From ab6ec9e770fb750ada03e15464d7cc58d126de1a Mon Sep 17 00:00:00 2001 From: yileifeng Date: Fri, 3 Jan 2025 17:34:23 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ramp4-pc?= =?UTF-8?q?ar4/story-ramp@434903f133b32fcb735ebb7683bcd09f4cc83e16=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...000000-0000-0000-0000-000000000000_en.json | 29 - .../{main-08UmyTTd.js => main-BlFeCTIx.js} | 6 +- toc-sublists/assets/panel-8LUl7gRb.js | 1 - toc-sublists/assets/panel-Benx66U4.js | 1 + .../{story-BT3RcN9w.js => story-3OAW3UcQ.js} | 600 +++++++++--------- toc-sublists/assets/story-Dqj6KyeR.css | 1 - toc-sublists/assets/story-iZZl0WHD.css | 1 + toc-sublists/index-ca-en.html | 2 +- toc-sublists/index-ca-fr.html | 2 +- toc-sublists/index.html | 2 +- 10 files changed, 308 insertions(+), 337 deletions(-) rename toc-sublists/assets/{main-08UmyTTd.js => main-BlFeCTIx.js} (99%) delete mode 100644 toc-sublists/assets/panel-8LUl7gRb.js create mode 100644 toc-sublists/assets/panel-Benx66U4.js rename toc-sublists/assets/{story-BT3RcN9w.js => story-3OAW3UcQ.js} (92%) delete mode 100644 toc-sublists/assets/story-Dqj6KyeR.css create mode 100644 toc-sublists/assets/story-iZZl0WHD.css diff --git a/toc-sublists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json b/toc-sublists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json index 070f732b..d58f3022 100644 --- a/toc-sublists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json +++ b/toc-sublists/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000_en.json @@ -13,35 +13,6 @@ "backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/bg.jpg" }, "slides": [ - { - "title": "Interactive Map with Zoomies", - "panel": [ - { - "config": "00000000-0000-0000-0000-000000000000/ramp-config/Locator_Map.json", - "type": "interactive-map", - "scrollguard": true, - "title": "Interactive Map with Zoom to Salish Sea", - "points": [ - { - "title": "Home Extent", - "text": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", - "target": { - "returnHome": true - } - }, - { - "title": "Point of Interest", - "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", - "target": { - "layerId": "Salish_Sea_Boundaries", - "oid": 1 - } - } - ], - "duration": 2000 - } - ] - }, { "title": "Overview", "backgroundImage": "00000000-0000-0000-0000-000000000000/assets/en/GettyImages-516166467__1554821531978__w1920.jpg", diff --git a/toc-sublists/assets/main-08UmyTTd.js b/toc-sublists/assets/main-BlFeCTIx.js similarity index 99% rename from toc-sublists/assets/main-08UmyTTd.js rename to toc-sublists/assets/main-BlFeCTIx.js index 3b0da60f..a09c7bdf 100644 --- a/toc-sublists/assets/main-08UmyTTd.js +++ b/toc-sublists/assets/main-BlFeCTIx.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-BT3RcN9w.js","./story-Dqj6KyeR.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-3OAW3UcQ.js","./story-iZZl0WHD.css"])))=>i.map(i=>d[i]); function op(t,e){for(var i=0;in[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function i(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(r){if(r.ep)return;r.ep=!0;const o=i(r);fetch(r.href,o)}})();/** * @vue/shared v3.4.38 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -28,7 +28,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * vue-router v4.4.3 * (c) 2024 Eduardo San Martin Morote * @license MIT - */const en=typeof document<"u";function Qv(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function es(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ne(r)?r.map(t):t(r)}return i}const Yn=()=>{},Ne=Array.isArray,Pf=/#/g,ty=/&/g,ey=/\//g,iy=/=/g,ny=/\?/g,kf=/\+/g,ry=/%5B/g,oy=/%5D/g,Lf=/%5E/g,sy=/%60/g,Mf=/%7B/g,ay=/%7C/g,If=/%7D/g,ly=/%20/g;function Da(t){return encodeURI(""+t).replace(ay,"|").replace(ry,"[").replace(oy,"]")}function cy(t){return Da(t).replace(Mf,"{").replace(If,"}").replace(Lf,"^")}function Bs(t){return Da(t).replace(kf,"%2B").replace(ly,"+").replace(Pf,"%23").replace(ty,"%26").replace(sy,"`").replace(Mf,"{").replace(If,"}").replace(Lf,"^")}function uy(t){return Bs(t).replace(iy,"%3D")}function hy(t){return Da(t).replace(Pf,"%23").replace(ny,"%3F")}function fy(t){return t==null?"":hy(t).replace(ey,"%2F")}function rr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const dy=/\/$/,py=t=>t.replace(dy,"");function is(t,e,i="/"){let n,r={},o="",s="";const u=e.indexOf("#");let l=e.indexOf("?");return u=0&&(l=-1),l>-1&&(n=e.slice(0,l),o=e.slice(l+1,u>-1?u:e.length),r=t(o)),u>-1&&(n=n||e.slice(0,u),s=e.slice(u,e.length)),n=yy(n??e,i),{fullPath:n+(o&&"?")+o+s,path:n,query:r,hash:rr(s)}}function gy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function Yl(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function my(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&vn(e.matched[n],i.matched[r])&&Rf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function vn(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Rf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!vy(t[i],e[i]))return!1;return!0}function vy(t,e){return Ne(t)?zl(t,e):Ne(e)?zl(e,t):t===e}function zl(t,e){return Ne(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function yy(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let o=i.length-1,s,u;for(s=0;s1&&o--;else break;return i.slice(0,o).join("/")+"/"+n.slice(s).join("/")}const fi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var or;(function(t){t.pop="pop",t.push="push"})(or||(or={}));var zn;(function(t){t.back="back",t.forward="forward",t.unknown=""})(zn||(zn={}));function xy(t){if(!t)if(en){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),py(t)}const by=/^[^#]+#/;function _y(t,e){return t.replace(by,"#")+e}function Ey(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const No=()=>({left:window.scrollX,top:window.scrollY});function wy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ey(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Kl(t,e){return(history.state?history.state.position-e:-1)+t}const Hs=new Map;function Cy(t,e){Hs.set(t,e)}function Sy(t){const e=Hs.get(t);return Hs.delete(t),e}let Ty=()=>location.protocol+"//"+location.host;function Nf(t,e){const{pathname:i,search:n,hash:r}=e,o=t.indexOf("#");if(o>-1){let u=r.includes(t.slice(o))?t.slice(o).length:1,l=r.slice(u);return l[0]!=="/"&&(l="/"+l),Yl(l,"")}return Yl(i,t)+n+r}function Oy(t,e,i,n){let r=[],o=[],s=null;const u=({state:E})=>{const b=Nf(t,location),O=i.value,x=e.value;let C=0;if(E){if(i.value=b,e.value=E,s&&s===O){s=null;return}C=x?E.position-x.position:0}else n(b);r.forEach(M=>{M(i.value,O,{delta:C,type:or.pop,direction:C?C>0?zn.forward:zn.back:zn.unknown})})};function l(){s=i.value}function A(E){r.push(E);const b=()=>{const O=r.indexOf(E);O>-1&&r.splice(O,1)};return o.push(b),b}function P(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:No()}),"")}function _(){for(const E of o)E();o=[],window.removeEventListener("popstate",u),window.removeEventListener("beforeunload",P)}return window.addEventListener("popstate",u),window.addEventListener("beforeunload",P,{passive:!0}),{pauseListeners:l,listen:A,destroy:_}}function ql(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?No():null}}function Ay(t){const{history:e,location:i}=window,n={value:Nf(t,i)},r={value:e.state};r.value||o(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(l,A,P){const _=t.indexOf("#"),E=_>-1?(i.host&&document.querySelector("base")?t:t.slice(_))+l:Ty()+t+l;try{e[P?"replaceState":"pushState"](A,"",E),r.value=A}catch(b){console.error(b),i[P?"replace":"assign"](E)}}function s(l,A){const P=Nt({},e.state,ql(r.value.back,l,r.value.forward,!0),A,{position:r.value.position});o(l,P,!0),n.value=l}function u(l,A){const P=Nt({},r.value,e.state,{forward:l,scroll:No()});o(P.current,P,!0);const _=Nt({},ql(n.value,l,null),{position:P.position+1},A);o(l,_,!1),n.value=l}return{location:n,state:r,push:u,replace:s}}function Py(t){t=xy(t);const e=Ay(t),i=Oy(t,e.state,e.location,e.replace);function n(o,s=!0){s||i.pauseListeners(),history.go(o)}const r=Nt({location:"",base:t,go:n,createHref:_y.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function ky(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),Py(t)}function Ly(t){return typeof t=="string"||t&&typeof t=="object"}function Df(t){return typeof t=="string"||typeof t=="symbol"}const jf=Symbol("");var Zl;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Zl||(Zl={}));function yn(t,e){return Nt(new Error,{type:t,[jf]:!0},e)}function Ke(t,e){return t instanceof Error&&jf in t&&(e==null||!!(t.type&e))}const Jl="[^/]+?",My={sensitive:!1,strict:!1,start:!0,end:!0},Iy=/[.+*?^${}()[\]/\\]/g;function Ry(t,e){const i=Nt({},My,e),n=[];let r=i.start?"^":"";const o=[];for(const A of t){const P=A.length?[]:[90];i.strict&&!A.length&&(r+="/");for(let _=0;_e.length?e.length===1&&e[0]===80?1:-1:0}function Ff(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const Dy={type:0,value:""},jy=/[a-zA-Z0-9_]/;function Fy(t){if(!t)return[[]];if(t==="/")return[[Dy]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${A}": ${b}`)}let i=0,n=i;const r=[];let o;function s(){o&&r.push(o),o=[]}let u=0,l,A="",P="";function _(){A&&(i===0?o.push({type:0,value:A}):i===1||i===2||i===3?(o.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${A}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:A,regexp:P,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),A="")}function E(){A+=l}for(;u{s(y)}:Yn}function s(_){if(Df(_)){const E=n.get(_);E&&(n.delete(_),i.splice(i.indexOf(E),1),E.children.forEach(s),E.alias.forEach(s))}else{const E=i.indexOf(_);E>-1&&(i.splice(E,1),_.record.name&&n.delete(_.record.name),_.children.forEach(s),_.alias.forEach(s))}}function u(){return i}function l(_){const E=Gy(_,i);i.splice(E,0,_),_.record.name&&!ec(_)&&n.set(_.record.name,_)}function A(_,E){let b,O={},x,C;if("name"in _&&_.name){if(b=n.get(_.name),!b)throw yn(1,{location:_});C=b.record.name,O=Nt(tc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),_.params&&tc(_.params,b.keys.map(y=>y.name))),x=b.stringify(O)}else if(_.path!=null)x=_.path,b=i.find(y=>y.re.test(x)),b&&(O=b.parse(x),C=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw yn(1,{location:_,currentLocation:E});C=b.record.name,O=Nt({},E.params,_.params),x=b.stringify(O)}const M=[];let L=b;for(;L;)M.unshift(L.record),L=L.parent;return{name:C,path:x,params:O,matched:M,meta:Wy(M)}}t.forEach(_=>o(_));function P(){i.length=0,n.clear()}return{addRoute:o,resolve:A,removeRoute:s,clearRoutes:P,getRoutes:u,getRecordMatcher:r}}function tc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function Vy(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:Uy(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function Uy(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function ec(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function Wy(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function ic(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function Gy(t,e){let i=0,n=e.length;for(;i!==n;){const o=i+n>>1;Ff(t,e[o])<0?n=o:i=o+1}const r=$y(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function $y(t){let e=t;for(;e=e.parent;)if(Bf(e)&&Ff(t,e)===0)return e}function Bf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function Xy(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;ro&&Bs(o)):[n&&Bs(n)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+i,o!=null&&(e+="="+o))})}return e}function Yy(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ne(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const zy=Symbol(""),rc=Symbol(""),ja=Symbol(""),Fa=Symbol(""),Vs=Symbol("");function Rn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function yi(t,e,i,n,r,o=s=>s()){const s=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((u,l)=>{const A=E=>{E===!1?l(yn(4,{from:i,to:e})):E instanceof Error?l(E):Ly(E)?l(yn(2,{from:e,to:E})):(s&&n.enterCallbacks[r]===s&&typeof E=="function"&&s.push(E),u())},P=o(()=>t.call(n&&n.instances[r],e,i,A));let _=Promise.resolve(P);t.length<3&&(_=_.then(A)),_.catch(E=>l(E))})}function ns(t,e,i,n,r=o=>o()){const o=[];for(const s of t)for(const u in s.components){let l=s.components[u];if(!(e!=="beforeRouteEnter"&&!s.instances[u]))if(Ky(l)){const P=(l.__vccOpts||l)[e];P&&o.push(yi(P,i,n,s,u,r))}else{let A=l();o.push(()=>A.then(P=>{if(!P)return Promise.reject(new Error(`Couldn't resolve component "${u}" at "${s.path}"`));const _=Qv(P)?P.default:P;s.components[u]=_;const b=(_.__vccOpts||_)[e];return b&&yi(b,i,n,s,u,r)()}))}}return o}function Ky(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function oc(t){const e=Se(ja),i=Se(Fa),n=Ut(()=>{const l=We(t.to);return e.resolve(l)}),r=Ut(()=>{const{matched:l}=n.value,{length:A}=l,P=l[A-1],_=i.matched;if(!P||!_.length)return-1;const E=_.findIndex(vn.bind(null,P));if(E>-1)return E;const b=sc(l[A-2]);return A>1&&sc(P)===b&&_[_.length-1].path!==b?_.findIndex(vn.bind(null,l[A-2])):E}),o=Ut(()=>r.value>-1&&Qy(i.params,n.value.params)),s=Ut(()=>r.value>-1&&r.value===i.matched.length-1&&Rf(i.params,n.value.params));function u(l={}){return Jy(l)?e[We(t.replace)?"replace":"push"](We(t.to)).catch(Yn):Promise.resolve()}return{route:n,href:Ut(()=>n.value.href),isActive:o,isExactActive:s,navigate:u}}const qy=De({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:oc,setup(t,{slots:e}){const i=qi(oc(t)),{options:n}=Se(ja),r=Ut(()=>({[ac(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[ac(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const o=e.default&&e.default(i);return t.custom?o:Ce("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},o)}}}),Zy=qy;function Jy(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function Qy(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ne(r)||r.length!==n.length||n.some((o,s)=>o!==r[s]))return!1}return!0}function sc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const ac=(t,e,i)=>t??e??i,t0=De({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Se(Vs),r=Ut(()=>t.route||n.value),o=Se(rc,0),s=Ut(()=>{let A=We(o);const{matched:P}=r.value;let _;for(;(_=P[A])&&!_.components;)A++;return A}),u=Ut(()=>r.value.matched[s.value]);Wn(rc,Ut(()=>s.value+1)),Wn(zy,u),Wn(Vs,r);const l=Xt();return ce(()=>[l.value,u.value,t.name],([A,P,_],[E,b,O])=>{P&&(P.instances[_]=A,b&&b!==P&&A&&A===E&&(P.leaveGuards.size||(P.leaveGuards=b.leaveGuards),P.updateGuards.size||(P.updateGuards=b.updateGuards))),A&&P&&(!b||!vn(P,b)||!E)&&(P.enterCallbacks[_]||[]).forEach(x=>x(A))},{flush:"post"}),()=>{const A=r.value,P=t.name,_=u.value,E=_&&_.components[P];if(!E)return lc(i.default,{Component:E,route:A});const b=_.props[P],O=b?b===!0?A.params:typeof b=="function"?b(A):b:null,C=Ce(E,Nt({},O,e,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(_.instances[P]=null)},ref:l}));return lc(i.default,{Component:C,route:A})||C}}});function lc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const e0=t0;function i0(t){const e=Hy(t.routes,t),i=t.parseQuery||Xy,n=t.stringifyQuery||nc,r=t.history,o=Rn(),s=Rn(),u=Rn(),l=gr(fi);let A=fi;en&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const P=es.bind(null,G=>""+G),_=es.bind(null,fy),E=es.bind(null,rr);function b(G,J){let w,W;return Df(G)?(w=e.getRecordMatcher(G),W=J):W=G,e.addRoute(W,w)}function O(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function x(){return e.getRoutes().map(G=>G.record)}function C(G){return!!e.getRecordMatcher(G)}function M(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=is(i,G,J.path),X=e.resolve({path:F.path},J),ot=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:rr(F.hash),redirectedFrom:void 0,href:ot})}let w;if(G.path!=null)w=Nt({},G,{path:is(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];w=Nt({},G,{params:_(F)}),J.params=_(J.params)}const W=e.resolve(w,J),B=G.hash||"";W.params=P(E(W.params));const Q=gy(n,Nt({},G,{hash:cy(B),path:W.path})),D=r.createHref(Q);return Nt({fullPath:Q,hash:B,query:n===nc?Yy(G.query):G.query||{}},W,{redirectedFrom:void 0,href:D})}function L(G){return typeof G=="string"?is(i,G,l.value.path):Nt({},G)}function y(G,J){if(A!==G)return yn(8,{from:J,to:G})}function a(G){return S(G)}function T(G){return a(Nt(L(G),{replace:!0}))}function m(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:w}=J;let W=typeof w=="function"?w(G):w;return typeof W=="string"&&(W=W.includes("?")||W.includes("#")?W=L(W):{path:W},W.params={}),Nt({query:G.query,hash:G.hash,params:W.path!=null?{}:G.params},W)}}function S(G,J){const w=A=M(G),W=l.value,B=G.state,Q=G.force,D=G.replace===!0,F=m(w);if(F)return S(Nt(L(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:Q,replace:D}),J||w);const X=w;X.redirectedFrom=J;let ot;return!Q&&my(n,W,w)&&(ot=yn(16,{to:X,from:W}),H(W,W,!0,!1)),(ot?Promise.resolve(ot):g(X,W)).catch(st=>Ke(st)?Ke(st,2)?st:it(st):$(st,X,W)).then(st=>{if(st){if(Ke(st,2))return S(Nt({replace:D},L(st.to),{state:typeof st.to=="object"?Nt({},B,st.to.state):B,force:Q}),J||X)}else st=v(X,W,!0,D,B);return h(X,W,st),st})}function f(G,J){const w=y(G,J);return w?Promise.reject(w):Promise.resolve()}function c(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let w;const[W,B,Q]=n0(G,J);w=ns(W.reverse(),"beforeRouteLeave",G,J);for(const F of W)F.leaveGuards.forEach(X=>{w.push(yi(X,G,J))});const D=f.bind(null,G,J);return w.push(D),K(w).then(()=>{w=[];for(const F of o.list())w.push(yi(F,G,J));return w.push(D),K(w)}).then(()=>{w=ns(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{w.push(yi(X,G,J))});return w.push(D),K(w)}).then(()=>{w=[];for(const F of Q)if(F.beforeEnter)if(Ne(F.beforeEnter))for(const X of F.beforeEnter)w.push(yi(X,G,J));else w.push(yi(F.beforeEnter,G,J));return w.push(D),K(w)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),w=ns(Q,"beforeRouteEnter",G,J,c),w.push(D),K(w))).then(()=>{w=[];for(const F of s.list())w.push(yi(F,G,J));return w.push(D),K(w)}).catch(F=>Ke(F,8)?F:Promise.reject(F))}function h(G,J,w){u.list().forEach(W=>c(()=>W(G,J,w)))}function v(G,J,w,W,B){const Q=y(G,J);if(Q)return Q;const D=J===fi,F=en?history.state:{};w&&(W||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,w,D),it()}let d;function p(){d||(d=r.listen((G,J,w)=>{if(!U.listening)return;const W=M(G),B=m(W);if(B){S(Nt(B,{replace:!0}),W).catch(Yn);return}A=W;const Q=l.value;en&&Cy(Kl(Q.fullPath,w.delta),No()),g(W,Q).catch(D=>Ke(D,12)?D:Ke(D,2)?(S(D.to,W).then(F=>{Ke(F,20)&&!w.delta&&w.type===or.pop&&r.go(-1,!1)}).catch(Yn),Promise.reject()):(w.delta&&r.go(-w.delta,!1),$(D,W,Q))).then(D=>{D=D||v(W,Q,!1),D&&(w.delta&&!Ke(D,8)?r.go(-w.delta,!1):w.type===or.pop&&Ke(D,20)&&r.go(-1,!1)),h(W,Q,D)}).catch(Yn)}))}let R=Rn(),I=Rn(),j;function $(G,J,w){it(G);const W=I.list();return W.length?W.forEach(B=>B(G,J,w)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==fi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,w])=>G?w(G):J()),R.reset()),G}function H(G,J,w,W){const{scrollBehavior:B}=t;if(!en||!B)return Promise.resolve();const Q=!w&&Sy(Kl(G.fullPath,0))||(W||!w)&&history.state&&history.state.scroll||null;return Pn().then(()=>B(G,J,Q)).then(D=>D&&wy(D)).catch(D=>$(D,G,J))}const Y=G=>r.go(G);let k;const N=new Set,U={currentRoute:l,listening:!0,addRoute:b,removeRoute:O,clearRoutes:e.clearRoutes,hasRoute:C,getRoutes:x,resolve:M,options:t,push:a,replace:T,go:Y,back:()=>Y(-1),forward:()=>Y(1),beforeEach:o.add,beforeResolve:s.add,afterEach:u.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",Zy),G.component("RouterView",e0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>We(l)}),en&&!k&&l.value===fi&&(k=!0,a(r.location).catch(B=>{}));const w={};for(const B in fi)Object.defineProperty(w,B,{get:()=>l.value[B],enumerable:!0});G.provide(ja,J),G.provide(Fa,fa(w)),G.provide(Vs,l);const W=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(A=fi,d&&d(),d=null,l.value=fi,k=!1,j=!1),W()}}};function K(G){return G.reduce((J,w)=>J.then(()=>c(w)),Promise.resolve())}return U}function n0(t,e){const i=[],n=[],r=[],o=Math.max(e.matched.length,t.matched.length);for(let s=0;svn(A,u))?n.push(u):i.push(u));const l=t.matched[s];l&&(e.matched.find(A=>vn(A,l))||r.push(l))}return[i,n,r]}function Kw(t){return Se(Fa)}const r0=[{path:"/",component:()=>ts(()=>import("./story-BT3RcN9w.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>ts(()=>import("./story-BT3RcN9w.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>ts(()=>import("./story-BT3RcN9w.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)}],o0=i0({routes:r0,history:ky(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! + */const en=typeof document<"u";function Qv(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function es(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ne(r)?r.map(t):t(r)}return i}const Yn=()=>{},Ne=Array.isArray,Pf=/#/g,ty=/&/g,ey=/\//g,iy=/=/g,ny=/\?/g,kf=/\+/g,ry=/%5B/g,oy=/%5D/g,Lf=/%5E/g,sy=/%60/g,Mf=/%7B/g,ay=/%7C/g,If=/%7D/g,ly=/%20/g;function Da(t){return encodeURI(""+t).replace(ay,"|").replace(ry,"[").replace(oy,"]")}function cy(t){return Da(t).replace(Mf,"{").replace(If,"}").replace(Lf,"^")}function Bs(t){return Da(t).replace(kf,"%2B").replace(ly,"+").replace(Pf,"%23").replace(ty,"%26").replace(sy,"`").replace(Mf,"{").replace(If,"}").replace(Lf,"^")}function uy(t){return Bs(t).replace(iy,"%3D")}function hy(t){return Da(t).replace(Pf,"%23").replace(ny,"%3F")}function fy(t){return t==null?"":hy(t).replace(ey,"%2F")}function rr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const dy=/\/$/,py=t=>t.replace(dy,"");function is(t,e,i="/"){let n,r={},o="",s="";const u=e.indexOf("#");let l=e.indexOf("?");return u=0&&(l=-1),l>-1&&(n=e.slice(0,l),o=e.slice(l+1,u>-1?u:e.length),r=t(o)),u>-1&&(n=n||e.slice(0,u),s=e.slice(u,e.length)),n=yy(n??e,i),{fullPath:n+(o&&"?")+o+s,path:n,query:r,hash:rr(s)}}function gy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function Yl(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function my(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&vn(e.matched[n],i.matched[r])&&Rf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function vn(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Rf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!vy(t[i],e[i]))return!1;return!0}function vy(t,e){return Ne(t)?zl(t,e):Ne(e)?zl(e,t):t===e}function zl(t,e){return Ne(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function yy(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let o=i.length-1,s,u;for(s=0;s1&&o--;else break;return i.slice(0,o).join("/")+"/"+n.slice(s).join("/")}const fi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var or;(function(t){t.pop="pop",t.push="push"})(or||(or={}));var zn;(function(t){t.back="back",t.forward="forward",t.unknown=""})(zn||(zn={}));function xy(t){if(!t)if(en){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),py(t)}const by=/^[^#]+#/;function _y(t,e){return t.replace(by,"#")+e}function Ey(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const No=()=>({left:window.scrollX,top:window.scrollY});function wy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ey(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Kl(t,e){return(history.state?history.state.position-e:-1)+t}const Hs=new Map;function Cy(t,e){Hs.set(t,e)}function Sy(t){const e=Hs.get(t);return Hs.delete(t),e}let Ty=()=>location.protocol+"//"+location.host;function Nf(t,e){const{pathname:i,search:n,hash:r}=e,o=t.indexOf("#");if(o>-1){let u=r.includes(t.slice(o))?t.slice(o).length:1,l=r.slice(u);return l[0]!=="/"&&(l="/"+l),Yl(l,"")}return Yl(i,t)+n+r}function Oy(t,e,i,n){let r=[],o=[],s=null;const u=({state:E})=>{const b=Nf(t,location),O=i.value,x=e.value;let C=0;if(E){if(i.value=b,e.value=E,s&&s===O){s=null;return}C=x?E.position-x.position:0}else n(b);r.forEach(M=>{M(i.value,O,{delta:C,type:or.pop,direction:C?C>0?zn.forward:zn.back:zn.unknown})})};function l(){s=i.value}function A(E){r.push(E);const b=()=>{const O=r.indexOf(E);O>-1&&r.splice(O,1)};return o.push(b),b}function P(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:No()}),"")}function _(){for(const E of o)E();o=[],window.removeEventListener("popstate",u),window.removeEventListener("beforeunload",P)}return window.addEventListener("popstate",u),window.addEventListener("beforeunload",P,{passive:!0}),{pauseListeners:l,listen:A,destroy:_}}function ql(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?No():null}}function Ay(t){const{history:e,location:i}=window,n={value:Nf(t,i)},r={value:e.state};r.value||o(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(l,A,P){const _=t.indexOf("#"),E=_>-1?(i.host&&document.querySelector("base")?t:t.slice(_))+l:Ty()+t+l;try{e[P?"replaceState":"pushState"](A,"",E),r.value=A}catch(b){console.error(b),i[P?"replace":"assign"](E)}}function s(l,A){const P=Nt({},e.state,ql(r.value.back,l,r.value.forward,!0),A,{position:r.value.position});o(l,P,!0),n.value=l}function u(l,A){const P=Nt({},r.value,e.state,{forward:l,scroll:No()});o(P.current,P,!0);const _=Nt({},ql(n.value,l,null),{position:P.position+1},A);o(l,_,!1),n.value=l}return{location:n,state:r,push:u,replace:s}}function Py(t){t=xy(t);const e=Ay(t),i=Oy(t,e.state,e.location,e.replace);function n(o,s=!0){s||i.pauseListeners(),history.go(o)}const r=Nt({location:"",base:t,go:n,createHref:_y.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function ky(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),Py(t)}function Ly(t){return typeof t=="string"||t&&typeof t=="object"}function Df(t){return typeof t=="string"||typeof t=="symbol"}const jf=Symbol("");var Zl;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Zl||(Zl={}));function yn(t,e){return Nt(new Error,{type:t,[jf]:!0},e)}function Ke(t,e){return t instanceof Error&&jf in t&&(e==null||!!(t.type&e))}const Jl="[^/]+?",My={sensitive:!1,strict:!1,start:!0,end:!0},Iy=/[.+*?^${}()[\]/\\]/g;function Ry(t,e){const i=Nt({},My,e),n=[];let r=i.start?"^":"";const o=[];for(const A of t){const P=A.length?[]:[90];i.strict&&!A.length&&(r+="/");for(let _=0;_e.length?e.length===1&&e[0]===80?1:-1:0}function Ff(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const Dy={type:0,value:""},jy=/[a-zA-Z0-9_]/;function Fy(t){if(!t)return[[]];if(t==="/")return[[Dy]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${A}": ${b}`)}let i=0,n=i;const r=[];let o;function s(){o&&r.push(o),o=[]}let u=0,l,A="",P="";function _(){A&&(i===0?o.push({type:0,value:A}):i===1||i===2||i===3?(o.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${A}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:A,regexp:P,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),A="")}function E(){A+=l}for(;u{s(y)}:Yn}function s(_){if(Df(_)){const E=n.get(_);E&&(n.delete(_),i.splice(i.indexOf(E),1),E.children.forEach(s),E.alias.forEach(s))}else{const E=i.indexOf(_);E>-1&&(i.splice(E,1),_.record.name&&n.delete(_.record.name),_.children.forEach(s),_.alias.forEach(s))}}function u(){return i}function l(_){const E=Gy(_,i);i.splice(E,0,_),_.record.name&&!ec(_)&&n.set(_.record.name,_)}function A(_,E){let b,O={},x,C;if("name"in _&&_.name){if(b=n.get(_.name),!b)throw yn(1,{location:_});C=b.record.name,O=Nt(tc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),_.params&&tc(_.params,b.keys.map(y=>y.name))),x=b.stringify(O)}else if(_.path!=null)x=_.path,b=i.find(y=>y.re.test(x)),b&&(O=b.parse(x),C=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw yn(1,{location:_,currentLocation:E});C=b.record.name,O=Nt({},E.params,_.params),x=b.stringify(O)}const M=[];let L=b;for(;L;)M.unshift(L.record),L=L.parent;return{name:C,path:x,params:O,matched:M,meta:Wy(M)}}t.forEach(_=>o(_));function P(){i.length=0,n.clear()}return{addRoute:o,resolve:A,removeRoute:s,clearRoutes:P,getRoutes:u,getRecordMatcher:r}}function tc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function Vy(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:Uy(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function Uy(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function ec(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function Wy(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function ic(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function Gy(t,e){let i=0,n=e.length;for(;i!==n;){const o=i+n>>1;Ff(t,e[o])<0?n=o:i=o+1}const r=$y(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function $y(t){let e=t;for(;e=e.parent;)if(Bf(e)&&Ff(t,e)===0)return e}function Bf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function Xy(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;ro&&Bs(o)):[n&&Bs(n)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+i,o!=null&&(e+="="+o))})}return e}function Yy(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ne(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const zy=Symbol(""),rc=Symbol(""),ja=Symbol(""),Fa=Symbol(""),Vs=Symbol("");function Rn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function yi(t,e,i,n,r,o=s=>s()){const s=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((u,l)=>{const A=E=>{E===!1?l(yn(4,{from:i,to:e})):E instanceof Error?l(E):Ly(E)?l(yn(2,{from:e,to:E})):(s&&n.enterCallbacks[r]===s&&typeof E=="function"&&s.push(E),u())},P=o(()=>t.call(n&&n.instances[r],e,i,A));let _=Promise.resolve(P);t.length<3&&(_=_.then(A)),_.catch(E=>l(E))})}function ns(t,e,i,n,r=o=>o()){const o=[];for(const s of t)for(const u in s.components){let l=s.components[u];if(!(e!=="beforeRouteEnter"&&!s.instances[u]))if(Ky(l)){const P=(l.__vccOpts||l)[e];P&&o.push(yi(P,i,n,s,u,r))}else{let A=l();o.push(()=>A.then(P=>{if(!P)return Promise.reject(new Error(`Couldn't resolve component "${u}" at "${s.path}"`));const _=Qv(P)?P.default:P;s.components[u]=_;const b=(_.__vccOpts||_)[e];return b&&yi(b,i,n,s,u,r)()}))}}return o}function Ky(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function oc(t){const e=Se(ja),i=Se(Fa),n=Ut(()=>{const l=We(t.to);return e.resolve(l)}),r=Ut(()=>{const{matched:l}=n.value,{length:A}=l,P=l[A-1],_=i.matched;if(!P||!_.length)return-1;const E=_.findIndex(vn.bind(null,P));if(E>-1)return E;const b=sc(l[A-2]);return A>1&&sc(P)===b&&_[_.length-1].path!==b?_.findIndex(vn.bind(null,l[A-2])):E}),o=Ut(()=>r.value>-1&&Qy(i.params,n.value.params)),s=Ut(()=>r.value>-1&&r.value===i.matched.length-1&&Rf(i.params,n.value.params));function u(l={}){return Jy(l)?e[We(t.replace)?"replace":"push"](We(t.to)).catch(Yn):Promise.resolve()}return{route:n,href:Ut(()=>n.value.href),isActive:o,isExactActive:s,navigate:u}}const qy=De({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:oc,setup(t,{slots:e}){const i=qi(oc(t)),{options:n}=Se(ja),r=Ut(()=>({[ac(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[ac(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const o=e.default&&e.default(i);return t.custom?o:Ce("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},o)}}}),Zy=qy;function Jy(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function Qy(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ne(r)||r.length!==n.length||n.some((o,s)=>o!==r[s]))return!1}return!0}function sc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const ac=(t,e,i)=>t??e??i,t0=De({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Se(Vs),r=Ut(()=>t.route||n.value),o=Se(rc,0),s=Ut(()=>{let A=We(o);const{matched:P}=r.value;let _;for(;(_=P[A])&&!_.components;)A++;return A}),u=Ut(()=>r.value.matched[s.value]);Wn(rc,Ut(()=>s.value+1)),Wn(zy,u),Wn(Vs,r);const l=Xt();return ce(()=>[l.value,u.value,t.name],([A,P,_],[E,b,O])=>{P&&(P.instances[_]=A,b&&b!==P&&A&&A===E&&(P.leaveGuards.size||(P.leaveGuards=b.leaveGuards),P.updateGuards.size||(P.updateGuards=b.updateGuards))),A&&P&&(!b||!vn(P,b)||!E)&&(P.enterCallbacks[_]||[]).forEach(x=>x(A))},{flush:"post"}),()=>{const A=r.value,P=t.name,_=u.value,E=_&&_.components[P];if(!E)return lc(i.default,{Component:E,route:A});const b=_.props[P],O=b?b===!0?A.params:typeof b=="function"?b(A):b:null,C=Ce(E,Nt({},O,e,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(_.instances[P]=null)},ref:l}));return lc(i.default,{Component:C,route:A})||C}}});function lc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const e0=t0;function i0(t){const e=Hy(t.routes,t),i=t.parseQuery||Xy,n=t.stringifyQuery||nc,r=t.history,o=Rn(),s=Rn(),u=Rn(),l=gr(fi);let A=fi;en&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const P=es.bind(null,G=>""+G),_=es.bind(null,fy),E=es.bind(null,rr);function b(G,J){let w,W;return Df(G)?(w=e.getRecordMatcher(G),W=J):W=G,e.addRoute(W,w)}function O(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function x(){return e.getRoutes().map(G=>G.record)}function C(G){return!!e.getRecordMatcher(G)}function M(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=is(i,G,J.path),X=e.resolve({path:F.path},J),ot=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:rr(F.hash),redirectedFrom:void 0,href:ot})}let w;if(G.path!=null)w=Nt({},G,{path:is(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];w=Nt({},G,{params:_(F)}),J.params=_(J.params)}const W=e.resolve(w,J),B=G.hash||"";W.params=P(E(W.params));const Q=gy(n,Nt({},G,{hash:cy(B),path:W.path})),D=r.createHref(Q);return Nt({fullPath:Q,hash:B,query:n===nc?Yy(G.query):G.query||{}},W,{redirectedFrom:void 0,href:D})}function L(G){return typeof G=="string"?is(i,G,l.value.path):Nt({},G)}function y(G,J){if(A!==G)return yn(8,{from:J,to:G})}function a(G){return S(G)}function T(G){return a(Nt(L(G),{replace:!0}))}function m(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:w}=J;let W=typeof w=="function"?w(G):w;return typeof W=="string"&&(W=W.includes("?")||W.includes("#")?W=L(W):{path:W},W.params={}),Nt({query:G.query,hash:G.hash,params:W.path!=null?{}:G.params},W)}}function S(G,J){const w=A=M(G),W=l.value,B=G.state,Q=G.force,D=G.replace===!0,F=m(w);if(F)return S(Nt(L(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:Q,replace:D}),J||w);const X=w;X.redirectedFrom=J;let ot;return!Q&&my(n,W,w)&&(ot=yn(16,{to:X,from:W}),H(W,W,!0,!1)),(ot?Promise.resolve(ot):g(X,W)).catch(st=>Ke(st)?Ke(st,2)?st:it(st):$(st,X,W)).then(st=>{if(st){if(Ke(st,2))return S(Nt({replace:D},L(st.to),{state:typeof st.to=="object"?Nt({},B,st.to.state):B,force:Q}),J||X)}else st=v(X,W,!0,D,B);return h(X,W,st),st})}function f(G,J){const w=y(G,J);return w?Promise.reject(w):Promise.resolve()}function c(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let w;const[W,B,Q]=n0(G,J);w=ns(W.reverse(),"beforeRouteLeave",G,J);for(const F of W)F.leaveGuards.forEach(X=>{w.push(yi(X,G,J))});const D=f.bind(null,G,J);return w.push(D),K(w).then(()=>{w=[];for(const F of o.list())w.push(yi(F,G,J));return w.push(D),K(w)}).then(()=>{w=ns(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{w.push(yi(X,G,J))});return w.push(D),K(w)}).then(()=>{w=[];for(const F of Q)if(F.beforeEnter)if(Ne(F.beforeEnter))for(const X of F.beforeEnter)w.push(yi(X,G,J));else w.push(yi(F.beforeEnter,G,J));return w.push(D),K(w)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),w=ns(Q,"beforeRouteEnter",G,J,c),w.push(D),K(w))).then(()=>{w=[];for(const F of s.list())w.push(yi(F,G,J));return w.push(D),K(w)}).catch(F=>Ke(F,8)?F:Promise.reject(F))}function h(G,J,w){u.list().forEach(W=>c(()=>W(G,J,w)))}function v(G,J,w,W,B){const Q=y(G,J);if(Q)return Q;const D=J===fi,F=en?history.state:{};w&&(W||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,w,D),it()}let d;function p(){d||(d=r.listen((G,J,w)=>{if(!U.listening)return;const W=M(G),B=m(W);if(B){S(Nt(B,{replace:!0}),W).catch(Yn);return}A=W;const Q=l.value;en&&Cy(Kl(Q.fullPath,w.delta),No()),g(W,Q).catch(D=>Ke(D,12)?D:Ke(D,2)?(S(D.to,W).then(F=>{Ke(F,20)&&!w.delta&&w.type===or.pop&&r.go(-1,!1)}).catch(Yn),Promise.reject()):(w.delta&&r.go(-w.delta,!1),$(D,W,Q))).then(D=>{D=D||v(W,Q,!1),D&&(w.delta&&!Ke(D,8)?r.go(-w.delta,!1):w.type===or.pop&&Ke(D,20)&&r.go(-1,!1)),h(W,Q,D)}).catch(Yn)}))}let R=Rn(),I=Rn(),j;function $(G,J,w){it(G);const W=I.list();return W.length?W.forEach(B=>B(G,J,w)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==fi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,w])=>G?w(G):J()),R.reset()),G}function H(G,J,w,W){const{scrollBehavior:B}=t;if(!en||!B)return Promise.resolve();const Q=!w&&Sy(Kl(G.fullPath,0))||(W||!w)&&history.state&&history.state.scroll||null;return Pn().then(()=>B(G,J,Q)).then(D=>D&&wy(D)).catch(D=>$(D,G,J))}const Y=G=>r.go(G);let k;const N=new Set,U={currentRoute:l,listening:!0,addRoute:b,removeRoute:O,clearRoutes:e.clearRoutes,hasRoute:C,getRoutes:x,resolve:M,options:t,push:a,replace:T,go:Y,back:()=>Y(-1),forward:()=>Y(1),beforeEach:o.add,beforeResolve:s.add,afterEach:u.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",Zy),G.component("RouterView",e0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>We(l)}),en&&!k&&l.value===fi&&(k=!0,a(r.location).catch(B=>{}));const w={};for(const B in fi)Object.defineProperty(w,B,{get:()=>l.value[B],enumerable:!0});G.provide(ja,J),G.provide(Fa,fa(w)),G.provide(Vs,l);const W=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(A=fi,d&&d(),d=null,l.value=fi,k=!1,j=!1),W()}}};function K(G){return G.reduce((J,w)=>J.then(()=>c(w)),Promise.resolve())}return U}function n0(t,e){const i=[],n=[],r=[],o=Math.max(e.matched.length,t.matched.length);for(let s=0;svn(A,u))?n.push(u):i.push(u));const l=t.matched[s];l&&(e.matched.find(A=>vn(A,l))||r.push(l))}return[i,n,r]}function Kw(t){return Se(Fa)}const r0=[{path:"/",component:()=>ts(()=>import("./story-3OAW3UcQ.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>ts(()=>import("./story-3OAW3UcQ.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>ts(()=>import("./story-3OAW3UcQ.js").then(t=>t.s),__vite__mapDeps([0,1]),import.meta.url)}],o0=i0({routes:r0,history:ky(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! * shared v9.14.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. @@ -70,4 +70,4 @@ License: MIT * screenfull * v5.1.0 - 2020-12-24 * (c) Sindre Sorhus; MIT License -*/(function(t){var e,i,n,r,o;e=typeof window<"u"&&window.document!==void 0?window.document:{},i=t.exports,n=function(){for(var s,u=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],l=0,A=u.length,P={};lt.pageOnly||!Je.isEnabled),o=Ut(()=>(r.value||t.teleport)&&n.isFullscreen?{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}:void 0);function s(){e("change",n.isFullscreen),e("update:modelValue",n.isFullscreen),e("update:fullscreen",n.isFullscreen)}function u(){Je.isFullscreen||Je.off("change",u),n.isFullscreen=Je.isFullscreen,s()}function l(E){E.key==="Escape"&&P()}function A(){r.value?(n.isFullscreen=!0,s(),document.removeEventListener("keyup",l),document.addEventListener("keyup",l)):(Je.off("change",u),Je.on("change",u),Je.request(t.teleport?document.body:i.value))}function P(){n.isFullscreen&&(r.value?(n.isFullscreen=!1,s(),document.removeEventListener("keyup",l)):Je.exit())}return ce(()=>t.fullscreen,E=>{E!==n.isFullscreen&&(E?A():P())}),ce(()=>t.modelValue,E=>{E!==n.isFullscreen&&(E?A():P())}),_=((E,b)=>{for(var O in b||(b={}))Vd.call(b,O)&&lu(E,O,b[O]);if(vo)for(var O of vo(b))Ud.call(b,O)&&lu(E,O,b[O]);return E})({wrapper:i,wrapperStyle:o},Ju(n)),hE(_,fE({toggle:function(E){E===void 0?n.isFullscreen?P():A():E?A():P()},request:A,exit:P,shadeClick:function(E){E.target===i.value&&t.exitOnClickWrapper&&P()}}));var _}});ep.render=function(t,e,i,n,r,o){return Xi(),yr(Lh,{to:"body",disabled:!t.teleport||!t.fullscreen},[jt("div",La({ref:"wrapper"},t.$attrs,{style:t.wrapperStyle,class:{[t.fullscreenClass]:t.isFullscreen},onClick:e[1]||(e[1]=s=>t.shadeClick(s))}),[vh(t.$slots,"default")],16)],8,["disabled"])};const Uw=typeof window<"u"&&window!==null;(function(){if(Uw&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0})();const Ww=Object.prototype.propertyIsEnumerable,_u=Object.getOwnPropertySymbols;function Kr(t){return typeof t=="function"||toString.call(t)==="[object Object]"}function Gw(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"}function $w(t,...e){if(!Kr(t))throw new TypeError("expected the first argument to be an object");if(e.length===0||typeof Symbol!="function"||typeof _u!="function")return t;for(const i of e){const n=_u(i);for(const r of n)Ww.call(i,r)&&(t[r]=i[r])}return t}function nl(t,...e){let i=0;var n;for((typeof(n=t)=="object"?n===null:typeof n!="function")&&(t=e[i++]),t||(t={});i{n.key==="Escape"&&(document.removeEventListener("keyup",i),this.exit())};return this.isFullscreen=!0,this.element=t,document.removeEventListener("keyup",i),document.addEventListener("keyup",i),this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()}{const i=()=>{Fe.isFullscreen||(Fe.off("change",i),wu(this)),this.isFullscreen=Fe.isFullscreen,this.options.teleport?this.element=t||null:this.element=Fe.element,this.options.callback&&this.options.callback(Fe.isFullscreen)};return Fe.on("change",i),Fe.request(this.options.teleport?document.body:t)}},exit(){return this.isFullscreen?this.options.pageOnly?(wu(this),this.isFullscreen=!1,this.element=null,this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()):Fe.exit():Promise.resolve()}},Xw=(t,e,i)=>{const n=()=>{let r;const o={teleport:e.modifiers.teleport,pageOnly:e.modifiers.pageOnly};if(e.value)if(typeof e.value=="string")r=e.value;else{const s=e.value,{target:u}=s,l=((A,P)=>{var _={};for(var E in A)Vd.call(A,E)&&P.indexOf(E)<0&&(_[E]=A[E]);if(A!=null&&vo)for(var E of vo(A))P.indexOf(E)<0&&Ud.call(A,E)&&(_[E]=A[E]);return _})(s,["target"]);r=u,nl(o,l)}typeof r=="string"&&(r=document.querySelector(r)),np.toggle(r,o)};t._onClickFullScreen&&t.removeEventListener("click",t._onClickFullScreen),t.addEventListener("click",n),t._onClickFullScreen=n};var Yw={install(t,{name:e="fullscreen"}={}){t.config.globalProperties[`$${e}`]=np,t.component(e,Vw(ep,{name:e})),t.directive(e,Xw)}};const xo=co(qv);xo.use(o0).use(ab).use(rE,{tagName:"charts"}).use(J_,{directive:"tippy",component:"tippy"}).use(cE).use(Yw);xo.provide("$papa",xo.config.globalProperties.$papa);xo.mount("#app");export{jd as A,Mo as B,sm as C,bg as D,Pa as E,Yt as F,dr as G,co as H,Ce as I,J_ as J,ab as K,We as L,np as M,ue as N,Kw as O,ko as P,Wn as Q,Pn as R,kn as S,Ma as T,Xe as U,Se as V,eE as W,gg as X,ts as Y,Zm as Z,Yv as _,_g as a,Cm as b,qh as c,De as d,Aa as e,yr as f,ya as g,vh as h,Xt as i,Ut as j,ce as k,ci as l,Eg as m,pr as n,Xi as o,jt as p,wm as q,gh as r,ug as s,ku as t,$a as u,ff as v,dg as w,hg as x,qi as y,tE as z}; +*/(function(t){var e,i,n,r,o;e=typeof window<"u"&&window.document!==void 0?window.document:{},i=t.exports,n=function(){for(var s,u=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],l=0,A=u.length,P={};lt.pageOnly||!Je.isEnabled),o=Ut(()=>(r.value||t.teleport)&&n.isFullscreen?{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}:void 0);function s(){e("change",n.isFullscreen),e("update:modelValue",n.isFullscreen),e("update:fullscreen",n.isFullscreen)}function u(){Je.isFullscreen||Je.off("change",u),n.isFullscreen=Je.isFullscreen,s()}function l(E){E.key==="Escape"&&P()}function A(){r.value?(n.isFullscreen=!0,s(),document.removeEventListener("keyup",l),document.addEventListener("keyup",l)):(Je.off("change",u),Je.on("change",u),Je.request(t.teleport?document.body:i.value))}function P(){n.isFullscreen&&(r.value?(n.isFullscreen=!1,s(),document.removeEventListener("keyup",l)):Je.exit())}return ce(()=>t.fullscreen,E=>{E!==n.isFullscreen&&(E?A():P())}),ce(()=>t.modelValue,E=>{E!==n.isFullscreen&&(E?A():P())}),_=((E,b)=>{for(var O in b||(b={}))Vd.call(b,O)&&lu(E,O,b[O]);if(vo)for(var O of vo(b))Ud.call(b,O)&&lu(E,O,b[O]);return E})({wrapper:i,wrapperStyle:o},Ju(n)),hE(_,fE({toggle:function(E){E===void 0?n.isFullscreen?P():A():E?A():P()},request:A,exit:P,shadeClick:function(E){E.target===i.value&&t.exitOnClickWrapper&&P()}}));var _}});ep.render=function(t,e,i,n,r,o){return Xi(),yr(Lh,{to:"body",disabled:!t.teleport||!t.fullscreen},[jt("div",La({ref:"wrapper"},t.$attrs,{style:t.wrapperStyle,class:{[t.fullscreenClass]:t.isFullscreen},onClick:e[1]||(e[1]=s=>t.shadeClick(s))}),[vh(t.$slots,"default")],16)],8,["disabled"])};const Uw=typeof window<"u"&&window!==null;(function(){if(Uw&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return this.intersectionRatio>0}}),!0})();const Ww=Object.prototype.propertyIsEnumerable,_u=Object.getOwnPropertySymbols;function Kr(t){return typeof t=="function"||toString.call(t)==="[object Object]"}function Gw(t){return t!=="__proto__"&&t!=="constructor"&&t!=="prototype"}function $w(t,...e){if(!Kr(t))throw new TypeError("expected the first argument to be an object");if(e.length===0||typeof Symbol!="function"||typeof _u!="function")return t;for(const i of e){const n=_u(i);for(const r of n)Ww.call(i,r)&&(t[r]=i[r])}return t}function nl(t,...e){let i=0;var n;for((typeof(n=t)=="object"?n===null:typeof n!="function")&&(t=e[i++]),t||(t={});i{n.key==="Escape"&&(document.removeEventListener("keyup",i),this.exit())};return this.isFullscreen=!0,this.element=t,document.removeEventListener("keyup",i),document.addEventListener("keyup",i),this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()}{const i=()=>{Fe.isFullscreen||(Fe.off("change",i),wu(this)),this.isFullscreen=Fe.isFullscreen,this.options.teleport?this.element=t||null:this.element=Fe.element,this.options.callback&&this.options.callback(Fe.isFullscreen)};return Fe.on("change",i),Fe.request(this.options.teleport?document.body:t)}},exit(){return this.isFullscreen?this.options.pageOnly?(wu(this),this.isFullscreen=!1,this.element=null,this.options.callback&&this.options.callback(this.isFullscreen),Promise.resolve()):Fe.exit():Promise.resolve()}},Xw=(t,e,i)=>{const n=()=>{let r;const o={teleport:e.modifiers.teleport,pageOnly:e.modifiers.pageOnly};if(e.value)if(typeof e.value=="string")r=e.value;else{const s=e.value,{target:u}=s,l=((A,P)=>{var _={};for(var E in A)Vd.call(A,E)&&P.indexOf(E)<0&&(_[E]=A[E]);if(A!=null&&vo)for(var E of vo(A))P.indexOf(E)<0&&Ud.call(A,E)&&(_[E]=A[E]);return _})(s,["target"]);r=u,nl(o,l)}typeof r=="string"&&(r=document.querySelector(r)),np.toggle(r,o)};t._onClickFullScreen&&t.removeEventListener("click",t._onClickFullScreen),t.addEventListener("click",n),t._onClickFullScreen=n};var Yw={install(t,{name:e="fullscreen"}={}){t.config.globalProperties[`$${e}`]=np,t.component(e,Vw(ep,{name:e})),t.directive(e,Xw)}};const xo=co(qv);xo.use(o0).use(ab).use(rE,{tagName:"charts"}).use(J_,{directive:"tippy",component:"tippy"}).use(cE).use(Yw);xo.provide("$papa",xo.config.globalProperties.$papa);xo.mount("#app");export{tE as A,jd as B,sm as C,bg as D,Pa as E,Yt as F,dr as G,co as H,Ce as I,J_ as J,ab as K,We as L,np as M,ue as N,Kw as O,ko as P,Wn as Q,Pn as R,kn as S,Ma as T,Xe as U,Se as V,eE as W,gg as X,ts as Y,Zm as Z,Yv as _,_g as a,Cm as b,qh as c,De as d,Aa as e,yr as f,ya as g,vh as h,Xt as i,Ut as j,ce as k,ci as l,Eg as m,pr as n,Xi as o,jt as p,wm as q,gh as r,ug as s,ku as t,$a as u,ff as v,dg as w,hg as x,Mo as y,qi as z}; diff --git a/toc-sublists/assets/panel-8LUl7gRb.js b/toc-sublists/assets/panel-8LUl7gRb.js deleted file mode 100644 index d3570d0a..00000000 --- a/toc-sublists/assets/panel-8LUl7gRb.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./story-BT3RcN9w.js";import"./main-08UmyTTd.js";export{m as default}; diff --git a/toc-sublists/assets/panel-Benx66U4.js b/toc-sublists/assets/panel-Benx66U4.js new file mode 100644 index 00000000..70b29c98 --- /dev/null +++ b/toc-sublists/assets/panel-Benx66U4.js @@ -0,0 +1 @@ +import{_ as m}from"./story-3OAW3UcQ.js";import"./main-BlFeCTIx.js";export{m as default}; diff --git a/toc-sublists/assets/story-BT3RcN9w.js b/toc-sublists/assets/story-3OAW3UcQ.js similarity index 92% rename from toc-sublists/assets/story-BT3RcN9w.js rename to toc-sublists/assets/story-3OAW3UcQ.js index daf766c0..3f99107a 100644 --- a/toc-sublists/assets/story-BT3RcN9w.js +++ b/toc-sublists/assets/story-3OAW3UcQ.js @@ -1,8 +1,8 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./panel-8LUl7gRb.js","./main-08UmyTTd.js","./main-CicOJsn7.css"])))=>i.map(i=>d[i]); -import{d as da,u as uTt,r as sY,a as oY,o as pr,c as wr,w as Sm,n as Jl,b as xc,e as Tr,t as Zh,f as Vv,g as Wp,h as bUe,i as Cn,j as oc,k as G8,l as Tg,v as kP,F as Vc,m as lh,p as _h,q as cTt,s as Dxe,x as Fxe,_ as Ux,y as zC,T as uci,z as cci,A as jB,B as hci,C as dci,D as wUe,E as U8,G as ja,H as pci,I as ji,J as fci,K as mci,L as wf,M as Ztt,N as kxe,O as Lxe,P as gci,Q as gM,R as yci,S as vci,U as Qtt,V as ag,W as _ci,X as bci,Y as wci,Z as xUe}from"./main-08UmyTTd.js";const xci={key:0,class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#fff",stroke:"#878787"},Sci=Tr("path",{d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974"},null,-1),Tci=[Sci],Cci={key:0,class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#fff",stroke:"#878787"},Eci=Tr("path",{d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974"},null,-1),Ici=[Eci],LP=da({__name:"toc-item",props:{tocItem:{type:Object,required:!0},slides:{type:Array,required:!0},parentItem:{type:Boolean,required:!1,default:!0},verticalToc:{type:Boolean,required:!1,default:!0},mobile:{type:Boolean,required:!1,default:!1},plugin:{type:Boolean,required:!0},returnTop:{type:Boolean,required:!1,default:!1}},setup(i){const{t:e}=uTt(),t=i,r=o=>{const a=document.getElementById(o);a&&a.scrollIntoView({behavior:"smooth"})},n=o=>o.title!==""?o.title:e("chapters.untitled"),s=o=>{const a=t.slides.find((l,u)=>u===o);return a?`${o}-${a.title.toLowerCase().replaceAll(" ","-")}`:""};return(o,a)=>{const l=sY("router-link"),u=oY("tippy");return pr(),wr("div",{class:Jl({flex:i.parentItem})},[i.plugin?Sm((pr(),wr("a",{key:0,class:Jl(["flex items-center px-2 py-1 mx-1 cursor-pointer",{"flex-grow pb-2 min-w-0":i.parentItem,"pb-2":i.parentItem&&!i.verticalToc}]),onClick:a[0]||(a[0]=c=>r(s(i.tocItem.slideIndex)))},[i.verticalToc?(pr(),wr("svg",xci,Tci)):xc("",!0),Tr("span",{class:Jl(["flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap",{"ml-4":i.verticalToc&&i.parentItem,"pl-8":i.verticalToc&&!i.parentItem}])},Zh(n(i.tocItem)),3)],2)),[[u,{delay:"200",placement:"right",content:n(i.tocItem),animateFill:!0,animation:"chapter-menu"}]]):Sm((pr(),Vv(l,{key:1,to:{hash:`#${s(i.tocItem.slideIndex)}`},class:Jl(["flex items-center px-2 py-1 mx-1",{"flex-grow min-w-0":i.parentItem,"pb-2":i.parentItem&&!i.verticalToc}]),target:""},{default:Wp(()=>[i.verticalToc?(pr(),wr("svg",Cci,Ici)):xc("",!0),Tr("span",{class:Jl(["flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap",{"ml-4":i.verticalToc&&i.parentItem,"pl-8":i.verticalToc&&!i.parentItem}])},Zh(n(i.tocItem)),3)]),_:1},8,["to","class"])),[[u,{delay:"200",placement:"right",content:n(i.tocItem),animateFill:!0,animation:"chapter-menu"}]]),bUe(o.$slots,"default")],2)}}}),Hoe=i=>(Dxe("data-v-8655b2ad"),i=i(),Fxe(),i),Aci={class:"sticky w-12 duration-500 ease-in-out transition-width"},Mci={class:"flex px-3 py-2"},Oci=["aria-label"],Pci={class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"#707070"},Rci=["d"],Dci=["d"],Fci=Hoe(()=>Tr("path",{d:"m3.5 17h17"},null,-1)),kci={class:"flex items-center mt-3 py-4 w-72 bg-white"},Lci={class:"flex-2 pl-2 ml-4 leading-normal"},Nci=["aria-label"],$ci=Hoe(()=>Tr("svg",{class:"flex-shrink-0 mr-4",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#c0c0c0",stroke:"#c0c0c0"},[Tr("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"})],-1)),Bci=[$ci],jci={class:"dropdown-nav-content bg-white pb-10 w-72 z-10 border-r border-gray-200"},Gci={key:0},Uci=cTt('',1),zci={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Vci=Hoe(()=>Tr("svg",{class:"flex-shrink-0",viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"#fff",stroke:"#878787",xmlns:"http://www.w3.org/2000/svg"},[Tr("path",{"data-v-689fab2c":"",d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974",style:{fill:"rgba(255, 255, 255, 0)","fill-opacity":"0"},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"}),Tr("g",{transform:"matrix(1, 0, 0, 1, 0.07912001013755887, 1.1142139434814453)"},[Tr("polygon",{points:"11.956 9.662 9.522 12.097 9.862 12.437 11.956 10.344 14.049 12.437 14.39 12.097",style:{}}),Tr("path",{style:{fill:"rgb(135, 135, 135)","stroke-width":"1.5px"},d:"M 11.917 10.545 L 11.917 15.649"})]),Tr("rect",{x:"9.114",y:"8.74",width:"5.842",height:"0.487",style:{},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"})],-1)),Hci={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Wci=["aria-label","onClick"],qci={key:0,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:"rotate-180"},Yci=Hoe(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Xci=[Yci],Jci={key:1,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},Kci=Hoe(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Zci=[Kci],Qci={class:"dropdown-menu"},ehi=da({__name:"mobile-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Cn(!1),r=Cn(!0),n=Cn(-1),s=Cn({}),o=oc(()=>{const h=e.slides.map((p,m)=>({...p,index:m}));return e.customToc||h.filter(p=>p.includeInToc!==!1),h});G8(()=>e.activeChapterIndex,()=>{c()}),Tg(()=>{const h=document.getElementById("intro");r.value=!!h,e.customToc&&e.customToc.forEach((p,m)=>{s.value[m]=!1})});const a=h=>{const p=document.getElementById(h);p&&p.scrollIntoView({behavior:"smooth"})},l=h=>{s.value[h]=!s.value[h]},u=h=>s.value[h],c=()=>{const h=o.value.filter(p=>p.index<=e.activeChapterIndex);n.value=h.length?h[h.length-1].index:-1};return(h,p)=>{const m=sY("router-link");return pr(),wr("div",Aci,[Tr("div",Mci,[Tr("button",{onClick:p[0]||(p[0]=v=>t.value=!t.value),"aria-label":h.$t("chapters.menu")},[(pr(),wr("svg",Pci,[Tr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 7h${t.value?"17":"8.5"}`},null,8,Rci),Tr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 12h${t.value?"17":"8.5"}`},null,8,Dci),Fci]))],8,Oci)]),Sm(Tr("div",kci,[Tr("span",Lci,Zh(h.$t("chapters.title")),1),Tr("button",{onClick:p[1]||(p[1]=v=>t.value=!t.value),"aria-label":h.$t("chapters.menu")},Bci,8,Nci)],512),[[kP,t.value]]),Sm(Tr("ul",jci,[r.value&&i.returnToTop?(pr(),wr("li",Gci,[i.plugin?(pr(),wr("a",{key:0,class:"flex py-1 px-3",onClick:p[2]||(p[2]=v=>a("intro"))},[Uci,Tr("span",zci,Zh(h.$t("chapters.return")),1)])):(pr(),Vv(m,{key:1,to:{hash:"#intro"},class:"flex py-1 px-3",target:""},{default:Wp(()=>[Vci,Tr("span",Hci,Zh(h.$t("chapters.return")),1)]),_:1}))])):xc("",!0),i.customToc?(pr(!0),wr(Vc,{key:1},lh(i.customToc,(v,w)=>(pr(),wr("li",{key:w,class:Jl({"is-active":n.value===v.slideIndex})},[_h(LP,{tocItem:v,slides:i.slides,plugin:i.plugin},{default:Wp(()=>[v.sublist&&v.sublist.length&&t.value?(pr(),wr("button",{key:0,class:"mr-1","aria-label":h.$t("chapters.menu.dropdown"),onClick:S=>l(w)},[u(w)?(pr(),wr("svg",qci,Xci)):(pr(),wr("svg",Jci,Zci))],8,Wci)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Tr("ul",Qci,[(pr(!0),wr(Vc,null,lh(v.sublist,(S,I)=>(pr(),wr("li",{key:I,class:Jl({"is-active":n.value===S.slideIndex})},[_h(LP,{tocItem:S,slides:i.slides,parentItem:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,u(w)]])],2))),128)):(pr(!0),wr(Vc,{key:2},lh(o.value,(v,w)=>(pr(),wr("li",{key:w,class:Jl({"is-active":n.value===v.index})},[_h(LP,{tocItem:{...v,slideIndex:w},slides:i.slides,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,t.value]])])}}}),thi=Ux(ehi,[["__scopeId","data-v-8655b2ad"]]);(function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}function i(L){try{return L.defaultView&&L.defaultView.frameElement||null}catch{return null}}var e=function(L){for(var k=L,B=i(k);B;)k=B.ownerDocument,B=i(k);return k}(window.document),t=[],r=null,n=null;function s(L){this.time=L.time,this.target=L.target,this.rootBounds=v(L.rootBounds),this.boundingClientRect=v(L.boundingClientRect),this.intersectionRect=v(L.intersectionRect||m()),this.isIntersecting=!!L.intersectionRect;var k=this.boundingClientRect,B=k.width*k.height,$=this.intersectionRect,V=$.width*$.height;B?this.intersectionRatio=Number((V/B).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function o(L,k){var B=k||{};if(typeof L!="function")throw new Error("callback must be a function");if(B.root&&B.root.nodeType!=1&&B.root.nodeType!=9)throw new Error("root must be a Document or Element");this._checkForIntersections=l(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=L,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(B.rootMargin),this.thresholds=this._initThresholds(B.threshold),this.root=B.root||null,this.rootMargin=this._rootMarginValues.map(function($){return $.value+$.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return r||(r=function(L,k){!L||!k?n=m():n=w(L,k),t.forEach(function(B){B._checkForIntersections()})}),r},o._resetCrossOriginUpdater=function(){r=null,n=null},o.prototype.observe=function(L){var k=this._observationTargets.some(function(B){return B.element==L});if(!k){if(!(L&&L.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:L,entry:null}),this._monitorIntersections(L.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(L){this._observationTargets=this._observationTargets.filter(function(k){return k.element!=L}),this._unmonitorIntersections(L.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var L=this._queuedEntries.slice();return this._queuedEntries=[],L},o.prototype._initThresholds=function(L){var k=L||[0];return Array.isArray(k)||(k=[k]),k.sort().filter(function(B,$,V){if(typeof B!="number"||isNaN(B)||B<0||B>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return B!==V[$-1]})},o.prototype._parseRootMargin=function(L){var k=L||"0px",B=k.split(/\s+/).map(function($){var V=/^(-?\d*\.?\d+)(px|%)$/.exec($);if(!V)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(V[1]),unit:V[2]}});return B[1]=B[1]||B[0],B[2]=B[2]||B[0],B[3]=B[3]||B[1],B},o.prototype._monitorIntersections=function(L){var k=L.defaultView;if(k&&this._monitoringDocuments.indexOf(L)==-1){var B=this._checkForIntersections,$=null,V=null;this.POLL_INTERVAL?$=k.setInterval(B,this.POLL_INTERVAL):(u(k,"resize",B,!0),u(L,"scroll",B,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in k&&(V=new k.MutationObserver(B),V.observe(L,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(L),this._monitoringUnsubscribes.push(function(){var Q=L.defaultView;Q&&($&&Q.clearInterval($),c(Q,"resize",B,!0)),c(L,"scroll",B,!0),V&&V.disconnect()});var Y=this.root&&(this.root.ownerDocument||this.root)||e;if(L!=Y){var K=i(L);K&&this._monitorIntersections(K.ownerDocument)}}},o.prototype._unmonitorIntersections=function(L){var k=this._monitoringDocuments.indexOf(L);if(k!=-1){var B=this.root&&(this.root.ownerDocument||this.root)||e,$=this._observationTargets.some(function(K){var Q=K.element.ownerDocument;if(Q==L)return!0;for(;Q&&Q!=B;){var re=i(Q);if(Q=re&&re.ownerDocument,Q==L)return!0}return!1});if(!$){var V=this._monitoringUnsubscribes[k];if(this._monitoringDocuments.splice(k,1),this._monitoringUnsubscribes.splice(k,1),V(),L!=B){var Y=i(L);Y&&this._unmonitorIntersections(Y.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var L=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var k=0;k=0&&Q>=0&&{top:B,bottom:$,left:V,right:Y,width:K,height:Q}||null}function p(L){var k;try{k=L.getBoundingClientRect()}catch{}return k?(k.width&&k.height||(k={top:k.top,right:k.right,bottom:k.bottom,left:k.left,width:k.right-k.left,height:k.bottom-k.top}),k):m()}function m(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function v(L){return!L||"x"in L?L:{top:L.top,y:L.top,bottom:L.bottom,left:L.left,x:L.left,right:L.right,width:L.width,height:L.height}}function w(L,k){var B=k.top-L.top,$=k.left-L.left;return{top:B,left:$,height:k.height,width:k.width,bottom:B+k.height,right:$+k.width}}function S(L,k){for(var B=k;B;){if(B==L)return!0;B=I(B)}return!1}function I(L){var k=L.parentNode;return L.nodeType==9&&L!=e?i(L):(k&&k.assignedSlot&&(k=k.assignedSlot.parentNode),k&&k.nodeType==11&&k.host?k.host:k)}function R(L){return L&&L.nodeType===9}window.IntersectionObserver=o,window.IntersectionObserverEntry=s})();const Woe=i=>(Dxe("data-v-d353eb46"),i=i(),Fxe(),i),ihi={class:"flex items-center mt-4 mb-12"},rhi=["aria-label"],nhi={class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"#707070"},shi=["d"],ohi=["d"],ahi=Woe(()=>Tr("path",{d:"m3.5 17h17"},null,-1)),lhi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},uhi={class:"nav-content menu"},chi={key:0},hhi=cTt('',1),dhi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},phi=Woe(()=>Tr("svg",{class:"flex-shrink-0",viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"#fff",stroke:"#878787",xmlns:"http://www.w3.org/2000/svg"},[Tr("path",{"data-v-689fab2c":"",d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974",style:{fill:"rgba(255, 255, 255, 0)","fill-opacity":"0"},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"}),Tr("g",{transform:"matrix(1, 0, 0, 1, 0.07912001013755887, 1.1142139434814453)"},[Tr("polygon",{points:"11.956 9.662 9.522 12.097 9.862 12.437 11.956 10.344 14.049 12.437 14.39 12.097",style:{}}),Tr("path",{style:{fill:"rgb(135, 135, 135)","stroke-width":"1.5px"},d:"M 11.917 10.545 L 11.917 15.649"})]),Tr("rect",{x:"9.114",y:"8.74",width:"5.842",height:"0.487",style:{},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"})],-1)),fhi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},mhi=["aria-label","onClick"],ghi={key:0,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:"rotate-180"},yhi=Woe(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),vhi=[yhi],_hi={key:1,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},bhi=Woe(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),whi=[bhi],xhi={class:"dropdown-menu"},Shi=Woe(()=>Tr("div",{class:"h-10 flex-shrink-0"},null,-1)),Thi=da({__name:"chapter-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String,required:!0},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Cn(!1),r=Cn(!1),n=Cn(-1),s=Cn({}),o=oc(()=>{const h=e.slides.map((p,m)=>({...p,index:m}));return e.customToc||h.filter(p=>p.includeInToc!==!1),h});G8(()=>e.activeChapterIndex,()=>{c()}),Tg(()=>{const h=document.getElementById("intro");r.value=!!h,e.customToc&&e.customToc.forEach((p,m)=>{s.value[m]=!1})});const a=h=>{const p=document.getElementById(h);p&&p.scrollIntoView({behavior:"smooth"})},l=h=>{s.value[h]=!s.value[h]},u=h=>s.value[h],c=()=>{const h=o.value.filter(p=>p.index<=e.activeChapterIndex);n.value=h.length?h[h.length-1].index:-1};return(h,p)=>{const m=sY("router-link"),v=oY("tippy");return pr(),wr("div",{class:Jl([t.value?"w-72":"","nav-bar sticky self-start w-12 duration-500 ease-in-out transition-width"])},[Tr("div",ihi,[Sm((pr(),wr("button",{class:"flex items-center flex-shrink-0 px-2 py-1 mx-1 overflow-hidden","aria-label":h.$t("chapters.menu"),onClick:p[0]||(p[0]=w=>t.value=!t.value)},[(pr(),wr("svg",nhi,[Tr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 7h${t.value?"17":"8.5"}`},null,8,shi),Tr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 12h${t.value?"17":"8.5"}`},null,8,ohi),ahi])),Tr("span",lhi,Zh(h.$t("chapters.title")),1)],8,rhi)),[[v,{delay:"200",placement:"right",content:h.$t("chapters.title"),onShow:()=>!t.value,animateFill:!0}]])]),Tr("ul",uhi,[r.value&&i.returnToTop?(pr(),wr("li",chi,[i.plugin?Sm((pr(),wr("a",{key:0,class:"flex items-center px-2 py-1 mx-1 cursor-pointer",onClick:p[1]||(p[1]=w=>a("intro"))},[hhi,Tr("span",dhi,Zh(h.$t("chapters.return")),1)])),[[v,{delay:"200",placement:"right",content:h.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]]):Sm((pr(),Vv(m,{key:1,to:{hash:"#intro"},class:"flex items-center px-2 py-1 mx-1",target:""},{default:Wp(()=>[phi,Tr("span",fhi,Zh(h.$t("chapters.return")),1)]),_:1})),[[v,{delay:"200",placement:"right",content:h.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]])])):xc("",!0),i.customToc?(pr(!0),wr(Vc,{key:1},lh(i.customToc,(w,S)=>(pr(),wr("li",{key:S,class:Jl({"is-active":n.value===w.slideIndex})},[_h(LP,{tocItem:w,slides:i.slides,plugin:i.plugin},{default:Wp(()=>[w.sublist&&w.sublist.length&&t.value?(pr(),wr("button",{key:0,class:"mr-1","aria-label":h.$t("chapters.menu.dropdown"),onClick:I=>l(S)},[u(S)?(pr(),wr("svg",ghi,vhi)):(pr(),wr("svg",_hi,whi))],8,mhi)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Tr("ul",xhi,[(pr(!0),wr(Vc,null,lh(w.sublist,(I,R)=>(pr(),wr("li",{key:R,class:Jl({"is-active":n.value===I.slideIndex})},[_h(LP,{tocItem:I,slides:i.slides,parentItem:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,u(S)]])],2))),128)):(pr(!0),wr(Vc,{key:2},lh(o.value,(w,S)=>(pr(),wr("li",{key:S,class:Jl({"is-active":n.value===w.index})},[_h(LP,{tocItem:{...w,slideIndex:S},slides:i.slides,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128)),Shi])],2)}}}),Chi=Ux(Thi,[["__scopeId","data-v-d353eb46"]]),hTt=i=>(Dxe("data-v-dcca78d4"),i=i(),Fxe(),i),Ehi={id:"h-navbar",class:"navbar h-11 sticky"},Ihi={key:0},Ahi={class:"flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Mhi={class:"flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Ohi=["aria-label","onClick"],Phi={key:0,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:"rotate-180"},Rhi=hTt(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Dhi=[Rhi],Fhi={key:1,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},khi=hTt(()=>Tr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Lhi=[khi],Nhi={class:"dropdown-menu"},$hi=da({__name:"horizontal-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String,required:!0},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Cn(!1),r=Cn(-1),n=Cn({}),s=oc(()=>{const c=e.slides.map((h,p)=>({...h,index:p}));return e.customToc||c.filter(h=>h.includeInToc!==!1),c});G8(()=>e.activeChapterIndex,()=>{u()}),Tg(()=>{const c=document.getElementById("intro");t.value=!!c,e.customToc&&e.customToc.forEach((h,p)=>{n.value[p]=!1})});const o=c=>{const h=document.getElementById(c);h&&h.scrollIntoView({behavior:"smooth"})},a=c=>{n.value[c]=!n.value[c]},l=c=>n.value[c],u=()=>{const c=s.value.filter(h=>h.index<=e.activeChapterIndex);r.value=c.length?c[c.length-1].index:-1};return(c,h)=>{const p=sY("router-link"),m=oY("tippy");return pr(),wr("div",Ehi,[Tr("ul",null,[t.value&&i.returnToTop?(pr(),wr("li",Ihi,[i.plugin?Sm((pr(),wr("a",{key:0,class:"flex items-center px-2 py-1 mx-1 cursor-pointer",onClick:h[0]||(h[0]=v=>o("intro"))},[Tr("span",Ahi,Zh(c.$t("chapters.return")),1)])),[[m,{delay:"200",placement:"bottom",content:c.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]]):Sm((pr(),Vv(p,{key:1,to:{hash:"#intro"},class:"flex items-center px-2 py-1 mx-1",target:""},{default:Wp(()=>[Tr("span",Mhi,Zh(c.$t("chapters.return")),1)]),_:1})),[[m,{delay:"200",placement:"bottom",content:c.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]])])):xc("",!0),i.customToc?(pr(!0),wr(Vc,{key:1},lh(i.customToc,(v,w)=>(pr(),wr("li",{key:w,class:Jl({"is-active":r.value===v.slideIndex})},[_h(LP,{tocItem:v,slides:i.slides,verticalToc:!1,plugin:i.plugin},{default:Wp(()=>[v.sublist&&v.sublist.length?(pr(),wr("button",{key:0,class:"mr-1","aria-label":c.$t("chapters.menu.dropdown"),onClick:S=>a(w)},[l(w)?(pr(),wr("svg",Phi,Dhi)):(pr(),wr("svg",Fhi,Lhi))],8,Ohi)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Tr("ul",Nhi,[(pr(!0),wr(Vc,null,lh(v.sublist,(S,I)=>(pr(),wr("li",{key:I,class:Jl([[{"border-t-2":I===0,"is-active":r.value===S.slideIndex}],"border-b-2 border-gray-300"])},[_h(LP,{tocItem:S,slides:i.slides,parentItem:!1,verticalToc:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,l(w)]])],2))),128)):(pr(!0),wr(Vc,{key:2},lh(s.value,(v,w)=>(pr(),wr("li",{key:w,class:Jl({"is-active":r.value===v.index,separator:!i.returnToTop&&w!==0||i.returnToTop})},[_h(LP,{tocItem:{...v,slideIndex:w},slides:i.slides,verticalToc:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))])])}}}),Bhi=Ux($hi,[["__scopeId","data-v-dcca78d4"]]),jhi={class:"sticky z-10 grid-background overflow-hidden",style:{top:"60px",height:"100vh"}},Ghi={key:0,class:"w-full h-full"},Uhi=["src"],zhi=["src"],Vhi={key:1,class:"w-full h-full"},Hhi=da({__name:"background-image",props:{src:{type:String,required:!0},configFileStructure:{type:Object},cssClasses:{type:String}},emits:["background-changed"],setup(i,{emit:e}){const t=e,r=i,n={},s=zC({oldImage:"none",newImage:"none"}),o=Cn(0),a=Cn(-1);G8(()=>r.src,()=>{l(r.src).then(u=>{if(s.oldImage=u,a.value!==-1){const c=document.getElementById("primaryImage");c&&c.getAnimations().forEach(h=>{h.cancel(),h.play()}),clearTimeout(a.value),a.value=-1}o.value=1,r.src!=="none"&&s.newImage!=="none"?a.value=setTimeout(()=>{r.src!=="none"&&(o.value=0,s.oldImage=s.newImage,s.newImage=u,t("background-changed",!0),a.value=-1)},450):(s.newImage=u,o.value=0,t("background-changed",s.newImage!=="none"))})},{immediate:!1});const l=u=>new Promise(c=>{if(u==="none"){c(u);return}if(n[u]!==void 0){c(n[u]);return}if(r.configFileStructure){const h=`${u.substring(u.indexOf("/")+1)}`,p=r.configFileStructure?.zip.file(h);if(p)p.async("blob").then(m=>{const v=URL.createObjectURL(m);n[u]=v,c(n[u])});else{c(u);return}}else fetch(u).then(h=>h.blob()).then(h=>{const p=URL.createObjectURL(h);n[u]=p,c(n[u])})});return(u,c)=>(pr(),wr("div",jhi,[_h(uci,{name:"fade",mode:"out-in"},{default:Wp(()=>[s.newImage!=="none"?(pr(),wr("div",Ghi,[s.oldImage!=="none"?(pr(),wr("img",{key:0,class:"fade-in transition-img w-full h-full object-cover",role:"presentation",src:s.oldImage},null,8,Uhi)):xc("",!0),Tr("img",{class:Jl(["fade-in transition-img w-full h-full object-cover",[i.cssClasses,{"transition-hide":o.value===1}]]),src:s.newImage,id:"primaryImage",role:"presentation"},null,10,zhi)])):(pr(),wr("div",Vhi))]),_:1})]))}}),Whi=Ux(Hhi,[["__scopeId","data-v-7da3289c"]]);var qg=(i=>(i.Text="text",i.Image="image",i.Map="map",i.InteractiveMap="interactive-map",i.Chart="chart",i.Video="video",i.Audio="audio",i.Slideshow="slideshow",i.Dynamic="dynamic",i.Loading="loading",i))(qg||{}),Pc={};const qhi="Á",Yhi="á",Xhi="Ă",Jhi="ă",Khi="∾",Zhi="∿",Qhi="∾̳",edi="Â",tdi="â",idi="´",rdi="А",ndi="а",sdi="Æ",odi="æ",adi="⁡",ldi="𝔄",udi="𝔞",cdi="À",hdi="à",ddi="ℵ",pdi="ℵ",fdi="Α",mdi="α",gdi="Ā",ydi="ā",vdi="⨿",_di="&",bdi="&",wdi="⩕",xdi="⩓",Sdi="∧",Tdi="⩜",Cdi="⩘",Edi="⩚",Idi="∠",Adi="⦤",Mdi="∠",Odi="⦨",Pdi="⦩",Rdi="⦪",Ddi="⦫",Fdi="⦬",kdi="⦭",Ldi="⦮",Ndi="⦯",$di="∡",Bdi="∟",jdi="⊾",Gdi="⦝",Udi="∢",zdi="Å",Vdi="⍼",Hdi="Ą",Wdi="ą",qdi="𝔸",Ydi="𝕒",Xdi="⩯",Jdi="≈",Kdi="⩰",Zdi="≊",Qdi="≋",epi="'",tpi="⁡",ipi="≈",rpi="≊",npi="Å",spi="å",opi="𝒜",api="𝒶",lpi="≔",upi="*",cpi="≈",hpi="≍",dpi="Ã",ppi="ã",fpi="Ä",mpi="ä",gpi="∳",ypi="⨑",vpi="≌",_pi="϶",bpi="‵",wpi="∽",xpi="⋍",Spi="∖",Tpi="⫧",Cpi="⊽",Epi="⌅",Ipi="⌆",Api="⌅",Mpi="⎵",Opi="⎶",Ppi="≌",Rpi="Б",Dpi="б",Fpi="„",kpi="∵",Lpi="∵",Npi="∵",$pi="⦰",Bpi="϶",jpi="ℬ",Gpi="ℬ",Upi="Β",zpi="β",Vpi="ℶ",Hpi="≬",Wpi="𝔅",qpi="𝔟",Ypi="⋂",Xpi="◯",Jpi="⋃",Kpi="⨀",Zpi="⨁",Qpi="⨂",efi="⨆",tfi="★",ifi="▽",rfi="△",nfi="⨄",sfi="⋁",ofi="⋀",afi="⤍",lfi="⧫",ufi="▪",cfi="▴",hfi="▾",dfi="◂",pfi="▸",ffi="␣",mfi="▒",gfi="░",yfi="▓",vfi="█",_fi="=⃥",bfi="≡⃥",wfi="⫭",xfi="⌐",Sfi="𝔹",Tfi="𝕓",Cfi="⊥",Efi="⊥",Ifi="⋈",Afi="⧉",Mfi="┐",Ofi="╕",Pfi="╖",Rfi="╗",Dfi="┌",Ffi="╒",kfi="╓",Lfi="╔",Nfi="─",$fi="═",Bfi="┬",jfi="╤",Gfi="╥",Ufi="╦",zfi="┴",Vfi="╧",Hfi="╨",Wfi="╩",qfi="⊟",Yfi="⊞",Xfi="⊠",Jfi="┘",Kfi="╛",Zfi="╜",Qfi="╝",emi="└",tmi="╘",imi="╙",rmi="╚",nmi="│",smi="║",omi="┼",ami="╪",lmi="╫",umi="╬",cmi="┤",hmi="╡",dmi="╢",pmi="╣",fmi="├",mmi="╞",gmi="╟",ymi="╠",vmi="‵",_mi="˘",bmi="˘",wmi="¦",xmi="𝒷",Smi="ℬ",Tmi="⁏",Cmi="∽",Emi="⋍",Imi="⧅",Ami="\\",Mmi="⟈",Omi="•",Pmi="•",Rmi="≎",Dmi="⪮",Fmi="≏",kmi="≎",Lmi="≏",Nmi="Ć",$mi="ć",Bmi="⩄",jmi="⩉",Gmi="⩋",Umi="∩",zmi="⋒",Vmi="⩇",Hmi="⩀",Wmi="ⅅ",qmi="∩︀",Ymi="⁁",Xmi="ˇ",Jmi="ℭ",Kmi="⩍",Zmi="Č",Qmi="č",egi="Ç",tgi="ç",igi="Ĉ",rgi="ĉ",ngi="∰",sgi="⩌",ogi="⩐",agi="Ċ",lgi="ċ",ugi="¸",cgi="¸",hgi="⦲",dgi="¢",pgi="·",fgi="·",mgi="𝔠",ggi="ℭ",ygi="Ч",vgi="ч",_gi="✓",bgi="✓",wgi="Χ",xgi="χ",Sgi="ˆ",Tgi="≗",Cgi="↺",Egi="↻",Igi="⊛",Agi="⊚",Mgi="⊝",Ogi="⊙",Pgi="®",Rgi="Ⓢ",Dgi="⊖",Fgi="⊕",kgi="⊗",Lgi="○",Ngi="⧃",$gi="≗",Bgi="⨐",jgi="⫯",Ggi="⧂",Ugi="∲",zgi="”",Vgi="’",Hgi="♣",Wgi="♣",qgi=":",Ygi="∷",Xgi="⩴",Jgi="≔",Kgi="≔",Zgi=",",Qgi="@",eyi="∁",tyi="∘",iyi="∁",ryi="ℂ",nyi="≅",syi="⩭",oyi="≡",ayi="∮",lyi="∯",uyi="∮",cyi="𝕔",hyi="ℂ",dyi="∐",pyi="∐",fyi="©",myi="©",gyi="℗",yyi="∳",vyi="↵",_yi="✗",byi="⨯",wyi="𝒞",xyi="𝒸",Syi="⫏",Tyi="⫑",Cyi="⫐",Eyi="⫒",Iyi="⋯",Ayi="⤸",Myi="⤵",Oyi="⋞",Pyi="⋟",Ryi="↶",Dyi="⤽",Fyi="⩈",kyi="⩆",Lyi="≍",Nyi="∪",$yi="⋓",Byi="⩊",jyi="⊍",Gyi="⩅",Uyi="∪︀",zyi="↷",Vyi="⤼",Hyi="⋞",Wyi="⋟",qyi="⋎",Yyi="⋏",Xyi="¤",Jyi="↶",Kyi="↷",Zyi="⋎",Qyi="⋏",e0i="∲",t0i="∱",i0i="⌭",r0i="†",n0i="‡",s0i="ℸ",o0i="↓",a0i="↡",l0i="⇓",u0i="‐",c0i="⫤",h0i="⊣",d0i="⤏",p0i="˝",f0i="Ď",m0i="ď",g0i="Д",y0i="д",v0i="‡",_0i="⇊",b0i="ⅅ",w0i="ⅆ",x0i="⤑",S0i="⩷",T0i="°",C0i="∇",E0i="Δ",I0i="δ",A0i="⦱",M0i="⥿",O0i="𝔇",P0i="𝔡",R0i="⥥",D0i="⇃",F0i="⇂",k0i="´",L0i="˙",N0i="˝",$0i="`",B0i="˜",j0i="⋄",G0i="⋄",U0i="⋄",z0i="♦",V0i="♦",H0i="¨",W0i="ⅆ",q0i="ϝ",Y0i="⋲",X0i="÷",J0i="÷",K0i="⋇",Z0i="⋇",Q0i="Ђ",evi="ђ",tvi="⌞",ivi="⌍",rvi="$",nvi="𝔻",svi="𝕕",ovi="¨",avi="˙",lvi="⃜",uvi="≐",cvi="≑",hvi="≐",dvi="∸",pvi="∔",fvi="⊡",mvi="⌆",gvi="∯",yvi="¨",vvi="⇓",_vi="⇐",bvi="⇔",wvi="⫤",xvi="⟸",Svi="⟺",Tvi="⟹",Cvi="⇒",Evi="⊨",Ivi="⇑",Avi="⇕",Mvi="∥",Ovi="⤓",Pvi="↓",Rvi="↓",Dvi="⇓",Fvi="⇵",kvi="̑",Lvi="⇊",Nvi="⇃",$vi="⇂",Bvi="⥐",jvi="⥞",Gvi="⥖",Uvi="↽",zvi="⥟",Vvi="⥗",Hvi="⇁",Wvi="↧",qvi="⊤",Yvi="⤐",Xvi="⌟",Jvi="⌌",Kvi="𝒟",Zvi="𝒹",Qvi="Ѕ",e1i="ѕ",t1i="⧶",i1i="Đ",r1i="đ",n1i="⋱",s1i="▿",o1i="▾",a1i="⇵",l1i="⥯",u1i="⦦",c1i="Џ",h1i="џ",d1i="⟿",p1i="É",f1i="é",m1i="⩮",g1i="Ě",y1i="ě",v1i="Ê",_1i="ê",b1i="≖",w1i="≕",x1i="Э",S1i="э",T1i="⩷",C1i="Ė",E1i="ė",I1i="≑",A1i="ⅇ",M1i="≒",O1i="𝔈",P1i="𝔢",R1i="⪚",D1i="È",F1i="è",k1i="⪖",L1i="⪘",N1i="⪙",$1i="∈",B1i="⏧",j1i="ℓ",G1i="⪕",U1i="⪗",z1i="Ē",V1i="ē",H1i="∅",W1i="∅",q1i="◻",Y1i="∅",X1i="▫",J1i=" ",K1i=" ",Z1i=" ",Q1i="Ŋ",e_i="ŋ",t_i=" ",i_i="Ę",r_i="ę",n_i="𝔼",s_i="𝕖",o_i="⋕",a_i="⧣",l_i="⩱",u_i="ε",c_i="Ε",h_i="ε",d_i="ϵ",p_i="≖",f_i="≕",m_i="≂",g_i="⪖",y_i="⪕",v_i="⩵",__i="=",b_i="≂",w_i="≟",x_i="⇌",S_i="≡",T_i="⩸",C_i="⧥",E_i="⥱",I_i="≓",A_i="ℯ",M_i="ℰ",O_i="≐",P_i="⩳",R_i="≂",D_i="Η",F_i="η",k_i="Ð",L_i="ð",N_i="Ë",$_i="ë",B_i="€",j_i="!",G_i="∃",U_i="∃",z_i="ℰ",V_i="ⅇ",H_i="ⅇ",W_i="≒",q_i="Ф",Y_i="ф",X_i="♀",J_i="ffi",K_i="ff",Z_i="ffl",Q_i="𝔉",ebi="𝔣",tbi="fi",ibi="◼",rbi="▪",nbi="fj",sbi="♭",obi="fl",abi="▱",lbi="ƒ",ubi="𝔽",cbi="𝕗",hbi="∀",dbi="∀",pbi="⋔",fbi="⫙",mbi="ℱ",gbi="⨍",ybi="½",vbi="⅓",_bi="¼",bbi="⅕",wbi="⅙",xbi="⅛",Sbi="⅔",Tbi="⅖",Cbi="¾",Ebi="⅗",Ibi="⅜",Abi="⅘",Mbi="⅚",Obi="⅝",Pbi="⅞",Rbi="⁄",Dbi="⌢",Fbi="𝒻",kbi="ℱ",Lbi="ǵ",Nbi="Γ",$bi="γ",Bbi="Ϝ",jbi="ϝ",Gbi="⪆",Ubi="Ğ",zbi="ğ",Vbi="Ģ",Hbi="Ĝ",Wbi="ĝ",qbi="Г",Ybi="г",Xbi="Ġ",Jbi="ġ",Kbi="≥",Zbi="≧",Qbi="⪌",ewi="⋛",twi="≥",iwi="≧",rwi="⩾",nwi="⪩",swi="⩾",owi="⪀",awi="⪂",lwi="⪄",uwi="⋛︀",cwi="⪔",hwi="𝔊",dwi="𝔤",pwi="≫",fwi="⋙",mwi="⋙",gwi="ℷ",ywi="Ѓ",vwi="ѓ",_wi="⪥",bwi="≷",wwi="⪒",xwi="⪤",Swi="⪊",Twi="⪊",Cwi="⪈",Ewi="≩",Iwi="⪈",Awi="≩",Mwi="⋧",Owi="𝔾",Pwi="𝕘",Rwi="`",Dwi="≥",Fwi="⋛",kwi="≧",Lwi="⪢",Nwi="≷",$wi="⩾",Bwi="≳",jwi="𝒢",Gwi="ℊ",Uwi="≳",zwi="⪎",Vwi="⪐",Hwi="⪧",Wwi="⩺",qwi=">",Ywi=">",Xwi="≫",Jwi="⋗",Kwi="⦕",Zwi="⩼",Qwi="⪆",exi="⥸",txi="⋗",ixi="⋛",rxi="⪌",nxi="≷",sxi="≳",oxi="≩︀",axi="≩︀",lxi="ˇ",uxi=" ",cxi="½",hxi="ℋ",dxi="Ъ",pxi="ъ",fxi="⥈",mxi="↔",gxi="⇔",yxi="↭",vxi="^",_xi="ℏ",bxi="Ĥ",wxi="ĥ",xxi="♥",Sxi="♥",Txi="…",Cxi="⊹",Exi="𝔥",Ixi="ℌ",Axi="ℋ",Mxi="⤥",Oxi="⤦",Pxi="⇿",Rxi="∻",Dxi="↩",Fxi="↪",kxi="𝕙",Lxi="ℍ",Nxi="―",$xi="─",Bxi="𝒽",jxi="ℋ",Gxi="ℏ",Uxi="Ħ",zxi="ħ",Vxi="≎",Hxi="≏",Wxi="⁃",qxi="‐",Yxi="Í",Xxi="í",Jxi="⁣",Kxi="Î",Zxi="î",Qxi="И",e2i="и",t2i="İ",i2i="Е",r2i="е",n2i="¡",s2i="⇔",o2i="𝔦",a2i="ℑ",l2i="Ì",u2i="ì",c2i="ⅈ",h2i="⨌",d2i="∭",p2i="⧜",f2i="℩",m2i="IJ",g2i="ij",y2i="Ī",v2i="ī",_2i="ℑ",b2i="ⅈ",w2i="ℐ",x2i="ℑ",S2i="ı",T2i="ℑ",C2i="⊷",E2i="Ƶ",I2i="⇒",A2i="℅",M2i="∞",O2i="⧝",P2i="ı",R2i="⊺",D2i="∫",F2i="∬",k2i="ℤ",L2i="∫",N2i="⊺",$2i="⋂",B2i="⨗",j2i="⨼",G2i="⁣",U2i="⁢",z2i="Ё",V2i="ё",H2i="Į",W2i="į",q2i="𝕀",Y2i="𝕚",X2i="Ι",J2i="ι",K2i="⨼",Z2i="¿",Q2i="𝒾",eSi="ℐ",tSi="∈",iSi="⋵",rSi="⋹",nSi="⋴",sSi="⋳",oSi="∈",aSi="⁢",lSi="Ĩ",uSi="ĩ",cSi="І",hSi="і",dSi="Ï",pSi="ï",fSi="Ĵ",mSi="ĵ",gSi="Й",ySi="й",vSi="𝔍",_Si="𝔧",bSi="ȷ",wSi="𝕁",xSi="𝕛",SSi="𝒥",TSi="𝒿",CSi="Ј",ESi="ј",ISi="Є",ASi="є",MSi="Κ",OSi="κ",PSi="ϰ",RSi="Ķ",DSi="ķ",FSi="К",kSi="к",LSi="𝔎",NSi="𝔨",$Si="ĸ",BSi="Х",jSi="х",GSi="Ќ",USi="ќ",zSi="𝕂",VSi="𝕜",HSi="𝒦",WSi="𝓀",qSi="⇚",YSi="Ĺ",XSi="ĺ",JSi="⦴",KSi="ℒ",ZSi="Λ",QSi="λ",eTi="⟨",tTi="⟪",iTi="⦑",rTi="⟨",nTi="⪅",sTi="ℒ",oTi="«",aTi="⇤",lTi="⤟",uTi="←",cTi="↞",hTi="⇐",dTi="⤝",pTi="↩",fTi="↫",mTi="⤹",gTi="⥳",yTi="↢",vTi="⤙",_Ti="⤛",bTi="⪫",wTi="⪭",xTi="⪭︀",STi="⤌",TTi="⤎",CTi="❲",ETi="{",ITi="[",ATi="⦋",MTi="⦏",OTi="⦍",PTi="Ľ",RTi="ľ",DTi="Ļ",FTi="ļ",kTi="⌈",LTi="{",NTi="Л",$Ti="л",BTi="⤶",jTi="“",GTi="„",UTi="⥧",zTi="⥋",VTi="↲",HTi="≤",WTi="≦",qTi="⟨",YTi="⇤",XTi="←",JTi="←",KTi="⇐",ZTi="⇆",QTi="↢",eCi="⌈",tCi="⟦",iCi="⥡",rCi="⥙",nCi="⇃",sCi="⌊",oCi="↽",aCi="↼",lCi="⇇",uCi="↔",cCi="↔",hCi="⇔",dCi="⇆",pCi="⇋",fCi="↭",mCi="⥎",gCi="↤",yCi="⊣",vCi="⥚",_Ci="⋋",bCi="⧏",wCi="⊲",xCi="⊴",SCi="⥑",TCi="⥠",CCi="⥘",ECi="↿",ICi="⥒",ACi="↼",MCi="⪋",OCi="⋚",PCi="≤",RCi="≦",DCi="⩽",FCi="⪨",kCi="⩽",LCi="⩿",NCi="⪁",$Ci="⪃",BCi="⋚︀",jCi="⪓",GCi="⪅",UCi="⋖",zCi="⋚",VCi="⪋",HCi="⋚",WCi="≦",qCi="≶",YCi="≶",XCi="⪡",JCi="≲",KCi="⩽",ZCi="≲",QCi="⥼",eEi="⌊",tEi="𝔏",iEi="𝔩",rEi="≶",nEi="⪑",sEi="⥢",oEi="↽",aEi="↼",lEi="⥪",uEi="▄",cEi="Љ",hEi="љ",dEi="⇇",pEi="≪",fEi="⋘",mEi="⌞",gEi="⇚",yEi="⥫",vEi="◺",_Ei="Ŀ",bEi="ŀ",wEi="⎰",xEi="⎰",SEi="⪉",TEi="⪉",CEi="⪇",EEi="≨",IEi="⪇",AEi="≨",MEi="⋦",OEi="⟬",PEi="⇽",REi="⟦",DEi="⟵",FEi="⟵",kEi="⟸",LEi="⟷",NEi="⟷",$Ei="⟺",BEi="⟼",jEi="⟶",GEi="⟶",UEi="⟹",zEi="↫",VEi="↬",HEi="⦅",WEi="𝕃",qEi="𝕝",YEi="⨭",XEi="⨴",JEi="∗",KEi="_",ZEi="↙",QEi="↘",eIi="◊",tIi="◊",iIi="⧫",rIi="(",nIi="⦓",sIi="⇆",oIi="⌟",aIi="⇋",lIi="⥭",uIi="‎",cIi="⊿",hIi="‹",dIi="𝓁",pIi="ℒ",fIi="↰",mIi="↰",gIi="≲",yIi="⪍",vIi="⪏",_Ii="[",bIi="‘",wIi="‚",xIi="Ł",SIi="ł",TIi="⪦",CIi="⩹",EIi="<",IIi="<",AIi="≪",MIi="⋖",OIi="⋋",PIi="⋉",RIi="⥶",DIi="⩻",FIi="◃",kIi="⊴",LIi="◂",NIi="⦖",$Ii="⥊",BIi="⥦",jIi="≨︀",GIi="≨︀",UIi="¯",zIi="♂",VIi="✠",HIi="✠",WIi="↦",qIi="↦",YIi="↧",XIi="↤",JIi="↥",KIi="▮",ZIi="⨩",QIi="М",eAi="м",tAi="—",iAi="∺",rAi="∡",nAi=" ",sAi="ℳ",oAi="𝔐",aAi="𝔪",lAi="℧",uAi="µ",cAi="*",hAi="⫰",dAi="∣",pAi="·",fAi="⊟",mAi="−",gAi="∸",yAi="⨪",vAi="∓",_Ai="⫛",bAi="…",wAi="∓",xAi="⊧",SAi="𝕄",TAi="𝕞",CAi="∓",EAi="𝓂",IAi="ℳ",AAi="∾",MAi="Μ",OAi="μ",PAi="⊸",RAi="⊸",DAi="∇",FAi="Ń",kAi="ń",LAi="∠⃒",NAi="≉",$Ai="⩰̸",BAi="≋̸",jAi="ʼn",GAi="≉",UAi="♮",zAi="ℕ",VAi="♮",HAi=" ",WAi="≎̸",qAi="≏̸",YAi="⩃",XAi="Ň",JAi="ň",KAi="Ņ",ZAi="ņ",QAi="≇",e3i="⩭̸",t3i="⩂",i3i="Н",r3i="н",n3i="–",s3i="⤤",o3i="↗",a3i="⇗",l3i="↗",u3i="≠",c3i="≐̸",h3i="​",d3i="​",p3i="​",f3i="​",m3i="≢",g3i="⤨",y3i="≂̸",v3i="≫",_3i="≪",b3i=` -`,w3i="∄",x3i="∄",S3i="𝔑",T3i="𝔫",C3i="≧̸",E3i="≱",I3i="≱",A3i="≧̸",M3i="⩾̸",O3i="⩾̸",P3i="⋙̸",R3i="≵",D3i="≫⃒",F3i="≯",k3i="≯",L3i="≫̸",N3i="↮",$3i="⇎",B3i="⫲",j3i="∋",G3i="⋼",U3i="⋺",z3i="∋",V3i="Њ",H3i="њ",W3i="↚",q3i="⇍",Y3i="‥",X3i="≦̸",J3i="≰",K3i="↚",Z3i="⇍",Q3i="↮",eMi="⇎",tMi="≰",iMi="≦̸",rMi="⩽̸",nMi="⩽̸",sMi="≮",oMi="⋘̸",aMi="≴",lMi="≪⃒",uMi="≮",cMi="⋪",hMi="⋬",dMi="≪̸",pMi="∤",fMi="⁠",mMi=" ",gMi="𝕟",yMi="ℕ",vMi="⫬",_Mi="¬",bMi="≢",wMi="≭",xMi="∦",SMi="∉",TMi="≠",CMi="≂̸",EMi="∄",IMi="≯",AMi="≱",MMi="≧̸",OMi="≫̸",PMi="≹",RMi="⩾̸",DMi="≵",FMi="≎̸",kMi="≏̸",LMi="∉",NMi="⋵̸",$Mi="⋹̸",BMi="∉",jMi="⋷",GMi="⋶",UMi="⧏̸",zMi="⋪",VMi="⋬",HMi="≮",WMi="≰",qMi="≸",YMi="≪̸",XMi="⩽̸",JMi="≴",KMi="⪢̸",ZMi="⪡̸",QMi="∌",eOi="∌",tOi="⋾",iOi="⋽",rOi="⊀",nOi="⪯̸",sOi="⋠",oOi="∌",aOi="⧐̸",lOi="⋫",uOi="⋭",cOi="⊏̸",hOi="⋢",dOi="⊐̸",pOi="⋣",fOi="⊂⃒",mOi="⊈",gOi="⊁",yOi="⪰̸",vOi="⋡",_Oi="≿̸",bOi="⊃⃒",wOi="⊉",xOi="≁",SOi="≄",TOi="≇",COi="≉",EOi="∤",IOi="∦",AOi="∦",MOi="⫽⃥",OOi="∂̸",POi="⨔",ROi="⊀",DOi="⋠",FOi="⊀",kOi="⪯̸",LOi="⪯̸",NOi="⤳̸",$Oi="↛",BOi="⇏",jOi="↝̸",GOi="↛",UOi="⇏",zOi="⋫",VOi="⋭",HOi="⊁",WOi="⋡",qOi="⪰̸",YOi="𝒩",XOi="𝓃",JOi="∤",KOi="∦",ZOi="≁",QOi="≄",ePi="≄",tPi="∤",iPi="∦",rPi="⋢",nPi="⋣",sPi="⊄",oPi="⫅̸",aPi="⊈",lPi="⊂⃒",uPi="⊈",cPi="⫅̸",hPi="⊁",dPi="⪰̸",pPi="⊅",fPi="⫆̸",mPi="⊉",gPi="⊃⃒",yPi="⊉",vPi="⫆̸",_Pi="≹",bPi="Ñ",wPi="ñ",xPi="≸",SPi="⋪",TPi="⋬",CPi="⋫",EPi="⋭",IPi="Ν",APi="ν",MPi="#",OPi="№",PPi=" ",RPi="≍⃒",DPi="⊬",FPi="⊭",kPi="⊮",LPi="⊯",NPi="≥⃒",$Pi=">⃒",BPi="⤄",jPi="⧞",GPi="⤂",UPi="≤⃒",zPi="<⃒",VPi="⊴⃒",HPi="⤃",WPi="⊵⃒",qPi="∼⃒",YPi="⤣",XPi="↖",JPi="⇖",KPi="↖",ZPi="⤧",QPi="Ó",eRi="ó",tRi="⊛",iRi="Ô",rRi="ô",nRi="⊚",sRi="О",oRi="о",aRi="⊝",lRi="Ő",uRi="ő",cRi="⨸",hRi="⊙",dRi="⦼",pRi="Œ",fRi="œ",mRi="⦿",gRi="𝔒",yRi="𝔬",vRi="˛",_Ri="Ò",bRi="ò",wRi="⧁",xRi="⦵",SRi="Ω",TRi="∮",CRi="↺",ERi="⦾",IRi="⦻",ARi="‾",MRi="⧀",ORi="Ō",PRi="ō",RRi="Ω",DRi="ω",FRi="Ο",kRi="ο",LRi="⦶",NRi="⊖",$Ri="𝕆",BRi="𝕠",jRi="⦷",GRi="“",URi="‘",zRi="⦹",VRi="⊕",HRi="↻",WRi="⩔",qRi="∨",YRi="⩝",XRi="ℴ",JRi="ℴ",KRi="ª",ZRi="º",QRi="⊶",eDi="⩖",tDi="⩗",iDi="⩛",rDi="Ⓢ",nDi="𝒪",sDi="ℴ",oDi="Ø",aDi="ø",lDi="⊘",uDi="Õ",cDi="õ",hDi="⨶",dDi="⨷",pDi="⊗",fDi="Ö",mDi="ö",gDi="⌽",yDi="‾",vDi="⏞",_Di="⎴",bDi="⏜",wDi="¶",xDi="∥",SDi="∥",TDi="⫳",CDi="⫽",EDi="∂",IDi="∂",ADi="П",MDi="п",ODi="%",PDi=".",RDi="‰",DDi="⊥",FDi="‱",kDi="𝔓",LDi="𝔭",NDi="Φ",$Di="φ",BDi="ϕ",jDi="ℳ",GDi="☎",UDi="Π",zDi="π",VDi="⋔",HDi="ϖ",WDi="ℏ",qDi="ℎ",YDi="ℏ",XDi="⨣",JDi="⊞",KDi="⨢",ZDi="+",QDi="∔",e4i="⨥",t4i="⩲",i4i="±",r4i="±",n4i="⨦",s4i="⨧",o4i="±",a4i="ℌ",l4i="⨕",u4i="𝕡",c4i="ℙ",h4i="£",d4i="⪷",p4i="⪻",f4i="≺",m4i="≼",g4i="⪷",y4i="≺",v4i="≼",_4i="≺",b4i="⪯",w4i="≼",x4i="≾",S4i="⪯",T4i="⪹",C4i="⪵",E4i="⋨",I4i="⪯",A4i="⪳",M4i="≾",O4i="′",P4i="″",R4i="ℙ",D4i="⪹",F4i="⪵",k4i="⋨",L4i="∏",N4i="∏",$4i="⌮",B4i="⌒",j4i="⌓",G4i="∝",U4i="∝",z4i="∷",V4i="∝",H4i="≾",W4i="⊰",q4i="𝒫",Y4i="𝓅",X4i="Ψ",J4i="ψ",K4i=" ",Z4i="𝔔",Q4i="𝔮",e5i="⨌",t5i="𝕢",i5i="ℚ",r5i="⁗",n5i="𝒬",s5i="𝓆",o5i="ℍ",a5i="⨖",l5i="?",u5i="≟",c5i='"',h5i='"',d5i="⇛",p5i="∽̱",f5i="Ŕ",m5i="ŕ",g5i="√",y5i="⦳",v5i="⟩",_5i="⟫",b5i="⦒",w5i="⦥",x5i="⟩",S5i="»",T5i="⥵",C5i="⇥",E5i="⤠",I5i="⤳",A5i="→",M5i="↠",O5i="⇒",P5i="⤞",R5i="↪",D5i="↬",F5i="⥅",k5i="⥴",L5i="⤖",N5i="↣",$5i="↝",B5i="⤚",j5i="⤜",G5i="∶",U5i="ℚ",z5i="⤍",V5i="⤏",H5i="⤐",W5i="❳",q5i="}",Y5i="]",X5i="⦌",J5i="⦎",K5i="⦐",Z5i="Ř",Q5i="ř",eFi="Ŗ",tFi="ŗ",iFi="⌉",rFi="}",nFi="Р",sFi="р",oFi="⤷",aFi="⥩",lFi="”",uFi="”",cFi="↳",hFi="ℜ",dFi="ℛ",pFi="ℜ",fFi="ℝ",mFi="ℜ",gFi="▭",yFi="®",vFi="®",_Fi="∋",bFi="⇋",wFi="⥯",xFi="⥽",SFi="⌋",TFi="𝔯",CFi="ℜ",EFi="⥤",IFi="⇁",AFi="⇀",MFi="⥬",OFi="Ρ",PFi="ρ",RFi="ϱ",DFi="⟩",FFi="⇥",kFi="→",LFi="→",NFi="⇒",$Fi="⇄",BFi="↣",jFi="⌉",GFi="⟧",UFi="⥝",zFi="⥕",VFi="⇂",HFi="⌋",WFi="⇁",qFi="⇀",YFi="⇄",XFi="⇌",JFi="⇉",KFi="↝",ZFi="↦",QFi="⊢",eki="⥛",tki="⋌",iki="⧐",rki="⊳",nki="⊵",ski="⥏",oki="⥜",aki="⥔",lki="↾",uki="⥓",cki="⇀",hki="˚",dki="≓",pki="⇄",fki="⇌",mki="‏",gki="⎱",yki="⎱",vki="⫮",_ki="⟭",bki="⇾",wki="⟧",xki="⦆",Ski="𝕣",Tki="ℝ",Cki="⨮",Eki="⨵",Iki="⥰",Aki=")",Mki="⦔",Oki="⨒",Pki="⇉",Rki="⇛",Dki="›",Fki="𝓇",kki="ℛ",Lki="↱",Nki="↱",$ki="]",Bki="’",jki="’",Gki="⋌",Uki="⋊",zki="▹",Vki="⊵",Hki="▸",Wki="⧎",qki="⧴",Yki="⥨",Xki="℞",Jki="Ś",Kki="ś",Zki="‚",Qki="⪸",eLi="Š",tLi="š",iLi="⪼",rLi="≻",nLi="≽",sLi="⪰",oLi="⪴",aLi="Ş",lLi="ş",uLi="Ŝ",cLi="ŝ",hLi="⪺",dLi="⪶",pLi="⋩",fLi="⨓",mLi="≿",gLi="С",yLi="с",vLi="⊡",_Li="⋅",bLi="⩦",wLi="⤥",xLi="↘",SLi="⇘",TLi="↘",CLi="§",ELi=";",ILi="⤩",ALi="∖",MLi="∖",OLi="✶",PLi="𝔖",RLi="𝔰",DLi="⌢",FLi="♯",kLi="Щ",LLi="щ",NLi="Ш",$Li="ш",BLi="↓",jLi="←",GLi="∣",ULi="∥",zLi="→",VLi="↑",HLi="­",WLi="Σ",qLi="σ",YLi="ς",XLi="ς",JLi="∼",KLi="⩪",ZLi="≃",QLi="≃",eNi="⪞",tNi="⪠",iNi="⪝",rNi="⪟",nNi="≆",sNi="⨤",oNi="⥲",aNi="←",lNi="∘",uNi="∖",cNi="⨳",hNi="⧤",dNi="∣",pNi="⌣",fNi="⪪",mNi="⪬",gNi="⪬︀",yNi="Ь",vNi="ь",_Ni="⌿",bNi="⧄",wNi="/",xNi="𝕊",SNi="𝕤",TNi="♠",CNi="♠",ENi="∥",INi="⊓",ANi="⊓︀",MNi="⊔",ONi="⊔︀",PNi="√",RNi="⊏",DNi="⊑",FNi="⊏",kNi="⊑",LNi="⊐",NNi="⊒",$Ni="⊐",BNi="⊒",jNi="□",GNi="□",UNi="⊓",zNi="⊏",VNi="⊑",HNi="⊐",WNi="⊒",qNi="⊔",YNi="▪",XNi="□",JNi="▪",KNi="→",ZNi="𝒮",QNi="𝓈",e$i="∖",t$i="⌣",i$i="⋆",r$i="⋆",n$i="☆",s$i="★",o$i="ϵ",a$i="ϕ",l$i="¯",u$i="⊂",c$i="⋐",h$i="⪽",d$i="⫅",p$i="⊆",f$i="⫃",m$i="⫁",g$i="⫋",y$i="⊊",v$i="⪿",_$i="⥹",b$i="⊂",w$i="⋐",x$i="⊆",S$i="⫅",T$i="⊆",C$i="⊊",E$i="⫋",I$i="⫇",A$i="⫕",M$i="⫓",O$i="⪸",P$i="≻",R$i="≽",D$i="≻",F$i="⪰",k$i="≽",L$i="≿",N$i="⪰",$$i="⪺",B$i="⪶",j$i="⋩",G$i="≿",U$i="∋",z$i="∑",V$i="∑",H$i="♪",W$i="¹",q$i="²",Y$i="³",X$i="⊃",J$i="⋑",K$i="⪾",Z$i="⫘",Q$i="⫆",e6i="⊇",t6i="⫄",i6i="⊃",r6i="⊇",n6i="⟉",s6i="⫗",o6i="⥻",a6i="⫂",l6i="⫌",u6i="⊋",c6i="⫀",h6i="⊃",d6i="⋑",p6i="⊇",f6i="⫆",m6i="⊋",g6i="⫌",y6i="⫈",v6i="⫔",_6i="⫖",b6i="⤦",w6i="↙",x6i="⇙",S6i="↙",T6i="⤪",C6i="ß",E6i=" ",I6i="⌖",A6i="Τ",M6i="τ",O6i="⎴",P6i="Ť",R6i="ť",D6i="Ţ",F6i="ţ",k6i="Т",L6i="т",N6i="⃛",$6i="⌕",B6i="𝔗",j6i="𝔱",G6i="∴",U6i="∴",z6i="∴",V6i="Θ",H6i="θ",W6i="ϑ",q6i="ϑ",Y6i="≈",X6i="∼",J6i="  ",K6i=" ",Z6i=" ",Q6i="≈",e8i="∼",t8i="Þ",i8i="þ",r8i="˜",n8i="∼",s8i="≃",o8i="≅",a8i="≈",l8i="⨱",u8i="⊠",c8i="×",h8i="⨰",d8i="∭",p8i="⤨",f8i="⌶",m8i="⫱",g8i="⊤",y8i="𝕋",v8i="𝕥",_8i="⫚",b8i="⤩",w8i="‴",x8i="™",S8i="™",T8i="▵",C8i="▿",E8i="◃",I8i="⊴",A8i="≜",M8i="▹",O8i="⊵",P8i="◬",R8i="≜",D8i="⨺",F8i="⃛",k8i="⨹",L8i="⧍",N8i="⨻",$8i="⏢",B8i="𝒯",j8i="𝓉",G8i="Ц",U8i="ц",z8i="Ћ",V8i="ћ",H8i="Ŧ",W8i="ŧ",q8i="≬",Y8i="↞",X8i="↠",J8i="Ú",K8i="ú",Z8i="↑",Q8i="↟",e9i="⇑",t9i="⥉",i9i="Ў",r9i="ў",n9i="Ŭ",s9i="ŭ",o9i="Û",a9i="û",l9i="У",u9i="у",c9i="⇅",h9i="Ű",d9i="ű",p9i="⥮",f9i="⥾",m9i="𝔘",g9i="𝔲",y9i="Ù",v9i="ù",_9i="⥣",b9i="↿",w9i="↾",x9i="▀",S9i="⌜",T9i="⌜",C9i="⌏",E9i="◸",I9i="Ū",A9i="ū",M9i="¨",O9i="_",P9i="⏟",R9i="⎵",D9i="⏝",F9i="⋃",k9i="⊎",L9i="Ų",N9i="ų",$9i="𝕌",B9i="𝕦",j9i="⤒",G9i="↑",U9i="↑",z9i="⇑",V9i="⇅",H9i="↕",W9i="↕",q9i="⇕",Y9i="⥮",X9i="↿",J9i="↾",K9i="⊎",Z9i="↖",Q9i="↗",eBi="υ",tBi="ϒ",iBi="ϒ",rBi="Υ",nBi="υ",sBi="↥",oBi="⊥",aBi="⇈",lBi="⌝",uBi="⌝",cBi="⌎",hBi="Ů",dBi="ů",pBi="◹",fBi="𝒰",mBi="𝓊",gBi="⋰",yBi="Ũ",vBi="ũ",_Bi="▵",bBi="▴",wBi="⇈",xBi="Ü",SBi="ü",TBi="⦧",CBi="⦜",EBi="ϵ",IBi="ϰ",ABi="∅",MBi="ϕ",OBi="ϖ",PBi="∝",RBi="↕",DBi="⇕",FBi="ϱ",kBi="ς",LBi="⊊︀",NBi="⫋︀",$Bi="⊋︀",BBi="⫌︀",jBi="ϑ",GBi="⊲",UBi="⊳",zBi="⫨",VBi="⫫",HBi="⫩",WBi="В",qBi="в",YBi="⊢",XBi="⊨",JBi="⊩",KBi="⊫",ZBi="⫦",QBi="⊻",e7i="∨",t7i="⋁",i7i="≚",r7i="⋮",n7i="|",s7i="‖",o7i="|",a7i="‖",l7i="∣",u7i="|",c7i="❘",h7i="≀",d7i=" ",p7i="𝔙",f7i="𝔳",m7i="⊲",g7i="⊂⃒",y7i="⊃⃒",v7i="𝕍",_7i="𝕧",b7i="∝",w7i="⊳",x7i="𝒱",S7i="𝓋",T7i="⫋︀",C7i="⊊︀",E7i="⫌︀",I7i="⊋︀",A7i="⊪",M7i="⦚",O7i="Ŵ",P7i="ŵ",R7i="⩟",D7i="∧",F7i="⋀",k7i="≙",L7i="℘",N7i="𝔚",$7i="𝔴",B7i="𝕎",j7i="𝕨",G7i="℘",U7i="≀",z7i="≀",V7i="𝒲",H7i="𝓌",W7i="⋂",q7i="◯",Y7i="⋃",X7i="▽",J7i="𝔛",K7i="𝔵",Z7i="⟷",Q7i="⟺",eji="Ξ",tji="ξ",iji="⟵",rji="⟸",nji="⟼",sji="⋻",oji="⨀",aji="𝕏",lji="𝕩",uji="⨁",cji="⨂",hji="⟶",dji="⟹",pji="𝒳",fji="𝓍",mji="⨆",gji="⨄",yji="△",vji="⋁",_ji="⋀",bji="Ý",wji="ý",xji="Я",Sji="я",Tji="Ŷ",Cji="ŷ",Eji="Ы",Iji="ы",Aji="¥",Mji="𝔜",Oji="𝔶",Pji="Ї",Rji="ї",Dji="𝕐",Fji="𝕪",kji="𝒴",Lji="𝓎",Nji="Ю",$ji="ю",Bji="ÿ",jji="Ÿ",Gji="Ź",Uji="ź",zji="Ž",Vji="ž",Hji="З",Wji="з",qji="Ż",Yji="ż",Xji="ℨ",Jji="​",Kji="Ζ",Zji="ζ",Qji="𝔷",eGi="ℨ",tGi="Ж",iGi="ж",rGi="⇝",nGi="𝕫",sGi="ℤ",oGi="𝒵",aGi="𝓏",lGi="‍",uGi="‌",cGi={Aacute:qhi,aacute:Yhi,Abreve:Xhi,abreve:Jhi,ac:Khi,acd:Zhi,acE:Qhi,Acirc:edi,acirc:tdi,acute:idi,Acy:rdi,acy:ndi,AElig:sdi,aelig:odi,af:adi,Afr:ldi,afr:udi,Agrave:cdi,agrave:hdi,alefsym:ddi,aleph:pdi,Alpha:fdi,alpha:mdi,Amacr:gdi,amacr:ydi,amalg:vdi,amp:_di,AMP:bdi,andand:wdi,And:xdi,and:Sdi,andd:Tdi,andslope:Cdi,andv:Edi,ang:Idi,ange:Adi,angle:Mdi,angmsdaa:Odi,angmsdab:Pdi,angmsdac:Rdi,angmsdad:Ddi,angmsdae:Fdi,angmsdaf:kdi,angmsdag:Ldi,angmsdah:Ndi,angmsd:$di,angrt:Bdi,angrtvb:jdi,angrtvbd:Gdi,angsph:Udi,angst:zdi,angzarr:Vdi,Aogon:Hdi,aogon:Wdi,Aopf:qdi,aopf:Ydi,apacir:Xdi,ap:Jdi,apE:Kdi,ape:Zdi,apid:Qdi,apos:epi,ApplyFunction:tpi,approx:ipi,approxeq:rpi,Aring:npi,aring:spi,Ascr:opi,ascr:api,Assign:lpi,ast:upi,asymp:cpi,asympeq:hpi,Atilde:dpi,atilde:ppi,Auml:fpi,auml:mpi,awconint:gpi,awint:ypi,backcong:vpi,backepsilon:_pi,backprime:bpi,backsim:wpi,backsimeq:xpi,Backslash:Spi,Barv:Tpi,barvee:Cpi,barwed:Epi,Barwed:Ipi,barwedge:Api,bbrk:Mpi,bbrktbrk:Opi,bcong:Ppi,Bcy:Rpi,bcy:Dpi,bdquo:Fpi,becaus:kpi,because:Lpi,Because:Npi,bemptyv:$pi,bepsi:Bpi,bernou:jpi,Bernoullis:Gpi,Beta:Upi,beta:zpi,beth:Vpi,between:Hpi,Bfr:Wpi,bfr:qpi,bigcap:Ypi,bigcirc:Xpi,bigcup:Jpi,bigodot:Kpi,bigoplus:Zpi,bigotimes:Qpi,bigsqcup:efi,bigstar:tfi,bigtriangledown:ifi,bigtriangleup:rfi,biguplus:nfi,bigvee:sfi,bigwedge:ofi,bkarow:afi,blacklozenge:lfi,blacksquare:ufi,blacktriangle:cfi,blacktriangledown:hfi,blacktriangleleft:dfi,blacktriangleright:pfi,blank:ffi,blk12:mfi,blk14:gfi,blk34:yfi,block:vfi,bne:_fi,bnequiv:bfi,bNot:wfi,bnot:xfi,Bopf:Sfi,bopf:Tfi,bot:Cfi,bottom:Efi,bowtie:Ifi,boxbox:Afi,boxdl:Mfi,boxdL:Ofi,boxDl:Pfi,boxDL:Rfi,boxdr:Dfi,boxdR:Ffi,boxDr:kfi,boxDR:Lfi,boxh:Nfi,boxH:$fi,boxhd:Bfi,boxHd:jfi,boxhD:Gfi,boxHD:Ufi,boxhu:zfi,boxHu:Vfi,boxhU:Hfi,boxHU:Wfi,boxminus:qfi,boxplus:Yfi,boxtimes:Xfi,boxul:Jfi,boxuL:Kfi,boxUl:Zfi,boxUL:Qfi,boxur:emi,boxuR:tmi,boxUr:imi,boxUR:rmi,boxv:nmi,boxV:smi,boxvh:omi,boxvH:ami,boxVh:lmi,boxVH:umi,boxvl:cmi,boxvL:hmi,boxVl:dmi,boxVL:pmi,boxvr:fmi,boxvR:mmi,boxVr:gmi,boxVR:ymi,bprime:vmi,breve:_mi,Breve:bmi,brvbar:wmi,bscr:xmi,Bscr:Smi,bsemi:Tmi,bsim:Cmi,bsime:Emi,bsolb:Imi,bsol:Ami,bsolhsub:Mmi,bull:Omi,bullet:Pmi,bump:Rmi,bumpE:Dmi,bumpe:Fmi,Bumpeq:kmi,bumpeq:Lmi,Cacute:Nmi,cacute:$mi,capand:Bmi,capbrcup:jmi,capcap:Gmi,cap:Umi,Cap:zmi,capcup:Vmi,capdot:Hmi,CapitalDifferentialD:Wmi,caps:qmi,caret:Ymi,caron:Xmi,Cayleys:Jmi,ccaps:Kmi,Ccaron:Zmi,ccaron:Qmi,Ccedil:egi,ccedil:tgi,Ccirc:igi,ccirc:rgi,Cconint:ngi,ccups:sgi,ccupssm:ogi,Cdot:agi,cdot:lgi,cedil:ugi,Cedilla:cgi,cemptyv:hgi,cent:dgi,centerdot:pgi,CenterDot:fgi,cfr:mgi,Cfr:ggi,CHcy:ygi,chcy:vgi,check:_gi,checkmark:bgi,Chi:wgi,chi:xgi,circ:Sgi,circeq:Tgi,circlearrowleft:Cgi,circlearrowright:Egi,circledast:Igi,circledcirc:Agi,circleddash:Mgi,CircleDot:Ogi,circledR:Pgi,circledS:Rgi,CircleMinus:Dgi,CirclePlus:Fgi,CircleTimes:kgi,cir:Lgi,cirE:Ngi,cire:$gi,cirfnint:Bgi,cirmid:jgi,cirscir:Ggi,ClockwiseContourIntegral:Ugi,CloseCurlyDoubleQuote:zgi,CloseCurlyQuote:Vgi,clubs:Hgi,clubsuit:Wgi,colon:qgi,Colon:Ygi,Colone:Xgi,colone:Jgi,coloneq:Kgi,comma:Zgi,commat:Qgi,comp:eyi,compfn:tyi,complement:iyi,complexes:ryi,cong:nyi,congdot:syi,Congruent:oyi,conint:ayi,Conint:lyi,ContourIntegral:uyi,copf:cyi,Copf:hyi,coprod:dyi,Coproduct:pyi,copy:fyi,COPY:myi,copysr:gyi,CounterClockwiseContourIntegral:yyi,crarr:vyi,cross:_yi,Cross:byi,Cscr:wyi,cscr:xyi,csub:Syi,csube:Tyi,csup:Cyi,csupe:Eyi,ctdot:Iyi,cudarrl:Ayi,cudarrr:Myi,cuepr:Oyi,cuesc:Pyi,cularr:Ryi,cularrp:Dyi,cupbrcap:Fyi,cupcap:kyi,CupCap:Lyi,cup:Nyi,Cup:$yi,cupcup:Byi,cupdot:jyi,cupor:Gyi,cups:Uyi,curarr:zyi,curarrm:Vyi,curlyeqprec:Hyi,curlyeqsucc:Wyi,curlyvee:qyi,curlywedge:Yyi,curren:Xyi,curvearrowleft:Jyi,curvearrowright:Kyi,cuvee:Zyi,cuwed:Qyi,cwconint:e0i,cwint:t0i,cylcty:i0i,dagger:r0i,Dagger:n0i,daleth:s0i,darr:o0i,Darr:a0i,dArr:l0i,dash:u0i,Dashv:c0i,dashv:h0i,dbkarow:d0i,dblac:p0i,Dcaron:f0i,dcaron:m0i,Dcy:g0i,dcy:y0i,ddagger:v0i,ddarr:_0i,DD:b0i,dd:w0i,DDotrahd:x0i,ddotseq:S0i,deg:T0i,Del:C0i,Delta:E0i,delta:I0i,demptyv:A0i,dfisht:M0i,Dfr:O0i,dfr:P0i,dHar:R0i,dharl:D0i,dharr:F0i,DiacriticalAcute:k0i,DiacriticalDot:L0i,DiacriticalDoubleAcute:N0i,DiacriticalGrave:$0i,DiacriticalTilde:B0i,diam:j0i,diamond:G0i,Diamond:U0i,diamondsuit:z0i,diams:V0i,die:H0i,DifferentialD:W0i,digamma:q0i,disin:Y0i,div:X0i,divide:J0i,divideontimes:K0i,divonx:Z0i,DJcy:Q0i,djcy:evi,dlcorn:tvi,dlcrop:ivi,dollar:rvi,Dopf:nvi,dopf:svi,Dot:ovi,dot:avi,DotDot:lvi,doteq:uvi,doteqdot:cvi,DotEqual:hvi,dotminus:dvi,dotplus:pvi,dotsquare:fvi,doublebarwedge:mvi,DoubleContourIntegral:gvi,DoubleDot:yvi,DoubleDownArrow:vvi,DoubleLeftArrow:_vi,DoubleLeftRightArrow:bvi,DoubleLeftTee:wvi,DoubleLongLeftArrow:xvi,DoubleLongLeftRightArrow:Svi,DoubleLongRightArrow:Tvi,DoubleRightArrow:Cvi,DoubleRightTee:Evi,DoubleUpArrow:Ivi,DoubleUpDownArrow:Avi,DoubleVerticalBar:Mvi,DownArrowBar:Ovi,downarrow:Pvi,DownArrow:Rvi,Downarrow:Dvi,DownArrowUpArrow:Fvi,DownBreve:kvi,downdownarrows:Lvi,downharpoonleft:Nvi,downharpoonright:$vi,DownLeftRightVector:Bvi,DownLeftTeeVector:jvi,DownLeftVectorBar:Gvi,DownLeftVector:Uvi,DownRightTeeVector:zvi,DownRightVectorBar:Vvi,DownRightVector:Hvi,DownTeeArrow:Wvi,DownTee:qvi,drbkarow:Yvi,drcorn:Xvi,drcrop:Jvi,Dscr:Kvi,dscr:Zvi,DScy:Qvi,dscy:e1i,dsol:t1i,Dstrok:i1i,dstrok:r1i,dtdot:n1i,dtri:s1i,dtrif:o1i,duarr:a1i,duhar:l1i,dwangle:u1i,DZcy:c1i,dzcy:h1i,dzigrarr:d1i,Eacute:p1i,eacute:f1i,easter:m1i,Ecaron:g1i,ecaron:y1i,Ecirc:v1i,ecirc:_1i,ecir:b1i,ecolon:w1i,Ecy:x1i,ecy:S1i,eDDot:T1i,Edot:C1i,edot:E1i,eDot:I1i,ee:A1i,efDot:M1i,Efr:O1i,efr:P1i,eg:R1i,Egrave:D1i,egrave:F1i,egs:k1i,egsdot:L1i,el:N1i,Element:$1i,elinters:B1i,ell:j1i,els:G1i,elsdot:U1i,Emacr:z1i,emacr:V1i,empty:H1i,emptyset:W1i,EmptySmallSquare:q1i,emptyv:Y1i,EmptyVerySmallSquare:X1i,emsp13:J1i,emsp14:K1i,emsp:Z1i,ENG:Q1i,eng:e_i,ensp:t_i,Eogon:i_i,eogon:r_i,Eopf:n_i,eopf:s_i,epar:o_i,eparsl:a_i,eplus:l_i,epsi:u_i,Epsilon:c_i,epsilon:h_i,epsiv:d_i,eqcirc:p_i,eqcolon:f_i,eqsim:m_i,eqslantgtr:g_i,eqslantless:y_i,Equal:v_i,equals:__i,EqualTilde:b_i,equest:w_i,Equilibrium:x_i,equiv:S_i,equivDD:T_i,eqvparsl:C_i,erarr:E_i,erDot:I_i,escr:A_i,Escr:M_i,esdot:O_i,Esim:P_i,esim:R_i,Eta:D_i,eta:F_i,ETH:k_i,eth:L_i,Euml:N_i,euml:$_i,euro:B_i,excl:j_i,exist:G_i,Exists:U_i,expectation:z_i,exponentiale:V_i,ExponentialE:H_i,fallingdotseq:W_i,Fcy:q_i,fcy:Y_i,female:X_i,ffilig:J_i,fflig:K_i,ffllig:Z_i,Ffr:Q_i,ffr:ebi,filig:tbi,FilledSmallSquare:ibi,FilledVerySmallSquare:rbi,fjlig:nbi,flat:sbi,fllig:obi,fltns:abi,fnof:lbi,Fopf:ubi,fopf:cbi,forall:hbi,ForAll:dbi,fork:pbi,forkv:fbi,Fouriertrf:mbi,fpartint:gbi,frac12:ybi,frac13:vbi,frac14:_bi,frac15:bbi,frac16:wbi,frac18:xbi,frac23:Sbi,frac25:Tbi,frac34:Cbi,frac35:Ebi,frac38:Ibi,frac45:Abi,frac56:Mbi,frac58:Obi,frac78:Pbi,frasl:Rbi,frown:Dbi,fscr:Fbi,Fscr:kbi,gacute:Lbi,Gamma:Nbi,gamma:$bi,Gammad:Bbi,gammad:jbi,gap:Gbi,Gbreve:Ubi,gbreve:zbi,Gcedil:Vbi,Gcirc:Hbi,gcirc:Wbi,Gcy:qbi,gcy:Ybi,Gdot:Xbi,gdot:Jbi,ge:Kbi,gE:Zbi,gEl:Qbi,gel:ewi,geq:twi,geqq:iwi,geqslant:rwi,gescc:nwi,ges:swi,gesdot:owi,gesdoto:awi,gesdotol:lwi,gesl:uwi,gesles:cwi,Gfr:hwi,gfr:dwi,gg:pwi,Gg:fwi,ggg:mwi,gimel:gwi,GJcy:ywi,gjcy:vwi,gla:_wi,gl:bwi,glE:wwi,glj:xwi,gnap:Swi,gnapprox:Twi,gne:Cwi,gnE:Ewi,gneq:Iwi,gneqq:Awi,gnsim:Mwi,Gopf:Owi,gopf:Pwi,grave:Rwi,GreaterEqual:Dwi,GreaterEqualLess:Fwi,GreaterFullEqual:kwi,GreaterGreater:Lwi,GreaterLess:Nwi,GreaterSlantEqual:$wi,GreaterTilde:Bwi,Gscr:jwi,gscr:Gwi,gsim:Uwi,gsime:zwi,gsiml:Vwi,gtcc:Hwi,gtcir:Wwi,gt:qwi,GT:Ywi,Gt:Xwi,gtdot:Jwi,gtlPar:Kwi,gtquest:Zwi,gtrapprox:Qwi,gtrarr:exi,gtrdot:txi,gtreqless:ixi,gtreqqless:rxi,gtrless:nxi,gtrsim:sxi,gvertneqq:oxi,gvnE:axi,Hacek:lxi,hairsp:uxi,half:cxi,hamilt:hxi,HARDcy:dxi,hardcy:pxi,harrcir:fxi,harr:mxi,hArr:gxi,harrw:yxi,Hat:vxi,hbar:_xi,Hcirc:bxi,hcirc:wxi,hearts:xxi,heartsuit:Sxi,hellip:Txi,hercon:Cxi,hfr:Exi,Hfr:Ixi,HilbertSpace:Axi,hksearow:Mxi,hkswarow:Oxi,hoarr:Pxi,homtht:Rxi,hookleftarrow:Dxi,hookrightarrow:Fxi,hopf:kxi,Hopf:Lxi,horbar:Nxi,HorizontalLine:$xi,hscr:Bxi,Hscr:jxi,hslash:Gxi,Hstrok:Uxi,hstrok:zxi,HumpDownHump:Vxi,HumpEqual:Hxi,hybull:Wxi,hyphen:qxi,Iacute:Yxi,iacute:Xxi,ic:Jxi,Icirc:Kxi,icirc:Zxi,Icy:Qxi,icy:e2i,Idot:t2i,IEcy:i2i,iecy:r2i,iexcl:n2i,iff:s2i,ifr:o2i,Ifr:a2i,Igrave:l2i,igrave:u2i,ii:c2i,iiiint:h2i,iiint:d2i,iinfin:p2i,iiota:f2i,IJlig:m2i,ijlig:g2i,Imacr:y2i,imacr:v2i,image:_2i,ImaginaryI:b2i,imagline:w2i,imagpart:x2i,imath:S2i,Im:T2i,imof:C2i,imped:E2i,Implies:I2i,incare:A2i,in:"∈",infin:M2i,infintie:O2i,inodot:P2i,intcal:R2i,int:D2i,Int:F2i,integers:k2i,Integral:L2i,intercal:N2i,Intersection:$2i,intlarhk:B2i,intprod:j2i,InvisibleComma:G2i,InvisibleTimes:U2i,IOcy:z2i,iocy:V2i,Iogon:H2i,iogon:W2i,Iopf:q2i,iopf:Y2i,Iota:X2i,iota:J2i,iprod:K2i,iquest:Z2i,iscr:Q2i,Iscr:eSi,isin:tSi,isindot:iSi,isinE:rSi,isins:nSi,isinsv:sSi,isinv:oSi,it:aSi,Itilde:lSi,itilde:uSi,Iukcy:cSi,iukcy:hSi,Iuml:dSi,iuml:pSi,Jcirc:fSi,jcirc:mSi,Jcy:gSi,jcy:ySi,Jfr:vSi,jfr:_Si,jmath:bSi,Jopf:wSi,jopf:xSi,Jscr:SSi,jscr:TSi,Jsercy:CSi,jsercy:ESi,Jukcy:ISi,jukcy:ASi,Kappa:MSi,kappa:OSi,kappav:PSi,Kcedil:RSi,kcedil:DSi,Kcy:FSi,kcy:kSi,Kfr:LSi,kfr:NSi,kgreen:$Si,KHcy:BSi,khcy:jSi,KJcy:GSi,kjcy:USi,Kopf:zSi,kopf:VSi,Kscr:HSi,kscr:WSi,lAarr:qSi,Lacute:YSi,lacute:XSi,laemptyv:JSi,lagran:KSi,Lambda:ZSi,lambda:QSi,lang:eTi,Lang:tTi,langd:iTi,langle:rTi,lap:nTi,Laplacetrf:sTi,laquo:oTi,larrb:aTi,larrbfs:lTi,larr:uTi,Larr:cTi,lArr:hTi,larrfs:dTi,larrhk:pTi,larrlp:fTi,larrpl:mTi,larrsim:gTi,larrtl:yTi,latail:vTi,lAtail:_Ti,lat:bTi,late:wTi,lates:xTi,lbarr:STi,lBarr:TTi,lbbrk:CTi,lbrace:ETi,lbrack:ITi,lbrke:ATi,lbrksld:MTi,lbrkslu:OTi,Lcaron:PTi,lcaron:RTi,Lcedil:DTi,lcedil:FTi,lceil:kTi,lcub:LTi,Lcy:NTi,lcy:$Ti,ldca:BTi,ldquo:jTi,ldquor:GTi,ldrdhar:UTi,ldrushar:zTi,ldsh:VTi,le:HTi,lE:WTi,LeftAngleBracket:qTi,LeftArrowBar:YTi,leftarrow:XTi,LeftArrow:JTi,Leftarrow:KTi,LeftArrowRightArrow:ZTi,leftarrowtail:QTi,LeftCeiling:eCi,LeftDoubleBracket:tCi,LeftDownTeeVector:iCi,LeftDownVectorBar:rCi,LeftDownVector:nCi,LeftFloor:sCi,leftharpoondown:oCi,leftharpoonup:aCi,leftleftarrows:lCi,leftrightarrow:uCi,LeftRightArrow:cCi,Leftrightarrow:hCi,leftrightarrows:dCi,leftrightharpoons:pCi,leftrightsquigarrow:fCi,LeftRightVector:mCi,LeftTeeArrow:gCi,LeftTee:yCi,LeftTeeVector:vCi,leftthreetimes:_Ci,LeftTriangleBar:bCi,LeftTriangle:wCi,LeftTriangleEqual:xCi,LeftUpDownVector:SCi,LeftUpTeeVector:TCi,LeftUpVectorBar:CCi,LeftUpVector:ECi,LeftVectorBar:ICi,LeftVector:ACi,lEg:MCi,leg:OCi,leq:PCi,leqq:RCi,leqslant:DCi,lescc:FCi,les:kCi,lesdot:LCi,lesdoto:NCi,lesdotor:$Ci,lesg:BCi,lesges:jCi,lessapprox:GCi,lessdot:UCi,lesseqgtr:zCi,lesseqqgtr:VCi,LessEqualGreater:HCi,LessFullEqual:WCi,LessGreater:qCi,lessgtr:YCi,LessLess:XCi,lesssim:JCi,LessSlantEqual:KCi,LessTilde:ZCi,lfisht:QCi,lfloor:eEi,Lfr:tEi,lfr:iEi,lg:rEi,lgE:nEi,lHar:sEi,lhard:oEi,lharu:aEi,lharul:lEi,lhblk:uEi,LJcy:cEi,ljcy:hEi,llarr:dEi,ll:pEi,Ll:fEi,llcorner:mEi,Lleftarrow:gEi,llhard:yEi,lltri:vEi,Lmidot:_Ei,lmidot:bEi,lmoustache:wEi,lmoust:xEi,lnap:SEi,lnapprox:TEi,lne:CEi,lnE:EEi,lneq:IEi,lneqq:AEi,lnsim:MEi,loang:OEi,loarr:PEi,lobrk:REi,longleftarrow:DEi,LongLeftArrow:FEi,Longleftarrow:kEi,longleftrightarrow:LEi,LongLeftRightArrow:NEi,Longleftrightarrow:$Ei,longmapsto:BEi,longrightarrow:jEi,LongRightArrow:GEi,Longrightarrow:UEi,looparrowleft:zEi,looparrowright:VEi,lopar:HEi,Lopf:WEi,lopf:qEi,loplus:YEi,lotimes:XEi,lowast:JEi,lowbar:KEi,LowerLeftArrow:ZEi,LowerRightArrow:QEi,loz:eIi,lozenge:tIi,lozf:iIi,lpar:rIi,lparlt:nIi,lrarr:sIi,lrcorner:oIi,lrhar:aIi,lrhard:lIi,lrm:uIi,lrtri:cIi,lsaquo:hIi,lscr:dIi,Lscr:pIi,lsh:fIi,Lsh:mIi,lsim:gIi,lsime:yIi,lsimg:vIi,lsqb:_Ii,lsquo:bIi,lsquor:wIi,Lstrok:xIi,lstrok:SIi,ltcc:TIi,ltcir:CIi,lt:EIi,LT:IIi,Lt:AIi,ltdot:MIi,lthree:OIi,ltimes:PIi,ltlarr:RIi,ltquest:DIi,ltri:FIi,ltrie:kIi,ltrif:LIi,ltrPar:NIi,lurdshar:$Ii,luruhar:BIi,lvertneqq:jIi,lvnE:GIi,macr:UIi,male:zIi,malt:VIi,maltese:HIi,Map:"⤅",map:WIi,mapsto:qIi,mapstodown:YIi,mapstoleft:XIi,mapstoup:JIi,marker:KIi,mcomma:ZIi,Mcy:QIi,mcy:eAi,mdash:tAi,mDDot:iAi,measuredangle:rAi,MediumSpace:nAi,Mellintrf:sAi,Mfr:oAi,mfr:aAi,mho:lAi,micro:uAi,midast:cAi,midcir:hAi,mid:dAi,middot:pAi,minusb:fAi,minus:mAi,minusd:gAi,minusdu:yAi,MinusPlus:vAi,mlcp:_Ai,mldr:bAi,mnplus:wAi,models:xAi,Mopf:SAi,mopf:TAi,mp:CAi,mscr:EAi,Mscr:IAi,mstpos:AAi,Mu:MAi,mu:OAi,multimap:PAi,mumap:RAi,nabla:DAi,Nacute:FAi,nacute:kAi,nang:LAi,nap:NAi,napE:$Ai,napid:BAi,napos:jAi,napprox:GAi,natural:UAi,naturals:zAi,natur:VAi,nbsp:HAi,nbump:WAi,nbumpe:qAi,ncap:YAi,Ncaron:XAi,ncaron:JAi,Ncedil:KAi,ncedil:ZAi,ncong:QAi,ncongdot:e3i,ncup:t3i,Ncy:i3i,ncy:r3i,ndash:n3i,nearhk:s3i,nearr:o3i,neArr:a3i,nearrow:l3i,ne:u3i,nedot:c3i,NegativeMediumSpace:h3i,NegativeThickSpace:d3i,NegativeThinSpace:p3i,NegativeVeryThinSpace:f3i,nequiv:m3i,nesear:g3i,nesim:y3i,NestedGreaterGreater:v3i,NestedLessLess:_3i,NewLine:b3i,nexist:w3i,nexists:x3i,Nfr:S3i,nfr:T3i,ngE:C3i,nge:E3i,ngeq:I3i,ngeqq:A3i,ngeqslant:M3i,nges:O3i,nGg:P3i,ngsim:R3i,nGt:D3i,ngt:F3i,ngtr:k3i,nGtv:L3i,nharr:N3i,nhArr:$3i,nhpar:B3i,ni:j3i,nis:G3i,nisd:U3i,niv:z3i,NJcy:V3i,njcy:H3i,nlarr:W3i,nlArr:q3i,nldr:Y3i,nlE:X3i,nle:J3i,nleftarrow:K3i,nLeftarrow:Z3i,nleftrightarrow:Q3i,nLeftrightarrow:eMi,nleq:tMi,nleqq:iMi,nleqslant:rMi,nles:nMi,nless:sMi,nLl:oMi,nlsim:aMi,nLt:lMi,nlt:uMi,nltri:cMi,nltrie:hMi,nLtv:dMi,nmid:pMi,NoBreak:fMi,NonBreakingSpace:mMi,nopf:gMi,Nopf:yMi,Not:vMi,not:_Mi,NotCongruent:bMi,NotCupCap:wMi,NotDoubleVerticalBar:xMi,NotElement:SMi,NotEqual:TMi,NotEqualTilde:CMi,NotExists:EMi,NotGreater:IMi,NotGreaterEqual:AMi,NotGreaterFullEqual:MMi,NotGreaterGreater:OMi,NotGreaterLess:PMi,NotGreaterSlantEqual:RMi,NotGreaterTilde:DMi,NotHumpDownHump:FMi,NotHumpEqual:kMi,notin:LMi,notindot:NMi,notinE:$Mi,notinva:BMi,notinvb:jMi,notinvc:GMi,NotLeftTriangleBar:UMi,NotLeftTriangle:zMi,NotLeftTriangleEqual:VMi,NotLess:HMi,NotLessEqual:WMi,NotLessGreater:qMi,NotLessLess:YMi,NotLessSlantEqual:XMi,NotLessTilde:JMi,NotNestedGreaterGreater:KMi,NotNestedLessLess:ZMi,notni:QMi,notniva:eOi,notnivb:tOi,notnivc:iOi,NotPrecedes:rOi,NotPrecedesEqual:nOi,NotPrecedesSlantEqual:sOi,NotReverseElement:oOi,NotRightTriangleBar:aOi,NotRightTriangle:lOi,NotRightTriangleEqual:uOi,NotSquareSubset:cOi,NotSquareSubsetEqual:hOi,NotSquareSuperset:dOi,NotSquareSupersetEqual:pOi,NotSubset:fOi,NotSubsetEqual:mOi,NotSucceeds:gOi,NotSucceedsEqual:yOi,NotSucceedsSlantEqual:vOi,NotSucceedsTilde:_Oi,NotSuperset:bOi,NotSupersetEqual:wOi,NotTilde:xOi,NotTildeEqual:SOi,NotTildeFullEqual:TOi,NotTildeTilde:COi,NotVerticalBar:EOi,nparallel:IOi,npar:AOi,nparsl:MOi,npart:OOi,npolint:POi,npr:ROi,nprcue:DOi,nprec:FOi,npreceq:kOi,npre:LOi,nrarrc:NOi,nrarr:$Oi,nrArr:BOi,nrarrw:jOi,nrightarrow:GOi,nRightarrow:UOi,nrtri:zOi,nrtrie:VOi,nsc:HOi,nsccue:WOi,nsce:qOi,Nscr:YOi,nscr:XOi,nshortmid:JOi,nshortparallel:KOi,nsim:ZOi,nsime:QOi,nsimeq:ePi,nsmid:tPi,nspar:iPi,nsqsube:rPi,nsqsupe:nPi,nsub:sPi,nsubE:oPi,nsube:aPi,nsubset:lPi,nsubseteq:uPi,nsubseteqq:cPi,nsucc:hPi,nsucceq:dPi,nsup:pPi,nsupE:fPi,nsupe:mPi,nsupset:gPi,nsupseteq:yPi,nsupseteqq:vPi,ntgl:_Pi,Ntilde:bPi,ntilde:wPi,ntlg:xPi,ntriangleleft:SPi,ntrianglelefteq:TPi,ntriangleright:CPi,ntrianglerighteq:EPi,Nu:IPi,nu:APi,num:MPi,numero:OPi,numsp:PPi,nvap:RPi,nvdash:DPi,nvDash:FPi,nVdash:kPi,nVDash:LPi,nvge:NPi,nvgt:$Pi,nvHarr:BPi,nvinfin:jPi,nvlArr:GPi,nvle:UPi,nvlt:zPi,nvltrie:VPi,nvrArr:HPi,nvrtrie:WPi,nvsim:qPi,nwarhk:YPi,nwarr:XPi,nwArr:JPi,nwarrow:KPi,nwnear:ZPi,Oacute:QPi,oacute:eRi,oast:tRi,Ocirc:iRi,ocirc:rRi,ocir:nRi,Ocy:sRi,ocy:oRi,odash:aRi,Odblac:lRi,odblac:uRi,odiv:cRi,odot:hRi,odsold:dRi,OElig:pRi,oelig:fRi,ofcir:mRi,Ofr:gRi,ofr:yRi,ogon:vRi,Ograve:_Ri,ograve:bRi,ogt:wRi,ohbar:xRi,ohm:SRi,oint:TRi,olarr:CRi,olcir:ERi,olcross:IRi,oline:ARi,olt:MRi,Omacr:ORi,omacr:PRi,Omega:RRi,omega:DRi,Omicron:FRi,omicron:kRi,omid:LRi,ominus:NRi,Oopf:$Ri,oopf:BRi,opar:jRi,OpenCurlyDoubleQuote:GRi,OpenCurlyQuote:URi,operp:zRi,oplus:VRi,orarr:HRi,Or:WRi,or:qRi,ord:YRi,order:XRi,orderof:JRi,ordf:KRi,ordm:ZRi,origof:QRi,oror:eDi,orslope:tDi,orv:iDi,oS:rDi,Oscr:nDi,oscr:sDi,Oslash:oDi,oslash:aDi,osol:lDi,Otilde:uDi,otilde:cDi,otimesas:hDi,Otimes:dDi,otimes:pDi,Ouml:fDi,ouml:mDi,ovbar:gDi,OverBar:yDi,OverBrace:vDi,OverBracket:_Di,OverParenthesis:bDi,para:wDi,parallel:xDi,par:SDi,parsim:TDi,parsl:CDi,part:EDi,PartialD:IDi,Pcy:ADi,pcy:MDi,percnt:ODi,period:PDi,permil:RDi,perp:DDi,pertenk:FDi,Pfr:kDi,pfr:LDi,Phi:NDi,phi:$Di,phiv:BDi,phmmat:jDi,phone:GDi,Pi:UDi,pi:zDi,pitchfork:VDi,piv:HDi,planck:WDi,planckh:qDi,plankv:YDi,plusacir:XDi,plusb:JDi,pluscir:KDi,plus:ZDi,plusdo:QDi,plusdu:e4i,pluse:t4i,PlusMinus:i4i,plusmn:r4i,plussim:n4i,plustwo:s4i,pm:o4i,Poincareplane:a4i,pointint:l4i,popf:u4i,Popf:c4i,pound:h4i,prap:d4i,Pr:p4i,pr:f4i,prcue:m4i,precapprox:g4i,prec:y4i,preccurlyeq:v4i,Precedes:_4i,PrecedesEqual:b4i,PrecedesSlantEqual:w4i,PrecedesTilde:x4i,preceq:S4i,precnapprox:T4i,precneqq:C4i,precnsim:E4i,pre:I4i,prE:A4i,precsim:M4i,prime:O4i,Prime:P4i,primes:R4i,prnap:D4i,prnE:F4i,prnsim:k4i,prod:L4i,Product:N4i,profalar:$4i,profline:B4i,profsurf:j4i,prop:G4i,Proportional:U4i,Proportion:z4i,propto:V4i,prsim:H4i,prurel:W4i,Pscr:q4i,pscr:Y4i,Psi:X4i,psi:J4i,puncsp:K4i,Qfr:Z4i,qfr:Q4i,qint:e5i,qopf:t5i,Qopf:i5i,qprime:r5i,Qscr:n5i,qscr:s5i,quaternions:o5i,quatint:a5i,quest:l5i,questeq:u5i,quot:c5i,QUOT:h5i,rAarr:d5i,race:p5i,Racute:f5i,racute:m5i,radic:g5i,raemptyv:y5i,rang:v5i,Rang:_5i,rangd:b5i,range:w5i,rangle:x5i,raquo:S5i,rarrap:T5i,rarrb:C5i,rarrbfs:E5i,rarrc:I5i,rarr:A5i,Rarr:M5i,rArr:O5i,rarrfs:P5i,rarrhk:R5i,rarrlp:D5i,rarrpl:F5i,rarrsim:k5i,Rarrtl:L5i,rarrtl:N5i,rarrw:$5i,ratail:B5i,rAtail:j5i,ratio:G5i,rationals:U5i,rbarr:z5i,rBarr:V5i,RBarr:H5i,rbbrk:W5i,rbrace:q5i,rbrack:Y5i,rbrke:X5i,rbrksld:J5i,rbrkslu:K5i,Rcaron:Z5i,rcaron:Q5i,Rcedil:eFi,rcedil:tFi,rceil:iFi,rcub:rFi,Rcy:nFi,rcy:sFi,rdca:oFi,rdldhar:aFi,rdquo:lFi,rdquor:uFi,rdsh:cFi,real:hFi,realine:dFi,realpart:pFi,reals:fFi,Re:mFi,rect:gFi,reg:yFi,REG:vFi,ReverseElement:_Fi,ReverseEquilibrium:bFi,ReverseUpEquilibrium:wFi,rfisht:xFi,rfloor:SFi,rfr:TFi,Rfr:CFi,rHar:EFi,rhard:IFi,rharu:AFi,rharul:MFi,Rho:OFi,rho:PFi,rhov:RFi,RightAngleBracket:DFi,RightArrowBar:FFi,rightarrow:kFi,RightArrow:LFi,Rightarrow:NFi,RightArrowLeftArrow:$Fi,rightarrowtail:BFi,RightCeiling:jFi,RightDoubleBracket:GFi,RightDownTeeVector:UFi,RightDownVectorBar:zFi,RightDownVector:VFi,RightFloor:HFi,rightharpoondown:WFi,rightharpoonup:qFi,rightleftarrows:YFi,rightleftharpoons:XFi,rightrightarrows:JFi,rightsquigarrow:KFi,RightTeeArrow:ZFi,RightTee:QFi,RightTeeVector:eki,rightthreetimes:tki,RightTriangleBar:iki,RightTriangle:rki,RightTriangleEqual:nki,RightUpDownVector:ski,RightUpTeeVector:oki,RightUpVectorBar:aki,RightUpVector:lki,RightVectorBar:uki,RightVector:cki,ring:hki,risingdotseq:dki,rlarr:pki,rlhar:fki,rlm:mki,rmoustache:gki,rmoust:yki,rnmid:vki,roang:_ki,roarr:bki,robrk:wki,ropar:xki,ropf:Ski,Ropf:Tki,roplus:Cki,rotimes:Eki,RoundImplies:Iki,rpar:Aki,rpargt:Mki,rppolint:Oki,rrarr:Pki,Rrightarrow:Rki,rsaquo:Dki,rscr:Fki,Rscr:kki,rsh:Lki,Rsh:Nki,rsqb:$ki,rsquo:Bki,rsquor:jki,rthree:Gki,rtimes:Uki,rtri:zki,rtrie:Vki,rtrif:Hki,rtriltri:Wki,RuleDelayed:qki,ruluhar:Yki,rx:Xki,Sacute:Jki,sacute:Kki,sbquo:Zki,scap:Qki,Scaron:eLi,scaron:tLi,Sc:iLi,sc:rLi,sccue:nLi,sce:sLi,scE:oLi,Scedil:aLi,scedil:lLi,Scirc:uLi,scirc:cLi,scnap:hLi,scnE:dLi,scnsim:pLi,scpolint:fLi,scsim:mLi,Scy:gLi,scy:yLi,sdotb:vLi,sdot:_Li,sdote:bLi,searhk:wLi,searr:xLi,seArr:SLi,searrow:TLi,sect:CLi,semi:ELi,seswar:ILi,setminus:ALi,setmn:MLi,sext:OLi,Sfr:PLi,sfr:RLi,sfrown:DLi,sharp:FLi,SHCHcy:kLi,shchcy:LLi,SHcy:NLi,shcy:$Li,ShortDownArrow:BLi,ShortLeftArrow:jLi,shortmid:GLi,shortparallel:ULi,ShortRightArrow:zLi,ShortUpArrow:VLi,shy:HLi,Sigma:WLi,sigma:qLi,sigmaf:YLi,sigmav:XLi,sim:JLi,simdot:KLi,sime:ZLi,simeq:QLi,simg:eNi,simgE:tNi,siml:iNi,simlE:rNi,simne:nNi,simplus:sNi,simrarr:oNi,slarr:aNi,SmallCircle:lNi,smallsetminus:uNi,smashp:cNi,smeparsl:hNi,smid:dNi,smile:pNi,smt:fNi,smte:mNi,smtes:gNi,SOFTcy:yNi,softcy:vNi,solbar:_Ni,solb:bNi,sol:wNi,Sopf:xNi,sopf:SNi,spades:TNi,spadesuit:CNi,spar:ENi,sqcap:INi,sqcaps:ANi,sqcup:MNi,sqcups:ONi,Sqrt:PNi,sqsub:RNi,sqsube:DNi,sqsubset:FNi,sqsubseteq:kNi,sqsup:LNi,sqsupe:NNi,sqsupset:$Ni,sqsupseteq:BNi,square:jNi,Square:GNi,SquareIntersection:UNi,SquareSubset:zNi,SquareSubsetEqual:VNi,SquareSuperset:HNi,SquareSupersetEqual:WNi,SquareUnion:qNi,squarf:YNi,squ:XNi,squf:JNi,srarr:KNi,Sscr:ZNi,sscr:QNi,ssetmn:e$i,ssmile:t$i,sstarf:i$i,Star:r$i,star:n$i,starf:s$i,straightepsilon:o$i,straightphi:a$i,strns:l$i,sub:u$i,Sub:c$i,subdot:h$i,subE:d$i,sube:p$i,subedot:f$i,submult:m$i,subnE:g$i,subne:y$i,subplus:v$i,subrarr:_$i,subset:b$i,Subset:w$i,subseteq:x$i,subseteqq:S$i,SubsetEqual:T$i,subsetneq:C$i,subsetneqq:E$i,subsim:I$i,subsub:A$i,subsup:M$i,succapprox:O$i,succ:P$i,succcurlyeq:R$i,Succeeds:D$i,SucceedsEqual:F$i,SucceedsSlantEqual:k$i,SucceedsTilde:L$i,succeq:N$i,succnapprox:$$i,succneqq:B$i,succnsim:j$i,succsim:G$i,SuchThat:U$i,sum:z$i,Sum:V$i,sung:H$i,sup1:W$i,sup2:q$i,sup3:Y$i,sup:X$i,Sup:J$i,supdot:K$i,supdsub:Z$i,supE:Q$i,supe:e6i,supedot:t6i,Superset:i6i,SupersetEqual:r6i,suphsol:n6i,suphsub:s6i,suplarr:o6i,supmult:a6i,supnE:l6i,supne:u6i,supplus:c6i,supset:h6i,Supset:d6i,supseteq:p6i,supseteqq:f6i,supsetneq:m6i,supsetneqq:g6i,supsim:y6i,supsub:v6i,supsup:_6i,swarhk:b6i,swarr:w6i,swArr:x6i,swarrow:S6i,swnwar:T6i,szlig:C6i,Tab:E6i,target:I6i,Tau:A6i,tau:M6i,tbrk:O6i,Tcaron:P6i,tcaron:R6i,Tcedil:D6i,tcedil:F6i,Tcy:k6i,tcy:L6i,tdot:N6i,telrec:$6i,Tfr:B6i,tfr:j6i,there4:G6i,therefore:U6i,Therefore:z6i,Theta:V6i,theta:H6i,thetasym:W6i,thetav:q6i,thickapprox:Y6i,thicksim:X6i,ThickSpace:J6i,ThinSpace:K6i,thinsp:Z6i,thkap:Q6i,thksim:e8i,THORN:t8i,thorn:i8i,tilde:r8i,Tilde:n8i,TildeEqual:s8i,TildeFullEqual:o8i,TildeTilde:a8i,timesbar:l8i,timesb:u8i,times:c8i,timesd:h8i,tint:d8i,toea:p8i,topbot:f8i,topcir:m8i,top:g8i,Topf:y8i,topf:v8i,topfork:_8i,tosa:b8i,tprime:w8i,trade:x8i,TRADE:S8i,triangle:T8i,triangledown:C8i,triangleleft:E8i,trianglelefteq:I8i,triangleq:A8i,triangleright:M8i,trianglerighteq:O8i,tridot:P8i,trie:R8i,triminus:D8i,TripleDot:F8i,triplus:k8i,trisb:L8i,tritime:N8i,trpezium:$8i,Tscr:B8i,tscr:j8i,TScy:G8i,tscy:U8i,TSHcy:z8i,tshcy:V8i,Tstrok:H8i,tstrok:W8i,twixt:q8i,twoheadleftarrow:Y8i,twoheadrightarrow:X8i,Uacute:J8i,uacute:K8i,uarr:Z8i,Uarr:Q8i,uArr:e9i,Uarrocir:t9i,Ubrcy:i9i,ubrcy:r9i,Ubreve:n9i,ubreve:s9i,Ucirc:o9i,ucirc:a9i,Ucy:l9i,ucy:u9i,udarr:c9i,Udblac:h9i,udblac:d9i,udhar:p9i,ufisht:f9i,Ufr:m9i,ufr:g9i,Ugrave:y9i,ugrave:v9i,uHar:_9i,uharl:b9i,uharr:w9i,uhblk:x9i,ulcorn:S9i,ulcorner:T9i,ulcrop:C9i,ultri:E9i,Umacr:I9i,umacr:A9i,uml:M9i,UnderBar:O9i,UnderBrace:P9i,UnderBracket:R9i,UnderParenthesis:D9i,Union:F9i,UnionPlus:k9i,Uogon:L9i,uogon:N9i,Uopf:$9i,uopf:B9i,UpArrowBar:j9i,uparrow:G9i,UpArrow:U9i,Uparrow:z9i,UpArrowDownArrow:V9i,updownarrow:H9i,UpDownArrow:W9i,Updownarrow:q9i,UpEquilibrium:Y9i,upharpoonleft:X9i,upharpoonright:J9i,uplus:K9i,UpperLeftArrow:Z9i,UpperRightArrow:Q9i,upsi:eBi,Upsi:tBi,upsih:iBi,Upsilon:rBi,upsilon:nBi,UpTeeArrow:sBi,UpTee:oBi,upuparrows:aBi,urcorn:lBi,urcorner:uBi,urcrop:cBi,Uring:hBi,uring:dBi,urtri:pBi,Uscr:fBi,uscr:mBi,utdot:gBi,Utilde:yBi,utilde:vBi,utri:_Bi,utrif:bBi,uuarr:wBi,Uuml:xBi,uuml:SBi,uwangle:TBi,vangrt:CBi,varepsilon:EBi,varkappa:IBi,varnothing:ABi,varphi:MBi,varpi:OBi,varpropto:PBi,varr:RBi,vArr:DBi,varrho:FBi,varsigma:kBi,varsubsetneq:LBi,varsubsetneqq:NBi,varsupsetneq:$Bi,varsupsetneqq:BBi,vartheta:jBi,vartriangleleft:GBi,vartriangleright:UBi,vBar:zBi,Vbar:VBi,vBarv:HBi,Vcy:WBi,vcy:qBi,vdash:YBi,vDash:XBi,Vdash:JBi,VDash:KBi,Vdashl:ZBi,veebar:QBi,vee:e7i,Vee:t7i,veeeq:i7i,vellip:r7i,verbar:n7i,Verbar:s7i,vert:o7i,Vert:a7i,VerticalBar:l7i,VerticalLine:u7i,VerticalSeparator:c7i,VerticalTilde:h7i,VeryThinSpace:d7i,Vfr:p7i,vfr:f7i,vltri:m7i,vnsub:g7i,vnsup:y7i,Vopf:v7i,vopf:_7i,vprop:b7i,vrtri:w7i,Vscr:x7i,vscr:S7i,vsubnE:T7i,vsubne:C7i,vsupnE:E7i,vsupne:I7i,Vvdash:A7i,vzigzag:M7i,Wcirc:O7i,wcirc:P7i,wedbar:R7i,wedge:D7i,Wedge:F7i,wedgeq:k7i,weierp:L7i,Wfr:N7i,wfr:$7i,Wopf:B7i,wopf:j7i,wp:G7i,wr:U7i,wreath:z7i,Wscr:V7i,wscr:H7i,xcap:W7i,xcirc:q7i,xcup:Y7i,xdtri:X7i,Xfr:J7i,xfr:K7i,xharr:Z7i,xhArr:Q7i,Xi:eji,xi:tji,xlarr:iji,xlArr:rji,xmap:nji,xnis:sji,xodot:oji,Xopf:aji,xopf:lji,xoplus:uji,xotime:cji,xrarr:hji,xrArr:dji,Xscr:pji,xscr:fji,xsqcup:mji,xuplus:gji,xutri:yji,xvee:vji,xwedge:_ji,Yacute:bji,yacute:wji,YAcy:xji,yacy:Sji,Ycirc:Tji,ycirc:Cji,Ycy:Eji,ycy:Iji,yen:Aji,Yfr:Mji,yfr:Oji,YIcy:Pji,yicy:Rji,Yopf:Dji,yopf:Fji,Yscr:kji,yscr:Lji,YUcy:Nji,yucy:$ji,yuml:Bji,Yuml:jji,Zacute:Gji,zacute:Uji,Zcaron:zji,zcaron:Vji,Zcy:Hji,zcy:Wji,Zdot:qji,zdot:Yji,zeetrf:Xji,ZeroWidthSpace:Jji,Zeta:Kji,zeta:Zji,zfr:Qji,Zfr:eGi,ZHcy:tGi,zhcy:iGi,zigrarr:rGi,zopf:nGi,Zopf:sGi,Zscr:oGi,zscr:aGi,zwj:lGi,zwnj:uGi};var dTt=cGi,SUe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,aY={},eit={};function hGi(i){var e,t,r=eit[i];if(r)return r;for(r=eit[i]=[],e=0;e<128;e++)t=String.fromCharCode(e),/^[0-9a-z]$/i.test(t)?r.push(t):r.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e"u"&&(t=!0),a=hGi(e),r=0,n=i.length;r=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1=56320&&o<=57343)){l+=encodeURIComponent(i[r]+i[r+1]),r++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(i[r])}return l}Nxe.defaultChars=";/?:@&=+$,-_.!~*'()#";Nxe.componentChars="-_.!~*'()";var dGi=Nxe,tit={};function pGi(i){var e,t,r=tit[i];if(r)return r;for(r=tit[i]=[],e=0;e<128;e++)t=String.fromCharCode(e),r.push(t);for(e=0;e=55296&&c<=57343?h+="���":h+=String.fromCharCode(c),n+=6;continue}if((o&248)===240&&n+91114111?h+="����":(c-=65536,h+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),n+=9;continue}h+="�"}return h})}$xe.defaultChars=";/?:@&=+$,#";$xe.componentChars="";var fGi=$xe,mGi=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t};function cve(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var gGi=/^([a-z0-9.+-]+:)/i,yGi=/:[0-9]*$/,vGi=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,_Gi=["<",">",'"',"`"," ","\r",` -`," "],bGi=["{","}","|","\\","^","`"].concat(_Gi),wGi=["'"].concat(bGi),iit=["%","/","?",";","#"].concat(wGi),rit=["/","?","#"],xGi=255,nit=/^[+a-z0-9A-Z_-]{0,63}$/,SGi=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sit={javascript:!0,"javascript:":!0},oit={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function TGi(i,e){if(i&&i instanceof cve)return i;var t=new cve;return t.parse(i,e),t}cve.prototype.parse=function(i,e){var t,r,n,s,o,a=i;if(a=a.trim(),!e&&i.split("#").length===1){var l=vGi.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=gGi.exec(a);if(u&&(u=u[0],n=u.toLowerCase(),this.protocol=u,a=a.substr(u.length)),(e||u||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=a.substr(0,2)==="//",o&&!(u&&sit[u])&&(a=a.substr(2),this.slashes=!0)),!sit[u]&&(o||u&&!oit[u])){var c=-1;for(t=0;t127?I+="x":I+=S[R];if(!I.match(nit)){var k=w.slice(0,t),B=w.slice(t+1),$=S.match(SGi);$&&(k.push($[1]),B.unshift($[2])),B.length&&(a=B.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>xGi&&(this.hostname=""),v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var V=a.indexOf("#");V!==-1&&(this.hash=a.substr(V),a=a.slice(0,V));var Y=a.indexOf("?");return Y!==-1&&(this.search=a.substr(Y),a=a.slice(0,Y)),a&&(this.pathname=a),oit[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};cve.prototype.parseHost=function(i){var e=yGi.exec(i);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),i=i.substr(0,i.length-e.length)),i&&(this.hostname=i)};var CGi=TGi;aY.encode=dGi;aY.decode=fGi;aY.format=mGi;aY.parse=CGi;var LL={},AAe,ait;function pTt(){return ait||(ait=1,AAe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),AAe}var MAe,lit;function fTt(){return lit||(lit=1,MAe=/[\0-\x1F\x7F-\x9F]/),MAe}var OAe,uit;function EGi(){return uit||(uit=1,OAe=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),OAe}var PAe,cit;function mTt(){return cit||(cit=1,PAe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),PAe}var hit;function IGi(){return hit||(hit=1,LL.Any=pTt(),LL.Cc=fTt(),LL.Cf=EGi(),LL.P=SUe,LL.Z=mTt()),LL}(function(i){function e(pe){return Object.prototype.toString.call(pe)}function t(pe){return e(pe)==="[object String]"}var r=Object.prototype.hasOwnProperty;function n(pe,H){return r.call(pe,H)}function s(pe){var H=Array.prototype.slice.call(arguments,1);return H.forEach(function(Z){if(Z){if(typeof Z!="object")throw new TypeError(Z+"must be object");Object.keys(Z).forEach(function(ae){pe[ae]=Z[ae]})}}),pe}function o(pe,H,Z){return[].concat(pe.slice(0,H),Z,pe.slice(H+1))}function a(pe){return!(pe>=55296&&pe<=57343||pe>=64976&&pe<=65007||(pe&65535)===65535||(pe&65535)===65534||pe>=0&&pe<=8||pe===11||pe>=14&&pe<=31||pe>=127&&pe<=159||pe>1114111)}function l(pe){if(pe>65535){pe-=65536;var H=55296+(pe>>10),Z=56320+(pe&1023);return String.fromCharCode(H,Z)}return String.fromCharCode(pe)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(u.source+"|"+c.source,"gi"),p=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,m=dTt;function v(pe,H){var Z=0;return n(m,H)?m[H]:H.charCodeAt(0)===35&&p.test(H)&&(Z=H[1].toLowerCase()==="x"?parseInt(H.slice(2),16):parseInt(H.slice(1),10),a(Z))?l(Z):pe}function w(pe){return pe.indexOf("\\")<0?pe:pe.replace(u,"$1")}function S(pe){return pe.indexOf("\\")<0&&pe.indexOf("&")<0?pe:pe.replace(h,function(H,Z,ae){return Z||v(H,ae)})}var I=/[&<>"]/,R=/[&<>"]/g,L={"&":"&","<":"<",">":">",'"':"""};function k(pe){return L[pe]}function B(pe){return I.test(pe)?pe.replace(R,k):pe}var $=/[.?*+^$[\]\\(){}|-]/g;function V(pe){return pe.replace($,"\\$&")}function Y(pe){switch(pe){case 9:case 32:return!0}return!1}function K(pe){if(pe>=8192&&pe<=8202)return!0;switch(pe){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var Q=SUe;function re(pe){return Q.test(pe)}function ne(pe){switch(pe){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function de(pe){return pe=pe.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(pe=pe.replace(/ẞ/g,"ß")),pe.toLowerCase().toUpperCase()}i.lib={},i.lib.mdurl=aY,i.lib.ucmicro=IGi(),i.assign=s,i.isString=t,i.has=n,i.unescapeMd=w,i.unescapeAll=S,i.isValidEntityCode=a,i.fromCodePoint=l,i.escapeHtml=B,i.arrayReplaceAt=o,i.isSpace=Y,i.isWhiteSpace=K,i.isMdAsciiPunct=ne,i.isPunctChar=re,i.escapeRE=V,i.normalizeReference=de})(Pc);var Bxe={},AGi=function(e,t,r){var n,s,o,a,l=-1,u=e.posMax,c=e.pos;for(e.pos=t+1,n=1;e.pos32))return l;if(n===41){if(s===0)break;s--}t++}return a===t||s!==0||(l.str=dit(e.slice(a,t)),l.lines=o,l.pos=t,l.ok=!0),l},OGi=Pc.unescapeAll,PGi=function(e,t,r){var n,s,o=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=r||(s=e.charCodeAt(t),s!==34&&s!==39&&s!==40))return l;for(t++,s===40&&(s=41);t"+G9(i[e].content)+""};$3.code_block=function(i,e,t,r,n){var s=i[e];return""+G9(i[e].content)+` -`};$3.fence=function(i,e,t,r,n){var s=i[e],o=s.info?DGi(s.info).trim():"",a="",l="",u,c,h,p,m;return o&&(h=o.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),t.highlight?u=t.highlight(s.content,a,l)||G9(s.content):u=G9(s.content),u.indexOf("i.map(i=>d[i]); +import{d as da,u as uTt,r as sY,a as oY,o as fr,c as xr,w as Sm,n as Vl,b as xc,e as Cr,t as Zh,f as Vv,g as Wp,h as bUe,i as Tn,j as oc,k as G8,l as Tg,v as kP,F as Vc,m as lh,p as _h,q as cTt,s as Dxe,x as Fxe,_ as Ux,y as hTt,z as zC,T as uci,A as cci,B as jB,C as hci,D as wUe,E as U8,G as ja,H as dci,I as ji,J as pci,K as fci,L as wf,M as Ztt,N as kxe,O as Lxe,P as mci,Q as gM,R as gci,S as yci,U as Qtt,V as ag,W as vci,X as _ci,Y as bci,Z as xUe}from"./main-BlFeCTIx.js";const wci={key:0,class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#fff",stroke:"#878787"},xci=Cr("path",{d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974"},null,-1),Sci=[xci],Tci={key:0,class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#fff",stroke:"#878787"},Cci=Cr("path",{d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974"},null,-1),Eci=[Cci],LP=da({__name:"toc-item",props:{tocItem:{type:Object,required:!0},slides:{type:Array,required:!0},parentItem:{type:Boolean,required:!1,default:!0},verticalToc:{type:Boolean,required:!1,default:!0},mobile:{type:Boolean,required:!1,default:!1},plugin:{type:Boolean,required:!0},returnTop:{type:Boolean,required:!1,default:!1}},setup(i){const{t:e}=uTt(),t=i,r=o=>{const a=document.getElementById(o);a&&a.scrollIntoView({behavior:"smooth"})},n=o=>o.title!==""?o.title:e("chapters.untitled"),s=o=>{const a=t.slides.find((l,u)=>u===o);return a?`${o}-${a.title.toLowerCase().replaceAll(" ","-")}`:""};return(o,a)=>{const l=sY("router-link"),u=oY("tippy");return fr(),xr("div",{class:Vl(["toc-item",{flex:i.parentItem}])},[i.plugin?Sm((fr(),xr("a",{key:0,class:Vl(["flex items-center px-2 py-1 mx-1 cursor-pointer",{"flex-grow pb-2 min-w-0":i.parentItem,"pb-2":i.parentItem&&!i.verticalToc}]),onClick:a[0]||(a[0]=c=>r(s(i.tocItem.slideIndex)))},[i.verticalToc?(fr(),xr("svg",wci,Sci)):xc("",!0),Cr("span",{class:Vl(["flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap",{"ml-4":i.verticalToc&&i.parentItem,"pl-8":i.verticalToc&&!i.parentItem}])},Zh(n(i.tocItem)),3)],2)),[[u,{delay:"200",placement:"right",content:n(i.tocItem),animateFill:!0,animation:"chapter-menu"}]]):Sm((fr(),Vv(l,{key:1,to:{hash:`#${s(i.tocItem.slideIndex)}`},class:Vl(["flex items-center px-2 py-1 mx-1",{"flex-grow min-w-0":i.parentItem,"pb-2":i.parentItem&&!i.verticalToc}]),target:""},{default:Wp(()=>[i.verticalToc?(fr(),xr("svg",Tci,Eci)):xc("",!0),Cr("span",{class:Vl(["flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap",{"ml-4":i.verticalToc&&i.parentItem,"pl-8":i.verticalToc&&!i.parentItem}])},Zh(n(i.tocItem)),3)]),_:1},8,["to","class"])),[[u,{delay:"200",placement:"right",content:n(i.tocItem),animateFill:!0,animation:"chapter-menu"}]]),bUe(o.$slots,"default")],2)}}}),Hoe=i=>(Dxe("data-v-e5dfb17f"),i=i(),Fxe(),i),Ici={class:"sticky w-12 duration-500 ease-in-out transition-width"},Aci={class:"flex px-3 py-2"},Mci=["aria-label"],Oci={class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"#707070"},Pci=["d"],Rci=["d"],Dci=Hoe(()=>Cr("path",{d:"m3.5 17h17"},null,-1)),Fci={class:"flex items-center mt-3 py-4 w-72 bg-white"},kci={class:"flex-2 pl-2 ml-4 leading-normal"},Lci=["aria-label"],Nci=Hoe(()=>Cr("svg",{class:"flex-shrink-0 mr-4",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#c0c0c0",stroke:"#c0c0c0"},[Cr("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"})],-1)),$ci=[Nci],Bci={class:"dropdown-nav-content bg-white pb-10 w-72 z-10 border-r border-gray-200"},jci={key:0},Gci=cTt('',1),Uci={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},zci=Hoe(()=>Cr("svg",{class:"flex-shrink-0",viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"#fff",stroke:"#878787",xmlns:"http://www.w3.org/2000/svg"},[Cr("path",{"data-v-689fab2c":"",d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974",style:{fill:"rgba(255, 255, 255, 0)","fill-opacity":"0"},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"}),Cr("g",{transform:"matrix(1, 0, 0, 1, 0.07912001013755887, 1.1142139434814453)"},[Cr("polygon",{points:"11.956 9.662 9.522 12.097 9.862 12.437 11.956 10.344 14.049 12.437 14.39 12.097",style:{}}),Cr("path",{style:{fill:"rgb(135, 135, 135)","stroke-width":"1.5px"},d:"M 11.917 10.545 L 11.917 15.649"})]),Cr("rect",{x:"9.114",y:"8.74",width:"5.842",height:"0.487",style:{},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"})],-1)),Vci={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Hci=["aria-label","onClick"],Wci={key:0,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:"rotate-180"},qci=Hoe(()=>Cr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Yci=[qci],Xci={key:1,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},Jci=Hoe(()=>Cr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Kci=[Jci],Zci={class:"dropdown-menu"},Qci=da({__name:"mobile-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Tn(!1),r=Tn(!0),n=Tn(-1),s=Tn({}),o=oc(()=>{const h=e.slides.map((p,m)=>({...p,index:m}));return e.customToc||h.filter(p=>p.includeInToc!==!1),h});G8(()=>e.activeChapterIndex,()=>{c()}),Tg(()=>{const h=document.getElementById("intro");r.value=!!h,e.customToc&&e.customToc.forEach((p,m)=>{s.value[m]=!1})});const a=h=>{const p=document.getElementById(h);p&&p.scrollIntoView({behavior:"smooth"})},l=h=>{s.value[h]=!s.value[h]},u=h=>s.value[h],c=()=>{const h=o.value.filter(p=>p.index<=e.activeChapterIndex);n.value=h.length?h[h.length-1].index:-1};return(h,p)=>{const m=sY("router-link");return fr(),xr("div",Ici,[Cr("div",Aci,[Cr("button",{onClick:p[0]||(p[0]=v=>t.value=!t.value),"aria-label":h.$t("chapters.menu")},[(fr(),xr("svg",Oci,[Cr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 7h${t.value?"17":"8.5"}`},null,8,Pci),Cr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 12h${t.value?"17":"8.5"}`},null,8,Rci),Dci]))],8,Mci)]),Sm(Cr("div",Fci,[Cr("span",kci,Zh(h.$t("chapters.title")),1),Cr("button",{onClick:p[1]||(p[1]=v=>t.value=!t.value),"aria-label":h.$t("chapters.menu")},$ci,8,Lci)],512),[[kP,t.value]]),Sm(Cr("ul",Bci,[r.value&&i.returnToTop?(fr(),xr("li",jci,[i.plugin?(fr(),xr("a",{key:0,class:"flex py-1 px-3",onClick:p[2]||(p[2]=v=>a("intro"))},[Gci,Cr("span",Uci,Zh(h.$t("chapters.return")),1)])):(fr(),Vv(m,{key:1,to:{hash:"#intro"},class:"flex py-1 px-3",target:""},{default:Wp(()=>[zci,Cr("span",Vci,Zh(h.$t("chapters.return")),1)]),_:1}))])):xc("",!0),i.customToc?(fr(!0),xr(Vc,{key:1},lh(i.customToc,(v,w)=>(fr(),xr("li",{key:w,class:Vl({"is-active":n.value===v.slideIndex})},[_h(LP,{tocItem:v,slides:i.slides,plugin:i.plugin},{default:Wp(()=>[v.sublist&&v.sublist.length&&t.value?(fr(),xr("button",{key:0,class:"mr-1","aria-label":h.$t("chapters.menu.dropdown"),onClick:S=>l(w)},[u(w)?(fr(),xr("svg",Wci,Yci)):(fr(),xr("svg",Xci,Kci))],8,Hci)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Cr("ul",Zci,[(fr(!0),xr(Vc,null,lh(v.sublist,(S,I)=>(fr(),xr("li",{key:I,class:Vl({"is-active":n.value===S.slideIndex})},[_h(LP,{tocItem:S,slides:i.slides,parentItem:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,u(w)]])],2))),128)):(fr(!0),xr(Vc,{key:2},lh(o.value,(v,w)=>(fr(),xr("li",{key:w,class:Vl({"is-active":n.value===v.index})},[_h(LP,{tocItem:{...v,slideIndex:w},slides:i.slides,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,t.value]])])}}}),ehi=Ux(Qci,[["__scopeId","data-v-e5dfb17f"]]);(function(){if(typeof window!="object")return;if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype){"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});return}function i(L){try{return L.defaultView&&L.defaultView.frameElement||null}catch{return null}}var e=function(L){for(var k=L,B=i(k);B;)k=B.ownerDocument,B=i(k);return k}(window.document),t=[],r=null,n=null;function s(L){this.time=L.time,this.target=L.target,this.rootBounds=v(L.rootBounds),this.boundingClientRect=v(L.boundingClientRect),this.intersectionRect=v(L.intersectionRect||m()),this.isIntersecting=!!L.intersectionRect;var k=this.boundingClientRect,B=k.width*k.height,$=this.intersectionRect,V=$.width*$.height;B?this.intersectionRatio=Number((V/B).toFixed(4)):this.intersectionRatio=this.isIntersecting?1:0}function o(L,k){var B=k||{};if(typeof L!="function")throw new Error("callback must be a function");if(B.root&&B.root.nodeType!=1&&B.root.nodeType!=9)throw new Error("root must be a Document or Element");this._checkForIntersections=l(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=L,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(B.rootMargin),this.thresholds=this._initThresholds(B.threshold),this.root=B.root||null,this.rootMargin=this._rootMarginValues.map(function($){return $.value+$.unit}).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.USE_MUTATION_OBSERVER=!0,o._setupCrossOriginUpdater=function(){return r||(r=function(L,k){!L||!k?n=m():n=w(L,k),t.forEach(function(B){B._checkForIntersections()})}),r},o._resetCrossOriginUpdater=function(){r=null,n=null},o.prototype.observe=function(L){var k=this._observationTargets.some(function(B){return B.element==L});if(!k){if(!(L&&L.nodeType==1))throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:L,entry:null}),this._monitorIntersections(L.ownerDocument),this._checkForIntersections()}},o.prototype.unobserve=function(L){this._observationTargets=this._observationTargets.filter(function(k){return k.element!=L}),this._unmonitorIntersections(L.ownerDocument),this._observationTargets.length==0&&this._unregisterInstance()},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var L=this._queuedEntries.slice();return this._queuedEntries=[],L},o.prototype._initThresholds=function(L){var k=L||[0];return Array.isArray(k)||(k=[k]),k.sort().filter(function(B,$,V){if(typeof B!="number"||isNaN(B)||B<0||B>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return B!==V[$-1]})},o.prototype._parseRootMargin=function(L){var k=L||"0px",B=k.split(/\s+/).map(function($){var V=/^(-?\d*\.?\d+)(px|%)$/.exec($);if(!V)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(V[1]),unit:V[2]}});return B[1]=B[1]||B[0],B[2]=B[2]||B[0],B[3]=B[3]||B[1],B},o.prototype._monitorIntersections=function(L){var k=L.defaultView;if(k&&this._monitoringDocuments.indexOf(L)==-1){var B=this._checkForIntersections,$=null,V=null;this.POLL_INTERVAL?$=k.setInterval(B,this.POLL_INTERVAL):(u(k,"resize",B,!0),u(L,"scroll",B,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in k&&(V=new k.MutationObserver(B),V.observe(L,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))),this._monitoringDocuments.push(L),this._monitoringUnsubscribes.push(function(){var Q=L.defaultView;Q&&($&&Q.clearInterval($),c(Q,"resize",B,!0)),c(L,"scroll",B,!0),V&&V.disconnect()});var Y=this.root&&(this.root.ownerDocument||this.root)||e;if(L!=Y){var K=i(L);K&&this._monitorIntersections(K.ownerDocument)}}},o.prototype._unmonitorIntersections=function(L){var k=this._monitoringDocuments.indexOf(L);if(k!=-1){var B=this.root&&(this.root.ownerDocument||this.root)||e,$=this._observationTargets.some(function(K){var Q=K.element.ownerDocument;if(Q==L)return!0;for(;Q&&Q!=B;){var re=i(Q);if(Q=re&&re.ownerDocument,Q==L)return!0}return!1});if(!$){var V=this._monitoringUnsubscribes[k];if(this._monitoringDocuments.splice(k,1),this._monitoringUnsubscribes.splice(k,1),V(),L!=B){var Y=i(L);Y&&this._unmonitorIntersections(Y.ownerDocument)}}}},o.prototype._unmonitorAllIntersections=function(){var L=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var k=0;k=0&&Q>=0&&{top:B,bottom:$,left:V,right:Y,width:K,height:Q}||null}function p(L){var k;try{k=L.getBoundingClientRect()}catch{}return k?(k.width&&k.height||(k={top:k.top,right:k.right,bottom:k.bottom,left:k.left,width:k.right-k.left,height:k.bottom-k.top}),k):m()}function m(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function v(L){return!L||"x"in L?L:{top:L.top,y:L.top,bottom:L.bottom,left:L.left,x:L.left,right:L.right,width:L.width,height:L.height}}function w(L,k){var B=k.top-L.top,$=k.left-L.left;return{top:B,left:$,height:k.height,width:k.width,bottom:B+k.height,right:$+k.width}}function S(L,k){for(var B=k;B;){if(B==L)return!0;B=I(B)}return!1}function I(L){var k=L.parentNode;return L.nodeType==9&&L!=e?i(L):(k&&k.assignedSlot&&(k=k.assignedSlot.parentNode),k&&k.nodeType==11&&k.host?k.host:k)}function R(L){return L&&L.nodeType===9}window.IntersectionObserver=o,window.IntersectionObserverEntry=s})();const Woe=i=>(Dxe("data-v-d353eb46"),i=i(),Fxe(),i),thi={class:"flex items-center mt-4 mb-12"},ihi=["aria-label"],rhi={class:"flex-shrink-0",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"#707070"},nhi=["d"],shi=["d"],ohi=Woe(()=>Cr("path",{d:"m3.5 17h17"},null,-1)),ahi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},lhi={class:"nav-content menu"},uhi={key:0},chi=cTt('',1),hhi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},dhi=Woe(()=>Cr("svg",{class:"flex-shrink-0",viewBox:"0 0 24 24",width:"24px",height:"24px",fill:"#fff",stroke:"#878787",xmlns:"http://www.w3.org/2000/svg"},[Cr("path",{"data-v-689fab2c":"",d:"m19.325 16.229c-2.4415 1.4096-4.8829 2.8191-7.3244 4.2286-2.4415-1.4096-4.883-2.8192-7.3245-4.2288-3.55e-5 -2.8191-7.1e-5 -5.6383-1.066e-4 -8.4574 2.4415-1.4096 4.8829-2.8191 7.3244-4.2286 2.4415 1.4096 4.883 2.8192 7.3245 4.2288 3.7e-5 2.8191 7.4e-5 5.6383 1.1e-4 8.4574z","stroke-width":".93974",style:{fill:"rgba(255, 255, 255, 0)","fill-opacity":"0"},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"}),Cr("g",{transform:"matrix(1, 0, 0, 1, 0.07912001013755887, 1.1142139434814453)"},[Cr("polygon",{points:"11.956 9.662 9.522 12.097 9.862 12.437 11.956 10.344 14.049 12.437 14.39 12.097",style:{}}),Cr("path",{style:{fill:"rgb(135, 135, 135)","stroke-width":"1.5px"},d:"M 11.917 10.545 L 11.917 15.649"})]),Cr("rect",{x:"9.114",y:"8.74",width:"5.842",height:"0.487",style:{},transform:"matrix(1, 0, 0, 1, 8.881784197001252e-16, 0)"})],-1)),phi={class:"flex-1 ml-4 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},fhi=["aria-label","onClick"],mhi={key:0,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:"rotate-180"},ghi=Woe(()=>Cr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),yhi=[ghi],vhi={key:1,"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},_hi=Woe(()=>Cr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),bhi=[_hi],whi={class:"dropdown-menu"},xhi=Woe(()=>Cr("div",{class:"h-10 flex-shrink-0"},null,-1)),Shi=da({__name:"chapter-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String,required:!0},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Tn(!1),r=Tn(!1),n=Tn(-1),s=Tn({}),o=oc(()=>{const h=e.slides.map((p,m)=>({...p,index:m}));return e.customToc||h.filter(p=>p.includeInToc!==!1),h});G8(()=>e.activeChapterIndex,()=>{c()}),Tg(()=>{const h=document.getElementById("intro");r.value=!!h,e.customToc&&e.customToc.forEach((p,m)=>{s.value[m]=!1})});const a=h=>{const p=document.getElementById(h);p&&p.scrollIntoView({behavior:"smooth"})},l=h=>{s.value[h]=!s.value[h]},u=h=>s.value[h],c=()=>{const h=o.value.filter(p=>p.index<=e.activeChapterIndex);n.value=h.length?h[h.length-1].index:-1};return(h,p)=>{const m=sY("router-link"),v=oY("tippy");return fr(),xr("div",{class:Vl([t.value?"w-72":"","nav-bar sticky self-start w-12 duration-500 ease-in-out transition-width"])},[Cr("div",thi,[Sm((fr(),xr("button",{class:"flex items-center flex-shrink-0 px-2 py-1 mx-1 overflow-hidden","aria-label":h.$t("chapters.menu"),onClick:p[0]||(p[0]=w=>t.value=!t.value)},[(fr(),xr("svg",rhi,[Cr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 7h${t.value?"17":"8.5"}`},null,8,nhi),Cr("path",{class:"transition-all duration-500 ease-in-out",d:`m3.5 12h${t.value?"17":"8.5"}`},null,8,shi),ohi])),Cr("span",ahi,Zh(h.$t("chapters.title")),1)],8,ihi)),[[v,{delay:"200",placement:"right",content:h.$t("chapters.title"),onShow:()=>!t.value,animateFill:!0}]])]),Cr("ul",lhi,[r.value&&i.returnToTop?(fr(),xr("li",uhi,[i.plugin?Sm((fr(),xr("a",{key:0,class:"flex items-center px-2 py-1 mx-1 cursor-pointer",onClick:p[1]||(p[1]=w=>a("intro"))},[chi,Cr("span",hhi,Zh(h.$t("chapters.return")),1)])),[[v,{delay:"200",placement:"right",content:h.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]]):Sm((fr(),Vv(m,{key:1,to:{hash:"#intro"},class:"flex items-center px-2 py-1 mx-1",target:""},{default:Wp(()=>[dhi,Cr("span",phi,Zh(h.$t("chapters.return")),1)]),_:1})),[[v,{delay:"200",placement:"right",content:h.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]])])):xc("",!0),i.customToc?(fr(!0),xr(Vc,{key:1},lh(i.customToc,(w,S)=>(fr(),xr("li",{key:S,class:Vl({"is-active":n.value===w.slideIndex})},[_h(LP,{tocItem:w,slides:i.slides,plugin:i.plugin},{default:Wp(()=>[w.sublist&&w.sublist.length&&t.value?(fr(),xr("button",{key:0,class:"mr-1","aria-label":h.$t("chapters.menu.dropdown"),onClick:I=>l(S)},[u(S)?(fr(),xr("svg",mhi,yhi)):(fr(),xr("svg",vhi,bhi))],8,fhi)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Cr("ul",whi,[(fr(!0),xr(Vc,null,lh(w.sublist,(I,R)=>(fr(),xr("li",{key:R,class:Vl({"is-active":n.value===I.slideIndex})},[_h(LP,{tocItem:I,slides:i.slides,parentItem:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,u(S)]])],2))),128)):(fr(!0),xr(Vc,{key:2},lh(o.value,(w,S)=>(fr(),xr("li",{key:S,class:Vl({"is-active":n.value===w.index})},[_h(LP,{tocItem:{...w,slideIndex:S},slides:i.slides,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128)),xhi])],2)}}}),Thi=Ux(Shi,[["__scopeId","data-v-d353eb46"]]),Chi=i=>(Dxe("data-v-d885a1ee"),i=i(),Fxe(),i),Ehi={id:"h-navbar",class:"navbar h-11 sticky"},Ihi={key:0},Ahi={class:"flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Mhi={class:"flex-1 overflow-hidden leading-normal overflow-ellipsis whitespace-nowrap"},Ohi=["onFocusout"],Phi=["aria-label","onClick"],Rhi=Chi(()=>Cr("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},null,-1)),Dhi=[Rhi],Fhi={class:"dropdown-menu"},khi=da({__name:"horizontal-menu",props:{returnToTop:{type:Boolean,default:!0},slides:{type:Array,required:!0},customToc:{type:Array,required:!1},activeChapterIndex:{type:Number,required:!0},lang:{type:String,required:!0},plugin:{type:Boolean,default:!1}},setup(i){const e=i,t=Tn(!1),r=Tn(-1),n=Tn(-1),s=Tn(null),o=oc(()=>{const m=e.slides.map((v,w)=>({...v,index:w}));return e.customToc||m.filter(v=>v.includeInToc!==!1),m});G8(()=>e.activeChapterIndex,()=>{h()}),Tg(()=>{const m=document.getElementById("intro");t.value=!!m,document.addEventListener("click",l)}),hTt(()=>{document.removeEventListener("click",l)});const a=()=>{n.value=-1},l=m=>{const v=m.target,w=v.closest(".toc-item"),S=v.closest(".dropdown-menu");w&&w.querySelector("button")?.contains(v)||S||a()},u=m=>{const v=document.getElementById(m);v&&v.scrollIntoView({behavior:"smooth"})},c=m=>{n.value=n.value!==m?m:-1},h=()=>{const m=o.value.filter(v=>v.index<=e.activeChapterIndex);r.value=m.length?m[m.length-1].index:-1},p=m=>{setTimeout(()=>{const v=s.value;v&&v[m]&&!v[m].contains(document.activeElement)&&(n.value=-1)},0)};return(m,v)=>{const w=sY("router-link"),S=oY("tippy");return fr(),xr("div",Ehi,[Cr("ul",null,[t.value&&i.returnToTop?(fr(),xr("li",Ihi,[i.plugin?Sm((fr(),xr("a",{key:0,class:"flex items-center px-2 py-1 mx-1 cursor-pointer",onClick:v[0]||(v[0]=I=>u("intro"))},[Cr("span",Ahi,Zh(m.$t("chapters.return")),1)])),[[S,{delay:"200",placement:"bottom",content:m.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]]):Sm((fr(),Vv(w,{key:1,to:{hash:"#intro"},class:"flex items-center px-2 py-1 mx-1",target:""},{default:Wp(()=>[Cr("span",Mhi,Zh(m.$t("chapters.return")),1)]),_:1})),[[S,{delay:"200",placement:"bottom",content:m.$t("chapters.return"),animateFill:!0,animation:"chapter-menu"}]])])):xc("",!0),i.customToc?(fr(!0),xr(Vc,{key:1},lh(i.customToc,(I,R)=>(fr(),xr("li",{key:R,class:Vl({"is-active":r.value===I.slideIndex}),ref_for:!0,ref_key:"itemContainer",ref:s,onFocusout:L=>p(R)},[_h(LP,{tocItem:I,slides:i.slides,verticalToc:!1,plugin:i.plugin},{default:Wp(()=>[I.sublist&&I.sublist.length?(fr(),xr("button",{key:0,class:"mr-1","aria-label":m.$t("chapters.menu.dropdown"),onClick:L=>c(R)},[(fr(),xr("svg",{"data-v-b1261e08":"",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18",class:Vl({"rotate-180":n.value===R})},Dhi,2))],8,Phi)):xc("",!0)]),_:2},1032,["tocItem","slides","plugin"]),Sm(Cr("ul",Fhi,[(fr(!0),xr(Vc,null,lh(I.sublist,(L,k)=>(fr(),xr("li",{key:k,class:Vl([[{"border-t-2":k===0,"is-active":r.value===L.slideIndex}],"border-b-2 border-gray-300"])},[_h(LP,{tocItem:L,slides:i.slides,parentItem:!1,verticalToc:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))],512),[[kP,n.value===R]])],42,Ohi))),128)):(fr(!0),xr(Vc,{key:2},lh(o.value,(I,R)=>(fr(),xr("li",{key:R,class:Vl({"is-active":r.value===I.index,separator:!i.returnToTop&&R!==0||i.returnToTop})},[_h(LP,{tocItem:{...I,slideIndex:R},slides:i.slides,verticalToc:!1,plugin:i.plugin},null,8,["tocItem","slides","plugin"])],2))),128))])])}}}),Lhi=Ux(khi,[["__scopeId","data-v-d885a1ee"]]),Nhi={class:"sticky z-10 grid-background overflow-hidden",style:{top:"60px",height:"100vh"}},$hi={key:0,class:"w-full h-full"},Bhi=["src"],jhi=["src"],Ghi={key:1,class:"w-full h-full"},Uhi=da({__name:"background-image",props:{src:{type:String,required:!0},configFileStructure:{type:Object},cssClasses:{type:String}},emits:["background-changed"],setup(i,{emit:e}){const t=e,r=i,n={},s=zC({oldImage:"none",newImage:"none"}),o=Tn(0),a=Tn(-1);G8(()=>r.src,()=>{l(r.src).then(u=>{if(s.oldImage=u,a.value!==-1){const c=document.getElementById("primaryImage");c&&c.getAnimations().forEach(h=>{h.cancel(),h.play()}),clearTimeout(a.value),a.value=-1}o.value=1,r.src!=="none"&&s.newImage!=="none"?a.value=setTimeout(()=>{r.src!=="none"&&(o.value=0,s.oldImage=s.newImage,s.newImage=u,t("background-changed",!0),a.value=-1)},450):(s.newImage=u,o.value=0,t("background-changed",s.newImage!=="none"))})},{immediate:!1});const l=u=>new Promise(c=>{if(u==="none"){c(u);return}if(n[u]!==void 0){c(n[u]);return}if(r.configFileStructure){const h=`${u.substring(u.indexOf("/")+1)}`,p=r.configFileStructure?.zip.file(h);if(p)p.async("blob").then(m=>{const v=URL.createObjectURL(m);n[u]=v,c(n[u])});else{c(u);return}}else fetch(u).then(h=>h.blob()).then(h=>{const p=URL.createObjectURL(h);n[u]=p,c(n[u])})});return(u,c)=>(fr(),xr("div",Nhi,[_h(uci,{name:"fade",mode:"out-in"},{default:Wp(()=>[s.newImage!=="none"?(fr(),xr("div",$hi,[s.oldImage!=="none"?(fr(),xr("img",{key:0,class:"fade-in transition-img w-full h-full object-cover",role:"presentation",src:s.oldImage},null,8,Bhi)):xc("",!0),Cr("img",{class:Vl(["fade-in transition-img w-full h-full object-cover",[i.cssClasses,{"transition-hide":o.value===1}]]),src:s.newImage,id:"primaryImage",role:"presentation"},null,10,jhi)])):(fr(),xr("div",Ghi))]),_:1})]))}}),zhi=Ux(Uhi,[["__scopeId","data-v-7da3289c"]]);var qg=(i=>(i.Text="text",i.Image="image",i.Map="map",i.InteractiveMap="interactive-map",i.Chart="chart",i.Video="video",i.Audio="audio",i.Slideshow="slideshow",i.Dynamic="dynamic",i.Loading="loading",i))(qg||{}),Pc={};const Vhi="Á",Hhi="á",Whi="Ă",qhi="ă",Yhi="∾",Xhi="∿",Jhi="∾̳",Khi="Â",Zhi="â",Qhi="´",edi="А",tdi="а",idi="Æ",rdi="æ",ndi="⁡",sdi="𝔄",odi="𝔞",adi="À",ldi="à",udi="ℵ",cdi="ℵ",hdi="Α",ddi="α",pdi="Ā",fdi="ā",mdi="⨿",gdi="&",ydi="&",vdi="⩕",_di="⩓",bdi="∧",wdi="⩜",xdi="⩘",Sdi="⩚",Tdi="∠",Cdi="⦤",Edi="∠",Idi="⦨",Adi="⦩",Mdi="⦪",Odi="⦫",Pdi="⦬",Rdi="⦭",Ddi="⦮",Fdi="⦯",kdi="∡",Ldi="∟",Ndi="⊾",$di="⦝",Bdi="∢",jdi="Å",Gdi="⍼",Udi="Ą",zdi="ą",Vdi="𝔸",Hdi="𝕒",Wdi="⩯",qdi="≈",Ydi="⩰",Xdi="≊",Jdi="≋",Kdi="'",Zdi="⁡",Qdi="≈",epi="≊",tpi="Å",ipi="å",rpi="𝒜",npi="𝒶",spi="≔",opi="*",api="≈",lpi="≍",upi="Ã",cpi="ã",hpi="Ä",dpi="ä",ppi="∳",fpi="⨑",mpi="≌",gpi="϶",ypi="‵",vpi="∽",_pi="⋍",bpi="∖",wpi="⫧",xpi="⊽",Spi="⌅",Tpi="⌆",Cpi="⌅",Epi="⎵",Ipi="⎶",Api="≌",Mpi="Б",Opi="б",Ppi="„",Rpi="∵",Dpi="∵",Fpi="∵",kpi="⦰",Lpi="϶",Npi="ℬ",$pi="ℬ",Bpi="Β",jpi="β",Gpi="ℶ",Upi="≬",zpi="𝔅",Vpi="𝔟",Hpi="⋂",Wpi="◯",qpi="⋃",Ypi="⨀",Xpi="⨁",Jpi="⨂",Kpi="⨆",Zpi="★",Qpi="▽",efi="△",tfi="⨄",ifi="⋁",rfi="⋀",nfi="⤍",sfi="⧫",ofi="▪",afi="▴",lfi="▾",ufi="◂",cfi="▸",hfi="␣",dfi="▒",pfi="░",ffi="▓",mfi="█",gfi="=⃥",yfi="≡⃥",vfi="⫭",_fi="⌐",bfi="𝔹",wfi="𝕓",xfi="⊥",Sfi="⊥",Tfi="⋈",Cfi="⧉",Efi="┐",Ifi="╕",Afi="╖",Mfi="╗",Ofi="┌",Pfi="╒",Rfi="╓",Dfi="╔",Ffi="─",kfi="═",Lfi="┬",Nfi="╤",$fi="╥",Bfi="╦",jfi="┴",Gfi="╧",Ufi="╨",zfi="╩",Vfi="⊟",Hfi="⊞",Wfi="⊠",qfi="┘",Yfi="╛",Xfi="╜",Jfi="╝",Kfi="└",Zfi="╘",Qfi="╙",emi="╚",tmi="│",imi="║",rmi="┼",nmi="╪",smi="╫",omi="╬",ami="┤",lmi="╡",umi="╢",cmi="╣",hmi="├",dmi="╞",pmi="╟",fmi="╠",mmi="‵",gmi="˘",ymi="˘",vmi="¦",_mi="𝒷",bmi="ℬ",wmi="⁏",xmi="∽",Smi="⋍",Tmi="⧅",Cmi="\\",Emi="⟈",Imi="•",Ami="•",Mmi="≎",Omi="⪮",Pmi="≏",Rmi="≎",Dmi="≏",Fmi="Ć",kmi="ć",Lmi="⩄",Nmi="⩉",$mi="⩋",Bmi="∩",jmi="⋒",Gmi="⩇",Umi="⩀",zmi="ⅅ",Vmi="∩︀",Hmi="⁁",Wmi="ˇ",qmi="ℭ",Ymi="⩍",Xmi="Č",Jmi="č",Kmi="Ç",Zmi="ç",Qmi="Ĉ",egi="ĉ",tgi="∰",igi="⩌",rgi="⩐",ngi="Ċ",sgi="ċ",ogi="¸",agi="¸",lgi="⦲",ugi="¢",cgi="·",hgi="·",dgi="𝔠",pgi="ℭ",fgi="Ч",mgi="ч",ggi="✓",ygi="✓",vgi="Χ",_gi="χ",bgi="ˆ",wgi="≗",xgi="↺",Sgi="↻",Tgi="⊛",Cgi="⊚",Egi="⊝",Igi="⊙",Agi="®",Mgi="Ⓢ",Ogi="⊖",Pgi="⊕",Rgi="⊗",Dgi="○",Fgi="⧃",kgi="≗",Lgi="⨐",Ngi="⫯",$gi="⧂",Bgi="∲",jgi="”",Ggi="’",Ugi="♣",zgi="♣",Vgi=":",Hgi="∷",Wgi="⩴",qgi="≔",Ygi="≔",Xgi=",",Jgi="@",Kgi="∁",Zgi="∘",Qgi="∁",eyi="ℂ",tyi="≅",iyi="⩭",ryi="≡",nyi="∮",syi="∯",oyi="∮",ayi="𝕔",lyi="ℂ",uyi="∐",cyi="∐",hyi="©",dyi="©",pyi="℗",fyi="∳",myi="↵",gyi="✗",yyi="⨯",vyi="𝒞",_yi="𝒸",byi="⫏",wyi="⫑",xyi="⫐",Syi="⫒",Tyi="⋯",Cyi="⤸",Eyi="⤵",Iyi="⋞",Ayi="⋟",Myi="↶",Oyi="⤽",Pyi="⩈",Ryi="⩆",Dyi="≍",Fyi="∪",kyi="⋓",Lyi="⩊",Nyi="⊍",$yi="⩅",Byi="∪︀",jyi="↷",Gyi="⤼",Uyi="⋞",zyi="⋟",Vyi="⋎",Hyi="⋏",Wyi="¤",qyi="↶",Yyi="↷",Xyi="⋎",Jyi="⋏",Kyi="∲",Zyi="∱",Qyi="⌭",e0i="†",t0i="‡",i0i="ℸ",r0i="↓",n0i="↡",s0i="⇓",o0i="‐",a0i="⫤",l0i="⊣",u0i="⤏",c0i="˝",h0i="Ď",d0i="ď",p0i="Д",f0i="д",m0i="‡",g0i="⇊",y0i="ⅅ",v0i="ⅆ",_0i="⤑",b0i="⩷",w0i="°",x0i="∇",S0i="Δ",T0i="δ",C0i="⦱",E0i="⥿",I0i="𝔇",A0i="𝔡",M0i="⥥",O0i="⇃",P0i="⇂",R0i="´",D0i="˙",F0i="˝",k0i="`",L0i="˜",N0i="⋄",$0i="⋄",B0i="⋄",j0i="♦",G0i="♦",U0i="¨",z0i="ⅆ",V0i="ϝ",H0i="⋲",W0i="÷",q0i="÷",Y0i="⋇",X0i="⋇",J0i="Ђ",K0i="ђ",Z0i="⌞",Q0i="⌍",evi="$",tvi="𝔻",ivi="𝕕",rvi="¨",nvi="˙",svi="⃜",ovi="≐",avi="≑",lvi="≐",uvi="∸",cvi="∔",hvi="⊡",dvi="⌆",pvi="∯",fvi="¨",mvi="⇓",gvi="⇐",yvi="⇔",vvi="⫤",_vi="⟸",bvi="⟺",wvi="⟹",xvi="⇒",Svi="⊨",Tvi="⇑",Cvi="⇕",Evi="∥",Ivi="⤓",Avi="↓",Mvi="↓",Ovi="⇓",Pvi="⇵",Rvi="̑",Dvi="⇊",Fvi="⇃",kvi="⇂",Lvi="⥐",Nvi="⥞",$vi="⥖",Bvi="↽",jvi="⥟",Gvi="⥗",Uvi="⇁",zvi="↧",Vvi="⊤",Hvi="⤐",Wvi="⌟",qvi="⌌",Yvi="𝒟",Xvi="𝒹",Jvi="Ѕ",Kvi="ѕ",Zvi="⧶",Qvi="Đ",e1i="đ",t1i="⋱",i1i="▿",r1i="▾",n1i="⇵",s1i="⥯",o1i="⦦",a1i="Џ",l1i="џ",u1i="⟿",c1i="É",h1i="é",d1i="⩮",p1i="Ě",f1i="ě",m1i="Ê",g1i="ê",y1i="≖",v1i="≕",_1i="Э",b1i="э",w1i="⩷",x1i="Ė",S1i="ė",T1i="≑",C1i="ⅇ",E1i="≒",I1i="𝔈",A1i="𝔢",M1i="⪚",O1i="È",P1i="è",R1i="⪖",D1i="⪘",F1i="⪙",k1i="∈",L1i="⏧",N1i="ℓ",$1i="⪕",B1i="⪗",j1i="Ē",G1i="ē",U1i="∅",z1i="∅",V1i="◻",H1i="∅",W1i="▫",q1i=" ",Y1i=" ",X1i=" ",J1i="Ŋ",K1i="ŋ",Z1i=" ",Q1i="Ę",e_i="ę",t_i="𝔼",i_i="𝕖",r_i="⋕",n_i="⧣",s_i="⩱",o_i="ε",a_i="Ε",l_i="ε",u_i="ϵ",c_i="≖",h_i="≕",d_i="≂",p_i="⪖",f_i="⪕",m_i="⩵",g_i="=",y_i="≂",v_i="≟",__i="⇌",b_i="≡",w_i="⩸",x_i="⧥",S_i="⥱",T_i="≓",C_i="ℯ",E_i="ℰ",I_i="≐",A_i="⩳",M_i="≂",O_i="Η",P_i="η",R_i="Ð",D_i="ð",F_i="Ë",k_i="ë",L_i="€",N_i="!",$_i="∃",B_i="∃",j_i="ℰ",G_i="ⅇ",U_i="ⅇ",z_i="≒",V_i="Ф",H_i="ф",W_i="♀",q_i="ffi",Y_i="ff",X_i="ffl",J_i="𝔉",K_i="𝔣",Z_i="fi",Q_i="◼",ebi="▪",tbi="fj",ibi="♭",rbi="fl",nbi="▱",sbi="ƒ",obi="𝔽",abi="𝕗",lbi="∀",ubi="∀",cbi="⋔",hbi="⫙",dbi="ℱ",pbi="⨍",fbi="½",mbi="⅓",gbi="¼",ybi="⅕",vbi="⅙",_bi="⅛",bbi="⅔",wbi="⅖",xbi="¾",Sbi="⅗",Tbi="⅜",Cbi="⅘",Ebi="⅚",Ibi="⅝",Abi="⅞",Mbi="⁄",Obi="⌢",Pbi="𝒻",Rbi="ℱ",Dbi="ǵ",Fbi="Γ",kbi="γ",Lbi="Ϝ",Nbi="ϝ",$bi="⪆",Bbi="Ğ",jbi="ğ",Gbi="Ģ",Ubi="Ĝ",zbi="ĝ",Vbi="Г",Hbi="г",Wbi="Ġ",qbi="ġ",Ybi="≥",Xbi="≧",Jbi="⪌",Kbi="⋛",Zbi="≥",Qbi="≧",ewi="⩾",twi="⪩",iwi="⩾",rwi="⪀",nwi="⪂",swi="⪄",owi="⋛︀",awi="⪔",lwi="𝔊",uwi="𝔤",cwi="≫",hwi="⋙",dwi="⋙",pwi="ℷ",fwi="Ѓ",mwi="ѓ",gwi="⪥",ywi="≷",vwi="⪒",_wi="⪤",bwi="⪊",wwi="⪊",xwi="⪈",Swi="≩",Twi="⪈",Cwi="≩",Ewi="⋧",Iwi="𝔾",Awi="𝕘",Mwi="`",Owi="≥",Pwi="⋛",Rwi="≧",Dwi="⪢",Fwi="≷",kwi="⩾",Lwi="≳",Nwi="𝒢",$wi="ℊ",Bwi="≳",jwi="⪎",Gwi="⪐",Uwi="⪧",zwi="⩺",Vwi=">",Hwi=">",Wwi="≫",qwi="⋗",Ywi="⦕",Xwi="⩼",Jwi="⪆",Kwi="⥸",Zwi="⋗",Qwi="⋛",exi="⪌",txi="≷",ixi="≳",rxi="≩︀",nxi="≩︀",sxi="ˇ",oxi=" ",axi="½",lxi="ℋ",uxi="Ъ",cxi="ъ",hxi="⥈",dxi="↔",pxi="⇔",fxi="↭",mxi="^",gxi="ℏ",yxi="Ĥ",vxi="ĥ",_xi="♥",bxi="♥",wxi="…",xxi="⊹",Sxi="𝔥",Txi="ℌ",Cxi="ℋ",Exi="⤥",Ixi="⤦",Axi="⇿",Mxi="∻",Oxi="↩",Pxi="↪",Rxi="𝕙",Dxi="ℍ",Fxi="―",kxi="─",Lxi="𝒽",Nxi="ℋ",$xi="ℏ",Bxi="Ħ",jxi="ħ",Gxi="≎",Uxi="≏",zxi="⁃",Vxi="‐",Hxi="Í",Wxi="í",qxi="⁣",Yxi="Î",Xxi="î",Jxi="И",Kxi="и",Zxi="İ",Qxi="Е",e2i="е",t2i="¡",i2i="⇔",r2i="𝔦",n2i="ℑ",s2i="Ì",o2i="ì",a2i="ⅈ",l2i="⨌",u2i="∭",c2i="⧜",h2i="℩",d2i="IJ",p2i="ij",f2i="Ī",m2i="ī",g2i="ℑ",y2i="ⅈ",v2i="ℐ",_2i="ℑ",b2i="ı",w2i="ℑ",x2i="⊷",S2i="Ƶ",T2i="⇒",C2i="℅",E2i="∞",I2i="⧝",A2i="ı",M2i="⊺",O2i="∫",P2i="∬",R2i="ℤ",D2i="∫",F2i="⊺",k2i="⋂",L2i="⨗",N2i="⨼",$2i="⁣",B2i="⁢",j2i="Ё",G2i="ё",U2i="Į",z2i="į",V2i="𝕀",H2i="𝕚",W2i="Ι",q2i="ι",Y2i="⨼",X2i="¿",J2i="𝒾",K2i="ℐ",Z2i="∈",Q2i="⋵",eSi="⋹",tSi="⋴",iSi="⋳",rSi="∈",nSi="⁢",sSi="Ĩ",oSi="ĩ",aSi="І",lSi="і",uSi="Ï",cSi="ï",hSi="Ĵ",dSi="ĵ",pSi="Й",fSi="й",mSi="𝔍",gSi="𝔧",ySi="ȷ",vSi="𝕁",_Si="𝕛",bSi="𝒥",wSi="𝒿",xSi="Ј",SSi="ј",TSi="Є",CSi="є",ESi="Κ",ISi="κ",ASi="ϰ",MSi="Ķ",OSi="ķ",PSi="К",RSi="к",DSi="𝔎",FSi="𝔨",kSi="ĸ",LSi="Х",NSi="х",$Si="Ќ",BSi="ќ",jSi="𝕂",GSi="𝕜",USi="𝒦",zSi="𝓀",VSi="⇚",HSi="Ĺ",WSi="ĺ",qSi="⦴",YSi="ℒ",XSi="Λ",JSi="λ",KSi="⟨",ZSi="⟪",QSi="⦑",eTi="⟨",tTi="⪅",iTi="ℒ",rTi="«",nTi="⇤",sTi="⤟",oTi="←",aTi="↞",lTi="⇐",uTi="⤝",cTi="↩",hTi="↫",dTi="⤹",pTi="⥳",fTi="↢",mTi="⤙",gTi="⤛",yTi="⪫",vTi="⪭",_Ti="⪭︀",bTi="⤌",wTi="⤎",xTi="❲",STi="{",TTi="[",CTi="⦋",ETi="⦏",ITi="⦍",ATi="Ľ",MTi="ľ",OTi="Ļ",PTi="ļ",RTi="⌈",DTi="{",FTi="Л",kTi="л",LTi="⤶",NTi="“",$Ti="„",BTi="⥧",jTi="⥋",GTi="↲",UTi="≤",zTi="≦",VTi="⟨",HTi="⇤",WTi="←",qTi="←",YTi="⇐",XTi="⇆",JTi="↢",KTi="⌈",ZTi="⟦",QTi="⥡",eCi="⥙",tCi="⇃",iCi="⌊",rCi="↽",nCi="↼",sCi="⇇",oCi="↔",aCi="↔",lCi="⇔",uCi="⇆",cCi="⇋",hCi="↭",dCi="⥎",pCi="↤",fCi="⊣",mCi="⥚",gCi="⋋",yCi="⧏",vCi="⊲",_Ci="⊴",bCi="⥑",wCi="⥠",xCi="⥘",SCi="↿",TCi="⥒",CCi="↼",ECi="⪋",ICi="⋚",ACi="≤",MCi="≦",OCi="⩽",PCi="⪨",RCi="⩽",DCi="⩿",FCi="⪁",kCi="⪃",LCi="⋚︀",NCi="⪓",$Ci="⪅",BCi="⋖",jCi="⋚",GCi="⪋",UCi="⋚",zCi="≦",VCi="≶",HCi="≶",WCi="⪡",qCi="≲",YCi="⩽",XCi="≲",JCi="⥼",KCi="⌊",ZCi="𝔏",QCi="𝔩",eEi="≶",tEi="⪑",iEi="⥢",rEi="↽",nEi="↼",sEi="⥪",oEi="▄",aEi="Љ",lEi="љ",uEi="⇇",cEi="≪",hEi="⋘",dEi="⌞",pEi="⇚",fEi="⥫",mEi="◺",gEi="Ŀ",yEi="ŀ",vEi="⎰",_Ei="⎰",bEi="⪉",wEi="⪉",xEi="⪇",SEi="≨",TEi="⪇",CEi="≨",EEi="⋦",IEi="⟬",AEi="⇽",MEi="⟦",OEi="⟵",PEi="⟵",REi="⟸",DEi="⟷",FEi="⟷",kEi="⟺",LEi="⟼",NEi="⟶",$Ei="⟶",BEi="⟹",jEi="↫",GEi="↬",UEi="⦅",zEi="𝕃",VEi="𝕝",HEi="⨭",WEi="⨴",qEi="∗",YEi="_",XEi="↙",JEi="↘",KEi="◊",ZEi="◊",QEi="⧫",eIi="(",tIi="⦓",iIi="⇆",rIi="⌟",nIi="⇋",sIi="⥭",oIi="‎",aIi="⊿",lIi="‹",uIi="𝓁",cIi="ℒ",hIi="↰",dIi="↰",pIi="≲",fIi="⪍",mIi="⪏",gIi="[",yIi="‘",vIi="‚",_Ii="Ł",bIi="ł",wIi="⪦",xIi="⩹",SIi="<",TIi="<",CIi="≪",EIi="⋖",IIi="⋋",AIi="⋉",MIi="⥶",OIi="⩻",PIi="◃",RIi="⊴",DIi="◂",FIi="⦖",kIi="⥊",LIi="⥦",NIi="≨︀",$Ii="≨︀",BIi="¯",jIi="♂",GIi="✠",UIi="✠",zIi="↦",VIi="↦",HIi="↧",WIi="↤",qIi="↥",YIi="▮",XIi="⨩",JIi="М",KIi="м",ZIi="—",QIi="∺",eAi="∡",tAi=" ",iAi="ℳ",rAi="𝔐",nAi="𝔪",sAi="℧",oAi="µ",aAi="*",lAi="⫰",uAi="∣",cAi="·",hAi="⊟",dAi="−",pAi="∸",fAi="⨪",mAi="∓",gAi="⫛",yAi="…",vAi="∓",_Ai="⊧",bAi="𝕄",wAi="𝕞",xAi="∓",SAi="𝓂",TAi="ℳ",CAi="∾",EAi="Μ",IAi="μ",AAi="⊸",MAi="⊸",OAi="∇",PAi="Ń",RAi="ń",DAi="∠⃒",FAi="≉",kAi="⩰̸",LAi="≋̸",NAi="ʼn",$Ai="≉",BAi="♮",jAi="ℕ",GAi="♮",UAi=" ",zAi="≎̸",VAi="≏̸",HAi="⩃",WAi="Ň",qAi="ň",YAi="Ņ",XAi="ņ",JAi="≇",KAi="⩭̸",ZAi="⩂",QAi="Н",e3i="н",t3i="–",i3i="⤤",r3i="↗",n3i="⇗",s3i="↗",o3i="≠",a3i="≐̸",l3i="​",u3i="​",c3i="​",h3i="​",d3i="≢",p3i="⤨",f3i="≂̸",m3i="≫",g3i="≪",y3i=` +`,v3i="∄",_3i="∄",b3i="𝔑",w3i="𝔫",x3i="≧̸",S3i="≱",T3i="≱",C3i="≧̸",E3i="⩾̸",I3i="⩾̸",A3i="⋙̸",M3i="≵",O3i="≫⃒",P3i="≯",R3i="≯",D3i="≫̸",F3i="↮",k3i="⇎",L3i="⫲",N3i="∋",$3i="⋼",B3i="⋺",j3i="∋",G3i="Њ",U3i="њ",z3i="↚",V3i="⇍",H3i="‥",W3i="≦̸",q3i="≰",Y3i="↚",X3i="⇍",J3i="↮",K3i="⇎",Z3i="≰",Q3i="≦̸",eMi="⩽̸",tMi="⩽̸",iMi="≮",rMi="⋘̸",nMi="≴",sMi="≪⃒",oMi="≮",aMi="⋪",lMi="⋬",uMi="≪̸",cMi="∤",hMi="⁠",dMi=" ",pMi="𝕟",fMi="ℕ",mMi="⫬",gMi="¬",yMi="≢",vMi="≭",_Mi="∦",bMi="∉",wMi="≠",xMi="≂̸",SMi="∄",TMi="≯",CMi="≱",EMi="≧̸",IMi="≫̸",AMi="≹",MMi="⩾̸",OMi="≵",PMi="≎̸",RMi="≏̸",DMi="∉",FMi="⋵̸",kMi="⋹̸",LMi="∉",NMi="⋷",$Mi="⋶",BMi="⧏̸",jMi="⋪",GMi="⋬",UMi="≮",zMi="≰",VMi="≸",HMi="≪̸",WMi="⩽̸",qMi="≴",YMi="⪢̸",XMi="⪡̸",JMi="∌",KMi="∌",ZMi="⋾",QMi="⋽",eOi="⊀",tOi="⪯̸",iOi="⋠",rOi="∌",nOi="⧐̸",sOi="⋫",oOi="⋭",aOi="⊏̸",lOi="⋢",uOi="⊐̸",cOi="⋣",hOi="⊂⃒",dOi="⊈",pOi="⊁",fOi="⪰̸",mOi="⋡",gOi="≿̸",yOi="⊃⃒",vOi="⊉",_Oi="≁",bOi="≄",wOi="≇",xOi="≉",SOi="∤",TOi="∦",COi="∦",EOi="⫽⃥",IOi="∂̸",AOi="⨔",MOi="⊀",OOi="⋠",POi="⊀",ROi="⪯̸",DOi="⪯̸",FOi="⤳̸",kOi="↛",LOi="⇏",NOi="↝̸",$Oi="↛",BOi="⇏",jOi="⋫",GOi="⋭",UOi="⊁",zOi="⋡",VOi="⪰̸",HOi="𝒩",WOi="𝓃",qOi="∤",YOi="∦",XOi="≁",JOi="≄",KOi="≄",ZOi="∤",QOi="∦",ePi="⋢",tPi="⋣",iPi="⊄",rPi="⫅̸",nPi="⊈",sPi="⊂⃒",oPi="⊈",aPi="⫅̸",lPi="⊁",uPi="⪰̸",cPi="⊅",hPi="⫆̸",dPi="⊉",pPi="⊃⃒",fPi="⊉",mPi="⫆̸",gPi="≹",yPi="Ñ",vPi="ñ",_Pi="≸",bPi="⋪",wPi="⋬",xPi="⋫",SPi="⋭",TPi="Ν",CPi="ν",EPi="#",IPi="№",APi=" ",MPi="≍⃒",OPi="⊬",PPi="⊭",RPi="⊮",DPi="⊯",FPi="≥⃒",kPi=">⃒",LPi="⤄",NPi="⧞",$Pi="⤂",BPi="≤⃒",jPi="<⃒",GPi="⊴⃒",UPi="⤃",zPi="⊵⃒",VPi="∼⃒",HPi="⤣",WPi="↖",qPi="⇖",YPi="↖",XPi="⤧",JPi="Ó",KPi="ó",ZPi="⊛",QPi="Ô",eRi="ô",tRi="⊚",iRi="О",rRi="о",nRi="⊝",sRi="Ő",oRi="ő",aRi="⨸",lRi="⊙",uRi="⦼",cRi="Œ",hRi="œ",dRi="⦿",pRi="𝔒",fRi="𝔬",mRi="˛",gRi="Ò",yRi="ò",vRi="⧁",_Ri="⦵",bRi="Ω",wRi="∮",xRi="↺",SRi="⦾",TRi="⦻",CRi="‾",ERi="⧀",IRi="Ō",ARi="ō",MRi="Ω",ORi="ω",PRi="Ο",RRi="ο",DRi="⦶",FRi="⊖",kRi="𝕆",LRi="𝕠",NRi="⦷",$Ri="“",BRi="‘",jRi="⦹",GRi="⊕",URi="↻",zRi="⩔",VRi="∨",HRi="⩝",WRi="ℴ",qRi="ℴ",YRi="ª",XRi="º",JRi="⊶",KRi="⩖",ZRi="⩗",QRi="⩛",eDi="Ⓢ",tDi="𝒪",iDi="ℴ",rDi="Ø",nDi="ø",sDi="⊘",oDi="Õ",aDi="õ",lDi="⨶",uDi="⨷",cDi="⊗",hDi="Ö",dDi="ö",pDi="⌽",fDi="‾",mDi="⏞",gDi="⎴",yDi="⏜",vDi="¶",_Di="∥",bDi="∥",wDi="⫳",xDi="⫽",SDi="∂",TDi="∂",CDi="П",EDi="п",IDi="%",ADi=".",MDi="‰",ODi="⊥",PDi="‱",RDi="𝔓",DDi="𝔭",FDi="Φ",kDi="φ",LDi="ϕ",NDi="ℳ",$Di="☎",BDi="Π",jDi="π",GDi="⋔",UDi="ϖ",zDi="ℏ",VDi="ℎ",HDi="ℏ",WDi="⨣",qDi="⊞",YDi="⨢",XDi="+",JDi="∔",KDi="⨥",ZDi="⩲",QDi="±",e4i="±",t4i="⨦",i4i="⨧",r4i="±",n4i="ℌ",s4i="⨕",o4i="𝕡",a4i="ℙ",l4i="£",u4i="⪷",c4i="⪻",h4i="≺",d4i="≼",p4i="⪷",f4i="≺",m4i="≼",g4i="≺",y4i="⪯",v4i="≼",_4i="≾",b4i="⪯",w4i="⪹",x4i="⪵",S4i="⋨",T4i="⪯",C4i="⪳",E4i="≾",I4i="′",A4i="″",M4i="ℙ",O4i="⪹",P4i="⪵",R4i="⋨",D4i="∏",F4i="∏",k4i="⌮",L4i="⌒",N4i="⌓",$4i="∝",B4i="∝",j4i="∷",G4i="∝",U4i="≾",z4i="⊰",V4i="𝒫",H4i="𝓅",W4i="Ψ",q4i="ψ",Y4i=" ",X4i="𝔔",J4i="𝔮",K4i="⨌",Z4i="𝕢",Q4i="ℚ",e5i="⁗",t5i="𝒬",i5i="𝓆",r5i="ℍ",n5i="⨖",s5i="?",o5i="≟",a5i='"',l5i='"',u5i="⇛",c5i="∽̱",h5i="Ŕ",d5i="ŕ",p5i="√",f5i="⦳",m5i="⟩",g5i="⟫",y5i="⦒",v5i="⦥",_5i="⟩",b5i="»",w5i="⥵",x5i="⇥",S5i="⤠",T5i="⤳",C5i="→",E5i="↠",I5i="⇒",A5i="⤞",M5i="↪",O5i="↬",P5i="⥅",R5i="⥴",D5i="⤖",F5i="↣",k5i="↝",L5i="⤚",N5i="⤜",$5i="∶",B5i="ℚ",j5i="⤍",G5i="⤏",U5i="⤐",z5i="❳",V5i="}",H5i="]",W5i="⦌",q5i="⦎",Y5i="⦐",X5i="Ř",J5i="ř",K5i="Ŗ",Z5i="ŗ",Q5i="⌉",eFi="}",tFi="Р",iFi="р",rFi="⤷",nFi="⥩",sFi="”",oFi="”",aFi="↳",lFi="ℜ",uFi="ℛ",cFi="ℜ",hFi="ℝ",dFi="ℜ",pFi="▭",fFi="®",mFi="®",gFi="∋",yFi="⇋",vFi="⥯",_Fi="⥽",bFi="⌋",wFi="𝔯",xFi="ℜ",SFi="⥤",TFi="⇁",CFi="⇀",EFi="⥬",IFi="Ρ",AFi="ρ",MFi="ϱ",OFi="⟩",PFi="⇥",RFi="→",DFi="→",FFi="⇒",kFi="⇄",LFi="↣",NFi="⌉",$Fi="⟧",BFi="⥝",jFi="⥕",GFi="⇂",UFi="⌋",zFi="⇁",VFi="⇀",HFi="⇄",WFi="⇌",qFi="⇉",YFi="↝",XFi="↦",JFi="⊢",KFi="⥛",ZFi="⋌",QFi="⧐",eki="⊳",tki="⊵",iki="⥏",rki="⥜",nki="⥔",ski="↾",oki="⥓",aki="⇀",lki="˚",uki="≓",cki="⇄",hki="⇌",dki="‏",pki="⎱",fki="⎱",mki="⫮",gki="⟭",yki="⇾",vki="⟧",_ki="⦆",bki="𝕣",wki="ℝ",xki="⨮",Ski="⨵",Tki="⥰",Cki=")",Eki="⦔",Iki="⨒",Aki="⇉",Mki="⇛",Oki="›",Pki="𝓇",Rki="ℛ",Dki="↱",Fki="↱",kki="]",Lki="’",Nki="’",$ki="⋌",Bki="⋊",jki="▹",Gki="⊵",Uki="▸",zki="⧎",Vki="⧴",Hki="⥨",Wki="℞",qki="Ś",Yki="ś",Xki="‚",Jki="⪸",Kki="Š",Zki="š",Qki="⪼",eLi="≻",tLi="≽",iLi="⪰",rLi="⪴",nLi="Ş",sLi="ş",oLi="Ŝ",aLi="ŝ",lLi="⪺",uLi="⪶",cLi="⋩",hLi="⨓",dLi="≿",pLi="С",fLi="с",mLi="⊡",gLi="⋅",yLi="⩦",vLi="⤥",_Li="↘",bLi="⇘",wLi="↘",xLi="§",SLi=";",TLi="⤩",CLi="∖",ELi="∖",ILi="✶",ALi="𝔖",MLi="𝔰",OLi="⌢",PLi="♯",RLi="Щ",DLi="щ",FLi="Ш",kLi="ш",LLi="↓",NLi="←",$Li="∣",BLi="∥",jLi="→",GLi="↑",ULi="­",zLi="Σ",VLi="σ",HLi="ς",WLi="ς",qLi="∼",YLi="⩪",XLi="≃",JLi="≃",KLi="⪞",ZLi="⪠",QLi="⪝",eNi="⪟",tNi="≆",iNi="⨤",rNi="⥲",nNi="←",sNi="∘",oNi="∖",aNi="⨳",lNi="⧤",uNi="∣",cNi="⌣",hNi="⪪",dNi="⪬",pNi="⪬︀",fNi="Ь",mNi="ь",gNi="⌿",yNi="⧄",vNi="/",_Ni="𝕊",bNi="𝕤",wNi="♠",xNi="♠",SNi="∥",TNi="⊓",CNi="⊓︀",ENi="⊔",INi="⊔︀",ANi="√",MNi="⊏",ONi="⊑",PNi="⊏",RNi="⊑",DNi="⊐",FNi="⊒",kNi="⊐",LNi="⊒",NNi="□",$Ni="□",BNi="⊓",jNi="⊏",GNi="⊑",UNi="⊐",zNi="⊒",VNi="⊔",HNi="▪",WNi="□",qNi="▪",YNi="→",XNi="𝒮",JNi="𝓈",KNi="∖",ZNi="⌣",QNi="⋆",e$i="⋆",t$i="☆",i$i="★",r$i="ϵ",n$i="ϕ",s$i="¯",o$i="⊂",a$i="⋐",l$i="⪽",u$i="⫅",c$i="⊆",h$i="⫃",d$i="⫁",p$i="⫋",f$i="⊊",m$i="⪿",g$i="⥹",y$i="⊂",v$i="⋐",_$i="⊆",b$i="⫅",w$i="⊆",x$i="⊊",S$i="⫋",T$i="⫇",C$i="⫕",E$i="⫓",I$i="⪸",A$i="≻",M$i="≽",O$i="≻",P$i="⪰",R$i="≽",D$i="≿",F$i="⪰",k$i="⪺",L$i="⪶",N$i="⋩",$$i="≿",B$i="∋",j$i="∑",G$i="∑",U$i="♪",z$i="¹",V$i="²",H$i="³",W$i="⊃",q$i="⋑",Y$i="⪾",X$i="⫘",J$i="⫆",K$i="⊇",Z$i="⫄",Q$i="⊃",e6i="⊇",t6i="⟉",i6i="⫗",r6i="⥻",n6i="⫂",s6i="⫌",o6i="⊋",a6i="⫀",l6i="⊃",u6i="⋑",c6i="⊇",h6i="⫆",d6i="⊋",p6i="⫌",f6i="⫈",m6i="⫔",g6i="⫖",y6i="⤦",v6i="↙",_6i="⇙",b6i="↙",w6i="⤪",x6i="ß",S6i=" ",T6i="⌖",C6i="Τ",E6i="τ",I6i="⎴",A6i="Ť",M6i="ť",O6i="Ţ",P6i="ţ",R6i="Т",D6i="т",F6i="⃛",k6i="⌕",L6i="𝔗",N6i="𝔱",$6i="∴",B6i="∴",j6i="∴",G6i="Θ",U6i="θ",z6i="ϑ",V6i="ϑ",H6i="≈",W6i="∼",q6i="  ",Y6i=" ",X6i=" ",J6i="≈",K6i="∼",Z6i="Þ",Q6i="þ",e8i="˜",t8i="∼",i8i="≃",r8i="≅",n8i="≈",s8i="⨱",o8i="⊠",a8i="×",l8i="⨰",u8i="∭",c8i="⤨",h8i="⌶",d8i="⫱",p8i="⊤",f8i="𝕋",m8i="𝕥",g8i="⫚",y8i="⤩",v8i="‴",_8i="™",b8i="™",w8i="▵",x8i="▿",S8i="◃",T8i="⊴",C8i="≜",E8i="▹",I8i="⊵",A8i="◬",M8i="≜",O8i="⨺",P8i="⃛",R8i="⨹",D8i="⧍",F8i="⨻",k8i="⏢",L8i="𝒯",N8i="𝓉",$8i="Ц",B8i="ц",j8i="Ћ",G8i="ћ",U8i="Ŧ",z8i="ŧ",V8i="≬",H8i="↞",W8i="↠",q8i="Ú",Y8i="ú",X8i="↑",J8i="↟",K8i="⇑",Z8i="⥉",Q8i="Ў",e9i="ў",t9i="Ŭ",i9i="ŭ",r9i="Û",n9i="û",s9i="У",o9i="у",a9i="⇅",l9i="Ű",u9i="ű",c9i="⥮",h9i="⥾",d9i="𝔘",p9i="𝔲",f9i="Ù",m9i="ù",g9i="⥣",y9i="↿",v9i="↾",_9i="▀",b9i="⌜",w9i="⌜",x9i="⌏",S9i="◸",T9i="Ū",C9i="ū",E9i="¨",I9i="_",A9i="⏟",M9i="⎵",O9i="⏝",P9i="⋃",R9i="⊎",D9i="Ų",F9i="ų",k9i="𝕌",L9i="𝕦",N9i="⤒",$9i="↑",B9i="↑",j9i="⇑",G9i="⇅",U9i="↕",z9i="↕",V9i="⇕",H9i="⥮",W9i="↿",q9i="↾",Y9i="⊎",X9i="↖",J9i="↗",K9i="υ",Z9i="ϒ",Q9i="ϒ",eBi="Υ",tBi="υ",iBi="↥",rBi="⊥",nBi="⇈",sBi="⌝",oBi="⌝",aBi="⌎",lBi="Ů",uBi="ů",cBi="◹",hBi="𝒰",dBi="𝓊",pBi="⋰",fBi="Ũ",mBi="ũ",gBi="▵",yBi="▴",vBi="⇈",_Bi="Ü",bBi="ü",wBi="⦧",xBi="⦜",SBi="ϵ",TBi="ϰ",CBi="∅",EBi="ϕ",IBi="ϖ",ABi="∝",MBi="↕",OBi="⇕",PBi="ϱ",RBi="ς",DBi="⊊︀",FBi="⫋︀",kBi="⊋︀",LBi="⫌︀",NBi="ϑ",$Bi="⊲",BBi="⊳",jBi="⫨",GBi="⫫",UBi="⫩",zBi="В",VBi="в",HBi="⊢",WBi="⊨",qBi="⊩",YBi="⊫",XBi="⫦",JBi="⊻",KBi="∨",ZBi="⋁",QBi="≚",e7i="⋮",t7i="|",i7i="‖",r7i="|",n7i="‖",s7i="∣",o7i="|",a7i="❘",l7i="≀",u7i=" ",c7i="𝔙",h7i="𝔳",d7i="⊲",p7i="⊂⃒",f7i="⊃⃒",m7i="𝕍",g7i="𝕧",y7i="∝",v7i="⊳",_7i="𝒱",b7i="𝓋",w7i="⫋︀",x7i="⊊︀",S7i="⫌︀",T7i="⊋︀",C7i="⊪",E7i="⦚",I7i="Ŵ",A7i="ŵ",M7i="⩟",O7i="∧",P7i="⋀",R7i="≙",D7i="℘",F7i="𝔚",k7i="𝔴",L7i="𝕎",N7i="𝕨",$7i="℘",B7i="≀",j7i="≀",G7i="𝒲",U7i="𝓌",z7i="⋂",V7i="◯",H7i="⋃",W7i="▽",q7i="𝔛",Y7i="𝔵",X7i="⟷",J7i="⟺",K7i="Ξ",Z7i="ξ",Q7i="⟵",eji="⟸",tji="⟼",iji="⋻",rji="⨀",nji="𝕏",sji="𝕩",oji="⨁",aji="⨂",lji="⟶",uji="⟹",cji="𝒳",hji="𝓍",dji="⨆",pji="⨄",fji="△",mji="⋁",gji="⋀",yji="Ý",vji="ý",_ji="Я",bji="я",wji="Ŷ",xji="ŷ",Sji="Ы",Tji="ы",Cji="¥",Eji="𝔜",Iji="𝔶",Aji="Ї",Mji="ї",Oji="𝕐",Pji="𝕪",Rji="𝒴",Dji="𝓎",Fji="Ю",kji="ю",Lji="ÿ",Nji="Ÿ",$ji="Ź",Bji="ź",jji="Ž",Gji="ž",Uji="З",zji="з",Vji="Ż",Hji="ż",Wji="ℨ",qji="​",Yji="Ζ",Xji="ζ",Jji="𝔷",Kji="ℨ",Zji="Ж",Qji="ж",eGi="⇝",tGi="𝕫",iGi="ℤ",rGi="𝒵",nGi="𝓏",sGi="‍",oGi="‌",aGi={Aacute:Vhi,aacute:Hhi,Abreve:Whi,abreve:qhi,ac:Yhi,acd:Xhi,acE:Jhi,Acirc:Khi,acirc:Zhi,acute:Qhi,Acy:edi,acy:tdi,AElig:idi,aelig:rdi,af:ndi,Afr:sdi,afr:odi,Agrave:adi,agrave:ldi,alefsym:udi,aleph:cdi,Alpha:hdi,alpha:ddi,Amacr:pdi,amacr:fdi,amalg:mdi,amp:gdi,AMP:ydi,andand:vdi,And:_di,and:bdi,andd:wdi,andslope:xdi,andv:Sdi,ang:Tdi,ange:Cdi,angle:Edi,angmsdaa:Idi,angmsdab:Adi,angmsdac:Mdi,angmsdad:Odi,angmsdae:Pdi,angmsdaf:Rdi,angmsdag:Ddi,angmsdah:Fdi,angmsd:kdi,angrt:Ldi,angrtvb:Ndi,angrtvbd:$di,angsph:Bdi,angst:jdi,angzarr:Gdi,Aogon:Udi,aogon:zdi,Aopf:Vdi,aopf:Hdi,apacir:Wdi,ap:qdi,apE:Ydi,ape:Xdi,apid:Jdi,apos:Kdi,ApplyFunction:Zdi,approx:Qdi,approxeq:epi,Aring:tpi,aring:ipi,Ascr:rpi,ascr:npi,Assign:spi,ast:opi,asymp:api,asympeq:lpi,Atilde:upi,atilde:cpi,Auml:hpi,auml:dpi,awconint:ppi,awint:fpi,backcong:mpi,backepsilon:gpi,backprime:ypi,backsim:vpi,backsimeq:_pi,Backslash:bpi,Barv:wpi,barvee:xpi,barwed:Spi,Barwed:Tpi,barwedge:Cpi,bbrk:Epi,bbrktbrk:Ipi,bcong:Api,Bcy:Mpi,bcy:Opi,bdquo:Ppi,becaus:Rpi,because:Dpi,Because:Fpi,bemptyv:kpi,bepsi:Lpi,bernou:Npi,Bernoullis:$pi,Beta:Bpi,beta:jpi,beth:Gpi,between:Upi,Bfr:zpi,bfr:Vpi,bigcap:Hpi,bigcirc:Wpi,bigcup:qpi,bigodot:Ypi,bigoplus:Xpi,bigotimes:Jpi,bigsqcup:Kpi,bigstar:Zpi,bigtriangledown:Qpi,bigtriangleup:efi,biguplus:tfi,bigvee:ifi,bigwedge:rfi,bkarow:nfi,blacklozenge:sfi,blacksquare:ofi,blacktriangle:afi,blacktriangledown:lfi,blacktriangleleft:ufi,blacktriangleright:cfi,blank:hfi,blk12:dfi,blk14:pfi,blk34:ffi,block:mfi,bne:gfi,bnequiv:yfi,bNot:vfi,bnot:_fi,Bopf:bfi,bopf:wfi,bot:xfi,bottom:Sfi,bowtie:Tfi,boxbox:Cfi,boxdl:Efi,boxdL:Ifi,boxDl:Afi,boxDL:Mfi,boxdr:Ofi,boxdR:Pfi,boxDr:Rfi,boxDR:Dfi,boxh:Ffi,boxH:kfi,boxhd:Lfi,boxHd:Nfi,boxhD:$fi,boxHD:Bfi,boxhu:jfi,boxHu:Gfi,boxhU:Ufi,boxHU:zfi,boxminus:Vfi,boxplus:Hfi,boxtimes:Wfi,boxul:qfi,boxuL:Yfi,boxUl:Xfi,boxUL:Jfi,boxur:Kfi,boxuR:Zfi,boxUr:Qfi,boxUR:emi,boxv:tmi,boxV:imi,boxvh:rmi,boxvH:nmi,boxVh:smi,boxVH:omi,boxvl:ami,boxvL:lmi,boxVl:umi,boxVL:cmi,boxvr:hmi,boxvR:dmi,boxVr:pmi,boxVR:fmi,bprime:mmi,breve:gmi,Breve:ymi,brvbar:vmi,bscr:_mi,Bscr:bmi,bsemi:wmi,bsim:xmi,bsime:Smi,bsolb:Tmi,bsol:Cmi,bsolhsub:Emi,bull:Imi,bullet:Ami,bump:Mmi,bumpE:Omi,bumpe:Pmi,Bumpeq:Rmi,bumpeq:Dmi,Cacute:Fmi,cacute:kmi,capand:Lmi,capbrcup:Nmi,capcap:$mi,cap:Bmi,Cap:jmi,capcup:Gmi,capdot:Umi,CapitalDifferentialD:zmi,caps:Vmi,caret:Hmi,caron:Wmi,Cayleys:qmi,ccaps:Ymi,Ccaron:Xmi,ccaron:Jmi,Ccedil:Kmi,ccedil:Zmi,Ccirc:Qmi,ccirc:egi,Cconint:tgi,ccups:igi,ccupssm:rgi,Cdot:ngi,cdot:sgi,cedil:ogi,Cedilla:agi,cemptyv:lgi,cent:ugi,centerdot:cgi,CenterDot:hgi,cfr:dgi,Cfr:pgi,CHcy:fgi,chcy:mgi,check:ggi,checkmark:ygi,Chi:vgi,chi:_gi,circ:bgi,circeq:wgi,circlearrowleft:xgi,circlearrowright:Sgi,circledast:Tgi,circledcirc:Cgi,circleddash:Egi,CircleDot:Igi,circledR:Agi,circledS:Mgi,CircleMinus:Ogi,CirclePlus:Pgi,CircleTimes:Rgi,cir:Dgi,cirE:Fgi,cire:kgi,cirfnint:Lgi,cirmid:Ngi,cirscir:$gi,ClockwiseContourIntegral:Bgi,CloseCurlyDoubleQuote:jgi,CloseCurlyQuote:Ggi,clubs:Ugi,clubsuit:zgi,colon:Vgi,Colon:Hgi,Colone:Wgi,colone:qgi,coloneq:Ygi,comma:Xgi,commat:Jgi,comp:Kgi,compfn:Zgi,complement:Qgi,complexes:eyi,cong:tyi,congdot:iyi,Congruent:ryi,conint:nyi,Conint:syi,ContourIntegral:oyi,copf:ayi,Copf:lyi,coprod:uyi,Coproduct:cyi,copy:hyi,COPY:dyi,copysr:pyi,CounterClockwiseContourIntegral:fyi,crarr:myi,cross:gyi,Cross:yyi,Cscr:vyi,cscr:_yi,csub:byi,csube:wyi,csup:xyi,csupe:Syi,ctdot:Tyi,cudarrl:Cyi,cudarrr:Eyi,cuepr:Iyi,cuesc:Ayi,cularr:Myi,cularrp:Oyi,cupbrcap:Pyi,cupcap:Ryi,CupCap:Dyi,cup:Fyi,Cup:kyi,cupcup:Lyi,cupdot:Nyi,cupor:$yi,cups:Byi,curarr:jyi,curarrm:Gyi,curlyeqprec:Uyi,curlyeqsucc:zyi,curlyvee:Vyi,curlywedge:Hyi,curren:Wyi,curvearrowleft:qyi,curvearrowright:Yyi,cuvee:Xyi,cuwed:Jyi,cwconint:Kyi,cwint:Zyi,cylcty:Qyi,dagger:e0i,Dagger:t0i,daleth:i0i,darr:r0i,Darr:n0i,dArr:s0i,dash:o0i,Dashv:a0i,dashv:l0i,dbkarow:u0i,dblac:c0i,Dcaron:h0i,dcaron:d0i,Dcy:p0i,dcy:f0i,ddagger:m0i,ddarr:g0i,DD:y0i,dd:v0i,DDotrahd:_0i,ddotseq:b0i,deg:w0i,Del:x0i,Delta:S0i,delta:T0i,demptyv:C0i,dfisht:E0i,Dfr:I0i,dfr:A0i,dHar:M0i,dharl:O0i,dharr:P0i,DiacriticalAcute:R0i,DiacriticalDot:D0i,DiacriticalDoubleAcute:F0i,DiacriticalGrave:k0i,DiacriticalTilde:L0i,diam:N0i,diamond:$0i,Diamond:B0i,diamondsuit:j0i,diams:G0i,die:U0i,DifferentialD:z0i,digamma:V0i,disin:H0i,div:W0i,divide:q0i,divideontimes:Y0i,divonx:X0i,DJcy:J0i,djcy:K0i,dlcorn:Z0i,dlcrop:Q0i,dollar:evi,Dopf:tvi,dopf:ivi,Dot:rvi,dot:nvi,DotDot:svi,doteq:ovi,doteqdot:avi,DotEqual:lvi,dotminus:uvi,dotplus:cvi,dotsquare:hvi,doublebarwedge:dvi,DoubleContourIntegral:pvi,DoubleDot:fvi,DoubleDownArrow:mvi,DoubleLeftArrow:gvi,DoubleLeftRightArrow:yvi,DoubleLeftTee:vvi,DoubleLongLeftArrow:_vi,DoubleLongLeftRightArrow:bvi,DoubleLongRightArrow:wvi,DoubleRightArrow:xvi,DoubleRightTee:Svi,DoubleUpArrow:Tvi,DoubleUpDownArrow:Cvi,DoubleVerticalBar:Evi,DownArrowBar:Ivi,downarrow:Avi,DownArrow:Mvi,Downarrow:Ovi,DownArrowUpArrow:Pvi,DownBreve:Rvi,downdownarrows:Dvi,downharpoonleft:Fvi,downharpoonright:kvi,DownLeftRightVector:Lvi,DownLeftTeeVector:Nvi,DownLeftVectorBar:$vi,DownLeftVector:Bvi,DownRightTeeVector:jvi,DownRightVectorBar:Gvi,DownRightVector:Uvi,DownTeeArrow:zvi,DownTee:Vvi,drbkarow:Hvi,drcorn:Wvi,drcrop:qvi,Dscr:Yvi,dscr:Xvi,DScy:Jvi,dscy:Kvi,dsol:Zvi,Dstrok:Qvi,dstrok:e1i,dtdot:t1i,dtri:i1i,dtrif:r1i,duarr:n1i,duhar:s1i,dwangle:o1i,DZcy:a1i,dzcy:l1i,dzigrarr:u1i,Eacute:c1i,eacute:h1i,easter:d1i,Ecaron:p1i,ecaron:f1i,Ecirc:m1i,ecirc:g1i,ecir:y1i,ecolon:v1i,Ecy:_1i,ecy:b1i,eDDot:w1i,Edot:x1i,edot:S1i,eDot:T1i,ee:C1i,efDot:E1i,Efr:I1i,efr:A1i,eg:M1i,Egrave:O1i,egrave:P1i,egs:R1i,egsdot:D1i,el:F1i,Element:k1i,elinters:L1i,ell:N1i,els:$1i,elsdot:B1i,Emacr:j1i,emacr:G1i,empty:U1i,emptyset:z1i,EmptySmallSquare:V1i,emptyv:H1i,EmptyVerySmallSquare:W1i,emsp13:q1i,emsp14:Y1i,emsp:X1i,ENG:J1i,eng:K1i,ensp:Z1i,Eogon:Q1i,eogon:e_i,Eopf:t_i,eopf:i_i,epar:r_i,eparsl:n_i,eplus:s_i,epsi:o_i,Epsilon:a_i,epsilon:l_i,epsiv:u_i,eqcirc:c_i,eqcolon:h_i,eqsim:d_i,eqslantgtr:p_i,eqslantless:f_i,Equal:m_i,equals:g_i,EqualTilde:y_i,equest:v_i,Equilibrium:__i,equiv:b_i,equivDD:w_i,eqvparsl:x_i,erarr:S_i,erDot:T_i,escr:C_i,Escr:E_i,esdot:I_i,Esim:A_i,esim:M_i,Eta:O_i,eta:P_i,ETH:R_i,eth:D_i,Euml:F_i,euml:k_i,euro:L_i,excl:N_i,exist:$_i,Exists:B_i,expectation:j_i,exponentiale:G_i,ExponentialE:U_i,fallingdotseq:z_i,Fcy:V_i,fcy:H_i,female:W_i,ffilig:q_i,fflig:Y_i,ffllig:X_i,Ffr:J_i,ffr:K_i,filig:Z_i,FilledSmallSquare:Q_i,FilledVerySmallSquare:ebi,fjlig:tbi,flat:ibi,fllig:rbi,fltns:nbi,fnof:sbi,Fopf:obi,fopf:abi,forall:lbi,ForAll:ubi,fork:cbi,forkv:hbi,Fouriertrf:dbi,fpartint:pbi,frac12:fbi,frac13:mbi,frac14:gbi,frac15:ybi,frac16:vbi,frac18:_bi,frac23:bbi,frac25:wbi,frac34:xbi,frac35:Sbi,frac38:Tbi,frac45:Cbi,frac56:Ebi,frac58:Ibi,frac78:Abi,frasl:Mbi,frown:Obi,fscr:Pbi,Fscr:Rbi,gacute:Dbi,Gamma:Fbi,gamma:kbi,Gammad:Lbi,gammad:Nbi,gap:$bi,Gbreve:Bbi,gbreve:jbi,Gcedil:Gbi,Gcirc:Ubi,gcirc:zbi,Gcy:Vbi,gcy:Hbi,Gdot:Wbi,gdot:qbi,ge:Ybi,gE:Xbi,gEl:Jbi,gel:Kbi,geq:Zbi,geqq:Qbi,geqslant:ewi,gescc:twi,ges:iwi,gesdot:rwi,gesdoto:nwi,gesdotol:swi,gesl:owi,gesles:awi,Gfr:lwi,gfr:uwi,gg:cwi,Gg:hwi,ggg:dwi,gimel:pwi,GJcy:fwi,gjcy:mwi,gla:gwi,gl:ywi,glE:vwi,glj:_wi,gnap:bwi,gnapprox:wwi,gne:xwi,gnE:Swi,gneq:Twi,gneqq:Cwi,gnsim:Ewi,Gopf:Iwi,gopf:Awi,grave:Mwi,GreaterEqual:Owi,GreaterEqualLess:Pwi,GreaterFullEqual:Rwi,GreaterGreater:Dwi,GreaterLess:Fwi,GreaterSlantEqual:kwi,GreaterTilde:Lwi,Gscr:Nwi,gscr:$wi,gsim:Bwi,gsime:jwi,gsiml:Gwi,gtcc:Uwi,gtcir:zwi,gt:Vwi,GT:Hwi,Gt:Wwi,gtdot:qwi,gtlPar:Ywi,gtquest:Xwi,gtrapprox:Jwi,gtrarr:Kwi,gtrdot:Zwi,gtreqless:Qwi,gtreqqless:exi,gtrless:txi,gtrsim:ixi,gvertneqq:rxi,gvnE:nxi,Hacek:sxi,hairsp:oxi,half:axi,hamilt:lxi,HARDcy:uxi,hardcy:cxi,harrcir:hxi,harr:dxi,hArr:pxi,harrw:fxi,Hat:mxi,hbar:gxi,Hcirc:yxi,hcirc:vxi,hearts:_xi,heartsuit:bxi,hellip:wxi,hercon:xxi,hfr:Sxi,Hfr:Txi,HilbertSpace:Cxi,hksearow:Exi,hkswarow:Ixi,hoarr:Axi,homtht:Mxi,hookleftarrow:Oxi,hookrightarrow:Pxi,hopf:Rxi,Hopf:Dxi,horbar:Fxi,HorizontalLine:kxi,hscr:Lxi,Hscr:Nxi,hslash:$xi,Hstrok:Bxi,hstrok:jxi,HumpDownHump:Gxi,HumpEqual:Uxi,hybull:zxi,hyphen:Vxi,Iacute:Hxi,iacute:Wxi,ic:qxi,Icirc:Yxi,icirc:Xxi,Icy:Jxi,icy:Kxi,Idot:Zxi,IEcy:Qxi,iecy:e2i,iexcl:t2i,iff:i2i,ifr:r2i,Ifr:n2i,Igrave:s2i,igrave:o2i,ii:a2i,iiiint:l2i,iiint:u2i,iinfin:c2i,iiota:h2i,IJlig:d2i,ijlig:p2i,Imacr:f2i,imacr:m2i,image:g2i,ImaginaryI:y2i,imagline:v2i,imagpart:_2i,imath:b2i,Im:w2i,imof:x2i,imped:S2i,Implies:T2i,incare:C2i,in:"∈",infin:E2i,infintie:I2i,inodot:A2i,intcal:M2i,int:O2i,Int:P2i,integers:R2i,Integral:D2i,intercal:F2i,Intersection:k2i,intlarhk:L2i,intprod:N2i,InvisibleComma:$2i,InvisibleTimes:B2i,IOcy:j2i,iocy:G2i,Iogon:U2i,iogon:z2i,Iopf:V2i,iopf:H2i,Iota:W2i,iota:q2i,iprod:Y2i,iquest:X2i,iscr:J2i,Iscr:K2i,isin:Z2i,isindot:Q2i,isinE:eSi,isins:tSi,isinsv:iSi,isinv:rSi,it:nSi,Itilde:sSi,itilde:oSi,Iukcy:aSi,iukcy:lSi,Iuml:uSi,iuml:cSi,Jcirc:hSi,jcirc:dSi,Jcy:pSi,jcy:fSi,Jfr:mSi,jfr:gSi,jmath:ySi,Jopf:vSi,jopf:_Si,Jscr:bSi,jscr:wSi,Jsercy:xSi,jsercy:SSi,Jukcy:TSi,jukcy:CSi,Kappa:ESi,kappa:ISi,kappav:ASi,Kcedil:MSi,kcedil:OSi,Kcy:PSi,kcy:RSi,Kfr:DSi,kfr:FSi,kgreen:kSi,KHcy:LSi,khcy:NSi,KJcy:$Si,kjcy:BSi,Kopf:jSi,kopf:GSi,Kscr:USi,kscr:zSi,lAarr:VSi,Lacute:HSi,lacute:WSi,laemptyv:qSi,lagran:YSi,Lambda:XSi,lambda:JSi,lang:KSi,Lang:ZSi,langd:QSi,langle:eTi,lap:tTi,Laplacetrf:iTi,laquo:rTi,larrb:nTi,larrbfs:sTi,larr:oTi,Larr:aTi,lArr:lTi,larrfs:uTi,larrhk:cTi,larrlp:hTi,larrpl:dTi,larrsim:pTi,larrtl:fTi,latail:mTi,lAtail:gTi,lat:yTi,late:vTi,lates:_Ti,lbarr:bTi,lBarr:wTi,lbbrk:xTi,lbrace:STi,lbrack:TTi,lbrke:CTi,lbrksld:ETi,lbrkslu:ITi,Lcaron:ATi,lcaron:MTi,Lcedil:OTi,lcedil:PTi,lceil:RTi,lcub:DTi,Lcy:FTi,lcy:kTi,ldca:LTi,ldquo:NTi,ldquor:$Ti,ldrdhar:BTi,ldrushar:jTi,ldsh:GTi,le:UTi,lE:zTi,LeftAngleBracket:VTi,LeftArrowBar:HTi,leftarrow:WTi,LeftArrow:qTi,Leftarrow:YTi,LeftArrowRightArrow:XTi,leftarrowtail:JTi,LeftCeiling:KTi,LeftDoubleBracket:ZTi,LeftDownTeeVector:QTi,LeftDownVectorBar:eCi,LeftDownVector:tCi,LeftFloor:iCi,leftharpoondown:rCi,leftharpoonup:nCi,leftleftarrows:sCi,leftrightarrow:oCi,LeftRightArrow:aCi,Leftrightarrow:lCi,leftrightarrows:uCi,leftrightharpoons:cCi,leftrightsquigarrow:hCi,LeftRightVector:dCi,LeftTeeArrow:pCi,LeftTee:fCi,LeftTeeVector:mCi,leftthreetimes:gCi,LeftTriangleBar:yCi,LeftTriangle:vCi,LeftTriangleEqual:_Ci,LeftUpDownVector:bCi,LeftUpTeeVector:wCi,LeftUpVectorBar:xCi,LeftUpVector:SCi,LeftVectorBar:TCi,LeftVector:CCi,lEg:ECi,leg:ICi,leq:ACi,leqq:MCi,leqslant:OCi,lescc:PCi,les:RCi,lesdot:DCi,lesdoto:FCi,lesdotor:kCi,lesg:LCi,lesges:NCi,lessapprox:$Ci,lessdot:BCi,lesseqgtr:jCi,lesseqqgtr:GCi,LessEqualGreater:UCi,LessFullEqual:zCi,LessGreater:VCi,lessgtr:HCi,LessLess:WCi,lesssim:qCi,LessSlantEqual:YCi,LessTilde:XCi,lfisht:JCi,lfloor:KCi,Lfr:ZCi,lfr:QCi,lg:eEi,lgE:tEi,lHar:iEi,lhard:rEi,lharu:nEi,lharul:sEi,lhblk:oEi,LJcy:aEi,ljcy:lEi,llarr:uEi,ll:cEi,Ll:hEi,llcorner:dEi,Lleftarrow:pEi,llhard:fEi,lltri:mEi,Lmidot:gEi,lmidot:yEi,lmoustache:vEi,lmoust:_Ei,lnap:bEi,lnapprox:wEi,lne:xEi,lnE:SEi,lneq:TEi,lneqq:CEi,lnsim:EEi,loang:IEi,loarr:AEi,lobrk:MEi,longleftarrow:OEi,LongLeftArrow:PEi,Longleftarrow:REi,longleftrightarrow:DEi,LongLeftRightArrow:FEi,Longleftrightarrow:kEi,longmapsto:LEi,longrightarrow:NEi,LongRightArrow:$Ei,Longrightarrow:BEi,looparrowleft:jEi,looparrowright:GEi,lopar:UEi,Lopf:zEi,lopf:VEi,loplus:HEi,lotimes:WEi,lowast:qEi,lowbar:YEi,LowerLeftArrow:XEi,LowerRightArrow:JEi,loz:KEi,lozenge:ZEi,lozf:QEi,lpar:eIi,lparlt:tIi,lrarr:iIi,lrcorner:rIi,lrhar:nIi,lrhard:sIi,lrm:oIi,lrtri:aIi,lsaquo:lIi,lscr:uIi,Lscr:cIi,lsh:hIi,Lsh:dIi,lsim:pIi,lsime:fIi,lsimg:mIi,lsqb:gIi,lsquo:yIi,lsquor:vIi,Lstrok:_Ii,lstrok:bIi,ltcc:wIi,ltcir:xIi,lt:SIi,LT:TIi,Lt:CIi,ltdot:EIi,lthree:IIi,ltimes:AIi,ltlarr:MIi,ltquest:OIi,ltri:PIi,ltrie:RIi,ltrif:DIi,ltrPar:FIi,lurdshar:kIi,luruhar:LIi,lvertneqq:NIi,lvnE:$Ii,macr:BIi,male:jIi,malt:GIi,maltese:UIi,Map:"⤅",map:zIi,mapsto:VIi,mapstodown:HIi,mapstoleft:WIi,mapstoup:qIi,marker:YIi,mcomma:XIi,Mcy:JIi,mcy:KIi,mdash:ZIi,mDDot:QIi,measuredangle:eAi,MediumSpace:tAi,Mellintrf:iAi,Mfr:rAi,mfr:nAi,mho:sAi,micro:oAi,midast:aAi,midcir:lAi,mid:uAi,middot:cAi,minusb:hAi,minus:dAi,minusd:pAi,minusdu:fAi,MinusPlus:mAi,mlcp:gAi,mldr:yAi,mnplus:vAi,models:_Ai,Mopf:bAi,mopf:wAi,mp:xAi,mscr:SAi,Mscr:TAi,mstpos:CAi,Mu:EAi,mu:IAi,multimap:AAi,mumap:MAi,nabla:OAi,Nacute:PAi,nacute:RAi,nang:DAi,nap:FAi,napE:kAi,napid:LAi,napos:NAi,napprox:$Ai,natural:BAi,naturals:jAi,natur:GAi,nbsp:UAi,nbump:zAi,nbumpe:VAi,ncap:HAi,Ncaron:WAi,ncaron:qAi,Ncedil:YAi,ncedil:XAi,ncong:JAi,ncongdot:KAi,ncup:ZAi,Ncy:QAi,ncy:e3i,ndash:t3i,nearhk:i3i,nearr:r3i,neArr:n3i,nearrow:s3i,ne:o3i,nedot:a3i,NegativeMediumSpace:l3i,NegativeThickSpace:u3i,NegativeThinSpace:c3i,NegativeVeryThinSpace:h3i,nequiv:d3i,nesear:p3i,nesim:f3i,NestedGreaterGreater:m3i,NestedLessLess:g3i,NewLine:y3i,nexist:v3i,nexists:_3i,Nfr:b3i,nfr:w3i,ngE:x3i,nge:S3i,ngeq:T3i,ngeqq:C3i,ngeqslant:E3i,nges:I3i,nGg:A3i,ngsim:M3i,nGt:O3i,ngt:P3i,ngtr:R3i,nGtv:D3i,nharr:F3i,nhArr:k3i,nhpar:L3i,ni:N3i,nis:$3i,nisd:B3i,niv:j3i,NJcy:G3i,njcy:U3i,nlarr:z3i,nlArr:V3i,nldr:H3i,nlE:W3i,nle:q3i,nleftarrow:Y3i,nLeftarrow:X3i,nleftrightarrow:J3i,nLeftrightarrow:K3i,nleq:Z3i,nleqq:Q3i,nleqslant:eMi,nles:tMi,nless:iMi,nLl:rMi,nlsim:nMi,nLt:sMi,nlt:oMi,nltri:aMi,nltrie:lMi,nLtv:uMi,nmid:cMi,NoBreak:hMi,NonBreakingSpace:dMi,nopf:pMi,Nopf:fMi,Not:mMi,not:gMi,NotCongruent:yMi,NotCupCap:vMi,NotDoubleVerticalBar:_Mi,NotElement:bMi,NotEqual:wMi,NotEqualTilde:xMi,NotExists:SMi,NotGreater:TMi,NotGreaterEqual:CMi,NotGreaterFullEqual:EMi,NotGreaterGreater:IMi,NotGreaterLess:AMi,NotGreaterSlantEqual:MMi,NotGreaterTilde:OMi,NotHumpDownHump:PMi,NotHumpEqual:RMi,notin:DMi,notindot:FMi,notinE:kMi,notinva:LMi,notinvb:NMi,notinvc:$Mi,NotLeftTriangleBar:BMi,NotLeftTriangle:jMi,NotLeftTriangleEqual:GMi,NotLess:UMi,NotLessEqual:zMi,NotLessGreater:VMi,NotLessLess:HMi,NotLessSlantEqual:WMi,NotLessTilde:qMi,NotNestedGreaterGreater:YMi,NotNestedLessLess:XMi,notni:JMi,notniva:KMi,notnivb:ZMi,notnivc:QMi,NotPrecedes:eOi,NotPrecedesEqual:tOi,NotPrecedesSlantEqual:iOi,NotReverseElement:rOi,NotRightTriangleBar:nOi,NotRightTriangle:sOi,NotRightTriangleEqual:oOi,NotSquareSubset:aOi,NotSquareSubsetEqual:lOi,NotSquareSuperset:uOi,NotSquareSupersetEqual:cOi,NotSubset:hOi,NotSubsetEqual:dOi,NotSucceeds:pOi,NotSucceedsEqual:fOi,NotSucceedsSlantEqual:mOi,NotSucceedsTilde:gOi,NotSuperset:yOi,NotSupersetEqual:vOi,NotTilde:_Oi,NotTildeEqual:bOi,NotTildeFullEqual:wOi,NotTildeTilde:xOi,NotVerticalBar:SOi,nparallel:TOi,npar:COi,nparsl:EOi,npart:IOi,npolint:AOi,npr:MOi,nprcue:OOi,nprec:POi,npreceq:ROi,npre:DOi,nrarrc:FOi,nrarr:kOi,nrArr:LOi,nrarrw:NOi,nrightarrow:$Oi,nRightarrow:BOi,nrtri:jOi,nrtrie:GOi,nsc:UOi,nsccue:zOi,nsce:VOi,Nscr:HOi,nscr:WOi,nshortmid:qOi,nshortparallel:YOi,nsim:XOi,nsime:JOi,nsimeq:KOi,nsmid:ZOi,nspar:QOi,nsqsube:ePi,nsqsupe:tPi,nsub:iPi,nsubE:rPi,nsube:nPi,nsubset:sPi,nsubseteq:oPi,nsubseteqq:aPi,nsucc:lPi,nsucceq:uPi,nsup:cPi,nsupE:hPi,nsupe:dPi,nsupset:pPi,nsupseteq:fPi,nsupseteqq:mPi,ntgl:gPi,Ntilde:yPi,ntilde:vPi,ntlg:_Pi,ntriangleleft:bPi,ntrianglelefteq:wPi,ntriangleright:xPi,ntrianglerighteq:SPi,Nu:TPi,nu:CPi,num:EPi,numero:IPi,numsp:APi,nvap:MPi,nvdash:OPi,nvDash:PPi,nVdash:RPi,nVDash:DPi,nvge:FPi,nvgt:kPi,nvHarr:LPi,nvinfin:NPi,nvlArr:$Pi,nvle:BPi,nvlt:jPi,nvltrie:GPi,nvrArr:UPi,nvrtrie:zPi,nvsim:VPi,nwarhk:HPi,nwarr:WPi,nwArr:qPi,nwarrow:YPi,nwnear:XPi,Oacute:JPi,oacute:KPi,oast:ZPi,Ocirc:QPi,ocirc:eRi,ocir:tRi,Ocy:iRi,ocy:rRi,odash:nRi,Odblac:sRi,odblac:oRi,odiv:aRi,odot:lRi,odsold:uRi,OElig:cRi,oelig:hRi,ofcir:dRi,Ofr:pRi,ofr:fRi,ogon:mRi,Ograve:gRi,ograve:yRi,ogt:vRi,ohbar:_Ri,ohm:bRi,oint:wRi,olarr:xRi,olcir:SRi,olcross:TRi,oline:CRi,olt:ERi,Omacr:IRi,omacr:ARi,Omega:MRi,omega:ORi,Omicron:PRi,omicron:RRi,omid:DRi,ominus:FRi,Oopf:kRi,oopf:LRi,opar:NRi,OpenCurlyDoubleQuote:$Ri,OpenCurlyQuote:BRi,operp:jRi,oplus:GRi,orarr:URi,Or:zRi,or:VRi,ord:HRi,order:WRi,orderof:qRi,ordf:YRi,ordm:XRi,origof:JRi,oror:KRi,orslope:ZRi,orv:QRi,oS:eDi,Oscr:tDi,oscr:iDi,Oslash:rDi,oslash:nDi,osol:sDi,Otilde:oDi,otilde:aDi,otimesas:lDi,Otimes:uDi,otimes:cDi,Ouml:hDi,ouml:dDi,ovbar:pDi,OverBar:fDi,OverBrace:mDi,OverBracket:gDi,OverParenthesis:yDi,para:vDi,parallel:_Di,par:bDi,parsim:wDi,parsl:xDi,part:SDi,PartialD:TDi,Pcy:CDi,pcy:EDi,percnt:IDi,period:ADi,permil:MDi,perp:ODi,pertenk:PDi,Pfr:RDi,pfr:DDi,Phi:FDi,phi:kDi,phiv:LDi,phmmat:NDi,phone:$Di,Pi:BDi,pi:jDi,pitchfork:GDi,piv:UDi,planck:zDi,planckh:VDi,plankv:HDi,plusacir:WDi,plusb:qDi,pluscir:YDi,plus:XDi,plusdo:JDi,plusdu:KDi,pluse:ZDi,PlusMinus:QDi,plusmn:e4i,plussim:t4i,plustwo:i4i,pm:r4i,Poincareplane:n4i,pointint:s4i,popf:o4i,Popf:a4i,pound:l4i,prap:u4i,Pr:c4i,pr:h4i,prcue:d4i,precapprox:p4i,prec:f4i,preccurlyeq:m4i,Precedes:g4i,PrecedesEqual:y4i,PrecedesSlantEqual:v4i,PrecedesTilde:_4i,preceq:b4i,precnapprox:w4i,precneqq:x4i,precnsim:S4i,pre:T4i,prE:C4i,precsim:E4i,prime:I4i,Prime:A4i,primes:M4i,prnap:O4i,prnE:P4i,prnsim:R4i,prod:D4i,Product:F4i,profalar:k4i,profline:L4i,profsurf:N4i,prop:$4i,Proportional:B4i,Proportion:j4i,propto:G4i,prsim:U4i,prurel:z4i,Pscr:V4i,pscr:H4i,Psi:W4i,psi:q4i,puncsp:Y4i,Qfr:X4i,qfr:J4i,qint:K4i,qopf:Z4i,Qopf:Q4i,qprime:e5i,Qscr:t5i,qscr:i5i,quaternions:r5i,quatint:n5i,quest:s5i,questeq:o5i,quot:a5i,QUOT:l5i,rAarr:u5i,race:c5i,Racute:h5i,racute:d5i,radic:p5i,raemptyv:f5i,rang:m5i,Rang:g5i,rangd:y5i,range:v5i,rangle:_5i,raquo:b5i,rarrap:w5i,rarrb:x5i,rarrbfs:S5i,rarrc:T5i,rarr:C5i,Rarr:E5i,rArr:I5i,rarrfs:A5i,rarrhk:M5i,rarrlp:O5i,rarrpl:P5i,rarrsim:R5i,Rarrtl:D5i,rarrtl:F5i,rarrw:k5i,ratail:L5i,rAtail:N5i,ratio:$5i,rationals:B5i,rbarr:j5i,rBarr:G5i,RBarr:U5i,rbbrk:z5i,rbrace:V5i,rbrack:H5i,rbrke:W5i,rbrksld:q5i,rbrkslu:Y5i,Rcaron:X5i,rcaron:J5i,Rcedil:K5i,rcedil:Z5i,rceil:Q5i,rcub:eFi,Rcy:tFi,rcy:iFi,rdca:rFi,rdldhar:nFi,rdquo:sFi,rdquor:oFi,rdsh:aFi,real:lFi,realine:uFi,realpart:cFi,reals:hFi,Re:dFi,rect:pFi,reg:fFi,REG:mFi,ReverseElement:gFi,ReverseEquilibrium:yFi,ReverseUpEquilibrium:vFi,rfisht:_Fi,rfloor:bFi,rfr:wFi,Rfr:xFi,rHar:SFi,rhard:TFi,rharu:CFi,rharul:EFi,Rho:IFi,rho:AFi,rhov:MFi,RightAngleBracket:OFi,RightArrowBar:PFi,rightarrow:RFi,RightArrow:DFi,Rightarrow:FFi,RightArrowLeftArrow:kFi,rightarrowtail:LFi,RightCeiling:NFi,RightDoubleBracket:$Fi,RightDownTeeVector:BFi,RightDownVectorBar:jFi,RightDownVector:GFi,RightFloor:UFi,rightharpoondown:zFi,rightharpoonup:VFi,rightleftarrows:HFi,rightleftharpoons:WFi,rightrightarrows:qFi,rightsquigarrow:YFi,RightTeeArrow:XFi,RightTee:JFi,RightTeeVector:KFi,rightthreetimes:ZFi,RightTriangleBar:QFi,RightTriangle:eki,RightTriangleEqual:tki,RightUpDownVector:iki,RightUpTeeVector:rki,RightUpVectorBar:nki,RightUpVector:ski,RightVectorBar:oki,RightVector:aki,ring:lki,risingdotseq:uki,rlarr:cki,rlhar:hki,rlm:dki,rmoustache:pki,rmoust:fki,rnmid:mki,roang:gki,roarr:yki,robrk:vki,ropar:_ki,ropf:bki,Ropf:wki,roplus:xki,rotimes:Ski,RoundImplies:Tki,rpar:Cki,rpargt:Eki,rppolint:Iki,rrarr:Aki,Rrightarrow:Mki,rsaquo:Oki,rscr:Pki,Rscr:Rki,rsh:Dki,Rsh:Fki,rsqb:kki,rsquo:Lki,rsquor:Nki,rthree:$ki,rtimes:Bki,rtri:jki,rtrie:Gki,rtrif:Uki,rtriltri:zki,RuleDelayed:Vki,ruluhar:Hki,rx:Wki,Sacute:qki,sacute:Yki,sbquo:Xki,scap:Jki,Scaron:Kki,scaron:Zki,Sc:Qki,sc:eLi,sccue:tLi,sce:iLi,scE:rLi,Scedil:nLi,scedil:sLi,Scirc:oLi,scirc:aLi,scnap:lLi,scnE:uLi,scnsim:cLi,scpolint:hLi,scsim:dLi,Scy:pLi,scy:fLi,sdotb:mLi,sdot:gLi,sdote:yLi,searhk:vLi,searr:_Li,seArr:bLi,searrow:wLi,sect:xLi,semi:SLi,seswar:TLi,setminus:CLi,setmn:ELi,sext:ILi,Sfr:ALi,sfr:MLi,sfrown:OLi,sharp:PLi,SHCHcy:RLi,shchcy:DLi,SHcy:FLi,shcy:kLi,ShortDownArrow:LLi,ShortLeftArrow:NLi,shortmid:$Li,shortparallel:BLi,ShortRightArrow:jLi,ShortUpArrow:GLi,shy:ULi,Sigma:zLi,sigma:VLi,sigmaf:HLi,sigmav:WLi,sim:qLi,simdot:YLi,sime:XLi,simeq:JLi,simg:KLi,simgE:ZLi,siml:QLi,simlE:eNi,simne:tNi,simplus:iNi,simrarr:rNi,slarr:nNi,SmallCircle:sNi,smallsetminus:oNi,smashp:aNi,smeparsl:lNi,smid:uNi,smile:cNi,smt:hNi,smte:dNi,smtes:pNi,SOFTcy:fNi,softcy:mNi,solbar:gNi,solb:yNi,sol:vNi,Sopf:_Ni,sopf:bNi,spades:wNi,spadesuit:xNi,spar:SNi,sqcap:TNi,sqcaps:CNi,sqcup:ENi,sqcups:INi,Sqrt:ANi,sqsub:MNi,sqsube:ONi,sqsubset:PNi,sqsubseteq:RNi,sqsup:DNi,sqsupe:FNi,sqsupset:kNi,sqsupseteq:LNi,square:NNi,Square:$Ni,SquareIntersection:BNi,SquareSubset:jNi,SquareSubsetEqual:GNi,SquareSuperset:UNi,SquareSupersetEqual:zNi,SquareUnion:VNi,squarf:HNi,squ:WNi,squf:qNi,srarr:YNi,Sscr:XNi,sscr:JNi,ssetmn:KNi,ssmile:ZNi,sstarf:QNi,Star:e$i,star:t$i,starf:i$i,straightepsilon:r$i,straightphi:n$i,strns:s$i,sub:o$i,Sub:a$i,subdot:l$i,subE:u$i,sube:c$i,subedot:h$i,submult:d$i,subnE:p$i,subne:f$i,subplus:m$i,subrarr:g$i,subset:y$i,Subset:v$i,subseteq:_$i,subseteqq:b$i,SubsetEqual:w$i,subsetneq:x$i,subsetneqq:S$i,subsim:T$i,subsub:C$i,subsup:E$i,succapprox:I$i,succ:A$i,succcurlyeq:M$i,Succeeds:O$i,SucceedsEqual:P$i,SucceedsSlantEqual:R$i,SucceedsTilde:D$i,succeq:F$i,succnapprox:k$i,succneqq:L$i,succnsim:N$i,succsim:$$i,SuchThat:B$i,sum:j$i,Sum:G$i,sung:U$i,sup1:z$i,sup2:V$i,sup3:H$i,sup:W$i,Sup:q$i,supdot:Y$i,supdsub:X$i,supE:J$i,supe:K$i,supedot:Z$i,Superset:Q$i,SupersetEqual:e6i,suphsol:t6i,suphsub:i6i,suplarr:r6i,supmult:n6i,supnE:s6i,supne:o6i,supplus:a6i,supset:l6i,Supset:u6i,supseteq:c6i,supseteqq:h6i,supsetneq:d6i,supsetneqq:p6i,supsim:f6i,supsub:m6i,supsup:g6i,swarhk:y6i,swarr:v6i,swArr:_6i,swarrow:b6i,swnwar:w6i,szlig:x6i,Tab:S6i,target:T6i,Tau:C6i,tau:E6i,tbrk:I6i,Tcaron:A6i,tcaron:M6i,Tcedil:O6i,tcedil:P6i,Tcy:R6i,tcy:D6i,tdot:F6i,telrec:k6i,Tfr:L6i,tfr:N6i,there4:$6i,therefore:B6i,Therefore:j6i,Theta:G6i,theta:U6i,thetasym:z6i,thetav:V6i,thickapprox:H6i,thicksim:W6i,ThickSpace:q6i,ThinSpace:Y6i,thinsp:X6i,thkap:J6i,thksim:K6i,THORN:Z6i,thorn:Q6i,tilde:e8i,Tilde:t8i,TildeEqual:i8i,TildeFullEqual:r8i,TildeTilde:n8i,timesbar:s8i,timesb:o8i,times:a8i,timesd:l8i,tint:u8i,toea:c8i,topbot:h8i,topcir:d8i,top:p8i,Topf:f8i,topf:m8i,topfork:g8i,tosa:y8i,tprime:v8i,trade:_8i,TRADE:b8i,triangle:w8i,triangledown:x8i,triangleleft:S8i,trianglelefteq:T8i,triangleq:C8i,triangleright:E8i,trianglerighteq:I8i,tridot:A8i,trie:M8i,triminus:O8i,TripleDot:P8i,triplus:R8i,trisb:D8i,tritime:F8i,trpezium:k8i,Tscr:L8i,tscr:N8i,TScy:$8i,tscy:B8i,TSHcy:j8i,tshcy:G8i,Tstrok:U8i,tstrok:z8i,twixt:V8i,twoheadleftarrow:H8i,twoheadrightarrow:W8i,Uacute:q8i,uacute:Y8i,uarr:X8i,Uarr:J8i,uArr:K8i,Uarrocir:Z8i,Ubrcy:Q8i,ubrcy:e9i,Ubreve:t9i,ubreve:i9i,Ucirc:r9i,ucirc:n9i,Ucy:s9i,ucy:o9i,udarr:a9i,Udblac:l9i,udblac:u9i,udhar:c9i,ufisht:h9i,Ufr:d9i,ufr:p9i,Ugrave:f9i,ugrave:m9i,uHar:g9i,uharl:y9i,uharr:v9i,uhblk:_9i,ulcorn:b9i,ulcorner:w9i,ulcrop:x9i,ultri:S9i,Umacr:T9i,umacr:C9i,uml:E9i,UnderBar:I9i,UnderBrace:A9i,UnderBracket:M9i,UnderParenthesis:O9i,Union:P9i,UnionPlus:R9i,Uogon:D9i,uogon:F9i,Uopf:k9i,uopf:L9i,UpArrowBar:N9i,uparrow:$9i,UpArrow:B9i,Uparrow:j9i,UpArrowDownArrow:G9i,updownarrow:U9i,UpDownArrow:z9i,Updownarrow:V9i,UpEquilibrium:H9i,upharpoonleft:W9i,upharpoonright:q9i,uplus:Y9i,UpperLeftArrow:X9i,UpperRightArrow:J9i,upsi:K9i,Upsi:Z9i,upsih:Q9i,Upsilon:eBi,upsilon:tBi,UpTeeArrow:iBi,UpTee:rBi,upuparrows:nBi,urcorn:sBi,urcorner:oBi,urcrop:aBi,Uring:lBi,uring:uBi,urtri:cBi,Uscr:hBi,uscr:dBi,utdot:pBi,Utilde:fBi,utilde:mBi,utri:gBi,utrif:yBi,uuarr:vBi,Uuml:_Bi,uuml:bBi,uwangle:wBi,vangrt:xBi,varepsilon:SBi,varkappa:TBi,varnothing:CBi,varphi:EBi,varpi:IBi,varpropto:ABi,varr:MBi,vArr:OBi,varrho:PBi,varsigma:RBi,varsubsetneq:DBi,varsubsetneqq:FBi,varsupsetneq:kBi,varsupsetneqq:LBi,vartheta:NBi,vartriangleleft:$Bi,vartriangleright:BBi,vBar:jBi,Vbar:GBi,vBarv:UBi,Vcy:zBi,vcy:VBi,vdash:HBi,vDash:WBi,Vdash:qBi,VDash:YBi,Vdashl:XBi,veebar:JBi,vee:KBi,Vee:ZBi,veeeq:QBi,vellip:e7i,verbar:t7i,Verbar:i7i,vert:r7i,Vert:n7i,VerticalBar:s7i,VerticalLine:o7i,VerticalSeparator:a7i,VerticalTilde:l7i,VeryThinSpace:u7i,Vfr:c7i,vfr:h7i,vltri:d7i,vnsub:p7i,vnsup:f7i,Vopf:m7i,vopf:g7i,vprop:y7i,vrtri:v7i,Vscr:_7i,vscr:b7i,vsubnE:w7i,vsubne:x7i,vsupnE:S7i,vsupne:T7i,Vvdash:C7i,vzigzag:E7i,Wcirc:I7i,wcirc:A7i,wedbar:M7i,wedge:O7i,Wedge:P7i,wedgeq:R7i,weierp:D7i,Wfr:F7i,wfr:k7i,Wopf:L7i,wopf:N7i,wp:$7i,wr:B7i,wreath:j7i,Wscr:G7i,wscr:U7i,xcap:z7i,xcirc:V7i,xcup:H7i,xdtri:W7i,Xfr:q7i,xfr:Y7i,xharr:X7i,xhArr:J7i,Xi:K7i,xi:Z7i,xlarr:Q7i,xlArr:eji,xmap:tji,xnis:iji,xodot:rji,Xopf:nji,xopf:sji,xoplus:oji,xotime:aji,xrarr:lji,xrArr:uji,Xscr:cji,xscr:hji,xsqcup:dji,xuplus:pji,xutri:fji,xvee:mji,xwedge:gji,Yacute:yji,yacute:vji,YAcy:_ji,yacy:bji,Ycirc:wji,ycirc:xji,Ycy:Sji,ycy:Tji,yen:Cji,Yfr:Eji,yfr:Iji,YIcy:Aji,yicy:Mji,Yopf:Oji,yopf:Pji,Yscr:Rji,yscr:Dji,YUcy:Fji,yucy:kji,yuml:Lji,Yuml:Nji,Zacute:$ji,zacute:Bji,Zcaron:jji,zcaron:Gji,Zcy:Uji,zcy:zji,Zdot:Vji,zdot:Hji,zeetrf:Wji,ZeroWidthSpace:qji,Zeta:Yji,zeta:Xji,zfr:Jji,Zfr:Kji,ZHcy:Zji,zhcy:Qji,zigrarr:eGi,zopf:tGi,Zopf:iGi,Zscr:rGi,zscr:nGi,zwj:sGi,zwnj:oGi};var dTt=aGi,SUe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,aY={},eit={};function lGi(i){var e,t,r=eit[i];if(r)return r;for(r=eit[i]=[],e=0;e<128;e++)t=String.fromCharCode(e),/^[0-9a-z]$/i.test(t)?r.push(t):r.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e"u"&&(t=!0),a=lGi(e),r=0,n=i.length;r=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1=56320&&o<=57343)){l+=encodeURIComponent(i[r]+i[r+1]),r++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(i[r])}return l}Nxe.defaultChars=";/?:@&=+$,-_.!~*'()#";Nxe.componentChars="-_.!~*'()";var uGi=Nxe,tit={};function cGi(i){var e,t,r=tit[i];if(r)return r;for(r=tit[i]=[],e=0;e<128;e++)t=String.fromCharCode(e),r.push(t);for(e=0;e=55296&&c<=57343?h+="���":h+=String.fromCharCode(c),n+=6;continue}if((o&248)===240&&n+91114111?h+="����":(c-=65536,h+=String.fromCharCode(55296+(c>>10),56320+(c&1023))),n+=9;continue}h+="�"}return h})}$xe.defaultChars=";/?:@&=+$,#";$xe.componentChars="";var hGi=$xe,dGi=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t};function cve(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var pGi=/^([a-z0-9.+-]+:)/i,fGi=/:[0-9]*$/,mGi=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gGi=["<",">",'"',"`"," ","\r",` +`," "],yGi=["{","}","|","\\","^","`"].concat(gGi),vGi=["'"].concat(yGi),iit=["%","/","?",";","#"].concat(vGi),rit=["/","?","#"],_Gi=255,nit=/^[+a-z0-9A-Z_-]{0,63}$/,bGi=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sit={javascript:!0,"javascript:":!0},oit={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wGi(i,e){if(i&&i instanceof cve)return i;var t=new cve;return t.parse(i,e),t}cve.prototype.parse=function(i,e){var t,r,n,s,o,a=i;if(a=a.trim(),!e&&i.split("#").length===1){var l=mGi.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var u=pGi.exec(a);if(u&&(u=u[0],n=u.toLowerCase(),this.protocol=u,a=a.substr(u.length)),(e||u||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=a.substr(0,2)==="//",o&&!(u&&sit[u])&&(a=a.substr(2),this.slashes=!0)),!sit[u]&&(o||u&&!oit[u])){var c=-1;for(t=0;t127?I+="x":I+=S[R];if(!I.match(nit)){var k=w.slice(0,t),B=w.slice(t+1),$=S.match(bGi);$&&(k.push($[1]),B.unshift($[2])),B.length&&(a=B.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>_Gi&&(this.hostname=""),v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var V=a.indexOf("#");V!==-1&&(this.hash=a.substr(V),a=a.slice(0,V));var Y=a.indexOf("?");return Y!==-1&&(this.search=a.substr(Y),a=a.slice(0,Y)),a&&(this.pathname=a),oit[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};cve.prototype.parseHost=function(i){var e=fGi.exec(i);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),i=i.substr(0,i.length-e.length)),i&&(this.hostname=i)};var xGi=wGi;aY.encode=uGi;aY.decode=hGi;aY.format=dGi;aY.parse=xGi;var LL={},AAe,ait;function pTt(){return ait||(ait=1,AAe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),AAe}var MAe,lit;function fTt(){return lit||(lit=1,MAe=/[\0-\x1F\x7F-\x9F]/),MAe}var OAe,uit;function SGi(){return uit||(uit=1,OAe=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),OAe}var PAe,cit;function mTt(){return cit||(cit=1,PAe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),PAe}var hit;function TGi(){return hit||(hit=1,LL.Any=pTt(),LL.Cc=fTt(),LL.Cf=SGi(),LL.P=SUe,LL.Z=mTt()),LL}(function(i){function e(pe){return Object.prototype.toString.call(pe)}function t(pe){return e(pe)==="[object String]"}var r=Object.prototype.hasOwnProperty;function n(pe,H){return r.call(pe,H)}function s(pe){var H=Array.prototype.slice.call(arguments,1);return H.forEach(function(Z){if(Z){if(typeof Z!="object")throw new TypeError(Z+"must be object");Object.keys(Z).forEach(function(ae){pe[ae]=Z[ae]})}}),pe}function o(pe,H,Z){return[].concat(pe.slice(0,H),Z,pe.slice(H+1))}function a(pe){return!(pe>=55296&&pe<=57343||pe>=64976&&pe<=65007||(pe&65535)===65535||(pe&65535)===65534||pe>=0&&pe<=8||pe===11||pe>=14&&pe<=31||pe>=127&&pe<=159||pe>1114111)}function l(pe){if(pe>65535){pe-=65536;var H=55296+(pe>>10),Z=56320+(pe&1023);return String.fromCharCode(H,Z)}return String.fromCharCode(pe)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(u.source+"|"+c.source,"gi"),p=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,m=dTt;function v(pe,H){var Z=0;return n(m,H)?m[H]:H.charCodeAt(0)===35&&p.test(H)&&(Z=H[1].toLowerCase()==="x"?parseInt(H.slice(2),16):parseInt(H.slice(1),10),a(Z))?l(Z):pe}function w(pe){return pe.indexOf("\\")<0?pe:pe.replace(u,"$1")}function S(pe){return pe.indexOf("\\")<0&&pe.indexOf("&")<0?pe:pe.replace(h,function(H,Z,ae){return Z||v(H,ae)})}var I=/[&<>"]/,R=/[&<>"]/g,L={"&":"&","<":"<",">":">",'"':"""};function k(pe){return L[pe]}function B(pe){return I.test(pe)?pe.replace(R,k):pe}var $=/[.?*+^$[\]\\(){}|-]/g;function V(pe){return pe.replace($,"\\$&")}function Y(pe){switch(pe){case 9:case 32:return!0}return!1}function K(pe){if(pe>=8192&&pe<=8202)return!0;switch(pe){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var Q=SUe;function re(pe){return Q.test(pe)}function ne(pe){switch(pe){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function de(pe){return pe=pe.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(pe=pe.replace(/ẞ/g,"ß")),pe.toLowerCase().toUpperCase()}i.lib={},i.lib.mdurl=aY,i.lib.ucmicro=TGi(),i.assign=s,i.isString=t,i.has=n,i.unescapeMd=w,i.unescapeAll=S,i.isValidEntityCode=a,i.fromCodePoint=l,i.escapeHtml=B,i.arrayReplaceAt=o,i.isSpace=Y,i.isWhiteSpace=K,i.isMdAsciiPunct=ne,i.isPunctChar=re,i.escapeRE=V,i.normalizeReference=de})(Pc);var Bxe={},CGi=function(e,t,r){var n,s,o,a,l=-1,u=e.posMax,c=e.pos;for(e.pos=t+1,n=1;e.pos32))return l;if(n===41){if(s===0)break;s--}t++}return a===t||s!==0||(l.str=dit(e.slice(a,t)),l.lines=o,l.pos=t,l.ok=!0),l},IGi=Pc.unescapeAll,AGi=function(e,t,r){var n,s,o=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=r||(s=e.charCodeAt(t),s!==34&&s!==39&&s!==40))return l;for(t++,s===40&&(s=41);t"+G9(i[e].content)+""};$3.code_block=function(i,e,t,r,n){var s=i[e];return""+G9(i[e].content)+` +`};$3.fence=function(i,e,t,r,n){var s=i[e],o=s.info?OGi(s.info).trim():"",a="",l="",u,c,h,p,m;return o&&(h=o.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),t.highlight?u=t.highlight(s.content,a,l)||G9(s.content):u=G9(s.content),u.indexOf(""+u+` `):"
"+u+`
`};$3.image=function(i,e,t,r,n){var s=i[e];return s.attrs[s.attrIndex("alt")][1]=n.renderInlineAsText(s.children,t,r),n.renderToken(i,e,t)};$3.hardbreak=function(i,e,t){return t.xhtmlOut?`
@@ -10,17 +10,17 @@ import{d as da,u as uTt,r as sY,a as oY,o as pr,c as wr,w as Sm,n as Jl,b as xc, `};$3.softbreak=function(i,e,t){return t.breaks?t.xhtmlOut?`
`:`
`:` -`};$3.text=function(i,e){return G9(i[e].content)};$3.html_block=function(i,e){return i[e].content};$3.html_inline=function(i,e){return i[e].content};function lY(){this.rules=RGi({},$3)}lY.prototype.renderAttrs=function(e){var t,r,n;if(!e.attrs)return"";for(n="",t=0,r=e.attrs.length;t `:">",s)};lY.prototype.renderInline=function(i,e,t){for(var r,n="",s=this.rules,o=0,a=i.length;o\s]/i.test(i)}function UGi(i){return/^<\/a\s*>/i.test(i)}var zGi=function(e){var t,r,n,s,o,a,l,u,c,h,p,m,v,w,S,I,R=e.tokens,L;if(e.md.options.linkify){for(r=0,n=R.length;r=0;t--){if(a=s[t],a.type==="link_close"){for(t--;s[t].level!==a.level&&s[t].type!=="link_open";)t--;continue}if(a.type==="html_inline"&&(GGi(a.content)&&v>0&&v--,UGi(a.content)&&v++),!(v>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(c=a.content,L=e.md.linkify.match(c),l=[],m=a.level,p=0,u=0;up&&(o=new e.Token("text","",0),o.content=c.slice(p,h),o.level=m,l.push(o)),o=new e.Token("link_open","a",1),o.attrs=[["href",S]],o.level=m++,o.markup="linkify",o.info="auto",l.push(o),o=new e.Token("text","",0),o.content=I,o.level=m,l.push(o),o=new e.Token("link_close","a",-1),o.level=--m,o.markup="linkify",o.info="auto",l.push(o),p=L[u].lastIndex);p=0;e--)t=i[e],t.type==="text"&&!r&&(t.content=t.content.replace(HGi,qGi)),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}function XGi(i){var e,t,r=0;for(e=i.length-1;e>=0;e--)t=i[e],t.type==="text"&&!r&&gTt.test(t.content)&&(t.content=t.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}var JGi=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(VGi.test(e.tokens[t].content)&&YGi(e.tokens[t].children),gTt.test(e.tokens[t].content)&&XGi(e.tokens[t].children))},pit=Pc.isWhiteSpace,fit=Pc.isPunctChar,mit=Pc.isMdAsciiPunct,KGi=/['"]/,git=/['"]/g,yit="’";function Sce(i,e,t){return i.substr(0,e)+t+i.substr(e+1)}function ZGi(i,e){var t,r,n,s,o,a,l,u,c,h,p,m,v,w,S,I,R,L,k,B,$;for(k=[],t=0;t=0&&!(k[R].level<=l);R--);if(k.length=R+1,r.type==="text"){n=r.content,o=0,a=n.length;e:for(;o=0)c=n.charCodeAt(s.index-1);else for(R=t-1;R>=0&&!(i[R].type==="softbreak"||i[R].type==="hardbreak");R--)if(i[R].content){c=i[R].content.charCodeAt(i[R].content.length-1);break}if(h=32,o=48&&c<=57&&(I=S=!1),S&&I&&(S=p,I=m),!S&&!I){L&&(r.content=Sce(r.content,s.index,yit));continue}if(I){for(R=k.length-1;R>=0&&(u=k[R],!(k[R].level=0;t--)e.tokens[t].type!=="inline"||!KGi.test(e.tokens[t].content)||ZGi(e.tokens[t].children,e)};function uY(i,e,t){this.type=i,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}uY.prototype.attrIndex=function(e){var t,r,n;if(!this.attrs)return-1;for(t=this.attrs,r=0,n=t.length;r=0&&(r=this.attrs[t][1]),r};uY.prototype.attrJoin=function(e,t){var r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};var CUe=uY,eUi=CUe;function yTt(i,e,t){this.src=i,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}yTt.prototype.Token=eUi;var tUi=yTt,iUi=TUe,RAe=[["normalize",NGi],["block",$Gi],["inline",BGi],["linkify",zGi],["replacements",JGi],["smartquotes",QGi]];function EUe(){this.ruler=new iUi;for(var i=0;ir||(c=t+1,e.sCount[c]=4||(a=e.bMarks[c]+e.tShift[c],a>=e.eMarks[c])||(B=e.src.charCodeAt(a++),B!==124&&B!==45&&B!==58)||a>=e.eMarks[c]||($=e.src.charCodeAt(a++),$!==124&&$!==45&&$!==58&&!DAe($))||B===45&&DAe($))return!1;for(;a=4||(h=vit(o),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),p=h.length,p===0||p!==v.length))return!1;if(n)return!0;for(R=e.parentType,e.parentType="table",k=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),m.map=S=[t,0],m=e.push("thead_open","thead",1),m.map=[t,t+1],m=e.push("tr_open","tr",1),m.map=[t,t+1],l=0;l=4)break;for(h=vit(o),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),c===t+2&&(m=e.push("tbody_open","tbody",1),m.map=I=[t+2,0]),m=e.push("tr_open","tr",1),m.map=[c,c+1],l=0;l=4){n++,s=n;continue}break}return e.line=s,o=e.push("code_block","code",0),o.content=e.getLines(t,s,4+e.blkIndent,!1)+` -`,o.map=[t,e.line],!0},oUi=function(e,t,r,n){var s,o,a,l,u,c,h,p=!1,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||m+3>v||(s=e.src.charCodeAt(m),s!==126&&s!==96)||(u=m,m=e.skipChars(m,s),o=m-u,o<3)||(h=e.src.slice(u,m),a=e.src.slice(m,v),s===96&&a.indexOf(String.fromCharCode(s))>=0))return!1;if(n)return!0;for(l=t;l++,!(l>=r||(m=u=e.bMarks[l]+e.tShift[l],v=e.eMarks[l],m=4)&&(m=e.skipChars(m,s),!(m-u=4||e.src.charCodeAt(Q++)!==62)return!1;if(n)return!0;for(l=m=e.sCount[t]+1,e.src.charCodeAt(Q)===32?(Q++,l++,m++,s=!1,k=!0):e.src.charCodeAt(Q)===9?(k=!0,(e.bsCount[t]+m)%4===3?(Q++,l++,m++,s=!1):s=!0):k=!1,v=[e.bMarks[t]],e.bMarks[t]=Q;Q=re,R=[e.sCount[t]],e.sCount[t]=m-l,L=[e.tShift[t]],e.tShift[t]=Q-e.bMarks[t],$=e.md.block.ruler.getRules("blockquote"),I=e.parentType,e.parentType="blockquote",p=t+1;p=re));p++){if(e.src.charCodeAt(Q++)===62&&!Y){for(l=m=e.sCount[p]+1,e.src.charCodeAt(Q)===32?(Q++,l++,m++,s=!1,k=!0):e.src.charCodeAt(Q)===9?(k=!0,(e.bsCount[p]+m)%4===3?(Q++,l++,m++,s=!1):s=!0):k=!1,v.push(e.bMarks[p]),e.bMarks[p]=Q;Q=re,w.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(k?1:0),R.push(e.sCount[p]),e.sCount[p]=m-l,L.push(e.tShift[p]),e.tShift[p]=Q-e.bMarks[p];continue}if(c)break;for(B=!1,a=0,u=$.length;a",V.map=h=[t,0],e.md.block.tokenize(e,t,p),V=e.push("blockquote_close","blockquote",-1),V.markup=">",e.lineMax=K,e.parentType=I,h[1]=e.line,a=0;a=4||(s=e.src.charCodeAt(u++),s!==42&&s!==45&&s!==95))return!1;for(o=1;u=s||(t=i.src.charCodeAt(n++),t<48||t>57))return-1;for(;;){if(n>=s)return-1;if(t=i.src.charCodeAt(n++),t>=48&&t<=57){if(n-r>=10)return-1;continue}if(t===41||t===46)break;return-1}return n=4||e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(ae=!0),(re=wit(e,t))>=0){if(h=!0,de=e.bMarks[t]+e.tShift[t],I=Number(e.src.slice(de,re-1)),ae&&I!==1)return!1}else if((re=bit(e,t))>=0)h=!1;else return!1;if(ae&&e.skipSpaces(re)>=e.eMarks[t])return!1;if(S=e.src.charCodeAt(re-1),n)return!0;for(w=e.tokens.length,h?(Z=e.push("ordered_list_open","ol",1),I!==1&&(Z.attrs=[["start",I]])):Z=e.push("bullet_list_open","ul",1),Z.map=v=[t,0],Z.markup=String.fromCharCode(S),L=t,ne=!1,H=e.md.block.ruler.getRules("list"),$=e.parentType,e.parentType="list";L=R?u=1:u=k-c,u>4&&(u=1),l=c+u,Z=e.push("list_item_open","li",1),Z.markup=String.fromCharCode(S),Z.map=p=[t,0],h&&(Z.info=e.src.slice(de,re-1)),K=e.tight,Y=e.tShift[t],V=e.sCount[t],B=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=o-e.bMarks[t],e.sCount[t]=k,o>=R&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,t,r,!0),(!e.tight||ne)&&(fe=!1),ne=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=B,e.tShift[t]=Y,e.sCount[t]=V,e.tight=K,Z=e.push("list_item_close","li",-1),Z.markup=String.fromCharCode(S),L=t=e.line,p[1]=L,o=e.bMarks[t],L>=r||e.sCount[L]=4)break;for(pe=!1,a=0,m=H.length;a=4||e.src.charCodeAt($)!==91)return!1;for(;++$3)&&!(e.sCount[Y]<0)){for(R=!1,c=0,h=L.length;c"u"&&(e.env.references={}),typeof e.env.references[p]>"u"&&(e.env.references[p]={title:k,href:u}),e.parentType=v,e.line=t+B+1),!0)},fUi=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],jxe={},mUi="[a-zA-Z_:][a-zA-Z0-9:._-]*",gUi="[^\"'=<>`\\x00-\\x20]+",yUi="'[^']*'",vUi='"[^"]*"',_Ui="(?:"+gUi+"|"+yUi+"|"+vUi+")",bUi="(?:\\s+"+mUi+"(?:\\s*=\\s*"+_Ui+")?)",_Tt="<[A-Za-z][A-Za-z0-9\\-]*"+bUi+"*\\s*\\/?>",bTt="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",wUi="|",xUi="<[?][\\s\\S]*?[?]>",SUi="]*>",TUi="",CUi=new RegExp("^(?:"+_Tt+"|"+bTt+"|"+wUi+"|"+xUi+"|"+SUi+"|"+TUi+")"),EUi=new RegExp("^(?:"+_Tt+"|"+bTt+")");jxe.HTML_TAG_RE=CUi;jxe.HTML_OPEN_CLOSE_TAG_RE=EUi;var IUi=fUi,AUi=jxe.HTML_OPEN_CLOSE_TAG_RE,sj=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(AUi.source+"\\s*$"),/^$/,!1]],MUi=function(e,t,r,n){var s,o,a,l,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(u)!==60)return!1;for(l=e.src.slice(u,c),s=0;s=4||(s=e.src.charCodeAt(u),s!==35||u>=c))return!1;for(o=1,s=e.src.charCodeAt(++u);s===35&&u6||uu&&xit(e.src.charCodeAt(a-1))&&(c=a),e.line=t+1,l=e.push("heading_open","h"+String(o),1),l.markup="########".slice(0,o),l.map=[t,e.line],l=e.push("inline","",0),l.content=e.src.slice(u,c).trim(),l.map=[t,e.line],l.children=[],l=e.push("heading_close","h"+String(o),-1),l.markup="########".slice(0,o)),!0)},PUi=function(e,t,r){var n,s,o,a,l,u,c,h,p,m=t+1,v,w=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(v=e.parentType,e.parentType="paragraph";m3)){if(e.sCount[m]>=e.blkIndent&&(u=e.bMarks[m]+e.tShift[m],c=e.eMarks[m],u=c)))){h=p===61?1:2;break}if(!(e.sCount[m]<0)){for(s=!1,o=0,a=w.length;o3)&&!(e.sCount[u]<0)){for(n=!1,s=0,o=c.length;s0&&this.level++,this.tokens.push(r),r};B3.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};B3.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!Gxe(this.src.charCodeAt(--e)))return e+1;return e};B3.prototype.skipChars=function(e,t){for(var r=this.src.length;er;)if(t!==this.src.charCodeAt(--e))return e+1;return e};B3.prototype.getLines=function(e,t,r,n){var s,o,a,l,u,c,h,p=e;if(e>=t)return"";for(c=new Array(t-e),s=0;pr?c[s]=new Array(o-r+1).join(" ")+this.src.slice(l,u):c[s]=this.src.slice(l,u)}return c.join("")};B3.prototype.Token=wTt;var DUi=B3,FUi=TUe,Cce=[["table",nUi,["paragraph","reference"]],["code",sUi],["fence",oUi,["paragraph","reference","blockquote","list"]],["blockquote",aUi,["paragraph","reference","blockquote","list"]],["hr",uUi,["paragraph","reference","blockquote","list"]],["list",hUi,["paragraph","reference","blockquote"]],["reference",pUi],["html_block",MUi,["paragraph","reference","blockquote"]],["heading",OUi,["paragraph","reference","blockquote"]],["lheading",PUi],["paragraph",RUi]];function Uxe(){this.ruler=new FUi;for(var i=0;i=t||i.sCount[a]=u){i.line=t;break}for(n=0;n=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){for(s=r-1;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(o++;o?@[]^_`{|}~-".split("").forEach(function(i){IUe[i.charCodeAt(0)]=1});var GUi=function(e,t){var r,n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==92)return!1;if(n++,n=0;t--)r=e[t],!(r.marker!==95&&r.marker!==42)&&r.end!==-1&&(n=e[r.end],a=t>0&&e[t-1].end===r.end+1&&e[t-1].marker===r.marker&&e[t-1].token===r.token-1&&e[r.end+1].token===n.token+1,o=String.fromCharCode(r.marker),s=i.tokens[r.token],s.type=a?"strong_open":"em_open",s.tag=a?"strong":"em",s.nesting=1,s.markup=a?o+o:o,s.content="",s=i.tokens[n.token],s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?o+o:o,s.content="",a&&(i.tokens[e[t-1].token].content="",i.tokens[e[r.end+1].token].content="",t--))}Vxe.postProcess=function(e){var t,r=e.tokens_meta,n=e.tokens_meta.length;for(Cit(e,e.delimiters),t=0;t=w)return!1;if(S=l,u=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),u.ok){for(p=e.md.normalizeLink(u.str),e.md.validateLink(p)?l=u.pos:p="",S=l;l=w||e.src.charCodeAt(l)!==41)&&(I=!0),l++}if(I){if(typeof e.env.references>"u")return!1;if(l=0?s=e.src.slice(S,l++):l=o+1):l=o+1,s||(s=e.src.slice(a,o)),c=e.env.references[zUi(s)],!c)return e.pos=v,!1;p=c.href,m=c.title}return t||(e.pos=a,e.posMax=o,h=e.push("link_open","a",1),h.attrs=r=[["href",p]],m&&r.push(["title",m]),e.md.inline.tokenize(e),h=e.push("link_close","a",-1)),e.pos=l,e.posMax=w,!0},HUi=Pc.normalizeReference,LAe=Pc.isSpace,WUi=function(e,t){var r,n,s,o,a,l,u,c,h,p,m,v,w,S="",I=e.pos,R=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(l=e.pos+2,a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),a<0))return!1;if(u=a+1,u=R)return!1;for(w=u,h=e.md.helpers.parseLinkDestination(e.src,u,e.posMax),h.ok&&(S=e.md.normalizeLink(h.str),e.md.validateLink(S)?u=h.pos:S=""),w=u;u=R||e.src.charCodeAt(u)!==41)return e.pos=I,!1;u++}else{if(typeof e.env.references>"u")return!1;if(u=0?o=e.src.slice(w,u++):u=a+1):u=a+1,o||(o=e.src.slice(l,a)),c=e.env.references[HUi(o)],!c)return e.pos=I,!1;S=c.href,p=c.title}return t||(s=e.src.slice(l,a),e.md.inline.parse(s,e.md,e.env,v=[]),m=e.push("image","img",0),m.attrs=r=[["src",S],["alt",""]],m.children=v,m.content=s,p&&r.push(["title",p])),e.pos=u,e.posMax=R,!0},qUi=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,YUi=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,XUi=function(e,t){var r,n,s,o,a,l,u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;for(a=e.pos,l=e.posMax;;){if(++u>=l||(o=e.src.charCodeAt(u),o===60))return!1;if(o===62)break}return r=e.src.slice(a+1,u),YUi.test(r)?(n=e.md.normalizeLink(r),e.md.validateLink(n)?(t||(s=e.push("link_open","a",1),s.attrs=[["href",n]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):qUi.test(r)?(n=e.md.normalizeLink("mailto:"+r),e.md.validateLink(n)?(t||(s=e.push("link_open","a",1),s.attrs=[["href",n]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):!1},JUi=jxe.HTML_TAG_RE;function KUi(i){var e=i|32;return e>=97&&e<=122}var ZUi=function(e,t){var r,n,s,o,a=e.pos;return!e.md.options.html||(s=e.posMax,e.src.charCodeAt(a)!==60||a+2>=s)||(r=e.src.charCodeAt(a+1),r!==33&&r!==63&&r!==47&&!KUi(r))||(n=e.src.slice(a).match(JUi),!n)?!1:(t||(o=e.push("html_inline","",0),o.content=e.src.slice(a,a+n[0].length)),e.pos+=n[0].length,!0)},Eit=dTt,QUi=Pc.has,ezi=Pc.isValidEntityCode,Iit=Pc.fromCodePoint,tzi=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,izi=/^&([a-z][a-z0-9]{1,31});/i,rzi=function(e,t){var r,n,s,o=e.pos,a=e.posMax;if(e.src.charCodeAt(o)!==38)return!1;if(o+1o;r-=v[r]+1)if(s=e[r],s.marker===n.marker&&s.open&&s.end<0&&(l=!1,(s.close||n.open)&&(s.length+n.length)%3===0&&(s.length%3!==0||n.length%3!==0)&&(l=!0),!l)){u=r>0&&!e[r-1].open?v[r-1]+1:0,v[t]=t-r+u,v[r]=u,n.open=!1,s.end=t,s.close=!1,a=-1,m=-2;break}a!==-1&&(c[n.marker][(n.open?3:0)+(n.length||0)%3]=a)}}}var nzi=function(e){var t,r=e.tokens_meta,n=e.tokens_meta.length;for(Ait(e,e.delimiters),t=0;t0&&n++,s[t].type==="text"&&t+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(n),r};qoe.prototype.scanDelims=function(i,e){var t=i,r,n,s,o,a,l,u,c,h,p=!0,m=!0,v=this.posMax,w=this.src.charCodeAt(i);for(r=i>0?this.src.charCodeAt(i-1):32;t=s)break;continue}i.pending+=i.src[i.pos++]}i.pending&&i.pushPending()};Yoe.prototype.parse=function(i,e,t,r){var n,s,o,a=new this.State(i,e,t,r);for(this.tokenize(a),s=this.ruler2.getRules(""),o=s.length,n=0;n|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),BAe}function O4e(i){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){t&&Object.keys(t).forEach(function(r){i[r]=t[r]})}),i}function Hxe(i){return Object.prototype.toString.call(i)}function uzi(i){return Hxe(i)==="[object String]"}function czi(i){return Hxe(i)==="[object Object]"}function hzi(i){return Hxe(i)==="[object RegExp]"}function Fit(i){return Hxe(i)==="[object Function]"}function dzi(i){return i.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var xTt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function pzi(i){return Object.keys(i||{}).reduce(function(e,t){return e||xTt.hasOwnProperty(t)},!1)}var fzi={"http:":{validate:function(i,e,t){var r=i.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(i,e,t){var r=i.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&i[e-3]===":"||e>=3&&i[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(i,e,t){var r=i.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},mzi="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",gzi="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function yzi(i){i.__index__=-1,i.__text_cache__=""}function vzi(i){return function(e,t){var r=e.slice(t);return i.test(r)?r.match(i)[0].length:0}}function kit(){return function(i,e){e.normalize(i)}}function hve(i){var e=i.re=lzi()(i.__opts__),t=i.__tlds__.slice();i.onCompile(),i.__tlds_replaced__||t.push(mzi),t.push(e.src_xn),e.src_tlds=t.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];i.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(i.__schemas__).forEach(function(a){var l=i.__schemas__[a];if(l!==null){var u={validate:null,link:null};if(i.__compiled__[a]=u,czi(l)){hzi(l.validate)?u.validate=vzi(l.validate):Fit(l.validate)?u.validate=l.validate:s(a,l),Fit(l.normalize)?u.normalize=l.normalize:l.normalize?s(a,l):u.normalize=kit();return}if(uzi(l)){n.push(a);return}s(a,l)}}),n.forEach(function(a){i.__compiled__[i.__schemas__[a]]&&(i.__compiled__[a].validate=i.__compiled__[i.__schemas__[a]].validate,i.__compiled__[a].normalize=i.__compiled__[i.__schemas__[a]].normalize)}),i.__compiled__[""]={validate:null,normalize:kit()};var o=Object.keys(i.__compiled__).filter(function(a){return a.length>0&&i.__compiled__[a]}).map(dzi).join("|");i.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),i.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),i.re.pretest=RegExp("("+i.re.schema_test.source+")|("+i.re.host_fuzzy_test.source+")|@","i"),yzi(i)}function _zi(i,e){var t=i.__index__,r=i.__last_index__,n=i.__text_cache__.slice(t,r);this.schema=i.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Lit(i,e){var t=new _zi(i,e);return i.__compiled__[t.schema].normalize(t,i),t}function MS(i,e){if(!(this instanceof MS))return new MS(i,e);e||pzi(i)&&(e=i,i={}),this.__opts__=O4e({},xTt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=O4e({},fzi,i),this.__compiled__={},this.__tlds__=gzi,this.__tlds_replaced__=!1,this.re={},hve(this)}MS.prototype.add=function(e,t){return this.__schemas__[e]=t,hve(this),this};MS.prototype.set=function(e){return this.__opts__=O4e(this.__opts__,e),this};MS.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,r,n,s,o,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(t=l.exec(e))!==null;)if(s=this.testSchemaAt(e,t[2],l.lastIndex),s){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(n=e.match(this.re.email_fuzzy))!==null&&(o=n.index+n[1].length,a=n.index+n[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};MS.prototype.pretest=function(e){return this.re.pretest.test(e)};MS.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};MS.prototype.match=function(e){var t=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Lit(this,t)),t=this.__last_index__);for(var n=t?e.slice(t):e;this.test(n);)r.push(Lit(this,t)),n=n.slice(this.__last_index__),t+=this.__last_index__;return r.length?r:null};MS.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,s){return r!==s[n-1]}).reverse(),hve(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,hve(this),this)};MS.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};MS.prototype.onCompile=function(){};var bzi=MS;const MV=2147483647,CA=36,MUe=1,mne=26,wzi=38,xzi=700,STt=72,TTt=128,CTt="-",Szi=/^xn--/,Tzi=/[^\0-\x7F]/,Czi=/[\x2E\u3002\uFF0E\uFF61]/g,Ezi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},jAe=CA-MUe,EA=Math.floor,GAe=String.fromCharCode;function u5(i){throw new RangeError(Ezi[i])}function Izi(i,e){const t=[];let r=i.length;for(;r--;)t[r]=e(i[r]);return t}function ETt(i,e){const t=i.split("@");let r="";t.length>1&&(r=t[0]+"@",i=t[1]),i=i.replace(Czi,".");const n=i.split("."),s=Izi(n,e).join(".");return r+s}function OUe(i){const e=[];let t=0;const r=i.length;for(;t=55296&&n<=56319&&tString.fromCodePoint(...i),Azi=function(i){return i>=48&&i<58?26+(i-48):i>=65&&i<91?i-65:i>=97&&i<123?i-97:CA},Nit=function(i,e){return i+22+75*(i<26)-((e!=0)<<5)},ATt=function(i,e,t){let r=0;for(i=t?EA(i/xzi):i>>1,i+=EA(i/e);i>jAe*mne>>1;r+=CA)i=EA(i/jAe);return EA(r+(jAe+1)*i/(i+wzi))},PUe=function(i){const e=[],t=i.length;let r=0,n=TTt,s=STt,o=i.lastIndexOf(CTt);o<0&&(o=0);for(let a=0;a=128&&u5("not-basic"),e.push(i.charCodeAt(a));for(let a=o>0?o+1:0;a=t&&u5("invalid-input");const p=Azi(i.charCodeAt(a++));p>=CA&&u5("invalid-input"),p>EA((MV-r)/c)&&u5("overflow"),r+=p*c;const m=h<=s?MUe:h>=s+mne?mne:h-s;if(pEA(MV/v)&&u5("overflow"),c*=v}const u=e.length+1;s=ATt(r-l,u,l==0),EA(r/u)>MV-n&&u5("overflow"),n+=EA(r/u),r%=u,e.splice(r++,0,n)}return String.fromCodePoint(...e)},RUe=function(i){const e=[];i=OUe(i);const t=i.length;let r=TTt,n=0,s=STt;for(const l of i)l<128&&e.push(GAe(l));const o=e.length;let a=o;for(o&&e.push(CTt);a=r&&cEA((MV-n)/u)&&u5("overflow"),n+=(l-r)*u,r=l;for(const c of i)if(cMV&&u5("overflow"),c===r){let h=n;for(let p=CA;;p+=CA){const m=p<=s?MUe:p>=s+mne?mne:p-s;if(h=0))try{e.hostname=PTt.toASCII(e.hostname)}catch{}return t8.encode(t8.format(e))}function Wzi(i){var e=t8.parse(i,!0);if(e.hostname&&(!e.protocol||RTt.indexOf(e.protocol)>=0))try{e.hostname=PTt.toUnicode(e.hostname)}catch{}return t8.decode(t8.format(e),t8.decode.defaultChars+"%")}function OS(i,e){if(!(this instanceof OS))return new OS(i,e);e||hie.isString(i)||(e=i||{},i="default"),this.inline=new Bzi,this.block=new $zi,this.core=new Nzi,this.renderer=new Lzi,this.linkify=new jzi,this.validateLink=Vzi,this.normalizeLink=Hzi,this.normalizeLinkText=Wzi,this.utils=hie,this.helpers=hie.assign({},kzi),this.options={},this.configure(i),e&&this.set(e)}OS.prototype.set=function(i){return hie.assign(this.options,i),this};OS.prototype.configure=function(i){var e=this,t;if(hie.isString(i)&&(t=i,i=Gzi[t],!i))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!i)throw new Error("Wrong `markdown-it` preset, can't be empty");return i.options&&e.set(i.options),i.components&&Object.keys(i.components).forEach(function(r){i.components[r].rules&&e[r].ruler.enableOnly(i.components[r].rules),i.components[r].rules2&&e[r].ruler2.enableOnly(i.components[r].rules2)}),this};OS.prototype.enable=function(i,e){var t=[];Array.isArray(i)||(i=[i]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(i,!0))},this),t=t.concat(this.inline.ruler2.enable(i,!0));var r=i.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};OS.prototype.disable=function(i,e){var t=[];Array.isArray(i)||(i=[i]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(i,!0))},this),t=t.concat(this.inline.ruler2.disable(i,!0));var r=i.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};OS.prototype.use=function(i){var e=[this].concat(Array.prototype.slice.call(arguments,1));return i.apply(i,e),this};OS.prototype.parse=function(i,e){if(typeof i!="string")throw new Error("Input data should be a String");var t=new this.core.State(i,this,e);return this.core.process(t),t.tokens};OS.prototype.render=function(i,e){return e=e||{},this.renderer.render(this.parse(i,e),this.options,e)};OS.prototype.parseInline=function(i,e){var t=new this.core.State(i,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};OS.prototype.renderInline=function(i,e){return e=e||{},this.renderer.render(this.parseInline(i,e),this.options,e)};var qzi=OS,Yzi=qzi;const GB=jB(Yzi);function Xzi(i,e=document){return typeof i=="string"?Array.from(e.querySelectorAll(i)):i instanceof Element?[i]:i instanceof NodeList?Array.from(i):i instanceof Array?i:[]}function Jzi(i){const e=document.createElement("div");e.className=`scrollama__debug-step ${i}`,e.style.position="fixed",e.style.left="0",e.style.width="100%",e.style.zIndex="9999",e.style.borderTop="2px solid black",e.style.borderBottom="2px solid black";const t=document.createElement("p");return t.style.position="absolute",t.style.left="0",t.style.height="1px",t.style.width="100%",t.style.borderTop="1px dashed black",e.appendChild(t),document.body.appendChild(e),e}function Kzi({id:i,step:e,marginTop:t}){const{index:r,height:n}=e,s=`scrollama__debug-step--${i}-${r}`;let o=document.querySelector(`.${s}`);o||(o=Jzi(s)),o.style.top=`${t*-1}px`,o.style.height=`${n}px`,o.querySelector("p").style.top=`${n/2}px`}function Zzi(){const i="abcdefghijklmnopqrstuvwxyz",e=Date.now(),t=[];for(let r=0;r<6;r+=1){const n=i[Math.floor(Math.random()*i.length)];t.push(n)}return`${t.join("")}${e}`}function Ece(i){console.error(`scrollama error: ${i}`)}function vJ(i){return+i.getAttribute("data-scrollama-index")}function Qzi(i,e){const t=Math.ceil(i/e),r=[],n=1/t;for(let s=0;s0){const e=+i.replace("px","");return isNaN(e)?(err("offset value must be in 'px' format. Fallback to 0.5."),{format:"percent",value:.5}):{format:"pixels",value:e}}else if(typeof i=="number"||!isNaN(+i))return i>1&&err("offset value is greater than 1. Fallback to 1."),i<0&&err("offset value is lower than 0. Fallback to 0."),{format:"percent",value:Math.min(Math.max(0,i),1)};return null}function eVi(i){i.forEach(e=>e.node.setAttribute("data-scrollama-index",e.index))}function tVi(i){const{top:e}=i.getBoundingClientRect(),t=window.pageYOffset,r=document.body.clientTop||0;return e+t-r}let TG,Gfe,BO;function DTt(i){const e=i?i.scrollTop:window.pageYOffset;TG!==e&&(TG=e,TG>Gfe?BO="down":TGDTt(i))}function $it(){let i={},e=Zzi(),t=[],r,n,s,o=0,a=!1,l=!1,u=!1,c=!1,h=[];function p(){i={stepEnter:()=>{},stepExit:()=>{},stepProgress:()=>{}},h=[]}function m(pe){pe&&!a&&ne(),!pe&&a&&B(),a=pe}function v(pe,H){const Z=vJ(pe),ae=t[Z];H!==void 0&&(ae.progress=H);const fe={element:pe,index:Z,progress:H,direction:BO};ae.state==="enter"&&i.stepProgress(fe)}function w(pe,H=!0){const Z=vJ(pe),ae=t[Z],fe={element:pe,index:Z,direction:BO};ae.direction=BO,ae.state="enter",h[Z]||i.stepEnter(fe),c&&(h[Z]=!0)}function S(pe,H=!0){const Z=vJ(pe),ae=t[Z];if(!ae.state)return!1;const fe={element:pe,index:Z,direction:BO};l&&(BO==="down"&&ae.progress<1?v(pe,1):BO==="up"&&ae.progress>0&&v(pe,0)),ae.direction=BO,ae.state="exit",i.stepExit(fe)}function I([pe]){const H=vJ(pe.target),Z=t[H],ae=pe.target.offsetHeight;ae!==Z.height&&(Z.height=ae,k(Z),Y(Z),$(Z))}function R([pe]){DTt(n);const{isIntersecting:H,target:Z}=pe;H?w(Z):S(Z)}function L([pe]){const H=vJ(pe.target),Z=t[H],{isIntersecting:ae,intersectionRatio:fe,target:be}=pe;ae&&Z.state==="enter"&&v(be,fe)}function k({observers:pe}){Object.keys(pe).map(H=>{pe[H].disconnect()})}function B(){t.forEach(k)}function $(pe){const H=new ResizeObserver(I);H.observe(pe.node),pe.observers.resize=H}function V(){t.forEach($)}function Y(pe){const H=window.innerHeight,Z=pe.offset||r,ae=Z.format==="pixels"?1:H,fe=Z.value*ae,be=pe.height/2-fe,_e=pe.height/2-(H-fe),Ve={rootMargin:`${be}px 0px ${_e}px 0px`,threshold:.5,root:s},$e=new IntersectionObserver(R,Ve);$e.observe(pe.node),pe.observers.step=$e,u&&Kzi({id:e,step:pe,marginTop:be,marginBottom:_e})}function K(){t.forEach(Y)}function Q(pe){const H=window.innerHeight,Z=pe.offset||r,ae=Z.format==="pixels"?1:H,fe=Z.value*ae,be=-fe+pe.height,_e=fe-H,Ie=`${be}px 0px ${_e}px 0px`,Te=Qzi(pe.height,o),Be={rootMargin:Ie,threshold:Te},Ve=new IntersectionObserver(L,Be);Ve.observe(pe.node),pe.observers.progress=Ve}function re(){t.forEach(Q)}function ne(){B(),V(),K(),l&&re()}const de={};return de.setup=({step:pe,parent:H,offset:Z=.5,threshold:ae=4,progress:fe=!1,once:be=!1,debug:_e=!1,container:Ie=void 0,root:Te=null})=>(iVi(Ie),t=Xzi(pe,H).map((Be,Ve)=>({index:Ve,direction:void 0,height:Be.offsetHeight,node:Be,observers:{},offset:UAe(Be.dataset.offset),top:tVi(Be),progress:0,state:void 0})),t.length?(l=fe,c=be,u=_e,o=Math.max(1,+ae),r=UAe(Z),n=Ie,s=Te,p(),eVi(t),m(!0),de):(Ece("no step elements"),de)),de.enable=()=>(m(!0),de),de.disable=()=>(m(!1),de),de.destroy=()=>(m(!1),p(),de),de.resize=()=>(ne(),de),de.offset=pe=>pe==null?r.value:(r=UAe(pe),ne(),de),de.onStepEnter=pe=>(typeof pe=="function"?i.stepEnter=pe:Ece("onStepEnter requires a function"),de),de.onStepExit=pe=>(typeof pe=="function"?i.stepExit=pe:Ece("onStepExit requires a function"),de),de.onStepProgress=pe=>(typeof pe=="function"?i.stepProgress=pe:Ece("onStepProgress requires a function"),de),de}const Wxe=da({__name:"scrollama",emits:["step-progress","step-enter","step-exit"],setup(i,{emit:e}){const t=e;let r=Cn();const n=Cn(),s=new Proxy({},{get:(l,u)=>r.value.getAttribute(u),has:(l,u)=>r.value.hasAttribute(u)});Tg(()=>{n.value=$it(),o()}),hci(()=>{n.value&&n.value.destroy(),window.removeEventListener("resize",a)}),dci(()=>{o()});function o(){if(n.value&&n.value.destroy(),r.value){const l={step:Array.from(r.value.children),progress:"step-progress"in s,...s};n.value=$it().setup(l).onStepProgress(u=>{t("step-progress",u)}).onStepEnter(u=>{t("step-enter",u)}).onStepExit(u=>{t("step-exit",u)}),window.addEventListener("resize",a)}}function a(){n.value&&n.value.resize()}return(l,u)=>(pr(),wr("div",{class:"scrollama__steps",ref_key:"rootElement",ref:r},[bUe(l.$slots,"default")],512))}}),rVi=["innerHTML"],nVi=da({__name:"text-panel",props:{config:{type:Object,required:!0},background:{type:Boolean}},setup(i){const e=i,t=new GB({html:!0}),r=Cn("");return Tg(()=>{r.value=t.render(e.config.content).replace(//g,"
"),document.querySelectorAll(".storyramp-app a:not([target])").forEach(n=>n.target="_blank")}),(n,s)=>(pr(),Vv(Wxe,{class:Jl(["text-panel prose max-w-none mb-5 mx-1 py-5",{"has-background":i.background}]),style:ja({color:i.config.textColour??"#000"})},{default:Wp(()=>[(pr(),Vv(wUe(i.config.titleTag||"h2"),{class:"px-10 mb-0 chapter-title top-20"},{default:Wp(()=>[U8(Zh(i.config.title),1)]),_:1})),Tr("div",{class:"px-10 md-content object-contain",innerHTML:r.value},null,8,rVi)]),_:1},8,["class","style"]))}}),sVi=Ux(nVi,[["__scopeId","data-v-044ceba3"]]);var j1=(i=>(i.BLOB="blob",i.DATE="date",i.DOUBLE="double",i.GEOMETRY="geometry",i.GLOBAL_ID="global-id",i.GUID="guid",i.INTEGER="integer",i.LONG="long",i.OID="oid",i.RASTER="raster",i.SINGLE="single",i.SMALL_INTEGER="small-integer",i.STRING="string",i.XML="xml",i))(j1||{}),zI=(i=>(i.CIRCLE="circle",i.CROSS="cross",i.DIAMOND="diamond",i.ICON="icon",i.PATH="path",i.SQUARE="square",i.TRIANGLE="triangle",i.X="x",i))(zI||{}),K_=(i=>(i.DASH="dash",i.DASHDOT="dash-dot",i.DASHDOTDOT="short-dash-dot-dot",i.DOT="dot",i.LONGDASH="long-dash",i.LONGDASHDOT="long-dash-dot",i.LONGDASHDOTDOT="long-dash-dot-dot",i.NONE="none",i.NULL="none",i.SHORTDASH="short-dash",i.SHORTDASHDOT="short-dash-dot",i.SHORTDASHDOTDOT="short-dash-dot-dot",i.SHORTDOT="short-dot",i.SOLID="solid",i))(K_||{}),FTt=(i=>(i.BEVEL="bevel",i.MITER="miter",i.ROUND="round",i))(FTt||{}),kTt=(i=>(i.ROUND="round",i.BUTT="butt",i.SQUARE="square",i))(kTt||{}),LTt=(i=>(i.BDIAG="backward-diagonal",i.CROSS="cross",i.DIAG_CROSS="diagonal-cross",i.FDIAG="forward-diagonal",i.HORIZONTAL="horizontal",i.NONE="none",i.NULL="none",i.SOLID="solid",i.VERTICAL="vertical",i))(LTt||{}),cl=(i=>(i.POINT="Point",i.MULTIPOINT="MultiPoint",i.LINESTRING="LineString",i.MULTILINESTRING="MultiLineString",i.POLYGON="Polygon",i.MULTIPOLYGON="MultiPolygon",i.LINEARRING="LinearRing",i.EXTENT="Extent",i.NONE="None",i.UNKNOWN="Unknown",i))(cl||{}),qxe=(i=>(i.Simple="simple",i.Unique="uniqueValue",i.ClassBreaks="classBreaks",i.Unknown="unknown",i))(qxe||{}),pn=(i=>(i.FEATURE="esri-feature",i.MAPIMAGE="esri-map-image",i.TILE="esri-tile",i.IMAGERY="esri-imagery",i.GRAPHIC="esri-graphic",i.WMS="ogc-wms",i.WFS="ogc-wfs",i.GEOJSON="file-geojson",i.CSV="file-csv",i.SHAPEFILE="file-shape",i.OSM="osm-tile",i.DATACSV="data-csv",i.DATAJSON="data-json",i.DATATABLE="data-esri-table",i.UNKNOWN="unknown",i.SUBLAYER="sublayer",i))(pn||{}),zx=(i=>(i.FEATURE="feature",i.GRAPHIC="graphic",i.IMAGERY="imagery",i.MAPIMAGE="map-image",i.NOLAYER="no-layer",i.OSM="osm-tile",i.TILE="tile",i.UNKNOWN="unknown",i.WMS="wms",i))(zx||{}),l0=(i=>(i.ESRI_FEATURE="esriFeature",i.ESRI_RASTER="esriRaster",i.ESRI_TILE="esriTile",i.OSM_TILE="osmTile",i.OGC_RASTER="ogcRaster",i.UNKNOWN="unknown",i))(l0||{}),jp=(i=>(i.POINT="Point",i.MULTIPOINT="MultiPoint",i.LINESTRING="LineString",i.MULTILINESTRING="MultiLineString",i.POLYGON="Polygon",i.MULTIPOLYGON="MultiPolygon",i))(jp||{}),sg=(i=>(i.GEOMETRIC="geometric",i.SYMBOLIC="symbolic",i.HYBRID="hybrid",i.NONE="none",i))(sg||{}),ey=(i=>(i.NEW="new",i.INITIATING="initiating",i.INITIATED="initiated",i.TERMINATING="terminating",i.TERMINATED="terminated",i))(ey||{}),Ud=(i=>(i.NEW="new",i.LOADING="loading",i.LOADED="loaded",i.ERROR="error",i))(Ud||{}),fb=(i=>(i.NOT_LOADED="not-loaded",i.NOT_VISUAL="not-visual",i.REFRESH="refresh",i.UP_TO_DATE="up-to-date",i))(fb||{}),z8=(i=>(i.ESRI="esri",i.TEXT="text",i.IMAGE="image",i.HTML="html",i.XML="xml",i.JSON="json",i.UNKNOWN="unknown",i))(z8||{}),pm=(i=>(i.SYMBOL="symbol",i.GRID="grid",i.EXTENT="extent",i.INITIAL="initial",i.API="api",i.PERMANENT="permanent",i))(pm||{}),ya=(i=>(i.BoundaryZoom="boundaryZoom",i.Datatable="datatable",i.Identify="identify",i.Metadata="metadata",i.Opacity="opacity",i.Refresh="refresh",i.Reload="reload",i.Remove="remove",i.Settings="settings",i.Symbology="symbology",i.Visibility="visibility",i))(ya||{});class Ax{attributes;geometry;style;id;constructor(e,t,r){this.geometry=e,t?this.id=t:this.id=sH.sharedUtils.generateUUID(),r?this.attributes=r:this.attributes={}}_hover;get hover(){return this._hover}set hover(e){e&&this._hover&&this._hover.id!==e.id&&this.removeHover(),this._hover=e}removeHover(){this._hover&&(this._hover=void 0)}}function x(i,e,t,r){var n,s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function _u(i,e){return function(t,r){e(t,r,i)}}function Tm(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(h){o(h)}}function l(c){try{u(r.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((r=r.apply(i,[])).next())})}let J5;function yi(i){return typeof J5[i]=="function"?J5[i]=J5[i](globalThis):J5[i]}J5=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},yi.add=(i,e,t,r)=>((r||J5[i]===void 0)&&(J5[i]=e),t&&yi(i)),yi.cache=J5,yi.add("big-integer-warning-enabled",!0),yi.add("esri-deprecation-warnings",!0),yi.add("esri-tests-disable-screenshots",!1),yi.add("esri-tests-use-full-window",!1),yi.add("esri-tests-post-to-influx",!0),(()=>{yi.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const i=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(yi.add("host-browser",i),yi.add("host-node",typeof globalThis.process=="object"&&globalThis.process.versions?.node&&globalThis.process.versions.v8),yi.add("dom",i),yi("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(yi.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),yi.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),yi.add("khtml",r.includes("Konqueror")?n:void 0),yi.add("edge",parseFloat(t.split("Edge/")[1])||void 0),yi.add("opr",parseFloat(t.split("OPR/")[1])||void 0),yi.add("webkit",!yi("wp")&&!yi("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),yi.add("chrome",!yi("edge")&&!yi("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),yi.add("android",!yi("wp")&&parseFloat(t.split("Android ")[1])||void 0),yi.add("safari",!r.includes("Safari")||yi("wp")||yi("chrome")||yi("android")||yi("edge")||yi("opr")?void 0:parseFloat(r.split("Version/")[1])),yi.add("mac",r.includes("Macintosh")),!yi("wp")&&/(iPhone|iPod|iPad)/.test(t)){const s=RegExp.$1.replace(/P/,"p"),o=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",a=parseFloat(o.replace(/_/,".").replaceAll("_",""));yi.add(s,a),yi.add("ios",a)}yi("webkit")||(!t.includes("Gecko")||yi("wp")||yi("khtml")||yi("edge")||yi.add("mozilla",n),yi("mozilla")&&yi.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const i=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(i),t=/iPhone/i.test(i);e&&yi.add("esri-mobile",e),t&&yi.add("esri-iPhone",t),yi.add("esri-geolocation",!!navigator.geolocation)}yi.add("esri-wasm","WebAssembly"in globalThis),yi.add("esri-performance-mode-frames-between-render",20),yi.add("esri-force-performance-mode",!1),yi.add("esri-shared-array-buffer",()=>{const i="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return i&&!e}),yi.add("wasm-simd",()=>{const i=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(i))}),yi.add("esri-atomics","Atomics"in globalThis),yi.add("esri-workers","Worker"in globalThis),yi.add("web-feat:cache","caches"in globalThis),yi.add("esri-workers-arraybuffer-transfer",!yi("safari")||Number(yi("safari"))>=12),yi.add("workers-pool-size",8),yi.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),yi.add("featurelayer-simplify-payload-size-factors",[1,1,4]),yi.add("featurelayer-fast-triangulation-enabled",!0),yi.add("featurelayer-animation-enabled",!0),yi.add("featurelayer-snapshot-enabled",!0),yi.add("featurelayer-snapshot-point-min-threshold",8e4),yi.add("featurelayer-snapshot-point-max-threshold",4e5),yi.add("featurelayer-snapshot-point-coverage",.1),yi.add("featurelayer-query-max-depth",4),yi.add("featurelayer-query-pausing-enabled",!1),yi.add("hittest-2d-mobile-tolerance",3),yi.add("hittest-2d-desktop-tolerance",1),yi.add("hittest-2d-small-symbol-tolerance",3),yi.add("hittest-2d-small-symbol-tolerance-threshold",3),yi.add("featurelayer-advanced-symbols",!1),yi.add("featurelayer-pbf",!0),yi.add("featurelayer-pbf-statistics",!1),yi.add("feature-layers-workers",!0),yi.add("feature-polyline-generalization-factor",1),yi.add("mapview-transitions-duration",200),yi.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),yi.add("mapserver-pbf-version-support",10.81),yi.add("mapservice-popup-identify-max-tolerance",20),yi("host-webworker")||yi("host-browser")&&(yi.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),yi.add("esri-image-decode",()=>{if("decode"in new Image){const i=new Image;return i.src='data:image/svg+xml;charset=UTF-8,',void i.decode().then(()=>{yi.add("esri-image-decode",!0,!0,!0)}).catch(()=>{yi.add("esri-image-decode",!1,!0,!0)})}return!1}),yi.add("esri-url-encodes-apostrophe",()=>{const i=window.document.createElement("a");return i.href="?'",i.href.includes("?%27")}))})();let VC=class wN{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*wN._m}getInt(){return this._seed=(wN._a*this._seed+wN._c)%wN._m,this._seed}getFloat(){return this.getInt()/(wN._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/wN._m*r}};VC._m=2147483647,VC._a=48271,VC._c=0;function zAe(i,e){for(let t=i.length-1;t>=0;t--){const r=i[t];if(e(r))return r}}function DUe(i,e){return e?i.filter((t,r,n)=>n.findIndex(e.bind(null,t))===r):Array.from(new Set(i))}function UB(i,e,t){if(i==null&&e==null)return!0;if(i==null||e==null||i.length!==e.length)return!1;if(t){for(let r=0;r!i.some(o=>t(o,s))),n=i.filter(s=>!e.some(o=>t(o,s)))):(r=e.filter(s=>!i.includes(s)),n=i.filter(s=>!e.includes(s))),{added:r,removed:n}}function NTt(i){return i&&typeof i.length=="number"}const aVi=!!Array.prototype.fill;function lVi(i,e){if(aVi)return new Array(i).fill(e);const t=new Array(i);for(let r=0;re+(t?U9(t)?R4e(t,kUe()):t.byteLength+VTt:0),0)}const VTt=145,a3=1024;function fVi(i){return Qxe(i)||Zxe(i)||Kxe(i)||Xxe(i)||LUe(i)}function mVi(i){return Qxe(i)||Zxe(i)}function gVi(i){return Qxe(i)?179769e303:Zxe(i)?3402823e32:$Ue(i)?4294967295:Jxe(i)?65535:K5(i)||NUe(i)?255:Kxe(i)?2147483647:Xxe(i)?32767:LUe(i)?127:256}function BUe(i,e){let t;for(t in i)i.hasOwnProperty(t)&&i[t]===void 0&&delete i[t];return i}function li(i){if(!i||typeof i!="object"||typeof i=="function")return i;const e=qTt(i);if(e!=null)return e;if(dve(i))return i.clone();if(HTt(i))return i.map(li);if(WTt(i))return i.clone();const t={};for(const r of Object.getOwnPropertyNames(i))t[r]=li(i[r]);return t}function F4e(i){if(!i||typeof i!="object"||typeof i=="function"||"HTMLElement"in globalThis&&i instanceof HTMLElement)return i;const e=qTt(i);if(e!=null)return e;if(HTt(i)){let t=!0;const r=i.map(n=>{const s=F4e(n);return n!=null&&s==null&&(t=!1),s});return t?r:null}if(dve(i))return i.clone();if(i instanceof File||i instanceof Blob)return i;if(!WTt(i)){const t=new(Object.getPrototypeOf(i)).constructor;for(const r of Object.getOwnPropertyNames(i)){const n=i[r],s=F4e(n);if(n!=null&&s==null)return null;t[r]=s}return t}return null}function dve(i){return typeof i.clone=="function"}function HTt(i){return typeof i.map=="function"&&typeof i.forEach=="function"}function WTt(i){return typeof i.notifyChange=="function"&&typeof i.watch=="function"}function Bit(i){if(Object.prototype.toString.call(i)!=="[object Object]")return!1;const e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}function qTt(i){if(LUe(i)||K5(i)||NUe(i)||Xxe(i)||Jxe(i)||Kxe(i)||$Ue(i)||Zxe(i)||Qxe(i))return i.slice();if(i instanceof Date)return new Date(i.getTime());if(i instanceof ArrayBuffer)return i.slice(0,i.byteLength);if(i instanceof Map){const e=new Map;for(const[t,r]of i)e.set(t,li(r));return e}if(i instanceof Set){const e=new Set;for(const t of i)e.add(li(t));return e}return null}function jUe(i,e){return i===e||typeof i=="number"&&isNaN(i)&&typeof e=="number"&&isNaN(e)||typeof i?.getTime=="function"&&typeof e?.getTime=="function"&&i.getTime()===e.getTime()||!1}function YTt(i,e){return i===e||(i==null||typeof i=="string"?i===e:typeof i=="number"?i===e||typeof e=="number"&&isNaN(i)&&isNaN(e):i instanceof Date?e instanceof Date&&i.getTime()===e.getTime():Array.isArray(i)?Array.isArray(e)&&UB(i,e):i instanceof Set?e instanceof Set&&vVi(i,e):i instanceof Map?e instanceof Map&&_Vi(i,e):!!Bit(i)&&Bit(e)&&yVi(i,e))}function yVi(i,e){if(i===null||e===null)return!1;const t=Object.keys(i);if(e===null||Object.keys(e).length!==t.length)return!1;for(const r of t)if(i[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function vVi(i,e){if(i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0}function _Vi(i,e){if(i.size!==e.size)return!1;for(const[t,r]of i){const n=e.get(t);if(n!==r||n===void 0&&!e.has(t))return!1}return!0}function GUe(i,e,t=!1){return JTt(i,e,t)}function uS(i,e){if(e!=null)return e[i]||XTt(i.split("."),!1,e)}function Qp(i,e,t){const r=i.split("."),n=r.pop(),s=XTt(r,!0,t);s&&n&&(s[n]=e)}function XTt(i,e,t){let r=t;for(const n of i){if(r==null)return;if(!(n in r)){if(!e)return;r[n]={}}r=r[n]}return r}function JTt(i,e,t){return e?Object.keys(e).reduce((r,n)=>{let s=r[n],o=e[n];return s===o?r:s===void 0?(r[n]=li(o),r):(Array.isArray(o)||Array.isArray(r)?(s=s?Array.isArray(s)?r[n]=s.concat():r[n]=[s]:r[n]=[],o&&(Array.isArray(o)||(o=[o]),t?o.forEach(a=>{s.includes(a)||s.push(a)}):r[n]=o.concat())):o&&typeof o=="object"?r[n]=JTt(s,o,t):r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=o),r)},i||{}):i}const Ho={apiKey:void 0,applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(GUe(Ho,globalThis.esriConfig,!0),delete Ho.has),!Ho.assetsPath){{const i="4.29";Ho.assetsPath=`https://js.arcgis.com/${i}/@arcgis/core/assets`}Ho.defaultAssetsPath=Ho.assetsPath}const bVi=/\{([^\}]+)\}/g;function jit(i){return i??""}function m0(i,e){return e?i.replaceAll(bVi,typeof e=="object"?(t,r)=>jit(uS(r,e)):(t,r)=>jit(e(r))):i}function UUe(i,e){return i.replaceAll(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,t=>e&&e.includes(t)?t:`\\${t}`)}function Q1(i){let e=0;for(let t=0;te._loggedMessages.warn.clear()}}static get test(){return{resetLoggers(e=new Map){const t=z0._loggers;return z0._loggers=e,t},set throttlingDisabled(e){z0._throttlingDisabled=e}}}static getLogger(e){return e=typeof e!="string"?e.declaredClass:e,z0._loggers.get(e)||new z0({module:e})}_log(e,t,...r){if(this._matchLevel(e)){if(t!=="always"&&!z0._throttlingDisabled){const n=this._argsToKey(r),s=this._loggedMessages[e].get(n);if(t==="once"&&s!=null||t==="oncePerTick"&&s&&s>=z0._tickCounter)return;this._loggedMessages[e].set(n,z0._tickCounter),z0._scheduleTickCounterIncrement()}for(const n of Ho.log.interceptors)if(n(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;r!=null;){const n=r[e];if(n!=null)return n;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=Ho.log.level||"warn";return Uit[this._parentWithMember("level",t)]<=Uit[e]}_argsToKey(...e){return Q1(JSON.stringify(e,(r,n)=>typeof n!="object"||Array.isArray(n)?n:"[Object]"))}static _scheduleTickCounterIncrement(){z0._tickCounterScheduled||(z0._tickCounterScheduled=!0,Promise.resolve().then(()=>{z0._tickCounter++,z0._tickCounterScheduled=!1}))}};di._loggers=new Map,di._tickCounter=0,di._tickCounterScheduled=!1,di._throttlingDisabled=!1;function xVi(i,e){return i.replaceAll(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(t,r)=>r===""?"$":(uS(r,e)??"").toString())}let KTt=class{constructor(e,t,r){this.name=e,this.details=r,this.message=(t&&xVi(t,r))??""}toString(){return"["+this.name+"]: "+this.message}},qe=class ZTt extends KTt{constructor(e,t,r){super(e,t,r)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,t)=>{if(t&&typeof t=="object"&&typeof t.toJSON=="function")return t;try{return li(t)}catch{return"[object]"}}))}}catch(e){throw di.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new ZTt(e.name,e.message,e.details)}};qe.prototype.type="error";const zit=new WeakMap;function SVi(i,e,t=!1){const r=`🛑 DEPRECATED - ${e}`;if(!t)return void i.warn(r);let n=zit.get(i);n||(n=new Set,zit.set(i,n)),n.has(e)||(n.add(e),i.warn(r))}function zUe(i,e,t={}){if(yi("esri-deprecation-warnings")){const{moduleName:r}=t;UF(i,`Function: ${(r?r+"::":"")+e+"()"}`,t)}}function ty(i,e,t={}){if(yi("esri-deprecation-warnings")){const{moduleName:r}=t;UF(i,`Property: ${(r?r+"::":"")+e}`,t)}}function UF(i,e,t={}){if(yi("esri-deprecation-warnings")){const{replacement:r,version:n,see:s,warnOnce:o}=t;let a=e;r&&(a+=` +`);return r};lY.prototype.render=function(i,e,t){var r,n,s,o="",a=this.rules;for(r=0,n=i.length;r\s]/i.test(i)}function BGi(i){return/^<\/a\s*>/i.test(i)}var jGi=function(e){var t,r,n,s,o,a,l,u,c,h,p,m,v,w,S,I,R=e.tokens,L;if(e.md.options.linkify){for(r=0,n=R.length;r=0;t--){if(a=s[t],a.type==="link_close"){for(t--;s[t].level!==a.level&&s[t].type!=="link_open";)t--;continue}if(a.type==="html_inline"&&($Gi(a.content)&&v>0&&v--,BGi(a.content)&&v++),!(v>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(c=a.content,L=e.md.linkify.match(c),l=[],m=a.level,p=0,u=0;up&&(o=new e.Token("text","",0),o.content=c.slice(p,h),o.level=m,l.push(o)),o=new e.Token("link_open","a",1),o.attrs=[["href",S]],o.level=m++,o.markup="linkify",o.info="auto",l.push(o),o=new e.Token("text","",0),o.content=I,o.level=m,l.push(o),o=new e.Token("link_close","a",-1),o.level=--m,o.markup="linkify",o.info="auto",l.push(o),p=L[u].lastIndex);p=0;e--)t=i[e],t.type==="text"&&!r&&(t.content=t.content.replace(UGi,VGi)),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}function WGi(i){var e,t,r=0;for(e=i.length-1;e>=0;e--)t=i[e],t.type==="text"&&!r&&gTt.test(t.content)&&(t.content=t.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),t.type==="link_open"&&t.info==="auto"&&r--,t.type==="link_close"&&t.info==="auto"&&r++}var qGi=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(GGi.test(e.tokens[t].content)&&HGi(e.tokens[t].children),gTt.test(e.tokens[t].content)&&WGi(e.tokens[t].children))},pit=Pc.isWhiteSpace,fit=Pc.isPunctChar,mit=Pc.isMdAsciiPunct,YGi=/['"]/,git=/['"]/g,yit="’";function Sce(i,e,t){return i.substr(0,e)+t+i.substr(e+1)}function XGi(i,e){var t,r,n,s,o,a,l,u,c,h,p,m,v,w,S,I,R,L,k,B,$;for(k=[],t=0;t=0&&!(k[R].level<=l);R--);if(k.length=R+1,r.type==="text"){n=r.content,o=0,a=n.length;e:for(;o=0)c=n.charCodeAt(s.index-1);else for(R=t-1;R>=0&&!(i[R].type==="softbreak"||i[R].type==="hardbreak");R--)if(i[R].content){c=i[R].content.charCodeAt(i[R].content.length-1);break}if(h=32,o=48&&c<=57&&(I=S=!1),S&&I&&(S=p,I=m),!S&&!I){L&&(r.content=Sce(r.content,s.index,yit));continue}if(I){for(R=k.length-1;R>=0&&(u=k[R],!(k[R].level=0;t--)e.tokens[t].type!=="inline"||!YGi.test(e.tokens[t].content)||XGi(e.tokens[t].children,e)};function uY(i,e,t){this.type=i,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}uY.prototype.attrIndex=function(e){var t,r,n;if(!this.attrs)return-1;for(t=this.attrs,r=0,n=t.length;r=0&&(r=this.attrs[t][1]),r};uY.prototype.attrJoin=function(e,t){var r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};var CUe=uY,KGi=CUe;function yTt(i,e,t){this.src=i,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}yTt.prototype.Token=KGi;var ZGi=yTt,QGi=TUe,RAe=[["normalize",FGi],["block",kGi],["inline",LGi],["linkify",jGi],["replacements",qGi],["smartquotes",JGi]];function EUe(){this.ruler=new QGi;for(var i=0;ir||(c=t+1,e.sCount[c]=4||(a=e.bMarks[c]+e.tShift[c],a>=e.eMarks[c])||(B=e.src.charCodeAt(a++),B!==124&&B!==45&&B!==58)||a>=e.eMarks[c]||($=e.src.charCodeAt(a++),$!==124&&$!==45&&$!==58&&!DAe($))||B===45&&DAe($))return!1;for(;a=4||(h=vit(o),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),p=h.length,p===0||p!==v.length))return!1;if(n)return!0;for(R=e.parentType,e.parentType="table",k=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),m.map=S=[t,0],m=e.push("thead_open","thead",1),m.map=[t,t+1],m=e.push("tr_open","tr",1),m.map=[t,t+1],l=0;l=4)break;for(h=vit(o),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),c===t+2&&(m=e.push("tbody_open","tbody",1),m.map=I=[t+2,0]),m=e.push("tr_open","tr",1),m.map=[c,c+1],l=0;l=4){n++,s=n;continue}break}return e.line=s,o=e.push("code_block","code",0),o.content=e.getLines(t,s,4+e.blkIndent,!1)+` +`,o.map=[t,e.line],!0},rUi=function(e,t,r,n){var s,o,a,l,u,c,h,p=!1,m=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||m+3>v||(s=e.src.charCodeAt(m),s!==126&&s!==96)||(u=m,m=e.skipChars(m,s),o=m-u,o<3)||(h=e.src.slice(u,m),a=e.src.slice(m,v),s===96&&a.indexOf(String.fromCharCode(s))>=0))return!1;if(n)return!0;for(l=t;l++,!(l>=r||(m=u=e.bMarks[l]+e.tShift[l],v=e.eMarks[l],m=4)&&(m=e.skipChars(m,s),!(m-u=4||e.src.charCodeAt(Q++)!==62)return!1;if(n)return!0;for(l=m=e.sCount[t]+1,e.src.charCodeAt(Q)===32?(Q++,l++,m++,s=!1,k=!0):e.src.charCodeAt(Q)===9?(k=!0,(e.bsCount[t]+m)%4===3?(Q++,l++,m++,s=!1):s=!0):k=!1,v=[e.bMarks[t]],e.bMarks[t]=Q;Q=re,R=[e.sCount[t]],e.sCount[t]=m-l,L=[e.tShift[t]],e.tShift[t]=Q-e.bMarks[t],$=e.md.block.ruler.getRules("blockquote"),I=e.parentType,e.parentType="blockquote",p=t+1;p=re));p++){if(e.src.charCodeAt(Q++)===62&&!Y){for(l=m=e.sCount[p]+1,e.src.charCodeAt(Q)===32?(Q++,l++,m++,s=!1,k=!0):e.src.charCodeAt(Q)===9?(k=!0,(e.bsCount[p]+m)%4===3?(Q++,l++,m++,s=!1):s=!0):k=!1,v.push(e.bMarks[p]),e.bMarks[p]=Q;Q=re,w.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(k?1:0),R.push(e.sCount[p]),e.sCount[p]=m-l,L.push(e.tShift[p]),e.tShift[p]=Q-e.bMarks[p];continue}if(c)break;for(B=!1,a=0,u=$.length;a",V.map=h=[t,0],e.md.block.tokenize(e,t,p),V=e.push("blockquote_close","blockquote",-1),V.markup=">",e.lineMax=K,e.parentType=I,h[1]=e.line,a=0;a=4||(s=e.src.charCodeAt(u++),s!==42&&s!==45&&s!==95))return!1;for(o=1;u=s||(t=i.src.charCodeAt(n++),t<48||t>57))return-1;for(;;){if(n>=s)return-1;if(t=i.src.charCodeAt(n++),t>=48&&t<=57){if(n-r>=10)return-1;continue}if(t===41||t===46)break;return-1}return n=4||e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(ae=!0),(re=wit(e,t))>=0){if(h=!0,de=e.bMarks[t]+e.tShift[t],I=Number(e.src.slice(de,re-1)),ae&&I!==1)return!1}else if((re=bit(e,t))>=0)h=!1;else return!1;if(ae&&e.skipSpaces(re)>=e.eMarks[t])return!1;if(S=e.src.charCodeAt(re-1),n)return!0;for(w=e.tokens.length,h?(Z=e.push("ordered_list_open","ol",1),I!==1&&(Z.attrs=[["start",I]])):Z=e.push("bullet_list_open","ul",1),Z.map=v=[t,0],Z.markup=String.fromCharCode(S),L=t,ne=!1,H=e.md.block.ruler.getRules("list"),$=e.parentType,e.parentType="list";L=R?u=1:u=k-c,u>4&&(u=1),l=c+u,Z=e.push("list_item_open","li",1),Z.markup=String.fromCharCode(S),Z.map=p=[t,0],h&&(Z.info=e.src.slice(de,re-1)),K=e.tight,Y=e.tShift[t],V=e.sCount[t],B=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=o-e.bMarks[t],e.sCount[t]=k,o>=R&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,t,r,!0),(!e.tight||ne)&&(fe=!1),ne=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=B,e.tShift[t]=Y,e.sCount[t]=V,e.tight=K,Z=e.push("list_item_close","li",-1),Z.markup=String.fromCharCode(S),L=t=e.line,p[1]=L,o=e.bMarks[t],L>=r||e.sCount[L]=4)break;for(pe=!1,a=0,m=H.length;a=4||e.src.charCodeAt($)!==91)return!1;for(;++$3)&&!(e.sCount[Y]<0)){for(R=!1,c=0,h=L.length;c"u"&&(e.env.references={}),typeof e.env.references[p]>"u"&&(e.env.references[p]={title:k,href:u}),e.parentType=v,e.line=t+B+1),!0)},hUi=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],jxe={},dUi="[a-zA-Z_:][a-zA-Z0-9:._-]*",pUi="[^\"'=<>`\\x00-\\x20]+",fUi="'[^']*'",mUi='"[^"]*"',gUi="(?:"+pUi+"|"+fUi+"|"+mUi+")",yUi="(?:\\s+"+dUi+"(?:\\s*=\\s*"+gUi+")?)",_Tt="<[A-Za-z][A-Za-z0-9\\-]*"+yUi+"*\\s*\\/?>",bTt="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",vUi="|",_Ui="<[?][\\s\\S]*?[?]>",bUi="]*>",wUi="",xUi=new RegExp("^(?:"+_Tt+"|"+bTt+"|"+vUi+"|"+_Ui+"|"+bUi+"|"+wUi+")"),SUi=new RegExp("^(?:"+_Tt+"|"+bTt+")");jxe.HTML_TAG_RE=xUi;jxe.HTML_OPEN_CLOSE_TAG_RE=SUi;var TUi=hUi,CUi=jxe.HTML_OPEN_CLOSE_TAG_RE,sj=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(CUi.source+"\\s*$"),/^$/,!1]],EUi=function(e,t,r,n){var s,o,a,l,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(u)!==60)return!1;for(l=e.src.slice(u,c),s=0;s=4||(s=e.src.charCodeAt(u),s!==35||u>=c))return!1;for(o=1,s=e.src.charCodeAt(++u);s===35&&u6||uu&&xit(e.src.charCodeAt(a-1))&&(c=a),e.line=t+1,l=e.push("heading_open","h"+String(o),1),l.markup="########".slice(0,o),l.map=[t,e.line],l=e.push("inline","",0),l.content=e.src.slice(u,c).trim(),l.map=[t,e.line],l.children=[],l=e.push("heading_close","h"+String(o),-1),l.markup="########".slice(0,o)),!0)},AUi=function(e,t,r){var n,s,o,a,l,u,c,h,p,m=t+1,v,w=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(v=e.parentType,e.parentType="paragraph";m3)){if(e.sCount[m]>=e.blkIndent&&(u=e.bMarks[m]+e.tShift[m],c=e.eMarks[m],u=c)))){h=p===61?1:2;break}if(!(e.sCount[m]<0)){for(s=!1,o=0,a=w.length;o3)&&!(e.sCount[u]<0)){for(n=!1,s=0,o=c.length;s0&&this.level++,this.tokens.push(r),r};B3.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};B3.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!Gxe(this.src.charCodeAt(--e)))return e+1;return e};B3.prototype.skipChars=function(e,t){for(var r=this.src.length;er;)if(t!==this.src.charCodeAt(--e))return e+1;return e};B3.prototype.getLines=function(e,t,r,n){var s,o,a,l,u,c,h,p=e;if(e>=t)return"";for(c=new Array(t-e),s=0;pr?c[s]=new Array(o-r+1).join(" ")+this.src.slice(l,u):c[s]=this.src.slice(l,u)}return c.join("")};B3.prototype.Token=wTt;var OUi=B3,PUi=TUe,Cce=[["table",tUi,["paragraph","reference"]],["code",iUi],["fence",rUi,["paragraph","reference","blockquote","list"]],["blockquote",nUi,["paragraph","reference","blockquote","list"]],["hr",oUi,["paragraph","reference","blockquote","list"]],["list",lUi,["paragraph","reference","blockquote"]],["reference",cUi],["html_block",EUi,["paragraph","reference","blockquote"]],["heading",IUi,["paragraph","reference","blockquote"]],["lheading",AUi],["paragraph",MUi]];function Uxe(){this.ruler=new PUi;for(var i=0;i=t||i.sCount[a]=u){i.line=t;break}for(n=0;n=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){for(s=r-1;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(o++;o?@[]^_`{|}~-".split("").forEach(function(i){IUe[i.charCodeAt(0)]=1});var $Ui=function(e,t){var r,n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==92)return!1;if(n++,n=0;t--)r=e[t],!(r.marker!==95&&r.marker!==42)&&r.end!==-1&&(n=e[r.end],a=t>0&&e[t-1].end===r.end+1&&e[t-1].marker===r.marker&&e[t-1].token===r.token-1&&e[r.end+1].token===n.token+1,o=String.fromCharCode(r.marker),s=i.tokens[r.token],s.type=a?"strong_open":"em_open",s.tag=a?"strong":"em",s.nesting=1,s.markup=a?o+o:o,s.content="",s=i.tokens[n.token],s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?o+o:o,s.content="",a&&(i.tokens[e[t-1].token].content="",i.tokens[e[r.end+1].token].content="",t--))}Vxe.postProcess=function(e){var t,r=e.tokens_meta,n=e.tokens_meta.length;for(Cit(e,e.delimiters),t=0;t=w)return!1;if(S=l,u=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),u.ok){for(p=e.md.normalizeLink(u.str),e.md.validateLink(p)?l=u.pos:p="",S=l;l=w||e.src.charCodeAt(l)!==41)&&(I=!0),l++}if(I){if(typeof e.env.references>"u")return!1;if(l=0?s=e.src.slice(S,l++):l=o+1):l=o+1,s||(s=e.src.slice(a,o)),c=e.env.references[jUi(s)],!c)return e.pos=v,!1;p=c.href,m=c.title}return t||(e.pos=a,e.posMax=o,h=e.push("link_open","a",1),h.attrs=r=[["href",p]],m&&r.push(["title",m]),e.md.inline.tokenize(e),h=e.push("link_close","a",-1)),e.pos=l,e.posMax=w,!0},UUi=Pc.normalizeReference,LAe=Pc.isSpace,zUi=function(e,t){var r,n,s,o,a,l,u,c,h,p,m,v,w,S="",I=e.pos,R=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(l=e.pos+2,a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),a<0))return!1;if(u=a+1,u=R)return!1;for(w=u,h=e.md.helpers.parseLinkDestination(e.src,u,e.posMax),h.ok&&(S=e.md.normalizeLink(h.str),e.md.validateLink(S)?u=h.pos:S=""),w=u;u=R||e.src.charCodeAt(u)!==41)return e.pos=I,!1;u++}else{if(typeof e.env.references>"u")return!1;if(u=0?o=e.src.slice(w,u++):u=a+1):u=a+1,o||(o=e.src.slice(l,a)),c=e.env.references[UUi(o)],!c)return e.pos=I,!1;S=c.href,p=c.title}return t||(s=e.src.slice(l,a),e.md.inline.parse(s,e.md,e.env,v=[]),m=e.push("image","img",0),m.attrs=r=[["src",S],["alt",""]],m.children=v,m.content=s,p&&r.push(["title",p])),e.pos=u,e.posMax=R,!0},VUi=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,HUi=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,WUi=function(e,t){var r,n,s,o,a,l,u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;for(a=e.pos,l=e.posMax;;){if(++u>=l||(o=e.src.charCodeAt(u),o===60))return!1;if(o===62)break}return r=e.src.slice(a+1,u),HUi.test(r)?(n=e.md.normalizeLink(r),e.md.validateLink(n)?(t||(s=e.push("link_open","a",1),s.attrs=[["href",n]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):VUi.test(r)?(n=e.md.normalizeLink("mailto:"+r),e.md.validateLink(n)?(t||(s=e.push("link_open","a",1),s.attrs=[["href",n]],s.markup="autolink",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(r),s=e.push("link_close","a",-1),s.markup="autolink",s.info="auto"),e.pos+=r.length+2,!0):!1):!1},qUi=jxe.HTML_TAG_RE;function YUi(i){var e=i|32;return e>=97&&e<=122}var XUi=function(e,t){var r,n,s,o,a=e.pos;return!e.md.options.html||(s=e.posMax,e.src.charCodeAt(a)!==60||a+2>=s)||(r=e.src.charCodeAt(a+1),r!==33&&r!==63&&r!==47&&!YUi(r))||(n=e.src.slice(a).match(qUi),!n)?!1:(t||(o=e.push("html_inline","",0),o.content=e.src.slice(a,a+n[0].length)),e.pos+=n[0].length,!0)},Eit=dTt,JUi=Pc.has,KUi=Pc.isValidEntityCode,Iit=Pc.fromCodePoint,ZUi=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,QUi=/^&([a-z][a-z0-9]{1,31});/i,ezi=function(e,t){var r,n,s,o=e.pos,a=e.posMax;if(e.src.charCodeAt(o)!==38)return!1;if(o+1o;r-=v[r]+1)if(s=e[r],s.marker===n.marker&&s.open&&s.end<0&&(l=!1,(s.close||n.open)&&(s.length+n.length)%3===0&&(s.length%3!==0||n.length%3!==0)&&(l=!0),!l)){u=r>0&&!e[r-1].open?v[r-1]+1:0,v[t]=t-r+u,v[r]=u,n.open=!1,s.end=t,s.close=!1,a=-1,m=-2;break}a!==-1&&(c[n.marker][(n.open?3:0)+(n.length||0)%3]=a)}}}var tzi=function(e){var t,r=e.tokens_meta,n=e.tokens_meta.length;for(Ait(e,e.delimiters),t=0;t0&&n++,s[t].type==="text"&&t+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(n),r};qoe.prototype.scanDelims=function(i,e){var t=i,r,n,s,o,a,l,u,c,h,p=!0,m=!0,v=this.posMax,w=this.src.charCodeAt(i);for(r=i>0?this.src.charCodeAt(i-1):32;t=s)break;continue}i.pending+=i.src[i.pos++]}i.pending&&i.pushPending()};Yoe.prototype.parse=function(i,e,t,r){var n,s,o,a=new this.State(i,e,t,r);for(this.tokenize(a),s=this.ruler2.getRules(""),o=s.length,n=0;n|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),BAe}function O4e(i){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){t&&Object.keys(t).forEach(function(r){i[r]=t[r]})}),i}function Hxe(i){return Object.prototype.toString.call(i)}function ozi(i){return Hxe(i)==="[object String]"}function azi(i){return Hxe(i)==="[object Object]"}function lzi(i){return Hxe(i)==="[object RegExp]"}function Fit(i){return Hxe(i)==="[object Function]"}function uzi(i){return i.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var xTt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function czi(i){return Object.keys(i||{}).reduce(function(e,t){return e||xTt.hasOwnProperty(t)},!1)}var hzi={"http:":{validate:function(i,e,t){var r=i.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(i,e,t){var r=i.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&i[e-3]===":"||e>=3&&i[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(i,e,t){var r=i.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},dzi="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",pzi="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function fzi(i){i.__index__=-1,i.__text_cache__=""}function mzi(i){return function(e,t){var r=e.slice(t);return i.test(r)?r.match(i)[0].length:0}}function kit(){return function(i,e){e.normalize(i)}}function hve(i){var e=i.re=szi()(i.__opts__),t=i.__tlds__.slice();i.onCompile(),i.__tlds_replaced__||t.push(dzi),t.push(e.src_xn),e.src_tlds=t.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];i.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(i.__schemas__).forEach(function(a){var l=i.__schemas__[a];if(l!==null){var u={validate:null,link:null};if(i.__compiled__[a]=u,azi(l)){lzi(l.validate)?u.validate=mzi(l.validate):Fit(l.validate)?u.validate=l.validate:s(a,l),Fit(l.normalize)?u.normalize=l.normalize:l.normalize?s(a,l):u.normalize=kit();return}if(ozi(l)){n.push(a);return}s(a,l)}}),n.forEach(function(a){i.__compiled__[i.__schemas__[a]]&&(i.__compiled__[a].validate=i.__compiled__[i.__schemas__[a]].validate,i.__compiled__[a].normalize=i.__compiled__[i.__schemas__[a]].normalize)}),i.__compiled__[""]={validate:null,normalize:kit()};var o=Object.keys(i.__compiled__).filter(function(a){return a.length>0&&i.__compiled__[a]}).map(uzi).join("|");i.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),i.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),i.re.pretest=RegExp("("+i.re.schema_test.source+")|("+i.re.host_fuzzy_test.source+")|@","i"),fzi(i)}function gzi(i,e){var t=i.__index__,r=i.__last_index__,n=i.__text_cache__.slice(t,r);this.schema=i.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Lit(i,e){var t=new gzi(i,e);return i.__compiled__[t.schema].normalize(t,i),t}function MS(i,e){if(!(this instanceof MS))return new MS(i,e);e||czi(i)&&(e=i,i={}),this.__opts__=O4e({},xTt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=O4e({},hzi,i),this.__compiled__={},this.__tlds__=pzi,this.__tlds_replaced__=!1,this.re={},hve(this)}MS.prototype.add=function(e,t){return this.__schemas__[e]=t,hve(this),this};MS.prototype.set=function(e){return this.__opts__=O4e(this.__opts__,e),this};MS.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,r,n,s,o,a,l,u,c;if(this.re.schema_test.test(e)){for(l=this.re.schema_search,l.lastIndex=0;(t=l.exec(e))!==null;)if(s=this.testSchemaAt(e,t[2],l.lastIndex),s){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test),u>=0&&(this.__index__<0||u=0&&(n=e.match(this.re.email_fuzzy))!==null&&(o=n.index+n[1].length,a=n.index+n[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};MS.prototype.pretest=function(e){return this.re.pretest.test(e)};MS.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};MS.prototype.match=function(e){var t=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Lit(this,t)),t=this.__last_index__);for(var n=t?e.slice(t):e;this.test(n);)r.push(Lit(this,t)),n=n.slice(this.__last_index__),t+=this.__last_index__;return r.length?r:null};MS.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,s){return r!==s[n-1]}).reverse(),hve(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,hve(this),this)};MS.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};MS.prototype.onCompile=function(){};var yzi=MS;const MV=2147483647,CA=36,MUe=1,mne=26,vzi=38,_zi=700,STt=72,TTt=128,CTt="-",bzi=/^xn--/,wzi=/[^\0-\x7F]/,xzi=/[\x2E\u3002\uFF0E\uFF61]/g,Szi={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},jAe=CA-MUe,EA=Math.floor,GAe=String.fromCharCode;function u5(i){throw new RangeError(Szi[i])}function Tzi(i,e){const t=[];let r=i.length;for(;r--;)t[r]=e(i[r]);return t}function ETt(i,e){const t=i.split("@");let r="";t.length>1&&(r=t[0]+"@",i=t[1]),i=i.replace(xzi,".");const n=i.split("."),s=Tzi(n,e).join(".");return r+s}function OUe(i){const e=[];let t=0;const r=i.length;for(;t=55296&&n<=56319&&tString.fromCodePoint(...i),Czi=function(i){return i>=48&&i<58?26+(i-48):i>=65&&i<91?i-65:i>=97&&i<123?i-97:CA},Nit=function(i,e){return i+22+75*(i<26)-((e!=0)<<5)},ATt=function(i,e,t){let r=0;for(i=t?EA(i/_zi):i>>1,i+=EA(i/e);i>jAe*mne>>1;r+=CA)i=EA(i/jAe);return EA(r+(jAe+1)*i/(i+vzi))},PUe=function(i){const e=[],t=i.length;let r=0,n=TTt,s=STt,o=i.lastIndexOf(CTt);o<0&&(o=0);for(let a=0;a=128&&u5("not-basic"),e.push(i.charCodeAt(a));for(let a=o>0?o+1:0;a=t&&u5("invalid-input");const p=Czi(i.charCodeAt(a++));p>=CA&&u5("invalid-input"),p>EA((MV-r)/c)&&u5("overflow"),r+=p*c;const m=h<=s?MUe:h>=s+mne?mne:h-s;if(pEA(MV/v)&&u5("overflow"),c*=v}const u=e.length+1;s=ATt(r-l,u,l==0),EA(r/u)>MV-n&&u5("overflow"),n+=EA(r/u),r%=u,e.splice(r++,0,n)}return String.fromCodePoint(...e)},RUe=function(i){const e=[];i=OUe(i);const t=i.length;let r=TTt,n=0,s=STt;for(const l of i)l<128&&e.push(GAe(l));const o=e.length;let a=o;for(o&&e.push(CTt);a=r&&cEA((MV-n)/u)&&u5("overflow"),n+=(l-r)*u,r=l;for(const c of i)if(cMV&&u5("overflow"),c===r){let h=n;for(let p=CA;;p+=CA){const m=p<=s?MUe:p>=s+mne?mne:p-s;if(h=0))try{e.hostname=PTt.toASCII(e.hostname)}catch{}return t8.encode(t8.format(e))}function zzi(i){var e=t8.parse(i,!0);if(e.hostname&&(!e.protocol||RTt.indexOf(e.protocol)>=0))try{e.hostname=PTt.toUnicode(e.hostname)}catch{}return t8.decode(t8.format(e),t8.decode.defaultChars+"%")}function OS(i,e){if(!(this instanceof OS))return new OS(i,e);e||hie.isString(i)||(e=i||{},i="default"),this.inline=new Lzi,this.block=new kzi,this.core=new Fzi,this.renderer=new Dzi,this.linkify=new Nzi,this.validateLink=Gzi,this.normalizeLink=Uzi,this.normalizeLinkText=zzi,this.utils=hie,this.helpers=hie.assign({},Rzi),this.options={},this.configure(i),e&&this.set(e)}OS.prototype.set=function(i){return hie.assign(this.options,i),this};OS.prototype.configure=function(i){var e=this,t;if(hie.isString(i)&&(t=i,i=$zi[t],!i))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!i)throw new Error("Wrong `markdown-it` preset, can't be empty");return i.options&&e.set(i.options),i.components&&Object.keys(i.components).forEach(function(r){i.components[r].rules&&e[r].ruler.enableOnly(i.components[r].rules),i.components[r].rules2&&e[r].ruler2.enableOnly(i.components[r].rules2)}),this};OS.prototype.enable=function(i,e){var t=[];Array.isArray(i)||(i=[i]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.enable(i,!0))},this),t=t.concat(this.inline.ruler2.enable(i,!0));var r=i.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};OS.prototype.disable=function(i,e){var t=[];Array.isArray(i)||(i=[i]),["core","block","inline"].forEach(function(n){t=t.concat(this[n].ruler.disable(i,!0))},this),t=t.concat(this.inline.ruler2.disable(i,!0));var r=i.filter(function(n){return t.indexOf(n)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};OS.prototype.use=function(i){var e=[this].concat(Array.prototype.slice.call(arguments,1));return i.apply(i,e),this};OS.prototype.parse=function(i,e){if(typeof i!="string")throw new Error("Input data should be a String");var t=new this.core.State(i,this,e);return this.core.process(t),t.tokens};OS.prototype.render=function(i,e){return e=e||{},this.renderer.render(this.parse(i,e),this.options,e)};OS.prototype.parseInline=function(i,e){var t=new this.core.State(i,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};OS.prototype.renderInline=function(i,e){return e=e||{},this.renderer.render(this.parseInline(i,e),this.options,e)};var Vzi=OS,Hzi=Vzi;const GB=jB(Hzi);function Wzi(i,e=document){return typeof i=="string"?Array.from(e.querySelectorAll(i)):i instanceof Element?[i]:i instanceof NodeList?Array.from(i):i instanceof Array?i:[]}function qzi(i){const e=document.createElement("div");e.className=`scrollama__debug-step ${i}`,e.style.position="fixed",e.style.left="0",e.style.width="100%",e.style.zIndex="9999",e.style.borderTop="2px solid black",e.style.borderBottom="2px solid black";const t=document.createElement("p");return t.style.position="absolute",t.style.left="0",t.style.height="1px",t.style.width="100%",t.style.borderTop="1px dashed black",e.appendChild(t),document.body.appendChild(e),e}function Yzi({id:i,step:e,marginTop:t}){const{index:r,height:n}=e,s=`scrollama__debug-step--${i}-${r}`;let o=document.querySelector(`.${s}`);o||(o=qzi(s)),o.style.top=`${t*-1}px`,o.style.height=`${n}px`,o.querySelector("p").style.top=`${n/2}px`}function Xzi(){const i="abcdefghijklmnopqrstuvwxyz",e=Date.now(),t=[];for(let r=0;r<6;r+=1){const n=i[Math.floor(Math.random()*i.length)];t.push(n)}return`${t.join("")}${e}`}function Ece(i){console.error(`scrollama error: ${i}`)}function vJ(i){return+i.getAttribute("data-scrollama-index")}function Jzi(i,e){const t=Math.ceil(i/e),r=[],n=1/t;for(let s=0;s0){const e=+i.replace("px","");return isNaN(e)?(err("offset value must be in 'px' format. Fallback to 0.5."),{format:"percent",value:.5}):{format:"pixels",value:e}}else if(typeof i=="number"||!isNaN(+i))return i>1&&err("offset value is greater than 1. Fallback to 1."),i<0&&err("offset value is lower than 0. Fallback to 0."),{format:"percent",value:Math.min(Math.max(0,i),1)};return null}function Kzi(i){i.forEach(e=>e.node.setAttribute("data-scrollama-index",e.index))}function Zzi(i){const{top:e}=i.getBoundingClientRect(),t=window.pageYOffset,r=document.body.clientTop||0;return e+t-r}let TG,Gfe,BO;function DTt(i){const e=i?i.scrollTop:window.pageYOffset;TG!==e&&(TG=e,TG>Gfe?BO="down":TGDTt(i))}function $it(){let i={},e=Xzi(),t=[],r,n,s,o=0,a=!1,l=!1,u=!1,c=!1,h=[];function p(){i={stepEnter:()=>{},stepExit:()=>{},stepProgress:()=>{}},h=[]}function m(pe){pe&&!a&&ne(),!pe&&a&&B(),a=pe}function v(pe,H){const Z=vJ(pe),ae=t[Z];H!==void 0&&(ae.progress=H);const fe={element:pe,index:Z,progress:H,direction:BO};ae.state==="enter"&&i.stepProgress(fe)}function w(pe,H=!0){const Z=vJ(pe),ae=t[Z],fe={element:pe,index:Z,direction:BO};ae.direction=BO,ae.state="enter",h[Z]||i.stepEnter(fe),c&&(h[Z]=!0)}function S(pe,H=!0){const Z=vJ(pe),ae=t[Z];if(!ae.state)return!1;const fe={element:pe,index:Z,direction:BO};l&&(BO==="down"&&ae.progress<1?v(pe,1):BO==="up"&&ae.progress>0&&v(pe,0)),ae.direction=BO,ae.state="exit",i.stepExit(fe)}function I([pe]){const H=vJ(pe.target),Z=t[H],ae=pe.target.offsetHeight;ae!==Z.height&&(Z.height=ae,k(Z),Y(Z),$(Z))}function R([pe]){DTt(n);const{isIntersecting:H,target:Z}=pe;H?w(Z):S(Z)}function L([pe]){const H=vJ(pe.target),Z=t[H],{isIntersecting:ae,intersectionRatio:fe,target:be}=pe;ae&&Z.state==="enter"&&v(be,fe)}function k({observers:pe}){Object.keys(pe).map(H=>{pe[H].disconnect()})}function B(){t.forEach(k)}function $(pe){const H=new ResizeObserver(I);H.observe(pe.node),pe.observers.resize=H}function V(){t.forEach($)}function Y(pe){const H=window.innerHeight,Z=pe.offset||r,ae=Z.format==="pixels"?1:H,fe=Z.value*ae,be=pe.height/2-fe,_e=pe.height/2-(H-fe),Ve={rootMargin:`${be}px 0px ${_e}px 0px`,threshold:.5,root:s},$e=new IntersectionObserver(R,Ve);$e.observe(pe.node),pe.observers.step=$e,u&&Yzi({id:e,step:pe,marginTop:be,marginBottom:_e})}function K(){t.forEach(Y)}function Q(pe){const H=window.innerHeight,Z=pe.offset||r,ae=Z.format==="pixels"?1:H,fe=Z.value*ae,be=-fe+pe.height,_e=fe-H,Ie=`${be}px 0px ${_e}px 0px`,Te=Jzi(pe.height,o),Be={rootMargin:Ie,threshold:Te},Ve=new IntersectionObserver(L,Be);Ve.observe(pe.node),pe.observers.progress=Ve}function re(){t.forEach(Q)}function ne(){B(),V(),K(),l&&re()}const de={};return de.setup=({step:pe,parent:H,offset:Z=.5,threshold:ae=4,progress:fe=!1,once:be=!1,debug:_e=!1,container:Ie=void 0,root:Te=null})=>(Qzi(Ie),t=Wzi(pe,H).map((Be,Ve)=>({index:Ve,direction:void 0,height:Be.offsetHeight,node:Be,observers:{},offset:UAe(Be.dataset.offset),top:Zzi(Be),progress:0,state:void 0})),t.length?(l=fe,c=be,u=_e,o=Math.max(1,+ae),r=UAe(Z),n=Ie,s=Te,p(),Kzi(t),m(!0),de):(Ece("no step elements"),de)),de.enable=()=>(m(!0),de),de.disable=()=>(m(!1),de),de.destroy=()=>(m(!1),p(),de),de.resize=()=>(ne(),de),de.offset=pe=>pe==null?r.value:(r=UAe(pe),ne(),de),de.onStepEnter=pe=>(typeof pe=="function"?i.stepEnter=pe:Ece("onStepEnter requires a function"),de),de.onStepExit=pe=>(typeof pe=="function"?i.stepExit=pe:Ece("onStepExit requires a function"),de),de.onStepProgress=pe=>(typeof pe=="function"?i.stepProgress=pe:Ece("onStepProgress requires a function"),de),de}const Wxe=da({__name:"scrollama",emits:["step-progress","step-enter","step-exit"],setup(i,{emit:e}){const t=e;let r=Tn();const n=Tn(),s=new Proxy({},{get:(l,u)=>r.value.getAttribute(u),has:(l,u)=>r.value.hasAttribute(u)});Tg(()=>{n.value=$it(),o()}),hTt(()=>{n.value&&n.value.destroy(),window.removeEventListener("resize",a)}),hci(()=>{o()});function o(){if(n.value&&n.value.destroy(),r.value){const l={step:Array.from(r.value.children),progress:"step-progress"in s,...s};n.value=$it().setup(l).onStepProgress(u=>{t("step-progress",u)}).onStepEnter(u=>{t("step-enter",u)}).onStepExit(u=>{t("step-exit",u)}),window.addEventListener("resize",a)}}function a(){n.value&&n.value.resize()}return(l,u)=>(fr(),xr("div",{class:"scrollama__steps",ref_key:"rootElement",ref:r},[bUe(l.$slots,"default")],512))}}),eVi=["innerHTML"],tVi=da({__name:"text-panel",props:{config:{type:Object,required:!0},background:{type:Boolean}},setup(i){const e=i,t=new GB({html:!0}),r=Tn("");return Tg(()=>{r.value=t.render(e.config.content).replace(//g,"
"),document.querySelectorAll(".storyramp-app a:not([target])").forEach(n=>n.target="_blank")}),(n,s)=>(fr(),Vv(Wxe,{class:Vl(["text-panel prose max-w-none mb-5 mx-1 py-5",{"has-background":i.background}]),style:ja({color:i.config.textColour??"#000"})},{default:Wp(()=>[(fr(),Vv(wUe(i.config.titleTag||"h2"),{class:"px-10 mb-0 chapter-title top-20"},{default:Wp(()=>[U8(Zh(i.config.title),1)]),_:1})),Cr("div",{class:"px-10 md-content object-contain",innerHTML:r.value},null,8,eVi)]),_:1},8,["class","style"]))}}),iVi=Ux(tVi,[["__scopeId","data-v-044ceba3"]]);var j1=(i=>(i.BLOB="blob",i.DATE="date",i.DOUBLE="double",i.GEOMETRY="geometry",i.GLOBAL_ID="global-id",i.GUID="guid",i.INTEGER="integer",i.LONG="long",i.OID="oid",i.RASTER="raster",i.SINGLE="single",i.SMALL_INTEGER="small-integer",i.STRING="string",i.XML="xml",i))(j1||{}),zI=(i=>(i.CIRCLE="circle",i.CROSS="cross",i.DIAMOND="diamond",i.ICON="icon",i.PATH="path",i.SQUARE="square",i.TRIANGLE="triangle",i.X="x",i))(zI||{}),K_=(i=>(i.DASH="dash",i.DASHDOT="dash-dot",i.DASHDOTDOT="short-dash-dot-dot",i.DOT="dot",i.LONGDASH="long-dash",i.LONGDASHDOT="long-dash-dot",i.LONGDASHDOTDOT="long-dash-dot-dot",i.NONE="none",i.NULL="none",i.SHORTDASH="short-dash",i.SHORTDASHDOT="short-dash-dot",i.SHORTDASHDOTDOT="short-dash-dot-dot",i.SHORTDOT="short-dot",i.SOLID="solid",i))(K_||{}),FTt=(i=>(i.BEVEL="bevel",i.MITER="miter",i.ROUND="round",i))(FTt||{}),kTt=(i=>(i.ROUND="round",i.BUTT="butt",i.SQUARE="square",i))(kTt||{}),LTt=(i=>(i.BDIAG="backward-diagonal",i.CROSS="cross",i.DIAG_CROSS="diagonal-cross",i.FDIAG="forward-diagonal",i.HORIZONTAL="horizontal",i.NONE="none",i.NULL="none",i.SOLID="solid",i.VERTICAL="vertical",i))(LTt||{}),cl=(i=>(i.POINT="Point",i.MULTIPOINT="MultiPoint",i.LINESTRING="LineString",i.MULTILINESTRING="MultiLineString",i.POLYGON="Polygon",i.MULTIPOLYGON="MultiPolygon",i.LINEARRING="LinearRing",i.EXTENT="Extent",i.NONE="None",i.UNKNOWN="Unknown",i))(cl||{}),qxe=(i=>(i.Simple="simple",i.Unique="uniqueValue",i.ClassBreaks="classBreaks",i.Unknown="unknown",i))(qxe||{}),pn=(i=>(i.FEATURE="esri-feature",i.MAPIMAGE="esri-map-image",i.TILE="esri-tile",i.IMAGERY="esri-imagery",i.GRAPHIC="esri-graphic",i.WMS="ogc-wms",i.WFS="ogc-wfs",i.GEOJSON="file-geojson",i.CSV="file-csv",i.SHAPEFILE="file-shape",i.OSM="osm-tile",i.DATACSV="data-csv",i.DATAJSON="data-json",i.DATATABLE="data-esri-table",i.UNKNOWN="unknown",i.SUBLAYER="sublayer",i))(pn||{}),zx=(i=>(i.FEATURE="feature",i.GRAPHIC="graphic",i.IMAGERY="imagery",i.MAPIMAGE="map-image",i.NOLAYER="no-layer",i.OSM="osm-tile",i.TILE="tile",i.UNKNOWN="unknown",i.WMS="wms",i))(zx||{}),l0=(i=>(i.ESRI_FEATURE="esriFeature",i.ESRI_RASTER="esriRaster",i.ESRI_TILE="esriTile",i.OSM_TILE="osmTile",i.OGC_RASTER="ogcRaster",i.UNKNOWN="unknown",i))(l0||{}),jp=(i=>(i.POINT="Point",i.MULTIPOINT="MultiPoint",i.LINESTRING="LineString",i.MULTILINESTRING="MultiLineString",i.POLYGON="Polygon",i.MULTIPOLYGON="MultiPolygon",i))(jp||{}),sg=(i=>(i.GEOMETRIC="geometric",i.SYMBOLIC="symbolic",i.HYBRID="hybrid",i.NONE="none",i))(sg||{}),ey=(i=>(i.NEW="new",i.INITIATING="initiating",i.INITIATED="initiated",i.TERMINATING="terminating",i.TERMINATED="terminated",i))(ey||{}),Ud=(i=>(i.NEW="new",i.LOADING="loading",i.LOADED="loaded",i.ERROR="error",i))(Ud||{}),fb=(i=>(i.NOT_LOADED="not-loaded",i.NOT_VISUAL="not-visual",i.REFRESH="refresh",i.UP_TO_DATE="up-to-date",i))(fb||{}),z8=(i=>(i.ESRI="esri",i.TEXT="text",i.IMAGE="image",i.HTML="html",i.XML="xml",i.JSON="json",i.UNKNOWN="unknown",i))(z8||{}),pm=(i=>(i.SYMBOL="symbol",i.GRID="grid",i.EXTENT="extent",i.INITIAL="initial",i.API="api",i.PERMANENT="permanent",i))(pm||{}),ya=(i=>(i.BoundaryZoom="boundaryZoom",i.Datatable="datatable",i.Identify="identify",i.Metadata="metadata",i.Opacity="opacity",i.Refresh="refresh",i.Reload="reload",i.Remove="remove",i.Settings="settings",i.Symbology="symbology",i.Visibility="visibility",i))(ya||{});class Ax{attributes;geometry;style;id;constructor(e,t,r){this.geometry=e,t?this.id=t:this.id=sH.sharedUtils.generateUUID(),r?this.attributes=r:this.attributes={}}_hover;get hover(){return this._hover}set hover(e){e&&this._hover&&this._hover.id!==e.id&&this.removeHover(),this._hover=e}removeHover(){this._hover&&(this._hover=void 0)}}function x(i,e,t,r){var n,s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(e,t,o):n(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o}function _u(i,e){return function(t,r){e(t,r,i)}}function Tm(i,e,t,r){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(h){o(h)}}function l(c){try{u(r.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((r=r.apply(i,[])).next())})}let J5;function yi(i){return typeof J5[i]=="function"?J5[i]=J5[i](globalThis):J5[i]}J5=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},yi.add=(i,e,t,r)=>((r||J5[i]===void 0)&&(J5[i]=e),t&&yi(i)),yi.cache=J5,yi.add("big-integer-warning-enabled",!0),yi.add("esri-deprecation-warnings",!0),yi.add("esri-tests-disable-screenshots",!1),yi.add("esri-tests-use-full-window",!1),yi.add("esri-tests-post-to-influx",!0),(()=>{yi.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const i=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(yi.add("host-browser",i),yi.add("host-node",typeof globalThis.process=="object"&&globalThis.process.versions?.node&&globalThis.process.versions.v8),yi.add("dom",i),yi("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(yi.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),yi.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),yi.add("khtml",r.includes("Konqueror")?n:void 0),yi.add("edge",parseFloat(t.split("Edge/")[1])||void 0),yi.add("opr",parseFloat(t.split("OPR/")[1])||void 0),yi.add("webkit",!yi("wp")&&!yi("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),yi.add("chrome",!yi("edge")&&!yi("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),yi.add("android",!yi("wp")&&parseFloat(t.split("Android ")[1])||void 0),yi.add("safari",!r.includes("Safari")||yi("wp")||yi("chrome")||yi("android")||yi("edge")||yi("opr")?void 0:parseFloat(r.split("Version/")[1])),yi.add("mac",r.includes("Macintosh")),!yi("wp")&&/(iPhone|iPod|iPad)/.test(t)){const s=RegExp.$1.replace(/P/,"p"),o=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",a=parseFloat(o.replace(/_/,".").replaceAll("_",""));yi.add(s,a),yi.add("ios",a)}yi("webkit")||(!t.includes("Gecko")||yi("wp")||yi("khtml")||yi("edge")||yi.add("mozilla",n),yi("mozilla")&&yi.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const i=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(i),t=/iPhone/i.test(i);e&&yi.add("esri-mobile",e),t&&yi.add("esri-iPhone",t),yi.add("esri-geolocation",!!navigator.geolocation)}yi.add("esri-wasm","WebAssembly"in globalThis),yi.add("esri-performance-mode-frames-between-render",20),yi.add("esri-force-performance-mode",!1),yi.add("esri-shared-array-buffer",()=>{const i="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return i&&!e}),yi.add("wasm-simd",()=>{const i=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(i))}),yi.add("esri-atomics","Atomics"in globalThis),yi.add("esri-workers","Worker"in globalThis),yi.add("web-feat:cache","caches"in globalThis),yi.add("esri-workers-arraybuffer-transfer",!yi("safari")||Number(yi("safari"))>=12),yi.add("workers-pool-size",8),yi.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),yi.add("featurelayer-simplify-payload-size-factors",[1,1,4]),yi.add("featurelayer-fast-triangulation-enabled",!0),yi.add("featurelayer-animation-enabled",!0),yi.add("featurelayer-snapshot-enabled",!0),yi.add("featurelayer-snapshot-point-min-threshold",8e4),yi.add("featurelayer-snapshot-point-max-threshold",4e5),yi.add("featurelayer-snapshot-point-coverage",.1),yi.add("featurelayer-query-max-depth",4),yi.add("featurelayer-query-pausing-enabled",!1),yi.add("hittest-2d-mobile-tolerance",3),yi.add("hittest-2d-desktop-tolerance",1),yi.add("hittest-2d-small-symbol-tolerance",3),yi.add("hittest-2d-small-symbol-tolerance-threshold",3),yi.add("featurelayer-advanced-symbols",!1),yi.add("featurelayer-pbf",!0),yi.add("featurelayer-pbf-statistics",!1),yi.add("feature-layers-workers",!0),yi.add("feature-polyline-generalization-factor",1),yi.add("mapview-transitions-duration",200),yi.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),yi.add("mapserver-pbf-version-support",10.81),yi.add("mapservice-popup-identify-max-tolerance",20),yi("host-webworker")||yi("host-browser")&&(yi.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),yi.add("esri-image-decode",()=>{if("decode"in new Image){const i=new Image;return i.src='data:image/svg+xml;charset=UTF-8,',void i.decode().then(()=>{yi.add("esri-image-decode",!0,!0,!0)}).catch(()=>{yi.add("esri-image-decode",!1,!0,!0)})}return!1}),yi.add("esri-url-encodes-apostrophe",()=>{const i=window.document.createElement("a");return i.href="?'",i.href.includes("?%27")}))})();let VC=class wN{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*wN._m}getInt(){return this._seed=(wN._a*this._seed+wN._c)%wN._m,this._seed}getFloat(){return this.getInt()/(wN._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/wN._m*r}};VC._m=2147483647,VC._a=48271,VC._c=0;function zAe(i,e){for(let t=i.length-1;t>=0;t--){const r=i[t];if(e(r))return r}}function DUe(i,e){return e?i.filter((t,r,n)=>n.findIndex(e.bind(null,t))===r):Array.from(new Set(i))}function UB(i,e,t){if(i==null&&e==null)return!0;if(i==null||e==null||i.length!==e.length)return!1;if(t){for(let r=0;r!i.some(o=>t(o,s))),n=i.filter(s=>!e.some(o=>t(o,s)))):(r=e.filter(s=>!i.includes(s)),n=i.filter(s=>!e.includes(s))),{added:r,removed:n}}function NTt(i){return i&&typeof i.length=="number"}const nVi=!!Array.prototype.fill;function sVi(i,e){if(nVi)return new Array(i).fill(e);const t=new Array(i);for(let r=0;re+(t?U9(t)?R4e(t,kUe()):t.byteLength+VTt:0),0)}const VTt=145,a3=1024;function hVi(i){return Qxe(i)||Zxe(i)||Kxe(i)||Xxe(i)||LUe(i)}function dVi(i){return Qxe(i)||Zxe(i)}function pVi(i){return Qxe(i)?179769e303:Zxe(i)?3402823e32:$Ue(i)?4294967295:Jxe(i)?65535:K5(i)||NUe(i)?255:Kxe(i)?2147483647:Xxe(i)?32767:LUe(i)?127:256}function BUe(i,e){let t;for(t in i)i.hasOwnProperty(t)&&i[t]===void 0&&delete i[t];return i}function li(i){if(!i||typeof i!="object"||typeof i=="function")return i;const e=qTt(i);if(e!=null)return e;if(dve(i))return i.clone();if(HTt(i))return i.map(li);if(WTt(i))return i.clone();const t={};for(const r of Object.getOwnPropertyNames(i))t[r]=li(i[r]);return t}function F4e(i){if(!i||typeof i!="object"||typeof i=="function"||"HTMLElement"in globalThis&&i instanceof HTMLElement)return i;const e=qTt(i);if(e!=null)return e;if(HTt(i)){let t=!0;const r=i.map(n=>{const s=F4e(n);return n!=null&&s==null&&(t=!1),s});return t?r:null}if(dve(i))return i.clone();if(i instanceof File||i instanceof Blob)return i;if(!WTt(i)){const t=new(Object.getPrototypeOf(i)).constructor;for(const r of Object.getOwnPropertyNames(i)){const n=i[r],s=F4e(n);if(n!=null&&s==null)return null;t[r]=s}return t}return null}function dve(i){return typeof i.clone=="function"}function HTt(i){return typeof i.map=="function"&&typeof i.forEach=="function"}function WTt(i){return typeof i.notifyChange=="function"&&typeof i.watch=="function"}function Bit(i){if(Object.prototype.toString.call(i)!=="[object Object]")return!1;const e=Object.getPrototypeOf(i);return e===null||e===Object.prototype}function qTt(i){if(LUe(i)||K5(i)||NUe(i)||Xxe(i)||Jxe(i)||Kxe(i)||$Ue(i)||Zxe(i)||Qxe(i))return i.slice();if(i instanceof Date)return new Date(i.getTime());if(i instanceof ArrayBuffer)return i.slice(0,i.byteLength);if(i instanceof Map){const e=new Map;for(const[t,r]of i)e.set(t,li(r));return e}if(i instanceof Set){const e=new Set;for(const t of i)e.add(li(t));return e}return null}function jUe(i,e){return i===e||typeof i=="number"&&isNaN(i)&&typeof e=="number"&&isNaN(e)||typeof i?.getTime=="function"&&typeof e?.getTime=="function"&&i.getTime()===e.getTime()||!1}function YTt(i,e){return i===e||(i==null||typeof i=="string"?i===e:typeof i=="number"?i===e||typeof e=="number"&&isNaN(i)&&isNaN(e):i instanceof Date?e instanceof Date&&i.getTime()===e.getTime():Array.isArray(i)?Array.isArray(e)&&UB(i,e):i instanceof Set?e instanceof Set&&mVi(i,e):i instanceof Map?e instanceof Map&&gVi(i,e):!!Bit(i)&&Bit(e)&&fVi(i,e))}function fVi(i,e){if(i===null||e===null)return!1;const t=Object.keys(i);if(e===null||Object.keys(e).length!==t.length)return!1;for(const r of t)if(i[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function mVi(i,e){if(i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0}function gVi(i,e){if(i.size!==e.size)return!1;for(const[t,r]of i){const n=e.get(t);if(n!==r||n===void 0&&!e.has(t))return!1}return!0}function GUe(i,e,t=!1){return JTt(i,e,t)}function uS(i,e){if(e!=null)return e[i]||XTt(i.split("."),!1,e)}function Qp(i,e,t){const r=i.split("."),n=r.pop(),s=XTt(r,!0,t);s&&n&&(s[n]=e)}function XTt(i,e,t){let r=t;for(const n of i){if(r==null)return;if(!(n in r)){if(!e)return;r[n]={}}r=r[n]}return r}function JTt(i,e,t){return e?Object.keys(e).reduce((r,n)=>{let s=r[n],o=e[n];return s===o?r:s===void 0?(r[n]=li(o),r):(Array.isArray(o)||Array.isArray(r)?(s=s?Array.isArray(s)?r[n]=s.concat():r[n]=[s]:r[n]=[],o&&(Array.isArray(o)||(o=[o]),t?o.forEach(a=>{s.includes(a)||s.push(a)}):r[n]=o.concat())):o&&typeof o=="object"?r[n]=JTt(s,o,t):r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=o),r)},i||{}):i}const Ho={apiKey:void 0,applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(GUe(Ho,globalThis.esriConfig,!0),delete Ho.has),!Ho.assetsPath){{const i="4.29";Ho.assetsPath=`https://js.arcgis.com/${i}/@arcgis/core/assets`}Ho.defaultAssetsPath=Ho.assetsPath}const yVi=/\{([^\}]+)\}/g;function jit(i){return i??""}function m0(i,e){return e?i.replaceAll(yVi,typeof e=="object"?(t,r)=>jit(uS(r,e)):(t,r)=>jit(e(r))):i}function UUe(i,e){return i.replaceAll(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,t=>e&&e.includes(t)?t:`\\${t}`)}function Q1(i){let e=0;for(let t=0;te._loggedMessages.warn.clear()}}static get test(){return{resetLoggers(e=new Map){const t=z0._loggers;return z0._loggers=e,t},set throttlingDisabled(e){z0._throttlingDisabled=e}}}static getLogger(e){return e=typeof e!="string"?e.declaredClass:e,z0._loggers.get(e)||new z0({module:e})}_log(e,t,...r){if(this._matchLevel(e)){if(t!=="always"&&!z0._throttlingDisabled){const n=this._argsToKey(r),s=this._loggedMessages[e].get(n);if(t==="once"&&s!=null||t==="oncePerTick"&&s&&s>=z0._tickCounter)return;this._loggedMessages[e].set(n,z0._tickCounter),z0._scheduleTickCounterIncrement()}for(const n of Ho.log.interceptors)if(n(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;r!=null;){const n=r[e];if(n!=null)return n;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=Ho.log.level||"warn";return Uit[this._parentWithMember("level",t)]<=Uit[e]}_argsToKey(...e){return Q1(JSON.stringify(e,(r,n)=>typeof n!="object"||Array.isArray(n)?n:"[Object]"))}static _scheduleTickCounterIncrement(){z0._tickCounterScheduled||(z0._tickCounterScheduled=!0,Promise.resolve().then(()=>{z0._tickCounter++,z0._tickCounterScheduled=!1}))}};di._loggers=new Map,di._tickCounter=0,di._tickCounterScheduled=!1,di._throttlingDisabled=!1;function _Vi(i,e){return i.replaceAll(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(t,r)=>r===""?"$":(uS(r,e)??"").toString())}let KTt=class{constructor(e,t,r){this.name=e,this.details=r,this.message=(t&&_Vi(t,r))??""}toString(){return"["+this.name+"]: "+this.message}},qe=class ZTt extends KTt{constructor(e,t,r){super(e,t,r)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,t)=>{if(t&&typeof t=="object"&&typeof t.toJSON=="function")return t;try{return li(t)}catch{return"[object]"}}))}}catch(e){throw di.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new ZTt(e.name,e.message,e.details)}};qe.prototype.type="error";const zit=new WeakMap;function bVi(i,e,t=!1){const r=`🛑 DEPRECATED - ${e}`;if(!t)return void i.warn(r);let n=zit.get(i);n||(n=new Set,zit.set(i,n)),n.has(e)||(n.add(e),i.warn(r))}function zUe(i,e,t={}){if(yi("esri-deprecation-warnings")){const{moduleName:r}=t;UF(i,`Function: ${(r?r+"::":"")+e+"()"}`,t)}}function ty(i,e,t={}){if(yi("esri-deprecation-warnings")){const{moduleName:r}=t;UF(i,`Property: ${(r?r+"::":"")+e}`,t)}}function UF(i,e,t={}){if(yi("esri-deprecation-warnings")){const{replacement:r,version:n,see:s,warnOnce:o}=t;let a=e;r&&(a+=` 🛠️ Replacement: ${r}`),n&&(a+=` ⚙️ Version: ${n}`),s&&(a+=` - 🔗 See ${s} for more details.`),SVi(i,a,o)}}function TVi(i){const e=[];return function*(){yield*e;for(const t of i)e.push(t),yield t}}function die(i,e){for(const t of i)if(t!=null&&e(t))return t}function pve(i){return i!=null&&typeof i[Symbol.iterator]=="function"}let cY=class k4e{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach(t=>{e+=t.length}),e}add(e,t){if(pve(e)){const r=this._getOrCreateGroup(t);for(const n of e)this._isHandle(n)&&r.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(t).push(e);return this}forEach(e,t){if(typeof e=="function")this._groups.forEach(r=>r.forEach(e));else{const r=this._getGroup(e);r&&t&&r.forEach(t)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&pve(e)){for(const t of e)this.remove(t);return this}return this.has(e)?(this._removeAllFromGroup(this._getGroup(e)),this._groups.delete(this._ensureGroupKey(e)),this):this}removeAll(){return this._groups.forEach(e=>this._removeAllFromGroup(e)),this._groups.clear(),this}_isHandle(e){return e&&(!!e.remove||e instanceof k4e)}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(this._ensureGroupKey(e),t),t}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){for(const t of e)t instanceof k4e?t.removeAll():t.remove()}};function Of(i,e){if(i==null)throw new Error(e??"value is None")}function zo(i){return i?.destroy(),null}function ba(i){return i?.dispose(),null}function Hc(i){return i?.remove(),null}function zF(i){return i?.abort(),null}function e4(i){return i?.release(),null}function gne(i,e,t){return i!=null&&e!=null?t!=null?t(i,e):i.equals(e):i===e}function CVi(i,e){let t;return i.some((r,n)=>(t=e(r,n),t!=null)),t??void 0}const QTt=Symbol("Accessor-beforeDestroy"),EVi={remove:()=>{}};function wa(i){return i?{remove(){i&&(i(),i=void 0)}}:EVi}function IVi(i){i.forEach(e=>e?.remove())}function j3(i){return wa(()=>IVi(i))}function Kp(i){return i.__accessor__??null}function AVi(i,e){return i?.metadata?.[e]!=null}function Ufe(i,e,t){return t?fve(i,e,{policy:t,path:""}):fve(i,e,null)}function fve(i,e,t){return e?Object.keys(e).reduce((r,n)=>{const s=n;let o=null,a="merge";if(t&&(o=t.path?`${t.path}.${n}`:n,a=t.policy(o)),a==="replace"||a==="replace-arrays"&&Array.isArray(r[s]))return r[s]=e[s],r;if(r[s]===void 0)return r[s]=li(e[s]),r;let l=r[s],u=e[s];if(l===u)return r;if(Array.isArray(u)||Array.isArray(r))l=l?Array.isArray(l)?r[s]=l.concat():r[s]=[l]:r[s]=[],u&&(Array.isArray(u)||(u=[u]),u.forEach(c=>{l.includes(c)||l.push(c)}));else if(u&&typeof u=="object")if(t){const c=t.path;t.path=o,r[s]=fve(l,u,t),t.path=c}else r[s]=fve(l,u,null);else r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[s]=u);return r},i||{}):i}function eCt(i){return Array.isArray(i)?i:i.split(".")}function Vit(i){return i.includes(",")?i.split(",").map(e=>e.trim()):[i.trim()]}function MVi(i){if(Array.isArray(i)){const e=[];for(const t of i)e.push(...Vit(t));return e}return Vit(i)}function tCt(i,e,t,r){const n=MVi(e);if(n.length!==1){const s=n.map(o=>r(i,o,t));return j3(s)}return r(i,n[0],t)}function iCt(i,e){const t=i[i.length-1]==="?"?i.slice(0,-1):i;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(t,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.at(n)}const r=Kp(e);return AVi(r,t)?r.get(t):e[t]}function rCt(i,e,t){if(i==null)return i;const r=iCt(e[t],i);return!r&&t=this._pool.length)){for(let t=e;t0){if(!(n+r{},onTrackingEnd:()=>{}},GZ=[];let pie=mve;function Ws(i){pie.onObservableAccessed(i)}let zfe=!1,Vfe=!1;function oR(i,e,t){if(zfe)return VUe(i,e,t);sCt(i);const r=e.call(t);return oCt(),r}function $Vi(i,e){return oR(mve,i,e)}function VUe(i,e,t){const r=zfe;zfe=!0,sCt(i);let n=null;try{n=e.call(t)}catch(s){Vfe&&di.getLogger("esri.core.accessorSupport.tracking").error(s)}return oCt(),zfe=r,n}function sCt(i){pie=i,GZ.push(i)}function oCt(){const i=GZ.length;if(i>1){const e=GZ.pop();pie=GZ[i-2],e.onTrackingEnd()}else if(i===1){const e=GZ.pop();pie=mve,e.onTrackingEnd()}else pie=mve}function aCt(i,e){if(e.flags&Nc.DepTrackingInitialized)return;const t=Vfe;Vfe=!1,e.flags&Nc.AutoTracked?VUe(e,e.metadata.get,i):lCt(i,e),Vfe=t}const BVi=[];function lCt(i,e){e.flags&Nc.ExplicitlyTracking||(e.flags|=Nc.ExplicitlyTracking,VUe(e,()=>{const t=e.metadata.dependsOn||BVi;for(const r of t)if(typeof r!="string"||r.includes(".")){const n=eCt(r);for(let s=0,o=i;s0)for(const t of e)t.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const r of t)r.onCommitted()}}},jVi=class uCt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new uCt;return this._values.forEach((r,n)=>{e&&e.has(n)||t.set(n,li(r))}),t}get(e){return this._values.get(e)}originOf(){return Pn.USER}keys(){return[...this._values.keys()]}set(e,t){this._values.set(e,t)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function Ice(i,e,t){return i!==void 0}function Yit(i,e,t,r){return i!==void 0&&(!(t==null&&i.flags&Nc.NonNullable)||(r.lifecycle,ub.INITIALIZING,!1))}let GVi=class{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=ub.INITIALIZING,this.store=new jVi,this._origin=Pn.USER;const t=this.host.constructor.__accessorMetadata__;for(const r in t){const n=new qit(r,t[r]);this.propertiesByName.set(r,n)}this.metadata=t}initialize(){this.lifecycle=ub.CONSTRUCTING}constructed(){this.lifecycle=ub.CONSTRUCTED}destroy(){this.lifecycle=ub.DESTROYED,this.propertiesByName.forEach(e=>e.destroy())}get initialized(){return this.lifecycle!==ub.INITIALIZING}get(e){const t=this.propertiesByName.get(e);if(t.metadata.get)return t.getComputed(this);Ws(t);const r=this.store;return r.has(e)?r.get(e):t.metadata.value}originOf(e){const t=this.store.originOf(e);if(t===void 0){const r=this.propertiesByName.get(e);if(r!==void 0&&r.flags&Nc.HasDefaultValue)return"defaults"}return yne(t)}has(e){return this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const t=this.propertiesByName.get(e);if(Ice(t))return this.store.has(e)?this.store.get(e):t.metadata.value}internalSet(e,t){const r=this.propertiesByName.get(e);Ice(r)&&this._internalSet(r,t)}getDependsInfo(e,t,r){const n=this.propertiesByName.get(t);if(!Ice(n))return"";const s=new Set,o=oR({onObservableAccessed:l=>s.add(l),onTrackingEnd:()=>{}},()=>n.metadata.get?.call(e));let a=`${r}${e.declaredClass.split(".").pop()}.${t}: ${o} + 🔗 See ${s} for more details.`),bVi(i,a,o)}}function wVi(i){const e=[];return function*(){yield*e;for(const t of i)e.push(t),yield t}}function die(i,e){for(const t of i)if(t!=null&&e(t))return t}function pve(i){return i!=null&&typeof i[Symbol.iterator]=="function"}let cY=class k4e{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach(t=>{e+=t.length}),e}add(e,t){if(pve(e)){const r=this._getOrCreateGroup(t);for(const n of e)this._isHandle(n)&&r.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(t).push(e);return this}forEach(e,t){if(typeof e=="function")this._groups.forEach(r=>r.forEach(e));else{const r=this._getGroup(e);r&&t&&r.forEach(t)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&pve(e)){for(const t of e)this.remove(t);return this}return this.has(e)?(this._removeAllFromGroup(this._getGroup(e)),this._groups.delete(this._ensureGroupKey(e)),this):this}removeAll(){return this._groups.forEach(e=>this._removeAllFromGroup(e)),this._groups.clear(),this}_isHandle(e){return e&&(!!e.remove||e instanceof k4e)}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(this._ensureGroupKey(e),t),t}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){for(const t of e)t instanceof k4e?t.removeAll():t.remove()}};function Of(i,e){if(i==null)throw new Error(e??"value is None")}function zo(i){return i?.destroy(),null}function ba(i){return i?.dispose(),null}function Hc(i){return i?.remove(),null}function zF(i){return i?.abort(),null}function e4(i){return i?.release(),null}function gne(i,e,t){return i!=null&&e!=null?t!=null?t(i,e):i.equals(e):i===e}function xVi(i,e){let t;return i.some((r,n)=>(t=e(r,n),t!=null)),t??void 0}const QTt=Symbol("Accessor-beforeDestroy"),SVi={remove:()=>{}};function wa(i){return i?{remove(){i&&(i(),i=void 0)}}:SVi}function TVi(i){i.forEach(e=>e?.remove())}function j3(i){return wa(()=>TVi(i))}function Kp(i){return i.__accessor__??null}function CVi(i,e){return i?.metadata?.[e]!=null}function Ufe(i,e,t){return t?fve(i,e,{policy:t,path:""}):fve(i,e,null)}function fve(i,e,t){return e?Object.keys(e).reduce((r,n)=>{const s=n;let o=null,a="merge";if(t&&(o=t.path?`${t.path}.${n}`:n,a=t.policy(o)),a==="replace"||a==="replace-arrays"&&Array.isArray(r[s]))return r[s]=e[s],r;if(r[s]===void 0)return r[s]=li(e[s]),r;let l=r[s],u=e[s];if(l===u)return r;if(Array.isArray(u)||Array.isArray(r))l=l?Array.isArray(l)?r[s]=l.concat():r[s]=[l]:r[s]=[],u&&(Array.isArray(u)||(u=[u]),u.forEach(c=>{l.includes(c)||l.push(c)}));else if(u&&typeof u=="object")if(t){const c=t.path;t.path=o,r[s]=fve(l,u,t),t.path=c}else r[s]=fve(l,u,null);else r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[s]=u);return r},i||{}):i}function eCt(i){return Array.isArray(i)?i:i.split(".")}function Vit(i){return i.includes(",")?i.split(",").map(e=>e.trim()):[i.trim()]}function EVi(i){if(Array.isArray(i)){const e=[];for(const t of i)e.push(...Vit(t));return e}return Vit(i)}function tCt(i,e,t,r){const n=EVi(e);if(n.length!==1){const s=n.map(o=>r(i,o,t));return j3(s)}return r(i,n[0],t)}function iCt(i,e){const t=i[i.length-1]==="?"?i.slice(0,-1):i;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(t,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.at(n)}const r=Kp(e);return CVi(r,t)?r.get(t):e[t]}function rCt(i,e,t){if(i==null)return i;const r=iCt(e[t],i);return!r&&t=this._pool.length)){for(let t=e;t0){if(!(n+r{},onTrackingEnd:()=>{}},GZ=[];let pie=mve;function Ws(i){pie.onObservableAccessed(i)}let zfe=!1,Vfe=!1;function oR(i,e,t){if(zfe)return VUe(i,e,t);sCt(i);const r=e.call(t);return oCt(),r}function kVi(i,e){return oR(mve,i,e)}function VUe(i,e,t){const r=zfe;zfe=!0,sCt(i);let n=null;try{n=e.call(t)}catch(s){Vfe&&di.getLogger("esri.core.accessorSupport.tracking").error(s)}return oCt(),zfe=r,n}function sCt(i){pie=i,GZ.push(i)}function oCt(){const i=GZ.length;if(i>1){const e=GZ.pop();pie=GZ[i-2],e.onTrackingEnd()}else if(i===1){const e=GZ.pop();pie=mve,e.onTrackingEnd()}else pie=mve}function aCt(i,e){if(e.flags&Nc.DepTrackingInitialized)return;const t=Vfe;Vfe=!1,e.flags&Nc.AutoTracked?VUe(e,e.metadata.get,i):lCt(i,e),Vfe=t}const LVi=[];function lCt(i,e){e.flags&Nc.ExplicitlyTracking||(e.flags|=Nc.ExplicitlyTracking,VUe(e,()=>{const t=e.metadata.dependsOn||LVi;for(const r of t)if(typeof r!="string"||r.includes(".")){const n=eCt(r);for(let s=0,o=i;s0)for(const t of e)t.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const r of t)r.onCommitted()}}},NVi=class uCt{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new uCt;return this._values.forEach((r,n)=>{e&&e.has(n)||t.set(n,li(r))}),t}get(e){return this._values.get(e)}originOf(){return Pn.USER}keys(){return[...this._values.keys()]}set(e,t){this._values.set(e,t)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function Ice(i,e,t){return i!==void 0}function Yit(i,e,t,r){return i!==void 0&&(!(t==null&&i.flags&Nc.NonNullable)||(r.lifecycle,ub.INITIALIZING,!1))}let $Vi=class{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=ub.INITIALIZING,this.store=new NVi,this._origin=Pn.USER;const t=this.host.constructor.__accessorMetadata__;for(const r in t){const n=new qit(r,t[r]);this.propertiesByName.set(r,n)}this.metadata=t}initialize(){this.lifecycle=ub.CONSTRUCTING}constructed(){this.lifecycle=ub.CONSTRUCTED}destroy(){this.lifecycle=ub.DESTROYED,this.propertiesByName.forEach(e=>e.destroy())}get initialized(){return this.lifecycle!==ub.INITIALIZING}get(e){const t=this.propertiesByName.get(e);if(t.metadata.get)return t.getComputed(this);Ws(t);const r=this.store;return r.has(e)?r.get(e):t.metadata.value}originOf(e){const t=this.store.originOf(e);if(t===void 0){const r=this.propertiesByName.get(e);if(r!==void 0&&r.flags&Nc.HasDefaultValue)return"defaults"}return yne(t)}has(e){return this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const t=this.propertiesByName.get(e);if(Ice(t))return this.store.has(e)?this.store.get(e):t.metadata.value}internalSet(e,t){const r=this.propertiesByName.get(e);Ice(r)&&this._internalSet(r,t)}getDependsInfo(e,t,r){const n=this.propertiesByName.get(t);if(!Ice(n))return"";const s=new Set,o=oR({onObservableAccessed:l=>s.add(l),onTrackingEnd:()=>{}},()=>n.metadata.get?.call(e));let a=`${r}${e.declaredClass.split(".").pop()}.${t}: ${o} `;if(s.size===0)return a;r+=" ";for(const l of s)l instanceof qit&&(a+=`${r}${l.propertyName}: undefined -`);return a}setAtOrigin(e,t,r){const n=this.propertiesByName.get(e);if(Ice(n))return this._setAtOrigin(n,t,r)}isOverridden(e){const t=this.propertiesByName.get(e);return t!==void 0&&!!(t.flags&Nc.Overridden)}clearOverride(e){const t=this.propertiesByName.get(e);t&&t.flags&Nc.Overridden&&(t.flags&=~Nc.Overridden,t.notifyChange())}override(e,t){const r=this.propertiesByName.get(e);if(!Yit(r,e,t,this))return;const n=r.metadata.cast;if(n){const s=this._cast(n,t),{valid:o,value:a}=s;if(VAe.release(s),!o)return;t=a}r.flags|=Nc.Overridden,this._internalSet(r,t)}set(e,t){const r=this.propertiesByName.get(e);if(!Yit(r,e,t,this))return;const n=r.metadata.cast;if(n){const o=this._cast(n,t),{valid:a,value:l}=o;if(VAe.release(o),!a)return;t=l}const s=r.metadata.set;s?s.call(this.host,t):this._internalSet(r,t)}setDefaultOrigin(e){this._origin=n0(e)}getDefaultOrigin(){return yne(this._origin)}notifyChange(e){const t=this.propertiesByName.get(e);t!==void 0&&t.notifyChange()}invalidate(e){const t=this.propertiesByName.get(e);t!==void 0&&t.invalidate()}commit(e){const t=this.propertiesByName.get(e);t!==void 0&&t.commit()}_internalSet(e,t){const r=this.lifecycle!==ub.INITIALIZING?this._origin:Pn.DEFAULTS;this._setAtOrigin(e,t,r)}_setAtOrigin(e,t,r){const n=this.store,s=e.propertyName;n.has(s,r)&&jUe(t,n.get(s))&&~e.flags&Nc.Overridden&&r===n.originOf(s)||(e.invalidate(),n.set(s,t,r),e.commit(),aCt(this.host,e))}_cast(e,t){const r=VAe.acquire();return r.valid=!0,r.value=t,e&&(r.value=e.call(this.host,t,r)),r}},UVi=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const VAe=new G3(UVi);function gve(i,e,t){if(i&&e)if(typeof e=="object")for(const r of Object.getOwnPropertyNames(e))gve(i,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(-1,1)[0];return void gve(_S(i,n),s,t)}const r=i.__accessor__;r!=null&&zVi(e,r),i[e]=t}}function zVi(i,e){if(yi("esri-unknown-property-errors")&&!VVi(i,e))throw new qe("set:unknown-property",HVi(i,e))}function VVi(i,e){return e.metadata[i]!=null}function HVi(i,e){return"setting unknown property '"+i+"' on instance of "+e.host.declaredClass}let WVi;function qVi(){return WVi}var Xit;(function(i){i[i.Ignore=0]="Ignore",i[i.Destroy=1]="Destroy",i[i.ThrowError=2]="ThrowError"})(Xit||(Xit={}));function YVi(i){i.length=0}let Ky=class{constructor(e=50,t=50){this._pool=new G3(Array,void 0,YVi,t,e)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return HAe.acquire()}static release(e){return HAe.release(e)}static prune(){HAe.prune()}};const HAe=new Ky(100);let cCt=class extends G3{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const t=super.acquire(...e);return this._set.delete(t),t}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const Ace=[];function z9(i){Ace.push(i),Ace.length===1&&queueMicrotask(()=>{const e=Ace.slice();Ace.length=0;for(const t of e)t()})}let fie=class{constructor(e,t=30){this.name=e,this._counter=0,this._samples=new Array(t)}record(e){e!=null&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,t)=>e-t)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,t)=>e+t,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var $4e;(function(i){const e=(s,o,a,l)=>{let u=o,c=o;const h=a>>>1,p=s[u-1];for(;c<=h;){c=u<<1,cso?1:0;function r(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=t);for(let c=a>>>1;c>o;c--)e(s,c,a,l);const u=o+1;for(let c=a-1;c>o;c--){const h=s[o];s[o]=s[c],s[c]=h,e(s,u,c,l)}}function*n(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=t);for(let c=a>>>1;c>o;c--)e(s,c,a,l),yield;const u=o+1;for(let c=a-1;c>o;c--){const h=s[o];s[o]=s[c],s[c]=h,e(s,u,c,l),yield}}i.sort=r,i.iterableSort=n})($4e||($4e={}));const Jit=$4e,XVi=1.5,JVi=1.1;let mg=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new Yxe,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),e.deallocator!==void 0&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>Kit(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const t=new Array;for(let r=0;r=this._length))return this.data[e]}includes(e,t){const r=this.data.indexOf(e,t);return r!==-1&&rthis._length){if(this._allocator){for(;this._length=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=hVi(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;const r=this.data[e];this.data[e]=this.data[t],this.data[t]=r}sort(e){Jit.sort(this.data,0,this.length,e)}iterableSort(e){return Jit.iterableSort(this.data,0,this.length,e)}some(e,t){for(let r=0;rXVi*i.length&&(i.data.length=Math.floor(i.length*JVi))}function KVi(i){return{setTimeout:(e,t)=>{const r=i.setTimeout(e,t);return wa(()=>i.clearTimeout(r))}}}const hY=KVi(globalThis);function e2e(i){return ZVi(i)||hCt(i)}function ZVi(i){return i!=null&&typeof i=="object"&&"on"in i&&typeof i.on=="function"}function hCt(i){return i!=null&&typeof i=="object"&&"addEventListener"in i&&typeof i.addEventListener=="function"}function BA(i,e,t){if(!e2e(i))throw new TypeError("target is not a Evented or EventTarget object");return hCt(i)?QVi(i,e,t):i.on(e,t)}function QVi(i,e,t,r){if(Array.isArray(e)){const n=e.slice();for(const s of n)i.addEventListener(s,t,r);return wa(()=>{for(const s of n)i.removeEventListener(s,t,r)})}return i.addEventListener(e,t,r),wa(()=>i.removeEventListener(e,t,r))}function HUe(i,e,t){if(!e2e(i))throw new TypeError("target is not a Evented or EventTarget object");if("once"in i)return i.once(e,t);const r=BA(i,e,n=>{r.remove(),t.call(i,n)});return r}function Oc(i="Aborted"){return new qe("AbortError",i)}function hn(i,e="Aborted"){if(xg(i))throw Oc(e)}function D1(i){return i instanceof AbortSignal?i:i?.signal}function xg(i){const e=D1(i);return e!=null&&e.aborted}function _a(i){if(mo(i))throw i}function l3(i){if(!mo(i))throw i}function Qh(i,e){const t=D1(i);if(t!=null){if(!t.aborted)return HUe(t,"abort",()=>e());e()}}function ZH(i,e){const t=D1(i);if(t!=null)return hn(t),HUe(t,"abort",()=>e(Oc()))}function Jg(i,e){return D1(e)==null?i:new Promise((t,r)=>{let n=Qh(e,()=>r(Oc()));const s=()=>{n=Hc(n)};i.then(s,s),i.then(t,r)})}function mo(i){return i?.name==="AbortError"}async function NP(i){try{return await i}catch(e){if(!mo(e))throw e;return}}async function g0(i){if(!i)return;if(typeof i.forEach!="function"){const t=Object.keys(i),r=t.map(o=>i[o]),n=await g0(r),s={};return t.map((o,a)=>s[o]=n[a]),s}const e=i;return Promise.allSettled(e).then(t=>Array.from(e,(r,n)=>{const s=t[n];return s.status==="fulfilled"?{promise:r,value:s.value}:{promise:r,error:s.reason}}))}async function yve(i){return(await Promise.allSettled(i)).filter(e=>e.status==="fulfilled").map(e=>e.value)}async function eHi(i){return(await Promise.allSettled(i)).filter(e=>e.status==="rejected").map(e=>e.reason)}function jk(i,e=void 0,t){const r=new AbortController;return Qh(t,()=>r.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},i);Qh(r,()=>{o&&(clearTimeout(o),s(Oc()))})})}function tHi(i,e){const t=new AbortController,r=setTimeout(()=>t.abort(),e);return Qh(i,()=>{t.abort(),clearTimeout(r)}),{...i,signal:t.signal}}function qp(i){return i&&typeof i.then=="function"}function B4e(i){return qp(i)?i:Promise.resolve(i)}function xd(i,e=-1){let t,r,n,s,o=null;const a=(...l)=>{if(t){r=l,s&&s.reject(Oc()),s=ac();const p=s.promise;if(o){const m=o;o=null,m.abort()}return p}if(n=s||ac(),s=null,e>0){const p=new AbortController;t=B4e(i(...l,p.signal));const m=t;jk(e).then(()=>{t===m&&(s?p.abort():o=p)})}else t=1,t=B4e(i(...l));const u=()=>{const p=r;r=n=t=o=null,p!=null&&a(...p)},c=t,h=n;return c.then(u,u),c.then(h.resolve,h.reject),h.promise};return a}function ac(){let i,e;const t=new Promise((n,s)=>{i=n,e=s}),r=n=>{i(n)};return r.resolve=n=>i(n),r.reject=n=>e(n),r.timeout=(n,s)=>hY.setTimeout(()=>r.reject(s),n),r.promise=t,r}async function vve(i){await Promise.resolve(),hn(i)}function dCt(i){return 1e3*i}let iHi=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},rHi=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},j4e=0;const _J={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},G4e=["prepare","preRender","render","postRender","update","finish"],U4e=[],V9=new mg;let nHi=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};function sHi(){V8!=null&&(cancelAnimationFrame(V8),V8=requestAnimationFrame(WUe))}const _ve={frameTasks:V9,willDispatch:!1,clearFrameTasks:oHi,dispatch:fCt,executeFrameTasks:aHi,reschedule:sHi};function Gk(i){const e=new rHi(i);return U4e.push(e),_ve.willDispatch||(_ve.willDispatch=!0,z9(fCt)),e}function H9(i){const e=new iHi(i);return V9.push(e),V8==null&&(j4e=performance.now(),V8=requestAnimationFrame(WUe)),new nHi(e)}let V8=null;function oHi(i=!1){V9.forAll(e=>{e.removed=!0}),i&&pCt()}function WUe(){const i=performance.now();V8=null,V8=V9.length>0?requestAnimationFrame(WUe):null,_ve.executeFrameTasks(i)}function aHi(i){const e=i-j4e;j4e=i;const t=1e3/60,r=Math.max(0,e-t);_J.time=i,_J.frameDuration=t-r;for(let n=0;n{a.paused||a.removed||(n===0&&a.ticks++,a.phases[o]&&(_J.elapsedFrameTime=performance.now()-i,_J.deltaTime=a.ticks===0?0:e,a.phases[o]?.call(a,_J)))}),uHi[n].record(performance.now()-s)}pCt(),cHi.record(performance.now()-i)}const Mce=new mg;function pCt(){V9.forAll(i=>{i.removed&&Mce.push(i)}),V9.removeUnorderedMany(Mce.data,Mce.length),Mce.clear()}function fCt(){for(;U4e.length;){const i=U4e.shift();i.isActive&&i.callback()}_ve.willDispatch=!1}function lHi(i=1,e){const t=ac(),r=()=>{xg(e)?t.reject(Oc()):i===0?t():(--i,z9(()=>r()))};return r(),t.promise}const uHi=G4e.map(i=>new fie(i)),cHi=new fie("total");function hHi(i,e){for(const t of i.entries())if(e(t[0]))return!0;return!1}function Zit(i,e){if(!e)return i;for(const t of e)i.add(t);return i}function bve(i,e){const t=new Set;return Zit(t,i),Zit(t,e),t}function z4e(i,e){const t=new Set;for(const r of e)i.has(r)&&t.add(r);return t}function V4e(i,e){if(!i||!e)return!1;if(i===e)return!0;for(const t of i)if(!e.has(t))return!1;return!0}function dHi(i,e){if(i==null&&e==null)return!0;if(i==null||e==null||i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0}function mCt(i,e){const t=new Set(i);for(const r of e)t.delete(r);return t}function pHi(i,e){return mCt(bve(i,e),z4e(i,e))}let fHi=0;function vF(){return++fHi}let t2e=class{constructor(e){this._accessed=[],this._handles=[],this._observerObject=new mHi(e),Qit.register(this,new WeakRef(this._observerObject),this)}destroy(){Qit.unregister(this._observerObject),this._accessed.length=0,this._observerObject?.destroy(),this.clear()}onObservableAccessed(e){const t=this._accessed;t.includes(e)||t.push(e)}onTrackingEnd(){const e=this._handles,t=this._accessed,r=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=gHi}};const Qit=new FinalizationRegistry(i=>{i.deref()?.destroy()});function gHi(){}let OV=!1;const wve=[];function gCt(i,e){let t=new t2e(s),r=null,n=!1;function s(){if(!t||n)return;if(OV)return void _Ct(s);const a=r;t.clear(),OV=!0,n=!0,r=oR(t,i),n=!1,OV=!1,e(r,a),bCt()}function o(){t&&(t.destroy(),t=null,r=null)}return n=!0,r=oR(t,i),n=!1,wa(o)}function yCt(i,e){let t=new t2e(n),r=null;function n(){e(r,o)}function s(){t&&(t.destroy(),t=null),r=null}function o(){return t?(t.clear(),r=oR(t,i),r):null}return o(),wa(s)}function vCt(i){let e=new t2e(r),t=!1;function r(){e&&!t&&(OV?_Ct(r):(e.clear(),OV=!0,t=!0,oR(e,i),t=!1,OV=!1,bCt()))}function n(){e&&(e.destroy(),e=null)}return t=!0,oR(e,i),t=!1,wa(n)}function _Ct(i){wve.includes(i)||wve.unshift(i)}function bCt(){for(;wve.length;)wve.pop()()}var mie;(function(i){i[i.Untracked=0]="Untracked",i[i.Tracked=1]="Tracked"})(mie||(mie={}));let vne=class{constructor(){this.uid=vF(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,t,r,n,s){return this.pool.acquire(mie.Untracked,e,t,r,n,s,jUe)}static acquireTracked(e,t,r,n){return this.pool.acquire(mie.Tracked,e,t,r,null,null,n)}notify(e,t){this.type===mie.Untracked?this.callback.call(this.target,e,t,this.path,this.target):this.callback.call(null,e,t,void 0,void 0)}acquire(e,t,r,n,s,o,a){this.uid=vF(),this.removed=!1,this.type=e,this.oldValue=t,this.callback=r,this.getValue=n,this.target=s,this.path=o,this.equals=a}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=vF(),this.removed=!0}};vne.pool=new cCt(vne);const Hfe=new Ky,$P=new Set;let xve;function Sve(i){$P.delete(i),$P.add(i),xve||(xve=Gk(_Hi))}function yHi(i){if(i.removed)return;const e=i.oldValue,t=i.getValue();i.equals(e,t)||(i.oldValue=t,i.notify(t,e))}function vHi(i){for(const e of $P.values())e.target===i&&(e.removed=!0)}function _Hi(){let i=10;for(;xve&&i--;){xve=null;const e=bHi(),t=Hfe.acquire();for(const r of e){const n=r.uid;yHi(r),n===r.uid&&r.removed&&t.push(r)}for(const r of $P)r.removed&&(t.push(r),$P.delete(r));for(const r of t)vne.pool.release(r);Hfe.release(t),Hfe.release(e),H4e.forEach(r=>r())}}function bHi(){const i=Hfe.acquire();i.length=$P.size;let e=0;for(const t of $P)i[e]=t,++e;return $P.clear(),i}const H4e=new Set;function wHi(i){return H4e.add(i),wa(()=>H4e.delete(i))}function xHi(i,e,t){let r=tCt(i,e,t,(n,s,o)=>{let a,l,u=yCt(()=>Xoe(n,s),(c,h)=>{n.__accessor__?.lifecycle===ub.DESTROYED||a&&a.uid!==l?r.remove():(a||(a=vne.acquireUntracked(c,o,h,n,s),l=a.uid),Sve(a))});return wa(()=>{u.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,Sve(a)),a=null),r=u=null})});return r}function SHi(i,e,t){const r=tCt(i,e,t,(n,s,o)=>{let a=!1;return gCt(()=>Xoe(n,s),(l,u)=>{n.__accessor__.lifecycle!==ub.DESTROYED?a||(a=!0,jUe(u,l)||o.call(n,l,u,s,n),a=!1):r.remove()})});return r}function THi(i,e,t,r=!1){return i.__accessor__&&i.__accessor__.lifecycle!==ub.DESTROYED?r?SHi(i,e,t):xHi(i,e,t):wa()}function CHi(i,e,t){let r,n,s=yCt(i,(o,a)=>{r&&r.uid!==n?s.remove():(r||(r=vne.acquireTracked(o,e,a,t),n=r.uid),Sve(r))});return wa(()=>{s.remove(),r&&(r.uid!==n||r.removed||(r.removed=!0,Sve(r)),r=null),s=null})}function EHi(i,e,t){let r=!1;return gCt(i,(n,s)=>{r||(r=!0,t(s,n)||e(n,s),r=!1)})}function IHi(i,e,t=!1,r=YTt){return t?EHi(i,e,r):CHi(i,e,r)}function ert(i){return hHi($P,e=>e.oldValue===i)}function i2e(i,e){for(const[t,r]of i)if(e(r,t))return!0;return!1}function qh(i,e,t){const r=i.get(e);if(r!==void 0)return r;const n=t();return i.set(e,n),n}function AHi(i){const e=new Map;return t=>(e.has(t)||e.set(t,i(t)),e.get(t))}const PV=()=>di.getLogger("esri.core.accessorSupport.ensureTypes");function MHi(i){return i==null?i:new Date(i)}function OHi(i){return i==null?i:!!i}function Zoe(i){return i==null?i:i.toString()}function Gd(i){return i==null?i:(i=parseFloat(i),isNaN(i)?0:i)}function r2e(i){return i==null?i:Math.round(parseFloat(i))}function wCt(i){return i?.constructor&&i.constructor.__accessorMetadata__!==void 0}function Tve(i,e){return e!=null&&i&&!(e instanceof i)}function xCt(i){return i&&"isCollection"in i}function trt(i){return i?.Type?typeof i.Type=="function"?i.Type:i.Type.base:null}function PHi(i,e){if(!e?.constructor||!xCt(e.constructor))return W4e(i,e)?e:new i(e);const t=trt(i.prototype.itemType),r=trt(e.constructor.prototype.itemType);return t?r?t===r?e:t.prototype.isPrototypeOf(r.prototype)?new i(e):(W4e(i,e),e):new i(e):e}function W4e(i,e){return!!wCt(e)&&(PV().error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+n2e(i)+"'"),!0)}function Cu(i,e){return e==null?e:xCt(i)?PHi(i,e):Tve(i,e)?W4e(i,e)?e:new i(e):e}function n2e(i){return i?.prototype?.declaredClass||"unknown"}const RHi=new WeakMap;function DHi(i){switch(i){case Number:return Gd;case ms:return r2e;case Boolean:return OHi;case String:return Zoe;case Date:return MHi;default:return qh(RHi,i,()=>Cu.bind(null,i))}}function Sd(i,e){const t=DHi(i);return arguments.length===1?t:t(e)}function _ne(i,e,t){return arguments.length===1?_ne.bind(null,i):e&&(Array.isArray(e)?e.map(r=>i(r,t)):[i(e,t)])}function FHi(i,e){return arguments.length===1?_ne(t=>Sd(i,t)):_ne(t=>Sd(i,t),e)}function SCt(i,e,t){return e!==0&&Array.isArray(t)?t.map(r=>SCt(i,e-1,r)):i(t)}function Cve(i,e,t){if(arguments.length===2)return s=>Cve(i,e,s);if(!t)return t;t=SCt(i,e,t);let r=e,n=t;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(n!==void 0)for(let s=0;sSd(i,r),e):Cve(r=>Sd(i,r),e,t)}function TCt(i){return!!Array.isArray(i)&&!i.some(e=>{const t=typeof e;return!(t==="string"||t==="number"||t==="function"&&i.length>1)})}function q4e(i,e){if(arguments.length===2)return q4e(i).call(null,e);const t=new Set,r=i.filter(a=>typeof a!="function"),n=i.filter(a=>typeof a=="function");for(const a of i)typeof a!="string"&&typeof a!="number"||t.add(a);let s=null,o=null;return(a,l)=>{if(a==null)return a;const u=typeof a,c=u==="string"||u==="number";return c&&(t.has(a)||n.some(h=>u==="string"&&h===String||u==="number"&&h===Number))||u==="object"&&n.some(h=>!Tve(a,h))?a:(c&&r.length?(s||(s=r.map(h=>typeof h=="string"?`'${h}'`:`${h}`).join(", ")),PV().error("Accessor#set",`'${a}' is not a valid value for this property, only the following values are valid: ${s}`)):typeof a=="object"&&n.length?(o||(o=n.map(h=>n2e(h)).join(", ")),PV().error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):PV().error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function u3(i,e){if(arguments.length===2)return u3(i).call(null,e);const t={},r=[],n=[];for(const l in i.typeMap){const u=i.typeMap[l];t[l]=Sd(u),r.push(n2e(u)),n.push(l)}const s=()=>`'${r.join("', '")}'`,o=()=>`'${n.join("', '")}'`,a=typeof i.key=="string"?l=>l[i.key]:i.key;return l=>{if(i.base&&!Tve(i.base,l)||l==null)return l;const u=a(l)||i.defaultKeyValue,c=t[u];if(!c)return PV().error("Accessor#set",`Invalid property value, value needs to be one of ${s()}, or a plain object that can autocast (having .type = ${o()})`),null;if(!Tve(i.typeMap[u],l))return l;if(typeof i.key=="string"&&!wCt(l)){const h={};for(const p in l)p!==i.key&&(h[p]=l[p]);return c(h)}return c(l)}}let ms=class{};const bJ={native:i=>({type:"native",value:i}),array:i=>({type:"array",value:i}),oneOf:i=>({type:"one-of",values:i})};function LHi(i){if(!i||!("type"in i))return!1;switch(i.type){case"native":case"array":case"one-of":return!0}return!1}function CCt(i){switch(i.type){case"native":return Sd(i.value);case"array":return _ne(CCt(i.value));case"one-of":return NHi(i);default:return null}}function NHi(i){let e=null;return(t,r)=>X4e(t,i)?t:(e==null&&(e=Y4e(i)),PV().error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),r&&(r.valid=!1),null)}function Y4e(i){switch(i.type){case"native":switch(i.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case ms:return"integer";case Date:return"date";default:return n2e(i.value)}case"array":return`array of ${Y4e(i.value)}`;case"one-of":{const e=i.values.map(t=>Y4e(t));return`one of ${e.slice(0,-1)} or ${e[e.length-1]}`}}return"unknown"}function X4e(i,e){if(i==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case ms:return typeof i=="number";case Boolean:return typeof i=="boolean";case String:return typeof i=="string"}return i instanceof e.value;case"array":return!!Array.isArray(i)&&!i.some(t=>!X4e(t,e.value));case"one-of":return e.values.some(t=>X4e(i,t))}}function D(i={}){return(e,t)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${t}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(e,t),n=Koe(e,t);r&&(r.get||r.set?(n.get=r.get||n.get,n.set=r.set||n.set):"value"in r&&("value"in i&&di.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${t}" on "${e.constructor.name}" already defined in the metadata`,i),n.value=i.value=r.value)),i.readOnly!=null&&(n.readOnly=i.readOnly);const s=i.aliasOf;if(s){const l=typeof s=="string"?s:s.source,u=typeof s=="string"?null:s.overridable===!0;let c;n.dependsOn=[l],n.get=function(){let h=_S(this,l);if(typeof h=="function"){c||(c=l.split(".").slice(0,-1).join("."));const p=_S(this,c);p&&(h=h.bind(p))}return h},n.readOnly||(n.set=u?function(h){this._override(t,h)}:function(h){gve(this,l,h)})}const o=i.type,a=i.types;n.cast||(o?n.cast=$Hi(o):a&&(Array.isArray(a)?n.cast=_ne(u3(a[0])):n.cast=u3(a))),OVi(n,i),i.range&&(n.cast=ECt(n.cast,i.range))}}function qUe(i,e,t){const r=Koe(i,t);r.json||(r.json={});let n=r.json;return e!==void 0&&(n.origins||(n.origins={}),n.origins[e]||(n.origins[e]={}),n=n.origins[e]),n}function $Hi(i){let e=0,t=i;if(LHi(i))return CCt(i);for(;Array.isArray(t)&&t.length===1&&typeof t[0]!="string"&&typeof t[0]!="number";)t=t[0],e++;const r=t;if(TCt(r))return e===0?q4e(r):Cve(q4e(r),e);if(e===1)return FHi(r);if(e>1)return kHi(r,e);const n=i;return n.from?n.from:Sd(n)}function ECt(i,e){return t=>{let r=+i(t);return e.step!=null&&(r=Math.round(r/e.step)*e.step),e.min!=null&&(r=Math.max(e.min,r)),e.max!=null&&(r=Math.min(e.max,r)),r}}function BHi(i){if(i.json&&i.json.origins){const e=i.json.origins,t={"web-document":["web-scene","web-map"]};for(const r in t)if(e[r]){const n=e[r];t[r].forEach(s=>{e[s]=n}),delete e[r]}}}let Rf=class extends KTt{constructor(e,t,r){super(e,t,r)}};Rf.prototype.type="warning";function ICt(i){return!!i&&i.prototype?.declaredClass&&i.prototype.declaredClass.indexOf("esri.core.Collection")===0}const J4e=()=>di.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function irt(i,e,t){i&&(!t&&!e.read||e.read?.reader||e.read?.enabled===!1||UHi(i)&&Qp("read.reader",zB(i),e))}function zB(i){const e=i.ndimArray??0;if(e>1)return GHi(i);if(e===1)return rrt(i);if("type"in i&&MCt(i.type)){const t=i.type.prototype?.itemType?.Type,r=rrt(typeof t=="function"?{type:t}:{types:t});return(n,s,o)=>{const a=r(n,s,o);return a&&new i.type(a)}}return YUe(i)}function YUe(i){return"type"in i?jHi(i.type):zHi(i.types)}function jHi(i){return i.prototype.read?(e,t,r)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void J4e().error(`Expected JSON value of type 'object' to deserialize type '${i.prototype.declaredClass}', but got '${n}'`);const s=new i;return s.read(e,r),s}:i.fromJSON}function ACt(i,e,t,r){return r!==0&&Array.isArray(e)?e.map(n=>ACt(i,n,t,r-1)):i(e,void 0,t)}function GHi(i){const e=YUe(i),t=ACt.bind(null,e),r=i.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=t(n,o,r);let a=r,l=n;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let u=0;u{if(t==null)return t;if(Array.isArray(t)){const o=[];for(const a of t){const l=e(a,void 0,n);l!==void 0&&o.push(l)}return o}const s=e(t,void 0,n);return s!==void 0?[s]:void 0}}function MCt(i){if(!ICt(i))return!1;const e=i.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?XUe(e.Type):OCt(e.Type))}function UHi(i){return"types"in i?OCt(i.types):XUe(i.type)}function XUe(i){return!Array.isArray(i)&&!!i&&i.prototype&&("read"in i.prototype||"fromJSON"in i||MCt(i))}function OCt(i){for(const e in i.typeMap)if(!XUe(i.typeMap[e]))return!1;return!0}function zHi(i){let e=null;const t=i.errorContext??"type",r=i.validate;return(n,s,o)=>{if(n==null)return n;const a=typeof n;if(a!=="object")return void J4e().error(`Expected JSON value of type 'object' to deserialize, but got '${a}'`);e||(e=VHi(i));const l=i.key;if(typeof l!="string")return;const u=n[l],c=u?e[u]:i.defaultKeyValue?i.typeMap[i.defaultKeyValue]:void 0;if(!c){const p=`Type '${u||"unknown"}' is not supported`;return o?.messages&&n&&o.messages.push(new Rf(`${t}:unsupported`,p,{definition:n,context:o})),void J4e().error(p)}const h=new c;return h.read(n,o),r?r(h):h}}function VHi(i){const e={};for(const t in i.typeMap){const r=i.typeMap[t],n=Joe(r.prototype);if(typeof i.key=="function")continue;const s=n[i.key];if(!s)continue;s.json?.type&&Array.isArray(s.json.type)&&s.json.type.length===1&&typeof s.json.type[0]=="string"&&(e[s.json.type[0]]=r);const o=s.json?.write;if(!o?.writer){e[t]=r;continue}const a=o.target,l=typeof a=="string"?a:i.key,u={};o.writer(t,u,l),u[l]&&(e[u[l]]=r)}return e}function HHi(i){if(i.json||(i.json={}),srt(i.json),ort(i.json),nrt(i.json),i.json.origins)for(const e in i.json.origins)srt(i.json.origins[e]),ort(i.json.origins[e]),nrt(i.json.origins[e]);return!0}function nrt(i){i.name&&(i.read&&typeof i.read=="object"?i.read.source===void 0&&(i.read.source=i.name):i.read={source:i.name},i.write&&typeof i.write=="object"?i.write.target===void 0&&(i.write.target=i.name):i.write={target:i.name})}function srt(i){typeof i.read=="boolean"?i.read={enabled:i.read}:typeof i.read=="function"?i.read={enabled:!0,reader:i.read}:i.read&&typeof i.read=="object"&&i.read.enabled===void 0&&(i.read.enabled=!0)}function ort(i){typeof i.write=="boolean"?i.write={enabled:i.write}:typeof i.write=="function"?i.write={enabled:!0,writer:i.write}:i.write&&typeof i.write=="object"&&i.write.enabled===void 0&&(i.write.enabled=!0)}function art(i,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const t=i?.ndimArray??0;i&&(t===1||"type"in i&&ICt(i.type))?e.write.writer=YHi:t>1?e.write.writer=XHi(t):e.types?Array.isArray(e.types)?e.write.writer=qHi(e.types[0]):e.write.writer=WHi(e.types):e.write.writer=bne}function WHi(i){return(e,t,r,n)=>e?PCt(e,i,n)?bne(e,t,r,n):void 0:bne(e,t,r,n)}function PCt(i,e,t){for(const r in e.typeMap)if(i instanceof e.typeMap[r])return!0;if(t?.messages){const r=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?i[e.key]:i.declaredClass)??"Unknown"}' cannot be written`;t&&t.messages&&i&&t.messages.push(new qe(`${r}:unsupported`,n,{definition:i,context:t})),di.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function qHi(i){return(e,t,r,n)=>!e||!Array.isArray(e)?bne(e,t,r,n):bne(e.filter(s=>PCt(s,i,n)),t,r,n)}function bne(i,e,t,r){Qp(t,Eve(i,r),e)}function Eve(i,e){return i&&typeof i.write=="function"?i.write({},e):i&&typeof i.toJSON=="function"?i.toJSON():typeof i=="number"?Ive(i):i}function Ive(i){return i===-1/0?-Number.MAX_VALUE:i===1/0?Number.MAX_VALUE:isNaN(i)?null:i}function YHi(i,e,t,r){let n;i===null?n=null:i&&typeof i.map=="function"?(n=i.map(s=>Eve(s,r)),typeof n.toArray=="function"&&(n=n.toArray())):n=[Eve(i,r)],Qp(t,n,e)}function RCt(i,e,t){return t!==0&&Array.isArray(i)?i.map(r=>RCt(r,e,t-1)):Eve(i,e)}function XHi(i){return(e,t,r,n)=>{let s;if(e===null)s=null;else{s=RCt(e,n,i);let o=i,a=s;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{i??="esri.core.Accessor",e.prototype.declaredClass=i,iWi(e);const t=[],r=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!WAe.has(n.initialize)&&(WAe.add(n.initialize),t.push(n.initialize)),n.hasOwnProperty("destroy")&&!qAe.has(n.destroy)&&(qAe.add(n.destroy),r.push(n.destroy)),n=Object.getPrototypeOf(n);WAe.clear(),qAe.clear();const s=class extends e{constructor(...a){if(super(...a),this.constructor===s&&typeof this.postscript=="function"){if(t.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=t.length-1;l>=0;l--)t[l].call(this)}}),r.length){let l=!1;const u=this[QTt];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0,u.call(this);for(let c=0;c0&&this.normalizeCtorArgs&&(t.ctorArgs=this.normalizeCtorArgs.apply(this,e))}postscript(e){const t=this.__accessor__,r=t.ctorArgs||e;t.initialize(),r&&(this.set(r),t.ctorArgs=null),t.constructed(),this.initialize(),this[Q4e]=!0}initialize(){}[QTt](){this[t4]=zo(this[t4])}destroy(){this.destroyed||(vHi(this),this.__accessor__.destroy(),qVi()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[Q4e]}get destroyed(){return this.__accessor__?.lifecycle===ub.DESTROYED||!1}commitProperty(e){_S(this,e)}get(e){return zUe(di.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),_S(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return gve(this,e,t),this}watch(e,t,r){return THi(this,e,t,r)}addHandles(e,t){if(this.destroyed){const n=Array.isArray(e)?e:[e];for(const s of n)s.remove();return}let r=this[t4];r==null&&(r=this[t4]=new cY),r.add(e,t)}removeHandles(e){const t=this[t4];t?.remove(e)}removeAllHandles(){const e=this[t4];e?.removeAll()}hasHandles(e){const t=this[t4];return t!=null&&t.has(e)}_override(e,t){t===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){t==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}};kCt=t4,LCt=Q4e;let nWi=class $Ct{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new $Ct;return this._values.forEach((r,n)=>{e&&e.has(n)||t.set(n,li(r.value),r.origin)}),t}get(e,t){t=this._normalizeOrigin(t);const r=this._values.get(e);return t==null||r?.origin===t?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??Pn.USER}keys(e){e=this._normalizeOrigin(e);const t=[...this._values.keys()];return e==null?t:t.filter(r=>this._values.get(r)?.origin===e)}set(e,t,r){if((r=this._normalizeOrigin(r))===Pn.DEFAULTS){const n=this._values.get(e);if(n?.origin!=null&&n.origin>r)return}this._values.set(e,new sWi(t,r))}delete(e,t){(t=this._normalizeOrigin(t))!=null&&this._values.get(e)?.origin!==t||this._values.delete(e)}has(e,t){return(t=this._normalizeOrigin(t))!=null?this._values.get(e)?.origin===t:this._values.has(e)}forEach(e){this._values.forEach(({value:t},r)=>e(t,r))}_normalizeOrigin(e){if(e!=null)return e===Pn.DEFAULTS?e:Pn.USER}},sWi=class{constructor(e,t){this.value=e,this.origin=t}};function BCt(i,e,t){e.keys().forEach(n=>{t.set(n,e.get(n),Pn.DEFAULTS)});const r=i.metadata;Object.keys(r).forEach(n=>{i.internalGet(n)&&t.set(n,i.internalGet(n),Pn.DEFAULTS)})}function oWi(i,e,t){if(!i?.read||i.read.enabled===!1||!i.read.source)return!1;const r=i.read.source;if(typeof r=="string"){if(r===e||r.includes(".")&&r.indexOf(e)===0&&Hit(r,t))return!0}else for(const n of r)if(n===e||n.includes(".")&&n.indexOf(e)===0&&Hit(n,t))return!0;return!1}function aWi(i){return i&&(!i.read||i.read.enabled!==!1&&!i.read.source)}function lWi(i,e,t,r,n){let s=K4e(e[t],n);aWi(s)&&(i[t]=!0);for(const o of Object.getOwnPropertyNames(e))s=K4e(e[o],n),oWi(s,t,r)&&(i[o]=!0)}function uWi(i,e,t,r){const n=t.metadata,s=JHi(n[e],r),o=s?.default;if(o===void 0)return;const a=typeof o=="function"?o.call(i,e,r):o;a!==void 0&&t.set(e,a)}const jCt={origin:"service"};function GCt(i,e,t=jCt){if(!e||typeof e!="object")return;const r=Kp(i),n=r.metadata,s={};for(const o of Object.getOwnPropertyNames(e))lWi(s,n,o,e,t);r.setDefaultOrigin(t.origin);for(const o of Object.getOwnPropertyNames(s)){const a=K4e(n[o],t).read,l=a?.source;let u;u=l&&typeof l=="string"?Xoe(e,l):e[o],a?.reader&&(u=a.reader.call(i,u,e,t)),u!==void 0&&r.set(o,u)}if(!t||!t.ignoreDefaults){r.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||uWi(i,o,r,t)}r.setDefaultOrigin("user")}function cWi(i,e,t,r=jCt){const n={...r,messages:[]};t(n),n.messages?.forEach(s=>{s.type!=="warning"||i.loaded?r?.messages&&r.messages.push(s):i.loadWarnings.push(s)})}function hWi(i,e,t,r,n){const s={};return e.write?.writer?.call(i,r,s,t,n),s}function UCt(i,e,t,r,n,s){if(!r?.write)return!1;const o=_S(i,t);if(!n&&r.write.overridePolicy){const a=r.write.overridePolicy.call(i,o,t,s??void 0);a!==void 0&&(n=a)}if(n||(n=r.write),!n||n.enabled===!1||n.layerContainerTypes&&s?.layerContainerType&&!n.layerContainerTypes.includes(s.layerContainerType))return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const a=new qe("web-document-write:property-required",`Missing value for required property '${t}' on '${i.declaredClass}'`,{propertyName:t,target:i});return a&&s?.messages?s.messages.push(a):a&&!s&&di.getLogger("esri.core.accessorSupport.write").error(a.name,a.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||!n.alwaysWriteDefaults&&(!e.store.multipleOriginsSupported||e.store.originOf(t)===Pn.DEFAULTS)&&dWi(i,t,s,r,o)||!n.ignoreOrigin&&s?.origin&&e.store.multipleOriginsSupported&&e.store.originOf(t)0&&(e=Ufe(e,l),t?.resources?.pendingOperations?.length&&t.resources.pendingOperations.push(Promise.all(t.resources.pendingOperations).then(()=>Ufe(e,l,()=>"replace-arrays"))),t?.writtenProperties&&t.writtenProperties.push({target:i,propName:s,oldOrigin:NVi(r.store.originOf(s)),newOrigin:t.origin}))}return e}const S0=i=>{let e=class extends i{constructor(...t){super(...t);const r=Kp(this),n=r.store,s=new nWi;r.store=s,BCt(r,n,s)}read(t,r){GCt(this,t,r)}write(t,r){return VCt(this,t??{},r)}toJSON(t){return this.write({},t)}static fromJSON(t,r){return pWi.call(this,t,r)}};return e=x([Qe("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function pWi(i,e){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const t=new this;return t.read(i,e),t}function W9(i){return i&&typeof i=="object"&&"toJSON"in i&&typeof i.toJSON=="function"}let Ci=class extends S0(un){};Ci=x([Qe("esri.core.JSONSupport")],Ci);const fWi=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,mWi={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function e5e(i){const e=i?.match(fWi);if(!e)return null;const[,t,r,n]=e;if(!t)return null;let s=null,o=null,a=null;const{devext:l,qaext:u,www:c}=mWi;if(r)if(s=t,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=u);break;default:return null}else({customBaseUrl:o,portalHostname:a}=c);else switch(t.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=u);break;case"www":({customBaseUrl:o,portalHostname:a}=c);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:s}}function HCt(i){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(i)}function WCt(i){const e=atob(i),t=new Uint8Array(e.length);for(let r=0;rdi.getLogger("esri.core.urlUtils"),dY=Ho.request,lrt="esri/config: esriConfig.request.proxyUrl is not set.",qCt=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,YCt=/^\s*http:/i,vWi=/^\s*https:/i,_Wi=/^\s*file:/i,bWi=/:\d+$/,wWi=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,xWi=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),SWi=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let Qy=class{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(xWi);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),this.authority!=null&&(t=this.authority.match(SWi),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}};const Oce={},TWi=new Qy(Ho.applicationUrl);let Mv=TWi;const CWi=EWi();let KUe=CWi;const ZUe=()=>Mv,XCt=()=>KUe;function EWi(){const i=Mv.path,e=i.substring(0,i.lastIndexOf(i.split("/")[i.split("/").length-1]));return`${`${Mv.scheme}://${Mv.host}${Mv.port!=null?`:${Mv.port}`:""}`}${e}`}function Yo(i){if(!i)return null;const e={path:null,query:null},t=new Qy(i),r=i.indexOf("?");return t.query===null?e.path=i:(e.path=i.substring(0,r),e.query=mP(t.query)),t.fragment&&(e.hash=t.fragment,t.query===null&&(e.path=e.path.substring(0,e.path.length-(t.fragment.length+1)))),e}function mP(i){const e=i.split("&"),t={};for(const r of e){if(!r)continue;const n=r.indexOf("=");let s,o;n<0?(s=decodeURIComponent(r),o=""):(s=decodeURIComponent(r.slice(0,n)),o=decodeURIComponent(r.slice(n+1)));let a=t[s];typeof a=="string"&&(a=t[s]=[a]),Array.isArray(a)?a.push(o):t[s]=o}return t}function Lb(i,e){return i?e&&typeof e=="function"?Object.keys(i).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e(t,i[t]))).join("&"):Object.keys(i).map(t=>{const r=i[t];if(r==null)return"";const n=encodeURIComponent(t)+"=",s=e?.[t];return s?n+encodeURIComponent(s(r)):Array.isArray(r)?r.map(o=>W9(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):W9(r)?n+encodeURIComponent(JSON.stringify(r)):n+encodeURIComponent(r)}).filter(t=>t).join("&"):""}function IWi(i=!1){let e,t=dY.proxyUrl;if(typeof i=="string"){e=eEt(i);const r=Qoe(i);r&&(t=r.proxyUrl)}else e=!!i;if(!t)throw yWi().warn(lrt),new qe("urlUtils:proxy-not-set",lrt);return e&&t5e()&&(t=wne(t)),Yo(t)}function JCt(i){const e=Qoe(i);let t,r;if(e){const n=QUe(e.proxyUrl);t=n.path,r=n.query?mP(n.query):null}if(t){const n=Yo(i);i=t+"?"+n.path;const s=Lb({...r,...n.query});s&&(i=`${i}?${s}`)}return i}const wJ={path:"",query:""};function QUe(i){const e=i.indexOf("?");return e!==-1?(wJ.path=i.slice(0,e),wJ.query=i.slice(e+1)):(wJ.path=i,wJ.query=null),wJ}function KCt(i){return i=(i=Mve(i=tEt(i=QUe(i).path),!0)).toLowerCase()}function AWi(i){const e={proxyUrl:i.proxyUrl,urlPrefix:KCt(i.urlPrefix)},t=dY.proxyRules,r=e.urlPrefix;let n=t.length;for(let s=0;s0?i.substring(0,e):i.replace(/\/+$/,"")}function ZCt(i){const e=r=>r==null||r instanceof RegExp&&r.test(i)||typeof r=="string"&&i.startsWith(r),t=dY.interceptors;if(t){for(const r of t)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r}return null}function _v(i,e,t=!1){if(!i||!e)return!1;const r=r5e(i),n=r5e(e);return!(!t&&r.scheme!==n.scheme)&&r.host!=null&&n.host!=null&&r.host.toLowerCase()===n.host.toLowerCase()&&r.port===n.port}function tze(i){if(typeof i=="string"){if(!u0(i))return!0;i=r5e(i)}if(_v(i,Mv))return!0;const e=dY.trustedServers||[];for(let t=0;t(m=h.indexOf(p,m))===-1?h.length:m;let l=a(n,"/",n.indexOf("//")+2),u=-1;for(;n.slice(0,l+1)===s.slice(0,l)+"/"&&(u=l+1,l!==n.length);)l=a(n,"/",l+1);if(u===-1||o&&u0)for(let h=0;hs?n.concat(s.split("/")):n,[]);for(let n=0;n0&&t[t.length-1]!==".."?t.pop():(!s&&n===r.length-1||s&&(s!=="."||t.length===0))&&t.push(s)}return t.join("/")}function HC(i,e=!1){if(i==null||aR(i)||Vx(i))return null;let t=i.indexOf("://");if(t===-1&&Mx(i))t=2;else{if(t===-1)return null;t+=3}const r=i.indexOf("/",t);return r!==-1&&(i=i.slice(0,r)),e&&(i=Mve(i,!0)),i}function u0(i){return Mx(i)||rze(i)}function aR(i){return i!=null&&i.slice(0,5)==="blob:"}function Vx(i){return i!=null&&i.slice(0,5)==="data:"}function ize(i){const e=lR(i);return e&&e.isBase64?WCt(e.data):null}function YAe(i){return gWi(i).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const PWi=/^data:(.*?)(;base64)?,(.*)$/;function lR(i){const e=i.match(PWi);if(!e)return null;const[,t,r,n]=e;return{mediaType:t,isBase64:!!r,data:n}}function QCt(i){return i.isBase64?`data:${i.mediaType};base64,${i.data}`:`data:${i.mediaType},${i.data}`}async function RWi(i){return(await fetch(i)).blob()}function DWi(i){const e=ize(i);if(!e)return null;const t=lR(i);return new Blob([e],{type:t.mediaType})}function FWi(i,e){kWi(i,e)}function kWi(i,e){if(!i)return!1;const t=document.createElement("a");if(!("download"in t))return!1;const r=URL.createObjectURL(i);return t.download=e,t.href=r,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(r),!0}function Mx(i){return i!=null&&i[0]==="/"&&i[1]==="/"}function rze(i){return i!=null&&qCt.test(i)}function eEt(i){return i!=null&&vWi.test(i)||Mv.scheme==="https"&&Mx(i)}function LWi(i){return i!=null&&YCt.test(i)||Mv.scheme==="http"&&Mx(i)}function NWi(i){return i!=null&&_Wi.test(i)}function wne(i){return Mx(i)?`https:${i}`:i.replace(YCt,"https:")}function $Wi(){return Mv.scheme==="http"}function t5e(){return Mv.scheme==="https"}function Mve(i,e=!1){return Mx(i)?i.slice(2):(i=i.replace(qCt,""),e&&i.length>1&&i[0]==="/"&&i[1]==="/"&&(i=i.slice(2)),i)}function BWi(i){const e=i.indexOf("//"),t=i.indexOf("/",e+2);return t===-1?i:i.slice(0,t)}function eae(i){let e=0;if(u0(i)){const r=i.indexOf("//");r!==-1&&(e=r+2)}const t=i.lastIndexOf("/");return tr===n||r.endsWith(`.${n}`))||t5e()&&!Qoe(i))&&(i=wne(i)),i}function i5e(i,e,t){if(!(e&&t&&i&&u0(i)))return i;const r=i.indexOf("//"),n=i.indexOf("/",r+2),s=i.indexOf(":",r+2),o=Math.min(n<0?i.length:n,s<0?i.length:s);return i.slice(r+2,o).toLowerCase()!==e.toLowerCase()?i:`${i.slice(0,r+2)}${t}${i.slice(o)}`}function r5e(i){return typeof i=="string"?new Qy(xf(i)):(i.scheme||(i.scheme=Mv.scheme),i)}function zWi(i){return HWi.test(i)}function iEt(i,e){const t=Yo(i),r=Object.keys(t.query||{});return r.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),t.path}function VWi(i,e,t){const r=Yo(i),n=r.query||{};return n[e]=String(t),`${r.path}?${Lb(n)}`}function gg(i,e){if(!e)return i;const t=Yo(i),r=t.query||{};for(const[s,o]of Object.entries(e))o!=null&&(r[s]=o);const n=Lb(r);return n?`${t.path}?${n}`:t.path}function nze(i){if(i==null)return null;const e=i.match(nEt);return e?e[2]:null}function urt(i){if(i==null)return null;const e=i.match(nEt);return e?{path:e[1],extension:e[2]}:{path:i,extension:null}}async function rEt(i){return typeof i=="string"?lR(i)??{data:i}:new Promise((e,t)=>{const r=new FileReader;r.readAsDataURL(i),r.onload=()=>e(lR(r.result)),r.onerror=n=>t(n)})}const nEt=/([^.]*)\.([^\/]*)$/,HWi=/(^data:image\/svg|\.svg$)/i,sEt="20240321",oEt="9cf5a4b8555fda94595b625a40b922e012baf071";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const tae="4.29";let no,sze=tae;sze="4.29.10";function WWi(i){no=i}function qWi(i){const e=no?.findCredential(i);return e?.token?VWi(i,"token",e.token):i}yi("host-webworker");const YWi=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function oze(i){const e=HC(i,!0);return!!e&&e.endsWith(".arcgis.com")&&!YWi.has(e)&&!i.endsWith("/sharing/rest/generateToken")}function aEt(i,e,t=!1,r){return new Promise((n,s)=>{if(xg(r))return void s(crt());let o=()=>{u(),s(new Error(`Unable to load ${e}`))},a=()=>{const c=i;u(),n(c)},l=()=>{if(!i)return;const c=i;u(),c.src="",s(crt())};const u=()=>{yi("esri-image-decode")||(i.removeEventListener("error",o),i.removeEventListener("load",a)),o=null,a=null,i=null,r?.removeEventListener("abort",l),l=null,t&&URL.revokeObjectURL(e)};r?.addEventListener("abort",l),yi("esri-image-decode")?i.decode().then(a,o):(i.addEventListener("error",o),i.addEventListener("load",a))})}function crt(){try{return new DOMException("Aborted","AbortError")}catch{const i=new Error;return i.name="AbortError",i}}const XWi="Timeout exceeded";function JWi(){return new Error(XWi)}function KWi(i){Ho.request.crossOriginNoCorsDomains||(Ho.request.crossOriginNoCorsDomains={});const e=Ho.request.crossOriginNoCorsDomains;for(let t of i)t=t.toLowerCase(),/^https?:\/\//.test(t)?e[HC(t)??""]=0:(e[HC("http://"+t)??""]=0,e[HC("https://"+t)??""]=0)}function ZWi(i){const e=Ho.request.crossOriginNoCorsDomains;if(e){let t=HC(i);if(t)return t=t.toLowerCase(),!_v(t,ZUe())&&e[t]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:fC.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await uqi(a);return s?.after?.(l),l}let Ove;const fC=Ho.request,lEt="FormData"in globalThis,eqi=new Set([499,498,403,401]),tqi=new Set(["COM_0056","COM_0057","SB_0008"]),iqi=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],QH=()=>null,Pve=Symbol();function rqi(i){const e=HC(i);e&&!zi._corsServers.includes(e)&&zi._corsServers.push(e)}function hrt(i){const e=HC(i);return!e||e.endsWith(".arcgis.com")||zi._corsServers.includes(e)||tze(e)}function jA(i,e,t,r){let n="Error";const s={url:t.url,requestOptions:t.requestOptions,getAllHeaders:QH,getHeader:QH,ssl:!1};if(e instanceof qe)return e.details?(e.details=li(e.details),e.details.url=t.url,e.details.requestOptions=t.requestOptions):e.details=s,e;if(e){const o=r&&(()=>Array.from(r.headers)),a=r&&(c=>r.headers.get(c)),l=r?.status,u=e.message;u&&(n=u),o&&a&&(s.getAllHeaders=o,s.getHeader=a),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||l||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=Pve in e?e[Pve]:e}return mo(e)?Oc():new qe(i,n,s)}async function nqi(){yi("host-webworker")&&!Ove&&(Ove=await Promise.resolve().then(()=>rNr))}async function n5e(){no||await Promise.resolve().then(()=>sNr)}async function sqi(i){const e=i.params.url,t=i.params.requestOptions,r=i.controller.signal,n=t.body;let s=null,o=null;if(lEt&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),i.fetchOptions={cache:t.cacheBust?"no-cache":"default",credentials:"same-origin",headers:t.headers||{},method:t.method==="head"?"HEAD":"GET",mode:"cors",priority:fC.priority,redirect:"follow",signal:r},(s||o)&&(i.fetchOptions.body=s||o),t.authMode==="anonymous"&&(i.useIdentity=!1),i.hasToken=!!(/token=/i.test(e)||t.query?.token||s?.get("token")),!i.hasToken&&Ho.apiKey&&oze(e)&&(t.query||(t.query={}),t.query.token=Ho.apiKey,i.hasToken=!0),i.useIdentity&&!i.hasToken&&!i.credentialToken&&!uEt(e)&&!xg(r)){let a;t.authMode==="immediate"?(await n5e(),a=await no.getCredential(e,{signal:r}),i.credential=a):t.authMode==="no-prompt"?(await n5e(),a=await no.getCredential(e,{prompt:!1,signal:r}).catch(()=>{}),i.credential=a):no&&(a=no.findCredential(e)),a&&(i.credentialToken=a.token,i.useSSL=!!a.ssl)}}function uEt(i){return iqi.some(e=>e.test(i))}async function oqi(i){let e=i.params.url;const t=i.params.requestOptions,r=i.fetchOptions??{},n=aR(e)||Vx(e),s=t.responseType||"json",o=n?0:t.timeout!=null?t.timeout:fC.timeout;let a=!1;if(!n){i.useSSL&&(e=wne(e));let p={...t.query};i.credentialToken&&(p.token=i.credentialToken);let m=Lb(p);yi("esri-url-encodes-apostrophe")&&(m=m.replaceAll("'","%27"));const v=e.length+1+m.length;let w;a=t.method==="delete"||t.method==="post"||t.method==="put"||!!t.body||v>fC.maxUrlLength;const S=t.useProxy||!!Qoe(e);if(S){const I=IWi(e);w=I.path,!a&&w.length+1+v>fC.maxUrlLength&&(a=!0),I.query&&(p={...I.query,...p})}if(r.method==="HEAD"&&(a||S)){if(a)throw v>fC.maxUrlLength?jA("request:invalid-parameters",new Error("URL exceeds maximum length"),i.params):jA("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),i.params);if(S)throw jA("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),i.params)}a?(r.method=t.method==="delete"?"DELETE":t.method==="put"?"PUT":"POST",t.body?e=gg(e,p):(r.body=Lb(p),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):e=gg(e,p),S&&(i.useProxy=!0,e=`${w}?${e}`),p.token&&lEt&&r.body instanceof FormData&&!HCt(e)&&r.body.set("token",p.token),t.hasOwnProperty("withCredentials")?i.withCredentials=t.withCredentials:_v(e,ZUe())||(tze(e)||no&&no.findServerInfo(e)?.webTierAuth)&&(i.withCredentials=!0),i.withCredentials&&(r.credentials="include",ZWi(e)&&await QWi(a?gg(e,p):e))}let l,u,c=0,h=!1;o>0&&(c=setTimeout(()=>{h=!0,i.controller.abort()},o));try{if(t.responseType==="native-request-init")u=r,u.url=e;else if(t.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||a||lqi(t.headers)||!n&&!i.useProxy&&fC.proxyUrl&&!hrt(e)){if(zi._beforeFetch&&await zi._beforeFetch(e,r),l=await fetch(e,r),zi._afterFetch&&await zi._afterFetch(l),i.useProxy||rqi(e),t.responseType==="native")u=l;else if(r.method!=="HEAD")if(l.ok){switch(s){case"array-buffer":u=await l.arrayBuffer();break;case"blob":case"image":u=await l.blob();break;default:u=await l.text()}if(c&&(clearTimeout(c),c=0),s==="json"||s==="xml"||s==="document")if(u)switch(s){case"json":u=JSON.parse(u);break;case"xml":u=drt(u,"application/xml");break;case"document":u=drt(u,"text/html")}else u=null;if(u){if(s==="array-buffer"||s==="blob"){const p=l.headers.get("Content-Type");if(p&&/application\/json|text\/plain/i.test(p)&&u[s==="blob"?"size":"byteLength"]<=750)try{const m=await new Response(u).json();m.error&&(u=m)}catch{}}s==="image"&&u instanceof Blob&&(u=await prt(URL.createObjectURL(u),i,!0))}}else{u=await l.text();try{u=JSON.parse(u)}catch{}}}else u=await prt(e,i)}catch(p){if(p.name==="AbortError")throw h?JWi():Oc("Request canceled");if(!(!l&&p instanceof TypeError&&fC.proxyUrl)||t.body||t.method==="delete"||t.method==="head"||t.method==="post"||t.method==="put"||i.useProxy||hrt(e))throw p;i.redoRequest=!0,AWi({proxyUrl:fC.proxyUrl,urlPrefix:HC(e)??""})}finally{c&&clearTimeout(c)}return[l,u]}async function aqi(i,e){if(i.responseData!=null)return i.responseData;if(i.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...i.headers}),i.query&&(e.requestOptions.query={...e.requestOptions.query,...i.query}),i.before){let t,r;try{r=await i.before(e)}catch(n){t=jA("request:interceptor",n,e)}if((r instanceof Error||r instanceof qe)&&(t=jA("request:interceptor",r,e)),t)throw i.error&&i.error(t),t;return r}}function lqi(i){if(i){for(const e of Object.getOwnPropertyNames(i))if(i[e])return!0}return!1}function drt(i,e){let t;try{t=new DOMParser().parseFromString(i,e)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function uqi(i){let e,t;await sqi(i);try{do[e,t]=await oqi(i);while(!await cqi(i,e,t))}catch(s){const o=jA("request:server",s,i.params,e);throw o.details.ssl=i.useSSL,i.interceptor?.error&&i.interceptor.error(o),o}const r=i.params.url;if(t&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!i.hasToken&&!i.credentialToken&&t.user?.username&&!tze(r)){const s=HC(r,!0);s&&fC.trustedServers.push(s)}Array.isArray(t.authorizedCrossOriginNoCorsDomains)&&KWi(t.authorizedCrossOriginNoCorsDomains)}const n=i.credential;if(n&&no){let o=no.findServerInfo(n.server)?.owningSystemUrl;if(o){o=o.replace(/\/?$/,"/sharing");const a=no.findCredential(o,n.userId);a&&no._getIdenticalSvcIdx(o,a)===-1&&a.resources.unshift(o)}}return{data:t,getAllHeaders:e?()=>Array.from(e.headers):QH,getHeader:e?s=>e.headers.get(s):QH,httpStatus:e?.status??200,requestOptions:i.params.requestOptions,ssl:i.useSSL,url:i.params.url}}async function cqi(i,e,t){if(i.redoRequest)return i.redoRequest=!1,!1;const r=i.params.requestOptions;if(!e||r.responseType==="native"||r.responseType==="native-request-init")return!0;let n,s;if(t&&(t.error?n=t.error:t.status==="error"&&Array.isArray(t.messages)&&(n={...t},n[Pve]=t,n.details=t.messages)),!n&&!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[Pve]=t,n;let o,a=null;n&&(s=Number(n.code),a=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o?.toUpperCase());const l=r.authMode;if(s===403&&(a===4||n.message?.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!i.useSSL)return i.useSSL=!0,!1}else if(!i.hasToken&&i.useIdentity&&(l!=="no-prompt"||s===498)&&s!==void 0&&eqi.has(s)&&!uEt(i.params.url)&&(s!==403||(!o||!tqi.has(o))&&(a==null||a===2&&i.credentialToken))){await n5e();try{const u=await no.getCredential(i.params.url,{error:jA("request:server",n,i.params),prompt:l!=="no-prompt",signal:i.controller.signal,token:i.credentialToken});return i.credential=u,i.credentialToken=u.token,i.useSSL=i.useSSL||u.ssl,!1}catch(u){if(l==="no-prompt")return i.credential=void 0,i.credentialToken=void 0,!1;n=u}}if(n)throw n;return!0}function prt(i,e,t=!1){const r=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=fC.priority,n.src=i,aEt(n,i,t,r)}zi._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],zi._beforeFetch=void 0,zi._afterFetch=void 0;let Wfe=class cEt{constructor(){this._emitter=new cEt.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(i){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(n,s){let o=this._listenersMap?.get(n);if(!o)return!1;const a=this._target||this;let l=!1;for(const u of o.slice()){const c="deref"in u?u.deref():u;c?c?.call(a,s):l=!0}return l&&(o=o.filter(u=>!("deref"in u)||u.deref()!=null),this._listenersMap.set(n,o)),o.length>0}on(n,s){if(Array.isArray(n)){const a=n.map(l=>this.on(l,s));return j3(a)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),wa(()=>{const a=this._listenersMap?.get(n),l=a?.indexOf(s)??-1;l>=0&&a.splice(l,1)})}once(n,s){const o=this.on(n,a=>{o.remove(),("deref"in s?s.deref():s)?.call(null,a)});return o}hasEventListener(n){const s=this._listenersMap?.get(n);return s!=null&&s.length>0}}i.EventEmitter=e,i.EventedMixin=r=>{let n=class extends r{constructor(){super(...arguments),this._emitter=new e}destroy(){this._emitter.clear()}emit(s,o){return this._emitter.emit(s,o)}on(s,o){return this._emitter.on(s,o)}once(s,o){return this._emitter.once(s,o)}hasEventListener(s){return this._emitter.hasEventListener(s)}};return n=x([Qe("esri.core.Evented")],n),n};let t=class extends un{constructor(){super(...arguments),this._emitter=new Wfe.EventEmitter(this)}destroy(){this._emitter.clear()}emit(r,n){return this._emitter.emit(r,n)}on(r,n){return this._emitter.on(r,n)}once(r,n){return this._emitter.once(r,n)}hasEventListener(r){return this._emitter.hasEventListener(r)}};t=x([Qe("esri.core.Evented")],t),i.EventedAccessor=t})(Wfe||(Wfe={}));const rd=Wfe;var yc;(function(i){i[i.ADD=1]="ADD",i[i.REMOVE=2]="REMOVE",i[i.MOVE=4]="MOVE"})(yc||(yc={}));function aze(i){return(e,t)=>{e[t]=i}}let pY=class extends nCt{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const r of t)r.onInvalidated(),r.onCommitted()}}};var JO;let hqi=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},dqi=class{constructor(e,t,r,n,s){this.target=e,this.added=t,this.removed=r,this.start=n,this.deleteCount=s}};const a2=new G3(hqi,void 0,i=>{i.item=null,i.target=null,i.defaultPrevented=!1,i.cancellable=!1});function XAe(i){return i?i instanceof jO?i.toArray():i.length?Array.prototype.slice.apply(i):[]:[]}function JAe(i){if(i?.length)return i[0]}function pqi(i,e,t,r){const n=Math.min(i.length-t,e.length-r);let s=0;for(;s{i.push(n),hEt(i,t.call(r,n,s,o),t,r)})}const hD=new Set,dD=new Set,pD=new Set,KAe=new Map;let fqi=0,jO=JO=class extends rd.EventedAccessor{static isCollection(i){return i!=null&&i instanceof JO}constructor(i){super(i),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new pY,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:fqi++})}normalizeCtorArgs(i){return i?Array.isArray(i)||i instanceof JO?{items:i}:i:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return Ws(this._observable),this._items}set items(i){this._emitBeforeChanges(yc.ADD)||(this._splice(0,this.length,XAe(i)),this._emitAfterChanges(yc.ADD))}hasEventListener(i){return i==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(i)}on(i,e){if(i==="change"){const t=this._chgListeners,r={removed:!1,callback:e};return t.push(r),this._notifications&&this._notifications.push({listeners:t.slice(),items:this._items.slice(),changes:[]}),wa(()=>{r.removed=!0,t.splice(t.indexOf(r),1)})}return this._emitter.on(i,e)}once(i,e){const t="deref"in e?()=>e.deref():()=>e,r=this.on(i,n=>{t()?.call(null,n),r.remove()});return r}add(i,e){if(Ws(this._observable),this._emitBeforeChanges(yc.ADD))return this;const t=this.getNextIndex(e??null);return this._splice(t,0,[i]),this._emitAfterChanges(yc.ADD),this}addMany(i,e=this._items.length){if(Ws(this._observable),!i?.length)return this;if(this._emitBeforeChanges(yc.ADD))return this;const t=this.getNextIndex(e);return this._splice(t,0,XAe(i)),this._emitAfterChanges(yc.ADD),this}at(i){if(Ws(this._observable),(i=Math.trunc(i)||0)<0&&(i+=this.length),!(i<0||i>=this.length))return this._items[i]}removeAll(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return[];const i=this._removeAllRaw();return this._emitAfterChanges(yc.REMOVE),i}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return Ws(this._observable),this._createNewInstance({items:this._items.map(li)})}concat(...i){Ws(this._observable);const e=i.map(XAe);return this._createNewInstance({items:this._items.concat(...e)})}drain(i,e){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const t=this._splice(0,this.length),r=t.length;for(let n=0;ne&&(i=e),i}includes(i,e=0){return Ws(this._observable),this._items.includes(i,e)}indexOf(i,e=0){return Ws(this._observable),this._items.indexOf(i,e)}join(i=","){return Ws(this._observable),this._items.join(i)}lastIndexOf(i,e=this.length-1){return Ws(this._observable),this._items.lastIndexOf(i,e)}map(i,e){Ws(this._observable);const t=this._items.map(i,e);return new JO({items:t})}reorder(i,e=this.length-1){Ws(this._observable);const t=this.indexOf(i);if(t!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),t!==e){if(this._emitBeforeChanges(yc.MOVE))return i;this._splice(t,1),this._splice(e,0,[i]),this._emitAfterChanges(yc.MOVE)}return i}}pop(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const i=JAe(this._splice(this.length-1,1));return this._emitAfterChanges(yc.REMOVE),i}push(...i){return Ws(this._observable),this._emitBeforeChanges(yc.ADD)||(this._splice(this.length,0,i),this._emitAfterChanges(yc.ADD)),this.length}reduce(i,e){Ws(this._observable);const t=this._items;return arguments.length===2?t.reduce(i,e):t.reduce(i)}reduceRight(i,e){Ws(this._observable);const t=this._items;return arguments.length===2?t.reduceRight(i,e):t.reduceRight(i)}remove(i){return Ws(this._observable),this.removeAt(this.indexOf(i))}removeAt(i){if(Ws(this._observable),i<0||i>=this.length||this._emitBeforeChanges(yc.REMOVE))return;const e=JAe(this._splice(i,1));return this._emitAfterChanges(yc.REMOVE),e}removeMany(i){if(Ws(this._observable),!i?.length||this._emitBeforeChanges(yc.REMOVE))return[];const e=i instanceof JO?i.toArray():i,t=this._items,r=[],n=e.length;for(let s=0;s-1){const l=1+pqi(e,t,s+1,a+1),u=this._splice(a,l);u&&u.length>0&&r.push.apply(r,u),s+=l-1}}return this._emitAfterChanges(yc.REMOVE),r}reverse(){if(Ws(this._observable),this._emitBeforeChanges(yc.MOVE))return this;const i=this._splice(0,this.length);return i&&(i.reverse(),this._splice(0,0,i)),this._emitAfterChanges(yc.MOVE),this}shift(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const i=JAe(this._splice(0,1));return this._emitAfterChanges(yc.REMOVE),i}slice(i=0,e=this.length){return Ws(this._observable),this._createNewInstance({items:this._items.slice(i,e)})}some(i,e){return Ws(this._observable),this._items.some(i,e)}sort(i){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(i):e.sort(),this._splice(0,0,e),this._emitAfterChanges(yc.MOVE),this}splice(i,e,...t){Ws(this._observable);const r=(e?yc.REMOVE:0)|(t.length?yc.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(i,e,t)||[];return this._emitAfterChanges(r),n}toArray(){return Ws(this._observable),this._items.slice()}toJSON(){return Ws(this._observable),this.toArray()}toLocaleString(){return Ws(this._observable),this._items.toLocaleString()}toString(){return Ws(this._observable),this._items.toString()}unshift(...i){return Ws(this._observable),!i.length||this._emitBeforeChanges(yc.ADD)||(this._splice(0,0,i),this._emitAfterChanges(yc.ADD)),this.length}_createNewInstance(i){return new this.constructor(i)}_splice(i,e,t){const r=this._items,n=this.itemType;let s,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=Gk(()=>this._dispatchChange())),i<0&&(i+=this.length),e){if(o=r.splice(i,e),this.hasEventListener("before-remove")){const a=a2.acquire();a.target=this,a.cancellable=!0;for(let l=0,u=o.length;l{r.push(l)});const n=Ky.acquire();dD.forEach(l=>{n.push(l)});const s=this._items,o=e.items,a=Ky.acquire();if(pD.forEach(l=>{o.indexOf(l)!==s.indexOf(l)&&a.push(l)}),e.listeners&&(r.length||n.length||a.length)){const l={target:this,added:r,removed:n,moved:a},u=e.listeners.length;for(let c=0;c{if(!i)return JO;if(KAe.has(i))return KAe.get(i);let e=null;if(typeof i=="function")e=i.prototype.declaredClass;else if(i.base)e=i.base.prototype.declaredClass;else for(const r in i.typeMap){const n=i.typeMap[r].prototype.declaredClass;e?e+=` | ${n}`:e=n}let t=class extends JO{};return x([aze({Type:i,ensureType:typeof i=="function"?Sd(i):u3(i)})],t.prototype,"itemType",void 0),t=x([Qe(`esri.core.Collection<${e}>`)],t),KAe.set(i,t),t},x([D()],jO.prototype,"_updating",void 0),x([D()],jO.prototype,"length",void 0),x([D()],jO.prototype,"items",null),x([D({readOnly:!0})],jO.prototype,"updating",null),jO=JO=x([Qe("esri.core.Collection")],jO);const dr=jO;function ay(i,e,t=dr){return e||(e=new t),e===i||(e.removeAll(),mqi(i)?e.addMany(i):i&&e.add(i)),e}function fY(i){return i}function mqi(i){return i&&(Array.isArray(i)||"items"in i&&Array.isArray(i.items))}var c5;(function(i){i[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED"})(c5||(c5={}));let gqi=class{constructor(){this._resolver=ac(),this._status=c5.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=c5.RESOLVED,this._cleanUp()},()=>{this._status=c5.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===c5.RESOLVED}isRejected(){return this._status===c5.REJECTED}isFulfilled(){return this._status!==c5.PENDING}abort(){this._resolver.reject(Oc())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=ac(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},n=>{this.isFulfilled()||this._allPromise!==r||mo(n)||this._resolver.reject(n)}),e.resolve()}};const U3=i=>{let e=class extends i{constructor(...t){super(...t),this._promiseProps=new gqi,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(t,r){return this._promiseProps.promise.then(()=>this).then(t,r)}catch(t){return this.when(null,t)}addResolvingPromise(t){t&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in t?t.when():t)}};return e=x([Qe("esri.core.Promise")],e),e};let Rve=class extends U3(un){};Rve=x([Qe("esri.core.Promise")],Rve);const yqi="not-loaded",vqi="loading",_qi="failed",frt="loaded",dEt=i=>{let e=class extends i{constructor(...t){super(...t),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(r=>{const n=this.load.bind(this);this.load=s=>{const o=new Promise((a,l)=>{const u=ZH(s,l);this.destroyed&&l(new qe("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(a,l).finally(()=>{u&&u.remove()})});if(this.loadStatus===yqi){this._set("loadStatus",vqi);const a=this._loadController=new AbortController;n({signal:a.signal})}return r(),o}})),this.when(()=>{this._set("loadStatus",frt),this._loadController=null},r=>{this._set("loadStatus",_qi),this._set("loadError",r),this._loadController=null})}destroy(){this._loadController&&(this._loadController=zF(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===frt}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new qe("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return x([D({readOnly:!0})],e.prototype,"loaded",null),x([D({readOnly:!0})],e.prototype,"loadError",void 0),x([D({clonable:!1})],e.prototype,"loadStatus",void 0),x([D({type:[Rf],readOnly:!0})],e.prototype,"loadWarnings",null),e=x([Qe("esri.core.Loadable")],e),e};let UZ=class extends dEt(Rve){};UZ=x([Qe("esri.core.Loadable")],UZ),function(i){function e(t){return!(!t||!t.load)}i.LoadableMixin=dEt,i.isLoadable=e}(UZ||(UZ={}));const ef=UZ;function bqi(i,e,t){return g0(i.map((r,n)=>e.apply(t,[r,n])))}async function wqi(i,e,t){return(await g0(i.map((r,n)=>e.apply(t,[r,n])))).map(r=>r.value)}function lze(i){return{ok:!0,value:i}}function uze(i){return{ok:!1,error:i}}function xqi(i){return i!=null&&i.ok===!0?i.value:null}function Sqi(i){return i!=null&&i.ok===!1?i.error:null}async function Uk(i){if(i==null)return{ok:!1,error:new Error("no promise provided")};try{return lze(await i)}catch(e){return uze(e)}}async function s5e(i){try{return lze(await i)}catch(e){return _a(e),uze(e)}}function pE(i,e){return new i4(i,e)}let i4=class extends un{get value(){return xqi(this._result)}get error(){return Sqi(this._result)}get finished(){return this._result!=null}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=zF(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(n=>{this._result=lze(n),this._cleanup()},n=>{this._result=uze(n),this._cleanup()}),this._abortHandle=Qh(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Hc(this._abortHandle),this._abortController=null}};x([D()],i4.prototype,"value",null),x([D()],i4.prototype,"error",null),x([D()],i4.prototype,"finished",null),x([D()],i4.prototype,"promise",void 0),x([D()],i4.prototype,"_result",void 0),i4=x([Qe("esri.core.asyncUtils.ReactiveTask")],i4);async function VB(i,e){return await i.load(),pEt(i,e)}async function pEt(i,e){const t=[],r=(...s)=>{for(const o of s)o!=null&&(Array.isArray(o)?r(...o):dr.isCollection(o)?o.forEach(a=>r(a)):ef.isLoadable(o)&&t.push(o))};e(r);let n=null;if(await wqi(t,async s=>{const o=await Uk(Tqi(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return i}function Tqi(i){return"loadAll"in i&&typeof i.loadAll=="function"}function ur(i,e,t){let r,n;return e===void 0?(n=i,r=[void 0]):typeof e!="string"?(n=i,r=[void 0],t=e):(n=e,r=Array.isArray(i)?i:[i]),(s,o)=>{const a=s.constructor.prototype;for(const l of r){const u=qUe(s,l,n);u.write&&typeof u.write=="object"||(u.write={}),t&&(u.write.target=t),u.write.writer=a[o]}}}let Rs=class{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=r=>this.fromJSON(r),this.write=(r,n,s)=>{const o=this.toJSON(r);o!==void 0&&Qp(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return e!=null&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}};function pa(){return function(i,e){return new Rs(i,{ignoreUnknown:!0,...e})}}let cze=class{constructor(e,t,r,n){this.semiMajorAxis=e,this.flattening=t,this.outerAtmosphereRimWidth=r;const s=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*s,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=n||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Td=new cze(6378137,1/298.257223563,3e5,.006694379990137799),GA=new cze(3396190,1/169.8944472236118,23e4),VF=new cze(1737400,0,0);function Fl(i){if(!Ho.assetsPath)throw di.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new qe("assets:path-not-set","config.assetsPath is not set");return Iu(Ho.assetsPath,i)}let ZAe,nr=null;function hze(){return!!nr}function Cqi(){return!!yi("esri-wasm")}function fEt(){return ZAe||(ZAe=Promise.resolve().then(()=>lNr).then(i=>i.p).then(({default:i})=>i({locateFile:e=>Fl(`esri/geometry/support/${e}`)})).then(i=>{gEt(i)}),ZAe)}var xne,ku,tx;(function(i){function e(s,o,a){nr.ensureCache.prepare();const l=S6(a),u=a===l,c=nr.ensureFloat64(l),h=nr._pe_geog_to_proj(nr.getPointer(s),o,c);return h&&k5(a,o,c,u),h}function t(s,o,a,l){switch(l){case ku.PE_TRANSFORM_P_TO_G:return r(s,o,a);case ku.PE_TRANSFORM_G_TO_P:return e(s,o,a)}return 0}function r(s,o,a){return n(s,o,a,0)}function n(s,o,a,l){nr.ensureCache.prepare();const u=S6(a),c=a===u,h=nr.ensureFloat64(u),p=nr._pe_proj_to_geog_center(nr.getPointer(s),o,h,l);return p&&k5(a,o,h,c),p}i.geogToProj=e,i.projGeog=t,i.projToGeog=r,i.projToGeogCenter=n})(xne||(xne={})),function(i){function e(){i.PE_BUFFER_MAX=nr.PeDefs.prototype.PE_BUFFER_MAX,i.PE_NAME_MAX=nr.PeDefs.prototype.PE_NAME_MAX,i.PE_MGRS_MAX=nr.PeDefs.prototype.PE_MGRS_MAX,i.PE_USNG_MAX=nr.PeDefs.prototype.PE_USNG_MAX,i.PE_DD_MAX=nr.PeDefs.prototype.PE_DD_MAX,i.PE_DDM_MAX=nr.PeDefs.prototype.PE_DDM_MAX,i.PE_DMS_MAX=nr.PeDefs.prototype.PE_DMS_MAX,i.PE_UTM_MAX=nr.PeDefs.prototype.PE_UTM_MAX,i.PE_PARM_MAX=nr.PeDefs.prototype.PE_PARM_MAX,i.PE_TYPE_NONE=nr.PeDefs.prototype.PE_TYPE_NONE,i.PE_TYPE_GEOGCS=nr.PeDefs.prototype.PE_TYPE_GEOGCS,i.PE_TYPE_PROJCS=nr.PeDefs.prototype.PE_TYPE_PROJCS,i.PE_TYPE_GEOGTRAN=nr.PeDefs.prototype.PE_TYPE_GEOGTRAN,i.PE_TYPE_COORDSYS=nr.PeDefs.prototype.PE_TYPE_COORDSYS,i.PE_TYPE_UNIT=nr.PeDefs.prototype.PE_TYPE_UNIT,i.PE_TYPE_LINUNIT=nr.PeDefs.prototype.PE_TYPE_LINUNIT,i.PE_STR_OPTS_NONE=nr.PeDefs.prototype.PE_STR_OPTS_NONE,i.PE_STR_AUTH_NONE=nr.PeDefs.prototype.PE_STR_AUTH_NONE,i.PE_STR_AUTH_TOP=nr.PeDefs.prototype.PE_STR_AUTH_TOP,i.PE_STR_NAME_CANON=nr.PeDefs.prototype.PE_STR_NAME_CANON,i.PE_STR_FMT_WKT=nr.PeDefs.prototype.PE_STR_FMT_WKT,i.PE_STR_FMT_WKT2=nr.PeDefs.prototype.PE_STR_FMT_WKT2,i.PE_PARM_X0=nr.PeDefs.prototype.PE_PARM_X0,i.PE_PARM_ND=nr.PeDefs.prototype.PE_PARM_ND,i.PE_TRANSFORM_1_TO_2=nr.PeDefs.prototype.PE_TRANSFORM_1_TO_2,i.PE_TRANSFORM_2_TO_1=nr.PeDefs.prototype.PE_TRANSFORM_2_TO_1,i.PE_TRANSFORM_P_TO_G=nr.PeDefs.prototype.PE_TRANSFORM_P_TO_G,i.PE_TRANSFORM_G_TO_P=nr.PeDefs.prototype.PE_TRANSFORM_G_TO_P,i.PE_HORIZON_RECT=nr.PeDefs.prototype.PE_HORIZON_RECT,i.PE_HORIZON_POLY=nr.PeDefs.prototype.PE_HORIZON_POLY,i.PE_HORIZON_LINE=nr.PeDefs.prototype.PE_HORIZON_LINE,i.PE_HORIZON_DELTA=nr.PeDefs.prototype.PE_HORIZON_DELTA}i.init=e}(ku||(ku={})),function(i){const e={},t={},r=m=>{if(m){const v=m.getType();switch(v){case ku.PE_TYPE_GEOGCS:m=nr.castObject(m,nr.PeGeogcs);break;case ku.PE_TYPE_PROJCS:m=nr.castObject(m,nr.PeProjcs);break;case ku.PE_TYPE_GEOGTRAN:m=nr.castObject(m,nr.PeGeogtran);break;default:v&ku.PE_TYPE_UNIT&&(m=nr.castObject(m,nr.PeUnit))}}return m};function n(){nr.PeFactory.prototype.initialize(null)}function s(m){return o(ku.PE_TYPE_COORDSYS,m)}function o(m,v){let w=null,S=e[m];if(S||(S={},e[m]=S),S.hasOwnProperty(String(v)))w=S[v];else{const I=nr.PeFactory.prototype.factoryByType(m,v);nr.compare(I,nr.NULL)||(w=I,S[v]=w)}return w=r(w),w}function a(m,v){let w=null,S=t[m];if(S||(S={},t[m]=S),S.hasOwnProperty(v))w=S[v];else{const I=nr.PeFactory.prototype.fromString(m,v);nr.compare(I,nr.NULL)||(w=I,S[v]=w)}return w=r(w),w}function l(m){return o(ku.PE_TYPE_GEOGCS,m)}function u(m){return o(ku.PE_TYPE_GEOGTRAN,m)}function c(m){return nr.PeFactory.prototype.getCode(m)}function h(m){return o(ku.PE_TYPE_PROJCS,m)}function p(m){return o(ku.PE_TYPE_UNIT,m)}i.initialize=n,i.coordsys=s,i.factoryByType=o,i.fromString=a,i.geogcs=l,i.geogtran=u,i.getCode=c,i.projcs=h,i.unit=p}(tx||(tx={}));let mEt=null;var Dve,o5e,Fve,a5e,kve,l5e,Lve,Sne,u5e;function gEt(i){function e(s,o,a){s[o]=a(s[o])}nr=i,ku.init(),Dve.init(),kve.init(),Lve.init(),Sne.init(),mEt=class extends nr.PeGCSExtent{destroy(){nr.destroy(this)}};const t=[nr.PeDatum,nr.PeGeogcs,nr.PeGeogtran,nr.PeObject,nr.PeParameter,nr.PePrimem,nr.PeProjcs,nr.PeSpheroid,nr.PeUnit];for(const s of t)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(ku.PE_NAME_MAX))});for(const s of[nr.PeGeogtran,nr.PeProjcs])e(s.prototype,"getParameters",o=>function(){const a=new Array(ku.PE_PARM_MAX);let l=o.call(this);for(let u=0;ufunction(){const o=this.getSize();if(!o)return null;const a=[];return k5(a,o,s.call(this)),a}),e(nr.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=nr._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=s.call(this);if(!nr.compare(l,nr.NULL)){a=[l];const u=this.getSteps();if(u>1){const c=nr.getPointer(l);for(let h=1;hfunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(s))return o.get(s);let a=null;const l=s.call(this);if(!nr.compare(l,nr.NULL)){a=[l];const u=l.getNump();if(u>1){const c=nr.getPointer(l);for(let h=1;h{e.push(t[0],t[1])})):e=i,e}function k5(i,e,t,r=!1){if(r)for(let n=0;n<2*e;n++)i[n]=nr.getValue(t+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=i.length===0;for(let s=0;s1)){const m=nr.getPointer(p);for(let v=1;v{yM(n);const s=n.getGeogtran();yM(s),s.getParameters().forEach(yM),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{yM(o);const a=o.getDatum();yM(a),yM(a.getSpheroid()),yM(o.getPrimem()),yM(o.getUnit())})});nr.PeGTlistExtendedEntry.prototype.Delete(t[0])}}i.destroy=e}(o5e||(o5e={})),function(i){function e(t,r,n,s,o){nr.ensureCache.prepare();const a=S6(n),l=n===a,u=nr.ensureFloat64(a);let c=0;s&&(c=nr.ensureFloat64(s));const h=nr._pe_geog_to_geog(nr.getPointer(t),r,u,c,o);return h&&k5(n,r,u,l),h}i.geogToGeog=e}(Fve||(Fve={})),function(i){const e=(u,c,h,p,m,v)=>{let w,S;switch(nr.ensureCache.prepare(),u){case"dd":w=nr._pe_geog_to_dd,S=ku.PE_DD_MAX;break;case"ddm":w=nr._pe_geog_to_ddm,S=ku.PE_DDM_MAX;break;case"dms":w=nr._pe_geog_to_dms,S=ku.PE_DMS_MAX}let I=0;c&&(I=nr.getPointer(c));const R=S6(p),L=nr.ensureFloat64(R),k=Pce(h,S),B=w(I,h,L,m,nr.ensureInt32(k));if(B)for(let $=0;${let v;switch(nr.ensureCache.prepare(),u){case"dd":v=nr._pe_dd_to_geog;break;case"ddm":v=nr._pe_ddm_to_geog;break;case"dms":v=nr._pe_dms_to_geog}let w=0;c&&(w=nr.getPointer(c));const S=p.map(k=>nr.ensureString(k)),I=nr.ensureInt32(S),R=nr.ensureFloat64(new Array(2*h)),L=v(w,h,I,R);return L&&k5(m,h,R),L};function r(u,c,h,p,m){return e("dms",u,c,h,p,m)}function n(u,c,h,p){return t("dms",u,c,h,p)}function s(u,c,h,p,m){return e("ddm",u,c,h,p,m)}function o(u,c,h,p){return t("ddm",u,c,h,p)}function a(u,c,h,p,m){return e("dd",u,c,h,p,m)}function l(u,c,h,p){return t("dd",u,c,h,p)}i.geogToDms=r,i.dmsToGeog=n,i.geogToDdm=s,i.ddmToGeog=o,i.geogToDd=a,i.ddToGeog=l}(a5e||(a5e={})),function(i){function e(){i.PE_MGRS_STYLE_NEW=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,i.PE_MGRS_STYLE_OLD=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,i.PE_MGRS_STYLE_AUTO=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,i.PE_MGRS_180_ZONE_1_PLUS=nr.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,i.PE_MGRS_ADD_SPACES=nr.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function t(n,s,o,a,l,u,c){nr.ensureCache.prepare();let h=0;n&&(h=nr.getPointer(n));const p=S6(o),m=nr.ensureFloat64(p),v=Pce(s,ku.PE_MGRS_MAX),w=nr.ensureInt32(v),S=nr._pe_geog_to_mgrs_extended(h,s,m,a,l,u,w);if(S)for(let I=0;Inr.ensureString(v)),h=nr.ensureInt32(c),p=nr.ensureFloat64(new Array(2*s)),m=nr._pe_mgrs_to_geog_extended(u,s,h,a,p);return m&&k5(l,s,p),m}i.init=e,i.geogToMgrsExtended=t,i.mgrsToGeogExtended=r}(kve||(kve={})),function(i){function e(r,n,s,o,a,l,u){nr.ensureCache.prepare();let c=0;r&&(c=nr.getPointer(r));const h=S6(s),p=nr.ensureFloat64(h),m=Pce(n,ku.PE_MGRS_MAX),v=nr.ensureInt32(m),w=nr._pe_geog_to_usng(c,n,p,o,a,l,v);if(w)for(let S=0;Snr.ensureString(p)),u=nr.ensureInt32(l),c=nr.ensureFloat64(new Array(2*n)),h=nr._pe_usng_to_geog(a,n,u,c);return h&&k5(o,n,c),h}i.geogToUsng=e,i.usngToGeog=t}(l5e||(l5e={})),function(i){function e(){i.PE_UTM_OPTS_NONE=nr.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,i.PE_UTM_OPTS_ADD_SPACES=nr.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,i.PE_UTM_OPTS_NS=nr.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function t(n,s,o,a,l){nr.ensureCache.prepare();let u=0;n&&(u=nr.getPointer(n));const c=S6(o),h=nr.ensureFloat64(c),p=Pce(s,ku.PE_UTM_MAX),m=nr.ensureInt32(p),v=nr._pe_geog_to_utm(u,s,h,a,m);if(v)for(let w=0;wnr.ensureString(v)),h=nr.ensureInt32(c),p=nr.ensureFloat64(new Array(2*s)),m=nr._pe_utm_to_geog(u,s,h,a,p);return m&&k5(l,s,p),m}i.init=e,i.geogToUtm=t,i.utmToGeog=r}(Lve||(Lve={})),function(i){const e=new Map;function t(){i.PE_PCSINFO_OPTION_NONE=nr.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,i.PE_PCSINFO_OPTION_DOMAIN=nr.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,i.PE_POLE_OUTSIDE_BOUNDARY=nr.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,i.PE_POLE_POINT=nr.PePCSInfo.prototype.PE_POLE_POINT}function r(n,s=i.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return e.has(n)&&(a=e.get(n),a[s]&&(o=a[s])),o||(o=nr.PePCSInfo.prototype.generate(n,s),a||(a=[],e.set(n,a)),a[s]=o),o}i.init=t,i.generate=r}(Sne||(Sne={})),function(i){function e(){return nr.PeVersion.prototype.version_string()}i.versionString=e}(u5e||(u5e={}));const Eqi=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return xne},get PeDefs(){return ku},get PeFactory(){return tx},get PeGCSExtent(){return mEt},get PeGTTransformations(){return Fve},get PeGTlistExtended(){return Dve},get PeGTlistExtendedEntry(){return o5e},get PeNotationDms(){return a5e},get PeNotationMgrs(){return kve},get PeNotationUsng(){return l5e},get PeNotationUtm(){return Lve},get PePCSInfo(){return Sne},get PeVersion(){return u5e},_init:gEt,get _pe(){return nr},isLoaded:hze,isSupported:Cqi,load:fEt},Symbol.toStringTag,{value:"Module"}));var Y9;(function(i){i[i.CGCS2000=4490]="CGCS2000",i[i.GCSMARS2000=104971]="GCSMARS2000",i[i.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",i[i.GCSMOON2000=104903]="GCSMOON2000"})(Y9||(Y9={}));let se;const Qt={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(se=2e3;se<=2045;se++)Qt[se]=0;for(se=2056;se<=2065;se++)Qt[se]=0;for(se=2067;se<=2135;se++)Qt[se]=0;for(se=2137;se<=2154;se++)Qt[se]=0;for(se=2161;se<=2170;se++)Qt[se]=0;for(se=2172;se<=2193;se++)Qt[se]=0;for(se=2195;se<=2198;se++)Qt[se]=0;for(se=2200;se<=2203;se++)Qt[se]=0;for(se=2205;se<=2217;se++)Qt[se]=0;for(se=2222;se<=2224;se++)Qt[se]=1;for(se=2225;se<=2250;se++)Qt[se]=2;for(se=2251;se<=2253;se++)Qt[se]=1;for(se=2257;se<=2264;se++)Qt[se]=2;for(se=2274;se<=2279;se++)Qt[se]=2;for(se=2280;se<=2282;se++)Qt[se]=1;for(se=2283;se<=2289;se++)Qt[se]=2;for(se=2290;se<=2292;se++)Qt[se]=0;for(se=2308;se<=2313;se++)Qt[se]=0;for(se=2315;se<=2491;se++)Qt[se]=0;for(se=2494;se<=2866;se++)Qt[se]=0;for(se=2867;se<=2869;se++)Qt[se]=1;for(se=2870;se<=2888;se++)Qt[se]=2;for(se=2891;se<=2895;se++)Qt[se]=2;for(se=2896;se<=2898;se++)Qt[se]=1;for(se=2902;se<=2908;se++)Qt[se]=2;for(se=2915;se<=2920;se++)Qt[se]=2;for(se=2921;se<=2923;se++)Qt[se]=1;for(se=2924;se<=2930;se++)Qt[se]=2;for(se=2931;se<=2962;se++)Qt[se]=0;for(se=2964;se<=2968;se++)Qt[se]=2;for(se=2969;se<=2973;se++)Qt[se]=0;for(se=2975;se<=2991;se++)Qt[se]=0;for(se=2995;se<=3051;se++)Qt[se]=0;for(se=3054;se<=3079;se++)Qt[se]=0;for(se=3081;se<=3088;se++)Qt[se]=0;for(se=3092;se<=3101;se++)Qt[se]=0;for(se=3106;se<=3138;se++)Qt[se]=0;for(se=3146;se<=3151;se++)Qt[se]=0;for(se=3153;se<=3166;se++)Qt[se]=0;for(se=3168;se<=3172;se++)Qt[se]=0;for(se=3174;se<=3203;se++)Qt[se]=0;for(se=3294;se<=3358;se++)Qt[se]=0;for(se=3367;se<=3403;se++)Qt[se]=0;for(se=3408;se<=3416;se++)Qt[se]=0;for(se=3417;se<=3438;se++)Qt[se]=2;for(se=3441;se<=3446;se++)Qt[se]=2;for(se=3447;se<=3450;se++)Qt[se]=0;for(se=3451;se<=3459;se++)Qt[se]=2;for(se=3460;se<=3478;se++)Qt[se]=0;for(se=3554;se<=3559;se++)Qt[se]=0;for(se=3560;se<=3570;se++)Qt[se]=2;for(se=3571;se<=3581;se++)Qt[se]=0;for(se=3594;se<=3597;se++)Qt[se]=0;for(se=3601;se<=3604;se++)Qt[se]=0;for(se=3637;se<=3639;se++)Qt[se]=0;for(se=3665;se<=3667;se++)Qt[se]=0;for(se=3693;se<=3695;se++)Qt[se]=0;for(se=3701;se<=3727;se++)Qt[se]=0;for(se=3728;se<=3739;se++)Qt[se]=2;for(se=3740;se<=3751;se++)Qt[se]=0;for(se=3753;se<=3760;se++)Qt[se]=2;for(se=3761;se<=3773;se++)Qt[se]=0;for(se=3775;se<=3777;se++)Qt[se]=0;for(se=3779;se<=3781;se++)Qt[se]=0;for(se=3783;se<=3785;se++)Qt[se]=0;for(se=3788;se<=3791;se++)Qt[se]=0;for(se=3797;se<=3802;se++)Qt[se]=0;for(se=3814;se<=3816;se++)Qt[se]=0;for(se=3825;se<=3829;se++)Qt[se]=0;for(se=3832;se<=3841;se++)Qt[se]=0;for(se=3844;se<=3852;se++)Qt[se]=0;for(se=3873;se<=3885;se++)Qt[se]=0;for(se=3890;se<=3893;se++)Qt[se]=0;for(se=3907;se<=3912;se++)Qt[se]=0;for(se=3942;se<=3950;se++)Qt[se]=0;for(se=3968;se<=3970;se++)Qt[se]=0;for(se=3973;se<=3976;se++)Qt[se]=0;for(se=3986;se<=3989;se++)Qt[se]=0;for(se=3994;se<=3997;se++)Qt[se]=0;for(se=4048;se<=4051;se++)Qt[se]=0;for(se=4056;se<=4063;se++)Qt[se]=0;for(se=4093;se<=4096;se++)Qt[se]=0;for(se=4390;se<=4398;se++)Qt[se]=0;for(se=4399;se<=4413;se++)Qt[se]=2;for(se=4418;se<=4433;se++)Qt[se]=2;for(se=4455;se<=4457;se++)Qt[se]=2;for(se=4484;se<=4489;se++)Qt[se]=0;for(se=4491;se<=4554;se++)Qt[se]=0;for(se=4568;se<=4589;se++)Qt[se]=0;for(se=4652;se<=4656;se++)Qt[se]=0;for(se=4766;se<=4800;se++)Qt[se]=0;for(se=5014;se<=5016;se++)Qt[se]=0;for(se=5069;se<=5072;se++)Qt[se]=0;for(se=5105;se<=5130;se++)Qt[se]=0;for(se=5167;se<=5188;se++)Qt[se]=0;for(se=5253;se<=5259;se++)Qt[se]=0;for(se=5269;se<=5275;se++)Qt[se]=0;for(se=5292;se<=5311;se++)Qt[se]=0;for(se=5329;se<=5331;se++)Qt[se]=0;for(se=5343;se<=5349;se++)Qt[se]=0;for(se=5355;se<=5357;se++)Qt[se]=0;for(se=5387;se<=5389;se++)Qt[se]=0;for(se=5459;se<=5463;se++)Qt[se]=0;for(se=5479;se<=5482;se++)Qt[se]=0;for(se=5518;se<=5520;se++)Qt[se]=0;for(se=5530;se<=5539;se++)Qt[se]=0;for(se=5550;se<=5552;se++)Qt[se]=0;for(se=5562;se<=5583;se++)Qt[se]=0;for(se=5623;se<=5625;se++)Qt[se]=2;for(se=5631;se<=5639;se++)Qt[se]=0;for(se=5649;se<=5653;se++)Qt[se]=0;for(se=5663;se<=5680;se++)Qt[se]=0;for(se=5682;se<=5685;se++)Qt[se]=0;for(se=5875;se<=5877;se++)Qt[se]=0;for(se=5896;se<=5899;se++)Qt[se]=0;for(se=5921;se<=5940;se++)Qt[se]=0;for(se=6050;se<=6125;se++)Qt[se]=0;for(se=6244;se<=6275;se++)Qt[se]=0;for(se=6328;se<=6348;se++)Qt[se]=0;for(se=6350;se<=6356;se++)Qt[se]=0;for(se=6366;se<=6372;se++)Qt[se]=0;for(se=6381;se<=6387;se++)Qt[se]=0;for(se=6393;se<=6404;se++)Qt[se]=0;for(se=6480;se<=6483;se++)Qt[se]=0;for(se=6511;se<=6514;se++)Qt[se]=0;for(se=6579;se<=6581;se++)Qt[se]=0;for(se=6619;se<=6624;se++)Qt[se]=0;for(se=6625;se<=6627;se++)Qt[se]=2;for(se=6628;se<=6632;se++)Qt[se]=0;for(se=6634;se<=6637;se++)Qt[se]=0;for(se=6669;se<=6692;se++)Qt[se]=0;for(se=6707;se<=6709;se++)Qt[se]=0;for(se=6720;se<=6723;se++)Qt[se]=0;for(se=6732;se<=6738;se++)Qt[se]=0;for(se=6931;se<=6933;se++)Qt[se]=0;for(se=6956;se<=6959;se++)Qt[se]=0;for(se=7005;se<=7007;se++)Qt[se]=0;for(se=7057;se<=7070;se++)Qt[se]=2;for(se=7074;se<=7082;se++)Qt[se]=0;for(se=7109;se<=7118;se++)Qt[se]=0;for(se=7119;se<=7127;se++)Qt[se]=1;for(se=7374;se<=7376;se++)Qt[se]=0;for(se=7528;se<=7586;se++)Qt[se]=0;for(se=7587;se<=7645;se++)Qt[se]=2;for(se=7692;se<=7696;se++)Qt[se]=0;for(se=7755;se<=7787;se++)Qt[se]=0;for(se=7791;se<=7795;se++)Qt[se]=0;for(se=7799;se<=7801;se++)Qt[se]=0;for(se=7803;se<=7805;se++)Qt[se]=0;for(se=7825;se<=7831;se++)Qt[se]=0;for(se=7845;se<=7859;se++)Qt[se]=0;for(se=8013;se<=8032;se++)Qt[se]=0;for(se=8065;se<=8068;se++)Qt[se]=1;for(se=8518;se<=8529;se++)Qt[se]=2;for(se=8533;se<=8536;se++)Qt[se]=2;for(se=8538;se<=8540;se++)Qt[se]=2;for(se=8677;se<=8679;se++)Qt[se]=0;for(se=8836;se<=8840;se++)Qt[se]=0;for(se=8857;se<=8859;se++)Qt[se]=0;for(se=8908;se<=8910;se++)Qt[se]=0;for(se=9154;se<=9159;se++)Qt[se]=0;for(se=9205;se<=9218;se++)Qt[se]=0;for(se=9271;se<=9273;se++)Qt[se]=0;for(se=9295;se<=9297;se++)Qt[se]=0;for(se=9356;se<=9360;se++)Qt[se]=0;for(se=9404;se<=9407;se++)Qt[se]=0;for(se=9476;se<=9482;se++)Qt[se]=0;for(se=9487;se<=9494;se++)Qt[se]=0;for(se=9697;se<=9699;se++)Qt[se]=0;for(se=9821;se<=9865;se++)Qt[se]=0;for(se=10285;se<=10291;se++)Qt[se]=0;for(se=10314;se<=10317;se++)Qt[se]=0;for(se=10448;se<=10465;se++)Qt[se]=0;for(se=11114;se<=11118;se++)Qt[se]=0;for(se=20004;se<=20032;se++)Qt[se]=0;for(se=20047;se<=20049;se++)Qt[se]=0;for(se=20062;se<=20092;se++)Qt[se]=0;for(se=20135;se<=20138;se++)Qt[se]=0;for(se=20248;se<=20258;se++)Qt[se]=0;for(se=20348;se<=20358;se++)Qt[se]=0;for(se=20436;se<=20440;se++)Qt[se]=0;for(se=20822;se<=20824;se++)Qt[se]=0;for(se=20904;se<=20932;se++)Qt[se]=0;for(se=20934;se<=20936;se++)Qt[se]=0;for(se=21004;se<=21032;se++)Qt[se]=0;for(se=21035;se<=21037;se++)Qt[se]=0;for(se=21095;se<=21097;se++)Qt[se]=0;for(se=21148;se<=21150;se++)Qt[se]=0;for(se=21207;se<=21264;se++)Qt[se]=0;for(se=21307;se<=21364;se++)Qt[se]=0;for(se=21413;se<=21423;se++)Qt[se]=0;for(se=21453;se<=21463;se++)Qt[se]=0;for(se=21473;se<=21483;se++)Qt[se]=0;for(se=21780;se<=21782;se++)Qt[se]=0;for(se=21891;se<=21894;se++)Qt[se]=0;for(se=21896;se<=21899;se++)Qt[se]=0;for(se=22171;se<=22177;se++)Qt[se]=0;for(se=22181;se<=22187;se++)Qt[se]=0;for(se=22191;se<=22197;se++)Qt[se]=0;for(se=22207;se<=22222;se++)Qt[se]=0;for(se=22229;se<=22232;se++)Qt[se]=0;for(se=22234;se<=22236;se++)Qt[se]=0;for(se=22243;se<=22250;se++)Qt[se]=0;for(se=22262;se<=22265;se++)Qt[se]=0;for(se=22307;se<=22322;se++)Qt[se]=0;for(se=22348;se<=22357;se++)Qt[se]=0;for(se=22407;se<=22422;se++)Qt[se]=0;for(se=22462;se<=22465;se++)Qt[se]=0;for(se=22521;se<=22525;se++)Qt[se]=0;for(se=22607;se<=22622;se++)Qt[se]=0;for(se=22641;se<=22646;se++)Qt[se]=0;for(se=22648;se<=22657;se++)Qt[se]=0;for(se=22707;se<=22722;se++)Qt[se]=0;for(se=22762;se<=22765;se++)Qt[se]=0;for(se=22807;se<=22822;se++)Qt[se]=0;for(se=22991;se<=22994;se++)Qt[se]=0;for(se=23028;se<=23038;se++)Qt[se]=0;for(se=23301;se<=23333;se++)Qt[se]=2;for(se=23830;se<=23853;se++)Qt[se]=0;for(se=23866;se<=23872;se++)Qt[se]=0;for(se=23877;se<=23884;se++)Qt[se]=0;for(se=23886;se<=23894;se++)Qt[se]=0;for(se=23946;se<=23948;se++)Qt[se]=0;for(se=24311;se<=24313;se++)Qt[se]=0;for(se=24342;se<=24347;se++)Qt[se]=0;for(se=24370;se<=24374;se++)Qt[se]=10;for(se=24375;se<=24381;se++)Qt[se]=0;for(se=24718;se<=24721;se++)Qt[se]=0;for(se=24817;se<=24821;se++)Qt[se]=0;for(se=24877;se<=24882;se++)Qt[se]=0;for(se=24891;se<=24893;se++)Qt[se]=0;for(se=25391;se<=25395;se++)Qt[se]=0;for(se=25828;se<=25838;se++)Qt[se]=0;for(se=26191;se<=26195;se++)Qt[se]=0;for(se=26391;se<=26393;se++)Qt[se]=0;for(se=26701;se<=26722;se++)Qt[se]=0;for(se=26729;se<=26799;se++)Qt[se]=2;for(se=26801;se<=26803;se++)Qt[se]=2;for(se=26811;se<=26813;se++)Qt[se]=2;for(se=26847;se<=26870;se++)Qt[se]=2;for(se=26891;se<=26899;se++)Qt[se]=0;for(se=26901;se<=26923;se++)Qt[se]=0;for(se=26929;se<=26946;se++)Qt[se]=0;for(se=26948;se<=26998;se++)Qt[se]=0;for(se=27037;se<=27040;se++)Qt[se]=0;for(se=27205;se<=27232;se++)Qt[se]=0;for(se=27258;se<=27260;se++)Qt[se]=0;for(se=27391;se<=27398;se++)Qt[se]=0;for(se=27561;se<=27564;se++)Qt[se]=0;for(se=27571;se<=27574;se++)Qt[se]=0;for(se=27581;se<=27584;se++)Qt[se]=0;for(se=27591;se<=27594;se++)Qt[se]=0;for(se=28191;se<=28193;se++)Qt[se]=0;for(se=28348;se<=28358;se++)Qt[se]=0;for(se=28402;se<=28432;se++)Qt[se]=0;for(se=28462;se<=28492;se++)Qt[se]=0;for(se=29118;se<=29122;se++)Qt[se]=0;for(se=29168;se<=29172;se++)Qt[se]=0;for(se=29177;se<=29185;se++)Qt[se]=0;for(se=29187;se<=29195;se++)Qt[se]=0;for(se=29900;se<=29903;se++)Qt[se]=0;for(se=30161;se<=30179;se++)Qt[se]=0;for(se=30491;se<=30494;se++)Qt[se]=0;for(se=30729;se<=30732;se++)Qt[se]=0;for(se=31251;se<=31259;se++)Qt[se]=0;for(se=31265;se<=31268;se++)Qt[se]=0;for(se=31275;se<=31279;se++)Qt[se]=0;for(se=31281;se<=31297;se++)Qt[se]=0;for(se=31461;se<=31469;se++)Qt[se]=0;for(se=31491;se<=31495;se++)Qt[se]=0;for(se=31917;se<=31922;se++)Qt[se]=0;for(se=31965;se<=32e3;se++)Qt[se]=0;for(se=32001;se<=32003;se++)Qt[se]=2;for(se=32005;se<=32031;se++)Qt[se]=2;for(se=32033;se<=32060;se++)Qt[se]=2;for(se=32064;se<=32067;se++)Qt[se]=2;for(se=32074;se<=32077;se++)Qt[se]=2;for(se=32081;se<=32086;se++)Qt[se]=0;for(se=32107;se<=32130;se++)Qt[se]=0;for(se=32133;se<=32159;se++)Qt[se]=0;for(se=32164;se<=32167;se++)Qt[se]=2;for(se=32180;se<=32199;se++)Qt[se]=0;for(se=32201;se<=32260;se++)Qt[se]=0;for(se=32301;se<=32360;se++)Qt[se]=0;for(se=32401;se<=32460;se++)Qt[se]=0;for(se=32501;se<=32560;se++)Qt[se]=0;for(se=32601;se<=32662;se++)Qt[se]=0;for(se=32664;se<=32667;se++)Qt[se]=2;for(se=32701;se<=32761;se++)Qt[se]=0;for(se=53001;se<=53004;se++)Qt[se]=0;for(se=53008;se<=53019;se++)Qt[se]=0;for(se=53021;se<=53032;se++)Qt[se]=0;for(se=53034;se<=53037;se++)Qt[se]=0;for(se=53042;se<=53046;se++)Qt[se]=0;for(se=53074;se<=53080;se++)Qt[se]=0;for(se=54001;se<=54004;se++)Qt[se]=0;for(se=54008;se<=54019;se++)Qt[se]=0;for(se=54021;se<=54032;se++)Qt[se]=0;for(se=54034;se<=54037;se++)Qt[se]=0;for(se=54042;se<=54046;se++)Qt[se]=0;for(se=54048;se<=54053;se++)Qt[se]=0;for(se=54074;se<=54080;se++)Qt[se]=0;for(se=54098;se<=54101;se++)Qt[se]=0;for(se=102001;se<=102040;se++)Qt[se]=0;for(se=102042;se<=102063;se++)Qt[se]=0;for(se=102065;se<=102067;se++)Qt[se]=0;for(se=102070;se<=102117;se++)Qt[se]=0;for(se=102122;se<=102216;se++)Qt[se]=0;for(se=102221;se<=102377;se++)Qt[se]=0;for(se=102382;se<=102388;se++)Qt[se]=0;for(se=102389;se<=102398;se++)Qt[se]=2;for(se=102399;se<=102444;se++)Qt[se]=0;for(se=102445;se<=102447;se++)Qt[se]=2;for(se=102448;se<=102458;se++)Qt[se]=0;for(se=102459;se<=102468;se++)Qt[se]=2;for(se=102469;se<=102499;se++)Qt[se]=0;for(se=102500;se<=102519;se++)Qt[se]=1;for(se=102520;se<=102524;se++)Qt[se]=0;for(se=102525;se<=102529;se++)Qt[se]=2;for(se=102530;se<=102588;se++)Qt[se]=0;for(se=102590;se<=102598;se++)Qt[se]=0;for(se=102601;se<=102603;se++)Qt[se]=0;for(se=102605;se<=102628;se++)Qt[se]=0;for(se=102629;se<=102646;se++)Qt[se]=2;for(se=102648;se<=102700;se++)Qt[se]=2;for(se=102701;se<=102703;se++)Qt[se]=0;for(se=102707;se<=102730;se++)Qt[se]=2;for(se=102733;se<=102758;se++)Qt[se]=2;for(se=102767;se<=102900;se++)Qt[se]=0;for(se=102901;se<=102933;se++)Qt[se]=2;for(se=102934;se<=102950;se++)Qt[se]=13;for(se=102951;se<=102955;se++)Qt[se]=0;for(se=102961;se<=102963;se++)Qt[se]=0;for(se=102965;se<=102969;se++)Qt[se]=0;for(se=102971;se<=102973;se++)Qt[se]=0;for(se=102975;se<=102989;se++)Qt[se]=0;for(se=102990;se<=102992;se++)Qt[se]=1;for(se=102997;se<=103002;se++)Qt[se]=0;for(se=103003;se<=103008;se++)Qt[se]=2;for(se=103009;se<=103011;se++)Qt[se]=0;for(se=103012;se<=103014;se++)Qt[se]=2;for(se=103019;se<=103021;se++)Qt[se]=0;for(se=103022;se<=103024;se++)Qt[se]=2;for(se=103029;se<=103031;se++)Qt[se]=0;for(se=103032;se<=103034;se++)Qt[se]=2;for(se=103065;se<=103068;se++)Qt[se]=0;for(se=103074;se<=103076;se++)Qt[se]=0;for(se=103077;se<=103079;se++)Qt[se]=1;for(se=103080;se<=103082;se++)Qt[se]=0;for(se=103083;se<=103085;se++)Qt[se]=2;for(se=103090;se<=103093;se++)Qt[se]=0;for(se=103097;se<=103099;se++)Qt[se]=0;for(se=103100;se<=103102;se++)Qt[se]=2;for(se=103107;se<=103109;se++)Qt[se]=0;for(se=103110;se<=103112;se++)Qt[se]=2;for(se=103113;se<=103116;se++)Qt[se]=0;for(se=103117;se<=103120;se++)Qt[se]=2;for(se=103153;se<=103157;se++)Qt[se]=0;for(se=103158;se<=103162;se++)Qt[se]=2;for(se=103163;se<=103165;se++)Qt[se]=0;for(se=103166;se<=103168;se++)Qt[se]=1;for(se=103169;se<=103171;se++)Qt[se]=2;for(se=103186;se<=103188;se++)Qt[se]=0;for(se=103189;se<=103191;se++)Qt[se]=2;for(se=103192;se<=103195;se++)Qt[se]=0;for(se=103196;se<=103199;se++)Qt[se]=2;for(se=103200;se<=103224;se++)Qt[se]=0;for(se=103225;se<=103227;se++)Qt[se]=1;for(se=103232;se<=103237;se++)Qt[se]=0;for(se=103238;se<=103243;se++)Qt[se]=2;for(se=103244;se<=103246;se++)Qt[se]=0;for(se=103247;se<=103249;se++)Qt[se]=2;for(se=103254;se<=103256;se++)Qt[se]=0;for(se=103257;se<=103259;se++)Qt[se]=2;for(se=103264;se<=103266;se++)Qt[se]=0;for(se=103267;se<=103269;se++)Qt[se]=2;for(se=103300;se<=103375;se++)Qt[se]=0;for(se=103381;se<=103383;se++)Qt[se]=0;for(se=103384;se<=103386;se++)Qt[se]=1;for(se=103387;se<=103389;se++)Qt[se]=0;for(se=103390;se<=103392;se++)Qt[se]=2;for(se=103397;se<=103399;se++)Qt[se]=0;for(se=103400;se<=103471;se++)Qt[se]=2;for(se=103476;se<=103478;se++)Qt[se]=0;for(se=103479;se<=103481;se++)Qt[se]=2;for(se=103486;se<=103488;se++)Qt[se]=0;for(se=103489;se<=103491;se++)Qt[se]=2;for(se=103492;se<=103495;se++)Qt[se]=0;for(se=103496;se<=103499;se++)Qt[se]=2;for(se=103528;se<=103543;se++)Qt[se]=0;for(se=103544;se<=103548;se++)Qt[se]=2;for(se=103549;se<=103551;se++)Qt[se]=0;for(se=103552;se<=103554;se++)Qt[se]=1;for(se=103555;se<=103557;se++)Qt[se]=2;for(se=103558;se<=103560;se++)Qt[se]=0;for(se=103571;se<=103573;se++)Qt[se]=0;for(se=103574;se<=103576;se++)Qt[se]=2;for(se=103577;se<=103580;se++)Qt[se]=0;for(se=103581;se<=103583;se++)Qt[se]=2;for(se=103595;se<=103694;se++)Qt[se]=0;for(se=103696;se<=103699;se++)Qt[se]=0;for(se=103700;se<=103793;se++)Qt[se]=2;for(se=103794;se<=103890;se++)Qt[se]=0;for(se=103891;se<=103896;se++)Qt[se]=2;for(se=103900;se<=103971;se++)Qt[se]=2;for(se=103972;se<=103977;se++)Qt[se]=0;for(se=112e3;se<=112101;se++)Qt[se]=0;const yEt=[102100,102113,3857,3785],Iqi=[104905,104971],Aqi=[4326,...yEt,...Iqi],mrt='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',Rce=[-20037508342788905e-9,20037508342788905e-9],Dce=[-20037508342787e-6,20037508342787e-6],vEt={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Rce,origin:Dce,dx:1e-5},102100:{wkTemplate:mrt,valid:Rce,origin:Dce,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Rce,origin:Dce,dx:1e-5},3857:{wkTemplate:mrt,valid:Rce,origin:Dce,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Ya(i,e){if(i===e)return!0;if(i==null||e==null)return!1;const t=i.wkid,r=e.wkid;if(t!=null||r!=null){if(t===r||Nb(i)&&Nb(e))return!0;const o=i.latestWkid;if(o!=null&&r===o)return!0;const a=e.latestWkid;return a!=null&&t===a}let n,s;return i.wkt2&&e.wkt2?(n=i.wkt2,s=e.wkt2):i.wkt&&e.wkt&&(n=i.wkt,s=e.wkt),!(!n||!s)&&n.toUpperCase()===s.toUpperCase()}function Zp(i){const e=i?.wkid;return e!=null&&e>=2e3&&vEt[e]||null}function Hv(i){if(!i)return;const{wkid:e,vcsWkid:t}=i;if(e)return t?JSON.stringify({wkid:e,vcsWkid:t}):String(e);const r=i.wkt||i.wkt2;return JSON.stringify(r?t?{wkt:r,vcsWkid:t}:{wkt:r}:{})}function iae(i){if(!Cm(i))return!1;const{wkid:e}=i;if(e)return Qt[e]==null;const t=i.wkt2||i.wkt;return!!t&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(t)}function Mqi(i){return!(dze(i)||pze(i))}function fE(i){return i?.wkid===4326}function Oqi(i){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(i)}function Pqi(i){return i?.wkid===Y9.CGCS2000}function Nb(i){const e=i?.wkid;return e!=null&&e>=2e3&&yEt.includes(e)}function c5e(i){return i?.wkid===32662}function eW(i){return i===Y9.GCSMARS2000||i===Y9.GCSMARS2000_SPHERE}function dze(i){return eW(i?.wkid)}function tW(i){return i===Y9.GCSMOON2000}function pze(i){return tW(i?.wkid)}function _Et(i){const e=i?.wkid;return e!=null&&e>=2e3&&Aqi.includes(e)}function Cm(i){if(i==null)return!1;const e=i.wkid;return e!=null&&e>=2e3||i.wkt2!=null||i.wkt!=null}const Yp={wkid:4326,wkt:m0(vEt[4326].wkTemplate,{Central_Meridian:"0.0"})},Nve={wkid:102100,latestWkid:3857},Rqi={wkid:32662};function fze(i){return{wkt:`GEOCCS["Spherical geocentric", +`);return a}setAtOrigin(e,t,r){const n=this.propertiesByName.get(e);if(Ice(n))return this._setAtOrigin(n,t,r)}isOverridden(e){const t=this.propertiesByName.get(e);return t!==void 0&&!!(t.flags&Nc.Overridden)}clearOverride(e){const t=this.propertiesByName.get(e);t&&t.flags&Nc.Overridden&&(t.flags&=~Nc.Overridden,t.notifyChange())}override(e,t){const r=this.propertiesByName.get(e);if(!Yit(r,e,t,this))return;const n=r.metadata.cast;if(n){const s=this._cast(n,t),{valid:o,value:a}=s;if(VAe.release(s),!o)return;t=a}r.flags|=Nc.Overridden,this._internalSet(r,t)}set(e,t){const r=this.propertiesByName.get(e);if(!Yit(r,e,t,this))return;const n=r.metadata.cast;if(n){const o=this._cast(n,t),{valid:a,value:l}=o;if(VAe.release(o),!a)return;t=l}const s=r.metadata.set;s?s.call(this.host,t):this._internalSet(r,t)}setDefaultOrigin(e){this._origin=n0(e)}getDefaultOrigin(){return yne(this._origin)}notifyChange(e){const t=this.propertiesByName.get(e);t!==void 0&&t.notifyChange()}invalidate(e){const t=this.propertiesByName.get(e);t!==void 0&&t.invalidate()}commit(e){const t=this.propertiesByName.get(e);t!==void 0&&t.commit()}_internalSet(e,t){const r=this.lifecycle!==ub.INITIALIZING?this._origin:Pn.DEFAULTS;this._setAtOrigin(e,t,r)}_setAtOrigin(e,t,r){const n=this.store,s=e.propertyName;n.has(s,r)&&jUe(t,n.get(s))&&~e.flags&Nc.Overridden&&r===n.originOf(s)||(e.invalidate(),n.set(s,t,r),e.commit(),aCt(this.host,e))}_cast(e,t){const r=VAe.acquire();return r.valid=!0,r.value=t,e&&(r.value=e.call(this.host,t,r)),r}},BVi=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const VAe=new G3(BVi);function gve(i,e,t){if(i&&e)if(typeof e=="object")for(const r of Object.getOwnPropertyNames(e))gve(i,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(-1,1)[0];return void gve(_S(i,n),s,t)}const r=i.__accessor__;r!=null&&jVi(e,r),i[e]=t}}function jVi(i,e){if(yi("esri-unknown-property-errors")&&!GVi(i,e))throw new qe("set:unknown-property",UVi(i,e))}function GVi(i,e){return e.metadata[i]!=null}function UVi(i,e){return"setting unknown property '"+i+"' on instance of "+e.host.declaredClass}let zVi;function VVi(){return zVi}var Xit;(function(i){i[i.Ignore=0]="Ignore",i[i.Destroy=1]="Destroy",i[i.ThrowError=2]="ThrowError"})(Xit||(Xit={}));function HVi(i){i.length=0}let Ky=class{constructor(e=50,t=50){this._pool=new G3(Array,void 0,HVi,t,e)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return HAe.acquire()}static release(e){return HAe.release(e)}static prune(){HAe.prune()}};const HAe=new Ky(100);let cCt=class extends G3{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const t=super.acquire(...e);return this._set.delete(t),t}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const Ace=[];function z9(i){Ace.push(i),Ace.length===1&&queueMicrotask(()=>{const e=Ace.slice();Ace.length=0;for(const t of e)t()})}let fie=class{constructor(e,t=30){this.name=e,this._counter=0,this._samples=new Array(t)}record(e){e!=null&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,t)=>e-t)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,t)=>e+t,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var $4e;(function(i){const e=(s,o,a,l)=>{let u=o,c=o;const h=a>>>1,p=s[u-1];for(;c<=h;){c=u<<1,cso?1:0;function r(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=t);for(let c=a>>>1;c>o;c--)e(s,c,a,l);const u=o+1;for(let c=a-1;c>o;c--){const h=s[o];s[o]=s[c],s[c]=h,e(s,u,c,l)}}function*n(s,o,a,l){o===void 0&&(o=0),a===void 0&&(a=s.length),l===void 0&&(l=t);for(let c=a>>>1;c>o;c--)e(s,c,a,l),yield;const u=o+1;for(let c=a-1;c>o;c--){const h=s[o];s[o]=s[c],s[c]=h,e(s,u,c,l),yield}}i.sort=r,i.iterableSort=n})($4e||($4e={}));const Jit=$4e,WVi=1.5,qVi=1.1;let mg=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new Yxe,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),e.deallocator!==void 0&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>Kit(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const t=new Array;for(let r=0;r=this._length))return this.data[e]}includes(e,t){const r=this.data.indexOf(e,t);return r!==-1&&rthis._length){if(this._allocator){for(;this._length=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,t=e.length,r){this.length=lVi(this.data,e,this.length,t,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,t){if(e>=this.length||t>=this.length||e===t)return;const r=this.data[e];this.data[e]=this.data[t],this.data[t]=r}sort(e){Jit.sort(this.data,0,this.length,e)}iterableSort(e){return Jit.iterableSort(this.data,0,this.length,e)}some(e,t){for(let r=0;rWVi*i.length&&(i.data.length=Math.floor(i.length*qVi))}function YVi(i){return{setTimeout:(e,t)=>{const r=i.setTimeout(e,t);return wa(()=>i.clearTimeout(r))}}}const hY=YVi(globalThis);function e2e(i){return XVi(i)||hCt(i)}function XVi(i){return i!=null&&typeof i=="object"&&"on"in i&&typeof i.on=="function"}function hCt(i){return i!=null&&typeof i=="object"&&"addEventListener"in i&&typeof i.addEventListener=="function"}function BA(i,e,t){if(!e2e(i))throw new TypeError("target is not a Evented or EventTarget object");return hCt(i)?JVi(i,e,t):i.on(e,t)}function JVi(i,e,t,r){if(Array.isArray(e)){const n=e.slice();for(const s of n)i.addEventListener(s,t,r);return wa(()=>{for(const s of n)i.removeEventListener(s,t,r)})}return i.addEventListener(e,t,r),wa(()=>i.removeEventListener(e,t,r))}function HUe(i,e,t){if(!e2e(i))throw new TypeError("target is not a Evented or EventTarget object");if("once"in i)return i.once(e,t);const r=BA(i,e,n=>{r.remove(),t.call(i,n)});return r}function Oc(i="Aborted"){return new qe("AbortError",i)}function hn(i,e="Aborted"){if(xg(i))throw Oc(e)}function D1(i){return i instanceof AbortSignal?i:i?.signal}function xg(i){const e=D1(i);return e!=null&&e.aborted}function _a(i){if(mo(i))throw i}function l3(i){if(!mo(i))throw i}function Qh(i,e){const t=D1(i);if(t!=null){if(!t.aborted)return HUe(t,"abort",()=>e());e()}}function ZH(i,e){const t=D1(i);if(t!=null)return hn(t),HUe(t,"abort",()=>e(Oc()))}function Jg(i,e){return D1(e)==null?i:new Promise((t,r)=>{let n=Qh(e,()=>r(Oc()));const s=()=>{n=Hc(n)};i.then(s,s),i.then(t,r)})}function mo(i){return i?.name==="AbortError"}async function NP(i){try{return await i}catch(e){if(!mo(e))throw e;return}}async function g0(i){if(!i)return;if(typeof i.forEach!="function"){const t=Object.keys(i),r=t.map(o=>i[o]),n=await g0(r),s={};return t.map((o,a)=>s[o]=n[a]),s}const e=i;return Promise.allSettled(e).then(t=>Array.from(e,(r,n)=>{const s=t[n];return s.status==="fulfilled"?{promise:r,value:s.value}:{promise:r,error:s.reason}}))}async function yve(i){return(await Promise.allSettled(i)).filter(e=>e.status==="fulfilled").map(e=>e.value)}async function KVi(i){return(await Promise.allSettled(i)).filter(e=>e.status==="rejected").map(e=>e.reason)}function jk(i,e=void 0,t){const r=new AbortController;return Qh(t,()=>r.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},i);Qh(r,()=>{o&&(clearTimeout(o),s(Oc()))})})}function ZVi(i,e){const t=new AbortController,r=setTimeout(()=>t.abort(),e);return Qh(i,()=>{t.abort(),clearTimeout(r)}),{...i,signal:t.signal}}function qp(i){return i&&typeof i.then=="function"}function B4e(i){return qp(i)?i:Promise.resolve(i)}function xd(i,e=-1){let t,r,n,s,o=null;const a=(...l)=>{if(t){r=l,s&&s.reject(Oc()),s=ac();const p=s.promise;if(o){const m=o;o=null,m.abort()}return p}if(n=s||ac(),s=null,e>0){const p=new AbortController;t=B4e(i(...l,p.signal));const m=t;jk(e).then(()=>{t===m&&(s?p.abort():o=p)})}else t=1,t=B4e(i(...l));const u=()=>{const p=r;r=n=t=o=null,p!=null&&a(...p)},c=t,h=n;return c.then(u,u),c.then(h.resolve,h.reject),h.promise};return a}function ac(){let i,e;const t=new Promise((n,s)=>{i=n,e=s}),r=n=>{i(n)};return r.resolve=n=>i(n),r.reject=n=>e(n),r.timeout=(n,s)=>hY.setTimeout(()=>r.reject(s),n),r.promise=t,r}async function vve(i){await Promise.resolve(),hn(i)}function dCt(i){return 1e3*i}let QVi=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},eHi=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},j4e=0;const _J={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},G4e=["prepare","preRender","render","postRender","update","finish"],U4e=[],V9=new mg;let tHi=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};function iHi(){V8!=null&&(cancelAnimationFrame(V8),V8=requestAnimationFrame(WUe))}const _ve={frameTasks:V9,willDispatch:!1,clearFrameTasks:rHi,dispatch:fCt,executeFrameTasks:nHi,reschedule:iHi};function Gk(i){const e=new eHi(i);return U4e.push(e),_ve.willDispatch||(_ve.willDispatch=!0,z9(fCt)),e}function H9(i){const e=new QVi(i);return V9.push(e),V8==null&&(j4e=performance.now(),V8=requestAnimationFrame(WUe)),new tHi(e)}let V8=null;function rHi(i=!1){V9.forAll(e=>{e.removed=!0}),i&&pCt()}function WUe(){const i=performance.now();V8=null,V8=V9.length>0?requestAnimationFrame(WUe):null,_ve.executeFrameTasks(i)}function nHi(i){const e=i-j4e;j4e=i;const t=1e3/60,r=Math.max(0,e-t);_J.time=i,_J.frameDuration=t-r;for(let n=0;n{a.paused||a.removed||(n===0&&a.ticks++,a.phases[o]&&(_J.elapsedFrameTime=performance.now()-i,_J.deltaTime=a.ticks===0?0:e,a.phases[o]?.call(a,_J)))}),oHi[n].record(performance.now()-s)}pCt(),aHi.record(performance.now()-i)}const Mce=new mg;function pCt(){V9.forAll(i=>{i.removed&&Mce.push(i)}),V9.removeUnorderedMany(Mce.data,Mce.length),Mce.clear()}function fCt(){for(;U4e.length;){const i=U4e.shift();i.isActive&&i.callback()}_ve.willDispatch=!1}function sHi(i=1,e){const t=ac(),r=()=>{xg(e)?t.reject(Oc()):i===0?t():(--i,z9(()=>r()))};return r(),t.promise}const oHi=G4e.map(i=>new fie(i)),aHi=new fie("total");function lHi(i,e){for(const t of i.entries())if(e(t[0]))return!0;return!1}function Zit(i,e){if(!e)return i;for(const t of e)i.add(t);return i}function bve(i,e){const t=new Set;return Zit(t,i),Zit(t,e),t}function z4e(i,e){const t=new Set;for(const r of e)i.has(r)&&t.add(r);return t}function V4e(i,e){if(!i||!e)return!1;if(i===e)return!0;for(const t of i)if(!e.has(t))return!1;return!0}function uHi(i,e){if(i==null&&e==null)return!0;if(i==null||e==null||i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0}function mCt(i,e){const t=new Set(i);for(const r of e)t.delete(r);return t}function cHi(i,e){return mCt(bve(i,e),z4e(i,e))}let hHi=0;function vF(){return++hHi}let t2e=class{constructor(e){this._accessed=[],this._handles=[],this._observerObject=new dHi(e),Qit.register(this,new WeakRef(this._observerObject),this)}destroy(){Qit.unregister(this._observerObject),this._accessed.length=0,this._observerObject?.destroy(),this.clear()}onObservableAccessed(e){const t=this._accessed;t.includes(e)||t.push(e)}onTrackingEnd(){const e=this._handles,t=this._accessed,r=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=pHi}};const Qit=new FinalizationRegistry(i=>{i.deref()?.destroy()});function pHi(){}let OV=!1;const wve=[];function gCt(i,e){let t=new t2e(s),r=null,n=!1;function s(){if(!t||n)return;if(OV)return void _Ct(s);const a=r;t.clear(),OV=!0,n=!0,r=oR(t,i),n=!1,OV=!1,e(r,a),bCt()}function o(){t&&(t.destroy(),t=null,r=null)}return n=!0,r=oR(t,i),n=!1,wa(o)}function yCt(i,e){let t=new t2e(n),r=null;function n(){e(r,o)}function s(){t&&(t.destroy(),t=null),r=null}function o(){return t?(t.clear(),r=oR(t,i),r):null}return o(),wa(s)}function vCt(i){let e=new t2e(r),t=!1;function r(){e&&!t&&(OV?_Ct(r):(e.clear(),OV=!0,t=!0,oR(e,i),t=!1,OV=!1,bCt()))}function n(){e&&(e.destroy(),e=null)}return t=!0,oR(e,i),t=!1,wa(n)}function _Ct(i){wve.includes(i)||wve.unshift(i)}function bCt(){for(;wve.length;)wve.pop()()}var mie;(function(i){i[i.Untracked=0]="Untracked",i[i.Tracked=1]="Tracked"})(mie||(mie={}));let vne=class{constructor(){this.uid=vF(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,t,r,n,s){return this.pool.acquire(mie.Untracked,e,t,r,n,s,jUe)}static acquireTracked(e,t,r,n){return this.pool.acquire(mie.Tracked,e,t,r,null,null,n)}notify(e,t){this.type===mie.Untracked?this.callback.call(this.target,e,t,this.path,this.target):this.callback.call(null,e,t,void 0,void 0)}acquire(e,t,r,n,s,o,a){this.uid=vF(),this.removed=!1,this.type=e,this.oldValue=t,this.callback=r,this.getValue=n,this.target=s,this.path=o,this.equals=a}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=vF(),this.removed=!0}};vne.pool=new cCt(vne);const Hfe=new Ky,$P=new Set;let xve;function Sve(i){$P.delete(i),$P.add(i),xve||(xve=Gk(gHi))}function fHi(i){if(i.removed)return;const e=i.oldValue,t=i.getValue();i.equals(e,t)||(i.oldValue=t,i.notify(t,e))}function mHi(i){for(const e of $P.values())e.target===i&&(e.removed=!0)}function gHi(){let i=10;for(;xve&&i--;){xve=null;const e=yHi(),t=Hfe.acquire();for(const r of e){const n=r.uid;fHi(r),n===r.uid&&r.removed&&t.push(r)}for(const r of $P)r.removed&&(t.push(r),$P.delete(r));for(const r of t)vne.pool.release(r);Hfe.release(t),Hfe.release(e),H4e.forEach(r=>r())}}function yHi(){const i=Hfe.acquire();i.length=$P.size;let e=0;for(const t of $P)i[e]=t,++e;return $P.clear(),i}const H4e=new Set;function vHi(i){return H4e.add(i),wa(()=>H4e.delete(i))}function _Hi(i,e,t){let r=tCt(i,e,t,(n,s,o)=>{let a,l,u=yCt(()=>Xoe(n,s),(c,h)=>{n.__accessor__?.lifecycle===ub.DESTROYED||a&&a.uid!==l?r.remove():(a||(a=vne.acquireUntracked(c,o,h,n,s),l=a.uid),Sve(a))});return wa(()=>{u.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,Sve(a)),a=null),r=u=null})});return r}function bHi(i,e,t){const r=tCt(i,e,t,(n,s,o)=>{let a=!1;return gCt(()=>Xoe(n,s),(l,u)=>{n.__accessor__.lifecycle!==ub.DESTROYED?a||(a=!0,jUe(u,l)||o.call(n,l,u,s,n),a=!1):r.remove()})});return r}function wHi(i,e,t,r=!1){return i.__accessor__&&i.__accessor__.lifecycle!==ub.DESTROYED?r?bHi(i,e,t):_Hi(i,e,t):wa()}function xHi(i,e,t){let r,n,s=yCt(i,(o,a)=>{r&&r.uid!==n?s.remove():(r||(r=vne.acquireTracked(o,e,a,t),n=r.uid),Sve(r))});return wa(()=>{s.remove(),r&&(r.uid!==n||r.removed||(r.removed=!0,Sve(r)),r=null),s=null})}function SHi(i,e,t){let r=!1;return gCt(i,(n,s)=>{r||(r=!0,t(s,n)||e(n,s),r=!1)})}function THi(i,e,t=!1,r=YTt){return t?SHi(i,e,r):xHi(i,e,r)}function ert(i){return lHi($P,e=>e.oldValue===i)}function i2e(i,e){for(const[t,r]of i)if(e(r,t))return!0;return!1}function qh(i,e,t){const r=i.get(e);if(r!==void 0)return r;const n=t();return i.set(e,n),n}function CHi(i){const e=new Map;return t=>(e.has(t)||e.set(t,i(t)),e.get(t))}const PV=()=>di.getLogger("esri.core.accessorSupport.ensureTypes");function EHi(i){return i==null?i:new Date(i)}function IHi(i){return i==null?i:!!i}function Zoe(i){return i==null?i:i.toString()}function Gd(i){return i==null?i:(i=parseFloat(i),isNaN(i)?0:i)}function r2e(i){return i==null?i:Math.round(parseFloat(i))}function wCt(i){return i?.constructor&&i.constructor.__accessorMetadata__!==void 0}function Tve(i,e){return e!=null&&i&&!(e instanceof i)}function xCt(i){return i&&"isCollection"in i}function trt(i){return i?.Type?typeof i.Type=="function"?i.Type:i.Type.base:null}function AHi(i,e){if(!e?.constructor||!xCt(e.constructor))return W4e(i,e)?e:new i(e);const t=trt(i.prototype.itemType),r=trt(e.constructor.prototype.itemType);return t?r?t===r?e:t.prototype.isPrototypeOf(r.prototype)?new i(e):(W4e(i,e),e):new i(e):e}function W4e(i,e){return!!wCt(e)&&(PV().error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+n2e(i)+"'"),!0)}function Cu(i,e){return e==null?e:xCt(i)?AHi(i,e):Tve(i,e)?W4e(i,e)?e:new i(e):e}function n2e(i){return i?.prototype?.declaredClass||"unknown"}const MHi=new WeakMap;function OHi(i){switch(i){case Number:return Gd;case ms:return r2e;case Boolean:return IHi;case String:return Zoe;case Date:return EHi;default:return qh(MHi,i,()=>Cu.bind(null,i))}}function Sd(i,e){const t=OHi(i);return arguments.length===1?t:t(e)}function _ne(i,e,t){return arguments.length===1?_ne.bind(null,i):e&&(Array.isArray(e)?e.map(r=>i(r,t)):[i(e,t)])}function PHi(i,e){return arguments.length===1?_ne(t=>Sd(i,t)):_ne(t=>Sd(i,t),e)}function SCt(i,e,t){return e!==0&&Array.isArray(t)?t.map(r=>SCt(i,e-1,r)):i(t)}function Cve(i,e,t){if(arguments.length===2)return s=>Cve(i,e,s);if(!t)return t;t=SCt(i,e,t);let r=e,n=t;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(n!==void 0)for(let s=0;sSd(i,r),e):Cve(r=>Sd(i,r),e,t)}function TCt(i){return!!Array.isArray(i)&&!i.some(e=>{const t=typeof e;return!(t==="string"||t==="number"||t==="function"&&i.length>1)})}function q4e(i,e){if(arguments.length===2)return q4e(i).call(null,e);const t=new Set,r=i.filter(a=>typeof a!="function"),n=i.filter(a=>typeof a=="function");for(const a of i)typeof a!="string"&&typeof a!="number"||t.add(a);let s=null,o=null;return(a,l)=>{if(a==null)return a;const u=typeof a,c=u==="string"||u==="number";return c&&(t.has(a)||n.some(h=>u==="string"&&h===String||u==="number"&&h===Number))||u==="object"&&n.some(h=>!Tve(a,h))?a:(c&&r.length?(s||(s=r.map(h=>typeof h=="string"?`'${h}'`:`${h}`).join(", ")),PV().error("Accessor#set",`'${a}' is not a valid value for this property, only the following values are valid: ${s}`)):typeof a=="object"&&n.length?(o||(o=n.map(h=>n2e(h)).join(", ")),PV().error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):PV().error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function u3(i,e){if(arguments.length===2)return u3(i).call(null,e);const t={},r=[],n=[];for(const l in i.typeMap){const u=i.typeMap[l];t[l]=Sd(u),r.push(n2e(u)),n.push(l)}const s=()=>`'${r.join("', '")}'`,o=()=>`'${n.join("', '")}'`,a=typeof i.key=="string"?l=>l[i.key]:i.key;return l=>{if(i.base&&!Tve(i.base,l)||l==null)return l;const u=a(l)||i.defaultKeyValue,c=t[u];if(!c)return PV().error("Accessor#set",`Invalid property value, value needs to be one of ${s()}, or a plain object that can autocast (having .type = ${o()})`),null;if(!Tve(i.typeMap[u],l))return l;if(typeof i.key=="string"&&!wCt(l)){const h={};for(const p in l)p!==i.key&&(h[p]=l[p]);return c(h)}return c(l)}}let ms=class{};const bJ={native:i=>({type:"native",value:i}),array:i=>({type:"array",value:i}),oneOf:i=>({type:"one-of",values:i})};function DHi(i){if(!i||!("type"in i))return!1;switch(i.type){case"native":case"array":case"one-of":return!0}return!1}function CCt(i){switch(i.type){case"native":return Sd(i.value);case"array":return _ne(CCt(i.value));case"one-of":return FHi(i);default:return null}}function FHi(i){let e=null;return(t,r)=>X4e(t,i)?t:(e==null&&(e=Y4e(i)),PV().error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),r&&(r.valid=!1),null)}function Y4e(i){switch(i.type){case"native":switch(i.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case ms:return"integer";case Date:return"date";default:return n2e(i.value)}case"array":return`array of ${Y4e(i.value)}`;case"one-of":{const e=i.values.map(t=>Y4e(t));return`one of ${e.slice(0,-1)} or ${e[e.length-1]}`}}return"unknown"}function X4e(i,e){if(i==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case ms:return typeof i=="number";case Boolean:return typeof i=="boolean";case String:return typeof i=="string"}return i instanceof e.value;case"array":return!!Array.isArray(i)&&!i.some(t=>!X4e(t,e.value));case"one-of":return e.values.some(t=>X4e(i,t))}}function D(i={}){return(e,t)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${t}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(e,t),n=Koe(e,t);r&&(r.get||r.set?(n.get=r.get||n.get,n.set=r.set||n.set):"value"in r&&("value"in i&&di.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${t}" on "${e.constructor.name}" already defined in the metadata`,i),n.value=i.value=r.value)),i.readOnly!=null&&(n.readOnly=i.readOnly);const s=i.aliasOf;if(s){const l=typeof s=="string"?s:s.source,u=typeof s=="string"?null:s.overridable===!0;let c;n.dependsOn=[l],n.get=function(){let h=_S(this,l);if(typeof h=="function"){c||(c=l.split(".").slice(0,-1).join("."));const p=_S(this,c);p&&(h=h.bind(p))}return h},n.readOnly||(n.set=u?function(h){this._override(t,h)}:function(h){gve(this,l,h)})}const o=i.type,a=i.types;n.cast||(o?n.cast=kHi(o):a&&(Array.isArray(a)?n.cast=_ne(u3(a[0])):n.cast=u3(a))),IVi(n,i),i.range&&(n.cast=ECt(n.cast,i.range))}}function qUe(i,e,t){const r=Koe(i,t);r.json||(r.json={});let n=r.json;return e!==void 0&&(n.origins||(n.origins={}),n.origins[e]||(n.origins[e]={}),n=n.origins[e]),n}function kHi(i){let e=0,t=i;if(DHi(i))return CCt(i);for(;Array.isArray(t)&&t.length===1&&typeof t[0]!="string"&&typeof t[0]!="number";)t=t[0],e++;const r=t;if(TCt(r))return e===0?q4e(r):Cve(q4e(r),e);if(e===1)return PHi(r);if(e>1)return RHi(r,e);const n=i;return n.from?n.from:Sd(n)}function ECt(i,e){return t=>{let r=+i(t);return e.step!=null&&(r=Math.round(r/e.step)*e.step),e.min!=null&&(r=Math.max(e.min,r)),e.max!=null&&(r=Math.min(e.max,r)),r}}function LHi(i){if(i.json&&i.json.origins){const e=i.json.origins,t={"web-document":["web-scene","web-map"]};for(const r in t)if(e[r]){const n=e[r];t[r].forEach(s=>{e[s]=n}),delete e[r]}}}let Rf=class extends KTt{constructor(e,t,r){super(e,t,r)}};Rf.prototype.type="warning";function ICt(i){return!!i&&i.prototype?.declaredClass&&i.prototype.declaredClass.indexOf("esri.core.Collection")===0}const J4e=()=>di.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function irt(i,e,t){i&&(!t&&!e.read||e.read?.reader||e.read?.enabled===!1||BHi(i)&&Qp("read.reader",zB(i),e))}function zB(i){const e=i.ndimArray??0;if(e>1)return $Hi(i);if(e===1)return rrt(i);if("type"in i&&MCt(i.type)){const t=i.type.prototype?.itemType?.Type,r=rrt(typeof t=="function"?{type:t}:{types:t});return(n,s,o)=>{const a=r(n,s,o);return a&&new i.type(a)}}return YUe(i)}function YUe(i){return"type"in i?NHi(i.type):jHi(i.types)}function NHi(i){return i.prototype.read?(e,t,r)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void J4e().error(`Expected JSON value of type 'object' to deserialize type '${i.prototype.declaredClass}', but got '${n}'`);const s=new i;return s.read(e,r),s}:i.fromJSON}function ACt(i,e,t,r){return r!==0&&Array.isArray(e)?e.map(n=>ACt(i,n,t,r-1)):i(e,void 0,t)}function $Hi(i){const e=YUe(i),t=ACt.bind(null,e),r=i.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=t(n,o,r);let a=r,l=n;for(;a>0&&Array.isArray(l);)a--,l=l[0];if(l!==void 0)for(let u=0;u{if(t==null)return t;if(Array.isArray(t)){const o=[];for(const a of t){const l=e(a,void 0,n);l!==void 0&&o.push(l)}return o}const s=e(t,void 0,n);return s!==void 0?[s]:void 0}}function MCt(i){if(!ICt(i))return!1;const e=i.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?XUe(e.Type):OCt(e.Type))}function BHi(i){return"types"in i?OCt(i.types):XUe(i.type)}function XUe(i){return!Array.isArray(i)&&!!i&&i.prototype&&("read"in i.prototype||"fromJSON"in i||MCt(i))}function OCt(i){for(const e in i.typeMap)if(!XUe(i.typeMap[e]))return!1;return!0}function jHi(i){let e=null;const t=i.errorContext??"type",r=i.validate;return(n,s,o)=>{if(n==null)return n;const a=typeof n;if(a!=="object")return void J4e().error(`Expected JSON value of type 'object' to deserialize, but got '${a}'`);e||(e=GHi(i));const l=i.key;if(typeof l!="string")return;const u=n[l],c=u?e[u]:i.defaultKeyValue?i.typeMap[i.defaultKeyValue]:void 0;if(!c){const p=`Type '${u||"unknown"}' is not supported`;return o?.messages&&n&&o.messages.push(new Rf(`${t}:unsupported`,p,{definition:n,context:o})),void J4e().error(p)}const h=new c;return h.read(n,o),r?r(h):h}}function GHi(i){const e={};for(const t in i.typeMap){const r=i.typeMap[t],n=Joe(r.prototype);if(typeof i.key=="function")continue;const s=n[i.key];if(!s)continue;s.json?.type&&Array.isArray(s.json.type)&&s.json.type.length===1&&typeof s.json.type[0]=="string"&&(e[s.json.type[0]]=r);const o=s.json?.write;if(!o?.writer){e[t]=r;continue}const a=o.target,l=typeof a=="string"?a:i.key,u={};o.writer(t,u,l),u[l]&&(e[u[l]]=r)}return e}function UHi(i){if(i.json||(i.json={}),srt(i.json),ort(i.json),nrt(i.json),i.json.origins)for(const e in i.json.origins)srt(i.json.origins[e]),ort(i.json.origins[e]),nrt(i.json.origins[e]);return!0}function nrt(i){i.name&&(i.read&&typeof i.read=="object"?i.read.source===void 0&&(i.read.source=i.name):i.read={source:i.name},i.write&&typeof i.write=="object"?i.write.target===void 0&&(i.write.target=i.name):i.write={target:i.name})}function srt(i){typeof i.read=="boolean"?i.read={enabled:i.read}:typeof i.read=="function"?i.read={enabled:!0,reader:i.read}:i.read&&typeof i.read=="object"&&i.read.enabled===void 0&&(i.read.enabled=!0)}function ort(i){typeof i.write=="boolean"?i.write={enabled:i.write}:typeof i.write=="function"?i.write={enabled:!0,writer:i.write}:i.write&&typeof i.write=="object"&&i.write.enabled===void 0&&(i.write.enabled=!0)}function art(i,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const t=i?.ndimArray??0;i&&(t===1||"type"in i&&ICt(i.type))?e.write.writer=HHi:t>1?e.write.writer=WHi(t):e.types?Array.isArray(e.types)?e.write.writer=VHi(e.types[0]):e.write.writer=zHi(e.types):e.write.writer=bne}function zHi(i){return(e,t,r,n)=>e?PCt(e,i,n)?bne(e,t,r,n):void 0:bne(e,t,r,n)}function PCt(i,e,t){for(const r in e.typeMap)if(i instanceof e.typeMap[r])return!0;if(t?.messages){const r=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?i[e.key]:i.declaredClass)??"Unknown"}' cannot be written`;t&&t.messages&&i&&t.messages.push(new qe(`${r}:unsupported`,n,{definition:i,context:t})),di.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function VHi(i){return(e,t,r,n)=>!e||!Array.isArray(e)?bne(e,t,r,n):bne(e.filter(s=>PCt(s,i,n)),t,r,n)}function bne(i,e,t,r){Qp(t,Eve(i,r),e)}function Eve(i,e){return i&&typeof i.write=="function"?i.write({},e):i&&typeof i.toJSON=="function"?i.toJSON():typeof i=="number"?Ive(i):i}function Ive(i){return i===-1/0?-Number.MAX_VALUE:i===1/0?Number.MAX_VALUE:isNaN(i)?null:i}function HHi(i,e,t,r){let n;i===null?n=null:i&&typeof i.map=="function"?(n=i.map(s=>Eve(s,r)),typeof n.toArray=="function"&&(n=n.toArray())):n=[Eve(i,r)],Qp(t,n,e)}function RCt(i,e,t){return t!==0&&Array.isArray(i)?i.map(r=>RCt(r,e,t-1)):Eve(i,e)}function WHi(i){return(e,t,r,n)=>{let s;if(e===null)s=null;else{s=RCt(e,n,i);let o=i,a=s;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{i??="esri.core.Accessor",e.prototype.declaredClass=i,QHi(e);const t=[],r=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!WAe.has(n.initialize)&&(WAe.add(n.initialize),t.push(n.initialize)),n.hasOwnProperty("destroy")&&!qAe.has(n.destroy)&&(qAe.add(n.destroy),r.push(n.destroy)),n=Object.getPrototypeOf(n);WAe.clear(),qAe.clear();const s=class extends e{constructor(...a){if(super(...a),this.constructor===s&&typeof this.postscript=="function"){if(t.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=t.length-1;l>=0;l--)t[l].call(this)}}),r.length){let l=!1;const u=this[QTt];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0,u.call(this);for(let c=0;c0&&this.normalizeCtorArgs&&(t.ctorArgs=this.normalizeCtorArgs.apply(this,e))}postscript(e){const t=this.__accessor__,r=t.ctorArgs||e;t.initialize(),r&&(this.set(r),t.ctorArgs=null),t.constructed(),this.initialize(),this[Q4e]=!0}initialize(){}[QTt](){this[t4]=zo(this[t4])}destroy(){this.destroyed||(mHi(this),this.__accessor__.destroy(),VVi()?.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[Q4e]}get destroyed(){return this.__accessor__?.lifecycle===ub.DESTROYED||!1}commitProperty(e){_S(this,e)}get(e){return zUe(di.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),_S(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,t){return gve(this,e,t),this}watch(e,t,r){return wHi(this,e,t,r)}addHandles(e,t){if(this.destroyed){const n=Array.isArray(e)?e:[e];for(const s of n)s.remove();return}let r=this[t4];r==null&&(r=this[t4]=new cY),r.add(e,t)}removeHandles(e){const t=this[t4];t?.remove(e)}removeAllHandles(){const e=this[t4];e?.removeAll()}hasHandles(e){const t=this[t4];return t!=null&&t.has(e)}_override(e,t){t===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,t){t==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,t)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,t){return this.__accessor__.internalSet(e,t),this}};kCt=t4,LCt=Q4e;let tWi=class $Ct{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const t=new $Ct;return this._values.forEach((r,n)=>{e&&e.has(n)||t.set(n,li(r.value),r.origin)}),t}get(e,t){t=this._normalizeOrigin(t);const r=this._values.get(e);return t==null||r?.origin===t?r?.value:void 0}originOf(e){return this._values.get(e)?.origin??Pn.USER}keys(e){e=this._normalizeOrigin(e);const t=[...this._values.keys()];return e==null?t:t.filter(r=>this._values.get(r)?.origin===e)}set(e,t,r){if((r=this._normalizeOrigin(r))===Pn.DEFAULTS){const n=this._values.get(e);if(n?.origin!=null&&n.origin>r)return}this._values.set(e,new iWi(t,r))}delete(e,t){(t=this._normalizeOrigin(t))!=null&&this._values.get(e)?.origin!==t||this._values.delete(e)}has(e,t){return(t=this._normalizeOrigin(t))!=null?this._values.get(e)?.origin===t:this._values.has(e)}forEach(e){this._values.forEach(({value:t},r)=>e(t,r))}_normalizeOrigin(e){if(e!=null)return e===Pn.DEFAULTS?e:Pn.USER}},iWi=class{constructor(e,t){this.value=e,this.origin=t}};function BCt(i,e,t){e.keys().forEach(n=>{t.set(n,e.get(n),Pn.DEFAULTS)});const r=i.metadata;Object.keys(r).forEach(n=>{i.internalGet(n)&&t.set(n,i.internalGet(n),Pn.DEFAULTS)})}function rWi(i,e,t){if(!i?.read||i.read.enabled===!1||!i.read.source)return!1;const r=i.read.source;if(typeof r=="string"){if(r===e||r.includes(".")&&r.indexOf(e)===0&&Hit(r,t))return!0}else for(const n of r)if(n===e||n.includes(".")&&n.indexOf(e)===0&&Hit(n,t))return!0;return!1}function nWi(i){return i&&(!i.read||i.read.enabled!==!1&&!i.read.source)}function sWi(i,e,t,r,n){let s=K4e(e[t],n);nWi(s)&&(i[t]=!0);for(const o of Object.getOwnPropertyNames(e))s=K4e(e[o],n),rWi(s,t,r)&&(i[o]=!0)}function oWi(i,e,t,r){const n=t.metadata,s=qHi(n[e],r),o=s?.default;if(o===void 0)return;const a=typeof o=="function"?o.call(i,e,r):o;a!==void 0&&t.set(e,a)}const jCt={origin:"service"};function GCt(i,e,t=jCt){if(!e||typeof e!="object")return;const r=Kp(i),n=r.metadata,s={};for(const o of Object.getOwnPropertyNames(e))sWi(s,n,o,e,t);r.setDefaultOrigin(t.origin);for(const o of Object.getOwnPropertyNames(s)){const a=K4e(n[o],t).read,l=a?.source;let u;u=l&&typeof l=="string"?Xoe(e,l):e[o],a?.reader&&(u=a.reader.call(i,u,e,t)),u!==void 0&&r.set(o,u)}if(!t||!t.ignoreDefaults){r.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||oWi(i,o,r,t)}r.setDefaultOrigin("user")}function aWi(i,e,t,r=jCt){const n={...r,messages:[]};t(n),n.messages?.forEach(s=>{s.type!=="warning"||i.loaded?r?.messages&&r.messages.push(s):i.loadWarnings.push(s)})}function lWi(i,e,t,r,n){const s={};return e.write?.writer?.call(i,r,s,t,n),s}function UCt(i,e,t,r,n,s){if(!r?.write)return!1;const o=_S(i,t);if(!n&&r.write.overridePolicy){const a=r.write.overridePolicy.call(i,o,t,s??void 0);a!==void 0&&(n=a)}if(n||(n=r.write),!n||n.enabled===!1||n.layerContainerTypes&&s?.layerContainerType&&!n.layerContainerTypes.includes(s.layerContainerType))return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const a=new qe("web-document-write:property-required",`Missing value for required property '${t}' on '${i.declaredClass}'`,{propertyName:t,target:i});return a&&s?.messages?s.messages.push(a):a&&!s&&di.getLogger("esri.core.accessorSupport.write").error(a.name,a.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||!n.alwaysWriteDefaults&&(!e.store.multipleOriginsSupported||e.store.originOf(t)===Pn.DEFAULTS)&&uWi(i,t,s,r,o)||!n.ignoreOrigin&&s?.origin&&e.store.multipleOriginsSupported&&e.store.originOf(t)0&&(e=Ufe(e,l),t?.resources?.pendingOperations?.length&&t.resources.pendingOperations.push(Promise.all(t.resources.pendingOperations).then(()=>Ufe(e,l,()=>"replace-arrays"))),t?.writtenProperties&&t.writtenProperties.push({target:i,propName:s,oldOrigin:FVi(r.store.originOf(s)),newOrigin:t.origin}))}return e}const S0=i=>{let e=class extends i{constructor(...t){super(...t);const r=Kp(this),n=r.store,s=new tWi;r.store=s,BCt(r,n,s)}read(t,r){GCt(this,t,r)}write(t,r){return VCt(this,t??{},r)}toJSON(t){return this.write({},t)}static fromJSON(t,r){return cWi.call(this,t,r)}};return e=x([Qe("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function cWi(i,e){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const t=new this;return t.read(i,e),t}function W9(i){return i&&typeof i=="object"&&"toJSON"in i&&typeof i.toJSON=="function"}let Ci=class extends S0(un){};Ci=x([Qe("esri.core.JSONSupport")],Ci);const hWi=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,dWi={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function e5e(i){const e=i?.match(hWi);if(!e)return null;const[,t,r,n]=e;if(!t)return null;let s=null,o=null,a=null;const{devext:l,qaext:u,www:c}=dWi;if(r)if(s=t,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=u);break;default:return null}else({customBaseUrl:o,portalHostname:a}=c);else switch(t.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=u);break;case"www":({customBaseUrl:o,portalHostname:a}=c);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:s}}function HCt(i){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(i)}function WCt(i){const e=atob(i),t=new Uint8Array(e.length);for(let r=0;rdi.getLogger("esri.core.urlUtils"),dY=Ho.request,lrt="esri/config: esriConfig.request.proxyUrl is not set.",qCt=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,YCt=/^\s*http:/i,mWi=/^\s*https:/i,gWi=/^\s*file:/i,yWi=/:\d+$/,vWi=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,_Wi=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),bWi=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let Qy=class{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(_Wi);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),this.authority!=null&&(t=this.authority.match(bWi),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}};const Oce={},wWi=new Qy(Ho.applicationUrl);let Mv=wWi;const xWi=SWi();let KUe=xWi;const ZUe=()=>Mv,XCt=()=>KUe;function SWi(){const i=Mv.path,e=i.substring(0,i.lastIndexOf(i.split("/")[i.split("/").length-1]));return`${`${Mv.scheme}://${Mv.host}${Mv.port!=null?`:${Mv.port}`:""}`}${e}`}function Yo(i){if(!i)return null;const e={path:null,query:null},t=new Qy(i),r=i.indexOf("?");return t.query===null?e.path=i:(e.path=i.substring(0,r),e.query=mP(t.query)),t.fragment&&(e.hash=t.fragment,t.query===null&&(e.path=e.path.substring(0,e.path.length-(t.fragment.length+1)))),e}function mP(i){const e=i.split("&"),t={};for(const r of e){if(!r)continue;const n=r.indexOf("=");let s,o;n<0?(s=decodeURIComponent(r),o=""):(s=decodeURIComponent(r.slice(0,n)),o=decodeURIComponent(r.slice(n+1)));let a=t[s];typeof a=="string"&&(a=t[s]=[a]),Array.isArray(a)?a.push(o):t[s]=o}return t}function Lb(i,e){return i?e&&typeof e=="function"?Object.keys(i).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e(t,i[t]))).join("&"):Object.keys(i).map(t=>{const r=i[t];if(r==null)return"";const n=encodeURIComponent(t)+"=",s=e?.[t];return s?n+encodeURIComponent(s(r)):Array.isArray(r)?r.map(o=>W9(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):W9(r)?n+encodeURIComponent(JSON.stringify(r)):n+encodeURIComponent(r)}).filter(t=>t).join("&"):""}function TWi(i=!1){let e,t=dY.proxyUrl;if(typeof i=="string"){e=eEt(i);const r=Qoe(i);r&&(t=r.proxyUrl)}else e=!!i;if(!t)throw fWi().warn(lrt),new qe("urlUtils:proxy-not-set",lrt);return e&&t5e()&&(t=wne(t)),Yo(t)}function JCt(i){const e=Qoe(i);let t,r;if(e){const n=QUe(e.proxyUrl);t=n.path,r=n.query?mP(n.query):null}if(t){const n=Yo(i);i=t+"?"+n.path;const s=Lb({...r,...n.query});s&&(i=`${i}?${s}`)}return i}const wJ={path:"",query:""};function QUe(i){const e=i.indexOf("?");return e!==-1?(wJ.path=i.slice(0,e),wJ.query=i.slice(e+1)):(wJ.path=i,wJ.query=null),wJ}function KCt(i){return i=(i=Mve(i=tEt(i=QUe(i).path),!0)).toLowerCase()}function CWi(i){const e={proxyUrl:i.proxyUrl,urlPrefix:KCt(i.urlPrefix)},t=dY.proxyRules,r=e.urlPrefix;let n=t.length;for(let s=0;s0?i.substring(0,e):i.replace(/\/+$/,"")}function ZCt(i){const e=r=>r==null||r instanceof RegExp&&r.test(i)||typeof r=="string"&&i.startsWith(r),t=dY.interceptors;if(t){for(const r of t)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r}return null}function _v(i,e,t=!1){if(!i||!e)return!1;const r=r5e(i),n=r5e(e);return!(!t&&r.scheme!==n.scheme)&&r.host!=null&&n.host!=null&&r.host.toLowerCase()===n.host.toLowerCase()&&r.port===n.port}function tze(i){if(typeof i=="string"){if(!u0(i))return!0;i=r5e(i)}if(_v(i,Mv))return!0;const e=dY.trustedServers||[];for(let t=0;t(m=h.indexOf(p,m))===-1?h.length:m;let l=a(n,"/",n.indexOf("//")+2),u=-1;for(;n.slice(0,l+1)===s.slice(0,l)+"/"&&(u=l+1,l!==n.length);)l=a(n,"/",l+1);if(u===-1||o&&u0)for(let h=0;hs?n.concat(s.split("/")):n,[]);for(let n=0;n0&&t[t.length-1]!==".."?t.pop():(!s&&n===r.length-1||s&&(s!=="."||t.length===0))&&t.push(s)}return t.join("/")}function HC(i,e=!1){if(i==null||aR(i)||Vx(i))return null;let t=i.indexOf("://");if(t===-1&&Mx(i))t=2;else{if(t===-1)return null;t+=3}const r=i.indexOf("/",t);return r!==-1&&(i=i.slice(0,r)),e&&(i=Mve(i,!0)),i}function u0(i){return Mx(i)||rze(i)}function aR(i){return i!=null&&i.slice(0,5)==="blob:"}function Vx(i){return i!=null&&i.slice(0,5)==="data:"}function ize(i){const e=lR(i);return e&&e.isBase64?WCt(e.data):null}function YAe(i){return pWi(i).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const AWi=/^data:(.*?)(;base64)?,(.*)$/;function lR(i){const e=i.match(AWi);if(!e)return null;const[,t,r,n]=e;return{mediaType:t,isBase64:!!r,data:n}}function QCt(i){return i.isBase64?`data:${i.mediaType};base64,${i.data}`:`data:${i.mediaType},${i.data}`}async function MWi(i){return(await fetch(i)).blob()}function OWi(i){const e=ize(i);if(!e)return null;const t=lR(i);return new Blob([e],{type:t.mediaType})}function PWi(i,e){RWi(i,e)}function RWi(i,e){if(!i)return!1;const t=document.createElement("a");if(!("download"in t))return!1;const r=URL.createObjectURL(i);return t.download=e,t.href=r,t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(r),!0}function Mx(i){return i!=null&&i[0]==="/"&&i[1]==="/"}function rze(i){return i!=null&&qCt.test(i)}function eEt(i){return i!=null&&mWi.test(i)||Mv.scheme==="https"&&Mx(i)}function DWi(i){return i!=null&&YCt.test(i)||Mv.scheme==="http"&&Mx(i)}function FWi(i){return i!=null&&gWi.test(i)}function wne(i){return Mx(i)?`https:${i}`:i.replace(YCt,"https:")}function kWi(){return Mv.scheme==="http"}function t5e(){return Mv.scheme==="https"}function Mve(i,e=!1){return Mx(i)?i.slice(2):(i=i.replace(qCt,""),e&&i.length>1&&i[0]==="/"&&i[1]==="/"&&(i=i.slice(2)),i)}function LWi(i){const e=i.indexOf("//"),t=i.indexOf("/",e+2);return t===-1?i:i.slice(0,t)}function eae(i){let e=0;if(u0(i)){const r=i.indexOf("//");r!==-1&&(e=r+2)}const t=i.lastIndexOf("/");return tr===n||r.endsWith(`.${n}`))||t5e()&&!Qoe(i))&&(i=wne(i)),i}function i5e(i,e,t){if(!(e&&t&&i&&u0(i)))return i;const r=i.indexOf("//"),n=i.indexOf("/",r+2),s=i.indexOf(":",r+2),o=Math.min(n<0?i.length:n,s<0?i.length:s);return i.slice(r+2,o).toLowerCase()!==e.toLowerCase()?i:`${i.slice(0,r+2)}${t}${i.slice(o)}`}function r5e(i){return typeof i=="string"?new Qy(xf(i)):(i.scheme||(i.scheme=Mv.scheme),i)}function jWi(i){return UWi.test(i)}function iEt(i,e){const t=Yo(i),r=Object.keys(t.query||{});return r.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),t.path}function GWi(i,e,t){const r=Yo(i),n=r.query||{};return n[e]=String(t),`${r.path}?${Lb(n)}`}function gg(i,e){if(!e)return i;const t=Yo(i),r=t.query||{};for(const[s,o]of Object.entries(e))o!=null&&(r[s]=o);const n=Lb(r);return n?`${t.path}?${n}`:t.path}function nze(i){if(i==null)return null;const e=i.match(nEt);return e?e[2]:null}function urt(i){if(i==null)return null;const e=i.match(nEt);return e?{path:e[1],extension:e[2]}:{path:i,extension:null}}async function rEt(i){return typeof i=="string"?lR(i)??{data:i}:new Promise((e,t)=>{const r=new FileReader;r.readAsDataURL(i),r.onload=()=>e(lR(r.result)),r.onerror=n=>t(n)})}const nEt=/([^.]*)\.([^\/]*)$/,UWi=/(^data:image\/svg|\.svg$)/i,sEt="20240321",oEt="9cf5a4b8555fda94595b625a40b922e012baf071";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const tae="4.29";let no,sze=tae;sze="4.29.10";function zWi(i){no=i}function VWi(i){const e=no?.findCredential(i);return e?.token?GWi(i,"token",e.token):i}yi("host-webworker");const HWi=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function oze(i){const e=HC(i,!0);return!!e&&e.endsWith(".arcgis.com")&&!HWi.has(e)&&!i.endsWith("/sharing/rest/generateToken")}function aEt(i,e,t=!1,r){return new Promise((n,s)=>{if(xg(r))return void s(crt());let o=()=>{u(),s(new Error(`Unable to load ${e}`))},a=()=>{const c=i;u(),n(c)},l=()=>{if(!i)return;const c=i;u(),c.src="",s(crt())};const u=()=>{yi("esri-image-decode")||(i.removeEventListener("error",o),i.removeEventListener("load",a)),o=null,a=null,i=null,r?.removeEventListener("abort",l),l=null,t&&URL.revokeObjectURL(e)};r?.addEventListener("abort",l),yi("esri-image-decode")?i.decode().then(a,o):(i.addEventListener("error",o),i.addEventListener("load",a))})}function crt(){try{return new DOMException("Aborted","AbortError")}catch{const i=new Error;return i.name="AbortError",i}}const WWi="Timeout exceeded";function qWi(){return new Error(WWi)}function YWi(i){Ho.request.crossOriginNoCorsDomains||(Ho.request.crossOriginNoCorsDomains={});const e=Ho.request.crossOriginNoCorsDomains;for(let t of i)t=t.toLowerCase(),/^https?:\/\//.test(t)?e[HC(t)??""]=0:(e[HC("http://"+t)??""]=0,e[HC("https://"+t)??""]=0)}function XWi(i){const e=Ho.request.crossOriginNoCorsDomains;if(e){let t=HC(i);if(t)return t=t.toLowerCase(),!_v(t,ZUe())&&e[t]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:fC.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await oqi(a);return s?.after?.(l),l}let Ove;const fC=Ho.request,lEt="FormData"in globalThis,KWi=new Set([499,498,403,401]),ZWi=new Set(["COM_0056","COM_0057","SB_0008"]),QWi=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],QH=()=>null,Pve=Symbol();function eqi(i){const e=HC(i);e&&!zi._corsServers.includes(e)&&zi._corsServers.push(e)}function hrt(i){const e=HC(i);return!e||e.endsWith(".arcgis.com")||zi._corsServers.includes(e)||tze(e)}function jA(i,e,t,r){let n="Error";const s={url:t.url,requestOptions:t.requestOptions,getAllHeaders:QH,getHeader:QH,ssl:!1};if(e instanceof qe)return e.details?(e.details=li(e.details),e.details.url=t.url,e.details.requestOptions=t.requestOptions):e.details=s,e;if(e){const o=r&&(()=>Array.from(r.headers)),a=r&&(c=>r.headers.get(c)),l=r?.status,u=e.message;u&&(n=u),o&&a&&(s.getAllHeaders=o,s.getHeader=a),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||l||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=Pve in e?e[Pve]:e}return mo(e)?Oc():new qe(i,n,s)}async function tqi(){yi("host-webworker")&&!Ove&&(Ove=await Promise.resolve().then(()=>eNr))}async function n5e(){no||await Promise.resolve().then(()=>iNr)}async function iqi(i){const e=i.params.url,t=i.params.requestOptions,r=i.controller.signal,n=t.body;let s=null,o=null;if(lEt&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),i.fetchOptions={cache:t.cacheBust?"no-cache":"default",credentials:"same-origin",headers:t.headers||{},method:t.method==="head"?"HEAD":"GET",mode:"cors",priority:fC.priority,redirect:"follow",signal:r},(s||o)&&(i.fetchOptions.body=s||o),t.authMode==="anonymous"&&(i.useIdentity=!1),i.hasToken=!!(/token=/i.test(e)||t.query?.token||s?.get("token")),!i.hasToken&&Ho.apiKey&&oze(e)&&(t.query||(t.query={}),t.query.token=Ho.apiKey,i.hasToken=!0),i.useIdentity&&!i.hasToken&&!i.credentialToken&&!uEt(e)&&!xg(r)){let a;t.authMode==="immediate"?(await n5e(),a=await no.getCredential(e,{signal:r}),i.credential=a):t.authMode==="no-prompt"?(await n5e(),a=await no.getCredential(e,{prompt:!1,signal:r}).catch(()=>{}),i.credential=a):no&&(a=no.findCredential(e)),a&&(i.credentialToken=a.token,i.useSSL=!!a.ssl)}}function uEt(i){return QWi.some(e=>e.test(i))}async function rqi(i){let e=i.params.url;const t=i.params.requestOptions,r=i.fetchOptions??{},n=aR(e)||Vx(e),s=t.responseType||"json",o=n?0:t.timeout!=null?t.timeout:fC.timeout;let a=!1;if(!n){i.useSSL&&(e=wne(e));let p={...t.query};i.credentialToken&&(p.token=i.credentialToken);let m=Lb(p);yi("esri-url-encodes-apostrophe")&&(m=m.replaceAll("'","%27"));const v=e.length+1+m.length;let w;a=t.method==="delete"||t.method==="post"||t.method==="put"||!!t.body||v>fC.maxUrlLength;const S=t.useProxy||!!Qoe(e);if(S){const I=TWi(e);w=I.path,!a&&w.length+1+v>fC.maxUrlLength&&(a=!0),I.query&&(p={...I.query,...p})}if(r.method==="HEAD"&&(a||S)){if(a)throw v>fC.maxUrlLength?jA("request:invalid-parameters",new Error("URL exceeds maximum length"),i.params):jA("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),i.params);if(S)throw jA("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),i.params)}a?(r.method=t.method==="delete"?"DELETE":t.method==="put"?"PUT":"POST",t.body?e=gg(e,p):(r.body=Lb(p),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):e=gg(e,p),S&&(i.useProxy=!0,e=`${w}?${e}`),p.token&&lEt&&r.body instanceof FormData&&!HCt(e)&&r.body.set("token",p.token),t.hasOwnProperty("withCredentials")?i.withCredentials=t.withCredentials:_v(e,ZUe())||(tze(e)||no&&no.findServerInfo(e)?.webTierAuth)&&(i.withCredentials=!0),i.withCredentials&&(r.credentials="include",XWi(e)&&await JWi(a?gg(e,p):e))}let l,u,c=0,h=!1;o>0&&(c=setTimeout(()=>{h=!0,i.controller.abort()},o));try{if(t.responseType==="native-request-init")u=r,u.url=e;else if(t.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||a||sqi(t.headers)||!n&&!i.useProxy&&fC.proxyUrl&&!hrt(e)){if(zi._beforeFetch&&await zi._beforeFetch(e,r),l=await fetch(e,r),zi._afterFetch&&await zi._afterFetch(l),i.useProxy||eqi(e),t.responseType==="native")u=l;else if(r.method!=="HEAD")if(l.ok){switch(s){case"array-buffer":u=await l.arrayBuffer();break;case"blob":case"image":u=await l.blob();break;default:u=await l.text()}if(c&&(clearTimeout(c),c=0),s==="json"||s==="xml"||s==="document")if(u)switch(s){case"json":u=JSON.parse(u);break;case"xml":u=drt(u,"application/xml");break;case"document":u=drt(u,"text/html")}else u=null;if(u){if(s==="array-buffer"||s==="blob"){const p=l.headers.get("Content-Type");if(p&&/application\/json|text\/plain/i.test(p)&&u[s==="blob"?"size":"byteLength"]<=750)try{const m=await new Response(u).json();m.error&&(u=m)}catch{}}s==="image"&&u instanceof Blob&&(u=await prt(URL.createObjectURL(u),i,!0))}}else{u=await l.text();try{u=JSON.parse(u)}catch{}}}else u=await prt(e,i)}catch(p){if(p.name==="AbortError")throw h?qWi():Oc("Request canceled");if(!(!l&&p instanceof TypeError&&fC.proxyUrl)||t.body||t.method==="delete"||t.method==="head"||t.method==="post"||t.method==="put"||i.useProxy||hrt(e))throw p;i.redoRequest=!0,CWi({proxyUrl:fC.proxyUrl,urlPrefix:HC(e)??""})}finally{c&&clearTimeout(c)}return[l,u]}async function nqi(i,e){if(i.responseData!=null)return i.responseData;if(i.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...i.headers}),i.query&&(e.requestOptions.query={...e.requestOptions.query,...i.query}),i.before){let t,r;try{r=await i.before(e)}catch(n){t=jA("request:interceptor",n,e)}if((r instanceof Error||r instanceof qe)&&(t=jA("request:interceptor",r,e)),t)throw i.error&&i.error(t),t;return r}}function sqi(i){if(i){for(const e of Object.getOwnPropertyNames(i))if(i[e])return!0}return!1}function drt(i,e){let t;try{t=new DOMParser().parseFromString(i,e)}catch{}if(!t||t.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return t}async function oqi(i){let e,t;await iqi(i);try{do[e,t]=await rqi(i);while(!await aqi(i,e,t))}catch(s){const o=jA("request:server",s,i.params,e);throw o.details.ssl=i.useSSL,i.interceptor?.error&&i.interceptor.error(o),o}const r=i.params.url;if(t&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!i.hasToken&&!i.credentialToken&&t.user?.username&&!tze(r)){const s=HC(r,!0);s&&fC.trustedServers.push(s)}Array.isArray(t.authorizedCrossOriginNoCorsDomains)&&YWi(t.authorizedCrossOriginNoCorsDomains)}const n=i.credential;if(n&&no){let o=no.findServerInfo(n.server)?.owningSystemUrl;if(o){o=o.replace(/\/?$/,"/sharing");const a=no.findCredential(o,n.userId);a&&no._getIdenticalSvcIdx(o,a)===-1&&a.resources.unshift(o)}}return{data:t,getAllHeaders:e?()=>Array.from(e.headers):QH,getHeader:e?s=>e.headers.get(s):QH,httpStatus:e?.status??200,requestOptions:i.params.requestOptions,ssl:i.useSSL,url:i.params.url}}async function aqi(i,e,t){if(i.redoRequest)return i.redoRequest=!1,!1;const r=i.params.requestOptions;if(!e||r.responseType==="native"||r.responseType==="native-request-init")return!0;let n,s;if(t&&(t.error?n=t.error:t.status==="error"&&Array.isArray(t.messages)&&(n={...t},n[Pve]=t,n.details=t.messages)),!n&&!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[Pve]=t,n;let o,a=null;n&&(s=Number(n.code),a=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o?.toUpperCase());const l=r.authMode;if(s===403&&(a===4||n.message?.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!i.useSSL)return i.useSSL=!0,!1}else if(!i.hasToken&&i.useIdentity&&(l!=="no-prompt"||s===498)&&s!==void 0&&KWi.has(s)&&!uEt(i.params.url)&&(s!==403||(!o||!ZWi.has(o))&&(a==null||a===2&&i.credentialToken))){await n5e();try{const u=await no.getCredential(i.params.url,{error:jA("request:server",n,i.params),prompt:l!=="no-prompt",signal:i.controller.signal,token:i.credentialToken});return i.credential=u,i.credentialToken=u.token,i.useSSL=i.useSSL||u.ssl,!1}catch(u){if(l==="no-prompt")return i.credential=void 0,i.credentialToken=void 0,!1;n=u}}if(n)throw n;return!0}function prt(i,e,t=!1){const r=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=fC.priority,n.src=i,aEt(n,i,t,r)}zi._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],zi._beforeFetch=void 0,zi._afterFetch=void 0;let Wfe=class cEt{constructor(){this._emitter=new cEt.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(i){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){this._listenersMap?.clear(),this._listenersMap=null}destroy(){this.clear()}emit(n,s){let o=this._listenersMap?.get(n);if(!o)return!1;const a=this._target||this;let l=!1;for(const u of o.slice()){const c="deref"in u?u.deref():u;c?c?.call(a,s):l=!0}return l&&(o=o.filter(u=>!("deref"in u)||u.deref()!=null),this._listenersMap.set(n,o)),o.length>0}on(n,s){if(Array.isArray(n)){const a=n.map(l=>this.on(l,s));return j3(a)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??=new Map;const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),wa(()=>{const a=this._listenersMap?.get(n),l=a?.indexOf(s)??-1;l>=0&&a.splice(l,1)})}once(n,s){const o=this.on(n,a=>{o.remove(),("deref"in s?s.deref():s)?.call(null,a)});return o}hasEventListener(n){const s=this._listenersMap?.get(n);return s!=null&&s.length>0}}i.EventEmitter=e,i.EventedMixin=r=>{let n=class extends r{constructor(){super(...arguments),this._emitter=new e}destroy(){this._emitter.clear()}emit(s,o){return this._emitter.emit(s,o)}on(s,o){return this._emitter.on(s,o)}once(s,o){return this._emitter.once(s,o)}hasEventListener(s){return this._emitter.hasEventListener(s)}};return n=x([Qe("esri.core.Evented")],n),n};let t=class extends un{constructor(){super(...arguments),this._emitter=new Wfe.EventEmitter(this)}destroy(){this._emitter.clear()}emit(r,n){return this._emitter.emit(r,n)}on(r,n){return this._emitter.on(r,n)}once(r,n){return this._emitter.once(r,n)}hasEventListener(r){return this._emitter.hasEventListener(r)}};t=x([Qe("esri.core.Evented")],t),i.EventedAccessor=t})(Wfe||(Wfe={}));const rd=Wfe;var yc;(function(i){i[i.ADD=1]="ADD",i[i.REMOVE=2]="REMOVE",i[i.MOVE=4]="MOVE"})(yc||(yc={}));function aze(i){return(e,t)=>{e[t]=i}}let pY=class extends nCt{notify(){const e=this._observers;if(e&&e.length>0){const t=e.slice();for(const r of t)r.onInvalidated(),r.onCommitted()}}};var JO;let lqi=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},uqi=class{constructor(e,t,r,n,s){this.target=e,this.added=t,this.removed=r,this.start=n,this.deleteCount=s}};const a2=new G3(lqi,void 0,i=>{i.item=null,i.target=null,i.defaultPrevented=!1,i.cancellable=!1});function XAe(i){return i?i instanceof jO?i.toArray():i.length?Array.prototype.slice.apply(i):[]:[]}function JAe(i){if(i?.length)return i[0]}function cqi(i,e,t,r){const n=Math.min(i.length-t,e.length-r);let s=0;for(;s{i.push(n),hEt(i,t.call(r,n,s,o),t,r)})}const hD=new Set,dD=new Set,pD=new Set,KAe=new Map;let hqi=0,jO=JO=class extends rd.EventedAccessor{static isCollection(i){return i!=null&&i instanceof JO}constructor(i){super(i),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new pY,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:hqi++})}normalizeCtorArgs(i){return i?Array.isArray(i)||i instanceof JO?{items:i}:i:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return Ws(this._observable),this._items}set items(i){this._emitBeforeChanges(yc.ADD)||(this._splice(0,this.length,XAe(i)),this._emitAfterChanges(yc.ADD))}hasEventListener(i){return i==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(i)}on(i,e){if(i==="change"){const t=this._chgListeners,r={removed:!1,callback:e};return t.push(r),this._notifications&&this._notifications.push({listeners:t.slice(),items:this._items.slice(),changes:[]}),wa(()=>{r.removed=!0,t.splice(t.indexOf(r),1)})}return this._emitter.on(i,e)}once(i,e){const t="deref"in e?()=>e.deref():()=>e,r=this.on(i,n=>{t()?.call(null,n),r.remove()});return r}add(i,e){if(Ws(this._observable),this._emitBeforeChanges(yc.ADD))return this;const t=this.getNextIndex(e??null);return this._splice(t,0,[i]),this._emitAfterChanges(yc.ADD),this}addMany(i,e=this._items.length){if(Ws(this._observable),!i?.length)return this;if(this._emitBeforeChanges(yc.ADD))return this;const t=this.getNextIndex(e);return this._splice(t,0,XAe(i)),this._emitAfterChanges(yc.ADD),this}at(i){if(Ws(this._observable),(i=Math.trunc(i)||0)<0&&(i+=this.length),!(i<0||i>=this.length))return this._items[i]}removeAll(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return[];const i=this._removeAllRaw();return this._emitAfterChanges(yc.REMOVE),i}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return Ws(this._observable),this._createNewInstance({items:this._items.map(li)})}concat(...i){Ws(this._observable);const e=i.map(XAe);return this._createNewInstance({items:this._items.concat(...e)})}drain(i,e){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const t=this._splice(0,this.length),r=t.length;for(let n=0;ne&&(i=e),i}includes(i,e=0){return Ws(this._observable),this._items.includes(i,e)}indexOf(i,e=0){return Ws(this._observable),this._items.indexOf(i,e)}join(i=","){return Ws(this._observable),this._items.join(i)}lastIndexOf(i,e=this.length-1){return Ws(this._observable),this._items.lastIndexOf(i,e)}map(i,e){Ws(this._observable);const t=this._items.map(i,e);return new JO({items:t})}reorder(i,e=this.length-1){Ws(this._observable);const t=this.indexOf(i);if(t!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),t!==e){if(this._emitBeforeChanges(yc.MOVE))return i;this._splice(t,1),this._splice(e,0,[i]),this._emitAfterChanges(yc.MOVE)}return i}}pop(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const i=JAe(this._splice(this.length-1,1));return this._emitAfterChanges(yc.REMOVE),i}push(...i){return Ws(this._observable),this._emitBeforeChanges(yc.ADD)||(this._splice(this.length,0,i),this._emitAfterChanges(yc.ADD)),this.length}reduce(i,e){Ws(this._observable);const t=this._items;return arguments.length===2?t.reduce(i,e):t.reduce(i)}reduceRight(i,e){Ws(this._observable);const t=this._items;return arguments.length===2?t.reduceRight(i,e):t.reduceRight(i)}remove(i){return Ws(this._observable),this.removeAt(this.indexOf(i))}removeAt(i){if(Ws(this._observable),i<0||i>=this.length||this._emitBeforeChanges(yc.REMOVE))return;const e=JAe(this._splice(i,1));return this._emitAfterChanges(yc.REMOVE),e}removeMany(i){if(Ws(this._observable),!i?.length||this._emitBeforeChanges(yc.REMOVE))return[];const e=i instanceof JO?i.toArray():i,t=this._items,r=[],n=e.length;for(let s=0;s-1){const l=1+cqi(e,t,s+1,a+1),u=this._splice(a,l);u&&u.length>0&&r.push.apply(r,u),s+=l-1}}return this._emitAfterChanges(yc.REMOVE),r}reverse(){if(Ws(this._observable),this._emitBeforeChanges(yc.MOVE))return this;const i=this._splice(0,this.length);return i&&(i.reverse(),this._splice(0,0,i)),this._emitAfterChanges(yc.MOVE),this}shift(){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.REMOVE))return;const i=JAe(this._splice(0,1));return this._emitAfterChanges(yc.REMOVE),i}slice(i=0,e=this.length){return Ws(this._observable),this._createNewInstance({items:this._items.slice(i,e)})}some(i,e){return Ws(this._observable),this._items.some(i,e)}sort(i){if(Ws(this._observable),!this.length||this._emitBeforeChanges(yc.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(i):e.sort(),this._splice(0,0,e),this._emitAfterChanges(yc.MOVE),this}splice(i,e,...t){Ws(this._observable);const r=(e?yc.REMOVE:0)|(t.length?yc.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(i,e,t)||[];return this._emitAfterChanges(r),n}toArray(){return Ws(this._observable),this._items.slice()}toJSON(){return Ws(this._observable),this.toArray()}toLocaleString(){return Ws(this._observable),this._items.toLocaleString()}toString(){return Ws(this._observable),this._items.toString()}unshift(...i){return Ws(this._observable),!i.length||this._emitBeforeChanges(yc.ADD)||(this._splice(0,0,i),this._emitAfterChanges(yc.ADD)),this.length}_createNewInstance(i){return new this.constructor(i)}_splice(i,e,t){const r=this._items,n=this.itemType;let s,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=Gk(()=>this._dispatchChange())),i<0&&(i+=this.length),e){if(o=r.splice(i,e),this.hasEventListener("before-remove")){const a=a2.acquire();a.target=this,a.cancellable=!0;for(let l=0,u=o.length;l{r.push(l)});const n=Ky.acquire();dD.forEach(l=>{n.push(l)});const s=this._items,o=e.items,a=Ky.acquire();if(pD.forEach(l=>{o.indexOf(l)!==s.indexOf(l)&&a.push(l)}),e.listeners&&(r.length||n.length||a.length)){const l={target:this,added:r,removed:n,moved:a},u=e.listeners.length;for(let c=0;c{if(!i)return JO;if(KAe.has(i))return KAe.get(i);let e=null;if(typeof i=="function")e=i.prototype.declaredClass;else if(i.base)e=i.base.prototype.declaredClass;else for(const r in i.typeMap){const n=i.typeMap[r].prototype.declaredClass;e?e+=` | ${n}`:e=n}let t=class extends JO{};return x([aze({Type:i,ensureType:typeof i=="function"?Sd(i):u3(i)})],t.prototype,"itemType",void 0),t=x([Qe(`esri.core.Collection<${e}>`)],t),KAe.set(i,t),t},x([D()],jO.prototype,"_updating",void 0),x([D()],jO.prototype,"length",void 0),x([D()],jO.prototype,"items",null),x([D({readOnly:!0})],jO.prototype,"updating",null),jO=JO=x([Qe("esri.core.Collection")],jO);const dr=jO;function ay(i,e,t=dr){return e||(e=new t),e===i||(e.removeAll(),dqi(i)?e.addMany(i):i&&e.add(i)),e}function fY(i){return i}function dqi(i){return i&&(Array.isArray(i)||"items"in i&&Array.isArray(i.items))}var c5;(function(i){i[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED"})(c5||(c5={}));let pqi=class{constructor(){this._resolver=ac(),this._status=c5.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=c5.RESOLVED,this._cleanUp()},()=>{this._status=c5.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===c5.RESOLVED}isRejected(){return this._status===c5.REJECTED}isFulfilled(){return this._status!==c5.PENDING}abort(){this._resolver.reject(Oc())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=ac(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},n=>{this.isFulfilled()||this._allPromise!==r||mo(n)||this._resolver.reject(n)}),e.resolve()}};const U3=i=>{let e=class extends i{constructor(...t){super(...t),this._promiseProps=new pqi,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(t,r){return this._promiseProps.promise.then(()=>this).then(t,r)}catch(t){return this.when(null,t)}addResolvingPromise(t){t&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in t?t.when():t)}};return e=x([Qe("esri.core.Promise")],e),e};let Rve=class extends U3(un){};Rve=x([Qe("esri.core.Promise")],Rve);const fqi="not-loaded",mqi="loading",gqi="failed",frt="loaded",dEt=i=>{let e=class extends i{constructor(...t){super(...t),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(r=>{const n=this.load.bind(this);this.load=s=>{const o=new Promise((a,l)=>{const u=ZH(s,l);this.destroyed&&l(new qe("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(a,l).finally(()=>{u&&u.remove()})});if(this.loadStatus===fqi){this._set("loadStatus",mqi);const a=this._loadController=new AbortController;n({signal:a.signal})}return r(),o}})),this.when(()=>{this._set("loadStatus",frt),this._loadController=null},r=>{this._set("loadStatus",gqi),this._set("loadError",r),this._loadController=null})}destroy(){this._loadController&&(this._loadController=zF(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===frt}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){return this.isFulfilled()||(this._set("loadError",new qe("load:cancelled","Cancelled")),this._loadController?.abort(),this._promiseProps.abort()),this}};return x([D({readOnly:!0})],e.prototype,"loaded",null),x([D({readOnly:!0})],e.prototype,"loadError",void 0),x([D({clonable:!1})],e.prototype,"loadStatus",void 0),x([D({type:[Rf],readOnly:!0})],e.prototype,"loadWarnings",null),e=x([Qe("esri.core.Loadable")],e),e};let UZ=class extends dEt(Rve){};UZ=x([Qe("esri.core.Loadable")],UZ),function(i){function e(t){return!(!t||!t.load)}i.LoadableMixin=dEt,i.isLoadable=e}(UZ||(UZ={}));const ef=UZ;function yqi(i,e,t){return g0(i.map((r,n)=>e.apply(t,[r,n])))}async function vqi(i,e,t){return(await g0(i.map((r,n)=>e.apply(t,[r,n])))).map(r=>r.value)}function lze(i){return{ok:!0,value:i}}function uze(i){return{ok:!1,error:i}}function _qi(i){return i!=null&&i.ok===!0?i.value:null}function bqi(i){return i!=null&&i.ok===!1?i.error:null}async function Uk(i){if(i==null)return{ok:!1,error:new Error("no promise provided")};try{return lze(await i)}catch(e){return uze(e)}}async function s5e(i){try{return lze(await i)}catch(e){return _a(e),uze(e)}}function pE(i,e){return new i4(i,e)}let i4=class extends un{get value(){return _qi(this._result)}get error(){return bqi(this._result)}get finished(){return this._result!=null}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=zF(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(n=>{this._result=lze(n),this._cleanup()},n=>{this._result=uze(n),this._cleanup()}),this._abortHandle=Qh(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Hc(this._abortHandle),this._abortController=null}};x([D()],i4.prototype,"value",null),x([D()],i4.prototype,"error",null),x([D()],i4.prototype,"finished",null),x([D()],i4.prototype,"promise",void 0),x([D()],i4.prototype,"_result",void 0),i4=x([Qe("esri.core.asyncUtils.ReactiveTask")],i4);async function VB(i,e){return await i.load(),pEt(i,e)}async function pEt(i,e){const t=[],r=(...s)=>{for(const o of s)o!=null&&(Array.isArray(o)?r(...o):dr.isCollection(o)?o.forEach(a=>r(a)):ef.isLoadable(o)&&t.push(o))};e(r);let n=null;if(await vqi(t,async s=>{const o=await Uk(wqi(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return i}function wqi(i){return"loadAll"in i&&typeof i.loadAll=="function"}function ur(i,e,t){let r,n;return e===void 0?(n=i,r=[void 0]):typeof e!="string"?(n=i,r=[void 0],t=e):(n=e,r=Array.isArray(i)?i:[i]),(s,o)=>{const a=s.constructor.prototype;for(const l of r){const u=qUe(s,l,n);u.write&&typeof u.write=="object"||(u.write={}),t&&(u.write.target=t),u.write.writer=a[o]}}}let Rs=class{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=r=>this.fromJSON(r),this.write=(r,n,s)=>{const o=this.toJSON(r);o!==void 0&&Qp(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return e!=null&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}};function pa(){return function(i,e){return new Rs(i,{ignoreUnknown:!0,...e})}}let cze=class{constructor(e,t,r,n){this.semiMajorAxis=e,this.flattening=t,this.outerAtmosphereRimWidth=r;const s=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*s,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=n||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Td=new cze(6378137,1/298.257223563,3e5,.006694379990137799),GA=new cze(3396190,1/169.8944472236118,23e4),VF=new cze(1737400,0,0);function Fl(i){if(!Ho.assetsPath)throw di.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new qe("assets:path-not-set","config.assetsPath is not set");return Iu(Ho.assetsPath,i)}let ZAe,nr=null;function hze(){return!!nr}function xqi(){return!!yi("esri-wasm")}function fEt(){return ZAe||(ZAe=Promise.resolve().then(()=>sNr).then(i=>i.p).then(({default:i})=>i({locateFile:e=>Fl(`esri/geometry/support/${e}`)})).then(i=>{gEt(i)}),ZAe)}var xne,ku,tx;(function(i){function e(s,o,a){nr.ensureCache.prepare();const l=S6(a),u=a===l,c=nr.ensureFloat64(l),h=nr._pe_geog_to_proj(nr.getPointer(s),o,c);return h&&k5(a,o,c,u),h}function t(s,o,a,l){switch(l){case ku.PE_TRANSFORM_P_TO_G:return r(s,o,a);case ku.PE_TRANSFORM_G_TO_P:return e(s,o,a)}return 0}function r(s,o,a){return n(s,o,a,0)}function n(s,o,a,l){nr.ensureCache.prepare();const u=S6(a),c=a===u,h=nr.ensureFloat64(u),p=nr._pe_proj_to_geog_center(nr.getPointer(s),o,h,l);return p&&k5(a,o,h,c),p}i.geogToProj=e,i.projGeog=t,i.projToGeog=r,i.projToGeogCenter=n})(xne||(xne={})),function(i){function e(){i.PE_BUFFER_MAX=nr.PeDefs.prototype.PE_BUFFER_MAX,i.PE_NAME_MAX=nr.PeDefs.prototype.PE_NAME_MAX,i.PE_MGRS_MAX=nr.PeDefs.prototype.PE_MGRS_MAX,i.PE_USNG_MAX=nr.PeDefs.prototype.PE_USNG_MAX,i.PE_DD_MAX=nr.PeDefs.prototype.PE_DD_MAX,i.PE_DDM_MAX=nr.PeDefs.prototype.PE_DDM_MAX,i.PE_DMS_MAX=nr.PeDefs.prototype.PE_DMS_MAX,i.PE_UTM_MAX=nr.PeDefs.prototype.PE_UTM_MAX,i.PE_PARM_MAX=nr.PeDefs.prototype.PE_PARM_MAX,i.PE_TYPE_NONE=nr.PeDefs.prototype.PE_TYPE_NONE,i.PE_TYPE_GEOGCS=nr.PeDefs.prototype.PE_TYPE_GEOGCS,i.PE_TYPE_PROJCS=nr.PeDefs.prototype.PE_TYPE_PROJCS,i.PE_TYPE_GEOGTRAN=nr.PeDefs.prototype.PE_TYPE_GEOGTRAN,i.PE_TYPE_COORDSYS=nr.PeDefs.prototype.PE_TYPE_COORDSYS,i.PE_TYPE_UNIT=nr.PeDefs.prototype.PE_TYPE_UNIT,i.PE_TYPE_LINUNIT=nr.PeDefs.prototype.PE_TYPE_LINUNIT,i.PE_STR_OPTS_NONE=nr.PeDefs.prototype.PE_STR_OPTS_NONE,i.PE_STR_AUTH_NONE=nr.PeDefs.prototype.PE_STR_AUTH_NONE,i.PE_STR_AUTH_TOP=nr.PeDefs.prototype.PE_STR_AUTH_TOP,i.PE_STR_NAME_CANON=nr.PeDefs.prototype.PE_STR_NAME_CANON,i.PE_STR_FMT_WKT=nr.PeDefs.prototype.PE_STR_FMT_WKT,i.PE_STR_FMT_WKT2=nr.PeDefs.prototype.PE_STR_FMT_WKT2,i.PE_PARM_X0=nr.PeDefs.prototype.PE_PARM_X0,i.PE_PARM_ND=nr.PeDefs.prototype.PE_PARM_ND,i.PE_TRANSFORM_1_TO_2=nr.PeDefs.prototype.PE_TRANSFORM_1_TO_2,i.PE_TRANSFORM_2_TO_1=nr.PeDefs.prototype.PE_TRANSFORM_2_TO_1,i.PE_TRANSFORM_P_TO_G=nr.PeDefs.prototype.PE_TRANSFORM_P_TO_G,i.PE_TRANSFORM_G_TO_P=nr.PeDefs.prototype.PE_TRANSFORM_G_TO_P,i.PE_HORIZON_RECT=nr.PeDefs.prototype.PE_HORIZON_RECT,i.PE_HORIZON_POLY=nr.PeDefs.prototype.PE_HORIZON_POLY,i.PE_HORIZON_LINE=nr.PeDefs.prototype.PE_HORIZON_LINE,i.PE_HORIZON_DELTA=nr.PeDefs.prototype.PE_HORIZON_DELTA}i.init=e}(ku||(ku={})),function(i){const e={},t={},r=m=>{if(m){const v=m.getType();switch(v){case ku.PE_TYPE_GEOGCS:m=nr.castObject(m,nr.PeGeogcs);break;case ku.PE_TYPE_PROJCS:m=nr.castObject(m,nr.PeProjcs);break;case ku.PE_TYPE_GEOGTRAN:m=nr.castObject(m,nr.PeGeogtran);break;default:v&ku.PE_TYPE_UNIT&&(m=nr.castObject(m,nr.PeUnit))}}return m};function n(){nr.PeFactory.prototype.initialize(null)}function s(m){return o(ku.PE_TYPE_COORDSYS,m)}function o(m,v){let w=null,S=e[m];if(S||(S={},e[m]=S),S.hasOwnProperty(String(v)))w=S[v];else{const I=nr.PeFactory.prototype.factoryByType(m,v);nr.compare(I,nr.NULL)||(w=I,S[v]=w)}return w=r(w),w}function a(m,v){let w=null,S=t[m];if(S||(S={},t[m]=S),S.hasOwnProperty(v))w=S[v];else{const I=nr.PeFactory.prototype.fromString(m,v);nr.compare(I,nr.NULL)||(w=I,S[v]=w)}return w=r(w),w}function l(m){return o(ku.PE_TYPE_GEOGCS,m)}function u(m){return o(ku.PE_TYPE_GEOGTRAN,m)}function c(m){return nr.PeFactory.prototype.getCode(m)}function h(m){return o(ku.PE_TYPE_PROJCS,m)}function p(m){return o(ku.PE_TYPE_UNIT,m)}i.initialize=n,i.coordsys=s,i.factoryByType=o,i.fromString=a,i.geogcs=l,i.geogtran=u,i.getCode=c,i.projcs=h,i.unit=p}(tx||(tx={}));let mEt=null;var Dve,o5e,Fve,a5e,kve,l5e,Lve,Sne,u5e;function gEt(i){function e(s,o,a){s[o]=a(s[o])}nr=i,ku.init(),Dve.init(),kve.init(),Lve.init(),Sne.init(),mEt=class extends nr.PeGCSExtent{destroy(){nr.destroy(this)}};const t=[nr.PeDatum,nr.PeGeogcs,nr.PeGeogtran,nr.PeObject,nr.PeParameter,nr.PePrimem,nr.PeProjcs,nr.PeSpheroid,nr.PeUnit];for(const s of t)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(ku.PE_NAME_MAX))});for(const s of[nr.PeGeogtran,nr.PeProjcs])e(s.prototype,"getParameters",o=>function(){const a=new Array(ku.PE_PARM_MAX);let l=o.call(this);for(let u=0;ufunction(){const o=this.getSize();if(!o)return null;const a=[];return k5(a,o,s.call(this)),a}),e(nr.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=nr._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=s.call(this);if(!nr.compare(l,nr.NULL)){a=[l];const u=this.getSteps();if(u>1){const c=nr.getPointer(l);for(let h=1;hfunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(s))return o.get(s);let a=null;const l=s.call(this);if(!nr.compare(l,nr.NULL)){a=[l];const u=l.getNump();if(u>1){const c=nr.getPointer(l);for(let h=1;h{e.push(t[0],t[1])})):e=i,e}function k5(i,e,t,r=!1){if(r)for(let n=0;n<2*e;n++)i[n]=nr.getValue(t+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=i.length===0;for(let s=0;s1)){const m=nr.getPointer(p);for(let v=1;v{yM(n);const s=n.getGeogtran();yM(s),s.getParameters().forEach(yM),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{yM(o);const a=o.getDatum();yM(a),yM(a.getSpheroid()),yM(o.getPrimem()),yM(o.getUnit())})});nr.PeGTlistExtendedEntry.prototype.Delete(t[0])}}i.destroy=e}(o5e||(o5e={})),function(i){function e(t,r,n,s,o){nr.ensureCache.prepare();const a=S6(n),l=n===a,u=nr.ensureFloat64(a);let c=0;s&&(c=nr.ensureFloat64(s));const h=nr._pe_geog_to_geog(nr.getPointer(t),r,u,c,o);return h&&k5(n,r,u,l),h}i.geogToGeog=e}(Fve||(Fve={})),function(i){const e=(u,c,h,p,m,v)=>{let w,S;switch(nr.ensureCache.prepare(),u){case"dd":w=nr._pe_geog_to_dd,S=ku.PE_DD_MAX;break;case"ddm":w=nr._pe_geog_to_ddm,S=ku.PE_DDM_MAX;break;case"dms":w=nr._pe_geog_to_dms,S=ku.PE_DMS_MAX}let I=0;c&&(I=nr.getPointer(c));const R=S6(p),L=nr.ensureFloat64(R),k=Pce(h,S),B=w(I,h,L,m,nr.ensureInt32(k));if(B)for(let $=0;${let v;switch(nr.ensureCache.prepare(),u){case"dd":v=nr._pe_dd_to_geog;break;case"ddm":v=nr._pe_ddm_to_geog;break;case"dms":v=nr._pe_dms_to_geog}let w=0;c&&(w=nr.getPointer(c));const S=p.map(k=>nr.ensureString(k)),I=nr.ensureInt32(S),R=nr.ensureFloat64(new Array(2*h)),L=v(w,h,I,R);return L&&k5(m,h,R),L};function r(u,c,h,p,m){return e("dms",u,c,h,p,m)}function n(u,c,h,p){return t("dms",u,c,h,p)}function s(u,c,h,p,m){return e("ddm",u,c,h,p,m)}function o(u,c,h,p){return t("ddm",u,c,h,p)}function a(u,c,h,p,m){return e("dd",u,c,h,p,m)}function l(u,c,h,p){return t("dd",u,c,h,p)}i.geogToDms=r,i.dmsToGeog=n,i.geogToDdm=s,i.ddmToGeog=o,i.geogToDd=a,i.ddToGeog=l}(a5e||(a5e={})),function(i){function e(){i.PE_MGRS_STYLE_NEW=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,i.PE_MGRS_STYLE_OLD=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,i.PE_MGRS_STYLE_AUTO=nr.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,i.PE_MGRS_180_ZONE_1_PLUS=nr.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,i.PE_MGRS_ADD_SPACES=nr.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function t(n,s,o,a,l,u,c){nr.ensureCache.prepare();let h=0;n&&(h=nr.getPointer(n));const p=S6(o),m=nr.ensureFloat64(p),v=Pce(s,ku.PE_MGRS_MAX),w=nr.ensureInt32(v),S=nr._pe_geog_to_mgrs_extended(h,s,m,a,l,u,w);if(S)for(let I=0;Inr.ensureString(v)),h=nr.ensureInt32(c),p=nr.ensureFloat64(new Array(2*s)),m=nr._pe_mgrs_to_geog_extended(u,s,h,a,p);return m&&k5(l,s,p),m}i.init=e,i.geogToMgrsExtended=t,i.mgrsToGeogExtended=r}(kve||(kve={})),function(i){function e(r,n,s,o,a,l,u){nr.ensureCache.prepare();let c=0;r&&(c=nr.getPointer(r));const h=S6(s),p=nr.ensureFloat64(h),m=Pce(n,ku.PE_MGRS_MAX),v=nr.ensureInt32(m),w=nr._pe_geog_to_usng(c,n,p,o,a,l,v);if(w)for(let S=0;Snr.ensureString(p)),u=nr.ensureInt32(l),c=nr.ensureFloat64(new Array(2*n)),h=nr._pe_usng_to_geog(a,n,u,c);return h&&k5(o,n,c),h}i.geogToUsng=e,i.usngToGeog=t}(l5e||(l5e={})),function(i){function e(){i.PE_UTM_OPTS_NONE=nr.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,i.PE_UTM_OPTS_ADD_SPACES=nr.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,i.PE_UTM_OPTS_NS=nr.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function t(n,s,o,a,l){nr.ensureCache.prepare();let u=0;n&&(u=nr.getPointer(n));const c=S6(o),h=nr.ensureFloat64(c),p=Pce(s,ku.PE_UTM_MAX),m=nr.ensureInt32(p),v=nr._pe_geog_to_utm(u,s,h,a,m);if(v)for(let w=0;wnr.ensureString(v)),h=nr.ensureInt32(c),p=nr.ensureFloat64(new Array(2*s)),m=nr._pe_utm_to_geog(u,s,h,a,p);return m&&k5(l,s,p),m}i.init=e,i.geogToUtm=t,i.utmToGeog=r}(Lve||(Lve={})),function(i){const e=new Map;function t(){i.PE_PCSINFO_OPTION_NONE=nr.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,i.PE_PCSINFO_OPTION_DOMAIN=nr.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,i.PE_POLE_OUTSIDE_BOUNDARY=nr.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,i.PE_POLE_POINT=nr.PePCSInfo.prototype.PE_POLE_POINT}function r(n,s=i.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return e.has(n)&&(a=e.get(n),a[s]&&(o=a[s])),o||(o=nr.PePCSInfo.prototype.generate(n,s),a||(a=[],e.set(n,a)),a[s]=o),o}i.init=t,i.generate=r}(Sne||(Sne={})),function(i){function e(){return nr.PeVersion.prototype.version_string()}i.versionString=e}(u5e||(u5e={}));const Sqi=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return xne},get PeDefs(){return ku},get PeFactory(){return tx},get PeGCSExtent(){return mEt},get PeGTTransformations(){return Fve},get PeGTlistExtended(){return Dve},get PeGTlistExtendedEntry(){return o5e},get PeNotationDms(){return a5e},get PeNotationMgrs(){return kve},get PeNotationUsng(){return l5e},get PeNotationUtm(){return Lve},get PePCSInfo(){return Sne},get PeVersion(){return u5e},_init:gEt,get _pe(){return nr},isLoaded:hze,isSupported:xqi,load:fEt},Symbol.toStringTag,{value:"Module"}));var Y9;(function(i){i[i.CGCS2000=4490]="CGCS2000",i[i.GCSMARS2000=104971]="GCSMARS2000",i[i.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",i[i.GCSMOON2000=104903]="GCSMOON2000"})(Y9||(Y9={}));let se;const Qt={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(se=2e3;se<=2045;se++)Qt[se]=0;for(se=2056;se<=2065;se++)Qt[se]=0;for(se=2067;se<=2135;se++)Qt[se]=0;for(se=2137;se<=2154;se++)Qt[se]=0;for(se=2161;se<=2170;se++)Qt[se]=0;for(se=2172;se<=2193;se++)Qt[se]=0;for(se=2195;se<=2198;se++)Qt[se]=0;for(se=2200;se<=2203;se++)Qt[se]=0;for(se=2205;se<=2217;se++)Qt[se]=0;for(se=2222;se<=2224;se++)Qt[se]=1;for(se=2225;se<=2250;se++)Qt[se]=2;for(se=2251;se<=2253;se++)Qt[se]=1;for(se=2257;se<=2264;se++)Qt[se]=2;for(se=2274;se<=2279;se++)Qt[se]=2;for(se=2280;se<=2282;se++)Qt[se]=1;for(se=2283;se<=2289;se++)Qt[se]=2;for(se=2290;se<=2292;se++)Qt[se]=0;for(se=2308;se<=2313;se++)Qt[se]=0;for(se=2315;se<=2491;se++)Qt[se]=0;for(se=2494;se<=2866;se++)Qt[se]=0;for(se=2867;se<=2869;se++)Qt[se]=1;for(se=2870;se<=2888;se++)Qt[se]=2;for(se=2891;se<=2895;se++)Qt[se]=2;for(se=2896;se<=2898;se++)Qt[se]=1;for(se=2902;se<=2908;se++)Qt[se]=2;for(se=2915;se<=2920;se++)Qt[se]=2;for(se=2921;se<=2923;se++)Qt[se]=1;for(se=2924;se<=2930;se++)Qt[se]=2;for(se=2931;se<=2962;se++)Qt[se]=0;for(se=2964;se<=2968;se++)Qt[se]=2;for(se=2969;se<=2973;se++)Qt[se]=0;for(se=2975;se<=2991;se++)Qt[se]=0;for(se=2995;se<=3051;se++)Qt[se]=0;for(se=3054;se<=3079;se++)Qt[se]=0;for(se=3081;se<=3088;se++)Qt[se]=0;for(se=3092;se<=3101;se++)Qt[se]=0;for(se=3106;se<=3138;se++)Qt[se]=0;for(se=3146;se<=3151;se++)Qt[se]=0;for(se=3153;se<=3166;se++)Qt[se]=0;for(se=3168;se<=3172;se++)Qt[se]=0;for(se=3174;se<=3203;se++)Qt[se]=0;for(se=3294;se<=3358;se++)Qt[se]=0;for(se=3367;se<=3403;se++)Qt[se]=0;for(se=3408;se<=3416;se++)Qt[se]=0;for(se=3417;se<=3438;se++)Qt[se]=2;for(se=3441;se<=3446;se++)Qt[se]=2;for(se=3447;se<=3450;se++)Qt[se]=0;for(se=3451;se<=3459;se++)Qt[se]=2;for(se=3460;se<=3478;se++)Qt[se]=0;for(se=3554;se<=3559;se++)Qt[se]=0;for(se=3560;se<=3570;se++)Qt[se]=2;for(se=3571;se<=3581;se++)Qt[se]=0;for(se=3594;se<=3597;se++)Qt[se]=0;for(se=3601;se<=3604;se++)Qt[se]=0;for(se=3637;se<=3639;se++)Qt[se]=0;for(se=3665;se<=3667;se++)Qt[se]=0;for(se=3693;se<=3695;se++)Qt[se]=0;for(se=3701;se<=3727;se++)Qt[se]=0;for(se=3728;se<=3739;se++)Qt[se]=2;for(se=3740;se<=3751;se++)Qt[se]=0;for(se=3753;se<=3760;se++)Qt[se]=2;for(se=3761;se<=3773;se++)Qt[se]=0;for(se=3775;se<=3777;se++)Qt[se]=0;for(se=3779;se<=3781;se++)Qt[se]=0;for(se=3783;se<=3785;se++)Qt[se]=0;for(se=3788;se<=3791;se++)Qt[se]=0;for(se=3797;se<=3802;se++)Qt[se]=0;for(se=3814;se<=3816;se++)Qt[se]=0;for(se=3825;se<=3829;se++)Qt[se]=0;for(se=3832;se<=3841;se++)Qt[se]=0;for(se=3844;se<=3852;se++)Qt[se]=0;for(se=3873;se<=3885;se++)Qt[se]=0;for(se=3890;se<=3893;se++)Qt[se]=0;for(se=3907;se<=3912;se++)Qt[se]=0;for(se=3942;se<=3950;se++)Qt[se]=0;for(se=3968;se<=3970;se++)Qt[se]=0;for(se=3973;se<=3976;se++)Qt[se]=0;for(se=3986;se<=3989;se++)Qt[se]=0;for(se=3994;se<=3997;se++)Qt[se]=0;for(se=4048;se<=4051;se++)Qt[se]=0;for(se=4056;se<=4063;se++)Qt[se]=0;for(se=4093;se<=4096;se++)Qt[se]=0;for(se=4390;se<=4398;se++)Qt[se]=0;for(se=4399;se<=4413;se++)Qt[se]=2;for(se=4418;se<=4433;se++)Qt[se]=2;for(se=4455;se<=4457;se++)Qt[se]=2;for(se=4484;se<=4489;se++)Qt[se]=0;for(se=4491;se<=4554;se++)Qt[se]=0;for(se=4568;se<=4589;se++)Qt[se]=0;for(se=4652;se<=4656;se++)Qt[se]=0;for(se=4766;se<=4800;se++)Qt[se]=0;for(se=5014;se<=5016;se++)Qt[se]=0;for(se=5069;se<=5072;se++)Qt[se]=0;for(se=5105;se<=5130;se++)Qt[se]=0;for(se=5167;se<=5188;se++)Qt[se]=0;for(se=5253;se<=5259;se++)Qt[se]=0;for(se=5269;se<=5275;se++)Qt[se]=0;for(se=5292;se<=5311;se++)Qt[se]=0;for(se=5329;se<=5331;se++)Qt[se]=0;for(se=5343;se<=5349;se++)Qt[se]=0;for(se=5355;se<=5357;se++)Qt[se]=0;for(se=5387;se<=5389;se++)Qt[se]=0;for(se=5459;se<=5463;se++)Qt[se]=0;for(se=5479;se<=5482;se++)Qt[se]=0;for(se=5518;se<=5520;se++)Qt[se]=0;for(se=5530;se<=5539;se++)Qt[se]=0;for(se=5550;se<=5552;se++)Qt[se]=0;for(se=5562;se<=5583;se++)Qt[se]=0;for(se=5623;se<=5625;se++)Qt[se]=2;for(se=5631;se<=5639;se++)Qt[se]=0;for(se=5649;se<=5653;se++)Qt[se]=0;for(se=5663;se<=5680;se++)Qt[se]=0;for(se=5682;se<=5685;se++)Qt[se]=0;for(se=5875;se<=5877;se++)Qt[se]=0;for(se=5896;se<=5899;se++)Qt[se]=0;for(se=5921;se<=5940;se++)Qt[se]=0;for(se=6050;se<=6125;se++)Qt[se]=0;for(se=6244;se<=6275;se++)Qt[se]=0;for(se=6328;se<=6348;se++)Qt[se]=0;for(se=6350;se<=6356;se++)Qt[se]=0;for(se=6366;se<=6372;se++)Qt[se]=0;for(se=6381;se<=6387;se++)Qt[se]=0;for(se=6393;se<=6404;se++)Qt[se]=0;for(se=6480;se<=6483;se++)Qt[se]=0;for(se=6511;se<=6514;se++)Qt[se]=0;for(se=6579;se<=6581;se++)Qt[se]=0;for(se=6619;se<=6624;se++)Qt[se]=0;for(se=6625;se<=6627;se++)Qt[se]=2;for(se=6628;se<=6632;se++)Qt[se]=0;for(se=6634;se<=6637;se++)Qt[se]=0;for(se=6669;se<=6692;se++)Qt[se]=0;for(se=6707;se<=6709;se++)Qt[se]=0;for(se=6720;se<=6723;se++)Qt[se]=0;for(se=6732;se<=6738;se++)Qt[se]=0;for(se=6931;se<=6933;se++)Qt[se]=0;for(se=6956;se<=6959;se++)Qt[se]=0;for(se=7005;se<=7007;se++)Qt[se]=0;for(se=7057;se<=7070;se++)Qt[se]=2;for(se=7074;se<=7082;se++)Qt[se]=0;for(se=7109;se<=7118;se++)Qt[se]=0;for(se=7119;se<=7127;se++)Qt[se]=1;for(se=7374;se<=7376;se++)Qt[se]=0;for(se=7528;se<=7586;se++)Qt[se]=0;for(se=7587;se<=7645;se++)Qt[se]=2;for(se=7692;se<=7696;se++)Qt[se]=0;for(se=7755;se<=7787;se++)Qt[se]=0;for(se=7791;se<=7795;se++)Qt[se]=0;for(se=7799;se<=7801;se++)Qt[se]=0;for(se=7803;se<=7805;se++)Qt[se]=0;for(se=7825;se<=7831;se++)Qt[se]=0;for(se=7845;se<=7859;se++)Qt[se]=0;for(se=8013;se<=8032;se++)Qt[se]=0;for(se=8065;se<=8068;se++)Qt[se]=1;for(se=8518;se<=8529;se++)Qt[se]=2;for(se=8533;se<=8536;se++)Qt[se]=2;for(se=8538;se<=8540;se++)Qt[se]=2;for(se=8677;se<=8679;se++)Qt[se]=0;for(se=8836;se<=8840;se++)Qt[se]=0;for(se=8857;se<=8859;se++)Qt[se]=0;for(se=8908;se<=8910;se++)Qt[se]=0;for(se=9154;se<=9159;se++)Qt[se]=0;for(se=9205;se<=9218;se++)Qt[se]=0;for(se=9271;se<=9273;se++)Qt[se]=0;for(se=9295;se<=9297;se++)Qt[se]=0;for(se=9356;se<=9360;se++)Qt[se]=0;for(se=9404;se<=9407;se++)Qt[se]=0;for(se=9476;se<=9482;se++)Qt[se]=0;for(se=9487;se<=9494;se++)Qt[se]=0;for(se=9697;se<=9699;se++)Qt[se]=0;for(se=9821;se<=9865;se++)Qt[se]=0;for(se=10285;se<=10291;se++)Qt[se]=0;for(se=10314;se<=10317;se++)Qt[se]=0;for(se=10448;se<=10465;se++)Qt[se]=0;for(se=11114;se<=11118;se++)Qt[se]=0;for(se=20004;se<=20032;se++)Qt[se]=0;for(se=20047;se<=20049;se++)Qt[se]=0;for(se=20062;se<=20092;se++)Qt[se]=0;for(se=20135;se<=20138;se++)Qt[se]=0;for(se=20248;se<=20258;se++)Qt[se]=0;for(se=20348;se<=20358;se++)Qt[se]=0;for(se=20436;se<=20440;se++)Qt[se]=0;for(se=20822;se<=20824;se++)Qt[se]=0;for(se=20904;se<=20932;se++)Qt[se]=0;for(se=20934;se<=20936;se++)Qt[se]=0;for(se=21004;se<=21032;se++)Qt[se]=0;for(se=21035;se<=21037;se++)Qt[se]=0;for(se=21095;se<=21097;se++)Qt[se]=0;for(se=21148;se<=21150;se++)Qt[se]=0;for(se=21207;se<=21264;se++)Qt[se]=0;for(se=21307;se<=21364;se++)Qt[se]=0;for(se=21413;se<=21423;se++)Qt[se]=0;for(se=21453;se<=21463;se++)Qt[se]=0;for(se=21473;se<=21483;se++)Qt[se]=0;for(se=21780;se<=21782;se++)Qt[se]=0;for(se=21891;se<=21894;se++)Qt[se]=0;for(se=21896;se<=21899;se++)Qt[se]=0;for(se=22171;se<=22177;se++)Qt[se]=0;for(se=22181;se<=22187;se++)Qt[se]=0;for(se=22191;se<=22197;se++)Qt[se]=0;for(se=22207;se<=22222;se++)Qt[se]=0;for(se=22229;se<=22232;se++)Qt[se]=0;for(se=22234;se<=22236;se++)Qt[se]=0;for(se=22243;se<=22250;se++)Qt[se]=0;for(se=22262;se<=22265;se++)Qt[se]=0;for(se=22307;se<=22322;se++)Qt[se]=0;for(se=22348;se<=22357;se++)Qt[se]=0;for(se=22407;se<=22422;se++)Qt[se]=0;for(se=22462;se<=22465;se++)Qt[se]=0;for(se=22521;se<=22525;se++)Qt[se]=0;for(se=22607;se<=22622;se++)Qt[se]=0;for(se=22641;se<=22646;se++)Qt[se]=0;for(se=22648;se<=22657;se++)Qt[se]=0;for(se=22707;se<=22722;se++)Qt[se]=0;for(se=22762;se<=22765;se++)Qt[se]=0;for(se=22807;se<=22822;se++)Qt[se]=0;for(se=22991;se<=22994;se++)Qt[se]=0;for(se=23028;se<=23038;se++)Qt[se]=0;for(se=23301;se<=23333;se++)Qt[se]=2;for(se=23830;se<=23853;se++)Qt[se]=0;for(se=23866;se<=23872;se++)Qt[se]=0;for(se=23877;se<=23884;se++)Qt[se]=0;for(se=23886;se<=23894;se++)Qt[se]=0;for(se=23946;se<=23948;se++)Qt[se]=0;for(se=24311;se<=24313;se++)Qt[se]=0;for(se=24342;se<=24347;se++)Qt[se]=0;for(se=24370;se<=24374;se++)Qt[se]=10;for(se=24375;se<=24381;se++)Qt[se]=0;for(se=24718;se<=24721;se++)Qt[se]=0;for(se=24817;se<=24821;se++)Qt[se]=0;for(se=24877;se<=24882;se++)Qt[se]=0;for(se=24891;se<=24893;se++)Qt[se]=0;for(se=25391;se<=25395;se++)Qt[se]=0;for(se=25828;se<=25838;se++)Qt[se]=0;for(se=26191;se<=26195;se++)Qt[se]=0;for(se=26391;se<=26393;se++)Qt[se]=0;for(se=26701;se<=26722;se++)Qt[se]=0;for(se=26729;se<=26799;se++)Qt[se]=2;for(se=26801;se<=26803;se++)Qt[se]=2;for(se=26811;se<=26813;se++)Qt[se]=2;for(se=26847;se<=26870;se++)Qt[se]=2;for(se=26891;se<=26899;se++)Qt[se]=0;for(se=26901;se<=26923;se++)Qt[se]=0;for(se=26929;se<=26946;se++)Qt[se]=0;for(se=26948;se<=26998;se++)Qt[se]=0;for(se=27037;se<=27040;se++)Qt[se]=0;for(se=27205;se<=27232;se++)Qt[se]=0;for(se=27258;se<=27260;se++)Qt[se]=0;for(se=27391;se<=27398;se++)Qt[se]=0;for(se=27561;se<=27564;se++)Qt[se]=0;for(se=27571;se<=27574;se++)Qt[se]=0;for(se=27581;se<=27584;se++)Qt[se]=0;for(se=27591;se<=27594;se++)Qt[se]=0;for(se=28191;se<=28193;se++)Qt[se]=0;for(se=28348;se<=28358;se++)Qt[se]=0;for(se=28402;se<=28432;se++)Qt[se]=0;for(se=28462;se<=28492;se++)Qt[se]=0;for(se=29118;se<=29122;se++)Qt[se]=0;for(se=29168;se<=29172;se++)Qt[se]=0;for(se=29177;se<=29185;se++)Qt[se]=0;for(se=29187;se<=29195;se++)Qt[se]=0;for(se=29900;se<=29903;se++)Qt[se]=0;for(se=30161;se<=30179;se++)Qt[se]=0;for(se=30491;se<=30494;se++)Qt[se]=0;for(se=30729;se<=30732;se++)Qt[se]=0;for(se=31251;se<=31259;se++)Qt[se]=0;for(se=31265;se<=31268;se++)Qt[se]=0;for(se=31275;se<=31279;se++)Qt[se]=0;for(se=31281;se<=31297;se++)Qt[se]=0;for(se=31461;se<=31469;se++)Qt[se]=0;for(se=31491;se<=31495;se++)Qt[se]=0;for(se=31917;se<=31922;se++)Qt[se]=0;for(se=31965;se<=32e3;se++)Qt[se]=0;for(se=32001;se<=32003;se++)Qt[se]=2;for(se=32005;se<=32031;se++)Qt[se]=2;for(se=32033;se<=32060;se++)Qt[se]=2;for(se=32064;se<=32067;se++)Qt[se]=2;for(se=32074;se<=32077;se++)Qt[se]=2;for(se=32081;se<=32086;se++)Qt[se]=0;for(se=32107;se<=32130;se++)Qt[se]=0;for(se=32133;se<=32159;se++)Qt[se]=0;for(se=32164;se<=32167;se++)Qt[se]=2;for(se=32180;se<=32199;se++)Qt[se]=0;for(se=32201;se<=32260;se++)Qt[se]=0;for(se=32301;se<=32360;se++)Qt[se]=0;for(se=32401;se<=32460;se++)Qt[se]=0;for(se=32501;se<=32560;se++)Qt[se]=0;for(se=32601;se<=32662;se++)Qt[se]=0;for(se=32664;se<=32667;se++)Qt[se]=2;for(se=32701;se<=32761;se++)Qt[se]=0;for(se=53001;se<=53004;se++)Qt[se]=0;for(se=53008;se<=53019;se++)Qt[se]=0;for(se=53021;se<=53032;se++)Qt[se]=0;for(se=53034;se<=53037;se++)Qt[se]=0;for(se=53042;se<=53046;se++)Qt[se]=0;for(se=53074;se<=53080;se++)Qt[se]=0;for(se=54001;se<=54004;se++)Qt[se]=0;for(se=54008;se<=54019;se++)Qt[se]=0;for(se=54021;se<=54032;se++)Qt[se]=0;for(se=54034;se<=54037;se++)Qt[se]=0;for(se=54042;se<=54046;se++)Qt[se]=0;for(se=54048;se<=54053;se++)Qt[se]=0;for(se=54074;se<=54080;se++)Qt[se]=0;for(se=54098;se<=54101;se++)Qt[se]=0;for(se=102001;se<=102040;se++)Qt[se]=0;for(se=102042;se<=102063;se++)Qt[se]=0;for(se=102065;se<=102067;se++)Qt[se]=0;for(se=102070;se<=102117;se++)Qt[se]=0;for(se=102122;se<=102216;se++)Qt[se]=0;for(se=102221;se<=102377;se++)Qt[se]=0;for(se=102382;se<=102388;se++)Qt[se]=0;for(se=102389;se<=102398;se++)Qt[se]=2;for(se=102399;se<=102444;se++)Qt[se]=0;for(se=102445;se<=102447;se++)Qt[se]=2;for(se=102448;se<=102458;se++)Qt[se]=0;for(se=102459;se<=102468;se++)Qt[se]=2;for(se=102469;se<=102499;se++)Qt[se]=0;for(se=102500;se<=102519;se++)Qt[se]=1;for(se=102520;se<=102524;se++)Qt[se]=0;for(se=102525;se<=102529;se++)Qt[se]=2;for(se=102530;se<=102588;se++)Qt[se]=0;for(se=102590;se<=102598;se++)Qt[se]=0;for(se=102601;se<=102603;se++)Qt[se]=0;for(se=102605;se<=102628;se++)Qt[se]=0;for(se=102629;se<=102646;se++)Qt[se]=2;for(se=102648;se<=102700;se++)Qt[se]=2;for(se=102701;se<=102703;se++)Qt[se]=0;for(se=102707;se<=102730;se++)Qt[se]=2;for(se=102733;se<=102758;se++)Qt[se]=2;for(se=102767;se<=102900;se++)Qt[se]=0;for(se=102901;se<=102933;se++)Qt[se]=2;for(se=102934;se<=102950;se++)Qt[se]=13;for(se=102951;se<=102955;se++)Qt[se]=0;for(se=102961;se<=102963;se++)Qt[se]=0;for(se=102965;se<=102969;se++)Qt[se]=0;for(se=102971;se<=102973;se++)Qt[se]=0;for(se=102975;se<=102989;se++)Qt[se]=0;for(se=102990;se<=102992;se++)Qt[se]=1;for(se=102997;se<=103002;se++)Qt[se]=0;for(se=103003;se<=103008;se++)Qt[se]=2;for(se=103009;se<=103011;se++)Qt[se]=0;for(se=103012;se<=103014;se++)Qt[se]=2;for(se=103019;se<=103021;se++)Qt[se]=0;for(se=103022;se<=103024;se++)Qt[se]=2;for(se=103029;se<=103031;se++)Qt[se]=0;for(se=103032;se<=103034;se++)Qt[se]=2;for(se=103065;se<=103068;se++)Qt[se]=0;for(se=103074;se<=103076;se++)Qt[se]=0;for(se=103077;se<=103079;se++)Qt[se]=1;for(se=103080;se<=103082;se++)Qt[se]=0;for(se=103083;se<=103085;se++)Qt[se]=2;for(se=103090;se<=103093;se++)Qt[se]=0;for(se=103097;se<=103099;se++)Qt[se]=0;for(se=103100;se<=103102;se++)Qt[se]=2;for(se=103107;se<=103109;se++)Qt[se]=0;for(se=103110;se<=103112;se++)Qt[se]=2;for(se=103113;se<=103116;se++)Qt[se]=0;for(se=103117;se<=103120;se++)Qt[se]=2;for(se=103153;se<=103157;se++)Qt[se]=0;for(se=103158;se<=103162;se++)Qt[se]=2;for(se=103163;se<=103165;se++)Qt[se]=0;for(se=103166;se<=103168;se++)Qt[se]=1;for(se=103169;se<=103171;se++)Qt[se]=2;for(se=103186;se<=103188;se++)Qt[se]=0;for(se=103189;se<=103191;se++)Qt[se]=2;for(se=103192;se<=103195;se++)Qt[se]=0;for(se=103196;se<=103199;se++)Qt[se]=2;for(se=103200;se<=103224;se++)Qt[se]=0;for(se=103225;se<=103227;se++)Qt[se]=1;for(se=103232;se<=103237;se++)Qt[se]=0;for(se=103238;se<=103243;se++)Qt[se]=2;for(se=103244;se<=103246;se++)Qt[se]=0;for(se=103247;se<=103249;se++)Qt[se]=2;for(se=103254;se<=103256;se++)Qt[se]=0;for(se=103257;se<=103259;se++)Qt[se]=2;for(se=103264;se<=103266;se++)Qt[se]=0;for(se=103267;se<=103269;se++)Qt[se]=2;for(se=103300;se<=103375;se++)Qt[se]=0;for(se=103381;se<=103383;se++)Qt[se]=0;for(se=103384;se<=103386;se++)Qt[se]=1;for(se=103387;se<=103389;se++)Qt[se]=0;for(se=103390;se<=103392;se++)Qt[se]=2;for(se=103397;se<=103399;se++)Qt[se]=0;for(se=103400;se<=103471;se++)Qt[se]=2;for(se=103476;se<=103478;se++)Qt[se]=0;for(se=103479;se<=103481;se++)Qt[se]=2;for(se=103486;se<=103488;se++)Qt[se]=0;for(se=103489;se<=103491;se++)Qt[se]=2;for(se=103492;se<=103495;se++)Qt[se]=0;for(se=103496;se<=103499;se++)Qt[se]=2;for(se=103528;se<=103543;se++)Qt[se]=0;for(se=103544;se<=103548;se++)Qt[se]=2;for(se=103549;se<=103551;se++)Qt[se]=0;for(se=103552;se<=103554;se++)Qt[se]=1;for(se=103555;se<=103557;se++)Qt[se]=2;for(se=103558;se<=103560;se++)Qt[se]=0;for(se=103571;se<=103573;se++)Qt[se]=0;for(se=103574;se<=103576;se++)Qt[se]=2;for(se=103577;se<=103580;se++)Qt[se]=0;for(se=103581;se<=103583;se++)Qt[se]=2;for(se=103595;se<=103694;se++)Qt[se]=0;for(se=103696;se<=103699;se++)Qt[se]=0;for(se=103700;se<=103793;se++)Qt[se]=2;for(se=103794;se<=103890;se++)Qt[se]=0;for(se=103891;se<=103896;se++)Qt[se]=2;for(se=103900;se<=103971;se++)Qt[se]=2;for(se=103972;se<=103977;se++)Qt[se]=0;for(se=112e3;se<=112101;se++)Qt[se]=0;const yEt=[102100,102113,3857,3785],Tqi=[104905,104971],Cqi=[4326,...yEt,...Tqi],mrt='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',Rce=[-20037508342788905e-9,20037508342788905e-9],Dce=[-20037508342787e-6,20037508342787e-6],vEt={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Rce,origin:Dce,dx:1e-5},102100:{wkTemplate:mrt,valid:Rce,origin:Dce,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:Rce,origin:Dce,dx:1e-5},3857:{wkTemplate:mrt,valid:Rce,origin:Dce,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Ya(i,e){if(i===e)return!0;if(i==null||e==null)return!1;const t=i.wkid,r=e.wkid;if(t!=null||r!=null){if(t===r||Nb(i)&&Nb(e))return!0;const o=i.latestWkid;if(o!=null&&r===o)return!0;const a=e.latestWkid;return a!=null&&t===a}let n,s;return i.wkt2&&e.wkt2?(n=i.wkt2,s=e.wkt2):i.wkt&&e.wkt&&(n=i.wkt,s=e.wkt),!(!n||!s)&&n.toUpperCase()===s.toUpperCase()}function Zp(i){const e=i?.wkid;return e!=null&&e>=2e3&&vEt[e]||null}function Hv(i){if(!i)return;const{wkid:e,vcsWkid:t}=i;if(e)return t?JSON.stringify({wkid:e,vcsWkid:t}):String(e);const r=i.wkt||i.wkt2;return JSON.stringify(r?t?{wkt:r,vcsWkid:t}:{wkt:r}:{})}function iae(i){if(!Cm(i))return!1;const{wkid:e}=i;if(e)return Qt[e]==null;const t=i.wkt2||i.wkt;return!!t&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(t)}function Eqi(i){return!(dze(i)||pze(i))}function fE(i){return i?.wkid===4326}function Iqi(i){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(i)}function Aqi(i){return i?.wkid===Y9.CGCS2000}function Nb(i){const e=i?.wkid;return e!=null&&e>=2e3&&yEt.includes(e)}function c5e(i){return i?.wkid===32662}function eW(i){return i===Y9.GCSMARS2000||i===Y9.GCSMARS2000_SPHERE}function dze(i){return eW(i?.wkid)}function tW(i){return i===Y9.GCSMOON2000}function pze(i){return tW(i?.wkid)}function _Et(i){const e=i?.wkid;return e!=null&&e>=2e3&&Cqi.includes(e)}function Cm(i){if(i==null)return!1;const e=i.wkid;return e!=null&&e>=2e3||i.wkt2!=null||i.wkt!=null}const Yp={wkid:4326,wkt:m0(vEt[4326].wkTemplate,{Central_Meridian:"0.0"})},Nve={wkid:102100,latestWkid:3857},Mqi={wkid:32662};function fze(i){return{wkt:`GEOCCS["Spherical geocentric", DATUM["Not specified", SPHEROID["Sphere",${i.radius},0]], PRIMEM["Greenwich",0.0, @@ -42,16 +42,16 @@ import{d as da,u as uTt,r as sY,a as oY,o as pr,c as wr,w as Sm,n as Jl,b as xc, AXIS["Geocentric Y",OTHER], AXIS["Geocentric Z",NORTH], AUTHORITY["EPSG","4978"] -]`},Dqi=a2e.wkt.toUpperCase(),Fqi=l2e.wkt.toUpperCase();function wEt(i){if(i!=null&&Cm(i)){const e=i.wkid,t=i.wkt2??i.wkt;if(eW(e))return GA;const r=t?.toUpperCase();if(t&&r===Dqi)return GA;if(tW(e)||r&&r===Fqi)return VF}return Td}function kqi(i){return eW(i)?GA:tW(i)?VF:Td}function $ve(i){return Ya(i,bEt)}function HF(i){return $ve(i)||Ya(i,a2e)||Ya(i,l2e)}const mze=39.37,Lqi=Td.radius*Math.PI/200,xEt=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,H8=Qt,SEt=/UNIT\[([^\]]+)]/i,Nqi=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),$qi=pa()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),BE=i=>i*i,fD=i=>i*i*i,Tne={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:BE(.001)},"square-centimeters":{inBaseUnits:BE(.01)},"square-decimeters":{inBaseUnits:BE(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:BE(1e3)},"square-inches":{inBaseUnits:BE(.0254)},"square-feet":{inBaseUnits:BE(.3048)},"square-yards":{inBaseUnits:BE(.9144)},"square-miles":{inBaseUnits:BE(1609.344)},"square-us-feet":{inBaseUnits:BE(1200/3937)},acres:{inBaseUnits:.0015625*BE(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*fD(.001)},"cubic-centimeters":{inBaseUnits:1e3*fD(.01)},"cubic-decimeters":{inBaseUnits:1e3*fD(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*fD(1e3)},"cubic-inches":{inBaseUnits:1e3*fD(.0254)},"cubic-feet":{inBaseUnits:1e3*fD(.3048)},"cubic-yards":{inBaseUnits:1e3*fD(.9144)},"cubic-miles":{inBaseUnits:1e3*fD(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},Bqi=(()=>{const i={};for(const e in Tne)for(const t in Tne[e].units)i[t]=e;return i})();function jqi(i,e,t){return i*Tne[t].units[e].inBaseUnits}function Gqi(i,e,t){return i/Tne[t].units[e].inBaseUnits}function iW(i){const e=Bqi[i];if(!e)throw new Error("unknown type");return e}function grt(i,e=null){return e=e||iW(i),Tne[e].baseUnit===i}function tb(i,e,t){if(e===t)return i;const r=iW(e);if(r!==iW(t))throw new Error("incompatible units");const n=grt(e,r)?i:jqi(i,e,r);return grt(t,r)?n:Gqi(n,t,r)}function Uqi(i,e,t){return tb(i,e,"meters")/(t*Math.PI/180)}function TEt(i){return $qi.fromJSON(i.toLowerCase())||null}function WF(i){if(i!=null&&!Mqi(i))return 1;const e=pu(i);return e>1e5?1:e}function zqi(i){return pu(i)>=wEt(i).metersPerDegree?"meters":gze(i)}function pu(i,e=Td.metersPerDegree){return Vqi(i,!0)??e}function Vqi(i,e=!1){const t=i?.wkid??null,r=i?.wkt2??i?.wkt??null;let n=null;if(t){if(eW(t))return GA.metersPerDegree;if(tW(t))return VF.metersPerDegree;n=H8.values[H8[t]],!n&&e&&Nqi.has(t)&&(n=Lqi)}else r&&(IEt(r)?n=yrt(xEt.exec(r),n):EEt(r)&&(n=yrt(SEt.exec(r),n)));return n}function Bve(i){return iae(i)?1:pu(i)}function yrt(i,e){return i?.[1]?CEt(i[1]):e}function CEt(i){return parseFloat(i.split(",")[1])}function gze(i){const e=i?.wkid??null,t=i?.wkt2??i?.wkt??null;let r=null;if(e)r=H8.units[H8[e]];else if(t){const n=IEt(t)?xEt:EEt(t)?SEt:null;if(n){const s=n.exec(t);s?.[1]&&(r=Wqi(s[1]))}}return r!=null?TEt(r):null}function EEt(i){return/^GEOCCS/i.test(i)}function IEt(i){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(i)}const Hqi=1e-7;function Wqi(i){let t=/[\\"']{1}([^\\"']+)/.exec(i)?.[1];if(!t||!H8.units.includes(t)){const r=CEt(i);t=null;const n=H8.values;for(let s=0;s{const a=s.constructor.prototype;r.forEach(l=>{const u=qUe(s,l,n);u.read&&typeof u.read=="object"||(u.read={}),u.read.reader=a[o],t&&(u.read.source=(u.read.source||[]).concat(t))})}}let aI=class extends Ci{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=Xi.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,t){if(e instanceof Xi)return e;if(e!=null){const r=new Xi;return r.read(e,t),r}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,t){this.cache[e]=t}};x([D()],aI.prototype,"type",void 0),x([D({readOnly:!0})],aI.prototype,"cache",null),x([D({readOnly:!0})],aI.prototype,"extent",null),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],aI.prototype,"hasM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],aI.prototype,"hasZ",void 0),x([D({type:Xi,json:{write:!0},value:Xi.WGS84})],aI.prototype,"spatialReference",void 0),x([Mi("spatialReference")],aI.prototype,"readSpatialReference",null),aI=x([Qe("esri.geometry.Geometry")],aI);const Nr=aI,Jqi=Object.prototype.toString;function Kqi(i){const e="__accessorMetadata__"in i?Sd(i):i;return function(...t){if(t.push(e),typeof t[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return Zqi.apply(this,t)}}function Zqi(i,e,t,r){Koe(i,e).cast=r}function Qqi(i){return(e,t)=>{Koe(e,i).cast=e[t]}}function So(...i){if(i.length!==3||typeof i[1]!="string")return i.length===1&&Jqi.call(i[0])==="[object Function]"?Kqi(i[0]):i.length===1&&typeof i[0]=="string"?Qqi(i[0]):void 0}function eYi(i,e){const t=i.x-e.x,r=i.y-e.y,n=i.hasZ&&e.hasZ?i.z-e.z:0;return Math.sqrt(t*t+r*r+n*n)}const tYi=57.29577951308232,iYi=.017453292519943;function vrt(i){return i*tYi}function _rt(i){return i*iYi}function rYi(i){return Math.PI/2-2*Math.atan(Math.exp(-i/Td.radius))}function h5e(i){return i.wkid!=null||i.wkt!=null}const QAe=[0,0];function Gve(i,e,t,r,n){const s=i,o=n;if(o.spatialReference=t,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,QAe,r);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,QAe,r),[o.xmax,o.ymax]=e(s.xmax,s.ymax,QAe,r);else if("paths"in s&&"paths"in o||"rings"in s&&"rings"in o){const a="paths"in s?s.paths:s.rings,l=[];let u;for(let c=0;c2&&u[p].push(h[p][2]),h[p].length>3&&u[p].push(h[p][3])}"paths"in o?o.paths=l:o.rings=l}else if("points"in s&&"points"in o){const a=s.points,l=[];for(let u=0;u2&&l[u].push(a[u][2]),a[u].length>3&&l[u].push(a[u][3]);o.points=l}return n}function RV(i,e){const t=i&&(h5e(i)?i:i.spatialReference),r=e&&(h5e(e)?e:e.spatialReference);return!(i&&"type"in i&&i.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!t||!r)&&(!!Ya(r,t)||Nb(r)&&fE(t)||Nb(t)&&fE(r))}function HB(i,e){if(i==null)return null;const t=i.spatialReference,r=e&&(h5e(e)?e:e.spatialReference);return RV(t,r)?Ya(t,r)?li(i):Nb(r)?Gve(i,Z5,Xi.WebMercator,!1,li(i)):fE(r)?Gve(i,DV,Xi.WGS84,!1,li(i)):null:null}function Z5(i,e,t=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const r=_rt(e);return t[0]=_rt(i)*Td.radius,t[1]=Td.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),t}function DV(i,e,t=[0,0],r=!1){const n=vrt(i/Td.radius);return t[0]=r?n:n-360*Math.floor((n+180)/360),t[1]=vrt(Math.PI/2-2*Math.atan(Math.exp(-e/Td.radius))),t}function WC(i,e=!1,t=li(i)){return Gve(i,Z5,Xi.WebMercator,e,t)}function r8(i,e=!1,t=li(i)){return Gve(i,DV,Xi.WGS84,e,t)}var qfe;const xJ=[0,0];function brt(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}let a1=qfe=class extends Nr{static copy(i,e){e._set("x",i._get("x")),e._set("y",i._get("y")),e._set("z",i._get("z")),e._set("m",i._get("m"));const t=i._get("spatialReference");e._set("spatialReference",Object.isFrozen(t)?t:t.clone())}constructor(...i){super(...i),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(i,e,t,r,n){let s;if(Array.isArray(i))s=i,n=e,i=s[0],e=s[1],t=s[2],r=s[3];else if(i&&typeof i=="object"){if(s=i,i=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,t=s.z,r=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new Xi(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)di.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)di.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const a=Z5(s.longitude,s.latitude,xJ);i=a[0],e=a[1]}}}else brt(t)?(n=t,t=null):brt(r)&&(n=r,r=null);const o={x:i,y:e};return o.x==null&&o.y!=null?di.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&di.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),t!=null&&(o.z=t),r!=null&&(o.m=r),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(i){i!==(this._get("m")!==void 0)&&(this._set("m",i?0:void 0),this._set("hasM",i))}get hasZ(){return this.z!==void 0}set hasZ(i){i!==(this._get("z")!==void 0)&&(this._set("z",i?0:void 0),this._set("hasZ",i))}get latitude(){const{spatialReference:i,x:e,y:t}=this;if(i){if(i.isWebMercator)return DV(e,t,xJ)[1];if(i.isGeographic)return t}return null}set latitude(i){const{spatialReference:e,x:t}=this;i!=null&&e&&(e.isWebMercator?this._set("y",Z5(t,i,xJ)[1]):e.isGeographic&&this._set("y",i),this._set("latitude",i))}get longitude(){const{x:i,y:e,spatialReference:t}=this;if(t){if(t.isWebMercator)return DV(i,e,xJ)[0];if(t.isGeographic)return i}return null}set longitude(i){const{y:e,spatialReference:t}=this;i!=null&&t&&(t.isWebMercator?this._set("x",Z5(i,e,xJ)[0]):t.isGeographic&&this._set("x",i),this._set("longitude",i))}writeX(i,e,t){e[t]=isNaN(i)?"NaN":i}readX(i){return typeof i=="string"?NaN:i}clone(){const i=new qfe;return i.x=this.x,i.y=this.y,i.z=this.z,i.m=this.m,i.spatialReference=this.spatialReference,i}copy(i){return qfe.copy(i,this),this}equals(i){if(i==null)return!1;const{x:e,y:t,z:r,m:n,spatialReference:s}=this,{z:o,m:a}=i;let{x:l,y:u,spatialReference:c}=i;if(!s.equals(c))if(s.isWebMercator&&c.isWGS84)[l,u]=Z5(l,u),c=s;else{if(!s.isWGS84||!c.isWebMercator)return!1;[l,u]=DV(l,u),c=s}return e===l&&t===u&&r===o&&n===a&&s.wkid===c.wkid}offset(i,e,t){return this.x+=i,this.y+=e,t!=null&&(this.z=(this.z??0)+t),this}normalize(){if(!this.spatialReference)return this;const i=Zp(this.spatialReference);if(!i)return this;let e=this.x;const[t,r]=i.valid,n=2*r;let s;return e>r?(s=Math.ceil(Math.abs(e-r)/n),e-=s*n):eisNaN(i)?i:Gd(i))],a1.prototype,"x",void 0),x([ur("x")],a1.prototype,"writeX",null),x([Mi("x")],a1.prototype,"readX",null),x([D({type:Number,json:{write:!0}})],a1.prototype,"y",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],a1.prototype,"z",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],a1.prototype,"m",void 0),a1=qfe=x([Qe("esri.geometry.Point")],a1),a1.prototype.toJSON.isDefaultToJSON=!0;const $i=a1,e3e=[0,0];function rae(i,e){return e!=null&&M1(i,e.x,e.y,e.z)}function nYi(i,e){if(!e.points||e.points.length)return!1;for(const t of e.points)if(!rW(i,t))return!1;return!0}function sYi(i,e){const{xmin:t,ymin:r,zmin:n,xmax:s,ymax:o,zmax:a}=e;return i.hasZ&&e.hasZ?M1(i,t,r,n)&&M1(i,t,o,n)&&M1(i,s,o,n)&&M1(i,s,r,n)&&M1(i,t,r,a)&&M1(i,t,o,a)&&M1(i,s,o,a)&&M1(i,s,r,a):M1(i,t,r)&&M1(i,t,o)&&M1(i,s,o)&&M1(i,s,r)}function rW(i,e){return M1(i,e[0],e[1])}function oYi(i,e){return M1(i,e[0],e[1],e[2])}function M1(i,e,t,r){return e>=i.xmin&&e<=i.xmax&&t>=i.ymin&&t<=i.ymax&&(r==null||!i.hasZ||r>=i.zmin&&r<=i.zmax)}function AEt(i,e){return e3e[1]=e.y,e3e[0]=e.x,aYi(i,e3e)}function aYi(i,e){return yze(i.rings,e)}function yze(i,e){if(!i)return!1;if(lYi(i))return wrt(!1,i,e);let t=!1;for(let r=0,n=i.length;r=n||p=n)&&u+(n-c)/(p-c)*(h-u)=0&&k<=1&&B>=0&&B<=1&&(n&&(n[0]=s+k*(a-s),n[1]=o+k*(l-o)),!0)}function REt(i){switch(i){case"esriGeometryEnvelope":case"extent":return MEt;case"esriGeometryMultipoint":case"multipoint":return cYi;case"esriGeometryPoint":case"point":return uYi;case"esriGeometryPolygon":case"polygon":return vze;case"esriGeometryPolyline":case"polyline":return pYi}}var w2;function mYi(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}function mD(i,e,t){return e==null?t:t==null?e:i(e,t)}let Um=w2=class extends Nr{constructor(...i){super(...i),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(i,e,t,r,n){return mYi(i)?{spatialReference:i,xmin:0,ymin:0,xmax:0,ymax:0}:typeof i=="object"?(i.spatialReference=i.spatialReference==null?Xi.WGS84:i.spatialReference,i):{xmin:i,ymin:e,xmax:t,ymax:r,spatialReference:n??Xi.WGS84}}static fromBounds(i,e){return new w2({xmin:i[0],ymin:i[1],xmax:i[2],ymax:i[3],spatialReference:e})}static fromPoint(i){return new w2({xmin:i.x,ymin:i.y,zmin:i.z,xmax:i.x,ymax:i.y,zmax:i.z,spatialReference:i.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const i=new $i({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(i.z=.5*(this.zmin+this.zmax)),this.hasM&&(i.m=.5*(this.mmin+this.mmax)),i}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(i){const e=this.center;return i.z!=null&&this.hasZ?this.offset(i.x-e.x,i.y-e.y,i.z-e.z):this.offset(i.x-e.x,i.y-e.y)}clone(){const i=new w2;return i.xmin=this.xmin,i.ymin=this.ymin,i.xmax=this.xmax,i.ymax=this.ymax,i.spatialReference=this.spatialReference,this.zmin!=null&&(i.zmin=this.zmin,i.zmax=this.zmax),this.mmin!=null&&(i.mmin=this.mmin,i.mmax=this.mmax),i}contains(i){if(!i)return!1;const e=this.spatialReference,t=i.spatialReference;return e&&t&&!e.equals(t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),i.type==="point"?rae(this,i):i.type==="extent"&&sYi(this,i)}equals(i){if(this===i)return!0;if(i==null)return!1;const e=this.spatialReference,t=i.spatialReference;return e&&t&&!e.equals(t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),this.xmin===i.xmin&&this.ymin===i.ymin&&this.zmin===i.zmin&&this.mmin===i.mmin&&this.xmax===i.xmax&&this.ymax===i.ymax&&this.zmax===i.zmax&&this.mmax===i.mmax}expand(i){const e=.5*(1-i),t=this.width*e,r=this.height*e;if(this.xmin+=t,this.ymin+=r,this.xmax-=t,this.ymax-=r,this.hasZ){const n=(this.zmax-this.zmin)*e;this.zmin+=n,this.zmax-=n}if(this.hasM){const n=(this.mmax-this.mmin)*e;this.mmin+=n,this.mmax-=n}return this}intersects(i){if(i==null)return!1;i.type==="mesh"&&(i=i.extent);const e=this.spatialReference,t=i.spatialReference;return e&&t&&!Ya(e,t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),REt(i.type)(this,i)}normalize(){const i=this._normalize(!1,!0);return Array.isArray(i)?i:[i]}offset(i,e,t){return this.xmin+=i,this.ymin+=e,this.xmax+=i,this.ymax+=e,t!=null&&(this.zmin+=t,this.zmax+=t),this}shiftCentralMeridian(){return this._normalize(!0)}union(i){return this===i||(this.xmin=Math.min(this.xmin,i.xmin),this.ymin=Math.min(this.ymin,i.ymin),this.xmax=Math.max(this.xmax,i.xmax),this.ymax=Math.max(this.ymax,i.ymax),(this.hasZ||i.hasZ)&&(this.zmin=mD(Math.min,this.zmin,i.zmin),this.zmax=mD(Math.max,this.zmax,i.zmax)),(this.hasM||i.hasM)&&(this.mmin=mD(Math.min,this.mmin,i.mmin),this.mmax=mD(Math.max,this.mmax,i.mmax))),this}intersection(i){return this===i?this:i!=null&&this.intersects(i)?(this.xmin=Math.max(this.xmin,i.xmin),this.ymin=Math.max(this.ymin,i.ymin),this.xmax=Math.min(this.xmax,i.xmax),this.ymax=Math.min(this.ymax,i.ymax),(this.hasZ||i.hasZ)&&(this.zmin=mD(Math.max,this.zmin,i.zmin),this.zmax=mD(Math.min,this.zmax,i.zmax)),(this.hasM||i.hasM)&&(this.mmin=mD(Math.max,this.mmin,i.mmin),this.mmax=mD(Math.min,this.mmax,i.mmax)),this):null}toJSON(i){return this.write({},i)}_shiftCM(i=Zp(this.spatialReference)){if(!i||!this.spatialReference)return this;const e=this.spatialReference,t=this._getCM(i);if(t){const r=e.isWebMercator?r8(t):t;this.xmin-=t.x,this.xmax-=t.x,e.isWebMercator||(r.x=this._normalizeX(r.x,i).x),this.spatialReference=new Xi(m0((e.isWGS84?i.altTemplate:null)??i.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(i){let e=null;const[t,r]=i.valid,n=this.xmin,s=this.xmax;return n>=t&&n<=r&&s>=t&&s<=r||(e=this.center),e}_normalize(i,e,t){const r=this.spatialReference;if(!r)return this;const n=t??Zp(r);if(n==null)return this;const s=this._getParts(n).map(l=>l.extent);if(s.length<2)return s[0]||this;if(s.length>2)return i?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(i)return this._shiftCM(n);if(e)return s;let o=!0,a=!0;return s.forEach(l=>{l.hasZ||(o=!1),l.hasM||(a=!1)}),{rings:s.map(l=>{const u=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const c=(l.zmax-l.zmin)/2;for(let h=0;h0;if(a>2*p){const R=new w2(lw||I?e.push({extent:new w2(m,n,p,s,o),frameIds:[v]},{extent:new w2(h,n,w,s,o),frameIds:[S]}):e.push({extent:new w2(m,n,w,s,o),frameIds:[v]});this.cache._parts=e}const t=this.hasZ,r=this.hasM;if(t||r){const n={};t&&(n.zmin=this.zmin,n.zmax=this.zmax),r&&(n.mmin=this.mmin,n.mmax=this.mmax);for(let s=0;sr?(s=Math.ceil(Math.abs(i-r)/n),i-=s*n,o=s):ivie.splice(vie.indexOf(i),1))}const d5e=[];function bze(i){return d5e.push(i),wa(()=>vie.splice(d5e.indexOf(i),1))}function yYi(){const i=DEt();yie!==i&&(yie=i,[...d5e].forEach(e=>{e.call(null,i)}),[...vie].forEach(e=>{e.call(null,i)}))}globalThis.addEventListener?.("languagechange",yYi);let Fce;function vYi(i){return Fce&&!Fce.destroyed||(Fce=i()),Fce}var p5e;const _Yi=new Rs({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let x2=p5e=class extends un{constructor(i){super(i),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(i){i!=="asc"&&i!=="desc"||this._set("sortOrder",i)}clone(){return new p5e({categories:this.categories?li(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(i,e){let t=[];this.categories&&(t=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o));let r="";if(this.extent){const o=HB(this.extent,Xi.WGS84);o!=null&&(r=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&i.extraQuery&&(n="("+n+")"+i.extraQuery);const s={categories:t,bbox:r,q:n,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(o=>_Yi.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};x([D()],x2.prototype,"categories",void 0),x([D()],x2.prototype,"disableExtraQuery",void 0),x([D({type:hr})],x2.prototype,"extent",void 0),x([D()],x2.prototype,"filter",void 0),x([D()],x2.prototype,"num",void 0),x([D()],x2.prototype,"query",void 0),x([D()],x2.prototype,"sortField",void 0),x([D()],x2.prototype,"sortOrder",null),x([D()],x2.prototype,"start",void 0),x2=p5e=x([Qe("esri.portal.PortalQueryParams")],x2);const hA=x2;var f5e;let zf=f5e=class extends Ci{constructor(i){super(i),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const i=this.url,e=this.thumbnail;return i&&e&&this.portal?this.portal?.normalizeUrl(`${i}/info/${e}?f=json`):null}get url(){const i=this.portal?.restUrl;return i?i+"/community/groups/"+this.id:null}fetchCategorySchema(i){return this.portal.request(this.url+"/categorySchema",i).then(e=>{const t=e.categorySchema||[];return t.some(r=>r.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",i):t})}fetchMembers(i){return this.portal.request(this.url+"/users",i)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}toJSON(){throw new qe("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const e=new f5e;return e.sourceJSON=i,e.read(i),e}queryItems(i,e){let t=Sd(hA,i);const r=this.portal;return parseFloat(r.currentVersion)>5?(t=t||new hA,r.queryPortal(`/content/groups/${this.id}/search`,t,"PortalItem",e)):(t=t?t.clone():new hA,t.query="group:"+this.id+(t.query?" "+t.query:""),r.queryItems(t,e))}_fetchCategorySchemaSet(i,e){const t=this.portal;return t.fetchSelf(t.authMode,!0,e).then(r=>{const n=r.contentCategorySetsGroupQuery;if(n){const s=new hA;return s.disableExtraQuery=!0,s.num=1,s.query=n,t.queryGroups(s,e)}throw new qe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const n=r.results[0],s=new hA;return s.num=1,s.query=`typekeywords:"${i}"`,n.queryItems(s,e)}throw new qe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(r=>r.total?r.results[0].fetchData("json",e).then(n=>{const s=n?.categorySchema;return s?.length?s:[]}):[])}};x([D()],zf.prototype,"access",void 0),x([D({type:Date})],zf.prototype,"created",void 0),x([D()],zf.prototype,"description",void 0),x([D()],zf.prototype,"id",void 0),x([D()],zf.prototype,"isInvitationOnly",void 0),x([D({type:Date})],zf.prototype,"modified",void 0),x([D()],zf.prototype,"owner",void 0),x([D()],zf.prototype,"portal",void 0),x([D()],zf.prototype,"snippet",void 0),x([D()],zf.prototype,"sortField",void 0),x([D()],zf.prototype,"sortOrder",void 0),x([D()],zf.prototype,"sourceJSON",void 0),x([D()],zf.prototype,"tags",void 0),x([D()],zf.prototype,"thumbnail",void 0),x([D({readOnly:!0})],zf.prototype,"thumbnailUrl",null),x([D()],zf.prototype,"title",void 0),x([D({readOnly:!0})],zf.prototype,"url",null),zf=f5e=x([Qe("esri.portal.PortalGroup")],zf);const m5e=zf;let xN=class extends un{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};x([D()],xN.prototype,"nextQueryParams",void 0),x([D()],xN.prototype,"queryParams",void 0),x([D()],xN.prototype,"results",void 0),x([D()],xN.prototype,"total",void 0),xN=x([Qe("esri.portal.PortalQueryResult")],xN);const bYi=xN;let $M=class extends Ci{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new qe("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};x([D({type:Date})],$M.prototype,"created",void 0),x([D()],$M.prototype,"id",void 0),x([D()],$M.prototype,"portal",void 0),x([D()],$M.prototype,"title",void 0),x([D({readOnly:!0})],$M.prototype,"url",null),x([D()],$M.prototype,"username",void 0),$M=x([Qe("esri.portal.PortalFolder")],$M);const wYi=$M;var g5e;let $h=g5e=class extends Ci{constructor(...i){super(...i),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const i=this.url,e=this.thumbnail;return i&&e?this.portal.normalizeUrl(`${i}/info/${e}?f=json`):null}get userContentUrl(){const i=this.portal?.restUrl;return i?`${i}/content/users/${this.username}`:null}get url(){const i=this.portal?.restUrl;return i?`${i}/community/users/${this.username}`:null}addItem(i){const e=i&&i.item,t=i?.data,r=i?.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),t!=null&&(typeof t=="string"?n.query.text=t:typeof t=="object"&&(n.query.text=JSON.stringify(t))));let s=this.userContentUrl;return r&&(s+="/"+(typeof r=="string"?r:r.id)),this.portal.request(s+"/addItem",n).then(o=>(e.id=o.id,e.portal=this.portal,e.loaded?e.reload():e.load()))}deleteItem(i){let e=this.userContentUrl;return i.ownerFolder&&(e+="/"+i.ownerFolder),this.portal.request(e+`/items/${i.id}/delete`,{method:"post"}).then(()=>{i.id=null,i.portal=null})}deleteItems(i){const e=this.userContentUrl+"/deleteItems",t=i.map(r=>r.id);if(t.length){const r={method:"post",query:{items:t.join(",")}};return this.portal.request(e,r).then(()=>{i.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const i={query:{num:1}};return this.portal.request(this.userContentUrl??"",i).then(e=>{let t;return t=e&&e.folders?e.folders.map(r=>{const n=wYi.fromJSON(r);return n.portal=this.portal,n}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(i=>{let e;return e=i&&i.groups?i.groups.map(t=>{const r=m5e.fromJSON(t);return r.portal=this.portal,r}):[],e})}fetchItems(i){const e=i??{};let t,r=this.userContentUrl??"";return e.folder&&(r+="/"+e.folder.id),Promise.resolve().then(()=>NEt).then(({default:n})=>{t=n;const s={folders:!1,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"};return this.portal.request(r,{query:s})}).then(n=>{let s;return n?.items?(s=n.items.map(o=>{const a=t.fromJSON(o);return a.portal=this.portal,a}),Promise.all(s.map(o=>o.load())).catch(o=>o).then(()=>({items:s,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(i=>i.tags)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}queryFavorites(i){return this.favGroupId?(this._favGroup||(this._favGroup=new m5e({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(i)):Promise.reject(new qe("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new qe("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const e=new g5e;return e.sourceJSON=i,e.read(i),e}};x([D()],$h.prototype,"access",void 0),x([D({type:Date})],$h.prototype,"created",void 0),x([D()],$h.prototype,"culture",void 0),x([D()],$h.prototype,"description",void 0),x([D()],$h.prototype,"email",void 0),x([D()],$h.prototype,"favGroupId",void 0),x([D()],$h.prototype,"fullName",void 0),x([D({type:Date})],$h.prototype,"modified",void 0),x([D()],$h.prototype,"orgId",void 0),x([D()],$h.prototype,"portal",void 0),x([D()],$h.prototype,"preferredView",void 0),x([D()],$h.prototype,"privileges",void 0),x([D()],$h.prototype,"region",void 0),x([D()],$h.prototype,"role",void 0),x([D()],$h.prototype,"roleId",void 0),x([D()],$h.prototype,"sourceJSON",void 0),x([D()],$h.prototype,"thumbnail",void 0),x([D({readOnly:!0})],$h.prototype,"thumbnailUrl",null),x([D()],$h.prototype,"units",void 0),x([D({readOnly:!0})],$h.prototype,"userContentUrl",null),x([D({readOnly:!0})],$h.prototype,"url",null),x([D()],$h.prototype,"username",void 0),x([D()],$h.prototype,"userType",void 0),$h=g5e=x([Qe("esri.portal.PortalUser")],$h);const wze=$h;var fw;let kce;const xrt={PortalGroup:()=>Promise.resolve({default:m5e}),PortalItem:()=>Promise.resolve().then(()=>NEt),PortalUser:()=>Promise.resolve({default:wze})};let On=fw=class extends S0(ef){constructor(i){super(i),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ho.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(i){return typeof i=="string"?{url:i}:i}destroy(){Srt.unregister(this),this.defaultBasemap=zo(this.defaultBasemap),this.defaultDevBasemap=zo(this.defaultDevBasemap),this.defaultVectorBasemap=zo(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=Hc(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(i){if(i)for(const e of i)Ho.request.trustedServers.includes(e)||Ho.request.trustedServers.push(e);return i}readDefaultBasemap(i){return this._readBasemap(i)}readDefaultDevBasemap(i){return this._readBasemap(i)}readDefaultVectorBasemap(i){return this._readBasemap(i)}get extraQuery(){const i=this.user?.orgId,e=!i||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let i=this.url;if(i){const e=i.indexOf("/sharing");i=e>0?i.substring(0,e):this.url.replace(/\/+$/,""),i+="/sharing/rest"}return i}get thumbnailUrl(){const i=this.restUrl,e=this.thumbnail;return i&&e?this._normalizeSSL(i+"/portals/self/resources/"+e):null}readUrlKey(i){return i&&i.toLowerCase()}readUser(i){let e=null;return i&&(e=wze.fromJSON(i),e.portal=this),e}load(i){const e=Promise.resolve().then(()=>JYi).then(({default:t})=>{hn(i),kce=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,i)).then(t=>{if(no){const r=no;this.credential=r.findCredential(this.restUrl),this.credential||this.authMode!==fw.AUTH_MODE_AUTO&&this.authMode!==fw.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=r.on("credential-create",xYi(new WeakRef(this))),Srt.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=t,this.read(t)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const i=this._getHelperService("defaultElevationLayers"),e=(await Promise.resolve().then(()=>a8t)).default;return i?i.map(t=>new e({id:t.id,url:t.url})):[]}async fetchBasemaps(i,e){const t=await this._fetchBasemaps(i,e);if(e?.include3d===!0&&this.use3dBasemaps!==!1){const r=await this._fetchBasemaps3D(i,e);t.unshift(...r)}return t}fetchCategorySchema(i){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",i).then(e=>e.categorySchema):xg(i)?Promise.reject(Oc()):Promise.resolve([])}fetchFeaturedGroups(i){const e=this.featuredGroups,t=new hA;if(t.num=100,t.sortField="title",e&&e.length){const r=[];for(const n of e)r.push(`(title:"${n.title}" AND owner:${n.owner})`);return t.query=r.join(" OR "),this.queryGroups(t,i).then(n=>n.results)}return xg(i)?Promise.reject(Oc()):Promise.resolve([])}fetchRegions(i){const e=this.user?.culture||this.culture||Am();return this.request(this.restUrl+"/portals/regions",{...i,query:{culture:e}})}fetchSettings(i){const e=this.user?.culture||this.culture||Am();return this.request(this.restUrl+"/portals/self/settings",{...i,query:{culture:e}})}static getDefault(){return vYi(()=>new fw)}queryGroups(i,e){return this.queryPortal("/community/groups",i,"PortalGroup",e)}queryItems(i,e){return this.queryPortal("/search",i,"PortalItem",e)}queryUsers(i,e){return i.sortField||(i.sortField="username"),this.queryPortal("/community/users",i,"PortalUser",e)}fetchSelf(i=this.authMode,e=!1,t){const r=this.restUrl+"/portals/self",n={authMode:i,query:{culture:Am().toLowerCase()},withCredentials:!0,...t};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(r,n)}queryPortal(i,e,t,r){const n=Sd(hA,e),s=o=>this.request(this.restUrl+i,{...n.toRequestOptions(this),...r}).then(a=>{const l=n.clone();return l.start=a.nextStart,new bYi({nextQueryParams:l,queryParams:n,total:a.total,results:fw._resultsToTypedArray(o,{portal:this},a,r)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(_a(l),a)));return t&&xrt[t]?xrt[t]().then(({default:o})=>(hn(r),s(o))):s()}signIn(){if(this.authMode===fw.AUTH_MODE_ANONYMOUS||this.authMode===fw.AUTH_MODE_NO_PROMPT&&!no)return Promise.reject(new qe("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const i=e=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(e||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(t=>{t&&(this.sourceJSON=t,this.read(t))});return no?no.getCredential(this.restUrl,{prompt:this.authMode!==fw.AUTH_MODE_NO_PROMPT}).then(e=>i(e)):i(this.credential)}normalizeUrl(i){const e=this.credential?.token;return this._normalizeSSL(e?i+(i.includes("?")?"&":"?")+"token="+e:i)}requestToTypedArray(i,e,t){return this.request(i,e).then(r=>{const n=fw._resultsToTypedArray(t,{portal:this},r);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():r)).then(()=>n,()=>n)})}request(i,e={}){const t={f:"json",...e.query},{authMode:r=this.authMode===fw.AUTH_MODE_ANONYMOUS||this.authMode===fw.AUTH_MODE_NO_PROMPT?this.authMode:"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:a="json",signal:l}=e,u={authMode:r,body:n,cacheBust:s,method:o,query:t,responseType:a,timeout:0,signal:l};return e.withCredentials&&(u.withCredentials=!0),zi(this._normalizeSSL(i),u).then(c=>c.data)}toJSON(){throw new qe("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");return new fw({sourceJSON:i})}_getHelperService(i){const e=this.helperServices&&this.helperServices[i];if(!e)throw new qe("portal:service-not-found",`The \`helperServices\` do not include an entry named "${i}"`);return e}async _fetchBasemaps(i,e){const t=new hA;t.query=i||(Ho.apiKey&&oze(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),t.disableExtraQuery=!0;const r=await this.queryGroups(t,e);if(!r.total)return[];const n=r.results[0];t.num=100,t.query='type:"Web Map" -type:"Web Application"',t.sortField=n.sortField||"name",t.sortOrder=n.sortOrder||"desc";const s=await n.queryItems(t,e);return s.total?s.results.filter(o=>o.type==="Web Map").map(o=>new kce({portalItem:o})):[]}async _fetchBasemaps3D(i,e){const t=i||this.basemapGalleryGroupQuery3D;if(!t)return[];const r=new hA({query:t,disableExtraQuery:!0}),n=await this.queryGroups(r,e);if(!n.total)return[];const s=n.results[0];r.num=100,r.query='type:"Web Scene"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(r,e);return o.total?o.results.filter(a=>a.type==="Web Scene").map(a=>new kce({portalItem:a})):[]}_normalizeSSL(i){return i.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(i){if(i){const e=kce.fromJSON(i);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(i,e,t,r){let n=[];if(t){const s=r!=null?r.signal:null;n=t.listings||t.notifications||t.userInvitations||t.tags||t.items||t.groups||t.comments||t.provisions||t.results||t.relatedItems||t,(i||e)&&(n=n.map(o=>{const a=Object.assign(i?i.fromJSON(o):o,e);return typeof a.load=="function"&&a.load(s),a}))}else n=[];return n}};On.AUTH_MODE_ANONYMOUS="anonymous",On.AUTH_MODE_AUTO="auto",On.AUTH_MODE_IMMEDIATE="immediate",On.AUTH_MODE_NO_PROMPT="no-prompt",x([D()],On.prototype,"access",void 0),x([D()],On.prototype,"allSSL",void 0),x([D()],On.prototype,"authMode",void 0),x([D()],On.prototype,"authorizedCrossOriginDomains",void 0),x([Mi("authorizedCrossOriginDomains")],On.prototype,"readAuthorizedCrossOriginDomains",null),x([D()],On.prototype,"basemapGalleryGroupQuery",void 0),x([D({json:{name:"3DBasemapGalleryGroupQuery"}})],On.prototype,"basemapGalleryGroupQuery3D",void 0),x([D()],On.prototype,"bingKey",void 0),x([D()],On.prototype,"canListApps",void 0),x([D()],On.prototype,"canListData",void 0),x([D()],On.prototype,"canListPreProvisionedItems",void 0),x([D()],On.prototype,"canProvisionDirectPurchase",void 0),x([D()],On.prototype,"canSearchPublic",void 0),x([D()],On.prototype,"canShareBingPublic",void 0),x([D()],On.prototype,"canSharePublic",void 0),x([D()],On.prototype,"canSignInArcGIS",void 0),x([D()],On.prototype,"canSignInIDP",void 0),x([D()],On.prototype,"colorSetsGroupQuery",void 0),x([D()],On.prototype,"commentsEnabled",void 0),x([D({type:Date})],On.prototype,"created",void 0),x([D()],On.prototype,"credential",void 0),x([D()],On.prototype,"culture",void 0),x([D()],On.prototype,"currentVersion",void 0),x([D()],On.prototype,"customBaseUrl",void 0),x([D()],On.prototype,"defaultBasemap",void 0),x([Mi("defaultBasemap")],On.prototype,"readDefaultBasemap",null),x([D()],On.prototype,"defaultDevBasemap",void 0),x([Mi("defaultDevBasemap")],On.prototype,"readDefaultDevBasemap",null),x([D({type:hr})],On.prototype,"defaultExtent",void 0),x([D()],On.prototype,"defaultVectorBasemap",void 0),x([Mi("defaultVectorBasemap")],On.prototype,"readDefaultVectorBasemap",null),x([D()],On.prototype,"description",void 0),x([D()],On.prototype,"devBasemapGalleryGroupQuery",void 0),x([D()],On.prototype,"eueiEnabled",void 0),x([D({readOnly:!0})],On.prototype,"extraQuery",null),x([D()],On.prototype,"featuredGroups",void 0),x([D()],On.prototype,"featuredItemsGroupQuery",void 0),x([D()],On.prototype,"galleryTemplatesGroupQuery",void 0),x([D()],On.prototype,"layoutGroupQuery",void 0),x([D()],On.prototype,"livingAtlasGroupQuery",void 0),x([D()],On.prototype,"hasCategorySchema",void 0),x([D()],On.prototype,"helpBase",void 0),x([D()],On.prototype,"helperServices",void 0),x([D()],On.prototype,"helpMap",void 0),x([D()],On.prototype,"homePageFeaturedContent",void 0),x([D()],On.prototype,"homePageFeaturedContentCount",void 0),x([D()],On.prototype,"httpPort",void 0),x([D()],On.prototype,"httpsPort",void 0),x([D()],On.prototype,"id",void 0),x([D()],On.prototype,"ipCntryCode",void 0),x([D({readOnly:!0})],On.prototype,"isOrganization",null),x([D()],On.prototype,"isPortal",void 0),x([D()],On.prototype,"isReadOnly",void 0),x([D({readOnly:!0})],On.prototype,"itemPageUrl",null),x([D()],On.prototype,"layerTemplatesGroupQuery",void 0),x([D()],On.prototype,"maxTokenExpirationMinutes",void 0),x([D({type:Date})],On.prototype,"modified",void 0),x([D()],On.prototype,"name",void 0),x([D()],On.prototype,"portalHostname",void 0),x([D()],On.prototype,"portalMode",void 0),x([D()],On.prototype,"portalProperties",void 0),x([D()],On.prototype,"region",void 0),x([D({readOnly:!0})],On.prototype,"restUrl",null),x([D()],On.prototype,"rotatorPanels",void 0),x([D()],On.prototype,"showHomePageDescription",void 0),x([D()],On.prototype,"sourceJSON",void 0),x([D()],On.prototype,"staticImagesUrl",void 0),x([D({json:{name:"2DStylesGroupQuery"}})],On.prototype,"stylesGroupQuery2d",void 0),x([D({json:{name:"stylesGroupQuery"}})],On.prototype,"stylesGroupQuery3d",void 0),x([D()],On.prototype,"supportsHostedServices",void 0),x([D()],On.prototype,"symbolSetsGroupQuery",void 0),x([D()],On.prototype,"templatesGroupQuery",void 0),x([D()],On.prototype,"thumbnail",void 0),x([D({readOnly:!0})],On.prototype,"thumbnailUrl",null),x([D()],On.prototype,"units",void 0),x([D()],On.prototype,"url",void 0),x([D()],On.prototype,"urlKey",void 0),x([Mi("urlKey")],On.prototype,"readUrlKey",null),x([D()],On.prototype,"user",void 0),x([Mi("user")],On.prototype,"readUser",null),x([D()],On.prototype,"use3dBasemaps",void 0),x([D()],On.prototype,"useStandardizedQuery",void 0),x([D()],On.prototype,"useVectorBasemaps",void 0),x([D()],On.prototype,"vectorBasemapGalleryGroupQuery",void 0),On=fw=x([Qe("esri.portal.Portal")],On);const Bu=On,Srt=new FinalizationRegistry(i=>{i.remove()});function xYi(i){const e=no;return()=>{const t=i.deref();t&&e.findCredential(t.restUrl)&&t.signIn().catch(()=>{})}}let BM=class extends un{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){e!=null&&u0(e)?di.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new qe("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await Promise.resolve().then(()=>Qz);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}_normalizePath(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&u0(e)&&(e=s2e(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};x([D()],BM.prototype,"portalItem",void 0),x([D({type:String,value:null})],BM.prototype,"path",null),x([So("path")],BM.prototype,"_castPath",null),x([D({type:String,readOnly:!0})],BM.prototype,"url",null),x([D({type:String,readOnly:!0})],BM.prototype,"cdnUrl",null),x([D({type:String,readOnly:!0})],BM.prototype,"itemRelativeUrl",null),BM=x([Qe("esri.portal.PortalItemResource")],BM);const SYi=BM;let zZ=class extends un{constructor(e){super(e),this.created=null,this.rating=null}};x([D()],zZ.prototype,"created",void 0),x([D()],zZ.prototype,"rating",void 0),zZ=x([Qe("esri.portal.PortalRating")],zZ);const t3e=zZ;function mE(i,e){const t=e?.url?.path;if(i&&t&&(i=xf(i,t,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const r=s2e(i,e.portalItem.itemUrl);r!=null&&TYi.test(r)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(r).path)}return(i=y5e(i,e?.portal))&&u2e.test(i)?Tze(i):i}function gE(i,e,t=Q9.YES){if((i=i&&u2e.test(i)?LEt(i):i)==null)return i;!u0(i)&&e?.blockedRelativeUrls&&e.blockedRelativeUrls.push(i);let r=xf(i);if(e){const n=e.verifyItemRelativeUrls?.rootPath||e.url?.path;if(n){const s=y5e(n,e.portal),o=y5e(r,e.portal);r=s2e(o,s,s),r!=null&&r!==o&&r!==i&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=Sze(r,e?.portal),u0(r)&&(r=X1(r)),e?.resources&&e?.portalItem&&!u0(r)&&!Vx(r)&&t===Q9.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(r),compress:!1}),r}function mY(i,e,t){return mE(i,t)}function cR(i,e,t,r){const n=gE(i,r);n!==void 0&&(e[t]=n)}const u2e=/\/items\/([^\/]+)\/resources\/(.*)/,TYi=/^\.\/resources\//;function xze(i){return(i?.match(u2e)??null)?.[1]??null}function kEt(i){const e=i?.match(u2e)??null;if(e==null)return null;const t=e[2],r=t.lastIndexOf("/");if(r===-1){const{path:o,extension:a}=urt(t);return{prefix:null,filename:o,extension:a}}const{path:n,extension:s}=urt(t.slice(r+1));return{prefix:t.slice(0,r),filename:n,extension:s}}function Sze(i,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?i5e(i,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):i}function y5e(i,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return i;const t=`${e.urlKey}.${e.customBaseUrl}`,r=ZUe();return _v(r,`${r.scheme}://${t}`)?i5e(i,e.portalHostname,t):i5e(i,t,e.portalHostname)}function Tze(i){if(!i)return i||null;let e=i;return e&&no&&!no.findCredential(e)&&(e=no._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),e=e.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),e=e.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),e}function LEt(i){if(!i)return i||null;let e=i;return e=e.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),e=e.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),e=e.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),e&&no&&!no.findCredential(e)&&(e=no._normalizeAGOLorgDomain(e)),e}var Q9;(function(i){i[i.YES=0]="YES",i[i.NO=1]="NO"})(Q9||(Q9={}));const CYi=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return Q9},ensureMainOnlineDomain:Sze,fromCDNUrl:LEt,fromJSON:mE,itemIdFromResourceUrl:xze,prefixAndFilenameFromResourceUrl:kEt,read:mY,toCDNUrl:Tze,toJSON:gE,write:cR},Symbol.toStringTag,{value:"Module"}));var SN;const EYi=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),IYi=new Set(["KML","GeoJson","CSV"]);let La=SN=class extends S0(ef){static from(i){return Cu(SN,i)}constructor(i){super(i),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const i=this.type,e=this.typeKeywords||[];let t=i;return i==="Feature Service"||i==="Feature Collection"?t=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":i==="Image Service"?t=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":i==="Scene Service"?t="Scene Layer":i==="Video Service"?t="Video Layer":i==="Scene Package"?t="Scene Layer Package":i==="Stream Service"?t="Feature Layer":i==="Geoprocessing Service"?t=e.includes("Web Tool")?"Tool":"Geoprocessing Service":i==="Geoenrichment Service"?t="GeoEnrichment Service":i==="Geocoding Service"?t="Locator":i==="Microsoft Powerpoint"?t="Microsoft PowerPoint":i==="GeoJson"?t="GeoJSON":i==="Globe Service"?t="Globe Layer":i==="Vector Tile Service"?t="Tile Layer":i==="netCDF"?t="NetCDF":i==="Map Service"?t=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":i&&i.toLowerCase().includes("add in")?t=i.replaceAll(/(add in)/gi,"Add-In"):i==="datastore catalog service"?t="Big Data File Share":i==="Compact Tile Package"?t="Tile Package (tpkx)":i==="Raster function template"?t="Raster Function Template":i==="OGCFeatureServer"?t="OGC Feature Layer":i==="web mapping application"&&e.includes("configurableApp")?t="Instant App":i==="Insights Page"?t="Insights Report":i==="Excalibur Imagery Project"?t="Excalibur Project":i==="3DTiles Service"?t="3D tiles layer":i==="3DTiles Package"&&(t="3D tiles package"),t}readExtent(i){return i&&i.length?new hr(i[0][0],i[0][1],i[1][0],i[1][1]):null}get iconUrl(){const i=this.type?.toLowerCase()||"",e=this.typeKeywords||[],t="esri/images/portal/",r="16";let n,s=!1,o=!1,a=!1,l=!1,u=!1,c=!1,h=!1,p=!1;return i.indexOf("service")>0||i==="feature collection"||i==="kml"||i==="wms"||i==="wmts"||i==="wfs"?(s=e.includes("Hosted Service"),i==="feature service"||i==="feature collection"||i==="kml"||i==="wfs"?(o=e.includes("Table"),a=e.includes("Route Layer"),l=e.includes("Markup"),u=e.includes("Spatiotemporal"),c=e.includes("UtilityNetwork"),n=u&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":u?"spatiotemporal":c?"utilitynetwork":s?"featureshosted":"features"):i==="map service"||i==="wms"||i==="wmts"?(u=e.includes("Spatiotemporal"),h=e.includes("Relational"),n=u||h?"mapimages":s||e.includes("Tiled")||i==="wmts"?"maptiles":"mapimages"):n=i==="scene service"?e.includes("Line")?"sceneweblayerline":e.includes("3DObject")?"sceneweblayermultipatch":e.includes("Point")?"sceneweblayerpoint":e.includes("IntegratedMesh")?"sceneweblayermesh":e.includes("PointCloud")?"sceneweblayerpointcloud":e.includes("Polygon")?"sceneweblayerpolygon":e.includes("Building")?"sceneweblayerbuilding":e.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":i==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":i==="stream service"?"streamlayer":i==="vector tile service"?"vectortile":i==="datastore catalog service"?"datastorecollection":i==="geocoding service"?"geocodeservice":i==="video service"?e.includes("Live Stream")?"livestreamvideolayer":"videolayer":i==="geoprocessing service"?e.includes("Web Tool")?"tool":"layers":i==="geodata service"?"geodataservice":i==="3dtiles service"?e.includes("3DObject")?"3dobjecttileslayer":e.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):i==="web map"||i==="cityengine web scene"?n="maps":i==="web scene"?n=e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":i==="web mapping application"&&e.includes("configurableApp")?n="instantapps":i==="web mapping application"||i==="mobile application"||i==="application"||i==="operation view"||i==="desktop application"?n="apps":i==="map document"||i==="map package"||i==="published map"||i==="scene document"||i==="globe document"||i==="basemap package"||i==="mobile basemap package"||i==="mobile map package"||i==="project package"||i==="project template"||i==="pro map"||i==="layout"||i==="layer"&&e.includes("ArcGIS Pro")||i==="explorer map"&&e.indexOf("Explorer Document")?n="mapsgray":i==="service definition"||i==="shapefile"||i==="cad drawing"||i==="geojson"||i==="netcdf"||i==="administrative report"?n="datafiles":i==="360 vr experience"?n="360vr":i==="explorer add in"||i==="desktop add in"||i==="windows viewer add in"||i==="windows viewer configuration"?n="appsgray":i==="arcgis pro add in"||i==="arcgis pro configuration"?n="addindesktop":i==="pdf"?n="pdf":i==="microsoft word"?n="word":i==="microsoft excel"?n="excel":i==="microsoft powerpoint"?n="ppt":i==="rule package"||i==="file geodatabase"||i==="sqlite geodatabase"||i==="csv collection"||i==="kml collection"||i==="windows mobile package"||i==="map template"||i==="desktop application template"||i==="gml"||i==="arcpad package"||i==="code sample"||i==="document link"||i==="earth configuration"||i==="operations dashboard add in"||i==="rules package"||i==="workflow manager package"||i==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?n="datafilesgray":i==="network analysis service"||i==="geoprocessing service"||i==="geodata service"||i==="geometry service"||i==="geoprocessing package"||i==="locator package"||i==="geoprocessing sample"||i==="workflow manager service"?n="toolsgray":i==="layer"||i==="layer package"||i==="explorer layer"?n="layersgray":i==="scene package"?n="scenepackage":i==="3dtiles package"?n="3dtileslayerpackage":i==="3dtiles service"?n="3dtileslayer":i==="mobile scene package"?n="mobilescenepackage":i==="tile package"||i==="compact tile package"?n="tilepackage":i==="task file"?n="taskfile":i==="report template"?n="report-template":i==="statistical data collection"?n="statisticaldatacollection":i==="insights workbook"?n="workbook":i==="insights model"?n="insightsmodel":i==="insights page"?n="insightspage":i==="insights theme"?n="insightstheme":i==="hub initiative"?n="hubinitiative":i==="hub page"?n="hubpage":i==="hub site application"?n="hubsite":i==="hub event"?n="hubevent":i==="hub project"?n="hubproject":i==="relational database connection"?n="relationaldatabaseconnection":i==="big data file share"?n="datastorecollection":i==="image collection"?n="imagecollection":i==="desktop style"?n="desktopstyle":i==="style"?n="style":i==="dashboard"?n="dashboard":i==="raster function template"?n="rasterprocessingtemplate":i==="vector tile package"?n="vectortilepackage":i==="ortho mapping project"?n="orthomappingproject":i==="ortho mapping template"?n="orthomappingtemplate":i==="solution"?n="solutions":i==="geopackage"?n="geopackage":i==="deep learning package"?n="deeplearningpackage":i==="real time analytic"?n="realtimeanalytics":i==="big data analytic"?n="bigdataanalytics":i==="feed"?n="feed":i==="excalibur imagery project"?n="excaliburimageryproject":i==="notebook"?n="notebook":i==="storymap"?n="storymap":i==="survey123 add in"?n="survey123addin":i==="mission"?n="mission":i==="mission report"?n="missionreport":i==="mission template"?n="missiontemplate":i==="quickcapture project"?n="quickcaptureproject":i==="pro report"?n="proreport":i==="pro report template"?n="proreporttemplate":i==="urban model"?n="urbanmodel":i==="web experience"?n="experiencebuilder":i==="web experience template"?n="webexperiencetemplate":i==="experience builder widget"?n="experiencebuilderwidget":i==="experience builder widget package"?n="experiencebuilderwidgetpackage":i==="workflow"?n="workflow":i==="kernel gateway connection"?n="kernelgatewayconnection":i==="insights script"?n="insightsscript":i==="hub initiative template"?n="hubinitiativetemplate":i==="storymap theme"?n="storymaptheme":i==="knowledge graph"?n="knowledgegraph":i==="knowledge studio project"?n="knowledgestudio":i==="native application"?n="nativeapp":i==="native application installer"?n="nativeappinstaller":i==="web link chart"?n="linkchart":i==="knowledge graph web investigation"?n="investigation":i==="ogcfeatureserver"?n="features":i==="pro project"?n="proproject":i==="insights workbook package"?n="insightsworkbookpackage":i==="apache parquet"?n="apacheparquet":i==="notebook code snippets"||i==="notebook code snippet library"?n="notebookcodesnippets":i==="suitability model"?n="suitabilitymodel":i==="esri classifier definition"?n="classifierdefinition":i==="esri classification schema"?n="classificationschema":i==="insights data engineering workbook"?n="dataengineeringworkbook":i==="insights data engineering model"?n="dataengineeringmodel":i==="deep learning studio project"?n="deeplearningproject":i==="discussion"?n="discussion":i==="allsource project"?n="allsourceproject":i==="api key"?n="apikey":i==="data pipeline"?n="datapipelines":i==="group layer"?(p=e.includes("Map"),n=p?"layergroup2d":"layergroup"):n=i==="media layer"?"onlinemedialayer":i==="form"?e.includes("Survey123")?"survey":"datafilesgray":i==="csv"?"csv":i==="image"?"image":"maps",n?Fl(t+n+r+".png"):null}get isLayer(){return this.type!=null&&EYi.has(this.type)}get itemCdnUrl(){return Tze(this.itemUrl)}get itemPageUrl(){const i=this.portal?.itemPageUrl;return i&&this.id?`${i}?id=${this.id}`:null}get itemUrl(){const i=this.portal?.restUrl;return i&&this.id?`${i}/content/items/${this.id}`:null}get thumbnailUrl(){const i=this.itemUrl,e=this.thumbnail;return i&&e?this.portal?.normalizeUrl(`${i}/info/${e}?f=json`)??null:null}get userItemUrl(){const i=this.portal?.restUrl;if(!i)return null;const e=this.owner||this.portal?.user?.username;return e?`${i}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(i){const e=this.portal??(this.portal=Bu.getDefault()),t=e.load(i).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:i!=null?i.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(t),Promise.resolve(this)}async addRating(i){const e={method:"post",query:{}};return i instanceof t3e&&(i=i.rating),i==null||isNaN(i)||typeof i!="number"||(e.query.rating=i),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new t3e({rating:i,created:new Date})):null}clone(){const i={access:this.access,accessInformation:this.accessInformation,applicationProxies:li(this.applicationProxies),avgRating:this.avgRating,categories:li(this.categories),created:li(this.created),culture:this.culture,description:this.description,extent:li(this.extent),groupCategories:li(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:li(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:li(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:li(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:li(this.typeKeywords),url:this.url};this.loaded&&(i.loadStatus="loaded");const e=new SN({sourceJSON:this.sourceJSON}).set(i);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){const i=this.toJSON();for(const t of["tags","typeKeywords","categories"])i[t]=i[t]?.join(", ");const{extent:e}=i;return e&&(i.extent=JSON.stringify(e)),i}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(i="json",e){return this.portal.request(this.itemUrl+"/data",{responseType:i,...e,query:{token:this.apiKey}})}async fetchRating(i){const e=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...i});return e.rating!=null?(e.created=new Date(e.created),new t3e(e)):null}fetchRelatedItems(i,e){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...i,token:this.apiKey},...e},SN)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(i=>(this.sourceJSON=i,this.read(i),this))}update(i){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=i?.data,t={method:"post"};t.query=this.createPostQuery();for(const r in t.query)t.query[r]===null&&(t.query[r]="");return t.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?t.query.text=e:typeof e=="object"&&(t.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,t).then(()=>this.reload())}):Promise.reject(new qe("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(i){if(!this.id)throw new qe("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:t}=this;await e.signIn();const{copyResources:r,folder:n,tags:s,title:o}=i||{},a={method:"post",query:{copyPrivateResources:r==="all",folder:typeof n=="string"?n:n?.id,includeResources:!!r,tags:s?.join(","),title:o}},{itemId:l}=await e.request(`${t}/copy`,a);return new SN({id:l,portal:e})}updateThumbnail(i){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=i.thumbnail,t=i.filename,r={method:"post"};if(typeof e=="string")Vx(e)?r.query={data:e}:r.query={url:xf(e)},t!=null&&(r.query.filename=t);else{const n=new FormData;t!=null?n.append("file",e,t):n.append("file",e),r.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new qe("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(i={},e){const{fetchResources:t}=await Promise.resolve().then(()=>Qz);return t(this,i,e)}async addResource(i,e,t){const{addOrUpdateResources:r}=await Promise.resolve().then(()=>Qz);return i.portalItem=this,await r(this,[{resource:i,content:e,compress:t?.compress,access:t?.access}],"add",t),i}async removeResource(i,e){const{removeResource:t}=await Promise.resolve().then(()=>Qz);if(i.portalItem&&i.portalItem.itemUrl!==this.itemUrl)throw new qe("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return t(this,i,e)}async removeAllResources(i){const{removeAllResources:e}=await Promise.resolve().then(()=>Qz);return e(this,i)}resourceFromPath(i){return new SYi({portalItem:this,path:i})}toJSON(){const i=this.extent,e={accessInformation:this.accessInformation,categories:li(this.categories),created:this.created?.getTime(),description:this.description,extent:i&&[[i.xmin,i.ymin],[i.xmax,i.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:li(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:li(this.typeKeywords),url:this.url};return BUe(e)}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");return new SN({sourceJSON:i})}_getPostQuery(){const i=this.toJSON();for(const e in i)e==="tags"&&i[e]!==null&&(i[e]=i[e].join(", ")),e==="typeKeywords"&&i[e]!==null&&(i[e]=i[e].join(", ")),e==="extent"&&i[e]&&(i[e]=JSON.stringify(i[e]));return i}};x([D({type:["private","shared","org","public"]})],La.prototype,"access",void 0),x([D()],La.prototype,"accessInformation",void 0),x([D({type:String})],La.prototype,"apiKey",void 0),x([D({json:{read:{source:"appProxies"}}})],La.prototype,"applicationProxies",void 0),x([D()],La.prototype,"avgRating",void 0),x([D()],La.prototype,"categories",void 0),x([D({type:Date})],La.prototype,"created",void 0),x([D()],La.prototype,"culture",void 0),x([D()],La.prototype,"description",void 0),x([D({readOnly:!0})],La.prototype,"displayName",null),x([D({type:hr})],La.prototype,"extent",void 0),x([Mi("extent")],La.prototype,"readExtent",null),x([D()],La.prototype,"groupCategories",void 0),x([D({readOnly:!0})],La.prototype,"iconUrl",null),x([D()],La.prototype,"id",void 0),x([D({readOnly:!0})],La.prototype,"isLayer",null),x([D({type:Boolean,readOnly:!0})],La.prototype,"isOrgItem",void 0),x([D()],La.prototype,"itemControl",void 0),x([D({readOnly:!0})],La.prototype,"itemPageUrl",null),x([D({readOnly:!0})],La.prototype,"itemUrl",null),x([D()],La.prototype,"licenseInfo",void 0),x([D({type:Date})],La.prototype,"modified",void 0),x([D()],La.prototype,"name",void 0),x([D()],La.prototype,"numComments",void 0),x([D()],La.prototype,"numRatings",void 0),x([D()],La.prototype,"numViews",void 0),x([D()],La.prototype,"owner",void 0),x([D()],La.prototype,"ownerFolder",void 0),x([D({type:Bu})],La.prototype,"portal",void 0),x([D()],La.prototype,"screenshots",void 0),x([D()],La.prototype,"size",void 0),x([D()],La.prototype,"snippet",void 0),x([D()],La.prototype,"sourceJSON",void 0),x([D({type:String})],La.prototype,"sourceUrl",void 0),x([D({type:String})],La.prototype,"spatialReference",void 0),x([D()],La.prototype,"tags",void 0),x([D()],La.prototype,"thumbnail",void 0),x([D({readOnly:!0})],La.prototype,"thumbnailUrl",null),x([D()],La.prototype,"title",void 0),x([D()],La.prototype,"type",void 0),x([D()],La.prototype,"typeKeywords",void 0),x([D({type:String,json:{read(i,e){if(IYi.has(e.type)){const t=this.portal?.restUrl;i||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return i}}})],La.prototype,"url",void 0),x([D({readOnly:!0})],La.prototype,"userItemUrl",null),La=SN=x([Qe("esri.portal.PortalItem")],La);const yg=La,NEt=Object.freeze(Object.defineProperty({__proto__:null,default:yg},Symbol.toStringTag,{value:"Module"})),Trt=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,AYi={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function Crt(i){return i in AYi}const VZ=[],FV=new Map;function Ert(i){for(const e of FV.keys())$Et(i.pattern,e)&&FV.delete(e)}function MYi(i){return VZ.includes(i)||(Ert(i),VZ.unshift(i)),wa(()=>{const e=VZ.indexOf(i);e>-1&&(VZ.splice(e,1),Ert(i))})}async function Cze(i){const e=Am();FV.has(i)||FV.set(i,PYi(i,e));const t=FV.get(i);return t&&await RYi.add(t),t}function OYi(i){if(!Trt.test(i))return null;const e=Trt.exec(i);if(e===null)return null;const[,t,r]=e,n=t+(r?"-"+r.toUpperCase():"");return Crt(n)?n:Crt(t)?t:null}async function PYi(i,e){const t=[];for(const r of VZ)if($Et(r.pattern,i))try{return await r.fetchMessageBundle(i,e)}catch(n){t.push(n)}throw t.length?new qe("intl:message-bundle-error",`Errors occurred while loading "${i}"`,{errors:t}):new qe("intl:no-message-bundle-loader",`No loader found for message bundle "${i}"`)}function $Et(i,e){return typeof i=="string"?e.startsWith(i):i.test(e)}bze(()=>{FV.clear()});const RYi=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(i){return this._increase(),i.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=ac())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function DYi(i){if(!i)return;const e=i.includes("-vector")?i.slice(0,i.indexOf("-vector")):i.includes("-3d")?i.slice(0,i.indexOf("-3d")):i,t=await Cze("esri/t9n/basemaps");return t[i]||t[e]}const v5e={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return Fl("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Fl("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Fl("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Fl("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Fl("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Fl("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},FYi=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let r4=class extends un{constructor(e){super(e),this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=Am().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const t=FEt(e);return t==="pt"?"pt-BR":t&&FYi.has(t)?t:"global"}};x([D()],r4.prototype,"id",void 0),x([D()],r4.prototype,"language",void 0),x([D()],r4.prototype,"places",void 0),x([D()],r4.prototype,"serviceUrl",void 0),x([D()],r4.prototype,"worldview",void 0),r4=x([Qe("esri.support.BasemapStyle")],r4);const kYi=r4;function LYi(i){return i!=null&&typeof i=="object"&&"type"in i&&i.type==="subtype-group"&&"sublayers"in i}function oj(i){return i?.type==="subtype-sublayer"}const _ie={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function BEt(i){const e=i?.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function c2e(i){return i?.type==="feature"&&!i.url&&i.source?.type==="memory"}function NYi(i){return(i?.type==="feature"||i?.type==="subtype-group")&&i.source?.type==="feature-layer"}async function jEt(i,e){const t=no?.findServerInfo(i);if(t?.currentVersion!=null)return t.owningSystemUrl||null;const r=i.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const n=`${i.substring(0,r)}/rest/info`,s=e!=null?e.signal:null,{data:o}=await zi(n,{query:{f:"json"},responseType:"json",signal:s});return o?.owningSystemUrl||null}function $Yi(i){if(!("capabilities"in i))return!1;switch(i.type){case"catalog":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function tT(i){return $Yi(i)?"effectiveCapabilities"in i?i.effectiveCapabilities:i.capabilities:null}function BYi(i){if(!("editingEnabled"in i))return!1;switch(i.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function GEt(i){return!!BYi(i)&&("effectiveEditingEnabled"in i?i.effectiveEditingEnabled:i.editingEnabled)}const jYi=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),GYi=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function UYi(i){return i.layerContainerType==="basemap"?jYi:i.layerContainerType==="operational-layers"?GYi:null}function zYi(i,e){if(e.restrictedWebMapWriting){const t=UYi(e);return t==null||t.has(i.type)&&!c2e(i)}return!0}function VYi(i,e){if(e)if(c2e(i)){const t=uS("featureCollection.layers",e),r=t?.[0]?.layerDefinition;r&&Irt(i,r)}else i.type!=="group"&&Irt(i,e)}function Irt(i,e){"maxScale"in i&&(e.maxScale=Ive(i.maxScale)??void 0),"minScale"in i&&(e.minScale=Ive(i.minScale)??void 0)}function HYi(i,e){if(VYi(i,e),e&&(e.id=i.id,"blendMode"in i&&(e.blendMode=i.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=Ive(i.opacity)??void 0,e.title=i.title||"Layer",e.visibility=i.visible,"legendEnabled"in i&&i.type!=="wmts"))if(c2e(i)){const t=e.featureCollection;t&&(t.showLegend=i.legendEnabled)}else e.showLegend=i.legendEnabled}function _5e(i,e,t){if(!i.persistenceEnabled)return null;if(!("write"in i)||!i.write)return t?.messages&&t.messages.push(new qe("layer:unsupported",`Layers (${i.title}, ${i.id}) of type '${i.declaredClass}' cannot be persisted`,{layer:i})),null;if(c2e(i)&&!i.isTable)e=i.resourceInfo;else if(zYi(i,t)){const r={};return i.write(r,t)?r:null}return e!=null&&HYi(i,e=li(e)),e}var HZ;let WYi=0;const qYi="esri.Basemap";let mw=HZ=class extends S0(ef){constructor(i){super(i),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+WYi++,this.baseLayers=new dr,this.referenceLayers=new dr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&di.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},t=r=>{r.parent=null};this.addHandles([this.baseLayers.on("after-add",r=>e(r.item)),this.referenceLayers.on("after-add",r=>e(r.item)),this.baseLayers.on("after-remove",r=>t(r.item)),this.referenceLayers.on("after-remove",r=>t(r.item))])}initialize(){this.when().catch(i=>{di.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,i)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const i=this.baseLayers.toArray();for(const t of i)t.destroy();const e=this.referenceLayers.toArray();for(const t of e)t.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=zo(this.portalItem)}normalizeCtorArgs(i){return i&&"resourceInfo"in i&&(this._set("resourceInfo",i.resourceInfo),delete(i={...i}).resourceInfo),i}set baseLayers(i){this._set("baseLayers",ay(i,this._get("baseLayers")))}_writeBaseLayers(i,e,t){const r=[];i&&(t={...t,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=_5e(n,t.webmap?t.webmap.getLayerJSONFromResourceInfo(n):null,t);s!=null&&r.push(s)}),this.referenceLayers.forEach(n=>{const s=_5e(n,t.webmap?t.webmap.getLayerJSONFromResourceInfo(n):null,t);s!=null&&(n.type!=="scene"&&(s.isReference=!0),r.push(s))})),e.baseMapLayers=r}set referenceLayers(i){this._set("referenceLayers",ay(i,this._get("referenceLayers")))}writeTitle(i,e){e.title=i||"Basemap"}load(i){return this.addResolvingPromise(this._loadFromSource(i)),Promise.resolve(this)}loadAll(){return VB(this,i=>{i(this.baseLayers,this.referenceLayers)})}clone(){const i={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>dve(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>dve(e)?e.clone():e)};return this.loaded&&(i.loadStatus="loaded"),new HZ({resourceInfo:this.resourceInfo}).set(i)}read(i,e){this.resourceInfo||this._set("resourceInfo",{data:i,context:e}),super.read(i,e)}write(i,e){return i=i||{},e?.origin||(e={origin:"web-map",...e}),super.write(i,e),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(i.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(t=>{const r=li(t);return r.url&&Mx(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&Mx(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),i}async _loadFromSource(i){const{resourceInfo:e,portalItem:t,style:r}=this;hn(i);const n=[];if(e){const s=e.context?e.context.url:null;if(n.push(this._loadLayersFromJSON(e.data,s,i)),e.data.id&&!e.data.title){const o=e.data.id;n.push(DYi(o).then(a=>{a&&this.read({title:a},e.context)}))}}else t?n.push(this._loadFromItem(t,i)):r&&n.push(this._loadFromStylesService(r,i));await Promise.all(n)}async _loadLayersFromJSON(i,e,t){const r=this.resourceInfo?.context,n=this.portalItem?.portal||r?.portal||null,s=XYi[r?.origin||""]??"web-map",{populateOperationalLayers:o}=await Promise.resolve().then(()=>T8t),a=[];if(hn(t),i.baseMapLayers&&Array.isArray(i.baseMapLayers)){const l={context:{...r,origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},u=p=>s==="web-scene"&&p.layerType==="ArcGISSceneServiceLayer"||p.isReference,c=o(this.baseLayers,i.baseMapLayers.filter(p=>!u(p)),l);a.push(c);const h=o(this.referenceLayers,i.baseMapLayers.filter(u),l);a.push(h)}await Promise.allSettled(a)}async _loadFromItem(i,e){const t=await i.load(e),r=await t.fetchData("json",e),n=Yo(i.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:YYi[i.type||""]??"web-map",portal:i.portal||Bu.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:i.title,thumbnailUrl:i.thumbnailUrl},{origin:"portal-item",portal:i.portal||Bu.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}async _loadFromStylesService(i,e){const t=`${i.serviceUrl}/${i.id}`,r=(await zi(t,{query:{language:i.getLanguageParamValue(),places:i.places,worldview:i.worldview},signal:e?.signal})).data,n=Yo(t);return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:"web-map",url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(i){const e=v5e[i];return e?e.itemId?new HZ({portalItem:{id:e.itemId,portal:{url:"https://www.arcgis.com"}}}):HZ.fromJSON(e,{origin:e.is3d?"web-scene":"web-map"}):null}};x([D({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(i,e,t,r){this._writeBaseLayers(i,e,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:dr}},writer(i,e,t,r){this._writeBaseLayers(i,e,r)}}}}}})],mw.prototype,"baseLayers",null),x([D({type:String,json:{origins:{"web-scene":{write:!0}}}})],mw.prototype,"id",void 0),x([D({type:yg})],mw.prototype,"portalItem",void 0),x([D()],mw.prototype,"referenceLayers",null),x([D({readOnly:!0})],mw.prototype,"resourceInfo",void 0),x([D({type:Xi})],mw.prototype,"spatialReference",void 0),x([D({type:kYi})],mw.prototype,"style",void 0),x([D()],mw.prototype,"thumbnailUrl",void 0),x([D({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],mw.prototype,"title",void 0),x([ur("title")],mw.prototype,"writeTitle",null),mw=HZ=x([Qe(qYi)],mw);const YYi={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},XYi={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},kV=mw,JYi=Object.freeze(Object.defineProperty({__proto__:null,default:kV},Symbol.toStringTag,{value:"Module"})),Uve={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function UEt(i){return!!Uve[i]||!!Uve[i.toLowerCase()]}function Eze(i){return Uve[i]??Uve[i.toLowerCase()]}function KYi(i){return[...Eze(i)]}function i3e(i,e,t){t<0&&++t,t>1&&--t;const r=6*t;return r<1?i+(e-i)*r:2*t<1?e:3*t<2?i+(e-i)*(2/3-t)*6:i}function zEt(i,e,t,r=1){const n=(i%360+360)%360/360,s=t<=.5?t*(e+1):t+e-t*e,o=2*t-s;return[Math.round(255*i3e(o,s,n+1/3)),Math.round(255*i3e(o,s,n)),Math.round(255*i3e(o,s,n-1/3)),r]}function ZYi(i){const e=i.length>5,t=e?8:4,r=(1<>=t,a[3]=n*l/255),l=o&r,o>>=t,a[2]=n*l,l=o&r,o>>=t,a[1]=n*l,l=o&r,o>>=t,a[0]=n*l,a}function gr(){return[0,0,0]}function Ef(i){return[i[0],i[1],i[2]]}function Do(i,e,t){return[i,e,t]}function sW(i,e=gr()){const t=Math.min(3,i.length);for(let r=0;r0&&(s=1/Math.sqrt(s),i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s),i}function yE(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function qC(i,e,t){const r=e[0],n=e[1],s=e[2],o=t[0],a=t[1],l=t[2];return i[0]=n*l-s*a,i[1]=s*o-r*l,i[2]=r*a-n*o,i}function lW(i,e,t,r){const n=e[0],s=e[1],o=e[2];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i[2]=o+r*(t[2]-o),i}function lXi(i,e,t,r,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return i[0]=e[0]*a+t[0]*l+r[0]*u+n[0]*c,i[1]=e[1]*a+t[1]*l+r[1]*u+n[1]*c,i[2]=e[2]*a+t[2]*l+r[2]*u+n[2]*c,i}function uXi(i,e,t,r,n,s){const o=1-s,a=o*o,l=s*s,u=a*o,c=3*s*a,h=3*l*o,p=l*s;return i[0]=e[0]*u+t[0]*c+r[0]*h+n[0]*p,i[1]=e[1]*u+t[1]*c+r[1]*h+n[1]*p,i[2]=e[2]*u+t[2]*c+r[2]*h+n[2]*p,i}function cXi(i,e){e=e||1;const t=sae,r=2*t()*Math.PI,n=2*t()-1,s=Math.sqrt(1-n*n)*e;return i[0]=Math.cos(r)*s,i[1]=Math.sin(r)*s,i[2]=n*e,i}function c0(i,e,t){const r=e[0],n=e[1],s=e[2];return i[0]=t[0]*r+t[4]*n+t[8]*s+t[12],i[1]=t[1]*r+t[5]*n+t[9]*s+t[13],i[2]=t[2]*r+t[6]*n+t[10]*s+t[14],i}function c3(i,e,t){const r=e[0],n=e[1],s=e[2];return i[0]=r*t[0]+n*t[3]+s*t[6],i[1]=r*t[1]+n*t[4]+s*t[7],i[2]=r*t[2]+n*t[5]+s*t[8],i}function Cv(i,e,t){const r=t[0],n=t[1],s=t[2],o=t[3],a=e[0],l=e[1],u=e[2],c=n*u-s*l,h=s*a-r*u,p=r*l-n*a,m=n*p-s*h,v=s*c-r*p,w=r*h-n*c,S=2*o;return i[0]=a+c*S+2*m,i[1]=l+h*S+2*v,i[2]=u+p*S+2*w,i}function hXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[0],s[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),s[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function dXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),s[1]=n[1],s[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function pXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),s[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),s[2]=n[2],i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function fXi(i,e){ly(Art,i),ly(Mrt,e);const t=yE(Art,Mrt);return t>1?0:t<-1?Math.PI:Math.acos(t)}const Art=gr(),Mrt=gr();function mXi(i){return"vec3("+i[0]+", "+i[1]+", "+i[2]+")"}function _F(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]}function gXi(i,e){if(i===e)return!0;const t=i[0],r=i[1],n=i[2],s=e[0],o=e[1],a=e[2],l=c_();return Math.abs(t-s)<=l*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(r-o)<=l*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=l*Math.max(1,Math.abs(n),Math.abs(a))}function ZEt(i,e,t){const r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];let o=r*r+n*n+s*s;return o>0?(o=1/Math.sqrt(o),i[0]=r*o,i[1]=n*o,i[2]=s*o,i):(i[0]=0,i[1]=0,i[2]=0,i)}const O1=uh,yXi=h2e,vXi=Ene,QEt=hR,w5e=aW,eIt=yp,tIt=d2e;Object.freeze(Object.defineProperty({__proto__:null,abs:oW,add:hl,angle:fXi,bezier:uXi,ceil:nXi,copy:Px,cross:qC,direction:ZEt,dist:QEt,distance:hR,div:vXi,divide:Ene,dot:yE,equals:gXi,exactEquals:_F,floor:sXi,hermite:lXi,inverse:Aze,len:eIt,length:yp,lerp:lW,max:Hve,min:Vve,mul:yXi,multiply:h2e,negate:aXi,normalize:ly,random:cXi,rotateX:hXi,rotateY:dXi,rotateZ:pXi,round:oXi,scale:Gc,scaleAndAdd:gb,set:Zo,sign:KEt,sqrDist:w5e,sqrLen:tIt,squaredDistance:aW,squaredLength:d2e,str:mXi,sub:O1,subtract:uh,transformMat3:c3,transformMat4:c0,transformQuat:Cv},Symbol.toStringTag,{value:"Module"}));const Ort=new Float32Array(1);function _Xi(i){--i;for(let e=1;e<32;e<<=1)i|=i>>e;return i+1}function uu(i,e,t){return Math.min(Math.max(i,e),t)}function x5e(i){return i--,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,++i}function Pz(i,e,t){return i+(e-i)*t}function Prt(i,e,t,r,n){return Pz(r,n,(i-e)/(t-e))}function Rx(i){return i*Math.PI/180}function yb(i){return 180*i/Math.PI}function Mze(i){return Math.acos(uu(i,-1,1))}function iIt(i){return Math.asin(uu(i,-1,1))}function W8(i,e,t=1e-6){return i===e?!0:!Number.isFinite(i)||!Number.isFinite(e)?!1:(i>e?i-e:e-i)<=t}const Wve=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function bXi(i){return Wve.setFloat64(0,i),Wve.getBigInt64(0)}function wXi(i){return Wve.setBigInt64(0,i),Wve.getFloat64(0)}const r3e=BigInt("1000000");xXi(1);function xXi(i){const e=bXi(i=Math.abs(i)),t=wXi(e<=r3e?r3e:e-r3e);return Math.abs(i-t)}function Rrt(i){return rIt(Math.max(-bF,Math.min(i,bF)))}function rIt(i){return Ort[0]=i,Ort[0]}function Drt(i,e){const t=yp(i),r=iIt(i[2]/t),n=Math.atan2(i[1]/t,i[0]/t);return Zo(e,t,r,n),e}function Frt(i){const e=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],t=i[3]*i[3]+i[4]*i[4]+i[5]*i[5],r=i[6]*i[6]+i[7]*i[7]+i[8]*i[8];return!(W8(e,1)&&W8(t,1)&&W8(r,1))}const bF=rIt(34028234663852886e22);function Lce(i){return uu(r2e(i),0,255)}function Nce(i,e,t){return i=Number(i),isNaN(i)?t:it?t:i}function $ce(i,e){const t=i.toString(16).padStart(2,"0");return e?t.substring(0,1):t}let Yfe=class zm{static blendColors(e,t,r,n=new zm){return n.r=Math.round(e.r+(t.r-e.r)*r),n.g=Math.round(e.g+(t.g-e.g)*r),n.b=Math.round(e.b+(t.b-e.b)*r),n.a=e.a+(t.a-e.a)*r,n._sanitize()}static fromRgb(e,t){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const n=r[2].split(/\s*,\s*/),s=r[1];if(s==="rgb"&&n.length===3||s==="rgba"&&n.length===4){const o=n[0];if(o.charAt(o.length-1)==="%"){const a=n.map(l=>2.56*parseFloat(l));return n.length===4&&(a[3]=parseFloat(n[3])),zm.fromArray(a,t)}return zm.fromArray(n.map(a=>parseFloat(a)),t)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return zm.fromArray(zEt(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),t)}return null}static fromHex(e,t=new zm){if(e[0]!=="#"||isNaN(+`0x${e.substring(1)}`))return null;switch(e.length){case 4:case 5:{const r=parseInt(e.substring(1,2),16),n=parseInt(e.substring(2,3),16),s=parseInt(e.substring(3,4),16),o=e.length===5?15:parseInt(e.substring(4),16);return zm.fromArray([r+16*r,n+16*n,s+16*s,(o+16*o)/255],t)}case 7:case 9:{const r=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),o=e.length===7?255:parseInt(e.substring(7),16);return zm.fromArray([r,n,s,o/255],t)}default:return null}}static fromArray(e,t=new zm){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=UEt(e)?Eze(e):null;return r&&zm.fromArray(r,t)||zm.fromRgb(e,t)||zm.fromHex(e,t)}static fromJSON(e){return e!=null?new zm([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return e!=null?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return e!=null?[e.r/255,e.g/255,e.b/255,e.a!=null?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return typeof e=="string"?zm.fromString(e,this):Array.isArray(e)?zm.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof zm||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,r=e?.digits??6,n=r===3||r===4,s=r===4||r===8,o=`#${$ce(this.r,n)}${$ce(this.g,n)}${$ce(this.b,n)}${s?$ce(Math.round(255*this.a),n):""}`;return t?o.toUpperCase():o}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=zm.AlphaMode.ALWAYS){const t=Lce(this.r),r=Lce(this.g),n=Lce(this.b);return e===zm.AlphaMode.ALWAYS||this.a!==1?[t,r,n,Lce(255*this.a)]:[t,r,n]}clone(){return new zm(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return e!=null&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(Nce(this.r,0,255)),this.g=Math.round(Nce(this.g,0,255)),this.b=Math.round(Nce(this.b,0,255)),this.a=Nce(this.a,0,1),this}_set(e,t,r,n){this.r=e,this.g=t,this.b=r,this.a=n}};Yfe.prototype.declaredClass="esri.Color",function(i){var e;(e=i.AlphaMode||(i.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Yfe||(Yfe={}));const jr=Yfe;function uW(i,e,t=!1){let{hasM:r,hasZ:n}=i;Array.isArray(e)?e.length!==4||r||n?e.length===3&&t&&!r?(n=!0,r=!1):e.length===3&&r&&n&&(r=!1,n=!1):(r=!0,n=!0):(n=!n&&e.hasZ&&(!r||e.hasM),r=!r&&e.hasM&&(!n||e.hasZ)),i.hasZ=n,i.hasM=r}var S5e;function krt(i){return(e,t)=>e==null?t:t==null?e:i(e,t)}function SXi(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}let n4=S5e=class extends Nr{constructor(...i){super(...i),this.points=[],this.type="multipoint"}normalizeCtorArgs(i,e){if(!i&&!e)return{};const t={};Array.isArray(i)?(t.points=i,t.spatialReference=e):SXi(i)?t.spatialReference=i:(i.points&&(t.points=i.points),i.spatialReference&&(t.spatialReference=i.spatialReference),i.hasZ&&(t.hasZ=i.hasZ),i.hasM&&(t.hasM=i.hasM));const r=t.points?.[0];return r&&(t.hasZ===void 0&&t.hasM===void 0?(t.hasZ=r.length>2,t.hasM=!1):t.hasZ===void 0?t.hasZ=r.length>3:t.hasM===void 0&&(t.hasM=r.length>3)),t}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const i=this.points;if(!i.length)return null;const e=new hr,t=this.hasZ,r=this.hasM,n=t?3:2,s=i[0],o=krt(Math.min),a=krt(Math.max);let l,u,c,h,[p,m]=s,[v,w]=s;for(let S=0,I=i.length;S2){const B=R[2];l=o(l,B),c=a(c,B)}if(r&&R.length>n){const B=R[n];u=o(u,B),h=a(h,B)}}return e.xmin=p,e.ymin=m,e.xmax=v,e.ymax=w,e.spatialReference=this.spatialReference,t?(e.zmin=l,e.zmax=c):(e.zmin=void 0,e.zmax=void 0),r?(e.mmin=u,e.mmax=h):(e.mmin=void 0,e.mmax=void 0),e}writePoints(i,e){e.points=li(this.points)}addPoint(i){return uW(this,i),Array.isArray(i)?this.points.push(i):this.points.push(i.toArray()),this.notifyChange("points"),this}clone(){const i={points:li(this.points),spatialReference:this.spatialReference};return this.hasZ&&(i.hasZ=!0),this.hasM&&(i.hasM=!0),new S5e(i)}getPoint(i){if(!this._validateInputs(i))return null;const e=this.points[i],t={x:e[0],y:e[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(t.z=e[2],r=3),this.hasM&&(t.m=e[r]),new $i(t)}removePoint(i){if(!this._validateInputs(i))return null;const e=new $i(this.points.splice(i,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(i,e){return this._validateInputs(i)?(uW(this,e),Array.isArray(e)||(e=e.toArray()),this.points[i]=e,this.notifyChange("points"),this):this}toJSON(i){return this.write({},i)}_validateInputs(i){return i!=null&&i>=0&&i2&&e.length>2){const n=i[2]-e[2];return Math.sqrt(t*t+r*r+n*n)}return Math.sqrt(t*t+r*r)}function TXi(i,e,t){const r=i[0]+t*(e[0]-i[0]),n=i[1]+t*(e[1]-i[1]);return i.length>2&&e.length>2?[r,n,i[2]+t*(e[2]-i[2])]:[r,n]}function CXi(i,e,t,r){return sIt(i,e,t[r],t[r+1])}function sIt(i,e,t,r){const[n,s]=e,[o,a]=t,[l,u]=r,c=l-o,h=u-a,p=c*c+h*h,m=(n-o)*c+(s-a)*h,v=Math.min(1,Math.max(0,m/p));return i[0]=o+c*v,i[1]=a+h*v,i}function EXi(i,e,t,r,n,s){let o=t,a=r,l=n-o,u=s-a;if(l!==0||u!==0){const c=((i-o)*l+(e-a)*u)/(l*l+u*u);c>1?(o=n,a=s):c>0&&(o+=l*c,a+=u*c)}return l=i-o,u=e-a,l*l+u*u}function oIt(i,e){return TXi(i,e,.5)}function q8(i,e=ig.X,t=ig.Y){let r=0;const n=i.length;let s=i[0];for(let o=0;o=0}function IXi(i){const e=i.length;return e>2&&UB(i[0],i[e-1])}function AXi(i){if("rings"in i&&(aIt(i),i.rings.length>0&&!q8(i.rings[0])))for(const e of i.rings)e.reverse()}function aIt(i){if("rings"in i)for(const e of i.rings)IXi(e)||e.push(e[0].slice())}function MXi(i){return i?i.hasZ?[i.xmax-i.xmin/2,i.ymax-i.ymin/2,i.zmax-i.zmin/2]:[i.xmax-i.xmin/2,i.ymax-i.ymin/2]:null}function p2e(i){return i?lIt(i.rings,i.hasZ??!1):null}function lIt(i,e){if(!i?.length)return null;const t=[],r=[],n=e?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let s=0,o=i.length;s{let a=s[2]-o[2];return a===0&&e&&(a=s[4]-o[4]),a}),r.length&&(t[0]=r[0][0],t[1]=r[0][1],e&&(t[2]=r[0][3]),(t[0]n[1]||t[1]n[3]||e&&(t[2]n[5]))&&(t.length=0)),!t.length){const s=i[0]&&i[0].length?PXi(i[0],e):null;if(!s)return null;t[0]=s[0],t[1]=s[1],e&&s.length>2&&(t[2]=s[2])}return t}function uIt(i,e,t){let r=0,n=0,s=0,o=0,a=0;const l=i.length?i[0][0]:0,u=i.length?i[0][1]:0,c=i.length&&e?i[0][2]:0;for(let p=0;p2&&v.length>2){const Q=I-c,re=$-c,ne=R*re-V*Q;s+=(Q+re)*ne,a+=ne}wt[1]&&(t[1]=w),St[3]&&(t[3]=S),e&&(It[5]&&(t[5]=I))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const h=[r/(6*o)+l,n/(6*o)+u,o];return e&&(t[4]===t[5]||a===0?(h[3]=(t[4]+t[5])/2,h[4]=0):(h[3]=s/(6*a)+c,h[4]=a)),h}function OXi(i,e){let t=0,r=0,n=0;i.nextPoint();const s=i.pathSize?i.x:0,o=i.pathSize?i.y:0;for(let a=0;ae[1]&&(e[1]=c),he[3]&&(e[3]=h)}return n>0&&(n*=-1),n?(n*=.5,[t/(6*n)+s,r/(6*n)+o,n]):null}function PXi(i,e){const t=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;for(let l=0,u=i.length;l2&&h.length>2&&(t[2]=c[2],r[2]=h[2]);const p=nIt(t,r);if(p){n+=p;const m=oIt(c,h);s+=p*m[0],o+=p*m[1],e&&m.length>2&&(a+=p*m[2])}}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:i.length?i[0]:null}function RXi(i){const{hasZ:e,totalSize:t}=i;if(t===0)return null;const r=[],n=[],s=e?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(i.reset();i.nextPath();){const o=uIt(wF(i),i.hasZ,s);o&&n.push(o)}if(n.sort((o,a)=>{let l=o[2]-a[2];return l===0&&e&&(l=o[4]-a[4]),l}),n.length&&(r[0]=n[0][0],r[1]=n[0][1],e&&(r[2]=n[0][3]),(r[0]s[1]||r[1]s[3]||e&&(r[2]s[5]))&&(r.length=0)),!r.length){i.reset(),i.nextPath();const o=i.pathSize?DXi(i):null;if(!o)return null;r[0]=o[0],r[1]=o[1],e&&o.length>2&&(r[2]=o[2])}return r}function DXi(i){const{hasZ:e}=i,t=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;if(i.nextPoint()){let l=i.x,u=i.y,c=i.z;for(;i.nextPoint();){const h=i.x,p=i.y,m=i.z;t[0]=l,t[1]=u,r[0]=h,r[1]=p,e&&(t[2]=c,r[2]=m);const v=nIt(t,r);if(v){n+=v;const w=oIt(t,r);s+=v*w[0],o+=v*w[1],e&&w.length>2&&(a+=v*w[2])}l=h,u=p,c=m}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:i.pathSize?(i.seekPathStart(),i.nextPoint(),[i.x,i.y]):null}const FXi=1e-6;function kXi(i){let e=0;for(i.reset();i.nextPath();)e+=i.getCurrentRingArea();if(ei[2]&&(i[2]=e[0]),e[1]i[3]&&(i[3]=e[1])}function T5e(i,e,t){if(e!=null)if("length"in e)E5e(e)?(t[0]=Math.min(i[0],e[0]),t[1]=Math.min(i[1],e[1]),t[2]=Math.max(i[2],e[2]),t[3]=Math.max(i[3],e[3])):e.length!==2&&e.length!==3||(t[0]=Math.min(i[0],e[0]),t[1]=Math.min(i[1],e[1]),t[2]=Math.max(i[2],e[0]),t[3]=Math.max(i[3],e[1]));else switch(e.type){case"extent":t[0]=Math.min(i[0],e.xmin),t[1]=Math.min(i[1],e.ymin),t[2]=Math.max(i[2],e.xmax),t[3]=Math.max(i[3],e.ymax);break;case"point":t[0]=Math.min(i[0],e.x),t[1]=Math.min(i[1],e.y),t[2]=Math.max(i[2],e.x),t[3]=Math.max(i[3],e.y)}else cIt(t,i)}function hIt(i){return i==null||i[0]>=i[2]?0:i[2]-i[0]}function dIt(i){return i==null||i[1]>=i[3]?0:i[3]-i[1]}function pIt(i){return hIt(i)*dIt(i)}function $Xi(i,e,t){return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}function aae(i,e){return Math.max(e[0],i[0])<=Math.min(e[2],i[2])&&Math.max(e[1],i[1])<=Math.min(e[3],i[3])}function C5e(i,e){return e[0]>=i[0]&&e[2]<=i[2]&&e[1]>=i[1]&&e[3]<=i[3]}function Oze(i){return i?cIt(i,qve):Wo(qve)}function E5e(i){return i!=null&&i.length===4}function fIt(i,e){return E5e(i)&&E5e(e)?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]:i===e}const qve=[1/0,1/0,-1/0,-1/0],BXi=[0,0,0,0];function mIt(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function gIt(i){return i.points!==void 0}function yIt(i){return i.x!==void 0&&i.y!==void 0}function vIt(i){return i.paths!==void 0}function _It(i){return i.rings!==void 0}function bIt(i){function e(t,r){return t==null?r:r==null?t:i(t,r)}return e}const Q5=bIt(Math.min),eF=bIt(Math.max);function gY(i,e){return vIt(e)?hW(i,e.paths,!1,!1):_It(e)?hW(i,e.rings,!1,!1):gIt(e)?Pze(i,e.points,!1,!1,!1,!1):mIt(e)?xIt(i,e):(yIt(e)&&(i[0]=e.x,i[1]=e.y,i[2]=e.x,i[3]=e.y),i)}function f2e(i){let e,t,r,n;for(i.reset(),e=r=1/0,t=n=-1/0;i.nextPath();){const s=wIt(i);e=Math.min(s[0],e),r=Math.min(s[1],r),t=Math.max(s[2],t),n=Math.max(s[3],n)}return Wo([e,r,t,n])}function wIt(i){let e,t,r,n;for(e=r=1/0,t=n=-1/0;i.nextPoint();)e=Math.min(i.x,e),r=Math.min(i.y,r),t=Math.max(i.x,t),n=Math.max(i.y,n);return Wo([e,r,t,n])}function jce(i,e){return vIt(e)?hW(i,e.paths,!0,!1):_It(e)?hW(i,e.rings,!0,!1):gIt(e)?Pze(i,e.points,!0,!1,!0,!1):mIt(e)?xIt(i,e,!0,!1,!0,!1):(yIt(e)&&(i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.x,i[4]=e.y,i[5]=e.z),i)}function hW(i,e,t,r){const n=t?3:2;if(!e.length||!e[0].length)return null;let s,o,a,l,[u,c]=e[0][0],[h,p]=e[0][0];for(let m=0;m2){const L=S[2];s=Q5(s,L),o=eF(o,L)}if(r&&S.length>n){const L=S[n];a=Q5(s,L),l=eF(o,L)}}}return t?r?(i[0]=u,i[1]=c,i[2]=s,i[3]=a,i[4]=h,i[5]=p,i[6]=o,i[7]=l,i.length=8,i):(i[0]=u,i[1]=c,i[2]=s,i[3]=h,i[4]=p,i[5]=o,i.length=6,i):r?(i[0]=u,i[1]=c,i[2]=a,i[3]=h,i[4]=p,i[5]=l,i.length=6,i):(i[0]=u,i[1]=c,i[2]=h,i[3]=p,i.length=4,i)}function xIt(i,e,t,r,n,s){const o=e.xmin,a=e.xmax,l=e.ymin,u=e.ymax;let c=e.zmin,h=e.zmax,p=e.mmin,m=e.mmax;return n?(c=c||0,h=h||0,s?(p=p||0,m=m||0,i[0]=o,i[1]=l,i[2]=c,i[3]=p,i[4]=a,i[5]=u,i[6]=h,i[7]=m,i):(i[0]=o,i[1]=l,i[2]=c,i[3]=a,i[4]=u,i[5]=h,i)):s?(p=p||0,m=m||0,i[0]=o,i[1]=l,i[2]=p,i[3]=a,i[4]=u,i[5]=m,i):(i[0]=o,i[1]=l,i[2]=a,i[3]=u,i)}function Pze(i,e,t,r,n,s){const o=t?3:2,a=r&&s,l=t&&n;if(!e.length||!e[0].length)return null;let u,c,h,p,[m,v]=e[0],[w,S]=e[0];for(let I=0;I2){const B=R[2];u=Q5(u,B),c=eF(c,B)}if(a&&R.length>o){const B=R[o];h=Q5(u,B),p=eF(c,B)}}return n?(u=u||0,c=c||0,s?(h=h||0,p=p||0,i[0]=m,i[1]=v,i[2]=u,i[3]=h,i[4]=w,i[5]=S,i[6]=c,i[7]=p,i):(i[0]=m,i[1]=v,i[2]=u,i[3]=w,i[4]=S,i[5]=c,i)):s?(h=h||0,p=p||0,i[0]=m,i[1]=v,i[2]=h,i[3]=w,i[4]=S,i[5]=p,i):(i[0]=m,i[1]=v,i[2]=w,i[3]=S,i)}function jXi(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function GXi(i){return i.points!==void 0}function UXi(i){return i.x!==void 0&&i.y!==void 0}function zXi(i){return i.paths!==void 0}function VXi(i){return i.rings!==void 0}const Rze=[];function SIt(i,e,t,r){return{xmin:i,ymin:e,xmax:t,ymax:r}}function TIt(i,e,t,r,n,s){return{xmin:i,ymin:e,zmin:t,xmax:r,ymax:n,zmax:s}}function CIt(i,e,t,r,n,s){return{xmin:i,ymin:e,mmin:t,xmax:r,ymax:n,mmax:s}}function EIt(i,e,t,r,n,s,o,a){return{xmin:i,ymin:e,zmin:t,mmin:r,xmax:n,ymax:s,zmax:o,mmax:a}}function Dze(i,e=!1,t=!1){return e?t?EIt(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]):TIt(i[0],i[1],i[2],i[3],i[4],i[5]):t?CIt(i[0],i[1],i[2],i[3],i[4],i[5]):SIt(i[0],i[1],i[2],i[3])}function I5e(i){return i?jXi(i)?i:UXi(i)?WXi(i):VXi(i)?Fze(i):zXi(i)?IIt(i):GXi(i)?HXi(i):null:null}function HXi(i){const{hasZ:e,hasM:t,points:r}=i;return Dze(Pze(Rze,r,e??!1,t??!1),e,t)}function WXi(i){const{x:e,y:t,z:r,m:n}=i,s=n!=null;return r!=null?s?EIt(e,t,r,n,e,t,r,n):TIt(e,t,r,e,t,r):s?CIt(e,t,n,e,t,n):SIt(e,t,e,t)}function Fze(i){const{hasZ:e,hasM:t,rings:r}=i,n=hW(Rze,r,e??!1,t??!1);return n?Dze(n,e,t):null}function IIt(i){const{hasZ:e,hasM:t,paths:r}=i,n=hW(Rze,r,e??!1,t??!1);return n?Dze(n,e,t):null}var Xfe;function Lrt(i){return!Array.isArray(i[0])}let lI=Xfe=class extends Nr{static fromExtent(i){const e=i.clone().normalize(),t=i.spatialReference;let r=!1,n=!1;for(const o of e)o.hasZ&&(r=!0),o.hasM&&(n=!0);const s={rings:e.map(o=>{const a=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(r&&o.hasZ){const l=o.zmin+.5*(o.zmax-o.zmin);for(let u=0;u2,r=s.length>3):t===void 0?t=r?s.length>3:s.length>2:r===void 0&&(r=t?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:t,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const i=p2e(this);if(!i||isNaN(i[0])||isNaN(i[1])||this.hasZ&&isNaN(i[2]))return null;const e=new $i;return e.x=i[0],e.y=i[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=i[2]),e}get extent(){const{spatialReference:i}=this,e=Fze(this);if(!e)return null;const t=new hr(e);return t.spatialReference=i,t}get isSelfIntersecting(){return fYi(this.rings)}writeRings(i,e){e.rings=li(this.rings)}addRing(i){if(!i)return;const e=this.rings,t=e.length;if(Lrt(i)){const r=[];for(let n=0,s=i.length;nn===l&&s===u&&(o==null&&c==null||o===c)&&(a==null&&h==null||a===h);for(let n=0;nthis.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y]):i,q8(e)}getPoint(i,e){if(!this._validateInputs(i,e))return null;const t=this.rings[i][e],r=this.hasZ,n=this.hasM;return r&&!n?new $i(t[0],t[1],t[2],void 0,this.spatialReference):n&&!r?new $i(t[0],t[1],void 0,t[2],this.spatialReference):r&&n?new $i(t[0],t[1],t[2],t[3],this.spatialReference):new $i(t[0],t[1],this.spatialReference)}insertPoint(i,e,t){return this._validateInputs(i,e,!0)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.rings[i].splice(e,0,t),this.notifyChange("rings"),this):this}removePoint(i,e){if(!this._validateInputs(i,e))return null;const t=new $i(this.rings[i].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),t}removeRing(i){if(!this._validateInputs(i,null))return null;const e=this.rings.splice(i,1)[0],t=this.spatialReference,r=e.map(n=>new $i(n,t));return this.notifyChange("rings"),r}setPoint(i,e,t){return this._validateInputs(i,e)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.rings[i][e]=t,this.notifyChange("rings"),this):this}_validateInputs(i,e,t=!1){if(i==null||i<0||i>=this.rings.length)return!1;if(e!=null){const r=this.rings[i];if(t&&(e<0||e>r.length)||!t&&(e<0||e>=r.length))return!1}return!0}toJSON(i){return this.write({},i)}};x([D({readOnly:!0})],lI.prototype,"cache",null),x([D({readOnly:!0})],lI.prototype,"centroid",null),x([D({readOnly:!0})],lI.prototype,"extent",null),x([D({readOnly:!0})],lI.prototype,"isSelfIntersecting",null),x([D({type:[[[Number]]],json:{write:{isRequired:!0}}})],lI.prototype,"rings",void 0),x([ur("rings")],lI.prototype,"writeRings",null),lI=Xfe=x([Qe("esri.geometry.Polygon")],lI),lI.prototype.toJSON.isDefaultToJSON=!0;const $s=lI;var A5e;function qXi(i){return!Array.isArray(i[0])}let s4=A5e=class extends Nr{constructor(...i){super(...i),this.paths=[],this.type="polyline"}normalizeCtorArgs(i,e){let t,r,n=null,s=null;return i&&!Array.isArray(i)?(n=i.paths??null,e||(i.spatialReference?e=i.spatialReference:i.paths||(e=i)),t=i.hasZ,r=i.hasM):n=i,n=n||[],e=e||Xi.WGS84,n.length&&n[0]?.[0]!=null&&typeof n[0][0]=="number"&&(n=[n]),s=n[0]?.[0],s&&(t===void 0&&r===void 0?(t=s.length>2,r=!1):t===void 0?t=!r&&s.length>3:r===void 0&&(r=!t&&s.length>3)),{paths:n,spatialReference:e,hasZ:t,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:i}=this,e=IIt(this);if(!e)return null;const t=new hr(e);return t.spatialReference=i,t}writePaths(i,e){e.paths=li(this.paths)}addPath(i){if(!i)return;const e=this.paths,t=e.length;if(qXi(i)){const r=[];for(let n=0,s=i.length;nnew $i(n,t));return this.notifyChange("paths"),r}removePoint(i,e){if(!this._validateInputs(i,e))return null;const t=new $i(this.paths[i].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),t}setPoint(i,e,t){return this._validateInputs(i,e)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.paths[i][e]=t,this.notifyChange("paths"),this):this}_validateInputs(i,e,t=!1){if(i==null||i<0||i>=this.paths.length)return!1;if(e!=null){const r=this.paths[i];if(t&&(e<0||e>r.length)||!t&&(e<0||e>=r.length))return!1}return!0}toJSON(i){return this.write({},i)}};x([D({readOnly:!0})],s4.prototype,"cache",null),x([D({readOnly:!0})],s4.prototype,"extent",null),x([D({type:[[[Number]]],json:{write:{isRequired:!0}}})],s4.prototype,"paths",void 0),x([ur("paths")],s4.prototype,"writePaths",null),s4=A5e=x([Qe("esri.geometry.Polyline")],s4),s4.prototype.toJSON.isDefaultToJSON=!0;const lo=s4;function zd(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function xF(i){return i.points!==void 0}function dR(i){return i.x!==void 0&&i.y!==void 0}function e0(i){return i.paths!==void 0}function ed(i){return i.rings!==void 0}function Ro(i){return i==null?null:i instanceof Nr?i:dR(i)?$i.fromJSON(i):e0(i)?lo.fromJSON(i):ed(i)?$s.fromJSON(i):xF(i)?Oh.fromJSON(i):zd(i)?hr.fromJSON(i):null}function ah(i){return i?dR(i)?"esriGeometryPoint":e0(i)?"esriGeometryPolyline":ed(i)?"esriGeometryPolygon":zd(i)?"esriGeometryEnvelope":xF(i)?"esriGeometryMultipoint":null:null}const YXi={esriGeometryPoint:$i,esriGeometryPolyline:lo,esriGeometryPolygon:$s,esriGeometryEnvelope:hr,esriGeometryMultipoint:Oh};function XXi(i){return i&&YXi[i]||null}const Vp=pa()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),Yve=pa()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),Ff={base:Nr,key:"type",typeMap:{extent:hr,multipoint:Oh,point:$i,polyline:lo,polygon:$s}};u3(Ff);const xs=i=>{let e=class extends i{clone(){const t=Kp(this);Of(t,"unable to clone instance of non-accessor class");const r=t.metadata,n=t.store,s={},o=new Map;for(const l in r){const u=r[l],c=n?.originOf(l),h=u.clonable;if(u.readOnly||h===!1||c!==Pn.USER&&c!==Pn.DEFAULTS&&c!==Pn.WEB_MAP&&c!==Pn.WEB_SCENE)continue;const p=this[l];let m=null;m=typeof h=="function"?h(p):h==="reference"?p:F4e(p),p!=null&&m==null||(c===Pn.DEFAULTS?o.set(l,m):s[l]=m)}const a=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const l=Kp(a)?.store;if(l)for(const[u,c]of o)l.set(u,c,Pn.DEFAULTS)}return a}};return e=x([Qe("esri.core.Clonable")],e),e};let qF=class extends xs(un){};qF=x([Qe("esri.core.Clonable")],qF);async function Ine(i,e){const{WhereClause:t}=await Promise.resolve().then(()=>L6r);return t.create(i,e)}function PS(i,e){return i!=null&&i!==""?e!=null&&e!==""?`(${i}) AND (${e})`:i:e}const Nrt=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);class WB extends Error{}class JXi extends WB{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class KXi extends WB{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ZXi extends WB{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Rz extends WB{}class AIt extends WB{constructor(e){super(`Invalid unit ${e}`)}}class cb extends WB{}class gD extends WB{constructor(){super("Zone is an abstract class")}}const fs="numeric",vE="short",yx="long",Xve={year:fs,month:fs,day:fs},MIt={year:fs,month:vE,day:fs},QXi={year:fs,month:vE,day:fs,weekday:vE},OIt={year:fs,month:yx,day:fs},PIt={year:fs,month:yx,day:fs,weekday:yx},RIt={hour:fs,minute:fs},DIt={hour:fs,minute:fs,second:fs},FIt={hour:fs,minute:fs,second:fs,timeZoneName:vE},kIt={hour:fs,minute:fs,second:fs,timeZoneName:yx},LIt={hour:fs,minute:fs,hourCycle:"h23"},NIt={hour:fs,minute:fs,second:fs,hourCycle:"h23"},$It={hour:fs,minute:fs,second:fs,hourCycle:"h23",timeZoneName:vE},BIt={hour:fs,minute:fs,second:fs,hourCycle:"h23",timeZoneName:yx},jIt={year:fs,month:fs,day:fs,hour:fs,minute:fs},GIt={year:fs,month:fs,day:fs,hour:fs,minute:fs,second:fs},UIt={year:fs,month:vE,day:fs,hour:fs,minute:fs},zIt={year:fs,month:vE,day:fs,hour:fs,minute:fs,second:fs},eJi={year:fs,month:vE,day:fs,weekday:vE,hour:fs,minute:fs},VIt={year:fs,month:yx,day:fs,hour:fs,minute:fs,timeZoneName:vE},HIt={year:fs,month:yx,day:fs,hour:fs,minute:fs,second:fs,timeZoneName:vE},WIt={year:fs,month:yx,day:fs,weekday:yx,hour:fs,minute:fs,timeZoneName:yx},qIt={year:fs,month:yx,day:fs,weekday:yx,hour:fs,minute:fs,second:fs,timeZoneName:yx};class zk{get type(){throw new gD}get name(){throw new gD}get ianaName(){return this.name}get isUniversal(){throw new gD}offsetName(e,t){throw new gD}formatOffset(e,t){throw new gD}offset(e){throw new gD}equals(e){throw new gD}get isValid(){throw new gD}}let n3e=null;class m2e extends zk{static get instance(){return n3e===null&&(n3e=new m2e),n3e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return iAt(e,t,r)}formatOffset(e,t){return bie(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Jfe={};function tJi(i){return Jfe[i]||(Jfe[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Jfe[i]}const iJi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function rJi(i,e){const t=i.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,n,s,o,a,l,u,c]=r;return[o,n,s,a,l,u,c]}function nJi(i,e){const t=i.formatToParts(e),r=[];for(let n=0;n=0?v:1e3+v,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let $rt={};function sJi(i,e={}){const t=JSON.stringify([i,e]);let r=$rt[t];return r||(r=new Intl.ListFormat(i,e),$rt[t]=r),r}let M5e={};function O5e(i,e={}){const t=JSON.stringify([i,e]);let r=M5e[t];return r||(r=new Intl.DateTimeFormat(i,e),M5e[t]=r),r}let P5e={};function oJi(i,e={}){const t=JSON.stringify([i,e]);let r=P5e[t];return r||(r=new Intl.NumberFormat(i,e),P5e[t]=r),r}let R5e={};function aJi(i,e={}){const{base:t,...r}=e,n=JSON.stringify([i,r]);let s=R5e[n];return s||(s=new Intl.RelativeTimeFormat(i,e),R5e[n]=s),s}let WZ=null;function lJi(){return WZ||(WZ=new Intl.DateTimeFormat().resolvedOptions().locale,WZ)}let Brt={};function uJi(i){let e=Brt[i];if(!e){const t=new Intl.Locale(i);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,Brt[i]=e}return e}function cJi(i){const e=i.indexOf("-x-");e!==-1&&(i=i.substring(0,e));const t=i.indexOf("-u-");if(t===-1)return[i];{let r,n;try{r=O5e(i).resolvedOptions(),n=i}catch{const l=i.substring(0,t);r=O5e(l).resolvedOptions(),n=l}const{numberingSystem:s,calendar:o}=r;return[n,s,o]}}function hJi(i,e,t){return(t||e)&&(i.includes("-u-")||(i+="-u"),t&&(i+=`-ca-${t}`),e&&(i+=`-nu-${e}`)),i}function dJi(i){const e=[];for(let t=1;t<=12;t++){const r=Sn.utc(2009,t,1);e.push(i(r))}return e}function pJi(i){const e=[];for(let t=1;t<=7;t++){const r=Sn.utc(2016,11,13+t);e.push(i(r))}return e}function Uce(i,e,t,r){const n=i.listingMode();return n==="error"?null:n==="en"?t(e):r(e)}function fJi(i){return i.numberingSystem&&i.numberingSystem!=="latn"?!1:i.numberingSystem==="latn"||!i.locale||i.locale.startsWith("en")||new Intl.DateTimeFormat(i.intl).resolvedOptions().numberingSystem==="latn"}class mJi{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...o}=r;if(!t||Object.keys(o).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=oJi(e,a)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):$ze(e,3);return cm(t,this.padTo)}}}class gJi{constructor(e,t,r){this.opts=r,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&$b.create(a).valid?(n=a,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=O5e(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:r}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class yJi{constructor(e,t,r){this.opts={style:"long",...r},!t&&eAt()&&(this.rtf=aJi(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):NJi(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const vJi={firstDay:1,minimalDays:4,weekend:[6,7]};class mh{static fromOpts(e){return mh.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){const o=e||df.defaultLocale,a=o||(s?"en-US":lJi()),l=t||df.defaultNumberingSystem,u=r||df.defaultOutputCalendar,c=D5e(n)||df.defaultWeekSettings;return new mh(a,l,u,c,o)}static resetCache(){WZ=null,M5e={},P5e={},R5e={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return mh.create(e,t,r,n)}constructor(e,t,r,n,s){const[o,a,l]=cJi(e);this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||l||null,this.weekSettings=n,this.intl=hJi(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=fJi(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:mh.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,D5e(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Uce(this,e,sAt,()=>{const r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=dJi(s=>this.extract(s,r,"month"))),this.monthsCache[n][e]})}weekdays(e,t=!1){return Uce(this,e,lAt,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=pJi(s=>this.extract(s,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return Uce(this,void 0,()=>uAt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Sn.utc(2016,11,13,9),Sn.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Uce(this,e,cAt,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Sn.utc(-40,1,1),Sn.utc(2017,1,1)].map(r=>this.extract(r,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t),s=n.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new mJi(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new gJi(e,this.intl,t)}relFormatter(e={}){return new yJi(this.intl,this.isEnglish(),e)}listFormatter(e={}){return sJi(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tAt()?uJi(this.locale):vJi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let s3e=null;class If extends zk{static get utcInstance(){return s3e===null&&(s3e=new If(0)),s3e}static instance(e){return e===0?If.utcInstance:new If(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new If(v2e(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${bie(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${bie(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return bie(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class _Ji extends zk{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function L5(i,e){if(tl(i)||i===null)return e;if(i instanceof zk)return i;if(xJi(i)){const t=i.toLowerCase();return t==="default"?e:t==="local"||t==="system"?m2e.instance:t==="utc"||t==="gmt"?If.utcInstance:If.parseSpecifier(t)||$b.create(i)}else return Y8(i)?If.instance(i):typeof i=="object"&&"offset"in i&&typeof i.offset=="function"?i:new _Ji(i)}let jrt=()=>Date.now(),Grt="system",Urt=null,zrt=null,Vrt=null,Hrt=60,Wrt,qrt=null;class df{static get now(){return jrt}static set now(e){jrt=e}static set defaultZone(e){Grt=e}static get defaultZone(){return L5(Grt,m2e.instance)}static get defaultLocale(){return Urt}static set defaultLocale(e){Urt=e}static get defaultNumberingSystem(){return zrt}static set defaultNumberingSystem(e){zrt=e}static get defaultOutputCalendar(){return Vrt}static set defaultOutputCalendar(e){Vrt=e}static get defaultWeekSettings(){return qrt}static set defaultWeekSettings(e){qrt=D5e(e)}static get twoDigitCutoffYear(){return Hrt}static set twoDigitCutoffYear(e){Hrt=e%100}static get throwOnInvalid(){return Wrt}static set throwOnInvalid(e){Wrt=e}static resetCaches(){mh.resetCache(),$b.resetCache()}}class $C{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const YIt=[0,31,59,90,120,151,181,212,243,273,304,334],XIt=[0,31,60,91,121,152,182,213,244,274,305,335];function cS(i,e){return new $C("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${i}, which is invalid`)}function kze(i,e,t){const r=new Date(Date.UTC(i,e-1,t));i<100&&i>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return n===0?7:n}function JIt(i,e,t){return t+(lae(i)?XIt:YIt)[e-1]}function KIt(i,e){const t=lae(i)?XIt:YIt,r=t.findIndex(s=>sAne(r,e,t)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,..._2e(i)}}function Yrt(i,e=4,t=1){const{weekYear:r,weekNumber:n,weekday:s}=i,o=Lze(kze(r,1,e),t),a=LV(r);let l=n*7+s-o-7+e,u;l<1?(u=r-1,l+=LV(u)):l>a?(u=r+1,l-=LV(r)):u=r;const{month:c,day:h}=KIt(u,l);return{year:u,month:c,day:h,..._2e(i)}}function o3e(i){const{year:e,month:t,day:r}=i,n=JIt(e,t,r);return{year:e,ordinal:n,..._2e(i)}}function Xrt(i){const{year:e,ordinal:t}=i,{month:r,day:n}=KIt(e,t);return{year:e,month:r,day:n,..._2e(i)}}function Jrt(i,e){if(!tl(i.localWeekday)||!tl(i.localWeekNumber)||!tl(i.localWeekYear)){if(!tl(i.weekday)||!tl(i.weekNumber)||!tl(i.weekYear))throw new Rz("Cannot mix locale-based week fields with ISO-based week fields");return tl(i.localWeekday)||(i.weekday=i.localWeekday),tl(i.localWeekNumber)||(i.weekNumber=i.localWeekNumber),tl(i.localWeekYear)||(i.weekYear=i.localWeekYear),delete i.localWeekday,delete i.localWeekNumber,delete i.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function bJi(i,e=4,t=1){const r=g2e(i.weekYear),n=hS(i.weekNumber,1,Ane(i.weekYear,e,t)),s=hS(i.weekday,1,7);return r?n?s?!1:cS("weekday",i.weekday):cS("week",i.weekNumber):cS("weekYear",i.weekYear)}function wJi(i){const e=g2e(i.year),t=hS(i.ordinal,1,LV(i.year));return e?t?!1:cS("ordinal",i.ordinal):cS("year",i.year)}function ZIt(i){const e=g2e(i.year),t=hS(i.month,1,12),r=hS(i.day,1,Kve(i.year,i.month));return e?t?r?!1:cS("day",i.day):cS("month",i.month):cS("year",i.year)}function QIt(i){const{hour:e,minute:t,second:r,millisecond:n}=i,s=hS(e,0,23)||e===24&&t===0&&r===0&&n===0,o=hS(t,0,59),a=hS(r,0,59),l=hS(n,0,999);return s?o?a?l?!1:cS("millisecond",n):cS("second",r):cS("minute",t):cS("hour",e)}function tl(i){return typeof i>"u"}function Y8(i){return typeof i=="number"}function g2e(i){return typeof i=="number"&&i%1===0}function xJi(i){return typeof i=="string"}function SJi(i){return Object.prototype.toString.call(i)==="[object Date]"}function eAt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tAt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function TJi(i){return Array.isArray(i)?i:[i]}function Krt(i,e,t){if(i.length!==0)return i.reduce((r,n)=>{const s=[e(n),n];return r&&t(r[0],s[0])===r[0]?r:s},null)[1]}function CJi(i,e){return e.reduce((t,r)=>(t[r]=i[r],t),{})}function dW(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function D5e(i){if(i==null)return null;if(typeof i!="object")throw new cb("Week settings must be an object");if(!hS(i.firstDay,1,7)||!hS(i.minimalDays,1,7)||!Array.isArray(i.weekend)||i.weekend.some(e=>!hS(e,1,7)))throw new cb("Invalid week settings");return{firstDay:i.firstDay,minimalDays:i.minimalDays,weekend:Array.from(i.weekend)}}function hS(i,e,t){return g2e(i)&&i>=e&&i<=t}function EJi(i,e){return i-e*Math.floor(i/e)}function cm(i,e=2){const t=i<0;let r;return t?r="-"+(""+-i).padStart(e,"0"):r=(""+i).padStart(e,"0"),r}function h5(i){if(!(tl(i)||i===null||i===""))return parseInt(i,10)}function NL(i){if(!(tl(i)||i===null||i===""))return parseFloat(i)}function Nze(i){if(!(tl(i)||i===null||i==="")){const e=parseFloat("0."+i)*1e3;return Math.floor(e)}}function $ze(i,e,t=!1){const r=10**e;return(t?Math.trunc:Math.round)(i*r)/r}function lae(i){return i%4===0&&(i%100!==0||i%400===0)}function LV(i){return lae(i)?366:365}function Kve(i,e){const t=EJi(e-1,12)+1,r=i+(e-t)/12;return t===2?lae(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function y2e(i){let e=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond);return i.year<100&&i.year>=0&&(e=new Date(e),e.setUTCFullYear(i.year,i.month-1,i.day)),+e}function Zrt(i,e,t){return-Lze(kze(i,1,e),t)+e-1}function Ane(i,e=4,t=1){const r=Zrt(i,e,t),n=Zrt(i+1,e,t);return(LV(i)-r+n)/7}function F5e(i){return i>99?i:i>df.twoDigitCutoffYear?1900+i:2e3+i}function iAt(i,e,t,r=null){const n=new Date(i),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const o={timeZoneName:e,...s},a=new Intl.DateTimeFormat(t,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function v2e(i,e){let t=parseInt(i,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,n=t<0||Object.is(t,-0)?-r:r;return t*60+n}function rAt(i){const e=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(e))throw new cb(`Invalid unit value ${i}`);return e}function Zve(i,e){const t={};for(const r in i)if(dW(i,r)){const n=i[r];if(n==null)continue;t[e(r)]=rAt(n)}return t}function bie(i,e){const t=Math.trunc(Math.abs(i/60)),r=Math.trunc(Math.abs(i%60)),n=i>=0?"+":"-";switch(e){case"short":return`${n}${cm(t,2)}:${cm(r,2)}`;case"narrow":return`${n}${t}${r>0?`:${r}`:""}`;case"techie":return`${n}${cm(t,2)}${cm(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function _2e(i){return CJi(i,["hour","minute","second","millisecond"])}const IJi=["January","February","March","April","May","June","July","August","September","October","November","December"],nAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],AJi=["J","F","M","A","M","J","J","A","S","O","N","D"];function sAt(i){switch(i){case"narrow":return[...AJi];case"short":return[...nAt];case"long":return[...IJi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const oAt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],aAt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],MJi=["M","T","W","T","F","S","S"];function lAt(i){switch(i){case"narrow":return[...MJi];case"short":return[...aAt];case"long":return[...oAt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const uAt=["AM","PM"],OJi=["Before Christ","Anno Domini"],PJi=["BC","AD"],RJi=["B","A"];function cAt(i){switch(i){case"narrow":return[...RJi];case"short":return[...PJi];case"long":return[...OJi];default:return null}}function DJi(i){return uAt[i.hour<12?0:1]}function FJi(i,e){return lAt(e)[i.weekday-1]}function kJi(i,e){return sAt(e)[i.month-1]}function LJi(i,e){return cAt(e)[i.year<0?0:1]}function NJi(i,e,t="always",r=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(i)===-1;if(t==="auto"&&s){const h=i==="days";switch(e){case 1:return h?"tomorrow":`next ${n[i][0]}`;case-1:return h?"yesterday":`last ${n[i][0]}`;case 0:return h?"today":`this ${n[i][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=n[i],c=r?l?u[1]:u[2]||u[1]:l?n[i][0]:i;return o?`${a} ${c} ago`:`in ${a} ${c}`}function Qrt(i,e){let t="";for(const r of i)r.literal?t+=r.val:t+=e(r.val);return t}const $Ji={D:Xve,DD:MIt,DDD:OIt,DDDD:PIt,t:RIt,tt:DIt,ttt:FIt,tttt:kIt,T:LIt,TT:NIt,TTT:$It,TTTT:BIt,f:jIt,ff:UIt,fff:VIt,ffff:WIt,F:GIt,FF:zIt,FFF:HIt,FFFF:qIt};class Ov{static create(e,t={}){return new Ov(e,t)}static parseFormat(e){let t=null,r="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n||a===t?r+=a:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=a,t=a)}return r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return $Ji[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return cm(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,v)=>this.loc.extract(e,m,v),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",a=()=>r?DJi(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,v)=>r?kJi(e,m):s(v?{month:m}:{month:m,day:"numeric"},"month"),u=(m,v)=>r?FJi(e,m):s(v?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const v=Ov.macroTokenToFormatOpts(m);return v?this.formatWithSystemDefault(e,v):m},h=m=>r?LJi(e,m):s({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return Qrt(Ov.parseFormat(t),p)}formatDurationFromString(e,t){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>u=>{const c=r(u);return c?this.num(l.get(c),u.length):u},s=Ov.parseFormat(t),o=s.reduce((l,{literal:u,val:c})=>u?l:l.concat(c),[]),a=e.shiftTo(...o.map(r).filter(l=>l));return Qrt(s,n(a))}}const hAt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yY(...i){const e=i.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function vY(...i){return e=>i.reduce(([t,r,n],s)=>{const[o,a,l]=s(e,n);return[{...t,...o},a||r,l]},[{},null,1]).slice(0,2)}function _Y(i,...e){if(i==null)return[null,null];for(const[t,r]of e){const n=t.exec(i);if(n)return r(n)}return[null,null]}function dAt(...i){return(e,t)=>{const r={};let n;for(n=0;nm!==void 0&&(v||m&&c)?-m:m;return[{years:p(NL(t)),months:p(NL(r)),weeks:p(NL(n)),days:p(NL(s)),hours:p(NL(o)),minutes:p(NL(a)),seconds:p(NL(l),l==="-0"),milliseconds:p(Nze(u),h)}]}const KJi={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Gze(i,e,t,r,n,s,o){const a={year:e.length===2?F5e(h5(e)):h5(e),month:nAt.indexOf(t)+1,day:h5(r),hour:h5(n),minute:h5(s)};return o&&(a.second=h5(o)),i&&(a.weekday=i.length>3?oAt.indexOf(i)+1:aAt.indexOf(i)+1),a}const ZJi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function QJi(i){const[,e,t,r,n,s,o,a,l,u,c,h]=i,p=Gze(e,n,r,t,s,o,a);let m;return l?m=KJi[l]:u?m=0:m=v2e(c,h),[p,new If(m)]}function eKi(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const tKi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,iKi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,rKi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ent(i){const[,e,t,r,n,s,o,a]=i;return[Gze(e,n,r,t,s,o,a),If.utcInstance]}function nKi(i){const[,e,t,r,n,s,o,a]=i;return[Gze(e,a,t,r,n,s,o),If.utcInstance]}const sKi=yY(jJi,jze),oKi=yY(GJi,jze),aKi=yY(UJi,jze),lKi=yY(fAt),gAt=vY(qJi,bY,uae,cae),uKi=vY(zJi,bY,uae,cae),cKi=vY(VJi,bY,uae,cae),hKi=vY(bY,uae,cae);function dKi(i){return _Y(i,[sKi,gAt],[oKi,uKi],[aKi,cKi],[lKi,hKi])}function pKi(i){return _Y(eKi(i),[ZJi,QJi])}function fKi(i){return _Y(i,[tKi,ent],[iKi,ent],[rKi,nKi])}function mKi(i){return _Y(i,[XJi,JJi])}const gKi=vY(bY);function yKi(i){return _Y(i,[YJi,gKi])}const vKi=yY(HJi,WJi),_Ki=yY(mAt),bKi=vY(bY,uae,cae);function wKi(i){return _Y(i,[vKi,gAt],[_Ki,bKi])}const tnt="Invalid Duration",yAt={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},xKi={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...yAt},l2=146097/400,aj=146097/4800,SKi={years:{quarters:4,months:12,weeks:l2/7,days:l2,hours:l2*24,minutes:l2*24*60,seconds:l2*24*60*60,milliseconds:l2*24*60*60*1e3},quarters:{months:3,weeks:l2/28,days:l2/4,hours:l2*24/4,minutes:l2*24*60/4,seconds:l2*24*60*60/4,milliseconds:l2*24*60*60*1e3/4},months:{weeks:aj/7,days:aj,hours:aj*24,minutes:aj*24*60,seconds:aj*24*60*60,milliseconds:aj*24*60*60*1e3},...yAt},n8=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],TKi=n8.slice(0).reverse();function yD(i,e,t=!1){const r={values:t?e.values:{...i.values,...e.values||{}},loc:i.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||i.conversionAccuracy,matrix:e.matrix||i.matrix};return new tc(r)}function vAt(i,e){let t=e.milliseconds??0;for(const r of TKi.slice(1))e[r]&&(t+=e[r]*i[r].milliseconds);return t}function int(i,e){const t=vAt(i,e)<0?-1:1;n8.reduceRight((r,n)=>{if(tl(e[n]))return r;if(r){const s=e[r]*t,o=i[n][r],a=Math.floor(s/o);e[n]+=a*t,e[r]-=a*o*t}return n},null),n8.reduce((r,n)=>{if(tl(e[n]))return r;if(r){const s=e[r]%1;e[r]-=s,e[n]+=s*i[r][n]}return n},null)}function CKi(i){const e={};for(const[t,r]of Object.entries(i))r!==0&&(e[t]=r);return e}class tc{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let r=t?SKi:xKi;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||mh.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return tc.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new cb(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tc({values:Zve(e,tc.normalizeUnit),loc:mh.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Y8(e))return tc.fromMillis(e);if(tc.isDuration(e))return e;if(typeof e=="object")return tc.fromObject(e);throw new cb(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=mKi(e);return r?tc.fromObject(r,t):tc.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=yKi(e);return r?tc.fromObject(r,t):tc.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new cb("need to specify a reason the Duration is invalid");const r=e instanceof $C?e:new $C(e,t);if(df.throwOnInvalid)throw new ZXi(r);return new tc({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new AIt(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?Ov.create(this.loc,r).formatDurationFromString(this,e):tnt}toHuman(e={}){if(!this.isValid)return tnt;const t=n8.map(r=>{const n=this.values[r];return tl(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=$ze(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Sn.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?vAt(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e),r={};for(const n of n8)(dW(t.values,n)||dW(this.values,n))&&(r[n]=t.get(n)+this.get(n));return yD(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=rAt(e(this.values[r],r));return yD(this,{values:t},!0)}get(e){return this[tc.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Zve(e,tc.normalizeUnit)};return yD(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r};return yD(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return int(this.matrix,e),yD(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=CKi(this.normalize().shiftToAll().toObject());return yD(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>tc.normalizeUnit(o));const t={},r={},n=this.toObject();let s;for(const o of n8)if(e.indexOf(o)>=0){s=o;let a=0;for(const u in r)a+=this.matrix[u][o]*r[u],r[u]=0;Y8(n[o])&&(a+=n[o]);const l=Math.trunc(a);t[o]=l,r[o]=(a*1e3-l*1e3)/1e3}else Y8(n[o])&&(r[o]=n[o]);for(const o in r)r[o]!==0&&(t[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return int(this.matrix,t),yD(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yD(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(r,n){return r===void 0||r===0?n===void 0||n===0:r===n}for(const r of n8)if(!t(this.values[r],e.values[r]))return!1;return!0}}const lj="Invalid Interval";function EKi(i,e){return!i||!i.isValid?$p.invalid("missing or invalid start"):!e||!e.isValid?$p.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?$p.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(TJ).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),r=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;r.push($p.fromDateTimes(n,a)),n=a,s+=1}return r}splitBy(e){const t=tc.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,n=1,s;const o=[];for(;rl*n));s=+a>+this.e?this.e:a,o.push($p.fromDateTimes(r,s)),r=s,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e=r?null:$p.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return $p.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((n,s)=>n.s-s.s).reduce(([n,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[n,s.union(o)]:[n.concat([s]),o]:[n,o],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],s=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...s),a=o.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?t=l.time:(t&&+t!=+l.time&&n.push($p.fromDateTimes(t,l.time)),t=null);return $p.merge(n)}difference(...e){return $p.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:lj}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Xve,t={}){return this.isValid?Ov.create(this.s.loc.clone(t),e).formatInterval(this):lj}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:lj}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:lj}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:lj}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:lj}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):tc.invalid(this.invalidReason)}mapEndpoints(e){return $p.fromDateTimes(e(this.s),e(this.e))}}class zce{static hasDST(e=df.defaultZone){const t=Sn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $b.isValidZone(e)}static normalizeZone(e){return L5(e,df.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||mh.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||mh.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||mh.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||mh.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mh.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mh.create(t,null,"gregory").eras(e)}static features(){return{relative:eAt(),localeWeek:tAt()}}}function rnt(i,e){const t=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(i);return Math.floor(tc.fromMillis(r).as("days"))}function IKi(i,e,t){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=rnt(l,u);return(c-c%7)/7}],["days",rnt]],n={},s=i;let o,a;for(const[l,u]of r)t.indexOf(l)>=0&&(o=l,n[l]=u(i,e),a=s.plus(n),a>e?(n[l]--,i=s.plus(n),i>e&&(a=i,n[l]--,i=s.plus(n))):i=a);return[i,n,a,o]}function AKi(i,e,t,r){let[n,s,o,a]=IKi(i,e,t);const l=e-n,u=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);u.length===0&&(o0?tc.fromMillis(l,r).shiftTo(...u).plus(c):c}const Uze={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},nnt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},MKi=Uze.hanidec.replace(/[\[|\]]/g,"").split("");function OKi(i){let e=parseInt(i,10);if(isNaN(e)){e="";for(let t=0;t=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}function dT({numberingSystem:i},e=""){return new RegExp(`${Uze[i||"latn"]}${e}`)}const PKi="missing Intl.DateTimeFormat.formatToParts support";function Ic(i,e=t=>t){return{regex:i,deser:([t])=>e(OKi(t))}}const RKi=" ",_At=`[ ${RKi}]`,bAt=new RegExp(_At,"g");function DKi(i){return i.replace(/\./g,"\\.?").replace(bAt,_At)}function snt(i){return i.replace(/\./g,"").replace(bAt," ").toLowerCase()}function pT(i,e){return i===null?null:{regex:RegExp(i.map(DKi).join("|")),deser:([t])=>i.findIndex(r=>snt(t)===snt(r))+e}}function ont(i,e){return{regex:i,deser:([,t,r])=>v2e(t,r),groups:e}}function Vce(i){return{regex:i,deser:([e])=>e}}function FKi(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kKi(i,e){const t=dT(e),r=dT(e,"{2}"),n=dT(e,"{3}"),s=dT(e,"{4}"),o=dT(e,"{6}"),a=dT(e,"{1,2}"),l=dT(e,"{1,3}"),u=dT(e,"{1,6}"),c=dT(e,"{1,9}"),h=dT(e,"{2,4}"),p=dT(e,"{4,6}"),m=S=>({regex:RegExp(FKi(S.val)),deser:([I])=>I,literal:!0}),w=(S=>{if(i.literal)return m(S);switch(S.val){case"G":return pT(e.eras("short"),0);case"GG":return pT(e.eras("long"),0);case"y":return Ic(u);case"yy":return Ic(h,F5e);case"yyyy":return Ic(s);case"yyyyy":return Ic(p);case"yyyyyy":return Ic(o);case"M":return Ic(a);case"MM":return Ic(r);case"MMM":return pT(e.months("short",!0),1);case"MMMM":return pT(e.months("long",!0),1);case"L":return Ic(a);case"LL":return Ic(r);case"LLL":return pT(e.months("short",!1),1);case"LLLL":return pT(e.months("long",!1),1);case"d":return Ic(a);case"dd":return Ic(r);case"o":return Ic(l);case"ooo":return Ic(n);case"HH":return Ic(r);case"H":return Ic(a);case"hh":return Ic(r);case"h":return Ic(a);case"mm":return Ic(r);case"m":return Ic(a);case"q":return Ic(a);case"qq":return Ic(r);case"s":return Ic(a);case"ss":return Ic(r);case"S":return Ic(l);case"SSS":return Ic(n);case"u":return Vce(c);case"uu":return Vce(a);case"uuu":return Ic(t);case"a":return pT(e.meridiems(),0);case"kkkk":return Ic(s);case"kk":return Ic(h,F5e);case"W":return Ic(a);case"WW":return Ic(r);case"E":case"c":return Ic(t);case"EEE":return pT(e.weekdays("short",!1),1);case"EEEE":return pT(e.weekdays("long",!1),1);case"ccc":return pT(e.weekdays("short",!0),1);case"cccc":return pT(e.weekdays("long",!0),1);case"Z":case"ZZ":return ont(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return ont(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Vce(/[a-z_+-/]{1,256}?/i);case" ":return Vce(/[^\S\n\r]/);default:return m(S)}})(i)||{invalidReason:PKi};return w.token=i,w}const LKi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function NKi(i,e,t){const{type:r,value:n}=i;if(r==="literal"){const l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}const s=e[r];let o=r;r==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let a=LKi[o];if(typeof a=="object"&&(a=a[s]),a)return{literal:!1,val:a}}function $Ki(i){return[`^${i.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,i]}function BKi(i,e,t){const r=i.match(e);if(r){const n={};let s=1;for(const o in t)if(dW(t,o)){const a=t[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(r.slice(s,s+l))),s+=l}return[r,n]}else return[r,{}]}function jKi(i){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,r;return tl(i.z)||(t=$b.create(i.z)),tl(i.Z)||(t||(t=new If(i.Z)),r=i.Z),tl(i.q)||(i.M=(i.q-1)*3+1),tl(i.h)||(i.h<12&&i.a===1?i.h+=12:i.h===12&&i.a===0&&(i.h=0)),i.G===0&&i.y&&(i.y=-i.y),tl(i.u)||(i.S=Nze(i.u)),[Object.keys(i).reduce((s,o)=>{const a=e(o);return a&&(s[a]=i[o]),s},{}),t,r]}let a3e=null;function GKi(){return a3e||(a3e=Sn.fromMillis(1555555555555)),a3e}function UKi(i,e){if(i.literal)return i;const t=Ov.macroTokenToFormatOpts(i.val),r=SAt(t,e);return r==null||r.includes(void 0)?i:r}function wAt(i,e){return Array.prototype.concat(...i.map(t=>UKi(t,e)))}function xAt(i,e,t){const r=wAt(Ov.parseFormat(t),i),n=r.map(o=>kKi(o,i)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:r,invalidReason:s.invalidReason};{const[o,a]=$Ki(n),l=RegExp(o,"i"),[u,c]=BKi(e,l,a),[h,p,m]=c?jKi(c):[null,null,void 0];if(dW(c,"a")&&dW(c,"H"))throw new Rz("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:u,matches:c,result:h,zone:p,specificOffset:m}}}function zKi(i,e,t){const{result:r,zone:n,specificOffset:s,invalidReason:o}=xAt(i,e,t);return[r,n,s,o]}function SAt(i,e){if(!i)return null;const r=Ov.create(e,i).dtFormatter(GKi()),n=r.formatToParts(),s=r.resolvedOptions();return n.map(o=>NKi(o,i,s))}const l3e="Invalid DateTime",ant=864e13;function Hce(i){return new $C("unsupported zone",`the zone "${i.name}" is not supported`)}function u3e(i){return i.weekData===null&&(i.weekData=Jve(i.c)),i.weekData}function c3e(i){return i.localWeekData===null&&(i.localWeekData=Jve(i.c,i.loc.getMinDaysInFirstWeek(),i.loc.getStartOfWeek())),i.localWeekData}function $L(i,e){const t={ts:i.ts,zone:i.zone,c:i.c,o:i.o,loc:i.loc,invalid:i.invalid};return new Sn({...t,...e,old:t})}function TAt(i,e,t){let r=i-e*60*1e3;const n=t.offset(r);if(e===n)return[r,e];r-=(n-e)*60*1e3;const s=t.offset(r);return n===s?[r,n]:[i-Math.min(n,s)*60*1e3,Math.max(n,s)]}function Wce(i,e){i+=e*60*1e3;const t=new Date(i);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Kfe(i,e,t){return TAt(y2e(i),e,t)}function lnt(i,e){const t=i.o,r=i.c.year+Math.trunc(e.years),n=i.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...i.c,year:r,month:n,day:Math.min(i.c.day,Kve(r,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=tc.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=y2e(s);let[l,u]=TAt(a,t,i.zone);return o!==0&&(l+=o,u=i.zone.offset(l)),{ts:l,o:u}}function SJ(i,e,t,r,n,s){const{setZone:o,zone:a}=t;if(i&&Object.keys(i).length!==0||e){const l=e||a,u=Sn.fromObject(i,{...t,zone:l,specificOffset:s});return o?u:u.setZone(a)}else return Sn.invalid(new $C("unparsable",`the input "${n}" can't be parsed as ${r}`))}function qce(i,e,t=!0){return i.isValid?Ov.create(mh.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(i,e):null}function h3e(i,e){const t=i.c.year>9999||i.c.year<0;let r="";return t&&i.c.year>=0&&(r+="+"),r+=cm(i.c.year,t?6:4),e?(r+="-",r+=cm(i.c.month),r+="-",r+=cm(i.c.day)):(r+=cm(i.c.month),r+=cm(i.c.day)),r}function unt(i,e,t,r,n,s){let o=cm(i.c.hour);return e?(o+=":",o+=cm(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!t)&&(o+=":")):o+=cm(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!t)&&(o+=cm(i.c.second),(i.c.millisecond!==0||!r)&&(o+=".",o+=cm(i.c.millisecond,3))),n&&(i.isOffsetFixed&&i.offset===0&&!s?o+="Z":i.o<0?(o+="-",o+=cm(Math.trunc(-i.o/60)),o+=":",o+=cm(Math.trunc(-i.o%60))):(o+="+",o+=cm(Math.trunc(i.o/60)),o+=":",o+=cm(Math.trunc(i.o%60)))),s&&(o+="["+i.zone.ianaName+"]"),o}const CAt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},VKi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},HKi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},EAt=["year","month","day","hour","minute","second","millisecond"],WKi=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],qKi=["year","ordinal","hour","minute","second","millisecond"];function YKi(i){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[i.toLowerCase()];if(!e)throw new AIt(i);return e}function cnt(i){switch(i.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return YKi(i)}}function hnt(i,e){const t=L5(e.zone,df.defaultZone),r=mh.fromObject(e),n=df.now();let s,o;if(tl(i.year))s=n;else{for(const u of EAt)tl(i[u])&&(i[u]=CAt[u]);const a=ZIt(i)||QIt(i);if(a)return Sn.invalid(a);const l=t.offset(n);[s,o]=Kfe(i,l,t)}return new Sn({ts:s,zone:t,loc:r,o})}function dnt(i,e,t){const r=tl(t.round)?!0:t.round,n=(o,a)=>(o=$ze(o,r||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,a)),s=o=>t.calendary?e.hasSame(i,o)?0:e.startOf(o).diff(i.startOf(o),o).get(o):e.diff(i,o).get(o);if(t.unit)return n(s(t.unit),t.unit);for(const o of t.units){const a=s(o);if(Math.abs(a)>=1)return n(a,o)}return n(i>e?-0:0,t.units[t.units.length-1])}function pnt(i){let e={},t;return i.length>0&&typeof i[i.length-1]=="object"?(e=i[i.length-1],t=Array.from(i).slice(0,i.length-1)):t=Array.from(i),[e,t]}class Sn{constructor(e){const t=e.zone||df.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new $C("invalid input"):null)||(t.isValid?null:Hce(t));this.ts=tl(e.ts)?df.now():e.ts;let n=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,s]=[e.old.c,e.old.o];else{const a=t.offset(this.ts);n=Wce(this.ts,a),r=Number.isNaN(n.year)?new $C("invalid input"):null,n=r?null:n,s=r?null:a}this._zone=t,this.loc=e.loc||mh.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new Sn({})}static local(){const[e,t]=pnt(arguments),[r,n,s,o,a,l,u]=t;return hnt({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static utc(){const[e,t]=pnt(arguments),[r,n,s,o,a,l,u]=t;return e.zone=If.utcInstance,hnt({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,t={}){const r=SJi(e)?e.valueOf():NaN;if(Number.isNaN(r))return Sn.invalid("invalid input");const n=L5(t.zone,df.defaultZone);return n.isValid?new Sn({ts:r,zone:n,loc:mh.fromObject(t)}):Sn.invalid(Hce(n))}static fromMillis(e,t={}){if(Y8(e))return e<-ant||e>ant?Sn.invalid("Timestamp out of range"):new Sn({ts:e,zone:L5(t.zone,df.defaultZone),loc:mh.fromObject(t)});throw new cb(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Y8(e))return new Sn({ts:e*1e3,zone:L5(t.zone,df.defaultZone),loc:mh.fromObject(t)});throw new cb("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=L5(t.zone,df.defaultZone);if(!r.isValid)return Sn.invalid(Hce(r));const n=mh.fromObject(t),s=Zve(e,cnt),{minDaysInFirstWeek:o,startOfWeek:a}=Jrt(s,n),l=df.now(),u=tl(t.specificOffset)?r.offset(l):t.specificOffset,c=!tl(s.ordinal),h=!tl(s.year),p=!tl(s.month)||!tl(s.day),m=h||p,v=s.weekYear||s.weekNumber;if((m||c)&&v)throw new Rz("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new Rz("Can't mix ordinal dates with month/day");const w=v||s.weekday&&!m;let S,I,R=Wce(l,u);w?(S=WKi,I=VKi,R=Jve(R,o,a)):c?(S=qKi,I=HKi,R=o3e(R)):(S=EAt,I=CAt);let L=!1;for(const Q of S){const re=s[Q];tl(re)?L?s[Q]=I[Q]:s[Q]=R[Q]:L=!0}const k=w?bJi(s,o,a):c?wJi(s):ZIt(s),B=k||QIt(s);if(B)return Sn.invalid(B);const $=w?Yrt(s,o,a):c?Xrt(s):s,[V,Y]=Kfe($,u,r),K=new Sn({ts:V,zone:r,o:Y,loc:n});return s.weekday&&m&&e.weekday!==K.weekday?Sn.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${K.toISO()}`):K}static fromISO(e,t={}){const[r,n]=dKi(e);return SJ(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=pKi(e);return SJ(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=fKi(e);return SJ(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(tl(e)||tl(t))throw new cb("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,o=mh.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,l,u,c]=zKi(o,e,t);return c?Sn.invalid(c):SJ(a,l,r,`format ${t}`,e,u)}static fromString(e,t,r={}){return Sn.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=wKi(e);return SJ(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new cb("need to specify a reason the DateTime is invalid");const r=e instanceof $C?e:new $C(e,t);if(df.throwOnInvalid)throw new JXi(r);return new Sn({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=SAt(e,mh.fromObject(t));return r?r.map(n=>n?n.val:null).join(""):null}static expandFormat(e,t={}){return wAt(Ov.parseFormat(e),mh.fromObject(t)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?u3e(this).weekYear:NaN}get weekNumber(){return this.isValid?u3e(this).weekNumber:NaN}get weekday(){return this.isValid?u3e(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?c3e(this).weekday:NaN}get localWeekNumber(){return this.isValid?c3e(this).weekNumber:NaN}get localWeekYear(){return this.isValid?c3e(this).weekYear:NaN}get ordinal(){return this.isValid?o3e(this.c).ordinal:NaN}get monthShort(){return this.isValid?zce.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?zce.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?zce.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?zce.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=y2e(this.c),n=this.zone.offset(r-e),s=this.zone.offset(r+e),o=this.zone.offset(r-n*t),a=this.zone.offset(r-s*t);if(o===a)return[this];const l=r-o*t,u=r-a*t,c=Wce(l,o),h=Wce(u,a);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[$L(this,{ts:l}),$L(this,{ts:u})]:[this]}get isInLeapYear(){return lae(this.year)}get daysInMonth(){return Kve(this.year,this.month)}get daysInYear(){return this.isValid?LV(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ane(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ane(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Ov.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(If.instance(e),t)}toLocal(){return this.setZone(df.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if(e=L5(e,df.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const s=e.offset(this.ts),o=this.toObject();[n]=Kfe(o,s,e)}return $L(this,{ts:n,zone:e})}else return Sn.invalid(Hce(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){const n=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return $L(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Zve(e,cnt),{minDaysInFirstWeek:r,startOfWeek:n}=Jrt(t,this.loc),s=!tl(t.weekYear)||!tl(t.weekNumber)||!tl(t.weekday),o=!tl(t.ordinal),a=!tl(t.year),l=!tl(t.month)||!tl(t.day),u=a||l,c=t.weekYear||t.weekNumber;if((u||o)&&c)throw new Rz("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Rz("Can't mix ordinal dates with month/day");let h;s?h=Yrt({...Jve(this.c,r,n),...t},r,n):tl(t.ordinal)?(h={...this.toObject(),...t},tl(t.day)&&(h.day=Math.min(Kve(h.year,h.month),h.day))):h=Xrt({...o3e(this.c),...t});const[p,m]=Kfe(h,this.o,this.zone);return $L(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e);return $L(this,lnt(this,t))}minus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e).negate();return $L(this,lnt(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=tc.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),a=o?this:e,l=o?e:this,u=AKi(a,l,s,n);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Sn.now(),e,t)}until(e){return this.isValid?$p.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,r)<=n&&n<=s.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Sn.fromObject({},{zone:this.zone}),r=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Sn.isDateTime))throw new cb("max requires all arguments be DateTimes");return Krt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:s=null}=r,o=mh.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return xAt(o,e,t)}static fromStringExplain(e,t,r={}){return Sn.fromFormatExplain(e,t,r)}static get DATE_SHORT(){return Xve}static get DATE_MED(){return MIt}static get DATE_MED_WITH_WEEKDAY(){return QXi}static get DATE_FULL(){return OIt}static get DATE_HUGE(){return PIt}static get TIME_SIMPLE(){return RIt}static get TIME_WITH_SECONDS(){return DIt}static get TIME_WITH_SHORT_OFFSET(){return FIt}static get TIME_WITH_LONG_OFFSET(){return kIt}static get TIME_24_SIMPLE(){return LIt}static get TIME_24_WITH_SECONDS(){return NIt}static get TIME_24_WITH_SHORT_OFFSET(){return $It}static get TIME_24_WITH_LONG_OFFSET(){return BIt}static get DATETIME_SHORT(){return jIt}static get DATETIME_SHORT_WITH_SECONDS(){return GIt}static get DATETIME_MED(){return UIt}static get DATETIME_MED_WITH_SECONDS(){return zIt}static get DATETIME_MED_WITH_WEEKDAY(){return eJi}static get DATETIME_FULL(){return VIt}static get DATETIME_FULL_WITH_SECONDS(){return HIt}static get DATETIME_HUGE(){return WIt}static get DATETIME_HUGE_WITH_SECONDS(){return qIt}}function TJ(i){if(Sn.isDateTime(i))return i;if(i&&i.valueOf&&Y8(i.valueOf()))return Sn.fromJSDate(i);if(i&&typeof i=="object")return Sn.fromObject(i);throw new cb(`Unknown datetime argument: ${i}, of type ${typeof i}`)}const RS="system",YF="unknown",y0="UTC",XKi=Intl.DateTimeFormat().resolvedOptions().timeZone,JKi="shortOffset";function KKi(i){return"timeZoneIANA"in i}function ZKi(i){return i.startsWith("UTC")}function XF(i,e=!1){return{json:{read:{source:i,reader:(t,r)=>r[i]?Zfe(r[i]):null},write:!!e&&{allowNull:!0,writer(t,r){r[i]=t?QKi(t):null}}}}}function Zfe(i,e=RS){return i?KKi(i)?i.timeZoneIANA:eZi(i,e):e}function QKi(i){return{timeZoneIANA:i}}function eZi(i,e=RS){if(!i||!Nrt.has(i.timeZone))return e;const t=Nrt.get(i.timeZone);return ZKi(i.timeZone)||i.respectsDaylightSaving?t:tZi(t)}function tZi(i){const e=Sn.local().setZone(i),t=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return t===0?"Etc/UTC":`Etc/GMT${If.instance(-t).formatOffset(0,"narrow")}`}function IAt(i,e,t,r,n){if(e&&n==="date")return{timeZone:y0,timeZoneName:void 0};const s=r.timeStyle||r.hour,o=t===YF;return{timeZone:o?n==="timestamp-offset"?void 0:i??y0:t,timeZoneName:o&&s?JKi:void 0}}const iZi={year:void 0,month:void 0,day:void 0,weekday:void 0},rZi={hour:void 0,minute:void 0,second:void 0},AAt={timeZone:y0},jE={year:"numeric",month:"numeric",day:"numeric"},CJ={year:"numeric",month:"long",day:"numeric"},EJ={year:"numeric",month:"short",day:"numeric"},IJ={year:"numeric",month:"long",weekday:"long",day:"numeric"},d5={hour:"numeric",minute:"numeric"},TN={...d5,second:"numeric"},MAt={hourCycle:"h23"},AJ={...d5,...MAt},MJ={...TN,...MAt},OAt={"short-date":jE,"short-date-short-time":{...jE,...d5},"short-date-short-time-24":{...jE,...AJ},"short-date-long-time":{...jE,...TN},"short-date-long-time-24":{...jE,...MJ},"short-date-le":jE,"short-date-le-short-time":{...jE,...d5},"short-date-le-short-time-24":{...jE,...AJ},"short-date-le-long-time":{...jE,...TN},"short-date-le-long-time-24":{...jE,...MJ},"long-month-day-year":CJ,"long-month-day-year-short-time":{...CJ,...d5},"long-month-day-year-short-time-24":{...CJ,...AJ},"long-month-day-year-long-time":{...CJ,...TN},"long-month-day-year-long-time-24":{...CJ,...MJ},"day-short-month-year":EJ,"day-short-month-year-short-time":{...EJ,...d5},"day-short-month-year-short-time-24":{...EJ,...AJ},"day-short-month-year-long-time":{...EJ,...TN},"day-short-month-year-long-time-24":{...EJ,...MJ},"long-date":IJ,"long-date-short-time":{...IJ,...d5},"long-date-short-time-24":{...IJ,...AJ},"long-date-long-time":{...IJ,...TN},"long-date-long-time-24":{...IJ,...MJ},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":d5,"long-time":TN},nZi=pa()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),PAt={ar:"ar-u-nu-latn-ca-gregory"};let k5e=new WeakMap;const b2e=OAt["short-date-short-time"];function sZi(i){let e=k5e.get(i);if(!e){const t=Am(),r=PAt[t]||t,n=zze(i.timeZone??RS),s={...i,timeZone:n};e=new Intl.DateTimeFormat(r,s),k5e.set(i,e)}return e}function T6(i){return OAt[i]}function vb(i,e=b2e){return sZi(e).format(i)}function oZi(i,e=b2e){return vb(new Date(i),{...e,...AAt,...rZi})}function aZi(i,e=b2e){return vb(new Date(`1970-01-01T${i}Z`),{...e,...AAt,...iZi})}function lZi(i,e=b2e){if(e.timeZone)return vb(new Date(i),e);const t=Sn.fromISO(i,{setZone:!0}),r=Am(),n=PAt[r]??r,s=t.offset===0?y0:e.timeZone,o={...e,timeZone:s};return t.toLocaleString(o,{locale:n})}function zze(i){switch(i){case RS:return XKi;case YF:return y0;default:return i}}bze(()=>{k5e=new WeakMap});const uZi={ar:"ar-u-nu-latn"};let Qfe=new WeakMap,RAt={};function cZi(i){const e=i||RAt;if(!Qfe.has(e)){const t=Am(),r=uZi[Am()]||t;Qfe.set(e,new Intl.NumberFormat(r,i))}return Qfe.get(e)}function Qve(i={}){const e={};return i.digitSeparator!=null&&(e.useGrouping=i.digitSeparator),i.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=i.places),e}function DS(i,e){return Object.is(i,-0)&&(i=0),cZi(e).format(i)}bze(()=>{Qfe=new WeakMap,RAt={}});const DAt=()=>di.getLogger("esri.intl.substitute");function xC(i,e,t={}){const{format:r={}}=t;return m0(i,n=>hZi(n,e,r))}function hZi(i,e,t){let r,n;const s=i.indexOf(":");if(s===-1?r=i.trim():(r=i.slice(0,s).trim(),n=i.slice(s+1).trim()),!r)return"";const o=uS(r,e);if(o==null)return"";const a=(n?t?.[n]:null)??t?.[r];return a?dZi(o,a):n?pZi(o,n):Vze(o)}function dZi(i,e){switch(e.type){case"date":return vb(i,e.intlOptions);case"number":return DS(i,e.intlOptions);default:return DAt().warn("missing format descriptor for key {key}"),Vze(i)}}function pZi(i,e){switch(e.toLowerCase()){case"dateformat":return vb(i);case"numberformat":return DS(i);default:return DAt().warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?vb(i):/^numberformat/i.test(e)?DS(i):Vze(i)}}function Vze(i){switch(typeof i){case"string":return i;case"number":return DS(i);case"boolean":return""+i;default:return i instanceof Date?vb(i):""}}async function fZi(i,e,t,r){const n=e.exec(t);if(!n)throw new qe("esri-intl:invalid-bundle",`Bundle id "${t}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],a=OYi(r),l=`${s}${o}.json`,u=a?`${s}${o}_${a}.json`:l;let c;try{c=await fnt(i(u))}catch(h){if(u===l)throw new qe("intl:unknown-bundle",`Bundle "${t}" cannot be loaded`,{error:h});try{c=await fnt(i(l))}catch(p){throw new qe("intl:unknown-bundle",`Bundle "${t}" cannot be loaded`,{error:p})}}return c}async function fnt(i){if(mnt.fetchBundleAsset!=null)return mnt.fetchBundleAsset(i);const e=await zi(i,{responseType:"text"});return JSON.parse(e.data)}let mZi=class{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n=typeof r=="string"?s=>new URL(s,new URL(r,window.location.href)).href:r instanceof URL?s=>new URL(s,r).href:r,this.pattern=typeof t=="string"?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return fZi(this.getAssetUrl,this.matcher,e,t)}};function gZi(i){return new mZi(i)}const mnt={};MYi(gZi({pattern:"esri/",location:Fl}));function dS(i){return typeof i=="number"}function Hze(i){return typeof i=="string"||i instanceof String}const yZi="yyyy-MM-dd",vZi="TT";var wie;(function(i){i.HM="HH:mm",i.HMS="HH:mm:ss",i.HMS_MS="HH:mm:ss.SSS"})(wie||(wie={}));const _Zi=[wie.HMS_MS,wie.HMS,wie.HM,vZi];function gnt(i){if(!i||!Hze(i))return null;const e=Sn.fromFormat(i,yZi);return e.isValid?e:null}function ynt(i){return i&&Hze(i)?CVi(_Zi,e=>{const t=Sn.fromFormat(i,e);return t.isValid?t:null})??null:null}function vnt(i){if(!i||!Hze(i))return null;const e=Sn.fromISO(i);return e.isValid?e:null}var pW;(function(i){i.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",i.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(pW||(pW={}));const bZi=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function wZi(i){return i!=null&&bZi.has(i.type)}function FAt(i){return i!=null&&(i.type==="date-only"||i.type==="esriFieldTypeDateOnly")}function kAt(i){return i!=null&&(i.type==="timestamp-offset"||i.type==="esriFieldTypeTimestampOffset")}function LAt(i){return i!=null&&(i.type==="time-only"||i.type==="esriFieldTypeTimeOnly")}function xZi(i,e){const t=i?.domain;if(!t)return null;switch(t.type){case"range":{const{min:r,max:n}=NAt(i);if(r!=null&&+en)return pW.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(t.codedValues==null||t.codedValues.every(r=>r==null||r.code!==e))return pW.INVALID_CODED_VALUE}return null}function NAt(i,e){const t=i?.domain;if(!t||t.type!=="range")return;const r="range"in t?t.range[0]:t.minValue,n="range"in t?t.range[1]:t.maxValue,s=wZi(i);return FAt(i)||LAt(i)||kAt(i)?{...SZi(i,n,r),isInteger:s}:{min:r!=null&&typeof r=="number"?r:null,max:n!=null&&typeof n=="number"?n:null,rawMin:r,rawMax:n,isInteger:s}}function SZi(i,e,t){return FAt(i)?{min:gnt(t)?.toMillis(),max:gnt(e)?.toMillis(),rawMin:t,rawMax:e}:LAt(i)?{min:ynt(t)?.toMillis(),max:ynt(e)?.toMillis(),rawMin:t,rawMax:e}:kAt(i)?{min:vnt(t)?.toMillis(),max:vnt(e)?.toMillis(),rawMin:t,rawMax:e}:{max:null,min:null}}const TZi=()=>di.getLogger("esri.support.arcadeOnDemand");let d3e;function e_(){return d3e||(d3e=(async()=>{const i=await Promise.resolve().then(()=>n7r);return{arcade:i.arcade,arcadeUtils:i,Dictionary:i.Dictionary,Feature:i.arcadeFeature}})()),d3e}const $At=(i,e,t)=>BAt.create(i,e,t,null,["$feature","$view"],[]),CZi=(i,e,t,r)=>BAt.create(i,e,t,r,["$feature","$view"],[]);let BAt=class jAt{constructor(e,t,r,n,s,o,a){this.services=null,this.script=e,this.evaluate=n;const l=Array.isArray(o)?o:o?.fields;this.fields=l??[],this._syntaxTree=r,this._arcade=t,this._arcadeFeature=s,this._spatialReference=a,this._referencesGeometry=t.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,t,r,n,s,o){const{arcade:a,Feature:l,Dictionary:u}=await e_(),c=Xi.fromJSON(t);let h;try{h=a.parseScript(e,o)}catch(Y){return TZi().error(new qe("arcade-bad-expression","Failed to parse arcade script",{script:e,error:Y})),null}const p=s.reduce((Y,K)=>({...Y,[K]:null}),{});let m=null;n!=null&&(m=new u(n),m.immutable=!0,p.$config=null);const v=a.scriptUsesGeometryEngine(h),w=v&&a.enableGeometrySupport(),S=a.scriptUsesFeatureSet(h)&&a.enableFeatureSetSupport(),I=a.scriptIsAsync(h),R=I&&a.enableAsyncSupport(),L={vars:p,spatialReference:c,useAsync:!!R};await Promise.all([w,S,R]);const k=new Set;await a.loadDependentModules(k,h,null,I,v);const B=new u;B.immutable=!1,B.setField("scale",0);const $=a.compileScript(h,L),V=(Y,K)=>{const Q=Y.$view?.timeZone;return"$view"in Y&&Y.$view&&(B.setField("scale",typeof Y.$view=="object"&&"scale"in Y.$view?Y.$view.scale:void 0),Y.$view=B),m&&(Y.$config=m),$({vars:Y,spatialReference:c,services:K,timeZone:Q})};return new jAt(e,a,h,V,new l,r,c)}repurposeFeature(e){return e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry,e.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const EZi=/^([0-9_])/,IZi=/[^a-z0-9_\u0080-\uffff]+/gi;function fW(i){return i==null?null:i.trim().replaceAll(IZi,"_").replace(EZi,"F$1")||null}const AZi=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],MZi=["field","normalizationField"];function t_(i,e){if(i!=null&&e!=null){for(const t of Array.isArray(i)?i:[i])if(_nt(AZi,t,e),"visualVariables"in t&&t.visualVariables)for(const r of t.visualVariables)_nt(MZi,r,e)}}function _nt(i,e,t){if(i)for(const r of i){const n=uS(r,e),s=n&&typeof n!="function"&&t.get(n);s&&Qp(r,s.name,e)}}function pR(i,e){if(i!=null&&e?.fields?.length)if("startField"in i){const t=e.get(i.startField),r=e.get(i.endField);i.startField=t?.name??null,i.endField=r?.name??null}else{const t=e.get(i.startTimeField),r=e.get(i.endTimeField);i.startTimeField=t?.name??null,i.endTimeField=r?.name??null}}const p3e=new Set;function rB(i,e){return i&&e?(p3e.clear(),IA(p3e,i,e),Array.from(p3e).sort()):[]}function IA(i,e,t){if(t)if(e?.fields?.length)if(t.includes("*"))for(const{name:r}of e.fields)i.add(r);else for(const r of t)$v(i,e,r);else{if(t.includes("*"))return i.clear(),void i.add("*");for(const r of t)r!=null&&i.add(r)}}function $v(i,e,t){if(typeof t=="string")if(e){const r=e.get(t);r&&i.add(r.name)}else i.add(t)}function e1e(i,e){return e==null||i==null?[]:e.includes("*")?(i.fields??[]).map(t=>t.name):e}function OZi(i,e,t=1){if(!e||!i)return[];if(e.includes("*"))return["*"];const r=rB(i,e);return r.length/i.fields.length>=t?["*"]:r}async function i_(i,e,t){if(!t)return;const{arcadeUtils:r}=await e_(),n=r.extractFieldNames(t,e?.fields?.map(s=>s.name));for(const s of n)$v(i,e,s)}async function GAt(i,e,t){if(t&&t!=="1=1"){const r=await Ine(t,e);if(!r.isStandardized)throw new qe("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});IA(i,e,r.fieldNames)}}function PZi({displayField:i,fields:e}){return i||(e?.length?f3e(e,"name-or-title")||f3e(e,"unique-identifier")||f3e(e,"type-or-category")||RZi(e):null)}function RZi(i){for(const e of i){if(!e?.name)continue;const t=e.name.toLowerCase();if(t.includes("name")||t.includes("title"))return e.name}return null}function f3e(i,e){for(const t of i)if(t?.valueType&&t.valueType===e)return t.name;return null}async function DZi(i,e){if(!e)return;const t=e.elevationInfo?.featureExpressionInfo;return t?t.collectRequiredFields(i,e.fieldsIndex):void 0}function FZi(i,e,t){t.onStatisticExpression?i_(i,e,t.onStatisticExpression.expression):i.add(t.onStatisticField)}async function kZi(i,e,t){if(!e||!t||!("fields"in t))return;const r=[],n=t.popupTemplate;r.push(LZi(i,e,n)),t.fields&&r.push(...t.fields.map(async s=>FZi(i,e.fieldsIndex,s))),await Promise.all(r)}async function LZi(i,e,t){const r=[];t?.expressionInfos&&r.push(...t.expressionInfos.map(s=>i_(i,e.fieldsIndex,s.expression)));const n=t?.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&r.push(i_(i,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(r)}async function bnt(i,e,t){e&&(e.timeInfo&&t?.timeExtent&&IA(i,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&IA(i,e.fieldsIndex,[e.floorInfo.floorField]),t?.where!=null&&await GAt(i,e.fieldsIndex,t.where))}async function NZi(i,e,t){e&&t&&await Promise.all(t.map(r=>$Zi(i,e,r)))}async function $Zi(i,e,t){e&&t&&(t.valueExpression?await i_(i,e.fieldsIndex,t.valueExpression):t.field&&$v(i,e.fieldsIndex,t.field))}function BZi(i){return i?rB(i.fieldsIndex,UAt(i)):[]}function jZi(i){if(!i)return[];const e=i.geometryFieldsInfo;return e?rB(i.fieldsIndex,[e.shapeAreaField,e.shapeLengthField]):[]}const GZi=new Set(["oid","global-id","guid"]),UZi=new Set(["oid","global-id"]),zZi=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function VZi(i){const e=new Set;zAt(i).forEach(r=>e.add(r)),jZi(i).forEach(r=>e.add(r.toLowerCase()));const t=i&&"infoFor3D"in i?i.infoFor3D:void 0;return t&&(Object.values(t.assetMapFieldRoles).forEach(r=>e.add(r.toLowerCase())),Object.values(t.transformFieldRoles).forEach(r=>e.add(r.toLowerCase()))),Array.from(e)}function UAt(i){if(!i)return[];const e="editFieldsInfo"in i&&i.editFieldsInfo;if(!e)return[];const{creationDateField:t,creatorField:r,editDateField:n,editorField:s}=e;return[t,r,n,s].filter(Boolean)}function zAt(i){return UAt(i).map(e=>e.toLowerCase())}function HZi(i,e){return i.editable&&!GZi.has(i.type)&&!zAt(e).includes(i.name?.toLowerCase()??"")}function WZi(i,e){const t=i.name?.toLowerCase()??"";return!(e?.objectIdField!=null&&t===e.objectIdField.toLowerCase()||e?.globalIdField!=null&&t===e.globalIdField.toLowerCase()||VZi(e).includes(t)||UZi.has(i.type)||zZi.some(r=>r.test(t)))}async function wnt(i,e){const{labelingInfo:t,fieldsIndex:r}=e;t?.length&&await Promise.all(t.map(n=>qZi(i,r,n)))}async function qZi(i,e,t){if(!t)return;const r=t.getLabelExpression(),n=t.where;if(r.type==="arcade")await i_(i,e,r.expression);else{const s=r.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{$v(i,e,o.slice(1,-1))})}await GAt(i,e,n)}function w2e(i){const e=i.defaultValue;return e!==void 0&&WAt(i,e)?e:i.nullable?null:void 0}function s8(i){const e=typeof i=="string"?{type:i}:i;return xie(e)?255:e.type==="esriFieldTypeDate"||e.type==="date"?8:void 0}function VAt(i){return typeof i=="number"&&!isNaN(i)&&isFinite(i)}function YZi(i){return i===null||VAt(i)}function XZi(i){return i===null||Number.isInteger(i)}function HAt(i){return i!=null&&typeof i=="string"}function JZi(i){return i===null||HAt(i)}function KZi(){return!0}function WAt(i,e){let t;switch(i.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":t=i.nullable?XZi:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":t=i.nullable?YZi:VAt;break;case"string":case"esriFieldTypeString":t=i.nullable?JZi:HAt;break;default:t=KZi}return arguments.length===1?t:t(e)}const ZZi=["integer","small-integer","big-integer"],QZi=["single","double"],eQi=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],tQi=["esriFieldTypeSingle","esriFieldTypeDouble"],iQi=new Set([...ZZi,...eQi]),rQi=new Set([...QZi,...tQi]),nQi=bve(iQi,rQi);function wY(i){return i!=null&&nQi.has(i.type)}function xie(i){return i!=null&&(i.type==="string"||i.type==="esriFieldTypeString")}function mW(i){return i!=null&&(i.type==="date"||i.type==="esriFieldTypeDate")}function t1e(i){return i!=null&&(i.type==="date-only"||i.type==="esriFieldTypeDateOnly")}function i1e(i){return i!=null&&(i.type==="timestamp-offset"||i.type==="esriFieldTypeTimestampOffset")}function hae(i){return i!=null&&(i.type==="time-only"||i.type==="esriFieldTypeTimeOnly")}function xnt(i){return i!=null&&(i.type==="oid"||i.type==="esriFieldTypeOID")}function Snt(i){return i!=null&&(i.type==="global-id"||i.type==="esriFieldTypeGlobalID")}function sQi(i,e){return qAt(i,e)===null}var r1e,n1e;function oQi(i){return i==null||typeof i=="number"&&isNaN(i)?null:i}function qAt(i,e){return i==null||i.nullable&&e===null?null:wY(i)&&!aQi(i.type,Number(e))?r1e.OUT_OF_RANGE:WAt(i,e)?i.domain?xZi(i,e):null:n1e.INVALID_TYPE}function aQi(i,e){const t=typeof i=="string"?YAt(i):i;if(!t)return!1;const r=t.min,n=t.max;return t.isInteger?Number.isInteger(e)&&e>=r&&e<=n:e>=r&&e<=n}function YAt(i){switch(i){case"esriFieldTypeSmallInteger":case"small-integer":return lQi;case"esriFieldTypeInteger":case"integer":return uQi;case"esriFieldTypeBigInteger":case"big-integer":return cQi;case"esriFieldTypeSingle":case"single":return hQi;case"esriFieldTypeDouble":case"double":return dQi}}(function(i){i.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(r1e||(r1e={})),function(i){i.INVALID_TYPE="type-validation-error::invalid-type"}(n1e||(n1e={}));const lQi={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},uQi={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},cQi={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},hQi={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},dQi={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function pQi(i,e,t){switch(i){case pW.INVALID_CODED_VALUE:return`Value ${t} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case pW.VALUE_OUT_OF_RANGE:return`Value ${t} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case n1e.INVALID_TYPE:return`Value ${t} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case r1e.OUT_OF_RANGE:{const{min:r,max:n}=YAt(e.type);return`Value ${t} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${r} to ${n}`}}}function XAt(i,e){return!fQi(i,e,null)}function fQi(i,e,t){if(!e?.attributes||!i)return!0;const r=new Set(Object.keys(e.attributes));let n=!1;for(const s of i)if(!r.has(s)&&(n=!0,t==null))break;return n}function L5e(i){return!!i&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>i.toLowerCase().startsWith(e))}let eme=class extends Ci{constructor(e){super(e),this.type=null}};x([D({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],eme.prototype,"type",void 0),eme=x([Qe("esri.popup.content.Content")],eme);const Vk=eme;var N5e;let CN=N5e=class extends Vk{constructor(i){super(i),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new N5e({description:this.description,displayType:this.displayType,title:this.title})}};x([D({type:String,json:{write:!0}})],CN.prototype,"description",void 0),x([D({type:["auto","preview","list"],json:{write:!0}})],CN.prototype,"displayType",void 0),x([D({type:String,json:{write:!0}})],CN.prototype,"title",void 0),x([D({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],CN.prototype,"type",void 0),CN=N5e=x([Qe("esri.popup.content.AttachmentsContent")],CN);const Mne=CN;var $5e;let EN=$5e=class extends Vk{constructor(i){super(i),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new $5e({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?li(this.outFields):null})}};x([D()],EN.prototype,"creator",void 0),x([D()],EN.prototype,"destroyer",void 0),x([D()],EN.prototype,"outFields",void 0),x([D({type:["custom"],readOnly:!0})],EN.prototype,"type",void 0),EN=$5e=x([Qe("esri.popup.content.CustomContent")],EN);const mQi=EN;var B5e;let CG=B5e=class extends Ci{constructor(i){super(i),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new B5e({title:this.title,expression:this.expression})}};x([D({type:String,json:{write:!0}})],CG.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],CG.prototype,"expression",void 0),x([D({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],CG.prototype,"returnType",void 0),CG=B5e=x([Qe("esri.popup.ElementExpressionInfo")],CG);const JAt=CG;var j5e;let qZ=j5e=class extends Vk{constructor(i){super(i),this.expressionInfo=null,this.type="expression"}clone(){return new j5e({expressionInfo:this.expressionInfo?.clone()})}};x([D({type:JAt,json:{write:!0}})],qZ.prototype,"expressionInfo",void 0),x([D({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],qZ.prototype,"type",void 0),qZ=j5e=x([Qe("esri.popup.content.ExpressionContent")],qZ);const Wze=qZ;function Wr(i,e={}){const t=i instanceof Rs?i:new Rs(i,e),r={type:e?.ignoreUnknown??1?t.apiValues:String,json:{type:t.jsonValues,read:!e?.readOnly&&{reader:t.read},write:{writer:t.write}}};return e?.readOnly!==void 0&&(r.readOnly=!!e.readOnly),e?.default!==void 0&&(r.json.default=e.default),e?.name!==void 0&&(r.json.name=e.name),e?.nonNullable!==void 0&&(r.nonNullable=e.nonNullable),D(r)}let EG=class extends xs(Ci){constructor(e){super(e),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};x([Wr(nZi)],EG.prototype,"dateFormat",void 0),x([D({type:Boolean,json:{write:!0}})],EG.prototype,"digitSeparator",void 0),x([D({type:ms,json:{write:!0}})],EG.prototype,"places",void 0),EG=x([Qe("esri.popup.support.FieldInfoFormat")],EG);const tme=EG;var G5e;let PT=G5e=class extends Ci{constructor(i){super(i),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new G5e({fieldName:this.fieldName,format:this.format?li(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};x([D({type:String,json:{write:!0}})],PT.prototype,"fieldName",void 0),x([D({type:tme,json:{write:!0}})],PT.prototype,"format",void 0),x([D({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],PT.prototype,"isEditable",void 0),x([D({type:String,json:{write:!0}})],PT.prototype,"label",void 0),x([Wr(new Rs({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],PT.prototype,"stringFieldOption",void 0),x([D({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],PT.prototype,"statisticType",void 0),x([D({type:String,json:{write:!0}})],PT.prototype,"tooltip",void 0),x([D({type:Boolean,json:{write:!0}})],PT.prototype,"visible",void 0),PT=G5e=x([Qe("esri.popup.FieldInfo")],PT);const dae=PT;var U5e;let jM=U5e=class extends Vk{constructor(i){super(i),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(i,e){e.fieldInfos=i&&i.map(t=>t.toJSON())}clone(){return new U5e(li({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};x([D({type:Object,json:{write:!0}})],jM.prototype,"attributes",void 0),x([D({type:String,json:{write:!0}})],jM.prototype,"description",void 0),x([D({type:[dae]})],jM.prototype,"fieldInfos",void 0),x([ur("fieldInfos")],jM.prototype,"writeFieldInfos",null),x([D({type:String,json:{write:!0}})],jM.prototype,"title",void 0),x([D({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],jM.prototype,"type",void 0),jM=U5e=x([Qe("esri.popup.content.FieldsContent")],jM);const gW=jM;let IN=class extends Ci{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};x([D({type:String,json:{write:!0}})],IN.prototype,"altText",void 0),x([D({type:String,json:{write:!0}})],IN.prototype,"caption",void 0),x([D({type:String,json:{write:!0}})],IN.prototype,"title",void 0),x([D({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],IN.prototype,"type",void 0),IN=x([Qe("esri.popup.content.mixins.MediaInfo")],IN);const qze=IN;var z5e;let AN=z5e=class extends un{constructor(i){super(i),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new z5e({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};x([D()],AN.prototype,"color",void 0),x([D()],AN.prototype,"fieldName",void 0),x([D()],AN.prototype,"tooltip",void 0),x([D()],AN.prototype,"value",void 0),AN=z5e=x([Qe("esri.popup.content.support.ChartMediaInfoValueSeries")],AN);const KAt=AN;var V5e;let o4=V5e=class extends Ci{constructor(i){super(i),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new V5e({colors:li(this.colors),fields:li(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};x([D({type:[jr],json:{type:[[ms]],write:!0}})],o4.prototype,"colors",void 0),x([D({type:[String],json:{write:!0}})],o4.prototype,"fields",void 0),x([D({type:String,json:{write:!0}})],o4.prototype,"normalizeField",void 0),x([D({type:[KAt],json:{read:!1}})],o4.prototype,"series",void 0),x([D({type:String,json:{write:!0}})],o4.prototype,"tooltipField",void 0),o4=V5e=x([Qe("esri.popup.content.support.ChartMediaInfoValue")],o4);const gQi=o4;let YZ=class extends qze{constructor(e){super(e),this.type=null,this.value=null}};x([D({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],YZ.prototype,"type",void 0),x([D({type:gQi,json:{write:!0}})],YZ.prototype,"value",void 0),YZ=x([Qe("esri.popup.content.mixins.ChartMediaInfo")],YZ);const x2e=YZ,S2e=pa()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var H5e;let ime=H5e=class extends x2e{constructor(i){super(i),this.type="bar-chart"}clone(){return new H5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:S2e.write}})],ime.prototype,"type",void 0),ime=H5e=x([Qe("esri.popup.content.BarChartMediaInfo")],ime);const ZAt=ime;var W5e;let rme=W5e=class extends x2e{constructor(i){super(i),this.type="column-chart"}clone(){return new W5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:S2e.write}})],rme.prototype,"type",void 0),rme=W5e=x([Qe("esri.popup.content.ColumnChartMediaInfo")],rme);const QAt=rme;var q5e;let XZ=q5e=class extends Ci{constructor(i){super(i),this.linkURL=null,this.sourceURL=null}clone(){return new q5e({linkURL:this.linkURL,sourceURL:this.sourceURL})}};x([D({type:String,json:{write:!0}})],XZ.prototype,"linkURL",void 0),x([D({type:String,json:{write:!0}})],XZ.prototype,"sourceURL",void 0),XZ=q5e=x([Qe("esri.popup.content.support.ImageMediaInfoValue")],XZ);const yQi=XZ;var Y5e;let IG=Y5e=class extends qze{constructor(i){super(i),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new Y5e({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};x([D({type:Number,json:{write:!0}})],IG.prototype,"refreshInterval",void 0),x([D({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],IG.prototype,"type",void 0),x([D({type:yQi,json:{write:!0}})],IG.prototype,"value",void 0),IG=Y5e=x([Qe("esri.popup.content.ImageMediaInfo")],IG);const e3t=IG;var X5e;let nme=X5e=class extends x2e{constructor(i){super(i),this.type="line-chart"}clone(){return new X5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:S2e.write}})],nme.prototype,"type",void 0),nme=X5e=x([Qe("esri.popup.content.LineChartMediaInfo")],nme);const t3t=nme;var J5e;let sme=J5e=class extends x2e{constructor(i){super(i),this.type="pie-chart"}clone(){return new J5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:S2e.write}})],sme.prototype,"type",void 0),sme=J5e=x([Qe("esri.popup.content.PieChartMediaInfo")],sme);const i3t=sme,r3t={base:qze,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":ZAt,"column-chart":QAt,"line-chart":t3t,"pie-chart":i3t,image:e3t}};var K5e;let RT=K5e=class extends Vk{constructor(i){super(i),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(i){return i&&i.map(e=>e.type==="image"?e3t.fromJSON(e):e.type==="barchart"?ZAt.fromJSON(e):e.type==="columnchart"?QAt.fromJSON(e):e.type==="linechart"?t3t.fromJSON(e):e.type==="piechart"?i3t.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(i,e){e.mediaInfos=i&&i.map(t=>t.toJSON())}clone(){return new K5e(li({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};x([D()],RT.prototype,"activeMediaInfoIndex",void 0),x([D({type:Object,json:{write:!0}})],RT.prototype,"attributes",void 0),x([D({type:String,json:{write:!0}})],RT.prototype,"description",void 0),x([D({types:[r3t]})],RT.prototype,"mediaInfos",void 0),x([Mi("mediaInfos")],RT.prototype,"readMediaInfos",null),x([ur("mediaInfos")],RT.prototype,"writeMediaInfos",null),x([D({type:String,json:{write:!0}})],RT.prototype,"title",void 0),x([D({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],RT.prototype,"type",void 0),RT=K5e=x([Qe("esri.popup.content.MediaContent")],RT);const One=RT;var Z5e;let JZ=Z5e=class extends Ci{constructor(i){super(i),this.field=null,this.order=null}clone(){return new Z5e({field:this.field,order:this.order})}};x([D({type:String,json:{write:!0}})],JZ.prototype,"field",void 0),x([D({type:["asc","desc"],json:{write:!0}})],JZ.prototype,"order",void 0),JZ=Z5e=x([Qe("esri.popup.support.RelatedRecordsInfoFieldOrder")],JZ);const Yze=JZ;let uI=class extends xs(Vk){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};x([D({type:String,json:{write:!0}})],uI.prototype,"description",void 0),x([D({type:Number,json:{type:ms,write:!0}})],uI.prototype,"displayCount",void 0),x([D({type:["list"],json:{write:!0}})],uI.prototype,"displayType",void 0),x([D({type:[Yze],json:{write:!0}})],uI.prototype,"orderByFields",void 0),x([D({type:Number,json:{type:ms,write:!0}})],uI.prototype,"relationshipId",void 0),x([D({type:String,json:{write:!0}})],uI.prototype,"title",void 0),x([D({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],uI.prototype,"type",void 0),uI=x([Qe("esri.popup.content.RelationshipContent")],uI);const s1e=uI;var Q5e;let KZ=Q5e=class extends Vk{constructor(i){super(i),this.text=null,this.type="text"}clone(){return new Q5e({text:this.text})}};x([D({type:String,json:{write:!0}})],KZ.prototype,"text",void 0),x([D({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],KZ.prototype,"type",void 0),KZ=Q5e=x([Qe("esri.popup.content.TextContent")],KZ);const yW=KZ,vQi={base:null,key:"type",typeMap:{attachment:Mne,media:One,text:yW,expression:Wze,field:gW,relationship:s1e}};var eFe;let MN=eFe=class extends Ci{constructor(i){super(i),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new eFe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};x([D({type:String,json:{write:!0}})],MN.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],MN.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],MN.prototype,"expression",void 0),x([D({type:["string","number"],json:{write:!0}})],MN.prototype,"returnType",void 0),MN=eFe=x([Qe("esri.popup.ExpressionInfo")],MN);const o1e=MN;var tFe;let ZZ=tFe=class extends Ci{constructor(i){super(i),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new tFe({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};x([D({type:Boolean,json:{write:!0}})],ZZ.prototype,"returnTopmostRaster",void 0),x([D({type:Boolean,json:{write:!0}})],ZZ.prototype,"showNoDataRecords",void 0),ZZ=tFe=x([Qe("esri.popup.LayerOptions")],ZZ);const _Qi=ZZ;var iFe;let QZ=iFe=class extends Ci{constructor(i){super(i),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new iFe({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?li(this.orderByFields):null})}};x([D({type:Boolean,json:{write:!0}})],QZ.prototype,"showRelatedRecords",void 0),x([D({type:[Yze],json:{write:!0}})],QZ.prototype,"orderByFields",void 0),QZ=iFe=x([Qe("esri.popup.RelatedRecordsInfo")],QZ);const bQi=QZ;let n3t=0;const iT=i=>{let e=class extends i{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n3t++})}};return e=x([Qe("esri.core.Identifiable")],e),e},T2e=i=>{let e=class extends i{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n3t++})}};return e=x([Qe("esri.core.NumericIdentifiable")],e),e};let Tnt=class extends iT(class{}){};Tnt=x([Qe("esri.core.Identifiable")],Tnt);var rFe;let S2=rFe=class extends iT(un){constructor(i){super(i),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new rFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};x([D()],S2.prototype,"active",void 0),x([D()],S2.prototype,"className",void 0),x([D()],S2.prototype,"disabled",void 0),x([D()],S2.prototype,"icon",void 0),x([D()],S2.prototype,"id",void 0),x([D()],S2.prototype,"indicator",void 0),x([D()],S2.prototype,"title",void 0),x([D()],S2.prototype,"type",void 0),x([D()],S2.prototype,"visible",void 0),S2=rFe=x([Qe("esri.support.actions.ActionBase")],S2);const C2e=S2;var nFe;let ome=nFe=class extends C2e{constructor(i){super(i),this.image=null,this.type="button"}clone(){return new nFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};x([D()],ome.prototype,"image",void 0),ome=nFe=x([Qe("esri.support.Action.ActionButton")],ome);const xY=ome;var sFe;let eQ=sFe=class extends C2e{constructor(i){super(i),this.image=null,this.type="toggle",this.value=!1}clone(){return new sFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};x([D()],eQ.prototype,"image",void 0),x([D()],eQ.prototype,"value",void 0),eQ=sFe=x([Qe("esri.support.Action.ActionToggle")],eQ);const Xze=eQ,OJ="relationships/",Cnt="expression/",wQi=dr.ofType({key:"type",defaultKeyValue:"button",base:C2e,typeMap:{button:xY,toggle:Xze}}),xQi={base:Vk,key:"type",typeMap:{media:One,custom:mQi,text:yW,attachments:Mne,fields:gW,expression:Wze,relationship:s1e}},SQi=new Set(["attachments","fields","media","text","expression","relationship"]);let Vm=class extends xs(Ci){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(t=>u3(xQi,t)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||qp(e)?e:(di.getLogger(this).error("content error","unsupported content value",{value:e}),null)}readContent(e,t){const{popupElements:r}=t;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(t.description,t.mediaInfos,r):this._readPopupInfo(t)}writeContent(e,t,r,n){typeof e!="string"?Array.isArray(e)&&(t.popupElements=e.filter(s=>SQi.has(s.type)).map(s=>s?.toJSON(n)),t.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(t):s.type==="media"?this._writeMediaContent(s,t):s.type==="text"?this._writeTextContent(s,t):s.type==="relationship"&&this._writeRelationshipContent(s,t)})):t.description=e}writeFieldInfos(e,t,r,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const a=o?o.filter(u=>u.type==="fields"):[],l=a.length&&a.every(u=>u.fieldInfos?.length);t.fieldInfos=e.filter(Boolean).map(u=>{const c=u.toJSON(n);return l&&(c.visible=!1),c})}if(o)for(const a of o)a.type==="fields"&&this._writeFieldsContent(a,t)}writeLayerOptions(e,t,r,n){t[r]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,t){t.title=e||""}async collectRequiredFields(e,t){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(e,t,[...r,...this._getContentExpressionInfos(this.content,r)]),IA(e,t,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const t=new Set;return await this.collectRequiredFields(t,e),[...t].sort()}_writeFieldsContent(e,t){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const r=li(e.fieldInfos);Array.isArray(t.fieldInfos)?r.forEach(n=>{const s=t.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:t.fieldInfos.push(n)}):t.fieldInfos=r}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,t){const r=e.orderByFields?.map(s=>this._toFieldOrderJSON(s,e.relationshipId))||[],n=[...t.relatedRecordsInfo?.orderByFields||[],...r];t.relatedRecordsInfo={showRelatedRecords:!0,...n?.length&&{orderByFields:n}}}_writeTextContent(e,t){!t.description&&e.text&&(t.description=e.text)}_writeMediaContent(e,t){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const r=li(e.mediaInfos);Array.isArray(t.mediaInfos)?t.mediaInfos=[...t.mediaInfos,...r]:t.mediaInfos=r}_readPopupInfoElements(e,t,r){const n={description:!1,mediaInfos:!1};return r.map(s=>s.type==="media"?(s.mediaInfos||!t||n.mediaInfos||(s.mediaInfos=t,n.mediaInfos=!0),One.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),yW.fromJSON(s)):s.type==="attachments"?Mne.fromJSON(s):s.type==="fields"?gW.fromJSON(s):s.type==="expression"?Wze.fromJSON(s):s.type==="relationship"?s1e.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:t,order:r}=e;if(!t?.startsWith(OJ))return null;const n=t.replace(OJ,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?s1e.fromJSON({relationshipId:s,orderByFields:[{field:o,order:r}]}):null}_toFieldOrderJSON(e,t){const{order:r,field:n}=e;return{field:`${OJ}${t}/${n}`,order:r}}_readPopupInfo({description:e,mediaInfos:t,showAttachments:r,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new yW({text:e})):s.push(new gW),Array.isArray(t)&&t.length&&s.push(One.fromJSON({mediaInfos:t})),r&&s.push(Mne.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:a}=n;return o&&a?.length&&a.forEach(l=>{const u=this._toRelationshipContent(l);u&&s.push(u)}),s.length?s:e}_getContentElementFields(e){const t=e?.type;if(t==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(t==="custom")return e.outFields||[];if(t==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(t==="media"){const r=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...r.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return t==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:t,title:r,value:n}=e,s=n||{},{fields:o,normalizeField:a,tooltipField:l,sourceURL:u,linkURL:c}=s,h=[...this._extractFieldNames(r),...this._extractFieldNames(t),...this._extractFieldNames(u),...this._extractFieldNames(c),...o??[]];return a&&h.push(a),l&&h.push(l),h}_getContentExpressionInfos(e,t){return Array.isArray(e)?e.reduce((r,n)=>[...r,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],t):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((t,r)=>[...t,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(e,t,r){r&&await Promise.all(r.map(n=>i_(e,t,n.expression)))}_getFieldInfoFields(e){return e?e.filter(t=>t.visible===void 0||!!t.visible).map(t=>t.fieldName).filter(t=>!t.startsWith(OJ)&&!t.startsWith(Cnt)):[]}_getActionsFields(e){return e?e.toArray().reduce((t,r)=>[...t,...this._getActionFields(r)],[]):[]}_getActionFields(e){const{className:t,title:r,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(t),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const t=/{[^}]*}/g,r=e.match(t);if(!r)return[];const n=/\{(\w+):.+\}/,s=r.filter(o=>!(o.indexOf(`{${OJ}`)===0||o.indexOf(`{${Cnt}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};x([D({type:wQi})],Vm.prototype,"actions",void 0),x([D()],Vm.prototype,"content",void 0),x([So("content")],Vm.prototype,"castContent",null),x([Mi("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Vm.prototype,"readContent",null),x([ur("content",{popupElements:{type:dr.ofType(vQi)},showAttachments:{type:Boolean},mediaInfos:{type:dr.ofType(r3t)},description:{type:String},relatedRecordsInfo:{type:bQi}})],Vm.prototype,"writeContent",null),x([D({type:[o1e],json:{write:!0}})],Vm.prototype,"expressionInfos",void 0),x([D({type:[dae]})],Vm.prototype,"fieldInfos",void 0),x([ur("fieldInfos")],Vm.prototype,"writeFieldInfos",null),x([D({type:_Qi})],Vm.prototype,"layerOptions",void 0),x([ur("layerOptions")],Vm.prototype,"writeLayerOptions",null),x([D({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Vm.prototype,"lastEditInfoEnabled",void 0),x([D()],Vm.prototype,"outFields",void 0),x([D()],Vm.prototype,"overwriteActions",void 0),x([D()],Vm.prototype,"returnGeometry",void 0),x([D({json:{type:String}})],Vm.prototype,"title",void 0),x([ur("title")],Vm.prototype,"writeTitle",null),Vm=x([Qe("esri.PopupTemplate")],Vm);const qc=Vm,Ent=new Rs({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let TQi=0,AG=class extends Ci{constructor(e){super(e),this.id="sym"+TQi++,this.type=null,this.color=new jr([0,0,0,1])}readColor(e){return e?.[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};x([D({type:Ent.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:Ent.write}}})],AG.prototype,"type",void 0),x([D({type:jr,json:{write:{allowNull:!0}}})],AG.prototype,"color",void 0),x([Mi("color")],AG.prototype,"readColor",null),AG=x([Qe("esri.symbols.Symbol")],AG);const T0=AG;var oFe;let a4=oFe=class extends T0{constructor(i){super(i),this.data=null,this.type="cim"}readData(i,e){return e}writeData(i,e){Object.assign(e,i)}async collectRequiredFields(i,e){if(this.data?.type==="CIMSymbolReference"){const t=this.data.primitiveOverrides;if(t){const r=t.map(n=>{const s=n.valueExpressionInfo;return s?i_(i,e,s.expression):null});await Promise.all(r)}}}clone(){return new oFe({data:li(this.data)})}hash(){return Q1(JSON.stringify(this.data)).toString()}};x([D({json:{write:!1}})],a4.prototype,"color",void 0),x([D({json:{write:!0}})],a4.prototype,"data",void 0),x([Mi("data",["symbol"])],a4.prototype,"readData",null),x([ur("data",{})],a4.prototype,"writeData",null),x([Wr({CIMSymbolReference:"cim"},{readOnly:!0})],a4.prototype,"type",void 0),a4=oFe=x([Qe("esri.symbols.CIMSymbol")],a4);const pae=a4;let MG=class extends Ci{constructor(e){super(e),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(e,t,r){e||(t[r]=e)}};x([D({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],MG.prototype,"enabled",void 0),x([ur("enabled")],MG.prototype,"writeEnabled",null),x([D({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],MG.prototype,"type",void 0),MG=x([Qe("esri.symbols.Symbol3DLayer")],MG);const z3=MG,CQi=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,EQi="screenUtils.toPt: input not recognized!",s3t=96;function us(i){return i?i/72*s3t:0}function uy(i){return i?72*i/s3t:0}function Cl(i){if(typeof i=="string"){const e=i.match(CQi);if(e){const t=Number(e[1]),r=e[3]&&e[3].toLowerCase(),n=i.charAt(0)==="-",s=r==="px"?uy(t):t;return n?-s:s}return console.warn(EQi),null}return i}function Vd(i=0,e=0){return{x:i,y:e}}function IQi(i=0,e=0){return[i,e]}function E2e(i){const e=r2e(100*(1-i));return Math.max(0,Math.min(e,100))}function vW(i){const e=1-i/100;return Math.max(0,Math.min(e,1))}function AQi(i,e){const t=e.transparency!=null?vW(e.transparency):1,r=e.color;return r&&Array.isArray(r)?new jr([r[0]||0,r[1]||0,r[2]||0,t]):null}function MQi(i,e){e.color=i.toJSON().slice(0,3);const t=E2e(i.a);t!==0&&(e.transparency=t)}const Hk={type:jr,json:{type:[ms],default:null,read:{source:["color","transparency"],reader:AQi},write:{target:{color:{type:[ms]},transparency:{type:ms}},writer:MQi}}},h3={type:Number,cast:Cl,json:{write:!0}};let ON=class extends Ci{constructor(e){super(e),this.color=new jr([0,0,0,1]),this.extensionLength=0,this.size=uy(1)}clone(){}cloneProperties(){return{color:li(this.color),size:this.size,extensionLength:this.extensionLength}}};x([D({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],ON.prototype,"type",void 0),x([D(Hk)],ON.prototype,"color",void 0),x([D({...h3,json:{write:{overridePolicy:i=>({enabled:!!i})}}})],ON.prototype,"extensionLength",void 0),x([D(h3)],ON.prototype,"size",void 0),ON=x([Qe("esri.symbols.edges.Edges3D")],ON);const Jze=ON;var aFe;let ame=aFe=class extends Jze{constructor(i){super(i),this.type="sketch"}clone(){return new aFe(this.cloneProperties())}};x([Wr({sketch:"sketch"},{readOnly:!0})],ame.prototype,"type",void 0),ame=aFe=x([Qe("esri.symbols.edges.SketchEdges3D")],ame);const OQi=ame;var lFe;let lme=lFe=class extends Jze{constructor(i){super(i),this.type="solid"}clone(){return new lFe(this.cloneProperties())}};x([Wr({solid:"solid"},{readOnly:!0})],lme.prototype,"type",void 0),lme=lFe=x([Qe("esri.symbols.support.SolidEdges3D")],lme);const PQi=lme,Kze={types:{key:"type",base:Jze,typeMap:{solid:PQi,sketch:OQi}},json:{write:!0}};var uFe;let vx=uFe=class extends Ci{constructor(i){super(i),this.color=null}clone(){const i={color:this.color!=null?this.color.clone():null};return new uFe(i)}};x([D(Hk)],vx.prototype,"color",void 0),vx=uFe=x([Qe("esri.symbols.support.Symbol3DMaterial")],vx);var cFe;let l4=cFe=class extends z3{constructor(i){super(i),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new cFe({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};x([Wr({Extrude:"extrude"},{readOnly:!0})],l4.prototype,"type",void 0),x([D({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],l4.prototype,"size",void 0),x([D({type:vx,json:{write:!0}})],l4.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],l4.prototype,"castShadows",void 0),x([D(Kze)],l4.prototype,"edges",void 0),l4=cFe=x([Qe("esri.symbols.ExtrudeSymbol3DLayer")],l4);const o3t=l4;let tQ=class extends T0{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};x([Wr({esriSLS:"simple-line"},{readOnly:!0})],tQ.prototype,"type",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],tQ.prototype,"width",void 0),tQ=x([Qe("esri.symbols.LineSymbol")],tQ);const RQi=tQ,DQi=["begin","end","begin-end"],a3t=["arrow","circle","square","diamond","cross","x"];var hFe;let cI=hFe=class extends Ci{constructor(i){super(i),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(i,e,t,r){e[t]=r?.origin==="web-map"?"arrow":i}set color(i){this._set("color",i)}readColor(i){return i?.[0]!=null?[i[0],i[1],i[2],i[3]/255]:i}writeColor(i,e,t,r){r?.origin==="web-map"||(e[t]=i)}clone(){return new hFe({color:li(this.color),placement:this.placement,style:this.style})}hash(){return`${this.placement}.${this.color?.hash()}.${this.style}`}};x([D({type:["begin","end","begin-end"],json:{write:!0}})],cI.prototype,"placement",void 0),x([Wr({"line-marker":"line-marker"},{readOnly:!0}),D({json:{origins:{"web-map":{write:!1}}}})],cI.prototype,"type",void 0),x([D({type:a3t})],cI.prototype,"style",void 0),x([ur("style")],cI.prototype,"writeStyle",null),x([D({type:jr,value:null,json:{write:{allowNull:!0}}})],cI.prototype,"color",null),x([Mi("color")],cI.prototype,"readColor",null),x([ur("color")],cI.prototype,"writeColor",null),cI=hFe=x([Qe("esri.symbols.LineSymbolMarker")],cI);const FQi=cI;var dFe;const m3e=new Rs({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let GM=dFe=class extends RQi{constructor(...i){super(...i),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(i,e,t,r,n,s){if(i&&typeof i!="string")return i;const o={};return i!=null&&(o.style=i),e!=null&&(o.color=e),t!=null&&(o.width=Cl(t)),r!=null&&(o.cap=r),n!=null&&(o.join=n),s!=null&&(o.miterLimit=Cl(s)),o}clone(){return new dFe({color:li(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};x([Wr({esriSLS:"simple-line"},{readOnly:!0})],GM.prototype,"type",void 0),x([D({type:m3e.apiValues,json:{read:m3e.read,write:m3e.write}})],GM.prototype,"style",void 0),x([D({type:["butt","round","square"],json:{write:{overridePolicy:(i,e,t)=>({enabled:i!=="round"&&t?.origin==null})}}})],GM.prototype,"cap",void 0),x([D({type:["miter","round","bevel"],json:{write:{overridePolicy:(i,e,t)=>({enabled:i!=="round"&&t?.origin==null})}}})],GM.prototype,"join",void 0),x([D({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":FQi}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],GM.prototype,"marker",void 0),x([D({type:Number,json:{read:!1,write:!1}})],GM.prototype,"miterLimit",void 0),GM=dFe=x([Qe("esri.symbols.SimpleLineSymbol")],GM);const vg=GM;let iQ=class extends T0{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};x([D({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":vg}},json:{default:null,write:!0}})],iQ.prototype,"outline",void 0),x([D({type:["simple-fill","picture-fill"],readOnly:!0})],iQ.prototype,"type",void 0),iQ=x([Qe("esri.symbols.FillSymbol")],iQ);const l3t=iQ;let ume=class extends Ci{constructor(e){super(e)}clone(){}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],ume.prototype,"type",void 0),ume=x([Qe("esri.symbols.patterns.LinePattern3D")],ume);const u3t=ume,kQi=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var pFe;const LQi=pa()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let rQ=pFe=class extends u3t{constructor(i){super(i),this.type="style",this.style="solid"}clone(){const i={style:this.style};return new pFe(i)}};x([D({type:["style"]})],rQ.prototype,"type",void 0),x([Wr(LQi),D({type:kQi})],rQ.prototype,"style",void 0),rQ=pFe=x([Qe("esri.symbols.patterns.LineStylePattern3D")],rQ);const Zze=rQ;let cme=class extends Ci{constructor(e){super(e)}clone(){}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],cme.prototype,"type",void 0),cme=x([Qe("esri.symbols.patterns.Pattern3D")],cme);const c3t=cme,NQi=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var fFe;let nQ=fFe=class extends c3t{constructor(i){super(i),this.type="style",this.style="solid"}clone(){const i={style:this.style};return new fFe(i)}};x([D({type:["style"]})],nQ.prototype,"type",void 0),x([D({type:NQi,json:{read:!0,write:!0}})],nQ.prototype,"style",void 0),nQ=fFe=x([Qe("esri.symbols.patterns.StylePattern3D")],nQ);const h3t=nQ,$Qi={types:{key:"type",base:c3t,typeMap:{style:h3t}},json:{write:!0}},d3t={types:{key:"type",base:u3t,typeMap:{style:Zze}},json:{write:!0}},Sie=new jr("white");new jr("black");const BQi=new jr([255,255,255,0]);function jQi(i){return i.r===0&&i.g===0&&i.b===0}var mFe;let Tie=mFe=class extends vx{constructor(i){super(i),this.colorMixMode=null}clone(){const i={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new mFe(i)}};x([Wr({multiply:"multiply",replace:"replace",tint:"tint"})],Tie.prototype,"colorMixMode",void 0),Tie=mFe=x([Qe("esri.symbols.support.Symbol3DFillMaterial")],Tie);function Dx(i=m3t){return[i[0],i[1],i[2],i[3],i[4],i[5]]}function I2e(i,e,t,r,n,s,o=Dx()){return o[0]=i,o[1]=e,o[2]=t,o[3]=r,o[4]=n,o[5]=s,o}function GQi(i,e){const t=isFinite(i[2])||isFinite(i[5]);return new hr(t?{xmin:i[0],xmax:i[3],ymin:i[1],ymax:i[4],zmin:i[2],zmax:i[5],spatialReference:e}:{xmin:i[0],xmax:i[3],ymin:i[1],ymax:i[4],spatialReference:e})}function sQ(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.min(i[2],e[2]),i[3]=Math.max(i[3],e[3]),i[4]=Math.max(i[4],e[4]),i[5]=Math.max(i[5],e[5])}function Pne(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.min(i[2],e[2]),i[3]=Math.max(i[3],e[0]),i[4]=Math.max(i[4],e[1]),i[5]=Math.max(i[5],e[2])}function UQi(i,e,t=0,r=e.length/3){let n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],u=i[5];for(let c=0;c=i[3]?0:i[3]-i[0]}function VQi(i){return i[1]>=i[4]?0:i[4]-i[1]}function HQi(i){return i[2]>=i[5]?0:i[5]-i[2]}function Int(i,e=[0,0,0]){return e[0]=zQi(i),e[1]=VQi(i),e[2]=HQi(i),e}function WQi(i,e,t=i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t!==i&&(t[3]=i[3],t[4]=i[4],t[5]=i[5]),t}function qQi(i,e,t=i){return t[3]=e[0],t[4]=e[1],t[5]=e[2],t!==i&&(t[0]=i[0],t[1]=i[1],t[2]=i[2]),i}function p3t(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i}function f3t(i){return i?p3t(i,$V):Dx($V)}function YQi(i,e){return i[0]=e[0],i[1]=e[1],i[2]=Number.NEGATIVE_INFINITY,i[3]=e[2],i[4]=e[3],i[5]=Number.POSITIVE_INFINITY,i}function a1e(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=Number.NEGATIVE_INFINITY,i[3]=r,i[4]=n,i[5]=Number.POSITIVE_INFINITY,i}function gFe(i){return i.length===6}function XQi(i,e,t){if(i==null||e==null)return i===e;if(!gFe(i)||!gFe(e))return!1;for(let r=0;r{const e=Gd(i);return e===0?1:uu(e,.1,4)},nonNullable:!0},ner=["left","right","center"],ser=["baseline","top","middle","bottom"],v3t={type:ner,nonNullable:!0},_3t={type:ser,nonNullable:!0},oer=8;var vFe;let zM=vFe=class extends Ci{constructor(i){super(i),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(i){return Cl(i)}clone(){return new vFe({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};x([D({type:ter,json:{default:"none",write:!0}})],zM.prototype,"decoration",void 0),x([D({type:String,json:{write:!0}})],zM.prototype,"family",void 0),x([D({type:Number,json:{write:{overridePolicy:(i,e,t)=>({enabled:!t||!t.textSymbol3D})}}})],zM.prototype,"size",void 0),x([So("size")],zM.prototype,"castSize",null),x([D({type:ier,json:{default:"normal",write:!0}})],zM.prototype,"style",void 0),x([D({type:rer,json:{default:"normal",write:!0}})],zM.prototype,"weight",void 0),zM=vFe=x([Qe("esri.symbols.Font")],zM);const mae=zM;var _Fe;const aer=pa()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let RN=_Fe=class extends Ci{constructor(i){super(i)}readHref(i,e,t){return i?mE(i,t):e.dataURI}writeHref(i,e,t,r){i&&(Vx(i)?e.dataURI=i:(e.href=gE(i,r),u0(e.href)&&(e.href=X1(e.href))))}clone(){return new _Fe({href:this.href,primitive:this.primitive})}};x([D({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],RN.prototype,"href",void 0),x([Mi("href")],RN.prototype,"readHref",null),x([ur("href",{href:{type:String},dataURI:{type:String}})],RN.prototype,"writeHref",null),x([Wr(aer)],RN.prototype,"primitive",void 0),RN=_Fe=x([Qe("esri.symbols.support.IconSymbol3DLayerResource")],RN);var bFe;let Dz=bFe=class extends un{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new bFe({x:this.x,y:this.y})}};x([D({type:Number})],Dz.prototype,"x",void 0),x([D({type:Number})],Dz.prototype,"y",void 0),Dz=bFe=x([Qe("esri.symbols.support.Symbol3DAnchorPosition2D")],Dz);var wFe;let oQ=wFe=class extends Ci{constructor(i){super(i),this.color=new jr([0,0,0,1]),this.size=uy(1)}clone(){const i={color:this.color!=null?this.color.clone():null,size:this.size};return new wFe(i)}};x([D(Hk)],oQ.prototype,"color",void 0),x([D(h3)],oQ.prototype,"size",void 0),oQ=wFe=x([Qe("esri.symbols.support.Symbol3DIconOutline")],oQ);var OG;const b3t="esri.symbols.IconSymbol3DLayer";let hI=OG=class extends z3{constructor(i){super(i),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new OG({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(i){const e=i.color||Sie,t=Ant(i),r=i.outline&&i.outline.width>0?{size:i.outline.width,color:(i.outline.color||Sie).clone()}:null;return new OG({size:i.size,resource:{primitive:uer(i.style)},material:{color:e},outline:r,anchor:t?"relative":void 0,anchorPosition:t})}static fromPictureMarkerSymbol(i){const e=!i.color||jQi(i.color)?Sie:i.color,t=Ant(i);return new OG({size:i.width<=i.height?i.height:i.width,resource:{href:i.url},material:{color:e.clone()},anchor:t?"relative":void 0,anchorPosition:t})}static fromCIMSymbol(i){return new OG({resource:{href:QCt({mediaType:"application/json",data:JSON.stringify(i.data)})}})}};function Ant(i){const e="width"in i?i.width:i.size,t="height"in i?i.height:i.size,r=Mnt(i.xoffset),n=Mnt(i.yoffset);return(r||n)&&e&&t?{x:-r/e,y:n/t}:null}function Mnt(i){return isFinite(i)?i:0}x([D({type:vx,json:{write:!0}})],hI.prototype,"material",void 0),x([D({type:RN,json:{write:!0}})],hI.prototype,"resource",void 0),x([Wr({Icon:"icon"},{readOnly:!0})],hI.prototype,"type",void 0),x([D(h3)],hI.prototype,"size",void 0),x([Wr({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),D({json:{default:"center"}})],hI.prototype,"anchor",void 0),x([D({type:Dz,json:{type:[Number],read:{reader:i=>new Dz({x:i[0],y:i[1]})},write:{writer:(i,e)=>{e.anchorPosition=[i.x,i.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],hI.prototype,"anchorPosition",void 0),x([D({type:oQ,json:{write:!0}})],hI.prototype,"outline",void 0),hI=OG=x([Qe(b3t)],hI);const ler={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function uer(i){return ler[i]||(di.getLogger(b3t).warn(`${i} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const o8=hI;let DN=class extends xs(Ci){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return e!=null&&e.placement===this.placement&&e.style===this.style&&(this.color==null&&e.color==null||this.color!=null&&e.color!=null&&this.color.toJSON()===e.color.toJSON())}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],DN.prototype,"type",void 0),x([D({type:DQi,json:{default:"begin-end",write:!0}})],DN.prototype,"placement",void 0),x([D({type:a3t,json:{default:"arrow",write:!0}})],DN.prototype,"style",void 0),x([D({type:jr,json:{type:[ms],default:null,write:!0}})],DN.prototype,"color",void 0),DN=x([Qe("esri.symbols.LineStyleMarker3D")],DN);const xFe=DN;var dme;let dI=dme=class extends z3{constructor(i){super(i),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=uy(1),this.pattern=null,this.marker=null}clone(){const i={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new dme(i)}static fromSimpleLineSymbol(i){const e={enabled:!0,size:i.width??uy(1),cap:i.cap||"butt",join:i.join||"miter",pattern:i.style&&i.style!=="inside-frame"?new Zze({style:i.style}):null,material:new vx({color:(i.color||Sie).clone()}),marker:i.marker?new xFe({placement:i.marker.placement,style:i.marker.style,color:i.marker.color?.clone()??null}):null};return new dme(e)}};x([D({type:vx,json:{write:!0}})],dI.prototype,"material",void 0),x([Wr({Line:"line"},{readOnly:!0})],dI.prototype,"type",void 0),x([D({type:g3t,json:{write:!0,default:"miter"}})],dI.prototype,"join",void 0),x([D({type:Qze,json:{write:!0,default:"butt"}})],dI.prototype,"cap",void 0),x([D(h3)],dI.prototype,"size",void 0),x([D(d3t)],dI.prototype,"pattern",void 0),x([D({types:{key:"type",base:xFe,typeMap:{style:xFe}},json:{write:!0}})],dI.prototype,"marker",void 0),dI=dme=x([Qe("esri.symbols.LineSymbol3DLayer")],dI);const gae=dI;var SFe;const cer=pa()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let aQ=SFe=class extends Ci{clone(){return new SFe({href:this.href,primitive:this.primitive})}};x([D({type:String,json:{read:mY,write:cR}})],aQ.prototype,"href",void 0),x([Wr(cer)],aQ.prototype,"primitive",void 0),aQ=SFe=x([Qe("esri.symbols.support.ObjectSymbol3DLayerResource")],aQ);var TFe;let C6=TFe=class extends un{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new TFe({x:this.x,y:this.y,z:this.z})}};x([D({type:Number})],C6.prototype,"x",void 0),x([D({type:Number})],C6.prototype,"y",void 0),x([D({type:Number})],C6.prototype,"z",void 0),C6=TFe=x([Qe("esri.symbols.support.Symbol3DAnchorPosition3D")],C6);var CFe;let V0=CFe=class extends z3{constructor(i){super(i),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new CFe({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition?.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:this.material?.clone()??null,castShadows:this.castShadows,resource:this.resource?.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};x([D({type:vx,json:{write:!0}})],V0.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],V0.prototype,"castShadows",void 0),x([D({type:aQ,json:{write:!0}})],V0.prototype,"resource",void 0),x([Wr({Object:"object"},{readOnly:!0})],V0.prototype,"type",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"width",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"height",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"depth",void 0),x([Wr({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),D({json:{default:"origin"}})],V0.prototype,"anchor",void 0),x([D({type:C6,json:{type:[Number],read:{reader:i=>new C6({x:i[0],y:i[1],z:i[2]})},write:{writer:(i,e)=>{e.anchorPosition=[i.x,i.y,i.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],V0.prototype,"anchorPosition",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"heading",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"tilt",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"roll",void 0),x([D({readOnly:!0})],V0.prototype,"isPrimitive",null),V0=CFe=x([Qe("esri.symbols.ObjectSymbol3DLayer")],V0);const eVe=V0;var EFe;let l1=EFe=class extends z3{constructor(i){super(i),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(i,e){return i??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(i,e){return i??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new EFe({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};x([D({type:vx,json:{write:!0}})],l1.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],l1.prototype,"castShadows",void 0),x([Wr({Path:"path"},{readOnly:!0})],l1.prototype,"type",void 0),x([D({type:["circle","quad"],json:{write:!0,default:"circle"}})],l1.prototype,"profile",void 0),x([D({type:g3t,json:{write:!0,default:"miter"}})],l1.prototype,"join",void 0),x([D({type:eer,json:{write:!0,default:"butt"}})],l1.prototype,"cap",void 0),x([D({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],l1.prototype,"width",void 0),x([Mi("width",["width","size","height"])],l1.prototype,"readWidth",null),x([D({type:Number,json:{write:!0}})],l1.prototype,"height",void 0),x([Mi("height",["height","size","width"])],l1.prototype,"readHeight",null),x([D({type:["center","bottom","top"],json:{write:!0,default:"center"}})],l1.prototype,"anchor",void 0),x([D({type:["heading","all"],json:{write:!0,default:"all"}})],l1.prototype,"profileRotation",void 0),l1=EFe=x([Qe("esri.symbols.PathSymbol3DLayer")],l1);const tVe=l1;var IFe;let Fz=IFe=class extends Ci{constructor(){super(...arguments),this.color=new jr([0,0,0,1]),this.size=0}clone(){const i={color:li(this.color),size:this.size};return new IFe(i)}};x([D(Hk)],Fz.prototype,"color",void 0),x([D(h3)],Fz.prototype,"size",void 0),Fz=IFe=x([Qe("esri.symbols.support.Symbol3DHalo")],Fz);let Cie=class extends xs(Ci){constructor(e){super(e),this.color=null}};x([D(Hk)],Cie.prototype,"color",void 0),Cie=x([Qe("esri.symbols.support.Symbol3DTextBackground")],Cie);var pme;let F_=pme=class extends z3{constructor(i){super(i),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(i){i!=null&&this._userSize!=null&&(i.size=this._userSize),this._set("font",i)}writeFont(i,e,t,r){const n={...r,textSymbol3D:!0};e.font=i.write({},n),delete e.font.size}get size(){return this._userSize!=null?this._userSize:this.font?.size!=null?this.font.size:9}set size(i){this._userSize=i,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const i=new pme({enabled:this.enabled,font:this.font&&li(this.font),halo:this.halo&&li(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:li(this.background)});return i._userSize=this._userSize,i}static fromTextSymbol(i){return new pme({font:i.font!=null?i.font.clone():new mae,halo:her(i.haloColor,i.haloSize),horizontalAlignment:i.horizontalAlignment,lineHeight:i.lineHeight,material:i.color?new vx({color:i.color.clone()}):null,text:i.text,verticalAlignment:i.verticalAlignment,background:i.backgroundColor?new Cie({color:i.backgroundColor.clone()}):null})}};function her(i,e){return i&&e!=null&&e>0?new Fz({color:li(i),size:e}):null}x([D({type:mae,json:{write:!0}})],F_.prototype,"font",null),x([ur("font")],F_.prototype,"writeFont",null),x([D({type:Fz,json:{write:!0}})],F_.prototype,"halo",void 0),x([D({...v3t,json:{default:"center",write:!0}})],F_.prototype,"horizontalAlignment",void 0),x([D({...y3t,json:{default:1,write:!0}})],F_.prototype,"lineHeight",void 0),x([D({type:vx,json:{write:!0}})],F_.prototype,"material",void 0),x([D({type:Cie,json:{write:!0}})],F_.prototype,"background",void 0),x([D(h3)],F_.prototype,"size",null),x([D({type:String,json:{write:!0}})],F_.prototype,"text",void 0),x([Wr({Text:"text"},{readOnly:!0})],F_.prototype,"type",void 0),x([D({..._3t,json:{default:"baseline",write:!0}})],F_.prototype,"verticalAlignment",void 0),F_=pme=x([Qe("esri.symbols.TextSymbol3DLayer")],F_);const SY=F_;var AFe;let u4=AFe=class extends z3{constructor(i){super(i),this.color=MFe.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new AFe({color:li(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};x([D({type:jr,nonNullable:!0,json:{type:[ms],write:(i,e,t)=>e[t]=i.toArray(jr.AlphaMode.UNLESS_OPAQUE),default:()=>MFe.clone(),defaultEquals:i=>i.toCss(!0)===MFe.toCss(!0)}})],u4.prototype,"color",void 0),x([Wr({Water:"water"},{readOnly:!0})],u4.prototype,"type",void 0),x([D({type:["small","medium","large"],json:{write:!0,default:"medium"}})],u4.prototype,"waterbodySize",void 0),x([D({type:Number,json:{write:!0,default:null}})],u4.prototype,"waveDirection",void 0),x([D({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],u4.prototype,"waveStrength",void 0),u4=AFe=x([Qe("esri.symbols.WaterSymbol3DLayer")],u4);const MFe=new jr([0,119,190]),w3t=u4;var OFe;let FN=OFe=class extends un{constructor(i){super(i),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new OFe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};x([D({type:String})],FN.prototype,"name",void 0),x([D({type:String})],FN.prototype,"styleUrl",void 0),x([D({type:String})],FN.prototype,"styleName",void 0),x([D({type:Bu})],FN.prototype,"portal",void 0),FN=OFe=x([Qe("esri.symbols.support.StyleOrigin")],FN);const Rne=FN;var PFe;let X8=PFe=class extends un{constructor(){super(...arguments),this.url=""}clone(){return new PFe({url:this.url})}};x([D({type:String})],X8.prototype,"url",void 0),X8=PFe=x([Qe("esri.symbols.support.Thumbnail")],X8);const x3t={icon:o8,object:eVe,line:gae,path:tVe,fill:fae,extrude:o3t,text:SY,water:w3t},der=dr.ofType({base:z3,key:"type",typeMap:x3t,errorContext:"symbol-layer"});let pI=class extends T0{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers,r=t?.type,n=r||dr;this._set("symbolLayers",new n)}get color(){return null}set color(e){this.constructed&&di.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){ay(e,this._get("symbolLayers"))}readStyleOrigin(e,t,r){if(e.styleUrl&&e.name){const n=mE(e.styleUrl,r);return new Rne({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new Rne({portal:r?.portal||Bu.getDefault(),styleName:e.styleName,name:e.name});r?.messages&&r.messages.push(new Rf("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:e}))}writeStyleOrigin(e,t,r,n){if(e.styleUrl&&e.name){let s=gE(e.styleUrl,n);u0(s)&&(s=X1(s)),t.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&n?.portal&&!eze(e.portal.restUrl,n.portal.restUrl)?n?.messages&&n.messages.push(new Rf("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof z3||e&&x3t[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};x([D({json:{read:!1,write:!1}})],pI.prototype,"color",null),x([D({type:der,nonNullable:!0,json:{write:!0}}),So(fY)],pI.prototype,"symbolLayers",null),x([D({type:Rne})],pI.prototype,"styleOrigin",void 0),x([Mi("styleOrigin")],pI.prototype,"readStyleOrigin",null),x([ur("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],pI.prototype,"writeStyleOrigin",null),x([D({type:X8,json:{read:!1}})],pI.prototype,"thumbnail",void 0),x([D({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],pI.prototype,"type",void 0),pI=x([Qe("esri.symbols.Symbol3D")],pI);const TY=pI;let lQ=class extends Ci{constructor(e){super(e),this.visible=!0}clone(){}};x([D({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],lQ.prototype,"type",void 0),x([D({readOnly:!0})],lQ.prototype,"visible",void 0),lQ=x([Qe("esri.symbols.callouts.Callout3D")],lQ);const S3t=lQ;var RFe;let fme=RFe=class extends Ci{constructor(i){super(i),this.color=new jr("white")}clone(){return new RFe({color:li(this.color)})}};x([D(Hk)],fme.prototype,"color",void 0),fme=RFe=x([Qe("esri.symbols.callouts.LineCallout3DBorder")],fme);const per=fme;var DFe;let c4=DFe=class extends S3t{constructor(i){super(i),this.type="line",this.color=new jr([0,0,0,1]),this.size=uy(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new DFe({color:li(this.color),size:this.size,border:li(this.border)})}};x([Wr({line:"line"})],c4.prototype,"type",void 0),x([D(Hk)],c4.prototype,"color",void 0),x([D(h3)],c4.prototype,"size",void 0),x([D({type:per,json:{write:!0}})],c4.prototype,"border",void 0),x([D({readOnly:!0})],c4.prototype,"visible",null),c4=DFe=x([Qe("esri.symbols.callouts.LineCallout3D")],c4);const T3t=c4;function iVe(i){if(!i)return!1;const e=i.verticalOffset;return!!e&&!(e.screenLength<=0||e.maxWorldLength!=null&&e.maxWorldLength<=0)}function C3t(i){if(!i||!i.supportsCallout||!i.supportsCallout())return!1;const e=i.callout;return!!e&&!!e.visible&&!!iVe(i)}const E3t={types:{key:"type",base:S3t,typeMap:{line:T3t}},json:{write:!0}};var FFe;let PG=FFe=class extends Ci{constructor(i){super(i),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new FFe({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};x([D(h3)],PG.prototype,"screenLength",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0,default:0}})],PG.prototype,"minWorldLength",void 0),x([D({type:Number,json:{write:!0}})],PG.prototype,"maxWorldLength",void 0),PG=FFe=x([Qe("esri.symbols.support.Symbol3DVerticalOffset")],PG);const rVe=PG;var mme;const I3t=dr.ofType({base:null,key:"type",typeMap:{text:SY}});let h4=mme=class extends TY{constructor(i){super(i),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new I3t,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return C3t(this)}hasVisibleVerticalOffset(){return iVe(this)}clone(){return new mme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail),callout:li(this.callout),verticalOffset:li(this.verticalOffset)})}static fromTextSymbol(i){return new mme({symbolLayers:new dr([SY.fromTextSymbol(i)])})}};x([D({type:rVe,json:{write:!0}})],h4.prototype,"verticalOffset",void 0),x([D(E3t)],h4.prototype,"callout",void 0),x([D({json:{read:!1,write:!1}})],h4.prototype,"styleOrigin",void 0),x([D({type:I3t})],h4.prototype,"symbolLayers",void 0),x([Wr({LabelSymbol3D:"label-3d"},{readOnly:!0})],h4.prototype,"type",void 0),h4=mme=x([Qe("esri.symbols.LabelSymbol3D")],h4);const A2e=h4;var gme;const A3t=dr.ofType({base:null,key:"type",typeMap:{line:gae,path:tVe}}),fer=dr.ofType({base:null,key:"type",typeMap:{line:gae,path:tVe}});let uQ=gme=class extends TY{constructor(i){super(i),this.symbolLayers=new A3t,this.type="line-3d"}clone(){return new gme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleLineSymbol(i){return new gme({symbolLayers:new dr([gae.fromSimpleLineSymbol(i)])})}};x([D({type:A3t,json:{type:fer}})],uQ.prototype,"symbolLayers",void 0),x([Wr({LineSymbol3D:"line-3d"},{readOnly:!0})],uQ.prototype,"type",void 0),uQ=gme=x([Qe("esri.symbols.LineSymbol3D")],uQ);const M2e=uQ;let d4=class extends T0{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};x([D({type:Number,json:{read:i=>i&&-1*i,write:(i,e)=>e.angle=i&&-1*i}})],d4.prototype,"angle",void 0),x([D({type:["simple-marker","picture-marker"],readOnly:!0})],d4.prototype,"type",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],d4.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],d4.prototype,"yoffset",void 0),x([D({type:Number,cast:i=>i==="auto"?i:Cl(i),json:{write:!0}})],d4.prototype,"size",void 0),d4=x([Qe("esri.symbols.MarkerSymbol")],d4);const M3t=d4;var yme;const O3t=dr.ofType({base:null,key:"type",typeMap:{fill:fae}});let cQ=yme=class extends TY{constructor(i){super(i),this.symbolLayers=new O3t,this.type="mesh-3d"}clone(){return new yme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleFillSymbol(i){return new yme({symbolLayers:new dr([fae.fromSimpleFillSymbol(i)])})}};x([D({type:O3t})],cQ.prototype,"symbolLayers",void 0),x([Wr({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],cQ.prototype,"type",void 0),cQ=yme=x([Qe("esri.symbols.MeshSymbol3D")],cQ);const O2e=cQ;function mer(i,e,t){return e.imageData?QCt({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):P3t(e.url,t)}function P3t(i,e){if(!u0(i)){const t=yer(e);if(t)return Iu(t,"images",i)}return mE(i,e)}function ger(i,e,t,r){if(Vx(i)){const n=lR(i);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,t&&t.imageData===e.imageData&&t.url&&cR(t.url,e,"url",r)}else cR(i,e,"url",r)}const R3t={json:{read:{source:["imageData","url"],reader:mer},write:{writer(i,e,t,r){ger(i,e,this.source,r)}}}},D3t={readOnly:!0,json:{read:{source:["imageData","url"],reader(i,e,t){const r={};return e.imageData&&(r.imageData=e.imageData),e.contentType&&(r.contentType=e.contentType),e.url&&(r.url=P3t(e.url,t)),r}}}};function yer(i){if(!i)return null;const{origin:e,layer:t}=i;if(e!=="service"&&e!=="portal-item")return null;const r=t?.type;return r==="feature"||r==="stream"?t.parsedUrl?.path:r==="map-image"||r==="tile"?i.url?.path:null}var kFe;let T2=kFe=class extends l3t{constructor(...i){super(...i),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(i,e,t,r){if(i&&typeof i!="string"&&i.imageData==null)return i;const n={};return i&&(n.url=i),e&&(n.outline=e),t!=null&&(n.width=Cl(t)),r!=null&&(n.height=Cl(r)),n}clone(){const i=new kFe({color:li(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return i._set("source",li(this.source)),i}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};x([Wr({esriPFS:"picture-fill"},{readOnly:!0})],T2.prototype,"type",void 0),x([D(R3t)],T2.prototype,"url",void 0),x([D({type:Number,json:{write:!0}})],T2.prototype,"xscale",void 0),x([D({type:Number,json:{write:!0}})],T2.prototype,"yscale",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"width",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"height",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"yoffset",void 0),x([D(D3t)],T2.prototype,"source",void 0),T2=kFe=x([Qe("esri.symbols.PictureFillSymbol")],T2);const F3t=T2;var LFe;let DT=LFe=class extends M3t{constructor(...i){super(...i),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string"&&i.imageData==null)return i;const r={};return i&&(r.url=i),e!=null&&(r.width=Cl(e)),t!=null&&(r.height=Cl(t)),r}readHeight(i,e){return e.size||i}readWidth(i,e){return e.size||i}clone(){const i=new LFe({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return i._set("source",li(this.source)),i}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};x([D({json:{write:!1}})],DT.prototype,"color",void 0),x([Wr({esriPMS:"picture-marker"},{readOnly:!0})],DT.prototype,"type",void 0),x([D(R3t)],DT.prototype,"url",void 0),x([D(D3t)],DT.prototype,"source",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],DT.prototype,"height",void 0),x([Mi("height",["height","size"])],DT.prototype,"readHeight",null),x([D({type:Number,cast:Cl,json:{write:!0}})],DT.prototype,"width",void 0),x([D({json:{write:!1}})],DT.prototype,"size",void 0),DT=LFe=x([Qe("esri.symbols.PictureMarkerSymbol")],DT);const BP=DT;var kN;const k3t=dr.ofType({base:null,key:"type",typeMap:{icon:o8,object:eVe,text:SY}});let LN=kN=class extends TY{constructor(i){super(i),this.verticalOffset=null,this.callout=null,this.symbolLayers=new k3t,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const i of this.symbolLayers.items)switch(i.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return C3t(this)}hasVisibleVerticalOffset(){return iVe(this)}clone(){return new kN({verticalOffset:li(this.verticalOffset),callout:li(this.callout),styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleMarkerSymbol(i){return new kN({symbolLayers:new dr([o8.fromSimpleMarkerSymbol(i)])})}static fromPictureMarkerSymbol(i){return new kN({symbolLayers:new dr([o8.fromPictureMarkerSymbol(i)])})}static fromCIMSymbol(i){if(i.data?.symbol?.type!=="CIMPointSymbol")return null;const t=i.data.symbol;return new kN(t?.callout?{symbolLayers:new dr([o8.fromCIMSymbol(i)]),callout:new T3t({size:.5,color:new jr([0,0,0])}),verticalOffset:new rVe({screenLength:40})}:{symbolLayers:new dr([o8.fromCIMSymbol(i)])})}static fromTextSymbol(i){return new kN({symbolLayers:new dr([SY.fromTextSymbol(i)])})}};x([D({type:rVe,json:{write:!0}})],LN.prototype,"verticalOffset",void 0),x([D(E3t)],LN.prototype,"callout",void 0),x([D({type:k3t,json:{origins:{"web-scene":{write:!0}}}})],LN.prototype,"symbolLayers",void 0),x([Wr({PointSymbol3D:"point-3d"},{readOnly:!0})],LN.prototype,"type",void 0),LN=kN=x([Qe("esri.symbols.PointSymbol3D")],LN);const a8=LN;function Ki(i,e,t={}){return nVe(i,e,t,L3t)}function v0(i,e,t={}){return nVe(i,e,t,N3t)}function nVe(i,e,t={},r){let n=null;const s=t.once?(o,a)=>{r(o)&&(Hc(n),e(o,a))}:(o,a)=>{r(o)&&e(o,a)};if(n=IHi(i,s,t.sync,t.equals),t.initial){const o=i();s(o,o)}return n}function ju(i,e,t,r={}){let n=null,s=null,o=null;function a(){n&&s&&(s.remove(),r.onListenerRemove?.(n),n=null,s=null)}function l(c){r.once&&r.once&&Hc(o),t(c)}const u=Ki(i,(c,h)=>{a(),e2e(c)&&(n=c,s=BA(c,e,l),r.onListenerAdd?.(c))},{sync:r.sync,initial:!0});return o=wa(()=>{u.remove(),a()}),o}function fR(i,e){return ver(i,N3t,e)}function ver(i,e,t){if(xg(t))return Promise.reject(Oc());const r=i();if(e?.(r))return Promise.resolve(r);let n=null;function s(){n=Hc(n)}return new Promise((o,a)=>{n=j3([Qh(t,()=>{s(),a(Oc())}),nVe(i,l=>{s(),o(l)},{sync:!1,once:!0},e??L3t)])})}function L3t(i){return!0}function N3t(i){return!!i}const Kl={sync:!0},js={initial:!0},Ah={sync:!0,initial:!0};var hQ;const $3t=dr.ofType({base:null,key:"type",typeMap:{extrude:o3t,fill:fae,icon:o8,line:gae,object:eVe,text:SY,water:w3t}});let dQ=hQ=class extends TY{constructor(i){super(i),this.symbolLayers=new $3t,this.type="polygon-3d"}initialize(){const i=e=>{e.type==="line"&&UF(di.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),e.type==="text"&&UF(di.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const e of this.symbolLayers)i(e);this.addHandles(ju(()=>this.symbolLayers,"after-add",({item:e})=>i(e),Kl))}clone(){return new hQ({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromJSON(i){const e=new hQ;if(e.read(i),e.symbolLayers.length===2&&e.symbolLayers.at(0).type==="fill"&&e.symbolLayers.at(1).type==="line"){const t=e.symbolLayers.at(0),r=e.symbolLayers.at(1);!r.enabled||i.symbolLayers?.[1]&&i.symbolLayers[1].enable===!1||(t.outline={size:r.size,color:r.material!=null?r.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(i){return new hQ({symbolLayers:new dr([fae.fromSimpleFillSymbol(i)])})}};x([D({type:$3t,json:{write:!0}})],dQ.prototype,"symbolLayers",void 0),x([Wr({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],dQ.prototype,"type",void 0),dQ=hQ=x([Qe("esri.symbols.PolygonSymbol3D")],dQ);const yae=dQ;var NFe;const g3e=new Rs({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let NN=NFe=class extends l3t{constructor(...i){super(...i),this.color=new jr([0,0,0,.25]),this.outline=new vg,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string")return i;const r={};return i&&(r.style=i),e&&(r.outline=e),t&&(r.color=t),r}clone(){return new NFe({color:li(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};x([D()],NN.prototype,"color",void 0),x([D()],NN.prototype,"outline",void 0),x([Wr({esriSFS:"simple-fill"},{readOnly:!0})],NN.prototype,"type",void 0),x([D({type:g3e.apiValues,json:{read:g3e.read,write:g3e.write}})],NN.prototype,"style",void 0),NN=NFe=x([Qe("esri.symbols.SimpleFillSymbol")],NN);const Hx=NN;var $Fe;const y3e=new Rs({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let fI=$Fe=class extends M3t{constructor(...i){super(...i),this.color=new jr([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new vg}normalizeCtorArgs(i,e,t,r){if(i&&typeof i!="string")return i;const n={};return i&&(n.style=i),e!=null&&(n.size=Cl(e)),t&&(n.outline=t),r&&(n.color=r),n}writeColor(i,e){i&&this.style!=="x"&&this.style!=="cross"&&(e.color=i.toJSON()),i===null&&(e.color=null)}set path(i){this.style="path",this._set("path",i)}clone(){return new $Fe({angle:this.angle,color:li(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};x([D()],fI.prototype,"color",void 0),x([ur("color")],fI.prototype,"writeColor",null),x([Wr({esriSMS:"simple-marker"},{readOnly:!0})],fI.prototype,"type",void 0),x([D()],fI.prototype,"size",void 0),x([D({type:y3e.apiValues,json:{read:y3e.read,write:y3e.write}})],fI.prototype,"style",void 0),x([D({type:String,json:{write:!0}})],fI.prototype,"path",null),x([D({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":vg}},json:{default:null,write:!0}})],fI.prototype,"outline",void 0),fI=$Fe=x([Qe("esri.symbols.SimpleMarkerSymbol")],fI);const Jh=fI;var BFe;let od=BFe=class extends T0{constructor(...i){super(...i),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new mae,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string")return i;const r={};return i&&(r.text=i),e&&(r.font=e),t&&(r.color=t),r}writeLineWidth(i,e,t,r){r&&typeof r!="string"?r.origin:e[t]=i}castLineWidth(i){return Cl(i)}writeLineHeight(i,e,t,r){r&&typeof r!="string"?r.origin:e[t]=i}clone(){return new BFe({angle:this.angle,backgroundColor:li(this.backgroundColor),borderLineColor:li(this.borderLineColor),borderLineSize:this.borderLineSize,color:li(this.color),font:this.font&&this.font.clone(),haloColor:li(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};x([D({type:jr,json:{write:!0}})],od.prototype,"backgroundColor",void 0),x([D({type:jr,json:{write:!0}})],od.prototype,"borderLineColor",void 0),x([D({type:Number,json:{write:!0},cast:Cl})],od.prototype,"borderLineSize",void 0),x([D({type:mae,json:{write:!0}})],od.prototype,"font",void 0),x([D({...v3t,json:{write:!0}})],od.prototype,"horizontalAlignment",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"kerning",void 0),x([D({type:jr,json:{write:!0}})],od.prototype,"haloColor",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"haloSize",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"rightToLeft",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"rotated",void 0),x([D({type:String,json:{write:!0}})],od.prototype,"text",void 0),x([Wr({esriTS:"text"},{readOnly:!0})],od.prototype,"type",void 0),x([D({..._3t,json:{write:!0}})],od.prototype,"verticalAlignment",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"yoffset",void 0),x([D({type:Number,json:{read:i=>i&&-1*i,write:(i,e)=>e.angle=i&&-1*i}})],od.prototype,"angle",void 0),x([D({type:Number,json:{write:!0}})],od.prototype,"width",void 0),x([D({type:Number})],od.prototype,"lineWidth",void 0),x([ur("lineWidth")],od.prototype,"writeLineWidth",null),x([So("lineWidth")],od.prototype,"castLineWidth",null),x([D(y3t)],od.prototype,"lineHeight",void 0),x([ur("lineHeight")],od.prototype,"writeLineHeight",null),od=BFe=x([Qe("esri.symbols.TextSymbol")],od);const qB=od;var jFe;let FT=jFe=class extends T0{constructor(i){super(i),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const i=this.portal!=null?this.portal:Bu.getDefault(),e=i.user?i.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${i.url}`}read(i,e){this.portal=e?.portal,super.read(i,e)}clone(){return new jFe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(i){return this._fetchSymbol("webRef",i)}fetchCIMSymbol(i){return this._fetchSymbol("cimRef",i)}async _fetchSymbol(i,e){const t=e!=null?e.cache:null,r=t?this._fetchCacheKey:null;if(t!=null){const a=r&&t.get(r);if(a)return a.clone()}const{resolveWebStyleSymbol:n}=await Promise.resolve().then(()=>u7r);hn(e);const s=n(this,{portal:this.portal},i,e);s.catch(a=>{di.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await s;return i==="webRef"&&o.type==="point-3d"||i==="cimRef"&&o.type==="cim"?(t?.set(r,o.clone()),o):null}};x([D({json:{write:!1}})],FT.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],FT.prototype,"styleName",void 0),x([D({type:Bu,json:{write:!1}})],FT.prototype,"portal",void 0),x([D({type:String,json:{read:mY,write:cR}})],FT.prototype,"styleUrl",void 0),x([D({type:X8,json:{read:!1}})],FT.prototype,"thumbnail",void 0),x([D({type:String,json:{write:!0}})],FT.prototype,"name",void 0),x([Wr({styleSymbolReference:"web-style"},{readOnly:!0})],FT.prototype,"type",void 0),x([D()],FT.prototype,"_fetchCacheKey",null),FT=jFe=x([Qe("esri.symbols.WebStyleSymbol")],FT);const YB=FT;function P2e(i){if(!i)return!1;switch(i.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function JF(i){if(!i)return!1;switch(i.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Kh={base:T0,key:"type",typeMap:{"simple-fill":Hx,"picture-fill":F3t,"picture-marker":BP,"simple-line":vg,"simple-marker":Jh,text:qB,"label-3d":A2e,"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},_er={base:T0,key:"type",typeMap:{"picture-marker":BP,"simple-marker":Jh,text:qB,"web-style":YB,cim:pae},errorContext:"symbol"},ber=zB({types:Kh}),B3t={base:T0,key:"type",typeMap:{"simple-fill":Hx,"picture-fill":F3t,"picture-marker":BP,"simple-line":vg,"simple-marker":Jh,text:qB,"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},wer={base:T0,key:"type",typeMap:{text:qB,"label-3d":A2e},errorContext:"symbol"},Ont={base:T0,key:"type",typeMap:{"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},xer={base:T0,key:"type",typeMap:{"label-3d":A2e},errorContext:"symbol"},j3t=u3(Kh);var GFe;function Ser(i){if(!i)return null;const e={};for(const t in i){const r=Ro(i[t]);r&&(e[t]=r)}return Object.keys(e).length!==0?e:null}function Ter(i){if(i==null)return null;const e={};for(const t in i){const r=i[t];r&&(e[t]=r.toJSON())}return Object.keys(e).length!==0?e:null}let u1=GFe=class extends xs(Ci){constructor(...i){super(...i),this.isAggregate=!1,this.layer=null,this.origin=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:vF(),configurable:!0})}normalizeCtorArgs(i,e,t,r){return i&&!i.declaredClass?i:{geometry:i,symbol:e,attributes:t,popupTemplate:r}}set aggregateGeometries(i){const e=this._get("aggregateGeometries");JSON.stringify(e)!==JSON.stringify(i)&&this._set("aggregateGeometries",i)}set attributes(i){const e=this._get("attributes");e!==i&&(this._set("attributes",i),this._notifyLayer("attributes",e,i))}set geometry(i){const e=this._get("geometry");e!==i&&(this._set("geometry",i),this._notifyLayer("geometry",e,i))}set symbol(i){const e=this._get("symbol");e!==i&&(this._set("symbol",i),this._notifyLayer("symbol",e,i))}set visible(i){const e=this._get("visible");e!==i&&(this._set("visible",i),this._notifyLayer("visible",e,i))}cloneShallow(){return new GFe({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(i=!1){if(this.popupTemplate)return this.popupTemplate;const e=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[e,this.sourceLayer,this.layer])if(t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(i&&"defaultPopupTemplate"in t&&t.defaultPopupTemplate!=null)return t.defaultPopupTemplate}return null}getAttribute(i){return this.attributes?.[i]}setAttribute(i,e){if(this.attributes){const t=this.getAttribute(i);this.attributes[i]=e,this._notifyLayer("attributes",t,e,i)}else this.attributes={[i]:e},this._notifyLayer("attributes",void 0,e,i)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:Ter(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:W9(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(i={}){const{geometry:e}=this;if(e?.type==="mesh"){const t={origin:e.origin,transform:e.transform};this._notifyLayer("origin-transform",t,t,i.action)}}_notifyLayer(i,e,t,r){if(!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:i,oldValue:e,newValue:t};i==="origin-transform"&&(n.action=r),i==="attributes"&&(n.attributeName=r),this.layer.graphicChanged(n)}};x([D({value:null,json:{read:Ser}})],u1.prototype,"aggregateGeometries",null),x([D({value:null})],u1.prototype,"attributes",null),x([D({value:null,types:Ff,json:{read:Ro}})],u1.prototype,"geometry",null),x([D({type:Boolean})],u1.prototype,"isAggregate",void 0),x([D({clonable:"reference"})],u1.prototype,"layer",void 0),x([D({clonable:"reference"})],u1.prototype,"origin",void 0),x([D({type:qc})],u1.prototype,"popupTemplate",void 0),x([D({clonable:"reference"})],u1.prototype,"sourceLayer",void 0),x([D({value:null,types:Kh})],u1.prototype,"symbol",null),x([D({type:Boolean,value:!0})],u1.prototype,"visible",null),u1=GFe=x([Qe("esri.Graphic")],u1),function(i){i.generateUID=vF}(u1||(u1={}));const Us=u1;var UFe;let pQ=UFe=class extends Ci{constructor(i){super(i),this.minValue=0,this.maxValue=0}clone(){return new UFe({minValue:this.minValue,maxValue:this.maxValue})}};x([D({type:Number,json:{write:!0}})],pQ.prototype,"minValue",void 0),x([D({type:Number,json:{write:!0}})],pQ.prototype,"maxValue",void 0),pQ=UFe=x([Qe("esri.renderer.support.AuthoringInfoClassBreakInfo")],pQ);var zFe;let p5=zFe=class extends Ci{constructor(i){super(i),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new zFe({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:li(this.classBreakInfos)})}};x([D({type:String,json:{write:!0}})],p5.prototype,"field",void 0),x([D({type:String,json:{write:!0}})],p5.prototype,"normalizationField",void 0),x([D({type:String,json:{write:!0}})],p5.prototype,"label",void 0),x([D({type:[pQ],json:{write:!0}})],p5.prototype,"classBreakInfos",void 0),p5=zFe=x([Qe("esri.renderers.support.AuthoringInfoFieldInfo")],p5);var VFe;const Yce=new Rs({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),Xce=new Rs({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Pnt={key:i=>typeof i=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},Rnt=["high-to-low","above-and-below","centered-on","extremes"],Dnt=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],Fnt=["seconds","minutes","hours","days","months","years"];let k_=VFe=class extends Ci{constructor(i){super(i),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(i){return typeof i=="string"||typeof i=="number"?i:null}castStartTime(i){return typeof i=="string"||typeof i=="number"?i:null}get style(){return this.type==="color"?this._get("style"):null}set style(i){this._set("style",i)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(i){this._set("theme",i)}clone(){return new VFe({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};x([D({types:Pnt,json:{write:!0}})],k_.prototype,"endTime",void 0),x([So("endTime")],k_.prototype,"castEndTime",null),x([D({type:String,json:{write:!0}})],k_.prototype,"field",void 0),x([D({type:Number,json:{write:!0}})],k_.prototype,"maxSliderValue",void 0),x([D({type:Number,json:{write:!0}})],k_.prototype,"minSliderValue",void 0),x([D({types:Pnt,json:{write:!0}})],k_.prototype,"startTime",void 0),x([So("startTime")],k_.prototype,"castStartTime",null),x([D({type:Yce.apiValues,value:null,json:{type:Yce.jsonValues,read:Yce.read,write:Yce.write}})],k_.prototype,"style",null),x([D({type:Dnt,value:null,json:{type:Dnt,origins:{"web-scene":{type:Rnt,write:{writer:(i,e)=>{Rnt.includes(i)&&(e.theme=i)}}}},write:!0}})],k_.prototype,"theme",null),x([D({type:Xce.apiValues,json:{type:Xce.jsonValues,read:Xce.read,write:Xce.write}})],k_.prototype,"type",void 0),x([D({type:Fnt,json:{type:Fnt,write:!0}})],k_.prototype,"units",void 0),k_=VFe=x([Qe("esri.renderers.support.AuthoringInfoVisualVariable")],k_);const Cer=k_;let vme=class extends Ci{constructor(e){super(e),this.type=null}};x([D({readOnly:!0,json:{read:!1,write:!0}})],vme.prototype,"type",void 0),vme=x([Qe("esri.rest.support.ColorRamp")],vme);const sVe=vme;var HFe;let $N=HFe=class extends sVe{constructor(i){super(i),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new HFe({fromColor:li(this.fromColor),toColor:li(this.toColor),algorithm:this.algorithm})}};x([Wr({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],$N.prototype,"algorithm",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],$N.prototype,"fromColor",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],$N.prototype,"toColor",void 0),x([D({type:["algorithmic"]})],$N.prototype,"type",void 0),$N=HFe=x([Qe("esri.rest.support.AlgorithmicColorRamp")],$N);const oVe=$N;var WFe;let fQ=WFe=class extends sVe{constructor(i){super(i),this.colorRamps=null,this.type="multipart"}clone(){return new WFe({colorRamps:li(this.colorRamps)})}};x([D({type:[oVe],json:{write:!0}})],fQ.prototype,"colorRamps",void 0),x([D({type:["multipart"]})],fQ.prototype,"type",void 0),fQ=WFe=x([Qe("esri.rest.support.MultipartColorRamp")],fQ);const R2e=fQ,D2e={key:"type",base:sVe,typeMap:{algorithmic:oVe,multipart:R2e}};function F2e(i){return i?.type?i.type==="algorithmic"?oVe.fromJSON(i):i.type==="multipart"?R2e.fromJSON(i):null:null}var qFe;const BL=new Rs({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),Jce=new Rs({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),knt=new Rs({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),Lnt=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],Eer=["high-to-low","above-and-below","above","below","90-10"],Ier=["flow-line","wave-front"],Aer=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let Qd=qFe=class extends Ci{constructor(i){super(i),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const i=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?i||"manual":null:i}set classificationMethod(i){this._set("classificationMethod",i)}readColorRamp(i){return i?F2e(i):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(i){this._set("fields",i)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(i){this._set("field1",i)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(i){this._set("field2",i)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(i){this._set("flowTheme",i)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(i){this._set("focus",i)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(i){this._set("numClasses",i)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(i){this._set("statistics",i)}get standardDeviationInterval(){const i=this.type;return i&&i!=="relationship"&&i!=="class-breaks-size"&&i!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(i){this._set("standardDeviationInterval",i)}get type(){return this._get("type")}set type(i){let e=i;i==="classed-size"?e="class-breaks-size":i==="classed-color"&&(e="class-breaks-color"),this._set("type",e)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(i){this._set("univariateSymbolStyle",i)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(i){this._set("univariateTheme",i)}clone(){return new qFe({classificationMethod:this.classificationMethod,colorRamp:li(this.colorRamp),fadeRatio:li(this.fadeRatio),fields:this.fields?.slice(0),field1:li(this.field1),field2:li(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(i=>i.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};x([D({type:BL.apiValues,value:null,json:{type:BL.jsonValues,read:BL.read,write:BL.write,origins:{"web-document":{default:"manual",type:BL.jsonValues,read:BL.read,write:BL.write}}}})],Qd.prototype,"classificationMethod",null),x([D({types:D2e,json:{write:!0}})],Qd.prototype,"colorRamp",void 0),x([Mi("colorRamp")],Qd.prototype,"readColorRamp",null),x([D({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"fadeRatio",void 0),x([D({type:[String],value:null,json:{write:!0}})],Qd.prototype,"fields",null),x([D({type:p5,value:null,json:{write:!0}})],Qd.prototype,"field1",null),x([D({type:p5,value:null,json:{write:!0}})],Qd.prototype,"field2",null),x([D({type:Ier,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"flowTheme",null),x([D({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],Qd.prototype,"focus",null),x([D({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"isAutoGenerated",void 0),x([D({type:Number,value:null,json:{type:ms,write:!0}})],Qd.prototype,"numClasses",null),x([D({type:Lnt,json:{type:Lnt,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],Qd.prototype,"lengthUnit",void 0),x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"maxSliderValue",void 0),x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"minSliderValue",void 0),x([D({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"statistics",null),x([D({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],Qd.prototype,"standardDeviationInterval",null),x([D({type:Jce.apiValues,value:null,json:{type:Jce.jsonValues,read:Jce.read,write:Jce.write,origins:{"web-scene":{type:knt.jsonValues,write:{writer:knt.write,overridePolicy:i=>({enabled:i!=="flow"})}}}}})],Qd.prototype,"type",null),x([D({type:[Cer],json:{write:!0}})],Qd.prototype,"visualVariables",void 0),x([D({type:Aer,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"univariateSymbolStyle",null),x([D({type:Eer,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"univariateTheme",null),Qd=qFe=x([Qe("esri.renderers.support.AuthoringInfo")],Qd);const vae=Qd,v3e=new Rs({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let mQ=class extends Ci{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};x([D({type:vae,json:{write:!0}})],mQ.prototype,"authoringInfo",void 0),x([D({type:v3e.apiValues,readOnly:!0,json:{type:v3e.jsonValues,read:!1,write:{writer:v3e.write,ignoreOrigin:!0}}})],mQ.prototype,"type",void 0),mQ=x([Qe("esri.renderers.Renderer")],mQ);const V3=mQ;function Mer(i){return i.match(Oer)?.[1]?.replace(/\\'/g,"'")??null}const Oer=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var YFe;let UA=YFe=class extends Ci{constructor(){super(...arguments),this.title=null}clone(){return new YFe({title:this.title})}};x([D({type:String,json:{write:!0}})],UA.prototype,"title",void 0),UA=YFe=x([Qe("esri.renderers.support.LegendOptions")],UA);var XFe;let _me=XFe=class extends UA{constructor(){super(...arguments),this.showLegend=null}clone(){return new XFe({title:this.title,showLegend:this.showLegend})}};x([D({type:Boolean,json:{write:!0}})],_me.prototype,"showLegend",void 0),_me=XFe=x([Qe("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],_me);const G3t=_me,_3e=new Rs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let kT=class extends Ci{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};x([D()],kT.prototype,"index",void 0),x([D({type:_3e.apiValues,readOnly:!0,json:{read:_3e.read,write:_3e.write}})],kT.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],kT.prototype,"field",void 0),x([So("field")],kT.prototype,"castField",null),x([D({type:String,json:{write:!0}})],kT.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],kT.prototype,"valueExpressionTitle",void 0),x([D({readOnly:!0})],kT.prototype,"arcadeRequired",null),x([D({type:G3t,json:{write:!0}})],kT.prototype,"legendOptions",void 0),kT=x([Qe("esri.renderers.visualVariables.VisualVariable")],kT);const _ae=kT;var JFe;let BN=JFe=class extends Ci{constructor(i){super(i),this.color=null,this.label=null,this.value=null}writeValue(i,e,t){e[t]=i??0}clone(){return new JFe({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};x([D({type:jr,json:{type:[ms],write:!0}})],BN.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],BN.prototype,"label",void 0),x([D({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],BN.prototype,"value",void 0),x([ur("value")],BN.prototype,"writeValue",null),BN=JFe=x([Qe("esri.renderers.visualVariables.support.ColorStop")],BN);const U3t=BN;var KFe;let jN=KFe=class extends _ae{constructor(i){super(i),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(i){i&&Array.isArray(i)&&(i=i.filter(e=>!!e)).sort((e,t)=>e.value-t.value),this._set("stops",i)}clone(){return new KFe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(i=>i.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(i=>i.value||0)}};x([D({readOnly:!0})],jN.prototype,"cache",null),x([D({type:["color"],json:{type:["colorInfo"]}})],jN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],jN.prototype,"normalizationField",void 0),x([D({type:[U3t],json:{write:!0}})],jN.prototype,"stops",null),jN=KFe=x([Qe("esri.renderers.visualVariables.ColorVariable")],jN);const z3t=jN;var ZFe;let p4=ZFe=class extends Ci{constructor(i){super(i),this.label=null,this.opacity=null,this.value=null}readOpacity(i,e){return vW(e.transparency)}writeOpacity(i,e,t){e[t]=E2e(i)}clone(){return new ZFe({label:this.label,opacity:this.opacity,value:this.value})}};x([D({type:String,json:{write:!0}})],p4.prototype,"label",void 0),x([D({type:Number,json:{type:ms,write:{target:"transparency"}}})],p4.prototype,"opacity",void 0),x([Mi("opacity",["transparency"])],p4.prototype,"readOpacity",null),x([ur("opacity")],p4.prototype,"writeOpacity",null),x([D({type:Number,json:{write:!0}})],p4.prototype,"value",void 0),p4=ZFe=x([Qe("esri.renderers.visualVariables.support.OpacityStop")],p4);const Per=p4;var QFe;let GN=QFe=class extends _ae{constructor(i){super(i),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(i){i&&Array.isArray(i)&&(i=i.filter(e=>!!e)).sort((e,t)=>e.value-t.value),this._set("stops",i)}clone(){return new QFe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(i=>i.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(i=>i.value||0)}};x([D({readOnly:!0})],GN.prototype,"cache",null),x([D({type:["opacity"],json:{type:["transparencyInfo"]}})],GN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],GN.prototype,"normalizationField",void 0),x([D({type:[Per],json:{write:!0}})],GN.prototype,"stops",null),GN=QFe=x([Qe("esri.renderers.visualVariables.OpacityVariable")],GN);const V3t=GN;var eke;let VM=eke=class extends _ae{constructor(i){super(i),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(i,e,t,r){if(r?.messages){const n=`visualVariables[${this.index}]`;r.messages.push(new qe("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpressionTitle",context:r}))}}clone(){return new eke({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};x([D({readOnly:!0})],VM.prototype,"cache",null),x([D({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],VM.prototype,"axis",void 0),x([D({type:["rotation"],json:{type:["rotationInfo"]}})],VM.prototype,"type",void 0),x([D({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],VM.prototype,"rotationType",void 0),x([D({type:String,json:{write:!0}})],VM.prototype,"valueExpressionTitle",void 0),x([ur("web-scene","valueExpressionTitle")],VM.prototype,"writeValueExpressionTitleWebScene",null),VM=eke=x([Qe("esri.renderers.visualVariables.RotationVariable")],VM);const k2e=VM;var tke;let f4=tke=class extends Ci{constructor(i){super(i),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new tke({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};x([D({type:String,json:{write:!0}})],f4.prototype,"label",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],f4.prototype,"size",void 0),x([D({type:Number,json:{write:!0}})],f4.prototype,"value",void 0),x([D({type:Boolean,json:{write:!1}})],f4.prototype,"useMinValue",void 0),x([D({type:Boolean,json:{write:!1}})],f4.prototype,"useMaxValue",void 0),f4=tke=x([Qe("esri.renderers.visualVariables.support.SizeStop")],f4);const bme=f4;var ike;let wme=ike=class extends G3t{constructor(){super(...arguments),this.customValues=null}clone(){return new ike({title:this.title,showLegend:this.showLegend,customValues:this.customValues?.slice(0)})}};x([D({type:[Number],json:{write:!0}})],wme.prototype,"customValues",void 0),wme=ike=x([Qe("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],wme);const Rer=wme;var jP,Mh;function kz(i){return i&&i.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function Dne(i){return i!=null&&!isNaN(i)&&isFinite(i)}function H3t(i){return i.valueExpression?jP.Expression:i.field&&typeof i.field=="string"?jP.Field:jP.Unknown}function Der(i,e){const t=e||H3t(i),r=i.valueUnit||"unknown";return t===jP.Unknown?Mh.Constant:i.stops?Mh.Stops:i.minSize!=null&&i.maxSize!=null&&i.minDataValue!=null&&i.maxDataValue!=null?Mh.ClampedLinear:r==="unknown"?i.minSize!=null&&i.minDataValue!=null?i.minSize&&i.minDataValue?Mh.Proportional:Mh.Additive:Mh.Identity:Mh.RealWorldSize}(function(i){i.Unknown="unknown",i.Expression="expression",i.Field="field"})(jP||(jP={})),function(i){i.Unknown="unknown",i.Stops="stops",i.ClampedLinear="clamped-linear",i.Proportional="proportional",i.Additive="additive",i.Constant="constant",i.Identity="identity",i.RealWorldSize="real-world-size"}(Mh||(Mh={}));function Fer(i){return()=>i}const bae={unknown:1,inches:tb(1,"meters","inches"),feet:tb(1,"meters","feet"),"us-feet":tb(1,"meters","us-feet"),yards:tb(1,"meters","yards"),miles:tb(1,"meters","miles"),"nautical-miles":tb(1,"meters","nautical-miles"),millimeters:tb(1,"meters","millimeters"),centimeters:tb(1,"meters","centimeters"),decimeters:tb(1,"meters","decimeters"),meters:tb(1,"meters","meters"),kilometers:tb(1,"meters","kilometers"),"decimal-degrees":1/Uqi(1,"meters",Td.radius)},KF=()=>di.getLogger("esri.renderers.visualVariables.support.visualVariableUtils");new Us;const xme=Math.PI,W3t=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function ker(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(v=>v.type==="color"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s?.attributes;let a=n?e:null;const l=r.field,{ipData:u,hasExpression:c}=r.cache;let h=r.cache.compiledFunc;if(!l&&!c){const v=r.stops;return v&&v[0]&&v[0].color}if(typeof a!="number")if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const v={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},w=t.arcade.arcadeUtils,S=w.getViewInfo(v),I=w.createExecContext(s,S,t.timeZone);if(!h){const R=w.createSyntaxTree(r.valueExpression);h=w.createFunction(R),r.cache.compiledFunc=h}a=w.executeFunction(h,I)}else o&&(a=o[l]);const p=r.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const v=lVe(a,u);if(v){const w=v[0],S=v[1],I=w===S?r.stops[w].color:jr.blendColors(r.stops[w].color,r.stops[S].color,v[2],t?.color);return new jr(I)}}}function Ler(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(v=>v.type==="opacity"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s?.attributes;let a=n?e:null;const l=r.field,{ipData:u,hasExpression:c}=r.cache;let h=r.cache.compiledFunc;if(!l&&!c){const v=r.stops;return v&&v[0]&&v[0].opacity}if(typeof a!="number")if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const v={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},w=t.arcade.arcadeUtils,S=w.getViewInfo(v),I=w.createExecContext(s,S,t.timeZone);if(!h){const R=w.createSyntaxTree(r.valueExpression);h=w.createFunction(R),r.cache.compiledFunc=h}a=w.executeFunction(h,I)}else o&&(a=o[l]);const p=r.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const v=lVe(a,u);if(v){const w=v[0],S=v[1];if(w===S)return r.stops[w].opacity;{const I=r.stops[w].opacity;return I+(r.stops[S].opacity-I)*v[2]}}}}function q3t(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(m=>m.type==="rotation"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const n=r.axis||"heading",s=n==="heading"&&r.rotationType==="arithmetic"?90:0,o=n==="heading"&&r.rotationType==="arithmetic"?-1:1,a=typeof e=="number"?null:e,l=a?.attributes,u=r.field,{hasExpression:c}=r.cache;let h=r.cache.compiledFunc,p=0;if(!u&&!c)return p;if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const m={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},v=t.arcade.arcadeUtils,w=v.getViewInfo(m),S=v.createExecContext(a,w,t.timeZone);if(!h){const I=v.createSyntaxTree(r.valueExpression);h=v.createFunction(I),r.cache.compiledFunc=h}p=v.executeFunction(h,S)}else l&&(p=l[u]||0);return p=typeof p!="number"||isNaN(p)?null:s+o*p,p}function Ner(i,e,t){const r=typeof e=="number",n=r?null:e,s=n?.attributes;let o=r?e:null;const{isScaleDriven:a}=i.cache;let l=i.cache.compiledFunc;if(a){const c=t?.scale,h=t?.view;o=c==null||h==="3d"?$er(i):c}else if(!r)switch(i.inputValueType){case jP.Expression:{if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const c={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},h=t.arcade.arcadeUtils,p=h.getViewInfo(c),m=h.createExecContext(n,p,t.timeZone);if(!l){const v=h.createSyntaxTree(i.valueExpression);l=h.createFunction(v),i.cache.compiledFunc=l}o=h.executeFunction(l,m);break}case jP.Field:s&&(o=s[i.field]);break;case jP.Unknown:o=null}if(!Dne(o))return null;if(r||!i.normalizationField)return o;const u=s?parseFloat(s[i.normalizationField]):null;return Dne(u)&&u!==0?o/u:null}function $er(i){let e=null,t=null;const r=i.stops;return r?(e=r[0].value,t=r[r.length-1].value):(e=i.minDataValue||0,t=i.maxDataValue||0),(e+t)/2}function aVe(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(s=>s.type==="size"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=X3t(Ner(r,e,t),r,e,t,r.cache.ipData);return n==null||isNaN(n)?0:n}function bS(i,e,t){return i==null?null:kz(i)?aVe(i,e,t):Dne(i)?i:null}function Y3t(i,e,t){return Dne(t)&&i>t?t:Dne(e)&&i=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&a){const l=a==="circle",u=l?xme*(s/2)**2:s*s,c=u+n*((l?xme*(o/2)**2:o*o)-u);return l?2*Math.sqrt(c/xme):Math.sqrt(c)}return s+n*(o-s)}function Uer(i,e,t,r){const n=r?.shape,s=i/e.minDataValue,o=bS(e.minSize,t,r),a=bS(e.maxSize,t,r);let l=null;return l=n==="circle"?2*Math.sqrt(s*(o/2)**2):n==="square"||n==="diamond"||n==="image"?Math.sqrt(s*o**2):s*o,Y3t(l,o,a)}function zer(i,e,t,r,n){const[s,o,a]=lVe(i,n);if(s===o)return bS(e.stops?.[s].size,t,r);{const l=bS(e.stops?.[s].size,t,r);return l+(bS(e.stops?.[o].size,t,r)-l)*a}}function Ver(i,e,t,r){const n=(r?.resolution??1)*bae[e.valueUnit],s=bS(e.minSize,t,r),o=bS(e.maxSize,t,r),{valueRepresentation:a}=e;let l=null;return l=a==="area"?2*Math.sqrt(i/xme)/n:a==="radius"||a==="distance"?2*i/n:i/n,Y3t(l,s,o)}function X3t(i,e,t,r,n){switch(e.transformationType){case Mh.Additive:return Ber(i,e,t,r);case Mh.Constant:return jer(e,t,r);case Mh.ClampedLinear:return Ger(i,e,t,r);case Mh.Proportional:return Uer(i,e,t,r);case Mh.Stops:return zer(i,e,t,r,n);case Mh.RealWorldSize:return Ver(i,e,t,r);case Mh.Identity:return i;case Mh.Unknown:return null}}function lVe(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((n,s)=>i!!e)).sort((e,t)=>e.value-t.value):i&&(di.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),i=null),this._set("stops",i)}get transformationType(){return Der(this,this.inputValueType)}readValueExpression(i,e){return i||e.expression&&"$view.scale"}writeValueExpressionWebScene(i,e,t,r){if(i==="$view.scale"){if(r?.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;r.messages.push(new qe("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:s+".valueExpression",context:r}))}}else e[t]=i}readValueUnit(i){return i?nke.read(i):null}clone(){return new rke({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:kz(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:kz(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(i=>i.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Mh.ClampedLinear){const{minSize:i,maxSize:e}=this;return this.minSize=e,this.maxSize=i,this}if(this.transformationType===Mh.Stops){const i=this.stops;if(!i)return this;const e=i.map(r=>r.size).reverse(),t=i.length;for(let r=0;ri.value||0)}};x([D({readOnly:!0})],Ku.prototype,"cache",null),x([D({type:Kce.apiValues,json:{type:Kce.jsonValues,origins:{"web-map":{read:!1}},read:Kce.read,write:Kce.write}})],Ku.prototype,"axis",void 0),x([D({type:String,value:null,json:{read:!1}})],Ku.prototype,"expression",null),x([D()],Ku.prototype,"index",null),x([D({type:String,readOnly:!0})],Ku.prototype,"inputValueType",null),x([D({type:Rer,json:{write:!0}})],Ku.prototype,"legendOptions",void 0),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"maxDataValue",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"maxSize",null),x([So("maxSize")],Ku.prototype,"castMaxSize",null),x([Mi("maxSize")],Ku.prototype,"readMaxSize",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"minDataValue",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"minSize",null),x([So("minSize")],Ku.prototype,"castMinSize",null),x([Mi("minSize")],Ku.prototype,"readMinSize",null),x([D({type:String,json:{write:!0}})],Ku.prototype,"normalizationField",void 0),x([D({readOnly:!0})],Ku.prototype,"arcadeRequired",null),x([D({type:String})],Ku.prototype,"scaleBy",void 0),x([D({type:[bme],value:null,json:{write:!0}})],Ku.prototype,"stops",null),x([D({type:["outline"],json:{write:!0}})],Ku.prototype,"target",void 0),x([D({type:String,readOnly:!0})],Ku.prototype,"transformationType",null),x([D({type:["size"],json:{type:["sizeInfo"]}})],Ku.prototype,"type",void 0),x([D({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],Ku.prototype,"useSymbolValue",void 0),x([D({type:String,json:{write:!0}})],Ku.prototype,"valueExpression",void 0),x([Mi("valueExpression",["valueExpression","expression"])],Ku.prototype,"readValueExpression",null),x([ur("web-scene","valueExpression")],Ku.prototype,"writeValueExpressionWebScene",null),x([D({type:["radius","diameter","area","width","distance"],json:{write:!0}})],Ku.prototype,"valueRepresentation",void 0),x([D({type:nke.apiValues,json:{write:nke.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],Ku.prototype,"valueUnit",void 0),x([Mi("valueUnit")],Ku.prototype,"readValueUnit",null),Ku=rke=x([Qe("esri.renderers.visualVariables.SizeVariable")],Ku);const CY=Ku,Her={color:z3t,size:CY,opacity:V3t,rotation:k2e},Wer=new Rs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),qer=/^\[([^\]]+)\]$/i;let Sme=class extends un{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e&&e.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,r)=>{let n=null;return n=t.target===r.target?0:t.target?1:-1,n});for(let t=0;t{const u=Wer.read(l.type),c=Her[u];c||(di.getLogger(this).warn(`Unknown variable type: ${u}`),r?.messages&&r.messages.push(new Rf("visual-variable:unsupported",`visualVariable of type '${u}' is not supported`,{definition:l,context:r})));const h=new c;return h.read(l,r),h})}writeVariables(e,t){const r=[];for(const n of e){const s=n.toJSON(t);s&&r.push(s)}return r}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};x([D()],Sme.prototype,"visualVariables",null),Sme=x([Qe("esri.renderers.visualVariables.VisualVariableFactory")],Sme);const Yer=Sme,Xer={base:_ae,key:"type",typeMap:{opacity:V3t,color:z3t,rotation:k2e,size:CY}},Wk=i=>{let e=class extends i{constructor(){super(...arguments),this._vvFactory=new Yer}set visualVariables(t){this._vvFactory.visualVariables=t,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(t,r,n){return this._vvFactory.readVariables(t,r,n)}writeVisualVariables(t,r,n,s){r[n]=this._vvFactory.writeVariables(t,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const t of this.visualVariables)if(t.arcadeRequired)return!0;return!1}hasVisualVariables(t,r){return t?this.getVisualVariablesForType(t,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(t,r){const n=this.visualVariables;return n?n.filter(s=>s.type===t&&(typeof r=="string"?s.target===r:r!==!1||!s.target)):[]}async collectVVRequiredFields(t,r){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&$v(t,r,s.field),s.normalizationField&&$v(t,r,s.normalizationField),s.valueExpression&&(Jer(s.valueExpression,t,r)||await i_(t,r,s.valueExpression)))}};return x([D({types:[Xer],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),x([Mi("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),x([ur("visualVariables")],e.prototype,"writeVisualVariables",null),e=x([Qe("esri.renderers.mixins.VisualVariablesMixin")],e),e};function Jer(i,e,t){const r=Mer(i);return r!=null&&($v(e,t,r),!0)}const PJ={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function Ker(i,e=PJ){if(!i)return{symbol:null};const{retainId:t=PJ.retainId,ignoreDrivers:r=PJ.ignoreDrivers,hasLabelingContext:n=PJ.hasLabelingContext,retainCIM:s=PJ.retainCIM}=e;let o=null;if(JF(i)||i instanceof YB)o=i.clone();else if(i.type==="cim"){const a=i.data?.symbol?.type;if(a!=="CIMPointSymbol")return{error:new qe("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${a||"unknown"}' is unsupported in 3D`,{symbol:i})};o=s?i.clone():a8.fromCIMSymbol(i)}else if(i instanceof vg)o=M2e.fromSimpleLineSymbol(i);else if(i instanceof Jh)o=a8.fromSimpleMarkerSymbol(i);else if(i instanceof BP)o=a8.fromPictureMarkerSymbol(i);else if(i instanceof Hx)o=e.geometryType&&e.geometryType==="mesh"?O2e.fromSimpleFillSymbol(i):yae.fromSimpleFillSymbol(i);else{if(!(i instanceof qB))return{error:new qe("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${i.type||i.declaredClass}' is unsupported in 3D`,{symbol:i})};o=n?A2e.fromTextSymbol(i):a8.fromTextSymbol(i)}return t&&o&&o.type!=="cim"&&(o.id=i.id),r&&JF(o)&&o.symbolLayers.forEach(a=>a.ignoreDrivers=!0),{symbol:o}}function l1e(i,e,t,r){const n=K3t(i,{},{context:r,isLabelSymbol:!1});n!=null&&(e[t]=n)}function Bnt(i,e,t,r){const n=K3t(i,{},{context:r,isLabelSymbol:!0});n!=null&&(e[t]=n)}function jnt(i){return i instanceof TY||i instanceof YB}function K3t(i,e,t){if(i==null)return null;const{context:r,isLabelSymbol:n}=t,s=r?.origin,o=r?.messages;if(s==="web-scene"&&!jnt(i)){const a=Ker(i,{retainCIM:!0,hasLabelingContext:n});return a.symbol!=null?a.symbol.write(e,r):(o?.push(new qe("symbol:unsupported",`Symbols of type '${i.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:i,context:r,error:a.error})),null)}return(s==="web-map"||s==="portal-item"&&!BEt(r?.layer))&&jnt(i)?(o?.push(new qe("symbol:unsupported",`Symbols of type '${i.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:i,context:r})),null):i.write(e,r)}function wae(i,e){return ber(i,null,e)}const N2e={types:B3t,json:{write:{writer:l1e},origins:{"web-scene":{types:Ont,write:{writer:l1e},read:{reader:zB({types:Ont})}}}}},uVe=GUe({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},N2e),Z3t={types:{base:T0,key:"type",typeMap:{"simple-fill":Kh.typeMap["simple-fill"],"picture-fill":Kh.typeMap["picture-fill"],"polygon-3d":Kh.typeMap["polygon-3d"]}},json:{write:{writer:l1e},origins:{"web-scene":{type:yae,write:{writer:l1e}}}}},Tme={cast:i=>i==null||typeof i=="string"||typeof i=="number"?i:`${i}`,json:{type:String,write:{writer:(i,e)=>{e.value=i?.toString()}}}};var ske;let m4=ske=class extends Ci{constructor(i){super(i),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new ske({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const i=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${i}`}};x([D({type:String,json:{write:!0}})],m4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],m4.prototype,"label",void 0),x([D({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],m4.prototype,"minValue",void 0),x([D({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],m4.prototype,"maxValue",void 0),x([D(uVe)],m4.prototype,"symbol",void 0),m4=ske=x([Qe("esri.renderers.support.ClassBreakInfo")],m4);const _W=m4;var oke;const Q3t="log",Cme="percent-of-total",Eme="field",Zce=new Rs({esriNormalizeByLog:Q3t,esriNormalizeByPercentOfTotal:Cme,esriNormalizeByField:Eme}),Zer=Sd(_W);let Vf=oke=class extends Wk(V3){constructor(i){super(i),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(i,e,t){if(!Array.isArray(i))return;let r=e.minValue;return i.map(n=>{const s=new _W;return s.read(n,t),s.minValue==null&&(s.minValue=r),s.maxValue==null&&(s.maxValue=s.minValue),r=s.maxValue,s})}writeClassBreakInfos(i,e,t,r){const n=i.map(s=>s.write({},r));this._areClassBreaksConsecutive()&&n.forEach(s=>delete s.classMinValue),e[t]=n}castField(i){return i==null?i:typeof i=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(i)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let i=this._get("normalizationType");const e=!!this.normalizationField,t=this.normalizationTotal!=null;return e||t?(i=e&&Eme||t&&Cme||null,e&&t&&di.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):i!==Eme&&i!==Cme||(i=null),i}set normalizationType(i){this._set("normalizationType",i)}addClassBreakInfo(i,e,t){let r=null;r=typeof i=="number"?new _W({minValue:i,maxValue:e,symbol:j3t(t)}):Zer(li(i)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(i,e){const t=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[t].symbol:this.defaultSymbol}async getSymbolAsync(i,e){let t=e;if(this.valueExpression&&e?.arcade==null){const n=await e_(),{arcadeUtils:s}=n;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),t={...t,arcade:n}}const r=this.getBreakIndex(i,t);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const i=[];return this.classBreakInfos.forEach(e=>{e.symbol&&i.push(e.symbol)}),this.defaultSymbol&&i.push(this.defaultSymbol),i}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){const i=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),t=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${i}.${e}.${this.classBreakInfos.reduce((r,n)=>r+n.getMeshHash(),"")}.${t}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new oke({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:li(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:li(this.visualVariables),legendOptions:li(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(i,e){const t=[this.collectVVRequiredFields(i,e),this.collectSymbolFields(i,e)];await Promise.all(t)}async collectSymbolFields(i,e){const t=[...this.getSymbols().map(r=>r.collectRequiredFields(i,e)),i_(i,e,this.valueExpression)];$v(i,e,this.field),$v(i,e,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(i,e){const{viewingMode:t,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{},{valueExpression:a}=this;let l=this._compiledValueExpression.valueExpression===a?this._compiledValueExpression.compiledFunction:null;const u=s.arcadeUtils;if(!l){const h=u.createSyntaxTree(a);l=u.createFunction(h),this._compiledValueExpression.compiledFunction=l}this._compiledValueExpression.valueExpression=a;const c=u.executeFunction(l,u.createExecContext(i,u.getViewInfo({viewingMode:t,scale:r,spatialReference:n}),o));return this._getBreakIndexfromInfos(c)}_getBreakIndexForField(i){const e=this.field,t=i.attributes,r=this.normalizationType;let n=parseFloat(t[e]);if(r){const s=this.normalizationTotal,o=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(r===Q3t)n=Math.log(n)*Math.LOG10E;else if(r!==Cme||s==null||isNaN(s)){if(r===Eme&&!isNaN(o)){if(isNaN(n)||isNaN(o))return-1;n/=o}}else n=n/s*100}return this._getBreakIndexfromInfos(n)}_getBreakIndexfromInfos(i){const e=this.isMaxInclusive;if(i!=null&&typeof i=="number"&&!isNaN(i))for(let t=0;tGd(i),json:{write:!0}})],Vf.prototype,"normalizationTotal",void 0),x([D({type:Zce.apiValues,value:null,json:{type:Zce.jsonValues,read:Zce.read,write:Zce.write}})],Vf.prototype,"normalizationType",null),x([Wr({classBreaks:"class-breaks"})],Vf.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],Vf.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],Vf.prototype,"valueExpressionTitle",void 0),Vf=oke=x([Qe("esri.renderers.ClassBreaksRenderer")],Vf);const XB=Vf,ake=-3,Qer=ake-1;var GO;(function(i){i[i.ALL=0]="ALL",i[i.SOME=1]="SOME"})(GO||(GO={}));let etr=class{constructor(e,t,r){this.name=e,this._storage=t,this.id=ttr+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,n=0){this._storage.put(this,e,t,r,n)}pop(e){const t=this._storage.pop(this,e);return t===void 0?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return t===void 0?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}},eMt=class{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new mg,this._users=new mg}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(t=>t[0]!==e)}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,r,n,s){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,GO.ALL)),n>this._maxSize)return void this._notifyRemove(t,r,n,GO.ALL);if(r===void 0)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,r,0,GO.ALL);const a=1+Math.max(s,Qer)-ake;this._db.set(t,new itr(r,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,r,n){t=e.id+t;const s=this._db.get(t);if(s&&s.entry===r){for(this._size-=s.size,e.size-=s.size;n>this._maxSize;){const o=this._notifyRemove(t,r,n,GO.SOME);if(!(o!=null&&o>0))return void this._db.delete(t);n=o}s.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(r!==void 0)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;r[l]=(r[l]||0)+o.size,this._users.forAll(u=>{const{id:c,name:h}=u;if(a.startsWith(c)){const p=t[h]||0;t[h]=p+o.size}})});const n={};this._users.forAll(o=>{const a=o.name;if("hitRate"in o&&typeof o.hitRate=="number"&&!isNaN(o.hitRate)&&o.hitRate>0){const l=t[a]||0;t[a]=l,n[a]=Math.round(100*o.hitRate)+"%"}else n[a]="0%"});const s=Object.keys(t);s.sort((o,a)=>t[a]-t[o]),s.forEach(o=>e[o]=Math.round(t[o]/2**20)+"MB / "+n[o]);for(let o=r.length-1;o>=0;--o){const a=r[o];a&&(e["Priority "+(o+ake-1)]=Math.round(a/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((r,n)=>{n.startsWith(t)&&(this._size-=r.size,this._db.delete(n),this._notifyRemove(n,r.entry,r.size,GO.ALL))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,GO.ALL)),this._users.forAll(e=>e.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,n){let s;return this._removeFuncs.some(o=>{if(e.startsWith(o[0])){const a=o[1](t,n,r);return typeof a=="number"&&(s=a),!0}return!1}),s}_checkSize(){this._users.forAll(e=>this._checkSizeLimits(e)),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let n=!0;for(;n;){n=!1;for(const[s,o]of this._db)if(o.lifetime===0&&(!r||s.startsWith(r))){if(this._purgeItem(s,o,e),t.size<=.9*t.maxSize)return;n||=this._db.has(s)}}for(const[s,o]of this._db)if((!r||s.startsWith(r))&&(this._purgeItem(s,o,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find(n=>e.startsWith(n.id))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,GO.SOME);n!=null&&n>0&&(this._size+=n,r&&(r.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}},ttr=0,itr=class{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}},d3=class{constructor(e,t){this._storage=new eMt,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}},EY=class lke{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major$b.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return hae(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>W9(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function E6(i){return i.trim().toLowerCase()}function Gnt(i){return fW(i)?.toLowerCase()??""}const tMt=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function Unt(i){const e=new Map;if(!i.fields)return e;const t=i.datesInUnknownTimezone===!0,{timeInfo:r,editFieldsInfo:n}=i,s=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",a=str(i)?i.dateFieldsTimeZone??null:i.dateFieldsTimeReference?Zfe(i.dateFieldsTimeReference):null,l=n?rtr(n)?n.timeZone??a:n.dateFieldsTimeReference?Zfe(n.dateFieldsTimeReference):a??y0:null,u=r?ntr(r)?r.timeZone??a:r.timeReference?Zfe(r.timeReference):a:null,c=new Map([[E6(n?.creationDateField??""),l],[E6(n?.editDateField??""),l],[E6(s),u],[E6(o),u]]);for(const{name:h,type:p}of i.fields)if(tMt.has(p))e.set(h,YF);else if(p!=="date"&&p!=="esriFieldTypeDate")e.set(h,null);else if(t)e.set(h,YF);else{const m=c.get(E6(h??""))??a;e.set(h,m)}return e}function Fne(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i}function atr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i}function k1(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}function iMt(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i}function rMt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i}function nMt(i,e,t){return i[0]=e[0]*t[0],i[1]=e[1]*t[1],i[2]=e[2]*t[2],i[3]=e[3]*t[3],i}function sMt(i,e,t){return i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i[3]=e[3]/t[3],i}function ltr(i,e){return i[0]=Math.ceil(e[0]),i[1]=Math.ceil(e[1]),i[2]=Math.ceil(e[2]),i[3]=Math.ceil(e[3]),i}function utr(i,e){return i[0]=Math.floor(e[0]),i[1]=Math.floor(e[1]),i[2]=Math.floor(e[2]),i[3]=Math.floor(e[3]),i}function ctr(i,e,t){return i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.min(e[2],t[2]),i[3]=Math.min(e[3],t[3]),i}function htr(i,e,t){return i[0]=Math.max(e[0],t[0]),i[1]=Math.max(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3]),i}function dtr(i,e){return i[0]=Math.round(e[0]),i[1]=Math.round(e[1]),i[2]=Math.round(e[2]),i[3]=Math.round(e[3]),i}function oMt(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i}function ptr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i}function aMt(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2],s=e[3]-i[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function lMt(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2],s=e[3]-i[3];return t*t+r*r+n*n+s*s}function cVe(i){const e=i[0],t=i[1],r=i[2],n=i[3];return Math.sqrt(e*e+t*t+r*r+n*n)}function hVe(i){const e=i[0],t=i[1],r=i[2],n=i[3];return e*e+t*t+r*r+n*n}function ftr(i,e){return i[0]=-e[0],i[1]=-e[1],i[2]=-e[2],i[3]=-e[3],i}function mtr(i,e){return i[0]=1/e[0],i[1]=1/e[1],i[2]=1/e[2],i[3]=1/e[3],i}function uMt(i,e){const t=e[0],r=e[1],n=e[2],s=e[3];let o=t*t+r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),i[0]=t*o,i[1]=r*o,i[2]=n*o,i[3]=s*o),i}function cMt(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]}function dVe(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i[2]=o+r*(t[2]-o),i[3]=a+r*(t[3]-a),i}function gtr(i,e){const t=sae;let r,n,s,o,a,l;e=e||1;do r=2*t()-1,n=2*t()-1,a=r*r+n*n;while(a>=1);do s=2*t()-1,o=2*t()-1,l=s*s+o*o;while(l>=1);const u=Math.sqrt((1-a)/l);return i[0]=e*r,i[1]=e*n,i[2]=e*s*u,i[3]=e*o*u,i}function hMt(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3];return i[0]=t[0]*r+t[4]*n+t[8]*s+t[12]*o,i[1]=t[1]*r+t[5]*n+t[9]*s+t[13]*o,i[2]=t[2]*r+t[6]*n+t[10]*s+t[14]*o,i[3]=t[3]*r+t[7]*n+t[11]*s+t[15]*o,i}function ytr(i,e,t){const r=e[0],n=e[1],s=e[2],o=t[0],a=t[1],l=t[2],u=t[3],c=u*r+a*s-l*n,h=u*n+l*r-o*s,p=u*s+o*n-a*r,m=-o*r-a*n-l*s;return i[0]=c*u+m*-o+h*-l-p*-a,i[1]=h*u+m*-a+p*-o-c*-l,i[2]=p*u+m*-l+c*-a-h*-o,i[3]=e[3],i}function vtr(i){return"vec4("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+")"}function dMt(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]}function $2e(i,e){const t=i[0],r=i[1],n=i[2],s=i[3],o=e[0],a=e[1],l=e[2],u=e[3],c=c_();return Math.abs(t-o)<=c*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(r-a)<=c*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=c*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-u)<=c*Math.max(1,Math.abs(s),Math.abs(u))}const _tr=rMt,btr=nMt,wtr=sMt,xtr=aMt,Str=lMt,Ttr=cVe,Ctr=hVe;Object.freeze(Object.defineProperty({__proto__:null,add:iMt,ceil:ltr,copy:Fne,copyVec3:atr,dist:xtr,distance:aMt,div:wtr,divide:sMt,dot:cMt,equals:$2e,exactEquals:dMt,floor:utr,inverse:mtr,len:Ttr,length:cVe,lerp:dVe,max:htr,min:ctr,mul:btr,multiply:nMt,negate:ftr,normalize:uMt,random:gtr,round:dtr,scale:oMt,scaleAndAdd:ptr,set:k1,sqrDist:Str,sqrLen:Ctr,squaredDistance:lMt,squaredLength:hVe,str:vtr,sub:_tr,subtract:rMt,transformMat4:hMt,transformQuat:ytr},Symbol.toStringTag,{value:"Module"}));function EE(){return[0,0,0,0]}function Etr(i){return[i[0],i[1],i[2],i[3]]}function Vb(i,e,t,r){return[i,e,t,r]}function Itr(i,e=EE()){const t=Math.min(4,i.length);for(let r=0;rr<=.04045?r/12.92:((r+.055)/1.055)**2.4),t=xMt(Ltr,e);return{x:100*t[0],y:100*t[1],z:100*t[2]}}function fVe(i){const e=xMt(Ntr,[i.x/100,i.y/100,i.z/100]).map(t=>{const r=t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055;return Math.min(1,Math.max(r,0))});return{r:Math.round(255*e[0]),g:Math.round(255*e[1]),b:Math.round(255*e[2])}}function TMt(i){const e=[i.x/95.047,i.y/100,i.z/108.883].map(t=>t>.008856451679035631?t**.3333333333333333:7.787037037037035*t+.13793103448275862);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function CMt(i){const e=i.l,t=[(e+16)/116+i.a/500,(e+16)/116,(e+16)/116-i.b/200].map(r=>r>6/29?r**3:3*(6/29)**2*(r-4/29));return{x:95.047*t[0],y:100*t[1],z:108.883*t[2]}}function $tr(i){const e=i.l,t=i.a,r=i.b,n=Math.sqrt(t*t+r*r);let s=Math.atan2(r,t);return s=s>0?s:s+2*Math.PI,{l:e,c:n,h:s}}function Btr(i){const e=i.l,t=i.c,r=i.h;return{l:e,a:t*Math.cos(r),b:t*Math.sin(r)}}function jtr(i){return TMt(SMt(i))}function Gtr(i){return fVe(CMt(i))}function Utr(i){return $tr(TMt(SMt(i)))}function ztr(i){return fVe(CMt(Btr(i)))}function Vtr(i){const e=i.r,t=i.g,r=i.b,n=Math.max(e,t,r),s=n-Math.min(e,t,r);let o=n,a=s===0?0:n===e?(t-r)/s%6:n===t?(r-e)/s+2:(e-t)/s+4,l=s===0?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=100/255,{h:a,s:l,v:o}}function Htr(i){const e=(i.h+360)%360/60,t=i.s/100,r=i.v/100*255,n=r*t,s=n*(1-Math.abs(e%2-1));let o;switch(Math.floor(e)){case 0:o={r:n,g:s,b:0};break;case 1:o={r:s,g:n,b:0};break;case 2:o={r:0,g:n,b:s};break;case 3:o={r:0,g:s,b:n};break;case 4:o={r:s,g:0,b:n};break;case 5:case 6:o={r:n,g:0,b:s};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+r-n),o.g=Math.round(o.g+r-n),o.b=Math.round(o.b+r-n),o}function ZF(i){return pVe(i)?i:wMt(i)?ztr(i):bMt(i)?Gtr(i):ktr(i)?fVe(i):_Mt(i)?Htr(i):i}function u1e(i){return _Mt(i)?i:Vtr(ZF(i))}function c1e(i){return bMt(i)?i:jtr(ZF(i))}function h1e(i){return wMt(i)?i:Utr(ZF(i))}var znt;(function(i){i[i.Low=160]="Low",i[i.High=225]="High"})(znt||(znt={}));const Wtr={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderLineColor:[0,0,0,1]},ph={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetX:0,offsetY:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMSolidFill:{enable:!0,colorocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0}};function qtr(i){return[i.r,i.g,i.b,i.a]}const Ytr=` /-, -`;function Vnt(i){let e=i.length;for(;e--;)if(!Ytr.includes(i.charAt(e)))return!1;return!0}function Xtr(i,e){const t=[];let r=0,n=-1;do if(n=i.indexOf("[",r),n>=r){if(n>r){const s=i.substr(r,n-r);t.push([s,null,Vnt(s)])}if(r=n+1,n=i.indexOf("]",r),n>=r){if(n>r){const s=e[i.substr(r,n-r)];s&&t.push([null,s,!1])}r=n+1}}while(n!==-1);if(r=-1&&ne<=1&&(v=2*ne*ne*ne-3*ne*ne+1,v>0&&(re=4*(Q+$*e),k+=v*i[re+3],S+=v,i[re+3]<255&&(v=v*i[re+3]/250),I+=v*i[re],R+=v*i[re+1],L+=v*i[re+2],w+=v))}}r[m]=I/w,r[m+1]=R/w,r[m+2]=L/w,r[m+3]=k/S}}function Ly(i){return i?[i[0],i[1],i[2],i[3]/255]:[0,0,0,0]}function Qtr(i){return i.data?.symbol??null}function eir(i){return i.type==="CIMVectorMarker"||i.type==="CIMPictureMarker"||i.type==="CIMBarChartMarker"||i.type==="CIMCharacterMarker"||i.type==="CIMPieChartMarker"||i.type==="CIMStackedBarChartMarker"}function tir(i){return i.type==="CIMGradientStroke"||i.type==="CIMPictureStroke"||i.type==="CIMSolidStroke"}function iir(i){return i!=null&&(i.type==="CIMGradientFill"||i.type==="CIMHatchFill"||i.type==="CIMPictureFill"||i.type==="CIMSolidFill"||i.type==="CIMWaterFill")}function mVe(i){return i!=null&&(i.type==="CIMMarkerPlacementAlongLineRandomSize"||i.type==="CIMMarkerPlacementAlongLineSameSize"||i.type==="CIMMarkerPlacementAlongLineVariableSize"||i.type==="CIMMarkerPlacementAtExtremities"||i.type==="CIMMarkerPlacementAtMeasuredUnits"||i.type==="CIMMarkerPlacementAtRatioPositions"||i.type==="CIMMarkerPlacementOnLine"||i.type==="CIMMarkerPlacementOnVertices")}const rs=(i,e=0)=>i==null||isNaN(i)?e:i,uj=(i,e)=>i??e,Qce=i=>i.tintColor?Ly(i.tintColor):[255,255,255,1],rir=i=>{if(!i)return!1;for(const e of i)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function nir(){return Promise.resolve().then(()=>iX)}function sir(i){if(!i)return"normal";switch(i.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function oir(i){if(!i)return"normal";switch(i.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function gVe(i){let e="normal",t="normal";if(i){const r=i.toLowerCase();r.includes("italic")?e="italic":r.includes("oblique")&&(e="oblique"),r.includes("bold")?t="bold":r.includes("light")&&(t="lighter")}return{style:e,weight:t}}function yVe(i){return i.underline?"underline":i.strikethrough?"line-through":"none"}function gP(i){if(!i)return null;switch(i.type){case"CIMPolygonSymbol":if(i.symbolLayers)for(const e of i.symbolLayers){const t=gP(e);if(t!=null)return t}break;case"CIMTextSymbol":return gP(i.symbol);case"CIMSolidFill":return i.color}return null}function BV(i){if(i)switch(i.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=i.symbolLayers;if(e)for(const t of e){const r=BV(t);if(r!=null)return r}break}case"CIMTextSymbol":return BV(i.symbol);case"CIMSolidStroke":return i.color}}function kne(i){if(i)switch(i.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(i.symbolLayers)for(const e of i.symbolLayers){const t=kne(e);if(t!==void 0)return t}break;case"CIMTextSymbol":return kne(i.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return i.width}}function EMt(i){switch(i){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function IMt(i){switch(i){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function air(i){return(i?Object.keys(i):[]).map(e=>({name:e,alias:e,type:typeof i[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const cj=i=>i.includes("data:image/svg+xml");function d1e(i){return i&&i.charAt(0).toLowerCase()+i.substring(1)}function AMt(i,e,t,r,n,s){const{infos:o}=s;let a=1,l=0,u=0,c=0;for(const{offsetX:m,offsetY:v,rotation:w,size:S,frameHeight:I,rotateClockWise:R}of o)u=Wnt(m,v,l,a,u),c=Hnt(m,v,l,a,c),I&&(a*=S/I),l=qnt(w,R,l);const h=Wnt(r,n,l,a,u),p=Hnt(r,n,l,a,c);return{size:i*a,rotation:qnt(e,t,l),offsetX:h,offsetY:p}}function MMt(i){if(i==null)return!1;if(Array.isArray(i))return i.every(e=>MMt(e));switch(typeof i){case"string":return!!i;case"number":return!isNaN(i)}}function w3e(i,e){if(e==="color"||e==="outlinecolor"||e==="backgroundcolor"||e==="borderLineColor")return[...Wtr[e]];const t=ph[i];if(!t||typeof t[e]=="boolean")throw new Error(`InternalError: default value for type ${i}.`);return t[e]}function OMt(i){return i?.dashTemplate&&typeof i.dashTemplate=="string"&&(i.dashTemplate=i.dashTemplate.split(" ").map(Number)),i}function uke(i){if(i==null)return"Normal";switch(i.type){case"CIMTextSymbol":return i.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const e=i.symbolLayers;if(!e)return"Normal";for(const t of e)if(t.type==="CIMVectorMarker")return uke(t)}break;case"CIMVectorMarker":{const e=i.markerGraphics;if(!e)return"Normal";for(const t of e)if(t.symbol)return uke(t.symbol)}}return"Normal"}function PMt(i){if(i)switch(i.type){case"CIMTextSymbol":return i.height;case"CIMPointSymbol":{let e=0;if(i.symbolLayers){for(const t of i.symbolLayers)if(t)switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=t.size??ph.CIMVectorMarker.size;r>e&&(e=r);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(i.symbolLayers){for(const t of i.symbolLayers)if(t)switch(t.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const r=t.width;r!=null&&r>e&&(e=r);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(t.markerPlacement&&mVe(t.markerPlacement)){const r=t.size??ph.CIMVectorMarker.size;r>e&&(e=r)}break;case"CIMPictureFill":{const r=t.height;r!=null&&r>e&&(e=r)}}}return e}}}function RMt(i,e){if(e!==null){const t=e.get(i);return t?t.name:i}return i}function Hnt(i,e,t,r,n){const s=t*Math.PI/180;if(s){const o=Math.cos(s);return(Math.sin(s)*i+o*e)*r+n}return e*r+n}function Wnt(i,e,t,r,n){const s=t*Math.PI/180;return s?(Math.cos(s)*i-Math.sin(s)*e)*r+n:i*r+n}function qnt(i,e,t){return e?t-i:t+i}const vVe=(i,e,t)=>[e,t],bW=(i,e,t)=>[e,t,i[2]],_Ve=(i,e,t)=>[e,t,i[2],i[3]];function p1e(i){return i?{originPosition:i.originPosition==="upper-left"?"upperLeft":i.originPosition==="lower-left"?"lowerLeft":i.originPosition,scale:i.tolerance?[i.tolerance,i.tolerance]:[1,1],translate:i.extent!=null?[i.extent.xmin,i.extent.ymax]:[0,0]}:null}function lir({scale:i,translate:e},t){return Math.round((t-e[0])/i[0])}function uir({scale:i,translate:e},t){return Math.round((e[1]-t)/i[1])}function DMt({scale:i,translate:e},t){return t*i[0]+e[0]}function FMt({scale:i,translate:e},t){return e[1]-t*i[1]}function kMt(i,e,t){const r=new Array(t.length);if(!t.length)return r;const[n,s]=i.scale;let o=DMt(i,t[0][0]),a=FMt(i,t[0][1]);r[0]=e(t[0],o,a);for(let l=1;lmir(r,e,t,n,s);case"esriGeometryPolygon":return(t,r,n,s)=>gir(r,e,t,n,s);case"esriGeometryPolyline":return(t,r,n,s)=>yir(r,e,t,n,s);case"esriGeometryMultipoint":return(t,r,n,s)=>fir(r,e,t,n,s);default:return di.getLogger("esri.views.2d.support.arcadeOnDemand").error(new qe("mapview-arcade",`Unable to handle geometryType: ${i}`)),t=>t}}const wir=i=>{if(!i)return[0,0,0,0];const{r:e,g:t,b:r,a:n}=i;return[e,t,r,255*n]};let N5=class Ad{static findApplicableOverrides(e,t,r){if(e&&t){if(e.primitiveName){let n=!1;for(const s of r)if(s.primitiveName===e.primitiveName){n=!0;break}if(!n)for(const s of t)s.primitiveName===e.primitiveName&&r.push(s)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const n of e.effects)Ad.findApplicableOverrides(n,t,r);if(e.symbolLayers)for(const n of e.symbolLayers)Ad.findApplicableOverrides(n,t,r);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const n of e.effects)Ad.findApplicableOverrides(n,t,r);if(e.markerPlacement&&Ad.findApplicableOverrides(e.markerPlacement,t,r),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const n of e.markerGraphics)Ad.findApplicableOverrides(n,t,r),Ad.findApplicableOverrides(n.symbol,t,r)}else e.type==="CIMCharacterMarker"?Ad.findApplicableOverrides(e.symbol,t,r):e.type==="CIMHatchFill"?Ad.findApplicableOverrides(e.lineSymbol,t,r):e.type==="CIMPictureMarker"&&Ad.findApplicableOverrides(e.animatedSymbolProperties,t,r)}}}static findEffectOverrides(e,t){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&OMt(e),!t||!e.primitiveName)return{type:"cim-effect-info",effect:e,overrides:[]};const r=e.primitiveName,n=[];for(const s of t)s.primitiveName===r&&n.push({...s,propertyName:d1e(s.propertyName)});return{type:"cim-effect-info",effect:e,overrides:n}}static async resolveSymbolOverrides(e,t,r,n,s,o,a){if(!e?.symbol)return null;let{symbol:l,primitiveOverrides:u}=e;const c=!!u;if(!c&&!n)return l;l=li(l),u=li(u);let h=!0;if(t||(t={attributes:{}},h=!1),c){if(h||(u=u.filter(p=>!p.valueExpressionInfo?.expression.includes("$feature"))),a||(u=u.filter(p=>!p.valueExpressionInfo?.expression.includes("$view"))),u.length>0){const p={spatialReference:r,fields:air(t.attributes),geometryType:s};await Ad.createRenderExpressions(u,p),Ad.evaluateOverrides(u,t,s??"esriGeometryPoint",o,a)}Ad.applyOverrides(l,u)}return n&&Ad.applyDictionaryTextOverrides(l,t,n,null),l}static async createRenderExpressions(e,t){const r=[];for(const n of e){const s=n.valueExpressionInfo;if(!s||Ad._expressionToRenderExpression.has(s.expression))continue;const o=$At(s.expression,t.spatialReference,t.fields);r.push(o),o.then(a=>Ad._expressionToRenderExpression.set(s.expression,a))}r.length>0&&await Promise.all(r)}static evaluateOverrides(e,t,r,n,s){const o={$view:{scale:s?.scale}};for(const a of e){a.value&&typeof a.value=="object"&&pVe(a.value)&&(a.propertyName==="Color"||a.propertyName==="StrokeColor")&&(a.value=wir(a.value));const l=a.valueExpressionInfo;if(!l)continue;const u=Ad._expressionToRenderExpression.get(l.expression);u&&(a.value=vir(u,t,o,r,n))}}static applyDictionaryTextOverrides(e,t,r,n,s="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const o=e.symbolLayers;if(!o)return;for(const a of o)a&&a.type==="CIMVectorMarker"&&Ad.applyDictionaryTextOverrides(a,t,r,n,e.type==="CIMTextSymbol"?e.textCase:s)}break;case"CIMVectorMarker":{const o=e.markerGraphics;if(!o)return;for(const a of o)a&&Ad.applyDictionaryTextOverrides(a,t,r,n)}break;case"CIMMarkerGraphic":{const o=e.textString;if(o&&o.includes("[")){const a=Xtr(o,r);e.textString=Jtr(t,a,n,s)}}}}static applyOverrides(e,t,r,n){if(e.primitiveName){for(const s of t)if(s.primitiveName===e.primitiveName){const o=d1e(s.propertyName);if(n&&n.push({cim:e,nocapPropertyName:o,value:e[o]}),r){let a=!1;for(const l of r)l.primitiveName===e.primitiveName&&(a=!0);a||r.push(s)}s.value!=null&&(e[o]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)Ad.applyOverrides(s,t,r,n);if(e.symbolLayers)for(const s of e.symbolLayers)Ad.applyOverrides(s,t,r,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)Ad.applyOverrides(s,t,r,n);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)Ad.applyOverrides(s,t,r,n),Ad.applyOverrides(s.symbol,t,r,n)}}static restoreOverrides(e){for(const t of e)t.cim[t.nocapPropertyName]=t.value}static buildOverrideKey(e){let t="";for(const r of e)r.value!==void 0&&(t+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return t}static toValue(e,t){if(e==="DashTemplate")return t.split(" ").map(r=>Number(r));if(e==="Color"){const r=new jr(t).toRgba();return r[3]*=255,r}return t}};N5._expressionToRenderExpression=new Map;const Ynt="esri.renderers.support.DictionaryLoader",xir={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let NMt=class{constructor(e,t,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new d3(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=t,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,t){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(t));try{r=await this._dictionaryPromise}catch(h){if(mo(h))return this._dictionaryPromise=null,null}const n=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),s={};if(this.fieldMap)for(const h of this._symbolFields){const p=RMt(this.fieldMap[h],this._fieldIndex);if(p){const m=e.attributes[p];s[h]=n?m:m!=null?""+e.attributes[p]:""}else s[h]=""}let o=null;try{o=r?.(s,t)}catch{return null}if(!o||typeof o!="string"||o==="invalid")return null;const a=o.split(";"),l=[],u=[];for(const h of a)if(h)if(h.includes("po:")){const p=h.substr(3).split("|");if(p.length===3){const m=p[0],v=p[1];let w=p[2];if(v==="DashTemplate")w=w.split(" ").map(S=>Number(S));else if(v==="Color"){const S=new jr(w).toRgba();w=[S[0],S[1],S[2],255*S[3]]}else w=Number(w);u.push({primitiveName:m,propertyName:v,value:w,defaultValue:null})}}else if(h.includes("|")){for(const p of h.split("|"))if(this._itemNames.has(p)){l.push(p);break}}else this._itemNames.has(h)&&l.push(h);const c=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,l,u,c,t)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void di.getLogger(Ynt).error("no valid URL!");const t=zi(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([t,e_()]);if(!r)throw this._dictionaryPromise=null,new qe("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:n,dictionary_version:s,expression:o,itemsNames:a}=r,l=o;let u=!1;s&&(this._dictionaryVersion=EY.parse(s),u=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(a),this._symbolFields=n.symbol;const c={};if(this.config){const m=this.config;for(const v in m)c[v]=m[v]}if(n.configuration)for(const m of n.configuration)c.hasOwnProperty(m.name)||(c[m.name]=m.value);const h=[];if(e?.fields&&this.fieldMap)for(const m in this.fieldMap){const v=this.fieldMap[m],w=e.fields.filter(S=>S.name.toLowerCase()===v?.toLowerCase());w.length>0&&h.push({...w[0],type:u?w[0].type:"esriFieldTypeString"})}h.length>0&&(this._fieldIndex=new Cd(h));const p=CZi(l,e!=null?e.spatialReference:null,h,c).then(m=>{const v={scale:0};return(w,S)=>{if(m==null)return null;const I=m.repurposeFeature({geometry:null,attributes:w});return v.scale=S!=null?S.scale??void 0:void 0,m.evaluate({$feature:I,$view:v},m.services)}}).catch(m=>(di.getLogger(Ynt).error("Creating dictinoary expression failed:",m),null));return this._dictionaryPromise=p,p}async _cimPartsToCIMSymbol(e,t,r,n,s){const o=new Array(t.length);for(let u=0;uo.data);const n=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),s=zi(n,{responseType:"json",query:{f:"json"},...t});this._ongoingRequests.set(e,s),s.finally(()=>this._ongoingRequests.delete(e));try{const o=await s;return this._symbolCache.put(e,o.data),o.data}catch(o){throw o}}_combineSymbolParts(e,t,r){if(!e||e.length===0)return null;const n={...e[0]};if(e.length>1){n.symbolLayers=[];for(const s of e){const o=s;n.symbolLayers.unshift(...o.symbolLayers)}}return r&&(n.callout=xir),{type:"CIMSymbolReference",symbol:n,primitiveOverrides:t}}};var cke;let LT=cke=class extends Wk(V3){constructor(i){super(i),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new NMt(this.url,this.config,this.fieldMap)}writeData(i,e){i&&(e.scalingExpressionInfo={expression:i,returnType:"number"})}writeVisualVariables(i,e,t,r){r?.origin||super.writeVisualVariables(i,e,t,r)}clone(){return new cke({config:li(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:li(this.fieldMap),url:li(this.url),visualVariables:li(this.visualVariables)})}async getSymbolAsync(i,e){return this._loader.getSymbolAsync(i,e)}async collectRequiredFields(i,e){await this.collectVVRequiredFields(i,e),this.scaleExpression&&await i_(i,e,this.scaleExpression);for(const t in this.fieldMap){const r=this.fieldMap[t];e.has(r)&&i.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};x([D({type:NMt})],LT.prototype,"_loader",null),x([D({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],LT.prototype,"config",void 0),x([D({type:Object,json:{write:!0}})],LT.prototype,"fieldMap",void 0),x([D({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],LT.prototype,"scaleExpression",void 0),x([ur("scaleExpression")],LT.prototype,"writeData",null),x([D({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(i){return{enabled:!!i&&!!this.scaleExpression}}}}})],LT.prototype,"scaleExpressionTitle",void 0),x([D({type:String,json:{write:!0}})],LT.prototype,"url",void 0),x([ur("visualVariables")],LT.prototype,"writeVisualVariables",null),LT=cke=x([Qe("esri.renderers.DictionaryRenderer")],LT);const Sir=LT;var hke;let HM=hke=class extends Ci{constructor(i){super(i),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(i){return i==null?i:typeof i=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(i)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new hke({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};x([D({type:jr,json:{type:[Number],write:!0}})],HM.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"field",void 0),x([So("field")],HM.prototype,"castField",null),x([D({type:String,json:{write:!0}})],HM.prototype,"label",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"valueExpressionTitle",void 0),HM=hke=x([Qe("esri.renderers.support.AttributeColorInfo")],HM);const $Mt=HM;var dke;let Ame=dke=class extends Ci{constructor(){super(...arguments),this.unit=null}clone(){return new dke({unit:this.unit})}};x([D({type:String,json:{write:!0}})],Ame.prototype,"unit",void 0),Ame=dke=x([Qe("esri.renderers.support.DotDensityLegendOptions")],Ame);const Tir=Ame;var pke;let L_=pke=class extends Wk(V3){constructor(i){super(i),this.attributes=null,this.backgroundColor=new jr([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new vg,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(i){if(this.referenceScale==null)return this.dotValue;const e=i/this.referenceScale*this.dotValue;return e<1?1:e}getSymbol(){return new Hx({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((i,e)=>i+e.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new pke({attributes:li(this.attributes),backgroundColor:li(this.backgroundColor),dotBlendingEnabled:li(this.dotBlendingEnabled),dotShape:li(this.dotShape),dotSize:li(this.dotSize),dotValue:li(this.dotValue),legendOptions:li(this.legendOptions),outline:li(this.outline),referenceScale:li(this.referenceScale),seed:li(this.seed),visualVariables:li(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(i,e){await this.collectVVRequiredFields(i,e);for(const t of this.attributes??[])t.valueExpression&&await i_(i,e,t.valueExpression),t.field&&i.add(t.field)}};x([D({type:[$Mt],json:{write:!0}})],L_.prototype,"attributes",void 0),x([D({type:jr,json:{write:!0}})],L_.prototype,"backgroundColor",void 0),x([D({type:Boolean,json:{write:!0}})],L_.prototype,"dotBlendingEnabled",void 0),x([D({type:String,json:{write:!1}})],L_.prototype,"dotShape",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"dotSize",void 0),x([D({type:Tir,json:{write:!0}})],L_.prototype,"legendOptions",void 0),x([D({type:vg,json:{default:null,write:!0}})],L_.prototype,"outline",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"dotValue",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"referenceScale",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"seed",void 0),x([Wr({dotDensity:"dot-density"})],L_.prototype,"type",void 0),L_=pke=x([Qe("esri.renderers.DotDensityRenderer")],L_);const Cir=L_;var fke;let gQ=fke=class extends Ci{constructor(i){super(i),this.color=null,this.ratio=null}clone(){return new fke({color:this.color&&this.color.clone(),ratio:this.ratio})}};x([D({type:jr,json:{type:[ms],default:null,write:!0}})],gQ.prototype,"color",void 0),x([D({type:Number,json:{write:!0}})],gQ.prototype,"ratio",void 0),gQ=fke=x([Qe("esri.renderers.support.HeatmapColorStop")],gQ);const Eie=gQ;let DG=class extends xs(Ci){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};x([D({type:String,json:{write:!0}})],DG.prototype,"minLabel",void 0),x([D({type:String,json:{write:!0}})],DG.prototype,"maxLabel",void 0),x([D({type:String,json:{write:!0}})],DG.prototype,"title",void 0),DG=x([Qe("esri.renderers.support.HeatmapLegendOptions")],DG);const bVe=2.4;function Eir(i){return uy(i*bVe)}function Iir(i){return us(i)/bVe}function Air(i,e,t,r){let{color:n,ratio:s}=e,{color:o,ratio:a}=t;a===s&&(a===1?s-=1e-6:a+=1e-6);const l=uu((r-s)/(a-s),0,1);dVe(i,n.toArray(),o.toArray(),l)}function Mir(i){const t=new Uint8ClampedArray(2048);if(i=i.filter(({ratio:a})=>a>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),i.length<1)return t;let r=i[0],n=i[0],s=1;const o=EE();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>n.ratio&&s1?0:3/(Math.PI*t**2)*(1-r**2)**2}function Pir(i){return typeof i=="function"?i:i?e=>+e[i]:()=>1}var mke;function Xnt(i){if(i!=null){const{maxDensity:e,minDensity:t,radius:r}=i;if(e!=null||t!=null||r!=null){const{blurRadius:n,maxPixelIntensity:s,minPixelIntensity:o,...a}=i;return a}}return i}let jg=mke=class extends V3{constructor(i){super(i),this.authoringInfo=null,this.colorStops=[new Eie({ratio:0,color:new jr("rgba(255, 140, 0, 0)")}),new Eie({ratio:.75,color:new jr("rgba(255, 140, 0, 1)")}),new Eie({ratio:.9,color:new jr("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(i){return Xnt(i)}get blurRadius(){return Iir(this.radius)}set blurRadius(i){const e=this.maxPixelIntensity,t=this.minPixelIntensity;this._set("radius",Eir(i)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",t*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(i){this._set("maxDensity",i*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(i){this._set("minDensity",i*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(bVe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(i,e){this._warnedProps[i]||Kp(this).getDefaultOrigin()==="user"&&(this._warnedProps[i]=!0,Gk(()=>{ty(di.getLogger(this),i,{replacement:`${String(e)} (suggested value: ${this._get(e)})`,version:"4.24"})}))}read(i,e){i=Xnt(i),super.read(i,e)}getSymbol(){return new Jh}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(i,e){const t=this.field,r=this.valueExpression;t&&typeof t=="string"&&$v(i,e,t),r&&typeof r=="string"&&await i_(i,e,r)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new mke({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:li(this.colorStops),field:this.field,legendOptions:li(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};x([D({type:vae,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],jg.prototype,"authoringInfo",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"blurRadius",null),x([D({type:[Eie],json:{write:!0}})],jg.prototype,"colorStops",void 0),x([D({type:String,json:{write:!0}})],jg.prototype,"field",void 0),x([D({type:DG,json:{write:!0}})],jg.prototype,"legendOptions",void 0),x([D({type:Number,json:{write:!0}})],jg.prototype,"maxDensity",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"maxPixelIntensity",null),x([D({type:Number,json:{write:!0}})],jg.prototype,"minDensity",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"minPixelIntensity",null),x([D({type:Number,cast:Cl,json:{write:!0}})],jg.prototype,"radius",void 0),x([D({type:Number,range:{min:0},json:{default:0,write:!0}})],jg.prototype,"referenceScale",void 0),x([Wr({heatmap:"heatmap"})],jg.prototype,"type",void 0),x([D({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],jg.prototype,"valueExpression",void 0),x([D({type:String})],jg.prototype,"valueExpressionTitle",void 0),x([D({readOnly:!0})],jg.prototype,"_pixelIntensityToDensity",null),jg=mke=x([Qe("esri.renderers.HeatmapRenderer")],jg);const BMt=jg;let I6=class extends xs(Ci){constructor(){super(...arguments),this.color=new jr([0,0,0,0]),this.label=null,this.threshold=0}};x([D({type:jr,json:{write:!0}})],I6.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],I6.prototype,"label",void 0),x([D({type:Number,range:{min:0,max:1},json:{write:!0}})],I6.prototype,"threshold",void 0),I6=x([Qe("esri.renderers.support.OthersCategory")],I6);let Mme=class extends xs(Ci){constructor(){super(...arguments),this.title=null}};x([D({type:String,json:{write:!0}})],Mme.prototype,"title",void 0),Mme=x([Qe("esri.renderers.support.PieChartLegendOptions")],Mme);let gw=class extends Wk(xs(V3)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new jr([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new I6,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new Jh({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(Ga)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const r of this.attributes)r.valueExpression&&await i_(e,t,r.valueExpression),r.field&&e.add(r.field)}};x([D({type:[$Mt],json:{write:!0}})],gw.prototype,"attributes",void 0),x([D({type:Hx,json:{default:null,write:!0}})],gw.prototype,"backgroundFillSymbol",void 0),x([D({type:jr,json:{write:!0}})],gw.prototype,"defaultColor",void 0),x([D({type:String,json:{write:!0}})],gw.prototype,"defaultLabel",void 0),x([D({type:Number,range:{min:0,max:1},json:{write:!0}})],gw.prototype,"holePercentage",void 0),x([D({type:I6,json:{write:!0}})],gw.prototype,"othersCategory",void 0),x([D({type:Mme,json:{write:!0}})],gw.prototype,"legendOptions",void 0),x([D({type:vg,json:{default:null,write:!0}})],gw.prototype,"outline",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],gw.prototype,"size",void 0),x([Wr({pieChart:"pie-chart"})],gw.prototype,"type",void 0),gw=x([Qe("esri.renderers.PieChartRenderer")],gw);const Rir=gw;var gke;let UN=gke=class extends Wk(V3){constructor(i){super(i),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(i,e){await Promise.all([this.collectSymbolFields(i,e),this.collectVVRequiredFields(i,e)])}async collectSymbolFields(i,e){await Promise.all(this.getSymbols().map(t=>t.collectRequiredFields(i,e)))}getSymbol(i,e){return this.symbol}async getSymbolAsync(i,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((i,e)=>i+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new gke({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:li(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};x([D({type:String,json:{write:!0}})],UN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],UN.prototype,"label",void 0),x([D(uVe)],UN.prototype,"symbol",void 0),x([Wr({simple:"simple"})],UN.prototype,"type",void 0),UN=gke=x([Qe("esri.renderers.SimpleRenderer")],UN);const _x=UN,Dir=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function yke(i){return i instanceof un}function Jnt(i){return i instanceof dr?Object.keys(i.items):yke(i)?Kp(i).keys():i?Object.keys(i):[]}function ehe(i,e){return i instanceof dr?i.items[e]:i[e]}function Fir(i,e){return!(!Array.isArray(i)||!Array.isArray(e))&&i.length!==e.length}function Iie(i){return i?i.declaredClass:null}function jMt(i,e){const t=i.diff;if(t&&typeof t=="function")return t(i,e);const r=Jnt(i),n=Jnt(e);if(r.length===0&&n.length===0)return;if(!r.length||!n.length||Fir(i,e))return{type:"complete",oldValue:i,newValue:e};const s=n.filter(h=>!r.includes(h)),o=r.filter(h=>!n.includes(h)),a=r.filter(h=>n.includes(h)&&ehe(i,h)!==ehe(e,h)).concat(s,o).sort(),l=Iie(i);if(l&&Dir.has(l)&&a.length)return{type:"complete",oldValue:i,newValue:e};let u;const c=yke(i)&&yke(e);for(const h of a){const p=ehe(i,h),m=ehe(e,h);let v;if((c||typeof p!="function"&&typeof m!="function")&&p!==m&&(p!=null||m!=null)){if(t&&t[h]&&typeof t[h]=="function")v=t[h]?.(p,m);else if(p instanceof Date&&m instanceof Date){if(p.getTime()===m.getTime())continue;v={type:"complete",oldValue:p,newValue:m}}else v=typeof p=="object"&&typeof m=="object"&&Iie(p)===Iie(m)?jMt(p,m):{type:"complete",oldValue:p,newValue:m};v!=null&&(u!=null?u.diff[h]=v:u={type:"partial",diff:{[h]:v}})}}return u}function Knt(i,e){return Aie(i,e)}function Aie(i,e){if(i==null)return!1;const t=e.split(".");let r=i;for(const n of t){if(r.type==="complete")return!0;if(r.type!=="partial")return!1;{const s=r.diff[n];if(!s)return!1;r=s}}return!0}function Znt(i,e){if(!i)return!1;if(i.type==="partial"){const t=Object.keys(i.diff);return t.length===1&&t[0]===e}return!1}function nB(i,e){if(typeof i!="function"&&typeof e!="function"&&(i!=null||e!=null))return i==null||e==null||typeof i=="object"&&typeof e=="object"&&Iie(i)!==Iie(e)?{type:"complete",oldValue:i,newValue:e}:jMt(i,e)}let FG=class extends xs(Ci){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};x([D(Tme)],FG.prototype,"value",void 0),x([D(Tme)],FG.prototype,"value2",void 0),x([D(Tme)],FG.prototype,"value3",void 0),FG=x([Qe("esri.renderers.support.UniqueValue")],FG);const jV=FG;let g4=class extends xs(Ci){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const t=typeof(e=Array.isArray(e)?e:[e])[0];return t==="string"||t==="number"?e.map(r=>new jV({value:r})):t==="object"?e[0]instanceof jV?e:e.map(r=>new jV(r)):null}};x([D({type:String,json:{write:!0}})],g4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],g4.prototype,"label",void 0),x([D(N2e)],g4.prototype,"symbol",void 0),x([D({type:[jV],json:{type:[[String]],read:{reader:i=>i?i.map(e=>new jV({value:e[0],value2:e[1],value3:e[2]})):null},write:{writer:(i,e)=>{const t=[];for(const r of i){const n=[r.value,r.value2,r.value3].filter(Ga).map(s=>s.toString());t.push(n)}e.values=t}}}})],g4.prototype,"values",void 0),x([So("values")],g4.prototype,"castValues",null),g4=x([Qe("esri.renderers.support.UniqueValueClass")],g4);const GMt=g4;let yQ=class extends xs(Ci){constructor(e){super(e),this.heading=null,this.classes=null}};x([D({type:String,json:{write:!0}})],yQ.prototype,"heading",void 0),x([D({type:[GMt],json:{write:!0}})],yQ.prototype,"classes",void 0),yQ=x([Qe("esri.renderers.support.UniqueValueGroup")],yQ);const vke=yQ;var _ke;let zN=_ke=class extends Ci{constructor(i){super(i),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new _ke({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const i=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${i}`}};x([D({type:String,json:{write:!0}})],zN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],zN.prototype,"label",void 0),x([D(uVe)],zN.prototype,"symbol",void 0),x([D(Tme)],zN.prototype,"value",void 0),zN=_ke=x([Qe("esri.renderers.support.UniqueValueInfo")],zN);const J8=zN,kir=()=>!!yi("enable-feature:force-wosr"),Lir=()=>yi.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),Nir=()=>yi.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),$ir=()=>yi.add("enable-i3s-patching",!0,!0,!0),Bir=()=>yi.add("enable-i3s-patching",!1,!0,!0),Qnt=()=>!!yi("enable-feature:SceneLayer-editing"),jir=(i="i3s-patching")=>{switch(Bir(),Nir(),yi.add("enable-feature:SceneLayer-editing",!0,!0,!0),i){case"feature-layer-view":Lir();break;case"i3s-patching":$ir()}};jir("i3s-patching");let S3e={};async function Gir(i,e){try{return{data:(await wVe(i,e)).data,baseUrl:eae(i),styleUrl:i}}catch(t){return _a(t),null}}function Uir(i,e,t){const r=e.portal!=null?e.portal:Bu.getDefault();let n;const s=`${r.url} - ${r.user&&r.user.username} - ${i}`;return S3e[s]||(S3e[s]=zir(i,r,t).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:i}))),S3e[s]}function zir(i,e,t){return e.load(t).then(()=>{const r=new hA({disableExtraQuery:!0,query:`owner:${est} AND type:${tst} AND typekeywords:"${i}"`});return e.queryItems(r,t)}).then(({results:r})=>{let n=null;const s=i.toLowerCase();if(r&&Array.isArray(r)){for(const o of r)if(o.typeKeywords?.some(l=>l.toLowerCase()===s)&&o.type===tst&&o.owner===est){n=o;break}}if(!n)throw new qe("symbolstyleutils:style-not-found",`The style '${i}' could not be found`,{styleName:i});return n.load(t)})}function UMt(i,e,t){return i?.styleUrl!=null?Gir(i.styleUrl,t):i?.styleName!=null?Uir(i.styleName,e,t):Promise.reject(new qe("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function zMt(i){return i===null||i.type==="CIMSymbolReference"?i:{type:"CIMSymbolReference",symbol:i}}function Vir(i,e,t=["gltf"]){if(e==="cimRef")return i.cimRef;if(i.formatInfos&&!kir())for(const r of t){const n=i.formatInfos.find(s=>s.type===r);if(n)return n.href}return i.webRef}function wVe(i,e){const t={responseType:"json",query:{f:"json"},...e};return zi(X1(i),t)}const est="esri_en",tst="Style",Hir="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var vQ;const VMt="esri.renderers.UniqueValueRenderer",vD=()=>di.getLogger(VMt),ist="uvInfos-watcher",rst="uvGroups-watcher",Wir=",",qir=Sd(J8);function Yir(i){const{field1:e,field2:t,field3:r,fieldDelimiter:n,uniqueValueInfos:s,valueExpression:o}=i,a=!(!e||!t);return[{classes:(s??[]).map(l=>{const{symbol:u,label:c,value:h,description:p}=l,[m,v,w]=a?h?.toString()?.split(n||"")||[]:[h],S=[];return(e||o)&&S.push(m),t&&S.push(v),r&&S.push(w),{symbol:u,label:c,values:[S],description:p}})}]}let ad=vQ=class extends Wk(V3){constructor(i){super(i),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,t){if(!e&&!t)return;if(!e||!t)return{type:"complete",oldValue:e,newValue:t};let r=!1;const n={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let s=0;sa.value===t[s].value);o?nB(o,t[s])?(n.changed.push({type:"complete",oldValue:o,newValue:t[s]}),r=!0):n.unchanged.push({oldValue:o,newValue:t[s]}):(n.added.push(t[s]),r=!0)}for(let s=0;so.value===e[s].value)||(n.removed.push(e[s]),r=!0);return r?n:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(i){this._set("field",i),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(i){return i==null||typeof i=="function"?i:Zoe(i)}writeField(i,e,t,r){typeof i=="string"?e[t]=i:r?.messages?r.messages.push(new qe("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):vD().error(".field: cannot write field to JSON since it's not a string value")}set field2(i){this._set("field2",i),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(i){this._set("field3",i),this._updateUniqueValues()}set valueExpression(i){this._set("valueExpression",i),this._updateUniqueValues()}set defaultSymbol(i){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",i)}set fieldDelimiter(i){this._set("fieldDelimiter",i),this._updateUniqueValues()}readPortal(i,e,t){return t.portal||Bu.getDefault()}readStyleOrigin(i,e,t){if(e.styleName)return Object.freeze({styleName:e.styleName});if(e.styleUrl){const r=mE(e.styleUrl,t);return Object.freeze({styleUrl:r})}}writeStyleOrigin(i,e,t,r){i.styleName?e.styleName=i.styleName:i.styleUrl&&(e.styleUrl=gE(i.styleUrl,r))}set uniqueValueGroups(i){this.styleOrigin?vD().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",i),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(i){this.styleOrigin?vD().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",i),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(i,e){if(this.styleOrigin)return void vD().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let t;t=typeof i=="object"?qir(i):new J8({value:i,symbol:j3t(e)}),this.uniqueValueInfos?.push(t),this._valueInfoMap[t.value]=t,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(i){if(this.styleOrigin)return void vD().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const e=this.uniqueValueInfos;if(e)for(let t=0;ti+e.getAttributeHash(),"")}getMeshHash(){const i=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),t=this.uniqueValueInfos?.reduce((r,n)=>r+n.getMeshHash(),"");return`${i}.${e}.${t}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const i=new vQ({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:li(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:li(this.visualVariables),legendOptions:li(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:li(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(i._isDefaultSymbolDerived=!0),i._set("portal",this.portal);const e=li(this.uniqueValueInfos),t=li(this.uniqueValueGroups);return this.styleOrigin&&(i._set("styleOrigin",Object.freeze(li(this.styleOrigin))),Object.freeze(e),Object.freeze(t)),i._set("uniqueValueInfos",e),i._updateValueInfoMap(),i._set("uniqueValueGroups",t),i._isInfosSource=this._isInfosSource,i._watchUniqueValueInfosAndGroups(),i}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(i,e){const t=[this.collectVVRequiredFields(i,e),this.collectSymbolFields(i,e)];await Promise.all(t)}async collectSymbolFields(i,e){const t=[...this.getSymbols().map(r=>r.collectRequiredFields(i,e)),i_(i,e,this.valueExpression)];$v(i,e,this.field),$v(i,e,this.field2),$v(i,e,this.field3),await Promise.all(t)}populateFromStyle(){return UMt(this.styleOrigin,{portal:this.portal}).then(i=>{const e=[];return this._valueInfoMap={},i&&i.data&&Array.isArray(i.data.items)&&i.data.items.forEach(t=>{const r=new YB({styleUrl:i.styleUrl,styleName:i.styleName,portal:this.portal,name:t.name});this.defaultSymbol||t.name!==i.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new J8({value:t.name,symbol:r});e.push(n),this._valueInfoMap[t.name]=n}),this._set("uniqueValueInfos",Object.freeze(e)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",Wir)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:i}=this;if(i)for(const e of i)this._valueInfoMap[e.value+""]=e}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(ist);const{uniqueValueInfos:i}=this;if(i){const e=[];for(const t of i)e.push(Ki(()=>({symbol:t.symbol,value:t.value,label:t.label,description:t.description}),(r,n)=>{r!==n&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(e,ist)}}_watchUniqueValueGroups(){this.removeHandles(rst);const{uniqueValueGroups:i}=this;if(i){const e=[];for(const t of i){e.push(Ki(()=>({classes:t.classes}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of t.classes??[])e.push(Ki(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(n,s)=>{n!==s&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(e,rst)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const i=[],{field:e,field2:t,field3:r,fieldDelimiter:n,uniqueValueGroups:s,valueExpression:o}=this;if(!e&&!o)return this._set("uniqueValueInfos",i),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!e||!t);for(const l of s)for(const u of l.classes??[]){const{symbol:c,label:h,values:p,description:m}=u;for(const v of p??[]){const{value:w,value2:S,value3:I}=v,R=[w];t&&R.push(S),r&&R.push(I);const L=a?R.join(n||""):R[0];i.push(new J8({symbol:c,label:h,value:L,description:m}))}}this._set("uniqueValueInfos",i),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(i=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:e,field2:t,valueExpression:r,fieldDelimiter:n,uniqueValueInfos:s}=this;if(!e&&!r||!s.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!e||!t),a=s.map(u=>{const{symbol:c,label:h,value:p,description:m}=u,[v,w,S]=o?p?.toString()?.split(n||"")||[]:[p];return new GMt({symbol:c,label:h,description:m,values:[new jV({value:v,value2:w,value3:S})]})}),l=[new vke({classes:a})];i&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(i,e){return this.valueExpression?this._getUnqiueValueInfoForExpression(i,e):this._getUnqiueValueInfoForFields(i)}_getUnqiueValueInfoForExpression(i,e){const{viewingMode:t,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{};let a=this._cache.compiledFunc;const l=s.arcadeUtils;if(!a){const c=l.createSyntaxTree(this.valueExpression);a=l.createFunction(c),this._cache.compiledFunc=a}const u=l.executeFunction(a,l.createExecContext(i,l.getViewInfo({viewingMode:t,scale:r,spatialReference:n}),o));return this._valueInfoMap[u+""]}_getUnqiueValueInfoForFields(i){const e=this.field,t=i.attributes;let r;if(typeof e!="function"&&this.field2){const n=this.field2,s=this.field3,o=[];e&&o.push(t[e]),n&&o.push(t[n]),s&&o.push(t[s]),r=o.join(this.fieldDelimiter||"")}else typeof e=="function"?r=e(i):e&&(r=t[e]);return this._valueInfoMap[r+""]}static fromPortalStyle(i,e){const t=new vQ(e?.properties);t._set("styleOrigin",Object.freeze({styleName:i})),t._set("portal",e?.portal||Bu.getDefault());const r=t.populateFromStyle();return r.catch(n=>{vD().error(`#fromPortalStyle('${i}'[, ...])`,"Failed to create unique value renderer from style name",n)}),r}static fromStyleUrl(i,e){const t=new vQ(e?.properties);t._set("styleOrigin",Object.freeze({styleUrl:i}));const r=t.populateFromStyle();return r.catch(n=>{vD().error(`#fromStyleUrl('${i}'[, ...])`,"Failed to create unique value renderer from style URL",n)}),r}};x([D({readOnly:!0})],ad.prototype,"_cache",null),x([Wr({uniqueValue:"unique-value"})],ad.prototype,"type",void 0),x([D(Z3t)],ad.prototype,"backgroundFillSymbol",void 0),x([D({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],ad.prototype,"field",null),x([So("field")],ad.prototype,"castField",null),x([ur("field")],ad.prototype,"writeField",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"field2",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"field3",null),x([D({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],ad.prototype,"orderByClassesEnabled",void 0),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"valueExpression",null),x([D({type:String,json:{write:!0}})],ad.prototype,"valueExpressionTitle",void 0),x([D({type:UA,json:{write:!0}})],ad.prototype,"legendOptions",void 0),x([D({type:String,json:{write:!0}})],ad.prototype,"defaultLabel",void 0),x([D(GUe({...N2e},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],ad.prototype,"defaultSymbol",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"fieldDelimiter",null),x([D({type:Bu,readOnly:!0})],ad.prototype,"portal",void 0),x([Mi("portal",["styleName"])],ad.prototype,"readPortal",null),x([D({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],ad.prototype,"styleOrigin",void 0),x([Mi("styleOrigin",["styleName","styleUrl"])],ad.prototype,"readStyleOrigin",null),x([ur("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],ad.prototype,"writeStyleOrigin",null),x([D({type:[vke],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(i,e,t)=>(e.uniqueValueGroups||Yir(e)).map(r=>vke.fromJSON(r,t))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],ad.prototype,"uniqueValueGroups",null),x([D({type:[J8],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],ad.prototype,"uniqueValueInfos",null),ad=vQ=x([Qe(VMt)],ad);const JB=ad,IE={key:"type",base:V3,typeMap:{heatmap:BMt,simple:_x,"unique-value":JB,"class-breaks":XB,"dot-density":Cir,dictionary:Sir,"pie-chart":Rir},errorContext:"renderer"},qk={key:"type",base:V3,typeMap:{simple:_x,"unique-value":JB,"class-breaks":XB,heatmap:BMt},errorContext:"renderer",validate:Xir};function Xir(i){switch(i.type){case"simple":return Jir(i);case"unique-value":return Kir(i);case"class-breaks":return Zir(i);case"heatmap":return i}}function Jir(i){if(i.symbol)return i;di.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Kir(i){const e=i.uniqueValueInfos,t=e?.filter(({symbol:r,label:n},s)=>(r||di.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${s}] ${n}) without a symbol from web scene.`),!!r));return t?.length!==e?.length&&(i.uniqueValueInfos=t),i}function Zir(i){const e=i.classBreakInfos,t=e?.filter(({symbol:r,label:n},s)=>(r||di.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${s}] ${n}) without a symbol from web scene.`),!!r));return t?.length!==e?.length&&(i.classBreakInfos=t),i}function YC(i,e){return sB(i,null,e)}const Qir=zB({types:IE});function sB(i,e,t){return i?i&&(i.styleName||i.styleUrl)&&i.type!=="uniqueValue"?(t?.messages&&t.messages.push(new Rf("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+i.type+"'",{definition:i,context:t})),null):Qir(i,e,t):null}let trr=class HMt{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(N4e),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new HMt,r=this._originStores[Pn.DEFAULTS];r&&r.forEach((n,s)=>{t.set(s,li(n),Pn.DEFAULTS)});for(let n=Pn.SERVICE;n{e&&e.has(a)||t.set(a,li(o),n)})}return t}get(e,t){const r=t===void 0?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=Pn.USER){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const s=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),s!==t}return!1}delete(e,t=Pn.USER){const r=this._originStores[t];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let s=t-1;s>=0;s--){const o=this._originStores[s];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,s);break}}}return n}has(e,t){const r=t===void 0?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],n=r?.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,t),s!==n}originOf(e){return this._propertyOriginMap.get(e)||Pn.DEFAULTS}forEach(e){this._values.forEach(e)}};const WMt=i=>{let e=class extends i{constructor(...t){super(...t);const r=Kp(this),n=r.store,s=new trr;r.store=s,BCt(r,n,s)}read(t,r){GCt(this,t,r)}getAtOrigin(t,r){const n=T3e(this),s=n0(r);if(typeof t=="string")return n.get(t,s);const o={};return t.forEach(a=>{o[a]=n.get(a,s)}),o}originOf(t){return yne(this.originIdOf(t))}originIdOf(t){return T3e(this).originOf(t)}revert(t,r){const n=T3e(this),s=n0(r),o=Kp(this);let a;a=typeof t=="string"?t==="*"?n.keys(s):[t]:t,a.forEach(l=>{o.invalidate(l),n.revert(l,s),o.commit(l)})}};return e=x([Qe("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function T3e(i){return Kp(i).store}let nst=class extends WMt(un){};nst=x([Qe("esri.core.ReadOnlyMultiOriginJSONSupport")],nst);const irr=i=>{let e=class extends i{constructor(...t){super(...t)}clear(t,r="user"){return C3e(this).delete(t,n0(r))}write(t,r){return VCt(this,t=t||{},r),t}setAtOrigin(t,r,n){Kp(this).setAtOrigin(t,r,n0(n))}removeOrigin(t){const r=C3e(this),n=n0(t),s=r.keys(n);for(const o of s)r.originOf(o)===n&&r.set(o,r.get(o,n),Pn.USER)}updateOrigin(t,r){const n=C3e(this),s=n0(r),o=_S(this,t);for(let a=s+1;a{let e=class extends irr(WMt(i)){constructor(...t){super(...t)}};return e=x([Qe("esri.core.MultiOriginJSONSupport")],e),e};let f1e=class extends Ql(un){};f1e=x([Qe("esri.core.MultiOriginJSONSupport")],f1e);const Wv=(i=>i)(["operational-layers","basemap","ground"]);var bke;let VN=bke=class extends Ci{constructor(i){super(i),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new bke({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};x([D({type:String,json:{write:!0}})],VN.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],VN.prototype,"name",void 0),x([D({type:["boolean","date","number","string"],json:{write:!0}})],VN.prototype,"returnType",void 0),x([D({type:String,json:{write:!0}})],VN.prototype,"title",void 0),VN=bke=x([Qe("esri.form.ExpressionInfo")],VN);const rrr=VN;let HN=class extends Ci{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};x([D({type:String,json:{write:!0}})],HN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],HN.prototype,"label",void 0),x([D()],HN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],HN.prototype,"visibilityExpression",void 0),HN=x([Qe("esri.form.elements.Element")],HN);const oB=HN;var wke;let Ome=wke=class extends Ci{constructor(i){super(i),this.type=null}clone(){return new wke({type:this.type})}};x([D({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],Ome.prototype,"type",void 0),Ome=wke=x([Qe("esri.form.elements.inputs.AttachmentInput")],Ome);const nrr=Ome;var xke;let WN=xke=class extends oB{constructor(i){super(i),this.attachmentKeyword=null,this.editableExpression=null,this.input=null,this.type="attachment"}clone(){return new xke({attachmentKeyword:this.attachmentKeyword,description:this.description,editableExpression:this.editableExpression,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};x([D({type:String,json:{write:!0}})],WN.prototype,"attachmentKeyword",void 0),x([D({type:String,json:{write:!0}})],WN.prototype,"editableExpression",void 0),x([D({type:nrr,json:{read:{source:"inputType"},write:{target:"inputType"}}})],WN.prototype,"input",void 0),x([D({type:["attachment"],json:{read:!1,write:!0}})],WN.prototype,"type",void 0),WN=xke=x([Qe("esri.form.elements.AttachmentElement")],WN);const sst=WN;let Pme=class extends Ci{constructor(e){super(e),this.type=null}};x([D()],Pme.prototype,"type",void 0),Pme=x([Qe("esri.form.elements.inputs.Input")],Pme);const NR=Pme;let _Q=class extends NR{constructor(e){super(e),this.maxLength=null,this.minLength=0}};x([D({type:Number,json:{write:!0}})],_Q.prototype,"maxLength",void 0),x([D({type:Number,json:{write:!0}})],_Q.prototype,"minLength",void 0),_Q=x([Qe("esri.form.elements.inputs.TextInput")],_Q);const xVe=_Q;var Ske;let Rme=Ske=class extends xVe{constructor(i){super(i),this.type="barcode-scanner"}clone(){return new Ske({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["barcode-scanner"],json:{read:!1,write:!0}})],Rme.prototype,"type",void 0),Rme=Ske=x([Qe("esri.form.elements.inputs.BarcodeScannerInput")],Rme);const srr=Rme;var Tke;let kG=Tke=class extends NR{constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new Tke({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};x([D({type:String,json:{write:!0}})],kG.prototype,"noValueOptionLabel",void 0),x([D({type:Boolean,json:{write:!0}})],kG.prototype,"showNoValueOption",void 0),x([D({type:["combo-box"],json:{read:!1,write:!0}})],kG.prototype,"type",void 0),kG=Tke=x([Qe("esri.form.elements.inputs.ComboBoxInput")],kG);const orr=kG;var Cke;function ost(i){return i??null}function ast(i){return i??null}let mI=Cke=class extends NR{constructor(i){super(i),this.max=null,this.min=null,this.type="date-picker"}readMax(i,e){return ost(e.max)}writeMax(i,e){e.max=ast(i)}readMin(i,e){return ost(e.min)}writeMin(i,e){e.min=ast(i)}clone(){return new Cke({max:this.max,min:this.min})}};x([D({type:String,json:{type:String,write:!0}})],mI.prototype,"max",void 0),x([Mi("max")],mI.prototype,"readMax",null),x([ur("max")],mI.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],mI.prototype,"min",void 0),x([Mi("min")],mI.prototype,"readMin",null),x([ur("min")],mI.prototype,"writeMin",null),x([D({type:["date-picker"],json:{read:!1,write:!0}})],mI.prototype,"type",void 0),mI=Cke=x([Qe("esri.form.elements.inputs.DatePickerInput")],mI);const arr=mI;var Eke;function E3e(i){return i??null}function I3e(i){return i??null}let N_=Eke=class extends NR{constructor(i){super(i),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(i,e){return E3e(e.max)}writeMax(i,e){e.max=I3e(i)}readMin(i,e){return E3e(e.min)}writeMin(i,e){e.min=I3e(i)}readTimeResolution(i,e){return E3e(e.timeResolution)}writeTimeResolution(i,e){e.timeResolution=I3e(i)}clone(){return new Eke({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};x([D({type:Boolean,json:{write:!0}})],N_.prototype,"includeTimeOffset",void 0),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"max",void 0),x([Mi("max")],N_.prototype,"readMax",null),x([ur("max")],N_.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"min",void 0),x([Mi("min")],N_.prototype,"readMin",null),x([ur("min")],N_.prototype,"writeMin",null),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"timeResolution",void 0),x([Mi("timeResolution")],N_.prototype,"readTimeResolution",null),x([ur("timeResolution")],N_.prototype,"writeTimeResolution",null),x([D({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],N_.prototype,"type",void 0),N_=Eke=x([Qe("esri.form.elements.inputs.DateTimeOffsetPickerInput")],N_);const lrr=N_;var Ike;function lst(i){return i!=null?new Date(i):null}function ust(i){return i?i.getTime():null}let NT=Ike=class extends NR{constructor(i){super(i),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(i,e){return lst(e.max)}writeMax(i,e){e.max=ust(i)}readMin(i,e){return lst(e.min)}writeMin(i,e){e.min=ust(i)}clone(){return new Ike({includeTime:this.includeTime,max:this.max,min:this.min})}};x([D({type:Boolean,json:{write:!0}})],NT.prototype,"includeTime",void 0),x([D({type:Date,json:{type:Number,write:!0}})],NT.prototype,"max",void 0),x([Mi("max")],NT.prototype,"readMax",null),x([ur("max")],NT.prototype,"writeMax",null),x([D({type:Date,json:{type:Number,write:!0}})],NT.prototype,"min",void 0),x([Mi("min")],NT.prototype,"readMin",null),x([ur("min")],NT.prototype,"writeMin",null),x([D({type:["datetime-picker"],json:{read:!1,write:!0}})],NT.prototype,"type",void 0),NT=Ike=x([Qe("esri.form.elements.inputs.DateTimePickerInput")],NT);const urr=NT;var Ake;let LG=Ake=class extends NR{constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new Ake({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};x([D({type:String,json:{write:!0}})],LG.prototype,"noValueOptionLabel",void 0),x([D({type:Boolean,json:{write:!0}})],LG.prototype,"showNoValueOption",void 0),x([D({type:["radio-buttons"],json:{read:!1,write:!0}})],LG.prototype,"type",void 0),LG=Ake=x([Qe("esri.form.elements.inputs.RadioButtonsInput")],LG);const crr=LG;var Mke;let NG=Mke=class extends NR{constructor(i){super(i),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new Mke({offValue:this.offValue,onValue:this.onValue})}};x([D({type:[String,Number],json:{write:!0}})],NG.prototype,"offValue",void 0),x([D({type:[String,Number],json:{write:!0}})],NG.prototype,"onValue",void 0),x([D({type:["switch"],json:{read:!1,write:!0}})],NG.prototype,"type",void 0),NG=Mke=x([Qe("esri.form.elements.inputs.SwitchInput")],NG);const hrr=NG;var Oke;let Dme=Oke=class extends xVe{constructor(i){super(i),this.type="text-area"}clone(){return new Oke({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["text-area"],json:{read:!1,write:!0}})],Dme.prototype,"type",void 0),Dme=Oke=x([Qe("esri.form.elements.inputs.TextAreaInput")],Dme);const drr=Dme;var Pke;let Fme=Pke=class extends xVe{constructor(i){super(i),this.type="text-box"}clone(){return new Pke({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["text-box"],json:{read:!1,write:!0}})],Fme.prototype,"type",void 0),Fme=Pke=x([Qe("esri.form.elements.inputs.TextBoxInput")],Fme);const prr=Fme;var Rke;function A3e(i){return i??null}function M3e(i){return i??null}let yw=Rke=class extends NR{constructor(i){super(i),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(i,e){return A3e(e.max)}writeMax(i,e){e.max=M3e(i)}readMin(i,e){return A3e(e.min)}writeMin(i,e){e.min=M3e(i)}readTimeResolution(i,e){return A3e(e.timeResolution)}writeTimeResolution(i,e){e.timeResolution=M3e(i)}clone(){return new Rke({max:this.max,min:this.min,timeResolution:this.timeResolution})}};x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"max",void 0),x([Mi("max")],yw.prototype,"readMax",null),x([ur("max")],yw.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"min",void 0),x([Mi("min")],yw.prototype,"readMin",null),x([ur("min")],yw.prototype,"writeMin",null),x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"timeResolution",void 0),x([Mi("timeResolution")],yw.prototype,"readTimeResolution",null),x([ur("timeResolution")],yw.prototype,"writeTimeResolution",null),x([D({type:["time-picker"],json:{read:!1,write:!0}})],yw.prototype,"type",void 0),yw=Rke=x([Qe("esri.form.elements.inputs.TimePickerInput")],yw);const frr=yw,mrr={base:NR,key:"type",typeMap:{"barcode-scanner":srr,"combo-box":orr,"date-picker":arr,"datetime-picker":urr,"datetimeoffset-picker":lrr,"radio-buttons":crr,switch:hrr,"text-area":drr,"text-box":prr,"time-picker":frr}};var Dke;let bQ=Dke=class extends Ci{constructor(i){super(i),this.name=null,this.code=null}clone(){return new Dke({name:this.name,code:this.code})}};x([D({type:String,json:{write:!0}})],bQ.prototype,"name",void 0),x([D({type:[String,Number],json:{write:!0}})],bQ.prototype,"code",void 0),bQ=Dke=x([Qe("esri.layers.support.CodedValue")],bQ);const grr=new Rs({inherited:"inherited",codedValue:"coded-value",range:"range"});let wQ=class extends Ci{constructor(e){super(e),this.name=null,this.type=null}};x([D({type:String,json:{write:!0}})],wQ.prototype,"name",void 0),x([Wr(grr)],wQ.prototype,"type",void 0),wQ=x([Qe("esri.layers.support.Domain")],wQ);const B2e=wQ;var Fke;let xQ=Fke=class extends B2e{constructor(i){super(i),this.codedValues=null,this.type="coded-value"}getName(i){let e=null;if(this.codedValues){const t=String(i);this.codedValues.some(r=>(String(r.code)===t&&(e=r.name),!!e))}return e}clone(){return new Fke({codedValues:li(this.codedValues),name:this.name})}};x([D({type:[bQ],json:{write:!0}})],xQ.prototype,"codedValues",void 0),x([Wr({codedValue:"coded-value"})],xQ.prototype,"type",void 0),xQ=Fke=x([Qe("esri.layers.support.CodedValueDomain")],xQ);const qMt=xQ;var kke;let kme=kke=class extends B2e{constructor(i){super(i),this.type="inherited"}clone(){return new kke}};x([Wr({inherited:"inherited"})],kme.prototype,"type",void 0),kme=kke=x([Qe("esri.layers.support.InheritedDomain")],kme);const YMt=kme;var Lke;let $G=Lke=class extends B2e{constructor(i){super(i),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new Lke({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};x([D({json:{type:[Number],read:{source:"range",reader:(i,e)=>e.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(i,e,t){e[t]=[this.minValue||0,i]}}}})],$G.prototype,"maxValue",void 0),x([D({json:{type:[Number],read:{source:"range",reader:(i,e)=>e.range?.[0]},write:{target:"range",writer(i,e,t){e[t]=[i,this.maxValue||0]}}}})],$G.prototype,"minValue",void 0),x([Wr({range:"range"})],$G.prototype,"type",void 0),$G=Lke=x([Qe("esri.layers.support.RangeDomain")],$G);const XMt=$G,JMt={key:"type",base:B2e,typeMap:{range:XMt,"coded-value":qMt,inherited:YMt}};function j2e(i){if(!i?.type)return null;switch(i.type){case"range":return XMt.fromJSON(i);case"codedValue":return qMt.fromJSON(i);case"inherited":return YMt.fromJSON(i)}return null}var Nke;let C2=Nke=class extends oB{constructor(i){super(i),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return this._get("editable")??!0}set editable(i){this._set("editable",i)}clone(){return new Nke({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};x([D({types:JMt,json:{read:{reader:j2e},write:!0}})],C2.prototype,"domain",void 0),x([D({type:Boolean,json:{write:!0}})],C2.prototype,"editable",null),x([D({type:String,json:{write:!0}})],C2.prototype,"editableExpression",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"fieldName",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"hint",void 0),x([D({types:mrr,json:{read:{source:"inputType"},write:{target:"inputType"}}})],C2.prototype,"input",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"requiredExpression",void 0),x([D({type:String,json:{read:!1,write:!0}})],C2.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"valueExpression",void 0),C2=Nke=x([Qe("esri.form.elements.FieldElement")],C2);const cst=C2;var $ke;let WM=$ke=class extends oB{constructor(i){super(i),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new $ke({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:li(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};x([D({type:Number,json:{write:!0}})],WM.prototype,"displayCount",void 0),x([D({type:["list"],json:{write:!0}})],WM.prototype,"displayType",void 0),x([D({type:String,json:{write:!0}})],WM.prototype,"editableExpression",void 0),x([D({type:[Yze],json:{write:!0}})],WM.prototype,"orderByFields",void 0),x([D({type:Number,json:{write:!0}})],WM.prototype,"relationshipId",void 0),x([D({type:["relationship"],json:{read:!1,write:!0}})],WM.prototype,"type",void 0),WM=$ke=x([Qe("esri.form.elements.RelationshipElement")],WM);const hst=WM;var Bke;let BG=Bke=class extends oB{constructor(i){super(i),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new Bke({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};x([D({type:String,json:{write:!0}})],BG.prototype,"text",void 0),x([D({type:String,json:{write:!0}})],BG.prototype,"textFormat",void 0),x([D({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],BG.prototype,"type",void 0),BG=Bke=x([Qe("esri.form.elements.TextElement")],BG);const dst=BG;function KMt(i){return{typesWithGroup:{base:oB,key:"type",typeMap:{attachment:sst,field:cst,group:i,relationship:hst,text:dst}},typesWithoutGroup:{base:oB,key:"type",typeMap:{attachment:sst,field:cst,relationship:hst,text:dst}}}}function ZMt(i,e,t=!0){if(!i)return null;const r=t?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function QMt(i,e,t=!0){if(!i)return null;const r=t?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>n.toJSON())}function eOt(i,e,t=!0){return i?i.map(r=>u3(t?e.typesWithGroup:e.typesWithoutGroup,r)):null}var jke;let VI=jke=class extends oB{constructor(i){super(i),this.elements=null,this.initialState="expanded",this.type="group"}castElements(i){return eOt(i,O3e,!1)}readElements(i,e){return ZMt(e.formElements,O3e,!1)}writeElements(i,e){e.formElements=QMt(i,O3e,!1)}clone(){return new jke({description:this.description,elements:li(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};x([D({json:{write:!0}})],VI.prototype,"elements",void 0),x([So("elements")],VI.prototype,"castElements",null),x([Mi("elements",["formElements"])],VI.prototype,"readElements",null),x([ur("elements")],VI.prototype,"writeElements",null),x([D({type:["collapsed","expanded"],json:{write:!0}})],VI.prototype,"initialState",void 0),x([D({type:String,json:{read:!1,write:!0}})],VI.prototype,"type",void 0),VI=jke=x([Qe("esri.form.elements.GroupElement")],VI);const O3e=KMt(VI),yrr=VI;var Gke;const P3e=KMt(yrr);let $T=Gke=class extends Ci{constructor(i){super(i),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(i){return eOt(i,P3e)}readElements(i,e){return ZMt(e.formElements,P3e)}writeElements(i,e){e.formElements=QMt(i,P3e)}clone(){return new Gke({description:this.description,expressionInfos:li(this.expressionInfos),elements:li(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};x([D({type:String,json:{write:!0}})],$T.prototype,"description",void 0),x([D({json:{write:!0}})],$T.prototype,"elements",void 0),x([So("elements")],$T.prototype,"castElements",null),x([Mi("elements",["formElements"])],$T.prototype,"readElements",null),x([ur("elements")],$T.prototype,"writeElements",null),x([D({type:[rrr],json:{write:!0}})],$T.prototype,"expressionInfos",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],$T.prototype,"preserveFieldValuesWhenHidden",void 0),x([D({type:String,json:{write:!0}})],$T.prototype,"title",void 0),$T=Gke=x([Qe("esri.form.FormTemplate")],$T);const tOt=$T;async function vrr(i){const e="portalItem"in i?i:{portalItem:i},{fromItem:t}=await Promise.resolve().then(()=>HNr);try{return await t(e)}catch(r){const n=e&&e.portalItem,s=n?.id||"unset",o=n&&n.portal&&n.portal.url||Ho.portalUrl;throw di.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",r),r}}let _rr=0,Hf=class extends rd.EventedMixin(iT(ef)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new hr(-180,-90,180,90,Xi.WGS84),this.id=Date.now().toString(16)+"-layer-"+_rr++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=Xi.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t=typeof e=="string"?{url:e}:e;return(await Promise.resolve().then(()=>$7r)).fromUrl(t)}static fromPortalItem(e){return vrr(e)}initialize(){this.when().catch(e=>{mo(e)||di.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Yo(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await zi(e,{query:{f:"json"},responseType:"json"})).data;throw new qe("layer:no-attribution-data","Layer does not have attribution data")}};x([D({type:String})],Hf.prototype,"attributionDataUrl",void 0),x([D({type:hr})],Hf.prototype,"fullExtent",void 0),x([D({readOnly:!0})],Hf.prototype,"hasAttributionData",null),x([D({type:String,clonable:!1})],Hf.prototype,"id",void 0),x([D({type:Boolean,nonNullable:!0})],Hf.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"]})],Hf.prototype,"listMode",void 0),x([D({type:Number,range:{min:0,max:1},nonNullable:!0})],Hf.prototype,"opacity",void 0),x([D({clonable:!1})],Hf.prototype,"parent",void 0),x([D({readOnly:!0})],Hf.prototype,"parsedUrl",null),x([D({type:Boolean,readOnly:!0})],Hf.prototype,"persistenceEnabled",void 0),x([D({type:Boolean})],Hf.prototype,"popupEnabled",void 0),x([D({type:Boolean})],Hf.prototype,"attributionVisible",void 0),x([D({type:Xi})],Hf.prototype,"spatialReference",void 0),x([D({type:String})],Hf.prototype,"title",void 0),x([D({readOnly:!0,json:{read:!1}})],Hf.prototype,"type",void 0),x([D()],Hf.prototype,"url",void 0),x([D({type:Boolean,nonNullable:!0})],Hf.prototype,"visible",void 0),Hf=x([Qe("esri.layers.Layer")],Hf);const Il=Hf;let m1e=class{constructor(e=t=>t.values().next().value){this._peeker=e,this._observable=new pY,this._items=new Set}get length(){return Ws(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let e;for(e of this._items);return e}peek(){if(this.length!==0)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return Ws(this._observable),this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const t=this.length;return this._items.forEach(r=>{e(r)||this._items.delete(r)}),t!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){Ws(this._observable),yield*this._items}};const iOt=new FinalizationRegistry(i=>{i.close()});function brr(i,e){iOt.register(i,e,e)}function wrr(i){iOt.unregister(i)}const rOt="worker:port-closed";var iy;(function(i){i[i.HANDSHAKE=0]="HANDSHAKE",i[i.OPEN=1]="OPEN",i[i.OPENED=2]="OPENED",i[i.RESPONSE=3]="RESPONSE",i[i.INVOKE=4]="INVOKE",i[i.ABORT=5]="ABORT",i[i.CLOSE=6]="CLOSE",i[i.OPEN_PORT=7]="OPEN_PORT",i[i.ON=8]="ON"})(iy||(iy={}));let xrr=0;function nOt(){return xrr++}function Srr(i){return i&&typeof i=="object"&&("result"in i||"transferList"in i)}function Lne(i){return i?typeof i=="string"?JSON.stringify({name:"message",message:i}):i.toJSON?JSON.stringify(i):JSON.stringify({name:i.name,message:i.message,details:i.details||{stack:i.stack}}):null}function SVe(i,e,t,r){if(e.type===iy.OPEN_PORT)return void i.postMessage(e,[e.port]);if(e.type!==iy.INVOKE&&e.type!==iy.RESPONSE)return void i.postMessage(e);let n;if(Srr(t)?(n=pst(t.transferList),e.data=t.result):(n=pst(r),e.data=t),n){if(yi("ff")){for(const s of n)if("byteLength"in s&&s.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(e.type){case iy.INVOKE:throw o;case iy.RESPONSE:return void SVe(i,{type:iy.RESPONSE,jobId:e.jobId,error:Lne(o)})}}}i.postMessage(e,n)}else i.postMessage(e)}function Nne(i){if(!i)return null;const e=i.data;return e?typeof e=="string"?JSON.parse(e):e:null}function pst(i){if(!i?.length)return null;if(yi("esri-workers-arraybuffer-transfer"))return i;const e=i.filter(t=>!Trr(t));return e.length?e:null}function Trr(i){return i instanceof ArrayBuffer||i?.constructor?.name==="ArrayBuffer"}async function Crr(i){try{return await i}catch(e){const t=e?.name===rOt;if(!(mo(e)||t))throw e;return}}function sOt(i,e,t){return new Proxy({},{get:(r,n,s)=>(...o)=>{let a,l;const u=o[o.length-1];Err(u)&&(a=u.signal,l=u.transferList,o.pop());const c=i.apply(e?`${e}.${n.toString()}`:n.toString(),o,{transferList:l,signal:a});return t?.ignoreConnectionErrors?Crr(c):c}})}function Err(i){return typeof i=="object"&&!Array.isArray(i)&&i!=null&&("signal"in i||"transferList"in i||Object.keys(i).length===0)}const Irr={statsWorker:()=>Promise.resolve().then(()=>gjr),geometryEngineWorker:()=>Promise.resolve().then(()=>vjr),CSVSourceWorker:()=>Promise.resolve().then(()=>jGr),EdgeProcessingWorker:()=>Promise.resolve().then(()=>vUr),ElevationSamplerWorker:()=>Promise.resolve().then(()=>bzr),FeatureServiceSnappingSourceWorker:()=>Promise.resolve().then(()=>Kzr),GeoJSONSourceWorker:()=>Promise.resolve().then(()=>_Vr),LercWorker:()=>Promise.resolve().then(()=>AVr),MemorySourceWorker:()=>Promise.resolve().then(()=>LVr),PBFDecoderWorker:()=>Promise.resolve().then(()=>qVr),FeaturePipelineWorker:()=>Promise.resolve().then(()=>SQr),PointCloudWorker:()=>Promise.resolve().then(()=>Pen),RasterWorker:()=>Promise.resolve().then(()=>wrn),SceneLayerSnappingSourceWorker:()=>Promise.resolve().then(()=>rnn),SceneLayerWorker:()=>Promise.resolve().then(()=>Snn),WFSSourceWorker:()=>Promise.resolve().then(()=>Znn),WorkerTileHandler:()=>Promise.resolve().then(()=>don),Lyr3DWorker:()=>Promise.resolve().then(()=>yon)},{CLOSE:fst,ABORT:mst,INVOKE:gst,RESPONSE:RJ,OPEN_PORT:yst,ON:Arr}=iy,Mrr=2;let Orr=class{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===iy.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},mR=class jG{static connect(e){const t=new MessageChannel;let r;r=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new jG(t.port1,{channel:t,client:r});return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=n),jG.clients.set(n,r),t.port2}static loadWorker(e){const t=Irr[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new Orr(n=>this._onInvokeMessage(n)),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:fst}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,s=r?.transferList;if(!this._port)return Promise.reject(new qe(rOt,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const o=nOt();return new Promise((a,l)=>{if(xg(n))return this._processWork(),void l(Oc());const u=Qh(n,()=>{const h=this._outJobs.get(o);h&&(this._outJobs.delete(o),this._processWork(),Hc(h.abortHandle),this._post({type:mst,jobId:o}),l(Oc()))}),c={resolve:a,reject:l,abortHandle:u,debugInfo:e};this._outJobs.set(o,c),this._post({type:gst,jobId:o,methodName:e,abortable:n!=null},t,s)})}createInvokeProxy(e,t){return sOt(this,e,t)}on(e,t){const r=new MessageChannel;function n(s){t(s.data)}return this._port.postMessage({type:iy.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),wa(()=>{r.port1.postMessage({type:iy.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)})}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:yst,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=Mrr)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:s}=e;this.apply(t,r,n).then(o=>s.resolve(o)).catch(o=>s.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{Hc(e.abortHandle),e.reject(Oc(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){this._schedule!=null?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const t=Nne(e);if(t)switch(t.type){case RJ:this._onResponseMessage(t);break;case gst:this._invokeQueue.push(t);break;case mst:this._onAbortMessage(t);break;case fst:this._onCloseMessage();break;case yst:this._onOpenPortMessage(t);break;case Arr:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&jG.clients.get(this)===e&&e.destroy(),jG.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:s}=e,o=s?new AbortController:null,a=this._inJobs;let l,u=this._client,c=u[t];try{if(!c&&t&&t.includes(".")){const h=t.split(".");for(let p=0;p{a.has(r)&&(a.delete(r),this._post({type:RJ,jobId:r},h))},h=>{a.has(r)&&(a.delete(r),mo(h)||this._post({type:RJ,jobId:r,error:Lne(h||{message:`Error encountered at method ${t}`})}))})):this._post({type:RJ,jobId:r},l)}_onOpenPortMessage(e){new jG(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,s=>{t.postMessage(s)}),n=BA(e.port,"message",s=>{Nne(s)?.type===iy.CLOSE&&(n.remove(),r.remove(),t.close())})}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const o=s.get(t);s.delete(t),this._processWork(),Hc(o.abortHandle),r?o.reject(qe.fromJSON(JSON.parse(r))):o.resolve(n)}_post(e,t,r){return SVe(this._port,e,t,r)}};mR.kernelInfo={buildDate:sEt,fullVersion:sze,revision:oEt},mR.clients=new Map;let oOt=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new m1e}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,t){return new Promise((r,n)=>{let s=!0;const o=a=>{hn(t.signal),s&&(s=!1,a())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let a=0;a(this._clients[a]=new mR(u,t,this._ongoingJobsQueue),o(r),this._clients[a]),()=>(o(n),null)):(this._clients[a]=new mR(l,t,this._ongoingJobsQueue),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(r))}})}broadcast(e,t,r){const n=new Array(this._clientPromises.length);for(let s=0;sa?.invoke(e,t,r))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(Oc(`Worker closing, aborting job calling '${e.methodName}'`));for(const t of this._clientPromises)t.then(r=>r?.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,wrr(this)}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=ac();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,resolver:n});for(let s=0;sa?.jobAdded())}return n.promise}createInvokeProxy(e){return sOt(this,e)}on(e,t){return Promise.all(this._clientPromises).then(()=>j3(this._clients.map(r=>r.on(e,t))))}openPorts(){return new Promise(e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let n=0;n{s&&(t[n]=s.openPort()),--r==0&&e(t)})})}get test(){return{numClients:this._clients.length}}};const Prr={async request(i,e){const t=i.options,r=t.responseType;t.signal=e?.signal,t.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&ZCt(i.url)?.after?r:"array-buffer";const n=await zi(i.url,t),s={data:n.data,httpStatus:n.httpStatus,ssl:n.ssl};switch(n.requestOptions?.responseType){case"native-request-init":return delete s.data.signal,s;case"blob":s.data=await s.data.arrayBuffer();break;case"json":s.data=new TextEncoder().encode(JSON.stringify(s.data)).buffer;break;case"text":s.data=new TextEncoder().encode(s.data).buffer}return{result:s,transferList:[s.data]}}},Rrr={};function Drr(i){const e={async:i.async,isDebug:i.isDebug,locale:i.locale,baseUrl:i.baseUrl,has:{...i.has},map:{...i.map},packages:i.packages?.concat()||[],paths:{...i.paths}};return i.hasOwnProperty("async")||(e.async=!0),i.hasOwnProperty("isDebug")||(e.isDebug=!1),i.baseUrl||(e.baseUrl=Rrr.baseUrl),e}let Frr=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(t=>{this[t]=(...r)=>e[t](...r)})}},Lme=class{constructor(){this._dispatcher=new Frr,this._workerPostMessage({type:iy.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){z9(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){z9(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const t=Nne(e);if(t&&t.type===iy.OPEN){const{modulePath:r,jobId:n}=t;let s=await mR.loadWorker(r);s||(s=await import(r));const o=mR.connect(s);this._workerPostMessage({type:iy.OPENED,jobId:n,data:o})}}};const Uke=()=>di.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:krr}=iy,Lrr='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let the,ihe;const vst="Failed to create Worker. Fallback to execute module in main thread";async function Nrr(){if(!yi("esri-workers"))return _st(new Lme);if(!the&&!ihe)try{const e=Lrr.split('"{CONFIGURATION}"').join(`'${$rr()}'`);the=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){ihe=e||{}}let i;if(the)try{i=new Worker(the,{name:"esri-worker-"+Brr++})}catch{Uke().warn(vst,ihe),i=new Lme}else Uke().warn(vst,ihe),i=new Lme;return _st(i)}async function _st(i){return new Promise(e=>{function t(n){const s=Nne(n);s&&s.type===krr&&(i.removeEventListener("message",t),i.removeEventListener("error",r),e(i))}function r(n){n.preventDefault(),i.removeEventListener("message",t),i.removeEventListener("error",r),Uke().warn("Failed to create Worker. Fallback to execute module in main thread",n),(i=new Lme).addEventListener("message",t),i.addEventListener("error",r)}i.addEventListener("message",t),i.addEventListener("error",r)})}function $rr(){let i;if(Ho.default!=null){const n={...Ho};delete n.default,i=JSON.parse(JSON.stringify(n))}else i=JSON.parse(JSON.stringify(Ho));i.assetsPath=xf(i.assetsPath),i.defaultAssetsPath=i.defaultAssetsPath?xf(i.defaultAssetsPath):void 0,i.request.interceptors=[],i.log.interceptors=[],i.locale=Am(),i.has={"esri-csp-restrictions":yi("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":yi("esri-2d-update-debug"),"esri-2d-log-updating":yi("esri-2d-log-updating"),"featurelayer-pbf":yi("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":yi("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":yi("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":yi("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":yi("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":yi("featurelayer-query-max-depth"),"featurelayer-query-pausing-enabled":yi("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-enabled":yi("featurelayer-snapshot-enabled"),"esri-atomics":yi("esri-atomics"),"esri-shared-array-buffer":yi("esri-shared-array-buffer"),"esri-tiles-debug":yi("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":yi("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":yi("feature-polyline-generalization-factor"),"host-webworker":1},i.workers.loaderUrl&&(i.workers.loaderUrl=xf(i.workers.loaderUrl)),i.workers.workerPath?i.workers.workerPath=xf(i.workers.workerPath):i.workers.workerPath=xf(Fl("esri/core/workers/RemoteClient.js")),i.workers.useDynamicImport=!1;const e=Ho.workers.loaderConfig,t=Drr({baseUrl:e?.baseUrl,locale:Am(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...e?.has},map:{...e?.map},paths:{...e?.paths},packages:e?.packages||[]});return JSON.stringify({esriConfig:i,loaderConfig:t,kernelInfo:{buildDate:sEt,fullVersion:sze,revision:oEt}})}let Brr=0;const{ABORT:bst,INVOKE:jrr,OPEN:Grr,OPENED:Urr,RESPONSE:DJ}=iy;let zrr=class aOt{static async create(e){const t=await Nrr();return new aOt(t,e)}constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",r=>{r.preventDefault(),di.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=nOt();return new Promise((s,o)=>{const a={resolve:s,reject:o,abortHandle:ZH(r,()=>{this._outJobs.delete(n),this._post({type:bst,jobId:n})})};this._outJobs.set(n,a),this._post({type:Grr,jobId:n,modulePath:e})})}_onMessage(e){const t=Nne(e);if(t)switch(t.type){case Urr:this._onOpenedMessage(t);break;case DJ:this._onResponseMessage(t);break;case bst:this._onAbortMessage(t);break;case jrr:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs,l=Prr[t];let u;try{if(typeof l!="function")throw new TypeError(`${t} is not a function`);u=l.call(null,n,{signal:o?o.signal:null})}catch(c){return void this._post({type:DJ,jobId:r,error:Lne(c)})}qp(u)?(a.set(r,{controller:o,promise:u}),u.then(c=>{a.has(r)&&(a.delete(r),this._post({type:DJ,jobId:r},c))},c=>{a.has(r)&&(a.delete(r),c||(c={message:"Error encountered at method"+t}),mo(c)||this._post({type:DJ,jobId:r,error:Lne(c||{message:`Error encountered at method ${t}`})}))})):this._post({type:DJ,jobId:r},u)}_onOpenedMessage(e){const{jobId:t,data:r}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),Hc(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),Hc(s.abortHandle),r?s.reject(qe.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,t,r){return SVe(this.worker,e,t,r)}};const wst=yi("host-browser")?Math.min(navigator.hardwareConcurrency-1,yi("workers-pool-size")):0;let l8=yi("esri-mobile")?Math.min(wst,3):wst;l8||(l8=yi("safari")&&yi("mac")?7:2);let xst=0;const Nme=[];function Vrr(){lOt()}async function rhe(i,e){const t=new oOt,{registryTarget:r,...n}=e;return await t.open(i,n),r&&brr(r,t),t}async function $R(i,e={}){if(typeof i!="string")throw new qe("workers:undefined-module","modulePath is missing");let t=e.strategy||"distributed";if(yi("host-webworker")&&!yi("esri-workers")&&(t="local"),t==="local"){let r=await mR.loadWorker(i);r||(r=await import(i)),hn(e.signal);const n=e.client||r;return rhe([mR.connect(r)],{...e,client:n})}if(await lOt(),hn(e.signal),t==="dedicated"){const r=xst++%l8;return rhe([await Nme[r].open(i,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,l8);if(rr.open(i,e)),e)}let nhe=null;async function lOt(){if(nhe)return nhe;new AbortController;const i=[];for(let e=0;e(Nme[e]=r,r));i.push(t)}return nhe=Promise.all(i),nhe}function Sst(i,e,t){if(i.hasM==null||i.hasZ)for(const r of e)for(const n of r)n.length>2&&(n[2]*=t)}function uOt(i,e,t){if(!i&&!e||!t)return;const r=WF(t);Tst(i,t,r),Tst(e,t,r)}function Tst(i,e,t){if(i)for(const r of i)Hrr(r.geometry,e,t)}function Hrr(i,e,t){if(!i?.spatialReference||Ya(i.spatialReference,e))return;const r=WF(i.spatialReference)/t;if(r!==1){if("x"in i)i.z!=null&&(i.z*=r);else if("rings"in i)Sst(i,i.rings,r);else if("paths"in i)Sst(i,i.paths,r);else if("points"in i&&(i.hasM==null||i.hasZ))for(const n of i.points)n.length>2&&(n[2]*=r)}}function IY(i,e,t){if(e==null||t==null||t.vcsWkid||Ya(e,t)||HF(e)||HF(t))return null;const r=WF(e)/WF(t);if(r===1)return null;switch(i){case"point":case"esriGeometryPoint":return n=>Wrr(n,r);case"polyline":case"esriGeometryPolyline":return n=>Yrr(n,r);case"polygon":case"esriGeometryPolygon":return n=>qrr(n,r);case"multipoint":case"esriGeometryMultipoint":return n=>Xrr(n,r);case"extent":case"esriGeometryEnvelope":return n=>Jrr(n,r);default:return null}}function Wrr(i,e){i?.z!=null&&(i.z*=e)}function qrr(i,e){if(i)for(const t of i.rings)for(const r of t)r.length>2&&(r[2]*=e)}function Yrr(i,e){if(i)for(const t of i.paths)for(const r of t)r.length>2&&(r[2]*=e)}function Xrr(i,e){if(i)for(const t of i.points)t.length>2&&(t[2]*=e)}function Jrr(i,e){i&&i.zmin!=null&&i.zmax!=null&&(i.zmin*=e,i.zmax*=e)}function g1e(i,e,t){if(!t?.features||!t.hasZ)return;const r=IY(t.geometryType,e,i.outSpatialReference);if(r!=null)for(const n of t.features)r(n.geometry)}const wW=new Rs({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var zke;const Krr=new Rs({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let H0=zke=class extends Ci{constructor(i){super(i),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(i,{description:e}){let t=null;try{t=e?JSON.parse(e):null}catch{}return t?.value??null}readValueType(i,{description:e}){let t=null;try{t=e?JSON.parse(e):null}catch{}return t?Krr.fromJSON(t.fieldValueType):null}clone(){return new zke({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};x([D({type:String,json:{write:!0}})],H0.prototype,"alias",void 0),x([D({type:[String,Number],json:{write:{allowNull:!0}}})],H0.prototype,"defaultValue",void 0),x([D()],H0.prototype,"description",void 0),x([Mi("description")],H0.prototype,"readDescription",null),x([D({types:JMt,json:{read:{reader:j2e},write:!0}})],H0.prototype,"domain",void 0),x([D({type:Boolean,json:{write:!0}})],H0.prototype,"editable",void 0),x([D({type:ms,json:{write:{overridePolicy:i=>({enabled:Number.isFinite(i)})}}})],H0.prototype,"length",void 0),x([D({type:String,json:{write:!0}})],H0.prototype,"name",void 0),x([D({type:Boolean,json:{write:!0}})],H0.prototype,"nullable",void 0),x([Wr(wW)],H0.prototype,"type",void 0),x([D()],H0.prototype,"valueType",void 0),x([Mi("valueType",["description"])],H0.prototype,"readValueType",null),x([D({type:Boolean,json:{read:!1}})],H0.prototype,"visible",void 0),H0=zke=x([Qe("esri.layers.support.Field")],H0);const Fo=H0;var Vke;const Hke=new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let Gg=Vke=class extends Ci{constructor(i){super(i),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(i,e){const t=Xi.fromJSON(e.spatialReference),r=[];for(let n=0;n0)for(let t=0;tMath.round((u-r)/e),o=u=>Math.round((n-u)/t),a=this.features,l=this._getQuantizationFunction(this.geometryType,s,o);for(let u=0,c=a.length;up*s+r,l=p=>n-p*o;let u=null,c=null;if(this.hasZ&&t?.scale?.[2]!=null){const{translate:[,,p],scale:[,,m]}=t;u=v=>v*m+p}if(this.hasM&&t?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,m]}=t;c=v=>v==null?v:v*m+p}const h=this._getHydrationFunction(i,a,l,u,c);for(const{geometry:p}of e)p!=null&&h&&h(p);return this.transform=null,this}_quantizePoints(i,e,t){let r,n;const s=[];for(let o=0,a=i.length;o0){const u=e(l[0]),c=t(l[1]);u===r&&c===n||(s.push([u-r,c-n]),r=u,n=c)}else r=e(l[0]),n=t(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(i,e,t){return i==="point"?r=>(r.x=e(r.x),r.y=t(r.y),r):i==="polyline"||i==="polygon"?r=>{const n=ed(r)?r.rings:r.paths,s=[];for(let o=0,a=n.length;o0?(ed(r)?r.rings=s:r.paths=s,r):null}:i==="multipoint"?r=>{const n=this._quantizePoints(r.points,e,t);return n&&n.length>0?(r.points=n,r):null}:i==="extent"?r=>r:null}_getHydrationFunction(i,e,t,r,n){return i==="point"?s=>{s.x=e(s.x),s.y=t(s.y),r&&(s.z=r(s.z))}:i==="polyline"||i==="polygon"?s=>{const o=ed(s)?s.rings:s.paths;let a,l;for(let u=0,c=o.length;u0?(a+=v[0],l+=v[1]):(a=v[0],l=v[1]),v[0]=e(a),v[1]=t(l)}}if(r&&n)for(let u=0,c=o.length;u{s.xmin=e(s.xmin),s.ymin=t(s.ymin),s.xmax=e(s.xmax),s.ymax=t(s.ymax),r&&s.zmax!=null&&s.zmin!=null&&(s.zmax=r(s.zmax),s.zmin=r(s.zmin)),n&&s.mmax!=null&&s.mmin!=null&&(s.mmax=n(s.mmax),s.mmin=n(s.mmin))}:i==="multipoint"?s=>{const o=s.points;let a,l;for(let u=0,c=o.length;u0?(a+=h[0],l+=h[1]):(a=h[0],l=h[1]),h[0]=e(a),h[1]=t(l)}if(r&&n)for(let u=0,c=o.length;u({enabled:i})}}})],Gg.prototype,"exceededTransferLimit",void 0),x([D({type:[Us],json:{write:!0}})],Gg.prototype,"features",void 0),x([Mi("features")],Gg.prototype,"readFeatures",null),x([D({type:[Fo],json:{write:!0}})],Gg.prototype,"fields",void 0),x([D({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:Hke.read}}})],Gg.prototype,"geometryType",void 0),x([ur("geometryType")],Gg.prototype,"writeGeometryType",null),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Gg.prototype,"hasM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Gg.prototype,"hasZ",void 0),x([D({types:Ff,json:{write:!0}})],Gg.prototype,"queryGeometry",void 0),x([Mi("queryGeometry")],Gg.prototype,"readQueryGeometry",null),x([D({type:Xi,json:{write:!0}})],Gg.prototype,"spatialReference",void 0),x([ur("spatialReference")],Gg.prototype,"writeSpatialReference",null),x([D({json:{write:!0}})],Gg.prototype,"transform",void 0),Gg=Vke=x([Qe("esri.rest.support.FeatureSet")],Gg),Gg.prototype.toJSON.isDefaultToJSON=!0;const du=Gg;let Zrr=0,UO=class extends ef.LoadableMixin(U3(dr)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);g1e(e,this.layer.spatialReference,r);const n=du.fromJSON(r);if(!this._requiresClientGraphicMapping())return n;const s=this.layer.objectIdField;for(const o of n.features){const a=o.attributes[s],l=this._idToClientGraphic.get(a);l&&(o.geometry=l.geometry)}return n.geometryType=this.layer.geometryType,n}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new qe("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return g1e(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:hr.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new qe("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const n=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=c=>"objectId"in c&&c.objectId!=null?c.objectId:"attributes"in c&&c.attributes[t]!=null?c.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const c of e.deleteFeatures){const h=o(c);h!=null&&n.push(h)}const a=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const c of e.updateFeatures)if(s.push(this._serializeFeature(c)),a){const h=o(c);h!=null&&a.set(h,c)}}uOt(r?r.features:null,s,this.layer.spatialReference);const{fullExtent:l,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:s,deletes:n});return this.fullExtent=l,r&&r.finish(u.uidToObjectId),this._updateClientGraphicIds(a,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:n}of e)n==null||n.type!=="mesh"||n.hasExtent||n.loaded||r.push(n.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const n=e.get(r.objectId);n!=null&&this._addIdToClientGraphic(n)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new qe("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let n=null;for(let o=0;o{di.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),v.preventDefault()}));const h={features:c.features,fields:t?.map(v=>v.toJSON()),geometryType:Yve.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||o,objectIdField:n,spatialReference:u?null:r&&r.toJSON(),timeInfo:a?.toJSON()??null,dateFieldsTimeZone:l},p=await this._connection.invoke("load",h,{signal:e});for(const v of p.warnings)di.getLogger(this.layer).warn("#load()",`${v.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:v});p.featureErrors.length&&di.getLogger(this.layer).warn("#load()",`Encountered ${p.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:p.featureErrors});const m=p.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(c.inferredGeometryType)&&(m.geometryType=Yve.toJSON(c.inferredGeometryType)),this.sourceJSON=m,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),c.finish(p.assignedObjectIds)}};x([aze({Type:Us,ensureType:Sd(Us)})],UO.prototype,"itemType",void 0),x([D()],UO.prototype,"type",void 0),x([D({constructOnly:!0})],UO.prototype,"layer",void 0),x([D({readOnly:!0})],UO.prototype,"_workerGeometryType",null),x([D()],UO.prototype,"sourceJSON",void 0),UO=x([Qe("esri.layers.graphics.sources.MemorySource")],UO);function Qrr(i){return"portalItem"in i}const Wx=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):Qrr(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return x([D({type:String})],e.prototype,"apiKey",null),e=x([Qe("esri.layers.mixins.APIKeyMixin")],e),e},cOt={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},hOt=Object.values(cOt),dOt=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${hOt.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),enr=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${hOt.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),tnr=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function pOt(i){return!!dOt.test(i)}function r_(i){if(i==null)return null;const e=Yo(i),t=e?.path.match(dOt)||e?.path.match(enr);if(!t)return null;const[,r,n,s,o]=t,a=n.indexOf("/");return{title:G2e(a!==-1?n.slice(a+1):n),serverType:cOt[s.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:r}}}function fOt(i){const e=Yo(i).path.match(tnr);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function G2e(i){return(i=i.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+i.slice(1)}function TVe(i,e){const t=[];if(i){const r=r_(i);r!=null&&r.title&&t.push(r.title)}if(e){const r=G2e(e);t.push(r)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function Fx(i){if(!i)return!1;const e=".arcgis.com/",t="//services",r="//tiles",n="//features",s=(i=i.toLowerCase()).includes(e),o=i.includes(t)||i.includes(r)||i.includes(n);return s&&o}function xae(i,e){return i&&q9(iEt(i,e))}function mOt(i){let{url:e}=i;if(!e)return{url:e};e=iEt(e,i.logger);const t=Yo(e),r=r_(t.path);let n;if(r!=null)r.sublayer!=null&&i.layer.layerId==null&&(n=r.sublayer),e=r.url.path;else if(i.nonStandardUrlAllowed){const s=fOt(t.path);s!=null&&(e=s.serviceUrl,n=s.sublayerId)}return{url:q9(e),layerId:n}}function gOt(i,e,t,r,n){cR(e,r,"url",n),r.url&&i.layerId!=null&&(r.url=Iu(r.url,t,i.layerId.toString()))}function inr(i){if(!i)return!1;const e=i.toLowerCase(),t=e.includes("/services/"),r=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),s=e.includes("/wmsserver");return t&&(r||n||s)}const Xv=i=>{let e=class extends i{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=r_(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",xae(t,di.getLogger(this)))}};return x([D()],e.prototype,"title",null),x([D({type:String})],e.prototype,"url",null),e=x([Qe("esri.layers.mixins.ArcGISService")],e),e};function U2e(){const i=new Float32Array(16);return i[0]=1,i[5]=1,i[10]=1,i[15]=1,i}function rnr(i){const e=new Float32Array(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e}function nnr(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w){const S=new Float32Array(16);return S[0]=i,S[1]=e,S[2]=t,S[3]=r,S[4]=n,S[5]=s,S[6]=o,S[7]=a,S[8]=l,S[9]=u,S[10]=c,S[11]=h,S[12]=p,S[13]=m,S[14]=v,S[15]=w,S}function snr(i,e){return new Float32Array(i,e,16)}const onr=U2e();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:onr,clone:rnr,create:U2e,createView:snr,fromValues:nnr},Symbol.toStringTag,{value:"Module"}));function anr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function Yk(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i[4]=s,i[5]=o,i[6]=a,i[7]=l,i[8]=u,i[9]=c,i[10]=h,i[11]=p,i[12]=m,i[13]=v,i[14]=w,i[15]=S,i}function Sae(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function BR(i,e){if(i===e){const t=e[1],r=e[2],n=e[3],s=e[6],o=e[7],a=e[11];i[1]=e[4],i[2]=e[8],i[3]=e[12],i[4]=t,i[6]=e[9],i[7]=e[13],i[8]=r,i[9]=s,i[11]=e[14],i[12]=n,i[13]=o,i[14]=a}else i[0]=e[0],i[1]=e[4],i[2]=e[8],i[3]=e[12],i[4]=e[1],i[5]=e[5],i[6]=e[9],i[7]=e[13],i[8]=e[2],i[9]=e[6],i[10]=e[10],i[11]=e[14],i[12]=e[3],i[13]=e[7],i[14]=e[11],i[15]=e[15];return i}function lnr(i,e){return AY(i,e)||Sae(i),i}function AY(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],S=e[14],I=e[15],R=t*a-r*o,L=t*l-n*o,k=t*u-s*o,B=r*l-n*a,$=r*u-s*a,V=n*u-s*l,Y=c*w-h*v,K=c*S-p*v,Q=c*I-m*v,re=h*S-p*w,ne=h*I-m*w,de=p*I-m*S;let pe=R*de-L*ne+k*re+B*Q-$*K+V*Y;return pe?(pe=1/pe,i[0]=(a*de-l*ne+u*re)*pe,i[1]=(n*ne-r*de-s*re)*pe,i[2]=(w*V-S*$+I*B)*pe,i[3]=(p*$-h*V-m*B)*pe,i[4]=(l*Q-o*de-u*K)*pe,i[5]=(t*de-n*Q+s*K)*pe,i[6]=(S*k-v*V-I*L)*pe,i[7]=(c*V-p*k+m*L)*pe,i[8]=(o*ne-a*Q+u*Y)*pe,i[9]=(r*Q-t*ne-s*Y)*pe,i[10]=(v*$-w*k+I*R)*pe,i[11]=(h*k-c*$-m*R)*pe,i[12]=(a*K-o*re-l*Y)*pe,i[13]=(t*re-r*K+n*Y)*pe,i[14]=(w*L-v*B-S*R)*pe,i[15]=(c*B-h*L+p*R)*pe,i):null}function unr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],S=e[14],I=e[15];return i[0]=a*(p*I-m*S)-h*(l*I-u*S)+w*(l*m-u*p),i[1]=-(r*(p*I-m*S)-h*(n*I-s*S)+w*(n*m-s*p)),i[2]=r*(l*I-u*S)-a*(n*I-s*S)+w*(n*u-s*l),i[3]=-(r*(l*m-u*p)-a*(n*m-s*p)+h*(n*u-s*l)),i[4]=-(o*(p*I-m*S)-c*(l*I-u*S)+v*(l*m-u*p)),i[5]=t*(p*I-m*S)-c*(n*I-s*S)+v*(n*m-s*p),i[6]=-(t*(l*I-u*S)-o*(n*I-s*S)+v*(n*u-s*l)),i[7]=t*(l*m-u*p)-o*(n*m-s*p)+c*(n*u-s*l),i[8]=o*(h*I-m*w)-c*(a*I-u*w)+v*(a*m-u*h),i[9]=-(t*(h*I-m*w)-c*(r*I-s*w)+v*(r*m-s*h)),i[10]=t*(a*I-u*w)-o*(r*I-s*w)+v*(r*u-s*a),i[11]=-(t*(a*m-u*h)-o*(r*m-s*h)+c*(r*u-s*a)),i[12]=-(o*(h*S-p*w)-c*(a*S-l*w)+v*(a*p-l*h)),i[13]=t*(h*S-p*w)-c*(r*S-n*w)+v*(r*p-n*h),i[14]=-(t*(a*S-l*w)-o*(r*S-n*w)+v*(r*l-n*a)),i[15]=t*(a*p-l*h)-o*(r*p-n*h)+c*(r*l-n*a),i}function cnr(i){const e=i[0],t=i[1],r=i[2],n=i[3],s=i[4],o=i[5],a=i[6],l=i[7],u=i[8],c=i[9],h=i[10],p=i[11],m=i[12],v=i[13],w=i[14],S=i[15];return(e*o-t*s)*(h*S-p*w)-(e*a-r*s)*(c*S-p*v)+(e*l-n*s)*(c*w-h*v)+(t*a-r*o)*(u*S-p*m)-(t*l-n*o)*(u*w-h*m)+(r*l-n*a)*(u*v-c*m)}function MY(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],m=e[10],v=e[11],w=e[12],S=e[13],I=e[14],R=e[15];let L=t[0],k=t[1],B=t[2],$=t[3];return i[0]=L*r+k*a+B*h+$*w,i[1]=L*n+k*l+B*p+$*S,i[2]=L*s+k*u+B*m+$*I,i[3]=L*o+k*c+B*v+$*R,L=t[4],k=t[5],B=t[6],$=t[7],i[4]=L*r+k*a+B*h+$*w,i[5]=L*n+k*l+B*p+$*S,i[6]=L*s+k*u+B*m+$*I,i[7]=L*o+k*c+B*v+$*R,L=t[8],k=t[9],B=t[10],$=t[11],i[8]=L*r+k*a+B*h+$*w,i[9]=L*n+k*l+B*p+$*S,i[10]=L*s+k*u+B*m+$*I,i[11]=L*o+k*c+B*v+$*R,L=t[12],k=t[13],B=t[14],$=t[15],i[12]=L*r+k*a+B*h+$*w,i[13]=L*n+k*l+B*p+$*S,i[14]=L*s+k*u+B*m+$*I,i[15]=L*o+k*c+B*v+$*R,i}function $ne(i,e,t){const r=t[0],n=t[1],s=t[2];if(e===i)i[12]=e[0]*r+e[4]*n+e[8]*s+e[12],i[13]=e[1]*r+e[5]*n+e[9]*s+e[13],i[14]=e[2]*r+e[6]*n+e[10]*s+e[14],i[15]=e[3]*r+e[7]*n+e[11]*s+e[15];else{const o=e[0],a=e[1],l=e[2],u=e[3],c=e[4],h=e[5],p=e[6],m=e[7],v=e[8],w=e[9],S=e[10],I=e[11];i[0]=o,i[1]=a,i[2]=l,i[3]=u,i[4]=c,i[5]=h,i[6]=p,i[7]=m,i[8]=v,i[9]=w,i[10]=S,i[11]=I,i[12]=o*r+c*n+v*s+e[12],i[13]=a*r+h*n+w*s+e[13],i[14]=l*r+p*n+S*s+e[14],i[15]=u*r+m*n+I*s+e[15]}return i}function OY(i,e,t){const r=t[0],n=t[1],s=t[2];return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3]*r,i[4]=e[4]*n,i[5]=e[5]*n,i[6]=e[6]*n,i[7]=e[7]*n,i[8]=e[8]*s,i[9]=e[9]*s,i[10]=e[10]*s,i[11]=e[11]*s,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function yOt(i,e,t,r){let n,s,o,a,l,u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne=r[0],de=r[1],pe=r[2],H=Math.sqrt(ne*ne+de*de+pe*pe);return H0?(t[0]=2*(a*o+c*r+l*s-u*n)/h,t[1]=2*(l*o+c*n+u*r-a*s)/h,t[2]=2*(u*o+c*s+a*n-l*r)/h):(t[0]=2*(a*o+c*r+l*s-u*n),t[1]=2*(l*o+c*n+u*r-a*s),t[2]=2*(u*o+c*s+a*n-l*r)),bOt(i,e,t),i}const vnr=gr();function EVe(i,e){return i[0]=e[12],i[1]=e[13],i[2]=e[14],i}function IVe(i,e){const t=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],u=e[9],c=e[10];return i[0]=Math.sqrt(t*t+r*r+n*n),i[1]=Math.sqrt(s*s+o*o+a*a),i[2]=Math.sqrt(l*l+u*u+c*c),i}function wOt(i,e){const t=e[0]+e[5]+e[10];let r=0;return t>0?(r=2*Math.sqrt(t+1),i[3]=.25*r,i[0]=(e[6]-e[9])/r,i[1]=(e[8]-e[2])/r,i[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),i[3]=(e[6]-e[9])/r,i[0]=.25*r,i[1]=(e[1]+e[4])/r,i[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),i[3]=(e[8]-e[2])/r,i[0]=(e[1]+e[4])/r,i[1]=.25*r,i[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),i[3]=(e[1]-e[4])/r,i[0]=(e[8]+e[2])/r,i[1]=(e[6]+e[9])/r,i[2]=.25*r),i}function xOt(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3],l=n+n,u=s+s,c=o+o,h=n*l,p=n*u,m=n*c,v=s*u,w=s*c,S=o*c,I=a*l,R=a*u,L=a*c,k=r[0],B=r[1],$=r[2];return i[0]=(1-(v+S))*k,i[1]=(p+L)*k,i[2]=(m-R)*k,i[3]=0,i[4]=(p-L)*B,i[5]=(1-(h+S))*B,i[6]=(w+I)*B,i[7]=0,i[8]=(m+R)*$,i[9]=(w-I)*$,i[10]=(1-(h+v))*$,i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i}function AVe(i,e,t,r,n){const s=e[0],o=e[1],a=e[2],l=e[3],u=s+s,c=o+o,h=a+a,p=s*u,m=s*c,v=s*h,w=o*c,S=o*h,I=a*h,R=l*u,L=l*c,k=l*h,B=r[0],$=r[1],V=r[2],Y=n[0],K=n[1],Q=n[2],re=(1-(w+I))*B,ne=(m+k)*B,de=(v-L)*B,pe=(m-k)*$,H=(1-(p+I))*$,Z=(S+R)*$,ae=(v+L)*V,fe=(S-R)*V,be=(1-(p+w))*V;return i[0]=re,i[1]=ne,i[2]=de,i[3]=0,i[4]=pe,i[5]=H,i[6]=Z,i[7]=0,i[8]=ae,i[9]=fe,i[10]=be,i[11]=0,i[12]=t[0]+Y-(re*Y+pe*K+ae*Q),i[13]=t[1]+K-(ne*Y+H*K+fe*Q),i[14]=t[2]+Q-(de*Y+Z*K+be*Q),i[15]=1,i}function _nr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=t+t,a=r+r,l=n+n,u=t*o,c=r*o,h=r*a,p=n*o,m=n*a,v=n*l,w=s*o,S=s*a,I=s*l;return i[0]=1-h-v,i[1]=c+I,i[2]=p-S,i[3]=0,i[4]=c-I,i[5]=1-u-v,i[6]=m+w,i[7]=0,i[8]=p+S,i[9]=m-w,i[10]=1-u-h,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function bnr(i,e,t,r,n,s,o){const a=1/(t-e),l=1/(n-r),u=1/(s-o);return i[0]=2*s*a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2*s*l,i[6]=0,i[7]=0,i[8]=(t+e)*a,i[9]=(n+r)*l,i[10]=(o+s)*u,i[11]=-1,i[12]=0,i[13]=0,i[14]=o*s*2*u,i[15]=0,i}function wnr(i,e,t,r,n){const s=1/Math.tan(e/2);let o;return i[0]=s/t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,n!=null&&n!==1/0?(o=1/(r-n),i[10]=(n+r)*o,i[14]=2*n*r*o):(i[10]=-1,i[14]=-2*r),i}function xnr(i,e,t,r){const n=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+a),u=2/(n+s);return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=-(o-a)*l*.5,i[9]=(n-s)*u*.5,i[10]=r/(t-r),i[11]=-1,i[12]=0,i[13]=0,i[14]=r*t/(t-r),i[15]=0,i}function Snr(i,e,t,r,n,s,o){const a=1/(e-t),l=1/(r-n),u=1/(s-o);return i[0]=-2*a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*l,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*u,i[11]=0,i[12]=(e+t)*a,i[13]=(n+r)*l,i[14]=(o+s)*u,i[15]=1,i}function Tnr(i,e,t,r){const n=e[0],s=e[1],o=e[2];let a=n-t[0],l=s-t[1],u=o-t[2];const c=c_();if(Math.abs(a)0&&(m=1/Math.sqrt(m),c*=m,h*=m,p*=m);let v=l*p-u*h,w=u*c-a*p,S=a*h-l*c;return m=v*v+w*w+S*S,m>0&&(m=1/Math.sqrt(m),v*=m,w*=m,S*=m),i[0]=v,i[1]=w,i[2]=S,i[3]=0,i[4]=h*S-p*w,i[5]=p*v-c*S,i[6]=c*w-h*v,i[7]=0,i[8]=c,i[9]=h,i[10]=p,i[11]=0,i[12]=n,i[13]=s,i[14]=o,i[15]=1,i}function Enr(i){return"mat4("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+", "+i[4]+", "+i[5]+", "+i[6]+", "+i[7]+", "+i[8]+", "+i[9]+", "+i[10]+", "+i[11]+", "+i[12]+", "+i[13]+", "+i[14]+", "+i[15]+")"}function Inr(i){return Math.sqrt(i[0]**2+i[1]**2+i[2]**2+i[3]**2+i[4]**2+i[5]**2+i[6]**2+i[7]**2+i[8]**2+i[9]**2+i[10]**2+i[11]**2+i[12]**2+i[13]**2+i[14]**2+i[15]**2)}function Anr(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i}function SOt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i}function Mnr(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i}function Onr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i[4]=e[4]+t[4]*r,i[5]=e[5]+t[5]*r,i[6]=e[6]+t[6]*r,i[7]=e[7]+t[7]*r,i[8]=e[8]+t[8]*r,i[9]=e[9]+t[9]*r,i[10]=e[10]+t[10]*r,i[11]=e[11]+t[11]*r,i[12]=e[12]+t[12]*r,i[13]=e[13]+t[13]*r,i[14]=e[14]+t[14]*r,i[15]=e[15]+t[15]*r,i}function TOt(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]&&i[6]===e[6]&&i[7]===e[7]&&i[8]===e[8]&&i[9]===e[9]&&i[10]===e[10]&&i[11]===e[11]&&i[12]===e[12]&&i[13]===e[13]&&i[14]===e[14]&&i[15]===e[15]}function COt(i,e){if(i===e)return!0;const t=i[0],r=i[1],n=i[2],s=i[3],o=i[4],a=i[5],l=i[6],u=i[7],c=i[8],h=i[9],p=i[10],m=i[11],v=i[12],w=i[13],S=i[14],I=i[15],R=e[0],L=e[1],k=e[2],B=e[3],$=e[4],V=e[5],Y=e[6],K=e[7],Q=e[8],re=e[9],ne=e[10],de=e[11],pe=e[12],H=e[13],Z=e[14],ae=e[15],fe=c_();return Math.abs(t-R)<=fe*Math.max(1,Math.abs(t),Math.abs(R))&&Math.abs(r-L)<=fe*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(n-k)<=fe*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-B)<=fe*Math.max(1,Math.abs(s),Math.abs(B))&&Math.abs(o-$)<=fe*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-V)<=fe*Math.max(1,Math.abs(a),Math.abs(V))&&Math.abs(l-Y)<=fe*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(u-K)<=fe*Math.max(1,Math.abs(u),Math.abs(K))&&Math.abs(c-Q)<=fe*Math.max(1,Math.abs(c),Math.abs(Q))&&Math.abs(h-re)<=fe*Math.max(1,Math.abs(h),Math.abs(re))&&Math.abs(p-ne)<=fe*Math.max(1,Math.abs(p),Math.abs(ne))&&Math.abs(m-de)<=fe*Math.max(1,Math.abs(m),Math.abs(de))&&Math.abs(v-pe)<=fe*Math.max(1,Math.abs(v),Math.abs(pe))&&Math.abs(w-H)<=fe*Math.max(1,Math.abs(w),Math.abs(H))&&Math.abs(S-Z)<=fe*Math.max(1,Math.abs(S),Math.abs(Z))&&Math.abs(I-ae)<=fe*Math.max(1,Math.abs(I),Math.abs(ae))}function MVe(i){const e=c_(),t=i[0],r=i[1],n=i[2],s=i[4],o=i[5],a=i[6],l=i[8],u=i[9],c=i[10];return Math.abs(1-(t*t+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+u*u))<=e&&Math.abs(1-(n*n+a*a+c*c))<=e}function OVe(i){return i[0]===1&&i[1]===0&&i[2]===0&&i[4]===0&&i[5]===1&&i[6]===0&&i[8]===0&&i[9]===0&&i[10]===1}const Pnr=MY,Rnr=SOt;Object.freeze(Object.defineProperty({__proto__:null,add:Anr,adjoint:unr,copy:anr,determinant:cnr,equals:COt,exactEquals:TOt,frob:Inr,fromQuat:_nr,fromQuat2:ynr,fromRotation:CVe,fromRotationTranslation:bOt,fromRotationTranslationScale:xOt,fromRotationTranslationScaleOrigin:AVe,fromScaling:fnr,fromTranslation:vOt,fromXRotation:_Ot,fromYRotation:mnr,fromZRotation:gnr,frustum:bnr,getRotation:wOt,getScaling:IVe,getTranslation:EVe,hasIdentityRotation:OVe,identity:Sae,invert:AY,invertOrIdentity:lnr,isOrthoNormal:MVe,lookAt:Tnr,mul:Pnr,multiply:MY,multiplyScalar:Mnr,multiplyScalarAndAdd:Onr,ortho:Snr,perspective:wnr,perspectiveFromFieldOfView:xnr,rotate:yOt,rotateX:hnr,rotateY:dnr,rotateZ:pnr,scale:OY,set:Yk,str:Enr,sub:Rnr,subtract:SOt,targetTo:Cnr,translate:$ne,transpose:BR},Symbol.toStringTag,{value:"Module"}));const Dnr=(i,e)=>{const t=Yk(i,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return BR(t,t)},Fnr=(i,e)=>{const t=Yk(i,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return BR(t,t)},knr=(i,e)=>{const t=1-e,r=Yk(i,.2126+.7874*t,.7152-.7152*t,.0722-.0722*t,0,.2126-.2126*t,.7152+.2848*t,.0722-.0722*t,0,.2126-.2126*t,.7152-.7152*t,.0722+.9278*t,0,0,0,0,1);return BR(r,r)},Lnr=(i,e)=>{const t=Math.sin(e*Math.PI/180),r=Math.cos(e*Math.PI/180),n=Yk(i,.213+.787*r-.213*t,.715-.715*r-.715*t,.072-.072*r+.928*t,0,.213-.213*r+.143*t,.715+.285*r+.14*t,.072-.072*r-.283*t,0,.213-.213*r-.787*t,.715-.715*r+.715*t,.072+.928*r+.072*t,0,0,0,0,1);return BR(n,n)},Nnr=(i,e)=>{const t=1-2*e,r=Yk(i,t,0,0,e,0,t,0,e,0,0,t,e,0,0,0,1);return BR(r,r)},$nr=(i,e)=>{const t=Yk(i,.213+.787*e,.715-.715*e,.072-.072*e,0,.213-.213*e,.715+.285*e,.072-.072*e,0,.213-.213*e,.715-.715*e,.072+.928*e,0,0,0,0,1);return BR(t,t)},Bnr=(i,e)=>{const t=1-e,r=Yk(i,.393+.607*t,.769-.769*t,.189-.189*t,0,.349-.349*t,.686+.314*t,.168-.168*t,0,.272-.272*t,.534-.534*t,.131+.869*t,0,0,0,0,1);return BR(r,r)};let EOt=class IOt{constructor(e,t,r){this.strength=e,this.radius=t,this.threshold=r,this.type="bloom"}interpolate(e,t,r){this.strength=ab(e.strength,t.strength,r),this.radius=ab(e.radius,t.radius,r),this.threshold=ab(e.threshold,t.threshold,r)}clone(){return new IOt(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:Mie(this.radius),strength:this.strength,threshold:this.threshold}}},AOt=class MOt{constructor(e){this.radius=e,this.type="blur"}interpolate(e,t,r){this.radius=Math.round(ab(e.radius,t.radius,r))}clone(){return new MOt(this.radius)}toJSON(){return{type:"blur",radius:Mie(this.radius)}}},Wke=class OOt{constructor(e,t){this.type=e,this.amount=t,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,t,r){this.amount=ab(e.amount,t.amount,r),this._updateMatrix()}clone(){return new OOt(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||U2e();switch(this.type){case"brightness":this._colorMatrix=Dnr(e,this.amount);break;case"contrast":this._colorMatrix=Fnr(e,this.amount);break;case"grayscale":this._colorMatrix=knr(e,this.amount);break;case"invert":this._colorMatrix=Nnr(e,this.amount);break;case"saturate":this._colorMatrix=$nr(e,this.amount);break;case"sepia":this._colorMatrix=Bnr(e,this.amount)}}},POt=class ROt{constructor(e,t,r,n){this.offsetX=e,this.offsetY=t,this.blurRadius=r,this.color=n,this.type="drop-shadow"}interpolate(e,t,r){this.offsetX=ab(e.offsetX,t.offsetX,r),this.offsetY=ab(e.offsetY,t.offsetY,r),this.blurRadius=ab(e.blurRadius,t.blurRadius,r),this.color[0]=Math.round(ab(e.color[0],t.color[0],r)),this.color[1]=Math.round(ab(e.color[1],t.color[1],r)),this.color[2]=Math.round(ab(e.color[2],t.color[2],r)),this.color[3]=ab(e.color[3],t.color[3],r)}clone(){return new ROt(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:Mie(this.offsetX),yoffset:Mie(this.offsetY),blurRadius:Mie(this.blurRadius),color:e}}},DOt=class FOt{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,t,r){this.angle=ab(e.angle,t.angle,r),this._updateMatrix()}clone(){return new FOt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||U2e();this._colorMatrix=Lnr(e,this.angle)}},kOt=class LOt{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,t,r){this.amount=ab(e.amount,t.amount,r)}clone(){return new LOt(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function ab(i,e,t){return i+(e-i)*t}function Mie(i){return Math.round(1e3*uy(i))/1e3}function jnr(i){switch(i.type){case"grayscale":case"sepia":case"invert":return new Wke(i.type,0);case"saturate":case"brightness":case"contrast":return new Wke(i.type,1);case"opacity":return new kOt(1);case"hue-rotate":return new DOt(0);case"blur":return new AOt(0);case"drop-shadow":return new POt(0,0,0,[...Eze("transparent")]);case"bloom":return new EOt(0,0,1)}}var wS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function NOt(i,e){const t=i.length>e.length?i:e;return(i.length>e.length?e:i).every((r,n)=>r.type===t[n].type)}function $Ot(i,e){const t=i.length>e.length?i:e,r=i.length>e.length?e:i;for(let n=r.length;ns?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function r(n,s){var o,a={},l=(s=s!==void 0?s:{}).grammarSource,u={start:Dt},c=Dt,h="none",p=")",m=",",v="(",w="%",S="px",I="cm",R="mm",L="in",k="pt",B="pc",$="deg",V="rad",Y="grad",K="turn",Q="#",re=".",ne="e",de=/^[ \t\n\r]/,pe=/^[a-z\-]/,H=/^[0-9a-fA-F]/,Z=/^[+\-]/,ae=/^[0-9]/,fe=ar("none"),be=Ui("none",!1),_e=Ui(")",!1),Ie=Ui(",",!1),Te=ar("whitespace"),Be=Bi([" "," ",` -`,"\r"],!1,!1),Ve=ar("function"),$e=Ui("(",!1),tt=ar("identifier"),yt=Bi([["a","z"],"-"],!1,!1),Ct=ar("percentage"),ot=Ui("%",!1),vt=ar("length"),At=Ui("px",!1),Je=Ui("cm",!1),it=Ui("mm",!1),Ue=Ui("in",!1),ct=Ui("pt",!1),st=Ui("pc",!1),Ze=ar("angle"),ye=Ui("deg",!1),Ke=Ui("rad",!1),ke=Ui("grad",!1),me=Ui("turn",!1),ie=ar("number"),ge=ar("color"),je=Ui("#",!1),rt=Bi([["0","9"],["a","f"],["A","F"]],!1,!1),Me=Bi(["+","-"],!1,!1),ht=Bi([["0","9"]],!1,!1),Ht=Ui(".",!1),_t=Ui("e",!1),Fe=function(){return[]},Yt=function(gi,lr){return{type:"function",name:gi,parameters:lr||[]}},A=function(gi,lr){return lr.length>0?la(gi,lr,3):[gi]},ue=function(gi){return{type:"quantity",value:gi.value,unit:gi.unit}},G=function(gi){return{type:"color",colorType:gi.type,value:gi.value}},E=function(gi){return gi},_=function(){return Ri()},g=function(gi){return{value:gi,unit:"%"}},b=function(gi){return{value:gi,unit:"px"}},C=function(gi){return{value:gi,unit:"cm"}},O=function(gi){return{value:gi,unit:"mm"}},F=function(gi){return{value:gi,unit:"in"}},N=function(gi){return{value:gi,unit:"pt"}},j=function(gi){return{value:gi,unit:"pc"}},W=function(gi){return{value:gi,unit:"deg"}},q=function(gi){return{value:gi,unit:"rad"}},J=function(gi){return{value:gi,unit:"grad"}},ee=function(gi){return{value:gi,unit:"turn"}},he=function(gi){return{value:gi,unit:null}},Ee=function(){return{type:"hex",value:Ri()}},De=function(gi){return{type:"function",value:gi}},pt=function(){return{type:"named",value:Ri()}},Et=function(){return parseFloat(Ri())},Ye=0,jt=0,ei=[{line:1,column:1}],Xt=0,wi=[],pi=0;if("startRule"in s){if(!(s.startRule in u))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');c=u[s.startRule]}function Ri(){return n.substring(jt,Ye)}function Ui(gi,lr){return{type:"literal",text:gi,ignoreCase:lr}}function Bi(gi,lr,Rr){return{type:"class",parts:gi,inverted:lr,ignoreCase:Rr}}function mi(){return{type:"end"}}function ar(gi){return{type:"other",description:gi}}function z(gi){var lr,Rr=ei[gi];if(Rr)return Rr;for(lr=gi-1;!ei[lr];)lr--;for(Rr={line:(Rr=ei[lr]).line,column:Rr.column};lrXt&&(Xt=Ye,wi=[]),wi.push(gi))}function ds(gi,lr,Rr){return new e(e.buildMessage(gi,lr),gi,lr,Rr)}function Dt(){var gi;return(gi=Mn())===a&&(gi=yn()),gi}function Mn(){var gi,lr;return pi++,gi=Ye,Tn(),n.substr(Ye,4)===h?(lr=h,Ye+=4):(lr=a,pi===0&&Fr(be)),lr!==a?(Tn(),jt=gi,gi=Fe()):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(fe),gi}function yn(){var gi,lr;if(gi=[],(lr=Pt())!==a)for(;lr!==a;)gi.push(lr),lr=Pt();else gi=a;return gi}function Pt(){var gi,lr,Rr,Os;return gi=Ye,Tn(),(lr=bs())!==a?(Tn(),(Rr=Un())===a&&(Rr=null),Tn(),n.charCodeAt(Ye)===41?(Os=p,Ye++):(Os=a,pi===0&&Fr(_e)),Os!==a?(Tn(),jt=gi,gi=Yt(lr,Rr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi}function Un(){var gi,lr,Rr,Os,Js,vs,na,gl;if(gi=Ye,(lr=Qi())!==a){for(Rr=[],Os=Ye,Js=Tn(),n.charCodeAt(Ye)===44?(vs=m,Ye++):(vs=a,pi===0&&Fr(Ie)),vs===a&&(vs=null),na=Tn(),(gl=Qi())!==a?Os=Js=[Js,vs,na,gl]:(Ye=Os,Os=a);Os!==a;)Rr.push(Os),Os=Ye,Js=Tn(),n.charCodeAt(Ye)===44?(vs=m,Ye++):(vs=a,pi===0&&Fr(Ie)),vs===a&&(vs=null),na=Tn(),(gl=Qi())!==a?Os=Js=[Js,vs,na,gl]:(Ye=Os,Os=a);jt=gi,gi=A(lr,Rr)}else Ye=gi,gi=a;return gi}function Qi(){var gi,lr;return gi=Ye,(lr=ko())===a&&(lr=ai())===a&&(lr=Al())===a&&(lr=eu()),lr!==a&&(jt=gi,lr=ue(lr)),(gi=lr)===a&&(gi=Ye,(lr=Ma())!==a&&(jt=gi,lr=G(lr)),gi=lr),gi}function Tn(){var gi,lr;for(pi++,gi=[],de.test(n.charAt(Ye))?(lr=n.charAt(Ye),Ye++):(lr=a,pi===0&&Fr(Be));lr!==a;)gi.push(lr),de.test(n.charAt(Ye))?(lr=n.charAt(Ye),Ye++):(lr=a,pi===0&&Fr(Be));return pi--,lr=a,pi===0&&Fr(Te),gi}function bs(){var gi,lr,Rr;return pi++,gi=Ye,(lr=qn())!==a?(n.charCodeAt(Ye)===40?(Rr=v,Ye++):(Rr=a,pi===0&&Fr($e)),Rr!==a?(jt=gi,gi=E(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),pi--,gi===a&&(lr=a,pi===0&&Fr(Ve)),gi}function qn(){var gi,lr,Rr;if(pi++,gi=Ye,lr=[],pe.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(yt)),Rr!==a)for(;Rr!==a;)lr.push(Rr),pe.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(yt));else lr=a;return lr!==a&&(jt=gi,lr=_()),pi--,(gi=lr)===a&&(lr=a,pi===0&&Fr(tt)),gi}function ko(){var gi,lr,Rr;return pi++,gi=Ye,Tn(),(lr=_n())!==a?(n.charCodeAt(Ye)===37?(Rr=w,Ye++):(Rr=a,pi===0&&Fr(ot)),Rr!==a?(jt=gi,gi=g(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(Ct),gi}function ai(){var gi,lr,Rr;return pi++,gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===S?(Rr=S,Ye+=2):(Rr=a,pi===0&&Fr(At)),Rr!==a?(jt=gi,gi=b(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===I?(Rr=I,Ye+=2):(Rr=a,pi===0&&Fr(Je)),Rr!==a?(jt=gi,gi=C(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===R?(Rr=R,Ye+=2):(Rr=a,pi===0&&Fr(it)),Rr!==a?(jt=gi,gi=O(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===L?(Rr=L,Ye+=2):(Rr=a,pi===0&&Fr(Ue)),Rr!==a?(jt=gi,gi=F(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===k?(Rr=k,Ye+=2):(Rr=a,pi===0&&Fr(ct)),Rr!==a?(jt=gi,gi=N(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Tn(),(lr=_n())!==a?(n.substr(Ye,2)===B?(Rr=B,Ye+=2):(Rr=a,pi===0&&Fr(st)),Rr!==a?(jt=gi,gi=j(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a)))))),pi--,gi===a&&pi===0&&Fr(vt),gi}function Al(){var gi,lr,Rr;return pi++,gi=Ye,(lr=_n())!==a?(n.substr(Ye,3)===$?(Rr=$,Ye+=3):(Rr=a,pi===0&&Fr(ye)),Rr!==a?(jt=gi,gi=W(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,3)===V?(Rr=V,Ye+=3):(Rr=a,pi===0&&Fr(Ke)),Rr!==a?(jt=gi,gi=q(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,4)===Y?(Rr=Y,Ye+=4):(Rr=a,pi===0&&Fr(ke)),Rr!==a?(jt=gi,gi=J(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,4)===K?(Rr=K,Ye+=4):(Rr=a,pi===0&&Fr(me)),Rr!==a?(jt=gi,gi=ee(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a)))),pi--,gi===a&&(lr=a,pi===0&&Fr(Ze)),gi}function eu(){var gi,lr;return pi++,gi=Ye,Tn(),(lr=_n())!==a?(jt=gi,gi=he(lr)):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(ie),gi}function Ma(){var gi,lr,Rr,Os;if(pi++,gi=Ye,n.charCodeAt(Ye)===35?(lr=Q,Ye++):(lr=a,pi===0&&Fr(je)),lr!==a){if(Rr=[],H.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(rt)),Os!==a)for(;Os!==a;)Rr.push(Os),H.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(rt));else Rr=a;Rr!==a?(jt=gi,gi=Ee()):(Ye=gi,gi=a)}else Ye=gi,gi=a;return gi===a&&(gi=Ye,(lr=Pt())!==a&&(jt=gi,lr=De(lr)),(gi=lr)===a&&(gi=Ye,(lr=qn())!==a&&(jt=gi,lr=pt()),gi=lr)),pi--,gi===a&&(lr=a,pi===0&&Fr(ge)),gi}function _n(){var gi,lr,Rr,Os,Js,vs,na;for(gi=Ye,Z.test(n.charAt(Ye))?(n.charAt(Ye),Ye++):pi===0&&Fr(Me),lr=Ye,Rr=[],ae.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(ht));Os!==a;)Rr.push(Os),ae.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(ht));if(n.charCodeAt(Ye)===46?(Os=re,Ye++):(Os=a,pi===0&&Fr(Ht)),Os!==a){if(Js=[],ae.test(n.charAt(Ye))?(vs=n.charAt(Ye),Ye++):(vs=a,pi===0&&Fr(ht)),vs!==a)for(;vs!==a;)Js.push(vs),ae.test(n.charAt(Ye))?(vs=n.charAt(Ye),Ye++):(vs=a,pi===0&&Fr(ht));else Js=a;Js!==a?lr=Rr=[Rr,Os,Js]:(Ye=lr,lr=a)}else Ye=lr,lr=a;if(lr===a)if(lr=[],ae.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(ht)),Rr!==a)for(;Rr!==a;)lr.push(Rr),ae.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(ht));else lr=a;if(lr!==a){if(Rr=Ye,n.charCodeAt(Ye)===101?(Os=ne,Ye++):(Os=a,pi===0&&Fr(_t)),Os!==a){if(Z.test(n.charAt(Ye))?(Js=n.charAt(Ye),Ye++):(Js=a,pi===0&&Fr(Me)),Js===a&&(Js=null),vs=[],ae.test(n.charAt(Ye))?(na=n.charAt(Ye),Ye++):(na=a,pi===0&&Fr(ht)),na!==a)for(;na!==a;)vs.push(na),ae.test(n.charAt(Ye))?(na=n.charAt(Ye),Ye++):(na=a,pi===0&&Fr(ht));else vs=a;vs!==a?Rr=Os=[Os,Js,vs]:(Ye=Rr,Rr=a)}else Ye=Rr,Rr=a;Rr===a&&(Rr=null),jt=gi,gi=Et()}else Ye=gi,gi=a;return gi}function Ss(gi,lr){return gi.map(function(Rr){return Rr[lr]})}function la(gi,lr,Rr){return[gi].concat(Ss(lr,Rr))}if((o=c())!==a&&Ye===n.length)return o;throw o!==a&&Yei*i,fD=i=>i*i*i,Tne={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:BE(.001)},"square-centimeters":{inBaseUnits:BE(.01)},"square-decimeters":{inBaseUnits:BE(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:BE(1e3)},"square-inches":{inBaseUnits:BE(.0254)},"square-feet":{inBaseUnits:BE(.3048)},"square-yards":{inBaseUnits:BE(.9144)},"square-miles":{inBaseUnits:BE(1609.344)},"square-us-feet":{inBaseUnits:BE(1200/3937)},acres:{inBaseUnits:.0015625*BE(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*fD(.001)},"cubic-centimeters":{inBaseUnits:1e3*fD(.01)},"cubic-decimeters":{inBaseUnits:1e3*fD(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*fD(1e3)},"cubic-inches":{inBaseUnits:1e3*fD(.0254)},"cubic-feet":{inBaseUnits:1e3*fD(.3048)},"cubic-yards":{inBaseUnits:1e3*fD(.9144)},"cubic-miles":{inBaseUnits:1e3*fD(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},Lqi=(()=>{const i={};for(const e in Tne)for(const t in Tne[e].units)i[t]=e;return i})();function Nqi(i,e,t){return i*Tne[t].units[e].inBaseUnits}function $qi(i,e,t){return i/Tne[t].units[e].inBaseUnits}function iW(i){const e=Lqi[i];if(!e)throw new Error("unknown type");return e}function grt(i,e=null){return e=e||iW(i),Tne[e].baseUnit===i}function tb(i,e,t){if(e===t)return i;const r=iW(e);if(r!==iW(t))throw new Error("incompatible units");const n=grt(e,r)?i:Nqi(i,e,r);return grt(t,r)?n:$qi(n,t,r)}function Bqi(i,e,t){return tb(i,e,"meters")/(t*Math.PI/180)}function TEt(i){return kqi.fromJSON(i.toLowerCase())||null}function WF(i){if(i!=null&&!Eqi(i))return 1;const e=pu(i);return e>1e5?1:e}function jqi(i){return pu(i)>=wEt(i).metersPerDegree?"meters":gze(i)}function pu(i,e=Td.metersPerDegree){return Gqi(i,!0)??e}function Gqi(i,e=!1){const t=i?.wkid??null,r=i?.wkt2??i?.wkt??null;let n=null;if(t){if(eW(t))return GA.metersPerDegree;if(tW(t))return VF.metersPerDegree;n=H8.values[H8[t]],!n&&e&&Fqi.has(t)&&(n=Dqi)}else r&&(IEt(r)?n=yrt(xEt.exec(r),n):EEt(r)&&(n=yrt(SEt.exec(r),n)));return n}function Bve(i){return iae(i)?1:pu(i)}function yrt(i,e){return i?.[1]?CEt(i[1]):e}function CEt(i){return parseFloat(i.split(",")[1])}function gze(i){const e=i?.wkid??null,t=i?.wkt2??i?.wkt??null;let r=null;if(e)r=H8.units[H8[e]];else if(t){const n=IEt(t)?xEt:EEt(t)?SEt:null;if(n){const s=n.exec(t);s?.[1]&&(r=zqi(s[1]))}}return r!=null?TEt(r):null}function EEt(i){return/^GEOCCS/i.test(i)}function IEt(i){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(i)}const Uqi=1e-7;function zqi(i){let t=/[\\"']{1}([^\\"']+)/.exec(i)?.[1];if(!t||!H8.units.includes(t)){const r=CEt(i);t=null;const n=H8.values;for(let s=0;s{const a=s.constructor.prototype;r.forEach(l=>{const u=qUe(s,l,n);u.read&&typeof u.read=="object"||(u.read={}),u.read.reader=a[o],t&&(u.read.source=(u.read.source||[]).concat(t))})}}let aI=class extends Ci{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=Xi.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,t){if(e instanceof Xi)return e;if(e!=null){const r=new Xi;return r.read(e,t),r}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,t){this.cache[e]=t}};x([D()],aI.prototype,"type",void 0),x([D({readOnly:!0})],aI.prototype,"cache",null),x([D({readOnly:!0})],aI.prototype,"extent",null),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],aI.prototype,"hasM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],aI.prototype,"hasZ",void 0),x([D({type:Xi,json:{write:!0},value:Xi.WGS84})],aI.prototype,"spatialReference",void 0),x([Mi("spatialReference")],aI.prototype,"readSpatialReference",null),aI=x([Qe("esri.geometry.Geometry")],aI);const Nr=aI,qqi=Object.prototype.toString;function Yqi(i){const e="__accessorMetadata__"in i?Sd(i):i;return function(...t){if(t.push(e),typeof t[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return Xqi.apply(this,t)}}function Xqi(i,e,t,r){Koe(i,e).cast=r}function Jqi(i){return(e,t)=>{Koe(e,i).cast=e[t]}}function So(...i){if(i.length!==3||typeof i[1]!="string")return i.length===1&&qqi.call(i[0])==="[object Function]"?Yqi(i[0]):i.length===1&&typeof i[0]=="string"?Jqi(i[0]):void 0}function Kqi(i,e){const t=i.x-e.x,r=i.y-e.y,n=i.hasZ&&e.hasZ?i.z-e.z:0;return Math.sqrt(t*t+r*r+n*n)}const Zqi=57.29577951308232,Qqi=.017453292519943;function vrt(i){return i*Zqi}function _rt(i){return i*Qqi}function eYi(i){return Math.PI/2-2*Math.atan(Math.exp(-i/Td.radius))}function h5e(i){return i.wkid!=null||i.wkt!=null}const QAe=[0,0];function Gve(i,e,t,r,n){const s=i,o=n;if(o.spatialReference=t,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,QAe,r);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,QAe,r),[o.xmax,o.ymax]=e(s.xmax,s.ymax,QAe,r);else if("paths"in s&&"paths"in o||"rings"in s&&"rings"in o){const a="paths"in s?s.paths:s.rings,l=[];let u;for(let c=0;c2&&u[p].push(h[p][2]),h[p].length>3&&u[p].push(h[p][3])}"paths"in o?o.paths=l:o.rings=l}else if("points"in s&&"points"in o){const a=s.points,l=[];for(let u=0;u2&&l[u].push(a[u][2]),a[u].length>3&&l[u].push(a[u][3]);o.points=l}return n}function RV(i,e){const t=i&&(h5e(i)?i:i.spatialReference),r=e&&(h5e(e)?e:e.spatialReference);return!(i&&"type"in i&&i.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!t||!r)&&(!!Ya(r,t)||Nb(r)&&fE(t)||Nb(t)&&fE(r))}function HB(i,e){if(i==null)return null;const t=i.spatialReference,r=e&&(h5e(e)?e:e.spatialReference);return RV(t,r)?Ya(t,r)?li(i):Nb(r)?Gve(i,Z5,Xi.WebMercator,!1,li(i)):fE(r)?Gve(i,DV,Xi.WGS84,!1,li(i)):null:null}function Z5(i,e,t=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const r=_rt(e);return t[0]=_rt(i)*Td.radius,t[1]=Td.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),t}function DV(i,e,t=[0,0],r=!1){const n=vrt(i/Td.radius);return t[0]=r?n:n-360*Math.floor((n+180)/360),t[1]=vrt(Math.PI/2-2*Math.atan(Math.exp(-e/Td.radius))),t}function WC(i,e=!1,t=li(i)){return Gve(i,Z5,Xi.WebMercator,e,t)}function r8(i,e=!1,t=li(i)){return Gve(i,DV,Xi.WGS84,e,t)}var qfe;const xJ=[0,0];function brt(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}let a1=qfe=class extends Nr{static copy(i,e){e._set("x",i._get("x")),e._set("y",i._get("y")),e._set("z",i._get("z")),e._set("m",i._get("m"));const t=i._get("spatialReference");e._set("spatialReference",Object.isFrozen(t)?t:t.clone())}constructor(...i){super(...i),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(i,e,t,r,n){let s;if(Array.isArray(i))s=i,n=e,i=s[0],e=s[1],t=s[2],r=s[3];else if(i&&typeof i=="object"){if(s=i,i=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,t=s.z,r=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new Xi(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)di.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)di.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const a=Z5(s.longitude,s.latitude,xJ);i=a[0],e=a[1]}}}else brt(t)?(n=t,t=null):brt(r)&&(n=r,r=null);const o={x:i,y:e};return o.x==null&&o.y!=null?di.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&di.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),t!=null&&(o.z=t),r!=null&&(o.m=r),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(i){i!==(this._get("m")!==void 0)&&(this._set("m",i?0:void 0),this._set("hasM",i))}get hasZ(){return this.z!==void 0}set hasZ(i){i!==(this._get("z")!==void 0)&&(this._set("z",i?0:void 0),this._set("hasZ",i))}get latitude(){const{spatialReference:i,x:e,y:t}=this;if(i){if(i.isWebMercator)return DV(e,t,xJ)[1];if(i.isGeographic)return t}return null}set latitude(i){const{spatialReference:e,x:t}=this;i!=null&&e&&(e.isWebMercator?this._set("y",Z5(t,i,xJ)[1]):e.isGeographic&&this._set("y",i),this._set("latitude",i))}get longitude(){const{x:i,y:e,spatialReference:t}=this;if(t){if(t.isWebMercator)return DV(i,e,xJ)[0];if(t.isGeographic)return i}return null}set longitude(i){const{y:e,spatialReference:t}=this;i!=null&&t&&(t.isWebMercator?this._set("x",Z5(i,e,xJ)[0]):t.isGeographic&&this._set("x",i),this._set("longitude",i))}writeX(i,e,t){e[t]=isNaN(i)?"NaN":i}readX(i){return typeof i=="string"?NaN:i}clone(){const i=new qfe;return i.x=this.x,i.y=this.y,i.z=this.z,i.m=this.m,i.spatialReference=this.spatialReference,i}copy(i){return qfe.copy(i,this),this}equals(i){if(i==null)return!1;const{x:e,y:t,z:r,m:n,spatialReference:s}=this,{z:o,m:a}=i;let{x:l,y:u,spatialReference:c}=i;if(!s.equals(c))if(s.isWebMercator&&c.isWGS84)[l,u]=Z5(l,u),c=s;else{if(!s.isWGS84||!c.isWebMercator)return!1;[l,u]=DV(l,u),c=s}return e===l&&t===u&&r===o&&n===a&&s.wkid===c.wkid}offset(i,e,t){return this.x+=i,this.y+=e,t!=null&&(this.z=(this.z??0)+t),this}normalize(){if(!this.spatialReference)return this;const i=Zp(this.spatialReference);if(!i)return this;let e=this.x;const[t,r]=i.valid,n=2*r;let s;return e>r?(s=Math.ceil(Math.abs(e-r)/n),e-=s*n):eisNaN(i)?i:Gd(i))],a1.prototype,"x",void 0),x([ur("x")],a1.prototype,"writeX",null),x([Mi("x")],a1.prototype,"readX",null),x([D({type:Number,json:{write:!0}})],a1.prototype,"y",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],a1.prototype,"z",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],a1.prototype,"m",void 0),a1=qfe=x([Qe("esri.geometry.Point")],a1),a1.prototype.toJSON.isDefaultToJSON=!0;const $i=a1,e3e=[0,0];function rae(i,e){return e!=null&&M1(i,e.x,e.y,e.z)}function tYi(i,e){if(!e.points||e.points.length)return!1;for(const t of e.points)if(!rW(i,t))return!1;return!0}function iYi(i,e){const{xmin:t,ymin:r,zmin:n,xmax:s,ymax:o,zmax:a}=e;return i.hasZ&&e.hasZ?M1(i,t,r,n)&&M1(i,t,o,n)&&M1(i,s,o,n)&&M1(i,s,r,n)&&M1(i,t,r,a)&&M1(i,t,o,a)&&M1(i,s,o,a)&&M1(i,s,r,a):M1(i,t,r)&&M1(i,t,o)&&M1(i,s,o)&&M1(i,s,r)}function rW(i,e){return M1(i,e[0],e[1])}function rYi(i,e){return M1(i,e[0],e[1],e[2])}function M1(i,e,t,r){return e>=i.xmin&&e<=i.xmax&&t>=i.ymin&&t<=i.ymax&&(r==null||!i.hasZ||r>=i.zmin&&r<=i.zmax)}function AEt(i,e){return e3e[1]=e.y,e3e[0]=e.x,nYi(i,e3e)}function nYi(i,e){return yze(i.rings,e)}function yze(i,e){if(!i)return!1;if(sYi(i))return wrt(!1,i,e);let t=!1;for(let r=0,n=i.length;r=n||p=n)&&u+(n-c)/(p-c)*(h-u)=0&&k<=1&&B>=0&&B<=1&&(n&&(n[0]=s+k*(a-s),n[1]=o+k*(l-o)),!0)}function REt(i){switch(i){case"esriGeometryEnvelope":case"extent":return MEt;case"esriGeometryMultipoint":case"multipoint":return aYi;case"esriGeometryPoint":case"point":return oYi;case"esriGeometryPolygon":case"polygon":return vze;case"esriGeometryPolyline":case"polyline":return cYi}}var w2;function dYi(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}function mD(i,e,t){return e==null?t:t==null?e:i(e,t)}let Um=w2=class extends Nr{constructor(...i){super(...i),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(i,e,t,r,n){return dYi(i)?{spatialReference:i,xmin:0,ymin:0,xmax:0,ymax:0}:typeof i=="object"?(i.spatialReference=i.spatialReference==null?Xi.WGS84:i.spatialReference,i):{xmin:i,ymin:e,xmax:t,ymax:r,spatialReference:n??Xi.WGS84}}static fromBounds(i,e){return new w2({xmin:i[0],ymin:i[1],xmax:i[2],ymax:i[3],spatialReference:e})}static fromPoint(i){return new w2({xmin:i.x,ymin:i.y,zmin:i.z,xmax:i.x,ymax:i.y,zmax:i.z,spatialReference:i.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const i=new $i({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(i.z=.5*(this.zmin+this.zmax)),this.hasM&&(i.m=.5*(this.mmin+this.mmax)),i}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(i){const e=this.center;return i.z!=null&&this.hasZ?this.offset(i.x-e.x,i.y-e.y,i.z-e.z):this.offset(i.x-e.x,i.y-e.y)}clone(){const i=new w2;return i.xmin=this.xmin,i.ymin=this.ymin,i.xmax=this.xmax,i.ymax=this.ymax,i.spatialReference=this.spatialReference,this.zmin!=null&&(i.zmin=this.zmin,i.zmax=this.zmax),this.mmin!=null&&(i.mmin=this.mmin,i.mmax=this.mmax),i}contains(i){if(!i)return!1;const e=this.spatialReference,t=i.spatialReference;return e&&t&&!e.equals(t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),i.type==="point"?rae(this,i):i.type==="extent"&&iYi(this,i)}equals(i){if(this===i)return!0;if(i==null)return!1;const e=this.spatialReference,t=i.spatialReference;return e&&t&&!e.equals(t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),this.xmin===i.xmin&&this.ymin===i.ymin&&this.zmin===i.zmin&&this.mmin===i.mmin&&this.xmax===i.xmax&&this.ymax===i.ymax&&this.zmax===i.zmax&&this.mmax===i.mmax}expand(i){const e=.5*(1-i),t=this.width*e,r=this.height*e;if(this.xmin+=t,this.ymin+=r,this.xmax-=t,this.ymax-=r,this.hasZ){const n=(this.zmax-this.zmin)*e;this.zmin+=n,this.zmax-=n}if(this.hasM){const n=(this.mmax-this.mmin)*e;this.mmin+=n,this.mmax-=n}return this}intersects(i){if(i==null)return!1;i.type==="mesh"&&(i=i.extent);const e=this.spatialReference,t=i.spatialReference;return e&&t&&!Ya(e,t)&&RV(e,t)&&(i=e.isWebMercator?WC(i):r8(i,!0)),REt(i.type)(this,i)}normalize(){const i=this._normalize(!1,!0);return Array.isArray(i)?i:[i]}offset(i,e,t){return this.xmin+=i,this.ymin+=e,this.xmax+=i,this.ymax+=e,t!=null&&(this.zmin+=t,this.zmax+=t),this}shiftCentralMeridian(){return this._normalize(!0)}union(i){return this===i||(this.xmin=Math.min(this.xmin,i.xmin),this.ymin=Math.min(this.ymin,i.ymin),this.xmax=Math.max(this.xmax,i.xmax),this.ymax=Math.max(this.ymax,i.ymax),(this.hasZ||i.hasZ)&&(this.zmin=mD(Math.min,this.zmin,i.zmin),this.zmax=mD(Math.max,this.zmax,i.zmax)),(this.hasM||i.hasM)&&(this.mmin=mD(Math.min,this.mmin,i.mmin),this.mmax=mD(Math.max,this.mmax,i.mmax))),this}intersection(i){return this===i?this:i!=null&&this.intersects(i)?(this.xmin=Math.max(this.xmin,i.xmin),this.ymin=Math.max(this.ymin,i.ymin),this.xmax=Math.min(this.xmax,i.xmax),this.ymax=Math.min(this.ymax,i.ymax),(this.hasZ||i.hasZ)&&(this.zmin=mD(Math.max,this.zmin,i.zmin),this.zmax=mD(Math.min,this.zmax,i.zmax)),(this.hasM||i.hasM)&&(this.mmin=mD(Math.max,this.mmin,i.mmin),this.mmax=mD(Math.min,this.mmax,i.mmax)),this):null}toJSON(i){return this.write({},i)}_shiftCM(i=Zp(this.spatialReference)){if(!i||!this.spatialReference)return this;const e=this.spatialReference,t=this._getCM(i);if(t){const r=e.isWebMercator?r8(t):t;this.xmin-=t.x,this.xmax-=t.x,e.isWebMercator||(r.x=this._normalizeX(r.x,i).x),this.spatialReference=new Xi(m0((e.isWGS84?i.altTemplate:null)??i.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(i){let e=null;const[t,r]=i.valid,n=this.xmin,s=this.xmax;return n>=t&&n<=r&&s>=t&&s<=r||(e=this.center),e}_normalize(i,e,t){const r=this.spatialReference;if(!r)return this;const n=t??Zp(r);if(n==null)return this;const s=this._getParts(n).map(l=>l.extent);if(s.length<2)return s[0]||this;if(s.length>2)return i?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(i)return this._shiftCM(n);if(e)return s;let o=!0,a=!0;return s.forEach(l=>{l.hasZ||(o=!1),l.hasM||(a=!1)}),{rings:s.map(l=>{const u=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const c=(l.zmax-l.zmin)/2;for(let h=0;h0;if(a>2*p){const R=new w2(lw||I?e.push({extent:new w2(m,n,p,s,o),frameIds:[v]},{extent:new w2(h,n,w,s,o),frameIds:[S]}):e.push({extent:new w2(m,n,w,s,o),frameIds:[v]});this.cache._parts=e}const t=this.hasZ,r=this.hasM;if(t||r){const n={};t&&(n.zmin=this.zmin,n.zmax=this.zmax),r&&(n.mmin=this.mmin,n.mmax=this.mmax);for(let s=0;sr?(s=Math.ceil(Math.abs(i-r)/n),i-=s*n,o=s):ivie.splice(vie.indexOf(i),1))}const d5e=[];function bze(i){return d5e.push(i),wa(()=>vie.splice(d5e.indexOf(i),1))}function fYi(){const i=DEt();yie!==i&&(yie=i,[...d5e].forEach(e=>{e.call(null,i)}),[...vie].forEach(e=>{e.call(null,i)}))}globalThis.addEventListener?.("languagechange",fYi);let Fce;function mYi(i){return Fce&&!Fce.destroyed||(Fce=i()),Fce}var p5e;const gYi=new Rs({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let x2=p5e=class extends un{constructor(i){super(i),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(i){i!=="asc"&&i!=="desc"||this._set("sortOrder",i)}clone(){return new p5e({categories:this.categories?li(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(i,e){let t=[];this.categories&&(t=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o));let r="";if(this.extent){const o=HB(this.extent,Xi.WGS84);o!=null&&(r=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&i.extraQuery&&(n="("+n+")"+i.extraQuery);const s={categories:t,bbox:r,q:n,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(o=>gYi.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};x([D()],x2.prototype,"categories",void 0),x([D()],x2.prototype,"disableExtraQuery",void 0),x([D({type:hr})],x2.prototype,"extent",void 0),x([D()],x2.prototype,"filter",void 0),x([D()],x2.prototype,"num",void 0),x([D()],x2.prototype,"query",void 0),x([D()],x2.prototype,"sortField",void 0),x([D()],x2.prototype,"sortOrder",null),x([D()],x2.prototype,"start",void 0),x2=p5e=x([Qe("esri.portal.PortalQueryParams")],x2);const hA=x2;var f5e;let zf=f5e=class extends Ci{constructor(i){super(i),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const i=this.url,e=this.thumbnail;return i&&e&&this.portal?this.portal?.normalizeUrl(`${i}/info/${e}?f=json`):null}get url(){const i=this.portal?.restUrl;return i?i+"/community/groups/"+this.id:null}fetchCategorySchema(i){return this.portal.request(this.url+"/categorySchema",i).then(e=>{const t=e.categorySchema||[];return t.some(r=>r.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",i):t})}fetchMembers(i){return this.portal.request(this.url+"/users",i)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}toJSON(){throw new qe("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const e=new f5e;return e.sourceJSON=i,e.read(i),e}queryItems(i,e){let t=Sd(hA,i);const r=this.portal;return parseFloat(r.currentVersion)>5?(t=t||new hA,r.queryPortal(`/content/groups/${this.id}/search`,t,"PortalItem",e)):(t=t?t.clone():new hA,t.query="group:"+this.id+(t.query?" "+t.query:""),r.queryItems(t,e))}_fetchCategorySchemaSet(i,e){const t=this.portal;return t.fetchSelf(t.authMode,!0,e).then(r=>{const n=r.contentCategorySetsGroupQuery;if(n){const s=new hA;return s.disableExtraQuery=!0,s.num=1,s.query=n,t.queryGroups(s,e)}throw new qe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const n=r.results[0],s=new hA;return s.num=1,s.query=`typekeywords:"${i}"`,n.queryItems(s,e)}throw new qe("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(r=>r.total?r.results[0].fetchData("json",e).then(n=>{const s=n?.categorySchema;return s?.length?s:[]}):[])}};x([D()],zf.prototype,"access",void 0),x([D({type:Date})],zf.prototype,"created",void 0),x([D()],zf.prototype,"description",void 0),x([D()],zf.prototype,"id",void 0),x([D()],zf.prototype,"isInvitationOnly",void 0),x([D({type:Date})],zf.prototype,"modified",void 0),x([D()],zf.prototype,"owner",void 0),x([D()],zf.prototype,"portal",void 0),x([D()],zf.prototype,"snippet",void 0),x([D()],zf.prototype,"sortField",void 0),x([D()],zf.prototype,"sortOrder",void 0),x([D()],zf.prototype,"sourceJSON",void 0),x([D()],zf.prototype,"tags",void 0),x([D()],zf.prototype,"thumbnail",void 0),x([D({readOnly:!0})],zf.prototype,"thumbnailUrl",null),x([D()],zf.prototype,"title",void 0),x([D({readOnly:!0})],zf.prototype,"url",null),zf=f5e=x([Qe("esri.portal.PortalGroup")],zf);const m5e=zf;let xN=class extends un{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};x([D()],xN.prototype,"nextQueryParams",void 0),x([D()],xN.prototype,"queryParams",void 0),x([D()],xN.prototype,"results",void 0),x([D()],xN.prototype,"total",void 0),xN=x([Qe("esri.portal.PortalQueryResult")],xN);const yYi=xN;let $M=class extends Ci{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.portal?.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new qe("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};x([D({type:Date})],$M.prototype,"created",void 0),x([D()],$M.prototype,"id",void 0),x([D()],$M.prototype,"portal",void 0),x([D()],$M.prototype,"title",void 0),x([D({readOnly:!0})],$M.prototype,"url",null),x([D()],$M.prototype,"username",void 0),$M=x([Qe("esri.portal.PortalFolder")],$M);const vYi=$M;var g5e;let $h=g5e=class extends Ci{constructor(...i){super(...i),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const i=this.url,e=this.thumbnail;return i&&e?this.portal.normalizeUrl(`${i}/info/${e}?f=json`):null}get userContentUrl(){const i=this.portal?.restUrl;return i?`${i}/content/users/${this.username}`:null}get url(){const i=this.portal?.restUrl;return i?`${i}/community/users/${this.username}`:null}addItem(i){const e=i&&i.item,t=i?.data,r=i?.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),t!=null&&(typeof t=="string"?n.query.text=t:typeof t=="object"&&(n.query.text=JSON.stringify(t))));let s=this.userContentUrl;return r&&(s+="/"+(typeof r=="string"?r:r.id)),this.portal.request(s+"/addItem",n).then(o=>(e.id=o.id,e.portal=this.portal,e.loaded?e.reload():e.load()))}deleteItem(i){let e=this.userContentUrl;return i.ownerFolder&&(e+="/"+i.ownerFolder),this.portal.request(e+`/items/${i.id}/delete`,{method:"post"}).then(()=>{i.id=null,i.portal=null})}deleteItems(i){const e=this.userContentUrl+"/deleteItems",t=i.map(r=>r.id);if(t.length){const r={method:"post",query:{items:t.join(",")}};return this.portal.request(e,r).then(()=>{i.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const i={query:{num:1}};return this.portal.request(this.userContentUrl??"",i).then(e=>{let t;return t=e&&e.folders?e.folders.map(r=>{const n=vYi.fromJSON(r);return n.portal=this.portal,n}):[],t})}fetchGroups(){return this.portal.request(this.url??"").then(i=>{let e;return e=i&&i.groups?i.groups.map(t=>{const r=m5e.fromJSON(t);return r.portal=this.portal,r}):[],e})}fetchItems(i){const e=i??{};let t,r=this.userContentUrl??"";return e.folder&&(r+="/"+e.folder.id),Promise.resolve().then(()=>NEt).then(({default:n})=>{t=n;const s={folders:!1,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"};return this.portal.request(r,{query:s})}).then(n=>{let s;return n?.items?(s=n.items.map(o=>{const a=t.fromJSON(o);return a.portal=this.portal,a}),Promise.all(s.map(o=>o.load())).catch(o=>o).then(()=>({items:s,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(i=>i.tags)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}queryFavorites(i){return this.favGroupId?(this._favGroup||(this._favGroup=new m5e({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(i)):Promise.reject(new qe("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new qe("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");const e=new g5e;return e.sourceJSON=i,e.read(i),e}};x([D()],$h.prototype,"access",void 0),x([D({type:Date})],$h.prototype,"created",void 0),x([D()],$h.prototype,"culture",void 0),x([D()],$h.prototype,"description",void 0),x([D()],$h.prototype,"email",void 0),x([D()],$h.prototype,"favGroupId",void 0),x([D()],$h.prototype,"fullName",void 0),x([D({type:Date})],$h.prototype,"modified",void 0),x([D()],$h.prototype,"orgId",void 0),x([D()],$h.prototype,"portal",void 0),x([D()],$h.prototype,"preferredView",void 0),x([D()],$h.prototype,"privileges",void 0),x([D()],$h.prototype,"region",void 0),x([D()],$h.prototype,"role",void 0),x([D()],$h.prototype,"roleId",void 0),x([D()],$h.prototype,"sourceJSON",void 0),x([D()],$h.prototype,"thumbnail",void 0),x([D({readOnly:!0})],$h.prototype,"thumbnailUrl",null),x([D()],$h.prototype,"units",void 0),x([D({readOnly:!0})],$h.prototype,"userContentUrl",null),x([D({readOnly:!0})],$h.prototype,"url",null),x([D()],$h.prototype,"username",void 0),x([D()],$h.prototype,"userType",void 0),$h=g5e=x([Qe("esri.portal.PortalUser")],$h);const wze=$h;var fw;let kce;const xrt={PortalGroup:()=>Promise.resolve({default:m5e}),PortalItem:()=>Promise.resolve().then(()=>NEt),PortalUser:()=>Promise.resolve({default:wze})};let On=fw=class extends S0(ef){constructor(i){super(i),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ho.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(i){return typeof i=="string"?{url:i}:i}destroy(){Srt.unregister(this),this.defaultBasemap=zo(this.defaultBasemap),this.defaultDevBasemap=zo(this.defaultDevBasemap),this.defaultVectorBasemap=zo(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=Hc(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(i){if(i)for(const e of i)Ho.request.trustedServers.includes(e)||Ho.request.trustedServers.push(e);return i}readDefaultBasemap(i){return this._readBasemap(i)}readDefaultDevBasemap(i){return this._readBasemap(i)}readDefaultVectorBasemap(i){return this._readBasemap(i)}get extraQuery(){const i=this.user?.orgId,e=!i||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let i=this.url;if(i){const e=i.indexOf("/sharing");i=e>0?i.substring(0,e):this.url.replace(/\/+$/,""),i+="/sharing/rest"}return i}get thumbnailUrl(){const i=this.restUrl,e=this.thumbnail;return i&&e?this._normalizeSSL(i+"/portals/self/resources/"+e):null}readUrlKey(i){return i&&i.toLowerCase()}readUser(i){let e=null;return i&&(e=wze.fromJSON(i),e.portal=this),e}load(i){const e=Promise.resolve().then(()=>qYi).then(({default:t})=>{hn(i),kce=t}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,i)).then(t=>{if(no){const r=no;this.credential=r.findCredential(this.restUrl),this.credential||this.authMode!==fw.AUTH_MODE_AUTO&&this.authMode!==fw.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=r.on("credential-create",_Yi(new WeakRef(this))),Srt.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=t,this.read(t)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const i=this._getHelperService("defaultElevationLayers"),e=(await Promise.resolve().then(()=>a8t)).default;return i?i.map(t=>new e({id:t.id,url:t.url})):[]}async fetchBasemaps(i,e){const t=await this._fetchBasemaps(i,e);if(e?.include3d===!0&&this.use3dBasemaps!==!1){const r=await this._fetchBasemaps3D(i,e);t.unshift(...r)}return t}fetchCategorySchema(i){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",i).then(e=>e.categorySchema):xg(i)?Promise.reject(Oc()):Promise.resolve([])}fetchFeaturedGroups(i){const e=this.featuredGroups,t=new hA;if(t.num=100,t.sortField="title",e&&e.length){const r=[];for(const n of e)r.push(`(title:"${n.title}" AND owner:${n.owner})`);return t.query=r.join(" OR "),this.queryGroups(t,i).then(n=>n.results)}return xg(i)?Promise.reject(Oc()):Promise.resolve([])}fetchRegions(i){const e=this.user?.culture||this.culture||Am();return this.request(this.restUrl+"/portals/regions",{...i,query:{culture:e}})}fetchSettings(i){const e=this.user?.culture||this.culture||Am();return this.request(this.restUrl+"/portals/self/settings",{...i,query:{culture:e}})}static getDefault(){return mYi(()=>new fw)}queryGroups(i,e){return this.queryPortal("/community/groups",i,"PortalGroup",e)}queryItems(i,e){return this.queryPortal("/search",i,"PortalItem",e)}queryUsers(i,e){return i.sortField||(i.sortField="username"),this.queryPortal("/community/users",i,"PortalUser",e)}fetchSelf(i=this.authMode,e=!1,t){const r=this.restUrl+"/portals/self",n={authMode:i,query:{culture:Am().toLowerCase()},withCredentials:!0,...t};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(r,n)}queryPortal(i,e,t,r){const n=Sd(hA,e),s=o=>this.request(this.restUrl+i,{...n.toRequestOptions(this),...r}).then(a=>{const l=n.clone();return l.start=a.nextStart,new yYi({nextQueryParams:l,queryParams:n,total:a.total,results:fw._resultsToTypedArray(o,{portal:this},a,r)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(_a(l),a)));return t&&xrt[t]?xrt[t]().then(({default:o})=>(hn(r),s(o))):s()}signIn(){if(this.authMode===fw.AUTH_MODE_ANONYMOUS||this.authMode===fw.AUTH_MODE_NO_PROMPT&&!no)return Promise.reject(new qe("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const i=e=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(e||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(t=>{t&&(this.sourceJSON=t,this.read(t))});return no?no.getCredential(this.restUrl,{prompt:this.authMode!==fw.AUTH_MODE_NO_PROMPT}).then(e=>i(e)):i(this.credential)}normalizeUrl(i){const e=this.credential?.token;return this._normalizeSSL(e?i+(i.includes("?")?"&":"?")+"token="+e:i)}requestToTypedArray(i,e,t){return this.request(i,e).then(r=>{const n=fw._resultsToTypedArray(t,{portal:this},r);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():r)).then(()=>n,()=>n)})}request(i,e={}){const t={f:"json",...e.query},{authMode:r=this.authMode===fw.AUTH_MODE_ANONYMOUS||this.authMode===fw.AUTH_MODE_NO_PROMPT?this.authMode:"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:a="json",signal:l}=e,u={authMode:r,body:n,cacheBust:s,method:o,query:t,responseType:a,timeout:0,signal:l};return e.withCredentials&&(u.withCredentials=!0),zi(this._normalizeSSL(i),u).then(c=>c.data)}toJSON(){throw new qe("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");return new fw({sourceJSON:i})}_getHelperService(i){const e=this.helperServices&&this.helperServices[i];if(!e)throw new qe("portal:service-not-found",`The \`helperServices\` do not include an entry named "${i}"`);return e}async _fetchBasemaps(i,e){const t=new hA;t.query=i||(Ho.apiKey&&oze(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),t.disableExtraQuery=!0;const r=await this.queryGroups(t,e);if(!r.total)return[];const n=r.results[0];t.num=100,t.query='type:"Web Map" -type:"Web Application"',t.sortField=n.sortField||"name",t.sortOrder=n.sortOrder||"desc";const s=await n.queryItems(t,e);return s.total?s.results.filter(o=>o.type==="Web Map").map(o=>new kce({portalItem:o})):[]}async _fetchBasemaps3D(i,e){const t=i||this.basemapGalleryGroupQuery3D;if(!t)return[];const r=new hA({query:t,disableExtraQuery:!0}),n=await this.queryGroups(r,e);if(!n.total)return[];const s=n.results[0];r.num=100,r.query='type:"Web Scene"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(r,e);return o.total?o.results.filter(a=>a.type==="Web Scene").map(a=>new kce({portalItem:a})):[]}_normalizeSSL(i){return i.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(i){if(i){const e=kce.fromJSON(i);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(i,e,t,r){let n=[];if(t){const s=r!=null?r.signal:null;n=t.listings||t.notifications||t.userInvitations||t.tags||t.items||t.groups||t.comments||t.provisions||t.results||t.relatedItems||t,(i||e)&&(n=n.map(o=>{const a=Object.assign(i?i.fromJSON(o):o,e);return typeof a.load=="function"&&a.load(s),a}))}else n=[];return n}};On.AUTH_MODE_ANONYMOUS="anonymous",On.AUTH_MODE_AUTO="auto",On.AUTH_MODE_IMMEDIATE="immediate",On.AUTH_MODE_NO_PROMPT="no-prompt",x([D()],On.prototype,"access",void 0),x([D()],On.prototype,"allSSL",void 0),x([D()],On.prototype,"authMode",void 0),x([D()],On.prototype,"authorizedCrossOriginDomains",void 0),x([Mi("authorizedCrossOriginDomains")],On.prototype,"readAuthorizedCrossOriginDomains",null),x([D()],On.prototype,"basemapGalleryGroupQuery",void 0),x([D({json:{name:"3DBasemapGalleryGroupQuery"}})],On.prototype,"basemapGalleryGroupQuery3D",void 0),x([D()],On.prototype,"bingKey",void 0),x([D()],On.prototype,"canListApps",void 0),x([D()],On.prototype,"canListData",void 0),x([D()],On.prototype,"canListPreProvisionedItems",void 0),x([D()],On.prototype,"canProvisionDirectPurchase",void 0),x([D()],On.prototype,"canSearchPublic",void 0),x([D()],On.prototype,"canShareBingPublic",void 0),x([D()],On.prototype,"canSharePublic",void 0),x([D()],On.prototype,"canSignInArcGIS",void 0),x([D()],On.prototype,"canSignInIDP",void 0),x([D()],On.prototype,"colorSetsGroupQuery",void 0),x([D()],On.prototype,"commentsEnabled",void 0),x([D({type:Date})],On.prototype,"created",void 0),x([D()],On.prototype,"credential",void 0),x([D()],On.prototype,"culture",void 0),x([D()],On.prototype,"currentVersion",void 0),x([D()],On.prototype,"customBaseUrl",void 0),x([D()],On.prototype,"defaultBasemap",void 0),x([Mi("defaultBasemap")],On.prototype,"readDefaultBasemap",null),x([D()],On.prototype,"defaultDevBasemap",void 0),x([Mi("defaultDevBasemap")],On.prototype,"readDefaultDevBasemap",null),x([D({type:hr})],On.prototype,"defaultExtent",void 0),x([D()],On.prototype,"defaultVectorBasemap",void 0),x([Mi("defaultVectorBasemap")],On.prototype,"readDefaultVectorBasemap",null),x([D()],On.prototype,"description",void 0),x([D()],On.prototype,"devBasemapGalleryGroupQuery",void 0),x([D()],On.prototype,"eueiEnabled",void 0),x([D({readOnly:!0})],On.prototype,"extraQuery",null),x([D()],On.prototype,"featuredGroups",void 0),x([D()],On.prototype,"featuredItemsGroupQuery",void 0),x([D()],On.prototype,"galleryTemplatesGroupQuery",void 0),x([D()],On.prototype,"layoutGroupQuery",void 0),x([D()],On.prototype,"livingAtlasGroupQuery",void 0),x([D()],On.prototype,"hasCategorySchema",void 0),x([D()],On.prototype,"helpBase",void 0),x([D()],On.prototype,"helperServices",void 0),x([D()],On.prototype,"helpMap",void 0),x([D()],On.prototype,"homePageFeaturedContent",void 0),x([D()],On.prototype,"homePageFeaturedContentCount",void 0),x([D()],On.prototype,"httpPort",void 0),x([D()],On.prototype,"httpsPort",void 0),x([D()],On.prototype,"id",void 0),x([D()],On.prototype,"ipCntryCode",void 0),x([D({readOnly:!0})],On.prototype,"isOrganization",null),x([D()],On.prototype,"isPortal",void 0),x([D()],On.prototype,"isReadOnly",void 0),x([D({readOnly:!0})],On.prototype,"itemPageUrl",null),x([D()],On.prototype,"layerTemplatesGroupQuery",void 0),x([D()],On.prototype,"maxTokenExpirationMinutes",void 0),x([D({type:Date})],On.prototype,"modified",void 0),x([D()],On.prototype,"name",void 0),x([D()],On.prototype,"portalHostname",void 0),x([D()],On.prototype,"portalMode",void 0),x([D()],On.prototype,"portalProperties",void 0),x([D()],On.prototype,"region",void 0),x([D({readOnly:!0})],On.prototype,"restUrl",null),x([D()],On.prototype,"rotatorPanels",void 0),x([D()],On.prototype,"showHomePageDescription",void 0),x([D()],On.prototype,"sourceJSON",void 0),x([D()],On.prototype,"staticImagesUrl",void 0),x([D({json:{name:"2DStylesGroupQuery"}})],On.prototype,"stylesGroupQuery2d",void 0),x([D({json:{name:"stylesGroupQuery"}})],On.prototype,"stylesGroupQuery3d",void 0),x([D()],On.prototype,"supportsHostedServices",void 0),x([D()],On.prototype,"symbolSetsGroupQuery",void 0),x([D()],On.prototype,"templatesGroupQuery",void 0),x([D()],On.prototype,"thumbnail",void 0),x([D({readOnly:!0})],On.prototype,"thumbnailUrl",null),x([D()],On.prototype,"units",void 0),x([D()],On.prototype,"url",void 0),x([D()],On.prototype,"urlKey",void 0),x([Mi("urlKey")],On.prototype,"readUrlKey",null),x([D()],On.prototype,"user",void 0),x([Mi("user")],On.prototype,"readUser",null),x([D()],On.prototype,"use3dBasemaps",void 0),x([D()],On.prototype,"useStandardizedQuery",void 0),x([D()],On.prototype,"useVectorBasemaps",void 0),x([D()],On.prototype,"vectorBasemapGalleryGroupQuery",void 0),On=fw=x([Qe("esri.portal.Portal")],On);const Bu=On,Srt=new FinalizationRegistry(i=>{i.remove()});function _Yi(i){const e=no;return()=>{const t=i.deref();t&&e.findCredential(t.restUrl)&&t.signIn().catch(()=>{})}}let BM=class extends un{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){e!=null&&u0(e)?di.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new qe("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await Promise.resolve().then(()=>Qz);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}_normalizePath(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&u0(e)&&(e=s2e(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};x([D()],BM.prototype,"portalItem",void 0),x([D({type:String,value:null})],BM.prototype,"path",null),x([So("path")],BM.prototype,"_castPath",null),x([D({type:String,readOnly:!0})],BM.prototype,"url",null),x([D({type:String,readOnly:!0})],BM.prototype,"cdnUrl",null),x([D({type:String,readOnly:!0})],BM.prototype,"itemRelativeUrl",null),BM=x([Qe("esri.portal.PortalItemResource")],BM);const bYi=BM;let zZ=class extends un{constructor(e){super(e),this.created=null,this.rating=null}};x([D()],zZ.prototype,"created",void 0),x([D()],zZ.prototype,"rating",void 0),zZ=x([Qe("esri.portal.PortalRating")],zZ);const t3e=zZ;function mE(i,e){const t=e?.url?.path;if(i&&t&&(i=xf(i,t,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const r=s2e(i,e.portalItem.itemUrl);r!=null&&wYi.test(r)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(r).path)}return(i=y5e(i,e?.portal))&&u2e.test(i)?Tze(i):i}function gE(i,e,t=Q9.YES){if((i=i&&u2e.test(i)?LEt(i):i)==null)return i;!u0(i)&&e?.blockedRelativeUrls&&e.blockedRelativeUrls.push(i);let r=xf(i);if(e){const n=e.verifyItemRelativeUrls?.rootPath||e.url?.path;if(n){const s=y5e(n,e.portal),o=y5e(r,e.portal);r=s2e(o,s,s),r!=null&&r!==o&&r!==i&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=Sze(r,e?.portal),u0(r)&&(r=X1(r)),e?.resources&&e?.portalItem&&!u0(r)&&!Vx(r)&&t===Q9.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(r),compress:!1}),r}function mY(i,e,t){return mE(i,t)}function cR(i,e,t,r){const n=gE(i,r);n!==void 0&&(e[t]=n)}const u2e=/\/items\/([^\/]+)\/resources\/(.*)/,wYi=/^\.\/resources\//;function xze(i){return(i?.match(u2e)??null)?.[1]??null}function kEt(i){const e=i?.match(u2e)??null;if(e==null)return null;const t=e[2],r=t.lastIndexOf("/");if(r===-1){const{path:o,extension:a}=urt(t);return{prefix:null,filename:o,extension:a}}const{path:n,extension:s}=urt(t.slice(r+1));return{prefix:t.slice(0,r),filename:n,extension:s}}function Sze(i,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?i5e(i,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):i}function y5e(i,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return i;const t=`${e.urlKey}.${e.customBaseUrl}`,r=ZUe();return _v(r,`${r.scheme}://${t}`)?i5e(i,e.portalHostname,t):i5e(i,t,e.portalHostname)}function Tze(i){if(!i)return i||null;let e=i;return e&&no&&!no.findCredential(e)&&(e=no._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),e=e.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),e=e.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),e}function LEt(i){if(!i)return i||null;let e=i;return e=e.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),e=e.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),e=e.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),e&&no&&!no.findCredential(e)&&(e=no._normalizeAGOLorgDomain(e)),e}var Q9;(function(i){i[i.YES=0]="YES",i[i.NO=1]="NO"})(Q9||(Q9={}));const xYi=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return Q9},ensureMainOnlineDomain:Sze,fromCDNUrl:LEt,fromJSON:mE,itemIdFromResourceUrl:xze,prefixAndFilenameFromResourceUrl:kEt,read:mY,toCDNUrl:Tze,toJSON:gE,write:cR},Symbol.toStringTag,{value:"Module"}));var SN;const SYi=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),TYi=new Set(["KML","GeoJson","CSV"]);let La=SN=class extends S0(ef){static from(i){return Cu(SN,i)}constructor(i){super(i),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const i=this.type,e=this.typeKeywords||[];let t=i;return i==="Feature Service"||i==="Feature Collection"?t=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":i==="Image Service"?t=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":i==="Scene Service"?t="Scene Layer":i==="Video Service"?t="Video Layer":i==="Scene Package"?t="Scene Layer Package":i==="Stream Service"?t="Feature Layer":i==="Geoprocessing Service"?t=e.includes("Web Tool")?"Tool":"Geoprocessing Service":i==="Geoenrichment Service"?t="GeoEnrichment Service":i==="Geocoding Service"?t="Locator":i==="Microsoft Powerpoint"?t="Microsoft PowerPoint":i==="GeoJson"?t="GeoJSON":i==="Globe Service"?t="Globe Layer":i==="Vector Tile Service"?t="Tile Layer":i==="netCDF"?t="NetCDF":i==="Map Service"?t=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":i&&i.toLowerCase().includes("add in")?t=i.replaceAll(/(add in)/gi,"Add-In"):i==="datastore catalog service"?t="Big Data File Share":i==="Compact Tile Package"?t="Tile Package (tpkx)":i==="Raster function template"?t="Raster Function Template":i==="OGCFeatureServer"?t="OGC Feature Layer":i==="web mapping application"&&e.includes("configurableApp")?t="Instant App":i==="Insights Page"?t="Insights Report":i==="Excalibur Imagery Project"?t="Excalibur Project":i==="3DTiles Service"?t="3D tiles layer":i==="3DTiles Package"&&(t="3D tiles package"),t}readExtent(i){return i&&i.length?new hr(i[0][0],i[0][1],i[1][0],i[1][1]):null}get iconUrl(){const i=this.type?.toLowerCase()||"",e=this.typeKeywords||[],t="esri/images/portal/",r="16";let n,s=!1,o=!1,a=!1,l=!1,u=!1,c=!1,h=!1,p=!1;return i.indexOf("service")>0||i==="feature collection"||i==="kml"||i==="wms"||i==="wmts"||i==="wfs"?(s=e.includes("Hosted Service"),i==="feature service"||i==="feature collection"||i==="kml"||i==="wfs"?(o=e.includes("Table"),a=e.includes("Route Layer"),l=e.includes("Markup"),u=e.includes("Spatiotemporal"),c=e.includes("UtilityNetwork"),n=u&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":u?"spatiotemporal":c?"utilitynetwork":s?"featureshosted":"features"):i==="map service"||i==="wms"||i==="wmts"?(u=e.includes("Spatiotemporal"),h=e.includes("Relational"),n=u||h?"mapimages":s||e.includes("Tiled")||i==="wmts"?"maptiles":"mapimages"):n=i==="scene service"?e.includes("Line")?"sceneweblayerline":e.includes("3DObject")?"sceneweblayermultipatch":e.includes("Point")?"sceneweblayerpoint":e.includes("IntegratedMesh")?"sceneweblayermesh":e.includes("PointCloud")?"sceneweblayerpointcloud":e.includes("Polygon")?"sceneweblayerpolygon":e.includes("Building")?"sceneweblayerbuilding":e.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":i==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":i==="stream service"?"streamlayer":i==="vector tile service"?"vectortile":i==="datastore catalog service"?"datastorecollection":i==="geocoding service"?"geocodeservice":i==="video service"?e.includes("Live Stream")?"livestreamvideolayer":"videolayer":i==="geoprocessing service"?e.includes("Web Tool")?"tool":"layers":i==="geodata service"?"geodataservice":i==="3dtiles service"?e.includes("3DObject")?"3dobjecttileslayer":e.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):i==="web map"||i==="cityengine web scene"?n="maps":i==="web scene"?n=e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":i==="web mapping application"&&e.includes("configurableApp")?n="instantapps":i==="web mapping application"||i==="mobile application"||i==="application"||i==="operation view"||i==="desktop application"?n="apps":i==="map document"||i==="map package"||i==="published map"||i==="scene document"||i==="globe document"||i==="basemap package"||i==="mobile basemap package"||i==="mobile map package"||i==="project package"||i==="project template"||i==="pro map"||i==="layout"||i==="layer"&&e.includes("ArcGIS Pro")||i==="explorer map"&&e.indexOf("Explorer Document")?n="mapsgray":i==="service definition"||i==="shapefile"||i==="cad drawing"||i==="geojson"||i==="netcdf"||i==="administrative report"?n="datafiles":i==="360 vr experience"?n="360vr":i==="explorer add in"||i==="desktop add in"||i==="windows viewer add in"||i==="windows viewer configuration"?n="appsgray":i==="arcgis pro add in"||i==="arcgis pro configuration"?n="addindesktop":i==="pdf"?n="pdf":i==="microsoft word"?n="word":i==="microsoft excel"?n="excel":i==="microsoft powerpoint"?n="ppt":i==="rule package"||i==="file geodatabase"||i==="sqlite geodatabase"||i==="csv collection"||i==="kml collection"||i==="windows mobile package"||i==="map template"||i==="desktop application template"||i==="gml"||i==="arcpad package"||i==="code sample"||i==="document link"||i==="earth configuration"||i==="operations dashboard add in"||i==="rules package"||i==="workflow manager package"||i==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?n="datafilesgray":i==="network analysis service"||i==="geoprocessing service"||i==="geodata service"||i==="geometry service"||i==="geoprocessing package"||i==="locator package"||i==="geoprocessing sample"||i==="workflow manager service"?n="toolsgray":i==="layer"||i==="layer package"||i==="explorer layer"?n="layersgray":i==="scene package"?n="scenepackage":i==="3dtiles package"?n="3dtileslayerpackage":i==="3dtiles service"?n="3dtileslayer":i==="mobile scene package"?n="mobilescenepackage":i==="tile package"||i==="compact tile package"?n="tilepackage":i==="task file"?n="taskfile":i==="report template"?n="report-template":i==="statistical data collection"?n="statisticaldatacollection":i==="insights workbook"?n="workbook":i==="insights model"?n="insightsmodel":i==="insights page"?n="insightspage":i==="insights theme"?n="insightstheme":i==="hub initiative"?n="hubinitiative":i==="hub page"?n="hubpage":i==="hub site application"?n="hubsite":i==="hub event"?n="hubevent":i==="hub project"?n="hubproject":i==="relational database connection"?n="relationaldatabaseconnection":i==="big data file share"?n="datastorecollection":i==="image collection"?n="imagecollection":i==="desktop style"?n="desktopstyle":i==="style"?n="style":i==="dashboard"?n="dashboard":i==="raster function template"?n="rasterprocessingtemplate":i==="vector tile package"?n="vectortilepackage":i==="ortho mapping project"?n="orthomappingproject":i==="ortho mapping template"?n="orthomappingtemplate":i==="solution"?n="solutions":i==="geopackage"?n="geopackage":i==="deep learning package"?n="deeplearningpackage":i==="real time analytic"?n="realtimeanalytics":i==="big data analytic"?n="bigdataanalytics":i==="feed"?n="feed":i==="excalibur imagery project"?n="excaliburimageryproject":i==="notebook"?n="notebook":i==="storymap"?n="storymap":i==="survey123 add in"?n="survey123addin":i==="mission"?n="mission":i==="mission report"?n="missionreport":i==="mission template"?n="missiontemplate":i==="quickcapture project"?n="quickcaptureproject":i==="pro report"?n="proreport":i==="pro report template"?n="proreporttemplate":i==="urban model"?n="urbanmodel":i==="web experience"?n="experiencebuilder":i==="web experience template"?n="webexperiencetemplate":i==="experience builder widget"?n="experiencebuilderwidget":i==="experience builder widget package"?n="experiencebuilderwidgetpackage":i==="workflow"?n="workflow":i==="kernel gateway connection"?n="kernelgatewayconnection":i==="insights script"?n="insightsscript":i==="hub initiative template"?n="hubinitiativetemplate":i==="storymap theme"?n="storymaptheme":i==="knowledge graph"?n="knowledgegraph":i==="knowledge studio project"?n="knowledgestudio":i==="native application"?n="nativeapp":i==="native application installer"?n="nativeappinstaller":i==="web link chart"?n="linkchart":i==="knowledge graph web investigation"?n="investigation":i==="ogcfeatureserver"?n="features":i==="pro project"?n="proproject":i==="insights workbook package"?n="insightsworkbookpackage":i==="apache parquet"?n="apacheparquet":i==="notebook code snippets"||i==="notebook code snippet library"?n="notebookcodesnippets":i==="suitability model"?n="suitabilitymodel":i==="esri classifier definition"?n="classifierdefinition":i==="esri classification schema"?n="classificationschema":i==="insights data engineering workbook"?n="dataengineeringworkbook":i==="insights data engineering model"?n="dataengineeringmodel":i==="deep learning studio project"?n="deeplearningproject":i==="discussion"?n="discussion":i==="allsource project"?n="allsourceproject":i==="api key"?n="apikey":i==="data pipeline"?n="datapipelines":i==="group layer"?(p=e.includes("Map"),n=p?"layergroup2d":"layergroup"):n=i==="media layer"?"onlinemedialayer":i==="form"?e.includes("Survey123")?"survey":"datafilesgray":i==="csv"?"csv":i==="image"?"image":"maps",n?Fl(t+n+r+".png"):null}get isLayer(){return this.type!=null&&SYi.has(this.type)}get itemCdnUrl(){return Tze(this.itemUrl)}get itemPageUrl(){const i=this.portal?.itemPageUrl;return i&&this.id?`${i}?id=${this.id}`:null}get itemUrl(){const i=this.portal?.restUrl;return i&&this.id?`${i}/content/items/${this.id}`:null}get thumbnailUrl(){const i=this.itemUrl,e=this.thumbnail;return i&&e?this.portal?.normalizeUrl(`${i}/info/${e}?f=json`)??null:null}get userItemUrl(){const i=this.portal?.restUrl;if(!i)return null;const e=this.owner||this.portal?.user?.username;return e?`${i}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(i){const e=this.portal??(this.portal=Bu.getDefault()),t=e.load(i).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:i!=null?i.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(t),Promise.resolve(this)}async addRating(i){const e={method:"post",query:{}};return i instanceof t3e&&(i=i.rating),i==null||isNaN(i)||typeof i!="number"||(e.query.rating=i),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new t3e({rating:i,created:new Date})):null}clone(){const i={access:this.access,accessInformation:this.accessInformation,applicationProxies:li(this.applicationProxies),avgRating:this.avgRating,categories:li(this.categories),created:li(this.created),culture:this.culture,description:this.description,extent:li(this.extent),groupCategories:li(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:li(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:li(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:li(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:li(this.typeKeywords),url:this.url};this.loaded&&(i.loadStatus="loaded");const e=new SN({sourceJSON:this.sourceJSON}).set(i);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){const i=this.toJSON();for(const t of["tags","typeKeywords","categories"])i[t]=i[t]?.join(", ");const{extent:e}=i;return e&&(i.extent=JSON.stringify(e)),i}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(i="json",e){return this.portal.request(this.itemUrl+"/data",{responseType:i,...e,query:{token:this.apiKey}})}async fetchRating(i){const e=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...i});return e.rating!=null?(e.created=new Date(e.created),new t3e(e)):null}fetchRelatedItems(i,e){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...i,token:this.apiKey},...e},SN)}getThumbnailUrl(i){let e=this.thumbnailUrl;return e&&i&&(e+=`&w=${i}`),e}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(i=>(this.sourceJSON=i,this.read(i),this))}update(i){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=i?.data,t={method:"post"};t.query=this.createPostQuery();for(const r in t.query)t.query[r]===null&&(t.query[r]="");return t.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?t.query.text=e:typeof e=="object"&&(t.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,t).then(()=>this.reload())}):Promise.reject(new qe("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(i){if(!this.id)throw new qe("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:t}=this;await e.signIn();const{copyResources:r,folder:n,tags:s,title:o}=i||{},a={method:"post",query:{copyPrivateResources:r==="all",folder:typeof n=="string"?n:n?.id,includeResources:!!r,tags:s?.join(","),title:o}},{itemId:l}=await e.request(`${t}/copy`,a);return new SN({id:l,portal:e})}updateThumbnail(i){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=i.thumbnail,t=i.filename,r={method:"post"};if(typeof e=="string")Vx(e)?r.query={data:e}:r.query={url:xf(e)},t!=null&&(r.query.filename=t);else{const n=new FormData;t!=null?n.append("file",e,t):n.append("file",e),r.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new qe("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(i={},e){const{fetchResources:t}=await Promise.resolve().then(()=>Qz);return t(this,i,e)}async addResource(i,e,t){const{addOrUpdateResources:r}=await Promise.resolve().then(()=>Qz);return i.portalItem=this,await r(this,[{resource:i,content:e,compress:t?.compress,access:t?.access}],"add",t),i}async removeResource(i,e){const{removeResource:t}=await Promise.resolve().then(()=>Qz);if(i.portalItem&&i.portalItem.itemUrl!==this.itemUrl)throw new qe("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return t(this,i,e)}async removeAllResources(i){const{removeAllResources:e}=await Promise.resolve().then(()=>Qz);return e(this,i)}resourceFromPath(i){return new bYi({portalItem:this,path:i})}toJSON(){const i=this.extent,e={accessInformation:this.accessInformation,categories:li(this.categories),created:this.created?.getTime(),description:this.description,extent:i&&[[i.xmin,i.ymin],[i.xmax,i.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:li(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:li(this.typeKeywords),url:this.url};return BUe(e)}static fromJSON(i){if(!i)return null;if(i.declaredClass)throw new Error("JSON object is already hydrated");return new SN({sourceJSON:i})}_getPostQuery(){const i=this.toJSON();for(const e in i)e==="tags"&&i[e]!==null&&(i[e]=i[e].join(", ")),e==="typeKeywords"&&i[e]!==null&&(i[e]=i[e].join(", ")),e==="extent"&&i[e]&&(i[e]=JSON.stringify(i[e]));return i}};x([D({type:["private","shared","org","public"]})],La.prototype,"access",void 0),x([D()],La.prototype,"accessInformation",void 0),x([D({type:String})],La.prototype,"apiKey",void 0),x([D({json:{read:{source:"appProxies"}}})],La.prototype,"applicationProxies",void 0),x([D()],La.prototype,"avgRating",void 0),x([D()],La.prototype,"categories",void 0),x([D({type:Date})],La.prototype,"created",void 0),x([D()],La.prototype,"culture",void 0),x([D()],La.prototype,"description",void 0),x([D({readOnly:!0})],La.prototype,"displayName",null),x([D({type:hr})],La.prototype,"extent",void 0),x([Mi("extent")],La.prototype,"readExtent",null),x([D()],La.prototype,"groupCategories",void 0),x([D({readOnly:!0})],La.prototype,"iconUrl",null),x([D()],La.prototype,"id",void 0),x([D({readOnly:!0})],La.prototype,"isLayer",null),x([D({type:Boolean,readOnly:!0})],La.prototype,"isOrgItem",void 0),x([D()],La.prototype,"itemControl",void 0),x([D({readOnly:!0})],La.prototype,"itemPageUrl",null),x([D({readOnly:!0})],La.prototype,"itemUrl",null),x([D()],La.prototype,"licenseInfo",void 0),x([D({type:Date})],La.prototype,"modified",void 0),x([D()],La.prototype,"name",void 0),x([D()],La.prototype,"numComments",void 0),x([D()],La.prototype,"numRatings",void 0),x([D()],La.prototype,"numViews",void 0),x([D()],La.prototype,"owner",void 0),x([D()],La.prototype,"ownerFolder",void 0),x([D({type:Bu})],La.prototype,"portal",void 0),x([D()],La.prototype,"screenshots",void 0),x([D()],La.prototype,"size",void 0),x([D()],La.prototype,"snippet",void 0),x([D()],La.prototype,"sourceJSON",void 0),x([D({type:String})],La.prototype,"sourceUrl",void 0),x([D({type:String})],La.prototype,"spatialReference",void 0),x([D()],La.prototype,"tags",void 0),x([D()],La.prototype,"thumbnail",void 0),x([D({readOnly:!0})],La.prototype,"thumbnailUrl",null),x([D()],La.prototype,"title",void 0),x([D()],La.prototype,"type",void 0),x([D()],La.prototype,"typeKeywords",void 0),x([D({type:String,json:{read(i,e){if(TYi.has(e.type)){const t=this.portal?.restUrl;i||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return i}}})],La.prototype,"url",void 0),x([D({readOnly:!0})],La.prototype,"userItemUrl",null),La=SN=x([Qe("esri.portal.PortalItem")],La);const yg=La,NEt=Object.freeze(Object.defineProperty({__proto__:null,default:yg},Symbol.toStringTag,{value:"Module"})),Trt=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,CYi={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function Crt(i){return i in CYi}const VZ=[],FV=new Map;function Ert(i){for(const e of FV.keys())$Et(i.pattern,e)&&FV.delete(e)}function EYi(i){return VZ.includes(i)||(Ert(i),VZ.unshift(i)),wa(()=>{const e=VZ.indexOf(i);e>-1&&(VZ.splice(e,1),Ert(i))})}async function Cze(i){const e=Am();FV.has(i)||FV.set(i,AYi(i,e));const t=FV.get(i);return t&&await MYi.add(t),t}function IYi(i){if(!Trt.test(i))return null;const e=Trt.exec(i);if(e===null)return null;const[,t,r]=e,n=t+(r?"-"+r.toUpperCase():"");return Crt(n)?n:Crt(t)?t:null}async function AYi(i,e){const t=[];for(const r of VZ)if($Et(r.pattern,i))try{return await r.fetchMessageBundle(i,e)}catch(n){t.push(n)}throw t.length?new qe("intl:message-bundle-error",`Errors occurred while loading "${i}"`,{errors:t}):new qe("intl:no-message-bundle-loader",`No loader found for message bundle "${i}"`)}function $Et(i,e){return typeof i=="string"?e.startsWith(i):i.test(e)}bze(()=>{FV.clear()});const MYi=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(i){return this._increase(),i.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=ac())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function OYi(i){if(!i)return;const e=i.includes("-vector")?i.slice(0,i.indexOf("-vector")):i.includes("-3d")?i.slice(0,i.indexOf("-3d")):i,t=await Cze("esri/t9n/basemaps");return t[i]||t[e]}const v5e={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return Fl("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return Fl("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Fl("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Fl("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Fl("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Fl("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Fl("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Fl("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},PYi=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let r4=class extends un{constructor(e){super(e),this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=Am().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const t=FEt(e);return t==="pt"?"pt-BR":t&&PYi.has(t)?t:"global"}};x([D()],r4.prototype,"id",void 0),x([D()],r4.prototype,"language",void 0),x([D()],r4.prototype,"places",void 0),x([D()],r4.prototype,"serviceUrl",void 0),x([D()],r4.prototype,"worldview",void 0),r4=x([Qe("esri.support.BasemapStyle")],r4);const RYi=r4;function DYi(i){return i!=null&&typeof i=="object"&&"type"in i&&i.type==="subtype-group"&&"sublayers"in i}function oj(i){return i?.type==="subtype-sublayer"}const _ie={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function BEt(i){const e=i?.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function c2e(i){return i?.type==="feature"&&!i.url&&i.source?.type==="memory"}function FYi(i){return(i?.type==="feature"||i?.type==="subtype-group")&&i.source?.type==="feature-layer"}async function jEt(i,e){const t=no?.findServerInfo(i);if(t?.currentVersion!=null)return t.owningSystemUrl||null;const r=i.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const n=`${i.substring(0,r)}/rest/info`,s=e!=null?e.signal:null,{data:o}=await zi(n,{query:{f:"json"},responseType:"json",signal:s});return o?.owningSystemUrl||null}function kYi(i){if(!("capabilities"in i))return!1;switch(i.type){case"catalog":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function tT(i){return kYi(i)?"effectiveCapabilities"in i?i.effectiveCapabilities:i.capabilities:null}function LYi(i){if(!("editingEnabled"in i))return!1;switch(i.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function GEt(i){return!!LYi(i)&&("effectiveEditingEnabled"in i?i.effectiveEditingEnabled:i.editingEnabled)}const NYi=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),$Yi=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function BYi(i){return i.layerContainerType==="basemap"?NYi:i.layerContainerType==="operational-layers"?$Yi:null}function jYi(i,e){if(e.restrictedWebMapWriting){const t=BYi(e);return t==null||t.has(i.type)&&!c2e(i)}return!0}function GYi(i,e){if(e)if(c2e(i)){const t=uS("featureCollection.layers",e),r=t?.[0]?.layerDefinition;r&&Irt(i,r)}else i.type!=="group"&&Irt(i,e)}function Irt(i,e){"maxScale"in i&&(e.maxScale=Ive(i.maxScale)??void 0),"minScale"in i&&(e.minScale=Ive(i.minScale)??void 0)}function UYi(i,e){if(GYi(i,e),e&&(e.id=i.id,"blendMode"in i&&(e.blendMode=i.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=Ive(i.opacity)??void 0,e.title=i.title||"Layer",e.visibility=i.visible,"legendEnabled"in i&&i.type!=="wmts"))if(c2e(i)){const t=e.featureCollection;t&&(t.showLegend=i.legendEnabled)}else e.showLegend=i.legendEnabled}function _5e(i,e,t){if(!i.persistenceEnabled)return null;if(!("write"in i)||!i.write)return t?.messages&&t.messages.push(new qe("layer:unsupported",`Layers (${i.title}, ${i.id}) of type '${i.declaredClass}' cannot be persisted`,{layer:i})),null;if(c2e(i)&&!i.isTable)e=i.resourceInfo;else if(jYi(i,t)){const r={};return i.write(r,t)?r:null}return e!=null&&UYi(i,e=li(e)),e}var HZ;let zYi=0;const VYi="esri.Basemap";let mw=HZ=class extends S0(ef){constructor(i){super(i),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+zYi++,this.baseLayers=new dr,this.referenceLayers=new dr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&di.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},t=r=>{r.parent=null};this.addHandles([this.baseLayers.on("after-add",r=>e(r.item)),this.referenceLayers.on("after-add",r=>e(r.item)),this.baseLayers.on("after-remove",r=>t(r.item)),this.referenceLayers.on("after-remove",r=>t(r.item))])}initialize(){this.when().catch(i=>{di.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,i)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const i=this.baseLayers.toArray();for(const t of i)t.destroy();const e=this.referenceLayers.toArray();for(const t of e)t.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=zo(this.portalItem)}normalizeCtorArgs(i){return i&&"resourceInfo"in i&&(this._set("resourceInfo",i.resourceInfo),delete(i={...i}).resourceInfo),i}set baseLayers(i){this._set("baseLayers",ay(i,this._get("baseLayers")))}_writeBaseLayers(i,e,t){const r=[];i&&(t={...t,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=_5e(n,t.webmap?t.webmap.getLayerJSONFromResourceInfo(n):null,t);s!=null&&r.push(s)}),this.referenceLayers.forEach(n=>{const s=_5e(n,t.webmap?t.webmap.getLayerJSONFromResourceInfo(n):null,t);s!=null&&(n.type!=="scene"&&(s.isReference=!0),r.push(s))})),e.baseMapLayers=r}set referenceLayers(i){this._set("referenceLayers",ay(i,this._get("referenceLayers")))}writeTitle(i,e){e.title=i||"Basemap"}load(i){return this.addResolvingPromise(this._loadFromSource(i)),Promise.resolve(this)}loadAll(){return VB(this,i=>{i(this.baseLayers,this.referenceLayers)})}clone(){const i={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>dve(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>dve(e)?e.clone():e)};return this.loaded&&(i.loadStatus="loaded"),new HZ({resourceInfo:this.resourceInfo}).set(i)}read(i,e){this.resourceInfo||this._set("resourceInfo",{data:i,context:e}),super.read(i,e)}write(i,e){return i=i||{},e?.origin||(e={origin:"web-map",...e}),super.write(i,e),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(i.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(t=>{const r=li(t);return r.url&&Mx(r.url)&&(r.url=`https:${r.url}`),r.templateUrl&&Mx(r.templateUrl)&&(r.templateUrl=`https:${r.templateUrl}`),r})),i}async _loadFromSource(i){const{resourceInfo:e,portalItem:t,style:r}=this;hn(i);const n=[];if(e){const s=e.context?e.context.url:null;if(n.push(this._loadLayersFromJSON(e.data,s,i)),e.data.id&&!e.data.title){const o=e.data.id;n.push(OYi(o).then(a=>{a&&this.read({title:a},e.context)}))}}else t?n.push(this._loadFromItem(t,i)):r&&n.push(this._loadFromStylesService(r,i));await Promise.all(n)}async _loadLayersFromJSON(i,e,t){const r=this.resourceInfo?.context,n=this.portalItem?.portal||r?.portal||null,s=WYi[r?.origin||""]??"web-map",{populateOperationalLayers:o}=await Promise.resolve().then(()=>T8t),a=[];if(hn(t),i.baseMapLayers&&Array.isArray(i.baseMapLayers)){const l={context:{...r,origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},u=p=>s==="web-scene"&&p.layerType==="ArcGISSceneServiceLayer"||p.isReference,c=o(this.baseLayers,i.baseMapLayers.filter(p=>!u(p)),l);a.push(c);const h=o(this.referenceLayers,i.baseMapLayers.filter(u),l);a.push(h)}await Promise.allSettled(a)}async _loadFromItem(i,e){const t=await i.load(e),r=await t.fetchData("json",e),n=Yo(i.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:HYi[i.type||""]??"web-map",portal:i.portal||Bu.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:i.title,thumbnailUrl:i.thumbnailUrl},{origin:"portal-item",portal:i.portal||Bu.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}async _loadFromStylesService(i,e){const t=`${i.serviceUrl}/${i.id}`,r=(await zi(t,{query:{language:i.getLanguageParamValue(),places:i.places,worldview:i.worldview},signal:e?.signal})).data,n=Yo(t);return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:"web-map",url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(i){const e=v5e[i];return e?e.itemId?new HZ({portalItem:{id:e.itemId,portal:{url:"https://www.arcgis.com"}}}):HZ.fromJSON(e,{origin:e.is3d?"web-scene":"web-map"}):null}};x([D({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(i,e,t,r){this._writeBaseLayers(i,e,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:dr}},writer(i,e,t,r){this._writeBaseLayers(i,e,r)}}}}}})],mw.prototype,"baseLayers",null),x([D({type:String,json:{origins:{"web-scene":{write:!0}}}})],mw.prototype,"id",void 0),x([D({type:yg})],mw.prototype,"portalItem",void 0),x([D()],mw.prototype,"referenceLayers",null),x([D({readOnly:!0})],mw.prototype,"resourceInfo",void 0),x([D({type:Xi})],mw.prototype,"spatialReference",void 0),x([D({type:RYi})],mw.prototype,"style",void 0),x([D()],mw.prototype,"thumbnailUrl",void 0),x([D({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],mw.prototype,"title",void 0),x([ur("title")],mw.prototype,"writeTitle",null),mw=HZ=x([Qe(VYi)],mw);const HYi={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},WYi={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},kV=mw,qYi=Object.freeze(Object.defineProperty({__proto__:null,default:kV},Symbol.toStringTag,{value:"Module"})),Uve={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function UEt(i){return!!Uve[i]||!!Uve[i.toLowerCase()]}function Eze(i){return Uve[i]??Uve[i.toLowerCase()]}function YYi(i){return[...Eze(i)]}function i3e(i,e,t){t<0&&++t,t>1&&--t;const r=6*t;return r<1?i+(e-i)*r:2*t<1?e:3*t<2?i+(e-i)*(2/3-t)*6:i}function zEt(i,e,t,r=1){const n=(i%360+360)%360/360,s=t<=.5?t*(e+1):t+e-t*e,o=2*t-s;return[Math.round(255*i3e(o,s,n+1/3)),Math.round(255*i3e(o,s,n)),Math.round(255*i3e(o,s,n-1/3)),r]}function XYi(i){const e=i.length>5,t=e?8:4,r=(1<>=t,a[3]=n*l/255),l=o&r,o>>=t,a[2]=n*l,l=o&r,o>>=t,a[1]=n*l,l=o&r,o>>=t,a[0]=n*l,a}function gr(){return[0,0,0]}function Ef(i){return[i[0],i[1],i[2]]}function Do(i,e,t){return[i,e,t]}function sW(i,e=gr()){const t=Math.min(3,i.length);for(let r=0;r0&&(s=1/Math.sqrt(s),i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s),i}function yE(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function qC(i,e,t){const r=e[0],n=e[1],s=e[2],o=t[0],a=t[1],l=t[2];return i[0]=n*l-s*a,i[1]=s*o-r*l,i[2]=r*a-n*o,i}function lW(i,e,t,r){const n=e[0],s=e[1],o=e[2];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i[2]=o+r*(t[2]-o),i}function sXi(i,e,t,r,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return i[0]=e[0]*a+t[0]*l+r[0]*u+n[0]*c,i[1]=e[1]*a+t[1]*l+r[1]*u+n[1]*c,i[2]=e[2]*a+t[2]*l+r[2]*u+n[2]*c,i}function oXi(i,e,t,r,n,s){const o=1-s,a=o*o,l=s*s,u=a*o,c=3*s*a,h=3*l*o,p=l*s;return i[0]=e[0]*u+t[0]*c+r[0]*h+n[0]*p,i[1]=e[1]*u+t[1]*c+r[1]*h+n[1]*p,i[2]=e[2]*u+t[2]*c+r[2]*h+n[2]*p,i}function aXi(i,e){e=e||1;const t=sae,r=2*t()*Math.PI,n=2*t()-1,s=Math.sqrt(1-n*n)*e;return i[0]=Math.cos(r)*s,i[1]=Math.sin(r)*s,i[2]=n*e,i}function c0(i,e,t){const r=e[0],n=e[1],s=e[2];return i[0]=t[0]*r+t[4]*n+t[8]*s+t[12],i[1]=t[1]*r+t[5]*n+t[9]*s+t[13],i[2]=t[2]*r+t[6]*n+t[10]*s+t[14],i}function c3(i,e,t){const r=e[0],n=e[1],s=e[2];return i[0]=r*t[0]+n*t[3]+s*t[6],i[1]=r*t[1]+n*t[4]+s*t[7],i[2]=r*t[2]+n*t[5]+s*t[8],i}function Cv(i,e,t){const r=t[0],n=t[1],s=t[2],o=t[3],a=e[0],l=e[1],u=e[2],c=n*u-s*l,h=s*a-r*u,p=r*l-n*a,m=n*p-s*h,v=s*c-r*p,w=r*h-n*c,S=2*o;return i[0]=a+c*S+2*m,i[1]=l+h*S+2*v,i[2]=u+p*S+2*w,i}function lXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[0],s[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),s[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function uXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),s[1]=n[1],s[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function cXi(i,e,t,r){const n=[],s=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],s[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),s[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),s[2]=n[2],i[0]=s[0]+t[0],i[1]=s[1]+t[1],i[2]=s[2]+t[2],i}function hXi(i,e){ly(Art,i),ly(Mrt,e);const t=yE(Art,Mrt);return t>1?0:t<-1?Math.PI:Math.acos(t)}const Art=gr(),Mrt=gr();function dXi(i){return"vec3("+i[0]+", "+i[1]+", "+i[2]+")"}function _F(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]}function pXi(i,e){if(i===e)return!0;const t=i[0],r=i[1],n=i[2],s=e[0],o=e[1],a=e[2],l=c_();return Math.abs(t-s)<=l*Math.max(1,Math.abs(t),Math.abs(s))&&Math.abs(r-o)<=l*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-a)<=l*Math.max(1,Math.abs(n),Math.abs(a))}function ZEt(i,e,t){const r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];let o=r*r+n*n+s*s;return o>0?(o=1/Math.sqrt(o),i[0]=r*o,i[1]=n*o,i[2]=s*o,i):(i[0]=0,i[1]=0,i[2]=0,i)}const O1=uh,fXi=h2e,mXi=Ene,QEt=hR,w5e=aW,eIt=yp,tIt=d2e;Object.freeze(Object.defineProperty({__proto__:null,abs:oW,add:hl,angle:hXi,bezier:oXi,ceil:tXi,copy:Px,cross:qC,direction:ZEt,dist:QEt,distance:hR,div:mXi,divide:Ene,dot:yE,equals:pXi,exactEquals:_F,floor:iXi,hermite:sXi,inverse:Aze,len:eIt,length:yp,lerp:lW,max:Hve,min:Vve,mul:fXi,multiply:h2e,negate:nXi,normalize:ly,random:aXi,rotateX:lXi,rotateY:uXi,rotateZ:cXi,round:rXi,scale:Gc,scaleAndAdd:gb,set:Zo,sign:KEt,sqrDist:w5e,sqrLen:tIt,squaredDistance:aW,squaredLength:d2e,str:dXi,sub:O1,subtract:uh,transformMat3:c3,transformMat4:c0,transformQuat:Cv},Symbol.toStringTag,{value:"Module"}));const Ort=new Float32Array(1);function gXi(i){--i;for(let e=1;e<32;e<<=1)i|=i>>e;return i+1}function uu(i,e,t){return Math.min(Math.max(i,e),t)}function x5e(i){return i--,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,++i}function Pz(i,e,t){return i+(e-i)*t}function Prt(i,e,t,r,n){return Pz(r,n,(i-e)/(t-e))}function Rx(i){return i*Math.PI/180}function yb(i){return 180*i/Math.PI}function Mze(i){return Math.acos(uu(i,-1,1))}function iIt(i){return Math.asin(uu(i,-1,1))}function W8(i,e,t=1e-6){return i===e?!0:!Number.isFinite(i)||!Number.isFinite(e)?!1:(i>e?i-e:e-i)<=t}const Wve=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function yXi(i){return Wve.setFloat64(0,i),Wve.getBigInt64(0)}function vXi(i){return Wve.setBigInt64(0,i),Wve.getFloat64(0)}const r3e=BigInt("1000000");_Xi(1);function _Xi(i){const e=yXi(i=Math.abs(i)),t=vXi(e<=r3e?r3e:e-r3e);return Math.abs(i-t)}function Rrt(i){return rIt(Math.max(-bF,Math.min(i,bF)))}function rIt(i){return Ort[0]=i,Ort[0]}function Drt(i,e){const t=yp(i),r=iIt(i[2]/t),n=Math.atan2(i[1]/t,i[0]/t);return Zo(e,t,r,n),e}function Frt(i){const e=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],t=i[3]*i[3]+i[4]*i[4]+i[5]*i[5],r=i[6]*i[6]+i[7]*i[7]+i[8]*i[8];return!(W8(e,1)&&W8(t,1)&&W8(r,1))}const bF=rIt(34028234663852886e22);function Lce(i){return uu(r2e(i),0,255)}function Nce(i,e,t){return i=Number(i),isNaN(i)?t:it?t:i}function $ce(i,e){const t=i.toString(16).padStart(2,"0");return e?t.substring(0,1):t}let Yfe=class zm{static blendColors(e,t,r,n=new zm){return n.r=Math.round(e.r+(t.r-e.r)*r),n.g=Math.round(e.g+(t.g-e.g)*r),n.b=Math.round(e.b+(t.b-e.b)*r),n.a=e.a+(t.a-e.a)*r,n._sanitize()}static fromRgb(e,t){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const n=r[2].split(/\s*,\s*/),s=r[1];if(s==="rgb"&&n.length===3||s==="rgba"&&n.length===4){const o=n[0];if(o.charAt(o.length-1)==="%"){const a=n.map(l=>2.56*parseFloat(l));return n.length===4&&(a[3]=parseFloat(n[3])),zm.fromArray(a,t)}return zm.fromArray(n.map(a=>parseFloat(a)),t)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return zm.fromArray(zEt(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),t)}return null}static fromHex(e,t=new zm){if(e[0]!=="#"||isNaN(+`0x${e.substring(1)}`))return null;switch(e.length){case 4:case 5:{const r=parseInt(e.substring(1,2),16),n=parseInt(e.substring(2,3),16),s=parseInt(e.substring(3,4),16),o=e.length===5?15:parseInt(e.substring(4),16);return zm.fromArray([r+16*r,n+16*n,s+16*s,(o+16*o)/255],t)}case 7:case 9:{const r=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),o=e.length===7?255:parseInt(e.substring(7),16);return zm.fromArray([r,n,s,o/255],t)}default:return null}}static fromArray(e,t=new zm){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=UEt(e)?Eze(e):null;return r&&zm.fromArray(r,t)||zm.fromRgb(e,t)||zm.fromHex(e,t)}static fromJSON(e){return e!=null?new zm([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return e!=null?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return e!=null?[e.r/255,e.g/255,e.b/255,e.a!=null?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return typeof e=="string"?zm.fromString(e,this):Array.isArray(e)?zm.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof zm||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,r=e?.digits??6,n=r===3||r===4,s=r===4||r===8,o=`#${$ce(this.r,n)}${$ce(this.g,n)}${$ce(this.b,n)}${s?$ce(Math.round(255*this.a),n):""}`;return t?o.toUpperCase():o}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=zm.AlphaMode.ALWAYS){const t=Lce(this.r),r=Lce(this.g),n=Lce(this.b);return e===zm.AlphaMode.ALWAYS||this.a!==1?[t,r,n,Lce(255*this.a)]:[t,r,n]}clone(){return new zm(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return e!=null&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(Nce(this.r,0,255)),this.g=Math.round(Nce(this.g,0,255)),this.b=Math.round(Nce(this.b,0,255)),this.a=Nce(this.a,0,1),this}_set(e,t,r,n){this.r=e,this.g=t,this.b=r,this.a=n}};Yfe.prototype.declaredClass="esri.Color",function(i){var e;(e=i.AlphaMode||(i.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Yfe||(Yfe={}));const jr=Yfe;function uW(i,e,t=!1){let{hasM:r,hasZ:n}=i;Array.isArray(e)?e.length!==4||r||n?e.length===3&&t&&!r?(n=!0,r=!1):e.length===3&&r&&n&&(r=!1,n=!1):(r=!0,n=!0):(n=!n&&e.hasZ&&(!r||e.hasM),r=!r&&e.hasM&&(!n||e.hasZ)),i.hasZ=n,i.hasM=r}var S5e;function krt(i){return(e,t)=>e==null?t:t==null?e:i(e,t)}function bXi(i){return i&&(i.declaredClass==="esri.geometry.SpatialReference"||i.wkid!=null)}let n4=S5e=class extends Nr{constructor(...i){super(...i),this.points=[],this.type="multipoint"}normalizeCtorArgs(i,e){if(!i&&!e)return{};const t={};Array.isArray(i)?(t.points=i,t.spatialReference=e):bXi(i)?t.spatialReference=i:(i.points&&(t.points=i.points),i.spatialReference&&(t.spatialReference=i.spatialReference),i.hasZ&&(t.hasZ=i.hasZ),i.hasM&&(t.hasM=i.hasM));const r=t.points?.[0];return r&&(t.hasZ===void 0&&t.hasM===void 0?(t.hasZ=r.length>2,t.hasM=!1):t.hasZ===void 0?t.hasZ=r.length>3:t.hasM===void 0&&(t.hasM=r.length>3)),t}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const i=this.points;if(!i.length)return null;const e=new hr,t=this.hasZ,r=this.hasM,n=t?3:2,s=i[0],o=krt(Math.min),a=krt(Math.max);let l,u,c,h,[p,m]=s,[v,w]=s;for(let S=0,I=i.length;S2){const B=R[2];l=o(l,B),c=a(c,B)}if(r&&R.length>n){const B=R[n];u=o(u,B),h=a(h,B)}}return e.xmin=p,e.ymin=m,e.xmax=v,e.ymax=w,e.spatialReference=this.spatialReference,t?(e.zmin=l,e.zmax=c):(e.zmin=void 0,e.zmax=void 0),r?(e.mmin=u,e.mmax=h):(e.mmin=void 0,e.mmax=void 0),e}writePoints(i,e){e.points=li(this.points)}addPoint(i){return uW(this,i),Array.isArray(i)?this.points.push(i):this.points.push(i.toArray()),this.notifyChange("points"),this}clone(){const i={points:li(this.points),spatialReference:this.spatialReference};return this.hasZ&&(i.hasZ=!0),this.hasM&&(i.hasM=!0),new S5e(i)}getPoint(i){if(!this._validateInputs(i))return null;const e=this.points[i],t={x:e[0],y:e[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(t.z=e[2],r=3),this.hasM&&(t.m=e[r]),new $i(t)}removePoint(i){if(!this._validateInputs(i))return null;const e=new $i(this.points.splice(i,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(i,e){return this._validateInputs(i)?(uW(this,e),Array.isArray(e)||(e=e.toArray()),this.points[i]=e,this.notifyChange("points"),this):this}toJSON(i){return this.write({},i)}_validateInputs(i){return i!=null&&i>=0&&i2&&e.length>2){const n=i[2]-e[2];return Math.sqrt(t*t+r*r+n*n)}return Math.sqrt(t*t+r*r)}function wXi(i,e,t){const r=i[0]+t*(e[0]-i[0]),n=i[1]+t*(e[1]-i[1]);return i.length>2&&e.length>2?[r,n,i[2]+t*(e[2]-i[2])]:[r,n]}function xXi(i,e,t,r){return sIt(i,e,t[r],t[r+1])}function sIt(i,e,t,r){const[n,s]=e,[o,a]=t,[l,u]=r,c=l-o,h=u-a,p=c*c+h*h,m=(n-o)*c+(s-a)*h,v=Math.min(1,Math.max(0,m/p));return i[0]=o+c*v,i[1]=a+h*v,i}function SXi(i,e,t,r,n,s){let o=t,a=r,l=n-o,u=s-a;if(l!==0||u!==0){const c=((i-o)*l+(e-a)*u)/(l*l+u*u);c>1?(o=n,a=s):c>0&&(o+=l*c,a+=u*c)}return l=i-o,u=e-a,l*l+u*u}function oIt(i,e){return wXi(i,e,.5)}function q8(i,e=ig.X,t=ig.Y){let r=0;const n=i.length;let s=i[0];for(let o=0;o=0}function TXi(i){const e=i.length;return e>2&&UB(i[0],i[e-1])}function CXi(i){if("rings"in i&&(aIt(i),i.rings.length>0&&!q8(i.rings[0])))for(const e of i.rings)e.reverse()}function aIt(i){if("rings"in i)for(const e of i.rings)TXi(e)||e.push(e[0].slice())}function EXi(i){return i?i.hasZ?[i.xmax-i.xmin/2,i.ymax-i.ymin/2,i.zmax-i.zmin/2]:[i.xmax-i.xmin/2,i.ymax-i.ymin/2]:null}function p2e(i){return i?lIt(i.rings,i.hasZ??!1):null}function lIt(i,e){if(!i?.length)return null;const t=[],r=[],n=e?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let s=0,o=i.length;s{let a=s[2]-o[2];return a===0&&e&&(a=s[4]-o[4]),a}),r.length&&(t[0]=r[0][0],t[1]=r[0][1],e&&(t[2]=r[0][3]),(t[0]n[1]||t[1]n[3]||e&&(t[2]n[5]))&&(t.length=0)),!t.length){const s=i[0]&&i[0].length?AXi(i[0],e):null;if(!s)return null;t[0]=s[0],t[1]=s[1],e&&s.length>2&&(t[2]=s[2])}return t}function uIt(i,e,t){let r=0,n=0,s=0,o=0,a=0;const l=i.length?i[0][0]:0,u=i.length?i[0][1]:0,c=i.length&&e?i[0][2]:0;for(let p=0;p2&&v.length>2){const Q=I-c,re=$-c,ne=R*re-V*Q;s+=(Q+re)*ne,a+=ne}wt[1]&&(t[1]=w),St[3]&&(t[3]=S),e&&(It[5]&&(t[5]=I))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const h=[r/(6*o)+l,n/(6*o)+u,o];return e&&(t[4]===t[5]||a===0?(h[3]=(t[4]+t[5])/2,h[4]=0):(h[3]=s/(6*a)+c,h[4]=a)),h}function IXi(i,e){let t=0,r=0,n=0;i.nextPoint();const s=i.pathSize?i.x:0,o=i.pathSize?i.y:0;for(let a=0;ae[1]&&(e[1]=c),he[3]&&(e[3]=h)}return n>0&&(n*=-1),n?(n*=.5,[t/(6*n)+s,r/(6*n)+o,n]):null}function AXi(i,e){const t=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;for(let l=0,u=i.length;l2&&h.length>2&&(t[2]=c[2],r[2]=h[2]);const p=nIt(t,r);if(p){n+=p;const m=oIt(c,h);s+=p*m[0],o+=p*m[1],e&&m.length>2&&(a+=p*m[2])}}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:i.length?i[0]:null}function MXi(i){const{hasZ:e,totalSize:t}=i;if(t===0)return null;const r=[],n=[],s=e?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(i.reset();i.nextPath();){const o=uIt(wF(i),i.hasZ,s);o&&n.push(o)}if(n.sort((o,a)=>{let l=o[2]-a[2];return l===0&&e&&(l=o[4]-a[4]),l}),n.length&&(r[0]=n[0][0],r[1]=n[0][1],e&&(r[2]=n[0][3]),(r[0]s[1]||r[1]s[3]||e&&(r[2]s[5]))&&(r.length=0)),!r.length){i.reset(),i.nextPath();const o=i.pathSize?OXi(i):null;if(!o)return null;r[0]=o[0],r[1]=o[1],e&&o.length>2&&(r[2]=o[2])}return r}function OXi(i){const{hasZ:e}=i,t=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,a=0;if(i.nextPoint()){let l=i.x,u=i.y,c=i.z;for(;i.nextPoint();){const h=i.x,p=i.y,m=i.z;t[0]=l,t[1]=u,r[0]=h,r[1]=p,e&&(t[2]=c,r[2]=m);const v=nIt(t,r);if(v){n+=v;const w=oIt(t,r);s+=v*w[0],o+=v*w[1],e&&w.length>2&&(a+=v*w[2])}l=h,u=p,c=m}}return n>0?e?[s/n,o/n,a/n]:[s/n,o/n]:i.pathSize?(i.seekPathStart(),i.nextPoint(),[i.x,i.y]):null}const PXi=1e-6;function RXi(i){let e=0;for(i.reset();i.nextPath();)e+=i.getCurrentRingArea();if(ei[2]&&(i[2]=e[0]),e[1]i[3]&&(i[3]=e[1])}function T5e(i,e,t){if(e!=null)if("length"in e)E5e(e)?(t[0]=Math.min(i[0],e[0]),t[1]=Math.min(i[1],e[1]),t[2]=Math.max(i[2],e[2]),t[3]=Math.max(i[3],e[3])):e.length!==2&&e.length!==3||(t[0]=Math.min(i[0],e[0]),t[1]=Math.min(i[1],e[1]),t[2]=Math.max(i[2],e[0]),t[3]=Math.max(i[3],e[1]));else switch(e.type){case"extent":t[0]=Math.min(i[0],e.xmin),t[1]=Math.min(i[1],e.ymin),t[2]=Math.max(i[2],e.xmax),t[3]=Math.max(i[3],e.ymax);break;case"point":t[0]=Math.min(i[0],e.x),t[1]=Math.min(i[1],e.y),t[2]=Math.max(i[2],e.x),t[3]=Math.max(i[3],e.y)}else cIt(t,i)}function hIt(i){return i==null||i[0]>=i[2]?0:i[2]-i[0]}function dIt(i){return i==null||i[1]>=i[3]?0:i[3]-i[1]}function pIt(i){return hIt(i)*dIt(i)}function kXi(i,e,t){return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}function aae(i,e){return Math.max(e[0],i[0])<=Math.min(e[2],i[2])&&Math.max(e[1],i[1])<=Math.min(e[3],i[3])}function C5e(i,e){return e[0]>=i[0]&&e[2]<=i[2]&&e[1]>=i[1]&&e[3]<=i[3]}function Oze(i){return i?cIt(i,qve):Wo(qve)}function E5e(i){return i!=null&&i.length===4}function fIt(i,e){return E5e(i)&&E5e(e)?i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]:i===e}const qve=[1/0,1/0,-1/0,-1/0],LXi=[0,0,0,0];function mIt(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function gIt(i){return i.points!==void 0}function yIt(i){return i.x!==void 0&&i.y!==void 0}function vIt(i){return i.paths!==void 0}function _It(i){return i.rings!==void 0}function bIt(i){function e(t,r){return t==null?r:r==null?t:i(t,r)}return e}const Q5=bIt(Math.min),eF=bIt(Math.max);function gY(i,e){return vIt(e)?hW(i,e.paths,!1,!1):_It(e)?hW(i,e.rings,!1,!1):gIt(e)?Pze(i,e.points,!1,!1,!1,!1):mIt(e)?xIt(i,e):(yIt(e)&&(i[0]=e.x,i[1]=e.y,i[2]=e.x,i[3]=e.y),i)}function f2e(i){let e,t,r,n;for(i.reset(),e=r=1/0,t=n=-1/0;i.nextPath();){const s=wIt(i);e=Math.min(s[0],e),r=Math.min(s[1],r),t=Math.max(s[2],t),n=Math.max(s[3],n)}return Wo([e,r,t,n])}function wIt(i){let e,t,r,n;for(e=r=1/0,t=n=-1/0;i.nextPoint();)e=Math.min(i.x,e),r=Math.min(i.y,r),t=Math.max(i.x,t),n=Math.max(i.y,n);return Wo([e,r,t,n])}function jce(i,e){return vIt(e)?hW(i,e.paths,!0,!1):_It(e)?hW(i,e.rings,!0,!1):gIt(e)?Pze(i,e.points,!0,!1,!0,!1):mIt(e)?xIt(i,e,!0,!1,!0,!1):(yIt(e)&&(i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.x,i[4]=e.y,i[5]=e.z),i)}function hW(i,e,t,r){const n=t?3:2;if(!e.length||!e[0].length)return null;let s,o,a,l,[u,c]=e[0][0],[h,p]=e[0][0];for(let m=0;m2){const L=S[2];s=Q5(s,L),o=eF(o,L)}if(r&&S.length>n){const L=S[n];a=Q5(s,L),l=eF(o,L)}}}return t?r?(i[0]=u,i[1]=c,i[2]=s,i[3]=a,i[4]=h,i[5]=p,i[6]=o,i[7]=l,i.length=8,i):(i[0]=u,i[1]=c,i[2]=s,i[3]=h,i[4]=p,i[5]=o,i.length=6,i):r?(i[0]=u,i[1]=c,i[2]=a,i[3]=h,i[4]=p,i[5]=l,i.length=6,i):(i[0]=u,i[1]=c,i[2]=h,i[3]=p,i.length=4,i)}function xIt(i,e,t,r,n,s){const o=e.xmin,a=e.xmax,l=e.ymin,u=e.ymax;let c=e.zmin,h=e.zmax,p=e.mmin,m=e.mmax;return n?(c=c||0,h=h||0,s?(p=p||0,m=m||0,i[0]=o,i[1]=l,i[2]=c,i[3]=p,i[4]=a,i[5]=u,i[6]=h,i[7]=m,i):(i[0]=o,i[1]=l,i[2]=c,i[3]=a,i[4]=u,i[5]=h,i)):s?(p=p||0,m=m||0,i[0]=o,i[1]=l,i[2]=p,i[3]=a,i[4]=u,i[5]=m,i):(i[0]=o,i[1]=l,i[2]=a,i[3]=u,i)}function Pze(i,e,t,r,n,s){const o=t?3:2,a=r&&s,l=t&&n;if(!e.length||!e[0].length)return null;let u,c,h,p,[m,v]=e[0],[w,S]=e[0];for(let I=0;I2){const B=R[2];u=Q5(u,B),c=eF(c,B)}if(a&&R.length>o){const B=R[o];h=Q5(u,B),p=eF(c,B)}}return n?(u=u||0,c=c||0,s?(h=h||0,p=p||0,i[0]=m,i[1]=v,i[2]=u,i[3]=h,i[4]=w,i[5]=S,i[6]=c,i[7]=p,i):(i[0]=m,i[1]=v,i[2]=u,i[3]=w,i[4]=S,i[5]=c,i)):s?(h=h||0,p=p||0,i[0]=m,i[1]=v,i[2]=h,i[3]=w,i[4]=S,i[5]=p,i):(i[0]=m,i[1]=v,i[2]=w,i[3]=S,i)}function NXi(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function $Xi(i){return i.points!==void 0}function BXi(i){return i.x!==void 0&&i.y!==void 0}function jXi(i){return i.paths!==void 0}function GXi(i){return i.rings!==void 0}const Rze=[];function SIt(i,e,t,r){return{xmin:i,ymin:e,xmax:t,ymax:r}}function TIt(i,e,t,r,n,s){return{xmin:i,ymin:e,zmin:t,xmax:r,ymax:n,zmax:s}}function CIt(i,e,t,r,n,s){return{xmin:i,ymin:e,mmin:t,xmax:r,ymax:n,mmax:s}}function EIt(i,e,t,r,n,s,o,a){return{xmin:i,ymin:e,zmin:t,mmin:r,xmax:n,ymax:s,zmax:o,mmax:a}}function Dze(i,e=!1,t=!1){return e?t?EIt(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7]):TIt(i[0],i[1],i[2],i[3],i[4],i[5]):t?CIt(i[0],i[1],i[2],i[3],i[4],i[5]):SIt(i[0],i[1],i[2],i[3])}function I5e(i){return i?NXi(i)?i:BXi(i)?zXi(i):GXi(i)?Fze(i):jXi(i)?IIt(i):$Xi(i)?UXi(i):null:null}function UXi(i){const{hasZ:e,hasM:t,points:r}=i;return Dze(Pze(Rze,r,e??!1,t??!1),e,t)}function zXi(i){const{x:e,y:t,z:r,m:n}=i,s=n!=null;return r!=null?s?EIt(e,t,r,n,e,t,r,n):TIt(e,t,r,e,t,r):s?CIt(e,t,n,e,t,n):SIt(e,t,e,t)}function Fze(i){const{hasZ:e,hasM:t,rings:r}=i,n=hW(Rze,r,e??!1,t??!1);return n?Dze(n,e,t):null}function IIt(i){const{hasZ:e,hasM:t,paths:r}=i,n=hW(Rze,r,e??!1,t??!1);return n?Dze(n,e,t):null}var Xfe;function Lrt(i){return!Array.isArray(i[0])}let lI=Xfe=class extends Nr{static fromExtent(i){const e=i.clone().normalize(),t=i.spatialReference;let r=!1,n=!1;for(const o of e)o.hasZ&&(r=!0),o.hasM&&(n=!0);const s={rings:e.map(o=>{const a=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(r&&o.hasZ){const l=o.zmin+.5*(o.zmax-o.zmin);for(let u=0;u2,r=s.length>3):t===void 0?t=r?s.length>3:s.length>2:r===void 0&&(r=t?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:t,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const i=p2e(this);if(!i||isNaN(i[0])||isNaN(i[1])||this.hasZ&&isNaN(i[2]))return null;const e=new $i;return e.x=i[0],e.y=i[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=i[2]),e}get extent(){const{spatialReference:i}=this,e=Fze(this);if(!e)return null;const t=new hr(e);return t.spatialReference=i,t}get isSelfIntersecting(){return hYi(this.rings)}writeRings(i,e){e.rings=li(this.rings)}addRing(i){if(!i)return;const e=this.rings,t=e.length;if(Lrt(i)){const r=[];for(let n=0,s=i.length;nn===l&&s===u&&(o==null&&c==null||o===c)&&(a==null&&h==null||a===h);for(let n=0;nthis.hasZ?this.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y]):i,q8(e)}getPoint(i,e){if(!this._validateInputs(i,e))return null;const t=this.rings[i][e],r=this.hasZ,n=this.hasM;return r&&!n?new $i(t[0],t[1],t[2],void 0,this.spatialReference):n&&!r?new $i(t[0],t[1],void 0,t[2],this.spatialReference):r&&n?new $i(t[0],t[1],t[2],t[3],this.spatialReference):new $i(t[0],t[1],this.spatialReference)}insertPoint(i,e,t){return this._validateInputs(i,e,!0)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.rings[i].splice(e,0,t),this.notifyChange("rings"),this):this}removePoint(i,e){if(!this._validateInputs(i,e))return null;const t=new $i(this.rings[i].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),t}removeRing(i){if(!this._validateInputs(i,null))return null;const e=this.rings.splice(i,1)[0],t=this.spatialReference,r=e.map(n=>new $i(n,t));return this.notifyChange("rings"),r}setPoint(i,e,t){return this._validateInputs(i,e)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.rings[i][e]=t,this.notifyChange("rings"),this):this}_validateInputs(i,e,t=!1){if(i==null||i<0||i>=this.rings.length)return!1;if(e!=null){const r=this.rings[i];if(t&&(e<0||e>r.length)||!t&&(e<0||e>=r.length))return!1}return!0}toJSON(i){return this.write({},i)}};x([D({readOnly:!0})],lI.prototype,"cache",null),x([D({readOnly:!0})],lI.prototype,"centroid",null),x([D({readOnly:!0})],lI.prototype,"extent",null),x([D({readOnly:!0})],lI.prototype,"isSelfIntersecting",null),x([D({type:[[[Number]]],json:{write:{isRequired:!0}}})],lI.prototype,"rings",void 0),x([ur("rings")],lI.prototype,"writeRings",null),lI=Xfe=x([Qe("esri.geometry.Polygon")],lI),lI.prototype.toJSON.isDefaultToJSON=!0;const $s=lI;var A5e;function VXi(i){return!Array.isArray(i[0])}let s4=A5e=class extends Nr{constructor(...i){super(...i),this.paths=[],this.type="polyline"}normalizeCtorArgs(i,e){let t,r,n=null,s=null;return i&&!Array.isArray(i)?(n=i.paths??null,e||(i.spatialReference?e=i.spatialReference:i.paths||(e=i)),t=i.hasZ,r=i.hasM):n=i,n=n||[],e=e||Xi.WGS84,n.length&&n[0]?.[0]!=null&&typeof n[0][0]=="number"&&(n=[n]),s=n[0]?.[0],s&&(t===void 0&&r===void 0?(t=s.length>2,r=!1):t===void 0?t=!r&&s.length>3:r===void 0&&(r=!t&&s.length>3)),{paths:n,spatialReference:e,hasZ:t,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:i}=this,e=IIt(this);if(!e)return null;const t=new hr(e);return t.spatialReference=i,t}writePaths(i,e){e.paths=li(this.paths)}addPath(i){if(!i)return;const e=this.paths,t=e.length;if(VXi(i)){const r=[];for(let n=0,s=i.length;nnew $i(n,t));return this.notifyChange("paths"),r}removePoint(i,e){if(!this._validateInputs(i,e))return null;const t=new $i(this.paths[i].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),t}setPoint(i,e,t){return this._validateInputs(i,e)?(uW(this,t),Array.isArray(t)||(t=t.toArray()),this.paths[i][e]=t,this.notifyChange("paths"),this):this}_validateInputs(i,e,t=!1){if(i==null||i<0||i>=this.paths.length)return!1;if(e!=null){const r=this.paths[i];if(t&&(e<0||e>r.length)||!t&&(e<0||e>=r.length))return!1}return!0}toJSON(i){return this.write({},i)}};x([D({readOnly:!0})],s4.prototype,"cache",null),x([D({readOnly:!0})],s4.prototype,"extent",null),x([D({type:[[[Number]]],json:{write:{isRequired:!0}}})],s4.prototype,"paths",void 0),x([ur("paths")],s4.prototype,"writePaths",null),s4=A5e=x([Qe("esri.geometry.Polyline")],s4),s4.prototype.toJSON.isDefaultToJSON=!0;const lo=s4;function zd(i){return i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0}function xF(i){return i.points!==void 0}function dR(i){return i.x!==void 0&&i.y!==void 0}function e0(i){return i.paths!==void 0}function ed(i){return i.rings!==void 0}function Ro(i){return i==null?null:i instanceof Nr?i:dR(i)?$i.fromJSON(i):e0(i)?lo.fromJSON(i):ed(i)?$s.fromJSON(i):xF(i)?Oh.fromJSON(i):zd(i)?hr.fromJSON(i):null}function ah(i){return i?dR(i)?"esriGeometryPoint":e0(i)?"esriGeometryPolyline":ed(i)?"esriGeometryPolygon":zd(i)?"esriGeometryEnvelope":xF(i)?"esriGeometryMultipoint":null:null}const HXi={esriGeometryPoint:$i,esriGeometryPolyline:lo,esriGeometryPolygon:$s,esriGeometryEnvelope:hr,esriGeometryMultipoint:Oh};function WXi(i){return i&&HXi[i]||null}const Vp=pa()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),Yve=pa()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),Ff={base:Nr,key:"type",typeMap:{extent:hr,multipoint:Oh,point:$i,polyline:lo,polygon:$s}};u3(Ff);const xs=i=>{let e=class extends i{clone(){const t=Kp(this);Of(t,"unable to clone instance of non-accessor class");const r=t.metadata,n=t.store,s={},o=new Map;for(const l in r){const u=r[l],c=n?.originOf(l),h=u.clonable;if(u.readOnly||h===!1||c!==Pn.USER&&c!==Pn.DEFAULTS&&c!==Pn.WEB_MAP&&c!==Pn.WEB_SCENE)continue;const p=this[l];let m=null;m=typeof h=="function"?h(p):h==="reference"?p:F4e(p),p!=null&&m==null||(c===Pn.DEFAULTS?o.set(l,m):s[l]=m)}const a=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const l=Kp(a)?.store;if(l)for(const[u,c]of o)l.set(u,c,Pn.DEFAULTS)}return a}};return e=x([Qe("esri.core.Clonable")],e),e};let qF=class extends xs(un){};qF=x([Qe("esri.core.Clonable")],qF);async function Ine(i,e){const{WhereClause:t}=await Promise.resolve().then(()=>D6r);return t.create(i,e)}function PS(i,e){return i!=null&&i!==""?e!=null&&e!==""?`(${i}) AND (${e})`:i:e}const Nrt=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);class WB extends Error{}class qXi extends WB{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class YXi extends WB{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class XXi extends WB{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Rz extends WB{}class AIt extends WB{constructor(e){super(`Invalid unit ${e}`)}}class cb extends WB{}class gD extends WB{constructor(){super("Zone is an abstract class")}}const fs="numeric",vE="short",yx="long",Xve={year:fs,month:fs,day:fs},MIt={year:fs,month:vE,day:fs},JXi={year:fs,month:vE,day:fs,weekday:vE},OIt={year:fs,month:yx,day:fs},PIt={year:fs,month:yx,day:fs,weekday:yx},RIt={hour:fs,minute:fs},DIt={hour:fs,minute:fs,second:fs},FIt={hour:fs,minute:fs,second:fs,timeZoneName:vE},kIt={hour:fs,minute:fs,second:fs,timeZoneName:yx},LIt={hour:fs,minute:fs,hourCycle:"h23"},NIt={hour:fs,minute:fs,second:fs,hourCycle:"h23"},$It={hour:fs,minute:fs,second:fs,hourCycle:"h23",timeZoneName:vE},BIt={hour:fs,minute:fs,second:fs,hourCycle:"h23",timeZoneName:yx},jIt={year:fs,month:fs,day:fs,hour:fs,minute:fs},GIt={year:fs,month:fs,day:fs,hour:fs,minute:fs,second:fs},UIt={year:fs,month:vE,day:fs,hour:fs,minute:fs},zIt={year:fs,month:vE,day:fs,hour:fs,minute:fs,second:fs},KXi={year:fs,month:vE,day:fs,weekday:vE,hour:fs,minute:fs},VIt={year:fs,month:yx,day:fs,hour:fs,minute:fs,timeZoneName:vE},HIt={year:fs,month:yx,day:fs,hour:fs,minute:fs,second:fs,timeZoneName:vE},WIt={year:fs,month:yx,day:fs,weekday:yx,hour:fs,minute:fs,timeZoneName:yx},qIt={year:fs,month:yx,day:fs,weekday:yx,hour:fs,minute:fs,second:fs,timeZoneName:yx};class zk{get type(){throw new gD}get name(){throw new gD}get ianaName(){return this.name}get isUniversal(){throw new gD}offsetName(e,t){throw new gD}formatOffset(e,t){throw new gD}offset(e){throw new gD}equals(e){throw new gD}get isValid(){throw new gD}}let n3e=null;class m2e extends zk{static get instance(){return n3e===null&&(n3e=new m2e),n3e}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return iAt(e,t,r)}formatOffset(e,t){return bie(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Jfe={};function ZXi(i){return Jfe[i]||(Jfe[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Jfe[i]}const QXi={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function eJi(i,e){const t=i.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,n,s,o,a,l,u,c]=r;return[o,n,s,a,l,u,c]}function tJi(i,e){const t=i.formatToParts(e),r=[];for(let n=0;n=0?v:1e3+v,(p-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let $rt={};function iJi(i,e={}){const t=JSON.stringify([i,e]);let r=$rt[t];return r||(r=new Intl.ListFormat(i,e),$rt[t]=r),r}let M5e={};function O5e(i,e={}){const t=JSON.stringify([i,e]);let r=M5e[t];return r||(r=new Intl.DateTimeFormat(i,e),M5e[t]=r),r}let P5e={};function rJi(i,e={}){const t=JSON.stringify([i,e]);let r=P5e[t];return r||(r=new Intl.NumberFormat(i,e),P5e[t]=r),r}let R5e={};function nJi(i,e={}){const{base:t,...r}=e,n=JSON.stringify([i,r]);let s=R5e[n];return s||(s=new Intl.RelativeTimeFormat(i,e),R5e[n]=s),s}let WZ=null;function sJi(){return WZ||(WZ=new Intl.DateTimeFormat().resolvedOptions().locale,WZ)}let Brt={};function oJi(i){let e=Brt[i];if(!e){const t=new Intl.Locale(i);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,Brt[i]=e}return e}function aJi(i){const e=i.indexOf("-x-");e!==-1&&(i=i.substring(0,e));const t=i.indexOf("-u-");if(t===-1)return[i];{let r,n;try{r=O5e(i).resolvedOptions(),n=i}catch{const l=i.substring(0,t);r=O5e(l).resolvedOptions(),n=l}const{numberingSystem:s,calendar:o}=r;return[n,s,o]}}function lJi(i,e,t){return(t||e)&&(i.includes("-u-")||(i+="-u"),t&&(i+=`-ca-${t}`),e&&(i+=`-nu-${e}`)),i}function uJi(i){const e=[];for(let t=1;t<=12;t++){const r=Sn.utc(2009,t,1);e.push(i(r))}return e}function cJi(i){const e=[];for(let t=1;t<=7;t++){const r=Sn.utc(2016,11,13+t);e.push(i(r))}return e}function Uce(i,e,t,r){const n=i.listingMode();return n==="error"?null:n==="en"?t(e):r(e)}function hJi(i){return i.numberingSystem&&i.numberingSystem!=="latn"?!1:i.numberingSystem==="latn"||!i.locale||i.locale.startsWith("en")||new Intl.DateTimeFormat(i.intl).resolvedOptions().numberingSystem==="latn"}class dJi{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...o}=r;if(!t||Object.keys(o).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=rJi(e,a)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):$ze(e,3);return cm(t,this.padTo)}}}class pJi{constructor(e,t,r){this.opts=r,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),a=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&$b.create(a).valid?(n=a,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=O5e(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:r}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class fJi{constructor(e,t,r){this.opts={style:"long",...r},!t&&eAt()&&(this.rtf=nJi(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):FJi(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const mJi={firstDay:1,minimalDays:4,weekend:[6,7]};class mh{static fromOpts(e){return mh.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){const o=e||df.defaultLocale,a=o||(s?"en-US":sJi()),l=t||df.defaultNumberingSystem,u=r||df.defaultOutputCalendar,c=D5e(n)||df.defaultWeekSettings;return new mh(a,l,u,c,o)}static resetCache(){WZ=null,M5e={},P5e={},R5e={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return mh.create(e,t,r,n)}constructor(e,t,r,n,s){const[o,a,l]=aJi(e);this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=r||l||null,this.weekSettings=n,this.intl=lJi(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=hJi(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:mh.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,D5e(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Uce(this,e,sAt,()=>{const r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=uJi(s=>this.extract(s,r,"month"))),this.monthsCache[n][e]})}weekdays(e,t=!1){return Uce(this,e,lAt,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=cJi(s=>this.extract(s,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return Uce(this,void 0,()=>uAt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Sn.utc(2016,11,13,9),Sn.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Uce(this,e,cAt,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Sn.utc(-40,1,1),Sn.utc(2017,1,1)].map(r=>this.extract(r,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t),s=n.formatToParts(),o=s.find(a=>a.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new dJi(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new pJi(e,this.intl,t)}relFormatter(e={}){return new fJi(this.intl,this.isEnglish(),e)}listFormatter(e={}){return iJi(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tAt()?oJi(this.locale):mJi}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let s3e=null;class If extends zk{static get utcInstance(){return s3e===null&&(s3e=new If(0)),s3e}static instance(e){return e===0?If.utcInstance:new If(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new If(v2e(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${bie(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${bie(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return bie(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class gJi extends zk{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function L5(i,e){if(tl(i)||i===null)return e;if(i instanceof zk)return i;if(_Ji(i)){const t=i.toLowerCase();return t==="default"?e:t==="local"||t==="system"?m2e.instance:t==="utc"||t==="gmt"?If.utcInstance:If.parseSpecifier(t)||$b.create(i)}else return Y8(i)?If.instance(i):typeof i=="object"&&"offset"in i&&typeof i.offset=="function"?i:new gJi(i)}let jrt=()=>Date.now(),Grt="system",Urt=null,zrt=null,Vrt=null,Hrt=60,Wrt,qrt=null;class df{static get now(){return jrt}static set now(e){jrt=e}static set defaultZone(e){Grt=e}static get defaultZone(){return L5(Grt,m2e.instance)}static get defaultLocale(){return Urt}static set defaultLocale(e){Urt=e}static get defaultNumberingSystem(){return zrt}static set defaultNumberingSystem(e){zrt=e}static get defaultOutputCalendar(){return Vrt}static set defaultOutputCalendar(e){Vrt=e}static get defaultWeekSettings(){return qrt}static set defaultWeekSettings(e){qrt=D5e(e)}static get twoDigitCutoffYear(){return Hrt}static set twoDigitCutoffYear(e){Hrt=e%100}static get throwOnInvalid(){return Wrt}static set throwOnInvalid(e){Wrt=e}static resetCaches(){mh.resetCache(),$b.resetCache()}}class $C{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const YIt=[0,31,59,90,120,151,181,212,243,273,304,334],XIt=[0,31,60,91,121,152,182,213,244,274,305,335];function cS(i,e){return new $C("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${i}, which is invalid`)}function kze(i,e,t){const r=new Date(Date.UTC(i,e-1,t));i<100&&i>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return n===0?7:n}function JIt(i,e,t){return t+(lae(i)?XIt:YIt)[e-1]}function KIt(i,e){const t=lae(i)?XIt:YIt,r=t.findIndex(s=>sAne(r,e,t)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:a,..._2e(i)}}function Yrt(i,e=4,t=1){const{weekYear:r,weekNumber:n,weekday:s}=i,o=Lze(kze(r,1,e),t),a=LV(r);let l=n*7+s-o-7+e,u;l<1?(u=r-1,l+=LV(u)):l>a?(u=r+1,l-=LV(r)):u=r;const{month:c,day:h}=KIt(u,l);return{year:u,month:c,day:h,..._2e(i)}}function o3e(i){const{year:e,month:t,day:r}=i,n=JIt(e,t,r);return{year:e,ordinal:n,..._2e(i)}}function Xrt(i){const{year:e,ordinal:t}=i,{month:r,day:n}=KIt(e,t);return{year:e,month:r,day:n,..._2e(i)}}function Jrt(i,e){if(!tl(i.localWeekday)||!tl(i.localWeekNumber)||!tl(i.localWeekYear)){if(!tl(i.weekday)||!tl(i.weekNumber)||!tl(i.weekYear))throw new Rz("Cannot mix locale-based week fields with ISO-based week fields");return tl(i.localWeekday)||(i.weekday=i.localWeekday),tl(i.localWeekNumber)||(i.weekNumber=i.localWeekNumber),tl(i.localWeekYear)||(i.weekYear=i.localWeekYear),delete i.localWeekday,delete i.localWeekNumber,delete i.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function yJi(i,e=4,t=1){const r=g2e(i.weekYear),n=hS(i.weekNumber,1,Ane(i.weekYear,e,t)),s=hS(i.weekday,1,7);return r?n?s?!1:cS("weekday",i.weekday):cS("week",i.weekNumber):cS("weekYear",i.weekYear)}function vJi(i){const e=g2e(i.year),t=hS(i.ordinal,1,LV(i.year));return e?t?!1:cS("ordinal",i.ordinal):cS("year",i.year)}function ZIt(i){const e=g2e(i.year),t=hS(i.month,1,12),r=hS(i.day,1,Kve(i.year,i.month));return e?t?r?!1:cS("day",i.day):cS("month",i.month):cS("year",i.year)}function QIt(i){const{hour:e,minute:t,second:r,millisecond:n}=i,s=hS(e,0,23)||e===24&&t===0&&r===0&&n===0,o=hS(t,0,59),a=hS(r,0,59),l=hS(n,0,999);return s?o?a?l?!1:cS("millisecond",n):cS("second",r):cS("minute",t):cS("hour",e)}function tl(i){return typeof i>"u"}function Y8(i){return typeof i=="number"}function g2e(i){return typeof i=="number"&&i%1===0}function _Ji(i){return typeof i=="string"}function bJi(i){return Object.prototype.toString.call(i)==="[object Date]"}function eAt(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tAt(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function wJi(i){return Array.isArray(i)?i:[i]}function Krt(i,e,t){if(i.length!==0)return i.reduce((r,n)=>{const s=[e(n),n];return r&&t(r[0],s[0])===r[0]?r:s},null)[1]}function xJi(i,e){return e.reduce((t,r)=>(t[r]=i[r],t),{})}function dW(i,e){return Object.prototype.hasOwnProperty.call(i,e)}function D5e(i){if(i==null)return null;if(typeof i!="object")throw new cb("Week settings must be an object");if(!hS(i.firstDay,1,7)||!hS(i.minimalDays,1,7)||!Array.isArray(i.weekend)||i.weekend.some(e=>!hS(e,1,7)))throw new cb("Invalid week settings");return{firstDay:i.firstDay,minimalDays:i.minimalDays,weekend:Array.from(i.weekend)}}function hS(i,e,t){return g2e(i)&&i>=e&&i<=t}function SJi(i,e){return i-e*Math.floor(i/e)}function cm(i,e=2){const t=i<0;let r;return t?r="-"+(""+-i).padStart(e,"0"):r=(""+i).padStart(e,"0"),r}function h5(i){if(!(tl(i)||i===null||i===""))return parseInt(i,10)}function NL(i){if(!(tl(i)||i===null||i===""))return parseFloat(i)}function Nze(i){if(!(tl(i)||i===null||i==="")){const e=parseFloat("0."+i)*1e3;return Math.floor(e)}}function $ze(i,e,t=!1){const r=10**e;return(t?Math.trunc:Math.round)(i*r)/r}function lae(i){return i%4===0&&(i%100!==0||i%400===0)}function LV(i){return lae(i)?366:365}function Kve(i,e){const t=SJi(e-1,12)+1,r=i+(e-t)/12;return t===2?lae(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function y2e(i){let e=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.millisecond);return i.year<100&&i.year>=0&&(e=new Date(e),e.setUTCFullYear(i.year,i.month-1,i.day)),+e}function Zrt(i,e,t){return-Lze(kze(i,1,e),t)+e-1}function Ane(i,e=4,t=1){const r=Zrt(i,e,t),n=Zrt(i+1,e,t);return(LV(i)-r+n)/7}function F5e(i){return i>99?i:i>df.twoDigitCutoffYear?1900+i:2e3+i}function iAt(i,e,t,r=null){const n=new Date(i),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const o={timeZoneName:e,...s},a=new Intl.DateTimeFormat(t,o).formatToParts(n).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function v2e(i,e){let t=parseInt(i,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,n=t<0||Object.is(t,-0)?-r:r;return t*60+n}function rAt(i){const e=Number(i);if(typeof i=="boolean"||i===""||Number.isNaN(e))throw new cb(`Invalid unit value ${i}`);return e}function Zve(i,e){const t={};for(const r in i)if(dW(i,r)){const n=i[r];if(n==null)continue;t[e(r)]=rAt(n)}return t}function bie(i,e){const t=Math.trunc(Math.abs(i/60)),r=Math.trunc(Math.abs(i%60)),n=i>=0?"+":"-";switch(e){case"short":return`${n}${cm(t,2)}:${cm(r,2)}`;case"narrow":return`${n}${t}${r>0?`:${r}`:""}`;case"techie":return`${n}${cm(t,2)}${cm(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function _2e(i){return xJi(i,["hour","minute","second","millisecond"])}const TJi=["January","February","March","April","May","June","July","August","September","October","November","December"],nAt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CJi=["J","F","M","A","M","J","J","A","S","O","N","D"];function sAt(i){switch(i){case"narrow":return[...CJi];case"short":return[...nAt];case"long":return[...TJi];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const oAt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],aAt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],EJi=["M","T","W","T","F","S","S"];function lAt(i){switch(i){case"narrow":return[...EJi];case"short":return[...aAt];case"long":return[...oAt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const uAt=["AM","PM"],IJi=["Before Christ","Anno Domini"],AJi=["BC","AD"],MJi=["B","A"];function cAt(i){switch(i){case"narrow":return[...MJi];case"short":return[...AJi];case"long":return[...IJi];default:return null}}function OJi(i){return uAt[i.hour<12?0:1]}function PJi(i,e){return lAt(e)[i.weekday-1]}function RJi(i,e){return sAt(e)[i.month-1]}function DJi(i,e){return cAt(e)[i.year<0?0:1]}function FJi(i,e,t="always",r=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(i)===-1;if(t==="auto"&&s){const h=i==="days";switch(e){case 1:return h?"tomorrow":`next ${n[i][0]}`;case-1:return h?"yesterday":`last ${n[i][0]}`;case 0:return h?"today":`this ${n[i][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=a===1,u=n[i],c=r?l?u[1]:u[2]||u[1]:l?n[i][0]:i;return o?`${a} ${c} ago`:`in ${a} ${c}`}function Qrt(i,e){let t="";for(const r of i)r.literal?t+=r.val:t+=e(r.val);return t}const kJi={D:Xve,DD:MIt,DDD:OIt,DDDD:PIt,t:RIt,tt:DIt,ttt:FIt,tttt:kIt,T:LIt,TT:NIt,TTT:$It,TTTT:BIt,f:jIt,ff:UIt,fff:VIt,ffff:WIt,F:GIt,FF:zIt,FFF:HIt,FFFF:qIt};class Ov{static create(e,t={}){return new Ov(e,t)}static parseFormat(e){let t=null,r="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n||a===t?r+=a:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=a,t=a)}return r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return kJi[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return cm(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,v)=>this.loc.extract(e,m,v),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",a=()=>r?OJi(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(m,v)=>r?RJi(e,m):s(v?{month:m}:{month:m,day:"numeric"},"month"),u=(m,v)=>r?PJi(e,m):s(v?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),c=m=>{const v=Ov.macroTokenToFormatOpts(m);return v?this.formatWithSystemDefault(e,v):m},h=m=>r?DJi(e,m):s({era:m},"era"),p=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return c(m)}};return Qrt(Ov.parseFormat(t),p)}formatDurationFromString(e,t){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=l=>u=>{const c=r(u);return c?this.num(l.get(c),u.length):u},s=Ov.parseFormat(t),o=s.reduce((l,{literal:u,val:c})=>u?l:l.concat(c),[]),a=e.shiftTo(...o.map(r).filter(l=>l));return Qrt(s,n(a))}}const hAt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yY(...i){const e=i.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function vY(...i){return e=>i.reduce(([t,r,n],s)=>{const[o,a,l]=s(e,n);return[{...t,...o},a||r,l]},[{},null,1]).slice(0,2)}function _Y(i,...e){if(i==null)return[null,null];for(const[t,r]of e){const n=t.exec(i);if(n)return r(n)}return[null,null]}function dAt(...i){return(e,t)=>{const r={};let n;for(n=0;nm!==void 0&&(v||m&&c)?-m:m;return[{years:p(NL(t)),months:p(NL(r)),weeks:p(NL(n)),days:p(NL(s)),hours:p(NL(o)),minutes:p(NL(a)),seconds:p(NL(l),l==="-0"),milliseconds:p(Nze(u),h)}]}const YJi={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Gze(i,e,t,r,n,s,o){const a={year:e.length===2?F5e(h5(e)):h5(e),month:nAt.indexOf(t)+1,day:h5(r),hour:h5(n),minute:h5(s)};return o&&(a.second=h5(o)),i&&(a.weekday=i.length>3?oAt.indexOf(i)+1:aAt.indexOf(i)+1),a}const XJi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function JJi(i){const[,e,t,r,n,s,o,a,l,u,c,h]=i,p=Gze(e,n,r,t,s,o,a);let m;return l?m=YJi[l]:u?m=0:m=v2e(c,h),[p,new If(m)]}function KJi(i){return i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const ZJi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,QJi=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,eKi=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function ent(i){const[,e,t,r,n,s,o,a]=i;return[Gze(e,n,r,t,s,o,a),If.utcInstance]}function tKi(i){const[,e,t,r,n,s,o,a]=i;return[Gze(e,a,t,r,n,s,o),If.utcInstance]}const iKi=yY(NJi,jze),rKi=yY($Ji,jze),nKi=yY(BJi,jze),sKi=yY(fAt),gAt=vY(VJi,bY,uae,cae),oKi=vY(jJi,bY,uae,cae),aKi=vY(GJi,bY,uae,cae),lKi=vY(bY,uae,cae);function uKi(i){return _Y(i,[iKi,gAt],[rKi,oKi],[nKi,aKi],[sKi,lKi])}function cKi(i){return _Y(KJi(i),[XJi,JJi])}function hKi(i){return _Y(i,[ZJi,ent],[QJi,ent],[eKi,tKi])}function dKi(i){return _Y(i,[WJi,qJi])}const pKi=vY(bY);function fKi(i){return _Y(i,[HJi,pKi])}const mKi=yY(UJi,zJi),gKi=yY(mAt),yKi=vY(bY,uae,cae);function vKi(i){return _Y(i,[mKi,gAt],[gKi,yKi])}const tnt="Invalid Duration",yAt={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},_Ki={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...yAt},l2=146097/400,aj=146097/4800,bKi={years:{quarters:4,months:12,weeks:l2/7,days:l2,hours:l2*24,minutes:l2*24*60,seconds:l2*24*60*60,milliseconds:l2*24*60*60*1e3},quarters:{months:3,weeks:l2/28,days:l2/4,hours:l2*24/4,minutes:l2*24*60/4,seconds:l2*24*60*60/4,milliseconds:l2*24*60*60*1e3/4},months:{weeks:aj/7,days:aj,hours:aj*24,minutes:aj*24*60,seconds:aj*24*60*60,milliseconds:aj*24*60*60*1e3},...yAt},n8=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],wKi=n8.slice(0).reverse();function yD(i,e,t=!1){const r={values:t?e.values:{...i.values,...e.values||{}},loc:i.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||i.conversionAccuracy,matrix:e.matrix||i.matrix};return new tc(r)}function vAt(i,e){let t=e.milliseconds??0;for(const r of wKi.slice(1))e[r]&&(t+=e[r]*i[r].milliseconds);return t}function int(i,e){const t=vAt(i,e)<0?-1:1;n8.reduceRight((r,n)=>{if(tl(e[n]))return r;if(r){const s=e[r]*t,o=i[n][r],a=Math.floor(s/o);e[n]+=a*t,e[r]-=a*o*t}return n},null),n8.reduce((r,n)=>{if(tl(e[n]))return r;if(r){const s=e[r]%1;e[r]-=s,e[n]+=s*i[r][n]}return n},null)}function xKi(i){const e={};for(const[t,r]of Object.entries(i))r!==0&&(e[t]=r);return e}class tc{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let r=t?bKi:_Ki;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||mh.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return tc.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new cb(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tc({values:Zve(e,tc.normalizeUnit),loc:mh.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Y8(e))return tc.fromMillis(e);if(tc.isDuration(e))return e;if(typeof e=="object")return tc.fromObject(e);throw new cb(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=dKi(e);return r?tc.fromObject(r,t):tc.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=fKi(e);return r?tc.fromObject(r,t):tc.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new cb("need to specify a reason the Duration is invalid");const r=e instanceof $C?e:new $C(e,t);if(df.throwOnInvalid)throw new XXi(r);return new tc({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new AIt(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?Ov.create(this.loc,r).formatDurationFromString(this,e):tnt}toHuman(e={}){if(!this.isValid)return tnt;const t=n8.map(r=>{const n=this.values[r];return tl(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=$ze(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Sn.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?vAt(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e),r={};for(const n of n8)(dW(t.values,n)||dW(this.values,n))&&(r[n]=t.get(n)+this.get(n));return yD(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=rAt(e(this.values[r],r));return yD(this,{values:t},!0)}get(e){return this[tc.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Zve(e,tc.normalizeUnit)};return yD(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r};return yD(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return int(this.matrix,e),yD(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=xKi(this.normalize().shiftToAll().toObject());return yD(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>tc.normalizeUnit(o));const t={},r={},n=this.toObject();let s;for(const o of n8)if(e.indexOf(o)>=0){s=o;let a=0;for(const u in r)a+=this.matrix[u][o]*r[u],r[u]=0;Y8(n[o])&&(a+=n[o]);const l=Math.trunc(a);t[o]=l,r[o]=(a*1e3-l*1e3)/1e3}else Y8(n[o])&&(r[o]=n[o]);for(const o in r)r[o]!==0&&(t[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return int(this.matrix,t),yD(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return yD(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(r,n){return r===void 0||r===0?n===void 0||n===0:r===n}for(const r of n8)if(!t(this.values[r],e.values[r]))return!1;return!0}}const lj="Invalid Interval";function SKi(i,e){return!i||!i.isValid?$p.invalid("missing or invalid start"):!e||!e.isValid?$p.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?$p.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(TJ).filter(o=>this.contains(o)).sort((o,a)=>o.toMillis()-a.toMillis()),r=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;r.push($p.fromDateTimes(n,a)),n=a,s+=1}return r}splitBy(e){const t=tc.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,n=1,s;const o=[];for(;rl*n));s=+a>+this.e?this.e:a,o.push($p.fromDateTimes(r,s)),r=s,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e=r?null:$p.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return $p.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((n,s)=>n.s-s.s).reduce(([n,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[n,s.union(o)]:[n.concat([s]),o]:[n,o],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],s=e.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...s),a=o.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?t=l.time:(t&&+t!=+l.time&&n.push($p.fromDateTimes(t,l.time)),t=null);return $p.merge(n)}difference(...e){return $p.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:lj}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Xve,t={}){return this.isValid?Ov.create(this.s.loc.clone(t),e).formatInterval(this):lj}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:lj}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:lj}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:lj}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:lj}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):tc.invalid(this.invalidReason)}mapEndpoints(e){return $p.fromDateTimes(e(this.s),e(this.e))}}class zce{static hasDST(e=df.defaultZone){const t=Sn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $b.isValidZone(e)}static normalizeZone(e){return L5(e,df.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||mh.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||mh.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||mh.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||mh.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||mh.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return mh.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return mh.create(t,null,"gregory").eras(e)}static features(){return{relative:eAt(),localeWeek:tAt()}}}function rnt(i,e){const t=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(i);return Math.floor(tc.fromMillis(r).as("days"))}function TKi(i,e,t){const r=[["years",(l,u)=>u.year-l.year],["quarters",(l,u)=>u.quarter-l.quarter+(u.year-l.year)*4],["months",(l,u)=>u.month-l.month+(u.year-l.year)*12],["weeks",(l,u)=>{const c=rnt(l,u);return(c-c%7)/7}],["days",rnt]],n={},s=i;let o,a;for(const[l,u]of r)t.indexOf(l)>=0&&(o=l,n[l]=u(i,e),a=s.plus(n),a>e?(n[l]--,i=s.plus(n),i>e&&(a=i,n[l]--,i=s.plus(n))):i=a);return[i,n,a,o]}function CKi(i,e,t,r){let[n,s,o,a]=TKi(i,e,t);const l=e-n,u=t.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);u.length===0&&(o0?tc.fromMillis(l,r).shiftTo(...u).plus(c):c}const Uze={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},nnt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},EKi=Uze.hanidec.replace(/[\[|\]]/g,"").split("");function IKi(i){let e=parseInt(i,10);if(isNaN(e)){e="";for(let t=0;t=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}function dT({numberingSystem:i},e=""){return new RegExp(`${Uze[i||"latn"]}${e}`)}const AKi="missing Intl.DateTimeFormat.formatToParts support";function Ic(i,e=t=>t){return{regex:i,deser:([t])=>e(IKi(t))}}const MKi=" ",_At=`[ ${MKi}]`,bAt=new RegExp(_At,"g");function OKi(i){return i.replace(/\./g,"\\.?").replace(bAt,_At)}function snt(i){return i.replace(/\./g,"").replace(bAt," ").toLowerCase()}function pT(i,e){return i===null?null:{regex:RegExp(i.map(OKi).join("|")),deser:([t])=>i.findIndex(r=>snt(t)===snt(r))+e}}function ont(i,e){return{regex:i,deser:([,t,r])=>v2e(t,r),groups:e}}function Vce(i){return{regex:i,deser:([e])=>e}}function PKi(i){return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function RKi(i,e){const t=dT(e),r=dT(e,"{2}"),n=dT(e,"{3}"),s=dT(e,"{4}"),o=dT(e,"{6}"),a=dT(e,"{1,2}"),l=dT(e,"{1,3}"),u=dT(e,"{1,6}"),c=dT(e,"{1,9}"),h=dT(e,"{2,4}"),p=dT(e,"{4,6}"),m=S=>({regex:RegExp(PKi(S.val)),deser:([I])=>I,literal:!0}),w=(S=>{if(i.literal)return m(S);switch(S.val){case"G":return pT(e.eras("short"),0);case"GG":return pT(e.eras("long"),0);case"y":return Ic(u);case"yy":return Ic(h,F5e);case"yyyy":return Ic(s);case"yyyyy":return Ic(p);case"yyyyyy":return Ic(o);case"M":return Ic(a);case"MM":return Ic(r);case"MMM":return pT(e.months("short",!0),1);case"MMMM":return pT(e.months("long",!0),1);case"L":return Ic(a);case"LL":return Ic(r);case"LLL":return pT(e.months("short",!1),1);case"LLLL":return pT(e.months("long",!1),1);case"d":return Ic(a);case"dd":return Ic(r);case"o":return Ic(l);case"ooo":return Ic(n);case"HH":return Ic(r);case"H":return Ic(a);case"hh":return Ic(r);case"h":return Ic(a);case"mm":return Ic(r);case"m":return Ic(a);case"q":return Ic(a);case"qq":return Ic(r);case"s":return Ic(a);case"ss":return Ic(r);case"S":return Ic(l);case"SSS":return Ic(n);case"u":return Vce(c);case"uu":return Vce(a);case"uuu":return Ic(t);case"a":return pT(e.meridiems(),0);case"kkkk":return Ic(s);case"kk":return Ic(h,F5e);case"W":return Ic(a);case"WW":return Ic(r);case"E":case"c":return Ic(t);case"EEE":return pT(e.weekdays("short",!1),1);case"EEEE":return pT(e.weekdays("long",!1),1);case"ccc":return pT(e.weekdays("short",!0),1);case"cccc":return pT(e.weekdays("long",!0),1);case"Z":case"ZZ":return ont(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return ont(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Vce(/[a-z_+-/]{1,256}?/i);case" ":return Vce(/[^\S\n\r]/);default:return m(S)}})(i)||{invalidReason:AKi};return w.token=i,w}const DKi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function FKi(i,e,t){const{type:r,value:n}=i;if(r==="literal"){const l=/^\s+$/.test(n);return{literal:!l,val:l?" ":n}}const s=e[r];let o=r;r==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let a=DKi[o];if(typeof a=="object"&&(a=a[s]),a)return{literal:!1,val:a}}function kKi(i){return[`^${i.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,i]}function LKi(i,e,t){const r=i.match(e);if(r){const n={};let s=1;for(const o in t)if(dW(t,o)){const a=t[o],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(n[a.token.val[0]]=a.deser(r.slice(s,s+l))),s+=l}return[r,n]}else return[r,{}]}function NKi(i){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,r;return tl(i.z)||(t=$b.create(i.z)),tl(i.Z)||(t||(t=new If(i.Z)),r=i.Z),tl(i.q)||(i.M=(i.q-1)*3+1),tl(i.h)||(i.h<12&&i.a===1?i.h+=12:i.h===12&&i.a===0&&(i.h=0)),i.G===0&&i.y&&(i.y=-i.y),tl(i.u)||(i.S=Nze(i.u)),[Object.keys(i).reduce((s,o)=>{const a=e(o);return a&&(s[a]=i[o]),s},{}),t,r]}let a3e=null;function $Ki(){return a3e||(a3e=Sn.fromMillis(1555555555555)),a3e}function BKi(i,e){if(i.literal)return i;const t=Ov.macroTokenToFormatOpts(i.val),r=SAt(t,e);return r==null||r.includes(void 0)?i:r}function wAt(i,e){return Array.prototype.concat(...i.map(t=>BKi(t,e)))}function xAt(i,e,t){const r=wAt(Ov.parseFormat(t),i),n=r.map(o=>RKi(o,i)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:r,invalidReason:s.invalidReason};{const[o,a]=kKi(n),l=RegExp(o,"i"),[u,c]=LKi(e,l,a),[h,p,m]=c?NKi(c):[null,null,void 0];if(dW(c,"a")&&dW(c,"H"))throw new Rz("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:l,rawMatches:u,matches:c,result:h,zone:p,specificOffset:m}}}function jKi(i,e,t){const{result:r,zone:n,specificOffset:s,invalidReason:o}=xAt(i,e,t);return[r,n,s,o]}function SAt(i,e){if(!i)return null;const r=Ov.create(e,i).dtFormatter($Ki()),n=r.formatToParts(),s=r.resolvedOptions();return n.map(o=>FKi(o,i,s))}const l3e="Invalid DateTime",ant=864e13;function Hce(i){return new $C("unsupported zone",`the zone "${i.name}" is not supported`)}function u3e(i){return i.weekData===null&&(i.weekData=Jve(i.c)),i.weekData}function c3e(i){return i.localWeekData===null&&(i.localWeekData=Jve(i.c,i.loc.getMinDaysInFirstWeek(),i.loc.getStartOfWeek())),i.localWeekData}function $L(i,e){const t={ts:i.ts,zone:i.zone,c:i.c,o:i.o,loc:i.loc,invalid:i.invalid};return new Sn({...t,...e,old:t})}function TAt(i,e,t){let r=i-e*60*1e3;const n=t.offset(r);if(e===n)return[r,e];r-=(n-e)*60*1e3;const s=t.offset(r);return n===s?[r,n]:[i-Math.min(n,s)*60*1e3,Math.max(n,s)]}function Wce(i,e){i+=e*60*1e3;const t=new Date(i);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function Kfe(i,e,t){return TAt(y2e(i),e,t)}function lnt(i,e){const t=i.o,r=i.c.year+Math.trunc(e.years),n=i.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...i.c,year:r,month:n,day:Math.min(i.c.day,Kve(r,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=tc.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=y2e(s);let[l,u]=TAt(a,t,i.zone);return o!==0&&(l+=o,u=i.zone.offset(l)),{ts:l,o:u}}function SJ(i,e,t,r,n,s){const{setZone:o,zone:a}=t;if(i&&Object.keys(i).length!==0||e){const l=e||a,u=Sn.fromObject(i,{...t,zone:l,specificOffset:s});return o?u:u.setZone(a)}else return Sn.invalid(new $C("unparsable",`the input "${n}" can't be parsed as ${r}`))}function qce(i,e,t=!0){return i.isValid?Ov.create(mh.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(i,e):null}function h3e(i,e){const t=i.c.year>9999||i.c.year<0;let r="";return t&&i.c.year>=0&&(r+="+"),r+=cm(i.c.year,t?6:4),e?(r+="-",r+=cm(i.c.month),r+="-",r+=cm(i.c.day)):(r+=cm(i.c.month),r+=cm(i.c.day)),r}function unt(i,e,t,r,n,s){let o=cm(i.c.hour);return e?(o+=":",o+=cm(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!t)&&(o+=":")):o+=cm(i.c.minute),(i.c.millisecond!==0||i.c.second!==0||!t)&&(o+=cm(i.c.second),(i.c.millisecond!==0||!r)&&(o+=".",o+=cm(i.c.millisecond,3))),n&&(i.isOffsetFixed&&i.offset===0&&!s?o+="Z":i.o<0?(o+="-",o+=cm(Math.trunc(-i.o/60)),o+=":",o+=cm(Math.trunc(-i.o%60))):(o+="+",o+=cm(Math.trunc(i.o/60)),o+=":",o+=cm(Math.trunc(i.o%60)))),s&&(o+="["+i.zone.ianaName+"]"),o}const CAt={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},GKi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},UKi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},EAt=["year","month","day","hour","minute","second","millisecond"],zKi=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],VKi=["year","ordinal","hour","minute","second","millisecond"];function HKi(i){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[i.toLowerCase()];if(!e)throw new AIt(i);return e}function cnt(i){switch(i.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return HKi(i)}}function hnt(i,e){const t=L5(e.zone,df.defaultZone),r=mh.fromObject(e),n=df.now();let s,o;if(tl(i.year))s=n;else{for(const u of EAt)tl(i[u])&&(i[u]=CAt[u]);const a=ZIt(i)||QIt(i);if(a)return Sn.invalid(a);const l=t.offset(n);[s,o]=Kfe(i,l,t)}return new Sn({ts:s,zone:t,loc:r,o})}function dnt(i,e,t){const r=tl(t.round)?!0:t.round,n=(o,a)=>(o=$ze(o,r||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,a)),s=o=>t.calendary?e.hasSame(i,o)?0:e.startOf(o).diff(i.startOf(o),o).get(o):e.diff(i,o).get(o);if(t.unit)return n(s(t.unit),t.unit);for(const o of t.units){const a=s(o);if(Math.abs(a)>=1)return n(a,o)}return n(i>e?-0:0,t.units[t.units.length-1])}function pnt(i){let e={},t;return i.length>0&&typeof i[i.length-1]=="object"?(e=i[i.length-1],t=Array.from(i).slice(0,i.length-1)):t=Array.from(i),[e,t]}class Sn{constructor(e){const t=e.zone||df.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new $C("invalid input"):null)||(t.isValid?null:Hce(t));this.ts=tl(e.ts)?df.now():e.ts;let n=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,s]=[e.old.c,e.old.o];else{const a=t.offset(this.ts);n=Wce(this.ts,a),r=Number.isNaN(n.year)?new $C("invalid input"):null,n=r?null:n,s=r?null:a}this._zone=t,this.loc=e.loc||mh.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new Sn({})}static local(){const[e,t]=pnt(arguments),[r,n,s,o,a,l,u]=t;return hnt({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static utc(){const[e,t]=pnt(arguments),[r,n,s,o,a,l,u]=t;return e.zone=If.utcInstance,hnt({year:r,month:n,day:s,hour:o,minute:a,second:l,millisecond:u},e)}static fromJSDate(e,t={}){const r=bJi(e)?e.valueOf():NaN;if(Number.isNaN(r))return Sn.invalid("invalid input");const n=L5(t.zone,df.defaultZone);return n.isValid?new Sn({ts:r,zone:n,loc:mh.fromObject(t)}):Sn.invalid(Hce(n))}static fromMillis(e,t={}){if(Y8(e))return e<-ant||e>ant?Sn.invalid("Timestamp out of range"):new Sn({ts:e,zone:L5(t.zone,df.defaultZone),loc:mh.fromObject(t)});throw new cb(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Y8(e))return new Sn({ts:e*1e3,zone:L5(t.zone,df.defaultZone),loc:mh.fromObject(t)});throw new cb("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=L5(t.zone,df.defaultZone);if(!r.isValid)return Sn.invalid(Hce(r));const n=mh.fromObject(t),s=Zve(e,cnt),{minDaysInFirstWeek:o,startOfWeek:a}=Jrt(s,n),l=df.now(),u=tl(t.specificOffset)?r.offset(l):t.specificOffset,c=!tl(s.ordinal),h=!tl(s.year),p=!tl(s.month)||!tl(s.day),m=h||p,v=s.weekYear||s.weekNumber;if((m||c)&&v)throw new Rz("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new Rz("Can't mix ordinal dates with month/day");const w=v||s.weekday&&!m;let S,I,R=Wce(l,u);w?(S=zKi,I=GKi,R=Jve(R,o,a)):c?(S=VKi,I=UKi,R=o3e(R)):(S=EAt,I=CAt);let L=!1;for(const Q of S){const re=s[Q];tl(re)?L?s[Q]=I[Q]:s[Q]=R[Q]:L=!0}const k=w?yJi(s,o,a):c?vJi(s):ZIt(s),B=k||QIt(s);if(B)return Sn.invalid(B);const $=w?Yrt(s,o,a):c?Xrt(s):s,[V,Y]=Kfe($,u,r),K=new Sn({ts:V,zone:r,o:Y,loc:n});return s.weekday&&m&&e.weekday!==K.weekday?Sn.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${K.toISO()}`):K}static fromISO(e,t={}){const[r,n]=uKi(e);return SJ(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=cKi(e);return SJ(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=hKi(e);return SJ(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(tl(e)||tl(t))throw new cb("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,o=mh.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,l,u,c]=jKi(o,e,t);return c?Sn.invalid(c):SJ(a,l,r,`format ${t}`,e,u)}static fromString(e,t,r={}){return Sn.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=vKi(e);return SJ(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new cb("need to specify a reason the DateTime is invalid");const r=e instanceof $C?e:new $C(e,t);if(df.throwOnInvalid)throw new qXi(r);return new Sn({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=SAt(e,mh.fromObject(t));return r?r.map(n=>n?n.val:null).join(""):null}static expandFormat(e,t={}){return wAt(Ov.parseFormat(e),mh.fromObject(t)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?u3e(this).weekYear:NaN}get weekNumber(){return this.isValid?u3e(this).weekNumber:NaN}get weekday(){return this.isValid?u3e(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?c3e(this).weekday:NaN}get localWeekNumber(){return this.isValid?c3e(this).weekNumber:NaN}get localWeekYear(){return this.isValid?c3e(this).weekYear:NaN}get ordinal(){return this.isValid?o3e(this.c).ordinal:NaN}get monthShort(){return this.isValid?zce.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?zce.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?zce.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?zce.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=y2e(this.c),n=this.zone.offset(r-e),s=this.zone.offset(r+e),o=this.zone.offset(r-n*t),a=this.zone.offset(r-s*t);if(o===a)return[this];const l=r-o*t,u=r-a*t,c=Wce(l,o),h=Wce(u,a);return c.hour===h.hour&&c.minute===h.minute&&c.second===h.second&&c.millisecond===h.millisecond?[$L(this,{ts:l}),$L(this,{ts:u})]:[this]}get isInLeapYear(){return lae(this.year)}get daysInMonth(){return Kve(this.year,this.month)}get daysInYear(){return this.isValid?LV(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ane(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ane(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Ov.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(If.instance(e),t)}toLocal(){return this.setZone(df.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if(e=L5(e,df.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const s=e.offset(this.ts),o=this.toObject();[n]=Kfe(o,s,e)}return $L(this,{ts:n,zone:e})}else return Sn.invalid(Hce(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){const n=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return $L(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Zve(e,cnt),{minDaysInFirstWeek:r,startOfWeek:n}=Jrt(t,this.loc),s=!tl(t.weekYear)||!tl(t.weekNumber)||!tl(t.weekday),o=!tl(t.ordinal),a=!tl(t.year),l=!tl(t.month)||!tl(t.day),u=a||l,c=t.weekYear||t.weekNumber;if((u||o)&&c)throw new Rz("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Rz("Can't mix ordinal dates with month/day");let h;s?h=Yrt({...Jve(this.c,r,n),...t},r,n):tl(t.ordinal)?(h={...this.toObject(),...t},tl(t.day)&&(h.day=Math.min(Kve(h.year,h.month),h.day))):h=Xrt({...o3e(this.c),...t});const[p,m]=Kfe(h,this.o,this.zone);return $L(this,{ts:p,o:m})}plus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e);return $L(this,lnt(this,t))}minus(e){if(!this.isValid)return this;const t=tc.fromDurationLike(e).negate();return $L(this,lnt(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=tc.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),a=o?this:e,l=o?e:this,u=CKi(a,l,s,n);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Sn.now(),e,t)}until(e){return this.isValid?$p.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,r)<=n&&n<=s.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Sn.fromObject({},{zone:this.zone}),r=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Sn.isDateTime))throw new cb("max requires all arguments be DateTimes");return Krt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:s=null}=r,o=mh.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return xAt(o,e,t)}static fromStringExplain(e,t,r={}){return Sn.fromFormatExplain(e,t,r)}static get DATE_SHORT(){return Xve}static get DATE_MED(){return MIt}static get DATE_MED_WITH_WEEKDAY(){return JXi}static get DATE_FULL(){return OIt}static get DATE_HUGE(){return PIt}static get TIME_SIMPLE(){return RIt}static get TIME_WITH_SECONDS(){return DIt}static get TIME_WITH_SHORT_OFFSET(){return FIt}static get TIME_WITH_LONG_OFFSET(){return kIt}static get TIME_24_SIMPLE(){return LIt}static get TIME_24_WITH_SECONDS(){return NIt}static get TIME_24_WITH_SHORT_OFFSET(){return $It}static get TIME_24_WITH_LONG_OFFSET(){return BIt}static get DATETIME_SHORT(){return jIt}static get DATETIME_SHORT_WITH_SECONDS(){return GIt}static get DATETIME_MED(){return UIt}static get DATETIME_MED_WITH_SECONDS(){return zIt}static get DATETIME_MED_WITH_WEEKDAY(){return KXi}static get DATETIME_FULL(){return VIt}static get DATETIME_FULL_WITH_SECONDS(){return HIt}static get DATETIME_HUGE(){return WIt}static get DATETIME_HUGE_WITH_SECONDS(){return qIt}}function TJ(i){if(Sn.isDateTime(i))return i;if(i&&i.valueOf&&Y8(i.valueOf()))return Sn.fromJSDate(i);if(i&&typeof i=="object")return Sn.fromObject(i);throw new cb(`Unknown datetime argument: ${i}, of type ${typeof i}`)}const RS="system",YF="unknown",y0="UTC",WKi=Intl.DateTimeFormat().resolvedOptions().timeZone,qKi="shortOffset";function YKi(i){return"timeZoneIANA"in i}function XKi(i){return i.startsWith("UTC")}function XF(i,e=!1){return{json:{read:{source:i,reader:(t,r)=>r[i]?Zfe(r[i]):null},write:!!e&&{allowNull:!0,writer(t,r){r[i]=t?JKi(t):null}}}}}function Zfe(i,e=RS){return i?YKi(i)?i.timeZoneIANA:KKi(i,e):e}function JKi(i){return{timeZoneIANA:i}}function KKi(i,e=RS){if(!i||!Nrt.has(i.timeZone))return e;const t=Nrt.get(i.timeZone);return XKi(i.timeZone)||i.respectsDaylightSaving?t:ZKi(t)}function ZKi(i){const e=Sn.local().setZone(i),t=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return t===0?"Etc/UTC":`Etc/GMT${If.instance(-t).formatOffset(0,"narrow")}`}function IAt(i,e,t,r,n){if(e&&n==="date")return{timeZone:y0,timeZoneName:void 0};const s=r.timeStyle||r.hour,o=t===YF;return{timeZone:o?n==="timestamp-offset"?void 0:i??y0:t,timeZoneName:o&&s?qKi:void 0}}const QKi={year:void 0,month:void 0,day:void 0,weekday:void 0},eZi={hour:void 0,minute:void 0,second:void 0},AAt={timeZone:y0},jE={year:"numeric",month:"numeric",day:"numeric"},CJ={year:"numeric",month:"long",day:"numeric"},EJ={year:"numeric",month:"short",day:"numeric"},IJ={year:"numeric",month:"long",weekday:"long",day:"numeric"},d5={hour:"numeric",minute:"numeric"},TN={...d5,second:"numeric"},MAt={hourCycle:"h23"},AJ={...d5,...MAt},MJ={...TN,...MAt},OAt={"short-date":jE,"short-date-short-time":{...jE,...d5},"short-date-short-time-24":{...jE,...AJ},"short-date-long-time":{...jE,...TN},"short-date-long-time-24":{...jE,...MJ},"short-date-le":jE,"short-date-le-short-time":{...jE,...d5},"short-date-le-short-time-24":{...jE,...AJ},"short-date-le-long-time":{...jE,...TN},"short-date-le-long-time-24":{...jE,...MJ},"long-month-day-year":CJ,"long-month-day-year-short-time":{...CJ,...d5},"long-month-day-year-short-time-24":{...CJ,...AJ},"long-month-day-year-long-time":{...CJ,...TN},"long-month-day-year-long-time-24":{...CJ,...MJ},"day-short-month-year":EJ,"day-short-month-year-short-time":{...EJ,...d5},"day-short-month-year-short-time-24":{...EJ,...AJ},"day-short-month-year-long-time":{...EJ,...TN},"day-short-month-year-long-time-24":{...EJ,...MJ},"long-date":IJ,"long-date-short-time":{...IJ,...d5},"long-date-short-time-24":{...IJ,...AJ},"long-date-long-time":{...IJ,...TN},"long-date-long-time-24":{...IJ,...MJ},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":d5,"long-time":TN},tZi=pa()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),PAt={ar:"ar-u-nu-latn-ca-gregory"};let k5e=new WeakMap;const b2e=OAt["short-date-short-time"];function iZi(i){let e=k5e.get(i);if(!e){const t=Am(),r=PAt[t]||t,n=zze(i.timeZone??RS),s={...i,timeZone:n};e=new Intl.DateTimeFormat(r,s),k5e.set(i,e)}return e}function T6(i){return OAt[i]}function vb(i,e=b2e){return iZi(e).format(i)}function rZi(i,e=b2e){return vb(new Date(i),{...e,...AAt,...eZi})}function nZi(i,e=b2e){return vb(new Date(`1970-01-01T${i}Z`),{...e,...AAt,...QKi})}function sZi(i,e=b2e){if(e.timeZone)return vb(new Date(i),e);const t=Sn.fromISO(i,{setZone:!0}),r=Am(),n=PAt[r]??r,s=t.offset===0?y0:e.timeZone,o={...e,timeZone:s};return t.toLocaleString(o,{locale:n})}function zze(i){switch(i){case RS:return WKi;case YF:return y0;default:return i}}bze(()=>{k5e=new WeakMap});const oZi={ar:"ar-u-nu-latn"};let Qfe=new WeakMap,RAt={};function aZi(i){const e=i||RAt;if(!Qfe.has(e)){const t=Am(),r=oZi[Am()]||t;Qfe.set(e,new Intl.NumberFormat(r,i))}return Qfe.get(e)}function Qve(i={}){const e={};return i.digitSeparator!=null&&(e.useGrouping=i.digitSeparator),i.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=i.places),e}function DS(i,e){return Object.is(i,-0)&&(i=0),aZi(e).format(i)}bze(()=>{Qfe=new WeakMap,RAt={}});const DAt=()=>di.getLogger("esri.intl.substitute");function xC(i,e,t={}){const{format:r={}}=t;return m0(i,n=>lZi(n,e,r))}function lZi(i,e,t){let r,n;const s=i.indexOf(":");if(s===-1?r=i.trim():(r=i.slice(0,s).trim(),n=i.slice(s+1).trim()),!r)return"";const o=uS(r,e);if(o==null)return"";const a=(n?t?.[n]:null)??t?.[r];return a?uZi(o,a):n?cZi(o,n):Vze(o)}function uZi(i,e){switch(e.type){case"date":return vb(i,e.intlOptions);case"number":return DS(i,e.intlOptions);default:return DAt().warn("missing format descriptor for key {key}"),Vze(i)}}function cZi(i,e){switch(e.toLowerCase()){case"dateformat":return vb(i);case"numberformat":return DS(i);default:return DAt().warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?vb(i):/^numberformat/i.test(e)?DS(i):Vze(i)}}function Vze(i){switch(typeof i){case"string":return i;case"number":return DS(i);case"boolean":return""+i;default:return i instanceof Date?vb(i):""}}async function hZi(i,e,t,r){const n=e.exec(t);if(!n)throw new qe("esri-intl:invalid-bundle",`Bundle id "${t}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],a=IYi(r),l=`${s}${o}.json`,u=a?`${s}${o}_${a}.json`:l;let c;try{c=await fnt(i(u))}catch(h){if(u===l)throw new qe("intl:unknown-bundle",`Bundle "${t}" cannot be loaded`,{error:h});try{c=await fnt(i(l))}catch(p){throw new qe("intl:unknown-bundle",`Bundle "${t}" cannot be loaded`,{error:p})}}return c}async function fnt(i){if(mnt.fetchBundleAsset!=null)return mnt.fetchBundleAsset(i);const e=await zi(i,{responseType:"text"});return JSON.parse(e.data)}let dZi=class{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let n;n=typeof r=="string"?s=>new URL(s,new URL(r,window.location.href)).href:r instanceof URL?s=>new URL(s,r).href:r,this.pattern=typeof t=="string"?new RegExp(`^${t}`):t,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return hZi(this.getAssetUrl,this.matcher,e,t)}};function pZi(i){return new dZi(i)}const mnt={};EYi(pZi({pattern:"esri/",location:Fl}));function dS(i){return typeof i=="number"}function Hze(i){return typeof i=="string"||i instanceof String}const fZi="yyyy-MM-dd",mZi="TT";var wie;(function(i){i.HM="HH:mm",i.HMS="HH:mm:ss",i.HMS_MS="HH:mm:ss.SSS"})(wie||(wie={}));const gZi=[wie.HMS_MS,wie.HMS,wie.HM,mZi];function gnt(i){if(!i||!Hze(i))return null;const e=Sn.fromFormat(i,fZi);return e.isValid?e:null}function ynt(i){return i&&Hze(i)?xVi(gZi,e=>{const t=Sn.fromFormat(i,e);return t.isValid?t:null})??null:null}function vnt(i){if(!i||!Hze(i))return null;const e=Sn.fromISO(i);return e.isValid?e:null}var pW;(function(i){i.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",i.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(pW||(pW={}));const yZi=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function vZi(i){return i!=null&&yZi.has(i.type)}function FAt(i){return i!=null&&(i.type==="date-only"||i.type==="esriFieldTypeDateOnly")}function kAt(i){return i!=null&&(i.type==="timestamp-offset"||i.type==="esriFieldTypeTimestampOffset")}function LAt(i){return i!=null&&(i.type==="time-only"||i.type==="esriFieldTypeTimeOnly")}function _Zi(i,e){const t=i?.domain;if(!t)return null;switch(t.type){case"range":{const{min:r,max:n}=NAt(i);if(r!=null&&+en)return pW.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(t.codedValues==null||t.codedValues.every(r=>r==null||r.code!==e))return pW.INVALID_CODED_VALUE}return null}function NAt(i,e){const t=i?.domain;if(!t||t.type!=="range")return;const r="range"in t?t.range[0]:t.minValue,n="range"in t?t.range[1]:t.maxValue,s=vZi(i);return FAt(i)||LAt(i)||kAt(i)?{...bZi(i,n,r),isInteger:s}:{min:r!=null&&typeof r=="number"?r:null,max:n!=null&&typeof n=="number"?n:null,rawMin:r,rawMax:n,isInteger:s}}function bZi(i,e,t){return FAt(i)?{min:gnt(t)?.toMillis(),max:gnt(e)?.toMillis(),rawMin:t,rawMax:e}:LAt(i)?{min:ynt(t)?.toMillis(),max:ynt(e)?.toMillis(),rawMin:t,rawMax:e}:kAt(i)?{min:vnt(t)?.toMillis(),max:vnt(e)?.toMillis(),rawMin:t,rawMax:e}:{max:null,min:null}}const wZi=()=>di.getLogger("esri.support.arcadeOnDemand");let d3e;function e_(){return d3e||(d3e=(async()=>{const i=await Promise.resolve().then(()=>t7r);return{arcade:i.arcade,arcadeUtils:i,Dictionary:i.Dictionary,Feature:i.arcadeFeature}})()),d3e}const $At=(i,e,t)=>BAt.create(i,e,t,null,["$feature","$view"],[]),xZi=(i,e,t,r)=>BAt.create(i,e,t,r,["$feature","$view"],[]);let BAt=class jAt{constructor(e,t,r,n,s,o,a){this.services=null,this.script=e,this.evaluate=n;const l=Array.isArray(o)?o:o?.fields;this.fields=l??[],this._syntaxTree=r,this._arcade=t,this._arcadeFeature=s,this._spatialReference=a,this._referencesGeometry=t.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,t,r,n,s,o){const{arcade:a,Feature:l,Dictionary:u}=await e_(),c=Xi.fromJSON(t);let h;try{h=a.parseScript(e,o)}catch(Y){return wZi().error(new qe("arcade-bad-expression","Failed to parse arcade script",{script:e,error:Y})),null}const p=s.reduce((Y,K)=>({...Y,[K]:null}),{});let m=null;n!=null&&(m=new u(n),m.immutable=!0,p.$config=null);const v=a.scriptUsesGeometryEngine(h),w=v&&a.enableGeometrySupport(),S=a.scriptUsesFeatureSet(h)&&a.enableFeatureSetSupport(),I=a.scriptIsAsync(h),R=I&&a.enableAsyncSupport(),L={vars:p,spatialReference:c,useAsync:!!R};await Promise.all([w,S,R]);const k=new Set;await a.loadDependentModules(k,h,null,I,v);const B=new u;B.immutable=!1,B.setField("scale",0);const $=a.compileScript(h,L),V=(Y,K)=>{const Q=Y.$view?.timeZone;return"$view"in Y&&Y.$view&&(B.setField("scale",typeof Y.$view=="object"&&"scale"in Y.$view?Y.$view.scale:void 0),Y.$view=B),m&&(Y.$config=m),$({vars:Y,spatialReference:c,services:K,timeZone:Q})};return new jAt(e,a,h,V,new l,r,c)}repurposeFeature(e){return e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry,e.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const SZi=/^([0-9_])/,TZi=/[^a-z0-9_\u0080-\uffff]+/gi;function fW(i){return i==null?null:i.trim().replaceAll(TZi,"_").replace(SZi,"F$1")||null}const CZi=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],EZi=["field","normalizationField"];function t_(i,e){if(i!=null&&e!=null){for(const t of Array.isArray(i)?i:[i])if(_nt(CZi,t,e),"visualVariables"in t&&t.visualVariables)for(const r of t.visualVariables)_nt(EZi,r,e)}}function _nt(i,e,t){if(i)for(const r of i){const n=uS(r,e),s=n&&typeof n!="function"&&t.get(n);s&&Qp(r,s.name,e)}}function pR(i,e){if(i!=null&&e?.fields?.length)if("startField"in i){const t=e.get(i.startField),r=e.get(i.endField);i.startField=t?.name??null,i.endField=r?.name??null}else{const t=e.get(i.startTimeField),r=e.get(i.endTimeField);i.startTimeField=t?.name??null,i.endTimeField=r?.name??null}}const p3e=new Set;function rB(i,e){return i&&e?(p3e.clear(),IA(p3e,i,e),Array.from(p3e).sort()):[]}function IA(i,e,t){if(t)if(e?.fields?.length)if(t.includes("*"))for(const{name:r}of e.fields)i.add(r);else for(const r of t)$v(i,e,r);else{if(t.includes("*"))return i.clear(),void i.add("*");for(const r of t)r!=null&&i.add(r)}}function $v(i,e,t){if(typeof t=="string")if(e){const r=e.get(t);r&&i.add(r.name)}else i.add(t)}function e1e(i,e){return e==null||i==null?[]:e.includes("*")?(i.fields??[]).map(t=>t.name):e}function IZi(i,e,t=1){if(!e||!i)return[];if(e.includes("*"))return["*"];const r=rB(i,e);return r.length/i.fields.length>=t?["*"]:r}async function i_(i,e,t){if(!t)return;const{arcadeUtils:r}=await e_(),n=r.extractFieldNames(t,e?.fields?.map(s=>s.name));for(const s of n)$v(i,e,s)}async function GAt(i,e,t){if(t&&t!=="1=1"){const r=await Ine(t,e);if(!r.isStandardized)throw new qe("fieldUtils:collectFilterFields","Where clause is not standardized",{where:t});IA(i,e,r.fieldNames)}}function AZi({displayField:i,fields:e}){return i||(e?.length?f3e(e,"name-or-title")||f3e(e,"unique-identifier")||f3e(e,"type-or-category")||MZi(e):null)}function MZi(i){for(const e of i){if(!e?.name)continue;const t=e.name.toLowerCase();if(t.includes("name")||t.includes("title"))return e.name}return null}function f3e(i,e){for(const t of i)if(t?.valueType&&t.valueType===e)return t.name;return null}async function OZi(i,e){if(!e)return;const t=e.elevationInfo?.featureExpressionInfo;return t?t.collectRequiredFields(i,e.fieldsIndex):void 0}function PZi(i,e,t){t.onStatisticExpression?i_(i,e,t.onStatisticExpression.expression):i.add(t.onStatisticField)}async function RZi(i,e,t){if(!e||!t||!("fields"in t))return;const r=[],n=t.popupTemplate;r.push(DZi(i,e,n)),t.fields&&r.push(...t.fields.map(async s=>PZi(i,e.fieldsIndex,s))),await Promise.all(r)}async function DZi(i,e,t){const r=[];t?.expressionInfos&&r.push(...t.expressionInfos.map(s=>i_(i,e.fieldsIndex,s.expression)));const n=t?.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&r.push(i_(i,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(r)}async function bnt(i,e,t){e&&(e.timeInfo&&t?.timeExtent&&IA(i,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&IA(i,e.fieldsIndex,[e.floorInfo.floorField]),t?.where!=null&&await GAt(i,e.fieldsIndex,t.where))}async function FZi(i,e,t){e&&t&&await Promise.all(t.map(r=>kZi(i,e,r)))}async function kZi(i,e,t){e&&t&&(t.valueExpression?await i_(i,e.fieldsIndex,t.valueExpression):t.field&&$v(i,e.fieldsIndex,t.field))}function LZi(i){return i?rB(i.fieldsIndex,UAt(i)):[]}function NZi(i){if(!i)return[];const e=i.geometryFieldsInfo;return e?rB(i.fieldsIndex,[e.shapeAreaField,e.shapeLengthField]):[]}const $Zi=new Set(["oid","global-id","guid"]),BZi=new Set(["oid","global-id"]),jZi=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function GZi(i){const e=new Set;zAt(i).forEach(r=>e.add(r)),NZi(i).forEach(r=>e.add(r.toLowerCase()));const t=i&&"infoFor3D"in i?i.infoFor3D:void 0;return t&&(Object.values(t.assetMapFieldRoles).forEach(r=>e.add(r.toLowerCase())),Object.values(t.transformFieldRoles).forEach(r=>e.add(r.toLowerCase()))),Array.from(e)}function UAt(i){if(!i)return[];const e="editFieldsInfo"in i&&i.editFieldsInfo;if(!e)return[];const{creationDateField:t,creatorField:r,editDateField:n,editorField:s}=e;return[t,r,n,s].filter(Boolean)}function zAt(i){return UAt(i).map(e=>e.toLowerCase())}function UZi(i,e){return i.editable&&!$Zi.has(i.type)&&!zAt(e).includes(i.name?.toLowerCase()??"")}function zZi(i,e){const t=i.name?.toLowerCase()??"";return!(e?.objectIdField!=null&&t===e.objectIdField.toLowerCase()||e?.globalIdField!=null&&t===e.globalIdField.toLowerCase()||GZi(e).includes(t)||BZi.has(i.type)||jZi.some(r=>r.test(t)))}async function wnt(i,e){const{labelingInfo:t,fieldsIndex:r}=e;t?.length&&await Promise.all(t.map(n=>VZi(i,r,n)))}async function VZi(i,e,t){if(!t)return;const r=t.getLabelExpression(),n=t.where;if(r.type==="arcade")await i_(i,e,r.expression);else{const s=r.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{$v(i,e,o.slice(1,-1))})}await GAt(i,e,n)}function w2e(i){const e=i.defaultValue;return e!==void 0&&WAt(i,e)?e:i.nullable?null:void 0}function s8(i){const e=typeof i=="string"?{type:i}:i;return xie(e)?255:e.type==="esriFieldTypeDate"||e.type==="date"?8:void 0}function VAt(i){return typeof i=="number"&&!isNaN(i)&&isFinite(i)}function HZi(i){return i===null||VAt(i)}function WZi(i){return i===null||Number.isInteger(i)}function HAt(i){return i!=null&&typeof i=="string"}function qZi(i){return i===null||HAt(i)}function YZi(){return!0}function WAt(i,e){let t;switch(i.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":t=i.nullable?WZi:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":t=i.nullable?HZi:VAt;break;case"string":case"esriFieldTypeString":t=i.nullable?qZi:HAt;break;default:t=YZi}return arguments.length===1?t:t(e)}const XZi=["integer","small-integer","big-integer"],JZi=["single","double"],KZi=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],ZZi=["esriFieldTypeSingle","esriFieldTypeDouble"],QZi=new Set([...XZi,...KZi]),eQi=new Set([...JZi,...ZZi]),tQi=bve(QZi,eQi);function wY(i){return i!=null&&tQi.has(i.type)}function xie(i){return i!=null&&(i.type==="string"||i.type==="esriFieldTypeString")}function mW(i){return i!=null&&(i.type==="date"||i.type==="esriFieldTypeDate")}function t1e(i){return i!=null&&(i.type==="date-only"||i.type==="esriFieldTypeDateOnly")}function i1e(i){return i!=null&&(i.type==="timestamp-offset"||i.type==="esriFieldTypeTimestampOffset")}function hae(i){return i!=null&&(i.type==="time-only"||i.type==="esriFieldTypeTimeOnly")}function xnt(i){return i!=null&&(i.type==="oid"||i.type==="esriFieldTypeOID")}function Snt(i){return i!=null&&(i.type==="global-id"||i.type==="esriFieldTypeGlobalID")}function iQi(i,e){return qAt(i,e)===null}var r1e,n1e;function rQi(i){return i==null||typeof i=="number"&&isNaN(i)?null:i}function qAt(i,e){return i==null||i.nullable&&e===null?null:wY(i)&&!nQi(i.type,Number(e))?r1e.OUT_OF_RANGE:WAt(i,e)?i.domain?_Zi(i,e):null:n1e.INVALID_TYPE}function nQi(i,e){const t=typeof i=="string"?YAt(i):i;if(!t)return!1;const r=t.min,n=t.max;return t.isInteger?Number.isInteger(e)&&e>=r&&e<=n:e>=r&&e<=n}function YAt(i){switch(i){case"esriFieldTypeSmallInteger":case"small-integer":return sQi;case"esriFieldTypeInteger":case"integer":return oQi;case"esriFieldTypeBigInteger":case"big-integer":return aQi;case"esriFieldTypeSingle":case"single":return lQi;case"esriFieldTypeDouble":case"double":return uQi}}(function(i){i.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(r1e||(r1e={})),function(i){i.INVALID_TYPE="type-validation-error::invalid-type"}(n1e||(n1e={}));const sQi={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},oQi={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},aQi={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},lQi={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},uQi={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function cQi(i,e,t){switch(i){case pW.INVALID_CODED_VALUE:return`Value ${t} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case pW.VALUE_OUT_OF_RANGE:return`Value ${t} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case n1e.INVALID_TYPE:return`Value ${t} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case r1e.OUT_OF_RANGE:{const{min:r,max:n}=YAt(e.type);return`Value ${t} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${r} to ${n}`}}}function XAt(i,e){return!hQi(i,e,null)}function hQi(i,e,t){if(!e?.attributes||!i)return!0;const r=new Set(Object.keys(e.attributes));let n=!1;for(const s of i)if(!r.has(s)&&(n=!0,t==null))break;return n}function L5e(i){return!!i&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>i.toLowerCase().startsWith(e))}let eme=class extends Ci{constructor(e){super(e),this.type=null}};x([D({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],eme.prototype,"type",void 0),eme=x([Qe("esri.popup.content.Content")],eme);const Vk=eme;var N5e;let CN=N5e=class extends Vk{constructor(i){super(i),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new N5e({description:this.description,displayType:this.displayType,title:this.title})}};x([D({type:String,json:{write:!0}})],CN.prototype,"description",void 0),x([D({type:["auto","preview","list"],json:{write:!0}})],CN.prototype,"displayType",void 0),x([D({type:String,json:{write:!0}})],CN.prototype,"title",void 0),x([D({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],CN.prototype,"type",void 0),CN=N5e=x([Qe("esri.popup.content.AttachmentsContent")],CN);const Mne=CN;var $5e;let EN=$5e=class extends Vk{constructor(i){super(i),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new $5e({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?li(this.outFields):null})}};x([D()],EN.prototype,"creator",void 0),x([D()],EN.prototype,"destroyer",void 0),x([D()],EN.prototype,"outFields",void 0),x([D({type:["custom"],readOnly:!0})],EN.prototype,"type",void 0),EN=$5e=x([Qe("esri.popup.content.CustomContent")],EN);const dQi=EN;var B5e;let CG=B5e=class extends Ci{constructor(i){super(i),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new B5e({title:this.title,expression:this.expression})}};x([D({type:String,json:{write:!0}})],CG.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],CG.prototype,"expression",void 0),x([D({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],CG.prototype,"returnType",void 0),CG=B5e=x([Qe("esri.popup.ElementExpressionInfo")],CG);const JAt=CG;var j5e;let qZ=j5e=class extends Vk{constructor(i){super(i),this.expressionInfo=null,this.type="expression"}clone(){return new j5e({expressionInfo:this.expressionInfo?.clone()})}};x([D({type:JAt,json:{write:!0}})],qZ.prototype,"expressionInfo",void 0),x([D({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],qZ.prototype,"type",void 0),qZ=j5e=x([Qe("esri.popup.content.ExpressionContent")],qZ);const Wze=qZ;function Wr(i,e={}){const t=i instanceof Rs?i:new Rs(i,e),r={type:e?.ignoreUnknown??1?t.apiValues:String,json:{type:t.jsonValues,read:!e?.readOnly&&{reader:t.read},write:{writer:t.write}}};return e?.readOnly!==void 0&&(r.readOnly=!!e.readOnly),e?.default!==void 0&&(r.json.default=e.default),e?.name!==void 0&&(r.json.name=e.name),e?.nonNullable!==void 0&&(r.nonNullable=e.nonNullable),D(r)}let EG=class extends xs(Ci){constructor(e){super(e),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};x([Wr(tZi)],EG.prototype,"dateFormat",void 0),x([D({type:Boolean,json:{write:!0}})],EG.prototype,"digitSeparator",void 0),x([D({type:ms,json:{write:!0}})],EG.prototype,"places",void 0),EG=x([Qe("esri.popup.support.FieldInfoFormat")],EG);const tme=EG;var G5e;let PT=G5e=class extends Ci{constructor(i){super(i),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new G5e({fieldName:this.fieldName,format:this.format?li(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};x([D({type:String,json:{write:!0}})],PT.prototype,"fieldName",void 0),x([D({type:tme,json:{write:!0}})],PT.prototype,"format",void 0),x([D({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],PT.prototype,"isEditable",void 0),x([D({type:String,json:{write:!0}})],PT.prototype,"label",void 0),x([Wr(new Rs({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],PT.prototype,"stringFieldOption",void 0),x([D({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],PT.prototype,"statisticType",void 0),x([D({type:String,json:{write:!0}})],PT.prototype,"tooltip",void 0),x([D({type:Boolean,json:{write:!0}})],PT.prototype,"visible",void 0),PT=G5e=x([Qe("esri.popup.FieldInfo")],PT);const dae=PT;var U5e;let jM=U5e=class extends Vk{constructor(i){super(i),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(i,e){e.fieldInfos=i&&i.map(t=>t.toJSON())}clone(){return new U5e(li({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};x([D({type:Object,json:{write:!0}})],jM.prototype,"attributes",void 0),x([D({type:String,json:{write:!0}})],jM.prototype,"description",void 0),x([D({type:[dae]})],jM.prototype,"fieldInfos",void 0),x([ur("fieldInfos")],jM.prototype,"writeFieldInfos",null),x([D({type:String,json:{write:!0}})],jM.prototype,"title",void 0),x([D({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],jM.prototype,"type",void 0),jM=U5e=x([Qe("esri.popup.content.FieldsContent")],jM);const gW=jM;let IN=class extends Ci{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};x([D({type:String,json:{write:!0}})],IN.prototype,"altText",void 0),x([D({type:String,json:{write:!0}})],IN.prototype,"caption",void 0),x([D({type:String,json:{write:!0}})],IN.prototype,"title",void 0),x([D({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],IN.prototype,"type",void 0),IN=x([Qe("esri.popup.content.mixins.MediaInfo")],IN);const qze=IN;var z5e;let AN=z5e=class extends un{constructor(i){super(i),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new z5e({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};x([D()],AN.prototype,"color",void 0),x([D()],AN.prototype,"fieldName",void 0),x([D()],AN.prototype,"tooltip",void 0),x([D()],AN.prototype,"value",void 0),AN=z5e=x([Qe("esri.popup.content.support.ChartMediaInfoValueSeries")],AN);const KAt=AN;var V5e;let o4=V5e=class extends Ci{constructor(i){super(i),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new V5e({colors:li(this.colors),fields:li(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};x([D({type:[jr],json:{type:[[ms]],write:!0}})],o4.prototype,"colors",void 0),x([D({type:[String],json:{write:!0}})],o4.prototype,"fields",void 0),x([D({type:String,json:{write:!0}})],o4.prototype,"normalizeField",void 0),x([D({type:[KAt],json:{read:!1}})],o4.prototype,"series",void 0),x([D({type:String,json:{write:!0}})],o4.prototype,"tooltipField",void 0),o4=V5e=x([Qe("esri.popup.content.support.ChartMediaInfoValue")],o4);const pQi=o4;let YZ=class extends qze{constructor(e){super(e),this.type=null,this.value=null}};x([D({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],YZ.prototype,"type",void 0),x([D({type:pQi,json:{write:!0}})],YZ.prototype,"value",void 0),YZ=x([Qe("esri.popup.content.mixins.ChartMediaInfo")],YZ);const x2e=YZ,S2e=pa()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var H5e;let ime=H5e=class extends x2e{constructor(i){super(i),this.type="bar-chart"}clone(){return new H5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:S2e.write}})],ime.prototype,"type",void 0),ime=H5e=x([Qe("esri.popup.content.BarChartMediaInfo")],ime);const ZAt=ime;var W5e;let rme=W5e=class extends x2e{constructor(i){super(i),this.type="column-chart"}clone(){return new W5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:S2e.write}})],rme.prototype,"type",void 0),rme=W5e=x([Qe("esri.popup.content.ColumnChartMediaInfo")],rme);const QAt=rme;var q5e;let XZ=q5e=class extends Ci{constructor(i){super(i),this.linkURL=null,this.sourceURL=null}clone(){return new q5e({linkURL:this.linkURL,sourceURL:this.sourceURL})}};x([D({type:String,json:{write:!0}})],XZ.prototype,"linkURL",void 0),x([D({type:String,json:{write:!0}})],XZ.prototype,"sourceURL",void 0),XZ=q5e=x([Qe("esri.popup.content.support.ImageMediaInfoValue")],XZ);const fQi=XZ;var Y5e;let IG=Y5e=class extends qze{constructor(i){super(i),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new Y5e({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};x([D({type:Number,json:{write:!0}})],IG.prototype,"refreshInterval",void 0),x([D({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],IG.prototype,"type",void 0),x([D({type:fQi,json:{write:!0}})],IG.prototype,"value",void 0),IG=Y5e=x([Qe("esri.popup.content.ImageMediaInfo")],IG);const e3t=IG;var X5e;let nme=X5e=class extends x2e{constructor(i){super(i),this.type="line-chart"}clone(){return new X5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:S2e.write}})],nme.prototype,"type",void 0),nme=X5e=x([Qe("esri.popup.content.LineChartMediaInfo")],nme);const t3t=nme;var J5e;let sme=J5e=class extends x2e{constructor(i){super(i),this.type="pie-chart"}clone(){return new J5e({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};x([D({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:S2e.write}})],sme.prototype,"type",void 0),sme=J5e=x([Qe("esri.popup.content.PieChartMediaInfo")],sme);const i3t=sme,r3t={base:qze,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":ZAt,"column-chart":QAt,"line-chart":t3t,"pie-chart":i3t,image:e3t}};var K5e;let RT=K5e=class extends Vk{constructor(i){super(i),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(i){return i&&i.map(e=>e.type==="image"?e3t.fromJSON(e):e.type==="barchart"?ZAt.fromJSON(e):e.type==="columnchart"?QAt.fromJSON(e):e.type==="linechart"?t3t.fromJSON(e):e.type==="piechart"?i3t.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(i,e){e.mediaInfos=i&&i.map(t=>t.toJSON())}clone(){return new K5e(li({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};x([D()],RT.prototype,"activeMediaInfoIndex",void 0),x([D({type:Object,json:{write:!0}})],RT.prototype,"attributes",void 0),x([D({type:String,json:{write:!0}})],RT.prototype,"description",void 0),x([D({types:[r3t]})],RT.prototype,"mediaInfos",void 0),x([Mi("mediaInfos")],RT.prototype,"readMediaInfos",null),x([ur("mediaInfos")],RT.prototype,"writeMediaInfos",null),x([D({type:String,json:{write:!0}})],RT.prototype,"title",void 0),x([D({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],RT.prototype,"type",void 0),RT=K5e=x([Qe("esri.popup.content.MediaContent")],RT);const One=RT;var Z5e;let JZ=Z5e=class extends Ci{constructor(i){super(i),this.field=null,this.order=null}clone(){return new Z5e({field:this.field,order:this.order})}};x([D({type:String,json:{write:!0}})],JZ.prototype,"field",void 0),x([D({type:["asc","desc"],json:{write:!0}})],JZ.prototype,"order",void 0),JZ=Z5e=x([Qe("esri.popup.support.RelatedRecordsInfoFieldOrder")],JZ);const Yze=JZ;let uI=class extends xs(Vk){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};x([D({type:String,json:{write:!0}})],uI.prototype,"description",void 0),x([D({type:Number,json:{type:ms,write:!0}})],uI.prototype,"displayCount",void 0),x([D({type:["list"],json:{write:!0}})],uI.prototype,"displayType",void 0),x([D({type:[Yze],json:{write:!0}})],uI.prototype,"orderByFields",void 0),x([D({type:Number,json:{type:ms,write:!0}})],uI.prototype,"relationshipId",void 0),x([D({type:String,json:{write:!0}})],uI.prototype,"title",void 0),x([D({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],uI.prototype,"type",void 0),uI=x([Qe("esri.popup.content.RelationshipContent")],uI);const s1e=uI;var Q5e;let KZ=Q5e=class extends Vk{constructor(i){super(i),this.text=null,this.type="text"}clone(){return new Q5e({text:this.text})}};x([D({type:String,json:{write:!0}})],KZ.prototype,"text",void 0),x([D({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],KZ.prototype,"type",void 0),KZ=Q5e=x([Qe("esri.popup.content.TextContent")],KZ);const yW=KZ,mQi={base:null,key:"type",typeMap:{attachment:Mne,media:One,text:yW,expression:Wze,field:gW,relationship:s1e}};var eFe;let MN=eFe=class extends Ci{constructor(i){super(i),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new eFe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};x([D({type:String,json:{write:!0}})],MN.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],MN.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],MN.prototype,"expression",void 0),x([D({type:["string","number"],json:{write:!0}})],MN.prototype,"returnType",void 0),MN=eFe=x([Qe("esri.popup.ExpressionInfo")],MN);const o1e=MN;var tFe;let ZZ=tFe=class extends Ci{constructor(i){super(i),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new tFe({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};x([D({type:Boolean,json:{write:!0}})],ZZ.prototype,"returnTopmostRaster",void 0),x([D({type:Boolean,json:{write:!0}})],ZZ.prototype,"showNoDataRecords",void 0),ZZ=tFe=x([Qe("esri.popup.LayerOptions")],ZZ);const gQi=ZZ;var iFe;let QZ=iFe=class extends Ci{constructor(i){super(i),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new iFe({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?li(this.orderByFields):null})}};x([D({type:Boolean,json:{write:!0}})],QZ.prototype,"showRelatedRecords",void 0),x([D({type:[Yze],json:{write:!0}})],QZ.prototype,"orderByFields",void 0),QZ=iFe=x([Qe("esri.popup.RelatedRecordsInfo")],QZ);const yQi=QZ;let n3t=0;const iT=i=>{let e=class extends i{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n3t++})}};return e=x([Qe("esri.core.Identifiable")],e),e},T2e=i=>{let e=class extends i{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n3t++})}};return e=x([Qe("esri.core.NumericIdentifiable")],e),e};let Tnt=class extends iT(class{}){};Tnt=x([Qe("esri.core.Identifiable")],Tnt);var rFe;let S2=rFe=class extends iT(un){constructor(i){super(i),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new rFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};x([D()],S2.prototype,"active",void 0),x([D()],S2.prototype,"className",void 0),x([D()],S2.prototype,"disabled",void 0),x([D()],S2.prototype,"icon",void 0),x([D()],S2.prototype,"id",void 0),x([D()],S2.prototype,"indicator",void 0),x([D()],S2.prototype,"title",void 0),x([D()],S2.prototype,"type",void 0),x([D()],S2.prototype,"visible",void 0),S2=rFe=x([Qe("esri.support.actions.ActionBase")],S2);const C2e=S2;var nFe;let ome=nFe=class extends C2e{constructor(i){super(i),this.image=null,this.type="button"}clone(){return new nFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};x([D()],ome.prototype,"image",void 0),ome=nFe=x([Qe("esri.support.Action.ActionButton")],ome);const xY=ome;var sFe;let eQ=sFe=class extends C2e{constructor(i){super(i),this.image=null,this.type="toggle",this.value=!1}clone(){return new sFe({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};x([D()],eQ.prototype,"image",void 0),x([D()],eQ.prototype,"value",void 0),eQ=sFe=x([Qe("esri.support.Action.ActionToggle")],eQ);const Xze=eQ,OJ="relationships/",Cnt="expression/",vQi=dr.ofType({key:"type",defaultKeyValue:"button",base:C2e,typeMap:{button:xY,toggle:Xze}}),_Qi={base:Vk,key:"type",typeMap:{media:One,custom:dQi,text:yW,attachments:Mne,fields:gW,expression:Wze,relationship:s1e}},bQi=new Set(["attachments","fields","media","text","expression","relationship"]);let Vm=class extends xs(Ci){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(t=>u3(_Qi,t)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||qp(e)?e:(di.getLogger(this).error("content error","unsupported content value",{value:e}),null)}readContent(e,t){const{popupElements:r}=t;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(t.description,t.mediaInfos,r):this._readPopupInfo(t)}writeContent(e,t,r,n){typeof e!="string"?Array.isArray(e)&&(t.popupElements=e.filter(s=>bQi.has(s.type)).map(s=>s?.toJSON(n)),t.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(t):s.type==="media"?this._writeMediaContent(s,t):s.type==="text"?this._writeTextContent(s,t):s.type==="relationship"&&this._writeRelationshipContent(s,t)})):t.description=e}writeFieldInfos(e,t,r,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const a=o?o.filter(u=>u.type==="fields"):[],l=a.length&&a.every(u=>u.fieldInfos?.length);t.fieldInfos=e.filter(Boolean).map(u=>{const c=u.toJSON(n);return l&&(c.visible=!1),c})}if(o)for(const a of o)a.type==="fields"&&this._writeFieldsContent(a,t)}writeLayerOptions(e,t,r,n){t[r]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,t){t.title=e||""}async collectRequiredFields(e,t){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(e,t,[...r,...this._getContentExpressionInfos(this.content,r)]),IA(e,t,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const t=new Set;return await this.collectRequiredFields(t,e),[...t].sort()}_writeFieldsContent(e,t){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const r=li(e.fieldInfos);Array.isArray(t.fieldInfos)?r.forEach(n=>{const s=t.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:t.fieldInfos.push(n)}):t.fieldInfos=r}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,t){const r=e.orderByFields?.map(s=>this._toFieldOrderJSON(s,e.relationshipId))||[],n=[...t.relatedRecordsInfo?.orderByFields||[],...r];t.relatedRecordsInfo={showRelatedRecords:!0,...n?.length&&{orderByFields:n}}}_writeTextContent(e,t){!t.description&&e.text&&(t.description=e.text)}_writeMediaContent(e,t){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const r=li(e.mediaInfos);Array.isArray(t.mediaInfos)?t.mediaInfos=[...t.mediaInfos,...r]:t.mediaInfos=r}_readPopupInfoElements(e,t,r){const n={description:!1,mediaInfos:!1};return r.map(s=>s.type==="media"?(s.mediaInfos||!t||n.mediaInfos||(s.mediaInfos=t,n.mediaInfos=!0),One.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),yW.fromJSON(s)):s.type==="attachments"?Mne.fromJSON(s):s.type==="fields"?gW.fromJSON(s):s.type==="expression"?Wze.fromJSON(s):s.type==="relationship"?s1e.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:t,order:r}=e;if(!t?.startsWith(OJ))return null;const n=t.replace(OJ,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?s1e.fromJSON({relationshipId:s,orderByFields:[{field:o,order:r}]}):null}_toFieldOrderJSON(e,t){const{order:r,field:n}=e;return{field:`${OJ}${t}/${n}`,order:r}}_readPopupInfo({description:e,mediaInfos:t,showAttachments:r,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new yW({text:e})):s.push(new gW),Array.isArray(t)&&t.length&&s.push(One.fromJSON({mediaInfos:t})),r&&s.push(Mne.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:a}=n;return o&&a?.length&&a.forEach(l=>{const u=this._toRelationshipContent(l);u&&s.push(u)}),s.length?s:e}_getContentElementFields(e){const t=e?.type;if(t==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(t==="custom")return e.outFields||[];if(t==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(t==="media"){const r=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...r.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return t==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:t,title:r,value:n}=e,s=n||{},{fields:o,normalizeField:a,tooltipField:l,sourceURL:u,linkURL:c}=s,h=[...this._extractFieldNames(r),...this._extractFieldNames(t),...this._extractFieldNames(u),...this._extractFieldNames(c),...o??[]];return a&&h.push(a),l&&h.push(l),h}_getContentExpressionInfos(e,t){return Array.isArray(e)?e.reduce((r,n)=>[...r,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],t):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((t,r)=>[...t,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(e,t,r){r&&await Promise.all(r.map(n=>i_(e,t,n.expression)))}_getFieldInfoFields(e){return e?e.filter(t=>t.visible===void 0||!!t.visible).map(t=>t.fieldName).filter(t=>!t.startsWith(OJ)&&!t.startsWith(Cnt)):[]}_getActionsFields(e){return e?e.toArray().reduce((t,r)=>[...t,...this._getActionFields(r)],[]):[]}_getActionFields(e){const{className:t,title:r,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(t),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const t=/{[^}]*}/g,r=e.match(t);if(!r)return[];const n=/\{(\w+):.+\}/,s=r.filter(o=>!(o.indexOf(`{${OJ}`)===0||o.indexOf(`{${Cnt}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};x([D({type:vQi})],Vm.prototype,"actions",void 0),x([D()],Vm.prototype,"content",void 0),x([So("content")],Vm.prototype,"castContent",null),x([Mi("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Vm.prototype,"readContent",null),x([ur("content",{popupElements:{type:dr.ofType(mQi)},showAttachments:{type:Boolean},mediaInfos:{type:dr.ofType(r3t)},description:{type:String},relatedRecordsInfo:{type:yQi}})],Vm.prototype,"writeContent",null),x([D({type:[o1e],json:{write:!0}})],Vm.prototype,"expressionInfos",void 0),x([D({type:[dae]})],Vm.prototype,"fieldInfos",void 0),x([ur("fieldInfos")],Vm.prototype,"writeFieldInfos",null),x([D({type:gQi})],Vm.prototype,"layerOptions",void 0),x([ur("layerOptions")],Vm.prototype,"writeLayerOptions",null),x([D({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Vm.prototype,"lastEditInfoEnabled",void 0),x([D()],Vm.prototype,"outFields",void 0),x([D()],Vm.prototype,"overwriteActions",void 0),x([D()],Vm.prototype,"returnGeometry",void 0),x([D({json:{type:String}})],Vm.prototype,"title",void 0),x([ur("title")],Vm.prototype,"writeTitle",null),Vm=x([Qe("esri.PopupTemplate")],Vm);const qc=Vm,Ent=new Rs({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let wQi=0,AG=class extends Ci{constructor(e){super(e),this.id="sym"+wQi++,this.type=null,this.color=new jr([0,0,0,1])}readColor(e){return e?.[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};x([D({type:Ent.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:Ent.write}}})],AG.prototype,"type",void 0),x([D({type:jr,json:{write:{allowNull:!0}}})],AG.prototype,"color",void 0),x([Mi("color")],AG.prototype,"readColor",null),AG=x([Qe("esri.symbols.Symbol")],AG);const T0=AG;var oFe;let a4=oFe=class extends T0{constructor(i){super(i),this.data=null,this.type="cim"}readData(i,e){return e}writeData(i,e){Object.assign(e,i)}async collectRequiredFields(i,e){if(this.data?.type==="CIMSymbolReference"){const t=this.data.primitiveOverrides;if(t){const r=t.map(n=>{const s=n.valueExpressionInfo;return s?i_(i,e,s.expression):null});await Promise.all(r)}}}clone(){return new oFe({data:li(this.data)})}hash(){return Q1(JSON.stringify(this.data)).toString()}};x([D({json:{write:!1}})],a4.prototype,"color",void 0),x([D({json:{write:!0}})],a4.prototype,"data",void 0),x([Mi("data",["symbol"])],a4.prototype,"readData",null),x([ur("data",{})],a4.prototype,"writeData",null),x([Wr({CIMSymbolReference:"cim"},{readOnly:!0})],a4.prototype,"type",void 0),a4=oFe=x([Qe("esri.symbols.CIMSymbol")],a4);const pae=a4;let MG=class extends Ci{constructor(e){super(e),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(e,t,r){e||(t[r]=e)}};x([D({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],MG.prototype,"enabled",void 0),x([ur("enabled")],MG.prototype,"writeEnabled",null),x([D({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],MG.prototype,"type",void 0),MG=x([Qe("esri.symbols.Symbol3DLayer")],MG);const z3=MG,xQi=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,SQi="screenUtils.toPt: input not recognized!",s3t=96;function us(i){return i?i/72*s3t:0}function uy(i){return i?72*i/s3t:0}function Cl(i){if(typeof i=="string"){const e=i.match(xQi);if(e){const t=Number(e[1]),r=e[3]&&e[3].toLowerCase(),n=i.charAt(0)==="-",s=r==="px"?uy(t):t;return n?-s:s}return console.warn(SQi),null}return i}function Vd(i=0,e=0){return{x:i,y:e}}function TQi(i=0,e=0){return[i,e]}function E2e(i){const e=r2e(100*(1-i));return Math.max(0,Math.min(e,100))}function vW(i){const e=1-i/100;return Math.max(0,Math.min(e,1))}function CQi(i,e){const t=e.transparency!=null?vW(e.transparency):1,r=e.color;return r&&Array.isArray(r)?new jr([r[0]||0,r[1]||0,r[2]||0,t]):null}function EQi(i,e){e.color=i.toJSON().slice(0,3);const t=E2e(i.a);t!==0&&(e.transparency=t)}const Hk={type:jr,json:{type:[ms],default:null,read:{source:["color","transparency"],reader:CQi},write:{target:{color:{type:[ms]},transparency:{type:ms}},writer:EQi}}},h3={type:Number,cast:Cl,json:{write:!0}};let ON=class extends Ci{constructor(e){super(e),this.color=new jr([0,0,0,1]),this.extensionLength=0,this.size=uy(1)}clone(){}cloneProperties(){return{color:li(this.color),size:this.size,extensionLength:this.extensionLength}}};x([D({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],ON.prototype,"type",void 0),x([D(Hk)],ON.prototype,"color",void 0),x([D({...h3,json:{write:{overridePolicy:i=>({enabled:!!i})}}})],ON.prototype,"extensionLength",void 0),x([D(h3)],ON.prototype,"size",void 0),ON=x([Qe("esri.symbols.edges.Edges3D")],ON);const Jze=ON;var aFe;let ame=aFe=class extends Jze{constructor(i){super(i),this.type="sketch"}clone(){return new aFe(this.cloneProperties())}};x([Wr({sketch:"sketch"},{readOnly:!0})],ame.prototype,"type",void 0),ame=aFe=x([Qe("esri.symbols.edges.SketchEdges3D")],ame);const IQi=ame;var lFe;let lme=lFe=class extends Jze{constructor(i){super(i),this.type="solid"}clone(){return new lFe(this.cloneProperties())}};x([Wr({solid:"solid"},{readOnly:!0})],lme.prototype,"type",void 0),lme=lFe=x([Qe("esri.symbols.support.SolidEdges3D")],lme);const AQi=lme,Kze={types:{key:"type",base:Jze,typeMap:{solid:AQi,sketch:IQi}},json:{write:!0}};var uFe;let vx=uFe=class extends Ci{constructor(i){super(i),this.color=null}clone(){const i={color:this.color!=null?this.color.clone():null};return new uFe(i)}};x([D(Hk)],vx.prototype,"color",void 0),vx=uFe=x([Qe("esri.symbols.support.Symbol3DMaterial")],vx);var cFe;let l4=cFe=class extends z3{constructor(i){super(i),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new cFe({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};x([Wr({Extrude:"extrude"},{readOnly:!0})],l4.prototype,"type",void 0),x([D({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],l4.prototype,"size",void 0),x([D({type:vx,json:{write:!0}})],l4.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],l4.prototype,"castShadows",void 0),x([D(Kze)],l4.prototype,"edges",void 0),l4=cFe=x([Qe("esri.symbols.ExtrudeSymbol3DLayer")],l4);const o3t=l4;let tQ=class extends T0{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};x([Wr({esriSLS:"simple-line"},{readOnly:!0})],tQ.prototype,"type",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],tQ.prototype,"width",void 0),tQ=x([Qe("esri.symbols.LineSymbol")],tQ);const MQi=tQ,OQi=["begin","end","begin-end"],a3t=["arrow","circle","square","diamond","cross","x"];var hFe;let cI=hFe=class extends Ci{constructor(i){super(i),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(i,e,t,r){e[t]=r?.origin==="web-map"?"arrow":i}set color(i){this._set("color",i)}readColor(i){return i?.[0]!=null?[i[0],i[1],i[2],i[3]/255]:i}writeColor(i,e,t,r){r?.origin==="web-map"||(e[t]=i)}clone(){return new hFe({color:li(this.color),placement:this.placement,style:this.style})}hash(){return`${this.placement}.${this.color?.hash()}.${this.style}`}};x([D({type:["begin","end","begin-end"],json:{write:!0}})],cI.prototype,"placement",void 0),x([Wr({"line-marker":"line-marker"},{readOnly:!0}),D({json:{origins:{"web-map":{write:!1}}}})],cI.prototype,"type",void 0),x([D({type:a3t})],cI.prototype,"style",void 0),x([ur("style")],cI.prototype,"writeStyle",null),x([D({type:jr,value:null,json:{write:{allowNull:!0}}})],cI.prototype,"color",null),x([Mi("color")],cI.prototype,"readColor",null),x([ur("color")],cI.prototype,"writeColor",null),cI=hFe=x([Qe("esri.symbols.LineSymbolMarker")],cI);const PQi=cI;var dFe;const m3e=new Rs({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let GM=dFe=class extends MQi{constructor(...i){super(...i),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(i,e,t,r,n,s){if(i&&typeof i!="string")return i;const o={};return i!=null&&(o.style=i),e!=null&&(o.color=e),t!=null&&(o.width=Cl(t)),r!=null&&(o.cap=r),n!=null&&(o.join=n),s!=null&&(o.miterLimit=Cl(s)),o}clone(){return new dFe({color:li(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:this.marker?.clone()})}hash(){return`${super.hash()}.${this.color?.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${this.marker?.hash()}`}};x([Wr({esriSLS:"simple-line"},{readOnly:!0})],GM.prototype,"type",void 0),x([D({type:m3e.apiValues,json:{read:m3e.read,write:m3e.write}})],GM.prototype,"style",void 0),x([D({type:["butt","round","square"],json:{write:{overridePolicy:(i,e,t)=>({enabled:i!=="round"&&t?.origin==null})}}})],GM.prototype,"cap",void 0),x([D({type:["miter","round","bevel"],json:{write:{overridePolicy:(i,e,t)=>({enabled:i!=="round"&&t?.origin==null})}}})],GM.prototype,"join",void 0),x([D({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":PQi}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],GM.prototype,"marker",void 0),x([D({type:Number,json:{read:!1,write:!1}})],GM.prototype,"miterLimit",void 0),GM=dFe=x([Qe("esri.symbols.SimpleLineSymbol")],GM);const vg=GM;let iQ=class extends T0{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};x([D({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":vg}},json:{default:null,write:!0}})],iQ.prototype,"outline",void 0),x([D({type:["simple-fill","picture-fill"],readOnly:!0})],iQ.prototype,"type",void 0),iQ=x([Qe("esri.symbols.FillSymbol")],iQ);const l3t=iQ;let ume=class extends Ci{constructor(e){super(e)}clone(){}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],ume.prototype,"type",void 0),ume=x([Qe("esri.symbols.patterns.LinePattern3D")],ume);const u3t=ume,RQi=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var pFe;const DQi=pa()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let rQ=pFe=class extends u3t{constructor(i){super(i),this.type="style",this.style="solid"}clone(){const i={style:this.style};return new pFe(i)}};x([D({type:["style"]})],rQ.prototype,"type",void 0),x([Wr(DQi),D({type:RQi})],rQ.prototype,"style",void 0),rQ=pFe=x([Qe("esri.symbols.patterns.LineStylePattern3D")],rQ);const Zze=rQ;let cme=class extends Ci{constructor(e){super(e)}clone(){}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],cme.prototype,"type",void 0),cme=x([Qe("esri.symbols.patterns.Pattern3D")],cme);const c3t=cme,FQi=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var fFe;let nQ=fFe=class extends c3t{constructor(i){super(i),this.type="style",this.style="solid"}clone(){const i={style:this.style};return new fFe(i)}};x([D({type:["style"]})],nQ.prototype,"type",void 0),x([D({type:FQi,json:{read:!0,write:!0}})],nQ.prototype,"style",void 0),nQ=fFe=x([Qe("esri.symbols.patterns.StylePattern3D")],nQ);const h3t=nQ,kQi={types:{key:"type",base:c3t,typeMap:{style:h3t}},json:{write:!0}},d3t={types:{key:"type",base:u3t,typeMap:{style:Zze}},json:{write:!0}},Sie=new jr("white");new jr("black");const LQi=new jr([255,255,255,0]);function NQi(i){return i.r===0&&i.g===0&&i.b===0}var mFe;let Tie=mFe=class extends vx{constructor(i){super(i),this.colorMixMode=null}clone(){const i={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new mFe(i)}};x([Wr({multiply:"multiply",replace:"replace",tint:"tint"})],Tie.prototype,"colorMixMode",void 0),Tie=mFe=x([Qe("esri.symbols.support.Symbol3DFillMaterial")],Tie);function Dx(i=m3t){return[i[0],i[1],i[2],i[3],i[4],i[5]]}function I2e(i,e,t,r,n,s,o=Dx()){return o[0]=i,o[1]=e,o[2]=t,o[3]=r,o[4]=n,o[5]=s,o}function $Qi(i,e){const t=isFinite(i[2])||isFinite(i[5]);return new hr(t?{xmin:i[0],xmax:i[3],ymin:i[1],ymax:i[4],zmin:i[2],zmax:i[5],spatialReference:e}:{xmin:i[0],xmax:i[3],ymin:i[1],ymax:i[4],spatialReference:e})}function sQ(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.min(i[2],e[2]),i[3]=Math.max(i[3],e[3]),i[4]=Math.max(i[4],e[4]),i[5]=Math.max(i[5],e[5])}function Pne(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.min(i[2],e[2]),i[3]=Math.max(i[3],e[0]),i[4]=Math.max(i[4],e[1]),i[5]=Math.max(i[5],e[2])}function BQi(i,e,t=0,r=e.length/3){let n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],u=i[5];for(let c=0;c=i[3]?0:i[3]-i[0]}function GQi(i){return i[1]>=i[4]?0:i[4]-i[1]}function UQi(i){return i[2]>=i[5]?0:i[5]-i[2]}function Int(i,e=[0,0,0]){return e[0]=jQi(i),e[1]=GQi(i),e[2]=UQi(i),e}function zQi(i,e,t=i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t!==i&&(t[3]=i[3],t[4]=i[4],t[5]=i[5]),t}function VQi(i,e,t=i){return t[3]=e[0],t[4]=e[1],t[5]=e[2],t!==i&&(t[0]=i[0],t[1]=i[1],t[2]=i[2]),i}function p3t(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i}function f3t(i){return i?p3t(i,$V):Dx($V)}function HQi(i,e){return i[0]=e[0],i[1]=e[1],i[2]=Number.NEGATIVE_INFINITY,i[3]=e[2],i[4]=e[3],i[5]=Number.POSITIVE_INFINITY,i}function a1e(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=Number.NEGATIVE_INFINITY,i[3]=r,i[4]=n,i[5]=Number.POSITIVE_INFINITY,i}function gFe(i){return i.length===6}function WQi(i,e,t){if(i==null||e==null)return i===e;if(!gFe(i)||!gFe(e))return!1;for(let r=0;r{const e=Gd(i);return e===0?1:uu(e,.1,4)},nonNullable:!0},ter=["left","right","center"],ier=["baseline","top","middle","bottom"],v3t={type:ter,nonNullable:!0},_3t={type:ier,nonNullable:!0},rer=8;var vFe;let zM=vFe=class extends Ci{constructor(i){super(i),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(i){return Cl(i)}clone(){return new vFe({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};x([D({type:ZQi,json:{default:"none",write:!0}})],zM.prototype,"decoration",void 0),x([D({type:String,json:{write:!0}})],zM.prototype,"family",void 0),x([D({type:Number,json:{write:{overridePolicy:(i,e,t)=>({enabled:!t||!t.textSymbol3D})}}})],zM.prototype,"size",void 0),x([So("size")],zM.prototype,"castSize",null),x([D({type:QQi,json:{default:"normal",write:!0}})],zM.prototype,"style",void 0),x([D({type:eer,json:{default:"normal",write:!0}})],zM.prototype,"weight",void 0),zM=vFe=x([Qe("esri.symbols.Font")],zM);const mae=zM;var _Fe;const ner=pa()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let RN=_Fe=class extends Ci{constructor(i){super(i)}readHref(i,e,t){return i?mE(i,t):e.dataURI}writeHref(i,e,t,r){i&&(Vx(i)?e.dataURI=i:(e.href=gE(i,r),u0(e.href)&&(e.href=X1(e.href))))}clone(){return new _Fe({href:this.href,primitive:this.primitive})}};x([D({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],RN.prototype,"href",void 0),x([Mi("href")],RN.prototype,"readHref",null),x([ur("href",{href:{type:String},dataURI:{type:String}})],RN.prototype,"writeHref",null),x([Wr(ner)],RN.prototype,"primitive",void 0),RN=_Fe=x([Qe("esri.symbols.support.IconSymbol3DLayerResource")],RN);var bFe;let Dz=bFe=class extends un{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new bFe({x:this.x,y:this.y})}};x([D({type:Number})],Dz.prototype,"x",void 0),x([D({type:Number})],Dz.prototype,"y",void 0),Dz=bFe=x([Qe("esri.symbols.support.Symbol3DAnchorPosition2D")],Dz);var wFe;let oQ=wFe=class extends Ci{constructor(i){super(i),this.color=new jr([0,0,0,1]),this.size=uy(1)}clone(){const i={color:this.color!=null?this.color.clone():null,size:this.size};return new wFe(i)}};x([D(Hk)],oQ.prototype,"color",void 0),x([D(h3)],oQ.prototype,"size",void 0),oQ=wFe=x([Qe("esri.symbols.support.Symbol3DIconOutline")],oQ);var OG;const b3t="esri.symbols.IconSymbol3DLayer";let hI=OG=class extends z3{constructor(i){super(i),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new OG({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(i){const e=i.color||Sie,t=Ant(i),r=i.outline&&i.outline.width>0?{size:i.outline.width,color:(i.outline.color||Sie).clone()}:null;return new OG({size:i.size,resource:{primitive:oer(i.style)},material:{color:e},outline:r,anchor:t?"relative":void 0,anchorPosition:t})}static fromPictureMarkerSymbol(i){const e=!i.color||NQi(i.color)?Sie:i.color,t=Ant(i);return new OG({size:i.width<=i.height?i.height:i.width,resource:{href:i.url},material:{color:e.clone()},anchor:t?"relative":void 0,anchorPosition:t})}static fromCIMSymbol(i){return new OG({resource:{href:QCt({mediaType:"application/json",data:JSON.stringify(i.data)})}})}};function Ant(i){const e="width"in i?i.width:i.size,t="height"in i?i.height:i.size,r=Mnt(i.xoffset),n=Mnt(i.yoffset);return(r||n)&&e&&t?{x:-r/e,y:n/t}:null}function Mnt(i){return isFinite(i)?i:0}x([D({type:vx,json:{write:!0}})],hI.prototype,"material",void 0),x([D({type:RN,json:{write:!0}})],hI.prototype,"resource",void 0),x([Wr({Icon:"icon"},{readOnly:!0})],hI.prototype,"type",void 0),x([D(h3)],hI.prototype,"size",void 0),x([Wr({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),D({json:{default:"center"}})],hI.prototype,"anchor",void 0),x([D({type:Dz,json:{type:[Number],read:{reader:i=>new Dz({x:i[0],y:i[1]})},write:{writer:(i,e)=>{e.anchorPosition=[i.x,i.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],hI.prototype,"anchorPosition",void 0),x([D({type:oQ,json:{write:!0}})],hI.prototype,"outline",void 0),hI=OG=x([Qe(b3t)],hI);const ser={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function oer(i){return ser[i]||(di.getLogger(b3t).warn(`${i} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const o8=hI;let DN=class extends xs(Ci){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return e!=null&&e.placement===this.placement&&e.style===this.style&&(this.color==null&&e.color==null||this.color!=null&&e.color!=null&&this.color.toJSON()===e.color.toJSON())}};x([D({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],DN.prototype,"type",void 0),x([D({type:OQi,json:{default:"begin-end",write:!0}})],DN.prototype,"placement",void 0),x([D({type:a3t,json:{default:"arrow",write:!0}})],DN.prototype,"style",void 0),x([D({type:jr,json:{type:[ms],default:null,write:!0}})],DN.prototype,"color",void 0),DN=x([Qe("esri.symbols.LineStyleMarker3D")],DN);const xFe=DN;var dme;let dI=dme=class extends z3{constructor(i){super(i),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=uy(1),this.pattern=null,this.marker=null}clone(){const i={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new dme(i)}static fromSimpleLineSymbol(i){const e={enabled:!0,size:i.width??uy(1),cap:i.cap||"butt",join:i.join||"miter",pattern:i.style&&i.style!=="inside-frame"?new Zze({style:i.style}):null,material:new vx({color:(i.color||Sie).clone()}),marker:i.marker?new xFe({placement:i.marker.placement,style:i.marker.style,color:i.marker.color?.clone()??null}):null};return new dme(e)}};x([D({type:vx,json:{write:!0}})],dI.prototype,"material",void 0),x([Wr({Line:"line"},{readOnly:!0})],dI.prototype,"type",void 0),x([D({type:g3t,json:{write:!0,default:"miter"}})],dI.prototype,"join",void 0),x([D({type:Qze,json:{write:!0,default:"butt"}})],dI.prototype,"cap",void 0),x([D(h3)],dI.prototype,"size",void 0),x([D(d3t)],dI.prototype,"pattern",void 0),x([D({types:{key:"type",base:xFe,typeMap:{style:xFe}},json:{write:!0}})],dI.prototype,"marker",void 0),dI=dme=x([Qe("esri.symbols.LineSymbol3DLayer")],dI);const gae=dI;var SFe;const aer=pa()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let aQ=SFe=class extends Ci{clone(){return new SFe({href:this.href,primitive:this.primitive})}};x([D({type:String,json:{read:mY,write:cR}})],aQ.prototype,"href",void 0),x([Wr(aer)],aQ.prototype,"primitive",void 0),aQ=SFe=x([Qe("esri.symbols.support.ObjectSymbol3DLayerResource")],aQ);var TFe;let C6=TFe=class extends un{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new TFe({x:this.x,y:this.y,z:this.z})}};x([D({type:Number})],C6.prototype,"x",void 0),x([D({type:Number})],C6.prototype,"y",void 0),x([D({type:Number})],C6.prototype,"z",void 0),C6=TFe=x([Qe("esri.symbols.support.Symbol3DAnchorPosition3D")],C6);var CFe;let V0=CFe=class extends z3{constructor(i){super(i),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new CFe({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition?.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:this.material?.clone()??null,castShadows:this.castShadows,resource:this.resource?.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};x([D({type:vx,json:{write:!0}})],V0.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],V0.prototype,"castShadows",void 0),x([D({type:aQ,json:{write:!0}})],V0.prototype,"resource",void 0),x([Wr({Object:"object"},{readOnly:!0})],V0.prototype,"type",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"width",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"height",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"depth",void 0),x([Wr({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),D({json:{default:"origin"}})],V0.prototype,"anchor",void 0),x([D({type:C6,json:{type:[Number],read:{reader:i=>new C6({x:i[0],y:i[1],z:i[2]})},write:{writer:(i,e)=>{e.anchorPosition=[i.x,i.y,i.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],V0.prototype,"anchorPosition",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"heading",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"tilt",void 0),x([D({type:Number,json:{write:!0}})],V0.prototype,"roll",void 0),x([D({readOnly:!0})],V0.prototype,"isPrimitive",null),V0=CFe=x([Qe("esri.symbols.ObjectSymbol3DLayer")],V0);const eVe=V0;var EFe;let l1=EFe=class extends z3{constructor(i){super(i),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(i,e){return i??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(i,e){return i??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new EFe({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};x([D({type:vx,json:{write:!0}})],l1.prototype,"material",void 0),x([D({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],l1.prototype,"castShadows",void 0),x([Wr({Path:"path"},{readOnly:!0})],l1.prototype,"type",void 0),x([D({type:["circle","quad"],json:{write:!0,default:"circle"}})],l1.prototype,"profile",void 0),x([D({type:g3t,json:{write:!0,default:"miter"}})],l1.prototype,"join",void 0),x([D({type:KQi,json:{write:!0,default:"butt"}})],l1.prototype,"cap",void 0),x([D({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],l1.prototype,"width",void 0),x([Mi("width",["width","size","height"])],l1.prototype,"readWidth",null),x([D({type:Number,json:{write:!0}})],l1.prototype,"height",void 0),x([Mi("height",["height","size","width"])],l1.prototype,"readHeight",null),x([D({type:["center","bottom","top"],json:{write:!0,default:"center"}})],l1.prototype,"anchor",void 0),x([D({type:["heading","all"],json:{write:!0,default:"all"}})],l1.prototype,"profileRotation",void 0),l1=EFe=x([Qe("esri.symbols.PathSymbol3DLayer")],l1);const tVe=l1;var IFe;let Fz=IFe=class extends Ci{constructor(){super(...arguments),this.color=new jr([0,0,0,1]),this.size=0}clone(){const i={color:li(this.color),size:this.size};return new IFe(i)}};x([D(Hk)],Fz.prototype,"color",void 0),x([D(h3)],Fz.prototype,"size",void 0),Fz=IFe=x([Qe("esri.symbols.support.Symbol3DHalo")],Fz);let Cie=class extends xs(Ci){constructor(e){super(e),this.color=null}};x([D(Hk)],Cie.prototype,"color",void 0),Cie=x([Qe("esri.symbols.support.Symbol3DTextBackground")],Cie);var pme;let F_=pme=class extends z3{constructor(i){super(i),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(i){i!=null&&this._userSize!=null&&(i.size=this._userSize),this._set("font",i)}writeFont(i,e,t,r){const n={...r,textSymbol3D:!0};e.font=i.write({},n),delete e.font.size}get size(){return this._userSize!=null?this._userSize:this.font?.size!=null?this.font.size:9}set size(i){this._userSize=i,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const i=new pme({enabled:this.enabled,font:this.font&&li(this.font),halo:this.halo&&li(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:li(this.background)});return i._userSize=this._userSize,i}static fromTextSymbol(i){return new pme({font:i.font!=null?i.font.clone():new mae,halo:ler(i.haloColor,i.haloSize),horizontalAlignment:i.horizontalAlignment,lineHeight:i.lineHeight,material:i.color?new vx({color:i.color.clone()}):null,text:i.text,verticalAlignment:i.verticalAlignment,background:i.backgroundColor?new Cie({color:i.backgroundColor.clone()}):null})}};function ler(i,e){return i&&e!=null&&e>0?new Fz({color:li(i),size:e}):null}x([D({type:mae,json:{write:!0}})],F_.prototype,"font",null),x([ur("font")],F_.prototype,"writeFont",null),x([D({type:Fz,json:{write:!0}})],F_.prototype,"halo",void 0),x([D({...v3t,json:{default:"center",write:!0}})],F_.prototype,"horizontalAlignment",void 0),x([D({...y3t,json:{default:1,write:!0}})],F_.prototype,"lineHeight",void 0),x([D({type:vx,json:{write:!0}})],F_.prototype,"material",void 0),x([D({type:Cie,json:{write:!0}})],F_.prototype,"background",void 0),x([D(h3)],F_.prototype,"size",null),x([D({type:String,json:{write:!0}})],F_.prototype,"text",void 0),x([Wr({Text:"text"},{readOnly:!0})],F_.prototype,"type",void 0),x([D({..._3t,json:{default:"baseline",write:!0}})],F_.prototype,"verticalAlignment",void 0),F_=pme=x([Qe("esri.symbols.TextSymbol3DLayer")],F_);const SY=F_;var AFe;let u4=AFe=class extends z3{constructor(i){super(i),this.color=MFe.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new AFe({color:li(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};x([D({type:jr,nonNullable:!0,json:{type:[ms],write:(i,e,t)=>e[t]=i.toArray(jr.AlphaMode.UNLESS_OPAQUE),default:()=>MFe.clone(),defaultEquals:i=>i.toCss(!0)===MFe.toCss(!0)}})],u4.prototype,"color",void 0),x([Wr({Water:"water"},{readOnly:!0})],u4.prototype,"type",void 0),x([D({type:["small","medium","large"],json:{write:!0,default:"medium"}})],u4.prototype,"waterbodySize",void 0),x([D({type:Number,json:{write:!0,default:null}})],u4.prototype,"waveDirection",void 0),x([D({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],u4.prototype,"waveStrength",void 0),u4=AFe=x([Qe("esri.symbols.WaterSymbol3DLayer")],u4);const MFe=new jr([0,119,190]),w3t=u4;var OFe;let FN=OFe=class extends un{constructor(i){super(i),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new OFe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};x([D({type:String})],FN.prototype,"name",void 0),x([D({type:String})],FN.prototype,"styleUrl",void 0),x([D({type:String})],FN.prototype,"styleName",void 0),x([D({type:Bu})],FN.prototype,"portal",void 0),FN=OFe=x([Qe("esri.symbols.support.StyleOrigin")],FN);const Rne=FN;var PFe;let X8=PFe=class extends un{constructor(){super(...arguments),this.url=""}clone(){return new PFe({url:this.url})}};x([D({type:String})],X8.prototype,"url",void 0),X8=PFe=x([Qe("esri.symbols.support.Thumbnail")],X8);const x3t={icon:o8,object:eVe,line:gae,path:tVe,fill:fae,extrude:o3t,text:SY,water:w3t},uer=dr.ofType({base:z3,key:"type",typeMap:x3t,errorContext:"symbol-layer"});let pI=class extends T0{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers,r=t?.type,n=r||dr;this._set("symbolLayers",new n)}get color(){return null}set color(e){this.constructed&&di.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){ay(e,this._get("symbolLayers"))}readStyleOrigin(e,t,r){if(e.styleUrl&&e.name){const n=mE(e.styleUrl,r);return new Rne({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new Rne({portal:r?.portal||Bu.getDefault(),styleName:e.styleName,name:e.name});r?.messages&&r.messages.push(new Rf("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:e}))}writeStyleOrigin(e,t,r,n){if(e.styleUrl&&e.name){let s=gE(e.styleUrl,n);u0(s)&&(s=X1(s)),t.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&n?.portal&&!eze(e.portal.restUrl,n.portal.restUrl)?n?.messages&&n.messages.push(new Rf("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof z3||e&&x3t[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};x([D({json:{read:!1,write:!1}})],pI.prototype,"color",null),x([D({type:uer,nonNullable:!0,json:{write:!0}}),So(fY)],pI.prototype,"symbolLayers",null),x([D({type:Rne})],pI.prototype,"styleOrigin",void 0),x([Mi("styleOrigin")],pI.prototype,"readStyleOrigin",null),x([ur("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],pI.prototype,"writeStyleOrigin",null),x([D({type:X8,json:{read:!1}})],pI.prototype,"thumbnail",void 0),x([D({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],pI.prototype,"type",void 0),pI=x([Qe("esri.symbols.Symbol3D")],pI);const TY=pI;let lQ=class extends Ci{constructor(e){super(e),this.visible=!0}clone(){}};x([D({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],lQ.prototype,"type",void 0),x([D({readOnly:!0})],lQ.prototype,"visible",void 0),lQ=x([Qe("esri.symbols.callouts.Callout3D")],lQ);const S3t=lQ;var RFe;let fme=RFe=class extends Ci{constructor(i){super(i),this.color=new jr("white")}clone(){return new RFe({color:li(this.color)})}};x([D(Hk)],fme.prototype,"color",void 0),fme=RFe=x([Qe("esri.symbols.callouts.LineCallout3DBorder")],fme);const cer=fme;var DFe;let c4=DFe=class extends S3t{constructor(i){super(i),this.type="line",this.color=new jr([0,0,0,1]),this.size=uy(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new DFe({color:li(this.color),size:this.size,border:li(this.border)})}};x([Wr({line:"line"})],c4.prototype,"type",void 0),x([D(Hk)],c4.prototype,"color",void 0),x([D(h3)],c4.prototype,"size",void 0),x([D({type:cer,json:{write:!0}})],c4.prototype,"border",void 0),x([D({readOnly:!0})],c4.prototype,"visible",null),c4=DFe=x([Qe("esri.symbols.callouts.LineCallout3D")],c4);const T3t=c4;function iVe(i){if(!i)return!1;const e=i.verticalOffset;return!!e&&!(e.screenLength<=0||e.maxWorldLength!=null&&e.maxWorldLength<=0)}function C3t(i){if(!i||!i.supportsCallout||!i.supportsCallout())return!1;const e=i.callout;return!!e&&!!e.visible&&!!iVe(i)}const E3t={types:{key:"type",base:S3t,typeMap:{line:T3t}},json:{write:!0}};var FFe;let PG=FFe=class extends Ci{constructor(i){super(i),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new FFe({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};x([D(h3)],PG.prototype,"screenLength",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0,default:0}})],PG.prototype,"minWorldLength",void 0),x([D({type:Number,json:{write:!0}})],PG.prototype,"maxWorldLength",void 0),PG=FFe=x([Qe("esri.symbols.support.Symbol3DVerticalOffset")],PG);const rVe=PG;var mme;const I3t=dr.ofType({base:null,key:"type",typeMap:{text:SY}});let h4=mme=class extends TY{constructor(i){super(i),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new I3t,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return C3t(this)}hasVisibleVerticalOffset(){return iVe(this)}clone(){return new mme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail),callout:li(this.callout),verticalOffset:li(this.verticalOffset)})}static fromTextSymbol(i){return new mme({symbolLayers:new dr([SY.fromTextSymbol(i)])})}};x([D({type:rVe,json:{write:!0}})],h4.prototype,"verticalOffset",void 0),x([D(E3t)],h4.prototype,"callout",void 0),x([D({json:{read:!1,write:!1}})],h4.prototype,"styleOrigin",void 0),x([D({type:I3t})],h4.prototype,"symbolLayers",void 0),x([Wr({LabelSymbol3D:"label-3d"},{readOnly:!0})],h4.prototype,"type",void 0),h4=mme=x([Qe("esri.symbols.LabelSymbol3D")],h4);const A2e=h4;var gme;const A3t=dr.ofType({base:null,key:"type",typeMap:{line:gae,path:tVe}}),her=dr.ofType({base:null,key:"type",typeMap:{line:gae,path:tVe}});let uQ=gme=class extends TY{constructor(i){super(i),this.symbolLayers=new A3t,this.type="line-3d"}clone(){return new gme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleLineSymbol(i){return new gme({symbolLayers:new dr([gae.fromSimpleLineSymbol(i)])})}};x([D({type:A3t,json:{type:her}})],uQ.prototype,"symbolLayers",void 0),x([Wr({LineSymbol3D:"line-3d"},{readOnly:!0})],uQ.prototype,"type",void 0),uQ=gme=x([Qe("esri.symbols.LineSymbol3D")],uQ);const M2e=uQ;let d4=class extends T0{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};x([D({type:Number,json:{read:i=>i&&-1*i,write:(i,e)=>e.angle=i&&-1*i}})],d4.prototype,"angle",void 0),x([D({type:["simple-marker","picture-marker"],readOnly:!0})],d4.prototype,"type",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],d4.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],d4.prototype,"yoffset",void 0),x([D({type:Number,cast:i=>i==="auto"?i:Cl(i),json:{write:!0}})],d4.prototype,"size",void 0),d4=x([Qe("esri.symbols.MarkerSymbol")],d4);const M3t=d4;var yme;const O3t=dr.ofType({base:null,key:"type",typeMap:{fill:fae}});let cQ=yme=class extends TY{constructor(i){super(i),this.symbolLayers=new O3t,this.type="mesh-3d"}clone(){return new yme({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleFillSymbol(i){return new yme({symbolLayers:new dr([fae.fromSimpleFillSymbol(i)])})}};x([D({type:O3t})],cQ.prototype,"symbolLayers",void 0),x([Wr({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],cQ.prototype,"type",void 0),cQ=yme=x([Qe("esri.symbols.MeshSymbol3D")],cQ);const O2e=cQ;function der(i,e,t){return e.imageData?QCt({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):P3t(e.url,t)}function P3t(i,e){if(!u0(i)){const t=fer(e);if(t)return Iu(t,"images",i)}return mE(i,e)}function per(i,e,t,r){if(Vx(i)){const n=lR(i);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,t&&t.imageData===e.imageData&&t.url&&cR(t.url,e,"url",r)}else cR(i,e,"url",r)}const R3t={json:{read:{source:["imageData","url"],reader:der},write:{writer(i,e,t,r){per(i,e,this.source,r)}}}},D3t={readOnly:!0,json:{read:{source:["imageData","url"],reader(i,e,t){const r={};return e.imageData&&(r.imageData=e.imageData),e.contentType&&(r.contentType=e.contentType),e.url&&(r.url=P3t(e.url,t)),r}}}};function fer(i){if(!i)return null;const{origin:e,layer:t}=i;if(e!=="service"&&e!=="portal-item")return null;const r=t?.type;return r==="feature"||r==="stream"?t.parsedUrl?.path:r==="map-image"||r==="tile"?i.url?.path:null}var kFe;let T2=kFe=class extends l3t{constructor(...i){super(...i),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(i,e,t,r){if(i&&typeof i!="string"&&i.imageData==null)return i;const n={};return i&&(n.url=i),e&&(n.outline=e),t!=null&&(n.width=Cl(t)),r!=null&&(n.height=Cl(r)),n}clone(){const i=new kFe({color:li(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return i._set("source",li(this.source)),i}hash(){return`${super.hash()}.${this.color?.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};x([Wr({esriPFS:"picture-fill"},{readOnly:!0})],T2.prototype,"type",void 0),x([D(R3t)],T2.prototype,"url",void 0),x([D({type:Number,json:{write:!0}})],T2.prototype,"xscale",void 0),x([D({type:Number,json:{write:!0}})],T2.prototype,"yscale",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"width",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"height",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],T2.prototype,"yoffset",void 0),x([D(D3t)],T2.prototype,"source",void 0),T2=kFe=x([Qe("esri.symbols.PictureFillSymbol")],T2);const F3t=T2;var LFe;let DT=LFe=class extends M3t{constructor(...i){super(...i),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string"&&i.imageData==null)return i;const r={};return i&&(r.url=i),e!=null&&(r.width=Cl(e)),t!=null&&(r.height=Cl(t)),r}readHeight(i,e){return e.size||i}readWidth(i,e){return e.size||i}clone(){const i=new LFe({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return i._set("source",li(this.source)),i}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};x([D({json:{write:!1}})],DT.prototype,"color",void 0),x([Wr({esriPMS:"picture-marker"},{readOnly:!0})],DT.prototype,"type",void 0),x([D(R3t)],DT.prototype,"url",void 0),x([D(D3t)],DT.prototype,"source",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],DT.prototype,"height",void 0),x([Mi("height",["height","size"])],DT.prototype,"readHeight",null),x([D({type:Number,cast:Cl,json:{write:!0}})],DT.prototype,"width",void 0),x([D({json:{write:!1}})],DT.prototype,"size",void 0),DT=LFe=x([Qe("esri.symbols.PictureMarkerSymbol")],DT);const BP=DT;var kN;const k3t=dr.ofType({base:null,key:"type",typeMap:{icon:o8,object:eVe,text:SY}});let LN=kN=class extends TY{constructor(i){super(i),this.verticalOffset=null,this.callout=null,this.symbolLayers=new k3t,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const i of this.symbolLayers.items)switch(i.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return C3t(this)}hasVisibleVerticalOffset(){return iVe(this)}clone(){return new kN({verticalOffset:li(this.verticalOffset),callout:li(this.callout),styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromSimpleMarkerSymbol(i){return new kN({symbolLayers:new dr([o8.fromSimpleMarkerSymbol(i)])})}static fromPictureMarkerSymbol(i){return new kN({symbolLayers:new dr([o8.fromPictureMarkerSymbol(i)])})}static fromCIMSymbol(i){if(i.data?.symbol?.type!=="CIMPointSymbol")return null;const t=i.data.symbol;return new kN(t?.callout?{symbolLayers:new dr([o8.fromCIMSymbol(i)]),callout:new T3t({size:.5,color:new jr([0,0,0])}),verticalOffset:new rVe({screenLength:40})}:{symbolLayers:new dr([o8.fromCIMSymbol(i)])})}static fromTextSymbol(i){return new kN({symbolLayers:new dr([SY.fromTextSymbol(i)])})}};x([D({type:rVe,json:{write:!0}})],LN.prototype,"verticalOffset",void 0),x([D(E3t)],LN.prototype,"callout",void 0),x([D({type:k3t,json:{origins:{"web-scene":{write:!0}}}})],LN.prototype,"symbolLayers",void 0),x([Wr({PointSymbol3D:"point-3d"},{readOnly:!0})],LN.prototype,"type",void 0),LN=kN=x([Qe("esri.symbols.PointSymbol3D")],LN);const a8=LN;function Ki(i,e,t={}){return nVe(i,e,t,L3t)}function v0(i,e,t={}){return nVe(i,e,t,N3t)}function nVe(i,e,t={},r){let n=null;const s=t.once?(o,a)=>{r(o)&&(Hc(n),e(o,a))}:(o,a)=>{r(o)&&e(o,a)};if(n=THi(i,s,t.sync,t.equals),t.initial){const o=i();s(o,o)}return n}function ju(i,e,t,r={}){let n=null,s=null,o=null;function a(){n&&s&&(s.remove(),r.onListenerRemove?.(n),n=null,s=null)}function l(c){r.once&&r.once&&Hc(o),t(c)}const u=Ki(i,(c,h)=>{a(),e2e(c)&&(n=c,s=BA(c,e,l),r.onListenerAdd?.(c))},{sync:r.sync,initial:!0});return o=wa(()=>{u.remove(),a()}),o}function fR(i,e){return mer(i,N3t,e)}function mer(i,e,t){if(xg(t))return Promise.reject(Oc());const r=i();if(e?.(r))return Promise.resolve(r);let n=null;function s(){n=Hc(n)}return new Promise((o,a)=>{n=j3([Qh(t,()=>{s(),a(Oc())}),nVe(i,l=>{s(),o(l)},{sync:!1,once:!0},e??L3t)])})}function L3t(i){return!0}function N3t(i){return!!i}const Kl={sync:!0},js={initial:!0},Ah={sync:!0,initial:!0};var hQ;const $3t=dr.ofType({base:null,key:"type",typeMap:{extrude:o3t,fill:fae,icon:o8,line:gae,object:eVe,text:SY,water:w3t}});let dQ=hQ=class extends TY{constructor(i){super(i),this.symbolLayers=new $3t,this.type="polygon-3d"}initialize(){const i=e=>{e.type==="line"&&UF(di.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),e.type==="text"&&UF(di.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const e of this.symbolLayers)i(e);this.addHandles(ju(()=>this.symbolLayers,"after-add",({item:e})=>i(e),Kl))}clone(){return new hQ({styleOrigin:li(this.styleOrigin),symbolLayers:li(this.symbolLayers),thumbnail:li(this.thumbnail)})}static fromJSON(i){const e=new hQ;if(e.read(i),e.symbolLayers.length===2&&e.symbolLayers.at(0).type==="fill"&&e.symbolLayers.at(1).type==="line"){const t=e.symbolLayers.at(0),r=e.symbolLayers.at(1);!r.enabled||i.symbolLayers?.[1]&&i.symbolLayers[1].enable===!1||(t.outline={size:r.size,color:r.material!=null?r.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(i){return new hQ({symbolLayers:new dr([fae.fromSimpleFillSymbol(i)])})}};x([D({type:$3t,json:{write:!0}})],dQ.prototype,"symbolLayers",void 0),x([Wr({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],dQ.prototype,"type",void 0),dQ=hQ=x([Qe("esri.symbols.PolygonSymbol3D")],dQ);const yae=dQ;var NFe;const g3e=new Rs({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let NN=NFe=class extends l3t{constructor(...i){super(...i),this.color=new jr([0,0,0,.25]),this.outline=new vg,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string")return i;const r={};return i&&(r.style=i),e&&(r.outline=e),t&&(r.color=t),r}clone(){return new NFe({color:li(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};x([D()],NN.prototype,"color",void 0),x([D()],NN.prototype,"outline",void 0),x([Wr({esriSFS:"simple-fill"},{readOnly:!0})],NN.prototype,"type",void 0),x([D({type:g3e.apiValues,json:{read:g3e.read,write:g3e.write}})],NN.prototype,"style",void 0),NN=NFe=x([Qe("esri.symbols.SimpleFillSymbol")],NN);const Hx=NN;var $Fe;const y3e=new Rs({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let fI=$Fe=class extends M3t{constructor(...i){super(...i),this.color=new jr([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new vg}normalizeCtorArgs(i,e,t,r){if(i&&typeof i!="string")return i;const n={};return i&&(n.style=i),e!=null&&(n.size=Cl(e)),t&&(n.outline=t),r&&(n.color=r),n}writeColor(i,e){i&&this.style!=="x"&&this.style!=="cross"&&(e.color=i.toJSON()),i===null&&(e.color=null)}set path(i){this.style="path",this._set("path",i)}clone(){return new $Fe({angle:this.angle,color:li(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${this.outline?.hash()}`}};x([D()],fI.prototype,"color",void 0),x([ur("color")],fI.prototype,"writeColor",null),x([Wr({esriSMS:"simple-marker"},{readOnly:!0})],fI.prototype,"type",void 0),x([D()],fI.prototype,"size",void 0),x([D({type:y3e.apiValues,json:{read:y3e.read,write:y3e.write}})],fI.prototype,"style",void 0),x([D({type:String,json:{write:!0}})],fI.prototype,"path",null),x([D({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":vg}},json:{default:null,write:!0}})],fI.prototype,"outline",void 0),fI=$Fe=x([Qe("esri.symbols.SimpleMarkerSymbol")],fI);const Jh=fI;var BFe;let od=BFe=class extends T0{constructor(...i){super(...i),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new mae,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(i,e,t){if(i&&typeof i!="string")return i;const r={};return i&&(r.text=i),e&&(r.font=e),t&&(r.color=t),r}writeLineWidth(i,e,t,r){r&&typeof r!="string"?r.origin:e[t]=i}castLineWidth(i){return Cl(i)}writeLineHeight(i,e,t,r){r&&typeof r!="string"?r.origin:e[t]=i}clone(){return new BFe({angle:this.angle,backgroundColor:li(this.backgroundColor),borderLineColor:li(this.borderLineColor),borderLineSize:this.borderLineSize,color:li(this.color),font:this.font&&this.font.clone(),haloColor:li(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){return`${this.backgroundColor?.hash()}.${this.borderLineColor}.${this.borderLineSize}.${this.color?.hash()}.${this.font&&this.font.hash()}.${this.haloColor?.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};x([D({type:jr,json:{write:!0}})],od.prototype,"backgroundColor",void 0),x([D({type:jr,json:{write:!0}})],od.prototype,"borderLineColor",void 0),x([D({type:Number,json:{write:!0},cast:Cl})],od.prototype,"borderLineSize",void 0),x([D({type:mae,json:{write:!0}})],od.prototype,"font",void 0),x([D({...v3t,json:{write:!0}})],od.prototype,"horizontalAlignment",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"kerning",void 0),x([D({type:jr,json:{write:!0}})],od.prototype,"haloColor",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"haloSize",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"rightToLeft",void 0),x([D({type:Boolean,json:{write:!0}})],od.prototype,"rotated",void 0),x([D({type:String,json:{write:!0}})],od.prototype,"text",void 0),x([Wr({esriTS:"text"},{readOnly:!0})],od.prototype,"type",void 0),x([D({..._3t,json:{write:!0}})],od.prototype,"verticalAlignment",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"xoffset",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],od.prototype,"yoffset",void 0),x([D({type:Number,json:{read:i=>i&&-1*i,write:(i,e)=>e.angle=i&&-1*i}})],od.prototype,"angle",void 0),x([D({type:Number,json:{write:!0}})],od.prototype,"width",void 0),x([D({type:Number})],od.prototype,"lineWidth",void 0),x([ur("lineWidth")],od.prototype,"writeLineWidth",null),x([So("lineWidth")],od.prototype,"castLineWidth",null),x([D(y3t)],od.prototype,"lineHeight",void 0),x([ur("lineHeight")],od.prototype,"writeLineHeight",null),od=BFe=x([Qe("esri.symbols.TextSymbol")],od);const qB=od;var jFe;let FT=jFe=class extends T0{constructor(i){super(i),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const i=this.portal!=null?this.portal:Bu.getDefault(),e=i.user?i.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${i.url}`}read(i,e){this.portal=e?.portal,super.read(i,e)}clone(){return new jFe({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(i){return this._fetchSymbol("webRef",i)}fetchCIMSymbol(i){return this._fetchSymbol("cimRef",i)}async _fetchSymbol(i,e){const t=e!=null?e.cache:null,r=t?this._fetchCacheKey:null;if(t!=null){const a=r&&t.get(r);if(a)return a.clone()}const{resolveWebStyleSymbol:n}=await Promise.resolve().then(()=>o7r);hn(e);const s=n(this,{portal:this.portal},i,e);s.catch(a=>{di.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await s;return i==="webRef"&&o.type==="point-3d"||i==="cimRef"&&o.type==="cim"?(t?.set(r,o.clone()),o):null}};x([D({json:{write:!1}})],FT.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],FT.prototype,"styleName",void 0),x([D({type:Bu,json:{write:!1}})],FT.prototype,"portal",void 0),x([D({type:String,json:{read:mY,write:cR}})],FT.prototype,"styleUrl",void 0),x([D({type:X8,json:{read:!1}})],FT.prototype,"thumbnail",void 0),x([D({type:String,json:{write:!0}})],FT.prototype,"name",void 0),x([Wr({styleSymbolReference:"web-style"},{readOnly:!0})],FT.prototype,"type",void 0),x([D()],FT.prototype,"_fetchCacheKey",null),FT=jFe=x([Qe("esri.symbols.WebStyleSymbol")],FT);const YB=FT;function P2e(i){if(!i)return!1;switch(i.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function JF(i){if(!i)return!1;switch(i.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Kh={base:T0,key:"type",typeMap:{"simple-fill":Hx,"picture-fill":F3t,"picture-marker":BP,"simple-line":vg,"simple-marker":Jh,text:qB,"label-3d":A2e,"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},ger={base:T0,key:"type",typeMap:{"picture-marker":BP,"simple-marker":Jh,text:qB,"web-style":YB,cim:pae},errorContext:"symbol"},yer=zB({types:Kh}),B3t={base:T0,key:"type",typeMap:{"simple-fill":Hx,"picture-fill":F3t,"picture-marker":BP,"simple-line":vg,"simple-marker":Jh,text:qB,"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},ver={base:T0,key:"type",typeMap:{text:qB,"label-3d":A2e},errorContext:"symbol"},Ont={base:T0,key:"type",typeMap:{"line-3d":M2e,"mesh-3d":O2e,"point-3d":a8,"polygon-3d":yae,"web-style":YB,cim:pae},errorContext:"symbol"},_er={base:T0,key:"type",typeMap:{"label-3d":A2e},errorContext:"symbol"},j3t=u3(Kh);var GFe;function ber(i){if(!i)return null;const e={};for(const t in i){const r=Ro(i[t]);r&&(e[t]=r)}return Object.keys(e).length!==0?e:null}function wer(i){if(i==null)return null;const e={};for(const t in i){const r=i[t];r&&(e[t]=r.toJSON())}return Object.keys(e).length!==0?e:null}let u1=GFe=class extends xs(Ci){constructor(...i){super(...i),this.isAggregate=!1,this.layer=null,this.origin=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:vF(),configurable:!0})}normalizeCtorArgs(i,e,t,r){return i&&!i.declaredClass?i:{geometry:i,symbol:e,attributes:t,popupTemplate:r}}set aggregateGeometries(i){const e=this._get("aggregateGeometries");JSON.stringify(e)!==JSON.stringify(i)&&this._set("aggregateGeometries",i)}set attributes(i){const e=this._get("attributes");e!==i&&(this._set("attributes",i),this._notifyLayer("attributes",e,i))}set geometry(i){const e=this._get("geometry");e!==i&&(this._set("geometry",i),this._notifyLayer("geometry",e,i))}set symbol(i){const e=this._get("symbol");e!==i&&(this._set("symbol",i),this._notifyLayer("symbol",e,i))}set visible(i){const e=this._get("visible");e!==i&&(this._set("visible",i),this._notifyLayer("visible",e,i))}cloneShallow(){return new GFe({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(i=!1){if(this.popupTemplate)return this.popupTemplate;const e=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[e,this.sourceLayer,this.layer])if(t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(i&&"defaultPopupTemplate"in t&&t.defaultPopupTemplate!=null)return t.defaultPopupTemplate}return null}getAttribute(i){return this.attributes?.[i]}setAttribute(i,e){if(this.attributes){const t=this.getAttribute(i);this.attributes[i]=e,this._notifyLayer("attributes",t,e,i)}else this.attributes={[i]:e},this._notifyLayer("attributes",void 0,e,i)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{aggregateGeometries:wer(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:W9(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(i={}){const{geometry:e}=this;if(e?.type==="mesh"){const t={origin:e.origin,transform:e.transform};this._notifyLayer("origin-transform",t,t,i.action)}}_notifyLayer(i,e,t,r){if(!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:i,oldValue:e,newValue:t};i==="origin-transform"&&(n.action=r),i==="attributes"&&(n.attributeName=r),this.layer.graphicChanged(n)}};x([D({value:null,json:{read:ber}})],u1.prototype,"aggregateGeometries",null),x([D({value:null})],u1.prototype,"attributes",null),x([D({value:null,types:Ff,json:{read:Ro}})],u1.prototype,"geometry",null),x([D({type:Boolean})],u1.prototype,"isAggregate",void 0),x([D({clonable:"reference"})],u1.prototype,"layer",void 0),x([D({clonable:"reference"})],u1.prototype,"origin",void 0),x([D({type:qc})],u1.prototype,"popupTemplate",void 0),x([D({clonable:"reference"})],u1.prototype,"sourceLayer",void 0),x([D({value:null,types:Kh})],u1.prototype,"symbol",null),x([D({type:Boolean,value:!0})],u1.prototype,"visible",null),u1=GFe=x([Qe("esri.Graphic")],u1),function(i){i.generateUID=vF}(u1||(u1={}));const Us=u1;var UFe;let pQ=UFe=class extends Ci{constructor(i){super(i),this.minValue=0,this.maxValue=0}clone(){return new UFe({minValue:this.minValue,maxValue:this.maxValue})}};x([D({type:Number,json:{write:!0}})],pQ.prototype,"minValue",void 0),x([D({type:Number,json:{write:!0}})],pQ.prototype,"maxValue",void 0),pQ=UFe=x([Qe("esri.renderer.support.AuthoringInfoClassBreakInfo")],pQ);var zFe;let p5=zFe=class extends Ci{constructor(i){super(i),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new zFe({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:li(this.classBreakInfos)})}};x([D({type:String,json:{write:!0}})],p5.prototype,"field",void 0),x([D({type:String,json:{write:!0}})],p5.prototype,"normalizationField",void 0),x([D({type:String,json:{write:!0}})],p5.prototype,"label",void 0),x([D({type:[pQ],json:{write:!0}})],p5.prototype,"classBreakInfos",void 0),p5=zFe=x([Qe("esri.renderers.support.AuthoringInfoFieldInfo")],p5);var VFe;const Yce=new Rs({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),Xce=new Rs({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Pnt={key:i=>typeof i=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},Rnt=["high-to-low","above-and-below","centered-on","extremes"],Dnt=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],Fnt=["seconds","minutes","hours","days","months","years"];let k_=VFe=class extends Ci{constructor(i){super(i),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(i){return typeof i=="string"||typeof i=="number"?i:null}castStartTime(i){return typeof i=="string"||typeof i=="number"?i:null}get style(){return this.type==="color"?this._get("style"):null}set style(i){this._set("style",i)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(i){this._set("theme",i)}clone(){return new VFe({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};x([D({types:Pnt,json:{write:!0}})],k_.prototype,"endTime",void 0),x([So("endTime")],k_.prototype,"castEndTime",null),x([D({type:String,json:{write:!0}})],k_.prototype,"field",void 0),x([D({type:Number,json:{write:!0}})],k_.prototype,"maxSliderValue",void 0),x([D({type:Number,json:{write:!0}})],k_.prototype,"minSliderValue",void 0),x([D({types:Pnt,json:{write:!0}})],k_.prototype,"startTime",void 0),x([So("startTime")],k_.prototype,"castStartTime",null),x([D({type:Yce.apiValues,value:null,json:{type:Yce.jsonValues,read:Yce.read,write:Yce.write}})],k_.prototype,"style",null),x([D({type:Dnt,value:null,json:{type:Dnt,origins:{"web-scene":{type:Rnt,write:{writer:(i,e)=>{Rnt.includes(i)&&(e.theme=i)}}}},write:!0}})],k_.prototype,"theme",null),x([D({type:Xce.apiValues,json:{type:Xce.jsonValues,read:Xce.read,write:Xce.write}})],k_.prototype,"type",void 0),x([D({type:Fnt,json:{type:Fnt,write:!0}})],k_.prototype,"units",void 0),k_=VFe=x([Qe("esri.renderers.support.AuthoringInfoVisualVariable")],k_);const xer=k_;let vme=class extends Ci{constructor(e){super(e),this.type=null}};x([D({readOnly:!0,json:{read:!1,write:!0}})],vme.prototype,"type",void 0),vme=x([Qe("esri.rest.support.ColorRamp")],vme);const sVe=vme;var HFe;let $N=HFe=class extends sVe{constructor(i){super(i),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new HFe({fromColor:li(this.fromColor),toColor:li(this.toColor),algorithm:this.algorithm})}};x([Wr({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],$N.prototype,"algorithm",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],$N.prototype,"fromColor",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],$N.prototype,"toColor",void 0),x([D({type:["algorithmic"]})],$N.prototype,"type",void 0),$N=HFe=x([Qe("esri.rest.support.AlgorithmicColorRamp")],$N);const oVe=$N;var WFe;let fQ=WFe=class extends sVe{constructor(i){super(i),this.colorRamps=null,this.type="multipart"}clone(){return new WFe({colorRamps:li(this.colorRamps)})}};x([D({type:[oVe],json:{write:!0}})],fQ.prototype,"colorRamps",void 0),x([D({type:["multipart"]})],fQ.prototype,"type",void 0),fQ=WFe=x([Qe("esri.rest.support.MultipartColorRamp")],fQ);const R2e=fQ,D2e={key:"type",base:sVe,typeMap:{algorithmic:oVe,multipart:R2e}};function F2e(i){return i?.type?i.type==="algorithmic"?oVe.fromJSON(i):i.type==="multipart"?R2e.fromJSON(i):null:null}var qFe;const BL=new Rs({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),Jce=new Rs({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),knt=new Rs({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),Lnt=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],Ser=["high-to-low","above-and-below","above","below","90-10"],Ter=["flow-line","wave-front"],Cer=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let Qd=qFe=class extends Ci{constructor(i){super(i),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const i=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?i||"manual":null:i}set classificationMethod(i){this._set("classificationMethod",i)}readColorRamp(i){return i?F2e(i):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(i){this._set("fields",i)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(i){this._set("field1",i)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(i){this._set("field2",i)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(i){this._set("flowTheme",i)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(i){this._set("focus",i)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(i){this._set("numClasses",i)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(i){this._set("statistics",i)}get standardDeviationInterval(){const i=this.type;return i&&i!=="relationship"&&i!=="class-breaks-size"&&i!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(i){this._set("standardDeviationInterval",i)}get type(){return this._get("type")}set type(i){let e=i;i==="classed-size"?e="class-breaks-size":i==="classed-color"&&(e="class-breaks-color"),this._set("type",e)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(i){this._set("univariateSymbolStyle",i)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(i){this._set("univariateTheme",i)}clone(){return new qFe({classificationMethod:this.classificationMethod,colorRamp:li(this.colorRamp),fadeRatio:li(this.fadeRatio),fields:this.fields?.slice(0),field1:li(this.field1),field2:li(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(i=>i.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};x([D({type:BL.apiValues,value:null,json:{type:BL.jsonValues,read:BL.read,write:BL.write,origins:{"web-document":{default:"manual",type:BL.jsonValues,read:BL.read,write:BL.write}}}})],Qd.prototype,"classificationMethod",null),x([D({types:D2e,json:{write:!0}})],Qd.prototype,"colorRamp",void 0),x([Mi("colorRamp")],Qd.prototype,"readColorRamp",null),x([D({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"fadeRatio",void 0),x([D({type:[String],value:null,json:{write:!0}})],Qd.prototype,"fields",null),x([D({type:p5,value:null,json:{write:!0}})],Qd.prototype,"field1",null),x([D({type:p5,value:null,json:{write:!0}})],Qd.prototype,"field2",null),x([D({type:Ter,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"flowTheme",null),x([D({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],Qd.prototype,"focus",null),x([D({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"isAutoGenerated",void 0),x([D({type:Number,value:null,json:{type:ms,write:!0}})],Qd.prototype,"numClasses",null),x([D({type:Lnt,json:{type:Lnt,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],Qd.prototype,"lengthUnit",void 0),x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"maxSliderValue",void 0),x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"minSliderValue",void 0),x([D({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Qd.prototype,"statistics",null),x([D({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],Qd.prototype,"standardDeviationInterval",null),x([D({type:Jce.apiValues,value:null,json:{type:Jce.jsonValues,read:Jce.read,write:Jce.write,origins:{"web-scene":{type:knt.jsonValues,write:{writer:knt.write,overridePolicy:i=>({enabled:i!=="flow"})}}}}})],Qd.prototype,"type",null),x([D({type:[xer],json:{write:!0}})],Qd.prototype,"visualVariables",void 0),x([D({type:Cer,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"univariateSymbolStyle",null),x([D({type:Ser,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qd.prototype,"univariateTheme",null),Qd=qFe=x([Qe("esri.renderers.support.AuthoringInfo")],Qd);const vae=Qd,v3e=new Rs({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let mQ=class extends Ci{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};x([D({type:vae,json:{write:!0}})],mQ.prototype,"authoringInfo",void 0),x([D({type:v3e.apiValues,readOnly:!0,json:{type:v3e.jsonValues,read:!1,write:{writer:v3e.write,ignoreOrigin:!0}}})],mQ.prototype,"type",void 0),mQ=x([Qe("esri.renderers.Renderer")],mQ);const V3=mQ;function Eer(i){return i.match(Ier)?.[1]?.replace(/\\'/g,"'")??null}const Ier=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var YFe;let UA=YFe=class extends Ci{constructor(){super(...arguments),this.title=null}clone(){return new YFe({title:this.title})}};x([D({type:String,json:{write:!0}})],UA.prototype,"title",void 0),UA=YFe=x([Qe("esri.renderers.support.LegendOptions")],UA);var XFe;let _me=XFe=class extends UA{constructor(){super(...arguments),this.showLegend=null}clone(){return new XFe({title:this.title,showLegend:this.showLegend})}};x([D({type:Boolean,json:{write:!0}})],_me.prototype,"showLegend",void 0),_me=XFe=x([Qe("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],_me);const G3t=_me,_3e=new Rs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let kT=class extends Ci{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};x([D()],kT.prototype,"index",void 0),x([D({type:_3e.apiValues,readOnly:!0,json:{read:_3e.read,write:_3e.write}})],kT.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],kT.prototype,"field",void 0),x([So("field")],kT.prototype,"castField",null),x([D({type:String,json:{write:!0}})],kT.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],kT.prototype,"valueExpressionTitle",void 0),x([D({readOnly:!0})],kT.prototype,"arcadeRequired",null),x([D({type:G3t,json:{write:!0}})],kT.prototype,"legendOptions",void 0),kT=x([Qe("esri.renderers.visualVariables.VisualVariable")],kT);const _ae=kT;var JFe;let BN=JFe=class extends Ci{constructor(i){super(i),this.color=null,this.label=null,this.value=null}writeValue(i,e,t){e[t]=i??0}clone(){return new JFe({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};x([D({type:jr,json:{type:[ms],write:!0}})],BN.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],BN.prototype,"label",void 0),x([D({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],BN.prototype,"value",void 0),x([ur("value")],BN.prototype,"writeValue",null),BN=JFe=x([Qe("esri.renderers.visualVariables.support.ColorStop")],BN);const U3t=BN;var KFe;let jN=KFe=class extends _ae{constructor(i){super(i),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(i){i&&Array.isArray(i)&&(i=i.filter(e=>!!e)).sort((e,t)=>e.value-t.value),this._set("stops",i)}clone(){return new KFe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(i=>i.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(i=>i.value||0)}};x([D({readOnly:!0})],jN.prototype,"cache",null),x([D({type:["color"],json:{type:["colorInfo"]}})],jN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],jN.prototype,"normalizationField",void 0),x([D({type:[U3t],json:{write:!0}})],jN.prototype,"stops",null),jN=KFe=x([Qe("esri.renderers.visualVariables.ColorVariable")],jN);const z3t=jN;var ZFe;let p4=ZFe=class extends Ci{constructor(i){super(i),this.label=null,this.opacity=null,this.value=null}readOpacity(i,e){return vW(e.transparency)}writeOpacity(i,e,t){e[t]=E2e(i)}clone(){return new ZFe({label:this.label,opacity:this.opacity,value:this.value})}};x([D({type:String,json:{write:!0}})],p4.prototype,"label",void 0),x([D({type:Number,json:{type:ms,write:{target:"transparency"}}})],p4.prototype,"opacity",void 0),x([Mi("opacity",["transparency"])],p4.prototype,"readOpacity",null),x([ur("opacity")],p4.prototype,"writeOpacity",null),x([D({type:Number,json:{write:!0}})],p4.prototype,"value",void 0),p4=ZFe=x([Qe("esri.renderers.visualVariables.support.OpacityStop")],p4);const Aer=p4;var QFe;let GN=QFe=class extends _ae{constructor(i){super(i),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(i){i&&Array.isArray(i)&&(i=i.filter(e=>!!e)).sort((e,t)=>e.value-t.value),this._set("stops",i)}clone(){return new QFe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(i=>i.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(i=>i.value||0)}};x([D({readOnly:!0})],GN.prototype,"cache",null),x([D({type:["opacity"],json:{type:["transparencyInfo"]}})],GN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],GN.prototype,"normalizationField",void 0),x([D({type:[Aer],json:{write:!0}})],GN.prototype,"stops",null),GN=QFe=x([Qe("esri.renderers.visualVariables.OpacityVariable")],GN);const V3t=GN;var eke;let VM=eke=class extends _ae{constructor(i){super(i),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(i,e,t,r){if(r?.messages){const n=`visualVariables[${this.index}]`;r.messages.push(new qe("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpressionTitle",context:r}))}}clone(){return new eke({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};x([D({readOnly:!0})],VM.prototype,"cache",null),x([D({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],VM.prototype,"axis",void 0),x([D({type:["rotation"],json:{type:["rotationInfo"]}})],VM.prototype,"type",void 0),x([D({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],VM.prototype,"rotationType",void 0),x([D({type:String,json:{write:!0}})],VM.prototype,"valueExpressionTitle",void 0),x([ur("web-scene","valueExpressionTitle")],VM.prototype,"writeValueExpressionTitleWebScene",null),VM=eke=x([Qe("esri.renderers.visualVariables.RotationVariable")],VM);const k2e=VM;var tke;let f4=tke=class extends Ci{constructor(i){super(i),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new tke({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};x([D({type:String,json:{write:!0}})],f4.prototype,"label",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],f4.prototype,"size",void 0),x([D({type:Number,json:{write:!0}})],f4.prototype,"value",void 0),x([D({type:Boolean,json:{write:!1}})],f4.prototype,"useMinValue",void 0),x([D({type:Boolean,json:{write:!1}})],f4.prototype,"useMaxValue",void 0),f4=tke=x([Qe("esri.renderers.visualVariables.support.SizeStop")],f4);const bme=f4;var ike;let wme=ike=class extends G3t{constructor(){super(...arguments),this.customValues=null}clone(){return new ike({title:this.title,showLegend:this.showLegend,customValues:this.customValues?.slice(0)})}};x([D({type:[Number],json:{write:!0}})],wme.prototype,"customValues",void 0),wme=ike=x([Qe("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],wme);const Mer=wme;var jP,Mh;function kz(i){return i&&i.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function Dne(i){return i!=null&&!isNaN(i)&&isFinite(i)}function H3t(i){return i.valueExpression?jP.Expression:i.field&&typeof i.field=="string"?jP.Field:jP.Unknown}function Oer(i,e){const t=e||H3t(i),r=i.valueUnit||"unknown";return t===jP.Unknown?Mh.Constant:i.stops?Mh.Stops:i.minSize!=null&&i.maxSize!=null&&i.minDataValue!=null&&i.maxDataValue!=null?Mh.ClampedLinear:r==="unknown"?i.minSize!=null&&i.minDataValue!=null?i.minSize&&i.minDataValue?Mh.Proportional:Mh.Additive:Mh.Identity:Mh.RealWorldSize}(function(i){i.Unknown="unknown",i.Expression="expression",i.Field="field"})(jP||(jP={})),function(i){i.Unknown="unknown",i.Stops="stops",i.ClampedLinear="clamped-linear",i.Proportional="proportional",i.Additive="additive",i.Constant="constant",i.Identity="identity",i.RealWorldSize="real-world-size"}(Mh||(Mh={}));function Per(i){return()=>i}const bae={unknown:1,inches:tb(1,"meters","inches"),feet:tb(1,"meters","feet"),"us-feet":tb(1,"meters","us-feet"),yards:tb(1,"meters","yards"),miles:tb(1,"meters","miles"),"nautical-miles":tb(1,"meters","nautical-miles"),millimeters:tb(1,"meters","millimeters"),centimeters:tb(1,"meters","centimeters"),decimeters:tb(1,"meters","decimeters"),meters:tb(1,"meters","meters"),kilometers:tb(1,"meters","kilometers"),"decimal-degrees":1/Bqi(1,"meters",Td.radius)},KF=()=>di.getLogger("esri.renderers.visualVariables.support.visualVariableUtils");new Us;const xme=Math.PI,W3t=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function Rer(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(v=>v.type==="color"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s?.attributes;let a=n?e:null;const l=r.field,{ipData:u,hasExpression:c}=r.cache;let h=r.cache.compiledFunc;if(!l&&!c){const v=r.stops;return v&&v[0]&&v[0].color}if(typeof a!="number")if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const v={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},w=t.arcade.arcadeUtils,S=w.getViewInfo(v),I=w.createExecContext(s,S,t.timeZone);if(!h){const R=w.createSyntaxTree(r.valueExpression);h=w.createFunction(R),r.cache.compiledFunc=h}a=w.executeFunction(h,I)}else o&&(a=o[l]);const p=r.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const v=lVe(a,u);if(v){const w=v[0],S=v[1],I=w===S?r.stops[w].color:jr.blendColors(r.stops[w].color,r.stops[S].color,v[2],t?.color);return new jr(I)}}}function Der(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(v=>v.type==="opacity"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s?.attributes;let a=n?e:null;const l=r.field,{ipData:u,hasExpression:c}=r.cache;let h=r.cache.compiledFunc;if(!l&&!c){const v=r.stops;return v&&v[0]&&v[0].opacity}if(typeof a!="number")if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const v={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},w=t.arcade.arcadeUtils,S=w.getViewInfo(v),I=w.createExecContext(s,S,t.timeZone);if(!h){const R=w.createSyntaxTree(r.valueExpression);h=w.createFunction(R),r.cache.compiledFunc=h}a=w.executeFunction(h,I)}else o&&(a=o[l]);const p=r.normalizationField,m=o!=null&&p!=null?parseFloat(o[p]):void 0;if(a!=null&&(!p||n||!isNaN(m)&&m!==0)){isNaN(m)||n||(a/=m);const v=lVe(a,u);if(v){const w=v[0],S=v[1];if(w===S)return r.stops[w].opacity;{const I=r.stops[w].opacity;return I+(r.stops[S].opacity-I)*v[2]}}}}function q3t(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(m=>m.type==="rotation"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const n=r.axis||"heading",s=n==="heading"&&r.rotationType==="arithmetic"?90:0,o=n==="heading"&&r.rotationType==="arithmetic"?-1:1,a=typeof e=="number"?null:e,l=a?.attributes,u=r.field,{hasExpression:c}=r.cache;let h=r.cache.compiledFunc,p=0;if(!u&&!c)return p;if(c){if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const m={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},v=t.arcade.arcadeUtils,w=v.getViewInfo(m),S=v.createExecContext(a,w,t.timeZone);if(!h){const I=v.createSyntaxTree(r.valueExpression);h=v.createFunction(I),r.cache.compiledFunc=h}p=v.executeFunction(h,S)}else l&&(p=l[u]||0);return p=typeof p!="number"||isNaN(p)?null:s+o*p,p}function Fer(i,e,t){const r=typeof e=="number",n=r?null:e,s=n?.attributes;let o=r?e:null;const{isScaleDriven:a}=i.cache;let l=i.cache.compiledFunc;if(a){const c=t?.scale,h=t?.view;o=c==null||h==="3d"?ker(i):c}else if(!r)switch(i.inputValueType){case jP.Expression:{if(t?.arcade==null)return void KF().error("Use of arcade expressions requires an arcade context");const c={viewingMode:t.viewingMode,scale:t.scale,spatialReference:t.spatialReference},h=t.arcade.arcadeUtils,p=h.getViewInfo(c),m=h.createExecContext(n,p,t.timeZone);if(!l){const v=h.createSyntaxTree(i.valueExpression);l=h.createFunction(v),i.cache.compiledFunc=l}o=h.executeFunction(l,m);break}case jP.Field:s&&(o=s[i.field]);break;case jP.Unknown:o=null}if(!Dne(o))return null;if(r||!i.normalizationField)return o;const u=s?parseFloat(s[i.normalizationField]):null;return Dne(u)&&u!==0?o/u:null}function ker(i){let e=null,t=null;const r=i.stops;return r?(e=r[0].value,t=r[r.length-1].value):(e=i.minDataValue||0,t=i.maxDataValue||0),(e+t)/2}function aVe(i,e,t){const r="visualVariables"in i&&i.visualVariables?i.visualVariables.find(s=>s.type==="size"):i;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void KF().warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=X3t(Fer(r,e,t),r,e,t,r.cache.ipData);return n==null||isNaN(n)?0:n}function bS(i,e,t){return i==null?null:kz(i)?aVe(i,e,t):Dne(i)?i:null}function Y3t(i,e,t){return Dne(t)&&i>t?t:Dne(e)&&i=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&a){const l=a==="circle",u=l?xme*(s/2)**2:s*s,c=u+n*((l?xme*(o/2)**2:o*o)-u);return l?2*Math.sqrt(c/xme):Math.sqrt(c)}return s+n*(o-s)}function Ber(i,e,t,r){const n=r?.shape,s=i/e.minDataValue,o=bS(e.minSize,t,r),a=bS(e.maxSize,t,r);let l=null;return l=n==="circle"?2*Math.sqrt(s*(o/2)**2):n==="square"||n==="diamond"||n==="image"?Math.sqrt(s*o**2):s*o,Y3t(l,o,a)}function jer(i,e,t,r,n){const[s,o,a]=lVe(i,n);if(s===o)return bS(e.stops?.[s].size,t,r);{const l=bS(e.stops?.[s].size,t,r);return l+(bS(e.stops?.[o].size,t,r)-l)*a}}function Ger(i,e,t,r){const n=(r?.resolution??1)*bae[e.valueUnit],s=bS(e.minSize,t,r),o=bS(e.maxSize,t,r),{valueRepresentation:a}=e;let l=null;return l=a==="area"?2*Math.sqrt(i/xme)/n:a==="radius"||a==="distance"?2*i/n:i/n,Y3t(l,s,o)}function X3t(i,e,t,r,n){switch(e.transformationType){case Mh.Additive:return Ler(i,e,t,r);case Mh.Constant:return Ner(e,t,r);case Mh.ClampedLinear:return $er(i,e,t,r);case Mh.Proportional:return Ber(i,e,t,r);case Mh.Stops:return jer(i,e,t,r,n);case Mh.RealWorldSize:return Ger(i,e,t,r);case Mh.Identity:return i;case Mh.Unknown:return null}}function lVe(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((n,s)=>i!!e)).sort((e,t)=>e.value-t.value):i&&(di.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),i=null),this._set("stops",i)}get transformationType(){return Oer(this,this.inputValueType)}readValueExpression(i,e){return i||e.expression&&"$view.scale"}writeValueExpressionWebScene(i,e,t,r){if(i==="$view.scale"){if(r?.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;r.messages.push(new qe("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:s+".valueExpression",context:r}))}}else e[t]=i}readValueUnit(i){return i?nke.read(i):null}clone(){return new rke({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:kz(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:kz(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(i=>i.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Mh.ClampedLinear){const{minSize:i,maxSize:e}=this;return this.minSize=e,this.maxSize=i,this}if(this.transformationType===Mh.Stops){const i=this.stops;if(!i)return this;const e=i.map(r=>r.size).reverse(),t=i.length;for(let r=0;ri.value||0)}};x([D({readOnly:!0})],Ku.prototype,"cache",null),x([D({type:Kce.apiValues,json:{type:Kce.jsonValues,origins:{"web-map":{read:!1}},read:Kce.read,write:Kce.write}})],Ku.prototype,"axis",void 0),x([D({type:String,value:null,json:{read:!1}})],Ku.prototype,"expression",null),x([D()],Ku.prototype,"index",null),x([D({type:String,readOnly:!0})],Ku.prototype,"inputValueType",null),x([D({type:Mer,json:{write:!0}})],Ku.prototype,"legendOptions",void 0),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"maxDataValue",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"maxSize",null),x([So("maxSize")],Ku.prototype,"castMaxSize",null),x([Mi("maxSize")],Ku.prototype,"readMaxSize",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"minDataValue",null),x([D({type:Number,value:null,json:{write:!0}})],Ku.prototype,"minSize",null),x([So("minSize")],Ku.prototype,"castMinSize",null),x([Mi("minSize")],Ku.prototype,"readMinSize",null),x([D({type:String,json:{write:!0}})],Ku.prototype,"normalizationField",void 0),x([D({readOnly:!0})],Ku.prototype,"arcadeRequired",null),x([D({type:String})],Ku.prototype,"scaleBy",void 0),x([D({type:[bme],value:null,json:{write:!0}})],Ku.prototype,"stops",null),x([D({type:["outline"],json:{write:!0}})],Ku.prototype,"target",void 0),x([D({type:String,readOnly:!0})],Ku.prototype,"transformationType",null),x([D({type:["size"],json:{type:["sizeInfo"]}})],Ku.prototype,"type",void 0),x([D({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],Ku.prototype,"useSymbolValue",void 0),x([D({type:String,json:{write:!0}})],Ku.prototype,"valueExpression",void 0),x([Mi("valueExpression",["valueExpression","expression"])],Ku.prototype,"readValueExpression",null),x([ur("web-scene","valueExpression")],Ku.prototype,"writeValueExpressionWebScene",null),x([D({type:["radius","diameter","area","width","distance"],json:{write:!0}})],Ku.prototype,"valueRepresentation",void 0),x([D({type:nke.apiValues,json:{write:nke.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],Ku.prototype,"valueUnit",void 0),x([Mi("valueUnit")],Ku.prototype,"readValueUnit",null),Ku=rke=x([Qe("esri.renderers.visualVariables.SizeVariable")],Ku);const CY=Ku,Uer={color:z3t,size:CY,opacity:V3t,rotation:k2e},zer=new Rs({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),Ver=/^\[([^\]]+)\]$/i;let Sme=class extends un{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e&&e.filter(t=>!!t),e?.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,r)=>{let n=null;return n=t.target===r.target?0:t.target?1:-1,n});for(let t=0;t{const u=zer.read(l.type),c=Uer[u];c||(di.getLogger(this).warn(`Unknown variable type: ${u}`),r?.messages&&r.messages.push(new Rf("visual-variable:unsupported",`visualVariable of type '${u}' is not supported`,{definition:l,context:r})));const h=new c;return h.read(l,r),h})}writeVariables(e,t){const r=[];for(const n of e){const s=n.toJSON(t);s&&r.push(s)}return r}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};x([D()],Sme.prototype,"visualVariables",null),Sme=x([Qe("esri.renderers.visualVariables.VisualVariableFactory")],Sme);const Her=Sme,Wer={base:_ae,key:"type",typeMap:{opacity:V3t,color:z3t,rotation:k2e,size:CY}},Wk=i=>{let e=class extends i{constructor(){super(...arguments),this._vvFactory=new Her}set visualVariables(t){this._vvFactory.visualVariables=t,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(t,r,n){return this._vvFactory.readVariables(t,r,n)}writeVisualVariables(t,r,n,s){r[n]=this._vvFactory.writeVariables(t,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const t of this.visualVariables)if(t.arcadeRequired)return!0;return!1}hasVisualVariables(t,r){return t?this.getVisualVariablesForType(t,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(t,r){const n=this.visualVariables;return n?n.filter(s=>s.type===t&&(typeof r=="string"?s.target===r:r!==!1||!s.target)):[]}async collectVVRequiredFields(t,r){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&$v(t,r,s.field),s.normalizationField&&$v(t,r,s.normalizationField),s.valueExpression&&(qer(s.valueExpression,t,r)||await i_(t,r,s.valueExpression)))}};return x([D({types:[Wer],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),x([Mi("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),x([ur("visualVariables")],e.prototype,"writeVisualVariables",null),e=x([Qe("esri.renderers.mixins.VisualVariablesMixin")],e),e};function qer(i,e,t){const r=Eer(i);return r!=null&&($v(e,t,r),!0)}const PJ={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function Yer(i,e=PJ){if(!i)return{symbol:null};const{retainId:t=PJ.retainId,ignoreDrivers:r=PJ.ignoreDrivers,hasLabelingContext:n=PJ.hasLabelingContext,retainCIM:s=PJ.retainCIM}=e;let o=null;if(JF(i)||i instanceof YB)o=i.clone();else if(i.type==="cim"){const a=i.data?.symbol?.type;if(a!=="CIMPointSymbol")return{error:new qe("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${a||"unknown"}' is unsupported in 3D`,{symbol:i})};o=s?i.clone():a8.fromCIMSymbol(i)}else if(i instanceof vg)o=M2e.fromSimpleLineSymbol(i);else if(i instanceof Jh)o=a8.fromSimpleMarkerSymbol(i);else if(i instanceof BP)o=a8.fromPictureMarkerSymbol(i);else if(i instanceof Hx)o=e.geometryType&&e.geometryType==="mesh"?O2e.fromSimpleFillSymbol(i):yae.fromSimpleFillSymbol(i);else{if(!(i instanceof qB))return{error:new qe("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${i.type||i.declaredClass}' is unsupported in 3D`,{symbol:i})};o=n?A2e.fromTextSymbol(i):a8.fromTextSymbol(i)}return t&&o&&o.type!=="cim"&&(o.id=i.id),r&&JF(o)&&o.symbolLayers.forEach(a=>a.ignoreDrivers=!0),{symbol:o}}function l1e(i,e,t,r){const n=K3t(i,{},{context:r,isLabelSymbol:!1});n!=null&&(e[t]=n)}function Bnt(i,e,t,r){const n=K3t(i,{},{context:r,isLabelSymbol:!0});n!=null&&(e[t]=n)}function jnt(i){return i instanceof TY||i instanceof YB}function K3t(i,e,t){if(i==null)return null;const{context:r,isLabelSymbol:n}=t,s=r?.origin,o=r?.messages;if(s==="web-scene"&&!jnt(i)){const a=Yer(i,{retainCIM:!0,hasLabelingContext:n});return a.symbol!=null?a.symbol.write(e,r):(o?.push(new qe("symbol:unsupported",`Symbols of type '${i.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:i,context:r,error:a.error})),null)}return(s==="web-map"||s==="portal-item"&&!BEt(r?.layer))&&jnt(i)?(o?.push(new qe("symbol:unsupported",`Symbols of type '${i.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:i,context:r})),null):i.write(e,r)}function wae(i,e){return yer(i,null,e)}const N2e={types:B3t,json:{write:{writer:l1e},origins:{"web-scene":{types:Ont,write:{writer:l1e},read:{reader:zB({types:Ont})}}}}},uVe=GUe({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},N2e),Z3t={types:{base:T0,key:"type",typeMap:{"simple-fill":Kh.typeMap["simple-fill"],"picture-fill":Kh.typeMap["picture-fill"],"polygon-3d":Kh.typeMap["polygon-3d"]}},json:{write:{writer:l1e},origins:{"web-scene":{type:yae,write:{writer:l1e}}}}},Tme={cast:i=>i==null||typeof i=="string"||typeof i=="number"?i:`${i}`,json:{type:String,write:{writer:(i,e)=>{e.value=i?.toString()}}}};var ske;let m4=ske=class extends Ci{constructor(i){super(i),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new ske({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const i=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${i}`}};x([D({type:String,json:{write:!0}})],m4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],m4.prototype,"label",void 0),x([D({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],m4.prototype,"minValue",void 0),x([D({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],m4.prototype,"maxValue",void 0),x([D(uVe)],m4.prototype,"symbol",void 0),m4=ske=x([Qe("esri.renderers.support.ClassBreakInfo")],m4);const _W=m4;var oke;const Q3t="log",Cme="percent-of-total",Eme="field",Zce=new Rs({esriNormalizeByLog:Q3t,esriNormalizeByPercentOfTotal:Cme,esriNormalizeByField:Eme}),Xer=Sd(_W);let Vf=oke=class extends Wk(V3){constructor(i){super(i),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(i,e,t){if(!Array.isArray(i))return;let r=e.minValue;return i.map(n=>{const s=new _W;return s.read(n,t),s.minValue==null&&(s.minValue=r),s.maxValue==null&&(s.maxValue=s.minValue),r=s.maxValue,s})}writeClassBreakInfos(i,e,t,r){const n=i.map(s=>s.write({},r));this._areClassBreaksConsecutive()&&n.forEach(s=>delete s.classMinValue),e[t]=n}castField(i){return i==null?i:typeof i=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(i)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let i=this._get("normalizationType");const e=!!this.normalizationField,t=this.normalizationTotal!=null;return e||t?(i=e&&Eme||t&&Cme||null,e&&t&&di.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):i!==Eme&&i!==Cme||(i=null),i}set normalizationType(i){this._set("normalizationType",i)}addClassBreakInfo(i,e,t){let r=null;r=typeof i=="number"?new _W({minValue:i,maxValue:e,symbol:j3t(t)}):Xer(li(i)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(i,e){const t=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[t].symbol:this.defaultSymbol}async getSymbolAsync(i,e){let t=e;if(this.valueExpression&&e?.arcade==null){const n=await e_(),{arcadeUtils:s}=n;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),t={...t,arcade:n}}const r=this.getBreakIndex(i,t);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const i=[];return this.classBreakInfos.forEach(e=>{e.symbol&&i.push(e.symbol)}),this.defaultSymbol&&i.push(this.defaultSymbol),i}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){const i=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),t=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${i}.${e}.${this.classBreakInfos.reduce((r,n)=>r+n.getMeshHash(),"")}.${t}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new oke({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:li(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:li(this.visualVariables),legendOptions:li(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(i,e){const t=[this.collectVVRequiredFields(i,e),this.collectSymbolFields(i,e)];await Promise.all(t)}async collectSymbolFields(i,e){const t=[...this.getSymbols().map(r=>r.collectRequiredFields(i,e)),i_(i,e,this.valueExpression)];$v(i,e,this.field),$v(i,e,this.normalizationField),await Promise.all(t)}_getBreakIndexForExpression(i,e){const{viewingMode:t,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{},{valueExpression:a}=this;let l=this._compiledValueExpression.valueExpression===a?this._compiledValueExpression.compiledFunction:null;const u=s.arcadeUtils;if(!l){const h=u.createSyntaxTree(a);l=u.createFunction(h),this._compiledValueExpression.compiledFunction=l}this._compiledValueExpression.valueExpression=a;const c=u.executeFunction(l,u.createExecContext(i,u.getViewInfo({viewingMode:t,scale:r,spatialReference:n}),o));return this._getBreakIndexfromInfos(c)}_getBreakIndexForField(i){const e=this.field,t=i.attributes,r=this.normalizationType;let n=parseFloat(t[e]);if(r){const s=this.normalizationTotal,o=parseFloat(this.normalizationField?t[this.normalizationField]:void 0);if(r===Q3t)n=Math.log(n)*Math.LOG10E;else if(r!==Cme||s==null||isNaN(s)){if(r===Eme&&!isNaN(o)){if(isNaN(n)||isNaN(o))return-1;n/=o}}else n=n/s*100}return this._getBreakIndexfromInfos(n)}_getBreakIndexfromInfos(i){const e=this.isMaxInclusive;if(i!=null&&typeof i=="number"&&!isNaN(i))for(let t=0;tGd(i),json:{write:!0}})],Vf.prototype,"normalizationTotal",void 0),x([D({type:Zce.apiValues,value:null,json:{type:Zce.jsonValues,read:Zce.read,write:Zce.write}})],Vf.prototype,"normalizationType",null),x([Wr({classBreaks:"class-breaks"})],Vf.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],Vf.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],Vf.prototype,"valueExpressionTitle",void 0),Vf=oke=x([Qe("esri.renderers.ClassBreaksRenderer")],Vf);const XB=Vf,ake=-3,Jer=ake-1;var GO;(function(i){i[i.ALL=0]="ALL",i[i.SOME=1]="SOME"})(GO||(GO={}));let Ker=class{constructor(e,t,r){this.name=e,this._storage=t,this.id=Zer+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,r,n=0){this._storage.put(this,e,t,r,n)}pop(e){const t=this._storage.pop(this,e);return t===void 0?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return t===void 0?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}},eMt=class{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new mg,this._users=new mg}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(t=>t[0]!==e)}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,r,n,s){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==r&&this._notifyRemove(t,o.entry,o.size,GO.ALL)),n>this._maxSize)return void this._notifyRemove(t,r,n,GO.ALL);if(r===void 0)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,r,0,GO.ALL);const a=1+Math.max(s,Jer)-ake;this._db.set(t,new Qer(r,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,r,n){t=e.id+t;const s=this._db.get(t);if(s&&s.entry===r){for(this._size-=s.size,e.size-=s.size;n>this._maxSize;){const o=this._notifyRemove(t,r,n,GO.SOME);if(!(o!=null&&o>0))return void this._db.delete(t);n=o}s.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(r!==void 0)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}peek(e,t){const r=this._db.get(e.id+t);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},r=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;r[l]=(r[l]||0)+o.size,this._users.forAll(u=>{const{id:c,name:h}=u;if(a.startsWith(c)){const p=t[h]||0;t[h]=p+o.size}})});const n={};this._users.forAll(o=>{const a=o.name;if("hitRate"in o&&typeof o.hitRate=="number"&&!isNaN(o.hitRate)&&o.hitRate>0){const l=t[a]||0;t[a]=l,n[a]=Math.round(100*o.hitRate)+"%"}else n[a]="0%"});const s=Object.keys(t);s.sort((o,a)=>t[a]-t[o]),s.forEach(o=>e[o]=Math.round(t[o]/2**20)+"MB / "+n[o]);for(let o=r.length-1;o>=0;--o){const a=r[o];a&&(e["Priority "+(o+ake-1)]=Math.round(a/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((r,n)=>{n.startsWith(t)&&(this._size-=r.size,this._db.delete(n),this._notifyRemove(n,r.entry,r.size,GO.ALL))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,GO.ALL)),this._users.forAll(e=>e.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r,n){let s;return this._removeFuncs.some(o=>{if(e.startsWith(o[0])){const a=o[1](t,n,r);return typeof a=="number"&&(s=a),!0}return!1}),s}_checkSize(){this._users.forAll(e=>this._checkSizeLimits(e)),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const r=e?.id;let n=!0;for(;n;){n=!1;for(const[s,o]of this._db)if(o.lifetime===0&&(!r||s.startsWith(r))){if(this._purgeItem(s,o,e),t.size<=.9*t.maxSize)return;n||=this._db.has(s)}}for(const[s,o]of this._db)if((!r||s.startsWith(r))&&(this._purgeItem(s,o,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,r=this._users.find(n=>e.startsWith(n.id))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,GO.SOME);n!=null&&n>0&&(this._size+=n,r&&(r.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}},Zer=0,Qer=class{constructor(e,t,r){this.entry=e,this.size=t,this.lifetime=r,this.lives=r}},d3=class{constructor(e,t){this._storage=new eMt,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}},EY=class lke{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major$b.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return hae(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>W9(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function E6(i){return i.trim().toLowerCase()}function Gnt(i){return fW(i)?.toLowerCase()??""}const tMt=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function Unt(i){const e=new Map;if(!i.fields)return e;const t=i.datesInUnknownTimezone===!0,{timeInfo:r,editFieldsInfo:n}=i,s=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",a=itr(i)?i.dateFieldsTimeZone??null:i.dateFieldsTimeReference?Zfe(i.dateFieldsTimeReference):null,l=n?etr(n)?n.timeZone??a:n.dateFieldsTimeReference?Zfe(n.dateFieldsTimeReference):a??y0:null,u=r?ttr(r)?r.timeZone??a:r.timeReference?Zfe(r.timeReference):a:null,c=new Map([[E6(n?.creationDateField??""),l],[E6(n?.editDateField??""),l],[E6(s),u],[E6(o),u]]);for(const{name:h,type:p}of i.fields)if(tMt.has(p))e.set(h,YF);else if(p!=="date"&&p!=="esriFieldTypeDate")e.set(h,null);else if(t)e.set(h,YF);else{const m=c.get(E6(h??""))??a;e.set(h,m)}return e}function Fne(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i}function ntr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i}function k1(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}function iMt(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i}function rMt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i}function nMt(i,e,t){return i[0]=e[0]*t[0],i[1]=e[1]*t[1],i[2]=e[2]*t[2],i[3]=e[3]*t[3],i}function sMt(i,e,t){return i[0]=e[0]/t[0],i[1]=e[1]/t[1],i[2]=e[2]/t[2],i[3]=e[3]/t[3],i}function str(i,e){return i[0]=Math.ceil(e[0]),i[1]=Math.ceil(e[1]),i[2]=Math.ceil(e[2]),i[3]=Math.ceil(e[3]),i}function otr(i,e){return i[0]=Math.floor(e[0]),i[1]=Math.floor(e[1]),i[2]=Math.floor(e[2]),i[3]=Math.floor(e[3]),i}function atr(i,e,t){return i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.min(e[2],t[2]),i[3]=Math.min(e[3],t[3]),i}function ltr(i,e,t){return i[0]=Math.max(e[0],t[0]),i[1]=Math.max(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3]),i}function utr(i,e){return i[0]=Math.round(e[0]),i[1]=Math.round(e[1]),i[2]=Math.round(e[2]),i[3]=Math.round(e[3]),i}function oMt(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i}function ctr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i}function aMt(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2],s=e[3]-i[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function lMt(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2],s=e[3]-i[3];return t*t+r*r+n*n+s*s}function cVe(i){const e=i[0],t=i[1],r=i[2],n=i[3];return Math.sqrt(e*e+t*t+r*r+n*n)}function hVe(i){const e=i[0],t=i[1],r=i[2],n=i[3];return e*e+t*t+r*r+n*n}function htr(i,e){return i[0]=-e[0],i[1]=-e[1],i[2]=-e[2],i[3]=-e[3],i}function dtr(i,e){return i[0]=1/e[0],i[1]=1/e[1],i[2]=1/e[2],i[3]=1/e[3],i}function uMt(i,e){const t=e[0],r=e[1],n=e[2],s=e[3];let o=t*t+r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),i[0]=t*o,i[1]=r*o,i[2]=n*o,i[3]=s*o),i}function cMt(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]}function dVe(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i[2]=o+r*(t[2]-o),i[3]=a+r*(t[3]-a),i}function ptr(i,e){const t=sae;let r,n,s,o,a,l;e=e||1;do r=2*t()-1,n=2*t()-1,a=r*r+n*n;while(a>=1);do s=2*t()-1,o=2*t()-1,l=s*s+o*o;while(l>=1);const u=Math.sqrt((1-a)/l);return i[0]=e*r,i[1]=e*n,i[2]=e*s*u,i[3]=e*o*u,i}function hMt(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3];return i[0]=t[0]*r+t[4]*n+t[8]*s+t[12]*o,i[1]=t[1]*r+t[5]*n+t[9]*s+t[13]*o,i[2]=t[2]*r+t[6]*n+t[10]*s+t[14]*o,i[3]=t[3]*r+t[7]*n+t[11]*s+t[15]*o,i}function ftr(i,e,t){const r=e[0],n=e[1],s=e[2],o=t[0],a=t[1],l=t[2],u=t[3],c=u*r+a*s-l*n,h=u*n+l*r-o*s,p=u*s+o*n-a*r,m=-o*r-a*n-l*s;return i[0]=c*u+m*-o+h*-l-p*-a,i[1]=h*u+m*-a+p*-o-c*-l,i[2]=p*u+m*-l+c*-a-h*-o,i[3]=e[3],i}function mtr(i){return"vec4("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+")"}function dMt(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]}function $2e(i,e){const t=i[0],r=i[1],n=i[2],s=i[3],o=e[0],a=e[1],l=e[2],u=e[3],c=c_();return Math.abs(t-o)<=c*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(r-a)<=c*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=c*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(s-u)<=c*Math.max(1,Math.abs(s),Math.abs(u))}const gtr=rMt,ytr=nMt,vtr=sMt,_tr=aMt,btr=lMt,wtr=cVe,xtr=hVe;Object.freeze(Object.defineProperty({__proto__:null,add:iMt,ceil:str,copy:Fne,copyVec3:ntr,dist:_tr,distance:aMt,div:vtr,divide:sMt,dot:cMt,equals:$2e,exactEquals:dMt,floor:otr,inverse:dtr,len:wtr,length:cVe,lerp:dVe,max:ltr,min:atr,mul:ytr,multiply:nMt,negate:htr,normalize:uMt,random:ptr,round:utr,scale:oMt,scaleAndAdd:ctr,set:k1,sqrDist:btr,sqrLen:xtr,squaredDistance:lMt,squaredLength:hVe,str:mtr,sub:gtr,subtract:rMt,transformMat4:hMt,transformQuat:ftr},Symbol.toStringTag,{value:"Module"}));function EE(){return[0,0,0,0]}function Str(i){return[i[0],i[1],i[2],i[3]]}function Vb(i,e,t,r){return[i,e,t,r]}function Ttr(i,e=EE()){const t=Math.min(4,i.length);for(let r=0;rr<=.04045?r/12.92:((r+.055)/1.055)**2.4),t=xMt(Dtr,e);return{x:100*t[0],y:100*t[1],z:100*t[2]}}function fVe(i){const e=xMt(Ftr,[i.x/100,i.y/100,i.z/100]).map(t=>{const r=t<=.0031308?12.92*t:1.055*t**.4166666666666667-.055;return Math.min(1,Math.max(r,0))});return{r:Math.round(255*e[0]),g:Math.round(255*e[1]),b:Math.round(255*e[2])}}function TMt(i){const e=[i.x/95.047,i.y/100,i.z/108.883].map(t=>t>.008856451679035631?t**.3333333333333333:7.787037037037035*t+.13793103448275862);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function CMt(i){const e=i.l,t=[(e+16)/116+i.a/500,(e+16)/116,(e+16)/116-i.b/200].map(r=>r>6/29?r**3:3*(6/29)**2*(r-4/29));return{x:95.047*t[0],y:100*t[1],z:108.883*t[2]}}function ktr(i){const e=i.l,t=i.a,r=i.b,n=Math.sqrt(t*t+r*r);let s=Math.atan2(r,t);return s=s>0?s:s+2*Math.PI,{l:e,c:n,h:s}}function Ltr(i){const e=i.l,t=i.c,r=i.h;return{l:e,a:t*Math.cos(r),b:t*Math.sin(r)}}function Ntr(i){return TMt(SMt(i))}function $tr(i){return fVe(CMt(i))}function Btr(i){return ktr(TMt(SMt(i)))}function jtr(i){return fVe(CMt(Ltr(i)))}function Gtr(i){const e=i.r,t=i.g,r=i.b,n=Math.max(e,t,r),s=n-Math.min(e,t,r);let o=n,a=s===0?0:n===e?(t-r)/s%6:n===t?(r-e)/s+2:(e-t)/s+4,l=s===0?0:s/o;return a<0&&(a+=6),a*=60,l*=100,o*=100/255,{h:a,s:l,v:o}}function Utr(i){const e=(i.h+360)%360/60,t=i.s/100,r=i.v/100*255,n=r*t,s=n*(1-Math.abs(e%2-1));let o;switch(Math.floor(e)){case 0:o={r:n,g:s,b:0};break;case 1:o={r:s,g:n,b:0};break;case 2:o={r:0,g:n,b:s};break;case 3:o={r:0,g:s,b:n};break;case 4:o={r:s,g:0,b:n};break;case 5:case 6:o={r:n,g:0,b:s};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+r-n),o.g=Math.round(o.g+r-n),o.b=Math.round(o.b+r-n),o}function ZF(i){return pVe(i)?i:wMt(i)?jtr(i):bMt(i)?$tr(i):Rtr(i)?fVe(i):_Mt(i)?Utr(i):i}function u1e(i){return _Mt(i)?i:Gtr(ZF(i))}function c1e(i){return bMt(i)?i:Ntr(ZF(i))}function h1e(i){return wMt(i)?i:Btr(ZF(i))}var znt;(function(i){i[i.Low=160]="Low",i[i.High=225]="High"})(znt||(znt={}));const ztr={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderLineColor:[0,0,0,1]},ph={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetX:0,offsetY:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMSolidFill:{enable:!0,colorocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0}};function Vtr(i){return[i.r,i.g,i.b,i.a]}const Htr=` /-, +`;function Vnt(i){let e=i.length;for(;e--;)if(!Htr.includes(i.charAt(e)))return!1;return!0}function Wtr(i,e){const t=[];let r=0,n=-1;do if(n=i.indexOf("[",r),n>=r){if(n>r){const s=i.substr(r,n-r);t.push([s,null,Vnt(s)])}if(r=n+1,n=i.indexOf("]",r),n>=r){if(n>r){const s=e[i.substr(r,n-r)];s&&t.push([null,s,!1])}r=n+1}}while(n!==-1);if(r=-1&&ne<=1&&(v=2*ne*ne*ne-3*ne*ne+1,v>0&&(re=4*(Q+$*e),k+=v*i[re+3],S+=v,i[re+3]<255&&(v=v*i[re+3]/250),I+=v*i[re],R+=v*i[re+1],L+=v*i[re+2],w+=v))}}r[m]=I/w,r[m+1]=R/w,r[m+2]=L/w,r[m+3]=k/S}}function Ly(i){return i?[i[0],i[1],i[2],i[3]/255]:[0,0,0,0]}function Jtr(i){return i.data?.symbol??null}function Ktr(i){return i.type==="CIMVectorMarker"||i.type==="CIMPictureMarker"||i.type==="CIMBarChartMarker"||i.type==="CIMCharacterMarker"||i.type==="CIMPieChartMarker"||i.type==="CIMStackedBarChartMarker"}function Ztr(i){return i.type==="CIMGradientStroke"||i.type==="CIMPictureStroke"||i.type==="CIMSolidStroke"}function Qtr(i){return i!=null&&(i.type==="CIMGradientFill"||i.type==="CIMHatchFill"||i.type==="CIMPictureFill"||i.type==="CIMSolidFill"||i.type==="CIMWaterFill")}function mVe(i){return i!=null&&(i.type==="CIMMarkerPlacementAlongLineRandomSize"||i.type==="CIMMarkerPlacementAlongLineSameSize"||i.type==="CIMMarkerPlacementAlongLineVariableSize"||i.type==="CIMMarkerPlacementAtExtremities"||i.type==="CIMMarkerPlacementAtMeasuredUnits"||i.type==="CIMMarkerPlacementAtRatioPositions"||i.type==="CIMMarkerPlacementOnLine"||i.type==="CIMMarkerPlacementOnVertices")}const rs=(i,e=0)=>i==null||isNaN(i)?e:i,uj=(i,e)=>i??e,Qce=i=>i.tintColor?Ly(i.tintColor):[255,255,255,1],eir=i=>{if(!i)return!1;for(const e of i)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function tir(){return Promise.resolve().then(()=>iX)}function iir(i){if(!i)return"normal";switch(i.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function rir(i){if(!i)return"normal";switch(i.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function gVe(i){let e="normal",t="normal";if(i){const r=i.toLowerCase();r.includes("italic")?e="italic":r.includes("oblique")&&(e="oblique"),r.includes("bold")?t="bold":r.includes("light")&&(t="lighter")}return{style:e,weight:t}}function yVe(i){return i.underline?"underline":i.strikethrough?"line-through":"none"}function gP(i){if(!i)return null;switch(i.type){case"CIMPolygonSymbol":if(i.symbolLayers)for(const e of i.symbolLayers){const t=gP(e);if(t!=null)return t}break;case"CIMTextSymbol":return gP(i.symbol);case"CIMSolidFill":return i.color}return null}function BV(i){if(i)switch(i.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=i.symbolLayers;if(e)for(const t of e){const r=BV(t);if(r!=null)return r}break}case"CIMTextSymbol":return BV(i.symbol);case"CIMSolidStroke":return i.color}}function kne(i){if(i)switch(i.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(i.symbolLayers)for(const e of i.symbolLayers){const t=kne(e);if(t!==void 0)return t}break;case"CIMTextSymbol":return kne(i.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return i.width}}function EMt(i){switch(i){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function IMt(i){switch(i){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function nir(i){return(i?Object.keys(i):[]).map(e=>({name:e,alias:e,type:typeof i[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const cj=i=>i.includes("data:image/svg+xml");function d1e(i){return i&&i.charAt(0).toLowerCase()+i.substring(1)}function AMt(i,e,t,r,n,s){const{infos:o}=s;let a=1,l=0,u=0,c=0;for(const{offsetX:m,offsetY:v,rotation:w,size:S,frameHeight:I,rotateClockWise:R}of o)u=Wnt(m,v,l,a,u),c=Hnt(m,v,l,a,c),I&&(a*=S/I),l=qnt(w,R,l);const h=Wnt(r,n,l,a,u),p=Hnt(r,n,l,a,c);return{size:i*a,rotation:qnt(e,t,l),offsetX:h,offsetY:p}}function MMt(i){if(i==null)return!1;if(Array.isArray(i))return i.every(e=>MMt(e));switch(typeof i){case"string":return!!i;case"number":return!isNaN(i)}}function w3e(i,e){if(e==="color"||e==="outlinecolor"||e==="backgroundcolor"||e==="borderLineColor")return[...ztr[e]];const t=ph[i];if(!t||typeof t[e]=="boolean")throw new Error(`InternalError: default value for type ${i}.`);return t[e]}function OMt(i){return i?.dashTemplate&&typeof i.dashTemplate=="string"&&(i.dashTemplate=i.dashTemplate.split(" ").map(Number)),i}function uke(i){if(i==null)return"Normal";switch(i.type){case"CIMTextSymbol":return i.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const e=i.symbolLayers;if(!e)return"Normal";for(const t of e)if(t.type==="CIMVectorMarker")return uke(t)}break;case"CIMVectorMarker":{const e=i.markerGraphics;if(!e)return"Normal";for(const t of e)if(t.symbol)return uke(t.symbol)}}return"Normal"}function PMt(i){if(i)switch(i.type){case"CIMTextSymbol":return i.height;case"CIMPointSymbol":{let e=0;if(i.symbolLayers){for(const t of i.symbolLayers)if(t)switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=t.size??ph.CIMVectorMarker.size;r>e&&(e=r);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(i.symbolLayers){for(const t of i.symbolLayers)if(t)switch(t.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const r=t.width;r!=null&&r>e&&(e=r);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(t.markerPlacement&&mVe(t.markerPlacement)){const r=t.size??ph.CIMVectorMarker.size;r>e&&(e=r)}break;case"CIMPictureFill":{const r=t.height;r!=null&&r>e&&(e=r)}}}return e}}}function RMt(i,e){if(e!==null){const t=e.get(i);return t?t.name:i}return i}function Hnt(i,e,t,r,n){const s=t*Math.PI/180;if(s){const o=Math.cos(s);return(Math.sin(s)*i+o*e)*r+n}return e*r+n}function Wnt(i,e,t,r,n){const s=t*Math.PI/180;return s?(Math.cos(s)*i-Math.sin(s)*e)*r+n:i*r+n}function qnt(i,e,t){return e?t-i:t+i}const vVe=(i,e,t)=>[e,t],bW=(i,e,t)=>[e,t,i[2]],_Ve=(i,e,t)=>[e,t,i[2],i[3]];function p1e(i){return i?{originPosition:i.originPosition==="upper-left"?"upperLeft":i.originPosition==="lower-left"?"lowerLeft":i.originPosition,scale:i.tolerance?[i.tolerance,i.tolerance]:[1,1],translate:i.extent!=null?[i.extent.xmin,i.extent.ymax]:[0,0]}:null}function sir({scale:i,translate:e},t){return Math.round((t-e[0])/i[0])}function oir({scale:i,translate:e},t){return Math.round((e[1]-t)/i[1])}function DMt({scale:i,translate:e},t){return t*i[0]+e[0]}function FMt({scale:i,translate:e},t){return e[1]-t*i[1]}function kMt(i,e,t){const r=new Array(t.length);if(!t.length)return r;const[n,s]=i.scale;let o=DMt(i,t[0][0]),a=FMt(i,t[0][1]);r[0]=e(t[0],o,a);for(let l=1;ldir(r,e,t,n,s);case"esriGeometryPolygon":return(t,r,n,s)=>pir(r,e,t,n,s);case"esriGeometryPolyline":return(t,r,n,s)=>fir(r,e,t,n,s);case"esriGeometryMultipoint":return(t,r,n,s)=>hir(r,e,t,n,s);default:return di.getLogger("esri.views.2d.support.arcadeOnDemand").error(new qe("mapview-arcade",`Unable to handle geometryType: ${i}`)),t=>t}}const vir=i=>{if(!i)return[0,0,0,0];const{r:e,g:t,b:r,a:n}=i;return[e,t,r,255*n]};let N5=class Ad{static findApplicableOverrides(e,t,r){if(e&&t){if(e.primitiveName){let n=!1;for(const s of r)if(s.primitiveName===e.primitiveName){n=!0;break}if(!n)for(const s of t)s.primitiveName===e.primitiveName&&r.push(s)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const n of e.effects)Ad.findApplicableOverrides(n,t,r);if(e.symbolLayers)for(const n of e.symbolLayers)Ad.findApplicableOverrides(n,t,r);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const n of e.effects)Ad.findApplicableOverrides(n,t,r);if(e.markerPlacement&&Ad.findApplicableOverrides(e.markerPlacement,t,r),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const n of e.markerGraphics)Ad.findApplicableOverrides(n,t,r),Ad.findApplicableOverrides(n.symbol,t,r)}else e.type==="CIMCharacterMarker"?Ad.findApplicableOverrides(e.symbol,t,r):e.type==="CIMHatchFill"?Ad.findApplicableOverrides(e.lineSymbol,t,r):e.type==="CIMPictureMarker"&&Ad.findApplicableOverrides(e.animatedSymbolProperties,t,r)}}}static findEffectOverrides(e,t){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&OMt(e),!t||!e.primitiveName)return{type:"cim-effect-info",effect:e,overrides:[]};const r=e.primitiveName,n=[];for(const s of t)s.primitiveName===r&&n.push({...s,propertyName:d1e(s.propertyName)});return{type:"cim-effect-info",effect:e,overrides:n}}static async resolveSymbolOverrides(e,t,r,n,s,o,a){if(!e?.symbol)return null;let{symbol:l,primitiveOverrides:u}=e;const c=!!u;if(!c&&!n)return l;l=li(l),u=li(u);let h=!0;if(t||(t={attributes:{}},h=!1),c){if(h||(u=u.filter(p=>!p.valueExpressionInfo?.expression.includes("$feature"))),a||(u=u.filter(p=>!p.valueExpressionInfo?.expression.includes("$view"))),u.length>0){const p={spatialReference:r,fields:nir(t.attributes),geometryType:s};await Ad.createRenderExpressions(u,p),Ad.evaluateOverrides(u,t,s??"esriGeometryPoint",o,a)}Ad.applyOverrides(l,u)}return n&&Ad.applyDictionaryTextOverrides(l,t,n,null),l}static async createRenderExpressions(e,t){const r=[];for(const n of e){const s=n.valueExpressionInfo;if(!s||Ad._expressionToRenderExpression.has(s.expression))continue;const o=$At(s.expression,t.spatialReference,t.fields);r.push(o),o.then(a=>Ad._expressionToRenderExpression.set(s.expression,a))}r.length>0&&await Promise.all(r)}static evaluateOverrides(e,t,r,n,s){const o={$view:{scale:s?.scale}};for(const a of e){a.value&&typeof a.value=="object"&&pVe(a.value)&&(a.propertyName==="Color"||a.propertyName==="StrokeColor")&&(a.value=vir(a.value));const l=a.valueExpressionInfo;if(!l)continue;const u=Ad._expressionToRenderExpression.get(l.expression);u&&(a.value=mir(u,t,o,r,n))}}static applyDictionaryTextOverrides(e,t,r,n,s="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const o=e.symbolLayers;if(!o)return;for(const a of o)a&&a.type==="CIMVectorMarker"&&Ad.applyDictionaryTextOverrides(a,t,r,n,e.type==="CIMTextSymbol"?e.textCase:s)}break;case"CIMVectorMarker":{const o=e.markerGraphics;if(!o)return;for(const a of o)a&&Ad.applyDictionaryTextOverrides(a,t,r,n)}break;case"CIMMarkerGraphic":{const o=e.textString;if(o&&o.includes("[")){const a=Wtr(o,r);e.textString=qtr(t,a,n,s)}}}}static applyOverrides(e,t,r,n){if(e.primitiveName){for(const s of t)if(s.primitiveName===e.primitiveName){const o=d1e(s.propertyName);if(n&&n.push({cim:e,nocapPropertyName:o,value:e[o]}),r){let a=!1;for(const l of r)l.primitiveName===e.primitiveName&&(a=!0);a||r.push(s)}s.value!=null&&(e[o]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)Ad.applyOverrides(s,t,r,n);if(e.symbolLayers)for(const s of e.symbolLayers)Ad.applyOverrides(s,t,r,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)Ad.applyOverrides(s,t,r,n);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)Ad.applyOverrides(s,t,r,n),Ad.applyOverrides(s.symbol,t,r,n)}}static restoreOverrides(e){for(const t of e)t.cim[t.nocapPropertyName]=t.value}static buildOverrideKey(e){let t="";for(const r of e)r.value!==void 0&&(t+=`${r.primitiveName}${r.propertyName}${JSON.stringify(r.value)}`);return t}static toValue(e,t){if(e==="DashTemplate")return t.split(" ").map(r=>Number(r));if(e==="Color"){const r=new jr(t).toRgba();return r[3]*=255,r}return t}};N5._expressionToRenderExpression=new Map;const Ynt="esri.renderers.support.DictionaryLoader",_ir={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let NMt=class{constructor(e,t,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new d3(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=t,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,t){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(t));try{r=await this._dictionaryPromise}catch(h){if(mo(h))return this._dictionaryPromise=null,null}const n=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),s={};if(this.fieldMap)for(const h of this._symbolFields){const p=RMt(this.fieldMap[h],this._fieldIndex);if(p){const m=e.attributes[p];s[h]=n?m:m!=null?""+e.attributes[p]:""}else s[h]=""}let o=null;try{o=r?.(s,t)}catch{return null}if(!o||typeof o!="string"||o==="invalid")return null;const a=o.split(";"),l=[],u=[];for(const h of a)if(h)if(h.includes("po:")){const p=h.substr(3).split("|");if(p.length===3){const m=p[0],v=p[1];let w=p[2];if(v==="DashTemplate")w=w.split(" ").map(S=>Number(S));else if(v==="Color"){const S=new jr(w).toRgba();w=[S[0],S[1],S[2],255*S[3]]}else w=Number(w);u.push({primitiveName:m,propertyName:v,value:w,defaultValue:null})}}else if(h.includes("|")){for(const p of h.split("|"))if(this._itemNames.has(p)){l.push(p);break}}else this._itemNames.has(h)&&l.push(h);const c=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,l,u,c,t)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void di.getLogger(Ynt).error("no valid URL!");const t=zi(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([t,e_()]);if(!r)throw this._dictionaryPromise=null,new qe("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:n,dictionary_version:s,expression:o,itemsNames:a}=r,l=o;let u=!1;s&&(this._dictionaryVersion=EY.parse(s),u=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(a),this._symbolFields=n.symbol;const c={};if(this.config){const m=this.config;for(const v in m)c[v]=m[v]}if(n.configuration)for(const m of n.configuration)c.hasOwnProperty(m.name)||(c[m.name]=m.value);const h=[];if(e?.fields&&this.fieldMap)for(const m in this.fieldMap){const v=this.fieldMap[m],w=e.fields.filter(S=>S.name.toLowerCase()===v?.toLowerCase());w.length>0&&h.push({...w[0],type:u?w[0].type:"esriFieldTypeString"})}h.length>0&&(this._fieldIndex=new Cd(h));const p=xZi(l,e!=null?e.spatialReference:null,h,c).then(m=>{const v={scale:0};return(w,S)=>{if(m==null)return null;const I=m.repurposeFeature({geometry:null,attributes:w});return v.scale=S!=null?S.scale??void 0:void 0,m.evaluate({$feature:I,$view:v},m.services)}}).catch(m=>(di.getLogger(Ynt).error("Creating dictinoary expression failed:",m),null));return this._dictionaryPromise=p,p}async _cimPartsToCIMSymbol(e,t,r,n,s){const o=new Array(t.length);for(let u=0;uo.data);const n=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),s=zi(n,{responseType:"json",query:{f:"json"},...t});this._ongoingRequests.set(e,s),s.finally(()=>this._ongoingRequests.delete(e));try{const o=await s;return this._symbolCache.put(e,o.data),o.data}catch(o){throw o}}_combineSymbolParts(e,t,r){if(!e||e.length===0)return null;const n={...e[0]};if(e.length>1){n.symbolLayers=[];for(const s of e){const o=s;n.symbolLayers.unshift(...o.symbolLayers)}}return r&&(n.callout=_ir),{type:"CIMSymbolReference",symbol:n,primitiveOverrides:t}}};var cke;let LT=cke=class extends Wk(V3){constructor(i){super(i),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new NMt(this.url,this.config,this.fieldMap)}writeData(i,e){i&&(e.scalingExpressionInfo={expression:i,returnType:"number"})}writeVisualVariables(i,e,t,r){r?.origin||super.writeVisualVariables(i,e,t,r)}clone(){return new cke({config:li(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:li(this.fieldMap),url:li(this.url),visualVariables:li(this.visualVariables)})}async getSymbolAsync(i,e){return this._loader.getSymbolAsync(i,e)}async collectRequiredFields(i,e){await this.collectVVRequiredFields(i,e),this.scaleExpression&&await i_(i,e,this.scaleExpression);for(const t in this.fieldMap){const r=this.fieldMap[t];e.has(r)&&i.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};x([D({type:NMt})],LT.prototype,"_loader",null),x([D({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],LT.prototype,"config",void 0),x([D({type:Object,json:{write:!0}})],LT.prototype,"fieldMap",void 0),x([D({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],LT.prototype,"scaleExpression",void 0),x([ur("scaleExpression")],LT.prototype,"writeData",null),x([D({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(i){return{enabled:!!i&&!!this.scaleExpression}}}}})],LT.prototype,"scaleExpressionTitle",void 0),x([D({type:String,json:{write:!0}})],LT.prototype,"url",void 0),x([ur("visualVariables")],LT.prototype,"writeVisualVariables",null),LT=cke=x([Qe("esri.renderers.DictionaryRenderer")],LT);const bir=LT;var hke;let HM=hke=class extends Ci{constructor(i){super(i),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(i){return i==null?i:typeof i=="function"?(di.getLogger(this).error(".field: field must be a string value"),null):Zoe(i)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new hke({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};x([D({type:jr,json:{type:[Number],write:!0}})],HM.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"field",void 0),x([So("field")],HM.prototype,"castField",null),x([D({type:String,json:{write:!0}})],HM.prototype,"label",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"valueExpression",void 0),x([D({type:String,json:{write:!0}})],HM.prototype,"valueExpressionTitle",void 0),HM=hke=x([Qe("esri.renderers.support.AttributeColorInfo")],HM);const $Mt=HM;var dke;let Ame=dke=class extends Ci{constructor(){super(...arguments),this.unit=null}clone(){return new dke({unit:this.unit})}};x([D({type:String,json:{write:!0}})],Ame.prototype,"unit",void 0),Ame=dke=x([Qe("esri.renderers.support.DotDensityLegendOptions")],Ame);const wir=Ame;var pke;let L_=pke=class extends Wk(V3){constructor(i){super(i),this.attributes=null,this.backgroundColor=new jr([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new vg,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(i){if(this.referenceScale==null)return this.dotValue;const e=i/this.referenceScale*this.dotValue;return e<1?1:e}getSymbol(){return new Hx({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((i,e)=>i+e.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new pke({attributes:li(this.attributes),backgroundColor:li(this.backgroundColor),dotBlendingEnabled:li(this.dotBlendingEnabled),dotShape:li(this.dotShape),dotSize:li(this.dotSize),dotValue:li(this.dotValue),legendOptions:li(this.legendOptions),outline:li(this.outline),referenceScale:li(this.referenceScale),seed:li(this.seed),visualVariables:li(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(i,e){await this.collectVVRequiredFields(i,e);for(const t of this.attributes??[])t.valueExpression&&await i_(i,e,t.valueExpression),t.field&&i.add(t.field)}};x([D({type:[$Mt],json:{write:!0}})],L_.prototype,"attributes",void 0),x([D({type:jr,json:{write:!0}})],L_.prototype,"backgroundColor",void 0),x([D({type:Boolean,json:{write:!0}})],L_.prototype,"dotBlendingEnabled",void 0),x([D({type:String,json:{write:!1}})],L_.prototype,"dotShape",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"dotSize",void 0),x([D({type:wir,json:{write:!0}})],L_.prototype,"legendOptions",void 0),x([D({type:vg,json:{default:null,write:!0}})],L_.prototype,"outline",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"dotValue",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"referenceScale",void 0),x([D({type:Number,json:{write:!0}})],L_.prototype,"seed",void 0),x([Wr({dotDensity:"dot-density"})],L_.prototype,"type",void 0),L_=pke=x([Qe("esri.renderers.DotDensityRenderer")],L_);const xir=L_;var fke;let gQ=fke=class extends Ci{constructor(i){super(i),this.color=null,this.ratio=null}clone(){return new fke({color:this.color&&this.color.clone(),ratio:this.ratio})}};x([D({type:jr,json:{type:[ms],default:null,write:!0}})],gQ.prototype,"color",void 0),x([D({type:Number,json:{write:!0}})],gQ.prototype,"ratio",void 0),gQ=fke=x([Qe("esri.renderers.support.HeatmapColorStop")],gQ);const Eie=gQ;let DG=class extends xs(Ci){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};x([D({type:String,json:{write:!0}})],DG.prototype,"minLabel",void 0),x([D({type:String,json:{write:!0}})],DG.prototype,"maxLabel",void 0),x([D({type:String,json:{write:!0}})],DG.prototype,"title",void 0),DG=x([Qe("esri.renderers.support.HeatmapLegendOptions")],DG);const bVe=2.4;function Sir(i){return uy(i*bVe)}function Tir(i){return us(i)/bVe}function Cir(i,e,t,r){let{color:n,ratio:s}=e,{color:o,ratio:a}=t;a===s&&(a===1?s-=1e-6:a+=1e-6);const l=uu((r-s)/(a-s),0,1);dVe(i,n.toArray(),o.toArray(),l)}function Eir(i){const t=new Uint8ClampedArray(2048);if(i=i.filter(({ratio:a})=>a>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),i.length<1)return t;let r=i[0],n=i[0],s=1;const o=EE();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>n.ratio&&s1?0:3/(Math.PI*t**2)*(1-r**2)**2}function Air(i){return typeof i=="function"?i:i?e=>+e[i]:()=>1}var mke;function Xnt(i){if(i!=null){const{maxDensity:e,minDensity:t,radius:r}=i;if(e!=null||t!=null||r!=null){const{blurRadius:n,maxPixelIntensity:s,minPixelIntensity:o,...a}=i;return a}}return i}let jg=mke=class extends V3{constructor(i){super(i),this.authoringInfo=null,this.colorStops=[new Eie({ratio:0,color:new jr("rgba(255, 140, 0, 0)")}),new Eie({ratio:.75,color:new jr("rgba(255, 140, 0, 1)")}),new Eie({ratio:.9,color:new jr("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(i){return Xnt(i)}get blurRadius(){return Tir(this.radius)}set blurRadius(i){const e=this.maxPixelIntensity,t=this.minPixelIntensity;this._set("radius",Sir(i)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",t*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(i){this._set("maxDensity",i*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(i){this._set("minDensity",i*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(bVe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(i,e){this._warnedProps[i]||Kp(this).getDefaultOrigin()==="user"&&(this._warnedProps[i]=!0,Gk(()=>{ty(di.getLogger(this),i,{replacement:`${String(e)} (suggested value: ${this._get(e)})`,version:"4.24"})}))}read(i,e){i=Xnt(i),super.read(i,e)}getSymbol(){return new Jh}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(i,e){const t=this.field,r=this.valueExpression;t&&typeof t=="string"&&$v(i,e,t),r&&typeof r=="string"&&await i_(i,e,r)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new mke({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:li(this.colorStops),field:this.field,legendOptions:li(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};x([D({type:vae,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],jg.prototype,"authoringInfo",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"blurRadius",null),x([D({type:[Eie],json:{write:!0}})],jg.prototype,"colorStops",void 0),x([D({type:String,json:{write:!0}})],jg.prototype,"field",void 0),x([D({type:DG,json:{write:!0}})],jg.prototype,"legendOptions",void 0),x([D({type:Number,json:{write:!0}})],jg.prototype,"maxDensity",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"maxPixelIntensity",null),x([D({type:Number,json:{write:!0}})],jg.prototype,"minDensity",void 0),x([D({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],jg.prototype,"minPixelIntensity",null),x([D({type:Number,cast:Cl,json:{write:!0}})],jg.prototype,"radius",void 0),x([D({type:Number,range:{min:0},json:{default:0,write:!0}})],jg.prototype,"referenceScale",void 0),x([Wr({heatmap:"heatmap"})],jg.prototype,"type",void 0),x([D({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],jg.prototype,"valueExpression",void 0),x([D({type:String})],jg.prototype,"valueExpressionTitle",void 0),x([D({readOnly:!0})],jg.prototype,"_pixelIntensityToDensity",null),jg=mke=x([Qe("esri.renderers.HeatmapRenderer")],jg);const BMt=jg;let I6=class extends xs(Ci){constructor(){super(...arguments),this.color=new jr([0,0,0,0]),this.label=null,this.threshold=0}};x([D({type:jr,json:{write:!0}})],I6.prototype,"color",void 0),x([D({type:String,json:{write:!0}})],I6.prototype,"label",void 0),x([D({type:Number,range:{min:0,max:1},json:{write:!0}})],I6.prototype,"threshold",void 0),I6=x([Qe("esri.renderers.support.OthersCategory")],I6);let Mme=class extends xs(Ci){constructor(){super(...arguments),this.title=null}};x([D({type:String,json:{write:!0}})],Mme.prototype,"title",void 0),Mme=x([Qe("esri.renderers.support.PieChartLegendOptions")],Mme);let gw=class extends Wk(xs(V3)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new jr([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new I6,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){return new Jh({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(Ga)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const r of this.attributes)r.valueExpression&&await i_(e,t,r.valueExpression),r.field&&e.add(r.field)}};x([D({type:[$Mt],json:{write:!0}})],gw.prototype,"attributes",void 0),x([D({type:Hx,json:{default:null,write:!0}})],gw.prototype,"backgroundFillSymbol",void 0),x([D({type:jr,json:{write:!0}})],gw.prototype,"defaultColor",void 0),x([D({type:String,json:{write:!0}})],gw.prototype,"defaultLabel",void 0),x([D({type:Number,range:{min:0,max:1},json:{write:!0}})],gw.prototype,"holePercentage",void 0),x([D({type:I6,json:{write:!0}})],gw.prototype,"othersCategory",void 0),x([D({type:Mme,json:{write:!0}})],gw.prototype,"legendOptions",void 0),x([D({type:vg,json:{default:null,write:!0}})],gw.prototype,"outline",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],gw.prototype,"size",void 0),x([Wr({pieChart:"pie-chart"})],gw.prototype,"type",void 0),gw=x([Qe("esri.renderers.PieChartRenderer")],gw);const Mir=gw;var gke;let UN=gke=class extends Wk(V3){constructor(i){super(i),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(i,e){await Promise.all([this.collectSymbolFields(i,e),this.collectVVRequiredFields(i,e)])}async collectSymbolFields(i,e){await Promise.all(this.getSymbols().map(t=>t.collectRequiredFields(i,e)))}getSymbol(i,e){return this.symbol}async getSymbolAsync(i,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((i,e)=>i+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((i,e)=>i+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new gke({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:li(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};x([D({type:String,json:{write:!0}})],UN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],UN.prototype,"label",void 0),x([D(uVe)],UN.prototype,"symbol",void 0),x([Wr({simple:"simple"})],UN.prototype,"type",void 0),UN=gke=x([Qe("esri.renderers.SimpleRenderer")],UN);const _x=UN,Oir=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function yke(i){return i instanceof un}function Jnt(i){return i instanceof dr?Object.keys(i.items):yke(i)?Kp(i).keys():i?Object.keys(i):[]}function ehe(i,e){return i instanceof dr?i.items[e]:i[e]}function Pir(i,e){return!(!Array.isArray(i)||!Array.isArray(e))&&i.length!==e.length}function Iie(i){return i?i.declaredClass:null}function jMt(i,e){const t=i.diff;if(t&&typeof t=="function")return t(i,e);const r=Jnt(i),n=Jnt(e);if(r.length===0&&n.length===0)return;if(!r.length||!n.length||Pir(i,e))return{type:"complete",oldValue:i,newValue:e};const s=n.filter(h=>!r.includes(h)),o=r.filter(h=>!n.includes(h)),a=r.filter(h=>n.includes(h)&&ehe(i,h)!==ehe(e,h)).concat(s,o).sort(),l=Iie(i);if(l&&Oir.has(l)&&a.length)return{type:"complete",oldValue:i,newValue:e};let u;const c=yke(i)&&yke(e);for(const h of a){const p=ehe(i,h),m=ehe(e,h);let v;if((c||typeof p!="function"&&typeof m!="function")&&p!==m&&(p!=null||m!=null)){if(t&&t[h]&&typeof t[h]=="function")v=t[h]?.(p,m);else if(p instanceof Date&&m instanceof Date){if(p.getTime()===m.getTime())continue;v={type:"complete",oldValue:p,newValue:m}}else v=typeof p=="object"&&typeof m=="object"&&Iie(p)===Iie(m)?jMt(p,m):{type:"complete",oldValue:p,newValue:m};v!=null&&(u!=null?u.diff[h]=v:u={type:"partial",diff:{[h]:v}})}}return u}function Knt(i,e){return Aie(i,e)}function Aie(i,e){if(i==null)return!1;const t=e.split(".");let r=i;for(const n of t){if(r.type==="complete")return!0;if(r.type!=="partial")return!1;{const s=r.diff[n];if(!s)return!1;r=s}}return!0}function Znt(i,e){if(!i)return!1;if(i.type==="partial"){const t=Object.keys(i.diff);return t.length===1&&t[0]===e}return!1}function nB(i,e){if(typeof i!="function"&&typeof e!="function"&&(i!=null||e!=null))return i==null||e==null||typeof i=="object"&&typeof e=="object"&&Iie(i)!==Iie(e)?{type:"complete",oldValue:i,newValue:e}:jMt(i,e)}let FG=class extends xs(Ci){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};x([D(Tme)],FG.prototype,"value",void 0),x([D(Tme)],FG.prototype,"value2",void 0),x([D(Tme)],FG.prototype,"value3",void 0),FG=x([Qe("esri.renderers.support.UniqueValue")],FG);const jV=FG;let g4=class extends xs(Ci){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const t=typeof(e=Array.isArray(e)?e:[e])[0];return t==="string"||t==="number"?e.map(r=>new jV({value:r})):t==="object"?e[0]instanceof jV?e:e.map(r=>new jV(r)):null}};x([D({type:String,json:{write:!0}})],g4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],g4.prototype,"label",void 0),x([D(N2e)],g4.prototype,"symbol",void 0),x([D({type:[jV],json:{type:[[String]],read:{reader:i=>i?i.map(e=>new jV({value:e[0],value2:e[1],value3:e[2]})):null},write:{writer:(i,e)=>{const t=[];for(const r of i){const n=[r.value,r.value2,r.value3].filter(Ga).map(s=>s.toString());t.push(n)}e.values=t}}}})],g4.prototype,"values",void 0),x([So("values")],g4.prototype,"castValues",null),g4=x([Qe("esri.renderers.support.UniqueValueClass")],g4);const GMt=g4;let yQ=class extends xs(Ci){constructor(e){super(e),this.heading=null,this.classes=null}};x([D({type:String,json:{write:!0}})],yQ.prototype,"heading",void 0),x([D({type:[GMt],json:{write:!0}})],yQ.prototype,"classes",void 0),yQ=x([Qe("esri.renderers.support.UniqueValueGroup")],yQ);const vke=yQ;var _ke;let zN=_ke=class extends Ci{constructor(i){super(i),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new _ke({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const i=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${i}`}};x([D({type:String,json:{write:!0}})],zN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],zN.prototype,"label",void 0),x([D(uVe)],zN.prototype,"symbol",void 0),x([D(Tme)],zN.prototype,"value",void 0),zN=_ke=x([Qe("esri.renderers.support.UniqueValueInfo")],zN);const J8=zN,Rir=()=>!!yi("enable-feature:force-wosr"),Dir=()=>yi.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),Fir=()=>yi.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),kir=()=>yi.add("enable-i3s-patching",!0,!0,!0),Lir=()=>yi.add("enable-i3s-patching",!1,!0,!0),Qnt=()=>!!yi("enable-feature:SceneLayer-editing"),Nir=(i="i3s-patching")=>{switch(Lir(),Fir(),yi.add("enable-feature:SceneLayer-editing",!0,!0,!0),i){case"feature-layer-view":Dir();break;case"i3s-patching":kir()}};Nir("i3s-patching");let S3e={};async function $ir(i,e){try{return{data:(await wVe(i,e)).data,baseUrl:eae(i),styleUrl:i}}catch(t){return _a(t),null}}function Bir(i,e,t){const r=e.portal!=null?e.portal:Bu.getDefault();let n;const s=`${r.url} - ${r.user&&r.user.username} - ${i}`;return S3e[s]||(S3e[s]=jir(i,r,t).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:i}))),S3e[s]}function jir(i,e,t){return e.load(t).then(()=>{const r=new hA({disableExtraQuery:!0,query:`owner:${est} AND type:${tst} AND typekeywords:"${i}"`});return e.queryItems(r,t)}).then(({results:r})=>{let n=null;const s=i.toLowerCase();if(r&&Array.isArray(r)){for(const o of r)if(o.typeKeywords?.some(l=>l.toLowerCase()===s)&&o.type===tst&&o.owner===est){n=o;break}}if(!n)throw new qe("symbolstyleutils:style-not-found",`The style '${i}' could not be found`,{styleName:i});return n.load(t)})}function UMt(i,e,t){return i?.styleUrl!=null?$ir(i.styleUrl,t):i?.styleName!=null?Bir(i.styleName,e,t):Promise.reject(new qe("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function zMt(i){return i===null||i.type==="CIMSymbolReference"?i:{type:"CIMSymbolReference",symbol:i}}function Gir(i,e,t=["gltf"]){if(e==="cimRef")return i.cimRef;if(i.formatInfos&&!Rir())for(const r of t){const n=i.formatInfos.find(s=>s.type===r);if(n)return n.href}return i.webRef}function wVe(i,e){const t={responseType:"json",query:{f:"json"},...e};return zi(X1(i),t)}const est="esri_en",tst="Style",Uir="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var vQ;const VMt="esri.renderers.UniqueValueRenderer",vD=()=>di.getLogger(VMt),ist="uvInfos-watcher",rst="uvGroups-watcher",zir=",",Vir=Sd(J8);function Hir(i){const{field1:e,field2:t,field3:r,fieldDelimiter:n,uniqueValueInfos:s,valueExpression:o}=i,a=!(!e||!t);return[{classes:(s??[]).map(l=>{const{symbol:u,label:c,value:h,description:p}=l,[m,v,w]=a?h?.toString()?.split(n||"")||[]:[h],S=[];return(e||o)&&S.push(m),t&&S.push(v),r&&S.push(w),{symbol:u,label:c,values:[S],description:p}})}]}let ad=vQ=class extends Wk(V3){constructor(i){super(i),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,t){if(!e&&!t)return;if(!e||!t)return{type:"complete",oldValue:e,newValue:t};let r=!1;const n={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let s=0;sa.value===t[s].value);o?nB(o,t[s])?(n.changed.push({type:"complete",oldValue:o,newValue:t[s]}),r=!0):n.unchanged.push({oldValue:o,newValue:t[s]}):(n.added.push(t[s]),r=!0)}for(let s=0;so.value===e[s].value)||(n.removed.push(e[s]),r=!0);return r?n:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(i){this._set("field",i),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(i){return i==null||typeof i=="function"?i:Zoe(i)}writeField(i,e,t,r){typeof i=="string"?e[t]=i:r?.messages?r.messages.push(new qe("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):vD().error(".field: cannot write field to JSON since it's not a string value")}set field2(i){this._set("field2",i),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(i){this._set("field3",i),this._updateUniqueValues()}set valueExpression(i){this._set("valueExpression",i),this._updateUniqueValues()}set defaultSymbol(i){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",i)}set fieldDelimiter(i){this._set("fieldDelimiter",i),this._updateUniqueValues()}readPortal(i,e,t){return t.portal||Bu.getDefault()}readStyleOrigin(i,e,t){if(e.styleName)return Object.freeze({styleName:e.styleName});if(e.styleUrl){const r=mE(e.styleUrl,t);return Object.freeze({styleUrl:r})}}writeStyleOrigin(i,e,t,r){i.styleName?e.styleName=i.styleName:i.styleUrl&&(e.styleUrl=gE(i.styleUrl,r))}set uniqueValueGroups(i){this.styleOrigin?vD().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",i),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(i){this.styleOrigin?vD().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",i),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(i,e){if(this.styleOrigin)return void vD().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let t;t=typeof i=="object"?Vir(i):new J8({value:i,symbol:j3t(e)}),this.uniqueValueInfos?.push(t),this._valueInfoMap[t.value]=t,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(i){if(this.styleOrigin)return void vD().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const e=this.uniqueValueInfos;if(e)for(let t=0;ti+e.getAttributeHash(),"")}getMeshHash(){const i=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),t=this.uniqueValueInfos?.reduce((r,n)=>r+n.getMeshHash(),"");return`${i}.${e}.${t}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const i=new vQ({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:li(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:li(this.visualVariables),legendOptions:li(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:li(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(i._isDefaultSymbolDerived=!0),i._set("portal",this.portal);const e=li(this.uniqueValueInfos),t=li(this.uniqueValueGroups);return this.styleOrigin&&(i._set("styleOrigin",Object.freeze(li(this.styleOrigin))),Object.freeze(e),Object.freeze(t)),i._set("uniqueValueInfos",e),i._updateValueInfoMap(),i._set("uniqueValueGroups",t),i._isInfosSource=this._isInfosSource,i._watchUniqueValueInfosAndGroups(),i}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(i,e){const t=[this.collectVVRequiredFields(i,e),this.collectSymbolFields(i,e)];await Promise.all(t)}async collectSymbolFields(i,e){const t=[...this.getSymbols().map(r=>r.collectRequiredFields(i,e)),i_(i,e,this.valueExpression)];$v(i,e,this.field),$v(i,e,this.field2),$v(i,e,this.field3),await Promise.all(t)}populateFromStyle(){return UMt(this.styleOrigin,{portal:this.portal}).then(i=>{const e=[];return this._valueInfoMap={},i&&i.data&&Array.isArray(i.data.items)&&i.data.items.forEach(t=>{const r=new YB({styleUrl:i.styleUrl,styleName:i.styleName,portal:this.portal,name:t.name});this.defaultSymbol||t.name!==i.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new J8({value:t.name,symbol:r});e.push(n),this._valueInfoMap[t.name]=n}),this._set("uniqueValueInfos",Object.freeze(e)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",zir)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:i}=this;if(i)for(const e of i)this._valueInfoMap[e.value+""]=e}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(ist);const{uniqueValueInfos:i}=this;if(i){const e=[];for(const t of i)e.push(Ki(()=>({symbol:t.symbol,value:t.value,label:t.label,description:t.description}),(r,n)=>{r!==n&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(e,ist)}}_watchUniqueValueGroups(){this.removeHandles(rst);const{uniqueValueGroups:i}=this;if(i){const e=[];for(const t of i){e.push(Ki(()=>({classes:t.classes}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of t.classes??[])e.push(Ki(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(n,s)=>{n!==s&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(e,rst)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const i=[],{field:e,field2:t,field3:r,fieldDelimiter:n,uniqueValueGroups:s,valueExpression:o}=this;if(!e&&!o)return this._set("uniqueValueInfos",i),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!e||!t);for(const l of s)for(const u of l.classes??[]){const{symbol:c,label:h,values:p,description:m}=u;for(const v of p??[]){const{value:w,value2:S,value3:I}=v,R=[w];t&&R.push(S),r&&R.push(I);const L=a?R.join(n||""):R[0];i.push(new J8({symbol:c,label:h,value:L,description:m}))}}this._set("uniqueValueInfos",i),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(i=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:e,field2:t,valueExpression:r,fieldDelimiter:n,uniqueValueInfos:s}=this;if(!e&&!r||!s.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!e||!t),a=s.map(u=>{const{symbol:c,label:h,value:p,description:m}=u,[v,w,S]=o?p?.toString()?.split(n||"")||[]:[p];return new GMt({symbol:c,label:h,description:m,values:[new jV({value:v,value2:w,value3:S})]})}),l=[new vke({classes:a})];i&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(i,e){return this.valueExpression?this._getUnqiueValueInfoForExpression(i,e):this._getUnqiueValueInfoForFields(i)}_getUnqiueValueInfoForExpression(i,e){const{viewingMode:t,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{};let a=this._cache.compiledFunc;const l=s.arcadeUtils;if(!a){const c=l.createSyntaxTree(this.valueExpression);a=l.createFunction(c),this._cache.compiledFunc=a}const u=l.executeFunction(a,l.createExecContext(i,l.getViewInfo({viewingMode:t,scale:r,spatialReference:n}),o));return this._valueInfoMap[u+""]}_getUnqiueValueInfoForFields(i){const e=this.field,t=i.attributes;let r;if(typeof e!="function"&&this.field2){const n=this.field2,s=this.field3,o=[];e&&o.push(t[e]),n&&o.push(t[n]),s&&o.push(t[s]),r=o.join(this.fieldDelimiter||"")}else typeof e=="function"?r=e(i):e&&(r=t[e]);return this._valueInfoMap[r+""]}static fromPortalStyle(i,e){const t=new vQ(e?.properties);t._set("styleOrigin",Object.freeze({styleName:i})),t._set("portal",e?.portal||Bu.getDefault());const r=t.populateFromStyle();return r.catch(n=>{vD().error(`#fromPortalStyle('${i}'[, ...])`,"Failed to create unique value renderer from style name",n)}),r}static fromStyleUrl(i,e){const t=new vQ(e?.properties);t._set("styleOrigin",Object.freeze({styleUrl:i}));const r=t.populateFromStyle();return r.catch(n=>{vD().error(`#fromStyleUrl('${i}'[, ...])`,"Failed to create unique value renderer from style URL",n)}),r}};x([D({readOnly:!0})],ad.prototype,"_cache",null),x([Wr({uniqueValue:"unique-value"})],ad.prototype,"type",void 0),x([D(Z3t)],ad.prototype,"backgroundFillSymbol",void 0),x([D({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],ad.prototype,"field",null),x([So("field")],ad.prototype,"castField",null),x([ur("field")],ad.prototype,"writeField",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"field2",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"field3",null),x([D({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],ad.prototype,"orderByClassesEnabled",void 0),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"valueExpression",null),x([D({type:String,json:{write:!0}})],ad.prototype,"valueExpressionTitle",void 0),x([D({type:UA,json:{write:!0}})],ad.prototype,"legendOptions",void 0),x([D({type:String,json:{write:!0}})],ad.prototype,"defaultLabel",void 0),x([D(GUe({...N2e},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],ad.prototype,"defaultSymbol",null),x([D({type:String,value:null,json:{write:!0}})],ad.prototype,"fieldDelimiter",null),x([D({type:Bu,readOnly:!0})],ad.prototype,"portal",void 0),x([Mi("portal",["styleName"])],ad.prototype,"readPortal",null),x([D({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],ad.prototype,"styleOrigin",void 0),x([Mi("styleOrigin",["styleName","styleUrl"])],ad.prototype,"readStyleOrigin",null),x([ur("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],ad.prototype,"writeStyleOrigin",null),x([D({type:[vke],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(i,e,t)=>(e.uniqueValueGroups||Hir(e)).map(r=>vke.fromJSON(r,t))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],ad.prototype,"uniqueValueGroups",null),x([D({type:[J8],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],ad.prototype,"uniqueValueInfos",null),ad=vQ=x([Qe(VMt)],ad);const JB=ad,IE={key:"type",base:V3,typeMap:{heatmap:BMt,simple:_x,"unique-value":JB,"class-breaks":XB,"dot-density":xir,dictionary:bir,"pie-chart":Mir},errorContext:"renderer"},qk={key:"type",base:V3,typeMap:{simple:_x,"unique-value":JB,"class-breaks":XB,heatmap:BMt},errorContext:"renderer",validate:Wir};function Wir(i){switch(i.type){case"simple":return qir(i);case"unique-value":return Yir(i);case"class-breaks":return Xir(i);case"heatmap":return i}}function qir(i){if(i.symbol)return i;di.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Yir(i){const e=i.uniqueValueInfos,t=e?.filter(({symbol:r,label:n},s)=>(r||di.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${s}] ${n}) without a symbol from web scene.`),!!r));return t?.length!==e?.length&&(i.uniqueValueInfos=t),i}function Xir(i){const e=i.classBreakInfos,t=e?.filter(({symbol:r,label:n},s)=>(r||di.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${s}] ${n}) without a symbol from web scene.`),!!r));return t?.length!==e?.length&&(i.classBreakInfos=t),i}function YC(i,e){return sB(i,null,e)}const Jir=zB({types:IE});function sB(i,e,t){return i?i&&(i.styleName||i.styleUrl)&&i.type!=="uniqueValue"?(t?.messages&&t.messages.push(new Rf("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+i.type+"'",{definition:i,context:t})),null):Jir(i,e,t):null}let Kir=class HMt{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(N4e),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new HMt,r=this._originStores[Pn.DEFAULTS];r&&r.forEach((n,s)=>{t.set(s,li(n),Pn.DEFAULTS)});for(let n=Pn.SERVICE;n{e&&e.has(a)||t.set(a,li(o),n)})}return t}get(e,t){const r=t===void 0?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=Pn.USER){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const s=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),s!==t}return!1}delete(e,t=Pn.USER){const r=this._originStores[t];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let s=t-1;s>=0;s--){const o=this._originStores[s];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,s);break}}}return n}has(e,t){const r=t===void 0?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],n=r?.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,t),s!==n}originOf(e){return this._propertyOriginMap.get(e)||Pn.DEFAULTS}forEach(e){this._values.forEach(e)}};const WMt=i=>{let e=class extends i{constructor(...t){super(...t);const r=Kp(this),n=r.store,s=new Kir;r.store=s,BCt(r,n,s)}read(t,r){GCt(this,t,r)}getAtOrigin(t,r){const n=T3e(this),s=n0(r);if(typeof t=="string")return n.get(t,s);const o={};return t.forEach(a=>{o[a]=n.get(a,s)}),o}originOf(t){return yne(this.originIdOf(t))}originIdOf(t){return T3e(this).originOf(t)}revert(t,r){const n=T3e(this),s=n0(r),o=Kp(this);let a;a=typeof t=="string"?t==="*"?n.keys(s):[t]:t,a.forEach(l=>{o.invalidate(l),n.revert(l,s),o.commit(l)})}};return e=x([Qe("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function T3e(i){return Kp(i).store}let nst=class extends WMt(un){};nst=x([Qe("esri.core.ReadOnlyMultiOriginJSONSupport")],nst);const Zir=i=>{let e=class extends i{constructor(...t){super(...t)}clear(t,r="user"){return C3e(this).delete(t,n0(r))}write(t,r){return VCt(this,t=t||{},r),t}setAtOrigin(t,r,n){Kp(this).setAtOrigin(t,r,n0(n))}removeOrigin(t){const r=C3e(this),n=n0(t),s=r.keys(n);for(const o of s)r.originOf(o)===n&&r.set(o,r.get(o,n),Pn.USER)}updateOrigin(t,r){const n=C3e(this),s=n0(r),o=_S(this,t);for(let a=s+1;a{let e=class extends Zir(WMt(i)){constructor(...t){super(...t)}};return e=x([Qe("esri.core.MultiOriginJSONSupport")],e),e};let f1e=class extends Ql(un){};f1e=x([Qe("esri.core.MultiOriginJSONSupport")],f1e);const Wv=(i=>i)(["operational-layers","basemap","ground"]);var bke;let VN=bke=class extends Ci{constructor(i){super(i),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new bke({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};x([D({type:String,json:{write:!0}})],VN.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],VN.prototype,"name",void 0),x([D({type:["boolean","date","number","string"],json:{write:!0}})],VN.prototype,"returnType",void 0),x([D({type:String,json:{write:!0}})],VN.prototype,"title",void 0),VN=bke=x([Qe("esri.form.ExpressionInfo")],VN);const Qir=VN;let HN=class extends Ci{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};x([D({type:String,json:{write:!0}})],HN.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],HN.prototype,"label",void 0),x([D()],HN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],HN.prototype,"visibilityExpression",void 0),HN=x([Qe("esri.form.elements.Element")],HN);const oB=HN;var wke;let Ome=wke=class extends Ci{constructor(i){super(i),this.type=null}clone(){return new wke({type:this.type})}};x([D({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],Ome.prototype,"type",void 0),Ome=wke=x([Qe("esri.form.elements.inputs.AttachmentInput")],Ome);const trr=Ome;var xke;let WN=xke=class extends oB{constructor(i){super(i),this.attachmentKeyword=null,this.editableExpression=null,this.input=null,this.type="attachment"}clone(){return new xke({attachmentKeyword:this.attachmentKeyword,description:this.description,editableExpression:this.editableExpression,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};x([D({type:String,json:{write:!0}})],WN.prototype,"attachmentKeyword",void 0),x([D({type:String,json:{write:!0}})],WN.prototype,"editableExpression",void 0),x([D({type:trr,json:{read:{source:"inputType"},write:{target:"inputType"}}})],WN.prototype,"input",void 0),x([D({type:["attachment"],json:{read:!1,write:!0}})],WN.prototype,"type",void 0),WN=xke=x([Qe("esri.form.elements.AttachmentElement")],WN);const sst=WN;let Pme=class extends Ci{constructor(e){super(e),this.type=null}};x([D()],Pme.prototype,"type",void 0),Pme=x([Qe("esri.form.elements.inputs.Input")],Pme);const NR=Pme;let _Q=class extends NR{constructor(e){super(e),this.maxLength=null,this.minLength=0}};x([D({type:Number,json:{write:!0}})],_Q.prototype,"maxLength",void 0),x([D({type:Number,json:{write:!0}})],_Q.prototype,"minLength",void 0),_Q=x([Qe("esri.form.elements.inputs.TextInput")],_Q);const xVe=_Q;var Ske;let Rme=Ske=class extends xVe{constructor(i){super(i),this.type="barcode-scanner"}clone(){return new Ske({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["barcode-scanner"],json:{read:!1,write:!0}})],Rme.prototype,"type",void 0),Rme=Ske=x([Qe("esri.form.elements.inputs.BarcodeScannerInput")],Rme);const irr=Rme;var Tke;let kG=Tke=class extends NR{constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new Tke({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};x([D({type:String,json:{write:!0}})],kG.prototype,"noValueOptionLabel",void 0),x([D({type:Boolean,json:{write:!0}})],kG.prototype,"showNoValueOption",void 0),x([D({type:["combo-box"],json:{read:!1,write:!0}})],kG.prototype,"type",void 0),kG=Tke=x([Qe("esri.form.elements.inputs.ComboBoxInput")],kG);const rrr=kG;var Cke;function ost(i){return i??null}function ast(i){return i??null}let mI=Cke=class extends NR{constructor(i){super(i),this.max=null,this.min=null,this.type="date-picker"}readMax(i,e){return ost(e.max)}writeMax(i,e){e.max=ast(i)}readMin(i,e){return ost(e.min)}writeMin(i,e){e.min=ast(i)}clone(){return new Cke({max:this.max,min:this.min})}};x([D({type:String,json:{type:String,write:!0}})],mI.prototype,"max",void 0),x([Mi("max")],mI.prototype,"readMax",null),x([ur("max")],mI.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],mI.prototype,"min",void 0),x([Mi("min")],mI.prototype,"readMin",null),x([ur("min")],mI.prototype,"writeMin",null),x([D({type:["date-picker"],json:{read:!1,write:!0}})],mI.prototype,"type",void 0),mI=Cke=x([Qe("esri.form.elements.inputs.DatePickerInput")],mI);const nrr=mI;var Eke;function E3e(i){return i??null}function I3e(i){return i??null}let N_=Eke=class extends NR{constructor(i){super(i),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(i,e){return E3e(e.max)}writeMax(i,e){e.max=I3e(i)}readMin(i,e){return E3e(e.min)}writeMin(i,e){e.min=I3e(i)}readTimeResolution(i,e){return E3e(e.timeResolution)}writeTimeResolution(i,e){e.timeResolution=I3e(i)}clone(){return new Eke({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};x([D({type:Boolean,json:{write:!0}})],N_.prototype,"includeTimeOffset",void 0),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"max",void 0),x([Mi("max")],N_.prototype,"readMax",null),x([ur("max")],N_.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"min",void 0),x([Mi("min")],N_.prototype,"readMin",null),x([ur("min")],N_.prototype,"writeMin",null),x([D({type:String,json:{type:String,write:!0}})],N_.prototype,"timeResolution",void 0),x([Mi("timeResolution")],N_.prototype,"readTimeResolution",null),x([ur("timeResolution")],N_.prototype,"writeTimeResolution",null),x([D({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],N_.prototype,"type",void 0),N_=Eke=x([Qe("esri.form.elements.inputs.DateTimeOffsetPickerInput")],N_);const srr=N_;var Ike;function lst(i){return i!=null?new Date(i):null}function ust(i){return i?i.getTime():null}let NT=Ike=class extends NR{constructor(i){super(i),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(i,e){return lst(e.max)}writeMax(i,e){e.max=ust(i)}readMin(i,e){return lst(e.min)}writeMin(i,e){e.min=ust(i)}clone(){return new Ike({includeTime:this.includeTime,max:this.max,min:this.min})}};x([D({type:Boolean,json:{write:!0}})],NT.prototype,"includeTime",void 0),x([D({type:Date,json:{type:Number,write:!0}})],NT.prototype,"max",void 0),x([Mi("max")],NT.prototype,"readMax",null),x([ur("max")],NT.prototype,"writeMax",null),x([D({type:Date,json:{type:Number,write:!0}})],NT.prototype,"min",void 0),x([Mi("min")],NT.prototype,"readMin",null),x([ur("min")],NT.prototype,"writeMin",null),x([D({type:["datetime-picker"],json:{read:!1,write:!0}})],NT.prototype,"type",void 0),NT=Ike=x([Qe("esri.form.elements.inputs.DateTimePickerInput")],NT);const orr=NT;var Ake;let LG=Ake=class extends NR{constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new Ake({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};x([D({type:String,json:{write:!0}})],LG.prototype,"noValueOptionLabel",void 0),x([D({type:Boolean,json:{write:!0}})],LG.prototype,"showNoValueOption",void 0),x([D({type:["radio-buttons"],json:{read:!1,write:!0}})],LG.prototype,"type",void 0),LG=Ake=x([Qe("esri.form.elements.inputs.RadioButtonsInput")],LG);const arr=LG;var Mke;let NG=Mke=class extends NR{constructor(i){super(i),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new Mke({offValue:this.offValue,onValue:this.onValue})}};x([D({type:[String,Number],json:{write:!0}})],NG.prototype,"offValue",void 0),x([D({type:[String,Number],json:{write:!0}})],NG.prototype,"onValue",void 0),x([D({type:["switch"],json:{read:!1,write:!0}})],NG.prototype,"type",void 0),NG=Mke=x([Qe("esri.form.elements.inputs.SwitchInput")],NG);const lrr=NG;var Oke;let Dme=Oke=class extends xVe{constructor(i){super(i),this.type="text-area"}clone(){return new Oke({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["text-area"],json:{read:!1,write:!0}})],Dme.prototype,"type",void 0),Dme=Oke=x([Qe("esri.form.elements.inputs.TextAreaInput")],Dme);const urr=Dme;var Pke;let Fme=Pke=class extends xVe{constructor(i){super(i),this.type="text-box"}clone(){return new Pke({maxLength:this.maxLength,minLength:this.minLength})}};x([D({type:["text-box"],json:{read:!1,write:!0}})],Fme.prototype,"type",void 0),Fme=Pke=x([Qe("esri.form.elements.inputs.TextBoxInput")],Fme);const crr=Fme;var Rke;function A3e(i){return i??null}function M3e(i){return i??null}let yw=Rke=class extends NR{constructor(i){super(i),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(i,e){return A3e(e.max)}writeMax(i,e){e.max=M3e(i)}readMin(i,e){return A3e(e.min)}writeMin(i,e){e.min=M3e(i)}readTimeResolution(i,e){return A3e(e.timeResolution)}writeTimeResolution(i,e){e.timeResolution=M3e(i)}clone(){return new Rke({max:this.max,min:this.min,timeResolution:this.timeResolution})}};x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"max",void 0),x([Mi("max")],yw.prototype,"readMax",null),x([ur("max")],yw.prototype,"writeMax",null),x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"min",void 0),x([Mi("min")],yw.prototype,"readMin",null),x([ur("min")],yw.prototype,"writeMin",null),x([D({type:String,json:{type:String,write:!0}})],yw.prototype,"timeResolution",void 0),x([Mi("timeResolution")],yw.prototype,"readTimeResolution",null),x([ur("timeResolution")],yw.prototype,"writeTimeResolution",null),x([D({type:["time-picker"],json:{read:!1,write:!0}})],yw.prototype,"type",void 0),yw=Rke=x([Qe("esri.form.elements.inputs.TimePickerInput")],yw);const hrr=yw,drr={base:NR,key:"type",typeMap:{"barcode-scanner":irr,"combo-box":rrr,"date-picker":nrr,"datetime-picker":orr,"datetimeoffset-picker":srr,"radio-buttons":arr,switch:lrr,"text-area":urr,"text-box":crr,"time-picker":hrr}};var Dke;let bQ=Dke=class extends Ci{constructor(i){super(i),this.name=null,this.code=null}clone(){return new Dke({name:this.name,code:this.code})}};x([D({type:String,json:{write:!0}})],bQ.prototype,"name",void 0),x([D({type:[String,Number],json:{write:!0}})],bQ.prototype,"code",void 0),bQ=Dke=x([Qe("esri.layers.support.CodedValue")],bQ);const prr=new Rs({inherited:"inherited",codedValue:"coded-value",range:"range"});let wQ=class extends Ci{constructor(e){super(e),this.name=null,this.type=null}};x([D({type:String,json:{write:!0}})],wQ.prototype,"name",void 0),x([Wr(prr)],wQ.prototype,"type",void 0),wQ=x([Qe("esri.layers.support.Domain")],wQ);const B2e=wQ;var Fke;let xQ=Fke=class extends B2e{constructor(i){super(i),this.codedValues=null,this.type="coded-value"}getName(i){let e=null;if(this.codedValues){const t=String(i);this.codedValues.some(r=>(String(r.code)===t&&(e=r.name),!!e))}return e}clone(){return new Fke({codedValues:li(this.codedValues),name:this.name})}};x([D({type:[bQ],json:{write:!0}})],xQ.prototype,"codedValues",void 0),x([Wr({codedValue:"coded-value"})],xQ.prototype,"type",void 0),xQ=Fke=x([Qe("esri.layers.support.CodedValueDomain")],xQ);const qMt=xQ;var kke;let kme=kke=class extends B2e{constructor(i){super(i),this.type="inherited"}clone(){return new kke}};x([Wr({inherited:"inherited"})],kme.prototype,"type",void 0),kme=kke=x([Qe("esri.layers.support.InheritedDomain")],kme);const YMt=kme;var Lke;let $G=Lke=class extends B2e{constructor(i){super(i),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new Lke({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};x([D({json:{type:[Number],read:{source:"range",reader:(i,e)=>e.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(i,e,t){e[t]=[this.minValue||0,i]}}}})],$G.prototype,"maxValue",void 0),x([D({json:{type:[Number],read:{source:"range",reader:(i,e)=>e.range?.[0]},write:{target:"range",writer(i,e,t){e[t]=[i,this.maxValue||0]}}}})],$G.prototype,"minValue",void 0),x([Wr({range:"range"})],$G.prototype,"type",void 0),$G=Lke=x([Qe("esri.layers.support.RangeDomain")],$G);const XMt=$G,JMt={key:"type",base:B2e,typeMap:{range:XMt,"coded-value":qMt,inherited:YMt}};function j2e(i){if(!i?.type)return null;switch(i.type){case"range":return XMt.fromJSON(i);case"codedValue":return qMt.fromJSON(i);case"inherited":return YMt.fromJSON(i)}return null}var Nke;let C2=Nke=class extends oB{constructor(i){super(i),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return this._get("editable")??!0}set editable(i){this._set("editable",i)}clone(){return new Nke({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};x([D({types:JMt,json:{read:{reader:j2e},write:!0}})],C2.prototype,"domain",void 0),x([D({type:Boolean,json:{write:!0}})],C2.prototype,"editable",null),x([D({type:String,json:{write:!0}})],C2.prototype,"editableExpression",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"fieldName",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"hint",void 0),x([D({types:drr,json:{read:{source:"inputType"},write:{target:"inputType"}}})],C2.prototype,"input",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"requiredExpression",void 0),x([D({type:String,json:{read:!1,write:!0}})],C2.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],C2.prototype,"valueExpression",void 0),C2=Nke=x([Qe("esri.form.elements.FieldElement")],C2);const cst=C2;var $ke;let WM=$ke=class extends oB{constructor(i){super(i),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new $ke({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:li(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};x([D({type:Number,json:{write:!0}})],WM.prototype,"displayCount",void 0),x([D({type:["list"],json:{write:!0}})],WM.prototype,"displayType",void 0),x([D({type:String,json:{write:!0}})],WM.prototype,"editableExpression",void 0),x([D({type:[Yze],json:{write:!0}})],WM.prototype,"orderByFields",void 0),x([D({type:Number,json:{write:!0}})],WM.prototype,"relationshipId",void 0),x([D({type:["relationship"],json:{read:!1,write:!0}})],WM.prototype,"type",void 0),WM=$ke=x([Qe("esri.form.elements.RelationshipElement")],WM);const hst=WM;var Bke;let BG=Bke=class extends oB{constructor(i){super(i),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new Bke({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};x([D({type:String,json:{write:!0}})],BG.prototype,"text",void 0),x([D({type:String,json:{write:!0}})],BG.prototype,"textFormat",void 0),x([D({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],BG.prototype,"type",void 0),BG=Bke=x([Qe("esri.form.elements.TextElement")],BG);const dst=BG;function KMt(i){return{typesWithGroup:{base:oB,key:"type",typeMap:{attachment:sst,field:cst,group:i,relationship:hst,text:dst}},typesWithoutGroup:{base:oB,key:"type",typeMap:{attachment:sst,field:cst,relationship:hst,text:dst}}}}function ZMt(i,e,t=!0){if(!i)return null;const r=t?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function QMt(i,e,t=!0){if(!i)return null;const r=t?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>n.toJSON())}function eOt(i,e,t=!0){return i?i.map(r=>u3(t?e.typesWithGroup:e.typesWithoutGroup,r)):null}var jke;let VI=jke=class extends oB{constructor(i){super(i),this.elements=null,this.initialState="expanded",this.type="group"}castElements(i){return eOt(i,O3e,!1)}readElements(i,e){return ZMt(e.formElements,O3e,!1)}writeElements(i,e){e.formElements=QMt(i,O3e,!1)}clone(){return new jke({description:this.description,elements:li(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};x([D({json:{write:!0}})],VI.prototype,"elements",void 0),x([So("elements")],VI.prototype,"castElements",null),x([Mi("elements",["formElements"])],VI.prototype,"readElements",null),x([ur("elements")],VI.prototype,"writeElements",null),x([D({type:["collapsed","expanded"],json:{write:!0}})],VI.prototype,"initialState",void 0),x([D({type:String,json:{read:!1,write:!0}})],VI.prototype,"type",void 0),VI=jke=x([Qe("esri.form.elements.GroupElement")],VI);const O3e=KMt(VI),frr=VI;var Gke;const P3e=KMt(frr);let $T=Gke=class extends Ci{constructor(i){super(i),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(i){return eOt(i,P3e)}readElements(i,e){return ZMt(e.formElements,P3e)}writeElements(i,e){e.formElements=QMt(i,P3e)}clone(){return new Gke({description:this.description,expressionInfos:li(this.expressionInfos),elements:li(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};x([D({type:String,json:{write:!0}})],$T.prototype,"description",void 0),x([D({json:{write:!0}})],$T.prototype,"elements",void 0),x([So("elements")],$T.prototype,"castElements",null),x([Mi("elements",["formElements"])],$T.prototype,"readElements",null),x([ur("elements")],$T.prototype,"writeElements",null),x([D({type:[Qir],json:{write:!0}})],$T.prototype,"expressionInfos",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],$T.prototype,"preserveFieldValuesWhenHidden",void 0),x([D({type:String,json:{write:!0}})],$T.prototype,"title",void 0),$T=Gke=x([Qe("esri.form.FormTemplate")],$T);const tOt=$T;async function mrr(i){const e="portalItem"in i?i:{portalItem:i},{fromItem:t}=await Promise.resolve().then(()=>UNr);try{return await t(e)}catch(r){const n=e&&e.portalItem,s=n?.id||"unset",o=n&&n.portal&&n.portal.url||Ho.portalUrl;throw di.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",r),r}}let grr=0,Hf=class extends rd.EventedMixin(iT(ef)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new hr(-180,-90,180,90,Xi.WGS84),this.id=Date.now().toString(16)+"-layer-"+grr++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=Xi.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t=typeof e=="string"?{url:e}:e;return(await Promise.resolve().then(()=>k7r)).fromUrl(t)}static fromPortalItem(e){return mrr(e)}initialize(){this.when().catch(e=>{mo(e)||di.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Yo(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await zi(e,{query:{f:"json"},responseType:"json"})).data;throw new qe("layer:no-attribution-data","Layer does not have attribution data")}};x([D({type:String})],Hf.prototype,"attributionDataUrl",void 0),x([D({type:hr})],Hf.prototype,"fullExtent",void 0),x([D({readOnly:!0})],Hf.prototype,"hasAttributionData",null),x([D({type:String,clonable:!1})],Hf.prototype,"id",void 0),x([D({type:Boolean,nonNullable:!0})],Hf.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"]})],Hf.prototype,"listMode",void 0),x([D({type:Number,range:{min:0,max:1},nonNullable:!0})],Hf.prototype,"opacity",void 0),x([D({clonable:!1})],Hf.prototype,"parent",void 0),x([D({readOnly:!0})],Hf.prototype,"parsedUrl",null),x([D({type:Boolean,readOnly:!0})],Hf.prototype,"persistenceEnabled",void 0),x([D({type:Boolean})],Hf.prototype,"popupEnabled",void 0),x([D({type:Boolean})],Hf.prototype,"attributionVisible",void 0),x([D({type:Xi})],Hf.prototype,"spatialReference",void 0),x([D({type:String})],Hf.prototype,"title",void 0),x([D({readOnly:!0,json:{read:!1}})],Hf.prototype,"type",void 0),x([D()],Hf.prototype,"url",void 0),x([D({type:Boolean,nonNullable:!0})],Hf.prototype,"visible",void 0),Hf=x([Qe("esri.layers.Layer")],Hf);const Il=Hf;let m1e=class{constructor(e=t=>t.values().next().value){this._peeker=e,this._observable=new pY,this._items=new Set}get length(){return Ws(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let e;for(e of this._items);return e}peek(){if(this.length!==0)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return Ws(this._observable),this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const t=this.length;return this._items.forEach(r=>{e(r)||this._items.delete(r)}),t!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){Ws(this._observable),yield*this._items}};const iOt=new FinalizationRegistry(i=>{i.close()});function yrr(i,e){iOt.register(i,e,e)}function vrr(i){iOt.unregister(i)}const rOt="worker:port-closed";var iy;(function(i){i[i.HANDSHAKE=0]="HANDSHAKE",i[i.OPEN=1]="OPEN",i[i.OPENED=2]="OPENED",i[i.RESPONSE=3]="RESPONSE",i[i.INVOKE=4]="INVOKE",i[i.ABORT=5]="ABORT",i[i.CLOSE=6]="CLOSE",i[i.OPEN_PORT=7]="OPEN_PORT",i[i.ON=8]="ON"})(iy||(iy={}));let _rr=0;function nOt(){return _rr++}function brr(i){return i&&typeof i=="object"&&("result"in i||"transferList"in i)}function Lne(i){return i?typeof i=="string"?JSON.stringify({name:"message",message:i}):i.toJSON?JSON.stringify(i):JSON.stringify({name:i.name,message:i.message,details:i.details||{stack:i.stack}}):null}function SVe(i,e,t,r){if(e.type===iy.OPEN_PORT)return void i.postMessage(e,[e.port]);if(e.type!==iy.INVOKE&&e.type!==iy.RESPONSE)return void i.postMessage(e);let n;if(brr(t)?(n=pst(t.transferList),e.data=t.result):(n=pst(r),e.data=t),n){if(yi("ff")){for(const s of n)if("byteLength"in s&&s.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(e.type){case iy.INVOKE:throw o;case iy.RESPONSE:return void SVe(i,{type:iy.RESPONSE,jobId:e.jobId,error:Lne(o)})}}}i.postMessage(e,n)}else i.postMessage(e)}function Nne(i){if(!i)return null;const e=i.data;return e?typeof e=="string"?JSON.parse(e):e:null}function pst(i){if(!i?.length)return null;if(yi("esri-workers-arraybuffer-transfer"))return i;const e=i.filter(t=>!wrr(t));return e.length?e:null}function wrr(i){return i instanceof ArrayBuffer||i?.constructor?.name==="ArrayBuffer"}async function xrr(i){try{return await i}catch(e){const t=e?.name===rOt;if(!(mo(e)||t))throw e;return}}function sOt(i,e,t){return new Proxy({},{get:(r,n,s)=>(...o)=>{let a,l;const u=o[o.length-1];Srr(u)&&(a=u.signal,l=u.transferList,o.pop());const c=i.apply(e?`${e}.${n.toString()}`:n.toString(),o,{transferList:l,signal:a});return t?.ignoreConnectionErrors?xrr(c):c}})}function Srr(i){return typeof i=="object"&&!Array.isArray(i)&&i!=null&&("signal"in i||"transferList"in i||Object.keys(i).length===0)}const Trr={statsWorker:()=>Promise.resolve().then(()=>pjr),geometryEngineWorker:()=>Promise.resolve().then(()=>mjr),CSVSourceWorker:()=>Promise.resolve().then(()=>NGr),EdgeProcessingWorker:()=>Promise.resolve().then(()=>mUr),ElevationSamplerWorker:()=>Promise.resolve().then(()=>yzr),FeatureServiceSnappingSourceWorker:()=>Promise.resolve().then(()=>Yzr),GeoJSONSourceWorker:()=>Promise.resolve().then(()=>gVr),LercWorker:()=>Promise.resolve().then(()=>CVr),MemorySourceWorker:()=>Promise.resolve().then(()=>DVr),PBFDecoderWorker:()=>Promise.resolve().then(()=>VVr),FeaturePipelineWorker:()=>Promise.resolve().then(()=>bQr),PointCloudWorker:()=>Promise.resolve().then(()=>Aen),RasterWorker:()=>Promise.resolve().then(()=>vrn),SceneLayerSnappingSourceWorker:()=>Promise.resolve().then(()=>enn),SceneLayerWorker:()=>Promise.resolve().then(()=>bnn),WFSSourceWorker:()=>Promise.resolve().then(()=>Xnn),WorkerTileHandler:()=>Promise.resolve().then(()=>uon),Lyr3DWorker:()=>Promise.resolve().then(()=>fon)},{CLOSE:fst,ABORT:mst,INVOKE:gst,RESPONSE:RJ,OPEN_PORT:yst,ON:Crr}=iy,Err=2;let Irr=class{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===iy.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},mR=class jG{static connect(e){const t=new MessageChannel;let r;r=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new jG(t.port1,{channel:t,client:r});return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=n),jG.clients.set(n,r),t.port2}static loadWorker(e){const t=Trr[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new Irr(n=>this._onInvokeMessage(n)),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:fst}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,s=r?.transferList;if(!this._port)return Promise.reject(new qe(rOt,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const o=nOt();return new Promise((a,l)=>{if(xg(n))return this._processWork(),void l(Oc());const u=Qh(n,()=>{const h=this._outJobs.get(o);h&&(this._outJobs.delete(o),this._processWork(),Hc(h.abortHandle),this._post({type:mst,jobId:o}),l(Oc()))}),c={resolve:a,reject:l,abortHandle:u,debugInfo:e};this._outJobs.set(o,c),this._post({type:gst,jobId:o,methodName:e,abortable:n!=null},t,s)})}createInvokeProxy(e,t){return sOt(this,e,t)}on(e,t){const r=new MessageChannel;function n(s){t(s.data)}return this._port.postMessage({type:iy.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),wa(()=>{r.port1.postMessage({type:iy.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)})}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:yst,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=Err)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:s}=e;this.apply(t,r,n).then(o=>s.resolve(o)).catch(o=>s.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{Hc(e.abortHandle),e.reject(Oc(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){this._schedule!=null?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const t=Nne(e);if(t)switch(t.type){case RJ:this._onResponseMessage(t);break;case gst:this._invokeQueue.push(t);break;case mst:this._onAbortMessage(t);break;case fst:this._onCloseMessage();break;case yst:this._onOpenPortMessage(t);break;case Crr:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&jG.clients.get(this)===e&&e.destroy(),jG.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:s}=e,o=s?new AbortController:null,a=this._inJobs;let l,u=this._client,c=u[t];try{if(!c&&t&&t.includes(".")){const h=t.split(".");for(let p=0;p{a.has(r)&&(a.delete(r),this._post({type:RJ,jobId:r},h))},h=>{a.has(r)&&(a.delete(r),mo(h)||this._post({type:RJ,jobId:r,error:Lne(h||{message:`Error encountered at method ${t}`})}))})):this._post({type:RJ,jobId:r},l)}_onOpenPortMessage(e){new jG(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,s=>{t.postMessage(s)}),n=BA(e.port,"message",s=>{Nne(s)?.type===iy.CLOSE&&(n.remove(),r.remove(),t.close())})}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const o=s.get(t);s.delete(t),this._processWork(),Hc(o.abortHandle),r?o.reject(qe.fromJSON(JSON.parse(r))):o.resolve(n)}_post(e,t,r){return SVe(this._port,e,t,r)}};mR.kernelInfo={buildDate:sEt,fullVersion:sze,revision:oEt},mR.clients=new Map;let oOt=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new m1e}destroy(){this.close()}get closed(){return!this._clients?.length}open(e,t){return new Promise((r,n)=>{let s=!0;const o=a=>{hn(t.signal),s&&(s=!1,a())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let a=0;a(this._clients[a]=new mR(u,t,this._ongoingJobsQueue),o(r),this._clients[a]),()=>(o(n),null)):(this._clients[a]=new mR(l,t,this._ongoingJobsQueue),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(r))}})}broadcast(e,t,r){const n=new Array(this._clientPromises.length);for(let s=0;sa?.invoke(e,t,r))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(Oc(`Worker closing, aborting job calling '${e.methodName}'`));for(const t of this._clientPromises)t.then(r=>r?.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,vrr(this)}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=ac();this._ongoingJobsQueue.push({methodName:e,data:t,invokeOptions:r,resolver:n});for(let s=0;sa?.jobAdded())}return n.promise}createInvokeProxy(e){return sOt(this,e)}on(e,t){return Promise.all(this._clientPromises).then(()=>j3(this._clients.map(r=>r.on(e,t))))}openPorts(){return new Promise(e=>{const t=new Array(this._clientPromises.length);let r=t.length;for(let n=0;n{s&&(t[n]=s.openPort()),--r==0&&e(t)})})}get test(){return{numClients:this._clients.length}}};const Arr={async request(i,e){const t=i.options,r=t.responseType;t.signal=e?.signal,t.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&ZCt(i.url)?.after?r:"array-buffer";const n=await zi(i.url,t),s={data:n.data,httpStatus:n.httpStatus,ssl:n.ssl};switch(n.requestOptions?.responseType){case"native-request-init":return delete s.data.signal,s;case"blob":s.data=await s.data.arrayBuffer();break;case"json":s.data=new TextEncoder().encode(JSON.stringify(s.data)).buffer;break;case"text":s.data=new TextEncoder().encode(s.data).buffer}return{result:s,transferList:[s.data]}}},Mrr={};function Orr(i){const e={async:i.async,isDebug:i.isDebug,locale:i.locale,baseUrl:i.baseUrl,has:{...i.has},map:{...i.map},packages:i.packages?.concat()||[],paths:{...i.paths}};return i.hasOwnProperty("async")||(e.async=!0),i.hasOwnProperty("isDebug")||(e.isDebug=!1),i.baseUrl||(e.baseUrl=Mrr.baseUrl),e}let Prr=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(t=>{this[t]=(...r)=>e[t](...r)})}},Lme=class{constructor(){this._dispatcher=new Prr,this._workerPostMessage({type:iy.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){z9(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){z9(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const t=Nne(e);if(t&&t.type===iy.OPEN){const{modulePath:r,jobId:n}=t;let s=await mR.loadWorker(r);s||(s=await import(r));const o=mR.connect(s);this._workerPostMessage({type:iy.OPENED,jobId:n,data:o})}}};const Uke=()=>di.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:Rrr}=iy,Drr='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let the,ihe;const vst="Failed to create Worker. Fallback to execute module in main thread";async function Frr(){if(!yi("esri-workers"))return _st(new Lme);if(!the&&!ihe)try{const e=Drr.split('"{CONFIGURATION}"').join(`'${krr()}'`);the=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){ihe=e||{}}let i;if(the)try{i=new Worker(the,{name:"esri-worker-"+Lrr++})}catch{Uke().warn(vst,ihe),i=new Lme}else Uke().warn(vst,ihe),i=new Lme;return _st(i)}async function _st(i){return new Promise(e=>{function t(n){const s=Nne(n);s&&s.type===Rrr&&(i.removeEventListener("message",t),i.removeEventListener("error",r),e(i))}function r(n){n.preventDefault(),i.removeEventListener("message",t),i.removeEventListener("error",r),Uke().warn("Failed to create Worker. Fallback to execute module in main thread",n),(i=new Lme).addEventListener("message",t),i.addEventListener("error",r)}i.addEventListener("message",t),i.addEventListener("error",r)})}function krr(){let i;if(Ho.default!=null){const n={...Ho};delete n.default,i=JSON.parse(JSON.stringify(n))}else i=JSON.parse(JSON.stringify(Ho));i.assetsPath=xf(i.assetsPath),i.defaultAssetsPath=i.defaultAssetsPath?xf(i.defaultAssetsPath):void 0,i.request.interceptors=[],i.log.interceptors=[],i.locale=Am(),i.has={"esri-csp-restrictions":yi("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":yi("esri-2d-update-debug"),"esri-2d-log-updating":yi("esri-2d-log-updating"),"featurelayer-pbf":yi("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":yi("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":yi("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":yi("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":yi("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":yi("featurelayer-query-max-depth"),"featurelayer-query-pausing-enabled":yi("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-enabled":yi("featurelayer-snapshot-enabled"),"esri-atomics":yi("esri-atomics"),"esri-shared-array-buffer":yi("esri-shared-array-buffer"),"esri-tiles-debug":yi("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":yi("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":yi("feature-polyline-generalization-factor"),"host-webworker":1},i.workers.loaderUrl&&(i.workers.loaderUrl=xf(i.workers.loaderUrl)),i.workers.workerPath?i.workers.workerPath=xf(i.workers.workerPath):i.workers.workerPath=xf(Fl("esri/core/workers/RemoteClient.js")),i.workers.useDynamicImport=!1;const e=Ho.workers.loaderConfig,t=Orr({baseUrl:e?.baseUrl,locale:Am(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...e?.has},map:{...e?.map},paths:{...e?.paths},packages:e?.packages||[]});return JSON.stringify({esriConfig:i,loaderConfig:t,kernelInfo:{buildDate:sEt,fullVersion:sze,revision:oEt}})}let Lrr=0;const{ABORT:bst,INVOKE:Nrr,OPEN:$rr,OPENED:Brr,RESPONSE:DJ}=iy;let jrr=class aOt{static async create(e){const t=await Frr();return new aOt(t,e)}constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",r=>{r.preventDefault(),di.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,n=nOt();return new Promise((s,o)=>{const a={resolve:s,reject:o,abortHandle:ZH(r,()=>{this._outJobs.delete(n),this._post({type:bst,jobId:n})})};this._outJobs.set(n,a),this._post({type:$rr,jobId:n,modulePath:e})})}_onMessage(e){const t=Nne(e);if(t)switch(t.type){case Brr:this._onOpenedMessage(t);break;case DJ:this._onResponseMessage(t);break;case bst:this._onAbortMessage(t);break;case Nrr:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);n&&(n.controller&&n.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,a=this._inJobs,l=Arr[t];let u;try{if(typeof l!="function")throw new TypeError(`${t} is not a function`);u=l.call(null,n,{signal:o?o.signal:null})}catch(c){return void this._post({type:DJ,jobId:r,error:Lne(c)})}qp(u)?(a.set(r,{controller:o,promise:u}),u.then(c=>{a.has(r)&&(a.delete(r),this._post({type:DJ,jobId:r},c))},c=>{a.has(r)&&(a.delete(r),c||(c={message:"Error encountered at method"+t}),mo(c)||this._post({type:DJ,jobId:r,error:Lne(c||{message:`Error encountered at method ${t}`})}))})):this._post({type:DJ,jobId:r},u)}_onOpenedMessage(e){const{jobId:t,data:r}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),Hc(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs.get(t);s&&(this._outJobs.delete(t),Hc(s.abortHandle),r?s.reject(qe.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,t,r){return SVe(this.worker,e,t,r)}};const wst=yi("host-browser")?Math.min(navigator.hardwareConcurrency-1,yi("workers-pool-size")):0;let l8=yi("esri-mobile")?Math.min(wst,3):wst;l8||(l8=yi("safari")&&yi("mac")?7:2);let xst=0;const Nme=[];function Grr(){lOt()}async function rhe(i,e){const t=new oOt,{registryTarget:r,...n}=e;return await t.open(i,n),r&&yrr(r,t),t}async function $R(i,e={}){if(typeof i!="string")throw new qe("workers:undefined-module","modulePath is missing");let t=e.strategy||"distributed";if(yi("host-webworker")&&!yi("esri-workers")&&(t="local"),t==="local"){let r=await mR.loadWorker(i);r||(r=await import(i)),hn(e.signal);const n=e.client||r;return rhe([mR.connect(r)],{...e,client:n})}if(await lOt(),hn(e.signal),t==="dedicated"){const r=xst++%l8;return rhe([await Nme[r].open(i,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,l8);if(rr.open(i,e)),e)}let nhe=null;async function lOt(){if(nhe)return nhe;new AbortController;const i=[];for(let e=0;e(Nme[e]=r,r));i.push(t)}return nhe=Promise.all(i),nhe}function Sst(i,e,t){if(i.hasM==null||i.hasZ)for(const r of e)for(const n of r)n.length>2&&(n[2]*=t)}function uOt(i,e,t){if(!i&&!e||!t)return;const r=WF(t);Tst(i,t,r),Tst(e,t,r)}function Tst(i,e,t){if(i)for(const r of i)Urr(r.geometry,e,t)}function Urr(i,e,t){if(!i?.spatialReference||Ya(i.spatialReference,e))return;const r=WF(i.spatialReference)/t;if(r!==1){if("x"in i)i.z!=null&&(i.z*=r);else if("rings"in i)Sst(i,i.rings,r);else if("paths"in i)Sst(i,i.paths,r);else if("points"in i&&(i.hasM==null||i.hasZ))for(const n of i.points)n.length>2&&(n[2]*=r)}}function IY(i,e,t){if(e==null||t==null||t.vcsWkid||Ya(e,t)||HF(e)||HF(t))return null;const r=WF(e)/WF(t);if(r===1)return null;switch(i){case"point":case"esriGeometryPoint":return n=>zrr(n,r);case"polyline":case"esriGeometryPolyline":return n=>Hrr(n,r);case"polygon":case"esriGeometryPolygon":return n=>Vrr(n,r);case"multipoint":case"esriGeometryMultipoint":return n=>Wrr(n,r);case"extent":case"esriGeometryEnvelope":return n=>qrr(n,r);default:return null}}function zrr(i,e){i?.z!=null&&(i.z*=e)}function Vrr(i,e){if(i)for(const t of i.rings)for(const r of t)r.length>2&&(r[2]*=e)}function Hrr(i,e){if(i)for(const t of i.paths)for(const r of t)r.length>2&&(r[2]*=e)}function Wrr(i,e){if(i)for(const t of i.points)t.length>2&&(t[2]*=e)}function qrr(i,e){i&&i.zmin!=null&&i.zmax!=null&&(i.zmin*=e,i.zmax*=e)}function g1e(i,e,t){if(!t?.features||!t.hasZ)return;const r=IY(t.geometryType,e,i.outSpatialReference);if(r!=null)for(const n of t.features)r(n.geometry)}const wW=new Rs({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var zke;const Yrr=new Rs({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let H0=zke=class extends Ci{constructor(i){super(i),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(i,{description:e}){let t=null;try{t=e?JSON.parse(e):null}catch{}return t?.value??null}readValueType(i,{description:e}){let t=null;try{t=e?JSON.parse(e):null}catch{}return t?Yrr.fromJSON(t.fieldValueType):null}clone(){return new zke({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};x([D({type:String,json:{write:!0}})],H0.prototype,"alias",void 0),x([D({type:[String,Number],json:{write:{allowNull:!0}}})],H0.prototype,"defaultValue",void 0),x([D()],H0.prototype,"description",void 0),x([Mi("description")],H0.prototype,"readDescription",null),x([D({types:JMt,json:{read:{reader:j2e},write:!0}})],H0.prototype,"domain",void 0),x([D({type:Boolean,json:{write:!0}})],H0.prototype,"editable",void 0),x([D({type:ms,json:{write:{overridePolicy:i=>({enabled:Number.isFinite(i)})}}})],H0.prototype,"length",void 0),x([D({type:String,json:{write:!0}})],H0.prototype,"name",void 0),x([D({type:Boolean,json:{write:!0}})],H0.prototype,"nullable",void 0),x([Wr(wW)],H0.prototype,"type",void 0),x([D()],H0.prototype,"valueType",void 0),x([Mi("valueType",["description"])],H0.prototype,"readValueType",null),x([D({type:Boolean,json:{read:!1}})],H0.prototype,"visible",void 0),H0=zke=x([Qe("esri.layers.support.Field")],H0);const Fo=H0;var Vke;const Hke=new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let Gg=Vke=class extends Ci{constructor(i){super(i),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(i,e){const t=Xi.fromJSON(e.spatialReference),r=[];for(let n=0;n0)for(let t=0;tMath.round((u-r)/e),o=u=>Math.round((n-u)/t),a=this.features,l=this._getQuantizationFunction(this.geometryType,s,o);for(let u=0,c=a.length;up*s+r,l=p=>n-p*o;let u=null,c=null;if(this.hasZ&&t?.scale?.[2]!=null){const{translate:[,,p],scale:[,,m]}=t;u=v=>v*m+p}if(this.hasM&&t?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,m]}=t;c=v=>v==null?v:v*m+p}const h=this._getHydrationFunction(i,a,l,u,c);for(const{geometry:p}of e)p!=null&&h&&h(p);return this.transform=null,this}_quantizePoints(i,e,t){let r,n;const s=[];for(let o=0,a=i.length;o0){const u=e(l[0]),c=t(l[1]);u===r&&c===n||(s.push([u-r,c-n]),r=u,n=c)}else r=e(l[0]),n=t(l[1]),s.push([r,n])}return s.length>0?s:null}_getQuantizationFunction(i,e,t){return i==="point"?r=>(r.x=e(r.x),r.y=t(r.y),r):i==="polyline"||i==="polygon"?r=>{const n=ed(r)?r.rings:r.paths,s=[];for(let o=0,a=n.length;o0?(ed(r)?r.rings=s:r.paths=s,r):null}:i==="multipoint"?r=>{const n=this._quantizePoints(r.points,e,t);return n&&n.length>0?(r.points=n,r):null}:i==="extent"?r=>r:null}_getHydrationFunction(i,e,t,r,n){return i==="point"?s=>{s.x=e(s.x),s.y=t(s.y),r&&(s.z=r(s.z))}:i==="polyline"||i==="polygon"?s=>{const o=ed(s)?s.rings:s.paths;let a,l;for(let u=0,c=o.length;u0?(a+=v[0],l+=v[1]):(a=v[0],l=v[1]),v[0]=e(a),v[1]=t(l)}}if(r&&n)for(let u=0,c=o.length;u{s.xmin=e(s.xmin),s.ymin=t(s.ymin),s.xmax=e(s.xmax),s.ymax=t(s.ymax),r&&s.zmax!=null&&s.zmin!=null&&(s.zmax=r(s.zmax),s.zmin=r(s.zmin)),n&&s.mmax!=null&&s.mmin!=null&&(s.mmax=n(s.mmax),s.mmin=n(s.mmin))}:i==="multipoint"?s=>{const o=s.points;let a,l;for(let u=0,c=o.length;u0?(a+=h[0],l+=h[1]):(a=h[0],l=h[1]),h[0]=e(a),h[1]=t(l)}if(r&&n)for(let u=0,c=o.length;u({enabled:i})}}})],Gg.prototype,"exceededTransferLimit",void 0),x([D({type:[Us],json:{write:!0}})],Gg.prototype,"features",void 0),x([Mi("features")],Gg.prototype,"readFeatures",null),x([D({type:[Fo],json:{write:!0}})],Gg.prototype,"fields",void 0),x([D({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:Hke.read}}})],Gg.prototype,"geometryType",void 0),x([ur("geometryType")],Gg.prototype,"writeGeometryType",null),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Gg.prototype,"hasM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Gg.prototype,"hasZ",void 0),x([D({types:Ff,json:{write:!0}})],Gg.prototype,"queryGeometry",void 0),x([Mi("queryGeometry")],Gg.prototype,"readQueryGeometry",null),x([D({type:Xi,json:{write:!0}})],Gg.prototype,"spatialReference",void 0),x([ur("spatialReference")],Gg.prototype,"writeSpatialReference",null),x([D({json:{write:!0}})],Gg.prototype,"transform",void 0),Gg=Vke=x([Qe("esri.rest.support.FeatureSet")],Gg),Gg.prototype.toJSON.isDefaultToJSON=!0;const du=Gg;let Xrr=0,UO=class extends ef.LoadableMixin(U3(dr)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);g1e(e,this.layer.spatialReference,r);const n=du.fromJSON(r);if(!this._requiresClientGraphicMapping())return n;const s=this.layer.objectIdField;for(const o of n.features){const a=o.attributes[s],l=this._idToClientGraphic.get(a);l&&(o.geometry=l.geometry)}return n.geometryType=this.layer.geometryType,n}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new qe("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return g1e(e,this.layer.spatialReference,r),r}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:hr.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new qe("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const n=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=c=>"objectId"in c&&c.objectId!=null?c.objectId:"attributes"in c&&c.attributes[t]!=null?c.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const c of e.deleteFeatures){const h=o(c);h!=null&&n.push(h)}const a=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const c of e.updateFeatures)if(s.push(this._serializeFeature(c)),a){const h=o(c);h!=null&&a.set(h,c)}}uOt(r?r.features:null,s,this.layer.spatialReference);const{fullExtent:l,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:s,deletes:n});return this.fullExtent=l,r&&r.finish(u.uidToObjectId),this._updateClientGraphicIds(a,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:n}of e)n==null||n.type!=="mesh"||n.hasExtent||n.loaded||r.push(n.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const n=e.get(r.objectId);n!=null&&this._addIdToClientGraphic(n)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new qe("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let n=null;for(let o=0;o{di.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),v.preventDefault()}));const h={features:c.features,fields:t?.map(v=>v.toJSON()),geometryType:Yve.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||o,objectIdField:n,spatialReference:u?null:r&&r.toJSON(),timeInfo:a?.toJSON()??null,dateFieldsTimeZone:l},p=await this._connection.invoke("load",h,{signal:e});for(const v of p.warnings)di.getLogger(this.layer).warn("#load()",`${v.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:v});p.featureErrors.length&&di.getLogger(this.layer).warn("#load()",`Encountered ${p.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:p.featureErrors});const m=p.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(c.inferredGeometryType)&&(m.geometryType=Yve.toJSON(c.inferredGeometryType)),this.sourceJSON=m,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),c.finish(p.assignedObjectIds)}};x([aze({Type:Us,ensureType:Sd(Us)})],UO.prototype,"itemType",void 0),x([D()],UO.prototype,"type",void 0),x([D({constructOnly:!0})],UO.prototype,"layer",void 0),x([D({readOnly:!0})],UO.prototype,"_workerGeometryType",null),x([D()],UO.prototype,"sourceJSON",void 0),UO=x([Qe("esri.layers.graphics.sources.MemorySource")],UO);function Jrr(i){return"portalItem"in i}const Wx=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):Jrr(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return x([D({type:String})],e.prototype,"apiKey",null),e=x([Qe("esri.layers.mixins.APIKeyMixin")],e),e},cOt={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},hOt=Object.values(cOt),dOt=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${hOt.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),Krr=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${hOt.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),Zrr=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function pOt(i){return!!dOt.test(i)}function r_(i){if(i==null)return null;const e=Yo(i),t=e?.path.match(dOt)||e?.path.match(Krr);if(!t)return null;const[,r,n,s,o]=t,a=n.indexOf("/");return{title:G2e(a!==-1?n.slice(a+1):n),serverType:cOt[s.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:r}}}function fOt(i){const e=Yo(i).path.match(Zrr);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function G2e(i){return(i=i.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+i.slice(1)}function TVe(i,e){const t=[];if(i){const r=r_(i);r!=null&&r.title&&t.push(r.title)}if(e){const r=G2e(e);t.push(r)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function Fx(i){if(!i)return!1;const e=".arcgis.com/",t="//services",r="//tiles",n="//features",s=(i=i.toLowerCase()).includes(e),o=i.includes(t)||i.includes(r)||i.includes(n);return s&&o}function xae(i,e){return i&&q9(iEt(i,e))}function mOt(i){let{url:e}=i;if(!e)return{url:e};e=iEt(e,i.logger);const t=Yo(e),r=r_(t.path);let n;if(r!=null)r.sublayer!=null&&i.layer.layerId==null&&(n=r.sublayer),e=r.url.path;else if(i.nonStandardUrlAllowed){const s=fOt(t.path);s!=null&&(e=s.serviceUrl,n=s.sublayerId)}return{url:q9(e),layerId:n}}function gOt(i,e,t,r,n){cR(e,r,"url",n),r.url&&i.layerId!=null&&(r.url=Iu(r.url,t,i.layerId.toString()))}function Qrr(i){if(!i)return!1;const e=i.toLowerCase(),t=e.includes("/services/"),r=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),s=e.includes("/wmsserver");return t&&(r||n||s)}const Xv=i=>{let e=class extends i{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=r_(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",xae(t,di.getLogger(this)))}};return x([D()],e.prototype,"title",null),x([D({type:String})],e.prototype,"url",null),e=x([Qe("esri.layers.mixins.ArcGISService")],e),e};function U2e(){const i=new Float32Array(16);return i[0]=1,i[5]=1,i[10]=1,i[15]=1,i}function enr(i){const e=new Float32Array(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e}function tnr(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w){const S=new Float32Array(16);return S[0]=i,S[1]=e,S[2]=t,S[3]=r,S[4]=n,S[5]=s,S[6]=o,S[7]=a,S[8]=l,S[9]=u,S[10]=c,S[11]=h,S[12]=p,S[13]=m,S[14]=v,S[15]=w,S}function inr(i,e){return new Float32Array(i,e,16)}const rnr=U2e();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:rnr,clone:enr,create:U2e,createView:inr,fromValues:tnr},Symbol.toStringTag,{value:"Module"}));function nnr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function Yk(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i[4]=s,i[5]=o,i[6]=a,i[7]=l,i[8]=u,i[9]=c,i[10]=h,i[11]=p,i[12]=m,i[13]=v,i[14]=w,i[15]=S,i}function Sae(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function BR(i,e){if(i===e){const t=e[1],r=e[2],n=e[3],s=e[6],o=e[7],a=e[11];i[1]=e[4],i[2]=e[8],i[3]=e[12],i[4]=t,i[6]=e[9],i[7]=e[13],i[8]=r,i[9]=s,i[11]=e[14],i[12]=n,i[13]=o,i[14]=a}else i[0]=e[0],i[1]=e[4],i[2]=e[8],i[3]=e[12],i[4]=e[1],i[5]=e[5],i[6]=e[9],i[7]=e[13],i[8]=e[2],i[9]=e[6],i[10]=e[10],i[11]=e[14],i[12]=e[3],i[13]=e[7],i[14]=e[11],i[15]=e[15];return i}function snr(i,e){return AY(i,e)||Sae(i),i}function AY(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],S=e[14],I=e[15],R=t*a-r*o,L=t*l-n*o,k=t*u-s*o,B=r*l-n*a,$=r*u-s*a,V=n*u-s*l,Y=c*w-h*v,K=c*S-p*v,Q=c*I-m*v,re=h*S-p*w,ne=h*I-m*w,de=p*I-m*S;let pe=R*de-L*ne+k*re+B*Q-$*K+V*Y;return pe?(pe=1/pe,i[0]=(a*de-l*ne+u*re)*pe,i[1]=(n*ne-r*de-s*re)*pe,i[2]=(w*V-S*$+I*B)*pe,i[3]=(p*$-h*V-m*B)*pe,i[4]=(l*Q-o*de-u*K)*pe,i[5]=(t*de-n*Q+s*K)*pe,i[6]=(S*k-v*V-I*L)*pe,i[7]=(c*V-p*k+m*L)*pe,i[8]=(o*ne-a*Q+u*Y)*pe,i[9]=(r*Q-t*ne-s*Y)*pe,i[10]=(v*$-w*k+I*R)*pe,i[11]=(h*k-c*$-m*R)*pe,i[12]=(a*K-o*re-l*Y)*pe,i[13]=(t*re-r*K+n*Y)*pe,i[14]=(w*L-v*B-S*R)*pe,i[15]=(c*B-h*L+p*R)*pe,i):null}function onr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],m=e[11],v=e[12],w=e[13],S=e[14],I=e[15];return i[0]=a*(p*I-m*S)-h*(l*I-u*S)+w*(l*m-u*p),i[1]=-(r*(p*I-m*S)-h*(n*I-s*S)+w*(n*m-s*p)),i[2]=r*(l*I-u*S)-a*(n*I-s*S)+w*(n*u-s*l),i[3]=-(r*(l*m-u*p)-a*(n*m-s*p)+h*(n*u-s*l)),i[4]=-(o*(p*I-m*S)-c*(l*I-u*S)+v*(l*m-u*p)),i[5]=t*(p*I-m*S)-c*(n*I-s*S)+v*(n*m-s*p),i[6]=-(t*(l*I-u*S)-o*(n*I-s*S)+v*(n*u-s*l)),i[7]=t*(l*m-u*p)-o*(n*m-s*p)+c*(n*u-s*l),i[8]=o*(h*I-m*w)-c*(a*I-u*w)+v*(a*m-u*h),i[9]=-(t*(h*I-m*w)-c*(r*I-s*w)+v*(r*m-s*h)),i[10]=t*(a*I-u*w)-o*(r*I-s*w)+v*(r*u-s*a),i[11]=-(t*(a*m-u*h)-o*(r*m-s*h)+c*(r*u-s*a)),i[12]=-(o*(h*S-p*w)-c*(a*S-l*w)+v*(a*p-l*h)),i[13]=t*(h*S-p*w)-c*(r*S-n*w)+v*(r*p-n*h),i[14]=-(t*(a*S-l*w)-o*(r*S-n*w)+v*(r*l-n*a)),i[15]=t*(a*p-l*h)-o*(r*p-n*h)+c*(r*l-n*a),i}function anr(i){const e=i[0],t=i[1],r=i[2],n=i[3],s=i[4],o=i[5],a=i[6],l=i[7],u=i[8],c=i[9],h=i[10],p=i[11],m=i[12],v=i[13],w=i[14],S=i[15];return(e*o-t*s)*(h*S-p*w)-(e*a-r*s)*(c*S-p*v)+(e*l-n*s)*(c*w-h*v)+(t*a-r*o)*(u*S-p*m)-(t*l-n*o)*(u*w-h*m)+(r*l-n*a)*(u*v-c*m)}function MY(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],m=e[10],v=e[11],w=e[12],S=e[13],I=e[14],R=e[15];let L=t[0],k=t[1],B=t[2],$=t[3];return i[0]=L*r+k*a+B*h+$*w,i[1]=L*n+k*l+B*p+$*S,i[2]=L*s+k*u+B*m+$*I,i[3]=L*o+k*c+B*v+$*R,L=t[4],k=t[5],B=t[6],$=t[7],i[4]=L*r+k*a+B*h+$*w,i[5]=L*n+k*l+B*p+$*S,i[6]=L*s+k*u+B*m+$*I,i[7]=L*o+k*c+B*v+$*R,L=t[8],k=t[9],B=t[10],$=t[11],i[8]=L*r+k*a+B*h+$*w,i[9]=L*n+k*l+B*p+$*S,i[10]=L*s+k*u+B*m+$*I,i[11]=L*o+k*c+B*v+$*R,L=t[12],k=t[13],B=t[14],$=t[15],i[12]=L*r+k*a+B*h+$*w,i[13]=L*n+k*l+B*p+$*S,i[14]=L*s+k*u+B*m+$*I,i[15]=L*o+k*c+B*v+$*R,i}function $ne(i,e,t){const r=t[0],n=t[1],s=t[2];if(e===i)i[12]=e[0]*r+e[4]*n+e[8]*s+e[12],i[13]=e[1]*r+e[5]*n+e[9]*s+e[13],i[14]=e[2]*r+e[6]*n+e[10]*s+e[14],i[15]=e[3]*r+e[7]*n+e[11]*s+e[15];else{const o=e[0],a=e[1],l=e[2],u=e[3],c=e[4],h=e[5],p=e[6],m=e[7],v=e[8],w=e[9],S=e[10],I=e[11];i[0]=o,i[1]=a,i[2]=l,i[3]=u,i[4]=c,i[5]=h,i[6]=p,i[7]=m,i[8]=v,i[9]=w,i[10]=S,i[11]=I,i[12]=o*r+c*n+v*s+e[12],i[13]=a*r+h*n+w*s+e[13],i[14]=l*r+p*n+S*s+e[14],i[15]=u*r+m*n+I*s+e[15]}return i}function OY(i,e,t){const r=t[0],n=t[1],s=t[2];return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3]*r,i[4]=e[4]*n,i[5]=e[5]*n,i[6]=e[6]*n,i[7]=e[7]*n,i[8]=e[8]*s,i[9]=e[9]*s,i[10]=e[10]*s,i[11]=e[11]*s,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function yOt(i,e,t,r){let n,s,o,a,l,u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne=r[0],de=r[1],pe=r[2],H=Math.sqrt(ne*ne+de*de+pe*pe);return H0?(t[0]=2*(a*o+c*r+l*s-u*n)/h,t[1]=2*(l*o+c*n+u*r-a*s)/h,t[2]=2*(u*o+c*s+a*n-l*r)/h):(t[0]=2*(a*o+c*r+l*s-u*n),t[1]=2*(l*o+c*n+u*r-a*s),t[2]=2*(u*o+c*s+a*n-l*r)),bOt(i,e,t),i}const mnr=gr();function EVe(i,e){return i[0]=e[12],i[1]=e[13],i[2]=e[14],i}function IVe(i,e){const t=e[0],r=e[1],n=e[2],s=e[4],o=e[5],a=e[6],l=e[8],u=e[9],c=e[10];return i[0]=Math.sqrt(t*t+r*r+n*n),i[1]=Math.sqrt(s*s+o*o+a*a),i[2]=Math.sqrt(l*l+u*u+c*c),i}function wOt(i,e){const t=e[0]+e[5]+e[10];let r=0;return t>0?(r=2*Math.sqrt(t+1),i[3]=.25*r,i[0]=(e[6]-e[9])/r,i[1]=(e[8]-e[2])/r,i[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),i[3]=(e[6]-e[9])/r,i[0]=.25*r,i[1]=(e[1]+e[4])/r,i[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),i[3]=(e[8]-e[2])/r,i[0]=(e[1]+e[4])/r,i[1]=.25*r,i[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),i[3]=(e[1]-e[4])/r,i[0]=(e[8]+e[2])/r,i[1]=(e[6]+e[9])/r,i[2]=.25*r),i}function xOt(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3],l=n+n,u=s+s,c=o+o,h=n*l,p=n*u,m=n*c,v=s*u,w=s*c,S=o*c,I=a*l,R=a*u,L=a*c,k=r[0],B=r[1],$=r[2];return i[0]=(1-(v+S))*k,i[1]=(p+L)*k,i[2]=(m-R)*k,i[3]=0,i[4]=(p-L)*B,i[5]=(1-(h+S))*B,i[6]=(w+I)*B,i[7]=0,i[8]=(m+R)*$,i[9]=(w-I)*$,i[10]=(1-(h+v))*$,i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i}function AVe(i,e,t,r,n){const s=e[0],o=e[1],a=e[2],l=e[3],u=s+s,c=o+o,h=a+a,p=s*u,m=s*c,v=s*h,w=o*c,S=o*h,I=a*h,R=l*u,L=l*c,k=l*h,B=r[0],$=r[1],V=r[2],Y=n[0],K=n[1],Q=n[2],re=(1-(w+I))*B,ne=(m+k)*B,de=(v-L)*B,pe=(m-k)*$,H=(1-(p+I))*$,Z=(S+R)*$,ae=(v+L)*V,fe=(S-R)*V,be=(1-(p+w))*V;return i[0]=re,i[1]=ne,i[2]=de,i[3]=0,i[4]=pe,i[5]=H,i[6]=Z,i[7]=0,i[8]=ae,i[9]=fe,i[10]=be,i[11]=0,i[12]=t[0]+Y-(re*Y+pe*K+ae*Q),i[13]=t[1]+K-(ne*Y+H*K+fe*Q),i[14]=t[2]+Q-(de*Y+Z*K+be*Q),i[15]=1,i}function gnr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=t+t,a=r+r,l=n+n,u=t*o,c=r*o,h=r*a,p=n*o,m=n*a,v=n*l,w=s*o,S=s*a,I=s*l;return i[0]=1-h-v,i[1]=c+I,i[2]=p-S,i[3]=0,i[4]=c-I,i[5]=1-u-v,i[6]=m+w,i[7]=0,i[8]=p+S,i[9]=m-w,i[10]=1-u-h,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function ynr(i,e,t,r,n,s,o){const a=1/(t-e),l=1/(n-r),u=1/(s-o);return i[0]=2*s*a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=2*s*l,i[6]=0,i[7]=0,i[8]=(t+e)*a,i[9]=(n+r)*l,i[10]=(o+s)*u,i[11]=-1,i[12]=0,i[13]=0,i[14]=o*s*2*u,i[15]=0,i}function vnr(i,e,t,r,n){const s=1/Math.tan(e/2);let o;return i[0]=s/t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,n!=null&&n!==1/0?(o=1/(r-n),i[10]=(n+r)*o,i[14]=2*n*r*o):(i[10]=-1,i[14]=-2*r),i}function _nr(i,e,t,r){const n=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+a),u=2/(n+s);return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=-(o-a)*l*.5,i[9]=(n-s)*u*.5,i[10]=r/(t-r),i[11]=-1,i[12]=0,i[13]=0,i[14]=r*t/(t-r),i[15]=0,i}function bnr(i,e,t,r,n,s,o){const a=1/(e-t),l=1/(r-n),u=1/(s-o);return i[0]=-2*a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*l,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*u,i[11]=0,i[12]=(e+t)*a,i[13]=(n+r)*l,i[14]=(o+s)*u,i[15]=1,i}function wnr(i,e,t,r){const n=e[0],s=e[1],o=e[2];let a=n-t[0],l=s-t[1],u=o-t[2];const c=c_();if(Math.abs(a)0&&(m=1/Math.sqrt(m),c*=m,h*=m,p*=m);let v=l*p-u*h,w=u*c-a*p,S=a*h-l*c;return m=v*v+w*w+S*S,m>0&&(m=1/Math.sqrt(m),v*=m,w*=m,S*=m),i[0]=v,i[1]=w,i[2]=S,i[3]=0,i[4]=h*S-p*w,i[5]=p*v-c*S,i[6]=c*w-h*v,i[7]=0,i[8]=c,i[9]=h,i[10]=p,i[11]=0,i[12]=n,i[13]=s,i[14]=o,i[15]=1,i}function Snr(i){return"mat4("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+", "+i[4]+", "+i[5]+", "+i[6]+", "+i[7]+", "+i[8]+", "+i[9]+", "+i[10]+", "+i[11]+", "+i[12]+", "+i[13]+", "+i[14]+", "+i[15]+")"}function Tnr(i){return Math.sqrt(i[0]**2+i[1]**2+i[2]**2+i[3]**2+i[4]**2+i[5]**2+i[6]**2+i[7]**2+i[8]**2+i[9]**2+i[10]**2+i[11]**2+i[12]**2+i[13]**2+i[14]**2+i[15]**2)}function Cnr(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i}function SOt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i}function Enr(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i}function Inr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i[4]=e[4]+t[4]*r,i[5]=e[5]+t[5]*r,i[6]=e[6]+t[6]*r,i[7]=e[7]+t[7]*r,i[8]=e[8]+t[8]*r,i[9]=e[9]+t[9]*r,i[10]=e[10]+t[10]*r,i[11]=e[11]+t[11]*r,i[12]=e[12]+t[12]*r,i[13]=e[13]+t[13]*r,i[14]=e[14]+t[14]*r,i[15]=e[15]+t[15]*r,i}function TOt(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]&&i[6]===e[6]&&i[7]===e[7]&&i[8]===e[8]&&i[9]===e[9]&&i[10]===e[10]&&i[11]===e[11]&&i[12]===e[12]&&i[13]===e[13]&&i[14]===e[14]&&i[15]===e[15]}function COt(i,e){if(i===e)return!0;const t=i[0],r=i[1],n=i[2],s=i[3],o=i[4],a=i[5],l=i[6],u=i[7],c=i[8],h=i[9],p=i[10],m=i[11],v=i[12],w=i[13],S=i[14],I=i[15],R=e[0],L=e[1],k=e[2],B=e[3],$=e[4],V=e[5],Y=e[6],K=e[7],Q=e[8],re=e[9],ne=e[10],de=e[11],pe=e[12],H=e[13],Z=e[14],ae=e[15],fe=c_();return Math.abs(t-R)<=fe*Math.max(1,Math.abs(t),Math.abs(R))&&Math.abs(r-L)<=fe*Math.max(1,Math.abs(r),Math.abs(L))&&Math.abs(n-k)<=fe*Math.max(1,Math.abs(n),Math.abs(k))&&Math.abs(s-B)<=fe*Math.max(1,Math.abs(s),Math.abs(B))&&Math.abs(o-$)<=fe*Math.max(1,Math.abs(o),Math.abs($))&&Math.abs(a-V)<=fe*Math.max(1,Math.abs(a),Math.abs(V))&&Math.abs(l-Y)<=fe*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(u-K)<=fe*Math.max(1,Math.abs(u),Math.abs(K))&&Math.abs(c-Q)<=fe*Math.max(1,Math.abs(c),Math.abs(Q))&&Math.abs(h-re)<=fe*Math.max(1,Math.abs(h),Math.abs(re))&&Math.abs(p-ne)<=fe*Math.max(1,Math.abs(p),Math.abs(ne))&&Math.abs(m-de)<=fe*Math.max(1,Math.abs(m),Math.abs(de))&&Math.abs(v-pe)<=fe*Math.max(1,Math.abs(v),Math.abs(pe))&&Math.abs(w-H)<=fe*Math.max(1,Math.abs(w),Math.abs(H))&&Math.abs(S-Z)<=fe*Math.max(1,Math.abs(S),Math.abs(Z))&&Math.abs(I-ae)<=fe*Math.max(1,Math.abs(I),Math.abs(ae))}function MVe(i){const e=c_(),t=i[0],r=i[1],n=i[2],s=i[4],o=i[5],a=i[6],l=i[8],u=i[9],c=i[10];return Math.abs(1-(t*t+s*s+l*l))<=e&&Math.abs(1-(r*r+o*o+u*u))<=e&&Math.abs(1-(n*n+a*a+c*c))<=e}function OVe(i){return i[0]===1&&i[1]===0&&i[2]===0&&i[4]===0&&i[5]===1&&i[6]===0&&i[8]===0&&i[9]===0&&i[10]===1}const Anr=MY,Mnr=SOt;Object.freeze(Object.defineProperty({__proto__:null,add:Cnr,adjoint:onr,copy:nnr,determinant:anr,equals:COt,exactEquals:TOt,frob:Tnr,fromQuat:gnr,fromQuat2:fnr,fromRotation:CVe,fromRotationTranslation:bOt,fromRotationTranslationScale:xOt,fromRotationTranslationScaleOrigin:AVe,fromScaling:hnr,fromTranslation:vOt,fromXRotation:_Ot,fromYRotation:dnr,fromZRotation:pnr,frustum:ynr,getRotation:wOt,getScaling:IVe,getTranslation:EVe,hasIdentityRotation:OVe,identity:Sae,invert:AY,invertOrIdentity:snr,isOrthoNormal:MVe,lookAt:wnr,mul:Anr,multiply:MY,multiplyScalar:Enr,multiplyScalarAndAdd:Inr,ortho:bnr,perspective:vnr,perspectiveFromFieldOfView:_nr,rotate:yOt,rotateX:lnr,rotateY:unr,rotateZ:cnr,scale:OY,set:Yk,str:Snr,sub:Mnr,subtract:SOt,targetTo:xnr,translate:$ne,transpose:BR},Symbol.toStringTag,{value:"Module"}));const Onr=(i,e)=>{const t=Yk(i,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return BR(t,t)},Pnr=(i,e)=>{const t=Yk(i,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return BR(t,t)},Rnr=(i,e)=>{const t=1-e,r=Yk(i,.2126+.7874*t,.7152-.7152*t,.0722-.0722*t,0,.2126-.2126*t,.7152+.2848*t,.0722-.0722*t,0,.2126-.2126*t,.7152-.7152*t,.0722+.9278*t,0,0,0,0,1);return BR(r,r)},Dnr=(i,e)=>{const t=Math.sin(e*Math.PI/180),r=Math.cos(e*Math.PI/180),n=Yk(i,.213+.787*r-.213*t,.715-.715*r-.715*t,.072-.072*r+.928*t,0,.213-.213*r+.143*t,.715+.285*r+.14*t,.072-.072*r-.283*t,0,.213-.213*r-.787*t,.715-.715*r+.715*t,.072+.928*r+.072*t,0,0,0,0,1);return BR(n,n)},Fnr=(i,e)=>{const t=1-2*e,r=Yk(i,t,0,0,e,0,t,0,e,0,0,t,e,0,0,0,1);return BR(r,r)},knr=(i,e)=>{const t=Yk(i,.213+.787*e,.715-.715*e,.072-.072*e,0,.213-.213*e,.715+.285*e,.072-.072*e,0,.213-.213*e,.715-.715*e,.072+.928*e,0,0,0,0,1);return BR(t,t)},Lnr=(i,e)=>{const t=1-e,r=Yk(i,.393+.607*t,.769-.769*t,.189-.189*t,0,.349-.349*t,.686+.314*t,.168-.168*t,0,.272-.272*t,.534-.534*t,.131+.869*t,0,0,0,0,1);return BR(r,r)};let EOt=class IOt{constructor(e,t,r){this.strength=e,this.radius=t,this.threshold=r,this.type="bloom"}interpolate(e,t,r){this.strength=ab(e.strength,t.strength,r),this.radius=ab(e.radius,t.radius,r),this.threshold=ab(e.threshold,t.threshold,r)}clone(){return new IOt(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:Mie(this.radius),strength:this.strength,threshold:this.threshold}}},AOt=class MOt{constructor(e){this.radius=e,this.type="blur"}interpolate(e,t,r){this.radius=Math.round(ab(e.radius,t.radius,r))}clone(){return new MOt(this.radius)}toJSON(){return{type:"blur",radius:Mie(this.radius)}}},Wke=class OOt{constructor(e,t){this.type=e,this.amount=t,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,t,r){this.amount=ab(e.amount,t.amount,r),this._updateMatrix()}clone(){return new OOt(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||U2e();switch(this.type){case"brightness":this._colorMatrix=Onr(e,this.amount);break;case"contrast":this._colorMatrix=Pnr(e,this.amount);break;case"grayscale":this._colorMatrix=Rnr(e,this.amount);break;case"invert":this._colorMatrix=Fnr(e,this.amount);break;case"saturate":this._colorMatrix=knr(e,this.amount);break;case"sepia":this._colorMatrix=Lnr(e,this.amount)}}},POt=class ROt{constructor(e,t,r,n){this.offsetX=e,this.offsetY=t,this.blurRadius=r,this.color=n,this.type="drop-shadow"}interpolate(e,t,r){this.offsetX=ab(e.offsetX,t.offsetX,r),this.offsetY=ab(e.offsetY,t.offsetY,r),this.blurRadius=ab(e.blurRadius,t.blurRadius,r),this.color[0]=Math.round(ab(e.color[0],t.color[0],r)),this.color[1]=Math.round(ab(e.color[1],t.color[1],r)),this.color[2]=Math.round(ab(e.color[2],t.color[2],r)),this.color[3]=ab(e.color[3],t.color[3],r)}clone(){return new ROt(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:Mie(this.offsetX),yoffset:Mie(this.offsetY),blurRadius:Mie(this.blurRadius),color:e}}},DOt=class FOt{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,t,r){this.angle=ab(e.angle,t.angle,r),this._updateMatrix()}clone(){return new FOt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||U2e();this._colorMatrix=Dnr(e,this.angle)}},kOt=class LOt{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,t,r){this.amount=ab(e.amount,t.amount,r)}clone(){return new LOt(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function ab(i,e,t){return i+(e-i)*t}function Mie(i){return Math.round(1e3*uy(i))/1e3}function Nnr(i){switch(i.type){case"grayscale":case"sepia":case"invert":return new Wke(i.type,0);case"saturate":case"brightness":case"contrast":return new Wke(i.type,1);case"opacity":return new kOt(1);case"hue-rotate":return new DOt(0);case"blur":return new AOt(0);case"drop-shadow":return new POt(0,0,0,[...Eze("transparent")]);case"bloom":return new EOt(0,0,1)}}var wS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function NOt(i,e){const t=i.length>e.length?i:e;return(i.length>e.length?e:i).every((r,n)=>r.type===t[n].type)}function $Ot(i,e){const t=i.length>e.length?i:e,r=i.length>e.length?e:i;for(let n=r.length;ns?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function r(n,s){var o,a={},l=(s=s!==void 0?s:{}).grammarSource,u={start:Dt},c=Dt,h="none",p=")",m=",",v="(",w="%",S="px",I="cm",R="mm",L="in",k="pt",B="pc",$="deg",V="rad",Y="grad",K="turn",Q="#",re=".",ne="e",de=/^[ \t\n\r]/,pe=/^[a-z\-]/,H=/^[0-9a-fA-F]/,Z=/^[+\-]/,ae=/^[0-9]/,fe=ar("none"),be=Ui("none",!1),_e=Ui(")",!1),Ie=Ui(",",!1),Te=ar("whitespace"),Be=Bi([" "," ",` +`,"\r"],!1,!1),Ve=ar("function"),$e=Ui("(",!1),tt=ar("identifier"),yt=Bi([["a","z"],"-"],!1,!1),Ct=ar("percentage"),ot=Ui("%",!1),vt=ar("length"),At=Ui("px",!1),Je=Ui("cm",!1),it=Ui("mm",!1),Ue=Ui("in",!1),ct=Ui("pt",!1),st=Ui("pc",!1),Ze=ar("angle"),ye=Ui("deg",!1),Ke=Ui("rad",!1),ke=Ui("grad",!1),me=Ui("turn",!1),ie=ar("number"),ge=ar("color"),je=Ui("#",!1),rt=Bi([["0","9"],["a","f"],["A","F"]],!1,!1),Me=Bi(["+","-"],!1,!1),ht=Bi([["0","9"]],!1,!1),Ht=Ui(".",!1),_t=Ui("e",!1),Fe=function(){return[]},Yt=function(gi,lr){return{type:"function",name:gi,parameters:lr||[]}},A=function(gi,lr){return lr.length>0?la(gi,lr,3):[gi]},ue=function(gi){return{type:"quantity",value:gi.value,unit:gi.unit}},G=function(gi){return{type:"color",colorType:gi.type,value:gi.value}},E=function(gi){return gi},_=function(){return Ri()},g=function(gi){return{value:gi,unit:"%"}},b=function(gi){return{value:gi,unit:"px"}},C=function(gi){return{value:gi,unit:"cm"}},O=function(gi){return{value:gi,unit:"mm"}},F=function(gi){return{value:gi,unit:"in"}},N=function(gi){return{value:gi,unit:"pt"}},j=function(gi){return{value:gi,unit:"pc"}},W=function(gi){return{value:gi,unit:"deg"}},q=function(gi){return{value:gi,unit:"rad"}},J=function(gi){return{value:gi,unit:"grad"}},ee=function(gi){return{value:gi,unit:"turn"}},he=function(gi){return{value:gi,unit:null}},Ee=function(){return{type:"hex",value:Ri()}},De=function(gi){return{type:"function",value:gi}},pt=function(){return{type:"named",value:Ri()}},Et=function(){return parseFloat(Ri())},Ye=0,jt=0,ei=[{line:1,column:1}],Xt=0,wi=[],pi=0;if("startRule"in s){if(!(s.startRule in u))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');c=u[s.startRule]}function Ri(){return n.substring(jt,Ye)}function Ui(gi,lr){return{type:"literal",text:gi,ignoreCase:lr}}function Bi(gi,lr,Rr){return{type:"class",parts:gi,inverted:lr,ignoreCase:Rr}}function mi(){return{type:"end"}}function ar(gi){return{type:"other",description:gi}}function z(gi){var lr,Rr=ei[gi];if(Rr)return Rr;for(lr=gi-1;!ei[lr];)lr--;for(Rr={line:(Rr=ei[lr]).line,column:Rr.column};lrXt&&(Xt=Ye,wi=[]),wi.push(gi))}function ds(gi,lr,Rr){return new e(e.buildMessage(gi,lr),gi,lr,Rr)}function Dt(){var gi;return(gi=Mn())===a&&(gi=yn()),gi}function Mn(){var gi,lr;return pi++,gi=Ye,Cn(),n.substr(Ye,4)===h?(lr=h,Ye+=4):(lr=a,pi===0&&Fr(be)),lr!==a?(Cn(),jt=gi,gi=Fe()):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(fe),gi}function yn(){var gi,lr;if(gi=[],(lr=Pt())!==a)for(;lr!==a;)gi.push(lr),lr=Pt();else gi=a;return gi}function Pt(){var gi,lr,Rr,Os;return gi=Ye,Cn(),(lr=bs())!==a?(Cn(),(Rr=Un())===a&&(Rr=null),Cn(),n.charCodeAt(Ye)===41?(Os=p,Ye++):(Os=a,pi===0&&Fr(_e)),Os!==a?(Cn(),jt=gi,gi=Yt(lr,Rr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi}function Un(){var gi,lr,Rr,Os,Js,vs,na,gl;if(gi=Ye,(lr=Qi())!==a){for(Rr=[],Os=Ye,Js=Cn(),n.charCodeAt(Ye)===44?(vs=m,Ye++):(vs=a,pi===0&&Fr(Ie)),vs===a&&(vs=null),na=Cn(),(gl=Qi())!==a?Os=Js=[Js,vs,na,gl]:(Ye=Os,Os=a);Os!==a;)Rr.push(Os),Os=Ye,Js=Cn(),n.charCodeAt(Ye)===44?(vs=m,Ye++):(vs=a,pi===0&&Fr(Ie)),vs===a&&(vs=null),na=Cn(),(gl=Qi())!==a?Os=Js=[Js,vs,na,gl]:(Ye=Os,Os=a);jt=gi,gi=A(lr,Rr)}else Ye=gi,gi=a;return gi}function Qi(){var gi,lr;return gi=Ye,(lr=ko())===a&&(lr=ai())===a&&(lr=Al())===a&&(lr=eu()),lr!==a&&(jt=gi,lr=ue(lr)),(gi=lr)===a&&(gi=Ye,(lr=Ma())!==a&&(jt=gi,lr=G(lr)),gi=lr),gi}function Cn(){var gi,lr;for(pi++,gi=[],de.test(n.charAt(Ye))?(lr=n.charAt(Ye),Ye++):(lr=a,pi===0&&Fr(Be));lr!==a;)gi.push(lr),de.test(n.charAt(Ye))?(lr=n.charAt(Ye),Ye++):(lr=a,pi===0&&Fr(Be));return pi--,lr=a,pi===0&&Fr(Te),gi}function bs(){var gi,lr,Rr;return pi++,gi=Ye,(lr=qn())!==a?(n.charCodeAt(Ye)===40?(Rr=v,Ye++):(Rr=a,pi===0&&Fr($e)),Rr!==a?(jt=gi,gi=E(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),pi--,gi===a&&(lr=a,pi===0&&Fr(Ve)),gi}function qn(){var gi,lr,Rr;if(pi++,gi=Ye,lr=[],pe.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(yt)),Rr!==a)for(;Rr!==a;)lr.push(Rr),pe.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(yt));else lr=a;return lr!==a&&(jt=gi,lr=_()),pi--,(gi=lr)===a&&(lr=a,pi===0&&Fr(tt)),gi}function ko(){var gi,lr,Rr;return pi++,gi=Ye,Cn(),(lr=_n())!==a?(n.charCodeAt(Ye)===37?(Rr=w,Ye++):(Rr=a,pi===0&&Fr(ot)),Rr!==a?(jt=gi,gi=g(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(Ct),gi}function ai(){var gi,lr,Rr;return pi++,gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===S?(Rr=S,Ye+=2):(Rr=a,pi===0&&Fr(At)),Rr!==a?(jt=gi,gi=b(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===I?(Rr=I,Ye+=2):(Rr=a,pi===0&&Fr(Je)),Rr!==a?(jt=gi,gi=C(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===R?(Rr=R,Ye+=2):(Rr=a,pi===0&&Fr(it)),Rr!==a?(jt=gi,gi=O(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===L?(Rr=L,Ye+=2):(Rr=a,pi===0&&Fr(Ue)),Rr!==a?(jt=gi,gi=F(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===k?(Rr=k,Ye+=2):(Rr=a,pi===0&&Fr(ct)),Rr!==a?(jt=gi,gi=N(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,Cn(),(lr=_n())!==a?(n.substr(Ye,2)===B?(Rr=B,Ye+=2):(Rr=a,pi===0&&Fr(st)),Rr!==a?(jt=gi,gi=j(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a)))))),pi--,gi===a&&pi===0&&Fr(vt),gi}function Al(){var gi,lr,Rr;return pi++,gi=Ye,(lr=_n())!==a?(n.substr(Ye,3)===$?(Rr=$,Ye+=3):(Rr=a,pi===0&&Fr(ye)),Rr!==a?(jt=gi,gi=W(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,3)===V?(Rr=V,Ye+=3):(Rr=a,pi===0&&Fr(Ke)),Rr!==a?(jt=gi,gi=q(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,4)===Y?(Rr=Y,Ye+=4):(Rr=a,pi===0&&Fr(ke)),Rr!==a?(jt=gi,gi=J(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a),gi===a&&(gi=Ye,(lr=_n())!==a?(n.substr(Ye,4)===K?(Rr=K,Ye+=4):(Rr=a,pi===0&&Fr(me)),Rr!==a?(jt=gi,gi=ee(lr)):(Ye=gi,gi=a)):(Ye=gi,gi=a)))),pi--,gi===a&&(lr=a,pi===0&&Fr(Ze)),gi}function eu(){var gi,lr;return pi++,gi=Ye,Cn(),(lr=_n())!==a?(jt=gi,gi=he(lr)):(Ye=gi,gi=a),pi--,gi===a&&pi===0&&Fr(ie),gi}function Ma(){var gi,lr,Rr,Os;if(pi++,gi=Ye,n.charCodeAt(Ye)===35?(lr=Q,Ye++):(lr=a,pi===0&&Fr(je)),lr!==a){if(Rr=[],H.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(rt)),Os!==a)for(;Os!==a;)Rr.push(Os),H.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(rt));else Rr=a;Rr!==a?(jt=gi,gi=Ee()):(Ye=gi,gi=a)}else Ye=gi,gi=a;return gi===a&&(gi=Ye,(lr=Pt())!==a&&(jt=gi,lr=De(lr)),(gi=lr)===a&&(gi=Ye,(lr=qn())!==a&&(jt=gi,lr=pt()),gi=lr)),pi--,gi===a&&(lr=a,pi===0&&Fr(ge)),gi}function _n(){var gi,lr,Rr,Os,Js,vs,na;for(gi=Ye,Z.test(n.charAt(Ye))?(n.charAt(Ye),Ye++):pi===0&&Fr(Me),lr=Ye,Rr=[],ae.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(ht));Os!==a;)Rr.push(Os),ae.test(n.charAt(Ye))?(Os=n.charAt(Ye),Ye++):(Os=a,pi===0&&Fr(ht));if(n.charCodeAt(Ye)===46?(Os=re,Ye++):(Os=a,pi===0&&Fr(Ht)),Os!==a){if(Js=[],ae.test(n.charAt(Ye))?(vs=n.charAt(Ye),Ye++):(vs=a,pi===0&&Fr(ht)),vs!==a)for(;vs!==a;)Js.push(vs),ae.test(n.charAt(Ye))?(vs=n.charAt(Ye),Ye++):(vs=a,pi===0&&Fr(ht));else Js=a;Js!==a?lr=Rr=[Rr,Os,Js]:(Ye=lr,lr=a)}else Ye=lr,lr=a;if(lr===a)if(lr=[],ae.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(ht)),Rr!==a)for(;Rr!==a;)lr.push(Rr),ae.test(n.charAt(Ye))?(Rr=n.charAt(Ye),Ye++):(Rr=a,pi===0&&Fr(ht));else lr=a;if(lr!==a){if(Rr=Ye,n.charCodeAt(Ye)===101?(Os=ne,Ye++):(Os=a,pi===0&&Fr(_t)),Os!==a){if(Z.test(n.charAt(Ye))?(Js=n.charAt(Ye),Ye++):(Js=a,pi===0&&Fr(Me)),Js===a&&(Js=null),vs=[],ae.test(n.charAt(Ye))?(na=n.charAt(Ye),Ye++):(na=a,pi===0&&Fr(ht)),na!==a)for(;na!==a;)vs.push(na),ae.test(n.charAt(Ye))?(na=n.charAt(Ye),Ye++):(na=a,pi===0&&Fr(ht));else vs=a;vs!==a?Rr=Os=[Os,Js,vs]:(Ye=Rr,Rr=a)}else Ye=Rr,Rr=a;Rr===a&&(Rr=null),jt=gi,gi=Et()}else Ye=gi,gi=a;return gi}function Ss(gi,lr){return gi.map(function(Rr){return Rr[lr]})}function la(gi,lr,Rr){return[gi].concat(Ss(lr,Rr))}if((o=c())!==a&&Ye===n.length)return o;throw o!==a&&Ye `+c+` `+p+` | `+u.line+" | "+m+` `+p+" | "+t("",l.column-1," ")+t("",v,"^")}else s+=` - at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(m){return'"'+l(m.text)+'"'},class:function(m){var v=m.parts.map(function(w){return Array.isArray(w)?u(w[0])+"-"+u(w[1]):u(w)});return"["+(m.inverted?"^":"")+v.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function a(m){return m.charCodeAt(0).toString(16).toUpperCase()}function l(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function u(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function c(m){return o[m.type](m)}function h(m){var v,w,S=m.map(c);if(S.sort(),S.length>0){for(v=1,w=1;v{if(!Number.isFinite(t.scale)||t.scale<=0)throw new qe("effect:invalid-scale","scale must be finite and greater than 0",{stop:t});return{scale:t.scale,effects:Ist(t.value)}});e.sort((t,r)=>r.effects.length-t.effects.length);for(let t=0;tr.scale-t.scale),e}function Ist(i){let e;if(!i)return[];try{e=Unr.parse(i)}catch(t){throw new qe("effect:invalid-syntax","Invalid effect syntax",{value:i,error:t})}return e.map(t=>znr(t))}function znr(i){try{switch(i.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return Vnr(i);case"opacity":return Hnr(i);case"hue-rotate":return Wnr(i);case"blur":return qnr(i);case"drop-shadow":return Ynr(i);case"bloom":return Xnr(i)}}catch(e){throw e.details.filter=i,e}throw new qe("effect:unknown-effect",`Effect '${i.name}' is not supported`,{effect:i})}function Vnr(i){let e=1;return PY(i.parameters,1),i.parameters.length===1&&(e=mC(i.parameters[0])),new Wke(i.name,e)}function Hnr(i){let e=1;return PY(i.parameters,1),i.parameters.length===1&&(e=mC(i.parameters[0])),new kOt(e)}function Wnr(i){let e=0;return PY(i.parameters,1),i.parameters.length===1&&(e=tsr(i.parameters[0])),new DOt(e)}function qnr(i){let e=0;return PY(i.parameters,1),i.parameters.length===1&&(e=FVe(i.parameters[0]),Tae(e,i.parameters[0])),new AOt(e)}function Ynr(i){const e=[];let t=null;for(const r of i.parameters)if(r.type==="color"){if(e.length&&Object.freeze(e),t)throw new qe("effect:type-error","Accepts only one color",{});t=isr(r)}else{const n=FVe(r);if(Object.isFrozen(e))throw new qe("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&Tae(n,r)}if(e.length<2||e.length>3)throw new qe("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new POt(e[0],e[1],e[2]||0,t||jOt("black"))}function Xnr(i){let e=1,t=0,r=0;return PY(i.parameters,3),i.parameters[0]&&(e=mC(i.parameters[0])),i.parameters[1]&&(t=FVe(i.parameters[1]),Tae(t,i.parameters[1])),i.parameters[2]&&(r=mC(i.parameters[2])),new EOt(e,t,r)}function PY(i,e){if(i.length>e)throw new qe("effect:type-error",`Function supports up to ${e} parameters, Actual: ${i.length}`,{parameters:i})}function z2e(i){if(i.type==="color")return"";if(i.unit){if(i.unit in DVe)return"";if(i.unit in RVe)return"";if(i.unit==="%")return""}return""}function Tae(i,e){if(i<0)throw new qe("effect:type-error",`Negative values are not allowed, Actual: ${i}`,{term:e})}function Jnr(i){if(i.type!=="quantity"||i.unit!==null)throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}function Knr(i){if(i.type!=="quantity"||i.unit!==null&&i.unit!=="%")throw new qe("effect:type-error",`Expected or , Actual: ${z2e(i)}`,{term:i})}const RVe={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Znr(i){if(i.type!=="quantity"||!(i.value===0&&i.unit===null||i.unit&&RVe[i.unit]!=null))throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}const DVe={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function Qnr(i){if(i.type!=="quantity"||!(i.value===0&&i.unit===null||i.unit&&DVe[i.unit]!=null))throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}function mC(i){Knr(i);const e=i.value;return Tae(e,i),i.unit==="%"?.01*e:e}function esr(i){return Jnr(i),Tae(i.value,i),i.value}function tsr(i){return Znr(i),i.value*RVe[i.unit]||0}function FVe(i){return Qnr(i),i.value*DVe[i.unit]||0}function isr(i){switch(i.colorType){case"hex":return ZYi(i.value);case"named":return jOt(i.value);case"function":return ssr(i.value)}}function jOt(i){if(!UEt(i))throw new qe("effect:unknown-color",`color '${i}' isn't valid`,{namedColor:i});return KYi(i)}const rsr=/^rgba?/i,nsr=/^hsla?/i;function ssr(i){if(PY(i.parameters,4),rsr.test(i.name))return[mC(i.parameters[0]),mC(i.parameters[1]),mC(i.parameters[2]),i.parameters[3]?mC(i.parameters[3]):1];if(nsr.test(i.name))return zEt(esr(i.parameters[0]),mC(i.parameters[1]),mC(i.parameters[2]),i.parameters[3]?mC(i.parameters[3]):1);throw new qe("effect:syntax-error",`Invalid color function '${i.name}'`,{colorFunction:i})}function kVe(i,e,t){try{return asr(i)}catch(r){t?.messages?.push(r)}return null}function LVe(i,e,t,r){try{const n=osr(i);Qp(t,n,e)}catch(n){r.messages&&r.messages.push(n)}}function osr(i){const e=PVe(i);return e?Gnr(e)?e.map(t=>t.toJSON()):e.map(({scale:t,effects:r})=>({scale:t,value:r.map(n=>n.toJSON())})):null}function asr(i){if(!i||i.length===0)return null;if(lsr(i)){const e=[];for(const t of i)e.push({scale:t.scale,value:Ast(t.value)});return e}return Ast(i)}function lsr(i){const e=i[0];return!!e&&"scale"in e}function Ast(i){if(!i?.length)return"";const e=[];for(const t of i){let r=[];switch(t.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[vM(t,"amount")];break;case"blur":r=[vM(t,"radius","pt")];break;case"hue-rotate":r=[vM(t,"angle","deg")];break;case"drop-shadow":r=[vM(t,"xoffset","pt"),vM(t,"yoffset","pt"),vM(t,"blurRadius","pt"),usr(t,"color")];break;case"bloom":r=[vM(t,"strength"),vM(t,"radius","pt"),vM(t,"threshold")]}const n=`${t.type}(${r.filter(Boolean).join(" ")})`;PVe(n),e.push(n)}return e.join(" ")}function vM(i,e,t){if(i[e]==null)throw new qe("effect:missing-parameter",`Missing parameter '${e}' in ${i.type} effect`,{effect:i});return t?i[e]+t:""+i[e]}function usr(i,e){if(i[e]==null)throw new qe("effect:missing-parameter",`Missing parameter '${e}' in ${i.type} effect`,{effect:i});const t=i[e];return`rgba(${t[0]||0}, ${t[1]||0}, ${t[2]||0}, ${t[3]/255||0})`}const Mst={read:{reader:kVe},write:{allowNull:!0,writer:LVe}},xh=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return x([D({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],e.prototype,"blendMode",void 0),x([D({json:{read:!1,write:!1,origins:{"web-map":Mst,"portal-item":Mst}}})],e.prototype,"effect",void 0),e=x([Qe("esri.layers.mixins.BlendLayer")],e),e},py=i=>{let e=class extends i{constructor(){super(...arguments),this.customParameters=null}};return x([D({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=x([Qe("esri.layers.mixins.CustomParametersMixin")],e),e},csr="randomUUID"in crypto;function KB(){if(csr)return crypto.randomUUID();const i=crypto.getRandomValues(new Uint16Array(8));i[3]=4095&i[3]|16384,i[4]=16383&i[4]|32768;const e=t=>i[t].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function NVe(){return`{${KB().toUpperCase()}}`}function hsr(){return`{${KB()}}`}const GOt=hsr(),UOt=new Map,zOt=new Map;async function dsr(i,e,t){if(!i||!t)return!1;if(!e)return!0;const r=new URL(i).host;let n=UOt.get(r);if(!n){const s=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await zi(s,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===e}async function psr(i,e,t=!1){if(!i||!e)return!0;const r=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),n=zOt.get(r)?.entries();if(n){for(const[s,o]of n)if(o.name===e){const a=!o.stack?.hasForwardEdits();if(!a&&t){const[{deleteForwardEdits:l},{default:u}]=await Promise.all([Promise.resolve().then(()=>_on),Promise.resolve().then(()=>won)]);return l(r,s,new u({sessionId:GOt,moment:o.moment}))}return a}}return!0}function VOt(i,e){if(!i)return!1;const t=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=zOt.get(t)?.entries();if(r){for(const[n,s]of r)if(s.name===e)return s.lockType==="edit"}return!1}const $Ve=new rd.EventEmitter;function fsr(i){return $Ve.on("apply-edits",new WeakRef(i))}function msr(i){return $Ve.on("update-moment",new WeakRef(i))}function gsr(i,e,t=null,r=!1){const n=ac();return r=e==null||r,$Ve.emit("apply-edits",{serviceUrl:i,layerId:e,gdbVersion:t,mayReceiveServiceEdits:r,result:n.promise}),n}const HOt="esri.layers.mixins.EditBusLayer",WOt=Symbol(HOt);function ysr(i){return i!=null&&typeof i=="object"&&WOt in i}function FJ(i){return i!=null&&typeof i=="object"&&"gdbVersion"in i}function R3e(i,e,t){const r=new URL(i).host,n=UOt.get(r),s=o=>!o||o===n;return s(e)&&s(t)||e===t}const BVe=i=>{var e;let t=class extends i{constructor(...r){super(...r),this[e]=!0,this._applyEditsHandler=n=>{const{serviceUrl:s,layerId:o,gdbVersion:a,mayReceiveServiceEdits:l,result:u}=n,c=s===this.url,h=o!=null&&this.layerId!=null&&o===this.layerId,p=FJ(this),m=FJ(this)&&R3e(s,a,this.gdbVersion);if(!c||p&&!m||!h&&!l)return;const v=u.then(w=>{if(h&&(w.addedFeatures.length||w.updatedFeatures.length||w.deletedFeatures.length||w.addedAttachments.length||w.updatedAttachments.length||w.deletedAttachments.length))return this.emit("edits",li(w)),w;const S=w.editedFeatures?.find(({layerId:I})=>I===this.layerId);if(S){const{adds:I,updates:R,deletes:L}=S.editedFeatures,k={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:I?I.map(({attributes:B})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],deletedFeatures:L?L.map(({attributes:B})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],updatedFeatures:R?R.map(({current:{attributes:B}})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],editedFeatures:li(w.editedFeatures),exceededTransferLimit:!1,historicMoment:li(w.historicMoment)};return this.emit("edits",k),k}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:li(w.editedFeatures),exceededTransferLimit:!1,historicMoment:li(w.historicMoment)}}).then(w=>("historicMoment"in this&&this.historicMoment!==w.historicMoment&&VOt(s,a)&&(this.historicMoment=w.historicMoment),w));this.emit("apply-edits",{result:v})},this._updateMomentHandler=n=>{const{serviceUrl:s,gdbVersion:o,moment:a}=n,l=s===this.url,u=FJ(this),c=FJ(this)&&R3e(s,o,this.gdbVersion),h=FJ(this)&&!R3e(s,this.gdbVersion,null);l&&u&&c&&h&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(fsr(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(msr(this._updateMomentHandler))},()=>{})}};return e=WOt,t=x([Qe(HOt)],t),t},Oie={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function K8(i,e,t,r=RS){const n=new $b(zze(r)),s=Sn.fromJSDate(i,{zone:n}),o=t==="decades"||t==="centuries"?"year":qOt(t);return t==="decades"&&(e*=10),t==="centuries"&&(e*=100),s.plus({[o]:e}).toJSDate()}function Ost(i,e,t=RS){const r=new $b(zze(t)),n=Sn.fromJSDate(i,{zone:r});if(e==="decades"||e==="centuries"){const o=n.startOf("year"),{year:a}=o,l=a-a%(e==="decades"?10:100);return o.set({year:l}).toJSDate()}const s=qOt(e);return n.startOf(s).toJSDate()}function vsr(i,e,t){return i===0?0:i*Oie[e]/Oie[t]}function qOt(i){switch(i){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var BT;let Gw=BT=class extends Ci{static get allTime(){return Pst}static get empty(){return _sr}constructor(i){super(i),this.end=null,this.start=null}readEnd(i,e){return e.end!=null?new Date(e.end):null}writeEnd(i,e){e.end=i?.getTime()??null}get isAllTime(){return this.equals(BT.allTime)}get isEmpty(){return this.equals(BT.empty)}readStart(i,e){return e.start!=null?new Date(e.start):null}writeStart(i,e){e.start=i?.getTime()??null}clone(){return new BT({end:this.end,start:this.start})}equals(i){if(!i)return!1;const e=this.start?.getTime()??this.start,t=this.end?.getTime()??this.end,r=i.start?.getTime()??i.start,n=i.end?.getTime()??i.end;return e===r&&t===n}expandTo(i,e=RS){if(this.isEmpty||this.isAllTime)return this.clone();let t=this.start;t&&(t=Ost(t,i,e));let r=this.end;if(r){const n=Ost(r,i,e);r=r.getTime()===n.getTime()?n:K8(n,1,i,e)}return new BT({start:t,end:r})}intersection(i){if(!i)return this.clone();if(this.isEmpty||i.isEmpty)return BT.empty;if(this.isAllTime)return i.clone();if(i.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,t=this.end?.getTime()??1/0,r=i.start?.getTime()??-1/0,n=i.end?.getTime()??1/0;let s,o;if(r>=e&&r<=t?s=r:e>=r&&e<=n&&(s=e),t>=r&&t<=n?o=t:n>=e&&n<=t&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const a=new BT;return a.start=s===-1/0?null:new Date(s),a.end=o===1/0?null:new Date(o),a}return BT.empty}offset(i,e,t=RS){if(this.isEmpty||this.isAllTime)return this.clone();const r=new BT,{start:n,end:s}=this;return n!=null&&(r.start=K8(n,i,e,t)),s!=null&&(r.end=K8(s,i,e,t)),r}union(i){if(!i||i.isEmpty)return this.clone();if(this.isEmpty)return i.clone();if(this.isAllTime||i.isAllTime)return Pst.clone();const e=this.start!=null&&i.start!=null?new Date(Math.min(this.start.getTime(),i.start.getTime())):null,t=this.end!=null&&i.end!=null?new Date(Math.max(this.end.getTime(),i.end.getTime())):null;return new BT({start:e,end:t})}};x([D({type:Date,json:{write:{allowNull:!0}}})],Gw.prototype,"end",void 0),x([Mi("end")],Gw.prototype,"readEnd",null),x([ur("end")],Gw.prototype,"writeEnd",null),x([D({readOnly:!0,json:{read:!1}})],Gw.prototype,"isAllTime",null),x([D({readOnly:!0,json:{read:!1}})],Gw.prototype,"isEmpty",null),x([D({type:Date,json:{write:{allowNull:!0}}})],Gw.prototype,"start",void 0),x([Mi("start")],Gw.prototype,"readStart",null),x([ur("start")],Gw.prototype,"writeStart",null),Gw=BT=x([Qe("esri.TimeExtent")],Gw);const Pst=new Gw,_sr=new Gw({start:void 0,end:void 0}),Eg=Gw;var qke;let lP=qke=class extends Ci{constructor(i){super(i),this.type="map-layer"}clone(){const{mapLayerId:i,gdbVersion:e}=this;return new qke({mapLayerId:i,gdbVersion:e})}};x([Wr({mapLayer:"map-layer"})],lP.prototype,"type",void 0),x([D({type:ms,json:{write:!0}})],lP.prototype,"mapLayerId",void 0),x([D({type:String,json:{write:!0}})],lP.prototype,"gdbVersion",void 0),lP=qke=x([Qe("esri.layers.support.source.MapLayerSource")],lP);var Yke;let qM=Yke=class extends Ci{constructor(i){super(i),this.type="query-table"}clone(){const{workspaceId:i,query:e,oidFields:t,spatialReference:r,geometryType:n}=this,s={workspaceId:i,query:e,oidFields:t,spatialReference:r?.clone()??void 0,geometryType:n};return new Yke(s)}};x([Wr({queryTable:"query-table"})],qM.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"workspaceId",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"query",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"oidFields",void 0),x([D({type:Xi,json:{write:!0}})],qM.prototype,"spatialReference",void 0),x([Wr(Vp)],qM.prototype,"geometryType",void 0),qM=Yke=x([Qe("esri.layers.support.source.QueryTableDataSource")],qM);var Xke;let GG=Xke=class extends Ci{constructor(i){super(i),this.type="raster"}clone(){const{workspaceId:i,dataSourceName:e}=this;return new Xke({workspaceId:i,dataSourceName:e})}};x([Wr({raster:"raster"})],GG.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],GG.prototype,"dataSourceName",void 0),x([D({type:String,json:{write:!0}})],GG.prototype,"workspaceId",void 0),GG=Xke=x([Qe("esri.layers.support.source.RasterDataSource")],GG);var Jke;let qN=Jke=class extends Ci{constructor(i){super(i),this.type="table"}clone(){const{workspaceId:i,gdbVersion:e,dataSourceName:t}=this;return new Jke({workspaceId:i,gdbVersion:e,dataSourceName:t})}};x([Wr({table:"table"})],qN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"workspaceId",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"gdbVersion",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"dataSourceName",void 0),qN=Jke=x([Qe("esri.layers.support.source.TableDataSource")],qN);var Kke,Zke;const bsr=pa()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let vw=Kke=class extends Ci{constructor(i){super(i),this.type="join-table"}readLeftTableSource(i,e,t){return Rst()(i,e,t)}castLeftTableSource(i){return u3(Qke(),i)}readRightTableSource(i,e,t){return Rst()(i,e,t)}castRightTableSource(i){return u3(Qke(),i)}clone(){const{leftTableKey:i,rightTableKey:e,leftTableSource:t,rightTableSource:r,joinType:n}=this,s={leftTableKey:i,rightTableKey:e,leftTableSource:t?.clone()??void 0,rightTableSource:r?.clone()??void 0,joinType:n};return new Kke(s)}};x([Wr({joinTable:"join-table"})],vw.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],vw.prototype,"leftTableKey",void 0),x([D({type:String,json:{write:!0}})],vw.prototype,"rightTableKey",void 0),x([D({json:{write:!0}})],vw.prototype,"leftTableSource",void 0),x([Mi("leftTableSource")],vw.prototype,"readLeftTableSource",null),x([So("leftTableSource")],vw.prototype,"castLeftTableSource",null),x([D({json:{write:!0}})],vw.prototype,"rightTableSource",void 0),x([Mi("rightTableSource")],vw.prototype,"readRightTableSource",null),x([So("rightTableSource")],vw.prototype,"castRightTableSource",null),x([Wr(bsr)],vw.prototype,"joinType",void 0),vw=Kke=x([Qe("esri.layers.support.source.JoinTableDataSource")],vw);let D3e=null;function Rst(){return D3e||(D3e=zB({types:Qke()})),D3e}let F3e=null;function Qke(){return F3e||(F3e={key:"type",base:null,typeMap:{"data-layer":Ev,"map-layer":lP}}),F3e}const wsr={key:"type",base:null,typeMap:{"join-table":vw,"query-table":qM,raster:GG,table:qN}};let Ev=Zke=class extends Ci{constructor(i){super(i),this.type="data-layer"}clone(){const{fields:i,dataSource:e}=this;return new Zke({fields:i,dataSource:e})}};x([Wr({dataLayer:"data-layer"})],Ev.prototype,"type",void 0),x([D({type:[Fo],json:{write:!0}})],Ev.prototype,"fields",void 0),x([D({types:wsr,json:{write:!0}})],Ev.prototype,"dataSource",void 0),Ev=Zke=x([Qe("esri.layers.support.source.DataLayerSource")],Ev),Ev.from=Sd(Ev);let YN=class extends xs(Ci){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};x([D({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],YN.prototype,"onFields",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"operator",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"searchTerm",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"searchType",void 0),YN=x([Qe("esri.rest.support.FullTextSearch")],YN);const xsr=YN;var eLe;const Dst=new Rs({upperLeft:"upper-left",lowerLeft:"lower-left"});let XN=eLe=class extends Ci{constructor(i){super(i),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new eLe(li({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};x([D({type:hr,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],XN.prototype,"extent",void 0),x([D({type:["view","edit"],json:{write:!0}})],XN.prototype,"mode",void 0),x([D({type:String,json:{read:Dst.read,write:Dst.write}})],XN.prototype,"originPosition",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],XN.prototype,"tolerance",void 0),XN=eLe=x([Qe("esri.rest.support.QuantizationParameters")],XN);const YOt=XN,XOt=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var tLe;const Fst=new Rs({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let jT=tLe=class extends Ci{constructor(i){super(i),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(i,e){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(e.statisticParameters=li(i))}clone(){return new tLe({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:li(this.statisticParameters)})}};x([D({type:Number,json:{write:!0}})],jT.prototype,"maxPointCount",void 0),x([D({type:Number,json:{write:!0}})],jT.prototype,"maxRecordCount",void 0),x([D({type:Number,json:{write:!0}})],jT.prototype,"maxVertexCount",void 0),x([D({type:String,json:{write:!0}})],jT.prototype,"onStatisticField",void 0),x([D({type:String,json:{write:!0}})],jT.prototype,"outStatisticFieldName",void 0),x([D({type:String,json:{read:{source:"statisticType",reader:Fst.read},write:{target:"statisticType",writer:Fst.write}}})],jT.prototype,"statisticType",void 0),x([D({type:Object})],jT.prototype,"statisticParameters",void 0),x([ur("statisticParameters")],jT.prototype,"writeStatisticParameters",null),jT=tLe=x([Qe("esri.rest.support.StatisticDefinition")],jT);const y1e=jT;var $me;const Ssr=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let To=$me=class extends Ci{static from(i){return Cu($me,i)}constructor(i){super(i),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(i){return typeof i=="number"||typeof i=="object"?i:null}writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}writeParameterValues(i,e){if(i){const t={};for(const r in i){const n=i[r];Array.isArray(n)?t[r]=n.map(s=>s instanceof Date?s.getTime():s):n instanceof Date?t[r]=n.getTime():t[r]=n}e.parameterValues=t}}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(i,e){e.where=i||"1=1"}clone(){return new $me(li({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};To.MAX_MAX_RECORD_COUNT_FACTOR=5,x([D({json:{write:!0}})],To.prototype,"aggregateIds",void 0),x([D({type:Boolean,json:{write:!0}})],To.prototype,"cacheHint",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"compactGeometryEnabled",void 0),x([D({json:{write:!0}})],To.prototype,"datumTransformation",void 0),x([So("datumTransformation")],To.prototype,"castDatumTransformation",null),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"defaultSpatialReferenceEnabled",void 0),x([D({type:Number,json:{write:{overridePolicy:i=>({enabled:i>0})}}})],To.prototype,"distance",void 0),x([D({type:Ev,json:{write:!0}})],To.prototype,"dynamicDataSource",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"formatOf3DObjects",void 0),x([D({type:[xsr],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],To.prototype,"fullText",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"gdbVersion",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],To.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],To.prototype,"geometryPrecision",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"groupByFieldsForStatistics",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"having",void 0),x([D({type:Date})],To.prototype,"historicMoment",void 0),x([ur("historicMoment")],To.prototype,"writeHistoricMoment",null),x([D({type:Number,json:{write:!0}})],To.prototype,"maxAllowableOffset",void 0),x([D({type:Number,cast:i=>i<1?1:i>To.MAX_MAX_RECORD_COUNT_FACTOR?To.MAX_MAX_RECORD_COUNT_FACTOR:i,json:{write:{overridePolicy:i=>({enabled:i>1})}}})],To.prototype,"maxRecordCountFactor",void 0),x([D({type:["xyFootprint"],json:{write:!0}})],To.prototype,"multipatchOption",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],To.prototype,"num",void 0),x([D({json:{write:!0}})],To.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"outFields",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],To.prototype,"outSpatialReference",void 0),x([D({type:[y1e],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],To.prototype,"outStatistics",void 0),x([D({json:{write:!0}})],To.prototype,"parameterValues",void 0),x([ur("parameterValues")],To.prototype,"writeParameterValues",null),x([D({type:$i,json:{write:!0}})],To.prototype,"pixelSize",void 0),x([D({type:YOt,json:{write:!0}})],To.prototype,"quantizationParameters",void 0),x([D({type:[Object],json:{write:!0}})],To.prototype,"rangeValues",void 0),x([D({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],To.prototype,"relationParameter",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"resultType",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnCentroid",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnDistinctValues",void 0),x([D({type:Boolean,json:{default:!0,write:!0}})],To.prototype,"returnExceededLimitFeatures",void 0),x([D({type:Boolean,json:{write:!0}})],To.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnQueryGeometry",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],To.prototype,"returnZ",void 0),x([D({type:Xi,json:{write:!0}})],To.prototype,"sourceSpatialReference",void 0),x([Wr(XOt,{ignoreUnknown:!1,name:"spatialRel"})],To.prototype,"spatialRelationship",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],To.prototype,"start",void 0),x([ur("start"),ur("num")],To.prototype,"writeStart",null),x([D({type:String,json:{write:!0}})],To.prototype,"sqlFormat",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"text",void 0),x([D({type:Eg,json:{write:!0}})],To.prototype,"timeExtent",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"timeReferenceUnknownClient",void 0),x([Wr(Ssr,{ignoreUnknown:!1}),D({json:{write:{overridePolicy(i){return{enabled:!!i&&this.distance!=null&&this.distance>0}}}}})],To.prototype,"units",void 0),x([D({type:String,json:{write:{overridePolicy(i){return{enabled:i!=null||this.start!=null&&this.start>0}}}}})],To.prototype,"where",void 0),x([ur("where")],To.prototype,"writeWhere",null),To=$me=x([Qe("esri.rest.support.Query")],To);const Kn=To;var iLe;const k3e=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),L3e=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let gI=iLe=class extends Ci{constructor(i){super(i),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(i={}){const{where:e,geometry:t,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new Kn({geometry:li(t),objectIds:li(s),spatialRelationship:r,timeExtent:li(n),where:e,units:o,distance:a,...i})}clone(){const{where:i,geometry:e,spatialRelationship:t,timeExtent:r,objectIds:n,units:s,distance:o}=this;return new iLe({geometry:li(e),objectIds:li(n),spatialRelationship:t,timeExtent:li(r),where:i,units:s,distance:o})}};x([D({type:String,json:{write:!0}})],gI.prototype,"where",void 0),x([D({types:Ff,json:{write:!0}})],gI.prototype,"geometry",void 0),x([D({type:k3e.apiValues,json:{name:"spatialRel",read:{reader:k3e.read},write:{allowNull:!1,writer:k3e.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],gI.prototype,"spatialRelationship",void 0),x([D({type:Number,json:{write:{overridePolicy(i){return{enabled:i!=null&&this.geometry!=null}}}}})],gI.prototype,"distance",void 0),x([D({type:[Number],json:{write:!0}})],gI.prototype,"objectIds",void 0),x([D({type:L3e.apiValues,json:{read:L3e.read,write:{writer:L3e.write,overridePolicy(i){return{enabled:i!=null&&this.geometry!=null}}}}})],gI.prototype,"units",void 0),x([D({type:Eg,json:{write:!0}})],gI.prototype,"timeExtent",void 0),gI=iLe=x([Qe("esri.layers.support.FeatureFilter")],gI);const QF=gI;var rLe;const kst={read:{reader:kVe},write:{writer:LVe,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},Lst={read:{reader:kVe},write:{writer:LVe,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},Nst={name:"showExcludedLabels",default:!0};let JN=rLe=class extends Ci{constructor(i){super(i),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(i,e){const t=super.write(i,e);if(e?.origin){if(t.filter){const r=Object.keys(t.filter);if(r.length>1||r[0]!=="where")return e.messages?.push(new qe("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in t)return e.messages?.push(new qe("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return t}clone(){return new rLe({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};x([D({type:QF,json:{write:{allowNull:!0,writer(i,e,t,r){const n=i?.write({},r);n&&Object.keys(n).length!==0?Qp(t,n,e):Qp(t,null,e)}}}})],JN.prototype,"filter",void 0),x([D({json:{write:!0,origins:{"web-map":kst,"portal-item":kst}}})],JN.prototype,"includedEffect",void 0),x([D({json:{write:!0,origins:{"web-map":Lst,"portal-item":Lst}}})],JN.prototype,"excludedEffect",void 0),x([D({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":Nst,"portal-item":Nst}}})],JN.prototype,"excludedLabelsVisible",void 0),JN=rLe=x([Qe("esri.layers.support.FeatureEffect")],JN);const JOt=JN,$st={write:{allowNull:!0}},RY=i=>{let e=class extends i{constructor(){super(...arguments),this.featureEffect=null}};return x([D({type:JOt,json:{origins:{"web-map":$st,"portal-item":$st}}})],e.prototype,"featureEffect",void 0),e=x([Qe("esri.layers.mixins.FeatureEffectLayer")],e),e};var SQ;const v1e=pa()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),KOt=v1e.jsonValues.slice();cVi(KOt,"orthometric");const Pie=pa()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let GT=SQ=class extends Ci{constructor(i){super(i),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(i,e,t){return v1e.write(i,e,t)}readHeightModel(i,e,t){return v1e.read(i)||(t?.messages&&t.messages.push(Tsr(i,{context:t})),null)}readHeightUnit(i,e,t){return Pie.read(i)||(t?.messages&&t.messages.push(Bst(i,{context:t})),null)}readHeightUnitService(i,e,t){return TEt(i)||Pie.read(i)||(t?.messages&&t.messages.push(Bst(i,{context:t})),null)}readVertCRS(i,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new SQ({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(i){return!!i&&(this===i||this.heightModel===i.heightModel&&this.heightUnit===i.heightUnit&&this.vertCRS===i.vertCRS)}static deriveUnitFromSR(i,e){const t=zqi(e);return new SQ({heightModel:i.heightModel,heightUnit:t??void 0,vertCRS:i.vertCRS})}write(i,e){return e={origin:"web-scene",...e},super.write(i,e)}static fromJSON(i){if(!i)return null;const e=new SQ;return e.read(i,{origin:"web-scene"}),e}};function Bst(i,e){return new Rf("height-unit:unsupported",`Height unit of value '${i}' is not supported`,e)}function Tsr(i,e){return new Rf("height-model:unsupported",`Height model of value '${i}' is not supported`,e)}x([D({type:v1e.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:KOt,default:"ellipsoidal"}}}})],GT.prototype,"heightModel",void 0),x([ur("web-scene","heightModel")],GT.prototype,"writeHeightModel",null),x([Mi(["web-scene","service"],"heightModel")],GT.prototype,"readHeightModel",null),x([D({type:Pie.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:Pie.jsonValues,write:Pie.write}}}})],GT.prototype,"heightUnit",void 0),x([Mi("web-scene","heightUnit")],GT.prototype,"readHeightUnit",null),x([Mi("service","heightUnit")],GT.prototype,"readHeightUnitService",null),x([D({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],GT.prototype,"vertCRS",void 0),x([Mi("service","vertCRS",["vertCRS","ellipsoid","geoid"])],GT.prototype,"readVertCRS",null),GT=SQ=x([Qe("esri.geometry.HeightModelInfo")],GT);const DY=GT;function jst(i){return i!=null&&typeof i=="object"&&"declaredClass"in i&&i.declaredClass==="esri.WebMap"}function Csr(i){if(!i)return i;const{start:e,end:t}=i;return new Eg({start:e!=null?K8(e,-e.getTimezoneOffset(),"minutes"):e,end:t!=null?K8(t,-t.getTimezoneOffset(),"minutes"):t})}function Esr(i){if(!i)return i;const{start:e,end:t}=i;return new Eg({start:e!=null?K8(e,e.getTimezoneOffset(),"minutes"):e,end:t!=null?K8(t,t.getTimezoneOffset(),"minutes"):t})}var nLe;let TQ=nLe=class extends Ci{constructor(i){super(i)}async collectRequiredFields(i,e){return i_(i,e,this.expression)}clone(){return new nLe({expression:this.expression,title:this.title})}equals(i){return this.expression===i.expression&&this.title===i.title}};x([D({type:String,json:{write:!0}})],TQ.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],TQ.prototype,"title",void 0),TQ=nLe=x([Qe("esri.layers.support.FeatureExpressionInfo")],TQ);const Gst=TQ;function Isr(i){return 1/(bae[i]||1)}function Asr(){const i=Object.keys(bae);return i.sort(),i}const Msr=Asr();var sLe;const she=pa()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),Ust=new Rs({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let YM=sLe=class extends Ci{constructor(i){super(i),this.offset=null}readFeatureExpressionInfo(i,e){return i??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(i,e,t,r){e[t]=i.write({},r),i.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:i,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):i!=null||e?"relative-to-ground":"on-the-ground"}set mode(i){this._override("mode",i)}set unit(i){this._set("unit",i)}write(i,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(i,e):null}clone(){return new sLe({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(i){return this.mode===i.mode&&this.offset===i.offset&&this.unit===i.unit&&gne(this.featureExpressionInfo,i.featureExpressionInfo)}};x([D({type:Gst,json:{write:!0}})],YM.prototype,"featureExpressionInfo",void 0),x([Mi("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],YM.prototype,"readFeatureExpressionInfo",null),x([ur("featureExpressionInfo",{featureExpressionInfo:{type:Gst},"featureExpression.value":{type:[0]}})],YM.prototype,"writeFeatureExpressionInfo",null),x([D({type:she.apiValues,nonNullable:!0,json:{type:she.jsonValues,read:she.read,write:{writer:she.write,isRequired:!0}}})],YM.prototype,"mode",null),x([D({type:Number,json:{write:!0}})],YM.prototype,"offset",void 0),x([D({type:Msr,json:{type:String,read:Ust.read,write:Ust.write}})],YM.prototype,"unit",null),YM=sLe=x([Qe("esri.layers.support.ElevationInfo")],YM);const ZB=YM,FY={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:Wv}}},h_={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(i,e)=>!e.disablePopup},write:{enabled:!0,writer(i,e,t){e[t]=!i}}}},H3={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:Wv}}},C0={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:cR}}},d_={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:Wv}}},jR={value:null,type:ZB,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:Wv}}};function oLe(i){return{type:i,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const ZOt={write:{enabled:!0,layerContainerTypes:Wv},read:!0},aB={type:Number,json:{origins:{"web-document":ZOt,"portal-item":{write:!0}}}},QOt={...aB,json:{...aB.json,origins:{"web-document":{...ZOt,write:{enabled:!0,layerContainerTypes:Wv,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(i,e,t)=>t&&t.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?e.layerDefinition?.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?vW(e.layerDefinition.drawingInfo.transparency):void 0:vW(e.drawingInfo.transparency)}}},kY={type:Eg,readOnly:!0,get(){const i=this.layer?.timeInfo!=null?this.layer:this.i3slayer?.timeInfo!=null?this.i3slayer:null;if(i==null)return null;const{datesInUnknownTimezone:e,timeOffset:t,useViewTime:r}=i,n=this.view?.timeExtent;let s=i.timeExtent;e&&(s=Esr(s));let o=r?n&&s?n.intersection(s):n||s:s;if(!o||o.isEmpty||o.isAllTime)return o;t&&(o=o.offset(-t.value,t.unit)),e&&(o=Csr(o));const a=this._get("timeExtent");return o.equals(a)?a:o}},Osr={type:hr,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(i,e)=>{const t=hr.fromJSON(i);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(t.spatialReference=Xi.fromJSON(e.spatialReference)),t}}}},read:!1}},LY={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},jVe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.minScale",write:!0}},GVe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.maxScale",write:!0}},ePt={json:{write:{ignoreOrigin:!0,layerContainerTypes:Wv},origins:{"web-map":{read:!1,write:!1}}}};let XM=class extends xs(Ci){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};x([D()],XM.prototype,"creatorField",void 0),x([D()],XM.prototype,"creationDateField",void 0),x([D()],XM.prototype,"editorField",void 0),x([D()],XM.prototype,"editDateField",void 0),x([D()],XM.prototype,"realm",void 0),x([D(XF("dateFieldsTimeReference",!0))],XM.prototype,"timeZone",void 0),XM=x([Qe("esri.layers.support.EditFieldsInfo")],XM);const Psr=XM;let HI=class extends xs(Ci){constructor(e){super(e)}};x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"name",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"fields",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"isAscending",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"indexType",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"isUnique",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"description",void 0),HI=x([Qe("esri.layers.support.FeatureIndex")],HI);async function Rsr(i,e,t){e=e.clone(),i.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=tPt(i));const r=Dsr(i),n=i.capabilities.query.supportsPagination;e.start=0,e.num=r;let s=null;for(;;){const o=await i.source.queryFeaturesJSON(e,t);if(s==null?s=o:s.features=s.features.concat(o.features),s.exceededTransferLimit=o.exceededTransferLimit,!n||!o.exceededTransferLimit)break;e.start+=r}return s}function Dsr(i){return tPt(i)*Fsr(i)}function Fsr(i){return i.capabilities.query.maxRecordCount||2e3}function tPt(i){return i.capabilities.query.supportsMaxRecordCountFactor?Kn.MAX_MAX_RECORD_COUNT_FACTOR:1}var aLe;let Ug=aLe=class extends Ci{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new aLe(li({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};x([D({type:[String],json:{write:!0}})],Ug.prototype,"attachmentTypes",void 0),x([D({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],Ug.prototype,"attachmentsWhere",void 0),x([D({type:Boolean,json:{write:!0}})],Ug.prototype,"cacheHint",void 0),x([D({type:[String],json:{write:!0}})],Ug.prototype,"keywords",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"globalIds",void 0),x([D({json:{write:!0}})],Ug.prototype,"name",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Ug.prototype,"num",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"objectIds",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],Ug.prototype,"returnMetadata",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"size",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Ug.prototype,"start",void 0),x([ur("start"),ur("num")],Ug.prototype,"writeStart",null),x([D({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Ug.prototype,"where",void 0),Ug=aLe=x([Qe("esri.rest.support.AttachmentQuery")],Ug),Ug.from=Sd(Ug);const _1e=Ug;var lLe;let Md=lLe=class extends Ci{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(e.definitionExpression="1=1")}clone(){return new lLe(li({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};x([D({type:Boolean,json:{write:!0}})],Md.prototype,"cacheHint",void 0),x([D({type:Ev,json:{write:!0}})],Md.prototype,"dynamicDataSource",void 0),x([D({type:String,json:{write:!0}})],Md.prototype,"gdbVersion",void 0),x([D({type:Number,json:{write:!0}})],Md.prototype,"geometryPrecision",void 0),x([D({type:Date})],Md.prototype,"historicMoment",void 0),x([ur("historicMoment")],Md.prototype,"_writeHistoricMoment",null),x([D({type:Number,json:{write:!0}})],Md.prototype,"maxAllowableOffset",void 0),x([D({type:[Number],json:{write:!0}})],Md.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],Md.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],Md.prototype,"outFields",void 0),x([D({type:Xi,json:{read:{source:"outSR"},write:{target:"outSR"}}})],Md.prototype,"outSpatialReference",void 0),x([D({json:{write:!0}})],Md.prototype,"relationshipId",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Md.prototype,"start",void 0),x([ur("start"),ur("num")],Md.prototype,"writeStart",null),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Md.prototype,"num",void 0),x([D({json:{write:!0}})],Md.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Md.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Md.prototype,"returnZ",void 0),x([D({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Md.prototype,"where",void 0),Md=lLe=x([Qe("esri.rest.support.RelationshipQuery")],Md),Md.from=Sd(Md);const p3=Md,zst=Object.freeze(Object.defineProperty({__proto__:null,default:p3},Symbol.toStringTag,{value:"Module"})),uLe=new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function iPt(i,e,t,r){const n=await Xk(i);if(await UVe(i,e,r),!n.addAttachment)throw new qe(r,"Layer source does not support addAttachment capability");return n.addAttachment(e,t)}function UVe(i,e,t){const{attributes:r}=e,{objectIdField:n}=i;return i.capabilities?.data?.supportsAttachment?e?r?n&&r[n]?Promise.resolve():Promise.reject(new qe(t,`feature is missing the identifying attribute ${n}`)):Promise.reject(new qe(t,"'attributes' are required on a feature to query attachments")):Promise.reject(new qe(t,"A feature is required to add/delete/update attachments")):Promise.reject(new qe(t,"this layer doesn't support attachments"))}async function rPt(i,e,t,r,n){const s=await Xk(i);if(await UVe(i,e,n),!s.updateAttachment)throw new qe(n,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,t,r)}async function nPt(i,e,t){const{applyEdits:r}=await Promise.resolve().then(()=>UCe),n=await i.load(),{source:s,globalIdField:o}=n;let a=t;return n.type==="feature"&&n.infoFor3D&&e.deleteFeatures!=null&&o!=null&&(a={...a,globalIdToObjectId:await gPt(i,e.deleteFeatures,o)}),r(n,s,e,t)}async function ksr(i,e,t){const{uploadAssets:r}=await Promise.resolve().then(()=>UCe),n=await i.load();return r(n,n.source,e,t)}async function sPt(i,e,t,r){const n=await Xk(i);if(await UVe(i,e,r),!n.deleteAttachments)throw new qe(r,"Layer source does not support deleteAttachments capability");return n.deleteAttachments(e,t)}async function oPt(i,e,t){const r=(await i.load({signal:e?.signal})).source;if(!r.fetchRecomputedExtents)throw new qe(t,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(e)}async function aPt(i,e,t,r){e=_1e.from(e),await i.load();const n=i.source,s=i.capabilities;if(!s?.data?.supportsAttachment)throw new qe(r,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:u,size:c,start:h,where:p}=e;if(!s?.operations?.supportsQueryAttachments&&(o?.length>0||l?.length>0||c?.length>0||u||h||p))throw new qe(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(a?.length||l?.length||p))throw new qe(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!n.queryAttachments)throw new qe(r,"Layer source does not support queryAttachments capability",e);return n.queryAttachments(e)}async function lPt(i,e,t,r){const n=await Xk(i);if(!n.queryObjectIds)throw new qe(r,"Layer source does not support queryObjectIds capability");return n.queryObjectIds(Kn.from(e)??i.createQuery(),t)}async function uPt(i,e,t,r){const n=await Xk(i);if(!n.queryFeatureCount)throw new qe(r,"Layer source does not support queryFeatureCount capability");return n.queryFeatureCount(Kn.from(e)??i.createQuery(),t)}async function cPt(i,e,t,r){const n=await Xk(i);if(!n.queryExtent)throw new qe(r,"Layer source does not support queryExtent capability");return n.queryExtent(Kn.from(e)??i.createQuery(),t)}async function hPt(i,e,t,r){const n=await Xk(i);if(!n.queryRelatedFeatures)throw new qe(r,"Layer source does not support queryRelatedFeatures capability");return n.queryRelatedFeatures(p3.from(e),t)}async function dPt(i,e,t,r){const n=await Xk(i);if(!n.queryRelatedFeaturesCount)throw new qe(r,"Layer source does not support queryRelatedFeaturesCount capability");return n.queryRelatedFeaturesCount(p3.from(e),t)}async function pPt(i){const e=i.source;if(e?.refresh)try{const{dataChanged:t,updates:r}=await e.refresh();if(r!=null&&(i.sourceJSON={...i.sourceJSON,...r},i.read(r,{origin:"service",url:i.parsedUrl})),t)return!0}catch{}if(i.definitionExpression)try{return(await Ine(i.definitionExpression,i.fieldsIndex)).hasDateFunctions}catch{}return!1}function zVe(i){const e=new Kn,t=i.capabilities?.data,r=i.capabilities?.query;e.historicMoment=i.historicMoment,e.gdbVersion=i.gdbVersion,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&i.returnZ!=null&&(e.returnZ=i.returnZ),t.supportsM&&i.returnM!=null&&(e.returnM=i.returnM)),e.outFields=["*"];const{timeOffset:n,timeExtent:s}=i;return e.timeExtent=n!=null&&s!=null?s.offset(-n.value,n.unit):s||null,e.multipatchOption=i.geometryType==="multipatch"?"xyFootprint":null,e}function fPt(i){const{globalIdField:e,fields:t}=i;if(e)return e;if(t){for(const r of t)if(r.type==="esriFieldTypeGlobalID")return r.name}}function mPt(i){const{objectIdField:e,fields:t}=i;if(e)return e;if(t){for(const r of t)if(r.type==="esriFieldTypeOID")return r.name}}function Lsr(i){return i.currentVersion?i.currentVersion:i.hasOwnProperty("capabilities")||i.hasOwnProperty("drawingInfo")||i.hasOwnProperty("hasAttachments")||i.hasOwnProperty("htmlPopupType")||i.hasOwnProperty("relationships")||i.hasOwnProperty("timeInfo")||i.hasOwnProperty("typeIdField")||i.hasOwnProperty("types")?10:9.3}async function Xk(i){return(await i.load()).source}async function Nsr(i,e){if(!no||no.findCredential(i))return;let t;try{const r=await jEt(i,e);r&&(t=await no.checkSignInStatus(`${r}/sharing`))}catch{}if(t)try{const r=e!=null?e.signal:null;await no.getCredential(i,{signal:r})}catch{}}async function u8(i,e,t){const r=i.parsedUrl?.path;r&&i.authenticationTriggerEvent===e&&await Nsr(r,t)}function VVe(i){return!i.sourceJSON?.isMultiServicesView&&(i.userHasUpdateItemPrivileges||i.editingEnabled)}const N3e=zB({types:B3t});function V2e(i,e){if(i.defaultSymbol)return i.types?.length?new JB({defaultSymbol:N3e(i.defaultSymbol,i,e),field:i.typeIdField,uniqueValueInfos:i.types.map(t=>({id:t.id,symbol:N3e(t.symbol,t,e)}))}):new _x({symbol:N3e(i.defaultSymbol,i,e)})}function $sr(i){let e=i.sourceJSON?.cacheMaxAge;if(!e)return!1;const t=i.editingInfo?.lastEditDate?.getTime();return t==null||(e*=1e3,Date.now()-t{let c=null;if("attributes"in u){const{attributes:h}=u;c={globalId:h[t],objectId:h[n]!=null&&h[n]!==-1?h[n]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||r.push(c.globalId))}),r.length===0)return null;const s=i.createQuery();s.where=r.map(u=>`${t}='${u}'`).join(" OR "),s.returnGeometry=!1,s.outFields=[n,t],s.cacheHint=!1;const o=await s5e(Rsr(i,s));if(!o.ok)return null;const a=new Map,l=o.value.features;for(const u of l){const c=u.attributes[t],h=u.attributes[n];c!=null&&h!=null&&h!==-1&&a.set(c,h)}return a}let UG=class extends xs(Ci){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};x([D({type:String,json:{read:{source:"shapeAreaFieldName"}}})],UG.prototype,"shapeAreaField",void 0),x([D({type:String,json:{read:{source:"shapeLengthFieldName"}}})],UG.prototype,"shapeLengthField",void 0),x([D({type:String,json:{read:i=>Cne.read(i)||uR.read(i)}})],UG.prototype,"units",void 0),UG=x([Qe("esri.layers.support.GeometryFieldsInfo")],UG);const Bsr=UG;var cLe;let zG=cLe=class extends Ci{constructor(i){super(i),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new dr}clone(){return new cLe({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};x([D({type:String,json:{write:!0}})],zG.prototype,"floorField",void 0),x([D({json:{read:!1,write:!1}})],zG.prototype,"viewAllMode",void 0),x([D({json:{read:!1,write:!1}})],zG.prototype,"viewAllLevelIds",void 0),zG=cLe=x([Qe("esri.layers.support.LayerFloorInfo")],zG);const HVe=zG,Vst=new Rs({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),Hst=new Rs({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let E2=class extends xs(Ci){constructor(e){super(e),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};x([D({json:{read:Vst.read,write:Vst.write}})],E2.prototype,"cardinality",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"composite",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"id",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"keyField",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"keyFieldInRelationshipTable",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"name",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"relatedTableId",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"relationshipTableId",void 0),x([D({json:{read:Hst.read,write:Hst.write}})],E2.prototype,"role",void 0),E2=x([Qe("esri.layers.support.Relationship")],E2);const jsr=E2;function Go(i,e,t){return!!yPt(i,e,t)}function CQ(i,e,t){return yPt(i,e,t)}function yPt(i,e,t){return i&&i.hasOwnProperty(e)?i[e]:t}const Gsr={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function Usr(i){const e=i?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function Cae(i,e){return!!i?.supportedOperationsWithCacheHint?.map(r=>r.toLowerCase())?.includes(e.toLowerCase())}function WVe(i,e){return{analytics:zsr(i),attachment:Vsr(i),data:Hsr(i),metadata:Wsr(i),operations:qsr(i.capabilities,i,e),query:Ysr(i,e),queryRelated:Xsr(i),queryTopFeatures:Jsr(i),editing:Ksr(i)}}function zsr(i){return{supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryAnalytics")}}function Vsr(i){const e=i.attachmentProperties,t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryAttachments"),supportsResize:Go(i,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(r=>{const n=Gsr[r.name];n&&(t[n]=!!r.isEnabled)}),t}function Hsr(i){return{isVersioned:Go(i,"isDataVersioned",!1),supportsAttachment:Go(i,"hasAttachments",!1),supportsM:Go(i,"hasM",!1),supportsZ:Go(i,"hasZ",!1)}}function Wsr(i){return{supportsAdvancedFieldProperties:Go(i,"supportsFieldDescriptionProperty",!1)}}function qsr(i,e,t){const r=i?i.toLowerCase().split(",").map(p=>p.trim()):[],n=t?r_(t):null,s=r.includes(n!=null&&n.serverType==="MapServer"?"data":"query"),o=r.includes("editing")&&!e.datesInUnknownTimezone;let a=o&&r.includes("create"),l=o&&r.includes("delete"),u=o&&r.includes("update");const c=r.includes("changetracking"),h=e.advancedQueryCapabilities;return o&&!(a||l||u)&&(a=l=u=!0),{supportsCalculate:Go(e,"supportsCalculate",!1),supportsTruncate:Go(e,"supportsTruncate",!1),supportsValidateSql:Go(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:c,supportsQuery:s,supportsQueryAnalytics:Go(h,"supportsQueryAnalytic",!1),supportsQueryAttachments:Go(h,"supportsQueryAttachments",!1),supportsQueryTopFeatures:Go(h,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:Go(e,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:u,supportsExceedsLimitStatistics:Go(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:Go(e,"supportsAsyncConvert3D",!1)}}function Ysr(i,e){const t=i.advancedQueryCapabilities,r=i.ownershipBasedAccessControlForFeatures,n=i.archivingInfo,s=i.currentVersion,o=e?.includes("MapServer"),a=!o||s>=yi("mapserver-pbf-version-support"),l=Fx(e),u=new Set((i.supportedQueryFormats??"").split(",").map(c=>c.toLowerCase().trim()));return{supportsStatistics:Go(t,"supportsStatistics",i.supportsStatistics),supportsPercentileStatistics:Go(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Go(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Usr(t),supportsCentroid:Go(t,"supportsReturningGeometryCentroid",!1),supportsDistance:Go(t,"supportsQueryWithDistance",!1),supportsDistinct:Go(t,"supportsDistinct",i.supportsAdvancedQueries),supportsExtent:Go(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Go(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:Go(t,"supportsHavingClause",!1),supportsOrderBy:Go(t,"supportsOrderBy",i.supportsAdvancedQueries),supportsPagination:Go(t,"supportsPagination",!1),supportsQuantization:Go(i,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Go(i,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Go(i,"supportsReturningQueryGeometry",!1),supportsResultType:Go(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Go(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Go(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Go(i,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Go(t,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:Go(r,"allowAnonymousToQuery",!0),supportsQueryByOthers:Go(r,"allowOthersToQuery",!0),supportsHistoricMoment:Go(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&u.has("pbf"),supportsDisjointSpatialRelationship:Go(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:Go(t,"supportsQueryWithCacheHint",!1)||Cae(t,"query"),supportsDefaultSpatialReference:Go(t,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:Go(t,"supportsFullTextSearch",!1),maxRecordCountFactor:CQ(i,"maxRecordCountFactor",void 0),maxRecordCount:CQ(i,"maxRecordCount",void 0),standardMaxRecordCount:CQ(i,"standardMaxRecordCount",void 0),tileMaxRecordCount:CQ(i,"tileMaxRecordCount",void 0)}}function Xsr(i){const e=i.advancedQueryCapabilities,t=Go(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Go(e,"supportsQueryRelatedPagination",!1),supportsCount:t,supportsOrderBy:t,supportsCacheHint:Cae(e,"queryRelated")}}function Jsr(i){return{supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryTopFilter")}}function Ksr(i){const e=i.ownershipBasedAccessControlForFeatures,t=i?i.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:Go(i,"allowGeometryUpdates",!0),supportsGlobalId:Go(i,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Go(i,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:Go(i,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Go(i,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Go(i,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Go(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Go(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Go(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Go(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:Go(t,"supportsAsyncApplyEdits",!1),zDefault:CQ(i,"zDefault",void 0)}}let JM=class extends xs(Ci){constructor(e){super(e),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=j2e(e[r]);return t}writeDomains(e,t){if(!e)return;const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());t.domains=r}};x([D({type:Number,json:{write:!0}})],JM.prototype,"code",void 0),x([D({type:Object,json:{write:!0}})],JM.prototype,"defaultValues",void 0),x([D({json:{write:!0}})],JM.prototype,"domains",void 0),x([Mi("domains")],JM.prototype,"readDomains",null),x([ur("domains")],JM.prototype,"writeDomains",null),x([D({type:String,json:{write:!0}})],JM.prototype,"name",void 0),JM=x([Qe("esri.layers.support.Subtype")],JM);const Zsr=JM,qVe=i=>{let e=class extends i{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(dr.ofType(HI)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Xi.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:t}=this;if(t){const{query:n,operations:s,editing:o}=t;if(!n.supportsQueryByOthers||!n.supportsQueryByAnonymous||s.supportsEditing&&!(o.supportsUpdateByOthers&&o.supportsUpdateByAnonymous&&o.supportsDeleteByOthers&&o.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if($sr(this))return"load";if(this.hasUpdateItemRestrictions)return t.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const r=this.editFieldsInfo;return(r?.creatorField||r?.editorField)&&t?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(t,r){return WVe(r,this.url)}readEditingInfo(t,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}get effectiveCapabilities(){const t=this.capabilities;if(!t)return null;const r=li(t),{operations:n,editing:s}=r;return this.sourceJSON?.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(n.supportsQuery=!0),r):this.userHasUpdateItemPrivileges?(n.supportsAdd=n.supportsDelete=n.supportsEditing=n.supportsQuery=n.supportsUpdate=s.supportsDeleteByOthers=s.supportsGeometryUpdate=s.supportsUpdateByOthers=!0,r):(this.userHasFullEditingPrivileges&&n.supportsEditing&&(n.supportsAdd=n.supportsDelete=n.supportsUpdate=s.supportsGeometryUpdate=!0),r)}readGlobalIdFieldFromService(t,r){return fPt(r)}get hasFullEditingRestrictions(){const t=this.capabilities;if(!t||this.sourceJSON?.isMultiServicesView)return!1;const{operations:r,editing:n}=t;return r.supportsEditing&&!(r.supportsAdd&&r.supportsDelete&&r.supportsUpdate&&n.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const t=this.capabilities;if(!t)return!1;const{operations:r,editing:n}=t;return this.sourceJSON?.isMultiServicesView?!r.supportsQuery:!(r.supportsAdd&&r.supportsDelete&&r.supportsEditing&&r.supportsQuery&&r.supportsUpdate&&n.supportsDeleteByOthers&&n.supportsGeometryUpdate&&n.supportsUpdateByOthers)}readIsTableFromService(t,r){return r.type==="Table"}readMaxScale(t,r){return r.effectiveMaxScale||t||0}readMinScale(t,r){return r.effectiveMinScale||t||0}readObjectIdFieldFromService(t,r){return mPt(r)}readServiceDefinitionExpression(t,r){return r.definitionQuery||r.definitionExpression}set url(t){const r=mOt({layer:this,url:t,nonStandardUrlAllowed:!0,logger:di.getLogger(this)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(t,r,n,s){gOt(this,t,null,r,s)}readVersion(t,r){return Lsr(r)}};return x([D({readOnly:!0})],e.prototype,"authenticationTriggerEvent",null),x([D({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),x([D({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities")],e.prototype,"readCapabilitiesFromService",null),x([D(XF("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),x([D({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),x([D({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),x([D({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],e.prototype,"displayField",void 0),x([D({readOnly:!0,type:Psr})],e.prototype,"editFieldsInfo",void 0),x([D({readOnly:!0})],e.prototype,"editingInfo",void 0),x([Mi("editingInfo")],e.prototype,"readEditingInfo",null),x([D({readOnly:!0})],e.prototype,"effectiveCapabilities",null),x([D((()=>{const t=li(jR),r=t.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},t})())],e.prototype,"elevationInfo",void 0),x([D({type:HVe,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:Wv}}}}})],e.prototype,"floorInfo",void 0),x([D({type:hr,json:{origins:{service:{read:{source:"extent"}}}}})],e.prototype,"fullExtent",void 0),x([D()],e.prototype,"gdbVersion",void 0),x([D({readOnly:!0,type:Bsr,json:{read:{source:"geometryProperties"}}})],e.prototype,"geometryFieldsInfo",void 0),x([D({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:uLe.read}}}})],e.prototype,"geometryType",void 0),x([D({type:String})],e.prototype,"globalIdField",void 0),x([Mi("service","globalIdField",["globalIdField","fields"])],e.prototype,"readGlobalIdFieldFromService",null),x([D({readOnly:!0})],e.prototype,"hasFullEditingRestrictions",null),x([D({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasM",void 0),x([D({readOnly:!0})],e.prototype,"hasUpdateItemRestrictions",null),x([D({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasZ",void 0),x([D({readOnly:!0,type:DY})],e.prototype,"heightModelInfo",void 0),x([D({type:Date})],e.prototype,"historicMoment",void 0),x([D({type:dr.ofType(HI),readOnly:!0})],e.prototype,"indexes",void 0),x([D({readOnly:!0})],e.prototype,"isTable",void 0),x([Mi("service","isTable",["type"])],e.prototype,"readIsTableFromService",null),x([D({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],e.prototype,"layerId",void 0),x([D(GVe)],e.prototype,"maxScale",void 0),x([Mi("service","maxScale",["maxScale","effectiveMaxScale"])],e.prototype,"readMaxScale",null),x([D(jVe)],e.prototype,"minScale",void 0),x([Mi("service","minScale",["minScale","effectiveMinScale"])],e.prototype,"readMinScale",null),x([D({type:String})],e.prototype,"objectIdField",void 0),x([Mi("service","objectIdField",["objectIdField","fields"])],e.prototype,"readObjectIdFieldFromService",null),x([D(XF("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),x([D({type:[jsr],readOnly:!0})],e.prototype,"relationships",void 0),x([D({type:Boolean})],e.prototype,"returnM",void 0),x([D({type:Boolean})],e.prototype,"returnZ",void 0),x([D({readOnly:!0,json:{write:!1}})],e.prototype,"serverGens",void 0),x([D({readOnly:!0})],e.prototype,"serviceDefinitionExpression",void 0),x([Mi("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],e.prototype,"readServiceDefinitionExpression",null),x([D({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"serviceItemId",void 0),x([D()],e.prototype,"sourceJSON",void 0),x([D({type:Xi,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],e.prototype,"spatialReference",void 0),x([D({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],e.prototype,"subtypeField",void 0),x([D({type:[Zsr],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"subtypes",void 0),x([D({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],e.prototype,"trackIdField",void 0),x([D(C0)],e.prototype,"url",null),x([ur("url")],e.prototype,"writeUrl",null),x([D({json:{origins:{service:{read:!0}},read:!1}})],e.prototype,"version",void 0),x([Mi("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.FeatureLayerBase")],e),e};let VG=class extends xs(Ci){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};x([D({type:String,json:{write:!0}})],VG.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],VG.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],VG.prototype,"returnType",void 0),VG=x([Qe("esri.layers.support.ExpressionInfo")],VG);const YVe=VG;var hLe;let KM=hLe=class extends Ci{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new hLe({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:li(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};x([D({type:Boolean,json:{write:!0}})],KM.prototype,"isAutoGenerated",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"alias",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"onStatisticField",void 0),x([D({type:YVe,json:{write:!0}})],KM.prototype,"onStatisticExpression",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"statisticType",void 0),KM=hLe=x([Qe("esri.layers.support.AggregateField")],KM);const lB=KM;let GP=class extends Ci{constructor(){super(...arguments),this.type=null}};x([D({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],GP.prototype,"type",void 0),GP=x([Qe("esri.layers.support.FeatureReduction")],GP);const XVe="__begin__",JVe="__end__",Qsr=new RegExp(XVe,"ig"),eor=new RegExp(JVe,"ig"),Wst=new RegExp("^"+XVe,"i"),qst=new RegExp(JVe+"$","i"),b1e='"',tor=b1e+" + ",ior=" + "+b1e;function vPt(i){return i.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function ror(i){return i.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function KVe(i){const e={expression:"",type:"none"};return i.labelExpressionInfo?i.labelExpressionInfo.value?(e.expression=i.labelExpressionInfo.value,e.type="conventional"):i.labelExpressionInfo.expression&&(e.expression=i.labelExpressionInfo.expression,e.type="arcade"):i.labelExpression!=null&&(e.expression=vPt(i.labelExpression),e.type="conventional"),e}function nor(i){const e=KVe(i);if(!e)return null;switch(e.type){case"conventional":return dLe(e.expression);case"arcade":return e.expression}return null}function sor(i){const e=KVe(i);if(!e)return null;switch(e.type){case"conventional":return aor(e.expression);case"arcade":return _Pt(e.expression)}return null}function dLe(i){let e;return i?(e=m0(i,t=>XVe+'$feature["'+t+'"]'+JVe),e=Wst.test(e)?e.replace(Wst,""):b1e+e,e=qst.test(e)?e.replace(qst,""):e+b1e,e=e.replaceAll(Qsr,tor).replaceAll(eor,ior)):e='""',e}const oor=/^\s*\{([^}]+)\}\s*$/i;function aor(i){return i?.match(oor)?.[1].trim()||null}const lor=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,uor=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,cor=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function _Pt(i){if(!i)return null;let e=lor.exec(i)||uor.exec(i);return e?e[1]||e[3]:(e=cor.exec(i),e?e[2]:null)}var pLe;let y4=pLe=class extends Ci{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(i,e){return e.value?dLe(e.value):i}writeExpression(i,e,t){this.value!=null&&(i=dLe(this.value)),i!=null&&(e[t]=i)}clone(){return new pLe({expression:this.expression,title:this.title,value:this.value})}};x([D({type:String,json:{write:{writerEnsuresNonNull:!0}}})],y4.prototype,"expression",void 0),x([Mi("expression",["expression","value"])],y4.prototype,"readExpression",null),x([ur("expression")],y4.prototype,"writeExpression",null),x([D({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],y4.prototype,"title",void 0),x([D({json:{read:!1,write:!1}})],y4.prototype,"value",void 0),y4=pLe=x([Qe("esri.layers.support.LabelExpressionInfo")],y4);const bPt=y4,wPt=[252,146,31,255],xPt={type:"esriSMS",style:"esriSMSCircle",size:6,color:wPt,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},SPt={type:"esriSLS",style:"esriSLSSolid",width:.75,color:wPt},TPt={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},hor={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},dor={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},por={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},mor={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},gor=Jh.fromJSON(xPt),CPt=vg.fromJSON(SPt),yor=Hx.fromJSON(TPt),vor=qB.fromJSON(hor),_or=Jh.fromJSON(dor),bor=vg.fromJSON(por),wor=Hx.fromJSON(mor);var fLe;const ohe=new Rs({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function ahe(i,e,t){return{enabled:!BEt(t?.layer)}}function EPt(i){return!i||i.origin!=="service"&&i.layer?.type!=="map-image"}function xor(i){return i?.type==="map-image"}function IPt(i){return!!xor(i)&&!!i.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function Sor(i){return EPt(i)||IPt(i?.layer)}let Ip=fLe=class extends Ci{static evaluateWhere(i,e){const t=(r,n,s)=>{switch(n){case"=":return r==s;case"<>":return r!=s;case">":return r>s;case">=":return r>=s;case"<":return rSor(t)?{allowNull:!0}:{enabled:!1}}}})],Ip.prototype,"labelExpressionInfo",void 0),x([ur("labelExpressionInfo")],Ip.prototype,"writeLabelExpressionInfo",null),x([D({type:ohe.apiValues,json:{type:ohe.jsonValues,read:ohe.read,write:ohe.write}})],Ip.prototype,"labelPlacement",void 0),x([D({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],Ip.prototype,"labelPosition",void 0),x([D({type:Number})],Ip.prototype,"maxScale",void 0),x([ur("maxScale")],Ip.prototype,"writeMaxScale",null),x([D({type:Number})],Ip.prototype,"minScale",void 0),x([ur("minScale")],Ip.prototype,"writeMinScale",null),x([D({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:ahe}}}}})],Ip.prototype,"repeatLabel",void 0),x([D({type:Number,cast:Cl,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:ahe}}}}})],Ip.prototype,"repeatLabelDistance",void 0),x([D({types:wer,json:{origins:{"web-scene":{types:xer,write:Bnt,default:null}},write:Bnt,default:null}})],Ip.prototype,"symbol",void 0),x([D({type:Boolean,json:{write:!0}})],Ip.prototype,"useCodedValues",void 0),x([D({type:String,json:{write:!0}})],Ip.prototype,"where",void 0),Ip=fLe=x([Qe("esri.layers.support.LabelClass")],Ip);const rT=Ip;var mLe;const Tor="esri.layers.support.FeatureReductionBinning";let c1=mLe=class extends GP{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(i,e,t){const r=i.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Qp(t,r,e)}readRenderer(i,e,t){const r=e.drawingInfo?.renderer;return r?sB(r,e,t)??void 0:V2e(e,t)}clone(){return new mLe({fields:li(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:li(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:li(this.popupTemplate),renderer:li(this.renderer)})}};x([Wr({binning:"binning"})],c1.prototype,"type",void 0),x([Wr({geohash:"geohash"})],c1.prototype,"binType",void 0),x([D({type:Number,range:{min:1,max:9},json:{write:!0}})],c1.prototype,"fixedBinLevel",void 0),x([D({type:[rT],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],c1.prototype,"labelingInfo",void 0),x([D(H3)],c1.prototype,"labelsVisible",void 0),x([D({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],c1.prototype,"maxScale",void 0),x([D(h_)],c1.prototype,"popupEnabled",void 0),x([D({type:qc,json:{name:"popupInfo",write:!0}})],c1.prototype,"popupTemplate",void 0),x([D({type:[lB],json:{write:!0}})],c1.prototype,"fields",void 0),x([ur("fields")],c1.prototype,"writeFields",null),x([D({types:IE,json:{write:{target:"drawingInfo.renderer"}}})],c1.prototype,"renderer",void 0),x([Mi("renderer",["drawingInfo.renderer"])],c1.prototype,"readRenderer",null),c1=mLe=x([Qe(Tor)],c1);const APt=c1;var gLe;const Cor="esri.layers.support.FeatureReductionCluster";function Yst(i){return i.type==="simple"&&!i.visualVariables?.length}let Wf=gLe=class extends Ci{constructor(i){super(i),this.type="cluster",this.clusterRadius=Cl("80px"),this.clusterMinSize=Cl("12px"),this.clusterMaxSize=Cl("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,e,t){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r?Yst(r)?null:sB(r,e,t)??void 0:V2e(e,t)}readSymbol(i,e,t){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r&&Yst(r)?sB(r,e,t)?.symbol:null}writeSymbol(i,e,t,r){const n=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||n){const s=new _x({symbol:i});e.drawingInfo={renderer:s.write({},r)}}}writeFields(i,e,t){const r=i.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Qp(t,r,e)}readFields(i,e,t){return i.filter(r=>!r.isAutoGenerated).map(r=>lB.fromJSON(r))}clone(){return new gLe({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:li(this.labelingInfo),labelsVisible:this.labelsVisible,fields:li(this.fields),maxScale:this.maxScale,renderer:li(this.renderer),symbol:li(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:li(this.popupTemplate)})}};x([D({type:["cluster"],readOnly:!0,json:{write:!0}})],Wf.prototype,"type",void 0),x([D({type:Number,cast:i=>i==="auto"?i:Cl(i),json:{write:!0}})],Wf.prototype,"clusterRadius",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],Wf.prototype,"clusterMinSize",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],Wf.prototype,"clusterMaxSize",void 0),x([D({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],Wf.prototype,"maxScale",void 0),x([D(h_)],Wf.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Wf.prototype,"popupTemplate",void 0),x([D({types:IE,json:{write:{target:"drawingInfo.renderer"}}})],Wf.prototype,"renderer",void 0),x([Mi("renderer",["drawingInfo.renderer"])],Wf.prototype,"readRenderer",null),x([D({types:_er})],Wf.prototype,"symbol",void 0),x([Mi("symbol",["drawingInfo.renderer"])],Wf.prototype,"readSymbol",null),x([ur("symbol")],Wf.prototype,"writeSymbol",null),x([D({type:[rT],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Wf.prototype,"labelingInfo",void 0),x([D(H3)],Wf.prototype,"labelsVisible",void 0),x([D({type:[lB],json:{write:!0}})],Wf.prototype,"fields",void 0),x([ur("fields")],Wf.prototype,"writeFields",null),x([Mi("fields")],Wf.prototype,"readFields",null),Wf=gLe=x([Qe(Cor)],Wf);const MPt=Wf;var yLe;let Bme=yLe=class extends GP{constructor(i){super(i),this.type="selection"}clone(){return new yLe}};x([D({type:["selection"]})],Bme.prototype,"type",void 0),Bme=yLe=x([Qe("esri.layers.support.FeatureReductionSelection")],Bme);const vLe=Bme,Xst={key:"type",base:GP,typeMap:{cluster:MPt,binning:APt}},Eor={types:{key:"type",base:GP,typeMap:{selection:vLe,cluster:MPt,binning:APt}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:Xst},"portal-item":{types:Xst},"web-scene":{types:{key:"type",base:GP,typeMap:{selection:vLe}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:Wv}}}}},f5={Base64:0,Hex:1,String:2,Raw:3},GV=8,OPt=(1<>16)+(e>>16)+(t>>16)<<16|65535&t}function Ior(i){const e=[];for(let t=0,r=i.length*GV;t>5]|=(i.charCodeAt(t/GV)&OPt)<>5]>>>t%32&OPt));return e.join("")}function Mor(i){const e="0123456789abcdef",t=[];for(let r=0,n=4*i.length;r>2]>>r%4*8+4&15)+e.charAt(i[r>>2]>>r%4*8&15));return t.join("")}function Oor(i){const e="=",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[];for(let n=0,s=4*i.length;n>2]>>n%4*8&255)<<16|(i[n+1>>2]>>(n+1)%4*8&255)<<8|i[n+2>>2]>>(n+2)%4*8&255;for(let a=0;a<4;a++)8*n+6*a>32*i.length?r.push(e):r.push(t.charAt(o>>6*(3-a)&63))}return r.join("")}function Por(i,e){return i<>>32-e}function H2e(i,e,t,r,n,s){return tF(Por(tF(tF(e,i),tF(r,s)),n),t)}function P0(i,e,t,r,n,s,o){return H2e(e&t|~e&r,i,e,n,s,o)}function R0(i,e,t,r,n,s,o){return H2e(e&r|t&~r,i,e,n,s,o)}function D0(i,e,t,r,n,s,o){return H2e(e^t^r,i,e,n,s,o)}function F0(i,e,t,r,n,s,o){return H2e(t^(e|~r),i,e,n,s,o)}function Ror(i,e){i[e>>5]|=128<>>9<<4)]=e;let t=1732584193,r=-271733879,n=-1732584194,s=271733878;for(let o=0;odi.getLogger("esri.views.2d.layers.support.clusterUtils");yi.add("esri-cluster-arcade-enabled",!0);const For=yi("esri-cluster-arcade-enabled"),kor=new Set(["simple-line","simple-fill","picture-fill"]);function Jst(i,e){let t=e.clone();if(!Lor(t))return t;if(e.getSymbols().some(r=>kor.has(r.type))&&(t=new _x({symbol:new Jh})),t.authoringInfo||(t.authoringInfo=new vae),t.authoringInfo.isAutoGenerated=!0,"visualVariables"in t){const r=(t.visualVariables||[]).filter(n=>n.valueExpression!=="$view.scale");r.forEach(n=>{n.type==="rotation"?n.field?n.field=jL(i,n.field,"avg_angle","number"):n.valueExpression&&(n.field=kJ(i,n.valueExpression,"avg_angle","number"),n.valueExpression=null):n.normalizationField?(n.field=jL(i,n.field,"avg_norm","number",n.normalizationField),n.normalizationField=null):n.field?n.field=jL(i,n.field,"avg","number"):n.valueExpression&&(n.field=kJ(i,n.valueExpression,"avg","number"),n.valueExpression=null)}),t.visualVariables=r}switch(t.type){case"simple":break;case"pie-chart":for(const r of t.attributes)r.field?r.field=jL(i,r.field,"sum","number"):r.valueExpression&&(r.field=kJ(i,r.valueExpression,"sum","number"),r.valueExpression=null);break;case"unique-value":t.field?t.field=jL(i,t.field,"mode","string"):t.valueExpression&&(t.field=kJ(i,t.valueExpression,"mode","string"),t.valueExpression=null);break;case"class-breaks":t.normalizationField?(t.field=jL(i,t.field,"avg_norm","number",t.normalizationField),t.normalizationField=null):t.field?t.field=jL(i,t.field,"avg","number"):t.valueExpression&&(t.field=kJ(i,t.valueExpression,"avg","number"),t.valueExpression=null)}return t}const Lor=i=>{const e=t=>Dor().error(new qe("Unsupported-renderer",t,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return e("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const t=i.normalizationType;if(t!=="field")return e(`FeatureReductionCluster does not support a normalizationType of ${t}`),!1}break;case"simple":case"pie-chart":break;default:return e(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!For){if("valueExpression"in i&&i.valueExpression)return e("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(t=>!(!("valueExpression"in t)||!t.valueExpression)))return e("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function Nor(i,e,t){switch(i){case"sum":return`cluster_sum_${e}`;case"avg":case"avg_angle":return`cluster_avg_${e}`;case"mode":return`cluster_type_${e}`;case"avg_norm":{const r=t,n="field",s=e.toLowerCase()+",norm:"+n+","+r.toLowerCase();return"cluster_avg_"+Eae(s)}}}function kJ(i,e,t,r){const n=Eae(e),s=t==="mode"?`cluster_type_${n}`:t==="sum"?`cluster_sum_${n}`:`cluster_avg_${n}`;return i.some(o=>o.name===s)||i.push(new lB({name:s,isAutoGenerated:!0,onStatisticExpression:new YVe({expression:e,returnType:r}),statisticType:t})),s}function jL(i,e,t,r,n){if(e==="cluster_count"||i.some(o=>o.name===e))return e;const s=Nor(t,e,n);return i.some(o=>o.name===s)||(t==="avg_norm"?i.push(new lB({name:s,isAutoGenerated:!0,onStatisticExpression:new YVe({expression:`$feature.${e} / $feature.${n}`,returnType:r}),statisticType:"avg"})):i.push(new lB({name:s,isAutoGenerated:!0,onStatisticField:e,statisticType:t}))),s}const NY=i=>{let e=class extends i{constructor(...t){super(...t),this.addHandles(Ki(()=>this.renderer,()=>{if(this.featureReduction){const r=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",r)}},Kl))}set featureReduction(t){const r=this._normalizeFeatureReduction(t);this._set("featureReduction",r)}set renderer(t){}_withClusterVariable(t,r,n){const s=t.clone();return"visualVariables"in s&&(s.visualVariables||(s.visualVariables=[]),s.visualVariables.some(o=>o.type==="size")||s.visualVariables.push(new CY({field:"cluster_count",stops:[new bme({value:1}),new bme({useMinValue:!0,size:r}),new bme({useMaxValue:!0,size:n})]}))),s}_normalizeFeatureReduction(t){if(t?.type!=="cluster")return t;const r=t.clone(),n=[new lB({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],s=(r.fields??[]).filter(h=>!h.isAutoGenerated),o=t.renderer&&!t.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:a,clusterMaxSize:l}=r;if(o){r.fields=[...n,...s];const h=this._withClusterVariable(r.renderer,a,l);return r.effectiveFeatureRenderer=h,r.effectiveClusterRenderer=h,r}if(t.symbol){if(r.fields=[...n,...s],r.renderer=null,!this.renderer)return r.effectiveFeatureRenderer=null,r.effectiveClusterRenderer=null,r;const h=Jst(n,this.renderer),p=this._withClusterVariable(h,a,l),m="visualVariables"in p&&p.visualVariables?p.visualVariables:[],v=new _x({symbol:t.symbol,visualVariables:m});return r.fields=[...n,...s],r.effectiveFeatureRenderer=p,r.effectiveClusterRenderer=v,r}if(!this.renderer)return t;const u=Jst(n,this.renderer);r.fields=[...n,...s],r.renderer=u;const c=this._withClusterVariable(u,a,l);return r.effectiveFeatureRenderer=c,r.effectiveClusterRenderer=c,r}};return x([D(Eor)],e.prototype,"featureReduction",null),e=x([Qe("esri.layers.mixins.FeatureReductionLayer")],e),e},Kst={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},Zst={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},Qst={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},$or={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":Kst,"web-map/basemap":Zst,"web-map/tables":Qst,"link-chart/operational-layers":{...Kst,LinkChartLayer:!0},"link-chart/basemap":Zst,"link-chart/tables":Qst,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}},Rc=i=>{let e=class extends i{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(t,r,n){return n?.portalItem?.type==="Group Layer"?void 0:t}writeListMode(t,r,n,s){(s&&s.layerContainerType==="ground"||t&&zCt(this,n,{},s))&&(r[n]=t)}writeOperationalLayerType(t,r,n,s){t&&s?.layerContainerType!=="tables"&&(r.layerType=t)}writeTitle(t,r){r.title=t??"Layer"}read(t,r){r&&(r.layer=this),cWi(this,t,n=>super.read(t,n),r)}write(t,r){if(!this.persistenceEnabled)return null;if(r?.origin){const o=`${r.origin}/${r.layerContainerType||"operational-layers"}`;let l=!!$or[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(l=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(l=!1),!l)return r.messages?.push(new qe("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const n=super.write(t,{...r,layer:this}),s=!!r&&!!r.messages&&!!r.messages.filter(o=>o instanceof qe&&o.name==="web-document-write:property-required").length;return aR(n?.url)?(r?.messages?.push(new qe("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:n}beforeSave(){}};return x([D({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],e.prototype,"id",void 0),x([Mi("id",["id"])],e.prototype,"readId",null),x([D(ePt)],e.prototype,"listMode",void 0),x([ur("listMode")],e.prototype,"writeListMode",null),x([D({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:Wv}}}}})],e.prototype,"operationalLayerType",void 0),x([ur("operationalLayerType")],e.prototype,"writeOperationalLayerType",null),x([D(aB)],e.prototype,"opacity",void 0),x([D({type:Boolean,readOnly:!1})],e.prototype,"persistenceEnabled",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],e.prototype,"title",void 0),x([ur("title"),ur(["web-scene"],"title")],e.prototype,"writeTitle",null),x([D({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:Wv}}},name:"visibility",write:!0}})],e.prototype,"visible",void 0),e=x([Qe("esri.layers.mixins.OperationalLayer")],e),e};var _Le;const $3e=new Rs({asc:"ascending",desc:"descending"});let HG=_Le=class extends Ci{constructor(i){super(i),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new _Le({field:this.field,valueExpression:this.valueExpression,order:this.order})}};x([D({type:String,json:{write:!0}})],HG.prototype,"field",void 0),x([D({type:String,json:{write:!0}})],HG.prototype,"valueExpression",void 0),x([D({type:$3e.apiValues,json:{read:$3e.read,write:$3e.write}})],HG.prototype,"order",void 0),HG=_Le=x([Qe("esri.layers.support.OrderByInfo")],HG);const W2e=HG;function Bor(i,e,t){if(!i)return null;const r=i.find(s=>!!s.field);if(!r)return null;const n=new W2e;return n.read(r,t),[n]}function jor(i,e,t,r){const n=i.find(s=>!!s.field);n&&Qp(t,[n.toJSON()],e)}const Iae=i=>{let e=class extends i{constructor(){super(...arguments),this.orderBy=null}};return x([D({type:[W2e],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:Bor},write:{target:"layerDefinition.orderBy",writer:jor}}})],e.prototype,"orderBy",void 0),e=x([Qe("esri.layers.mixins.OrderedLayer")],e),e},_D=Td.radius,fT=Td.eccentricitySquared,Gor={a1:_D*fT,a2:_D*fT*_D*fT,a3:_D*fT*fT/2,a4:_D*fT*_D*fT*2.5,a5:_D*fT+_D*fT*fT/2,a6:1-fT};1/294.9786982,1/298.257222101,Td.radius,Td.flattening,1/298.257222101,VF.radius,VF.flattening,1/192.0430107526882,GA.radius,GA.flattening,1/10.2079945799458,1/43.61604095563141,GA.radius;var Gi;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",i[i.WGS84=2]="WGS84",i[i.WEB_MERCATOR=3]="WEB_MERCATOR",i[i.WGS84_ECEF=4]="WGS84_ECEF",i[i.CGCS2000=5]="CGCS2000",i[i.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",i[i.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",i[i.GCSMARS2000=8]="GCSMARS2000",i[i.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",i[i.GCSMOON2000=10]="GCSMOON2000",i[i.LON_LAT=11]="LON_LAT",i[i.PLATE_CARREE=12]="PLATE_CARREE"})(Gi||(Gi={}));const Lz={[Gi.WGS84]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:jne,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.CGCS2000]:{[Gi.CGCS2000]:th,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:p8},[Gi.GCSMARS2000]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:th,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:tot,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.GCSMOON2000]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:th,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:eot,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.WEB_MERCATOR]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:Rie,[Gi.WGS84_COMPARABLE_LON_LAT]:Rie,[Gi.SPHERICAL_ECEF]:zor,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:th,[Gi.PLATE_CARREE]:Wor,[Gi.WGS84]:Rie,[Gi.WGS84_ECEF]:Vor},[Gi.WGS84_ECEF]:{[Gi.CGCS2000]:f8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:f8,[Gi.WGS84_COMPARABLE_LON_LAT]:f8,[Gi.SPHERICAL_ECEF]:tar,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:iar,[Gi.PLATE_CARREE]:qor,[Gi.WGS84]:f8,[Gi.WGS84_ECEF]:th},[Gi.SPHERICAL_ECEF]:{[Gi.CGCS2000]:d8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:d8,[Gi.WGS84_COMPARABLE_LON_LAT]:d8,[Gi.SPHERICAL_ECEF]:th,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:Zor,[Gi.PLATE_CARREE]:Yor,[Gi.WGS84]:d8,[Gi.WGS84_ECEF]:Qor},[Gi.SPHERICAL_MARS_PCPF]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:rot,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:rot,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:th,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.SPHERICAL_MOON_PCPF]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:iot,[Gi.LON_LAT]:iot,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:th,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.UNKNOWN]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:null,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:th,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.LON_LAT]:{[Gi.CGCS2000]:th,[Gi.GCSMARS2000]:th,[Gi.GCSMOON2000]:th,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:tot,[Gi.SPHERICAL_MOON_PCPF]:eot,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:jne,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.WGS84_COMPARABLE_LON_LAT]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.PLATE_CARREE]:{[Gi.CGCS2000]:h8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:h8,[Gi.WGS84_COMPARABLE_LON_LAT]:h8,[Gi.SPHERICAL_ECEF]:Xor,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:Jor,[Gi.PLATE_CARREE]:th,[Gi.WGS84]:h8,[Gi.WGS84_ECEF]:Kor}};function Uor(i){const e=Bne(i,RPt);return Lz[e][Gi.WGS84_COMPARABLE_LON_LAT]}function q2e(i,e,t=PPt()){return i==null||e==null?null:rar(i,e,t).projector}function Bne(i,e){return i?e.spatialReference===i?e.spatialReferenceId:(e.spatialReference=i,"metersPerUnit"in e&&(e.metersPerUnit=pu(i,1)),$ve(i)?e.spatialReferenceId=Gi.SPHERICAL_ECEF:fE(i)?e.spatialReferenceId=Gi.WGS84:Nb(i)?e.spatialReferenceId=Gi.WEB_MERCATOR:c5e(i)?e.spatialReferenceId=Gi.PLATE_CARREE:i.wkt===gie.wkt?e.spatialReferenceId=Gi.WGS84_ECEF:i.wkid===Y9.CGCS2000?e.spatialReferenceId=Gi.CGCS2000:i.wkt===a2e.wkt?e.spatialReferenceId=Gi.SPHERICAL_MARS_PCPF:i.wkt===l2e.wkt?e.spatialReferenceId=Gi.SPHERICAL_MOON_PCPF:dze(i)?e.spatialReferenceId=Gi.GCSMARS2000:pze(i)?e.spatialReferenceId=Gi.GCSMOON2000:e.spatialReferenceId=Gi.UNKNOWN):Gi.UNKNOWN}function th(i,e,t,r){i!==t&&(t[r++]=i[e++],t[r++]=i[e++],t[r]=i[e])}function Rie(i,e,t,r){t[r]=SW*(i[e]/Z8),t[r+1]=SW*(FPt-2*Math.atan(Math.exp(-i[e+1]/Z8))),t[r+2]=i[e+2]}function zor(i,e,t,r){const n=i[e]/Z8,s=FPt-2*Math.atan(Math.exp(-i[e+1]/Z8)),o=Z8+i[e+2],a=Math.cos(s)*o;t[r]=Math.cos(n)*a,t[r+1]=Math.sin(n)*a,t[r+2]=Math.sin(s)*o}function Vor(i,e,t,r){Rie(i,e,t,r),p8(t,r,t,r)}function Hor(i,e,t,r,n){const s=.4999999*Y2e,o=uu(xW*i[e+1],-s,s),a=Math.sin(o);t[r++]=xW*i[e]*n.radius,t[r++]=n.halfSemiMajorAxis*Math.log((1+a)/(1-a)),t[r]=i[e+2]}function jne(i,e,t,r){Hor(i,e,t,r,Td)}function c8(i,e,t,r){t[r]=i[e]*not,t[r+1]=i[e+1]*not,t[r+2]=i[e+2]}function h8(i,e,t,r){t[r]=i[e]*sot,t[r+1]=i[e+1]*sot,t[r+2]=i[e+2]}function Wor(i,e,t,r){Rie(i,e,t,r),c8(t,r,t,r)}function qor(i,e,t,r){f8(i,e,t,r),c8(t,r,t,r)}function Yor(i,e,t,r){d8(i,e,t,r),c8(t,r,t,r)}function Xor(i,e,t,r){h8(i,e,t,r),Nz(t,r,t,r)}function Jor(i,e,t,r){h8(i,e,t,r),jne(t,r,t,r)}function Kor(i,e,t,r){h8(i,e,t,r),p8(t,r,t,r)}function ZVe(i,e,t,r,n){const s=n+i[e+2],o=xW*i[e+1],a=xW*i[e],l=Math.cos(o)*s;t[r]=Math.cos(a)*l,t[r+1]=Math.sin(a)*l,t[r+2]=Math.sin(o)*s}function eot(i,e,t,r){ZVe(i,e,t,r,VF.radius)}function tot(i,e,t,r){ZVe(i,e,t,r,GA.radius)}function Nz(i,e,t,r){ZVe(i,e,t,r,Td.radius)}function QVe(i,e,t,r,n){const s=i[e],o=i[e+1],a=i[e+2],l=Math.sqrt(s*s+o*o+a*a),u=iIt(a/(l===0?1:l)),c=Math.atan2(o,s);t[r++]=SW*c,t[r++]=SW*u,t[r]=l-n}function iot(i,e,t,r){QVe(i,e,t,r,VF.radius)}function rot(i,e,t,r){QVe(i,e,t,r,GA.radius)}function d8(i,e,t,r){QVe(i,e,t,r,Td.radius)}function Zor(i,e,t,r){d8(i,e,t,r),jne(t,r,t,r)}function Qor(i,e,t,r){d8(i,e,t,r),p8(t,r,t,r)}function ear(i,e,t,r,n){const s=xW*i[e],o=xW*i[e+1],a=i[e+2],l=Math.sin(o),u=Math.cos(o),c=n.radius/Math.sqrt(1-n.eccentricitySquared*l*l);t[r++]=(c+a)*u*Math.cos(s),t[r++]=(c+a)*u*Math.sin(s),t[r++]=(c*(1-n.eccentricitySquared)+a)*l}function p8(i,e,t,r){ear(i,e,t,r,Td)}function f8(i,e,t,r){const n=Gor,s=i[e],o=i[e+1],a=i[e+2];let l,u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne;l=Math.abs(a),u=s*s+o*o,c=Math.sqrt(u),h=u+a*a,p=Math.sqrt(h),re=Math.atan2(o,s),m=a*a/h,v=u/h,B=n.a2/p,$=n.a3-n.a4/p,v>.3?(w=l/p*(1+v*(n.a1+B+m*$)/p),Q=Math.asin(w),I=w*w,S=Math.sqrt(1-I)):(S=c/p*(1-m*(n.a5-B-v*$)/p),Q=Math.acos(S),I=1-S*S,w=Math.sqrt(I)),R=1-Td.eccentricitySquared*I,L=Td.radius/Math.sqrt(R),k=n.a6*L,B=c-L*S,$=l-k*w,Y=S*B+w*$,V=S*$-w*B,K=V/(k/R+Y),Q+=K,ne=Y+V*K/2,a<0&&(Q=-Q),t[r++]=SW*re,t[r++]=SW*Q,t[r]=ne}function tar(i,e,t,r){f8(i,e,t,r),Nz(t,r,t,r)}function iar(i,e,t,r){f8(i,e,t,r),jne(t,r,t,r)}function rar(i,e,t){if(i==null||e==null||t.source.spatialReference===i&&t.dest.spatialReference===e)return t;const r=Bne(i,t.source),n=Bne(e,t.dest);return r===Gi.UNKNOWN&&n===Gi.UNKNOWN?Ya(i,e)?t.projector=th:t.projector=null:t.projector=Lz[r][n],t}function PPt(){return{source:{spatialReference:null,spatialReferenceId:Gi.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:Gi.UNKNOWN,metersPerUnit:1},projector:th}}const RPt={spatialReference:null,spatialReferenceId:Gi.UNKNOWN},nar={spatialReference:null,spatialReferenceId:Gi.UNKNOWN},DPt=PPt(),xW=Rx(1),SW=yb(1),Y2e=Math.PI,FPt=.5*Y2e,Z8=Td.radius,not=Z8*Y2e/180,sot=180/(Z8*Y2e);function sy(i,e,t,r,n,s,o=1){const a=q2e(e,n,DPt);if(a==null)return!1;if(a===th){if(i===r&&t===s)return!0;const u=t+3*o;for(let c=t,h=s;c=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,r){this._cachedProjection[EQ.cacheKey(e,t)]=r}getCachedGeTransformation(e,t){let r="";for(const s of this.steps)r+=s.uid.toString()+",";r!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=r);const n=this._cachedProjection[EQ.cacheKey(e,t)];return n===void 0?null:n}},XC=null,ek=null,Die=null,jme={};const eHe=new pY;function qx(){return!!XC&&hze()}function kPt(){return!!qx()||(Ws(eHe),FS(),!1)}function LPt(i,e){return!i||!e||_0(i,e)||kPt()}function oar(i,e){return!_0(i,e)&&!qx()}function FS(i){return Die==null&&(Die=Promise.all([fEt(),Promise.resolve().then(()=>d7r).then(e=>e.g),Promise.resolve().then(()=>Non)])),Die.then(([,e,{hydratedAdapter:t}])=>{hn(i),ek=t,XC=e.default,XC._enableProjection(Eqi),eHe.notify()})}function Wc(i,e,t=null,r=null){return Array.isArray(i)?i.length===0?[]:TW(ek,i,i[0].spatialReference,e,t,r):TW(ek,[i],i.spatialReference,e,t,r)[0]}function TW(i,e,t,r,n=null,s=null){if(t==null||r==null)return e;if(_0(t,r,n))return e.map(o=>Fie(o,t,r));if(n==null&&$ve(t))return e.map(o=>Fie(o,t,Xi.WGS84)).map(o=>CW(o,r));if(n==null&&$ve(r))return e.map(o=>CW(o,Xi.WGS84)).map(o=>Fie(o,Xi.WGS84,r));if(n==null){const o=Gne.cacheKey(t,r);jme[o]!==void 0?n=jme[o]:((n=Une(t,r,void 0))==null&&(n=new Gne),jme[o]=n)}if(XC==null||i==null)throw new X2e;return s!=null?XC._project(i,e,t,r,n,s):XC._project(i,e,t,r,n)}function kx(i,e){const t=tHe([i],e);return t.pending!=null?{pending:t.pending,geometry:null}:t.geometries!=null?{pending:null,geometry:t.geometries[0]}:{pending:null,geometry:null}}function tHe(i,e){if(!qx()){for(const t of i)if(t!=null&&!Ya(t.spatialReference,e)&&Cm(t.spatialReference)&&Cm(e)&&!_0(t.spatialReference,e))return Ws(eHe),{pending:FS(),geometries:null}}return{pending:null,geometries:i.map(t=>t==null?null:Ya(t.spatialReference,e)?t:Cm(t.spatialReference)&&Cm(e)?CW(t,e):null)}}function Une(i,e,t=null){if(i==null||e==null)return null;if(XC==null||ek==null)throw new X2e;const r=XC._getTransformation(ek,i,e,t,t?.spatialReference);return r!==null?Gne.fromGE(r):null}function aar(i,e,t=null){if(XC==null||ek==null)throw new X2e;const r=XC._getTransformationBySuitability(ek,i,e,t,t?.spatialReference);if(r!==null){const n=[];for(const s of r)n.push(Gne.fromGE(s));return n}return[]}let X2e=class extends qe{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}};function lar(){XC=null,ek=null,Die=null,jme={}}const uar={get loadPromise(){return Die}};function CW(i,e){try{const t=Wc(i,e);if(t==null)return null;"xmin"in i&&"xmin"in t&&(t.zmin=i.zmin,t.zmax=i.zmax);const r=IY(t.type,i.spatialReference,e);return r?.(t),t}catch(t){if(!(t instanceof X2e))throw t;return null}}async function car(i,e,t){const r=i.spatialReference;return r!=null&&e!=null&&await Lx(r,e,null,t),CW(i,e)}function _0(i,e,t){return!t&&(!!Ya(i,e)||Cm(i)&&Cm(e)&&!!q2e(i,e,DPt))}async function Lx(i,e,t,r){if(qx())return vve(r);if(Array.isArray(i)){for(const{source:n,dest:s,geographicTransformation:o}of i)if(n&&s&&!_0(n,s,o))return FS(r)}else if(i&&e&&!_0(i,e,t))return FS(r);return vve(r)}function Fie(i,e,t){return i?"x"in i?NPt(i,e,new $i,t,0):"xmin"in i?GPt(i,e,new hr,t,0):"rings"in i?jPt(i,e,new $s,t,0):"paths"in i?BPt(i,e,new lo,t,0):"points"in i?$Pt(i,e,new Oh,t,0):null:null}function har(i,e,t=e.spatialReference,r=0){return t!=null&&i.spatialReference!=null&&NPt(i,i.spatialReference,e,t,r)!=null}function NPt(i,e,t,r,n){bv[0]=i.x,bv[1]=i.y;const s=i.z;return bv[2]=s!==void 0?s:n,sy(bv,e,0,bv,r,0,1)?(t.x=bv[0],t.y=bv[1],t.spatialReference=r,s!==void 0||HF(r)?(t.z=bv[2],t.hasZ=!0):(t.z=void 0,t.hasZ=!1),i.m===void 0?(t.m=void 0,t.hasM=!1):(t.m=i.m,t.hasM=!0),t):null}function dar(i,e,t=e.spatialReference,r=0){return i.spatialReference!=null&&t!=null&&$Pt(i,i.spatialReference,e,t,r)!=null}function $Pt(i,e,t,r,n){const{points:s,hasZ:o,hasM:a}=i,l=[],u=s.length,c=[];for(const p of s)c.push(p[0],p[1],o?p[2]:n);if(!sy(c,e,0,c,r,0,u))return null;const h=o||HF(r);for(let p=0;p-1&&t.splice(r,1)}}async function J2e(i){const e=i.clone().normalize();let t;if(e.length>1)for(const r of e)t?r.width>t.width&&(t=r):t=r;else t=e[0];return yar(t)}const _b={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function lot(i){const{portal:e,isOrgItem:t,itemControl:r}=i,n=e.user?.privileges;let s=!n||n.includes("features:user:edit"),o=!!t&&!!n?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}const Yc=i=>{let e=class extends i{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=zo(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,r,n){if(r.itemId)return new yg({id:r.itemId,portal:n?.portal})}writePortalItem(t,r){t?.id&&(r.itemId=t.id)}async loadFromPortal(t,r){if(this.portalItem?.id)try{const{load:n}=await Promise.resolve().then(()=>Jon);return hn(r),await n({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap},r)}catch(n){throw mo(n)||di.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) - ${n}`),n}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(r=>(_a(r),!0)))}async setUserPrivileges(t,r){if(!Ho.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:n,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(t,r);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(n){_a(n)}}async _fetchUserPrivileges(t,r){let n=this.portalItem;if(!t||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(r);const s=t===n.id;if(s&&n.portal.user)return lot(n);let o,a;if(s)o=n.portal.url;else try{o=await jEt(this.url,r)}catch(h){_a(h)}if(!o||!MWi(o,n.portal.url))return this._fetchFallbackUserPrivileges(r);try{const h=r!=null?r.signal:null;a=await no?.getCredential(`${o}/sharing`,{prompt:!1,signal:h})}catch(h){_a(h)}const l=!0,u=!1,c=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:c}};try{if(s?await n.reload():(n=new yg({id:t,portal:{url:o}}),await n.load(r)),n.portal.user)return lot(n)}catch(h){_a(h)}return{features:{edit:l,fullEdit:u},content:{updateItem:c}}}async _fetchFallbackUserPrivileges(t){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(t)}catch(n){_a(n)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const r=this.url?no?.findCredential(this.url):null;if(!r)return!0;const n=che.credential===r?che.user:await this._fetchEditingUser(t);return che.credential=r,che.user=n,n?.privileges==null||n.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const r=this.portalItem?.portal?.user;if(r)return r;const n=no.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const s=`${n.owningSystemUrl}/sharing/rest`,o=Bu.getDefault();if(o&&o.loaded&&X1(o.restUrl)===X1(s))return o.user;const a=`${s}/community/self`,l=t!=null?t.signal:null,u=await Uk(zi(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return u.ok?wze.fromJSON(u.value.data):null}read(t,r){r&&(r.layer=this),super.read(t,r)}write(t,r){const n=r?.portal,s=this.portalItem?.id&&(this.portalItem.portal||Bu.getDefault());return n&&s&&!eze(s.restUrl,n.restUrl)?(r.messages&&r.messages.push(new qe("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...r,layer:this})}};return x([D({type:yg})],e.prototype,"portalItem",null),x([Mi("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),x([ur("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),x([D({clonable:!1})],e.prototype,"resourceReferences",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=x([Qe("esri.layers.mixins.PortalLayer")],e),e},che={credential:null,user:null};let IQ=class extends un{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};x([D()],IQ.prototype,"updating",void 0),x([D()],IQ.prototype,"status",void 0),IQ=x([Qe("esri.layers.support.PublishingInfo")],IQ);const _ar=IQ,zPt="esri.layers.mixins.PublishableLayer",bar=Symbol(zPt),war=i=>{var e;let t=class extends i{constructor(){super(...arguments),this[e]=!0}get publishingInfo(){if(this.destroyed)return null;const r=this._get("publishingInfo");if(r)return r;const n=new _ar;return this._checkPublishingStatus(n),n}_checkPublishingStatus(r){let o=0;const a=async u=>{let c;r.updating=!0;try{c=await this.fetchPublishingStatus()}catch{c="unavailable"}c!=="published"&&c!=="unavailable"||(r.status==="publishing"&&this.refresh(),l.remove()),r.status=c,r.updating=!1,l.removed||(o=setTimeout(a,u,u+125))},l={removed:!1,remove(){this.removed=!0,clearTimeout(o)}};this.when().catch(()=>l.remove()),a(250),this.addHandles(l)}};return e=bar,x([D({readOnly:!0,clonable:!1})],t.prototype,"publishingInfo",null),t=x([Qe(zPt)],t),t},iF=new dr,kie=new WeakMap;function xar(i){Tar(i)&&iF.push(new WeakRef(i))}function Sar(i){const e=iF.find(t=>t.deref()===i);e&&iF.remove(e)}function Tar(i){return i!=null&&typeof i=="object"&&"refreshInterval"in i&&"refresh"in i}function VPt(i,e){return Number.isFinite(i)&&Number.isFinite(e)?e<=0?i:VPt(e,i%e):0}let j3e=0,hhe=0;function Car(){const i=Date.now();let e=!1;for(const t of iF){const r=t.deref();r?r.refreshInterval&&i-(kie.get(r)??0)+5>=6e4*r.refreshInterval&&(kie.set(r,i),r.refresh(i)):e=!0}if(e)for(let t=iF.length-1;t>=0;t--)iF.at(t).deref()||iF.removeAt(t)}vCt(()=>{const i=Date.now();let e=0;for(const t of iF){const r=t.deref();r&&(e=VPt(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?kie.get(r)||kie.set(r,i):kie.delete(r))}if(e!==hhe){if(hhe=e,clearInterval(j3e),hhe===0)return void(j3e=0);j3e=setInterval(Car,hhe)}});const uot=.1,fy=i=>{let e=class extends i{constructor(...t){super(...t),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=xd(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||xar(this)},()=>{})}destroy(){Sar(this)}castRefreshInterval(t){return t>=uot?t:t<=0?0:uot}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(t=Date.now()){NP(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",t),this.emit("refresh",{dataChanged:r})},r=>{di.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){const t=this;return{set refreshInterval(r){t._set("refreshInterval",r)}}}};return x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:Wv}}}}})],e.prototype,"refreshInterval",void 0),x([So("refreshInterval")],e.prototype,"castRefreshInterval",null),x([D({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),x([D({readOnly:!0})],e.prototype,"refreshParameters",null),e=x([Qe("esri.layers.mixins.RefreshableLayer")],e),e},uc=i=>{let e=class extends i{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const t={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&Ear(t,r.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===t.minScale&&n.maxScale===t.maxScale?n:t}};return x([D({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),x([D({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=x([Qe("esri.layers.mixins.ScaleRangeLayer")],e),e};function Ear(i,e){return i.minScale=i.minScale>0?e.minScale>0?Math.min(i.minScale,e.minScale):i.minScale:e.minScale,i.maxScale=i.maxScale>0?e.maxScale>0?Math.max(i.maxScale,e.maxScale):i.maxScale:e.maxScale,i}const HPt=pa()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let AQ=class extends xs(Ci){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return vsr(this.value,this.unit,"milliseconds")}};x([Wr(HPt,{nonNullable:!0})],AQ.prototype,"unit",void 0),x([D({type:Number,json:{write:!0},nonNullable:!0})],AQ.prototype,"value",void 0),AQ=x([Qe("esri.TimeInterval")],AQ);const zne=AQ;function cot(i,e){return zne.fromJSON({value:i,unit:e})}let W0=class extends xs(Ci){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||t.timeExtent.length!==2)return null;const r=new Date(t.timeExtent[0]),n=new Date(t.timeExtent[1]);return new Eg({start:r,end:n})}writeFullTimeExtent(e,t){e?.start!=null&&e.end!=null?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?cot(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?cot(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};x([D({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],W0.prototype,"cumulative",void 0),x([D({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],W0.prototype,"endField",void 0),x([D({type:Eg,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"fullTimeExtent",void 0),x([Mi("fullTimeExtent",["timeExtent"])],W0.prototype,"readFullTimeExtent",null),x([ur("fullTimeExtent")],W0.prototype,"writeFullTimeExtent",null),x([D({type:Boolean,json:{write:!0}})],W0.prototype,"hasLiveData",void 0),x([D({type:zne,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"interval",void 0),x([Mi("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],W0.prototype,"readInterval",null),x([ur("interval")],W0.prototype,"writeInterval",null),x([D({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],W0.prototype,"startField",void 0),x([D(XF("timeReference",!0))],W0.prototype,"timeZone",void 0),x([D({type:String,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"trackIdField",void 0),x([D({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],W0.prototype,"useTime",void 0),W0=x([Qe("esri.layers.support.TimeInfo")],W0);const K2e=W0,AE=i=>{let e=class extends i{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(t,r){const n=r.timeInfo.exportOptions;if(!n)return null;const s=n.timeOffset,o=HPt.fromJSON(n.timeOffsetUnits);return s&&o?new zne({value:s,unit:o}):null}set timeInfo(t){pR(t,this.fieldsIndex),this._set("timeInfo",t)}};return x([D({type:Eg,json:{write:!1}})],e.prototype,"timeExtent",void 0),x([D({type:zne})],e.prototype,"timeOffset",void 0),x([Mi("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),x([D({value:null,type:K2e,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),x([D({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=x([Qe("esri.layers.mixins.TemporalLayer")],e),e},hot=new Rs({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let v4=class extends xs(Ci){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};x([D({json:{write:!0}})],v4.prototype,"name",void 0),x([D({json:{write:!0}})],v4.prototype,"description",void 0),x([D({json:{read:hot.read,write:hot.write}})],v4.prototype,"drawingTool",void 0),x([D({json:{write:!0}})],v4.prototype,"prototype",void 0),x([D({json:{write:!0}})],v4.prototype,"thumbnail",void 0),v4=x([Qe("esri.layers.support.FeatureTemplate")],v4);const $Y=v4;let ZM=class extends xs(Ci){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=j2e(e[r]);return t}writeDomains(e,t){const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());t.domains=r}};x([D({json:{write:!0}})],ZM.prototype,"id",void 0),x([D({json:{write:!0}})],ZM.prototype,"name",void 0),x([D({json:{write:!0}})],ZM.prototype,"domains",void 0),x([Mi("domains")],ZM.prototype,"readDomains",null),x([ur("domains")],ZM.prototype,"writeDomains",null),x([D({type:[$Y],json:{write:!0}})],ZM.prototype,"templates",void 0),ZM=x([Qe("esri.layers.support.FeatureType")],ZM);const Aae=ZM;function nT(){return{fields:{type:[Fo],value:null,set:function(i){if(i&&yi("big-integer-warning-enabled")){const e=i.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(e.length){const t=e.map(r=>`'${r.name}'`).join(", ");di.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",i)}},fieldsIndex:{readOnly:!0,get(){return Cd.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(i){this._userOutFields=i,this.notifyChange("outFields")},get:function(){const i=this._userOutFields;if(!i?.length)return null;if(i.includes("*"))return["*"];if(!this.fields)return i;for(const e of i)this.fieldsIndex?.has(e)||di.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${e} found in outFields`,{layer:this,outFields:i});return rB(this.fieldsIndex,i)}}}}const G3e=()=>di.getLogger("esri.layers.support.labelingInfo"),Iar=/\[([^\[\]]+)\]/gi;function JC(i,e,t){return i?i.map(r=>{const n=new rT;if(n.read(r,t),n.labelExpression){const s=e.fields||e.layerDefinition?.fields||this.fields;n.labelExpression=n.labelExpression.replaceAll(Iar,(o,a)=>`[${Aar(a,s)}]`)}return n}):null}function Aar(i,e){if(!e)return i;const t=i.toLowerCase();for(let r=0;rOar(r,e))?[]:t}function Oar(i,e){const t=i.labelPlacement,r=Mar[e];if(!i.symbol)return G3e().warn("No ILabelClass symbol specified."),!0;if(!r)return G3e().error(new qe("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!r.includes(t)){const n=r[0];t&&G3e().warn(`Found invalid label placement type ${t} for ${e}. Defaulting to ${n}`),i.labelPlacement=n}return!1}const QM=[];function Mae(i,e){if(Fx(i.url??""))return!0;const{wkid:t}=e;for(const r of QM){if((i.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(t))return!1}return!0}QM.push([10.91,()=>{const i=new Set([9709,9716,9741,9761,9766]);for(let e=9712;e<=9713;e++)i.add(e);for(let e=9748;e<=9749;e++)i.add(e);for(let e=20904;e<=20932;e++)i.add(e);for(let e=21004;e<=21032;e++)i.add(e);for(let e=21207;e<=21264;e++)i.add(e);for(let e=21307;e<=21364;e++)i.add(e);for(let e=23301;e<=23333;e++)i.add(e);for(let e=102759;e<=102760;e++)i.add(e);for(let e=102934;e<=102955;e++)i.add(e);return i}]),QM.push([10.9,()=>{const i=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let e=9356;e<=9360;e++)i.add(e);for(let e=9404;e<=9407;e++)i.add(e);for(let e=9476;e<=9482;e++)i.add(e);for(let e=9487;e<=9494;e++)i.add(e);for(let e=9697;e<=9699;e++)i.add(e);return i}]),QM.push([10.81,()=>{const i=new Set([9265,9333,103598,103699]);for(let e=9248;e<=9254;e++)i.add(e);for(let e=9271;e<=9273;e++)i.add(e);for(let e=9284;e<=9285;e++)i.add(e);for(let e=21453;e<=21463;e++)i.add(e);return i}]),QM.push([10.8,()=>{const i=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let e=8035;e<=8036;e++)i.add(e);for(let e=8455;e<=8456;e++)i.add(e);for(let e=8518;e<=8529;e++)i.add(e);for(let e=8533;e<=8536;e++)i.add(e);for(let e=8538;e<=8540;e++)i.add(e);for(let e=8677;e<=8679;e++)i.add(e);for(let e=8902;e<=8903;e++)i.add(e);for(let e=8907;e<=8910;e++)i.add(e);for(let e=8949;e<=8951;e++)i.add(e);for(let e=8972;e<=8987;e++)i.add(e);for(let e=9039;e<=9040;e++)i.add(e);for(let e=9068;e<=9069;e++)i.add(e);for(let e=9140;e<=9141;e++)i.add(e);for(let e=9148;e<=9150;e++)i.add(e);for(let e=9153;e<=9159;e++)i.add(e);for(let e=9205;e<=9218;e++)i.add(e);for(let e=9221;e<=9222;e++)i.add(e);for(let e=54098;e<=54101;e++)i.add(e);return i}]),QM.push([10.71,()=>{const i=new Set([6316]);for(let e=8351;e<=8353;e++)i.add(e);for(let e=9294;e<=9297;e++)i.add(e);for(let e=22619;e<=22621;e++)i.add(e);for(let e=103586;e<=103594;e++)i.add(e);return i}]),QM.push([10.7,()=>{const i=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let e=8065;e<=8068;e++)i.add(e);for(let e=8082;e<=8083;e++)i.add(e);for(let e=8379;e<=8385;e++)i.add(e);for(let e=8836;e<=8840;e++)i.add(e);for(let e=8857;e<=8860;e++)i.add(e);for(let e=53035;e<=53037;e++)i.add(e);for(let e=54090;e<=54091;e++)i.add(e);for(let e=102498;e<=102499;e++)i.add(e);return i}]),QM.push([10.61,()=>new Set([102497])]),QM.push([10.6,()=>{const i=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let e=7755;e<=7787;e++)i.add(e);for(let e=7791;e<=7795;e++)i.add(e);for(let e=7799;e<=7801;e++)i.add(e);for(let e=7825;e<=7831;e++)i.add(e);for(let e=7877;e<=7878;e++)i.add(e);for(let e=7882;e<=7883;e++)i.add(e);for(let e=7991;e<=7992;e++)i.add(e);for(let e=8042;e<=8043;e++)i.add(e);for(let e=8058;e<=8059;e++)i.add(e);for(let e=8311;e<=8348;e++)i.add(e);for(let e=9060;e<=9067;e++)i.add(e);for(let e=102562;e<=102568;e++)i.add(e);for(let e=102799;e<=102900;e++)i.add(e);return i}]);async function Oae(i,e,t){const r=i&&i.getAtOrigin&&i.getAtOrigin("renderer",e.origin);if(r&&r.type==="unique-value"&&r.styleOrigin){const n=await Uk(r.populateFromStyle());if(hn(t),n.ok===!1){const s=n.error;e?.messages&&e.messages.push(new Rf("renderer:style-reference",`Failed to create unique value renderer from style reference: ${s.message}`,{error:s,context:e})),i.clear("renderer",e?.origin)}}}var wLe;let WG=wLe=class extends Ci{constructor(i){super(i),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new wLe({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};x([D({type:[String],json:{write:!0}})],WG.prototype,"groupByFields",void 0),x([D({type:Number,json:{write:!0}})],WG.prototype,"topCount",void 0),x([D({type:[String],json:{write:!0}})],WG.prototype,"orderByFields",void 0),WG=wLe=x([Qe("esri.rest.support.TopFilter")],WG);const Par=WG;var xLe;const dot=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),pot=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Bh=xLe=class extends Ci{constructor(i){super(i),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new xLe(li({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};x([D({type:Boolean,json:{write:!0}})],Bh.prototype,"cacheHint",void 0),x([D({type:Number,json:{write:{overridePolicy:i=>({enabled:i>0})}}})],Bh.prototype,"distance",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],Bh.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],Bh.prototype,"geometryPrecision",void 0),x([D({type:Number,json:{write:!0}})],Bh.prototype,"maxAllowableOffset",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Bh.prototype,"num",void 0),x([D({json:{write:!0}})],Bh.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],Bh.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],Bh.prototype,"outFields",void 0),x([D({type:Xi,json:{read:{source:"outSR"},write:{target:"outSR"}}})],Bh.prototype,"outSpatialReference",void 0),x([D({type:String,json:{write:!0}})],Bh.prototype,"resultType",void 0),x([D({json:{write:!0}})],Bh.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Bh.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Bh.prototype,"returnZ",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Bh.prototype,"start",void 0),x([ur("start"),ur("num")],Bh.prototype,"writeStart",null),x([D({type:String,json:{read:{source:"spatialRel",reader:dot.read},write:{target:"spatialRel",writer:dot.write}}})],Bh.prototype,"spatialRelationship",void 0),x([D({type:Eg,json:{write:!0}})],Bh.prototype,"timeExtent",void 0),x([D({type:Par,json:{write:!0}})],Bh.prototype,"topFilter",void 0),x([D({type:String,json:{read:pot.read,write:{writer:pot.write,overridePolicy(i){return{enabled:i!=null&&this.distance!=null&&this.distance>0}}}}})],Bh.prototype,"units",void 0),x([D({type:String,json:{write:!0}})],Bh.prototype,"where",void 0),Bh=xLe=x([Qe("esri.rest.support.TopFeaturesQuery")],Bh),Bh.from=Sd(Bh);const rF=Bh;function p_({displayField:i,editFieldsInfo:e,fields:t,objectIdField:r,title:n},s){if(!t)return null;const o=kar({editFieldsInfo:e,fields:t,objectIdField:r},s);if(!o.length)return null;const a=$ar({titleBase:n,fields:t,displayField:i}),l=Nar();return new qc({title:a,content:l,fieldInfos:o})}const Rar=(i,e)=>e.visibleFieldNames?e.visibleFieldNames.has(i.name):WZi(i,e);function Dar(i,e){const t=i;return e&&(i=i.filter(r=>!e.includes(r.type))),i===t&&(i=i.slice()),i.sort(Far),i}function Far(i,e){return i.type==="oid"?-1:e.type==="oid"?1:fot(i)?-1:fot(e)?1:(i.alias||i.name).toLocaleLowerCase().localeCompare((e.alias||e.name).toLocaleLowerCase())}function kar(i,e){const t=e?.visibleFieldNames;return Dar(i.fields??[],e?.ignoreFieldTypes||Bar).map(r=>new dae({fieldName:r.name,isEditable:HZi(r,i),label:r.alias,format:Lar(r),visible:Rar(r,{...i,visibleFieldNames:t})}))}function Lar(i){switch(i.type){case"small-integer":case"integer":case"single":return new tme({digitSeparator:!0,places:0});case"double":return new tme({digitSeparator:!0,places:2});case"string":return L5e(i.name)?new tme({digitSeparator:!0,places:0}):null;default:return null}}function Nar(){return[new gW,new Mne]}function $ar(i){const e=PZi(i),{titleBase:t}=i;return e?`${t}: {${e.trim()}}`:t??""}function fot(i){return(i.name&&i.name.toLowerCase())==="name"?!0:(i.alias&&i.alias.toLowerCase())==="name"}const Bar=["geometry","blob","raster","guid","xml"];var Uc;(function(i){i[i.SAVE=0]="SAVE",i[i.SAVE_AS=1]="SAVE_AS"})(Uc||(Uc={}));const i1="FeatureLayer";function dhe(i,e){return new qe("layer:unsupported",`Layer (${i.title}, ${i.id}) of type '${i.declaredClass}' ${e}`,{layer:i})}function mot(i){return i&&i instanceof dr}const U3e=nT();function z3e(i,e,t){const r=!!t?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let zs=class extends qVe(NY(RY(war(BVe(xh(Iae(AE(uc(fy(Xv(Rc(Yc(Ql(py(Wx(xs(Il))))))))))))))))){constructor(...e){super(...e),this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=Xi.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=xd(async(t,r,n)=>{const{save:s,saveAs:o}=await Promise.resolve().then(()=>EWt);switch(t){case Uc.SAVE:return s(this,r);case Uc.SAVE_AS:return o(this,n,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(n=>this.initLayerProperties(n))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(_a).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const n=await this._fetchFirstValidLayerId(t);n!=null&&(this.layerId=n)}if(!this.url&&!this._hasMemorySource())throw new qe("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>u8(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,WVe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,n){this._writeEditingEnabled(e,t,!0,n)}get effectiveEditingEnabled(){return VVe(this)}readIsTable(e,t){return(t=t?.layerDefinition??t).type==="Table"||!t.geometryType}writeIsTable(e,t,r,n){n?.writeLayerSchema&&Qp(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return fPt(t.layerDefinition||t)}readObjectIdField(e,t){return mPt(t.layerDefinition||t)}get parsedUrl(){const e=Yo(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=Iu(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=Iu(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){t_(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const n=t.drawingInfo?.renderer;if(n){const s=sB(n,t,r)??void 0;return s||di.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),s}return V2e(t,r)}set source(e){const t=this._get("source");t!==e&&(mot(t)&&this._resetMemorySource(t),mot(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof dr?new UO({layer:this,items:e}):e:null}readSource(e,t){const r=du.fromJSON(t.featureSet);return new UO({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,n=r?.creatorField,s=r?.editorField;return e=e?.map(o=>$Y.fromJSON(o)),this._fixTemplates(e,n),this._fixTemplates(e,s),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,n=t.title||t.layerDefinition?.title;if(r){const s=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?TVe(this.url,r):r;let o=r;if(!o&&this.url){const a=r_(this.url);a!=null&&(o=a.title)}return o?(this.sublayerTitleMode==="item-title-and-service-name"&&s&&s!==o&&(o=s+" - "+o),G2e(o)):void 0}if(this.sublayerTitleMode==="item-title"&&n)return n}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const n=t.fields.find(s=>s.name.toLowerCase()===r);n&&(r=n.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,n=r?.creatorField,s=r?.editorField;return e?.map(o=>(o=Aae.fromJSON(o),this._fixTemplates(o.templates,n),this._fixTemplates(o.templates,s),o))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return iPt(this,e,t,i1)}async updateAttachment(e,t,r){return rPt(this,e,t,r,i1)}async applyEdits(e,t){return nPt(this,e,t)}async uploadAssets(e,t){return ksr(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return p_(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await Jg(Promise.resolve().then(()=>MWt),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=zVe(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=PS(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){return sPt(this,e,t,i1)}async fetchRecomputedExtents(e){return oPt(this,e,i1)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const n=e.attributes?e.attributes[t]:void 0;if(n==null)return null;let s=null;return r?.some(o=>{const{id:a}=o;return a!=null&&(a.toString()===n.toString()&&(s=o),!!s)}),s}getFieldDomain(e,t){const r=t?.feature,n=this.getFeatureType(r);if(n){const s=n.domains&&n.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return aPt(this,e,t,i1)}async queryFeatures(e,t){const r=await this.load(),n=await r.source.queryFeatures(Kn.from(e)??r.createQuery(),t);if(n?.features)for(const s of n.features)s.layer=s.sourceLayer=r;return n}async queryObjectIds(e,t){return lPt(this,e,t,i1)}async queryFeatureCount(e,t){return uPt(this,e,t,i1)}async queryExtent(e,t){return cPt(this,e,t,i1)}async queryRelatedFeatures(e,t){return hPt(this,e,t,i1)}async queryRelatedFeaturesCount(e,t){return dPt(this,e,t,i1)}async queryTopFeatures(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopFeatures||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopFeatures capability");const s=await r.queryTopFeatures(rF.from(e),t);if(s?.features)for(const o of s.features)o.layer=o.sourceLayer=this;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopObjectIds||!n?.query.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(rF.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopExtents||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(rF.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopCount||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(rF.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const n=r.layers;n&&n.length===1&&(super.read(n[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:n,messages:s}=t;if(this.dynamicDataSource)return s?.push(dhe(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&n!=="tables")return s?.push(dhe(this,`a table source can only be written to tables, not ${n}`)),null;if(this._hasMemorySource())return s?.push(dhe(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&n==="tables")return s?.push(dhe(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new qe(i1,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||Mae(this,e))}async save(e){return this._debouncedSaveOperations(Uc.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Uc.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let n=e.layerDefinition?.capabilities;return n?this._hasEditingCapability(n):(n=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&n?this._hasEditingCapability(n):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,n){if(!e){const s=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";Qp("layerDefinition.capabilities",s,t),r&&!n?.writeLayerSchema&&(t.capabilities=s)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return zi(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),t_(this.renderer,this.fieldsIndex),pR(this.timeInfo,this.fieldsIndex),Oae(this,{origin:"service"})}async hasDataChanged(){return pPt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const n=r.prototype?.attributes;n&&t&&delete n[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new qe("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new qe("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};x([Mi("service","capabilities")],zs.prototype,"readCapabilities",null),x([D({json:{origins:{"web-scene":{write:!1}},write:!0}})],zs.prototype,"charts",void 0),x([D({readOnly:!0})],zs.prototype,"createQueryVersion",null),x([D({json:{read:{source:"layerDefinition.copyrightText"}}})],zs.prototype,"copyright",void 0),x([D({json:{read:{source:"layerDefinition.displayField"}}})],zs.prototype,"displayField",void 0),x([D({types:Kh,readOnly:!0})],zs.prototype,"defaultSymbol",void 0),x([D({type:Ev})],zs.prototype,"dynamicDataSource",void 0),x([D({type:Boolean})],zs.prototype,"editingEnabled",null),x([Mi(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],zs.prototype,"readEditingEnabled",null),x([Mi("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],zs.prototype,"readEditingEnabledFromWebMap",null),x([ur(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],zs.prototype,"writeEditingEnabled",null),x([ur("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],zs.prototype,"writeEditingEnabledToWebMap",null),x([D({readOnly:!0})],zs.prototype,"effectiveEditingEnabled",null),x([D({...U3e.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:z3e}}}}})],zs.prototype,"fields",void 0),x([D(U3e.fieldsIndex)],zs.prototype,"fieldsIndex",void 0),x([D({type:tOt,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],zs.prototype,"formTemplate",void 0),x([D({json:{read:{source:"layerDefinition.extent"}}})],zs.prototype,"fullExtent",void 0),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:z3e,writer(i,e,t){const r=i?uLe.toJSON(i):null;r&&Qp(t,r,e)}}}},read:{source:"layerDefinition.geometryType",reader:uLe.read}}})],zs.prototype,"geometryType",void 0),x([D({json:{read:{source:"layerDefinition.hasM"}}})],zs.prototype,"hasM",void 0),x([D({json:{read:{source:"layerDefinition.hasZ"}}})],zs.prototype,"hasZ",void 0),x([D(LY)],zs.prototype,"id",void 0),x([D({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],zs.prototype,"infoFor3D",void 0),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],zs.prototype,"isTable",void 0),x([Mi("service","isTable",["type","geometryType"]),Mi("isTable",["layerDefinition.type","layerDefinition.geometryType"])],zs.prototype,"readIsTable",null),x([ur("web-map","isTable")],zs.prototype,"writeIsTable",null),x([D(H3)],zs.prototype,"labelsVisible",void 0),x([D({type:[rT],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:JC,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:JC,write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.drawingInfo.labelingInfo",read:JC,write:!0}})],zs.prototype,"labelingInfo",void 0),x([D((()=>{const i=li(QOt);return i.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){Qp(r,E2e(e),t)}}},i})())],zs.prototype,"opacity",void 0),x([D(d_)],zs.prototype,"legendEnabled",void 0),x([D({type:["show","hide"],json:(()=>{const i=li(ePt.json);return i.origins["portal-item"]={read:!1,write:!1},i})()})],zs.prototype,"listMode",void 0),x([Mi("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],zs.prototype,"readGlobalIdField",null),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:z3e}}}}})],zs.prototype,"objectIdField",void 0),x([Mi("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],zs.prototype,"readObjectIdField",null),x([D({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],zs.prototype,"operationalLayerType",void 0),x([D(U3e.outFields)],zs.prototype,"outFields",void 0),x([D({readOnly:!0})],zs.prototype,"parsedUrl",null),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],zs.prototype,"path",void 0),x([D(h_)],zs.prototype,"popupEnabled",void 0),x([D({type:qc,json:{name:"popupInfo",write:!0}})],zs.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],zs.prototype,"defaultPopupTemplate",null),x([D({types:IE,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:qk,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:Wv,overridePolicy:(i,e,t)=>({ignoreOrigin:t?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(i,e,t)=>({ignoreOrigin:t?.writeLayerSchema})}}})],zs.prototype,"renderer",null),x([Mi("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Mi("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],zs.prototype,"readRenderer",null),x([D()],zs.prototype,"resourceInfo",void 0),x([D((()=>{const i=li(FY);return i.json.origins["portal-item"]={read:!1,write:!1},i})())],zs.prototype,"screenSizePerspectiveEnabled",void 0),x([D({clonable:!1})],zs.prototype,"source",null),x([So("source")],zs.prototype,"castSource",null),x([Mi("portal-item","source",["featureSet"]),Mi("web-map","source",["featureSet"])],zs.prototype,"readSource",null),x([D({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],zs.prototype,"spatialReference",void 0),x([D({type:Number})],zs.prototype,"subtypeCode",void 0),x([D({type:[$Y]})],zs.prototype,"templates",void 0),x([Mi("templates",["editFieldsInfo","creatorField","editorField","templates"])],zs.prototype,"readTemplates",null),x([D({type:K2e})],zs.prototype,"timeInfo",void 0),x([D()],zs.prototype,"title",void 0),x([Mi("service","title",["name"]),Mi("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],zs.prototype,"readTitle",null),x([Mi("web-map","title",["layerDefinition.name","title"])],zs.prototype,"readTitleFromWebMap",null),x([D({type:String})],zs.prototype,"sublayerTitleMode",void 0),x([D({json:{read:!1}})],zs.prototype,"type",void 0),x([D({type:String})],zs.prototype,"typeIdField",void 0),x([Mi("service","typeIdField"),Mi("typeIdField",["layerDefinition.typeIdField"])],zs.prototype,"readTypeIdField",null),x([D({type:[Aae]})],zs.prototype,"types",void 0),x([Mi("service","types",["types"]),Mi("types",["layerDefinition.types"])],zs.prototype,"readTypes",null),x([D({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],zs.prototype,"visible",void 0),x([Mi("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],zs.prototype,"readVisible",null),zs=x([Qe("esri.layers.FeatureLayer")],zs);const yh=zs,rHe=Object.freeze(Object.defineProperty({__proto__:null,default:yh},Symbol.toStringTag,{value:"Module"}));let Lie=class extends dr{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(dr.ofType(this.itemType.Type))(e):new dr(e)}};function SLe(i,e){return{type:i,cast:fY,set(t){const r=ay(t,this._get(e),i);r.owner=this,this._set(e,r)}}}x([D()],Lie.prototype,"owner",null),Lie=x([Qe("esri.core.support.OwningCollection")],Lie);let bx=class extends Lie{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};x([aze({Type:Us,ensureType:Sd(Us)})],bx.prototype,"itemType",void 0),bx=x([Qe("esri.support.GraphicsCollection")],bx);let eO=class extends xh(uc(Il)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new bx,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};x([D({type:ZB})],eO.prototype,"elevationInfo",void 0),x([D(SLe(bx,"graphics"))],eO.prototype,"graphics",void 0),x([D({type:["show","hide"]})],eO.prototype,"listMode",void 0),x([D()],eO.prototype,"screenSizePerspectiveEnabled",void 0),x([D({readOnly:!0})],eO.prototype,"type",void 0),x([D({constructOnly:!0})],eO.prototype,"internal",void 0),eO=x([Qe("esri.layers.GraphicsLayer")],eO);const nHe=eO;var TLe;const phe=new Rs({flow_from:"flow-from",flow_to:"flow-to"});let q0=TLe=class extends Wk(Ci){constructor(i){super(i),this.density=.8,this.color=new jr([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:i,maxPathLength:e,trailWidth:t,flowSpeed:r,trailLength:n,smoothing:s,flowRepresentation:o,trailCap:a,background:l}=this,u=this.color.clone(),c=(this.visualVariables||[]).map(m=>m.clone()),h=this.authoringInfo?.clone(),p=this.legendOptions?.clone();return new TLe({density:i,color:u,maxPathLength:e,trailWidth:t,flowSpeed:r,trailLength:n,trailCap:a,background:l,smoothing:s,flowRepresentation:o,visualVariables:c,authoringInfo:h,legendOptions:p})}getSymbol(i,e){}async getSymbolAsync(i,e){}getSymbols(){return[]}};x([D({type:Number,json:{write:!0}})],q0.prototype,"density",void 0),x([D({type:jr,json:{write:{allowNull:!0}}})],q0.prototype,"color",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],q0.prototype,"maxPathLength",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],q0.prototype,"trailWidth",void 0),x([D({type:Number,json:{write:!0}})],q0.prototype,"flowSpeed",void 0),x([D({type:Number,json:{write:!0}})],q0.prototype,"trailLength",void 0),x([D({type:Number,cast:Cl,json:{write:!1}})],q0.prototype,"smoothing",void 0),x([D({type:phe.apiValues,json:{type:phe.jsonValues,read:{reader:phe.read},write:{writer:phe.write}}})],q0.prototype,"flowRepresentation",void 0),x([Wr({flowRenderer:"flow"})],q0.prototype,"type",void 0),x([D({type:vae,json:{write:!0}})],q0.prototype,"authoringInfo",void 0),x([D({type:UA,json:{write:!0}})],q0.prototype,"legendOptions",void 0),x([D({type:String,json:{write:!0}})],q0.prototype,"trailCap",void 0),x([D({type:String,json:{write:!0}})],q0.prototype,"background",void 0),q0=TLe=x([Qe("esri.renderers.FlowRenderer")],q0);const qPt=q0;let qG=class extends Ci{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};x([D({type:Number,json:{write:!0}})],qG.prototype,"value",void 0),x([D({type:String,json:{write:!0}})],qG.prototype,"label",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],qG.prototype,"color",void 0),qG=x([Qe("esri.renderers.support.ColormapInfo")],qG);const YPt=qG,jar=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],sHe=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],UV=new Rs({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function fhe(i,e){if(!i||!e||i.length!==e.length)return!1;for(let t=0;te[t]+2||i[t]got(t))),e}return got(i)}function yot(i,e){if(!i)return;const t=sHe;let r=null;return i.type==="algorithmic"?t.some(n=>{if(fhe(i.fromColor.toRgb(),n.fromColor)&&fhe(i.toColor.toRgb(),n.toColor))return r=n.id,!0}):i.type==="multipart"&&t.some(n=>{const s=i.colorRamps,o=n.colorRamps;if(s&&o&&s.length===o.length&&!o.some((a,l)=>{if(!fhe(s[l].fromColor.toRgb(),new jr(a.fromColor).toRgb())||!fhe(s[l].toColor.toRgb(),new jr(a.toColor).toRgb()))return!0})){if(r)return!0;r=n.id}}),r}function Uar(i,e,t=!1){if(!i)return;let r=!1,n=yot(i);return n!=null||t||(r=!0,n=yot(i=Gar(i))),n?{id:n,inverted:r}:void 0}function XPt(i,e=!1){const t=typeof i=="string"?i:Uar(i,void 0,e)?.id;return t?UV.toJSON(t):null}function zar(i,e="esriCIELabAlgorithm"){const t=sHe.find(({id:r})=>r===i);return t?t.colorRamps?{type:"multipart",colorRamps:t.colorRamps.map(r=>({type:"algorithmic",algorithm:e,fromColor:[...r.fromColor],toColor:[...r.toColor]}))}:{type:"algorithmic",algorithm:e,fromColor:[...t.fromColor],toColor:[...t.toColor]}:null}function JPt(i){const e=(i=i||{}).numColors||256,t=i.distanceOffset||0,r=i.isCustomInterval!=null?i.isCustomInterval:i.distanceInterval!==null&&i.distanceInterval!==1/(e-1),n=i.distanceInterval||1/(e-1);return{...i,numColors:e,distanceOffset:t,interpolateAlpha:!!i.interpolateAlpha,distanceInterval:n,isCustomInterval:r,weights:i.weights}}function Var(i,e,t){const{numColors:r,distanceOffset:n,distanceInterval:s,isCustomInterval:o}=t,a=i.s===0,l=e.s===0;let u=i.h,c=e.h;a&&!l?u=c:l&&!a&&(e={...e,h:u},c=u);let h,p=Math.abs(c-u);const m=360;pc?p*s:-p*s);const v=(e.s-i.s)*s,w=(e.v-i.v)*s;let{s:S,v:I}=i,R=u;if(n){const k=n/s;R=(R+k*h+m)%m,S+=k*v,I+=k*w}const L=[];for(let k=0;kp+m);n=n.map(p=>p/h)}else{n=[];for(let h=0;h{n.unshift(s),r||n.pop()}),t}function vot(i){const e=u1e(i);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function _ot(i){return{Algorithm:i.toJSON()?.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:vot(i.fromColor),ToColor:vot(i.toColor)}}function ZPt(i){const e=XPt(i);if(!e)return null;if(i.type==="algorithmic")return{..._ot(i),Name:e};if(i.colorRamps){const t=i.colorRamps.map(_ot);return{type:"MultiPartColorRamp",NumColorRamps:t.length,ArrayOfColorRamp:t,Name:e}}return null}function Yar(i){const e=i.reverse().map(t=>{const r=t.toString(16);return r.length<2?"0"+r:r});return 4294967295&Number.parseInt(e.join(""),16)}var MQ;let OQ=MQ=class extends Ci{constructor(i){super(i),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(i,e){if(!i)return null;const t=i[0].length===5,r=[...i].sort((n,s)=>n[0]-s[0]).map(n=>YPt.fromJSON({value:n[0],color:t?n.slice(1,5):n.slice(1,4).concat([255]),label:e?e[n[0]]??"":n[0]}));return new MQ({colormapInfos:r})}static createFromColorramp(i){const e=tk(i);return MQ.createFromColormap(e)}clone(){return new MQ({colormapInfos:this.colormapInfos.map(i=>i.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:i,color:e})=>[i,e.r,e.g,e.b,e.a>1?e.a:255*e.a&255]).sort((i,e)=>i[0]-e[0])}};x([D({type:[YPt],json:{write:!0}})],OQ.prototype,"colormapInfos",void 0),x([Wr({rasterColormap:"raster-colormap"})],OQ.prototype,"type",void 0),OQ=MQ=x([Qe("esri.renderers.RasterColormapRenderer")],OQ);const aHe=OQ;var CLe;let _w=CLe=class extends Ci{constructor(i){super(i),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(i){return F2e(i)}clone(){return new CLe({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:li(this.colorRamp)})}};x([D({type:Number,json:{write:!0}})],_w.prototype,"altitude",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"azimuth",void 0),x([D({types:D2e,json:{write:!0}})],_w.prototype,"colorRamp",void 0),x([Mi("colorRamp")],_w.prototype,"readColorRamp",null),x([D({type:["traditional","multi-directional"],json:{write:!0}})],_w.prototype,"hillshadeType",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"pixelSizePower",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"pixelSizeFactor",void 0),x([D({type:["none","adjusted"],json:{write:!0}})],_w.prototype,"scalingType",void 0),x([Wr({rasterShadedRelief:"raster-shaded-relief"})],_w.prototype,"type",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"zFactor",void 0),_w=CLe=x([Qe("esri.renderers.RasterShadedReliefRenderer")],_w);const QPt=_w,Nie=new Rs({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),eRt={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ELe;let nf=ELe=class extends Ci{constructor(i){super(i),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(i){if(i)return F2e(i)}writeStatistics(i,e,t){i?.length&&(Array.isArray(i[0])||(i=i.map(r=>[r.min,r.max,r.avg,r.stddev])),e[t]=i)}readStretchType(i,e){let t=e.stretchType;return typeof t=="number"&&(t=eRt[t]),Nie.read(t)}clone(){return new ELe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:li(this.statistics),gamma:li(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:li(this.colorRamp),histograms:li(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};x([D({types:D2e,json:{write:!0}})],nf.prototype,"colorRamp",void 0),x([Mi("colorRamp")],nf.prototype,"readColorRamp",null),x([D({type:Boolean,json:{write:!0}})],nf.prototype,"computeGamma",void 0),x([D({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],nf.prototype,"dynamicRangeAdjustment",void 0),x([D({type:[Number],json:{write:!0}})],nf.prototype,"gamma",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"maxPercent",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"minPercent",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"numberOfStandardDeviations",void 0),x([D({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],nf.prototype,"outputMax",void 0),x([D({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],nf.prototype,"outputMin",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"sigmoidStrengthLevel",void 0),x([D({json:{type:[[Number]],write:!0}})],nf.prototype,"statistics",void 0),x([D()],nf.prototype,"histograms",void 0),x([ur("statistics")],nf.prototype,"writeStatistics",null),x([D({type:Boolean,json:{write:!0}})],nf.prototype,"useGamma",void 0),x([D({type:Nie.apiValues,json:{type:Nie.jsonValues,write:Nie.write}})],nf.prototype,"stretchType",void 0),x([Mi("stretchType",["stretchType"])],nf.prototype,"readStretchType",null),x([Wr({rasterStretch:"raster-stretch"})],nf.prototype,"type",void 0),nf=ELe=x([Qe("esri.renderers.RasterStretchRenderer")],nf);const lHe=nf,$z={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new lo({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:Xi.WebMercator}),minus180Line:new lo({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:Xi.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new lo({paths:[[[180,-180],[180,180]]],spatialReference:Xi.WGS84}),minus180Line:new lo({paths:[[[-180,-180],[-180,180]]],spatialReference:Xi.WGS84})}};function pS(i,e){return Math.ceil((i-e)/(2*e))}function uHe(i,e){const t=$ie(i);for(const r of t)for(const n of r)n[0]+=e;return i}function $ie(i){return ed(i)?i.rings:i.paths}function _p(i,e){return e?{...e,query:{...i??{},...e.query}}:{query:i}}function gu(i){return typeof i=="string"?Yo(i):li(i)}function Ig(i,e,t){const r={};for(const n in i){if(n==="declaredClass")continue;const s=i[n];if(s!=null&&typeof s!="function")if(Array.isArray(s))r[n]=s.map(o=>Ig({item:o},e,t).item);else if(typeof s=="object")if(s.toJSON){const o=s.toJSON(t?.[n]);r[n]=JSON.stringify(o)}else r[n]=JSON.stringify(s);else r[n]=s}return r}async function Xar(i,e,t,r){const n=gu(i),s=e[0].spatialReference,o={...r,responseType:"json",query:{...n.query,f:"json",sr:Hv(s),target:JSON.stringify({geometryType:ah(e[0]),geometries:e}),cutter:JSON.stringify(t)}},a=await zi(n.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=a.data;return{cutIndexes:l,geometries:u.map(c=>{const h=Ro(c);return h.spatialReference=s,h})}}function Jar(i){return{geometryType:ah(i[0]),geometries:i.map(e=>e.toJSON())}}function tRt(i,e,t){const r=XXi(e);return i.map(n=>{const s=r.fromJSON(n);return s.spatialReference=t,s})}async function Kar(i,e,t){const r=typeof i=="string"?Yo(i):i,n=e[0].spatialReference,s=ah(e[0]),o={...t,query:{...r.query,f:"json",sr:Hv(n),geometries:JSON.stringify(Jar(e))}},{data:a}=await zi(r.path+"/simplify",o);return tRt(a.geometries,s,n)}const iRt=()=>di.getLogger("esri.geometry.support.normalizeUtils");function Zar(i){return i.type==="polygon"}function Qar(i){return i[0].type==="polygon"}function elr(i){return i[0].type==="polyline"}function bot(i){const e=[];let t=0,r=0;for(let n=0;n1){for(let R=1;R<=v-1;R++){const L=R*e,k=m*L+a,B=p*L+l;s.push([k,B])}const w=(h+Math.floor(v-1)*e)/2,S=m*w+a,I=p*w+l;s.push([S,I])}s.push([u,c])}}return Zar(i)?new $s({rings:r,spatialReference:i.spatialReference}):new lo({paths:r,spatialReference:i.spatialReference})}function wot(i,e,t){if(e){const r=tlr(i,1e6);i=r8(r,!0)}return t&&(i=uHe(i,t)),i}function xot(i,e,t){if(Array.isArray(i)){const r=i[0];if(r>e){const n=pS(r,e);i[0]=r+n*(-2*e)}else if(re){const n=pS(r,e);i=i.clone().offset(n*(-2*e),0)}else if(r{if(u[0]<180)return!0;{let c=0;for(let p=0;pc?m:c}c=Number(c.toFixed(9));const h=-360*pS(c,180);for(let p=0;pxot($,a,l)),v.push(B)}else if(k.type==="extent"){const B=k.clone()._normalize(!1,!1,s);v.push(B.rings?new $s(B):B)}else if(k.extent){const B=k.extent,$=pS(B.xmin,l)*(2*a);let V=$===0?k.clone():uHe(k.clone(),$);B.offset($,0),B.intersects(c)&&B.xmax!==a?(p=B.xmax>p?B.xmax:p,V=wot(V,o),m.push(V),v.push("cut")):B.intersects(h)&&B.xmin!==l?(p=B.xmax*(2*a)>p?B.xmax*(2*a):p,V=wot(V,o,360),m.push(V),v.push("cut")):v.push(V)}else v.push(k.clone());else v.push(k);else v.push(k);let w=pS(p,a),S=-90;const I=w,R=new lo;for(;w>0;){const k=360*w-180;R.addPath([[k,S],[k,-1*S]]),S*=-1,w--}if(m.length>0&&I>0){const k=ilr(m,await Xar(r,m,R,t)),B=[],$=[];for(let K=0;K1&&re.rings.length>=ne.rings.length?(B.push(re),$.push("simplify")):$.push(o?WC(re):re)}}if(!B.length)return $;const V=await Kar(r,B,t),Y=[];for(let K=0;K<$.length;K++){const Q=$[K];Q!=="simplify"?Y.push(Q):Y.push(o?WC(V.shift()):V.shift())}return Y}const L=[];for(let k=0;ks||ln)return e;switch(i.type){case"polygon":if(!(i.rings.length>1))return e;a=bot(i.rings);break;case"polyline":if(!(i.paths.length>1))return e;a=bot(i.paths);break;case"multipoint":a=i.points}const c=e.clone();for(let h=0;hs?a=Math.ceil(Math.abs(e-s)/o):es?l=Math.ceil(Math.abs(i-s)/o):is?u-=o:cn)for(;i>n;)i-=s}return i}let Sot=class{constructor(e=null,t=null,r=null){this.minValue=e,this.maxValue=t,this.noDataValue=r}};const nlr=9999999e31,slr=2e-7,olr={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function Yx(i){return olr[i]??[-34028234663852886e22,34028234663852886e22]}function Gme(i,e){return i==null||e==null?"s32":i<0?i>=-128&&e<128?"s8":i>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function SF(i){return(i?.startsWith("s")||i?.startsWith("u"))??!1}function Z2e(i,e,t){if(i.depthCount&&i.depthCount>1)return;const{pixels:r,statistics:n,pixelType:s}=i,o=r[0].length,a=i.bandMasks??[],l=i.mask??new Uint8Array(o).fill(255),u=s==="f32"||s==="f64",c=Yx(s);let h=!1;for(let p=0;pm+Number.EPSILON||w=nlr?slr*Math.abs(m):s==="f32"?2**-23:Number.EPSILON);for(let k=0;k1?a:null,i.mask=l),h&&"updateStatistics"in i&&i.updateStatistics()}var _4;let Y0=_4=class extends Ci{static createEmptyBand(i,e){return new(_4.getPixelArrayConstructor(i))(e)}static combineBandMasks(i){if(i.length<2)return i[0];const e=i[0].length,t=new Uint8Array(e).fill(255);for(let r=0;rthis._calculateBandStatistics(t,this.mask));const i=this.mask;let e=0;if(i!=null)for(let t=0;tt?t:ah>=e.length),s=r===i.length&&!i.some((h,p)=>h!==p);if(n||s)return this;const o=this.bandMasks?.length===r?i.map(h=>this.bandMasks[h]):void 0;let{mask:a,validPixelCount:l}=this;const{width:u,height:c}=this;return o?.length&&(a=_4.combineBandMasks(o),l=a.filter(h=>!!h).length),new _4({pixelType:this.pixelType,width:u,height:c,mask:a,bandMasks:o,validPixelCount:l,maskIsAlpha:this.maskIsAlpha,pixels:i.map(h=>e[h]),statistics:t&&i.map(h=>t[h])})}clone(){const i=new _4({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?i.mask=new Uint8Array(this.mask):i.mask=this.mask.slice(0)),this.bandMasks&&(i.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const t=_4.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){i.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(o=n[1],a=n[2]):n.length===2&&(o=n[1]);const u=new Uint32Array(i),c=this.width*this.height;if(s.length===c)if(e!=null&&e.length===c)if(t)for(l=0;l0){for(const w of r)if(w.minValue!=null&&(o=Math.min(o,w.minValue)),w.maxValue!=null&&w.minValue!=null){const S=w.maxValue-w.minValue;a=Math.max(a,S)}s=255/a}else{let w=255;n==="s8"?(o=-128,w=127):n==="u16"?w=65535:n==="s16"?(o=-32768,w=32767):n==="u32"?w=4294967295:n==="s32"?(o=-2147483648,w=2147483647):n==="f32"?(o=-34e38,w=34e38):n==="f64"&&(o=-Number.MAX_VALUE,w=Number.MAX_VALUE),s=255/(w-o)}const l=new Uint32Array(i),u=this.width*this.height;let c,h,p,m,v;if(c=h=p=e[0],c.length!==u)return di.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(h=e[1],e.length>=3&&(p=e[2]),t!=null&&t.length===u)for(m=0;m=3?(n=e[1],s=e[2]):e.length===2&&(n=e[1]);const a=this.width*this.height;if(r.length!==a)return di.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(t!=null&&t.length===a)for(o=0;or?o:r);else for(s=0;sr?o:r;return new Sot(t,r)}};x([D({json:{write:!0}})],Y0.prototype,"width",void 0),x([D({json:{write:!0}})],Y0.prototype,"height",void 0),x([D({json:{write:!0}})],Y0.prototype,"pixelType",void 0),x([So("pixelType")],Y0.prototype,"castPixelType",null),x([D({json:{write:!0}})],Y0.prototype,"validPixelCount",void 0),x([D({json:{write:!0}})],Y0.prototype,"mask",void 0),x([D({json:{write:!0}})],Y0.prototype,"maskIsAlpha",void 0),x([D({json:{write:!0}})],Y0.prototype,"pixels",void 0),x([D()],Y0.prototype,"premultiplyAlpha",void 0),x([D({json:{write:!0}})],Y0.prototype,"statistics",void 0),x([D({json:{write:!0}})],Y0.prototype,"depthCount",void 0),x([D({json:{write:!0}})],Y0.prototype,"noDataValues",void 0),x([D({json:{write:!0}})],Y0.prototype,"bandMasks",void 0),Y0=_4=x([Qe("esri.layers.support.PixelBlock")],Y0);const Br=Y0;var w1e,x1e;(function(i){i[i.matchAny=0]="matchAny",i[i.matchAll=1]="matchAll"})(w1e||(w1e={})),function(i){i[i.bestMatch=0]="bestMatch",i[i.fail=1]="fail"}(x1e||(x1e={}));const uP=6;function bh(i){return i!=null&&i.declaredClass==="esri.layers.support.PixelBlock"&&i.pixels&&i.pixels.length>0}function alr(i){if(!i?.length||i.some(c=>!bh(c)))return null;if(i.length===1)return i[0]?.clone()??null;const e=i,{width:t,height:r,pixelType:n}=e[0];if(e.some(c=>c.width!==t||c.height!==r))return null;const s=e.map(({mask:c})=>c).filter(c=>c!=null);let o=null;s.length&&(o=new Uint8Array(t*r),o.set(s[0]),s.length>1&&nRt(s.slice(1),o));const a=[];e.forEach(({pixels:c})=>a.push(...c));const l=e.map(({statistics:c})=>c).filter(c=>c?.length),u=[];return l.forEach(c=>u.push(...c)),new Br({pixelType:n,width:t,height:r,mask:o,pixels:a,statistics:u.length?u:null})}function LJ(i){if(!i)return;const e=i.colormap;if(!e||e.length===0)return;const t=e.sort((h,p)=>h[0]-p[0]);let r=0;t[0][0]<0&&(r=t[0][0]);const n=Math.max(256,t[t.length-1][0]-r+1),s=new Uint8Array(4*n),o=[];let a,l=0,u=0;const c=t[0].length===5;if(n>65536)return t.forEach(h=>{o[h[0]-r]=c?h.slice(1):h.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:c};if(i.fillUnspecified)for(a=t[u],l=a[0]-r;lI?n[c]=0:(p[c]=o[S],m[c]=o[S+1],v[c]=o[S+2],n[c]=o[S+3]));else{for(n=new Uint8Array(s),c=0;cI?n[c]=0:(p[c]=o[S],m[c]=o[S+1],v[c]=o[S+2],n[c]=o[S+3]);t.mask=n}}else if(a)if(n!=null)for(c=0;cs));const a=[],l=e.outputPixelType||"u8";for(let c=0;c1;){if(u===c.value){w=!0;break}u>c.value?h=v:p=v,v=Math.floor((h+p)/2),c=e[Math.floor(v)]}w||(u===e[h].value?(c=e[h],w=!0):u===e[p].value?(c=e[p],w=!0):ue[h].value&&(uk-v);w[0]=n[0],w[w.length-1]=n[n.length-1]+(u?1e-6:0);const S=n.length/2,[I,R]=Yx(o);for(let k=0;k=0;K--)if(V===w[2*K]||V>w[2*K]&&VR?R:V=a[Y]&&V<=a[Y+1]){h[$]=0,m[$]=0;break}}}return new Br({width:t,height:r,pixelType:o,pixels:[h],mask:m})}function Tot(i,e,t,r){const n=t!=null&&t.length>=2?new Set(t):null,s=t?.length===1?t[0]:null,o=!!e?.length;for(let a=0;a=e[c]&&l<=e[c+1]){u=!0;break}u||(r[a]=0)}r[a]&&(l===s||n?.has(l))&&(r[a]=0)}}function Cot(i,e){const t=i[0].length;for(let r=0;rS-1e-6);w[0]=t[0],o&&(w[w.length-1]=t[t.length-1]);for(let S=0;Sm?m:r[S]v.pixelBlock);if(t?.pixelBlock==null)return null;const r=(t.extent.xmax-t.extent.xmin)/t.pixelBlock.width,n=(t.extent.ymax-t.extent.ymin)/t.pixelBlock.height,s=.01*Math.min(r,n),o=i.sort((v,w)=>Math.abs(v.extent.ymax-w.extent.ymax)>s?w.extent.ymax-v.extent.ymax:Math.abs(v.extent.xmin-w.extent.xmin)>s?v.extent.xmin-w.extent.xmin:0),a=Math.min.apply(null,o.map(v=>v.extent.xmin)),l=Math.min.apply(null,o.map(v=>v.extent.ymin)),u=Math.max.apply(null,o.map(v=>v.extent.xmax)),c=Math.max.apply(null,o.map(v=>v.extent.ymax)),h={x:Math.round((e.xmin-a)/r),y:Math.round((c-e.ymax)/n)},p={width:Math.round((u-a)/r),height:Math.round((c-l)/n)},m={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/n)};return Math.round(p.width/t.pixelBlock.width)*Math.round(p.height/t.pixelBlock.height)!==o.length||h.x<0||h.y<0||p.widthv.pixelBlock),p,{clipOffset:h,clipSize:m})}}function H3e(i,e,t,r,n,s){const{width:o,height:a}=t.block,{x:l,y:u}=t.offset,{width:c,height:h}=t.mosaic,p=plr(o,a,r,n,l,u,c,h);let m=0,v=0;if(s){const w=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,S=o*s.resolutionX,I=s.startX+r*S;Iw?v=s.rightPadding:I>=w&&(m=s.leftMargin-s.rightPadding,v=0)}if(p.xmax-=v,typeof e!="number")for(let w=p.ymin;wbh(Q));if(a==null)return null;const l=n?n.width:e.width,u=n?n.height:e.height,c=a.width,h=a.height,p=e.width/c,m=e.height/h,v={offset:r||{x:0,y:0},mosaic:n||e,block:{width:c,height:h}},w=a.pixelType,S=Br.getPixelArrayConstructor(w),I=a.pixels.length,R=[];let L,k;for(let Q=0;QQ==null||Q.mask!=null&&Q.mask.length>0),$=i.some(Q=>Q?.bandMasks&&Q.bandMasks.length>1),V=B?new Uint8Array(l*u):void 0,Y=$?[]:void 0;if(V){for(let Q=0;QS!=null);if(r==null)return null;const n=i.some(S=>S==null||!!S.mask),{width:s,height:o}=e,a=n?new Uint8Array(s*o):null,{blockWidths:l}=t,u=[],c=r.getPlaneCount(),h=Br.getPixelArrayConstructor(r.pixelType);if(n)for(let S=0,I=0;SS?.bandMasks&&S.bandMasks.length>1),m=p?[]:void 0,v=s*o;for(let S=0;Sr||l>n||s===0&&o===0&&a===r&&l===n)return i;i.mask||(i.mask=new Uint8Array(r*n));const u=i.mask;for(let c=0;c=l||p=a?0:1}return i.updateStatistics(),i}function ylr(i){if(!bh(i))return null;const e=i.clone(),{width:t,height:r,pixels:n}=i,s=n[0],o=e.pixels[0],a=i.mask;for(let l=2;le&&(t=s.value,e=r),s=n.next();return t}function mhe(i,e,t){if(t===0)return;const r=i.get(e);r===1?i.delete(e):i.set(e,r-1)}function NJ(i,e,t){t!==0&&i.set(e,i.has(e)?i.get(e)+1:1)}function sRt(i,e,t){let{x:r,y:n}=e;const{width:s,height:o}=t;if(r===0&&n===0&&o===i.height&&s===i.width)return i;const{width:a,height:l}=i,u=Math.max(0,n),c=Math.max(0,r),h=Math.min(r+s,a),p=Math.min(n+o,l);if(h<0||p<0||!bh(i))return null;r=Math.max(0,-r),n=Math.max(0,-n);const{pixels:m}=i,v=s*o,w=m.length,S=[];for(let k=0;k0;m--)p=oRt(p,o);return p}function uRt(i,e,t,r,n=0){const{width:s,height:o}=i,{width:a,height:l}=e,u=r.cols,c=r.rows,h=Math.ceil(a/u-.1/u),p=Math.ceil(l/c-.1/c);let m,v,w,S,I,R,L;const k=h*u,B=k*p*c,$=new Float32Array(B),V=new Float32Array(B),Y=new Uint32Array(B),K=new Uint32Array(B);let Q,re,ne=0;for(let de=0;de{const Z=ne instanceof Float32Array||ne instanceof Float64Array?0:.5;for(let ae=0;ae0){const[tt,yt]=Vy(R,V,e,l),[Ct,ot]=Vy(S,I,e,l);ne.push(tt),ne.push(yt),ne.push(Ve),ne.push($e),ne.push(Ct),ne.push(ot)}else{const[tt,yt]=Vy(R,L,e,l),[Ct,ot]=Vy(k,B,e,l),[vt,At]=Vy(Y,K,e,l);de.push(Ve),de.push($e),de.push(vt),de.push(At),de.push(Ct),de.push(ot),de.push(tt),de.push(yt)}V+=s,I+=s,L+=s,B+=s,K+=s}const[pe,H]=Vy(u+w,c+o,e,l),Z=(r/2+h)*v,[ae,fe]=Vy(u+Z,c+o,e,l),[be,_e]=Vy(u+w,c-a,e,l),[Ie,Te]=Vy(u+Z,c-a,e,l);return{pennants:ne,barbs:de,shaft:[pe,H,ae,fe,be,_e,Ie,Te]}}function Vy(i,e,t,r=1){const n=Math.sqrt(i*i+e*e)/r,s=(2*Math.PI+Math.atan2(e,i))%(2*Math.PI);return[n,(2*Math.PI+s-t)%(2*Math.PI)]}const ghe=[0,1,3,6,10,16,21,27,33,40,47,55,63],Slr=[0,.5,1,1.5,2],Tlr=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function GL(i,e,t,r){const n=Q2e(r||"knots",t);let s;for(s=1;sB>0).length:p*m,R=new Float32Array(I*l),L=new Uint32Array(u*I),k=e.invertDirection?pRt(0,0,0,!1):wlr;for(let B=0;B=pHe){const I=(a[w]+360)%360/180*Math.PI,{pennants:R,barbs:L,shaft:k}=W3e[Math.min(Math.floor(S/5),29)];if(R.length+L.length===0)continue;let B=u.length/l;const $=(v+.5)/r,V=(m+.5)/n;for(let Y=0;Y=(K-V)*(Q-Y)*(1-n)){I[$]=1;const[re,ne]=eSe([w[$]/B,S[$]/B]);w[$]=re,S[$]=ne}else I[$]=0,w[$]=0,S[$]=0}const R=new Br({width:p,height:m,pixels:[w,S],mask:I});return R.updateStatistics(),R}function Mlr(i){const e=[];return MLe(Qtr(i),e),e.length?new jr(Ly(e[0])):null}function MLe(i,e){if(!i)return;let t;t=i.type==="CIMTextSymbol"?i.symbol:i;const r=i.type==="CIMPolygonSymbol";if(t?.symbolLayers){for(const n of t.symbolLayers)if(!(n.colorLocked||r&&(tir(n)||eir(n)&&n.markerPlacement&&mVe(n.markerPlacement))))switch(n.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":n.tintColor&&Aot(e,n.tintColor);break;case"CIMVectorMarker":n.markerGraphics?.forEach(s=>{MLe(s.symbol,e)});break;case"CIMSolidStroke":case"CIMSolidFill":Aot(e,n.color);break;case"CIMHatchFill":MLe(n.lineSymbol,e)}}}function Aot(i,e){for(const t of i)if(t.join(".")===e.join("."))return;i.push(e)}new d3(1e3);new jr([128,128,128]);const Olr=new jr("white");function hj(i,e){if(!i)return null;let t=null;return JF(i)?t=Plr(i):P2e(i)&&(t=i.type==="cim"?Mlr(i):i.color?new jr(i.color):null),t?Hne(t,e):null}function Plr(i){const e=i.symbolLayers;if(!e)return null;let t=null;return e.forEach(r=>{r.type==="object"&&r.resource?.href||(t=r.type==="water"?r.color:r.material?r.material.color:null)}),t?new jr(t):null}function Hne(i,e){if(e==null||i==null)return i;const t=i.toRgba();return t[3]=t[3]*e,new jr(t)}function Rlr(i,e,t){const r=i.symbolLayers;if(!r)return;const n=s=>Hne(e=e??s??(t!=null?Olr:null),t);r.forEach(s=>{if(s.type!=="object"||!s.resource?.href||e)if(s.type==="water")s.color=n(s.color);else{const o=s.material!=null?s.material.color:null,a=n(o);s.material==null?s.material=new vx({color:a}):s.material.color=a,t!=null&&"outline"in s&&s.outline?.color!=null&&(s.outline.color=Hne(s.outline.color,t))}})}function Dlr(i,e,t){(e=e??i.color)&&(i.color=Hne(e,t)),t!=null&&"outline"in i&&i.outline?.color&&(i.outline.color=Hne(i.outline.color,t))}function q3e(i,e,t){i&&(e||t!=null)&&(e&&(e=new jr(e)),JF(i)?Rlr(i,e,t):P2e(i)&&Dlr(i,e,t))}async function Flr(i,e){const t=i.symbolLayers;t&&await bqi(t,async r=>klr(r,e))}async function klr(i,e){switch(i.type){case"extrude":Nlr(i,e);break;case"icon":case"line":case"text":Llr(i,e);break;case"path":Blr(i,e);break;case"object":await $lr(i,e)}}function Llr(i,e){const t=fRt(e);t!=null&&(i.size=t)}function fRt(i){for(const e of i)if(typeof e=="number")return e;return null}function Nlr(i,e){i.size=typeof e[2]=="number"?e[2]:0}async function $lr(i,e){const{resourceSize:t,symbolSize:r}=await jlr(i),n=mRt(e,t,r);i.width=jie(e[0],r[0],t[0],n),i.depth=jie(e[1],r[1],t[1],n),i.height=jie(e[2],r[2],t[2],n)}function Blr(i,e){const t=mRt(e,nae,[i.width,void 0,i.height]);i.width=jie(e[0],i.width,1,t),i.height=jie(e[2],i.height,1,t)}function mRt(i,e,t){for(let r=0;r<3;r++){const n=i[r];switch(n){case"symbol-value":{const s=t[r];return s!=null?s/e[r]:1}case"proportional":break;default:if(n&&e[r])return n/e[r]}}return 1}async function jlr(i){const{computeObjectLayerResourceSize:e}=await Promise.resolve().then(()=>Lan),t=await e(i,10),{width:r,height:n,depth:s}=i,o=[r,s,n];let a=1;for(let l=0;l<3;l++){const u=o[l];if(u!=null){a=u/t[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=t[l]*a);return{resourceSize:t,symbolSize:o}}function jie(i,e,t,r){switch(i){case"proportional":return t*r;case"symbol-value":return e??t;default:return i}}function Glr(i,e){const t=fRt(e);if(t!=null)switch(i.type){case"simple-marker":i.size=t;break;case"picture-marker":{const r=i.width/i.height;r>1?(i.width=t,i.height=t*r):(i.width=t*r,i.height=t);break}case"simple-line":i.width=t;break;case"text":i.font.size=t}}async function gRt(i,e){if(i&&e)return JF(i)?Flr(i,e):void(P2e(i)&&Glr(i,e))}function yRt(i,e,t){if(i&&e!=null)if(JF(i)){const r=i.symbolLayers;r&&r.forEach(n=>{if(n&&n.type==="object")switch(t){case"tilt":n.tilt=(n.tilt??0)+e;break;case"roll":n.roll=(n.roll??0)+e;break;default:n.heading=(n.heading??0)+e}})}else P2e(i)&&(i.type!=="simple-marker"&&i.type!=="picture-marker"&&i.type!=="text"||(i.angle+=e))}async function Ulr(i,e){return await i.fetchSymbol(e)||i.fetchCIMSymbol(e)}var OLe;const Mot=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),yhe=new Rs({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),vhe=new Rs({flow_from:"flow-from",flow_to:"flow-to"});let X0=OLe=class extends Wk(Ci){constructor(i){super(i),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(i,e){return Mot.has(i)?Zw.fromJSON(i):null}readOutputUnit(i,e){return Mot.has(i)?Zw.fromJSON(i):null}get styleRenderer(){const i=this.style,e=this.attributeField,t=this._createStyleRenderer(i);return t.field=e,t}get sizeVariables(){const i=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="size"&&i.push(e);if(i.length===0){const e=new CY({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),i.push(e)}return i}get rotationVariables(){const i=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="rotation"&&i.push(e);if(i.length===0){const e=new k2e({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),i.push(e)}return i}clone(){return new OLe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:li(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(i,e=!1,t=[]){const r=new Array,n=Q2e(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,o=e?AW(i.pixelBlock,"vector-uv",s,n):_lr(i.pixelBlock,"vector-magdir",n);if(o==null)return r;const a=i.extent,l=o.mask!=null&&o.mask.length>0;let u=0;const c=(a.xmax-a.xmin)/o.width,h=(a.ymax-a.ymin)/o.height;for(let p=0;pS.intersects(v));if((!l||o.mask[u])&&!w){const S={Magnitude:o.pixels[0][u],Direction:o.pixels[1][u]},I=new Us({geometry:{type:"point",x:v.x,y:v.y,spatialReference:a.spatialReference},attributes:S});I.symbol=this._getVisualVariablesAppliedSymbol(I),r.push(I)}}return r}getSymbol(i,e){}async getSymbolAsync(i,e){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(i){return new Jh({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new vg({width:0}),size:20,color:i||new jr([0,92,230])})}_getVisualVariablesAppliedSymbol(i){if(!i)return;const e=this.styleRenderer?.getSymbol(i)?.clone(),t=this.sizeVariables,r=this.rotationVariables;if(t&&t.length&&this.sizeVariables.forEach(n=>gRt(e,J3t([n],i))),r&&r.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;i.attributes.Direction=i.attributes.Direction+n,this.rotationVariables.forEach(s=>yRt(e,q3t(s,i),s.axis))}return e}_createStyleRenderer(i){let e={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(i){case"single-arrow":e=this._createSingleArrowRenderer();break;case"beaufort-kn":e=this._createBeaufortKnotsRenderer();break;case"beaufort-m":e=this._createBeaufortMeterRenderer();break;case"beaufort-ft":e=this._createBeaufortFeetRenderer();break;case"beaufort-mi":e=this._createBeaufortMilesRenderer();break;case"beaufort-km":e=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":e=this._createCurrentMeterRenderer();break;case"ocean-current-kn":e=this._createCurrentKnotsRenderer();break;case"simple-scalar":e=this._createSimpleScalarRenderer();break;case"wind-barb":e=this._createWindBarbsRenderer();break;case"classified-arrow":e=this._createClassifiedArrowRenderer()}return new XB(e)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const i=[0,1,3,6,10,16,21,27,33,40,47,55,63],e=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new jr([214,47,39])),classBreakInfos:this._getClassBreaks(i,e)}}_createBeaufortMeterRenderer(){const i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],e=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new jr([214,47,39])),classBreakInfos:this._getClassBreaks(i,e)}}_createBeaufortFeetRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMilesRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortKilometersRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentMeterRenderer(){const i=[0,.5,1,1.5,2],e=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new jr([177,177,177])),classBreakInfos:this._getClassBreaks(i,e)}}_createCurrentKnotsRenderer(){const i=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],e=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new jr([177,177,177])),classBreakInfos:this._getClassBreaks(i,e)}}_createClassifiedArrowRenderer(){const i=this._getDefaultSymbol(new jr([56,168,0]));let e=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,n=this.sizeVariables[0].maxDataValue;if(r&&n){const s=(n-r)/5;e=Array.from(Array(6).keys()).map(o=>r+s*o)}}const t=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createSimpleScalarRenderer(){return{defaultSymbol:BP.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const i=Array.from(Array(31).keys()).map(n=>5*n),e=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],t=BP.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=i.map((n,s)=>{let o;if(s!==i.length-1)if(s===0)o={minValue:n,maxValue:i[s+1],symbol:t};else{const a=BP.fromJSON({type:"esriPMS",imageData:e[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:n,maxValue:i[s+1],symbol:a}}return new _W(o)});return{defaultSymbol:t,classBreakInfos:r}}_getClassBreaks(i,e){return e.map((t,r)=>new _W({minValue:i[r],maxValue:i[r+1],symbol:this._getDefaultSymbol(new jr(t))}))}};x([D({type:String,json:{write:!0}})],X0.prototype,"attributeField",void 0),x([D({type:vhe.apiValues,json:{type:vhe.jsonValues,read:{reader:vhe.read},write:{writer:vhe.write}}})],X0.prototype,"flowRepresentation",void 0),x([D({type:["geographic","arithmetic"],json:{write:!0}})],X0.prototype,"rotationType",void 0),x([D({type:yhe.apiValues,json:{type:yhe.jsonValues,read:{reader:yhe.read},write:{writer:yhe.write}}})],X0.prototype,"style",void 0),x([D({json:{write:!0}})],X0.prototype,"symbolTileSize",void 0),x([D({type:Zw.apiValues,json:{type:Zw.jsonValues,write:{writer:Zw.write}}})],X0.prototype,"inputUnit",void 0),x([Mi("inputUnit")],X0.prototype,"readInputUnit",null),x([D({type:Zw.apiValues,json:{type:Zw.jsonValues,read:{reader:Zw.read},write:{writer:Zw.write}}})],X0.prototype,"outputUnit",void 0),x([Mi("outputUnit")],X0.prototype,"readOutputUnit",null),x([Wr({vectorField:"vector-field"})],X0.prototype,"type",void 0),x([D({type:XB})],X0.prototype,"styleRenderer",null),x([D({type:CY})],X0.prototype,"sizeVariables",null),x([D({type:k2e})],X0.prototype,"rotationVariables",null),X0=OLe=x([Qe("esri.renderers.VectorFieldRenderer")],X0);const fHe=X0,S1e={key:"type",base:null,typeMap:{"unique-value":JB,"class-breaks":XB,"raster-colormap":aHe,"raster-stretch":lHe,"vector-field":fHe,"raster-shaded-relief":QPt,flow:qPt}},T1e={...S1e,typeMap:{...S1e.typeMap}};delete T1e.typeMap["vector-field"],delete T1e.typeMap.flow;const zlr={uniqueValue:JB,classBreaks:XB,rasterStretch:lHe,rasterColormap:aHe,vectorField:fHe,rasterShadedRelief:QPt,flowRenderer:qPt};function Vlr(i){return i&&zlr[i.type]||null}function vRt(i,e){if(!i)return null;if(i.type==="classBreaks"&&i.classificationMethod){const r=i.authoringInfo||{classificationMethod:""};r.classificationMethod=i.classificationMethod,i.authoringInfo=r}i.type==="vectorField"&&i.visualVariables&&!Array.isArray(i.visualVariables)&&(i.visualVariables=[i.visualVariables]);const t=Vlr(i);if(t){const r=new t;return r.read(i,e),r}return e?.messages&&i&&e.messages.push(new Rf("renderer:unsupported","Renderers of type '"+(i.type||"unknown")+"' are not supported",{definition:i,context:e})),null}var PLe;let KN=PLe=class extends Ci{constructor(i){super(i),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new PLe({variableName:this.variableName,dimensionName:this.dimensionName,values:li(this.values),isSlice:this.isSlice})}};x([D({type:String,json:{write:!0}})],KN.prototype,"variableName",void 0),x([D({type:String,json:{write:!0}})],KN.prototype,"dimensionName",void 0),x([D({type:bJ.array(bJ.oneOf([bJ.native(Number),bJ.array(bJ.native(Number))])),json:{write:!0}})],KN.prototype,"values",void 0),x([D({type:Boolean,json:{write:!0}})],KN.prototype,"isSlice",void 0),KN=PLe=x([Qe("esri.layers.support.DimensionalDefinition")],KN);const gR=KN,UP=pa()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Gie=pa()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),zV=pa()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let b4=class extends Ci{constructor(){super(...arguments),this.pixelType="unknown"}};x([D({type:String,json:{write:!0}})],b4.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],b4.prototype,"description",void 0),x([D({type:ms,json:{type:ms,write:!0,name:"_object_id"}})],b4.prototype,"id",void 0),x([D({type:String,json:{type:zV.jsonValues,read:zV.read,write:zV.write}})],b4.prototype,"pixelType",void 0),x([D({type:String,json:{write:!0}})],b4.prototype,"type",void 0),b4=x([Qe("esri.layers.support.RasterFunctionInfo")],b4);const Hlr=b4;let tO=class extends Ci{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};x([D({type:String,json:{write:!0}})],tO.prototype,"name",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],tO.prototype,"id",void 0),x([D({type:Boolean,json:{write:!0}})],tO.prototype,"isDataset",void 0),x([D({type:Boolean,json:{write:!0}})],tO.prototype,"isPublic",void 0),x([D({json:{write:!0}})],tO.prototype,"value",void 0),x([D({type:String,json:{write:!0}})],tO.prototype,"type",void 0),tO=x([Qe("esri.layers.support.RasterFunctionVariable")],tO);const Wlr=tO,_he={key:"type",base:null,typeMap:{RasterFunctionVariable:Wlr}};let ZN=class extends Ci{};x([D({types:_he,json:{types:_he,name:"MatchVariable"}})],ZN.prototype,"matchVariable",void 0),x([D({types:_he,json:{types:_he,name:"UnionDimension"}})],ZN.prototype,"unionDimension",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],ZN.prototype,"id",void 0),x([D({type:String,json:{write:!0}})],ZN.prototype,"type",void 0),ZN=x([Qe("esri.layers.support.RasterFunctionProperties")],ZN);const qlr=ZN,Y3e=new Rs({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let zg=class extends Ci{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};x([D({type:[String],json:{write:!0}})],zg.prototype,"aliases",void 0),x([D({type:Object,json:{write:!0}})],zg.prototype,"arguments",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"description",void 0),x([D({type:Hlr,json:{write:!0,name:"function"}})],zg.prototype,"functionInfo",void 0),x([D({type:Y3e.apiValues,json:{type:[0,1,2],read:Y3e.read,write:Y3e.write}})],zg.prototype,"functionType",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"group",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"help",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],zg.prototype,"id",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"name",void 0),x([D({type:String,json:{write:!0,name:"definition"}})],zg.prototype,"queryDefinition",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"tag",void 0),x([D({type:qlr,json:{write:!0}})],zg.prototype,"properties",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"thumbnail",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"thumbnailEx",void 0),x([D({json:{type:["RasterFunctionTemplate"],write:!0}})],zg.prototype,"type",void 0),zg=x([Qe("esri.layers.support.RasterFunctionTemplate")],zg);const _Rt=zg;var RLe;const Ume=new Set(["raster","raster2","dem","fillraster"]),zme=new Set(["rasters"]),Oot=i=>i?.rasterFunction?hv.fromJSON(i):i,X3e=i=>i&&i instanceof hv?i.toJSON():i,DLe=i=>i?.functionName&&!i.declaredClass,Pot=i=>DLe(i)?new hv(i):i,Ylr=i=>{if(i==null)return null;i=li(i);const e={};for(const t of Object.keys(i))Ume.has(t.toLowerCase())?e[t]=Oot(i[t]):zme.has(t.toLowerCase())&&Array.isArray(i[t])?e[t]=i[t].map(Oot):e[t]=i[t];return e},Xlr={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:_Rt}},json:{write:!0,name:"rasterFunctionDefinition"}};let hv=RLe=class extends Ci{constructor(i){super(i),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(i){if(i){const e=Object.keys(i);if(e.some(t=>Ume.has(t.toLowerCase())&&DLe(i[t]))||e.some(t=>zme.has(t.toLowerCase())&&Array.isArray(i[t])&&i[t].some(r=>DLe(r)))){i=li(i);for(const t of e)Ume.has(t.toLowerCase())?i[t]=Pot(i[t]):zme.has(t.toLowerCase())&&Array.isArray(i[t])&&(i[t]=i[t].map(r=>Pot(r)))}}this._set("functionArguments",i)}readFunctionArguments(i){return Ylr(i)}writeFunctionArguments(i,e,t){const r={};for(const n of Object.keys(i))Ume.has(n.toLowerCase())?r[n]=X3e(i[n]):zme.has(n.toLowerCase())&&Array.isArray(i[n])?r[n]=i[n].map(X3e):r[n]=X3e(i[n]);e[t]=r}readFunctionName(i,e){const t=e.rasterFunctionInfos;return e.name||(t?.length&&t[0].name!=="None"?t[0].name:e.rasterFunctionDefinition?e.rasterFunctionDefinition.name:e.rasterFunction)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(i){this.functionDefinition=i?_Rt.fromJSON(i):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new RLe({functionName:this.functionName,functionArguments:li(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:li(this.rasterFunctionDefinition)})}};x([D({json:{type:Object,name:"rasterFunctionArguments"}})],hv.prototype,"functionArguments",null),x([Mi("functionArguments")],hv.prototype,"readFunctionArguments",null),x([ur("functionArguments")],hv.prototype,"writeFunctionArguments",null),x([D({json:{type:String,write:{target:"rasterFunction"}}})],hv.prototype,"functionName",void 0),x([Mi("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],hv.prototype,"readFunctionName",null),x([Wr({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),D({json:{default:"unknown"}})],hv.prototype,"outputPixelType",void 0),x([D({type:String,json:{read:!0,write:!0}})],hv.prototype,"variableName",void 0),x([D()],hv.prototype,"rasterFunctionDefinition",null),x([D(Xlr)],hv.prototype,"functionDefinition",void 0),x([D()],hv.prototype,"hasClipFunction",null),hv=RLe=x([Qe("esri.layers.support.RasterFunction")],hv);const kl=hv,Jlr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Klr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Zlr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Qlr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function bRt(i){return Qlr.has(i.type)}function J3e(i,e){if(!i||!e)return li(i||e);const t=li(i);if(t.functionDefinition&&e.rasterFunctionDefinition){const r=e.rasterFunctionDefinition;(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=void 0),wRt(t.functionDefinition.arguments,e),t.rasterFunctionDefinition=t.functionDefinition.toJSON()}else e.functionName?.toLowerCase()!=="none"&&(xRt(t.functionArguments).Raster=e);return t}function wRt(i,e){for(const t in i)t.toLowerCase()==="raster"&&(i[t].type==="RasterFunctionVariable"?(i[t]=e.rasterFunctionDefinition,i[t].type="RasterFunctionTemplate"):i[t].type==="RasterFunctionTemplate"&&wRt(i[t].arguments,e))}function f3(i){const e=li(Jlr[i.functionName+"Function"]),t=i.functionArguments;for(const r in t)r.toLowerCase()==="raster"?(e.arguments[r]=f3(t[r]),e.arguments[r].type="RasterFunctionTemplate"):r.toLowerCase()==="colormap"?(e.arguments[r].value=lur(t[r]),e.arguments.ColorSchemeType.value=0):e.arguments[r].value=t[r];return e}function eur(i,e){switch(e=e||{},i.type){case"raster-stretch":return rur(i,e);case"class-breaks":return nur(i,e);case"unique-value":return sur(i,e);case"raster-colormap":return our(i,e);case"vector-field":return tur(i,e);case"raster-shaded-relief":return iur(i,e);case"flow":throw new Error("Unsupported rendering rule.")}}function xRt(i){const e=i?.Raster??i?.raster;return e&&e.declaredClass==="esri.layers.support.RasterFunction"?xRt(e.functionArguments):i}const $J={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function tur(i,e){const t=new kl;t.functionName="VectorFieldRenderer";const{dataType:r,bandNames:n}=e,s=r==="vector-uv";let o,a;if(n&&n.length===2){const m=n.map(v=>v.toLowerCase());o=m.indexOf("magnitude"),a=m.indexOf("direction")}o!==-1&&o!==null||(o=0,a=1);const l=i.rotationType==="arithmetic"?1:2,u=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(m=>m.field==="Magnitude"):new CY,h={magnitudeBandID:o,directionBandID:a,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Zlr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};t.functionArguments=h;const p=f3(t);return e.convertToRFT?kl.fromJSON({rasterFunctionDefinition:p}):t}function iur(i,e){const t=e.convertToRFT;if(e.dataType!=="elevation"&&(e.dataType!=="generic"||e.bandCount!==1||e.pixelType!=="s16"&&e.pixelType!=="s32"&&e.pixelType!=="f32"&&e.pixelType!=="f64"))return new kl;const r=new kl;r.functionName="Hillshade";const n=i.hillshadeType==="traditional"?0:1,s=i.scalingType==="none"?1:3,o={HillshadeType:n,SlopeType:s,ZFactor:i.zFactor};return n===0&&(o.Azimuth=i.azimuth,o.Altitude=i.altitude),s===3&&(o.PSPower=i.pixelSizePower,o.PSZFactor=i.pixelSizeFactor),r.functionArguments=o,r.variableName="Raster",i.colorRamp&&(r.functionName="ShadedRelief",t?o.ColorRamp=ZPt(i.colorRamp):o.Colormap=tk(i.colorRamp)),t?new kl({rasterFunctionDefinition:f3(r)}):r}function rur(i,e){const t=e.convertToRFT,r=new kl;r.functionName="Stretch";const n=$J[Nie.toJSON(i.stretchType)],s="u8",o={StretchType:n,Statistics:aur(i.statistics??[]),DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(o.Min=i.outputMin),i.outputMax!=null&&(o.Max=i.outputMax),n===$J.standardDeviation?(o.NumberOfStandardDeviations=i.numberOfStandardDeviations,r.outputPixelType=s):n===$J.percentClip?(o.MinPercent=i.minPercent,o.MaxPercent=i.maxPercent,r.outputPixelType=s):n===$J.minMax?r.outputPixelType=s:n===$J.sigmoid&&(o.SigmoidStrengthLevel=i.sigmoidStrengthLevel),r.functionArguments=o,r.variableName="Raster",i.colorRamp){const a=i.colorRamp,l=new kl;if(t)l.functionArguments={ColorRamp:ZPt(a)};else{const u=XPt(a,!0);if(u)l.functionArguments={colorRampName:u};else if(!e.convertColorRampToColormap||a.type!=="algorithmic"&&a.type!=="multipart"){const c=i.colorRamp.toJSON();c.type==="algorithmic"?c.algorithm=c.algorithm||"esriCIELabAlgorithm":c.type==="multipart"&&c.colorRamps?.length&&c.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),l.functionArguments={colorRamp:c}}else l.functionArguments={Colormap:tk(a)}}return l.variableName="Raster",l.functionName="Colormap",l.functionArguments.Raster=r,t?new kl({rasterFunctionDefinition:f3(l)}):l}return t?new kl({rasterFunctionDefinition:f3(r)}):r}function nur(i,e){const t=[],r=[],n=[],s=[],{pixelType:a,rasterAttributeTable:l}=e,u=l==null?null:l.features,c=SRt(l);if(c&&u&&Array.isArray(u)&&i.classBreakInfos){i.classBreakInfos.forEach((S,I)=>{const R=S.symbol?.color;let L;R?.a&&S.minValue!=null&&S.maxValue!=null&&u.forEach(k=>{S.minValue!=null&&S.maxValue!=null&&(L=k.attributes[i.field],(L>=S.minValue&&L=S.minValue)&&s.push([k.attributes[c],R.r,R.g,R.b]))})});const v=a?C1e(s,a):s,w=new kl;return w.functionName="Colormap",w.functionArguments={},w.functionArguments.Colormap=v,w.variableName="Raster",e.convertToRFT?new kl({rasterFunctionDefinition:f3(w)}):w}i.classBreakInfos.forEach((v,w)=>{if(v.minValue==null||v.maxValue==null)return;const S=v.symbol&&v.symbol.color;S?.a?(w===0?t.push(v.minValue,v.maxValue+1e-4):t.push(v.minValue+1e-4,v.maxValue+1e-4),r.push(w),s.push([w,S.r,S.g,S.b])):n.push(v.minValue,v.maxValue)});const h=a?C1e(s,a):s,p=new kl;p.functionName="Remap",p.functionArguments={InputRanges:t,OutputValues:r,NoDataRanges:n},p.variableName="Raster";const m=new kl;return m.functionName="Colormap",m.functionArguments={Colormap:h,Raster:p},e.convertToRFT?new kl({rasterFunctionDefinition:f3(m)}):m}function C1e(i,e){const t=Klr.has(e)?Yx(e):null;return t&&i.push([Math.floor(t[0]-1),0,0,0],[Math.ceil(t[1]+1),0,0,0]),i}function SRt(i){if(i==null)return;const{fields:e}=i;return e?.find(r=>r?.name&&r.name.toLowerCase()==="value")?.name}function sur(i,e){const t=[],{pixelType:r,rasterAttributeTable:n}=e,s=n==null?null:n.features,o=SRt(n),a=i.defaultSymbol?.color?.toRgb(),l=i.uniqueValueInfos;if(l)if(s){if(o){const h=new Map;l.forEach(m=>{const v=m.value,w=m.symbol?.color;v!=null&&w?.a&&h.set(String(v),w.toRgb())});const p=i.field;s.forEach(({attributes:m})=>{const v=String(m[p]),w=m[o],S=h.get(v);S?t.push([w,...S]):a&&t.push([w,...a])})}}else for(let h=0;h{const r=t;if(Array.isArray(r))e.push(r);else{if(r.min==null||r.max==null)return;const n=[r.min,r.max,r.avg||0,r.stddev||0];e.push(n)}}),e}function lur(i){const e=[],t=[];return i.forEach(r=>{e.push(r[0]),t.push(Yar([...r.slice(1),255]))}),{type:"RasterColormap",values:e,colors:t}}var FLe;const Uie=pa()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),kLe=pa()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function uur(i){let e;switch(i?i.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":e="esriMosaicAttribute";break;case"lockraster":e="esriMosaicLockRaster";break;case"center":e="esriMosaicCenter";break;case"northwest":e="esriMosaicNorthwest";break;case"nadir":e="esriMosaicNadir";break;case"viewpoint":e="esriMosaicViewpoint";break;case"seamline":e="esriMosaicSeamline";break;default:e="esriMosaicNone"}return kLe.fromJSON(e)}let qf=FLe=class extends Ci{constructor(i){super(i),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(i,e){return e.ascending!=null?e.ascending:e.sortAscending==null||e.sortAscending}get itemRenderingRule(){return ty(di.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(i){ty(di.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",i)}readMethod(i,e){return uur(e.mosaicMethod||e.defaultMosaicMethod)}writeMultidimensionalDefinition(i,e,t){i!=null&&(i=i.filter(({variableName:r,dimensionName:n})=>r&&r!=="*"||n)).length&&(e[t]=i.map(r=>r.toJSON()))}readOperation(i,e){const t=e.mosaicOperation,r=e.mosaicOperator?.toLowerCase(),n=t||(r?Uie.toJSON(r):null);return Uie.fromJSON(n)||"first"}castSortValue(i){return i==null||typeof i=="string"||typeof i=="number"?i:`${i}`}clone(){return new FLe({ascending:this.ascending,itemRasterFunction:li(this.itemRasterFunction),lockRasterIds:li(this.lockRasterIds),method:this.method,multidimensionalDefinition:li(this.multidimensionalDefinition),objectIds:li(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:li(this.viewpoint),where:this.where})}};x([D({type:Boolean,json:{write:!0}})],qf.prototype,"ascending",void 0),x([Mi("ascending",["ascending","sortAscending"])],qf.prototype,"readAscending",null),x([D({type:kl,json:{name:"itemRenderingRule",write:!0}})],qf.prototype,"itemRasterFunction",void 0),x([D({type:kl})],qf.prototype,"itemRenderingRule",null),x([D({type:[ms],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],qf.prototype,"lockRasterIds",void 0),x([D({type:String,json:{type:kLe.jsonValues,write:{target:"mosaicMethod",writer:kLe.write}}})],qf.prototype,"method",void 0),x([Mi("method",["mosaicMethod","defaultMosaicMethod"])],qf.prototype,"readMethod",null),x([D({type:[gR],json:{write:!0}})],qf.prototype,"multidimensionalDefinition",void 0),x([ur("multidimensionalDefinition")],qf.prototype,"writeMultidimensionalDefinition",null),x([D({type:[ms],json:{name:"fids",write:!0}})],qf.prototype,"objectIds",void 0),x([D({json:{type:Uie.jsonValues,read:{reader:Uie.read},write:{target:"mosaicOperation",writer:Uie.write}}})],qf.prototype,"operation",void 0),x([Mi("operation",["mosaicOperation","mosaicOperator"])],qf.prototype,"readOperation",null),x([D({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],qf.prototype,"sortField",void 0),x([D({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],qf.prototype,"sortValue",void 0),x([So("sortValue")],qf.prototype,"castSortValue",null),x([D({type:$i,json:{write:!0}})],qf.prototype,"viewpoint",void 0),x([D({type:String,json:{write:!0}})],qf.prototype,"where",void 0),qf=FLe=x([Qe("esri.layers.support.MosaicRule")],qf);const Qw=qf;let Ap=class extends Ci{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(e,t,r){this.layer.version<10.3||(t[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,t,r){this.format&&this.format.toLowerCase().includes("jpg")&&e!=null&&(t[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,t,r){this.format==="lerc"&&e!=null&&(t[r]=e)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(e,t,r){this.format==="lerc"&&this.layer.version>=10.5&&(t[r]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("rasterFunction"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("definitionExpression"),e.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const r=e.definitionExpression;return t?r&&r!==t.where&&(t=t.clone(),t.where=r):r&&(t=new Qw({where:r})),t}get rasterFunction(){const e=this.layer;let{rasterFunction:t}=e;const r=e.pixelFilter,n=!e.format||e.format.includes("jpg")||e.format.includes("png");t=this._addResampleRasterFunction(t);const s=e.multidimensionalSubset?.areaOfInterest;return s&&(t=this._addClipFunction(t,s)),n&&!r&&e.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(e){const t=this.layer,{rasterInfo:r,renderer:n}=t;return e=e||t.rasterFunction,!n||!bRt(n)?e:J3e(eur(n,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandNames:r.bandInfos.map(({name:s})=>s),convertColorRampToColormap:t.version<10.6,convertToRFT:!!e?.rasterFunctionDefinition,bandCount:r.bandCount}),e)}_addResampleRasterFunction(e){if(this.layer.renderer?.type!=="vector-field"||e?.functionName==="Resample")return e;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,r=this.layer.serviceRasterInfo.pixelSize;let n=new kl({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:r}});return n=e?.rasterFunctionDefinition?new kl({rasterFunctionDefinition:f3(n)}):n,J3e(n,e)}_addClipFunction(e,t){const r=new kl({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return J3e(r,e)}};x([D()],Ap.prototype,"layer",void 0),x([D({json:{write:!0}})],Ap.prototype,"adjustAspectRatio",null),x([ur("adjustAspectRatio")],Ap.prototype,"writeAdjustAspectRatio",null),x([D({json:{write:!0}})],Ap.prototype,"bandIds",null),x([D({json:{write:!0}})],Ap.prototype,"compression",void 0),x([D({json:{write:!0}})],Ap.prototype,"compressionQuality",null),x([ur("compressionQuality")],Ap.prototype,"writeCompressionQuality",null),x([D({json:{write:!0}})],Ap.prototype,"compressionTolerance",null),x([ur("compressionTolerance")],Ap.prototype,"writeCompressionTolerance",null),x([D({json:{write:!0}})],Ap.prototype,"format",null),x([D({type:String,json:{read:{reader:UP.read},write:{writer:UP.write}}})],Ap.prototype,"interpolation",null),x([D({json:{write:!0}})],Ap.prototype,"noData",null),x([D({type:String,json:{read:{reader:Gie.read},write:{writer:Gie.write}}})],Ap.prototype,"noDataInterpretation",null),x([D({json:{write:!0}})],Ap.prototype,"pixelType",void 0),x([D({json:{write:!0}})],Ap.prototype,"lercVersion",void 0),x([ur("lercVersion")],Ap.prototype,"writeLercVersion",null),x([D({type:Number})],Ap.prototype,"version",null),x([D({json:{write:!0}})],Ap.prototype,"mosaicRule",null),x([D({json:{write:!0,name:"renderingRule"}})],Ap.prototype,"rasterFunction",null),Ap=x([Qe("esri.layers.mixins.ExportImageServiceParameters")],Ap);async function E1e(i,e,t){let r;try{r=await createImageBitmap(i)}catch(n){throw new qe("request:server",`Unable to load ${e}`,{url:e,error:n})}return hn(t),r}async function ik(i,e,t,r,n){let s;try{s=await createImageBitmap(i)}catch(o){throw new qe("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:o,level:e,row:t,col:r})}return hn(n),s}var LLe;const cur={base:Nr,key:"type",typeMap:{extent:hr,polygon:$s}};let QN=LLe=class extends Ci{constructor(i){super(i),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:i}=this;if(i==null||i.length===0)return[];const e=new Map;i.forEach(r=>{if(!r.dimensionName)return;let n,s;if(Array.isArray(r.values[0])){const o=r.values;n=o[0][0],s=o[r.values.length-1][1]}else{const o=r.values;n=o[0],s=o[r.values.length-1]}if(e.has(r.dimensionName)){const o=e.get(r.dimensionName);o[0]=Math.min(n,o[0]),o[1]=Math.max(s,o[1])}else e.set(r.dimensionName,[n,s])});const t=[];for(const r of e)t.push({name:r[0],extent:r[1]});return t}get variables(){const{subsetDefinitions:i}=this;if(i==null||i.length===0)return[];const e=new Set;return i.forEach(t=>{t.variableName&&e.add(t.variableName)}),[...e]}clone(){const i=this.subsetDefinitions?.map(t=>t.clone()),e=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new LLe({areaOfInterest:e,subsetDefinitions:i})}};x([D({types:cur,json:{read:Ro,write:!0}})],QN.prototype,"areaOfInterest",void 0),x([D({readOnly:!0})],QN.prototype,"dimensions",null),x([D({readOnly:!0})],QN.prototype,"variables",null),x([D({type:[gR],json:{write:!0}})],QN.prototype,"subsetDefinitions",void 0),QN=LLe=x([Qe("esri.layers.support.MultidimensionalSubset")],QN);const TRt=QN;var NLe;function UL(i){return i=Number(i),isNaN(i)?void 0:i}let UT=NLe=class extends Ci{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new NLe({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};x([D({json:{name:"BandName",write:!0}})],UT.prototype,"name",void 0),x([D({json:{name:"WavelengthMin",read:{reader:UL},write:!0}})],UT.prototype,"minWavelength",void 0),x([D({json:{name:"WavelengthMax",read:{reader:UL},write:!0}})],UT.prototype,"maxWavelength",void 0),x([D({json:{name:"RadianceBias",read:{reader:UL},write:!0}})],UT.prototype,"radianceBias",void 0),x([D({json:{name:"RadianceGain",read:{reader:UL},write:!0}})],UT.prototype,"radianceGain",void 0),x([D({json:{name:"ReflectanceBias",read:{reader:UL},write:!0}})],UT.prototype,"reflectanceBias",void 0),x([D({json:{name:"ReflectanceGain",read:{reader:UL},write:!0}})],UT.prototype,"reflectanceGain",void 0),x([D({json:{name:"SolarIrradiance",read:{reader:UL},write:!0}})],UT.prototype,"solarIrradiance",void 0),UT=NLe=x([Qe("esri.layers.support.RasterBandInfo")],UT);const Rot=UT;var $Le;function BJ(i){return i=Number(i),isNaN(i)?void 0:i}let bw=$Le=class extends Ci{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(i){return new Date(i)}writeAcquisitionDate(i,e){e.AcquisitionDate=i.getTime()}clone(){return new $Le({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};x([D({json:{name:"AcquisitionDate",write:!0}})],bw.prototype,"acquisitionDate",void 0),x([Mi("acquisitionDate")],bw.prototype,"readAcquisitionDate",null),x([ur("acquisitionDate")],bw.prototype,"writeAcquisitionDate",null),x([D({json:{name:"CloudCover",read:{reader:BJ},write:!0}})],bw.prototype,"cloudCover",void 0),x([D({json:{name:"ProductName",write:!0}})],bw.prototype,"productName",void 0),x([D({json:{name:"SensorName",write:!0}})],bw.prototype,"sensorName",void 0),x([D({json:{name:"SensorAzimuth",read:{reader:BJ},write:!0}})],bw.prototype,"sensorAzimuth",void 0),x([D({json:{name:"SensorElevation",read:{reader:BJ},write:!0}})],bw.prototype,"sensorElevation",void 0),x([D({json:{name:"SunAzimuth",read:{reader:BJ},write:!0}})],bw.prototype,"sunAzimuth",void 0),x([D({json:{name:"SunElevation",read:{reader:BJ},write:!0}})],bw.prototype,"sunElevation",void 0),bw=$Le=x([Qe("esri.layers.support.RasterSensorInfo")],bw);const hur=bw;var BLe;let Ty=BLe=class extends Ci{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new BLe({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:li(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:li(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:li(this.tileInfo),transposeInfo:li(this.transposeInfo),blockBoundary:li(this.blockBoundary)})}};x([D({type:Number,json:{write:!0}})],Ty.prototype,"blockWidth",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"blockHeight",void 0),x([D({type:String,json:{write:!0}})],Ty.prototype,"compression",void 0),x([D({type:$i,json:{write:!0}})],Ty.prototype,"origin",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"firstPyramidLevel",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"maximumPyramidLevel",void 0),x([D({json:{write:!0}})],Ty.prototype,"pyramidResolutions",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidScalingFactor",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidBlockWidth",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidBlockHeight",void 0),x([D({type:Boolean,json:{write:!0}})],Ty.prototype,"isVirtualTileInfo",void 0),x([D({json:{write:!0}})],Ty.prototype,"tileInfo",void 0),x([D()],Ty.prototype,"transposeInfo",void 0),x([D()],Ty.prototype,"blockBoundary",void 0),Ty=BLe=x([Qe("esri.layers.support.RasterStorageInfo")],Ty);const QB=Ty;var jLe;let Sh=jLe=class extends Ci{constructor(i){super(i),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const i=this.keyProperties.BandProperties,{bandCount:e}=this;if(!i?.length||i.lengthRot.fromJSON(r));for(let r=0;rn!=null?n.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(n=>n!=null?n.toJSON():null),primaryRasterIds:e.primaryRasterIds},t);return r?new Br(r):null}async stretch(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON(),stretchParams:e.stretchParams},n=await this._workerThread.invoke("stretch",r,t);return n?new Br(n):null}async split(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON(),tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},n=await this._workerThread.invoke("split",r,t);return n&&n.forEach((s,o)=>{n.set(o,s?Br.fromJSON(s):null)}),n}async clipTile(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={...e,pixelBlock:e.pixelBlock.toJSON()},n=await this._workerThread.invoke("clipTile",r,t);return n?Br.fromJSON(n):null}async estimateStatisticsHistograms(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,t)}async mosaicAndTransform(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...e,srcPixelBlocks:e.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},n=await this._workerThread.invoke("mosaicAndTransform",r,t);return{pixelBlock:n.pixelBlock?new Br(n.pixelBlock):null,localNorthDirections:n.localNorthDirections}}async createFlowMesh(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");const r={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:n,simulationSettings:s}=e,o=await this._workerThread.invoke("createFlowMesh",{meshType:n,flowData:r,simulationSettings:s},{...t,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");const r=e.datumTransformation!=null?e.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,n=e.rasterTransform!=null?e.rasterTransform.toJSON():null,s={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:r,rasterTransform:n,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,t)}};function ERt(i,e,t){const r=e.shift();if(t.length===0){const s=[];t.push({sliceId:-1,multidimensionalDefinition:s})}const n=t.length;for(let s=0;s{t.push({sliceId:-1,multidimensionalDefinition:[...o,{variableName:i,dimensionName:r.name,values:[a]}]})})}e.length&&ERt(i,e,t)}function dur(i,e){const t=[];let r=0;return(e?i.variables.filter(n=>n.name.toLowerCase()===e.toLowerCase()):[...i.variables].sort((n,s)=>n.name>s.name?1:-1)).forEach(n=>{const s=[],o=[...n.dimensions].sort((a,l)=>a.name>l.name?-1:1);ERt(n.name,o,s),s.forEach(a=>{t.push({...a,sliceId:r++})})}),t}function pur(i,e,t){let r=i;if(e&&(e=[...e].sort((n,s)=>n.dimensionName{s.length&&(r=r.filter(a=>{const l=a.multidimensionalDefinition.find(c=>c.dimensionName===n);if(l==null)return!1;const u=l.values[0];return typeof u=="number"?typeof s[0]=="number"?s.includes(u):s.some(c=>c[0]<=u&&c[1]>=u):typeof s[0]=="number"?s.some(c=>u[0]<=c&&u[1]>=c):o?s.some(c=>c[0]===u[0]&&c[0]===u[1]):s.some(c=>c[0]>=u[0]&&c[0]<=u[1]||c[1]>=u[0]&&c[1]<=u[1]||c[0]u[1])}))}),r.length&&t?.start!=null&&t.end!=null){const n=t.start.getTime(),s=t.end.getTime(),o=r[0].multidimensionalDefinition.findIndex(a=>a.dimensionName==="StdTime");o>-1&&(r=r.filter(a=>{const l=a.multidimensionalDefinition[o].values[0];return n<=l&&s>=l}))}return r.map(n=>n.sliceId)}function IRt(i,e){return Array.isArray(i)?e[0]===e[1]?i[0]===e[0]||i[1]===e[0]:i[0]>=e[0]&&i[0]<=e[1]&&i[1]>=e[0]&&i[1]<=e[1]:i>=e[0]&&i<=e[1]}function fur(i,e){return i[0]<=e[0]&&i[1]>=e[0]||i[0]<=e[1]&&i[1]>=e[1]||i[0]>=e[0]&&i[1]<=e[1]}function ARt(i){return i.length===1?[i[0],i[0]]:[i[0],i[i.length-1]]}function MRt(i,e,t){if(!e?.subsetDefinitions?.length)return i;let r;if(t){const{variables:o}=e;if(o.length&&!o.includes(t))return null;const a=e.subsetDefinitions.find(l=>l.dimensionName===i.name&&l.variableName===t);if(!a?.values?.length)return i;r=ARt(a.values)}else r=e.dimensions.find(({name:a})=>a===i.name)?.extent;const n=r;if(!n?.length)return i;const s=i.values.filter(o=>IRt(o,n));return{...i,extent:[...n],values:s}}function Wne(i,e,t){if(!e?.subsetDefinitions?.length)return!1;const{variables:r}=e;if(r.length&&i.some(({variableName:n})=>n&&!r.includes(n)))return!0;for(let n=0;n(s.variableName===""||a.variableName===s.variableName)&&a.dimensionName===s.dimensionName);if(o?.values.length){const a=ARt(o.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&t){if(!fur(s.values,a))return!0}else if(s.values.some(l=>!IRt(l,a)))return!0}}return!1}function K3e(i,e){if(i==null)return{isOutside:!1};const{geometry:t,timeExtent:r,multidimensionalDefinition:n}=e;let s=null;if(r!=null&&(s=mur(i,r),s==null))return{isOutside:!0};const{areaOfInterest:o}=i;if(o&&t){const a=t.type==="point"?t:t.type==="extent"?t.center:t.type==="polygon"?t.centroid:null;if(a&&!o.contains(a))return{isOutside:!0}}return n!=null&&n.length&&Wne(n,i,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:t,timeExtent:s,multidimensionalDefinition:n}}}function mur(i,e){const t=i.dimensions.find(({name:o})=>o==="StdTime");if(t==null||e.start==null&&e.end==null)return e;e=e.clone();const{start:r,end:n}=e.toJSON(),s=r===n?[r]:r!=null&&n!=null?[r,n]:[r??n];return s.length===2&&t?.extent.length&&(s[0]=Math.max(s[0],t.extent[0]),s[1]=Math.min(s[1],t.extent[1]??t.extent[0]),s[1]s.variables.includes(c))),l?u.find(({name:c})=>c===l)??u[0]:u[0]}function ULe(i,e={}){const t=GLe(i,e);if(!t)return null;const r=[],{dimensions:n,name:s}=t;if(n.length===0)return[new gR({variableName:s,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(e.values==null)return!0;const t=e.values.length;return t===0||t>1||!e.isSlice&&Array.isArray(e.values[0])})}function PRt(i,e){if(e==null||i==null)return null;let t=e.variables.map(r=>({...r}));return i?.variables?.length&&(t=t.filter(({name:r})=>i.variables.includes(r)),t.forEach(r=>{r.dimensions=r.dimensions.map(n=>MRt(n,i,r.name)).filter(Ga)})),t}function gur(i,e){const{values:t}=e;if(t?.length){const a=Array.isArray(t[0]),l=Array.isArray(i);return a!==l?-1:a&&l?t.findIndex(u=>u[0]===i[0]&&u[1]===i[1]):t.indexOf(i)}const{extent:r}=e;if(Array.isArray(i)||ir[1])return-1;const n=e.interval||1;if(e.unit!=="ISO8601")return Math.round((i-r[0])/n);const s=r[0];let o=-1;switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((i-s)/1e3/n);break;case"minutes":o=Math.round((i-s)/6e4/n);break;case"hours":o=Math.round((i-s)/36e5/n);break;case"days":o=Math.round((i-s)/864e5/n);break;case"months":{const a=new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear(),l=new Date(s).getUTCMonth(),u=new Date(i).getUTCMonth();o=a===0?u-l:u+11-l+12*(a-1)}break;case"years":o=Math.round((new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear())/10/n)}return o}function Dot(i){let e=i.values?.length;if(e)return e;const{extent:t,unit:r}=i,n=i.interval||1,s=t?t[1]-t[0]:0;if(r!=="ISO8601")return Math.round(s/n);switch(i.intervalUnit?.toLowerCase()??"seconds"){case"seconds":e=Math.round(s/1e3/n);break;case"minutes":e=Math.round(s/6e4/n);break;case"hours":e=Math.round(s/36e5/n);break;case"days":e=Math.round(s/864e5/n);break;case"months":{const o=new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear(),a=new Date(t[0]).getUTCMonth(),l=new Date(t[1]).getUTCMonth();e=o===0?l-a+1:l+11-a+12*(o-1)+1}break;case"years":e=Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/n);break;case"decades":e=Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/10/n);break;default:e=0}return e}function RRt(i,e){let t=0;const r=i[0].variableName,n=[...e.variables].sort((s,o)=>s.name>o.name?1:-1);for(let s=0;sc.name>h.name?-1:1);if(o.name!==r){t+=a.map(c=>Dot(c)).reduce((c,h)=>c*h);continue}const l=a.map(c=>Dot(c)),u=a.length;for(let c=0;cm.dimensionName===a[c].name);if(h==null)return null;const p=gur(h.values[0],a[c]);if(p===-1)return null;l.shift(),t+=c===u-1?p:p*l.reduce((m,v)=>m*v)}break}return t}var Z3e,Fot,kot,DRt={exports:{}};Fot=DRt,Z3e=function(){function i(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return i.prototype={ensureBuffer:function(e){var t=this.buffer,r=t?t.byteLength:0;if(en&&(r=n)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(t,r)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,r){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},i}(),(kot=function(){if(!self||!self.Uint32Array)return null;var i=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),t=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],n=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(a){throw new Error(a)}function o(a){var l=0,u=a[l++],c=a[l++];u!=-1&&c!=-1||s("Invalid header in flate stream"),(15&u)!=8&&s("Unknown compression method in flate stream"),((u<<8)+c)%31!=0&&s("Bad FCHECK in flate stream"),32&c&&s("FDICT bit set in flate stream"),this.bytes=a,this.bytesPos=l,this.codeSize=0,this.codeBuf=0,Z3e.call(this)}return o.prototype=Object.create(Z3e.prototype),o.prototype.getBits=function(a){for(var l,u=this.codeSize,c=this.codeBuf,h=this.bytes,p=this.bytesPos;u>a,this.codeSize=u-=a,this.bytesPos=p,l},o.prototype.getCode=function(a){for(var l=a[0],u=a[1],c=this.codeSize,h=this.codeBuf,p=this.bytes,m=this.bytesPos;c>16,I=65535&w;return(c==0||c>S,this.codeSize=c-S,this.bytesPos=m,I},o.prototype.generateHuffmanTable=function(a){for(var l=a.length,u=0,c=0;cu&&(u=a[c]);for(var h=1<>=1;for(c=I;c0;)Ie[w++]=Ve}var l=this.getBits(3);if(1&l&&(this.eof=!0),(l>>=1)!=0){var u,c;if(l==1)u=r,c=n;else if(l==2){for(var h=this.getBits(5)+257,p=this.getBits(5)+1,m=this.getBits(4)+4,v=Array(i.length),w=0;w=B&&(B=(ae=this.ensureBuffer($+1)).length),ae[$++]=V;else{if(V==256)return void(this.bufferLength=$);var Y=(V=e[V-=257])>>16;Y>0&&(Y=this.getBits(Y)),I=(65535&V)+Y,V=this.getCode(c),(Y=(V=t[V])>>16)>0&&(Y=this.getBits(Y));var K=(65535&V)+Y;$+I>=B&&(B=(ae=this.ensureBuffer($+I)).length);for(var Q=0;Q{let c=null;o==="jpg"&&a&&(c=FRt._getMask(e,{width:n,height:s}));const h=new Blob([new Uint8Array(e)],{type:"image/"+o=="jpg"?"jpeg":o}),p=URL.createObjectURL(h),m=new Image;let v;m.src=p,m.onload=()=>{if(URL.revokeObjectURL(p),xg(r))return void u(Oc());n=m.width,s=m.height,this._canvas&&this._ctx?(this._canvas.width===n&&this._canvas.height===s||(this._canvas.width=n,this._canvas.height=s),this._ctx.clearRect(0,0,n,s)):(this._canvas=document.createElement("canvas"),this._canvas.width=n,this._canvas.height=s,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const w=this._ctx.getImageData(0,0,n,s);let S;if(v=w.data,t.renderOnCanvas){if(c)for(S=0;S{URL.revokeObjectURL(p),u("cannot load image")}})}static _getMask(e,t){let r=null;try{const n=new Uint8Array(e),s=Math.ceil(n.length/2);let o=0;const a=n.length-2;for(o=s;o=0;h--)r[u++]=l[c]>>h&1}}catch{}return r}};var Lot,Not,$ot,kRt={exports:{}};Lot=kRt,Not=function(){var i=function(){function e(t){this.message="JPEG error: "+t}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,u=2896;function c(){this.decodeTransform=null,this.colorTransform=-1}function h(I,R){for(var L,k,B=0,$=[],V=16;V>0&&!I[V-1];)V--;$.push({children:[],index:0});var Y,K=$[0];for(L=0;L0;)K=$.pop();for(K.index++,$.push(K);$.length<=L;)$.push(Y={children:[],index:0}),K.children[K.index]=Y.children,K=Y;B++}L+10)return pe--,de>>pe&1;if((de=I[R++])===255){var ge=I[R++];if(ge)throw new i("unexpected marker "+(de<<8|ge).toString(16))}return pe=7,de>>>7}function Z(ge){for(var je=ge;;){if(typeof(je=je[H()])=="number")return je;if(typeof je!="object")throw new i("invalid huffman sequence")}}function ae(ge){for(var je=0;ge>0;)je=je<<1|H(),ge--;return je}function fe(ge){if(ge===1)return H()===1?1:-1;var je=ae(ge);return je>=1<>4;if(_t!==0){var Yt=e[ht+=Fe];ge.blockData[je+Yt]=fe(_t),ht++}else{if(Fe<15)break;ht+=16}}}function _e(ge,je){var rt=Z(ge.huffmanTableDC),Me=rt===0?0:fe(rt)<0)Te--;else for(var rt=$,Me=V;rt<=Me;){var ht=Z(ge.huffmanTableAC),Ht=15&ht,_t=ht>>4;if(Ht!==0){var Fe=e[rt+=_t];ge.blockData[je+Fe]=fe(Ht)*(1<>4,(rt=15&Me)==0)_t<15?(Te=ae(_t)+(1<<_t),$e=4):(_t=16,$e=1);else{if(rt!==1)throw new i("invalid ACn encoding");Ve=fe(rt),$e=_t?2:3}continue;case 1:case 2:ge.blockData[je+Fe]?ge.blockData[je+Fe]+=H()<=65488&&ie<=65495))break;R+=2}return(st=S(I,R))&&st.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+st.invalid),R=st.offset),R-ne}function v(I,R,L){var k,B,$,V,Y,K,Q,re,ne,de,pe,H,Z,ae,fe,be,_e,Ie=I.quantizationTable,Te=I.blockData;if(!Ie)throw new i("missing required Quantization Table.");for(var Be=0;Be<64;Be+=8)ne=Te[R+Be],de=Te[R+Be+1],pe=Te[R+Be+2],H=Te[R+Be+3],Z=Te[R+Be+4],ae=Te[R+Be+5],fe=Te[R+Be+6],be=Te[R+Be+7],ne*=Ie[Be],de|pe|H|Z|ae|fe|be?(de*=Ie[Be+1],pe*=Ie[Be+2],H*=Ie[Be+3],Z*=Ie[Be+4],ae*=Ie[Be+5],fe*=Ie[Be+6],be*=Ie[Be+7],B=(k=(k=l*ne+128>>8)+(B=l*Z+128>>8)+1>>1)-B,_e=($=pe)*a+(V=fe)*o+128>>8,$=$*o-V*a+128>>8,Q=(Y=(Y=u*(de-be)+128>>8)+(Q=ae<<4)+1>>1)-Q,K=(re=(re=u*(de+be)+128>>8)+(K=H<<4)+1>>1)-K,V=(k=k+(V=_e)+1>>1)-V,$=(B=B+$+1>>1)-$,_e=Y*s+re*n+2048>>12,Y=Y*n-re*s+2048>>12,re=_e,_e=K*r+Q*t+2048>>12,K=K*t-Q*r+2048>>12,Q=_e,L[Be]=k+re,L[Be+7]=k-re,L[Be+1]=B+Q,L[Be+6]=B-Q,L[Be+2]=$+K,L[Be+5]=$-K,L[Be+3]=V+Y,L[Be+4]=V-Y):(_e=l*ne+512>>10,L[Be]=_e,L[Be+1]=_e,L[Be+2]=_e,L[Be+3]=_e,L[Be+4]=_e,L[Be+5]=_e,L[Be+6]=_e,L[Be+7]=_e);for(var Ve=0;Ve<8;++Ve)ne=L[Ve],(de=L[Ve+8])|(pe=L[Ve+16])|(H=L[Ve+24])|(Z=L[Ve+32])|(ae=L[Ve+40])|(fe=L[Ve+48])|(be=L[Ve+56])?(B=(k=4112+((k=l*ne+2048>>12)+(B=l*Z+2048>>12)+1>>1))-B,_e=($=pe)*a+(V=fe)*o+2048>>12,$=$*o-V*a+2048>>12,V=_e,Q=(Y=(Y=u*(de-be)+2048>>12)+(Q=ae)+1>>1)-Q,K=(re=(re=u*(de+be)+2048>>12)+(K=H)+1>>1)-K,_e=Y*s+re*n+2048>>12,Y=Y*n-re*s+2048>>12,re=_e,_e=K*r+Q*t+2048>>12,K=K*t-Q*r+2048>>12,ne=(ne=(k=k+V+1>>1)+re)<16?0:ne>=4080?255:ne>>4,de=(de=(B=B+$+1>>1)+(Q=_e))<16?0:de>=4080?255:de>>4,pe=(pe=($=B-$)+K)<16?0:pe>=4080?255:pe>>4,H=(H=(V=k-V)+Y)<16?0:H>=4080?255:H>>4,Z=(Z=V-Y)<16?0:Z>=4080?255:Z>>4,ae=(ae=$-K)<16?0:ae>=4080?255:ae>>4,fe=(fe=B-Q)<16?0:fe>=4080?255:fe>>4,be=(be=k-re)<16?0:be>=4080?255:be>>4,Te[R+Ve]=ne,Te[R+Ve+8]=de,Te[R+Ve+16]=pe,Te[R+Ve+24]=H,Te[R+Ve+32]=Z,Te[R+Ve+40]=ae,Te[R+Ve+48]=fe,Te[R+Ve+56]=be):(_e=(_e=l*ne+8192>>14)<-2040?0:_e>=2024?255:_e+2056>>4,Te[R+Ve]=_e,Te[R+Ve+8]=_e,Te[R+Ve+16]=_e,Te[R+Ve+24]=_e,Te[R+Ve+32]=_e,Te[R+Ve+40]=_e,Te[R+Ve+48]=_e,Te[R+Ve+56]=_e)}function w(I,R){for(var L=R.blocksPerLine,k=R.blocksPerColumn,B=new Int16Array(64),$=0;$=B)return null;var V=k(R);if(V>=65472&&V<=65534)return{invalid:null,marker:V,offset:R};for(var Y=k($);!(Y>=65472&&Y<=65534);){if(++$>=B)return null;Y=k($)}return{invalid:V.toString(16),marker:Y,offset:$}}return c.prototype={parse:function(I){function R(){var ge=I[V]<<8|I[V+1];return V+=2,ge}function L(){var ge=R(),je=V+ge-2,rt=S(I,je,V);rt&&rt.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+rt.invalid),je=rt.offset);var Me=I.subarray(V,je);return V+=Me.length,Me}function k(ge){for(var je=Math.ceil(ge.samplesPerLine/8/ge.maxH),rt=Math.ceil(ge.scanLines/8/ge.maxV),Me=0;Me>4){if(be>>4!=1)throw new i("DQT - invalid table spec");for(H=0;H<64;H++)_e[e[H]]=R()}else for(H=0;H<64;H++)_e[e[H]]=I[V++];Q[15&be]=_e}break;case 65472:case 65473:case 65474:if(B)throw new i("Only single frame JPEGs supported");R(),(B={}).extended=de===65473,B.progressive=de===65474,B.precision=I[V++],B.scanLines=R(),B.samplesPerLine=R(),B.components=[],B.componentIds={};var Ie,Te=I[V++],Be=0,Ve=0;for(pe=0;pe>4,tt=15&I[V+1];Be<$e&&(Be=$e),Ve>4?re:ne)[15&ot]=h(vt,Je)}break;case 65501:R(),$=R();break;case 65498:R();var it,Ue=I[V++],ct=[];for(pe=0;pe>4],it.huffmanTableAC=re[15&Ze],ct.push(it)}var ye=I[V++],Ke=I[V++],ke=I[V++],me=m(I,V,B,ct,$,ye,Ke,ke>>4,15&ke);V+=me;break;case 65535:I[V]!==255&&V--;break;default:if(I[V-3]===255&&I[V-2]>=192&&I[V-2]<=254){V-=3;break}throw new i("unknown marker "+de.toString(16))}de=R()}for(this.width=B.samplesPerLine,this.height=B.scanLines,this.jfif=Y,this.eof=V,this.adobe=K,this.components=[],pe=0;pe>8)+Te[re+1];return be},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(I){for(var R,L,k,B=0,$=I.length;B<$;B+=3)R=I[B],L=I[B+1],k=I[B+2],I[B]=R-179.456+1.402*k,I[B+1]=R+135.459-.344*L-.714*k,I[B+2]=R-226.816+1.772*L;return I},_convertYcckToRgb:function(I){for(var R,L,k,B,$=0,V=0,Y=I.length;V4)throw new i("Unsupported color mode");var k=this._getLinearizedBlockData(I,R);if(this.numComponents===1&&L){for(var B=k.length,$=new Uint8ClampedArray(3*B),V=0,Y=0;Y=0;w--)p[I++]=S[m]>>w&1}catch{}if(a===1&&u.length===s*o){const S=new Uint8Array(u.buffer);h=[S,S,S]}else{for(h=[],m=0;m<3;m++)h.push(new Uint8Array(c));for(w=0,v=0;vBan).then(i=>i.l).then(({default:i})=>i({locateFile:e=>Fl(`esri/layers/support/rasterFormats/${e}`)})).then(i=>{bur(i)}),Q3e)}const I1e={getBlobInfo:null,decode:null};function _ur(i){return 16+(i>>3<<3)}function bD(i,e,t){t.set(i.slice(e,e+t.length))}function bur(i){const{_malloc:e,_free:t,_lerc_getBlobInfo:r,_lerc_getDataRanges:n,_lerc_decode_4D:s,asm:o}=i;let a;const l=Object.values(o).find(c=>c&&"buffer"in c&&c.buffer===i.HEAPU8.buffer),u=c=>{const h=c.map(w=>_ur(w)),p=h.reduce((w,S)=>w+S),m=e(p);a=new Uint8Array(l.buffer);let v=h[0];h[0]=m;for(let w=1;w{const m=new Uint8Array(48),v=new Uint8Array(8*3),[w,S,I]=u([c.length,m.length,v.length]);a.set(c,w),a.set(m,S),a.set(v,I);let R=r(w,c.length,S,I,12,3);if(R)throw t(w),new Error(`lerc-getBlobInfo: error code is ${R}`);a=new Uint8Array(l.buffer),bD(a,S,m),bD(a,I,v);const L=new Uint32Array(m.buffer),k=new Float64Array(v.buffer),[B,$,,V,Y,K,Q,re,ne,de,pe]=L,H={version:B,depthCount:de,width:V,height:Y,validPixelCount:Q,bandCount:K,blobSize:re,maskCount:ne,dataType:$,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:pe};if(pe&&de>1)return t(w),H;if(de===1&&K===1)return t(w),H.statistics.push({minValue:k[0],maxValue:k[1]}),H;const Z=de*K*8,ae=new Uint8Array(Z),fe=new Uint8Array(Z);let be=w,_e=0,Ie=0,Te=!1;if(a.byteLength1){const yt=Be.slice(tt*de,(tt+1)*de),Ct=Ve.slice(tt*de,(tt+1)*de),ot=Math.min.apply(null,yt),vt=Math.max.apply(null,Ct);$e.push({minValue:ot,maxValue:vt,depthStats:{minValues:yt,maxValues:Ct}})}else $e.push({minValue:Be[tt],maxValue:Ve[tt]});return t(be),Te||t(_e),H},I1e.decode=(c,h)=>{const{maskCount:p,depthCount:m,bandCount:v,width:w,height:S,dataType:I,bandCountWithNoData:R}=h,L=NRt[I],k=w*S,B=new Uint8Array(k*v),$=k*m*v*L.size,V=new Uint8Array($),Y=new Uint8Array(v),K=new Uint8Array(8*v),[Q,re,ne,de,pe]=u([c.length,B.length,V.length,Y.length,K.length]);a.set(c,Q),a.set(B,re),a.set(V,ne),a.set(Y,de),a.set(K,pe);const H=s(Q,c.length,p,re,m,w,S,v,I,ne,de,pe);if(H)throw t(Q),new Error(`lerc-decode: error code is ${H}`);a=new Uint8Array(l.buffer),bD(a,ne,V),bD(a,re,B);let Z=null;if(R){bD(a,de,Y),bD(a,pe,K),Z=[];const ae=new Float64Array(K.buffer);for(let fe=0;fe1){B.set(R[0]);for(let Q=1;Q=$;if(m>0&&V)for(let Q=0;Q1?R:null,{pixelType:K}=w;return{width:l,height:u,bandCount:c,pixelType:K,depthCount:h,statistics:v,pixels:I,mask:B,bandMasks:Y,noDataValues:a}}function xur(i,e,t,r=!0){if(e%4!=0||t%4!=0){const n=new ArrayBuffer(4*Math.ceil(t/4)),s=new Uint8Array(n),o=new Uint8Array(i,e,t);if(r)for(let a=0;a=s)a-=s,p=h>>>32-s,h<<=s;else{p=h>>>32-a,h=n[c++];const I=s-a;a=32-I,p=(p<>>a),h<<=I}if(p===257)break;if(p===256){s=9,o=Bot(),l=o.length,u=[];continue}const S=o[p];if(S==null){if(p>o.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),o[l++]=u.slice(),jot(w,u)}else jot(w,S),u.push(S[0]),u.length>1&&(o[l++]=u.slice()),u=S.slice();if(YG.has(l)&&s++,a===0&&(h=n[c++],a=32),c>m||c===m&&a<=v)break}return new Uint8Array(w)}YG.add(511),YG.add(1023),YG.add(2047),YG.add(4095),YG.add(8191);const Got=(i,e)=>{const t=e.width*e.height,r=e.pixelType;return Math.floor(i.byteLength/(t*jRt(r)))},jRt=i=>{let e=1;switch(i){case Uint8Array:case Int8Array:e=1;break;case Uint16Array:case Int16Array:e=2;break;case Uint32Array:case Int32Array:case Float32Array:e=4;break;case Float64Array:e=8}return e},Sur=(i,e)=>{if(8*i.byteLength=0;a--)r[n++]=s>>a&1;for(a=7;n>a&1,a--;return r};let Tur=class{static decode(e,t){const r=t.pixelType,n=[],s=t.width*t.height,o=Got(e,t),{bandIds:a,format:l}=t,u=a?.length||Got(e,t),c=e.byteLength-e.byteLength%(s*jRt(r)),h=new r(e,0,s*o);let p,m,v,w,S=null;if(l==="bip")for(p=0;p>4,n<8?n=1:n===15?(n=4,s=(7&s)<<18|(63&i[t++])<<12|(63&i[t++])<<6|63&i[t++]):n===14?(n=3,s=(15&s)<<12|(63&i[t++])<<6|63&i[t++]):(n=2,s=(31&s)<<6|63&i[t++]),(s!==0||e)&&(r+=String.fromCharCode(s));return r}const gHe=(()=>{const i=[];return i[254]="NEWSUBFILETYPE",i[255]="SUBFILETYPE",i[256]="IMAGEWIDTH",i[257]="IMAGELENGTH",i[258]="BITSPERSAMPLE",i[259]="COMPRESSION",i[262]="PHOTOMETRICINTERPRETATION",i[263]="THRESHHOLDING",i[264]="CELLWIDTH",i[265]="CELLLENGTH",i[266]="FILLORDER",i[269]="DOCUMENTNAME",i[270]="IMAGEDESCRIPTION",i[271]="MAKE",i[272]="MODEL",i[273]="STRIPOFFSETS",i[274]="ORIENTATION",i[277]="SAMPLESPERPIXEL",i[278]="ROWSPERSTRIP",i[279]="STRIPBYTECOUNTS",i[280]="MINSAMPLEVALUE",i[281]="MAXSAMPLEVALUE",i[282]="XRESOLUTION",i[283]="YRESOLUTION",i[284]="PLANARCONFIGURATION",i[285]="PAGENAME",i[286]="XPOSITION",i[287]="YPOSITION",i[288]="FREEOFFSETS",i[289]="FREEBYTECOUNTS",i[290]="GRAYRESPONSEUNIT",i[291]="GRAYRESPONSECURVE",i[292]="T4OPTIONS",i[293]="T6OPTIONS",i[296]="RESOLUTIONUNIT",i[297]="PAGENUMBER",i[300]="COLORRESPONSEUNIT",i[301]="TRANSFERFUNCTION",i[305]="SOFTWARE",i[306]="DATETIME",i[315]="ARTIST",i[316]="HOSTCOMPUTER",i[317]="PREDICTOR",i[318]="WHITEPOINT",i[319]="PRIMARYCHROMATICITIES",i[320]="COLORMAP",i[321]="HALFTONEHINTS",i[322]="TILEWIDTH",i[323]="TILELENGTH",i[324]="TILEOFFSETS",i[325]="TILEBYTECOUNTS",i[326]="BADFAXLINES",i[327]="CLEANFAXDATA",i[328]="CONSECUTIVEBADFAXLINES",i[330]="SUBIFD",i[332]="INKSET",i[333]="INKNAMES",i[334]="NUMBEROFINKS",i[336]="DOTRANGE",i[337]="TARGETPRINTER",i[338]="EXTRASAMPLES",i[339]="SAMPLEFORMAT",i[340]="SMINSAMPLEVALUE",i[341]="SMAXSAMPLEVALUE",i[342]="TRANSFERRANGE",i[347]="JPEGTABLES",i[512]="JPEGPROC",i[513]="JPEGIFOFFSET",i[514]="JPEGIFBYTECOUNT",i[515]="JPEGRESTARTINTERVAL",i[517]="JPEGLOSSLESSPREDICTORS",i[518]="JPEGPOINTTRANSFORM",i[519]="JPEGQTABLES",i[520]="JPEGDCTABLES",i[521]="JPEGACTABLES",i[529]="YCBCRCOEFFICIENTS",i[530]="YCBCRSUBSAMPLING",i[531]="YCBCRPOSITIONING",i[532]="REFERENCEBLACKWHITE",i[700]="XMP",i[33550]="GEOPIXELSCALE",i[33922]="GEOTIEPOINTS",i[33432]="COPYRIGHT",i[42112]="GDAL_METADATA",i[42113]="GDAL_NODATA",i[50844]="RPCCOEFFICIENT",i[34264]="GEOTRANSMATRIX",i[34735]="GEOKEYDIRECTORY",i[34736]="GEODOUBLEPARAMS",i[34737]="GEOASCIIPARAMS",i[34665]="EXIFIFD",i[34853]="GPSIFD",i[40965]="INTEROPERABILITYIFD",i})(),Cur=(()=>{const i=gHe.slice();return i[36864]="ExifVersion",i[40960]="FlashpixVersion",i[40961]="ColorSpace",i[42240]="Gamma",i[37121]="ComponentsConfiguration",i[37122]="CompressedBitsPerPixel",i[40962]="PixelXDimension",i[40963]="PixelYDimension",i[37500]="MakerNote",i[37510]="UserComment",i[40964]="RelatedSoundFile",i[36867]="DateTimeOriginal",i[36868]="DateTimeDigitized",i[36880]="OffsetTime",i[36881]="OffsetTimeOriginal",i[36882]="OffsetTimeDigitized",i[37520]="SubSecTime",i[37521]="SubSecTimeOriginal",i[37522]="SubSecTimeDigitized",i[37888]="Temperature",i[37889]="Humidity",i[37890]="Pressure",i[37891]="WaterDepth",i[37892]="Acceleration",i[37893]="CameraElevationAngle",i[42016]="ImageUniqueID",i[42032]="CameraOwnerName",i[42033]="BodySerialNumber",i[42034]="LensSpecification",i[42035]="LensMake",i[42036]="LensModel",i[42037]="LensSerialNumber",i[33434]="ExposureTime",i[33437]="FNumber",i[34850]="ExposureProgram",i[34852]="SpectralSensitivity",i[34855]="PhotographicSensitivity",i[34856]="OECF",i[34864]="SensitivityType",i[34865]="StandardOutputSensitivity",i[34866]="RecommendedExposureIndex",i[34867]="ISOSpeed",i[34868]="ISOSpeedLatitudeyyy",i[34869]="ISOSpeedLatitudezzz",i[37377]="ShutterSpeedValue",i[37378]="ApertureValue",i[37379]="BrightnessValue",i[37380]="ExposureBiasValue",i[37381]="MaxApertureValue",i[37382]="SubjectDistance",i[37383]="MeteringMode",i[37384]="LightSource",i[37385]="Flash",i[37386]="FocalLength",i[37396]="SubjectArea",i[41483]="FlashEnergy",i[41484]="SpatialFrequencyResponse",i[41486]="FocalPlaneXResolution",i[41487]="FocalPlaneYResolution",i[41488]="FocalPlaneResolutionUnit",i[41492]="SubjectLocation",i[41493]="ExposureIndex",i[41495]="SensingMethod",i[41728]="FileSource",i[41729]="SceneType",i[41730]="CFAPattern",i[41985]="CustomRendered",i[41986]="ExposureMode",i[41987]="WhiteBalance",i[41988]="DigitalZoomRatio",i[41989]="FocalLengthIn35mmFilm",i[41990]="SceneCaptureType",i[41991]="GainControl",i[41992]="Contrast",i[41993]="Saturation",i[41994]="Sharpness",i[41995]="DeviceSettingDescription",i[41996]="SubjectDistanceRange",i})(),Eur=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],Iur=(()=>{const i=[];return i[1024]="GTModelTypeGeoKey",i[1025]="GTRasterTypeGeoKey",i[1026]="GTCitationGeoKey",i[2048]="GeographicTypeGeoKey",i[2049]="GeogCitationGeoKey",i[2050]="GeogGeodeticDatumGeoKey",i[2051]="GeogPrimeMeridianGeoKey",i[2052]="GeogLinearUnitsGeoKey",i[2053]="GeogLinearUnitSizeGeoKey",i[2054]="GeogAngularUnitsGeoKey",i[2055]="GeogAngularUnitSizeGeoKey",i[2056]="GeogEllipsoidGeoKey",i[2057]="GeogSemiMajorAxisGeoKey",i[2058]="GeogSemiMinorAxisGeoKey",i[2059]="GeogInvFlatteningGeoKey",i[2061]="GeogPrimeMeridianLongGeoKey",i[2060]="GeogAzimuthUnitsGeoKey",i[3072]="ProjectedCSTypeGeoKey",i[3073]="PCSCitationGeoKey",i[3074]="ProjectionGeoKey",i[3075]="ProjCoordTransGeoKey",i[3076]="ProjLinearUnitsGeoKey",i[3077]="ProjLinearUnitSizeGeoKey",i[3078]="ProjStdParallel1GeoKey",i[3079]="ProjStdParallel2GeoKey",i[3080]="ProjNatOriginLongGeoKey",i[3081]="ProjNatOriginLatGeoKey",i[3082]="ProjFalseEastingGeoKey",i[3083]="ProjFalseNorthingGeoKey",i[3084]="ProjFalseOriginLongGeoKey",i[3085]="ProjFalseOriginLatGeoKey",i[3086]="ProjFalseOriginEastingGeoKey",i[3087]="ProjFalseOriginNorthingGeoKey",i[3088]="ProjCenterLongGeoKey",i[3090]="ProjCenterEastingGeoKey",i[3091]="ProjCenterNorthingGeoKey",i[3092]="ProjScaleAtNatOriginGeoKey",i[3093]="ProjScaleAtCenterGeoKey",i[3094]="ProjAzimuthAngleGeoKey",i[3095]="ProjStraightVertPoleLongGeoKey",i[4096]="VerticalCSTypeGeoKey",i[4097]="VerticalCitationGeoKey",i[4098]="VerticalDatumGeoKey",i[4099]="VerticalUnitsGeoKey",i})(),Aur=(i,e)=>{let t=(e||gHe)[i];return t===void 0&&(t="unknown"+String(i)),t},VLe=new Map;VLe.set("EXIFIFD",Cur),VLe.set("GPSIFD",Eur);const AA={tiffTags:gHe,ifdTags:VLe,geoKeys:Iur,getTagName:Aur},tSe=(()=>{const i=new ArrayBuffer(4),e=new Uint8Array(i);return new Uint32Array(i)[0]=1,e[0]===1})(),Uot=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],MW=4294967296,Mur=new Set([1,5,6,7,8,34712,34887]);function yHe(i,e){let t="unknown";return i===3?t=e===64?"f64":"f32":i===1?e===1?t="u1":e===2?t="u2":e===4?t="u4":e<=8?t="u8":e<=16?t="u16":e<=32&&(t="u32"):i===2&&(e<=8?t="s8":e<=16?t="s16":e<=32&&(t="s32")),t}function iSe(i){let e=null;switch(i?i.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f64":e=Float64Array;break;default:e=Float32Array}return e}function Our(i,e){return{x:e[0]*i.x+e[1]*i.y+e[2],y:e[3]*i.x+e[4]*i.y+e[5]}}function GRt(i,e){return i.get(e)?.values}function e9(i,e){return i.get(e)?.values}function zot(i,e){return i.get(e)?.values?.[0]}function $a(i,e){return i.get(e)?.values?.[0]}function eMe(i,e,t,r=0,n=AA.tiffTags,s=4){const o=s===8,a=o?bHe(new DataView(i,t,8),0,e):new DataView(i,t,2).getUint16(0,e),l=4+2*s,u=o?8:2,c=u+a*l;if(t+c>i.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:c};const h=t+c+4<=i.byteLength?Vme(new DataView(i,t+c,s===8?8:4),0,e,s===8):null,p=t+u,m=new Map;let v,w,S,I,R,L=0,k=0;for(let B=0;BBRt(i,{inputOffset:e}).pixels[0];function HLe(i,e){if(e!==1&&e!==2&&e!==4)return i;const t=new Uint8Array(i),r=8/e,n=new Uint8Array(i.byteLength*r);let s=0;const o=2**e-1;for(let a=0;a>>8-e&o}return n.buffer}function WLe(i,e,t){const r=new LRt;r.parse(i),r.colorTransform=t===6?-1:0;const n=r.getData(r.width,r.height,e!==1&&e!==4);return new Uint8Array(n.buffer)}function qLe(i){const e=new Pae(i).getBytes(),t=new ArrayBuffer(e.length),r=new Uint8Array(t);return r.set(e),r}async function YLe(i,e,t,r,n){const s=tSe===e,o=$a(t,"BITSPERSAMPLE"),a=$a(t,"SAMPLESPERPIXEL")??1,l=$a(t,"PHOTOMETRICINTERPRETATION"),u=$a(t,"SAMPLEFORMAT")??1,c=yHe(u,o),h=$a(t,"COMPRESSION")??1,p=iSe(c);let m,v,w;if(h===34887)return await $Rt(),Pur(i,r);if(h===1)m=i.slice(r,r+n),v=new Uint8Array(m);else if(h===8||h===32946)v=new Uint8Array(i,r,n),v=qLe(v),m=v.buffer;else if(h===6)v=new Uint8Array(i,r,n),v=WLe(v,a,l),m=v.buffer;else if(h===7){const L=t.get("JPEGTABLES").values,k=L.length-2;v=new Uint8Array(k+n-2);for(let $=0;$1&&(h===5||h===8||h===32946)&&I&&R){const L=Rae(t),k=new p(w.length);k.set(w),w=$ur(k,R,I,u===3&&S===3,L?1:a)}return w}async function Rur(i,e,t){const r=e9(t,"TILEOFFSETS");if(r===void 0)return null;const n=e9(t,"TILEBYTECOUNTS"),{width:s,height:o,pixelType:a,tileWidth:l,tileHeight:u}=rSe([t]),c=Rae(t,e),h=$a(t,"SAMPLESPERPIXEL")||e.planes,p=s*o,m=$a(t,"BITSPERSAMPLE"),v=($a(t,"COMPRESSION")??1)===34887,w=iSe(a),S=[];for(let ae=0;ae1){const ae=Math.round(r.length/h);for(I=0;I{const r=tSe===e.littleEndian,n=e9(t,"STRIPOFFSETS");if(n===void 0)return null;const{width:s,height:o,pixelType:a}=rSe([t]),l=$a(t,"SAMPLESPERPIXEL")||e.planes,u=$a(t,"PHOTOMETRICINTERPRETATION"),c=s*o,h=$a(t,"BITSPERSAMPLE"),p=iSe(a),m=new p(c*l),v=e9(t,"STRIPBYTECOUNTS"),w=$a(t,"ROWSPERSTRIP"),S=$a(t,"COMPRESSION")??1;let I,R,L,k,B,$,V,Y,K,Q=w;if(h%8==0)for(I=0;Io?o-I*w:w,a==="u8"||a==="s8"||r)S===8||S===32946?(V=new Uint8Array(i,n[I],v[I]),V=qLe(V),$=V.buffer):S===6?(V=new Uint8Array(i,n[I],v[I]),V=WLe(V,l,u),$=V.buffer):S===5?(V=mHe(i,n[I],v[I],e.littleEndian),$=V.buffer):(v[I]!==Q*s*l*h/8&&console.log("strip byte counts is different than expected"),$=i.slice(n[I],n[I]+v[I])),$=HLe($,h),k=new p($);else{switch(S===6||S===8||S===32946?(V=new Uint8Array(i,n[I],v[I]),Y=qLe(V),$=Y.buffer):(v[I]!==Q*s*l*h/8&&console.log("strip byte counts is different than expected"),$=new ArrayBuffer(v[I]),V=new Uint8Array(i,n[I],v[I]),Y=new Uint8Array($)),a){case"u16":case"s16":for(L=0;L{if(!(i&&i.length>0&&e&&t))return null;let r,n,s;const o=i[0].length,a=i.length,l=new Uint8Array(o);for(let u=0;us?0:1;else for(let c=0;cs?0:1);return l},kur=i=>{if(!i)return null;const e=i.match(//gi);if(!e||e.length===0)return null;const t=new Map;let r,n,s,o,a;for(let I=0;I")),o=r.indexOf("sample="),o>-1&&(a=r.slice(o+8,r.indexOf('"',o+8))),o=r.indexOf("name="),o>-1&&(n=r.slice(o+6,r.indexOf('"',o+6))),n&&(s=r.slice(r.indexOf(">")+1,r.indexOf("")).trim(),a!=null?t.has(n)?t.get(n)[a]=s:t.set(n,[s]):t.set(n,s)),a=null;const l=t.get("STATISTICS_MINIMUM"),u=t.get("STATISTICS_MAXIMUM"),c=t.get("STATISTICS_MEAN"),h=t.get("STATISTICS_STDDEV");let p=null;if(l&&u){p=[];for(let I=0;IS&&p>(n?i.byteLength:i?i.byteLength-l+r:0))return t.offlineOffsetSize=[l,p],t.values=null,!1;if(m<=S){if(!e)if(S<=32)l>>>=32-m;else{const R=I?.length?I[0]:l>>>0,L=I?.length?I[1]:Math.round((l-R)/MW);m<=32?(l=R>>>32-m,I[0]=l):(l=R*2**(32-m)+(L>>>32-m),I[0]=R,I[1]=L>>>32-m)}if(a===1&&h===S)u=[l];else if(S===64){const R=I?.length?I[0]:l>>>0,L=I?.length?I[1]:Math.round((l-R)/MW);let k=R,B=32;for(w=1;w<=a;w++){const $=32-h*w%32;if(B>>32-B,Y=L<<32-B>>>32-B;k=L,u.push(V+Y*2**(h-B)),B-=32-(h-B)}else u.push(k<<$>>>32-h),B-=h;B===0&&(B=32,k=L)}}else for(w=1;w<=a;w++){const R=32-h*w;u.push(l<>>32-h)}}else{l-=r,n&&(l=0);for(let R=l;RparseFloat(be)),p.some(be=>isNaN(be))&&(p=null));const m=$a(e,"COMPRESSION")??1;let v;switch(m){case 1:v="NONE";break;case 2:case 3:case 4:case 32771:v="CCITT";break;case 5:v="LZW";break;case 6:case 7:v="JPEG";break;case 32773:v="PACKBITS";break;case 8:case 32946:v="DEFLATE";break;case 34712:v="JPEG2000";break;case 34887:v="LERC";break;default:v=String(m)}let w=!0,S="";Mur.has(m)||(w=!1,S+="unsupported tag compression "+m),l>3&&(w=!1,S+="unsupported tag sampleFormat "+l),o!==1&&o!==2&&o!==4&&o%8!=0&&(w=!1,S+="unsupported tag bitsPerSample "+o);const I=zot(e,"GEOASCIIPARAMS");let R;if(I){const be=I.split("|").find(Ie=>Ie.includes("ESRI PE String = ")),_e=be?be.replace("ESRI PE String = ",""):"";R=_e.startsWith("COMPD_CS")||_e.startsWith("PROJCS")||_e.startsWith("GEOGCS")?{wkid:null,wkt:_e}:null}const L=e9(e,"GEOTIEPOINTS"),k=e9(e,"GEOPIXELSCALE"),B=e9(e,"GEOTRANSMATRIX"),$=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let V,Y,K=!1,Q=!1;if($){K=$a($,"GTRasterTypeGeoKey")===2;const be=$a($,"GTModelTypeGeoKey");if(be===2){const _e=$a($,"GeographicTypeGeoKey");_e>=1024&&_e<=32766&&(R={wkid:_e}),R||_e!==32767||(Q=!0,R={wkid:4326})}else if(be===1){const _e=$a($,"ProjectedCSTypeGeoKey");_e>=1024&&_e<=32766&&(R={wkid:_e})}}if(k&&L&&L.length>=6?(V=[k[0],0,L[3]-L[0]*k[0],0,-Math.abs(k[1]),L[4]-L[1]*k[1]],K&&(V[2]-=.5*V[0]+.5*V[1],V[5]-=.5*V[3]+.5*V[4])):B&&B.length===16&&(V=K?[B[0],B[1],B[3]-.5*B[0],B[4],B[5],B[7]-.5*B[5]]:[B[0],B[1],B[3],B[4],B[5],B[7]]),V){const be=[{x:0,y:s},{x:0,y:0},{x:n,y:s},{x:n,y:0}];let _e,Ie=Number.POSITIVE_INFINITY,Te=Number.POSITIVE_INFINITY,Be=Number.NEGATIVE_INFINITY,Ve=Number.NEGATIVE_INFINITY;for(let $e=0;$eIe?Ie:_e.x,Be=_e.xTe?Te:_e.y,Ve=_e.y400||Math.max(Math.abs(Y.xmin),Math.abs(Y.xmax))>361)&&(R=null,Y.spatialReference=null);const re=vHe(i);let ne,de,pe,H,Z;if(re.length>0){pe=Math.round(Math.log(n/$a(re[0],"IMAGEWIDTH"))/Math.LN2);const be=re[re.length-1];H=Math.round(Math.log(n/$a(be,"IMAGEWIDTH"))/Math.LN2),ne=$a(be,"TILEWIDTH"),de=$a(be,"TILELENGTH")}ne=H!=null&&H>0?ne||t:null,de=H!=null&&H>0?de||r:null,t&&(Z=[{maxCol:Math.ceil(n/t)-1,maxRow:Math.ceil(s/r)-1,minRow:0,minCol:0}],re.forEach(be=>{Z.push({maxCol:Math.ceil($a(be,"IMAGEWIDTH")/$a(be,"TILEWIDTH"))-1,maxRow:Math.ceil($a(be,"IMAGELENGTH")/$a(be,"TILELENGTH"))-1,minRow:0,minCol:0})}));const ae=zot(i[0],"GDAL_METADATA"),fe=kur(ae);return S+=" "+HRt({width:n,height:s,tileWidth:t,tileHeight:r,planes:a,ifds:i}),{width:n,height:s,tileWidth:t,tileHeight:r,planes:a,isBSQ:c,pixelType:u,compression:v,noData:p,hasMaskBand:_He(i).length===re.length+1,isSupported:w,message:S,extent:Y,isPseudoGeographic:Q,affine:k?null:V,firstPyramidLevel:pe,maximumPyramidLevel:H,pyramidBlockWidth:ne,pyramidBlockHeight:de,tileBoundary:Z,metadata:fe}}function Rae(i,e){const t=GRt(i,"PLANARCONFIGURATION");return t?t[0]===2:!!e&&e.isBSQ}function vHe(i){return i.filter(e=>$a(e,"NEWSUBFILETYPE")===1)}function _He(i){return i.filter(e=>{const t=(4&($a(e,"NEWSUBFILETYPE")??0))==4,r=$a(e,"PHOTOMETRICINTERPRETATION")===4;return t&&r})}function Lur(i){const{littleEndian:e,isBigTiff:t,firstIFDPos:r}=zRt(i);let n=r;const s=[];do{const o=VRt(i,e,n,0,AA.tiffTags,t?8:4);if(!o.success)break;s.push(o.ifd),n=o.nextIFD}while(n>0);return{...rSe(s),littleEndian:e,isBigTiff:t,ifds:s,pyramidIFDs:vHe(s),maskIFDs:_He(s)}}function bHe(i,e,t){const r=i.getUint32(e,t),n=i.getUint32(e+4,t);return t?n*MW+r:r*MW+n}function Nur(i,e,t){let r=t?i.getInt32(e,t):i.getUint32(e,t),n=t?i.getUint32(e+4,t):i.getInt32(e+4,t);const s=(t?r:n)>=0?1:-1;return t?r*=s:n*=s,s*(t?n*MW+r:r*MW+n)}function Vme(i,e,t,r){return r?bHe(i,e,t):i.getUint32(e,t)}function zRt(i){const e=new DataView(i,0,16),t=e.getUint16(0,!1);let r=null;if(t===18761)r=!0;else{if(t!==19789)throw new Error("unexpected endianess byte");r=!1}const n=e.getUint16(2,r);if(n!==42&&n!==43)throw new Error("unexpected tiff identifier");let s=4;const o=n===43;if(o){const a=e.getUint16(s,r);if(s+=2,a!==8)throw new Error("unsupported bigtiff version");if(e.getUint16(s,r)!==0)throw new Error("unsupported bigtiff version");s+=2}return{littleEndian:r,isBigTiff:o,firstIFDPos:Vme(e,s,r,o)}}function VRt(i,e,t,r=0,n=AA.tiffTags,s=4){const o=eMe(i,e,t,r,n,s);let a;const l=o.ifd;if(l){if(AA.ifdTags.forEach((u,c)=>{l.has(c)&&(a=l.get(c),a.data=eMe(i,e,a.valueOffset-r,r,u).ifd)}),l.has("GEOKEYDIRECTORY")){a=l.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const c=u[0]+"."+u[1]+"."+u[2];a.data=eMe(i,e,a.valueOffset+6-r,r,AA.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[c]})}}if(l.has("XMP")){a=l.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[zLe(new Uint8Array(u))])}}return o}function HRt(i){const{width:e,height:t,tileHeight:r,tileWidth:n}=i,s=i.planes,o=n?n*r:e*t,a=$a(i.ifds[0],"BITSPERSAMPLE");let l="";return o*s>2**30/(a>8?a/8:1)&&(l=n?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),l}function $ur(i,e,t,r,n){const s=r?4:1,o=t*s*n;r&&(i=new Uint8Array(i.buffer));for(let u=0;uK.min):null,V=B?B.map(K=>K.max):null,Y={pixelType:u,width:p,height:m,pixels:I,noDataValue:k};return k!=null?Z2e(Y,k):$&&V&&e.applyMinMaxConstraint&&(Y.mask=Fur(I,$,V)),Y}async function jur(i,e={}){const t=e.pyramidLevel||0,r=e.headerInfo||Lur(i),{ifds:n,noData:s}=r;if(n.length===0)throw new Error("no valid image file directory");const o=HRt(r);if(o)throw o;let a=null;const l=t===-1?n[n.length-1]:n[t],u=s??e.noDataValue;return a=r.tileWidth?await Rur(i,r,l):Dur(i,r,l),a&&(u!=null&&Z2e(a,u),a)}var Gur=function(i){var e,t,r,n,s,o;function a(l){var u,c,h,p,m,v,w,S,I,R,L,k,B;for(this.data=l,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var $,V;for(V=[],$=0;$<4;++$)V.push(String.fromCharCode(this.data[this.pos++]));return V}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},p=this.readUInt16(),h=this.readUInt16()||100,m.delay=1e3*p/h,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),l=m?.data||this.imgData,L=0;0<=u?Lu;0<=u?++L:--L)l.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(I=255-this.transparency.indexed.length)>0)for(k=0;0<=I?kI;0<=I?++k:--k)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":v=(R=this.read(u)).indexOf(0),w=String.fromCharCode.apply(String,R.slice(0,v)),this.text[w]=String.fromCharCode.apply(String,R.slice(v+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(B=this.colorType)===4||B===6,c=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*c,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(l,u,c){var h;return typeof u=="function"&&(c=u),(h=new XMLHttpRequest).open("GET",l,!0),h.responseType="arraybuffer",h.onload=function(){var p;return p=new a(new Uint8Array(h.response||h.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&p.render(u),typeof c=="function"?c(p):void 0},h.send(null)},t=1,r=2,e=0,a.prototype.read=function(l){var u,c;for(c=[],u=0;0<=l?ul;0<=l?++u:--u)c.push(this.data[this.pos++]);return c},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(l){var u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne,de,pe,H;if(l==null&&(l=this.imgData),l.length===0)return new Uint8Array(0);for(l=(l=new Pae(l)).getBytes(),Y=(k=this.pixelBitlength/8)*this.width,B=new Uint8Array(Y*this.height),v=l.length,V=0,$=0,c=0;$1&&c/pYur(t,r,i);break;case"tiff":e=Vur;break;case"deflate":e=Wur;break;case"lzw":e=qur;break;case"error":e=()=>{throw new qe("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new qe("rasterCodec:decode","unsupported raster format")}}return e}function Qur(i){let e=null,t=null;switch(i?i.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=255,e=Uint8Array;break;case"u16":t=t||65535,e=Uint16Array;break;case"u32":t=t||2**32-1,e=Uint32Array;break;case"s8":t=t||-128,e=Int8Array;break;case"s16":t=t||-32768,e=Int16Array;break;case"s32":t=t||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:t}}function ecr(i,e=1){if(!i)return;const{pixels:t,width:r,height:n,mask:s}=i;if(!t||t.length===0)return;const o=t.length,a=r-1,l=n-1,u=[];let c,h,p,m,v,w,S=null;const I=Br.getPixelArrayConstructor(i.pixelType);if(e===0){for(c=0;c1){const a=o.map((c,h)=>n(i.slice(c,o[h+1]),e)),l=await Promise.all(a);s=l[0],s.pixels=l.map(c=>c.pixels[0]);const u=l.map(c=>c.mask);l.some(c=>c!=null)&&(u.forEach((c,h)=>{c==null&&(u[h]=new Uint8Array(s.width*s.height).fill(255))}),s.bandMasks=u,s.mask=Br.combineBandMasks(u)),s.updateStatistics()}else s=await n(i,{...e,offset:o?.[0]??e.offset});return r!=="jpg"&&e.noDataValue!=null&&s.depthCount===1&&Z2e(s,e.noDataValue,{customFloatTolerance:e.tolerance}),e.isPoint&&ecr(s),s}function tcr(i){return["u8","s8"].includes(i.pixelType)&&i.statistics?.[0]?.min!=null&&i.statistics[0]?.max!=null&&i.bandCount===1}function wHe(i,e){const{attributeTable:t,bandCount:r}=i;return t==null&&tcr(i)?!0:!(t==null||r>1||e&&t.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function XRt(i){const{bandCount:e,dataType:t,pixelType:r}=i;return t==="elevation"||t==="generic"&&e===1&&(r==="s16"||r==="s32"||r==="f32"||r==="f64")}function xHe(i,e=!1){const{bandCount:t,colormap:r,pixelType:n}=i;return t===1&&(!!r?.length||!e&&n==="u8")}function icr(i,e=!1){const{attributeTable:t,bandCount:r}=i;return r===1&&(!e||t!=null||i.histograms!=null)}function SHe(i){const{dataType:e}=i;return e==="vector-uv"||e==="vector-magdir"}function rcr(i){const{dataType:e}=i;return e==="vector-uv"||e==="vector-magdir"}const Vot=new Rs({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),Hot=new Rs({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let zT=class extends Ci{constructor(e){super(e),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(e){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",e)}set definedInterval(e){this.classificationMethod==="defined-interval"&&this._set("definedInterval",e)}};x([Wr({classBreaksDef:"class-breaks-definition"})],zT.prototype,"type",void 0),x([D({json:{write:!0}})],zT.prototype,"breakCount",void 0),x([D({json:{write:!0}})],zT.prototype,"classificationField",void 0),x([D({type:String,json:{read:Vot.read,write:Vot.write}})],zT.prototype,"classificationMethod",void 0),x([D({json:{write:!0}})],zT.prototype,"normalizationField",void 0),x([D({json:{read:Hot.read,write:Hot.write}})],zT.prototype,"normalizationType",void 0),x([D({value:null,json:{write:!0}})],zT.prototype,"standardDeviationInterval",null),x([D({value:null,json:{write:!0}})],zT.prototype,"definedInterval",null),zT=x([Qe("esri.rest.support.ClassBreaksDefinition")],zT);const ncr=zT,scr=()=>di.getLogger("esri.rest.support.generateRendererUtils");function dj(i,e){return Number(i.toFixed(e))}function ocr(i){const{normalizationTotal:e}=i;return{classBreaks:acr(i),normalizationTotal:e}}function acr(i){const e=i.definition,{classificationMethod:t,normalizationType:r,definedInterval:n}=e,s=e.breakCount??1,o=[];let a=i.values;if(a.length===0)return[];a=a.sort((c,h)=>c-h);const l=a[0],u=a[a.length-1];if(t==="equal-interval")if(a.length>=s){const c=(u-l)/s;let h=l;for(let p=1;p{o.push({minValue:c,maxValue:c,label:E_(c,c,r)})});else if(t==="natural-breaks"){const c=lcr(a),h=i.valueFrequency||c.valueFrequency,p=ucr(c.uniqueValues,h,s);let m=l;for(let v=1;vv){const w=dj(c.uniqueValues[p[v]],6);o.push({minValue:m,maxValue:w,label:E_(m,w,r)}),m=w}o.push({minValue:m,maxValue:u,label:E_(m,u,r)})}else if(t==="quantile")if(a.length>=s&&l!==u){let c=l,h=Math.ceil(a.length/s),p=0;for(let m=1;ma.length&&(v=a.length-1),v<0&&(v=0),o.push({minValue:c,maxValue:a[v],label:E_(c,a[v],r)}),c=a[v],p+=h,h=Math.ceil((a.length-p)/(s-m))}o.push({minValue:c,maxValue:u,label:E_(c,u,r)})}else{let c=-1;for(let h=0;h=1;S--){const I=dj(c-(S-.5)*p,6);o.push({minValue:v,maxValue:I,label:E_(v,I,r)}),v=I,m++}let w=dj(c+.5*p,6);o.push({minValue:v,maxValue:w,label:E_(v,w,r)}),v=w,m++;for(let S=1;S<=s;S++)w=m===2*s?u:dj(c+(S+.5)*p,6),o.push({minValue:v,maxValue:w,label:E_(v,w,r)}),v=w,m++}}else if(t==="defined-interval"){if(!n)return o;const c=a[0],h=a[a.length-1],p=Math.ceil((h-c)/n);let m=c;for(let v=1;vr&&(t=r);for(let o=0;o0&&v!==i[m+1]&&Math.abs(c-l[m])>Math.abs(c-l[m-1]))i[m]=v;else if(mMath.abs(c-l[m+1])){i[m+1]=v-1;break}h=a,a=0,s=[],o=[];for(let m=0;mh){for(let m=0;m0;p--)for(;t[p]!==t[p-1]+1;){t[p]=t[p]-1;const m=Bz(p-1,t,r,n);l=m.sbMean,o=m.sbSdcm;const v=Bz(p,t,r,n);if(u=v.sbMean,a=v.sbSdcm,!(o+a=1?1:s>=.5?.5:.25,s}function dcr(i){let e=0;for(let t=0;tn===t?.toLowerCase());return e==="Map"?r??"bilinear":i.dataType==="standard-time"?r??"nearest":i.dataType==="thematic"||i.attributeTable||i.colormap?r==="nearest"||r==="majority"?r:"nearest":r??"bilinear"}function vcr(i,e){i=JLe(i,e?.variableName);const{bandCount:t}=i;let{bandIds:r,stretchType:n}=e||{};r?.some(h=>h>=t)&&(r=null);let s=i.statistics,o=i.histograms;t>1?(r=r?.length?r:THe(i),s=s==null?null:r?.map(h=>s[h]),o=o==null?null:r?.map(h=>o[h])):r=[0],n==null&&(n=bcr(i));let a=!1;switch(n){case"none":a=!1;break;case"percent-clip":a=!o?.length;break;default:a=!s?.length}const{dataType:l}=i,u=r?.length===1&&JRt.has(l)?mcr:null,c=new lHe({stretchType:n,dynamicRangeAdjustment:a,colorRamp:u,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return n==="percent-clip"?c.maxPercent=c.minPercent=fcr:n==="standard-deviation"&&(c.numberOfStandardDeviations=2),a||i.multidimensionalInfo==null&&!e?.includeStatisticsInStretch||(n==="percent-clip"?c.histograms=o:n!=="min-max"&&n!=="standard-deviation"||(c.statistics=s)),c}function JLe(i,e){const{multidimensionalInfo:t}=i;if(!e||!t)return i;const r=t.variables.find(n=>n.name===e);if(!r)return i;if(i=i.clone(),r){const{statistics:n,histograms:s}=r;n?.length&&(i.statistics=n.map(o=>({min:o.min,max:o.max,avg:o.avg,stddev:o.stddev}))),s?.length&&(i.histograms=s)}return i}function THe(i){const e=i.bandCount;if(e===1)return null;if(e===2)return[0];const{bandInfos:t}=i;let r;if(t.length===e){const{red:n,green:s,blue:o,nir:a}=_cr(t);n!=null&&s!=null&&o!=null?r=[n,s,o]:a!=null&&n!=null&&s!=null&&(r=[a,n,s])}return!r&&e>=3&&(r=[0,1,2]),r}function _cr(i){const e={};for(let t=0;t=410&&s<=480&&o>=480&&o<=540?e.blue=t:e.green==null&&s>=490&&s<=560&&o>=560&&o<=610?e.green=t:e.red==null&&s>=595&&s<=670&&o>=660&&o<=730?e.red=t:e.nir==null&&s>=700&&s<=860&&o>=800&&o<=950&&(e.nir=t)}}return e}function bcr(i){let e="percent-clip";const{pixelType:t,dataType:r,histograms:n,statistics:s,multidimensionalInfo:o}=i,a=JRt.has(r)||r==="generic"&&o!=null;return t!=="u8"||r!=="processed"&&n!=null&&s!=null?t==="u8"||r==="elevation"||a?e="min-max":n!=null?e="percent-clip":s!=null&&(e="min-max"):e="none",e}function wcr(i,e,t,r){if(!wHe(i,e))return null;const{attributeTable:n,statistics:s}=i,o=KRt(n,e),a=zie(n,"red"),l=zie(n,"green"),u=zie(n,"blue"),c=new vae,h=[],p=new Set,m=!!(a&&l&&u);if(n!=null)n.features.forEach(v=>{const w=v.attributes[o.name];if(!p.has(v.attributes[o.name])&&w!=null){p.add(w);const S=m&&(a.type==="single"||a.type==="double")&&(l.type==="single"||l.type==="double")&&(u.type==="single"||u.type==="double")&&!n.features.some(R=>R.attributes[a.name]>1||R.attributes[l.name]>1||R.attributes[u.name]>1),I=S?255:1;h.push(new J8({value:v.attributes[o.name],label:v.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new jr(m?[v.attributes[a.name]*I,v.attributes[l.name]*I,v.attributes[u.name]*I,1]:[0,0,0,0])}}))}});else if(s?.[0])for(let v=s[0].min;v<=s[0].max;v++)h.push(new J8({value:v,label:v.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new jr([0,0,0,0])}}));if(h.sort((v,w)=>v.value&&typeof v.value.valueOf()=="string"?0:v.value>w.value?1:-1),!m){const v=tk(qot,{numColors:h.length});h.forEach((w,S)=>w.symbol.color=new jr(v[S].slice(1,4))),c.colorRamp=qot}return new JB({field:o.name,uniqueValueInfos:h,authoringInfo:c})}function KRt(i,e,t){let r;return i!=null?(r=e?i.fields.find(n=>e.toLowerCase()===n.name.toLowerCase()):xcr(i.fields),r||(t||(r=i.fields.find(n=>n.type==="string")),r||(r=zie(i,"value")))):r=new Fo({name:"value"}),r}function xcr(i){let e;for(let t=0;tt.name.toLowerCase()===e)}function Scr(i){if(!xHe(i))return null;let e;const{attributeTable:t,colormap:r}=i;if(t!=null){const n=zie(t,"value"),s=KRt(t,null,!0);s.type==="string"&&(e={},t.features.forEach(o=>{const a=o.attributes;e[a[n.name]]=s?a[s.name]:a[n.name]}))}return aHe.createFromColormap(r,e)}const Tcr=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Ccr(i){if(!SHe(i))return null;let e;if(i.statistics!=null&&i.statistics.length&&(i.dataType==="vector-magdir"||i.dataType==="vector-uv")){const{minMagnitude:n,maxMagnitude:s}=Ecr(i.dataType,i.statistics);e=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:n,maxDataValue:s}]}const t=i.multidimensionalInfo!=null?Tcr.get(i.multidimensionalInfo.variables[0].unit):null,r=new fHe({visualVariables:e,inputUnit:t,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function Yot(i){return{color:i.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function KLe(i){if(i.type==="uniqueValue"){const e=i.uniqueValueInfos;return e?.[0].symbol?.symbolLayers?.length&&(i.uniqueValueInfos=e?.map(r=>({value:r.value,label:r.label,symbol:r.symbol?Yot(r.symbol):null}))),i}if(i.type==="classBreaks"){const e=i.classBreakInfos;return e[0].symbol?.symbolLayers?.length&&(i.classBreakInfos=e.map(r=>({classMinValue:r.classMinValue,classMaxValue:r.classMaxValue,label:r.label,symbol:r.symbol?Yot(r.symbol):null}))),i}return i}function Ecr(i,e){let t,r;if(i==="vector-magdir")t=e[0].min,r=e[0].max;else{const n=e[0].min,s=e[0].max,o=e[1].min,a=e[1].max;t=0,r=Math.max(Math.abs(n),Math.abs(o),Math.abs(s),Math.abs(a))}return{minMagnitude:t,maxMagnitude:r}}const tMe=1;function ZRt(i,e=256){e=Math.min(e,256);const{size:t,counts:r}=i,n=new Uint8Array(t),s=r.reduce((c,h)=>c+h/e,0);let o=0,a=0,l=0,u=s;for(let c=0;c=l){const B=IHe(l,r);for(u=0;u1&&(L-=(1/w)**(S*B[u])),Re[u]){const $=L*w*S**(1/r[u])+o;k[c]=s==="floor"?Math.floor($):s==="round"?Math.round($):$}else R>=t[u]?k[c]=a:k[c]=o;else k[c]=o;I[u]=k}}else for(u=0;u=t[u])k[c]=a;else{const B=(R-e[u])*m[u]+o;k[c]=s==="floor"?Math.floor(B):s==="round"?Math.round(B):B}I[u]=k}if(i.contrastOffset!=null){const B=QRt(i.contrastOffset,i.brightnessOffset);for(u=0;u0&&t<100?a=(200*o-100*n+2*n*r)/(2*(100-t))+s:t<=0&&t>-100?a=(200*o-100*n+2*n*r)*(100+t)/2e4+s:t===100?(a=200*o-100*n+(n+1)*(100-t)+2*n*r,a=a>0?n:0):t===-100&&(a=s),l[o]=a>n?n:a<0?0:a;return l}function Icr(i,e,t){const r=[];for(let n=0;n=255)return tMe;let e=0;i!==150&&(e=i<=150?45*Math.cos(.01047*i):17*Math.sin(.021*i));const t=255,r=i+e,n=Math.log(i/t),s=Math.log(r/t);if(s===0)return tMe;const o=n/s;return isNaN(o)?tMe:Math.min(9.9,Math.max(.01,o))}function Mcr(i,e,t,r){let n=1/0,s=-1/0,o=0,a=0,l=0,u=0;const c=i.length,h=new Map,p=[];for(let V=0;Vu&&(u=K,l=Y),n=Ys?Y:s,o+=Y,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=o/a;let v=0;for(let V=0;VV).length:c,S=w<=1?0:Math.sqrt(v/(w-1));p.sort((V,Y)=>V-Y);const I=a>>>1,R={min:n,max:s,avg:m,stddev:S,mode:l,median:a%2?p[Math.floor(I)]:(p[I-1]+p[I])/2};if(["u8","s8","u4","u2","u1"].includes(t)){const V=s-n+1,Y=new Uint32Array(V);for(let K=0;KMcr(o,n?.[a]??t,r));return{statistics:s.map(({statistics:o})=>o),histograms:s.map(({histogram:o})=>o)}}function CHe(i){if(!i?.pixels?.length)return null;const{pixels:e,mask:t,bandMasks:r,pixelType:n}=i,s=i.width*i.height,o=e.length,a=[],l=[],u=256;let c,h,p,m;for(let v=0;vh?ne:h,p[ne]++}}else for(let re=0;reh?ne:h,p[ne]++}p=p.slice(c,h+1)}else{let re=!1;i.statistics||(i.updateStatistics(),re=!0);const ne=i.statistics;c=ne[v].minValue,h=ne[v].maxValue;const de=(h-c)/u;if(de===0){!ne||i.validPixelCount||re||i.updateStatistics();const pe=(i.validPixelCount||i.width*i.height)/u;for(let H=0;H[Q.minValue,Q.maxValue,0,0]);else{const Q=CHe(t);o=Q!=null?Q.statistics:null,a=Q!=null?Q.histograms:null}else o=i.statistics?.length?i.statistics:s.statistics,a="histograms"in i?i.histograms:void 0,a||(a=s.histograms);l!=="percentClip"&&l!=="histogramEqualization"||a?.length||(l="minMax");const u=o?.length||a?.length||s.bandCount,c=[],h=[];let p,m,v,w,S,I,R,L,k;o&&!Array.isArray(o[0])&&(o=o.map(Q=>[Q.min,Q.max,Q.avg,Q.stddev]));const[B,$]=Yx(s.pixelType);if(!o?.length){for(o=[],L=0;Lre[1]&&(h[L]=re[1])}}break;case"histogramEqualization":for(Of(a),L=0;L=20&&(w[0]=w[1]=w[2]=w[w.length-1]=w[w.length-2]=0),v=0,m=(p.max-p.min)/p.size,R=p.min===-.5&&m===1?.5:0,k=0;kI){c[L]=p.min+m*(k+R);break}for(I=(1-(i.maxPercent||0)/100)*v,h[L]=p.max+R,k=p.size-2;k>=0;k--)if(S[k]ZRt(Q)))):(Y=i.max||255,V=i.min||0),Ocr({minCutOff:c,maxCutOff:h,outMax:Y,outMin:V,histogramLut:K},r)}function Ocr(i,e){if(e==null||e.length===0)return i;const t=Math.max.apply(null,e),{minCutOff:r,maxCutOff:n,outMin:s,outMax:o,histogramLut:a}=i;return r.length===e.length||r.length<=t?i:{minCutOff:e.map(l=>r[l]),maxCutOff:e.map(l=>n[l]),histogramLut:a?e.map(l=>a[l]):null,outMin:s,outMax:o}}function IHe(i,e){const t=new Float32Array(i);for(let r=0;r1?e[r]>2?t[r]=6.5+(e[r]-2)**2.5:t[r]=6.5+100*(2-e[r])**4:t[r]=1;return t}function Hme(i,e){if(!i?.pixels?.length)return i;const{mask:t,bandMasks:r,width:n,height:s,pixels:o}=i,{minCutOff:a,maxCutOff:l,gamma:u}=e,c=e.outMin||0,h=e.outMax||255,p=n*s,m=e.outputPixelType||"u8",v=i.pixels.map(()=>Br.createEmptyBand(m,p)),w=v.length,S=h-c,I=[],R=[];for(let V=0;V=w,B=!!e.isRenderer;if(k){const V=IHe(w,u);for(let Y=0;Y1&&(de-=(1/S)**(ne*V[Y])),rea[Y]){const pe=de*S*ne**(1/u[Y])+c;v[Y][Q]=B?Math.floor(pe):L?Math.round(pe):pe}else re>=l[Y]?v[Y][Q]=h:v[Y][Q]=c}}}else for(let V=0;Va[V]){const re=(Q-a[V])*I[V]+c;v[V][K]=B?Math.floor(re):L?Math.round(re):re}else Q>=l[V]?v[V][K]=h:v[V][K]=c}}const $=new Br({width:n,height:s,mask:t,bandMasks:r,pixels:v,pixelType:m});return $.updateStatistics(),$}const Dv=1,yP=1/111e3;function eDt(i){let{altitude:e,azimuth:t}=i;const{hillshadeType:r,pixelSizePower:n=1,pixelSizeFactor:s=1,scalingType:o,isGCS:a,resolution:l}=i,u=r==="multi-directional"?2*i.zFactor:i.zFactor,{x:c,y:h}=l;let p=u/(8*c),m=u/(8*h);if(a&&u>.001&&(p/=yP,m/=yP),o==="adjusted")if(a){const ne=c*yP,de=h*yP;p=(u+ne**n*s)/(8*ne),m=(u+de**n*s)/(8*de)}else p=(u+c**n*s)/(8*c),m=(u+h**n*s)/(8*h);let v=(90-e)*Math.PI/180,w=Math.cos(v),S=(360-t+90)*Math.PI/180,I=Math.sin(v)*Math.cos(S),R=Math.sin(v)*Math.sin(S);const L=[315,270,225,360,180,0],k=[60,60,60,60,60,90],B=new Float32Array([3,5,3,2,1,4]),$=B.reduce((ne,de)=>ne+de),V=B.map(ne=>ne/$),Y=r==="multi-directional"?L.length:1,K=new Float32Array(6),Q=new Float32Array(6),re=new Float32Array(6);if(r==="multi-directional")for(let ne=0;nev?v:S],L=o[w],k=L*R,B=k*(1-Math.abs(I%2-1)),$=L-k;switch(Math.floor(I)){case 0:h[w]=k+$,p[w]=B+$,m[w]=$;break;case 1:h[w]=B+$,p[w]=k+$,m[w]=$;break;case 2:h[w]=$,p[w]=k+$,m[w]=B+$;break;case 3:h[w]=$,p[w]=B+$,m[w]=k+$;break;case 4:h[w]=B+$,p[w]=$,m[w]=k+$;break;case 5:case 6:h[w]=k+$,p[w]=$,m[w]=B+$}}i.pixels=[h,p,m],i.updateStatistics()}function Dcr(i,e){if(!bh(i))return i;const t=e.zFactor,r=e.pixelSizePower??1,n=e.pixelSizeFactor??1,s=e.slopeType,o=e.isGCS,{x:a,y:l}=e.resolution;let u=t/(8*a),c=t/(8*l);o&&Math.abs(t-1)<1e-4&&(u/=yP,c/=yP),s==="adjusted"&&(u=(t+a**r*n)/(8*a),c=(t+l**r*n)/(8*l));const{dzxs:h,dzys:p,outMask:m}=sSe(i),{width:v,height:w}=i,S=new Float32Array(v*w);for(let R=Dv;R360&&(I%=360)),c[p+m]=I}}}return oSe(c,l,u),new Br({width:l,height:u,pixels:[c],mask:a,pixelType:"f32",validPixelCount:i.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function kcr(i,e){if(!bh(i))return i;const{curvatures:t,outMask:r}=sSe(i,e),{width:n,height:s}=i;oSe(t,n,s);const o=new Br({width:n,height:s,pixels:[t],mask:r,pixelType:"f32",validPixelCount:i.validPixelCount});return o.updateStatistics(),o}let e$=class extends Ci{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!Xot(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const n=e.extent,s=n.spatialReference.isGeographic,o={x:(n.xmax-n.xmin)/t.width,y:(n.ymax-n.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:s,resolution:o});break}}return r}catch(r){return di.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Xot(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),Hme(e,{...t,isRenderer:!0})}catch(r){return di.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:a,offset:l}=this.lookup.colormapLut||{};return{colormap:a,colormapOffset:l,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:n,bandIds:s}=e,{rendererJSON:o}=this;return o.type==="rasterStretch"?this._generateStretchWebGLParams(t,o,s):o.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(o,r,n??void 0):o.type==="vectorField"?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:V3e(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?V3e(e,this.lookup.colormapLut):llr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:n,bandCount:s}=r,o=this.rendererJSON,a=["u8","u16","s8","s16"].includes(n);let l,u;const{dra:c}=o,{gamma:h}=this.lookup;if(o.stretchType==="histogramEqualization"){const p=c?null:this.lookup?.histogramLut,m=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!p}),v=Hme(e,{...m,gamma:h,isRenderer:!0});u=Vne(v,{lut:c?m.histogramLut:p,offset:0})}else if(a){if(c){const p=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t});l=ZLe({pixelType:n,...p,gamma:h,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;s>1&&t!=null&&t.length===e?.pixels.length&&l?.lut.length===s&&(l={lut:t.map(p=>l.lut[p]),offset:l.offset}),u=Vne(e,l)}else{const p=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t});u=Hme(e,{...p,gamma:h,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;u=V3e(u,this.lookup?.colormapLut)}return u}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,n={...r,...t},s=Pcr(e,n);if(!r.colorRamp)return s;let o;if(this._isLUTChanged(!0)){if(!this.bind().success)return s;o=this.lookup?this.lookup.hsvMap:null}else o=this.lookup?this.lookup.hsvMap:null;if(!o)return s;const a=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Rcr(s,e,o,a),s}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:n}=this.rasterInfo,s=e.field1;if(!s)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,a=t===1&&["u8","s8"].includes(n);if(!wHe(this.rasterInfo,s)&&!a)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const l=[];if(r!=null){const c=r.fields.find(h=>h.name.toLowerCase()==="value");if(!c)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(h=>{const p=e.uniqueValueInfos?.find(v=>String(v.value)===String(h.attributes[s])),m=p?.symbol?.color;m?l.push([h.attributes[c.name]].concat(m)):o&&l.push([h.attributes[c.name]].concat(o.color))})}else{if(s.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach(c=>{const h=c?.symbol?.color;h?l.push([parseInt(""+c.value,10)].concat(h)):o&&l.push([parseInt(""+c.value,10)].concat(o?.color))})}if(l.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const u=LJ({colormap:l});return this.lookup={rendererJSON:e,colormapLut:u},this.canRenderInWebGL=this._isColormapSupportedByWebGL(u?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!xHe(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(n=>[n.value].concat(n.color)).sort((n,s)=>n[0]-s[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=LJ({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!XRt(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=tk(e.colorRamp,{interpolateAlpha:!0}),r=LJ({colormap:t}),n=[],s=r.indexedColormap;for(let o=0;oa.name.toLowerCase()==="value"):null,s=t!=null?t.fields.find(a=>a.name.toLowerCase()===e.field.toLowerCase()):null,o=n!=null&&s!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:n,tableBreakField:s}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:n,tableBreakField:s}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const a=o.sort((p,m)=>p.classMaxValue-m.classMaxValue),l=a[a.length-1];let u=e.minValue;if(!r){const p=[];for(let m=0;mk>R);L&&c.push([I].concat(L.symbol.color))}}else{u=Math.floor(e.minValue);for(let p=0;p0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!(t==="none"||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const n=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||n?.length||r||(t="minMax");const{computeGamma:s,useGamma:o,colorRamp:a}=e;let{gamma:l}=e;if(o&&s&&!l?.length){const h=e.statistics?.length?e.statistics:this.rasterInfo.statistics;l=Icr(this.rasterInfo.pixelType,h)}const u=this.rasterInfo.pixelType,c=!r&&["u8","u16","s8","s16"].includes(u);if(t==="histogramEqualization"){const h=n.map(p=>ZRt(p));this.lookup={rendererJSON:e,histogramLut:h}}else if(c){const h=$5(e,{rasterInfo:this.rasterInfo}),p=ZLe({pixelType:u,...h,gamma:o?l:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:p}}if(a&&!this._isStretchColorRampNoop(a)){const h=tk(a,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=LJ({colormap:h}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){let n=null,s=null;const o=this.lookup?.colormapLut;t.colorRamp&&o&&(n=o.indexedColormap,s=o.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:a}=this.lookup,l=!!(t.useGamma&&a&&a.some(k=>k!==1)),{minCutOff:u,maxCutOff:c,outMin:h,outMax:p}=$5(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let m=0;e!=null&&(m=e.getPlaneCount(),m===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:v}=this.rasterInfo,w=Math.min(3,r?.length||m||v,v),S=new Float32Array(w),I=n||l?1:255;let R;for(R=0;R1?a[R]>2?L[R]=6.5+(a[R]-2)**2.5:L[R]=6.5+100*(2-a[R])**4:L[R]=1;return{bandCount:w,outMin:h/I,outMax:p/I,minCutOff:u,maxCutOff:c,factor:S,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?L:[1,1,1],colormap:n,colormapOffset:s,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let n=null,s=null;const o=this.lookup?.colormapLut;e.colorRamp&&o&&(n=o.indexedColormap,s=o.offset);const a={...e,isGCS:t,resolution:r},l=eDt(a),u=this.rasterInfo.statistics?.[0];return{...l,minValue:u?.min??0,maxValue:u?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:n,colormapOffset:s}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:n,visualVariables:s,symbolTileSize:o,flowRepresentation:a}=e;let l;const u=this.rasterInfo.statistics?.[0].min??0,c=this.rasterInfo.statistics?.[0].max??50,h=s?.find(R=>R.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:c,maxSize:.8*o,minDataValue:u,minSize:.2*o},p=h.minDataValue??u,m=h.maxDataValue??c,v=h.maxSize!=null&&h.minSize!=null?[h.minSize/o,h.maxSize/o]:[.2,.8];if(t==="wind_speed"){const R=(v[0]+v[1])/2;v[0]=v[1]=R}const w=p!=null&&m!=null?[p,m]:null;if(t==="classified_arrow")if(p!=null&&m!=null&&h!=null){l=[];const R=(h.maxDataValue-h.minDataValue)/5;for(let L=0;L<6;L++)l.push(h.minDataValue+R*L)}else l=[0,1e-6,3.5,7,10.5,14];const S=a==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,I=s?.find(R=>R.type==="rotationInfo");return{breakValues:l,dataRange:w,inputUnit:r,outputUnit:n,symbolTileSize:o,symbolPercentRange:v,style:t||"single_arrow",rotation:S,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":I?.rotationType||e.rotationType,type:"vectorField"}}};function Xot(i){return bh(i)&&i.validPixelCount!==0}x([D({json:{write:!0}})],e$.prototype,"rendererJSON",void 0),x([D({type:W3,json:{write:!0}})],e$.prototype,"rasterInfo",void 0),x([D({json:{write:!0}})],e$.prototype,"lookup",void 0),x([D()],e$.prototype,"canRenderInWebGL",void 0),e$=x([Qe("esri.renderers.support.RasterSymbolizer")],e$);const AHe=e$,tDt=i=>{let e=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return x([D({json:{write:!0}})],e.prototype,"make",void 0),x([D({json:{write:!0}})],e.prototype,"model",void 0),x([D({json:{write:!0}})],e.prototype,"focalLength",void 0),x([D({json:{write:!0}})],e.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],e.prototype,"rows",void 0),x([D({json:{write:!0}})],e.prototype,"cols",void 0),e=x([Qe("esri.rest.support.CameraInfoMixin")],e),e};let VT=class extends tDt(Ci){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(e,t){t.acquisitionDate=e?.getTime()}};x([D({json:{write:!0}})],VT.prototype,"id",void 0),x([D({json:{name:"uri",write:!0}})],VT.prototype,"referenceUri",void 0),x([D({type:Date,json:{write:!0}})],VT.prototype,"acquisitionDate",void 0),x([ur("acquisitionDate")],VT.prototype,"writeAcquisitionDate",null),x([D({json:{write:!0}})],VT.prototype,"cameraID",void 0),x([D({type:$i,json:{write:!0}})],VT.prototype,"center",void 0),x([D({type:$i,json:{write:!0}})],VT.prototype,"perspectiveCenter",void 0),x([D({json:{write:!0}})],VT.prototype,"orientation",void 0),VT=x([Qe("esri.rest.support.ImageInspectionInfo")],VT);const Lcr=VT;let Wme=class extends Ci{constructor(){super(...arguments),this.images=null}};x([D({type:[Lcr],json:{write:!0}})],Wme.prototype,"images",void 0),Wme=x([Qe("esri.rest.support.FindImagesResult")],Wme);const Ncr=Wme;let XG=class extends Ci{constructor(e){super(e),this.north=null,this.up=null,this.spatialReference=null}};x([D({type:Number,json:{write:!0}})],XG.prototype,"north",void 0),x([D({type:Number,json:{write:!0}})],XG.prototype,"up",void 0),x([D({type:Xi,json:{write:!0}})],XG.prototype,"spatialReference",void 0),XG=x([Qe("esri.rest.support.ImageAngleResult")],XG);const $cr=XG;let B5=class extends Ci{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};x([D({type:Number,json:{read:!0,write:!0}})],B5.prototype,"value",void 0),x([D({type:String,json:{read:!0,write:!0}})],B5.prototype,"displayValue",void 0),x([D({type:Number,json:{read:!0,write:!0}})],B5.prototype,"uncertainty",void 0),B5=x([Qe("esri.rest.support.ImageMeasureResultValue")],B5);let VV=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:uR.read,write:uR.write}})],VV.prototype,"unit",void 0),VV=x([Qe("esri.rest.support.ImageMeasureResultLengthValue")],VV);let qme=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:Cne.read,write:Cne.write}})],qme.prototype,"unit",void 0),qme=x([Qe("esri.rest.support.ImageMeasureResultAreaValue")],qme);let Vie=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:jve.read,write:jve.write}})],Vie.prototype,"unit",void 0),Vie=x([Qe("esri.rest.support.ImageMeasureResultAngleValue")],Vie);let nF=class extends Ci{constructor(){super(...arguments),this.name=null,this.sensorName=null}};x([D({type:String,json:{read:!0,write:!0}})],nF.prototype,"name",void 0),x([D({type:String,json:{read:!0,write:!0}})],nF.prototype,"sensorName",void 0),nF=x([Qe("esri.rest.support.BaseImageMeasureResult")],nF);let PQ=class extends nF{constructor(){super(...arguments),this.area=null,this.perimeter=null}};x([D({type:qme,json:{read:!0,write:!0}})],PQ.prototype,"area",void 0),x([D({type:VV,json:{read:!0,write:!0}})],PQ.prototype,"perimeter",void 0),PQ=x([Qe("esri.rest.support.ImageAreaResult")],PQ);const Bcr=PQ;let JG=class extends Ci{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(e,t){return e==null?null:e.rings?$s.fromJSON(e):hr.fromJSON(e)}};x([D({type:Number,json:{write:!0}})],JG.prototype,"area",void 0),x([D({json:{name:"shape",write:!0}})],JG.prototype,"geometry",void 0),x([Mi("geometry")],JG.prototype,"readGeometry",null),JG=x([Qe("esri.rest.support.ImageBoundaryResult")],JG);const jcr=JG;let KG=class extends nF{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};x([D({type:VV,json:{read:!0,write:!0}})],KG.prototype,"distance",void 0),x([D({type:Vie,json:{read:!0,write:!0}})],KG.prototype,"azimuthAngle",void 0),x([D({type:Vie,json:{read:!0,write:!0}})],KG.prototype,"elevationAngle",void 0),KG=x([Qe("esri.rest.support.ImageDistanceResult")],KG);const Gcr=KG;let Yme=class extends tDt(Ci){constructor(){super(...arguments),this.id=null}};x([D({json:{write:!0}})],Yme.prototype,"id",void 0),Yme=x([Qe("esri.rest.support.CameraInfo")],Yme);const Ucr=Yme;let HT=class extends Ci{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(e,t){t.acquisitionDate=e?.getTime()}};x([D({json:{write:!0}})],HT.prototype,"id",void 0),x([D({json:{write:!0}})],HT.prototype,"name",void 0),x([D({type:Date,json:{write:!0}})],HT.prototype,"acquisitionDate",void 0),x([ur("acquisitionDate")],HT.prototype,"writeAcquisitionDate",null),x([D({json:{write:!0}})],HT.prototype,"cameraID",void 0),x([D({type:$i,json:{write:!0}})],HT.prototype,"center",void 0),x([D({json:{write:!0}})],HT.prototype,"gps",void 0),x([D({json:{write:!0}})],HT.prototype,"orientation",void 0),HT=x([Qe("esri.rest.support.ImageGPSInfo")],HT);const zcr=HT;let RQ=class extends Ci{constructor(){super(...arguments),this.images=null,this.cameras=null}};x([D({type:[zcr],json:{write:!0}})],RQ.prototype,"images",void 0),x([D({type:[Ucr],json:{write:!0}})],RQ.prototype,"cameras",void 0),RQ=x([Qe("esri.rest.support.ImageGPSInfoResult")],RQ);const Vcr=RQ;let Xme=class extends nF{constructor(){super(...arguments),this.height=null}};x([D({type:VV,json:{read:!0,write:!0}})],Xme.prototype,"height",void 0),Xme=x([Qe("esri.rest.support.ImageHeightResult")],Xme);const Hcr=Xme;let WT=class extends Ci{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};x([D({json:{write:!0}})],WT.prototype,"catalogItemVisibilities",void 0),x([D({type:du,json:{write:!0}})],WT.prototype,"catalogItems",void 0),x([D({type:$i,json:{write:!0}})],WT.prototype,"location",void 0),x([D({json:{write:!0}})],WT.prototype,"name",void 0),x([D({json:{write:!0}})],WT.prototype,"objectId",void 0),x([D({json:{write:!0}})],WT.prototype,"processedValues",void 0),x([D({json:{write:!0}})],WT.prototype,"properties",void 0),x([D({json:{write:!0}})],WT.prototype,"value",void 0),WT=x([Qe("esri.rest.support.ImageIdentifyResult")],WT);const Wcr=WT;let Jme=class extends Ci{constructor(){super(...arguments),this.geometries=null}};x([D({json:{write:!0}})],Jme.prototype,"geometries",void 0),Jme=x([Qe("esri.rest.support.ImagePixelLocationResult")],Jme);const qcr=Jme;let Kme=class extends nF{constructor(){super(...arguments),this.point=null}};x([D({type:$i,json:{name:"point.value",read:!0,write:!0}})],Kme.prototype,"point",void 0),Kme=x([Qe("esri.rest.support.ImagePointResult")],Kme);const Ycr=Kme;let iO=class extends Ci{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};x([D({json:{write:!0}})],iO.prototype,"attributes",void 0),x([D({type:$i,json:{write:!0}})],iO.prototype,"location",void 0),x([D({json:{write:!0}})],iO.prototype,"locationId",void 0),x([D({json:{write:!0}})],iO.prototype,"rasterId",void 0),x([D({json:{write:!0}})],iO.prototype,"resolution",void 0),x([D({json:{write:!0}})],iO.prototype,"pixelValue",void 0),iO=x([Qe("esri.rest.support.ImageSample")],iO);const Xcr=iO;let Zme=class extends Ci{constructor(){super(...arguments),this.samples=null}};x([D({type:[Xcr],json:{write:!0}})],Zme.prototype,"samples",void 0),Zme=x([Qe("esri.rest.support.ImageSampleResult")],Zme);const Jcr=Zme;let Qme=class extends Ci{constructor(){super(...arguments),this.url=null}};x([D({json:{name:"imageURL",write:!0}})],Qme.prototype,"url",void 0),Qme=x([Qe("esri.rest.support.ImageUrlResult")],Qme);const Kcr=Qme;let w4=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(e,t){return e.spatialReference||(e={...e,spatialReference:t.Shape.spatialReference}),$i.fromJSON(e)}};x([D({types:Ff,json:{name:"Shape",read:Ro,write:!0}})],w4.prototype,"geometry",void 0),x([D({json:{name:"Length",write:!0}})],w4.prototype,"length",void 0),x([D({json:{name:"Area",write:!0}})],w4.prototype,"area",void 0),x([D({json:{name:"Center",write:!0}})],w4.prototype,"center",void 0),x([Mi("center")],w4.prototype,"readCenter",null),w4=x([Qe("esri.rest.support.MeasureAreaFromImageResult")],w4);const Zcr=w4;let DQ=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.length=null}};x([D({types:Ff,json:{name:"Shape",read:Ro,write:!0}})],DQ.prototype,"geometry",void 0),x([D({json:{name:"Length",write:!0}})],DQ.prototype,"length",void 0),DQ=x([Qe("esri.rest.support.MeasureLengthFromImageResult")],DQ);const Qcr=DQ;function MHe(i){const e=i?.time;if(e&&(e.start!=null||e.end!=null)){const t=[];e.start!=null&&t.push(e.start),e.end==null||t.includes(e.end)||t.push(e.end),i.time=t.join(",")}}async function iDt(i,e,t){const r=gu(i),n=e.geometry?[e.geometry]:[],s=await cy(n),o=e.toJSON();MHe(o);const a=s?.[0];a!=null&&(o.geometry=m3(a));const l=Ig({...r.query,f:"json",...o});return _p(l,t)}async function ehr(i,e,t){const r=e.toJSON();r.angleName!=null&&(r.angleName=r.angleName.join(",")),e?.point?.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=lSe(e.point.spatialReference)),e?.spatialReference?.imageCoordinateSystem&&(r.spatialReference=BY(e.spatialReference));const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/computeAngles`,o);return a.spatialReference=a.spatialReference?a.spatialReference.geodataXform!=null?new Xi({wkid:0,imageCoordinateSystem:a.spatialReference}):Xi.fromJSON(a.spatialReference):null,a.north==="NaN"&&(a.north=null),a.up==="NaN"&&(a.up=null),new $cr(a)}async function thr(i,e,t){const r=e.toJSON(),{geometries:n}=e;if(n)for(let u=0;u{a.avg=a.mean,a.stddev=a.standardDeviation}),{statistics:o,histograms:s.histograms}}async function rhr(i,e,t){const r=await iDt(i,e,t),n=gu(i),{data:s}=await zi(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}async function nhr(i,e,t){const r=e.toJSON();MHe(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s));const o=gu(i),a=Ig({...o.query,f:"json",...r}),l=_p(a,t),{data:u}=await zi(`${o.path}/getSamples`,l),c=u?.samples?.map(h=>{const p=h.value==="NaN"||h.value===""?null:h.value.split(" ").map(m=>Number(m));return{...h,pixelValue:p}});return Jcr.fromJSON({samples:c})}async function Jot(i,e,t){const r=gu(i),n=e.geometry?[e.geometry]:[];return cy(n).then(s=>{const o=e.toJSON(),a=s?.[0];a!=null&&(o.geometry=JSON.stringify(m3(a)));const l=Ig({...r.query,f:"json",...o}),u=_p(l,t);return zi(r.path+"/identify",u)}).then(s=>Wcr.fromJSON(s.data))}async function shr(i,e,t){const r=await aSe(i,e,[e.fromGeometry,e.toGeometry],t);return Hcr.fromJSON(r)}async function ohr(i,e,t){const r=await aSe(i,e,[e.geometry],t);return Bcr.fromJSON(r)}async function ahr(i,e,t){const r=await aSe(i,e,[e.geometry],t);return Ycr.fromJSON(r)}async function lhr(i,e,t){const r=await aSe(i,e,[e.fromGeometry,e.toGeometry],t);return Gcr.fromJSON(r)}async function aSe(i,e,t,r){const n=gu(i),s=await cy(t),o=e.toJSON();s[0]!=null&&(o.fromGeometry=JSON.stringify(m3(s[0]))),s[1]!=null&&(o.toGeometry=JSON.stringify(m3(s[1])));const a=Ig({...n.query,f:"json",...o}),l=_p(a,r),{data:u}=await zi(n.path+"/measure",l);return u}async function uhr(i,e,t){const r=await rDt(i,e,t);return Qcr.fromJSON(r)}async function chr(i,e,t){const r=await rDt(i,e,t);return Zcr.fromJSON(r)}async function rDt(i,e,t){const r=gu(i),n=e.toJSON(),s=Ig({...r.query,f:"json",...n}),o=_p(s,t),{data:a}=await zi(r.path+"/measureFromImage",o);return a}function m3(i){const e=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(e.spatialReference=lSe(i.spatialReference)),e}function lSe(i){const{imageCoordinateSystem:e}=i;if(e){const{id:t,referenceServiceName:r}=e;return t!=null?r?{icsid:t,icsns:r}:{icsid:t}:{ics:e}}return i.toJSON()}function BY(i,e){if(!i.imageCoordinateSystem)return Hv(i);const t=lSe(i),{icsid:r,icsns:n}=t;return r==null||n!=null&&!e?.toLowerCase().includes("/"+n.toLowerCase()+"/")?JSON.stringify(t):`0:${r}`}async function hhr(i,e,t){const r=gu(i),n=e.toJSON();e.outSpatialReference&&(n.outSR=BY(e.outSpatialReference));const s=Ig({...r.query,f:"json",...n}),o=_p(s,t),{data:a}=await zi(r.path+"/queryBoundary",o);return jcr.fromJSON(a)}async function dhr(i,e,t){const r=e.toJSON();MHe(r),r.objectIds?.length&&(r.objectIds=r.objectIds.join(",")),r.geometry||r.objectIds||r.time||r.where||(r.where="1=1");const n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s));const o=s?.spatialReference??e.geometry?.spatialReference;o&&(r.inSR=BY(o));const a=gu(i),l=Ig({...a.query,f:"json",...r}),u=_p(l,t),{data:c}=await zi(`${a.path}/queryGPSInfo`,u);return Vcr.fromJSON(c)}async function phr(i,e,t){const r=e.toJSON();e.geometry.spatialReference.imageCoordinateSystem&&(r.geometry=m3(e.geometry)),e.depthOffset&&e.adjust||delete r.options;const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/imageToMap`,o);return Ro(a)}async function fhr(i,e,t){const r=e.toJSON();e.rasterIds?.length&&(r.rasterIds=e.rasterIds.join(","));const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/imageToMapMultiray`,o);return Ro(a)}async function mhr(i,e,t){const r=e.toJSON(),n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s)),e.visibleOnly||delete r.options;const o=s?.spatialReference??e.geometry?.spatialReference;o&&(r.inSR=BY(o));const a=gu(i),l=Ig({...a.query,f:"json",...r}),u=_p(l,t),{data:c}=await zi(`${a.path}/mapToImage`,u);return Ro(c)}async function ghr(i,e,t){const r=e.toJSON(),n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/getImageUrl`,o);return Kcr.fromJSON(a)}async function yhr(i,e,t){const r=e.toJSON(),n=await cy([e.fromGeometry,e.toGeometry]);n[0]!=null&&(r.fromGeometry=m3(n[0]),n[0].spatialReference&&(r.inSR=BY(n[0].spatialReference))),n[1]!=null&&(r.toGeometry=m3(n[1])),e.objectIds?.length&&(r.objectIds=r.objectIds.join(","));const s=gu(i),o=Ig({...s.query,f:"json",...r}),a=_p(o,t),{data:l}=await zi(`${s.path}/find`,a);return Ncr.fromJSON(l)}function Dae(i){const e={};for(const t in i){if(t==="declaredClass")continue;const r=i[t];if(r!=null&&typeof r!="function")if(Array.isArray(r)){e[t]=[];for(let n=0;n>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=this._data[this._pos]!==0;return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getUint32(t+4,!0)*Kot;return this._skip(8),r}getSFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getInt32(t+4,!0)*Kot;return this._skip(8),r}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,r=this._toString(this._data,t,t+e);return this._skip(e),r}getBytes(){const e=this._getLength(),t=this._pos,r=this._toBytes(this._data,t,t+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,r,n){const s=this.getMessage(),o=e(s,t,r,n);return s.release(),o}processMessage(e){const t=this.getMessage(),r=e(t);return t.release(),r}getMessage(){const e=this._getLength(),t=ege.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){ege.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case m5.varint:this._decodeVarint();break;case m5.fixed64:this._skip(8);break;case m5.delimited:this._skip(this._getLength());break;case m5.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,r=0,n=0;if(this._end-t>=10)do{if(n=e[t++],r|=127&n,(128&n)==0||(n=e[t++],r|=(127&n)<<7,(128&n)==0)||(n=e[t++],r|=(127&n)<<14,(128&n)==0)||(n=e[t++],r|=(127&n)<<21,(128&n)==0)||(n=e[t++],r+=268435456*(127&n),(128&n)==0)||(n=e[t++],r+=34359738368*(127&n),(128&n)==0)||(n=e[t++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[t++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[t++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[t++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(!1);else{let s=1;for(;t!==this._end&&(n=e[t],(128&n)!=0);)++t,r+=(127&n)*s,s*=128;if(t===this._end)throw new Error("Varint overrun!");++t,r+=n*s}return this._pos=t,r}_decodeSVarint(){const e=this._data;let t,r=0,n=0;const s=1&e[this._pos];if(n=e[this._pos++],r|=127&n,(128&n)==0||(n=e[this._pos++],r|=(127&n)<<7,(128&n)==0)||(n=e[this._pos++],r|=(127&n)<<14,(128&n)==0)||(n=e[this._pos++],r|=(127&n)<<21,(128&n)==0)||(n=e[this._pos++],r+=268435456*(127&n),(128&n)==0)||(n=e[this._pos++],r+=34359738368*(127&n),(128&n)==0)||(n=e[this._pos++],r+=4398046511104*(127&n),(128&n)==0))return s?-(r+1)/2:r/2;if(t=BigInt(r),n=e[this._pos++],t+=0x2000000000000n*BigInt(127&n),(128&n)==0||(n=e[this._pos++],t+=0x100000000000000n*BigInt(127&n),(128&n)==0)||(n=e[this._pos++],t+=0x8000000000000000n*BigInt(127&n),(128&n)==0))return Number(s?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==m5.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,r){if((r=Math.min(this._end,r))-t>_hr){const o=e.subarray(t,r);return vhr.decode(o)}let n="",s="";for(let o=t;o{i._data=null,i._dataView=null});const iMe=2;let $o=class FQ{constructor(e=[],t=[],r=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=r}static fromRect(e){const[t,r,n,s]=e,o=n-t,a=s-r;return new FQ([5],[t,r,o,0,0,a,-o,0,0,-a])}get isPoint(){return this.lengths.length===0}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce((e,t)=>e+t)}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;rn+s))*iMe,r=this.coords.slice(0,t);return e?(e.set(r),new FQ(this.lengths,e,this.hasIndeterminateRingOrder)):new FQ(Array.from(this.lengths),Array.from(r),this.hasIndeterminateRingOrder)}},ry=class QLe{constructor(e=null,t={},r,n){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=n,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new QLe(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new QLe(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}};function kQ(i){return!!i.geometry?.coords?.length}let OHe=class nDt{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new nDt;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}};const sDt=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let bhr=class{constructor(e){this._options=e,this.geometryTypes=sDt,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new OHe}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||Ya(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=WF(this._options.sourceSpatialReference)/WF(e.spatialReference);if(t!==1)for(const r of e.features){if(!kQ(r))continue;const n=r.geometry.coords;for(let s=2;st+r,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new $o}};const Zot=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],Qot=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],eat=["upperLeft","lowerLeft"];function tat(i){return i>=Zot.length?null:Zot[i]}function whr(i){return i>=Qot.length?null:Qot[i]}function iat(i){return i>=eat.length?null:eat[i]}function rat(i,e){return e>=i.geometryTypes.length?null:i.geometryTypes[e]}function xhr(i,e,t){const n=i.asUnsafe(),s=e.createPointGeometry(t);for(;n.next();)switch(n.tag()){case 3:{const o=n.getUInt32(),a=n.pos()+o;let l=0;for(;n.pos()s.name===t);return n?jhr({tagName:r,tags:n.tags}):null}function jhr(i){const{tagName:e,tags:t}=i;return!t||!e?null:t.find(n=>n.name===e)?.value||null}var eNe;const Ghr={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let $_=eNe=class extends Ci{constructor(i){super(i),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:i}=this,e=Bhr({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:i});return Ghr[e]||null}clone(){return new eNe({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};x([D({type:String})],$_.prototype,"contentType",void 0),x([D()],$_.prototype,"exifInfo",void 0),x([D({readOnly:!0})],$_.prototype,"orientationInfo",null),x([D({type:ms})],$_.prototype,"id",void 0),x([D({type:String})],$_.prototype,"globalId",void 0),x([D({type:String})],$_.prototype,"keywords",void 0),x([D({type:String})],$_.prototype,"name",void 0),x([D({json:{read:!1}})],$_.prototype,"parentGlobalId",void 0),x([D({json:{read:!1}})],$_.prototype,"parentObjectId",void 0),x([D({type:ms})],$_.prototype,"size",void 0),x([D({json:{read:!1}})],$_.prototype,"url",void 0),$_=eNe=x([Qe("esri.layers.support.AttachmentInfo")],$_);const dDt=$_;async function DHe(i,e,t){const r=gu(i);return PHe(r,Kn.from(e),{...t}).then(n=>n.data.count)}async function uSe(i,e,t){const r=gu(i);return Nhr(r,Kn.from(e),{...t}).then(n=>n.data.objectIds)}async function pDt(i,e,t){const r=gu(i),{rasterFunction:n,sourceJSON:s}=e||{},o=n?JSON.stringify(n.rasterFunctionDefinition||n):null,a=Ig({...r.query,renderingRule:o,f:"json"}),l=_p(a,t);i=r.path;const u=s||await zi(i,l).then(ae=>ae.data),c=u.hasRasterAttributeTable?zi(`${i}/rasterAttributeTable`,l):null,h=u.hasColormap?zi(`${i}/colormap`,l):null,p=u.hasHistograms?zi(`${i}/histograms`,l):null,m=u.currentVersion>=10.3?zi(`${i}/keyProperties`,l):null,v=u.hasMultidimensions?zi(`${i}/multidimensionalInfo`,l):null,w=await Promise.allSettled([c,h,p,m,v]);let S=null;if(u.minValues&&u.minValues.length===u.bandCount){S=[];for(let ae=0;ae{ae.statistics?.length&&ae.statistics.forEach(fe=>{fe.avg=fe.mean,fe.stddev=fe.standardDeviation})});const{defaultVariable:pe,serviceDataType:H}=u;pe&&pe!==re.DefaultVariable&&(re.DefaultVariable=pe),H?.includes("esriImageServiceDataTypeVector")&&!H.includes(re.DataType)&&(re.DataType=H.replace("esriImageServiceDataType",""));let Z=u.noDataValue;return u.noDataValues?.length&&u.noDataValues.some(ae=>ae!==Z)&&(Z=u.noDataValues),new W3({width:R,height:L,bandCount:u.bandCount,extent:hr.fromJSON(u.extent),spatialReference:k,pixelSize:new $i({x:u.pixelSizeX,y:u.pixelSizeY,spatialReference:k}),pixelType:u.pixelType.toLowerCase(),statistics:S,attributeTable:$,colormap:Y,histograms:Q,keyProperties:re,noDataValue:Z,multidimensionalInfo:de})}function fDt(i,e,t){return pDt(i,{sourceJSON:e},t)}function Uhr(i,e,t){return pDt(i,{rasterFunction:e},t)}function mDt(i,e){i.attributeTable||(e.hasRasterAttributeTable=!1),i.histograms||(e.hasHistograms=!1),i.colormap||(e.hasColormap=!1),i.multidimensionalInfo||(e.hasMultidimensions=!1)}async function zhr(i,e,t){const r=gu(i),n=Ig({...r?.query,f:"json"}),s=_p(n,t),o=`${r?.path}/${e}/info`,a=zi(`${o}`,s),l=zi(`${o}/keyProperties`,s),u=await Promise.allSettled([a,l]),c=u[0].status==="fulfilled"?u[0].value.data:null,h=u[1].status==="fulfilled"?u[1].value.data:null;let p=null;c.statistics?.length&&(p=c.statistics.map(k=>({min:k[0],max:k[1],avg:k[2],stddev:k[3]})));const m=hr.fromJSON(c.extent),v=Math.ceil(m.width/c.pixelSizeX-.1),w=Math.ceil(m.height/c.pixelSizeY-.1),S=m.spatialReference,I=new $i({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:S}),R=c.histograms?.length?c.histograms:null,L=new QB({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new W3({width:v,height:w,bandCount:c.bandCount,extent:m,spatialReference:S,pixelSize:I,pixelType:c.pixelType.toLowerCase(),statistics:p,histograms:R,keyProperties:h,storageInfo:L})}let x4=class extends xs(Ci){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};x([D({type:$i,json:{read:!0}})],x4.prototype,"fromGeometry",void 0),x([D({type:$i,json:{read:!0,write:!0}})],x4.prototype,"toGeometry",void 0),x([D({json:{write:!0}})],x4.prototype,"objectIds",void 0),x([D({type:String,json:{write:!0}})],x4.prototype,"where",void 0),x([D({type:Number,json:{write:!0}})],x4.prototype,"maxCount",void 0),x4=x([Qe("esri.rest.support.FindImagesParameters")],x4);const Vhr=x4;var tNe;let t$=tNe=class extends Ci{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new tNe(li({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};x([D({type:[String],json:{name:"angleName",write:!0}})],t$.prototype,"angleNames",void 0),x([D({type:$i,json:{write:!0}})],t$.prototype,"point",void 0),x([D({type:Xi,json:{write:!0}})],t$.prototype,"spatialReference",void 0),x([D({type:ms,json:{write:!0}})],t$.prototype,"rasterId",void 0),t$=tNe=x([Qe("esri.rest.support.ImageAngleParameters")],t$);const Hhr=t$,xS=new Rs({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let gC=class extends Ci{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};x([D()],gC.prototype,"type",void 0),x([D({type:xS.apiValues,json:{read:xS.read,write:xS.write}})],gC.prototype,"measureOperation",void 0),x([D({type:Qw,json:{write:!0}})],gC.prototype,"mosaicRule",void 0),x([D({type:$i,json:{write:!0}})],gC.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],gC.prototype,"raster",void 0),gC=x([Qe("esri.rest.support.BaseImageMeasureParameters")],gC);var iNe;let rO=iNe=class extends gC{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new iNe(li({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({types:Ff,json:{name:"fromGeometry",read:!0,write:!0}})],rO.prototype,"geometry",void 0),x([ur("geometry")],rO.prototype,"writeGeometry",null),x([D({type:xS.apiValues,json:{write:xS.write}})],rO.prototype,"measureOperation",null),x([D({json:{read:!0}})],rO.prototype,"is3D",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],rO.prototype,"linearUnit",void 0),x([D({type:String,json:{read:Cne.read,write:Cne.write}})],rO.prototype,"areaUnit",void 0),rO=iNe=x([Qe("esri.rest.support.ImageAreaParameters")],rO);const Whr=rO;let tge=class extends xs(Ci){constructor(){super(...arguments),this.outSpatialReference=null}};x([D({type:Xi,json:{name:"outSR",write:!0}})],tge.prototype,"outSpatialReference",void 0),tge=x([Qe("esri.rest.support.ImageBoundaryParameters")],tge);const qhr=tge;var rNe;let yI=rNe=class extends gC{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new rNe(li({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({type:$i,json:{read:!0,write:!0}})],yI.prototype,"fromGeometry",void 0),x([ur("fromGeometry")],yI.prototype,"writeFromGeometry",null),x([D({type:$i,json:{read:!0,write:!0}})],yI.prototype,"toGeometry",void 0),x([D({type:xS.apiValues,json:{write:xS.write}})],yI.prototype,"measureOperation",null),x([D({json:{read:!0}})],yI.prototype,"is3D",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],yI.prototype,"linearUnit",void 0),x([D({type:String,json:{read:jve.read,write:jve.write}})],yI.prototype,"angularUnit",void 0),yI=rNe=x([Qe("esri.rest.support.ImageDistanceParameters")],yI);const Yhr=yI;let nO=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]=JSON.stringify(e.toJSON()))}};x([D({types:Ff,json:{read:Ro,write:!0}})],nO.prototype,"geometry",void 0),x([ur("geometry")],nO.prototype,"writeGeometry",null),x([D({json:{write:!0}})],nO.prototype,"objectIds",void 0),x([Wr(XOt,{ignoreUnknown:!1,name:"spatialRel"})],nO.prototype,"spatialRelationship",void 0),x([D({type:Eg,json:{name:"time",write:!0}})],nO.prototype,"timeExtent",void 0),x([D({type:String,json:{write:!0}})],nO.prototype,"where",void 0),nO=x([Qe("esri.rest.support.ImageGPSInfoParameters")],nO);const Xhr=nO;var nNe;let sO=nNe=class extends gC{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new nNe(li({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({type:$i,json:{read:!0}})],sO.prototype,"fromGeometry",void 0),x([ur("fromGeometry")],sO.prototype,"writeFromGeometry",null),x([D({type:$i,json:{read:!0,write:!0}})],sO.prototype,"toGeometry",void 0),x([D({type:xS.apiValues,json:{write:xS.write}})],sO.prototype,"measureOperation",null),x([D({json:{read:!0}})],sO.prototype,"operationType",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],sO.prototype,"linearUnit",void 0),sO=nNe=x([Qe("esri.rest.support.ImageHeightParameters")],sO);const Jhr=sO;var sNe;let qT=sNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(i){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",i)}clone(){return new sNe(li({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};x([D({types:Ff,json:{read:Ro}})],qT.prototype,"geometry",void 0),x([ur("geometry")],qT.prototype,"writeGeometry",null),x([D({type:Qw,json:{write:!0}})],qT.prototype,"mosaicRule",void 0),x([D({type:kl})],qT.prototype,"renderingRule",null),x([D({type:kl,json:{write:!0,name:"renderingRule"}})],qT.prototype,"rasterFunction",void 0),x([D({type:$i,json:{write:!0}})],qT.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],qT.prototype,"raster",void 0),x([D({type:Eg,json:{read:{source:"time"},write:{target:"time"}}})],qT.prototype,"timeExtent",void 0),qT=sNe=x([Qe("esri.rest.support.ImageHistogramParameters")],qT);const ige=qT;var oNe;let Od=oNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let e=i;e?.mosaicMethod&&(e=Qw.fromJSON({...e.toJSON(),mosaicMethod:e.mosaicMethod,mosaicOperation:e.mosaicOperation})),this._set("mosaicRule",e)}writeMosaicRule(i,e,t){i!=null&&(e[t]=JSON.stringify(i.toJSON()))}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(i){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",i)}get renderingRules(){return ty(di.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(i){ty(di.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",i)}set rasterFunction(i){let e=i;e?.rasterFunction&&(e=kl.fromJSON({...e.toJSON(),rasterFunction:e.rasterFunction,rasterFunctionArguments:e.rasterFunctionArguments})),this._set("rasterFunction",e)}writeRasterFunction(i,e,t){i!=null&&(e[t]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(e[t]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,e,t){i!=null&&(e[t]=JSON.stringify(i.map(r=>r.rasterFunctionDefinition||r.toJSON())))}writePixelSize(i,e,t){i!=null&&(e[t]=JSON.stringify(i))}writeTimeExtent(i,e,t){if(i!=null){const r=i.start!=null?i.start.getTime():null,n=i.end!=null?i.end.getTime():null;e[t]=r!=null?n!=null?`${r},${n}`:`${r}`:null}}clone(){return new oNe(li({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};x([D({json:{write:!0}})],Od.prototype,"geometry",void 0),x([ur("geometry")],Od.prototype,"writeGeometry",null),x([D({type:Qw,json:{write:!0}})],Od.prototype,"mosaicRule",null),x([ur("mosaicRule")],Od.prototype,"writeMosaicRule",null),x([D({type:kl})],Od.prototype,"renderingRule",null),x([D({type:[kl]})],Od.prototype,"renderingRules",null),x([D({type:kl,json:{write:!0,name:"renderingRule"}})],Od.prototype,"rasterFunction",null),x([ur("rasterFunction")],Od.prototype,"writeRasterFunction",null),x([D({type:[kl],json:{write:!0,name:"renderingRules"}})],Od.prototype,"rasterFunctions",void 0),x([ur("rasterFunctions")],Od.prototype,"writeRasterFunctions",null),x([D({type:$i,json:{write:!0}})],Od.prototype,"pixelSize",void 0),x([ur("pixelSize")],Od.prototype,"writePixelSize",null),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnCatalogItems",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnPixelValues",void 0),x([D({type:Number,json:{write:!0}})],Od.prototype,"maxItemCount",void 0),x([D({type:Eg,json:{write:{target:"time"}}})],Od.prototype,"timeExtent",void 0),x([ur("timeExtent")],Od.prototype,"writeTimeExtent",null),x([D({json:{write:!0}})],Od.prototype,"raster",void 0),x([D({json:{write:!0}})],Od.prototype,"viewId",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"processAsMultidimensional",void 0),Od=oNe=x([Qe("esri.rest.support.ImageIdentifyParameters")],Od);const sat=Od;var aNe;let ZG=aNe=class extends Ci{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,e,t){e.geometries={geometryType:"esriGeometryPoint",geometries:i.map(r=>r.toJSON())}}clone(){return new aNe({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};x([D({type:[$i],json:{write:!0}})],ZG.prototype,"geometries",void 0),x([ur("geometries")],ZG.prototype,"writeGeometry",null),x([D({type:ms,json:{write:!0}})],ZG.prototype,"rasterId",void 0),ZG=aNe=x([Qe("esri.rest.support.ImagePixelLocationParameters")],ZG);const Khr=ZG;var lNe;let i$=lNe=class extends gC{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:e}=this;return e.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new lNe(li({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({types:Ff,json:{name:"fromGeometry",read:Ro}})],i$.prototype,"geometry",void 0),x([ur("geometry")],i$.prototype,"writeGeometry",null),x([D({type:xS.apiValues,json:{read:xS.read,write:xS.write}})],i$.prototype,"measureOperation",null),x([D({json:{read:!0}})],i$.prototype,"is3D",void 0),i$=lNe=x([Qe("esri.rest.support.ImagePointParameters")],i$);const Zhr=i$;var uNe;let J0=uNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}set locations(i){if(i?.length){const e=new Oh({spatialReference:i[0].spatialReference});e.points=i.map(t=>[t.x,t.y]),this._set("locations",i),this.geometry=e}}clone(){return new uNe(li({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};x([D({types:Ff,json:{read:Ro}})],J0.prototype,"geometry",void 0),x([ur("geometry")],J0.prototype,"writeGeometry",null),x([D()],J0.prototype,"locations",null),x([D({type:String,json:{type:UP.jsonValues,read:UP.read,write:UP.write}})],J0.prototype,"interpolation",void 0),x([D({type:Qw,json:{write:!0}})],J0.prototype,"mosaicRule",void 0),x([D({type:[String],json:{write:!0}})],J0.prototype,"outFields",void 0),x([D({type:$i,json:{write:!0}})],J0.prototype,"pixelSize",void 0),x([D({type:String,json:{write:!0}})],J0.prototype,"raster",void 0),x([D({type:Boolean,json:{write:!0}})],J0.prototype,"returnFirstValueOnly",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sampleDistance",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sampleCount",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sliceId",void 0),x([D({type:Eg,json:{read:{source:"time"},write:{target:"time"}}})],J0.prototype,"timeExtent",void 0),J0=uNe=x([Qe("esri.rest.support.ImageSampleParameters")],J0);const Qhr=J0;let r$=class extends xs(Ci){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(e,t,r){t.geometries=e?.length?{geometryType:ah(e[0]),geometries:e.map(n=>({...n.toJSON(),spatialReference:void 0}))}:null}};x([D({types:[Ff]})],r$.prototype,"geometries",void 0),x([ur("geometries")],r$.prototype,"writeGeometries",null),x([D({type:[ms],json:{write:!0}})],r$.prototype,"rasterIds",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],r$.prototype,"outSpatialReference",void 0),r$=x([Qe("esri.rest.support.ImageToMapMultirayParameters")],r$);const edr=r$;let oO=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]={...e.toJSON(),spatialReference:void 0})}};x([D({types:Ff,json:{read:Ro,write:!0}})],oO.prototype,"geometry",void 0),x([ur("geometry")],oO.prototype,"writeGeometry",null),x([D({json:{write:!0}})],oO.prototype,"rasterId",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],oO.prototype,"outSpatialReference",void 0),x([D({json:{name:"options.DOff",write:!0}})],oO.prototype,"depthOffset",void 0),x([D({json:{name:"options.Adjust",write:!0}})],oO.prototype,"adjust",void 0),oO=x([Qe("esri.rest.support.ImageToMapParameters")],oO);const tdr=oO;let rge=class extends xs(Ci){constructor(){super(...arguments),this.referenceUri=null}};x([D({type:String,json:{name:"uri",write:!0}})],rge.prototype,"referenceUri",void 0),rge=x([Qe("esri.rest.support.ImageUrlParameters")],rge);const idr=rge;let n$=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]=JSON.stringify(e))}};x([D({types:Ff,json:{read:Ro,write:!0}})],n$.prototype,"geometry",void 0),x([ur("geometry")],n$.prototype,"writeGeometry",null),x([D({json:{write:!0}})],n$.prototype,"rasterId",void 0),x([D({json:{name:"options.VisibleOnly",write:!0}})],n$.prototype,"visibleOnly",void 0),n$=x([Qe("esri.rest.support.MapToImageParameters")],n$);const rdr=n$;var cNe;let QG=cNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]={...i.toJSON(),spatialReference:void 0})}clone(){const i=li({geometry:this.geometry,rasterId:this.rasterId});return new cNe(i)}};x([D({types:Ff,json:{name:"fromGeometry",read:Ro,write:!0}})],QG.prototype,"geometry",void 0),x([ur("geometry")],QG.prototype,"writeGeometry",null),x([D({json:{write:!0}})],QG.prototype,"rasterId",void 0),QG=cNe=x([Qe("esri.rest.support.MeasureFromImageParameters")],QG);const oat=QG,SC=()=>di.getLogger("esri.views.2d.engine.flow.dataUtils"),ndr=10;async function FHe(i,e,t,r){const n=performance.now(),s=sdr(e,t),o=performance.now(),a=adr(e,s,t.width,t.height),l=performance.now(),u=udr(a),c=performance.now(),h=i==="Streamlines"?cdr(u,ndr):hdr(u),p=performance.now();return yi("esri-2d-profiler")&&(SC().info("I.1","_createFlowFieldFromData (ms)",Math.round(o-n)),SC().info("I.2","_getStreamlines (ms)",Math.round(l-o)),SC().info("I.3","createAnimatedLinesData (ms)",Math.round(c-l)),SC().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-c)),SC().info("I.5","createFlowMesh (ms)",Math.round(p-n)),SC().info("I.6","Mesh size (bytes)",h.vertexData.buffer.byteLength+h.indexData.buffer.byteLength)),await Promise.resolve(),hn(r),h}function sdr(i,e){const t=ldr(e.data,e.width,e.height,i.smoothing);return i.interpolate?(r,n)=>{const s=Math.floor(r),o=Math.floor(n);if(s<0||s>=e.width)return[0,0];if(o<0||o>=e.height)return[0,0];const a=r-s,l=n-o,u=s,c=o,h=s{const s=Math.round(r),o=Math.round(n);return s<0||s>=e.width||o<0||o>=e.height?[0,0]:[t[2*(o*e.width+s)],t[2*(o*e.width+s)+1]]}}function odr(i,e,t,r,n,s,o,a,l){const u=[];let c=t,h=r,p=0,[m,v]=e(c,h);m*=i.velocityScale,v*=i.velocityScale;const w=Math.sqrt(m*m+v*v);let S,I;u.push({x:c,y:h,t:p,speed:w});for(let R=0;Ri.maxTurnAngle)return u;if(i.collisions){const Y=Math.round(c*l),K=Math.round(h*l);if(Y<0||Y>o-1||K<0||K>a-1)return u;const Q=s[K*o+Y];if(Q!==-1&&Q!==n)return u;s[K*o+Y]=n}u.push({x:c,y:h,t:p,speed:B}),S=$,I=V}return u}function adr(i,e,t,r){const n=[],s=new VC,o=1/Math.max(i.lineCollisionWidth,1),a=Math.round(t*o),l=Math.round(r*o),u=new Int32Array(a*l);for(let h=0;hh.sort-p.sort);for(const{x:h,y:p}of c)if(s.getFloat()=e)continue;const v=s[m+n];h+=v*i[2*(u*e+(c+m))],p+=v*i[2*(u*e+(c+m))+1]}a[2*(u*e+c)]=h,a[2*(u*e+c)+1]=p}const l=new Float32Array(i.length);for(let u=0;u=t)continue;const v=s[m+n];h+=v*a[2*((c+m)*e+u)],p+=v*a[2*((c+m)*e+u)+1]}l[2*(c*e+u)]=h,l[2*(c*e+u)+1]=p}return l}function udr(i,e){const t=new VC,r=i.reduce((l,u)=>l+u.length,0),n=new Float32Array(4*r),s=new Array(i.length);let o=0,a=0;for(const l of i){const u=o;for(const c of l)n[4*o]=c.x,n[4*o+1]=c.y,n[4*o+2]=c.t,n[4*o+3]=c.speed,o++;s[a++]={startVertex:u,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:t.getFloat()}}return{lineVertices:n,lineDescriptors:s}}function cdr(i,e){const{lineVertices:r,lineDescriptors:n}=i;let s=0,o=0;for(const m of n)s+=2*m.numberOfVertices,o+=6*(m.numberOfVertices-1);const a=new Float32Array(s*9),l=new Uint32Array(o);let u=0,c=0;function h(){l[c++]=u-2,l[c++]=u,l[c++]=u-1,l[c++]=u,l[c++]=u+1,l[c++]=u-1}function p(m,v,w,S,I,R,L,k){const B=u*9;let $=0;a[B+$++]=m,a[B+$++]=v,a[B+$++]=1,a[B+$++]=w,a[B+$++]=R,a[B+$++]=L,a[B+$++]=S/2,a[B+$++]=I/2,a[B+$++]=k,u++,a[B+$++]=m,a[B+$++]=v,a[B+$++]=-1,a[B+$++]=w,a[B+$++]=R,a[B+$++]=L,a[B+$++]=-S/2,a[B+$++]=-I/2,a[B+$++]=k,u++}for(const m of n){const{totalTime:v,timeSeed:w}=m;let S=null,I=null,R=null,L=null,k=null,B=null;for(let $=0;$0){re=V-S,ne=Y-I;const H=Math.sqrt(re*re+ne*ne);if(re/=H,ne/=H,$>1){let Z=re+k,ae=ne+B;const fe=Math.sqrt(Z*Z+ae*ae);Z/=fe,ae/=fe;const be=Math.min(1/(Z*re+ae*ne),e);Z*=be,ae*=be,de=-ae,pe=Z}else de=-ne,pe=re;de!==null&&pe!==null&&(p(S,I,R,de,pe,v,w,Q),h())}S=V,I=Y,R=K,k=re,B=ne,L=Q}p(S,I,R,-B,k,v,w,L)}return{vertexData:a,indexData:l}}function hdr(i){const{lineVertices:n,lineDescriptors:s}=i;let o=0,a=0;for(const H of s){const Z=H.numberOfVertices-1;o+=4*Z*2,a+=6*Z*2}const l=new Float32Array(o*16),u=new Uint32Array(a);let c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y=0,K=0;function Q(){u[K++]=Y-8,u[K++]=Y-7,u[K++]=Y-6,u[K++]=Y-7,u[K++]=Y-5,u[K++]=Y-6,u[K++]=Y-4,u[K++]=Y-3,u[K++]=Y-2,u[K++]=Y-3,u[K++]=Y-1,u[K++]=Y-2}function re(H,Z,ae,fe,be,_e,Ie,Te,Be,Ve,$e,tt,yt,Ct){const ot=Y*16;let vt=0;for(const At of[1,2])for(const Je of[1,2,3,4])l[ot+vt++]=H,l[ot+vt++]=Z,l[ot+vt++]=ae,l[ot+vt++]=fe,l[ot+vt++]=Ie,l[ot+vt++]=Te,l[ot+vt++]=Be,l[ot+vt++]=Ve,l[ot+vt++]=At,l[ot+vt++]=Je,l[ot+vt++]=yt,l[ot+vt++]=Ct,l[ot+vt++]=be/2,l[ot+vt++]=_e/2,l[ot+vt++]=$e/2,l[ot+vt++]=tt/2,Y++}function ne(H,Z){let ae=R+k,fe=L+B;const be=Math.sqrt(ae*ae+fe*fe);ae/=be,fe/=be;const _e=R*ae+L*fe;ae/=_e,fe/=_e;let Ie=k+$,Te=B+V;const Be=Math.sqrt(Ie*Ie+Te*Te);Ie/=Be,Te/=Be;const Ve=k*Ie+B*Te;Ie/=Ve,Te/=Ve,re(c,h,p,m,-fe,ae,v,w,S,I,-Te,Ie,H,Z),Q()}function de(H,Z,ae,fe,be,_e){if(R=k,L=B,k=$,B=V,R==null&&L==null&&(R=k,L=B),v!=null&&w!=null){$=H-v,V=Z-w;const Ie=Math.sqrt($*$+V*V);$/=Ie,V/=Ie}R!=null&&L!=null&&ne(be,_e),c=v,h=w,p=S,m=I,v=H,w=Z,S=ae,I=fe}function pe(H,Z){R=k,L=B,k=$,B=V,R==null&&L==null&&(R=k,L=B),R!=null&&L!=null&&ne(H,Z)}for(const H of s){c=null,h=null,p=null,m=null,v=null,w=null,S=null,I=null,R=null,L=null,k=null,B=null,$=null,V=null;const{totalTime:Z,timeSeed:ae}=H;for(let fe=0;fe=t||(R.data[2*(B*t+L+$)]=k.data[2*(B*k.width+$)],R.data[2*(B*t+L+$)+1]=k.data[2*(B*k.width+$)+1],R.mask[B*t+L+$]=k.mask[B*k.width+$]);L+=k.width}return yi("esri-2d-profiler")&&SC().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),R}async function uat(i,e,t,r,n,s){const o={requestProjectedLocalDirections:!0,signal:s};if(n!=null&&(o.timeExtent=n),i.type==="imagery"){await i.load({signal:s});const u=i.rasterInfo.dataType,c=await i.fetchImage(e,t,r,o);return c?.pixelData?.pixelBlock==null?{data:new Float32Array(t*r*2),mask:new Uint8Array(t*r),width:t,height:r}:aat(u,c.pixelData.pixelBlock)}await i.load({signal:s});const a=i.serviceRasterInfo.dataType,l=await i.fetchPixels(e,t,r,o);return l?.pixelBlock==null?{data:new Float32Array(t*r*2),mask:new Uint8Array(t*r),width:t,height:r}:aat(a,l.pixelBlock)}const ddr=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),pdr=ECt(Gd,{min:0,max:255});function fdr(i){if(!i)return null;const e=JSON.stringify(i).match(/"rasterFunction":"(.*?")/gi),t=e?.map(r=>r.replace('"rasterFunction":"',"").replace('"',""));return t?t.join("/"):null}const mdr=i=>{let e=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new Ap({layer:this}))}readServiceSupportsMosaicRule(r,n){return this._isMosaicRuleSupported(n)}get _rasterFunctionNamesIndex(){const r=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(n=>{r.set(n.name.toLowerCase().replaceAll(/ /gi,"_"),n.name)}),r}readBandIds(r,n){if(Array.isArray(r)&&r.length>0&&r.every(s=>typeof s=="number"))return r}readCapabilities(r,n){return this._readCapabilities(n)}writeCompressionQuality(r,n,s){r!=null&&this.format!=="lerc"&&(n[s]=r)}writeCompressionTolerance(r,n,s){this.format==="lerc"&&r!=null&&(n[s]=r)}readDefaultMosaicRule(r,n){return this._serviceSupportsMosaicRule?Qw.fromJSON(n):null}get fieldsIndex(){return this.fields?new Cd(this.fields):null}set format(r){r&&ddr.has(r.toLowerCase())&&this._set("format",r.toLowerCase())}readFormat(r,n){return n.serviceDataType==="esriImageServiceDataTypeVector-UV"||n.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(r,n){return n.minLOD!=null&&n.maxLOD!=null?r:0}readMaxScale(r,n){return n.minLOD!=null&&n.maxLOD!=null?r:0}set mosaicRule(r){let n=r;n?.mosaicMethod&&(n=Qw.fromJSON({...n.toJSON(),mosaicMethod:n.mosaicMethod,mosaicOperation:n.mosaicOperation})),this._set("mosaicRule",n)}readMosaicRule(r,n){const s=r||n.mosaicRule;return s?Qw.fromJSON(s):this._isMosaicRuleSupported(n)?Qw.fromJSON(n):null}writeMosaicRule(r,n,s){let o=this.mosaicRule;const a=this.definitionExpression;o?a&&a!==o.where&&(o=o.clone(),o.where=a):a&&(o=new Qw({where:a})),this._isValidCustomizedMosaicRule(o)&&(n[s]=o.toJSON())}writeNoData(r,n,s){r!=null&&typeof r=="number"&&(n[s]=pdr(r))}readObjectIdField(r,n){return r||(r=n.fields.find(o=>o.type==="esriFieldTypeOID"||o.type==="oid")?.name),r}get parsedUrl(){return Yo(this.url)}readSourceType(r,n){return this._isMosaicDataset(n)?"mosaic-dataset":"raster-dataset"}set renderer(r){this.loaded&&(r=this._configRenderer(r)),this._set("renderer",r)}readRenderer(r,n,s){const o=n?.layerDefinition?.drawingInfo?.renderer,a=vRt(o,s);return a==null?null:(a.type==="vector-field"&&n.symbolTileSize&&!o.symbolTileSize&&(a.symbolTileSize=n.symbolTileSize),bRt(a)||di.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),a)}writeRenderer(r,n,s){n.layerDefinition=n.layerDefinition||{},n.layerDefinition.drawingInfo=n.layerDefinition.drawingInfo||{},n.layerDefinition.drawingInfo.renderer=r.toJSON(),r.type==="vector-field"&&(n.symbolTileSize=r.symbolTileSize)}get rasterFields(){const r=this._rasterAttributeTableFieldPrefix,n=new Fo({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new Fo({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),o=new Fo({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let a=this.fields?li(this.fields):[];a.push(s),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&a.push(n),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(u=>u.name.toLowerCase()==="none")&&a.push(o),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(u=>u.name.toLowerCase()!=="none").forEach(u=>{a.push(new Fo({name:"Raster.ServicePixelValue."+u.name,alias:u.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(a.push(new Fo({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),a.push(new Fo({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:l}=this.rasterInfo??{};if(l!=null){const u=l.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const h=li(c);return h.name=r+c.name,h});a=a.concat(u)}return a}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(r){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",r)}set rasterFunction(r){let n=r;n?.rasterFunction&&(n=kl.fromJSON({...n.toJSON(),rasterFunction:n.rasterFunction,rasterFunctionArguments:n.rasterFunctionArguments})),this._set("rasterFunction",n)}readRasterFunction(r,n){const s=n.rasterFunctionInfos;return n.renderingRule||s?.length&&s[0].name!=="None"?this._isRFTJson(n.renderingRule)?kl.fromJSON({rasterFunctionDefinition:n.renderingRule}):kl.fromJSON(n.renderingRule||{rasterFunctionInfos:n.rasterFunctionInfos}):null}readSpatialReference(r,n){const s=r||n.extent.spatialReference;return s?Xi.fromJSON(s):null}readPixelType(r){return zV.fromJSON(r)||r}writePixelType(r,n,s){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(n[s]=zV.toJSON(r))}readVersion(r,n){let s=n.currentVersion;return s||(s=n.hasOwnProperty("fields")||n.hasOwnProperty("timeInfo")?10:9.3),s}applyFilter(r){let n=r;return this.pixelFilter&&(n=this._clonePixelData(r),this.pixelFilter(n)),n}async applyRenderer(r,n){let s=r;const{renderer:o,symbolizer:a,pixelFilter:l,bandIds:u}=this;if(!this._isPicture()&&o&&a&&!l){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(o.toJSON()),h=this._rasterJobHandler.instance;if(h){c&&(a.bind(),await h.updateSymbolizer(a,n),this._cachedRendererJson=o.toJSON());const p=await h.symbolize({bandIds:u,...r},n);s={extent:r.extent,pixelBlock:p}}else s={extent:r.extent,pixelBlock:a.symbolize({bandIds:u,...r})}}return s}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeAngles)throw new qe("imagery-layer:compute-angles","this operation is not supported on the input image service");return r=Cu(Hhr,r).clone(),ehr(this.url,r,this._getRequestOptions(n))}async computePixelSpaceLocations(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputePixelLocation)throw new qe("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return r=Cu(Khr,r).clone(),thr(this.url,r,this._getRequestOptions(n))}async computeHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeHistograms)throw new qe("imagery-layer:compute-histograms","this operation is not supported on the input image service");return r=Cu(ige,r).clone(),this._applyMosaicAndRenderingRules(r),rhr(this.url,r,this._getRequestOptions(n))}async computeStatisticsHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeStatisticsHistograms)throw new qe("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return r=Cu(ige,r).clone(),this._applyMosaicAndRenderingRules(r),ihr(this.url,r,this._getRequestOptions(n))}async measureHeight(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(r.operationType==="base-and-top"?s.mensuration.supportsHeightFromBaseAndTop:r.operationType==="base-and-top-shadow"?s.mensuration.supportsHeightFromBaseAndTopShadow:s.mensuration.supportsHeightFromTopAndTopShadow))throw new qe("imagery-layer:measure-height","this operation is not supported on the input image service");return r=Cu(Jhr,r).clone(),this._applyMosaicAndRenderingRules(r),shr(this.url,r,this._getRequestOptions(n))}async measureAreaAndPerimeter(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsAreaAndPerimeter&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return r=Cu(Whr,r).clone(),this._applyMosaicAndRenderingRules(r),ohr(this.url,r,this._getRequestOptions(n))}async measureDistanceAndAngle(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsDistanceAndAngle&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return r=Cu(Yhr,r).clone(),this._applyMosaicAndRenderingRules(r),lhr(this.url,r,this._getRequestOptions(n))}async measurePointOrCentroid(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsPointOrCentroid&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return r=Cu(Zhr,r).clone(),this._applyMosaicAndRenderingRules(r),ahr(this.url,r,this._getRequestOptions(n))}async measureLengthFromImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMeasureFromImage)throw new qe("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(r.geometry.type!=="polyline")throw new qe("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return r=Cu(oat,r).clone(),uhr(this.url,r,this._getRequestOptions(n))}async measureAreaFromImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMeasureFromImage)throw new qe("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(r.geometry.type!=="polygon")throw new qe("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return r=Cu(oat,r).clone(),chr(this.url,r,this._getRequestOptions(n))}getField(r){const{fieldsIndex:n}=this;return n?.get(r)}getFieldDomain(r,n){const s=this.getField(r);return s?s.domain:null}async fetchImage(r,n,s,o={}){if(r==null||n==null||s==null)throw new qe("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const h=await this._generateRasterInfo(this.rasterFunction,{signal:o.signal});h&&(this.rasterInfo=h)}const a=this.getExportImageServiceParameters(r,n,s,o.timeExtent);if(a==null){if(o.requestAsImageElement&&this._canRequestImageElement(this.format)){const I=document.createElement("canvas");return I.width=n,I.height=s,o.returnImageBitmap?{imageBitmap:await E1e(I,`${t(this.parsedUrl)}/exportImage`,o.signal)}:{imageOrCanvasElement:I}}const{bandIds:h,rasterInfo:p}=this,m=(h?.length||p.bandCount)??0,v=n*s,w=p.pixelType,S=[];for(let I=0;I=10.3?r?.rasterFunction:null})}).then(n=>n.data)}fetchRasterAttributeTable(r){return this.version<10.1?Promise.reject(new qe("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):zi(t(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?r?.rasterFunction:null})}).then(n=>du.fromJSON(n.data))}getCatalogItemRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return zhr(t(this.parsedUrl),r,s)}async getCatalogItemICSInfo(r,n){const{data:s}=await zi(t(this.parsedUrl)+"/"+r+"/info/ics",{query:this._getQueryParams(),...n}),o=s?.ics;if(!o)return;let a=null;try{a=(await zi(t(this.parsedUrl)+"/"+r+"/info",{query:this._getQueryParams(),...n})).data.extent}catch{}if(!a||!a.spatialReference)return{ics:o,icsToPixelTransform:null,icsExtent:null,northDirection:null};const l=this.version>=10.7?zi(t(this.parsedUrl)+"/"+r+"/info/icstopixel",{query:this._getQueryParams(),...n}).then(Z=>Z.data).catch(()=>({})):{},u=a.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[a]}),inSR:Hv(u),outSR:"0:"+r},h=zi(t(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...n}).then(Z=>Z.data).catch(()=>({})),p=5,m=(a.xmin+a.xmax)/2,v=(a.ymax-a.ymin)/(p+1),w=a.ymin+v,S=[];for(let Z=0;ZZ.data).catch(()=>({})),L=await Promise.all([l,h,R]);let k=L[0].ipxf;if(k==null){const Z=o.geodataXform?.xf_0;Z?.name?.toLowerCase()==="topup"&&Z?.coefficients?.length===6&&(k={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:Z.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const B=hr.fromJSON(L[1]?.geometries?.[0]);B&&(B.spatialReference=new Xi({wkid:0,imageCoordinateSystem:o}));const $=L[2].geometries?L[2].geometries.filter(Z=>Z?.x!=null&&Z.y!=null&&Z.x!=="NaN"&&Z.y!=="NaN"):[],V=$.length;if(V<3)return{ics:o,icsToPixelTransform:k,icsExtent:B,northDirection:null};let Y=0,K=0,Q=0,re=0;for(let Z=0;Z$[0].x,H=$[p-1].y>$[0].y;return ne===1/0?de=H?90:270:ne===0?de=pe?0:180:ne>0?de=pe?180*Math.atan(ne)/Math.PI:180*Math.atan(ne)/Math.PI+180:ne<0&&(de=H?180+180*Math.atan(ne)/Math.PI:360+180*Math.atan(ne)/Math.PI),{ics:o,icsToPixelTransform:k,icsExtent:B,northDirection:de}}async generateRasterInfo(r,n){if(r=Cu(kl,r),this.serviceRasterInfo&&(!r||r.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(r)))return this.serviceRasterInfo;const s=fdr(r);if(!s)throw new qe("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const o={...n,query:this._getQueryParams()},a=Uhr(t(this.parsedUrl),r,o);this._functionRasterInfos[s]=a;try{return await a}catch(l){throw this._functionRasterInfos[s]=null,l}}getExportImageServiceParameters(r,n,s,o){r=r.clone().shiftCentralMeridian();const a=BY(r.spatialReference,t(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const l=this.exportImageServiceParameters.toJSON(),{bandIds:u,noData:c}=l;let{renderingRule:h}=l;const p=this.rasterFunction?.rasterFunctionDefinition,m=!this.renderer||this.renderer.type==="raster-stretch";if(u?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&m){const S={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:u}};if(h.rasterFunction==="Stretch")S.rasterFunctionArguments.Raster=h.rasterFunctionArguments.Raster,h.rasterFunctionArguments.Raster=S;else if(h.rasterFunction==="Colormap"){const I=h.rasterFunctionArguments.Raster;I?.rasterFunction==="Stretch"?(S.rasterFunctionArguments.Raster=I.rasterFunctionArguments.Raster,I.rasterFunctionArguments.Raster=S):(S.rasterFunctionArguments.Raster=I,h.rasterFunctionArguments.Raster=S)}else S.rasterFunctionArguments.Raster=h,h=S;l.bandIds=void 0}else l.bandIds=u?.join(",");c instanceof Array&&c.length>0&&(l.noData=c.join(","));const v=this._processMultidimensionalIntersection(null,o,this.exportImageServiceParameters.mosaicRule);if(v.isOutSide)return null;l.mosaicRule=v.mosaicRule!=null?JSON.stringify(v.mosaicRule):null,o=v.timeExtent,l.renderingRule=this._getRenderingRuleString(kl.fromJSON(h));const w={};if(o!=null){const{start:S,end:I}=o.toJSON();S&&I&&S===I?w.time=""+S:S==null&&I==null||(w.time=`${S??"null"},${I??"null"}`)}return{bbox:r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:a,imageSR:a,size:n+","+s,...l,...w}}async getSamples(r,n){if(!(await this._fetchCapabilities(n?.signal))?.operations.supportsGetSamples)throw new qe("imagery-layer:get-samples","getSamples operation is not supported on the input image service");r=Cu(Qhr,r).clone();const{raster:o}=this;return o&&r.raster==null&&(r.raster=o),nhr(this.url,r,this._getRequestOptions(n))}async identify(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsIdentify)throw new qe("imagery-layer:identify","identify operation is not supported on the input image service");r=Cu(sat,r).clone(),this.version<10.91&&r.geometry?.type==="extent"&&(r.geometry=$s.fromExtent(r.geometry));const s=this._processMultidimensionalIntersection(r.geometry,r.timeExtent,r.mosaicRule||this.mosaicRule);if(s.isOutSide)throw new qe("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");r.timeExtent=s.timeExtent,r.mosaicRule=s.mosaicRule;const{raster:o,rasterFunction:a}=this;return a&&r.rasterFunction==null&&(r.rasterFunction=a),o&&r.raster==null&&(r.raster=o),Jot(this.url,r,this._getRequestOptions(n))}async imageToMap(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsImageToMap)throw new qe("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return r=Cu(tdr,r),phr(t(this.parsedUrl),r,this._getRequestOptions(n))}async imageToMapMultiray(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsImageToMapMultiray)throw new qe("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return r=Cu(edr,r),fhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async mapToImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMapToImage)throw new qe("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return r=Cu(rdr,r),mhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async findImages(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsFindImages)throw new qe("imagery-layer:find-images","findImages operation is not supported on the input image service");return r=Cu(Vhr,r),yhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async getImageUrl(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsGetImageUrl)throw new qe("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return r=Cu(idr,r),ghr(t(this.parsedUrl),r,this._getRequestOptions(n))}createQuery(){const r=new Kn;return r.outFields=["*"],r.returnGeometry=!0,r.where=this.definitionExpression||"1=1",r}async queryBoundary(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQueryBoundary)throw new qe("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return r=Cu(qhr,r??{outSpatialReference:this.spatialReference}).clone(),hhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async queryRasters(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),t9(this.url,r,n)}async queryObjectIds(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),uSe(this.url,r,n)}async queryGPSInfo(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQueryGPSInfo)throw new qe("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return r=Cu(Xhr,r??{outSpatialReference:this.spatialReference}).clone(),dhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async queryRasterCount(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),DHe(this.url,r,n)}async queryVisibleRasters(r,n){if(!r)throw new qe("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:s,returnDomainValues:o,returnTopmostRaster:a,showNoDataRecords:l}=n||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let u=!1,c=null,h=null;const p="raster.servicepixelvalue",m=this._rasterFunctionNamesIndex;if(r.outFields!=null&&(u=r.outFields.some(B=>!B.toLowerCase().includes(p)),this.version>=10.4)){const B=r.outFields.filter(V=>V.toLowerCase().includes(p)&&V.length>p.length).map(V=>{const Y=V.slice(p.length+1);return[this._updateRenderingRulesFunctionName(Y,m),Y]});c=B.map(V=>new kl({functionName:V[0]})),h=B.map(V=>V[1]);const{rasterFunction:$}=this;c.length===0?$?.functionName?(c.push($),h.push($.functionName)):c=null:$?.functionName&&!c.some(V=>V.functionName===$.functionName)&&(c.push($),h.push($.functionName))}const v=r.outSpatialReference==null||r.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:w}=this;let S=r.timeExtent||this.timeExtent;if(w){const{isOutside:B,intersection:$}=K3e(w,{geometry:r.geometry,timeExtent:r.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(B)throw new qe("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");$?.timeExtent!=null&&(S=$.timeExtent)}const I=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,S);let R=r.geometry;this.version<10.91&&R?.type==="extent"&&(R=$s.fromExtent(R));const L=this._getQueryParams({geometry:R,timeExtent:S,mosaicRule:I,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:s,returnCatalogItems:u,returnGeometry:v,raster:this.raster,maxItemCount:a?1:null});delete L.f;const k=new sat(L);try{await this._generateRasterInfo(this.rasterFunction);const B=await Jot(this.url,k,{signal:n?.signal,query:{...this.customParameters}}),$=r.outFields,V=B.value!=null&&B.value.toLowerCase().includes("nodata");if(!(u&&!v&&B?.catalogItems?.features.length&&(l||!V)))return this._processVisibleRastersResponse(B,{returnDomainValues:o,templateRRFunctionNames:h,showNoDataRecords:l,templateFields:$});const Y=this.objectIdField||"ObjectId",K=B.catalogItems?.features??[],Q=K.map(de=>de.attributes?.[Y]),re=new Kn({objectIds:Q,returnGeometry:!0,outSpatialReference:r.outSpatialReference,outFields:[Y]}),ne=await this.queryRasters(re);return ne?.features?.length&&ne.features.forEach(de=>{K.forEach(pe=>{pe.attributes[Y]===de.attributes[Y]&&(pe.geometry=new $s(de.geometry),r.outSpatialReference!=null&&(pe.geometry.spatialReference=r.outSpatialReference))})}),this._processVisibleRastersResponse(B,{returnDomainValues:o,templateRRFunctionNames:h,showNoDataRecords:l,templateFields:$})}catch{throw new qe("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(r,n){const s=zi(t(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.statistics),o=zi(t(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.histograms),a=await Promise.all([s,o]);return a[0]&&a[0].forEach(l=>{l.avg=l.mean,l.stddev=l.standardDeviation}),{statistics:a[0]||null,histograms:a[1]||null}}async createFlowMesh(r,n){const s=this._rasterJobHandler.instance;return s?s.createFlowMesh(r,n):FHe(r.meshType,r.simulationSettings,r.flowData,n.signal!=null?n.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(r){const n=r??this.serviceRasterInfo.multidimensionalInfo;return PRt(this.multidimensionalSubset,n)}async _fetchService(r){await this._fetchServiceInfo(r),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const n=this.sourceJSON,s=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):fDt(t(this.parsedUrl),n,{signal:r,query:this._getQueryParams()}).then(l=>(this._set("serviceRasterInfo",l),this._set("multidimensionalInfo",l.multidimensionalInfo),mDt(l,n),l)),o=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:r}):null,a=this._getRasterFunctionInfos();return Promise.all([s,o,a]).then(l=>{l[1]?this._set("rasterInfo",l[1]):this._set("rasterInfo",l[0]),l[2]&&this._set("rasterFunctionInfos",l[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),di.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([Ki(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(h=>{h&&(this.rasterInfo=h)})})]);const{serviceRasterInfo:u}=this;u.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(u)})}_combineMosaicRuleWithTimeExtent(r,n){const s=this.timeInfo,{multidimensionalInfo:o}=this.serviceRasterInfo;if(r==null||o==null||n==null||s?.startField==null)return r;const{startField:a}=s,l=o.variables.some(w=>w.dimensions.some(S=>S.name===a))?a:"StdTime";if(r=r.clone(),this.sourceType==="mosaic-dataset")return r.multidimensionalDefinition=r.multidimensionalDefinition?.filter(w=>w.dimensionName!==l),this._cleanupMultidimensionalDefinition(r);r.multidimensionalDefinition=r.multidimensionalDefinition||[];const u=r.multidimensionalDefinition.filter(w=>w.dimensionName===l),c=n.start!=null?n.start.getTime():null,h=n.end!=null?n.end.getTime():null,p=c==null||h==null||c===h,m=p?[c||h]:[[c,h]],v=this.version>=10.8;if(u.length)u.forEach(w=>{w.dimensionName===l&&(v?(w.dimensionName=null,w.isSlice=!1,w.values=[]):(w.isSlice=p,w.values=m))});else if(!v){const w=r.multidimensionalDefinition.filter(S=>S.variableName!=null&&S.dimensionName==null);w.length?w.forEach(S=>{S.dimensionName=l,S.isSlice=p,S.values=m}):r.multidimensionalDefinition.push(new gR({variableName:"",dimensionName:l,isSlice:p,values:m}))}return this._cleanupMultidimensionalDefinition(r)}_cleanupMultidimensionalDefinition(r){return r==null?null:(r.multidimensionalDefinition&&(r.multidimensionalDefinition=r.multidimensionalDefinition.filter(n=>!(!n.variableName&&!n.dimensionName)),r.multidimensionalDefinition.length===0&&(r.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&r.multidimensionalDefinition==null?null:r)}async _prepareForQuery(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQuery)throw new qe("imagery-layer:query-rasters","query operation is not supported on the input image service");return r=r!=null?Cu(Kn,r):this.createQuery(),n=this._getRequestOptions(n),this.raster&&(n.query={...n.query,raster:this.raster}),{query:r,requestOptions:n}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const r=new CRt;this._rasterJobHandler.connectionPromise=r.initialize().then(()=>{this._rasterJobHandler.instance=r},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(r){const{rasterInfo:n,rasterFunction:s}=this;return r.type==="unique-value"&&this._hasRasterFunction(s)&&n?.bandCount===1&&["u8","s8"].includes(n.pixelType)||n!=null&&r!=null&&gcr(n).includes(r.type)}async _fetchCapabilities(r){return this.capabilities||await this._fetchServiceInfo(r),this.capabilities}async _fetchServiceInfo(r){let n=this.sourceJSON;if(!n){const{data:s,ssl:o}=await zi(t(this.parsedUrl),{query:this._getQueryParams(),signal:r});n=s,this.sourceJSON=n,o&&(this.url=this.url.replace(/^http:/i,"https:"))}if(n.capabilities?.toLowerCase().split(",").map(s=>s.trim()).indexOf("tilesonly")>-1)throw new qe("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(n,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(r){return r.serviceSourceType?r.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":r.fields?.length>0}_isMosaicRuleSupported(r){if(!r)return!1;const n=this._isMosaicDataset(r),s=r.currentVersion>=10.71&&r.hasMultidimensions&&!(r.fields?.length>1);return n||s}_isVectorFieldResampleFunction(r){if(r==null)return!1;const{functionName:n,functionArguments:s}=r,o=n?.toLowerCase()==="resample",a=s?.ResampleType||s?.resampleType;return o&&(a===7||a===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(r){const n=this._isPicture(),{rasterInfo:s}=this;if(!n&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&s.bandCount>=3){const a=THe(s);!a||s.bandCount===3&&a[0]===0&&a[1]===1&&a[2]===2||(this.bandIds=a)}r||(r=XLe(s,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const o=KLe(r.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=s):this.symbolizer=new AHe({rendererJSON:o,rasterInfo:s}),this.symbolizer.bind().success||(this.symbolizer=null)}return r}_clonePixelData(r){return r==null?r:{extent:r.extent&&r.extent.clone(),pixelBlock:r.pixelBlock!=null?r.pixelBlock.clone():null}}_getQueryParams(r){r?.renderingRule!=null&&typeof r.renderingRule!="string"&&(r.renderingRule=this._getRenderingRuleString(r.renderingRule));const{raster:n,viewId:s}=this;return{raster:n,viewId:s,f:"json",...r,...this.customParameters}}_getRequestOptions(r){return{...r,query:{...r?.query,...this.customParameters}}}_decodePixelBlock(r,n,s){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:r,options:n}):A1e(r,n,s)}async _getRasterFunctionInfos(r){const n=this.sourceJSON.rasterFunctionInfos;return this.loaded?n:n&&this.version>=10.3?n.length===1&&n[0].name.toLowerCase()==="none"?n:(await zi(t(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:r})).data?.rasterFunctionInfos:null}_canRequestImageElement(r){return!this.pixelFilter&&(!r||r.includes("png"))}async _requestArrayBuffer(r){const{imageProps:n,requestAsImageElement:s,returnImageBitmap:o,signal:a}=r;if(s&&this._canRequestImageElement(n.format)){const w=`${t(this.parsedUrl)}/exportImage`,{data:S}=await zi(w,{responseType:o?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...r.imageServiceParameters}),signal:a});return S instanceof Blob?{imageBitmap:await E1e(S,w,a),params:n}:{imageOrCanvasElement:S,params:n}}const l=this._initJobHandler(),u=zi(t(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...r.imageServiceParameters}),signal:a}),c=(await Promise.all([u,l]))[0].data,h=n.format||"jpgpng";let p=h;if(p!=="bsq"&&p!=="bip"&&(p=YRt(c)),!p)throw new qe("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const m={signal:a};return{pixelData:{pixelBlock:await(h==="gif"||h==="bmp"||h.includes("png")&&(p==="png"||p==="jpg")?A1e(c,{useCanvas:!0,...n},m):this._decodePixelBlock(c,{width:n.width,height:n.height,planes:null,pixelType:null,noDataValue:null,format:h},m)),extent:n.extent},params:n}}_generateRasterInfo(r,n){return this.generateRasterInfo(r,n).catch(()=>null)}_isValidCustomizedMosaicRule(r){return r&&JSON.stringify(r.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(r){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let n=ULe(r,{multidimensionalSubset:this.multidimensionalSubset});if(n!=null&&n.length>0){this.mosaicRule=this.mosaicRule||new Qw;const s=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&n.forEach(o=>o.variableName=""),n=n.filter(({variableName:o,dimensionName:a})=>o&&o!=="*"||a),!s?.length&&n.length&&(this.mosaicRule.multidimensionalDefinition=n)}}_processVisibleRastersResponse(r,n){n=n||{};const s=r.value,{templateRRFunctionNames:o,showNoDataRecords:a,returnDomainValues:l,templateFields:u}=n,c=r.processedValues;let h=r.catalogItems?.features,p=r.properties?.Values?.map(L=>L.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",v=typeof s=="string"&&s.toLowerCase().includes("nodata"),w=[];if(s&&!h&&!v){const L={};L[m]=0,p=[s],h=[new Us(this.fullExtent,null,L)]}if(!h)return[];let S,I,R;this._updateResponseFieldNames(h,u),v&&!a&&(h=[]);for(let L=0;L0&&o&&o.length>0&&o.includes(this.rasterFunction.functionName)?c[o.indexOf(this.rasterFunction.functionName)]:s,I.toLowerCase()==="nodata"&&!a)continue;const k="Raster.ItemPixelValue",B="Raster.ServicePixelValue";S.attributes[k]=I,S.attributes[B]=R,this._updateFeatureWithMagDirValues(S,I);const $=this.fields&&this.fields.length>0;let V=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?$?I:s:R;this.rasterFunction||(V=$?I:s),this._updateFeatureWithRasterAttributeTableValues(S,V)}if(S.sourceLayer=S.layer=this,l&&this._updateFeatureWithDomainValues(S),o&&c&&o.length===c.length)for(let k=0;kc.name).find(c=>c.toLowerCase()==="value");if(!l)return;const u=o.filter(c=>c.attributes[l]===(n!=null?parseInt(n,10):null));u&&u[0]&&a.forEach(c=>{const h=this._rasterAttributeTableFieldPrefix+c.name;r.attributes[h]=u[0].attributes[c.name]})}_updateFeatureWithMagDirValues(r,n){if(!this._isVectorDataSet())return;const s=n.split(/,\s*/).map(c=>parseFloat(c)),o=s.map(c=>[c]),a=s.map(c=>({minValue:c,maxValue:c,noDataValue:null})),l=new Br({height:1,width:1,pixelType:"f32",pixels:o,statistics:a});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:l,extent:new hr(0,0,0,0,this.spatialReference)});const u=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[l.pixels[0][0],l.pixels[1][0]]:eSe([l.pixels[0][0],l.pixels[1][0]]);r.attributes["Raster.Magnitude"]=u[0],r.attributes["Raster.Direction"]=u[1]}_updateFeatureWithDomainValues(r){const n=this.fields&&this.fields.filter(s=>s.domain&&s.domain.type==="coded-value");n?.forEach(s=>{const o=r.attributes[s.name];if(o!=null){const a=s.domain.codedValues.find(l=>l.code===o);a&&(r.attributes[s.name]=a.name)}})}_updateResponseFieldNames(r,n){if(!n||n.length<1)return;const s=this.fieldsIndex;s!=null&&r.forEach(o=>{if(o?.attributes)for(const a of n){const l=s.get(a)?.name;l&&l!==a&&(o.attributes[a]=o.attributes[l],delete o.attributes[l])}})}_getRenderingRuleString(r){if(r){let n=r.toJSON();return n=n.rasterFunctionDefinition??n,(n.thumbnail||n.thumbnailEx)&&(n.thumbnail=n.thumbnailEx=null),JSON.stringify(n)}return null}_hasRasterFunction(r){return r?.functionName!=null&&r.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(r,n){if(!r||r.length<1)return;if(r==="Raw")return r.replace("Raw","None");const s=r.toLowerCase().replaceAll(/ /gi,"_");return n.has(s)?n.get(s):r}_isRFTJson(r){return r?.name&&r.arguments&&r.function&&r.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(r){const{raster:n,mosaicRule:s,rasterFunction:o}=this;o&&r instanceof ige&&r.rasterFunction==null&&(r.rasterFunction=o),s&&r.mosaicRule==null&&(r.mosaicRule=s),n&&r.raster==null&&(r.raster=n)}_readCapabilities(r){const n=r.capabilities?r.capabilities.toLowerCase().split(",").map(I=>I.trim()):["image","catalog"],{currentVersion:s,advancedQueryCapabilities:o,maxRecordCount:a}=r,l=n.includes("image"),u=r.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!r.spatialReference&&!r.extent?.spatialReference),h=n.includes("edit"),p=n.includes("mensuration")&&c,m=r.mensurationCapabilities==null?[]:r.mensurationCapabilities.toLowerCase().split(",").map(I=>I.trim()),v=p&&m.includes("basic"),w=this._isMosaicDataset(r)&&n.includes("catalog"),S=n.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:l,supportsExportImage:l,supportsIdentify:l,supportsImageToMap:s>=11.2&&w,supportsImageToMapMultiray:s>=11.2&&w,supportsMapToImage:s>=11.2&&w,supportsFindImages:s>=11.2&&w,supportsGetImageUrl:s>=11.2&&S,supportsMeasure:p,supportsMeasureFromImage:s>=11.2,supportsDownload:S,supportsQuery:w&&r.fields&&r.fields.length>0,supportsGetSamples:s>=10.2&&l,supportsProject:s>=10.3&&l,supportsComputeStatisticsHistograms:s>=10.4&&l,supportsQueryBoundary:s>=10.6&&l,supportsCalculateVolume:s>=10.7&&u,supportsComputePixelLocation:s>=10.7&&w,supportsComputeAngles:s>=10.91,supportsQueryGPSInfo:s>=11.2&&w,supportsAdd:h,supportsDelete:h,supportsEditing:h,supportsUpdate:h,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:a,maxRecordCountFactor:void 0,supportsStatistics:!!o?.supportsStatistics,supportsOrderBy:!!o?.supportsOrderBy,supportsDistinct:!!o?.supportsDistinct,supportsPagination:!!o?.supportsPagination,supportsStandardizedQueriesOnly:!!o?.useStandardizedQueries,supportsPercentileStatistics:!!o?.supportsPercentileStatistics,supportsCentroid:!!o?.supportsReturningGeometryCentroid,supportsDistance:!!o?.supportsQueryWithDistance,supportsExtent:!!o?.supportsReturningQueryExtent,supportsGeometryProperties:!!o?.supportsReturningGeometryProperties,supportsHavingClause:!!o?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!o?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:v,supportsAreaAndPerimeter:v,supportsPointOrCentroid:v,supportsHeightFromBaseAndTop:p&&m.includes("base-top height"),supportsHeightFromBaseAndTopShadow:p&&m.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:p&&m.includes("top-top shadow height"),supports3D:p&&m.includes("3d")}}}};function t(r){return r?.path??""}return x([D({clonable:!1})],e.prototype,"_functionRasterInfos",void 0),x([D({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),x([D({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),x([D({readOnly:!0})],e.prototype,"_serviceSupportsMosaicRule",void 0),x([Mi("_serviceSupportsMosaicRule",["currentVersion","fields"])],e.prototype,"readServiceSupportsMosaicRule",null),x([D({readOnly:!0})],e.prototype,"_rasterAttributeTableFieldPrefix",void 0),x([D({readOnly:!0})],e.prototype,"_rasterFunctionNamesIndex",null),x([D()],e.prototype,"adjustAspectRatio",void 0),x([D({type:[ms],json:{write:!0}})],e.prototype,"bandIds",void 0),x([Mi("bandIds")],e.prototype,"readBandIds",null),x([D({readOnly:!0,json:{read:!1}})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities","currentVersion","serviceDataType"])],e.prototype,"readCapabilities",null),x([D({type:Number})],e.prototype,"compressionQuality",void 0),x([ur("compressionQuality")],e.prototype,"writeCompressionQuality",null),x([D({type:Number})],e.prototype,"compressionTolerance",void 0),x([ur("compressionTolerance")],e.prototype,"writeCompressionTolerance",null),x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],e.prototype,"defaultMosaicRule",void 0),x([Mi("defaultMosaicRule",["defaultMosaicMethod"])],e.prototype,"readDefaultMosaicRule",null),x([D({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),x([D({readOnly:!0,constructOnly:!0})],e.prototype,"exportImageServiceParameters",void 0),x([D()],e.prototype,"rasterInfo",void 0),x([D({readOnly:!0,type:[Fo]})],e.prototype,"fields",void 0),x([D({readOnly:!0})],e.prototype,"fieldsIndex",null),x([D({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],e.prototype,"format",null),x([Mi("service","format",["serviceDataType"])],e.prototype,"readFormat",null),x([D({type:hr})],e.prototype,"fullExtent",void 0),x([D({readOnly:!0})],e.prototype,"hasMultidimensions",void 0),x([D({json:{read:{source:"maxImageHeight"}}})],e.prototype,"imageMaxHeight",void 0),x([D({json:{read:{source:"maxImageWidth"}}})],e.prototype,"imageMaxWidth",void 0),x([D({type:String,json:{type:UP.jsonValues,read:UP.read,write:UP.write}})],e.prototype,"interpolation",void 0),x([D()],e.prototype,"minScale",void 0),x([Mi("service","minScale")],e.prototype,"readMinScale",null),x([D()],e.prototype,"maxScale",void 0),x([Mi("service","maxScale")],e.prototype,"readMaxScale",null),x([D({type:Qw})],e.prototype,"mosaicRule",null),x([Mi("mosaicRule",["mosaicRule","defaultMosaicMethod"])],e.prototype,"readMosaicRule",null),x([ur("mosaicRule")],e.prototype,"writeMosaicRule",null),x([D()],e.prototype,"multidimensionalInfo",void 0),x([D({type:TRt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),x([D({json:{type:ms}})],e.prototype,"noData",void 0),x([ur("noData")],e.prototype,"writeNoData",null),x([D({type:String,json:{type:Gie.jsonValues,read:Gie.read,write:Gie.write}})],e.prototype,"noDataInterpretation",void 0),x([D({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],e.prototype,"objectIdField",void 0),x([Mi("objectIdField")],e.prototype,"readObjectIdField",null),x([D({readOnly:!0})],e.prototype,"geometryType",void 0),x([D({})],e.prototype,"typeIdField",void 0),x([D({})],e.prototype,"types",void 0),x([D({readOnly:!0})],e.prototype,"parsedUrl",null),x([D({type:Function})],e.prototype,"pixelFilter",void 0),x([D()],e.prototype,"raster",void 0),x([D({readOnly:!0})],e.prototype,"sourceType",void 0),x([Mi("sourceType",["serviceSourceType","fields"])],e.prototype,"readSourceType",null),x([D()],e.prototype,"viewId",void 0),x([D({types:S1e,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:T1e,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:r=>({enabled:r&&r.type!=="vector-field"&&r.type!=="flow"})}}}}})],e.prototype,"renderer",null),x([Mi("renderer")],e.prototype,"readRenderer",null),x([ur("renderer")],e.prototype,"writeRenderer",null),x([D({clonable:!1})],e.prototype,"symbolizer",void 0),x([D(aB)],e.prototype,"opacity",void 0),x([D({readOnly:!0})],e.prototype,"rasterFields",null),x([D({constructOnly:!0})],e.prototype,"rasterFunctionInfos",void 0),x([D({type:kl})],e.prototype,"renderingRule",null),x([D({type:kl,json:{name:"renderingRule"}})],e.prototype,"rasterFunction",null),x([Mi("rasterFunction",["renderingRule","rasterFunctionInfos"])],e.prototype,"readRasterFunction",null),x([D({readOnly:!0})],e.prototype,"serviceDataType",void 0),x([D({readOnly:!0,type:Xi})],e.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","extent"])],e.prototype,"readSpatialReference",null),x([D({json:{type:zV.jsonValues}})],e.prototype,"pixelType",void 0),x([Mi("pixelType")],e.prototype,"readPixelType",null),x([ur("pixelType")],e.prototype,"writePixelType",null),x([D({constructOnly:!0,type:W3})],e.prototype,"serviceRasterInfo",void 0),x([D()],e.prototype,"sourceJSON",void 0),x([D(C0)],e.prototype,"url",void 0),x([D({readOnly:!0})],e.prototype,"version",void 0),x([Mi("version",["currentVersion","fields","timeInfo"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.ArcGISImageService")],e),e};let ww=class extends xh(AE(uc(Rc(Yc(mdr(fy(py(Xv(Ql(xs(Il))))))))))){constructor(...e){super(...e),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=xd(async(t,r,n)=>{const{save:s,saveAs:o}=await Promise.resolve().then(()=>FWt);switch(t){case Uc.SAVE:return s(this,r);case Uc.SAVE_AS:return o(this,n,r)}})}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,t,r){const n=this.renderer?.type==="vector-field";t[r]=n?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const t=this.rasterFields,r=this.title,n=new Set;let s=!1,o=!1;this.capabilities&&(s=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,o=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const a=new Set;s&&a.add("raster.itempixelvalue");for(const u of t){const c=u.name.toLowerCase();a.has(c)||c.includes("raster.servicepixelvalue.")||n.add(u.name)}o&&n.add("raster.magnitude").add("raster.direction");const l=p_({fields:t,title:r},{...e,visibleFieldNames:n});return l?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&l.fieldInfos.forEach(({format:u,fieldName:c})=>{u&&/^raster\.(item|service)pixelvalue/i.test(c)&&(u.places=2)}),l}queryFeatures(e,t){return this.queryRasters(e,t).then(r=>{if(r?.features)for(const n of r.features)n.layer=n.sourceLayer=this;return r})}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(Uc.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Uc.SAVE_AS,t,e)}serviceSupportsSpatialReference(e){return Mae(this,e)}write(e,t){if(!this._isPreviewLayer)return super.write(e,t);if(t?.messages){const r=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new qe("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${r}'`,{layer:this}))}return null}};x([D(d_)],ww.prototype,"legendEnabled",null),x([D({type:["show","hide"]})],ww.prototype,"listMode",null),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ww.prototype,"isReference",void 0),x([D({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],ww.prototype,"operationalLayerType",void 0),x([ur("web-map","operationalLayerType")],ww.prototype,"writeOperationalLayerType",null),x([D(h_)],ww.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],ww.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],ww.prototype,"defaultPopupTemplate",null),x([D({readOnly:!0,json:{read:!1}})],ww.prototype,"type",void 0),x([D({readOnly:!0})],ww.prototype,"_isPreviewLayer",null),ww=x([Qe("esri.layers.ImageryLayer")],ww);const gDt=ww,gdr=Object.freeze(Object.defineProperty({__proto__:null,default:gDt},Symbol.toStringTag,{value:"Module"})),yDt=96;function M1e(i,e){const t=i.extent,r=i.width,n=pu(t?.spatialReference);return t&&r?t.width/r*n*mze*yDt:0}function ydr(i,e){return i/(pu(e)*mze*yDt)}function vDt(i,e,t){return vdr(i,e)&&_dr(i,t)}function vdr(i,e){return e===0||W8(i,e)||ie}const _Dt=i=>{let e=class extends i{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,r){const n=r.capabilities&&r.capabilities.split(",").map(R=>R.toLowerCase().trim());if(!n)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const s=this.type,o=s!=="tile"&&!!r.supportsDynamicLayers,a=n.includes("query"),l=n.includes("map"),u=!!r.exportTilesAllowed,c=n.includes("tilemap"),h=n.includes("data"),p=s!=="tile"&&(!r.tileInfo||o),m=s!=="tile"&&(!r.tileInfo||o),v=s!=="tile",w=r.cimVersion&&EY.parse(r.cimVersion),S=w?.since(1,4)??!1,I=w?.since(2,0)??!1;return{operations:{supportsExportMap:l,supportsExportTiles:u,supportsIdentify:a,supportsQuery:h,supportsTileMap:c},exportMap:l?{supportsArcadeExpressionForLabeling:S,supportsSublayersChanges:v,supportsDynamicLayers:o,supportsSublayerVisibility:p,supportsSublayerDefinitionExpression:m,supportsCIMSymbols:I}:null,exportTiles:u?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(t,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),n}async fetchRelatedService(t){const r=this.portalItem;if(!r||!aot(r))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=r.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(s=>s.find(o=>o.type==="Feature Service")??null,()=>null));const n=await this._relatedFeatureServicePromise;return hn(t),n?{itemId:n.id,url:n.url}:null}async fetchSublayerInfo(t,r){const{source:n}=t;if(this?.portalItem&&this.type==="tile"&&n?.type==="map-layer"&&aot(this.portalItem)&&t.originIdOf("url")Pn.SERVICE)try{const a=await this._fetchAllLayersAndTablesFromService(s),l=r_(s)?.sublayer??n.mapLayerId;o=a.get(l)}catch{}else{let a=t.id;n?.type==="map-layer"&&(a=n.mapLayerId);try{o=(await this.fetchAllLayersAndTables(r)).get(a)}catch{}}return o}async fetchAllLayersAndTables(t){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,t)}async _fetchAllLayersAndTablesFromService(t,r){await this.load(r),this._allLayersAndTablesMap||=new Map;const n=r_(t),s=qh(this._allLayersAndTablesMap,n?.url.path,()=>zi(Iu(n?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(a=>{const l=new Map;for(const u of a.data.layers)l.set(u.id,u);return{result:l}},a=>({error:a}))),o=await s;if(hn(r),"result"in o)return o.result;throw o.error}};return x([D({readOnly:!0})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D({type:hr})],e.prototype,"fullExtent",void 0),x([D(LY)],e.prototype,"id",void 0),x([D({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),x([D(h_)],e.prototype,"popupEnabled",void 0),x([D({type:Xi})],e.prototype,"spatialReference",void 0),x([D({readOnly:!0})],e.prototype,"version",void 0),x([Mi("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.ArcGISMapService")],e),e};let eU=class extends dr{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(vCt(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let t=0;for(const r of e)r!=null&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new dr(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(n=>!!n);for(const n of t)if(n){if(r(n)){const s=this.indexOf(n,e);s>=0?s!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const s=this.getChildrenFunction(n);if(Array.isArray(s))for(const o of s)e=this._processCollection(e,o);else e=this._processCollection(e,s)}}return e}};x([D()],eU.prototype,"getCollections",void 0),x([D()],eU.prototype,"getChildrenFunction",void 0),x([D()],eU.prototype,"itemFilterFunction",void 0),eU=x([Qe("esri.core.CollectionFlattener")],eU);const _E=eU,bdr=[["binary","application/octet-stream","bin",""]];function wdr(i,e){return xDt(e.name,i?.supportedFormats??[])!=null}function xdr(i,e){if(!i)return!1;const t=wDt(e,i.supportedFormats??[]);return t!=null&&i.editFormats.includes(t)}function yR(i,e){return LHe(Tdr(i,e))}function rk(i,e){return LHe(xDt(i,e))}function bDt(i,e){return SDt(Sdr(i,e))}function wDt(i,e){return rk(i.name,e)??yR(i.type,e)}function kHe(i){return[...bdr,...i]}function Sdr(i,e){return kHe(e).find(t=>LHe(t)===i)}function Tdr(i,e){const t=i.toLowerCase();return kHe(e).find(r=>SDt(r)===t)}function xDt(i,e){const t=i.toLowerCase();return kHe(e).find(r=>Cdr(r).some(n=>t.endsWith(n)))}function LHe(i){return i?.[0]}function SDt(i){return i?.[1].toLowerCase()}function Cdr(i){return i?.[2].split(",").map(e=>e.toLowerCase())??[]}function Edr(i){return i.tables?.find(e=>e.role==="assetMaps")}async function Idr(i,e,t){const r=gu(i),n=await hDt(r,Kn.from(e),{...t}),s=n.data.extent;return!s||isNaN(s.xmin)||isNaN(s.ymin)||isNaN(s.xmax)||isNaN(s.ymax)?{count:n.data.count,extent:null}:{count:n.data.count,extent:hr.fromJSON(s)}}function b0(i,e){return i?e?4:3:e?3:2}const kae=()=>di.getLogger("esri.layers.graphics.featureConversionUtils"),TDt={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},Adr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s},cat=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+2]},Mdr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+3]},Odr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+2],i[t+3]=e[r+3]};function NHe(i,e,t,r){if(i){if(t)return e&&r?Odr:cat;if(e&&r)return Mdr}else if(e&&r)return cat;return Adr}function nge({scale:i,translate:e},t){return Math.round((t-e[0])/i[0])}function sge({scale:i,translate:e},t){return Math.round((e[1]-t)/i[1])}function rMe({scale:i,translate:e},t,r){return t*i[r]+e[r]}function hNe(i,e,t){return i?e?t?jHe(i):$He(i):t?BHe(i):cSe(i):null}function cSe(i){const e=i.coords;return{x:e[0],y:e[1]}}function CDt(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i}function $He(i){const e=i.coords;return{x:e[0],y:e[1],z:e[2]}}function Pdr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.z,i}function BHe(i){const e=i.coords;return{x:e[0],y:e[1],m:e[2]}}function Rdr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.m,i}function jHe(i){const e=i.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function Ddr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.z,i.coords[3]=e.m,i}function Fdr(i,e,t,r){let n=cSe;t&&r?n=jHe:t?n=$He:r&&(n=BHe);for(const s of e){const{geometry:o,attributes:a}=s,l=o!=null?n(o):null;i.push({attributes:a,geometry:l})}return i}function GHe(i,e){return i&&e?Ddr:i?Pdr:e?Rdr:CDt}function kdr(i,e,t,r,n){const s=GHe(t,r);for(const{geometry:o,attributes:a}of e){const l=o!=null?s(new $o,o):null;i.push(new ry(l,a,null,n?a[n]:void 0))}return i}function EDt(i,e,t=GHe(e.z!=null,e.m!=null)){return t(i,e)}function Ldr(i,e,t,r){for(const{geometry:n,attributes:s}of e)i.push({attributes:s,geometry:n!=null?UHe(n,t,r):null});return i}function UHe(i,e,t){if(i==null)return null;const r=b0(e,t),n=[];for(let s=0;s=l&&(i.lengths.push($),k=L)}return bE(i.coords,k),i.coords.length?i:null}function DDt(i,e,t,r,n,s,o=t,a=r){if(zP(i),!e?.coords.length)return null;const l=TDt[n],{coords:u,lengths:c}=e,h=b0(t,r),p=b0(t&&o,r&&a),m=NHe(t,r,o,a);if(!c.length)return m(i.coords,u,0,0,u[0],u[1]),zP(i,h,0),i;let v=0;const w=s*s;for(const S of c){if(S=l?i.lengths.push(k):bE(i.coords,I*p),v+=S*h}return i.coords.length?i:null}function Hdr(i,e,t,r){const n=i[e],s=i[e+1],o=i[t],a=i[t+1],l=i[r],u=i[r+1];let c=o,h=a,p=l-c,m=u-h;if(p!==0||m!==0){const v=((n-c)*p+(s-h)*m)/(p*p+m*m);v>1?(c=l,h=u):v>0&&(c+=p*v,h+=m*v)}return p=n-c,m=s-h,p*p+m*m}function dNe(i,e,t,r,n,s,o){let a,l=r,u=0;for(let c=s+t;cl&&(u=c,l=a);l>r&&(u-s>t&&dNe(i,e,t,r,n,s,u),n(i,e,i.length,u,e[u],e[u+1]),o-u>t&&dNe(i,e,t,r,n,u,o))}function O1e(i,e,t,r){if(!e?.coords?.length)return null;const n=b0(t,r);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(e&&e.coords){const u=e.coords;for(let c=0;cs.name);this._attributesConstructor=function(){for(const s of n)this[s]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._mValueOffset=null,this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),e.geometryType){case"esriGeometryPoint":this.addCoordinate=(t,r,n)=>this.addCoordinatePoint(t,r,n),this.createGeometry=t=>this.createPointGeometry(t);break;case"esriGeometryPolygon":this.addCoordinate=(t,r,n)=>this._addCoordinatePolygon(t,r,n),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"esriGeometryPolyline":this.addCoordinate=(t,r,n)=>this._addCoordinatePolyline(t,r,n),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"esriGeometryMultipoint":this.addCoordinate=(t,r,n)=>this._addCoordinateMultipoint(t,r,n),this.createGeometry=t=>this._createMultipointGeometry(t)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:n}=t,s=cB(r.clone(),r,!1,!1,this._transform),o=KC(s,n,!1,!1);e.queryGeometryType=n,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const n=this._transform;switch(t=this._applyTransform(n,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const n=this._transform;return this._mValueOffset===null||e!==0||t%this._mValueOffset?this._applyTransform(n,e,t,r):0}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(n)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const n=this._transformPathLikeValue(t,r),s=e[e.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=n}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?Zdr:t?FDt:r?Kdr:WHe}};async function kDt(i,e,t){const r=gu(i),n={...t},s=Kn.from(e),o=!s.quantizationParameters,{data:a}=await uDt(r,s,new epr({sourceSpatialReference:s.sourceSpatialReference,applyTransform:o}),n);return a}let I2=class extends un{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return Yo(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),n=e.outStatistics?.[0]!=null,s=yi("featurelayer-pbf-statistics"),o=!n||s;let a;if(this.pbfSupported&&o)try{a=await kDt(this.url,r,t)}catch(l){if(l.name!=="query:parsing-pbf")throw l;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await RHe(this.url,r,t)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return du.fromJSON(t);const{meshFeatureSetFromJSON:n}=await Jg(Promise.resolve().then(()=>tqt),r);return n(e,this.infoFor3D,t)}executeForCount(e,t){return DHe(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return Idr(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return uSe(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:n}]=await Jg(Promise.all([Promise.resolve().then(()=>zst),Promise.resolve().then(()=>Pat)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),n(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:n}]=await Jg(Promise.all([Promise.resolve().then(()=>zst),Promise.resolve().then(()=>Pat)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),n(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:n,processAttachmentQueryResult:s}=await Jg(Promise.resolve().then(()=>jpr),t),o=gu(this.url);return s(o,await(this.queryAttachmentsSupported?r(o,e,t):n(o,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await Jg(Promise.resolve().then(()=>Zpr),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await Jg(Promise.resolve().then(()=>efr),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await Jg(Promise.resolve().then(()=>ifr),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await Jg(Promise.resolve().then(()=>nfr),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=Kn.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?Ev.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:n,queryFormats:s}=r,o=yR("model/gltf-binary",n)??rk("glb",n),a=yR("model/gltf+json",n)??rk("gltf",n);for(const l of s){if(l===o){t.formatOf3DObjects=l;break}l!==a||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:c,translationX:h,translationY:p,translationZ:m,scaleX:v,scaleY:w,scaleZ:S,rotationX:I,rotationY:R,rotationZ:L,rotationDeg:k}=r.transformFieldRoles;t.outFields.push(l,u,c,h,p,m,v,w,S,I,R,L,k)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};x([D({type:Ev})],I2.prototype,"dynamicDataSource",void 0),x([D()],I2.prototype,"fieldsIndex",void 0),x([D()],I2.prototype,"gdbVersion",void 0),x([D()],I2.prototype,"infoFor3D",void 0),x([D({readOnly:!0})],I2.prototype,"parsedUrl",null),x([D()],I2.prototype,"pbfSupported",void 0),x([D()],I2.prototype,"queryAttachmentsSupported",void 0),x([D()],I2.prototype,"sourceSpatialReference",void 0),x([D({type:String})],I2.prototype,"url",void 0),I2=x([Qe("esri.tasks.QueryTask")],I2);const LDt=I2;var oge;function nMe(i){return i!=null&&i.type==="esriSMS"}function sMe(i,e,t){const r=this.originIdOf(e)>=n0(t.origin);return{ignoreOrigin:!0,allowNull:r,enabled:!!t&&t.layer?.type==="map-image"&&(t.writeSublayerStructure||r)}}function oMe(i,e,t){return{enabled:!!t&&t.layer?.type==="tile"&&(t.origin&&this.originIdOf(e)>=n0(t.origin)||this._isOverridden(e))}}function u2(i,e,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function bhe(i,e,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(e)>=n0(t.origin))}}let tpr=0;const s$=new Set;s$.add("layer"),s$.add("parent"),s$.add("loaded"),s$.add("loadStatus"),s$.add("loadError"),s$.add("loadWarnings");let Bo=oge=class extends Ql(iT(ef)){constructor(i){super(i),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(i){return this.addResolvingPromise((async()=>{const{layer:e,url:t}=this;if(!e&&!t)throw new qe("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const r=e?await e.fetchSublayerInfo(this,i):(await zi(t,{responseType:"json",query:{f:"json"},...i})).data;r&&(this.sourceJSON=r,this.read({layerDefinition:r},{origin:"service",layer:e,url:gu(t)}))})()),this}readCapabilities(i,e){e=e.layerDefinition||e;const{operations:{supportsQuery:t,supportsQueryAttachments:r},query:{supportsFormatPBF:n},data:{supportsAttachment:s},queryRelated:o}=WVe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:r},data:{supportsAttachment:s},query:{supportsFormatPBF:n},queryRelated:o}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(i){this._setAndNotifyLayer("definitionExpression",i)}get effectiveScaleRange(){const{minScale:i,maxScale:e}=this;return{minScale:i,maxScale:e}}readMaxScaleRange(i,e){return{minScale:(e=e.layerDefinition||e).minScale??0,maxScale:e.maxScale??0}}get fieldsIndex(){return new Cd(this.fields||[])}set floorInfo(i){this._setAndNotifyLayer("floorInfo",i)}readGlobalIdFieldFromService(i,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??tpr++}set id(i){this._get("id")!==i&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",i):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(i){this._setAndNotifyLayer("labelingInfo",i)}writeLabelingInfo(i,e,t,r){i&&i.length&&(e.layerDefinition={drawingInfo:{labelingInfo:i.map(n=>n.write({},r))}})}set labelsVisible(i){this._setAndNotifyLayer("labelsVisible",i)}set layer(i){this._set("layer",i),this.sublayers&&this.sublayers.forEach(e=>e.layer=i)}set listMode(i){this._set("listMode",i)}set minScale(i){this._setAndNotifyLayer("minScale",i)}readMinScale(i,e){return e.minScale||e.layerDefinition?.minScale||0}set maxScale(i){this._setAndNotifyLayer("maxScale",i)}readMaxScale(i,e){return e.maxScale||e.layerDefinition?.maxScale||0}readObjectIdFieldFromService(i,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(i){this._setAndNotifyLayer("opacity",i)}readOpacity(i,e){const t=e.layerDefinition;return 1-.01*((t?.transparency!=null?t.transparency:t?.drawingInfo?.transparency)??0)}writeOpacity(i,e,t,r){e.layerDefinition={drawingInfo:{transparency:100-100*i}}}writeParent(i,e){this.parent&&this.parent!==this.layer?e.parentLayerId=r2e(this.parent.id):e.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:i}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:r}=this,n=yi("featurelayer-pbf")&&t?.query.supportsFormatPBF,s=t?.operations?.supportsQueryAttachments??!1;return new LDt({url:this.url,pbfSupported:n,fieldsIndex:r,gdbVersion:e,sourceSpatialReference:i,queryAttachmentsSupported:s})}set renderer(i){if(i){for(const e of i.getSymbols())if(JF(e)){di.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",i)}get source(){return this._get("source")||new lP({mapLayerId:this.id})}set source(i){this._setAndNotifyLayer("source",i)}set sublayers(i){this._handleSublayersChange(i,this._get("sublayers")),this._set("sublayers",i)}castSublayers(i){return Sd(dr.ofType(oge),i)}writeSublayers(i,e,t){this.sublayers?.length&&(e[t]=this.sublayers.map(r=>r.id).toArray().reverse())}readTitle(i,e){return e.layerDefinition?.name??e.name}readTypeIdField(i,e){let t=(e=e.layerDefinition||e).typeIdField;if(t&&e.fields){t=t.toLowerCase();const r=e.fields.find(n=>n.name.toLowerCase()===t);r&&(t=r.name)}return t}get url(){const i=this.layer?.parsedUrl??this._lastParsedUrl,e=this.source;if(!i)return null;if(this._lastParsedUrl=i,e?.type==="map-layer")return`${i.path}/${e.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${i.path}/dynamicLayer?${Lb(t)}`}set url(i){this._overrideIfSome("url",i)}set visible(i){this._setAndNotifyLayer("visible",i)}writeVisible(i,e,t,r){e[t]=this.getAtOrigin("defaultVisibility","service")||i}clone(){const{store:i}=Kp(this),e=new oge;return Kp(e).store=i.clone(s$),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(i){return p_(this,i)}createQuery(){return new Kn({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const i=(await Promise.resolve().then(()=>rHe)).default,{layer:e,url:t}=this;let r;if(t&&this.originIdOf("url")>Pn.SERVICE)r=new i({url:t});else{if(!e?.parsedUrl)throw new qe("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const n=e.parsedUrl;r=new i({url:n.path}),n&&this.source&&(this.source.type==="map-layer"?r.layerId=this.source.mapLayerId:r.dynamicDataSource=this.source)}}return e?.refreshInterval!=null&&(r.refreshInterval=e.refreshInterval),this.definitionExpression&&(r.definitionExpression=this.definitionExpression),this.floorInfo&&(r.floorInfo=li(this.floorInfo)),this.originIdOf("labelingInfo")>Pn.SERVICE&&(r.labelingInfo=li(this.labelingInfo)),this.originIdOf("labelsVisible")>Pn.DEFAULTS&&(r.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>Pn.DEFAULTS&&(r.legendEnabled=this.legendEnabled),this.originIdOf("visible")>Pn.DEFAULTS&&(r.visible=this.visible),this.originIdOf("minScale")>Pn.DEFAULTS&&(r.minScale=this.minScale),this.originIdOf("maxScale")>Pn.DEFAULTS&&(r.maxScale=this.maxScale),this.originIdOf("opacity")>Pn.DEFAULTS&&(r.opacity=this.opacity),this.originIdOf("popupTemplate")>Pn.DEFAULTS&&(r.popupTemplate=li(this.popupTemplate)),this.originIdOf("renderer")>Pn.SERVICE&&(r.renderer=li(this.renderer)),this.source?.type==="data-layer"&&(r.dynamicDataSource=this.source.clone()),this.originIdOf("title")>Pn.DEFAULTS&&(r.title=this.title),e?.type==="map-image"&&e.originIdOf("customParameters")>Pn.DEFAULTS&&(r.customParameters=e.customParameters),e?.type==="tile"&&e.originIdOf("customParameters")>Pn.DEFAULTS&&(r.customParameters=e.customParameters),r}getField(i){return this.fieldsIndex.get(i)}getFeatureType(i){const{typeIdField:e,types:t}=this;if(!e||!i)return null;const r=i.attributes?i.attributes[e]:void 0;if(r==null)return null;let n=null;return t?.some(s=>{const{id:o}=s;return o!=null&&(o.toString()===r.toString()&&(n=s),!!n)}),n}getFieldDomain(i,e){const t=e?.feature,r=this.getFeatureType(t);if(r){const n=r.domains&&r.domains[i];if(n&&n.type!=="inherited")return n}return this._getLayerDomain(i)}async queryAttachments(i,e){await this.load(),i=_1e.from(i);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new qe("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:r,objectIds:n,globalIds:s,num:o,size:a,start:l,where:u}=i;if(!t?.operations?.supportsQueryAttachments&&(r?.length>0||s?.length>0||a?.length>0||o||l||u))throw new qe("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",i);if(!(n?.length||s?.length||u))throw new qe("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",i);return this.queryTask.executeAttachmentQuery(i,e)}async queryFeatures(i=this.createQuery(),e){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new qe("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new qe("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(i,{...e,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const r of t.features)r.sourceLayer=this;return t}toExportImageJSON(i){const e={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=PS(i,this.definitionExpression);t!=null&&(e.definitionExpression=t);const r=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,o)=>(s[o]=this.originIdOf(o),s),{});if(Object.keys(r).some(s=>r[s]>Pn.SERVICE)){const s=e.drawingInfo={};if(r.renderer>Pn.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>Pn.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>Pn.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(a=>!a.labelPlacement)&&di.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let o=this.labelingInfo;this.geometryType!=null&&(o=WPt(this.labelingInfo,Vp.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=o.filter(a=>a.labelPlacement).map(a=>a.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;r.opacity>Pn.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return e}_assignDefaultSymbolColors(i){this._forEachSimpleMarkerSymbols(i,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(i,e){if(i){const t=("uniqueValueInfos"in i?i.uniqueValueInfos:"classBreakInfos"in i?i.classBreakInfos:null)??[];for(const r of t)nMe(r.symbol)&&e(r.symbol);"symbol"in i&&nMe(i.symbol)&&e(i.symbol),"defaultSymbol"in i&&nMe(i.defaultSymbol)&&e(i.defaultSymbol)}}_setAndNotifyLayer(i,e){const t=this.layer,r=this._get(i);let n,s;switch(i){case"definitionExpression":case"floorInfo":n="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":n="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":n="supportsDynamicLayers",s="supportsModification"}const o=Kp(this).getDefaultOrigin();if(o!=="service"){if(n&&this.layer?.capabilities?.exportMap?.[n]===!1)return void this._logLockedError(i,`capability not available 'layer.capabilities.exportMap.${n}'`);if(s&&this.capabilities?.exportMap[s]===!1)return void this._logLockedError(i,`capability not available 'capabilities.exportMap.${s}'`)}i!=="source"||this.loadStatus==="not-loaded"?(this._set(i,e),o!=="service"&&r!==e&&t&&t.emit&&t.emit("sublayer-update",{propertyName:i,target:this})):this._logLockedError(i,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(i,e){e&&(e.forEach(t=>{t.parent=null,t.layer=null}),this.removeAllHandles()),i&&(i.forEach(t=>{t.parent=this,t.layer=this.layer}),this.addHandles([i.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),i.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),i.on("before-changes",t=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;r==null||r||(di.getLogger(this).error(new qe("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(i,e){const{layer:t,declaredClass:r}=this;di.getLogger(r).error(new qe("sublayer:locked",`Property '${String(i)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:e,sublayer:this,layer:t}))}_getLayerDomain(i){const e=this.fieldsIndex.get(i);return e?e.domain:null}};Bo.test={isMapImageLayerOverridePolicy:i=>i===u2||i===sMe,isTileImageLayerOverridePolicy:i=>i===oMe},x([D({readOnly:!0})],Bo.prototype,"capabilities",void 0),x([Mi("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],Bo.prototype,"readCapabilities",null),x([D()],Bo.prototype,"defaultPopupTemplate",null),x([D({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:sMe}}})],Bo.prototype,"definitionExpression",null),x([D({readOnly:!0})],Bo.prototype,"effectiveScaleRange",null),x([Mi("service","maxScaleRange",["minScale","maxScale"])],Bo.prototype,"readMaxScaleRange",null),x([D({type:[Fo],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],Bo.prototype,"fields",void 0),x([D({readOnly:!0})],Bo.prototype,"fieldsIndex",null),x([D({type:HVe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:sMe},origins:{"web-scene":{read:!1,write:!1}}}})],Bo.prototype,"floorInfo",null),x([D({type:hr,json:{read:{source:"layerDefinition.extent"}}})],Bo.prototype,"fullExtent",void 0),x([D({type:Vp.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:Vp.read}}}}})],Bo.prototype,"geometryType",void 0),x([D({type:String})],Bo.prototype,"globalIdField",void 0),x([Mi("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Bo.prototype,"readGlobalIdFieldFromService",null),x([D({type:ms,json:{write:{ignoreOrigin:!0}}})],Bo.prototype,"id",null),x([D({value:null,type:[rT],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:u2}}})],Bo.prototype,"labelingInfo",null),x([ur("labelingInfo")],Bo.prototype,"writeLabelingInfo",null),x([D({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:u2}}})],Bo.prototype,"labelsVisible",null),x([D({value:null})],Bo.prototype,"layer",null),x([D({type:String,json:{write:{overridePolicy:oMe}}})],Bo.prototype,"layerItemId",void 0),x([D({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:bhe}}})],Bo.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],Bo.prototype,"listMode",null),x([D({type:Number,value:0,json:{write:{overridePolicy:u2}}})],Bo.prototype,"minScale",null),x([Mi("minScale",["minScale","layerDefinition.minScale"])],Bo.prototype,"readMinScale",null),x([D({type:Number,value:0,json:{write:{overridePolicy:u2}}})],Bo.prototype,"maxScale",null),x([Mi("maxScale",["maxScale","layerDefinition.maxScale"])],Bo.prototype,"readMaxScale",null),x([D({type:String})],Bo.prototype,"objectIdField",void 0),x([Mi("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Bo.prototype,"readObjectIdFieldFromService",null),x([D({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:u2}}})],Bo.prototype,"opacity",null),x([Mi("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],Bo.prototype,"readOpacity",null),x([ur("opacity")],Bo.prototype,"writeOpacity",null),x([D({json:{type:ms,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:u2}}})],Bo.prototype,"parent",void 0),x([ur("parent")],Bo.prototype,"writeParent",null),x([D({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(i,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:bhe,writer(i,e,t){e[t]=!i}}}})],Bo.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:bhe}}})],Bo.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],Bo.prototype,"queryTask",null),x([D({types:IE,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:u2},origins:{"web-scene":{types:qk,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:u2}}}}})],Bo.prototype,"renderer",null),x([D({types:{key:"type",base:null,typeMap:{"data-layer":Ev,"map-layer":lP}},cast(i){if(i){if("mapLayerId"in i)return Cu(lP,i);if("dataSource"in i)return Cu(Ev,i)}return i},json:{name:"layerDefinition.source",write:{overridePolicy:u2}}})],Bo.prototype,"source",null),x([D()],Bo.prototype,"sourceJSON",void 0),x([D({value:null,json:{type:[ms],write:{target:"subLayerIds",allowNull:!0,overridePolicy:u2}}})],Bo.prototype,"sublayers",null),x([So("sublayers")],Bo.prototype,"castSublayers",null),x([ur("sublayers")],Bo.prototype,"writeSublayers",null),x([D({type:String,json:{name:"name",write:{overridePolicy:bhe}}})],Bo.prototype,"title",void 0),x([Mi("service","title",["name","layerDefinition.name"])],Bo.prototype,"readTitle",null),x([D({type:String})],Bo.prototype,"typeIdField",void 0),x([D({json:{read:!1},readOnly:!0,value:"sublayer"})],Bo.prototype,"type",void 0),x([Mi("typeIdField",["layerDefinition.typeIdField"])],Bo.prototype,"readTypeIdField",null),x([D({type:[Aae],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],Bo.prototype,"types",void 0),x([D({type:String,json:{name:"layerUrl",write:{overridePolicy:oMe}}})],Bo.prototype,"url",null),x([D({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:u2}}})],Bo.prototype,"visible",null),x([ur("visible")],Bo.prototype,"writeVisible",null),Bo=oge=x([Qe("esri.layers.support.Sublayer")],Bo);const Lae=Bo;function hat(i,e,t){return e.flatten(({sublayers:n})=>n).length!==i.length?!0:!!i.some(n=>n.originIdOf("minScale")>t||n.originIdOf("maxScale")>t||n.originIdOf("renderer")>t||n.originIdOf("labelingInfo")>t||n.originIdOf("opacity")>t||n.originIdOf("labelsVisible")>t||n.originIdOf("source")>t)||!$Dt(i,e)}function NDt(i,e,t){return!!i.some(r=>{const n=r.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===r.id&&(n.gdbVersion==null||n.gdbVersion===t))||r.originIdOf("renderer")>Pn.SERVICE||r.originIdOf("labelingInfo")>Pn.SERVICE||r.originIdOf("opacity")>Pn.SERVICE||r.originIdOf("labelsVisible")>Pn.SERVICE})||!$Dt(i,e)}function $Dt(i,e){if(!i?.length||e==null)return!0;const t=e.slice().reverse().flatten(({sublayers:s})=>s&&s.toArray().reverse()).map(s=>s.id).toArray();if(i.length>t.length)return!1;let r=0;const n=t.length;for(const{id:s}of i){for(;r=n)return!1}return!0}function ipr(i){return!!i&&i.some(e=>e.minScale!=null||e.layerDefinition?.minScale!=null)}function rpr(i,e){const t=[],r={};return i&&i.forEach(n=>{const s=new Lae;if(s.read(n,e),r[s.id]=s,n.parentLayerId!=null&&n.parentLayerId!==-1){const o=r[n.parentLayerId];o.sublayers||(o.sublayers=[]),o.sublayers.unshift(s)}else t.unshift(s)}),t}const aMe=dr.ofType(Lae);function BDt(i,e){i&&i.forEach(t=>{e(t),t.sublayers&&t.sublayers.length&&BDt(t.sublayers,e)})}const jDt=i=>{let e=class extends i{constructor(...t){super(...t),this.allSublayers=new _E({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.sublayers}),this.sublayersSourceJSON={[Pn.SERVICE]:{},[Pn.PORTAL_ITEM]:{},[Pn.WEB_SCENE]:{},[Pn.WEB_MAP]:{}},this.addHandles(Ki(()=>this.sublayers,(r,n)=>this._handleSublayersChange(r,n),Kl))}destroy(){this.allSublayers.destroy()}readSublayers(t,r){if(!r||!t)return;const{sublayersSourceJSON:n}=this,s=n0(r.origin);if(sPn.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=Kp(this);l.setDefaultOrigin(a),this._set("sublayers",new aMe(o)),l.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(r=>r.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const r=n0(t==="web-document"?"web-map":t);let n=Pn.SERVICE,s=this.sublayersSourceJSON[Pn.SERVICE].layers,o=this.sublayersSourceJSON[Pn.SERVICE].context,a=null;const l=[Pn.PORTAL_ITEM,Pn.WEB_SCENE,Pn.WEB_MAP].filter(v=>v<=r);for(const v of l){const w=this.sublayersSourceJSON[v];ipr(w.layers)&&(n=v,s=w.layers,o=w.context,w.visibleLayers&&(a={visibleLayers:w.visibleLayers,context:w.context}))}const u=[Pn.PORTAL_ITEM,Pn.WEB_SCENE,Pn.WEB_MAP].filter(v=>v>n&&v<=r);let c=null;for(const v of u){const{layers:w,visibleLayers:S,context:I}=this.sublayersSourceJSON[v];w&&(c={layers:w,context:I}),S&&(a={visibleLayers:S,context:I})}const h=rpr(s,o),p=new Map,m=new Set;if(c)for(const v of c.layers)p.set(v.id,v);if(a?.visibleLayers)for(const v of a.visibleLayers)m.add(v);return BDt(h,v=>{c&&v.read(p.get(v.id),c.context),a&&v.read({defaultVisibility:m.has(v.id)},a.context)}),{origin:yne(n),sublayers:new aMe({items:h})}}read(t,r){super.read(t,r),this.readSublayers(t,r)}_handleSublayersChange(t,r){r&&(r.forEach(n=>{n.parent=null,n.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(n=>{n.parent=this,n.layer=this}),this.addHandles([t.on("after-add",({item:n})=>{n.parent=this,n.layer=this}),t.on("after-remove",({item:n})=>{n.parent=null,n.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",n=>{di.getLogger("esri.layers.TileLayer").error(new qe("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),n.preventDefault()}),"sublayers-owner"))}};return x([D({readOnly:!0})],e.prototype,"allSublayers",void 0),x([D({readOnly:!0,type:dr.ofType(Lae)})],e.prototype,"serviceSublayers",void 0),x([D({value:null,type:aMe,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),x([D({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=x([Qe("esri.layers.mixins.SublayersOwner")],e),e};function dat(i){const e=i.layer;return"floorInfo"in e&&e.floorInfo?.floorField&&"floors"in i.view?GDt(i.view.floors,e.floorInfo.floorField):null}function Yne(i,e){return"floorInfo"in e&&e.floorInfo?.floorField?GDt(i,e.floorInfo.floorField):null}function GDt(i,e){if(!i?.length)return null;const t=i.filter(r=>r!=="").map(r=>`'${r}'`);return t.push("''"),`${e} IN (${t.join(",")}) OR ${e} IS NULL`}const npr={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let Z_=class extends un{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(t=>{const r=Yne(this.floors,t);return t.toExportImageJSON(r)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&NDt(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",t=>this.notifyChange(npr[t.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(t=>t.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,t=this.visibleSublayers.filter(r=>r.definitionExpression!=null||e&&r.floorInfo!=null);return t.length?JSON.stringify(t.reduce((r,n)=>{const s=Yne(this.floors,n),o=PS(s,n.definitionExpression);return o!=null&&(r[n.id]=o),r},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const t=this.layer.sublayers,r=this.scale,n=o=>{o.visible&&(r===0||vDt(r,o.minScale,o.maxScale))&&(o.sublayers?o.sublayers.forEach(n):e.unshift(o))};t&&t.forEach(n);const s=this._get("visibleSublayers");return!s||s.length!==e.length||s.some((o,a)=>e[a]!==o)?e:s}toJSON(){const e=this.layer;let t={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?t.dynamicLayers=this.dynamicLayers:t={...t,layers:this.layers,layerDefs:this.layerDefs},t}};x([D({readOnly:!0})],Z_.prototype,"dynamicLayers",null),x([D()],Z_.prototype,"floors",void 0),x([D({readOnly:!0})],Z_.prototype,"hasDynamicLayers",null),x([D()],Z_.prototype,"layer",null),x([D({readOnly:!0})],Z_.prototype,"layers",null),x([D({readOnly:!0})],Z_.prototype,"layerDefs",null),x([D({type:Number})],Z_.prototype,"scale",void 0),x([D(kY)],Z_.prototype,"timeExtent",void 0),x([D({readOnly:!0})],Z_.prototype,"version",null),x([D({readOnly:!0})],Z_.prototype,"visibleSublayers",null),Z_=x([Qe("esri.layers.mixins.ExportImageParameters")],Z_);let ep=class extends xh(AE(uc(jDt(_Dt(Xv(Rc(Yc(Ql(fy(Wx(py(Il)))))))))))){constructor(...e){super(...e),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}writeSublayers(e,t,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:c})=>c&&c.toArray().reverse()).toArray();let o=!1;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){const c=n0(n.origin);if(c===Pn.PORTAL_ITEM){const h=this.createSublayersForOrigin("service").sublayers;o=hat(s,h,Pn.SERVICE)}else if(c>Pn.PORTAL_ITEM){const h=this.createSublayersForOrigin("portal-item");o=hat(s,h.sublayers,n0(h.origin))}}const a=[],l={writeSublayerStructure:o,...n};let u=o;s.forEach(c=>{const h=c.write({},l);a.push(h),u=u||c.originOf("visible")==="user"}),a.some(c=>Object.keys(c).length>1)&&(t.layers=a),u&&(t.visibleLayers=s.filter(c=>c.visible).map(c=>c.id))}createExportImageParameters(e,t,r,n){const s=n?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const o=new Z_({layer:this,floors:n?.floors,scale:M1e({extent:e,width:t})*s}),a=o.toJSON();o.destroy();const l=!n?.rotation||this.version<10.3?{}:{rotation:-n.rotation},u=e?.spatialReference,c=Hv(u);a.dpi*=s;const h={};if(n?.timeExtent){const{start:p,end:m}=n.timeExtent.toJSON();h.time=p&&m&&p===m?""+p:`${p??"null"},${m??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(h.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:c,imageSR:c,size:t+","+r,...a,...l,...h}}async fetchImage(e,t,r,n){const{data:s}=await this._fetchImage("image",e,t,r,n);return s}async fetchImageBitmap(e,t,r,n){const{data:s,url:o}=await this._fetchImage("blob",e,t,r,n);return E1e(s,o,n?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await zi(this.url,t),{extent:n,fullExtent:s,timeExtent:o}=r,a=n||s;return{fullExtent:a&&hr.fromJSON(a),timeExtent:o&&Eg.fromJSON({start:o[0],end:o[1]})}}loadAll(){return VB(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Mae(this,e)}async _fetchImage(e,t,r,n,s){const o={responseType:e,signal:s?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,r,n,s),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},a=this.parsedUrl.path+"/export";if(o.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new qe("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:o.query});try{const{data:l}=await zi(a,o);return{data:l,url:a}}catch(l){throw mo(l)?l:new qe("mapimagelayer:image-fetch-error",`Unable to load image: ${a}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:r}=await zi(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});r&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}};x([D(XF("dateFieldsTimeReference"))],ep.prototype,"dateFieldsTimeZone",void 0),x([D({type:Boolean})],ep.prototype,"datesInUnknownTimezone",void 0),x([D()],ep.prototype,"dpi",void 0),x([D()],ep.prototype,"gdbVersion",void 0),x([D()],ep.prototype,"imageFormat",void 0),x([Mi("imageFormat",["supportedImageFormatTypes"])],ep.prototype,"readImageFormat",null),x([D({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],ep.prototype,"imageMaxHeight",void 0),x([D({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],ep.prototype,"imageMaxWidth",void 0),x([D()],ep.prototype,"imageTransparency",void 0),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ep.prototype,"isReference",void 0),x([D({json:{read:!1,write:!1}})],ep.prototype,"labelsVisible",void 0),x([D({type:["ArcGISMapServiceLayer"]})],ep.prototype,"operationalLayerType",void 0),x([D({json:{read:!1,write:!1}})],ep.prototype,"popupEnabled",void 0),x([D(XF("preferredTimeReference"))],ep.prototype,"preferredTimeZone",void 0),x([D()],ep.prototype,"sourceJSON",void 0),x([D({json:{write:{ignoreOrigin:!0}}})],ep.prototype,"sublayers",void 0),x([ur("sublayers",{layers:{type:[Lae]},visibleLayers:{type:[ms]}})],ep.prototype,"writeSublayers",null),x([D({type:["show","hide","hide-children"]})],ep.prototype,"listMode",void 0),x([D({json:{read:!1},readOnly:!0,value:"map-image"})],ep.prototype,"type",void 0),x([D(C0)],ep.prototype,"url",void 0),ep=x([Qe("esri.layers.MapImageLayer")],ep);const qHe=ep,spr=Object.freeze(Object.defineProperty({__proto__:null,default:qHe},Symbol.toStringTag,{value:"Module"}));var pNe;let vI=pNe=class extends Ci{constructor(i){super(i),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new pNe({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"cols",void 0),x([D({type:ms,json:{write:!0}})],vI.prototype,"level",void 0),x([D({type:String,json:{write:!0}})],vI.prototype,"levelValue",void 0),x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"origin",void 0),x([D({type:Number,json:{write:!0}})],vI.prototype,"resolution",void 0),x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"rows",void 0),x([D({type:Number,json:{write:!0}})],vI.prototype,"scale",void 0),vI=pNe=x([Qe("esri.layers.support.LOD")],vI);const hs=vI;let jY=class{constructor(e,t,r,n,s=void 0){this.id=e,this.level=t,this.row=r,this.col=n,this.extent=s}};var S4;const pat=new Rs({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let Cy=S4=class extends Ci{static create(i={}){const{resolutionFactor:e=1,scales:t,size:r=256,spatialReference:n=Xi.WebMercator,numLODs:s=24}=i;if(!Cm(n)){const h=[];if(t)for(let p=0;p=0;m--)h.unshift(new hs({level:m,scale:p,resolution:p})),p*=2}return new S4({dpi:96,lods:h,origin:new $i(0,0,n),size:[r,r],spatialReference:n})}const o=Zp(n),a=i.origin?new $i({x:i.origin.x,y:i.origin.y,spatialReference:n}):new $i(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),l=96,u=1/(pu(n)*39.37*l),c=[];if(t)for(let h=0;h{r.push(s.scale),e=s.scale>e?s.scale:e,t=s.scale=e.length-1)return e[e.length-1];const t=Math.floor(i),r=t+1;return e[t]/(e[t]/e[r])**(i-t)}scaleToZoom(i){const e=this.scales,t=e.length-1;let r=0;for(;ri&&s=e?this.zoomToScale(Math.ceil(t)):this.zoomToScale(Math.floor(t))}tileAt(i,e,t,r){const n=this.lodAt(i);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=t;else if(Ya(e.spatialReference,this.spatialReference))s=e.x,o=e.y,r=t;else{const u=HB(e,this.spatialReference);if(u==null)return null;s=u.x,o=u.y,r=t}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return r||(r=new jY(null,0,0,0,Wo())),r.level=i,r.row=Math.floor((this.origin.y-o)/l+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(i,e=S4.ExtrapolateOptions.NONE){let t=this.lodAt(i.level);if(!t&&e===S4.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(i)?i:typeof i=="number"?[i,i]:[256,256]})],Cy.prototype,"size",void 0),x([Mi("size",["rows","cols"])],Cy.prototype,"readSize",null),x([ur("size",{cols:{type:ms},rows:{type:ms}})],Cy.prototype,"writeSize",null),x([D({type:Xi,json:{write:!0}})],Cy.prototype,"spatialReference",void 0),Cy=S4=x([Qe("esri.layers.support.TileInfo")],Cy),function(i){var e;(e=i.ExtrapolateOptions||(i.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(Cy||(Cy={}));const fu=Cy;var fNe;let zO=fNe=class extends Ci{constructor(i){super(i)}clone(){return new fNe({customLayerParameters:li(this.customLayerParameters),customParameters:li(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};x([D({json:{type:Object,write:!0}})],zO.prototype,"customLayerParameters",void 0),x([D({json:{type:Object,write:!0}})],zO.prototype,"customParameters",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"layerIdentifier",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"tileMatrixSet",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"url",void 0),zO=fNe=x([Qe("esri.layer.support.WMTSLayerInfo")],zO);var mNe;let tp=mNe=class extends xh(fy(uc(Rc(Yc(Ql(Il)))))){constructor(...i){super(...i),this.copyright="",this.fullExtent=new hr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,Xi.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=Xi.WebMercator,this.subDomains=null,this.tileInfo=new fu({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new $i({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:Xi.WebMercator}),spatialReference:Xi.WebMercator,lods:[new hs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new hs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new hs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new hs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new hs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new hs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new hs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new hs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new hs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new hs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new hs({level:10,scale:577790.554289,resolution:152.874056570411}),new hs({level:11,scale:288895.277144,resolution:76.4370282850732}),new hs({level:12,scale:144447.638572,resolution:38.2185141425366}),new hs({level:13,scale:72223.819286,resolution:19.1092570712683}),new hs({level:14,scale:36111.909643,resolution:9.55462853563415}),new hs({level:15,scale:18055.954822,resolution:4.77731426794937}),new hs({level:16,scale:9027.977411,resolution:2.38865713397468}),new hs({level:17,scale:4513.988705,resolution:1.19432856685505}),new hs({level:18,scale:2256.994353,resolution:.597164283559817}),new hs({level:19,scale:1128.497176,resolution:.298582141647617}),new hs({level:20,scale:564.248588,resolution:.14929107082380833}),new hs({level:21,scale:282.124294,resolution:.07464553541190416}),new hs({level:22,scale:141.062147,resolution:.03732276770595208}),new hs({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(i,e){return typeof i=="string"?{urlTemplate:i,...e}:i}load(i){const e=this.loadFromPortal({supportedTypes:["WMTS"]},i).then(()=>{let t="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const r=new Qy(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&r.authority?.includes("{subDomain}")&&(t="is missing 'subDomains' property")}else t="spatialReference must match tileInfo.spatialReference";else t="is missing the required 'urlTemplate' property value";if(t)throw new qe("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${t}`)});return this.addResolvingPromise(e),Promise.resolve(this)}get levelValues(){const i=[];if(!this.tileInfo)return null;for(const e of this.tileInfo.lods)i[e.level]=e.levelValue||e.level;return i}readSpatialReference(i,e){return i||Xi.fromJSON(e.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const i=[],{urlTemplate:e,subDomains:t}=this,r=new Qy(e),n=r.scheme?r.scheme+"://":"//",s=n+r.authority+"/",o=r.authority;if(o?.includes("{subDomain}")){if(t&&t.length>0&&o.split(".").length>1)for(const a of t)i.push(n+o.replaceAll(/\{subDomain\}/gi,a)+"/")}else i.push(s);return i.map(tEt)}get urlPath(){if(!this.urlTemplate)return null;const i=this.urlTemplate,e=new Qy(i),t=(e.scheme?e.scheme+"://":"//")+e.authority+"/";return i.substring(t.length)}readUrlTemplate(i,e){return i||e.templateUrl}writeUrlTemplate(i,e){Mx(i)&&(i="https:"+i),i&&(i=i.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),i=X1(i)),e.templateUrl=i}fetchTile(i,e,t,r={}){const{signal:n}=r,s=this.getTileUrl(i,e,t),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return zi(s,o).then(a=>a.data)}async fetchImageBitmapTile(i,e,t,r={}){const{signal:n}=r;if(this.fetchTile!==mNe.prototype.fetchTile){const l=await this.fetchTile(i,e,t,r);return ik(l,i,e,t,n)}const s=this.getTileUrl(i,e,t),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await zi(s,o);return ik(a,i,e,t,n)}getTileUrl(i,e,t){const{levelValues:r,tileServers:n,urlPath:s}=this;if(!r||!n||!s)return"";const o=r[i];return n[e%n.length]+m0(s,{level:o,z:o,col:t,x:t,row:e,y:e})}};x([D({type:String,value:"",json:{write:!0}})],tp.prototype,"copyright",void 0),x([D({type:hr,json:{write:!0},nonNullable:!0})],tp.prototype,"fullExtent",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],tp.prototype,"legendEnabled",void 0),x([D({type:["show","hide"]})],tp.prototype,"listMode",void 0),x([D({json:{read:!0,write:!0}})],tp.prototype,"blendMode",void 0),x([D()],tp.prototype,"levelValues",null),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],tp.prototype,"isReference",void 0),x([D({type:["WebTiledLayer"],value:"WebTiledLayer"})],tp.prototype,"operationalLayerType",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],tp.prototype,"popupEnabled",void 0),x([D({type:Xi})],tp.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","fullExtent.spatialReference"])],tp.prototype,"readSpatialReference",null),x([D({type:[String],json:{write:!0}})],tp.prototype,"subDomains",void 0),x([D({type:fu,json:{write:!0}})],tp.prototype,"tileInfo",void 0),x([D({readOnly:!0})],tp.prototype,"tileServers",null),x([D({json:{read:!1}})],tp.prototype,"type",void 0),x([D()],tp.prototype,"urlPath",null),x([D({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],tp.prototype,"urlTemplate",void 0),x([Mi("urlTemplate",["urlTemplate","templateUrl"])],tp.prototype,"readUrlTemplate",null),x([ur("urlTemplate",{templateUrl:{type:String}})],tp.prototype,"writeUrlTemplate",null),x([D({type:zO,json:{write:!0}})],tp.prototype,"wmtsInfo",void 0),tp=mNe=x([Qe("esri.layers.WebTileLayer")],tp);const YHe=tp,opr=Object.freeze(Object.defineProperty({__proto__:null,default:YHe},Symbol.toStringTag,{value:"Module"}));let h1=class extends YHe{constructor(...e){super(...e),this.portalItem=null,this.isReference=null,this.tileInfo=new fu({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new $i({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:Xi.WebMercator}),spatialReference:Xi.WebMercator,lods:[new hs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new hs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new hs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new hs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new hs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new hs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new hs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new hs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new hs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new hs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new hs({level:10,scale:577790.554289,resolution:152.874056570411}),new hs({level:11,scale:288895.277144,resolution:76.4370282850732}),new hs({level:12,scale:144447.638572,resolution:38.2185141425366}),new hs({level:13,scale:72223.819286,resolution:19.1092570712683}),new hs({level:14,scale:36111.909643,resolution:9.55462853563415}),new hs({level:15,scale:18055.954822,resolution:4.77731426794937}),new hs({level:16,scale:9027.977411,resolution:2.38865713397468}),new hs({level:17,scale:4513.988705,resolution:1.19432856685505}),new hs({level:18,scale:2256.994353,resolution:.597164283559817}),new hs({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new hr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,Xi.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};x([D({type:yg,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],h1.prototype,"portalItem",void 0),x([D({type:Boolean,json:{read:!1,write:!1}})],h1.prototype,"isReference",void 0),x([D({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],h1.prototype,"refreshInterval",null),x([D({type:fu,json:{write:!1}})],h1.prototype,"tileInfo",void 0),x([D({type:["show","hide"]})],h1.prototype,"listMode",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],h1.prototype,"subDomains",void 0),x([D({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],h1.prototype,"fullExtent",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],h1.prototype,"urlTemplate",void 0),x([D({type:["OpenStreetMap"]})],h1.prototype,"operationalLayerType",void 0),x([D({json:{read:!1}})],h1.prototype,"type",void 0),x([D({json:{read:!1,write:!1}})],h1.prototype,"copyright",void 0),x([D({json:{read:!1,write:!1}})],h1.prototype,"wmtsInfo",void 0),h1=x([Qe("esri.layers.OpenStreetMapLayer")],h1);const XHe=h1,apr=Object.freeze(Object.defineProperty({__proto__:null,default:XHe},Symbol.toStringTag,{value:"Module"}));let UDt=class{constructor(e,t=0,r=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=r,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(r)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,r){const n=this.tileInfo?.lodAt(e);return!n||ethis.maxLOD?"unavailable":n.cols&&n.rows?r>=n.cols[0]&&r<=n.cols[1]&&t>=n.rows[0]&&t<=n.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,r,n){await vve(n);const s=this.getAvailability(e,t,r);if(s==="unavailable")throw new qe("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:r});return s}async fetchAvailabilityUpsample(e,t,r,n,s){await vve(s),n.level=e,n.row=t,n.col=r;const o=this.tileInfo;return o.updateTileInfo(n),this.fetchAvailability(e,t,r,s).catch(a=>{if(mo(a))throw a;if(o.upsampleTile(n))return this.fetchAvailabilityUpsample(n.level,n.row,n.col,n,s);throw a})}};var RW;(function(i){i[i.KILOBYTES=1024]="KILOBYTES",i[i.MEGABYTES=1048576]="MEGABYTES",i[i.GIGABYTES=1073741824]="GIGABYTES"})(RW||(RW={}));function lpr(i,e=!1){return i<=a3?e?new Array(i).fill(0):new Array(i):new Uint32Array(i)}let fat=class gNe{constructor(e){this._validateJSON(e);const{location:t,data:r}=e;this.location=Object.freeze(li(t));const n=this.location.width,s=this.location.height;let o=!0,a=!0;const l=Math.ceil(n*s/32),u=lpr(l);let c=0;for(let h=0;h>5,o=this._availability;return s<0||s>o.length?"unknown":o[s]&1<u.data).catch(u=>{if(u&&u.details&&u.details.httpStatus===422)return{location:{top:n,left:s,width:o,height:a},valid:!0,data:lVi(o*a,0)};throw u}).then(u=>{if(u.location&&(u.location.top!==n||u.location.left!==s||u.location.width!==o||u.location.height!==a))throw new qe("tilemap:location-mismatch","Tilemap response for different location than requested",{response:u,definition:{top:n,left:s,width:o,height:a}});return gNe.fromJSON(u)})}static fromJSON(e){return Object.freeze(new gNe(e))}_validateJSON(e){if(!e?.location)throw new qe("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new qe("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new qe("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new qe("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new qe("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}};function mat(i){return`${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`}function upr(i){let e;if(i.service.tileServers?.length){const r=i.service.tileServers;e=`${r&&r.length?r[i.row%r.length]:i.service.url}/tilemap/${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`}else e=`${i.service.url}/tilemap/${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`;const t=i.service.query;return t&&(e=`${e}?${t}`),e}var M6;let Vw=M6=class extends un{constructor(i){super(i),this._pendingTilemapRequests={},this.request=zi,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new d3(2*RW.MEGABYTES),this.addHandles(Ki(()=>{const{layer:i}=this;return[i?.parsedUrl,i?.tileServers,i?.apiKey,i?.customParameters]},()=>this._initializeTilemapDefinition(),js))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(i,e,t,r){if(!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD)return Promise.reject(new qe("tilemap-cache:level-unavailable",`Level ${i} is unavailable in the service`));const n=this._tmpTilemapDefinition,s=this._tilemapFromCache(i,e,t,n);if(s)return Promise.resolve(s);const o=r?.signal;return r={...r,signal:null},new Promise((a,l)=>{Qh(o,()=>l(Oc()));const u=mat(n);let c=this._pendingTilemapRequests[u];if(!c){c=fat.fromDefinition(n,r).then(p=>(this._tilemapCache.put(u,p,p.byteSize),p));const h=()=>{delete this._pendingTilemapRequests[u]};this._pendingTilemapRequests[u]=c,c.then(h,h)}c.then(a,l)})}getAvailability(i,e,t){if(!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(i,e,t,this._tmpTilemapDefinition);return r?r.getAvailability(e,t):"unknown"}fetchAvailability(i,e,t,r){return!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD?Promise.reject(new qe("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t})):this.fetchTilemap(i,e,t,r).catch(n=>n).then(n=>{if(n instanceof fat){const s=n.getAvailability(e,t);if(s==="unavailable")throw new qe("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return s}if(mo(n))throw n;return"unknown"})}fetchAvailabilityUpsample(i,e,t,r,n){r.level=i,r.row=e,r.col=t;const s=this.layer.tileInfo;s.updateTileInfo(r);const o=this.fetchAvailability(i,e,t,n).catch(a=>{if(mo(a))throw a;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,n);throw a});return this._fetchAvailabilityUpsamplePrefetch(r.id,i,e,t,n,o),o}async _fetchAvailabilityUpsamplePrefetch(i,e,t,r,n,s){if(!this._prefetchingEnabled||i==null)return;const o=`prefetch-${i}`;if(this.hasHandles(o))return;const a=new AbortController;s.then(()=>a.abort(),()=>a.abort());let l=!1;const u=wa(()=>{l||(l=!0,a.abort())});if(this.addHandles(u,o),await lHi(10,a.signal).catch(()=>{}),l||(l=!0,this.removeHandles(o)),xg(a))return;const c=new jY(i,e,t,r),h={...n,signal:a.signal},p=this.layer.tileInfo;for(let m=0;M6._prefetches.length{M6._prefetches.removeUnordered(v)};v.then(w,w)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:i,apiKey:e,customParameters:t}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:i.path,query:Lb({...i.query,...t,token:e??i.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(i,e,t,r){r.level=i,r.row=e-e%this.size,r.col=t-t%this.size;const n=mat(r);return this._tilemapCache.get(n)}get test(){const i=this;return{get prefetchingEnabled(){return i._prefetchingEnabled},set prefetchingEnabled(e){i._prefetchingEnabled=e},hasTilemap:(e,t,r)=>!!i._tilemapFromCache(e,t,r,i._tmpTilemapDefinition)}}};Vw._maxPrefetch=4,Vw._prefetches=new mg({initialSize:M6._maxPrefetch}),x([D({constructOnly:!0})],Vw.prototype,"layer",void 0),x([D({constructOnly:!0})],Vw.prototype,"minLOD",void 0),x([D({constructOnly:!0})],Vw.prototype,"maxLOD",void 0),x([D({constructOnly:!0})],Vw.prototype,"request",void 0),x([D({constructOnly:!0})],Vw.prototype,"size",void 0),Vw=M6=x([Qe("esri.layers.support.TilemapCache")],Vw);const JHe=i=>{let e=class extends i{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(t,r){return r.minLOD!=null&&r.maxLOD!=null?t:0}readMaxScale(t,r){return r.minLOD!=null&&r.maxLOD!=null?t:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(t,r,n){const s=r.capabilities?.includes("Tilemap");let{minLOD:o,maxLOD:a,minScale:l,maxScale:u}=r;if(o==null&&a==null&&l!==0&&u!==0){const c=h=>Math.round(1e4*h)/1e4;l=c(l||r.tileInfo.lods[0].scale),u=c(u||r.tileInfo.lods[r.tileInfo.lods.length-1].scale);for(const h of r.tileInfo.lods){const p=c(h.scale);o=p>=l?h.level:o,a=p>=u?h.level:a}}if(s)return new Vw({layer:this,minLOD:o,maxLOD:a});if(r.tileInfo){const c=new fu;return c.read(r.tileInfo,n),new UDt(c,o,a)}return null}};return x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D()],e.prototype,"minScale",void 0),x([Mi("service","minScale")],e.prototype,"readMinScale",null),x([D()],e.prototype,"maxScale",void 0),x([Mi("service","maxScale")],e.prototype,"readMaxScale",null),x([D({type:Xi})],e.prototype,"spatialReference",void 0),x([D({readOnly:!0})],e.prototype,"supportsBlankTile",null),x([D({type:fu})],e.prototype,"tileInfo",void 0),x([D()],e.prototype,"tilemapCache",void 0),x([Mi("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),x([D()],e.prototype,"version",void 0),e=x([Qe("esri.layers.mixins.ArcGISCachedService")],e),e};var yNe;const gat=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let af=yNe=class extends xh(uc(jDt(JHe(_Dt(Rc(Yc(Xv(Ql(fy(Wx(py(Il)))))))))))){constructor(...i){super(...i),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}load(i){const e=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},i).catch(_a).then(()=>this._fetchService(e))),Promise.resolve(this)}get attributionDataUrl(){const i=this.parsedUrl?.path.toLowerCase();return i?this._getDefaultAttribution(this._getMapName(i)):null}readSpatialReference(i,e){return(i=i||e.tileInfo?.spatialReference)&&Xi.fromJSON(i)}writeSublayers(i,e,t,r){if(!this.loaded||!i)return;const n=i.slice().reverse().flatten(({sublayers:a})=>a&&a.toArray().reverse()).toArray(),s=[],o={writeSublayerStructure:!1,...r};n.forEach(a=>{const l=a.write({},o);s.push(l)}),s.some(a=>Object.keys(a).length>1)&&(e.layers=s)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(i){return Array.isArray(i)?i.map(e=>Yo(e).path):null}fetchTile(i,e,t,r={}){const{signal:n}=r,s=this.getTileUrl(i,e,t),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return zi(s,o).then(a=>a.data)}async fetchImageBitmapTile(i,e,t,r={}){const{signal:n}=r;if(this.fetchTile!==yNe.prototype.fetchTile){const l=await this.fetchTile(i,e,t,r);return ik(l,i,e,t,n)}const s=this.getTileUrl(i,e,t),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await zi(s,o);return ik(a,i,e,t,n)}getTileUrl(i,e,t){const r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,n=Lb({...this.parsedUrl?.query,blankTile:!r&&null,...this.customParameters,token:this.apiKey}),s=this.tileServers;return`${s&&s.length?s[e%s.length]:this.parsedUrl?.path}/tile/${i}/${e}/${t}${n?"?"+n:""}`}loadAll(){return VB(this,i=>{i(this.allSublayers)})}_fetchService(i){return new Promise((e,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new qe("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void e({data:this.sourceJSON})}if(!this.parsedUrl)throw new qe("tile-layer:undefined-url","layer's url is not defined");const r=r_(this.parsedUrl.path);if(r!=null&&r.serverType==="ImageServer")throw new qe("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");zi(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(e,t)}).then(e=>{let t=this.url;if(e.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=e.data,this.read(e.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!Fx(t))return this._fetchServerVersion(t,i).then(r=>{this.read({currentVersion:r})}).catch(()=>{})})}_fetchServerVersion(i,e){if(!pOt(i))return Promise.reject();const t=i.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return zi(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r=>{if(r.data&&r.data.currentVersion)return r.data.currentVersion;throw new qe("tile-layer:version-not-available")})}_getMapName(i){const e=i.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return e?e[2]:void 0}_getDefaultAttribution(i){if(i==null)return null;let e;i=i.toLowerCase();for(let t=0,r=gat.length;t({enabled:!1})}}})],af.prototype,"isReference",void 0),x([D({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],af.prototype,"operationalLayerType",void 0),x([D({type:Boolean})],af.prototype,"resampling",void 0),x([D()],af.prototype,"sourceJSON",void 0),x([D({type:Xi})],af.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","tileInfo"])],af.prototype,"readSpatialReference",null),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],af.prototype,"path",void 0),x([D({readOnly:!0})],af.prototype,"sublayers",void 0),x([ur("sublayers",{layers:{type:[Lae]}})],af.prototype,"writeSublayers",null),x([D({json:{read:!1,write:!1}})],af.prototype,"popupEnabled",void 0),x([D()],af.prototype,"tileServers",null),x([So("tileServers")],af.prototype,"castTileServers",null),x([D({readOnly:!0,json:{read:!1}})],af.prototype,"type",void 0),x([D(C0)],af.prototype,"url",void 0),af=yNe=x([Qe("esri.layers.TileLayer")],af);const zDt=Symbol("default-fetch-tile");af.prototype.fetchTile[zDt]=!0;const KHe=af,cpr=Object.freeze(Object.defineProperty({__proto__:null,default:KHe},Symbol.toStringTag,{value:"Module"})),hpr=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function DW(i){return i!=null&&hpr.some(([e,t])=>i>=e&&i<=t)}const dpr={visible:"visibleSublayers"};let QI=class extends un{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",t=>this.notifyChange(dpr[t.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:t}=this,r=e?.sublayers,n=[],s=o=>{const{minScale:a,maxScale:l,sublayers:u,visible:c}=o;c&&(t===0||(a===0||t<=a)&&(l===0||t>=l))&&(u?u.forEach(s):n.push(o))};return r?.forEach(s),n}toJSON(){const{layer:e,layers:t}=this,{imageFormat:r,imageTransparency:n,version:s}=e;return{format:r,request:"GetMap",service:"WMS",styles:"",transparent:n?"TRUE":"FALSE",version:s,layers:t}}};x([D()],QI.prototype,"layer",null),x([D({readOnly:!0})],QI.prototype,"layers",null),x([D({type:Number})],QI.prototype,"scale",void 0),x([D({readOnly:!0})],QI.prototype,"version",null),x([D({readOnly:!0})],QI.prototype,"visibleSublayers",null),QI=x([Qe("esri.layers.support.ExportWMSImageParameters")],QI);var age;let ppr=0,Pd=age=class extends iT(f1e){constructor(i){super(i),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([ju(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},Kl),ju(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},Kl),Ki(()=>this.sublayers,(e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer},Kl),Ki(()=>this.layer,e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e},Kl)])}get id(){return this._get("id")??ppr++}set id(i){this._set("id",i)}readLegendUrl(i,e){return e.legendUrl??e.legendURL??null}get effectiveScaleRange(){const{minScale:i,maxScale:e}=this;return{minScale:i,maxScale:e}}castSublayers(i){return Sd(dr.ofType(age),i)}set visible(i){this._setAndNotifyLayer("visible",i)}clone(){const i=new age;return this.hasOwnProperty("description")&&(i.description=this.description),this.hasOwnProperty("fullExtent")&&(i.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(i.fullExtents=this.fullExtents?.map(e=>e.clone())??null),this.hasOwnProperty("legendUrl")&&(i.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(i.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(i.layer=this.layer),this.hasOwnProperty("name")&&(i.name=this.name),this.hasOwnProperty("parent")&&(i.parent=this.parent),this.hasOwnProperty("queryable")&&(i.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(i.sublayers=this.sublayers?.map(e=>e.clone())),this.hasOwnProperty("spatialReferences")&&(i.spatialReferences=this.spatialReferences?.map(e=>e)),this.hasOwnProperty("visible")&&(i.visible=this.visible),this.hasOwnProperty("title")&&(i.title=this.title),i}_setAndNotifyLayer(i,e){const t=this.layer;this._get(i)!==e&&(this._set(i,e),t&&t.emit("wms-sublayer-update",{propertyName:i,id:this.id}))}};x([D()],Pd.prototype,"description",void 0),x([D({readOnly:!0})],Pd.prototype,"dimensions",void 0),x([D({type:hr,json:{name:"extent"}})],Pd.prototype,"fullExtent",void 0),x([D()],Pd.prototype,"fullExtents",void 0),x([D({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],Pd.prototype,"id",null),x([D({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],Pd.prototype,"legendUrl",void 0),x([Mi("legendUrl",["legendUrl","legendURL"])],Pd.prototype,"readLegendUrl",null),x([D({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],Pd.prototype,"legendEnabled",void 0),x([D()],Pd.prototype,"layer",void 0),x([D()],Pd.prototype,"maxScale",void 0),x([D()],Pd.prototype,"minScale",void 0),x([D({readOnly:!0})],Pd.prototype,"effectiveScaleRange",null),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"name",void 0),x([D()],Pd.prototype,"parent",void 0),x([D({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],Pd.prototype,"popupEnabled",void 0),x([D({type:Boolean,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"queryable",void 0),x([D()],Pd.prototype,"sublayers",void 0),x([So("sublayers")],Pd.prototype,"castSublayers",null),x([D({type:[Number],json:{read:{source:"spatialReferences"}}})],Pd.prototype,"spatialReferences",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"title",void 0),x([D({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],Pd.prototype,"visible",null),Pd=age=x([Qe("esri.layers.support.WMSSublayer")],Pd);const vNe=Pd,yat={84:4326,83:4269,27:4267};function fpr(i){if(!i)return null;const e={idCounter:-1};typeof i=="string"&&(i=new DOMParser().parseFromString(i,"text/xml"));const t=i.documentElement;if(t.nodeName==="ServiceExceptionReport"){const be=Array.prototype.slice.call(t.childNodes).map(_e=>_e.textContent).join(`\r -`);throw new qe("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",be)}const r=Fv("Capability",t),n=Fv("Service",t),s=r&&Fv("Request",r);if(!r||!n||!s)return null;const o=Fv("Layer",r);if(!o)return null;const a=t.nodeName==="WMS_Capabilities"||t.nodeName==="WMT_MS_Capabilities"?t.getAttribute("version"):"1.3.0",l=sA("Title",n,"")||sA("Name",n,""),u=sA("AccessConstraints",n,""),c=/^none$/i.test(u)?"":u,h=sA("Abstract",n,""),p=parseInt(sA("MaxWidth",n,"5000"),10),m=parseInt(sA("MaxHeight",n,"5000"),10),v=_at(s,"GetMap"),w=vat(s,"GetMap"),S=LQ(o,a,e);if(!S)return null;let I,R=0;const L=Array.prototype.slice.call(r.childNodes),k=S.sublayers??[],B=be=>{be!=null&&k.push(be)};L.forEach(be=>{be.nodeName==="Layer"&&(R===0?I=be:(R===1&&S.name&&(S.name="",B(LQ(I,a,e))),B(LQ(be,a,e))),R++)});let $=S.sublayers,V=S.extent;const Y=S.fullExtents??[];if($||($=[]),$.length===0&&$.push(S),!V){const be=new hr($[0].extent);S.extent=be.toJSON(),V=S.extent}const K=S.spatialReferences.length>0?S.spatialReferences:VDt(S),Q=vat(s,"GetFeatureInfo"),re=Q?_at(s,"GetFeatureInfo"):null,ne=HDt($),de=S.minScale||0,pe=S.maxScale||0,H=S.dimensions??[],Z=ne.reduce((be,_e)=>be.concat(_e.dimensions??[]),[]),ae=H.concat(Z).filter(qDt);let fe=null;if(ae.length){const be=ae.map(_e=>{const{extent:Ie}=_e;return ypr(Ie)?Ie.map(Te=>Te.getTime()):Ie?.map(Te=>[Te.min.getTime(),Te.max.getTime()])}).flat(2).filter(Ga);fe={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...be),Math.max(...be)]}}return{copyright:c,description:h,dimensions:H,extent:V,fullExtents:Y,featureInfoFormats:re,featureInfoUrl:Q,mapUrl:w,maxWidth:p,maxHeight:m,maxScale:pe,minScale:de,layers:ne,spatialReferences:K,supportedImageFormatTypes:v,timeInfo:fe,title:l,version:a}}function mpr(i){const e=i.filter(t=>t.popupEnabled&&t.name&&t.queryable);return e.length?e.map(({name:t})=>t).join():null}function VDt(i){if(i.spatialReferences.length>0)return i.spatialReferences;if(i.sublayers)for(const e of i.sublayers){const t=VDt(e);if(t.length>0)return t}return[]}function HDt(i){let e=[];for(const t of i)e.push(t),t.sublayers?.length&&(e=e.concat(HDt(t.sublayers)),delete t.sublayers);return e}function lge(i,e,t){return e.getAttribute(i)??t}function gpr(i,e,t,r){const n=Fv(i,t);return n?lge(e,n,r):r}function Fv(i,e){for(let t=0;tn).filter(Ga);const r=[];for(const n of t)if(n.getAttribute("name")===e){const s=uge("Format",n);for(const{textContent:o}of s)o!=null&&r.push(o)}return r}function bat(i,e,t){const r=Fv(e,i);if(!r)return t;const{textContent:n}=r;if(n==null||n==="")return t;const s=Number(n);return isNaN(s)?t:s}function LQ(i,e,t){if(!i)return null;const r={id:t.idCounter++,fullExtents:[],parentLayerId:null,queryable:i.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},n=Fv("LatLonBoundingBox",i),s=Fv("EX_GeographicBoundingBox",i);let o=null;n&&(o=jJ(n,4326)),s&&(o=new hr(0,0,0,0,new Xi({wkid:4326})),o.xmin=parseFloat(sA("westBoundLongitude",s,"0")),o.ymin=parseFloat(sA("southBoundLatitude",s,"0")),o.xmax=parseFloat(sA("eastBoundLongitude",s,"0")),o.ymax=parseFloat(sA("northBoundLatitude",s,"0"))),n||s||(o=new hr(-180,-90,180,90,new Xi({wkid:4326}))),r.minScale=bat(i,"MaxScaleDenominator",0),r.maxScale=bat(i,"MinScaleDenominator",0);const a=["1.0.0","1.1.0","1.1.1"].includes(e)?"SRS":"CRS";return Array.prototype.slice.call(i.childNodes).forEach(l=>{if(l.nodeName==="Name")r.name=l.textContent||"";else if(l.nodeName==="Title")r.title=l.textContent||"";else if(l.nodeName==="Abstract")r.description=l.textContent||"";else if(l.nodeName==="BoundingBox"){const u=l.getAttribute(a);if(u&&u.indexOf("EPSG:")===0){const h=parseInt(u.substring(5),10);h===0||isNaN(h)||o||(o=e==="1.3.0"?jJ(l,h,DW(h)):jJ(l,h))}const c=u&&u.indexOf(":");if(c&&c>-1){let h=parseInt(u.substring(c+1,u.length),10);h===0||isNaN(h)||(h=yat[h]??h);const p=e==="1.3.0"?jJ(l,h,DW(h)):jJ(l,h);p&&r.fullExtents&&r.fullExtents.push(p)}}else if(l.nodeName===a)(l.textContent?.split(" ")??[]).forEach(u=>{const c=u.includes(":")?parseInt(u.split(":")[1],10):parseInt(u,10);if(c!==0&&!isNaN(c)){const h=yat[c]??c;r.spatialReferences.includes(h)||r.spatialReferences.push(h)}});else if(l.nodeName!=="Style"||r.legendUrl){if(l.nodeName==="Layer"){const u=LQ(l,e,t);u&&(u.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(u))}}else{const u=Fv("LegendURL",l);if(u){const c=Fv("OnlineResource",u);c&&(r.legendUrl=c.getAttribute("xlink:href"))}}}),r.extent=o?.toJSON(),r.dimensions=uge("Dimension",i).filter(l=>l.getAttribute("name")&&l.getAttribute("units")&&l.textContent).map(l=>{const u=l.getAttribute("name"),c=l.getAttribute("units"),h=l.textContent,p=l.getAttribute("unitSymbol")??void 0,m=l.getAttribute("default")??void 0,v=lge("default",l,"0")!=="0",w=lge("nearestValue",l,"0")!=="0",S=lge("current",l,"0")!=="0";return qDt({name:u,units:c})?{name:"time",units:"ISO8601",extent:Sat(h),default:Sat(m),multipleValues:v,nearestValue:w,current:S}:vpr({name:u,units:c})?{name:"elevation",units:c,extent:wat(h),unitSymbol:p,default:wat(m),multipleValues:v,nearestValue:w}:{name:u,units:c,extent:xat(h),unitSymbol:p,default:xat(m),multipleValues:v,nearestValue:w}}),r}function ypr(i){return Array.isArray(i)&&i.length>0&&i[0]instanceof Date}function WDt(i){return i.nodeType===Node.ELEMENT_NODE}function vpr(i){return/^elevation$/i.test(i.name)&&/^(epsg|crs):\d+$/i.test(i.units)}function qDt(i){return/^time$/i.test(i.name)&&/^iso8601$/i.test(i.units)}function _pr(i,e){const t=[],r=Yo(i);for(const n in r.query)r.query.hasOwnProperty(n)&&(e.includes(n.toLowerCase())||t.push(n+"="+r.query[n]));return r.path+(t.length?"?"+t.join("&"):"")}function wat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:parseFloat(n[0]),max:parseFloat(n[1]),resolution:n.length>=3&&n[2]!=="0"?parseFloat(n[2]):void 0}}).filter(Ga):t.map(r=>parseFloat(r))}function xat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:n[0],max:n[1],resolution:n.length>=3&&n[2]!=="0"?n[2]:void 0}}).filter(Ga):t}function Sat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:new Date(n[0]),max:new Date(n[1]),resolution:n.length>=3&&n[2]!=="0"?bpr(n[2]):void 0}}).filter(Ga):t.map(r=>new Date(r))}function bpr(i){const e=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,t=i.match(e);return t?{years:pj(t[1]),months:pj(t[2]),days:pj(t[3]),hours:pj(t[4]),minutes:pj(t[5]),seconds:pj(t[6])}:null}function pj(i){if(!i)return 0;const e=/(?:\d+(?:\.|,)\d+|\d+)/,t=i.match(e);if(!t)return 0;const r=t[0].replace(",",".");return Number(r)}function fj(i){return i.toISOString().replace(/\.[0-9]{3}/,"")}const Tat=new Set([102100,3857,102113,900913]),wpr=new Set([3395,54004]);function xpr(i,e){let t=i.wkid;return e==null?t:(t!=null&&e.includes(t)||!i.latestWkid||(t=i.latestWkid),t!=null&&Tat.has(t)?e.find(r=>Tat.has(r))||e.find(r=>wpr.has(r))||102100:t)}const lMe=new Rs({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function Cat(i){return i==="text/html"}function Eat(i){return i==="text/plain"}let ql=class extends xh(AE(fy(uc(Rc(Yc(Ql(Il))))))){constructor(...e){super(...e),this.allSublayers=new _E({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([ju(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},Kl),ju(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},Kl),Ki(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},Kl)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new hr({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(Cat)??this.featureInfoFormats.find(Eat)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(Cat(e)||Eat(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new Xi(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return Iat(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return Iat(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const s=new Map,o=e.flatten(({sublayers:a})=>a??[]);for(const a of o)if(typeof a.parent?.id=="number"){const l=s.get(a.parent.id);l!=null?l.push(a.id):s.set(a.parent.id,[a.id])}for(const a of o){const l={sublayer:a,...n},u=a.write({parentLayerId:typeof a.parent?.id=="number"?a.parent.id:-1},l);if(s.has(a.id)&&(u.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const c=a.write({},l);delete c.id,t.layers.push(c)}}t.visibleLayers=o.filter(({visible:a,sublayers:l})=>a&&!l).map(({name:a})=>a).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=Yo(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const n=gg(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const s=n?.pixelRatio??1,o=M1e({extent:e,width:t})*s,a=new QI({layer:this,scale:o}),{xmin:l,ymin:u,xmax:c,ymax:h,spatialReference:p}=e,m=xpr(p,this.spatialReferences),v=this.version==="1.3.0"&&DW(m)?`${u},${l},${h},${c}`:`${l},${u},${c},${h}`,w=a.toJSON();return{bbox:v,[this.version==="1.3.0"?"crs":"srs"]:m==null||isNaN(m)?void 0:"EPSG:"+m,...w}}async fetchImage(e,t,r,n){const s=this.mapUrl,o=this.createExportImageParameters(e,t,r,n);if(!o.layers){const h=document.createElement("canvas");return h.width=t,h.height=r,h}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,u=a!=null&&l!=null?a.getTime()===l.getTime()?fj(a):`${fj(a)}/${fj(l)}`:void 0,c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...o,time:u,...this.refreshParameters}),signal:n?.signal};return zi(s??"",c).then(h=>h.data)}async fetchImageBitmap(e,t,r,n){const s=this.mapUrl??"",o=this.createExportImageParameters(e,t,r,n);if(!o.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,u=a!=null&&l!=null?a.getTime()===l.getTime()?fj(a):`${fj(a)}/${fj(l)}`:void 0,c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...o,time:u,...this.refreshParameters}),signal:n?.signal},{data:h}=await zi(s,c);return E1e(h,s,n?.signal)}fetchFeatureInfo(e,t,r,n,s){const o=M1e({extent:e,width:t}),a=new QI({layer:this,scale:o}),l=mpr(a.visibleSublayers);if(this.featureInfoUrl==null||l==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const u=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},c={query_layers:l,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...u},h={...this.createExportImageParameters(e,t,r),...c},p=this._mixCustomParameters(h);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(p):this._defaultFetchFeatureInfoFunction(gg(this.featureInfoUrl,p))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return inr(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?Xi.WebMercator:new Xi({wkid:t});return Ya(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=JCt(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new qc({title:this.title,content:t}),n=new Us({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await zi(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=fpr(n)}if(this.parsedUrl){const t=new Qy(this.parsedUrl.path),{httpsDomains:r}=Ho.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function Spr(i,e){return i.some(t=>{for(const r in t)if(zCt(t,r,null,e))return!0;return!1})}function Iat(i,e,t){i=i??[];const r=new Map;i.every(s=>s.id==null)&&(i=li(i)).forEach((s,o)=>s.id=o);for(const s of i){const o=new vNe;o.read(s,e),t&&!t.includes(o.name)&&(o.visible=!1),r.set(o.id,o)}const n=[];for(const s of i){const o=s.id!=null?r.get(s.id):null;if(o)if(s.parentLayerId!=null&&s.parentLayerId>=0){const a=r.get(s.parentLayerId);if(!a)continue;a.sublayers||(a.sublayers=new dr),a.sublayers.push(o)}else n.push(o)}return n}x([D({readOnly:!0})],ql.prototype,"allSublayers",void 0),x([D({json:{type:Object,write:!0}})],ql.prototype,"customParameters",void 0),x([D({json:{type:Object,write:!0}})],ql.prototype,"customLayerParameters",void 0),x([D({type:String,json:{write:!0}})],ql.prototype,"copyright",void 0),x([D()],ql.prototype,"description",void 0),x([D({readOnly:!0})],ql.prototype,"dimensions",void 0),x([D({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],ql.prototype,"fullExtent",void 0),x([Mi(["web-document","portal-item"],"fullExtent",["extent"])],ql.prototype,"readFullExtentFromItemOrMap",null),x([ur(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],ql.prototype,"writeFullExtent",null),x([D()],ql.prototype,"fullExtents",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],ql.prototype,"featureInfoFormat",null),x([D({type:[String],readOnly:!0})],ql.prototype,"featureInfoFormats",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],ql.prototype,"featureInfoUrl",void 0),x([D()],ql.prototype,"fetchFeatureInfoFunction",void 0),x([D({type:String,json:{origins:{"web-document":{default:"image/png",type:lMe.jsonValues,read:{reader:lMe.read,source:"format"},write:{writer:lMe.write,target:"format"}}}}})],ql.prototype,"imageFormat",void 0),x([Mi("imageFormat",["supportedImageFormatTypes"])],ql.prototype,"readImageFormat",null),x([D({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],ql.prototype,"imageMaxHeight",void 0),x([D({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],ql.prototype,"imageMaxWidth",void 0),x([D()],ql.prototype,"imageTransparency",void 0),x([D(d_)],ql.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"]})],ql.prototype,"listMode",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],ql.prototype,"mapUrl",void 0),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ql.prototype,"isReference",void 0),x([D({type:["WMS"]})],ql.prototype,"operationalLayerType",void 0),x([D()],ql.prototype,"resourceInfo",void 0),x([D({type:Xi,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],ql.prototype,"spatialReference",void 0),x([Mi(["web-document","portal-item"],"spatialReference",["spatialReferences"])],ql.prototype,"readSpatialReferenceFromItemOrDocument",null),x([D({type:[ms],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],ql.prototype,"spatialReferences",void 0),x([ur(["web-document","portal-item"],"spatialReferences")],ql.prototype,"writeSpatialReferences",null),x([D({type:dr.ofType(vNe),json:{write:{target:"layers",overridePolicy(i,e,t){if(Spr(this.allSublayers,t))return{ignoreOrigin:!0}}}}})],ql.prototype,"sublayers",void 0),x([Mi(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],ql.prototype,"readSublayersFromItemOrMap",null),x([Mi("service","sublayers",["layers"])],ql.prototype,"readSublayers",null),x([ur("sublayers",{layers:{type:[vNe]},visibleLayers:{type:[String]}})],ql.prototype,"writeSublayers",null),x([D({json:{read:!1},readOnly:!0,value:"wms"})],ql.prototype,"type",void 0),x([D(C0)],ql.prototype,"url",null),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],ql.prototype,"version",void 0),ql=x([Qe("esri.layers.WMSLayer")],ql);const YDt=ql,Tpr=Object.freeze(Object.defineProperty({__proto__:null,default:YDt},Symbol.toStringTag,{value:"Module"}));var _Ne;let cge=_Ne=class extends Ci{constructor(i){super(i),this.type="none"}clone(){return new _Ne({type:this.type})}};x([Wr({none:"none",stayAbove:"stay-above"})],cge.prototype,"type",void 0),cge=_Ne=x([Qe("esri.ground.NavigationConstraint")],cge);var bNe;let aO=bNe=class extends S0(ef){constructor(i){super(i),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new dr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&di.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},t=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>e(r.item)),this.layers.on("after-remove",r=>t(r.item))])}initialize(){this.when().catch(i=>{mo(i)||di.getLogger(this).error("#load()","Failed to load ground",i)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const i=this.layers.removeAll();for(const e of i)zo(e);this.layers.destroy()}normalizeCtorArgs(i){return i&&"resourceInfo"in i&&(this._set("resourceInfo",i.resourceInfo),delete(i={...i}).resourceInfo),i}set layers(i){this._set("layers",ay(i,this._get("layers")))}writeLayers(i,e,t,r){const n=[];i&&(r={...r,layerContainerType:"ground"},i.forEach(s=>{if("write"in s){const o={};Fer(s)().write(o,r)&&n.push(o)}else r?.messages&&r.messages.push(new qe("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(i){return this.addResolvingPromise(this._loadFromSource(i)),Promise.resolve(this)}loadAll(){return VB(this,i=>{i(this.layers)})}async queryElevation(i,e){await this.load({signal:e?.signal});const{ElevationQuery:t}=await Promise.resolve().then(()=>Zbe);hn(e);const r=new t,n=this.layers.filter(Aat).toArray();return r.queryAll(n,i,e)}async createElevationSampler(i,e){await this.load({signal:e?.signal});const{ElevationQuery:t}=await Promise.resolve().then(()=>Zbe);hn(e);const r=new t,n=this.layers.filter(Aat).toArray();return r.createSamplerAll(n,i,e)}clone(){const i={opacity:this.opacity,surfaceColor:li(this.surfaceColor),navigationConstraint:li(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(i.loadStatus="loaded"),new bNe({resourceInfo:this.resourceInfo}).set(i)}read(i,e){this.resourceInfo||this._set("resourceInfo",{data:i,context:e}),super.read(i,e)}_loadFromSource(i){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,i):Promise.resolve()}async _loadLayersFromJSON(i,e,t){const r=e?.origin||"web-scene",n=e?.portal||null,s=e?.url||null,{populateOperationalLayers:o}=await Promise.resolve().then(()=>T8t);hn(t);const a=[];if(i.layers&&Array.isArray(i.layers)){const l={context:{origin:r,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,i.layers,l))}await Promise.allSettled(a)}};function Cpr(i){return i&&"createElevationSampler"in i}function Aat(i){return i.type==="elevation"||Cpr(i)}x([D({json:{read:!1}})],aO.prototype,"layers",null),x([ur("layers")],aO.prototype,"writeLayers",null),x([D({readOnly:!0})],aO.prototype,"resourceInfo",void 0),x([D({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:ms,read:{reader:vW,source:"transparency"},write:{writer:(i,e)=>{e.transparency=E2e(i)},target:"transparency"}}})],aO.prototype,"opacity",void 0),x([D({type:jr,json:{type:[ms],write:(i,e)=>{e.surfaceColor=i.toJSON().slice(0,3)}}})],aO.prototype,"surfaceColor",void 0),x([D({type:cge,json:{write:!0}})],aO.prototype,"navigationConstraint",void 0),aO=bNe=x([Qe("esri.Ground")],aO);const P1e=aO;function Epr(i){return!(!(i&&typeof i=="object"&&"loaded"in i&&i.loaded&&tT(i)?.operations?.supportsEditing&&"type"in i)||"editingEnabled"in i&&!GEt(i))}const Mat=()=>di.getLogger("esri.support.basemapUtils");function Ipr(){return{}}function Apr(i){for(const e in i){const t=i[e];zo(t),delete i[e]}}function Mpr(i,e){let t;if(typeof i=="string"){const r=i in v5e,n=!r&&i.includes("/");if(!r&&!n){const s=Object.entries(v5e).filter(([o,a])=>Ho.apiKey&&!a.classic||!Ho.apiKey&&(a.classic||a.is3d)).map(([o])=>`"${o}"`).sort().join(", ");return Mat().warn(`Unable to find basemap definition for: ${i}. Try one of these: ${s}`),null}e&&(t=e[i]),t||(t=r?kV.fromId(i):new kV({style:{id:i}}),e&&(e[i]=t))}else t=Sd(kV,i);return t?.destroyed&&(Mat().warn("The provided basemap is already destroyed",{basemap:t}),t=null),t}function XDt(i){return new _E({getCollections:()=>[i.tables,i.layers],getChildrenFunction:e=>{const t=[];return"tables"in e&&t.push(e.tables),"layers"in e&&t.push(e.layers),t},itemFilterFunction:e=>{const t=e.parent;return!!t&&"tables"in t&&t.tables.includes(e)}})}function uMe(i){for(const e of i.values())e?.destroy();i.clear()}const Oat={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function Opr(i){let e=null;if(typeof i=="string")if(i in Oat){const t=Oat[i];e=new P1e({resourceInfo:{data:{layers:[t]}}})}else di.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${i}. Try "world-elevation"`);else e=Sd(P1e,i);return e}function wNe(i,e,t){let r,n;if(i)for(let s=0,o=i.length;s{let e=class extends i{constructor(...t){super(...t),this.layers=new dr;const r=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},n=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||di.getLogger(this).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},s=o=>{o.parent=null,this.layerRemoved(o)};this.addHandles([this.layers.on("before-add",o=>r(o.item)),this.layers.on("after-add",o=>n(o.item)),this.layers.on("after-remove",o=>s(o.item))])}destroy(){const t=this.layers.toArray();for(const r of t)r.destroy();this.layers.destroy()}set layers(t){this._set("layers",ay(t,this._get("layers")))}add(t,r){const n=this.layers;if(r=n.getNextIndex(r),t instanceof Il){const s=t;s.parent===this?this.reorder(s,r):n.add(s,r)}else qp(t)?t.then(s=>{this.destroyed||this.add(s,r)}):di.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(t,r){const n=this.layers;let s=n.getNextIndex(r);t.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(t){return wNe(this.layers,"id",t)}findLayerByUid(t){return wNe(this.layers,"uid",t)}remove(t){return this.layers.remove(t)}removeMany(t){return this.layers.removeMany(t)}removeAll(){return this.layers.removeAll()}reorder(t,r){return this.layers.reorder(t,r)}layerAdded(t){}layerRemoved(t){}};return x([D()],e.prototype,"layers",null),e=x([Qe("esri.support.LayersMixin")],e),e};function xNe(i,e,t){if(i)for(let r=0,n=i.length;r{let e=class extends i{constructor(...t){super(...t),this.tables=new dr,this.addHandles([this.tables.on("after-add",r=>{const n=r.item;n.parent&&n.parent!==this&&"tables"in n.parent&&n.parent.tables.remove(n),n.parent=this,n.type!=="feature"&&di.getLogger(this).error(`Layer 'title:${n.title}, id:${n.id}' of type '${n.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const t=this.tables.toArray();for(const r of t)r.destroy();this.tables.destroy()}set tables(t){this._set("tables",ay(t,this._get("tables")))}findTableById(t){return xNe(this.tables,"id",t)}findTableByUid(t){return xNe(this.tables,"uid",t)}};return x([D()],e.prototype,"tables",null),e=x([Qe("esri.support.TablesMixin")],e),e};let YT=class extends KDt(JDt(rd.EventedMixin(un))){constructor(e){super(e),this.allLayers=new _E({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=XDt(this),this.basemap=null,this.editableLayers=new _E({getCollections:()=>[this.allLayers],itemFilterFunction:Epr}),this.ground=new P1e,this._basemapCache=Ipr()}destroy(){Apr(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=zo(this.basemap),zo(this.ground),this._set("ground",null)}castBasemap(e){return Mpr(e,this._basemapCache)}castGround(e){return Opr(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};x([D({readOnly:!0,dependsOn:[]})],YT.prototype,"allLayers",void 0),x([D({readOnly:!0})],YT.prototype,"allTables",void 0),x([D({type:kV,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],YT.prototype,"basemap",void 0),x([So("basemap")],YT.prototype,"castBasemap",null),x([D({readOnly:!0})],YT.prototype,"editableLayers",void 0),x([D({type:P1e,nonNullable:!0})],YT.prototype,"ground",void 0),x([So("ground")],YT.prototype,"castGround",null),x([D()],YT.prototype,"undoRedo",void 0),YT=x([Qe("esri.Map")],YT);const ZDt=YT;async function Ppr(i,e,t,r){return Fpr(e,await Rpr(i,e,t,r),t,r)}async function Rpr(i,e,t,r){const n={...r},s=kpr(e,t),o=e.outStatistics?.[0]!=null,a=yi("featurelayer-pbf-statistics"),l=!o||a;let u;if(t?.format==="pbf"&&l)try{u=await kDt(i,s,n)}catch(c){if(c.name!=="query:parsing-pbf")throw c;t.format="json"}return t?.format!=="json"&&l||(u=await RHe(i,s,n)),Dpr(t?.fieldsIndex,u.fields),u}function Dpr(i,e){if(i!=null&&e!=null)for(const t of e){const r=i.get(t.name);r&&Object.assign(t,r.toJSON())}}async function Fpr(i,e,t,r){const n=t?.infoFor3D;if(!QDt(i,n)||n==null||!e.assetMaps||!e.features?.length)return du.fromJSON(e);const{meshFeatureSetFromJSON:s}=await Jg(Promise.resolve().then(()=>tqt),r);return s(i,n,e)}function kpr(i,e){let t=Kn.from(i);t.sourceSpatialReference=t.sourceSpatialReference??e?.sourceSpatialReference??null,(e?.gdbVersion||e?.dynamicDataSource)&&(t=t===i?t.clone():t,t.gdbVersion=i.gdbVersion||e.gdbVersion,t.dynamicDataSource=i.dynamicDataSource?Ev.from(i.dynamicDataSource):e.dynamicDataSource);const r=e?.infoFor3D;if(r!=null&&QDt(i,r)){t=t===i?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:n,queryFormats:s}=r,o=yR("model/gltf-binary",n)??rk("glb",n),a=yR("model/gltf+json",n)??rk("gtlf",n);for(const l of s){if(l===o){t.formatOf3DObjects=l;break}l!==a||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===i?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:c,translationX:h,translationY:p,translationZ:m,scaleX:v,scaleY:w,scaleZ:S,rotationX:I,rotationY:R,rotationZ:L,rotationDeg:k}=r.transformFieldRoles;t.outFields.push(l,u,c,h,p,m,v,w,S,I,R,L,k)}}return t}function QDt(i,e){return e!=null&&i.returnGeometry===!0&&i.multipatchOption!=="xyFootprint"&&!i.outStatistics}function Lpr(i){const e=i.toJSON();return e.attachmentTypes&&(e.attachmentTypes=e.attachmentTypes.join(",")),e.keywords&&(e.keywords=e.keywords.join(",")),e.globalIds&&(e.globalIds=e.globalIds.join(",")),e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.size&&(e.size=e.size.join(",")),e}function Npr(i,e){const t={};for(const r of e){const{parentObjectId:n,parentGlobalId:s,attachmentInfos:o}=r;for(const a of o){const{id:l}=a,u=JCt(qWi(`${i.path}/${n}/attachments/${l}`)),c=dDt.fromJSON(a);c.set({url:u,parentObjectId:n,parentGlobalId:s}),t[n]?t[n].push(c):t[n]=[c]}}return t}function $pr(i,e,t){let r={query:Dae({...i.query,f:"json",...Lpr(e)})};return t&&(r={...t,...r,query:{...t.query,...r.query}}),zi(i.path+"/queryAttachments",r).then(n=>n.data.attachmentGroups)}async function Bpr(i,e,t){const{objectIds:r}=e,n=[];for(const s of r)n.push(zi(i.path+"/"+s+"/attachments",t));return Promise.all(n).then(s=>r.map((o,a)=>({parentObjectId:o,attachmentInfos:s[a].data.attachmentInfos})))}const jpr=Object.freeze(Object.defineProperty({__proto__:null,executeAttachmentQuery:$pr,fetchAttachments:Bpr,processAttachmentQueryResult:Npr},Symbol.toStringTag,{value:"Module"}));function Gpr(i,e){const t=i.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=Hv(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function Upr(i,e,t){const r=await e4t(i,e,t),n=r.data,s=n.geometryType,o=n.spatialReference,a={};for(const l of n.relatedRecordGroups){const u={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:o,hasZ:!!n.hasZ,hasM:!!n.hasM,features:l.relatedRecords};if(l.objectId!=null)a[l.objectId]=u;else for(const c of Object.keys(l))c!=="relatedRecords"&&(a[l[c]]=u)}return{...r,data:a}}async function zpr(i,e,t){const r=await e4t(i,e,t,{returnCountOnly:!0}),n=r.data,s={};for(const o of n.relatedRecordGroups)o.objectId!=null&&(s[o.objectId]=o.count);return{...r,data:s}}async function e4t(i,e,t={},r){const n=Dae({...i.query,f:"json",...r,...Gpr(e,r)});return zi(i.path+"/queryRelatedRecords",{...t,query:{...t.query,...n}})}async function Vpr(i,e,t){e=p3.from(e);const r=gu(i);return Upr(r,e,t).then(n=>{const s=n.data,o={};return Object.keys(s).forEach(a=>o[a]=du.fromJSON(s[a])),o})}async function Hpr(i,e,t){e=p3.from(e);const r=gu(i);return zpr(r,e,{...t}).then(n=>n.data)}const Pat=Object.freeze(Object.defineProperty({__proto__:null,executeRelationshipQuery:Vpr,executeRelationshipQueryForCount:Hpr},Symbol.toStringTag,{value:"Module"})),Rat="Layer does not support extent calculation.";function Wpr(i,e){const t=i.geometry,r=i.toJSON(),n=r;if(t!=null&&(n.geometry=JSON.stringify(t),n.geometryType=ah(t),n.inSR=Hv(t.spatialReference)),r.topFilter?.groupByFields&&(n.topFilter.groupByFields=r.topFilter.groupByFields.join(",")),r.topFilter?.orderByFields&&(n.topFilter.orderByFields=r.topFilter.orderByFields.join(",")),r.topFilter&&(n.topFilter=JSON.stringify(n.topFilter)),r.objectIds&&(n.objectIds=r.objectIds.join(",")),r.orderByFields&&(n.orderByFields=r.orderByFields.join(",")),r.outFields&&!(e?.returnCountOnly||e?.returnExtentOnly||e?.returnIdsOnly)?r.outFields.includes("*")?n.outFields="*":n.outFields=r.outFields.join(","):delete n.outFields,r.outSR?n.outSR=Hv(r.outSR):t&&r.returnGeometry&&(n.outSR=n.inSR),r.returnGeometry&&delete r.returnGeometry,r.timeExtent){const s=r.timeExtent,{start:o,end:a}=s;o==null&&a==null||(n.time=o===a?o:`${o??"null"},${a??"null"}`),delete r.timeExtent}return n}async function qpr(i,e,t,r){const n=await dSe(i,e,"json",r);return g1e(e,t,n.data),n}async function Ypr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:dSe(i,e,"json",t,{returnIdsOnly:!0})}async function Xpr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:dSe(i,e,"json",t,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(Rat);if(n.hasOwnProperty("count"))throw new Error(Rat);return r})}function Jpr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):dSe(i,e,"json",t,{returnIdsOnly:!0,returnCountOnly:!0})}function dSe(i,e,t,r={},n={}){const s=typeof i=="string"?Yo(i):i,o=e.geometry?[e.geometry]:[];return r.responseType="json",cy(o,null,r).then(a=>{const l=a?.[0];l!=null&&((e=e.clone()).geometry=l);const u=Dae({...s.query,f:t,...n,...Wpr(e,n)});return zi(Iu(s.path,"queryTopFeatures"),{...r,query:{...u,...r.query}})})}async function Kpr(i,e,t,r){const n=gu(i),s={...r},{data:o}=await qpr(n,rF.from(e),t,s);return du.fromJSON(o)}const Zpr=Object.freeze(Object.defineProperty({__proto__:null,executeTopFeaturesQuery:Kpr},Symbol.toStringTag,{value:"Module"}));async function Qpr(i,e,t){const r=gu(i);return(await Ypr(r,rF.from(e),{...t})).data.objectIds}const efr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopIds:Qpr},Symbol.toStringTag,{value:"Module"}));async function tfr(i,e,t){const r=gu(i),n=await Xpr(r,rF.from(e),{...t}),s=n.data.extent;return!s||isNaN(s.xmin)||isNaN(s.ymin)||isNaN(s.xmax)||isNaN(s.ymax)?{count:n.data.count,extent:null}:{count:n.data.count,extent:hr.fromJSON(s)}}const ifr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopExtents:tfr},Symbol.toStringTag,{value:"Module"}));async function rfr(i,e,t){const r=gu(i);return(await Jpr(r,rF.from(e),{...t})).data.count}const nfr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopCount:rfr},Symbol.toStringTag,{value:"Module"}));let o$=class extends qF{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return e!=null&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"row",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"column",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"rows",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"columns",void 0),o$=x([Qe("esri.CameraLayout")],o$);const t4t=o$;let ZHe=class{constructor(e,t){this.min=e,this.max=t,this.range=t-e}ndiff(e,t=0){return Math.ceil((e-t)/this.range)*this.range+t}_normalize(e,t,r,n=0,s=!1){return(r-=n)t&&(r-=this.ndiff(r-t)),s&&r===t&&(r=e),r+n}normalize(e,t=0,r=!1){return this._normalize(this.min,this.max,e,t,r)}clamp(e,t=0){return uu(e-t,this.min,this.max)+t}monotonic(e,t,r){return ee&&rkS.normalize(Gd(i)))],_I.prototype,"heading",void 0),x([D({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),So(i=>uu(Gd(i),-180,180))],_I.prototype,"tilt",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],_I.prototype,"fov",void 0),x([D({type:t4t,nonNullable:!0,json:{read:!1,write:!1}})],_I.prototype,"layout",void 0),_I=x([Qe("esri.Camera")],_I);const sfr=_I;var SNe;let T4=SNe=class extends Ci{constructor(i){super(i),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(i){return(i%=360)<0&&(i+=360),i}clone(){return new SNe({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function cMe(){return{enabled:!this.camera}}x([D({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cMe}}}}})],T4.prototype,"rotation",void 0),x([So("rotation")],T4.prototype,"castRotation",null),x([D({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cMe}}}}})],T4.prototype,"scale",void 0),x([D({types:Ff,json:{read:Ro,write:!0,origins:{"web-scene":{read:Ro,write:{overridePolicy:cMe}}}}})],T4.prototype,"targetGeometry",void 0),x([D({type:sfr,json:{write:!0}})],T4.prototype,"camera",void 0),T4=SNe=x([Qe("esri.Viewpoint")],T4);const Ab=T4,hge={widthBreakpoint:{getValue(i){const e=i.viewSize[0],t=i.breakpoints,r=this.values;return e<=t.xsmall?r.xsmall:e<=t.small?r.small:e<=t.medium?r.medium:e<=t.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(i){const e=i.viewSize[1],t=i.breakpoints,r=this.values;return e<=t.xsmall?r.xsmall:e<=t.small?r.small:e<=t.medium?r.medium:e<=t.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(i){const e=i.viewSize,t=e[0],r=e[1],n=this.values;return r>=t?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},hMe={xsmall:544,small:768,medium:992,large:1200};function ofr(i){const e=i;return e&&e.xsmall{let e=class extends i{constructor(...t){super(...t),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=hMe}initialize(){this.addHandles(Ki(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),js))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(t){if(t===this._get("breakpoints"))return;const r=ofr(t);if(!r){const n=JSON.stringify(hMe,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}t=r?t:hMe,this._set("breakpoints",{...t})}_updateClassNames(){if(!this.container)return;const t=Ky.acquire(),r=Ky.acquire();let n,s=!1;for(n in hge){const o=this[n],a=hge[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(s=!0,this[n]=a,dMe(n,o).forEach(l=>r.push(l)),dMe(n,a).forEach(l=>t.push(l)))}s&&(this._applyClassNameChanges(t,r),Ky.release(t),Ky.release(r))}_applyClassNameChanges(t,r){const n=this.container;n&&(r.forEach(s=>n.classList.remove(s)),t.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const t=this.container;if(!t)return;let r;for(r in hge)dMe(r,this[r]).forEach(n=>t.classList.remove(n))}};return x([D()],e.prototype,"breakpoints",null),x([D()],e.prototype,"orientation",void 0),x([D()],e.prototype,"widthBreakpoint",void 0),x([D()],e.prototype,"heightBreakpoint",void 0),e=x([Qe("esri.views.BreakpointsOwner")],e),e};function eWe(i){return typeof i=="string"?document.getElementById(i):i??null}function i4t(i){for(;i.hasChildNodes();)i.removeChild(i.firstChild)}function Dat(i,e){const t=e.parentNode;t&&t.insertBefore(i,e)}function Fat(i,e){for(;;){const t=i.firstChild;if(!t)break;e.appendChild(t)}}let Mb=class extends un{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,r={}){return this._installWatch(e,t,r,Ki)}addWhen(e,t,r={}){return this._installWatch(e,t,r,v0)}addOnCollectionChange(e,t,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this.addHandles([ju(e,"after-changes",this._createSyncUpdatingCallback(),Kl),ju(e,"change",t,{onListenerAdd:r?o=>t({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>t({added:[],removed:o.toArray()}):void 0})],s),wa(()=>this.removeHandles(s))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(wa(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(whe)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this.removeHandles(t);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,t,r);return this.addHandles(o,s),wa(()=>this.removeHandles(s))}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=Ki(e,r,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(whe),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(Gk(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(whe))}),whe)}}};x([D({readOnly:!0})],Mb.prototype,"updating",void 0),Mb=x([Qe("esri.core.support.UpdatingHandles")],Mb);const whe=-42;/*! + at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(m){return'"'+l(m.text)+'"'},class:function(m){var v=m.parts.map(function(w){return Array.isArray(w)?u(w[0])+"-"+u(w[1]):u(w)});return"["+(m.inverted?"^":"")+v.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function a(m){return m.charCodeAt(0).toString(16).toUpperCase()}function l(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function u(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function c(m){return o[m.type](m)}function h(m){var v,w,S=m.map(c);if(S.sort(),S.length>0){for(v=1,w=1;v{if(!Number.isFinite(t.scale)||t.scale<=0)throw new qe("effect:invalid-scale","scale must be finite and greater than 0",{stop:t});return{scale:t.scale,effects:Ist(t.value)}});e.sort((t,r)=>r.effects.length-t.effects.length);for(let t=0;tr.scale-t.scale),e}function Ist(i){let e;if(!i)return[];try{e=Bnr.parse(i)}catch(t){throw new qe("effect:invalid-syntax","Invalid effect syntax",{value:i,error:t})}return e.map(t=>jnr(t))}function jnr(i){try{switch(i.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return Gnr(i);case"opacity":return Unr(i);case"hue-rotate":return znr(i);case"blur":return Vnr(i);case"drop-shadow":return Hnr(i);case"bloom":return Wnr(i)}}catch(e){throw e.details.filter=i,e}throw new qe("effect:unknown-effect",`Effect '${i.name}' is not supported`,{effect:i})}function Gnr(i){let e=1;return PY(i.parameters,1),i.parameters.length===1&&(e=mC(i.parameters[0])),new Wke(i.name,e)}function Unr(i){let e=1;return PY(i.parameters,1),i.parameters.length===1&&(e=mC(i.parameters[0])),new kOt(e)}function znr(i){let e=0;return PY(i.parameters,1),i.parameters.length===1&&(e=Znr(i.parameters[0])),new DOt(e)}function Vnr(i){let e=0;return PY(i.parameters,1),i.parameters.length===1&&(e=FVe(i.parameters[0]),Tae(e,i.parameters[0])),new AOt(e)}function Hnr(i){const e=[];let t=null;for(const r of i.parameters)if(r.type==="color"){if(e.length&&Object.freeze(e),t)throw new qe("effect:type-error","Accepts only one color",{});t=Qnr(r)}else{const n=FVe(r);if(Object.isFrozen(e))throw new qe("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&Tae(n,r)}if(e.length<2||e.length>3)throw new qe("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new POt(e[0],e[1],e[2]||0,t||jOt("black"))}function Wnr(i){let e=1,t=0,r=0;return PY(i.parameters,3),i.parameters[0]&&(e=mC(i.parameters[0])),i.parameters[1]&&(t=FVe(i.parameters[1]),Tae(t,i.parameters[1])),i.parameters[2]&&(r=mC(i.parameters[2])),new EOt(e,t,r)}function PY(i,e){if(i.length>e)throw new qe("effect:type-error",`Function supports up to ${e} parameters, Actual: ${i.length}`,{parameters:i})}function z2e(i){if(i.type==="color")return"";if(i.unit){if(i.unit in DVe)return"";if(i.unit in RVe)return"";if(i.unit==="%")return""}return""}function Tae(i,e){if(i<0)throw new qe("effect:type-error",`Negative values are not allowed, Actual: ${i}`,{term:e})}function qnr(i){if(i.type!=="quantity"||i.unit!==null)throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}function Ynr(i){if(i.type!=="quantity"||i.unit!==null&&i.unit!=="%")throw new qe("effect:type-error",`Expected or , Actual: ${z2e(i)}`,{term:i})}const RVe={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Xnr(i){if(i.type!=="quantity"||!(i.value===0&&i.unit===null||i.unit&&RVe[i.unit]!=null))throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}const DVe={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function Jnr(i){if(i.type!=="quantity"||!(i.value===0&&i.unit===null||i.unit&&DVe[i.unit]!=null))throw new qe("effect:type-error",`Expected , Actual: ${z2e(i)}`,{term:i})}function mC(i){Ynr(i);const e=i.value;return Tae(e,i),i.unit==="%"?.01*e:e}function Knr(i){return qnr(i),Tae(i.value,i),i.value}function Znr(i){return Xnr(i),i.value*RVe[i.unit]||0}function FVe(i){return Jnr(i),i.value*DVe[i.unit]||0}function Qnr(i){switch(i.colorType){case"hex":return XYi(i.value);case"named":return jOt(i.value);case"function":return isr(i.value)}}function jOt(i){if(!UEt(i))throw new qe("effect:unknown-color",`color '${i}' isn't valid`,{namedColor:i});return YYi(i)}const esr=/^rgba?/i,tsr=/^hsla?/i;function isr(i){if(PY(i.parameters,4),esr.test(i.name))return[mC(i.parameters[0]),mC(i.parameters[1]),mC(i.parameters[2]),i.parameters[3]?mC(i.parameters[3]):1];if(tsr.test(i.name))return zEt(Knr(i.parameters[0]),mC(i.parameters[1]),mC(i.parameters[2]),i.parameters[3]?mC(i.parameters[3]):1);throw new qe("effect:syntax-error",`Invalid color function '${i.name}'`,{colorFunction:i})}function kVe(i,e,t){try{return nsr(i)}catch(r){t?.messages?.push(r)}return null}function LVe(i,e,t,r){try{const n=rsr(i);Qp(t,n,e)}catch(n){r.messages&&r.messages.push(n)}}function rsr(i){const e=PVe(i);return e?$nr(e)?e.map(t=>t.toJSON()):e.map(({scale:t,effects:r})=>({scale:t,value:r.map(n=>n.toJSON())})):null}function nsr(i){if(!i||i.length===0)return null;if(ssr(i)){const e=[];for(const t of i)e.push({scale:t.scale,value:Ast(t.value)});return e}return Ast(i)}function ssr(i){const e=i[0];return!!e&&"scale"in e}function Ast(i){if(!i?.length)return"";const e=[];for(const t of i){let r=[];switch(t.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[vM(t,"amount")];break;case"blur":r=[vM(t,"radius","pt")];break;case"hue-rotate":r=[vM(t,"angle","deg")];break;case"drop-shadow":r=[vM(t,"xoffset","pt"),vM(t,"yoffset","pt"),vM(t,"blurRadius","pt"),osr(t,"color")];break;case"bloom":r=[vM(t,"strength"),vM(t,"radius","pt"),vM(t,"threshold")]}const n=`${t.type}(${r.filter(Boolean).join(" ")})`;PVe(n),e.push(n)}return e.join(" ")}function vM(i,e,t){if(i[e]==null)throw new qe("effect:missing-parameter",`Missing parameter '${e}' in ${i.type} effect`,{effect:i});return t?i[e]+t:""+i[e]}function osr(i,e){if(i[e]==null)throw new qe("effect:missing-parameter",`Missing parameter '${e}' in ${i.type} effect`,{effect:i});const t=i[e];return`rgba(${t[0]||0}, ${t[1]||0}, ${t[2]||0}, ${t[3]/255||0})`}const Mst={read:{reader:kVe},write:{allowNull:!0,writer:LVe}},xh=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return x([D({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],e.prototype,"blendMode",void 0),x([D({json:{read:!1,write:!1,origins:{"web-map":Mst,"portal-item":Mst}}})],e.prototype,"effect",void 0),e=x([Qe("esri.layers.mixins.BlendLayer")],e),e},py=i=>{let e=class extends i{constructor(){super(...arguments),this.customParameters=null}};return x([D({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=x([Qe("esri.layers.mixins.CustomParametersMixin")],e),e},asr="randomUUID"in crypto;function KB(){if(asr)return crypto.randomUUID();const i=crypto.getRandomValues(new Uint16Array(8));i[3]=4095&i[3]|16384,i[4]=16383&i[4]|32768;const e=t=>i[t].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function NVe(){return`{${KB().toUpperCase()}}`}function lsr(){return`{${KB()}}`}const GOt=lsr(),UOt=new Map,zOt=new Map;async function usr(i,e,t){if(!i||!t)return!1;if(!e)return!0;const r=new URL(i).host;let n=UOt.get(r);if(!n){const s=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");n=(await zi(s,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return n===e}async function csr(i,e,t=!1){if(!i||!e)return!0;const r=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),n=zOt.get(r)?.entries();if(n){for(const[s,o]of n)if(o.name===e){const a=!o.stack?.hasForwardEdits();if(!a&&t){const[{deleteForwardEdits:l},{default:u}]=await Promise.all([Promise.resolve().then(()=>gon),Promise.resolve().then(()=>von)]);return l(r,s,new u({sessionId:GOt,moment:o.moment}))}return a}}return!0}function VOt(i,e){if(!i)return!1;const t=i.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=zOt.get(t)?.entries();if(r){for(const[n,s]of r)if(s.name===e)return s.lockType==="edit"}return!1}const $Ve=new rd.EventEmitter;function hsr(i){return $Ve.on("apply-edits",new WeakRef(i))}function dsr(i){return $Ve.on("update-moment",new WeakRef(i))}function psr(i,e,t=null,r=!1){const n=ac();return r=e==null||r,$Ve.emit("apply-edits",{serviceUrl:i,layerId:e,gdbVersion:t,mayReceiveServiceEdits:r,result:n.promise}),n}const HOt="esri.layers.mixins.EditBusLayer",WOt=Symbol(HOt);function fsr(i){return i!=null&&typeof i=="object"&&WOt in i}function FJ(i){return i!=null&&typeof i=="object"&&"gdbVersion"in i}function R3e(i,e,t){const r=new URL(i).host,n=UOt.get(r),s=o=>!o||o===n;return s(e)&&s(t)||e===t}const BVe=i=>{var e;let t=class extends i{constructor(...r){super(...r),this[e]=!0,this._applyEditsHandler=n=>{const{serviceUrl:s,layerId:o,gdbVersion:a,mayReceiveServiceEdits:l,result:u}=n,c=s===this.url,h=o!=null&&this.layerId!=null&&o===this.layerId,p=FJ(this),m=FJ(this)&&R3e(s,a,this.gdbVersion);if(!c||p&&!m||!h&&!l)return;const v=u.then(w=>{if(h&&(w.addedFeatures.length||w.updatedFeatures.length||w.deletedFeatures.length||w.addedAttachments.length||w.updatedAttachments.length||w.deletedAttachments.length))return this.emit("edits",li(w)),w;const S=w.editedFeatures?.find(({layerId:I})=>I===this.layerId);if(S){const{adds:I,updates:R,deletes:L}=S.editedFeatures,k={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:I?I.map(({attributes:B})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],deletedFeatures:L?L.map(({attributes:B})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],updatedFeatures:R?R.map(({current:{attributes:B}})=>({objectId:this.objectIdField&&B[this.objectIdField],globalId:this.globalIdField&&B[this.globalIdField]})):[],editedFeatures:li(w.editedFeatures),exceededTransferLimit:!1,historicMoment:li(w.historicMoment)};return this.emit("edits",k),k}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:li(w.editedFeatures),exceededTransferLimit:!1,historicMoment:li(w.historicMoment)}}).then(w=>("historicMoment"in this&&this.historicMoment!==w.historicMoment&&VOt(s,a)&&(this.historicMoment=w.historicMoment),w));this.emit("apply-edits",{result:v})},this._updateMomentHandler=n=>{const{serviceUrl:s,gdbVersion:o,moment:a}=n,l=s===this.url,u=FJ(this),c=FJ(this)&&R3e(s,o,this.gdbVersion),h=FJ(this)&&!R3e(s,this.gdbVersion,null);l&&u&&c&&h&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(hsr(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(dsr(this._updateMomentHandler))},()=>{})}};return e=WOt,t=x([Qe(HOt)],t),t},Oie={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function K8(i,e,t,r=RS){const n=new $b(zze(r)),s=Sn.fromJSDate(i,{zone:n}),o=t==="decades"||t==="centuries"?"year":qOt(t);return t==="decades"&&(e*=10),t==="centuries"&&(e*=100),s.plus({[o]:e}).toJSDate()}function Ost(i,e,t=RS){const r=new $b(zze(t)),n=Sn.fromJSDate(i,{zone:r});if(e==="decades"||e==="centuries"){const o=n.startOf("year"),{year:a}=o,l=a-a%(e==="decades"?10:100);return o.set({year:l}).toJSDate()}const s=qOt(e);return n.startOf(s).toJSDate()}function msr(i,e,t){return i===0?0:i*Oie[e]/Oie[t]}function qOt(i){switch(i){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var BT;let Gw=BT=class extends Ci{static get allTime(){return Pst}static get empty(){return gsr}constructor(i){super(i),this.end=null,this.start=null}readEnd(i,e){return e.end!=null?new Date(e.end):null}writeEnd(i,e){e.end=i?.getTime()??null}get isAllTime(){return this.equals(BT.allTime)}get isEmpty(){return this.equals(BT.empty)}readStart(i,e){return e.start!=null?new Date(e.start):null}writeStart(i,e){e.start=i?.getTime()??null}clone(){return new BT({end:this.end,start:this.start})}equals(i){if(!i)return!1;const e=this.start?.getTime()??this.start,t=this.end?.getTime()??this.end,r=i.start?.getTime()??i.start,n=i.end?.getTime()??i.end;return e===r&&t===n}expandTo(i,e=RS){if(this.isEmpty||this.isAllTime)return this.clone();let t=this.start;t&&(t=Ost(t,i,e));let r=this.end;if(r){const n=Ost(r,i,e);r=r.getTime()===n.getTime()?n:K8(n,1,i,e)}return new BT({start:t,end:r})}intersection(i){if(!i)return this.clone();if(this.isEmpty||i.isEmpty)return BT.empty;if(this.isAllTime)return i.clone();if(i.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,t=this.end?.getTime()??1/0,r=i.start?.getTime()??-1/0,n=i.end?.getTime()??1/0;let s,o;if(r>=e&&r<=t?s=r:e>=r&&e<=n&&(s=e),t>=r&&t<=n?o=t:n>=e&&n<=t&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const a=new BT;return a.start=s===-1/0?null:new Date(s),a.end=o===1/0?null:new Date(o),a}return BT.empty}offset(i,e,t=RS){if(this.isEmpty||this.isAllTime)return this.clone();const r=new BT,{start:n,end:s}=this;return n!=null&&(r.start=K8(n,i,e,t)),s!=null&&(r.end=K8(s,i,e,t)),r}union(i){if(!i||i.isEmpty)return this.clone();if(this.isEmpty)return i.clone();if(this.isAllTime||i.isAllTime)return Pst.clone();const e=this.start!=null&&i.start!=null?new Date(Math.min(this.start.getTime(),i.start.getTime())):null,t=this.end!=null&&i.end!=null?new Date(Math.max(this.end.getTime(),i.end.getTime())):null;return new BT({start:e,end:t})}};x([D({type:Date,json:{write:{allowNull:!0}}})],Gw.prototype,"end",void 0),x([Mi("end")],Gw.prototype,"readEnd",null),x([ur("end")],Gw.prototype,"writeEnd",null),x([D({readOnly:!0,json:{read:!1}})],Gw.prototype,"isAllTime",null),x([D({readOnly:!0,json:{read:!1}})],Gw.prototype,"isEmpty",null),x([D({type:Date,json:{write:{allowNull:!0}}})],Gw.prototype,"start",void 0),x([Mi("start")],Gw.prototype,"readStart",null),x([ur("start")],Gw.prototype,"writeStart",null),Gw=BT=x([Qe("esri.TimeExtent")],Gw);const Pst=new Gw,gsr=new Gw({start:void 0,end:void 0}),Eg=Gw;var qke;let lP=qke=class extends Ci{constructor(i){super(i),this.type="map-layer"}clone(){const{mapLayerId:i,gdbVersion:e}=this;return new qke({mapLayerId:i,gdbVersion:e})}};x([Wr({mapLayer:"map-layer"})],lP.prototype,"type",void 0),x([D({type:ms,json:{write:!0}})],lP.prototype,"mapLayerId",void 0),x([D({type:String,json:{write:!0}})],lP.prototype,"gdbVersion",void 0),lP=qke=x([Qe("esri.layers.support.source.MapLayerSource")],lP);var Yke;let qM=Yke=class extends Ci{constructor(i){super(i),this.type="query-table"}clone(){const{workspaceId:i,query:e,oidFields:t,spatialReference:r,geometryType:n}=this,s={workspaceId:i,query:e,oidFields:t,spatialReference:r?.clone()??void 0,geometryType:n};return new Yke(s)}};x([Wr({queryTable:"query-table"})],qM.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"workspaceId",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"query",void 0),x([D({type:String,json:{write:!0}})],qM.prototype,"oidFields",void 0),x([D({type:Xi,json:{write:!0}})],qM.prototype,"spatialReference",void 0),x([Wr(Vp)],qM.prototype,"geometryType",void 0),qM=Yke=x([Qe("esri.layers.support.source.QueryTableDataSource")],qM);var Xke;let GG=Xke=class extends Ci{constructor(i){super(i),this.type="raster"}clone(){const{workspaceId:i,dataSourceName:e}=this;return new Xke({workspaceId:i,dataSourceName:e})}};x([Wr({raster:"raster"})],GG.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],GG.prototype,"dataSourceName",void 0),x([D({type:String,json:{write:!0}})],GG.prototype,"workspaceId",void 0),GG=Xke=x([Qe("esri.layers.support.source.RasterDataSource")],GG);var Jke;let qN=Jke=class extends Ci{constructor(i){super(i),this.type="table"}clone(){const{workspaceId:i,gdbVersion:e,dataSourceName:t}=this;return new Jke({workspaceId:i,gdbVersion:e,dataSourceName:t})}};x([Wr({table:"table"})],qN.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"workspaceId",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"gdbVersion",void 0),x([D({type:String,json:{write:!0}})],qN.prototype,"dataSourceName",void 0),qN=Jke=x([Qe("esri.layers.support.source.TableDataSource")],qN);var Kke,Zke;const ysr=pa()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let vw=Kke=class extends Ci{constructor(i){super(i),this.type="join-table"}readLeftTableSource(i,e,t){return Rst()(i,e,t)}castLeftTableSource(i){return u3(Qke(),i)}readRightTableSource(i,e,t){return Rst()(i,e,t)}castRightTableSource(i){return u3(Qke(),i)}clone(){const{leftTableKey:i,rightTableKey:e,leftTableSource:t,rightTableSource:r,joinType:n}=this,s={leftTableKey:i,rightTableKey:e,leftTableSource:t?.clone()??void 0,rightTableSource:r?.clone()??void 0,joinType:n};return new Kke(s)}};x([Wr({joinTable:"join-table"})],vw.prototype,"type",void 0),x([D({type:String,json:{write:!0}})],vw.prototype,"leftTableKey",void 0),x([D({type:String,json:{write:!0}})],vw.prototype,"rightTableKey",void 0),x([D({json:{write:!0}})],vw.prototype,"leftTableSource",void 0),x([Mi("leftTableSource")],vw.prototype,"readLeftTableSource",null),x([So("leftTableSource")],vw.prototype,"castLeftTableSource",null),x([D({json:{write:!0}})],vw.prototype,"rightTableSource",void 0),x([Mi("rightTableSource")],vw.prototype,"readRightTableSource",null),x([So("rightTableSource")],vw.prototype,"castRightTableSource",null),x([Wr(ysr)],vw.prototype,"joinType",void 0),vw=Kke=x([Qe("esri.layers.support.source.JoinTableDataSource")],vw);let D3e=null;function Rst(){return D3e||(D3e=zB({types:Qke()})),D3e}let F3e=null;function Qke(){return F3e||(F3e={key:"type",base:null,typeMap:{"data-layer":Ev,"map-layer":lP}}),F3e}const vsr={key:"type",base:null,typeMap:{"join-table":vw,"query-table":qM,raster:GG,table:qN}};let Ev=Zke=class extends Ci{constructor(i){super(i),this.type="data-layer"}clone(){const{fields:i,dataSource:e}=this;return new Zke({fields:i,dataSource:e})}};x([Wr({dataLayer:"data-layer"})],Ev.prototype,"type",void 0),x([D({type:[Fo],json:{write:!0}})],Ev.prototype,"fields",void 0),x([D({types:vsr,json:{write:!0}})],Ev.prototype,"dataSource",void 0),Ev=Zke=x([Qe("esri.layers.support.source.DataLayerSource")],Ev),Ev.from=Sd(Ev);let YN=class extends xs(Ci){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};x([D({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],YN.prototype,"onFields",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"operator",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"searchTerm",void 0),x([D({type:String,json:{write:!0}})],YN.prototype,"searchType",void 0),YN=x([Qe("esri.rest.support.FullTextSearch")],YN);const _sr=YN;var eLe;const Dst=new Rs({upperLeft:"upper-left",lowerLeft:"lower-left"});let XN=eLe=class extends Ci{constructor(i){super(i),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new eLe(li({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};x([D({type:hr,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],XN.prototype,"extent",void 0),x([D({type:["view","edit"],json:{write:!0}})],XN.prototype,"mode",void 0),x([D({type:String,json:{read:Dst.read,write:Dst.write}})],XN.prototype,"originPosition",void 0),x([D({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],XN.prototype,"tolerance",void 0),XN=eLe=x([Qe("esri.rest.support.QuantizationParameters")],XN);const YOt=XN,XOt=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var tLe;const Fst=new Rs({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let jT=tLe=class extends Ci{constructor(i){super(i),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(i,e){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(e.statisticParameters=li(i))}clone(){return new tLe({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:li(this.statisticParameters)})}};x([D({type:Number,json:{write:!0}})],jT.prototype,"maxPointCount",void 0),x([D({type:Number,json:{write:!0}})],jT.prototype,"maxRecordCount",void 0),x([D({type:Number,json:{write:!0}})],jT.prototype,"maxVertexCount",void 0),x([D({type:String,json:{write:!0}})],jT.prototype,"onStatisticField",void 0),x([D({type:String,json:{write:!0}})],jT.prototype,"outStatisticFieldName",void 0),x([D({type:String,json:{read:{source:"statisticType",reader:Fst.read},write:{target:"statisticType",writer:Fst.write}}})],jT.prototype,"statisticType",void 0),x([D({type:Object})],jT.prototype,"statisticParameters",void 0),x([ur("statisticParameters")],jT.prototype,"writeStatisticParameters",null),jT=tLe=x([Qe("esri.rest.support.StatisticDefinition")],jT);const y1e=jT;var $me;const bsr=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let To=$me=class extends Ci{static from(i){return Cu($me,i)}constructor(i){super(i),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(i){return typeof i=="number"||typeof i=="object"?i:null}writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}writeParameterValues(i,e){if(i){const t={};for(const r in i){const n=i[r];Array.isArray(n)?t[r]=n.map(s=>s instanceof Date?s.getTime():s):n instanceof Date?t[r]=n.getTime():t[r]=n}e.parameterValues=t}}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(i,e){e.where=i||"1=1"}clone(){return new $me(li({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};To.MAX_MAX_RECORD_COUNT_FACTOR=5,x([D({json:{write:!0}})],To.prototype,"aggregateIds",void 0),x([D({type:Boolean,json:{write:!0}})],To.prototype,"cacheHint",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"compactGeometryEnabled",void 0),x([D({json:{write:!0}})],To.prototype,"datumTransformation",void 0),x([So("datumTransformation")],To.prototype,"castDatumTransformation",null),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"defaultSpatialReferenceEnabled",void 0),x([D({type:Number,json:{write:{overridePolicy:i=>({enabled:i>0})}}})],To.prototype,"distance",void 0),x([D({type:Ev,json:{write:!0}})],To.prototype,"dynamicDataSource",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"formatOf3DObjects",void 0),x([D({type:[_sr],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],To.prototype,"fullText",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"gdbVersion",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],To.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],To.prototype,"geometryPrecision",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"groupByFieldsForStatistics",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"having",void 0),x([D({type:Date})],To.prototype,"historicMoment",void 0),x([ur("historicMoment")],To.prototype,"writeHistoricMoment",null),x([D({type:Number,json:{write:!0}})],To.prototype,"maxAllowableOffset",void 0),x([D({type:Number,cast:i=>i<1?1:i>To.MAX_MAX_RECORD_COUNT_FACTOR?To.MAX_MAX_RECORD_COUNT_FACTOR:i,json:{write:{overridePolicy:i=>({enabled:i>1})}}})],To.prototype,"maxRecordCountFactor",void 0),x([D({type:["xyFootprint"],json:{write:!0}})],To.prototype,"multipatchOption",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],To.prototype,"num",void 0),x([D({json:{write:!0}})],To.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],To.prototype,"outFields",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],To.prototype,"outSpatialReference",void 0),x([D({type:[y1e],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],To.prototype,"outStatistics",void 0),x([D({json:{write:!0}})],To.prototype,"parameterValues",void 0),x([ur("parameterValues")],To.prototype,"writeParameterValues",null),x([D({type:$i,json:{write:!0}})],To.prototype,"pixelSize",void 0),x([D({type:YOt,json:{write:!0}})],To.prototype,"quantizationParameters",void 0),x([D({type:[Object],json:{write:!0}})],To.prototype,"rangeValues",void 0),x([D({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],To.prototype,"relationParameter",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"resultType",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnCentroid",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnDistinctValues",void 0),x([D({type:Boolean,json:{default:!0,write:!0}})],To.prototype,"returnExceededLimitFeatures",void 0),x([D({type:Boolean,json:{write:!0}})],To.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnQueryGeometry",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],To.prototype,"returnZ",void 0),x([D({type:Xi,json:{write:!0}})],To.prototype,"sourceSpatialReference",void 0),x([Wr(XOt,{ignoreUnknown:!1,name:"spatialRel"})],To.prototype,"spatialRelationship",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],To.prototype,"start",void 0),x([ur("start"),ur("num")],To.prototype,"writeStart",null),x([D({type:String,json:{write:!0}})],To.prototype,"sqlFormat",void 0),x([D({type:String,json:{write:!0}})],To.prototype,"text",void 0),x([D({type:Eg,json:{write:!0}})],To.prototype,"timeExtent",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],To.prototype,"timeReferenceUnknownClient",void 0),x([Wr(bsr,{ignoreUnknown:!1}),D({json:{write:{overridePolicy(i){return{enabled:!!i&&this.distance!=null&&this.distance>0}}}}})],To.prototype,"units",void 0),x([D({type:String,json:{write:{overridePolicy(i){return{enabled:i!=null||this.start!=null&&this.start>0}}}}})],To.prototype,"where",void 0),x([ur("where")],To.prototype,"writeWhere",null),To=$me=x([Qe("esri.rest.support.Query")],To);const Kn=To;var iLe;const k3e=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),L3e=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let gI=iLe=class extends Ci{constructor(i){super(i),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(i={}){const{where:e,geometry:t,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:a}=this;return new Kn({geometry:li(t),objectIds:li(s),spatialRelationship:r,timeExtent:li(n),where:e,units:o,distance:a,...i})}clone(){const{where:i,geometry:e,spatialRelationship:t,timeExtent:r,objectIds:n,units:s,distance:o}=this;return new iLe({geometry:li(e),objectIds:li(n),spatialRelationship:t,timeExtent:li(r),where:i,units:s,distance:o})}};x([D({type:String,json:{write:!0}})],gI.prototype,"where",void 0),x([D({types:Ff,json:{write:!0}})],gI.prototype,"geometry",void 0),x([D({type:k3e.apiValues,json:{name:"spatialRel",read:{reader:k3e.read},write:{allowNull:!1,writer:k3e.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],gI.prototype,"spatialRelationship",void 0),x([D({type:Number,json:{write:{overridePolicy(i){return{enabled:i!=null&&this.geometry!=null}}}}})],gI.prototype,"distance",void 0),x([D({type:[Number],json:{write:!0}})],gI.prototype,"objectIds",void 0),x([D({type:L3e.apiValues,json:{read:L3e.read,write:{writer:L3e.write,overridePolicy(i){return{enabled:i!=null&&this.geometry!=null}}}}})],gI.prototype,"units",void 0),x([D({type:Eg,json:{write:!0}})],gI.prototype,"timeExtent",void 0),gI=iLe=x([Qe("esri.layers.support.FeatureFilter")],gI);const QF=gI;var rLe;const kst={read:{reader:kVe},write:{writer:LVe,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},Lst={read:{reader:kVe},write:{writer:LVe,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},Nst={name:"showExcludedLabels",default:!0};let JN=rLe=class extends Ci{constructor(i){super(i),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(i,e){const t=super.write(i,e);if(e?.origin){if(t.filter){const r=Object.keys(t.filter);if(r.length>1||r[0]!=="where")return e.messages?.push(new qe("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in t)return e.messages?.push(new qe("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return t}clone(){return new rLe({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};x([D({type:QF,json:{write:{allowNull:!0,writer(i,e,t,r){const n=i?.write({},r);n&&Object.keys(n).length!==0?Qp(t,n,e):Qp(t,null,e)}}}})],JN.prototype,"filter",void 0),x([D({json:{write:!0,origins:{"web-map":kst,"portal-item":kst}}})],JN.prototype,"includedEffect",void 0),x([D({json:{write:!0,origins:{"web-map":Lst,"portal-item":Lst}}})],JN.prototype,"excludedEffect",void 0),x([D({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":Nst,"portal-item":Nst}}})],JN.prototype,"excludedLabelsVisible",void 0),JN=rLe=x([Qe("esri.layers.support.FeatureEffect")],JN);const JOt=JN,$st={write:{allowNull:!0}},RY=i=>{let e=class extends i{constructor(){super(...arguments),this.featureEffect=null}};return x([D({type:JOt,json:{origins:{"web-map":$st,"portal-item":$st}}})],e.prototype,"featureEffect",void 0),e=x([Qe("esri.layers.mixins.FeatureEffectLayer")],e),e};var SQ;const v1e=pa()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),KOt=v1e.jsonValues.slice();aVi(KOt,"orthometric");const Pie=pa()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let GT=SQ=class extends Ci{constructor(i){super(i),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(i,e,t){return v1e.write(i,e,t)}readHeightModel(i,e,t){return v1e.read(i)||(t?.messages&&t.messages.push(wsr(i,{context:t})),null)}readHeightUnit(i,e,t){return Pie.read(i)||(t?.messages&&t.messages.push(Bst(i,{context:t})),null)}readHeightUnitService(i,e,t){return TEt(i)||Pie.read(i)||(t?.messages&&t.messages.push(Bst(i,{context:t})),null)}readVertCRS(i,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new SQ({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(i){return!!i&&(this===i||this.heightModel===i.heightModel&&this.heightUnit===i.heightUnit&&this.vertCRS===i.vertCRS)}static deriveUnitFromSR(i,e){const t=jqi(e);return new SQ({heightModel:i.heightModel,heightUnit:t??void 0,vertCRS:i.vertCRS})}write(i,e){return e={origin:"web-scene",...e},super.write(i,e)}static fromJSON(i){if(!i)return null;const e=new SQ;return e.read(i,{origin:"web-scene"}),e}};function Bst(i,e){return new Rf("height-unit:unsupported",`Height unit of value '${i}' is not supported`,e)}function wsr(i,e){return new Rf("height-model:unsupported",`Height model of value '${i}' is not supported`,e)}x([D({type:v1e.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:KOt,default:"ellipsoidal"}}}})],GT.prototype,"heightModel",void 0),x([ur("web-scene","heightModel")],GT.prototype,"writeHeightModel",null),x([Mi(["web-scene","service"],"heightModel")],GT.prototype,"readHeightModel",null),x([D({type:Pie.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:Pie.jsonValues,write:Pie.write}}}})],GT.prototype,"heightUnit",void 0),x([Mi("web-scene","heightUnit")],GT.prototype,"readHeightUnit",null),x([Mi("service","heightUnit")],GT.prototype,"readHeightUnitService",null),x([D({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],GT.prototype,"vertCRS",void 0),x([Mi("service","vertCRS",["vertCRS","ellipsoid","geoid"])],GT.prototype,"readVertCRS",null),GT=SQ=x([Qe("esri.geometry.HeightModelInfo")],GT);const DY=GT;function jst(i){return i!=null&&typeof i=="object"&&"declaredClass"in i&&i.declaredClass==="esri.WebMap"}function xsr(i){if(!i)return i;const{start:e,end:t}=i;return new Eg({start:e!=null?K8(e,-e.getTimezoneOffset(),"minutes"):e,end:t!=null?K8(t,-t.getTimezoneOffset(),"minutes"):t})}function Ssr(i){if(!i)return i;const{start:e,end:t}=i;return new Eg({start:e!=null?K8(e,e.getTimezoneOffset(),"minutes"):e,end:t!=null?K8(t,t.getTimezoneOffset(),"minutes"):t})}var nLe;let TQ=nLe=class extends Ci{constructor(i){super(i)}async collectRequiredFields(i,e){return i_(i,e,this.expression)}clone(){return new nLe({expression:this.expression,title:this.title})}equals(i){return this.expression===i.expression&&this.title===i.title}};x([D({type:String,json:{write:!0}})],TQ.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],TQ.prototype,"title",void 0),TQ=nLe=x([Qe("esri.layers.support.FeatureExpressionInfo")],TQ);const Gst=TQ;function Tsr(i){return 1/(bae[i]||1)}function Csr(){const i=Object.keys(bae);return i.sort(),i}const Esr=Csr();var sLe;const she=pa()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),Ust=new Rs({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let YM=sLe=class extends Ci{constructor(i){super(i),this.offset=null}readFeatureExpressionInfo(i,e){return i??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(i,e,t,r){e[t]=i.write({},r),i.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:i,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):i!=null||e?"relative-to-ground":"on-the-ground"}set mode(i){this._override("mode",i)}set unit(i){this._set("unit",i)}write(i,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(i,e):null}clone(){return new sLe({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(i){return this.mode===i.mode&&this.offset===i.offset&&this.unit===i.unit&&gne(this.featureExpressionInfo,i.featureExpressionInfo)}};x([D({type:Gst,json:{write:!0}})],YM.prototype,"featureExpressionInfo",void 0),x([Mi("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],YM.prototype,"readFeatureExpressionInfo",null),x([ur("featureExpressionInfo",{featureExpressionInfo:{type:Gst},"featureExpression.value":{type:[0]}})],YM.prototype,"writeFeatureExpressionInfo",null),x([D({type:she.apiValues,nonNullable:!0,json:{type:she.jsonValues,read:she.read,write:{writer:she.write,isRequired:!0}}})],YM.prototype,"mode",null),x([D({type:Number,json:{write:!0}})],YM.prototype,"offset",void 0),x([D({type:Esr,json:{type:String,read:Ust.read,write:Ust.write}})],YM.prototype,"unit",null),YM=sLe=x([Qe("esri.layers.support.ElevationInfo")],YM);const ZB=YM,FY={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:Wv}}},h_={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(i,e)=>!e.disablePopup},write:{enabled:!0,writer(i,e,t){e[t]=!i}}}},H3={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:Wv}}},C0={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:cR}}},d_={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:Wv}}},jR={value:null,type:ZB,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:Wv}}};function oLe(i){return{type:i,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const ZOt={write:{enabled:!0,layerContainerTypes:Wv},read:!0},aB={type:Number,json:{origins:{"web-document":ZOt,"portal-item":{write:!0}}}},QOt={...aB,json:{...aB.json,origins:{"web-document":{...ZOt,write:{enabled:!0,layerContainerTypes:Wv,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(i,e,t)=>t&&t.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?e.layerDefinition?.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?vW(e.layerDefinition.drawingInfo.transparency):void 0:vW(e.drawingInfo.transparency)}}},kY={type:Eg,readOnly:!0,get(){const i=this.layer?.timeInfo!=null?this.layer:this.i3slayer?.timeInfo!=null?this.i3slayer:null;if(i==null)return null;const{datesInUnknownTimezone:e,timeOffset:t,useViewTime:r}=i,n=this.view?.timeExtent;let s=i.timeExtent;e&&(s=Ssr(s));let o=r?n&&s?n.intersection(s):n||s:s;if(!o||o.isEmpty||o.isAllTime)return o;t&&(o=o.offset(-t.value,t.unit)),e&&(o=xsr(o));const a=this._get("timeExtent");return o.equals(a)?a:o}},Isr={type:hr,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(i,e)=>{const t=hr.fromJSON(i);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(t.spatialReference=Xi.fromJSON(e.spatialReference)),t}}}},read:!1}},LY={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},jVe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.minScale",write:!0}},GVe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.maxScale",write:!0}},ePt={json:{write:{ignoreOrigin:!0,layerContainerTypes:Wv},origins:{"web-map":{read:!1,write:!1}}}};let XM=class extends xs(Ci){constructor(e){super(e),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};x([D()],XM.prototype,"creatorField",void 0),x([D()],XM.prototype,"creationDateField",void 0),x([D()],XM.prototype,"editorField",void 0),x([D()],XM.prototype,"editDateField",void 0),x([D()],XM.prototype,"realm",void 0),x([D(XF("dateFieldsTimeReference",!0))],XM.prototype,"timeZone",void 0),XM=x([Qe("esri.layers.support.EditFieldsInfo")],XM);const Asr=XM;let HI=class extends xs(Ci){constructor(e){super(e)}};x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"name",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"fields",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"isAscending",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"indexType",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"isUnique",void 0),x([D({constructOnly:!0,json:{write:!0}})],HI.prototype,"description",void 0),HI=x([Qe("esri.layers.support.FeatureIndex")],HI);async function Msr(i,e,t){e=e.clone(),i.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=tPt(i));const r=Osr(i),n=i.capabilities.query.supportsPagination;e.start=0,e.num=r;let s=null;for(;;){const o=await i.source.queryFeaturesJSON(e,t);if(s==null?s=o:s.features=s.features.concat(o.features),s.exceededTransferLimit=o.exceededTransferLimit,!n||!o.exceededTransferLimit)break;e.start+=r}return s}function Osr(i){return tPt(i)*Psr(i)}function Psr(i){return i.capabilities.query.maxRecordCount||2e3}function tPt(i){return i.capabilities.query.supportsMaxRecordCountFactor?Kn.MAX_MAX_RECORD_COUNT_FACTOR:1}var aLe;let Ug=aLe=class extends Ci{constructor(i){super(i),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new aLe(li({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};x([D({type:[String],json:{write:!0}})],Ug.prototype,"attachmentTypes",void 0),x([D({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],Ug.prototype,"attachmentsWhere",void 0),x([D({type:Boolean,json:{write:!0}})],Ug.prototype,"cacheHint",void 0),x([D({type:[String],json:{write:!0}})],Ug.prototype,"keywords",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"globalIds",void 0),x([D({json:{write:!0}})],Ug.prototype,"name",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Ug.prototype,"num",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"objectIds",void 0),x([D({type:Boolean,json:{default:!1,write:!0}})],Ug.prototype,"returnMetadata",void 0),x([D({type:[Number],json:{write:!0}})],Ug.prototype,"size",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Ug.prototype,"start",void 0),x([ur("start"),ur("num")],Ug.prototype,"writeStart",null),x([D({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Ug.prototype,"where",void 0),Ug=aLe=x([Qe("esri.rest.support.AttachmentQuery")],Ug),Ug.from=Sd(Ug);const _1e=Ug;var lLe;let Md=lLe=class extends Ci{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(e.definitionExpression="1=1")}clone(){return new lLe(li({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};x([D({type:Boolean,json:{write:!0}})],Md.prototype,"cacheHint",void 0),x([D({type:Ev,json:{write:!0}})],Md.prototype,"dynamicDataSource",void 0),x([D({type:String,json:{write:!0}})],Md.prototype,"gdbVersion",void 0),x([D({type:Number,json:{write:!0}})],Md.prototype,"geometryPrecision",void 0),x([D({type:Date})],Md.prototype,"historicMoment",void 0),x([ur("historicMoment")],Md.prototype,"_writeHistoricMoment",null),x([D({type:Number,json:{write:!0}})],Md.prototype,"maxAllowableOffset",void 0),x([D({type:[Number],json:{write:!0}})],Md.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],Md.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],Md.prototype,"outFields",void 0),x([D({type:Xi,json:{read:{source:"outSR"},write:{target:"outSR"}}})],Md.prototype,"outSpatialReference",void 0),x([D({json:{write:!0}})],Md.prototype,"relationshipId",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Md.prototype,"start",void 0),x([ur("start"),ur("num")],Md.prototype,"writeStart",null),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Md.prototype,"num",void 0),x([D({json:{write:!0}})],Md.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Md.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Md.prototype,"returnZ",void 0),x([D({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Md.prototype,"where",void 0),Md=lLe=x([Qe("esri.rest.support.RelationshipQuery")],Md),Md.from=Sd(Md);const p3=Md,zst=Object.freeze(Object.defineProperty({__proto__:null,default:p3},Symbol.toStringTag,{value:"Module"})),uLe=new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function iPt(i,e,t,r){const n=await Xk(i);if(await UVe(i,e,r),!n.addAttachment)throw new qe(r,"Layer source does not support addAttachment capability");return n.addAttachment(e,t)}function UVe(i,e,t){const{attributes:r}=e,{objectIdField:n}=i;return i.capabilities?.data?.supportsAttachment?e?r?n&&r[n]?Promise.resolve():Promise.reject(new qe(t,`feature is missing the identifying attribute ${n}`)):Promise.reject(new qe(t,"'attributes' are required on a feature to query attachments")):Promise.reject(new qe(t,"A feature is required to add/delete/update attachments")):Promise.reject(new qe(t,"this layer doesn't support attachments"))}async function rPt(i,e,t,r,n){const s=await Xk(i);if(await UVe(i,e,n),!s.updateAttachment)throw new qe(n,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,t,r)}async function nPt(i,e,t){const{applyEdits:r}=await Promise.resolve().then(()=>UCe),n=await i.load(),{source:s,globalIdField:o}=n;let a=t;return n.type==="feature"&&n.infoFor3D&&e.deleteFeatures!=null&&o!=null&&(a={...a,globalIdToObjectId:await gPt(i,e.deleteFeatures,o)}),r(n,s,e,t)}async function Rsr(i,e,t){const{uploadAssets:r}=await Promise.resolve().then(()=>UCe),n=await i.load();return r(n,n.source,e,t)}async function sPt(i,e,t,r){const n=await Xk(i);if(await UVe(i,e,r),!n.deleteAttachments)throw new qe(r,"Layer source does not support deleteAttachments capability");return n.deleteAttachments(e,t)}async function oPt(i,e,t){const r=(await i.load({signal:e?.signal})).source;if(!r.fetchRecomputedExtents)throw new qe(t,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(e)}async function aPt(i,e,t,r){e=_1e.from(e),await i.load();const n=i.source,s=i.capabilities;if(!s?.data?.supportsAttachment)throw new qe(r,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:u,size:c,start:h,where:p}=e;if(!s?.operations?.supportsQueryAttachments&&(o?.length>0||l?.length>0||c?.length>0||u||h||p))throw new qe(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(a?.length||l?.length||p))throw new qe(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!n.queryAttachments)throw new qe(r,"Layer source does not support queryAttachments capability",e);return n.queryAttachments(e)}async function lPt(i,e,t,r){const n=await Xk(i);if(!n.queryObjectIds)throw new qe(r,"Layer source does not support queryObjectIds capability");return n.queryObjectIds(Kn.from(e)??i.createQuery(),t)}async function uPt(i,e,t,r){const n=await Xk(i);if(!n.queryFeatureCount)throw new qe(r,"Layer source does not support queryFeatureCount capability");return n.queryFeatureCount(Kn.from(e)??i.createQuery(),t)}async function cPt(i,e,t,r){const n=await Xk(i);if(!n.queryExtent)throw new qe(r,"Layer source does not support queryExtent capability");return n.queryExtent(Kn.from(e)??i.createQuery(),t)}async function hPt(i,e,t,r){const n=await Xk(i);if(!n.queryRelatedFeatures)throw new qe(r,"Layer source does not support queryRelatedFeatures capability");return n.queryRelatedFeatures(p3.from(e),t)}async function dPt(i,e,t,r){const n=await Xk(i);if(!n.queryRelatedFeaturesCount)throw new qe(r,"Layer source does not support queryRelatedFeaturesCount capability");return n.queryRelatedFeaturesCount(p3.from(e),t)}async function pPt(i){const e=i.source;if(e?.refresh)try{const{dataChanged:t,updates:r}=await e.refresh();if(r!=null&&(i.sourceJSON={...i.sourceJSON,...r},i.read(r,{origin:"service",url:i.parsedUrl})),t)return!0}catch{}if(i.definitionExpression)try{return(await Ine(i.definitionExpression,i.fieldsIndex)).hasDateFunctions}catch{}return!1}function zVe(i){const e=new Kn,t=i.capabilities?.data,r=i.capabilities?.query;e.historicMoment=i.historicMoment,e.gdbVersion=i.gdbVersion,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&i.returnZ!=null&&(e.returnZ=i.returnZ),t.supportsM&&i.returnM!=null&&(e.returnM=i.returnM)),e.outFields=["*"];const{timeOffset:n,timeExtent:s}=i;return e.timeExtent=n!=null&&s!=null?s.offset(-n.value,n.unit):s||null,e.multipatchOption=i.geometryType==="multipatch"?"xyFootprint":null,e}function fPt(i){const{globalIdField:e,fields:t}=i;if(e)return e;if(t){for(const r of t)if(r.type==="esriFieldTypeGlobalID")return r.name}}function mPt(i){const{objectIdField:e,fields:t}=i;if(e)return e;if(t){for(const r of t)if(r.type==="esriFieldTypeOID")return r.name}}function Dsr(i){return i.currentVersion?i.currentVersion:i.hasOwnProperty("capabilities")||i.hasOwnProperty("drawingInfo")||i.hasOwnProperty("hasAttachments")||i.hasOwnProperty("htmlPopupType")||i.hasOwnProperty("relationships")||i.hasOwnProperty("timeInfo")||i.hasOwnProperty("typeIdField")||i.hasOwnProperty("types")?10:9.3}async function Xk(i){return(await i.load()).source}async function Fsr(i,e){if(!no||no.findCredential(i))return;let t;try{const r=await jEt(i,e);r&&(t=await no.checkSignInStatus(`${r}/sharing`))}catch{}if(t)try{const r=e!=null?e.signal:null;await no.getCredential(i,{signal:r})}catch{}}async function u8(i,e,t){const r=i.parsedUrl?.path;r&&i.authenticationTriggerEvent===e&&await Fsr(r,t)}function VVe(i){return!i.sourceJSON?.isMultiServicesView&&(i.userHasUpdateItemPrivileges||i.editingEnabled)}const N3e=zB({types:B3t});function V2e(i,e){if(i.defaultSymbol)return i.types?.length?new JB({defaultSymbol:N3e(i.defaultSymbol,i,e),field:i.typeIdField,uniqueValueInfos:i.types.map(t=>({id:t.id,symbol:N3e(t.symbol,t,e)}))}):new _x({symbol:N3e(i.defaultSymbol,i,e)})}function ksr(i){let e=i.sourceJSON?.cacheMaxAge;if(!e)return!1;const t=i.editingInfo?.lastEditDate?.getTime();return t==null||(e*=1e3,Date.now()-t{let c=null;if("attributes"in u){const{attributes:h}=u;c={globalId:h[t],objectId:h[n]!=null&&h[n]!==-1?h[n]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||r.push(c.globalId))}),r.length===0)return null;const s=i.createQuery();s.where=r.map(u=>`${t}='${u}'`).join(" OR "),s.returnGeometry=!1,s.outFields=[n,t],s.cacheHint=!1;const o=await s5e(Msr(i,s));if(!o.ok)return null;const a=new Map,l=o.value.features;for(const u of l){const c=u.attributes[t],h=u.attributes[n];c!=null&&h!=null&&h!==-1&&a.set(c,h)}return a}let UG=class extends xs(Ci){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};x([D({type:String,json:{read:{source:"shapeAreaFieldName"}}})],UG.prototype,"shapeAreaField",void 0),x([D({type:String,json:{read:{source:"shapeLengthFieldName"}}})],UG.prototype,"shapeLengthField",void 0),x([D({type:String,json:{read:i=>Cne.read(i)||uR.read(i)}})],UG.prototype,"units",void 0),UG=x([Qe("esri.layers.support.GeometryFieldsInfo")],UG);const Lsr=UG;var cLe;let zG=cLe=class extends Ci{constructor(i){super(i),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new dr}clone(){return new cLe({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};x([D({type:String,json:{write:!0}})],zG.prototype,"floorField",void 0),x([D({json:{read:!1,write:!1}})],zG.prototype,"viewAllMode",void 0),x([D({json:{read:!1,write:!1}})],zG.prototype,"viewAllLevelIds",void 0),zG=cLe=x([Qe("esri.layers.support.LayerFloorInfo")],zG);const HVe=zG,Vst=new Rs({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),Hst=new Rs({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let E2=class extends xs(Ci){constructor(e){super(e),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};x([D({json:{read:Vst.read,write:Vst.write}})],E2.prototype,"cardinality",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"composite",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"id",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"keyField",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"keyFieldInRelationshipTable",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"name",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"relatedTableId",void 0),x([D({json:{read:!0,write:!0}})],E2.prototype,"relationshipTableId",void 0),x([D({json:{read:Hst.read,write:Hst.write}})],E2.prototype,"role",void 0),E2=x([Qe("esri.layers.support.Relationship")],E2);const Nsr=E2;function Go(i,e,t){return!!yPt(i,e,t)}function CQ(i,e,t){return yPt(i,e,t)}function yPt(i,e,t){return i&&i.hasOwnProperty(e)?i[e]:t}const $sr={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function Bsr(i){const e=i?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function Cae(i,e){return!!i?.supportedOperationsWithCacheHint?.map(r=>r.toLowerCase())?.includes(e.toLowerCase())}function WVe(i,e){return{analytics:jsr(i),attachment:Gsr(i),data:Usr(i),metadata:zsr(i),operations:Vsr(i.capabilities,i,e),query:Hsr(i,e),queryRelated:Wsr(i),queryTopFeatures:qsr(i),editing:Ysr(i)}}function jsr(i){return{supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryAnalytics")}}function Gsr(i){const e=i.attachmentProperties,t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryAttachments"),supportsResize:Go(i,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(r=>{const n=$sr[r.name];n&&(t[n]=!!r.isEnabled)}),t}function Usr(i){return{isVersioned:Go(i,"isDataVersioned",!1),supportsAttachment:Go(i,"hasAttachments",!1),supportsM:Go(i,"hasM",!1),supportsZ:Go(i,"hasZ",!1)}}function zsr(i){return{supportsAdvancedFieldProperties:Go(i,"supportsFieldDescriptionProperty",!1)}}function Vsr(i,e,t){const r=i?i.toLowerCase().split(",").map(p=>p.trim()):[],n=t?r_(t):null,s=r.includes(n!=null&&n.serverType==="MapServer"?"data":"query"),o=r.includes("editing")&&!e.datesInUnknownTimezone;let a=o&&r.includes("create"),l=o&&r.includes("delete"),u=o&&r.includes("update");const c=r.includes("changetracking"),h=e.advancedQueryCapabilities;return o&&!(a||l||u)&&(a=l=u=!0),{supportsCalculate:Go(e,"supportsCalculate",!1),supportsTruncate:Go(e,"supportsTruncate",!1),supportsValidateSql:Go(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:c,supportsQuery:s,supportsQueryAnalytics:Go(h,"supportsQueryAnalytic",!1),supportsQueryAttachments:Go(h,"supportsQueryAttachments",!1),supportsQueryTopFeatures:Go(h,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:Go(e,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:u,supportsExceedsLimitStatistics:Go(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:Go(e,"supportsAsyncConvert3D",!1)}}function Hsr(i,e){const t=i.advancedQueryCapabilities,r=i.ownershipBasedAccessControlForFeatures,n=i.archivingInfo,s=i.currentVersion,o=e?.includes("MapServer"),a=!o||s>=yi("mapserver-pbf-version-support"),l=Fx(e),u=new Set((i.supportedQueryFormats??"").split(",").map(c=>c.toLowerCase().trim()));return{supportsStatistics:Go(t,"supportsStatistics",i.supportsStatistics),supportsPercentileStatistics:Go(t,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Go(t,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Bsr(t),supportsCentroid:Go(t,"supportsReturningGeometryCentroid",!1),supportsDistance:Go(t,"supportsQueryWithDistance",!1),supportsDistinct:Go(t,"supportsDistinct",i.supportsAdvancedQueries),supportsExtent:Go(t,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Go(t,"supportsReturningGeometryProperties",!1),supportsHavingClause:Go(t,"supportsHavingClause",!1),supportsOrderBy:Go(t,"supportsOrderBy",i.supportsAdvancedQueries),supportsPagination:Go(t,"supportsPagination",!1),supportsQuantization:Go(i,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Go(i,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Go(i,"supportsReturningQueryGeometry",!1),supportsResultType:Go(t,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Go(t,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Go(t,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Go(i,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Go(t,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:Go(r,"allowAnonymousToQuery",!0),supportsQueryByOthers:Go(r,"allowOthersToQuery",!0),supportsHistoricMoment:Go(n,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&u.has("pbf"),supportsDisjointSpatialRelationship:Go(t,"supportsDisjointSpatialRel",!1),supportsCacheHint:Go(t,"supportsQueryWithCacheHint",!1)||Cae(t,"query"),supportsDefaultSpatialReference:Go(t,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:Go(t,"supportsFullTextSearch",!1),maxRecordCountFactor:CQ(i,"maxRecordCountFactor",void 0),maxRecordCount:CQ(i,"maxRecordCount",void 0),standardMaxRecordCount:CQ(i,"standardMaxRecordCount",void 0),tileMaxRecordCount:CQ(i,"tileMaxRecordCount",void 0)}}function Wsr(i){const e=i.advancedQueryCapabilities,t=Go(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Go(e,"supportsQueryRelatedPagination",!1),supportsCount:t,supportsOrderBy:t,supportsCacheHint:Cae(e,"queryRelated")}}function qsr(i){return{supportsCacheHint:Cae(i.advancedQueryCapabilities,"queryTopFilter")}}function Ysr(i){const e=i.ownershipBasedAccessControlForFeatures,t=i?i.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:Go(i,"allowGeometryUpdates",!0),supportsGlobalId:Go(i,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Go(i,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:Go(i,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Go(i,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Go(i,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Go(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Go(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Go(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Go(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:Go(t,"supportsAsyncApplyEdits",!1),zDefault:CQ(i,"zDefault",void 0)}}let JM=class extends xs(Ci){constructor(e){super(e),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=j2e(e[r]);return t}writeDomains(e,t){if(!e)return;const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());t.domains=r}};x([D({type:Number,json:{write:!0}})],JM.prototype,"code",void 0),x([D({type:Object,json:{write:!0}})],JM.prototype,"defaultValues",void 0),x([D({json:{write:!0}})],JM.prototype,"domains",void 0),x([Mi("domains")],JM.prototype,"readDomains",null),x([ur("domains")],JM.prototype,"writeDomains",null),x([D({type:String,json:{write:!0}})],JM.prototype,"name",void 0),JM=x([Qe("esri.layers.support.Subtype")],JM);const Xsr=JM,qVe=i=>{let e=class extends i{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(dr.ofType(HI)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Xi.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:t}=this;if(t){const{query:n,operations:s,editing:o}=t;if(!n.supportsQueryByOthers||!n.supportsQueryByAnonymous||s.supportsEditing&&!(o.supportsUpdateByOthers&&o.supportsUpdateByAnonymous&&o.supportsDeleteByOthers&&o.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(ksr(this))return"load";if(this.hasUpdateItemRestrictions)return t.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const r=this.editFieldsInfo;return(r?.creatorField||r?.editorField)&&t?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(t,r){return WVe(r,this.url)}readEditingInfo(t,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}get effectiveCapabilities(){const t=this.capabilities;if(!t)return null;const r=li(t),{operations:n,editing:s}=r;return this.sourceJSON?.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(n.supportsQuery=!0),r):this.userHasUpdateItemPrivileges?(n.supportsAdd=n.supportsDelete=n.supportsEditing=n.supportsQuery=n.supportsUpdate=s.supportsDeleteByOthers=s.supportsGeometryUpdate=s.supportsUpdateByOthers=!0,r):(this.userHasFullEditingPrivileges&&n.supportsEditing&&(n.supportsAdd=n.supportsDelete=n.supportsUpdate=s.supportsGeometryUpdate=!0),r)}readGlobalIdFieldFromService(t,r){return fPt(r)}get hasFullEditingRestrictions(){const t=this.capabilities;if(!t||this.sourceJSON?.isMultiServicesView)return!1;const{operations:r,editing:n}=t;return r.supportsEditing&&!(r.supportsAdd&&r.supportsDelete&&r.supportsUpdate&&n.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const t=this.capabilities;if(!t)return!1;const{operations:r,editing:n}=t;return this.sourceJSON?.isMultiServicesView?!r.supportsQuery:!(r.supportsAdd&&r.supportsDelete&&r.supportsEditing&&r.supportsQuery&&r.supportsUpdate&&n.supportsDeleteByOthers&&n.supportsGeometryUpdate&&n.supportsUpdateByOthers)}readIsTableFromService(t,r){return r.type==="Table"}readMaxScale(t,r){return r.effectiveMaxScale||t||0}readMinScale(t,r){return r.effectiveMinScale||t||0}readObjectIdFieldFromService(t,r){return mPt(r)}readServiceDefinitionExpression(t,r){return r.definitionQuery||r.definitionExpression}set url(t){const r=mOt({layer:this,url:t,nonStandardUrlAllowed:!0,logger:di.getLogger(this)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(t,r,n,s){gOt(this,t,null,r,s)}readVersion(t,r){return Dsr(r)}};return x([D({readOnly:!0})],e.prototype,"authenticationTriggerEvent",null),x([D({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),x([D({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities")],e.prototype,"readCapabilitiesFromService",null),x([D(XF("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),x([D({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),x([D({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),x([D({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],e.prototype,"displayField",void 0),x([D({readOnly:!0,type:Asr})],e.prototype,"editFieldsInfo",void 0),x([D({readOnly:!0})],e.prototype,"editingInfo",void 0),x([Mi("editingInfo")],e.prototype,"readEditingInfo",null),x([D({readOnly:!0})],e.prototype,"effectiveCapabilities",null),x([D((()=>{const t=li(jR),r=t.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},t})())],e.prototype,"elevationInfo",void 0),x([D({type:HVe,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:Wv}}}}})],e.prototype,"floorInfo",void 0),x([D({type:hr,json:{origins:{service:{read:{source:"extent"}}}}})],e.prototype,"fullExtent",void 0),x([D()],e.prototype,"gdbVersion",void 0),x([D({readOnly:!0,type:Lsr,json:{read:{source:"geometryProperties"}}})],e.prototype,"geometryFieldsInfo",void 0),x([D({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:uLe.read}}}})],e.prototype,"geometryType",void 0),x([D({type:String})],e.prototype,"globalIdField",void 0),x([Mi("service","globalIdField",["globalIdField","fields"])],e.prototype,"readGlobalIdFieldFromService",null),x([D({readOnly:!0})],e.prototype,"hasFullEditingRestrictions",null),x([D({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasM",void 0),x([D({readOnly:!0})],e.prototype,"hasUpdateItemRestrictions",null),x([D({type:Boolean,json:{origins:{service:{read:!0}}}})],e.prototype,"hasZ",void 0),x([D({readOnly:!0,type:DY})],e.prototype,"heightModelInfo",void 0),x([D({type:Date})],e.prototype,"historicMoment",void 0),x([D({type:dr.ofType(HI),readOnly:!0})],e.prototype,"indexes",void 0),x([D({readOnly:!0})],e.prototype,"isTable",void 0),x([Mi("service","isTable",["type"])],e.prototype,"readIsTableFromService",null),x([D({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],e.prototype,"layerId",void 0),x([D(GVe)],e.prototype,"maxScale",void 0),x([Mi("service","maxScale",["maxScale","effectiveMaxScale"])],e.prototype,"readMaxScale",null),x([D(jVe)],e.prototype,"minScale",void 0),x([Mi("service","minScale",["minScale","effectiveMinScale"])],e.prototype,"readMinScale",null),x([D({type:String})],e.prototype,"objectIdField",void 0),x([Mi("service","objectIdField",["objectIdField","fields"])],e.prototype,"readObjectIdFieldFromService",null),x([D(XF("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),x([D({type:[Nsr],readOnly:!0})],e.prototype,"relationships",void 0),x([D({type:Boolean})],e.prototype,"returnM",void 0),x([D({type:Boolean})],e.prototype,"returnZ",void 0),x([D({readOnly:!0,json:{write:!1}})],e.prototype,"serverGens",void 0),x([D({readOnly:!0})],e.prototype,"serviceDefinitionExpression",void 0),x([Mi("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],e.prototype,"readServiceDefinitionExpression",null),x([D({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"serviceItemId",void 0),x([D()],e.prototype,"sourceJSON",void 0),x([D({type:Xi,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],e.prototype,"spatialReference",void 0),x([D({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],e.prototype,"subtypeField",void 0),x([D({type:[Xsr],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],e.prototype,"subtypes",void 0),x([D({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],e.prototype,"trackIdField",void 0),x([D(C0)],e.prototype,"url",null),x([ur("url")],e.prototype,"writeUrl",null),x([D({json:{origins:{service:{read:!0}},read:!1}})],e.prototype,"version",void 0),x([Mi("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.FeatureLayerBase")],e),e};let VG=class extends xs(Ci){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};x([D({type:String,json:{write:!0}})],VG.prototype,"expression",void 0),x([D({type:String,json:{write:!0}})],VG.prototype,"title",void 0),x([D({type:String,json:{write:!0}})],VG.prototype,"returnType",void 0),VG=x([Qe("esri.layers.support.ExpressionInfo")],VG);const YVe=VG;var hLe;let KM=hLe=class extends Ci{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new hLe({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:li(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};x([D({type:Boolean,json:{write:!0}})],KM.prototype,"isAutoGenerated",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"alias",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"onStatisticField",void 0),x([D({type:YVe,json:{write:!0}})],KM.prototype,"onStatisticExpression",void 0),x([D({type:String,json:{write:!0}})],KM.prototype,"statisticType",void 0),KM=hLe=x([Qe("esri.layers.support.AggregateField")],KM);const lB=KM;let GP=class extends Ci{constructor(){super(...arguments),this.type=null}};x([D({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],GP.prototype,"type",void 0),GP=x([Qe("esri.layers.support.FeatureReduction")],GP);const XVe="__begin__",JVe="__end__",Jsr=new RegExp(XVe,"ig"),Ksr=new RegExp(JVe,"ig"),Wst=new RegExp("^"+XVe,"i"),qst=new RegExp(JVe+"$","i"),b1e='"',Zsr=b1e+" + ",Qsr=" + "+b1e;function vPt(i){return i.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function eor(i){return i.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function KVe(i){const e={expression:"",type:"none"};return i.labelExpressionInfo?i.labelExpressionInfo.value?(e.expression=i.labelExpressionInfo.value,e.type="conventional"):i.labelExpressionInfo.expression&&(e.expression=i.labelExpressionInfo.expression,e.type="arcade"):i.labelExpression!=null&&(e.expression=vPt(i.labelExpression),e.type="conventional"),e}function tor(i){const e=KVe(i);if(!e)return null;switch(e.type){case"conventional":return dLe(e.expression);case"arcade":return e.expression}return null}function ior(i){const e=KVe(i);if(!e)return null;switch(e.type){case"conventional":return nor(e.expression);case"arcade":return _Pt(e.expression)}return null}function dLe(i){let e;return i?(e=m0(i,t=>XVe+'$feature["'+t+'"]'+JVe),e=Wst.test(e)?e.replace(Wst,""):b1e+e,e=qst.test(e)?e.replace(qst,""):e+b1e,e=e.replaceAll(Jsr,Zsr).replaceAll(Ksr,Qsr)):e='""',e}const ror=/^\s*\{([^}]+)\}\s*$/i;function nor(i){return i?.match(ror)?.[1].trim()||null}const sor=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,oor=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,aor=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function _Pt(i){if(!i)return null;let e=sor.exec(i)||oor.exec(i);return e?e[1]||e[3]:(e=aor.exec(i),e?e[2]:null)}var pLe;let y4=pLe=class extends Ci{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(i,e){return e.value?dLe(e.value):i}writeExpression(i,e,t){this.value!=null&&(i=dLe(this.value)),i!=null&&(e[t]=i)}clone(){return new pLe({expression:this.expression,title:this.title,value:this.value})}};x([D({type:String,json:{write:{writerEnsuresNonNull:!0}}})],y4.prototype,"expression",void 0),x([Mi("expression",["expression","value"])],y4.prototype,"readExpression",null),x([ur("expression")],y4.prototype,"writeExpression",null),x([D({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],y4.prototype,"title",void 0),x([D({json:{read:!1,write:!1}})],y4.prototype,"value",void 0),y4=pLe=x([Qe("esri.layers.support.LabelExpressionInfo")],y4);const bPt=y4,wPt=[252,146,31,255],xPt={type:"esriSMS",style:"esriSMSCircle",size:6,color:wPt,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},SPt={type:"esriSLS",style:"esriSLSSolid",width:.75,color:wPt},TPt={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},lor={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},uor={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},cor={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},hor={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},dor=Jh.fromJSON(xPt),CPt=vg.fromJSON(SPt),por=Hx.fromJSON(TPt),mor=qB.fromJSON(lor),gor=Jh.fromJSON(uor),yor=vg.fromJSON(cor),vor=Hx.fromJSON(hor);var fLe;const ohe=new Rs({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function ahe(i,e,t){return{enabled:!BEt(t?.layer)}}function EPt(i){return!i||i.origin!=="service"&&i.layer?.type!=="map-image"}function _or(i){return i?.type==="map-image"}function IPt(i){return!!_or(i)&&!!i.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function bor(i){return EPt(i)||IPt(i?.layer)}let Ip=fLe=class extends Ci{static evaluateWhere(i,e){const t=(r,n,s)=>{switch(n){case"=":return r==s;case"<>":return r!=s;case">":return r>s;case">=":return r>=s;case"<":return rbor(t)?{allowNull:!0}:{enabled:!1}}}})],Ip.prototype,"labelExpressionInfo",void 0),x([ur("labelExpressionInfo")],Ip.prototype,"writeLabelExpressionInfo",null),x([D({type:ohe.apiValues,json:{type:ohe.jsonValues,read:ohe.read,write:ohe.write}})],Ip.prototype,"labelPlacement",void 0),x([D({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],Ip.prototype,"labelPosition",void 0),x([D({type:Number})],Ip.prototype,"maxScale",void 0),x([ur("maxScale")],Ip.prototype,"writeMaxScale",null),x([D({type:Number})],Ip.prototype,"minScale",void 0),x([ur("minScale")],Ip.prototype,"writeMinScale",null),x([D({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:ahe}}}}})],Ip.prototype,"repeatLabel",void 0),x([D({type:Number,cast:Cl,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:ahe}}}}})],Ip.prototype,"repeatLabelDistance",void 0),x([D({types:ver,json:{origins:{"web-scene":{types:_er,write:Bnt,default:null}},write:Bnt,default:null}})],Ip.prototype,"symbol",void 0),x([D({type:Boolean,json:{write:!0}})],Ip.prototype,"useCodedValues",void 0),x([D({type:String,json:{write:!0}})],Ip.prototype,"where",void 0),Ip=fLe=x([Qe("esri.layers.support.LabelClass")],Ip);const rT=Ip;var mLe;const wor="esri.layers.support.FeatureReductionBinning";let c1=mLe=class extends GP{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(i,e,t){const r=i.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Qp(t,r,e)}readRenderer(i,e,t){const r=e.drawingInfo?.renderer;return r?sB(r,e,t)??void 0:V2e(e,t)}clone(){return new mLe({fields:li(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:li(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:li(this.popupTemplate),renderer:li(this.renderer)})}};x([Wr({binning:"binning"})],c1.prototype,"type",void 0),x([Wr({geohash:"geohash"})],c1.prototype,"binType",void 0),x([D({type:Number,range:{min:1,max:9},json:{write:!0}})],c1.prototype,"fixedBinLevel",void 0),x([D({type:[rT],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],c1.prototype,"labelingInfo",void 0),x([D(H3)],c1.prototype,"labelsVisible",void 0),x([D({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],c1.prototype,"maxScale",void 0),x([D(h_)],c1.prototype,"popupEnabled",void 0),x([D({type:qc,json:{name:"popupInfo",write:!0}})],c1.prototype,"popupTemplate",void 0),x([D({type:[lB],json:{write:!0}})],c1.prototype,"fields",void 0),x([ur("fields")],c1.prototype,"writeFields",null),x([D({types:IE,json:{write:{target:"drawingInfo.renderer"}}})],c1.prototype,"renderer",void 0),x([Mi("renderer",["drawingInfo.renderer"])],c1.prototype,"readRenderer",null),c1=mLe=x([Qe(wor)],c1);const APt=c1;var gLe;const xor="esri.layers.support.FeatureReductionCluster";function Yst(i){return i.type==="simple"&&!i.visualVariables?.length}let Wf=gLe=class extends Ci{constructor(i){super(i),this.type="cluster",this.clusterRadius=Cl("80px"),this.clusterMinSize=Cl("12px"),this.clusterMaxSize=Cl("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,e,t){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r?Yst(r)?null:sB(r,e,t)??void 0:V2e(e,t)}readSymbol(i,e,t){const r=e.drawingInfo?.renderer;return r?.authoringInfo?.isAutoGenerated?null:r&&Yst(r)?sB(r,e,t)?.symbol:null}writeSymbol(i,e,t,r){const n=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||n){const s=new _x({symbol:i});e.drawingInfo={renderer:s.write({},r)}}}writeFields(i,e,t){const r=i.filter(n=>n.statisticType!=="avg_angle").map(n=>n.toJSON());Qp(t,r,e)}readFields(i,e,t){return i.filter(r=>!r.isAutoGenerated).map(r=>lB.fromJSON(r))}clone(){return new gLe({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:li(this.labelingInfo),labelsVisible:this.labelsVisible,fields:li(this.fields),maxScale:this.maxScale,renderer:li(this.renderer),symbol:li(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:li(this.popupTemplate)})}};x([D({type:["cluster"],readOnly:!0,json:{write:!0}})],Wf.prototype,"type",void 0),x([D({type:Number,cast:i=>i==="auto"?i:Cl(i),json:{write:!0}})],Wf.prototype,"clusterRadius",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],Wf.prototype,"clusterMinSize",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],Wf.prototype,"clusterMaxSize",void 0),x([D({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],Wf.prototype,"maxScale",void 0),x([D(h_)],Wf.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Wf.prototype,"popupTemplate",void 0),x([D({types:IE,json:{write:{target:"drawingInfo.renderer"}}})],Wf.prototype,"renderer",void 0),x([Mi("renderer",["drawingInfo.renderer"])],Wf.prototype,"readRenderer",null),x([D({types:ger})],Wf.prototype,"symbol",void 0),x([Mi("symbol",["drawingInfo.renderer"])],Wf.prototype,"readSymbol",null),x([ur("symbol")],Wf.prototype,"writeSymbol",null),x([D({type:[rT],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Wf.prototype,"labelingInfo",void 0),x([D(H3)],Wf.prototype,"labelsVisible",void 0),x([D({type:[lB],json:{write:!0}})],Wf.prototype,"fields",void 0),x([ur("fields")],Wf.prototype,"writeFields",null),x([Mi("fields")],Wf.prototype,"readFields",null),Wf=gLe=x([Qe(xor)],Wf);const MPt=Wf;var yLe;let Bme=yLe=class extends GP{constructor(i){super(i),this.type="selection"}clone(){return new yLe}};x([D({type:["selection"]})],Bme.prototype,"type",void 0),Bme=yLe=x([Qe("esri.layers.support.FeatureReductionSelection")],Bme);const vLe=Bme,Xst={key:"type",base:GP,typeMap:{cluster:MPt,binning:APt}},Sor={types:{key:"type",base:GP,typeMap:{selection:vLe,cluster:MPt,binning:APt}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:Xst},"portal-item":{types:Xst},"web-scene":{types:{key:"type",base:GP,typeMap:{selection:vLe}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:Wv}}}}},f5={Base64:0,Hex:1,String:2,Raw:3},GV=8,OPt=(1<>16)+(e>>16)+(t>>16)<<16|65535&t}function Tor(i){const e=[];for(let t=0,r=i.length*GV;t>5]|=(i.charCodeAt(t/GV)&OPt)<>5]>>>t%32&OPt));return e.join("")}function Eor(i){const e="0123456789abcdef",t=[];for(let r=0,n=4*i.length;r>2]>>r%4*8+4&15)+e.charAt(i[r>>2]>>r%4*8&15));return t.join("")}function Ior(i){const e="=",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[];for(let n=0,s=4*i.length;n>2]>>n%4*8&255)<<16|(i[n+1>>2]>>(n+1)%4*8&255)<<8|i[n+2>>2]>>(n+2)%4*8&255;for(let a=0;a<4;a++)8*n+6*a>32*i.length?r.push(e):r.push(t.charAt(o>>6*(3-a)&63))}return r.join("")}function Aor(i,e){return i<>>32-e}function H2e(i,e,t,r,n,s){return tF(Aor(tF(tF(e,i),tF(r,s)),n),t)}function P0(i,e,t,r,n,s,o){return H2e(e&t|~e&r,i,e,n,s,o)}function R0(i,e,t,r,n,s,o){return H2e(e&r|t&~r,i,e,n,s,o)}function D0(i,e,t,r,n,s,o){return H2e(e^t^r,i,e,n,s,o)}function F0(i,e,t,r,n,s,o){return H2e(t^(e|~r),i,e,n,s,o)}function Mor(i,e){i[e>>5]|=128<>>9<<4)]=e;let t=1732584193,r=-271733879,n=-1732584194,s=271733878;for(let o=0;odi.getLogger("esri.views.2d.layers.support.clusterUtils");yi.add("esri-cluster-arcade-enabled",!0);const Por=yi("esri-cluster-arcade-enabled"),Ror=new Set(["simple-line","simple-fill","picture-fill"]);function Jst(i,e){let t=e.clone();if(!Dor(t))return t;if(e.getSymbols().some(r=>Ror.has(r.type))&&(t=new _x({symbol:new Jh})),t.authoringInfo||(t.authoringInfo=new vae),t.authoringInfo.isAutoGenerated=!0,"visualVariables"in t){const r=(t.visualVariables||[]).filter(n=>n.valueExpression!=="$view.scale");r.forEach(n=>{n.type==="rotation"?n.field?n.field=jL(i,n.field,"avg_angle","number"):n.valueExpression&&(n.field=kJ(i,n.valueExpression,"avg_angle","number"),n.valueExpression=null):n.normalizationField?(n.field=jL(i,n.field,"avg_norm","number",n.normalizationField),n.normalizationField=null):n.field?n.field=jL(i,n.field,"avg","number"):n.valueExpression&&(n.field=kJ(i,n.valueExpression,"avg","number"),n.valueExpression=null)}),t.visualVariables=r}switch(t.type){case"simple":break;case"pie-chart":for(const r of t.attributes)r.field?r.field=jL(i,r.field,"sum","number"):r.valueExpression&&(r.field=kJ(i,r.valueExpression,"sum","number"),r.valueExpression=null);break;case"unique-value":t.field?t.field=jL(i,t.field,"mode","string"):t.valueExpression&&(t.field=kJ(i,t.valueExpression,"mode","string"),t.valueExpression=null);break;case"class-breaks":t.normalizationField?(t.field=jL(i,t.field,"avg_norm","number",t.normalizationField),t.normalizationField=null):t.field?t.field=jL(i,t.field,"avg","number"):t.valueExpression&&(t.field=kJ(i,t.valueExpression,"avg","number"),t.valueExpression=null)}return t}const Dor=i=>{const e=t=>Oor().error(new qe("Unsupported-renderer",t,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return e("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const t=i.normalizationType;if(t!=="field")return e(`FeatureReductionCluster does not support a normalizationType of ${t}`),!1}break;case"simple":case"pie-chart":break;default:return e(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!Por){if("valueExpression"in i&&i.valueExpression)return e("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(t=>!(!("valueExpression"in t)||!t.valueExpression)))return e("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function For(i,e,t){switch(i){case"sum":return`cluster_sum_${e}`;case"avg":case"avg_angle":return`cluster_avg_${e}`;case"mode":return`cluster_type_${e}`;case"avg_norm":{const r=t,n="field",s=e.toLowerCase()+",norm:"+n+","+r.toLowerCase();return"cluster_avg_"+Eae(s)}}}function kJ(i,e,t,r){const n=Eae(e),s=t==="mode"?`cluster_type_${n}`:t==="sum"?`cluster_sum_${n}`:`cluster_avg_${n}`;return i.some(o=>o.name===s)||i.push(new lB({name:s,isAutoGenerated:!0,onStatisticExpression:new YVe({expression:e,returnType:r}),statisticType:t})),s}function jL(i,e,t,r,n){if(e==="cluster_count"||i.some(o=>o.name===e))return e;const s=For(t,e,n);return i.some(o=>o.name===s)||(t==="avg_norm"?i.push(new lB({name:s,isAutoGenerated:!0,onStatisticExpression:new YVe({expression:`$feature.${e} / $feature.${n}`,returnType:r}),statisticType:"avg"})):i.push(new lB({name:s,isAutoGenerated:!0,onStatisticField:e,statisticType:t}))),s}const NY=i=>{let e=class extends i{constructor(...t){super(...t),this.addHandles(Ki(()=>this.renderer,()=>{if(this.featureReduction){const r=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",r)}},Kl))}set featureReduction(t){const r=this._normalizeFeatureReduction(t);this._set("featureReduction",r)}set renderer(t){}_withClusterVariable(t,r,n){const s=t.clone();return"visualVariables"in s&&(s.visualVariables||(s.visualVariables=[]),s.visualVariables.some(o=>o.type==="size")||s.visualVariables.push(new CY({field:"cluster_count",stops:[new bme({value:1}),new bme({useMinValue:!0,size:r}),new bme({useMaxValue:!0,size:n})]}))),s}_normalizeFeatureReduction(t){if(t?.type!=="cluster")return t;const r=t.clone(),n=[new lB({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],s=(r.fields??[]).filter(h=>!h.isAutoGenerated),o=t.renderer&&!t.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:a,clusterMaxSize:l}=r;if(o){r.fields=[...n,...s];const h=this._withClusterVariable(r.renderer,a,l);return r.effectiveFeatureRenderer=h,r.effectiveClusterRenderer=h,r}if(t.symbol){if(r.fields=[...n,...s],r.renderer=null,!this.renderer)return r.effectiveFeatureRenderer=null,r.effectiveClusterRenderer=null,r;const h=Jst(n,this.renderer),p=this._withClusterVariable(h,a,l),m="visualVariables"in p&&p.visualVariables?p.visualVariables:[],v=new _x({symbol:t.symbol,visualVariables:m});return r.fields=[...n,...s],r.effectiveFeatureRenderer=p,r.effectiveClusterRenderer=v,r}if(!this.renderer)return t;const u=Jst(n,this.renderer);r.fields=[...n,...s],r.renderer=u;const c=this._withClusterVariable(u,a,l);return r.effectiveFeatureRenderer=c,r.effectiveClusterRenderer=c,r}};return x([D(Sor)],e.prototype,"featureReduction",null),e=x([Qe("esri.layers.mixins.FeatureReductionLayer")],e),e},Kst={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},Zst={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},Qst={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},kor={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":Kst,"web-map/basemap":Zst,"web-map/tables":Qst,"link-chart/operational-layers":{...Kst,LinkChartLayer:!0},"link-chart/basemap":Zst,"link-chart/tables":Qst,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}},Rc=i=>{let e=class extends i{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(t,r,n){return n?.portalItem?.type==="Group Layer"?void 0:t}writeListMode(t,r,n,s){(s&&s.layerContainerType==="ground"||t&&zCt(this,n,{},s))&&(r[n]=t)}writeOperationalLayerType(t,r,n,s){t&&s?.layerContainerType!=="tables"&&(r.layerType=t)}writeTitle(t,r){r.title=t??"Layer"}read(t,r){r&&(r.layer=this),aWi(this,t,n=>super.read(t,n),r)}write(t,r){if(!this.persistenceEnabled)return null;if(r?.origin){const o=`${r.origin}/${r.layerContainerType||"operational-layers"}`;let l=!!kor[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(l=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(l=!1),!l)return r.messages?.push(new qe("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const n=super.write(t,{...r,layer:this}),s=!!r&&!!r.messages&&!!r.messages.filter(o=>o instanceof qe&&o.name==="web-document-write:property-required").length;return aR(n?.url)?(r?.messages?.push(new qe("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:n}beforeSave(){}};return x([D({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],e.prototype,"id",void 0),x([Mi("id",["id"])],e.prototype,"readId",null),x([D(ePt)],e.prototype,"listMode",void 0),x([ur("listMode")],e.prototype,"writeListMode",null),x([D({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:Wv}}}}})],e.prototype,"operationalLayerType",void 0),x([ur("operationalLayerType")],e.prototype,"writeOperationalLayerType",null),x([D(aB)],e.prototype,"opacity",void 0),x([D({type:Boolean,readOnly:!1})],e.prototype,"persistenceEnabled",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],e.prototype,"title",void 0),x([ur("title"),ur(["web-scene"],"title")],e.prototype,"writeTitle",null),x([D({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:Wv}}},name:"visibility",write:!0}})],e.prototype,"visible",void 0),e=x([Qe("esri.layers.mixins.OperationalLayer")],e),e};var _Le;const $3e=new Rs({asc:"ascending",desc:"descending"});let HG=_Le=class extends Ci{constructor(i){super(i),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new _Le({field:this.field,valueExpression:this.valueExpression,order:this.order})}};x([D({type:String,json:{write:!0}})],HG.prototype,"field",void 0),x([D({type:String,json:{write:!0}})],HG.prototype,"valueExpression",void 0),x([D({type:$3e.apiValues,json:{read:$3e.read,write:$3e.write}})],HG.prototype,"order",void 0),HG=_Le=x([Qe("esri.layers.support.OrderByInfo")],HG);const W2e=HG;function Lor(i,e,t){if(!i)return null;const r=i.find(s=>!!s.field);if(!r)return null;const n=new W2e;return n.read(r,t),[n]}function Nor(i,e,t,r){const n=i.find(s=>!!s.field);n&&Qp(t,[n.toJSON()],e)}const Iae=i=>{let e=class extends i{constructor(){super(...arguments),this.orderBy=null}};return x([D({type:[W2e],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:Lor},write:{target:"layerDefinition.orderBy",writer:Nor}}})],e.prototype,"orderBy",void 0),e=x([Qe("esri.layers.mixins.OrderedLayer")],e),e},_D=Td.radius,fT=Td.eccentricitySquared,$or={a1:_D*fT,a2:_D*fT*_D*fT,a3:_D*fT*fT/2,a4:_D*fT*_D*fT*2.5,a5:_D*fT+_D*fT*fT/2,a6:1-fT};1/294.9786982,1/298.257222101,Td.radius,Td.flattening,1/298.257222101,VF.radius,VF.flattening,1/192.0430107526882,GA.radius,GA.flattening,1/10.2079945799458,1/43.61604095563141,GA.radius;var Gi;(function(i){i[i.UNKNOWN=0]="UNKNOWN",i[i.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",i[i.WGS84=2]="WGS84",i[i.WEB_MERCATOR=3]="WEB_MERCATOR",i[i.WGS84_ECEF=4]="WGS84_ECEF",i[i.CGCS2000=5]="CGCS2000",i[i.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",i[i.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",i[i.GCSMARS2000=8]="GCSMARS2000",i[i.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",i[i.GCSMOON2000=10]="GCSMOON2000",i[i.LON_LAT=11]="LON_LAT",i[i.PLATE_CARREE=12]="PLATE_CARREE"})(Gi||(Gi={}));const Lz={[Gi.WGS84]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:jne,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.CGCS2000]:{[Gi.CGCS2000]:th,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:p8},[Gi.GCSMARS2000]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:th,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:tot,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.GCSMOON2000]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:th,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:eot,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.WEB_MERCATOR]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:Rie,[Gi.WGS84_COMPARABLE_LON_LAT]:Rie,[Gi.SPHERICAL_ECEF]:jor,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:th,[Gi.PLATE_CARREE]:zor,[Gi.WGS84]:Rie,[Gi.WGS84_ECEF]:Gor},[Gi.WGS84_ECEF]:{[Gi.CGCS2000]:f8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:f8,[Gi.WGS84_COMPARABLE_LON_LAT]:f8,[Gi.SPHERICAL_ECEF]:Zor,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:Qor,[Gi.PLATE_CARREE]:Vor,[Gi.WGS84]:f8,[Gi.WGS84_ECEF]:th},[Gi.SPHERICAL_ECEF]:{[Gi.CGCS2000]:d8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:d8,[Gi.WGS84_COMPARABLE_LON_LAT]:d8,[Gi.SPHERICAL_ECEF]:th,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:Xor,[Gi.PLATE_CARREE]:Hor,[Gi.WGS84]:d8,[Gi.WGS84_ECEF]:Jor},[Gi.SPHERICAL_MARS_PCPF]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:rot,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:rot,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:th,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.SPHERICAL_MOON_PCPF]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:iot,[Gi.LON_LAT]:iot,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:th,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.UNKNOWN]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:null,[Gi.WGS84_COMPARABLE_LON_LAT]:null,[Gi.SPHERICAL_ECEF]:null,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:th,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:null,[Gi.WGS84]:null,[Gi.WGS84_ECEF]:null},[Gi.LON_LAT]:{[Gi.CGCS2000]:th,[Gi.GCSMARS2000]:th,[Gi.GCSMOON2000]:th,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:tot,[Gi.SPHERICAL_MOON_PCPF]:eot,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:jne,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.WGS84_COMPARABLE_LON_LAT]:{[Gi.CGCS2000]:null,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:th,[Gi.WGS84_COMPARABLE_LON_LAT]:th,[Gi.SPHERICAL_ECEF]:Nz,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:null,[Gi.PLATE_CARREE]:c8,[Gi.WGS84]:th,[Gi.WGS84_ECEF]:p8},[Gi.PLATE_CARREE]:{[Gi.CGCS2000]:h8,[Gi.GCSMARS2000]:null,[Gi.GCSMOON2000]:null,[Gi.LON_LAT]:h8,[Gi.WGS84_COMPARABLE_LON_LAT]:h8,[Gi.SPHERICAL_ECEF]:Wor,[Gi.SPHERICAL_MARS_PCPF]:null,[Gi.SPHERICAL_MOON_PCPF]:null,[Gi.UNKNOWN]:null,[Gi.WEB_MERCATOR]:qor,[Gi.PLATE_CARREE]:th,[Gi.WGS84]:h8,[Gi.WGS84_ECEF]:Yor}};function Bor(i){const e=Bne(i,RPt);return Lz[e][Gi.WGS84_COMPARABLE_LON_LAT]}function q2e(i,e,t=PPt()){return i==null||e==null?null:ear(i,e,t).projector}function Bne(i,e){return i?e.spatialReference===i?e.spatialReferenceId:(e.spatialReference=i,"metersPerUnit"in e&&(e.metersPerUnit=pu(i,1)),$ve(i)?e.spatialReferenceId=Gi.SPHERICAL_ECEF:fE(i)?e.spatialReferenceId=Gi.WGS84:Nb(i)?e.spatialReferenceId=Gi.WEB_MERCATOR:c5e(i)?e.spatialReferenceId=Gi.PLATE_CARREE:i.wkt===gie.wkt?e.spatialReferenceId=Gi.WGS84_ECEF:i.wkid===Y9.CGCS2000?e.spatialReferenceId=Gi.CGCS2000:i.wkt===a2e.wkt?e.spatialReferenceId=Gi.SPHERICAL_MARS_PCPF:i.wkt===l2e.wkt?e.spatialReferenceId=Gi.SPHERICAL_MOON_PCPF:dze(i)?e.spatialReferenceId=Gi.GCSMARS2000:pze(i)?e.spatialReferenceId=Gi.GCSMOON2000:e.spatialReferenceId=Gi.UNKNOWN):Gi.UNKNOWN}function th(i,e,t,r){i!==t&&(t[r++]=i[e++],t[r++]=i[e++],t[r]=i[e])}function Rie(i,e,t,r){t[r]=SW*(i[e]/Z8),t[r+1]=SW*(FPt-2*Math.atan(Math.exp(-i[e+1]/Z8))),t[r+2]=i[e+2]}function jor(i,e,t,r){const n=i[e]/Z8,s=FPt-2*Math.atan(Math.exp(-i[e+1]/Z8)),o=Z8+i[e+2],a=Math.cos(s)*o;t[r]=Math.cos(n)*a,t[r+1]=Math.sin(n)*a,t[r+2]=Math.sin(s)*o}function Gor(i,e,t,r){Rie(i,e,t,r),p8(t,r,t,r)}function Uor(i,e,t,r,n){const s=.4999999*Y2e,o=uu(xW*i[e+1],-s,s),a=Math.sin(o);t[r++]=xW*i[e]*n.radius,t[r++]=n.halfSemiMajorAxis*Math.log((1+a)/(1-a)),t[r]=i[e+2]}function jne(i,e,t,r){Uor(i,e,t,r,Td)}function c8(i,e,t,r){t[r]=i[e]*not,t[r+1]=i[e+1]*not,t[r+2]=i[e+2]}function h8(i,e,t,r){t[r]=i[e]*sot,t[r+1]=i[e+1]*sot,t[r+2]=i[e+2]}function zor(i,e,t,r){Rie(i,e,t,r),c8(t,r,t,r)}function Vor(i,e,t,r){f8(i,e,t,r),c8(t,r,t,r)}function Hor(i,e,t,r){d8(i,e,t,r),c8(t,r,t,r)}function Wor(i,e,t,r){h8(i,e,t,r),Nz(t,r,t,r)}function qor(i,e,t,r){h8(i,e,t,r),jne(t,r,t,r)}function Yor(i,e,t,r){h8(i,e,t,r),p8(t,r,t,r)}function ZVe(i,e,t,r,n){const s=n+i[e+2],o=xW*i[e+1],a=xW*i[e],l=Math.cos(o)*s;t[r]=Math.cos(a)*l,t[r+1]=Math.sin(a)*l,t[r+2]=Math.sin(o)*s}function eot(i,e,t,r){ZVe(i,e,t,r,VF.radius)}function tot(i,e,t,r){ZVe(i,e,t,r,GA.radius)}function Nz(i,e,t,r){ZVe(i,e,t,r,Td.radius)}function QVe(i,e,t,r,n){const s=i[e],o=i[e+1],a=i[e+2],l=Math.sqrt(s*s+o*o+a*a),u=iIt(a/(l===0?1:l)),c=Math.atan2(o,s);t[r++]=SW*c,t[r++]=SW*u,t[r]=l-n}function iot(i,e,t,r){QVe(i,e,t,r,VF.radius)}function rot(i,e,t,r){QVe(i,e,t,r,GA.radius)}function d8(i,e,t,r){QVe(i,e,t,r,Td.radius)}function Xor(i,e,t,r){d8(i,e,t,r),jne(t,r,t,r)}function Jor(i,e,t,r){d8(i,e,t,r),p8(t,r,t,r)}function Kor(i,e,t,r,n){const s=xW*i[e],o=xW*i[e+1],a=i[e+2],l=Math.sin(o),u=Math.cos(o),c=n.radius/Math.sqrt(1-n.eccentricitySquared*l*l);t[r++]=(c+a)*u*Math.cos(s),t[r++]=(c+a)*u*Math.sin(s),t[r++]=(c*(1-n.eccentricitySquared)+a)*l}function p8(i,e,t,r){Kor(i,e,t,r,Td)}function f8(i,e,t,r){const n=$or,s=i[e],o=i[e+1],a=i[e+2];let l,u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne;l=Math.abs(a),u=s*s+o*o,c=Math.sqrt(u),h=u+a*a,p=Math.sqrt(h),re=Math.atan2(o,s),m=a*a/h,v=u/h,B=n.a2/p,$=n.a3-n.a4/p,v>.3?(w=l/p*(1+v*(n.a1+B+m*$)/p),Q=Math.asin(w),I=w*w,S=Math.sqrt(1-I)):(S=c/p*(1-m*(n.a5-B-v*$)/p),Q=Math.acos(S),I=1-S*S,w=Math.sqrt(I)),R=1-Td.eccentricitySquared*I,L=Td.radius/Math.sqrt(R),k=n.a6*L,B=c-L*S,$=l-k*w,Y=S*B+w*$,V=S*$-w*B,K=V/(k/R+Y),Q+=K,ne=Y+V*K/2,a<0&&(Q=-Q),t[r++]=SW*re,t[r++]=SW*Q,t[r]=ne}function Zor(i,e,t,r){f8(i,e,t,r),Nz(t,r,t,r)}function Qor(i,e,t,r){f8(i,e,t,r),jne(t,r,t,r)}function ear(i,e,t){if(i==null||e==null||t.source.spatialReference===i&&t.dest.spatialReference===e)return t;const r=Bne(i,t.source),n=Bne(e,t.dest);return r===Gi.UNKNOWN&&n===Gi.UNKNOWN?Ya(i,e)?t.projector=th:t.projector=null:t.projector=Lz[r][n],t}function PPt(){return{source:{spatialReference:null,spatialReferenceId:Gi.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:Gi.UNKNOWN,metersPerUnit:1},projector:th}}const RPt={spatialReference:null,spatialReferenceId:Gi.UNKNOWN},tar={spatialReference:null,spatialReferenceId:Gi.UNKNOWN},DPt=PPt(),xW=Rx(1),SW=yb(1),Y2e=Math.PI,FPt=.5*Y2e,Z8=Td.radius,not=Z8*Y2e/180,sot=180/(Z8*Y2e);function sy(i,e,t,r,n,s,o=1){const a=q2e(e,n,DPt);if(a==null)return!1;if(a===th){if(i===r&&t===s)return!0;const u=t+3*o;for(let c=t,h=s;c=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}getGTListEntry(){let e="";for(const t of this.steps)e+=t.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,t,r){this._cachedProjection[EQ.cacheKey(e,t)]=r}getCachedGeTransformation(e,t){let r="";for(const s of this.steps)r+=s.uid.toString()+",";r!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=r);const n=this._cachedProjection[EQ.cacheKey(e,t)];return n===void 0?null:n}},XC=null,ek=null,Die=null,jme={};const eHe=new pY;function qx(){return!!XC&&hze()}function kPt(){return!!qx()||(Ws(eHe),FS(),!1)}function LPt(i,e){return!i||!e||_0(i,e)||kPt()}function rar(i,e){return!_0(i,e)&&!qx()}function FS(i){return Die==null&&(Die=Promise.all([fEt(),Promise.resolve().then(()=>u7r).then(e=>e.g),Promise.resolve().then(()=>Fon)])),Die.then(([,e,{hydratedAdapter:t}])=>{hn(i),ek=t,XC=e.default,XC._enableProjection(Sqi),eHe.notify()})}function Wc(i,e,t=null,r=null){return Array.isArray(i)?i.length===0?[]:TW(ek,i,i[0].spatialReference,e,t,r):TW(ek,[i],i.spatialReference,e,t,r)[0]}function TW(i,e,t,r,n=null,s=null){if(t==null||r==null)return e;if(_0(t,r,n))return e.map(o=>Fie(o,t,r));if(n==null&&$ve(t))return e.map(o=>Fie(o,t,Xi.WGS84)).map(o=>CW(o,r));if(n==null&&$ve(r))return e.map(o=>CW(o,Xi.WGS84)).map(o=>Fie(o,Xi.WGS84,r));if(n==null){const o=Gne.cacheKey(t,r);jme[o]!==void 0?n=jme[o]:((n=Une(t,r,void 0))==null&&(n=new Gne),jme[o]=n)}if(XC==null||i==null)throw new X2e;return s!=null?XC._project(i,e,t,r,n,s):XC._project(i,e,t,r,n)}function kx(i,e){const t=tHe([i],e);return t.pending!=null?{pending:t.pending,geometry:null}:t.geometries!=null?{pending:null,geometry:t.geometries[0]}:{pending:null,geometry:null}}function tHe(i,e){if(!qx()){for(const t of i)if(t!=null&&!Ya(t.spatialReference,e)&&Cm(t.spatialReference)&&Cm(e)&&!_0(t.spatialReference,e))return Ws(eHe),{pending:FS(),geometries:null}}return{pending:null,geometries:i.map(t=>t==null?null:Ya(t.spatialReference,e)?t:Cm(t.spatialReference)&&Cm(e)?CW(t,e):null)}}function Une(i,e,t=null){if(i==null||e==null)return null;if(XC==null||ek==null)throw new X2e;const r=XC._getTransformation(ek,i,e,t,t?.spatialReference);return r!==null?Gne.fromGE(r):null}function nar(i,e,t=null){if(XC==null||ek==null)throw new X2e;const r=XC._getTransformationBySuitability(ek,i,e,t,t?.spatialReference);if(r!==null){const n=[];for(const s of r)n.push(Gne.fromGE(s));return n}return[]}let X2e=class extends qe{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}};function sar(){XC=null,ek=null,Die=null,jme={}}const oar={get loadPromise(){return Die}};function CW(i,e){try{const t=Wc(i,e);if(t==null)return null;"xmin"in i&&"xmin"in t&&(t.zmin=i.zmin,t.zmax=i.zmax);const r=IY(t.type,i.spatialReference,e);return r?.(t),t}catch(t){if(!(t instanceof X2e))throw t;return null}}async function aar(i,e,t){const r=i.spatialReference;return r!=null&&e!=null&&await Lx(r,e,null,t),CW(i,e)}function _0(i,e,t){return!t&&(!!Ya(i,e)||Cm(i)&&Cm(e)&&!!q2e(i,e,DPt))}async function Lx(i,e,t,r){if(qx())return vve(r);if(Array.isArray(i)){for(const{source:n,dest:s,geographicTransformation:o}of i)if(n&&s&&!_0(n,s,o))return FS(r)}else if(i&&e&&!_0(i,e,t))return FS(r);return vve(r)}function Fie(i,e,t){return i?"x"in i?NPt(i,e,new $i,t,0):"xmin"in i?GPt(i,e,new hr,t,0):"rings"in i?jPt(i,e,new $s,t,0):"paths"in i?BPt(i,e,new lo,t,0):"points"in i?$Pt(i,e,new Oh,t,0):null:null}function lar(i,e,t=e.spatialReference,r=0){return t!=null&&i.spatialReference!=null&&NPt(i,i.spatialReference,e,t,r)!=null}function NPt(i,e,t,r,n){bv[0]=i.x,bv[1]=i.y;const s=i.z;return bv[2]=s!==void 0?s:n,sy(bv,e,0,bv,r,0,1)?(t.x=bv[0],t.y=bv[1],t.spatialReference=r,s!==void 0||HF(r)?(t.z=bv[2],t.hasZ=!0):(t.z=void 0,t.hasZ=!1),i.m===void 0?(t.m=void 0,t.hasM=!1):(t.m=i.m,t.hasM=!0),t):null}function uar(i,e,t=e.spatialReference,r=0){return i.spatialReference!=null&&t!=null&&$Pt(i,i.spatialReference,e,t,r)!=null}function $Pt(i,e,t,r,n){const{points:s,hasZ:o,hasM:a}=i,l=[],u=s.length,c=[];for(const p of s)c.push(p[0],p[1],o?p[2]:n);if(!sy(c,e,0,c,r,0,u))return null;const h=o||HF(r);for(let p=0;p-1&&t.splice(r,1)}}async function J2e(i){const e=i.clone().normalize();let t;if(e.length>1)for(const r of e)t?r.width>t.width&&(t=r):t=r;else t=e[0];return far(t)}const _b={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function lot(i){const{portal:e,isOrgItem:t,itemControl:r}=i,n=e.user?.privileges;let s=!n||n.includes("features:user:edit"),o=!!t&&!!n?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:a}}}const Yc=i=>{let e=class extends i{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=zo(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,r,n){if(r.itemId)return new yg({id:r.itemId,portal:n?.portal})}writePortalItem(t,r){t?.id&&(r.itemId=t.id)}async loadFromPortal(t,r){if(this.portalItem?.id)try{const{load:n}=await Promise.resolve().then(()=>qon);return hn(r),await n({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap},r)}catch(n){throw mo(n)||di.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${n}`),n}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(r=>(_a(r),!0)))}async setUserPrivileges(t,r){if(!Ho.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:n,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(t,r);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(n){_a(n)}}async _fetchUserPrivileges(t,r){let n=this.portalItem;if(!t||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(r);const s=t===n.id;if(s&&n.portal.user)return lot(n);let o,a;if(s)o=n.portal.url;else try{o=await jEt(this.url,r)}catch(h){_a(h)}if(!o||!EWi(o,n.portal.url))return this._fetchFallbackUserPrivileges(r);try{const h=r!=null?r.signal:null;a=await no?.getCredential(`${o}/sharing`,{prompt:!1,signal:h})}catch(h){_a(h)}const l=!0,u=!1,c=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:c}};try{if(s?await n.reload():(n=new yg({id:t,portal:{url:o}}),await n.load(r)),n.portal.user)return lot(n)}catch(h){_a(h)}return{features:{edit:l,fullEdit:u},content:{updateItem:c}}}async _fetchFallbackUserPrivileges(t){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(t)}catch(n){_a(n)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const r=this.url?no?.findCredential(this.url):null;if(!r)return!0;const n=che.credential===r?che.user:await this._fetchEditingUser(t);return che.credential=r,che.user=n,n?.privileges==null||n.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const r=this.portalItem?.portal?.user;if(r)return r;const n=no.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const s=`${n.owningSystemUrl}/sharing/rest`,o=Bu.getDefault();if(o&&o.loaded&&X1(o.restUrl)===X1(s))return o.user;const a=`${s}/community/self`,l=t!=null?t.signal:null,u=await Uk(zi(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return u.ok?wze.fromJSON(u.value.data):null}read(t,r){r&&(r.layer=this),super.read(t,r)}write(t,r){const n=r?.portal,s=this.portalItem?.id&&(this.portalItem.portal||Bu.getDefault());return n&&s&&!eze(s.restUrl,n.restUrl)?(r.messages&&r.messages.push(new qe("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...r,layer:this})}};return x([D({type:yg})],e.prototype,"portalItem",null),x([Mi("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),x([ur("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),x([D({clonable:!1})],e.prototype,"resourceReferences",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),x([D({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=x([Qe("esri.layers.mixins.PortalLayer")],e),e},che={credential:null,user:null};let IQ=class extends un{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};x([D()],IQ.prototype,"updating",void 0),x([D()],IQ.prototype,"status",void 0),IQ=x([Qe("esri.layers.support.PublishingInfo")],IQ);const mar=IQ,zPt="esri.layers.mixins.PublishableLayer",gar=Symbol(zPt),yar=i=>{var e;let t=class extends i{constructor(){super(...arguments),this[e]=!0}get publishingInfo(){if(this.destroyed)return null;const r=this._get("publishingInfo");if(r)return r;const n=new mar;return this._checkPublishingStatus(n),n}_checkPublishingStatus(r){let o=0;const a=async u=>{let c;r.updating=!0;try{c=await this.fetchPublishingStatus()}catch{c="unavailable"}c!=="published"&&c!=="unavailable"||(r.status==="publishing"&&this.refresh(),l.remove()),r.status=c,r.updating=!1,l.removed||(o=setTimeout(a,u,u+125))},l={removed:!1,remove(){this.removed=!0,clearTimeout(o)}};this.when().catch(()=>l.remove()),a(250),this.addHandles(l)}};return e=gar,x([D({readOnly:!0,clonable:!1})],t.prototype,"publishingInfo",null),t=x([Qe(zPt)],t),t},iF=new dr,kie=new WeakMap;function _ar(i){war(i)&&iF.push(new WeakRef(i))}function bar(i){const e=iF.find(t=>t.deref()===i);e&&iF.remove(e)}function war(i){return i!=null&&typeof i=="object"&&"refreshInterval"in i&&"refresh"in i}function VPt(i,e){return Number.isFinite(i)&&Number.isFinite(e)?e<=0?i:VPt(e,i%e):0}let j3e=0,hhe=0;function xar(){const i=Date.now();let e=!1;for(const t of iF){const r=t.deref();r?r.refreshInterval&&i-(kie.get(r)??0)+5>=6e4*r.refreshInterval&&(kie.set(r,i),r.refresh(i)):e=!0}if(e)for(let t=iF.length-1;t>=0;t--)iF.at(t).deref()||iF.removeAt(t)}vCt(()=>{const i=Date.now();let e=0;for(const t of iF){const r=t.deref();r&&(e=VPt(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?kie.get(r)||kie.set(r,i):kie.delete(r))}if(e!==hhe){if(hhe=e,clearInterval(j3e),hhe===0)return void(j3e=0);j3e=setInterval(xar,hhe)}});const uot=.1,fy=i=>{let e=class extends i{constructor(...t){super(...t),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=xd(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||_ar(this)},()=>{})}destroy(){bar(this)}castRefreshInterval(t){return t>=uot?t:t<=0?0:uot}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(t=Date.now()){NP(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",t),this.emit("refresh",{dataChanged:r})},r=>{di.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){const t=this;return{set refreshInterval(r){t._set("refreshInterval",r)}}}};return x([D({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:Wv}}}}})],e.prototype,"refreshInterval",void 0),x([So("refreshInterval")],e.prototype,"castRefreshInterval",null),x([D({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),x([D({readOnly:!0})],e.prototype,"refreshParameters",null),e=x([Qe("esri.layers.mixins.RefreshableLayer")],e),e},uc=i=>{let e=class extends i{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const t={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&Sar(t,r.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===t.minScale&&n.maxScale===t.maxScale?n:t}};return x([D({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),x([D({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=x([Qe("esri.layers.mixins.ScaleRangeLayer")],e),e};function Sar(i,e){return i.minScale=i.minScale>0?e.minScale>0?Math.min(i.minScale,e.minScale):i.minScale:e.minScale,i.maxScale=i.maxScale>0?e.maxScale>0?Math.max(i.maxScale,e.maxScale):i.maxScale:e.maxScale,i}const HPt=pa()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let AQ=class extends xs(Ci){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return msr(this.value,this.unit,"milliseconds")}};x([Wr(HPt,{nonNullable:!0})],AQ.prototype,"unit",void 0),x([D({type:Number,json:{write:!0},nonNullable:!0})],AQ.prototype,"value",void 0),AQ=x([Qe("esri.TimeInterval")],AQ);const zne=AQ;function cot(i,e){return zne.fromJSON({value:i,unit:e})}let W0=class extends xs(Ci){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||t.timeExtent.length!==2)return null;const r=new Date(t.timeExtent[0]),n=new Date(t.timeExtent[1]);return new Eg({start:r,end:n})}writeFullTimeExtent(e,t){e?.start!=null&&e.end!=null?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?cot(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?cot(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};x([D({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],W0.prototype,"cumulative",void 0),x([D({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],W0.prototype,"endField",void 0),x([D({type:Eg,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"fullTimeExtent",void 0),x([Mi("fullTimeExtent",["timeExtent"])],W0.prototype,"readFullTimeExtent",null),x([ur("fullTimeExtent")],W0.prototype,"writeFullTimeExtent",null),x([D({type:Boolean,json:{write:!0}})],W0.prototype,"hasLiveData",void 0),x([D({type:zne,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"interval",void 0),x([Mi("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],W0.prototype,"readInterval",null),x([ur("interval")],W0.prototype,"writeInterval",null),x([D({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],W0.prototype,"startField",void 0),x([D(XF("timeReference",!0))],W0.prototype,"timeZone",void 0),x([D({type:String,json:{write:{enabled:!0,allowNull:!0}}})],W0.prototype,"trackIdField",void 0),x([D({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],W0.prototype,"useTime",void 0),W0=x([Qe("esri.layers.support.TimeInfo")],W0);const K2e=W0,AE=i=>{let e=class extends i{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(t,r){const n=r.timeInfo.exportOptions;if(!n)return null;const s=n.timeOffset,o=HPt.fromJSON(n.timeOffsetUnits);return s&&o?new zne({value:s,unit:o}):null}set timeInfo(t){pR(t,this.fieldsIndex),this._set("timeInfo",t)}};return x([D({type:Eg,json:{write:!1}})],e.prototype,"timeExtent",void 0),x([D({type:zne})],e.prototype,"timeOffset",void 0),x([Mi("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),x([D({value:null,type:K2e,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),x([D({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=x([Qe("esri.layers.mixins.TemporalLayer")],e),e},hot=new Rs({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let v4=class extends xs(Ci){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};x([D({json:{write:!0}})],v4.prototype,"name",void 0),x([D({json:{write:!0}})],v4.prototype,"description",void 0),x([D({json:{read:hot.read,write:hot.write}})],v4.prototype,"drawingTool",void 0),x([D({json:{write:!0}})],v4.prototype,"prototype",void 0),x([D({json:{write:!0}})],v4.prototype,"thumbnail",void 0),v4=x([Qe("esri.layers.support.FeatureTemplate")],v4);const $Y=v4;let ZM=class extends xs(Ci){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=j2e(e[r]);return t}writeDomains(e,t){const r={};for(const n of Object.keys(e))e[n]&&(r[n]=e[n]?.toJSON());t.domains=r}};x([D({json:{write:!0}})],ZM.prototype,"id",void 0),x([D({json:{write:!0}})],ZM.prototype,"name",void 0),x([D({json:{write:!0}})],ZM.prototype,"domains",void 0),x([Mi("domains")],ZM.prototype,"readDomains",null),x([ur("domains")],ZM.prototype,"writeDomains",null),x([D({type:[$Y],json:{write:!0}})],ZM.prototype,"templates",void 0),ZM=x([Qe("esri.layers.support.FeatureType")],ZM);const Aae=ZM;function nT(){return{fields:{type:[Fo],value:null,set:function(i){if(i&&yi("big-integer-warning-enabled")){const e=i.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(e.length){const t=e.map(r=>`'${r.name}'`).join(", ");di.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",i)}},fieldsIndex:{readOnly:!0,get(){return Cd.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(i){this._userOutFields=i,this.notifyChange("outFields")},get:function(){const i=this._userOutFields;if(!i?.length)return null;if(i.includes("*"))return["*"];if(!this.fields)return i;for(const e of i)this.fieldsIndex?.has(e)||di.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${e} found in outFields`,{layer:this,outFields:i});return rB(this.fieldsIndex,i)}}}}const G3e=()=>di.getLogger("esri.layers.support.labelingInfo"),Tar=/\[([^\[\]]+)\]/gi;function JC(i,e,t){return i?i.map(r=>{const n=new rT;if(n.read(r,t),n.labelExpression){const s=e.fields||e.layerDefinition?.fields||this.fields;n.labelExpression=n.labelExpression.replaceAll(Tar,(o,a)=>`[${Car(a,s)}]`)}return n}):null}function Car(i,e){if(!e)return i;const t=i.toLowerCase();for(let r=0;rIar(r,e))?[]:t}function Iar(i,e){const t=i.labelPlacement,r=Ear[e];if(!i.symbol)return G3e().warn("No ILabelClass symbol specified."),!0;if(!r)return G3e().error(new qe("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!r.includes(t)){const n=r[0];t&&G3e().warn(`Found invalid label placement type ${t} for ${e}. Defaulting to ${n}`),i.labelPlacement=n}return!1}const QM=[];function Mae(i,e){if(Fx(i.url??""))return!0;const{wkid:t}=e;for(const r of QM){if((i.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(t))return!1}return!0}QM.push([10.91,()=>{const i=new Set([9709,9716,9741,9761,9766]);for(let e=9712;e<=9713;e++)i.add(e);for(let e=9748;e<=9749;e++)i.add(e);for(let e=20904;e<=20932;e++)i.add(e);for(let e=21004;e<=21032;e++)i.add(e);for(let e=21207;e<=21264;e++)i.add(e);for(let e=21307;e<=21364;e++)i.add(e);for(let e=23301;e<=23333;e++)i.add(e);for(let e=102759;e<=102760;e++)i.add(e);for(let e=102934;e<=102955;e++)i.add(e);return i}]),QM.push([10.9,()=>{const i=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let e=9356;e<=9360;e++)i.add(e);for(let e=9404;e<=9407;e++)i.add(e);for(let e=9476;e<=9482;e++)i.add(e);for(let e=9487;e<=9494;e++)i.add(e);for(let e=9697;e<=9699;e++)i.add(e);return i}]),QM.push([10.81,()=>{const i=new Set([9265,9333,103598,103699]);for(let e=9248;e<=9254;e++)i.add(e);for(let e=9271;e<=9273;e++)i.add(e);for(let e=9284;e<=9285;e++)i.add(e);for(let e=21453;e<=21463;e++)i.add(e);return i}]),QM.push([10.8,()=>{const i=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let e=8035;e<=8036;e++)i.add(e);for(let e=8455;e<=8456;e++)i.add(e);for(let e=8518;e<=8529;e++)i.add(e);for(let e=8533;e<=8536;e++)i.add(e);for(let e=8538;e<=8540;e++)i.add(e);for(let e=8677;e<=8679;e++)i.add(e);for(let e=8902;e<=8903;e++)i.add(e);for(let e=8907;e<=8910;e++)i.add(e);for(let e=8949;e<=8951;e++)i.add(e);for(let e=8972;e<=8987;e++)i.add(e);for(let e=9039;e<=9040;e++)i.add(e);for(let e=9068;e<=9069;e++)i.add(e);for(let e=9140;e<=9141;e++)i.add(e);for(let e=9148;e<=9150;e++)i.add(e);for(let e=9153;e<=9159;e++)i.add(e);for(let e=9205;e<=9218;e++)i.add(e);for(let e=9221;e<=9222;e++)i.add(e);for(let e=54098;e<=54101;e++)i.add(e);return i}]),QM.push([10.71,()=>{const i=new Set([6316]);for(let e=8351;e<=8353;e++)i.add(e);for(let e=9294;e<=9297;e++)i.add(e);for(let e=22619;e<=22621;e++)i.add(e);for(let e=103586;e<=103594;e++)i.add(e);return i}]),QM.push([10.7,()=>{const i=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let e=8065;e<=8068;e++)i.add(e);for(let e=8082;e<=8083;e++)i.add(e);for(let e=8379;e<=8385;e++)i.add(e);for(let e=8836;e<=8840;e++)i.add(e);for(let e=8857;e<=8860;e++)i.add(e);for(let e=53035;e<=53037;e++)i.add(e);for(let e=54090;e<=54091;e++)i.add(e);for(let e=102498;e<=102499;e++)i.add(e);return i}]),QM.push([10.61,()=>new Set([102497])]),QM.push([10.6,()=>{const i=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let e=7755;e<=7787;e++)i.add(e);for(let e=7791;e<=7795;e++)i.add(e);for(let e=7799;e<=7801;e++)i.add(e);for(let e=7825;e<=7831;e++)i.add(e);for(let e=7877;e<=7878;e++)i.add(e);for(let e=7882;e<=7883;e++)i.add(e);for(let e=7991;e<=7992;e++)i.add(e);for(let e=8042;e<=8043;e++)i.add(e);for(let e=8058;e<=8059;e++)i.add(e);for(let e=8311;e<=8348;e++)i.add(e);for(let e=9060;e<=9067;e++)i.add(e);for(let e=102562;e<=102568;e++)i.add(e);for(let e=102799;e<=102900;e++)i.add(e);return i}]);async function Oae(i,e,t){const r=i&&i.getAtOrigin&&i.getAtOrigin("renderer",e.origin);if(r&&r.type==="unique-value"&&r.styleOrigin){const n=await Uk(r.populateFromStyle());if(hn(t),n.ok===!1){const s=n.error;e?.messages&&e.messages.push(new Rf("renderer:style-reference",`Failed to create unique value renderer from style reference: ${s.message}`,{error:s,context:e})),i.clear("renderer",e?.origin)}}}var wLe;let WG=wLe=class extends Ci{constructor(i){super(i),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new wLe({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};x([D({type:[String],json:{write:!0}})],WG.prototype,"groupByFields",void 0),x([D({type:Number,json:{write:!0}})],WG.prototype,"topCount",void 0),x([D({type:[String],json:{write:!0}})],WG.prototype,"orderByFields",void 0),WG=wLe=x([Qe("esri.rest.support.TopFilter")],WG);const Aar=WG;var xLe;const dot=new Rs({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),pot=new Rs({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Bh=xLe=class extends Ci{constructor(i){super(i),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(i,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new xLe(li({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};x([D({type:Boolean,json:{write:!0}})],Bh.prototype,"cacheHint",void 0),x([D({type:Number,json:{write:{overridePolicy:i=>({enabled:i>0})}}})],Bh.prototype,"distance",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],Bh.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],Bh.prototype,"geometryPrecision",void 0),x([D({type:Number,json:{write:!0}})],Bh.prototype,"maxAllowableOffset",void 0),x([D({type:Number,json:{read:{source:"resultRecordCount"}}})],Bh.prototype,"num",void 0),x([D({json:{write:!0}})],Bh.prototype,"objectIds",void 0),x([D({type:[String],json:{write:!0}})],Bh.prototype,"orderByFields",void 0),x([D({type:[String],json:{write:!0}})],Bh.prototype,"outFields",void 0),x([D({type:Xi,json:{read:{source:"outSR"},write:{target:"outSR"}}})],Bh.prototype,"outSpatialReference",void 0),x([D({type:String,json:{write:!0}})],Bh.prototype,"resultType",void 0),x([D({json:{write:!0}})],Bh.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Bh.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],Bh.prototype,"returnZ",void 0),x([D({type:Number,json:{read:{source:"resultOffset"}}})],Bh.prototype,"start",void 0),x([ur("start"),ur("num")],Bh.prototype,"writeStart",null),x([D({type:String,json:{read:{source:"spatialRel",reader:dot.read},write:{target:"spatialRel",writer:dot.write}}})],Bh.prototype,"spatialRelationship",void 0),x([D({type:Eg,json:{write:!0}})],Bh.prototype,"timeExtent",void 0),x([D({type:Aar,json:{write:!0}})],Bh.prototype,"topFilter",void 0),x([D({type:String,json:{read:pot.read,write:{writer:pot.write,overridePolicy(i){return{enabled:i!=null&&this.distance!=null&&this.distance>0}}}}})],Bh.prototype,"units",void 0),x([D({type:String,json:{write:!0}})],Bh.prototype,"where",void 0),Bh=xLe=x([Qe("esri.rest.support.TopFeaturesQuery")],Bh),Bh.from=Sd(Bh);const rF=Bh;function p_({displayField:i,editFieldsInfo:e,fields:t,objectIdField:r,title:n},s){if(!t)return null;const o=Rar({editFieldsInfo:e,fields:t,objectIdField:r},s);if(!o.length)return null;const a=kar({titleBase:n,fields:t,displayField:i}),l=Far();return new qc({title:a,content:l,fieldInfos:o})}const Mar=(i,e)=>e.visibleFieldNames?e.visibleFieldNames.has(i.name):zZi(i,e);function Oar(i,e){const t=i;return e&&(i=i.filter(r=>!e.includes(r.type))),i===t&&(i=i.slice()),i.sort(Par),i}function Par(i,e){return i.type==="oid"?-1:e.type==="oid"?1:fot(i)?-1:fot(e)?1:(i.alias||i.name).toLocaleLowerCase().localeCompare((e.alias||e.name).toLocaleLowerCase())}function Rar(i,e){const t=e?.visibleFieldNames;return Oar(i.fields??[],e?.ignoreFieldTypes||Lar).map(r=>new dae({fieldName:r.name,isEditable:UZi(r,i),label:r.alias,format:Dar(r),visible:Mar(r,{...i,visibleFieldNames:t})}))}function Dar(i){switch(i.type){case"small-integer":case"integer":case"single":return new tme({digitSeparator:!0,places:0});case"double":return new tme({digitSeparator:!0,places:2});case"string":return L5e(i.name)?new tme({digitSeparator:!0,places:0}):null;default:return null}}function Far(){return[new gW,new Mne]}function kar(i){const e=AZi(i),{titleBase:t}=i;return e?`${t}: {${e.trim()}}`:t??""}function fot(i){return(i.name&&i.name.toLowerCase())==="name"?!0:(i.alias&&i.alias.toLowerCase())==="name"}const Lar=["geometry","blob","raster","guid","xml"];var Uc;(function(i){i[i.SAVE=0]="SAVE",i[i.SAVE_AS=1]="SAVE_AS"})(Uc||(Uc={}));const i1="FeatureLayer";function dhe(i,e){return new qe("layer:unsupported",`Layer (${i.title}, ${i.id}) of type '${i.declaredClass}' ${e}`,{layer:i})}function mot(i){return i&&i instanceof dr}const U3e=nT();function z3e(i,e,t){const r=!!t?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let zs=class extends qVe(NY(RY(yar(BVe(xh(Iae(AE(uc(fy(Xv(Rc(Yc(Ql(py(Wx(xs(Il))))))))))))))))){constructor(...e){super(...e),this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=Xi.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=xd(async(t,r,n)=>{const{save:s,saveAs:o}=await Promise.resolve().then(()=>EWt);switch(t){case Uc.SAVE:return s(this,r);case Uc.SAVE_AS:return o(this,n,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(n=>this.initLayerProperties(n))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(_a).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const n=await this._fetchFirstValidLayerId(t);n!=null&&(this.layerId=n)}if(!this.url&&!this._hasMemorySource())throw new qe("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>u8(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,WVe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,n){this._writeEditingEnabled(e,t,!0,n)}get effectiveEditingEnabled(){return VVe(this)}readIsTable(e,t){return(t=t?.layerDefinition??t).type==="Table"||!t.geometryType}writeIsTable(e,t,r,n){n?.writeLayerSchema&&Qp(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return fPt(t.layerDefinition||t)}readObjectIdField(e,t){return mPt(t.layerDefinition||t)}get parsedUrl(){const e=Yo(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=Iu(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=Iu(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){t_(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const n=t.drawingInfo?.renderer;if(n){const s=sB(n,t,r)??void 0;return s||di.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),s}return V2e(t,r)}set source(e){const t=this._get("source");t!==e&&(mot(t)&&this._resetMemorySource(t),mot(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof dr?new UO({layer:this,items:e}):e:null}readSource(e,t){const r=du.fromJSON(t.featureSet);return new UO({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,n=r?.creatorField,s=r?.editorField;return e=e?.map(o=>$Y.fromJSON(o)),this._fixTemplates(e,n),this._fixTemplates(e,s),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,n=t.title||t.layerDefinition?.title;if(r){const s=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?TVe(this.url,r):r;let o=r;if(!o&&this.url){const a=r_(this.url);a!=null&&(o=a.title)}return o?(this.sublayerTitleMode==="item-title-and-service-name"&&s&&s!==o&&(o=s+" - "+o),G2e(o)):void 0}if(this.sublayerTitleMode==="item-title"&&n)return n}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const n=t.fields.find(s=>s.name.toLowerCase()===r);n&&(r=n.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,n=r?.creatorField,s=r?.editorField;return e?.map(o=>(o=Aae.fromJSON(o),this._fixTemplates(o.templates,n),this._fixTemplates(o.templates,s),o))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return iPt(this,e,t,i1)}async updateAttachment(e,t,r){return rPt(this,e,t,r,i1)}async applyEdits(e,t){return nPt(this,e,t)}async uploadAssets(e,t){return Rsr(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return p_(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await Jg(Promise.resolve().then(()=>MWt),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=zVe(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=PS(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){return sPt(this,e,t,i1)}async fetchRecomputedExtents(e){return oPt(this,e,i1)}getFeatureType(e){const{typeIdField:t,types:r}=this;if(!t||!e)return null;const n=e.attributes?e.attributes[t]:void 0;if(n==null)return null;let s=null;return r?.some(o=>{const{id:a}=o;return a!=null&&(a.toString()===n.toString()&&(s=o),!!s)}),s}getFieldDomain(e,t){const r=t?.feature,n=this.getFeatureType(r);if(n){const s=n.domains&&n.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return aPt(this,e,t,i1)}async queryFeatures(e,t){const r=await this.load(),n=await r.source.queryFeatures(Kn.from(e)??r.createQuery(),t);if(n?.features)for(const s of n.features)s.layer=s.sourceLayer=r;return n}async queryObjectIds(e,t){return lPt(this,e,t,i1)}async queryFeatureCount(e,t){return uPt(this,e,t,i1)}async queryExtent(e,t){return cPt(this,e,t,i1)}async queryRelatedFeatures(e,t){return hPt(this,e,t,i1)}async queryRelatedFeaturesCount(e,t){return dPt(this,e,t,i1)}async queryTopFeatures(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopFeatures||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopFeatures capability");const s=await r.queryTopFeatures(rF.from(e),t);if(s?.features)for(const o of s.features)o.layer=o.sourceLayer=this;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopObjectIds||!n?.query.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopObjectIds capability");return r.queryTopObjectIds(rF.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopExtents||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryTopExtents capability");return r.queryTopExtents(rF.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:n}=await this.load();if(!r.queryTopCount||!n?.query?.supportsTopFeaturesQuery)throw new qe(i1,"Layer source does not support queryFeatureCount capability");return r.queryTopCount(rF.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const n=r.layers;n&&n.length===1&&(super.read(n[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:n,messages:s}=t;if(this.dynamicDataSource)return s?.push(dhe(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&n!=="tables")return s?.push(dhe(this,`a table source can only be written to tables, not ${n}`)),null;if(this._hasMemorySource())return s?.push(dhe(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&n==="tables")return s?.push(dhe(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new qe(i1,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||Mae(this,e))}async save(e){return this._debouncedSaveOperations(Uc.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Uc.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let n=e.layerDefinition?.capabilities;return n?this._hasEditingCapability(n):(n=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&n?this._hasEditingCapability(n):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,n){if(!e){const s=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";Qp("layerDefinition.capabilities",s,t),r&&!n?.writeLayerSchema&&(t.capabilities=s)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return zi(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),t_(this.renderer,this.fieldsIndex),pR(this.timeInfo,this.fieldsIndex),Oae(this,{origin:"service"})}async hasDataChanged(){return pPt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(r=>{const n=r.prototype?.attributes;n&&t&&delete n[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new qe("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new qe("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};x([Mi("service","capabilities")],zs.prototype,"readCapabilities",null),x([D({json:{origins:{"web-scene":{write:!1}},write:!0}})],zs.prototype,"charts",void 0),x([D({readOnly:!0})],zs.prototype,"createQueryVersion",null),x([D({json:{read:{source:"layerDefinition.copyrightText"}}})],zs.prototype,"copyright",void 0),x([D({json:{read:{source:"layerDefinition.displayField"}}})],zs.prototype,"displayField",void 0),x([D({types:Kh,readOnly:!0})],zs.prototype,"defaultSymbol",void 0),x([D({type:Ev})],zs.prototype,"dynamicDataSource",void 0),x([D({type:Boolean})],zs.prototype,"editingEnabled",null),x([Mi(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],zs.prototype,"readEditingEnabled",null),x([Mi("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],zs.prototype,"readEditingEnabledFromWebMap",null),x([ur(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],zs.prototype,"writeEditingEnabled",null),x([ur("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],zs.prototype,"writeEditingEnabledToWebMap",null),x([D({readOnly:!0})],zs.prototype,"effectiveEditingEnabled",null),x([D({...U3e.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:z3e}}}}})],zs.prototype,"fields",void 0),x([D(U3e.fieldsIndex)],zs.prototype,"fieldsIndex",void 0),x([D({type:tOt,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],zs.prototype,"formTemplate",void 0),x([D({json:{read:{source:"layerDefinition.extent"}}})],zs.prototype,"fullExtent",void 0),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:z3e,writer(i,e,t){const r=i?uLe.toJSON(i):null;r&&Qp(t,r,e)}}}},read:{source:"layerDefinition.geometryType",reader:uLe.read}}})],zs.prototype,"geometryType",void 0),x([D({json:{read:{source:"layerDefinition.hasM"}}})],zs.prototype,"hasM",void 0),x([D({json:{read:{source:"layerDefinition.hasZ"}}})],zs.prototype,"hasZ",void 0),x([D(LY)],zs.prototype,"id",void 0),x([D({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],zs.prototype,"infoFor3D",void 0),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],zs.prototype,"isTable",void 0),x([Mi("service","isTable",["type","geometryType"]),Mi("isTable",["layerDefinition.type","layerDefinition.geometryType"])],zs.prototype,"readIsTable",null),x([ur("web-map","isTable")],zs.prototype,"writeIsTable",null),x([D(H3)],zs.prototype,"labelsVisible",void 0),x([D({type:[rT],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:JC,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:JC,write:{enabled:!0,layerContainerTypes:Wv}}},name:"layerDefinition.drawingInfo.labelingInfo",read:JC,write:!0}})],zs.prototype,"labelingInfo",void 0),x([D((()=>{const i=li(QOt);return i.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){Qp(r,E2e(e),t)}}},i})())],zs.prototype,"opacity",void 0),x([D(d_)],zs.prototype,"legendEnabled",void 0),x([D({type:["show","hide"],json:(()=>{const i=li(ePt.json);return i.origins["portal-item"]={read:!1,write:!1},i})()})],zs.prototype,"listMode",void 0),x([Mi("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],zs.prototype,"readGlobalIdField",null),x([D({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:z3e}}}}})],zs.prototype,"objectIdField",void 0),x([Mi("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],zs.prototype,"readObjectIdField",null),x([D({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],zs.prototype,"operationalLayerType",void 0),x([D(U3e.outFields)],zs.prototype,"outFields",void 0),x([D({readOnly:!0})],zs.prototype,"parsedUrl",null),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],zs.prototype,"path",void 0),x([D(h_)],zs.prototype,"popupEnabled",void 0),x([D({type:qc,json:{name:"popupInfo",write:!0}})],zs.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],zs.prototype,"defaultPopupTemplate",null),x([D({types:IE,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:qk,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:Wv,overridePolicy:(i,e,t)=>({ignoreOrigin:t?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(i,e,t)=>({ignoreOrigin:t?.writeLayerSchema})}}})],zs.prototype,"renderer",null),x([Mi("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Mi("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],zs.prototype,"readRenderer",null),x([D()],zs.prototype,"resourceInfo",void 0),x([D((()=>{const i=li(FY);return i.json.origins["portal-item"]={read:!1,write:!1},i})())],zs.prototype,"screenSizePerspectiveEnabled",void 0),x([D({clonable:!1})],zs.prototype,"source",null),x([So("source")],zs.prototype,"castSource",null),x([Mi("portal-item","source",["featureSet"]),Mi("web-map","source",["featureSet"])],zs.prototype,"readSource",null),x([D({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],zs.prototype,"spatialReference",void 0),x([D({type:Number})],zs.prototype,"subtypeCode",void 0),x([D({type:[$Y]})],zs.prototype,"templates",void 0),x([Mi("templates",["editFieldsInfo","creatorField","editorField","templates"])],zs.prototype,"readTemplates",null),x([D({type:K2e})],zs.prototype,"timeInfo",void 0),x([D()],zs.prototype,"title",void 0),x([Mi("service","title",["name"]),Mi("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],zs.prototype,"readTitle",null),x([Mi("web-map","title",["layerDefinition.name","title"])],zs.prototype,"readTitleFromWebMap",null),x([D({type:String})],zs.prototype,"sublayerTitleMode",void 0),x([D({json:{read:!1}})],zs.prototype,"type",void 0),x([D({type:String})],zs.prototype,"typeIdField",void 0),x([Mi("service","typeIdField"),Mi("typeIdField",["layerDefinition.typeIdField"])],zs.prototype,"readTypeIdField",null),x([D({type:[Aae]})],zs.prototype,"types",void 0),x([Mi("service","types",["types"]),Mi("types",["layerDefinition.types"])],zs.prototype,"readTypes",null),x([D({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],zs.prototype,"visible",void 0),x([Mi("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],zs.prototype,"readVisible",null),zs=x([Qe("esri.layers.FeatureLayer")],zs);const yh=zs,rHe=Object.freeze(Object.defineProperty({__proto__:null,default:yh},Symbol.toStringTag,{value:"Module"}));let Lie=class extends dr{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(dr.ofType(this.itemType.Type))(e):new dr(e)}};function SLe(i,e){return{type:i,cast:fY,set(t){const r=ay(t,this._get(e),i);r.owner=this,this._set(e,r)}}}x([D()],Lie.prototype,"owner",null),Lie=x([Qe("esri.core.support.OwningCollection")],Lie);let bx=class extends Lie{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};x([aze({Type:Us,ensureType:Sd(Us)})],bx.prototype,"itemType",void 0),bx=x([Qe("esri.support.GraphicsCollection")],bx);let eO=class extends xh(uc(Il)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new bx,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};x([D({type:ZB})],eO.prototype,"elevationInfo",void 0),x([D(SLe(bx,"graphics"))],eO.prototype,"graphics",void 0),x([D({type:["show","hide"]})],eO.prototype,"listMode",void 0),x([D()],eO.prototype,"screenSizePerspectiveEnabled",void 0),x([D({readOnly:!0})],eO.prototype,"type",void 0),x([D({constructOnly:!0})],eO.prototype,"internal",void 0),eO=x([Qe("esri.layers.GraphicsLayer")],eO);const nHe=eO;var TLe;const phe=new Rs({flow_from:"flow-from",flow_to:"flow-to"});let q0=TLe=class extends Wk(Ci){constructor(i){super(i),this.density=.8,this.color=new jr([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){const{density:i,maxPathLength:e,trailWidth:t,flowSpeed:r,trailLength:n,smoothing:s,flowRepresentation:o,trailCap:a,background:l}=this,u=this.color.clone(),c=(this.visualVariables||[]).map(m=>m.clone()),h=this.authoringInfo?.clone(),p=this.legendOptions?.clone();return new TLe({density:i,color:u,maxPathLength:e,trailWidth:t,flowSpeed:r,trailLength:n,trailCap:a,background:l,smoothing:s,flowRepresentation:o,visualVariables:c,authoringInfo:h,legendOptions:p})}getSymbol(i,e){}async getSymbolAsync(i,e){}getSymbols(){return[]}};x([D({type:Number,json:{write:!0}})],q0.prototype,"density",void 0),x([D({type:jr,json:{write:{allowNull:!0}}})],q0.prototype,"color",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],q0.prototype,"maxPathLength",void 0),x([D({type:Number,cast:Cl,json:{write:!0}})],q0.prototype,"trailWidth",void 0),x([D({type:Number,json:{write:!0}})],q0.prototype,"flowSpeed",void 0),x([D({type:Number,json:{write:!0}})],q0.prototype,"trailLength",void 0),x([D({type:Number,cast:Cl,json:{write:!1}})],q0.prototype,"smoothing",void 0),x([D({type:phe.apiValues,json:{type:phe.jsonValues,read:{reader:phe.read},write:{writer:phe.write}}})],q0.prototype,"flowRepresentation",void 0),x([Wr({flowRenderer:"flow"})],q0.prototype,"type",void 0),x([D({type:vae,json:{write:!0}})],q0.prototype,"authoringInfo",void 0),x([D({type:UA,json:{write:!0}})],q0.prototype,"legendOptions",void 0),x([D({type:String,json:{write:!0}})],q0.prototype,"trailCap",void 0),x([D({type:String,json:{write:!0}})],q0.prototype,"background",void 0),q0=TLe=x([Qe("esri.renderers.FlowRenderer")],q0);const qPt=q0;let qG=class extends Ci{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};x([D({type:Number,json:{write:!0}})],qG.prototype,"value",void 0),x([D({type:String,json:{write:!0}})],qG.prototype,"label",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],qG.prototype,"color",void 0),qG=x([Qe("esri.renderers.support.ColormapInfo")],qG);const YPt=qG,Nar=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],sHe=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],UV=new Rs({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function fhe(i,e){if(!i||!e||i.length!==e.length)return!1;for(let t=0;te[t]+2||i[t]got(t))),e}return got(i)}function yot(i,e){if(!i)return;const t=sHe;let r=null;return i.type==="algorithmic"?t.some(n=>{if(fhe(i.fromColor.toRgb(),n.fromColor)&&fhe(i.toColor.toRgb(),n.toColor))return r=n.id,!0}):i.type==="multipart"&&t.some(n=>{const s=i.colorRamps,o=n.colorRamps;if(s&&o&&s.length===o.length&&!o.some((a,l)=>{if(!fhe(s[l].fromColor.toRgb(),new jr(a.fromColor).toRgb())||!fhe(s[l].toColor.toRgb(),new jr(a.toColor).toRgb()))return!0})){if(r)return!0;r=n.id}}),r}function Bar(i,e,t=!1){if(!i)return;let r=!1,n=yot(i);return n!=null||t||(r=!0,n=yot(i=$ar(i))),n?{id:n,inverted:r}:void 0}function XPt(i,e=!1){const t=typeof i=="string"?i:Bar(i,void 0,e)?.id;return t?UV.toJSON(t):null}function jar(i,e="esriCIELabAlgorithm"){const t=sHe.find(({id:r})=>r===i);return t?t.colorRamps?{type:"multipart",colorRamps:t.colorRamps.map(r=>({type:"algorithmic",algorithm:e,fromColor:[...r.fromColor],toColor:[...r.toColor]}))}:{type:"algorithmic",algorithm:e,fromColor:[...t.fromColor],toColor:[...t.toColor]}:null}function JPt(i){const e=(i=i||{}).numColors||256,t=i.distanceOffset||0,r=i.isCustomInterval!=null?i.isCustomInterval:i.distanceInterval!==null&&i.distanceInterval!==1/(e-1),n=i.distanceInterval||1/(e-1);return{...i,numColors:e,distanceOffset:t,interpolateAlpha:!!i.interpolateAlpha,distanceInterval:n,isCustomInterval:r,weights:i.weights}}function Gar(i,e,t){const{numColors:r,distanceOffset:n,distanceInterval:s,isCustomInterval:o}=t,a=i.s===0,l=e.s===0;let u=i.h,c=e.h;a&&!l?u=c:l&&!a&&(e={...e,h:u},c=u);let h,p=Math.abs(c-u);const m=360;pc?p*s:-p*s);const v=(e.s-i.s)*s,w=(e.v-i.v)*s;let{s:S,v:I}=i,R=u;if(n){const k=n/s;R=(R+k*h+m)%m,S+=k*v,I+=k*w}const L=[];for(let k=0;kp+m);n=n.map(p=>p/h)}else{n=[];for(let h=0;h{n.unshift(s),r||n.pop()}),t}function vot(i){const e=u1e(i);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function _ot(i){return{Algorithm:i.toJSON()?.Algorithm||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:vot(i.fromColor),ToColor:vot(i.toColor)}}function ZPt(i){const e=XPt(i);if(!e)return null;if(i.type==="algorithmic")return{..._ot(i),Name:e};if(i.colorRamps){const t=i.colorRamps.map(_ot);return{type:"MultiPartColorRamp",NumColorRamps:t.length,ArrayOfColorRamp:t,Name:e}}return null}function Har(i){const e=i.reverse().map(t=>{const r=t.toString(16);return r.length<2?"0"+r:r});return 4294967295&Number.parseInt(e.join(""),16)}var MQ;let OQ=MQ=class extends Ci{constructor(i){super(i),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(i,e){if(!i)return null;const t=i[0].length===5,r=[...i].sort((n,s)=>n[0]-s[0]).map(n=>YPt.fromJSON({value:n[0],color:t?n.slice(1,5):n.slice(1,4).concat([255]),label:e?e[n[0]]??"":n[0]}));return new MQ({colormapInfos:r})}static createFromColorramp(i){const e=tk(i);return MQ.createFromColormap(e)}clone(){return new MQ({colormapInfos:this.colormapInfos.map(i=>i.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:i,color:e})=>[i,e.r,e.g,e.b,e.a>1?e.a:255*e.a&255]).sort((i,e)=>i[0]-e[0])}};x([D({type:[YPt],json:{write:!0}})],OQ.prototype,"colormapInfos",void 0),x([Wr({rasterColormap:"raster-colormap"})],OQ.prototype,"type",void 0),OQ=MQ=x([Qe("esri.renderers.RasterColormapRenderer")],OQ);const aHe=OQ;var CLe;let _w=CLe=class extends Ci{constructor(i){super(i),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(i){return F2e(i)}clone(){return new CLe({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:li(this.colorRamp)})}};x([D({type:Number,json:{write:!0}})],_w.prototype,"altitude",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"azimuth",void 0),x([D({types:D2e,json:{write:!0}})],_w.prototype,"colorRamp",void 0),x([Mi("colorRamp")],_w.prototype,"readColorRamp",null),x([D({type:["traditional","multi-directional"],json:{write:!0}})],_w.prototype,"hillshadeType",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"pixelSizePower",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"pixelSizeFactor",void 0),x([D({type:["none","adjusted"],json:{write:!0}})],_w.prototype,"scalingType",void 0),x([Wr({rasterShadedRelief:"raster-shaded-relief"})],_w.prototype,"type",void 0),x([D({type:Number,json:{write:!0}})],_w.prototype,"zFactor",void 0),_w=CLe=x([Qe("esri.renderers.RasterShadedReliefRenderer")],_w);const QPt=_w,Nie=new Rs({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),eRt={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ELe;let nf=ELe=class extends Ci{constructor(i){super(i),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(i){if(i)return F2e(i)}writeStatistics(i,e,t){i?.length&&(Array.isArray(i[0])||(i=i.map(r=>[r.min,r.max,r.avg,r.stddev])),e[t]=i)}readStretchType(i,e){let t=e.stretchType;return typeof t=="number"&&(t=eRt[t]),Nie.read(t)}clone(){return new ELe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:li(this.statistics),gamma:li(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:li(this.colorRamp),histograms:li(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};x([D({types:D2e,json:{write:!0}})],nf.prototype,"colorRamp",void 0),x([Mi("colorRamp")],nf.prototype,"readColorRamp",null),x([D({type:Boolean,json:{write:!0}})],nf.prototype,"computeGamma",void 0),x([D({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],nf.prototype,"dynamicRangeAdjustment",void 0),x([D({type:[Number],json:{write:!0}})],nf.prototype,"gamma",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"maxPercent",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"minPercent",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"numberOfStandardDeviations",void 0),x([D({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],nf.prototype,"outputMax",void 0),x([D({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],nf.prototype,"outputMin",void 0),x([D({type:Number,json:{write:!0}})],nf.prototype,"sigmoidStrengthLevel",void 0),x([D({json:{type:[[Number]],write:!0}})],nf.prototype,"statistics",void 0),x([D()],nf.prototype,"histograms",void 0),x([ur("statistics")],nf.prototype,"writeStatistics",null),x([D({type:Boolean,json:{write:!0}})],nf.prototype,"useGamma",void 0),x([D({type:Nie.apiValues,json:{type:Nie.jsonValues,write:Nie.write}})],nf.prototype,"stretchType",void 0),x([Mi("stretchType",["stretchType"])],nf.prototype,"readStretchType",null),x([Wr({rasterStretch:"raster-stretch"})],nf.prototype,"type",void 0),nf=ELe=x([Qe("esri.renderers.RasterStretchRenderer")],nf);const lHe=nf,$z={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new lo({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:Xi.WebMercator}),minus180Line:new lo({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:Xi.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new lo({paths:[[[180,-180],[180,180]]],spatialReference:Xi.WGS84}),minus180Line:new lo({paths:[[[-180,-180],[-180,180]]],spatialReference:Xi.WGS84})}};function pS(i,e){return Math.ceil((i-e)/(2*e))}function uHe(i,e){const t=$ie(i);for(const r of t)for(const n of r)n[0]+=e;return i}function $ie(i){return ed(i)?i.rings:i.paths}function _p(i,e){return e?{...e,query:{...i??{},...e.query}}:{query:i}}function gu(i){return typeof i=="string"?Yo(i):li(i)}function Ig(i,e,t){const r={};for(const n in i){if(n==="declaredClass")continue;const s=i[n];if(s!=null&&typeof s!="function")if(Array.isArray(s))r[n]=s.map(o=>Ig({item:o},e,t).item);else if(typeof s=="object")if(s.toJSON){const o=s.toJSON(t?.[n]);r[n]=JSON.stringify(o)}else r[n]=JSON.stringify(s);else r[n]=s}return r}async function War(i,e,t,r){const n=gu(i),s=e[0].spatialReference,o={...r,responseType:"json",query:{...n.query,f:"json",sr:Hv(s),target:JSON.stringify({geometryType:ah(e[0]),geometries:e}),cutter:JSON.stringify(t)}},a=await zi(n.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=a.data;return{cutIndexes:l,geometries:u.map(c=>{const h=Ro(c);return h.spatialReference=s,h})}}function qar(i){return{geometryType:ah(i[0]),geometries:i.map(e=>e.toJSON())}}function tRt(i,e,t){const r=WXi(e);return i.map(n=>{const s=r.fromJSON(n);return s.spatialReference=t,s})}async function Yar(i,e,t){const r=typeof i=="string"?Yo(i):i,n=e[0].spatialReference,s=ah(e[0]),o={...t,query:{...r.query,f:"json",sr:Hv(n),geometries:JSON.stringify(qar(e))}},{data:a}=await zi(r.path+"/simplify",o);return tRt(a.geometries,s,n)}const iRt=()=>di.getLogger("esri.geometry.support.normalizeUtils");function Xar(i){return i.type==="polygon"}function Jar(i){return i[0].type==="polygon"}function Kar(i){return i[0].type==="polyline"}function bot(i){const e=[];let t=0,r=0;for(let n=0;n1){for(let R=1;R<=v-1;R++){const L=R*e,k=m*L+a,B=p*L+l;s.push([k,B])}const w=(h+Math.floor(v-1)*e)/2,S=m*w+a,I=p*w+l;s.push([S,I])}s.push([u,c])}}return Xar(i)?new $s({rings:r,spatialReference:i.spatialReference}):new lo({paths:r,spatialReference:i.spatialReference})}function wot(i,e,t){if(e){const r=Zar(i,1e6);i=r8(r,!0)}return t&&(i=uHe(i,t)),i}function xot(i,e,t){if(Array.isArray(i)){const r=i[0];if(r>e){const n=pS(r,e);i[0]=r+n*(-2*e)}else if(re){const n=pS(r,e);i=i.clone().offset(n*(-2*e),0)}else if(r{if(u[0]<180)return!0;{let c=0;for(let p=0;pc?m:c}c=Number(c.toFixed(9));const h=-360*pS(c,180);for(let p=0;pxot($,a,l)),v.push(B)}else if(k.type==="extent"){const B=k.clone()._normalize(!1,!1,s);v.push(B.rings?new $s(B):B)}else if(k.extent){const B=k.extent,$=pS(B.xmin,l)*(2*a);let V=$===0?k.clone():uHe(k.clone(),$);B.offset($,0),B.intersects(c)&&B.xmax!==a?(p=B.xmax>p?B.xmax:p,V=wot(V,o),m.push(V),v.push("cut")):B.intersects(h)&&B.xmin!==l?(p=B.xmax*(2*a)>p?B.xmax*(2*a):p,V=wot(V,o,360),m.push(V),v.push("cut")):v.push(V)}else v.push(k.clone());else v.push(k);else v.push(k);let w=pS(p,a),S=-90;const I=w,R=new lo;for(;w>0;){const k=360*w-180;R.addPath([[k,S],[k,-1*S]]),S*=-1,w--}if(m.length>0&&I>0){const k=Qar(m,await War(r,m,R,t)),B=[],$=[];for(let K=0;K1&&re.rings.length>=ne.rings.length?(B.push(re),$.push("simplify")):$.push(o?WC(re):re)}}if(!B.length)return $;const V=await Yar(r,B,t),Y=[];for(let K=0;K<$.length;K++){const Q=$[K];Q!=="simplify"?Y.push(Q):Y.push(o?WC(V.shift()):V.shift())}return Y}const L=[];for(let k=0;ks||ln)return e;switch(i.type){case"polygon":if(!(i.rings.length>1))return e;a=bot(i.rings);break;case"polyline":if(!(i.paths.length>1))return e;a=bot(i.paths);break;case"multipoint":a=i.points}const c=e.clone();for(let h=0;hs?a=Math.ceil(Math.abs(e-s)/o):es?l=Math.ceil(Math.abs(i-s)/o):is?u-=o:cn)for(;i>n;)i-=s}return i}let Sot=class{constructor(e=null,t=null,r=null){this.minValue=e,this.maxValue=t,this.noDataValue=r}};const tlr=9999999e31,ilr=2e-7,rlr={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function Yx(i){return rlr[i]??[-34028234663852886e22,34028234663852886e22]}function Gme(i,e){return i==null||e==null?"s32":i<0?i>=-128&&e<128?"s8":i>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function SF(i){return(i?.startsWith("s")||i?.startsWith("u"))??!1}function Z2e(i,e,t){if(i.depthCount&&i.depthCount>1)return;const{pixels:r,statistics:n,pixelType:s}=i,o=r[0].length,a=i.bandMasks??[],l=i.mask??new Uint8Array(o).fill(255),u=s==="f32"||s==="f64",c=Yx(s);let h=!1;for(let p=0;pm+Number.EPSILON||w=tlr?ilr*Math.abs(m):s==="f32"?2**-23:Number.EPSILON);for(let k=0;k1?a:null,i.mask=l),h&&"updateStatistics"in i&&i.updateStatistics()}var _4;let Y0=_4=class extends Ci{static createEmptyBand(i,e){return new(_4.getPixelArrayConstructor(i))(e)}static combineBandMasks(i){if(i.length<2)return i[0];const e=i[0].length,t=new Uint8Array(e).fill(255);for(let r=0;rthis._calculateBandStatistics(t,this.mask));const i=this.mask;let e=0;if(i!=null)for(let t=0;tt?t:ah>=e.length),s=r===i.length&&!i.some((h,p)=>h!==p);if(n||s)return this;const o=this.bandMasks?.length===r?i.map(h=>this.bandMasks[h]):void 0;let{mask:a,validPixelCount:l}=this;const{width:u,height:c}=this;return o?.length&&(a=_4.combineBandMasks(o),l=a.filter(h=>!!h).length),new _4({pixelType:this.pixelType,width:u,height:c,mask:a,bandMasks:o,validPixelCount:l,maskIsAlpha:this.maskIsAlpha,pixels:i.map(h=>e[h]),statistics:t&&i.map(h=>t[h])})}clone(){const i=new _4({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?i.mask=new Uint8Array(this.mask):i.mask=this.mask.slice(0)),this.bandMasks&&(i.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const t=_4.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){i.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(o=n[1],a=n[2]):n.length===2&&(o=n[1]);const u=new Uint32Array(i),c=this.width*this.height;if(s.length===c)if(e!=null&&e.length===c)if(t)for(l=0;l0){for(const w of r)if(w.minValue!=null&&(o=Math.min(o,w.minValue)),w.maxValue!=null&&w.minValue!=null){const S=w.maxValue-w.minValue;a=Math.max(a,S)}s=255/a}else{let w=255;n==="s8"?(o=-128,w=127):n==="u16"?w=65535:n==="s16"?(o=-32768,w=32767):n==="u32"?w=4294967295:n==="s32"?(o=-2147483648,w=2147483647):n==="f32"?(o=-34e38,w=34e38):n==="f64"&&(o=-Number.MAX_VALUE,w=Number.MAX_VALUE),s=255/(w-o)}const l=new Uint32Array(i),u=this.width*this.height;let c,h,p,m,v;if(c=h=p=e[0],c.length!==u)return di.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(h=e[1],e.length>=3&&(p=e[2]),t!=null&&t.length===u)for(m=0;m=3?(n=e[1],s=e[2]):e.length===2&&(n=e[1]);const a=this.width*this.height;if(r.length!==a)return di.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let l=0;if(t!=null&&t.length===a)for(o=0;or?o:r);else for(s=0;sr?o:r;return new Sot(t,r)}};x([D({json:{write:!0}})],Y0.prototype,"width",void 0),x([D({json:{write:!0}})],Y0.prototype,"height",void 0),x([D({json:{write:!0}})],Y0.prototype,"pixelType",void 0),x([So("pixelType")],Y0.prototype,"castPixelType",null),x([D({json:{write:!0}})],Y0.prototype,"validPixelCount",void 0),x([D({json:{write:!0}})],Y0.prototype,"mask",void 0),x([D({json:{write:!0}})],Y0.prototype,"maskIsAlpha",void 0),x([D({json:{write:!0}})],Y0.prototype,"pixels",void 0),x([D()],Y0.prototype,"premultiplyAlpha",void 0),x([D({json:{write:!0}})],Y0.prototype,"statistics",void 0),x([D({json:{write:!0}})],Y0.prototype,"depthCount",void 0),x([D({json:{write:!0}})],Y0.prototype,"noDataValues",void 0),x([D({json:{write:!0}})],Y0.prototype,"bandMasks",void 0),Y0=_4=x([Qe("esri.layers.support.PixelBlock")],Y0);const Br=Y0;var w1e,x1e;(function(i){i[i.matchAny=0]="matchAny",i[i.matchAll=1]="matchAll"})(w1e||(w1e={})),function(i){i[i.bestMatch=0]="bestMatch",i[i.fail=1]="fail"}(x1e||(x1e={}));const uP=6;function bh(i){return i!=null&&i.declaredClass==="esri.layers.support.PixelBlock"&&i.pixels&&i.pixels.length>0}function nlr(i){if(!i?.length||i.some(c=>!bh(c)))return null;if(i.length===1)return i[0]?.clone()??null;const e=i,{width:t,height:r,pixelType:n}=e[0];if(e.some(c=>c.width!==t||c.height!==r))return null;const s=e.map(({mask:c})=>c).filter(c=>c!=null);let o=null;s.length&&(o=new Uint8Array(t*r),o.set(s[0]),s.length>1&&nRt(s.slice(1),o));const a=[];e.forEach(({pixels:c})=>a.push(...c));const l=e.map(({statistics:c})=>c).filter(c=>c?.length),u=[];return l.forEach(c=>u.push(...c)),new Br({pixelType:n,width:t,height:r,mask:o,pixels:a,statistics:u.length?u:null})}function LJ(i){if(!i)return;const e=i.colormap;if(!e||e.length===0)return;const t=e.sort((h,p)=>h[0]-p[0]);let r=0;t[0][0]<0&&(r=t[0][0]);const n=Math.max(256,t[t.length-1][0]-r+1),s=new Uint8Array(4*n),o=[];let a,l=0,u=0;const c=t[0].length===5;if(n>65536)return t.forEach(h=>{o[h[0]-r]=c?h.slice(1):h.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:c};if(i.fillUnspecified)for(a=t[u],l=a[0]-r;lI?n[c]=0:(p[c]=o[S],m[c]=o[S+1],v[c]=o[S+2],n[c]=o[S+3]));else{for(n=new Uint8Array(s),c=0;cI?n[c]=0:(p[c]=o[S],m[c]=o[S+1],v[c]=o[S+2],n[c]=o[S+3]);t.mask=n}}else if(a)if(n!=null)for(c=0;cs));const a=[],l=e.outputPixelType||"u8";for(let c=0;c1;){if(u===c.value){w=!0;break}u>c.value?h=v:p=v,v=Math.floor((h+p)/2),c=e[Math.floor(v)]}w||(u===e[h].value?(c=e[h],w=!0):u===e[p].value?(c=e[p],w=!0):ue[h].value&&(uk-v);w[0]=n[0],w[w.length-1]=n[n.length-1]+(u?1e-6:0);const S=n.length/2,[I,R]=Yx(o);for(let k=0;k=0;K--)if(V===w[2*K]||V>w[2*K]&&VR?R:V=a[Y]&&V<=a[Y+1]){h[$]=0,m[$]=0;break}}}return new Br({width:t,height:r,pixelType:o,pixels:[h],mask:m})}function Tot(i,e,t,r){const n=t!=null&&t.length>=2?new Set(t):null,s=t?.length===1?t[0]:null,o=!!e?.length;for(let a=0;a=e[c]&&l<=e[c+1]){u=!0;break}u||(r[a]=0)}r[a]&&(l===s||n?.has(l))&&(r[a]=0)}}function Cot(i,e){const t=i[0].length;for(let r=0;rS-1e-6);w[0]=t[0],o&&(w[w.length-1]=t[t.length-1]);for(let S=0;Sm?m:r[S]v.pixelBlock);if(t?.pixelBlock==null)return null;const r=(t.extent.xmax-t.extent.xmin)/t.pixelBlock.width,n=(t.extent.ymax-t.extent.ymin)/t.pixelBlock.height,s=.01*Math.min(r,n),o=i.sort((v,w)=>Math.abs(v.extent.ymax-w.extent.ymax)>s?w.extent.ymax-v.extent.ymax:Math.abs(v.extent.xmin-w.extent.xmin)>s?v.extent.xmin-w.extent.xmin:0),a=Math.min.apply(null,o.map(v=>v.extent.xmin)),l=Math.min.apply(null,o.map(v=>v.extent.ymin)),u=Math.max.apply(null,o.map(v=>v.extent.xmax)),c=Math.max.apply(null,o.map(v=>v.extent.ymax)),h={x:Math.round((e.xmin-a)/r),y:Math.round((c-e.ymax)/n)},p={width:Math.round((u-a)/r),height:Math.round((c-l)/n)},m={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/n)};return Math.round(p.width/t.pixelBlock.width)*Math.round(p.height/t.pixelBlock.height)!==o.length||h.x<0||h.y<0||p.widthv.pixelBlock),p,{clipOffset:h,clipSize:m})}}function H3e(i,e,t,r,n,s){const{width:o,height:a}=t.block,{x:l,y:u}=t.offset,{width:c,height:h}=t.mosaic,p=clr(o,a,r,n,l,u,c,h);let m=0,v=0;if(s){const w=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,S=o*s.resolutionX,I=s.startX+r*S;Iw?v=s.rightPadding:I>=w&&(m=s.leftMargin-s.rightPadding,v=0)}if(p.xmax-=v,typeof e!="number")for(let w=p.ymin;wbh(Q));if(a==null)return null;const l=n?n.width:e.width,u=n?n.height:e.height,c=a.width,h=a.height,p=e.width/c,m=e.height/h,v={offset:r||{x:0,y:0},mosaic:n||e,block:{width:c,height:h}},w=a.pixelType,S=Br.getPixelArrayConstructor(w),I=a.pixels.length,R=[];let L,k;for(let Q=0;QQ==null||Q.mask!=null&&Q.mask.length>0),$=i.some(Q=>Q?.bandMasks&&Q.bandMasks.length>1),V=B?new Uint8Array(l*u):void 0,Y=$?[]:void 0;if(V){for(let Q=0;QS!=null);if(r==null)return null;const n=i.some(S=>S==null||!!S.mask),{width:s,height:o}=e,a=n?new Uint8Array(s*o):null,{blockWidths:l}=t,u=[],c=r.getPlaneCount(),h=Br.getPixelArrayConstructor(r.pixelType);if(n)for(let S=0,I=0;SS?.bandMasks&&S.bandMasks.length>1),m=p?[]:void 0,v=s*o;for(let S=0;Sr||l>n||s===0&&o===0&&a===r&&l===n)return i;i.mask||(i.mask=new Uint8Array(r*n));const u=i.mask;for(let c=0;c=l||p=a?0:1}return i.updateStatistics(),i}function flr(i){if(!bh(i))return null;const e=i.clone(),{width:t,height:r,pixels:n}=i,s=n[0],o=e.pixels[0],a=i.mask;for(let l=2;le&&(t=s.value,e=r),s=n.next();return t}function mhe(i,e,t){if(t===0)return;const r=i.get(e);r===1?i.delete(e):i.set(e,r-1)}function NJ(i,e,t){t!==0&&i.set(e,i.has(e)?i.get(e)+1:1)}function sRt(i,e,t){let{x:r,y:n}=e;const{width:s,height:o}=t;if(r===0&&n===0&&o===i.height&&s===i.width)return i;const{width:a,height:l}=i,u=Math.max(0,n),c=Math.max(0,r),h=Math.min(r+s,a),p=Math.min(n+o,l);if(h<0||p<0||!bh(i))return null;r=Math.max(0,-r),n=Math.max(0,-n);const{pixels:m}=i,v=s*o,w=m.length,S=[];for(let k=0;k0;m--)p=oRt(p,o);return p}function uRt(i,e,t,r,n=0){const{width:s,height:o}=i,{width:a,height:l}=e,u=r.cols,c=r.rows,h=Math.ceil(a/u-.1/u),p=Math.ceil(l/c-.1/c);let m,v,w,S,I,R,L;const k=h*u,B=k*p*c,$=new Float32Array(B),V=new Float32Array(B),Y=new Uint32Array(B),K=new Uint32Array(B);let Q,re,ne=0;for(let de=0;de{const Z=ne instanceof Float32Array||ne instanceof Float64Array?0:.5;for(let ae=0;ae0){const[tt,yt]=Vy(R,V,e,l),[Ct,ot]=Vy(S,I,e,l);ne.push(tt),ne.push(yt),ne.push(Ve),ne.push($e),ne.push(Ct),ne.push(ot)}else{const[tt,yt]=Vy(R,L,e,l),[Ct,ot]=Vy(k,B,e,l),[vt,At]=Vy(Y,K,e,l);de.push(Ve),de.push($e),de.push(vt),de.push(At),de.push(Ct),de.push(ot),de.push(tt),de.push(yt)}V+=s,I+=s,L+=s,B+=s,K+=s}const[pe,H]=Vy(u+w,c+o,e,l),Z=(r/2+h)*v,[ae,fe]=Vy(u+Z,c+o,e,l),[be,_e]=Vy(u+w,c-a,e,l),[Ie,Te]=Vy(u+Z,c-a,e,l);return{pennants:ne,barbs:de,shaft:[pe,H,ae,fe,be,_e,Ie,Te]}}function Vy(i,e,t,r=1){const n=Math.sqrt(i*i+e*e)/r,s=(2*Math.PI+Math.atan2(e,i))%(2*Math.PI);return[n,(2*Math.PI+s-t)%(2*Math.PI)]}const ghe=[0,1,3,6,10,16,21,27,33,40,47,55,63],blr=[0,.5,1,1.5,2],wlr=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function GL(i,e,t,r){const n=Q2e(r||"knots",t);let s;for(s=1;sB>0).length:p*m,R=new Float32Array(I*l),L=new Uint32Array(u*I),k=e.invertDirection?pRt(0,0,0,!1):vlr;for(let B=0;B=pHe){const I=(a[w]+360)%360/180*Math.PI,{pennants:R,barbs:L,shaft:k}=W3e[Math.min(Math.floor(S/5),29)];if(R.length+L.length===0)continue;let B=u.length/l;const $=(v+.5)/r,V=(m+.5)/n;for(let Y=0;Y=(K-V)*(Q-Y)*(1-n)){I[$]=1;const[re,ne]=eSe([w[$]/B,S[$]/B]);w[$]=re,S[$]=ne}else I[$]=0,w[$]=0,S[$]=0}const R=new Br({width:p,height:m,pixels:[w,S],mask:I});return R.updateStatistics(),R}function Elr(i){const e=[];return MLe(Jtr(i),e),e.length?new jr(Ly(e[0])):null}function MLe(i,e){if(!i)return;let t;t=i.type==="CIMTextSymbol"?i.symbol:i;const r=i.type==="CIMPolygonSymbol";if(t?.symbolLayers){for(const n of t.symbolLayers)if(!(n.colorLocked||r&&(Ztr(n)||Ktr(n)&&n.markerPlacement&&mVe(n.markerPlacement))))switch(n.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":n.tintColor&&Aot(e,n.tintColor);break;case"CIMVectorMarker":n.markerGraphics?.forEach(s=>{MLe(s.symbol,e)});break;case"CIMSolidStroke":case"CIMSolidFill":Aot(e,n.color);break;case"CIMHatchFill":MLe(n.lineSymbol,e)}}}function Aot(i,e){for(const t of i)if(t.join(".")===e.join("."))return;i.push(e)}new d3(1e3);new jr([128,128,128]);const Ilr=new jr("white");function hj(i,e){if(!i)return null;let t=null;return JF(i)?t=Alr(i):P2e(i)&&(t=i.type==="cim"?Elr(i):i.color?new jr(i.color):null),t?Hne(t,e):null}function Alr(i){const e=i.symbolLayers;if(!e)return null;let t=null;return e.forEach(r=>{r.type==="object"&&r.resource?.href||(t=r.type==="water"?r.color:r.material?r.material.color:null)}),t?new jr(t):null}function Hne(i,e){if(e==null||i==null)return i;const t=i.toRgba();return t[3]=t[3]*e,new jr(t)}function Mlr(i,e,t){const r=i.symbolLayers;if(!r)return;const n=s=>Hne(e=e??s??(t!=null?Ilr:null),t);r.forEach(s=>{if(s.type!=="object"||!s.resource?.href||e)if(s.type==="water")s.color=n(s.color);else{const o=s.material!=null?s.material.color:null,a=n(o);s.material==null?s.material=new vx({color:a}):s.material.color=a,t!=null&&"outline"in s&&s.outline?.color!=null&&(s.outline.color=Hne(s.outline.color,t))}})}function Olr(i,e,t){(e=e??i.color)&&(i.color=Hne(e,t)),t!=null&&"outline"in i&&i.outline?.color&&(i.outline.color=Hne(i.outline.color,t))}function q3e(i,e,t){i&&(e||t!=null)&&(e&&(e=new jr(e)),JF(i)?Mlr(i,e,t):P2e(i)&&Olr(i,e,t))}async function Plr(i,e){const t=i.symbolLayers;t&&await yqi(t,async r=>Rlr(r,e))}async function Rlr(i,e){switch(i.type){case"extrude":Flr(i,e);break;case"icon":case"line":case"text":Dlr(i,e);break;case"path":Llr(i,e);break;case"object":await klr(i,e)}}function Dlr(i,e){const t=fRt(e);t!=null&&(i.size=t)}function fRt(i){for(const e of i)if(typeof e=="number")return e;return null}function Flr(i,e){i.size=typeof e[2]=="number"?e[2]:0}async function klr(i,e){const{resourceSize:t,symbolSize:r}=await Nlr(i),n=mRt(e,t,r);i.width=jie(e[0],r[0],t[0],n),i.depth=jie(e[1],r[1],t[1],n),i.height=jie(e[2],r[2],t[2],n)}function Llr(i,e){const t=mRt(e,nae,[i.width,void 0,i.height]);i.width=jie(e[0],i.width,1,t),i.height=jie(e[2],i.height,1,t)}function mRt(i,e,t){for(let r=0;r<3;r++){const n=i[r];switch(n){case"symbol-value":{const s=t[r];return s!=null?s/e[r]:1}case"proportional":break;default:if(n&&e[r])return n/e[r]}}return 1}async function Nlr(i){const{computeObjectLayerResourceSize:e}=await Promise.resolve().then(()=>Dan),t=await e(i,10),{width:r,height:n,depth:s}=i,o=[r,s,n];let a=1;for(let l=0;l<3;l++){const u=o[l];if(u!=null){a=u/t[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=t[l]*a);return{resourceSize:t,symbolSize:o}}function jie(i,e,t,r){switch(i){case"proportional":return t*r;case"symbol-value":return e??t;default:return i}}function $lr(i,e){const t=fRt(e);if(t!=null)switch(i.type){case"simple-marker":i.size=t;break;case"picture-marker":{const r=i.width/i.height;r>1?(i.width=t,i.height=t*r):(i.width=t*r,i.height=t);break}case"simple-line":i.width=t;break;case"text":i.font.size=t}}async function gRt(i,e){if(i&&e)return JF(i)?Plr(i,e):void(P2e(i)&&$lr(i,e))}function yRt(i,e,t){if(i&&e!=null)if(JF(i)){const r=i.symbolLayers;r&&r.forEach(n=>{if(n&&n.type==="object")switch(t){case"tilt":n.tilt=(n.tilt??0)+e;break;case"roll":n.roll=(n.roll??0)+e;break;default:n.heading=(n.heading??0)+e}})}else P2e(i)&&(i.type!=="simple-marker"&&i.type!=="picture-marker"&&i.type!=="text"||(i.angle+=e))}async function Blr(i,e){return await i.fetchSymbol(e)||i.fetchCIMSymbol(e)}var OLe;const Mot=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),yhe=new Rs({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),vhe=new Rs({flow_from:"flow-from",flow_to:"flow-to"});let X0=OLe=class extends Wk(Ci){constructor(i){super(i),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(i,e){return Mot.has(i)?Zw.fromJSON(i):null}readOutputUnit(i,e){return Mot.has(i)?Zw.fromJSON(i):null}get styleRenderer(){const i=this.style,e=this.attributeField,t=this._createStyleRenderer(i);return t.field=e,t}get sizeVariables(){const i=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="size"&&i.push(e);if(i.length===0){const e=new CY({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),i.push(e)}return i}get rotationVariables(){const i=[];if(this.visualVariables)for(const e of this.visualVariables)e.type==="rotation"&&i.push(e);if(i.length===0){const e=new k2e({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(e):this._set("visualVariables",[e]),i.push(e)}return i}clone(){return new OLe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:li(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(i,e=!1,t=[]){const r=new Array,n=Q2e(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,o=e?AW(i.pixelBlock,"vector-uv",s,n):glr(i.pixelBlock,"vector-magdir",n);if(o==null)return r;const a=i.extent,l=o.mask!=null&&o.mask.length>0;let u=0;const c=(a.xmax-a.xmin)/o.width,h=(a.ymax-a.ymin)/o.height;for(let p=0;pS.intersects(v));if((!l||o.mask[u])&&!w){const S={Magnitude:o.pixels[0][u],Direction:o.pixels[1][u]},I=new Us({geometry:{type:"point",x:v.x,y:v.y,spatialReference:a.spatialReference},attributes:S});I.symbol=this._getVisualVariablesAppliedSymbol(I),r.push(I)}}return r}getSymbol(i,e){}async getSymbolAsync(i,e){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(i){return new Jh({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new vg({width:0}),size:20,color:i||new jr([0,92,230])})}_getVisualVariablesAppliedSymbol(i){if(!i)return;const e=this.styleRenderer?.getSymbol(i)?.clone(),t=this.sizeVariables,r=this.rotationVariables;if(t&&t.length&&this.sizeVariables.forEach(n=>gRt(e,J3t([n],i))),r&&r.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;i.attributes.Direction=i.attributes.Direction+n,this.rotationVariables.forEach(s=>yRt(e,q3t(s,i),s.axis))}return e}_createStyleRenderer(i){let e={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(i){case"single-arrow":e=this._createSingleArrowRenderer();break;case"beaufort-kn":e=this._createBeaufortKnotsRenderer();break;case"beaufort-m":e=this._createBeaufortMeterRenderer();break;case"beaufort-ft":e=this._createBeaufortFeetRenderer();break;case"beaufort-mi":e=this._createBeaufortMilesRenderer();break;case"beaufort-km":e=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":e=this._createCurrentMeterRenderer();break;case"ocean-current-kn":e=this._createCurrentKnotsRenderer();break;case"simple-scalar":e=this._createSimpleScalarRenderer();break;case"wind-barb":e=this._createWindBarbsRenderer();break;case"classified-arrow":e=this._createClassifiedArrowRenderer()}return new XB(e)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const i=[0,1,3,6,10,16,21,27,33,40,47,55,63],e=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new jr([214,47,39])),classBreakInfos:this._getClassBreaks(i,e)}}_createBeaufortMeterRenderer(){const i=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],e=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new jr([214,47,39])),classBreakInfos:this._getClassBreaks(i,e)}}_createBeaufortFeetRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.28084;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMilesRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=2.23694;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortKilometersRenderer(){const i=this._getDefaultSymbol(new jr([214,47,39]));let e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],r=3.6;return e=e.map(n=>n*r),{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentMeterRenderer(){const i=[0,.5,1,1.5,2],e=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new jr([177,177,177])),classBreakInfos:this._getClassBreaks(i,e)}}_createCurrentKnotsRenderer(){const i=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],e=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new jr([177,177,177])),classBreakInfos:this._getClassBreaks(i,e)}}_createClassifiedArrowRenderer(){const i=this._getDefaultSymbol(new jr([56,168,0]));let e=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,n=this.sizeVariables[0].maxDataValue;if(r&&n){const s=(n-r)/5;e=Array.from(Array(6).keys()).map(o=>r+s*o)}}const t=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:i,classBreakInfos:this._getClassBreaks(e,t)}}_createSimpleScalarRenderer(){return{defaultSymbol:BP.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const i=Array.from(Array(31).keys()).map(n=>5*n),e=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],t=BP.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),r=i.map((n,s)=>{let o;if(s!==i.length-1)if(s===0)o={minValue:n,maxValue:i[s+1],symbol:t};else{const a=BP.fromJSON({type:"esriPMS",imageData:e[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:n,maxValue:i[s+1],symbol:a}}return new _W(o)});return{defaultSymbol:t,classBreakInfos:r}}_getClassBreaks(i,e){return e.map((t,r)=>new _W({minValue:i[r],maxValue:i[r+1],symbol:this._getDefaultSymbol(new jr(t))}))}};x([D({type:String,json:{write:!0}})],X0.prototype,"attributeField",void 0),x([D({type:vhe.apiValues,json:{type:vhe.jsonValues,read:{reader:vhe.read},write:{writer:vhe.write}}})],X0.prototype,"flowRepresentation",void 0),x([D({type:["geographic","arithmetic"],json:{write:!0}})],X0.prototype,"rotationType",void 0),x([D({type:yhe.apiValues,json:{type:yhe.jsonValues,read:{reader:yhe.read},write:{writer:yhe.write}}})],X0.prototype,"style",void 0),x([D({json:{write:!0}})],X0.prototype,"symbolTileSize",void 0),x([D({type:Zw.apiValues,json:{type:Zw.jsonValues,write:{writer:Zw.write}}})],X0.prototype,"inputUnit",void 0),x([Mi("inputUnit")],X0.prototype,"readInputUnit",null),x([D({type:Zw.apiValues,json:{type:Zw.jsonValues,read:{reader:Zw.read},write:{writer:Zw.write}}})],X0.prototype,"outputUnit",void 0),x([Mi("outputUnit")],X0.prototype,"readOutputUnit",null),x([Wr({vectorField:"vector-field"})],X0.prototype,"type",void 0),x([D({type:XB})],X0.prototype,"styleRenderer",null),x([D({type:CY})],X0.prototype,"sizeVariables",null),x([D({type:k2e})],X0.prototype,"rotationVariables",null),X0=OLe=x([Qe("esri.renderers.VectorFieldRenderer")],X0);const fHe=X0,S1e={key:"type",base:null,typeMap:{"unique-value":JB,"class-breaks":XB,"raster-colormap":aHe,"raster-stretch":lHe,"vector-field":fHe,"raster-shaded-relief":QPt,flow:qPt}},T1e={...S1e,typeMap:{...S1e.typeMap}};delete T1e.typeMap["vector-field"],delete T1e.typeMap.flow;const jlr={uniqueValue:JB,classBreaks:XB,rasterStretch:lHe,rasterColormap:aHe,vectorField:fHe,rasterShadedRelief:QPt,flowRenderer:qPt};function Glr(i){return i&&jlr[i.type]||null}function vRt(i,e){if(!i)return null;if(i.type==="classBreaks"&&i.classificationMethod){const r=i.authoringInfo||{classificationMethod:""};r.classificationMethod=i.classificationMethod,i.authoringInfo=r}i.type==="vectorField"&&i.visualVariables&&!Array.isArray(i.visualVariables)&&(i.visualVariables=[i.visualVariables]);const t=Glr(i);if(t){const r=new t;return r.read(i,e),r}return e?.messages&&i&&e.messages.push(new Rf("renderer:unsupported","Renderers of type '"+(i.type||"unknown")+"' are not supported",{definition:i,context:e})),null}var PLe;let KN=PLe=class extends Ci{constructor(i){super(i),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new PLe({variableName:this.variableName,dimensionName:this.dimensionName,values:li(this.values),isSlice:this.isSlice})}};x([D({type:String,json:{write:!0}})],KN.prototype,"variableName",void 0),x([D({type:String,json:{write:!0}})],KN.prototype,"dimensionName",void 0),x([D({type:bJ.array(bJ.oneOf([bJ.native(Number),bJ.array(bJ.native(Number))])),json:{write:!0}})],KN.prototype,"values",void 0),x([D({type:Boolean,json:{write:!0}})],KN.prototype,"isSlice",void 0),KN=PLe=x([Qe("esri.layers.support.DimensionalDefinition")],KN);const gR=KN,UP=pa()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Gie=pa()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),zV=pa()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let b4=class extends Ci{constructor(){super(...arguments),this.pixelType="unknown"}};x([D({type:String,json:{write:!0}})],b4.prototype,"name",void 0),x([D({type:String,json:{write:!0}})],b4.prototype,"description",void 0),x([D({type:ms,json:{type:ms,write:!0,name:"_object_id"}})],b4.prototype,"id",void 0),x([D({type:String,json:{type:zV.jsonValues,read:zV.read,write:zV.write}})],b4.prototype,"pixelType",void 0),x([D({type:String,json:{write:!0}})],b4.prototype,"type",void 0),b4=x([Qe("esri.layers.support.RasterFunctionInfo")],b4);const Ulr=b4;let tO=class extends Ci{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};x([D({type:String,json:{write:!0}})],tO.prototype,"name",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],tO.prototype,"id",void 0),x([D({type:Boolean,json:{write:!0}})],tO.prototype,"isDataset",void 0),x([D({type:Boolean,json:{write:!0}})],tO.prototype,"isPublic",void 0),x([D({json:{write:!0}})],tO.prototype,"value",void 0),x([D({type:String,json:{write:!0}})],tO.prototype,"type",void 0),tO=x([Qe("esri.layers.support.RasterFunctionVariable")],tO);const zlr=tO,_he={key:"type",base:null,typeMap:{RasterFunctionVariable:zlr}};let ZN=class extends Ci{};x([D({types:_he,json:{types:_he,name:"MatchVariable"}})],ZN.prototype,"matchVariable",void 0),x([D({types:_he,json:{types:_he,name:"UnionDimension"}})],ZN.prototype,"unionDimension",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],ZN.prototype,"id",void 0),x([D({type:String,json:{write:!0}})],ZN.prototype,"type",void 0),ZN=x([Qe("esri.layers.support.RasterFunctionProperties")],ZN);const Vlr=ZN,Y3e=new Rs({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let zg=class extends Ci{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};x([D({type:[String],json:{write:!0}})],zg.prototype,"aliases",void 0),x([D({type:Object,json:{write:!0}})],zg.prototype,"arguments",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"description",void 0),x([D({type:Ulr,json:{write:!0,name:"function"}})],zg.prototype,"functionInfo",void 0),x([D({type:Y3e.apiValues,json:{type:[0,1,2],read:Y3e.read,write:Y3e.write}})],zg.prototype,"functionType",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"group",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"help",void 0),x([D({type:Number,json:{type:ms,write:!0,name:"_object_id"}})],zg.prototype,"id",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"name",void 0),x([D({type:String,json:{write:!0,name:"definition"}})],zg.prototype,"queryDefinition",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"tag",void 0),x([D({type:Vlr,json:{write:!0}})],zg.prototype,"properties",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"thumbnail",void 0),x([D({type:String,json:{write:!0}})],zg.prototype,"thumbnailEx",void 0),x([D({json:{type:["RasterFunctionTemplate"],write:!0}})],zg.prototype,"type",void 0),zg=x([Qe("esri.layers.support.RasterFunctionTemplate")],zg);const _Rt=zg;var RLe;const Ume=new Set(["raster","raster2","dem","fillraster"]),zme=new Set(["rasters"]),Oot=i=>i?.rasterFunction?hv.fromJSON(i):i,X3e=i=>i&&i instanceof hv?i.toJSON():i,DLe=i=>i?.functionName&&!i.declaredClass,Pot=i=>DLe(i)?new hv(i):i,Hlr=i=>{if(i==null)return null;i=li(i);const e={};for(const t of Object.keys(i))Ume.has(t.toLowerCase())?e[t]=Oot(i[t]):zme.has(t.toLowerCase())&&Array.isArray(i[t])?e[t]=i[t].map(Oot):e[t]=i[t];return e},Wlr={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:_Rt}},json:{write:!0,name:"rasterFunctionDefinition"}};let hv=RLe=class extends Ci{constructor(i){super(i),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(i){if(i){const e=Object.keys(i);if(e.some(t=>Ume.has(t.toLowerCase())&&DLe(i[t]))||e.some(t=>zme.has(t.toLowerCase())&&Array.isArray(i[t])&&i[t].some(r=>DLe(r)))){i=li(i);for(const t of e)Ume.has(t.toLowerCase())?i[t]=Pot(i[t]):zme.has(t.toLowerCase())&&Array.isArray(i[t])&&(i[t]=i[t].map(r=>Pot(r)))}}this._set("functionArguments",i)}readFunctionArguments(i){return Hlr(i)}writeFunctionArguments(i,e,t){const r={};for(const n of Object.keys(i))Ume.has(n.toLowerCase())?r[n]=X3e(i[n]):zme.has(n.toLowerCase())&&Array.isArray(i[n])?r[n]=i[n].map(X3e):r[n]=X3e(i[n]);e[t]=r}readFunctionName(i,e){const t=e.rasterFunctionInfos;return e.name||(t?.length&&t[0].name!=="None"?t[0].name:e.rasterFunctionDefinition?e.rasterFunctionDefinition.name:e.rasterFunction)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(i){this.functionDefinition=i?_Rt.fromJSON(i):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new RLe({functionName:this.functionName,functionArguments:li(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:li(this.rasterFunctionDefinition)})}};x([D({json:{type:Object,name:"rasterFunctionArguments"}})],hv.prototype,"functionArguments",null),x([Mi("functionArguments")],hv.prototype,"readFunctionArguments",null),x([ur("functionArguments")],hv.prototype,"writeFunctionArguments",null),x([D({json:{type:String,write:{target:"rasterFunction"}}})],hv.prototype,"functionName",void 0),x([Mi("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],hv.prototype,"readFunctionName",null),x([Wr({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),D({json:{default:"unknown"}})],hv.prototype,"outputPixelType",void 0),x([D({type:String,json:{read:!0,write:!0}})],hv.prototype,"variableName",void 0),x([D()],hv.prototype,"rasterFunctionDefinition",null),x([D(Wlr)],hv.prototype,"functionDefinition",void 0),x([D()],hv.prototype,"hasClipFunction",null),hv=RLe=x([Qe("esri.layers.support.RasterFunction")],hv);const kl=hv,qlr={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Ylr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Xlr={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Jlr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function bRt(i){return Jlr.has(i.type)}function J3e(i,e){if(!i||!e)return li(i||e);const t=li(i);if(t.functionDefinition&&e.rasterFunctionDefinition){const r=e.rasterFunctionDefinition;(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=void 0),wRt(t.functionDefinition.arguments,e),t.rasterFunctionDefinition=t.functionDefinition.toJSON()}else e.functionName?.toLowerCase()!=="none"&&(xRt(t.functionArguments).Raster=e);return t}function wRt(i,e){for(const t in i)t.toLowerCase()==="raster"&&(i[t].type==="RasterFunctionVariable"?(i[t]=e.rasterFunctionDefinition,i[t].type="RasterFunctionTemplate"):i[t].type==="RasterFunctionTemplate"&&wRt(i[t].arguments,e))}function f3(i){const e=li(qlr[i.functionName+"Function"]),t=i.functionArguments;for(const r in t)r.toLowerCase()==="raster"?(e.arguments[r]=f3(t[r]),e.arguments[r].type="RasterFunctionTemplate"):r.toLowerCase()==="colormap"?(e.arguments[r].value=sur(t[r]),e.arguments.ColorSchemeType.value=0):e.arguments[r].value=t[r];return e}function Klr(i,e){switch(e=e||{},i.type){case"raster-stretch":return eur(i,e);case"class-breaks":return tur(i,e);case"unique-value":return iur(i,e);case"raster-colormap":return rur(i,e);case"vector-field":return Zlr(i,e);case"raster-shaded-relief":return Qlr(i,e);case"flow":throw new Error("Unsupported rendering rule.")}}function xRt(i){const e=i?.Raster??i?.raster;return e&&e.declaredClass==="esri.layers.support.RasterFunction"?xRt(e.functionArguments):i}const $J={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Zlr(i,e){const t=new kl;t.functionName="VectorFieldRenderer";const{dataType:r,bandNames:n}=e,s=r==="vector-uv";let o,a;if(n&&n.length===2){const m=n.map(v=>v.toLowerCase());o=m.indexOf("magnitude"),a=m.indexOf("direction")}o!==-1&&o!==null||(o=0,a=1);const l=i.rotationType==="arithmetic"?1:2,u=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(m=>m.field==="Magnitude"):new CY,h={magnitudeBandID:o,directionBandID:a,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Xlr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};t.functionArguments=h;const p=f3(t);return e.convertToRFT?kl.fromJSON({rasterFunctionDefinition:p}):t}function Qlr(i,e){const t=e.convertToRFT;if(e.dataType!=="elevation"&&(e.dataType!=="generic"||e.bandCount!==1||e.pixelType!=="s16"&&e.pixelType!=="s32"&&e.pixelType!=="f32"&&e.pixelType!=="f64"))return new kl;const r=new kl;r.functionName="Hillshade";const n=i.hillshadeType==="traditional"?0:1,s=i.scalingType==="none"?1:3,o={HillshadeType:n,SlopeType:s,ZFactor:i.zFactor};return n===0&&(o.Azimuth=i.azimuth,o.Altitude=i.altitude),s===3&&(o.PSPower=i.pixelSizePower,o.PSZFactor=i.pixelSizeFactor),r.functionArguments=o,r.variableName="Raster",i.colorRamp&&(r.functionName="ShadedRelief",t?o.ColorRamp=ZPt(i.colorRamp):o.Colormap=tk(i.colorRamp)),t?new kl({rasterFunctionDefinition:f3(r)}):r}function eur(i,e){const t=e.convertToRFT,r=new kl;r.functionName="Stretch";const n=$J[Nie.toJSON(i.stretchType)],s="u8",o={StretchType:n,Statistics:nur(i.statistics??[]),DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(o.Min=i.outputMin),i.outputMax!=null&&(o.Max=i.outputMax),n===$J.standardDeviation?(o.NumberOfStandardDeviations=i.numberOfStandardDeviations,r.outputPixelType=s):n===$J.percentClip?(o.MinPercent=i.minPercent,o.MaxPercent=i.maxPercent,r.outputPixelType=s):n===$J.minMax?r.outputPixelType=s:n===$J.sigmoid&&(o.SigmoidStrengthLevel=i.sigmoidStrengthLevel),r.functionArguments=o,r.variableName="Raster",i.colorRamp){const a=i.colorRamp,l=new kl;if(t)l.functionArguments={ColorRamp:ZPt(a)};else{const u=XPt(a,!0);if(u)l.functionArguments={colorRampName:u};else if(!e.convertColorRampToColormap||a.type!=="algorithmic"&&a.type!=="multipart"){const c=i.colorRamp.toJSON();c.type==="algorithmic"?c.algorithm=c.algorithm||"esriCIELabAlgorithm":c.type==="multipart"&&c.colorRamps?.length&&c.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),l.functionArguments={colorRamp:c}}else l.functionArguments={Colormap:tk(a)}}return l.variableName="Raster",l.functionName="Colormap",l.functionArguments.Raster=r,t?new kl({rasterFunctionDefinition:f3(l)}):l}return t?new kl({rasterFunctionDefinition:f3(r)}):r}function tur(i,e){const t=[],r=[],n=[],s=[],{pixelType:a,rasterAttributeTable:l}=e,u=l==null?null:l.features,c=SRt(l);if(c&&u&&Array.isArray(u)&&i.classBreakInfos){i.classBreakInfos.forEach((S,I)=>{const R=S.symbol?.color;let L;R?.a&&S.minValue!=null&&S.maxValue!=null&&u.forEach(k=>{S.minValue!=null&&S.maxValue!=null&&(L=k.attributes[i.field],(L>=S.minValue&&L=S.minValue)&&s.push([k.attributes[c],R.r,R.g,R.b]))})});const v=a?C1e(s,a):s,w=new kl;return w.functionName="Colormap",w.functionArguments={},w.functionArguments.Colormap=v,w.variableName="Raster",e.convertToRFT?new kl({rasterFunctionDefinition:f3(w)}):w}i.classBreakInfos.forEach((v,w)=>{if(v.minValue==null||v.maxValue==null)return;const S=v.symbol&&v.symbol.color;S?.a?(w===0?t.push(v.minValue,v.maxValue+1e-4):t.push(v.minValue+1e-4,v.maxValue+1e-4),r.push(w),s.push([w,S.r,S.g,S.b])):n.push(v.minValue,v.maxValue)});const h=a?C1e(s,a):s,p=new kl;p.functionName="Remap",p.functionArguments={InputRanges:t,OutputValues:r,NoDataRanges:n},p.variableName="Raster";const m=new kl;return m.functionName="Colormap",m.functionArguments={Colormap:h,Raster:p},e.convertToRFT?new kl({rasterFunctionDefinition:f3(m)}):m}function C1e(i,e){const t=Ylr.has(e)?Yx(e):null;return t&&i.push([Math.floor(t[0]-1),0,0,0],[Math.ceil(t[1]+1),0,0,0]),i}function SRt(i){if(i==null)return;const{fields:e}=i;return e?.find(r=>r?.name&&r.name.toLowerCase()==="value")?.name}function iur(i,e){const t=[],{pixelType:r,rasterAttributeTable:n}=e,s=n==null?null:n.features,o=SRt(n),a=i.defaultSymbol?.color?.toRgb(),l=i.uniqueValueInfos;if(l)if(s){if(o){const h=new Map;l.forEach(m=>{const v=m.value,w=m.symbol?.color;v!=null&&w?.a&&h.set(String(v),w.toRgb())});const p=i.field;s.forEach(({attributes:m})=>{const v=String(m[p]),w=m[o],S=h.get(v);S?t.push([w,...S]):a&&t.push([w,...a])})}}else for(let h=0;h{const r=t;if(Array.isArray(r))e.push(r);else{if(r.min==null||r.max==null)return;const n=[r.min,r.max,r.avg||0,r.stddev||0];e.push(n)}}),e}function sur(i){const e=[],t=[];return i.forEach(r=>{e.push(r[0]),t.push(Har([...r.slice(1),255]))}),{type:"RasterColormap",values:e,colors:t}}var FLe;const Uie=pa()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),kLe=pa()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function our(i){let e;switch(i?i.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":e="esriMosaicAttribute";break;case"lockraster":e="esriMosaicLockRaster";break;case"center":e="esriMosaicCenter";break;case"northwest":e="esriMosaicNorthwest";break;case"nadir":e="esriMosaicNadir";break;case"viewpoint":e="esriMosaicViewpoint";break;case"seamline":e="esriMosaicSeamline";break;default:e="esriMosaicNone"}return kLe.fromJSON(e)}let qf=FLe=class extends Ci{constructor(i){super(i),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(i,e){return e.ascending!=null?e.ascending:e.sortAscending==null||e.sortAscending}get itemRenderingRule(){return ty(di.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(i){ty(di.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",i)}readMethod(i,e){return our(e.mosaicMethod||e.defaultMosaicMethod)}writeMultidimensionalDefinition(i,e,t){i!=null&&(i=i.filter(({variableName:r,dimensionName:n})=>r&&r!=="*"||n)).length&&(e[t]=i.map(r=>r.toJSON()))}readOperation(i,e){const t=e.mosaicOperation,r=e.mosaicOperator?.toLowerCase(),n=t||(r?Uie.toJSON(r):null);return Uie.fromJSON(n)||"first"}castSortValue(i){return i==null||typeof i=="string"||typeof i=="number"?i:`${i}`}clone(){return new FLe({ascending:this.ascending,itemRasterFunction:li(this.itemRasterFunction),lockRasterIds:li(this.lockRasterIds),method:this.method,multidimensionalDefinition:li(this.multidimensionalDefinition),objectIds:li(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:li(this.viewpoint),where:this.where})}};x([D({type:Boolean,json:{write:!0}})],qf.prototype,"ascending",void 0),x([Mi("ascending",["ascending","sortAscending"])],qf.prototype,"readAscending",null),x([D({type:kl,json:{name:"itemRenderingRule",write:!0}})],qf.prototype,"itemRasterFunction",void 0),x([D({type:kl})],qf.prototype,"itemRenderingRule",null),x([D({type:[ms],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],qf.prototype,"lockRasterIds",void 0),x([D({type:String,json:{type:kLe.jsonValues,write:{target:"mosaicMethod",writer:kLe.write}}})],qf.prototype,"method",void 0),x([Mi("method",["mosaicMethod","defaultMosaicMethod"])],qf.prototype,"readMethod",null),x([D({type:[gR],json:{write:!0}})],qf.prototype,"multidimensionalDefinition",void 0),x([ur("multidimensionalDefinition")],qf.prototype,"writeMultidimensionalDefinition",null),x([D({type:[ms],json:{name:"fids",write:!0}})],qf.prototype,"objectIds",void 0),x([D({json:{type:Uie.jsonValues,read:{reader:Uie.read},write:{target:"mosaicOperation",writer:Uie.write}}})],qf.prototype,"operation",void 0),x([Mi("operation",["mosaicOperation","mosaicOperator"])],qf.prototype,"readOperation",null),x([D({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],qf.prototype,"sortField",void 0),x([D({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],qf.prototype,"sortValue",void 0),x([So("sortValue")],qf.prototype,"castSortValue",null),x([D({type:$i,json:{write:!0}})],qf.prototype,"viewpoint",void 0),x([D({type:String,json:{write:!0}})],qf.prototype,"where",void 0),qf=FLe=x([Qe("esri.layers.support.MosaicRule")],qf);const Qw=qf;let Ap=class extends Ci{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(e,t,r){this.layer.version<10.3||(t[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,t,r){this.format&&this.format.toLowerCase().includes("jpg")&&e!=null&&(t[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,t,r){this.format==="lerc"&&e!=null&&(t[r]=e)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(e,t,r){this.format==="lerc"&&this.layer.version>=10.5&&(t[r]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("rasterFunction"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("definitionExpression"),e.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const r=e.definitionExpression;return t?r&&r!==t.where&&(t=t.clone(),t.where=r):r&&(t=new Qw({where:r})),t}get rasterFunction(){const e=this.layer;let{rasterFunction:t}=e;const r=e.pixelFilter,n=!e.format||e.format.includes("jpg")||e.format.includes("png");t=this._addResampleRasterFunction(t);const s=e.multidimensionalSubset?.areaOfInterest;return s&&(t=this._addClipFunction(t,s)),n&&!r&&e.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(e){const t=this.layer,{rasterInfo:r,renderer:n}=t;return e=e||t.rasterFunction,!n||!bRt(n)?e:J3e(Klr(n,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandNames:r.bandInfos.map(({name:s})=>s),convertColorRampToColormap:t.version<10.6,convertToRFT:!!e?.rasterFunctionDefinition,bandCount:r.bandCount}),e)}_addResampleRasterFunction(e){if(this.layer.renderer?.type!=="vector-field"||e?.functionName==="Resample")return e;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,r=this.layer.serviceRasterInfo.pixelSize;let n=new kl({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:r}});return n=e?.rasterFunctionDefinition?new kl({rasterFunctionDefinition:f3(n)}):n,J3e(n,e)}_addClipFunction(e,t){const r=new kl({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return J3e(r,e)}};x([D()],Ap.prototype,"layer",void 0),x([D({json:{write:!0}})],Ap.prototype,"adjustAspectRatio",null),x([ur("adjustAspectRatio")],Ap.prototype,"writeAdjustAspectRatio",null),x([D({json:{write:!0}})],Ap.prototype,"bandIds",null),x([D({json:{write:!0}})],Ap.prototype,"compression",void 0),x([D({json:{write:!0}})],Ap.prototype,"compressionQuality",null),x([ur("compressionQuality")],Ap.prototype,"writeCompressionQuality",null),x([D({json:{write:!0}})],Ap.prototype,"compressionTolerance",null),x([ur("compressionTolerance")],Ap.prototype,"writeCompressionTolerance",null),x([D({json:{write:!0}})],Ap.prototype,"format",null),x([D({type:String,json:{read:{reader:UP.read},write:{writer:UP.write}}})],Ap.prototype,"interpolation",null),x([D({json:{write:!0}})],Ap.prototype,"noData",null),x([D({type:String,json:{read:{reader:Gie.read},write:{writer:Gie.write}}})],Ap.prototype,"noDataInterpretation",null),x([D({json:{write:!0}})],Ap.prototype,"pixelType",void 0),x([D({json:{write:!0}})],Ap.prototype,"lercVersion",void 0),x([ur("lercVersion")],Ap.prototype,"writeLercVersion",null),x([D({type:Number})],Ap.prototype,"version",null),x([D({json:{write:!0}})],Ap.prototype,"mosaicRule",null),x([D({json:{write:!0,name:"renderingRule"}})],Ap.prototype,"rasterFunction",null),Ap=x([Qe("esri.layers.mixins.ExportImageServiceParameters")],Ap);async function E1e(i,e,t){let r;try{r=await createImageBitmap(i)}catch(n){throw new qe("request:server",`Unable to load ${e}`,{url:e,error:n})}return hn(t),r}async function ik(i,e,t,r,n){let s;try{s=await createImageBitmap(i)}catch(o){throw new qe("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:o,level:e,row:t,col:r})}return hn(n),s}var LLe;const aur={base:Nr,key:"type",typeMap:{extent:hr,polygon:$s}};let QN=LLe=class extends Ci{constructor(i){super(i),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:i}=this;if(i==null||i.length===0)return[];const e=new Map;i.forEach(r=>{if(!r.dimensionName)return;let n,s;if(Array.isArray(r.values[0])){const o=r.values;n=o[0][0],s=o[r.values.length-1][1]}else{const o=r.values;n=o[0],s=o[r.values.length-1]}if(e.has(r.dimensionName)){const o=e.get(r.dimensionName);o[0]=Math.min(n,o[0]),o[1]=Math.max(s,o[1])}else e.set(r.dimensionName,[n,s])});const t=[];for(const r of e)t.push({name:r[0],extent:r[1]});return t}get variables(){const{subsetDefinitions:i}=this;if(i==null||i.length===0)return[];const e=new Set;return i.forEach(t=>{t.variableName&&e.add(t.variableName)}),[...e]}clone(){const i=this.subsetDefinitions?.map(t=>t.clone()),e=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new LLe({areaOfInterest:e,subsetDefinitions:i})}};x([D({types:aur,json:{read:Ro,write:!0}})],QN.prototype,"areaOfInterest",void 0),x([D({readOnly:!0})],QN.prototype,"dimensions",null),x([D({readOnly:!0})],QN.prototype,"variables",null),x([D({type:[gR],json:{write:!0}})],QN.prototype,"subsetDefinitions",void 0),QN=LLe=x([Qe("esri.layers.support.MultidimensionalSubset")],QN);const TRt=QN;var NLe;function UL(i){return i=Number(i),isNaN(i)?void 0:i}let UT=NLe=class extends Ci{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new NLe({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};x([D({json:{name:"BandName",write:!0}})],UT.prototype,"name",void 0),x([D({json:{name:"WavelengthMin",read:{reader:UL},write:!0}})],UT.prototype,"minWavelength",void 0),x([D({json:{name:"WavelengthMax",read:{reader:UL},write:!0}})],UT.prototype,"maxWavelength",void 0),x([D({json:{name:"RadianceBias",read:{reader:UL},write:!0}})],UT.prototype,"radianceBias",void 0),x([D({json:{name:"RadianceGain",read:{reader:UL},write:!0}})],UT.prototype,"radianceGain",void 0),x([D({json:{name:"ReflectanceBias",read:{reader:UL},write:!0}})],UT.prototype,"reflectanceBias",void 0),x([D({json:{name:"ReflectanceGain",read:{reader:UL},write:!0}})],UT.prototype,"reflectanceGain",void 0),x([D({json:{name:"SolarIrradiance",read:{reader:UL},write:!0}})],UT.prototype,"solarIrradiance",void 0),UT=NLe=x([Qe("esri.layers.support.RasterBandInfo")],UT);const Rot=UT;var $Le;function BJ(i){return i=Number(i),isNaN(i)?void 0:i}let bw=$Le=class extends Ci{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(i){return new Date(i)}writeAcquisitionDate(i,e){e.AcquisitionDate=i.getTime()}clone(){return new $Le({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};x([D({json:{name:"AcquisitionDate",write:!0}})],bw.prototype,"acquisitionDate",void 0),x([Mi("acquisitionDate")],bw.prototype,"readAcquisitionDate",null),x([ur("acquisitionDate")],bw.prototype,"writeAcquisitionDate",null),x([D({json:{name:"CloudCover",read:{reader:BJ},write:!0}})],bw.prototype,"cloudCover",void 0),x([D({json:{name:"ProductName",write:!0}})],bw.prototype,"productName",void 0),x([D({json:{name:"SensorName",write:!0}})],bw.prototype,"sensorName",void 0),x([D({json:{name:"SensorAzimuth",read:{reader:BJ},write:!0}})],bw.prototype,"sensorAzimuth",void 0),x([D({json:{name:"SensorElevation",read:{reader:BJ},write:!0}})],bw.prototype,"sensorElevation",void 0),x([D({json:{name:"SunAzimuth",read:{reader:BJ},write:!0}})],bw.prototype,"sunAzimuth",void 0),x([D({json:{name:"SunElevation",read:{reader:BJ},write:!0}})],bw.prototype,"sunElevation",void 0),bw=$Le=x([Qe("esri.layers.support.RasterSensorInfo")],bw);const lur=bw;var BLe;let Ty=BLe=class extends Ci{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new BLe({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:li(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:li(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:li(this.tileInfo),transposeInfo:li(this.transposeInfo),blockBoundary:li(this.blockBoundary)})}};x([D({type:Number,json:{write:!0}})],Ty.prototype,"blockWidth",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"blockHeight",void 0),x([D({type:String,json:{write:!0}})],Ty.prototype,"compression",void 0),x([D({type:$i,json:{write:!0}})],Ty.prototype,"origin",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"firstPyramidLevel",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"maximumPyramidLevel",void 0),x([D({json:{write:!0}})],Ty.prototype,"pyramidResolutions",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidScalingFactor",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidBlockWidth",void 0),x([D({type:Number,json:{write:!0}})],Ty.prototype,"pyramidBlockHeight",void 0),x([D({type:Boolean,json:{write:!0}})],Ty.prototype,"isVirtualTileInfo",void 0),x([D({json:{write:!0}})],Ty.prototype,"tileInfo",void 0),x([D()],Ty.prototype,"transposeInfo",void 0),x([D()],Ty.prototype,"blockBoundary",void 0),Ty=BLe=x([Qe("esri.layers.support.RasterStorageInfo")],Ty);const QB=Ty;var jLe;let Sh=jLe=class extends Ci{constructor(i){super(i),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const i=this.keyProperties.BandProperties,{bandCount:e}=this;if(!i?.length||i.lengthRot.fromJSON(r));for(let r=0;rn!=null?n.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(n=>n!=null?n.toJSON():null),primaryRasterIds:e.primaryRasterIds},t);return r?new Br(r):null}async stretch(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON(),stretchParams:e.stretchParams},n=await this._workerThread.invoke("stretch",r,t);return n?new Br(n):null}async split(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON(),tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},n=await this._workerThread.invoke("split",r,t);return n&&n.forEach((s,o)=>{n.set(o,s?Br.fromJSON(s):null)}),n}async clipTile(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={...e,pixelBlock:e.pixelBlock.toJSON()},n=await this._workerThread.invoke("clipTile",r,t);return n?Br.fromJSON(n):null}async estimateStatisticsHistograms(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.pixelBlock)return null;const r={srcPixelBlock:e.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,t)}async mosaicAndTransform(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");if(!e?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...e,srcPixelBlocks:e.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},n=await this._workerThread.invoke("mosaicAndTransform",r,t);return{pixelBlock:n.pixelBlock?new Br(n.pixelBlock):null,localNorthDirections:n.localNorthDirections}}async createFlowMesh(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");const r={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:n,simulationSettings:s}=e,o=await this._workerThread.invoke("createFlowMesh",{meshType:n,flowData:r,simulationSettings:s},{...t,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(e,t){if(!this._workerThread)throw new qe("raster-jobhandler:no-connection","no available worker connection");const r=e.datumTransformation!=null?e.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,n=e.rasterTransform!=null?e.rasterTransform.toJSON():null,s={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:r,rasterTransform:n,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,t)}};function ERt(i,e,t){const r=e.shift();if(t.length===0){const s=[];t.push({sliceId:-1,multidimensionalDefinition:s})}const n=t.length;for(let s=0;s{t.push({sliceId:-1,multidimensionalDefinition:[...o,{variableName:i,dimensionName:r.name,values:[a]}]})})}e.length&&ERt(i,e,t)}function uur(i,e){const t=[];let r=0;return(e?i.variables.filter(n=>n.name.toLowerCase()===e.toLowerCase()):[...i.variables].sort((n,s)=>n.name>s.name?1:-1)).forEach(n=>{const s=[],o=[...n.dimensions].sort((a,l)=>a.name>l.name?-1:1);ERt(n.name,o,s),s.forEach(a=>{t.push({...a,sliceId:r++})})}),t}function cur(i,e,t){let r=i;if(e&&(e=[...e].sort((n,s)=>n.dimensionName{s.length&&(r=r.filter(a=>{const l=a.multidimensionalDefinition.find(c=>c.dimensionName===n);if(l==null)return!1;const u=l.values[0];return typeof u=="number"?typeof s[0]=="number"?s.includes(u):s.some(c=>c[0]<=u&&c[1]>=u):typeof s[0]=="number"?s.some(c=>u[0]<=c&&u[1]>=c):o?s.some(c=>c[0]===u[0]&&c[0]===u[1]):s.some(c=>c[0]>=u[0]&&c[0]<=u[1]||c[1]>=u[0]&&c[1]<=u[1]||c[0]u[1])}))}),r.length&&t?.start!=null&&t.end!=null){const n=t.start.getTime(),s=t.end.getTime(),o=r[0].multidimensionalDefinition.findIndex(a=>a.dimensionName==="StdTime");o>-1&&(r=r.filter(a=>{const l=a.multidimensionalDefinition[o].values[0];return n<=l&&s>=l}))}return r.map(n=>n.sliceId)}function IRt(i,e){return Array.isArray(i)?e[0]===e[1]?i[0]===e[0]||i[1]===e[0]:i[0]>=e[0]&&i[0]<=e[1]&&i[1]>=e[0]&&i[1]<=e[1]:i>=e[0]&&i<=e[1]}function hur(i,e){return i[0]<=e[0]&&i[1]>=e[0]||i[0]<=e[1]&&i[1]>=e[1]||i[0]>=e[0]&&i[1]<=e[1]}function ARt(i){return i.length===1?[i[0],i[0]]:[i[0],i[i.length-1]]}function MRt(i,e,t){if(!e?.subsetDefinitions?.length)return i;let r;if(t){const{variables:o}=e;if(o.length&&!o.includes(t))return null;const a=e.subsetDefinitions.find(l=>l.dimensionName===i.name&&l.variableName===t);if(!a?.values?.length)return i;r=ARt(a.values)}else r=e.dimensions.find(({name:a})=>a===i.name)?.extent;const n=r;if(!n?.length)return i;const s=i.values.filter(o=>IRt(o,n));return{...i,extent:[...n],values:s}}function Wne(i,e,t){if(!e?.subsetDefinitions?.length)return!1;const{variables:r}=e;if(r.length&&i.some(({variableName:n})=>n&&!r.includes(n)))return!0;for(let n=0;n(s.variableName===""||a.variableName===s.variableName)&&a.dimensionName===s.dimensionName);if(o?.values.length){const a=ARt(o.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&t){if(!hur(s.values,a))return!0}else if(s.values.some(l=>!IRt(l,a)))return!0}}return!1}function K3e(i,e){if(i==null)return{isOutside:!1};const{geometry:t,timeExtent:r,multidimensionalDefinition:n}=e;let s=null;if(r!=null&&(s=dur(i,r),s==null))return{isOutside:!0};const{areaOfInterest:o}=i;if(o&&t){const a=t.type==="point"?t:t.type==="extent"?t.center:t.type==="polygon"?t.centroid:null;if(a&&!o.contains(a))return{isOutside:!0}}return n!=null&&n.length&&Wne(n,i,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:t,timeExtent:s,multidimensionalDefinition:n}}}function dur(i,e){const t=i.dimensions.find(({name:o})=>o==="StdTime");if(t==null||e.start==null&&e.end==null)return e;e=e.clone();const{start:r,end:n}=e.toJSON(),s=r===n?[r]:r!=null&&n!=null?[r,n]:[r??n];return s.length===2&&t?.extent.length&&(s[0]=Math.max(s[0],t.extent[0]),s[1]=Math.min(s[1],t.extent[1]??t.extent[0]),s[1]s.variables.includes(c))),l?u.find(({name:c})=>c===l)??u[0]:u[0]}function ULe(i,e={}){const t=GLe(i,e);if(!t)return null;const r=[],{dimensions:n,name:s}=t;if(n.length===0)return[new gR({variableName:s,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(e.values==null)return!0;const t=e.values.length;return t===0||t>1||!e.isSlice&&Array.isArray(e.values[0])})}function PRt(i,e){if(e==null||i==null)return null;let t=e.variables.map(r=>({...r}));return i?.variables?.length&&(t=t.filter(({name:r})=>i.variables.includes(r)),t.forEach(r=>{r.dimensions=r.dimensions.map(n=>MRt(n,i,r.name)).filter(Ga)})),t}function pur(i,e){const{values:t}=e;if(t?.length){const a=Array.isArray(t[0]),l=Array.isArray(i);return a!==l?-1:a&&l?t.findIndex(u=>u[0]===i[0]&&u[1]===i[1]):t.indexOf(i)}const{extent:r}=e;if(Array.isArray(i)||ir[1])return-1;const n=e.interval||1;if(e.unit!=="ISO8601")return Math.round((i-r[0])/n);const s=r[0];let o=-1;switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((i-s)/1e3/n);break;case"minutes":o=Math.round((i-s)/6e4/n);break;case"hours":o=Math.round((i-s)/36e5/n);break;case"days":o=Math.round((i-s)/864e5/n);break;case"months":{const a=new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear(),l=new Date(s).getUTCMonth(),u=new Date(i).getUTCMonth();o=a===0?u-l:u+11-l+12*(a-1)}break;case"years":o=Math.round((new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear())/n);break;case"decades":o=Math.round((new Date(i).getUTCFullYear()-new Date(s).getUTCFullYear())/10/n)}return o}function Dot(i){let e=i.values?.length;if(e)return e;const{extent:t,unit:r}=i,n=i.interval||1,s=t?t[1]-t[0]:0;if(r!=="ISO8601")return Math.round(s/n);switch(i.intervalUnit?.toLowerCase()??"seconds"){case"seconds":e=Math.round(s/1e3/n);break;case"minutes":e=Math.round(s/6e4/n);break;case"hours":e=Math.round(s/36e5/n);break;case"days":e=Math.round(s/864e5/n);break;case"months":{const o=new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear(),a=new Date(t[0]).getUTCMonth(),l=new Date(t[1]).getUTCMonth();e=o===0?l-a+1:l+11-a+12*(o-1)+1}break;case"years":e=Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/n);break;case"decades":e=Math.round((new Date(t[1]).getUTCFullYear()-new Date(t[0]).getUTCFullYear())/10/n);break;default:e=0}return e}function RRt(i,e){let t=0;const r=i[0].variableName,n=[...e.variables].sort((s,o)=>s.name>o.name?1:-1);for(let s=0;sc.name>h.name?-1:1);if(o.name!==r){t+=a.map(c=>Dot(c)).reduce((c,h)=>c*h);continue}const l=a.map(c=>Dot(c)),u=a.length;for(let c=0;cm.dimensionName===a[c].name);if(h==null)return null;const p=pur(h.values[0],a[c]);if(p===-1)return null;l.shift(),t+=c===u-1?p:p*l.reduce((m,v)=>m*v)}break}return t}var Z3e,Fot,kot,DRt={exports:{}};Fot=DRt,Z3e=function(){function i(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return i.prototype={ensureBuffer:function(e){var t=this.buffer,r=t?t.byteLength:0;if(en&&(r=n)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}return this.pos=r,this.buffer.subarray(t,r)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,r){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,r)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},i}(),(kot=function(){if(!self||!self.Uint32Array)return null;var i=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),t=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],n=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(a){throw new Error(a)}function o(a){var l=0,u=a[l++],c=a[l++];u!=-1&&c!=-1||s("Invalid header in flate stream"),(15&u)!=8&&s("Unknown compression method in flate stream"),((u<<8)+c)%31!=0&&s("Bad FCHECK in flate stream"),32&c&&s("FDICT bit set in flate stream"),this.bytes=a,this.bytesPos=l,this.codeSize=0,this.codeBuf=0,Z3e.call(this)}return o.prototype=Object.create(Z3e.prototype),o.prototype.getBits=function(a){for(var l,u=this.codeSize,c=this.codeBuf,h=this.bytes,p=this.bytesPos;u>a,this.codeSize=u-=a,this.bytesPos=p,l},o.prototype.getCode=function(a){for(var l=a[0],u=a[1],c=this.codeSize,h=this.codeBuf,p=this.bytes,m=this.bytesPos;c>16,I=65535&w;return(c==0||c>S,this.codeSize=c-S,this.bytesPos=m,I},o.prototype.generateHuffmanTable=function(a){for(var l=a.length,u=0,c=0;cu&&(u=a[c]);for(var h=1<>=1;for(c=I;c0;)Ie[w++]=Ve}var l=this.getBits(3);if(1&l&&(this.eof=!0),(l>>=1)!=0){var u,c;if(l==1)u=r,c=n;else if(l==2){for(var h=this.getBits(5)+257,p=this.getBits(5)+1,m=this.getBits(4)+4,v=Array(i.length),w=0;w=B&&(B=(ae=this.ensureBuffer($+1)).length),ae[$++]=V;else{if(V==256)return void(this.bufferLength=$);var Y=(V=e[V-=257])>>16;Y>0&&(Y=this.getBits(Y)),I=(65535&V)+Y,V=this.getCode(c),(Y=(V=t[V])>>16)>0&&(Y=this.getBits(Y));var K=(65535&V)+Y;$+I>=B&&(B=(ae=this.ensureBuffer($+I)).length);for(var Q=0;Q{let c=null;o==="jpg"&&a&&(c=FRt._getMask(e,{width:n,height:s}));const h=new Blob([new Uint8Array(e)],{type:"image/"+o=="jpg"?"jpeg":o}),p=URL.createObjectURL(h),m=new Image;let v;m.src=p,m.onload=()=>{if(URL.revokeObjectURL(p),xg(r))return void u(Oc());n=m.width,s=m.height,this._canvas&&this._ctx?(this._canvas.width===n&&this._canvas.height===s||(this._canvas.width=n,this._canvas.height=s),this._ctx.clearRect(0,0,n,s)):(this._canvas=document.createElement("canvas"),this._canvas.width=n,this._canvas.height=s,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const w=this._ctx.getImageData(0,0,n,s);let S;if(v=w.data,t.renderOnCanvas){if(c)for(S=0;S{URL.revokeObjectURL(p),u("cannot load image")}})}static _getMask(e,t){let r=null;try{const n=new Uint8Array(e),s=Math.ceil(n.length/2);let o=0;const a=n.length-2;for(o=s;o=0;h--)r[u++]=l[c]>>h&1}}catch{}return r}};var Lot,Not,$ot,kRt={exports:{}};Lot=kRt,Not=function(){var i=function(){function e(t){this.message="JPEG error: "+t}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,u=2896;function c(){this.decodeTransform=null,this.colorTransform=-1}function h(I,R){for(var L,k,B=0,$=[],V=16;V>0&&!I[V-1];)V--;$.push({children:[],index:0});var Y,K=$[0];for(L=0;L0;)K=$.pop();for(K.index++,$.push(K);$.length<=L;)$.push(Y={children:[],index:0}),K.children[K.index]=Y.children,K=Y;B++}L+10)return pe--,de>>pe&1;if((de=I[R++])===255){var ge=I[R++];if(ge)throw new i("unexpected marker "+(de<<8|ge).toString(16))}return pe=7,de>>>7}function Z(ge){for(var je=ge;;){if(typeof(je=je[H()])=="number")return je;if(typeof je!="object")throw new i("invalid huffman sequence")}}function ae(ge){for(var je=0;ge>0;)je=je<<1|H(),ge--;return je}function fe(ge){if(ge===1)return H()===1?1:-1;var je=ae(ge);return je>=1<>4;if(_t!==0){var Yt=e[ht+=Fe];ge.blockData[je+Yt]=fe(_t),ht++}else{if(Fe<15)break;ht+=16}}}function _e(ge,je){var rt=Z(ge.huffmanTableDC),Me=rt===0?0:fe(rt)<0)Te--;else for(var rt=$,Me=V;rt<=Me;){var ht=Z(ge.huffmanTableAC),Ht=15&ht,_t=ht>>4;if(Ht!==0){var Fe=e[rt+=_t];ge.blockData[je+Fe]=fe(Ht)*(1<>4,(rt=15&Me)==0)_t<15?(Te=ae(_t)+(1<<_t),$e=4):(_t=16,$e=1);else{if(rt!==1)throw new i("invalid ACn encoding");Ve=fe(rt),$e=_t?2:3}continue;case 1:case 2:ge.blockData[je+Fe]?ge.blockData[je+Fe]+=H()<=65488&&ie<=65495))break;R+=2}return(st=S(I,R))&&st.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+st.invalid),R=st.offset),R-ne}function v(I,R,L){var k,B,$,V,Y,K,Q,re,ne,de,pe,H,Z,ae,fe,be,_e,Ie=I.quantizationTable,Te=I.blockData;if(!Ie)throw new i("missing required Quantization Table.");for(var Be=0;Be<64;Be+=8)ne=Te[R+Be],de=Te[R+Be+1],pe=Te[R+Be+2],H=Te[R+Be+3],Z=Te[R+Be+4],ae=Te[R+Be+5],fe=Te[R+Be+6],be=Te[R+Be+7],ne*=Ie[Be],de|pe|H|Z|ae|fe|be?(de*=Ie[Be+1],pe*=Ie[Be+2],H*=Ie[Be+3],Z*=Ie[Be+4],ae*=Ie[Be+5],fe*=Ie[Be+6],be*=Ie[Be+7],B=(k=(k=l*ne+128>>8)+(B=l*Z+128>>8)+1>>1)-B,_e=($=pe)*a+(V=fe)*o+128>>8,$=$*o-V*a+128>>8,Q=(Y=(Y=u*(de-be)+128>>8)+(Q=ae<<4)+1>>1)-Q,K=(re=(re=u*(de+be)+128>>8)+(K=H<<4)+1>>1)-K,V=(k=k+(V=_e)+1>>1)-V,$=(B=B+$+1>>1)-$,_e=Y*s+re*n+2048>>12,Y=Y*n-re*s+2048>>12,re=_e,_e=K*r+Q*t+2048>>12,K=K*t-Q*r+2048>>12,Q=_e,L[Be]=k+re,L[Be+7]=k-re,L[Be+1]=B+Q,L[Be+6]=B-Q,L[Be+2]=$+K,L[Be+5]=$-K,L[Be+3]=V+Y,L[Be+4]=V-Y):(_e=l*ne+512>>10,L[Be]=_e,L[Be+1]=_e,L[Be+2]=_e,L[Be+3]=_e,L[Be+4]=_e,L[Be+5]=_e,L[Be+6]=_e,L[Be+7]=_e);for(var Ve=0;Ve<8;++Ve)ne=L[Ve],(de=L[Ve+8])|(pe=L[Ve+16])|(H=L[Ve+24])|(Z=L[Ve+32])|(ae=L[Ve+40])|(fe=L[Ve+48])|(be=L[Ve+56])?(B=(k=4112+((k=l*ne+2048>>12)+(B=l*Z+2048>>12)+1>>1))-B,_e=($=pe)*a+(V=fe)*o+2048>>12,$=$*o-V*a+2048>>12,V=_e,Q=(Y=(Y=u*(de-be)+2048>>12)+(Q=ae)+1>>1)-Q,K=(re=(re=u*(de+be)+2048>>12)+(K=H)+1>>1)-K,_e=Y*s+re*n+2048>>12,Y=Y*n-re*s+2048>>12,re=_e,_e=K*r+Q*t+2048>>12,K=K*t-Q*r+2048>>12,ne=(ne=(k=k+V+1>>1)+re)<16?0:ne>=4080?255:ne>>4,de=(de=(B=B+$+1>>1)+(Q=_e))<16?0:de>=4080?255:de>>4,pe=(pe=($=B-$)+K)<16?0:pe>=4080?255:pe>>4,H=(H=(V=k-V)+Y)<16?0:H>=4080?255:H>>4,Z=(Z=V-Y)<16?0:Z>=4080?255:Z>>4,ae=(ae=$-K)<16?0:ae>=4080?255:ae>>4,fe=(fe=B-Q)<16?0:fe>=4080?255:fe>>4,be=(be=k-re)<16?0:be>=4080?255:be>>4,Te[R+Ve]=ne,Te[R+Ve+8]=de,Te[R+Ve+16]=pe,Te[R+Ve+24]=H,Te[R+Ve+32]=Z,Te[R+Ve+40]=ae,Te[R+Ve+48]=fe,Te[R+Ve+56]=be):(_e=(_e=l*ne+8192>>14)<-2040?0:_e>=2024?255:_e+2056>>4,Te[R+Ve]=_e,Te[R+Ve+8]=_e,Te[R+Ve+16]=_e,Te[R+Ve+24]=_e,Te[R+Ve+32]=_e,Te[R+Ve+40]=_e,Te[R+Ve+48]=_e,Te[R+Ve+56]=_e)}function w(I,R){for(var L=R.blocksPerLine,k=R.blocksPerColumn,B=new Int16Array(64),$=0;$=B)return null;var V=k(R);if(V>=65472&&V<=65534)return{invalid:null,marker:V,offset:R};for(var Y=k($);!(Y>=65472&&Y<=65534);){if(++$>=B)return null;Y=k($)}return{invalid:V.toString(16),marker:Y,offset:$}}return c.prototype={parse:function(I){function R(){var ge=I[V]<<8|I[V+1];return V+=2,ge}function L(){var ge=R(),je=V+ge-2,rt=S(I,je,V);rt&&rt.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+rt.invalid),je=rt.offset);var Me=I.subarray(V,je);return V+=Me.length,Me}function k(ge){for(var je=Math.ceil(ge.samplesPerLine/8/ge.maxH),rt=Math.ceil(ge.scanLines/8/ge.maxV),Me=0;Me>4){if(be>>4!=1)throw new i("DQT - invalid table spec");for(H=0;H<64;H++)_e[e[H]]=R()}else for(H=0;H<64;H++)_e[e[H]]=I[V++];Q[15&be]=_e}break;case 65472:case 65473:case 65474:if(B)throw new i("Only single frame JPEGs supported");R(),(B={}).extended=de===65473,B.progressive=de===65474,B.precision=I[V++],B.scanLines=R(),B.samplesPerLine=R(),B.components=[],B.componentIds={};var Ie,Te=I[V++],Be=0,Ve=0;for(pe=0;pe>4,tt=15&I[V+1];Be<$e&&(Be=$e),Ve>4?re:ne)[15&ot]=h(vt,Je)}break;case 65501:R(),$=R();break;case 65498:R();var it,Ue=I[V++],ct=[];for(pe=0;pe>4],it.huffmanTableAC=re[15&Ze],ct.push(it)}var ye=I[V++],Ke=I[V++],ke=I[V++],me=m(I,V,B,ct,$,ye,Ke,ke>>4,15&ke);V+=me;break;case 65535:I[V]!==255&&V--;break;default:if(I[V-3]===255&&I[V-2]>=192&&I[V-2]<=254){V-=3;break}throw new i("unknown marker "+de.toString(16))}de=R()}for(this.width=B.samplesPerLine,this.height=B.scanLines,this.jfif=Y,this.eof=V,this.adobe=K,this.components=[],pe=0;pe>8)+Te[re+1];return be},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(I){for(var R,L,k,B=0,$=I.length;B<$;B+=3)R=I[B],L=I[B+1],k=I[B+2],I[B]=R-179.456+1.402*k,I[B+1]=R+135.459-.344*L-.714*k,I[B+2]=R-226.816+1.772*L;return I},_convertYcckToRgb:function(I){for(var R,L,k,B,$=0,V=0,Y=I.length;V4)throw new i("Unsupported color mode");var k=this._getLinearizedBlockData(I,R);if(this.numComponents===1&&L){for(var B=k.length,$=new Uint8ClampedArray(3*B),V=0,Y=0;Y=0;w--)p[I++]=S[m]>>w&1}catch{}if(a===1&&u.length===s*o){const S=new Uint8Array(u.buffer);h=[S,S,S]}else{for(h=[],m=0;m<3;m++)h.push(new Uint8Array(c));for(w=0,v=0;vLan).then(i=>i.l).then(({default:i})=>i({locateFile:e=>Fl(`esri/layers/support/rasterFormats/${e}`)})).then(i=>{yur(i)}),Q3e)}const I1e={getBlobInfo:null,decode:null};function gur(i){return 16+(i>>3<<3)}function bD(i,e,t){t.set(i.slice(e,e+t.length))}function yur(i){const{_malloc:e,_free:t,_lerc_getBlobInfo:r,_lerc_getDataRanges:n,_lerc_decode_4D:s,asm:o}=i;let a;const l=Object.values(o).find(c=>c&&"buffer"in c&&c.buffer===i.HEAPU8.buffer),u=c=>{const h=c.map(w=>gur(w)),p=h.reduce((w,S)=>w+S),m=e(p);a=new Uint8Array(l.buffer);let v=h[0];h[0]=m;for(let w=1;w{const m=new Uint8Array(48),v=new Uint8Array(8*3),[w,S,I]=u([c.length,m.length,v.length]);a.set(c,w),a.set(m,S),a.set(v,I);let R=r(w,c.length,S,I,12,3);if(R)throw t(w),new Error(`lerc-getBlobInfo: error code is ${R}`);a=new Uint8Array(l.buffer),bD(a,S,m),bD(a,I,v);const L=new Uint32Array(m.buffer),k=new Float64Array(v.buffer),[B,$,,V,Y,K,Q,re,ne,de,pe]=L,H={version:B,depthCount:de,width:V,height:Y,validPixelCount:Q,bandCount:K,blobSize:re,maskCount:ne,dataType:$,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:pe};if(pe&&de>1)return t(w),H;if(de===1&&K===1)return t(w),H.statistics.push({minValue:k[0],maxValue:k[1]}),H;const Z=de*K*8,ae=new Uint8Array(Z),fe=new Uint8Array(Z);let be=w,_e=0,Ie=0,Te=!1;if(a.byteLength1){const yt=Be.slice(tt*de,(tt+1)*de),Ct=Ve.slice(tt*de,(tt+1)*de),ot=Math.min.apply(null,yt),vt=Math.max.apply(null,Ct);$e.push({minValue:ot,maxValue:vt,depthStats:{minValues:yt,maxValues:Ct}})}else $e.push({minValue:Be[tt],maxValue:Ve[tt]});return t(be),Te||t(_e),H},I1e.decode=(c,h)=>{const{maskCount:p,depthCount:m,bandCount:v,width:w,height:S,dataType:I,bandCountWithNoData:R}=h,L=NRt[I],k=w*S,B=new Uint8Array(k*v),$=k*m*v*L.size,V=new Uint8Array($),Y=new Uint8Array(v),K=new Uint8Array(8*v),[Q,re,ne,de,pe]=u([c.length,B.length,V.length,Y.length,K.length]);a.set(c,Q),a.set(B,re),a.set(V,ne),a.set(Y,de),a.set(K,pe);const H=s(Q,c.length,p,re,m,w,S,v,I,ne,de,pe);if(H)throw t(Q),new Error(`lerc-decode: error code is ${H}`);a=new Uint8Array(l.buffer),bD(a,ne,V),bD(a,re,B);let Z=null;if(R){bD(a,de,Y),bD(a,pe,K),Z=[];const ae=new Float64Array(K.buffer);for(let fe=0;fe1){B.set(R[0]);for(let Q=1;Q=$;if(m>0&&V)for(let Q=0;Q1?R:null,{pixelType:K}=w;return{width:l,height:u,bandCount:c,pixelType:K,depthCount:h,statistics:v,pixels:I,mask:B,bandMasks:Y,noDataValues:a}}function _ur(i,e,t,r=!0){if(e%4!=0||t%4!=0){const n=new ArrayBuffer(4*Math.ceil(t/4)),s=new Uint8Array(n),o=new Uint8Array(i,e,t);if(r)for(let a=0;a=s)a-=s,p=h>>>32-s,h<<=s;else{p=h>>>32-a,h=n[c++];const I=s-a;a=32-I,p=(p<>>a),h<<=I}if(p===257)break;if(p===256){s=9,o=Bot(),l=o.length,u=[];continue}const S=o[p];if(S==null){if(p>o.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),o[l++]=u.slice(),jot(w,u)}else jot(w,S),u.push(S[0]),u.length>1&&(o[l++]=u.slice()),u=S.slice();if(YG.has(l)&&s++,a===0&&(h=n[c++],a=32),c>m||c===m&&a<=v)break}return new Uint8Array(w)}YG.add(511),YG.add(1023),YG.add(2047),YG.add(4095),YG.add(8191);const Got=(i,e)=>{const t=e.width*e.height,r=e.pixelType;return Math.floor(i.byteLength/(t*jRt(r)))},jRt=i=>{let e=1;switch(i){case Uint8Array:case Int8Array:e=1;break;case Uint16Array:case Int16Array:e=2;break;case Uint32Array:case Int32Array:case Float32Array:e=4;break;case Float64Array:e=8}return e},bur=(i,e)=>{if(8*i.byteLength=0;a--)r[n++]=s>>a&1;for(a=7;n>a&1,a--;return r};let wur=class{static decode(e,t){const r=t.pixelType,n=[],s=t.width*t.height,o=Got(e,t),{bandIds:a,format:l}=t,u=a?.length||Got(e,t),c=e.byteLength-e.byteLength%(s*jRt(r)),h=new r(e,0,s*o);let p,m,v,w,S=null;if(l==="bip")for(p=0;p>4,n<8?n=1:n===15?(n=4,s=(7&s)<<18|(63&i[t++])<<12|(63&i[t++])<<6|63&i[t++]):n===14?(n=3,s=(15&s)<<12|(63&i[t++])<<6|63&i[t++]):(n=2,s=(31&s)<<6|63&i[t++]),(s!==0||e)&&(r+=String.fromCharCode(s));return r}const gHe=(()=>{const i=[];return i[254]="NEWSUBFILETYPE",i[255]="SUBFILETYPE",i[256]="IMAGEWIDTH",i[257]="IMAGELENGTH",i[258]="BITSPERSAMPLE",i[259]="COMPRESSION",i[262]="PHOTOMETRICINTERPRETATION",i[263]="THRESHHOLDING",i[264]="CELLWIDTH",i[265]="CELLLENGTH",i[266]="FILLORDER",i[269]="DOCUMENTNAME",i[270]="IMAGEDESCRIPTION",i[271]="MAKE",i[272]="MODEL",i[273]="STRIPOFFSETS",i[274]="ORIENTATION",i[277]="SAMPLESPERPIXEL",i[278]="ROWSPERSTRIP",i[279]="STRIPBYTECOUNTS",i[280]="MINSAMPLEVALUE",i[281]="MAXSAMPLEVALUE",i[282]="XRESOLUTION",i[283]="YRESOLUTION",i[284]="PLANARCONFIGURATION",i[285]="PAGENAME",i[286]="XPOSITION",i[287]="YPOSITION",i[288]="FREEOFFSETS",i[289]="FREEBYTECOUNTS",i[290]="GRAYRESPONSEUNIT",i[291]="GRAYRESPONSECURVE",i[292]="T4OPTIONS",i[293]="T6OPTIONS",i[296]="RESOLUTIONUNIT",i[297]="PAGENUMBER",i[300]="COLORRESPONSEUNIT",i[301]="TRANSFERFUNCTION",i[305]="SOFTWARE",i[306]="DATETIME",i[315]="ARTIST",i[316]="HOSTCOMPUTER",i[317]="PREDICTOR",i[318]="WHITEPOINT",i[319]="PRIMARYCHROMATICITIES",i[320]="COLORMAP",i[321]="HALFTONEHINTS",i[322]="TILEWIDTH",i[323]="TILELENGTH",i[324]="TILEOFFSETS",i[325]="TILEBYTECOUNTS",i[326]="BADFAXLINES",i[327]="CLEANFAXDATA",i[328]="CONSECUTIVEBADFAXLINES",i[330]="SUBIFD",i[332]="INKSET",i[333]="INKNAMES",i[334]="NUMBEROFINKS",i[336]="DOTRANGE",i[337]="TARGETPRINTER",i[338]="EXTRASAMPLES",i[339]="SAMPLEFORMAT",i[340]="SMINSAMPLEVALUE",i[341]="SMAXSAMPLEVALUE",i[342]="TRANSFERRANGE",i[347]="JPEGTABLES",i[512]="JPEGPROC",i[513]="JPEGIFOFFSET",i[514]="JPEGIFBYTECOUNT",i[515]="JPEGRESTARTINTERVAL",i[517]="JPEGLOSSLESSPREDICTORS",i[518]="JPEGPOINTTRANSFORM",i[519]="JPEGQTABLES",i[520]="JPEGDCTABLES",i[521]="JPEGACTABLES",i[529]="YCBCRCOEFFICIENTS",i[530]="YCBCRSUBSAMPLING",i[531]="YCBCRPOSITIONING",i[532]="REFERENCEBLACKWHITE",i[700]="XMP",i[33550]="GEOPIXELSCALE",i[33922]="GEOTIEPOINTS",i[33432]="COPYRIGHT",i[42112]="GDAL_METADATA",i[42113]="GDAL_NODATA",i[50844]="RPCCOEFFICIENT",i[34264]="GEOTRANSMATRIX",i[34735]="GEOKEYDIRECTORY",i[34736]="GEODOUBLEPARAMS",i[34737]="GEOASCIIPARAMS",i[34665]="EXIFIFD",i[34853]="GPSIFD",i[40965]="INTEROPERABILITYIFD",i})(),xur=(()=>{const i=gHe.slice();return i[36864]="ExifVersion",i[40960]="FlashpixVersion",i[40961]="ColorSpace",i[42240]="Gamma",i[37121]="ComponentsConfiguration",i[37122]="CompressedBitsPerPixel",i[40962]="PixelXDimension",i[40963]="PixelYDimension",i[37500]="MakerNote",i[37510]="UserComment",i[40964]="RelatedSoundFile",i[36867]="DateTimeOriginal",i[36868]="DateTimeDigitized",i[36880]="OffsetTime",i[36881]="OffsetTimeOriginal",i[36882]="OffsetTimeDigitized",i[37520]="SubSecTime",i[37521]="SubSecTimeOriginal",i[37522]="SubSecTimeDigitized",i[37888]="Temperature",i[37889]="Humidity",i[37890]="Pressure",i[37891]="WaterDepth",i[37892]="Acceleration",i[37893]="CameraElevationAngle",i[42016]="ImageUniqueID",i[42032]="CameraOwnerName",i[42033]="BodySerialNumber",i[42034]="LensSpecification",i[42035]="LensMake",i[42036]="LensModel",i[42037]="LensSerialNumber",i[33434]="ExposureTime",i[33437]="FNumber",i[34850]="ExposureProgram",i[34852]="SpectralSensitivity",i[34855]="PhotographicSensitivity",i[34856]="OECF",i[34864]="SensitivityType",i[34865]="StandardOutputSensitivity",i[34866]="RecommendedExposureIndex",i[34867]="ISOSpeed",i[34868]="ISOSpeedLatitudeyyy",i[34869]="ISOSpeedLatitudezzz",i[37377]="ShutterSpeedValue",i[37378]="ApertureValue",i[37379]="BrightnessValue",i[37380]="ExposureBiasValue",i[37381]="MaxApertureValue",i[37382]="SubjectDistance",i[37383]="MeteringMode",i[37384]="LightSource",i[37385]="Flash",i[37386]="FocalLength",i[37396]="SubjectArea",i[41483]="FlashEnergy",i[41484]="SpatialFrequencyResponse",i[41486]="FocalPlaneXResolution",i[41487]="FocalPlaneYResolution",i[41488]="FocalPlaneResolutionUnit",i[41492]="SubjectLocation",i[41493]="ExposureIndex",i[41495]="SensingMethod",i[41728]="FileSource",i[41729]="SceneType",i[41730]="CFAPattern",i[41985]="CustomRendered",i[41986]="ExposureMode",i[41987]="WhiteBalance",i[41988]="DigitalZoomRatio",i[41989]="FocalLengthIn35mmFilm",i[41990]="SceneCaptureType",i[41991]="GainControl",i[41992]="Contrast",i[41993]="Saturation",i[41994]="Sharpness",i[41995]="DeviceSettingDescription",i[41996]="SubjectDistanceRange",i})(),Sur=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],Tur=(()=>{const i=[];return i[1024]="GTModelTypeGeoKey",i[1025]="GTRasterTypeGeoKey",i[1026]="GTCitationGeoKey",i[2048]="GeographicTypeGeoKey",i[2049]="GeogCitationGeoKey",i[2050]="GeogGeodeticDatumGeoKey",i[2051]="GeogPrimeMeridianGeoKey",i[2052]="GeogLinearUnitsGeoKey",i[2053]="GeogLinearUnitSizeGeoKey",i[2054]="GeogAngularUnitsGeoKey",i[2055]="GeogAngularUnitSizeGeoKey",i[2056]="GeogEllipsoidGeoKey",i[2057]="GeogSemiMajorAxisGeoKey",i[2058]="GeogSemiMinorAxisGeoKey",i[2059]="GeogInvFlatteningGeoKey",i[2061]="GeogPrimeMeridianLongGeoKey",i[2060]="GeogAzimuthUnitsGeoKey",i[3072]="ProjectedCSTypeGeoKey",i[3073]="PCSCitationGeoKey",i[3074]="ProjectionGeoKey",i[3075]="ProjCoordTransGeoKey",i[3076]="ProjLinearUnitsGeoKey",i[3077]="ProjLinearUnitSizeGeoKey",i[3078]="ProjStdParallel1GeoKey",i[3079]="ProjStdParallel2GeoKey",i[3080]="ProjNatOriginLongGeoKey",i[3081]="ProjNatOriginLatGeoKey",i[3082]="ProjFalseEastingGeoKey",i[3083]="ProjFalseNorthingGeoKey",i[3084]="ProjFalseOriginLongGeoKey",i[3085]="ProjFalseOriginLatGeoKey",i[3086]="ProjFalseOriginEastingGeoKey",i[3087]="ProjFalseOriginNorthingGeoKey",i[3088]="ProjCenterLongGeoKey",i[3090]="ProjCenterEastingGeoKey",i[3091]="ProjCenterNorthingGeoKey",i[3092]="ProjScaleAtNatOriginGeoKey",i[3093]="ProjScaleAtCenterGeoKey",i[3094]="ProjAzimuthAngleGeoKey",i[3095]="ProjStraightVertPoleLongGeoKey",i[4096]="VerticalCSTypeGeoKey",i[4097]="VerticalCitationGeoKey",i[4098]="VerticalDatumGeoKey",i[4099]="VerticalUnitsGeoKey",i})(),Cur=(i,e)=>{let t=(e||gHe)[i];return t===void 0&&(t="unknown"+String(i)),t},VLe=new Map;VLe.set("EXIFIFD",xur),VLe.set("GPSIFD",Sur);const AA={tiffTags:gHe,ifdTags:VLe,geoKeys:Tur,getTagName:Cur},tSe=(()=>{const i=new ArrayBuffer(4),e=new Uint8Array(i);return new Uint32Array(i)[0]=1,e[0]===1})(),Uot=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],MW=4294967296,Eur=new Set([1,5,6,7,8,34712,34887]);function yHe(i,e){let t="unknown";return i===3?t=e===64?"f64":"f32":i===1?e===1?t="u1":e===2?t="u2":e===4?t="u4":e<=8?t="u8":e<=16?t="u16":e<=32&&(t="u32"):i===2&&(e<=8?t="s8":e<=16?t="s16":e<=32&&(t="s32")),t}function iSe(i){let e=null;switch(i?i.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f64":e=Float64Array;break;default:e=Float32Array}return e}function Iur(i,e){return{x:e[0]*i.x+e[1]*i.y+e[2],y:e[3]*i.x+e[4]*i.y+e[5]}}function GRt(i,e){return i.get(e)?.values}function e9(i,e){return i.get(e)?.values}function zot(i,e){return i.get(e)?.values?.[0]}function $a(i,e){return i.get(e)?.values?.[0]}function eMe(i,e,t,r=0,n=AA.tiffTags,s=4){const o=s===8,a=o?bHe(new DataView(i,t,8),0,e):new DataView(i,t,2).getUint16(0,e),l=4+2*s,u=o?8:2,c=u+a*l;if(t+c>i.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:c};const h=t+c+4<=i.byteLength?Vme(new DataView(i,t+c,s===8?8:4),0,e,s===8):null,p=t+u,m=new Map;let v,w,S,I,R,L=0,k=0;for(let B=0;BBRt(i,{inputOffset:e}).pixels[0];function HLe(i,e){if(e!==1&&e!==2&&e!==4)return i;const t=new Uint8Array(i),r=8/e,n=new Uint8Array(i.byteLength*r);let s=0;const o=2**e-1;for(let a=0;a>>8-e&o}return n.buffer}function WLe(i,e,t){const r=new LRt;r.parse(i),r.colorTransform=t===6?-1:0;const n=r.getData(r.width,r.height,e!==1&&e!==4);return new Uint8Array(n.buffer)}function qLe(i){const e=new Pae(i).getBytes(),t=new ArrayBuffer(e.length),r=new Uint8Array(t);return r.set(e),r}async function YLe(i,e,t,r,n){const s=tSe===e,o=$a(t,"BITSPERSAMPLE"),a=$a(t,"SAMPLESPERPIXEL")??1,l=$a(t,"PHOTOMETRICINTERPRETATION"),u=$a(t,"SAMPLEFORMAT")??1,c=yHe(u,o),h=$a(t,"COMPRESSION")??1,p=iSe(c);let m,v,w;if(h===34887)return await $Rt(),Aur(i,r);if(h===1)m=i.slice(r,r+n),v=new Uint8Array(m);else if(h===8||h===32946)v=new Uint8Array(i,r,n),v=qLe(v),m=v.buffer;else if(h===6)v=new Uint8Array(i,r,n),v=WLe(v,a,l),m=v.buffer;else if(h===7){const L=t.get("JPEGTABLES").values,k=L.length-2;v=new Uint8Array(k+n-2);for(let $=0;$1&&(h===5||h===8||h===32946)&&I&&R){const L=Rae(t),k=new p(w.length);k.set(w),w=kur(k,R,I,u===3&&S===3,L?1:a)}return w}async function Mur(i,e,t){const r=e9(t,"TILEOFFSETS");if(r===void 0)return null;const n=e9(t,"TILEBYTECOUNTS"),{width:s,height:o,pixelType:a,tileWidth:l,tileHeight:u}=rSe([t]),c=Rae(t,e),h=$a(t,"SAMPLESPERPIXEL")||e.planes,p=s*o,m=$a(t,"BITSPERSAMPLE"),v=($a(t,"COMPRESSION")??1)===34887,w=iSe(a),S=[];for(let ae=0;ae1){const ae=Math.round(r.length/h);for(I=0;I{const r=tSe===e.littleEndian,n=e9(t,"STRIPOFFSETS");if(n===void 0)return null;const{width:s,height:o,pixelType:a}=rSe([t]),l=$a(t,"SAMPLESPERPIXEL")||e.planes,u=$a(t,"PHOTOMETRICINTERPRETATION"),c=s*o,h=$a(t,"BITSPERSAMPLE"),p=iSe(a),m=new p(c*l),v=e9(t,"STRIPBYTECOUNTS"),w=$a(t,"ROWSPERSTRIP"),S=$a(t,"COMPRESSION")??1;let I,R,L,k,B,$,V,Y,K,Q=w;if(h%8==0)for(I=0;Io?o-I*w:w,a==="u8"||a==="s8"||r)S===8||S===32946?(V=new Uint8Array(i,n[I],v[I]),V=qLe(V),$=V.buffer):S===6?(V=new Uint8Array(i,n[I],v[I]),V=WLe(V,l,u),$=V.buffer):S===5?(V=mHe(i,n[I],v[I],e.littleEndian),$=V.buffer):(v[I]!==Q*s*l*h/8&&console.log("strip byte counts is different than expected"),$=i.slice(n[I],n[I]+v[I])),$=HLe($,h),k=new p($);else{switch(S===6||S===8||S===32946?(V=new Uint8Array(i,n[I],v[I]),Y=qLe(V),$=Y.buffer):(v[I]!==Q*s*l*h/8&&console.log("strip byte counts is different than expected"),$=new ArrayBuffer(v[I]),V=new Uint8Array(i,n[I],v[I]),Y=new Uint8Array($)),a){case"u16":case"s16":for(L=0;L{if(!(i&&i.length>0&&e&&t))return null;let r,n,s;const o=i[0].length,a=i.length,l=new Uint8Array(o);for(let u=0;us?0:1;else for(let c=0;cs?0:1);return l},Rur=i=>{if(!i)return null;const e=i.match(//gi);if(!e||e.length===0)return null;const t=new Map;let r,n,s,o,a;for(let I=0;I")),o=r.indexOf("sample="),o>-1&&(a=r.slice(o+8,r.indexOf('"',o+8))),o=r.indexOf("name="),o>-1&&(n=r.slice(o+6,r.indexOf('"',o+6))),n&&(s=r.slice(r.indexOf(">")+1,r.indexOf("")).trim(),a!=null?t.has(n)?t.get(n)[a]=s:t.set(n,[s]):t.set(n,s)),a=null;const l=t.get("STATISTICS_MINIMUM"),u=t.get("STATISTICS_MAXIMUM"),c=t.get("STATISTICS_MEAN"),h=t.get("STATISTICS_STDDEV");let p=null;if(l&&u){p=[];for(let I=0;IS&&p>(n?i.byteLength:i?i.byteLength-l+r:0))return t.offlineOffsetSize=[l,p],t.values=null,!1;if(m<=S){if(!e)if(S<=32)l>>>=32-m;else{const R=I?.length?I[0]:l>>>0,L=I?.length?I[1]:Math.round((l-R)/MW);m<=32?(l=R>>>32-m,I[0]=l):(l=R*2**(32-m)+(L>>>32-m),I[0]=R,I[1]=L>>>32-m)}if(a===1&&h===S)u=[l];else if(S===64){const R=I?.length?I[0]:l>>>0,L=I?.length?I[1]:Math.round((l-R)/MW);let k=R,B=32;for(w=1;w<=a;w++){const $=32-h*w%32;if(B>>32-B,Y=L<<32-B>>>32-B;k=L,u.push(V+Y*2**(h-B)),B-=32-(h-B)}else u.push(k<<$>>>32-h),B-=h;B===0&&(B=32,k=L)}}else for(w=1;w<=a;w++){const R=32-h*w;u.push(l<>>32-h)}}else{l-=r,n&&(l=0);for(let R=l;RparseFloat(be)),p.some(be=>isNaN(be))&&(p=null));const m=$a(e,"COMPRESSION")??1;let v;switch(m){case 1:v="NONE";break;case 2:case 3:case 4:case 32771:v="CCITT";break;case 5:v="LZW";break;case 6:case 7:v="JPEG";break;case 32773:v="PACKBITS";break;case 8:case 32946:v="DEFLATE";break;case 34712:v="JPEG2000";break;case 34887:v="LERC";break;default:v=String(m)}let w=!0,S="";Eur.has(m)||(w=!1,S+="unsupported tag compression "+m),l>3&&(w=!1,S+="unsupported tag sampleFormat "+l),o!==1&&o!==2&&o!==4&&o%8!=0&&(w=!1,S+="unsupported tag bitsPerSample "+o);const I=zot(e,"GEOASCIIPARAMS");let R;if(I){const be=I.split("|").find(Ie=>Ie.includes("ESRI PE String = ")),_e=be?be.replace("ESRI PE String = ",""):"";R=_e.startsWith("COMPD_CS")||_e.startsWith("PROJCS")||_e.startsWith("GEOGCS")?{wkid:null,wkt:_e}:null}const L=e9(e,"GEOTIEPOINTS"),k=e9(e,"GEOPIXELSCALE"),B=e9(e,"GEOTRANSMATRIX"),$=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let V,Y,K=!1,Q=!1;if($){K=$a($,"GTRasterTypeGeoKey")===2;const be=$a($,"GTModelTypeGeoKey");if(be===2){const _e=$a($,"GeographicTypeGeoKey");_e>=1024&&_e<=32766&&(R={wkid:_e}),R||_e!==32767||(Q=!0,R={wkid:4326})}else if(be===1){const _e=$a($,"ProjectedCSTypeGeoKey");_e>=1024&&_e<=32766&&(R={wkid:_e})}}if(k&&L&&L.length>=6?(V=[k[0],0,L[3]-L[0]*k[0],0,-Math.abs(k[1]),L[4]-L[1]*k[1]],K&&(V[2]-=.5*V[0]+.5*V[1],V[5]-=.5*V[3]+.5*V[4])):B&&B.length===16&&(V=K?[B[0],B[1],B[3]-.5*B[0],B[4],B[5],B[7]-.5*B[5]]:[B[0],B[1],B[3],B[4],B[5],B[7]]),V){const be=[{x:0,y:s},{x:0,y:0},{x:n,y:s},{x:n,y:0}];let _e,Ie=Number.POSITIVE_INFINITY,Te=Number.POSITIVE_INFINITY,Be=Number.NEGATIVE_INFINITY,Ve=Number.NEGATIVE_INFINITY;for(let $e=0;$eIe?Ie:_e.x,Be=_e.xTe?Te:_e.y,Ve=_e.y400||Math.max(Math.abs(Y.xmin),Math.abs(Y.xmax))>361)&&(R=null,Y.spatialReference=null);const re=vHe(i);let ne,de,pe,H,Z;if(re.length>0){pe=Math.round(Math.log(n/$a(re[0],"IMAGEWIDTH"))/Math.LN2);const be=re[re.length-1];H=Math.round(Math.log(n/$a(be,"IMAGEWIDTH"))/Math.LN2),ne=$a(be,"TILEWIDTH"),de=$a(be,"TILELENGTH")}ne=H!=null&&H>0?ne||t:null,de=H!=null&&H>0?de||r:null,t&&(Z=[{maxCol:Math.ceil(n/t)-1,maxRow:Math.ceil(s/r)-1,minRow:0,minCol:0}],re.forEach(be=>{Z.push({maxCol:Math.ceil($a(be,"IMAGEWIDTH")/$a(be,"TILEWIDTH"))-1,maxRow:Math.ceil($a(be,"IMAGELENGTH")/$a(be,"TILELENGTH"))-1,minRow:0,minCol:0})}));const ae=zot(i[0],"GDAL_METADATA"),fe=Rur(ae);return S+=" "+HRt({width:n,height:s,tileWidth:t,tileHeight:r,planes:a,ifds:i}),{width:n,height:s,tileWidth:t,tileHeight:r,planes:a,isBSQ:c,pixelType:u,compression:v,noData:p,hasMaskBand:_He(i).length===re.length+1,isSupported:w,message:S,extent:Y,isPseudoGeographic:Q,affine:k?null:V,firstPyramidLevel:pe,maximumPyramidLevel:H,pyramidBlockWidth:ne,pyramidBlockHeight:de,tileBoundary:Z,metadata:fe}}function Rae(i,e){const t=GRt(i,"PLANARCONFIGURATION");return t?t[0]===2:!!e&&e.isBSQ}function vHe(i){return i.filter(e=>$a(e,"NEWSUBFILETYPE")===1)}function _He(i){return i.filter(e=>{const t=(4&($a(e,"NEWSUBFILETYPE")??0))==4,r=$a(e,"PHOTOMETRICINTERPRETATION")===4;return t&&r})}function Dur(i){const{littleEndian:e,isBigTiff:t,firstIFDPos:r}=zRt(i);let n=r;const s=[];do{const o=VRt(i,e,n,0,AA.tiffTags,t?8:4);if(!o.success)break;s.push(o.ifd),n=o.nextIFD}while(n>0);return{...rSe(s),littleEndian:e,isBigTiff:t,ifds:s,pyramidIFDs:vHe(s),maskIFDs:_He(s)}}function bHe(i,e,t){const r=i.getUint32(e,t),n=i.getUint32(e+4,t);return t?n*MW+r:r*MW+n}function Fur(i,e,t){let r=t?i.getInt32(e,t):i.getUint32(e,t),n=t?i.getUint32(e+4,t):i.getInt32(e+4,t);const s=(t?r:n)>=0?1:-1;return t?r*=s:n*=s,s*(t?n*MW+r:r*MW+n)}function Vme(i,e,t,r){return r?bHe(i,e,t):i.getUint32(e,t)}function zRt(i){const e=new DataView(i,0,16),t=e.getUint16(0,!1);let r=null;if(t===18761)r=!0;else{if(t!==19789)throw new Error("unexpected endianess byte");r=!1}const n=e.getUint16(2,r);if(n!==42&&n!==43)throw new Error("unexpected tiff identifier");let s=4;const o=n===43;if(o){const a=e.getUint16(s,r);if(s+=2,a!==8)throw new Error("unsupported bigtiff version");if(e.getUint16(s,r)!==0)throw new Error("unsupported bigtiff version");s+=2}return{littleEndian:r,isBigTiff:o,firstIFDPos:Vme(e,s,r,o)}}function VRt(i,e,t,r=0,n=AA.tiffTags,s=4){const o=eMe(i,e,t,r,n,s);let a;const l=o.ifd;if(l){if(AA.ifdTags.forEach((u,c)=>{l.has(c)&&(a=l.get(c),a.data=eMe(i,e,a.valueOffset-r,r,u).ifd)}),l.has("GEOKEYDIRECTORY")){a=l.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const c=u[0]+"."+u[1]+"."+u[2];a.data=eMe(i,e,a.valueOffset+6-r,r,AA.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[c]})}}if(l.has("XMP")){a=l.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[zLe(new Uint8Array(u))])}}return o}function HRt(i){const{width:e,height:t,tileHeight:r,tileWidth:n}=i,s=i.planes,o=n?n*r:e*t,a=$a(i.ifds[0],"BITSPERSAMPLE");let l="";return o*s>2**30/(a>8?a/8:1)&&(l=n?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),l}function kur(i,e,t,r,n){const s=r?4:1,o=t*s*n;r&&(i=new Uint8Array(i.buffer));for(let u=0;uK.min):null,V=B?B.map(K=>K.max):null,Y={pixelType:u,width:p,height:m,pixels:I,noDataValue:k};return k!=null?Z2e(Y,k):$&&V&&e.applyMinMaxConstraint&&(Y.mask=Pur(I,$,V)),Y}async function Nur(i,e={}){const t=e.pyramidLevel||0,r=e.headerInfo||Dur(i),{ifds:n,noData:s}=r;if(n.length===0)throw new Error("no valid image file directory");const o=HRt(r);if(o)throw o;let a=null;const l=t===-1?n[n.length-1]:n[t],u=s??e.noDataValue;return a=r.tileWidth?await Mur(i,r,l):Our(i,r,l),a&&(u!=null&&Z2e(a,u),a)}var $ur=function(i){var e,t,r,n,s,o;function a(l){var u,c,h,p,m,v,w,S,I,R,L,k,B;for(this.data=l,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var $,V;for(V=[],$=0;$<4;++$)V.push(String.fromCharCode(this.data[this.pos++]));return V}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},p=this.readUInt16(),h=this.readUInt16()||100,m.delay=1e3*p/h,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),l=m?.data||this.imgData,L=0;0<=u?Lu;0<=u?++L:--L)l.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(I=255-this.transparency.indexed.length)>0)for(k=0;0<=I?kI;0<=I?++k:--k)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":v=(R=this.read(u)).indexOf(0),w=String.fromCharCode.apply(String,R.slice(0,v)),this.text[w]=String.fromCharCode.apply(String,R.slice(v+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(B=this.colorType)===4||B===6,c=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*c,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(l,u,c){var h;return typeof u=="function"&&(c=u),(h=new XMLHttpRequest).open("GET",l,!0),h.responseType="arraybuffer",h.onload=function(){var p;return p=new a(new Uint8Array(h.response||h.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&p.render(u),typeof c=="function"?c(p):void 0},h.send(null)},t=1,r=2,e=0,a.prototype.read=function(l){var u,c;for(c=[],u=0;0<=l?ul;0<=l?++u:--u)c.push(this.data[this.pos++]);return c},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(l){var u,c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y,K,Q,re,ne,de,pe,H;if(l==null&&(l=this.imgData),l.length===0)return new Uint8Array(0);for(l=(l=new Pae(l)).getBytes(),Y=(k=this.pixelBitlength/8)*this.width,B=new Uint8Array(Y*this.height),v=l.length,V=0,$=0,c=0;$1&&c/pHur(t,r,i);break;case"tiff":e=Gur;break;case"deflate":e=zur;break;case"lzw":e=Vur;break;case"error":e=()=>{throw new qe("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new qe("rasterCodec:decode","unsupported raster format")}}return e}function Jur(i){let e=null,t=null;switch(i?i.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=255,e=Uint8Array;break;case"u16":t=t||65535,e=Uint16Array;break;case"u32":t=t||2**32-1,e=Uint32Array;break;case"s8":t=t||-128,e=Int8Array;break;case"s16":t=t||-32768,e=Int16Array;break;case"s32":t=t||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:t}}function Kur(i,e=1){if(!i)return;const{pixels:t,width:r,height:n,mask:s}=i;if(!t||t.length===0)return;const o=t.length,a=r-1,l=n-1,u=[];let c,h,p,m,v,w,S=null;const I=Br.getPixelArrayConstructor(i.pixelType);if(e===0){for(c=0;c1){const a=o.map((c,h)=>n(i.slice(c,o[h+1]),e)),l=await Promise.all(a);s=l[0],s.pixels=l.map(c=>c.pixels[0]);const u=l.map(c=>c.mask);l.some(c=>c!=null)&&(u.forEach((c,h)=>{c==null&&(u[h]=new Uint8Array(s.width*s.height).fill(255))}),s.bandMasks=u,s.mask=Br.combineBandMasks(u)),s.updateStatistics()}else s=await n(i,{...e,offset:o?.[0]??e.offset});return r!=="jpg"&&e.noDataValue!=null&&s.depthCount===1&&Z2e(s,e.noDataValue,{customFloatTolerance:e.tolerance}),e.isPoint&&Kur(s),s}function Zur(i){return["u8","s8"].includes(i.pixelType)&&i.statistics?.[0]?.min!=null&&i.statistics[0]?.max!=null&&i.bandCount===1}function wHe(i,e){const{attributeTable:t,bandCount:r}=i;return t==null&&Zur(i)?!0:!(t==null||r>1||e&&t.fields.find(n=>n.name.toLowerCase()===e.toLowerCase())==null)}function XRt(i){const{bandCount:e,dataType:t,pixelType:r}=i;return t==="elevation"||t==="generic"&&e===1&&(r==="s16"||r==="s32"||r==="f32"||r==="f64")}function xHe(i,e=!1){const{bandCount:t,colormap:r,pixelType:n}=i;return t===1&&(!!r?.length||!e&&n==="u8")}function Qur(i,e=!1){const{attributeTable:t,bandCount:r}=i;return r===1&&(!e||t!=null||i.histograms!=null)}function SHe(i){const{dataType:e}=i;return e==="vector-uv"||e==="vector-magdir"}function ecr(i){const{dataType:e}=i;return e==="vector-uv"||e==="vector-magdir"}const Vot=new Rs({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),Hot=new Rs({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let zT=class extends Ci{constructor(e){super(e),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(e){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",e)}set definedInterval(e){this.classificationMethod==="defined-interval"&&this._set("definedInterval",e)}};x([Wr({classBreaksDef:"class-breaks-definition"})],zT.prototype,"type",void 0),x([D({json:{write:!0}})],zT.prototype,"breakCount",void 0),x([D({json:{write:!0}})],zT.prototype,"classificationField",void 0),x([D({type:String,json:{read:Vot.read,write:Vot.write}})],zT.prototype,"classificationMethod",void 0),x([D({json:{write:!0}})],zT.prototype,"normalizationField",void 0),x([D({json:{read:Hot.read,write:Hot.write}})],zT.prototype,"normalizationType",void 0),x([D({value:null,json:{write:!0}})],zT.prototype,"standardDeviationInterval",null),x([D({value:null,json:{write:!0}})],zT.prototype,"definedInterval",null),zT=x([Qe("esri.rest.support.ClassBreaksDefinition")],zT);const tcr=zT,icr=()=>di.getLogger("esri.rest.support.generateRendererUtils");function dj(i,e){return Number(i.toFixed(e))}function rcr(i){const{normalizationTotal:e}=i;return{classBreaks:ncr(i),normalizationTotal:e}}function ncr(i){const e=i.definition,{classificationMethod:t,normalizationType:r,definedInterval:n}=e,s=e.breakCount??1,o=[];let a=i.values;if(a.length===0)return[];a=a.sort((c,h)=>c-h);const l=a[0],u=a[a.length-1];if(t==="equal-interval")if(a.length>=s){const c=(u-l)/s;let h=l;for(let p=1;p{o.push({minValue:c,maxValue:c,label:E_(c,c,r)})});else if(t==="natural-breaks"){const c=scr(a),h=i.valueFrequency||c.valueFrequency,p=ocr(c.uniqueValues,h,s);let m=l;for(let v=1;vv){const w=dj(c.uniqueValues[p[v]],6);o.push({minValue:m,maxValue:w,label:E_(m,w,r)}),m=w}o.push({minValue:m,maxValue:u,label:E_(m,u,r)})}else if(t==="quantile")if(a.length>=s&&l!==u){let c=l,h=Math.ceil(a.length/s),p=0;for(let m=1;ma.length&&(v=a.length-1),v<0&&(v=0),o.push({minValue:c,maxValue:a[v],label:E_(c,a[v],r)}),c=a[v],p+=h,h=Math.ceil((a.length-p)/(s-m))}o.push({minValue:c,maxValue:u,label:E_(c,u,r)})}else{let c=-1;for(let h=0;h=1;S--){const I=dj(c-(S-.5)*p,6);o.push({minValue:v,maxValue:I,label:E_(v,I,r)}),v=I,m++}let w=dj(c+.5*p,6);o.push({minValue:v,maxValue:w,label:E_(v,w,r)}),v=w,m++;for(let S=1;S<=s;S++)w=m===2*s?u:dj(c+(S+.5)*p,6),o.push({minValue:v,maxValue:w,label:E_(v,w,r)}),v=w,m++}}else if(t==="defined-interval"){if(!n)return o;const c=a[0],h=a[a.length-1],p=Math.ceil((h-c)/n);let m=c;for(let v=1;vr&&(t=r);for(let o=0;o0&&v!==i[m+1]&&Math.abs(c-l[m])>Math.abs(c-l[m-1]))i[m]=v;else if(mMath.abs(c-l[m+1])){i[m+1]=v-1;break}h=a,a=0,s=[],o=[];for(let m=0;mh){for(let m=0;m0;p--)for(;t[p]!==t[p-1]+1;){t[p]=t[p]-1;const m=Bz(p-1,t,r,n);l=m.sbMean,o=m.sbSdcm;const v=Bz(p,t,r,n);if(u=v.sbMean,a=v.sbSdcm,!(o+a=1?1:s>=.5?.5:.25,s}function ucr(i){let e=0;for(let t=0;tn===t?.toLowerCase());return e==="Map"?r??"bilinear":i.dataType==="standard-time"?r??"nearest":i.dataType==="thematic"||i.attributeTable||i.colormap?r==="nearest"||r==="majority"?r:"nearest":r??"bilinear"}function mcr(i,e){i=JLe(i,e?.variableName);const{bandCount:t}=i;let{bandIds:r,stretchType:n}=e||{};r?.some(h=>h>=t)&&(r=null);let s=i.statistics,o=i.histograms;t>1?(r=r?.length?r:THe(i),s=s==null?null:r?.map(h=>s[h]),o=o==null?null:r?.map(h=>o[h])):r=[0],n==null&&(n=ycr(i));let a=!1;switch(n){case"none":a=!1;break;case"percent-clip":a=!o?.length;break;default:a=!s?.length}const{dataType:l}=i,u=r?.length===1&&JRt.has(l)?dcr:null,c=new lHe({stretchType:n,dynamicRangeAdjustment:a,colorRamp:u,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return n==="percent-clip"?c.maxPercent=c.minPercent=hcr:n==="standard-deviation"&&(c.numberOfStandardDeviations=2),a||i.multidimensionalInfo==null&&!e?.includeStatisticsInStretch||(n==="percent-clip"?c.histograms=o:n!=="min-max"&&n!=="standard-deviation"||(c.statistics=s)),c}function JLe(i,e){const{multidimensionalInfo:t}=i;if(!e||!t)return i;const r=t.variables.find(n=>n.name===e);if(!r)return i;if(i=i.clone(),r){const{statistics:n,histograms:s}=r;n?.length&&(i.statistics=n.map(o=>({min:o.min,max:o.max,avg:o.avg,stddev:o.stddev}))),s?.length&&(i.histograms=s)}return i}function THe(i){const e=i.bandCount;if(e===1)return null;if(e===2)return[0];const{bandInfos:t}=i;let r;if(t.length===e){const{red:n,green:s,blue:o,nir:a}=gcr(t);n!=null&&s!=null&&o!=null?r=[n,s,o]:a!=null&&n!=null&&s!=null&&(r=[a,n,s])}return!r&&e>=3&&(r=[0,1,2]),r}function gcr(i){const e={};for(let t=0;t=410&&s<=480&&o>=480&&o<=540?e.blue=t:e.green==null&&s>=490&&s<=560&&o>=560&&o<=610?e.green=t:e.red==null&&s>=595&&s<=670&&o>=660&&o<=730?e.red=t:e.nir==null&&s>=700&&s<=860&&o>=800&&o<=950&&(e.nir=t)}}return e}function ycr(i){let e="percent-clip";const{pixelType:t,dataType:r,histograms:n,statistics:s,multidimensionalInfo:o}=i,a=JRt.has(r)||r==="generic"&&o!=null;return t!=="u8"||r!=="processed"&&n!=null&&s!=null?t==="u8"||r==="elevation"||a?e="min-max":n!=null?e="percent-clip":s!=null&&(e="min-max"):e="none",e}function vcr(i,e,t,r){if(!wHe(i,e))return null;const{attributeTable:n,statistics:s}=i,o=KRt(n,e),a=zie(n,"red"),l=zie(n,"green"),u=zie(n,"blue"),c=new vae,h=[],p=new Set,m=!!(a&&l&&u);if(n!=null)n.features.forEach(v=>{const w=v.attributes[o.name];if(!p.has(v.attributes[o.name])&&w!=null){p.add(w);const S=m&&(a.type==="single"||a.type==="double")&&(l.type==="single"||l.type==="double")&&(u.type==="single"||u.type==="double")&&!n.features.some(R=>R.attributes[a.name]>1||R.attributes[l.name]>1||R.attributes[u.name]>1),I=S?255:1;h.push(new J8({value:v.attributes[o.name],label:v.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new jr(m?[v.attributes[a.name]*I,v.attributes[l.name]*I,v.attributes[u.name]*I,1]:[0,0,0,0])}}))}});else if(s?.[0])for(let v=s[0].min;v<=s[0].max;v++)h.push(new J8({value:v,label:v.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new jr([0,0,0,0])}}));if(h.sort((v,w)=>v.value&&typeof v.value.valueOf()=="string"?0:v.value>w.value?1:-1),!m){const v=tk(qot,{numColors:h.length});h.forEach((w,S)=>w.symbol.color=new jr(v[S].slice(1,4))),c.colorRamp=qot}return new JB({field:o.name,uniqueValueInfos:h,authoringInfo:c})}function KRt(i,e,t){let r;return i!=null?(r=e?i.fields.find(n=>e.toLowerCase()===n.name.toLowerCase()):_cr(i.fields),r||(t||(r=i.fields.find(n=>n.type==="string")),r||(r=zie(i,"value")))):r=new Fo({name:"value"}),r}function _cr(i){let e;for(let t=0;tt.name.toLowerCase()===e)}function bcr(i){if(!xHe(i))return null;let e;const{attributeTable:t,colormap:r}=i;if(t!=null){const n=zie(t,"value"),s=KRt(t,null,!0);s.type==="string"&&(e={},t.features.forEach(o=>{const a=o.attributes;e[a[n.name]]=s?a[s.name]:a[n.name]}))}return aHe.createFromColormap(r,e)}const wcr=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function xcr(i){if(!SHe(i))return null;let e;if(i.statistics!=null&&i.statistics.length&&(i.dataType==="vector-magdir"||i.dataType==="vector-uv")){const{minMagnitude:n,maxMagnitude:s}=Scr(i.dataType,i.statistics);e=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:n,maxDataValue:s}]}const t=i.multidimensionalInfo!=null?wcr.get(i.multidimensionalInfo.variables[0].unit):null,r=new fHe({visualVariables:e,inputUnit:t,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function Yot(i){return{color:i.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function KLe(i){if(i.type==="uniqueValue"){const e=i.uniqueValueInfos;return e?.[0].symbol?.symbolLayers?.length&&(i.uniqueValueInfos=e?.map(r=>({value:r.value,label:r.label,symbol:r.symbol?Yot(r.symbol):null}))),i}if(i.type==="classBreaks"){const e=i.classBreakInfos;return e[0].symbol?.symbolLayers?.length&&(i.classBreakInfos=e.map(r=>({classMinValue:r.classMinValue,classMaxValue:r.classMaxValue,label:r.label,symbol:r.symbol?Yot(r.symbol):null}))),i}return i}function Scr(i,e){let t,r;if(i==="vector-magdir")t=e[0].min,r=e[0].max;else{const n=e[0].min,s=e[0].max,o=e[1].min,a=e[1].max;t=0,r=Math.max(Math.abs(n),Math.abs(o),Math.abs(s),Math.abs(a))}return{minMagnitude:t,maxMagnitude:r}}const tMe=1;function ZRt(i,e=256){e=Math.min(e,256);const{size:t,counts:r}=i,n=new Uint8Array(t),s=r.reduce((c,h)=>c+h/e,0);let o=0,a=0,l=0,u=s;for(let c=0;c=l){const B=IHe(l,r);for(u=0;u1&&(L-=(1/w)**(S*B[u])),Re[u]){const $=L*w*S**(1/r[u])+o;k[c]=s==="floor"?Math.floor($):s==="round"?Math.round($):$}else R>=t[u]?k[c]=a:k[c]=o;else k[c]=o;I[u]=k}}else for(u=0;u=t[u])k[c]=a;else{const B=(R-e[u])*m[u]+o;k[c]=s==="floor"?Math.floor(B):s==="round"?Math.round(B):B}I[u]=k}if(i.contrastOffset!=null){const B=QRt(i.contrastOffset,i.brightnessOffset);for(u=0;u0&&t<100?a=(200*o-100*n+2*n*r)/(2*(100-t))+s:t<=0&&t>-100?a=(200*o-100*n+2*n*r)*(100+t)/2e4+s:t===100?(a=200*o-100*n+(n+1)*(100-t)+2*n*r,a=a>0?n:0):t===-100&&(a=s),l[o]=a>n?n:a<0?0:a;return l}function Tcr(i,e,t){const r=[];for(let n=0;n=255)return tMe;let e=0;i!==150&&(e=i<=150?45*Math.cos(.01047*i):17*Math.sin(.021*i));const t=255,r=i+e,n=Math.log(i/t),s=Math.log(r/t);if(s===0)return tMe;const o=n/s;return isNaN(o)?tMe:Math.min(9.9,Math.max(.01,o))}function Ecr(i,e,t,r){let n=1/0,s=-1/0,o=0,a=0,l=0,u=0;const c=i.length,h=new Map,p=[];for(let V=0;Vu&&(u=K,l=Y),n=Ys?Y:s,o+=Y,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=o/a;let v=0;for(let V=0;VV).length:c,S=w<=1?0:Math.sqrt(v/(w-1));p.sort((V,Y)=>V-Y);const I=a>>>1,R={min:n,max:s,avg:m,stddev:S,mode:l,median:a%2?p[Math.floor(I)]:(p[I-1]+p[I])/2};if(["u8","s8","u4","u2","u1"].includes(t)){const V=s-n+1,Y=new Uint32Array(V);for(let K=0;KEcr(o,n?.[a]??t,r));return{statistics:s.map(({statistics:o})=>o),histograms:s.map(({histogram:o})=>o)}}function CHe(i){if(!i?.pixels?.length)return null;const{pixels:e,mask:t,bandMasks:r,pixelType:n}=i,s=i.width*i.height,o=e.length,a=[],l=[],u=256;let c,h,p,m;for(let v=0;vh?ne:h,p[ne]++}}else for(let re=0;reh?ne:h,p[ne]++}p=p.slice(c,h+1)}else{let re=!1;i.statistics||(i.updateStatistics(),re=!0);const ne=i.statistics;c=ne[v].minValue,h=ne[v].maxValue;const de=(h-c)/u;if(de===0){!ne||i.validPixelCount||re||i.updateStatistics();const pe=(i.validPixelCount||i.width*i.height)/u;for(let H=0;H[Q.minValue,Q.maxValue,0,0]);else{const Q=CHe(t);o=Q!=null?Q.statistics:null,a=Q!=null?Q.histograms:null}else o=i.statistics?.length?i.statistics:s.statistics,a="histograms"in i?i.histograms:void 0,a||(a=s.histograms);l!=="percentClip"&&l!=="histogramEqualization"||a?.length||(l="minMax");const u=o?.length||a?.length||s.bandCount,c=[],h=[];let p,m,v,w,S,I,R,L,k;o&&!Array.isArray(o[0])&&(o=o.map(Q=>[Q.min,Q.max,Q.avg,Q.stddev]));const[B,$]=Yx(s.pixelType);if(!o?.length){for(o=[],L=0;Lre[1]&&(h[L]=re[1])}}break;case"histogramEqualization":for(Of(a),L=0;L=20&&(w[0]=w[1]=w[2]=w[w.length-1]=w[w.length-2]=0),v=0,m=(p.max-p.min)/p.size,R=p.min===-.5&&m===1?.5:0,k=0;kI){c[L]=p.min+m*(k+R);break}for(I=(1-(i.maxPercent||0)/100)*v,h[L]=p.max+R,k=p.size-2;k>=0;k--)if(S[k]ZRt(Q)))):(Y=i.max||255,V=i.min||0),Icr({minCutOff:c,maxCutOff:h,outMax:Y,outMin:V,histogramLut:K},r)}function Icr(i,e){if(e==null||e.length===0)return i;const t=Math.max.apply(null,e),{minCutOff:r,maxCutOff:n,outMin:s,outMax:o,histogramLut:a}=i;return r.length===e.length||r.length<=t?i:{minCutOff:e.map(l=>r[l]),maxCutOff:e.map(l=>n[l]),histogramLut:a?e.map(l=>a[l]):null,outMin:s,outMax:o}}function IHe(i,e){const t=new Float32Array(i);for(let r=0;r1?e[r]>2?t[r]=6.5+(e[r]-2)**2.5:t[r]=6.5+100*(2-e[r])**4:t[r]=1;return t}function Hme(i,e){if(!i?.pixels?.length)return i;const{mask:t,bandMasks:r,width:n,height:s,pixels:o}=i,{minCutOff:a,maxCutOff:l,gamma:u}=e,c=e.outMin||0,h=e.outMax||255,p=n*s,m=e.outputPixelType||"u8",v=i.pixels.map(()=>Br.createEmptyBand(m,p)),w=v.length,S=h-c,I=[],R=[];for(let V=0;V=w,B=!!e.isRenderer;if(k){const V=IHe(w,u);for(let Y=0;Y1&&(de-=(1/S)**(ne*V[Y])),rea[Y]){const pe=de*S*ne**(1/u[Y])+c;v[Y][Q]=B?Math.floor(pe):L?Math.round(pe):pe}else re>=l[Y]?v[Y][Q]=h:v[Y][Q]=c}}}else for(let V=0;Va[V]){const re=(Q-a[V])*I[V]+c;v[V][K]=B?Math.floor(re):L?Math.round(re):re}else Q>=l[V]?v[V][K]=h:v[V][K]=c}}const $=new Br({width:n,height:s,mask:t,bandMasks:r,pixels:v,pixelType:m});return $.updateStatistics(),$}const Dv=1,yP=1/111e3;function eDt(i){let{altitude:e,azimuth:t}=i;const{hillshadeType:r,pixelSizePower:n=1,pixelSizeFactor:s=1,scalingType:o,isGCS:a,resolution:l}=i,u=r==="multi-directional"?2*i.zFactor:i.zFactor,{x:c,y:h}=l;let p=u/(8*c),m=u/(8*h);if(a&&u>.001&&(p/=yP,m/=yP),o==="adjusted")if(a){const ne=c*yP,de=h*yP;p=(u+ne**n*s)/(8*ne),m=(u+de**n*s)/(8*de)}else p=(u+c**n*s)/(8*c),m=(u+h**n*s)/(8*h);let v=(90-e)*Math.PI/180,w=Math.cos(v),S=(360-t+90)*Math.PI/180,I=Math.sin(v)*Math.cos(S),R=Math.sin(v)*Math.sin(S);const L=[315,270,225,360,180,0],k=[60,60,60,60,60,90],B=new Float32Array([3,5,3,2,1,4]),$=B.reduce((ne,de)=>ne+de),V=B.map(ne=>ne/$),Y=r==="multi-directional"?L.length:1,K=new Float32Array(6),Q=new Float32Array(6),re=new Float32Array(6);if(r==="multi-directional")for(let ne=0;nev?v:S],L=o[w],k=L*R,B=k*(1-Math.abs(I%2-1)),$=L-k;switch(Math.floor(I)){case 0:h[w]=k+$,p[w]=B+$,m[w]=$;break;case 1:h[w]=B+$,p[w]=k+$,m[w]=$;break;case 2:h[w]=$,p[w]=k+$,m[w]=B+$;break;case 3:h[w]=$,p[w]=B+$,m[w]=k+$;break;case 4:h[w]=B+$,p[w]=$,m[w]=k+$;break;case 5:case 6:h[w]=k+$,p[w]=$,m[w]=B+$}}i.pixels=[h,p,m],i.updateStatistics()}function Ocr(i,e){if(!bh(i))return i;const t=e.zFactor,r=e.pixelSizePower??1,n=e.pixelSizeFactor??1,s=e.slopeType,o=e.isGCS,{x:a,y:l}=e.resolution;let u=t/(8*a),c=t/(8*l);o&&Math.abs(t-1)<1e-4&&(u/=yP,c/=yP),s==="adjusted"&&(u=(t+a**r*n)/(8*a),c=(t+l**r*n)/(8*l));const{dzxs:h,dzys:p,outMask:m}=sSe(i),{width:v,height:w}=i,S=new Float32Array(v*w);for(let R=Dv;R360&&(I%=360)),c[p+m]=I}}}return oSe(c,l,u),new Br({width:l,height:u,pixels:[c],mask:a,pixelType:"f32",validPixelCount:i.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function Rcr(i,e){if(!bh(i))return i;const{curvatures:t,outMask:r}=sSe(i,e),{width:n,height:s}=i;oSe(t,n,s);const o=new Br({width:n,height:s,pixels:[t],mask:r,pixelType:"f32",validPixelCount:i.validPixelCount});return o.updateStatistics(),o}let e$=class extends Ci{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!Xot(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const n=e.extent,s=n.spatialReference.isGeographic,o={x:(n.xmax-n.xmin)/t.width,y:(n.ymax-n.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:s,resolution:o});break}}return r}catch(r){return di.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Xot(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),Hme(e,{...t,isRenderer:!0})}catch(r){return di.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:a,offset:l}=this.lookup.colormapLut||{};return{colormap:a,colormapOffset:l,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:n,bandIds:s}=e,{rendererJSON:o}=this;return o.type==="rasterStretch"?this._generateStretchWebGLParams(t,o,s):o.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(o,r,n??void 0):o.type==="vectorField"?this._generateVectorFieldWebGLParams(o):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:V3e(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?V3e(e,this.lookup.colormapLut):slr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:n,bandCount:s}=r,o=this.rendererJSON,a=["u8","u16","s8","s16"].includes(n);let l,u;const{dra:c}=o,{gamma:h}=this.lookup;if(o.stretchType==="histogramEqualization"){const p=c?null:this.lookup?.histogramLut,m=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!p}),v=Hme(e,{...m,gamma:h,isRenderer:!0});u=Vne(v,{lut:c?m.histogramLut:p,offset:0})}else if(a){if(c){const p=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t});l=ZLe({pixelType:n,...p,gamma:h,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;l=this.lookup?this.lookup.stretchLut:null}else l=this.lookup?this.lookup.stretchLut:null;if(!l)return e;s>1&&t!=null&&t.length===e?.pixels.length&&l?.lut.length===s&&(l={lut:t.map(p=>l.lut[p]),offset:l.offset}),u=Vne(e,l)}else{const p=$5(o,{rasterInfo:r,pixelBlock:e,bandIds:t});u=Hme(e,{...p,gamma:h,isRenderer:!0})}if(o.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;u=V3e(u,this.lookup?.colormapLut)}return u}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,n={...r,...t},s=Acr(e,n);if(!r.colorRamp)return s;let o;if(this._isLUTChanged(!0)){if(!this.bind().success)return s;o=this.lookup?this.lookup.hsvMap:null}else o=this.lookup?this.lookup.hsvMap:null;if(!o)return s;const a=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Mcr(s,e,o,a),s}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:n}=this.rasterInfo,s=e.field1;if(!s)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,a=t===1&&["u8","s8"].includes(n);if(!wHe(this.rasterInfo,s)&&!a)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const l=[];if(r!=null){const c=r.fields.find(h=>h.name.toLowerCase()==="value");if(!c)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(h=>{const p=e.uniqueValueInfos?.find(v=>String(v.value)===String(h.attributes[s])),m=p?.symbol?.color;m?l.push([h.attributes[c.name]].concat(m)):o&&l.push([h.attributes[c.name]].concat(o.color))})}else{if(s.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};e.uniqueValueInfos?.forEach(c=>{const h=c?.symbol?.color;h?l.push([parseInt(""+c.value,10)].concat(h)):o&&l.push([parseInt(""+c.value,10)].concat(o?.color))})}if(l.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const u=LJ({colormap:l});return this.lookup={rendererJSON:e,colormapLut:u},this.canRenderInWebGL=this._isColormapSupportedByWebGL(u?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!xHe(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(n=>[n.value].concat(n.color)).sort((n,s)=>n[0]-s[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=LJ({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!XRt(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=tk(e.colorRamp,{interpolateAlpha:!0}),r=LJ({colormap:t}),n=[],s=r.indexedColormap;for(let o=0;oa.name.toLowerCase()==="value"):null,s=t!=null?t.fields.find(a=>a.name.toLowerCase()===e.field.toLowerCase()):null,o=n!=null&&s!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:n,tableBreakField:s}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:n,tableBreakField:s}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const a=o.sort((p,m)=>p.classMaxValue-m.classMaxValue),l=a[a.length-1];let u=e.minValue;if(!r){const p=[];for(let m=0;mk>R);L&&c.push([I].concat(L.symbol.color))}}else{u=Math.floor(e.minValue);for(let p=0;p0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!(t==="none"||e.statistics?.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const n=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||n?.length||r||(t="minMax");const{computeGamma:s,useGamma:o,colorRamp:a}=e;let{gamma:l}=e;if(o&&s&&!l?.length){const h=e.statistics?.length?e.statistics:this.rasterInfo.statistics;l=Tcr(this.rasterInfo.pixelType,h)}const u=this.rasterInfo.pixelType,c=!r&&["u8","u16","s8","s16"].includes(u);if(t==="histogramEqualization"){const h=n.map(p=>ZRt(p));this.lookup={rendererJSON:e,histogramLut:h}}else if(c){const h=$5(e,{rasterInfo:this.rasterInfo}),p=ZLe({pixelType:u,...h,gamma:o?l:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:p}}if(a&&!this._isStretchColorRampNoop(a)){const h=tk(a,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=LJ({colormap:h}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&l?.length?l:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){let n=null,s=null;const o=this.lookup?.colormapLut;t.colorRamp&&o&&(n=o.indexedColormap,s=o.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:a}=this.lookup,l=!!(t.useGamma&&a&&a.some(k=>k!==1)),{minCutOff:u,maxCutOff:c,outMin:h,outMax:p}=$5(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let m=0;e!=null&&(m=e.getPlaneCount(),m===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:v}=this.rasterInfo,w=Math.min(3,r?.length||m||v,v),S=new Float32Array(w),I=n||l?1:255;let R;for(R=0;R1?a[R]>2?L[R]=6.5+(a[R]-2)**2.5:L[R]=6.5+100*(2-a[R])**4:L[R]=1;return{bandCount:w,outMin:h/I,outMax:p/I,minCutOff:u,maxCutOff:c,factor:S,useGamma:l,gamma:l?a:[1,1,1],gammaCorrection:l?L:[1,1,1],colormap:n,colormapOffset:s,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let n=null,s=null;const o=this.lookup?.colormapLut;e.colorRamp&&o&&(n=o.indexedColormap,s=o.offset);const a={...e,isGCS:t,resolution:r},l=eDt(a),u=this.rasterInfo.statistics?.[0];return{...l,minValue:u?.min??0,maxValue:u?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:n,colormapOffset:s}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:n,visualVariables:s,symbolTileSize:o,flowRepresentation:a}=e;let l;const u=this.rasterInfo.statistics?.[0].min??0,c=this.rasterInfo.statistics?.[0].max??50,h=s?.find(R=>R.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:c,maxSize:.8*o,minDataValue:u,minSize:.2*o},p=h.minDataValue??u,m=h.maxDataValue??c,v=h.maxSize!=null&&h.minSize!=null?[h.minSize/o,h.maxSize/o]:[.2,.8];if(t==="wind_speed"){const R=(v[0]+v[1])/2;v[0]=v[1]=R}const w=p!=null&&m!=null?[p,m]:null;if(t==="classified_arrow")if(p!=null&&m!=null&&h!=null){l=[];const R=(h.maxDataValue-h.minDataValue)/5;for(let L=0;L<6;L++)l.push(h.minDataValue+R*L)}else l=[0,1e-6,3.5,7,10.5,14];const S=a==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,I=s?.find(R=>R.type==="rotationInfo");return{breakValues:l,dataRange:w,inputUnit:r,outputUnit:n,symbolTileSize:o,symbolPercentRange:v,style:t||"single_arrow",rotation:S,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":I?.rotationType||e.rotationType,type:"vectorField"}}};function Xot(i){return bh(i)&&i.validPixelCount!==0}x([D({json:{write:!0}})],e$.prototype,"rendererJSON",void 0),x([D({type:W3,json:{write:!0}})],e$.prototype,"rasterInfo",void 0),x([D({json:{write:!0}})],e$.prototype,"lookup",void 0),x([D()],e$.prototype,"canRenderInWebGL",void 0),e$=x([Qe("esri.renderers.support.RasterSymbolizer")],e$);const AHe=e$,tDt=i=>{let e=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return x([D({json:{write:!0}})],e.prototype,"make",void 0),x([D({json:{write:!0}})],e.prototype,"model",void 0),x([D({json:{write:!0}})],e.prototype,"focalLength",void 0),x([D({json:{write:!0}})],e.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],e.prototype,"rows",void 0),x([D({json:{write:!0}})],e.prototype,"cols",void 0),e=x([Qe("esri.rest.support.CameraInfoMixin")],e),e};let VT=class extends tDt(Ci){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(e,t){t.acquisitionDate=e?.getTime()}};x([D({json:{write:!0}})],VT.prototype,"id",void 0),x([D({json:{name:"uri",write:!0}})],VT.prototype,"referenceUri",void 0),x([D({type:Date,json:{write:!0}})],VT.prototype,"acquisitionDate",void 0),x([ur("acquisitionDate")],VT.prototype,"writeAcquisitionDate",null),x([D({json:{write:!0}})],VT.prototype,"cameraID",void 0),x([D({type:$i,json:{write:!0}})],VT.prototype,"center",void 0),x([D({type:$i,json:{write:!0}})],VT.prototype,"perspectiveCenter",void 0),x([D({json:{write:!0}})],VT.prototype,"orientation",void 0),VT=x([Qe("esri.rest.support.ImageInspectionInfo")],VT);const Dcr=VT;let Wme=class extends Ci{constructor(){super(...arguments),this.images=null}};x([D({type:[Dcr],json:{write:!0}})],Wme.prototype,"images",void 0),Wme=x([Qe("esri.rest.support.FindImagesResult")],Wme);const Fcr=Wme;let XG=class extends Ci{constructor(e){super(e),this.north=null,this.up=null,this.spatialReference=null}};x([D({type:Number,json:{write:!0}})],XG.prototype,"north",void 0),x([D({type:Number,json:{write:!0}})],XG.prototype,"up",void 0),x([D({type:Xi,json:{write:!0}})],XG.prototype,"spatialReference",void 0),XG=x([Qe("esri.rest.support.ImageAngleResult")],XG);const kcr=XG;let B5=class extends Ci{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};x([D({type:Number,json:{read:!0,write:!0}})],B5.prototype,"value",void 0),x([D({type:String,json:{read:!0,write:!0}})],B5.prototype,"displayValue",void 0),x([D({type:Number,json:{read:!0,write:!0}})],B5.prototype,"uncertainty",void 0),B5=x([Qe("esri.rest.support.ImageMeasureResultValue")],B5);let VV=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:uR.read,write:uR.write}})],VV.prototype,"unit",void 0),VV=x([Qe("esri.rest.support.ImageMeasureResultLengthValue")],VV);let qme=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:Cne.read,write:Cne.write}})],qme.prototype,"unit",void 0),qme=x([Qe("esri.rest.support.ImageMeasureResultAreaValue")],qme);let Vie=class extends B5{constructor(){super(...arguments),this.unit=null}};x([D({type:String,json:{read:jve.read,write:jve.write}})],Vie.prototype,"unit",void 0),Vie=x([Qe("esri.rest.support.ImageMeasureResultAngleValue")],Vie);let nF=class extends Ci{constructor(){super(...arguments),this.name=null,this.sensorName=null}};x([D({type:String,json:{read:!0,write:!0}})],nF.prototype,"name",void 0),x([D({type:String,json:{read:!0,write:!0}})],nF.prototype,"sensorName",void 0),nF=x([Qe("esri.rest.support.BaseImageMeasureResult")],nF);let PQ=class extends nF{constructor(){super(...arguments),this.area=null,this.perimeter=null}};x([D({type:qme,json:{read:!0,write:!0}})],PQ.prototype,"area",void 0),x([D({type:VV,json:{read:!0,write:!0}})],PQ.prototype,"perimeter",void 0),PQ=x([Qe("esri.rest.support.ImageAreaResult")],PQ);const Lcr=PQ;let JG=class extends Ci{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(e,t){return e==null?null:e.rings?$s.fromJSON(e):hr.fromJSON(e)}};x([D({type:Number,json:{write:!0}})],JG.prototype,"area",void 0),x([D({json:{name:"shape",write:!0}})],JG.prototype,"geometry",void 0),x([Mi("geometry")],JG.prototype,"readGeometry",null),JG=x([Qe("esri.rest.support.ImageBoundaryResult")],JG);const Ncr=JG;let KG=class extends nF{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};x([D({type:VV,json:{read:!0,write:!0}})],KG.prototype,"distance",void 0),x([D({type:Vie,json:{read:!0,write:!0}})],KG.prototype,"azimuthAngle",void 0),x([D({type:Vie,json:{read:!0,write:!0}})],KG.prototype,"elevationAngle",void 0),KG=x([Qe("esri.rest.support.ImageDistanceResult")],KG);const $cr=KG;let Yme=class extends tDt(Ci){constructor(){super(...arguments),this.id=null}};x([D({json:{write:!0}})],Yme.prototype,"id",void 0),Yme=x([Qe("esri.rest.support.CameraInfo")],Yme);const Bcr=Yme;let HT=class extends Ci{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(e,t){t.acquisitionDate=e?.getTime()}};x([D({json:{write:!0}})],HT.prototype,"id",void 0),x([D({json:{write:!0}})],HT.prototype,"name",void 0),x([D({type:Date,json:{write:!0}})],HT.prototype,"acquisitionDate",void 0),x([ur("acquisitionDate")],HT.prototype,"writeAcquisitionDate",null),x([D({json:{write:!0}})],HT.prototype,"cameraID",void 0),x([D({type:$i,json:{write:!0}})],HT.prototype,"center",void 0),x([D({json:{write:!0}})],HT.prototype,"gps",void 0),x([D({json:{write:!0}})],HT.prototype,"orientation",void 0),HT=x([Qe("esri.rest.support.ImageGPSInfo")],HT);const jcr=HT;let RQ=class extends Ci{constructor(){super(...arguments),this.images=null,this.cameras=null}};x([D({type:[jcr],json:{write:!0}})],RQ.prototype,"images",void 0),x([D({type:[Bcr],json:{write:!0}})],RQ.prototype,"cameras",void 0),RQ=x([Qe("esri.rest.support.ImageGPSInfoResult")],RQ);const Gcr=RQ;let Xme=class extends nF{constructor(){super(...arguments),this.height=null}};x([D({type:VV,json:{read:!0,write:!0}})],Xme.prototype,"height",void 0),Xme=x([Qe("esri.rest.support.ImageHeightResult")],Xme);const Ucr=Xme;let WT=class extends Ci{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};x([D({json:{write:!0}})],WT.prototype,"catalogItemVisibilities",void 0),x([D({type:du,json:{write:!0}})],WT.prototype,"catalogItems",void 0),x([D({type:$i,json:{write:!0}})],WT.prototype,"location",void 0),x([D({json:{write:!0}})],WT.prototype,"name",void 0),x([D({json:{write:!0}})],WT.prototype,"objectId",void 0),x([D({json:{write:!0}})],WT.prototype,"processedValues",void 0),x([D({json:{write:!0}})],WT.prototype,"properties",void 0),x([D({json:{write:!0}})],WT.prototype,"value",void 0),WT=x([Qe("esri.rest.support.ImageIdentifyResult")],WT);const zcr=WT;let Jme=class extends Ci{constructor(){super(...arguments),this.geometries=null}};x([D({json:{write:!0}})],Jme.prototype,"geometries",void 0),Jme=x([Qe("esri.rest.support.ImagePixelLocationResult")],Jme);const Vcr=Jme;let Kme=class extends nF{constructor(){super(...arguments),this.point=null}};x([D({type:$i,json:{name:"point.value",read:!0,write:!0}})],Kme.prototype,"point",void 0),Kme=x([Qe("esri.rest.support.ImagePointResult")],Kme);const Hcr=Kme;let iO=class extends Ci{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};x([D({json:{write:!0}})],iO.prototype,"attributes",void 0),x([D({type:$i,json:{write:!0}})],iO.prototype,"location",void 0),x([D({json:{write:!0}})],iO.prototype,"locationId",void 0),x([D({json:{write:!0}})],iO.prototype,"rasterId",void 0),x([D({json:{write:!0}})],iO.prototype,"resolution",void 0),x([D({json:{write:!0}})],iO.prototype,"pixelValue",void 0),iO=x([Qe("esri.rest.support.ImageSample")],iO);const Wcr=iO;let Zme=class extends Ci{constructor(){super(...arguments),this.samples=null}};x([D({type:[Wcr],json:{write:!0}})],Zme.prototype,"samples",void 0),Zme=x([Qe("esri.rest.support.ImageSampleResult")],Zme);const qcr=Zme;let Qme=class extends Ci{constructor(){super(...arguments),this.url=null}};x([D({json:{name:"imageURL",write:!0}})],Qme.prototype,"url",void 0),Qme=x([Qe("esri.rest.support.ImageUrlResult")],Qme);const Ycr=Qme;let w4=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(e,t){return e.spatialReference||(e={...e,spatialReference:t.Shape.spatialReference}),$i.fromJSON(e)}};x([D({types:Ff,json:{name:"Shape",read:Ro,write:!0}})],w4.prototype,"geometry",void 0),x([D({json:{name:"Length",write:!0}})],w4.prototype,"length",void 0),x([D({json:{name:"Area",write:!0}})],w4.prototype,"area",void 0),x([D({json:{name:"Center",write:!0}})],w4.prototype,"center",void 0),x([Mi("center")],w4.prototype,"readCenter",null),w4=x([Qe("esri.rest.support.MeasureAreaFromImageResult")],w4);const Xcr=w4;let DQ=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.length=null}};x([D({types:Ff,json:{name:"Shape",read:Ro,write:!0}})],DQ.prototype,"geometry",void 0),x([D({json:{name:"Length",write:!0}})],DQ.prototype,"length",void 0),DQ=x([Qe("esri.rest.support.MeasureLengthFromImageResult")],DQ);const Jcr=DQ;function MHe(i){const e=i?.time;if(e&&(e.start!=null||e.end!=null)){const t=[];e.start!=null&&t.push(e.start),e.end==null||t.includes(e.end)||t.push(e.end),i.time=t.join(",")}}async function iDt(i,e,t){const r=gu(i),n=e.geometry?[e.geometry]:[],s=await cy(n),o=e.toJSON();MHe(o);const a=s?.[0];a!=null&&(o.geometry=m3(a));const l=Ig({...r.query,f:"json",...o});return _p(l,t)}async function Kcr(i,e,t){const r=e.toJSON();r.angleName!=null&&(r.angleName=r.angleName.join(",")),e?.point?.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=lSe(e.point.spatialReference)),e?.spatialReference?.imageCoordinateSystem&&(r.spatialReference=BY(e.spatialReference));const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/computeAngles`,o);return a.spatialReference=a.spatialReference?a.spatialReference.geodataXform!=null?new Xi({wkid:0,imageCoordinateSystem:a.spatialReference}):Xi.fromJSON(a.spatialReference):null,a.north==="NaN"&&(a.north=null),a.up==="NaN"&&(a.up=null),new kcr(a)}async function Zcr(i,e,t){const r=e.toJSON(),{geometries:n}=e;if(n)for(let u=0;u{a.avg=a.mean,a.stddev=a.standardDeviation}),{statistics:o,histograms:s.histograms}}async function ehr(i,e,t){const r=await iDt(i,e,t),n=gu(i),{data:s}=await zi(`${n.path}/computeHistograms`,r);return{histograms:s.histograms}}async function thr(i,e,t){const r=e.toJSON();MHe(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s));const o=gu(i),a=Ig({...o.query,f:"json",...r}),l=_p(a,t),{data:u}=await zi(`${o.path}/getSamples`,l),c=u?.samples?.map(h=>{const p=h.value==="NaN"||h.value===""?null:h.value.split(" ").map(m=>Number(m));return{...h,pixelValue:p}});return qcr.fromJSON({samples:c})}async function Jot(i,e,t){const r=gu(i),n=e.geometry?[e.geometry]:[];return cy(n).then(s=>{const o=e.toJSON(),a=s?.[0];a!=null&&(o.geometry=JSON.stringify(m3(a)));const l=Ig({...r.query,f:"json",...o}),u=_p(l,t);return zi(r.path+"/identify",u)}).then(s=>zcr.fromJSON(s.data))}async function ihr(i,e,t){const r=await aSe(i,e,[e.fromGeometry,e.toGeometry],t);return Ucr.fromJSON(r)}async function rhr(i,e,t){const r=await aSe(i,e,[e.geometry],t);return Lcr.fromJSON(r)}async function nhr(i,e,t){const r=await aSe(i,e,[e.geometry],t);return Hcr.fromJSON(r)}async function shr(i,e,t){const r=await aSe(i,e,[e.fromGeometry,e.toGeometry],t);return $cr.fromJSON(r)}async function aSe(i,e,t,r){const n=gu(i),s=await cy(t),o=e.toJSON();s[0]!=null&&(o.fromGeometry=JSON.stringify(m3(s[0]))),s[1]!=null&&(o.toGeometry=JSON.stringify(m3(s[1])));const a=Ig({...n.query,f:"json",...o}),l=_p(a,r),{data:u}=await zi(n.path+"/measure",l);return u}async function ohr(i,e,t){const r=await rDt(i,e,t);return Jcr.fromJSON(r)}async function ahr(i,e,t){const r=await rDt(i,e,t);return Xcr.fromJSON(r)}async function rDt(i,e,t){const r=gu(i),n=e.toJSON(),s=Ig({...r.query,f:"json",...n}),o=_p(s,t),{data:a}=await zi(r.path+"/measureFromImage",o);return a}function m3(i){const e=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(e.spatialReference=lSe(i.spatialReference)),e}function lSe(i){const{imageCoordinateSystem:e}=i;if(e){const{id:t,referenceServiceName:r}=e;return t!=null?r?{icsid:t,icsns:r}:{icsid:t}:{ics:e}}return i.toJSON()}function BY(i,e){if(!i.imageCoordinateSystem)return Hv(i);const t=lSe(i),{icsid:r,icsns:n}=t;return r==null||n!=null&&!e?.toLowerCase().includes("/"+n.toLowerCase()+"/")?JSON.stringify(t):`0:${r}`}async function lhr(i,e,t){const r=gu(i),n=e.toJSON();e.outSpatialReference&&(n.outSR=BY(e.outSpatialReference));const s=Ig({...r.query,f:"json",...n}),o=_p(s,t),{data:a}=await zi(r.path+"/queryBoundary",o);return Ncr.fromJSON(a)}async function uhr(i,e,t){const r=e.toJSON();MHe(r),r.objectIds?.length&&(r.objectIds=r.objectIds.join(",")),r.geometry||r.objectIds||r.time||r.where||(r.where="1=1");const n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s));const o=s?.spatialReference??e.geometry?.spatialReference;o&&(r.inSR=BY(o));const a=gu(i),l=Ig({...a.query,f:"json",...r}),u=_p(l,t),{data:c}=await zi(`${a.path}/queryGPSInfo`,u);return Gcr.fromJSON(c)}async function chr(i,e,t){const r=e.toJSON();e.geometry.spatialReference.imageCoordinateSystem&&(r.geometry=m3(e.geometry)),e.depthOffset&&e.adjust||delete r.options;const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/imageToMap`,o);return Ro(a)}async function hhr(i,e,t){const r=e.toJSON();e.rasterIds?.length&&(r.rasterIds=e.rasterIds.join(","));const n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/imageToMapMultiray`,o);return Ro(a)}async function dhr(i,e,t){const r=e.toJSON(),n=await cy(e.geometry),s=n?.[0];s!=null&&(r.geometry=m3(s)),e.visibleOnly||delete r.options;const o=s?.spatialReference??e.geometry?.spatialReference;o&&(r.inSR=BY(o));const a=gu(i),l=Ig({...a.query,f:"json",...r}),u=_p(l,t),{data:c}=await zi(`${a.path}/mapToImage`,u);return Ro(c)}async function phr(i,e,t){const r=e.toJSON(),n=gu(i),s=Ig({...n.query,f:"json",...r}),o=_p(s,t),{data:a}=await zi(`${n.path}/getImageUrl`,o);return Ycr.fromJSON(a)}async function fhr(i,e,t){const r=e.toJSON(),n=await cy([e.fromGeometry,e.toGeometry]);n[0]!=null&&(r.fromGeometry=m3(n[0]),n[0].spatialReference&&(r.inSR=BY(n[0].spatialReference))),n[1]!=null&&(r.toGeometry=m3(n[1])),e.objectIds?.length&&(r.objectIds=r.objectIds.join(","));const s=gu(i),o=Ig({...s.query,f:"json",...r}),a=_p(o,t),{data:l}=await zi(`${s.path}/find`,a);return Fcr.fromJSON(l)}function Dae(i){const e={};for(const t in i){if(t==="declaredClass")continue;const r=i[t];if(r!=null&&typeof r!="function")if(Array.isArray(r)){e[t]=[];for(let n=0;n>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=this._data[this._pos]!==0;return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getUint32(t+4,!0)*Kot;return this._skip(8),r}getSFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getInt32(t+4,!0)*Kot;return this._skip(8),r}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,r=this._toString(this._data,t,t+e);return this._skip(e),r}getBytes(){const e=this._getLength(),t=this._pos,r=this._toBytes(this._data,t,t+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,r,n){const s=this.getMessage(),o=e(s,t,r,n);return s.release(),o}processMessage(e){const t=this.getMessage(),r=e(t);return t.release(),r}getMessage(){const e=this._getLength(),t=ege.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){ege.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case m5.varint:this._decodeVarint();break;case m5.fixed64:this._skip(8);break;case m5.delimited:this._skip(this._getLength());break;case m5.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,r=0,n=0;if(this._end-t>=10)do{if(n=e[t++],r|=127&n,(128&n)==0||(n=e[t++],r|=(127&n)<<7,(128&n)==0)||(n=e[t++],r|=(127&n)<<14,(128&n)==0)||(n=e[t++],r|=(127&n)<<21,(128&n)==0)||(n=e[t++],r+=268435456*(127&n),(128&n)==0)||(n=e[t++],r+=34359738368*(127&n),(128&n)==0)||(n=e[t++],r+=4398046511104*(127&n),(128&n)==0)||(n=e[t++],r+=562949953421312*(127&n),(128&n)==0)||(n=e[t++],r+=72057594037927940*(127&n),(128&n)==0)||(n=e[t++],r+=9223372036854776e3*(127&n),(128&n)==0))break;throw new Error("Varint too long!")}while(!1);else{let s=1;for(;t!==this._end&&(n=e[t],(128&n)!=0);)++t,r+=(127&n)*s,s*=128;if(t===this._end)throw new Error("Varint overrun!");++t,r+=n*s}return this._pos=t,r}_decodeSVarint(){const e=this._data;let t,r=0,n=0;const s=1&e[this._pos];if(n=e[this._pos++],r|=127&n,(128&n)==0||(n=e[this._pos++],r|=(127&n)<<7,(128&n)==0)||(n=e[this._pos++],r|=(127&n)<<14,(128&n)==0)||(n=e[this._pos++],r|=(127&n)<<21,(128&n)==0)||(n=e[this._pos++],r+=268435456*(127&n),(128&n)==0)||(n=e[this._pos++],r+=34359738368*(127&n),(128&n)==0)||(n=e[this._pos++],r+=4398046511104*(127&n),(128&n)==0))return s?-(r+1)/2:r/2;if(t=BigInt(r),n=e[this._pos++],t+=0x2000000000000n*BigInt(127&n),(128&n)==0||(n=e[this._pos++],t+=0x100000000000000n*BigInt(127&n),(128&n)==0)||(n=e[this._pos++],t+=0x8000000000000000n*BigInt(127&n),(128&n)==0))return Number(s?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==m5.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,r){if((r=Math.min(this._end,r))-t>ghr){const o=e.subarray(t,r);return mhr.decode(o)}let n="",s="";for(let o=t;o{i._data=null,i._dataView=null});const iMe=2;let $o=class FQ{constructor(e=[],t=[],r=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=r}static fromRect(e){const[t,r,n,s]=e,o=n-t,a=s-r;return new FQ([5],[t,r,o,0,0,a,-o,0,0,-a])}get isPoint(){return this.lengths.length===0}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce((e,t)=>e+t)}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;rn+s))*iMe,r=this.coords.slice(0,t);return e?(e.set(r),new FQ(this.lengths,e,this.hasIndeterminateRingOrder)):new FQ(Array.from(this.lengths),Array.from(r),this.hasIndeterminateRingOrder)}},ry=class QLe{constructor(e=null,t={},r,n){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=n,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new QLe(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new QLe(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}};function kQ(i){return!!i.geometry?.coords?.length}let OHe=class nDt{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new nDt;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}};const sDt=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let yhr=class{constructor(e){this._options=e,this.geometryTypes=sDt,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new OHe}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||Ya(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=WF(this._options.sourceSpatialReference)/WF(e.spatialReference);if(t!==1)for(const r of e.features){if(!kQ(r))continue;const n=r.geometry.coords;for(let s=2;st+r,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new $o}};const Zot=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],Qot=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],eat=["upperLeft","lowerLeft"];function tat(i){return i>=Zot.length?null:Zot[i]}function vhr(i){return i>=Qot.length?null:Qot[i]}function iat(i){return i>=eat.length?null:eat[i]}function rat(i,e){return e>=i.geometryTypes.length?null:i.geometryTypes[e]}function _hr(i,e,t){const n=i.asUnsafe(),s=e.createPointGeometry(t);for(;n.next();)switch(n.tag()){case 3:{const o=n.getUInt32(),a=n.pos()+o;let l=0;for(;n.pos()s.name===t);return n?Nhr({tagName:r,tags:n.tags}):null}function Nhr(i){const{tagName:e,tags:t}=i;return!t||!e?null:t.find(n=>n.name===e)?.value||null}var eNe;const $hr={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let $_=eNe=class extends Ci{constructor(i){super(i),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:i}=this,e=Lhr({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:i});return $hr[e]||null}clone(){return new eNe({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};x([D({type:String})],$_.prototype,"contentType",void 0),x([D()],$_.prototype,"exifInfo",void 0),x([D({readOnly:!0})],$_.prototype,"orientationInfo",null),x([D({type:ms})],$_.prototype,"id",void 0),x([D({type:String})],$_.prototype,"globalId",void 0),x([D({type:String})],$_.prototype,"keywords",void 0),x([D({type:String})],$_.prototype,"name",void 0),x([D({json:{read:!1}})],$_.prototype,"parentGlobalId",void 0),x([D({json:{read:!1}})],$_.prototype,"parentObjectId",void 0),x([D({type:ms})],$_.prototype,"size",void 0),x([D({json:{read:!1}})],$_.prototype,"url",void 0),$_=eNe=x([Qe("esri.layers.support.AttachmentInfo")],$_);const dDt=$_;async function DHe(i,e,t){const r=gu(i);return PHe(r,Kn.from(e),{...t}).then(n=>n.data.count)}async function uSe(i,e,t){const r=gu(i);return Fhr(r,Kn.from(e),{...t}).then(n=>n.data.objectIds)}async function pDt(i,e,t){const r=gu(i),{rasterFunction:n,sourceJSON:s}=e||{},o=n?JSON.stringify(n.rasterFunctionDefinition||n):null,a=Ig({...r.query,renderingRule:o,f:"json"}),l=_p(a,t);i=r.path;const u=s||await zi(i,l).then(ae=>ae.data),c=u.hasRasterAttributeTable?zi(`${i}/rasterAttributeTable`,l):null,h=u.hasColormap?zi(`${i}/colormap`,l):null,p=u.hasHistograms?zi(`${i}/histograms`,l):null,m=u.currentVersion>=10.3?zi(`${i}/keyProperties`,l):null,v=u.hasMultidimensions?zi(`${i}/multidimensionalInfo`,l):null,w=await Promise.allSettled([c,h,p,m,v]);let S=null;if(u.minValues&&u.minValues.length===u.bandCount){S=[];for(let ae=0;ae{ae.statistics?.length&&ae.statistics.forEach(fe=>{fe.avg=fe.mean,fe.stddev=fe.standardDeviation})});const{defaultVariable:pe,serviceDataType:H}=u;pe&&pe!==re.DefaultVariable&&(re.DefaultVariable=pe),H?.includes("esriImageServiceDataTypeVector")&&!H.includes(re.DataType)&&(re.DataType=H.replace("esriImageServiceDataType",""));let Z=u.noDataValue;return u.noDataValues?.length&&u.noDataValues.some(ae=>ae!==Z)&&(Z=u.noDataValues),new W3({width:R,height:L,bandCount:u.bandCount,extent:hr.fromJSON(u.extent),spatialReference:k,pixelSize:new $i({x:u.pixelSizeX,y:u.pixelSizeY,spatialReference:k}),pixelType:u.pixelType.toLowerCase(),statistics:S,attributeTable:$,colormap:Y,histograms:Q,keyProperties:re,noDataValue:Z,multidimensionalInfo:de})}function fDt(i,e,t){return pDt(i,{sourceJSON:e},t)}function Bhr(i,e,t){return pDt(i,{rasterFunction:e},t)}function mDt(i,e){i.attributeTable||(e.hasRasterAttributeTable=!1),i.histograms||(e.hasHistograms=!1),i.colormap||(e.hasColormap=!1),i.multidimensionalInfo||(e.hasMultidimensions=!1)}async function jhr(i,e,t){const r=gu(i),n=Ig({...r?.query,f:"json"}),s=_p(n,t),o=`${r?.path}/${e}/info`,a=zi(`${o}`,s),l=zi(`${o}/keyProperties`,s),u=await Promise.allSettled([a,l]),c=u[0].status==="fulfilled"?u[0].value.data:null,h=u[1].status==="fulfilled"?u[1].value.data:null;let p=null;c.statistics?.length&&(p=c.statistics.map(k=>({min:k[0],max:k[1],avg:k[2],stddev:k[3]})));const m=hr.fromJSON(c.extent),v=Math.ceil(m.width/c.pixelSizeX-.1),w=Math.ceil(m.height/c.pixelSizeY-.1),S=m.spatialReference,I=new $i({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:S}),R=c.histograms?.length?c.histograms:null,L=new QB({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new W3({width:v,height:w,bandCount:c.bandCount,extent:m,spatialReference:S,pixelSize:I,pixelType:c.pixelType.toLowerCase(),statistics:p,histograms:R,keyProperties:h,storageInfo:L})}let x4=class extends xs(Ci){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};x([D({type:$i,json:{read:!0}})],x4.prototype,"fromGeometry",void 0),x([D({type:$i,json:{read:!0,write:!0}})],x4.prototype,"toGeometry",void 0),x([D({json:{write:!0}})],x4.prototype,"objectIds",void 0),x([D({type:String,json:{write:!0}})],x4.prototype,"where",void 0),x([D({type:Number,json:{write:!0}})],x4.prototype,"maxCount",void 0),x4=x([Qe("esri.rest.support.FindImagesParameters")],x4);const Ghr=x4;var tNe;let t$=tNe=class extends Ci{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new tNe(li({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};x([D({type:[String],json:{name:"angleName",write:!0}})],t$.prototype,"angleNames",void 0),x([D({type:$i,json:{write:!0}})],t$.prototype,"point",void 0),x([D({type:Xi,json:{write:!0}})],t$.prototype,"spatialReference",void 0),x([D({type:ms,json:{write:!0}})],t$.prototype,"rasterId",void 0),t$=tNe=x([Qe("esri.rest.support.ImageAngleParameters")],t$);const Uhr=t$,xS=new Rs({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let gC=class extends Ci{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};x([D()],gC.prototype,"type",void 0),x([D({type:xS.apiValues,json:{read:xS.read,write:xS.write}})],gC.prototype,"measureOperation",void 0),x([D({type:Qw,json:{write:!0}})],gC.prototype,"mosaicRule",void 0),x([D({type:$i,json:{write:!0}})],gC.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],gC.prototype,"raster",void 0),gC=x([Qe("esri.rest.support.BaseImageMeasureParameters")],gC);var iNe;let rO=iNe=class extends gC{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new iNe(li({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({types:Ff,json:{name:"fromGeometry",read:!0,write:!0}})],rO.prototype,"geometry",void 0),x([ur("geometry")],rO.prototype,"writeGeometry",null),x([D({type:xS.apiValues,json:{write:xS.write}})],rO.prototype,"measureOperation",null),x([D({json:{read:!0}})],rO.prototype,"is3D",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],rO.prototype,"linearUnit",void 0),x([D({type:String,json:{read:Cne.read,write:Cne.write}})],rO.prototype,"areaUnit",void 0),rO=iNe=x([Qe("esri.rest.support.ImageAreaParameters")],rO);const zhr=rO;let tge=class extends xs(Ci){constructor(){super(...arguments),this.outSpatialReference=null}};x([D({type:Xi,json:{name:"outSR",write:!0}})],tge.prototype,"outSpatialReference",void 0),tge=x([Qe("esri.rest.support.ImageBoundaryParameters")],tge);const Vhr=tge;var rNe;let yI=rNe=class extends gC{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new rNe(li({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({type:$i,json:{read:!0,write:!0}})],yI.prototype,"fromGeometry",void 0),x([ur("fromGeometry")],yI.prototype,"writeFromGeometry",null),x([D({type:$i,json:{read:!0,write:!0}})],yI.prototype,"toGeometry",void 0),x([D({type:xS.apiValues,json:{write:xS.write}})],yI.prototype,"measureOperation",null),x([D({json:{read:!0}})],yI.prototype,"is3D",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],yI.prototype,"linearUnit",void 0),x([D({type:String,json:{read:jve.read,write:jve.write}})],yI.prototype,"angularUnit",void 0),yI=rNe=x([Qe("esri.rest.support.ImageDistanceParameters")],yI);const Hhr=yI;let nO=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]=JSON.stringify(e.toJSON()))}};x([D({types:Ff,json:{read:Ro,write:!0}})],nO.prototype,"geometry",void 0),x([ur("geometry")],nO.prototype,"writeGeometry",null),x([D({json:{write:!0}})],nO.prototype,"objectIds",void 0),x([Wr(XOt,{ignoreUnknown:!1,name:"spatialRel"})],nO.prototype,"spatialRelationship",void 0),x([D({type:Eg,json:{name:"time",write:!0}})],nO.prototype,"timeExtent",void 0),x([D({type:String,json:{write:!0}})],nO.prototype,"where",void 0),nO=x([Qe("esri.rest.support.ImageGPSInfoParameters")],nO);const Whr=nO;var nNe;let sO=nNe=class extends gC{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new nNe(li({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({type:$i,json:{read:!0}})],sO.prototype,"fromGeometry",void 0),x([ur("fromGeometry")],sO.prototype,"writeFromGeometry",null),x([D({type:$i,json:{read:!0,write:!0}})],sO.prototype,"toGeometry",void 0),x([D({type:xS.apiValues,json:{write:xS.write}})],sO.prototype,"measureOperation",null),x([D({json:{read:!0}})],sO.prototype,"operationType",void 0),x([D({type:String,json:{read:uR.read,write:uR.write}})],sO.prototype,"linearUnit",void 0),sO=nNe=x([Qe("esri.rest.support.ImageHeightParameters")],sO);const qhr=sO;var sNe;let qT=sNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(i){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",i)}clone(){return new sNe(li({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};x([D({types:Ff,json:{read:Ro}})],qT.prototype,"geometry",void 0),x([ur("geometry")],qT.prototype,"writeGeometry",null),x([D({type:Qw,json:{write:!0}})],qT.prototype,"mosaicRule",void 0),x([D({type:kl})],qT.prototype,"renderingRule",null),x([D({type:kl,json:{write:!0,name:"renderingRule"}})],qT.prototype,"rasterFunction",void 0),x([D({type:$i,json:{write:!0}})],qT.prototype,"pixelSize",void 0),x([D({json:{write:!0}})],qT.prototype,"raster",void 0),x([D({type:Eg,json:{read:{source:"time"},write:{target:"time"}}})],qT.prototype,"timeExtent",void 0),qT=sNe=x([Qe("esri.rest.support.ImageHistogramParameters")],qT);const ige=qT;var oNe;let Od=oNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let e=i;e?.mosaicMethod&&(e=Qw.fromJSON({...e.toJSON(),mosaicMethod:e.mosaicMethod,mosaicOperation:e.mosaicOperation})),this._set("mosaicRule",e)}writeMosaicRule(i,e,t){i!=null&&(e[t]=JSON.stringify(i.toJSON()))}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(i){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",i)}get renderingRules(){return ty(di.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(i){ty(di.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",i)}set rasterFunction(i){let e=i;e?.rasterFunction&&(e=kl.fromJSON({...e.toJSON(),rasterFunction:e.rasterFunction,rasterFunctionArguments:e.rasterFunctionArguments})),this._set("rasterFunction",e)}writeRasterFunction(i,e,t){i!=null&&(e[t]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(e[t]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,e,t){i!=null&&(e[t]=JSON.stringify(i.map(r=>r.rasterFunctionDefinition||r.toJSON())))}writePixelSize(i,e,t){i!=null&&(e[t]=JSON.stringify(i))}writeTimeExtent(i,e,t){if(i!=null){const r=i.start!=null?i.start.getTime():null,n=i.end!=null?i.end.getTime():null;e[t]=r!=null?n!=null?`${r},${n}`:`${r}`:null}}clone(){return new oNe(li({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};x([D({json:{write:!0}})],Od.prototype,"geometry",void 0),x([ur("geometry")],Od.prototype,"writeGeometry",null),x([D({type:Qw,json:{write:!0}})],Od.prototype,"mosaicRule",null),x([ur("mosaicRule")],Od.prototype,"writeMosaicRule",null),x([D({type:kl})],Od.prototype,"renderingRule",null),x([D({type:[kl]})],Od.prototype,"renderingRules",null),x([D({type:kl,json:{write:!0,name:"renderingRule"}})],Od.prototype,"rasterFunction",null),x([ur("rasterFunction")],Od.prototype,"writeRasterFunction",null),x([D({type:[kl],json:{write:!0,name:"renderingRules"}})],Od.prototype,"rasterFunctions",void 0),x([ur("rasterFunctions")],Od.prototype,"writeRasterFunctions",null),x([D({type:$i,json:{write:!0}})],Od.prototype,"pixelSize",void 0),x([ur("pixelSize")],Od.prototype,"writePixelSize",null),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnCatalogItems",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"returnPixelValues",void 0),x([D({type:Number,json:{write:!0}})],Od.prototype,"maxItemCount",void 0),x([D({type:Eg,json:{write:{target:"time"}}})],Od.prototype,"timeExtent",void 0),x([ur("timeExtent")],Od.prototype,"writeTimeExtent",null),x([D({json:{write:!0}})],Od.prototype,"raster",void 0),x([D({json:{write:!0}})],Od.prototype,"viewId",void 0),x([D({type:Boolean,json:{write:!0}})],Od.prototype,"processAsMultidimensional",void 0),Od=oNe=x([Qe("esri.rest.support.ImageIdentifyParameters")],Od);const sat=Od;var aNe;let ZG=aNe=class extends Ci{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,e,t){e.geometries={geometryType:"esriGeometryPoint",geometries:i.map(r=>r.toJSON())}}clone(){return new aNe({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};x([D({type:[$i],json:{write:!0}})],ZG.prototype,"geometries",void 0),x([ur("geometries")],ZG.prototype,"writeGeometry",null),x([D({type:ms,json:{write:!0}})],ZG.prototype,"rasterId",void 0),ZG=aNe=x([Qe("esri.rest.support.ImagePixelLocationParameters")],ZG);const Yhr=ZG;var lNe;let i$=lNe=class extends gC{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:e}=this;return e.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new lNe(li({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};x([D({types:Ff,json:{name:"fromGeometry",read:Ro}})],i$.prototype,"geometry",void 0),x([ur("geometry")],i$.prototype,"writeGeometry",null),x([D({type:xS.apiValues,json:{read:xS.read,write:xS.write}})],i$.prototype,"measureOperation",null),x([D({json:{read:!0}})],i$.prototype,"is3D",void 0),i$=lNe=x([Qe("esri.rest.support.ImagePointParameters")],i$);const Xhr=i$;var uNe;let J0=uNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]=i.toJSON())}set locations(i){if(i?.length){const e=new Oh({spatialReference:i[0].spatialReference});e.points=i.map(t=>[t.x,t.y]),this._set("locations",i),this.geometry=e}}clone(){return new uNe(li({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};x([D({types:Ff,json:{read:Ro}})],J0.prototype,"geometry",void 0),x([ur("geometry")],J0.prototype,"writeGeometry",null),x([D()],J0.prototype,"locations",null),x([D({type:String,json:{type:UP.jsonValues,read:UP.read,write:UP.write}})],J0.prototype,"interpolation",void 0),x([D({type:Qw,json:{write:!0}})],J0.prototype,"mosaicRule",void 0),x([D({type:[String],json:{write:!0}})],J0.prototype,"outFields",void 0),x([D({type:$i,json:{write:!0}})],J0.prototype,"pixelSize",void 0),x([D({type:String,json:{write:!0}})],J0.prototype,"raster",void 0),x([D({type:Boolean,json:{write:!0}})],J0.prototype,"returnFirstValueOnly",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sampleDistance",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sampleCount",void 0),x([D({type:Number,json:{write:!0}})],J0.prototype,"sliceId",void 0),x([D({type:Eg,json:{read:{source:"time"},write:{target:"time"}}})],J0.prototype,"timeExtent",void 0),J0=uNe=x([Qe("esri.rest.support.ImageSampleParameters")],J0);const Jhr=J0;let r$=class extends xs(Ci){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(e,t,r){t.geometries=e?.length?{geometryType:ah(e[0]),geometries:e.map(n=>({...n.toJSON(),spatialReference:void 0}))}:null}};x([D({types:[Ff]})],r$.prototype,"geometries",void 0),x([ur("geometries")],r$.prototype,"writeGeometries",null),x([D({type:[ms],json:{write:!0}})],r$.prototype,"rasterIds",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],r$.prototype,"outSpatialReference",void 0),r$=x([Qe("esri.rest.support.ImageToMapMultirayParameters")],r$);const Khr=r$;let oO=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]={...e.toJSON(),spatialReference:void 0})}};x([D({types:Ff,json:{read:Ro,write:!0}})],oO.prototype,"geometry",void 0),x([ur("geometry")],oO.prototype,"writeGeometry",null),x([D({json:{write:!0}})],oO.prototype,"rasterId",void 0),x([D({type:Xi,json:{name:"outSR",write:!0}})],oO.prototype,"outSpatialReference",void 0),x([D({json:{name:"options.DOff",write:!0}})],oO.prototype,"depthOffset",void 0),x([D({json:{name:"options.Adjust",write:!0}})],oO.prototype,"adjust",void 0),oO=x([Qe("esri.rest.support.ImageToMapParameters")],oO);const Zhr=oO;let rge=class extends xs(Ci){constructor(){super(...arguments),this.referenceUri=null}};x([D({type:String,json:{name:"uri",write:!0}})],rge.prototype,"referenceUri",void 0),rge=x([Qe("esri.rest.support.ImageUrlParameters")],rge);const Qhr=rge;let n$=class extends xs(Ci){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(e,t,r){e!=null&&(t.geometryType=ah(e),t[r]=JSON.stringify(e))}};x([D({types:Ff,json:{read:Ro,write:!0}})],n$.prototype,"geometry",void 0),x([ur("geometry")],n$.prototype,"writeGeometry",null),x([D({json:{write:!0}})],n$.prototype,"rasterId",void 0),x([D({json:{name:"options.VisibleOnly",write:!0}})],n$.prototype,"visibleOnly",void 0),n$=x([Qe("esri.rest.support.MapToImageParameters")],n$);const edr=n$;var cNe;let QG=cNe=class extends Ci{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,e,t){i!=null&&(e.geometryType=ah(i),e[t]={...i.toJSON(),spatialReference:void 0})}clone(){const i=li({geometry:this.geometry,rasterId:this.rasterId});return new cNe(i)}};x([D({types:Ff,json:{name:"fromGeometry",read:Ro,write:!0}})],QG.prototype,"geometry",void 0),x([ur("geometry")],QG.prototype,"writeGeometry",null),x([D({json:{write:!0}})],QG.prototype,"rasterId",void 0),QG=cNe=x([Qe("esri.rest.support.MeasureFromImageParameters")],QG);const oat=QG,SC=()=>di.getLogger("esri.views.2d.engine.flow.dataUtils"),tdr=10;async function FHe(i,e,t,r){const n=performance.now(),s=idr(e,t),o=performance.now(),a=ndr(e,s,t.width,t.height),l=performance.now(),u=odr(a),c=performance.now(),h=i==="Streamlines"?adr(u,tdr):ldr(u),p=performance.now();return yi("esri-2d-profiler")&&(SC().info("I.1","_createFlowFieldFromData (ms)",Math.round(o-n)),SC().info("I.2","_getStreamlines (ms)",Math.round(l-o)),SC().info("I.3","createAnimatedLinesData (ms)",Math.round(c-l)),SC().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-c)),SC().info("I.5","createFlowMesh (ms)",Math.round(p-n)),SC().info("I.6","Mesh size (bytes)",h.vertexData.buffer.byteLength+h.indexData.buffer.byteLength)),await Promise.resolve(),hn(r),h}function idr(i,e){const t=sdr(e.data,e.width,e.height,i.smoothing);return i.interpolate?(r,n)=>{const s=Math.floor(r),o=Math.floor(n);if(s<0||s>=e.width)return[0,0];if(o<0||o>=e.height)return[0,0];const a=r-s,l=n-o,u=s,c=o,h=s{const s=Math.round(r),o=Math.round(n);return s<0||s>=e.width||o<0||o>=e.height?[0,0]:[t[2*(o*e.width+s)],t[2*(o*e.width+s)+1]]}}function rdr(i,e,t,r,n,s,o,a,l){const u=[];let c=t,h=r,p=0,[m,v]=e(c,h);m*=i.velocityScale,v*=i.velocityScale;const w=Math.sqrt(m*m+v*v);let S,I;u.push({x:c,y:h,t:p,speed:w});for(let R=0;Ri.maxTurnAngle)return u;if(i.collisions){const Y=Math.round(c*l),K=Math.round(h*l);if(Y<0||Y>o-1||K<0||K>a-1)return u;const Q=s[K*o+Y];if(Q!==-1&&Q!==n)return u;s[K*o+Y]=n}u.push({x:c,y:h,t:p,speed:B}),S=$,I=V}return u}function ndr(i,e,t,r){const n=[],s=new VC,o=1/Math.max(i.lineCollisionWidth,1),a=Math.round(t*o),l=Math.round(r*o),u=new Int32Array(a*l);for(let h=0;hh.sort-p.sort);for(const{x:h,y:p}of c)if(s.getFloat()=e)continue;const v=s[m+n];h+=v*i[2*(u*e+(c+m))],p+=v*i[2*(u*e+(c+m))+1]}a[2*(u*e+c)]=h,a[2*(u*e+c)+1]=p}const l=new Float32Array(i.length);for(let u=0;u=t)continue;const v=s[m+n];h+=v*a[2*((c+m)*e+u)],p+=v*a[2*((c+m)*e+u)+1]}l[2*(c*e+u)]=h,l[2*(c*e+u)+1]=p}return l}function odr(i,e){const t=new VC,r=i.reduce((l,u)=>l+u.length,0),n=new Float32Array(4*r),s=new Array(i.length);let o=0,a=0;for(const l of i){const u=o;for(const c of l)n[4*o]=c.x,n[4*o+1]=c.y,n[4*o+2]=c.t,n[4*o+3]=c.speed,o++;s[a++]={startVertex:u,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:t.getFloat()}}return{lineVertices:n,lineDescriptors:s}}function adr(i,e){const{lineVertices:r,lineDescriptors:n}=i;let s=0,o=0;for(const m of n)s+=2*m.numberOfVertices,o+=6*(m.numberOfVertices-1);const a=new Float32Array(s*9),l=new Uint32Array(o);let u=0,c=0;function h(){l[c++]=u-2,l[c++]=u,l[c++]=u-1,l[c++]=u,l[c++]=u+1,l[c++]=u-1}function p(m,v,w,S,I,R,L,k){const B=u*9;let $=0;a[B+$++]=m,a[B+$++]=v,a[B+$++]=1,a[B+$++]=w,a[B+$++]=R,a[B+$++]=L,a[B+$++]=S/2,a[B+$++]=I/2,a[B+$++]=k,u++,a[B+$++]=m,a[B+$++]=v,a[B+$++]=-1,a[B+$++]=w,a[B+$++]=R,a[B+$++]=L,a[B+$++]=-S/2,a[B+$++]=-I/2,a[B+$++]=k,u++}for(const m of n){const{totalTime:v,timeSeed:w}=m;let S=null,I=null,R=null,L=null,k=null,B=null;for(let $=0;$0){re=V-S,ne=Y-I;const H=Math.sqrt(re*re+ne*ne);if(re/=H,ne/=H,$>1){let Z=re+k,ae=ne+B;const fe=Math.sqrt(Z*Z+ae*ae);Z/=fe,ae/=fe;const be=Math.min(1/(Z*re+ae*ne),e);Z*=be,ae*=be,de=-ae,pe=Z}else de=-ne,pe=re;de!==null&&pe!==null&&(p(S,I,R,de,pe,v,w,Q),h())}S=V,I=Y,R=K,k=re,B=ne,L=Q}p(S,I,R,-B,k,v,w,L)}return{vertexData:a,indexData:l}}function ldr(i){const{lineVertices:n,lineDescriptors:s}=i;let o=0,a=0;for(const H of s){const Z=H.numberOfVertices-1;o+=4*Z*2,a+=6*Z*2}const l=new Float32Array(o*16),u=new Uint32Array(a);let c,h,p,m,v,w,S,I,R,L,k,B,$,V,Y=0,K=0;function Q(){u[K++]=Y-8,u[K++]=Y-7,u[K++]=Y-6,u[K++]=Y-7,u[K++]=Y-5,u[K++]=Y-6,u[K++]=Y-4,u[K++]=Y-3,u[K++]=Y-2,u[K++]=Y-3,u[K++]=Y-1,u[K++]=Y-2}function re(H,Z,ae,fe,be,_e,Ie,Te,Be,Ve,$e,tt,yt,Ct){const ot=Y*16;let vt=0;for(const At of[1,2])for(const Je of[1,2,3,4])l[ot+vt++]=H,l[ot+vt++]=Z,l[ot+vt++]=ae,l[ot+vt++]=fe,l[ot+vt++]=Ie,l[ot+vt++]=Te,l[ot+vt++]=Be,l[ot+vt++]=Ve,l[ot+vt++]=At,l[ot+vt++]=Je,l[ot+vt++]=yt,l[ot+vt++]=Ct,l[ot+vt++]=be/2,l[ot+vt++]=_e/2,l[ot+vt++]=$e/2,l[ot+vt++]=tt/2,Y++}function ne(H,Z){let ae=R+k,fe=L+B;const be=Math.sqrt(ae*ae+fe*fe);ae/=be,fe/=be;const _e=R*ae+L*fe;ae/=_e,fe/=_e;let Ie=k+$,Te=B+V;const Be=Math.sqrt(Ie*Ie+Te*Te);Ie/=Be,Te/=Be;const Ve=k*Ie+B*Te;Ie/=Ve,Te/=Ve,re(c,h,p,m,-fe,ae,v,w,S,I,-Te,Ie,H,Z),Q()}function de(H,Z,ae,fe,be,_e){if(R=k,L=B,k=$,B=V,R==null&&L==null&&(R=k,L=B),v!=null&&w!=null){$=H-v,V=Z-w;const Ie=Math.sqrt($*$+V*V);$/=Ie,V/=Ie}R!=null&&L!=null&&ne(be,_e),c=v,h=w,p=S,m=I,v=H,w=Z,S=ae,I=fe}function pe(H,Z){R=k,L=B,k=$,B=V,R==null&&L==null&&(R=k,L=B),R!=null&&L!=null&&ne(H,Z)}for(const H of s){c=null,h=null,p=null,m=null,v=null,w=null,S=null,I=null,R=null,L=null,k=null,B=null,$=null,V=null;const{totalTime:Z,timeSeed:ae}=H;for(let fe=0;fe=t||(R.data[2*(B*t+L+$)]=k.data[2*(B*k.width+$)],R.data[2*(B*t+L+$)+1]=k.data[2*(B*k.width+$)+1],R.mask[B*t+L+$]=k.mask[B*k.width+$]);L+=k.width}return yi("esri-2d-profiler")&&SC().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),R}async function uat(i,e,t,r,n,s){const o={requestProjectedLocalDirections:!0,signal:s};if(n!=null&&(o.timeExtent=n),i.type==="imagery"){await i.load({signal:s});const u=i.rasterInfo.dataType,c=await i.fetchImage(e,t,r,o);return c?.pixelData?.pixelBlock==null?{data:new Float32Array(t*r*2),mask:new Uint8Array(t*r),width:t,height:r}:aat(u,c.pixelData.pixelBlock)}await i.load({signal:s});const a=i.serviceRasterInfo.dataType,l=await i.fetchPixels(e,t,r,o);return l?.pixelBlock==null?{data:new Float32Array(t*r*2),mask:new Uint8Array(t*r),width:t,height:r}:aat(a,l.pixelBlock)}const udr=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),cdr=ECt(Gd,{min:0,max:255});function hdr(i){if(!i)return null;const e=JSON.stringify(i).match(/"rasterFunction":"(.*?")/gi),t=e?.map(r=>r.replace('"rasterFunction":"',"").replace('"',""));return t?t.join("/"):null}const ddr=i=>{let e=class extends i{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new Ap({layer:this}))}readServiceSupportsMosaicRule(r,n){return this._isMosaicRuleSupported(n)}get _rasterFunctionNamesIndex(){const r=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(n=>{r.set(n.name.toLowerCase().replaceAll(/ /gi,"_"),n.name)}),r}readBandIds(r,n){if(Array.isArray(r)&&r.length>0&&r.every(s=>typeof s=="number"))return r}readCapabilities(r,n){return this._readCapabilities(n)}writeCompressionQuality(r,n,s){r!=null&&this.format!=="lerc"&&(n[s]=r)}writeCompressionTolerance(r,n,s){this.format==="lerc"&&r!=null&&(n[s]=r)}readDefaultMosaicRule(r,n){return this._serviceSupportsMosaicRule?Qw.fromJSON(n):null}get fieldsIndex(){return this.fields?new Cd(this.fields):null}set format(r){r&&udr.has(r.toLowerCase())&&this._set("format",r.toLowerCase())}readFormat(r,n){return n.serviceDataType==="esriImageServiceDataTypeVector-UV"||n.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(r,n){return n.minLOD!=null&&n.maxLOD!=null?r:0}readMaxScale(r,n){return n.minLOD!=null&&n.maxLOD!=null?r:0}set mosaicRule(r){let n=r;n?.mosaicMethod&&(n=Qw.fromJSON({...n.toJSON(),mosaicMethod:n.mosaicMethod,mosaicOperation:n.mosaicOperation})),this._set("mosaicRule",n)}readMosaicRule(r,n){const s=r||n.mosaicRule;return s?Qw.fromJSON(s):this._isMosaicRuleSupported(n)?Qw.fromJSON(n):null}writeMosaicRule(r,n,s){let o=this.mosaicRule;const a=this.definitionExpression;o?a&&a!==o.where&&(o=o.clone(),o.where=a):a&&(o=new Qw({where:a})),this._isValidCustomizedMosaicRule(o)&&(n[s]=o.toJSON())}writeNoData(r,n,s){r!=null&&typeof r=="number"&&(n[s]=cdr(r))}readObjectIdField(r,n){return r||(r=n.fields.find(o=>o.type==="esriFieldTypeOID"||o.type==="oid")?.name),r}get parsedUrl(){return Yo(this.url)}readSourceType(r,n){return this._isMosaicDataset(n)?"mosaic-dataset":"raster-dataset"}set renderer(r){this.loaded&&(r=this._configRenderer(r)),this._set("renderer",r)}readRenderer(r,n,s){const o=n?.layerDefinition?.drawingInfo?.renderer,a=vRt(o,s);return a==null?null:(a.type==="vector-field"&&n.symbolTileSize&&!o.symbolTileSize&&(a.symbolTileSize=n.symbolTileSize),bRt(a)||di.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),a)}writeRenderer(r,n,s){n.layerDefinition=n.layerDefinition||{},n.layerDefinition.drawingInfo=n.layerDefinition.drawingInfo||{},n.layerDefinition.drawingInfo.renderer=r.toJSON(),r.type==="vector-field"&&(n.symbolTileSize=r.symbolTileSize)}get rasterFields(){const r=this._rasterAttributeTableFieldPrefix,n=new Fo({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new Fo({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),o=new Fo({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let a=this.fields?li(this.fields):[];a.push(s),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&a.push(n),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(u=>u.name.toLowerCase()==="none")&&a.push(o),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(u=>u.name.toLowerCase()!=="none").forEach(u=>{a.push(new Fo({name:"Raster.ServicePixelValue."+u.name,alias:u.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(a.push(new Fo({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),a.push(new Fo({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:l}=this.rasterInfo??{};if(l!=null){const u=l.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const h=li(c);return h.name=r+c.name,h});a=a.concat(u)}return a}get renderingRule(){return ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(r){ty(di.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",r)}set rasterFunction(r){let n=r;n?.rasterFunction&&(n=kl.fromJSON({...n.toJSON(),rasterFunction:n.rasterFunction,rasterFunctionArguments:n.rasterFunctionArguments})),this._set("rasterFunction",n)}readRasterFunction(r,n){const s=n.rasterFunctionInfos;return n.renderingRule||s?.length&&s[0].name!=="None"?this._isRFTJson(n.renderingRule)?kl.fromJSON({rasterFunctionDefinition:n.renderingRule}):kl.fromJSON(n.renderingRule||{rasterFunctionInfos:n.rasterFunctionInfos}):null}readSpatialReference(r,n){const s=r||n.extent.spatialReference;return s?Xi.fromJSON(s):null}readPixelType(r){return zV.fromJSON(r)||r}writePixelType(r,n,s){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(n[s]=zV.toJSON(r))}readVersion(r,n){let s=n.currentVersion;return s||(s=n.hasOwnProperty("fields")||n.hasOwnProperty("timeInfo")?10:9.3),s}applyFilter(r){let n=r;return this.pixelFilter&&(n=this._clonePixelData(r),this.pixelFilter(n)),n}async applyRenderer(r,n){let s=r;const{renderer:o,symbolizer:a,pixelFilter:l,bandIds:u}=this;if(!this._isPicture()&&o&&a&&!l){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(o.toJSON()),h=this._rasterJobHandler.instance;if(h){c&&(a.bind(),await h.updateSymbolizer(a,n),this._cachedRendererJson=o.toJSON());const p=await h.symbolize({bandIds:u,...r},n);s={extent:r.extent,pixelBlock:p}}else s={extent:r.extent,pixelBlock:a.symbolize({bandIds:u,...r})}}return s}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeAngles)throw new qe("imagery-layer:compute-angles","this operation is not supported on the input image service");return r=Cu(Uhr,r).clone(),Kcr(this.url,r,this._getRequestOptions(n))}async computePixelSpaceLocations(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputePixelLocation)throw new qe("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return r=Cu(Yhr,r).clone(),Zcr(this.url,r,this._getRequestOptions(n))}async computeHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeHistograms)throw new qe("imagery-layer:compute-histograms","this operation is not supported on the input image service");return r=Cu(ige,r).clone(),this._applyMosaicAndRenderingRules(r),ehr(this.url,r,this._getRequestOptions(n))}async computeStatisticsHistograms(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsComputeStatisticsHistograms)throw new qe("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return r=Cu(ige,r).clone(),this._applyMosaicAndRenderingRules(r),Qcr(this.url,r,this._getRequestOptions(n))}async measureHeight(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(r.operationType==="base-and-top"?s.mensuration.supportsHeightFromBaseAndTop:r.operationType==="base-and-top-shadow"?s.mensuration.supportsHeightFromBaseAndTopShadow:s.mensuration.supportsHeightFromTopAndTopShadow))throw new qe("imagery-layer:measure-height","this operation is not supported on the input image service");return r=Cu(qhr,r).clone(),this._applyMosaicAndRenderingRules(r),ihr(this.url,r,this._getRequestOptions(n))}async measureAreaAndPerimeter(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsAreaAndPerimeter&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return r=Cu(zhr,r).clone(),this._applyMosaicAndRenderingRules(r),rhr(this.url,r,this._getRequestOptions(n))}async measureDistanceAndAngle(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsDistanceAndAngle&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return r=Cu(Hhr,r).clone(),this._applyMosaicAndRenderingRules(r),shr(this.url,r,this._getRequestOptions(n))}async measurePointOrCentroid(r,n){const s=await this._fetchCapabilities(n?.signal);if(!(s.mensuration.supportsPointOrCentroid&&(!r.is3D||s.mensuration.supports3D)))throw new qe("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return r=Cu(Xhr,r).clone(),this._applyMosaicAndRenderingRules(r),nhr(this.url,r,this._getRequestOptions(n))}async measureLengthFromImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMeasureFromImage)throw new qe("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(r.geometry.type!=="polyline")throw new qe("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return r=Cu(oat,r).clone(),ohr(this.url,r,this._getRequestOptions(n))}async measureAreaFromImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMeasureFromImage)throw new qe("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(r.geometry.type!=="polygon")throw new qe("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return r=Cu(oat,r).clone(),ahr(this.url,r,this._getRequestOptions(n))}getField(r){const{fieldsIndex:n}=this;return n?.get(r)}getFieldDomain(r,n){const s=this.getField(r);return s?s.domain:null}async fetchImage(r,n,s,o={}){if(r==null||n==null||s==null)throw new qe("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const h=await this._generateRasterInfo(this.rasterFunction,{signal:o.signal});h&&(this.rasterInfo=h)}const a=this.getExportImageServiceParameters(r,n,s,o.timeExtent);if(a==null){if(o.requestAsImageElement&&this._canRequestImageElement(this.format)){const I=document.createElement("canvas");return I.width=n,I.height=s,o.returnImageBitmap?{imageBitmap:await E1e(I,`${t(this.parsedUrl)}/exportImage`,o.signal)}:{imageOrCanvasElement:I}}const{bandIds:h,rasterInfo:p}=this,m=(h?.length||p.bandCount)??0,v=n*s,w=p.pixelType,S=[];for(let I=0;I=10.3?r?.rasterFunction:null})}).then(n=>n.data)}fetchRasterAttributeTable(r){return this.version<10.1?Promise.reject(new qe("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):zi(t(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?r?.rasterFunction:null})}).then(n=>du.fromJSON(n.data))}getCatalogItemRasterInfo(r,n){const s={...n,query:this._getQueryParams()};return jhr(t(this.parsedUrl),r,s)}async getCatalogItemICSInfo(r,n){const{data:s}=await zi(t(this.parsedUrl)+"/"+r+"/info/ics",{query:this._getQueryParams(),...n}),o=s?.ics;if(!o)return;let a=null;try{a=(await zi(t(this.parsedUrl)+"/"+r+"/info",{query:this._getQueryParams(),...n})).data.extent}catch{}if(!a||!a.spatialReference)return{ics:o,icsToPixelTransform:null,icsExtent:null,northDirection:null};const l=this.version>=10.7?zi(t(this.parsedUrl)+"/"+r+"/info/icstopixel",{query:this._getQueryParams(),...n}).then(Z=>Z.data).catch(()=>({})):{},u=a.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[a]}),inSR:Hv(u),outSR:"0:"+r},h=zi(t(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...n}).then(Z=>Z.data).catch(()=>({})),p=5,m=(a.xmin+a.xmax)/2,v=(a.ymax-a.ymin)/(p+1),w=a.ymin+v,S=[];for(let Z=0;ZZ.data).catch(()=>({})),L=await Promise.all([l,h,R]);let k=L[0].ipxf;if(k==null){const Z=o.geodataXform?.xf_0;Z?.name?.toLowerCase()==="topup"&&Z?.coefficients?.length===6&&(k={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:Z.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const B=hr.fromJSON(L[1]?.geometries?.[0]);B&&(B.spatialReference=new Xi({wkid:0,imageCoordinateSystem:o}));const $=L[2].geometries?L[2].geometries.filter(Z=>Z?.x!=null&&Z.y!=null&&Z.x!=="NaN"&&Z.y!=="NaN"):[],V=$.length;if(V<3)return{ics:o,icsToPixelTransform:k,icsExtent:B,northDirection:null};let Y=0,K=0,Q=0,re=0;for(let Z=0;Z$[0].x,H=$[p-1].y>$[0].y;return ne===1/0?de=H?90:270:ne===0?de=pe?0:180:ne>0?de=pe?180*Math.atan(ne)/Math.PI:180*Math.atan(ne)/Math.PI+180:ne<0&&(de=H?180+180*Math.atan(ne)/Math.PI:360+180*Math.atan(ne)/Math.PI),{ics:o,icsToPixelTransform:k,icsExtent:B,northDirection:de}}async generateRasterInfo(r,n){if(r=Cu(kl,r),this.serviceRasterInfo&&(!r||r.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(r)))return this.serviceRasterInfo;const s=hdr(r);if(!s)throw new qe("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const o={...n,query:this._getQueryParams()},a=Bhr(t(this.parsedUrl),r,o);this._functionRasterInfos[s]=a;try{return await a}catch(l){throw this._functionRasterInfos[s]=null,l}}getExportImageServiceParameters(r,n,s,o){r=r.clone().shiftCentralMeridian();const a=BY(r.spatialReference,t(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const l=this.exportImageServiceParameters.toJSON(),{bandIds:u,noData:c}=l;let{renderingRule:h}=l;const p=this.rasterFunction?.rasterFunctionDefinition,m=!this.renderer||this.renderer.type==="raster-stretch";if(u?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&m){const S={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:u}};if(h.rasterFunction==="Stretch")S.rasterFunctionArguments.Raster=h.rasterFunctionArguments.Raster,h.rasterFunctionArguments.Raster=S;else if(h.rasterFunction==="Colormap"){const I=h.rasterFunctionArguments.Raster;I?.rasterFunction==="Stretch"?(S.rasterFunctionArguments.Raster=I.rasterFunctionArguments.Raster,I.rasterFunctionArguments.Raster=S):(S.rasterFunctionArguments.Raster=I,h.rasterFunctionArguments.Raster=S)}else S.rasterFunctionArguments.Raster=h,h=S;l.bandIds=void 0}else l.bandIds=u?.join(",");c instanceof Array&&c.length>0&&(l.noData=c.join(","));const v=this._processMultidimensionalIntersection(null,o,this.exportImageServiceParameters.mosaicRule);if(v.isOutSide)return null;l.mosaicRule=v.mosaicRule!=null?JSON.stringify(v.mosaicRule):null,o=v.timeExtent,l.renderingRule=this._getRenderingRuleString(kl.fromJSON(h));const w={};if(o!=null){const{start:S,end:I}=o.toJSON();S&&I&&S===I?w.time=""+S:S==null&&I==null||(w.time=`${S??"null"},${I??"null"}`)}return{bbox:r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:a,imageSR:a,size:n+","+s,...l,...w}}async getSamples(r,n){if(!(await this._fetchCapabilities(n?.signal))?.operations.supportsGetSamples)throw new qe("imagery-layer:get-samples","getSamples operation is not supported on the input image service");r=Cu(Jhr,r).clone();const{raster:o}=this;return o&&r.raster==null&&(r.raster=o),thr(this.url,r,this._getRequestOptions(n))}async identify(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsIdentify)throw new qe("imagery-layer:identify","identify operation is not supported on the input image service");r=Cu(sat,r).clone(),this.version<10.91&&r.geometry?.type==="extent"&&(r.geometry=$s.fromExtent(r.geometry));const s=this._processMultidimensionalIntersection(r.geometry,r.timeExtent,r.mosaicRule||this.mosaicRule);if(s.isOutSide)throw new qe("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");r.timeExtent=s.timeExtent,r.mosaicRule=s.mosaicRule;const{raster:o,rasterFunction:a}=this;return a&&r.rasterFunction==null&&(r.rasterFunction=a),o&&r.raster==null&&(r.raster=o),Jot(this.url,r,this._getRequestOptions(n))}async imageToMap(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsImageToMap)throw new qe("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return r=Cu(Zhr,r),chr(t(this.parsedUrl),r,this._getRequestOptions(n))}async imageToMapMultiray(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsImageToMapMultiray)throw new qe("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return r=Cu(Khr,r),hhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async mapToImage(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsMapToImage)throw new qe("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return r=Cu(edr,r),dhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async findImages(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsFindImages)throw new qe("imagery-layer:find-images","findImages operation is not supported on the input image service");return r=Cu(Ghr,r),fhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async getImageUrl(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsGetImageUrl)throw new qe("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return r=Cu(Qhr,r),phr(t(this.parsedUrl),r,this._getRequestOptions(n))}createQuery(){const r=new Kn;return r.outFields=["*"],r.returnGeometry=!0,r.where=this.definitionExpression||"1=1",r}async queryBoundary(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQueryBoundary)throw new qe("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return r=Cu(Vhr,r??{outSpatialReference:this.spatialReference}).clone(),lhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async queryRasters(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),t9(this.url,r,n)}async queryObjectIds(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),uSe(this.url,r,n)}async queryGPSInfo(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQueryGPSInfo)throw new qe("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return r=Cu(Whr,r??{outSpatialReference:this.spatialReference}).clone(),uhr(t(this.parsedUrl),r,this._getRequestOptions(n))}async queryRasterCount(r,n){return{query:r,requestOptions:n}=await this._prepareForQuery(r,n),DHe(this.url,r,n)}async queryVisibleRasters(r,n){if(!r)throw new qe("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:s,returnDomainValues:o,returnTopmostRaster:a,showNoDataRecords:l}=n||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let u=!1,c=null,h=null;const p="raster.servicepixelvalue",m=this._rasterFunctionNamesIndex;if(r.outFields!=null&&(u=r.outFields.some(B=>!B.toLowerCase().includes(p)),this.version>=10.4)){const B=r.outFields.filter(V=>V.toLowerCase().includes(p)&&V.length>p.length).map(V=>{const Y=V.slice(p.length+1);return[this._updateRenderingRulesFunctionName(Y,m),Y]});c=B.map(V=>new kl({functionName:V[0]})),h=B.map(V=>V[1]);const{rasterFunction:$}=this;c.length===0?$?.functionName?(c.push($),h.push($.functionName)):c=null:$?.functionName&&!c.some(V=>V.functionName===$.functionName)&&(c.push($),h.push($.functionName))}const v=r.outSpatialReference==null||r.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:w}=this;let S=r.timeExtent||this.timeExtent;if(w){const{isOutside:B,intersection:$}=K3e(w,{geometry:r.geometry,timeExtent:r.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(B)throw new qe("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");$?.timeExtent!=null&&(S=$.timeExtent)}const I=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,S);let R=r.geometry;this.version<10.91&&R?.type==="extent"&&(R=$s.fromExtent(R));const L=this._getQueryParams({geometry:R,timeExtent:S,mosaicRule:I,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:s,returnCatalogItems:u,returnGeometry:v,raster:this.raster,maxItemCount:a?1:null});delete L.f;const k=new sat(L);try{await this._generateRasterInfo(this.rasterFunction);const B=await Jot(this.url,k,{signal:n?.signal,query:{...this.customParameters}}),$=r.outFields,V=B.value!=null&&B.value.toLowerCase().includes("nodata");if(!(u&&!v&&B?.catalogItems?.features.length&&(l||!V)))return this._processVisibleRastersResponse(B,{returnDomainValues:o,templateRRFunctionNames:h,showNoDataRecords:l,templateFields:$});const Y=this.objectIdField||"ObjectId",K=B.catalogItems?.features??[],Q=K.map(de=>de.attributes?.[Y]),re=new Kn({objectIds:Q,returnGeometry:!0,outSpatialReference:r.outSpatialReference,outFields:[Y]}),ne=await this.queryRasters(re);return ne?.features?.length&&ne.features.forEach(de=>{K.forEach(pe=>{pe.attributes[Y]===de.attributes[Y]&&(pe.geometry=new $s(de.geometry),r.outSpatialReference!=null&&(pe.geometry.spatialReference=r.outSpatialReference))})}),this._processVisibleRastersResponse(B,{returnDomainValues:o,templateRRFunctionNames:h,showNoDataRecords:l,templateFields:$})}catch{throw new qe("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(r,n){const s=zi(t(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.statistics),o=zi(t(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:r}),signal:n}).then(l=>l.data?.histograms),a=await Promise.all([s,o]);return a[0]&&a[0].forEach(l=>{l.avg=l.mean,l.stddev=l.standardDeviation}),{statistics:a[0]||null,histograms:a[1]||null}}async createFlowMesh(r,n){const s=this._rasterJobHandler.instance;return s?s.createFlowMesh(r,n):FHe(r.meshType,r.simulationSettings,r.flowData,n.signal!=null?n.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(r){const n=r??this.serviceRasterInfo.multidimensionalInfo;return PRt(this.multidimensionalSubset,n)}async _fetchService(r){await this._fetchServiceInfo(r),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const n=this.sourceJSON,s=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):fDt(t(this.parsedUrl),n,{signal:r,query:this._getQueryParams()}).then(l=>(this._set("serviceRasterInfo",l),this._set("multidimensionalInfo",l.multidimensionalInfo),mDt(l,n),l)),o=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:r}):null,a=this._getRasterFunctionInfos();return Promise.all([s,o,a]).then(l=>{l[1]?this._set("rasterInfo",l[1]):this._set("rasterInfo",l[0]),l[2]&&this._set("rasterFunctionInfos",l[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),di.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([Ki(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(h=>{h&&(this.rasterInfo=h)})})]);const{serviceRasterInfo:u}=this;u.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(u)})}_combineMosaicRuleWithTimeExtent(r,n){const s=this.timeInfo,{multidimensionalInfo:o}=this.serviceRasterInfo;if(r==null||o==null||n==null||s?.startField==null)return r;const{startField:a}=s,l=o.variables.some(w=>w.dimensions.some(S=>S.name===a))?a:"StdTime";if(r=r.clone(),this.sourceType==="mosaic-dataset")return r.multidimensionalDefinition=r.multidimensionalDefinition?.filter(w=>w.dimensionName!==l),this._cleanupMultidimensionalDefinition(r);r.multidimensionalDefinition=r.multidimensionalDefinition||[];const u=r.multidimensionalDefinition.filter(w=>w.dimensionName===l),c=n.start!=null?n.start.getTime():null,h=n.end!=null?n.end.getTime():null,p=c==null||h==null||c===h,m=p?[c||h]:[[c,h]],v=this.version>=10.8;if(u.length)u.forEach(w=>{w.dimensionName===l&&(v?(w.dimensionName=null,w.isSlice=!1,w.values=[]):(w.isSlice=p,w.values=m))});else if(!v){const w=r.multidimensionalDefinition.filter(S=>S.variableName!=null&&S.dimensionName==null);w.length?w.forEach(S=>{S.dimensionName=l,S.isSlice=p,S.values=m}):r.multidimensionalDefinition.push(new gR({variableName:"",dimensionName:l,isSlice:p,values:m}))}return this._cleanupMultidimensionalDefinition(r)}_cleanupMultidimensionalDefinition(r){return r==null?null:(r.multidimensionalDefinition&&(r.multidimensionalDefinition=r.multidimensionalDefinition.filter(n=>!(!n.variableName&&!n.dimensionName)),r.multidimensionalDefinition.length===0&&(r.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&r.multidimensionalDefinition==null?null:r)}async _prepareForQuery(r,n){if(!(await this._fetchCapabilities(n?.signal)).operations.supportsQuery)throw new qe("imagery-layer:query-rasters","query operation is not supported on the input image service");return r=r!=null?Cu(Kn,r):this.createQuery(),n=this._getRequestOptions(n),this.raster&&(n.query={...n.query,raster:this.raster}),{query:r,requestOptions:n}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const r=new CRt;this._rasterJobHandler.connectionPromise=r.initialize().then(()=>{this._rasterJobHandler.instance=r},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(r){const{rasterInfo:n,rasterFunction:s}=this;return r.type==="unique-value"&&this._hasRasterFunction(s)&&n?.bandCount===1&&["u8","s8"].includes(n.pixelType)||n!=null&&r!=null&&pcr(n).includes(r.type)}async _fetchCapabilities(r){return this.capabilities||await this._fetchServiceInfo(r),this.capabilities}async _fetchServiceInfo(r){let n=this.sourceJSON;if(!n){const{data:s,ssl:o}=await zi(t(this.parsedUrl),{query:this._getQueryParams(),signal:r});n=s,this.sourceJSON=n,o&&(this.url=this.url.replace(/^http:/i,"https:"))}if(n.capabilities?.toLowerCase().split(",").map(s=>s.trim()).indexOf("tilesonly")>-1)throw new qe("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(n,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(r){return r.serviceSourceType?r.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":r.fields?.length>0}_isMosaicRuleSupported(r){if(!r)return!1;const n=this._isMosaicDataset(r),s=r.currentVersion>=10.71&&r.hasMultidimensions&&!(r.fields?.length>1);return n||s}_isVectorFieldResampleFunction(r){if(r==null)return!1;const{functionName:n,functionArguments:s}=r,o=n?.toLowerCase()==="resample",a=s?.ResampleType||s?.resampleType;return o&&(a===7||a===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(r){const n=this._isPicture(),{rasterInfo:s}=this;if(!n&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&s.bandCount>=3){const a=THe(s);!a||s.bandCount===3&&a[0]===0&&a[1]===1&&a[2]===2||(this.bandIds=a)}r||(r=XLe(s,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const o=KLe(r.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=s):this.symbolizer=new AHe({rendererJSON:o,rasterInfo:s}),this.symbolizer.bind().success||(this.symbolizer=null)}return r}_clonePixelData(r){return r==null?r:{extent:r.extent&&r.extent.clone(),pixelBlock:r.pixelBlock!=null?r.pixelBlock.clone():null}}_getQueryParams(r){r?.renderingRule!=null&&typeof r.renderingRule!="string"&&(r.renderingRule=this._getRenderingRuleString(r.renderingRule));const{raster:n,viewId:s}=this;return{raster:n,viewId:s,f:"json",...r,...this.customParameters}}_getRequestOptions(r){return{...r,query:{...r?.query,...this.customParameters}}}_decodePixelBlock(r,n,s){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:r,options:n}):A1e(r,n,s)}async _getRasterFunctionInfos(r){const n=this.sourceJSON.rasterFunctionInfos;return this.loaded?n:n&&this.version>=10.3?n.length===1&&n[0].name.toLowerCase()==="none"?n:(await zi(t(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:r})).data?.rasterFunctionInfos:null}_canRequestImageElement(r){return!this.pixelFilter&&(!r||r.includes("png"))}async _requestArrayBuffer(r){const{imageProps:n,requestAsImageElement:s,returnImageBitmap:o,signal:a}=r;if(s&&this._canRequestImageElement(n.format)){const w=`${t(this.parsedUrl)}/exportImage`,{data:S}=await zi(w,{responseType:o?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...r.imageServiceParameters}),signal:a});return S instanceof Blob?{imageBitmap:await E1e(S,w,a),params:n}:{imageOrCanvasElement:S,params:n}}const l=this._initJobHandler(),u=zi(t(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...r.imageServiceParameters}),signal:a}),c=(await Promise.all([u,l]))[0].data,h=n.format||"jpgpng";let p=h;if(p!=="bsq"&&p!=="bip"&&(p=YRt(c)),!p)throw new qe("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const m={signal:a};return{pixelData:{pixelBlock:await(h==="gif"||h==="bmp"||h.includes("png")&&(p==="png"||p==="jpg")?A1e(c,{useCanvas:!0,...n},m):this._decodePixelBlock(c,{width:n.width,height:n.height,planes:null,pixelType:null,noDataValue:null,format:h},m)),extent:n.extent},params:n}}_generateRasterInfo(r,n){return this.generateRasterInfo(r,n).catch(()=>null)}_isValidCustomizedMosaicRule(r){return r&&JSON.stringify(r.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(r){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let n=ULe(r,{multidimensionalSubset:this.multidimensionalSubset});if(n!=null&&n.length>0){this.mosaicRule=this.mosaicRule||new Qw;const s=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&n.forEach(o=>o.variableName=""),n=n.filter(({variableName:o,dimensionName:a})=>o&&o!=="*"||a),!s?.length&&n.length&&(this.mosaicRule.multidimensionalDefinition=n)}}_processVisibleRastersResponse(r,n){n=n||{};const s=r.value,{templateRRFunctionNames:o,showNoDataRecords:a,returnDomainValues:l,templateFields:u}=n,c=r.processedValues;let h=r.catalogItems?.features,p=r.properties?.Values?.map(L=>L.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",v=typeof s=="string"&&s.toLowerCase().includes("nodata"),w=[];if(s&&!h&&!v){const L={};L[m]=0,p=[s],h=[new Us(this.fullExtent,null,L)]}if(!h)return[];let S,I,R;this._updateResponseFieldNames(h,u),v&&!a&&(h=[]);for(let L=0;L0&&o&&o.length>0&&o.includes(this.rasterFunction.functionName)?c[o.indexOf(this.rasterFunction.functionName)]:s,I.toLowerCase()==="nodata"&&!a)continue;const k="Raster.ItemPixelValue",B="Raster.ServicePixelValue";S.attributes[k]=I,S.attributes[B]=R,this._updateFeatureWithMagDirValues(S,I);const $=this.fields&&this.fields.length>0;let V=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?$?I:s:R;this.rasterFunction||(V=$?I:s),this._updateFeatureWithRasterAttributeTableValues(S,V)}if(S.sourceLayer=S.layer=this,l&&this._updateFeatureWithDomainValues(S),o&&c&&o.length===c.length)for(let k=0;kc.name).find(c=>c.toLowerCase()==="value");if(!l)return;const u=o.filter(c=>c.attributes[l]===(n!=null?parseInt(n,10):null));u&&u[0]&&a.forEach(c=>{const h=this._rasterAttributeTableFieldPrefix+c.name;r.attributes[h]=u[0].attributes[c.name]})}_updateFeatureWithMagDirValues(r,n){if(!this._isVectorDataSet())return;const s=n.split(/,\s*/).map(c=>parseFloat(c)),o=s.map(c=>[c]),a=s.map(c=>({minValue:c,maxValue:c,noDataValue:null})),l=new Br({height:1,width:1,pixelType:"f32",pixels:o,statistics:a});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:l,extent:new hr(0,0,0,0,this.spatialReference)});const u=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[l.pixels[0][0],l.pixels[1][0]]:eSe([l.pixels[0][0],l.pixels[1][0]]);r.attributes["Raster.Magnitude"]=u[0],r.attributes["Raster.Direction"]=u[1]}_updateFeatureWithDomainValues(r){const n=this.fields&&this.fields.filter(s=>s.domain&&s.domain.type==="coded-value");n?.forEach(s=>{const o=r.attributes[s.name];if(o!=null){const a=s.domain.codedValues.find(l=>l.code===o);a&&(r.attributes[s.name]=a.name)}})}_updateResponseFieldNames(r,n){if(!n||n.length<1)return;const s=this.fieldsIndex;s!=null&&r.forEach(o=>{if(o?.attributes)for(const a of n){const l=s.get(a)?.name;l&&l!==a&&(o.attributes[a]=o.attributes[l],delete o.attributes[l])}})}_getRenderingRuleString(r){if(r){let n=r.toJSON();return n=n.rasterFunctionDefinition??n,(n.thumbnail||n.thumbnailEx)&&(n.thumbnail=n.thumbnailEx=null),JSON.stringify(n)}return null}_hasRasterFunction(r){return r?.functionName!=null&&r.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(r,n){if(!r||r.length<1)return;if(r==="Raw")return r.replace("Raw","None");const s=r.toLowerCase().replaceAll(/ /gi,"_");return n.has(s)?n.get(s):r}_isRFTJson(r){return r?.name&&r.arguments&&r.function&&r.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(r){const{raster:n,mosaicRule:s,rasterFunction:o}=this;o&&r instanceof ige&&r.rasterFunction==null&&(r.rasterFunction=o),s&&r.mosaicRule==null&&(r.mosaicRule=s),n&&r.raster==null&&(r.raster=n)}_readCapabilities(r){const n=r.capabilities?r.capabilities.toLowerCase().split(",").map(I=>I.trim()):["image","catalog"],{currentVersion:s,advancedQueryCapabilities:o,maxRecordCount:a}=r,l=n.includes("image"),u=r.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!r.spatialReference&&!r.extent?.spatialReference),h=n.includes("edit"),p=n.includes("mensuration")&&c,m=r.mensurationCapabilities==null?[]:r.mensurationCapabilities.toLowerCase().split(",").map(I=>I.trim()),v=p&&m.includes("basic"),w=this._isMosaicDataset(r)&&n.includes("catalog"),S=n.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:l,supportsExportImage:l,supportsIdentify:l,supportsImageToMap:s>=11.2&&w,supportsImageToMapMultiray:s>=11.2&&w,supportsMapToImage:s>=11.2&&w,supportsFindImages:s>=11.2&&w,supportsGetImageUrl:s>=11.2&&S,supportsMeasure:p,supportsMeasureFromImage:s>=11.2,supportsDownload:S,supportsQuery:w&&r.fields&&r.fields.length>0,supportsGetSamples:s>=10.2&&l,supportsProject:s>=10.3&&l,supportsComputeStatisticsHistograms:s>=10.4&&l,supportsQueryBoundary:s>=10.6&&l,supportsCalculateVolume:s>=10.7&&u,supportsComputePixelLocation:s>=10.7&&w,supportsComputeAngles:s>=10.91,supportsQueryGPSInfo:s>=11.2&&w,supportsAdd:h,supportsDelete:h,supportsEditing:h,supportsUpdate:h,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:a,maxRecordCountFactor:void 0,supportsStatistics:!!o?.supportsStatistics,supportsOrderBy:!!o?.supportsOrderBy,supportsDistinct:!!o?.supportsDistinct,supportsPagination:!!o?.supportsPagination,supportsStandardizedQueriesOnly:!!o?.useStandardizedQueries,supportsPercentileStatistics:!!o?.supportsPercentileStatistics,supportsCentroid:!!o?.supportsReturningGeometryCentroid,supportsDistance:!!o?.supportsQueryWithDistance,supportsExtent:!!o?.supportsReturningQueryExtent,supportsGeometryProperties:!!o?.supportsReturningGeometryProperties,supportsHavingClause:!!o?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!o?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:v,supportsAreaAndPerimeter:v,supportsPointOrCentroid:v,supportsHeightFromBaseAndTop:p&&m.includes("base-top height"),supportsHeightFromBaseAndTopShadow:p&&m.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:p&&m.includes("top-top shadow height"),supports3D:p&&m.includes("3d")}}}};function t(r){return r?.path??""}return x([D({clonable:!1})],e.prototype,"_functionRasterInfos",void 0),x([D({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),x([D({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),x([D({readOnly:!0})],e.prototype,"_serviceSupportsMosaicRule",void 0),x([Mi("_serviceSupportsMosaicRule",["currentVersion","fields"])],e.prototype,"readServiceSupportsMosaicRule",null),x([D({readOnly:!0})],e.prototype,"_rasterAttributeTableFieldPrefix",void 0),x([D({readOnly:!0})],e.prototype,"_rasterFunctionNamesIndex",null),x([D()],e.prototype,"adjustAspectRatio",void 0),x([D({type:[ms],json:{write:!0}})],e.prototype,"bandIds",void 0),x([Mi("bandIds")],e.prototype,"readBandIds",null),x([D({readOnly:!0,json:{read:!1}})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities","currentVersion","serviceDataType"])],e.prototype,"readCapabilities",null),x([D({type:Number})],e.prototype,"compressionQuality",void 0),x([ur("compressionQuality")],e.prototype,"writeCompressionQuality",null),x([D({type:Number})],e.prototype,"compressionTolerance",void 0),x([ur("compressionTolerance")],e.prototype,"writeCompressionTolerance",null),x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],e.prototype,"defaultMosaicRule",void 0),x([Mi("defaultMosaicRule",["defaultMosaicMethod"])],e.prototype,"readDefaultMosaicRule",null),x([D({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],e.prototype,"definitionExpression",void 0),x([D({readOnly:!0,constructOnly:!0})],e.prototype,"exportImageServiceParameters",void 0),x([D()],e.prototype,"rasterInfo",void 0),x([D({readOnly:!0,type:[Fo]})],e.prototype,"fields",void 0),x([D({readOnly:!0})],e.prototype,"fieldsIndex",null),x([D({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],e.prototype,"format",null),x([Mi("service","format",["serviceDataType"])],e.prototype,"readFormat",null),x([D({type:hr})],e.prototype,"fullExtent",void 0),x([D({readOnly:!0})],e.prototype,"hasMultidimensions",void 0),x([D({json:{read:{source:"maxImageHeight"}}})],e.prototype,"imageMaxHeight",void 0),x([D({json:{read:{source:"maxImageWidth"}}})],e.prototype,"imageMaxWidth",void 0),x([D({type:String,json:{type:UP.jsonValues,read:UP.read,write:UP.write}})],e.prototype,"interpolation",void 0),x([D()],e.prototype,"minScale",void 0),x([Mi("service","minScale")],e.prototype,"readMinScale",null),x([D()],e.prototype,"maxScale",void 0),x([Mi("service","maxScale")],e.prototype,"readMaxScale",null),x([D({type:Qw})],e.prototype,"mosaicRule",null),x([Mi("mosaicRule",["mosaicRule","defaultMosaicMethod"])],e.prototype,"readMosaicRule",null),x([ur("mosaicRule")],e.prototype,"writeMosaicRule",null),x([D()],e.prototype,"multidimensionalInfo",void 0),x([D({type:TRt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),x([D({json:{type:ms}})],e.prototype,"noData",void 0),x([ur("noData")],e.prototype,"writeNoData",null),x([D({type:String,json:{type:Gie.jsonValues,read:Gie.read,write:Gie.write}})],e.prototype,"noDataInterpretation",void 0),x([D({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],e.prototype,"objectIdField",void 0),x([Mi("objectIdField")],e.prototype,"readObjectIdField",null),x([D({readOnly:!0})],e.prototype,"geometryType",void 0),x([D({})],e.prototype,"typeIdField",void 0),x([D({})],e.prototype,"types",void 0),x([D({readOnly:!0})],e.prototype,"parsedUrl",null),x([D({type:Function})],e.prototype,"pixelFilter",void 0),x([D()],e.prototype,"raster",void 0),x([D({readOnly:!0})],e.prototype,"sourceType",void 0),x([Mi("sourceType",["serviceSourceType","fields"])],e.prototype,"readSourceType",null),x([D()],e.prototype,"viewId",void 0),x([D({types:S1e,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:T1e,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:r=>({enabled:r&&r.type!=="vector-field"&&r.type!=="flow"})}}}}})],e.prototype,"renderer",null),x([Mi("renderer")],e.prototype,"readRenderer",null),x([ur("renderer")],e.prototype,"writeRenderer",null),x([D({clonable:!1})],e.prototype,"symbolizer",void 0),x([D(aB)],e.prototype,"opacity",void 0),x([D({readOnly:!0})],e.prototype,"rasterFields",null),x([D({constructOnly:!0})],e.prototype,"rasterFunctionInfos",void 0),x([D({type:kl})],e.prototype,"renderingRule",null),x([D({type:kl,json:{name:"renderingRule"}})],e.prototype,"rasterFunction",null),x([Mi("rasterFunction",["renderingRule","rasterFunctionInfos"])],e.prototype,"readRasterFunction",null),x([D({readOnly:!0})],e.prototype,"serviceDataType",void 0),x([D({readOnly:!0,type:Xi})],e.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","extent"])],e.prototype,"readSpatialReference",null),x([D({json:{type:zV.jsonValues}})],e.prototype,"pixelType",void 0),x([Mi("pixelType")],e.prototype,"readPixelType",null),x([ur("pixelType")],e.prototype,"writePixelType",null),x([D({constructOnly:!0,type:W3})],e.prototype,"serviceRasterInfo",void 0),x([D()],e.prototype,"sourceJSON",void 0),x([D(C0)],e.prototype,"url",void 0),x([D({readOnly:!0})],e.prototype,"version",void 0),x([Mi("version",["currentVersion","fields","timeInfo"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.ArcGISImageService")],e),e};let ww=class extends xh(AE(uc(Rc(Yc(ddr(fy(py(Xv(Ql(xs(Il))))))))))){constructor(...e){super(...e),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=xd(async(t,r,n)=>{const{save:s,saveAs:o}=await Promise.resolve().then(()=>FWt);switch(t){case Uc.SAVE:return s(this,r);case Uc.SAVE_AS:return o(this,n,r)}})}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,t,r){const n=this.renderer?.type==="vector-field";t[r]=n?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const t=this.rasterFields,r=this.title,n=new Set;let s=!1,o=!1;this.capabilities&&(s=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,o=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const a=new Set;s&&a.add("raster.itempixelvalue");for(const u of t){const c=u.name.toLowerCase();a.has(c)||c.includes("raster.servicepixelvalue.")||n.add(u.name)}o&&n.add("raster.magnitude").add("raster.direction");const l=p_({fields:t,title:r},{...e,visibleFieldNames:n});return l?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&l.fieldInfos.forEach(({format:u,fieldName:c})=>{u&&/^raster\.(item|service)pixelvalue/i.test(c)&&(u.places=2)}),l}queryFeatures(e,t){return this.queryRasters(e,t).then(r=>{if(r?.features)for(const n of r.features)n.layer=n.sourceLayer=this;return r})}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(Uc.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Uc.SAVE_AS,t,e)}serviceSupportsSpatialReference(e){return Mae(this,e)}write(e,t){if(!this._isPreviewLayer)return super.write(e,t);if(t?.messages){const r=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new qe("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${r}'`,{layer:this}))}return null}};x([D(d_)],ww.prototype,"legendEnabled",null),x([D({type:["show","hide"]})],ww.prototype,"listMode",null),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ww.prototype,"isReference",void 0),x([D({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],ww.prototype,"operationalLayerType",void 0),x([ur("web-map","operationalLayerType")],ww.prototype,"writeOperationalLayerType",null),x([D(h_)],ww.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],ww.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],ww.prototype,"defaultPopupTemplate",null),x([D({readOnly:!0,json:{read:!1}})],ww.prototype,"type",void 0),x([D({readOnly:!0})],ww.prototype,"_isPreviewLayer",null),ww=x([Qe("esri.layers.ImageryLayer")],ww);const gDt=ww,pdr=Object.freeze(Object.defineProperty({__proto__:null,default:gDt},Symbol.toStringTag,{value:"Module"})),yDt=96;function M1e(i,e){const t=i.extent,r=i.width,n=pu(t?.spatialReference);return t&&r?t.width/r*n*mze*yDt:0}function fdr(i,e){return i/(pu(e)*mze*yDt)}function vDt(i,e,t){return mdr(i,e)&&gdr(i,t)}function mdr(i,e){return e===0||W8(i,e)||ie}const _Dt=i=>{let e=class extends i{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,r){const n=r.capabilities&&r.capabilities.split(",").map(R=>R.toLowerCase().trim());if(!n)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const s=this.type,o=s!=="tile"&&!!r.supportsDynamicLayers,a=n.includes("query"),l=n.includes("map"),u=!!r.exportTilesAllowed,c=n.includes("tilemap"),h=n.includes("data"),p=s!=="tile"&&(!r.tileInfo||o),m=s!=="tile"&&(!r.tileInfo||o),v=s!=="tile",w=r.cimVersion&&EY.parse(r.cimVersion),S=w?.since(1,4)??!1,I=w?.since(2,0)??!1;return{operations:{supportsExportMap:l,supportsExportTiles:u,supportsIdentify:a,supportsQuery:h,supportsTileMap:c},exportMap:l?{supportsArcadeExpressionForLabeling:S,supportsSublayersChanges:v,supportsDynamicLayers:o,supportsSublayerVisibility:p,supportsSublayerDefinitionExpression:m,supportsCIMSymbols:I}:null,exportTiles:u?{maxExportTilesCount:+r.maxExportTilesCount}:null}}readVersion(t,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("capabilities")||r.hasOwnProperty("tables")?10:r.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),n}async fetchRelatedService(t){const r=this.portalItem;if(!r||!aot(r))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=r.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(s=>s.find(o=>o.type==="Feature Service")??null,()=>null));const n=await this._relatedFeatureServicePromise;return hn(t),n?{itemId:n.id,url:n.url}:null}async fetchSublayerInfo(t,r){const{source:n}=t;if(this?.portalItem&&this.type==="tile"&&n?.type==="map-layer"&&aot(this.portalItem)&&t.originIdOf("url")Pn.SERVICE)try{const a=await this._fetchAllLayersAndTablesFromService(s),l=r_(s)?.sublayer??n.mapLayerId;o=a.get(l)}catch{}else{let a=t.id;n?.type==="map-layer"&&(a=n.mapLayerId);try{o=(await this.fetchAllLayersAndTables(r)).get(a)}catch{}}return o}async fetchAllLayersAndTables(t){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,t)}async _fetchAllLayersAndTablesFromService(t,r){await this.load(r),this._allLayersAndTablesMap||=new Map;const n=r_(t),s=qh(this._allLayersAndTablesMap,n?.url.path,()=>zi(Iu(n?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(a=>{const l=new Map;for(const u of a.data.layers)l.set(u.id,u);return{result:l}},a=>({error:a}))),o=await s;if(hn(r),"result"in o)return o.result;throw o.error}};return x([D({readOnly:!0})],e.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D({type:hr})],e.prototype,"fullExtent",void 0),x([D(LY)],e.prototype,"id",void 0),x([D({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),x([D(h_)],e.prototype,"popupEnabled",void 0),x([D({type:Xi})],e.prototype,"spatialReference",void 0),x([D({readOnly:!0})],e.prototype,"version",void 0),x([Mi("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=x([Qe("esri.layers.mixins.ArcGISMapService")],e),e};let eU=class extends dr{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(vCt(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let t=0;for(const r of e)r!=null&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new dr(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(n=>!!n);for(const n of t)if(n){if(r(n)){const s=this.indexOf(n,e);s>=0?s!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const s=this.getChildrenFunction(n);if(Array.isArray(s))for(const o of s)e=this._processCollection(e,o);else e=this._processCollection(e,s)}}return e}};x([D()],eU.prototype,"getCollections",void 0),x([D()],eU.prototype,"getChildrenFunction",void 0),x([D()],eU.prototype,"itemFilterFunction",void 0),eU=x([Qe("esri.core.CollectionFlattener")],eU);const _E=eU,ydr=[["binary","application/octet-stream","bin",""]];function vdr(i,e){return xDt(e.name,i?.supportedFormats??[])!=null}function _dr(i,e){if(!i)return!1;const t=wDt(e,i.supportedFormats??[]);return t!=null&&i.editFormats.includes(t)}function yR(i,e){return LHe(wdr(i,e))}function rk(i,e){return LHe(xDt(i,e))}function bDt(i,e){return SDt(bdr(i,e))}function wDt(i,e){return rk(i.name,e)??yR(i.type,e)}function kHe(i){return[...ydr,...i]}function bdr(i,e){return kHe(e).find(t=>LHe(t)===i)}function wdr(i,e){const t=i.toLowerCase();return kHe(e).find(r=>SDt(r)===t)}function xDt(i,e){const t=i.toLowerCase();return kHe(e).find(r=>xdr(r).some(n=>t.endsWith(n)))}function LHe(i){return i?.[0]}function SDt(i){return i?.[1].toLowerCase()}function xdr(i){return i?.[2].split(",").map(e=>e.toLowerCase())??[]}function Sdr(i){return i.tables?.find(e=>e.role==="assetMaps")}async function Tdr(i,e,t){const r=gu(i),n=await hDt(r,Kn.from(e),{...t}),s=n.data.extent;return!s||isNaN(s.xmin)||isNaN(s.ymin)||isNaN(s.xmax)||isNaN(s.ymax)?{count:n.data.count,extent:null}:{count:n.data.count,extent:hr.fromJSON(s)}}function b0(i,e){return i?e?4:3:e?3:2}const kae=()=>di.getLogger("esri.layers.graphics.featureConversionUtils"),TDt={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},Cdr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s},cat=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+2]},Edr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+3]},Idr=(i,e,t,r,n,s)=>{i[t]=n,i[t+1]=s,i[t+2]=e[r+2],i[t+3]=e[r+3]};function NHe(i,e,t,r){if(i){if(t)return e&&r?Idr:cat;if(e&&r)return Edr}else if(e&&r)return cat;return Cdr}function nge({scale:i,translate:e},t){return Math.round((t-e[0])/i[0])}function sge({scale:i,translate:e},t){return Math.round((e[1]-t)/i[1])}function rMe({scale:i,translate:e},t,r){return t*i[r]+e[r]}function hNe(i,e,t){return i?e?t?jHe(i):$He(i):t?BHe(i):cSe(i):null}function cSe(i){const e=i.coords;return{x:e[0],y:e[1]}}function CDt(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i}function $He(i){const e=i.coords;return{x:e[0],y:e[1],z:e[2]}}function Adr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.z,i}function BHe(i){const e=i.coords;return{x:e[0],y:e[1],m:e[2]}}function Mdr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.m,i}function jHe(i){const e=i.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function Odr(i,e){return i.coords[0]=e.x,i.coords[1]=e.y,i.coords[2]=e.z,i.coords[3]=e.m,i}function Pdr(i,e,t,r){let n=cSe;t&&r?n=jHe:t?n=$He:r&&(n=BHe);for(const s of e){const{geometry:o,attributes:a}=s,l=o!=null?n(o):null;i.push({attributes:a,geometry:l})}return i}function GHe(i,e){return i&&e?Odr:i?Adr:e?Mdr:CDt}function Rdr(i,e,t,r,n){const s=GHe(t,r);for(const{geometry:o,attributes:a}of e){const l=o!=null?s(new $o,o):null;i.push(new ry(l,a,null,n?a[n]:void 0))}return i}function EDt(i,e,t=GHe(e.z!=null,e.m!=null)){return t(i,e)}function Ddr(i,e,t,r){for(const{geometry:n,attributes:s}of e)i.push({attributes:s,geometry:n!=null?UHe(n,t,r):null});return i}function UHe(i,e,t){if(i==null)return null;const r=b0(e,t),n=[];for(let s=0;s=l&&(i.lengths.push($),k=L)}return bE(i.coords,k),i.coords.length?i:null}function DDt(i,e,t,r,n,s,o=t,a=r){if(zP(i),!e?.coords.length)return null;const l=TDt[n],{coords:u,lengths:c}=e,h=b0(t,r),p=b0(t&&o,r&&a),m=NHe(t,r,o,a);if(!c.length)return m(i.coords,u,0,0,u[0],u[1]),zP(i,h,0),i;let v=0;const w=s*s;for(const S of c){if(S=l?i.lengths.push(k):bE(i.coords,I*p),v+=S*h}return i.coords.length?i:null}function Udr(i,e,t,r){const n=i[e],s=i[e+1],o=i[t],a=i[t+1],l=i[r],u=i[r+1];let c=o,h=a,p=l-c,m=u-h;if(p!==0||m!==0){const v=((n-c)*p+(s-h)*m)/(p*p+m*m);v>1?(c=l,h=u):v>0&&(c+=p*v,h+=m*v)}return p=n-c,m=s-h,p*p+m*m}function dNe(i,e,t,r,n,s,o){let a,l=r,u=0;for(let c=s+t;cl&&(u=c,l=a);l>r&&(u-s>t&&dNe(i,e,t,r,n,s,u),n(i,e,i.length,u,e[u],e[u+1]),o-u>t&&dNe(i,e,t,r,n,u,o))}function O1e(i,e,t,r){if(!e?.coords?.length)return null;const n=b0(t,r);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(e&&e.coords){const u=e.coords;for(let c=0;cs.name);this._attributesConstructor=function(){for(const s of n)this[s]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._mValueOffset=null,this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),e.geometryType){case"esriGeometryPoint":this.addCoordinate=(t,r,n)=>this.addCoordinatePoint(t,r,n),this.createGeometry=t=>this.createPointGeometry(t);break;case"esriGeometryPolygon":this.addCoordinate=(t,r,n)=>this._addCoordinatePolygon(t,r,n),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"esriGeometryPolyline":this.addCoordinate=(t,r,n)=>this._addCoordinatePolyline(t,r,n),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"esriGeometryMultipoint":this.addCoordinate=(t,r,n)=>this._addCoordinateMultipoint(t,r,n),this.createGeometry=t=>this._createMultipointGeometry(t)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:n}=t,s=cB(r.clone(),r,!1,!1,this._transform),o=KC(s,n,!1,!1);e.queryGeometryType=n,e.queryGeometry={...o}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const n=this._transform;switch(t=this._applyTransform(n,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const n=this._transform;return this._mValueOffset===null||e!==0||t%this._mValueOffset?this._applyTransform(n,e,t,r):0}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(n)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const n=this._transformPathLikeValue(t,r),s=e[e.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),s.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=n}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?Xdr:t?FDt:r?Ydr:WHe}};async function kDt(i,e,t){const r=gu(i),n={...t},s=Kn.from(e),o=!s.quantizationParameters,{data:a}=await uDt(r,s,new Kdr({sourceSpatialReference:s.sourceSpatialReference,applyTransform:o}),n);return a}let I2=class extends un{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return Yo(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),n=e.outStatistics?.[0]!=null,s=yi("featurelayer-pbf-statistics"),o=!n||s;let a;if(this.pbfSupported&&o)try{a=await kDt(this.url,r,t)}catch(l){if(l.name!=="query:parsing-pbf")throw l;this.pbfSupported=!1}return this.pbfSupported&&o||(a=await RHe(this.url,r,t)),this._normalizeFields(a.fields),a}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return du.fromJSON(t);const{meshFeatureSetFromJSON:n}=await Jg(Promise.resolve().then(()=>tqt),r);return n(e,this.infoFor3D,t)}executeForCount(e,t){return DHe(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return Tdr(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return uSe(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:n}]=await Jg(Promise.all([Promise.resolve().then(()=>zst),Promise.resolve().then(()=>Pat)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),n(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:n}]=await Jg(Promise.all([Promise.resolve().then(()=>zst),Promise.resolve().then(()=>Pat)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),n(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:n,processAttachmentQueryResult:s}=await Jg(Promise.resolve().then(()=>Npr),t),o=gu(this.url);return s(o,await(this.queryAttachmentsSupported?r(o,e,t):n(o,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await Jg(Promise.resolve().then(()=>Xpr),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await Jg(Promise.resolve().then(()=>Kpr),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await Jg(Promise.resolve().then(()=>Qpr),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await Jg(Promise.resolve().then(()=>tfr),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=Kn.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?Ev.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:n,queryFormats:s}=r,o=yR("model/gltf-binary",n)??rk("glb",n),a=yR("model/gltf+json",n)??rk("gltf",n);for(const l of s){if(l===o){t.formatOf3DObjects=l;break}l!==a||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:c,translationX:h,translationY:p,translationZ:m,scaleX:v,scaleY:w,scaleZ:S,rotationX:I,rotationY:R,rotationZ:L,rotationDeg:k}=r.transformFieldRoles;t.outFields.push(l,u,c,h,p,m,v,w,S,I,R,L,k)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};x([D({type:Ev})],I2.prototype,"dynamicDataSource",void 0),x([D()],I2.prototype,"fieldsIndex",void 0),x([D()],I2.prototype,"gdbVersion",void 0),x([D()],I2.prototype,"infoFor3D",void 0),x([D({readOnly:!0})],I2.prototype,"parsedUrl",null),x([D()],I2.prototype,"pbfSupported",void 0),x([D()],I2.prototype,"queryAttachmentsSupported",void 0),x([D()],I2.prototype,"sourceSpatialReference",void 0),x([D({type:String})],I2.prototype,"url",void 0),I2=x([Qe("esri.tasks.QueryTask")],I2);const LDt=I2;var oge;function nMe(i){return i!=null&&i.type==="esriSMS"}function sMe(i,e,t){const r=this.originIdOf(e)>=n0(t.origin);return{ignoreOrigin:!0,allowNull:r,enabled:!!t&&t.layer?.type==="map-image"&&(t.writeSublayerStructure||r)}}function oMe(i,e,t){return{enabled:!!t&&t.layer?.type==="tile"&&(t.origin&&this.originIdOf(e)>=n0(t.origin)||this._isOverridden(e))}}function u2(i,e,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function bhe(i,e,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(e)>=n0(t.origin))}}let Zdr=0;const s$=new Set;s$.add("layer"),s$.add("parent"),s$.add("loaded"),s$.add("loadStatus"),s$.add("loadError"),s$.add("loadWarnings");let Bo=oge=class extends Ql(iT(ef)){constructor(i){super(i),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(i){return this.addResolvingPromise((async()=>{const{layer:e,url:t}=this;if(!e&&!t)throw new qe("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const r=e?await e.fetchSublayerInfo(this,i):(await zi(t,{responseType:"json",query:{f:"json"},...i})).data;r&&(this.sourceJSON=r,this.read({layerDefinition:r},{origin:"service",layer:e,url:gu(t)}))})()),this}readCapabilities(i,e){e=e.layerDefinition||e;const{operations:{supportsQuery:t,supportsQueryAttachments:r},query:{supportsFormatPBF:n},data:{supportsAttachment:s},queryRelated:o}=WVe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:r},data:{supportsAttachment:s},query:{supportsFormatPBF:n},queryRelated:o}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(i){this._setAndNotifyLayer("definitionExpression",i)}get effectiveScaleRange(){const{minScale:i,maxScale:e}=this;return{minScale:i,maxScale:e}}readMaxScaleRange(i,e){return{minScale:(e=e.layerDefinition||e).minScale??0,maxScale:e.maxScale??0}}get fieldsIndex(){return new Cd(this.fields||[])}set floorInfo(i){this._setAndNotifyLayer("floorInfo",i)}readGlobalIdFieldFromService(i,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??Zdr++}set id(i){this._get("id")!==i&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",i):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(i){this._setAndNotifyLayer("labelingInfo",i)}writeLabelingInfo(i,e,t,r){i&&i.length&&(e.layerDefinition={drawingInfo:{labelingInfo:i.map(n=>n.write({},r))}})}set labelsVisible(i){this._setAndNotifyLayer("labelsVisible",i)}set layer(i){this._set("layer",i),this.sublayers&&this.sublayers.forEach(e=>e.layer=i)}set listMode(i){this._set("listMode",i)}set minScale(i){this._setAndNotifyLayer("minScale",i)}readMinScale(i,e){return e.minScale||e.layerDefinition?.minScale||0}set maxScale(i){this._setAndNotifyLayer("maxScale",i)}readMaxScale(i,e){return e.maxScale||e.layerDefinition?.maxScale||0}readObjectIdFieldFromService(i,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(i){this._setAndNotifyLayer("opacity",i)}readOpacity(i,e){const t=e.layerDefinition;return 1-.01*((t?.transparency!=null?t.transparency:t?.drawingInfo?.transparency)??0)}writeOpacity(i,e,t,r){e.layerDefinition={drawingInfo:{transparency:100-100*i}}}writeParent(i,e){this.parent&&this.parent!==this.layer?e.parentLayerId=r2e(this.parent.id):e.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{spatialReference:i}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:r}=this,n=yi("featurelayer-pbf")&&t?.query.supportsFormatPBF,s=t?.operations?.supportsQueryAttachments??!1;return new LDt({url:this.url,pbfSupported:n,fieldsIndex:r,gdbVersion:e,sourceSpatialReference:i,queryAttachmentsSupported:s})}set renderer(i){if(i){for(const e of i.getSymbols())if(JF(e)){di.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",i)}get source(){return this._get("source")||new lP({mapLayerId:this.id})}set source(i){this._setAndNotifyLayer("source",i)}set sublayers(i){this._handleSublayersChange(i,this._get("sublayers")),this._set("sublayers",i)}castSublayers(i){return Sd(dr.ofType(oge),i)}writeSublayers(i,e,t){this.sublayers?.length&&(e[t]=this.sublayers.map(r=>r.id).toArray().reverse())}readTitle(i,e){return e.layerDefinition?.name??e.name}readTypeIdField(i,e){let t=(e=e.layerDefinition||e).typeIdField;if(t&&e.fields){t=t.toLowerCase();const r=e.fields.find(n=>n.name.toLowerCase()===t);r&&(t=r.name)}return t}get url(){const i=this.layer?.parsedUrl??this._lastParsedUrl,e=this.source;if(!i)return null;if(this._lastParsedUrl=i,e?.type==="map-layer")return`${i.path}/${e.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${i.path}/dynamicLayer?${Lb(t)}`}set url(i){this._overrideIfSome("url",i)}set visible(i){this._setAndNotifyLayer("visible",i)}writeVisible(i,e,t,r){e[t]=this.getAtOrigin("defaultVisibility","service")||i}clone(){const{store:i}=Kp(this),e=new oge;return Kp(e).store=i.clone(s$),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(i){return p_(this,i)}createQuery(){return new Kn({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const i=(await Promise.resolve().then(()=>rHe)).default,{layer:e,url:t}=this;let r;if(t&&this.originIdOf("url")>Pn.SERVICE)r=new i({url:t});else{if(!e?.parsedUrl)throw new qe("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const n=e.parsedUrl;r=new i({url:n.path}),n&&this.source&&(this.source.type==="map-layer"?r.layerId=this.source.mapLayerId:r.dynamicDataSource=this.source)}}return e?.refreshInterval!=null&&(r.refreshInterval=e.refreshInterval),this.definitionExpression&&(r.definitionExpression=this.definitionExpression),this.floorInfo&&(r.floorInfo=li(this.floorInfo)),this.originIdOf("labelingInfo")>Pn.SERVICE&&(r.labelingInfo=li(this.labelingInfo)),this.originIdOf("labelsVisible")>Pn.DEFAULTS&&(r.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>Pn.DEFAULTS&&(r.legendEnabled=this.legendEnabled),this.originIdOf("visible")>Pn.DEFAULTS&&(r.visible=this.visible),this.originIdOf("minScale")>Pn.DEFAULTS&&(r.minScale=this.minScale),this.originIdOf("maxScale")>Pn.DEFAULTS&&(r.maxScale=this.maxScale),this.originIdOf("opacity")>Pn.DEFAULTS&&(r.opacity=this.opacity),this.originIdOf("popupTemplate")>Pn.DEFAULTS&&(r.popupTemplate=li(this.popupTemplate)),this.originIdOf("renderer")>Pn.SERVICE&&(r.renderer=li(this.renderer)),this.source?.type==="data-layer"&&(r.dynamicDataSource=this.source.clone()),this.originIdOf("title")>Pn.DEFAULTS&&(r.title=this.title),e?.type==="map-image"&&e.originIdOf("customParameters")>Pn.DEFAULTS&&(r.customParameters=e.customParameters),e?.type==="tile"&&e.originIdOf("customParameters")>Pn.DEFAULTS&&(r.customParameters=e.customParameters),r}getField(i){return this.fieldsIndex.get(i)}getFeatureType(i){const{typeIdField:e,types:t}=this;if(!e||!i)return null;const r=i.attributes?i.attributes[e]:void 0;if(r==null)return null;let n=null;return t?.some(s=>{const{id:o}=s;return o!=null&&(o.toString()===r.toString()&&(n=s),!!n)}),n}getFieldDomain(i,e){const t=e?.feature,r=this.getFeatureType(t);if(r){const n=r.domains&&r.domains[i];if(n&&n.type!=="inherited")return n}return this._getLayerDomain(i)}async queryAttachments(i,e){await this.load(),i=_1e.from(i);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new qe("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:r,objectIds:n,globalIds:s,num:o,size:a,start:l,where:u}=i;if(!t?.operations?.supportsQueryAttachments&&(r?.length>0||s?.length>0||a?.length>0||o||l||u))throw new qe("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",i);if(!(n?.length||s?.length||u))throw new qe("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",i);return this.queryTask.executeAttachmentQuery(i,e)}async queryFeatures(i=this.createQuery(),e){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new qe("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new qe("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(i,{...e,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const r of t.features)r.sourceLayer=this;return t}toExportImageJSON(i){const e={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=PS(i,this.definitionExpression);t!=null&&(e.definitionExpression=t);const r=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,o)=>(s[o]=this.originIdOf(o),s),{});if(Object.keys(r).some(s=>r[s]>Pn.SERVICE)){const s=e.drawingInfo={};if(r.renderer>Pn.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),r.labelsVisible>Pn.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&r.labelingInfo>Pn.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(a=>!a.labelPlacement)&&di.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let o=this.labelingInfo;this.geometryType!=null&&(o=WPt(this.labelingInfo,Vp.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=o.filter(a=>a.labelPlacement).map(a=>a.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;r.opacity>Pn.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return e}_assignDefaultSymbolColors(i){this._forEachSimpleMarkerSymbols(i,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(i,e){if(i){const t=("uniqueValueInfos"in i?i.uniqueValueInfos:"classBreakInfos"in i?i.classBreakInfos:null)??[];for(const r of t)nMe(r.symbol)&&e(r.symbol);"symbol"in i&&nMe(i.symbol)&&e(i.symbol),"defaultSymbol"in i&&nMe(i.defaultSymbol)&&e(i.defaultSymbol)}}_setAndNotifyLayer(i,e){const t=this.layer,r=this._get(i);let n,s;switch(i){case"definitionExpression":case"floorInfo":n="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":n="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":n="supportsDynamicLayers",s="supportsModification"}const o=Kp(this).getDefaultOrigin();if(o!=="service"){if(n&&this.layer?.capabilities?.exportMap?.[n]===!1)return void this._logLockedError(i,`capability not available 'layer.capabilities.exportMap.${n}'`);if(s&&this.capabilities?.exportMap[s]===!1)return void this._logLockedError(i,`capability not available 'capabilities.exportMap.${s}'`)}i!=="source"||this.loadStatus==="not-loaded"?(this._set(i,e),o!=="service"&&r!==e&&t&&t.emit&&t.emit("sublayer-update",{propertyName:i,target:this})):this._logLockedError(i,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(i,e){e&&(e.forEach(t=>{t.parent=null,t.layer=null}),this.removeAllHandles()),i&&(i.forEach(t=>{t.parent=this,t.layer=this.layer}),this.addHandles([i.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),i.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),i.on("before-changes",t=>{const r=this.layer?.capabilities?.exportMap?.supportsSublayersChanges;r==null||r||(di.getLogger(this).error(new qe("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(i,e){const{layer:t,declaredClass:r}=this;di.getLogger(r).error(new qe("sublayer:locked",`Property '${String(i)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:e,sublayer:this,layer:t}))}_getLayerDomain(i){const e=this.fieldsIndex.get(i);return e?e.domain:null}};Bo.test={isMapImageLayerOverridePolicy:i=>i===u2||i===sMe,isTileImageLayerOverridePolicy:i=>i===oMe},x([D({readOnly:!0})],Bo.prototype,"capabilities",void 0),x([Mi("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],Bo.prototype,"readCapabilities",null),x([D()],Bo.prototype,"defaultPopupTemplate",null),x([D({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:sMe}}})],Bo.prototype,"definitionExpression",null),x([D({readOnly:!0})],Bo.prototype,"effectiveScaleRange",null),x([Mi("service","maxScaleRange",["minScale","maxScale"])],Bo.prototype,"readMaxScaleRange",null),x([D({type:[Fo],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],Bo.prototype,"fields",void 0),x([D({readOnly:!0})],Bo.prototype,"fieldsIndex",null),x([D({type:HVe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:sMe},origins:{"web-scene":{read:!1,write:!1}}}})],Bo.prototype,"floorInfo",null),x([D({type:hr,json:{read:{source:"layerDefinition.extent"}}})],Bo.prototype,"fullExtent",void 0),x([D({type:Vp.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:Vp.read}}}}})],Bo.prototype,"geometryType",void 0),x([D({type:String})],Bo.prototype,"globalIdField",void 0),x([Mi("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Bo.prototype,"readGlobalIdFieldFromService",null),x([D({type:ms,json:{write:{ignoreOrigin:!0}}})],Bo.prototype,"id",null),x([D({value:null,type:[rT],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:u2}}})],Bo.prototype,"labelingInfo",null),x([ur("labelingInfo")],Bo.prototype,"writeLabelingInfo",null),x([D({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:u2}}})],Bo.prototype,"labelsVisible",null),x([D({value:null})],Bo.prototype,"layer",null),x([D({type:String,json:{write:{overridePolicy:oMe}}})],Bo.prototype,"layerItemId",void 0),x([D({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:bhe}}})],Bo.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],Bo.prototype,"listMode",null),x([D({type:Number,value:0,json:{write:{overridePolicy:u2}}})],Bo.prototype,"minScale",null),x([Mi("minScale",["minScale","layerDefinition.minScale"])],Bo.prototype,"readMinScale",null),x([D({type:Number,value:0,json:{write:{overridePolicy:u2}}})],Bo.prototype,"maxScale",null),x([Mi("maxScale",["maxScale","layerDefinition.maxScale"])],Bo.prototype,"readMaxScale",null),x([D({type:String})],Bo.prototype,"objectIdField",void 0),x([Mi("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Bo.prototype,"readObjectIdFieldFromService",null),x([D({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:u2}}})],Bo.prototype,"opacity",null),x([Mi("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],Bo.prototype,"readOpacity",null),x([ur("opacity")],Bo.prototype,"writeOpacity",null),x([D({json:{type:ms,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:u2}}})],Bo.prototype,"parent",void 0),x([ur("parent")],Bo.prototype,"writeParent",null),x([D({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(i,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:bhe,writer(i,e,t){e[t]=!i}}}})],Bo.prototype,"popupEnabled",void 0),x([D({type:qc,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:bhe}}})],Bo.prototype,"popupTemplate",void 0),x([D({readOnly:!0})],Bo.prototype,"queryTask",null),x([D({types:IE,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:u2},origins:{"web-scene":{types:qk,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:u2}}}}})],Bo.prototype,"renderer",null),x([D({types:{key:"type",base:null,typeMap:{"data-layer":Ev,"map-layer":lP}},cast(i){if(i){if("mapLayerId"in i)return Cu(lP,i);if("dataSource"in i)return Cu(Ev,i)}return i},json:{name:"layerDefinition.source",write:{overridePolicy:u2}}})],Bo.prototype,"source",null),x([D()],Bo.prototype,"sourceJSON",void 0),x([D({value:null,json:{type:[ms],write:{target:"subLayerIds",allowNull:!0,overridePolicy:u2}}})],Bo.prototype,"sublayers",null),x([So("sublayers")],Bo.prototype,"castSublayers",null),x([ur("sublayers")],Bo.prototype,"writeSublayers",null),x([D({type:String,json:{name:"name",write:{overridePolicy:bhe}}})],Bo.prototype,"title",void 0),x([Mi("service","title",["name","layerDefinition.name"])],Bo.prototype,"readTitle",null),x([D({type:String})],Bo.prototype,"typeIdField",void 0),x([D({json:{read:!1},readOnly:!0,value:"sublayer"})],Bo.prototype,"type",void 0),x([Mi("typeIdField",["layerDefinition.typeIdField"])],Bo.prototype,"readTypeIdField",null),x([D({type:[Aae],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],Bo.prototype,"types",void 0),x([D({type:String,json:{name:"layerUrl",write:{overridePolicy:oMe}}})],Bo.prototype,"url",null),x([D({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:u2}}})],Bo.prototype,"visible",null),x([ur("visible")],Bo.prototype,"writeVisible",null),Bo=oge=x([Qe("esri.layers.support.Sublayer")],Bo);const Lae=Bo;function hat(i,e,t){return e.flatten(({sublayers:n})=>n).length!==i.length?!0:!!i.some(n=>n.originIdOf("minScale")>t||n.originIdOf("maxScale")>t||n.originIdOf("renderer")>t||n.originIdOf("labelingInfo")>t||n.originIdOf("opacity")>t||n.originIdOf("labelsVisible")>t||n.originIdOf("source")>t)||!$Dt(i,e)}function NDt(i,e,t){return!!i.some(r=>{const n=r.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===r.id&&(n.gdbVersion==null||n.gdbVersion===t))||r.originIdOf("renderer")>Pn.SERVICE||r.originIdOf("labelingInfo")>Pn.SERVICE||r.originIdOf("opacity")>Pn.SERVICE||r.originIdOf("labelsVisible")>Pn.SERVICE})||!$Dt(i,e)}function $Dt(i,e){if(!i?.length||e==null)return!0;const t=e.slice().reverse().flatten(({sublayers:s})=>s&&s.toArray().reverse()).map(s=>s.id).toArray();if(i.length>t.length)return!1;let r=0;const n=t.length;for(const{id:s}of i){for(;r=n)return!1}return!0}function Qdr(i){return!!i&&i.some(e=>e.minScale!=null||e.layerDefinition?.minScale!=null)}function epr(i,e){const t=[],r={};return i&&i.forEach(n=>{const s=new Lae;if(s.read(n,e),r[s.id]=s,n.parentLayerId!=null&&n.parentLayerId!==-1){const o=r[n.parentLayerId];o.sublayers||(o.sublayers=[]),o.sublayers.unshift(s)}else t.unshift(s)}),t}const aMe=dr.ofType(Lae);function BDt(i,e){i&&i.forEach(t=>{e(t),t.sublayers&&t.sublayers.length&&BDt(t.sublayers,e)})}const jDt=i=>{let e=class extends i{constructor(...t){super(...t),this.allSublayers=new _E({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.sublayers}),this.sublayersSourceJSON={[Pn.SERVICE]:{},[Pn.PORTAL_ITEM]:{},[Pn.WEB_SCENE]:{},[Pn.WEB_MAP]:{}},this.addHandles(Ki(()=>this.sublayers,(r,n)=>this._handleSublayersChange(r,n),Kl))}destroy(){this.allSublayers.destroy()}readSublayers(t,r){if(!r||!t)return;const{sublayersSourceJSON:n}=this,s=n0(r.origin);if(sPn.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:o,origin:a}=this.createSublayersForOrigin("web-document"),l=Kp(this);l.setDefaultOrigin(a),this._set("sublayers",new aMe(o)),l.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(r=>r.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const r=n0(t==="web-document"?"web-map":t);let n=Pn.SERVICE,s=this.sublayersSourceJSON[Pn.SERVICE].layers,o=this.sublayersSourceJSON[Pn.SERVICE].context,a=null;const l=[Pn.PORTAL_ITEM,Pn.WEB_SCENE,Pn.WEB_MAP].filter(v=>v<=r);for(const v of l){const w=this.sublayersSourceJSON[v];Qdr(w.layers)&&(n=v,s=w.layers,o=w.context,w.visibleLayers&&(a={visibleLayers:w.visibleLayers,context:w.context}))}const u=[Pn.PORTAL_ITEM,Pn.WEB_SCENE,Pn.WEB_MAP].filter(v=>v>n&&v<=r);let c=null;for(const v of u){const{layers:w,visibleLayers:S,context:I}=this.sublayersSourceJSON[v];w&&(c={layers:w,context:I}),S&&(a={visibleLayers:S,context:I})}const h=epr(s,o),p=new Map,m=new Set;if(c)for(const v of c.layers)p.set(v.id,v);if(a?.visibleLayers)for(const v of a.visibleLayers)m.add(v);return BDt(h,v=>{c&&v.read(p.get(v.id),c.context),a&&v.read({defaultVisibility:m.has(v.id)},a.context)}),{origin:yne(n),sublayers:new aMe({items:h})}}read(t,r){super.read(t,r),this.readSublayers(t,r)}_handleSublayersChange(t,r){r&&(r.forEach(n=>{n.parent=null,n.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(n=>{n.parent=this,n.layer=this}),this.addHandles([t.on("after-add",({item:n})=>{n.parent=this,n.layer=this}),t.on("after-remove",({item:n})=>{n.parent=null,n.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",n=>{di.getLogger("esri.layers.TileLayer").error(new qe("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),n.preventDefault()}),"sublayers-owner"))}};return x([D({readOnly:!0})],e.prototype,"allSublayers",void 0),x([D({readOnly:!0,type:dr.ofType(Lae)})],e.prototype,"serviceSublayers",void 0),x([D({value:null,type:aMe,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),x([D({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=x([Qe("esri.layers.mixins.SublayersOwner")],e),e};function dat(i){const e=i.layer;return"floorInfo"in e&&e.floorInfo?.floorField&&"floors"in i.view?GDt(i.view.floors,e.floorInfo.floorField):null}function Yne(i,e){return"floorInfo"in e&&e.floorInfo?.floorField?GDt(i,e.floorInfo.floorField):null}function GDt(i,e){if(!i?.length)return null;const t=i.filter(r=>r!=="").map(r=>`'${r}'`);return t.push("''"),`${e} IN (${t.join(",")}) OR ${e} IS NULL`}const tpr={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let Z_=class extends un{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(t=>{const r=Yne(this.floors,t);return t.toExportImageJSON(r)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&NDt(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",t=>this.notifyChange(tpr[t.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(t=>t.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,t=this.visibleSublayers.filter(r=>r.definitionExpression!=null||e&&r.floorInfo!=null);return t.length?JSON.stringify(t.reduce((r,n)=>{const s=Yne(this.floors,n),o=PS(s,n.definitionExpression);return o!=null&&(r[n.id]=o),r},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const t=this.layer.sublayers,r=this.scale,n=o=>{o.visible&&(r===0||vDt(r,o.minScale,o.maxScale))&&(o.sublayers?o.sublayers.forEach(n):e.unshift(o))};t&&t.forEach(n);const s=this._get("visibleSublayers");return!s||s.length!==e.length||s.some((o,a)=>e[a]!==o)?e:s}toJSON(){const e=this.layer;let t={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?t.dynamicLayers=this.dynamicLayers:t={...t,layers:this.layers,layerDefs:this.layerDefs},t}};x([D({readOnly:!0})],Z_.prototype,"dynamicLayers",null),x([D()],Z_.prototype,"floors",void 0),x([D({readOnly:!0})],Z_.prototype,"hasDynamicLayers",null),x([D()],Z_.prototype,"layer",null),x([D({readOnly:!0})],Z_.prototype,"layers",null),x([D({readOnly:!0})],Z_.prototype,"layerDefs",null),x([D({type:Number})],Z_.prototype,"scale",void 0),x([D(kY)],Z_.prototype,"timeExtent",void 0),x([D({readOnly:!0})],Z_.prototype,"version",null),x([D({readOnly:!0})],Z_.prototype,"visibleSublayers",null),Z_=x([Qe("esri.layers.mixins.ExportImageParameters")],Z_);let ep=class extends xh(AE(uc(jDt(_Dt(Xv(Rc(Yc(Ql(fy(Wx(py(Il)))))))))))){constructor(...e){super(...e),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("PNG32")?"png32":"png24"}writeSublayers(e,t,r,n){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:c})=>c&&c.toArray().reverse()).toArray();let o=!1;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){const c=n0(n.origin);if(c===Pn.PORTAL_ITEM){const h=this.createSublayersForOrigin("service").sublayers;o=hat(s,h,Pn.SERVICE)}else if(c>Pn.PORTAL_ITEM){const h=this.createSublayersForOrigin("portal-item");o=hat(s,h.sublayers,n0(h.origin))}}const a=[],l={writeSublayerStructure:o,...n};let u=o;s.forEach(c=>{const h=c.write({},l);a.push(h),u=u||c.originOf("visible")==="user"}),a.some(c=>Object.keys(c).length>1)&&(t.layers=a),u&&(t.visibleLayers=s.filter(c=>c.visible).map(c=>c.id))}createExportImageParameters(e,t,r,n){const s=n?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const o=new Z_({layer:this,floors:n?.floors,scale:M1e({extent:e,width:t})*s}),a=o.toJSON();o.destroy();const l=!n?.rotation||this.version<10.3?{}:{rotation:-n.rotation},u=e?.spatialReference,c=Hv(u);a.dpi*=s;const h={};if(n?.timeExtent){const{start:p,end:m}=n.timeExtent.toJSON();h.time=p&&m&&p===m?""+p:`${p??"null"},${m??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(h.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:c,imageSR:c,size:t+","+r,...a,...l,...h}}async fetchImage(e,t,r,n){const{data:s}=await this._fetchImage("image",e,t,r,n);return s}async fetchImageBitmap(e,t,r,n){const{data:s,url:o}=await this._fetchImage("blob",e,t,r,n);return E1e(s,o,n?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:r}=await zi(this.url,t),{extent:n,fullExtent:s,timeExtent:o}=r,a=n||s;return{fullExtent:a&&hr.fromJSON(a),timeExtent:o&&Eg.fromJSON({start:o[0],end:o[1]})}}loadAll(){return VB(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Mae(this,e)}async _fetchImage(e,t,r,n,s){const o={responseType:e,signal:s?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,r,n,s),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},a=this.parsedUrl.path+"/export";if(o.query?.dynamicLayers!=null&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new qe("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:o.query});try{const{data:l}=await zi(a,o);return{data:l,url:a}}catch(l){throw mo(l)?l:new qe("mapimagelayer:image-fetch-error",`Unable to load image: ${a}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:r}=await zi(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});r&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}};x([D(XF("dateFieldsTimeReference"))],ep.prototype,"dateFieldsTimeZone",void 0),x([D({type:Boolean})],ep.prototype,"datesInUnknownTimezone",void 0),x([D()],ep.prototype,"dpi",void 0),x([D()],ep.prototype,"gdbVersion",void 0),x([D()],ep.prototype,"imageFormat",void 0),x([Mi("imageFormat",["supportedImageFormatTypes"])],ep.prototype,"readImageFormat",null),x([D({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],ep.prototype,"imageMaxHeight",void 0),x([D({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],ep.prototype,"imageMaxWidth",void 0),x([D()],ep.prototype,"imageTransparency",void 0),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ep.prototype,"isReference",void 0),x([D({json:{read:!1,write:!1}})],ep.prototype,"labelsVisible",void 0),x([D({type:["ArcGISMapServiceLayer"]})],ep.prototype,"operationalLayerType",void 0),x([D({json:{read:!1,write:!1}})],ep.prototype,"popupEnabled",void 0),x([D(XF("preferredTimeReference"))],ep.prototype,"preferredTimeZone",void 0),x([D()],ep.prototype,"sourceJSON",void 0),x([D({json:{write:{ignoreOrigin:!0}}})],ep.prototype,"sublayers",void 0),x([ur("sublayers",{layers:{type:[Lae]},visibleLayers:{type:[ms]}})],ep.prototype,"writeSublayers",null),x([D({type:["show","hide","hide-children"]})],ep.prototype,"listMode",void 0),x([D({json:{read:!1},readOnly:!0,value:"map-image"})],ep.prototype,"type",void 0),x([D(C0)],ep.prototype,"url",void 0),ep=x([Qe("esri.layers.MapImageLayer")],ep);const qHe=ep,ipr=Object.freeze(Object.defineProperty({__proto__:null,default:qHe},Symbol.toStringTag,{value:"Module"}));var pNe;let vI=pNe=class extends Ci{constructor(i){super(i),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new pNe({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"cols",void 0),x([D({type:ms,json:{write:!0}})],vI.prototype,"level",void 0),x([D({type:String,json:{write:!0}})],vI.prototype,"levelValue",void 0),x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"origin",void 0),x([D({type:Number,json:{write:!0}})],vI.prototype,"resolution",void 0),x([D({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],vI.prototype,"rows",void 0),x([D({type:Number,json:{write:!0}})],vI.prototype,"scale",void 0),vI=pNe=x([Qe("esri.layers.support.LOD")],vI);const hs=vI;let jY=class{constructor(e,t,r,n,s=void 0){this.id=e,this.level=t,this.row=r,this.col=n,this.extent=s}};var S4;const pat=new Rs({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let Cy=S4=class extends Ci{static create(i={}){const{resolutionFactor:e=1,scales:t,size:r=256,spatialReference:n=Xi.WebMercator,numLODs:s=24}=i;if(!Cm(n)){const h=[];if(t)for(let p=0;p=0;m--)h.unshift(new hs({level:m,scale:p,resolution:p})),p*=2}return new S4({dpi:96,lods:h,origin:new $i(0,0,n),size:[r,r],spatialReference:n})}const o=Zp(n),a=i.origin?new $i({x:i.origin.x,y:i.origin.y,spatialReference:n}):new $i(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),l=96,u=1/(pu(n)*39.37*l),c=[];if(t)for(let h=0;h{r.push(s.scale),e=s.scale>e?s.scale:e,t=s.scale=e.length-1)return e[e.length-1];const t=Math.floor(i),r=t+1;return e[t]/(e[t]/e[r])**(i-t)}scaleToZoom(i){const e=this.scales,t=e.length-1;let r=0;for(;ri&&s=e?this.zoomToScale(Math.ceil(t)):this.zoomToScale(Math.floor(t))}tileAt(i,e,t,r){const n=this.lodAt(i);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=t;else if(Ya(e.spatialReference,this.spatialReference))s=e.x,o=e.y,r=t;else{const u=HB(e,this.spatialReference);if(u==null)return null;s=u.x,o=u.y,r=t}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return r||(r=new jY(null,0,0,0,Wo())),r.level=i,r.row=Math.floor((this.origin.y-o)/l+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(i,e=S4.ExtrapolateOptions.NONE){let t=this.lodAt(i.level);if(!t&&e===S4.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(i)?i:typeof i=="number"?[i,i]:[256,256]})],Cy.prototype,"size",void 0),x([Mi("size",["rows","cols"])],Cy.prototype,"readSize",null),x([ur("size",{cols:{type:ms},rows:{type:ms}})],Cy.prototype,"writeSize",null),x([D({type:Xi,json:{write:!0}})],Cy.prototype,"spatialReference",void 0),Cy=S4=x([Qe("esri.layers.support.TileInfo")],Cy),function(i){var e;(e=i.ExtrapolateOptions||(i.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(Cy||(Cy={}));const fu=Cy;var fNe;let zO=fNe=class extends Ci{constructor(i){super(i)}clone(){return new fNe({customLayerParameters:li(this.customLayerParameters),customParameters:li(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};x([D({json:{type:Object,write:!0}})],zO.prototype,"customLayerParameters",void 0),x([D({json:{type:Object,write:!0}})],zO.prototype,"customParameters",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"layerIdentifier",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"tileMatrixSet",void 0),x([D({type:String,json:{write:!0}})],zO.prototype,"url",void 0),zO=fNe=x([Qe("esri.layer.support.WMTSLayerInfo")],zO);var mNe;let tp=mNe=class extends xh(fy(uc(Rc(Yc(Ql(Il)))))){constructor(...i){super(...i),this.copyright="",this.fullExtent=new hr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,Xi.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=Xi.WebMercator,this.subDomains=null,this.tileInfo=new fu({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new $i({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:Xi.WebMercator}),spatialReference:Xi.WebMercator,lods:[new hs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new hs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new hs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new hs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new hs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new hs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new hs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new hs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new hs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new hs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new hs({level:10,scale:577790.554289,resolution:152.874056570411}),new hs({level:11,scale:288895.277144,resolution:76.4370282850732}),new hs({level:12,scale:144447.638572,resolution:38.2185141425366}),new hs({level:13,scale:72223.819286,resolution:19.1092570712683}),new hs({level:14,scale:36111.909643,resolution:9.55462853563415}),new hs({level:15,scale:18055.954822,resolution:4.77731426794937}),new hs({level:16,scale:9027.977411,resolution:2.38865713397468}),new hs({level:17,scale:4513.988705,resolution:1.19432856685505}),new hs({level:18,scale:2256.994353,resolution:.597164283559817}),new hs({level:19,scale:1128.497176,resolution:.298582141647617}),new hs({level:20,scale:564.248588,resolution:.14929107082380833}),new hs({level:21,scale:282.124294,resolution:.07464553541190416}),new hs({level:22,scale:141.062147,resolution:.03732276770595208}),new hs({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(i,e){return typeof i=="string"?{urlTemplate:i,...e}:i}load(i){const e=this.loadFromPortal({supportedTypes:["WMTS"]},i).then(()=>{let t="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const r=new Qy(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&r.authority?.includes("{subDomain}")&&(t="is missing 'subDomains' property")}else t="spatialReference must match tileInfo.spatialReference";else t="is missing the required 'urlTemplate' property value";if(t)throw new qe("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${t}`)});return this.addResolvingPromise(e),Promise.resolve(this)}get levelValues(){const i=[];if(!this.tileInfo)return null;for(const e of this.tileInfo.lods)i[e.level]=e.levelValue||e.level;return i}readSpatialReference(i,e){return i||Xi.fromJSON(e.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const i=[],{urlTemplate:e,subDomains:t}=this,r=new Qy(e),n=r.scheme?r.scheme+"://":"//",s=n+r.authority+"/",o=r.authority;if(o?.includes("{subDomain}")){if(t&&t.length>0&&o.split(".").length>1)for(const a of t)i.push(n+o.replaceAll(/\{subDomain\}/gi,a)+"/")}else i.push(s);return i.map(tEt)}get urlPath(){if(!this.urlTemplate)return null;const i=this.urlTemplate,e=new Qy(i),t=(e.scheme?e.scheme+"://":"//")+e.authority+"/";return i.substring(t.length)}readUrlTemplate(i,e){return i||e.templateUrl}writeUrlTemplate(i,e){Mx(i)&&(i="https:"+i),i&&(i=i.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),i=X1(i)),e.templateUrl=i}fetchTile(i,e,t,r={}){const{signal:n}=r,s=this.getTileUrl(i,e,t),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return zi(s,o).then(a=>a.data)}async fetchImageBitmapTile(i,e,t,r={}){const{signal:n}=r;if(this.fetchTile!==mNe.prototype.fetchTile){const l=await this.fetchTile(i,e,t,r);return ik(l,i,e,t,n)}const s=this.getTileUrl(i,e,t),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await zi(s,o);return ik(a,i,e,t,n)}getTileUrl(i,e,t){const{levelValues:r,tileServers:n,urlPath:s}=this;if(!r||!n||!s)return"";const o=r[i];return n[e%n.length]+m0(s,{level:o,z:o,col:t,x:t,row:e,y:e})}};x([D({type:String,value:"",json:{write:!0}})],tp.prototype,"copyright",void 0),x([D({type:hr,json:{write:!0},nonNullable:!0})],tp.prototype,"fullExtent",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],tp.prototype,"legendEnabled",void 0),x([D({type:["show","hide"]})],tp.prototype,"listMode",void 0),x([D({json:{read:!0,write:!0}})],tp.prototype,"blendMode",void 0),x([D()],tp.prototype,"levelValues",null),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],tp.prototype,"isReference",void 0),x([D({type:["WebTiledLayer"],value:"WebTiledLayer"})],tp.prototype,"operationalLayerType",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],tp.prototype,"popupEnabled",void 0),x([D({type:Xi})],tp.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","fullExtent.spatialReference"])],tp.prototype,"readSpatialReference",null),x([D({type:[String],json:{write:!0}})],tp.prototype,"subDomains",void 0),x([D({type:fu,json:{write:!0}})],tp.prototype,"tileInfo",void 0),x([D({readOnly:!0})],tp.prototype,"tileServers",null),x([D({json:{read:!1}})],tp.prototype,"type",void 0),x([D()],tp.prototype,"urlPath",null),x([D({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],tp.prototype,"urlTemplate",void 0),x([Mi("urlTemplate",["urlTemplate","templateUrl"])],tp.prototype,"readUrlTemplate",null),x([ur("urlTemplate",{templateUrl:{type:String}})],tp.prototype,"writeUrlTemplate",null),x([D({type:zO,json:{write:!0}})],tp.prototype,"wmtsInfo",void 0),tp=mNe=x([Qe("esri.layers.WebTileLayer")],tp);const YHe=tp,rpr=Object.freeze(Object.defineProperty({__proto__:null,default:YHe},Symbol.toStringTag,{value:"Module"}));let h1=class extends YHe{constructor(...e){super(...e),this.portalItem=null,this.isReference=null,this.tileInfo=new fu({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new $i({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:Xi.WebMercator}),spatialReference:Xi.WebMercator,lods:[new hs({level:0,scale:591657527591555e-6,resolution:156543.033928}),new hs({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new hs({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new hs({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new hs({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new hs({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new hs({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new hs({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new hs({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new hs({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new hs({level:10,scale:577790.554289,resolution:152.874056570411}),new hs({level:11,scale:288895.277144,resolution:76.4370282850732}),new hs({level:12,scale:144447.638572,resolution:38.2185141425366}),new hs({level:13,scale:72223.819286,resolution:19.1092570712683}),new hs({level:14,scale:36111.909643,resolution:9.55462853563415}),new hs({level:15,scale:18055.954822,resolution:4.77731426794937}),new hs({level:16,scale:9027.977411,resolution:2.38865713397468}),new hs({level:17,scale:4513.988705,resolution:1.19432856685505}),new hs({level:18,scale:2256.994353,resolution:.597164283559817}),new hs({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new hr(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,Xi.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};x([D({type:yg,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],h1.prototype,"portalItem",void 0),x([D({type:Boolean,json:{read:!1,write:!1}})],h1.prototype,"isReference",void 0),x([D({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],h1.prototype,"refreshInterval",null),x([D({type:fu,json:{write:!1}})],h1.prototype,"tileInfo",void 0),x([D({type:["show","hide"]})],h1.prototype,"listMode",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],h1.prototype,"subDomains",void 0),x([D({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],h1.prototype,"fullExtent",void 0),x([D({readOnly:!0,json:{read:!1,write:!1}})],h1.prototype,"urlTemplate",void 0),x([D({type:["OpenStreetMap"]})],h1.prototype,"operationalLayerType",void 0),x([D({json:{read:!1}})],h1.prototype,"type",void 0),x([D({json:{read:!1,write:!1}})],h1.prototype,"copyright",void 0),x([D({json:{read:!1,write:!1}})],h1.prototype,"wmtsInfo",void 0),h1=x([Qe("esri.layers.OpenStreetMapLayer")],h1);const XHe=h1,npr=Object.freeze(Object.defineProperty({__proto__:null,default:XHe},Symbol.toStringTag,{value:"Module"}));let UDt=class{constructor(e,t=0,r=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=r,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(r)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,r){const n=this.tileInfo?.lodAt(e);return!n||ethis.maxLOD?"unavailable":n.cols&&n.rows?r>=n.cols[0]&&r<=n.cols[1]&&t>=n.rows[0]&&t<=n.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,r,n){await vve(n);const s=this.getAvailability(e,t,r);if(s==="unavailable")throw new qe("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:r});return s}async fetchAvailabilityUpsample(e,t,r,n,s){await vve(s),n.level=e,n.row=t,n.col=r;const o=this.tileInfo;return o.updateTileInfo(n),this.fetchAvailability(e,t,r,s).catch(a=>{if(mo(a))throw a;if(o.upsampleTile(n))return this.fetchAvailabilityUpsample(n.level,n.row,n.col,n,s);throw a})}};var RW;(function(i){i[i.KILOBYTES=1024]="KILOBYTES",i[i.MEGABYTES=1048576]="MEGABYTES",i[i.GIGABYTES=1073741824]="GIGABYTES"})(RW||(RW={}));function spr(i,e=!1){return i<=a3?e?new Array(i).fill(0):new Array(i):new Uint32Array(i)}let fat=class gNe{constructor(e){this._validateJSON(e);const{location:t,data:r}=e;this.location=Object.freeze(li(t));const n=this.location.width,s=this.location.height;let o=!0,a=!0;const l=Math.ceil(n*s/32),u=spr(l);let c=0;for(let h=0;h>5,o=this._availability;return s<0||s>o.length?"unknown":o[s]&1<u.data).catch(u=>{if(u&&u.details&&u.details.httpStatus===422)return{location:{top:n,left:s,width:o,height:a},valid:!0,data:sVi(o*a,0)};throw u}).then(u=>{if(u.location&&(u.location.top!==n||u.location.left!==s||u.location.width!==o||u.location.height!==a))throw new qe("tilemap:location-mismatch","Tilemap response for different location than requested",{response:u,definition:{top:n,left:s,width:o,height:a}});return gNe.fromJSON(u)})}static fromJSON(e){return Object.freeze(new gNe(e))}_validateJSON(e){if(!e?.location)throw new qe("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new qe("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new qe("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new qe("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new qe("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}};function mat(i){return`${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`}function opr(i){let e;if(i.service.tileServers?.length){const r=i.service.tileServers;e=`${r&&r.length?r[i.row%r.length]:i.service.url}/tilemap/${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`}else e=`${i.service.url}/tilemap/${i.level}/${i.row}/${i.col}/${i.width}/${i.height}`;const t=i.service.query;return t&&(e=`${e}?${t}`),e}var M6;let Vw=M6=class extends un{constructor(i){super(i),this._pendingTilemapRequests={},this.request=zi,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new d3(2*RW.MEGABYTES),this.addHandles(Ki(()=>{const{layer:i}=this;return[i?.parsedUrl,i?.tileServers,i?.apiKey,i?.customParameters]},()=>this._initializeTilemapDefinition(),js))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(i,e,t,r){if(!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD)return Promise.reject(new qe("tilemap-cache:level-unavailable",`Level ${i} is unavailable in the service`));const n=this._tmpTilemapDefinition,s=this._tilemapFromCache(i,e,t,n);if(s)return Promise.resolve(s);const o=r?.signal;return r={...r,signal:null},new Promise((a,l)=>{Qh(o,()=>l(Oc()));const u=mat(n);let c=this._pendingTilemapRequests[u];if(!c){c=fat.fromDefinition(n,r).then(p=>(this._tilemapCache.put(u,p,p.byteSize),p));const h=()=>{delete this._pendingTilemapRequests[u]};this._pendingTilemapRequests[u]=c,c.then(h,h)}c.then(a,l)})}getAvailability(i,e,t){if(!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(i,e,t,this._tmpTilemapDefinition);return r?r.getAvailability(e,t):"unknown"}fetchAvailability(i,e,t,r){return!this.layer.tileInfo.lodAt(i)||ithis.effectiveMaxLOD?Promise.reject(new qe("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t})):this.fetchTilemap(i,e,t,r).catch(n=>n).then(n=>{if(n instanceof fat){const s=n.getAvailability(e,t);if(s==="unavailable")throw new qe("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return s}if(mo(n))throw n;return"unknown"})}fetchAvailabilityUpsample(i,e,t,r,n){r.level=i,r.row=e,r.col=t;const s=this.layer.tileInfo;s.updateTileInfo(r);const o=this.fetchAvailability(i,e,t,n).catch(a=>{if(mo(a))throw a;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,n);throw a});return this._fetchAvailabilityUpsamplePrefetch(r.id,i,e,t,n,o),o}async _fetchAvailabilityUpsamplePrefetch(i,e,t,r,n,s){if(!this._prefetchingEnabled||i==null)return;const o=`prefetch-${i}`;if(this.hasHandles(o))return;const a=new AbortController;s.then(()=>a.abort(),()=>a.abort());let l=!1;const u=wa(()=>{l||(l=!0,a.abort())});if(this.addHandles(u,o),await sHi(10,a.signal).catch(()=>{}),l||(l=!0,this.removeHandles(o)),xg(a))return;const c=new jY(i,e,t,r),h={...n,signal:a.signal},p=this.layer.tileInfo;for(let m=0;M6._prefetches.length{M6._prefetches.removeUnordered(v)};v.then(w,w)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:i,apiKey:e,customParameters:t}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:i.path,query:Lb({...i.query,...t,token:e??i.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(i,e,t,r){r.level=i,r.row=e-e%this.size,r.col=t-t%this.size;const n=mat(r);return this._tilemapCache.get(n)}get test(){const i=this;return{get prefetchingEnabled(){return i._prefetchingEnabled},set prefetchingEnabled(e){i._prefetchingEnabled=e},hasTilemap:(e,t,r)=>!!i._tilemapFromCache(e,t,r,i._tmpTilemapDefinition)}}};Vw._maxPrefetch=4,Vw._prefetches=new mg({initialSize:M6._maxPrefetch}),x([D({constructOnly:!0})],Vw.prototype,"layer",void 0),x([D({constructOnly:!0})],Vw.prototype,"minLOD",void 0),x([D({constructOnly:!0})],Vw.prototype,"maxLOD",void 0),x([D({constructOnly:!0})],Vw.prototype,"request",void 0),x([D({constructOnly:!0})],Vw.prototype,"size",void 0),Vw=M6=x([Qe("esri.layers.support.TilemapCache")],Vw);const JHe=i=>{let e=class extends i{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(t,r){return r.minLOD!=null&&r.maxLOD!=null?t:0}readMaxScale(t,r){return r.minLOD!=null&&r.maxLOD!=null?t:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(t,r,n){const s=r.capabilities?.includes("Tilemap");let{minLOD:o,maxLOD:a,minScale:l,maxScale:u}=r;if(o==null&&a==null&&l!==0&&u!==0){const c=h=>Math.round(1e4*h)/1e4;l=c(l||r.tileInfo.lods[0].scale),u=c(u||r.tileInfo.lods[r.tileInfo.lods.length-1].scale);for(const h of r.tileInfo.lods){const p=c(h.scale);o=p>=l?h.level:o,a=p>=u?h.level:a}}if(s)return new Vw({layer:this,minLOD:o,maxLOD:a});if(r.tileInfo){const c=new fu;return c.read(r.tileInfo,n),new UDt(c,o,a)}return null}};return x([D({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),x([D()],e.prototype,"minScale",void 0),x([Mi("service","minScale")],e.prototype,"readMinScale",null),x([D()],e.prototype,"maxScale",void 0),x([Mi("service","maxScale")],e.prototype,"readMaxScale",null),x([D({type:Xi})],e.prototype,"spatialReference",void 0),x([D({readOnly:!0})],e.prototype,"supportsBlankTile",null),x([D({type:fu})],e.prototype,"tileInfo",void 0),x([D()],e.prototype,"tilemapCache",void 0),x([Mi("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),x([D()],e.prototype,"version",void 0),e=x([Qe("esri.layers.mixins.ArcGISCachedService")],e),e};var yNe;const gat=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let af=yNe=class extends xh(uc(jDt(JHe(_Dt(Rc(Yc(Xv(Ql(fy(Wx(py(Il)))))))))))){constructor(...i){super(...i),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}load(i){const e=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},i).catch(_a).then(()=>this._fetchService(e))),Promise.resolve(this)}get attributionDataUrl(){const i=this.parsedUrl?.path.toLowerCase();return i?this._getDefaultAttribution(this._getMapName(i)):null}readSpatialReference(i,e){return(i=i||e.tileInfo?.spatialReference)&&Xi.fromJSON(i)}writeSublayers(i,e,t,r){if(!this.loaded||!i)return;const n=i.slice().reverse().flatten(({sublayers:a})=>a&&a.toArray().reverse()).toArray(),s=[],o={writeSublayerStructure:!1,...r};n.forEach(a=>{const l=a.write({},o);s.push(l)}),s.some(a=>Object.keys(a).length>1)&&(e.layers=s)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl?.path)}castTileServers(i){return Array.isArray(i)?i.map(e=>Yo(e).path):null}fetchTile(i,e,t,r={}){const{signal:n}=r,s=this.getTileUrl(i,e,t),o={responseType:"image",signal:n,query:{...this.refreshParameters}};return zi(s,o).then(a=>a.data)}async fetchImageBitmapTile(i,e,t,r={}){const{signal:n}=r;if(this.fetchTile!==yNe.prototype.fetchTile){const l=await this.fetchTile(i,e,t,r);return ik(l,i,e,t,n)}const s=this.getTileUrl(i,e,t),o={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:a}=await zi(s,o);return ik(a,i,e,t,n)}getTileUrl(i,e,t){const r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,n=Lb({...this.parsedUrl?.query,blankTile:!r&&null,...this.customParameters,token:this.apiKey}),s=this.tileServers;return`${s&&s.length?s[e%s.length]:this.parsedUrl?.path}/tile/${i}/${e}/${t}${n?"?"+n:""}`}loadAll(){return VB(this,i=>{i(this.allSublayers)})}_fetchService(i){return new Promise((e,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new qe("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void e({data:this.sourceJSON})}if(!this.parsedUrl)throw new qe("tile-layer:undefined-url","layer's url is not defined");const r=r_(this.parsedUrl.path);if(r!=null&&r.serverType==="ImageServer")throw new qe("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");zi(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(e,t)}).then(e=>{let t=this.url;if(e.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=e.data,this.read(e.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!Fx(t))return this._fetchServerVersion(t,i).then(r=>{this.read({currentVersion:r})}).catch(()=>{})})}_fetchServerVersion(i,e){if(!pOt(i))return Promise.reject();const t=i.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return zi(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r=>{if(r.data&&r.data.currentVersion)return r.data.currentVersion;throw new qe("tile-layer:version-not-available")})}_getMapName(i){const e=i.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return e?e[2]:void 0}_getDefaultAttribution(i){if(i==null)return null;let e;i=i.toLowerCase();for(let t=0,r=gat.length;t({enabled:!1})}}})],af.prototype,"isReference",void 0),x([D({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],af.prototype,"operationalLayerType",void 0),x([D({type:Boolean})],af.prototype,"resampling",void 0),x([D()],af.prototype,"sourceJSON",void 0),x([D({type:Xi})],af.prototype,"spatialReference",void 0),x([Mi("spatialReference",["spatialReference","tileInfo"])],af.prototype,"readSpatialReference",null),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],af.prototype,"path",void 0),x([D({readOnly:!0})],af.prototype,"sublayers",void 0),x([ur("sublayers",{layers:{type:[Lae]}})],af.prototype,"writeSublayers",null),x([D({json:{read:!1,write:!1}})],af.prototype,"popupEnabled",void 0),x([D()],af.prototype,"tileServers",null),x([So("tileServers")],af.prototype,"castTileServers",null),x([D({readOnly:!0,json:{read:!1}})],af.prototype,"type",void 0),x([D(C0)],af.prototype,"url",void 0),af=yNe=x([Qe("esri.layers.TileLayer")],af);const zDt=Symbol("default-fetch-tile");af.prototype.fetchTile[zDt]=!0;const KHe=af,apr=Object.freeze(Object.defineProperty({__proto__:null,default:KHe},Symbol.toStringTag,{value:"Module"})),lpr=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function DW(i){return i!=null&&lpr.some(([e,t])=>i>=e&&i<=t)}const upr={visible:"visibleSublayers"};let QI=class extends un{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",t=>this.notifyChange(upr[t.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:t}=this,r=e?.sublayers,n=[],s=o=>{const{minScale:a,maxScale:l,sublayers:u,visible:c}=o;c&&(t===0||(a===0||t<=a)&&(l===0||t>=l))&&(u?u.forEach(s):n.push(o))};return r?.forEach(s),n}toJSON(){const{layer:e,layers:t}=this,{imageFormat:r,imageTransparency:n,version:s}=e;return{format:r,request:"GetMap",service:"WMS",styles:"",transparent:n?"TRUE":"FALSE",version:s,layers:t}}};x([D()],QI.prototype,"layer",null),x([D({readOnly:!0})],QI.prototype,"layers",null),x([D({type:Number})],QI.prototype,"scale",void 0),x([D({readOnly:!0})],QI.prototype,"version",null),x([D({readOnly:!0})],QI.prototype,"visibleSublayers",null),QI=x([Qe("esri.layers.support.ExportWMSImageParameters")],QI);var age;let cpr=0,Pd=age=class extends iT(f1e){constructor(i){super(i),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([ju(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},Kl),ju(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},Kl),Ki(()=>this.sublayers,(e,t)=>{if(t)for(const r of t)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer},Kl),Ki(()=>this.layer,e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e},Kl)])}get id(){return this._get("id")??cpr++}set id(i){this._set("id",i)}readLegendUrl(i,e){return e.legendUrl??e.legendURL??null}get effectiveScaleRange(){const{minScale:i,maxScale:e}=this;return{minScale:i,maxScale:e}}castSublayers(i){return Sd(dr.ofType(age),i)}set visible(i){this._setAndNotifyLayer("visible",i)}clone(){const i=new age;return this.hasOwnProperty("description")&&(i.description=this.description),this.hasOwnProperty("fullExtent")&&(i.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(i.fullExtents=this.fullExtents?.map(e=>e.clone())??null),this.hasOwnProperty("legendUrl")&&(i.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(i.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(i.layer=this.layer),this.hasOwnProperty("name")&&(i.name=this.name),this.hasOwnProperty("parent")&&(i.parent=this.parent),this.hasOwnProperty("queryable")&&(i.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(i.sublayers=this.sublayers?.map(e=>e.clone())),this.hasOwnProperty("spatialReferences")&&(i.spatialReferences=this.spatialReferences?.map(e=>e)),this.hasOwnProperty("visible")&&(i.visible=this.visible),this.hasOwnProperty("title")&&(i.title=this.title),i}_setAndNotifyLayer(i,e){const t=this.layer;this._get(i)!==e&&(this._set(i,e),t&&t.emit("wms-sublayer-update",{propertyName:i,id:this.id}))}};x([D()],Pd.prototype,"description",void 0),x([D({readOnly:!0})],Pd.prototype,"dimensions",void 0),x([D({type:hr,json:{name:"extent"}})],Pd.prototype,"fullExtent",void 0),x([D()],Pd.prototype,"fullExtents",void 0),x([D({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],Pd.prototype,"id",null),x([D({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],Pd.prototype,"legendUrl",void 0),x([Mi("legendUrl",["legendUrl","legendURL"])],Pd.prototype,"readLegendUrl",null),x([D({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],Pd.prototype,"legendEnabled",void 0),x([D()],Pd.prototype,"layer",void 0),x([D()],Pd.prototype,"maxScale",void 0),x([D()],Pd.prototype,"minScale",void 0),x([D({readOnly:!0})],Pd.prototype,"effectiveScaleRange",null),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"name",void 0),x([D()],Pd.prototype,"parent",void 0),x([D({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],Pd.prototype,"popupEnabled",void 0),x([D({type:Boolean,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"queryable",void 0),x([D()],Pd.prototype,"sublayers",void 0),x([So("sublayers")],Pd.prototype,"castSublayers",null),x([D({type:[Number],json:{read:{source:"spatialReferences"}}})],Pd.prototype,"spatialReferences",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Pd.prototype,"title",void 0),x([D({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],Pd.prototype,"visible",null),Pd=age=x([Qe("esri.layers.support.WMSSublayer")],Pd);const vNe=Pd,yat={84:4326,83:4269,27:4267};function hpr(i){if(!i)return null;const e={idCounter:-1};typeof i=="string"&&(i=new DOMParser().parseFromString(i,"text/xml"));const t=i.documentElement;if(t.nodeName==="ServiceExceptionReport"){const be=Array.prototype.slice.call(t.childNodes).map(_e=>_e.textContent).join(`\r +`);throw new qe("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",be)}const r=Fv("Capability",t),n=Fv("Service",t),s=r&&Fv("Request",r);if(!r||!n||!s)return null;const o=Fv("Layer",r);if(!o)return null;const a=t.nodeName==="WMS_Capabilities"||t.nodeName==="WMT_MS_Capabilities"?t.getAttribute("version"):"1.3.0",l=sA("Title",n,"")||sA("Name",n,""),u=sA("AccessConstraints",n,""),c=/^none$/i.test(u)?"":u,h=sA("Abstract",n,""),p=parseInt(sA("MaxWidth",n,"5000"),10),m=parseInt(sA("MaxHeight",n,"5000"),10),v=_at(s,"GetMap"),w=vat(s,"GetMap"),S=LQ(o,a,e);if(!S)return null;let I,R=0;const L=Array.prototype.slice.call(r.childNodes),k=S.sublayers??[],B=be=>{be!=null&&k.push(be)};L.forEach(be=>{be.nodeName==="Layer"&&(R===0?I=be:(R===1&&S.name&&(S.name="",B(LQ(I,a,e))),B(LQ(be,a,e))),R++)});let $=S.sublayers,V=S.extent;const Y=S.fullExtents??[];if($||($=[]),$.length===0&&$.push(S),!V){const be=new hr($[0].extent);S.extent=be.toJSON(),V=S.extent}const K=S.spatialReferences.length>0?S.spatialReferences:VDt(S),Q=vat(s,"GetFeatureInfo"),re=Q?_at(s,"GetFeatureInfo"):null,ne=HDt($),de=S.minScale||0,pe=S.maxScale||0,H=S.dimensions??[],Z=ne.reduce((be,_e)=>be.concat(_e.dimensions??[]),[]),ae=H.concat(Z).filter(qDt);let fe=null;if(ae.length){const be=ae.map(_e=>{const{extent:Ie}=_e;return fpr(Ie)?Ie.map(Te=>Te.getTime()):Ie?.map(Te=>[Te.min.getTime(),Te.max.getTime()])}).flat(2).filter(Ga);fe={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...be),Math.max(...be)]}}return{copyright:c,description:h,dimensions:H,extent:V,fullExtents:Y,featureInfoFormats:re,featureInfoUrl:Q,mapUrl:w,maxWidth:p,maxHeight:m,maxScale:pe,minScale:de,layers:ne,spatialReferences:K,supportedImageFormatTypes:v,timeInfo:fe,title:l,version:a}}function dpr(i){const e=i.filter(t=>t.popupEnabled&&t.name&&t.queryable);return e.length?e.map(({name:t})=>t).join():null}function VDt(i){if(i.spatialReferences.length>0)return i.spatialReferences;if(i.sublayers)for(const e of i.sublayers){const t=VDt(e);if(t.length>0)return t}return[]}function HDt(i){let e=[];for(const t of i)e.push(t),t.sublayers?.length&&(e=e.concat(HDt(t.sublayers)),delete t.sublayers);return e}function lge(i,e,t){return e.getAttribute(i)??t}function ppr(i,e,t,r){const n=Fv(i,t);return n?lge(e,n,r):r}function Fv(i,e){for(let t=0;tn).filter(Ga);const r=[];for(const n of t)if(n.getAttribute("name")===e){const s=uge("Format",n);for(const{textContent:o}of s)o!=null&&r.push(o)}return r}function bat(i,e,t){const r=Fv(e,i);if(!r)return t;const{textContent:n}=r;if(n==null||n==="")return t;const s=Number(n);return isNaN(s)?t:s}function LQ(i,e,t){if(!i)return null;const r={id:t.idCounter++,fullExtents:[],parentLayerId:null,queryable:i.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},n=Fv("LatLonBoundingBox",i),s=Fv("EX_GeographicBoundingBox",i);let o=null;n&&(o=jJ(n,4326)),s&&(o=new hr(0,0,0,0,new Xi({wkid:4326})),o.xmin=parseFloat(sA("westBoundLongitude",s,"0")),o.ymin=parseFloat(sA("southBoundLatitude",s,"0")),o.xmax=parseFloat(sA("eastBoundLongitude",s,"0")),o.ymax=parseFloat(sA("northBoundLatitude",s,"0"))),n||s||(o=new hr(-180,-90,180,90,new Xi({wkid:4326}))),r.minScale=bat(i,"MaxScaleDenominator",0),r.maxScale=bat(i,"MinScaleDenominator",0);const a=["1.0.0","1.1.0","1.1.1"].includes(e)?"SRS":"CRS";return Array.prototype.slice.call(i.childNodes).forEach(l=>{if(l.nodeName==="Name")r.name=l.textContent||"";else if(l.nodeName==="Title")r.title=l.textContent||"";else if(l.nodeName==="Abstract")r.description=l.textContent||"";else if(l.nodeName==="BoundingBox"){const u=l.getAttribute(a);if(u&&u.indexOf("EPSG:")===0){const h=parseInt(u.substring(5),10);h===0||isNaN(h)||o||(o=e==="1.3.0"?jJ(l,h,DW(h)):jJ(l,h))}const c=u&&u.indexOf(":");if(c&&c>-1){let h=parseInt(u.substring(c+1,u.length),10);h===0||isNaN(h)||(h=yat[h]??h);const p=e==="1.3.0"?jJ(l,h,DW(h)):jJ(l,h);p&&r.fullExtents&&r.fullExtents.push(p)}}else if(l.nodeName===a)(l.textContent?.split(" ")??[]).forEach(u=>{const c=u.includes(":")?parseInt(u.split(":")[1],10):parseInt(u,10);if(c!==0&&!isNaN(c)){const h=yat[c]??c;r.spatialReferences.includes(h)||r.spatialReferences.push(h)}});else if(l.nodeName!=="Style"||r.legendUrl){if(l.nodeName==="Layer"){const u=LQ(l,e,t);u&&(u.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(u))}}else{const u=Fv("LegendURL",l);if(u){const c=Fv("OnlineResource",u);c&&(r.legendUrl=c.getAttribute("xlink:href"))}}}),r.extent=o?.toJSON(),r.dimensions=uge("Dimension",i).filter(l=>l.getAttribute("name")&&l.getAttribute("units")&&l.textContent).map(l=>{const u=l.getAttribute("name"),c=l.getAttribute("units"),h=l.textContent,p=l.getAttribute("unitSymbol")??void 0,m=l.getAttribute("default")??void 0,v=lge("default",l,"0")!=="0",w=lge("nearestValue",l,"0")!=="0",S=lge("current",l,"0")!=="0";return qDt({name:u,units:c})?{name:"time",units:"ISO8601",extent:Sat(h),default:Sat(m),multipleValues:v,nearestValue:w,current:S}:mpr({name:u,units:c})?{name:"elevation",units:c,extent:wat(h),unitSymbol:p,default:wat(m),multipleValues:v,nearestValue:w}:{name:u,units:c,extent:xat(h),unitSymbol:p,default:xat(m),multipleValues:v,nearestValue:w}}),r}function fpr(i){return Array.isArray(i)&&i.length>0&&i[0]instanceof Date}function WDt(i){return i.nodeType===Node.ELEMENT_NODE}function mpr(i){return/^elevation$/i.test(i.name)&&/^(epsg|crs):\d+$/i.test(i.units)}function qDt(i){return/^time$/i.test(i.name)&&/^iso8601$/i.test(i.units)}function gpr(i,e){const t=[],r=Yo(i);for(const n in r.query)r.query.hasOwnProperty(n)&&(e.includes(n.toLowerCase())||t.push(n+"="+r.query[n]));return r.path+(t.length?"?"+t.join("&"):"")}function wat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:parseFloat(n[0]),max:parseFloat(n[1]),resolution:n.length>=3&&n[2]!=="0"?parseFloat(n[2]):void 0}}).filter(Ga):t.map(r=>parseFloat(r))}function xat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:n[0],max:n[1],resolution:n.length>=3&&n[2]!=="0"?n[2]:void 0}}).filter(Ga):t}function Sat(i){if(!i)return;const e=i.includes("/"),t=i.split(",");return e?t.map(r=>{const n=r.split("/");return n.length<2?null:{min:new Date(n[0]),max:new Date(n[1]),resolution:n.length>=3&&n[2]!=="0"?ypr(n[2]):void 0}}).filter(Ga):t.map(r=>new Date(r))}function ypr(i){const e=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,t=i.match(e);return t?{years:pj(t[1]),months:pj(t[2]),days:pj(t[3]),hours:pj(t[4]),minutes:pj(t[5]),seconds:pj(t[6])}:null}function pj(i){if(!i)return 0;const e=/(?:\d+(?:\.|,)\d+|\d+)/,t=i.match(e);if(!t)return 0;const r=t[0].replace(",",".");return Number(r)}function fj(i){return i.toISOString().replace(/\.[0-9]{3}/,"")}const Tat=new Set([102100,3857,102113,900913]),vpr=new Set([3395,54004]);function _pr(i,e){let t=i.wkid;return e==null?t:(t!=null&&e.includes(t)||!i.latestWkid||(t=i.latestWkid),t!=null&&Tat.has(t)?e.find(r=>Tat.has(r))||e.find(r=>vpr.has(r))||102100:t)}const lMe=new Rs({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function Cat(i){return i==="text/html"}function Eat(i){return i==="text/plain"}let Yl=class extends xh(AE(fy(uc(Rc(Yc(Ql(Il))))))){constructor(...e){super(...e),this.allSublayers=new _E({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([ju(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},Kl),ju(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},Kl),Ki(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},Kl)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(_a).then(()=>this._fetchService(t))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new hr({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(Cat)??this.featureInfoFormats.find(Eat)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(Cat(e)||Eat(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new Xi(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return Iat(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return Iat(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const s=new Map,o=e.flatten(({sublayers:a})=>a??[]);for(const a of o)if(typeof a.parent?.id=="number"){const l=s.get(a.parent.id);l!=null?l.push(a.id):s.set(a.parent.id,[a.id])}for(const a of o){const l={sublayer:a,...n},u=a.write({parentLayerId:typeof a.parent?.id=="number"?a.parent.id:-1},l);if(s.has(a.id)&&(u.sublayerIds=s.get(a.id)),!a.sublayers&&a.name){const c=a.write({},l);delete c.id,t.layers.push(c)}}t.visibleLayers=o.filter(({visible:a,sublayers:l})=>a&&!l).map(({name:a})=>a).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=Yo(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const n=gg(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const s=n?.pixelRatio??1,o=M1e({extent:e,width:t})*s,a=new QI({layer:this,scale:o}),{xmin:l,ymin:u,xmax:c,ymax:h,spatialReference:p}=e,m=_pr(p,this.spatialReferences),v=this.version==="1.3.0"&&DW(m)?`${u},${l},${h},${c}`:`${l},${u},${c},${h}`,w=a.toJSON();return{bbox:v,[this.version==="1.3.0"?"crs":"srs"]:m==null||isNaN(m)?void 0:"EPSG:"+m,...w}}async fetchImage(e,t,r,n){const s=this.mapUrl,o=this.createExportImageParameters(e,t,r,n);if(!o.layers){const h=document.createElement("canvas");return h.width=t,h.height=r,h}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,u=a!=null&&l!=null?a.getTime()===l.getTime()?fj(a):`${fj(a)}/${fj(l)}`:void 0,c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...o,time:u,...this.refreshParameters}),signal:n?.signal};return zi(s??"",c).then(h=>h.data)}async fetchImageBitmap(e,t,r,n){const s=this.mapUrl??"",o=this.createExportImageParameters(e,t,r,n);if(!o.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const a=n?.timeExtent?.start,l=n?.timeExtent?.end,u=a!=null&&l!=null?a.getTime()===l.getTime()?fj(a):`${fj(a)}/${fj(l)}`:void 0,c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...o,time:u,...this.refreshParameters}),signal:n?.signal},{data:h}=await zi(s,c);return E1e(h,s,n?.signal)}fetchFeatureInfo(e,t,r,n,s){const o=M1e({extent:e,width:t}),a=new QI({layer:this,scale:o}),l=dpr(a.visibleSublayers);if(this.featureInfoUrl==null||l==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const u=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},c={query_layers:l,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...u},h={...this.createExportImageParameters(e,t,r),...c},p=this._mixCustomParameters(h);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(p):this._defaultFetchFeatureInfoFunction(gg(this.featureInfoUrl,p))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return Qrr(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?Xi.WebMercator:new Xi({wkid:t});return Ya(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=JCt(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new qc({title:this.title,content:t}),n=new Us({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await zi(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=hpr(n)}if(this.parsedUrl){const t=new Qy(this.parsedUrl.path),{httpsDomains:r}=Ho.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function bpr(i,e){return i.some(t=>{for(const r in t)if(zCt(t,r,null,e))return!0;return!1})}function Iat(i,e,t){i=i??[];const r=new Map;i.every(s=>s.id==null)&&(i=li(i)).forEach((s,o)=>s.id=o);for(const s of i){const o=new vNe;o.read(s,e),t&&!t.includes(o.name)&&(o.visible=!1),r.set(o.id,o)}const n=[];for(const s of i){const o=s.id!=null?r.get(s.id):null;if(o)if(s.parentLayerId!=null&&s.parentLayerId>=0){const a=r.get(s.parentLayerId);if(!a)continue;a.sublayers||(a.sublayers=new dr),a.sublayers.push(o)}else n.push(o)}return n}x([D({readOnly:!0})],Yl.prototype,"allSublayers",void 0),x([D({json:{type:Object,write:!0}})],Yl.prototype,"customParameters",void 0),x([D({json:{type:Object,write:!0}})],Yl.prototype,"customLayerParameters",void 0),x([D({type:String,json:{write:!0}})],Yl.prototype,"copyright",void 0),x([D()],Yl.prototype,"description",void 0),x([D({readOnly:!0})],Yl.prototype,"dimensions",void 0),x([D({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],Yl.prototype,"fullExtent",void 0),x([Mi(["web-document","portal-item"],"fullExtent",["extent"])],Yl.prototype,"readFullExtentFromItemOrMap",null),x([ur(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],Yl.prototype,"writeFullExtent",null),x([D()],Yl.prototype,"fullExtents",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Yl.prototype,"featureInfoFormat",null),x([D({type:[String],readOnly:!0})],Yl.prototype,"featureInfoFormats",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Yl.prototype,"featureInfoUrl",void 0),x([D()],Yl.prototype,"fetchFeatureInfoFunction",void 0),x([D({type:String,json:{origins:{"web-document":{default:"image/png",type:lMe.jsonValues,read:{reader:lMe.read,source:"format"},write:{writer:lMe.write,target:"format"}}}}})],Yl.prototype,"imageFormat",void 0),x([Mi("imageFormat",["supportedImageFormatTypes"])],Yl.prototype,"readImageFormat",null),x([D({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],Yl.prototype,"imageMaxHeight",void 0),x([D({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],Yl.prototype,"imageMaxWidth",void 0),x([D()],Yl.prototype,"imageTransparency",void 0),x([D(d_)],Yl.prototype,"legendEnabled",void 0),x([D({type:["show","hide","hide-children"]})],Yl.prototype,"listMode",void 0),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Yl.prototype,"mapUrl",void 0),x([D({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Yl.prototype,"isReference",void 0),x([D({type:["WMS"]})],Yl.prototype,"operationalLayerType",void 0),x([D()],Yl.prototype,"resourceInfo",void 0),x([D({type:Xi,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],Yl.prototype,"spatialReference",void 0),x([Mi(["web-document","portal-item"],"spatialReference",["spatialReferences"])],Yl.prototype,"readSpatialReferenceFromItemOrDocument",null),x([D({type:[ms],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],Yl.prototype,"spatialReferences",void 0),x([ur(["web-document","portal-item"],"spatialReferences")],Yl.prototype,"writeSpatialReferences",null),x([D({type:dr.ofType(vNe),json:{write:{target:"layers",overridePolicy(i,e,t){if(bpr(this.allSublayers,t))return{ignoreOrigin:!0}}}}})],Yl.prototype,"sublayers",void 0),x([Mi(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],Yl.prototype,"readSublayersFromItemOrMap",null),x([Mi("service","sublayers",["layers"])],Yl.prototype,"readSublayers",null),x([ur("sublayers",{layers:{type:[vNe]},visibleLayers:{type:[String]}})],Yl.prototype,"writeSublayers",null),x([D({json:{read:!1},readOnly:!0,value:"wms"})],Yl.prototype,"type",void 0),x([D(C0)],Yl.prototype,"url",null),x([D({type:String,json:{write:{ignoreOrigin:!0}}})],Yl.prototype,"version",void 0),Yl=x([Qe("esri.layers.WMSLayer")],Yl);const YDt=Yl,wpr=Object.freeze(Object.defineProperty({__proto__:null,default:YDt},Symbol.toStringTag,{value:"Module"}));var _Ne;let cge=_Ne=class extends Ci{constructor(i){super(i),this.type="none"}clone(){return new _Ne({type:this.type})}};x([Wr({none:"none",stayAbove:"stay-above"})],cge.prototype,"type",void 0),cge=_Ne=x([Qe("esri.ground.NavigationConstraint")],cge);var bNe;let aO=bNe=class extends S0(ef){constructor(i){super(i),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new dr;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&di.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},t=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>e(r.item)),this.layers.on("after-remove",r=>t(r.item))])}initialize(){this.when().catch(i=>{mo(i)||di.getLogger(this).error("#load()","Failed to load ground",i)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const i=this.layers.removeAll();for(const e of i)zo(e);this.layers.destroy()}normalizeCtorArgs(i){return i&&"resourceInfo"in i&&(this._set("resourceInfo",i.resourceInfo),delete(i={...i}).resourceInfo),i}set layers(i){this._set("layers",ay(i,this._get("layers")))}writeLayers(i,e,t,r){const n=[];i&&(r={...r,layerContainerType:"ground"},i.forEach(s=>{if("write"in s){const o={};Per(s)().write(o,r)&&n.push(o)}else r?.messages&&r.messages.push(new qe("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(i){return this.addResolvingPromise(this._loadFromSource(i)),Promise.resolve(this)}loadAll(){return VB(this,i=>{i(this.layers)})}async queryElevation(i,e){await this.load({signal:e?.signal});const{ElevationQuery:t}=await Promise.resolve().then(()=>Zbe);hn(e);const r=new t,n=this.layers.filter(Aat).toArray();return r.queryAll(n,i,e)}async createElevationSampler(i,e){await this.load({signal:e?.signal});const{ElevationQuery:t}=await Promise.resolve().then(()=>Zbe);hn(e);const r=new t,n=this.layers.filter(Aat).toArray();return r.createSamplerAll(n,i,e)}clone(){const i={opacity:this.opacity,surfaceColor:li(this.surfaceColor),navigationConstraint:li(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(i.loadStatus="loaded"),new bNe({resourceInfo:this.resourceInfo}).set(i)}read(i,e){this.resourceInfo||this._set("resourceInfo",{data:i,context:e}),super.read(i,e)}_loadFromSource(i){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,i):Promise.resolve()}async _loadLayersFromJSON(i,e,t){const r=e?.origin||"web-scene",n=e?.portal||null,s=e?.url||null,{populateOperationalLayers:o}=await Promise.resolve().then(()=>T8t);hn(t);const a=[];if(i.layers&&Array.isArray(i.layers)){const l={context:{origin:r,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,i.layers,l))}await Promise.allSettled(a)}};function xpr(i){return i&&"createElevationSampler"in i}function Aat(i){return i.type==="elevation"||xpr(i)}x([D({json:{read:!1}})],aO.prototype,"layers",null),x([ur("layers")],aO.prototype,"writeLayers",null),x([D({readOnly:!0})],aO.prototype,"resourceInfo",void 0),x([D({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:ms,read:{reader:vW,source:"transparency"},write:{writer:(i,e)=>{e.transparency=E2e(i)},target:"transparency"}}})],aO.prototype,"opacity",void 0),x([D({type:jr,json:{type:[ms],write:(i,e)=>{e.surfaceColor=i.toJSON().slice(0,3)}}})],aO.prototype,"surfaceColor",void 0),x([D({type:cge,json:{write:!0}})],aO.prototype,"navigationConstraint",void 0),aO=bNe=x([Qe("esri.Ground")],aO);const P1e=aO;function Spr(i){return!(!(i&&typeof i=="object"&&"loaded"in i&&i.loaded&&tT(i)?.operations?.supportsEditing&&"type"in i)||"editingEnabled"in i&&!GEt(i))}const Mat=()=>di.getLogger("esri.support.basemapUtils");function Tpr(){return{}}function Cpr(i){for(const e in i){const t=i[e];zo(t),delete i[e]}}function Epr(i,e){let t;if(typeof i=="string"){const r=i in v5e,n=!r&&i.includes("/");if(!r&&!n){const s=Object.entries(v5e).filter(([o,a])=>Ho.apiKey&&!a.classic||!Ho.apiKey&&(a.classic||a.is3d)).map(([o])=>`"${o}"`).sort().join(", ");return Mat().warn(`Unable to find basemap definition for: ${i}. Try one of these: ${s}`),null}e&&(t=e[i]),t||(t=r?kV.fromId(i):new kV({style:{id:i}}),e&&(e[i]=t))}else t=Sd(kV,i);return t?.destroyed&&(Mat().warn("The provided basemap is already destroyed",{basemap:t}),t=null),t}function XDt(i){return new _E({getCollections:()=>[i.tables,i.layers],getChildrenFunction:e=>{const t=[];return"tables"in e&&t.push(e.tables),"layers"in e&&t.push(e.layers),t},itemFilterFunction:e=>{const t=e.parent;return!!t&&"tables"in t&&t.tables.includes(e)}})}function uMe(i){for(const e of i.values())e?.destroy();i.clear()}const Oat={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function Ipr(i){let e=null;if(typeof i=="string")if(i in Oat){const t=Oat[i];e=new P1e({resourceInfo:{data:{layers:[t]}}})}else di.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${i}. Try "world-elevation"`);else e=Sd(P1e,i);return e}function wNe(i,e,t){let r,n;if(i)for(let s=0,o=i.length;s{let e=class extends i{constructor(...t){super(...t),this.layers=new dr;const r=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},n=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||di.getLogger(this).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},s=o=>{o.parent=null,this.layerRemoved(o)};this.addHandles([this.layers.on("before-add",o=>r(o.item)),this.layers.on("after-add",o=>n(o.item)),this.layers.on("after-remove",o=>s(o.item))])}destroy(){const t=this.layers.toArray();for(const r of t)r.destroy();this.layers.destroy()}set layers(t){this._set("layers",ay(t,this._get("layers")))}add(t,r){const n=this.layers;if(r=n.getNextIndex(r),t instanceof Il){const s=t;s.parent===this?this.reorder(s,r):n.add(s,r)}else qp(t)?t.then(s=>{this.destroyed||this.add(s,r)}):di.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(t,r){const n=this.layers;let s=n.getNextIndex(r);t.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(t){return wNe(this.layers,"id",t)}findLayerByUid(t){return wNe(this.layers,"uid",t)}remove(t){return this.layers.remove(t)}removeMany(t){return this.layers.removeMany(t)}removeAll(){return this.layers.removeAll()}reorder(t,r){return this.layers.reorder(t,r)}layerAdded(t){}layerRemoved(t){}};return x([D()],e.prototype,"layers",null),e=x([Qe("esri.support.LayersMixin")],e),e};function xNe(i,e,t){if(i)for(let r=0,n=i.length;r{let e=class extends i{constructor(...t){super(...t),this.tables=new dr,this.addHandles([this.tables.on("after-add",r=>{const n=r.item;n.parent&&n.parent!==this&&"tables"in n.parent&&n.parent.tables.remove(n),n.parent=this,n.type!=="feature"&&di.getLogger(this).error(`Layer 'title:${n.title}, id:${n.id}' of type '${n.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const t=this.tables.toArray();for(const r of t)r.destroy();this.tables.destroy()}set tables(t){this._set("tables",ay(t,this._get("tables")))}findTableById(t){return xNe(this.tables,"id",t)}findTableByUid(t){return xNe(this.tables,"uid",t)}};return x([D()],e.prototype,"tables",null),e=x([Qe("esri.support.TablesMixin")],e),e};let YT=class extends KDt(JDt(rd.EventedMixin(un))){constructor(e){super(e),this.allLayers=new _E({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=XDt(this),this.basemap=null,this.editableLayers=new _E({getCollections:()=>[this.allLayers],itemFilterFunction:Spr}),this.ground=new P1e,this._basemapCache=Tpr()}destroy(){Cpr(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=zo(this.basemap),zo(this.ground),this._set("ground",null)}castBasemap(e){return Epr(e,this._basemapCache)}castGround(e){return Ipr(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};x([D({readOnly:!0,dependsOn:[]})],YT.prototype,"allLayers",void 0),x([D({readOnly:!0})],YT.prototype,"allTables",void 0),x([D({type:kV,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],YT.prototype,"basemap",void 0),x([So("basemap")],YT.prototype,"castBasemap",null),x([D({readOnly:!0})],YT.prototype,"editableLayers",void 0),x([D({type:P1e,nonNullable:!0})],YT.prototype,"ground",void 0),x([So("ground")],YT.prototype,"castGround",null),x([D()],YT.prototype,"undoRedo",void 0),YT=x([Qe("esri.Map")],YT);const ZDt=YT;async function Apr(i,e,t,r){return Ppr(e,await Mpr(i,e,t,r),t,r)}async function Mpr(i,e,t,r){const n={...r},s=Rpr(e,t),o=e.outStatistics?.[0]!=null,a=yi("featurelayer-pbf-statistics"),l=!o||a;let u;if(t?.format==="pbf"&&l)try{u=await kDt(i,s,n)}catch(c){if(c.name!=="query:parsing-pbf")throw c;t.format="json"}return t?.format!=="json"&&l||(u=await RHe(i,s,n)),Opr(t?.fieldsIndex,u.fields),u}function Opr(i,e){if(i!=null&&e!=null)for(const t of e){const r=i.get(t.name);r&&Object.assign(t,r.toJSON())}}async function Ppr(i,e,t,r){const n=t?.infoFor3D;if(!QDt(i,n)||n==null||!e.assetMaps||!e.features?.length)return du.fromJSON(e);const{meshFeatureSetFromJSON:s}=await Jg(Promise.resolve().then(()=>tqt),r);return s(i,n,e)}function Rpr(i,e){let t=Kn.from(i);t.sourceSpatialReference=t.sourceSpatialReference??e?.sourceSpatialReference??null,(e?.gdbVersion||e?.dynamicDataSource)&&(t=t===i?t.clone():t,t.gdbVersion=i.gdbVersion||e.gdbVersion,t.dynamicDataSource=i.dynamicDataSource?Ev.from(i.dynamicDataSource):e.dynamicDataSource);const r=e?.infoFor3D;if(r!=null&&QDt(i,r)){t=t===i?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:n,queryFormats:s}=r,o=yR("model/gltf-binary",n)??rk("glb",n),a=yR("model/gltf+json",n)??rk("gtlf",n);for(const l of s){if(l===o){t.formatOf3DObjects=l;break}l!==a||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===i?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:c,translationX:h,translationY:p,translationZ:m,scaleX:v,scaleY:w,scaleZ:S,rotationX:I,rotationY:R,rotationZ:L,rotationDeg:k}=r.transformFieldRoles;t.outFields.push(l,u,c,h,p,m,v,w,S,I,R,L,k)}}return t}function QDt(i,e){return e!=null&&i.returnGeometry===!0&&i.multipatchOption!=="xyFootprint"&&!i.outStatistics}function Dpr(i){const e=i.toJSON();return e.attachmentTypes&&(e.attachmentTypes=e.attachmentTypes.join(",")),e.keywords&&(e.keywords=e.keywords.join(",")),e.globalIds&&(e.globalIds=e.globalIds.join(",")),e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.size&&(e.size=e.size.join(",")),e}function Fpr(i,e){const t={};for(const r of e){const{parentObjectId:n,parentGlobalId:s,attachmentInfos:o}=r;for(const a of o){const{id:l}=a,u=JCt(VWi(`${i.path}/${n}/attachments/${l}`)),c=dDt.fromJSON(a);c.set({url:u,parentObjectId:n,parentGlobalId:s}),t[n]?t[n].push(c):t[n]=[c]}}return t}function kpr(i,e,t){let r={query:Dae({...i.query,f:"json",...Dpr(e)})};return t&&(r={...t,...r,query:{...t.query,...r.query}}),zi(i.path+"/queryAttachments",r).then(n=>n.data.attachmentGroups)}async function Lpr(i,e,t){const{objectIds:r}=e,n=[];for(const s of r)n.push(zi(i.path+"/"+s+"/attachments",t));return Promise.all(n).then(s=>r.map((o,a)=>({parentObjectId:o,attachmentInfos:s[a].data.attachmentInfos})))}const Npr=Object.freeze(Object.defineProperty({__proto__:null,executeAttachmentQuery:kpr,fetchAttachments:Lpr,processAttachmentQueryResult:Fpr},Symbol.toStringTag,{value:"Module"}));function $pr(i,e){const t=i.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=Hv(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function Bpr(i,e,t){const r=await e4t(i,e,t),n=r.data,s=n.geometryType,o=n.spatialReference,a={};for(const l of n.relatedRecordGroups){const u={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:o,hasZ:!!n.hasZ,hasM:!!n.hasM,features:l.relatedRecords};if(l.objectId!=null)a[l.objectId]=u;else for(const c of Object.keys(l))c!=="relatedRecords"&&(a[l[c]]=u)}return{...r,data:a}}async function jpr(i,e,t){const r=await e4t(i,e,t,{returnCountOnly:!0}),n=r.data,s={};for(const o of n.relatedRecordGroups)o.objectId!=null&&(s[o.objectId]=o.count);return{...r,data:s}}async function e4t(i,e,t={},r){const n=Dae({...i.query,f:"json",...r,...$pr(e,r)});return zi(i.path+"/queryRelatedRecords",{...t,query:{...t.query,...n}})}async function Gpr(i,e,t){e=p3.from(e);const r=gu(i);return Bpr(r,e,t).then(n=>{const s=n.data,o={};return Object.keys(s).forEach(a=>o[a]=du.fromJSON(s[a])),o})}async function Upr(i,e,t){e=p3.from(e);const r=gu(i);return jpr(r,e,{...t}).then(n=>n.data)}const Pat=Object.freeze(Object.defineProperty({__proto__:null,executeRelationshipQuery:Gpr,executeRelationshipQueryForCount:Upr},Symbol.toStringTag,{value:"Module"})),Rat="Layer does not support extent calculation.";function zpr(i,e){const t=i.geometry,r=i.toJSON(),n=r;if(t!=null&&(n.geometry=JSON.stringify(t),n.geometryType=ah(t),n.inSR=Hv(t.spatialReference)),r.topFilter?.groupByFields&&(n.topFilter.groupByFields=r.topFilter.groupByFields.join(",")),r.topFilter?.orderByFields&&(n.topFilter.orderByFields=r.topFilter.orderByFields.join(",")),r.topFilter&&(n.topFilter=JSON.stringify(n.topFilter)),r.objectIds&&(n.objectIds=r.objectIds.join(",")),r.orderByFields&&(n.orderByFields=r.orderByFields.join(",")),r.outFields&&!(e?.returnCountOnly||e?.returnExtentOnly||e?.returnIdsOnly)?r.outFields.includes("*")?n.outFields="*":n.outFields=r.outFields.join(","):delete n.outFields,r.outSR?n.outSR=Hv(r.outSR):t&&r.returnGeometry&&(n.outSR=n.inSR),r.returnGeometry&&delete r.returnGeometry,r.timeExtent){const s=r.timeExtent,{start:o,end:a}=s;o==null&&a==null||(n.time=o===a?o:`${o??"null"},${a??"null"}`),delete r.timeExtent}return n}async function Vpr(i,e,t,r){const n=await dSe(i,e,"json",r);return g1e(e,t,n.data),n}async function Hpr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:dSe(i,e,"json",t,{returnIdsOnly:!0})}async function Wpr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:dSe(i,e,"json",t,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const n=r.data;if(n.hasOwnProperty("extent"))return r;if(n.features)throw new Error(Rat);if(n.hasOwnProperty("count"))throw new Error(Rat);return r})}function qpr(i,e,t){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):dSe(i,e,"json",t,{returnIdsOnly:!0,returnCountOnly:!0})}function dSe(i,e,t,r={},n={}){const s=typeof i=="string"?Yo(i):i,o=e.geometry?[e.geometry]:[];return r.responseType="json",cy(o,null,r).then(a=>{const l=a?.[0];l!=null&&((e=e.clone()).geometry=l);const u=Dae({...s.query,f:t,...n,...zpr(e,n)});return zi(Iu(s.path,"queryTopFeatures"),{...r,query:{...u,...r.query}})})}async function Ypr(i,e,t,r){const n=gu(i),s={...r},{data:o}=await Vpr(n,rF.from(e),t,s);return du.fromJSON(o)}const Xpr=Object.freeze(Object.defineProperty({__proto__:null,executeTopFeaturesQuery:Ypr},Symbol.toStringTag,{value:"Module"}));async function Jpr(i,e,t){const r=gu(i);return(await Hpr(r,rF.from(e),{...t})).data.objectIds}const Kpr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopIds:Jpr},Symbol.toStringTag,{value:"Module"}));async function Zpr(i,e,t){const r=gu(i),n=await Wpr(r,rF.from(e),{...t}),s=n.data.extent;return!s||isNaN(s.xmin)||isNaN(s.ymin)||isNaN(s.xmax)||isNaN(s.ymax)?{count:n.data.count,extent:null}:{count:n.data.count,extent:hr.fromJSON(s)}}const Qpr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopExtents:Zpr},Symbol.toStringTag,{value:"Module"}));async function efr(i,e,t){const r=gu(i);return(await qpr(r,rF.from(e),{...t})).data.count}const tfr=Object.freeze(Object.defineProperty({__proto__:null,executeForTopCount:efr},Symbol.toStringTag,{value:"Module"}));let o$=class extends qF{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return e!=null&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"row",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"column",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"rows",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o$.prototype,"columns",void 0),o$=x([Qe("esri.CameraLayout")],o$);const t4t=o$;let ZHe=class{constructor(e,t){this.min=e,this.max=t,this.range=t-e}ndiff(e,t=0){return Math.ceil((e-t)/this.range)*this.range+t}_normalize(e,t,r,n=0,s=!1){return(r-=n)t&&(r-=this.ndiff(r-t)),s&&r===t&&(r=e),r+n}normalize(e,t=0,r=!1){return this._normalize(this.min,this.max,e,t,r)}clamp(e,t=0){return uu(e-t,this.min,this.max)+t}monotonic(e,t,r){return ee&&rkS.normalize(Gd(i)))],_I.prototype,"heading",void 0),x([D({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),So(i=>uu(Gd(i),-180,180))],_I.prototype,"tilt",void 0),x([D({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],_I.prototype,"fov",void 0),x([D({type:t4t,nonNullable:!0,json:{read:!1,write:!1}})],_I.prototype,"layout",void 0),_I=x([Qe("esri.Camera")],_I);const ifr=_I;var SNe;let T4=SNe=class extends Ci{constructor(i){super(i),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(i){return(i%=360)<0&&(i+=360),i}clone(){return new SNe({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function cMe(){return{enabled:!this.camera}}x([D({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cMe}}}}})],T4.prototype,"rotation",void 0),x([So("rotation")],T4.prototype,"castRotation",null),x([D({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:cMe}}}}})],T4.prototype,"scale",void 0),x([D({types:Ff,json:{read:Ro,write:!0,origins:{"web-scene":{read:Ro,write:{overridePolicy:cMe}}}}})],T4.prototype,"targetGeometry",void 0),x([D({type:ifr,json:{write:!0}})],T4.prototype,"camera",void 0),T4=SNe=x([Qe("esri.Viewpoint")],T4);const Ab=T4,hge={widthBreakpoint:{getValue(i){const e=i.viewSize[0],t=i.breakpoints,r=this.values;return e<=t.xsmall?r.xsmall:e<=t.small?r.small:e<=t.medium?r.medium:e<=t.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(i){const e=i.viewSize[1],t=i.breakpoints,r=this.values;return e<=t.xsmall?r.xsmall:e<=t.small?r.small:e<=t.medium?r.medium:e<=t.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(i){const e=i.viewSize,t=e[0],r=e[1],n=this.values;return r>=t?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},hMe={xsmall:544,small:768,medium:992,large:1200};function rfr(i){const e=i;return e&&e.xsmall{let e=class extends i{constructor(...t){super(...t),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=hMe}initialize(){this.addHandles(Ki(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),js))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(t){if(t===this._get("breakpoints"))return;const r=rfr(t);if(!r){const n=JSON.stringify(hMe,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}t=r?t:hMe,this._set("breakpoints",{...t})}_updateClassNames(){if(!this.container)return;const t=Ky.acquire(),r=Ky.acquire();let n,s=!1;for(n in hge){const o=this[n],a=hge[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(s=!0,this[n]=a,dMe(n,o).forEach(l=>r.push(l)),dMe(n,a).forEach(l=>t.push(l)))}s&&(this._applyClassNameChanges(t,r),Ky.release(t),Ky.release(r))}_applyClassNameChanges(t,r){const n=this.container;n&&(r.forEach(s=>n.classList.remove(s)),t.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const t=this.container;if(!t)return;let r;for(r in hge)dMe(r,this[r]).forEach(n=>t.classList.remove(n))}};return x([D()],e.prototype,"breakpoints",null),x([D()],e.prototype,"orientation",void 0),x([D()],e.prototype,"widthBreakpoint",void 0),x([D()],e.prototype,"heightBreakpoint",void 0),e=x([Qe("esri.views.BreakpointsOwner")],e),e};function eWe(i){return typeof i=="string"?document.getElementById(i):i??null}function i4t(i){for(;i.hasChildNodes();)i.removeChild(i.firstChild)}function Dat(i,e){const t=e.parentNode;t&&t.insertBefore(i,e)}function Fat(i,e){for(;;){const t=i.firstChild;if(!t)break;e.appendChild(t)}}let Mb=class extends un{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,r={}){return this._installWatch(e,t,r,Ki)}addWhen(e,t,r={}){return this._installWatch(e,t,r,v0)}addOnCollectionChange(e,t,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this.addHandles([ju(e,"after-changes",this._createSyncUpdatingCallback(),Kl),ju(e,"change",t,{onListenerAdd:r?o=>t({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>t({added:[],removed:o.toArray()}):void 0})],s),wa(()=>this.removeHandles(s))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(wa(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(whe)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this.removeHandles(t);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,t,r);return this.addHandles(o,s),wa(()=>this.removeHandles(s))}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=Ki(e,r,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(whe),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(Gk(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(whe))}),whe)}}};x([D({readOnly:!0})],Mb.prototype,"updating",void 0),Mb=x([Qe("esri.core.support.UpdatingHandles")],Mb);const whe=-42;/*! * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time) * Copyright (c) 2022 - Environmental Systems Research Institute, Inc. * Apache-2.0 @@ -60,16 +60,16 @@ import{d as da,u as uTt,r as sY,a as oY,o as pr,c as wr,w as Sm,n as Jl,b as xc, * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) * http://ucdok.com * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details - */var lfr=function(i){if(typeof i!="object"||i===null||Object.prototype.toString.call(i)!=="[object Object]")return!1;var e=Object.getPrototypeOf(i);if(e===null)return!0;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(i)===e},O6={exports:{}},wp={},Xne={exports:{}},e7={};function r4t(){var i={};return i["align-content"]=!1,i["align-items"]=!1,i["align-self"]=!1,i["alignment-adjust"]=!1,i["alignment-baseline"]=!1,i.all=!1,i["anchor-point"]=!1,i.animation=!1,i["animation-delay"]=!1,i["animation-direction"]=!1,i["animation-duration"]=!1,i["animation-fill-mode"]=!1,i["animation-iteration-count"]=!1,i["animation-name"]=!1,i["animation-play-state"]=!1,i["animation-timing-function"]=!1,i.azimuth=!1,i["backface-visibility"]=!1,i.background=!0,i["background-attachment"]=!0,i["background-clip"]=!0,i["background-color"]=!0,i["background-image"]=!0,i["background-origin"]=!0,i["background-position"]=!0,i["background-repeat"]=!0,i["background-size"]=!0,i["baseline-shift"]=!1,i.binding=!1,i.bleed=!1,i["bookmark-label"]=!1,i["bookmark-level"]=!1,i["bookmark-state"]=!1,i.border=!0,i["border-bottom"]=!0,i["border-bottom-color"]=!0,i["border-bottom-left-radius"]=!0,i["border-bottom-right-radius"]=!0,i["border-bottom-style"]=!0,i["border-bottom-width"]=!0,i["border-collapse"]=!0,i["border-color"]=!0,i["border-image"]=!0,i["border-image-outset"]=!0,i["border-image-repeat"]=!0,i["border-image-slice"]=!0,i["border-image-source"]=!0,i["border-image-width"]=!0,i["border-left"]=!0,i["border-left-color"]=!0,i["border-left-style"]=!0,i["border-left-width"]=!0,i["border-radius"]=!0,i["border-right"]=!0,i["border-right-color"]=!0,i["border-right-style"]=!0,i["border-right-width"]=!0,i["border-spacing"]=!0,i["border-style"]=!0,i["border-top"]=!0,i["border-top-color"]=!0,i["border-top-left-radius"]=!0,i["border-top-right-radius"]=!0,i["border-top-style"]=!0,i["border-top-width"]=!0,i["border-width"]=!0,i.bottom=!1,i["box-decoration-break"]=!0,i["box-shadow"]=!0,i["box-sizing"]=!0,i["box-snap"]=!0,i["box-suppress"]=!0,i["break-after"]=!0,i["break-before"]=!0,i["break-inside"]=!0,i["caption-side"]=!1,i.chains=!1,i.clear=!0,i.clip=!1,i["clip-path"]=!1,i["clip-rule"]=!1,i.color=!0,i["color-interpolation-filters"]=!0,i["column-count"]=!1,i["column-fill"]=!1,i["column-gap"]=!1,i["column-rule"]=!1,i["column-rule-color"]=!1,i["column-rule-style"]=!1,i["column-rule-width"]=!1,i["column-span"]=!1,i["column-width"]=!1,i.columns=!1,i.contain=!1,i.content=!1,i["counter-increment"]=!1,i["counter-reset"]=!1,i["counter-set"]=!1,i.crop=!1,i.cue=!1,i["cue-after"]=!1,i["cue-before"]=!1,i.cursor=!1,i.direction=!1,i.display=!0,i["display-inside"]=!0,i["display-list"]=!0,i["display-outside"]=!0,i["dominant-baseline"]=!1,i.elevation=!1,i["empty-cells"]=!1,i.filter=!1,i.flex=!1,i["flex-basis"]=!1,i["flex-direction"]=!1,i["flex-flow"]=!1,i["flex-grow"]=!1,i["flex-shrink"]=!1,i["flex-wrap"]=!1,i.float=!1,i["float-offset"]=!1,i["flood-color"]=!1,i["flood-opacity"]=!1,i["flow-from"]=!1,i["flow-into"]=!1,i.font=!0,i["font-family"]=!0,i["font-feature-settings"]=!0,i["font-kerning"]=!0,i["font-language-override"]=!0,i["font-size"]=!0,i["font-size-adjust"]=!0,i["font-stretch"]=!0,i["font-style"]=!0,i["font-synthesis"]=!0,i["font-variant"]=!0,i["font-variant-alternates"]=!0,i["font-variant-caps"]=!0,i["font-variant-east-asian"]=!0,i["font-variant-ligatures"]=!0,i["font-variant-numeric"]=!0,i["font-variant-position"]=!0,i["font-weight"]=!0,i.grid=!1,i["grid-area"]=!1,i["grid-auto-columns"]=!1,i["grid-auto-flow"]=!1,i["grid-auto-rows"]=!1,i["grid-column"]=!1,i["grid-column-end"]=!1,i["grid-column-start"]=!1,i["grid-row"]=!1,i["grid-row-end"]=!1,i["grid-row-start"]=!1,i["grid-template"]=!1,i["grid-template-areas"]=!1,i["grid-template-columns"]=!1,i["grid-template-rows"]=!1,i["hanging-punctuation"]=!1,i.height=!0,i.hyphens=!1,i.icon=!1,i["image-orientation"]=!1,i["image-resolution"]=!1,i["ime-mode"]=!1,i["initial-letters"]=!1,i["inline-box-align"]=!1,i["justify-content"]=!1,i["justify-items"]=!1,i["justify-self"]=!1,i.left=!1,i["letter-spacing"]=!0,i["lighting-color"]=!0,i["line-box-contain"]=!1,i["line-break"]=!1,i["line-grid"]=!1,i["line-height"]=!1,i["line-snap"]=!1,i["line-stacking"]=!1,i["line-stacking-ruby"]=!1,i["line-stacking-shift"]=!1,i["line-stacking-strategy"]=!1,i["list-style"]=!0,i["list-style-image"]=!0,i["list-style-position"]=!0,i["list-style-type"]=!0,i.margin=!0,i["margin-bottom"]=!0,i["margin-left"]=!0,i["margin-right"]=!0,i["margin-top"]=!0,i["marker-offset"]=!1,i["marker-side"]=!1,i.marks=!1,i.mask=!1,i["mask-box"]=!1,i["mask-box-outset"]=!1,i["mask-box-repeat"]=!1,i["mask-box-slice"]=!1,i["mask-box-source"]=!1,i["mask-box-width"]=!1,i["mask-clip"]=!1,i["mask-image"]=!1,i["mask-origin"]=!1,i["mask-position"]=!1,i["mask-repeat"]=!1,i["mask-size"]=!1,i["mask-source-type"]=!1,i["mask-type"]=!1,i["max-height"]=!0,i["max-lines"]=!1,i["max-width"]=!0,i["min-height"]=!0,i["min-width"]=!0,i["move-to"]=!1,i["nav-down"]=!1,i["nav-index"]=!1,i["nav-left"]=!1,i["nav-right"]=!1,i["nav-up"]=!1,i["object-fit"]=!1,i["object-position"]=!1,i.opacity=!1,i.order=!1,i.orphans=!1,i.outline=!1,i["outline-color"]=!1,i["outline-offset"]=!1,i["outline-style"]=!1,i["outline-width"]=!1,i.overflow=!1,i["overflow-wrap"]=!1,i["overflow-x"]=!1,i["overflow-y"]=!1,i.padding=!0,i["padding-bottom"]=!0,i["padding-left"]=!0,i["padding-right"]=!0,i["padding-top"]=!0,i.page=!1,i["page-break-after"]=!1,i["page-break-before"]=!1,i["page-break-inside"]=!1,i["page-policy"]=!1,i.pause=!1,i["pause-after"]=!1,i["pause-before"]=!1,i.perspective=!1,i["perspective-origin"]=!1,i.pitch=!1,i["pitch-range"]=!1,i["play-during"]=!1,i.position=!1,i["presentation-level"]=!1,i.quotes=!1,i["region-fragment"]=!1,i.resize=!1,i.rest=!1,i["rest-after"]=!1,i["rest-before"]=!1,i.richness=!1,i.right=!1,i.rotation=!1,i["rotation-point"]=!1,i["ruby-align"]=!1,i["ruby-merge"]=!1,i["ruby-position"]=!1,i["shape-image-threshold"]=!1,i["shape-outside"]=!1,i["shape-margin"]=!1,i.size=!1,i.speak=!1,i["speak-as"]=!1,i["speak-header"]=!1,i["speak-numeral"]=!1,i["speak-punctuation"]=!1,i["speech-rate"]=!1,i.stress=!1,i["string-set"]=!1,i["tab-size"]=!1,i["table-layout"]=!1,i["text-align"]=!0,i["text-align-last"]=!0,i["text-combine-upright"]=!0,i["text-decoration"]=!0,i["text-decoration-color"]=!0,i["text-decoration-line"]=!0,i["text-decoration-skip"]=!0,i["text-decoration-style"]=!0,i["text-emphasis"]=!0,i["text-emphasis-color"]=!0,i["text-emphasis-position"]=!0,i["text-emphasis-style"]=!0,i["text-height"]=!0,i["text-indent"]=!0,i["text-justify"]=!0,i["text-orientation"]=!0,i["text-overflow"]=!0,i["text-shadow"]=!0,i["text-space-collapse"]=!0,i["text-transform"]=!0,i["text-underline-position"]=!0,i["text-wrap"]=!0,i.top=!1,i.transform=!1,i["transform-origin"]=!1,i["transform-style"]=!1,i.transition=!1,i["transition-delay"]=!1,i["transition-duration"]=!1,i["transition-property"]=!1,i["transition-timing-function"]=!1,i["unicode-bidi"]=!1,i["vertical-align"]=!1,i.visibility=!1,i["voice-balance"]=!1,i["voice-duration"]=!1,i["voice-family"]=!1,i["voice-pitch"]=!1,i["voice-range"]=!1,i["voice-rate"]=!1,i["voice-stress"]=!1,i["voice-volume"]=!1,i.volume=!1,i["white-space"]=!1,i.widows=!1,i.width=!0,i["will-change"]=!1,i["word-break"]=!0,i["word-spacing"]=!0,i["word-wrap"]=!0,i["wrap-flow"]=!1,i["wrap-through"]=!1,i["writing-mode"]=!1,i["z-index"]=!1,i}function ufr(i,e,t){}function cfr(i,e,t){}var hfr=/javascript\s*\:/img;function dfr(i,e){return hfr.test(e)?"":e}e7.whiteList=r4t();e7.getDefaultWhiteList=r4t;e7.onAttr=ufr;e7.onIgnoreAttr=cfr;e7.safeAttrValue=dfr;var pfr={indexOf:function(i,e){var t,r;if(Array.prototype.indexOf)return i.indexOf(e);for(t=0,r=i.length;t/g,Afr=/"/g,Mfr=/"/g,Ofr=/&#([a-zA-Z0-9]*);?/gim,Pfr=/:?/gim,Rfr=/&newline;?/gim,She=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Lat=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Nat=/u\s*r\s*l\s*\(.*/gi;function l4t(i){return i.replace(Afr,""")}function u4t(i){return i.replace(Mfr,'"')}function c4t(i){return i.replace(Ofr,function(t,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function h4t(i){return i.replace(Pfr,":").replace(Rfr," ")}function d4t(i){for(var e="",t=0,r=i.length;t",r);if(n===-1)break;t=n+3}return e}function Lfr(i){var e=i.split("");return e=e.filter(function(t){var r=t.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),e.join("")}wp.whiteList=s4t();wp.getDefaultWhiteList=s4t;wp.onTag=wfr;wp.onIgnoreTag=xfr;wp.onTagAttr=Sfr;wp.onIgnoreTagAttr=Tfr;wp.safeAttrValue=Cfr;wp.escapeHtml=a4t;wp.escapeQuote=l4t;wp.unescapeQuote=u4t;wp.escapeHtmlEntities=c4t;wp.escapeDangerHtml5Entities=h4t;wp.clearNonPrintableCharacter=d4t;wp.friendlyAttrValue=p4t;wp.escapeAttrValue=f4t;wp.onIgnoreTagStripAll=Dfr;wp.StripTagBody=Ffr;wp.stripCommentTag=kfr;wp.stripBlankChar=Lfr;wp.cssFilter=o4t;wp.getDefaultCSSWhiteList=bfr;var pSe={},g5=tWe;function Nfr(i){var e=g5.spaceIndex(i),t;return e===-1?t=i.slice(1,-1):t=i.slice(1,e+1),t=g5.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function $fr(i){return i.slice(0,2)===""){r+=t(i.slice(n,s)),c=i.slice(s,a+1),u=Nfr(c),r+=e(s,r.length,u,c,$fr(c)),n=a+1,s=!1;continue}if(h==='"'||h==="'")for(var p=1,m=i.charAt(a-p);m.trim()===""||m==="=";){if(m==="="){o=h;continue e}m=i.charAt(a-++p)}}else if(h===o){o=!1;continue}}return n0;e--){var t=i[e];if(t!==" ")return t==="="?e:-1}}function Hfr(i){return i[0]==='"'&&i[i.length-1]==='"'||i[0]==="'"&&i[i.length-1]==="'"}function $at(i){return Hfr(i)?i.substr(1,i.length-2):i}pSe.parseTag=Bfr;pSe.parseAttr=Gfr;var Wfr=Xne.exports.FilterCSS,dC=wp,m4t=pSe,qfr=m4t.parseTag,Yfr=m4t.parseAttr,dge=tWe;function The(i){return i==null}function Xfr(i){var e=dge.spaceIndex(i);if(e===-1)return{html:"",closing:i[i.length-2]==="/"};i=dge.trim(i.slice(e+1,-1));var t=i[i.length-1]==="/";return t&&(i=dge.trim(i.slice(0,-1))),{html:i,closing:t}}function Jfr(i){var e={};for(var t in i)e[t]=i[t];return e}function Kfr(i){var e={};for(var t in i)Array.isArray(i[t])?e[t.toLowerCase()]=i[t].map(function(r){return r.toLowerCase()}):e[t.toLowerCase()]=i[t];return e}function g4t(i){i=Jfr(i||{}),i.stripIgnoreTag&&(i.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),i.onIgnoreTag=dC.onIgnoreTagStripAll),i.whiteList||i.allowList?i.whiteList=Kfr(i.whiteList||i.allowList):i.whiteList=dC.whiteList,i.onTag=i.onTag||dC.onTag,i.onTagAttr=i.onTagAttr||dC.onTagAttr,i.onIgnoreTag=i.onIgnoreTag||dC.onIgnoreTag,i.onIgnoreTagAttr=i.onIgnoreTagAttr||dC.onIgnoreTagAttr,i.safeAttrValue=i.safeAttrValue||dC.safeAttrValue,i.escapeHtml=i.escapeHtml||dC.escapeHtml,this.options=i,i.css===!1?this.cssFilter=!1:(i.css=i.css||{},this.cssFilter=new Wfr(i.css))}g4t.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onTag,s=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,l=t.safeAttrValue,u=t.escapeHtml,c=e.cssFilter;t.stripBlankChar&&(i=dC.stripBlankChar(i)),t.allowCommentTag||(i=dC.stripCommentTag(i));var h=!1;t.stripIgnoreTagBody&&(h=dC.StripTagBody(t.stripIgnoreTagBody,s),s=h.onIgnoreTag);var p=qfr(i,function(m,v,w,S,I){var R={sourcePosition:m,position:v,isClosing:I,isWhite:Object.prototype.hasOwnProperty.call(r,w)},L=n(w,S,R);if(!The(L))return L;if(R.isWhite){if(R.isClosing)return"";var k=Xfr(S),B=r[w],$=Yfr(k.html,function(V,Y){var K=dge.indexOf(B,V)!==-1,Q=o(w,V,Y,K);return The(Q)?K?(Y=l(w,V,Y,c),Y?V+'="'+Y+'"':V):(Q=a(w,V,Y,K),The(Q)?void 0:Q):Q});return S="<"+w,$&&(S+=" "+$),k.closing&&(S+=" /"),S+=">",S}else return L=s(w,S,R),The(L)?u(S):L},u);return h&&(p=h.remove(p)),p};var Zfr=g4t;(function(i,e){var t=wp,r=pSe,n=Zfr;function s(a,l){var u=new n(l);return u.process(a)}e=i.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var a in t)e[a]=t[a];for(var l in r)e[l]=r[l]}();function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=i.exports)})(O6,O6.exports);var Qfr=function(){function i(e,t){var r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(s,o,a,l){return s==="a"&&o==="href"||(s==="img"||s==="source")&&o==="src"?r.sanitizeUrl(a):O6.exports.safeAttrValue(s,o,a,l)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!t?n=e:e&&t?(n=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach(function(s){s==="whiteList"?n.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,e.whiteList||{}]):n[s]=e[s]})):(n=Object.create(this.arcgisFilterOptions),n.whiteList=this.arcgisWhiteList),this.xssFilterOptions=n,this._xssFilter=new O6.exports.FilterXSS(n)}return i.prototype.sanitize=function(e,t){switch(t===void 0&&(t={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,t);default:return t.allowUndefined&&typeof e>"u"?void 0:null}},i.prototype.sanitizeUrl=function(e,t){var r=(t??{}).isProtocolRequired,n=r===void 0?!0:r,s=this._trim(e.substring(0,e.indexOf(":"))),o=e==="/",a=/^#/.test(e),l=s&&this.allowedProtocols.indexOf(s.toLowerCase())>-1;return o||a||l?O6.exports.escapeAttrValue(e):!s&&!n?O6.exports.escapeAttrValue("https://".concat(e)):""},i.prototype.sanitizeHTMLAttribute=function(e,t,r,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,t,r,n):O6.exports.safeAttrValue(e,t,r,n)},i.prototype.validate=function(e,t){t===void 0&&(t={});var r=this.sanitize(e,t);return{isValid:e===r,sanitized:r}},i.prototype.encodeHTML=function(e){var t=this;return String(e).replace(/[&<>"'\/]/g,function(r){return t._entityMap[r]})},i.prototype.encodeAttrValue=function(e){var t=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(r,n){return t.test(r)?r:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},i.prototype._extendObjectOfArrays=function(e){var t={};return e.forEach(function(r){Object.keys(r).forEach(function(n){Array.isArray(r[n])&&Array.isArray(t[n])?t[n]=t[n].concat(r[n]):t[n]=r[n]})}),t},i.prototype._iterateOverObject=function(e,t){var r=this;t===void 0&&(t={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(a,l){var u=r.validate(l,t);return u.isValid?a.concat([l]):(n=!0,a.concat([u.sanitized]))},[]);else if(lfr(e)){var o=Object.keys(e);s=o.reduce(function(a,l){var u=e[l],c=r.validate(u,t);return c.isValid?a[l]=u:(n=!0,a[l]=c.sanitized),a},{})}else return t.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},i.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},i}();const fSe=new Map;function y4t(){fSe.clear()}function emr(i){return fSe.get(i)}function tmr(i,e){fSe.set(i,e)}function pMe(i){fSe.delete(i)}const imr=()=>di.getLogger("esri.widgets.support.widgetUtils");function v4t(...i){const e=Ky.acquire();for(let r=0;r{const i=new Map,e=new ResizeObserver(r=>{y4t();for(const n of r)i.get(n.target)?.(n)}),t=(r,n,s)=>(i.has(r)&&imr().error("Already observing element",r),i.set(r,n),e.observe(r,s),wa(()=>{e.unobserve(r),i.delete(r)}));return(r,n,s)=>{let o=null;return j3([Ki(()=>typeof r=="function"?r():r,a=>{o?.remove(),a&&(o=t(a,n,s))},Ah),wa(()=>o?.remove())])}})();function nk(i){const e=i?.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function Bat(i){const e="data-node-ref";this[i.getAttribute(e)]=null}function jat(i){const e="data-node-ref";this[i.getAttribute(e)]=i}const rmr=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],nmr=rmr.reduce((i,e)=>(i[e]=[],i),{}),smr=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],_4t=new Qfr({whiteList:nmr,onTagAttr:(i,e,t)=>{const r=`${e}="${t}"`;if(smr.includes(e))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function omr(i){return i==="Enter"||i===" "}const b4t="http://www.w3.org/",mSe=`${b4t}2000/svg`,w4t=`${b4t}1999/xlink`;let Gat=[],iWe=(i,e)=>{let t={};return Object.keys(i).forEach(r=>{t[r]=i[r]}),e&&Object.keys(e).forEach(r=>{t[r]=e[r]}),t},rWe=(i,e)=>i.vnodeSelector===e.vnodeSelector&&(i.properties&&e.properties?i.properties.key===e.properties.key&&i.properties.bind===e.properties.bind:!i.properties&&!e.properties),x4t=i=>{if(typeof i!="string")throw new Error("Style values must be strings")},amr=(i,e,t)=>{if(e.vnodeSelector!==""){for(let r=t;r{let n=i[e];if(n.vnodeSelector==="")return;let s=n.properties;if(!(s&&(s.key===void 0?s.bind:s.key))){for(let o=0;o{if(i.properties){let e=i.properties.enterAnimation;e&&e(i.domNode,i.properties)}},TNe=[],CNe=!1,S4t=i=>{(i.children||[]).forEach(S4t),i.properties&&i.properties.afterRemoved&&i.properties.afterRemoved.apply(i.properties.bind||i.properties,[i.domNode])},Uat=()=>{CNe=!1,TNe.forEach(S4t),TNe.length=0},zat=i=>{TNe.push(i),CNe||(CNe=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(Uat,{timeout:16}):setTimeout(Uat,16))},Vat=i=>{let e=i.domNode;if(i.properties){let t=i.properties.exitAnimation;if(t)return e.style.pointerEvents="none",void t(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),zat(i))},i.properties)}e.parentNode&&(e.parentNode.removeChild(e),zat(i))},umr=(i,e,t)=>{if(!e)return;let r=t.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let r of e)jz(r,i,void 0,t)},T4t=(i,e,t)=>{cmr(i,e.children,t),e.text&&(i.textContent=e.text),umr(i,e.properties,t),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[i,t,e.vnodeSelector,e.properties,e.children])},jz=(i,e,t,r)=>{let n,s=0,o=i.vnodeSelector,a=e.ownerDocument;if(o==="")n=i.domNode=a.createTextNode(i.text),t!==void 0?e.insertBefore(n,t):e.appendChild(n);else{for(let l=0;l<=o.length;++l){let u=o.charAt(l);if(l===o.length||u==="."||u==="#"){let c=o.charAt(s-1),h=o.slice(s,l);c==="."?n.classList.add(h):c==="#"?n.id=h:(h==="svg"&&(r=iWe(r,{namespace:mSe})),r.namespace!==void 0?n=i.domNode=a.createElementNS(r.namespace,h):(n=i.domNode=i.domNode||a.createElement(h),h==="input"&&i.properties&&i.properties.type!==void 0&&n.setAttribute("type",i.properties.type)),t!==void 0?e.insertBefore(n,t):n.parentNode!==e&&e.appendChild(n)),s=l+1}}T4t(n,i,r)}},INe=(i,e,t)=>{e&&e.split(" ").forEach(r=>{r&&i.classList.toggle(r,t)})},hmr=(i,e,t,r)=>{if(!t)return;let n=!1,s=Object.keys(t),o=s.length;for(let a=0;a{if(t===r)return!1;r=r||Gat;let s,o=(t=t||Gat).length,a=r.length,l=0,u=0,c=!1;for(;u=0){for(s=l;sl)for(s=l;s{let r=i.domNode,n=!1;if(i===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==i.text){let o=r.ownerDocument.createTextNode(e.text);return r.parentNode.replaceChild(o,r),e.domNode=o,n=!0,n}e.domNode=r}else e.vnodeSelector.lastIndexOf("svg",0)===0&&(t=iWe(t,{namespace:mSe})),i.text!==e.text&&(s=!0,e.text===void 0?r.removeChild(r.firstChild):r.textContent=e.text),e.domNode=r,s=dmr(e,r,i.children,e.children,t)||s,s=hmr(r,i.properties,e.properties,t)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[r,t,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(r,e.properties,i.properties),n};let UJ=(i,e)=>({getLastRender:()=>i,update:t=>{if(i.vnodeSelector!==t.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=i;i=t,D1e(r,t,e)},domNode:i.domNode});const pmr={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(i,e,t)=>{e.charAt(0)==="-"?i.style.setProperty(e,t):i.style[e]=t}};let tU=i=>iWe(pmr,i),sF={create:(i,e)=>(e=tU(e),jz(i,document.createElement("div"),void 0,e),UJ(i,e)),append:(i,e,t)=>(t=tU(t),jz(e,i,void 0,t),UJ(e,t)),insertBefore:(i,e,t)=>(t=tU(t),jz(e,i.parentNode,i,t),UJ(e,t)),merge:(i,e,t)=>(t=tU(t),e.domNode=i,T4t(i,e,t),UJ(e,t)),replace:(i,e,t)=>(t=tU(t),jz(e,i.parentNode,i,t),i.parentNode.removeChild(i),UJ(e,t))},C4t,fmr=(i,e)=>{let t=[];for(;i&&i!==e;)t.push(i),i=i.parentNode;return t};C4t=Array.prototype.find?(i,e)=>i.find(e):(i,e)=>i.filter(e)[0];let mmr=(i,e)=>{let t=i;return e.forEach(r=>{t=t&&t.children?C4t(t.children,n=>n.domNode===r):void 0}),t},gmr=(i,e,t)=>{let r=function(n){t("domEvent",n);let s=e(),o=fmr(n.currentTarget,s.domNode);o.reverse();let a,l=mmr(s.getLastRender(),o);return i.scheduleRender(),l&&(a=l.properties[`on${n.type}`].apply(l.properties.bind||this,arguments)),t("domEventProcessed",n),a};return(n,s,o,a)=>r},ANe=i=>{let e,t,r=tU(i),n=r.performanceLogger,s=!0,o=!1,a=[],l=[],u=(h,p,m)=>{let v,w=()=>v;r.eventHandlerInterceptor=gmr(e,w,n),v=h(p,m(),r),a.push(v),l.push(m)},c=()=>{if(t=void 0,s){s=!1,n("renderStart",void 0);for(let h=0;h{t||o||(t=requestAnimationFrame(c))},stop:()=>{t&&(cancelAnimationFrame(t),t=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(h,p)=>{u(sF.append,h,p)},insertBefore:(h,p)=>{u(sF.insertBefore,h,p)},merge:(h,p)=>{u(sF.merge,h,p)},replace:(h,p)=>{u(sF.replace,h,p)},detach:h=>{for(let p=0;p0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,t=>{for(const r of t.added){const n=()=>r.render();this._callbacks.set(r,n),this._projector.append(this.surface,n)}for(const r of t.removed){const n=this._projector.detach(this._callbacks.get(r));this.surface.removeChild(n.domNode),this._callbacks.delete(r)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const t=this._hiddenSurface,r=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);r.append(t,s),r.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(r.detach(s);t.firstChild;)t.removeChild(t.firstChild);return o}overlaps(e,t){const r=this.computeBoundingRect(e),n=this.computeBoundingRect(t);return Math.max(r.left,n.left)<=Math.min(r.right,n.right)&&Math.max(r.top,n.top)<=Math.min(r.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e,t){const r=!!t?.disableDecorations;if(!this.items.some(s=>s.visible&&!(r&&s.isDecoration)))return;const n=e.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{r&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};x([D({readOnly:!0})],C4.prototype,"surface",void 0),x([D({readOnly:!0})],C4.prototype,"items",void 0),x([D({readOnly:!0})],C4.prototype,"needsRender",null),x([D({readOnly:!0})],C4.prototype,"_watchUpdatingTracking",void 0),x([D({readOnly:!0})],C4.prototype,"updating",null),C4=x([Qe("esri.views.overlay.ViewOverlay")],C4);const Hat=C4,mMe=[0,0];function ymr(i){const e=(i.ownerDocument||window.document).defaultView,t=i.getBoundingClientRect();return mMe[0]=t.left+(e?.pageXOffset??0),mMe[1]=t.top+(e?.pageYOffset??0),mMe}function Wat(i){i&&(i4t(i),i.parentNode&&i.parentNode.removeChild(i))}function vmr(i){const e=document.createElement("div");return i.appendChild(e),e}const zJ=16,Che=750,_mr=512,bmr=2,wmr=i=>{let e=class extends i{constructor(...t){super(...t),this._freqInfo={freq:zJ,time:Che},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([Ki(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),Ki(()=>this.navigating,r=>{const{surface:n}=this;n&&n.setAttribute("data-navigating",r.toString())})])}initialize(){const t=yi("mac"),r=async()=>{t&&(await fR(()=>this.ready),this.messagesCommon=await Cze("esri/t9n/common").catch(()=>{}))};r(),this.addHandles([Ki(()=>this.ui,(n,s)=>this._handleUIChange(n,s),js),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused")),_ze(r),Ki(()=>[this.surface,this.messagesCommon],()=>{t&&this.surface?.setAttribute("aria-label",this.messagesCommon?.ariaLabels?.navigationMacVoiceOver??"")})])}destroy(){this.destroyed||(this.ui=zo(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(t){const r=this._get("container"),n=eWe(t);if(n||typeof t!="string"||di.getLogger(this).error("#container",`element with id '${t}' not found`),r===n)return;if(this._stopMeasuring(),r&&(r.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(Wat(this.root),this._set("root",null)),this.userContent&&(Fat(this.userContent,r),Wat(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const s=document.createElement("div");s.className="esri-view-user-storage",Fat(n,s),n.appendChild(s),this._set("userContent",s);const o=document.createElement("div");o.className="esri-view-root",n.insertBefore(o,n.firstChild),this._set("root",o);const a=document.createElement("div");a.className="esri-view-surface",a.setAttribute("role","application"),a.tabIndex=0,o.appendChild(a),this._set("surface",a);const l=new Hat;o.appendChild(l.surface),this._set("overlay",l),this.addHandles(Ki(()=>l.needsRender,u=>{u&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=H9({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=Hc(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",n),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,r,n){const s=this.position;return t-=s?s[0]:0,r-=s?s[1]:0,n?(n[0]=t,n[1]=r):n=[t,r],n}containerToPage(t,r,n){const s=this.position;return t+=s?s[0]:0,r+=s?s[1]:0,n?(n[0]=t,n[1]=r):n=[t,r],n}_handleUIChange(t,r){this.removeHandles("ui"),r&&r!==t&&r.destroy(),t&&(t.view=this,this.addHandles(Ki(()=>this.root,n=>{t.container=n?vmr(n):null},js),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=zJ,t.time=Che,this.addHandles([BA(window,"resize",()=>{t.freq=zJ,t.time=Che}),H9({prepare:r=>{const n=this._measure(),s=this._freqInfo;if(s.time+=r.deltaTime,n&&(s.freq=zJ,this._get("resizing")||this._set("resizing",!0)),s.time=_mr&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,r=t?t.clientWidth:0,n=t?t.clientHeight:0;if(r===0||n===0)return this.suspended||this._set("suspended",!0),!1;const s=this.width,o=this.height;return r===s&&n===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",r),this._set("height",n),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:s,oldHeight:o,width:r,height:n}),!0)}_position(){const t=this.container,r=this.position,n=t&&ymr(t);return!!n&&(!r||n[0]!==r[0]||n[1]!==r[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return x([D()],e.prototype,"container",null),x([D({readOnly:!0})],e.prototype,"focused",null),x([D({readOnly:!0})],e.prototype,"height",void 0),x([D()],e.prototype,"messagesCommon",void 0),x([D({type:Hat})],e.prototype,"overlay",void 0),x([D({readOnly:!0})],e.prototype,"position",void 0),x([D({readOnly:!0})],e.prototype,"resizing",void 0),x([D({readOnly:!0})],e.prototype,"root",void 0),x([D({value:null,readOnly:!0})],e.prototype,"size",null),x([D({readOnly:!0})],e.prototype,"surface",void 0),x([D({readOnly:!0})],e.prototype,"suspended",void 0),x([D()],e.prototype,"ui",void 0),x([D({readOnly:!0})],e.prototype,"userContent",void 0),x([D({readOnly:!0})],e.prototype,"width",void 0),x([D()],e.prototype,"widthBreakpoint",void 0),e=x([Qe("esri.views.DOMContainer")],e),e};let xmr=class{constructor(e,t){this._owner=t,this._properties={},this._afterDispatchHandle=null;for(const r in e){const n=e[r],s=new cCt(n,void 0,void 0,2,2);this._properties[r]={pool:s,acquired:[]}}this._afterDispatchHandle=wHi(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const t=this._properties[e];for(const r of t.acquired)ert(r)||t.pool.release(r);t.pool.destroy(),t.pool=null,t.acquired=null}this._properties=null,this._owner=null}get(e){const t=this._owner._get(e),r=this._properties[e];let n=r.pool.acquire();for(r.acquired.push(n);n===t;)r.acquired.push(n),n=r.pool.acquire();return n}_release(){for(const e in this._properties){const t=this._properties[e];let r=0;for(const n of t.acquired)ert(n)?t.acquired[r++]=n:t.pool.release(n);t.acquired.length=r}}};const Smr=yi("mac")?"Meta":"Ctrl",Tmr=new Set(["Alt","Ctrl","Meta","Shift","Primary"]),Cmr=i=>Tmr.has(i);let Emr=class{constructor(e,t=[]){this.eventType=e,this.keyModifiers=t}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const t=e.modifiers;for(const r of this.keyModifiers)if(!t.has(r))return!1;return!0}};const qat=()=>di.getLogger("esri.views.input.InputHandler");let Ag=class{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const t=this._incoming[e];for(const r of t)this._incomingEventMatches.push(r.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(e=>e.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?qat().error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(t=>this._handleEvent(t)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,t,r){let n;typeof t=="function"?(r=t,n=[]):n=t||[];const s=typeof e=="string"?new Emr(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=c=>{const h=this._incoming[c.match.eventType];if(h){const p=h.indexOf(c);h.splice(p,1),o(),this._manager&&this._manager.updateDependencies()}},l=new Imr(s,r,{onPause:a,onRemove:a,onResume:c=>{const h=this._incoming[c.match.eventType];h&&!h.includes(c)&&(h.push(c),o(),this._manager&&this._manager.updateDependencies())}});let u=this._incoming[s.eventType];return u||(u=[],this._incoming[s.eventType]=u),u.push(l),o(),this._manager&&this._manager.updateDependencies(),l}registerOutgoing(e){if(this._outgoing[e])throw new Error("There is already a callback registered for this outgoing InputEvent: "+e);const t=new Amr(e,{onEmit:(r,n,s,o)=>{this._manager?.emit(r.eventType,n,s,o)},onRemove:r=>{delete this._outgoing[r.eventType],this._manager?.updateDependencies()}});return this._outgoing[e]=t,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),t}startCapturingPointer(e){this._manager?.setPointerCapture(e,!0)}stopCapturingPointer(e){this._manager?.setPointerCapture(e,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):qat().error("This InputHandler is not registered with an InputManager")}_handleEvent(e){const t=this._incoming[e.type];if(t){for(const r of t)if(r.match.matches(e)&&(r.callback?.(e),e.shouldStopPropagation()))break}}},Imr=class{constructor(e,t,r){this.match=e,this._callback=t,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},Amr=class{constructor(e,t){this.eventType=e,this._removed=!1,this._handler=t}emit(e,t,r){this._removed||this._handler.onEmit(this,e,t,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},Mmr=class extends Ag{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",t=>{this._update(t.data)})}_update(e){const t=e.native.pointerType==="touch"?"touch":"mouse",{x:r,y:n}=e;t===this._value&&this._x===r&&this._y===n||(this._value=t,this._x=r,this._y=n,this._onChange(t,r,n))}},Omr=class{constructor(e,t){this._observable=new pY,this._value=e,this._equalityFunction=t}get value(){return Ws(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}};function hB(i,e=YTt){return new Omr(i,e)}let Pmr=class extends Ag{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=hB(!1),this._onPointerAdd=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.add(e.native.pointerId),this._update())},this._onPointerRemove=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.delete(e.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},A2=class extends un{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=Smr,this._latestPointerType="mouse",this._propertiesPool=new xmr({latestPointerLocation:Fmr},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,r=zA.INTERNAL){if(this._nameToGroup[e])return void di.getLogger(this).error("There is already an InputHandler group registered under the name `"+e+"`");if(t.length===0)return void di.getLogger(this).error("Can't register a group of zero handlers");const n={name:e,handlers:t.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,l,u,c,h)=>{this._emitInputEvent(o.priorityIndex+1,a,l,u,h,c)},setPointerCapture:(a,l)=>{this._setPointerCapture(n,o,a,l)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(r=>{r.removed=!0,r.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):di.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}isModifierKeyDown(e){return this._activeKeyModifiers&&this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const n=this._handlers[r];n.priorityIndex=r,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const n=this._handlersPriority[r];n.priorityIndex=r;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(e.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){e.add(o.eventType);for(const a of o.keyModifiers)Cmr(a)||t.add(a)}n.active=s}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,r){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(n==null||n.x!==t||n.y!==r){const s=this._propertiesPool.get("latestPointerLocation");s.x=t,s.y=r,this._set("latestPointerLocation",s)}}_onEventReceived(e,t){if(e==="pointer-capture-lost"){const s=t;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,t);const r=this.test.timestamp!=null?this.test.timestamp:t.native?t.native.timestamp:void 0,n=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,r,n)}_updateKeyModifiers(e,t){if(!t)return;let r=!1;const n=()=>{if(!r){const a=new Set;this._activeKeyModifiers.forEach(l=>{a.add(l)}),this._activeKeyModifiers=a,r=!0}},s=(a,l)=>{l&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!l&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(e==="key-down"||e==="key-up"){const a=t.key;this._keyModifiers.has(a)&&s(a,e==="key-down")}const o=t.native;s("Alt",!(!o||!o.altKey)),s("Ctrl",!(!o||!o.ctrlKey)),s("Shift",!(!o||!o.shiftKey)),s("Meta",!(!o||!o.metaKey)),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new Mmr((e,t,r)=>this._setLatestPointer(e,t,r)),this._multiTouchHandler=new Pmr,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],zA.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,zA.INTERNAL)}_setPointerCapture(e,t,r,n){const s=e.name+"-"+t.priorityIndex,o=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,r,n){this._emitInputEvent(0,e,t,r,n)}_emitInputEvent(e,t,r,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),l=s!==void 0&&s,u={event:new Rmr(t,r,a,o||this._activeKeyModifiers,l),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(u):this._doNewPropagation(u)}_doNewPropagation(e){this._currentPropagation={events:new m1e,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:r}=e.events.pop(),n=t.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new m1e;t.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)t.push(r.events.pop());r.events=t,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const n of t.handler.incomingEventMatches){if(r.eventType!==n.eventType)continue;const s=r.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===r.keyModifiers.length!=(s.length===n.keyModifiers.length))return r.keyModifiers.length>n.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const r of e){let n=0;for(;n=0;)n++;t.splice(n,0,r)}return t}get debug(){const e=t=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},t(),this._setPointerCapture=r};return{injectEvent:(t,r)=>{e(()=>{this._onEventReceived(t,r)})},disablePointerCapture:e}}};x([D({readOnly:!0})],A2.prototype,"hasPendingInputs",null),x([D({constructOnly:!0})],A2.prototype,"eventSource",void 0),x([D({constructOnly:!0})],A2.prototype,"recognizers",void 0),x([D()],A2.prototype,"_latestPointerType",void 0),x([D()],A2.prototype,"latestPointerType",null),x([D()],A2.prototype,"multiTouchActive",null),x([D({readOnly:!0})],A2.prototype,"latestPointerLocation",void 0),x([D()],A2.prototype,"_paused",void 0),x([D({readOnly:!0})],A2.prototype,"updating",null),A2=x([Qe("esri.views.input.InputManager")],A2);let Rmr=class{constructor(e,t,r,n,s){this.type=e,this.data=t,this.timestamp=r,this.modifiers=n,this.cancelable=s,this._propagationState=y5.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=y5.STOPPED}shouldStopPropagation(){return(this._propagationState&y5.STOPPED)!=0}async(e){this._propagationState|=y5.PAUSED;const t=(r,n)=>{this._propagationState&=~y5.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw r;return r};return(typeof e=="function"?e():e).then(r=>t(r,!1),r=>t(r,!0))}shouldPausePropagation(e){return!!(this._propagationState&y5.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var y5;(function(i){i[i.NONE=0]="NONE",i[i.STOPPED=1]="STOPPED",i[i.PAUSED=2]="PAUSED"})(y5||(y5={}));const zA={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Dmr=class{};const Fmr=Dmr;function GE(i){return i!=null&&"open"in i&&"declaredClass"in i}function Yat(i){return i!=null&&"declaredClass"in i&&"dockOptions"in i}const kmr=i=>{let e=class extends i{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([Ki(()=>[this.ui,this.popup],([t,r],n)=>{const s="popup",o="manual";if(n){const[a,l]=n;a&&GE(l)&&(l.view=null,Yat(l)&&a.remove(l,s))}t&&GE(r)&&(r.view=this,Yat(r)&&t.add(r,{key:s,position:o,internal:!0}))},js),this.on("click",t=>{this.popup&&this.popupEnabled&&(t.pointerType!=="mouse"||t.button===0)&&(!GE(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(GE(this.popup)?this.popup.viewModel.handleViewClick(t):t.async(async()=>{await this.setupPopup(),GE(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(t)})))},zA.WIDGET)]),fR(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{Promise.resolve().then(()=>cvt)})}destroy(){this.destroyed||this.closePopup()}async openPopup(t){if(GE(this.popup))return this.popup.open(t);try{if(await this.setupPopup(),!this.popup)return void di.getLogger(this).error(new qe("view:null-popup","Popup is null and can't be opened"));this.popup.open(t)}catch{}}closePopup(){this._popupSetupTask?.abort(),GE(this.popup)&&this.popup.close()}async fetchPopupFeatures(t,r){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(t,r),r)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!GE(this.popup))return this._popupSetupTask=pE(async t=>{const{default:r}=await Promise.resolve().then(()=>cvt);if(hn(t),!this.popup||GE(this.popup))return;const n=this.popup;delete n.open,delete n.close,this.popup=new r(n)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:t,hits:r},n){const s=[],o=[];let a=!1;const l=tHi(n,yi("popup-view-fetch-timeout")??Nmr),u=p=>{const m=new Lmr(p);return o.push(m),s.push(m.promise),m},c=p=>{const m=o.at(-1);return m&&m.layerView===p&&!a?m:u(p)};for(const p of r)"graphic"in p?(c(p.layerView).graphics.push(p.graphic),a=!1):(s.push(p.layerView.fetchPopupFeaturesAtLocation(p.mapPoint,l)),a=!0);o.map(p=>p.resolve(l));const h=yve(s).then(p=>p.filter(m=>!!m).flat());return{pendingFeatures:s,allGraphicsPromise:h,location:t}}async _getPopupHits(t,r){const{hits:n,location:s}=await this.popupHitTest(t);hn(r);const o=[];for(const a of n)if("graphic"in a){if(this._isValidPopupGraphic(a.graphic,r)){const l=this._isValidPopupGraphicsLayerView(a.layerView)?a.layerView:void 0;o.push({graphic:a.graphic,layerView:l})}}else this._isValidPopupLocationLayerView(a.layerView)&&o.push({mapPoint:a.mapPoint,layerView:a.layerView});return{hits:o,location:s}}_isValidPopupGraphic(t,r){return t&&!!t.getEffectivePopupTemplate(r!=null&&r.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(t){return!t||(!("layer"in t)||!t.suspended)&&"fetchPopupFeaturesFromGraphics"in t}_isValidPopupLocationLayerView(t){return(!("layer"in t)||!t.suspended)&&"fetchPopupFeaturesAtLocation"in t}};return x([D({cast(t){return!t||GE(t)||typeof t=="object"&&(t.open=r=>(UF(di.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(r)),t.close=()=>(UF(di.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),t}})],e.prototype,"popup",void 0),x([D()],e.prototype,"popupEnabled",void 0),e=x([Qe("esri.views.PopupView")],e),e};let Lmr=class{constructor(e){this.layerView=e,this._resolver=ac(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){const{layerView:t,graphics:r,_resolver:n}=this;if(!t)return n.resolve(r),n.promise;let s;return t.fetchPopupFeaturesFromGraphics(r,e).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Nmr=5e3;let F1e=class extends Lie{constructor(e){super(e),this.addHandles(this.on("before-add",t=>{t.item!=null&&t.item.parent===this.owner&&(di.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),t.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};F1e=x([Qe("esri.support.AnalysesCollection")],F1e);let E4=class extends un{constructor(e){super(e),this.view=null,this.baseLayerViews=new dr,this.referenceLayerViews=new dr,this._loadingHandle=Ki(()=>this.view?.map?.basemap,t=>{t&&t.load().catch(()=>{})},js)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const e of this.baseLayerViews)e.destroy();this.baseLayerViews.length=0;for(const e of this.referenceLayerViews)e.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view&&this.view.suspended)return!1;const e=this.view?.map?.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(t=>t.updating)||this.referenceLayerViews.some(t=>t.updating))}};x([D({constructOnly:!0})],E4.prototype,"view",void 0),x([D({readOnly:!0})],E4.prototype,"baseLayerViews",void 0),x([D({readOnly:!0})],E4.prototype,"referenceLayerViews",void 0),x([D({readOnly:!0})],E4.prototype,"suspended",null),x([D({type:Boolean,readOnly:!0})],E4.prototype,"updating",null),E4=x([Qe("esri.views.BasemapView")],E4);function $mr(i){return"tryRecycleWith"in i}let Bmr=class{constructor(e,t,r){this.layer=e,this.view=t,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=ac(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Qh(this._controller.signal,()=>{const n=new qe("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!$mr(this.layerView))return null;const t=this.layer.type,r=this._controller.signal;for(let n=0;n(hn(this._controller.signal),s.emit("layerview-destroy",{view:l,layerView:a}),l.emit("layerview-destroy",{view:l,layerView:a}),s.emit("layerview-create",{view:l,layerView:a}),l.emit("layerview-create",{view:l,layerView:a}),a)),new Promise((u,c)=>Qh(this._controller.signal,()=>c(Oc())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:t,view:r}=this;t.emit("layerview-destroy",{view:r,layerView:e}),r.emit("layerview-destroy",{layer:t,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:t,view:r}=this;this._map=r.map;try{let n,s;if(await t.load({signal:e}),t.prefetchResources&&await t.prefetchResources({signal:e}),Gmr(t))n=await t.createLayerView(r,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(t))throw new qe("layer:view-not-supported","No layerview implementation was found");const l=await this.layerViewImporter.importLayerView(t);hn(e),n="default"in l?new l.default({layer:t,view:r}):new l({layer:t,view:r})}const o=()=>{s=Hc(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Qh(e,o),hn(e);try{await n.when()}catch(l){throw o(),l}if(!this._map?.allLayers?.includes(t))return o(),void this._deferred.reject(new qe("view:no-layerview-for-layer","The layer has been removed from the map",{layer:t}));this.layerView=n,t.emit("layerview-create",{view:r,layerView:n}),r.emit("layerview-create",{layer:t,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){t.emit("layerview-create-error",{view:r,error:n}),r.emit("layerview-create-error",{layer:t,error:n}),this.done=!0,this._deferred.reject(new qe("layerview:create-error","layerview creation failed",{layer:t,error:n}))}}},M2=class extends un{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new Mb,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const t=this.view.map?.allLayers;if(t)for(const r of t)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ac(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Gk(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const t=this.view.map;if(this._map!==t&&(this.clear(),this._map=t),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,n=[],s=this.view.ready,o=l=>{if(l!=null){for(const u of l)if(u){r.add(u);const c=this._layerLayerViewInfoMap.get(u);c&&s?c.start():c||this._recyclingInfoMap.has(u)||n.push(u),"layers"in u&&u.layers&&o(u.layers)}}};for(const l of this._rootCollectionNames)o(_S(this,l));for(const[l,u]of this._layerLayerViewInfoMap)if(!r.has(l)){this._layerLayerViewInfoMap.delete(u.layer);const c=u.tryRecycle(n);c?(this.notifyChange("updating"),this._recyclingInfoMap.set(u.layer,u),c.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),this._layerLayerViewInfoMap.set(u.layer,u),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),u.destroy(),this._reschedule()})):u.destroy()}for(const[l,u]of this._recyclingInfoMap)r.has(l)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),u.destroy());for(const l of n)this._createLayerView(l);this._refreshCollections();const a=[t?.ground?.layers,t?.basemap?.baseLayers,t?.basemap?.referenceLayers,t?.layers].filter(l=>!!l);r.forEach(l=>"layers"in l&&a.push(l.layers)),this.addHandles(a.map(l=>this._watchUpdatingTracking.addOnCollectionChange(()=>l,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ju(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),Ki(()=>{const e=this.view,t=e?.map;return[t?.basemap,t?.ground,t?.layers,e?.ready]},()=>this._reschedule(),Ah)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),uMe(this._recyclingInfoMap),uMe(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Oc()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||i2e(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const t of this._layerLayerViewInfoMap.values())t.done||++e;return e}clear(){this.destroyed||(uMe(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new qe("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,t]of this._layersToLayerViews)this._populateLayerViewsOwners(_S(this,e),_S(this,t),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,t,r){if(!e||!t)return void(t&&t.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=r,t.at(n)!==a&&t.splice(n,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const t=new Bmr(e,this.view,this.layerViewImporter);t.promise.then(()=>this._refreshCollections(),r=>{r&&(mo(r)||r.name==="cancelled:layerview-create")||di.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,t),this.view.ready&&t.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};x([D()],M2.prototype,"_workPromise",void 0),x([D({readOnly:!0})],M2.prototype,"_watchUpdatingTracking",void 0),x([D({readOnly:!0})],M2.prototype,"_layersToLayerViews",null),x([D({readOnly:!0})],M2.prototype,"_rootCollectionNames",null),x([D()],M2.prototype,"layerViewImporter",void 0),x([D()],M2.prototype,"supportsGround",void 0),x([D({readOnly:!0})],M2.prototype,"updating",null),x([D({readOnly:!0})],M2.prototype,"updatingRemaining",null),x([D({constructOnly:!0})],M2.prototype,"view",void 0),M2=x([Qe("esri.views.LayerViewManager")],M2);const jmr=M2;function Gmr(i){return"createLayerView"in i&&i.createLayerView!=null}let xw=class extends un{constructor(e){super(e),this.factor=1.5,this.offset=Vd(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};x([D({type:Number})],xw.prototype,"factor",void 0),x([D({nonNullable:!0})],xw.prototype,"offset",void 0),x([D()],xw.prototype,"position",void 0),x([D({type:Number,range:{min:0}})],xw.prototype,"size",void 0),x([D()],xw.prototype,"maskUrl",void 0),x([D()],xw.prototype,"maskEnabled",void 0),x([D()],xw.prototype,"overlayUrl",void 0),x([D()],xw.prototype,"overlayEnabled",void 0),x([D({readOnly:!0})],xw.prototype,"version",null),x([D({type:Boolean})],xw.prototype,"visible",void 0),xw=x([Qe("esri.views.Magnifier")],xw);const E4t=xw;let WV=class{constructor(e){this._observable=new pY,this._map=new Map(e)}get size(){return Ws(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return Ws(this._observable),this._map.entries()}forEach(e,t){Ws(this._observable),this._map.forEach((r,n)=>e.call(t,r,n,this),t)}get(e){return Ws(this._observable),this._map.get(e)}has(e){return Ws(this._observable),this._map.has(e)}keys(){return Ws(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return Ws(this._observable),this._map.values()}[Symbol.iterator](){return Ws(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}},lO=class extends rd.EventedAccessor{constructor(e){super(e),this._selectionMap=new WV,this._trashCan=[],this._layerEditHandles=new dr,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([Ki(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ju(()=>this.sources,"change",t=>{const r=this._selectionMap;for(const n of t.removed)r.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const e=new dr;this.view.when().then(()=>{this.view.map.allLayers.flatten(t=>"sublayers"in t&&t.sublayers?t.sublayers:null).forEach(t=>{(Ehe(t)&&!LYi(t)||oj(t))&&e.add(t)}),this._set("sources",e)})}destroy(){this._layerEditHandles.drain(Hc)}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,r]=e;return{layer:t,selection:[...r.selection]}})}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get sources(){return this._get("sources")}set sources(e){this._set("sources",e)}async getSelectedFeatures(e,t={},r="layerView"){const{view:n,selections:s}=this,o=(e!==void 0?s.filter(a=>e.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:l,selection:u}=a,c=oj(l)?l.parent:l;if(c==null||!Xat(c))return null;if(r==="layer")return Jat(c,u,t);const h=await n.whenLayerView(c);return Jat(h,u,t)});return(await Promise.all(o)).filter(a=>a!==null)}updateSelection(e){const t=new Map;for(const[s,o]of this._selectionMap)t.set(s,[...o.selection]);let r=!1;const n=e.current.concat(e.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ehe(o)||oj(o))&&a!==null){const l=qh(t,o,()=>[]);l.includes(a)||(l.push(a),r=!0)}}for(const s of e.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ehe(o)||oj(o))&&a!==null){const l=t.get(o),u=l?.indexOf(a);u!==void 0&&u>=0&&(l?.splice(u,1),r=!0)}}if(r){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[l,u]of t){const c=s.get(l);c!==void 0&&o.push(c),s.set(l,{selection:u}),a.push({layer:l,selection:u,...P4e(c!==void 0?c.selection:[],u)})}this._onSelectionChange(a)}}setSelection(e,t){this._setSelection(e,t)}getSelection(e){return this._selectionMap.get(e)?.selection}appendToSelection(e,t){const r=this._selectionMap.get(e),n=r!==void 0?[...r.selection]:[];for(const s of t)n.includes(s)||n.push(s);this._setSelection(e,n)}removeFromSelection(e,t){const r=this._selectionMap.get(e);if(!r)return;const n=[];for(const s of r.selection)t.includes(s)||n.push(s);this._setSelection(e,n)}toggleInSelection(e,t){const r=this._selectionMap.get(e);if(!r||r.selection.length===0)return void this._setSelection(e,t);const n=new Set(r.selection),s=new Set(t),o=pHi(n,s);this._setSelection(e,Array.from(o))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[r,n]of this._selectionMap.entries())t.push({layer:r,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:e,view:t,_selectionMap:r,showHighlight:n}=this,s=this._vizTaskId;for(const o of e){const a=r.get(o),l=oj(o)?o.parent:o;l!=null&&Xat(l)&&t.whenLayerView(l).then(u=>{a?.highlightHandle?.remove(),a!==void 0&&n&&s===this._vizTaskId&&"highlight"in u&&typeof u.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=u.highlight(a.selection,"selection"))})}}_refreshListeners(){this._layerEditHandles.drain(Hc);for(const e of this.sources){const t=oj(e)?e.parent:e;if(t!=null&&Ehe(t)){const r=t.on("edits",n=>{this._handleEditChanges(n,e)});this._layerEditHandles.push(r)}}}_handleEditChanges(e,t){if(e.deletedFeatures!==void 0&&e.deletedFeatures.length>0&&this._selectionMap.has(t)){const r=e.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(Ga);this.removeFromSelection(t,r)}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const r=this._selectionMap.get(e);if(r===void 0||!zmr(r,{selection:t})){r!==void 0&&this._trashCan.push(r),this._selectionMap.set(e,{selection:[...t]});const n={layer:e,selection:[...t],...P4e(r!==void 0?r.selection:[],t)};this._onSelectionChange([n])}}};x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"selections",null),x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"count",null),x([D({constructOnly:!0,nonNullable:!0})],lO.prototype,"view",void 0),x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"hasSelection",null),x([D()],lO.prototype,"showHighlight",void 0),x([D()],lO.prototype,"sources",null),lO=x([Qe("esri.views.SelectionManager")],lO);const Ehe=i=>i.createQuery!==void 0&&i.on!==void 0,Umr=i=>i.layer!==void 0,Xat=i=>i?.when!==void 0,zmr=(i,e)=>{if(i==null&&e==null)return!0;if(i!=null&&e==null||i==null&&e!=null)return!1;if(i!=null&&e!=null&&i.selection!=null&&e.selection!=null){const t=[...i.selection],r=[...e.selection];if(t.length!==r.length)return!1;t.sort(),r.sort();for(let n=0;n{let r;if(Umr(i)){const n=i;r=n===void 0?null:await n.queryFeatures(new Kn({...t,objectIds:e})).then(s=>({data:s,layer:i.layer}))}else{const n=i;r=n===void 0?null:await n.queryFeatures(new Kn({...t,objectIds:e})).then(s=>({data:s,layer:n}))}return r},Vmr=lO;let NQ=class extends xs(un){constructor(e){super(e),this.accentColor=new jr([255,127,0]),this.textColor=new jr([255,255,255])}};x([D({type:jr,nonNullable:!0})],NQ.prototype,"accentColor",void 0),x([D({type:jr,nonNullable:!0})],NQ.prototype,"textColor",void 0),NQ=x([Qe("esri.views.Theme")],NQ);const MNe=NQ;var Kat;(function(i){i[i.Left=0]="Left",i[i.Middle=1]="Middle",i[i.Right=2]="Right"})(Kat||(Kat={}));const I4t=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],A4t={};function M4t(i){return!!A4t[i]}function Hmr(i){for(const e of i)if(!M4t(e))return!1;return!0}I4t.forEach(i=>{A4t[i]=!0});let Wmr=class{constructor(e){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this._handlers.forEach(({handler:t,priority:r},n)=>this.inputManager?.installHandlers(n,[t],r))}disconnect(){this.inputManager&&this._handlers.forEach((e,t)=>this.inputManager?.uninstallHandlers(t)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,t,r,n){const s=Array.isArray(e)?e:e.split(",");if(!Hmr(s))return s.some(M4t)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(t)?a=t:(o=t,a=[]),typeof r=="function"?o=r:n=r,n=n??zA.DEFAULT;const l=this._createUniqueGroupName(),u=new qmr(this.view,s,a,o);this._handlers.set(l,{handler:u,priority:n});for(const c of s){const h=this._handlerCounts.get(c)||0;this._handlerCounts.set(c,h+1)}return this.inputManager&&this.inputManager.installHandlers(l,[u],n),wa(()=>this._removeHandler(l,s))}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,t){if(this._handlers.has(e)){this._handlers.delete(e);for(const r of t){const n=this._handlerCounts.get(r);n===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",r):n===1?this._handlerCounts.delete(r):this._handlerCounts.set(r,n-1)}}this.inputManager&&this.inputManager.uninstallHandlers(e)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},qmr=class extends Ag{constructor(e,t,r,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of t)switch(s){case"click":this.registerIncoming("click",r,o=>n(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",r,o=>n(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",r,o=>n(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",r,o=>n(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",r,o=>n(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",r,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",r,o=>n(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",r,o=>n(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",r,o=>n(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",r,o=>n(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",r,o=>n(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",r,o=>n(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",r,o=>n(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",r,o=>n(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",r,o=>n(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",r,o=>{n(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",r,o=>{n(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",r,o=>{n(this._wrapBlur(o))})}}_wrapFocus(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:u,timestamp:c}=e;return{type:"click",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,screenPoint:Vd(s,o),mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:h=>e.async(h),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:u,timestamp:c}=e;return{type:"double-click",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:h=>e.async(h),preventDefault:()=>e.preventDefault()}}_wrapImmediateClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,u=a.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-click",pointerId:u,pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:h,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,u=a.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-double-click",pointerId:u,pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:h,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a}=e.data,{cancelable:l,timestamp:u}=e;return{type:"hold",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:u,mapPoint:this._getMapPoint(s,o),cancelable:l,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,t){return this.view.toMap(Vd(e,t),{exclude:[]})}_wrapDrag(e){const t=e.data,{x:r,y:n}=t.center,{action:s,pointerType:o,button:a}=t;if(s==="start"&&(this._latestDragStart=t),!this._latestDragStart)return;const l=t.pointer.native,u=t.buttons,{cancelable:c,timestamp:h}=e,p={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:r,y:n,origin:p,pointerType:o,button:a,buttons:u,radius:t.radius,angle:yb(t.angle),native:l,timestamp:h,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:t,repeat:r,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:t,repeat:r,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:a=>e.async(a),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:t,native:r}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:t,native:r,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,t){const{x:r,y:n,button:s,buttons:o,native:a,eventId:l}=e.data,u=a.pointerId,c=a.pointerType,{cancelable:h,timestamp:p}=e;return{type:t,x:r,y:n,pointerId:u,pointerType:c,button:s,buttons:o,native:a,timestamp:p,eventId:l,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:t,y:r,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:a}=e.data.startEvent,l=e.data.startEvent.native.pointerId,u=e.data.startEvent.native.pointerType,c=e.data.action,h={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:p,timestamp:m}=e;return{type:"pointer-drag",x:t,y:r,pointerId:l,pointerType:u,button:a,buttons:n,action:c,origin:h,native:s,timestamp:m,eventId:o,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:t,data:r,timestamp:n}=e,{x:s,y:o,deltaY:a,native:l}=r;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:l,timestamp:n,cancelable:t,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:t,state:r,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:a,axes:l}=r;return{type:"gamepad",device:n,timestamp:o,action:t,buttons:a,axes:l,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}};var Jne,Zat,Qat;(function(i){i[i.USER=0]="USER",i[i.MANAGER=1]="MANAGER"})(Jne||(Jne={})),function(i){i[i.None=0]="None",i[i.Unfocused=1]="Unfocused",i[i.Focused=2]="Focused",i[i.Unselected=4]="Unselected",i[i.Selected=8]="Selected",i[i.All=15]="All"}(Zat||(Zat={})),function(i){i[i.None=0]="None",i[i.Custom1=16]="Custom1",i[i.Custom2=32]="Custom2",i[i.Custom3=64]="Custom3",i[i.Custom4=128]="Custom4",i[i.Custom5=256]="Custom5",i[i.Custom6=512]="Custom6",i[i.Custom7=1024]="Custom7",i[i.Custom8=2048]="Custom8",i[i.Custom9=4096]="Custom9",i[i.Custom10=8192]="Custom10",i[i.Custom11=16384]="Custom11",i[i.Custom12=32768]="Custom12",i[i.All=65520]="All"}(Qat||(Qat={}));function Ymr(i){return[i.on("before-add",e=>{const t=e.item;if(t==null||i.includes(t))return di.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();t.onAdd()}),i.on("after-remove",e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()})]}function ONe(i){return i.visible&&i.getEditableFlag!=null&&i.getEditableFlag(Jne.USER)&&i.getEditableFlag(Jne.MANAGER)}function bI(i){return Vd(i.x,i.y)}function O4t(i,e){const t=(i instanceof HTMLElement?i:i.surface)?.getBoundingClientRect();return t?Vd(e.clientX-t.left,e.clientY-t.top):Vd(0,0)}function P4t(i,e){return e instanceof Event?O4t(i,e):bI(e)}function R4t(i){if(i instanceof Event)return!0;if(typeof i=="object"&&"type"in i)switch(i.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let Xmr=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(e,t){const r=()=>e.stopPropagation();switch(e.type){case"pointer-move":elt(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),e.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!tlt(e))break;const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,e,t),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(e)&&!o.grabbing&&(this._grabbedManipulators.set(e.pointerId,{manipulator:o,tool:a,start:n,pointerType:e.pointerType}),this._grabbedManipulators.size===1&&t.activeTool==null&&(this._revertToNullActiveTool=!0,t.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:e.pointerType,screenPoint:n}),r());break}case"pointer-up":this._draggedManipulators.has(e.pointerId)||this._handlePointerEnd(e,t);break;case"pointer-drag":{if(!tlt(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=bI(e);a.x=uu(a.x,0,t.view.width),a.y=uu(a.y,0,t.view.height);const l=n.start,u=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,u?s.events.emit("drag",{action:"update",start:l,screenPoint:a}):s.events.emit("drag",{action:"start",start:l,screenPoint:a,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{tool:o,manipulator:s,start:l}));break;case"end":s.dragging=!1,u&&s.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,t)}r();break}case"immediate-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool);if(Jmr(e)||t.forEachTool(u=>{if((s==null||s.tool!==u||u.automaticManipulatorSelection)&&u.manipulators){let c=!1;u.manipulators.forEach(({manipulator:h})=>{h.selected&&(h.selected=!1,c=!0)}),c&&u.onManipulatorSelectionChanged&&u.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const l=e.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:r}),gMe(o,r);break}case"click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit(e.type,{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a}),r();break}case"double-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:r}),gMe(o,r);break}case"immediate-double-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:r}),gMe(o,r);break}}this._onFocusChange(t.forEachTool)}_releaseManipulatorBeforeDragging(e,t,r){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:bI(t)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(r.setActiveTool)}_handlePointerEnd(e,t){const r=this._grabbedManipulators.get(e.pointerId)?.manipulator;r!=null&&r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:bI(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorRelease(t.setActiveTool))}_cursorFromMap(e){let t=null;return i2e(e,({manipulator:r})=>!(r==null||!r.interactive)&&(r.grabbing&&r.grabCursor?(t=r.grabCursor,!0):!!r.cursor&&(t=r.cursor,!0))),t}_onFocusChange(e){this._updateCursor(),this._updateFocusedManipulatorTools(e)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(e){const t=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:n})=>{t.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{r.add(n)}),e(n=>{n.hasGrabbedManipulators=t.has(n),n.hasHoveredManipulators=r.has(n);const s=this._grabbedManipulators.values(),o=die(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(e,{forEachTool:t,setActiveTool:r},n=!0,s){const o=(a,l)=>a===e&&(s==null||s===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:u},c)=>{o(a,l)&&(this._grabbedManipulators.delete(c),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:u}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._draggedManipulators.delete(u),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._hoveredManipulators.delete(u),l.hovering=!1)}),this._afterManipulatorRelease(r),this._onFocusChange(t)}_intersect(e,t,r){let n=null;return r(s=>{if(s.manipulators==null||!ONe(s))return!1;const o=s.manipulators.intersect(e,t);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((t,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Vd(t.x,t.y),r,t.pointerType,e)})}handleHoverEvent(e,t){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!elt(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(bI(e),e.pointerId,e.pointerType,t)}_updateHoveredStateForPointerAtScreenPosition(e,t,r,n){let s=this._intersect(e,r,n);const o=this._hoveredManipulators.get(t)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(t,s)):this._hoveredManipulators.delete(t),this._onFocusChange(n))}_afterManipulatorRelease(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function elt(i){return i==="mouse"}function tlt(i){return i.pointerType!=="mouse"||i.button===0}function Jmr(i){return!!i.native.shiftKey}function gMe(i,e){i?.consumesClicks&&e()}const ilt="attached",yMe="tools",rlt=1e3;let wI=class extends un{constructor(e){super(e),this._updatingHandles=new Mb,this._clock=hY,this._manipulatorState=new Xmr,this.tools=new dr,this.cursor=null,this._interacting=!1,this._interactingTimeout=rlt,this._interactingTimeoutHandle=null,this._forEachTool=t=>{for(const r of this.tools.items)if(t(r))return}}initialize(){this.addHandles([this.view.on(I4t,e=>{this._handleInputEvent(e)},zA.TOOL),...Ymr(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(e=>e.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(e!=null&&!this.view.ready)return void di.getLogger(this).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const t=this.activeTool;this._set("activeTool",e),t?.deactivate(),e?.activate(),this._removeIncompleteTools(e);for(const r of this.tools){this._updateToolEditableFlag(r);const n=ONe(r);this.activeTool!=null&&n||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(e=>e.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=Hc(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([Ki(()=>{const{state:e}=this.view;return"camera"in e&&e.camera},()=>this._forEachManipulator(e=>e.onViewChange())),this.view.elevationProvider?.on("elevation-change",e=>this._forEachManipulator(t=>t.onElevationChange(e)))],ilt):this.addHandles(Ki(()=>this.view.extent,()=>this._forEachManipulator(e=>e.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ilt),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(e){this._forEachTool(t=>{t.manipulators&&t.manipulators.forEach(({manipulator:r})=>e(r,t))})}_handleInputEvent(e){let t=!1;const r={...e,stopPropagation:()=>{t=!0,e.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(n=>{!t&&n.visible&&n.handleInputEvent(r)}),!t&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),t||this.activeTool==null||this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor(),e.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(yMe),this._forEachTool(e=>{if(e instanceof un){const t=Ki(()=>[e.cursor,e.visible,e.editable],()=>{ONe(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(t,yMe)}e.manipulators&&this.addHandles([e.manipulators.on("after-remove",t=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,t.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],yMe)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag?.(Jne.MANAGER,this.activeTool==null||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;e==null&&this._forEachTool(t=>!(t.cursor==null||!t.visible)&&(e=t.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(t=>(e==null||t!==e)&&!t.created&&t.removeIncompleteOnCancel).forEach(t=>{this.tools.remove(t)})}get test(){const e=this;return{setClock:t=>this._clock=t,set interactingTimeoutEnabled(t){e._interactingTimeout=t?rlt:0},get interactingTimeoutEnabled(){return e._interactingTimeout!==0}}}};x([D({constructOnly:!0,nonNullable:!0})],wI.prototype,"view",void 0),x([D({value:null})],wI.prototype,"activeTool",null),x([D({readOnly:!0,type:dr})],wI.prototype,"tools",void 0),x([D({readOnly:!0})],wI.prototype,"cursor",void 0),x([D({readOnly:!0})],wI.prototype,"updating",null),x([D()],wI.prototype,"_interacting",void 0),x([D({readOnly:!0})],wI.prototype,"interacting",null),wI=x([Qe("esri.views.ToolViewManager")],wI);let iU=class extends un{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":Kmr.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndex_hn).then(e=>PNe=e)),await vMe,hn(i)}async function $4t(i,e,t,r){if(!i)return null;const n=i.spatialReference;return qx()||_0(n,e)?Wc(i,e):PNe?PNe.projectGeometry(i,e,t,r):(await Promise.race([sgr(r),FS(r)]),$4t(i,e,t,r))}let Zc=class extends un{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=zF(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),t=[];return this.priorityCollection!=null&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:t}=this._allLayers;let r=null;for(const s of e){const o=this._getSupportedSpatialReferences(s);if(o.length>0){const a=this._narrowDownSpatialReferenceCandidates(r,o);a!=null&&(r=a)}if(r!=null&&r.length===1)break}if(t&&(r==null||r.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(r);return{spatialReference:n!=null?n.spatialReference:null,viewingMode:n!=null?n.viewingMode:null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:t}=this._collectLayers([{parent:this.map?.()?.basemap,layers:this.map?.()?.basemap?.baseLayers},{layers:this.map?.()?.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const r=e[0].tileInfo;return{tileInfo:r&&r.spatialReference.equals(this.spatialReference)?r:null,updating:!1}}return{updating:t}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:t}=this._allLayers;for(const r of e)if(rgr(r)){const n=tgr(r);if(n)return{heightModelInfo:n,vcsWkid:r.spatialReference?.vcsWkid,latestVcsWkid:r.spatialReference?.latestVcsWkid,updating:!1}}return{updating:t}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,t=e.updating,r=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(n.fullExtent!=null?[n.fullExtent]:[]),o=this.requiresExtentInSpatialReference?null:s[0],a=s.find(l=>l.spatialReference.equals(this.spatialReference))??o;if(a)return{candidates:[{extent:a,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const l of s)r.push({extent:l,layer:n})}return{candidates:r,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(e),n=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=zF(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:n.clone(),task:pE(async s=>{try{const o=await $4t(r.extent,n,"portalItem"in r.layer?r.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(xg(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(e==null)return t;const r=[],n=(s,o)=>s!=null?o!=null?s===o&&s:s:o;for(const s of e)for(const o of t){if(!s.spatialReference.equals(o.spatialReference))continue;const a=n(s.viewingMode,o.viewingMode);if(a!==!1){r.push({spatialReference:s.spatialReference,viewingMode:a});break}}return r.length>0?r:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return e==null||e.length<1?t!=null?{spatialReference:t,viewingMode:null}:null:(t!=null&&e.length>1&&e.some(({spatialReference:r})=>r.equals(t))&&(e=e.filter(({spatialReference:r})=>r.equals(t))),e.length>1&&e.some(({viewingMode:r})=>r!==vR.Local)&&(e=e.filter(({viewingMode:r})=>r!==vR.Local)),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(t.length===0)return[];const r=[];for(const n of t){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(s!=null){const o=s.constraints!=null?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:l}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||r.push({spatialReference:a,viewingMode:l})}}return r}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:r})=>t.equals(r.spatialReference))||e[0]}_collectLayers(e){if(this._loadMaybe(this.map?.())!=="loaded")return{layers:[],updating:!0};const t=new ogr;for(const r of e)if(this._collectCollection(r,t),t.preloading===this.sourcePreloadCount)break;return{layers:t.layers,updating:t.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const r of e.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(t=>{mo(t)||console.log(t)}),"loading"):e.loadStatus:"loaded"}};x([D()],Zc.prototype,"required",void 0),x([D({constructOnly:!0})],Zc.prototype,"map",void 0),x([D({constructOnly:!0})],Zc.prototype,"getSpatialReferenceSupport",void 0),x([D()],Zc.prototype,"defaultSpatialReference",void 0),x([D()],Zc.prototype,"userSpatialReference",void 0),x([D()],Zc.prototype,"sourcePreloadCount",void 0),x([D()],Zc.prototype,"priorityCollection",void 0),x([D()],Zc.prototype,"requiresExtentInSpatialReference",void 0),x([D()],Zc.prototype,"suspended",void 0),x([D({readOnly:!0})],Zc.prototype,"ready",null),x([D({readOnly:!0})],Zc.prototype,"heightModelInfoReady",null),x([D({readOnly:!0})],Zc.prototype,"spatialReference",null),x([D({readOnly:!0})],Zc.prototype,"extent",null),x([D({readOnly:!0})],Zc.prototype,"heightModelInfo",null),x([D({readOnly:!0})],Zc.prototype,"vcsWkid",null),x([D({readOnly:!0})],Zc.prototype,"latestVcsWkid",null),x([D({readOnly:!0})],Zc.prototype,"viewingMode",null),x([D({readOnly:!0})],Zc.prototype,"tileInfo",null),x([D({readOnly:!0})],Zc.prototype,"mapCollections",null),x([D({readOnly:!0})],Zc.prototype,"_allLayers",null),x([D({readOnly:!0})],Zc.prototype,"_spatialReferenceTask",null),x([D({readOnly:!0})],Zc.prototype,"_tileInfoTask",null),x([D({readOnly:!0})],Zc.prototype,"_heightModelInfoTask",null),x([D({readOnly:!0})],Zc.prototype,"_extentCandidatesTask",null),x([D()],Zc.prototype,"_extentTask",null),x([D()],Zc.prototype,"_projectExtentTask",void 0),Zc=x([Qe("esri.views.support.DefaultsFromMap")],Zc);let ogr=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var BQ;let io=BQ=class extends rd.EventedMixin(U3(un)){constructor(i){super(i),this._userSpatialReference=null,this._cursor=null,this.handles=new cY,this.updatingHandles=new Mb,this.allLayerViews=new _E({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:lgr}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new bx,this.analyses=new F1e,this.typeSpecificPreconditionsReady=!0,this.layerViews=new dr,this.magnifier=new E4t,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new egr,this.navigation=new F4t,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Wmr(this),this.persistableViewModels=new dr,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(Ki(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,BQ.views.add(this)):(this._lockedSpatialReference=null,BQ.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(r){return void queueMicrotask(()=>{console.error("View._startup failed",r),this.fatalError=new qe("startup-error",null,r)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Kl))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,fR(()=>this.ready)))),this.basemapView=new E4({view:this}),this.layerViewManager=new jmr({view:this,layerViewImporter:{importLayerView:i=>this.importLayerView(i),hasLayerViewModule:i=>this.hasLayerViewModule(i)},supportsGround:this.supportsGround}),this.toolViewManager=new wI({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Vmr({view:this}),this.addHandles([Ki(()=>this.initialExtentRequired,i=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:i},Ah),Ki(()=>this.ready,i=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=i,this.defaultsFromMap.userSpatialReference=i?this.spatialReference:this._userSpatialReference)},Kl),Ki(()=>this._userSpatialReference,i=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=i)},Ah)])}_setupSpatialReferenceLogger(){let i=null;this.addHandles([Ki(()=>this.defaultsFromMap?.ready,e=>{const t=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&t){if(i!=null)return;const r=wa(()=>i=zF(i));i=pE(async n=>{try{await jk(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{i=null}di.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(r,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(BQ.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=zo(this.graphics),this.analyses=zo(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),zo(this.analysisViewManager),this.toolViewManager=zo(this.toolViewManager),this.layerViewManager=zo(this.layerViewManager),this.selectionManager=zo(this.selectionManager),this.basemapView=zo(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(i=>i.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=zo(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return di.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(i){this.toolViewManager&&(this.toolViewManager.activeTool=i)}get animation(){return this._get("animation")}set animation(i){this._set("animation",i)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new Zc({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:i=>this.getSpatialReferenceSupport(i),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(i){this._set("extent",i)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||ef.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(i){i!==this._get("map")&&(i?.destroyed&&(di.getLogger(this).warn("#map","The provided map is already destroyed",{map:i}),i=null),ef.isLoadable(i)&&i.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",i))}get spatialReference(){const i=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(i&&this.defaultsFromMap?.required?.heightModelInfo){const e=i.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return i}set spatialReference(i){const e=!Ya(i,this._get("spatialReference"));this._set("_userSpatialReference",i),e&&(this._set("spatialReference",i),this._spatialReferenceChanged(i))}_spatialReferenceChanged(i){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??RS}set timeZone(i){const e=new Set(["etc/utc","etc/gmt","gmt"]),t=new Set(Intl.supportedValuesOf("timeZone").map(r=>r.toLowerCase()));this._userTimeZone=i,i===RS||i===YF||e.has(i.toLowerCase())||t.has(i.toLowerCase())||di.getLogger(this).warn("#timeZone",`the parsed value '${i}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(i){this._cursor=i,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new MNe}whenLayerView(i){return this.layerViewManager?.whenLayerView(i)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(i){throw new qe("importLayerView() not implemented")}hasLayerViewModule(i){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(i){return this.getSpatialReferenceSupport({spatialReference:i})!=null}when(i,e){return this.isResolved()&&!this.ready&&di.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(i,e)}forceReadyCycle(){this.ready&&(v0(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(i){this.toolViewManager.tools.add(i),this.activeTool=i}tryFatalErrorRecovery(){this.fatalError=null}};io.views=new dr,x([D()],io.prototype,"_userSpatialReference",void 0),x([D()],io.prototype,"activeTool",null),x([D({readOnly:!0})],io.prototype,"allLayerViews",void 0),x([D()],io.prototype,"groundView",void 0),x([D()],io.prototype,"animation",null),x([D()],io.prototype,"basemapView",void 0),x([D()],io.prototype,"center",null),x([D({readOnly:!0})],io.prototype,"_defaultsFromMapSettings",null),x([D()],io.prototype,"defaultsFromMap",null),x([D()],io.prototype,"fatalError",void 0),x([D({type:hr})],io.prototype,"extent",null),x([D(SLe(bx,"graphics"))],io.prototype,"graphics",void 0),x([D(SLe(F1e,"analyses"))],io.prototype,"analyses",void 0),x([D({readOnly:!0,type:DY})],io.prototype,"heightModelInfo",null),x([D({readOnly:!0})],io.prototype,"interacting",null),x([D({readOnly:!0})],io.prototype,"navigating",null),x([D({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],io.prototype,"preconditionsReady",null),x([D({readOnly:!0})],io.prototype,"typeSpecificPreconditionsReady",void 0),x([D({type:dr,readOnly:!0})],io.prototype,"layerViews",void 0),x([D()],io.prototype,"resolution",null),x([D({type:E4t})],io.prototype,"magnifier",void 0),x([D({value:null,type:ZDt})],io.prototype,"map",null),x([D()],io.prototype,"padding",void 0),x([D({readOnly:!0})],io.prototype,"ready",void 0),x([D({type:Xi})],io.prototype,"spatialReference",null),x([D()],io.prototype,"spatialReferenceWarningDelay",void 0),x([D()],io.prototype,"stationary",null),x([D({readOnly:!0})],io.prototype,"supportsGround",void 0),x([D({type:Eg})],io.prototype,"timeExtent",void 0),x([D({type:String,nonNullable:!0})],io.prototype,"timeZone",null),x([D()],io.prototype,"tools",null),x([D()],io.prototype,"toolViewManager",void 0),x([D({readOnly:!0})],io.prototype,"type",void 0),x([D({type:Number})],io.prototype,"scale",void 0),x([D({readOnly:!0})],io.prototype,"updating",void 0),x([D({readOnly:!0})],io.prototype,"initialExtentRequired",void 0),x([D({readOnly:!0})],io.prototype,"initialExtent",null),x([D()],io.prototype,"cursor",null),x([D({readOnly:!0})],io.prototype,"input",void 0),x([D({type:F4t,nonNullable:!0})],io.prototype,"navigation",void 0),x([D()],io.prototype,"layerViewManager",void 0),x([D()],io.prototype,"analysisViewManager",void 0),x([D()],io.prototype,"selectionManager",void 0),x([D()],io.prototype,"width",void 0),x([D()],io.prototype,"height",void 0),x([D({readOnly:!0})],io.prototype,"resizing",void 0),x([D({value:null,readOnly:!0})],io.prototype,"size",null),x([D({readOnly:!0})],io.prototype,"suspended",void 0),x([D({readOnly:!0})],io.prototype,"viewEvents",void 0),x([D({readOnly:!0})],io.prototype,"persistableViewModels",void 0),x([D()],io.prototype,"_isValid",void 0),x([D()],io.prototype,"_readyCycleForced",void 0),x([D()],io.prototype,"_lockedSpatialReference",void 0),x([D()],io.prototype,"_userTimeZone",void 0),x([D()],io.prototype,"_lockedTimeZone",void 0),x([D({type:MNe})],io.prototype,"theme",void 0),x([D({readOnly:!0,type:MNe})],io.prototype,"effectiveTheme",null),io=BQ=x([Qe("esri.views.View")],io);const agr=io;function lgr(i){return i.layerViews}let A4=class extends Rve{constructor(e){super(e),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ac(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new qe("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(e,t){t||(t=qp(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",t)}};x([D({readOnly:!0})],A4.prototype,"done",null),x([D({readOnly:!0,type:String})],A4.prototype,"state",void 0),x([D()],A4.prototype,"target",void 0),A4=x([Qe("esri.views.ViewAnimation")],A4),function(i){i.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(A4||(A4={}));const RNe=A4;function j5(i,e,t,r){const n=3*i,s=3*(t-i)-n,o=1-n-s,a=3*e,l=3*(r-e)-a,u=1-a-l;function c(v){return((o*v+s)*v+n)*v}function h(v){return((u*v+l)*v+a)*v}function p(v){return(3*o*v+2*s)*v+n}function m(v,w){let S,I,R,L,k,B;for(R=v,B=0;B<8;B++){if(L=c(R)-v,Math.abs(L)I)return I;for(;SL?S=R:I=R,R=.5*(I-S)+S}return R}return function(v,w=1e-6){return h(m(v,w))}}const ugr=/^cubic-bezier\((.*)\)/,Y2={};function cgr(i){let e=Y2[i]||null;if(!e){const t=ugr.exec(i);if(t){const r=t[1].split(",").map(n=>parseFloat(n.trim()));r.length!==4||r.some(n=>isNaN(n))||(e=j5.apply(j5,r))}}return e}Y2.ease=j5(.25,.1,.25,1),Y2.linear=j5(0,0,1,1),Y2.easeIn=Y2["ease-in"]=j5(.42,0,1,1),Y2.easeOut=Y2["ease-out"]=j5(0,0,.58,1),Y2.easeInOut=Y2["ease-in-out"]=j5(.42,0,.58,1);function hgr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i}function sWe(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=0,i[5]=0,i}function B4t(i,e,t,r,n,s,o){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i[4]=s,i[5]=o,i}function oWe(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5];let l=t*s-r*n;return l?(l=1/l,i[0]=s*l,i[1]=-r*l,i[2]=-n*l,i[3]=t*l,i[4]=(n*a-s*o)*l,i[5]=(r*o-t*a)*l,i):null}function dgr(i){return i[0]*i[3]-i[1]*i[2]}function FW(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1],h=t[2],p=t[3],m=t[4],v=t[5];return i[0]=r*u+s*c,i[1]=n*u+o*c,i[2]=r*h+s*p,i[3]=n*h+o*p,i[4]=r*m+s*v+a,i[5]=n*m+o*v+l,i}function sk(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=Math.sin(t),c=Math.cos(t);return i[0]=r*c+s*u,i[1]=n*c+o*u,i[2]=r*-u+s*c,i[3]=n*-u+o*c,i[4]=a,i[5]=l,i}function gSe(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1];return i[0]=r*u,i[1]=n*u,i[2]=s*c,i[3]=o*c,i[4]=a,i[5]=l,i}function VA(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1];return i[0]=r,i[1]=n,i[2]=s,i[3]=o,i[4]=r*u+s*c+a,i[5]=n*u+o*c+l,i}function Nae(i,e){const t=Math.sin(e),r=Math.cos(e);return i[0]=r,i[1]=t,i[2]=-t,i[3]=r,i[4]=0,i[5]=0,i}function j4t(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=e[1],i[4]=0,i[5]=0,i}function aWe(i,e){return i[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=e[0],i[5]=e[1],i}function pgr(i){return"mat2d("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+", "+i[4]+", "+i[5]+")"}function fgr(i){return Math.sqrt(i[0]**2+i[1]**2+i[2]**2+i[3]**2+i[4]**2+i[5]**2+1)}function mgr(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i}function G4t(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i}function ggr(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i}function ygr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i[4]=e[4]+t[4]*r,i[5]=e[5]+t[5]*r,i}function vgr(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]}function _gr(i,e){const t=i[0],r=i[1],n=i[2],s=i[3],o=i[4],a=i[5],l=e[0],u=e[1],c=e[2],h=e[3],p=e[4],m=e[5],v=c_();return Math.abs(t-l)<=v*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(r-u)<=v*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=v*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(s-h)<=v*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-p)<=v*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=v*Math.max(1,Math.abs(a),Math.abs(m))}const bgr=FW,wgr=G4t;Object.freeze(Object.defineProperty({__proto__:null,add:mgr,copy:hgr,determinant:dgr,equals:_gr,exactEquals:vgr,frob:fgr,fromRotation:Nae,fromScaling:j4t,fromTranslation:aWe,identity:sWe,invert:oWe,mul:bgr,multiply:FW,multiplyScalar:ggr,multiplyScalarAndAdd:ygr,rotate:sk,scale:gSe,set:B4t,str:pgr,sub:wgr,subtract:G4t,translate:VA},Symbol.toStringTag,{value:"Module"}));function HA(){return[1,0,0,1,0,0]}function xgr(i){return[i[0],i[1],i[2],i[3],i[4],i[5]]}function Sgr(i,e,t,r,n,s){return[i,e,t,r,n,s]}function Tgr(i,e){return new Float64Array(i,e,6)}const Cgr=HA();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:Cgr,clone:xgr,create:HA,createView:Tgr,fromValues:Sgr},Symbol.toStringTag,{value:"Module"}));function kW(i,e){return i[0]=e[0],i[1]=e[1],i}function dl(i,e,t){return i[0]=e,i[1]=t,i}function lWe(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i}function Kne(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i}function U4t(i,e,t){return i[0]=e[0]*t[0],i[1]=e[1]*t[1],i}function z4t(i,e,t){return i[0]=e[0]/t[0],i[1]=e[1]/t[1],i}function Egr(i,e){return i[0]=Math.ceil(e[0]),i[1]=Math.ceil(e[1]),i}function Igr(i,e){return i[0]=Math.floor(e[0]),i[1]=Math.floor(e[1]),i}function Agr(i,e,t){return i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i}function Mgr(i,e,t){return i[0]=Math.max(e[0],t[0]),i[1]=Math.max(e[1],t[1]),i}function Ogr(i,e){return i[0]=Math.round(e[0]),i[1]=Math.round(e[1]),i}function $ae(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i}function Pgr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i}function ySe(i,e){const t=e[0]-i[0],r=e[1]-i[1];return Math.sqrt(t*t+r*r)}function k1e(i,e){const t=e[0]-i[0],r=e[1]-i[1];return t*t+r*r}function L1e(i){const e=i[0],t=i[1];return Math.sqrt(e*e+t*t)}function V4t(i){const e=i[0],t=i[1];return e*e+t*t}function H4t(i,e){return i[0]=-e[0],i[1]=-e[1],i}function Rgr(i,e){return i[0]=1/e[0],i[1]=1/e[1],i}function DNe(i,e){const t=e[0],r=e[1];let n=t*t+r*r;return n>0&&(n=1/Math.sqrt(n),i[0]=e[0]*n,i[1]=e[1]*n),i}function W4t(i,e){return i[0]*e[0]+i[1]*e[1]}function q4t(i,e,t){const r=e[0]*t[1]-e[1]*t[0];return i[0]=i[1]=0,i[2]=r,i}function FNe(i,e,t,r){const n=e[0],s=e[1];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i}function Dgr(i,e){e=e||1;const t=2*sae()*Math.PI;return i[0]=Math.cos(t)*e,i[1]=Math.sin(t)*e,i}function Fgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[2]*n,i[1]=t[1]*r+t[3]*n,i}function yf(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[2]*n+t[4],i[1]=t[1]*r+t[3]*n+t[5],i}function kgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[3]*n+t[6],i[1]=t[1]*r+t[4]*n+t[7],i}function Lgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[4]*n+t[12],i[1]=t[1]*r+t[5]*n+t[13],i}function m8(i,e,t,r){const n=e[0]-t[0],s=e[1]-t[1],o=Math.sin(r),a=Math.cos(r);return i[0]=n*a-s*o+t[0],i[1]=n*o+s*a+t[1],i}function Ngr(i,e){const t=i[0],r=i[1],n=e[0],s=e[1];let o=t*t+r*r;o>0&&(o=1/Math.sqrt(o));let a=n*n+s*s;a>0&&(a=1/Math.sqrt(a));const l=(t*n+r*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function $gr(i){return"vec2("+i[0]+", "+i[1]+")"}function Bgr(i,e){return i[0]===e[0]&&i[1]===e[1]}function jgr(i,e){const t=i[0],r=i[1],n=e[0],s=e[1],o=c_();return Math.abs(t-n)<=o*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(r-s)<=o*Math.max(1,Math.abs(r),Math.abs(s))}function Ggr(i,e,t,r,n){let s=e[0]-t[0],o=e[1]-t[1];const a=(r[0]*s+r[1]*o)*(n-1);return s=r[0]*a,o=r[1]*a,i[0]=e[0]+s,i[1]=e[1]+o,i}const Ugr=L1e,uWe=Kne,zgr=U4t,Vgr=z4t,Hgr=ySe,Wgr=k1e,qgr=V4t;Object.freeze(Object.defineProperty({__proto__:null,add:lWe,angle:Ngr,ceil:Egr,copy:kW,cross:q4t,dist:Hgr,distance:ySe,div:Vgr,divide:z4t,dot:W4t,equals:jgr,exactEquals:Bgr,floor:Igr,inverse:Rgr,len:Ugr,length:L1e,lerp:FNe,max:Mgr,min:Agr,mul:zgr,multiply:U4t,negate:H4t,normalize:DNe,projectAndScale:Ggr,random:Dgr,rotate:m8,round:Ogr,scale:$ae,scaleAndAdd:Pgr,set:dl,sqrDist:Wgr,sqrLen:qgr,squaredDistance:k1e,squaredLength:V4t,str:$gr,sub:uWe,subtract:Kne,transformMat2:Fgr,transformMat2d:yf,transformMat3:kgr,transformMat4:Lgr},Symbol.toStringTag,{value:"Module"}));function Ja(){return[0,0]}function Ygr(i){return[i[0],i[1]]}function MA(i,e){return[i,e]}function Xgr(i,e=Ja()){const t=Math.min(2,i.length);for(let r=0;r"attributes"in c),l=i.some(c=>!c.geometry);let u=i;if(a&&l&&e&&e.allLayerViews){const c=new Map;for(const v of i){const w=v.layer,S=c.get(w)||[],I=v.attributes[w.objectIdField];I!=null&&S.push(I),c.set(w,S)}const h=[];c.forEach((v,w)=>{const S=e.allLayerViews.find(I=>I.layer.id===w.id);if(S&&"queryFeatures"in S){const I=w.createQuery();I.objectIds=v,I.returnGeometry=!0,h.push(S.queryFeatures(I))}});const p=await Promise.all(h),m=[];for(const v of p)if(v&&v.features&&v.features.length)for(const w of v.features)w.geometry!=null&&m.push(w.geometry);u=m}for(const c of u)r=await jQ(c,e,t,r);return r}if(Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number")n=new $i(i);else if(i instanceof Nr)n=i;else if("geometry"in i){if(i.geometry)n=i.geometry;else if(i.layer){const a=i.layer,l=e.allLayerViews.find(u=>u.layer.id===a.id);if(l&&"queryFeatures"in l){const u=a.createQuery();u.objectIds=[i.attributes[a.objectIdField]],u.returnGeometry=!0,n=(await l.queryFeatures(u))?.features?.[0]?.geometry}}}if(n==null)return null;switch(n.type){case"point":s=new hr({xmin:n.x,ymin:n.y,xmax:n.x,ymax:n.y,spatialReference:n.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":s=rlr(n);break;default:s=n.extent}if(!s)return null;qx()||_0(s.spatialReference,t)||await FS();const o=Wc(s,t);return o?r=r?r.union(o):o:null}function eyr(i){if(i&&(!Array.isArray(i)||typeof i[0]!="number")&&(typeof i=="object"||Array.isArray(i)&&typeof i[0]=="object")){if("layer"in i&&i.layer?.minScale!=null&&i.layer.maxScale!=null){const e=i.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(i)&&i.length&&i.every(e=>"layer"in e)){let e=0,t=0;for(const r of i){const n=r.layer;n?.minScale&&n.maxScale&&(e=n.minScalet?n.maxScale:t)}return e&&t?{min:e,max:t}:null}}}function _Me(i,e){return Ya(e5t(i),e)?i:Wc(i,e)}async function tyr(i,e){if(!i||!e)return new Ab({targetGeometry:new $i,scale:0,rotation:0});let t=e.spatialReference;const{constraints:r,padding:n,viewpoint:s,size:o}=e,a=[n?o[0]-n.left-n.right:o[0],n?o[1]-n.top-n.bottom:o[1]];let l=null;i instanceof Ab?l=i:i.viewpoint?l=i.viewpoint:i.target&&i.target.declaredClass==="esri.Viewpoint"&&(l=i.target);let u=null;l?.targetGeometry?u=l.targetGeometry:i instanceof hr?u=i:(i||i&&("center"in i||"extent"in i||"target"in i))&&(u=await jQ(i.center,e,t)||await jQ(i.extent,e,t)||await jQ(i.target,e,t)||await jQ(i,e,t)),!u&&s?.targetGeometry?u=s.targetGeometry:!u&&e.extent&&(u=e.extent),t||(t=e5t(e.spatialReference||e.extent||u)),qx()||Ya(u.spatialReference,t)||_0(u.spatialReference,t)||await FS();const c=_Me(u,t),h="center"in c?c.center:c;e.pickClosestTarget!==!1&&h.type==="point"&&s.targetGeometry?.type==="point"&&(h.x=rRt(h.x,s.targetGeometry.x,h.spatialReference));let p=0;l?p=l.rotation:i.hasOwnProperty("rotation")?p=i.rotation:s&&(p=s.rotation);let m=0;if(l?.targetGeometry!=null&&l.targetGeometry.type==="point")m=l.scale;else if("scale"in i&&i.scale)m=i.scale;else if("zoom"in i&&i.zoom!==-1&&r&&r.effectiveLODs)m=r.zoomToScale(i.zoom);else if(Array.isArray(u)||u.type==="point"||u.type==="extent"&&u.width===0&&u.height===0){const S=_Me(e.extent,t);m=S!=null?qV(S,a,p):e.extent?qV(e.extent,a,p):s.scale}else m=qV(_Me(u.extent,t),a,p);const v=eyr(i.target??i);v&&(v.min&&v.minm&&(m=v.max));let w=new Ab({targetGeometry:h,scale:m,rotation:p});return r&&(w=r.fit(w),r.constrainByGeometry(w),r.rotationEnabled||(w.rotation=s.rotation)),w}function ME(i,e){const t=i.targetGeometry,r=e.targetGeometry;return t.x=r.x,t.y=r.y,t.spatialReference=r.spatialReference,i.scale=e.scale,i.rotation=e.rotation,i}function i5t(i,e,t){return t?dl(i,.5*(e[0]-t.right+t.left),.5*(e[1]-t.bottom+t.top)):$ae(i,e,.5)}const iyr=function(){const i=Ja();return function(e,t,r){const n=t.targetGeometry;hWe(i,n);const s=.5*GY(t);return e.xmin=i[0]-s*r[0],e.ymin=i[1]-s*r[1],e.xmax=i[0]+s*r[0],e.ymax=i[1]+s*r[1],e.spatialReference=n.spatialReference,e}}();function ryr(i,e,t,r,n){return kNe(i,e,t.center),i.scale=qV(t,r),n?.constraints?.constrain(i),i}function nyr(i,e,t,r){return mWe(i,e,t,r),oWe(i,i)}const dWe=function(){const i=Ja();return function(e,t,r){return uWe(e,lyr(e,t),i5t(i,t,r))}}(),syr=function(){const i=HA(),e=Ja();return function(t,r,n,s){const o=GY(r),a=pWe(r);return dl(e,o,o),j4t(i,e),sk(i,i,a),VA(i,i,dWe(e,n,s)),VA(i,i,[0,s.top-s.bottom]),dl(t,i[4],i[5])}}();function GY(i){return i.scale*oyr(i.targetGeometry)}function oyr(i){return i!=null&&Cm(i.spatialReference)?1/(t5t(i.spatialReference)*Q4t*Z4t):1}function pWe(i){return eB(i.rotation)||0}function ayr(i){return Cm(i)?t5t(i)*Q4t*Z4t:1}function lyr(i,e){return $ae(i,e,.5)}const fWe=function(){const i=Ja(),e=Ja(),t=Ja();return function(r,n,s,o,a,l){return H4t(i,n),$ae(e,s,.5*l),dl(t,1/o*l,-1/o*l),aWe(r,e),a&&sk(r,r,a),gSe(r,r,t),VA(r,r,i),r}}(),mWe=function(){const i=Ja();return function(e,t,r,n){const s=GY(t),o=pWe(t);return hWe(i,t.targetGeometry),fWe(e,i,r,s,o,n)}}(),uyr=function(){const i=Ja();return function(e,t,r,n){const s=GY(t);return hWe(i,t.targetGeometry),fWe(e,i,r,s,0,n)}}();function gWe(i){const e=Zp(i);return e?e.valid[1]-e.valid[0]:0}function cyr(i,e){return Math.round(gWe(i)/e)}const r5t=function(){const i=Ja(),e=Ja(),t=[0,0,0];return function(r,n,s){Kne(i,r,n),DNe(i,i),Kne(e,r,s),DNe(e,e),q4t(t,i,e);let o=Math.acos(W4t(i,e)/(L1e(i)*L1e(e)))*Qgr;return t[2]<0&&(o=-o),isNaN(o)&&(o=0),o}}(),hyr=function(){const i=Ja();return function(e,t,r,n){const s=e.targetGeometry;return ME(e,t),syr(i,t,r,n),s.x+=i[0],s.y+=i[1],e}}(),kNe=function(i,e,t){ME(i,e);const r=i.targetGeometry;return r.x=t.x,r.y=t.y,r.spatialReference=t.spatialReference,i},dyr=function(){const i=Ja();return function(e,t,r,n,s){s||(s="center"),uWe(i,r,n),$ae(i,i,.5);const o=i[0],a=i[1];switch(s){case"center":dl(i,0,0);break;case"left":dl(i,-o,0);break;case"top":dl(i,0,a);break;case"right":dl(i,o,0);break;case"bottom":dl(i,0,-a);break;case"top-left":dl(i,-o,a);break;case"bottom-left":dl(i,-o,-a);break;case"top-right":dl(i,o,a);break;case"bottom-right":dl(i,o,-a)}return ok(e,t,i),e}}();function LNe(i,e,t){return ME(i,e),i.rotation+=t,i}function pyr(i,e,t){return ME(i,e),i.rotation=t,i}const fyr=function(){const i=Ja();return function(e,t,r,n,s){return ME(e,t),isNaN(r)||r===0||(n5t(i,n,t,s),e.scale=t.scale*r,s5t(i,i,e,s),ok(e,e,dl(i,i[0]-n[0],n[1]-i[1]))),e}}();function slt(i,e,t){return ME(i,e),i.scale=t,i}const yWe=function(){const i=Ja();return function(e,t,r,n,s,o){return ME(e,t),isNaN(r)||r===0||(n5t(i,s,t,o),e.scale=t.scale*r,e.rotation+=n,s5t(i,i,e,o),ok(e,e,dl(i,i[0]-s[0],s[1]-i[1]))),e}}(),olt=function(){const i=Ja(),e=Ja();return function(t,r,n,s,o,a,l){return dWe(e,a,l),lWe(i,o,e),s?yWe(t,r,n,s,i,a):fyr(t,r,n,i,a)}}(),n5t=function(){const i=HA();return function(e,t,r,n){return yf(e,t,nyr(i,r,n,1))}}(),s5t=function(){const i=HA();return function(e,t,r,n){return yf(e,t,mWe(i,r,n,1))}}(),ok=function(){const i=Ja(),e=HA();return function(t,r,n){ME(t,r);const s=GY(r),o=t.targetGeometry;return Nae(e,pWe(r)),gSe(e,e,MA(s,s)),yf(i,n,e),o.x+=i[0],o.y+=i[1],t}}();let myr=class{constructor(e,t,r,n){const s=e.targetGeometry,o=t.targetGeometry;n?typeof n=="string"&&(n=cgr(n)||Y2.ease):n=Y2.ease,this.easing=n,this.duration=r,this.sCenterX=s.x,this.sCenterY=s.y,this.sScale=e.scale,this.sRotation=e.rotation,this.tCenterX=o.x,this.tCenterY=o.y,this.tScale=t.scale,this.tRotation=t.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(e,t){const r=this.easing(t);let n,s,o,a;t>=1?(n=this.tCenterX,s=this.tCenterY,o=this.tRotation,a=this.tScale):(n=this.sCenterX+r*this.dCenterX,s=this.sCenterY+r*this.dCenterY,o=this.sRotation+r*this.dRotation,a=this.sScale+r*this.dScale),e.targetGeometry.x=n,e.targetGeometry.y=s,e.scale=a,e.rotation=o}},M4=class extends un{constructor(e){super(e),this._animation=null,this.updateFunction=null,this.duration=200,this.transition=null,this.easing=Y2.ease,this.view=null,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this._updateTask=H9({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Hc(this._updateTask)}get animation(){return this._animation}set animation(e){this._animation=e,this.view&&(this.view.animation=e)}animate(e,t,r){this.stop();const n=this.viewpoint;ME(n,t),this.transition=new myr(this.viewpoint,e.target,r?.duration||this.duration,r?.easing||this.easing);const s=()=>{this.animation===e&&this._updateTask&&(e.state==="finished"&&(this.transition?.applyRatio(this.viewpoint,1),this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return e.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=e,e}animateContinous(e,t){this.stop(),this.updateFunction=t,this.viewpoint=e;const r=new RNe({target:e.clone()}),n=()=>{this.animation===r&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return r.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=r,r}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(e){const t=this.animation;if(t&&t.state!==RNe.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,e.deltaTime);else{const r=this.transition,n=(performance.now()-this._startTime)/r.duration,s=n>=1;r.applyRatio(this.viewpoint,n),s&&this.animation?.finish()}this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};x([D()],M4.prototype,"duration",void 0),x([D()],M4.prototype,"transition",void 0),x([D()],M4.prototype,"easing",void 0),x([D()],M4.prototype,"view",void 0),x([D()],M4.prototype,"viewpoint",void 0),M4=x([Qe("esri.views.2d.AnimationManager")],M4);const gyr=M4;let yyr=class{constructor(e){this.view=e,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:t,graphicsView:r,labelManager:n,state:{id:s}}=this.view;t.forEach(this._updateLayerView,this),n!=null&&(n.lastUpdateId!==s&&(n.viewChange(),n.lastUpdateId=s),n.updateRequested&&n.processUpdate(this._updateParameters)),r!=null&&(r.lastUpdateId!==s&&(r.viewChange(),r.lastUpdateId=s),r.updateRequested&&r.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle?.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const e=this.view;this.stationary=e.stationary,this._updateParameters={state:e.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:e.renderingOptions},this._stationaryHandle=Ki(()=>e.stationary,t=>{this.stationary=t,this.requestFrame()}),this._frameTaskHandle=H9(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(e){if(!e.attached)return void this.requestUpdate();const t=this.view.state,r=e.lastUpdateId;r!=null&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),r!==t.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=t.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews?.forEach(this._updateLayerView,this)}},fge=class extends un{constructor(e){super(e),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(e,t){if(!e)return void di.getLogger(this).error("#goTo()","target cannot be null or undefined");const r=new RNe;this.view.animation=r,await fR(()=>this.view.ready,t);const n={animate:!0,...t},{extent:s,spatialReference:o,size:a,viewpoint:l,constraints:u,padding:c,allLayerViews:h}=this.view,p=tyr(e,{extent:s,spatialReference:o,size:a,viewpoint:l,constraints:u,padding:c,allLayerViews:h,pickClosestTarget:t?.pickClosestTarget??!0});return r?.update(p),this._gotoTask={},n.animate?this._gotoAnimated(p,n):this._gotoImmediate(p,n)}_gotoImmediate(e,t){const r=this._gotoTask,n=this.view.animation,s=e.then(o=>{if(hn(t),r!==this._gotoTask)throw new qe("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(r,n,s,t)}_gotoAnimated(e,t){const r=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=e.then(o=>{if(hn(t),r!==this._gotoTask)throw new qe("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,t),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,n,s,t)}_cancellableGoTo(e,t,r,n){const s=()=>e===this._gotoTask;return Jg(r,n).finally(()=>{s()&&(t.done||t.stop())})}};x([D({constructOnly:!0})],fge.prototype,"view",void 0),fge=x([Qe("esri.views.2d.GoToManager")],fge);function Gh(){return Promise.all([Promise.resolve().then(()=>kqt),Promise.resolve().then(()=>ZYt)])}const VJ=()=>Gh().then(()=>Promise.resolve().then(()=>Dyn)),mj=()=>Gh().then(()=>Promise.resolve().then(()=>z0n)),alt={"base-dynamic":()=>Gh().then(()=>Promise.resolve().then(()=>X0n)),"base-tile":VJ,"bing-maps":VJ,catalog:()=>Gh().then(()=>Promise.resolve().then(()=>K0n)),"catalog-dynamic-group":()=>Gh().then(()=>Promise.resolve().then(()=>Q0n)),"catalog-footprint":()=>Gh().then(()=>Promise.resolve().then(()=>tvn)),csv:mj,"geo-rss":()=>Gh().then(()=>Promise.resolve().then(()=>rvn)),feature:mj,geojson:mj,graphics:()=>Gh().then(()=>Promise.resolve().then(()=>svn)),group:()=>Gh().then(()=>Promise.resolve().then(()=>lvn)),imagery:()=>Gh().then(()=>Promise.resolve().then(()=>Xvn)),"imagery-tile":()=>Gh().then(()=>Promise.resolve().then(()=>R1t)),kml:()=>Gh().then(()=>Promise.resolve().then(()=>Z_n)),"knowledge-graph":()=>Gh().then(()=>Promise.resolve().then(()=>F1t)),"link-chart":()=>Gh().then(()=>Promise.resolve().then(()=>F1t)),"knowledge-graph-sublayer":mj,"map-image":()=>Gh().then(()=>Promise.resolve().then(()=>ibn)),"map-notes":()=>Gh().then(()=>Promise.resolve().then(()=>nbn)),media:()=>Gh().then(()=>Promise.resolve().then(()=>hbn)),"ogc-feature":()=>Gh().then(()=>Promise.resolve().then(()=>fbn)),"open-street-map":VJ,"oriented-imagery":mj,route:()=>Gh().then(()=>Promise.resolve().then(()=>Obn)),stream:()=>Gh().then(()=>Promise.resolve().then(()=>Dbn)),"subtype-group":()=>Gh().then(()=>Promise.resolve().then(()=>kbn)),tile:VJ,"vector-tile":()=>Gh().then(()=>Promise.resolve().then(()=>Swn)),video:()=>Gh().then(()=>Promise.resolve().then(()=>Cwn)),wcs:()=>Gh().then(()=>Promise.resolve().then(()=>R1t)),"web-tile":VJ,wfs:mj,wms:()=>Gh().then(()=>Promise.resolve().then(()=>Awn)),wmts:()=>Gh().then(()=>Promise.resolve().then(()=>Rwn)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function vyr(i){const e=i.declaredClass?i.declaredClass.slice(i.declaredClass.lastIndexOf(".")+1):"Unknown",t=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new qe(`${t}:view-not-supported`,`${e} is not supported in 2D`)}const llt={hasLayerViewModule:i=>alt[i.type]!=null,importLayerView:i=>{const e=alt[i.type];if(e==null)throw vyr(i);return e(i)}};function _yr(i,e){const{spatialReference:t}=e,r=[e.x,e.y];let n=Number.POSITIVE_INFINITY,s=0,o=0;const a=[0,0],l=i.type==="extent"?[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]:i.rings;for(const u of l)for(let c=0;cc.clone()),e.sort((c,h)=>h.scale-c.scale),e.forEach((c,h)=>c.level=h);for(const c of e)!l&&t>0&&t>=c.scale&&(o=c.level,l=!0),!u&&r>0&&r>=c.scale&&(a=i?i.level:-1,u=!0),i=c;n===-1&&(n=t===0?0:o),s===-1&&(s=r===0?e.length-1:a),n=Math.max(n,0),n=Math.min(n,e.length-1),s=Math.max(s,0),s=Math.min(s,e.length-1),n>s&&([n,s]=[s,n]),t=e[n].scale,r=e[s].scale,e.splice(0,n),e.splice(s-n+1,e.length),e.forEach((c,h)=>{this._lodByScale[c.scale]=c,this._scales[h]=c.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",n),this._set("effectiveMaxZoom",s),this._set("effectiveMinScale",t),this._set("effectiveMaxScale",r)}constrain(i,e){if(e&&i.scale===e.scale)return i;const t=this.effectiveMinScale,r=this.effectiveMaxScale,n=i.targetGeometry,s=e&&e.targetGeometry,o=r!==0&&i.scalet;if(o||a){const l=a?t:r;if(e&&s){const u=(l-e.scale)/(i.scale-e.scale);n.x=s.x+(n.x-s.x)*u,n.y=s.y+(n.y-s.y)*u}i.scale=l}return this.snapToZoom&&this.effectiveLODs&&(i.scale=this._getClosestScale(i.scale)),i}fit(i){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(i,null);const e=this.scaleToZoom(i.scale),t=Math.abs(e-Math.floor(e));return i.scale=this.zoomToScale(t>.99?Math.round(e):Math.floor(e)),i}zoomToScale(i){if(!this.effectiveLODs)return 0;i-=this.effectiveMinZoom,i=Math.max(0,i);const e=this._scales;if(i<=0)return e[0];if(i>=e.length)return e[e.length-1];const t=Math.round(i-.5),r=Math.round(i);return e[r]+(r-i)*(e[t]-e[r])}scaleToZoom(i){if(!this.effectiveLODs)return-1;const e=this._scales;let t,r;if(i>=e[0])return this.effectiveMinZoom;if(i<=e[e.length-1])return this.effectiveMaxZoom;for(let n=0;ni&&rMath.abs(t-i)<=Math.abs(e-i)?t:e,this._scales[0])),this._lodByScale[i].scale}};x([D({readOnly:!0})],B_.prototype,"effectiveLODs",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMinZoom",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMaxZoom",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMinScale",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMaxScale",void 0),x([D()],B_.prototype,"lods",void 0),x([D()],B_.prototype,"minZoom",void 0),x([D()],B_.prototype,"maxZoom",void 0),x([D()],B_.prototype,"minScale",void 0),x([D()],B_.prototype,"maxScale",void 0),x([D()],B_.prototype,"snapToZoom",void 0),B_=BNe=x([Qe("esri.views.2d.constraints.ZoomConstraint")],B_);const a5t=B_,byr={base:null,key:"type",typeMap:{extent:hr,polygon:$s}};let Mp=class extends un{constructor(e){super(e),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new dr}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(e){e?this._set("geometry",e):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const e=this._get("_geometry");return e&&this.geometry===e.geometry&&this.view?.constraintsInfo.spatialReference===e.spatialReference?e:new P6({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new o5t({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),t=this.lods||this.view?.constraintsInfo.lods,r=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return e&&e.lods===t&&e.minZoom===r&&e.maxZoom===n&&e.minScale===s&&e.maxScale===o&&e.snapToZoom===a?e:new a5t({lods:t,minZoom:r,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(e){const t=this.effectiveMaxScale;return t===0||e>=t}canZoomOutTo(e){const t=this.effectiveMinScale;return t===0||e<=t}constrain(e,t){return this._zoom.constrain(e,t),this._rotation.constrain(e,t),this._geometry.constrain(e,t),this.customConstraints.forEach(r=>r.constrain(e,t)),e}constrainByGeometry(e){return this._geometry.constrain(e),this.customConstraints.forEach(t=>t.applyPanConstraint?.(e)),e}fit(e){return this._zoom.fit(e)}zoomToScale(e){return this._zoom.zoomToScale(e)}scaleToZoom(e){return this._zoom.scaleToZoom(e)}snapScale(e){return this._zoom.snapToClosestScale(e)}snapToNextScale(e){return this._zoom.snapToNextScale(e)}snapToPreviousScale(e){return this._zoom.snapToPreviousScale(e)}};x([D({readOnly:!0})],Mp.prototype,"effectiveLODs",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMinScale",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMaxScale",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMinZoom",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMaxZoom",null),x([D({types:byr,value:null})],Mp.prototype,"geometry",null),x([D({type:[hs]})],Mp.prototype,"lods",void 0),x([D()],Mp.prototype,"minScale",void 0),x([D()],Mp.prototype,"maxScale",void 0),x([D()],Mp.prototype,"minZoom",void 0),x([D()],Mp.prototype,"maxZoom",void 0),x([D()],Mp.prototype,"rotationEnabled",void 0),x([D()],Mp.prototype,"snapToZoom",void 0),x([D({type:dr})],Mp.prototype,"customConstraints",void 0),x([D()],Mp.prototype,"view",void 0),x([D({readOnly:!0})],Mp.prototype,"version",null),x([D({type:P6,readOnly:!0})],Mp.prototype,"_geometry",null),x([D({type:o5t})],Mp.prototype,"_rotation",null),x([D({readOnly:!0,type:a5t})],Mp.prototype,"_zoom",null),Mp=x([Qe("esri.views.2d.MapViewConstraints")],Mp);const l5t=Mp;let Tc=class l${static getId(e,t,r,n){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${n}`}constructor(e,t,r,n){this.set(e,t,r,n)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,n){this.set(e,t,r,n)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new l$(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,n){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[s,o,a,l]=e.split("/");this.level=parseFloat(s),this.row=parseFloat(o),this.col=parseFloat(a),this.world=parseFloat(l)}else this.level=+e,this.row=+t,this.col=+r,this.world=+n||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new l$(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(e,t){return`${this.level}/${this.row+t}/${this.col+e}/${this.world}`}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,n=this.world;return[new l$(e,t,r,n),new l$(e,t,r+1,n),new l$(e,t+1,r,n),new l$(e,t+1,r+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};Tc.pool=new G3(Tc,null,null,25,50);function wD(i,e){return[i,e]}function zL(i,e,t){return i[0]=e,i[1]=t,i}function wyr(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}const mT=new Tc("0/0/0/0");let xyr=class u5t{static create(e,t,r=null){const n=Zp(e.spatialReference),s=t.origin||wD(e.origin.x,e.origin.y),o=wD(e.size[0]*t.resolution,e.size[1]*t.resolution),a=wD(-1/0,-1/0),l=wD(1/0,1/0),u=wD(1/0,1/0);r!=null&&(zL(a,Math.max(0,Math.floor((r.xmin-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymax)/o[1]))),zL(l,Math.max(0,Math.floor((r.xmax-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymin)/o[1]))),zL(u,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:c,rows:h}=t;let p,m,v,w;return!r&&c&&h&&(zL(a,c[0],h[0]),zL(l,c[1],h[1]),zL(u,c[1]-c[0]+1,h[1]-h[0]+1)),e.isWrappable?(p=wD(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),u[1]),m=wD(Math.floor((n.origin[0]-s[0])/o[0]),a[1]),v=wD(p[0]+m[0]-1,l[1]),w=!0):(m=a,v=l,p=u,w=!1),new u5t(t.level,t.resolution,t.scale,s,a,l,u,o,m,v,p,w)}constructor(e,t,r,n,s,o,a,l,u,c,h,p){this.level=e,this.resolution=t,this.scale=r,this.origin=n,this.first=s,this.last=o,this.size=a,this.norm=l,this.worldStart=u,this.worldEnd=c,this.worldSize=h,this.wrap=p}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,r=!1){mT.set(t);const n=r?mT.col:this.denormalizeCol(mT.col,mT.world),s=mT.row;return wyr(e,this.getXForColumn(n),this.getYForRow(s+1),this.getXForColumn(n+1),this.getYForRow(s)),e}getTileCoords(e,t,r=!1){mT.set(t);const n=r?mT.col:this.denormalizeCol(mT.col,mT.world);return Array.isArray(e)?zL(e,this.getXForColumn(n),this.getYForRow(mT.row)):(e.x=this.getXForColumn(n),e.y=this.getYForRow(mT.row)),e}},dB=class{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}*keys(){const e=this.lodInfo;for(const{row:t,colFrom:r,colTo:n}of this.spans)for(let s=r;s<=n;s++){const o=e.getWorldForColumn(s);yield new Tc(e.level,t,e.normalizeCol(s),o)}}forEach(e,t){const{spans:r,lodInfo:n}=this,{level:s}=n;if(r.length!==0)for(const{row:o,colFrom:a,colTo:l}of r)for(let u=a;u<=l;u++)e.call(t,s,o,n.normalizeCol(u),n.getWorldForColumn(u))}};dB.pool=new G3(dB);let bMe=class{constructor(e,t,r){this.row=e,this.colFrom=t,this.colTo=r}};const nd=new Tc("0/0/0/0");let Syr=class c5t{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[r,n]=e,[s,o]=t,a=s-r,l=o-n,u=l!==0?a/l:0,c=(Math.ceil(n)-n)*u,h=(Math.floor(n)-n)*u;return new c5t(r,Math.floor(n),Math.ceil(o),u,a<0?c:h,a<0?h:c,a<0?s:r,a<0?r:s)}constructor(e,t,r,n,s,o,a,l){this.x=e,this.ymin=t,this.ymax=r,this.invM=n,this.leftAdjust=s,this.rightAdjust=o,this.leftBound=a,this.rightBound=l}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const sw=[[0,0],[0,0],[0,0],[0,0]],Tyr=1e-6;let ak=class{constructor(e,t=null,r=e.lods[0].level,n=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=e.lods.filter(a=>a.level>=r&&a.level<=n);this.minScale=s[0].scale,this.maxScale=s[s.length-1].scale;const o=this._lodInfos=s.map(a=>xyr.create(e,a,t));s.forEach((a,l)=>{this._infoByLevel[a.level]=o[l],this._infoByScale[a.scale]=o[l],this.scales[l]=a.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel[typeof e=="number"?e:e.level]}getTileBounds(e,t,r=!1){nd.set(t);const n=this._infoByLevel[nd.level];return n?n.getTileBounds(e,nd,r):e}getTileCoords(e,t,r=!1){nd.set(t);const n=this._infoByLevel[nd.level];return n?n.getTileCoords(e,nd,r):e}getTileCoverage(e,t=192,r=!0,n="closest"){if(!r&&(e.scale>this.minScale||e.scale100)return null;let S=[];for(l=h;l=0;I--){const R=S[I];u=Math.min(u,R.getLeftCol()),c=Math.max(c,R.getRightCol())}if(u=Math.floor(u),c=Math.floor(c),l>=s.first[1]&&l<=s.last[1])if(a)if(s.size[0]s.last[0]||c=0;I--){const R=S[I];R.ymax>=l?R.incrRow():S.splice(I,1)}}return o}getTileParentId(e){nd.set(e);const t=this._infoByLevel[nd.level],r=this._lodInfos.indexOf(t)-1;return r<0?null:(this._getTileIdAtLOD(nd,this._lodInfos[r],nd),nd.id)}getTileResolution(e){const t=this._infoByLevel[typeof e=="object"?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){nd.set(t);const r=this._infoByLevel[nd.level],n=e.lodInfo;if(n.resolution>r.resolution){this._getTileIdAtLOD(nd,n,nd);const o=n.denormalizeCol(nd.col,nd.world);for(const a of e.spans)if(a.row===nd.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(n.resolution(w[0]=Math.min(w[0],S.row),w[1]=Math.max(w[1],S.row),w[2]=Math.min(w[2],S.colFrom),w[3]=Math.max(w[3],S.colTo),w),[1/0,-1/0,1/0,-1/0]),c=r.denormalizeCol(nd.col,nd.world),h=n.getColumnForX(r.getXForColumn(c)),p=n.getRowForY(r.getYForRow(nd.row)),m=n.getColumnForX(r.getXForColumn(c+1))-1,v=n.getRowForY(r.getYForRow(nd.row+1))-1;return!(h>u||ma||vo.row===nd.row&&o.colFrom<=s&&o.colTo>=s)}normalizeBounds(e,t,r){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const n=Zp(this.tileInfo.spatialReference),s=-r*(n.valid[1]-n.valid[0]);e[0]+=s,e[2]+=s}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let r=1;rt[r]+Tyr)return this._infoByScale[t[r-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce((r,n)=>Math.abs(n-e)=0;r--)if(ee.push(t)),this._controllers.clear(),e.forEach(t=>t.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,r)=>e(r))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const r=this.get(e);if(r)return r;const n=new AbortController;let s=null;t&&(s=Qh(t,()=>n.abort()));const o=()=>{const c=this._processingItems.get(e);c&&c.controller.abort(),a(),u.reject(Oc())},a=()=>{l.remove(),s?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=ZH(n.signal,o),u=ac();return this._deferreds.set(e,u),this._controllers.set(e,n),u.promise.then(a,a),this._queue.push(e),this._scheduleNext(),u.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(Oc("Removed from queue")),this._removeItem(e)),e}reset(){const e=[];this._processingItems.forEach(t=>e.push(t)),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(n,s),s=>this._processError(n,s))):this._processResult(n,t)}get test(){return{update:e=>this.runTask(e)}}};function Eyr(i,e){return i.length=0,e.forEach(t=>i.push(t)),i}const wMe=new Set,Ihe=[],gj=new Map,ult=[0,0];let O4=class extends un{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t,strategy:r}=this;this._queue=new UY({concurrency:e,process:(n,s)=>{const o=this._keyToItem.get(n);return t(o,{signal:s})},peeker:r==="scale-first"?n=>this._peekByScaleFirst(n):n=>this._peekByCenterFirst(n)})}destroy(){this.clear(),this._queue=zo(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear()}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const r=this._queue.push(t),n=()=>{this._keyToItem.delete(t)};return this._keyToItem.set(t,e),r.then(n,n),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(c=>{const h=this._keyToItem.get(c),p=this.tileInfoView.getTileScale(h.key);gj.has(p)||(gj.set(p,[]),r=Math.max(p,r),n=Math.min(p,n)),gj.get(p).push(h.key),wMe.add(p)});let s=this.state.scale;gj.has(s)||(Eyr(Ihe,wMe),Ihe.sort((c,h)=>c-h),s=Ihe.reduce((c,h)=>Math.abs(h-s){const p=a.denormalizeCol(c.col,c.world),m=a.denormalizeCol(h.col,h.world);return Math.sqrt((l-p)*(l-p)+(u-c.row)*(u-c.row))-Math.sqrt((l-m)*(l-m)+(u-h.row)*(u-h.row))}),wMe.clear(),gj.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);t.getTileCoords(ult,a.key);const l=ySe(ult,r);lthis.maxSize&&s>=0;)s!==e&&(n=this._pruneAroundCenterTile(n,t,r,s)),s--;n>this.maxSize&&(n=this._pruneAroundCenterTile(n,t,r,e))}_pruneAroundCenterTile(e,t,r,n){const s=this._tileKeysPerLevel[n];if(!s||s.length===0)return e;const{size:o,origin:a}=this._tileInfoView.tileInfo,l=r*o[0],u=r*o[1],c=[0,0],h=[0,0];for(s.sort((p,m)=>(c[0]=a.x+l*(p.col+.5),c[1]=a.y-u*(p.row+.5),h[0]=a.x+l*(m.col+.5),h[1]=a.y-u*(m.row+.5),k1e(c,t)-k1e(h,t)));s.length>0;){const p=s.pop();if(this._removeTile(p.id),--e===this.maxSize)break}return e}_removeTile(e){const t=this._tilePerId.get(e);this._removedFunc&&t&&this._removedFunc(t),clt(this._tilePerId,e)}};function clt(i,e){i.delete(e)}const VL=new Tc(0,0,0,0),_M=new Map,HL=[],xMe=[];let Qne=class{constructor(e){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,e.resampling!=null&&(this.resampling=e.resampling),e.cachePolicy&&(this.cachePolicy=e.cachePolicy),e.coveragePolicy&&(this.coveragePolicy=e.coveragePolicy),e.buffer!=null&&(this.buffer=e.buffer),e.cacheSize&&(this._tileCache=new Iyr(e.cacheSize,this.tileInfoView,t=>{this.releaseTile(t)}))}destroy(){this.tileIndex.clear()}update(e){const{resampling:t,tileIndex:r}=this,{scale:n,center:s,resolution:o}=e.state,{minScale:a,maxScale:l}=this.tileInfoView,u=!e.stationary&&n>this._previousScale;if(this._previousScale=n,!t&&(n>a||nI.visible=!0);let v=0,w=0;if(h.length>0)for(const{row:I,colFrom:R,colTo:L}of h)for(let k=R;k<=L;k++){v++;const B=VL.set(m,I,p.normalizeCol(k),p.getWorldForColumn(k)).id;let $=r.get(B);if($)$.isReady?(_M.set(B,$),w++):u||this._addParentTile(B,_M);else{if(this._tileCache?.has(B)){if($=this._tileCache.pop(B),this.tileIndex.set(B,$),$.isReady){_M.set(B,$),w++;continue}}else $=this.acquireTile(VL),this.tileIndex.set(B,$);u||this._addParentTile(B,_M)}}const S=w===v;for(const[I,R]of r){if(_M.has(I))continue;VL.set(I);const L=this.tileInfoView.intersects(c,VL),k=this.cachePolicy==="purge"?VL.level!==m:VL.level>m;!L||!u&&S?!k&&L||HL.push(R):R.isReady?k&&this.cachePolicy==="purge"&&this._hasReadyAncestor(VL,m)?HL.push(R):xMe.push(R):k&&HL.push(R)}for(const I of xMe)I.isReady&&_M.set(I.key.id,I);for(const I of HL)this._tileCache?this._tileCache.add(I):this.releaseTile(I),r.delete(I.key.id);for(const I of _M.values())this.tiles.push(I);for(const I of r.values())_M.has(I.key.id)||(I.visible=!1);this._tileCache?.prune(m,s,o),dB.pool.release(c),xMe.length=0,HL.length=0,_M.clear()}clear(){const{tileIndex:e}=this;for(const t of e.values())this.releaseTile(t);e.clear()}refresh(e){for(const t of this.tileIndex.values())this.tiles.includes(t)?e(t):HL.push(t);for(const t of HL)this.releaseTile(t),this.tileIndex.delete(t.key.id);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,t){let r=e,n=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(n=this.tileIndex.get(r),n?.isReady){t.has(n.key.id)||t.set(n.key.id,n);break}}else if(this._tileCache?.has(r)&&(n=this._tileCache.pop(r),this.tileIndex.set(r,n),n?.isReady)){t.has(n.key.id)||t.set(n.key.id,n);break}}_hasReadyAncestor(e,t){const r=Wo();this.tileInfoView.getTileBounds(r,e,!0);for(const n of this.tileIndex.values())if(n.isReady&&n.key.level>=t&&n.key.level=2}function e0r(i){return Array.isArray(i)&&i.length>=2}function Ahe(i){return Qyr(i)||e0r(i)}var jNe;const k0=[0,0];let P4=jNe=class extends Ci{constructor(i){super(i),this._viewpoint2D={center:Ja(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new hr,this.id=0,this.inverseTransform=HA(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=HA(),this.transformNoRotation=HA(),this.displayMat3=Cc(),this.displayViewMat3=Cc(),this.viewMat3=Cc(),this.viewMat2d=SS(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(i){this._set("pixelRatio",i),this._update()}set size(i){this._set("size",i),this._update()}set viewpoint(i){if(i){const e=this._viewpoint2D,t=i.targetGeometry;e.center[0]=t.x,e.center[1]=t.y,e.rotation=i.rotation,e.scale=i.scale,e.spatialReference=t.spatialReference}this._update()}copy(i){const e=this.size,t=this.viewpoint;return t&&e?(this.viewpoint=ME(t,i.viewpoint),this._set("size",kW(e,i.size))):(this.viewpoint=i.viewpoint.clone(),this._set("size",[i.size[0],i.size[1]])),this._set("pixelRatio",i.pixelRatio),this}clone(){return new jNe({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(i,e,t){return Ahe(e)?yf(i,e,this.inverseTransform):(k0[0]=e,k0[1]=t,yf(i,k0,this.inverseTransform))}toScreen(i,e,t){return Ahe(e)?yf(i,e,this.transform):(k0[0]=e,k0[1]=t,yf(i,k0,this.transform))}toScreenNoRotation(i,e,t){return Ahe(e)?yf(i,e,this.transformNoRotation):(k0[0]=e,k0[1]=t,yf(i,k0,this.transformNoRotation))}toScreenClosest(i,e,t){Ahe(e)?(k0[0]=e[0],k0[1]=e[1]):(k0[0]=e,k0[1]=t);const[r]=k0,{center:n,extent:s,spatialReference:o,transform:a}=this;return(rs.xmax)&&(k0[0]=rRt(r,n[0],o)),yf(i,k0,a)}getScreenTransform(i,e){const{center:t}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size");return fWe(i,t,n,e,0,r),i}_update(){const{center:i,spatialReference:e,scale:t,rotation:r}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new Ab({targetGeometry:new $i(i[0],i[1],e),scale:t,rotation:r});if(this._set("viewpoint",o),!s||!e||!t)return;this.resolution=GY(o),this.rotation=r,this.scale=t,this.spatialReference=e,kW(this.center,i);const a=s[0]!==0?2/s[0]:0,l=s[1]!==0?-2/s[1]:0;pB(this.displayMat3,a,0,0,0,l,0,-1,1,1);const u=Jk(this.viewMat3),c=Xp(s[0]/2,s[1]/2),h=Xp(-s[0]/2,-s[1]/2),p=eB(r);h0(u,u,c),q3(u,u,p),h0(u,u,h),n_(this.displayViewMat3,this.displayMat3,u);const m=aWe(this.viewMat2d,c);return sk(m,m,p),VA(m,m,h),iyr(this.extent,o,s),mWe(this.transform,o,s,n),oWe(this.inverseTransform,this.transform),uyr(this.transformNoRotation,o,s,n),this.worldScreenWidth=cyr(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};x([D({readOnly:!0})],P4.prototype,"id",void 0),x([D({value:1,json:{write:!0}})],P4.prototype,"pixelRatio",null),x([D({json:{write:!0}})],P4.prototype,"size",null),x([D()],P4.prototype,"spatialReference",void 0),x([D({type:Ab,json:{write:!0}})],P4.prototype,"viewpoint",null),P4=jNe=x([Qe("esri.views.2d.ViewState")],P4);const hlt=P4;var GNe,UNe;let KO=GNe=class extends un{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new GNe({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};x([D()],KO.prototype,"left",void 0),x([D()],KO.prototype,"top",void 0),x([D()],KO.prototype,"right",void 0),x([D()],KO.prototype,"bottom",void 0),KO=GNe=x([Qe("esri.views.2d.PaddedViewState.Padding")],KO);let rU=UNe=class extends hlt{constructor(...i){super(...i),this.paddedViewState=new hlt,this._updateContent=(()=>{const e=Ja();return()=>{const t=this._get("size"),r=this._get("padding");if(!t||!r)return;const n=this.paddedViewState;dl(e,r.left+r.right,r.top+r.bottom),Kne(e,t,e),kW(n.size,e);const s=n.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(Ki(()=>[this.size,this.padding],()=>this._updateContent(),Kl)),this.padding=new KO,this.size=[0,0]}set padding(i){this._set("padding",i||new KO)}set viewpoint(i){if(i){const e=i.clone();this.paddedViewState.viewpoint=i,hyr(e,i,this._get("size"),this._get("padding"));const t=this._viewpoint2D,r=e.targetGeometry;t.center[0]=r.x,t.center[1]=r.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=r.spatialReference,this._update()}}clone(){return new UNe({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};x([D()],rU.prototype,"paddedViewState",void 0),x([D({type:KO})],rU.prototype,"padding",null),x([D()],rU.prototype,"viewpoint",null),rU=UNe=x([Qe("esri.views.2d.PaddedViewState")],rU);const t0r=rU;let d1=class extends un{constructor(e){super(e),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([Ki(()=>this.constraints?.version,t=>{this.constraints&&t&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Kl)])}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return this.state.commitProperty("id"),new $i({x:e[0],y:e[1],spatialReference:t})}set center(e){if(e==null)return;if(!this.ready)return void this._set("center",e);let t;try{t=this._project(e,this.state.spatialReference)}catch(n){return void di.getLogger(this).error(new qe("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:n}))}const r=this.viewpoint;kNe(r,r,t),this.viewpoint=r}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void di.getLogger(this).error(new qe("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let t;try{t=this._project(e,this.state.spatialReference)}catch(n){return void di.getLogger(this).error(new qe("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const r=this.viewpoint;ryr(r,r,t,this.state.size,{constraints:this.constraints}),this.viewpoint=r}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;pyr(t,t,e),this.viewpoint=t}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",void 0);const r=this._get("extent");return void(r&&(this._set("extent",void 0),this._set("center",r.center)))}const t=this.viewpoint;slt(t,t,e),this.viewpoint=t}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(e){if(e==null)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let t,r;try{t=this._project(e,this.state.spatialReference),!e.scale||isNaN(e.scale)?r=new qe("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):e.targetGeometry==null&&(r=new qe("mapview:invalid-viewpoint","geometry not defined"))}catch(s){r=new qe("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(r)return void di.getLogger(this).error(r);this._scaleBeforeChangingSpatialReference=null;const n=new Ab({targetGeometry:new $i,scale:0,rotation:0});ME(n,t),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(e){if(!(e>=0))return;if(!this.ready){this._set("zoom",e),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const t=this.constraints?.zoomToScale(e)??0;if(!t)return void this._set("zoom",-1);const r=this.viewpoint;slt(r,r,t),this.viewpoint=r,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(e){if(!e[0]&&!e[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:t,constraints:r}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),l=this._get("viewpoint"),u=this._get("zoom"),c=u!=null&&r!=null&&r.zoomToScale(u)||void 0;let h,p,m;const v=l?.rotation,w=l?.targetGeometry;w?.type==="extent"?h=w:w?.type==="point"&&(p=w,m=l?.scale);const S=s??h;return{center:n??p??S?.center,rotation:a??v,scale:(o??c??m??(S&&qV(S,[e[0]-t.left-t.right,e[1]-t.top-t.bottom])))||void 0}}startup(e,t,r,n){const s=e.targetGeometry;try{this._project(e,r)}catch(o){di.getLogger(this).warn(new Rf("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:r,error:o})),e.targetGeometry=n||new $i({x:0,y:0,spatialReference:r})}this.constraints?.fit(e),this._set("state",new t0r({padding:this.padding,size:t,viewpoint:e})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[e,t],spatialReference:r,rotation:n,scale:s}=this.state.paddedViewState,o=new $i({x:e,y:t,spatialReference:r});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(e){const t=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=t.scale;else{const l=t.viewpoint.clone();l.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=l}const r=t.clone(),[n,s]=t.center;let o=null;try{o=this._project(new $i({x:n,y:s,spatialReference:t.spatialReference}),e)}catch(l){hze()||di.getLogger(this).warn(new Rf("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:e,error:l}))}o||(o=new $i({x:0,y:0,spatialReference:e}));const a=kNe(new Ab({targetGeometry:new $i,scale:0,rotation:0}),t.viewpoint,o);r.viewpoint=a;try{const u=[t.size[0]/2,t.size[1]/2],c=[u[0]+20,u[1]],h=t.toMap([0,0],c),{x:p,y:m}=this._project(new $i({x:h[0],y:h[1],spatialReference:t.spatialReference}),e);h[0]=p,h[1]=m,r.toScreen(h,h);const v=r5t(u,h,c),w=Math.hypot(h[0]-u[0],h[1]-u[1])/20;!Number.isFinite(w)||Math.abs(w)>4?(a.rotation=0,a.targetGeometry=new $i({x:0,y:0,spatialReference:e})):(a.scale*=w,a.scale>yi("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(v)?v:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(e,t){if(!this.ready)return;const r=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();r.size=[e,t],dyr(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(e){if(!this.ready)return null;const t=[0,0],[r,n]=this.state.toMap(t,[e.x,e.y]),s=this.state.spatialReference;return new $i({x:r,y:n,spatialReference:s})}toScreen(e,t){if(!this.ready)return null;const r=this._project(e,this.state.spatialReference),n=[r.x,r.y];return t?.pickClosestTarget===!1?this.state.toScreen(n,n):this.state.toScreenClosest(n,n),Vd(n[0],n[1])}_project(e,t){const r=e?.targetGeometry||e;if(!t)return e;if(!r)return null;if(t.imageCoordinateSystem||r.spatialReference?.imageCoordinateSystem||Ya(t,r.spatialReference))return e;const n=Wc(r,t);if(!n)throw new qe("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:t});return i0r(e)?(e.targetGeometry=n,e):n}};function i0r(i){return i?.declaredClass==="esri.Viewpoint"}x([D({type:$i})],d1.prototype,"center",null),x([D()],d1.prototype,"constraints",void 0),x([D({type:hr})],d1.prototype,"extent",null),x([D({value:{top:0,right:0,bottom:0,left:0},cast:i=>({top:0,right:0,bottom:0,left:0,...i})})],d1.prototype,"padding",null),x([D()],d1.prototype,"ready",void 0),x([D()],d1.prototype,"resizeAlign",void 0),x([D({readOnly:!0})],d1.prototype,"resolution",null),x([D({type:Number})],d1.prototype,"rotation",null),x([D({type:Number})],d1.prototype,"scale",null),x([D({readOnly:!0})],d1.prototype,"state",void 0),x([D({type:Ab})],d1.prototype,"viewpoint",null),x([D()],d1.prototype,"zoom",null),d1=x([Qe("esri.views.2d.ViewStateManager")],d1);function wWe(i,e){switch(e){case"primary":return i.pointerType==="touch"||i.button===0;case"secondary":return i.pointerType!=="touch"&&i.button===2;case"tertiary":return i.pointerType!=="touch"&&i.button===1}}let dlt=class extends Ag{constructor(e,t){super(!0),this._view=e,this.registerIncoming("double-click",t,r=>this._handleDoubleClick(r,t))}_handleDoubleClick(e,t){wWe(e.data,"primary")&&(e.stopPropagation(),t?this._view.mapViewNavigation.zoomOut([e.data.x,e.data.y]):this._view.mapViewNavigation.zoomIn([e.data.x,e.data.y]))}},r0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.pointerType=t,this.registerIncoming("double-tap-drag",r,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(e){const{data:t}=e,{pointerType:r}=t;if(r!==this.pointerType)return;e.stopPropagation();const{action:n,delta:s}=t,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:l}=o;this._startScale=l,this._currentScale=l,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const l=1.015**s.y,u=this._startScale*l,c=u/this._currentScale;a.setViewpointImmediate(c),this._currentScale=u;break}case"end":{const{constraints:l}=o,{effectiveLODs:u,snapToZoom:c}=l;if(!c||!u)return void a.end();const h=l.snapScale(this._currentScale),p=(s.y>0?Math.max(h,l.snapToPreviousScale(this._startScale)):Math.min(h,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(p);break}}}},_Se=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const t=e.data,r=t.pointers.size;switch(t.action){case"start":this._currentCount=r,this._emitStart(e);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"update":this._emitUpdate(e);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"end":this._emitEnd(e),this._currentCount=0}this._previousEvent=e}_emitStart(e){this._startEvent=e,this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.start(this._currentCount,e,this._startEvent)}_emitUpdate(e){this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.update(this._currentCount,e,this._startEvent)}_emitEnd(e){this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.end(this._currentCount,e,this._startEvent),this._startEvent=null}},n0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.pointerAction=t,this.registerIncoming("drag",r,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(e){super.onInstall(e),this._dragEventSeparator=new _Se({start:(t,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(t,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(t,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(t,r)=>t===1&&wWe(r.data,this.pointerAction)})}_handleDrag(e){const t=this.view.mapViewNavigation;t.pinch.zoomMomentum||t.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},s0r=class extends Ag{constructor(e,t,r){super(!0),this._view=e,this.pointerAction=t;const n=this._view.mapViewNavigation;this._dragEventSeparator=new _Se({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&wWe(o.data,this.pointerAction)}),this.registerIncoming("drag",r,s=>this._dragEventSeparator.handle(s))}};function gT(i){let e=i*i;return i<0&&(e*=-1),e}function o0r(i){return i.translation[0]=0,i.translation[1]=0,i.translation[2]=0,i.heading=0,i.tilt=0,i}function a0r(i,e,t){const r=t,n=i.state,s=i.device,o=e.tiltDirection==="forward-down"?1:-1,a=1;return s.deviceType==="standard"?(r.translation[0]=gT(n.axes[0]),r.translation[1]=gT(n.axes[1]),r.translation[2]=gT(n.buttons[7])-gT(n.buttons[6]),r.heading=gT(n.axes[2]),r.tilt=gT(n.axes[3])):s.deviceType==="spacemouse"&&(r.translation[0]=1.2*gT(n.axes[0]),r.translation[1]=1.2*gT(n.axes[1]),r.translation[2]=2*-gT(n.axes[2]),r.heading=1.2*gT(n.axes[5]),r.tilt=1.2*gT(n.axes[3])),r.tilt*=o,Gc(r.translation,r.translation,a),r}function l0r(i){return i.translation[0]===0&&i.translation[1]===0&&i.translation[2]===0&&i.heading===0&&i.tilt===0&&i.zoom===0}let u0r=class extends Ag{constructor(e){super(!0),this._view=e,this._frameTask=null,this._watchHandles=new cY,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",t=>this._handleGamePadEvent(t)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([Ki(()=>this._view.navigation.gamepad?.enabled,t=>{t?(this._handle.resume(),this._frameTask||(this._frameTask=H9({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},js)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(e){const t=this._view.navigation.gamepad.device;t&&e.data.device!==t||this._currentDevice&&this._currentDevice!==e.data.device||(e.data.action==="end"?(this._currentDevice=null,o0r(this._transformation)):(this._currentDevice=e.data.device,a0r(e.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(e){const t=this._transformation;if(l0r(t))return;const r=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=h0r*n*e;ok(r,r,[t.translation[0]*s,-t.translation[1]*s]);const o=1+t.translation[2]*d0r*e,a=this._view.constraints.rotationEnabled?-t.heading*c0r*e:0,l=this._view.size,u=[l[0]/2,l[1]];yWe(r,r,o,a,u,l);const c=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=c}};const c0r=.06,h0r=.7,d0r=6e-4;function x5t(i){const e=()=>i(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),{remove:()=>document.addEventListener("visibilitychange",e)}}let p0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Ctrl"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,l=this._pressedKeys.size>0;a||l?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[t.left]:"left",[t.right]:"right",[t.up]:"up",[t.down]:"down"},this.registerIncoming("key-down",r,this._handleKey),this.registerIncoming("key-up",r,this._handleKey),this.registerIncoming("blur",r,this._stopMovement),this._visibilityHandle=x5t(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(e){const t=this._currentDirection!=null;if(e!=null){if(t||this.view.mapViewNavigation.begin(),this._currentDirection!==e)switch(e){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else t&&this.view.mapViewNavigation.stop();this._currentDirection=e}_setTimeout(e){clearTimeout(this._timeout),this._timeout=e===void 0?void 0:setTimeout(()=>{this._timeout=void 0,e()},this._stickyKeyDuration)}},f0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",r,n=>this._handleKeyUp(n)),this.registerIncoming("blur",r,()=>this._handleStop()),this._visibilityHandle=x5t(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,t){const r=e.modifiers;if(r.size>0&&!r.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[e.data.key];if(this._pressed=n!=null,this._pressed){if(e.preventDefault(),t)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}};var Gz;(function(i){i[i.IN=0]="IN",i[i.OUT=1]="OUT"})(Gz||(Gz={}));let m0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._keysToZoomAction={},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),t.zoomIn.forEach(n=>this._keysToZoomAction[n]=Gz.IN),t.zoomOut.forEach(n=>this._keysToZoomAction[n]=Gz.OUT)}_handleKeyDown(e){this._handleKey(e)}_handleKey(e){const t=e.modifiers;if(t.size>0&&!t.has("Shift"))return;const{key:r}=e.data;if(!(r in this._keysToZoomAction))return;const n=this._keysToZoomAction[r],{mapViewNavigation:s}=this.view;let o=null;switch(n){case Gz.IN:o=s.zoomIn();break;case Gz.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),e.stopPropagation()}};const g0r=.6;let y0r=class extends Ag{constructor(e,t){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",t,r=>this._handleMouseWheel(r))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled||(e.preventDefault(),e.stopPropagation(),!this._canZoom))return;const t=this._view.mapViewNavigation,{x:r,y:n,deltaY:s}=e.data,o=1/g0r**(1/60*s),a=t.zoom(o,[r,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,t.end()}))}},v0r=class extends Ag{constructor(e){super(!0),this.view=e,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const t=this.view.mapViewNavigation;this._dragEventSeparator=new _Se({start:(r,n)=>{t.pinch.begin(this.view,n.data),n.stopPropagation()},update:(r,n)=>{t.pinch.update(this.view,n.data),n.stopPropagation()},end:(r,n)=>{t.pinch.end(this.view),n.stopPropagation()},condition:r=>r>=2})}_handleDrag(e){this._dragEventSeparator.handle(e)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function plt(i){const e=i.native;return e?{buttons:e.buttons.map(t=>t.pressed?t.value||1:0),axes:e.axes.map(t=>w0r(t,i.axisThreshold))}:{buttons:[],axes:[]}}function _0r(i,e){if(i.axes.length!==e.axes.length||i.buttons.length!==e.buttons.length)return!1;for(let t=0;t{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,plt(l),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(l),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const r="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=r&&n,this.supported&&(this._forEachGamepad(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const t=new nWe(e);t.deviceType!=="unknown"&&(this._inputDevices[e.index]=t,this._input.gamepad.devices.add(t)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=H9({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),t=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!t;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=plt(s),l=r||b0r(a);o&&(o.timestamp===n.timestamp||!o.active&&l||_0r(o.state,a))||this._emitGamepadEvent(n,a,!l)})}_forEachGamepad(e){const t=window.navigator.getGamepads();for(let r=0;r{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new x0r(e,this._input),this._gamepadSource.onEvent=r=>this._callback("gamepad",r)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=zo(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const r=this._active[t];this._element.removeEventListener(SMe[t],r),delete this._active[t]}e&&e.forEach(t=>{if(!this._active[t]&&SMe[t]){const r=(this._eventHandlers[t]||this._handleDefault).bind(this,t);this._element.addEventListener(SMe[t],r),this._active[t]=r}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,t){t?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?yj.touchNone:yj.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?yj.touchPan:yj.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(yj.touchNone),this._element.classList.remove(yj.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,t){const r=O4t(this._element,e);return T5t.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),t.x=r.x,t.y=r.y,t}_handleKey(e,t){const{key:r}=t;r&&e==="key-up"&&this._keyDownState.delete(r);const n={native:t,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,t){const r=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,r)}_handlePointerPreventDefault(e,t){const r=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,r)}_handleMouseWheel(e,t){let r=t.deltaY;switch(t.deltaMode){case 0:flt&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}flt?r*=.7:S0r||C0r?r*=.6:T0r&&(r*=1.375);const n=100,s=Math.abs(r);s>n&&(r=r/s*200/(1+Math.exp(-.02*(s-n))));const o=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:r});this._callback(e,o)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const r={native:t};t.preventDefault(),this._callback(e,r)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};S5t.test={disableSubpixelCoordinates:!1};const SMe={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let E0r=class extends Ag{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};const t0={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function B1e(i,e){return Math.abs(e.x-i.x)+Math.abs(e.y-i.y)}function I0r(i,e){const t=e.x-i.x,r=e.y-i.y;return Math.sqrt(t*t+r*r)}function A0r(i,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:Vd()},i.length===0)return e;if(i.length===1)return e.center.x=i[0].x,e.center.y=i[0].y,e;if(i.length===2){const[L,k]=i,[B,$]=[k.x-L.x,k.y-L.y];return e.radius=Math.sqrt(B*B+$*$)/2,e.center.x=(L.x+k.x)/2,e.center.y=(L.y+k.y)/2,e}let t=0,r=0;for(let L=0;LL.x-t),s=i.map(L=>L.y-r);let o=0,a=0,l=0,u=0,c=0,h=0,p=0;for(let L=0;Lthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(e=>{e.doubleTapTimeout=Hc(e.doubleTapTimeout)})}get hasPendingInputs(){return i2e(this._pointerState,e=>e.doubleTapTimeout!=null)}_clearPointerDown(e){const t=this._pointerState.get(e);t&&(t.doubleTapTimeout=Hc(t.doubleTapTimeout),this._pointerState.delete(e),this.refreshHasPendingInputs())}_createDoubleTapDragData(e,t,r){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:u}=r;return{action:e,delta:t,button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:u}}_dragStart(e,t){if(!this._doubleTapDragReady||e!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:n}=t,{center:s}=r;this._dragStartCenter=s;const o=this._createDoubleTapDragData("begin",Vd(0,0),r);this._doubleTapDrag.emit(o,void 0,n),t.stopPropagation()}_dragUpdate(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:r}=e,{center:n}=t,s=Vd(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",s,t);this._doubleTapDrag.emit(o,void 0,r),e.stopPropagation()}_dragEnd(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:r}=e,{center:n}=t,s=Vd(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",s,t);this._doubleTapDrag.emit(o,void 0,r),this._doubleTapDragActive=!1,e.stopPropagation()}_handlePointerDown(e){const{data:t}=e,r=i9(t),n=this._pointerState.get(r),{pointerType:s}=t.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),B1e(n.event.data,t)>o?this._storePointerDown(e):this._doubleTapDragReady=!0}else this._storePointerDown(e)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(e){const{data:t}=e,{pointerType:r}=t.native,n=i9(t),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:e,doubleTapTimeout:o}),this.refreshHasPendingInputs()}},O0r=class extends Ag{constructor(e){super(!1),this._navigationTouch=e,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(e,t,r,n){return{action:e,pointerType:this._pointerType,button:this._mouseButton,buttons:t.buttons,timestamp:n,pointers:P0r(this._activePointerMap),pointer:t,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(e){const t=e.native.pointerId,r=Mhe(this._activePointerMap).angle,n={event:e,initialAngle:0,lastAngle:0};this._activePointerMap.set(t,n);const s=mge(n,C5t(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(r)}_updatePointer(e){if(e&&e.x==null&&e.y==null)return;const t=e.native.pointerId,r=this._activePointerMap.get(t);r?r.event=e:this._addPointer(e)}_removePointer(e){const t=Mhe(this._activePointerMap).angle;this._activePointerMap.delete(e),this._updatePointerAngles(t)}_updatePointerAngles(e){const t=Mhe(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=mge(r,t)-e,r.lastAngle=mge(r,t)-e})}_emitEvent(e,t,r){const n=Mhe(this._activePointerMap);this._drag.emit(this._createPayload(e,t,n,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const t=e.data.native.pointerId,r=e.timestamp;this._activePointerMap.get(t)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(t)):(this._removePointer(t),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const t=e.data,r=t.currentEvent,n=e.timestamp;switch(t.action){case"start":case"update":this._isDragging?this._activePointerMap.has(r.native.pointerId)?(this._updatePointer(r),!this._isCurrentDragSuppressed&&this._emitEvent("update",r,n)):(this._addPointer(r),this._emitEvent("added",r,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(r),this._pointerType=e.data.startEvent.pointerType,this._mouseButton=e.data.startEvent.button,this._startStateModifiers=e.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",r,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function C5t(i){const e=[];return i.forEach(t=>{e.push(Vd(t.event.x,t.event.y))}),A0r(e)}function Mhe(i){const e=C5t(i);let t=0;return i.forEach(r=>{let n=mge(r,e),s=n-r.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=r.lastAngle+s,r.lastAngle=n;const o=n-r.initialAngle;t+=o}),t/=i.size||1,{angle:t,radius:e.radius,center:e.center}}function P0r(i){const e=new Map;return i.forEach((t,r)=>e.set(r,t.event)),e}function mge(i,e){const t=i.event,r=t.x-e.center.x,n=t.y-e.center.y;return Math.atan2(n,r)}var glt;(function(i){i[i.Left=0]="Left",i[i.Middle=1]="Middle",i[i.Right=2]="Right",i[i.Back=3]="Back",i[i.Forward=4]="Forward",i[i.Undefined=-1]="Undefined"})(glt||(glt={}));let R0r=class extends Ag{constructor(e=t0.maximumDoubleClickDelay,t=t0.maximumDoubleClickDistance,r=t0.maximumDoubleTouchDelay,n=t0.maximumDoubleTouchDistance,s=hY){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=t,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(e=>{e.immediateDoubleClick&&e.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(e){const t=e.data,r=i9(t);if(!this._pointerState.has(r)){const n={downButton:t.native.button,x:t.x,y:t.y,immediateDoubleClick:null};this._pointerState.set(r,n),this.startCapturingPointer(t.native)}}_handlePointerUp(e){const t=e.data,r=i9(t),n=this._pointerState.get(r);if(n&&n.downButton===t.native.button){const s=n.immediateDoubleClick,o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),B1e(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(t))):B1e(n,e.data)>o?this._removeState(t):this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,t){const r=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;t.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),r)}}_removeState(e){const t=i9(e);this._pointerState.delete(t),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}},D0r=class extends Ag{constructor(e=t0.maximumClickDelay,t=t0.movementUntilMouseDrag,r=t0.movementUntilPenDrag,n=t0.movementUntilTouchDrag,s=t0.holdDelay,o=hY){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=t,this._movementUntilPenDrag=r,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",a=>{this._handlePointerLoss(a,"pointer-up")}),this.registerIncoming("pointer-capture-lost",a=>{this._handlePointerLoss(a,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",a=>{this._handlePointerLoss(a,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(e=>{e.holdTimeout=Hc(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const t=e.data,r=t.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(r);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,e.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:t,previousEvent:t,startTimestamp:e.timestamp,isDragging:!1,downButton:t.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(r,s),this.startCapturingPointer(t.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,t,r){return{action:e,startEvent:t.startEvent,previousEvent:t.previousEvent,currentEvent:r}}_handlePointerMove(e){const t=e.data,r=t.native.pointerId,n=this._pointerState.get(r);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,t),void 0,n.modifiers):I0r(t,n.startEvent)>this._getDragThreshold(t.native.pointerType)&&this._startDragging(e),n.previousEvent=t)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const t=e.data,r=t.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=e.modifiers,n.isDragging=!0,r===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",n,t)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,t){const r=e.data,n=r.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",s,t==="pointer-up"?r:s.previousEvent),void 0,s.modifiers):t==="pointer-up"&&s.downButton===r.native.button&&e.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(r),this._pointerState.delete(n),this.stopCapturingPointer(r.native),this._pointerState.size===0&&this._moveHandle.pause())}},F0r=class extends Ag{constructor(e=t0.maximumDoubleClickDelay,t=t0.maximumDoubleClickDistance,r=t0.maximumDoubleTouchDelay,n=t0.maximumDoubleTouchDistance,s=hY){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=t,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(e=>e.doubleClickTimer=Hc(e.doubleClickTimer))}get hasPendingInputs(){return i2e(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,t){const r=this._pointerState.get(e);r&&(r.doubleClickTimer=Hc(r.doubleClickTimer),t&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const t=this._pointerState.get(e);t.pointerDownCount===1&&this._click.emit(t.event.data,void 0,t.event.modifiers),t.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:t,pointerType:r,button:n}=e.native;return r==="mouse"?`${t}:${n}`:`${r}`}_handleImmediateClick(e){const t=e.data,{pointerType:r}=t.native,n=this._getPointerId(t);if(!this._pointerState.has(n))return void this._startClick(e);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,l=r==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;B1e(o,t)>l?(this._clearDoubleClickTimer(n,!0),this._startClick(e)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(e){const t=i9(e.data),r=this._pointerState.get(t);r&&(r.pointerDownCount+=1)}_startClick(e){const{data:t}=e,{native:{pointerType:r}}=t,n=i9(t),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};const Ohe={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let u$=class extends un{initialize(){const e=()=>this.view?.ready;this.addHandles([v0(()=>!e(),()=>this._disconnect()),v0(e,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=zo(this._inputManager)}_connect(){const e=this.view.surface,t=new S5t(e,this.view.input),r=[new R0r,new D0r,new F0r,new O0r(this.view.navigation),new M0r],n=new A2({eventSource:t,recognizers:r});n.installHandlers("prevent-context-menu",[new E0r],zA.INTERNAL),n.installHandlers("navigation",[new v0r(this.view),new u0r(this.view),new y0r(this.view),new dlt(this.view),new dlt(this.view,[Ohe.counter]),new n0r(this.view,"primary"),new p0r(this.view,Ohe.pan),new m0r(this.view,Ohe.zoom),new f0r(this.view,Ohe.rotate),new s0r(this.view,"secondary"),new r0r(this.view,"touch")],zA.INTERNAL),this.view.viewEvents.connect(n),this._source=t,this._inputManager=n,Ki(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},js)}get test(){return{inputManager:this._inputManager}}};x([D()],u$.prototype,"view",void 0),x([D()],u$.prototype,"latestPointerType",null),x([D()],u$.prototype,"latestPointerLocation",null),x([D()],u$.prototype,"multiTouchActive",null),u$=x([Qe("esri.views.2d.input.MapViewInputManager")],u$);const k0r=u$;var ylt,vlt,_lt,E5t={exports:{}};ylt=E5t,vlt=function(){function i(n,s,o,a,l){e(n,s,o||0,a||n.length-1,l||r)}function e(n,s,o,a,l){for(;a>o;){if(a-o>600){var u=a-o+1,c=s-o+1,h=Math.log(u),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);e(n,s,Math.max(o,Math.floor(s-c*p/u+m)),Math.min(a,Math.floor(s+(u-c)*p/u+m)),l)}var v=n[s],w=o,S=a;for(t(n,o,s),l(n[a],v)>0&&t(n,o,a);w0;)S--}l(n[o],v)===0?t(n,o,S):t(n,++S,a),S<=s&&(o=S+1),s<=S&&(a=S-1)}}function t(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function r(n,s){return ns?1:0}return i},(_lt=vlt())!==void 0&&(ylt.exports=_lt);const I5t=Cg(E5t.exports);function $W(i,e){if(!(this instanceof $W))return new $W(i,e);this._maxEntries=Math.max(4,i||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function L0r(i,e,t){if(!t)return e.indexOf(i);for(var r=0;r=i.minX&&e.maxY>=i.minY}function nU(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xlt(i,e,t,r,n){for(var s,o=[e,t];o.length;)(t=o.pop())-(e=o.pop())<=r||(s=e+Math.ceil((t-e)/r/2)*r,I5t(i,s,e,t,n),o.push(e,s,s,t))}$W.prototype={all:function(){return this._all(this.data,[])},search:function(i){var e=this.data,t=[],r=this.toBBox;if(!Rhe(i,e))return t;for(var n,s,o,a,l=[];e;){for(n=0,s=e.children.length;n=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)},_split:function(i,e){var t=i[e],r=t.children.length,n=this._minEntries;this._chooseSplitAxis(t,n,r);var s=this._chooseSplitIndex(t,n,r),o=nU(t.children.splice(s,t.children.length-s));o.height=t.height,o.leaf=t.leaf,vj(t,this.toBBox),vj(o,this.toBBox),e?i[e-1].children.push(o):this._splitRoot(t,o)},_splitRoot:function(i,e){this.data=nU([i,e]),this.data.height=i.height+1,this.data.leaf=!1,vj(this.data,this.toBBox)},_chooseSplitIndex:function(i,e,t){var r,n,s,o,a,l,u,c;for(l=u=1/0,r=e;r<=t-e;r++)o=$0r(n=UQ(i,0,r,this.toBBox),s=UQ(i,r,t,this.toBBox)),a=TMe(n)+TMe(s),o=e;n--)s=i.children[n],zQ(l,i.leaf?o(s):s),u+=Phe(l);return u},_adjustParentBBoxes:function(i,e,t){for(var r=t;r>=0;r--)zQ(e[r],i)},_condense:function(i){for(var e,t=i.length-1;t>=0;t--)i[t].children.length===0?t>0?(e=i[t-1].children).splice(e.indexOf(i[t]),1):this.clear():vj(i[t],this.toBBox)},_initFormat:function(i){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(i[0])),this.compareMinY=new Function("a","b",e.join(i[1])),this.toBBox=new Function("a","return {minX: a"+i[0]+", minY: a"+i[1]+", maxX: a"+i[2]+", maxY: a"+i[3]+"};")}};let zNe=class A5t{constructor(e,t){this.key=new Tc(0,0,0,0),this.bounds=Wo(),this.objectIds=new Set,this.key.set(t);const r=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=r.resolution,this.scale=r.scale,this.level=r.level}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return hr.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),t=Ky.acquire();for(let r=0;rn?[Wo([i[0],i[1],n,i[3]]),Wo([r,i[1],r+i[2]-n,i[3]])]:i[0]({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||hIt(e)===0||dIt(e)===0)return[];const t=j0r(e,this.tileScheme.spatialReference);return t!=null?[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]:this.boundsIntersections(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const r of e.added)if(!this.has(r)){const n=new zNe(this.tileScheme,r);this._tiles.set(r,n),this._index.insert(n),t.added.push(n)}for(const r of e.removed)if(this.has(r)){const n=this.get(r);this._tiles.delete(r),this._index.remove(n),t.removed.push(n)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:r,lodInfo:n}=t,{level:s}=n;if(r.length>0)for(const{row:o,colFrom:a,colTo:l}of r)for(let u=a;u<=l;u++){const c=B0r.set(s,o,n.normalizeCol(u),n.getWorldForColumn(u)).id;if(EMe.add(c),!this.has(c)){const h=new zNe(this.tileScheme,c);this._tiles.set(c,h),this._index.insert(h),this.tiles.push(h),WL.added.push(h)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];EMe.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),WL.removed.push(a))}(WL.added.length||WL.removed.length)&&this.emit("update",WL),dB.pool.release(t),EMe.clear(),WL.added.length=0,WL.removed.length=0}},R4=class extends un{constructor(){super(...arguments),this.color=new jr([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25,this.multiHighlightEnabled=!1}equals(e){return this.color.equals(e.color)&&(this.haloColor||this.color).equals(e.haloColor||e.color)&&this.haloOpacity===e.haloOpacity&&this.fillOpacity===e.fillOpacity&&this.multiHighlightEnabled===e.multiHighlightEnabled}};x([D({type:jr})],R4.prototype,"color",void 0),x([D({type:jr})],R4.prototype,"haloColor",void 0),x([D()],R4.prototype,"haloOpacity",void 0),x([D()],R4.prototype,"fillOpacity",void 0),x([D()],R4.prototype,"multiHighlightEnabled",void 0),R4=x([Qe("esri.views.2d.support.HighlightOptions")],R4);const tse=R4;async function U0r(i,e,t){const r=R4t(e)?P4t(i,e):e;if(!i.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let n=new Set;const s=new Set;let o=!1,a=null,l=null;t?.include?Tlt(t.include,Slt(i,p=>{n.add(p),IMe(p,m=>s.add(m))},(p,m)=>{s.add(p),n.add(m)},p=>{a||(a=new Set),a.add(p)},p=>n.add(p),()=>o=!0)):(o=!0,n=new Set(i.allLayerViews),n.forEach(p=>{IMe(p,m=>s.add(m))})),t?.exclude&&Tlt(t.exclude,Slt(i,p=>{n.delete(p),IMe(p,m=>s.delete(m))},p=>s.delete(p),p=>{l||(l=new Set),l.add(p)}));const u=i.allLayerViews.filter(p=>!p.suspended&&n.has(p)).reverse(),c=i.toMap(r);let h=[...o?i.graphicsView.hitTest(c).map(p=>({type:"graphic",graphic:p,layer:null,mapPoint:c})):[],...await Promise.all(u.map(p=>p.hitTest(c,r)).toArray())].filter(Ga).flat().filter(Ga);return h=h.filter(p=>p.type!=="graphic"||p.layer?.type!=="subtype-group"||s.has(p.graphic.layer)),a&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||a?.has(VNe(p.graphic)))),l&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||!l?.has(VNe(p.graphic)))),{screenPoint:r,results:h}}function Slt(i,e,t,r,n,s){return o=>{if(o instanceof Us){if(o.layer===i)s?.();else{const a=i.allLayerViews.find(l=>l.layer===o.layer);a&&n?.(a)}r(VNe(o))}else if(o.type==="subtype-sublayer"){const a=i.allLayerViews.find(l=>l.layer===o.parent);a&&t(o,a)}else{const a=i.allLayerViews.find(l=>l.layer===o);a&&e(a)}}}function Tlt(i,e){if(i)if(pve(i))for(const t of i)if(pve(t))for(const r of t)e(r);else e(t);else e(i)}function VNe(i){const e=i.getObjectId();return e?`${i.layer?.uid??i.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${i.uid}`}function IMe({layer:i},e){i.type==="subtype-group"&&i.sublayers.forEach(t=>{e(t)})}let HJ=null,j1e=!0;function z0r(i,e,t){if(!i||!e)throw new Error("Cannot construct image data without dimensions");if(j1e)try{return new ImageData(i,e)}catch{j1e=!1}return M5t(i,e,t)}function V0r(i,e,t,r){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(j1e)try{return new ImageData(i,e,t)}catch{j1e=!1}const n=M5t(e,t,r);return n.data.set(i,0),n}function H0r(){return HJ||(HJ=document.createElement("canvas"),HJ.width=1,HJ.height=1),HJ}function M5t(i,e,t){return t||(t=H0r()),t.getContext("2d").createImageData(i,e)}async function W0r(i,e){const t=window.URL.createObjectURL(i);try{const{data:r}=await zi(t,{...e,responseType:"image"});return r}catch(r){throw mo(r)?r:new qe("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function O5t(i,e){const{arrayBuffer:t,mediaType:r}=await q0r(i,e),n=r==="image/png";if(r==="image/gif"){const{isAnimatedGIF:s,parseGif:o}=await Promise.resolve().then(()=>oxn);if(s(t))return o(t,e)}if(n){const{isAnimatedPNG:s,parseApng:o}=await Promise.resolve().then(()=>hxn);if(s(t))return o(t,e)}return W0r(new Blob([t],{type:r}),e)}async function q0r(i,e){const t=lR(i);if(t?.isBase64)return{arrayBuffer:WCt(t.data),mediaType:t.mediaType};const r=await zi(i,{responseType:"array-buffer",...e});return{arrayBuffer:r.data,mediaType:r.getHeader?.("Content-Type")??""}}function Y0r(i,e,t){const{ctx:r,canvas:n}=P5t(i,t),s=r.getImageData(0,0,i.width,i.height),o=K0r(n,e);return R5t(n),{dataUrl:o,data:s}}function X0r(i,e){const{ctx:t,canvas:r}=P5t(i,e),n=t.getImageData(0,0,i.width,i.height);return R5t(r),n}function P5t(i,e){const t=J0r();e.premultipliedAlpha&&rvr(i),t.width=i.width,t.height=i.height;const r=t.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),e.flipY&&ivr(r),{ctx:r,canvas:t}}function R5t(i){i.width=0,i.height=0}function J0r(){return AMe==null&&(AMe=document.createElement("canvas")),AMe}let AMe=null;function K0r(i,e){const t=nvr[e.format],r=e.quality/100;return i.toDataURL(t,r)}function Z0r(i,e){const t=tvr(i),r=ovr[t];return{format:t,quality:uu(e??r,0,100)}}function Q0r(i,e){return e/Math.max(i[0],i[1])}function evr(i,e,t,r=0,n=0,s=i.width-r,o=i.height-n,a=!1){const{data:l}=i,{width:u,height:c,data:h}=e,p=s/u,m=o/c,v=Math.ceil(p/2),w=Math.ceil(m/2),S=i.width;for(let I=0;I=1)continue;let fe=2*ae*ae*ae-3*ae*ae+1;const be=4*(r+H+(n+re)*S);K+=fe*l[be+3],B+=fe,$+=fe*l[be],V+=fe*l[be+1],Y+=fe*l[be+2],k+=fe}}h[L]=$/k,h[L+1]=V/k,h[L+2]=Y/k,h[L+3]=K/B}return e}function tvr(i){switch(i){case"png":case"jpg":case"jpeg":return i;default:return svr}}function ivr(i){i.save(),i.globalCompositeOperation="copy",i.scale(1,-1),i.translate(0,-i.canvas.height),i.drawImage(i.canvas,0,0),i.restore()}function rvr(i){const e=i.data,t=e.length;for(let r=0;r0){const s=255/n;e[r]=e[r]*s,e[r+1]=e[r+1]*s,e[r+2]=e[r+2]*s}}}const nvr={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},Clt=98,svr="png",ovr={png:100,jpg:Clt,jpeg:Clt},D5t={flipY:!0,premultipliedAlpha:!0};async function avr(i,e){const t=await F5t(i,e),{format:r,quality:n}=Z0r(e?.format,e?.quality);return Y0r(t,{format:r,quality:n,rotation:0,disableDecorations:!1},D5t)}async function lvr(i,e){const t=await F5t(i,e);return X0r(t,D5t)}function F5t(i,e){const t=hvr(e||{},cvr(i.stage,i.size),i.size,i.padding),r=uvr(e,i.allLayerViews);return i.stage.takeScreenshot(t,r,i.backgroundColor,e?.rotation)}function uvr(i={},e){if(!i.layers)return;const t=[];return i.layers.forEach(r=>{const n=e.find(s=>s.layer.id===r.id);n?.container&&t.push(n.container)}),t}function cvr(i,e){return Math.min(4,Q0r(e,Math.min(4096,i.context.parameters.maxTextureSize)))}function hvr(i,e,t,r){i.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let n=null;i.width!=null&&i.height!=null?n=[i.width,i.height]:i.width==null&&i.height!=null?n=[i.height,i.height]:i.width!=null&&i.height==null?n=[i.width,i.width]:i.width==null&&i.height==null&&(n=null);const s=t[0]-(r.left+r.right),o=t[1]-(r.top+r.bottom);let a,l,u=i.area||{x:0,y:0,width:s,height:o};if(n){const c=s/o,h=n[0]/n[1];if(h>c){const p=u.width/h;u={x:u.x,y:Math.round(u.y+(u.height-p)/2),width:u.width,height:Math.round(p)}}else{const p=u.height*h;u={x:Math.round(u.x+(u.width-p)/2),y:u.y,width:Math.round(p),height:u.height}}}else n=[u.width,u.height];return n[0]>u.width?(a=Math.min(n[0]/u.width,e),l=n[0]/u.width/a):(a=1,l=n[0]/u.width),{cropArea:{x:Math.round((u.x+r.left)*a),y:Math.round((u.y+r.top)*a),width:Math.round(u.width*a),height:Math.round(u.height*a)},outputScale:l,resolutionScale:a}}const Elt=160;let VQ=class extends un{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Elt&&this.clear()},Elt))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};x([D()],VQ.prototype,"_timer",void 0),x([D()],VQ.prototype,"stationary",null),VQ=x([Qe("esri.views.2d.support.StationaryManager")],VQ);const dvr=i=>i.includes("Brush");let xWe=class{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),dvr(e)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${e}.Start`))}end(e){this._names.has(e)&&!this._names.get(e)&&(this._names.set(e,!0),performance.mark(`Esri.${e}.End`))}record(e){this._names.has(e)||(this._names.set(e,!0),performance.mark(`Esri.${e}`))}};function BW(i,e={}){return i.getContext("webgl2",e)||null}let MMe;function lk(){return MMe||(MMe=mvr()),MMe}let pvr=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}};function fvr(i){if(typeof WebGL2RenderingContext>"u")return null;const e=document.createElement("canvas");if(!e)return null;let t=BW(e,{failIfMajorPerformanceCaveat:!0});if(t==null&&(t=BW(e),t!=null&&(i.majorPerformanceCaveat=!0)),t==null)return t;i.available=!0,i.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),i.supportsVertexShaderSamplers=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);return r&&(i.supportsHighPrecisionFragment=r.precision>0),t}function mvr(){const i=new pvr,e=fvr(i);return e==null||(i.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,i.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,i.supportsColorBufferHalfFloat=i.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),i}function gvr(i){const e=lk();return e.available?i==="3d"&&e.majorPerformanceCaveat?new qe("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new qe("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new qe("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new qe("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function yvr(i){return i&&"nodeType"in i}function vvr(i){return i&&typeof i.render=="function"}const Ilt={component:"esri-component"};let c$=class extends un{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(e){this._set("id",e)}set node(e){const t=this._get("node");e!==t&&(e&&e.classList.add(Ilt.component),t&&t.classList.remove(Ilt.component),this._set("node",e))}castNode(e){return this.widget?.destroy(),e?typeof e=="string"||yvr(e)?(this._set("widget",null),eWe(e)):(vvr(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};x([D()],c$.prototype,"id",null),x([D()],c$.prototype,"node",null),x([So("node")],c$.prototype,"castNode",null),x([D({readOnly:!0})],c$.prototype,"widget",void 0),c$=x([Qe("esri.views.ui.Component")],c$);const gge=c$,k5t="calcite-mode-";function _vr(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function L5t(){return _vr().startsWith("dark")}function N5t(){return`${k5t}${L5t()?"dark":"light"}`}function bvr(i){wvr(i),i.classList.add(N5t())}function wvr(i){Array.from(i.classList).forEach(e=>{e.startsWith(k5t)&&i.classList.remove(e)})}const xvr={left:0,top:0,bottom:0,right:0},$5t={bottom:30,top:15,right:15,left:15},bM="esri-ui",I_={ui:bM,corner:`${bM}-corner`,innerContainer:`${bM}-inner-container`,manualContainer:`${bM}-manual-container`,cornerContainer:`${bM}-corner-container`,topLeft:`${bM}-top-left`,topRight:`${bM}-top-right`,bottomLeft:`${bM}-bottom-left`,bottomRight:`${bM}-bottom-right`};function Svr(i){return i&&!i._started&&typeof i.postMixInProperties=="function"&&typeof i.buildRendering=="function"&&typeof i.postCreate=="function"&&typeof i.startup=="function"}function Dhe(i){return i===0?"0":`${i}px`}function OMe(i){const e=typeof i=="object"&&i!==null&&Object.getPrototypeOf(i);return(e===null||e===Object.prototype)&&("component"in i||"index"in i||"position"in i)?i:null}function PMe(i,{top:e,bottom:t,left:r,right:n}){i.style.top=e,i.style.bottom=t,i.style.left=r,i.style.right=n}let xI=class extends rd.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=Am(),this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&PMe(t,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&PMe(t,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([Ki(()=>[this.view?.padding,this.container],this._applyViewPadding,js),Ki(()=>this.padding,this._applyUIPadding,js),Ki(()=>[this.container,this._locale],([e,t])=>{e&&e.setAttribute("lang",t)},js),_ze(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentMap.clear()}set container(e){const t=this._get("container");e!==t&&(e&&(e.classList.add(I_.ui),bvr(e),this._attachContainers(e)),t&&(t.classList.remove(I_.ui),PMe(t,{top:"",bottom:"",left:"",right:""}),i4t(t)),this._set("container",e))}get height(){const e=this.view?.height??0;if(e===0)return e;const t=this._getViewPadding(),{top:r,bottom:n}=t;return Math.max(e-r-n,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...$5t,...e}}get width(){const e=this.view?.width??0;if(e===0)return e;const t=this._getViewPadding(),{left:r,right:n}=t;return Math.max(e-r-n,0)}add(e,t){let r,n,s;if(Array.isArray(e))return void e.forEach(a=>this.add(a,t));const o=OMe(e);o&&({index:r,position:t,component:e,key:n}=o),t&&typeof t=="object"&&({index:r,key:n,position:t,internal:s}=t),!e||t&&!this._isValidPosition(t)||this._add(e,t,r,n,s)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(n=>this.remove(n,t));const r=this._find(e);if(r){if(this._componentMap.has(r)&&this._componentMap.get(r)?.key!==t)return;const n=this._components.indexOf(r);return r.node.parentNode?.removeChild(r.node),this._componentMap.delete(r),this._components.splice(n,1)[0]}}empty(e,t={removeInternal:!1}){if(Array.isArray(e)){for(const s of e)this.empty(s,t);return}const r=this._positionNameToContainerLookup[e??"manual"],n=Array.prototype.slice.call(r.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||t.removeInternal);for(const s of n)this.remove(s)}move(e,t){if(Array.isArray(e)&&e.forEach(o=>this.move(o,t)),!e)return;let r;const n=OMe(e)||OMe(t);if(n&&(r=n.index,t=n.position,e=n.component||e),t&&!this._isValidPosition(t))return;const s=this.remove(e);s&&this.add(s,{position:t,index:r})}find(e){if(!e)return null;const t=this._findById(e);return t&&(t.widget||t.node)}getComponents(e,t={includeInternal:!1}){return e?Array.isArray(e)?e.flatMap(r=>this._getComponentsAtPosition(r,t)):this._getComponentsAtPosition(e,t):this._components.filter(r=>t.includeInternal||!this._componentMap.get(r)?.internal).map(({widget:r,node:n})=>r??n)}getPosition(e){for(const t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,r,n,s){e instanceof gge||(e=new gge({node:e})),this._place({component:e,position:t,index:r}),this._components.push(e),this._componentMap.set(e,{key:n,internal:s})}_find(e){return e?e instanceof gge?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.view?.padding??xvr}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(I_.innerContainer,I_.cornerContainer);const t=document.createElement("div");t.classList.add(I_.innerContainer,I_.manualContainer);const r=document.createElement("div");r.classList.add(I_.topLeft,I_.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(I_.topRight,I_.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(I_.bottomLeft,I_.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(I_.bottomRight,I_.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=t;const a=nk();this._cornerNameToContainerLookup={"top-left":r,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:r,"top-trailing":a?r:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const t=e.position??"manual",{component:r,index:n}=e,s=this._positionNameToContainerLookup[t],o=n!=null&&n>-1;if(Svr(r.widget)&&r.widget.startup(),!o)return void s.appendChild(r.node);const a=Array.from(s.children);if(n===0)return void(s.firstChild?Dat(r.node,s.firstChild):s.appendChild(r.node));n>=a.length?s.appendChild(r.node):Dat(r.node,a[n])}_toPixelPosition(e){return{top:Dhe(e.top),left:Dhe(e.left),right:Dhe(e.right),bottom:Dhe(e.bottom)}}_findByComponent(e){return this._components.find(t=>t===e)??null}_findById(e){return this._components.find(({id:t})=>t===e)??null}_findByNode(e){return this._components.find(({node:t})=>t===e)??null}_getComponentsAtPosition(e,t){const r=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(r.children).map(n=>this._findByNode(n)).filter(Ga).filter(n=>t.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};x([D()],xI.prototype,"_locale",void 0),x([D()],xI.prototype,"container",null),x([D()],xI.prototype,"height",null),x([D({value:$5t})],xI.prototype,"padding",null),x([So("padding")],xI.prototype,"castPadding",null),x([D()],xI.prototype,"view",void 0),x([D()],xI.prototype,"width",null),xI=x([Qe("esri.views.ui.UI")],xI);const Tvr=xI,Cvr={handleInterceptedEvent:(i,e,t,r)=>(i.scheduleRender(),e.properties[`on${r.type}`].apply(e.properties.bind||t,[r]))},Evr={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(i,e,t)=>{e.charAt(0)==="-"?i.style.setProperty(e,t):i.style[e]=t}},Ivr=i=>({...Evr,...i}),Avr=(i,e)=>{const t=[];for(;i&&i!==e;)t.push(i),i=i.parentNode;return t},Mvr=(i,e)=>i.find(e),Alt=(i,e,t=!1)=>{let r=i;return e.forEach((n,s)=>{const o=r?.children?Mvr(r.children,a=>a.domNode===n):void 0;t&&!o&&s!==e.length-1||(r=o)}),r},Ovr=i=>{let e;const t={...Cvr,...i},r=Ivr(t),n=r.performanceLogger;let s,o=!0,a=!1;const l=[],u=[],c=(p,m,v)=>{let w;r.eventHandlerInterceptor=(I,R,L,k)=>function(B){let $;n("domEvent",B);const V=Avr(B.currentTarget,w.domNode),Y=V.some(Q=>customElements.get(Q?.tagName?.toLowerCase()));if(B.eventPhase===Event.CAPTURING_PHASE||!Y)V.reverse(),$=Alt(w.getLastRender(),V);else{const Q=B.composedPath(),re=Q.slice(Q.indexOf(B.currentTarget),Q.indexOf(w.domNode)).reverse();$=Alt(w.getLastRender(),re,!0)}let K;return $&&(K=t.handleInterceptedEvent(e,$,this,B)),n("domEventProcessed",B),K},t.postProcessProjectionOptions?.(r);const S=v();w=p(m,S,r),r.eventHandlerInterceptor=void 0,l.push(w),u.push(v),t.afterFirstVNodeRendered&&t.afterFirstVNodeRendered(w,S)};let h=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let p=0;p{s||a||(s=requestAnimationFrame(h))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),a=!0},resume:()=>{a=!1,o=!0,e.scheduleRender()},append:(p,m)=>{c(sF.append,p,m)},insertBefore:(p,m)=>{c(sF.insertBefore,p,m)},merge:(p,m)=>{c(sF.merge,p,m)},replace:(p,m)=>{c(sF.replace,p,m)},detach:p=>{for(let m=0;m/g,Cfr=/"/g,Efr=/"/g,Ifr=/&#([a-zA-Z0-9]*);?/gim,Afr=/:?/gim,Mfr=/&newline;?/gim,She=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Lat=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Nat=/u\s*r\s*l\s*\(.*/gi;function l4t(i){return i.replace(Cfr,""")}function u4t(i){return i.replace(Efr,'"')}function c4t(i){return i.replace(Ifr,function(t,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function h4t(i){return i.replace(Afr,":").replace(Mfr," ")}function d4t(i){for(var e="",t=0,r=i.length;t",r);if(n===-1)break;t=n+3}return e}function Dfr(i){var e=i.split("");return e=e.filter(function(t){var r=t.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),e.join("")}wp.whiteList=s4t();wp.getDefaultWhiteList=s4t;wp.onTag=vfr;wp.onIgnoreTag=_fr;wp.onTagAttr=bfr;wp.onIgnoreTagAttr=wfr;wp.safeAttrValue=xfr;wp.escapeHtml=a4t;wp.escapeQuote=l4t;wp.unescapeQuote=u4t;wp.escapeHtmlEntities=c4t;wp.escapeDangerHtml5Entities=h4t;wp.clearNonPrintableCharacter=d4t;wp.friendlyAttrValue=p4t;wp.escapeAttrValue=f4t;wp.onIgnoreTagStripAll=Ofr;wp.StripTagBody=Pfr;wp.stripCommentTag=Rfr;wp.stripBlankChar=Dfr;wp.cssFilter=o4t;wp.getDefaultCSSWhiteList=yfr;var pSe={},g5=tWe;function Ffr(i){var e=g5.spaceIndex(i),t;return e===-1?t=i.slice(1,-1):t=i.slice(1,e+1),t=g5.trim(t).toLowerCase(),t.slice(0,1)==="/"&&(t=t.slice(1)),t.slice(-1)==="/"&&(t=t.slice(0,-1)),t}function kfr(i){return i.slice(0,2)===""){r+=t(i.slice(n,s)),c=i.slice(s,a+1),u=Ffr(c),r+=e(s,r.length,u,c,kfr(c)),n=a+1,s=!1;continue}if(h==='"'||h==="'")for(var p=1,m=i.charAt(a-p);m.trim()===""||m==="=";){if(m==="="){o=h;continue e}m=i.charAt(a-++p)}}else if(h===o){o=!1;continue}}return n0;e--){var t=i[e];if(t!==" ")return t==="="?e:-1}}function Ufr(i){return i[0]==='"'&&i[i.length-1]==='"'||i[0]==="'"&&i[i.length-1]==="'"}function $at(i){return Ufr(i)?i.substr(1,i.length-2):i}pSe.parseTag=Lfr;pSe.parseAttr=$fr;var zfr=Xne.exports.FilterCSS,dC=wp,m4t=pSe,Vfr=m4t.parseTag,Hfr=m4t.parseAttr,dge=tWe;function The(i){return i==null}function Wfr(i){var e=dge.spaceIndex(i);if(e===-1)return{html:"",closing:i[i.length-2]==="/"};i=dge.trim(i.slice(e+1,-1));var t=i[i.length-1]==="/";return t&&(i=dge.trim(i.slice(0,-1))),{html:i,closing:t}}function qfr(i){var e={};for(var t in i)e[t]=i[t];return e}function Yfr(i){var e={};for(var t in i)Array.isArray(i[t])?e[t.toLowerCase()]=i[t].map(function(r){return r.toLowerCase()}):e[t.toLowerCase()]=i[t];return e}function g4t(i){i=qfr(i||{}),i.stripIgnoreTag&&(i.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),i.onIgnoreTag=dC.onIgnoreTagStripAll),i.whiteList||i.allowList?i.whiteList=Yfr(i.whiteList||i.allowList):i.whiteList=dC.whiteList,i.onTag=i.onTag||dC.onTag,i.onTagAttr=i.onTagAttr||dC.onTagAttr,i.onIgnoreTag=i.onIgnoreTag||dC.onIgnoreTag,i.onIgnoreTagAttr=i.onIgnoreTagAttr||dC.onIgnoreTagAttr,i.safeAttrValue=i.safeAttrValue||dC.safeAttrValue,i.escapeHtml=i.escapeHtml||dC.escapeHtml,this.options=i,i.css===!1?this.cssFilter=!1:(i.css=i.css||{},this.cssFilter=new zfr(i.css))}g4t.prototype.process=function(i){if(i=i||"",i=i.toString(),!i)return"";var e=this,t=e.options,r=t.whiteList,n=t.onTag,s=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,l=t.safeAttrValue,u=t.escapeHtml,c=e.cssFilter;t.stripBlankChar&&(i=dC.stripBlankChar(i)),t.allowCommentTag||(i=dC.stripCommentTag(i));var h=!1;t.stripIgnoreTagBody&&(h=dC.StripTagBody(t.stripIgnoreTagBody,s),s=h.onIgnoreTag);var p=Vfr(i,function(m,v,w,S,I){var R={sourcePosition:m,position:v,isClosing:I,isWhite:Object.prototype.hasOwnProperty.call(r,w)},L=n(w,S,R);if(!The(L))return L;if(R.isWhite){if(R.isClosing)return"";var k=Wfr(S),B=r[w],$=Hfr(k.html,function(V,Y){var K=dge.indexOf(B,V)!==-1,Q=o(w,V,Y,K);return The(Q)?K?(Y=l(w,V,Y,c),Y?V+'="'+Y+'"':V):(Q=a(w,V,Y,K),The(Q)?void 0:Q):Q});return S="<"+w,$&&(S+=" "+$),k.closing&&(S+=" /"),S+=">",S}else return L=s(w,S,R),The(L)?u(S):L},u);return h&&(p=h.remove(p)),p};var Xfr=g4t;(function(i,e){var t=wp,r=pSe,n=Xfr;function s(a,l){var u=new n(l);return u.process(a)}e=i.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var a in t)e[a]=t[a];for(var l in r)e[l]=r[l]}();function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=i.exports)})(O6,O6.exports);var Jfr=function(){function i(e,t){var r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(s,o,a,l){return s==="a"&&o==="href"||(s==="img"||s==="source")&&o==="src"?r.sanitizeUrl(a):O6.exports.safeAttrValue(s,o,a,l)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!t?n=e:e&&t?(n=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach(function(s){s==="whiteList"?n.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,e.whiteList||{}]):n[s]=e[s]})):(n=Object.create(this.arcgisFilterOptions),n.whiteList=this.arcgisWhiteList),this.xssFilterOptions=n,this._xssFilter=new O6.exports.FilterXSS(n)}return i.prototype.sanitize=function(e,t){switch(t===void 0&&(t={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,t);default:return t.allowUndefined&&typeof e>"u"?void 0:null}},i.prototype.sanitizeUrl=function(e,t){var r=(t??{}).isProtocolRequired,n=r===void 0?!0:r,s=this._trim(e.substring(0,e.indexOf(":"))),o=e==="/",a=/^#/.test(e),l=s&&this.allowedProtocols.indexOf(s.toLowerCase())>-1;return o||a||l?O6.exports.escapeAttrValue(e):!s&&!n?O6.exports.escapeAttrValue("https://".concat(e)):""},i.prototype.sanitizeHTMLAttribute=function(e,t,r,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,t,r,n):O6.exports.safeAttrValue(e,t,r,n)},i.prototype.validate=function(e,t){t===void 0&&(t={});var r=this.sanitize(e,t);return{isValid:e===r,sanitized:r}},i.prototype.encodeHTML=function(e){var t=this;return String(e).replace(/[&<>"'\/]/g,function(r){return t._entityMap[r]})},i.prototype.encodeAttrValue=function(e){var t=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(r,n){return t.test(r)?r:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},i.prototype._extendObjectOfArrays=function(e){var t={};return e.forEach(function(r){Object.keys(r).forEach(function(n){Array.isArray(r[n])&&Array.isArray(t[n])?t[n]=t[n].concat(r[n]):t[n]=r[n]})}),t},i.prototype._iterateOverObject=function(e,t){var r=this;t===void 0&&(t={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(a,l){var u=r.validate(l,t);return u.isValid?a.concat([l]):(n=!0,a.concat([u.sanitized]))},[]);else if(sfr(e)){var o=Object.keys(e);s=o.reduce(function(a,l){var u=e[l],c=r.validate(u,t);return c.isValid?a[l]=u:(n=!0,a[l]=c.sanitized),a},{})}else return t.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},i.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},i}();const fSe=new Map;function y4t(){fSe.clear()}function Kfr(i){return fSe.get(i)}function Zfr(i,e){fSe.set(i,e)}function pMe(i){fSe.delete(i)}const Qfr=()=>di.getLogger("esri.widgets.support.widgetUtils");function v4t(...i){const e=Ky.acquire();for(let r=0;r{const i=new Map,e=new ResizeObserver(r=>{y4t();for(const n of r)i.get(n.target)?.(n)}),t=(r,n,s)=>(i.has(r)&&Qfr().error("Already observing element",r),i.set(r,n),e.observe(r,s),wa(()=>{e.unobserve(r),i.delete(r)}));return(r,n,s)=>{let o=null;return j3([Ki(()=>typeof r=="function"?r():r,a=>{o?.remove(),a&&(o=t(a,n,s))},Ah),wa(()=>o?.remove())])}})();function nk(i){const e=i?.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function Bat(i){const e="data-node-ref";this[i.getAttribute(e)]=null}function jat(i){const e="data-node-ref";this[i.getAttribute(e)]=i}const emr=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],tmr=emr.reduce((i,e)=>(i[e]=[],i),{}),imr=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],_4t=new Jfr({whiteList:tmr,onTagAttr:(i,e,t)=>{const r=`${e}="${t}"`;if(imr.includes(e))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function rmr(i){return i==="Enter"||i===" "}const b4t="http://www.w3.org/",mSe=`${b4t}2000/svg`,w4t=`${b4t}1999/xlink`;let Gat=[],iWe=(i,e)=>{let t={};return Object.keys(i).forEach(r=>{t[r]=i[r]}),e&&Object.keys(e).forEach(r=>{t[r]=e[r]}),t},rWe=(i,e)=>i.vnodeSelector===e.vnodeSelector&&(i.properties&&e.properties?i.properties.key===e.properties.key&&i.properties.bind===e.properties.bind:!i.properties&&!e.properties),x4t=i=>{if(typeof i!="string")throw new Error("Style values must be strings")},nmr=(i,e,t)=>{if(e.vnodeSelector!==""){for(let r=t;r{let n=i[e];if(n.vnodeSelector==="")return;let s=n.properties;if(!(s&&(s.key===void 0?s.bind:s.key))){for(let o=0;o{if(i.properties){let e=i.properties.enterAnimation;e&&e(i.domNode,i.properties)}},TNe=[],CNe=!1,S4t=i=>{(i.children||[]).forEach(S4t),i.properties&&i.properties.afterRemoved&&i.properties.afterRemoved.apply(i.properties.bind||i.properties,[i.domNode])},Uat=()=>{CNe=!1,TNe.forEach(S4t),TNe.length=0},zat=i=>{TNe.push(i),CNe||(CNe=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(Uat,{timeout:16}):setTimeout(Uat,16))},Vat=i=>{let e=i.domNode;if(i.properties){let t=i.properties.exitAnimation;if(t)return e.style.pointerEvents="none",void t(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),zat(i))},i.properties)}e.parentNode&&(e.parentNode.removeChild(e),zat(i))},omr=(i,e,t)=>{if(!e)return;let r=t.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let r of e)jz(r,i,void 0,t)},T4t=(i,e,t)=>{amr(i,e.children,t),e.text&&(i.textContent=e.text),omr(i,e.properties,t),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[i,t,e.vnodeSelector,e.properties,e.children])},jz=(i,e,t,r)=>{let n,s=0,o=i.vnodeSelector,a=e.ownerDocument;if(o==="")n=i.domNode=a.createTextNode(i.text),t!==void 0?e.insertBefore(n,t):e.appendChild(n);else{for(let l=0;l<=o.length;++l){let u=o.charAt(l);if(l===o.length||u==="."||u==="#"){let c=o.charAt(s-1),h=o.slice(s,l);c==="."?n.classList.add(h):c==="#"?n.id=h:(h==="svg"&&(r=iWe(r,{namespace:mSe})),r.namespace!==void 0?n=i.domNode=a.createElementNS(r.namespace,h):(n=i.domNode=i.domNode||a.createElement(h),h==="input"&&i.properties&&i.properties.type!==void 0&&n.setAttribute("type",i.properties.type)),t!==void 0?e.insertBefore(n,t):n.parentNode!==e&&e.appendChild(n)),s=l+1}}T4t(n,i,r)}},INe=(i,e,t)=>{e&&e.split(" ").forEach(r=>{r&&i.classList.toggle(r,t)})},lmr=(i,e,t,r)=>{if(!t)return;let n=!1,s=Object.keys(t),o=s.length;for(let a=0;a{if(t===r)return!1;r=r||Gat;let s,o=(t=t||Gat).length,a=r.length,l=0,u=0,c=!1;for(;u=0){for(s=l;sl)for(s=l;s{let r=i.domNode,n=!1;if(i===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==i.text){let o=r.ownerDocument.createTextNode(e.text);return r.parentNode.replaceChild(o,r),e.domNode=o,n=!0,n}e.domNode=r}else e.vnodeSelector.lastIndexOf("svg",0)===0&&(t=iWe(t,{namespace:mSe})),i.text!==e.text&&(s=!0,e.text===void 0?r.removeChild(r.firstChild):r.textContent=e.text),e.domNode=r,s=umr(e,r,i.children,e.children,t)||s,s=lmr(r,i.properties,e.properties,t)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[r,t,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(r,e.properties,i.properties),n};let UJ=(i,e)=>({getLastRender:()=>i,update:t=>{if(i.vnodeSelector!==t.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=i;i=t,D1e(r,t,e)},domNode:i.domNode});const cmr={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(i,e,t)=>{e.charAt(0)==="-"?i.style.setProperty(e,t):i.style[e]=t}};let tU=i=>iWe(cmr,i),sF={create:(i,e)=>(e=tU(e),jz(i,document.createElement("div"),void 0,e),UJ(i,e)),append:(i,e,t)=>(t=tU(t),jz(e,i,void 0,t),UJ(e,t)),insertBefore:(i,e,t)=>(t=tU(t),jz(e,i.parentNode,i,t),UJ(e,t)),merge:(i,e,t)=>(t=tU(t),e.domNode=i,T4t(i,e,t),UJ(e,t)),replace:(i,e,t)=>(t=tU(t),jz(e,i.parentNode,i,t),i.parentNode.removeChild(i),UJ(e,t))},C4t,hmr=(i,e)=>{let t=[];for(;i&&i!==e;)t.push(i),i=i.parentNode;return t};C4t=Array.prototype.find?(i,e)=>i.find(e):(i,e)=>i.filter(e)[0];let dmr=(i,e)=>{let t=i;return e.forEach(r=>{t=t&&t.children?C4t(t.children,n=>n.domNode===r):void 0}),t},pmr=(i,e,t)=>{let r=function(n){t("domEvent",n);let s=e(),o=hmr(n.currentTarget,s.domNode);o.reverse();let a,l=dmr(s.getLastRender(),o);return i.scheduleRender(),l&&(a=l.properties[`on${n.type}`].apply(l.properties.bind||this,arguments)),t("domEventProcessed",n),a};return(n,s,o,a)=>r},ANe=i=>{let e,t,r=tU(i),n=r.performanceLogger,s=!0,o=!1,a=[],l=[],u=(h,p,m)=>{let v,w=()=>v;r.eventHandlerInterceptor=pmr(e,w,n),v=h(p,m(),r),a.push(v),l.push(m)},c=()=>{if(t=void 0,s){s=!1,n("renderStart",void 0);for(let h=0;h{t||o||(t=requestAnimationFrame(c))},stop:()=>{t&&(cancelAnimationFrame(t),t=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(h,p)=>{u(sF.append,h,p)},insertBefore:(h,p)=>{u(sF.insertBefore,h,p)},merge:(h,p)=>{u(sF.merge,h,p)},replace:(h,p)=>{u(sF.replace,h,p)},detach:h=>{for(let p=0;p0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,t=>{for(const r of t.added){const n=()=>r.render();this._callbacks.set(r,n),this._projector.append(this.surface,n)}for(const r of t.removed){const n=this._projector.detach(this._callbacks.get(r));this.surface.removeChild(n.domNode),this._callbacks.delete(r)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const t=this._hiddenSurface,r=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);r.append(t,s),r.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(r.detach(s);t.firstChild;)t.removeChild(t.firstChild);return o}overlaps(e,t){const r=this.computeBoundingRect(e),n=this.computeBoundingRect(t);return Math.max(r.left,n.left)<=Math.min(r.right,n.right)&&Math.max(r.top,n.top)<=Math.min(r.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e,t){const r=!!t?.disableDecorations;if(!this.items.some(s=>s.visible&&!(r&&s.isDecoration)))return;const n=e.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{r&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};x([D({readOnly:!0})],C4.prototype,"surface",void 0),x([D({readOnly:!0})],C4.prototype,"items",void 0),x([D({readOnly:!0})],C4.prototype,"needsRender",null),x([D({readOnly:!0})],C4.prototype,"_watchUpdatingTracking",void 0),x([D({readOnly:!0})],C4.prototype,"updating",null),C4=x([Qe("esri.views.overlay.ViewOverlay")],C4);const Hat=C4,mMe=[0,0];function fmr(i){const e=(i.ownerDocument||window.document).defaultView,t=i.getBoundingClientRect();return mMe[0]=t.left+(e?.pageXOffset??0),mMe[1]=t.top+(e?.pageYOffset??0),mMe}function Wat(i){i&&(i4t(i),i.parentNode&&i.parentNode.removeChild(i))}function mmr(i){const e=document.createElement("div");return i.appendChild(e),e}const zJ=16,Che=750,gmr=512,ymr=2,vmr=i=>{let e=class extends i{constructor(...t){super(...t),this._freqInfo={freq:zJ,time:Che},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([Ki(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),Ki(()=>this.navigating,r=>{const{surface:n}=this;n&&n.setAttribute("data-navigating",r.toString())})])}initialize(){const t=yi("mac"),r=async()=>{t&&(await fR(()=>this.ready),this.messagesCommon=await Cze("esri/t9n/common").catch(()=>{}))};r(),this.addHandles([Ki(()=>this.ui,(n,s)=>this._handleUIChange(n,s),js),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused")),_ze(r),Ki(()=>[this.surface,this.messagesCommon],()=>{t&&this.surface?.setAttribute("aria-label",this.messagesCommon?.ariaLabels?.navigationMacVoiceOver??"")})])}destroy(){this.destroyed||(this.ui=zo(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(t){const r=this._get("container"),n=eWe(t);if(n||typeof t!="string"||di.getLogger(this).error("#container",`element with id '${t}' not found`),r===n)return;if(this._stopMeasuring(),r&&(r.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(Wat(this.root),this._set("root",null)),this.userContent&&(Fat(this.userContent,r),Wat(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const s=document.createElement("div");s.className="esri-view-user-storage",Fat(n,s),n.appendChild(s),this._set("userContent",s);const o=document.createElement("div");o.className="esri-view-root",n.insertBefore(o,n.firstChild),this._set("root",o);const a=document.createElement("div");a.className="esri-view-surface",a.setAttribute("role","application"),a.tabIndex=0,o.appendChild(a),this._set("surface",a);const l=new Hat;o.appendChild(l.surface),this._set("overlay",l),this.addHandles(Ki(()=>l.needsRender,u=>{u&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=H9({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=Hc(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",n),this._startMeasuring()}get focused(){const t=document.activeElement===this.surface;return document.hasFocus()&&t}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(t,r,n){const s=this.position;return t-=s?s[0]:0,r-=s?s[1]:0,n?(n[0]=t,n[1]=r):n=[t,r],n}containerToPage(t,r,n){const s=this.position;return t+=s?s[0]:0,r+=s?s[1]:0,n?(n[0]=t,n[1]=r):n=[t,r],n}_handleUIChange(t,r){this.removeHandles("ui"),r&&r!==t&&r.destroy(),t&&(t.view=this,this.addHandles(Ki(()=>this.root,n=>{t.container=n?mmr(n):null},js),"ui")),this._set("ui",t)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const t=this._freqInfo;t.freq=zJ,t.time=Che,this.addHandles([BA(window,"resize",()=>{t.freq=zJ,t.time=Che}),H9({prepare:r=>{const n=this._measure(),s=this._freqInfo;if(s.time+=r.deltaTime,n&&(s.freq=zJ,this._get("resizing")||this._set("resizing",!0)),s.time=gmr&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const t=this.container,r=t?t.clientWidth:0,n=t?t.clientHeight:0;if(r===0||n===0)return this.suspended||this._set("suspended",!0),!1;const s=this.width,o=this.height;return r===s&&n===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",r),this._set("height",n),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:s,oldHeight:o,width:r,height:n}),!0)}_position(){const t=this.container,r=this.position,n=t&&fmr(t);return!!n&&(!r||n[0]!==r[0]||n[1]!==r[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return x([D()],e.prototype,"container",null),x([D({readOnly:!0})],e.prototype,"focused",null),x([D({readOnly:!0})],e.prototype,"height",void 0),x([D()],e.prototype,"messagesCommon",void 0),x([D({type:Hat})],e.prototype,"overlay",void 0),x([D({readOnly:!0})],e.prototype,"position",void 0),x([D({readOnly:!0})],e.prototype,"resizing",void 0),x([D({readOnly:!0})],e.prototype,"root",void 0),x([D({value:null,readOnly:!0})],e.prototype,"size",null),x([D({readOnly:!0})],e.prototype,"surface",void 0),x([D({readOnly:!0})],e.prototype,"suspended",void 0),x([D()],e.prototype,"ui",void 0),x([D({readOnly:!0})],e.prototype,"userContent",void 0),x([D({readOnly:!0})],e.prototype,"width",void 0),x([D()],e.prototype,"widthBreakpoint",void 0),e=x([Qe("esri.views.DOMContainer")],e),e};let _mr=class{constructor(e,t){this._owner=t,this._properties={},this._afterDispatchHandle=null;for(const r in e){const n=e[r],s=new cCt(n,void 0,void 0,2,2);this._properties[r]={pool:s,acquired:[]}}this._afterDispatchHandle=vHi(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const t=this._properties[e];for(const r of t.acquired)ert(r)||t.pool.release(r);t.pool.destroy(),t.pool=null,t.acquired=null}this._properties=null,this._owner=null}get(e){const t=this._owner._get(e),r=this._properties[e];let n=r.pool.acquire();for(r.acquired.push(n);n===t;)r.acquired.push(n),n=r.pool.acquire();return n}_release(){for(const e in this._properties){const t=this._properties[e];let r=0;for(const n of t.acquired)ert(n)?t.acquired[r++]=n:t.pool.release(n);t.acquired.length=r}}};const bmr=yi("mac")?"Meta":"Ctrl",wmr=new Set(["Alt","Ctrl","Meta","Shift","Primary"]),xmr=i=>wmr.has(i);let Smr=class{constructor(e,t=[]){this.eventType=e,this.keyModifiers=t}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const t=e.modifiers;for(const r of this.keyModifiers)if(!t.has(r))return!1;return!0}};const qat=()=>di.getLogger("esri.views.input.InputHandler");let Ag=class{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const t=this._incoming[e];for(const r of t)this._incomingEventMatches.push(r.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(e=>e.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?qat().error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(t=>this._handleEvent(t)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,t,r){let n;typeof t=="function"?(r=t,n=[]):n=t||[];const s=typeof e=="string"?new Smr(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=c=>{const h=this._incoming[c.match.eventType];if(h){const p=h.indexOf(c);h.splice(p,1),o(),this._manager&&this._manager.updateDependencies()}},l=new Tmr(s,r,{onPause:a,onRemove:a,onResume:c=>{const h=this._incoming[c.match.eventType];h&&!h.includes(c)&&(h.push(c),o(),this._manager&&this._manager.updateDependencies())}});let u=this._incoming[s.eventType];return u||(u=[],this._incoming[s.eventType]=u),u.push(l),o(),this._manager&&this._manager.updateDependencies(),l}registerOutgoing(e){if(this._outgoing[e])throw new Error("There is already a callback registered for this outgoing InputEvent: "+e);const t=new Cmr(e,{onEmit:(r,n,s,o)=>{this._manager?.emit(r.eventType,n,s,o)},onRemove:r=>{delete this._outgoing[r.eventType],this._manager?.updateDependencies()}});return this._outgoing[e]=t,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),t}startCapturingPointer(e){this._manager?.setPointerCapture(e,!0)}stopCapturingPointer(e){this._manager?.setPointerCapture(e,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):qat().error("This InputHandler is not registered with an InputManager")}_handleEvent(e){const t=this._incoming[e.type];if(t){for(const r of t)if(r.match.matches(e)&&(r.callback?.(e),e.shouldStopPropagation()))break}}},Tmr=class{constructor(e,t,r){this.match=e,this._callback=t,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},Cmr=class{constructor(e,t){this.eventType=e,this._removed=!1,this._handler=t}emit(e,t,r){this._removed||this._handler.onEmit(this,e,t,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},Emr=class extends Ag{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",t=>{this._update(t.data)})}_update(e){const t=e.native.pointerType==="touch"?"touch":"mouse",{x:r,y:n}=e;t===this._value&&this._x===r&&this._y===n||(this._value=t,this._x=r,this._y=n,this._onChange(t,r,n))}},Imr=class{constructor(e,t){this._observable=new pY,this._value=e,this._equalityFunction=t}get value(){return Ws(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}};function hB(i,e=YTt){return new Imr(i,e)}let Amr=class extends Ag{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=hB(!1),this._onPointerAdd=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.add(e.native.pointerId),this._update())},this._onPointerRemove=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.delete(e.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},A2=class extends un{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=bmr,this._latestPointerType="mouse",this._propertiesPool=new _mr({latestPointerLocation:Pmr},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,r=zA.INTERNAL){if(this._nameToGroup[e])return void di.getLogger(this).error("There is already an InputHandler group registered under the name `"+e+"`");if(t.length===0)return void di.getLogger(this).error("Can't register a group of zero handlers");const n={name:e,handlers:t.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,l,u,c,h)=>{this._emitInputEvent(o.priorityIndex+1,a,l,u,h,c)},setPointerCapture:(a,l)=>{this._setPointerCapture(n,o,a,l)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(r=>{r.removed=!0,r.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):di.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}isModifierKeyDown(e){return this._activeKeyModifiers&&this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const n=this._handlers[r];n.priorityIndex=r,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const n=this._handlersPriority[r];n.priorityIndex=r;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(e.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){e.add(o.eventType);for(const a of o.keyModifiers)xmr(a)||t.add(a)}n.active=s}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,r){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(n==null||n.x!==t||n.y!==r){const s=this._propertiesPool.get("latestPointerLocation");s.x=t,s.y=r,this._set("latestPointerLocation",s)}}_onEventReceived(e,t){if(e==="pointer-capture-lost"){const s=t;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,t);const r=this.test.timestamp!=null?this.test.timestamp:t.native?t.native.timestamp:void 0,n=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,r,n)}_updateKeyModifiers(e,t){if(!t)return;let r=!1;const n=()=>{if(!r){const a=new Set;this._activeKeyModifiers.forEach(l=>{a.add(l)}),this._activeKeyModifiers=a,r=!0}},s=(a,l)=>{l&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!l&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(e==="key-down"||e==="key-up"){const a=t.key;this._keyModifiers.has(a)&&s(a,e==="key-down")}const o=t.native;s("Alt",!(!o||!o.altKey)),s("Ctrl",!(!o||!o.ctrlKey)),s("Shift",!(!o||!o.shiftKey)),s("Meta",!(!o||!o.metaKey)),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new Emr((e,t,r)=>this._setLatestPointer(e,t,r)),this._multiTouchHandler=new Amr,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],zA.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,zA.INTERNAL)}_setPointerCapture(e,t,r,n){const s=e.name+"-"+t.priorityIndex,o=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,r,n){this._emitInputEvent(0,e,t,r,n)}_emitInputEvent(e,t,r,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),l=s!==void 0&&s,u={event:new Mmr(t,r,a,o||this._activeKeyModifiers,l),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(u):this._doNewPropagation(u)}_doNewPropagation(e){this._currentPropagation={events:new m1e,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:r}=e.events.pop(),n=t.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new m1e;t.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)t.push(r.events.pop());r.events=t,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const n of t.handler.incomingEventMatches){if(r.eventType!==n.eventType)continue;const s=r.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===r.keyModifiers.length!=(s.length===n.keyModifiers.length))return r.keyModifiers.length>n.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const r of e){let n=0;for(;n=0;)n++;t.splice(n,0,r)}return t}get debug(){const e=t=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},t(),this._setPointerCapture=r};return{injectEvent:(t,r)=>{e(()=>{this._onEventReceived(t,r)})},disablePointerCapture:e}}};x([D({readOnly:!0})],A2.prototype,"hasPendingInputs",null),x([D({constructOnly:!0})],A2.prototype,"eventSource",void 0),x([D({constructOnly:!0})],A2.prototype,"recognizers",void 0),x([D()],A2.prototype,"_latestPointerType",void 0),x([D()],A2.prototype,"latestPointerType",null),x([D()],A2.prototype,"multiTouchActive",null),x([D({readOnly:!0})],A2.prototype,"latestPointerLocation",void 0),x([D()],A2.prototype,"_paused",void 0),x([D({readOnly:!0})],A2.prototype,"updating",null),A2=x([Qe("esri.views.input.InputManager")],A2);let Mmr=class{constructor(e,t,r,n,s){this.type=e,this.data=t,this.timestamp=r,this.modifiers=n,this.cancelable=s,this._propagationState=y5.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=y5.STOPPED}shouldStopPropagation(){return(this._propagationState&y5.STOPPED)!=0}async(e){this._propagationState|=y5.PAUSED;const t=(r,n)=>{this._propagationState&=~y5.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw r;return r};return(typeof e=="function"?e():e).then(r=>t(r,!1),r=>t(r,!0))}shouldPausePropagation(e){return!!(this._propagationState&y5.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var y5;(function(i){i[i.NONE=0]="NONE",i[i.STOPPED=1]="STOPPED",i[i.PAUSED=2]="PAUSED"})(y5||(y5={}));const zA={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Omr=class{};const Pmr=Omr;function GE(i){return i!=null&&"open"in i&&"declaredClass"in i}function Yat(i){return i!=null&&"declaredClass"in i&&"dockOptions"in i}const Rmr=i=>{let e=class extends i{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([Ki(()=>[this.ui,this.popup],([t,r],n)=>{const s="popup",o="manual";if(n){const[a,l]=n;a&&GE(l)&&(l.view=null,Yat(l)&&a.remove(l,s))}t&&GE(r)&&(r.view=this,Yat(r)&&t.add(r,{key:s,position:o,internal:!0}))},js),this.on("click",t=>{this.popup&&this.popupEnabled&&(t.pointerType!=="mouse"||t.button===0)&&(!GE(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(GE(this.popup)?this.popup.viewModel.handleViewClick(t):t.async(async()=>{await this.setupPopup(),GE(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(t)})))},zA.WIDGET)]),fR(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{Promise.resolve().then(()=>cvt)})}destroy(){this.destroyed||this.closePopup()}async openPopup(t){if(GE(this.popup))return this.popup.open(t);try{if(await this.setupPopup(),!this.popup)return void di.getLogger(this).error(new qe("view:null-popup","Popup is null and can't be opened"));this.popup.open(t)}catch{}}closePopup(){this._popupSetupTask?.abort(),GE(this.popup)&&this.popup.close()}async fetchPopupFeatures(t,r){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(t,r),r)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!GE(this.popup))return this._popupSetupTask=pE(async t=>{const{default:r}=await Promise.resolve().then(()=>cvt);if(hn(t),!this.popup||GE(this.popup))return;const n=this.popup;delete n.open,delete n.close,this.popup=new r(n)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:t,hits:r},n){const s=[],o=[];let a=!1;const l=ZVi(n,yi("popup-view-fetch-timeout")??Fmr),u=p=>{const m=new Dmr(p);return o.push(m),s.push(m.promise),m},c=p=>{const m=o.at(-1);return m&&m.layerView===p&&!a?m:u(p)};for(const p of r)"graphic"in p?(c(p.layerView).graphics.push(p.graphic),a=!1):(s.push(p.layerView.fetchPopupFeaturesAtLocation(p.mapPoint,l)),a=!0);o.map(p=>p.resolve(l));const h=yve(s).then(p=>p.filter(m=>!!m).flat());return{pendingFeatures:s,allGraphicsPromise:h,location:t}}async _getPopupHits(t,r){const{hits:n,location:s}=await this.popupHitTest(t);hn(r);const o=[];for(const a of n)if("graphic"in a){if(this._isValidPopupGraphic(a.graphic,r)){const l=this._isValidPopupGraphicsLayerView(a.layerView)?a.layerView:void 0;o.push({graphic:a.graphic,layerView:l})}}else this._isValidPopupLocationLayerView(a.layerView)&&o.push({mapPoint:a.mapPoint,layerView:a.layerView});return{hits:o,location:s}}_isValidPopupGraphic(t,r){return t&&!!t.getEffectivePopupTemplate(r!=null&&r.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(t){return!t||(!("layer"in t)||!t.suspended)&&"fetchPopupFeaturesFromGraphics"in t}_isValidPopupLocationLayerView(t){return(!("layer"in t)||!t.suspended)&&"fetchPopupFeaturesAtLocation"in t}};return x([D({cast(t){return!t||GE(t)||typeof t=="object"&&(t.open=r=>(UF(di.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(r)),t.close=()=>(UF(di.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),t}})],e.prototype,"popup",void 0),x([D()],e.prototype,"popupEnabled",void 0),e=x([Qe("esri.views.PopupView")],e),e};let Dmr=class{constructor(e){this.layerView=e,this._resolver=ac(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(e){const{layerView:t,graphics:r,_resolver:n}=this;if(!t)return n.resolve(r),n.promise;let s;return t.fetchPopupFeaturesFromGraphics(r,e).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Fmr=5e3;let F1e=class extends Lie{constructor(e){super(e),this.addHandles(this.on("before-add",t=>{t.item!=null&&t.item.parent===this.owner&&(di.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),t.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};F1e=x([Qe("esri.support.AnalysesCollection")],F1e);let E4=class extends un{constructor(e){super(e),this.view=null,this.baseLayerViews=new dr,this.referenceLayerViews=new dr,this._loadingHandle=Ki(()=>this.view?.map?.basemap,t=>{t&&t.load().catch(()=>{})},js)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const e of this.baseLayerViews)e.destroy();this.baseLayerViews.length=0;for(const e of this.referenceLayerViews)e.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view&&this.view.suspended)return!1;const e=this.view?.map?.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(t=>t.updating)||this.referenceLayerViews.some(t=>t.updating))}};x([D({constructOnly:!0})],E4.prototype,"view",void 0),x([D({readOnly:!0})],E4.prototype,"baseLayerViews",void 0),x([D({readOnly:!0})],E4.prototype,"referenceLayerViews",void 0),x([D({readOnly:!0})],E4.prototype,"suspended",null),x([D({type:Boolean,readOnly:!0})],E4.prototype,"updating",null),E4=x([Qe("esri.views.BasemapView")],E4);function kmr(i){return"tryRecycleWith"in i}let Lmr=class{constructor(e,t,r){this.layer=e,this.view=t,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=ac(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Qh(this._controller.signal,()=>{const n=new qe("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!kmr(this.layerView))return null;const t=this.layer.type,r=this._controller.signal;for(let n=0;n(hn(this._controller.signal),s.emit("layerview-destroy",{view:l,layerView:a}),l.emit("layerview-destroy",{view:l,layerView:a}),s.emit("layerview-create",{view:l,layerView:a}),l.emit("layerview-create",{view:l,layerView:a}),a)),new Promise((u,c)=>Qh(this._controller.signal,()=>c(Oc())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:t,view:r}=this;t.emit("layerview-destroy",{view:r,layerView:e}),r.emit("layerview-destroy",{layer:t,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:t,view:r}=this;this._map=r.map;try{let n,s;if(await t.load({signal:e}),t.prefetchResources&&await t.prefetchResources({signal:e}),$mr(t))n=await t.createLayerView(r,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(t))throw new qe("layer:view-not-supported","No layerview implementation was found");const l=await this.layerViewImporter.importLayerView(t);hn(e),n="default"in l?new l.default({layer:t,view:r}):new l({layer:t,view:r})}const o=()=>{s=Hc(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Qh(e,o),hn(e);try{await n.when()}catch(l){throw o(),l}if(!this._map?.allLayers?.includes(t))return o(),void this._deferred.reject(new qe("view:no-layerview-for-layer","The layer has been removed from the map",{layer:t}));this.layerView=n,t.emit("layerview-create",{view:r,layerView:n}),r.emit("layerview-create",{layer:t,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){t.emit("layerview-create-error",{view:r,error:n}),r.emit("layerview-create-error",{layer:t,error:n}),this.done=!0,this._deferred.reject(new qe("layerview:create-error","layerview creation failed",{layer:t,error:n}))}}},M2=class extends un{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new Mb,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const t=this.view.map?.allLayers;if(t)for(const r of t)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ac(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Gk(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const t=this.view.map;if(this._map!==t&&(this.clear(),this._map=t),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,n=[],s=this.view.ready,o=l=>{if(l!=null){for(const u of l)if(u){r.add(u);const c=this._layerLayerViewInfoMap.get(u);c&&s?c.start():c||this._recyclingInfoMap.has(u)||n.push(u),"layers"in u&&u.layers&&o(u.layers)}}};for(const l of this._rootCollectionNames)o(_S(this,l));for(const[l,u]of this._layerLayerViewInfoMap)if(!r.has(l)){this._layerLayerViewInfoMap.delete(u.layer);const c=u.tryRecycle(n);c?(this.notifyChange("updating"),this._recyclingInfoMap.set(u.layer,u),c.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),this._layerLayerViewInfoMap.set(u.layer,u),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),u.destroy(),this._reschedule()})):u.destroy()}for(const[l,u]of this._recyclingInfoMap)r.has(l)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(u.layer),u.destroy());for(const l of n)this._createLayerView(l);this._refreshCollections();const a=[t?.ground?.layers,t?.basemap?.baseLayers,t?.basemap?.referenceLayers,t?.layers].filter(l=>!!l);r.forEach(l=>"layers"in l&&a.push(l.layers)),this.addHandles(a.map(l=>this._watchUpdatingTracking.addOnCollectionChange(()=>l,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ju(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),Ki(()=>{const e=this.view,t=e?.map;return[t?.basemap,t?.ground,t?.layers,e?.ready]},()=>this._reschedule(),Ah)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),uMe(this._recyclingInfoMap),uMe(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Oc()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||i2e(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const t of this._layerLayerViewInfoMap.values())t.done||++e;return e}clear(){this.destroyed||(uMe(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new qe("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,t]of this._layersToLayerViews)this._populateLayerViewsOwners(_S(this,e),_S(this,t),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,t,r){if(!e||!t)return void(t&&t.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=r,t.at(n)!==a&&t.splice(n,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const t=new Lmr(e,this.view,this.layerViewImporter);t.promise.then(()=>this._refreshCollections(),r=>{r&&(mo(r)||r.name==="cancelled:layerview-create")||di.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,t),this.view.ready&&t.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};x([D()],M2.prototype,"_workPromise",void 0),x([D({readOnly:!0})],M2.prototype,"_watchUpdatingTracking",void 0),x([D({readOnly:!0})],M2.prototype,"_layersToLayerViews",null),x([D({readOnly:!0})],M2.prototype,"_rootCollectionNames",null),x([D()],M2.prototype,"layerViewImporter",void 0),x([D()],M2.prototype,"supportsGround",void 0),x([D({readOnly:!0})],M2.prototype,"updating",null),x([D({readOnly:!0})],M2.prototype,"updatingRemaining",null),x([D({constructOnly:!0})],M2.prototype,"view",void 0),M2=x([Qe("esri.views.LayerViewManager")],M2);const Nmr=M2;function $mr(i){return"createLayerView"in i&&i.createLayerView!=null}let xw=class extends un{constructor(e){super(e),this.factor=1.5,this.offset=Vd(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};x([D({type:Number})],xw.prototype,"factor",void 0),x([D({nonNullable:!0})],xw.prototype,"offset",void 0),x([D()],xw.prototype,"position",void 0),x([D({type:Number,range:{min:0}})],xw.prototype,"size",void 0),x([D()],xw.prototype,"maskUrl",void 0),x([D()],xw.prototype,"maskEnabled",void 0),x([D()],xw.prototype,"overlayUrl",void 0),x([D()],xw.prototype,"overlayEnabled",void 0),x([D({readOnly:!0})],xw.prototype,"version",null),x([D({type:Boolean})],xw.prototype,"visible",void 0),xw=x([Qe("esri.views.Magnifier")],xw);const E4t=xw;let WV=class{constructor(e){this._observable=new pY,this._map=new Map(e)}get size(){return Ws(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return Ws(this._observable),this._map.entries()}forEach(e,t){Ws(this._observable),this._map.forEach((r,n)=>e.call(t,r,n,this),t)}get(e){return Ws(this._observable),this._map.get(e)}has(e){return Ws(this._observable),this._map.has(e)}keys(){return Ws(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return Ws(this._observable),this._map.values()}[Symbol.iterator](){return Ws(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}},lO=class extends rd.EventedAccessor{constructor(e){super(e),this._selectionMap=new WV,this._trashCan=[],this._layerEditHandles=new dr,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([Ki(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ju(()=>this.sources,"change",t=>{const r=this._selectionMap;for(const n of t.removed)r.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const e=new dr;this.view.when().then(()=>{this.view.map.allLayers.flatten(t=>"sublayers"in t&&t.sublayers?t.sublayers:null).forEach(t=>{(Ehe(t)&&!DYi(t)||oj(t))&&e.add(t)}),this._set("sources",e)})}destroy(){this._layerEditHandles.drain(Hc)}get selections(){return Array.from(this._selectionMap.entries()).map(e=>{const[t,r]=e;return{layer:t,selection:[...r.selection]}})}get count(){let e=0;for(const t of this._selectionMap.values())e+=t.selection.length;return e}get hasSelection(){return this.count>0}get sources(){return this._get("sources")}set sources(e){this._set("sources",e)}async getSelectedFeatures(e,t={},r="layerView"){const{view:n,selections:s}=this,o=(e!==void 0?s.filter(a=>e.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:l,selection:u}=a,c=oj(l)?l.parent:l;if(c==null||!Xat(c))return null;if(r==="layer")return Jat(c,u,t);const h=await n.whenLayerView(c);return Jat(h,u,t)});return(await Promise.all(o)).filter(a=>a!==null)}updateSelection(e){const t=new Map;for(const[s,o]of this._selectionMap)t.set(s,[...o.selection]);let r=!1;const n=e.current.concat(e.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ehe(o)||oj(o))&&a!==null){const l=qh(t,o,()=>[]);l.includes(a)||(l.push(a),r=!0)}}for(const s of e.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ehe(o)||oj(o))&&a!==null){const l=t.get(o),u=l?.indexOf(a);u!==void 0&&u>=0&&(l?.splice(u,1),r=!0)}}if(r){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[l,u]of t){const c=s.get(l);c!==void 0&&o.push(c),s.set(l,{selection:u}),a.push({layer:l,selection:u,...P4e(c!==void 0?c.selection:[],u)})}this._onSelectionChange(a)}}setSelection(e,t){this._setSelection(e,t)}getSelection(e){return this._selectionMap.get(e)?.selection}appendToSelection(e,t){const r=this._selectionMap.get(e),n=r!==void 0?[...r.selection]:[];for(const s of t)n.includes(s)||n.push(s);this._setSelection(e,n)}removeFromSelection(e,t){const r=this._selectionMap.get(e);if(!r)return;const n=[];for(const s of r.selection)t.includes(s)||n.push(s);this._setSelection(e,n)}toggleInSelection(e,t){const r=this._selectionMap.get(e);if(!r||r.selection.length===0)return void this._setSelection(e,t);const n=new Set(r.selection),s=new Set(t),o=cHi(n,s);this._setSelection(e,Array.from(o))}clear(){const e=this._selectionMap.values();this._trashCan.push(...e);const t=[];for(const[r,n]of this._selectionMap.entries())t.push({layer:r,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(t)}_onSelectionChange(e){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:e})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:e,view:t,_selectionMap:r,showHighlight:n}=this,s=this._vizTaskId;for(const o of e){const a=r.get(o),l=oj(o)?o.parent:o;l!=null&&Xat(l)&&t.whenLayerView(l).then(u=>{a?.highlightHandle?.remove(),a!==void 0&&n&&s===this._vizTaskId&&"highlight"in u&&typeof u.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=u.highlight(a.selection,"selection"))})}}_refreshListeners(){this._layerEditHandles.drain(Hc);for(const e of this.sources){const t=oj(e)?e.parent:e;if(t!=null&&Ehe(t)){const r=t.on("edits",n=>{this._handleEditChanges(n,e)});this._layerEditHandles.push(r)}}}_handleEditChanges(e,t){if(e.deletedFeatures!==void 0&&e.deletedFeatures.length>0&&this._selectionMap.has(t)){const r=e.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(Ga);this.removeFromSelection(t,r)}}_setSelection(e,t){if(!this.sources.includes(e))throw new Error(`Cannot set selection on layer ${e.title} because it is not in 'sources'`);const r=this._selectionMap.get(e);if(r===void 0||!jmr(r,{selection:t})){r!==void 0&&this._trashCan.push(r),this._selectionMap.set(e,{selection:[...t]});const n={layer:e,selection:[...t],...P4e(r!==void 0?r.selection:[],t)};this._onSelectionChange([n])}}};x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"selections",null),x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"count",null),x([D({constructOnly:!0,nonNullable:!0})],lO.prototype,"view",void 0),x([D({readOnly:!0,nonNullable:!0})],lO.prototype,"hasSelection",null),x([D()],lO.prototype,"showHighlight",void 0),x([D()],lO.prototype,"sources",null),lO=x([Qe("esri.views.SelectionManager")],lO);const Ehe=i=>i.createQuery!==void 0&&i.on!==void 0,Bmr=i=>i.layer!==void 0,Xat=i=>i?.when!==void 0,jmr=(i,e)=>{if(i==null&&e==null)return!0;if(i!=null&&e==null||i==null&&e!=null)return!1;if(i!=null&&e!=null&&i.selection!=null&&e.selection!=null){const t=[...i.selection],r=[...e.selection];if(t.length!==r.length)return!1;t.sort(),r.sort();for(let n=0;n{let r;if(Bmr(i)){const n=i;r=n===void 0?null:await n.queryFeatures(new Kn({...t,objectIds:e})).then(s=>({data:s,layer:i.layer}))}else{const n=i;r=n===void 0?null:await n.queryFeatures(new Kn({...t,objectIds:e})).then(s=>({data:s,layer:n}))}return r},Gmr=lO;let NQ=class extends xs(un){constructor(e){super(e),this.accentColor=new jr([255,127,0]),this.textColor=new jr([255,255,255])}};x([D({type:jr,nonNullable:!0})],NQ.prototype,"accentColor",void 0),x([D({type:jr,nonNullable:!0})],NQ.prototype,"textColor",void 0),NQ=x([Qe("esri.views.Theme")],NQ);const MNe=NQ;var Kat;(function(i){i[i.Left=0]="Left",i[i.Middle=1]="Middle",i[i.Right=2]="Right"})(Kat||(Kat={}));const I4t=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],A4t={};function M4t(i){return!!A4t[i]}function Umr(i){for(const e of i)if(!M4t(e))return!1;return!0}I4t.forEach(i=>{A4t[i]=!0});let zmr=class{constructor(e){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this._handlers.forEach(({handler:t,priority:r},n)=>this.inputManager?.installHandlers(n,[t],r))}disconnect(){this.inputManager&&this._handlers.forEach((e,t)=>this.inputManager?.uninstallHandlers(t)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,t,r,n){const s=Array.isArray(e)?e:e.split(",");if(!Umr(s))return s.some(M4t)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(t)?a=t:(o=t,a=[]),typeof r=="function"?o=r:n=r,n=n??zA.DEFAULT;const l=this._createUniqueGroupName(),u=new Vmr(this.view,s,a,o);this._handlers.set(l,{handler:u,priority:n});for(const c of s){const h=this._handlerCounts.get(c)||0;this._handlerCounts.set(c,h+1)}return this.inputManager&&this.inputManager.installHandlers(l,[u],n),wa(()=>this._removeHandler(l,s))}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,t){if(this._handlers.has(e)){this._handlers.delete(e);for(const r of t){const n=this._handlerCounts.get(r);n===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",r):n===1?this._handlerCounts.delete(r):this._handlerCounts.set(r,n-1)}}this.inputManager&&this.inputManager.uninstallHandlers(e)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Vmr=class extends Ag{constructor(e,t,r,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of t)switch(s){case"click":this.registerIncoming("click",r,o=>n(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",r,o=>n(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",r,o=>n(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",r,o=>n(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",r,o=>n(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",r,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",r,o=>n(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",r,o=>n(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",r,o=>n(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",r,o=>n(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",r,o=>n(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",r,o=>n(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",r,o=>n(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",r,o=>n(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",r,o=>n(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",r,o=>{n(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",r,o=>{n(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",r,o=>{n(this._wrapBlur(o))})}}_wrapFocus(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:t=>e.async(t),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:u,timestamp:c}=e;return{type:"click",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,screenPoint:Vd(s,o),mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:h=>e.async(h),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,{cancelable:u,timestamp:c}=e;return{type:"double-click",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:c,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:u,stopPropagation:()=>e.stopPropagation(),async:h=>e.async(h),preventDefault:()=>e.preventDefault()}}_wrapImmediateClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,u=a.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-click",pointerId:u,pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:h,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a,eventId:l}=e.data,u=a.pointerId,{cancelable:c,timestamp:h}=e;return{type:"immediate-double-click",pointerId:u,pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:h,mapPoint:this._getMapPoint(s,o),eventId:l,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:p=>e.async(p),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:t,button:r,buttons:n,x:s,y:o,native:a}=e.data,{cancelable:l,timestamp:u}=e;return{type:"hold",pointerType:t,button:r,buttons:n,x:s,y:o,native:a,timestamp:u,mapPoint:this._getMapPoint(s,o),cancelable:l,stopPropagation:()=>e.stopPropagation(),async:c=>e.async(c),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,t){return this.view.toMap(Vd(e,t),{exclude:[]})}_wrapDrag(e){const t=e.data,{x:r,y:n}=t.center,{action:s,pointerType:o,button:a}=t;if(s==="start"&&(this._latestDragStart=t),!this._latestDragStart)return;const l=t.pointer.native,u=t.buttons,{cancelable:c,timestamp:h}=e,p={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:r,y:n,origin:p,pointerType:o,button:a,buttons:u,radius:t.radius,angle:yb(t.angle),native:l,timestamp:h,cancelable:c,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:t,repeat:r,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:t,repeat:r,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:a=>e.async(a),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:t,native:r}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:t,native:r,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,t){const{x:r,y:n,button:s,buttons:o,native:a,eventId:l}=e.data,u=a.pointerId,c=a.pointerType,{cancelable:h,timestamp:p}=e;return{type:t,x:r,y:n,pointerId:u,pointerType:c,button:s,buttons:o,native:a,timestamp:p,eventId:l,cancelable:h,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:t,y:r,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:a}=e.data.startEvent,l=e.data.startEvent.native.pointerId,u=e.data.startEvent.native.pointerType,c=e.data.action,h={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:p,timestamp:m}=e;return{type:"pointer-drag",x:t,y:r,pointerId:l,pointerType:u,button:a,buttons:n,action:c,origin:h,native:s,timestamp:m,eventId:o,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:v=>e.async(v),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:t,data:r,timestamp:n}=e,{x:s,y:o,deltaY:a,native:l}=r;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:l,timestamp:n,cancelable:t,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:t,state:r,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:a,axes:l}=r;return{type:"gamepad",device:n,timestamp:o,action:t,buttons:a,axes:l,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}};var Jne,Zat,Qat;(function(i){i[i.USER=0]="USER",i[i.MANAGER=1]="MANAGER"})(Jne||(Jne={})),function(i){i[i.None=0]="None",i[i.Unfocused=1]="Unfocused",i[i.Focused=2]="Focused",i[i.Unselected=4]="Unselected",i[i.Selected=8]="Selected",i[i.All=15]="All"}(Zat||(Zat={})),function(i){i[i.None=0]="None",i[i.Custom1=16]="Custom1",i[i.Custom2=32]="Custom2",i[i.Custom3=64]="Custom3",i[i.Custom4=128]="Custom4",i[i.Custom5=256]="Custom5",i[i.Custom6=512]="Custom6",i[i.Custom7=1024]="Custom7",i[i.Custom8=2048]="Custom8",i[i.Custom9=4096]="Custom9",i[i.Custom10=8192]="Custom10",i[i.Custom11=16384]="Custom11",i[i.Custom12=32768]="Custom12",i[i.All=65520]="All"}(Qat||(Qat={}));function Hmr(i){return[i.on("before-add",e=>{const t=e.item;if(t==null||i.includes(t))return di.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();t.onAdd()}),i.on("after-remove",e=>{const t=e.item;t.active&&(t.view.activeTool=null),t.destroy()})]}function ONe(i){return i.visible&&i.getEditableFlag!=null&&i.getEditableFlag(Jne.USER)&&i.getEditableFlag(Jne.MANAGER)}function bI(i){return Vd(i.x,i.y)}function O4t(i,e){const t=(i instanceof HTMLElement?i:i.surface)?.getBoundingClientRect();return t?Vd(e.clientX-t.left,e.clientY-t.top):Vd(0,0)}function P4t(i,e){return e instanceof Event?O4t(i,e):bI(e)}function R4t(i){if(i instanceof Event)return!0;if(typeof i=="object"&&"type"in i)switch(i.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let Wmr=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(e,t){const r=()=>e.stopPropagation();switch(e.type){case"pointer-move":elt(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),e.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!tlt(e))break;const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,e,t),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(e)&&!o.grabbing&&(this._grabbedManipulators.set(e.pointerId,{manipulator:o,tool:a,start:n,pointerType:e.pointerType}),this._grabbedManipulators.size===1&&t.activeTool==null&&(this._revertToNullActiveTool=!0,t.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:e.pointerType,screenPoint:n}),r());break}case"pointer-up":this._draggedManipulators.has(e.pointerId)||this._handlePointerEnd(e,t);break;case"pointer-drag":{if(!tlt(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=bI(e);a.x=uu(a.x,0,t.view.width),a.y=uu(a.y,0,t.view.height);const l=n.start,u=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,u?s.events.emit("drag",{action:"update",start:l,screenPoint:a}):s.events.emit("drag",{action:"start",start:l,screenPoint:a,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{tool:o,manipulator:s,start:l}));break;case"end":s.dragging=!1,u&&s.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,t)}r();break}case"immediate-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool);if(qmr(e)||t.forEachTool(u=>{if((s==null||s.tool!==u||u.automaticManipulatorSelection)&&u.manipulators){let c=!1;u.manipulators.forEach(({manipulator:h})=>{h.selected&&(h.selected=!1,c=!0)}),c&&u.onManipulatorSelectionChanged&&u.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const l=e.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:r}),gMe(o,r);break}case"click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit(e.type,{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a}),r();break}case"double-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:r}),gMe(o,r);break}case"immediate-double-click":{const n=bI(e),s=this._intersect(n,e.pointerType,t.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=e.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:a,stopPropagation:r}),gMe(o,r);break}}this._onFocusChange(t.forEachTool)}_releaseManipulatorBeforeDragging(e,t,r){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:bI(t)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(r.setActiveTool)}_handlePointerEnd(e,t){const r=this._grabbedManipulators.get(e.pointerId)?.manipulator;r!=null&&r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:bI(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorRelease(t.setActiveTool))}_cursorFromMap(e){let t=null;return i2e(e,({manipulator:r})=>!(r==null||!r.interactive)&&(r.grabbing&&r.grabCursor?(t=r.grabCursor,!0):!!r.cursor&&(t=r.cursor,!0))),t}_onFocusChange(e){this._updateCursor(),this._updateFocusedManipulatorTools(e)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(e){const t=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:n})=>{t.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{r.add(n)}),e(n=>{n.hasGrabbedManipulators=t.has(n),n.hasHoveredManipulators=r.has(n);const s=this._grabbedManipulators.values(),o=die(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(e,{forEachTool:t,setActiveTool:r},n=!0,s){const o=(a,l)=>a===e&&(s==null||s===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:u},c)=>{o(a,l)&&(this._grabbedManipulators.delete(c),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:u}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._draggedManipulators.delete(u),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._hoveredManipulators.delete(u),l.hovering=!1)}),this._afterManipulatorRelease(r),this._onFocusChange(t)}_intersect(e,t,r){let n=null;return r(s=>{if(s.manipulators==null||!ONe(s))return!1;const o=s.manipulators.intersect(e,t);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((t,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Vd(t.x,t.y),r,t.pointerType,e)})}handleHoverEvent(e,t){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!elt(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(bI(e),e.pointerId,e.pointerType,t)}_updateHoveredStateForPointerAtScreenPosition(e,t,r,n){let s=this._intersect(e,r,n);const o=this._hoveredManipulators.get(t)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(t,s)):this._hoveredManipulators.delete(t),this._onFocusChange(n))}_afterManipulatorRelease(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function elt(i){return i==="mouse"}function tlt(i){return i.pointerType!=="mouse"||i.button===0}function qmr(i){return!!i.native.shiftKey}function gMe(i,e){i?.consumesClicks&&e()}const ilt="attached",yMe="tools",rlt=1e3;let wI=class extends un{constructor(e){super(e),this._updatingHandles=new Mb,this._clock=hY,this._manipulatorState=new Wmr,this.tools=new dr,this.cursor=null,this._interacting=!1,this._interactingTimeout=rlt,this._interactingTimeoutHandle=null,this._forEachTool=t=>{for(const r of this.tools.items)if(t(r))return}}initialize(){this.addHandles([this.view.on(I4t,e=>{this._handleInputEvent(e)},zA.TOOL),...Hmr(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(e=>e.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(e!=null&&!this.view.ready)return void di.getLogger(this).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const t=this.activeTool;this._set("activeTool",e),t?.deactivate(),e?.activate(),this._removeIncompleteTools(e);for(const r of this.tools){this._updateToolEditableFlag(r);const n=ONe(r);this.activeTool!=null&&n||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(e=>e.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=Hc(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([Ki(()=>{const{state:e}=this.view;return"camera"in e&&e.camera},()=>this._forEachManipulator(e=>e.onViewChange())),this.view.elevationProvider?.on("elevation-change",e=>this._forEachManipulator(t=>t.onElevationChange(e)))],ilt):this.addHandles(Ki(()=>this.view.extent,()=>this._forEachManipulator(e=>e.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ilt),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(e){this._forEachTool(t=>{t.manipulators&&t.manipulators.forEach(({manipulator:r})=>e(r,t))})}_handleInputEvent(e){let t=!1;const r={...e,stopPropagation:()=>{t=!0,e.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(n=>{!t&&n.visible&&n.handleInputEvent(r)}),!t&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),t||this.activeTool==null||this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor(),e.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(yMe),this._forEachTool(e=>{if(e instanceof un){const t=Ki(()=>[e.cursor,e.visible,e.editable],()=>{ONe(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(t,yMe)}e.manipulators&&this.addHandles([e.manipulators.on("after-remove",t=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,t.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],yMe)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag?.(Jne.MANAGER,this.activeTool==null||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;e==null&&this._forEachTool(t=>!(t.cursor==null||!t.visible)&&(e=t.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(t=>(e==null||t!==e)&&!t.created&&t.removeIncompleteOnCancel).forEach(t=>{this.tools.remove(t)})}get test(){const e=this;return{setClock:t=>this._clock=t,set interactingTimeoutEnabled(t){e._interactingTimeout=t?rlt:0},get interactingTimeoutEnabled(){return e._interactingTimeout!==0}}}};x([D({constructOnly:!0,nonNullable:!0})],wI.prototype,"view",void 0),x([D({value:null})],wI.prototype,"activeTool",null),x([D({readOnly:!0,type:dr})],wI.prototype,"tools",void 0),x([D({readOnly:!0})],wI.prototype,"cursor",void 0),x([D({readOnly:!0})],wI.prototype,"updating",null),x([D()],wI.prototype,"_interacting",void 0),x([D({readOnly:!0})],wI.prototype,"interacting",null),wI=x([Qe("esri.views.ToolViewManager")],wI);let iU=class extends un{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":Ymr.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexghn).then(e=>PNe=e)),await vMe,hn(i)}async function $4t(i,e,t,r){if(!i)return null;const n=i.spatialReference;return qx()||_0(n,e)?Wc(i,e):PNe?PNe.projectGeometry(i,e,t,r):(await Promise.race([igr(r),FS(r)]),$4t(i,e,t,r))}let Zc=class extends un{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=zF(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const e=this.map?.(),t=[];return this.priorityCollection!=null&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:t}=this._allLayers;let r=null;for(const s of e){const o=this._getSupportedSpatialReferences(s);if(o.length>0){const a=this._narrowDownSpatialReferenceCandidates(r,o);a!=null&&(r=a)}if(r!=null&&r.length===1)break}if(t&&(r==null||r.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(r);return{spatialReference:n!=null?n.spatialReference:null,viewingMode:n!=null?n.viewingMode:null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:t}=this._collectLayers([{parent:this.map?.()?.basemap,layers:this.map?.()?.basemap?.baseLayers},{layers:this.map?.()?.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const r=e[0].tileInfo;return{tileInfo:r&&r.spatialReference.equals(this.spatialReference)?r:null,updating:!1}}return{updating:t}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:t}=this._allLayers;for(const r of e)if(egr(r)){const n=Zmr(r);if(n)return{heightModelInfo:n,vcsWkid:r.spatialReference?.vcsWkid,latestVcsWkid:r.spatialReference?.latestVcsWkid,updating:!1}}return{updating:t}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,t=e.updating,r=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(n.fullExtent!=null?[n.fullExtent]:[]),o=this.requiresExtentInSpatialReference?null:s[0],a=s.find(l=>l.spatialReference.equals(this.spatialReference))??o;if(a)return{candidates:[{extent:a,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const l of s)r.push({extent:l,layer:n})}return{candidates:r,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(e),n=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=zF(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:n.clone(),task:pE(async s=>{try{const o=await $4t(r.extent,n,"portalItem"in r.layer?r.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(xg(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(e==null)return t;const r=[],n=(s,o)=>s!=null?o!=null?s===o&&s:s:o;for(const s of e)for(const o of t){if(!s.spatialReference.equals(o.spatialReference))continue;const a=n(s.viewingMode,o.viewingMode);if(a!==!1){r.push({spatialReference:s.spatialReference,viewingMode:a});break}}return r.length>0?r:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return e==null||e.length<1?t!=null?{spatialReference:t,viewingMode:null}:null:(t!=null&&e.length>1&&e.some(({spatialReference:r})=>r.equals(t))&&(e=e.filter(({spatialReference:r})=>r.equals(t))),e.length>1&&e.some(({viewingMode:r})=>r!==vR.Local)&&(e=e.filter(({viewingMode:r})=>r!==vR.Local)),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(t.length===0)return[];const r=[];for(const n of t){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(s!=null){const o=s.constraints!=null?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:l}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||r.push({spatialReference:a,viewingMode:l})}}return r}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:r})=>t.equals(r.spatialReference))||e[0]}_collectLayers(e){if(this._loadMaybe(this.map?.())!=="loaded")return{layers:[],updating:!0};const t=new rgr;for(const r of e)if(this._collectCollection(r,t),t.preloading===this.sourcePreloadCount)break;return{layers:t.layers,updating:t.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const r of e.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(t=>{mo(t)||console.log(t)}),"loading"):e.loadStatus:"loaded"}};x([D()],Zc.prototype,"required",void 0),x([D({constructOnly:!0})],Zc.prototype,"map",void 0),x([D({constructOnly:!0})],Zc.prototype,"getSpatialReferenceSupport",void 0),x([D()],Zc.prototype,"defaultSpatialReference",void 0),x([D()],Zc.prototype,"userSpatialReference",void 0),x([D()],Zc.prototype,"sourcePreloadCount",void 0),x([D()],Zc.prototype,"priorityCollection",void 0),x([D()],Zc.prototype,"requiresExtentInSpatialReference",void 0),x([D()],Zc.prototype,"suspended",void 0),x([D({readOnly:!0})],Zc.prototype,"ready",null),x([D({readOnly:!0})],Zc.prototype,"heightModelInfoReady",null),x([D({readOnly:!0})],Zc.prototype,"spatialReference",null),x([D({readOnly:!0})],Zc.prototype,"extent",null),x([D({readOnly:!0})],Zc.prototype,"heightModelInfo",null),x([D({readOnly:!0})],Zc.prototype,"vcsWkid",null),x([D({readOnly:!0})],Zc.prototype,"latestVcsWkid",null),x([D({readOnly:!0})],Zc.prototype,"viewingMode",null),x([D({readOnly:!0})],Zc.prototype,"tileInfo",null),x([D({readOnly:!0})],Zc.prototype,"mapCollections",null),x([D({readOnly:!0})],Zc.prototype,"_allLayers",null),x([D({readOnly:!0})],Zc.prototype,"_spatialReferenceTask",null),x([D({readOnly:!0})],Zc.prototype,"_tileInfoTask",null),x([D({readOnly:!0})],Zc.prototype,"_heightModelInfoTask",null),x([D({readOnly:!0})],Zc.prototype,"_extentCandidatesTask",null),x([D()],Zc.prototype,"_extentTask",null),x([D()],Zc.prototype,"_projectExtentTask",void 0),Zc=x([Qe("esri.views.support.DefaultsFromMap")],Zc);let rgr=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var BQ;let io=BQ=class extends rd.EventedMixin(U3(un)){constructor(i){super(i),this._userSpatialReference=null,this._cursor=null,this.handles=new cY,this.updatingHandles=new Mb,this.allLayerViews=new _E({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:sgr}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new bx,this.analyses=new F1e,this.typeSpecificPreconditionsReady=!0,this.layerViews=new dr,this.magnifier=new E4t,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new Kmr,this.navigation=new F4t,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new zmr(this),this.persistableViewModels=new dr,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(Ki(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,BQ.views.add(this)):(this._lockedSpatialReference=null,BQ.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(r){return void queueMicrotask(()=>{console.error("View._startup failed",r),this.fatalError=new qe("startup-error",null,r)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Kl))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,fR(()=>this.ready)))),this.basemapView=new E4({view:this}),this.layerViewManager=new Nmr({view:this,layerViewImporter:{importLayerView:i=>this.importLayerView(i),hasLayerViewModule:i=>this.hasLayerViewModule(i)},supportsGround:this.supportsGround}),this.toolViewManager=new wI({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Gmr({view:this}),this.addHandles([Ki(()=>this.initialExtentRequired,i=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:i},Ah),Ki(()=>this.ready,i=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=i,this.defaultsFromMap.userSpatialReference=i?this.spatialReference:this._userSpatialReference)},Kl),Ki(()=>this._userSpatialReference,i=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=i)},Ah)])}_setupSpatialReferenceLogger(){let i=null;this.addHandles([Ki(()=>this.defaultsFromMap?.ready,e=>{const t=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&t){if(i!=null)return;const r=wa(()=>i=zF(i));i=pE(async n=>{try{await jk(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{i=null}di.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(r,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(BQ.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=zo(this.graphics),this.analyses=zo(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),zo(this.analysisViewManager),this.toolViewManager=zo(this.toolViewManager),this.layerViewManager=zo(this.layerViewManager),this.selectionManager=zo(this.selectionManager),this.basemapView=zo(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(i=>i.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=zo(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return di.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(i){this.toolViewManager&&(this.toolViewManager.activeTool=i)}get animation(){return this._get("animation")}set animation(i){this._set("animation",i)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new Zc({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:i=>this.getSpatialReferenceSupport(i),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(i){this._set("extent",i)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||ef.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(i){i!==this._get("map")&&(i?.destroyed&&(di.getLogger(this).warn("#map","The provided map is already destroyed",{map:i}),i=null),ef.isLoadable(i)&&i.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",i))}get spatialReference(){const i=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(i&&this.defaultsFromMap?.required?.heightModelInfo){const e=i.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return i}set spatialReference(i){const e=!Ya(i,this._get("spatialReference"));this._set("_userSpatialReference",i),e&&(this._set("spatialReference",i),this._spatialReferenceChanged(i))}_spatialReferenceChanged(i){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??RS}set timeZone(i){const e=new Set(["etc/utc","etc/gmt","gmt"]),t=new Set(Intl.supportedValuesOf("timeZone").map(r=>r.toLowerCase()));this._userTimeZone=i,i===RS||i===YF||e.has(i.toLowerCase())||t.has(i.toLowerCase())||di.getLogger(this).warn("#timeZone",`the parsed value '${i}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(i){this._cursor=i,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new MNe}whenLayerView(i){return this.layerViewManager?.whenLayerView(i)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}importLayerView(i){throw new qe("importLayerView() not implemented")}hasLayerViewModule(i){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(i){return this.getSpatialReferenceSupport({spatialReference:i})!=null}when(i,e){return this.isResolved()&&!this.ready&&di.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(i,e)}forceReadyCycle(){this.ready&&(v0(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(i){this.toolViewManager.tools.add(i),this.activeTool=i}tryFatalErrorRecovery(){this.fatalError=null}};io.views=new dr,x([D()],io.prototype,"_userSpatialReference",void 0),x([D()],io.prototype,"activeTool",null),x([D({readOnly:!0})],io.prototype,"allLayerViews",void 0),x([D()],io.prototype,"groundView",void 0),x([D()],io.prototype,"animation",null),x([D()],io.prototype,"basemapView",void 0),x([D()],io.prototype,"center",null),x([D({readOnly:!0})],io.prototype,"_defaultsFromMapSettings",null),x([D()],io.prototype,"defaultsFromMap",null),x([D()],io.prototype,"fatalError",void 0),x([D({type:hr})],io.prototype,"extent",null),x([D(SLe(bx,"graphics"))],io.prototype,"graphics",void 0),x([D(SLe(F1e,"analyses"))],io.prototype,"analyses",void 0),x([D({readOnly:!0,type:DY})],io.prototype,"heightModelInfo",null),x([D({readOnly:!0})],io.prototype,"interacting",null),x([D({readOnly:!0})],io.prototype,"navigating",null),x([D({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],io.prototype,"preconditionsReady",null),x([D({readOnly:!0})],io.prototype,"typeSpecificPreconditionsReady",void 0),x([D({type:dr,readOnly:!0})],io.prototype,"layerViews",void 0),x([D()],io.prototype,"resolution",null),x([D({type:E4t})],io.prototype,"magnifier",void 0),x([D({value:null,type:ZDt})],io.prototype,"map",null),x([D()],io.prototype,"padding",void 0),x([D({readOnly:!0})],io.prototype,"ready",void 0),x([D({type:Xi})],io.prototype,"spatialReference",null),x([D()],io.prototype,"spatialReferenceWarningDelay",void 0),x([D()],io.prototype,"stationary",null),x([D({readOnly:!0})],io.prototype,"supportsGround",void 0),x([D({type:Eg})],io.prototype,"timeExtent",void 0),x([D({type:String,nonNullable:!0})],io.prototype,"timeZone",null),x([D()],io.prototype,"tools",null),x([D()],io.prototype,"toolViewManager",void 0),x([D({readOnly:!0})],io.prototype,"type",void 0),x([D({type:Number})],io.prototype,"scale",void 0),x([D({readOnly:!0})],io.prototype,"updating",void 0),x([D({readOnly:!0})],io.prototype,"initialExtentRequired",void 0),x([D({readOnly:!0})],io.prototype,"initialExtent",null),x([D()],io.prototype,"cursor",null),x([D({readOnly:!0})],io.prototype,"input",void 0),x([D({type:F4t,nonNullable:!0})],io.prototype,"navigation",void 0),x([D()],io.prototype,"layerViewManager",void 0),x([D()],io.prototype,"analysisViewManager",void 0),x([D()],io.prototype,"selectionManager",void 0),x([D()],io.prototype,"width",void 0),x([D()],io.prototype,"height",void 0),x([D({readOnly:!0})],io.prototype,"resizing",void 0),x([D({value:null,readOnly:!0})],io.prototype,"size",null),x([D({readOnly:!0})],io.prototype,"suspended",void 0),x([D({readOnly:!0})],io.prototype,"viewEvents",void 0),x([D({readOnly:!0})],io.prototype,"persistableViewModels",void 0),x([D()],io.prototype,"_isValid",void 0),x([D()],io.prototype,"_readyCycleForced",void 0),x([D()],io.prototype,"_lockedSpatialReference",void 0),x([D()],io.prototype,"_userTimeZone",void 0),x([D()],io.prototype,"_lockedTimeZone",void 0),x([D({type:MNe})],io.prototype,"theme",void 0),x([D({readOnly:!0,type:MNe})],io.prototype,"effectiveTheme",null),io=BQ=x([Qe("esri.views.View")],io);const ngr=io;function sgr(i){return i.layerViews}let A4=class extends Rve{constructor(e){super(e),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ac(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new qe("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(e,t){t||(t=qp(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",t)}};x([D({readOnly:!0})],A4.prototype,"done",null),x([D({readOnly:!0,type:String})],A4.prototype,"state",void 0),x([D()],A4.prototype,"target",void 0),A4=x([Qe("esri.views.ViewAnimation")],A4),function(i){i.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(A4||(A4={}));const RNe=A4;function j5(i,e,t,r){const n=3*i,s=3*(t-i)-n,o=1-n-s,a=3*e,l=3*(r-e)-a,u=1-a-l;function c(v){return((o*v+s)*v+n)*v}function h(v){return((u*v+l)*v+a)*v}function p(v){return(3*o*v+2*s)*v+n}function m(v,w){let S,I,R,L,k,B;for(R=v,B=0;B<8;B++){if(L=c(R)-v,Math.abs(L)I)return I;for(;SL?S=R:I=R,R=.5*(I-S)+S}return R}return function(v,w=1e-6){return h(m(v,w))}}const ogr=/^cubic-bezier\((.*)\)/,Y2={};function agr(i){let e=Y2[i]||null;if(!e){const t=ogr.exec(i);if(t){const r=t[1].split(",").map(n=>parseFloat(n.trim()));r.length!==4||r.some(n=>isNaN(n))||(e=j5.apply(j5,r))}}return e}Y2.ease=j5(.25,.1,.25,1),Y2.linear=j5(0,0,1,1),Y2.easeIn=Y2["ease-in"]=j5(.42,0,1,1),Y2.easeOut=Y2["ease-out"]=j5(0,0,.58,1),Y2.easeInOut=Y2["ease-in-out"]=j5(.42,0,.58,1);function lgr(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i}function sWe(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=0,i[5]=0,i}function B4t(i,e,t,r,n,s,o){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i[4]=s,i[5]=o,i}function oWe(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],a=e[5];let l=t*s-r*n;return l?(l=1/l,i[0]=s*l,i[1]=-r*l,i[2]=-n*l,i[3]=t*l,i[4]=(n*a-s*o)*l,i[5]=(r*o-t*a)*l,i):null}function ugr(i){return i[0]*i[3]-i[1]*i[2]}function FW(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1],h=t[2],p=t[3],m=t[4],v=t[5];return i[0]=r*u+s*c,i[1]=n*u+o*c,i[2]=r*h+s*p,i[3]=n*h+o*p,i[4]=r*m+s*v+a,i[5]=n*m+o*v+l,i}function sk(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=Math.sin(t),c=Math.cos(t);return i[0]=r*c+s*u,i[1]=n*c+o*u,i[2]=r*-u+s*c,i[3]=n*-u+o*c,i[4]=a,i[5]=l,i}function gSe(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1];return i[0]=r*u,i[1]=n*u,i[2]=s*c,i[3]=o*c,i[4]=a,i[5]=l,i}function VA(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],u=t[0],c=t[1];return i[0]=r,i[1]=n,i[2]=s,i[3]=o,i[4]=r*u+s*c+a,i[5]=n*u+o*c+l,i}function Nae(i,e){const t=Math.sin(e),r=Math.cos(e);return i[0]=r,i[1]=t,i[2]=-t,i[3]=r,i[4]=0,i[5]=0,i}function j4t(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=e[1],i[4]=0,i[5]=0,i}function aWe(i,e){return i[0]=1,i[1]=0,i[2]=0,i[3]=1,i[4]=e[0],i[5]=e[1],i}function cgr(i){return"mat2d("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+", "+i[4]+", "+i[5]+")"}function hgr(i){return Math.sqrt(i[0]**2+i[1]**2+i[2]**2+i[3]**2+i[4]**2+i[5]**2+1)}function dgr(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i}function G4t(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i}function pgr(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i}function fgr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i[2]=e[2]+t[2]*r,i[3]=e[3]+t[3]*r,i[4]=e[4]+t[4]*r,i[5]=e[5]+t[5]*r,i}function mgr(i,e){return i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]}function ggr(i,e){const t=i[0],r=i[1],n=i[2],s=i[3],o=i[4],a=i[5],l=e[0],u=e[1],c=e[2],h=e[3],p=e[4],m=e[5],v=c_();return Math.abs(t-l)<=v*Math.max(1,Math.abs(t),Math.abs(l))&&Math.abs(r-u)<=v*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=v*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(s-h)<=v*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-p)<=v*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-m)<=v*Math.max(1,Math.abs(a),Math.abs(m))}const ygr=FW,vgr=G4t;Object.freeze(Object.defineProperty({__proto__:null,add:dgr,copy:lgr,determinant:ugr,equals:ggr,exactEquals:mgr,frob:hgr,fromRotation:Nae,fromScaling:j4t,fromTranslation:aWe,identity:sWe,invert:oWe,mul:ygr,multiply:FW,multiplyScalar:pgr,multiplyScalarAndAdd:fgr,rotate:sk,scale:gSe,set:B4t,str:cgr,sub:vgr,subtract:G4t,translate:VA},Symbol.toStringTag,{value:"Module"}));function HA(){return[1,0,0,1,0,0]}function _gr(i){return[i[0],i[1],i[2],i[3],i[4],i[5]]}function bgr(i,e,t,r,n,s){return[i,e,t,r,n,s]}function wgr(i,e){return new Float64Array(i,e,6)}const xgr=HA();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:xgr,clone:_gr,create:HA,createView:wgr,fromValues:bgr},Symbol.toStringTag,{value:"Module"}));function kW(i,e){return i[0]=e[0],i[1]=e[1],i}function dl(i,e,t){return i[0]=e,i[1]=t,i}function lWe(i,e,t){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i}function Kne(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i}function U4t(i,e,t){return i[0]=e[0]*t[0],i[1]=e[1]*t[1],i}function z4t(i,e,t){return i[0]=e[0]/t[0],i[1]=e[1]/t[1],i}function Sgr(i,e){return i[0]=Math.ceil(e[0]),i[1]=Math.ceil(e[1]),i}function Tgr(i,e){return i[0]=Math.floor(e[0]),i[1]=Math.floor(e[1]),i}function Cgr(i,e,t){return i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i}function Egr(i,e,t){return i[0]=Math.max(e[0],t[0]),i[1]=Math.max(e[1],t[1]),i}function Igr(i,e){return i[0]=Math.round(e[0]),i[1]=Math.round(e[1]),i}function $ae(i,e,t){return i[0]=e[0]*t,i[1]=e[1]*t,i}function Agr(i,e,t,r){return i[0]=e[0]+t[0]*r,i[1]=e[1]+t[1]*r,i}function ySe(i,e){const t=e[0]-i[0],r=e[1]-i[1];return Math.sqrt(t*t+r*r)}function k1e(i,e){const t=e[0]-i[0],r=e[1]-i[1];return t*t+r*r}function L1e(i){const e=i[0],t=i[1];return Math.sqrt(e*e+t*t)}function V4t(i){const e=i[0],t=i[1];return e*e+t*t}function H4t(i,e){return i[0]=-e[0],i[1]=-e[1],i}function Mgr(i,e){return i[0]=1/e[0],i[1]=1/e[1],i}function DNe(i,e){const t=e[0],r=e[1];let n=t*t+r*r;return n>0&&(n=1/Math.sqrt(n),i[0]=e[0]*n,i[1]=e[1]*n),i}function W4t(i,e){return i[0]*e[0]+i[1]*e[1]}function q4t(i,e,t){const r=e[0]*t[1]-e[1]*t[0];return i[0]=i[1]=0,i[2]=r,i}function FNe(i,e,t,r){const n=e[0],s=e[1];return i[0]=n+r*(t[0]-n),i[1]=s+r*(t[1]-s),i}function Ogr(i,e){e=e||1;const t=2*sae()*Math.PI;return i[0]=Math.cos(t)*e,i[1]=Math.sin(t)*e,i}function Pgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[2]*n,i[1]=t[1]*r+t[3]*n,i}function yf(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[2]*n+t[4],i[1]=t[1]*r+t[3]*n+t[5],i}function Rgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[3]*n+t[6],i[1]=t[1]*r+t[4]*n+t[7],i}function Dgr(i,e,t){const r=e[0],n=e[1];return i[0]=t[0]*r+t[4]*n+t[12],i[1]=t[1]*r+t[5]*n+t[13],i}function m8(i,e,t,r){const n=e[0]-t[0],s=e[1]-t[1],o=Math.sin(r),a=Math.cos(r);return i[0]=n*a-s*o+t[0],i[1]=n*o+s*a+t[1],i}function Fgr(i,e){const t=i[0],r=i[1],n=e[0],s=e[1];let o=t*t+r*r;o>0&&(o=1/Math.sqrt(o));let a=n*n+s*s;a>0&&(a=1/Math.sqrt(a));const l=(t*n+r*s)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function kgr(i){return"vec2("+i[0]+", "+i[1]+")"}function Lgr(i,e){return i[0]===e[0]&&i[1]===e[1]}function Ngr(i,e){const t=i[0],r=i[1],n=e[0],s=e[1],o=c_();return Math.abs(t-n)<=o*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(r-s)<=o*Math.max(1,Math.abs(r),Math.abs(s))}function $gr(i,e,t,r,n){let s=e[0]-t[0],o=e[1]-t[1];const a=(r[0]*s+r[1]*o)*(n-1);return s=r[0]*a,o=r[1]*a,i[0]=e[0]+s,i[1]=e[1]+o,i}const Bgr=L1e,uWe=Kne,jgr=U4t,Ggr=z4t,Ugr=ySe,zgr=k1e,Vgr=V4t;Object.freeze(Object.defineProperty({__proto__:null,add:lWe,angle:Fgr,ceil:Sgr,copy:kW,cross:q4t,dist:Ugr,distance:ySe,div:Ggr,divide:z4t,dot:W4t,equals:Ngr,exactEquals:Lgr,floor:Tgr,inverse:Mgr,len:Bgr,length:L1e,lerp:FNe,max:Egr,min:Cgr,mul:jgr,multiply:U4t,negate:H4t,normalize:DNe,projectAndScale:$gr,random:Ogr,rotate:m8,round:Igr,scale:$ae,scaleAndAdd:Agr,set:dl,sqrDist:zgr,sqrLen:Vgr,squaredDistance:k1e,squaredLength:V4t,str:kgr,sub:uWe,subtract:Kne,transformMat2:Pgr,transformMat2d:yf,transformMat3:Rgr,transformMat4:Dgr},Symbol.toStringTag,{value:"Module"}));function Ja(){return[0,0]}function Hgr(i){return[i[0],i[1]]}function MA(i,e){return[i,e]}function Wgr(i,e=Ja()){const t=Math.min(2,i.length);for(let r=0;r"attributes"in c),l=i.some(c=>!c.geometry);let u=i;if(a&&l&&e&&e.allLayerViews){const c=new Map;for(const v of i){const w=v.layer,S=c.get(w)||[],I=v.attributes[w.objectIdField];I!=null&&S.push(I),c.set(w,S)}const h=[];c.forEach((v,w)=>{const S=e.allLayerViews.find(I=>I.layer.id===w.id);if(S&&"queryFeatures"in S){const I=w.createQuery();I.objectIds=v,I.returnGeometry=!0,h.push(S.queryFeatures(I))}});const p=await Promise.all(h),m=[];for(const v of p)if(v&&v.features&&v.features.length)for(const w of v.features)w.geometry!=null&&m.push(w.geometry);u=m}for(const c of u)r=await jQ(c,e,t,r);return r}if(Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number")n=new $i(i);else if(i instanceof Nr)n=i;else if("geometry"in i){if(i.geometry)n=i.geometry;else if(i.layer){const a=i.layer,l=e.allLayerViews.find(u=>u.layer.id===a.id);if(l&&"queryFeatures"in l){const u=a.createQuery();u.objectIds=[i.attributes[a.objectIdField]],u.returnGeometry=!0,n=(await l.queryFeatures(u))?.features?.[0]?.geometry}}}if(n==null)return null;switch(n.type){case"point":s=new hr({xmin:n.x,ymin:n.y,xmax:n.x,ymax:n.y,spatialReference:n.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":s=elr(n);break;default:s=n.extent}if(!s)return null;qx()||_0(s.spatialReference,t)||await FS();const o=Wc(s,t);return o?r=r?r.union(o):o:null}function Kgr(i){if(i&&(!Array.isArray(i)||typeof i[0]!="number")&&(typeof i=="object"||Array.isArray(i)&&typeof i[0]=="object")){if("layer"in i&&i.layer?.minScale!=null&&i.layer.maxScale!=null){const e=i.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(i)&&i.length&&i.every(e=>"layer"in e)){let e=0,t=0;for(const r of i){const n=r.layer;n?.minScale&&n.maxScale&&(e=n.minScalet?n.maxScale:t)}return e&&t?{min:e,max:t}:null}}}function _Me(i,e){return Ya(e5t(i),e)?i:Wc(i,e)}async function Zgr(i,e){if(!i||!e)return new Ab({targetGeometry:new $i,scale:0,rotation:0});let t=e.spatialReference;const{constraints:r,padding:n,viewpoint:s,size:o}=e,a=[n?o[0]-n.left-n.right:o[0],n?o[1]-n.top-n.bottom:o[1]];let l=null;i instanceof Ab?l=i:i.viewpoint?l=i.viewpoint:i.target&&i.target.declaredClass==="esri.Viewpoint"&&(l=i.target);let u=null;l?.targetGeometry?u=l.targetGeometry:i instanceof hr?u=i:(i||i&&("center"in i||"extent"in i||"target"in i))&&(u=await jQ(i.center,e,t)||await jQ(i.extent,e,t)||await jQ(i.target,e,t)||await jQ(i,e,t)),!u&&s?.targetGeometry?u=s.targetGeometry:!u&&e.extent&&(u=e.extent),t||(t=e5t(e.spatialReference||e.extent||u)),qx()||Ya(u.spatialReference,t)||_0(u.spatialReference,t)||await FS();const c=_Me(u,t),h="center"in c?c.center:c;e.pickClosestTarget!==!1&&h.type==="point"&&s.targetGeometry?.type==="point"&&(h.x=rRt(h.x,s.targetGeometry.x,h.spatialReference));let p=0;l?p=l.rotation:i.hasOwnProperty("rotation")?p=i.rotation:s&&(p=s.rotation);let m=0;if(l?.targetGeometry!=null&&l.targetGeometry.type==="point")m=l.scale;else if("scale"in i&&i.scale)m=i.scale;else if("zoom"in i&&i.zoom!==-1&&r&&r.effectiveLODs)m=r.zoomToScale(i.zoom);else if(Array.isArray(u)||u.type==="point"||u.type==="extent"&&u.width===0&&u.height===0){const S=_Me(e.extent,t);m=S!=null?qV(S,a,p):e.extent?qV(e.extent,a,p):s.scale}else m=qV(_Me(u.extent,t),a,p);const v=Kgr(i.target??i);v&&(v.min&&v.minm&&(m=v.max));let w=new Ab({targetGeometry:h,scale:m,rotation:p});return r&&(w=r.fit(w),r.constrainByGeometry(w),r.rotationEnabled||(w.rotation=s.rotation)),w}function ME(i,e){const t=i.targetGeometry,r=e.targetGeometry;return t.x=r.x,t.y=r.y,t.spatialReference=r.spatialReference,i.scale=e.scale,i.rotation=e.rotation,i}function i5t(i,e,t){return t?dl(i,.5*(e[0]-t.right+t.left),.5*(e[1]-t.bottom+t.top)):$ae(i,e,.5)}const Qgr=function(){const i=Ja();return function(e,t,r){const n=t.targetGeometry;hWe(i,n);const s=.5*GY(t);return e.xmin=i[0]-s*r[0],e.ymin=i[1]-s*r[1],e.xmax=i[0]+s*r[0],e.ymax=i[1]+s*r[1],e.spatialReference=n.spatialReference,e}}();function eyr(i,e,t,r,n){return kNe(i,e,t.center),i.scale=qV(t,r),n?.constraints?.constrain(i),i}function tyr(i,e,t,r){return mWe(i,e,t,r),oWe(i,i)}const dWe=function(){const i=Ja();return function(e,t,r){return uWe(e,syr(e,t),i5t(i,t,r))}}(),iyr=function(){const i=HA(),e=Ja();return function(t,r,n,s){const o=GY(r),a=pWe(r);return dl(e,o,o),j4t(i,e),sk(i,i,a),VA(i,i,dWe(e,n,s)),VA(i,i,[0,s.top-s.bottom]),dl(t,i[4],i[5])}}();function GY(i){return i.scale*ryr(i.targetGeometry)}function ryr(i){return i!=null&&Cm(i.spatialReference)?1/(t5t(i.spatialReference)*Q4t*Z4t):1}function pWe(i){return eB(i.rotation)||0}function nyr(i){return Cm(i)?t5t(i)*Q4t*Z4t:1}function syr(i,e){return $ae(i,e,.5)}const fWe=function(){const i=Ja(),e=Ja(),t=Ja();return function(r,n,s,o,a,l){return H4t(i,n),$ae(e,s,.5*l),dl(t,1/o*l,-1/o*l),aWe(r,e),a&&sk(r,r,a),gSe(r,r,t),VA(r,r,i),r}}(),mWe=function(){const i=Ja();return function(e,t,r,n){const s=GY(t),o=pWe(t);return hWe(i,t.targetGeometry),fWe(e,i,r,s,o,n)}}(),oyr=function(){const i=Ja();return function(e,t,r,n){const s=GY(t);return hWe(i,t.targetGeometry),fWe(e,i,r,s,0,n)}}();function gWe(i){const e=Zp(i);return e?e.valid[1]-e.valid[0]:0}function ayr(i,e){return Math.round(gWe(i)/e)}const r5t=function(){const i=Ja(),e=Ja(),t=[0,0,0];return function(r,n,s){Kne(i,r,n),DNe(i,i),Kne(e,r,s),DNe(e,e),q4t(t,i,e);let o=Math.acos(W4t(i,e)/(L1e(i)*L1e(e)))*Jgr;return t[2]<0&&(o=-o),isNaN(o)&&(o=0),o}}(),lyr=function(){const i=Ja();return function(e,t,r,n){const s=e.targetGeometry;return ME(e,t),iyr(i,t,r,n),s.x+=i[0],s.y+=i[1],e}}(),kNe=function(i,e,t){ME(i,e);const r=i.targetGeometry;return r.x=t.x,r.y=t.y,r.spatialReference=t.spatialReference,i},uyr=function(){const i=Ja();return function(e,t,r,n,s){s||(s="center"),uWe(i,r,n),$ae(i,i,.5);const o=i[0],a=i[1];switch(s){case"center":dl(i,0,0);break;case"left":dl(i,-o,0);break;case"top":dl(i,0,a);break;case"right":dl(i,o,0);break;case"bottom":dl(i,0,-a);break;case"top-left":dl(i,-o,a);break;case"bottom-left":dl(i,-o,-a);break;case"top-right":dl(i,o,a);break;case"bottom-right":dl(i,o,-a)}return ok(e,t,i),e}}();function LNe(i,e,t){return ME(i,e),i.rotation+=t,i}function cyr(i,e,t){return ME(i,e),i.rotation=t,i}const hyr=function(){const i=Ja();return function(e,t,r,n,s){return ME(e,t),isNaN(r)||r===0||(n5t(i,n,t,s),e.scale=t.scale*r,s5t(i,i,e,s),ok(e,e,dl(i,i[0]-n[0],n[1]-i[1]))),e}}();function slt(i,e,t){return ME(i,e),i.scale=t,i}const yWe=function(){const i=Ja();return function(e,t,r,n,s,o){return ME(e,t),isNaN(r)||r===0||(n5t(i,s,t,o),e.scale=t.scale*r,e.rotation+=n,s5t(i,i,e,o),ok(e,e,dl(i,i[0]-s[0],s[1]-i[1]))),e}}(),olt=function(){const i=Ja(),e=Ja();return function(t,r,n,s,o,a,l){return dWe(e,a,l),lWe(i,o,e),s?yWe(t,r,n,s,i,a):hyr(t,r,n,i,a)}}(),n5t=function(){const i=HA();return function(e,t,r,n){return yf(e,t,tyr(i,r,n,1))}}(),s5t=function(){const i=HA();return function(e,t,r,n){return yf(e,t,mWe(i,r,n,1))}}(),ok=function(){const i=Ja(),e=HA();return function(t,r,n){ME(t,r);const s=GY(r),o=t.targetGeometry;return Nae(e,pWe(r)),gSe(e,e,MA(s,s)),yf(i,n,e),o.x+=i[0],o.y+=i[1],t}}();let dyr=class{constructor(e,t,r,n){const s=e.targetGeometry,o=t.targetGeometry;n?typeof n=="string"&&(n=agr(n)||Y2.ease):n=Y2.ease,this.easing=n,this.duration=r,this.sCenterX=s.x,this.sCenterY=s.y,this.sScale=e.scale,this.sRotation=e.rotation,this.tCenterX=o.x,this.tCenterY=o.y,this.tScale=t.scale,this.tRotation=t.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(e,t){const r=this.easing(t);let n,s,o,a;t>=1?(n=this.tCenterX,s=this.tCenterY,o=this.tRotation,a=this.tScale):(n=this.sCenterX+r*this.dCenterX,s=this.sCenterY+r*this.dCenterY,o=this.sRotation+r*this.dRotation,a=this.sScale+r*this.dScale),e.targetGeometry.x=n,e.targetGeometry.y=s,e.scale=a,e.rotation=o}},M4=class extends un{constructor(e){super(e),this._animation=null,this.updateFunction=null,this.duration=200,this.transition=null,this.easing=Y2.ease,this.view=null,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this._updateTask=H9({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Hc(this._updateTask)}get animation(){return this._animation}set animation(e){this._animation=e,this.view&&(this.view.animation=e)}animate(e,t,r){this.stop();const n=this.viewpoint;ME(n,t),this.transition=new dyr(this.viewpoint,e.target,r?.duration||this.duration,r?.easing||this.easing);const s=()=>{this.animation===e&&this._updateTask&&(e.state==="finished"&&(this.transition?.applyRatio(this.viewpoint,1),this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return e.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=e,e}animateContinous(e,t){this.stop(),this.updateFunction=t,this.viewpoint=e;const r=new RNe({target:e.clone()}),n=()=>{this.animation===r&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return r.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=r,r}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(e){const t=this.animation;if(t&&t.state!==RNe.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,e.deltaTime);else{const r=this.transition,n=(performance.now()-this._startTime)/r.duration,s=n>=1;r.applyRatio(this.viewpoint,n),s&&this.animation?.finish()}this.view?.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};x([D()],M4.prototype,"duration",void 0),x([D()],M4.prototype,"transition",void 0),x([D()],M4.prototype,"easing",void 0),x([D()],M4.prototype,"view",void 0),x([D()],M4.prototype,"viewpoint",void 0),M4=x([Qe("esri.views.2d.AnimationManager")],M4);const pyr=M4;let fyr=class{constructor(e){this.view=e,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:t,graphicsView:r,labelManager:n,state:{id:s}}=this.view;t.forEach(this._updateLayerView,this),n!=null&&(n.lastUpdateId!==s&&(n.viewChange(),n.lastUpdateId=s),n.updateRequested&&n.processUpdate(this._updateParameters)),r!=null&&(r.lastUpdateId!==s&&(r.viewChange(),r.lastUpdateId=s),r.updateRequested&&r.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle?.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const e=this.view;this.stationary=e.stationary,this._updateParameters={state:e.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:e.renderingOptions},this._stationaryHandle=Ki(()=>e.stationary,t=>{this.stationary=t,this.requestFrame()}),this._frameTaskHandle=H9(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle?.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(e){if(!e.attached)return void this.requestUpdate();const t=this.view.state,r=e.lastUpdateId;r!=null&&(this.stationary||e.moving)||(e.moving=!0,e.moveStart()),r!==t.id&&e.viewChange(),this.stationary&&e.moving&&(e.moving=!1,e.moveEnd()),e.lastUpdateId=t.id,e.updateRequested&&e.processUpdate(this._updateParameters),"layerViews"in e&&e.layerViews?.forEach(this._updateLayerView,this)}},fge=class extends un{constructor(e){super(e),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(e,t){if(!e)return void di.getLogger(this).error("#goTo()","target cannot be null or undefined");const r=new RNe;this.view.animation=r,await fR(()=>this.view.ready,t);const n={animate:!0,...t},{extent:s,spatialReference:o,size:a,viewpoint:l,constraints:u,padding:c,allLayerViews:h}=this.view,p=Zgr(e,{extent:s,spatialReference:o,size:a,viewpoint:l,constraints:u,padding:c,allLayerViews:h,pickClosestTarget:t?.pickClosestTarget??!0});return r?.update(p),this._gotoTask={},n.animate?this._gotoAnimated(p,n):this._gotoImmediate(p,n)}_gotoImmediate(e,t){const r=this._gotoTask,n=this.view.animation,s=e.then(o=>{if(hn(t),r!==this._gotoTask)throw new qe("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(r,n,s,t)}_gotoAnimated(e,t){const r=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=e.then(o=>{if(hn(t),r!==this._gotoTask)throw new qe("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,t),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,n,s,t)}_cancellableGoTo(e,t,r,n){const s=()=>e===this._gotoTask;return Jg(r,n).finally(()=>{s()&&(t.done||t.stop())})}};x([D({constructOnly:!0})],fge.prototype,"view",void 0),fge=x([Qe("esri.views.2d.GoToManager")],fge);function Gh(){return Promise.all([Promise.resolve().then(()=>kqt),Promise.resolve().then(()=>ZYt)])}const VJ=()=>Gh().then(()=>Promise.resolve().then(()=>Oyn)),mj=()=>Gh().then(()=>Promise.resolve().then(()=>j0n)),alt={"base-dynamic":()=>Gh().then(()=>Promise.resolve().then(()=>W0n)),"base-tile":VJ,"bing-maps":VJ,catalog:()=>Gh().then(()=>Promise.resolve().then(()=>Y0n)),"catalog-dynamic-group":()=>Gh().then(()=>Promise.resolve().then(()=>J0n)),"catalog-footprint":()=>Gh().then(()=>Promise.resolve().then(()=>Z0n)),csv:mj,"geo-rss":()=>Gh().then(()=>Promise.resolve().then(()=>evn)),feature:mj,geojson:mj,graphics:()=>Gh().then(()=>Promise.resolve().then(()=>ivn)),group:()=>Gh().then(()=>Promise.resolve().then(()=>svn)),imagery:()=>Gh().then(()=>Promise.resolve().then(()=>Wvn)),"imagery-tile":()=>Gh().then(()=>Promise.resolve().then(()=>R1t)),kml:()=>Gh().then(()=>Promise.resolve().then(()=>X_n)),"knowledge-graph":()=>Gh().then(()=>Promise.resolve().then(()=>F1t)),"link-chart":()=>Gh().then(()=>Promise.resolve().then(()=>F1t)),"knowledge-graph-sublayer":mj,"map-image":()=>Gh().then(()=>Promise.resolve().then(()=>Q_n)),"map-notes":()=>Gh().then(()=>Promise.resolve().then(()=>tbn)),media:()=>Gh().then(()=>Promise.resolve().then(()=>lbn)),"ogc-feature":()=>Gh().then(()=>Promise.resolve().then(()=>hbn)),"open-street-map":VJ,"oriented-imagery":mj,route:()=>Gh().then(()=>Promise.resolve().then(()=>Ibn)),stream:()=>Gh().then(()=>Promise.resolve().then(()=>Obn)),"subtype-group":()=>Gh().then(()=>Promise.resolve().then(()=>Rbn)),tile:VJ,"vector-tile":()=>Gh().then(()=>Promise.resolve().then(()=>bwn)),video:()=>Gh().then(()=>Promise.resolve().then(()=>xwn)),wcs:()=>Gh().then(()=>Promise.resolve().then(()=>R1t)),"web-tile":VJ,wfs:mj,wms:()=>Gh().then(()=>Promise.resolve().then(()=>Cwn)),wmts:()=>Gh().then(()=>Promise.resolve().then(()=>Mwn)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function myr(i){const e=i.declaredClass?i.declaredClass.slice(i.declaredClass.lastIndexOf(".")+1):"Unknown",t=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new qe(`${t}:view-not-supported`,`${e} is not supported in 2D`)}const llt={hasLayerViewModule:i=>alt[i.type]!=null,importLayerView:i=>{const e=alt[i.type];if(e==null)throw myr(i);return e(i)}};function gyr(i,e){const{spatialReference:t}=e,r=[e.x,e.y];let n=Number.POSITIVE_INFINITY,s=0,o=0;const a=[0,0],l=i.type==="extent"?[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]:i.rings;for(const u of l)for(let c=0;cc.clone()),e.sort((c,h)=>h.scale-c.scale),e.forEach((c,h)=>c.level=h);for(const c of e)!l&&t>0&&t>=c.scale&&(o=c.level,l=!0),!u&&r>0&&r>=c.scale&&(a=i?i.level:-1,u=!0),i=c;n===-1&&(n=t===0?0:o),s===-1&&(s=r===0?e.length-1:a),n=Math.max(n,0),n=Math.min(n,e.length-1),s=Math.max(s,0),s=Math.min(s,e.length-1),n>s&&([n,s]=[s,n]),t=e[n].scale,r=e[s].scale,e.splice(0,n),e.splice(s-n+1,e.length),e.forEach((c,h)=>{this._lodByScale[c.scale]=c,this._scales[h]=c.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",n),this._set("effectiveMaxZoom",s),this._set("effectiveMinScale",t),this._set("effectiveMaxScale",r)}constrain(i,e){if(e&&i.scale===e.scale)return i;const t=this.effectiveMinScale,r=this.effectiveMaxScale,n=i.targetGeometry,s=e&&e.targetGeometry,o=r!==0&&i.scalet;if(o||a){const l=a?t:r;if(e&&s){const u=(l-e.scale)/(i.scale-e.scale);n.x=s.x+(n.x-s.x)*u,n.y=s.y+(n.y-s.y)*u}i.scale=l}return this.snapToZoom&&this.effectiveLODs&&(i.scale=this._getClosestScale(i.scale)),i}fit(i){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(i,null);const e=this.scaleToZoom(i.scale),t=Math.abs(e-Math.floor(e));return i.scale=this.zoomToScale(t>.99?Math.round(e):Math.floor(e)),i}zoomToScale(i){if(!this.effectiveLODs)return 0;i-=this.effectiveMinZoom,i=Math.max(0,i);const e=this._scales;if(i<=0)return e[0];if(i>=e.length)return e[e.length-1];const t=Math.round(i-.5),r=Math.round(i);return e[r]+(r-i)*(e[t]-e[r])}scaleToZoom(i){if(!this.effectiveLODs)return-1;const e=this._scales;let t,r;if(i>=e[0])return this.effectiveMinZoom;if(i<=e[e.length-1])return this.effectiveMaxZoom;for(let n=0;ni&&rMath.abs(t-i)<=Math.abs(e-i)?t:e,this._scales[0])),this._lodByScale[i].scale}};x([D({readOnly:!0})],B_.prototype,"effectiveLODs",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMinZoom",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMaxZoom",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMinScale",void 0),x([D({readOnly:!0})],B_.prototype,"effectiveMaxScale",void 0),x([D()],B_.prototype,"lods",void 0),x([D()],B_.prototype,"minZoom",void 0),x([D()],B_.prototype,"maxZoom",void 0),x([D()],B_.prototype,"minScale",void 0),x([D()],B_.prototype,"maxScale",void 0),x([D()],B_.prototype,"snapToZoom",void 0),B_=BNe=x([Qe("esri.views.2d.constraints.ZoomConstraint")],B_);const a5t=B_,yyr={base:null,key:"type",typeMap:{extent:hr,polygon:$s}};let Mp=class extends un{constructor(e){super(e),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new dr}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(e){e?this._set("geometry",e):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const e=this._get("_geometry");return e&&this.geometry===e.geometry&&this.view?.constraintsInfo.spatialReference===e.spatialReference?e:new P6({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new o5t({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),t=this.lods||this.view?.constraintsInfo.lods,r=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return e&&e.lods===t&&e.minZoom===r&&e.maxZoom===n&&e.minScale===s&&e.maxScale===o&&e.snapToZoom===a?e:new a5t({lods:t,minZoom:r,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(e){const t=this.effectiveMaxScale;return t===0||e>=t}canZoomOutTo(e){const t=this.effectiveMinScale;return t===0||e<=t}constrain(e,t){return this._zoom.constrain(e,t),this._rotation.constrain(e,t),this._geometry.constrain(e,t),this.customConstraints.forEach(r=>r.constrain(e,t)),e}constrainByGeometry(e){return this._geometry.constrain(e),this.customConstraints.forEach(t=>t.applyPanConstraint?.(e)),e}fit(e){return this._zoom.fit(e)}zoomToScale(e){return this._zoom.zoomToScale(e)}scaleToZoom(e){return this._zoom.scaleToZoom(e)}snapScale(e){return this._zoom.snapToClosestScale(e)}snapToNextScale(e){return this._zoom.snapToNextScale(e)}snapToPreviousScale(e){return this._zoom.snapToPreviousScale(e)}};x([D({readOnly:!0})],Mp.prototype,"effectiveLODs",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMinScale",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMaxScale",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMinZoom",null),x([D({readOnly:!0})],Mp.prototype,"effectiveMaxZoom",null),x([D({types:yyr,value:null})],Mp.prototype,"geometry",null),x([D({type:[hs]})],Mp.prototype,"lods",void 0),x([D()],Mp.prototype,"minScale",void 0),x([D()],Mp.prototype,"maxScale",void 0),x([D()],Mp.prototype,"minZoom",void 0),x([D()],Mp.prototype,"maxZoom",void 0),x([D()],Mp.prototype,"rotationEnabled",void 0),x([D()],Mp.prototype,"snapToZoom",void 0),x([D({type:dr})],Mp.prototype,"customConstraints",void 0),x([D()],Mp.prototype,"view",void 0),x([D({readOnly:!0})],Mp.prototype,"version",null),x([D({type:P6,readOnly:!0})],Mp.prototype,"_geometry",null),x([D({type:o5t})],Mp.prototype,"_rotation",null),x([D({readOnly:!0,type:a5t})],Mp.prototype,"_zoom",null),Mp=x([Qe("esri.views.2d.MapViewConstraints")],Mp);const l5t=Mp;let Tc=class l${static getId(e,t,r,n){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${n}`}constructor(e,t,r,n){this.set(e,t,r,n)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,n){this.set(e,t,r,n)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}containsChild(e){const t=e.level-this.level;return t>0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new l$(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,n){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[s,o,a,l]=e.split("/");this.level=parseFloat(s),this.row=parseFloat(o),this.col=parseFloat(a),this.world=parseFloat(l)}else this.level=+e,this.row=+t,this.col=+r,this.world=+n||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new l$(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(e,t){return`${this.level}/${this.row+t}/${this.col+e}/${this.world}`}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,n=this.world;return[new l$(e,t,r,n),new l$(e,t,r+1,n),new l$(e,t+1,r,n),new l$(e,t+1,r+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};Tc.pool=new G3(Tc,null,null,25,50);function wD(i,e){return[i,e]}function zL(i,e,t){return i[0]=e,i[1]=t,i}function vyr(i,e,t,r,n){return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}const mT=new Tc("0/0/0/0");let _yr=class u5t{static create(e,t,r=null){const n=Zp(e.spatialReference),s=t.origin||wD(e.origin.x,e.origin.y),o=wD(e.size[0]*t.resolution,e.size[1]*t.resolution),a=wD(-1/0,-1/0),l=wD(1/0,1/0),u=wD(1/0,1/0);r!=null&&(zL(a,Math.max(0,Math.floor((r.xmin-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymax)/o[1]))),zL(l,Math.max(0,Math.floor((r.xmax-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymin)/o[1]))),zL(u,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:c,rows:h}=t;let p,m,v,w;return!r&&c&&h&&(zL(a,c[0],h[0]),zL(l,c[1],h[1]),zL(u,c[1]-c[0]+1,h[1]-h[0]+1)),e.isWrappable?(p=wD(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),u[1]),m=wD(Math.floor((n.origin[0]-s[0])/o[0]),a[1]),v=wD(p[0]+m[0]-1,l[1]),w=!0):(m=a,v=l,p=u,w=!1),new u5t(t.level,t.resolution,t.scale,s,a,l,u,o,m,v,p,w)}constructor(e,t,r,n,s,o,a,l,u,c,h,p){this.level=e,this.resolution=t,this.scale=r,this.origin=n,this.first=s,this.last=o,this.size=a,this.norm=l,this.worldStart=u,this.worldEnd=c,this.worldSize=h,this.wrap=p}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,r=!1){mT.set(t);const n=r?mT.col:this.denormalizeCol(mT.col,mT.world),s=mT.row;return vyr(e,this.getXForColumn(n),this.getYForRow(s+1),this.getXForColumn(n+1),this.getYForRow(s)),e}getTileCoords(e,t,r=!1){mT.set(t);const n=r?mT.col:this.denormalizeCol(mT.col,mT.world);return Array.isArray(e)?zL(e,this.getXForColumn(n),this.getYForRow(mT.row)):(e.x=this.getXForColumn(n),e.y=this.getYForRow(mT.row)),e}},dB=class{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}*keys(){const e=this.lodInfo;for(const{row:t,colFrom:r,colTo:n}of this.spans)for(let s=r;s<=n;s++){const o=e.getWorldForColumn(s);yield new Tc(e.level,t,e.normalizeCol(s),o)}}forEach(e,t){const{spans:r,lodInfo:n}=this,{level:s}=n;if(r.length!==0)for(const{row:o,colFrom:a,colTo:l}of r)for(let u=a;u<=l;u++)e.call(t,s,o,n.normalizeCol(u),n.getWorldForColumn(u))}};dB.pool=new G3(dB);let bMe=class{constructor(e,t,r){this.row=e,this.colFrom=t,this.colTo=r}};const nd=new Tc("0/0/0/0");let byr=class c5t{static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[r,n]=e,[s,o]=t,a=s-r,l=o-n,u=l!==0?a/l:0,c=(Math.ceil(n)-n)*u,h=(Math.floor(n)-n)*u;return new c5t(r,Math.floor(n),Math.ceil(o),u,a<0?c:h,a<0?h:c,a<0?s:r,a<0?r:s)}constructor(e,t,r,n,s,o,a,l){this.x=e,this.ymin=t,this.ymax=r,this.invM=n,this.leftAdjust=s,this.rightAdjust=o,this.leftBound=a,this.rightBound=l}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const sw=[[0,0],[0,0],[0,0],[0,0]],wyr=1e-6;let ak=class{constructor(e,t=null,r=e.lods[0].level,n=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=e.lods.filter(a=>a.level>=r&&a.level<=n);this.minScale=s[0].scale,this.maxScale=s[s.length-1].scale;const o=this._lodInfos=s.map(a=>_yr.create(e,a,t));s.forEach((a,l)=>{this._infoByLevel[a.level]=o[l],this._infoByScale[a.scale]=o[l],this.scales[l]=a.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel[typeof e=="number"?e:e.level]}getTileBounds(e,t,r=!1){nd.set(t);const n=this._infoByLevel[nd.level];return n?n.getTileBounds(e,nd,r):e}getTileCoords(e,t,r=!1){nd.set(t);const n=this._infoByLevel[nd.level];return n?n.getTileCoords(e,nd,r):e}getTileCoverage(e,t=192,r=!0,n="closest"){if(!r&&(e.scale>this.minScale||e.scale100)return null;let S=[];for(l=h;l=0;I--){const R=S[I];u=Math.min(u,R.getLeftCol()),c=Math.max(c,R.getRightCol())}if(u=Math.floor(u),c=Math.floor(c),l>=s.first[1]&&l<=s.last[1])if(a)if(s.size[0]s.last[0]||c=0;I--){const R=S[I];R.ymax>=l?R.incrRow():S.splice(I,1)}}return o}getTileParentId(e){nd.set(e);const t=this._infoByLevel[nd.level],r=this._lodInfos.indexOf(t)-1;return r<0?null:(this._getTileIdAtLOD(nd,this._lodInfos[r],nd),nd.id)}getTileResolution(e){const t=this._infoByLevel[typeof e=="object"?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){nd.set(t);const r=this._infoByLevel[nd.level],n=e.lodInfo;if(n.resolution>r.resolution){this._getTileIdAtLOD(nd,n,nd);const o=n.denormalizeCol(nd.col,nd.world);for(const a of e.spans)if(a.row===nd.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(n.resolution(w[0]=Math.min(w[0],S.row),w[1]=Math.max(w[1],S.row),w[2]=Math.min(w[2],S.colFrom),w[3]=Math.max(w[3],S.colTo),w),[1/0,-1/0,1/0,-1/0]),c=r.denormalizeCol(nd.col,nd.world),h=n.getColumnForX(r.getXForColumn(c)),p=n.getRowForY(r.getYForRow(nd.row)),m=n.getColumnForX(r.getXForColumn(c+1))-1,v=n.getRowForY(r.getYForRow(nd.row+1))-1;return!(h>u||ma||vo.row===nd.row&&o.colFrom<=s&&o.colTo>=s)}normalizeBounds(e,t,r){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const n=Zp(this.tileInfo.spatialReference),s=-r*(n.valid[1]-n.valid[0]);e[0]+=s,e[2]+=s}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let r=1;rt[r]+wyr)return this._infoByScale[t[r-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce((r,n)=>Math.abs(n-e)=0;r--)if(ee.push(t)),this._controllers.clear(),e.forEach(t=>t.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,r)=>e(r))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const r=this.get(e);if(r)return r;const n=new AbortController;let s=null;t&&(s=Qh(t,()=>n.abort()));const o=()=>{const c=this._processingItems.get(e);c&&c.controller.abort(),a(),u.reject(Oc())},a=()=>{l.remove(),s?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=ZH(n.signal,o),u=ac();return this._deferreds.set(e,u),this._controllers.set(e,n),u.promise.then(a,a),this._queue.push(e),this._scheduleNext(),u.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(Oc("Removed from queue")),this._removeItem(e)),e}reset(){const e=[];this._processingItems.forEach(t=>e.push(t)),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(n,s),s=>this._processError(n,s))):this._processResult(n,t)}get test(){return{update:e=>this.runTask(e)}}};function Syr(i,e){return i.length=0,e.forEach(t=>i.push(t)),i}const wMe=new Set,Ihe=[],gj=new Map,ult=[0,0];let O4=class extends un{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t,strategy:r}=this;this._queue=new UY({concurrency:e,process:(n,s)=>{const o=this._keyToItem.get(n);return t(o,{signal:s})},peeker:r==="scale-first"?n=>this._peekByScaleFirst(n):n=>this._peekByCenterFirst(n)})}destroy(){this.clear(),this._queue=zo(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear()}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const r=this._queue.push(t),n=()=>{this._keyToItem.delete(t)};return this._keyToItem.set(t,e),r.then(n,n),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(c=>{const h=this._keyToItem.get(c),p=this.tileInfoView.getTileScale(h.key);gj.has(p)||(gj.set(p,[]),r=Math.max(p,r),n=Math.min(p,n)),gj.get(p).push(h.key),wMe.add(p)});let s=this.state.scale;gj.has(s)||(Syr(Ihe,wMe),Ihe.sort((c,h)=>c-h),s=Ihe.reduce((c,h)=>Math.abs(h-s){const p=a.denormalizeCol(c.col,c.world),m=a.denormalizeCol(h.col,h.world);return Math.sqrt((l-p)*(l-p)+(u-c.row)*(u-c.row))-Math.sqrt((l-m)*(l-m)+(u-h.row)*(u-h.row))}),wMe.clear(),gj.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const a=this._keyToItem.get(o);t.getTileCoords(ult,a.key);const l=ySe(ult,r);lthis.maxSize&&s>=0;)s!==e&&(n=this._pruneAroundCenterTile(n,t,r,s)),s--;n>this.maxSize&&(n=this._pruneAroundCenterTile(n,t,r,e))}_pruneAroundCenterTile(e,t,r,n){const s=this._tileKeysPerLevel[n];if(!s||s.length===0)return e;const{size:o,origin:a}=this._tileInfoView.tileInfo,l=r*o[0],u=r*o[1],c=[0,0],h=[0,0];for(s.sort((p,m)=>(c[0]=a.x+l*(p.col+.5),c[1]=a.y-u*(p.row+.5),h[0]=a.x+l*(m.col+.5),h[1]=a.y-u*(m.row+.5),k1e(c,t)-k1e(h,t)));s.length>0;){const p=s.pop();if(this._removeTile(p.id),--e===this.maxSize)break}return e}_removeTile(e){const t=this._tilePerId.get(e);this._removedFunc&&t&&this._removedFunc(t),clt(this._tilePerId,e)}};function clt(i,e){i.delete(e)}const VL=new Tc(0,0,0,0),_M=new Map,HL=[],xMe=[];let Qne=class{constructor(e){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,e.resampling!=null&&(this.resampling=e.resampling),e.cachePolicy&&(this.cachePolicy=e.cachePolicy),e.coveragePolicy&&(this.coveragePolicy=e.coveragePolicy),e.buffer!=null&&(this.buffer=e.buffer),e.cacheSize&&(this._tileCache=new Tyr(e.cacheSize,this.tileInfoView,t=>{this.releaseTile(t)}))}destroy(){this.tileIndex.clear()}update(e){const{resampling:t,tileIndex:r}=this,{scale:n,center:s,resolution:o}=e.state,{minScale:a,maxScale:l}=this.tileInfoView,u=!e.stationary&&n>this._previousScale;if(this._previousScale=n,!t&&(n>a||nI.visible=!0);let v=0,w=0;if(h.length>0)for(const{row:I,colFrom:R,colTo:L}of h)for(let k=R;k<=L;k++){v++;const B=VL.set(m,I,p.normalizeCol(k),p.getWorldForColumn(k)).id;let $=r.get(B);if($)$.isReady?(_M.set(B,$),w++):u||this._addParentTile(B,_M);else{if(this._tileCache?.has(B)){if($=this._tileCache.pop(B),this.tileIndex.set(B,$),$.isReady){_M.set(B,$),w++;continue}}else $=this.acquireTile(VL),this.tileIndex.set(B,$);u||this._addParentTile(B,_M)}}const S=w===v;for(const[I,R]of r){if(_M.has(I))continue;VL.set(I);const L=this.tileInfoView.intersects(c,VL),k=this.cachePolicy==="purge"?VL.level!==m:VL.level>m;!L||!u&&S?!k&&L||HL.push(R):R.isReady?k&&this.cachePolicy==="purge"&&this._hasReadyAncestor(VL,m)?HL.push(R):xMe.push(R):k&&HL.push(R)}for(const I of xMe)I.isReady&&_M.set(I.key.id,I);for(const I of HL)this._tileCache?this._tileCache.add(I):this.releaseTile(I),r.delete(I.key.id);for(const I of _M.values())this.tiles.push(I);for(const I of r.values())_M.has(I.key.id)||(I.visible=!1);this._tileCache?.prune(m,s,o),dB.pool.release(c),xMe.length=0,HL.length=0,_M.clear()}clear(){const{tileIndex:e}=this;for(const t of e.values())this.releaseTile(t);e.clear()}refresh(e){for(const t of this.tileIndex.values())this.tiles.includes(t)?e(t):HL.push(t);for(const t of HL)this.releaseTile(t),this.tileIndex.delete(t.key.id);this._tileCache?.clear()}updateCacheSize(e){this._tileCache&&(this._tileCache.maxSize=e)}_addParentTile(e,t){let r=e,n=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(n=this.tileIndex.get(r),n?.isReady){t.has(n.key.id)||t.set(n.key.id,n);break}}else if(this._tileCache?.has(r)&&(n=this._tileCache.pop(r),this.tileIndex.set(r,n),n?.isReady)){t.has(n.key.id)||t.set(n.key.id,n);break}}_hasReadyAncestor(e,t){const r=Wo();this.tileInfoView.getTileBounds(r,e,!0);for(const n of this.tileIndex.values())if(n.isReady&&n.key.level>=t&&n.key.level=2}function Kyr(i){return Array.isArray(i)&&i.length>=2}function Ahe(i){return Jyr(i)||Kyr(i)}var jNe;const k0=[0,0];let P4=jNe=class extends Ci{constructor(i){super(i),this._viewpoint2D={center:Ja(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new hr,this.id=0,this.inverseTransform=HA(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=HA(),this.transformNoRotation=HA(),this.displayMat3=Cc(),this.displayViewMat3=Cc(),this.viewMat3=Cc(),this.viewMat2d=SS(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(i){this._set("pixelRatio",i),this._update()}set size(i){this._set("size",i),this._update()}set viewpoint(i){if(i){const e=this._viewpoint2D,t=i.targetGeometry;e.center[0]=t.x,e.center[1]=t.y,e.rotation=i.rotation,e.scale=i.scale,e.spatialReference=t.spatialReference}this._update()}copy(i){const e=this.size,t=this.viewpoint;return t&&e?(this.viewpoint=ME(t,i.viewpoint),this._set("size",kW(e,i.size))):(this.viewpoint=i.viewpoint.clone(),this._set("size",[i.size[0],i.size[1]])),this._set("pixelRatio",i.pixelRatio),this}clone(){return new jNe({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(i,e,t){return Ahe(e)?yf(i,e,this.inverseTransform):(k0[0]=e,k0[1]=t,yf(i,k0,this.inverseTransform))}toScreen(i,e,t){return Ahe(e)?yf(i,e,this.transform):(k0[0]=e,k0[1]=t,yf(i,k0,this.transform))}toScreenNoRotation(i,e,t){return Ahe(e)?yf(i,e,this.transformNoRotation):(k0[0]=e,k0[1]=t,yf(i,k0,this.transformNoRotation))}toScreenClosest(i,e,t){Ahe(e)?(k0[0]=e[0],k0[1]=e[1]):(k0[0]=e,k0[1]=t);const[r]=k0,{center:n,extent:s,spatialReference:o,transform:a}=this;return(rs.xmax)&&(k0[0]=rRt(r,n[0],o)),yf(i,k0,a)}getScreenTransform(i,e){const{center:t}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size");return fWe(i,t,n,e,0,r),i}_update(){const{center:i,spatialReference:e,scale:t,rotation:r}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new Ab({targetGeometry:new $i(i[0],i[1],e),scale:t,rotation:r});if(this._set("viewpoint",o),!s||!e||!t)return;this.resolution=GY(o),this.rotation=r,this.scale=t,this.spatialReference=e,kW(this.center,i);const a=s[0]!==0?2/s[0]:0,l=s[1]!==0?-2/s[1]:0;pB(this.displayMat3,a,0,0,0,l,0,-1,1,1);const u=Jk(this.viewMat3),c=Xp(s[0]/2,s[1]/2),h=Xp(-s[0]/2,-s[1]/2),p=eB(r);h0(u,u,c),q3(u,u,p),h0(u,u,h),n_(this.displayViewMat3,this.displayMat3,u);const m=aWe(this.viewMat2d,c);return sk(m,m,p),VA(m,m,h),Qgr(this.extent,o,s),mWe(this.transform,o,s,n),oWe(this.inverseTransform,this.transform),oyr(this.transformNoRotation,o,s,n),this.worldScreenWidth=ayr(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};x([D({readOnly:!0})],P4.prototype,"id",void 0),x([D({value:1,json:{write:!0}})],P4.prototype,"pixelRatio",null),x([D({json:{write:!0}})],P4.prototype,"size",null),x([D()],P4.prototype,"spatialReference",void 0),x([D({type:Ab,json:{write:!0}})],P4.prototype,"viewpoint",null),P4=jNe=x([Qe("esri.views.2d.ViewState")],P4);const hlt=P4;var GNe,UNe;let KO=GNe=class extends un{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new GNe({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};x([D()],KO.prototype,"left",void 0),x([D()],KO.prototype,"top",void 0),x([D()],KO.prototype,"right",void 0),x([D()],KO.prototype,"bottom",void 0),KO=GNe=x([Qe("esri.views.2d.PaddedViewState.Padding")],KO);let rU=UNe=class extends hlt{constructor(...i){super(...i),this.paddedViewState=new hlt,this._updateContent=(()=>{const e=Ja();return()=>{const t=this._get("size"),r=this._get("padding");if(!t||!r)return;const n=this.paddedViewState;dl(e,r.left+r.right,r.top+r.bottom),Kne(e,t,e),kW(n.size,e);const s=n.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(Ki(()=>[this.size,this.padding],()=>this._updateContent(),Kl)),this.padding=new KO,this.size=[0,0]}set padding(i){this._set("padding",i||new KO)}set viewpoint(i){if(i){const e=i.clone();this.paddedViewState.viewpoint=i,lyr(e,i,this._get("size"),this._get("padding"));const t=this._viewpoint2D,r=e.targetGeometry;t.center[0]=r.x,t.center[1]=r.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=r.spatialReference,this._update()}}clone(){return new UNe({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};x([D()],rU.prototype,"paddedViewState",void 0),x([D({type:KO})],rU.prototype,"padding",null),x([D()],rU.prototype,"viewpoint",null),rU=UNe=x([Qe("esri.views.2d.PaddedViewState")],rU);const Zyr=rU;let d1=class extends un{constructor(e){super(e),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([Ki(()=>this.constraints?.version,t=>{this.constraints&&t&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Kl)])}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return this.state.commitProperty("id"),new $i({x:e[0],y:e[1],spatialReference:t})}set center(e){if(e==null)return;if(!this.ready)return void this._set("center",e);let t;try{t=this._project(e,this.state.spatialReference)}catch(n){return void di.getLogger(this).error(new qe("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:n}))}const r=this.viewpoint;kNe(r,r,t),this.viewpoint=r}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void di.getLogger(this).error(new qe("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let t;try{t=this._project(e,this.state.spatialReference)}catch(n){return void di.getLogger(this).error(new qe("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const r=this.viewpoint;eyr(r,r,t,this.state.size,{constraints:this.constraints}),this.viewpoint=r}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;cyr(t,t,e),this.viewpoint=t}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",void 0);const r=this._get("extent");return void(r&&(this._set("extent",void 0),this._set("center",r.center)))}const t=this.viewpoint;slt(t,t,e),this.viewpoint=t}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(e){if(e==null)return;if(!this.ready)return this._set("viewpoint",e),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let t,r;try{t=this._project(e,this.state.spatialReference),!e.scale||isNaN(e.scale)?r=new qe("mapview:invalid-viewpoint",`invalid scale value of ${e.scale}`):e.targetGeometry==null&&(r=new qe("mapview:invalid-viewpoint","geometry not defined"))}catch(s){r=new qe("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(r)return void di.getLogger(this).error(r);this._scaleBeforeChangingSpatialReference=null;const n=new Ab({targetGeometry:new $i,scale:0,rotation:0});ME(n,t),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(e){if(!(e>=0))return;if(!this.ready){this._set("zoom",e),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const t=this.constraints?.zoomToScale(e)??0;if(!t)return void this._set("zoom",-1);const r=this.viewpoint;slt(r,r,t),this.viewpoint=r,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(e){if(!e[0]&&!e[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:t,constraints:r}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),l=this._get("viewpoint"),u=this._get("zoom"),c=u!=null&&r!=null&&r.zoomToScale(u)||void 0;let h,p,m;const v=l?.rotation,w=l?.targetGeometry;w?.type==="extent"?h=w:w?.type==="point"&&(p=w,m=l?.scale);const S=s??h;return{center:n??p??S?.center,rotation:a??v,scale:(o??c??m??(S&&qV(S,[e[0]-t.left-t.right,e[1]-t.top-t.bottom])))||void 0}}startup(e,t,r,n){const s=e.targetGeometry;try{this._project(e,r)}catch(o){di.getLogger(this).warn(new Rf("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:r,error:o})),e.targetGeometry=n||new $i({x:0,y:0,spatialReference:r})}this.constraints?.fit(e),this._set("state",new Zyr({padding:this.padding,size:t,viewpoint:e})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[e,t],spatialReference:r,rotation:n,scale:s}=this.state.paddedViewState,o=new $i({x:e,y:t,spatialReference:r});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(e){const t=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=t.scale;else{const l=t.viewpoint.clone();l.scale=this._scaleBeforeChangingSpatialReference,t.viewpoint=l}const r=t.clone(),[n,s]=t.center;let o=null;try{o=this._project(new $i({x:n,y:s,spatialReference:t.spatialReference}),e)}catch(l){hze()||di.getLogger(this).warn(new Rf("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:e,error:l}))}o||(o=new $i({x:0,y:0,spatialReference:e}));const a=kNe(new Ab({targetGeometry:new $i,scale:0,rotation:0}),t.viewpoint,o);r.viewpoint=a;try{const u=[t.size[0]/2,t.size[1]/2],c=[u[0]+20,u[1]],h=t.toMap([0,0],c),{x:p,y:m}=this._project(new $i({x:h[0],y:h[1],spatialReference:t.spatialReference}),e);h[0]=p,h[1]=m,r.toScreen(h,h);const v=r5t(u,h,c),w=Math.hypot(h[0]-u[0],h[1]-u[1])/20;!Number.isFinite(w)||Math.abs(w)>4?(a.rotation=0,a.targetGeometry=new $i({x:0,y:0,spatialReference:e})):(a.scale*=w,a.scale>yi("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(v)?v:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(e,t){if(!this.ready)return;const r=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.concat();r.size=[e,t],uyr(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(e){if(!this.ready)return null;const t=[0,0],[r,n]=this.state.toMap(t,[e.x,e.y]),s=this.state.spatialReference;return new $i({x:r,y:n,spatialReference:s})}toScreen(e,t){if(!this.ready)return null;const r=this._project(e,this.state.spatialReference),n=[r.x,r.y];return t?.pickClosestTarget===!1?this.state.toScreen(n,n):this.state.toScreenClosest(n,n),Vd(n[0],n[1])}_project(e,t){const r=e?.targetGeometry||e;if(!t)return e;if(!r)return null;if(t.imageCoordinateSystem||r.spatialReference?.imageCoordinateSystem||Ya(t,r.spatialReference))return e;const n=Wc(r,t);if(!n)throw new qe("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:t});return Qyr(e)?(e.targetGeometry=n,e):n}};function Qyr(i){return i?.declaredClass==="esri.Viewpoint"}x([D({type:$i})],d1.prototype,"center",null),x([D()],d1.prototype,"constraints",void 0),x([D({type:hr})],d1.prototype,"extent",null),x([D({value:{top:0,right:0,bottom:0,left:0},cast:i=>({top:0,right:0,bottom:0,left:0,...i})})],d1.prototype,"padding",null),x([D()],d1.prototype,"ready",void 0),x([D()],d1.prototype,"resizeAlign",void 0),x([D({readOnly:!0})],d1.prototype,"resolution",null),x([D({type:Number})],d1.prototype,"rotation",null),x([D({type:Number})],d1.prototype,"scale",null),x([D({readOnly:!0})],d1.prototype,"state",void 0),x([D({type:Ab})],d1.prototype,"viewpoint",null),x([D()],d1.prototype,"zoom",null),d1=x([Qe("esri.views.2d.ViewStateManager")],d1);function wWe(i,e){switch(e){case"primary":return i.pointerType==="touch"||i.button===0;case"secondary":return i.pointerType!=="touch"&&i.button===2;case"tertiary":return i.pointerType!=="touch"&&i.button===1}}let dlt=class extends Ag{constructor(e,t){super(!0),this._view=e,this.registerIncoming("double-click",t,r=>this._handleDoubleClick(r,t))}_handleDoubleClick(e,t){wWe(e.data,"primary")&&(e.stopPropagation(),t?this._view.mapViewNavigation.zoomOut([e.data.x,e.data.y]):this._view.mapViewNavigation.zoomIn([e.data.x,e.data.y]))}},e0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.pointerType=t,this.registerIncoming("double-tap-drag",r,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(e){const{data:t}=e,{pointerType:r}=t;if(r!==this.pointerType)return;e.stopPropagation();const{action:n,delta:s}=t,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:l}=o;this._startScale=l,this._currentScale=l,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const l=1.015**s.y,u=this._startScale*l,c=u/this._currentScale;a.setViewpointImmediate(c),this._currentScale=u;break}case"end":{const{constraints:l}=o,{effectiveLODs:u,snapToZoom:c}=l;if(!c||!u)return void a.end();const h=l.snapScale(this._currentScale),p=(s.y>0?Math.max(h,l.snapToPreviousScale(this._startScale)):Math.min(h,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(p);break}}}},_Se=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const t=e.data,r=t.pointers.size;switch(t.action){case"start":this._currentCount=r,this._emitStart(e);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"update":this._emitUpdate(e);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"end":this._emitEnd(e),this._currentCount=0}this._previousEvent=e}_emitStart(e){this._startEvent=e,this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.start(this._currentCount,e,this._startEvent)}_emitUpdate(e){this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.update(this._currentCount,e,this._startEvent)}_emitEnd(e){this._callbacks.condition?.(this._currentCount,e)&&this._callbacks.end(this._currentCount,e,this._startEvent),this._startEvent=null}},t0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.pointerAction=t,this.registerIncoming("drag",r,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(e){super.onInstall(e),this._dragEventSeparator=new _Se({start:(t,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(t,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(t,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(t,r)=>t===1&&wWe(r.data,this.pointerAction)})}_handleDrag(e){const t=this.view.mapViewNavigation;t.pinch.zoomMomentum||t.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(e)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},i0r=class extends Ag{constructor(e,t,r){super(!0),this._view=e,this.pointerAction=t;const n=this._view.mapViewNavigation;this._dragEventSeparator=new _Se({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&wWe(o.data,this.pointerAction)}),this.registerIncoming("drag",r,s=>this._dragEventSeparator.handle(s))}};function gT(i){let e=i*i;return i<0&&(e*=-1),e}function r0r(i){return i.translation[0]=0,i.translation[1]=0,i.translation[2]=0,i.heading=0,i.tilt=0,i}function n0r(i,e,t){const r=t,n=i.state,s=i.device,o=e.tiltDirection==="forward-down"?1:-1,a=1;return s.deviceType==="standard"?(r.translation[0]=gT(n.axes[0]),r.translation[1]=gT(n.axes[1]),r.translation[2]=gT(n.buttons[7])-gT(n.buttons[6]),r.heading=gT(n.axes[2]),r.tilt=gT(n.axes[3])):s.deviceType==="spacemouse"&&(r.translation[0]=1.2*gT(n.axes[0]),r.translation[1]=1.2*gT(n.axes[1]),r.translation[2]=2*-gT(n.axes[2]),r.heading=1.2*gT(n.axes[5]),r.tilt=1.2*gT(n.axes[3])),r.tilt*=o,Gc(r.translation,r.translation,a),r}function s0r(i){return i.translation[0]===0&&i.translation[1]===0&&i.translation[2]===0&&i.heading===0&&i.tilt===0&&i.zoom===0}let o0r=class extends Ag{constructor(e){super(!0),this._view=e,this._frameTask=null,this._watchHandles=new cY,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",t=>this._handleGamePadEvent(t)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([Ki(()=>this._view.navigation.gamepad?.enabled,t=>{t?(this._handle.resume(),this._frameTask||(this._frameTask=H9({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},js)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(e){const t=this._view.navigation.gamepad.device;t&&e.data.device!==t||this._currentDevice&&this._currentDevice!==e.data.device||(e.data.action==="end"?(this._currentDevice=null,r0r(this._transformation)):(this._currentDevice=e.data.device,n0r(e.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(e){const t=this._transformation;if(s0r(t))return;const r=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=l0r*n*e;ok(r,r,[t.translation[0]*s,-t.translation[1]*s]);const o=1+t.translation[2]*u0r*e,a=this._view.constraints.rotationEnabled?-t.heading*a0r*e:0,l=this._view.size,u=[l[0]/2,l[1]];yWe(r,r,o,a,u,l);const c=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=c}};const a0r=.06,l0r=.7,u0r=6e-4;function x5t(i){const e=()=>i(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),{remove:()=>document.addEventListener("visibilitychange",e)}}let c0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Ctrl"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,l=this._pressedKeys.size>0;a||l?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[t.left]:"left",[t.right]:"right",[t.up]:"up",[t.down]:"down"},this.registerIncoming("key-down",r,this._handleKey),this.registerIncoming("key-up",r,this._handleKey),this.registerIncoming("blur",r,this._stopMovement),this._visibilityHandle=x5t(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(e){const t=this._currentDirection!=null;if(e!=null){if(t||this.view.mapViewNavigation.begin(),this._currentDirection!==e)switch(e){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else t&&this.view.mapViewNavigation.stop();this._currentDirection=e}_setTimeout(e){clearTimeout(this._timeout),this._timeout=e===void 0?void 0:setTimeout(()=>{this._timeout=void 0,e()},this._stickyKeyDuration)}},h0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._pressed=!1,this._keyToDirection={[t.clockwiseOption1]:"clockwise",[t.clockwiseOption2]:"clockwise",[t.counterClockwiseOption1]:"counterClockwise",[t.counterClockwiseOption2]:"counterClockwise",[t.resetOption1]:"reset",[t.resetOption2]:"reset"},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",r,n=>this._handleKeyUp(n)),this.registerIncoming("blur",r,()=>this._handleStop()),this._visibilityHandle=x5t(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(e){e.data.repeat||this._handleKey(e,!0)}_handleKeyUp(e){this._handleKey(e,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(e,t){const r=e.modifiers;if(r.size>0&&!r.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[e.data.key];if(this._pressed=n!=null,this._pressed){if(e.preventDefault(),t)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();e.stopPropagation()}}};var Gz;(function(i){i[i.IN=0]="IN",i[i.OUT=1]="OUT"})(Gz||(Gz={}));let d0r=class extends Ag{constructor(e,t,r){super(!0),this.view=e,this.keys=t,this._keysToZoomAction={},this.registerIncoming("key-down",r,n=>this._handleKeyDown(n)),t.zoomIn.forEach(n=>this._keysToZoomAction[n]=Gz.IN),t.zoomOut.forEach(n=>this._keysToZoomAction[n]=Gz.OUT)}_handleKeyDown(e){this._handleKey(e)}_handleKey(e){const t=e.modifiers;if(t.size>0&&!t.has("Shift"))return;const{key:r}=e.data;if(!(r in this._keysToZoomAction))return;const n=this._keysToZoomAction[r],{mapViewNavigation:s}=this.view;let o=null;switch(n){case Gz.IN:o=s.zoomIn();break;case Gz.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),e.stopPropagation()}};const p0r=.6;let f0r=class extends Ag{constructor(e,t){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",t,r=>this._handleMouseWheel(r))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled||(e.preventDefault(),e.stopPropagation(),!this._canZoom))return;const t=this._view.mapViewNavigation,{x:r,y:n,deltaY:s}=e.data,o=1/p0r**(1/60*s),a=t.zoom(o,[r,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,t.end()}))}},m0r=class extends Ag{constructor(e){super(!0),this.view=e,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const t=this.view.mapViewNavigation;this._dragEventSeparator=new _Se({start:(r,n)=>{t.pinch.begin(this.view,n.data),n.stopPropagation()},update:(r,n)=>{t.pinch.update(this.view,n.data),n.stopPropagation()},end:(r,n)=>{t.pinch.end(this.view),n.stopPropagation()},condition:r=>r>=2})}_handleDrag(e){this._dragEventSeparator.handle(e)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function plt(i){const e=i.native;return e?{buttons:e.buttons.map(t=>t.pressed?t.value||1:0),axes:e.axes.map(t=>v0r(t,i.axisThreshold))}:{buttons:[],axes:[]}}function g0r(i,e){if(i.axes.length!==e.axes.length||i.buttons.length!==e.buttons.length)return!1;for(let t=0;t{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,plt(l),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(l),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const r="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=r&&n,this.supported&&(this._forEachGamepad(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const t=new nWe(e);t.deviceType!=="unknown"&&(this._inputDevices[e.index]=t,this._input.gamepad.devices.add(t)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=H9({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),t=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!t;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=plt(s),l=r||y0r(a);o&&(o.timestamp===n.timestamp||!o.active&&l||g0r(o.state,a))||this._emitGamepadEvent(n,a,!l)})}_forEachGamepad(e){const t=window.navigator.getGamepads();for(let r=0;r{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new _0r(e,this._input),this._gamepadSource.onEvent=r=>this._callback("gamepad",r)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=zo(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const r=this._active[t];this._element.removeEventListener(SMe[t],r),delete this._active[t]}e&&e.forEach(t=>{if(!this._active[t]&&SMe[t]){const r=(this._eventHandlers[t]||this._handleDefault).bind(this,t);this._element.addEventListener(SMe[t],r),this._active[t]=r}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,t){t?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?yj.touchNone:yj.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?yj.touchPan:yj.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(yj.touchNone),this._element.classList.remove(yj.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,t){const r=O4t(this._element,e);return T5t.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),t.x=r.x,t.y=r.y,t}_handleKey(e,t){const{key:r}=t;r&&e==="key-up"&&this._keyDownState.delete(r);const n={native:t,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,t){const r=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,r)}_handlePointerPreventDefault(e,t){const r=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,r)}_handleMouseWheel(e,t){let r=t.deltaY;switch(t.deltaMode){case 0:flt&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}flt?r*=.7:b0r||x0r?r*=.6:w0r&&(r*=1.375);const n=100,s=Math.abs(r);s>n&&(r=r/s*200/(1+Math.exp(-.02*(s-n))));const o=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:r});this._callback(e,o)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const r={native:t};t.preventDefault(),this._callback(e,r)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};S5t.test={disableSubpixelCoordinates:!1};const SMe={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let S0r=class extends Ag{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};const t0={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function B1e(i,e){return Math.abs(e.x-i.x)+Math.abs(e.y-i.y)}function T0r(i,e){const t=e.x-i.x,r=e.y-i.y;return Math.sqrt(t*t+r*r)}function C0r(i,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:Vd()},i.length===0)return e;if(i.length===1)return e.center.x=i[0].x,e.center.y=i[0].y,e;if(i.length===2){const[L,k]=i,[B,$]=[k.x-L.x,k.y-L.y];return e.radius=Math.sqrt(B*B+$*$)/2,e.center.x=(L.x+k.x)/2,e.center.y=(L.y+k.y)/2,e}let t=0,r=0;for(let L=0;LL.x-t),s=i.map(L=>L.y-r);let o=0,a=0,l=0,u=0,c=0,h=0,p=0;for(let L=0;Lthis._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(e=>{e.doubleTapTimeout=Hc(e.doubleTapTimeout)})}get hasPendingInputs(){return i2e(this._pointerState,e=>e.doubleTapTimeout!=null)}_clearPointerDown(e){const t=this._pointerState.get(e);t&&(t.doubleTapTimeout=Hc(t.doubleTapTimeout),this._pointerState.delete(e),this.refreshHasPendingInputs())}_createDoubleTapDragData(e,t,r){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:u}=r;return{action:e,delta:t,button:n,buttons:s,pointer:o,pointers:a,pointerType:l,timestamp:u}}_dragStart(e,t){if(!this._doubleTapDragReady||e!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:n}=t,{center:s}=r;this._dragStartCenter=s;const o=this._createDoubleTapDragData("begin",Vd(0,0),r);this._doubleTapDrag.emit(o,void 0,n),t.stopPropagation()}_dragUpdate(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:r}=e,{center:n}=t,s=Vd(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",s,t);this._doubleTapDrag.emit(o,void 0,r),e.stopPropagation()}_dragEnd(e){if(!this._doubleTapDragActive)return;const{data:t,modifiers:r}=e,{center:n}=t,s=Vd(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",s,t);this._doubleTapDrag.emit(o,void 0,r),this._doubleTapDragActive=!1,e.stopPropagation()}_handlePointerDown(e){const{data:t}=e,r=i9(t),n=this._pointerState.get(r),{pointerType:s}=t.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),B1e(n.event.data,t)>o?this._storePointerDown(e):this._doubleTapDragReady=!0}else this._storePointerDown(e)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(e){const{data:t}=e,{pointerType:r}=t.native,n=i9(t),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:e,doubleTapTimeout:o}),this.refreshHasPendingInputs()}},I0r=class extends Ag{constructor(e){super(!1),this._navigationTouch=e,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(e,t,r,n){return{action:e,pointerType:this._pointerType,button:this._mouseButton,buttons:t.buttons,timestamp:n,pointers:A0r(this._activePointerMap),pointer:t,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(e){const t=e.native.pointerId,r=Mhe(this._activePointerMap).angle,n={event:e,initialAngle:0,lastAngle:0};this._activePointerMap.set(t,n);const s=mge(n,C5t(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(r)}_updatePointer(e){if(e&&e.x==null&&e.y==null)return;const t=e.native.pointerId,r=this._activePointerMap.get(t);r?r.event=e:this._addPointer(e)}_removePointer(e){const t=Mhe(this._activePointerMap).angle;this._activePointerMap.delete(e),this._updatePointerAngles(t)}_updatePointerAngles(e){const t=Mhe(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=mge(r,t)-e,r.lastAngle=mge(r,t)-e})}_emitEvent(e,t,r){const n=Mhe(this._activePointerMap);this._drag.emit(this._createPayload(e,t,n,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const t=e.data.native.pointerId,r=e.timestamp;this._activePointerMap.get(t)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(t)):(this._removePointer(t),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const t=e.data,r=t.currentEvent,n=e.timestamp;switch(t.action){case"start":case"update":this._isDragging?this._activePointerMap.has(r.native.pointerId)?(this._updatePointer(r),!this._isCurrentDragSuppressed&&this._emitEvent("update",r,n)):(this._addPointer(r),this._emitEvent("added",r,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(r),this._pointerType=e.data.startEvent.pointerType,this._mouseButton=e.data.startEvent.button,this._startStateModifiers=e.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",r,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function C5t(i){const e=[];return i.forEach(t=>{e.push(Vd(t.event.x,t.event.y))}),C0r(e)}function Mhe(i){const e=C5t(i);let t=0;return i.forEach(r=>{let n=mge(r,e),s=n-r.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=r.lastAngle+s,r.lastAngle=n;const o=n-r.initialAngle;t+=o}),t/=i.size||1,{angle:t,radius:e.radius,center:e.center}}function A0r(i){const e=new Map;return i.forEach((t,r)=>e.set(r,t.event)),e}function mge(i,e){const t=i.event,r=t.x-e.center.x,n=t.y-e.center.y;return Math.atan2(n,r)}var glt;(function(i){i[i.Left=0]="Left",i[i.Middle=1]="Middle",i[i.Right=2]="Right",i[i.Back=3]="Back",i[i.Forward=4]="Forward",i[i.Undefined=-1]="Undefined"})(glt||(glt={}));let M0r=class extends Ag{constructor(e=t0.maximumDoubleClickDelay,t=t0.maximumDoubleClickDistance,r=t0.maximumDoubleTouchDelay,n=t0.maximumDoubleTouchDistance,s=hY){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=t,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(e=>{e.immediateDoubleClick&&e.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(e){const t=e.data,r=i9(t);if(!this._pointerState.has(r)){const n={downButton:t.native.button,x:t.x,y:t.y,immediateDoubleClick:null};this._pointerState.set(r,n),this.startCapturingPointer(t.native)}}_handlePointerUp(e){const t=e.data,r=i9(t),n=this._pointerState.get(r);if(n&&n.downButton===t.native.button){const s=n.immediateDoubleClick,o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),B1e(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(t))):B1e(n,e.data)>o?this._removeState(t):this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,t){const r=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;t.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),r)}}_removeState(e){const t=i9(e);this._pointerState.delete(t),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}},O0r=class extends Ag{constructor(e=t0.maximumClickDelay,t=t0.movementUntilMouseDrag,r=t0.movementUntilPenDrag,n=t0.movementUntilTouchDrag,s=t0.holdDelay,o=hY){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=t,this._movementUntilPenDrag=r,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",a=>{this._handlePointerLoss(a,"pointer-up")}),this.registerIncoming("pointer-capture-lost",a=>{this._handlePointerLoss(a,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",a=>{this._handlePointerLoss(a,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(e=>{e.holdTimeout=Hc(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const t=e.data,r=t.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(r);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,e.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:t,previousEvent:t,startTimestamp:e.timestamp,isDragging:!1,downButton:t.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(r,s),this.startCapturingPointer(t.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,t,r){return{action:e,startEvent:t.startEvent,previousEvent:t.previousEvent,currentEvent:r}}_handlePointerMove(e){const t=e.data,r=t.native.pointerId,n=this._pointerState.get(r);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,t),void 0,n.modifiers):T0r(t,n.startEvent)>this._getDragThreshold(t.native.pointerType)&&this._startDragging(e),n.previousEvent=t)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const t=e.data,r=t.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=e.modifiers,n.isDragging=!0,r===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",n,t)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,t){const r=e.data,n=r.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",s,t==="pointer-up"?r:s.previousEvent),void 0,s.modifiers):t==="pointer-up"&&s.downButton===r.native.button&&e.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(r),this._pointerState.delete(n),this.stopCapturingPointer(r.native),this._pointerState.size===0&&this._moveHandle.pause())}},P0r=class extends Ag{constructor(e=t0.maximumDoubleClickDelay,t=t0.maximumDoubleClickDistance,r=t0.maximumDoubleTouchDelay,n=t0.maximumDoubleTouchDistance,s=hY){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=t,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(e=>e.doubleClickTimer=Hc(e.doubleClickTimer))}get hasPendingInputs(){return i2e(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,t){const r=this._pointerState.get(e);r&&(r.doubleClickTimer=Hc(r.doubleClickTimer),t&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const t=this._pointerState.get(e);t.pointerDownCount===1&&this._click.emit(t.event.data,void 0,t.event.modifiers),t.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:t,pointerType:r,button:n}=e.native;return r==="mouse"?`${t}:${n}`:`${r}`}_handleImmediateClick(e){const t=e.data,{pointerType:r}=t.native,n=this._getPointerId(t);if(!this._pointerState.has(n))return void this._startClick(e);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,l=r==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;B1e(o,t)>l?(this._clearDoubleClickTimer(n,!0),this._startClick(e)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(e){const t=i9(e.data),r=this._pointerState.get(t);r&&(r.pointerDownCount+=1)}_startClick(e){const{data:t}=e,{native:{pointerType:r}}=t,n=i9(t),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};const Ohe={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let u$=class extends un{initialize(){const e=()=>this.view?.ready;this.addHandles([v0(()=>!e(),()=>this._disconnect()),v0(e,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=zo(this._inputManager)}_connect(){const e=this.view.surface,t=new S5t(e,this.view.input),r=[new M0r,new O0r,new P0r,new I0r(this.view.navigation),new E0r],n=new A2({eventSource:t,recognizers:r});n.installHandlers("prevent-context-menu",[new S0r],zA.INTERNAL),n.installHandlers("navigation",[new m0r(this.view),new o0r(this.view),new f0r(this.view),new dlt(this.view),new dlt(this.view,[Ohe.counter]),new t0r(this.view,"primary"),new c0r(this.view,Ohe.pan),new d0r(this.view,Ohe.zoom),new h0r(this.view,Ohe.rotate),new i0r(this.view,"secondary"),new e0r(this.view,"touch")],zA.INTERNAL),this.view.viewEvents.connect(n),this._source=t,this._inputManager=n,Ki(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},js)}get test(){return{inputManager:this._inputManager}}};x([D()],u$.prototype,"view",void 0),x([D()],u$.prototype,"latestPointerType",null),x([D()],u$.prototype,"latestPointerLocation",null),x([D()],u$.prototype,"multiTouchActive",null),u$=x([Qe("esri.views.2d.input.MapViewInputManager")],u$);const R0r=u$;var ylt,vlt,_lt,E5t={exports:{}};ylt=E5t,vlt=function(){function i(n,s,o,a,l){e(n,s,o||0,a||n.length-1,l||r)}function e(n,s,o,a,l){for(;a>o;){if(a-o>600){var u=a-o+1,c=s-o+1,h=Math.log(u),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(u-p)/u)*(c-u/2<0?-1:1);e(n,s,Math.max(o,Math.floor(s-c*p/u+m)),Math.min(a,Math.floor(s+(u-c)*p/u+m)),l)}var v=n[s],w=o,S=a;for(t(n,o,s),l(n[a],v)>0&&t(n,o,a);w0;)S--}l(n[o],v)===0?t(n,o,S):t(n,++S,a),S<=s&&(o=S+1),s<=S&&(a=S-1)}}function t(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function r(n,s){return ns?1:0}return i},(_lt=vlt())!==void 0&&(ylt.exports=_lt);const I5t=Cg(E5t.exports);function $W(i,e){if(!(this instanceof $W))return new $W(i,e);this._maxEntries=Math.max(4,i||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function D0r(i,e,t){if(!t)return e.indexOf(i);for(var r=0;r=i.minX&&e.maxY>=i.minY}function nU(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xlt(i,e,t,r,n){for(var s,o=[e,t];o.length;)(t=o.pop())-(e=o.pop())<=r||(s=e+Math.ceil((t-e)/r/2)*r,I5t(i,s,e,t,n),o.push(e,s,s,t))}$W.prototype={all:function(){return this._all(this.data,[])},search:function(i){var e=this.data,t=[],r=this.toBBox;if(!Rhe(i,e))return t;for(var n,s,o,a,l=[];e;){for(n=0,s=e.children.length;n=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)},_split:function(i,e){var t=i[e],r=t.children.length,n=this._minEntries;this._chooseSplitAxis(t,n,r);var s=this._chooseSplitIndex(t,n,r),o=nU(t.children.splice(s,t.children.length-s));o.height=t.height,o.leaf=t.leaf,vj(t,this.toBBox),vj(o,this.toBBox),e?i[e-1].children.push(o):this._splitRoot(t,o)},_splitRoot:function(i,e){this.data=nU([i,e]),this.data.height=i.height+1,this.data.leaf=!1,vj(this.data,this.toBBox)},_chooseSplitIndex:function(i,e,t){var r,n,s,o,a,l,u,c;for(l=u=1/0,r=e;r<=t-e;r++)o=k0r(n=UQ(i,0,r,this.toBBox),s=UQ(i,r,t,this.toBBox)),a=TMe(n)+TMe(s),o=e;n--)s=i.children[n],zQ(l,i.leaf?o(s):s),u+=Phe(l);return u},_adjustParentBBoxes:function(i,e,t){for(var r=t;r>=0;r--)zQ(e[r],i)},_condense:function(i){for(var e,t=i.length-1;t>=0;t--)i[t].children.length===0?t>0?(e=i[t-1].children).splice(e.indexOf(i[t]),1):this.clear():vj(i[t],this.toBBox)},_initFormat:function(i){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(i[0])),this.compareMinY=new Function("a","b",e.join(i[1])),this.toBBox=new Function("a","return {minX: a"+i[0]+", minY: a"+i[1]+", maxX: a"+i[2]+", maxY: a"+i[3]+"};")}};let zNe=class A5t{constructor(e,t){this.key=new Tc(0,0,0,0),this.bounds=Wo(),this.objectIds=new Set,this.key.set(t);const r=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=r.resolution,this.scale=r.scale,this.level=r.level}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return hr.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),t=Ky.acquire();for(let r=0;rn?[Wo([i[0],i[1],n,i[3]]),Wo([r,i[1],r+i[2]-n,i[3]])]:i[0]({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}getIntersectingTiles(e){if(!e||hIt(e)===0||dIt(e)===0)return[];const t=N0r(e,this.tileScheme.spatialReference);return t!=null?[...new Set([...this.boundsIntersections(t[0]),...this.boundsIntersections(t[1])])]:this.boundsIntersections(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const r of e.added)if(!this.has(r)){const n=new zNe(this.tileScheme,r);this._tiles.set(r,n),this._index.insert(n),t.added.push(n)}for(const r of e.removed)if(this.has(r)){const n=this.get(r);this._tiles.delete(r),this._index.remove(n),t.removed.push(n)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:r,lodInfo:n}=t,{level:s}=n;if(r.length>0)for(const{row:o,colFrom:a,colTo:l}of r)for(let u=a;u<=l;u++){const c=L0r.set(s,o,n.normalizeCol(u),n.getWorldForColumn(u)).id;if(EMe.add(c),!this.has(c)){const h=new zNe(this.tileScheme,c);this._tiles.set(c,h),this._index.insert(h),this.tiles.push(h),WL.added.push(h)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];EMe.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),WL.removed.push(a))}(WL.added.length||WL.removed.length)&&this.emit("update",WL),dB.pool.release(t),EMe.clear(),WL.added.length=0,WL.removed.length=0}},R4=class extends un{constructor(){super(...arguments),this.color=new jr([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25,this.multiHighlightEnabled=!1}equals(e){return this.color.equals(e.color)&&(this.haloColor||this.color).equals(e.haloColor||e.color)&&this.haloOpacity===e.haloOpacity&&this.fillOpacity===e.fillOpacity&&this.multiHighlightEnabled===e.multiHighlightEnabled}};x([D({type:jr})],R4.prototype,"color",void 0),x([D({type:jr})],R4.prototype,"haloColor",void 0),x([D()],R4.prototype,"haloOpacity",void 0),x([D()],R4.prototype,"fillOpacity",void 0),x([D()],R4.prototype,"multiHighlightEnabled",void 0),R4=x([Qe("esri.views.2d.support.HighlightOptions")],R4);const tse=R4;async function B0r(i,e,t){const r=R4t(e)?P4t(i,e):e;if(!i.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let n=new Set;const s=new Set;let o=!1,a=null,l=null;t?.include?Tlt(t.include,Slt(i,p=>{n.add(p),IMe(p,m=>s.add(m))},(p,m)=>{s.add(p),n.add(m)},p=>{a||(a=new Set),a.add(p)},p=>n.add(p),()=>o=!0)):(o=!0,n=new Set(i.allLayerViews),n.forEach(p=>{IMe(p,m=>s.add(m))})),t?.exclude&&Tlt(t.exclude,Slt(i,p=>{n.delete(p),IMe(p,m=>s.delete(m))},p=>s.delete(p),p=>{l||(l=new Set),l.add(p)}));const u=i.allLayerViews.filter(p=>!p.suspended&&n.has(p)).reverse(),c=i.toMap(r);let h=[...o?i.graphicsView.hitTest(c).map(p=>({type:"graphic",graphic:p,layer:null,mapPoint:c})):[],...await Promise.all(u.map(p=>p.hitTest(c,r)).toArray())].filter(Ga).flat().filter(Ga);return h=h.filter(p=>p.type!=="graphic"||p.layer?.type!=="subtype-group"||s.has(p.graphic.layer)),a&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||a?.has(VNe(p.graphic)))),l&&(h=h.filter(p=>!("graphic"in p)||!p.graphic||!l?.has(VNe(p.graphic)))),{screenPoint:r,results:h}}function Slt(i,e,t,r,n,s){return o=>{if(o instanceof Us){if(o.layer===i)s?.();else{const a=i.allLayerViews.find(l=>l.layer===o.layer);a&&n?.(a)}r(VNe(o))}else if(o.type==="subtype-sublayer"){const a=i.allLayerViews.find(l=>l.layer===o.parent);a&&t(o,a)}else{const a=i.allLayerViews.find(l=>l.layer===o);a&&e(a)}}}function Tlt(i,e){if(i)if(pve(i))for(const t of i)if(pve(t))for(const r of t)e(r);else e(t);else e(i)}function VNe(i){const e=i.getObjectId();return e?`${i.layer?.uid??i.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${i.uid}`}function IMe({layer:i},e){i.type==="subtype-group"&&i.sublayers.forEach(t=>{e(t)})}let HJ=null,j1e=!0;function j0r(i,e,t){if(!i||!e)throw new Error("Cannot construct image data without dimensions");if(j1e)try{return new ImageData(i,e)}catch{j1e=!1}return M5t(i,e,t)}function G0r(i,e,t,r){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(j1e)try{return new ImageData(i,e,t)}catch{j1e=!1}const n=M5t(e,t,r);return n.data.set(i,0),n}function U0r(){return HJ||(HJ=document.createElement("canvas"),HJ.width=1,HJ.height=1),HJ}function M5t(i,e,t){return t||(t=U0r()),t.getContext("2d").createImageData(i,e)}async function z0r(i,e){const t=window.URL.createObjectURL(i);try{const{data:r}=await zi(t,{...e,responseType:"image"});return r}catch(r){throw mo(r)?r:new qe("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function O5t(i,e){const{arrayBuffer:t,mediaType:r}=await V0r(i,e),n=r==="image/png";if(r==="image/gif"){const{isAnimatedGIF:s,parseGif:o}=await Promise.resolve().then(()=>rxn);if(s(t))return o(t,e)}if(n){const{isAnimatedPNG:s,parseApng:o}=await Promise.resolve().then(()=>lxn);if(s(t))return o(t,e)}return z0r(new Blob([t],{type:r}),e)}async function V0r(i,e){const t=lR(i);if(t?.isBase64)return{arrayBuffer:WCt(t.data),mediaType:t.mediaType};const r=await zi(i,{responseType:"array-buffer",...e});return{arrayBuffer:r.data,mediaType:r.getHeader?.("Content-Type")??""}}function H0r(i,e,t){const{ctx:r,canvas:n}=P5t(i,t),s=r.getImageData(0,0,i.width,i.height),o=Y0r(n,e);return R5t(n),{dataUrl:o,data:s}}function W0r(i,e){const{ctx:t,canvas:r}=P5t(i,e),n=t.getImageData(0,0,i.width,i.height);return R5t(r),n}function P5t(i,e){const t=q0r();e.premultipliedAlpha&&evr(i),t.width=i.width,t.height=i.height;const r=t.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),e.flipY&&Q0r(r),{ctx:r,canvas:t}}function R5t(i){i.width=0,i.height=0}function q0r(){return AMe==null&&(AMe=document.createElement("canvas")),AMe}let AMe=null;function Y0r(i,e){const t=tvr[e.format],r=e.quality/100;return i.toDataURL(t,r)}function X0r(i,e){const t=Z0r(i),r=rvr[t];return{format:t,quality:uu(e??r,0,100)}}function J0r(i,e){return e/Math.max(i[0],i[1])}function K0r(i,e,t,r=0,n=0,s=i.width-r,o=i.height-n,a=!1){const{data:l}=i,{width:u,height:c,data:h}=e,p=s/u,m=o/c,v=Math.ceil(p/2),w=Math.ceil(m/2),S=i.width;for(let I=0;I=1)continue;let fe=2*ae*ae*ae-3*ae*ae+1;const be=4*(r+H+(n+re)*S);K+=fe*l[be+3],B+=fe,$+=fe*l[be],V+=fe*l[be+1],Y+=fe*l[be+2],k+=fe}}h[L]=$/k,h[L+1]=V/k,h[L+2]=Y/k,h[L+3]=K/B}return e}function Z0r(i){switch(i){case"png":case"jpg":case"jpeg":return i;default:return ivr}}function Q0r(i){i.save(),i.globalCompositeOperation="copy",i.scale(1,-1),i.translate(0,-i.canvas.height),i.drawImage(i.canvas,0,0),i.restore()}function evr(i){const e=i.data,t=e.length;for(let r=0;r0){const s=255/n;e[r]=e[r]*s,e[r+1]=e[r+1]*s,e[r+2]=e[r+2]*s}}}const tvr={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},Clt=98,ivr="png",rvr={png:100,jpg:Clt,jpeg:Clt},D5t={flipY:!0,premultipliedAlpha:!0};async function nvr(i,e){const t=await F5t(i,e),{format:r,quality:n}=X0r(e?.format,e?.quality);return H0r(t,{format:r,quality:n,rotation:0,disableDecorations:!1},D5t)}async function svr(i,e){const t=await F5t(i,e);return W0r(t,D5t)}function F5t(i,e){const t=lvr(e||{},avr(i.stage,i.size),i.size,i.padding),r=ovr(e,i.allLayerViews);return i.stage.takeScreenshot(t,r,i.backgroundColor,e?.rotation)}function ovr(i={},e){if(!i.layers)return;const t=[];return i.layers.forEach(r=>{const n=e.find(s=>s.layer.id===r.id);n?.container&&t.push(n.container)}),t}function avr(i,e){return Math.min(4,J0r(e,Math.min(4096,i.context.parameters.maxTextureSize)))}function lvr(i,e,t,r){i.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let n=null;i.width!=null&&i.height!=null?n=[i.width,i.height]:i.width==null&&i.height!=null?n=[i.height,i.height]:i.width!=null&&i.height==null?n=[i.width,i.width]:i.width==null&&i.height==null&&(n=null);const s=t[0]-(r.left+r.right),o=t[1]-(r.top+r.bottom);let a,l,u=i.area||{x:0,y:0,width:s,height:o};if(n){const c=s/o,h=n[0]/n[1];if(h>c){const p=u.width/h;u={x:u.x,y:Math.round(u.y+(u.height-p)/2),width:u.width,height:Math.round(p)}}else{const p=u.height*h;u={x:Math.round(u.x+(u.width-p)/2),y:u.y,width:Math.round(p),height:u.height}}}else n=[u.width,u.height];return n[0]>u.width?(a=Math.min(n[0]/u.width,e),l=n[0]/u.width/a):(a=1,l=n[0]/u.width),{cropArea:{x:Math.round((u.x+r.left)*a),y:Math.round((u.y+r.top)*a),width:Math.round(u.width*a),height:Math.round(u.height*a)},outputScale:l,resolutionScale:a}}const Elt=160;let VQ=class extends un{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Elt&&this.clear()},Elt))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};x([D()],VQ.prototype,"_timer",void 0),x([D()],VQ.prototype,"stationary",null),VQ=x([Qe("esri.views.2d.support.StationaryManager")],VQ);const uvr=i=>i.includes("Brush");let xWe=class{constructor(){this._names=new Map}begin(e){this._names.has(e)||(this._names.set(e,!1),uvr(e)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${e}.Start`))}end(e){this._names.has(e)&&!this._names.get(e)&&(this._names.set(e,!0),performance.mark(`Esri.${e}.End`))}record(e){this._names.has(e)||(this._names.set(e,!0),performance.mark(`Esri.${e}`))}};function BW(i,e={}){return i.getContext("webgl2",e)||null}let MMe;function lk(){return MMe||(MMe=dvr()),MMe}let cvr=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}};function hvr(i){if(typeof WebGL2RenderingContext>"u")return null;const e=document.createElement("canvas");if(!e)return null;let t=BW(e,{failIfMajorPerformanceCaveat:!0});if(t==null&&(t=BW(e),t!=null&&(i.majorPerformanceCaveat=!0)),t==null)return t;i.available=!0,i.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),i.supportsVertexShaderSamplers=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);return r&&(i.supportsHighPrecisionFragment=r.precision>0),t}function dvr(){const i=new cvr,e=hvr(i);return e==null||(i.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,i.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,i.supportsColorBufferHalfFloat=i.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),i}function pvr(i){const e=lk();return e.available?i==="3d"&&e.majorPerformanceCaveat?new qe("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new qe("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new qe("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new qe("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function fvr(i){return i&&"nodeType"in i}function mvr(i){return i&&typeof i.render=="function"}const Ilt={component:"esri-component"};let c$=class extends un{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(e){this._set("id",e)}set node(e){const t=this._get("node");e!==t&&(e&&e.classList.add(Ilt.component),t&&t.classList.remove(Ilt.component),this._set("node",e))}castNode(e){return this.widget?.destroy(),e?typeof e=="string"||fvr(e)?(this._set("widget",null),eWe(e)):(mvr(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};x([D()],c$.prototype,"id",null),x([D()],c$.prototype,"node",null),x([So("node")],c$.prototype,"castNode",null),x([D({readOnly:!0})],c$.prototype,"widget",void 0),c$=x([Qe("esri.views.ui.Component")],c$);const gge=c$,k5t="calcite-mode-";function gvr(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function L5t(){return gvr().startsWith("dark")}function N5t(){return`${k5t}${L5t()?"dark":"light"}`}function yvr(i){vvr(i),i.classList.add(N5t())}function vvr(i){Array.from(i.classList).forEach(e=>{e.startsWith(k5t)&&i.classList.remove(e)})}const _vr={left:0,top:0,bottom:0,right:0},$5t={bottom:30,top:15,right:15,left:15},bM="esri-ui",I_={ui:bM,corner:`${bM}-corner`,innerContainer:`${bM}-inner-container`,manualContainer:`${bM}-manual-container`,cornerContainer:`${bM}-corner-container`,topLeft:`${bM}-top-left`,topRight:`${bM}-top-right`,bottomLeft:`${bM}-bottom-left`,bottomRight:`${bM}-bottom-right`};function bvr(i){return i&&!i._started&&typeof i.postMixInProperties=="function"&&typeof i.buildRendering=="function"&&typeof i.postCreate=="function"&&typeof i.startup=="function"}function Dhe(i){return i===0?"0":`${i}px`}function OMe(i){const e=typeof i=="object"&&i!==null&&Object.getPrototypeOf(i);return(e===null||e===Object.prototype)&&("component"in i||"index"in i||"position"in i)?i:null}function PMe(i,{top:e,bottom:t,left:r,right:n}){i.style.top=e,i.style.bottom=t,i.style.left=r,i.style.right=n}let xI=class extends rd.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=Am(),this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&PMe(t,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&PMe(t,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([Ki(()=>[this.view?.padding,this.container],this._applyViewPadding,js),Ki(()=>this.padding,this._applyUIPadding,js),Ki(()=>[this.container,this._locale],([e,t])=>{e&&e.setAttribute("lang",t)},js),_ze(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentMap.clear()}set container(e){const t=this._get("container");e!==t&&(e&&(e.classList.add(I_.ui),yvr(e),this._attachContainers(e)),t&&(t.classList.remove(I_.ui),PMe(t,{top:"",bottom:"",left:"",right:""}),i4t(t)),this._set("container",e))}get height(){const e=this.view?.height??0;if(e===0)return e;const t=this._getViewPadding(),{top:r,bottom:n}=t;return Math.max(e-r-n,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...$5t,...e}}get width(){const e=this.view?.width??0;if(e===0)return e;const t=this._getViewPadding(),{left:r,right:n}=t;return Math.max(e-r-n,0)}add(e,t){let r,n,s;if(Array.isArray(e))return void e.forEach(a=>this.add(a,t));const o=OMe(e);o&&({index:r,position:t,component:e,key:n}=o),t&&typeof t=="object"&&({index:r,key:n,position:t,internal:s}=t),!e||t&&!this._isValidPosition(t)||this._add(e,t,r,n,s)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(n=>this.remove(n,t));const r=this._find(e);if(r){if(this._componentMap.has(r)&&this._componentMap.get(r)?.key!==t)return;const n=this._components.indexOf(r);return r.node.parentNode?.removeChild(r.node),this._componentMap.delete(r),this._components.splice(n,1)[0]}}empty(e,t={removeInternal:!1}){if(Array.isArray(e)){for(const s of e)this.empty(s,t);return}const r=this._positionNameToContainerLookup[e??"manual"],n=Array.prototype.slice.call(r.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||t.removeInternal);for(const s of n)this.remove(s)}move(e,t){if(Array.isArray(e)&&e.forEach(o=>this.move(o,t)),!e)return;let r;const n=OMe(e)||OMe(t);if(n&&(r=n.index,t=n.position,e=n.component||e),t&&!this._isValidPosition(t))return;const s=this.remove(e);s&&this.add(s,{position:t,index:r})}find(e){if(!e)return null;const t=this._findById(e);return t&&(t.widget||t.node)}getComponents(e,t={includeInternal:!1}){return e?Array.isArray(e)?e.flatMap(r=>this._getComponentsAtPosition(r,t)):this._getComponentsAtPosition(e,t):this._components.filter(r=>t.includeInternal||!this._componentMap.get(r)?.internal).map(({widget:r,node:n})=>r??n)}getPosition(e){for(const t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,r,n,s){e instanceof gge||(e=new gge({node:e})),this._place({component:e,position:t,index:r}),this._components.push(e),this._componentMap.set(e,{key:n,internal:s})}_find(e){return e?e instanceof gge?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.view?.padding??_vr}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(I_.innerContainer,I_.cornerContainer);const t=document.createElement("div");t.classList.add(I_.innerContainer,I_.manualContainer);const r=document.createElement("div");r.classList.add(I_.topLeft,I_.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(I_.topRight,I_.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(I_.bottomLeft,I_.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(I_.bottomRight,I_.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=t;const a=nk();this._cornerNameToContainerLookup={"top-left":r,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:r,"top-trailing":a?r:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const t=e.position??"manual",{component:r,index:n}=e,s=this._positionNameToContainerLookup[t],o=n!=null&&n>-1;if(bvr(r.widget)&&r.widget.startup(),!o)return void s.appendChild(r.node);const a=Array.from(s.children);if(n===0)return void(s.firstChild?Dat(r.node,s.firstChild):s.appendChild(r.node));n>=a.length?s.appendChild(r.node):Dat(r.node,a[n])}_toPixelPosition(e){return{top:Dhe(e.top),left:Dhe(e.left),right:Dhe(e.right),bottom:Dhe(e.bottom)}}_findByComponent(e){return this._components.find(t=>t===e)??null}_findById(e){return this._components.find(({id:t})=>t===e)??null}_findByNode(e){return this._components.find(({node:t})=>t===e)??null}_getComponentsAtPosition(e,t){const r=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(r.children).map(n=>this._findByNode(n)).filter(Ga).filter(n=>t.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};x([D()],xI.prototype,"_locale",void 0),x([D()],xI.prototype,"container",null),x([D()],xI.prototype,"height",null),x([D({value:$5t})],xI.prototype,"padding",null),x([So("padding")],xI.prototype,"castPadding",null),x([D()],xI.prototype,"view",void 0),x([D()],xI.prototype,"width",null),xI=x([Qe("esri.views.ui.UI")],xI);const wvr=xI,xvr={handleInterceptedEvent:(i,e,t,r)=>(i.scheduleRender(),e.properties[`on${r.type}`].apply(e.properties.bind||t,[r]))},Svr={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(i,e,t)=>{e.charAt(0)==="-"?i.style.setProperty(e,t):i.style[e]=t}},Tvr=i=>({...Svr,...i}),Cvr=(i,e)=>{const t=[];for(;i&&i!==e;)t.push(i),i=i.parentNode;return t},Evr=(i,e)=>i.find(e),Alt=(i,e,t=!1)=>{let r=i;return e.forEach((n,s)=>{const o=r?.children?Evr(r.children,a=>a.domNode===n):void 0;t&&!o&&s!==e.length-1||(r=o)}),r},Ivr=i=>{let e;const t={...xvr,...i},r=Tvr(t),n=r.performanceLogger;let s,o=!0,a=!1;const l=[],u=[],c=(p,m,v)=>{let w;r.eventHandlerInterceptor=(I,R,L,k)=>function(B){let $;n("domEvent",B);const V=Cvr(B.currentTarget,w.domNode),Y=V.some(Q=>customElements.get(Q?.tagName?.toLowerCase()));if(B.eventPhase===Event.CAPTURING_PHASE||!Y)V.reverse(),$=Alt(w.getLastRender(),V);else{const Q=B.composedPath(),re=Q.slice(Q.indexOf(B.currentTarget),Q.indexOf(w.domNode)).reverse();$=Alt(w.getLastRender(),re,!0)}let K;return $&&(K=t.handleInterceptedEvent(e,$,this,B)),n("domEventProcessed",B),K},t.postProcessProjectionOptions?.(r);const S=v();w=p(m,S,r),r.eventHandlerInterceptor=void 0,l.push(w),u.push(v),t.afterFirstVNodeRendered&&t.afterFirstVNodeRendered(w,S)};let h=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let p=0;p{s||a||(s=requestAnimationFrame(h))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),a=!0},resume:()=>{a=!1,o=!0,e.scheduleRender()},append:(p,m)=>{c(sF.append,p,m)},insertBefore:(p,m)=>{c(sF.insertBefore,p,m)},merge:(p,m)=>{c(sF.merge,p,m)},replace:(p,m)=>{c(sF.replace,p,m)},detach:p=>{for(let m=0;m{const e=new URL(i,hy.$resourcesUrl$);return e.origin!==jae.location.origin?e.href:e.pathname},Rvr=i=>hy.$resourcesUrl$=i,fB=(i,e="")=>()=>{},Dvr="slot-fb{display:contents}slot-fb[hidden]{display:none}",Olt="http://www.w3.org/1999/xlink",Plt={},Fvr="http://www.w3.org/2000/svg",kvr="http://www.w3.org/1999/xhtml",Lvr=i=>i!=null,CWe=i=>(i=typeof i,i==="object"||i==="function");function Nvr(i){var e,t,r;return(r=(t=(e=i.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||t===void 0?void 0:t.getAttribute("content"))!==null&&r!==void 0?r:void 0}const Ii=(i,e,...t)=>{let r=null,n=null,s=null,o=!1,a=!1;const l=[],u=h=>{for(let p=0;ph[p]).join(" "))}}if(typeof i=="function")return i(e===null?{}:e,l,Bvr);const c=U1e(i,null);return c.$attrs$=e,l.length>0&&(c.$children$=l),c.$key$=n,c.$name$=s,c},U1e=(i,e)=>{const t={$flags$:0,$tag$:i,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},Hb={},$vr=i=>i&&i.$tag$===Hb,Bvr={forEach:(i,e)=>i.map(Rlt).forEach(e),map:(i,e)=>i.map(Rlt).map(e).map(jvr)},Rlt=i=>({vattrs:i.$attrs$,vchildren:i.$children$,vkey:i.$key$,vname:i.$name$,vtag:i.$tag$,vtext:i.$text$}),jvr=i=>{if(typeof i.vtag=="function"){const t=Object.assign({},i.vattrs);return i.vkey&&(t.key=i.vkey),i.vname&&(t.name=i.vname),Ii(i.vtag,t,...i.vchildren||[])}const e=U1e(i.vtag,i.vtext);return e.$attrs$=i.vattrs,e.$children$=i.vchildren,e.$key$=i.vkey,e.$name$=i.vname,e},Gvr=i=>g1r.map(e=>e(i)).find(e=>!!e),Uvr=(i,e)=>i!=null&&!CWe(i)?e&4?i==="false"?!1:i===""||!!i:e&2?parseFloat(i):e&1?String(i):i:i,zvr=i=>i,Ba=(i,e,t)=>{const r=zvr(i);return{emit:n=>Vvr(r,e,{bubbles:!!(t&4),composed:!!(t&2),cancelable:!!(t&1),detail:n})}},Vvr=(i,e,t)=>{const r=hy.ce(e,t);return i.dispatchEvent(r),r},Dlt=new WeakMap,Hvr=(i,e,t)=>{let r=V1e.get(i);_1r&&t?(r=r||new CSSStyleSheet,typeof r=="string"?r=e:r.replaceSync(e)):r=e,V1e.set(i,r)},Wvr=(i,e,t)=>{var r;const n=V5t(e,t),s=V1e.get(n);if(i=i.nodeType===11?i:ZC,s)if(typeof s=="string"){i=i.head||i;let o=Dlt.get(i),a;if(o||Dlt.set(i,o=new Set),!o.has(n)){{a=ZC.createElement("style"),a.innerHTML=s;const l=(r=hy.$nonce$)!==null&&r!==void 0?r:Nvr(ZC);l!=null&&a.setAttribute("nonce",l),i.insertBefore(a,i.querySelector("link"))}e.$flags$&4&&(a.innerHTML+=Dvr),o&&o.add(n)}}else i.adoptedStyleSheets.includes(s)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s]);return n},qvr=i=>{const e=i.$cmpMeta$,t=i.$hostElement$,r=e.$flags$,n=fB("attachStyles",e.$tagName$),s=Wvr(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,i.$modeName$);r&10&&(t["s-sc"]=s,t.classList.add(s+"-h"),r&2&&t.classList.add(s+"-s")),n()},V5t=(i,e)=>"sc-"+(e&&i.$flags$&32?i.$tagName$+"-"+e:i.$tagName$),Flt=(i,e,t,r,n,s)=>{if(t!==r){let o=Blt(i,e),a=e.toLowerCase();if(e==="class"){const l=i.classList,u=klt(t),c=klt(r);l.remove(...u.filter(h=>h&&!c.includes(h))),l.add(...c.filter(h=>h&&!u.includes(h)))}else if(e==="style"){for(const l in t)(!r||r[l]==null)&&(l.includes("-")?i.style.removeProperty(l):i.style[l]="");for(const l in r)(!t||r[l]!==t[l])&&(l.includes("-")?i.style.setProperty(l,r[l]):i.style[l]=r[l])}else if(e!=="key")if(e==="ref")r&&r(i);else if(!i.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n"){if(e[2]==="-"?e=e.slice(3):Blt(jae,a)?e=a.slice(2):e=a[2]+e.slice(3),t||r){const l=e.endsWith(H5t);e=e.replace(Xvr,""),t&&hy.rel(i,e,t,l),r&&hy.ael(i,e,r,l)}}else{const l=CWe(r);if((o||l&&r!==null)&&!n)try{if(i.tagName.includes("-"))i[e]=r;else{const c=r??"";e==="list"?o=!1:(t==null||i[e]!=c)&&(i[e]=c)}}catch{}let u=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,u=!0),r==null||r===!1?(r!==!1||i.getAttribute(e)==="")&&(u?i.removeAttributeNS(Olt,e):i.removeAttribute(e)):(!o||s&4||n)&&!l&&(r=r===!0?"":r,u?i.setAttributeNS(Olt,e,r):i.setAttribute(e,r))}}},Yvr=/\s/,klt=i=>i?i.split(Yvr):[],H5t="Capture",Xvr=new RegExp(H5t+"$"),W5t=(i,e,t,r)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=i&&i.$attrs$||Plt,o=e.$attrs$||Plt;for(r in s)r in o||Flt(n,r,s[r],void 0,t,e.$flags$);for(r in o)Flt(n,r,s[r],o[r],t,e.$flags$)},z1e=(i,e,t,r)=>{var n;const s=e.$children$[t];let o=0,a,l,u;if(z5t||(SWe=!0,s.$tag$==="slot"&&(sU&&r.classList.add(sU+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)a=s.$elm$=ZC.createTextNode(s.$text$);else if(s.$flags$&1)a=s.$elm$=ZC.createTextNode("");else{if(Yw||(Yw=s.$tag$==="svg"),a=s.$elm$=ZC.createElementNS(Yw?Fvr:kvr,s.$flags$&2?"slot-fb":s.$tag$),Yw&&s.$tag$==="foreignObject"&&(Yw=!1),W5t(null,s,Yw),Lvr(sU)&&a["s-si"]!==sU&&a.classList.add(a["s-si"]=sU),s.$children$)for(o=0;o{var t;hy.$flags$|=1;const r=i.childNodes;for(let n=r.length-1;n>=0;n--){const s=r[n];s["s-hn"]!==bSe&&s["s-ol"]&&(X5t(s).insertBefore(s,EWe(s)),s["s-ol"].remove(),s["s-ol"]=void 0,s["s-sh"]=void 0,s.nodeType===1&&s.setAttribute("slot",(t=s["s-sn"])!==null&&t!==void 0?t:""),SWe=!0),e&&ise(s,e)}hy.$flags$&=-2},q5t=(i,e,t,r,n,s)=>{let o=i["s-cr"]&&i["s-cr"].parentNode||i,a;for(o.shadowRoot&&o.tagName===bSe&&(o=o.shadowRoot);n<=s;++n)r[n]&&(a=z1e(null,t,n,i),a&&(r[n].$elm$=a,o.insertBefore(a,EWe(e))))},Y5t=(i,e,t)=>{for(let r=e;r<=t;++r){const n=i[r];if(n){const s=n.$elm$;Z5t(n),s&&(G1e=!0,s["s-ol"]?s["s-ol"].remove():ise(s,!0),s.remove())}}},Jvr=(i,e,t,r,n=!1)=>{let s=0,o=0,a=0,l=0,u=e.length-1,c=e[0],h=e[u],p=r.length-1,m=r[0],v=r[p],w,S;for(;s<=u&&o<=p;)if(c==null)c=e[++s];else if(h==null)h=e[--u];else if(m==null)m=r[++o];else if(v==null)v=r[--p];else if(Fhe(c,m,n))oU(c,m,n),c=e[++s],m=r[++o];else if(Fhe(h,v,n))oU(h,v,n),h=e[--u],v=r[--p];else if(Fhe(c,v,n))(c.$tag$==="slot"||v.$tag$==="slot")&&ise(c.$elm$.parentNode,!1),oU(c,v,n),i.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++s],v=r[--p];else if(Fhe(h,m,n))(c.$tag$==="slot"||v.$tag$==="slot")&&ise(h.$elm$.parentNode,!1),oU(h,m,n),i.insertBefore(h.$elm$,c.$elm$),h=e[--u],m=r[++o];else{for(a=-1,l=s;l<=u;++l)if(e[l]&&e[l].$key$!==null&&e[l].$key$===m.$key$){a=l;break}a>=0?(S=e[a],S.$tag$!==m.$tag$?w=z1e(e&&e[o],t,a,i):(oU(S,m,n),e[a]=void 0,w=S.$elm$),m=r[++o]):(w=z1e(e&&e[o],t,o,i),m=r[++o]),w&&X5t(c.$elm$).insertBefore(w,EWe(c.$elm$))}s>u?q5t(i,r[p+1]==null?null:r[p+1].$elm$,t,r,o,p):o>p&&Y5t(e,s,u)},Fhe=(i,e,t=!1)=>i.$tag$===e.$tag$?i.$tag$==="slot"?i.$name$===e.$name$:t?!0:i.$key$===e.$key$:!1,EWe=i=>i&&i["s-ol"]||i,X5t=i=>(i["s-ol"]?i["s-ol"]:i).parentNode,oU=(i,e,t=!1)=>{const r=e.$elm$=i.$elm$,n=i.$children$,s=e.$children$,o=e.$tag$,a=e.$text$;let l;a===null?(Yw=o==="svg"?!0:o==="foreignObject"?!1:Yw,o==="slot"||W5t(i,e,Yw),n!==null&&s!==null?Jvr(r,n,e,s,t):s!==null?(i.$text$!==null&&(r.textContent=""),q5t(r,null,e,s,0,s.length-1)):n!==null&&Y5t(n,0,n.length-1),Yw&&o==="svg"&&(Yw=!1)):(l=r["s-cr"])?l.parentNode.textContent=a:i.$text$!==a&&(r.data=a)},J5t=i=>{const e=i.childNodes;for(const t of e)if(t.nodeType===1){if(t["s-sr"]){const r=t["s-sn"];t.hidden=!1;for(const n of e)if(n!==t){if(n["s-hn"]!==t["s-hn"]||r!==""){if(n.nodeType===1&&(r===n.getAttribute("slot")||r===n["s-sn"])){t.hidden=!0;break}}else if(n.nodeType===1||n.nodeType===3&&n.textContent.trim()!==""){t.hidden=!0;break}}}J5t(t)}},ZO=[],K5t=i=>{let e,t,r;for(const n of i.childNodes){if(n["s-sr"]&&(e=n["s-cr"])&&e.parentNode){t=e.parentNode.childNodes;const s=n["s-sn"];for(r=t.length-1;r>=0;r--)if(e=t[r],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==n["s-hn"]&&!R6.experimentalSlotFixes)if(Llt(e,s)){let o=ZO.find(a=>a.$nodeToRelocate$===e);G1e=!0,e["s-sn"]=e["s-sn"]||s,o?(o.$nodeToRelocate$["s-sh"]=n["s-hn"],o.$slotRefNode$=n):(e["s-sh"]=n["s-hn"],ZO.push({$slotRefNode$:n,$nodeToRelocate$:e})),e["s-sr"]&&ZO.map(a=>{Llt(a.$nodeToRelocate$,e["s-sn"])&&(o=ZO.find(l=>l.$nodeToRelocate$===e),o&&!a.$slotRefNode$&&(a.$slotRefNode$=o.$slotRefNode$))})}else ZO.some(o=>o.$nodeToRelocate$===e)||ZO.push({$nodeToRelocate$:e})}n.nodeType===1&&K5t(n)}},Llt=(i,e)=>i.nodeType===1?i.getAttribute("slot")===null&&e===""||i.getAttribute("slot")===e:i["s-sn"]===e?!0:e==="",Z5t=i=>{i.$attrs$&&i.$attrs$.ref&&i.$attrs$.ref(null),i.$children$&&i.$children$.map(Z5t)},Kvr=(i,e,t=!1)=>{var r,n,s,o;const a=i.$hostElement$,l=i.$cmpMeta$,u=i.$vnode$||U1e(null,null),c=$vr(e)?e:Ii(null,null,e);if(bSe=a.tagName,l.$attrsToReflect$&&(c.$attrs$=c.$attrs$||{},l.$attrsToReflect$.map(([h,p])=>c.$attrs$[p]=a[h])),t&&c.$attrs$)for(const h of Object.keys(c.$attrs$))a.hasAttribute(h)&&!["key","ref","style","class"].includes(h)&&(c.$attrs$[h]=a[h]);c.$tag$=null,c.$flags$|=4,i.$vnode$=c,c.$elm$=u.$elm$=a.shadowRoot||a,sU=a["s-sc"],U5t=a["s-cr"],z5t=(l.$flags$&1)!==0,G1e=!1,oU(u,c,t);{if(hy.$flags$|=1,SWe){K5t(c.$elm$);for(const h of ZO){const p=h.$nodeToRelocate$;if(!p["s-ol"]){const m=ZC.createTextNode("");m["s-nr"]=p,p.parentNode.insertBefore(p["s-ol"]=m,p)}}for(const h of ZO){const p=h.$nodeToRelocate$,m=h.$slotRefNode$;if(m){const v=m.parentNode;let w=m.nextSibling;{let S=(r=p["s-ol"])===null||r===void 0?void 0:r.previousSibling;for(;S;){let I=(n=S["s-nr"])!==null&&n!==void 0?n:null;if(I&&I["s-sn"]===p["s-sn"]&&v===I.parentNode&&(I=I.nextSibling,!I||!I["s-nr"])){w=I;break}S=S.previousSibling}}(!w&&v!==p.parentNode||p.nextSibling!==w)&&p!==w&&(!p["s-hn"]&&p["s-ol"]&&(p["s-hn"]=p["s-ol"].parentNode.nodeName),v.insertBefore(p,w),p.nodeType===1&&(p.hidden=(s=p["s-ih"])!==null&&s!==void 0?s:!1))}else p.nodeType===1&&(t&&(p["s-ih"]=(o=p.hidden)!==null&&o!==void 0?o:!1),p.hidden=!0)}}G1e&&J5t(c.$elm$),hy.$flags$&=-2,ZO.length=0}},Zvr=(i,e)=>{},IWe=(i,e)=>(i.$flags$|=16,Zvr(i,i.$ancestorComponent$),x1r(()=>Qvr(i,e))),Qvr=(i,e)=>{const t=i.$hostElement$,r=fB("scheduleUpdate",i.$cmpMeta$.$tagName$),n=t;let s;return e?s=YV(n,"componentWillLoad"):s=YV(n,"componentWillUpdate"),s=Nlt(s,()=>YV(n,"componentWillRender")),r(),Nlt(s,()=>t1r(i,n,e))},Nlt=(i,e)=>e1r(i)?i.then(e):e(),e1r=i=>i instanceof Promise||i&&i.then&&typeof i.then=="function",t1r=async(i,e,t)=>{const r=i.$hostElement$,n=fB("update",i.$cmpMeta$.$tagName$);r["s-rc"],t&&qvr(i);const s=fB("render",i.$cmpMeta$.$tagName$);i1r(i,e,r,t),s(),n(),r1r(i)},i1r=(i,e,t,r)=>{try{Mlt=e,e=e.render&&e.render(),i.$flags$&=-17,i.$flags$|=2,(R6.hasRenderFn||R6.reflect)&&(R6.vdomRender||R6.reflect)&&(R6.hydrateServerSide||Kvr(i,e,r))}catch(l){Bae(l,i.$hostElement$)}return Mlt=null,null},r1r=i=>{const e=i.$cmpMeta$.$tagName$,t=i.$hostElement$,r=fB("postUpdate",e),n=t;i.$ancestorComponent$,YV(n,"componentDidRender"),i.$flags$&64?(YV(n,"componentDidUpdate"),r()):(i.$flags$|=64,YV(n,"componentDidLoad"),r())},zY=i=>{{const e=VY(i),t=e.$hostElement$.isConnected;return t&&(e.$flags$&18)===2&&IWe(e,!1),t}},YV=(i,e,t)=>{if(i&&i[e])try{return i[e](t)}catch(r){Bae(r)}},n1r=(i,e)=>VY(i).$instanceValues$.get(e),s1r=(i,e,t,r)=>{const n=VY(i),s=i,o=n.$instanceValues$.get(e),a=n.$flags$,l=s;t=Uvr(t,r.$members$[e][0]);const u=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!u){n.$instanceValues$.set(e,t);{if(r.$watchers$&&a&128){const h=r.$watchers$[e];h&&h.map(p=>{try{l[p](t,o,e)}catch(m){Bae(m,s)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;IWe(n,!1)}}}},o1r=(i,e,t)=>{var r;const n=i.prototype;if(e.$members$){i.watchers&&(e.$watchers$=i.watchers);const s=Object.entries(e.$members$);s.map(([o,[a]])=>{(a&31||a&32)&&Object.defineProperty(n,o,{get(){return n1r(this,o)},set(l){s1r(this,o,l,e)},configurable:!0,enumerable:!0})});{const o=new Map;n.attributeChangedCallback=function(a,l,u){hy.jmp(()=>{var c;const h=o.get(a);if(this.hasOwnProperty(h))u=this[h],delete this[h];else{if(n.hasOwnProperty(h)&&typeof this[h]=="number"&&this[h]==u)return;if(h==null){const p=VY(this),m=p?.$flags$;if(m&&!(m&8)&&m&128&&u!==l){const w=this,S=(c=e.$watchers$)===null||c===void 0?void 0:c[a];S?.forEach(I=>{w[I]!=null&&w[I].call(w,u,l,a)})}return}}this[h]=u===null&&typeof this[h]=="boolean"?!1:u})},i.observedAttributes=Array.from(new Set([...Object.keys((r=e.$watchers$)!==null&&r!==void 0?r:{}),...s.filter(([a,l])=>l[0]&15).map(([a,l])=>{var u;const c=l[1]||a;return o.set(c,a),l[0]&512&&((u=e.$attrsToReflect$)===null||u===void 0||u.push([a,c])),c})]))}}return i},a1r=async(i,e,t,r)=>{let n;if(!(e.$flags$&32)&&(e.$flags$|=32,n=i.constructor,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=Gvr(i)]);const a=V5t(t,e.$modeName$);if(!V1e.has(a)){const l=fB("registerStyles",t.$tagName$);Hvr(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,IWe(e,!0)},$lt=i=>{},l1r=i=>{if(!(hy.$flags$&1)){const e=VY(i),t=e.$cmpMeta$,r=fB("connectedCallback",t.$tagName$);e.$flags$&1?(Q5t(i,e,t.$listeners$),e?.$lazyInstance$?$lt(e.$lazyInstance$):e?.$onReadyPromise$&&e.$onReadyPromise$.then(()=>$lt(e.$lazyInstance$))):(e.$flags$|=1,t.$flags$&12&&u1r(i),t.$members$&&Object.entries(t.$members$).map(([n,[s]])=>{if(s&31&&i.hasOwnProperty(n)){const o=i[n];delete i[n],i[n]=o}}),a1r(i,e,t)),r()}},u1r=i=>{const e=i["s-cr"]=ZC.createComment("");e["s-cn"]=!0,i.insertBefore(e,i.firstChild)},c1r=async i=>{if(!(hy.$flags$&1)){const e=VY(i);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},Xd=(i,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=i.$watchers$,t.$attrsToReflect$=[];const r=i.prototype.connectedCallback,n=i.prototype.disconnectedCallback;return Object.assign(i.prototype,{__registerHost(){m1r(this,t)},connectedCallback(){l1r(this),r&&r.call(this)},disconnectedCallback(){c1r(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),i.is=t.$tagName$,o1r(i,t)},h1r=(i,e)=>e,Q5t=(i,e,t,r)=>{t&&t.map(([n,s,o])=>{const a=p1r(i,n),l=d1r(e,o),u=f1r(n);hy.ael(a,s,l,u),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>hy.rel(a,s,l,u))})},d1r=(i,e)=>t=>{try{R6.lazyLoad||i.$hostElement$[e](t)}catch(r){Bae(r)}},p1r=(i,e)=>e&4?ZC:e&8?jae:e&16?ZC.body:i,f1r=i=>y1r?{passive:(i&1)!==0,capture:(i&2)!==0}:(i&2)!==0,eFt=new WeakMap,VY=i=>eFt.get(i),m1r=(i,e)=>{const t={$flags$:0,$hostElement$:i,$cmpMeta$:e,$instanceValues$:new Map};return Q5t(i,t,e.$listeners$),eFt.set(i,t)},Blt=(i,e)=>e in i,Bae=(i,e)=>(0,console.error)(i,e),V1e=new Map,g1r=[],jae=typeof window<"u"?window:{},ZC=jae.document||{head:{}},Jd=jae.HTMLElement||class{},hy={$flags$:0,$resourcesUrl$:"",jmp:i=>i(),raf:i=>requestAnimationFrame(i),ael:(i,e,t,r)=>i.addEventListener(e,t,r),rel:(i,e,t,r)=>i.removeEventListener(e,t,r),ce:(i,e)=>new CustomEvent(i,e)},y1r=(()=>{let i=!1;try{ZC.addEventListener("e",null,Object.defineProperty({},"passive",{get(){i=!0}}))}catch{}return i})(),v1r=i=>Promise.resolve(i),_1r=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),WNe=[],tFt=[],iFt=(i,e)=>t=>{i.push(t),HNe||(HNe=!0,e&&hy.$flags$&4?b1r(qNe):hy.raf(qNe))},jlt=i=>{for(let e=0;e{jlt(WNe),jlt(tFt),(HNe=WNe.length>0)&&hy.raf(qNe)},b1r=i=>v1r().then(i),w1r=iFt(WNe,!1),x1r=iFt(tFt,!0);/*! + */const B5t="calcite-mode-auto",j5t="calcite-mode-dark",Avr="calcite-mode-light",G5t={autoMode:B5t,darkMode:j5t,lightMode:Avr,rtl:"calcite--rtl",calciteAnimate:"calcite-animate",calciteAnimateIn:"calcite-animate__in",calciteAnimateInUp:"calcite-animate__in-up",calciteAnimateInDown:"calcite-animate__in-down",calciteAnimateInRight:"calcite-animate__in-right",calciteAnimateInLeft:"calcite-animate__in-left",calciteAnimateInScale:"calcite-animate__in-scale"},R6={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1};let sU,U5t,bSe,z5t=!1,G1e=!1,SWe=!1,Yw=!1,Mlt=null,HNe=!1;const TWe=i=>{const e=new URL(i,hy.$resourcesUrl$);return e.origin!==jae.location.origin?e.href:e.pathname},Mvr=i=>hy.$resourcesUrl$=i,fB=(i,e="")=>()=>{},Ovr="slot-fb{display:contents}slot-fb[hidden]{display:none}",Olt="http://www.w3.org/1999/xlink",Plt={},Pvr="http://www.w3.org/2000/svg",Rvr="http://www.w3.org/1999/xhtml",Dvr=i=>i!=null,CWe=i=>(i=typeof i,i==="object"||i==="function");function Fvr(i){var e,t,r;return(r=(t=(e=i.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||t===void 0?void 0:t.getAttribute("content"))!==null&&r!==void 0?r:void 0}const Ii=(i,e,...t)=>{let r=null,n=null,s=null,o=!1,a=!1;const l=[],u=h=>{for(let p=0;ph[p]).join(" "))}}if(typeof i=="function")return i(e===null?{}:e,l,Lvr);const c=U1e(i,null);return c.$attrs$=e,l.length>0&&(c.$children$=l),c.$key$=n,c.$name$=s,c},U1e=(i,e)=>{const t={$flags$:0,$tag$:i,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},Hb={},kvr=i=>i&&i.$tag$===Hb,Lvr={forEach:(i,e)=>i.map(Rlt).forEach(e),map:(i,e)=>i.map(Rlt).map(e).map(Nvr)},Rlt=i=>({vattrs:i.$attrs$,vchildren:i.$children$,vkey:i.$key$,vname:i.$name$,vtag:i.$tag$,vtext:i.$text$}),Nvr=i=>{if(typeof i.vtag=="function"){const t=Object.assign({},i.vattrs);return i.vkey&&(t.key=i.vkey),i.vname&&(t.name=i.vname),Ii(i.vtag,t,...i.vchildren||[])}const e=U1e(i.vtag,i.vtext);return e.$attrs$=i.vattrs,e.$children$=i.vchildren,e.$key$=i.vkey,e.$name$=i.vname,e},$vr=i=>p1r.map(e=>e(i)).find(e=>!!e),Bvr=(i,e)=>i!=null&&!CWe(i)?e&4?i==="false"?!1:i===""||!!i:e&2?parseFloat(i):e&1?String(i):i:i,jvr=i=>i,Ba=(i,e,t)=>{const r=jvr(i);return{emit:n=>Gvr(r,e,{bubbles:!!(t&4),composed:!!(t&2),cancelable:!!(t&1),detail:n})}},Gvr=(i,e,t)=>{const r=hy.ce(e,t);return i.dispatchEvent(r),r},Dlt=new WeakMap,Uvr=(i,e,t)=>{let r=V1e.get(i);g1r&&t?(r=r||new CSSStyleSheet,typeof r=="string"?r=e:r.replaceSync(e)):r=e,V1e.set(i,r)},zvr=(i,e,t)=>{var r;const n=V5t(e,t),s=V1e.get(n);if(i=i.nodeType===11?i:ZC,s)if(typeof s=="string"){i=i.head||i;let o=Dlt.get(i),a;if(o||Dlt.set(i,o=new Set),!o.has(n)){{a=ZC.createElement("style"),a.innerHTML=s;const l=(r=hy.$nonce$)!==null&&r!==void 0?r:Fvr(ZC);l!=null&&a.setAttribute("nonce",l),i.insertBefore(a,i.querySelector("link"))}e.$flags$&4&&(a.innerHTML+=Ovr),o&&o.add(n)}}else i.adoptedStyleSheets.includes(s)||(i.adoptedStyleSheets=[...i.adoptedStyleSheets,s]);return n},Vvr=i=>{const e=i.$cmpMeta$,t=i.$hostElement$,r=e.$flags$,n=fB("attachStyles",e.$tagName$),s=zvr(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,i.$modeName$);r&10&&(t["s-sc"]=s,t.classList.add(s+"-h"),r&2&&t.classList.add(s+"-s")),n()},V5t=(i,e)=>"sc-"+(e&&i.$flags$&32?i.$tagName$+"-"+e:i.$tagName$),Flt=(i,e,t,r,n,s)=>{if(t!==r){let o=Blt(i,e),a=e.toLowerCase();if(e==="class"){const l=i.classList,u=klt(t),c=klt(r);l.remove(...u.filter(h=>h&&!c.includes(h))),l.add(...c.filter(h=>h&&!u.includes(h)))}else if(e==="style"){for(const l in t)(!r||r[l]==null)&&(l.includes("-")?i.style.removeProperty(l):i.style[l]="");for(const l in r)(!t||r[l]!==t[l])&&(l.includes("-")?i.style.setProperty(l,r[l]):i.style[l]=r[l])}else if(e!=="key")if(e==="ref")r&&r(i);else if(!i.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n"){if(e[2]==="-"?e=e.slice(3):Blt(jae,a)?e=a.slice(2):e=a[2]+e.slice(3),t||r){const l=e.endsWith(H5t);e=e.replace(Wvr,""),t&&hy.rel(i,e,t,l),r&&hy.ael(i,e,r,l)}}else{const l=CWe(r);if((o||l&&r!==null)&&!n)try{if(i.tagName.includes("-"))i[e]=r;else{const c=r??"";e==="list"?o=!1:(t==null||i[e]!=c)&&(i[e]=c)}}catch{}let u=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,u=!0),r==null||r===!1?(r!==!1||i.getAttribute(e)==="")&&(u?i.removeAttributeNS(Olt,e):i.removeAttribute(e)):(!o||s&4||n)&&!l&&(r=r===!0?"":r,u?i.setAttributeNS(Olt,e,r):i.setAttribute(e,r))}}},Hvr=/\s/,klt=i=>i?i.split(Hvr):[],H5t="Capture",Wvr=new RegExp(H5t+"$"),W5t=(i,e,t,r)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=i&&i.$attrs$||Plt,o=e.$attrs$||Plt;for(r in s)r in o||Flt(n,r,s[r],void 0,t,e.$flags$);for(r in o)Flt(n,r,s[r],o[r],t,e.$flags$)},z1e=(i,e,t,r)=>{var n;const s=e.$children$[t];let o=0,a,l,u;if(z5t||(SWe=!0,s.$tag$==="slot"&&(sU&&r.classList.add(sU+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)a=s.$elm$=ZC.createTextNode(s.$text$);else if(s.$flags$&1)a=s.$elm$=ZC.createTextNode("");else{if(Yw||(Yw=s.$tag$==="svg"),a=s.$elm$=ZC.createElementNS(Yw?Pvr:Rvr,s.$flags$&2?"slot-fb":s.$tag$),Yw&&s.$tag$==="foreignObject"&&(Yw=!1),W5t(null,s,Yw),Dvr(sU)&&a["s-si"]!==sU&&a.classList.add(a["s-si"]=sU),s.$children$)for(o=0;o{var t;hy.$flags$|=1;const r=i.childNodes;for(let n=r.length-1;n>=0;n--){const s=r[n];s["s-hn"]!==bSe&&s["s-ol"]&&(X5t(s).insertBefore(s,EWe(s)),s["s-ol"].remove(),s["s-ol"]=void 0,s["s-sh"]=void 0,s.nodeType===1&&s.setAttribute("slot",(t=s["s-sn"])!==null&&t!==void 0?t:""),SWe=!0),e&&ise(s,e)}hy.$flags$&=-2},q5t=(i,e,t,r,n,s)=>{let o=i["s-cr"]&&i["s-cr"].parentNode||i,a;for(o.shadowRoot&&o.tagName===bSe&&(o=o.shadowRoot);n<=s;++n)r[n]&&(a=z1e(null,t,n,i),a&&(r[n].$elm$=a,o.insertBefore(a,EWe(e))))},Y5t=(i,e,t)=>{for(let r=e;r<=t;++r){const n=i[r];if(n){const s=n.$elm$;Z5t(n),s&&(G1e=!0,s["s-ol"]?s["s-ol"].remove():ise(s,!0),s.remove())}}},qvr=(i,e,t,r,n=!1)=>{let s=0,o=0,a=0,l=0,u=e.length-1,c=e[0],h=e[u],p=r.length-1,m=r[0],v=r[p],w,S;for(;s<=u&&o<=p;)if(c==null)c=e[++s];else if(h==null)h=e[--u];else if(m==null)m=r[++o];else if(v==null)v=r[--p];else if(Fhe(c,m,n))oU(c,m,n),c=e[++s],m=r[++o];else if(Fhe(h,v,n))oU(h,v,n),h=e[--u],v=r[--p];else if(Fhe(c,v,n))(c.$tag$==="slot"||v.$tag$==="slot")&&ise(c.$elm$.parentNode,!1),oU(c,v,n),i.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++s],v=r[--p];else if(Fhe(h,m,n))(c.$tag$==="slot"||v.$tag$==="slot")&&ise(h.$elm$.parentNode,!1),oU(h,m,n),i.insertBefore(h.$elm$,c.$elm$),h=e[--u],m=r[++o];else{for(a=-1,l=s;l<=u;++l)if(e[l]&&e[l].$key$!==null&&e[l].$key$===m.$key$){a=l;break}a>=0?(S=e[a],S.$tag$!==m.$tag$?w=z1e(e&&e[o],t,a,i):(oU(S,m,n),e[a]=void 0,w=S.$elm$),m=r[++o]):(w=z1e(e&&e[o],t,o,i),m=r[++o]),w&&X5t(c.$elm$).insertBefore(w,EWe(c.$elm$))}s>u?q5t(i,r[p+1]==null?null:r[p+1].$elm$,t,r,o,p):o>p&&Y5t(e,s,u)},Fhe=(i,e,t=!1)=>i.$tag$===e.$tag$?i.$tag$==="slot"?i.$name$===e.$name$:t?!0:i.$key$===e.$key$:!1,EWe=i=>i&&i["s-ol"]||i,X5t=i=>(i["s-ol"]?i["s-ol"]:i).parentNode,oU=(i,e,t=!1)=>{const r=e.$elm$=i.$elm$,n=i.$children$,s=e.$children$,o=e.$tag$,a=e.$text$;let l;a===null?(Yw=o==="svg"?!0:o==="foreignObject"?!1:Yw,o==="slot"||W5t(i,e,Yw),n!==null&&s!==null?qvr(r,n,e,s,t):s!==null?(i.$text$!==null&&(r.textContent=""),q5t(r,null,e,s,0,s.length-1)):n!==null&&Y5t(n,0,n.length-1),Yw&&o==="svg"&&(Yw=!1)):(l=r["s-cr"])?l.parentNode.textContent=a:i.$text$!==a&&(r.data=a)},J5t=i=>{const e=i.childNodes;for(const t of e)if(t.nodeType===1){if(t["s-sr"]){const r=t["s-sn"];t.hidden=!1;for(const n of e)if(n!==t){if(n["s-hn"]!==t["s-hn"]||r!==""){if(n.nodeType===1&&(r===n.getAttribute("slot")||r===n["s-sn"])){t.hidden=!0;break}}else if(n.nodeType===1||n.nodeType===3&&n.textContent.trim()!==""){t.hidden=!0;break}}}J5t(t)}},ZO=[],K5t=i=>{let e,t,r;for(const n of i.childNodes){if(n["s-sr"]&&(e=n["s-cr"])&&e.parentNode){t=e.parentNode.childNodes;const s=n["s-sn"];for(r=t.length-1;r>=0;r--)if(e=t[r],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==n["s-hn"]&&!R6.experimentalSlotFixes)if(Llt(e,s)){let o=ZO.find(a=>a.$nodeToRelocate$===e);G1e=!0,e["s-sn"]=e["s-sn"]||s,o?(o.$nodeToRelocate$["s-sh"]=n["s-hn"],o.$slotRefNode$=n):(e["s-sh"]=n["s-hn"],ZO.push({$slotRefNode$:n,$nodeToRelocate$:e})),e["s-sr"]&&ZO.map(a=>{Llt(a.$nodeToRelocate$,e["s-sn"])&&(o=ZO.find(l=>l.$nodeToRelocate$===e),o&&!a.$slotRefNode$&&(a.$slotRefNode$=o.$slotRefNode$))})}else ZO.some(o=>o.$nodeToRelocate$===e)||ZO.push({$nodeToRelocate$:e})}n.nodeType===1&&K5t(n)}},Llt=(i,e)=>i.nodeType===1?i.getAttribute("slot")===null&&e===""||i.getAttribute("slot")===e:i["s-sn"]===e?!0:e==="",Z5t=i=>{i.$attrs$&&i.$attrs$.ref&&i.$attrs$.ref(null),i.$children$&&i.$children$.map(Z5t)},Yvr=(i,e,t=!1)=>{var r,n,s,o;const a=i.$hostElement$,l=i.$cmpMeta$,u=i.$vnode$||U1e(null,null),c=kvr(e)?e:Ii(null,null,e);if(bSe=a.tagName,l.$attrsToReflect$&&(c.$attrs$=c.$attrs$||{},l.$attrsToReflect$.map(([h,p])=>c.$attrs$[p]=a[h])),t&&c.$attrs$)for(const h of Object.keys(c.$attrs$))a.hasAttribute(h)&&!["key","ref","style","class"].includes(h)&&(c.$attrs$[h]=a[h]);c.$tag$=null,c.$flags$|=4,i.$vnode$=c,c.$elm$=u.$elm$=a.shadowRoot||a,sU=a["s-sc"],U5t=a["s-cr"],z5t=(l.$flags$&1)!==0,G1e=!1,oU(u,c,t);{if(hy.$flags$|=1,SWe){K5t(c.$elm$);for(const h of ZO){const p=h.$nodeToRelocate$;if(!p["s-ol"]){const m=ZC.createTextNode("");m["s-nr"]=p,p.parentNode.insertBefore(p["s-ol"]=m,p)}}for(const h of ZO){const p=h.$nodeToRelocate$,m=h.$slotRefNode$;if(m){const v=m.parentNode;let w=m.nextSibling;{let S=(r=p["s-ol"])===null||r===void 0?void 0:r.previousSibling;for(;S;){let I=(n=S["s-nr"])!==null&&n!==void 0?n:null;if(I&&I["s-sn"]===p["s-sn"]&&v===I.parentNode&&(I=I.nextSibling,!I||!I["s-nr"])){w=I;break}S=S.previousSibling}}(!w&&v!==p.parentNode||p.nextSibling!==w)&&p!==w&&(!p["s-hn"]&&p["s-ol"]&&(p["s-hn"]=p["s-ol"].parentNode.nodeName),v.insertBefore(p,w),p.nodeType===1&&(p.hidden=(s=p["s-ih"])!==null&&s!==void 0?s:!1))}else p.nodeType===1&&(t&&(p["s-ih"]=(o=p.hidden)!==null&&o!==void 0?o:!1),p.hidden=!0)}}G1e&&J5t(c.$elm$),hy.$flags$&=-2,ZO.length=0}},Xvr=(i,e)=>{},IWe=(i,e)=>(i.$flags$|=16,Xvr(i,i.$ancestorComponent$),_1r(()=>Jvr(i,e))),Jvr=(i,e)=>{const t=i.$hostElement$,r=fB("scheduleUpdate",i.$cmpMeta$.$tagName$),n=t;let s;return e?s=YV(n,"componentWillLoad"):s=YV(n,"componentWillUpdate"),s=Nlt(s,()=>YV(n,"componentWillRender")),r(),Nlt(s,()=>Zvr(i,n,e))},Nlt=(i,e)=>Kvr(i)?i.then(e):e(),Kvr=i=>i instanceof Promise||i&&i.then&&typeof i.then=="function",Zvr=async(i,e,t)=>{const r=i.$hostElement$,n=fB("update",i.$cmpMeta$.$tagName$);r["s-rc"],t&&Vvr(i);const s=fB("render",i.$cmpMeta$.$tagName$);Qvr(i,e,r,t),s(),n(),e1r(i)},Qvr=(i,e,t,r)=>{try{Mlt=e,e=e.render&&e.render(),i.$flags$&=-17,i.$flags$|=2,(R6.hasRenderFn||R6.reflect)&&(R6.vdomRender||R6.reflect)&&(R6.hydrateServerSide||Yvr(i,e,r))}catch(l){Bae(l,i.$hostElement$)}return Mlt=null,null},e1r=i=>{const e=i.$cmpMeta$.$tagName$,t=i.$hostElement$,r=fB("postUpdate",e),n=t;i.$ancestorComponent$,YV(n,"componentDidRender"),i.$flags$&64?(YV(n,"componentDidUpdate"),r()):(i.$flags$|=64,YV(n,"componentDidLoad"),r())},zY=i=>{{const e=VY(i),t=e.$hostElement$.isConnected;return t&&(e.$flags$&18)===2&&IWe(e,!1),t}},YV=(i,e,t)=>{if(i&&i[e])try{return i[e](t)}catch(r){Bae(r)}},t1r=(i,e)=>VY(i).$instanceValues$.get(e),i1r=(i,e,t,r)=>{const n=VY(i),s=i,o=n.$instanceValues$.get(e),a=n.$flags$,l=s;t=Bvr(t,r.$members$[e][0]);const u=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!u){n.$instanceValues$.set(e,t);{if(r.$watchers$&&a&128){const h=r.$watchers$[e];h&&h.map(p=>{try{l[p](t,o,e)}catch(m){Bae(m,s)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;IWe(n,!1)}}}},r1r=(i,e,t)=>{var r;const n=i.prototype;if(e.$members$){i.watchers&&(e.$watchers$=i.watchers);const s=Object.entries(e.$members$);s.map(([o,[a]])=>{(a&31||a&32)&&Object.defineProperty(n,o,{get(){return t1r(this,o)},set(l){i1r(this,o,l,e)},configurable:!0,enumerable:!0})});{const o=new Map;n.attributeChangedCallback=function(a,l,u){hy.jmp(()=>{var c;const h=o.get(a);if(this.hasOwnProperty(h))u=this[h],delete this[h];else{if(n.hasOwnProperty(h)&&typeof this[h]=="number"&&this[h]==u)return;if(h==null){const p=VY(this),m=p?.$flags$;if(m&&!(m&8)&&m&128&&u!==l){const w=this,S=(c=e.$watchers$)===null||c===void 0?void 0:c[a];S?.forEach(I=>{w[I]!=null&&w[I].call(w,u,l,a)})}return}}this[h]=u===null&&typeof this[h]=="boolean"?!1:u})},i.observedAttributes=Array.from(new Set([...Object.keys((r=e.$watchers$)!==null&&r!==void 0?r:{}),...s.filter(([a,l])=>l[0]&15).map(([a,l])=>{var u;const c=l[1]||a;return o.set(c,a),l[0]&512&&((u=e.$attrsToReflect$)===null||u===void 0||u.push([a,c])),c})]))}}return i},n1r=async(i,e,t,r)=>{let n;if(!(e.$flags$&32)&&(e.$flags$|=32,n=i.constructor,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=$vr(i)]);const a=V5t(t,e.$modeName$);if(!V1e.has(a)){const l=fB("registerStyles",t.$tagName$);Uvr(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,IWe(e,!0)},$lt=i=>{},s1r=i=>{if(!(hy.$flags$&1)){const e=VY(i),t=e.$cmpMeta$,r=fB("connectedCallback",t.$tagName$);e.$flags$&1?(Q5t(i,e,t.$listeners$),e?.$lazyInstance$?$lt(e.$lazyInstance$):e?.$onReadyPromise$&&e.$onReadyPromise$.then(()=>$lt(e.$lazyInstance$))):(e.$flags$|=1,t.$flags$&12&&o1r(i),t.$members$&&Object.entries(t.$members$).map(([n,[s]])=>{if(s&31&&i.hasOwnProperty(n)){const o=i[n];delete i[n],i[n]=o}}),n1r(i,e,t)),r()}},o1r=i=>{const e=i["s-cr"]=ZC.createComment("");e["s-cn"]=!0,i.insertBefore(e,i.firstChild)},a1r=async i=>{if(!(hy.$flags$&1)){const e=VY(i);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},Xd=(i,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=i.$watchers$,t.$attrsToReflect$=[];const r=i.prototype.connectedCallback,n=i.prototype.disconnectedCallback;return Object.assign(i.prototype,{__registerHost(){d1r(this,t)},connectedCallback(){s1r(this),r&&r.call(this)},disconnectedCallback(){a1r(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),i.is=t.$tagName$,r1r(i,t)},l1r=(i,e)=>e,Q5t=(i,e,t,r)=>{t&&t.map(([n,s,o])=>{const a=c1r(i,n),l=u1r(e,o),u=h1r(n);hy.ael(a,s,l,u),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>hy.rel(a,s,l,u))})},u1r=(i,e)=>t=>{try{R6.lazyLoad||i.$hostElement$[e](t)}catch(r){Bae(r)}},c1r=(i,e)=>e&4?ZC:e&8?jae:e&16?ZC.body:i,h1r=i=>f1r?{passive:(i&1)!==0,capture:(i&2)!==0}:(i&2)!==0,eFt=new WeakMap,VY=i=>eFt.get(i),d1r=(i,e)=>{const t={$flags$:0,$hostElement$:i,$cmpMeta$:e,$instanceValues$:new Map};return Q5t(i,t,e.$listeners$),eFt.set(i,t)},Blt=(i,e)=>e in i,Bae=(i,e)=>(0,console.error)(i,e),V1e=new Map,p1r=[],jae=typeof window<"u"?window:{},ZC=jae.document||{head:{}},Jd=jae.HTMLElement||class{},hy={$flags$:0,$resourcesUrl$:"",jmp:i=>i(),raf:i=>requestAnimationFrame(i),ael:(i,e,t,r)=>i.addEventListener(e,t,r),rel:(i,e,t,r)=>i.removeEventListener(e,t,r),ce:(i,e)=>new CustomEvent(i,e)},f1r=(()=>{let i=!1;try{ZC.addEventListener("e",null,Object.defineProperty({},"passive",{get(){i=!0}}))}catch{}return i})(),m1r=i=>Promise.resolve(i),g1r=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),WNe=[],tFt=[],iFt=(i,e)=>t=>{i.push(t),HNe||(HNe=!0,e&&hy.$flags$&4?y1r(qNe):hy.raf(qNe))},jlt=i=>{for(let e=0;e{jlt(WNe),jlt(tFt),(HNe=WNe.length>0)&&hy.raf(qNe)},y1r=i=>m1r().then(i),v1r=iFt(WNe,!1),_1r=iFt(tFt,!0);/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */function Glt(){const{classList:i}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,t=()=>i.contains(j5t)||i.contains(B5t)&&e?"dark":"light",r=o=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:o}})),n=o=>{s!==o&&r(o),s=o};let s=t();r(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(t())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function S1r(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Glt():document.addEventListener("DOMContentLoaded",()=>Glt(),{once:!0}))}const T1r=S1r;T1r();let rFt;function C1r(){try{TWe(".")}catch{Rvr(xf(Fl(rFt)))}}function Y3(i){const e=[];for(const t of Object.keys(i))customElements.get(`calcite-${t}`)||e.push(i[t]?.());return e.length>0?Promise.all(e):null}rFt="components/assets";const nFt=Symbol("widget"),sFt=Symbol("widget-test-data"),E1r=[],I1r={},H1e=new WeakMap;function oFt(i,e){let t=e.children;if(t?.length)for(let n=0;naFt(i))),queueMicrotask(()=>{o[sFt].projector.renderNow()})}function M1r(i,e,t,{widgetProperties:r}){const n=H1e.get(i);n&&(n.set(r),n.afterUpdate?.(n,i))}function aFt(i){const e=H1e.get(i);e&&(e.afterRemoved?.(e,i),e.destroy(),H1e.delete(i))}function W1e(i){return typeof i=="function"&&i[nFt]}const i0={arrowDown:"esri-icon-arrow-down",arrowUp:"esri-icon-arrow-up",basemap:"esri-icon-basemap",bookmark:"esri-icon-bookmark",calendar:"esri-icon-calendar",checkMark:"esri-icon-check-mark",checkboxUnchecked:"esri-icon-checkbox-unchecked",close:"esri-icon-close",collapse:"esri-icon-collapse",defaultAction:"esri-icon-default-action",description:"esri-icon-description",directions:"esri-icon-directions",dockBottom:"esri-icon-dock-bottom",dockLeft:"esri-icon-dock-left",dockRight:"esri-icon-dock-right",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",download:"esri-icon-download",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",edit:"esri-icon-edit",elevationProfile:"esri-icon-elevation-profile",environmentSettings:"esri-icon-environment-settings",erase:"esri-icon-erase",error:"esri-icon-error",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",gear:"esri-icon-gear",handleHorizontal:"esri-icon-handle-horizontal",handleVertical:"esri-icon-handle-vertical",home:"esri-icon-home",icon:"esri-icon",launchLinkExternal:"esri-icon-launch-link-external",layerList:"esri-icon-layer-list",layers:"esri-icon-layers",left:"esri-icon-left",leftArrows:"esri-icon-left-arrow",leftTriangleArrow:"esri-icon-left-triangle-arrow",lineOfSight:"esri-icon-line-of-sight",link:"esri-icon-link",linkExternal:"esri-icon-link-external",linkHorizontal:"esri-icon-link-horizontal",loadingIndicator:"esri-icon-loading-indicator",locate:"esri-icon-locate",locateCircled:"esri-icon-locate-circled",locked:"esri-icon-locked",mapPin:"esri-icon-map-pin",maximize:"esri-icon-maximize",measure:"esri-icon-measure",measureArea:"esri-icon-measure-area",measureBuildingHeightShadow:"esri-icon-measure-building-height-shadow",measureLine:"esri-icon-measure-line",menu:"esri-icon-menu",minimize:"esri-icon-minimize",minus:"esri-icon-minus",nonVisible:"esri-icon-non-visible",northNavigation:"esri-icon-north-navigation",noticeTriangle:"esri-icon-notice-triangle",organization:"esri-icon-organization",pan:"esri-icon-pan",pan2:"esri-icon-pan2",partlyCloudy:"esri-icon-partly-cloudy",pause:"esri-icon-pause",play:"esri-icon-play",playCircled:"esri-icon-play-circled",plus:"esri-icon-plus",polyline:"esri-icon-polyline",printer:"esri-icon-printer",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",rightArrow:"esri-icon-right-arrow",rightTriangleArrow:"esri-icon-right-triangle-arrow",rotate:"esri-icon-rotate",save:"esri-icon-save",search:"esri-icon-search",settings2:"esri-icon-settings2",slice:"esri-icon-slice",swap:"esri-icon-swap",table:"esri-icon-table",timeClock:"esri-icon-time-clock",tracking:"esri-icon-tracking",trash:"esri-icon-trash",unlockedLinkHorizontal:"esri-icon-unlocked-link-horizontal",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",vertexGps:"esri-icon-vertex-gps",visible:"esri-icon-visible",zoomInFixed:"esri-icon-zoom-in-fixed",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomOutFixed:"esri-icon-zoom-out-fixed",zoomToObject:"esri-icon-zoom-to-object"},Ult=new Set;function O1r(i){Ult.add(i),i.finally(()=>Ult.delete(i))}var lFt;const P1r="esri.widgets.Widget";let R1r=0;const D1r={widgetIcon:i0.checkboxUnchecked};function uFt(i,e){for(const t in e)i[t]!=null&&(typeof i[t]=="object"&&typeof e[t]=="object"?uFt(i[t],e?.[t]):i[t]=e[t]);return i}const F1r=Ovr({postProcessProjectionOptions(i){const e=i.eventHandlerInterceptor,t=/capture$/i;i.eventHandlerInterceptor=(r,n,s,o)=>{const a=e?.(r,n,s,o),l=t.test(r);if(!((r=r.replace(t,"")).toLowerCase()in s)||l){const u=r[2].toLowerCase()+r.slice(3),c=m=>a?.call(s,m);s.addEventListener(u,c,l);const h=()=>s.removeEventListener(u,c,l),p=o.afterRemoved;o.afterRemoved=m=>{p?.(m),h()}}return a}},handleInterceptedEvent(i,e,t,r){const{eventPhase:n,type:s}=r,o=n===Event.CAPTURING_PHASE;let a=`on${s}${o?"capture":""}`;const l=e.properties;(l&&a in l||(a=`on${s[0].toUpperCase()}${s.slice(1)}${o?"Capture":""}`,l&&a in l))&&(y4t(),i.scheduleRender(),l[a].call(l.bind||t,r))}});let RMe=!1,Yf=class extends U3(rd.EventedAccessor){constructor(e,t){super(e,t),this._attached=!1,this._projector=F1r,this._readyForTrueRender=!1,this.iconClass=D1r.widgetIcon,this.icon=null,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=xd(async()=>{if(this._messageBundleProps?.length){const a=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:l,propertyName:u})=>{if(this.destroyed)return;let c=await Cze(l);this.uiStrings&&Object.keys(this.uiStrings)&&(c=uFt(li(c),this.uiStrings)),this[u]=c}));if(this.destroyed)return;for(const l of a)l.status==="rejected"&&di.getLogger(this).error("widget-intl:locale-error",this.declaredClass,l.reason)}await this.loadLocale()}),C1r();const r="esri-widget-uid-"+KB(),n=this.render.bind(this);this._trackingTarget=new t2e(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const a=n();let l=a.properties;l||(a.properties=l={});const{key:u}=l;if(u||(l.key=r),W1e(a.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?l.styles||(l.styles={}):(l.class="",l.styles={display:"none"}),l.styles.display||(l.styles.display="");let c=0;return a.children?.forEach(h=>{if(W1e(h.vnodeSelector))return;let{properties:p}=h;p||(h.properties=p={}),p.key||(p.key=`${this.id}--${c++}`)}),oFt(this,a)};this.render=()=>{if(RMe)return s();let a=emr(this)??null;if(a)return a;this._trackingTarget.clear(),RMe=!0;try{a=oR(this._trackingTarget,s)}catch(l){throw console.error(l),l}finally{RMe=!1}return a&&tmr(this,a),a};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this._readyForTrueRender=!0,this._postInitialize()}):(this._resourcesFetch=Promise.resolve().then(()=>{this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),O1r(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(l3):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||(zo(this._trackingTarget),zo(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,pMe(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return eWe(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+R1r++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(lFt=nFt,sFt)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(pMe(this),this._projector.scheduleRender())}own(e){zUe(di.getLogger(this),"`Widget.own()` is deprecated in favor of 'Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return v4t.apply(this,e)}renderNow(){pMe(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles(Ki(()=>this.viewModel,(t,r)=>{r&&this.removeHandles("delegated-events"),t&&e2e(t)&&this.addHandles(this._delegatedEventNames.map(n=>BA(t,n,s=>{this.emit(n,s)})),"delegated-events")},Ah)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(l3),this.scheduleRender()};this.addHandles([_ze(e),Ki(()=>this.uiStrings,e),v0(()=>this.container,t=>{this.destroyed||this._attach(t)},{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Yf[lFt]=!0,x([D()],Yf.prototype,"_readyForTrueRender",void 0),x([D({value:null})],Yf.prototype,"container",null),x([So("container")],Yf.prototype,"castContainer",null),x([D()],Yf.prototype,"iconClass",void 0),x([D()],Yf.prototype,"icon",void 0),x([D()],Yf.prototype,"id",null),x([D()],Yf.prototype,"label",null),x([D()],Yf.prototype,"renderable",null),x([D()],Yf.prototype,"uiStrings",void 0),x([D()],Yf.prototype,"viewModel",void 0),x([D({value:!0})],Yf.prototype,"visible",null),x([D()],Yf.prototype,"key",void 0),x([D()],Yf.prototype,"children",void 0),x([D()],Yf.prototype,"afterCreate",void 0),x([D()],Yf.prototype,"afterUpdate",void 0),x([D()],Yf.prototype,"afterRemoved",void 0),Yf=x([Qe(P1r)],Yf);const my=Yf,k1r=new Map;function L1r(i){return k1r.get(i)}function zlt(i,e){return i&&"copyright"in i&&(!e||typeof i.originOf=="function"&&i.originOf("copyright")==="user")}function N1r(i,e){return i.length!==e.length||i.some((t,r)=>t.text!==e[r].text)}function WJ(i,e,t){!t||!e||i.find(r=>r.layerView===e&&r.text===t)||i.push({text:t,layerView:e})}function $1r(i){return i.type==="bing-maps"}const wM=[];let aU=class extends un{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new dr,this.view=null,this._allLayerViewsChange=t=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const r=this.view?.allLayerViews;r&&(this.addHandles(r.map(n=>Ki(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),r.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),t?.removed&&t.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ju(()=>this.view?.allLayerViews,"change",t=>this._allLayerViewsChange(t),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),v0(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,t=e?.allLayerViews;if(wM.length=0,!e||!t)return void this._clear();t.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(zlt(s,"user"))return void WJ(wM,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?WJ(wM,n,this._getDynamicAttribution(a,e,s)):zlt(s)&&WJ(wM,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;WJ(wM,n,o||s.copyright)});const r=t.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&r){const n=L1r(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const h=c.id,p=!u.has(h)&&l&&c.extent&&rae(c.extent,l);return p&&u.add(h),p}).sort((c,h)=>h.score-c.score||c.objectId-h.objectId).map(c=>c.attribution).join(", "):""}};x([D({readOnly:!0,type:dr})],aU.prototype,"items",void 0),x([D({readOnly:!0})],aU.prototype,"state",null),x([D()],aU.prototype,"view",void 0),aU=x([Qe("esri.widgets.Attribution.AttributionViewModel")],aU);const cFt=aU,Xo={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",disabledElement:"esri-disabled-element",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",noBookmarksIcon:"esri-widget__no-bookmark-icon",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function B1r(){return function(i,e){if(!i[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:G1r(i[e])}}}function j1r(i){const e=i?.type;return i instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function G1r(i){return function(e,...t){j1r(e)?omr(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):i.call(this,e,...t)}}function Sg(i){return(e,t)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:i,propertyName:t})}}var U1r=function(i){return{vnodeSelector:"",properties:void 0,children:void 0,text:i.toString(),domNode:null}},hFt=function(i,e){for(var t=0,r=i.length;tr.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=qL.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new cFt}initialize(){this.addHandles(ju(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[qL.open]:this._isOpen};return er("div",{bind:this,class:this.classes(qL.base,Xo.widget,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return er("div",{class:qL.poweredBy},"Powered by"," ",er("a",{class:qL.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,r=t?0:void 0,{attributionText:n}=this,s={[qL.sourcesOpen]:e,[Xo.interactive]:t};return er("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(qL.sources,s),innerHTML:n,tabIndex:r})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:r,clientWidth:n,scrollWidth:s}=e,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(t=!0),this._isOpen){const l=r{let e=class extends i{constructor(...t){super(...t),this.goToOverride=null,this.view=null}callGoTo(t){const{view:r}=this;return Of(r),this.goToOverride?this.goToOverride(r,t):r.goTo(t.target,t.options)}};return x([D()],e.prototype,"goToOverride",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.widgets.support.GoTo")],e),e},q1r="esri.widgets.CompassViewModel";let h$=class extends dFt(un){constructor(e){super(e),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(Ki(()=>this.view,this._updateRotationWatcher,js))}destroy(){this.view=null}get canShowNorth(){return W1r(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){if(!this.view?.ready)return;const e={};this.view?.type==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const t=-e.heading;this.orientation={x:0,y:0,z:t}}_updateRotationWatcher(e){this.removeAllHandles(),e&&this.addHandles(e.type==="2d"?Ki(()=>e?.rotation,this._updateForRotation,js):Ki(()=>e?.camera,this._updateForCamera,js))}};x([D({readOnly:!0})],h$.prototype,"canShowNorth",null),x([D()],h$.prototype,"orientation",void 0),x([D({readOnly:!0})],h$.prototype,"state",null),x([D()],h$.prototype,"view",void 0),h$=x([Qe(q1r)],h$);const pFt=h$,Vlt="esri-compass",DMe={base:Vlt,widgetIcon:i0.locateCircled,iconContainer:`${Vlt}__icon-container`};let SI=class extends my{constructor(e,t){super(e,t),this.iconClass=DMe.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new pFt,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=r=>({transform:`rotateZ(${r.z}deg)`})}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle),icon:()=>Promise.resolve().then(()=>sEe)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,r=t==="rotation"?"arrow-up":"compass-needle",n=this.icon??r,{messages:s}=this;return er("div",{class:this.classes(DMe.base,Xo.widget)},er("calcite-button",{class:Xo.widgetButton,disabled:t==="disabled",kind:"neutral",label:s.reset,onclick:this._reset,round:!0,scale:"s",title:s.reset},er("div",{"aria-hidden":"true",class:DMe.iconContainer,title:s.reset},er("calcite-icon",{icon:n,scale:"m",styles:this._toRotationTransform(e)}))))}};x([D()],SI.prototype,"goToOverride",null),x([D()],SI.prototype,"iconClass",void 0),x([D()],SI.prototype,"icon",void 0),x([D()],SI.prototype,"label",null),x([D(),Sg("esri/widgets/Compass/t9n/Compass")],SI.prototype,"messages",void 0),x([D()],SI.prototype,"view",null),x([D({type:pFt})],SI.prototype,"viewModel",void 0),SI=x([Qe("esri.widgets.Compass")],SI);const Y1r=SI,Hlt="esri-navigation-toggle",FMe={base:Hlt,widgetIcon:i0.pan2,isLayoutHorizontal:`${Hlt}--horizontal`};let lU=class extends un{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.addHandles(v0(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){const e=this.view?.inputManager;e&&(e.primaryDragAction=this.navigationMode==="pan"?"pan":"rotate")}};x([D({readOnly:!0})],lU.prototype,"state",null),x([D()],lU.prototype,"navigationMode",void 0),x([D()],lU.prototype,"view",void 0),lU=x([Qe("esri.widgets.NavigationToggleViewModel")],lU);const fFt=lU;let TI=class extends my{constructor(e,t){super(e,t),this.iconClass=FMe.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new fFt,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{(this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton)?.setFocus(),this.toggle()}}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle)})}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.viewModel?.state==="disabled",t=this.viewModel?.navigationMode==="pan",r=this.messages.toggle;return er("div",{class:this.classes(FMe.base,Xo.widget,{[FMe.isLayoutHorizontal]:this.layout==="horizontal"})},er("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:t?"outline-fill":"solid",class:Xo.widgetButton,disabled:e,iconStart:"move",kind:"neutral",label:r,onclick:this._toggle,tabIndex:t?void 0:-1,title:r}),er("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:t?"solid":"outline-fill",class:Xo.widgetButton,disabled:e,iconStart:"rotate",kind:"neutral",label:r,onclick:this._toggle,tabIndex:t?-1:void 0,title:r}))}};x([D()],TI.prototype,"iconClass",void 0),x([D()],TI.prototype,"icon",void 0),x([D()],TI.prototype,"label",null),x([D({value:"vertical"})],TI.prototype,"layout",null),x([D(),Sg("esri/widgets/NavigationToggle/t9n/NavigationToggle")],TI.prototype,"messages",void 0),x([D()],TI.prototype,"view",null),x([D({type:fFt})],TI.prototype,"viewModel",void 0),TI=x([Qe("esri.widgets.NavigationToggle")],TI);const X1r=TI;let d$=class extends un{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:e}=this;if(!e?.ready)return!1;const r=e.constraints?.effectiveMinScale;return r===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle)})}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}set view(e){this.viewModel.view=e}get view(){return this.viewModel.view}render(){const e={[kMe.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:t,canZoomOut:r}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return er("div",{class:this.classes(kMe.base,Xo.widget,e)},er("calcite-button",{class:Xo.widgetButton,disabled:!t,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),er("calcite-button",{class:Xo.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};x([D()],CI.prototype,"iconClass",void 0),x([D()],CI.prototype,"icon",void 0),x([D()],CI.prototype,"label",null),x([D({value:"vertical"})],CI.prototype,"layout",null),x([D(),Sg("esri/widgets/Zoom/t9n/Zoom")],CI.prototype,"messages",void 0),x([D()],CI.prototype,"view",null),x([D({type:mFt})],CI.prototype,"viewModel",void 0),CI=x([Qe("esri.widgets.Zoom")],CI);const Z1r=CI;function Q1r(i){return i?.view!==void 0}let yge=class extends Tvr{constructor(e){super(e),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=t=>{this.components.forEach(r=>{const n=this._find(r),s=n?.widget;Q1r(s)&&(s.view=t)})},this._componentsWatcher=(t,r)=>{this._removeComponents(r),this._addComponents(t),this._adjustPadding(t)}}initialize(){this.addHandles([Ki(()=>this.components,this._componentsWatcher,js),Ki(()=>this.view,this._updateViewAwareWidgets,js)])}_add(e,t,r,n,s){let o=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;o=this._createComponent(e)}super._add(o,t,r,n,s)}_removeComponents(e){e.forEach(t=>{const r=this._find(t);r&&(this.remove(r),r.destroy())})}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(e){this.constructed&&e.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(e){const t=this._createWidget(e);return new gge({id:e,node:t})}_createWidget(e){const{view:t}=this;switch(e){case"attribution":return new H1r({view:t});case"compass":return new Y1r({view:t});case"navigation-toggle":return new X1r({view:t});case"zoom":return new Z1r({view:t})}}};x([D()],yge.prototype,"components",void 0),yge=x([Qe("esri.views.ui.DefaultUI")],yge);const gFt=yge;let vge=class extends gFt{constructor(e){super(e),this.components=["attribution","zoom"]}};x([D()],vge.prototype,"components",void 0),vge=x([Qe("esri.views.ui.2d.DefaultUI2D")],vge);const yFt=vge;var YNe;let _ge=YNe=class extends Ci{constructor(i){super(i),this.color=new jr([0,0,0,1])}clone(){return new YNe(li({color:this.color}))}};x([D({type:jr,json:{write:!0}})],_ge.prototype,"color",void 0),_ge=YNe=x([Qe("esri.webmap.background.ColorBackground")],_ge);const vFt=_ge;let _Ft,bFt,wFt,xFt,SFt,TFt;async function e_r(){const[,{GraphicsView2D:i,GraphicContainer:e,LabelManager:t,MapViewNavigation:r,MagnifierView2D:n,Stage:s}]=await Promise.all([Promise.resolve().then(()=>kqt),Promise.resolve().then(()=>ZYt)]);bFt=i,wFt=e,xFt=t,SFt=r,TFt=n,_Ft=s}let Ca=class extends afr(kmr(wmr(agr))){constructor(e){super(e),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new _E({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new fge({view:this}),this.graphicsView=null,this.stateManager=new d1({constraints:new l5t({view:this})}),this.stationaryManager=new VQ,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new yyr(this),this.floors=new dr,this.highlightOptions=new tse,this.inputManager=new k0r({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new xWe,this.type="2d",this.ui=new yFt,this.test={takeScreenshot:async t=>lvr(this._getScreenshotView(t),t)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([Ki(()=>this.viewpoint,()=>this.stationaryManager.flip(),Kl),this.on("resize",t=>this.stateManager.resize(t.width,t.height))]),Vrr()}destroy(){this._set("preconditionsReady",!1),this.frameTask=zo(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new G0r(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:r,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(t?.effectiveLODs||(o=-1),(!r||e===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,r=this.spatialReference;return LPt(t.spatialReference,r)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",e),this.frameTask.animationInProgress=!0;const r=()=>{this.destroyed||(e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask.animationInProgress=!1)};e.when(r,r)}get background(){return jst(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(t=>!t.destroyed&&!("layerViews"in t)&&t.updating===!0));if(yi("esri-2d-log-updating")){const t=this.allLayerViews.reduce((r,n)=>({...r,[`${n.layer.id}(${n.layer.type})`]:!n.destroyed&&!("layerViews"in n)&&n.updating}),{});console.log(`Updating MapView: ${e} + */function Glt(){const{classList:i}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,t=()=>i.contains(j5t)||i.contains(B5t)&&e?"dark":"light",r=o=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:o}})),n=o=>{s!==o&&r(o),s=o};let s=t();r(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(t())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function b1r(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Glt():document.addEventListener("DOMContentLoaded",()=>Glt(),{once:!0}))}const w1r=b1r;w1r();let rFt;function x1r(){try{TWe(".")}catch{Mvr(xf(Fl(rFt)))}}function Y3(i){const e=[];for(const t of Object.keys(i))customElements.get(`calcite-${t}`)||e.push(i[t]?.());return e.length>0?Promise.all(e):null}rFt="components/assets";const nFt=Symbol("widget"),sFt=Symbol("widget-test-data"),S1r=[],T1r={},H1e=new WeakMap;function oFt(i,e){let t=e.children;if(t?.length)for(let n=0;naFt(i))),queueMicrotask(()=>{o[sFt].projector.renderNow()})}function E1r(i,e,t,{widgetProperties:r}){const n=H1e.get(i);n&&(n.set(r),n.afterUpdate?.(n,i))}function aFt(i){const e=H1e.get(i);e&&(e.afterRemoved?.(e,i),e.destroy(),H1e.delete(i))}function W1e(i){return typeof i=="function"&&i[nFt]}const i0={arrowDown:"esri-icon-arrow-down",arrowUp:"esri-icon-arrow-up",basemap:"esri-icon-basemap",bookmark:"esri-icon-bookmark",calendar:"esri-icon-calendar",checkMark:"esri-icon-check-mark",checkboxUnchecked:"esri-icon-checkbox-unchecked",close:"esri-icon-close",collapse:"esri-icon-collapse",defaultAction:"esri-icon-default-action",description:"esri-icon-description",directions:"esri-icon-directions",dockBottom:"esri-icon-dock-bottom",dockLeft:"esri-icon-dock-left",dockRight:"esri-icon-dock-right",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",download:"esri-icon-download",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",edit:"esri-icon-edit",elevationProfile:"esri-icon-elevation-profile",environmentSettings:"esri-icon-environment-settings",erase:"esri-icon-erase",error:"esri-icon-error",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",gear:"esri-icon-gear",handleHorizontal:"esri-icon-handle-horizontal",handleVertical:"esri-icon-handle-vertical",home:"esri-icon-home",icon:"esri-icon",launchLinkExternal:"esri-icon-launch-link-external",layerList:"esri-icon-layer-list",layers:"esri-icon-layers",left:"esri-icon-left",leftArrows:"esri-icon-left-arrow",leftTriangleArrow:"esri-icon-left-triangle-arrow",lineOfSight:"esri-icon-line-of-sight",link:"esri-icon-link",linkExternal:"esri-icon-link-external",linkHorizontal:"esri-icon-link-horizontal",loadingIndicator:"esri-icon-loading-indicator",locate:"esri-icon-locate",locateCircled:"esri-icon-locate-circled",locked:"esri-icon-locked",mapPin:"esri-icon-map-pin",maximize:"esri-icon-maximize",measure:"esri-icon-measure",measureArea:"esri-icon-measure-area",measureBuildingHeightShadow:"esri-icon-measure-building-height-shadow",measureLine:"esri-icon-measure-line",menu:"esri-icon-menu",minimize:"esri-icon-minimize",minus:"esri-icon-minus",nonVisible:"esri-icon-non-visible",northNavigation:"esri-icon-north-navigation",noticeTriangle:"esri-icon-notice-triangle",organization:"esri-icon-organization",pan:"esri-icon-pan",pan2:"esri-icon-pan2",partlyCloudy:"esri-icon-partly-cloudy",pause:"esri-icon-pause",play:"esri-icon-play",playCircled:"esri-icon-play-circled",plus:"esri-icon-plus",polyline:"esri-icon-polyline",printer:"esri-icon-printer",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",rightArrow:"esri-icon-right-arrow",rightTriangleArrow:"esri-icon-right-triangle-arrow",rotate:"esri-icon-rotate",save:"esri-icon-save",search:"esri-icon-search",settings2:"esri-icon-settings2",slice:"esri-icon-slice",swap:"esri-icon-swap",table:"esri-icon-table",timeClock:"esri-icon-time-clock",tracking:"esri-icon-tracking",trash:"esri-icon-trash",unlockedLinkHorizontal:"esri-icon-unlocked-link-horizontal",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",vertexGps:"esri-icon-vertex-gps",visible:"esri-icon-visible",zoomInFixed:"esri-icon-zoom-in-fixed",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomOutFixed:"esri-icon-zoom-out-fixed",zoomToObject:"esri-icon-zoom-to-object"},Ult=new Set;function I1r(i){Ult.add(i),i.finally(()=>Ult.delete(i))}var lFt;const A1r="esri.widgets.Widget";let M1r=0;const O1r={widgetIcon:i0.checkboxUnchecked};function uFt(i,e){for(const t in e)i[t]!=null&&(typeof i[t]=="object"&&typeof e[t]=="object"?uFt(i[t],e?.[t]):i[t]=e[t]);return i}const P1r=Ivr({postProcessProjectionOptions(i){const e=i.eventHandlerInterceptor,t=/capture$/i;i.eventHandlerInterceptor=(r,n,s,o)=>{const a=e?.(r,n,s,o),l=t.test(r);if(!((r=r.replace(t,"")).toLowerCase()in s)||l){const u=r[2].toLowerCase()+r.slice(3),c=m=>a?.call(s,m);s.addEventListener(u,c,l);const h=()=>s.removeEventListener(u,c,l),p=o.afterRemoved;o.afterRemoved=m=>{p?.(m),h()}}return a}},handleInterceptedEvent(i,e,t,r){const{eventPhase:n,type:s}=r,o=n===Event.CAPTURING_PHASE;let a=`on${s}${o?"capture":""}`;const l=e.properties;(l&&a in l||(a=`on${s[0].toUpperCase()}${s.slice(1)}${o?"Capture":""}`,l&&a in l))&&(y4t(),i.scheduleRender(),l[a].call(l.bind||t,r))}});let RMe=!1,Yf=class extends U3(rd.EventedAccessor){constructor(e,t){super(e,t),this._attached=!1,this._projector=P1r,this._readyForTrueRender=!1,this.iconClass=O1r.widgetIcon,this.icon=null,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=xd(async()=>{if(this._messageBundleProps?.length){const a=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:l,propertyName:u})=>{if(this.destroyed)return;let c=await Cze(l);this.uiStrings&&Object.keys(this.uiStrings)&&(c=uFt(li(c),this.uiStrings)),this[u]=c}));if(this.destroyed)return;for(const l of a)l.status==="rejected"&&di.getLogger(this).error("widget-intl:locale-error",this.declaredClass,l.reason)}await this.loadLocale()}),x1r();const r="esri-widget-uid-"+KB(),n=this.render.bind(this);this._trackingTarget=new t2e(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const s=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const a=n();let l=a.properties;l||(a.properties=l={});const{key:u}=l;if(u||(l.key=r),W1e(a.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?l.styles||(l.styles={}):(l.class="",l.styles={display:"none"}),l.styles.display||(l.styles.display="");let c=0;return a.children?.forEach(h=>{if(W1e(h.vnodeSelector))return;let{properties:p}=h;p||(h.properties=p={}),p.key||(p.key=`${this.id}--${c++}`)}),oFt(this,a)};this.render=()=>{if(RMe)return s();let a=Kfr(this)??null;if(a)return a;this._trackingTarget.clear(),RMe=!0;try{a=oR(this._trackingTarget,s)}catch(l){throw console.error(l),l}finally{RMe=!1}return a&&Zfr(this,a),a};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this._readyForTrueRender=!0,this._postInitialize()}):(this._resourcesFetch=Promise.resolve().then(()=>{this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),I1r(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(l3):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||(zo(this._trackingTarget),zo(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,pMe(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return eWe(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+M1r++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(lFt=nFt,sFt)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(pMe(this),this._projector.scheduleRender())}own(e){zUe(di.getLogger(this),"`Widget.own()` is deprecated in favor of 'Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return v4t.apply(this,e)}renderNow(){pMe(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles(Ki(()=>this.viewModel,(t,r)=>{r&&this.removeHandles("delegated-events"),t&&e2e(t)&&this.addHandles(this._delegatedEventNames.map(n=>BA(t,n,s=>{this.emit(n,s)})),"delegated-events")},Ah)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(l3),this.scheduleRender()};this.addHandles([_ze(e),Ki(()=>this.uiStrings,e),v0(()=>this.container,t=>{this.destroyed||this._attach(t)},{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Yf[lFt]=!0,x([D()],Yf.prototype,"_readyForTrueRender",void 0),x([D({value:null})],Yf.prototype,"container",null),x([So("container")],Yf.prototype,"castContainer",null),x([D()],Yf.prototype,"iconClass",void 0),x([D()],Yf.prototype,"icon",void 0),x([D()],Yf.prototype,"id",null),x([D()],Yf.prototype,"label",null),x([D()],Yf.prototype,"renderable",null),x([D()],Yf.prototype,"uiStrings",void 0),x([D()],Yf.prototype,"viewModel",void 0),x([D({value:!0})],Yf.prototype,"visible",null),x([D()],Yf.prototype,"key",void 0),x([D()],Yf.prototype,"children",void 0),x([D()],Yf.prototype,"afterCreate",void 0),x([D()],Yf.prototype,"afterUpdate",void 0),x([D()],Yf.prototype,"afterRemoved",void 0),Yf=x([Qe(A1r)],Yf);const my=Yf,R1r=new Map;function D1r(i){return R1r.get(i)}function zlt(i,e){return i&&"copyright"in i&&(!e||typeof i.originOf=="function"&&i.originOf("copyright")==="user")}function F1r(i,e){return i.length!==e.length||i.some((t,r)=>t.text!==e[r].text)}function WJ(i,e,t){!t||!e||i.find(r=>r.layerView===e&&r.text===t)||i.push({text:t,layerView:e})}function k1r(i){return i.type==="bing-maps"}const wM=[];let aU=class extends un{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new dr,this.view=null,this._allLayerViewsChange=t=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const r=this.view?.allLayerViews;r&&(this.addHandles(r.map(n=>Ki(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),r.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),t?.removed&&t.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ju(()=>this.view?.allLayerViews,"change",t=>this._allLayerViewsChange(t),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),v0(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,t=e?.allLayerViews;if(wM.length=0,!e||!t)return void this._clear();t.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(zlt(s,"user"))return void WJ(wM,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?WJ(wM,n,this._getDynamicAttribution(a,e,s)):zlt(s)&&WJ(wM,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;WJ(wM,n,o||s.copyright)});const r=t.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&r){const n=D1r(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const h=c.id,p=!u.has(h)&&l&&c.extent&&rae(c.extent,l);return p&&u.add(h),p}).sort((c,h)=>h.score-c.score||c.objectId-h.objectId).map(c=>c.attribution).join(", "):""}};x([D({readOnly:!0,type:dr})],aU.prototype,"items",void 0),x([D({readOnly:!0})],aU.prototype,"state",null),x([D()],aU.prototype,"view",void 0),aU=x([Qe("esri.widgets.Attribution.AttributionViewModel")],aU);const cFt=aU,Xo={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",disabledElement:"esri-disabled-element",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",noBookmarksIcon:"esri-widget__no-bookmark-icon",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function L1r(){return function(i,e){if(!i[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:$1r(i[e])}}}function N1r(i){const e=i?.type;return i instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function $1r(i){return function(e,...t){N1r(e)?rmr(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):i.call(this,e,...t)}}function Sg(i){return(e,t)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:i,propertyName:t})}}var B1r=function(i){return{vnodeSelector:"",properties:void 0,children:void 0,text:i.toString(),domNode:null}},hFt=function(i,e){for(var t=0,r=i.length;tr.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=qL.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new cFt}initialize(){this.addHandles(ju(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[qL.open]:this._isOpen};return er("div",{bind:this,class:this.classes(qL.base,Xo.widget,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return er("div",{class:qL.poweredBy},"Powered by"," ",er("a",{class:qL.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,r=t?0:void 0,{attributionText:n}=this,s={[qL.sourcesOpen]:e,[Xo.interactive]:t};return er("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(qL.sources,s),innerHTML:n,tabIndex:r})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:r,clientWidth:n,scrollWidth:s}=e,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(t=!0),this._isOpen){const l=r{let e=class extends i{constructor(...t){super(...t),this.goToOverride=null,this.view=null}callGoTo(t){const{view:r}=this;return Of(r),this.goToOverride?this.goToOverride(r,t):r.goTo(t.target,t.options)}};return x([D()],e.prototype,"goToOverride",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.widgets.support.GoTo")],e),e},V1r="esri.widgets.CompassViewModel";let h$=class extends dFt(un){constructor(e){super(e),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(Ki(()=>this.view,this._updateRotationWatcher,js))}destroy(){this.view=null}get canShowNorth(){return z1r(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){if(!this.view?.ready)return;const e={};this.view?.type==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const t=-e.heading;this.orientation={x:0,y:0,z:t}}_updateRotationWatcher(e){this.removeAllHandles(),e&&this.addHandles(e.type==="2d"?Ki(()=>e?.rotation,this._updateForRotation,js):Ki(()=>e?.camera,this._updateForCamera,js))}};x([D({readOnly:!0})],h$.prototype,"canShowNorth",null),x([D()],h$.prototype,"orientation",void 0),x([D({readOnly:!0})],h$.prototype,"state",null),x([D()],h$.prototype,"view",void 0),h$=x([Qe(V1r)],h$);const pFt=h$,Vlt="esri-compass",DMe={base:Vlt,widgetIcon:i0.locateCircled,iconContainer:`${Vlt}__icon-container`};let SI=class extends my{constructor(e,t){super(e,t),this.iconClass=DMe.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new pFt,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=r=>({transform:`rotateZ(${r.z}deg)`})}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle),icon:()=>Promise.resolve().then(()=>sEe)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,r=t==="rotation"?"arrow-up":"compass-needle",n=this.icon??r,{messages:s}=this;return er("div",{class:this.classes(DMe.base,Xo.widget)},er("calcite-button",{class:Xo.widgetButton,disabled:t==="disabled",kind:"neutral",label:s.reset,onclick:this._reset,round:!0,scale:"s",title:s.reset},er("div",{"aria-hidden":"true",class:DMe.iconContainer,title:s.reset},er("calcite-icon",{icon:n,scale:"m",styles:this._toRotationTransform(e)}))))}};x([D()],SI.prototype,"goToOverride",null),x([D()],SI.prototype,"iconClass",void 0),x([D()],SI.prototype,"icon",void 0),x([D()],SI.prototype,"label",null),x([D(),Sg("esri/widgets/Compass/t9n/Compass")],SI.prototype,"messages",void 0),x([D()],SI.prototype,"view",null),x([D({type:pFt})],SI.prototype,"viewModel",void 0),SI=x([Qe("esri.widgets.Compass")],SI);const H1r=SI,Hlt="esri-navigation-toggle",FMe={base:Hlt,widgetIcon:i0.pan2,isLayoutHorizontal:`${Hlt}--horizontal`};let lU=class extends un{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.addHandles(v0(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){const e=this.view?.inputManager;e&&(e.primaryDragAction=this.navigationMode==="pan"?"pan":"rotate")}};x([D({readOnly:!0})],lU.prototype,"state",null),x([D()],lU.prototype,"navigationMode",void 0),x([D()],lU.prototype,"view",void 0),lU=x([Qe("esri.widgets.NavigationToggleViewModel")],lU);const fFt=lU;let TI=class extends my{constructor(e,t){super(e,t),this.iconClass=FMe.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new fFt,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{(this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton)?.setFocus(),this.toggle()}}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle)})}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.viewModel?.state==="disabled",t=this.viewModel?.navigationMode==="pan",r=this.messages.toggle;return er("div",{class:this.classes(FMe.base,Xo.widget,{[FMe.isLayoutHorizontal]:this.layout==="horizontal"})},er("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:t?"outline-fill":"solid",class:Xo.widgetButton,disabled:e,iconStart:"move",kind:"neutral",label:r,onclick:this._toggle,tabIndex:t?void 0:-1,title:r}),er("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:t?"solid":"outline-fill",class:Xo.widgetButton,disabled:e,iconStart:"rotate",kind:"neutral",label:r,onclick:this._toggle,tabIndex:t?-1:void 0,title:r}))}};x([D()],TI.prototype,"iconClass",void 0),x([D()],TI.prototype,"icon",void 0),x([D()],TI.prototype,"label",null),x([D({value:"vertical"})],TI.prototype,"layout",null),x([D(),Sg("esri/widgets/NavigationToggle/t9n/NavigationToggle")],TI.prototype,"messages",void 0),x([D()],TI.prototype,"view",null),x([D({type:fFt})],TI.prototype,"viewModel",void 0),TI=x([Qe("esri.widgets.NavigationToggle")],TI);const W1r=TI;let d$=class extends un{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:e}=this;if(!e?.ready)return!1;const r=e.constraints?.effectiveMinScale;return r===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle)})}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}set view(e){this.viewModel.view=e}get view(){return this.viewModel.view}render(){const e={[kMe.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:t,canZoomOut:r}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return er("div",{class:this.classes(kMe.base,Xo.widget,e)},er("calcite-button",{class:Xo.widgetButton,disabled:!t,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),er("calcite-button",{class:Xo.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};x([D()],CI.prototype,"iconClass",void 0),x([D()],CI.prototype,"icon",void 0),x([D()],CI.prototype,"label",null),x([D({value:"vertical"})],CI.prototype,"layout",null),x([D(),Sg("esri/widgets/Zoom/t9n/Zoom")],CI.prototype,"messages",void 0),x([D()],CI.prototype,"view",null),x([D({type:mFt})],CI.prototype,"viewModel",void 0),CI=x([Qe("esri.widgets.Zoom")],CI);const X1r=CI;function J1r(i){return i?.view!==void 0}let yge=class extends wvr{constructor(e){super(e),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=t=>{this.components.forEach(r=>{const n=this._find(r),s=n?.widget;J1r(s)&&(s.view=t)})},this._componentsWatcher=(t,r)=>{this._removeComponents(r),this._addComponents(t),this._adjustPadding(t)}}initialize(){this.addHandles([Ki(()=>this.components,this._componentsWatcher,js),Ki(()=>this.view,this._updateViewAwareWidgets,js)])}_add(e,t,r,n,s){let o=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;o=this._createComponent(e)}super._add(o,t,r,n,s)}_removeComponents(e){e.forEach(t=>{const r=this._find(t);r&&(this.remove(r),r.destroy())})}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(e){this.constructed&&e.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(e){const t=this._createWidget(e);return new gge({id:e,node:t})}_createWidget(e){const{view:t}=this;switch(e){case"attribution":return new U1r({view:t});case"compass":return new H1r({view:t});case"navigation-toggle":return new W1r({view:t});case"zoom":return new X1r({view:t})}}};x([D()],yge.prototype,"components",void 0),yge=x([Qe("esri.views.ui.DefaultUI")],yge);const gFt=yge;let vge=class extends gFt{constructor(e){super(e),this.components=["attribution","zoom"]}};x([D()],vge.prototype,"components",void 0),vge=x([Qe("esri.views.ui.2d.DefaultUI2D")],vge);const yFt=vge;var YNe;let _ge=YNe=class extends Ci{constructor(i){super(i),this.color=new jr([0,0,0,1])}clone(){return new YNe(li({color:this.color}))}};x([D({type:jr,json:{write:!0}})],_ge.prototype,"color",void 0),_ge=YNe=x([Qe("esri.webmap.background.ColorBackground")],_ge);const vFt=_ge;let _Ft,bFt,wFt,xFt,SFt,TFt;async function K1r(){const[,{GraphicsView2D:i,GraphicContainer:e,LabelManager:t,MapViewNavigation:r,MagnifierView2D:n,Stage:s}]=await Promise.all([Promise.resolve().then(()=>kqt),Promise.resolve().then(()=>ZYt)]);bFt=i,wFt=e,xFt=t,SFt=r,TFt=n,_Ft=s}let Ca=class extends nfr(Rmr(vmr(ngr))){constructor(e){super(e),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new _E({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new fge({view:this}),this.graphicsView=null,this.stateManager=new d1({constraints:new l5t({view:this})}),this.stationaryManager=new VQ,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new fyr(this),this.floors=new dr,this.highlightOptions=new tse,this.inputManager=new R0r({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new xWe,this.type="2d",this.ui=new yFt,this.test={takeScreenshot:async t=>svr(this._getScreenshotView(t),t)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([Ki(()=>this.viewpoint,()=>this.stationaryManager.flip(),Kl),this.on("resize",t=>this.stateManager.resize(t.width,t.height))]),Grr()}destroy(){this._set("preconditionsReady",!1),this.frameTask=zo(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new $0r(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:r,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(t?.effectiveLODs||(o=-1),(!r||e===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,r=this.spatialReference;return LPt(t.spatialReference,r)}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),e!==this.animationManager.animation&&this.animationManager.stop(),!e||e.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",e),this.frameTask.animationInProgress=!0;const r=()=>{this.destroyed||(e===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame()),this.frameTask.animationInProgress=!1)};e.when(r,r)}get background(){return jst(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get constraints(){return this.stateManager?.constraints}set constraints(e){e.view=this;const t=this.stateManager.constraints;this.stateManager.constraints=e,t?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(e){this.stateManager.extent=e}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(e){this.stateManager.resizeAlign=e}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(e){const{rotationEnabled:t}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=e,this.constraints.rotationEnabled=t}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(t=>!t.destroyed&&!("layerViews"in t)&&t.updating===!0));if(yi("esri-2d-log-updating")){const t=this.allLayerViews.reduce((r,n)=>({...r,[`${n.layer.id}(${n.layer.type})`]:!n.destroyed&&!("layerViews"in n)&&n.updating}),{});console.log(`Updating MapView: ${e} -> Null LayerViewManager: ${!this.layerViewManager} -> Null LabelManager: ${!this.labelManager} -> Null GraphicsView: ${!this.graphicsView} @@ -77,55 +77,55 @@ import{d as da,u as uTt,r as sY,a as oY,o as pr,c as wr,w as Sm,n as Jl,b as xc, -> labelManager.updating: ${this.labelManager?.updating} -> graphicsView.updating: ${this.graphicsView?.updating} -> allLayerViews: ${JSON.stringify(t)} -`)}return e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(e){this.stateManager.viewpoint=e,this.frameTask.requestFrame()}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}goTo(e,t){return this.goToManager.goTo(e,t)}async hitTest(e,t){return U0r(this,e,t)}async takeScreenshot(e){return avr(this._getScreenshotView(e),e)}toMap(e){if(!this.ready)return null;const t=R4t(e)?P4t(this,e):e;return this.stateManager.toMap(t)}toScreen(e,t){return this.stateManager.toScreen(e,t)}on(e,t,r,n){return this.inputManager&&this.viewEvents.on(e,t,r,n)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){this.graphicsView&&this.graphicsView.graphicUpdateHandler(e)}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return jst(this.map)?this.map.initialViewProperties.timeZone:null}hasLayerViewModule(e){return llt.hasLayerViewModule(e)}importLayerView(e){return llt.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(di.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),r=await this.hitTest(e),n=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(n.map(u=>[u.layer.uid,u])),o=[];let a=0,l=0;for(;athis._updateStageChildren()),t.on("webgl-error",a=>this.fatalError=a.error),Ki(()=>this.stationary,a=>t.stationary=a,Ah),Ki(()=>this.background,a=>{t.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},Ah),Ki(()=>this.magnifier,a=>this._magnifierView.magnifier=a,Ah),Ki(()=>this.renderingOptions,a=>t.renderingOptions=a,Ah),Ki(()=>this.highlightOptions,a=>t.highlightOptions=a,Ah),Ki(()=>this.state.id,()=>t.state=this.state,Ah)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(t=>{this.stage.addChild(t.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new ak(fu.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new bFt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new wFt(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:r,size:n,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:r,size:n,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const t of this.allLayerViews)t.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const t of this.allLayerViews)t.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};Ca.type="2d",x([D({readOnly:!0})],Ca.prototype,"animationManager",void 0),x([D({constructOnly:!0})],Ca.prototype,"deactivatedWebGLExtensions",void 0),x([D({constructOnly:!0})],Ca.prototype,"debugWebGLExtensions",void 0),x([D({readOnly:!0})],Ca.prototype,"featuresTilingScheme",void 0),x([D({readOnly:!0})],Ca.prototype,"fullOpacity",void 0),x([D()],Ca.prototype,"goToManager",void 0),x([D({readOnly:!0})],Ca.prototype,"graphicsTileStore",null),x([D()],Ca.prototype,"graphicsView",void 0),x([D()],Ca.prototype,"stateManager",void 0),x([D()],Ca.prototype,"constraintsInfo",null),x([D({readOnly:!0})],Ca.prototype,"state",null),x([D()],Ca.prototype,"initialExtentRequired",null),x([D()],Ca.prototype,"labelManager",void 0),x([D({readOnly:!0})],Ca.prototype,"mapViewNavigation",void 0),x([D({constructOnly:!0})],Ca.prototype,"renderCanvas",void 0),x([D()],Ca.prototype,"renderingOptions",void 0),x([D({constructOnly:!0})],Ca.prototype,"supersampleScreenshotsEnabled",void 0),x([D({readOnly:!0})],Ca.prototype,"supportsGround",void 0),x([D()],Ca.prototype,"_defaultsFromMapSettings",null),x([D({readOnly:!0})],Ca.prototype,"typeSpecificPreconditionsReady",null),x([D()],Ca.prototype,"animation",null),x([D({type:vFt})],Ca.prototype,"background",null),x([D()],Ca.prototype,"center",null),x([D({type:l5t})],Ca.prototype,"constraints",null),x([D()],Ca.prototype,"extent",null),x([D()],Ca.prototype,"floors",void 0),x([D({type:tse})],Ca.prototype,"highlightOptions",void 0),x([D({readOnly:!0})],Ca.prototype,"inputManager",void 0),x([D()],Ca.prototype,"map",void 0),x([D()],Ca.prototype,"padding",null),x([D({readOnly:!0})],Ca.prototype,"rendering",null),x([D()],Ca.prototype,"resizeAlign",null),x([D({readOnly:!0})],Ca.prototype,"resolution",null),x([D()],Ca.prototype,"rotation",null),x([D()],Ca.prototype,"scale",null),x([D({constructOnly:!0})],Ca.prototype,"spatialReferenceLocked",void 0),x([D()],Ca.prototype,"stationary",null),x([D({type:xWe,readOnly:!0})],Ca.prototype,"timeline",void 0),x([D({readOnly:!0})],Ca.prototype,"type",void 0),x([D({readOnly:!0})],Ca.prototype,"updating",null),x([D()],Ca.prototype,"viewpoint",null),x([D()],Ca.prototype,"zoom",null),x([D({readOnly:!0})],Ca.prototype,"navigating",null),x([D(),So(i=>i instanceof gFt?i:Cu(yFt,i))],Ca.prototype,"ui",void 0),Ca=x([Qe("esri.views.MapView")],Ca);const CFt=Ca;class xl{wkid;latestWkid;wkt;constructor(e,t){typeof e=="string"?this.wkt=e:(this.wkid=e,this.latestWkid=t)}isEqual(e){return!!(this.isWebMercator()&&e.isWebMercator()||this.wkid&&e.wkid&&this.wkid===e.wkid||this.wkt&&e.wkt&&this.wkt===e.wkt||this.latestWkid&&e.latestWkid&&this.latestWkid===e.latestWkid)}clone(){const e=new xl("");return e.latestWkid=this.latestWkid,e.wkid=this.wkid,e.wkt=this.wkt,e}lean(){const e={};return this.wkt?e.wkt=this.wkt:(e.wkid=this.wkid,this.latestWkid&&(e.latestWkid=this.latestWkid)),e}isWebMercator(){const e=[900913,3587,54004,41001,102113,102100,3785];return!!(this.wkid&&e.includes(this.wkid)||this.latestWkid&&e.includes(this.latestWkid))}static latLongSR(){return new xl(4326)}static fromConfig(e){if(e.wkt)return new xl(e.wkt);if(e.wkid)return new xl(e.wkid,e.latestWkid);throw new Error("Could not parse config spatial reference object")}static parseSR(e){return e?e instanceof xl?e.clone():new xl(e):xl.latLongSR()}static fromESRI(e){if(e.wkt)return new xl(e.wkt);{const t=e.toJSON().latestWkid,r=new xl(e.wkid);return t&&(r.latestWkid=t),r}}toESRI(){return new Xi(this.lean())}static fromGeoJSON(e){const t=xl.parseGeoJsonCrs(e);return t.substring(0,5)==="EPSG:"?new xl(parseInt(t.slice(5))):new xl(t)}static parseGeoJsonCrs(e){if(e){if(e.type==="name"){const t=/urn:ogc:def:crs:EPSG::(\d+)/,r=e.properties.name,n=r.match(t);if(n)return"EPSG:"+n[1];if(r.substring(0,7)!=="urn:ogc")return r}}else return"EPSG:4326";return console.error("Encountered unsupported GeoJSON CRS format. Defaulting to lat-long, resuling conversion is likely wrong",e),"EPSG:4326"}toGeoJSON(){const e={type:"name",properties:{name:""}};return this.wkt?e.properties.name=this.wkt:e.properties.name="urn:ogc:def:crs:EPSG::"+(this.latestWkid||this.wkid),e}}class t7{sr;id;constructor(e,t){this.id=e?e.toString():"",this.sr=xl.parseSR(t)}get type(){return cl.UNKNOWN}childIdGenerator(e){return`${this.id}-${e}`}toESRI(){throw new Error(`.toESRI not implemented on geometry type ${this.type}`)}toGeoJSON(){throw new Error(`.toGeoJSON not implemented on geometry type ${this.type}`)}invalid(){return this.type===cl.NONE||this.type===cl.UNKNOWN}geoJsonFactory(e,t){const r={type:e,coordinates:t};return this.sr&&(r.crs=this.sr.toGeoJSON()),r}}class Kk extends t7{constructor(){super("no_geometry")}get type(){return cl.NONE}}let s0=class HQ extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=t.slice():this.rawArray=HQ.parseXY(t)}get type(){return cl.POINT}get x(){return this.rawArray[0]}set x(e){this.rawArray[0]=e}get y(){return this.rawArray[1]}set y(e){this.rawArray[1]=e}toArray(){return this.rawArray.slice()}static parseXY(e){let t;if(Array.isArray(e)&&e.length===2)t=e;else{if(e instanceof HQ)return e.toArray();t=[e.x,e.y]}if(isNaN(t[0])||isNaN(t[1]))throw new Error("Unsupported point format detected. Supported formats are two element array of numbers, or object with x and y properties containing numbers");return[parseFloat(t[0]),parseFloat(t[1])]}static fromESRI(e,t){return new HQ(t,[e.x,e.y],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $i({x:this.x,y:this.y,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new HQ(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POINT,this.toArray())}};class bb extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=bb.arrayDeepCopy(t):t instanceof bb?this.rawArray=t.toArray():this.rawArray=bb.parsePointSet(t)}get pointArray(){return this.rawArray.map((e,t)=>new s0(this.childIdGenerator(t),e,this.sr,!0))}getAt(e){return new s0(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,t){this.rawArray[t]=s0.parseXY(e)}get length(){return this.rawArray.length}toArray(){return bb.arrayDeepCopy(this.rawArray)}static parsePointSet(e){if(Array.isArray(e)){if(e.length===0)throw new Error("no verticies provided");return e.map(t=>s0.parseXY(t))}else throw new Error("Bad geometry input encountered")}static arrayDeepCopy(e){return e.map(t=>t.slice())}}class XV extends bb{constructor(e,t,r,n){super(e,t,r,n)}get type(){return cl.MULTIPOINT}static fromESRI(e,t){return new XV(t,e.points,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new Oh({points:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new XV(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTIPOINT,this.toArray())}}class TF extends bb{constructor(e,t,r,n){if(super(e,t,r,n),this.rawArray.length<2)throw new Error("lines require at least two verticies")}get type(){return cl.LINESTRING}static fromESRI(e,t){return new TF(t,e.paths[0],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new lo({paths:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new TF(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.LINESTRING,this.toArray())}}class CC extends t7{rawArray;constructor(e,t,r,n){if(super(e,t.sr||r),n)this.rawArray=CC.arrayDeepCopy(t);else if(t instanceof CC)this.rawArray=t.toArray();else if(t instanceof bb)this.rawArray=[t.toArray()];else if(Array.isArray(t)){if(t.length===0)throw new Error("no lines provided");this.rawArray=t.map(s=>bb.parsePointSet(s))}else throw new Error("invalid lines format for MulitLineString")}get lineArray(){return this.rawArray.map((e,t)=>new TF(this.childIdGenerator(t),e,this.sr,!0))}getAt(e){return new TF(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,t){this.rawArray[t]=bb.parsePointSet(e)}get length(){return this.rawArray.length}get type(){return cl.MULTILINESTRING}toArray(){return CC.arrayDeepCopy(this.rawArray)}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.slice()))}static fromESRI(e,t){return new CC(t,e.paths,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new lo({paths:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new CC(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTILINESTRING,this.toArray())}}class r9 extends bb{constructor(e,t,r,n){if(super(e,t,r,n),r9.closeRing(this.rawArray),this.length<4)throw new Error("Linear Ring must have at least 3 distinct vertices.")}get type(){return cl.LINEARRING}updateAt(e,t){const r=this.length-1;t===0?super.updateAt(e,r):t===r&&super.updateAt(e,0),super.updateAt(e,t)}static closeRing(e){const t=e[0],r=e[e.length-1];(t[0]!==r[0]||t[1]!==r[1])&&e.push(t.slice())}static fromESRI(e,t){return new r9(t,e.rings[0],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $s({rings:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new r9(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POLYGON,[this.toArray()])}}class Zy extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=Zy.arrayDeepCopy(t):this.rawArray=Zy.parsePolygon(t)}addLinearRings(e){e.forEach(t=>this.rawArray.push(t.toArray()))}get ringArray(){return this.rawArray.map((e,t)=>new r9(this.childIdGenerator(t),e,this.sr,!0))}get type(){return cl.POLYGON}toArray(){return Zy.arrayDeepCopy(this.rawArray)}static parsePolygon(e){let t=[];if(e instanceof Zy)return e.toArray();if(e instanceof CC)t=e.toArray();else if(e instanceof bb)t=[e.toArray()];else if(Array.isArray(e)){if(e.length===0)throw new Error("no rings provided");t=e.map(r=>bb.parsePointSet(r))}else throw new Error("invalid input format for parsePolygon");return t.forEach(r=>r9.closeRing(r)),t}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.slice()))}static fromESRI(e,t){return new Zy(t,e.rings,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $s({rings:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new Zy(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POLYGON,this.toArray())}}class QO extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=QO.arrayDeepCopy(t):this.rawArray=QO.parseMultiPolygon(t)}addPolygon(e){this.rawArray.push(e.toArray())}get polygonArray(){return this.rawArray.map((e,t)=>new Zy(this.childIdGenerator(t),e,this.sr,!0))}get type(){return cl.MULTIPOLYGON}toArray(){return QO.arrayDeepCopy(this.rawArray)}static parseMultiPolygon(e){if(e instanceof QO)return e.toArray();if(e instanceof Zy)return[e.toArray()];if(e instanceof CC||e instanceof bb)return[Zy.parsePolygon(e)];if(Array.isArray(e)){if(e.length===0)throw new Error("no polygons provided");return e.map(t=>Zy.parsePolygon(t))}else throw new Error("invalid input format for parseMultiPolygon")}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.map(n=>n.slice())))}static fromESRI(e,t){return new QO(t,[e.rings],xl.fromESRI(e.spatialReference),!0)}toESRI(){const e=[];return this.toArray().forEach(t=>{t.forEach(r=>e.push(r))}),new $s({rings:e,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new QO(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTIPOLYGON,this.toArray())}}class Yh extends t7{rawMin;rawMax;constructor(e,t,r,n){super(e,t.sr||n),this.rawMin=s0.parseXY(t),this.rawMax=s0.parseXY(r)}get type(){return cl.EXTENT}get xmin(){return this.rawMin[0]}get ymin(){return this.rawMin[1]}get xmax(){return this.rawMax[0]}get ymax(){return this.rawMax[1]}center(){return new s0(this.id+"_centerPoint",[(this.xmax-this.xmin)/2+this.xmin,(this.ymax-this.ymin)/2+this.ymin],this.sr,!0)}expand(e){return Yh.fromESRI(this.toESRI().expand(e),`${this.id}-expanded`)}clone(){return new Yh(this.id,this.rawMin,this.rawMax,this.sr)}contains(e){return this.sr.isEqual(e.sr)?this.xmin<=e.x&&this.xmax>=e.x&&this.ymin<=e.y&&this.ymax>=e.y:(console.error("Extent.contains(point) must have point in same spatial reference as the extent."),!1)}toArray(){return[this.rawMin.slice(),this.rawMax.slice()]}toPolygonArray(){return[[this.rawMin.slice(),[this.xmin,this.ymax],this.rawMax.slice(),[this.xmax,this.ymin],this.rawMin.slice()]]}toPolygon(){return new Zy(this.id,this.toPolygonArray(),this.sr,!0)}static fromParams(e,t,r,n,s,o){return new Yh(e,[t,r],[n,s],o)}static fromConfig(e,t){return new Yh(e,[t.xmin,t.ymin],[t.xmax,t.ymax],xl.fromConfig(t.spatialReference))}isEqual(e){return e?this.xmin===e.xmin&&this.ymin===e.ymin&&this.xmax===e.xmax&&this.ymax===e.ymax:!1}static fromESRI(e,t){return Yh.fromParams(t,e.xmin,e.ymin,e.xmax,e.ymax,xl.fromESRI(e.spatialReference))}toESRI(){return new hr({xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:this.sr.toESRI()})}static fromArcServer(e,t){return Yh.fromESRI(hr.fromJSON(e),t)}static fromGeoJSON(e,t){if(e.coordinates.length!==5)throw new Error("Extent expected a four vertex polygon from GeoJSON");const r=e.coordinates[0].slice(),n=r.slice();return[1,2,3].forEach(s=>{[0,1].forEach(o=>{const a=e.coordinates[s];r[o]>a[o]&&(r[o]=a[o]),n[o]4){console.error("Invalid colour value array passed to Colour class"),this.c=[0,0,0,1];return}this.c=e.map((r,n)=>n===3?r:parseInt(r)),t===3&&this.c.push(1)}else if(typeof e=="string"){const t=e.substring(0,1)==="#"?e.substring(1):e;this.c=[0,2,4,6].map(r=>{const n=t.substring(r,r+2);return bR.hexToInt(n)})}else this.c=[e.r,e.g,e.b,e.a??1];this.c.forEach((t,r)=>{t<0&&(console.error("Negative value passed to colour"),this.c[r]=0),t>255&&(console.error("Rotund value passed to colour"),this.c[r]=255)}),this.c[3]>1&&(this.c[3]=this.c[3]/255)}get rgba(){return this.c.slice()}get hex(){const e=this.rgba;return e[3]=e[3]*255,`#${e.map(t=>bR.intToHex(t)).join("")}`}get r(){return this.c[0]}get g(){return this.c[1]}get b(){return this.c[2]}get a(){return this.c[3]}toESRI(){return new jr(this.rgba)}toArcServer(){return[this.c[0],this.c[1],this.c[2],255*this.c[3]]}static hexToInt(e){return e.length===0?255:parseInt(e,16)}static intToHex(e){const t=e.toString(16);return t.length===1?`0${t}`:t}}class eP{toOptions(){throw new Error(".toOptions called on BaseStyle. Likely was not implemented on subclass.")}toESRI(){throw new Error(".toESRI called on BaseStyle. Likely was not implemented on subclass.")}static convToPoints(e){if(!(typeof e>"u"))if(typeof e=="string"){let t;const r=e.length;if(r===0)return;const n=e.substring(r-2);return n==="px"?t=parseFloat(e.substring(0,r-2))*1.333333:n==="pt"?t=parseFloat(e.substring(0,r-2)):t=parseFloat(e),t}else return e}}class vP extends eP{_height;_xOffset;_yOffset;_icon;_width;_size;_colour;_style;_outline;_path;_angle;constructor(e){if(e=e||{style:zI.CIRCLE},super(),this._style=e.style||zI.CIRCLE,e.style===zI.ICON){const t=e;this._icon=t.icon||"",this._height=eP.convToPoints(t.height)||16.5,this._width=eP.convToPoints(t.width)||16.5,this._size=0,this._colour=new bR,this._outline=new WA,this._path=""}else{const t=e;this._size=eP.convToPoints(t.size)||12,this._colour=new bR(t.colour??"#ffffff40"),this._outline=new WA(t.outline),this._path=this._style===zI.PATH&&t.path||"",this._height=0,this._width=0,this._icon=""}this._xOffset=eP.convToPoints(e.xOffset)||0,this._yOffset=eP.convToPoints(e.yOffset)||0,this._angle=e.angle||0}get colour(){return this.propGrouse(!1),this._colour}get styleType(){return this._style}get width(){return this.propGrouse(!0),this._width}get height(){return this.propGrouse(!0),this._height}get size(){return this.propGrouse(!1),this._size}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}get angle(){return this._angle}get icon(){return this.propGrouse(!0),this._icon}get outline(){return this.propGrouse(!1),this._outline}get path(){return this.propGrouse(!1),this._path}propGrouse(e){this._style===zI.ICON!==e&&console.warn(`Accessed a point style property that is invalid for the style type ${this._style}`)}toOptions(){const e={style:this.styleType,yOffset:this.yOffset,xOffset:this.xOffset,angle:this.angle};return this._style===zI.ICON?{...e,icon:this.icon,width:this.width,height:this.height}:{...e,size:this.size,colour:this.colour.hex,path:this.path}}toESRI(){let e;return this.styleType===zI.ICON?vP.isImageUrl(this.icon)?(e=new BP,e.url=this.icon,e.width=this.width,e.height=this.height,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new Jh,e.color=new jr(this.colour.rgba),e.size=this.width,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new Jh,e.color=new jr(this.colour.rgba),e.size=this.size,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle,e.path=this.path,e.style=this.styleType,e.outline=this.outline.toESRI()),e}static fromESRI(e){const t={xOffset:e.xoffset,yOffset:e.yoffset,angle:e.angle};if(e.type==="simple-marker"){const r=t;r.style=e.style,r.colour=e.color.toRgba(),r.size=e.size,r.path=e.path,r.outline=WA.fromESRI(e.outline).toOptions()}else{const r=t;r.style=zI.ICON,r.width=e.width,r.height=e.height,r.icon=e.url}return new vP(t)}static fromArcServer(e){return vP.fromESRI(wae(e))}static isImageUrl(e){return!!e.match(/\.(jpeg|jpg|gif|png|swf|svg)$/)||!!e.match(/^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i)}}class WA extends eP{_style;_width;_miter;_cap;_join;_colour;constructor(e){e=e||{},super(),this._style=e.style||K_.SOLID;const t=eP.convToPoints(e.width);this._width=typeof t>"u"||t<0?.75:t,this._colour=new bR(e.colour),this._miter=e.miter??2,this._cap=e.cap||kTt.ROUND,this._join=e.join||FTt.ROUND}get styleType(){return this._style}get width(){return this._width}get colour(){return this._colour}get miter(){return this._miter}get cap(){return this._cap}get join(){return this._join}toOptions(){return{style:this.styleType,width:this.width,colour:this.colour.hex,miter:this.miter,cap:this.cap,join:this.join}}toESRI(){const e=new vg;return e.width=this.width,e.color=this.colour.toESRI(),e.style=this.styleType,e.cap=this.cap,e.miterLimit=this.miter,e.join=this.join,e}static fromESRI(e){const t={width:e.width,colour:e.color.toRgba(),style:e.style};return new WA(t)}static fromArcServer(e){return WA.fromESRI(wae(e))}}class jW extends eP{_outlineStyle;_fillColour;_fillStyle;constructor(e){super(),e=e||{},e.fill||(e.fill={}),this._fillColour=new bR(e.fill.colour),this._fillStyle=e.fill.style||LTt.SOLID,this._outlineStyle=new WA(e.outline)}get fillColour(){return this._fillColour}get fillStyleType(){return this._fillStyle}get outline(){return this._outlineStyle}toOptions(){return{fill:{style:this.fillStyleType,colour:this.fillColour.hex},outline:this.outline.toOptions()}}toESRI(){const e=this.outline.toESRI(),t=new jr(this.fillColour.rgba),r=new Hx;return r.style=this.fillStyleType,r.color=t,r.outline=e,r}static fromESRI(e){const t={fill:{colour:e.color.toRgba(),style:e.style},outline:WA.fromESRI(e.outline).toOptions()};return new jW(t)}static fromArcServer(e){return jW.fromESRI(wae(e))}}class t_r{Extent=Yh;Graphic=Ax;LineString=TF;LineStyle=WA;LinearRing=r9;MultiLineString=CC;MultiPoint=XV;MultiPolygon=QO;Point=s0;PointStyle=vP;Polygon=Zy;PolygonStyle=jW;SpatialReference=xl;esriMapClickToRamp(e,t){return{mapPoint:s0.fromESRI(e.mapPoint,t),screenX:e.x,screenY:e.y,button:e.button,input:e.native.pointerType,clickTime:e.timestamp}}esriMapMouseToRamp(e){return{screenX:e.x,screenY:e.y,button:e.button,moveTime:e.timestamp}}geomRampToEsri(e){return e.toESRI()}geomEsriToRamp(e,t){switch(e.type){case"point":return s0.fromESRI(e,t);case"polyline":{const r=e;return r.paths.length===1?TF.fromESRI(r,t):CC.fromESRI(r,t)}case"polygon":return Zy.fromESRI(e,t);case"extent":return Yh.fromESRI(e,t);case"multipoint":return XV.fromESRI(e,t);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomGeoJsonToRamp(e,t){switch(e.type){case jp.POINT:return s0.fromGeoJSON(e,t);case jp.LINESTRING:return TF.fromGeoJSON(e,t);case jp.POLYGON:return Zy.fromGeoJSON(e,t);case jp.MULTIPOINT:return XV.fromGeoJSON(e,t);case jp.MULTILINESTRING:return CC.fromGeoJSON(e,t);case jp.MULTIPOLYGON:return QO.fromGeoJSON(e,t);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomRampToGeoJson(e){return e.toGeoJSON()}graphicRampToGeoJson(e){const t={},r={type:"Feature",geometry:this.geomRampToGeoJson(e.geometry),properties:t};return Object.keys(e.attributes).forEach(n=>r.properties[n]=e.attributes[n]),r}graphicGeoJsonToRamp(e,t){if(e.type!=="Feature")throw new Error("Expected input parameter of graphicGeoJsonToRamp to be a GeoJson feature");const r=this.geomGeoJsonToRamp(e.geometry,t),n={};return Object.keys(e.properties.forEach(o=>n[o]=e.properties[o])),new Ax(r,"",n)}graphicRampToEsri(e){const t={attributes:{},id:e.id};return t.geometry=this.geomRampToEsri(e.geometry),Object.keys(e.attributes).forEach(r=>t.attributes[r]=e.attributes[r]),e.style&&(t.symbol=this.styleRampToEsri(e.style)),new Us(t)}styleRampToEsri(e){return e.toESRI()}styleEsriToRamp(e){switch(e.type){case"picture-marker":case"simple-marker":return vP.fromESRI(e);case"simple-line":return WA.fromESRI(e);case"simple-fill":return jW.fromESRI(e);default:return console.error(`Unsupported ESRI symbol type encountered: ${e.type}`),new vP}}serverGeomTypeToRampGeomType(e){if(!e)return cl.NONE;switch(e){case"esriGeometryPolygon":return cl.POLYGON;case"esriGeometryPolyline":return cl.LINESTRING;case"esriGeometryPoint":return cl.POINT;case"esriGeometryMultipoint":return cl.MULTIPOINT;case"esriGeometryEnvelope":return cl.EXTENT;default:return console.error(`Unrecognized server geometry type encountered: ${e}`),cl.UNKNOWN}}clientGeomTypeToRampGeomType(e){if(!e)return cl.NONE;switch(e){case"polygon":return cl.POLYGON;case"polyline":return cl.LINESTRING;case"point":return cl.POINT;case"multipoint":return cl.MULTIPOINT;default:return console.error(`Unrecognized client geometry type encountered: ${e}`),cl.UNKNOWN}}geoJsonGeomTypeToEsriGeomType(e){switch(e){case jp.POINT:return"point";case jp.LINESTRING:case jp.MULTILINESTRING:return"polyline";case jp.POLYGON:case jp.MULTIPOLYGON:return"polygon";case jp.MULTIPOINT:return"multipoint";default:throw new Error(`Encountered unhandled geometry type ${e}`)}}isImageUrl(e){return vP.isImageUrl(e)}}class q1e{layerIdx;name;children;uid;isRoot;constructor(e,t,r="",n=!0){this.layerIdx=e,this.name=r,this.isRoot=n,this.children=[],this.uid=t}findChildByUid(e){if(this.uid===e)return this;{let t;return this.children.some(r=>t=r.findChildByUid(e)),t}}findChildByIdx(e){if(this.layerIdx===e)return this;{let t;return this.children.some(r=>t=r.findChildByIdx(e)),t}}get isLogicalLayer(){return this.layerIdx>-1&&this.children.length===0}get isLayerRoot(){return this.isRoot}}class EFt{minScale;maxScale;constructor(e=0,t=0){this.minScale=e,this.maxScale=t}isOffScale(e){const t={offScale:!1,zoomIn:!1};return ethis.minScale&&this.minScale!==0&&(t.offScale=!0,t.zoomIn=!0),t}}let IFt=class{sql;cache;extent;constructor(e="",t=""){this.sql={[pm.PERMANENT]:e,[pm.INITIAL]:t},this.extent=void 0,this.cache={}}sqlActiveFilters(e=[]){const t=this.sql,r=Object.keys(t).filter(n=>t[n]);return e.length===0?r:r.filter(n=>e.indexOf(n)===-1)}isActive(){return this.sqlActiveFilters([pm.PERMANENT]).length>0}getCombinedSql(e=[]){const t=this.sqlActiveFilters(e),r=t.length;return r===0?"":r===1?this.sql[t[0]]:t.map(n=>`(${this.sql[n]})`).join(" AND ")}setSql(e,t){e===pm.PERMANENT?console.error("Attempted to overwrite a permanent filter. Not allowed."):(this.sql[e]=t,this.clearCacheSet(e))}getSql(e){return this.sql[e]||""}setExtent(e){e.isEqual(this.extent)||(this.extent=e,this.clearCacheSet(pm.EXTENT))}getCacheKey(e,t){return`_cache$${e.sort().join("$")}${t?"$"+pm.EXTENT:""}$`}getCache(e,t){const r=this.getCacheKey(e,t);return this.cache[r]}setCache(e,t,r){const n=this.getCacheKey(t,r);this.cache[n]=e}cacheActiveKeys(){const e=this.cache;return Object.keys(e).filter(t=>e[t])}clearAllCaches(){this.cache={}}clearCacheSet(e){this.cacheActiveKeys().forEach(t=>{t.indexOf(`$${e}$`)>-1&&delete this.cache[t]})}clearAll(){this.sql={[pm.PERMANENT]:this.sql[pm.PERMANENT]},this.extent=void 0,this.clearAllCaches()}};class rse{id;sr;_defaultExtent;_fullExtent;_maximumExtent;constructor(e,t,r=void 0,n=void 0){this.id=e,this.sr=t.sr.clone(),this._defaultExtent=t.clone(),this._fullExtent=r?.clone(),this._maximumExtent=n?.clone(),r&&!r.sr.isEqual(this.sr)&&console.error(`Full extent provided in extent set has a mismatching spatial reference: ${r.sr}`),n&&!n.sr.isEqual(this.sr)&&console.error(`Maximum extent provided in extent set has a mismatching spatial reference: ${n.sr}`)}get defaultExtent(){return this._defaultExtent}set defaultExtent(e){this._defaultExtent=e.clone()}get fullExtent(){return this._fullExtent?this._fullExtent:this.defaultExtent}set fullExtent(e){this._fullExtent=e.clone()}get maximumExtent(){return this._maximumExtent?this._maximumExtent:this.fullExtent}set maximumExtent(e){this._maximumExtent=e.clone()}static fromConfig(e){return new rse(e.id,Yh.fromConfig(`${e.id}-extent-default`,e.default),e.full!==void 0?Yh.fromConfig(`${e.id}-extent-full`,e.full):void 0,e.maximum!==void 0?Yh.fromConfig(`${e.id}-extent-maximum`,e.maximum):void 0)}clone(){return new rse(this.id,this._defaultExtent,this._fullExtent,this._maximumExtent)}}class Af{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((e,t)=>{this.resolveMe=e,this.rejectMe=t})}}var Hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function X3(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wSe(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function r(){if(this instanceof r){var n=[null];n.push.apply(n,arguments);var s=Function.bind.apply(e,n);return new s}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var n=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return i[r]}})}),t}var i_r=function(e){return r_r(e)&&!n_r(e)};function r_r(i){return!!i&&typeof i=="object"}function n_r(i){var e=Object.prototype.toString.call(i);return e==="[object RegExp]"||e==="[object Date]"||a_r(i)}var s_r=typeof Symbol=="function"&&Symbol.for,o_r=s_r?Symbol.for("react.element"):60103;function a_r(i){return i.$$typeof===o_r}function l_r(i){return Array.isArray(i)?[]:{}}function nse(i,e){return e.clone!==!1&&e.isMergeableObject(i)?GW(l_r(i),i,e):i}function u_r(i,e,t){return i.concat(e).map(function(r){return nse(r,t)})}function c_r(i,e){if(!e.customMerge)return GW;var t=e.customMerge(i);return typeof t=="function"?t:GW}function h_r(i){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(i).filter(function(e){return Object.propertyIsEnumerable.call(i,e)}):[]}function Wlt(i){return Object.keys(i).concat(h_r(i))}function AFt(i,e){try{return e in i}catch{return!1}}function d_r(i,e){return AFt(i,e)&&!(Object.hasOwnProperty.call(i,e)&&Object.propertyIsEnumerable.call(i,e))}function p_r(i,e,t){var r={};return t.isMergeableObject(i)&&Wlt(i).forEach(function(n){r[n]=nse(i[n],t)}),Wlt(e).forEach(function(n){d_r(i,n)||(AFt(i,n)&&t.isMergeableObject(e[n])?r[n]=c_r(n,t)(i[n],e[n],t):r[n]=nse(e[n],t))}),r}function GW(i,e,t){t=t||{},t.arrayMerge=t.arrayMerge||u_r,t.isMergeableObject=t.isMergeableObject||i_r,t.cloneUnlessOtherwiseSpecified=nse;var r=Array.isArray(e),n=Array.isArray(i),s=r===n;return s?r?t.arrayMerge(i,e,t):p_r(i,e,t):nse(e,t)}GW.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return GW(r,n,t)},{})};var f_r=GW,m_r=f_r;const HY=X3(m_r);class g_r{generateUUID(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?r:r&3|8).toString(16)})}convertImageToCanvas(e,t,r=!0){const n=t??window.document.createElement("canvas"),s=window.document.createElement("img");r&&(s.crossOrigin="anonymous");const o=new Promise((a,l)=>{s.addEventListener("load",()=>{n.width=s.width,n.height=s.height,n.getContext("2d")?.drawImage(s,0,0),a(n)}),s.addEventListener("error",u=>l(u))});return s.src=e,o}async convertImagetoDataURL(e,t="image/png"){return e.startsWith("data")?e:this.convertImageToCanvas(e).then(r=>r.toDataURL(t)).catch(r=>(console.error("Failed to load crossorigin image",e,r),e))}parseUrlIndex(e){const t={rootUrl:e,index:0},r=/\/(\d+)\/?$/,n=e.match(r);if(n){const s=n[1];t.index=isNaN(parseInt(s))?void 0:parseInt(s),t.rootUrl=e.substr(0,e.length-n[0].length)}else console.warn("Cannot extract layer index from url "+e);return t}}class sse{_url;_base;_query;_queryMap={};constructor(e){this._url=e,[this._base,this._query]=e.split("?").concat(""),this._queryMap=this._query.split("&").reduce((t,r)=>{const[n,s]=r.split("=");return t[n]=s,t},{})}get query(){return this._query}get base(){return this._base}get queryMap(){return this._queryMap}updateQuery(e){const t=HY.all([{},this.queryMap,e]);return`${this.base}${Object.entries(t).filter(([,n])=>n!==void 0).map(([n,s],o)=>`${o===0?"?":""}${n}=${s}`).join("&")}`}}var LMe={exports:{}},qlt;function MFt(){return qlt||(qlt=1,function(i,e){(function(t,r){i.exports=r(),typeof window=="object"&&(t.Terraformer=r())})(Hh,function(){var t={},r=6378137,n=57.29577951308232,s=.017453292519943,o={type:"link",properties:{href:"http://spatialreference.org/ref/sr-org/6928/ogcwkt/",type:"ogcwkt"}},a={type:"link",properties:{href:"http://spatialreference.org/ref/epsg/4326/ogcwkt/",type:"ogcwkt"}};function l(ye){return Object.prototype.toString.call(ye)==="[object Array]"}function u(){var ye=Array.prototype.slice.apply(arguments);typeof console!==void 0&&console.warn&&console.warn.apply(console,ye)}function c(ye,Ke){for(var ke in Ke)Ke.hasOwnProperty(ke)&&(ye[ke]=Ke[ke]);return ye}function h(ye){if(ye.type)switch(ye.type){case"Point":return[ye.coordinates[0],ye.coordinates[1],ye.coordinates[0],ye.coordinates[1]];case"MultiPoint":return v(ye.coordinates);case"LineString":return v(ye.coordinates);case"MultiLineString":return p(ye.coordinates);case"Polygon":return p(ye.coordinates);case"MultiPolygon":return m(ye.coordinates);case"Feature":return ye.geometry?h(ye.geometry):null;case"FeatureCollection":return w(ye);case"GeometryCollection":return S(ye);default:throw new Error("Unknown type: "+ye.type)}return null}function p(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=ht),(me===null||Htie)&&(ie=Ht)}return[Ke,me,ke,ie]}function m(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=_t),(me===null||Feie)&&(ie=Fe)}return[Ke,me,ke,ie]}function v(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=rt),(me===null||Meie)&&(ie=Me)}return[Ke,me,ke,ie]}function w(ye){for(var Ke=[],ke,me=ye.features.length-1;me>=0;me--)ke=h(ye.features[me].geometry),Ke.push([ke[0],ke[1]]),Ke.push([ke[2],ke[3]]);return v(Ke)}function S(ye){for(var Ke=[],ke,me=ye.geometries.length-1;me>=0;me--)ke=h(ye.geometries[me]),Ke.push([ke[0],ke[1]]),Ke.push([ke[2],ke[3]]);return v(Ke)}function I(ye){var Ke=h(ye);return{x:Ke[0],y:Ke[1],w:Math.abs(Ke[0]-Ke[2]),h:Math.abs(Ke[1]-Ke[3])}}function R(ye){return ye*n}function L(ye){return ye*s}function k(ye,Ke){for(var ke=0;keKe?1:0}function re(ye,Ke){return ye[0]>Ke[0]?-1:ye[0]Ke[1]?-1:ye[1]de(Ke,ke))&&(ke=ye[me])}return ke}function H(ye){if(ye.length===0)return[];if(ye.length===1)return ye;for(var Ke=[ye.sort(re)[0]],ke=0;ke0||!Ke&&rt<0)return!1}return!0}function ae(ye,Ke){for(var ke=!1,me=-1,ie=ye.length,ge=ie-1;++me=3)ye=this.coordinates;else return null;else if(this.type==="Polygon"||this.type==="MultiLineString")if(this.coordinates&&this.coordinates.length>0){for(Ke=0;Ke0){for(Ke=0;Ke=2)this.coordinates=Ke;else throw"Terraformer: invalid input for Terraformer.Point";this.type="Point"}yt.prototype=new tt,yt.prototype.constructor=yt;function Ct(ye){if(ye&&ye.type==="MultiPoint"&&ye.coordinates)c(this,ye);else if(l(ye))this.coordinates=ye;else throw"Terraformer: invalid input for Terraformer.MultiPoint";this.type="MultiPoint"}Ct.prototype=new tt,Ct.prototype.constructor=Ct,Ct.prototype.forEach=function(ye){for(var Ke=0;Ke1},At.prototype.holes=function(){var ye=[];if(this.hasHoles())for(var Ke=1;Ke=this.text.length)return;i=this.text[this.place++]}switch(this.state){case ase:return this.neutral(i);case OFt:return this.keyword(i);case Y1e:return this.quoted(i);case RFt:return this.afterquote(i);case PFt:return this.number(i);case AWe:return}};GR.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Y1e;return}if(xSe.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)};GR.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=ase;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ase,this.currentObject=this.stack.pop(),this.currentObject||(this.state=AWe);return}};GR.prototype.number=function(i){if(DFt.test(i)){this.word+=i;return}if(xSe.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)};GR.prototype.quoted=function(i){if(i==='"'){this.state=RFt;return}this.word+=i};GR.prototype.keyword=function(i){if(I_r.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=ase;return}if(xSe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)};GR.prototype.neutral=function(i){if(E_r.test(i)){this.word=i,this.state=OFt;return}if(i==='"'){this.word="",this.state=Y1e;return}if(DFt.test(i)){this.word=i,this.state=PFt;return}if(xSe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)};GR.prototype.output=function(){for(;this.place0?90:-90),i.lat_ts=i.lat1)}function FFt(i){var e=A_r(i),t=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",t]);var n={};return Uz(e,n),P_r(n),n}function F1(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?F1[i]=JNe(arguments[1]):F1[i]=FFt(arguments[1]):F1[i]=t}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(r){Array.isArray(r)?F1.apply(e,r):F1(r)});if(typeof i=="string"){if(i in F1)return F1[i]}else"EPSG"in i?F1["EPSG:"+i.EPSG]=i:"ESRI"in i?F1["ESRI:"+i.ESRI]=i:"IAU2000"in i?F1["IAU2000:"+i.IAU2000]=i:console.log(i);return}}v_r(F1);function R_r(i){return typeof i=="string"}function D_r(i){return i in F1}var F_r=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function k_r(i){return F_r.some(function(e){return i.indexOf(e)>-1})}var L_r=["3857","900913","3785","102113"];function N_r(i){var e=uk(i,"authority");if(e){var t=uk(e,"epsg");return t&&L_r.indexOf(t)>-1}}function $_r(i){var e=uk(i,"extension");if(e)return uk(e,"proj4")}function B_r(i){return i[0]==="+"}function j_r(i){if(R_r(i)){if(D_r(i))return F1[i];if(k_r(i)){var e=FFt(i);if(N_r(e))return F1["EPSG:3857"];var t=$_r(e);return t?JNe(t):e}if(B_r(i))return JNe(i)}else return i}function Zlt(i,e){i=i||{};var t,r;if(!e)return i;for(r in e)t=e[r],t!==void 0&&(i[r]=t);return i}function v3(i,e,t){var r=i*e;return t/Math.sqrt(1-r*r)}function Gae(i){return i<0?-1:1}function Gs(i){return Math.abs(i)<=mf?i:i-Gae(i)*ose}function QC(i,e,t){var r=i*t,n=.5*i;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(An-e))/r}function lse(i,e){for(var t=.5*i,r,n,s=An-2*Math.atan(e),o=0;o<=15;o++)if(r=i*Math.sin(s),n=An-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-s,s+=n,Math.abs(n)<=1e-10)return s;return-9999}function G_r(){var i=this.b/this.a;this.es=1-i*i,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=v3(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function U_r(i){var e=i.x,t=i.y;if(t*OA>90&&t*OA<-90&&e*OA>180&&e*OA<-180)return null;var r,n;if(Math.abs(Math.abs(t)-An)<=ys)return null;if(this.sphere)r=this.x0+this.a*this.k0*Gs(e-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan($c+.5*t));else{var s=Math.sin(t),o=QC(this.e,t,s);r=this.x0+this.a*this.k0*Gs(e-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return i.x=r,i.y=n,i}function z_r(i){var e=i.x-this.x0,t=i.y-this.y0,r,n;if(this.sphere)n=An-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var s=Math.exp(-t/(this.a*this.k0));if(n=lse(this.e,s),n===-9999)return null}return r=Gs(this.long0+e/(this.a*this.k0)),i.x=r,i.y=n,i}var V_r=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const H_r={init:G_r,forward:U_r,inverse:z_r,names:V_r};function W_r(){}function Qlt(i){return i}var q_r=["longlat","identity"];const Y_r={init:W_r,forward:Qlt,inverse:Qlt,names:q_r};var X_r=[H_r,Y_r],bge={},X1e=[];function kFt(i,e){var t=X1e.length;return i.names?(X1e[t]=i,i.names.forEach(function(r){bge[r.toLowerCase()]=t}),this):(console.log(e),!0)}function J_r(i){if(!i)return!1;var e=i.toLowerCase();if(typeof bge[e]<"u"&&X1e[bge[e]])return X1e[bge[e]]}function K_r(){X_r.forEach(kFt)}const Z_r={start:K_r,add:kFt,get:J_r};var nl={};nl.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};nl.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};nl.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};nl.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};nl.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};nl.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};nl.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};nl.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};nl.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};nl.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};nl.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};nl.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};nl.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};nl.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};nl.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};nl.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};nl.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};nl.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};nl.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};nl.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};nl.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};nl.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};nl.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};nl.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};nl.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};nl.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};nl.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};nl.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};nl.hough={a:6378270,rf:297,ellipseName:"Hough"};nl.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};nl.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};nl.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};nl.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};nl.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};nl.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};nl.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};nl.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};nl.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};nl.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};nl.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};nl.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Q_r=nl.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};nl.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function ebr(i,e,t,r){var n=i*i,s=e*e,o=(n-s)/n,a=0;r?(i*=1-o*(w_r+o*(x_r+o*S_r)),n=i*i,o=0):a=Math.sqrt(o);var l=(n-s)/s;return{es:o,e:a,ep2:l}}function tbr(i,e,t,r,n){if(!i){var s=uk(nl,r);s||(s=Q_r),i=s.a,e=s.b,t=s.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=gB,a.datum_params[3]*=Wie,a.datum_params[4]*=Wie,a.datum_params[5]*=Wie,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=JV,a.grids=o),a.a=t,a.b=r,a.es=n,a.ep2=s,a}var LFt={};function rbr(i,e){var t=new DataView(e),r=obr(t),n=abr(t,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=lbr(t,n,r),o={header:n,subgrids:s};return LFt[i]=o,o}function nbr(i){if(i===void 0)return null;var e=i.split(",");return e.map(sbr)}function sbr(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:LFt[i]||null,isNull:!1}}function zz(i){return i/3600*Math.PI/180}function obr(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function abr(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:KNe(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function KNe(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function lbr(i,e,t){for(var r=176,n=[],s=0;s5e-11?!1:i.datum_type===mB?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===gB?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function NFt(i,e,t){var r=i.x,n=i.y,s=i.z?i.z:0,o,a,l,u;if(n<-An&&n>-1.001*An)n=-An;else if(n>An&&n<1.001*An)n=An;else{if(n<-An)return{x:-1/0,y:-1/0,z:i.z};if(n>An)return{x:1/0,y:1/0,z:i.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(n),u=Math.cos(n),l=a*a,o=t/Math.sqrt(1-e*l),{x:(o+s)*u*Math.cos(r),y:(o+s)*u*Math.sin(r),z:(o*(1-e)+s)*a}}function $Ft(i,e,t,r){var n=1e-12,s=n*n,o=30,a,l,u,c,h,p,m,v,w,S,I,R,L,k=i.x,B=i.y,$=i.z?i.z:0,V,Y,K;if(a=Math.sqrt(k*k+B*B),l=Math.sqrt(k*k+B*B+$*$),a/ts&&Lr.y||c>r.x||ma&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Gs(s.x+t.ll[0]),r.y=s.y+t.ll[1]}else isNaN(s.x)||(r.x=i.x+s.x,r.y=i.y+s.y);return r}function tut(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},n={x:t.x-1*r.x,y:t.y-1*r.y},s={x:Number.NaN,y:Number.NaN},o;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return s;o=r.y*e.lim[0]+r.x;var a={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var l={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var u={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var c={x:e.cvs[o][0],y:e.cvs[o][1]},h=n.x*n.y,p=n.x*(1-n.y),m=(1-n.x)*(1-n.y),v=(1-n.x)*n.y;return s.x=m*a.x+p*l.x+v*c.x+h*u.x,s.y=m*a.y+p*l.y+v*c.y+h*u.y,s}function iut(i,e,t){var r=t.x,n=t.y,s=t.z||0,o,a,l,u={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(o=r,"ew".indexOf(i.axis[l])!==-1?a="x":a="y"):l===1?(o=n,"ns".indexOf(i.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),i.axis[l]){case"e":u[a]=o;break;case"w":u[a]=-o;break;case"n":u[a]=o;break;case"s":u[a]=-o;break;case"u":t[a]!==void 0&&(u.z=o);break;case"d":t[a]!==void 0&&(u.z=-o);break;default:return null}return u}function BFt(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function ybr(i){rut(i.x),rut(i.y)}function rut(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function vbr(i,e){return(i.datum.datum_type===mB||i.datum.datum_type===gB||i.datum.datum_type===JV)&&e.datumCode!=="WGS84"||(e.datum.datum_type===mB||e.datum.datum_type===gB||e.datum.datum_type===JV)&&i.datumCode!=="WGS84"}function J1e(i,e,t,r){var n;Array.isArray(t)?t=BFt(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var s=t.z!==void 0;if(ybr(t),i.datum&&e.datum&&vbr(i,e)&&(n=new qA("WGS84"),t=J1e(i,n,t,r),i=n),r&&i.axis!=="enu"&&(t=iut(i,!1,t)),i.projName==="longlat")t={x:t.x*Uy,y:t.y*Uy,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=mbr(i.datum,e.datum,t),!!t)return e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*OA,y:t.y*OA,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?iut(e,!0,t):(s||delete t.z,t)}var nut=qA("WGS84");function NMe(i,e,t,r){var n,s,o;return Array.isArray(t)?(n=J1e(i,e,t,r)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(t.splice(3)):[n.x,n.y,t[2]].concat(t.splice(3)):[n.x,n.y].concat(t.splice(2)):[n.x,n.y]):(s=J1e(i,e,t,r),o=Object.keys(t),o.length===2||o.forEach(function(a){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=t[a]}),s)}function sut(i){return i instanceof qA?i:i.oProj?i.oProj:qA(i)}function Ih(i,e,t){i=sut(i);var r=!1,n;return typeof e>"u"?(e=i,i=nut,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,e=i,i=nut,r=!0),e=sut(e),t?NMe(i,e,t):(n={forward:function(s,o){return NMe(i,e,s,o)},inverse:function(s,o){return NMe(e,i,s,o)}},r&&(n.oProj=e),n)}var out=6,jFt="AJSAJS",GFt="AFAFAF",Vz=65,Q_=73,z2=79,WQ=86,qQ=90;const _br={forward:UFt,inverse:bbr,toPoint:zFt};function UFt(i,e){return e=e||5,Sbr(wbr({lat:i[1],lon:i[0]}),e)}function bbr(i){var e=MWe(HFt(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function zFt(i){var e=MWe(HFt(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function $Me(i){return i*(Math.PI/180)}function aut(i){return 180*(i/Math.PI)}function wbr(i){var e=i.lat,t=i.lon,r=6378137,n=.00669438,s=.9996,o,a,l,u,c,h,p,m=$Me(e),v=$Me(t),w,S;S=Math.floor((t+180)/6)+1,t===180&&(S=60),e>=56&&e<64&&t>=3&&t<12&&(S=32),e>=72&&e<84&&(t>=0&&t<9?S=31:t>=9&&t<21?S=33:t>=21&&t<33?S=35:t>=33&&t<42&&(S=37)),o=(S-1)*6-180+3,w=$Me(o),a=n/(1-n),l=r/Math.sqrt(1-n*Math.sin(m)*Math.sin(m)),u=Math.tan(m)*Math.tan(m),c=a*Math.cos(m)*Math.cos(m),h=Math.cos(m)*(v-w),p=r*((1-n/4-3*n*n/64-5*n*n*n/256)*m-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*m)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*m)-35*n*n*n/3072*Math.sin(6*m));var I=s*l*(h+(1-u+c)*h*h*h/6+(5-18*u+u*u+72*c-58*a)*h*h*h*h*h/120)+5e5,R=s*(p+l*Math.tan(m)*(h*h/2+(5-u+9*c+4*c*c)*h*h*h*h/24+(61-58*u+u*u+600*c-330*a)*h*h*h*h*h*h/720));return e<0&&(R+=1e7),{northing:Math.round(R),easting:Math.round(I),zoneNumber:S,zoneLetter:xbr(e)}}function MWe(i){var e=i.northing,t=i.easting,r=i.zoneLetter,n=i.zoneNumber;if(n<0||n>60)return null;var s=.9996,o=6378137,a=.00669438,l,u=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),c,h,p,m,v,w,S,I,R,L=t-5e5,k=e;r<"N"&&(k-=1e7),S=(n-1)*6-180+3,l=a/(1-a),w=k/s,I=w/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),R=I+(3*u/2-27*u*u*u/32)*Math.sin(2*I)+(21*u*u/16-55*u*u*u*u/32)*Math.sin(4*I)+151*u*u*u/96*Math.sin(6*I),c=o/Math.sqrt(1-a*Math.sin(R)*Math.sin(R)),h=Math.tan(R)*Math.tan(R),p=l*Math.cos(R)*Math.cos(R),m=o*(1-a)/Math.pow(1-a*Math.sin(R)*Math.sin(R),1.5),v=L/(c*s);var B=R-c*Math.tan(R)/m*(v*v/2-(5+3*h+10*p-4*p*p-9*l)*v*v*v*v/24+(61+90*h+298*p+45*h*h-252*l-3*p*p)*v*v*v*v*v*v/720);B=aut(B);var $=(v-(1+2*h+p)*v*v*v/6+(5-2*p+28*h-3*p*p+8*l+24*h*h)*v*v*v*v*v/120)/Math.cos(R);$=S+aut($);var V;if(i.accuracy){var Y=MWe({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});V={top:Y.lat,right:Y.lon,bottom:B,left:$}}else V={lat:B,lon:$};return V}function xbr(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function Sbr(i,e){var t="00000"+i.easting,r="00000"+i.northing;return i.zoneNumber+i.zoneLetter+Tbr(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+r.substr(r.length-5,e)}function Tbr(i,e,t){var r=VFt(t),n=Math.floor(i/1e5),s=Math.floor(e/1e5)%20;return Cbr(n,s,r)}function VFt(i){var e=i%out;return e===0&&(e=out),e}function Cbr(i,e,t){var r=t-1,n=jFt.charCodeAt(r),s=GFt.charCodeAt(r),o=n+i-1,a=s+e,l=!1;o>qQ&&(o=o-qQ+Vz-1,l=!0),(o===Q_||nQ_||(o>Q_||nz2||(o>z2||nqQ&&(o=o-qQ+Vz-1),a>WQ?(a=a-WQ+Vz-1,l=!0):l=!1,(a===Q_||sQ_||(a>Q_||sz2||(a>z2||sWQ&&(a=a-WQ+Vz-1);var u=String.fromCharCode(o)+String.fromCharCode(a);return u}function HFt(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,r="",n,s=0;!/[A-Z]/.test(n=i.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+i;r+=n,s++}var o=parseInt(r,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+i;var a=i.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+i;t=i.substring(s,s+=2);for(var l=VFt(o),u=Ebr(t.charAt(0),l),c=Ibr(t.charAt(1),l);c{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return jst(this.map)?this.map.initialViewProperties.timeZone:null}hasLayerViewModule(e){return llt.hasLayerViewModule(e)}importLayerView(e){return llt.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(di.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),r=await this.hitTest(e),n=this.allLayerViews.toArray().reverse(),s=new globalThis.Map(n.map(u=>[u.layer.uid,u])),o=[];let a=0,l=0;for(;athis._updateStageChildren()),t.on("webgl-error",a=>this.fatalError=a.error),Ki(()=>this.stationary,a=>t.stationary=a,Ah),Ki(()=>this.background,a=>{t.backgroundColor=a?.color,this._magnifierView.backgroundColor=a?.color},Ah),Ki(()=>this.magnifier,a=>this._magnifierView.magnifier=a,Ah),Ki(()=>this.renderingOptions,a=>t.renderingOptions=a,Ah),Ki(()=>this.highlightOptions,a=>t.highlightOptions=a,Ah),Ki(()=>this.state.id,()=>t.state=this.state,Ah)],"map-view"),this._updateStageChildren();const o=this._resolveWhenReady;this._resolveWhenReady=[],o.forEach(a=>a(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(t=>{this.stage.addChild(t.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView)}_setupSpatialReferenceDependentProperties(){const e=new ak(fu.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new bFt({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new wFt(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:r,size:n,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:r,size:n,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const t of this.allLayerViews)t.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const t of this.allLayerViews)t.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}};Ca.type="2d",x([D({readOnly:!0})],Ca.prototype,"animationManager",void 0),x([D({constructOnly:!0})],Ca.prototype,"deactivatedWebGLExtensions",void 0),x([D({constructOnly:!0})],Ca.prototype,"debugWebGLExtensions",void 0),x([D({readOnly:!0})],Ca.prototype,"featuresTilingScheme",void 0),x([D({readOnly:!0})],Ca.prototype,"fullOpacity",void 0),x([D()],Ca.prototype,"goToManager",void 0),x([D({readOnly:!0})],Ca.prototype,"graphicsTileStore",null),x([D()],Ca.prototype,"graphicsView",void 0),x([D()],Ca.prototype,"stateManager",void 0),x([D()],Ca.prototype,"constraintsInfo",null),x([D({readOnly:!0})],Ca.prototype,"state",null),x([D()],Ca.prototype,"initialExtentRequired",null),x([D()],Ca.prototype,"labelManager",void 0),x([D({readOnly:!0})],Ca.prototype,"mapViewNavigation",void 0),x([D({constructOnly:!0})],Ca.prototype,"renderCanvas",void 0),x([D()],Ca.prototype,"renderingOptions",void 0),x([D({constructOnly:!0})],Ca.prototype,"supersampleScreenshotsEnabled",void 0),x([D({readOnly:!0})],Ca.prototype,"supportsGround",void 0),x([D()],Ca.prototype,"_defaultsFromMapSettings",null),x([D({readOnly:!0})],Ca.prototype,"typeSpecificPreconditionsReady",null),x([D()],Ca.prototype,"animation",null),x([D({type:vFt})],Ca.prototype,"background",null),x([D()],Ca.prototype,"center",null),x([D({type:l5t})],Ca.prototype,"constraints",null),x([D()],Ca.prototype,"extent",null),x([D()],Ca.prototype,"floors",void 0),x([D({type:tse})],Ca.prototype,"highlightOptions",void 0),x([D({readOnly:!0})],Ca.prototype,"inputManager",void 0),x([D()],Ca.prototype,"map",void 0),x([D()],Ca.prototype,"padding",null),x([D({readOnly:!0})],Ca.prototype,"rendering",null),x([D()],Ca.prototype,"resizeAlign",null),x([D({readOnly:!0})],Ca.prototype,"resolution",null),x([D()],Ca.prototype,"rotation",null),x([D()],Ca.prototype,"scale",null),x([D({constructOnly:!0})],Ca.prototype,"spatialReferenceLocked",void 0),x([D()],Ca.prototype,"stationary",null),x([D({type:xWe,readOnly:!0})],Ca.prototype,"timeline",void 0),x([D({readOnly:!0})],Ca.prototype,"type",void 0),x([D({readOnly:!0})],Ca.prototype,"updating",null),x([D()],Ca.prototype,"viewpoint",null),x([D()],Ca.prototype,"zoom",null),x([D({readOnly:!0})],Ca.prototype,"navigating",null),x([D(),So(i=>i instanceof gFt?i:Cu(yFt,i))],Ca.prototype,"ui",void 0),Ca=x([Qe("esri.views.MapView")],Ca);const CFt=Ca;class xl{wkid;latestWkid;wkt;constructor(e,t){typeof e=="string"?this.wkt=e:(this.wkid=e,this.latestWkid=t)}isEqual(e){return!!(this.isWebMercator()&&e.isWebMercator()||this.wkid&&e.wkid&&this.wkid===e.wkid||this.wkt&&e.wkt&&this.wkt===e.wkt||this.latestWkid&&e.latestWkid&&this.latestWkid===e.latestWkid)}clone(){const e=new xl("");return e.latestWkid=this.latestWkid,e.wkid=this.wkid,e.wkt=this.wkt,e}lean(){const e={};return this.wkt?e.wkt=this.wkt:(e.wkid=this.wkid,this.latestWkid&&(e.latestWkid=this.latestWkid)),e}isWebMercator(){const e=[900913,3587,54004,41001,102113,102100,3785];return!!(this.wkid&&e.includes(this.wkid)||this.latestWkid&&e.includes(this.latestWkid))}static latLongSR(){return new xl(4326)}static fromConfig(e){if(e.wkt)return new xl(e.wkt);if(e.wkid)return new xl(e.wkid,e.latestWkid);throw new Error("Could not parse config spatial reference object")}static parseSR(e){return e?e instanceof xl?e.clone():new xl(e):xl.latLongSR()}static fromESRI(e){if(e.wkt)return new xl(e.wkt);{const t=e.toJSON().latestWkid,r=new xl(e.wkid);return t&&(r.latestWkid=t),r}}toESRI(){return new Xi(this.lean())}static fromGeoJSON(e){const t=xl.parseGeoJsonCrs(e);return t.substring(0,5)==="EPSG:"?new xl(parseInt(t.slice(5))):new xl(t)}static parseGeoJsonCrs(e){if(e){if(e.type==="name"){const t=/urn:ogc:def:crs:EPSG::(\d+)/,r=e.properties.name,n=r.match(t);if(n)return"EPSG:"+n[1];if(r.substring(0,7)!=="urn:ogc")return r}}else return"EPSG:4326";return console.error("Encountered unsupported GeoJSON CRS format. Defaulting to lat-long, resuling conversion is likely wrong",e),"EPSG:4326"}toGeoJSON(){const e={type:"name",properties:{name:""}};return this.wkt?e.properties.name=this.wkt:e.properties.name="urn:ogc:def:crs:EPSG::"+(this.latestWkid||this.wkid),e}}class t7{sr;id;constructor(e,t){this.id=e?e.toString():"",this.sr=xl.parseSR(t)}get type(){return cl.UNKNOWN}childIdGenerator(e){return`${this.id}-${e}`}toESRI(){throw new Error(`.toESRI not implemented on geometry type ${this.type}`)}toGeoJSON(){throw new Error(`.toGeoJSON not implemented on geometry type ${this.type}`)}invalid(){return this.type===cl.NONE||this.type===cl.UNKNOWN}geoJsonFactory(e,t){const r={type:e,coordinates:t};return this.sr&&(r.crs=this.sr.toGeoJSON()),r}}class Kk extends t7{constructor(){super("no_geometry")}get type(){return cl.NONE}}let s0=class HQ extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=t.slice():this.rawArray=HQ.parseXY(t)}get type(){return cl.POINT}get x(){return this.rawArray[0]}set x(e){this.rawArray[0]=e}get y(){return this.rawArray[1]}set y(e){this.rawArray[1]=e}toArray(){return this.rawArray.slice()}static parseXY(e){let t;if(Array.isArray(e)&&e.length===2)t=e;else{if(e instanceof HQ)return e.toArray();t=[e.x,e.y]}if(isNaN(t[0])||isNaN(t[1]))throw new Error("Unsupported point format detected. Supported formats are two element array of numbers, or object with x and y properties containing numbers");return[parseFloat(t[0]),parseFloat(t[1])]}static fromESRI(e,t){return new HQ(t,[e.x,e.y],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $i({x:this.x,y:this.y,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new HQ(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POINT,this.toArray())}};class bb extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=bb.arrayDeepCopy(t):t instanceof bb?this.rawArray=t.toArray():this.rawArray=bb.parsePointSet(t)}get pointArray(){return this.rawArray.map((e,t)=>new s0(this.childIdGenerator(t),e,this.sr,!0))}getAt(e){return new s0(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,t){this.rawArray[t]=s0.parseXY(e)}get length(){return this.rawArray.length}toArray(){return bb.arrayDeepCopy(this.rawArray)}static parsePointSet(e){if(Array.isArray(e)){if(e.length===0)throw new Error("no verticies provided");return e.map(t=>s0.parseXY(t))}else throw new Error("Bad geometry input encountered")}static arrayDeepCopy(e){return e.map(t=>t.slice())}}class XV extends bb{constructor(e,t,r,n){super(e,t,r,n)}get type(){return cl.MULTIPOINT}static fromESRI(e,t){return new XV(t,e.points,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new Oh({points:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new XV(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTIPOINT,this.toArray())}}class TF extends bb{constructor(e,t,r,n){if(super(e,t,r,n),this.rawArray.length<2)throw new Error("lines require at least two verticies")}get type(){return cl.LINESTRING}static fromESRI(e,t){return new TF(t,e.paths[0],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new lo({paths:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new TF(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.LINESTRING,this.toArray())}}class CC extends t7{rawArray;constructor(e,t,r,n){if(super(e,t.sr||r),n)this.rawArray=CC.arrayDeepCopy(t);else if(t instanceof CC)this.rawArray=t.toArray();else if(t instanceof bb)this.rawArray=[t.toArray()];else if(Array.isArray(t)){if(t.length===0)throw new Error("no lines provided");this.rawArray=t.map(s=>bb.parsePointSet(s))}else throw new Error("invalid lines format for MulitLineString")}get lineArray(){return this.rawArray.map((e,t)=>new TF(this.childIdGenerator(t),e,this.sr,!0))}getAt(e){return new TF(this.childIdGenerator(e),this.rawArray[e],this.sr,!0)}updateAt(e,t){this.rawArray[t]=bb.parsePointSet(e)}get length(){return this.rawArray.length}get type(){return cl.MULTILINESTRING}toArray(){return CC.arrayDeepCopy(this.rawArray)}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.slice()))}static fromESRI(e,t){return new CC(t,e.paths,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new lo({paths:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new CC(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTILINESTRING,this.toArray())}}class r9 extends bb{constructor(e,t,r,n){if(super(e,t,r,n),r9.closeRing(this.rawArray),this.length<4)throw new Error("Linear Ring must have at least 3 distinct vertices.")}get type(){return cl.LINEARRING}updateAt(e,t){const r=this.length-1;t===0?super.updateAt(e,r):t===r&&super.updateAt(e,0),super.updateAt(e,t)}static closeRing(e){const t=e[0],r=e[e.length-1];(t[0]!==r[0]||t[1]!==r[1])&&e.push(t.slice())}static fromESRI(e,t){return new r9(t,e.rings[0],xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $s({rings:[this.toArray()],spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new r9(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POLYGON,[this.toArray()])}}class Zy extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=Zy.arrayDeepCopy(t):this.rawArray=Zy.parsePolygon(t)}addLinearRings(e){e.forEach(t=>this.rawArray.push(t.toArray()))}get ringArray(){return this.rawArray.map((e,t)=>new r9(this.childIdGenerator(t),e,this.sr,!0))}get type(){return cl.POLYGON}toArray(){return Zy.arrayDeepCopy(this.rawArray)}static parsePolygon(e){let t=[];if(e instanceof Zy)return e.toArray();if(e instanceof CC)t=e.toArray();else if(e instanceof bb)t=[e.toArray()];else if(Array.isArray(e)){if(e.length===0)throw new Error("no rings provided");t=e.map(r=>bb.parsePointSet(r))}else throw new Error("invalid input format for parsePolygon");return t.forEach(r=>r9.closeRing(r)),t}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.slice()))}static fromESRI(e,t){return new Zy(t,e.rings,xl.fromESRI(e.spatialReference),!0)}toESRI(){return new $s({rings:this.toArray(),spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new Zy(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.POLYGON,this.toArray())}}class QO extends t7{rawArray;constructor(e,t,r,n){super(e,t.sr||r),n?this.rawArray=QO.arrayDeepCopy(t):this.rawArray=QO.parseMultiPolygon(t)}addPolygon(e){this.rawArray.push(e.toArray())}get polygonArray(){return this.rawArray.map((e,t)=>new Zy(this.childIdGenerator(t),e,this.sr,!0))}get type(){return cl.MULTIPOLYGON}toArray(){return QO.arrayDeepCopy(this.rawArray)}static parseMultiPolygon(e){if(e instanceof QO)return e.toArray();if(e instanceof Zy)return[e.toArray()];if(e instanceof CC||e instanceof bb)return[Zy.parsePolygon(e)];if(Array.isArray(e)){if(e.length===0)throw new Error("no polygons provided");return e.map(t=>Zy.parsePolygon(t))}else throw new Error("invalid input format for parseMultiPolygon")}static arrayDeepCopy(e){return e.map(t=>t.map(r=>r.map(n=>n.slice())))}static fromESRI(e,t){return new QO(t,[e.rings],xl.fromESRI(e.spatialReference),!0)}toESRI(){const e=[];return this.toArray().forEach(t=>{t.forEach(r=>e.push(r))}),new $s({rings:e,spatialReference:this.sr.toESRI()})}static fromGeoJSON(e,t){return new QO(t,e.coordinates,xl.fromGeoJSON(e.crs),!0)}toGeoJSON(){return this.geoJsonFactory(jp.MULTIPOLYGON,this.toArray())}}class Yh extends t7{rawMin;rawMax;constructor(e,t,r,n){super(e,t.sr||n),this.rawMin=s0.parseXY(t),this.rawMax=s0.parseXY(r)}get type(){return cl.EXTENT}get xmin(){return this.rawMin[0]}get ymin(){return this.rawMin[1]}get xmax(){return this.rawMax[0]}get ymax(){return this.rawMax[1]}center(){return new s0(this.id+"_centerPoint",[(this.xmax-this.xmin)/2+this.xmin,(this.ymax-this.ymin)/2+this.ymin],this.sr,!0)}expand(e){return Yh.fromESRI(this.toESRI().expand(e),`${this.id}-expanded`)}clone(){return new Yh(this.id,this.rawMin,this.rawMax,this.sr)}contains(e){return this.sr.isEqual(e.sr)?this.xmin<=e.x&&this.xmax>=e.x&&this.ymin<=e.y&&this.ymax>=e.y:(console.error("Extent.contains(point) must have point in same spatial reference as the extent."),!1)}toArray(){return[this.rawMin.slice(),this.rawMax.slice()]}toPolygonArray(){return[[this.rawMin.slice(),[this.xmin,this.ymax],this.rawMax.slice(),[this.xmax,this.ymin],this.rawMin.slice()]]}toPolygon(){return new Zy(this.id,this.toPolygonArray(),this.sr,!0)}static fromParams(e,t,r,n,s,o){return new Yh(e,[t,r],[n,s],o)}static fromConfig(e,t){return new Yh(e,[t.xmin,t.ymin],[t.xmax,t.ymax],xl.fromConfig(t.spatialReference))}isEqual(e){return e?this.xmin===e.xmin&&this.ymin===e.ymin&&this.xmax===e.xmax&&this.ymax===e.ymax:!1}static fromESRI(e,t){return Yh.fromParams(t,e.xmin,e.ymin,e.xmax,e.ymax,xl.fromESRI(e.spatialReference))}toESRI(){return new hr({xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax,spatialReference:this.sr.toESRI()})}static fromArcServer(e,t){return Yh.fromESRI(hr.fromJSON(e),t)}static fromGeoJSON(e,t){if(e.coordinates.length!==5)throw new Error("Extent expected a four vertex polygon from GeoJSON");const r=e.coordinates[0].slice(),n=r.slice();return[1,2,3].forEach(s=>{[0,1].forEach(o=>{const a=e.coordinates[s];r[o]>a[o]&&(r[o]=a[o]),n[o]4){console.error("Invalid colour value array passed to Colour class"),this.c=[0,0,0,1];return}this.c=e.map((r,n)=>n===3?r:parseInt(r)),t===3&&this.c.push(1)}else if(typeof e=="string"){const t=e.substring(0,1)==="#"?e.substring(1):e;this.c=[0,2,4,6].map(r=>{const n=t.substring(r,r+2);return bR.hexToInt(n)})}else this.c=[e.r,e.g,e.b,e.a??1];this.c.forEach((t,r)=>{t<0&&(console.error("Negative value passed to colour"),this.c[r]=0),t>255&&(console.error("Rotund value passed to colour"),this.c[r]=255)}),this.c[3]>1&&(this.c[3]=this.c[3]/255)}get rgba(){return this.c.slice()}get hex(){const e=this.rgba;return e[3]=e[3]*255,`#${e.map(t=>bR.intToHex(t)).join("")}`}get r(){return this.c[0]}get g(){return this.c[1]}get b(){return this.c[2]}get a(){return this.c[3]}toESRI(){return new jr(this.rgba)}toArcServer(){return[this.c[0],this.c[1],this.c[2],255*this.c[3]]}static hexToInt(e){return e.length===0?255:parseInt(e,16)}static intToHex(e){const t=e.toString(16);return t.length===1?`0${t}`:t}}class eP{toOptions(){throw new Error(".toOptions called on BaseStyle. Likely was not implemented on subclass.")}toESRI(){throw new Error(".toESRI called on BaseStyle. Likely was not implemented on subclass.")}static convToPoints(e){if(!(typeof e>"u"))if(typeof e=="string"){let t;const r=e.length;if(r===0)return;const n=e.substring(r-2);return n==="px"?t=parseFloat(e.substring(0,r-2))*1.333333:n==="pt"?t=parseFloat(e.substring(0,r-2)):t=parseFloat(e),t}else return e}}class vP extends eP{_height;_xOffset;_yOffset;_icon;_width;_size;_colour;_style;_outline;_path;_angle;constructor(e){if(e=e||{style:zI.CIRCLE},super(),this._style=e.style||zI.CIRCLE,e.style===zI.ICON){const t=e;this._icon=t.icon||"",this._height=eP.convToPoints(t.height)||16.5,this._width=eP.convToPoints(t.width)||16.5,this._size=0,this._colour=new bR,this._outline=new WA,this._path=""}else{const t=e;this._size=eP.convToPoints(t.size)||12,this._colour=new bR(t.colour??"#ffffff40"),this._outline=new WA(t.outline),this._path=this._style===zI.PATH&&t.path||"",this._height=0,this._width=0,this._icon=""}this._xOffset=eP.convToPoints(e.xOffset)||0,this._yOffset=eP.convToPoints(e.yOffset)||0,this._angle=e.angle||0}get colour(){return this.propGrouse(!1),this._colour}get styleType(){return this._style}get width(){return this.propGrouse(!0),this._width}get height(){return this.propGrouse(!0),this._height}get size(){return this.propGrouse(!1),this._size}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}get angle(){return this._angle}get icon(){return this.propGrouse(!0),this._icon}get outline(){return this.propGrouse(!1),this._outline}get path(){return this.propGrouse(!1),this._path}propGrouse(e){this._style===zI.ICON!==e&&console.warn(`Accessed a point style property that is invalid for the style type ${this._style}`)}toOptions(){const e={style:this.styleType,yOffset:this.yOffset,xOffset:this.xOffset,angle:this.angle};return this._style===zI.ICON?{...e,icon:this.icon,width:this.width,height:this.height}:{...e,size:this.size,colour:this.colour.hex,path:this.path}}toESRI(){let e;return this.styleType===zI.ICON?vP.isImageUrl(this.icon)?(e=new BP,e.url=this.icon,e.width=this.width,e.height=this.height,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new Jh,e.color=new jr(this.colour.rgba),e.size=this.width,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle):(e=new Jh,e.color=new jr(this.colour.rgba),e.size=this.size,e.xoffset=this.xOffset,e.yoffset=this.yOffset,e.angle=this.angle,e.path=this.path,e.style=this.styleType,e.outline=this.outline.toESRI()),e}static fromESRI(e){const t={xOffset:e.xoffset,yOffset:e.yoffset,angle:e.angle};if(e.type==="simple-marker"){const r=t;r.style=e.style,r.colour=e.color.toRgba(),r.size=e.size,r.path=e.path,r.outline=WA.fromESRI(e.outline).toOptions()}else{const r=t;r.style=zI.ICON,r.width=e.width,r.height=e.height,r.icon=e.url}return new vP(t)}static fromArcServer(e){return vP.fromESRI(wae(e))}static isImageUrl(e){return!!e.match(/\.(jpeg|jpg|gif|png|swf|svg)$/)||!!e.match(/^\s*data:([a-z]+\/[a-z0-9\-\+]+(;[a-z\-]+\=[a-z0-9\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i)}}class WA extends eP{_style;_width;_miter;_cap;_join;_colour;constructor(e){e=e||{},super(),this._style=e.style||K_.SOLID;const t=eP.convToPoints(e.width);this._width=typeof t>"u"||t<0?.75:t,this._colour=new bR(e.colour),this._miter=e.miter??2,this._cap=e.cap||kTt.ROUND,this._join=e.join||FTt.ROUND}get styleType(){return this._style}get width(){return this._width}get colour(){return this._colour}get miter(){return this._miter}get cap(){return this._cap}get join(){return this._join}toOptions(){return{style:this.styleType,width:this.width,colour:this.colour.hex,miter:this.miter,cap:this.cap,join:this.join}}toESRI(){const e=new vg;return e.width=this.width,e.color=this.colour.toESRI(),e.style=this.styleType,e.cap=this.cap,e.miterLimit=this.miter,e.join=this.join,e}static fromESRI(e){const t={width:e.width,colour:e.color.toRgba(),style:e.style};return new WA(t)}static fromArcServer(e){return WA.fromESRI(wae(e))}}class jW extends eP{_outlineStyle;_fillColour;_fillStyle;constructor(e){super(),e=e||{},e.fill||(e.fill={}),this._fillColour=new bR(e.fill.colour),this._fillStyle=e.fill.style||LTt.SOLID,this._outlineStyle=new WA(e.outline)}get fillColour(){return this._fillColour}get fillStyleType(){return this._fillStyle}get outline(){return this._outlineStyle}toOptions(){return{fill:{style:this.fillStyleType,colour:this.fillColour.hex},outline:this.outline.toOptions()}}toESRI(){const e=this.outline.toESRI(),t=new jr(this.fillColour.rgba),r=new Hx;return r.style=this.fillStyleType,r.color=t,r.outline=e,r}static fromESRI(e){const t={fill:{colour:e.color.toRgba(),style:e.style},outline:WA.fromESRI(e.outline).toOptions()};return new jW(t)}static fromArcServer(e){return jW.fromESRI(wae(e))}}class Z1r{Extent=Yh;Graphic=Ax;LineString=TF;LineStyle=WA;LinearRing=r9;MultiLineString=CC;MultiPoint=XV;MultiPolygon=QO;Point=s0;PointStyle=vP;Polygon=Zy;PolygonStyle=jW;SpatialReference=xl;esriMapClickToRamp(e,t){return{mapPoint:s0.fromESRI(e.mapPoint,t),screenX:e.x,screenY:e.y,button:e.button,input:e.native.pointerType,clickTime:e.timestamp}}esriMapMouseToRamp(e){return{screenX:e.x,screenY:e.y,button:e.button,moveTime:e.timestamp}}geomRampToEsri(e){return e.toESRI()}geomEsriToRamp(e,t){switch(e.type){case"point":return s0.fromESRI(e,t);case"polyline":{const r=e;return r.paths.length===1?TF.fromESRI(r,t):CC.fromESRI(r,t)}case"polygon":return Zy.fromESRI(e,t);case"extent":return Yh.fromESRI(e,t);case"multipoint":return XV.fromESRI(e,t);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomGeoJsonToRamp(e,t){switch(e.type){case jp.POINT:return s0.fromGeoJSON(e,t);case jp.LINESTRING:return TF.fromGeoJSON(e,t);case jp.POLYGON:return Zy.fromGeoJSON(e,t);case jp.MULTIPOINT:return XV.fromGeoJSON(e,t);case jp.MULTILINESTRING:return CC.fromGeoJSON(e,t);case jp.MULTIPOLYGON:return QO.fromGeoJSON(e,t);default:throw new Error(`Encountered unhandled geometry type ${e.type}`)}}geomRampToGeoJson(e){return e.toGeoJSON()}graphicRampToGeoJson(e){const t={},r={type:"Feature",geometry:this.geomRampToGeoJson(e.geometry),properties:t};return Object.keys(e.attributes).forEach(n=>r.properties[n]=e.attributes[n]),r}graphicGeoJsonToRamp(e,t){if(e.type!=="Feature")throw new Error("Expected input parameter of graphicGeoJsonToRamp to be a GeoJson feature");const r=this.geomGeoJsonToRamp(e.geometry,t),n={};return Object.keys(e.properties.forEach(o=>n[o]=e.properties[o])),new Ax(r,"",n)}graphicRampToEsri(e){const t={attributes:{},id:e.id};return t.geometry=this.geomRampToEsri(e.geometry),Object.keys(e.attributes).forEach(r=>t.attributes[r]=e.attributes[r]),e.style&&(t.symbol=this.styleRampToEsri(e.style)),new Us(t)}styleRampToEsri(e){return e.toESRI()}styleEsriToRamp(e){switch(e.type){case"picture-marker":case"simple-marker":return vP.fromESRI(e);case"simple-line":return WA.fromESRI(e);case"simple-fill":return jW.fromESRI(e);default:return console.error(`Unsupported ESRI symbol type encountered: ${e.type}`),new vP}}serverGeomTypeToRampGeomType(e){if(!e)return cl.NONE;switch(e){case"esriGeometryPolygon":return cl.POLYGON;case"esriGeometryPolyline":return cl.LINESTRING;case"esriGeometryPoint":return cl.POINT;case"esriGeometryMultipoint":return cl.MULTIPOINT;case"esriGeometryEnvelope":return cl.EXTENT;default:return console.error(`Unrecognized server geometry type encountered: ${e}`),cl.UNKNOWN}}clientGeomTypeToRampGeomType(e){if(!e)return cl.NONE;switch(e){case"polygon":return cl.POLYGON;case"polyline":return cl.LINESTRING;case"point":return cl.POINT;case"multipoint":return cl.MULTIPOINT;default:return console.error(`Unrecognized client geometry type encountered: ${e}`),cl.UNKNOWN}}geoJsonGeomTypeToEsriGeomType(e){switch(e){case jp.POINT:return"point";case jp.LINESTRING:case jp.MULTILINESTRING:return"polyline";case jp.POLYGON:case jp.MULTIPOLYGON:return"polygon";case jp.MULTIPOINT:return"multipoint";default:throw new Error(`Encountered unhandled geometry type ${e}`)}}isImageUrl(e){return vP.isImageUrl(e)}}class q1e{layerIdx;name;children;uid;isRoot;constructor(e,t,r="",n=!0){this.layerIdx=e,this.name=r,this.isRoot=n,this.children=[],this.uid=t}findChildByUid(e){if(this.uid===e)return this;{let t;return this.children.some(r=>t=r.findChildByUid(e)),t}}findChildByIdx(e){if(this.layerIdx===e)return this;{let t;return this.children.some(r=>t=r.findChildByIdx(e)),t}}get isLogicalLayer(){return this.layerIdx>-1&&this.children.length===0}get isLayerRoot(){return this.isRoot}}class EFt{minScale;maxScale;constructor(e=0,t=0){this.minScale=e,this.maxScale=t}isOffScale(e){const t={offScale:!1,zoomIn:!1};return ethis.minScale&&this.minScale!==0&&(t.offScale=!0,t.zoomIn=!0),t}}let IFt=class{sql;cache;extent;constructor(e="",t=""){this.sql={[pm.PERMANENT]:e,[pm.INITIAL]:t},this.extent=void 0,this.cache={}}sqlActiveFilters(e=[]){const t=this.sql,r=Object.keys(t).filter(n=>t[n]);return e.length===0?r:r.filter(n=>e.indexOf(n)===-1)}isActive(){return this.sqlActiveFilters([pm.PERMANENT]).length>0}getCombinedSql(e=[]){const t=this.sqlActiveFilters(e),r=t.length;return r===0?"":r===1?this.sql[t[0]]:t.map(n=>`(${this.sql[n]})`).join(" AND ")}setSql(e,t){e===pm.PERMANENT?console.error("Attempted to overwrite a permanent filter. Not allowed."):(this.sql[e]=t,this.clearCacheSet(e))}getSql(e){return this.sql[e]||""}setExtent(e){e.isEqual(this.extent)||(this.extent=e,this.clearCacheSet(pm.EXTENT))}getCacheKey(e,t){return`_cache$${e.sort().join("$")}${t?"$"+pm.EXTENT:""}$`}getCache(e,t){const r=this.getCacheKey(e,t);return this.cache[r]}setCache(e,t,r){const n=this.getCacheKey(t,r);this.cache[n]=e}cacheActiveKeys(){const e=this.cache;return Object.keys(e).filter(t=>e[t])}clearAllCaches(){this.cache={}}clearCacheSet(e){this.cacheActiveKeys().forEach(t=>{t.indexOf(`$${e}$`)>-1&&delete this.cache[t]})}clearAll(){this.sql={[pm.PERMANENT]:this.sql[pm.PERMANENT]},this.extent=void 0,this.clearAllCaches()}};class rse{id;sr;_defaultExtent;_fullExtent;_maximumExtent;constructor(e,t,r=void 0,n=void 0){this.id=e,this.sr=t.sr.clone(),this._defaultExtent=t.clone(),this._fullExtent=r?.clone(),this._maximumExtent=n?.clone(),r&&!r.sr.isEqual(this.sr)&&console.error(`Full extent provided in extent set has a mismatching spatial reference: ${r.sr}`),n&&!n.sr.isEqual(this.sr)&&console.error(`Maximum extent provided in extent set has a mismatching spatial reference: ${n.sr}`)}get defaultExtent(){return this._defaultExtent}set defaultExtent(e){this._defaultExtent=e.clone()}get fullExtent(){return this._fullExtent?this._fullExtent:this.defaultExtent}set fullExtent(e){this._fullExtent=e.clone()}get maximumExtent(){return this._maximumExtent?this._maximumExtent:this.fullExtent}set maximumExtent(e){this._maximumExtent=e.clone()}static fromConfig(e){return new rse(e.id,Yh.fromConfig(`${e.id}-extent-default`,e.default),e.full!==void 0?Yh.fromConfig(`${e.id}-extent-full`,e.full):void 0,e.maximum!==void 0?Yh.fromConfig(`${e.id}-extent-maximum`,e.maximum):void 0)}clone(){return new rse(this.id,this._defaultExtent,this._fullExtent,this._maximumExtent)}}class Af{realPromise;resolveMe(){}rejectMe(){}getPromise(){return this.realPromise}constructor(){this.realPromise=new Promise((e,t)=>{this.resolveMe=e,this.rejectMe=t})}}var Hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function X3(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function wSe(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function r(){if(this instanceof r){var n=[null];n.push.apply(n,arguments);var s=Function.bind.apply(e,n);return new s}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var n=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return i[r]}})}),t}var Q1r=function(e){return e_r(e)&&!t_r(e)};function e_r(i){return!!i&&typeof i=="object"}function t_r(i){var e=Object.prototype.toString.call(i);return e==="[object RegExp]"||e==="[object Date]"||n_r(i)}var i_r=typeof Symbol=="function"&&Symbol.for,r_r=i_r?Symbol.for("react.element"):60103;function n_r(i){return i.$$typeof===r_r}function s_r(i){return Array.isArray(i)?[]:{}}function nse(i,e){return e.clone!==!1&&e.isMergeableObject(i)?GW(s_r(i),i,e):i}function o_r(i,e,t){return i.concat(e).map(function(r){return nse(r,t)})}function a_r(i,e){if(!e.customMerge)return GW;var t=e.customMerge(i);return typeof t=="function"?t:GW}function l_r(i){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(i).filter(function(e){return Object.propertyIsEnumerable.call(i,e)}):[]}function Wlt(i){return Object.keys(i).concat(l_r(i))}function AFt(i,e){try{return e in i}catch{return!1}}function u_r(i,e){return AFt(i,e)&&!(Object.hasOwnProperty.call(i,e)&&Object.propertyIsEnumerable.call(i,e))}function c_r(i,e,t){var r={};return t.isMergeableObject(i)&&Wlt(i).forEach(function(n){r[n]=nse(i[n],t)}),Wlt(e).forEach(function(n){u_r(i,n)||(AFt(i,n)&&t.isMergeableObject(e[n])?r[n]=a_r(n,t)(i[n],e[n],t):r[n]=nse(e[n],t))}),r}function GW(i,e,t){t=t||{},t.arrayMerge=t.arrayMerge||o_r,t.isMergeableObject=t.isMergeableObject||Q1r,t.cloneUnlessOtherwiseSpecified=nse;var r=Array.isArray(e),n=Array.isArray(i),s=r===n;return s?r?t.arrayMerge(i,e,t):c_r(i,e,t):nse(e,t)}GW.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return GW(r,n,t)},{})};var h_r=GW,d_r=h_r;const HY=X3(d_r);class p_r{generateUUID(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t==="x"?r:r&3|8).toString(16)})}convertImageToCanvas(e,t,r=!0){const n=t??window.document.createElement("canvas"),s=window.document.createElement("img");r&&(s.crossOrigin="anonymous");const o=new Promise((a,l)=>{s.addEventListener("load",()=>{n.width=s.width,n.height=s.height,n.getContext("2d")?.drawImage(s,0,0),a(n)}),s.addEventListener("error",u=>l(u))});return s.src=e,o}async convertImagetoDataURL(e,t="image/png"){return e.startsWith("data")?e:this.convertImageToCanvas(e).then(r=>r.toDataURL(t)).catch(r=>(console.error("Failed to load crossorigin image",e,r),e))}parseUrlIndex(e){const t={rootUrl:e,index:0},r=/\/(\d+)\/?$/,n=e.match(r);if(n){const s=n[1];t.index=isNaN(parseInt(s))?void 0:parseInt(s),t.rootUrl=e.substr(0,e.length-n[0].length)}else console.warn("Cannot extract layer index from url "+e);return t}}class sse{_url;_base;_query;_queryMap={};constructor(e){this._url=e,[this._base,this._query]=e.split("?").concat(""),this._queryMap=this._query.split("&").reduce((t,r)=>{const[n,s]=r.split("=");return t[n]=s,t},{})}get query(){return this._query}get base(){return this._base}get queryMap(){return this._queryMap}updateQuery(e){const t=HY.all([{},this.queryMap,e]);return`${this.base}${Object.entries(t).filter(([,n])=>n!==void 0).map(([n,s],o)=>`${o===0?"?":""}${n}=${s}`).join("&")}`}}var LMe={exports:{}},qlt;function MFt(){return qlt||(qlt=1,function(i,e){(function(t,r){i.exports=r(),typeof window=="object"&&(t.Terraformer=r())})(Hh,function(){var t={},r=6378137,n=57.29577951308232,s=.017453292519943,o={type:"link",properties:{href:"http://spatialreference.org/ref/sr-org/6928/ogcwkt/",type:"ogcwkt"}},a={type:"link",properties:{href:"http://spatialreference.org/ref/epsg/4326/ogcwkt/",type:"ogcwkt"}};function l(ye){return Object.prototype.toString.call(ye)==="[object Array]"}function u(){var ye=Array.prototype.slice.apply(arguments);typeof console!==void 0&&console.warn&&console.warn.apply(console,ye)}function c(ye,Ke){for(var ke in Ke)Ke.hasOwnProperty(ke)&&(ye[ke]=Ke[ke]);return ye}function h(ye){if(ye.type)switch(ye.type){case"Point":return[ye.coordinates[0],ye.coordinates[1],ye.coordinates[0],ye.coordinates[1]];case"MultiPoint":return v(ye.coordinates);case"LineString":return v(ye.coordinates);case"MultiLineString":return p(ye.coordinates);case"Polygon":return p(ye.coordinates);case"MultiPolygon":return m(ye.coordinates);case"Feature":return ye.geometry?h(ye.geometry):null;case"FeatureCollection":return w(ye);case"GeometryCollection":return S(ye);default:throw new Error("Unknown type: "+ye.type)}return null}function p(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=ht),(me===null||Htie)&&(ie=Ht)}return[Ke,me,ke,ie]}function m(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=_t),(me===null||Feie)&&(ie=Fe)}return[Ke,me,ke,ie]}function v(ye){for(var Ke=null,ke=null,me=null,ie=null,ge=0;geke)&&(ke=rt),(me===null||Meie)&&(ie=Me)}return[Ke,me,ke,ie]}function w(ye){for(var Ke=[],ke,me=ye.features.length-1;me>=0;me--)ke=h(ye.features[me].geometry),Ke.push([ke[0],ke[1]]),Ke.push([ke[2],ke[3]]);return v(Ke)}function S(ye){for(var Ke=[],ke,me=ye.geometries.length-1;me>=0;me--)ke=h(ye.geometries[me]),Ke.push([ke[0],ke[1]]),Ke.push([ke[2],ke[3]]);return v(Ke)}function I(ye){var Ke=h(ye);return{x:Ke[0],y:Ke[1],w:Math.abs(Ke[0]-Ke[2]),h:Math.abs(Ke[1]-Ke[3])}}function R(ye){return ye*n}function L(ye){return ye*s}function k(ye,Ke){for(var ke=0;keKe?1:0}function re(ye,Ke){return ye[0]>Ke[0]?-1:ye[0]Ke[1]?-1:ye[1]de(Ke,ke))&&(ke=ye[me])}return ke}function H(ye){if(ye.length===0)return[];if(ye.length===1)return ye;for(var Ke=[ye.sort(re)[0]],ke=0;ke0||!Ke&&rt<0)return!1}return!0}function ae(ye,Ke){for(var ke=!1,me=-1,ie=ye.length,ge=ie-1;++me=3)ye=this.coordinates;else return null;else if(this.type==="Polygon"||this.type==="MultiLineString")if(this.coordinates&&this.coordinates.length>0){for(Ke=0;Ke0){for(Ke=0;Ke=2)this.coordinates=Ke;else throw"Terraformer: invalid input for Terraformer.Point";this.type="Point"}yt.prototype=new tt,yt.prototype.constructor=yt;function Ct(ye){if(ye&&ye.type==="MultiPoint"&&ye.coordinates)c(this,ye);else if(l(ye))this.coordinates=ye;else throw"Terraformer: invalid input for Terraformer.MultiPoint";this.type="MultiPoint"}Ct.prototype=new tt,Ct.prototype.constructor=Ct,Ct.prototype.forEach=function(ye){for(var Ke=0;Ke1},At.prototype.holes=function(){var ye=[];if(this.hasHoles())for(var Ke=1;Ke=this.text.length)return;i=this.text[this.place++]}switch(this.state){case ase:return this.neutral(i);case OFt:return this.keyword(i);case Y1e:return this.quoted(i);case RFt:return this.afterquote(i);case PFt:return this.number(i);case AWe:return}};GR.prototype.afterquote=function(i){if(i==='"'){this.word+='"',this.state=Y1e;return}if(xSe.test(i)){this.word=this.word.trim(),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in afterquote yet, index '+this.place)};GR.prototype.afterItem=function(i){if(i===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=ase;return}if(i==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ase,this.currentObject=this.stack.pop(),this.currentObject||(this.state=AWe);return}};GR.prototype.number=function(i){if(DFt.test(i)){this.word+=i;return}if(xSe.test(i)){this.word=parseFloat(this.word),this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in number yet, index '+this.place)};GR.prototype.quoted=function(i){if(i==='"'){this.state=RFt;return}this.word+=i};GR.prototype.keyword=function(i){if(T_r.test(i)){this.word+=i;return}if(i==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=ase;return}if(xSe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in keyword yet, index '+this.place)};GR.prototype.neutral=function(i){if(S_r.test(i)){this.word=i,this.state=OFt;return}if(i==='"'){this.word="",this.state=Y1e;return}if(DFt.test(i)){this.word=i,this.state=PFt;return}if(xSe.test(i)){this.afterItem(i);return}throw new Error(`havn't handled "`+i+'" in neutral yet, index '+this.place)};GR.prototype.output=function(){for(;this.place0?90:-90),i.lat_ts=i.lat1)}function FFt(i){var e=C_r(i),t=e.shift(),r=e.shift();e.unshift(["name",r]),e.unshift(["type",t]);var n={};return Uz(e,n),A_r(n),n}function F1(i){var e=this;if(arguments.length===2){var t=arguments[1];typeof t=="string"?t.charAt(0)==="+"?F1[i]=JNe(arguments[1]):F1[i]=FFt(arguments[1]):F1[i]=t}else if(arguments.length===1){if(Array.isArray(i))return i.map(function(r){Array.isArray(r)?F1.apply(e,r):F1(r)});if(typeof i=="string"){if(i in F1)return F1[i]}else"EPSG"in i?F1["EPSG:"+i.EPSG]=i:"ESRI"in i?F1["ESRI:"+i.ESRI]=i:"IAU2000"in i?F1["IAU2000:"+i.IAU2000]=i:console.log(i);return}}m_r(F1);function M_r(i){return typeof i=="string"}function O_r(i){return i in F1}var P_r=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function R_r(i){return P_r.some(function(e){return i.indexOf(e)>-1})}var D_r=["3857","900913","3785","102113"];function F_r(i){var e=uk(i,"authority");if(e){var t=uk(e,"epsg");return t&&D_r.indexOf(t)>-1}}function k_r(i){var e=uk(i,"extension");if(e)return uk(e,"proj4")}function L_r(i){return i[0]==="+"}function N_r(i){if(M_r(i)){if(O_r(i))return F1[i];if(R_r(i)){var e=FFt(i);if(F_r(e))return F1["EPSG:3857"];var t=k_r(e);return t?JNe(t):e}if(L_r(i))return JNe(i)}else return i}function Zlt(i,e){i=i||{};var t,r;if(!e)return i;for(r in e)t=e[r],t!==void 0&&(i[r]=t);return i}function v3(i,e,t){var r=i*e;return t/Math.sqrt(1-r*r)}function Gae(i){return i<0?-1:1}function Gs(i){return Math.abs(i)<=mf?i:i-Gae(i)*ose}function QC(i,e,t){var r=i*t,n=.5*i;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(An-e))/r}function lse(i,e){for(var t=.5*i,r,n,s=An-2*Math.atan(e),o=0;o<=15;o++)if(r=i*Math.sin(s),n=An-2*Math.atan(e*Math.pow((1-r)/(1+r),t))-s,s+=n,Math.abs(n)<=1e-10)return s;return-9999}function $_r(){var i=this.b/this.a;this.es=1-i*i,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=v3(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function B_r(i){var e=i.x,t=i.y;if(t*OA>90&&t*OA<-90&&e*OA>180&&e*OA<-180)return null;var r,n;if(Math.abs(Math.abs(t)-An)<=ys)return null;if(this.sphere)r=this.x0+this.a*this.k0*Gs(e-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan($c+.5*t));else{var s=Math.sin(t),o=QC(this.e,t,s);r=this.x0+this.a*this.k0*Gs(e-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return i.x=r,i.y=n,i}function j_r(i){var e=i.x-this.x0,t=i.y-this.y0,r,n;if(this.sphere)n=An-2*Math.atan(Math.exp(-t/(this.a*this.k0)));else{var s=Math.exp(-t/(this.a*this.k0));if(n=lse(this.e,s),n===-9999)return null}return r=Gs(this.long0+e/(this.a*this.k0)),i.x=r,i.y=n,i}var G_r=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const U_r={init:$_r,forward:B_r,inverse:j_r,names:G_r};function z_r(){}function Qlt(i){return i}var V_r=["longlat","identity"];const H_r={init:z_r,forward:Qlt,inverse:Qlt,names:V_r};var W_r=[U_r,H_r],bge={},X1e=[];function kFt(i,e){var t=X1e.length;return i.names?(X1e[t]=i,i.names.forEach(function(r){bge[r.toLowerCase()]=t}),this):(console.log(e),!0)}function q_r(i){if(!i)return!1;var e=i.toLowerCase();if(typeof bge[e]<"u"&&X1e[bge[e]])return X1e[bge[e]]}function Y_r(){W_r.forEach(kFt)}const X_r={start:Y_r,add:kFt,get:q_r};var nl={};nl.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};nl.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};nl.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};nl.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};nl.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};nl.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};nl.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};nl.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};nl.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};nl.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};nl.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};nl.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};nl.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};nl.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};nl.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};nl.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};nl.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};nl.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};nl.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};nl.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};nl.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};nl.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};nl.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};nl.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};nl.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};nl.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};nl.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};nl.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};nl.hough={a:6378270,rf:297,ellipseName:"Hough"};nl.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};nl.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};nl.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};nl.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};nl.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};nl.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};nl.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};nl.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};nl.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};nl.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};nl.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};nl.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var J_r=nl.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};nl.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function K_r(i,e,t,r){var n=i*i,s=e*e,o=(n-s)/n,a=0;r?(i*=1-o*(v_r+o*(__r+o*b_r)),n=i*i,o=0):a=Math.sqrt(o);var l=(n-s)/s;return{es:o,e:a,ep2:l}}function Z_r(i,e,t,r,n){if(!i){var s=uk(nl,r);s||(s=J_r),i=s.a,e=s.b,t=s.rf}return t&&!e&&(e=(1-1/t)*i),(t===0||Math.abs(i-e)3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=gB,a.datum_params[3]*=Wie,a.datum_params[4]*=Wie,a.datum_params[5]*=Wie,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=JV,a.grids=o),a.a=t,a.b=r,a.es=n,a.ep2=s,a}var LFt={};function ebr(i,e){var t=new DataView(e),r=rbr(t),n=nbr(t,r);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s=sbr(t,n,r),o={header:n,subgrids:s};return LFt[i]=o,o}function tbr(i){if(i===void 0)return null;var e=i.split(",");return e.map(ibr)}function ibr(i){if(i.length===0)return null;var e=i[0]==="@";return e&&(i=i.slice(1)),i==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:i,mandatory:!e,grid:LFt[i]||null,isNull:!1}}function zz(i){return i/3600*Math.PI/180}function rbr(i){var e=i.getInt32(8,!1);return e===11?!1:(e=i.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function nbr(i,e){return{nFields:i.getInt32(8,e),nSubgridFields:i.getInt32(24,e),nSubgrids:i.getInt32(40,e),shiftType:KNe(i,56,64).trim(),fromSemiMajorAxis:i.getFloat64(120,e),fromSemiMinorAxis:i.getFloat64(136,e),toSemiMajorAxis:i.getFloat64(152,e),toSemiMinorAxis:i.getFloat64(168,e)}}function KNe(i,e,t){return String.fromCharCode.apply(null,new Uint8Array(i.buffer.slice(e,t)))}function sbr(i,e,t){for(var r=176,n=[],s=0;s5e-11?!1:i.datum_type===mB?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]:i.datum_type===gB?i.datum_params[0]===e.datum_params[0]&&i.datum_params[1]===e.datum_params[1]&&i.datum_params[2]===e.datum_params[2]&&i.datum_params[3]===e.datum_params[3]&&i.datum_params[4]===e.datum_params[4]&&i.datum_params[5]===e.datum_params[5]&&i.datum_params[6]===e.datum_params[6]:!0}function NFt(i,e,t){var r=i.x,n=i.y,s=i.z?i.z:0,o,a,l,u;if(n<-An&&n>-1.001*An)n=-An;else if(n>An&&n<1.001*An)n=An;else{if(n<-An)return{x:-1/0,y:-1/0,z:i.z};if(n>An)return{x:1/0,y:1/0,z:i.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(n),u=Math.cos(n),l=a*a,o=t/Math.sqrt(1-e*l),{x:(o+s)*u*Math.cos(r),y:(o+s)*u*Math.sin(r),z:(o*(1-e)+s)*a}}function $Ft(i,e,t,r){var n=1e-12,s=n*n,o=30,a,l,u,c,h,p,m,v,w,S,I,R,L,k=i.x,B=i.y,$=i.z?i.z:0,V,Y,K;if(a=Math.sqrt(k*k+B*B),l=Math.sqrt(k*k+B*B+$*$),a/ts&&Lr.y||c>r.x||ma&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=Gs(s.x+t.ll[0]),r.y=s.y+t.ll[1]}else isNaN(s.x)||(r.x=i.x+s.x,r.y=i.y+s.y);return r}function tut(i,e){var t={x:i.x/e.del[0],y:i.y/e.del[1]},r={x:Math.floor(t.x),y:Math.floor(t.y)},n={x:t.x-1*r.x,y:t.y-1*r.y},s={x:Number.NaN,y:Number.NaN},o;if(r.x<0||r.x>=e.lim[0]||r.y<0||r.y>=e.lim[1])return s;o=r.y*e.lim[0]+r.x;var a={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var l={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var u={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var c={x:e.cvs[o][0],y:e.cvs[o][1]},h=n.x*n.y,p=n.x*(1-n.y),m=(1-n.x)*(1-n.y),v=(1-n.x)*n.y;return s.x=m*a.x+p*l.x+v*c.x+h*u.x,s.y=m*a.y+p*l.y+v*c.y+h*u.y,s}function iut(i,e,t){var r=t.x,n=t.y,s=t.z||0,o,a,l,u={};for(l=0;l<3;l++)if(!(e&&l===2&&t.z===void 0))switch(l===0?(o=r,"ew".indexOf(i.axis[l])!==-1?a="x":a="y"):l===1?(o=n,"ns".indexOf(i.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),i.axis[l]){case"e":u[a]=o;break;case"w":u[a]=-o;break;case"n":u[a]=o;break;case"s":u[a]=-o;break;case"u":t[a]!==void 0&&(u.z=o);break;case"d":t[a]!==void 0&&(u.z=-o);break;default:return null}return u}function BFt(i){var e={x:i[0],y:i[1]};return i.length>2&&(e.z=i[2]),i.length>3&&(e.m=i[3]),e}function fbr(i){rut(i.x),rut(i.y)}function rut(i){if(typeof Number.isFinite=="function"){if(Number.isFinite(i))return;throw new TypeError("coordinates must be finite numbers")}if(typeof i!="number"||i!==i||!isFinite(i))throw new TypeError("coordinates must be finite numbers")}function mbr(i,e){return(i.datum.datum_type===mB||i.datum.datum_type===gB||i.datum.datum_type===JV)&&e.datumCode!=="WGS84"||(e.datum.datum_type===mB||e.datum.datum_type===gB||e.datum.datum_type===JV)&&i.datumCode!=="WGS84"}function J1e(i,e,t,r){var n;Array.isArray(t)?t=BFt(t):t={x:t.x,y:t.y,z:t.z,m:t.m};var s=t.z!==void 0;if(fbr(t),i.datum&&e.datum&&mbr(i,e)&&(n=new qA("WGS84"),t=J1e(i,n,t,r),i=n),r&&i.axis!=="enu"&&(t=iut(i,!1,t)),i.projName==="longlat")t={x:t.x*Uy,y:t.y*Uy,z:t.z||0};else if(i.to_meter&&(t={x:t.x*i.to_meter,y:t.y*i.to_meter,z:t.z||0}),t=i.inverse(t),!t)return;if(i.from_greenwich&&(t.x+=i.from_greenwich),t=dbr(i.datum,e.datum,t),!!t)return e.from_greenwich&&(t={x:t.x-e.from_greenwich,y:t.y,z:t.z||0}),e.projName==="longlat"?t={x:t.x*OA,y:t.y*OA,z:t.z||0}:(t=e.forward(t),e.to_meter&&(t={x:t.x/e.to_meter,y:t.y/e.to_meter,z:t.z||0})),r&&e.axis!=="enu"?iut(e,!0,t):(s||delete t.z,t)}var nut=qA("WGS84");function NMe(i,e,t,r){var n,s,o;return Array.isArray(t)?(n=J1e(i,e,t,r)||{x:NaN,y:NaN},t.length>2?typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof n.z=="number"?[n.x,n.y,n.z].concat(t.splice(3)):[n.x,n.y,t[2]].concat(t.splice(3)):[n.x,n.y].concat(t.splice(2)):[n.x,n.y]):(s=J1e(i,e,t,r),o=Object.keys(t),o.length===2||o.forEach(function(a){if(typeof i.name<"u"&&i.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=t[a]}),s)}function sut(i){return i instanceof qA?i:i.oProj?i.oProj:qA(i)}function Ih(i,e,t){i=sut(i);var r=!1,n;return typeof e>"u"?(e=i,i=nut,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(t=e,e=i,i=nut,r=!0),e=sut(e),t?NMe(i,e,t):(n={forward:function(s,o){return NMe(i,e,s,o)},inverse:function(s,o){return NMe(e,i,s,o)}},r&&(n.oProj=e),n)}var out=6,jFt="AJSAJS",GFt="AFAFAF",Vz=65,Q_=73,z2=79,WQ=86,qQ=90;const gbr={forward:UFt,inverse:ybr,toPoint:zFt};function UFt(i,e){return e=e||5,bbr(vbr({lat:i[1],lon:i[0]}),e)}function ybr(i){var e=MWe(HFt(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function zFt(i){var e=MWe(HFt(i.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function $Me(i){return i*(Math.PI/180)}function aut(i){return 180*(i/Math.PI)}function vbr(i){var e=i.lat,t=i.lon,r=6378137,n=.00669438,s=.9996,o,a,l,u,c,h,p,m=$Me(e),v=$Me(t),w,S;S=Math.floor((t+180)/6)+1,t===180&&(S=60),e>=56&&e<64&&t>=3&&t<12&&(S=32),e>=72&&e<84&&(t>=0&&t<9?S=31:t>=9&&t<21?S=33:t>=21&&t<33?S=35:t>=33&&t<42&&(S=37)),o=(S-1)*6-180+3,w=$Me(o),a=n/(1-n),l=r/Math.sqrt(1-n*Math.sin(m)*Math.sin(m)),u=Math.tan(m)*Math.tan(m),c=a*Math.cos(m)*Math.cos(m),h=Math.cos(m)*(v-w),p=r*((1-n/4-3*n*n/64-5*n*n*n/256)*m-(3*n/8+3*n*n/32+45*n*n*n/1024)*Math.sin(2*m)+(15*n*n/256+45*n*n*n/1024)*Math.sin(4*m)-35*n*n*n/3072*Math.sin(6*m));var I=s*l*(h+(1-u+c)*h*h*h/6+(5-18*u+u*u+72*c-58*a)*h*h*h*h*h/120)+5e5,R=s*(p+l*Math.tan(m)*(h*h/2+(5-u+9*c+4*c*c)*h*h*h*h/24+(61-58*u+u*u+600*c-330*a)*h*h*h*h*h*h/720));return e<0&&(R+=1e7),{northing:Math.round(R),easting:Math.round(I),zoneNumber:S,zoneLetter:_br(e)}}function MWe(i){var e=i.northing,t=i.easting,r=i.zoneLetter,n=i.zoneNumber;if(n<0||n>60)return null;var s=.9996,o=6378137,a=.00669438,l,u=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),c,h,p,m,v,w,S,I,R,L=t-5e5,k=e;r<"N"&&(k-=1e7),S=(n-1)*6-180+3,l=a/(1-a),w=k/s,I=w/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),R=I+(3*u/2-27*u*u*u/32)*Math.sin(2*I)+(21*u*u/16-55*u*u*u*u/32)*Math.sin(4*I)+151*u*u*u/96*Math.sin(6*I),c=o/Math.sqrt(1-a*Math.sin(R)*Math.sin(R)),h=Math.tan(R)*Math.tan(R),p=l*Math.cos(R)*Math.cos(R),m=o*(1-a)/Math.pow(1-a*Math.sin(R)*Math.sin(R),1.5),v=L/(c*s);var B=R-c*Math.tan(R)/m*(v*v/2-(5+3*h+10*p-4*p*p-9*l)*v*v*v*v/24+(61+90*h+298*p+45*h*h-252*l-3*p*p)*v*v*v*v*v*v/720);B=aut(B);var $=(v-(1+2*h+p)*v*v*v/6+(5-2*p+28*h-3*p*p+8*l+24*h*h)*v*v*v*v*v/120)/Math.cos(R);$=S+aut($);var V;if(i.accuracy){var Y=MWe({northing:i.northing+i.accuracy,easting:i.easting+i.accuracy,zoneLetter:i.zoneLetter,zoneNumber:i.zoneNumber});V={top:Y.lat,right:Y.lon,bottom:B,left:$}}else V={lat:B,lon:$};return V}function _br(i){var e="Z";return 84>=i&&i>=72?e="X":72>i&&i>=64?e="W":64>i&&i>=56?e="V":56>i&&i>=48?e="U":48>i&&i>=40?e="T":40>i&&i>=32?e="S":32>i&&i>=24?e="R":24>i&&i>=16?e="Q":16>i&&i>=8?e="P":8>i&&i>=0?e="N":0>i&&i>=-8?e="M":-8>i&&i>=-16?e="L":-16>i&&i>=-24?e="K":-24>i&&i>=-32?e="J":-32>i&&i>=-40?e="H":-40>i&&i>=-48?e="G":-48>i&&i>=-56?e="F":-56>i&&i>=-64?e="E":-64>i&&i>=-72?e="D":-72>i&&i>=-80&&(e="C"),e}function bbr(i,e){var t="00000"+i.easting,r="00000"+i.northing;return i.zoneNumber+i.zoneLetter+wbr(i.easting,i.northing,i.zoneNumber)+t.substr(t.length-5,e)+r.substr(r.length-5,e)}function wbr(i,e,t){var r=VFt(t),n=Math.floor(i/1e5),s=Math.floor(e/1e5)%20;return xbr(n,s,r)}function VFt(i){var e=i%out;return e===0&&(e=out),e}function xbr(i,e,t){var r=t-1,n=jFt.charCodeAt(r),s=GFt.charCodeAt(r),o=n+i-1,a=s+e,l=!1;o>qQ&&(o=o-qQ+Vz-1,l=!0),(o===Q_||nQ_||(o>Q_||nz2||(o>z2||nqQ&&(o=o-qQ+Vz-1),a>WQ?(a=a-WQ+Vz-1,l=!0):l=!1,(a===Q_||sQ_||(a>Q_||sz2||(a>z2||sWQ&&(a=a-WQ+Vz-1);var u=String.fromCharCode(o)+String.fromCharCode(a);return u}function HFt(i){if(i&&i.length===0)throw"MGRSPoint coverting from nothing";for(var e=i.length,t=null,r="",n,s=0;!/[A-Z]/.test(n=i.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+i;r+=n,s++}var o=parseInt(r,10);if(s===0||s+3>e)throw"MGRSPoint bad conversion from: "+i;var a=i.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+i;t=i.substring(s,s+=2);for(var l=VFt(o),u=Sbr(t.charAt(0),l),c=Tbr(t.charAt(1),l);c0&&(w=1e5/Math.pow(10,p),S=i.substring(s,s+p),m=parseFloat(S)*w,I=i.substring(s+p),v=parseFloat(I)*w),R=m+u,L=v+c,{easting:R,northing:L,zoneLetter:a,zoneNumber:o,accuracy:w}}function Ebr(i,e){for(var t=jFt.charCodeAt(e-1),r=1e5,n=!1;t!==i.charCodeAt(0);){if(t++,t===Q_&&t++,t===z2&&t++,t>qQ){if(n)throw"Bad character: "+i;t=Vz,n=!0}r+=1e5}return r}function Ibr(i,e){if(i>"V")throw"MGRSPoint given invalid Northing "+i;for(var t=GFt.charCodeAt(e-1),r=0,n=!1;t!==i.charCodeAt(0);){if(t++,t===Q_&&t++,t===z2&&t++,t>WQ){if(n)throw"Bad character: "+i;t=Vz,n=!0}r+=1e5}return r}function Abr(i){var e;switch(i){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+i}function UW(i,e,t){if(!(this instanceof UW))return new UW(i,e,t);if(Array.isArray(i))this.x=i[0],this.y=i[1],this.z=i[2]||0;else if(typeof i=="object")this.x=i.x,this.y=i.y,this.z=i.z||0;else if(typeof i=="string"&&typeof e>"u"){var r=i.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=i,this.y=e,this.z=t||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}UW.fromMGRS=function(i){return new UW(zFt(i))};UW.prototype.toMGRS=function(i){return UFt([this.x,this.y],i)};var Mbr=1,Obr=.25,lut=.046875,uut=.01953125,cut=.01068115234375,Pbr=.75,Rbr=.46875,Dbr=.013020833333333334,Fbr=.007120768229166667,kbr=.3645833333333333,Lbr=.005696614583333333,Nbr=.3076171875;function WFt(i){var e=[];e[0]=Mbr-i*(Obr+i*(lut+i*(uut+i*cut))),e[1]=i*(Pbr-i*(lut+i*(uut+i*cut)));var t=i*i;return e[2]=t*(Rbr-i*(Dbr+i*Fbr)),t*=i,e[3]=t*(kbr-i*Lbr),e[4]=t*i*Nbr,e}function SSe(i,e,t,r){return t*=e,e*=e,r[0]*i-t*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))}var $br=20;function qFt(i,e,t){for(var r=1/(1-e),n=i,s=$br;s;--s){var o=Math.sin(n),a=1-e*o*o;if(a=(SSe(n,o,Math.cos(n),t)-i)*(a*Math.sqrt(a))*r,n-=a,Math.abs(a)ys?Math.tan(t):0,w=Math.pow(v,2),S=Math.pow(w,2);n=1-this.es*Math.pow(a,2),c=c/Math.sqrt(n);var I=SSe(t,a,l,this.en);s=this.a*(this.k0*c*(1+h/6*(1-w+p+h/20*(5-18*w+S+14*p-58*w*p+h/42*(61+179*S-S*w-479*w)))))+this.x0,o=this.a*(this.k0*(I-this.ml0+a*r*c/2*(1+h/12*(5-w+9*p+4*m+h/30*(61+S-58*w+270*p-330*w*p+h/56*(1385+543*S-S*w-3111*w))))))+this.y0}else{var u=l*Math.sin(r);if(Math.abs(Math.abs(u)-1)=1){if(u-1>ys)return 93;o=0}else o=Math.acos(o);t<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return i.x=s,i.y=o,i}function Gbr(i){var e,t,r,n,s=(i.x-this.x0)*(1/this.a),o=(i.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,t=qFt(e,this.es,this.en),Math.abs(t)ys?Math.tan(t):0,v=this.ep2*Math.pow(p,2),w=Math.pow(v,2),S=Math.pow(m,2),I=Math.pow(S,2);e=1-this.es*Math.pow(h,2);var R=s*Math.sqrt(e)/this.k0,L=Math.pow(R,2);e=e*m,r=t-e*L/(1-this.es)*.5*(1-L/12*(5+3*S-9*v*S+v-4*w-L/30*(61+90*S-252*v*S+45*I+46*v-L/56*(1385+3633*S+4095*I+1574*I*S)))),n=Gs(this.long0+R*(1-L/6*(1+2*S+v-L/20*(5+28*S+24*I+8*v*S+6*v-L/42*(61+662*S+1320*I+720*I*S))))/p)}else r=An*Gae(o),n=0;else{var a=Math.exp(s/this.k0),l=.5*(a-1/a),u=this.lat0+o/this.k0,c=Math.cos(u);e=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),r=Math.asin(e),o<0&&(r=-r),l===0&&c===0?n=0:n=Gs(Math.atan2(l,c)+this.long0)}return i.x=n,i.y=r,i}var Ubr=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const wge={init:Bbr,forward:jbr,inverse:Gbr,names:Ubr};function YFt(i){var e=Math.exp(i);return e=(e-1/e)/2,e}function EC(i,e){i=Math.abs(i),e=Math.abs(e);var t=Math.max(i,e),r=Math.min(i,e)/(t||1);return t*Math.sqrt(1+Math.pow(r,2))}function zbr(i){var e=1+i,t=e-1;return t===0?i:i*Math.log(e)/t}function Vbr(i){var e=Math.abs(i);return e=zbr(e*(1+e/(EC(1,e)+1))),i<0?-e:e}function OWe(i,e){for(var t=2*Math.cos(2*e),r=i.length-1,n=i[r],s=0,o;--r>=0;)o=-s+t*n+i[r],s=n,n=o;return e+o*Math.sin(2*e)}function Hbr(i,e){for(var t=2*Math.cos(e),r=i.length-1,n=i[r],s=0,o;--r>=0;)o=-s+t*n+i[r],s=n,n=o;return Math.sin(e)*o}function Wbr(i){var e=Math.exp(i);return e=(e+1/e)/2,e}function XFt(i,e,t){for(var r=Math.sin(e),n=Math.cos(e),s=YFt(t),o=Wbr(t),a=2*n*o,l=-2*r*s,u=i.length-1,c=i[u],h=0,p=0,m=0,v,w;--u>=0;)v=p,w=h,p=c,h=m,c=-v+a*p-l*h+i[u],m=-w+l*p+a*h;return a=r*o,l=n*s,[a*c-l*m,a*m+l*c]}function qbr(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(wge.init.apply(this),this.forward=wge.forward,this.inverse=wge.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var i=this.es/(1+Math.sqrt(1-this.es)),e=i/(2-i),t=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),t=t*e,this.cgb[1]=t*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=t*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),t=t*e,this.cgb[2]=t*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=t*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),t=t*e,this.cgb[3]=t*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=t*(1237/630+e*(-12/5+e*(-24832/14175))),t=t*e,this.cgb[4]=t*(4174/315+e*(-144838/6237)),this.cbg[4]=t*(-734/315+e*(109598/31185)),t=t*e,this.cgb[5]=t*(601676/22275),this.cbg[5]=t*(444337/155925),t=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+t*(1/4+t*(1/64+t/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=t*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=t*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),t=t*e,this.utg[2]=t*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=t*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),t=t*e,this.utg[3]=t*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=t*(49561/161280+e*(-179/168+e*(6601661/7257600))),t=t*e,this.utg[4]=t*(-4583/161280+e*(108847/3991680)),this.gtu[4]=t*(34729/80640+e*(-3418889/1995840)),t=t*e,this.utg[5]=t*(-20648693/638668800),this.gtu[5]=t*(212378941/319334400);var r=OWe(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Hbr(this.gtu,2*r))}function Ybr(i){var e=Gs(i.x-this.long0),t=i.y;t=OWe(this.cbg,t);var r=Math.sin(t),n=Math.cos(t),s=Math.sin(e),o=Math.cos(e);t=Math.atan2(r,o*n),e=Math.atan2(s*n,EC(r,n*o)),e=Vbr(Math.tan(e));var a=XFt(this.gtu,2*t,2*e);t=t+a[0],e=e+a[1];var l,u;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*t+this.Zb)+this.y0):(l=1/0,u=1/0),i.x=l,i.y=u,i}function Xbr(i){var e=(i.x-this.x0)*(1/this.a),t=(i.y-this.y0)*(1/this.a);t=(t-this.Zb)/this.Qn,e=e/this.Qn;var r,n;if(Math.abs(e)<=2.623395162778){var s=XFt(this.utg,2*t,2*e);t=t+s[0],e=e+s[1],e=Math.atan(YFt(e));var o=Math.sin(t),a=Math.cos(t),l=Math.sin(e),u=Math.cos(e);t=Math.atan2(o*u,EC(l,u*a)),e=Math.atan2(l,u*a),r=Gs(e+this.long0),n=OWe(this.cgb,t)}else r=1/0,n=1/0;return i.x=r,i.y=n,i}var Jbr=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"];const xge={init:qbr,forward:Ybr,inverse:Xbr,names:Jbr};function Kbr(i,e){if(i===void 0){if(i=Math.floor((Gs(e)+Math.PI)*30/Math.PI)+1,i<0)return 0;if(i>60)return 60}return i}var Zbr="etmerc";function Qbr(){var i=Kbr(this.zone,this.long0);if(i===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(i)-183)*Uy,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,xge.init.apply(this),this.forward=xge.forward,this.inverse=xge.inverse}var ewr=["Universal Transverse Mercator System","utm"];const twr={init:Qbr,names:ewr,dependsOn:Zbr};function PWe(i,e){return Math.pow((1-i)/(1+i),e)}var iwr=20;function rwr(){var i=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*i*i),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(i/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+$c)/(Math.pow(Math.tan(.5*this.lat0+$c),this.C)*PWe(this.e*i,this.ratexp))}function nwr(i){var e=i.x,t=i.y;return i.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+$c),this.C)*PWe(this.e*Math.sin(t),this.ratexp))-An,i.x=this.C*e,i}function swr(i){for(var e=1e-14,t=i.x/this.C,r=i.y,n=Math.pow(Math.tan(.5*r+$c)/this.K,1/this.C),s=iwr;s>0&&(r=2*Math.atan(n*PWe(this.e*Math.sin(i.y),-.5*this.e))-An,!(Math.abs(r-i.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ys&&(this.k0=.5*this.cons*v3(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/QC(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=v3(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-An,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function fwr(i){var e=i.x,t=i.y,r=Math.sin(t),n=Math.cos(t),s,o,a,l,u,c,h=Gs(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=ys&&Math.abs(t+this.lat0)<=ys?(i.x=NaN,i.y=NaN,i):this.sphere?(s=2*this.k0/(1+this.sinlat0*r+this.coslat0*n*Math.cos(h)),i.x=this.a*s*n*Math.sin(h)+this.x0,i.y=this.a*s*(this.coslat0*r-this.sinlat0*n*Math.cos(h))+this.y0,i):(o=2*Math.atan(this.ssfn_(t,r,this.e))-An,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=ys?(u=QC(this.e,t*this.con,this.con*r),c=2*this.a*this.k0*u/this.cons,i.x=this.x0+c*Math.sin(e-this.long0),i.y=this.y0-this.con*c*Math.cos(e-this.long0),i):(Math.abs(this.sinlat0)0?e=Gs(this.long0+Math.atan2(i.x,-1*i.y)):e=Gs(this.long0+Math.atan2(i.x,i.y)):e=Gs(this.long0+Math.atan2(i.x*Math.sin(a),o*this.coslat0*Math.cos(a)-i.y*this.sinlat0*Math.sin(a))),i.x=e,i.y=t,i)}else if(Math.abs(this.coslat0)<=ys){if(o<=ys)return t=this.lat0,e=this.long0,i.x=e,i.y=t,i;i.x*=this.con,i.y*=this.con,r=o*this.cons/(2*this.a*this.k0),t=this.con*lse(this.e,r),e=this.con*Gs(this.con*this.long0+Math.atan2(i.x,-1*i.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=ys?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+i.y*Math.sin(n)*this.cosX0/o),e=Gs(this.long0+Math.atan2(i.x*Math.sin(n),o*this.cosX0*Math.cos(n)-i.y*this.sinX0*Math.sin(n)))),t=-1*lse(this.e,Math.tan(.5*(An+s)));return i.x=e,i.y=t,i}var gwr=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];const ywr={init:pwr,forward:fwr,inverse:mwr,names:gwr,ssfn_:dwr};function vwr(){var i=this.lat0;this.lambda0=this.long0;var e=Math.sin(i),t=this.a,r=this.rf,n=1/r,s=2*n-Math.pow(n,2),o=this.e=Math.sqrt(s);this.R=this.k0*t*Math.sqrt(1-s)/(1-s*Math.pow(e,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(i),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+i/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*l+this.alpha*o/2*u}function _wr(i){var e=Math.log(Math.tan(Math.PI/4-i.y/2)),t=this.e/2*Math.log((1+this.e*Math.sin(i.y))/(1-this.e*Math.sin(i.y))),r=-this.alpha*(e+t)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),s=this.alpha*(i.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return i.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,i.x=this.R*o+this.x0,i}function bwr(i){for(var e=i.x-this.x0,t=i.y-this.y0,r=e/this.R,n=2*(Math.atan(Math.exp(t/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),o=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+o/this.alpha,l=0,u=s,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return i.x=a,i.y=u,i}var wwr=["somerc"];const xwr={init:vwr,forward:_wr,inverse:bwr,names:wwr};var cU=1e-7;function Swr(i){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],t=typeof i.PROJECTION=="object"?Object.keys(i.PROJECTION)[0]:i.PROJECTION;return"no_uoff"in i||"no_off"in i||e.indexOf(t)!==-1}function Twr(){var i,e,t,r,n,s,o,a,l,u,c=0,h,p=0,m=0,v=0,w=0,S=0,I=0;this.no_off=Swr(this),this.no_rot="no_rot"in this;var R=!1;"alpha"in this&&(R=!0);var L=!1;if("rectified_grid_angle"in this&&(L=!0),R&&(I=this.alpha),L&&(c=this.rectified_grid_angle*Uy),R||L)p=this.longc;else if(m=this.long1,w=this.lat1,v=this.long2,S=this.lat2,Math.abs(w-S)<=cU||(i=Math.abs(w))<=cU||Math.abs(i-An)<=cU||Math.abs(Math.abs(this.lat0)-An)<=cU||Math.abs(Math.abs(S)-An)<=cU)throw new Error;var k=1-this.es;e=Math.sqrt(k),Math.abs(this.lat0)>ys?(a=Math.sin(this.lat0),t=Math.cos(this.lat0),i=1-this.es*a*a,this.B=t*t,this.B=Math.sqrt(1+this.es*this.B*this.B/k),this.A=this.B*this.k0*e/i,r=this.B*e/(t*Math.sqrt(i)),n=r*r-1,n<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=r,this.E*=Math.pow(QC(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=n=1),R||L?(R?(h=Math.asin(Math.sin(I)/r),L||(c=I)):(h=c,I=Math.asin(r*Math.sin(h))),this.lam0=p-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(QC(this.e,w,Math.sin(w)),this.B),o=Math.pow(QC(this.e,S,Math.sin(S)),this.B),n=this.E/s,l=(o-s)/(o+s),u=this.E*this.E,u=(u-o*s)/(u+o*s),i=m-v,i<-Math.pi?v-=ose:i>Math.pi&&(v+=ose),this.lam0=Gs(.5*(m+v)-Math.atan(u*Math.tan(.5*this.B*(m-v))/l)/this.B),h=Math.atan(2*Math.sin(this.B*Gs(m-this.lam0))/(n-1/n)),c=I=Math.asin(r*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(I))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan($c-n)),this.v_pole_s=this.ArB*Math.log(Math.tan($c+n))}function Cwr(i){var e={},t,r,n,s,o,a,l,u;if(i.x=i.x-this.lam0,Math.abs(Math.abs(i.y)-An)>ys){if(o=this.E/Math.pow(QC(this.e,i.y,Math.sin(i.y)),this.B),a=1/o,t=.5*(o-a),r=.5*(o+a),s=Math.sin(this.B*i.x),n=(t*this.singam-s*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*i.y;return this.no_rot?(e.x=l,e.y=u):(l-=this.u_0,e.x=u*this.cosrot+l*this.sinrot,e.y=l*this.cosrot-u*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function Ewr(i){var e,t,r,n,s,o,a,l={};if(i.x=(i.x-this.x0)*(1/this.a),i.y=(i.y-this.y0)*(1/this.a),this.no_rot?(t=i.y,e=i.x):(t=i.x*this.cosrot-i.y*this.sinrot,e=i.y*this.cosrot+i.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*t),n=.5*(r-1/r),s=.5*(r+1/r),o=Math.sin(this.BrA*e),a=(o*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(a)-1)ys?this.ns=Math.log(r/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Owr(i){var e=i.x,t=i.y;Math.abs(2*Math.abs(t)-Math.PI)<=ys&&(t=Gae(t)*(An-2*ys));var r=Math.abs(Math.abs(t)-An),n,s;if(r>ys)n=QC(this.e,t,Math.sin(t)),s=this.a*this.f0*Math.pow(n,this.ns);else{if(r=t*this.ns,r<=0)return null;s=0}var o=this.ns*Gs(e-this.long0);return i.x=this.k0*(s*Math.sin(o))+this.x0,i.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,i}function Pwr(i){var e,t,r,n,s,o=(i.x-this.x0)/this.k0,a=this.rh-(i.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),t=1):(e=-Math.sqrt(o*o+a*a),t=-1);var l=0;if(e!==0&&(l=Math.atan2(t*o,t*a)),e!==0||this.ns>0){if(t=1/this.ns,r=Math.pow(e/(this.a*this.f0),t),n=lse(this.e,r),n===-9999)return null}else n=-An;return s=Gs(l/this.ns+this.long0),i.x=s,i.y=n,i}var Rwr=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Dwr={init:Mwr,forward:Owr,inverse:Pwr,names:Rwr};function Fwr(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function kwr(i){var e,t,r,n,s,o,a,l=i.x,u=i.y,c=Gs(l-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(r)),s=Math.asin(Math.cos(t)*Math.sin(r)/Math.cos(n)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),i.y=a*Math.cos(o)/1,i.x=a*Math.sin(o)/1,this.czech||(i.y*=-1,i.x*=-1),i}function Lwr(i){var e,t,r,n,s,o,a,l,u=i.x;i.x=i.y,i.y=u,this.czech||(i.y*=-1,i.x*=-1),o=Math.sqrt(i.x*i.x+i.y*i.y),s=Math.atan2(i.y,i.x),n=s/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),t=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),i.x=this.long0-t/this.alfa,a=e,l=0;var c=0;do i.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-i.y)<1e-10&&(l=1),a=i.y,c+=1;while(l===0&&c<15);return c>=15?null:i}var Nwr=["Krovak","krovak"];const $wr={init:Fwr,forward:kwr,inverse:Lwr,names:Nwr};function V1(i,e,t,r,n){return i*n-e*Math.sin(2*n)+t*Math.sin(4*n)-r*Math.sin(6*n)}function Uae(i){return 1-.25*i*(1+i/16*(3+1.25*i))}function zae(i){return .375*i*(1+.25*i*(1+.46875*i))}function Vae(i){return .05859375*i*i*(1+.75*i)}function Hae(i){return i*i*i*(35/3072)}function zW(i,e,t){var r=e*t;return i/Math.sqrt(1-r*r)}function WY(i){return Math.abs(i)1e-7?(t=i*e,(1-i*i)*(e/(1-t*t)-.5/i*Math.log((1-t)/(1+t)))):2*e}var Vwr=1,Hwr=2,Wwr=3,qwr=4;function Ywr(){var i=Math.abs(this.lat0);if(Math.abs(i-An)0){var e;switch(this.qp=CF(this.e,1),this.mmf=.5/(1-this.es),this.apa=rxr(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=CF(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Xwr(i){var e,t,r,n,s,o,a,l,u,c,h=i.x,p=i.y;if(h=Gs(h-this.long0),this.sphere){if(s=Math.sin(p),c=Math.cos(p),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t=this.mode===this.EQUIT?1+c*r:1+this.sinph0*s+this.cosph0*c*r,t<=ys)return null;t=Math.sqrt(2/t),e=t*c*Math.sin(h),t*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(p+this.lat0)=0?(e=(u=Math.sqrt(o))*n,t=r*(this.mode===this.S_POLE?u:-u)):e=t=0;break}}return i.x=this.a*e+this.x0,i.y=this.a*t+this.y0,i}function Jwr(i){i.x-=this.x0,i.y-=this.y0;var e=i.x/this.a,t=i.y/this.a,r,n,s,o,a,l,u;if(this.sphere){var c=0,h,p=0;if(h=Math.sqrt(e*e+t*t),n=h*.5,n>1)return null;switch(n=2*Math.asin(n),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=Math.sin(n),c=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(h)<=ys?0:Math.asin(t*p/h),e*=p,t=c*h;break;case this.OBLIQ:n=Math.abs(h)<=ys?this.lat0:Math.asin(c*this.sinph0+t*p*this.cosph0/h),e*=p*this.cosph0,t=(c-Math.sin(n)*this.sinph0)*h;break;case this.N_POLE:t=-t,n=An-n;break;case this.S_POLE:n-=An;break}r=t===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,t)}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,t*=this.dd,l=Math.sqrt(e*e+t*t),l1&&(i=i>1?1:-1),Math.asin(i)}function axr(){Math.abs(this.lat1+this.lat2)ys?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function lxr(i){var e=i.x,t=i.y;this.sin_phi=Math.sin(t),this.cos_phi=Math.cos(t);var r=CF(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*Gs(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return i.x=o,i.y=a,i}function uxr(i){var e,t,r,n,s,o;return i.x-=this.x0,i.y=this.rh-i.y+this.y0,this.ns0>=0?(e=Math.sqrt(i.x*i.x+i.y*i.y),r=1):(e=-Math.sqrt(i.x*i.x+i.y*i.y),r=-1),n=0,e!==0&&(n=Math.atan2(r*i.x,r*i.y)),r=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-r*r)/(2*this.ns0)):(t=(this.c-r*r)/this.ns0,o=this.phi1z(this.e3,t)),s=Gs(n/this.ns0+this.long0),i.x=s,i.y=o,i}function cxr(i,e){var t,r,n,s,o,a=ck(.5*e);if(i0||Math.abs(o)<=ys?(a=this.x0+this.a*s*t*Math.sin(r)/o,l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*t*n)/o):(a=this.x0+this.infinity_dist*t*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*t*n)),i.x=a,i.y=l,i}function mxr(i){var e,t,r,n,s,o;return i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,i.x/=this.k0,i.y/=this.k0,(e=Math.sqrt(i.x*i.x+i.y*i.y))?(n=Math.atan2(e,this.rc),t=Math.sin(n),r=Math.cos(n),o=ck(r*this.sin_p14+i.y*t*this.cos_p14/e),s=Math.atan2(i.x*t,e*this.cos_p14*r-i.y*this.sin_p14*t),s=Gs(this.long0+s)):(o=this.phic0,s=0),i.x=s,i.y=o,i}var gxr=["gnom"];const yxr={init:pxr,forward:fxr,inverse:mxr,names:gxr};function vxr(i,e){var t=1-(1-i*i)/(2*i)*Math.log((1-i)/(1+i));if(Math.abs(Math.abs(e)-t)<1e-6)return e<0?-1*An:An;for(var r=Math.asin(.5*e),n,s,o,a,l=0;l<30;l++)if(s=Math.sin(r),o=Math.cos(r),a=i*s,n=Math.pow(1-a*a,2)/(2*o)*(e/(1-i*i)-s/(1-a*a)+.5/i*Math.log((1-a)/(1+a))),r+=n,Math.abs(n)<=1e-10)return r;return NaN}function _xr(){this.sphere||(this.k0=v3(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function bxr(i){var e=i.x,t=i.y,r,n,s=Gs(e-this.long0);if(this.sphere)r=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(t)/Math.cos(this.lat_ts);else{var o=CF(this.e,Math.sin(t));r=this.x0+this.a*this.k0*s,n=this.y0+this.a*o*.5/this.k0}return i.x=r,i.y=n,i}function wxr(i){i.x-=this.x0,i.y-=this.y0;var e,t;return this.sphere?(e=Gs(this.long0+i.x/this.a/Math.cos(this.lat_ts)),t=Math.asin(i.y/this.a*Math.cos(this.lat_ts))):(t=vxr(this.e,2*i.y*this.k0/this.a),e=Gs(this.long0+i.x/(this.a*this.k0))),i.x=e,i.y=t,i}var xxr=["cea"];const Sxr={init:_xr,forward:bxr,inverse:wxr,names:xxr};function Txr(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Cxr(i){var e=i.x,t=i.y,r=Gs(e-this.long0),n=WY(t-this.lat0);return i.x=this.x0+this.a*r*this.rc,i.y=this.y0+this.a*n,i}function Exr(i){var e=i.x,t=i.y;return i.x=Gs(this.long0+(e-this.x0)/(this.a*this.rc)),i.y=WY(this.lat0+(t-this.y0)/this.a),i}var Ixr=["Equirectangular","Equidistant_Cylindrical","eqc"];const Axr={init:Txr,forward:Cxr,inverse:Exr,names:Ixr};var hut=20;function Mxr(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Uae(this.es),this.e1=zae(this.es),this.e2=Vae(this.es),this.e3=Hae(this.es),this.ml0=this.a*V1(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Oxr(i){var e=i.x,t=i.y,r,n,s,o=Gs(e-this.long0);if(s=o*Math.sin(t),this.sphere)Math.abs(t)<=ys?(r=this.a*o,n=-1*this.a*this.lat0):(r=this.a*Math.sin(s)/Math.tan(t),n=this.a*(WY(t-this.lat0)+(1-Math.cos(s))/Math.tan(t)));else if(Math.abs(t)<=ys)r=this.a*o,n=-1*this.ml0;else{var a=zW(this.a,this.e,Math.sin(t))/Math.tan(t);r=a*Math.sin(s),n=this.a*V1(this.e0,this.e1,this.e2,this.e3,t)-this.ml0+a*(1-Math.cos(s))}return i.x=r+this.x0,i.y=n+this.y0,i}function Pxr(i){var e,t,r,n,s,o,a,l,u;if(r=i.x-this.x0,n=i.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=ys)e=Gs(r/this.a+this.long0),t=0;else{o=this.lat0+n/this.a,a=r*r/this.a/this.a+o*o,l=o;var c;for(s=hut;s;--s)if(c=Math.tan(l),u=-1*(o*(l*c+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),l+=u,Math.abs(u)<=ys){t=l;break}e=Gs(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(t))}else if(Math.abs(n+this.ml0)<=ys)t=0,e=Gs(this.long0+r/this.a);else{o=(this.ml0+n)/this.a,a=r*r/this.a/this.a+o*o,l=o;var h,p,m,v,w;for(s=hut;s;--s)if(w=this.e*Math.sin(l),h=Math.sqrt(1-w*w)*Math.tan(l),p=this.a*V1(this.e0,this.e1,this.e2,this.e3,l),m=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),v=p/this.a,u=(o*(h*v+1)-v-.5*h*(v*v+a))/(this.es*Math.sin(2*l)*(v*v+a-2*o*v)/(4*h)+(o-v)*(h*m-2/Math.sin(2*l))-m),l-=u,Math.abs(u)<=ys){t=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(t),2))*Math.tan(t),e=Gs(this.long0+Math.asin(r*h/this.a)/Math.sin(t))}return i.x=e,i.y=t,i}var Rxr=["Polyconic","poly"];const Dxr={init:Mxr,forward:Oxr,inverse:Pxr,names:Rxr};function Fxr(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function kxr(i){var e,t=i.x,r=i.y,n=r-this.lat0,s=t-this.long0,o=n/Wie*1e-5,a=s,l=1,u=0;for(e=1;e<=10;e++)l=l*o,u=u+this.A[e]*l;var c=u,h=a,p=1,m=0,v,w,S=0,I=0;for(e=1;e<=6;e++)v=p*c-m*h,w=m*c+p*h,p=v,m=w,S=S+this.B_re[e]*p-this.B_im[e]*m,I=I+this.B_im[e]*p+this.B_re[e]*m;return i.x=I*this.a+this.x0,i.y=S*this.a+this.y0,i}function Lxr(i){var e,t=i.x,r=i.y,n=t-this.x0,s=r-this.y0,o=s/this.a,a=n/this.a,l=1,u=0,c,h,p=0,m=0;for(e=1;e<=6;e++)c=l*o-u*a,h=u*o+l*a,l=c,u=h,p=p+this.C_re[e]*l-this.C_im[e]*u,m=m+this.C_im[e]*l+this.C_re[e]*u;for(var v=0;v.999999999999&&(t=.999999999999),e=Math.asin(t);var r=Gs(this.long0+i.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),t=(2*e+Math.sin(2*e))/Math.PI,Math.abs(t)>1&&(t=1);var n=Math.asin(t);return i.x=r,i.y=n,i}var Qxr=["Mollweide","moll"];const e2r={init:Jxr,forward:Kxr,inverse:Zxr,names:Qxr};function t2r(){Math.abs(this.lat1+this.lat2)=0?(t=Math.sqrt(i.x*i.x+i.y*i.y),e=1):(t=-Math.sqrt(i.x*i.x+i.y*i.y),e=-1);var s=0;if(t!==0&&(s=Math.atan2(e*i.x,e*i.y)),this.sphere)return n=Gs(this.long0+s/this.ns),r=WY(this.g-t/this.a),i.x=n,i.y=r,i;var o=this.g-t/this.a;return r=K1e(o,this.e0,this.e1,this.e2,this.e3),n=Gs(this.long0+s/this.ns),i.x=n,i.y=r,i}var n2r=["Equidistant_Conic","eqdc"];const s2r={init:t2r,forward:i2r,inverse:r2r,names:n2r};function o2r(){this.R=this.a}function a2r(i){var e=i.x,t=i.y,r=Gs(e-this.long0),n,s;Math.abs(t)<=ys&&(n=this.x0+this.R*r,s=this.y0);var o=ck(2*Math.abs(t/Math.PI));(Math.abs(r)<=ys||Math.abs(Math.abs(t)-An)<=ys)&&(n=this.x0,t>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/r-r/Math.PI),l=a*a,u=Math.sin(o),c=Math.cos(o),h=c/(u+c-1),p=h*h,m=h*(2/u-1),v=m*m,w=Math.PI*this.R*(a*(h-v)+Math.sqrt(l*(h-v)*(h-v)-(v+l)*(p-v)))/(v+l);r<0&&(w=-w),n=this.x0+w;var S=l+h;return w=Math.PI*this.R*(m*S-a*Math.sqrt((v+l)*(l+1)-S*S))/(v+l),t>=0?s=this.y0+w:s=this.y0-w,i.x=n,i.y=s,i}function l2r(i){var e,t,r,n,s,o,a,l,u,c,h,p,m;return i.x-=this.x0,i.y-=this.y0,h=Math.PI*this.R,r=i.x/h,n=i.y/h,s=r*r+n*n,o=-Math.abs(n)*(1+s),a=o-2*n*n+r*r,l=-2*o+1+2*n*n+s*s,m=n*n/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,u=(o-a*a/3/l)/l,c=2*Math.sqrt(-u/3),h=3*m/u/c,Math.abs(h)>1&&(h>=0?h=1:h=-1),p=Math.acos(h)/3,i.y>=0?t=(-c*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:t=-(-c*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,Math.abs(r)2*An*this.a?void 0:(t=e/this.a,r=Math.sin(t),n=Math.cos(t),s=this.long0,Math.abs(e)<=ys?o=this.lat0:(o=ck(n*this.sin_p12+i.y*r*this.cos_p12/e),a=Math.abs(this.lat0)-An,Math.abs(a)<=ys?this.lat0>=0?s=Gs(this.long0+Math.atan2(i.x,-i.y)):s=Gs(this.long0-Math.atan2(-i.x,i.y)):s=Gs(this.long0+Math.atan2(i.x*r,e*this.cos_p12*n-i.y*this.sin_p12*r))),i.x=s,i.y=o,i)):(l=Uae(this.es),u=zae(this.es),c=Vae(this.es),h=Hae(this.es),Math.abs(this.sin_p12-1)<=ys?(p=this.a*V1(l,u,c,h,An),e=Math.sqrt(i.x*i.x+i.y*i.y),m=p-e,o=K1e(m/this.a,l,u,c,h),s=Gs(this.long0+Math.atan2(i.x,-1*i.y)),i.x=s,i.y=o,i):Math.abs(this.sin_p12+1)<=ys?(p=this.a*V1(l,u,c,h,An),e=Math.sqrt(i.x*i.x+i.y*i.y),m=e-p,o=K1e(m/this.a,l,u,c,h),s=Gs(this.long0+Math.atan2(i.x,i.y)),i.x=s,i.y=o,i):(e=Math.sqrt(i.x*i.x+i.y*i.y),S=Math.atan2(i.x,i.y),v=zW(this.a,this.e,this.sin_p12),I=Math.cos(S),R=this.e*this.cos_p12*I,L=-R*R/(1-this.es),k=3*this.es*(1-L)*this.sin_p12*this.cos_p12*I/(1-this.es),B=e/v,$=B-L*(1+L)*Math.pow(B,3)/6-k*(1+3*L)*Math.pow(B,4)/24,V=1-L*$*$/2-B*$*$*$/6,w=Math.asin(this.sin_p12*Math.cos($)+this.cos_p12*Math.sin($)*I),s=Gs(this.long0+Math.asin(Math.sin(S)*Math.sin($)/Math.cos(w))),Y=Math.sin(w),o=Math.atan2((Y-this.es*V*this.sin_p12)*Math.tan(w),Y*(1-this.es)),i.x=s,i.y=o,i))}var f2r=["Azimuthal_Equidistant","aeqd"];const m2r={init:h2r,forward:d2r,inverse:p2r,names:f2r};function g2r(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function y2r(i){var e,t,r,n,s,o,a,l,u=i.x,c=i.y;return r=Gs(u-this.long0),e=Math.sin(c),t=Math.cos(c),n=Math.cos(r),o=this.sin_p14*e+this.cos_p14*t*n,s=1,(o>0||Math.abs(o)<=ys)&&(a=this.a*s*t*Math.sin(r),l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*t*n)),i.x=a,i.y=l,i}function v2r(i){var e,t,r,n,s,o,a;return i.x-=this.x0,i.y-=this.y0,e=Math.sqrt(i.x*i.x+i.y*i.y),t=ck(e/this.a),r=Math.sin(t),n=Math.cos(t),o=this.long0,Math.abs(e)<=ys?(a=this.lat0,i.x=o,i.y=a,i):(a=ck(n*this.sin_p14+i.y*r*this.cos_p14/e),s=Math.abs(this.lat0)-An,Math.abs(s)<=ys?(this.lat0>=0?o=Gs(this.long0+Math.atan2(i.x,-i.y)):o=Gs(this.long0-Math.atan2(-i.x,i.y)),i.x=o,i.y=a,i):(o=Gs(this.long0+Math.atan2(i.x*r,e*this.cos_p14*n-i.y*this.sin_p14*r)),i.x=o,i.y=a,i))}var _2r=["ortho"];const b2r={init:g2r,forward:y2r,inverse:v2r,names:_2r};var dp={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Bc={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function w2r(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=An-$c/2?this.face=dp.TOP:this.lat0<=-(An-$c/2)?this.face=dp.BOTTOM:Math.abs(this.long0)<=$c?this.face=dp.FRONT:Math.abs(this.long0)<=An+$c?this.face=this.long0>0?dp.RIGHT:dp.LEFT:this.face=dp.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function x2r(i){var e={x:0,y:0},t,r,n,s,o,a,l={value:0};if(i.x-=this.long0,this.es!==0?t=Math.atan(this.one_minus_f_squared*Math.tan(i.y)):t=i.y,r=i.x,this.face===dp.TOP)s=An-t,r>=$c&&r<=An+$c?(l.value=Bc.AREA_0,n=r-An):r>An+$c||r<=-(An+$c)?(l.value=Bc.AREA_1,n=r>0?r-mf:r+mf):r>-(An+$c)&&r<=-$c?(l.value=Bc.AREA_2,n=r+An):(l.value=Bc.AREA_3,n=r);else if(this.face===dp.BOTTOM)s=An+t,r>=$c&&r<=An+$c?(l.value=Bc.AREA_0,n=-r+An):r<$c&&r>=-$c?(l.value=Bc.AREA_1,n=-r):r<-$c&&r>=-(An+$c)?(l.value=Bc.AREA_2,n=-r-An):(l.value=Bc.AREA_3,n=r>0?-r+mf:-r-mf);else{var u,c,h,p,m,v,w;this.face===dp.RIGHT?r=KV(r,+An):this.face===dp.BACK?r=KV(r,+mf):this.face===dp.LEFT&&(r=KV(r,-An)),p=Math.sin(t),m=Math.cos(t),v=Math.sin(r),w=Math.cos(r),u=m*w,c=m*v,h=p,this.face===dp.FRONT?(s=Math.acos(u),n=Lhe(s,h,c,l)):this.face===dp.RIGHT?(s=Math.acos(c),n=Lhe(s,h,-u,l)):this.face===dp.BACK?(s=Math.acos(-u),n=Lhe(s,h,-c,l)):this.face===dp.LEFT?(s=Math.acos(-c),n=Lhe(s,h,u,l)):(s=n=0,l.value=Bc.AREA_0)}return a=Math.atan(12/mf*(n+Math.acos(Math.sin(n)*Math.cos($c))-An)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),l.value===Bc.AREA_1?a+=An:l.value===Bc.AREA_2?a+=mf:l.value===Bc.AREA_3&&(a+=1.5*mf),e.x=o*Math.cos(a),e.y=o*Math.sin(a),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,i.x=e.x,i.y=e.y,i}function S2r(i){var e={lam:0,phi:0},t,r,n,s,o,a,l,u,c,h={value:0};if(i.x=(i.x-this.x0)/this.a,i.y=(i.y-this.y0)/this.a,r=Math.atan(Math.sqrt(i.x*i.x+i.y*i.y)),t=Math.atan2(i.y,i.x),i.x>=0&&i.x>=Math.abs(i.y)?h.value=Bc.AREA_0:i.y>=0&&i.y>=Math.abs(i.x)?(h.value=Bc.AREA_1,t-=An):i.x<0&&-i.x>=Math.abs(i.y)?(h.value=Bc.AREA_2,t=t<0?t+mf:t-mf):(h.value=Bc.AREA_3,t+=An),c=mf/12*Math.tan(t),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),n=Math.cos(t),s=Math.tan(r),l=1-n*n*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===dp.TOP)u=Math.acos(l),e.phi=An-u,h.value===Bc.AREA_0?e.lam=a+An:h.value===Bc.AREA_1?e.lam=a<0?a+mf:a-mf:h.value===Bc.AREA_2?e.lam=a-An:e.lam=a;else if(this.face===dp.BOTTOM)u=Math.acos(l),e.phi=u-An,h.value===Bc.AREA_0?e.lam=-a+An:h.value===Bc.AREA_1?e.lam=-a:h.value===Bc.AREA_2?e.lam=-a-An:e.lam=a<0?-a-mf:-a+mf;else{var p,m,v;p=l,c=p*p,c>=1?v=0:v=Math.sqrt(1-c)*Math.sin(a),c+=v*v,c>=1?m=0:m=Math.sqrt(1-c),h.value===Bc.AREA_1?(c=m,m=-v,v=c):h.value===Bc.AREA_2?(m=-m,v=-v):h.value===Bc.AREA_3&&(c=m,m=v,v=-c),this.face===dp.RIGHT?(c=p,p=-m,m=c):this.face===dp.BACK?(p=-p,m=-m):this.face===dp.LEFT&&(c=p,p=m,m=-c),e.phi=Math.acos(-v)-An,e.lam=Math.atan2(m,p),this.face===dp.RIGHT?e.lam=KV(e.lam,-An):this.face===dp.BACK?e.lam=KV(e.lam,-mf):this.face===dp.LEFT&&(e.lam=KV(e.lam,+An))}if(this.es!==0){var w,S,I;w=e.phi<0?1:0,S=Math.tan(e.phi),I=this.b/Math.sqrt(S*S+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-I*I)/(this.one_minus_f*I)),w&&(e.phi=-e.phi)}return e.lam+=this.long0,i.x=e.lam,i.y=e.phi,i}function Lhe(i,e,t,r){var n;return i$c&&n<=An+$c?(r.value=Bc.AREA_1,n-=An):n>An+$c||n<=-(An+$c)?(r.value=Bc.AREA_2,n=n>=0?n-mf:n+mf):(r.value=Bc.AREA_3,n+=An)),n}function KV(i,e){var t=i+e;return t<-mf?t+=ose:t>+mf&&(t-=ose),t}var T2r=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const C2r={init:w2r,forward:x2r,inverse:S2r,names:T2r};var ZNe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],YQ=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],JFt=.8487,KFt=1.3523,ZFt=OA/5,E2r=1/ZFt,Hz=18,Z1e=function(i,e){return i[0]+e*(i[1]+e*(i[2]+e*i[3]))},I2r=function(i,e){return i[1]+e*(2*i[2]+e*3*i[3])};function A2r(i,e,t,r){for(var n=e;r;--r){var s=i(n);if(n-=s,Math.abs(s)=Hz&&(r=Hz-1),t=OA*(t-E2r*r);var n={x:Z1e(ZNe[r],t)*e,y:Z1e(YQ[r],t)};return i.y<0&&(n.y=-n.y),n.x=n.x*this.a*JFt+this.x0,n.y=n.y*this.a*KFt+this.y0,n}function P2r(i){var e={x:(i.x-this.x0)/(this.a*JFt),y:Math.abs(i.y-this.y0)/(this.a*KFt)};if(e.y>=1)e.x/=ZNe[Hz][0],e.y=i.y<0?-An:An;else{var t=Math.floor(e.y*Hz);for(t<0?t=0:t>=Hz&&(t=Hz-1);;)if(YQ[t][0]>e.y)--t;else if(YQ[t+1][0]<=e.y)++t;else break;var r=YQ[t],n=5*(e.y-r[0])/(YQ[t+1][0]-r[0]);n=A2r(function(s){return(Z1e(r,s)-e.y)/I2r(r,s)},n,ys,100),e.x/=Z1e(ZNe[t],n),e.y=(5*t+n)*Uy,i.y<0&&(e.y=-e.y)}return e.x=Gs(e.x+this.long0),e}var R2r=["Robinson","robin"];const D2r={init:M2r,forward:O2r,inverse:P2r,names:R2r};function F2r(){this.name="geocent"}function k2r(i){var e=NFt(i,this.es,this.a);return e}function L2r(i){var e=$Ft(i,this.es,this.a,this.b);return e}var N2r=["Geocentric","geocentric","geocent","Geocent"];const $2r={init:F2r,forward:k2r,inverse:L2r,names:N2r};var wv={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},qJ={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function B2r(){if(Object.keys(qJ).forEach(function(t){if(typeof this[t]>"u")this[t]=qJ[t].def;else{if(qJ[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);qJ[t].num&&(this[t]=parseFloat(this[t]))}qJ[t].degrees&&(this[t]=this[t]*Uy)}.bind(this)),Math.abs(Math.abs(this.lat0)-An)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var i=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(i),this.sw=Math.sin(i)}function j2r(i){i.x-=this.long0;var e=Math.sin(i.y),t=Math.cos(i.y),r=Math.cos(i.x),n,s;switch(this.mode){case wv.OBLIQ:s=this.sinph0*e+this.cosph0*t*r;break;case wv.EQUIT:s=t*r;break;case wv.S_POLE:s=-e;break;case wv.N_POLE:s=e;break}switch(s=this.pn1/(this.p-s),n=s*t*Math.sin(i.x),this.mode){case wv.OBLIQ:s*=this.cosph0*e-this.sinph0*t*r;break;case wv.EQUIT:s*=e;break;case wv.N_POLE:s*=-(t*r);break;case wv.S_POLE:s*=t*r;break}var o,a;return o=s*this.cg+n*this.sg,a=1/(o*this.sw*this.h1+this.cw),n=(n*this.cg-s*this.sg)*this.cw*a,s=o*a,i.x=n*this.a,i.y=s*this.a,i}function G2r(i){i.x/=this.a,i.y/=this.a;var e={x:i.x,y:i.y},t,r,n;n=1/(this.pn1-i.y*this.sw),t=this.pn1*i.x*n,r=this.pn1*i.y*this.cw*n,i.x=t*this.cg+r*this.sg,i.y=r*this.cg-t*this.sg;var s=EC(i.x,i.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var i=1-this.es,e=1/i;this.radius_p=Math.sqrt(i),this.radius_p2=i,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function H2r(i){var e=i.x,t=i.y,r,n,s,o;if(e=e-this.long0,this.shape==="ellipse"){t=Math.atan(this.radius_p2*Math.tan(t));var a=this.radius_p/EC(this.radius_p*Math.cos(t),Math.sin(t));if(n=a*Math.cos(e)*Math.cos(t),s=a*Math.sin(e)*Math.cos(t),o=a*Math.sin(t),(this.radius_g-n)*n-s*s-o*o*this.radius_p_inv2<0)return i.x=Number.NaN,i.y=Number.NaN,i;r=this.radius_g-n,this.flip_axis?(i.x=this.radius_g_1*Math.atan(s/EC(o,r)),i.y=this.radius_g_1*Math.atan(o/r)):(i.x=this.radius_g_1*Math.atan(s/r),i.y=this.radius_g_1*Math.atan(o/EC(s,r)))}else this.shape==="sphere"&&(r=Math.cos(t),n=Math.cos(e)*r,s=Math.sin(e)*r,o=Math.sin(t),r=this.radius_g-n,this.flip_axis?(i.x=this.radius_g_1*Math.atan(s/EC(o,r)),i.y=this.radius_g_1*Math.atan(o/r)):(i.x=this.radius_g_1*Math.atan(s/r),i.y=this.radius_g_1*Math.atan(o/EC(s,r))));return i.x=i.x*this.a,i.y=i.y*this.a,i}function W2r(i){var e=-1,t=0,r=0,n,s,o,a;if(i.x=i.x/this.a,i.y=i.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*EC(1,r)):(t=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*EC(1,t));var l=r/this.radius_p;if(n=t*t+l*l+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,t*=a,r*=a,i.x=Math.atan2(t,e),i.y=Math.atan(r*Math.cos(i.x)/e),i.y=Math.atan(this.radius_p_inv2*Math.tan(i.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(i.y/this.radius_g_1),t=Math.tan(i.x/this.radius_g_1)*Math.sqrt(1+r*r)):(t=Math.tan(i.x/this.radius_g_1),r=Math.tan(i.y/this.radius_g_1)*Math.sqrt(1+t*t)),n=t*t+r*r+e*e,s=2*this.radius_g*e,o=s*s-4*n*this.C,o<0)return i.x=Number.NaN,i.y=Number.NaN,i;a=(-s-Math.sqrt(o))/(2*n),e=this.radius_g+a*e,t*=a,r*=a,i.x=Math.atan2(t,e),i.y=Math.atan(r*Math.cos(i.x)/e)}return i.x=i.x+this.long0,i}var q2r=["Geostationary Satellite View","Geostationary_Satellite","geos"];const Y2r={init:V2r,forward:H2r,inverse:W2r,names:q2r};function X2r(i){i.Proj.projections.add(wge),i.Proj.projections.add(xge),i.Proj.projections.add(twr),i.Proj.projections.add(hwr),i.Proj.projections.add(ywr),i.Proj.projections.add(xwr),i.Proj.projections.add(Awr),i.Proj.projections.add(Dwr),i.Proj.projections.add($wr),i.Proj.projections.add(zwr),i.Proj.projections.add(oxr),i.Proj.projections.add(dxr),i.Proj.projections.add(yxr),i.Proj.projections.add(Sxr),i.Proj.projections.add(Axr),i.Proj.projections.add(Dxr),i.Proj.projections.add($xr),i.Proj.projections.add(zxr),i.Proj.projections.add(Xxr),i.Proj.projections.add(e2r),i.Proj.projections.add(s2r),i.Proj.projections.add(c2r),i.Proj.projections.add(m2r),i.Proj.projections.add(b2r),i.Proj.projections.add(C2r),i.Proj.projections.add(D2r),i.Proj.projections.add($2r),i.Proj.projections.add(z2r),i.Proj.projections.add(Y2r)}Ih.defaultDatum="WGS84";Ih.Proj=qA;Ih.WGS84=new Ih.Proj("WGS84");Ih.Point=UW;Ih.toPoint=BFt;Ih.defs=F1;Ih.nadgrid=rbr;Ih.transform=J1e;Ih.mgrs=_br;Ih.version="__VERSION__";X2r(Ih);const dut="EPSG:4326";class J2r{espgWorker;constructor(){this.espgWorker=this.defaultEpsgLookup,Ih.defs("EPSG:3978","+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ih.defs("EPSG:3979","+proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ih.defs("EPSG:54004","+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"),Ih.defs("EPSG:102100",Ih.defs("EPSG:3857")),Ih.defs("EPSG:102187","+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"),Ih.defs("EPSG:102190","+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");let e=1;for(;e<=60;){const t=e<10?`0${e}`:e;Ih.defs(`EPSG:326${t}`,`+proj=utm +zone=${e} +ellps=WGS84 +datum=WGS84 +units=m +no_defs`),e++}}addProjection(e,t){e=typeof e=="number"?`EPSG:${e}`:e,Ih.defs(e,t)}defaultEpsgLookup(e){const t=/urn:ogc:def:crs:EPSG::(\d+)/,r=/EPSG:(\d+)/,n=String(e).match(t)||String(e).match(r)||[];if(n.length<2)throw new Error("Invalid code provided.");return new Promise((s,o)=>{const a=`https://epsg.io/${n[1]}.proj4`;zi(a,{responseType:"text"}).then(c=>{c.data?s(c.data):o()},c=>{o(c)})})}epsgLookup(e){return this.espgWorker(e)}setEpsgLookup(e){this.espgWorker=e}normalizeProj(e){if(typeof e=="object"){if(e.wkid)return"EPSG:"+e.wkid;if(e.wkt)return e.wkt}else{if(typeof e=="number")return"EPSG:"+e;if(typeof e=="string")return e}throw new Error("Bad argument type, please provide a string, integer or SpatialReference object.")}async checkProj(e){let t,r="";if(e.wkt)return!0;try{t=this.normalizeProj(e)}catch{return!1}e.latestWkid&&(r=this.normalizeProj(e.latestWkid));const n=(l,u)=>{l!==u&&Ih.defs(u,Ih.defs(l))};if(Ih.defs(t))return!0;if(r&&Ih.defs(r))return n(r,t),!0;const s=async l=>{try{const u=await this.epsgLookup(l);return u===null||u===""?!1:(Ih.defs(l,u),!0)}catch{return!1}};return await(r?s(r):Promise.resolve(!1))?(n(r,t),!0):s(t)}async checkProjBomber(e){if(e.length>0){const t=e.pop();if(await this.checkProj(t))return this.checkProjBomber(e);throw console.error("Unable to parse or locate projection information for this item:",t),new Error("Could not find projection information, see console for details")}}async projectGeoJson(e,t,r){let n=this.normalizeProj(t),s=this.normalizeProj(r);if(!n&&e.crs&&e.crs.type==="name"&&(n=xl.parseGeoJsonCrs(e.crs)),n||(n=dut),s||(s=dut),s===n)return e;await this.checkProjBomber([n,s]);const o=Ih(n,s).forward;return y_r.Tools.applyConverter(e,o)}async projectGeometry(e,t){if(t.type===cl.EXTENT)return this.projectExtent(e,t);await this.checkProjBomber([e,t.sr]);const r=t.toGeoJSON(),n=await this.projectGeoJson(r,this.normalizeProj(t.sr),this.normalizeProj(e)),s=sH.geom.geomGeoJsonToRamp(n,t.id);return s.sr=xl.parseSR(e),s}async projectExtent(e,t){const r=(w,S,I)=>{if(I===0)return[w,S];const R=[(w[0]+S[0])/2,(w[1]+S[1])/2];if(I===1)return[w,R,S];if(I>1){const L=r(w,R,I-1),k=r(R,S,I-1);return L.concat(k.slice(1))}return[[]]},n=t.toPolygonArray().pop()||[];let s=[];[0,1,2,3].map(w=>r(n[w],n[w+1],3).slice(1)).forEach(w=>s=s.concat(w));const o=new Zy("warpy",[s],t.sr,!0),a=await this.projectGeometry(e,o),l=a.toArray().pop()||[],u=l.map(w=>w[0]),c=l.map(w=>w[1]),h=Math.min.apply(null,u),p=Math.max.apply(null,u),m=Math.min.apply(null,c),v=Math.max.apply(null,c);return Yh.fromParams(t.id+"_projected",h,m,p,v,a.sr)}}class K2r{DEFAULT_MERCATOR="DEFAULT_ESRI_World_AuxMerc_3857";DEFAULT_LAMBERT="DEFAULT_NRCAN_Lambert_3978";proj;geom;sharedUtils;constructor(){this.proj=new J2r,this.geom=new t_r,this.sharedUtils=new g_r}defaultTileSchemas(){return[this.DEFAULT_LAMBERT,this.DEFAULT_MERCATOR]}defaultLODs(e){const t=r=>r.map(n=>({level:n[0],resolution:n[1],scale:n[2]}));if(e===this.DEFAULT_LAMBERT)return t([[0,38364.660062653464,145e6],[1,22489.62831258996,85e6],[2,13229.193125052918,5e7],[3,7937.5158750317505,3e7],[4,4630.2175937685215,175e5],[5,2645.8386250105837,1e7],[6,1587.5031750063501,6e6],[7,926.0435187537042,35e5],[8,529.1677250021168,2e6],[9,317.50063500127004,12e5],[10,185.20870375074085,7e5],[11,111.12522225044451,42e4],[12,66.1459656252646,25e4],[13,38.36466006265346,145e3],[14,22.48962831258996,85e3],[15,13.229193125052918,5e4],[16,7.9375158750317505,3e4],[17,4.6302175937685215,17500]]);if(e===this.DEFAULT_MERCATOR)return t([[0,19567.87924099992,73957190948944e-6],[1,9783.93962049996,36978595474472e-6],[2,4891.96981024998,18489297737236e-6],[3,2445.98490512499,9244648868618e-6],[4,1222.992452562495,4622324434309e-6],[5,611.4962262813797,2311162217155e-6],[6,305.74811314055756,1155581108577e-6],[7,152.87405657041106,577790.554289],[8,76.43702828507324,288895.277144],[9,38.21851414253662,144447.638572],[10,19.10925707126831,72223.819286],[11,9.554628535634155,36111.909643],[12,4.77731426794937,18055.954822],[13,2.388657133974685,9027.977411],[14,1.1943285668550503,4513.988705],[15,.5971642835598172,2256.994353],[16,.29858214164761665,1128.497176],[17,.14929107082380833,564.248588],[18,.07464553541190416,282.124294],[19,.03732276770595208,141.062147],[20,.01866138385297604,70.5310735]]);throw new Error(`Unknown tile schema key passed to LOD defaulter ${e}`)}}class tf{$iApi;get $vApp(){return this.$iApi.$vApp}get $element(){return this.$iApi.$element}constructor(e){this.$iApi=e}}function Z2r(i){return typeof i=="function"&&i.render&&typeof i.render=="function"}function Q2r(i){const e=["data","props","propsData","computed","methods","watch","template","render","components","model"];return typeof i=="object"&&!i.functional&&e.some(t=>i[t]!==void 0)}function eSr(i){return typeof i=="object"&&i.default!==void 0}var QFt={exports:{}};function DWe(){}DWe.prototype={on:function(i,e,t){var r=this.e||(this.e={});return(r[i]||(r[i]=[])).push({fn:e,ctx:t}),this},once:function(i,e,t){var r=this;function n(){r.off(i,n),e.apply(t,arguments)}return n._=e,this.on(i,n,t)},emit:function(i){var e=[].slice.call(arguments,1),t=((this.e||(this.e={}))[i]||[]).slice(),r=0,n=t.length;for(r;r!!t[n.toLowerCase()]:n=>!!t[n]}const nh={},ZV=[],J1=()=>{},Sge=()=>!1,iSr=/^on[^a-z]/,i7=i=>iSr.test(i),FWe=i=>i.startsWith("onUpdate:"),$u=Object.assign,kWe=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},rSr=Object.prototype.hasOwnProperty,ic=(i,e)=>rSr.call(i,e),Ms=Array.isArray,QV=i=>qY(i)==="[object Map]",r7=i=>qY(i)==="[object Set]",put=i=>qY(i)==="[object Date]",nSr=i=>qY(i)==="[object RegExp]",Ra=i=>typeof i=="function",El=i=>typeof i=="string",hk=i=>typeof i=="symbol",ch=i=>i!==null&&typeof i=="object",LWe=i=>ch(i)&&Ra(i.then)&&Ra(i.catch),ekt=Object.prototype.toString,qY=i=>ekt.call(i),sSr=i=>qY(i).slice(8,-1),tkt=i=>qY(i)==="[object Object]",NWe=i=>El(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,n9=qb(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),oSr=qb("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),TSe=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},aSr=/-(\w)/g,Pf=TSe(i=>i.replace(aSr,(e,t)=>t?t.toUpperCase():"")),lSr=/\B([A-Z])/g,lx=TSe(i=>i.replace(lSr,"-$1").toLowerCase()),Zk=TSe(i=>i.charAt(0).toUpperCase()+i.slice(1)),s9=TSe(i=>i?`on${Zk(i)}`:""),VW=(i,e)=>!Object.is(i,e),eH=(i,e)=>{for(let t=0;t{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value:t})},e_e=i=>{const e=parseFloat(i);return isNaN(e)?i:e},t_e=i=>{const e=El(i)?Number(i):NaN;return isNaN(e)?i:e};let fut;const QNe=()=>fut||(fut=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),uSr="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console",cSr=qb(uSr);function s_(i){if(Ms(i)){const e={};for(let t=0;t{if(t){const r=t.split(dSr);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Wn(i){let e="";if(El(i))e=i;else if(Ms(i))for(let t=0;tdk(t,e))}const br=i=>El(i)?i:i==null?"":Ms(i)||ch(i)&&(i.toString===ekt||!Ra(i.toString))?JSON.stringify(i,skt,2):String(i),skt=(i,e)=>e&&e.__v_isRef?skt(i,e.value):QV(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[r,n])=>(t[`${r} =>`]=n,t),{})}:r7(e)?{[`Set(${e.size})`]:[...e.values()]}:ch(e)&&!Ms(e)&&!tkt(e)?String(e):e;let Hw;class ESe{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Hw,!e&&Hw&&(this.index=(Hw.scopes||(Hw.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Hw;try{return Hw=this,e()}finally{Hw=t}}}on(){Hw=this}off(){Hw=this.parent}stop(e){if(this._active){let t,r;for(t=0,r=this.effects.length;t{const e=new Set(i);return e.w=0,e.n=0,e},akt=i=>(i.w&pk)>0,lkt=i=>(i.n&pk)>0,SSr=({deps:i})=>{if(i.length)for(let e=0;e{const{deps:e}=i;if(e.length){let t=0;for(let r=0;r{(c==="length"||c>=l)&&a.push(u)})}else switch(t!==void 0&&a.push(o.get(t)),e){case"add":Ms(i)?NWe(t)&&a.push(o.get("length")):(a.push(o.get(o9)),QV(i)&&a.push(o.get(t$e)));break;case"delete":Ms(i)||(a.push(o.get(o9)),QV(i)&&a.push(o.get(t$e)));break;case"set":QV(i)&&a.push(o.get(o9));break}if(a.length===1)a[0]&&i$e(a[0]);else{const l=[];for(const u of a)u&&l.push(...u);i$e(BWe(l))}}function i$e(i,e){const t=Ms(i)?i:[...i];for(const r of t)r.computed&&gut(r);for(const r of t)r.computed||gut(r)}function gut(i,e){(i!==IC||i.allowRecurse)&&(i.scheduler?i.scheduler():i.run())}function CSr(i,e){var t;return(t=i_e.get(i))==null?void 0:t.get(e)}const ESr=qb("__proto__,__v_isRef,__isVue"),pkt=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(hk)),ISr=ASe(),ASr=ASe(!1,!0),MSr=ASe(!0),OSr=ASe(!0,!0),yut=PSr();function PSr(){const i={};return["includes","indexOf","lastIndexOf"].forEach(e=>{i[e]=function(...t){const r=Qs(this);for(let s=0,o=this.length;s{i[e]=function(...t){XY();const r=Qs(this)[e].apply(this,t);return JY(),r}}),i}function RSr(i){const e=Qs(this);return Bb(e,"has",i),e.hasOwnProperty(i)}function ASe(i=!1,e=!1){return function(r,n,s){if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return e;if(n==="__v_raw"&&s===(i?e?bkt:_kt:e?vkt:ykt).get(r))return r;const o=Ms(r);if(!i){if(o&&ic(yut,n))return Reflect.get(yut,n,s);if(n==="hasOwnProperty")return RSr}const a=Reflect.get(r,n,s);return(hk(n)?pkt.has(n):ESr(n))||(i||Bb(r,"get",n),e)?a:Wu(a)?o&&NWe(n)?a:a.value:ch(a)?i?PSe(a):Zl(a):a}}const DSr=fkt(),FSr=fkt(!0);function fkt(i=!1){return function(t,r,n,s){let o=t[r];if(fk(o)&&Wu(o)&&!Wu(n))return!1;if(!i&&(!HW(n)&&!fk(n)&&(o=Qs(o),n=Qs(n)),!Ms(t)&&Wu(o)&&!Wu(n)))return o.value=n,!0;const a=Ms(t)&&NWe(r)?Number(r)i,MSe=i=>Reflect.getPrototypeOf(i);function Nhe(i,e,t=!1,r=!1){i=i.__v_raw;const n=Qs(i),s=Qs(e);t||(e!==s&&Bb(n,"get",e),Bb(n,"get",s));const{has:o}=MSe(n),a=r?jWe:t?UWe:use;if(o.call(n,e))return a(i.get(e));if(o.call(n,s))return a(i.get(s));i!==n&&i.get(e)}function $he(i,e=!1){const t=this.__v_raw,r=Qs(t),n=Qs(i);return e||(i!==n&&Bb(r,"has",i),Bb(r,"has",n)),i===n?t.has(i):t.has(i)||t.has(n)}function Bhe(i,e=!1){return i=i.__v_raw,!e&&Bb(Qs(i),"iterate",o9),Reflect.get(i,"size",i)}function vut(i){i=Qs(i);const e=Qs(this);return MSe(e).has.call(e,i)||(e.add(i),wR(e,"add",i,i)),this}function _ut(i,e){e=Qs(e);const t=Qs(this),{has:r,get:n}=MSe(t);let s=r.call(t,i);s||(i=Qs(i),s=r.call(t,i));const o=n.call(t,i);return t.set(i,e),s?VW(e,o)&&wR(t,"set",i,e):wR(t,"add",i,e),this}function but(i){const e=Qs(this),{has:t,get:r}=MSe(e);let n=t.call(e,i);n||(i=Qs(i),n=t.call(e,i)),r&&r.call(e,i);const s=e.delete(i);return n&&wR(e,"delete",i,void 0),s}function wut(){const i=Qs(this),e=i.size!==0,t=i.clear();return e&&wR(i,"clear",void 0,void 0),t}function jhe(i,e){return function(r,n){const s=this,o=s.__v_raw,a=Qs(o),l=e?jWe:i?UWe:use;return!i&&Bb(a,"iterate",o9),o.forEach((u,c)=>r.call(n,l(u),l(c),s))}}function Ghe(i,e,t){return function(...r){const n=this.__v_raw,s=Qs(n),o=QV(s),a=i==="entries"||i===Symbol.iterator&&o,l=i==="keys"&&o,u=n[i](...r),c=t?jWe:e?UWe:use;return!e&&Bb(s,"iterate",l?t$e:o9),{next(){const{value:h,done:p}=u.next();return p?{value:h,done:p}:{value:a?[c(h[0]),c(h[1])]:c(h),done:p}},[Symbol.iterator](){return this}}}}function xD(i){return function(...e){return i==="delete"?!1:this}}function jSr(){const i={get(s){return Nhe(this,s)},get size(){return Bhe(this)},has:$he,add:vut,set:_ut,delete:but,clear:wut,forEach:jhe(!1,!1)},e={get(s){return Nhe(this,s,!1,!0)},get size(){return Bhe(this)},has:$he,add:vut,set:_ut,delete:but,clear:wut,forEach:jhe(!1,!0)},t={get(s){return Nhe(this,s,!0)},get size(){return Bhe(this,!0)},has(s){return $he.call(this,s,!0)},add:xD("add"),set:xD("set"),delete:xD("delete"),clear:xD("clear"),forEach:jhe(!0,!1)},r={get(s){return Nhe(this,s,!0,!0)},get size(){return Bhe(this,!0)},has(s){return $he.call(this,s,!0)},add:xD("add"),set:xD("set"),delete:xD("delete"),clear:xD("clear"),forEach:jhe(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=Ghe(s,!1,!1),t[s]=Ghe(s,!0,!1),e[s]=Ghe(s,!1,!0),r[s]=Ghe(s,!0,!0)}),[i,t,e,r]}const[GSr,USr,zSr,VSr]=jSr();function OSe(i,e){const t=e?i?VSr:zSr:i?USr:GSr;return(r,n,s)=>n==="__v_isReactive"?!i:n==="__v_isReadonly"?i:n==="__v_raw"?r:Reflect.get(ic(t,n)&&n in r?t:r,n,s)}const HSr={get:OSe(!1,!1)},WSr={get:OSe(!1,!0)},qSr={get:OSe(!0,!1)},YSr={get:OSe(!0,!0)},ykt=new WeakMap,vkt=new WeakMap,_kt=new WeakMap,bkt=new WeakMap;function XSr(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function JSr(i){return i.__v_skip||!Object.isExtensible(i)?0:XSr(sSr(i))}function Zl(i){return fk(i)?i:RSe(i,!1,mkt,HSr,ykt)}function GWe(i){return RSe(i,!1,$Sr,WSr,vkt)}function PSe(i){return RSe(i,!0,gkt,qSr,_kt)}function wkt(i){return RSe(i,!0,BSr,YSr,bkt)}function RSe(i,e,t,r,n){if(!ch(i)||i.__v_raw&&!(e&&i.__v_isReactive))return i;const s=n.get(i);if(s)return s;const o=JSr(i);if(o===0)return i;const a=new Proxy(i,o===2?r:t);return n.set(i,a),a}function TS(i){return fk(i)?TS(i.__v_raw):!!(i&&i.__v_isReactive)}function fk(i){return!!(i&&i.__v_isReadonly)}function HW(i){return!!(i&&i.__v_isShallow)}function DSe(i){return TS(i)||fk(i)}function Qs(i){const e=i&&i.__v_raw;return e?Qs(e):i}function Da(i){return Q1e(i,"__v_skip",!0),i}const use=i=>ch(i)?Zl(i):i,UWe=i=>ch(i)?PSe(i):i;function zWe(i){EF&&IC&&(i=Qs(i),dkt(i.dep||(i.dep=BWe())))}function FSe(i,e){i=Qs(i);const t=i.dep;t&&i$e(t)}function Wu(i){return!!(i&&i.__v_isRef===!0)}function vi(i){return xkt(i,!1)}function qae(i){return xkt(i,!0)}function xkt(i,e){return Wu(i)?i:new KSr(i,e)}class KSr{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Qs(e),this._value=t?e:use(e)}get value(){return zWe(this),this._value}set value(e){const t=this.__v_isShallow||HW(e)||fk(e);e=t?e:Qs(e),VW(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:use(e),FSe(this))}}function Skt(i){FSe(i)}function ri(i){return Wu(i)?i.value:i}function Tkt(i){return Ra(i)?i():ri(i)}const ZSr={get:(i,e,t)=>ri(Reflect.get(i,e,t)),set:(i,e,t,r)=>{const n=i[e];return Wu(n)&&!Wu(t)?(n.value=t,!0):Reflect.set(i,e,t,r)}};function kSe(i){return TS(i)?i:new Proxy(i,ZSr)}class QSr{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:r}=e(()=>zWe(this),()=>FSe(this));this._get=t,this._set=r}get value(){return this._get()}set value(e){this._set(e)}}function Ckt(i){return new QSr(i)}function g8(i){const e=Ms(i)?new Array(i.length):{};for(const t in i)e[t]=Ekt(i,t);return e}class eTr{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return CSr(Qs(this._object),this._key)}}class tTr{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function LSe(i,e,t){return Wu(i)?i:Ra(i)?new tTr(i):ch(i)&&arguments.length>1?Ekt(i,e,t):vi(i)}function Ekt(i,e,t){const r=i[e];return Wu(r)?r:new eTr(i,e,t)}class iTr{constructor(e,t,r,n){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new YY(e,()=>{this._dirty||(this._dirty=!0,FSe(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!n,this.__v_isReadonly=r}get value(){const e=Qs(this);return zWe(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function rTr(i,e,t=!1){let r,n;const s=Ra(i);return s?(r=i,n=J1):(r=i.get,n=i.set),new iTr(r,n,s||!n,t)}function Ikt(i,...e){}function Akt(i,e){}function YA(i,e,t,r){let n;try{n=r?i(...r):i()}catch(s){Qk(s,e,t)}return n}function Ob(i,e,t,r){if(Ra(i)){const s=YA(i,e,t,r);return s&&LWe(s)&&s.catch(o=>{Qk(o,e,t)}),s}const n=[];for(let s=0;s>>1;hse(Pv[r])dA&&Pv.splice(e,1)}function $Se(i){Ms(i)?tH.push(...i):(!VO||!VO.includes(i,i.allowRecurse?D6+1:D6))&&tH.push(i),Okt()}function xut(i,e=cse?dA+1:0){for(;ehse(t)-hse(r)),D6=0;D6i.id==null?1/0:i.id,aTr=(i,e)=>{const t=hse(i)-hse(e);if(t===0){if(i.pre&&!e.pre)return-1;if(e.pre&&!i.pre)return 1}return t};function Pkt(i){r$e=!1,cse=!0,Pv.sort(aTr);const e=J1;try{for(dA=0;dAF6.emit(n,...s)),Uhe=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{HWe(s,e)}),setTimeout(()=>{F6||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Uhe=[])},3e3)):Uhe=[]}function lTr(i,e,...t){if(i.isUnmounted)return;const r=i.vnode.props||nh;let n=t;const s=e.startsWith("update:"),o=s&&e.slice(7);if(o&&o in r){const c=`${o==="modelValue"?"model":o}Modifiers`,{number:h,trim:p}=r[c]||nh;p&&(n=t.map(m=>El(m)?m.trim():m)),h&&(n=t.map(e_e))}let a,l=r[a=s9(e)]||r[a=s9(Pf(e))];!l&&s&&(l=r[a=s9(lx(e))]),l&&Ob(l,i,6,n);const u=r[a+"Once"];if(u){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,Ob(u,i,6,n)}}function Rkt(i,e,t=!1){const r=e.emitsCache,n=r.get(i);if(n!==void 0)return n;const s=i.emits;let o={},a=!1;if(!Ra(i)){const l=u=>{const c=Rkt(u,e,!0);c&&(a=!0,$u(o,c))};!t&&e.mixins.length&&e.mixins.forEach(l),i.extends&&l(i.extends),i.mixins&&i.mixins.forEach(l)}return!s&&!a?(ch(i)&&r.set(i,null),null):(Ms(s)?s.forEach(l=>o[l]=null):$u(o,s),ch(i)&&r.set(i,o),o)}function BSe(i,e){return!i||!i7(e)?!1:(e=e.slice(2).replace(/Once$/,""),ic(i,e[0].toLowerCase()+e.slice(1))||ic(i,lx(e))||ic(i,e))}let ny=null,jSe=null;function dse(i){const e=ny;return ny=i,jSe=i&&i.type.__scopeId||null,e}function Dc(i){jSe=i}function Fc(){jSe=null}const Dkt=i=>Rn;function Rn(i,e=ny,t){if(!e||i._n)return i;const r=(...n)=>{r._d&&o_e(-1);const s=dse(e);let o;try{o=i(...n)}finally{dse(s),r._d&&o_e(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Tge(i){const{type:e,vnode:t,proxy:r,withProxy:n,props:s,propsOptions:[o],slots:a,attrs:l,emit:u,render:c,renderCache:h,data:p,setupState:m,ctx:v,inheritAttrs:w}=i;let S,I;const R=dse(i);try{if(t.shapeFlag&4){const k=n||r;S=ix(c.call(k,k,h,s,m,p,v)),I=l}else{const k=e;S=ix(k.length>1?k(s,{attrs:l,slots:a,emit:u}):k(s,null)),I=e.props?l:cTr(l)}}catch(k){Xie.length=0,Qk(k,i,1),S=Vn(d0)}let L=S;if(I&&w!==!1){const k=Object.keys(I),{shapeFlag:B}=L;k.length&&B&7&&(o&&k.some(FWe)&&(I=hTr(I,o)),L=wE(L,I))}return t.dirs&&(L=wE(L),L.dirs=L.dirs?L.dirs.concat(t.dirs):t.dirs),t.transition&&(L.transition=t.transition),S=L,dse(R),S}function uTr(i){let e;for(let t=0;t{let e;for(const t in i)(t==="class"||t==="style"||i7(t))&&((e||(e={}))[t]=i[t]);return e},hTr=(i,e)=>{const t={};for(const r in i)(!FWe(r)||!(r.slice(9)in e))&&(t[r]=i[r]);return t};function dTr(i,e,t){const{props:r,children:n,component:s}=i,{props:o,children:a,patchFlag:l}=e,u=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return r?Sut(r,o,u):!!o;if(l&8){const c=e.dynamicProps;for(let h=0;hi.__isSuspense,pTr={name:"Suspense",__isSuspense:!0,process(i,e,t,r,n,s,o,a,l,u){i==null?fTr(e,t,r,n,s,o,a,l,u):mTr(i,e,t,r,n,o,a,l,u)},hydrate:gTr,create:qWe,normalize:yTr},kkt=pTr;function pse(i,e){const t=i.props&&i.props[e];Ra(t)&&t()}function fTr(i,e,t,r,n,s,o,a,l){const{p:u,o:{createElement:c}}=l,h=c("div"),p=i.suspense=qWe(i,n,r,e,h,t,s,o,a,l);u(null,p.pendingBranch=i.ssContent,h,null,r,p,s,o),p.deps>0?(pse(i,"onPending"),pse(i,"onFallback"),u(null,i.ssFallback,e,t,r,null,s,o),iH(p,i.ssFallback)):p.resolve(!1,!0)}function mTr(i,e,t,r,n,s,o,a,{p:l,um:u,o:{createElement:c}}){const h=e.suspense=i.suspense;h.vnode=e,e.el=i.el;const p=e.ssContent,m=e.ssFallback,{activeBranch:v,pendingBranch:w,isInFallback:S,isHydrating:I}=h;if(w)h.pendingBranch=p,AC(p,w)?(l(w,p,h.hiddenContainer,null,n,h,s,o,a),h.deps<=0?h.resolve():S&&(l(v,m,t,r,n,null,s,o,a),iH(h,m))):(h.pendingId++,I?(h.isHydrating=!1,h.activeBranch=w):u(w,n,h),h.deps=0,h.effects.length=0,h.hiddenContainer=c("div"),S?(l(null,p,h.hiddenContainer,null,n,h,s,o,a),h.deps<=0?h.resolve():(l(v,m,t,r,n,null,s,o,a),iH(h,m))):v&&AC(p,v)?(l(v,p,t,r,n,h,s,o,a),h.resolve(!0)):(l(null,p,h.hiddenContainer,null,n,h,s,o,a),h.deps<=0&&h.resolve()));else if(v&&AC(p,v))l(v,p,t,r,n,h,s,o,a),iH(h,p);else if(pse(e,"onPending"),h.pendingBranch=p,h.pendingId++,l(null,p,h.hiddenContainer,null,n,h,s,o,a),h.deps<=0)h.resolve();else{const{timeout:R,pendingId:L}=h;R>0?setTimeout(()=>{h.pendingId===L&&h.fallback(m)},R):R===0&&h.fallback(m)}}function qWe(i,e,t,r,n,s,o,a,l,u,c=!1){const{p:h,m:p,um:m,n:v,o:{parentNode:w,remove:S}}=u;let I;const R=vTr(i);R&&e?.pendingBranch&&(I=e.pendingId,e.deps++);const L=i.props?t_e(i.props.timeout):void 0,k={vnode:i,parent:e,parentComponent:t,isSVG:o,container:r,hiddenContainer:n,anchor:s,deps:0,pendingId:0,timeout:typeof L=="number"?L:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:c,isUnmounted:!1,effects:[],resolve(B=!1,$=!1){const{vnode:V,activeBranch:Y,pendingBranch:K,pendingId:Q,effects:re,parentComponent:ne,container:de}=k;if(k.isHydrating)k.isHydrating=!1;else if(!B){const Z=Y&&K.transition&&K.transition.mode==="out-in";Z&&(Y.transition.afterLeave=()=>{Q===k.pendingId&&p(K,de,ae,0)});let{anchor:ae}=k;Y&&(ae=v(Y),m(Y,ne,k,!0)),Z||p(K,de,ae,0)}iH(k,K),k.pendingBranch=null,k.isInFallback=!1;let pe=k.parent,H=!1;for(;pe;){if(pe.pendingBranch){pe.effects.push(...re),H=!0;break}pe=pe.parent}H||$Se(re),k.effects=[],R&&e&&e.pendingBranch&&I===e.pendingId&&(e.deps--,e.deps===0&&!$&&e.resolve()),pse(V,"onResolve")},fallback(B){if(!k.pendingBranch)return;const{vnode:$,activeBranch:V,parentComponent:Y,container:K,isSVG:Q}=k;pse($,"onFallback");const re=v(V),ne=()=>{k.isInFallback&&(h(null,B,K,re,Y,null,Q,a,l),iH(k,B))},de=B.transition&&B.transition.mode==="out-in";de&&(V.transition.afterLeave=ne),k.isInFallback=!0,m(V,Y,null,!0),de||ne()},move(B,$,V){k.activeBranch&&p(k.activeBranch,B,$,V),k.container=B},next(){return k.activeBranch&&v(k.activeBranch)},registerDep(B,$){const V=!!k.pendingBranch;V&&k.deps++;const Y=B.vnode.el;B.asyncDep.catch(K=>{Qk(K,B,0)}).then(K=>{if(B.isUnmounted||k.isUnmounted||k.pendingId!==B.suspenseId)return;B.asyncResolved=!0;const{vnode:Q}=B;c$e(B,K,!1),Y&&(Q.el=Y);const re=!Y&&B.subTree.el;$(B,Q,w(Y||B.subTree.el),Y?null:v(B.subTree),k,o,l),re&&S(re),WWe(B,Q.el),V&&--k.deps===0&&k.resolve()})},unmount(B,$){k.isUnmounted=!0,k.activeBranch&&m(k.activeBranch,t,B,$),k.pendingBranch&&m(k.pendingBranch,t,B,$)}};return k}function gTr(i,e,t,r,n,s,o,a,l){const u=e.suspense=qWe(e,r,t,i.parentNode,document.createElement("div"),null,n,s,o,a,!0),c=l(i,u.pendingBranch=e.ssContent,t,u,s,o);return u.deps===0&&u.resolve(!1,!0),c}function yTr(i){const{shapeFlag:e,children:t}=i,r=e&32;i.ssContent=Tut(r?t.default:t),i.ssFallback=r?Tut(t.fallback):Vn(d0)}function Tut(i){let e;if(Ra(i)){const t=vB&&i._c;t&&(i._d=!1,qt()),i=i(),t&&(i._d=!0,e=wb,yLt())}return Ms(i)&&(i=uTr(i)),i=ix(i),e&&!i.dynamicChildren&&(i.dynamicChildren=e.filter(t=>t!==i)),i}function Lkt(i,e){e&&e.pendingBranch?Ms(i)?e.effects.push(...i):e.effects.push(i):$Se(i)}function iH(i,e){i.activeBranch=e;const{vnode:t,parentComponent:r}=i,n=t.el=e.el;r&&r.subTree===t&&(r.vnode.el=n,WWe(r,n))}function vTr(i){var e;return((e=i.props)==null?void 0:e.suspensible)!=null&&i.props.suspensible!==!1}function Nkt(i,e){return Yae(i,null,e)}function YWe(i,e){return Yae(i,null,{flush:"post"})}function $kt(i,e){return Yae(i,null,{flush:"sync"})}const zhe={};function rl(i,e,t){return Yae(i,e,t)}function Yae(i,e,{immediate:t,deep:r,flush:n,onTrack:s,onTrigger:o}=nh){var a;const l=ISe()===((a=_m)==null?void 0:a.scope)?_m:null;let u,c=!1,h=!1;if(Wu(i)?(u=()=>i.value,c=HW(i)):TS(i)?(u=()=>i,r=!0):Ms(i)?(h=!0,c=i.some(k=>TS(k)||HW(k)),u=()=>i.map(k=>{if(Wu(k))return k.value;if(TS(k))return y8(k);if(Ra(k))return YA(k,l,2)})):Ra(i)?e?u=()=>YA(i,l,2):u=()=>{if(!(l&&l.isUnmounted))return p&&p(),Ob(i,l,3,[m])}:u=J1,e&&r){const k=u;u=()=>y8(k())}let p,m=k=>{p=R.onStop=()=>{YA(k,l,4)}},v;if(WW)if(m=J1,e?t&&Ob(e,l,3,[u(),h?[]:void 0,m]):u(),n==="sync"){const k=gqe();v=k.__watcherHandles||(k.__watcherHandles=[])}else return J1;let w=h?new Array(i.length).fill(zhe):zhe;const S=()=>{if(R.active)if(e){const k=R.run();(r||c||(h?k.some((B,$)=>VW(B,w[$])):VW(k,w)))&&(p&&p(),Ob(e,l,3,[k,w===zhe?void 0:h&&w[0]===zhe?[]:w,m]),w=k)}else R.run()};S.allowRecurse=!!e;let I;n==="sync"?I=S:n==="post"?I=()=>zy(S,l&&l.suspense):(S.pre=!0,l&&(S.id=l.uid),I=()=>NSe(S));const R=new YY(u,I);e?t?S():w=R.run():n==="post"?zy(R.run.bind(R),l&&l.suspense):R.run();const L=()=>{R.stop(),l&&l.scope&&kWe(l.scope.effects,R)};return v&&v.push(L),L}function _Tr(i,e,t){const r=this.proxy,n=El(i)?i.includes(".")?Bkt(r,i):()=>r[i]:i.bind(r,r);let s;Ra(e)?s=e:(s=e.handler,t=e);const o=_m;gk(this);const a=Yae(n,s.bind(r),t);return o?gk(o):AF(),a}function Bkt(i,e){const t=e.split(".");return()=>{let r=i;for(let n=0;n{y8(t,e)});else if(tkt(i))for(const t in i)y8(i[t],e);return i}function Ur(i,e){const t=ny;if(t===null)return i;const r=YSe(t)||t.proxy,n=i.dirs||(i.dirs=[]);for(let s=0;s{i.isMounted=!0}),Ka(()=>{i.isUnmounting=!0}),i}const c2=[Function,Array],USe={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:c2,onEnter:c2,onAfterEnter:c2,onEnterCancelled:c2,onBeforeLeave:c2,onLeave:c2,onAfterLeave:c2,onLeaveCancelled:c2,onBeforeAppear:c2,onAppear:c2,onAfterAppear:c2,onAppearCancelled:c2},bTr={name:"BaseTransition",props:USe,setup(i,{slots:e}){const t=Df(),r=GSe();let n;return()=>{const s=e.default&&Xae(e.default(),!0);if(!s||!s.length)return;let o=s[0];if(s.length>1){for(const w of s)if(w.type!==d0){o=w;break}}const a=Qs(i),{mode:l}=a;if(r.isLeaving)return jMe(o);const u=Cut(o);if(!u)return jMe(o);const c=yB(u,a,r,t);mk(u,c);const h=t.subTree,p=h&&Cut(h);let m=!1;const{getTransitionKey:v}=u.type;if(v){const w=v();n===void 0?n=w:w!==n&&(n=w,m=!0)}if(p&&p.type!==d0&&(!AC(u,p)||m)){const w=yB(p,a,r,t);if(mk(p,w),l==="out-in")return r.isLeaving=!0,w.afterLeave=()=>{r.isLeaving=!1,t.update.active!==!1&&t.update()},jMe(o);l==="in-out"&&u.type!==d0&&(w.delayLeave=(S,I,R)=>{const L=jkt(r,p);L[String(p.key)]=p,S._leaveCb=()=>{I(),S._leaveCb=void 0,delete c.delayedLeave},c.delayedLeave=R})}return o}}},XWe=bTr;function jkt(i,e){const{leavingVNodes:t}=i;let r=t.get(e.type);return r||(r=Object.create(null),t.set(e.type,r)),r}function yB(i,e,t,r){const{appear:n,mode:s,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:u,onEnterCancelled:c,onBeforeLeave:h,onLeave:p,onAfterLeave:m,onLeaveCancelled:v,onBeforeAppear:w,onAppear:S,onAfterAppear:I,onAppearCancelled:R}=e,L=String(i.key),k=jkt(t,i),B=(Y,K)=>{Y&&Ob(Y,r,9,K)},$=(Y,K)=>{const Q=K[1];B(Y,K),Ms(Y)?Y.every(re=>re.length<=1)&&Q():Y.length<=1&&Q()},V={mode:s,persisted:o,beforeEnter(Y){let K=a;if(!t.isMounted)if(n)K=w||a;else return;Y._leaveCb&&Y._leaveCb(!0);const Q=k[L];Q&&AC(i,Q)&&Q.el._leaveCb&&Q.el._leaveCb(),B(K,[Y])},enter(Y){let K=l,Q=u,re=c;if(!t.isMounted)if(n)K=S||l,Q=I||u,re=R||c;else return;let ne=!1;const de=Y._enterCb=pe=>{ne||(ne=!0,pe?B(re,[Y]):B(Q,[Y]),V.delayedLeave&&V.delayedLeave(),Y._enterCb=void 0)};K?$(K,[Y,de]):de()},leave(Y,K){const Q=String(i.key);if(Y._enterCb&&Y._enterCb(!0),t.isUnmounting)return K();B(h,[Y]);let re=!1;const ne=Y._leaveCb=de=>{re||(re=!0,K(),de?B(v,[Y]):B(m,[Y]),Y._leaveCb=void 0,k[Q]===i&&delete k[Q])};k[Q]=i,p?$(p,[Y,ne]):ne()},clone(Y){return yB(Y,e,t,r)}};return V}function jMe(i){if(Jae(i))return i=wE(i),i.children=null,i}function Cut(i){return Jae(i)?i.children?i.children[0]:void 0:i}function mk(i,e){i.shapeFlag&6&&i.component?mk(i.component.subTree,e):i.shapeFlag&128?(i.ssContent.transition=e.clone(i.ssContent),i.ssFallback.transition=e.clone(i.ssFallback)):i.transition=e}function Xae(i,e=!1,t){let r=[],n=0;for(let s=0;s1)for(let s=0;s!!i.type.__asyncLoader;function fse(i){Ra(i)&&(i={loader:i});const{loader:e,loadingComponent:t,errorComponent:r,delay:n=200,timeout:s,suspensible:o=!0,onError:a}=i;let l=null,u,c=0;const h=()=>(c++,l=null,p()),p=()=>{let m;return l||(m=l=e().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),a)return new Promise((w,S)=>{a(v,()=>w(h()),()=>S(v),c+1)});throw v}).then(v=>m!==l&&l?l:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),u=v,v)))};return Xr({name:"AsyncComponentWrapper",__asyncLoader:p,get __asyncResolved(){return u},setup(){const m=_m;if(u)return()=>GMe(u,m);const v=R=>{l=null,Qk(R,m,13,!r)};if(o&&m.suspense||WW)return p().then(R=>()=>GMe(R,m)).catch(R=>(v(R),()=>r?Vn(r,{error:R}):null));const w=vi(!1),S=vi(),I=vi(!!n);return n&&setTimeout(()=>{I.value=!1},n),s!=null&&setTimeout(()=>{if(!w.value&&!S.value){const R=new Error(`Async component timed out after ${s}ms.`);v(R),S.value=R}},s),p().then(()=>{w.value=!0,m.parent&&Jae(m.parent.vnode)&&NSe(m.parent.update)}).catch(R=>{v(R),S.value=R}),()=>{if(w.value&&u)return GMe(u,m);if(S.value&&r)return Vn(r,{error:S.value});if(t&&!I.value)return Vn(t)}}})}function GMe(i,e){const{ref:t,props:r,children:n,ce:s}=e.vnode,o=Vn(i,r,n);return o.ref=t,o.ce=s,delete e.vnode.ce,o}const Jae=i=>i.type.__isKeepAlive,wTr={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(i,{slots:e}){const t=Df(),r=t.ctx;if(!r.renderer)return()=>{const R=e.default&&e.default();return R&&R.length===1?R[0]:R};const n=new Map,s=new Set;let o=null;const a=t.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:h}}}=r,p=h("div");r.activate=(R,L,k,B,$)=>{const V=R.component;u(R,L,k,0,a),l(V.vnode,R,L,k,V,a,B,R.slotScopeIds,$),zy(()=>{V.isDeactivated=!1,V.a&&eH(V.a);const Y=R.props&&R.props.onVnodeMounted;Y&&nb(Y,V.parent,R)},a)},r.deactivate=R=>{const L=R.component;u(R,p,null,1,a),zy(()=>{L.da&&eH(L.da);const k=R.props&&R.props.onVnodeUnmounted;k&&nb(k,L.parent,R),L.isDeactivated=!0},a)};function m(R){UMe(R),c(R,t,a,!0)}function v(R){n.forEach((L,k)=>{const B=d$e(L.type);B&&(!R||!R(B))&&w(k)})}function w(R){const L=n.get(R);!o||!AC(L,o)?m(L):o&&UMe(o),n.delete(R),s.delete(R)}rl(()=>[i.include,i.exclude],([R,L])=>{R&&v(k=>JQ(R,k)),L&&v(k=>!JQ(L,k))},{flush:"post",deep:!0});let S=null;const I=()=>{S!=null&&n.set(S,zMe(t.subTree))};return Fa(I),n7(I),Ka(()=>{n.forEach(R=>{const{subTree:L,suspense:k}=t,B=zMe(L);if(R.type===B.type&&R.key===B.key){UMe(B);const $=B.component.da;$&&zy($,k);return}m(R)})}),()=>{if(S=null,!e.default)return null;const R=e.default(),L=R[0];if(R.length>1)return o=null,R;if(!_3(L)||!(L.shapeFlag&4)&&!(L.shapeFlag&128))return o=null,L;let k=zMe(L);const B=k.type,$=d$e(a9(k)?k.type.__asyncResolved||{}:B),{include:V,exclude:Y,max:K}=i;if(V&&(!$||!JQ(V,$))||Y&&$&&JQ(Y,$))return o=k,L;const Q=k.key==null?B:k.key,re=n.get(Q);return k.el&&(k=wE(k),L.shapeFlag&128&&(L.ssContent=k)),S=Q,re?(k.el=re.el,k.component=re.component,k.transition&&mk(k,k.transition),k.shapeFlag|=512,s.delete(Q),s.add(Q)):(s.add(Q),K&&s.size>parseInt(K,10)&&w(s.values().next().value)),k.shapeFlag|=256,o=k,Fkt(L.type)?L:k}}},Gkt=wTr;function JQ(i,e){return Ms(i)?i.some(t=>JQ(t,e)):El(i)?i.split(",").includes(e):nSr(i)?i.test(e):!1}function JWe(i,e){Ukt(i,"a",e)}function KWe(i,e){Ukt(i,"da",e)}function Ukt(i,e,t=_m){const r=i.__wdc||(i.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return i()});if(zSe(e,r,t),t){let n=t.parent;for(;n&&n.parent;)Jae(n.parent.vnode)&&xTr(r,e,t,n),n=n.parent}}function xTr(i,e,t,r){const n=zSe(e,i,r,!0);s7(()=>{kWe(r[e],n)},t)}function UMe(i){i.shapeFlag&=-257,i.shapeFlag&=-513}function zMe(i){return i.shapeFlag&128?i.ssContent:i}function zSe(i,e,t=_m,r=!1){if(t){const n=t[i]||(t[i]=[]),s=e.__weh||(e.__weh=(...o)=>{if(t.isUnmounted)return;XY(),gk(t);const a=Ob(e,t,i,o);return AF(),JY(),a});return r?n.unshift(s):n.push(s),s}}const UR=i=>(e,t=_m)=>(!WW||i==="sp")&&zSe(i,(...r)=>e(...r),t),E0=UR("bm"),Fa=UR("m"),ZWe=UR("bu"),n7=UR("u"),Ka=UR("bum"),s7=UR("um"),QWe=UR("sp"),eqe=UR("rtg"),tqe=UR("rtc");function VSe(i,e=_m){zSe("ec",i,e)}const iqe="components",STr="directives";function Ko(i,e){return rqe(iqe,i,!0,e)||i}const zkt=Symbol.for("v-ndc");function xR(i){return El(i)?rqe(iqe,i,!1)||i:i||zkt}function Nn(i){return rqe(STr,i)}function rqe(i,e,t=!0,r=!1){const n=ny||_m;if(n){const s=n.type;if(i===iqe){const a=d$e(s,!1);if(a&&(a===e||a===Pf(e)||a===Zk(Pf(e))))return s}const o=Eut(n[i]||s[i],e)||Eut(n.appContext[i],e);return!o&&r?s:o}}function Eut(i,e){return i&&(i[e]||i[Pf(e)]||i[Zk(Pf(e))])}function hu(i,e,t,r){let n;const s=t&&t[r];if(Ms(i)||El(i)){n=new Array(i.length);for(let o=0,a=i.length;oe(o,a,void 0,s&&s[a]));else{const o=Object.keys(i);n=new Array(o.length);for(let a=0,l=o.length;a{const s=r.fn(...n);return s&&(s.key=r.key),s}:r.fn)}return i}function Em(i,e,t={},r,n){if(ny.isCE||ny.parent&&a9(ny.parent)&&ny.parent.isCE)return e!=="default"&&(t.name=e),Vn("slot",t,r&&r());let s=i[e];s&&s._c&&(s._d=!1),qt();const o=s&&Hkt(s(t)),a=Dn(Ks,{key:t.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&i._===1?64:-2);return!n&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),s&&s._c&&(s._d=!0),a}function Hkt(i){return i.some(e=>_3(e)?!(e.type===d0||e.type===Ks&&!Hkt(e.children)):!0)?i:null}function Wkt(i,e){const t={};for(const r in i)t[e&&/[A-Z]/.test(r)?`on:${r}`:s9(r)]=i[r];return t}const n$e=i=>i?xLt(i)?YSe(i)||i.proxy:n$e(i.parent):null,qie=$u(Object.create(null),{$:i=>i,$el:i=>i.vnode.el,$data:i=>i.data,$props:i=>i.props,$attrs:i=>i.attrs,$slots:i=>i.slots,$refs:i=>i.refs,$parent:i=>n$e(i.parent),$root:i=>n$e(i.root),$emit:i=>i.emit,$options:i=>nqe(i),$forceUpdate:i=>i.f||(i.f=()=>NSe(i.update)),$nextTick:i=>i.n||(i.n=Bv.bind(i.proxy)),$watch:i=>_Tr.bind(i)}),VMe=(i,e)=>i!==nh&&!i.__isScriptSetup&&ic(i,e),s$e={get({_:i},e){const{ctx:t,setupState:r,data:n,props:s,accessCache:o,type:a,appContext:l}=i;let u;if(e[0]!=="$"){const m=o[e];if(m!==void 0)switch(m){case 1:return r[e];case 2:return n[e];case 4:return t[e];case 3:return s[e]}else{if(VMe(r,e))return o[e]=1,r[e];if(n!==nh&&ic(n,e))return o[e]=2,n[e];if((u=i.propsOptions[0])&&ic(u,e))return o[e]=3,s[e];if(t!==nh&&ic(t,e))return o[e]=4,t[e];o$e&&(o[e]=0)}}const c=qie[e];let h,p;if(c)return e==="$attrs"&&Bb(i,"get",e),c(i);if((h=a.__cssModules)&&(h=h[e]))return h;if(t!==nh&&ic(t,e))return o[e]=4,t[e];if(p=l.config.globalProperties,ic(p,e))return p[e]},set({_:i},e,t){const{data:r,setupState:n,ctx:s}=i;return VMe(n,e)?(n[e]=t,!0):r!==nh&&ic(r,e)?(r[e]=t,!0):ic(i.props,e)||e[0]==="$"&&e.slice(1)in i?!1:(s[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:r,appContext:n,propsOptions:s}},o){let a;return!!t[o]||i!==nh&&ic(i,o)||VMe(e,o)||(a=s[0])&&ic(a,o)||ic(r,o)||ic(qie,o)||ic(n.config.globalProperties,o)},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:ic(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}},TTr=$u({},s$e,{get(i,e){if(e!==Symbol.unscopables)return s$e.get(i,e,i)},has(i,e){return e[0]!=="_"&&!cSr(e)}});function qkt(){return null}function Ykt(){return null}function Xkt(i){}function Jkt(i){}function Kkt(){return null}function Zkt(){}function Qkt(i,e){return null}function eLt(){return rLt().slots}function tLt(){return rLt().attrs}function iLt(i,e,t){const r=Df();if(t&&t.local){const n=vi(i[e]);return rl(()=>i[e],s=>n.value=s),rl(n,s=>{s!==i[e]&&r.emit(`update:${e}`,s)}),n}else return{__v_isRef:!0,get value(){return i[e]},set value(n){r.emit(`update:${e}`,n)}}}function rLt(){const i=Df();return i.setupContext||(i.setupContext=ELt(i))}function mse(i){return Ms(i)?i.reduce((e,t)=>(e[t]=null,e),{}):i}function nLt(i,e){const t=mse(i);for(const r in e){if(r.startsWith("__skip"))continue;let n=t[r];n?Ms(n)||Ra(n)?n=t[r]={type:n,default:e[r]}:n.default=e[r]:n===null&&(n=t[r]={default:e[r]}),n&&e[`__skip_${r}`]&&(n.skipFactory=!0)}return t}function sLt(i,e){return!i||!e?i||e:Ms(i)&&Ms(e)?i.concat(e):$u({},mse(i),mse(e))}function oLt(i,e){const t={};for(const r in i)e.includes(r)||Object.defineProperty(t,r,{enumerable:!0,get:()=>i[r]});return t}function aLt(i){const e=Df();let t=i();return AF(),LWe(t)&&(t=t.catch(r=>{throw gk(e),r})),[t,()=>gk(e)]}let o$e=!0;function CTr(i){const e=nqe(i),t=i.proxy,r=i.ctx;o$e=!1,e.beforeCreate&&Iut(e.beforeCreate,i,"bc");const{data:n,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:h,mounted:p,beforeUpdate:m,updated:v,activated:w,deactivated:S,beforeDestroy:I,beforeUnmount:R,destroyed:L,unmounted:k,render:B,renderTracked:$,renderTriggered:V,errorCaptured:Y,serverPrefetch:K,expose:Q,inheritAttrs:re,components:ne,directives:de,filters:pe}=e;if(u&&ETr(u,r,null),o)for(const ae in o){const fe=o[ae];Ra(fe)&&(r[ae]=fe.bind(t))}if(n){const ae=n.call(t,t);ch(ae)&&(i.data=Zl(ae))}if(o$e=!0,s)for(const ae in s){const fe=s[ae],be=Ra(fe)?fe.bind(t,t):Ra(fe.get)?fe.get.bind(t,t):J1,_e=!Ra(fe)&&Ra(fe.set)?fe.set.bind(t):J1,Ie=Hr({get:be,set:_e});Object.defineProperty(r,ae,{enumerable:!0,configurable:!0,get:()=>Ie.value,set:Te=>Ie.value=Te})}if(a)for(const ae in a)lLt(a[ae],r,t,ae);if(l){const ae=Ra(l)?l.call(t):l;Reflect.ownKeys(ae).forEach(fe=>{HSe(fe,ae[fe])})}c&&Iut(c,i,"c");function Z(ae,fe){Ms(fe)?fe.forEach(be=>ae(be.bind(t))):fe&&ae(fe.bind(t))}if(Z(E0,h),Z(Fa,p),Z(ZWe,m),Z(n7,v),Z(JWe,w),Z(KWe,S),Z(VSe,Y),Z(tqe,$),Z(eqe,V),Z(Ka,R),Z(s7,k),Z(QWe,K),Ms(Q))if(Q.length){const ae=i.exposed||(i.exposed={});Q.forEach(fe=>{Object.defineProperty(ae,fe,{get:()=>t[fe],set:be=>t[fe]=be})})}else i.exposed||(i.exposed={});B&&i.render===J1&&(i.render=B),re!=null&&(i.inheritAttrs=re),ne&&(i.components=ne),de&&(i.directives=de)}function ETr(i,e,t=J1){Ms(i)&&(i=a$e(i));for(const r in i){const n=i[r];let s;ch(n)?"default"in n?s=eo(n.from||r,n.default,!0):s=eo(n.from||r):s=eo(n),Wu(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[r]=s}}function Iut(i,e,t){Ob(Ms(i)?i.map(r=>r.bind(e.proxy)):i.bind(e.proxy),e,t)}function lLt(i,e,t,r){const n=r.includes(".")?Bkt(t,r):()=>t[r];if(El(i)){const s=e[i];Ra(s)&&rl(n,s)}else if(Ra(i))rl(n,i.bind(t));else if(ch(i))if(Ms(i))i.forEach(s=>lLt(s,e,t,r));else{const s=Ra(i.handler)?i.handler.bind(t):e[i.handler];Ra(s)&&rl(n,s,i)}}function nqe(i){const e=i.type,{mixins:t,extends:r}=e,{mixins:n,optionsCache:s,config:{optionMergeStrategies:o}}=i.appContext,a=s.get(e);let l;return a?l=a:!n.length&&!t&&!r?l=e:(l={},n.length&&n.forEach(u=>n_e(l,u,o,!0)),n_e(l,e,o)),ch(e)&&s.set(e,l),l}function n_e(i,e,t,r=!1){const{mixins:n,extends:s}=e;s&&n_e(i,s,t,!0),n&&n.forEach(o=>n_e(i,o,t,!0));for(const o in e)if(!(r&&o==="expose")){const a=ITr[o]||t&&t[o];i[o]=a?a(i[o],e[o]):e[o]}return i}const ITr={data:Aut,props:Mut,emits:Mut,methods:KQ,computed:KQ,beforeCreate:p1,created:p1,beforeMount:p1,mounted:p1,beforeUpdate:p1,updated:p1,beforeDestroy:p1,beforeUnmount:p1,destroyed:p1,unmounted:p1,activated:p1,deactivated:p1,errorCaptured:p1,serverPrefetch:p1,components:KQ,directives:KQ,watch:MTr,provide:Aut,inject:ATr};function Aut(i,e){return e?i?function(){return $u(Ra(i)?i.call(this,this):i,Ra(e)?e.call(this,this):e)}:e:i}function ATr(i,e){return KQ(a$e(i),a$e(e))}function a$e(i){if(Ms(i)){const e={};for(let t=0;t1)return t&&Ra(e)?e.call(r&&r.proxy):e}}function sqe(){return!!(_m||ny||gse)}function RTr(i,e,t,r=!1){const n={},s={};Q1e(s,WSe,1),i.propsDefaults=Object.create(null),cLt(i,e,n,s);for(const o in i.propsOptions[0])o in n||(n[o]=void 0);t?i.props=r?n:GWe(n):i.type.props?i.props=n:i.props=s,i.attrs=s}function DTr(i,e,t,r){const{props:n,attrs:s,vnode:{patchFlag:o}}=i,a=Qs(n),[l]=i.propsOptions;let u=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=i.vnode.dynamicProps;for(let h=0;h{l=!0;const[p,m]=hLt(h,e,!0);$u(o,p),m&&a.push(...m)};!t&&e.mixins.length&&e.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}if(!s&&!l)return ch(i)&&r.set(i,ZV),ZV;if(Ms(s))for(let c=0;c-1,m[1]=w<0||v-1||ic(m,"default"))&&a.push(h)}}}const u=[o,a];return ch(i)&&r.set(i,u),u}function Out(i){return i[0]!=="$"}function Put(i){const e=i&&i.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:i===null?"null":""}function Rut(i,e){return Put(i)===Put(e)}function Dut(i,e){return Ms(e)?e.findIndex(t=>Rut(t,i)):Ra(e)&&Rut(e,i)?0:-1}const dLt=i=>i[0]==="_"||i==="$stable",oqe=i=>Ms(i)?i.map(ix):[ix(i)],FTr=(i,e,t)=>{if(e._n)return e;const r=Rn((...n)=>oqe(e(...n)),t);return r._c=!1,r},pLt=(i,e,t)=>{const r=i._ctx;for(const n in i){if(dLt(n))continue;const s=i[n];if(Ra(s))e[n]=FTr(n,s,r);else if(s!=null){const o=oqe(s);e[n]=()=>o}}},fLt=(i,e)=>{const t=oqe(e);i.slots.default=()=>t},kTr=(i,e)=>{if(i.vnode.shapeFlag&32){const t=e._;t?(i.slots=Qs(e),Q1e(e,"_",t)):pLt(e,i.slots={})}else i.slots={},e&&fLt(i,e);Q1e(i.slots,WSe,1)},LTr=(i,e,t)=>{const{vnode:r,slots:n}=i;let s=!0,o=nh;if(r.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:($u(n,e),!t&&a===1&&delete n._):(s=!e.$stable,pLt(e,n)),o=e}else e&&(fLt(i,e),o={default:1});if(s)for(const a in n)!dLt(a)&&!(a in o)&&delete n[a]};function s_e(i,e,t,r,n=!1){if(Ms(i)){i.forEach((p,m)=>s_e(p,e&&(Ms(e)?e[m]:e),t,r,n));return}if(a9(r)&&!n)return;const s=r.shapeFlag&4?YSe(r.component)||r.component.proxy:r.el,o=n?null:s,{i:a,r:l}=i,u=e&&e.r,c=a.refs===nh?a.refs={}:a.refs,h=a.setupState;if(u!=null&&u!==l&&(El(u)?(c[u]=null,ic(h,u)&&(h[u]=null)):Wu(u)&&(u.value=null)),Ra(l))YA(l,a,12,[o,c]);else{const p=El(l),m=Wu(l);if(p||m){const v=()=>{if(i.f){const w=p?ic(h,l)?h[l]:c[l]:l.value;n?Ms(w)&&kWe(w,s):Ms(w)?w.includes(s)||w.push(s):p?(c[l]=[s],ic(h,l)&&(h[l]=c[l])):(l.value=[s],i.k&&(c[i.k]=l.value))}else p?(c[l]=o,ic(h,l)&&(h[l]=o)):m&&(l.value=o,i.k&&(c[i.k]=o))};o?(v.id=-1,zy(v,t)):v()}}}let SD=!1;const Vhe=i=>/svg/.test(i.namespaceURI)&&i.tagName!=="foreignObject",Hhe=i=>i.nodeType===8;function NTr(i){const{mt:e,p:t,o:{patchProp:r,createText:n,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:u}}=i,c=(I,R)=>{if(!R.hasChildNodes()){t(null,I,R),r_e(),R._vnode=I;return}SD=!1,h(R.firstChild,I,null,null,null),r_e(),R._vnode=I,SD&&console.error("Hydration completed but contains mismatches.")},h=(I,R,L,k,B,$=!1)=>{const V=Hhe(I)&&I.data==="[",Y=()=>w(I,R,L,k,B,V),{type:K,ref:Q,shapeFlag:re,patchFlag:ne}=R;let de=I.nodeType;R.el=I,ne===-2&&($=!1,R.dynamicChildren=null);let pe=null;switch(K){case SR:de!==3?R.children===""?(l(R.el=n(""),o(I),I),pe=I):pe=Y():(I.data!==R.children&&(SD=!0,I.data=R.children),pe=s(I));break;case d0:de!==8||V?pe=Y():pe=s(I);break;case IF:if(V&&(I=s(I),de=I.nodeType),de===1||de===3){pe=I;const H=!R.children.length;for(let Z=0;Z{$=$||!!R.dynamicChildren;const{type:V,props:Y,patchFlag:K,shapeFlag:Q,dirs:re}=R,ne=V==="input"&&re||V==="option";if(ne||K!==-1){if(re&&eA(R,null,L,"created"),Y)if(ne||!$||K&48)for(const pe in Y)(ne&&pe.endsWith("value")||i7(pe)&&!n9(pe))&&r(I,pe,null,Y[pe],!1,void 0,L);else Y.onClick&&r(I,"onClick",null,Y.onClick,!1,void 0,L);let de;if((de=Y&&Y.onVnodeBeforeMount)&&nb(de,L,R),re&&eA(R,null,L,"beforeMount"),((de=Y&&Y.onVnodeMounted)||re)&&Lkt(()=>{de&&nb(de,L,R),re&&eA(R,null,L,"mounted")},k),Q&16&&!(Y&&(Y.innerHTML||Y.textContent))){let pe=m(I.firstChild,R,I,L,k,B,$);for(;pe;){SD=!0;const H=pe;pe=pe.nextSibling,a(H)}}else Q&8&&I.textContent!==R.children&&(SD=!0,I.textContent=R.children)}return I.nextSibling},m=(I,R,L,k,B,$,V)=>{V=V||!!R.dynamicChildren;const Y=R.children,K=Y.length;for(let Q=0;Q{const{slotScopeIds:V}=R;V&&(B=B?B.concat(V):V);const Y=o(I),K=m(s(I),R,Y,L,k,B,$);return K&&Hhe(K)&&K.data==="]"?s(R.anchor=K):(SD=!0,l(R.anchor=u("]"),Y,K),K)},w=(I,R,L,k,B,$)=>{if(SD=!0,R.el=null,$){const K=S(I);for(;;){const Q=s(I);if(Q&&Q!==K)a(Q);else break}}const V=s(I),Y=o(I);return a(I),t(null,R,Y,V,L,k,Vhe(Y),B),V},S=I=>{let R=0;for(;I;)if(I=s(I),I&&Hhe(I)&&(I.data==="["&&R++,I.data==="]")){if(R===0)return s(I);R--}return I};return[c,h]}const zy=Lkt;function aqe(i){return mLt(i)}function lqe(i){return mLt(i,NTr)}function mLt(i,e){const t=QNe();t.__VUE__=!0;const{insert:r,remove:n,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:h,nextSibling:p,setScopeId:m=J1,insertStaticContent:v}=i,w=(Je,it,Ue,ct=null,st=null,Ze=null,ye=!1,Ke=null,ke=!!it.dynamicChildren)=>{if(Je===it)return;Je&&!AC(Je,it)&&(ct=yt(Je),Te(Je,st,Ze,!0),Je=null),it.patchFlag===-2&&(ke=!1,it.dynamicChildren=null);const{type:me,ref:ie,shapeFlag:ge}=it;switch(me){case SR:S(Je,it,Ue,ct);break;case d0:I(Je,it,Ue,ct);break;case IF:Je==null&&R(it,Ue,ct,ye);break;case Ks:ne(Je,it,Ue,ct,st,Ze,ye,Ke,ke);break;default:ge&1?B(Je,it,Ue,ct,st,Ze,ye,Ke,ke):ge&6?de(Je,it,Ue,ct,st,Ze,ye,Ke,ke):(ge&64||ge&128)&&me.process(Je,it,Ue,ct,st,Ze,ye,Ke,ke,ot)}ie!=null&&st&&s_e(ie,Je&&Je.ref,Ze,it||Je,!it)},S=(Je,it,Ue,ct)=>{if(Je==null)r(it.el=a(it.children),Ue,ct);else{const st=it.el=Je.el;it.children!==Je.children&&u(st,it.children)}},I=(Je,it,Ue,ct)=>{Je==null?r(it.el=l(it.children||""),Ue,ct):it.el=Je.el},R=(Je,it,Ue,ct)=>{[Je.el,Je.anchor]=v(Je.children,it,Ue,ct,Je.el,Je.anchor)},L=({el:Je,anchor:it},Ue,ct)=>{let st;for(;Je&&Je!==it;)st=p(Je),r(Je,Ue,ct),Je=st;r(it,Ue,ct)},k=({el:Je,anchor:it})=>{let Ue;for(;Je&&Je!==it;)Ue=p(Je),n(Je),Je=Ue;n(it)},B=(Je,it,Ue,ct,st,Ze,ye,Ke,ke)=>{ye=ye||it.type==="svg",Je==null?$(it,Ue,ct,st,Ze,ye,Ke,ke):K(Je,it,st,Ze,ye,Ke,ke)},$=(Je,it,Ue,ct,st,Ze,ye,Ke)=>{let ke,me;const{type:ie,props:ge,shapeFlag:je,transition:rt,dirs:Me}=Je;if(ke=Je.el=o(Je.type,Ze,ge&&ge.is,ge),je&8?c(ke,Je.children):je&16&&Y(Je.children,ke,null,ct,st,Ze&&ie!=="foreignObject",ye,Ke),Me&&eA(Je,null,ct,"created"),V(ke,Je,Je.scopeId,ye,ct),ge){for(const Ht in ge)Ht!=="value"&&!n9(Ht)&&s(ke,Ht,null,ge[Ht],Ze,Je.children,ct,st,tt);"value"in ge&&s(ke,"value",null,ge.value),(me=ge.onVnodeBeforeMount)&&nb(me,ct,Je)}Me&&eA(Je,null,ct,"beforeMount");const ht=(!st||st&&!st.pendingBranch)&&rt&&!rt.persisted;ht&&rt.beforeEnter(ke),r(ke,it,Ue),((me=ge&&ge.onVnodeMounted)||ht||Me)&&zy(()=>{me&&nb(me,ct,Je),ht&&rt.enter(ke),Me&&eA(Je,null,ct,"mounted")},st)},V=(Je,it,Ue,ct,st)=>{if(Ue&&m(Je,Ue),ct)for(let Ze=0;Ze{for(let me=ke;me{const Ke=it.el=Je.el;let{patchFlag:ke,dynamicChildren:me,dirs:ie}=it;ke|=Je.patchFlag&16;const ge=Je.props||nh,je=it.props||nh;let rt;Ue&&YL(Ue,!1),(rt=je.onVnodeBeforeUpdate)&&nb(rt,Ue,it,Je),ie&&eA(it,Je,Ue,"beforeUpdate"),Ue&&YL(Ue,!0);const Me=st&&it.type!=="foreignObject";if(me?Q(Je.dynamicChildren,me,Ke,Ue,ct,Me,Ze):ye||fe(Je,it,Ke,null,Ue,ct,Me,Ze,!1),ke>0){if(ke&16)re(Ke,it,ge,je,Ue,ct,st);else if(ke&2&&ge.class!==je.class&&s(Ke,"class",null,je.class,st),ke&4&&s(Ke,"style",ge.style,je.style,st),ke&8){const ht=it.dynamicProps;for(let Ht=0;Ht{rt&&nb(rt,Ue,it,Je),ie&&eA(it,Je,Ue,"updated")},ct)},Q=(Je,it,Ue,ct,st,Ze,ye)=>{for(let Ke=0;Ke{if(Ue!==ct){if(Ue!==nh)for(const Ke in Ue)!n9(Ke)&&!(Ke in ct)&&s(Je,Ke,Ue[Ke],null,ye,it.children,st,Ze,tt);for(const Ke in ct){if(n9(Ke))continue;const ke=ct[Ke],me=Ue[Ke];ke!==me&&Ke!=="value"&&s(Je,Ke,me,ke,ye,it.children,st,Ze,tt)}"value"in ct&&s(Je,"value",Ue.value,ct.value)}},ne=(Je,it,Ue,ct,st,Ze,ye,Ke,ke)=>{const me=it.el=Je?Je.el:a(""),ie=it.anchor=Je?Je.anchor:a("");let{patchFlag:ge,dynamicChildren:je,slotScopeIds:rt}=it;rt&&(Ke=Ke?Ke.concat(rt):rt),Je==null?(r(me,Ue,ct),r(ie,Ue,ct),Y(it.children,Ue,ie,st,Ze,ye,Ke,ke)):ge>0&&ge&64&&je&&Je.dynamicChildren?(Q(Je.dynamicChildren,je,Ue,st,Ze,ye,Ke),(it.key!=null||st&&it===st.subTree)&&uqe(Je,it,!0)):fe(Je,it,Ue,ie,st,Ze,ye,Ke,ke)},de=(Je,it,Ue,ct,st,Ze,ye,Ke,ke)=>{it.slotScopeIds=Ke,Je==null?it.shapeFlag&512?st.ctx.activate(it,Ue,ct,ye,ke):pe(it,Ue,ct,st,Ze,ye,ke):H(Je,it,ke)},pe=(Je,it,Ue,ct,st,Ze,ye)=>{const Ke=Je.component=wLt(Je,ct,st);if(Jae(Je)&&(Ke.ctx.renderer=ot),SLt(Ke),Ke.asyncDep){if(st&&st.registerDep(Ke,Z),!Je.el){const ke=Ke.subTree=Vn(d0);I(null,ke,it,Ue)}return}Z(Ke,Je,it,Ue,st,Ze,ye)},H=(Je,it,Ue)=>{const ct=it.component=Je.component;if(dTr(Je,it,Ue))if(ct.asyncDep&&!ct.asyncResolved){ae(ct,it,Ue);return}else ct.next=it,oTr(ct.update),ct.update();else it.el=Je.el,ct.vnode=it},Z=(Je,it,Ue,ct,st,Ze,ye)=>{const Ke=()=>{if(Je.isMounted){let{next:ie,bu:ge,u:je,parent:rt,vnode:Me}=Je,ht=ie,Ht;YL(Je,!1),ie?(ie.el=Me.el,ae(Je,ie,ye)):ie=Me,ge&&eH(ge),(Ht=ie.props&&ie.props.onVnodeBeforeUpdate)&&nb(Ht,rt,ie,Me),YL(Je,!0);const _t=Tge(Je),Fe=Je.subTree;Je.subTree=_t,w(Fe,_t,h(Fe.el),yt(Fe),Je,st,Ze),ie.el=_t.el,ht===null&&WWe(Je,_t.el),je&&zy(je,st),(Ht=ie.props&&ie.props.onVnodeUpdated)&&zy(()=>nb(Ht,rt,ie,Me),st)}else{let ie;const{el:ge,props:je}=it,{bm:rt,m:Me,parent:ht}=Je,Ht=a9(it);if(YL(Je,!1),rt&&eH(rt),!Ht&&(ie=je&&je.onVnodeBeforeMount)&&nb(ie,ht,it),YL(Je,!0),ge&&At){const _t=()=>{Je.subTree=Tge(Je),At(ge,Je.subTree,Je,st,null)};Ht?it.type.__asyncLoader().then(()=>!Je.isUnmounted&&_t()):_t()}else{const _t=Je.subTree=Tge(Je);w(null,_t,Ue,ct,Je,st,Ze),it.el=_t.el}if(Me&&zy(Me,st),!Ht&&(ie=je&&je.onVnodeMounted)){const _t=it;zy(()=>nb(ie,ht,_t),st)}(it.shapeFlag&256||ht&&a9(ht.vnode)&&ht.vnode.shapeFlag&256)&&Je.a&&zy(Je.a,st),Je.isMounted=!0,it=Ue=ct=null}},ke=Je.effect=new YY(Ke,()=>NSe(me),Je.scope),me=Je.update=()=>ke.run();me.id=Je.uid,YL(Je,!0),me()},ae=(Je,it,Ue)=>{it.component=Je;const ct=Je.vnode.props;Je.vnode=it,Je.next=null,DTr(Je,it.props,ct,Ue),LTr(Je,it.children,Ue),XY(),xut(),JY()},fe=(Je,it,Ue,ct,st,Ze,ye,Ke,ke=!1)=>{const me=Je&&Je.children,ie=Je?Je.shapeFlag:0,ge=it.children,{patchFlag:je,shapeFlag:rt}=it;if(je>0){if(je&128){_e(me,ge,Ue,ct,st,Ze,ye,Ke,ke);return}else if(je&256){be(me,ge,Ue,ct,st,Ze,ye,Ke,ke);return}}rt&8?(ie&16&&tt(me,st,Ze),ge!==me&&c(Ue,ge)):ie&16?rt&16?_e(me,ge,Ue,ct,st,Ze,ye,Ke,ke):tt(me,st,Ze,!0):(ie&8&&c(Ue,""),rt&16&&Y(ge,Ue,ct,st,Ze,ye,Ke,ke))},be=(Je,it,Ue,ct,st,Ze,ye,Ke,ke)=>{Je=Je||ZV,it=it||ZV;const me=Je.length,ie=it.length,ge=Math.min(me,ie);let je;for(je=0;jeie?tt(Je,st,Ze,!0,!1,ge):Y(it,Ue,ct,st,Ze,ye,Ke,ke,ge)},_e=(Je,it,Ue,ct,st,Ze,ye,Ke,ke)=>{let me=0;const ie=it.length;let ge=Je.length-1,je=ie-1;for(;me<=ge&&me<=je;){const rt=Je[me],Me=it[me]=ke?v5(it[me]):ix(it[me]);if(AC(rt,Me))w(rt,Me,Ue,null,st,Ze,ye,Ke,ke);else break;me++}for(;me<=ge&&me<=je;){const rt=Je[ge],Me=it[je]=ke?v5(it[je]):ix(it[je]);if(AC(rt,Me))w(rt,Me,Ue,null,st,Ze,ye,Ke,ke);else break;ge--,je--}if(me>ge){if(me<=je){const rt=je+1,Me=rtje)for(;me<=ge;)Te(Je[me],st,Ze,!0),me++;else{const rt=me,Me=me,ht=new Map;for(me=Me;me<=je;me++){const E=it[me]=ke?v5(it[me]):ix(it[me]);E.key!=null&&ht.set(E.key,me)}let Ht,_t=0;const Fe=je-Me+1;let Yt=!1,A=0;const ue=new Array(Fe);for(me=0;me=Fe){Te(E,st,Ze,!0);continue}let _;if(E.key!=null)_=ht.get(E.key);else for(Ht=Me;Ht<=je;Ht++)if(ue[Ht-Me]===0&&AC(E,it[Ht])){_=Ht;break}_===void 0?Te(E,st,Ze,!0):(ue[_-Me]=me+1,_>=A?A=_:Yt=!0,w(E,it[_],Ue,null,st,Ze,ye,Ke,ke),_t++)}const G=Yt?$Tr(ue):ZV;for(Ht=G.length-1,me=Fe-1;me>=0;me--){const E=Me+me,_=it[E],g=E+1{const{el:Ze,type:ye,transition:Ke,children:ke,shapeFlag:me}=Je;if(me&6){Ie(Je.component.subTree,it,Ue,ct);return}if(me&128){Je.suspense.move(it,Ue,ct);return}if(me&64){ye.move(Je,it,Ue,ot);return}if(ye===Ks){r(Ze,it,Ue);for(let ge=0;geKe.enter(Ze),st);else{const{leave:ge,delayLeave:je,afterLeave:rt}=Ke,Me=()=>r(Ze,it,Ue),ht=()=>{ge(Ze,()=>{Me(),rt&&rt()})};je?je(Ze,Me,ht):ht()}else r(Ze,it,Ue)},Te=(Je,it,Ue,ct=!1,st=!1)=>{const{type:Ze,props:ye,ref:Ke,children:ke,dynamicChildren:me,shapeFlag:ie,patchFlag:ge,dirs:je}=Je;if(Ke!=null&&s_e(Ke,null,Ue,Je,!0),ie&256){it.ctx.deactivate(Je);return}const rt=ie&1&&je,Me=!a9(Je);let ht;if(Me&&(ht=ye&&ye.onVnodeBeforeUnmount)&&nb(ht,it,Je),ie&6)$e(Je.component,Ue,ct);else{if(ie&128){Je.suspense.unmount(Ue,ct);return}rt&&eA(Je,null,it,"beforeUnmount"),ie&64?Je.type.remove(Je,it,Ue,st,ot,ct):me&&(Ze!==Ks||ge>0&&ge&64)?tt(me,it,Ue,!1,!0):(Ze===Ks&&ge&384||!st&&ie&16)&&tt(ke,it,Ue),ct&&Be(Je)}(Me&&(ht=ye&&ye.onVnodeUnmounted)||rt)&&zy(()=>{ht&&nb(ht,it,Je),rt&&eA(Je,null,it,"unmounted")},Ue)},Be=Je=>{const{type:it,el:Ue,anchor:ct,transition:st}=Je;if(it===Ks){Ve(Ue,ct);return}if(it===IF){k(Je);return}const Ze=()=>{n(Ue),st&&!st.persisted&&st.afterLeave&&st.afterLeave()};if(Je.shapeFlag&1&&st&&!st.persisted){const{leave:ye,delayLeave:Ke}=st,ke=()=>ye(Ue,Ze);Ke?Ke(Je.el,Ze,ke):ke()}else Ze()},Ve=(Je,it)=>{let Ue;for(;Je!==it;)Ue=p(Je),n(Je),Je=Ue;n(it)},$e=(Je,it,Ue)=>{const{bum:ct,scope:st,update:Ze,subTree:ye,um:Ke}=Je;ct&&eH(ct),st.stop(),Ze&&(Ze.active=!1,Te(ye,Je,it,Ue)),Ke&&zy(Ke,it),zy(()=>{Je.isUnmounted=!0},it),it&&it.pendingBranch&&!it.isUnmounted&&Je.asyncDep&&!Je.asyncResolved&&Je.suspenseId===it.pendingId&&(it.deps--,it.deps===0&&it.resolve())},tt=(Je,it,Ue,ct=!1,st=!1,Ze=0)=>{for(let ye=Ze;yeJe.shapeFlag&6?yt(Je.component.subTree):Je.shapeFlag&128?Je.suspense.next():p(Je.anchor||Je.el),Ct=(Je,it,Ue)=>{Je==null?it._vnode&&Te(it._vnode,null,null,!0):w(it._vnode||null,Je,it,null,null,null,Ue),xut(),r_e(),it._vnode=Je},ot={p:w,um:Te,m:Ie,r:Be,mt:pe,mc:Y,pc:fe,pbc:Q,n:yt,o:i};let vt,At;return e&&([vt,At]=e(ot)),{render:Ct,hydrate:vt,createApp:PTr(Ct,vt)}}function YL({effect:i,update:e},t){i.allowRecurse=e.allowRecurse=t}function uqe(i,e,t=!1){const r=i.children,n=e.children;if(Ms(r)&&Ms(n))for(let s=0;s>1,i[t[a]]0&&(e[r]=t[s-1]),t[s]=r)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}const BTr=i=>i.__isTeleport,Yie=i=>i&&(i.disabled||i.disabled===""),Fut=i=>typeof SVGElement<"u"&&i instanceof SVGElement,u$e=(i,e)=>{const t=i&&i.to;return El(t)?e?e(t):null:t},jTr={__isTeleport:!0,process(i,e,t,r,n,s,o,a,l,u){const{mc:c,pc:h,pbc:p,o:{insert:m,querySelector:v,createText:w,createComment:S}}=u,I=Yie(e.props);let{shapeFlag:R,children:L,dynamicChildren:k}=e;if(i==null){const B=e.el=w(""),$=e.anchor=w("");m(B,t,r),m($,t,r);const V=e.target=u$e(e.props,v),Y=e.targetAnchor=w("");V&&(m(Y,V),o=o||Fut(V));const K=(Q,re)=>{R&16&&c(L,Q,re,n,s,o,a,l)};I?K(t,$):V&&K(V,Y)}else{e.el=i.el;const B=e.anchor=i.anchor,$=e.target=i.target,V=e.targetAnchor=i.targetAnchor,Y=Yie(i.props),K=Y?t:$,Q=Y?B:V;if(o=o||Fut($),k?(p(i.dynamicChildren,k,K,n,s,o,a),uqe(i,e,!0)):l||h(i,e,K,Q,n,s,o,a,!1),I)Y||Whe(e,t,B,u,1);else if((e.props&&e.props.to)!==(i.props&&i.props.to)){const re=e.target=u$e(e.props,v);re&&Whe(e,re,null,u,0)}else Y&&Whe(e,$,V,u,1)}gLt(e)},remove(i,e,t,r,{um:n,o:{remove:s}},o){const{shapeFlag:a,children:l,anchor:u,targetAnchor:c,target:h,props:p}=i;if(h&&s(c),(o||!Yie(p))&&(s(u),a&16))for(let m=0;m0?wb||ZV:null,yLt(),vB>0&&wb&&wb.push(i),i}function si(i,e,t,r,n,s){return vLt(Ot(i,e,t,r,n,s,!0))}function Dn(i,e,t,r,n){return vLt(Vn(i,e,t,r,n,!0))}function _3(i){return i?i.__v_isVNode===!0:!1}function AC(i,e){return i.type===e.type&&i.key===e.key}function _Lt(i){}const WSe="__vInternal",bLt=({key:i})=>i??null,Cge=({ref:i,ref_key:e,ref_for:t})=>(typeof i=="number"&&(i=""+i),i!=null?El(i)||Wu(i)||Ra(i)?{i:ny,r:i,k:e,f:!!t}:i:null);function Ot(i,e=null,t=null,r=0,n=null,s=i===Ks?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:i,props:e,key:e&&bLt(e),ref:e&&Cge(e),scopeId:jSe,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:ny};return a?(dqe(l,t),s&128&&i.normalize(l)):t&&(l.shapeFlag|=El(t)?8:16),vB>0&&!o&&wb&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&wb.push(l),l}const Vn=UTr;function UTr(i,e=null,t=null,r=0,n=null,s=!1){if((!i||i===zkt)&&(i=d0),_3(i)){const a=wE(i,e,!0);return t&&dqe(a,t),vB>0&&!s&&wb&&(a.shapeFlag&6?wb[wb.indexOf(i)]=a:wb.push(a)),a.patchFlag|=-2,a}if(qTr(i)&&(i=i.__vccOpts),e){e=hqe(e);let{class:a,style:l}=e;a&&!El(a)&&(e.class=Wn(a)),ch(l)&&(DSe(l)&&!Ms(l)&&(l=$u({},l)),e.style=s_(l))}const o=El(i)?1:Fkt(i)?128:BTr(i)?64:ch(i)?4:Ra(i)?2:0;return Ot(i,e,t,r,n,o,s,!0)}function hqe(i){return i?DSe(i)||WSe in i?$u({},i):i:null}function wE(i,e,t=!1){const{props:r,ref:n,patchFlag:s,children:o}=i,a=e?Kae(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:i.type,props:a,key:a&&bLt(a),ref:e&&e.ref?t&&n?Ms(n)?n.concat(Cge(e)):[n,Cge(e)]:Cge(e):n,scopeId:i.scopeId,slotScopeIds:i.slotScopeIds,children:o,target:i.target,targetAnchor:i.targetAnchor,staticCount:i.staticCount,shapeFlag:i.shapeFlag,patchFlag:e&&i.type!==Ks?s===-1?16:s|16:s,dynamicProps:i.dynamicProps,dynamicChildren:i.dynamicChildren,appContext:i.appContext,dirs:i.dirs,transition:i.transition,component:i.component,suspense:i.suspense,ssContent:i.ssContent&&wE(i.ssContent),ssFallback:i.ssFallback&&wE(i.ssFallback),el:i.el,anchor:i.anchor,ctx:i.ctx,ce:i.ce}}function Xs(i=" ",e=0){return Vn(SR,null,i,e)}function qSe(i,e){const t=Vn(IF,null,i);return t.staticCount=e,t}function Yr(i="",e=!1){return e?(qt(),Dn(d0,null,i)):Vn(d0,null,i)}function ix(i){return i==null||typeof i=="boolean"?Vn(d0):Ms(i)?Vn(Ks,null,i.slice()):typeof i=="object"?v5(i):Vn(SR,null,String(i))}function v5(i){return i.el===null&&i.patchFlag!==-1||i.memo?i:wE(i)}function dqe(i,e){let t=0;const{shapeFlag:r}=i;if(e==null)e=null;else if(Ms(e))t=16;else if(typeof e=="object")if(r&65){const n=e.default;n&&(n._c&&(n._d=!1),dqe(i,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!(WSe in e)?e._ctx=ny:n===3&&ny&&(ny.slots._===1?e._=1:(e._=2,i.patchFlag|=1024))}else Ra(e)?(e={default:e,_ctx:ny},t=32):(e=String(e),r&64?(t=16,e=[Xs(e)]):t=8);i.children=e,i.shapeFlag|=t}function Kae(...i){const e={};for(let t=0;t_m||ny;let pqe,bj,kut="__VUE_INSTANCE_SETTERS__";(bj=QNe()[kut])||(bj=QNe()[kut]=[]),bj.push(i=>_m=i),pqe=i=>{bj.length>1?bj.forEach(e=>e(i)):bj[0](i)};const gk=i=>{pqe(i),i.scope.on()},AF=()=>{_m&&_m.scope.off(),pqe(null)};function xLt(i){return i.vnode.shapeFlag&4}let WW=!1;function SLt(i,e=!1){WW=e;const{props:t,children:r}=i.vnode,n=xLt(i);RTr(i,t,n,e),kTr(i,r);const s=n?HTr(i,e):void 0;return WW=!1,s}function HTr(i,e){const t=i.type;i.accessCache=Object.create(null),i.proxy=Da(new Proxy(i.ctx,s$e));const{setup:r}=t;if(r){const n=i.setupContext=r.length>1?ELt(i):null;gk(i),XY();const s=YA(r,i,0,[i.props,n]);if(JY(),AF(),LWe(s)){if(s.then(AF,AF),e)return s.then(o=>{c$e(i,o,e)}).catch(o=>{Qk(o,i,0)});i.asyncDep=s}else c$e(i,s,e)}else CLt(i,e)}function c$e(i,e,t){Ra(e)?i.type.__ssrInlineRender?i.ssrRender=e:i.render=e:ch(e)&&(i.setupState=kSe(e)),CLt(i,t)}let a_e,h$e;function fqe(i){a_e=i,h$e=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,TTr))}}const TLt=()=>!a_e;function CLt(i,e,t){const r=i.type;if(!i.render){if(!e&&a_e&&!r.render){const n=r.template||nqe(i).template;if(n){const{isCustomElement:s,compilerOptions:o}=i.appContext.config,{delimiters:a,compilerOptions:l}=r,u=$u($u({isCustomElement:s,delimiters:a},o),l);r.render=a_e(n,u)}}i.render=r.render||J1,h$e&&h$e(i)}gk(i),XY(),CTr(i),JY(),AF()}function WTr(i){return i.attrsProxy||(i.attrsProxy=new Proxy(i.attrs,{get(e,t){return Bb(i,"get","$attrs"),e[t]}}))}function ELt(i){const e=t=>{i.exposed=t||{}};return{get attrs(){return WTr(i)},slots:i.slots,emit:i.emit,expose:e}}function YSe(i){if(i.exposed)return i.exposeProxy||(i.exposeProxy=new Proxy(kSe(Da(i.exposed)),{get(e,t){if(t in e)return e[t];if(t in qie)return qie[t](i)},has(e,t){return t in e||t in qie}}))}function d$e(i,e=!0){return Ra(i)?i.displayName||i.name:i.name||e&&i.__name}function qTr(i){return Ra(i)&&"__vccOpts"in i}const Hr=(i,e)=>rTr(i,e,WW);function dx(i,e,t){const r=arguments.length;return r===2?ch(e)&&!Ms(e)?_3(e)?Vn(i,null,[e]):Vn(i,e):Vn(i,null,e):(r>3?t=Array.prototype.slice.call(arguments,2):r===3&&_3(t)&&(t=[t]),Vn(i,e,t))}const mqe=Symbol.for("v-scx"),gqe=()=>eo(mqe);function ILt(){}function ALt(i,e,t,r){const n=t[r];if(n&&yqe(n,i))return n;const s=e();return s.memo=i.slice(),t[r]=s}function yqe(i,e){const t=i.memo;if(t.length!=e.length)return!1;for(let r=0;r0&&wb&&wb.push(i),!0}const vqe="3.3.4",YTr={createComponentInstance:wLt,setupComponent:SLt,renderComponentRoot:Tge,setCurrentRenderingInstance:dse,isVNode:_3,normalizeVNode:ix},MLt=YTr,OLt=null,PLt=null,XTr="http://www.w3.org/2000/svg",k6=typeof document<"u"?document:null,Lut=k6&&k6.createElement("template"),JTr={insert:(i,e,t)=>{e.insertBefore(i,t||null)},remove:i=>{const e=i.parentNode;e&&e.removeChild(i)},createElement:(i,e,t,r)=>{const n=e?k6.createElementNS(XTr,i):k6.createElement(i,t?{is:t}:void 0);return i==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:i=>k6.createTextNode(i),createComment:i=>k6.createComment(i),setText:(i,e)=>{i.nodeValue=e},setElementText:(i,e)=>{i.textContent=e},parentNode:i=>i.parentNode,nextSibling:i=>i.nextSibling,querySelector:i=>k6.querySelector(i),setScopeId(i,e){i.setAttribute(e,"")},insertStaticContent(i,e,t,r,n,s){const o=t?t.previousSibling:e.lastChild;if(n&&(n===s||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),t),!(n===s||!(n=n.nextSibling)););else{Lut.innerHTML=r?`${i}`:i;const a=Lut.content;if(r){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}};function KTr(i,e,t){const r=i._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?i.removeAttribute("class"):t?i.setAttribute("class",e):i.className=e}function ZTr(i,e,t){const r=i.style,n=El(t);if(t&&!n){if(e&&!El(e))for(const s in e)t[s]==null&&p$e(r,s,"");for(const s in t)p$e(r,s,t[s])}else{const s=r.display;n?e!==t&&(r.cssText=t):e&&i.removeAttribute("style"),"_vod"in i&&(r.display=s)}}const Nut=/\s*!important$/;function p$e(i,e,t){if(Ms(t))t.forEach(r=>p$e(i,e,r));else if(t==null&&(t=""),e.startsWith("--"))i.setProperty(e,t);else{const r=QTr(i,e);Nut.test(t)?i.setProperty(lx(r),t.replace(Nut,""),"important"):i[r]=t}}const $ut=["Webkit","Moz","ms"],HMe={};function QTr(i,e){const t=HMe[e];if(t)return t;let r=Pf(e);if(r!=="filter"&&r in i)return HMe[e]=r;r=Zk(r);for(let n=0;n<$ut.length;n++){const s=$ut[n]+r;if(s in i)return HMe[e]=s}return e}const But="http://www.w3.org/1999/xlink";function eCr(i,e,t,r,n){if(r&&e.startsWith("xlink:"))t==null?i.removeAttributeNS(But,e.slice(6,e.length)):i.setAttributeNS(But,e,t);else{const s=wSr(e);t==null||s&&!nkt(t)?i.removeAttribute(e):i.setAttribute(e,s?"":t)}}function tCr(i,e,t,r,n,s,o){if(e==="innerHTML"||e==="textContent"){r&&o(r,n,s),i[e]=t??"";return}const a=i.tagName;if(e==="value"&&a!=="PROGRESS"&&!a.includes("-")){i._value=t;const u=a==="OPTION"?i.getAttribute("value"):i.value,c=t??"";u!==c&&(i.value=c),t==null&&i.removeAttribute(e);return}let l=!1;if(t===""||t==null){const u=typeof i[e];u==="boolean"?t=nkt(t):t==null&&u==="string"?(t="",l=!0):u==="number"&&(t=0,l=!0)}try{i[e]=t}catch{}l&&i.removeAttribute(e)}function cP(i,e,t,r){i.addEventListener(e,t,r)}function iCr(i,e,t,r){i.removeEventListener(e,t,r)}function rCr(i,e,t,r,n=null){const s=i._vei||(i._vei={}),o=s[e];if(r&&o)o.value=r;else{const[a,l]=nCr(e);if(r){const u=s[e]=aCr(r,n);cP(i,a,u,l)}else o&&(iCr(i,a,o,l),s[e]=void 0)}}const jut=/(?:Once|Passive|Capture)$/;function nCr(i){let e;if(jut.test(i)){e={};let r;for(;r=i.match(jut);)i=i.slice(0,i.length-r[0].length),e[r[0].toLowerCase()]=!0}return[i[2]===":"?i.slice(3):lx(i.slice(2)),e]}let WMe=0;const sCr=Promise.resolve(),oCr=()=>WMe||(sCr.then(()=>WMe=0),WMe=Date.now());function aCr(i,e){const t=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=t.attached)return;Ob(lCr(r,t.value),e,5,[r])};return t.value=i,t.attached=oCr(),t}function lCr(i,e){if(Ms(e)){const t=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{t.call(i),i._stopped=!0},e.map(r=>n=>!n._stopped&&r&&r(n))}else return e}const Gut=/^on[a-z]/,uCr=(i,e,t,r,n=!1,s,o,a,l)=>{e==="class"?KTr(i,r,n):e==="style"?ZTr(i,t,r):i7(e)?FWe(e)||rCr(i,e,t,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):cCr(i,e,r,n))?tCr(i,e,r,s,o,a,l):(e==="true-value"?i._trueValue=r:e==="false-value"&&(i._falseValue=r),eCr(i,e,r,n))};function cCr(i,e,t,r){return r?!!(e==="innerHTML"||e==="textContent"||e in i&&Gut.test(e)&&Ra(t)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&i.tagName==="INPUT"||e==="type"&&i.tagName==="TEXTAREA"||Gut.test(e)&&El(t)?!1:e in i}function _qe(i,e){const t=Xr(i);class r extends Zae{constructor(s){super(t,s,e)}}return r.def=t,r}const RLt=i=>_qe(i,wqe),hCr=typeof HTMLElement<"u"?HTMLElement:class{};class Zae extends hCr{constructor(e,t={},r){super(),this._def=e,this._props=t,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this.shadowRoot&&r?r(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,Bv(()=>{this._connected||(VP(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let r=0;r{for(const n of r)this._setAttr(n.attributeName)}).observe(this,{attributes:!0});const e=(r,n=!1)=>{const{props:s,styles:o}=r;let a;if(s&&!Ms(s))for(const l in s){const u=s[l];(u===Number||u&&u.type===Number)&&(l in this._props&&(this._props[l]=t_e(this._props[l])),(a||(a=Object.create(null)))[Pf(l)]=!0)}this._numberProps=a,n&&this._resolveProps(r),this._applyStyles(o),this._update()},t=this._def.__asyncLoader;t?t().then(r=>e(r,!0)):e(this._def)}_resolveProps(e){const{props:t}=e,r=Ms(t)?t:Object.keys(t||{});for(const n of Object.keys(this))n[0]!=="_"&&r.includes(n)&&this._setProp(n,this[n],!0,!1);for(const n of r.map(Pf))Object.defineProperty(this,n,{get(){return this._getProp(n)},set(s){this._setProp(n,s)}})}_setAttr(e){let t=this.getAttribute(e);const r=Pf(e);this._numberProps&&this._numberProps[r]&&(t=t_e(t)),this._setProp(r,t,!1)}_getProp(e){return this._props[e]}_setProp(e,t,r=!0,n=!0){t!==this._props[e]&&(this._props[e]=t,n&&this._instance&&this._update(),r&&(t===!0?this.setAttribute(lx(e),""):typeof t=="string"||typeof t=="number"?this.setAttribute(lx(e),t+""):t||this.removeAttribute(lx(e))))}_update(){VP(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Vn(this._def,$u({},this._props));return this._instance||(e.ce=t=>{this._instance=t,t.isCE=!0;const r=(s,o)=>{this.dispatchEvent(new CustomEvent(s,{detail:o}))};t.emit=(s,...o)=>{r(s,o),lx(s)!==s&&r(lx(s),o)};let n=this;for(;n=n&&(n.parentNode||n.host);)if(n instanceof Zae){t.parent=n._instance,t.provides=n._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(t=>{const r=document.createElement("style");r.textContent=t,this.shadowRoot.appendChild(r)})}}function DLt(i="$style"){{const e=Df();if(!e)return nh;const t=e.type.__cssModules;if(!t)return nh;const r=t[i];return r||nh}}function FLt(i){const e=Df();if(!e)return;const t=e.ut=(n=i(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(s=>m$e(s,n))},r=()=>{const n=i(e.proxy);f$e(e.subTree,n),t(n)};YWe(r),Fa(()=>{const n=new MutationObserver(r);n.observe(e.subTree.el.parentNode,{childList:!0}),s7(()=>n.disconnect())})}function f$e(i,e){if(i.shapeFlag&128){const t=i.suspense;i=t.activeBranch,t.pendingBranch&&!t.isHydrating&&t.effects.push(()=>{f$e(t.activeBranch,e)})}for(;i.component;)i=i.component.subTree;if(i.shapeFlag&1&&i.el)m$e(i.el,e);else if(i.type===Ks)i.children.forEach(t=>f$e(t,e));else if(i.type===IF){let{el:t,anchor:r}=i;for(;t&&(m$e(t,e),t!==r);)t=t.nextSibling}}function m$e(i,e){if(i.nodeType===1){const t=i.style;for(const r in e)t.setProperty(`--${r}`,e[r])}}const TD="transition",YJ="animation",eL=(i,{slots:e})=>dx(XWe,LLt(i),e);eL.displayName="Transition";const kLt={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},dCr=eL.props=$u({},USe,kLt),XL=(i,e=[])=>{Ms(i)?i.forEach(t=>t(...e)):i&&i(...e)},Uut=i=>i?Ms(i)?i.some(e=>e.length>1):i.length>1:!1;function LLt(i){const e={};for(const ne in i)ne in kLt||(e[ne]=i[ne]);if(i.css===!1)return e;const{name:t="v",type:r,duration:n,enterFromClass:s=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=s,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:h=`${t}-leave-from`,leaveActiveClass:p=`${t}-leave-active`,leaveToClass:m=`${t}-leave-to`}=i,v=pCr(n),w=v&&v[0],S=v&&v[1],{onBeforeEnter:I,onEnter:R,onEnterCancelled:L,onLeave:k,onLeaveCancelled:B,onBeforeAppear:$=I,onAppear:V=R,onAppearCancelled:Y=L}=e,K=(ne,de,pe)=>{F4(ne,de?c:a),F4(ne,de?u:o),pe&&pe()},Q=(ne,de)=>{ne._isLeaving=!1,F4(ne,h),F4(ne,m),F4(ne,p),de&&de()},re=ne=>(de,pe)=>{const H=ne?V:R,Z=()=>K(de,ne,pe);XL(H,[de,Z]),zut(()=>{F4(de,ne?l:s),uO(de,ne?c:a),Uut(H)||Vut(de,r,w,Z)})};return $u(e,{onBeforeEnter(ne){XL(I,[ne]),uO(ne,s),uO(ne,o)},onBeforeAppear(ne){XL($,[ne]),uO(ne,l),uO(ne,u)},onEnter:re(!1),onAppear:re(!0),onLeave(ne,de){ne._isLeaving=!0;const pe=()=>Q(ne,de);uO(ne,h),$Lt(),uO(ne,p),zut(()=>{ne._isLeaving&&(F4(ne,h),uO(ne,m),Uut(k)||Vut(ne,r,S,pe))}),XL(k,[ne,pe])},onEnterCancelled(ne){K(ne,!1),XL(L,[ne])},onAppearCancelled(ne){K(ne,!0),XL(Y,[ne])},onLeaveCancelled(ne){Q(ne),XL(B,[ne])}})}function pCr(i){if(i==null)return null;if(ch(i))return[qMe(i.enter),qMe(i.leave)];{const e=qMe(i);return[e,e]}}function qMe(i){return t_e(i)}function uO(i,e){e.split(/\s+/).forEach(t=>t&&i.classList.add(t)),(i._vtc||(i._vtc=new Set)).add(e)}function F4(i,e){e.split(/\s+/).forEach(r=>r&&i.classList.remove(r));const{_vtc:t}=i;t&&(t.delete(e),t.size||(i._vtc=void 0))}function zut(i){requestAnimationFrame(()=>{requestAnimationFrame(i)})}let fCr=0;function Vut(i,e,t,r){const n=i._endId=++fCr,s=()=>{n===i._endId&&r()};if(t)return setTimeout(s,t);const{type:o,timeout:a,propCount:l}=NLt(i,e);if(!o)return r();const u=o+"end";let c=0;const h=()=>{i.removeEventListener(u,p),s()},p=m=>{m.target===i&&++c>=l&&h()};setTimeout(()=>{c(t[v]||"").split(", "),n=r(`${TD}Delay`),s=r(`${TD}Duration`),o=Hut(n,s),a=r(`${YJ}Delay`),l=r(`${YJ}Duration`),u=Hut(a,l);let c=null,h=0,p=0;e===TD?o>0&&(c=TD,h=o,p=s.length):e===YJ?u>0&&(c=YJ,h=u,p=l.length):(h=Math.max(o,u),c=h>0?o>u?TD:YJ:null,p=c?c===TD?s.length:l.length:0);const m=c===TD&&/\b(transform|all)(,|$)/.test(r(`${TD}Property`).toString());return{type:c,timeout:h,propCount:p,hasTransform:m}}function Hut(i,e){for(;i.lengthWut(t)+Wut(i[r])))}function Wut(i){return Number(i.slice(0,-1).replace(",","."))*1e3}function $Lt(){return document.body.offsetHeight}const BLt=new WeakMap,jLt=new WeakMap,GLt={name:"TransitionGroup",props:$u({},dCr,{tag:String,moveClass:String}),setup(i,{slots:e}){const t=Df(),r=GSe();let n,s;return n7(()=>{if(!n.length)return;const o=i.moveClass||`${i.name||"v"}-move`;if(!_Cr(n[0].el,t.vnode.el,o))return;n.forEach(gCr),n.forEach(yCr);const a=n.filter(vCr);$Lt(),a.forEach(l=>{const u=l.el,c=u.style;uO(u,o),c.transform=c.webkitTransform=c.transitionDuration="";const h=u._moveCb=p=>{p&&p.target!==u||(!p||/transform$/.test(p.propertyName))&&(u.removeEventListener("transitionend",h),u._moveCb=null,F4(u,o))};u.addEventListener("transitionend",h)})}),()=>{const o=Qs(i),a=LLt(o);let l=o.tag||Ks;n=s,s=e.default?Xae(e.default()):[];for(let u=0;udelete i.mode;GLt.props;const XSe=GLt;function gCr(i){const e=i.el;e._moveCb&&e._moveCb(),e._enterCb&&e._enterCb()}function yCr(i){jLt.set(i,i.el.getBoundingClientRect())}function vCr(i){const e=BLt.get(i),t=jLt.get(i),r=e.left-t.left,n=e.top-t.top;if(r||n){const s=i.el.style;return s.transform=s.webkitTransform=`translate(${r}px,${n}px)`,s.transitionDuration="0s",i}}function _Cr(i,e,t){const r=i.cloneNode();i._vtc&&i._vtc.forEach(o=>{o.split(/\s+/).forEach(a=>a&&r.classList.remove(a))}),t.split(/\s+/).forEach(o=>o&&r.classList.add(o)),r.style.display="none";const n=e.nodeType===1?e:e.parentNode;n.appendChild(r);const{hasTransform:s}=NLt(r);return n.removeChild(r),s}const yk=i=>{const e=i.props["onUpdate:modelValue"]||!1;return Ms(e)?t=>eH(e,t):e};function bCr(i){i.target.composing=!0}function qut(i){const e=i.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const LS={created(i,{modifiers:{lazy:e,trim:t,number:r}},n){i._assign=yk(n);const s=r||n.props&&n.props.type==="number";cP(i,e?"change":"input",o=>{if(o.target.composing)return;let a=i.value;t&&(a=a.trim()),s&&(a=e_e(a)),i._assign(a)}),t&&cP(i,"change",()=>{i.value=i.value.trim()}),e||(cP(i,"compositionstart",bCr),cP(i,"compositionend",qut),cP(i,"change",qut))},mounted(i,{value:e}){i.value=e??""},beforeUpdate(i,{value:e,modifiers:{lazy:t,trim:r,number:n}},s){if(i._assign=yk(s),i.composing||document.activeElement===i&&i.type!=="range"&&(t||r&&i.value.trim()===e||(n||i.type==="number")&&e_e(i.value)===e))return;const o=e??"";i.value!==o&&(i.value=o)}},JSe={deep:!0,created(i,e,t){i._assign=yk(t),cP(i,"change",()=>{const r=i._modelValue,n=qW(i),s=i.checked,o=i._assign;if(Ms(r)){const a=CSe(r,n),l=a!==-1;if(s&&!l)o(r.concat(n));else if(!s&&l){const u=[...r];u.splice(a,1),o(u)}}else if(r7(r)){const a=new Set(r);s?a.add(n):a.delete(n),o(a)}else o(ULt(i,s))})},mounted:Yut,beforeUpdate(i,e,t){i._assign=yk(t),Yut(i,e,t)}};function Yut(i,{value:e,oldValue:t},r){i._modelValue=e,Ms(e)?i.checked=CSe(e,r.props.value)>-1:r7(e)?i.checked=e.has(r.props.value):e!==t&&(i.checked=dk(e,ULt(i,!0)))}const KSe={created(i,{value:e},t){i.checked=dk(e,t.props.value),i._assign=yk(t),cP(i,"change",()=>{i._assign(qW(i))})},beforeUpdate(i,{value:e,oldValue:t},r){i._assign=yk(r),e!==t&&(i.checked=dk(e,r.props.value))}},ZSe={deep:!0,created(i,{value:e,modifiers:{number:t}},r){const n=r7(e);cP(i,"change",()=>{const s=Array.prototype.filter.call(i.options,o=>o.selected).map(o=>t?e_e(qW(o)):qW(o));i._assign(i.multiple?n?new Set(s):s:s[0])}),i._assign=yk(r)},mounted(i,{value:e}){Xut(i,e)},beforeUpdate(i,e,t){i._assign=yk(t)},updated(i,{value:e}){Xut(i,e)}};function Xut(i,e){const t=i.multiple;if(!(t&&!Ms(e)&&!r7(e))){for(let r=0,n=i.options.length;r-1:s.selected=e.has(o);else if(dk(qW(s),e)){i.selectedIndex!==r&&(i.selectedIndex=r);return}}!t&&i.selectedIndex!==-1&&(i.selectedIndex=-1)}}function qW(i){return"_value"in i?i._value:i.value}function ULt(i,e){const t=e?"_trueValue":"_falseValue";return t in i?i[t]:e}const bqe={created(i,e,t){qhe(i,e,t,null,"created")},mounted(i,e,t){qhe(i,e,t,null,"mounted")},beforeUpdate(i,e,t,r){qhe(i,e,t,r,"beforeUpdate")},updated(i,e,t,r){qhe(i,e,t,r,"updated")}};function zLt(i,e){switch(i){case"SELECT":return ZSe;case"TEXTAREA":return LS;default:switch(e){case"checkbox":return JSe;case"radio":return KSe;default:return LS}}}function qhe(i,e,t,r,n){const o=zLt(i.tagName,t.props&&t.props.type)[n];o&&o(i,e,t,r)}function wCr(){LS.getSSRProps=({value:i})=>({value:i}),KSe.getSSRProps=({value:i},e)=>{if(e.props&&dk(e.props.value,i))return{checked:!0}},JSe.getSSRProps=({value:i},e)=>{if(Ms(i)){if(e.props&&CSe(i,e.props.value)>-1)return{checked:!0}}else if(r7(i)){if(e.props&&i.has(e.props.value))return{checked:!0}}else if(i)return{checked:!0}},bqe.getSSRProps=(i,e)=>{if(typeof e.type!="string")return;const t=zLt(e.type.toUpperCase(),e.props&&e.props.type);if(t.getSSRProps)return t.getSSRProps(i,e)}}const xCr=["ctrl","shift","alt","meta"],SCr={stop:i=>i.stopPropagation(),prevent:i=>i.preventDefault(),self:i=>i.target!==i.currentTarget,ctrl:i=>!i.ctrlKey,shift:i=>!i.shiftKey,alt:i=>!i.altKey,meta:i=>!i.metaKey,left:i=>"button"in i&&i.button!==0,middle:i=>"button"in i&&i.button!==1,right:i=>"button"in i&&i.button!==2,exact:(i,e)=>xCr.some(t=>i[`${t}Key`]&&!e.includes(t))},ia=(i,e)=>(t,...r)=>{for(let n=0;nt=>{if(!("key"in t))return;const r=lx(t.key);if(e.some(n=>n===r||TCr[n]===r))return i(t)},bf={beforeMount(i,{value:e},{transition:t}){i._vod=i.style.display==="none"?"":i.style.display,t&&e?t.beforeEnter(i):XJ(i,e)},mounted(i,{value:e},{transition:t}){t&&e&&t.enter(i)},updated(i,{value:e,oldValue:t},{transition:r}){!e!=!t&&(r?e?(r.beforeEnter(i),XJ(i,!0),r.enter(i)):r.leave(i,()=>{XJ(i,!1)}):XJ(i,e))},beforeUnmount(i,{value:e}){XJ(i,e)}};function XJ(i,e){i.style.display=e?i._vod:"none"}function CCr(){bf.getSSRProps=({value:i})=>{if(!i)return{style:{display:"none"}}}}const VLt=$u({patchProp:uCr},JTr);let Jie,Jut=!1;function HLt(){return Jie||(Jie=aqe(VLt))}function WLt(){return Jie=Jut?Jie:lqe(VLt),Jut=!0,Jie}const VP=(...i)=>{HLt().render(...i)},wqe=(...i)=>{WLt().hydrate(...i)},YW=(...i)=>{const e=HLt().createApp(...i),{mount:t}=e;return e.mount=r=>{const n=YLt(r);if(!n)return;const s=e._component;!Ra(s)&&!s.render&&!s.template&&(s.template=n.innerHTML),n.innerHTML="";const o=t(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e},qLt=(...i)=>{const e=WLt().createApp(...i),{mount:t}=e;return e.mount=r=>{const n=YLt(r);if(n)return t(n,!0,n instanceof SVGElement)},e};function YLt(i){return El(i)?document.querySelector(i):i}let Kut=!1;const XLt=()=>{Kut||(Kut=!0,wCr(),CCr())},ECr=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:XWe,BaseTransitionPropsValidators:USe,Comment:d0,EffectScope:ESe,Fragment:Ks,KeepAlive:Gkt,ReactiveEffect:YY,Static:IF,Suspense:kkt,Teleport:cqe,Text:SR,Transition:eL,TransitionGroup:XSe,VueElement:Zae,assertNumber:Akt,callWithAsyncErrorHandling:Ob,callWithErrorHandling:YA,camelize:Pf,capitalize:Zk,cloneVNode:wE,compatUtils:PLt,computed:Hr,createApp:YW,createBlock:Dn,createCommentVNode:Yr,createElementBlock:si,createElementVNode:Ot,createHydrationRenderer:lqe,createPropsRestProxy:oLt,createRenderer:aqe,createSSRApp:qLt,createSlots:Vkt,createStaticVNode:qSe,createTextVNode:Xs,createVNode:Vn,customRef:Ckt,defineAsyncComponent:fse,defineComponent:Xr,defineCustomElement:_qe,defineEmits:Ykt,defineExpose:Xkt,defineModel:Zkt,defineOptions:Jkt,defineProps:qkt,defineSSRCustomElement:RLt,defineSlots:Kkt,get devtools(){return F6},effect:ukt,effectScope:Wae,getCurrentInstance:Df,getCurrentScope:ISe,getTransitionRawChildren:Xae,guardReactiveProps:hqe,h:dx,handleError:Qk,hasInjectionContext:sqe,hydrate:wqe,initCustomFormatter:ILt,initDirectivesForSSR:XLt,inject:eo,isMemoSame:yqe,isProxy:DSe,isReactive:TS,isReadonly:fk,isRef:Wu,isRuntimeOnly:TLt,isShallow:HW,isVNode:_3,markRaw:Da,mergeDefaults:nLt,mergeModels:sLt,mergeProps:Kae,nextTick:Bv,normalizeClass:Wn,normalizeProps:rkt,normalizeStyle:s_,onActivated:JWe,onBeforeMount:E0,onBeforeUnmount:Ka,onBeforeUpdate:ZWe,onDeactivated:KWe,onErrorCaptured:VSe,onMounted:Fa,onRenderTracked:tqe,onRenderTriggered:eqe,onScopeDispose:$We,onServerPrefetch:QWe,onUnmounted:s7,onUpdated:n7,openBlock:qt,popScopeId:Fc,provide:HSe,proxyRefs:kSe,pushScopeId:Dc,queuePostFlushCb:$Se,reactive:Zl,readonly:PSe,ref:vi,registerRuntimeCompiler:fqe,render:VP,renderList:hu,renderSlot:Em,resolveComponent:Ko,resolveDirective:Nn,resolveDynamicComponent:xR,resolveFilter:OLt,resolveTransitionHooks:yB,setBlockTracking:o_e,setDevtoolsHook:HWe,setTransitionHooks:mk,shallowReactive:GWe,shallowReadonly:wkt,shallowRef:qae,ssrContextKey:mqe,ssrUtils:MLt,stop:ckt,toDisplayString:br,toHandlerKey:s9,toHandlers:Wkt,toRaw:Qs,toRef:LSe,toRefs:g8,toValue:Tkt,transformVNodeArgs:_Lt,triggerRef:Skt,unref:ri,useAttrs:tLt,useCssModule:DLt,useCssVars:FLt,useModel:iLt,useSSRContext:gqe,useSlots:eLt,useTransitionState:GSe,vModelCheckbox:JSe,vModelDynamic:bqe,vModelRadio:KSe,vModelSelect:ZSe,vModelText:LS,vShow:bf,version:vqe,warn:Ikt,watch:rl,watchEffect:Nkt,watchPostEffect:YWe,watchSyncEffect:$kt,withAsyncContext:aLt,withCtx:Rn,withDefaults:Qkt,withDirectives:Ur,withKeys:Ph,withMemo:ALt,withModifiers:ia,withScopeId:Dkt},Symbol.toStringTag,{value:"Module"}));function xqe(i){throw i}function JLt(i){}function Hd(i,e,t,r){const n=i,s=new SyntaxError(String(n));return s.code=i,s.loc=e,s}const yse=Symbol(""),Kie=Symbol(""),Sqe=Symbol(""),l_e=Symbol(""),KLt=Symbol(""),_B=Symbol(""),ZLt=Symbol(""),QLt=Symbol(""),Tqe=Symbol(""),Cqe=Symbol(""),Qae=Symbol(""),Eqe=Symbol(""),eNt=Symbol(""),Iqe=Symbol(""),u_e=Symbol(""),Aqe=Symbol(""),Mqe=Symbol(""),Oqe=Symbol(""),Pqe=Symbol(""),tNt=Symbol(""),iNt=Symbol(""),QSe=Symbol(""),c_e=Symbol(""),Rqe=Symbol(""),Dqe=Symbol(""),vse=Symbol(""),ele=Symbol(""),Fqe=Symbol(""),g$e=Symbol(""),ICr=Symbol(""),y$e=Symbol(""),h_e=Symbol(""),ACr=Symbol(""),MCr=Symbol(""),kqe=Symbol(""),OCr=Symbol(""),PCr=Symbol(""),Lqe=Symbol(""),rNt=Symbol(""),XW={[yse]:"Fragment",[Kie]:"Teleport",[Sqe]:"Suspense",[l_e]:"KeepAlive",[KLt]:"BaseTransition",[_B]:"openBlock",[ZLt]:"createBlock",[QLt]:"createElementBlock",[Tqe]:"createVNode",[Cqe]:"createElementVNode",[Qae]:"createCommentVNode",[Eqe]:"createTextVNode",[eNt]:"createStaticVNode",[Iqe]:"resolveComponent",[u_e]:"resolveDynamicComponent",[Aqe]:"resolveDirective",[Mqe]:"resolveFilter",[Oqe]:"withDirectives",[Pqe]:"renderList",[tNt]:"renderSlot",[iNt]:"createSlots",[QSe]:"toDisplayString",[c_e]:"mergeProps",[Rqe]:"normalizeClass",[Dqe]:"normalizeStyle",[vse]:"normalizeProps",[ele]:"guardReactiveProps",[Fqe]:"toHandlers",[g$e]:"camelize",[ICr]:"capitalize",[y$e]:"toHandlerKey",[h_e]:"setBlockTracking",[ACr]:"pushScopeId",[MCr]:"popScopeId",[kqe]:"withCtx",[OCr]:"unref",[PCr]:"isRef",[Lqe]:"withMemo",[rNt]:"isMemoSame"};function RCr(i){Object.getOwnPropertySymbols(i).forEach(e=>{XW[e]=i[e]})}const Xx={source:"",start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function DCr(i,e=Xx){return{type:0,children:i,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:e}}function _se(i,e,t,r,n,s,o,a=!1,l=!1,u=!1,c=Xx){return i&&(a?(i.helper(_B),i.helper(ZW(i.inSSR,u))):i.helper(KW(i.inSSR,u)),o&&i.helper(Oqe)),{type:13,tag:e,props:t,children:r,patchFlag:n,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:u,loc:c}}function tle(i,e=Xx){return{type:17,loc:e,elements:i}}function fS(i,e=Xx){return{type:15,loc:e,properties:i}}function Jp(i,e){return{type:16,loc:Xx,key:El(i)?Xl(i,!0):i,value:e}}function Xl(i,e=!1,t=Xx,r=0){return{type:4,loc:t,content:i,isStatic:e,constType:e?3:r}}function eE(i,e=Xx){return{type:8,loc:e,children:i}}function gm(i,e=[],t=Xx){return{type:14,loc:t,callee:i,arguments:e}}function JW(i,e=void 0,t=!1,r=!1,n=Xx){return{type:18,params:i,returns:e,newline:t,isSlot:r,loc:n}}function v$e(i,e,t,r=!0){return{type:19,test:i,consequent:e,alternate:t,newline:r,loc:Xx}}function FCr(i,e,t=!1){return{type:20,index:i,value:e,isVNode:t,loc:Xx}}function kCr(i){return{type:21,body:i,loc:Xx}}function KW(i,e){return i||e?Tqe:Cqe}function ZW(i,e){return i||e?ZLt:QLt}function Nqe(i,{helper:e,removeHelper:t,inSSR:r}){i.isBlock||(i.isBlock=!0,t(KW(r,i.isComponent)),e(_B),e(ZW(r,i.isComponent)))}const xb=i=>i.type===4&&i.isStatic,Wz=(i,e)=>i===e||i===lx(e);function nNt(i){if(Wz(i,"Teleport"))return Kie;if(Wz(i,"Suspense"))return Sqe;if(Wz(i,"KeepAlive"))return l_e;if(Wz(i,"BaseTransition"))return KLt}const LCr=/^\d|[^\$\w]/,$qe=i=>!LCr.test(i),NCr=/[A-Za-z_$\xA0-\uFFFF]/,$Cr=/[\.\?\w$\xA0-\uFFFF]/,BCr=/\s+[.[]\s*|\s*[.[]\s+/g,jCr=i=>{i=i.trim().replace(BCr,o=>o.trim());let e=0,t=[],r=0,n=0,s=null;for(let o=0;oe.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function YMe(i){return i.type===5||i.type===2}function UCr(i){return i.type===7&&i.name==="slot"}function f_e(i){return i.type===1&&i.tagType===3}function m_e(i){return i.type===1&&i.tagType===2}const zCr=new Set([vse,ele]);function aNt(i,e=[]){if(i&&!El(i)&&i.type===14){const t=i.callee;if(!El(t)&&zCr.has(t))return aNt(i.arguments[0],e.concat(i))}return[i,e]}function g_e(i,e,t){let r,n=i.type===13?i.props:i.arguments[2],s=[],o;if(n&&!El(n)&&n.type===14){const a=aNt(n);n=a[0],s=a[1],o=s[s.length-1]}if(n==null||El(n))r=fS([e]);else if(n.type===14){const a=n.arguments[0];!El(a)&&a.type===15?Zut(e,a)||a.properties.unshift(e):n.callee===Fqe?r=gm(t.helper(c_e),[fS([e]),n]):n.arguments.unshift(fS([e])),!r&&(r=n)}else n.type===15?(Zut(e,n)||n.properties.unshift(e),r=n):(r=gm(t.helper(c_e),[fS([e]),n]),o&&o.callee===ele&&(o=s[s.length-2]));i.type===13?o?o.arguments[0]=r:i.props=r:o?o.arguments[0]=r:i.arguments[2]=r}function Zut(i,e){let t=!1;if(i.key.type===4){const r=i.key.content;t=e.properties.some(n=>n.key.type===4&&n.key.content===r)}return t}function bse(i,e){return`_${e}_${i.replace(/[^\w]/g,(t,r)=>t==="-"?"_":i.charCodeAt(r).toString())}`}function VCr(i){return i.type===14&&i.callee===Lqe?i.arguments[1].returns:i}function Qut(i,e){const t=e.options?e.options.compatConfig:e.compatConfig,r=t&&t[i];return i==="MODE"?r||3:r}function l9(i,e){const t=Qut("MODE",e),r=Qut(i,e);return t===3?r===!0:r!==!1}function wse(i,e,t,...r){return l9(i,e)}const HCr=/&(gt|lt|amp|apos|quot);/g,WCr={gt:">",lt:"<",amp:"&",apos:"'",quot:'"'},ect={delimiters:["{{","}}"],getNamespace:()=>0,getTextMode:()=>0,isVoidTag:Sge,isPreTag:Sge,isCustomElement:Sge,decodeEntities:i=>i.replace(HCr,(e,t)=>WCr[t]),onError:xqe,onWarn:JLt,comments:!1};function qCr(i,e={}){const t=YCr(i,e),r=xx(t);return DCr(Bqe(t,0,[]),NS(t,r))}function YCr(i,e){const t=$u({},ect);let r;for(r in e)t[r]=e[r]===void 0?ect[r]:e[r];return{options:t,column:1,line:1,offset:0,originalSource:i,source:i,inPre:!1,inVPre:!1,onWarn:t.onWarn}}function Bqe(i,e,t){const r=tTe(t),n=r?r.ns:0,s=[];for(;!rEr(i,e,t);){const a=i.source;let l;if(e===0||e===1){if(!i.inVPre&&kv(a,i.options.delimiters[0]))l=tEr(i,e);else if(e===0&&a[0]==="<")if(a.length===1)rh(i,5,1);else if(a[1]==="!")kv(a,"=0;){const u=o[a];u&&u.type===9&&(l+=u.branches.length)}return()=>{if(s)r.codegenNode=oct(n,l,t);else{const u=IEr(r.codegenNode);u.alternate=oct(n,l+r.branches.length-1,t)}}}));function EEr(i,e,t,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const n=e.exp?e.exp.loc:i.loc;t.onError(Hd(28,e.loc)),e.exp=Xl("true",!1,n)}if(e.name==="if"){const n=sct(i,e),s={type:9,loc:i.loc,branches:[n]};if(t.replaceNode(s),r)return r(s,n,!0)}else{const n=t.parent.children;let s=n.indexOf(i);for(;s-->=-1;){const o=n[s];if(o&&o.type===3){t.removeNode(o);continue}if(o&&o.type===2&&!o.content.trim().length){t.removeNode(o);continue}if(o&&o.type===9){e.name==="else-if"&&o.branches[o.branches.length-1].condition===void 0&&t.onError(Hd(30,i.loc)),t.removeNode();const a=sct(i,e);o.branches.push(a);const l=r&&r(o,a,!1);iTe(a,t),l&&l(),t.currentNode=null}else t.onError(Hd(30,i.loc));break}}}function sct(i,e){const t=i.tagType===3;return{type:10,loc:i.loc,condition:e.name==="else"?void 0:e.exp,children:t&&!Q2(i,"for")?i.children:[i],userKey:eTe(i,"key"),isTemplateIf:t}}function oct(i,e,t){return i.condition?v$e(i.condition,act(i,e,t),gm(t.helper(Qae),['""',"true"])):act(i,e,t)}function act(i,e,t){const{helper:r}=t,n=Jp("key",Xl(`${e}`,!1,Xx,2)),{children:s}=i,o=s[0];if(s.length!==1||o.type!==1)if(s.length===1&&o.type===11){const l=o.codegenNode;return g_e(l,n,t),l}else return _se(t,r(yse),fS([n]),s,64+"",void 0,void 0,!0,!1,!1,i.loc);else{const l=o.codegenNode,u=VCr(l);return u.type===13&&Nqe(u,t),g_e(u,n,t),l}}function IEr(i){for(;;)if(i.type===19)if(i.alternate.type===19)i=i.alternate;else return i;else i.type===20&&(i=i.value)}const AEr=fNt("for",(i,e,t)=>{const{helper:r,removeHelper:n}=t;return MEr(i,e,t,s=>{const o=gm(r(Pqe),[s.source]),a=f_e(i),l=Q2(i,"memo"),u=eTe(i,"key"),c=u&&(u.type===6?Xl(u.value.content,!0):u.exp),h=u?Jp("key",c):null,p=s.source.type===4&&s.source.constType>0,m=p?64:u?128:256;return s.codegenNode=_se(t,r(yse),void 0,o,m+"",void 0,void 0,!0,!p,!1,i.loc),()=>{let v;const{children:w}=s,S=w.length!==1||w[0].type!==1,I=m_e(i)?i:a&&i.children.length===1&&m_e(i.children[0])?i.children[0]:null;if(I?(v=I.codegenNode,a&&h&&g_e(v,h,t)):S?v=_se(t,r(yse),h?fS([h]):void 0,i.children,"64",void 0,void 0,!0,void 0,!1):(v=w[0].codegenNode,a&&h&&g_e(v,h,t),v.isBlock!==!p&&(v.isBlock?(n(_B),n(ZW(t.inSSR,v.isComponent))):n(KW(t.inSSR,v.isComponent))),v.isBlock=!p,v.isBlock?(r(_B),r(ZW(t.inSSR,v.isComponent))):r(KW(t.inSSR,v.isComponent))),l){const R=JW(w$e(s.parseResult,[Xl("_cached")]));R.body=kCr([eE(["const _memo = (",l.exp,")"]),eE(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${t.helperString(rNt)}(_cached, _memo)) return _cached`]),eE(["const _item = ",v]),Xl("_item.memo = _memo"),Xl("return _item")]),o.arguments.push(R,Xl("_cache"),Xl(String(t.cached++)))}else o.arguments.push(JW(w$e(s.parseResult),v,!0))}})});function MEr(i,e,t,r){if(!e.exp){t.onError(Hd(31,e.loc));return}const n=vNt(e.exp);if(!n){t.onError(Hd(32,e.loc));return}const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=t,{source:l,value:u,key:c,index:h}=n,p={type:11,loc:e.loc,source:l,valueAlias:u,keyAlias:c,objectIndexAlias:h,parseResult:n,children:f_e(i)?i.children:[i]};t.replaceNode(p),a.vFor++;const m=r&&r(p);return()=>{a.vFor--,m&&m()}}const OEr=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,lct=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,PEr=/^\(|\)$/g;function vNt(i,e){const t=i.loc,r=i.content,n=r.match(OEr);if(!n)return;const[,s,o]=n,a={source:Yhe(t,o.trim(),r.indexOf(o,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(PEr,"").trim();const u=s.indexOf(l),c=l.match(lct);if(c){l=l.replace(lct,"").trim();const h=c[1].trim();let p;if(h&&(p=r.indexOf(h,u+l.length),a.key=Yhe(t,h,p)),c[2]){const m=c[2].trim();m&&(a.index=Yhe(t,m,r.indexOf(m,a.key?p+h.length:u+l.length)))}}return l&&(a.value=Yhe(t,l,u)),a}function Yhe(i,e,t){return Xl(e,!1,oNt(i,t,e.length))}function w$e({value:i,key:e,index:t},r=[]){return REr([i,e,t,...r])}function REr(i){let e=i.length;for(;e--&&!i[e];);return i.slice(0,e+1).map((t,r)=>t||Xl("_".repeat(r+1),!1))}const uct=Xl("undefined",!1),DEr=(i,e)=>{if(i.type===1&&(i.tagType===1||i.tagType===3)){const t=Q2(i,"slot");if(t)return t.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},FEr=(i,e,t)=>JW(i,e,!1,!0,e.length?e[0].loc:t);function kEr(i,e,t=FEr){e.helper(kqe);const{children:r,loc:n}=i,s=[],o=[];let a=e.scopes.vSlot>0||e.scopes.vFor>0;const l=Q2(i,"slot",!0);if(l){const{arg:S,exp:I}=l;S&&!xb(S)&&(a=!0),s.push(Jp(S||Xl("default",!0),t(I,r,n)))}let u=!1,c=!1;const h=[],p=new Set;let m=0;for(let S=0;S{const L=t(I,R,n);return e.compatConfig&&(L.isNonScopedSlot=!0),Jp("default",L)};u?h.length&&h.some(I=>_Nt(I))&&(c?e.onError(Hd(39,h[0].loc)):s.push(S(void 0,h))):s.push(S(void 0,r))}const v=a?2:Ige(i.children)?3:1;let w=fS(s.concat(Jp("_",Xl(v+"",!1))),n);return o.length&&(w=gm(e.helper(iNt),[w,tle(o)])),{slots:w,hasDynamicSlots:a}}function Xhe(i,e,t){const r=[Jp("name",i),Jp("fn",e)];return t!=null&&r.push(Jp("key",Xl(String(t),!0))),fS(r)}function Ige(i){for(let e=0;efunction(){if(i=e.currentNode,!(i.type===1&&(i.tagType===0||i.tagType===1)))return;const{tag:r,props:n}=i,s=i.tagType===1;let o=s?NEr(i,e):`"${r}"`;const a=ch(o)&&o.callee===u_e;let l,u,c,h=0,p,m,v,w=a||o===Kie||o===Sqe||!s&&(r==="svg"||r==="foreignObject");if(n.length>0){const S=wNt(i,e,void 0,s,a);l=S.props,h=S.patchFlag,m=S.dynamicPropNames;const I=S.directives;v=I&&I.length?tle(I.map(R=>BEr(R,e))):void 0,S.shouldUseBlock&&(w=!0)}if(i.children.length>0)if(o===l_e&&(w=!0,h|=1024),s&&o!==Kie&&o!==l_e){const{slots:I,hasDynamicSlots:R}=kEr(i,e);u=I,R&&(h|=1024)}else if(i.children.length===1&&o!==Kie){const I=i.children[0],R=I.type,L=R===5||R===8;L&&mS(I,e)===0&&(h|=1),L||R===2?u=I:u=i.children}else u=i.children;h!==0&&(c=String(h),m&&m.length&&(p=jEr(m))),i.codegenNode=_se(e,o,l,u,c,p,v,!!w,!1,s,i.loc)};function NEr(i,e,t=!1){let{tag:r}=i;const n=x$e(r),s=eTe(i,"is");if(s)if(n||l9("COMPILER_IS_ON_ELEMENT",e)){const l=s.type===6?s.value&&Xl(s.value.content,!0):s.exp;if(l)return gm(e.helper(u_e),[l])}else s.type===6&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const o=!n&&Q2(i,"is");if(o&&o.exp)return gm(e.helper(u_e),[o.exp]);const a=nNt(r)||e.isBuiltInComponent(r);return a?(t||e.helper(a),a):(e.helper(Iqe),e.components.add(r),bse(r,"component"))}function wNt(i,e,t=i.props,r,n,s=!1){const{tag:o,loc:a,children:l}=i;let u=[];const c=[],h=[],p=l.length>0;let m=!1,v=0,w=!1,S=!1,I=!1,R=!1,L=!1,k=!1;const B=[],$=K=>{u.length&&(c.push(fS(cct(u),a)),u=[]),K&&c.push(K)},V=({key:K,value:Q})=>{if(xb(K)){const re=K.content,ne=i7(re);if(ne&&(!r||n)&&re.toLowerCase()!=="onclick"&&re!=="onUpdate:modelValue"&&!n9(re)&&(R=!0),ne&&n9(re)&&(k=!0),Q.type===20||(Q.type===4||Q.type===8)&&mS(Q,e)>0)return;re==="ref"?w=!0:re==="class"?S=!0:re==="style"?I=!0:re!=="key"&&!B.includes(re)&&B.push(re),r&&(re==="class"||re==="style")&&!B.includes(re)&&B.push(re)}else L=!0};for(let K=0;K0&&u.push(Jp(Xl("ref_for",!0),Xl("true")))),ne==="is"&&(x$e(o)||de&&de.content.startsWith("vue:")||l9("COMPILER_IS_ON_ELEMENT",e)))continue;u.push(Jp(Xl(ne,!0,oNt(re,0,ne.length)),Xl(de?de.content:"",pe,de?de.loc:re)))}else{const{name:re,arg:ne,exp:de,loc:pe}=Q,H=re==="bind",Z=re==="on";if(re==="slot"){r||e.onError(Hd(40,pe));continue}if(re==="once"||re==="memo"||re==="is"||H&&v8(ne,"is")&&(x$e(o)||l9("COMPILER_IS_ON_ELEMENT",e))||Z&&s)continue;if((H&&v8(ne,"key")||Z&&p&&v8(ne,"vue:before-update"))&&(m=!0),H&&v8(ne,"ref")&&e.scopes.vFor>0&&u.push(Jp(Xl("ref_for",!0),Xl("true"))),!ne&&(H||Z)){if(L=!0,de)if(H){if($(),l9("COMPILER_V_BIND_OBJECT_ORDER",e)){c.unshift(de);continue}c.push(de)}else $({type:14,loc:pe,callee:e.helper(Fqe),arguments:r?[de]:[de,"true"]});else e.onError(Hd(H?34:35,pe));continue}const ae=e.directiveTransforms[re];if(ae){const{props:fe,needRuntime:be}=ae(Q,i,e);!s&&fe.forEach(V),Z&&ne&&!xb(ne)?$(fS(fe,a)):u.push(...fe),be&&(h.push(Q),hk(be)&&bNt.set(Q,be))}else oSr(re)||(h.push(Q),p&&(m=!0))}}let Y;if(c.length?($(),c.length>1?Y=gm(e.helper(c_e),c,a):Y=c[0]):u.length&&(Y=fS(cct(u),a)),L?v|=16:(S&&!r&&(v|=2),I&&!r&&(v|=4),B.length&&(v|=8),R&&(v|=32)),!m&&(v===0||v===32)&&(w||k||h.length>0)&&(v|=512),!e.inSSR&&Y)switch(Y.type){case 15:let K=-1,Q=-1,re=!1;for(let pe=0;peJp(o,s)),n))}return tle(t,i.loc)}function jEr(i){let e="[";for(let t=0,r=i.length;t{if(m_e(i)){const{children:t,loc:r}=i,{slotName:n,slotProps:s}=UEr(i,e),o=[e.prefixIdentifiers?"_ctx.$slots":"$slots",n,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),t.length&&(o[3]=JW([],t,!1,!1,r),a=4),e.scopeId&&!e.slotted&&(a=5),o.splice(a),i.codegenNode=gm(e.helper(tNt),o,r)}};function UEr(i,e){let t='"default"',r;const n=[];for(let s=0;s0){const{props:s,directives:o}=wNt(i,e,n,!1,!1);r=s,o.length&&e.onError(Hd(36,o[0].loc))}return{slotName:t,slotProps:r}}const zEr=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,xNt=(i,e,t,r)=>{const{loc:n,modifiers:s,arg:o}=i;!i.exp&&!s.length&&t.onError(Hd(35,n));let a;if(o.type===4)if(o.isStatic){let h=o.content;h.startsWith("vue:")&&(h=`vnode-${h.slice(4)}`);const p=e.tagType!==0||h.startsWith("vnode")||!/[A-Z]/.test(h)?s9(Pf(h)):`on:${h}`;a=Xl(p,!0,o.loc)}else a=eE([`${t.helperString(y$e)}(`,o,")"]);else a=o,a.children.unshift(`${t.helperString(y$e)}(`),a.children.push(")");let l=i.exp;l&&!l.content.trim()&&(l=void 0);let u=t.cacheHandlers&&!l&&!t.inVOnce;if(l){const h=sNt(l.content),p=!(h||zEr.test(l.content)),m=l.content.includes(";");(p||u&&h)&&(l=eE([`${p?"$event":"(...args)"} => ${m?"{":"("}`,l,m?"}":")"]))}let c={props:[Jp(a,l||Xl("() => {}",!1,n))]};return r&&(c=r(c)),u&&(c.props[0].value=t.cache(c.props[0].value)),c.props.forEach(h=>h.key.isHandlerKey=!0),c},VEr=(i,e,t)=>{const{exp:r,modifiers:n,loc:s}=i,o=i.arg;return o.type!==4?(o.children.unshift("("),o.children.push(') || ""')):o.isStatic||(o.content=`${o.content} || ""`),n.includes("camel")&&(o.type===4?o.isStatic?o.content=Pf(o.content):o.content=`${t.helperString(g$e)}(${o.content})`:(o.children.unshift(`${t.helperString(g$e)}(`),o.children.push(")"))),t.inSSR||(n.includes("prop")&&hct(o,"."),n.includes("attr")&&hct(o,"^")),!r||r.type===4&&!r.content.trim()?(t.onError(Hd(34,s)),{props:[Jp(o,Xl("",!0,s))]}):{props:[Jp(o,r)]}},hct=(i,e)=>{i.type===4?i.isStatic?i.content=e+i.content:i.content=`\`${e}\${${i.content}}\``:(i.children.unshift(`'${e}' + (`),i.children.push(")"))},HEr=(i,e)=>{if(i.type===0||i.type===1||i.type===11||i.type===10)return()=>{const t=i.children;let r,n=!1;for(let s=0;ss.type===7&&!e.directiveTransforms[s.name])&&i.tag!=="template")))for(let s=0;s{if(i.type===1&&Q2(i,"once",!0))return dct.has(i)||e.inVOnce||e.inSSR?void 0:(dct.add(i),e.inVOnce=!0,e.helper(h_e),()=>{e.inVOnce=!1;const t=e.currentNode;t.codegenNode&&(t.codegenNode=e.cache(t.codegenNode,!0))})},SNt=(i,e,t)=>{const{exp:r,arg:n}=i;if(!r)return t.onError(Hd(41,i.loc)),Jhe();const s=r.loc.source,o=r.type===4?r.content:s,a=t.bindingMetadata[s];if(a==="props"||a==="props-aliased")return t.onError(Hd(44,r.loc)),Jhe();if(!o.trim()||!sNt(o)&&!!1)return t.onError(Hd(42,r.loc)),Jhe();const u=n||Xl("modelValue",!0),c=n?xb(n)?`onUpdate:${Pf(n.content)}`:eE(['"onUpdate:" + ',n]):"onUpdate:modelValue";let h;const p=t.isTS?"($event: any)":"$event";h=eE([`${p} => ((`,r,") = $event)"]);const m=[Jp(u,i.exp),Jp(c,h)];if(i.modifiers.length&&e.tagType===1){const v=i.modifiers.map(S=>($qe(S)?S:JSON.stringify(S))+": true").join(", "),w=n?xb(n)?`${n.content}Modifiers`:eE([n,' + "Modifiers"']):"modelModifiers";m.push(Jp(w,Xl(`{ ${v} }`,!1,i.loc,2)))}return Jhe(m)};function Jhe(i=[]){return{props:i}}const qEr=/[\w).+\-_$\]]/,YEr=(i,e)=>{l9("COMPILER_FILTER",e)&&(i.type===5&&v_e(i.content,e),i.type===1&&i.props.forEach(t=>{t.type===7&&t.name!=="for"&&t.exp&&v_e(t.exp,e)}))};function v_e(i,e){if(i.type===4)pct(i,e);else for(let t=0;t=0&&(R=t.charAt(I),R===" ");I--);(!R||!qEr.test(R))&&(o=!0)}}v===void 0?v=t.slice(0,m).trim():c!==0&&S();function S(){w.push(t.slice(c,m).trim()),c=m+1}if(w.length){for(m=0;m{if(i.type===1){const t=Q2(i,"memo");return!t||fct.has(i)?void 0:(fct.add(i),()=>{const r=i.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(i.tagType!==1&&Nqe(r,e),i.codegenNode=gm(e.helper(Lqe),[t.exp,JW(void 0,r),"_cache",String(e.cached++)]))})}};function KEr(i){return[[WEr,CEr,JEr,AEr,YEr,GEr,LEr,DEr,HEr],{on:xNt,bind:VEr,model:SNt}]}function ZEr(i,e={}){const t=e.onError||xqe,r=e.mode==="module";e.prefixIdentifiers===!0?t(Hd(47)):r&&t(Hd(48));const n=!1;e.cacheHandlers&&t(Hd(49)),e.scopeId&&!r&&t(Hd(50));const s=El(i)?qCr(i,e):i,[o,a]=KEr();return aEr(s,$u({},e,{prefixIdentifiers:n,nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:$u({},a,e.directiveTransforms||{})})),cEr(s,$u({},e,{prefixIdentifiers:n}))}const QEr=()=>({props:[]}),TNt=Symbol(""),CNt=Symbol(""),ENt=Symbol(""),INt=Symbol(""),S$e=Symbol(""),ANt=Symbol(""),MNt=Symbol(""),ONt=Symbol(""),PNt=Symbol(""),RNt=Symbol("");RCr({[TNt]:"vModelRadio",[CNt]:"vModelCheckbox",[ENt]:"vModelText",[INt]:"vModelSelect",[S$e]:"vModelDynamic",[ANt]:"withModifiers",[MNt]:"withKeys",[ONt]:"vShow",[PNt]:"Transition",[RNt]:"TransitionGroup"});let wj;function eIr(i,e=!1){return wj||(wj=document.createElement("div")),e?(wj.innerHTML=`
`,wj.children[0].getAttribute("foo")):(wj.innerHTML=i,wj.textContent)}const tIr=qb("style,iframe,script,noscript",!0),iIr={isVoidTag:_Sr,isNativeTag:i=>ySr(i)||vSr(i),isPreTag:i=>i==="pre",decodeEntities:eIr,isBuiltInComponent:i=>{if(Wz(i,"Transition"))return PNt;if(Wz(i,"TransitionGroup"))return RNt},getNamespace(i,e){let t=e?e.ns:0;if(e&&t===2)if(e.tag==="annotation-xml"){if(i==="svg")return 1;e.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(t=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&i!=="mglyph"&&i!=="malignmark"&&(t=0);else e&&t===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(t=0);if(t===0){if(i==="svg")return 1;if(i==="math")return 2}return t},getTextMode({tag:i,ns:e}){if(e===0){if(i==="textarea"||i==="title")return 1;if(tIr(i))return 2}return 0}},rIr=i=>{i.type===1&&i.props.forEach((e,t)=>{e.type===6&&e.name==="style"&&e.value&&(i.props[t]={type:7,name:"bind",arg:Xl("style",!0,e.loc),exp:nIr(e.value.content,e.loc),modifiers:[],loc:e.loc})})},nIr=(i,e)=>{const t=ikt(i);return Xl(JSON.stringify(t),!1,e,3)};function MF(i,e){return Hd(i,e)}const sIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(53,n)),e.children.length&&(t.onError(MF(54,n)),e.children.length=0),{props:[Jp(Xl("innerHTML",!0,n),r||Xl("",!0))]}},oIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(55,n)),e.children.length&&(t.onError(MF(56,n)),e.children.length=0),{props:[Jp(Xl("textContent",!0),r?mS(r,t)>0?r:gm(t.helperString(QSe),[r],n):Xl("",!0))]}},aIr=(i,e,t)=>{const r=SNt(i,e,t);if(!r.props.length||e.tagType===1)return r;i.arg&&t.onError(MF(58,i.arg.loc));const{tag:n}=e,s=t.isCustomElement(n);if(n==="input"||n==="textarea"||n==="select"||s){let o=ENt,a=!1;if(n==="input"||s){const l=eTe(e,"type");if(l){if(l.type===7)o=S$e;else if(l.value)switch(l.value.content){case"radio":o=TNt;break;case"checkbox":o=CNt;break;case"file":a=!0,t.onError(MF(59,i.loc));break}}else GCr(e)&&(o=S$e)}else n==="select"&&(o=INt);a||(r.needRuntime=t.helper(o))}else t.onError(MF(57,i.loc));return r.props=r.props.filter(o=>!(o.key.type===4&&o.key.content==="modelValue")),r},lIr=qb("passive,once,capture"),uIr=qb("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),cIr=qb("left,right"),DNt=qb("onkeyup,onkeydown,onkeypress",!0),hIr=(i,e,t,r)=>{const n=[],s=[],o=[];for(let a=0;axb(i)&&i.content.toLowerCase()==="onclick"?Xl(e,!0):i.type!==4?eE(["(",i,`) === "onClick" ? "${e}" : (`,i,")"]):i,dIr=(i,e,t)=>xNt(i,e,t,r=>{const{modifiers:n}=i;if(!n.length)return r;let{key:s,value:o}=r.props[0];const{keyModifiers:a,nonKeyModifiers:l,eventOptionModifiers:u}=hIr(s,n,t,i.loc);if(l.includes("right")&&(s=mct(s,"onContextmenu")),l.includes("middle")&&(s=mct(s,"onMouseup")),l.length&&(o=gm(t.helper(ANt),[o,JSON.stringify(l)])),a.length&&(!xb(s)||DNt(s.content))&&(o=gm(t.helper(MNt),[o,JSON.stringify(a)])),u.length){const c=u.map(Zk).join("");s=xb(s)?Xl(`${s.content}${c}`,!0):eE(["(",s,`) + "${c}"`])}return{props:[Jp(s,o)]}}),pIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(61,n)),{props:[],needRuntime:t.helper(ONt)}},fIr=(i,e)=>{i.type===1&&i.tagType===0&&(i.tag==="script"||i.tag==="style")&&e.removeNode()},mIr=[rIr],gIr={cloak:QEr,html:sIr,text:oIr,model:aIr,on:dIr,show:pIr};function yIr(i,e={}){return ZEr(i,$u({},iIr,e,{nodeTransforms:[fIr,...mIr,...e.nodeTransforms||[]],directiveTransforms:$u({},gIr,e.directiveTransforms||{}),transformHoist:null}))}const gct=Object.create(null);function FNt(i,e){if(!El(i))if(i.nodeType)i=i.innerHTML;else return J1;const t=i,r=gct[t];if(r)return r;if(i[0]==="#"){const a=document.querySelector(i);i=a?a.innerHTML:""}const n=$u({hoistStatic:!0,onError:void 0,onWarn:J1},e);!n.isCustomElement&&typeof customElements<"u"&&(n.isCustomElement=a=>!!customElements.get(a));const{code:s}=yIr(i,n),o=new Function("Vue",s)(ECr);return o._rc=!0,gct[t]=o}fqe(FNt);const vIr=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:XWe,BaseTransitionPropsValidators:USe,Comment:d0,EffectScope:ESe,Fragment:Ks,KeepAlive:Gkt,ReactiveEffect:YY,Static:IF,Suspense:kkt,Teleport:cqe,Text:SR,Transition:eL,TransitionGroup:XSe,VueElement:Zae,assertNumber:Akt,callWithAsyncErrorHandling:Ob,callWithErrorHandling:YA,camelize:Pf,capitalize:Zk,cloneVNode:wE,compatUtils:PLt,compile:FNt,computed:Hr,createApp:YW,createBlock:Dn,createCommentVNode:Yr,createElementBlock:si,createElementVNode:Ot,createHydrationRenderer:lqe,createPropsRestProxy:oLt,createRenderer:aqe,createSSRApp:qLt,createSlots:Vkt,createStaticVNode:qSe,createTextVNode:Xs,createVNode:Vn,customRef:Ckt,defineAsyncComponent:fse,defineComponent:Xr,defineCustomElement:_qe,defineEmits:Ykt,defineExpose:Xkt,defineModel:Zkt,defineOptions:Jkt,defineProps:qkt,defineSSRCustomElement:RLt,defineSlots:Kkt,get devtools(){return F6},effect:ukt,effectScope:Wae,getCurrentInstance:Df,getCurrentScope:ISe,getTransitionRawChildren:Xae,guardReactiveProps:hqe,h:dx,handleError:Qk,hasInjectionContext:sqe,hydrate:wqe,initCustomFormatter:ILt,initDirectivesForSSR:XLt,inject:eo,isMemoSame:yqe,isProxy:DSe,isReactive:TS,isReadonly:fk,isRef:Wu,isRuntimeOnly:TLt,isShallow:HW,isVNode:_3,markRaw:Da,mergeDefaults:nLt,mergeModels:sLt,mergeProps:Kae,nextTick:Bv,normalizeClass:Wn,normalizeProps:rkt,normalizeStyle:s_,onActivated:JWe,onBeforeMount:E0,onBeforeUnmount:Ka,onBeforeUpdate:ZWe,onDeactivated:KWe,onErrorCaptured:VSe,onMounted:Fa,onRenderTracked:tqe,onRenderTriggered:eqe,onScopeDispose:$We,onServerPrefetch:QWe,onUnmounted:s7,onUpdated:n7,openBlock:qt,popScopeId:Fc,provide:HSe,proxyRefs:kSe,pushScopeId:Dc,queuePostFlushCb:$Se,reactive:Zl,readonly:PSe,ref:vi,registerRuntimeCompiler:fqe,render:VP,renderList:hu,renderSlot:Em,resolveComponent:Ko,resolveDirective:Nn,resolveDynamicComponent:xR,resolveFilter:OLt,resolveTransitionHooks:yB,setBlockTracking:o_e,setDevtoolsHook:HWe,setTransitionHooks:mk,shallowReactive:GWe,shallowReadonly:wkt,shallowRef:qae,ssrContextKey:mqe,ssrUtils:MLt,stop:ckt,toDisplayString:br,toHandlerKey:s9,toHandlers:Wkt,toRaw:Qs,toRef:LSe,toRefs:g8,toValue:Tkt,transformVNodeArgs:_Lt,triggerRef:Skt,unref:ri,useAttrs:tLt,useCssModule:DLt,useCssVars:FLt,useModel:iLt,useSSRContext:gqe,useSlots:eLt,useTransitionState:GSe,vModelCheckbox:JSe,vModelDynamic:bqe,vModelRadio:KSe,vModelSelect:ZSe,vModelText:LS,vShow:bf,version:vqe,warn:Ikt,watch:rl,watchEffect:Nkt,watchPostEffect:YWe,watchSyncEffect:$kt,withAsyncContext:aLt,withCtx:Rn,withDefaults:Qkt,withDirectives:Ur,withKeys:Ph,withMemo:ALt,withModifiers:ia,withScopeId:Dkt},Symbol.toStringTag,{value:"Module"}));var _Ir=!1;/*! +`)}uEr(i.hoists,e),s(),n("return ")}function XMe(i,e,{helper:t,push:r,newline:n,isTS:s}){const o=t(e==="filter"?Mqe:e==="component"?Iqe:Aqe);for(let a=0;a3||!1;e.push("["),t&&e.indent(),ile(i,e,t),t&&e.deindent(),e.push("]")}function ile(i,e,t=!1,r=!0){const{push:n,newline:s}=e;for(let o=0;ot||"null")}function gEr(i,e){const{push:t,helper:r,pure:n}=e,s=El(i.callee)?i.callee:r(i.callee);n&&t(rTe),t(s+"(",i),ile(i.arguments,e),t(")")}function yEr(i,e){const{push:t,indent:r,deindent:n,newline:s}=e,{properties:o}=i;if(!o.length){t("{}",i);return}const a=o.length>1||!1;t(a?"{":"{ "),a&&r();for(let l=0;l "),(l||a)&&(t("{"),r()),o?(l&&t("return "),Ms(o)?jqe(o,e):jv(o,e)):a&&jv(a,e),(l||a)&&(n(),t("}")),u&&(i.isNonScopedSlot&&t(", undefined, true"),t(")"))}function bEr(i,e){const{test:t,consequent:r,alternate:n,newline:s}=i,{push:o,indent:a,deindent:l,newline:u}=e;if(t.type===4){const h=!$qe(t.content);h&&o("("),gNt(t,e),h&&o(")")}else o("("),jv(t,e),o(")");s&&a(),e.indentLevel++,s||o(" "),o("? "),jv(r,e),e.indentLevel--,s&&u(),s||o(" "),o(": ");const c=n.type===19;c||e.indentLevel++,jv(n,e),c||e.indentLevel--,s&&l(!0)}function wEr(i,e){const{push:t,helper:r,indent:n,deindent:s,newline:o}=e;t(`_cache[${i.index}] || (`),i.isVNode&&(n(),t(`${r(h_e)}(-1),`),o()),t(`_cache[${i.index}] = `),jv(i.value,e),i.isVNode&&(t(","),o(),t(`${r(h_e)}(1),`),o(),t(`_cache[${i.index}]`),s()),t(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const xEr=fNt(/^(if|else|else-if)$/,(i,e,t)=>SEr(i,e,t,(r,n,s)=>{const o=t.parent.children;let a=o.indexOf(r),l=0;for(;a-->=0;){const u=o[a];u&&u.type===9&&(l+=u.branches.length)}return()=>{if(s)r.codegenNode=oct(n,l,t);else{const u=TEr(r.codegenNode);u.alternate=oct(n,l+r.branches.length-1,t)}}}));function SEr(i,e,t,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const n=e.exp?e.exp.loc:i.loc;t.onError(Hd(28,e.loc)),e.exp=Jl("true",!1,n)}if(e.name==="if"){const n=sct(i,e),s={type:9,loc:i.loc,branches:[n]};if(t.replaceNode(s),r)return r(s,n,!0)}else{const n=t.parent.children;let s=n.indexOf(i);for(;s-->=-1;){const o=n[s];if(o&&o.type===3){t.removeNode(o);continue}if(o&&o.type===2&&!o.content.trim().length){t.removeNode(o);continue}if(o&&o.type===9){e.name==="else-if"&&o.branches[o.branches.length-1].condition===void 0&&t.onError(Hd(30,i.loc)),t.removeNode();const a=sct(i,e);o.branches.push(a);const l=r&&r(o,a,!1);iTe(a,t),l&&l(),t.currentNode=null}else t.onError(Hd(30,i.loc));break}}}function sct(i,e){const t=i.tagType===3;return{type:10,loc:i.loc,condition:e.name==="else"?void 0:e.exp,children:t&&!Q2(i,"for")?i.children:[i],userKey:eTe(i,"key"),isTemplateIf:t}}function oct(i,e,t){return i.condition?v$e(i.condition,act(i,e,t),gm(t.helper(Qae),['""',"true"])):act(i,e,t)}function act(i,e,t){const{helper:r}=t,n=Jp("key",Jl(`${e}`,!1,Xx,2)),{children:s}=i,o=s[0];if(s.length!==1||o.type!==1)if(s.length===1&&o.type===11){const l=o.codegenNode;return g_e(l,n,t),l}else return _se(t,r(yse),fS([n]),s,64+"",void 0,void 0,!0,!1,!1,i.loc);else{const l=o.codegenNode,u=GCr(l);return u.type===13&&Nqe(u,t),g_e(u,n,t),l}}function TEr(i){for(;;)if(i.type===19)if(i.alternate.type===19)i=i.alternate;else return i;else i.type===20&&(i=i.value)}const CEr=fNt("for",(i,e,t)=>{const{helper:r,removeHelper:n}=t;return EEr(i,e,t,s=>{const o=gm(r(Pqe),[s.source]),a=f_e(i),l=Q2(i,"memo"),u=eTe(i,"key"),c=u&&(u.type===6?Jl(u.value.content,!0):u.exp),h=u?Jp("key",c):null,p=s.source.type===4&&s.source.constType>0,m=p?64:u?128:256;return s.codegenNode=_se(t,r(yse),void 0,o,m+"",void 0,void 0,!0,!p,!1,i.loc),()=>{let v;const{children:w}=s,S=w.length!==1||w[0].type!==1,I=m_e(i)?i:a&&i.children.length===1&&m_e(i.children[0])?i.children[0]:null;if(I?(v=I.codegenNode,a&&h&&g_e(v,h,t)):S?v=_se(t,r(yse),h?fS([h]):void 0,i.children,"64",void 0,void 0,!0,void 0,!1):(v=w[0].codegenNode,a&&h&&g_e(v,h,t),v.isBlock!==!p&&(v.isBlock?(n(_B),n(ZW(t.inSSR,v.isComponent))):n(KW(t.inSSR,v.isComponent))),v.isBlock=!p,v.isBlock?(r(_B),r(ZW(t.inSSR,v.isComponent))):r(KW(t.inSSR,v.isComponent))),l){const R=JW(w$e(s.parseResult,[Jl("_cached")]));R.body=RCr([eE(["const _memo = (",l.exp,")"]),eE(["if (_cached",...c?[" && _cached.key === ",c]:[],` && ${t.helperString(rNt)}(_cached, _memo)) return _cached`]),eE(["const _item = ",v]),Jl("_item.memo = _memo"),Jl("return _item")]),o.arguments.push(R,Jl("_cache"),Jl(String(t.cached++)))}else o.arguments.push(JW(w$e(s.parseResult),v,!0))}})});function EEr(i,e,t,r){if(!e.exp){t.onError(Hd(31,e.loc));return}const n=vNt(e.exp);if(!n){t.onError(Hd(32,e.loc));return}const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=t,{source:l,value:u,key:c,index:h}=n,p={type:11,loc:e.loc,source:l,valueAlias:u,keyAlias:c,objectIndexAlias:h,parseResult:n,children:f_e(i)?i.children:[i]};t.replaceNode(p),a.vFor++;const m=r&&r(p);return()=>{a.vFor--,m&&m()}}const IEr=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,lct=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,AEr=/^\(|\)$/g;function vNt(i,e){const t=i.loc,r=i.content,n=r.match(IEr);if(!n)return;const[,s,o]=n,a={source:Yhe(t,o.trim(),r.indexOf(o,s.length)),value:void 0,key:void 0,index:void 0};let l=s.trim().replace(AEr,"").trim();const u=s.indexOf(l),c=l.match(lct);if(c){l=l.replace(lct,"").trim();const h=c[1].trim();let p;if(h&&(p=r.indexOf(h,u+l.length),a.key=Yhe(t,h,p)),c[2]){const m=c[2].trim();m&&(a.index=Yhe(t,m,r.indexOf(m,a.key?p+h.length:u+l.length)))}}return l&&(a.value=Yhe(t,l,u)),a}function Yhe(i,e,t){return Jl(e,!1,oNt(i,t,e.length))}function w$e({value:i,key:e,index:t},r=[]){return MEr([i,e,t,...r])}function MEr(i){let e=i.length;for(;e--&&!i[e];);return i.slice(0,e+1).map((t,r)=>t||Jl("_".repeat(r+1),!1))}const uct=Jl("undefined",!1),OEr=(i,e)=>{if(i.type===1&&(i.tagType===1||i.tagType===3)){const t=Q2(i,"slot");if(t)return t.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},PEr=(i,e,t)=>JW(i,e,!1,!0,e.length?e[0].loc:t);function REr(i,e,t=PEr){e.helper(kqe);const{children:r,loc:n}=i,s=[],o=[];let a=e.scopes.vSlot>0||e.scopes.vFor>0;const l=Q2(i,"slot",!0);if(l){const{arg:S,exp:I}=l;S&&!xb(S)&&(a=!0),s.push(Jp(S||Jl("default",!0),t(I,r,n)))}let u=!1,c=!1;const h=[],p=new Set;let m=0;for(let S=0;S{const L=t(I,R,n);return e.compatConfig&&(L.isNonScopedSlot=!0),Jp("default",L)};u?h.length&&h.some(I=>_Nt(I))&&(c?e.onError(Hd(39,h[0].loc)):s.push(S(void 0,h))):s.push(S(void 0,r))}const v=a?2:Ige(i.children)?3:1;let w=fS(s.concat(Jp("_",Jl(v+"",!1))),n);return o.length&&(w=gm(e.helper(iNt),[w,tle(o)])),{slots:w,hasDynamicSlots:a}}function Xhe(i,e,t){const r=[Jp("name",i),Jp("fn",e)];return t!=null&&r.push(Jp("key",Jl(String(t),!0))),fS(r)}function Ige(i){for(let e=0;efunction(){if(i=e.currentNode,!(i.type===1&&(i.tagType===0||i.tagType===1)))return;const{tag:r,props:n}=i,s=i.tagType===1;let o=s?FEr(i,e):`"${r}"`;const a=ch(o)&&o.callee===u_e;let l,u,c,h=0,p,m,v,w=a||o===Kie||o===Sqe||!s&&(r==="svg"||r==="foreignObject");if(n.length>0){const S=wNt(i,e,void 0,s,a);l=S.props,h=S.patchFlag,m=S.dynamicPropNames;const I=S.directives;v=I&&I.length?tle(I.map(R=>LEr(R,e))):void 0,S.shouldUseBlock&&(w=!0)}if(i.children.length>0)if(o===l_e&&(w=!0,h|=1024),s&&o!==Kie&&o!==l_e){const{slots:I,hasDynamicSlots:R}=REr(i,e);u=I,R&&(h|=1024)}else if(i.children.length===1&&o!==Kie){const I=i.children[0],R=I.type,L=R===5||R===8;L&&mS(I,e)===0&&(h|=1),L||R===2?u=I:u=i.children}else u=i.children;h!==0&&(c=String(h),m&&m.length&&(p=NEr(m))),i.codegenNode=_se(e,o,l,u,c,p,v,!!w,!1,s,i.loc)};function FEr(i,e,t=!1){let{tag:r}=i;const n=x$e(r),s=eTe(i,"is");if(s)if(n||l9("COMPILER_IS_ON_ELEMENT",e)){const l=s.type===6?s.value&&Jl(s.value.content,!0):s.exp;if(l)return gm(e.helper(u_e),[l])}else s.type===6&&s.value.content.startsWith("vue:")&&(r=s.value.content.slice(4));const o=!n&&Q2(i,"is");if(o&&o.exp)return gm(e.helper(u_e),[o.exp]);const a=nNt(r)||e.isBuiltInComponent(r);return a?(t||e.helper(a),a):(e.helper(Iqe),e.components.add(r),bse(r,"component"))}function wNt(i,e,t=i.props,r,n,s=!1){const{tag:o,loc:a,children:l}=i;let u=[];const c=[],h=[],p=l.length>0;let m=!1,v=0,w=!1,S=!1,I=!1,R=!1,L=!1,k=!1;const B=[],$=K=>{u.length&&(c.push(fS(cct(u),a)),u=[]),K&&c.push(K)},V=({key:K,value:Q})=>{if(xb(K)){const re=K.content,ne=i7(re);if(ne&&(!r||n)&&re.toLowerCase()!=="onclick"&&re!=="onUpdate:modelValue"&&!n9(re)&&(R=!0),ne&&n9(re)&&(k=!0),Q.type===20||(Q.type===4||Q.type===8)&&mS(Q,e)>0)return;re==="ref"?w=!0:re==="class"?S=!0:re==="style"?I=!0:re!=="key"&&!B.includes(re)&&B.push(re),r&&(re==="class"||re==="style")&&!B.includes(re)&&B.push(re)}else L=!0};for(let K=0;K0&&u.push(Jp(Jl("ref_for",!0),Jl("true")))),ne==="is"&&(x$e(o)||de&&de.content.startsWith("vue:")||l9("COMPILER_IS_ON_ELEMENT",e)))continue;u.push(Jp(Jl(ne,!0,oNt(re,0,ne.length)),Jl(de?de.content:"",pe,de?de.loc:re)))}else{const{name:re,arg:ne,exp:de,loc:pe}=Q,H=re==="bind",Z=re==="on";if(re==="slot"){r||e.onError(Hd(40,pe));continue}if(re==="once"||re==="memo"||re==="is"||H&&v8(ne,"is")&&(x$e(o)||l9("COMPILER_IS_ON_ELEMENT",e))||Z&&s)continue;if((H&&v8(ne,"key")||Z&&p&&v8(ne,"vue:before-update"))&&(m=!0),H&&v8(ne,"ref")&&e.scopes.vFor>0&&u.push(Jp(Jl("ref_for",!0),Jl("true"))),!ne&&(H||Z)){if(L=!0,de)if(H){if($(),l9("COMPILER_V_BIND_OBJECT_ORDER",e)){c.unshift(de);continue}c.push(de)}else $({type:14,loc:pe,callee:e.helper(Fqe),arguments:r?[de]:[de,"true"]});else e.onError(Hd(H?34:35,pe));continue}const ae=e.directiveTransforms[re];if(ae){const{props:fe,needRuntime:be}=ae(Q,i,e);!s&&fe.forEach(V),Z&&ne&&!xb(ne)?$(fS(fe,a)):u.push(...fe),be&&(h.push(Q),hk(be)&&bNt.set(Q,be))}else rSr(re)||(h.push(Q),p&&(m=!0))}}let Y;if(c.length?($(),c.length>1?Y=gm(e.helper(c_e),c,a):Y=c[0]):u.length&&(Y=fS(cct(u),a)),L?v|=16:(S&&!r&&(v|=2),I&&!r&&(v|=4),B.length&&(v|=8),R&&(v|=32)),!m&&(v===0||v===32)&&(w||k||h.length>0)&&(v|=512),!e.inSSR&&Y)switch(Y.type){case 15:let K=-1,Q=-1,re=!1;for(let pe=0;peJp(o,s)),n))}return tle(t,i.loc)}function NEr(i){let e="[";for(let t=0,r=i.length;t{if(m_e(i)){const{children:t,loc:r}=i,{slotName:n,slotProps:s}=BEr(i,e),o=[e.prefixIdentifiers?"_ctx.$slots":"$slots",n,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),t.length&&(o[3]=JW([],t,!1,!1,r),a=4),e.scopeId&&!e.slotted&&(a=5),o.splice(a),i.codegenNode=gm(e.helper(tNt),o,r)}};function BEr(i,e){let t='"default"',r;const n=[];for(let s=0;s0){const{props:s,directives:o}=wNt(i,e,n,!1,!1);r=s,o.length&&e.onError(Hd(36,o[0].loc))}return{slotName:t,slotProps:r}}const jEr=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,xNt=(i,e,t,r)=>{const{loc:n,modifiers:s,arg:o}=i;!i.exp&&!s.length&&t.onError(Hd(35,n));let a;if(o.type===4)if(o.isStatic){let h=o.content;h.startsWith("vue:")&&(h=`vnode-${h.slice(4)}`);const p=e.tagType!==0||h.startsWith("vnode")||!/[A-Z]/.test(h)?s9(Pf(h)):`on:${h}`;a=Jl(p,!0,o.loc)}else a=eE([`${t.helperString(y$e)}(`,o,")"]);else a=o,a.children.unshift(`${t.helperString(y$e)}(`),a.children.push(")");let l=i.exp;l&&!l.content.trim()&&(l=void 0);let u=t.cacheHandlers&&!l&&!t.inVOnce;if(l){const h=sNt(l.content),p=!(h||jEr.test(l.content)),m=l.content.includes(";");(p||u&&h)&&(l=eE([`${p?"$event":"(...args)"} => ${m?"{":"("}`,l,m?"}":")"]))}let c={props:[Jp(a,l||Jl("() => {}",!1,n))]};return r&&(c=r(c)),u&&(c.props[0].value=t.cache(c.props[0].value)),c.props.forEach(h=>h.key.isHandlerKey=!0),c},GEr=(i,e,t)=>{const{exp:r,modifiers:n,loc:s}=i,o=i.arg;return o.type!==4?(o.children.unshift("("),o.children.push(') || ""')):o.isStatic||(o.content=`${o.content} || ""`),n.includes("camel")&&(o.type===4?o.isStatic?o.content=Pf(o.content):o.content=`${t.helperString(g$e)}(${o.content})`:(o.children.unshift(`${t.helperString(g$e)}(`),o.children.push(")"))),t.inSSR||(n.includes("prop")&&hct(o,"."),n.includes("attr")&&hct(o,"^")),!r||r.type===4&&!r.content.trim()?(t.onError(Hd(34,s)),{props:[Jp(o,Jl("",!0,s))]}):{props:[Jp(o,r)]}},hct=(i,e)=>{i.type===4?i.isStatic?i.content=e+i.content:i.content=`\`${e}\${${i.content}}\``:(i.children.unshift(`'${e}' + (`),i.children.push(")"))},UEr=(i,e)=>{if(i.type===0||i.type===1||i.type===11||i.type===10)return()=>{const t=i.children;let r,n=!1;for(let s=0;ss.type===7&&!e.directiveTransforms[s.name])&&i.tag!=="template")))for(let s=0;s{if(i.type===1&&Q2(i,"once",!0))return dct.has(i)||e.inVOnce||e.inSSR?void 0:(dct.add(i),e.inVOnce=!0,e.helper(h_e),()=>{e.inVOnce=!1;const t=e.currentNode;t.codegenNode&&(t.codegenNode=e.cache(t.codegenNode,!0))})},SNt=(i,e,t)=>{const{exp:r,arg:n}=i;if(!r)return t.onError(Hd(41,i.loc)),Jhe();const s=r.loc.source,o=r.type===4?r.content:s,a=t.bindingMetadata[s];if(a==="props"||a==="props-aliased")return t.onError(Hd(44,r.loc)),Jhe();if(!o.trim()||!sNt(o)&&!!1)return t.onError(Hd(42,r.loc)),Jhe();const u=n||Jl("modelValue",!0),c=n?xb(n)?`onUpdate:${Pf(n.content)}`:eE(['"onUpdate:" + ',n]):"onUpdate:modelValue";let h;const p=t.isTS?"($event: any)":"$event";h=eE([`${p} => ((`,r,") = $event)"]);const m=[Jp(u,i.exp),Jp(c,h)];if(i.modifiers.length&&e.tagType===1){const v=i.modifiers.map(S=>($qe(S)?S:JSON.stringify(S))+": true").join(", "),w=n?xb(n)?`${n.content}Modifiers`:eE([n,' + "Modifiers"']):"modelModifiers";m.push(Jp(w,Jl(`{ ${v} }`,!1,i.loc,2)))}return Jhe(m)};function Jhe(i=[]){return{props:i}}const VEr=/[\w).+\-_$\]]/,HEr=(i,e)=>{l9("COMPILER_FILTER",e)&&(i.type===5&&v_e(i.content,e),i.type===1&&i.props.forEach(t=>{t.type===7&&t.name!=="for"&&t.exp&&v_e(t.exp,e)}))};function v_e(i,e){if(i.type===4)pct(i,e);else for(let t=0;t=0&&(R=t.charAt(I),R===" ");I--);(!R||!VEr.test(R))&&(o=!0)}}v===void 0?v=t.slice(0,m).trim():c!==0&&S();function S(){w.push(t.slice(c,m).trim()),c=m+1}if(w.length){for(m=0;m{if(i.type===1){const t=Q2(i,"memo");return!t||fct.has(i)?void 0:(fct.add(i),()=>{const r=i.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(i.tagType!==1&&Nqe(r,e),i.codegenNode=gm(e.helper(Lqe),[t.exp,JW(void 0,r),"_cache",String(e.cached++)]))})}};function YEr(i){return[[zEr,xEr,qEr,CEr,HEr,$Er,DEr,OEr,UEr],{on:xNt,bind:GEr,model:SNt}]}function XEr(i,e={}){const t=e.onError||xqe,r=e.mode==="module";e.prefixIdentifiers===!0?t(Hd(47)):r&&t(Hd(48));const n=!1;e.cacheHandlers&&t(Hd(49)),e.scopeId&&!r&&t(Hd(50));const s=El(i)?VCr(i,e):i,[o,a]=YEr();return nEr(s,$u({},e,{prefixIdentifiers:n,nodeTransforms:[...o,...e.nodeTransforms||[]],directiveTransforms:$u({},a,e.directiveTransforms||{})})),aEr(s,$u({},e,{prefixIdentifiers:n}))}const JEr=()=>({props:[]}),TNt=Symbol(""),CNt=Symbol(""),ENt=Symbol(""),INt=Symbol(""),S$e=Symbol(""),ANt=Symbol(""),MNt=Symbol(""),ONt=Symbol(""),PNt=Symbol(""),RNt=Symbol("");MCr({[TNt]:"vModelRadio",[CNt]:"vModelCheckbox",[ENt]:"vModelText",[INt]:"vModelSelect",[S$e]:"vModelDynamic",[ANt]:"withModifiers",[MNt]:"withKeys",[ONt]:"vShow",[PNt]:"Transition",[RNt]:"TransitionGroup"});let wj;function KEr(i,e=!1){return wj||(wj=document.createElement("div")),e?(wj.innerHTML=`
`,wj.children[0].getAttribute("foo")):(wj.innerHTML=i,wj.textContent)}const ZEr=qb("style,iframe,script,noscript",!0),QEr={isVoidTag:gSr,isNativeTag:i=>fSr(i)||mSr(i),isPreTag:i=>i==="pre",decodeEntities:KEr,isBuiltInComponent:i=>{if(Wz(i,"Transition"))return PNt;if(Wz(i,"TransitionGroup"))return RNt},getNamespace(i,e){let t=e?e.ns:0;if(e&&t===2)if(e.tag==="annotation-xml"){if(i==="svg")return 1;e.props.some(r=>r.type===6&&r.name==="encoding"&&r.value!=null&&(r.value.content==="text/html"||r.value.content==="application/xhtml+xml"))&&(t=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&i!=="mglyph"&&i!=="malignmark"&&(t=0);else e&&t===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(t=0);if(t===0){if(i==="svg")return 1;if(i==="math")return 2}return t},getTextMode({tag:i,ns:e}){if(e===0){if(i==="textarea"||i==="title")return 1;if(ZEr(i))return 2}return 0}},eIr=i=>{i.type===1&&i.props.forEach((e,t)=>{e.type===6&&e.name==="style"&&e.value&&(i.props[t]={type:7,name:"bind",arg:Jl("style",!0,e.loc),exp:tIr(e.value.content,e.loc),modifiers:[],loc:e.loc})})},tIr=(i,e)=>{const t=ikt(i);return Jl(JSON.stringify(t),!1,e,3)};function MF(i,e){return Hd(i,e)}const iIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(53,n)),e.children.length&&(t.onError(MF(54,n)),e.children.length=0),{props:[Jp(Jl("innerHTML",!0,n),r||Jl("",!0))]}},rIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(55,n)),e.children.length&&(t.onError(MF(56,n)),e.children.length=0),{props:[Jp(Jl("textContent",!0),r?mS(r,t)>0?r:gm(t.helperString(QSe),[r],n):Jl("",!0))]}},nIr=(i,e,t)=>{const r=SNt(i,e,t);if(!r.props.length||e.tagType===1)return r;i.arg&&t.onError(MF(58,i.arg.loc));const{tag:n}=e,s=t.isCustomElement(n);if(n==="input"||n==="textarea"||n==="select"||s){let o=ENt,a=!1;if(n==="input"||s){const l=eTe(e,"type");if(l){if(l.type===7)o=S$e;else if(l.value)switch(l.value.content){case"radio":o=TNt;break;case"checkbox":o=CNt;break;case"file":a=!0,t.onError(MF(59,i.loc));break}}else $Cr(e)&&(o=S$e)}else n==="select"&&(o=INt);a||(r.needRuntime=t.helper(o))}else t.onError(MF(57,i.loc));return r.props=r.props.filter(o=>!(o.key.type===4&&o.key.content==="modelValue")),r},sIr=qb("passive,once,capture"),oIr=qb("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),aIr=qb("left,right"),DNt=qb("onkeyup,onkeydown,onkeypress",!0),lIr=(i,e,t,r)=>{const n=[],s=[],o=[];for(let a=0;axb(i)&&i.content.toLowerCase()==="onclick"?Jl(e,!0):i.type!==4?eE(["(",i,`) === "onClick" ? "${e}" : (`,i,")"]):i,uIr=(i,e,t)=>xNt(i,e,t,r=>{const{modifiers:n}=i;if(!n.length)return r;let{key:s,value:o}=r.props[0];const{keyModifiers:a,nonKeyModifiers:l,eventOptionModifiers:u}=lIr(s,n,t,i.loc);if(l.includes("right")&&(s=mct(s,"onContextmenu")),l.includes("middle")&&(s=mct(s,"onMouseup")),l.length&&(o=gm(t.helper(ANt),[o,JSON.stringify(l)])),a.length&&(!xb(s)||DNt(s.content))&&(o=gm(t.helper(MNt),[o,JSON.stringify(a)])),u.length){const c=u.map(Zk).join("");s=xb(s)?Jl(`${s.content}${c}`,!0):eE(["(",s,`) + "${c}"`])}return{props:[Jp(s,o)]}}),cIr=(i,e,t)=>{const{exp:r,loc:n}=i;return r||t.onError(MF(61,n)),{props:[],needRuntime:t.helper(ONt)}},hIr=(i,e)=>{i.type===1&&i.tagType===0&&(i.tag==="script"||i.tag==="style")&&e.removeNode()},dIr=[eIr],pIr={cloak:JEr,html:iIr,text:rIr,model:nIr,on:uIr,show:cIr};function fIr(i,e={}){return XEr(i,$u({},QEr,e,{nodeTransforms:[hIr,...dIr,...e.nodeTransforms||[]],directiveTransforms:$u({},pIr,e.directiveTransforms||{}),transformHoist:null}))}const gct=Object.create(null);function FNt(i,e){if(!El(i))if(i.nodeType)i=i.innerHTML;else return J1;const t=i,r=gct[t];if(r)return r;if(i[0]==="#"){const a=document.querySelector(i);i=a?a.innerHTML:""}const n=$u({hoistStatic:!0,onError:void 0,onWarn:J1},e);!n.isCustomElement&&typeof customElements<"u"&&(n.isCustomElement=a=>!!customElements.get(a));const{code:s}=fIr(i,n),o=new Function("Vue",s)(SCr);return o._rc=!0,gct[t]=o}fqe(FNt);const mIr=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:XWe,BaseTransitionPropsValidators:USe,Comment:d0,EffectScope:ESe,Fragment:Ks,KeepAlive:Gkt,ReactiveEffect:YY,Static:IF,Suspense:kkt,Teleport:cqe,Text:SR,Transition:eL,TransitionGroup:XSe,VueElement:Zae,assertNumber:Akt,callWithAsyncErrorHandling:Ob,callWithErrorHandling:YA,camelize:Pf,capitalize:Zk,cloneVNode:wE,compatUtils:PLt,compile:FNt,computed:Hr,createApp:YW,createBlock:Dn,createCommentVNode:Yr,createElementBlock:si,createElementVNode:Ot,createHydrationRenderer:lqe,createPropsRestProxy:oLt,createRenderer:aqe,createSSRApp:qLt,createSlots:Vkt,createStaticVNode:qSe,createTextVNode:Xs,createVNode:Vn,customRef:Ckt,defineAsyncComponent:fse,defineComponent:Xr,defineCustomElement:_qe,defineEmits:Ykt,defineExpose:Xkt,defineModel:Zkt,defineOptions:Jkt,defineProps:qkt,defineSSRCustomElement:RLt,defineSlots:Kkt,get devtools(){return F6},effect:ukt,effectScope:Wae,getCurrentInstance:Df,getCurrentScope:ISe,getTransitionRawChildren:Xae,guardReactiveProps:hqe,h:dx,handleError:Qk,hasInjectionContext:sqe,hydrate:wqe,initCustomFormatter:ILt,initDirectivesForSSR:XLt,inject:eo,isMemoSame:yqe,isProxy:DSe,isReactive:TS,isReadonly:fk,isRef:Wu,isRuntimeOnly:TLt,isShallow:HW,isVNode:_3,markRaw:Da,mergeDefaults:nLt,mergeModels:sLt,mergeProps:Kae,nextTick:Bv,normalizeClass:Wn,normalizeProps:rkt,normalizeStyle:s_,onActivated:JWe,onBeforeMount:E0,onBeforeUnmount:Ka,onBeforeUpdate:ZWe,onDeactivated:KWe,onErrorCaptured:VSe,onMounted:Fa,onRenderTracked:tqe,onRenderTriggered:eqe,onScopeDispose:$We,onServerPrefetch:QWe,onUnmounted:s7,onUpdated:n7,openBlock:qt,popScopeId:Fc,provide:HSe,proxyRefs:kSe,pushScopeId:Dc,queuePostFlushCb:$Se,reactive:Zl,readonly:PSe,ref:vi,registerRuntimeCompiler:fqe,render:VP,renderList:hu,renderSlot:Em,resolveComponent:Ko,resolveDirective:Nn,resolveDynamicComponent:xR,resolveFilter:OLt,resolveTransitionHooks:yB,setBlockTracking:o_e,setDevtoolsHook:HWe,setTransitionHooks:mk,shallowReactive:GWe,shallowReadonly:wkt,shallowRef:qae,ssrContextKey:mqe,ssrUtils:MLt,stop:ckt,toDisplayString:br,toHandlerKey:s9,toHandlers:Wkt,toRaw:Qs,toRef:LSe,toRefs:g8,toValue:Tkt,transformVNodeArgs:_Lt,triggerRef:Skt,unref:ri,useAttrs:tLt,useCssModule:DLt,useCssVars:FLt,useModel:iLt,useSSRContext:gqe,useSlots:eLt,useTransitionState:GSe,vModelCheckbox:JSe,vModelDynamic:bqe,vModelRadio:KSe,vModelSelect:ZSe,vModelText:LS,vShow:bf,version:vqe,warn:Ikt,watch:rl,watchEffect:Nkt,watchPostEffect:YWe,watchSyncEffect:$kt,withAsyncContext:aLt,withCtx:Rn,withDefaults:Qkt,withDirectives:Ur,withKeys:Ph,withMemo:ALt,withModifiers:ia,withScopeId:Dkt},Symbol.toStringTag,{value:"Module"}));var gIr=!1;/*! * pinia v2.1.7 * (c) 2023 Eduardo San Martin Morote * @license MIT - */let kNt;const nTe=i=>kNt=i,LNt=Symbol();function T$e(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}var Qie;(function(i){i.direct="direct",i.patchObject="patch object",i.patchFunction="patch function"})(Qie||(Qie={}));function bIr(){const i=Wae(!0),e=i.run(()=>vi({}));let t=[],r=[];const n=Da({install(s){nTe(n),n._a=s,s.provide(LNt,n),s.config.globalProperties.$pinia=n,r.forEach(o=>t.push(o)),r=[]},use(s){return!this._a&&!_Ir?r.push(s):t.push(s),this},_p:t,_a:null,_e:i,_s:new Map,state:e});return n}const NNt=()=>{};function yct(i,e,t,r=NNt){i.push(e);const n=()=>{const s=i.indexOf(e);s>-1&&(i.splice(s,1),r())};return!t&&ISe()&&$We(n),n}function xj(i,...e){i.slice().forEach(t=>{t(...e)})}const wIr=i=>i();function C$e(i,e){i instanceof Map&&e instanceof Map&&e.forEach((t,r)=>i.set(r,t)),i instanceof Set&&e instanceof Set&&e.forEach(i.add,i);for(const t in e){if(!e.hasOwnProperty(t))continue;const r=e[t],n=i[t];T$e(n)&&T$e(r)&&i.hasOwnProperty(t)&&!Wu(r)&&!TS(r)?i[t]=C$e(n,r):i[t]=r}return i}const xIr=Symbol();function SIr(i){return!T$e(i)||!i.hasOwnProperty(xIr)}const{assign:k4}=Object;function TIr(i){return!!(Wu(i)&&i.effect)}function CIr(i,e,t,r){const{state:n,actions:s,getters:o}=e,a=t.state.value[i];let l;function u(){a||(t.state.value[i]=n?n():{});const c=g8(t.state.value[i]);return k4(c,s,Object.keys(o||{}).reduce((h,p)=>(h[p]=Da(Hr(()=>{nTe(t);const m=t._s.get(i);return o[p].call(m,m)})),h),{}))}return l=$Nt(i,u,e,t,r,!0),l}function $Nt(i,e,t={},r,n,s){let o;const a=k4({actions:{}},t),l={deep:!0};let u,c,h=[],p=[],m;const v=r.state.value[i];!s&&!v&&(r.state.value[i]={}),vi({});let w;function S(Y){let K;u=c=!1,typeof Y=="function"?(Y(r.state.value[i]),K={type:Qie.patchFunction,storeId:i,events:m}):(C$e(r.state.value[i],Y),K={type:Qie.patchObject,payload:Y,storeId:i,events:m});const Q=w=Symbol();Bv().then(()=>{w===Q&&(u=!0)}),c=!0,xj(h,K,r.state.value[i])}const I=s?function(){const{state:K}=t,Q=K?K():{};this.$patch(re=>{k4(re,Q)})}:NNt;function R(){o.stop(),h=[],p=[],r._s.delete(i)}function L(Y,K){return function(){nTe(r);const Q=Array.from(arguments),re=[],ne=[];function de(Z){re.push(Z)}function pe(Z){ne.push(Z)}xj(p,{args:Q,name:Y,store:B,after:de,onError:pe});let H;try{H=K.apply(this&&this.$id===i?this:B,Q)}catch(Z){throw xj(ne,Z),Z}return H instanceof Promise?H.then(Z=>(xj(re,Z),Z)).catch(Z=>(xj(ne,Z),Promise.reject(Z))):(xj(re,H),H)}}const k={_p:r,$id:i,$onAction:yct.bind(null,p),$patch:S,$reset:I,$subscribe(Y,K={}){const Q=yct(h,Y,K.detached,()=>re()),re=o.run(()=>rl(()=>r.state.value[i],ne=>{(K.flush==="sync"?c:u)&&Y({storeId:i,type:Qie.direct,events:m},ne)},k4({},l,K)));return Q},$dispose:R},B=Zl(k);r._s.set(i,B);const V=(r._a&&r._a.runWithContext||wIr)(()=>r._e.run(()=>(o=Wae()).run(e)));for(const Y in V){const K=V[Y];if(Wu(K)&&!TIr(K)||TS(K))s||(v&&SIr(K)&&(Wu(K)?K.value=v[Y]:C$e(K,v[Y])),r.state.value[i][Y]=K);else if(typeof K=="function"){const Q=L(Y,K);V[Y]=Q,a.actions[Y]=K}}return k4(B,V),k4(Qs(B),V),Object.defineProperty(B,"$state",{get:()=>r.state.value[i],set:Y=>{S(K=>{k4(K,Y)})}}),r._p.forEach(Y=>{k4(B,o.run(()=>Y({store:B,app:r._a,pinia:r,options:a})))}),v&&s&&t.hydrate&&t.hydrate(B.$state,v),u=!0,c=!0,B}function xp(i,e,t){let r,n;const s=typeof e=="function";typeof i=="string"?(r=i,n=s?t:e):(n=i,r=i.id);function o(a,l){const u=sqe();return a=a||(u?eo(LNt,null):null),a&&nTe(a),a=kNt,a._s.has(r)||(s?$Nt(r,e,n,a):CIr(r,n,a)),a._s.get(r)}return o.$id=r,o}const dy=xp("appbar",()=>{const i=vi({}),e=vi([]),t=vi([]),r=Hr(()=>e.value.map(o=>o.map(a=>i.value[a]).filter(a=>{if(typeof a=="string"||a.componentId)return!0})).filter(o=>o.length>0));function n(o){t.value.includes(o)||t.value.push(o)}function s(o){const a=t.value.indexOf(o);a!==-1&&t.value.splice(a,1),o in i.value&&delete i.value[o],e.value.forEach(l=>{const u=l.indexOf(o);u!==-1&&l.splice(u,1)})}return{items:i,order:e,temporary:t,visible:r,addTempButton:n,removeButton:s}}),bB=xp("grid",()=>{const i=vi({}),e=vi(),t=vi();function r(a){i.value={...i.value,[a.id]:a}}function n(a){i.value[a]!==void 0&&delete i.value[a]}function s(a){return Object.keys(i.value).find(l=>i.value[l].layerIds.includes(a))}function o(a,l){i.value[a].layerIds=i.value[a].layerIds.filter(u=>u!==l)}return{grids:i,panel:e,currentId:t,addGrid:r,removeGrid:n,getGridId:s,removeLayer:o}});function _P(i,e,t,r){var n,s=!1,o=0;function a(){n&&clearTimeout(n)}function l(){a(),s=!0}typeof e!="boolean"&&(r=t,t=e,e=void 0);function u(){for(var c=arguments.length,h=new Array(c),p=0;pi?w():e!==!0&&(n=setTimeout(r?S:w,r===void 0?i-v:i))}return u.cancel=l,u}function xE(i,e,t){return t===void 0?_P(i,e,!1):_P(i,t,e!==!1)}const oF=xp("map-caption",()=>{const i=vi({text:{},logo:{}}),e=vi({}),t=vi({}),r=vi({});function n(o){o!==void 0?e.value.isImperialScale=o:e.value.isImperialScale=!e.value.isImperialScale}function s(o){i.value.text.value=o.text.value,i.value.text.disabled=o.text.disabled,i.value.logo.altText=o.logo.altText,i.value.logo.link=o.logo.link,i.value.logo.value=o.logo.value,i.value.logo.disabled=o.logo.disabled}return{attribution:i,scale:e,coords:t,langtoggle:r,toggleScale:n,setAttribution:s}}),JMe=(i,e)=>{const t=[...i];for(;t.length>0;){const r=t.shift();if(e(r))return r;r&&t.push(...r.sublayers)}},H1=xp("layer",()=>{const i=vi([]),e=vi([]),t=vi([]);function r(h){return JMe(i.value,p=>p?.uid===h)}function n(h){return JMe(i.value,p=>p?.id===h)}function s(h){return JMe(i.value,p=>p!==void 0&&(p.id===h||p.uid===h))}function o(h){e.value=[...e.value,h]}function a(h,p=void 0){i.value=[...i.value,h],h.mapLayer&&((p===void 0||p<0)&&(console.error("Map layer added to store with invalid index!"),p=t.value.length),t.value.splice(p,0,h.id),t.value=[...t.value])}function l(h,p){if(!h.mapLayer){console.error("Data layer passed to layer store reorder");return}if(p<0){console.error("Negative index passed to layer store reorder");return}p>=t.value.length&&(p=t.value.length-1);const m=t.value.findIndex(v=>v===h.id);m!==-1&&m!==p&&(t.value.splice(m,1),t.value.splice(p,0,h.id),t.value=[...t.value])}function u(h){const p=i.value.filter(m=>m.id!==h.id||m.uid!==h.uid);if(i.value=p,h.mapLayer){const m=t.value.filter(v=>v!==h.id);t.value=m}}function c(h){const p=e.value.filter(m=>m.id!==h);e.value=p}return{layers:i,mapOrder:t,layerConfigs:e,getLayerByUid:r,getLayerById:n,getLayerByAny:s,addLayerConfig:o,addLayer:a,reorderLayer:l,removeLayer:u,removeLayerConfig:c}}),bm=xp("config",()=>{const i=vi({map:{lodSets:[],extentSets:[],tileSchemas:[],basemaps:[],initialBasemapId:""},fixtures:{},layers:[]}),e=vi([]),t=vi(),r=vi({}),n=vi({});function s(l){if(r.value[n.value[l]]===void 0)throw new Error("Unsupported language or no registered config exists for requested language");return r.value[n.value[l]]}function o(l){const u={...i.value,...l};if(i.value=u,Array.isArray(i.value.layers)){const c=H1();c.layerConfigs=[...c.layerConfigs,i.value.layers]}}function a(l){const u=l.configLangs,c=l.config,h=l.allLangs;u!==void 0&&u.length>0&&u.forEach(p=>{r.value[p]=c,n.value[p]=p}),h!==void 0&&h.length>0&&h.forEach(p=>{n.value[p]=Object.keys(r.value)[0]})}return{config:i,startingFixtures:e,activeBasemapConfig:t,registeredConfigs:r,registeredLangs:n,getActiveConfig:s,newConfig:o,registerConfig:a}});class EIr{id;name;template;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:""}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields}=t)}}const tL=xp("details",()=>{const i=vi([]),e=vi({}),t=vi({}),r=vi(),n=vi(!1),s=vi(0),o=vi(0),a=vi(!0),l=vi();function u(h){const p=i.value.findIndex(m=>m.uid===h.uid);p!==-1&&i.value.splice(p,1)}function c(h){e.value={...e.value,[h.id]:h}}return{payload:i,properties:e,defaultTemplates:t,currentFeatureId:r,slowLoadingFlag:n,activeGreedy:s,lastHilight:o,hilightToggle:a,origin:l,removeLayer:u,addConfigProperty:c}}),oA=xp("fixture",()=>{const i=vi({}),e=vi({});function t(o){return o.map(a=>e.value[a].getPromise())}function r(o){if(i.value={...i.value,[o.id]:Da(o)},o.id in e.value)e.value[o.id].resolveMe();else{const a=new Af;a.resolveMe(),e.value={...e.value,[o.id]:a}}typeof o.added=="function"&&o.added()}function n(o){delete i.value[o.id],i.value={...i.value},delete e.value[o.id],e.value={...e.value},typeof o.removed=="function"&&o.removed()}function s(o){e.value={...e.value,[o]:new Af}}return{items:i,loadPromises:e,getLoadPromises:t,addFixture:r,removeFixture:n,addLoadPromise:s}});var ln=(i=>(i.APPBAR_BUTTON_CLICK="appbar/click",i.COMPONENT="ramp/component",i.CONFIG_CHANGE="config/configchanged",i.DETAILS_TOGGLE="details/toggle",i.FILTER_CHANGE="filter/change",i.FIXTURE_ADDED="fixture/added",i.FIXTURE_REMOVED="fixture/removed",i.GRID_TOGGLE="grid/toggle",i.HELP_TOGGLE="help/toggle",i.LAYER_DRAWSTATECHANGE="layer/drawstatechange",i.LAYER_INITIATIONSTATECHANGE="layer/initiationStatechange",i.LAYER_LAYERSTATECHANGE="layer/layerstatechange",i.LAYER_OPACITYCHANGE="layer/opacitychange",i.LAYER_REGISTERED="layer/registered",i.LAYER_RELOAD_END="layer/reloadend",i.LAYER_RELOAD_START="layer/reloadstart",i.LAYER_REMOVE="layer/remove",i.LAYER_VISIBILITYCHANGE="layer/visibilitychange",i.MAP_BASEMAPCHANGE="map/basemapchanged",i.MAP_BLUR="map/blur",i.MAP_CLICK="map/click",i.MAP_CREATED="map/created",i.MAP_DESTROYED="map/destroyed",i.MAP_DOUBLECLICK="map/doubleclick",i.MAP_EXTENTCHANGE="map/extentchanged",i.MAP_FOCUS="map/focus",i.MAP_GRAPHICHIT="map/graphichit",i.MAP_IDENTIFY="map/identify",i.MAP_KEYDOWN="map/keydown",i.MAP_KEYUP="map/keyup",i.MAP_MOUSEDOWN="map/mousedown",i.MAP_MOUSELEAVE="map/mouseleave",i.MAP_MOUSEMOVE="map/mousemove",i.MAP_MOUSEMOVE_END="map/mousemoveend",i.MAP_MOUSEMOVE_START="map/mousemovestart",i.MAP_REFRESH_END="map/refreshend",i.MAP_REFRESH_START="map/refreshstart",i.MAP_REORDER="map/reorder",i.MAP_RESIZED="map/resized",i.MAP_SCALECHANGE="map/scalechanged",i.MAP_START="map/start",i.METADATA_TOGGLE="metadata/toggle",i.PANEL_CLOSED="panel/closed",i.PANEL_MINIMIZED="panel/minimized",i.PANEL_OPENED="panel/opened",i.RAMP_MOBILEVIEW_CHANGE="ramp/mobileviewchange",i.REORDER_TOGGLE="reorder/toggle",i.SETTINGS_TOGGLE="settings/toggle",i.USER_LAYER_ADDED="user/layeradded",i.WIZARD_TOGGLE="wizard/toggle",i))(ln||{});class IIr{eventName;handlerName;handlerFunc;constructor(e,t,r){this.eventName=e,this.handlerName=t,this.handlerFunc=r}}class AIr extends tf{_eventBus;_eventRegister;_nameRegister;_funCounter;constructor(e){super(e),this._eventBus=new tSr,this._eventRegister=[],this._funCounter=1,this._nameRegister=Object.values(ln).filter(t=>typeof t=="string"&&t.indexOf("/")>-1)}findHandler(e){return this._eventRegister.find(t=>t.handlerName===e)}handlerNamer(e){return this._funCounter++,e.replace(/\//g,"_")+this._funCounter.toString()}registerEventName(e){(Array.isArray(e)?e:[e]).forEach(r=>{this._nameRegister.indexOf(r)===-1&&this._nameRegister.push(r)})}eventNames(){return this._nameRegister.slice()}on(e,t,r=""){if(this.findHandler(r))throw new Error("Duplicate handler name registration: "+r);r||(r=this.handlerNamer(e));const n=new IIr(e,r,t);return this._eventRegister.push(n),this._eventBus.on(e,t),r}off(e){const t=this.findHandler(e);t&&(this._eventRegister.splice(this._eventRegister.indexOf(t),1),this._eventBus.off(t.eventName,t.handlerFunc))}offAll(e=""){this.activeHandlers(e).forEach(r=>this.off(r))}emit(e,...t){this._eventBus.emit(e,...t)}once(e,t,r=""){r||(r=this.handlerNamer(e));const n=(...s)=>{t(...s),this.off(r)};return this.on(e,n,r)}activeHandlers(e=""){return e===""?this._eventRegister.map(t=>t.handlerName):this._eventRegister.filter(t=>t.eventName===e).map(t=>t.handlerName)}addDefaultEvents(e){return(!Array.isArray(e)||e.length===0)&&(e=["ramp_config_change_updates_map_attribs","ramp_layer_error_updates_legend","ramp_layer_register_binds_legend","ramp_layer_reload_end_binds_legend","ramp_layer_reload_start_updates_legend","ramp_layer_remove_updates_details","ramp_layer_remove_checks_grid","ramp_layer_remove_updates_legend","ramp_layer_useradd_updates_legend","ramp_map_basemap_checks_tile_proj","ramp_map_basemap_updates_map_attribs","ramp_map_blur_updates_key_handler","ramp_map_click_runs_identify","ramp_map_created_initializes_fixtures","ramp_map_created_updates_map_attribs","ramp_map_extent_updates_maptip","ramp_map_graphichit_creates_maptip","ramp_map_identify_opens_identify_results","ramp_map_keydown_updates_coords","ramp_map_keydown_updates_key_handler","ramp_map_keyup_updates_key_handler","ramp_map_mouse_updates_coords","ramp_map_mouse_updates_maptip","ramp_map_mouseleave_removes_maptip","ramp_map_resize_updates_scalebar","ramp_map_scale_updates_scalebar","ramp_panel_close_updates_appbar","ramp_panel_open_updates_appbar","ramp_toggle_details","ramp_toggle_grid","ramp_toggle_help","ramp_toggle_metadata","ramp_toggle_reorder","ramp_toggle_settings","ramp_toggle_wizard"]),e.map(t=>this.defaultHandlerFactory(t))}defaultHandlerFactory(e){let t;switch(e){case"ramp_config_change_updates_map_attribs":t=r=>{const n=r.map.basemaps.find(s=>s.id===this.$iApi.geo.map.getCurrentBasemapId());this.$iApi.geo.map.caption.updateAttribution(n?.attribution)},this.$iApi.event.on("config/configchanged",t,e);break;case"ramp_layer_error_updates_legend":t=r=>{if(r.layer.layerState===Ud.ERROR){const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r.layer)}},this.$iApi.event.on("layer/layerstatechange",t,e);break;case"ramp_layer_register_binds_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/registered",t,e);break;case"ramp_layer_reload_end_binds_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/reloadend",t,e);break;case"ramp_layer_reload_start_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.reloadLayerItem(r.uid)},this.$iApi.event.on("layer/reloadstart",t,e);break;case"ramp_layer_remove_checks_grid":t=r=>{if(this.$iApi.fixture.get("grid")){const n=bB(this.$vApp.$pinia),s=n.getGridId(r.id);if(s===void 0)return;if(n.removeLayer(s,r.id),n.grids[s].layerIds.length===0){n.removeGrid(s);const o=n.currentId;if(s===o){const a=this.$iApi.panel.get("grid");this.$iApi.panel.close(a),n.currentId=void 0}}}},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_remove_updates_details":t=r=>{const n=tL(this.$vApp.$pinia);this.$iApi.fixture.get("details")&&n.removeLayer(r)},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_remove_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&(n.removeLayerItem(r),this.$iApi.updateAlert(this.$iApi.$i18n.t("legend.alert.layerRemoved",{name:r.name})))},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_useradd_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.addLayerItem(r)},this.$iApi.event.on("user/layeradded",t,e);break;case"ramp_map_basemap_checks_tile_proj":t=()=>{this.$iApi.geo.layer.allLayers().filter(r=>r.layerType===pn.TILE).forEach(r=>{r.checkProj()})},this.$iApi.event.on("map/basemapchanged",t,e);break;case"ramp_map_basemap_updates_map_attribs":t=()=>{this.$iApi.geo.map.caption.updateAttribution(bm(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.event.on("map/basemapchanged",t,e);break;case"ramp_map_blur_updates_key_handler":t=()=>{this.$iApi.geo.map.stopKeyPan()},this.$iApi.event.on("map/blur",t,e);break;case"ramp_map_click_runs_identify":t=r=>{r.button===0&&this.$iApi.geo.map.runIdentify(r)},this.on("map/click",t,e);break;case"ramp_map_created_initializes_fixtures":t=()=>{const r=oA(this.$vApp.$pinia).items;Object.keys(r).forEach(n=>{r[n].initialized?.()})},this.$iApi.geo.map.created&&t(),this.$iApi.event.on("map/created",t,e);break;case"ramp_map_created_updates_map_attribs":t=()=>{this.$iApi.geo.map.caption.updateAttribution(bm(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.geo.map.created&&t(),this.$iApi.event.on("map/created",t,e);break;case"ramp_map_extent_updates_maptip":t=()=>{if(this.$iApi.geo.map.keysActive){const r=this.$iApi.geo.map.mapPointToScreenPoint(this.$iApi.geo.map.getExtent().center());this.$iApi.geo.map.maptip.checkAtCoord(r)}else this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/extentchanged",_P(50,!0,()=>t()),e);break;case"ramp_map_graphichit_creates_maptip":t=r=>{this.$iApi.geo.map.maptip.generateDefaultMaptip(r)},this.$iApi.event.on("map/graphichit",t,e);break;case"ramp_map_identify_opens_identify_results":t=r=>{const n=this.$iApi.fixture.get("details");n&&n.openDetails(r.results)},this.on("map/identify",t,e);break;case"ramp_map_keydown_updates_coords":this.$iApi.event.on("map/keydown",_P(50,()=>{const r=oF(this.$vApp.$pinia);r.coords?.disabled||!this.$iApi.geo.map.keysActive||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.getExtent().center()).then(s=>{r.coords={formattedString:s}})}),e);break;case"ramp_map_keydown_updates_key_handler":t=r=>{this.$iApi.geo.map.mapKeyDown(r)},this.$iApi.event.on("map/keydown",t,e);break;case"ramp_map_keyup_updates_key_handler":t=r=>{this.$iApi.geo.map.mapKeyUp(r)},this.$iApi.event.on("map/keyup",t,e);break;case"ramp_map_mouse_updates_coords":this.$iApi.event.on("map/mousemove",_P(50,r=>{const n=oF(this.$vApp.$pinia);n.coords?.disabled||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.screenPointToMapPoint(r)).then(o=>{n.coords={formattedString:o}})}),e);break;case"ramp_map_mouse_updates_maptip":t=r=>{this.$iApi.geo.map.maptip.checkAtCoord({screenX:r.screenX,screenY:r.screenY})},this.$iApi.event.on("map/mousemove",_P(50,r=>t(r)),e);break;case"ramp_map_mouseleave_removes_maptip":t=()=>{this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/mouseleave",t);break;case"ramp_map_resize_updates_scalebar":this.$iApi.event.on("map/resized",xE(100,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_map_scale_updates_scalebar":this.$iApi.event.on("map/scalechanged",xE(300,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_panel_close_updates_appbar":t=r=>{const n=dy(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!n.order.flat().find(s=>s===r.id)&&n.removeButton(r.id)},this.on("panel/closed",t,e);break;case"ramp_panel_open_updates_appbar":t=r=>{const n=dy(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&(!r.teleport||r.teleport?.showAppbarButton)&&!n.order.flat().find(s=>s===r.id)&&n.addTempButton(r.id)},this.on("panel/opened",t,e);break;case"ramp_toggle_details":t=(r,n)=>{const s=this.$iApi.fixture.get("details");s&&s.toggleFeature(r,n)},this.$iApi.event.on("details/toggle",t,e);break;case"ramp_toggle_grid":t=(r,n)=>{const s=this.$iApi.fixture.get("grid");s&&s.toggleGrid(r.id,n)},this.$iApi.event.on("grid/toggle",t,e);break;case"ramp_toggle_help":t=r=>{const n=this.$iApi.fixture.get("help");n&&n.toggleHelp(r)},this.$iApi.event.on("help/toggle",t,e);break;case"ramp_toggle_metadata":t=(r,n)=>{const s=this.$iApi.fixture.get("metadata");s&&s.toggleMetadata(r,n)},this.$iApi.event.on("metadata/toggle",t,e);break;case"ramp_toggle_reorder":t=r=>{const n=this.$iApi.fixture.get("layer-reorder");n&&n.toggleLayerReorder(r)},this.$iApi.event.on("reorder/toggle",t,e);break;case"ramp_toggle_settings":t=(r,n)=>{const s=this.$iApi.fixture.get("settings");s&&s.toggleSettings(r,n)},this.$iApi.event.on("settings/toggle",t,e);break;case"ramp_toggle_wizard":t=r=>{const n=this.$iApi.fixture.get("wizard");n&&n.toggleWizard(r)},this.$iApi.event.on("wizard/toggle",t,e);break;default:return console.error(`Unrecognized default event handler name encountered: ${e}`),`ERROR_NOT_REGISTERED__${e}`}return e}}/*! + */let kNt;const nTe=i=>kNt=i,LNt=Symbol();function T$e(i){return i&&typeof i=="object"&&Object.prototype.toString.call(i)==="[object Object]"&&typeof i.toJSON!="function"}var Qie;(function(i){i.direct="direct",i.patchObject="patch object",i.patchFunction="patch function"})(Qie||(Qie={}));function yIr(){const i=Wae(!0),e=i.run(()=>vi({}));let t=[],r=[];const n=Da({install(s){nTe(n),n._a=s,s.provide(LNt,n),s.config.globalProperties.$pinia=n,r.forEach(o=>t.push(o)),r=[]},use(s){return!this._a&&!gIr?r.push(s):t.push(s),this},_p:t,_a:null,_e:i,_s:new Map,state:e});return n}const NNt=()=>{};function yct(i,e,t,r=NNt){i.push(e);const n=()=>{const s=i.indexOf(e);s>-1&&(i.splice(s,1),r())};return!t&&ISe()&&$We(n),n}function xj(i,...e){i.slice().forEach(t=>{t(...e)})}const vIr=i=>i();function C$e(i,e){i instanceof Map&&e instanceof Map&&e.forEach((t,r)=>i.set(r,t)),i instanceof Set&&e instanceof Set&&e.forEach(i.add,i);for(const t in e){if(!e.hasOwnProperty(t))continue;const r=e[t],n=i[t];T$e(n)&&T$e(r)&&i.hasOwnProperty(t)&&!Wu(r)&&!TS(r)?i[t]=C$e(n,r):i[t]=r}return i}const _Ir=Symbol();function bIr(i){return!T$e(i)||!i.hasOwnProperty(_Ir)}const{assign:k4}=Object;function wIr(i){return!!(Wu(i)&&i.effect)}function xIr(i,e,t,r){const{state:n,actions:s,getters:o}=e,a=t.state.value[i];let l;function u(){a||(t.state.value[i]=n?n():{});const c=g8(t.state.value[i]);return k4(c,s,Object.keys(o||{}).reduce((h,p)=>(h[p]=Da(Hr(()=>{nTe(t);const m=t._s.get(i);return o[p].call(m,m)})),h),{}))}return l=$Nt(i,u,e,t,r,!0),l}function $Nt(i,e,t={},r,n,s){let o;const a=k4({actions:{}},t),l={deep:!0};let u,c,h=[],p=[],m;const v=r.state.value[i];!s&&!v&&(r.state.value[i]={}),vi({});let w;function S(Y){let K;u=c=!1,typeof Y=="function"?(Y(r.state.value[i]),K={type:Qie.patchFunction,storeId:i,events:m}):(C$e(r.state.value[i],Y),K={type:Qie.patchObject,payload:Y,storeId:i,events:m});const Q=w=Symbol();Bv().then(()=>{w===Q&&(u=!0)}),c=!0,xj(h,K,r.state.value[i])}const I=s?function(){const{state:K}=t,Q=K?K():{};this.$patch(re=>{k4(re,Q)})}:NNt;function R(){o.stop(),h=[],p=[],r._s.delete(i)}function L(Y,K){return function(){nTe(r);const Q=Array.from(arguments),re=[],ne=[];function de(Z){re.push(Z)}function pe(Z){ne.push(Z)}xj(p,{args:Q,name:Y,store:B,after:de,onError:pe});let H;try{H=K.apply(this&&this.$id===i?this:B,Q)}catch(Z){throw xj(ne,Z),Z}return H instanceof Promise?H.then(Z=>(xj(re,Z),Z)).catch(Z=>(xj(ne,Z),Promise.reject(Z))):(xj(re,H),H)}}const k={_p:r,$id:i,$onAction:yct.bind(null,p),$patch:S,$reset:I,$subscribe(Y,K={}){const Q=yct(h,Y,K.detached,()=>re()),re=o.run(()=>rl(()=>r.state.value[i],ne=>{(K.flush==="sync"?c:u)&&Y({storeId:i,type:Qie.direct,events:m},ne)},k4({},l,K)));return Q},$dispose:R},B=Zl(k);r._s.set(i,B);const V=(r._a&&r._a.runWithContext||vIr)(()=>r._e.run(()=>(o=Wae()).run(e)));for(const Y in V){const K=V[Y];if(Wu(K)&&!wIr(K)||TS(K))s||(v&&bIr(K)&&(Wu(K)?K.value=v[Y]:C$e(K,v[Y])),r.state.value[i][Y]=K);else if(typeof K=="function"){const Q=L(Y,K);V[Y]=Q,a.actions[Y]=K}}return k4(B,V),k4(Qs(B),V),Object.defineProperty(B,"$state",{get:()=>r.state.value[i],set:Y=>{S(K=>{k4(K,Y)})}}),r._p.forEach(Y=>{k4(B,o.run(()=>Y({store:B,app:r._a,pinia:r,options:a})))}),v&&s&&t.hydrate&&t.hydrate(B.$state,v),u=!0,c=!0,B}function xp(i,e,t){let r,n;const s=typeof e=="function";typeof i=="string"?(r=i,n=s?t:e):(n=i,r=i.id);function o(a,l){const u=sqe();return a=a||(u?eo(LNt,null):null),a&&nTe(a),a=kNt,a._s.has(r)||(s?$Nt(r,e,n,a):xIr(r,n,a)),a._s.get(r)}return o.$id=r,o}const dy=xp("appbar",()=>{const i=vi({}),e=vi([]),t=vi([]),r=Hr(()=>e.value.map(o=>o.map(a=>i.value[a]).filter(a=>{if(typeof a=="string"||a.componentId)return!0})).filter(o=>o.length>0));function n(o){t.value.includes(o)||t.value.push(o)}function s(o){const a=t.value.indexOf(o);a!==-1&&t.value.splice(a,1),o in i.value&&delete i.value[o],e.value.forEach(l=>{const u=l.indexOf(o);u!==-1&&l.splice(u,1)})}return{items:i,order:e,temporary:t,visible:r,addTempButton:n,removeButton:s}}),bB=xp("grid",()=>{const i=vi({}),e=vi(),t=vi();function r(a){i.value={...i.value,[a.id]:a}}function n(a){i.value[a]!==void 0&&delete i.value[a]}function s(a){return Object.keys(i.value).find(l=>i.value[l].layerIds.includes(a))}function o(a,l){i.value[a].layerIds=i.value[a].layerIds.filter(u=>u!==l)}return{grids:i,panel:e,currentId:t,addGrid:r,removeGrid:n,getGridId:s,removeLayer:o}});function _P(i,e,t,r){var n,s=!1,o=0;function a(){n&&clearTimeout(n)}function l(){a(),s=!0}typeof e!="boolean"&&(r=t,t=e,e=void 0);function u(){for(var c=arguments.length,h=new Array(c),p=0;pi?w():e!==!0&&(n=setTimeout(r?S:w,r===void 0?i-v:i))}return u.cancel=l,u}function xE(i,e,t){return t===void 0?_P(i,e,!1):_P(i,t,e!==!1)}const oF=xp("map-caption",()=>{const i=vi({text:{},logo:{}}),e=vi({}),t=vi({}),r=vi({});function n(o){o!==void 0?e.value.isImperialScale=o:e.value.isImperialScale=!e.value.isImperialScale}function s(o){i.value.text.value=o.text.value,i.value.text.disabled=o.text.disabled,i.value.logo.altText=o.logo.altText,i.value.logo.link=o.logo.link,i.value.logo.value=o.logo.value,i.value.logo.disabled=o.logo.disabled}return{attribution:i,scale:e,coords:t,langtoggle:r,toggleScale:n,setAttribution:s}}),JMe=(i,e)=>{const t=[...i];for(;t.length>0;){const r=t.shift();if(e(r))return r;r&&t.push(...r.sublayers)}},H1=xp("layer",()=>{const i=vi([]),e=vi([]),t=vi([]);function r(h){return JMe(i.value,p=>p?.uid===h)}function n(h){return JMe(i.value,p=>p?.id===h)}function s(h){return JMe(i.value,p=>p!==void 0&&(p.id===h||p.uid===h))}function o(h){e.value=[...e.value,h]}function a(h,p=void 0){i.value=[...i.value,h],h.mapLayer&&((p===void 0||p<0)&&(console.error("Map layer added to store with invalid index!"),p=t.value.length),t.value.splice(p,0,h.id),t.value=[...t.value])}function l(h,p){if(!h.mapLayer){console.error("Data layer passed to layer store reorder");return}if(p<0){console.error("Negative index passed to layer store reorder");return}p>=t.value.length&&(p=t.value.length-1);const m=t.value.findIndex(v=>v===h.id);m!==-1&&m!==p&&(t.value.splice(m,1),t.value.splice(p,0,h.id),t.value=[...t.value])}function u(h){const p=i.value.filter(m=>m.id!==h.id||m.uid!==h.uid);if(i.value=p,h.mapLayer){const m=t.value.filter(v=>v!==h.id);t.value=m}}function c(h){const p=e.value.filter(m=>m.id!==h);e.value=p}return{layers:i,mapOrder:t,layerConfigs:e,getLayerByUid:r,getLayerById:n,getLayerByAny:s,addLayerConfig:o,addLayer:a,reorderLayer:l,removeLayer:u,removeLayerConfig:c}}),bm=xp("config",()=>{const i=vi({map:{lodSets:[],extentSets:[],tileSchemas:[],basemaps:[],initialBasemapId:""},fixtures:{},layers:[]}),e=vi([]),t=vi(),r=vi({}),n=vi({});function s(l){if(r.value[n.value[l]]===void 0)throw new Error("Unsupported language or no registered config exists for requested language");return r.value[n.value[l]]}function o(l){const u={...i.value,...l};if(i.value=u,Array.isArray(i.value.layers)){const c=H1();c.layerConfigs=[...c.layerConfigs,i.value.layers]}}function a(l){const u=l.configLangs,c=l.config,h=l.allLangs;u!==void 0&&u.length>0&&u.forEach(p=>{r.value[p]=c,n.value[p]=p}),h!==void 0&&h.length>0&&h.forEach(p=>{n.value[p]=Object.keys(r.value)[0]})}return{config:i,startingFixtures:e,activeBasemapConfig:t,registeredConfigs:r,registeredLangs:n,getActiveConfig:s,newConfig:o,registerConfig:a}});class SIr{id;name;template;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:""}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields}=t)}}const tL=xp("details",()=>{const i=vi([]),e=vi({}),t=vi({}),r=vi(),n=vi(!1),s=vi(0),o=vi(0),a=vi(!0),l=vi();function u(h){const p=i.value.findIndex(m=>m.uid===h.uid);p!==-1&&i.value.splice(p,1)}function c(h){e.value={...e.value,[h.id]:h}}return{payload:i,properties:e,defaultTemplates:t,currentFeatureId:r,slowLoadingFlag:n,activeGreedy:s,lastHilight:o,hilightToggle:a,origin:l,removeLayer:u,addConfigProperty:c}}),oA=xp("fixture",()=>{const i=vi({}),e=vi({});function t(o){return o.map(a=>e.value[a].getPromise())}function r(o){if(i.value={...i.value,[o.id]:Da(o)},o.id in e.value)e.value[o.id].resolveMe();else{const a=new Af;a.resolveMe(),e.value={...e.value,[o.id]:a}}typeof o.added=="function"&&o.added()}function n(o){delete i.value[o.id],i.value={...i.value},delete e.value[o.id],e.value={...e.value},typeof o.removed=="function"&&o.removed()}function s(o){e.value={...e.value,[o]:new Af}}return{items:i,loadPromises:e,getLoadPromises:t,addFixture:r,removeFixture:n,addLoadPromise:s}});var ln=(i=>(i.APPBAR_BUTTON_CLICK="appbar/click",i.COMPONENT="ramp/component",i.CONFIG_CHANGE="config/configchanged",i.DETAILS_TOGGLE="details/toggle",i.FILTER_CHANGE="filter/change",i.FIXTURE_ADDED="fixture/added",i.FIXTURE_REMOVED="fixture/removed",i.GRID_TOGGLE="grid/toggle",i.HELP_TOGGLE="help/toggle",i.LAYER_DRAWSTATECHANGE="layer/drawstatechange",i.LAYER_INITIATIONSTATECHANGE="layer/initiationStatechange",i.LAYER_LAYERSTATECHANGE="layer/layerstatechange",i.LAYER_OPACITYCHANGE="layer/opacitychange",i.LAYER_REGISTERED="layer/registered",i.LAYER_RELOAD_END="layer/reloadend",i.LAYER_RELOAD_START="layer/reloadstart",i.LAYER_REMOVE="layer/remove",i.LAYER_VISIBILITYCHANGE="layer/visibilitychange",i.MAP_BASEMAPCHANGE="map/basemapchanged",i.MAP_BLUR="map/blur",i.MAP_CLICK="map/click",i.MAP_CREATED="map/created",i.MAP_DESTROYED="map/destroyed",i.MAP_DOUBLECLICK="map/doubleclick",i.MAP_EXTENTCHANGE="map/extentchanged",i.MAP_FOCUS="map/focus",i.MAP_GRAPHICHIT="map/graphichit",i.MAP_IDENTIFY="map/identify",i.MAP_KEYDOWN="map/keydown",i.MAP_KEYUP="map/keyup",i.MAP_MOUSEDOWN="map/mousedown",i.MAP_MOUSELEAVE="map/mouseleave",i.MAP_MOUSEMOVE="map/mousemove",i.MAP_MOUSEMOVE_END="map/mousemoveend",i.MAP_MOUSEMOVE_START="map/mousemovestart",i.MAP_REFRESH_END="map/refreshend",i.MAP_REFRESH_START="map/refreshstart",i.MAP_REORDER="map/reorder",i.MAP_RESIZED="map/resized",i.MAP_SCALECHANGE="map/scalechanged",i.MAP_START="map/start",i.METADATA_TOGGLE="metadata/toggle",i.PANEL_CLOSED="panel/closed",i.PANEL_MINIMIZED="panel/minimized",i.PANEL_OPENED="panel/opened",i.RAMP_MOBILEVIEW_CHANGE="ramp/mobileviewchange",i.REORDER_TOGGLE="reorder/toggle",i.SETTINGS_TOGGLE="settings/toggle",i.USER_LAYER_ADDED="user/layeradded",i.WIZARD_TOGGLE="wizard/toggle",i))(ln||{});class TIr{eventName;handlerName;handlerFunc;constructor(e,t,r){this.eventName=e,this.handlerName=t,this.handlerFunc=r}}class CIr extends tf{_eventBus;_eventRegister;_nameRegister;_funCounter;constructor(e){super(e),this._eventBus=new Z2r,this._eventRegister=[],this._funCounter=1,this._nameRegister=Object.values(ln).filter(t=>typeof t=="string"&&t.indexOf("/")>-1)}findHandler(e){return this._eventRegister.find(t=>t.handlerName===e)}handlerNamer(e){return this._funCounter++,e.replace(/\//g,"_")+this._funCounter.toString()}registerEventName(e){(Array.isArray(e)?e:[e]).forEach(r=>{this._nameRegister.indexOf(r)===-1&&this._nameRegister.push(r)})}eventNames(){return this._nameRegister.slice()}on(e,t,r=""){if(this.findHandler(r))throw new Error("Duplicate handler name registration: "+r);r||(r=this.handlerNamer(e));const n=new TIr(e,r,t);return this._eventRegister.push(n),this._eventBus.on(e,t),r}off(e){const t=this.findHandler(e);t&&(this._eventRegister.splice(this._eventRegister.indexOf(t),1),this._eventBus.off(t.eventName,t.handlerFunc))}offAll(e=""){this.activeHandlers(e).forEach(r=>this.off(r))}emit(e,...t){this._eventBus.emit(e,...t)}once(e,t,r=""){r||(r=this.handlerNamer(e));const n=(...s)=>{t(...s),this.off(r)};return this.on(e,n,r)}activeHandlers(e=""){return e===""?this._eventRegister.map(t=>t.handlerName):this._eventRegister.filter(t=>t.eventName===e).map(t=>t.handlerName)}addDefaultEvents(e){return(!Array.isArray(e)||e.length===0)&&(e=["ramp_config_change_updates_map_attribs","ramp_layer_error_updates_legend","ramp_layer_register_binds_legend","ramp_layer_reload_end_binds_legend","ramp_layer_reload_start_updates_legend","ramp_layer_remove_updates_details","ramp_layer_remove_checks_grid","ramp_layer_remove_updates_legend","ramp_layer_useradd_updates_legend","ramp_map_basemap_checks_tile_proj","ramp_map_basemap_updates_map_attribs","ramp_map_blur_updates_key_handler","ramp_map_click_runs_identify","ramp_map_created_initializes_fixtures","ramp_map_created_updates_map_attribs","ramp_map_extent_updates_maptip","ramp_map_graphichit_creates_maptip","ramp_map_identify_opens_identify_results","ramp_map_keydown_updates_coords","ramp_map_keydown_updates_key_handler","ramp_map_keyup_updates_key_handler","ramp_map_mouse_updates_coords","ramp_map_mouse_updates_maptip","ramp_map_mouseleave_removes_maptip","ramp_map_resize_updates_scalebar","ramp_map_scale_updates_scalebar","ramp_panel_close_updates_appbar","ramp_panel_open_updates_appbar","ramp_toggle_details","ramp_toggle_grid","ramp_toggle_help","ramp_toggle_metadata","ramp_toggle_reorder","ramp_toggle_settings","ramp_toggle_wizard"]),e.map(t=>this.defaultHandlerFactory(t))}defaultHandlerFactory(e){let t;switch(e){case"ramp_config_change_updates_map_attribs":t=r=>{const n=r.map.basemaps.find(s=>s.id===this.$iApi.geo.map.getCurrentBasemapId());this.$iApi.geo.map.caption.updateAttribution(n?.attribution)},this.$iApi.event.on("config/configchanged",t,e);break;case"ramp_layer_error_updates_legend":t=r=>{if(r.layer.layerState===Ud.ERROR){const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r.layer)}},this.$iApi.event.on("layer/layerstatechange",t,e);break;case"ramp_layer_register_binds_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/registered",t,e);break;case"ramp_layer_reload_end_binds_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.updateLegend(r)},this.$iApi.event.on("layer/reloadend",t,e);break;case"ramp_layer_reload_start_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.reloadLayerItem(r.uid)},this.$iApi.event.on("layer/reloadstart",t,e);break;case"ramp_layer_remove_checks_grid":t=r=>{if(this.$iApi.fixture.get("grid")){const n=bB(this.$vApp.$pinia),s=n.getGridId(r.id);if(s===void 0)return;if(n.removeLayer(s,r.id),n.grids[s].layerIds.length===0){n.removeGrid(s);const o=n.currentId;if(s===o){const a=this.$iApi.panel.get("grid");this.$iApi.panel.close(a),n.currentId=void 0}}}},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_remove_updates_details":t=r=>{const n=tL(this.$vApp.$pinia);this.$iApi.fixture.get("details")&&n.removeLayer(r)},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_remove_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&(n.removeLayerItem(r),this.$iApi.updateAlert(this.$iApi.$i18n.t("legend.alert.layerRemoved",{name:r.name})))},this.$iApi.event.on("layer/remove",t,e);break;case"ramp_layer_useradd_updates_legend":t=r=>{const n=this.$iApi.fixture.get("legend");n&&n.addLayerItem(r)},this.$iApi.event.on("user/layeradded",t,e);break;case"ramp_map_basemap_checks_tile_proj":t=()=>{this.$iApi.geo.layer.allLayers().filter(r=>r.layerType===pn.TILE).forEach(r=>{r.checkProj()})},this.$iApi.event.on("map/basemapchanged",t,e);break;case"ramp_map_basemap_updates_map_attribs":t=()=>{this.$iApi.geo.map.caption.updateAttribution(bm(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.event.on("map/basemapchanged",t,e);break;case"ramp_map_blur_updates_key_handler":t=()=>{this.$iApi.geo.map.stopKeyPan()},this.$iApi.event.on("map/blur",t,e);break;case"ramp_map_click_runs_identify":t=r=>{r.button===0&&this.$iApi.geo.map.runIdentify(r)},this.on("map/click",t,e);break;case"ramp_map_created_initializes_fixtures":t=()=>{const r=oA(this.$vApp.$pinia).items;Object.keys(r).forEach(n=>{r[n].initialized?.()})},this.$iApi.geo.map.created&&t(),this.$iApi.event.on("map/created",t,e);break;case"ramp_map_created_updates_map_attribs":t=()=>{this.$iApi.geo.map.caption.updateAttribution(bm(this.$vApp.$pinia).activeBasemapConfig?.attribution)},this.$iApi.geo.map.created&&t(),this.$iApi.event.on("map/created",t,e);break;case"ramp_map_extent_updates_maptip":t=()=>{if(this.$iApi.geo.map.keysActive){const r=this.$iApi.geo.map.mapPointToScreenPoint(this.$iApi.geo.map.getExtent().center());this.$iApi.geo.map.maptip.checkAtCoord(r)}else this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/extentchanged",_P(50,!0,()=>t()),e);break;case"ramp_map_graphichit_creates_maptip":t=r=>{this.$iApi.geo.map.maptip.generateDefaultMaptip(r)},this.$iApi.event.on("map/graphichit",t,e);break;case"ramp_map_identify_opens_identify_results":t=r=>{const n=this.$iApi.fixture.get("details");n&&n.openDetails(r.results)},this.on("map/identify",t,e);break;case"ramp_map_keydown_updates_coords":this.$iApi.event.on("map/keydown",_P(50,()=>{const r=oF(this.$vApp.$pinia);r.coords?.disabled||!this.$iApi.geo.map.keysActive||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.getExtent().center()).then(s=>{r.coords={formattedString:s}})}),e);break;case"ramp_map_keydown_updates_key_handler":t=r=>{this.$iApi.geo.map.mapKeyDown(r)},this.$iApi.event.on("map/keydown",t,e);break;case"ramp_map_keyup_updates_key_handler":t=r=>{this.$iApi.geo.map.mapKeyUp(r)},this.$iApi.event.on("map/keyup",t,e);break;case"ramp_map_mouse_updates_coords":this.$iApi.event.on("map/mousemove",_P(50,r=>{const n=oF(this.$vApp.$pinia);n.coords?.disabled||this.$iApi.geo.map.caption.formatPoint(this.$iApi.geo.map.screenPointToMapPoint(r)).then(o=>{n.coords={formattedString:o}})}),e);break;case"ramp_map_mouse_updates_maptip":t=r=>{this.$iApi.geo.map.maptip.checkAtCoord({screenX:r.screenX,screenY:r.screenY})},this.$iApi.event.on("map/mousemove",_P(50,r=>t(r)),e);break;case"ramp_map_mouseleave_removes_maptip":t=()=>{this.$iApi.geo.map.maptip.clear()},this.$iApi.event.on("map/mouseleave",t);break;case"ramp_map_resize_updates_scalebar":this.$iApi.event.on("map/resized",xE(100,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_map_scale_updates_scalebar":this.$iApi.event.on("map/scalechanged",xE(300,()=>this.$iApi.geo.map.caption.updateScale()),e);break;case"ramp_panel_close_updates_appbar":t=r=>{const n=dy(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&!n.order.flat().find(s=>s===r.id)&&n.removeButton(r.id)},this.on("panel/closed",t,e);break;case"ramp_panel_open_updates_appbar":t=r=>{const n=dy(this.$vApp.$pinia);this.$iApi.fixture.get("appbar")&&(!r.teleport||r.teleport?.showAppbarButton)&&!n.order.flat().find(s=>s===r.id)&&n.addTempButton(r.id)},this.on("panel/opened",t,e);break;case"ramp_toggle_details":t=(r,n)=>{const s=this.$iApi.fixture.get("details");s&&s.toggleFeature(r,n)},this.$iApi.event.on("details/toggle",t,e);break;case"ramp_toggle_grid":t=(r,n)=>{const s=this.$iApi.fixture.get("grid");s&&s.toggleGrid(r.id,n)},this.$iApi.event.on("grid/toggle",t,e);break;case"ramp_toggle_help":t=r=>{const n=this.$iApi.fixture.get("help");n&&n.toggleHelp(r)},this.$iApi.event.on("help/toggle",t,e);break;case"ramp_toggle_metadata":t=(r,n)=>{const s=this.$iApi.fixture.get("metadata");s&&s.toggleMetadata(r,n)},this.$iApi.event.on("metadata/toggle",t,e);break;case"ramp_toggle_reorder":t=r=>{const n=this.$iApi.fixture.get("layer-reorder");n&&n.toggleLayerReorder(r)},this.$iApi.event.on("reorder/toggle",t,e);break;case"ramp_toggle_settings":t=(r,n)=>{const s=this.$iApi.fixture.get("settings");s&&s.toggleSettings(r,n)},this.$iApi.event.on("settings/toggle",t,e);break;case"ramp_toggle_wizard":t=r=>{const n=this.$iApi.fixture.get("wizard");n&&n.toggleWizard(r)},this.$iApi.event.on("wizard/toggle",t,e);break;default:return console.error(`Unrecognized default event handler name encountered: ${e}`),`ERROR_NOT_REGISTERED__${e}`}return e}}/*! * shared v9.13.1 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */const __e=typeof window<"u",iL=(i,e=!1)=>e?Symbol.for(i):Symbol(i),MIr=(i,e,t)=>OIr({l:i,k:e,s:t}),OIr=i=>JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),lg=i=>typeof i=="number"&&isFinite(i),PIr=i=>jNt(i)==="[object Date]",vk=i=>jNt(i)==="[object RegExp]",sTe=i=>Xa(i)&&Object.keys(i).length===0,p0=Object.assign;let vct;const hP=()=>vct||(vct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function _ct(i){return i.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const RIr=Object.prototype.hasOwnProperty;function b_e(i,e){return RIr.call(i,e)}const wd=Array.isArray,Wh=i=>typeof i=="function",_s=i=>typeof i=="string",cu=i=>typeof i=="boolean",zc=i=>i!==null&&typeof i=="object",DIr=i=>zc(i)&&Wh(i.then)&&Wh(i.catch),BNt=Object.prototype.toString,jNt=i=>BNt.call(i),Xa=i=>{if(!zc(i))return!1;const e=Object.getPrototypeOf(i);return e===null||e.constructor===Object},FIr=i=>i==null?"":wd(i)||Xa(i)&&i.toString===BNt?JSON.stringify(i,null,2):String(i);function kIr(i,e=""){return i.reduce((t,r,n)=>n===0?t+r:t+e+r,"")}function oTe(i){let e=i;return()=>++e}function LIr(i,e){typeof console<"u"&&(console.warn("[intlify] "+i),e&&console.warn(e.stack))}const Khe=i=>!zc(i)||wd(i);function Age(i,e){if(Khe(i)||Khe(e))throw new Error("Invalid value");const t=[{src:i,des:e}];for(;t.length;){const{src:r,des:n}=t.pop();Object.keys(r).forEach(s=>{Khe(r[s])||Khe(n[s])?n[s]=r[s]:t.push({src:r[s],des:n[s]})})}}/*! + */const __e=typeof window<"u",iL=(i,e=!1)=>e?Symbol.for(i):Symbol(i),EIr=(i,e,t)=>IIr({l:i,k:e,s:t}),IIr=i=>JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),lg=i=>typeof i=="number"&&isFinite(i),AIr=i=>jNt(i)==="[object Date]",vk=i=>jNt(i)==="[object RegExp]",sTe=i=>Xa(i)&&Object.keys(i).length===0,p0=Object.assign;let vct;const hP=()=>vct||(vct=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function _ct(i){return i.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const MIr=Object.prototype.hasOwnProperty;function b_e(i,e){return MIr.call(i,e)}const wd=Array.isArray,Wh=i=>typeof i=="function",_s=i=>typeof i=="string",cu=i=>typeof i=="boolean",zc=i=>i!==null&&typeof i=="object",OIr=i=>zc(i)&&Wh(i.then)&&Wh(i.catch),BNt=Object.prototype.toString,jNt=i=>BNt.call(i),Xa=i=>{if(!zc(i))return!1;const e=Object.getPrototypeOf(i);return e===null||e.constructor===Object},PIr=i=>i==null?"":wd(i)||Xa(i)&&i.toString===BNt?JSON.stringify(i,null,2):String(i);function RIr(i,e=""){return i.reduce((t,r,n)=>n===0?t+r:t+e+r,"")}function oTe(i){let e=i;return()=>++e}function DIr(i,e){typeof console<"u"&&(console.warn("[intlify] "+i),e&&console.warn(e.stack))}const Khe=i=>!zc(i)||wd(i);function Age(i,e){if(Khe(i)||Khe(e))throw new Error("Invalid value");const t=[{src:i,des:e}];for(;t.length;){const{src:r,des:n}=t.pop();Object.keys(r).forEach(s=>{Khe(r[s])||Khe(n[s])?n[s]=r[s]:t.push({src:r[s],des:n[s]})})}}/*! * message-compiler v9.13.1 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */function NIr(i,e,t){return{line:i,column:e,offset:t}}function w_e(i,e,t){return{start:i,end:e}}const $Ir=/\{([0-9a-zA-Z]+)\}/g;function GNt(i,...e){return e.length===1&&BIr(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),i.replace($Ir,(t,r)=>e.hasOwnProperty(r)?e[r]:"")}const UNt=Object.assign,bct=i=>typeof i=="string",BIr=i=>i!==null&&typeof i=="object";function zNt(i,e=""){return i.reduce((t,r,n)=>n===0?t+r:t+e+r,"")}const Gqe={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},jIr={[Gqe.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function GIr(i,e,...t){const r=GNt(jIr[i],...t||[]),n={message:String(r),code:i};return e&&(n.location=e),n}const va={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},UIr={[va.EXPECTED_TOKEN]:"Expected token: '{0}'",[va.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[va.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[va.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[va.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[va.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[va.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[va.EMPTY_PLACEHOLDER]:"Empty placeholder",[va.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[va.INVALID_LINKED_FORMAT]:"Invalid linked format",[va.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[va.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[va.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[va.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[va.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[va.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function KY(i,e,t={}){const{domain:r,messages:n,args:s}=t,o=GNt((n||UIr)[i]||"",...s||[]),a=new SyntaxError(String(o));return a.code=i,e&&(a.location=e),a.domain=r,a}function zIr(i){throw i}const SM=" ",VIr="\r",P1=` -`,HIr="\u2028",WIr="\u2029";function qIr(i){const e=i;let t=0,r=1,n=1,s=0;const o=V=>e[V]===VIr&&e[V+1]===P1,a=V=>e[V]===P1,l=V=>e[V]===WIr,u=V=>e[V]===HIr,c=V=>o(V)||a(V)||l(V)||u(V),h=()=>t,p=()=>r,m=()=>n,v=()=>s,w=V=>o(V)||l(V)||u(V)?P1:e[V],S=()=>w(t),I=()=>w(t+s);function R(){return s=0,c(t)&&(r++,n=0),o(t)&&t++,t++,n++,e[t]}function L(){return o(t+s)&&s++,s++,e[t+s]}function k(){t=0,r=1,n=1,s=0}function B(V=0){s=V}function $(){const V=t+s;for(;V!==t;)R();s=0}return{index:h,line:p,column:m,peekOffset:v,charAt:w,currentChar:S,currentPeek:I,next:R,peek:L,reset:k,resetPeek:B,skipToPeek:$}}const CD=void 0,YIr=".",wct="'",XIr="tokenizer";function JIr(i,e={}){const t=e.location!==!1,r=qIr(i),n=()=>r.index(),s=()=>NIr(r.line(),r.column(),r.index()),o=s(),a=n(),l={currentType:14,offset:a,startLoc:o,endLoc:o,lastType:14,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=e;function h(ke,me,ie,...ge){const je=u();if(me.column+=ie,me.offset+=ie,c){const rt=t?w_e(je.startLoc,me):null,Me=KY(ke,rt,{domain:XIr,args:ge});c(Me)}}function p(ke,me,ie){ke.endLoc=s(),ke.currentType=me;const ge={type:me};return t&&(ge.loc=w_e(ke.startLoc,ke.endLoc)),ie!=null&&(ge.value=ie),ge}const m=ke=>p(ke,14);function v(ke,me){return ke.currentChar()===me?(ke.next(),me):(h(va.EXPECTED_TOKEN,s(),0,me),"")}function w(ke){let me="";for(;ke.currentPeek()===SM||ke.currentPeek()===P1;)me+=ke.currentPeek(),ke.peek();return me}function S(ke){const me=w(ke);return ke.skipToPeek(),me}function I(ke){if(ke===CD)return!1;const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me===95}function R(ke){if(ke===CD)return!1;const me=ke.charCodeAt(0);return me>=48&&me<=57}function L(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=I(ke.currentPeek());return ke.resetPeek(),ge}function k(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=ke.currentPeek()==="-"?ke.peek():ke.currentPeek(),je=R(ge);return ke.resetPeek(),je}function B(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=ke.currentPeek()===wct;return ke.resetPeek(),ge}function $(ke,me){const{currentType:ie}=me;if(ie!==8)return!1;w(ke);const ge=ke.currentPeek()===".";return ke.resetPeek(),ge}function V(ke,me){const{currentType:ie}=me;if(ie!==9)return!1;w(ke);const ge=I(ke.currentPeek());return ke.resetPeek(),ge}function Y(ke,me){const{currentType:ie}=me;if(!(ie===8||ie===12))return!1;w(ke);const ge=ke.currentPeek()===":";return ke.resetPeek(),ge}function K(ke,me){const{currentType:ie}=me;if(ie!==10)return!1;const ge=()=>{const rt=ke.currentPeek();return rt==="{"?I(ke.peek()):rt==="@"||rt==="%"||rt==="|"||rt===":"||rt==="."||rt===SM||!rt?!1:rt===P1?(ke.peek(),ge()):ne(ke,!1)},je=ge();return ke.resetPeek(),je}function Q(ke){w(ke);const me=ke.currentPeek()==="|";return ke.resetPeek(),me}function re(ke){const me=w(ke),ie=ke.currentPeek()==="%"&&ke.peek()==="{";return ke.resetPeek(),{isModulo:ie,hasSpace:me.length>0}}function ne(ke,me=!0){const ie=(je=!1,rt="",Me=!1)=>{const ht=ke.currentPeek();return ht==="{"?rt==="%"?!1:je:ht==="@"||!ht?rt==="%"?!0:je:ht==="%"?(ke.peek(),ie(je,"%",!0)):ht==="|"?rt==="%"||Me?!0:!(rt===SM||rt===P1):ht===SM?(ke.peek(),ie(!0,SM,Me)):ht===P1?(ke.peek(),ie(!0,P1,Me)):!0},ge=ie();return me&&ke.resetPeek(),ge}function de(ke,me){const ie=ke.currentChar();return ie===CD?CD:me(ie)?(ke.next(),ie):null}function pe(ke){const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36}function H(ke){return de(ke,pe)}function Z(ke){const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36||me===45}function ae(ke){return de(ke,Z)}function fe(ke){const me=ke.charCodeAt(0);return me>=48&&me<=57}function be(ke){return de(ke,fe)}function _e(ke){const me=ke.charCodeAt(0);return me>=48&&me<=57||me>=65&&me<=70||me>=97&&me<=102}function Ie(ke){return de(ke,_e)}function Te(ke){let me="",ie="";for(;me=be(ke);)ie+=me;return ie}function Be(ke){S(ke);const me=ke.currentChar();return me!=="%"&&h(va.EXPECTED_TOKEN,s(),0,me),ke.next(),"%"}function Ve(ke){let me="";for(;;){const ie=ke.currentChar();if(ie==="{"||ie==="}"||ie==="@"||ie==="|"||!ie)break;if(ie==="%")if(ne(ke))me+=ie,ke.next();else break;else if(ie===SM||ie===P1)if(ne(ke))me+=ie,ke.next();else{if(Q(ke))break;me+=ie,ke.next()}else me+=ie,ke.next()}return me}function $e(ke){S(ke);let me="",ie="";for(;me=ae(ke);)ie+=me;return ke.currentChar()===CD&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie}function tt(ke){S(ke);let me="";return ke.currentChar()==="-"?(ke.next(),me+=`-${Te(ke)}`):me+=Te(ke),ke.currentChar()===CD&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),me}function yt(ke){return ke!==wct&&ke!==P1}function Ct(ke){S(ke),v(ke,"'");let me="",ie="";for(;me=de(ke,yt);)me==="\\"?ie+=ot(ke):ie+=me;const ge=ke.currentChar();return ge===P1||ge===CD?(h(va.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),ge===P1&&(ke.next(),v(ke,"'")),ie):(v(ke,"'"),ie)}function ot(ke){const me=ke.currentChar();switch(me){case"\\":case"'":return ke.next(),`\\${me}`;case"u":return vt(ke,me,4);case"U":return vt(ke,me,6);default:return h(va.UNKNOWN_ESCAPE_SEQUENCE,s(),0,me),""}}function vt(ke,me,ie){v(ke,me);let ge="";for(let je=0;je{const ge=ke.currentChar();return ge==="{"||ge==="%"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===SM?ie:(ie+=ge,ke.next(),me(ie))};return me("")}function ct(ke){S(ke);const me=v(ke,"|");return S(ke),me}function st(ke,me){let ie=null;switch(ke.currentChar()){case"{":return me.braceNest>=1&&h(va.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),ke.next(),ie=p(me,2,"{"),S(ke),me.braceNest++,ie;case"}":return me.braceNest>0&&me.currentType===2&&h(va.EMPTY_PLACEHOLDER,s(),0),ke.next(),ie=p(me,3,"}"),me.braceNest--,me.braceNest>0&&S(ke),me.inLinked&&me.braceNest===0&&(me.inLinked=!1),ie;case"@":return me.braceNest>0&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie=Ze(ke,me)||m(me),me.braceNest=0,ie;default:{let je=!0,rt=!0,Me=!0;if(Q(ke))return me.braceNest>0&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ie;if(me.braceNest>0&&(me.currentType===5||me.currentType===6||me.currentType===7))return h(va.UNTERMINATED_CLOSING_BRACE,s(),0),me.braceNest=0,ye(ke,me);if(je=L(ke,me))return ie=p(me,5,$e(ke)),S(ke),ie;if(rt=k(ke,me))return ie=p(me,6,tt(ke)),S(ke),ie;if(Me=B(ke,me))return ie=p(me,7,Ct(ke)),S(ke),ie;if(!je&&!rt&&!Me)return ie=p(me,13,Je(ke)),h(va.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ie.value),S(ke),ie;break}}return ie}function Ze(ke,me){const{currentType:ie}=me;let ge=null;const je=ke.currentChar();switch((ie===8||ie===9||ie===12||ie===10)&&(je===P1||je===SM)&&h(va.INVALID_LINKED_FORMAT,s(),0),je){case"@":return ke.next(),ge=p(me,8,"@"),me.inLinked=!0,ge;case".":return S(ke),ke.next(),p(me,9,".");case":":return S(ke),ke.next(),p(me,10,":");default:return Q(ke)?(ge=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ge):$(ke,me)||Y(ke,me)?(S(ke),Ze(ke,me)):V(ke,me)?(S(ke),p(me,12,it(ke))):K(ke,me)?(S(ke),je==="{"?st(ke,me)||ge:p(me,11,Ue(ke))):(ie===8&&h(va.INVALID_LINKED_FORMAT,s(),0),me.braceNest=0,me.inLinked=!1,ye(ke,me))}}function ye(ke,me){let ie={type:14};if(me.braceNest>0)return st(ke,me)||m(me);if(me.inLinked)return Ze(ke,me)||m(me);switch(ke.currentChar()){case"{":return st(ke,me)||m(me);case"}":return h(va.UNBALANCED_CLOSING_BRACE,s(),0),ke.next(),p(me,3,"}");case"@":return Ze(ke,me)||m(me);default:{if(Q(ke))return ie=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ie;const{isModulo:je,hasSpace:rt}=re(ke);if(je)return rt?p(me,0,Ve(ke)):p(me,4,Be(ke));if(ne(ke))return p(me,0,Ve(ke));break}}return ie}function Ke(){const{currentType:ke,offset:me,startLoc:ie,endLoc:ge}=l;return l.lastType=ke,l.lastOffset=me,l.lastStartLoc=ie,l.lastEndLoc=ge,l.offset=n(),l.startLoc=s(),r.currentChar()===CD?p(l,14):ye(r,l)}return{nextToken:Ke,currentOffset:n,currentPosition:s,context:u}}const KIr="parser",ZIr=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function QIr(i,e,t){switch(i){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||t,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function eAr(i={}){const e=i.location!==!1,{onError:t,onWarn:r}=i;function n(L,k,B,$,...V){const Y=L.currentPosition();if(Y.offset+=$,Y.column+=$,t){const K=e?w_e(B,Y):null,Q=KY(k,K,{domain:KIr,args:V});t(Q)}}function s(L,k,B,$,...V){const Y=L.currentPosition();if(Y.offset+=$,Y.column+=$,r){const K=e?w_e(B,Y):null;r(GIr(k,K,V))}}function o(L,k,B){const $={type:L};return e&&($.start=k,$.end=k,$.loc={start:B,end:B}),$}function a(L,k,B,$){e&&(L.end=k,L.loc&&(L.loc.end=B))}function l(L,k){const B=L.context(),$=o(3,B.offset,B.startLoc);return $.value=k,a($,L.currentOffset(),L.currentPosition()),$}function u(L,k){const B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(5,$,V);return Y.index=parseInt(k,10),L.nextToken(),a(Y,L.currentOffset(),L.currentPosition()),Y}function c(L,k,B){const $=L.context(),{lastOffset:V,lastStartLoc:Y}=$,K=o(4,V,Y);return K.key=k,B===!0&&(K.modulo=!0),L.nextToken(),a(K,L.currentOffset(),L.currentPosition()),K}function h(L,k){const B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(9,$,V);return Y.value=k.replace(ZIr,QIr),L.nextToken(),a(Y,L.currentOffset(),L.currentPosition()),Y}function p(L){const k=L.nextToken(),B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(8,$,V);return k.type!==12?(n(L,va.UNEXPECTED_EMPTY_LINKED_MODIFIER,B.lastStartLoc,0),Y.value="",a(Y,$,V),{nextConsumeToken:k,node:Y}):(k.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,B.lastStartLoc,0,yT(k)),Y.value=k.value||"",a(Y,L.currentOffset(),L.currentPosition()),{node:Y})}function m(L,k){const B=L.context(),$=o(7,B.offset,B.startLoc);return $.value=k,a($,L.currentOffset(),L.currentPosition()),$}function v(L){const k=L.context(),B=o(6,k.offset,k.startLoc);let $=L.nextToken();if($.type===9){const V=p(L);B.modifier=V.node,$=V.nextConsumeToken||L.nextToken()}switch($.type!==10&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),$=L.nextToken(),$.type===2&&($=L.nextToken()),$.type){case 11:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=m(L,$.value||"");break;case 5:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=c(L,$.value||"");break;case 6:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=u(L,$.value||"");break;case 7:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=h(L,$.value||"");break;default:{n(L,va.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const V=L.context(),Y=o(7,V.offset,V.startLoc);return Y.value="",a(Y,V.offset,V.startLoc),B.key=Y,a(B,V.offset,V.startLoc),{nextConsumeToken:$,node:B}}}return a(B,L.currentOffset(),L.currentPosition()),{node:B}}function w(L){const k=L.context(),B=k.currentType===1?L.currentOffset():k.offset,$=k.currentType===1?k.endLoc:k.startLoc,V=o(2,B,$);V.items=[];let Y=null,K=null;do{const ne=Y||L.nextToken();switch(Y=null,ne.type){case 0:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(l(L,ne.value||""));break;case 6:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(u(L,ne.value||""));break;case 4:K=!0;break;case 5:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(c(L,ne.value||"",!!K)),K&&(s(L,Gqe.USE_MODULO_SYNTAX,k.lastStartLoc,0,yT(ne)),K=null);break;case 7:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(h(L,ne.value||""));break;case 8:{const de=v(L);V.items.push(de.node),Y=de.nextConsumeToken||null;break}}}while(k.currentType!==14&&k.currentType!==1);const Q=k.currentType===1?k.lastOffset:L.currentOffset(),re=k.currentType===1?k.lastEndLoc:L.currentPosition();return a(V,Q,re),V}function S(L,k,B,$){const V=L.context();let Y=$.items.length===0;const K=o(1,k,B);K.cases=[],K.cases.push($);do{const Q=w(L);Y||(Y=Q.items.length===0),K.cases.push(Q)}while(V.currentType!==14);return Y&&n(L,va.MUST_HAVE_MESSAGES_IN_PLURAL,B,0),a(K,L.currentOffset(),L.currentPosition()),K}function I(L){const k=L.context(),{offset:B,startLoc:$}=k,V=w(L);return k.currentType===14?V:S(L,B,$,V)}function R(L){const k=JIr(L,UNt({},i)),B=k.context(),$=o(0,B.offset,B.startLoc);return e&&$.loc&&($.loc.source=L),$.body=I(k),i.onCacheKey&&($.cacheKey=i.onCacheKey(L)),B.currentType!==14&&n(k,va.UNEXPECTED_LEXICAL_ANALYSIS,B.lastStartLoc,0,L[B.offset]||""),a($,k.currentOffset(),k.currentPosition()),$}return{parse:R}}function yT(i){if(i.type===14)return"EOF";const e=(i.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function tAr(i,e={}){const t={ast:i,helpers:new Set};return{context:()=>t,helper:s=>(t.helpers.add(s),s)}}function xct(i,e){for(let t=0;tSct(t)),i}function Sct(i){if(i.items.length===1){const e=i.items[0];(e.type===3||e.type===9)&&(i.static=e.value,delete e.value)}else{const e=[];for(let t=0;ta;function u(S,I){a.code+=S}function c(S,I=!0){const R=I?n:"";u(s?R+" ".repeat(S):R)}function h(S=!0){const I=++a.indentLevel;S&&c(I)}function p(S=!0){const I=--a.indentLevel;S&&c(I)}function m(){c(a.indentLevel)}return{context:l,push:u,indent:h,deindent:p,newline:m,helper:S=>`_${S}`,needIndent:()=>a.needIndent}}function aAr(i,e){const{helper:t}=i;i.push(`${t("linked")}(`),QW(i,e.key),e.modifier?(i.push(", "),QW(i,e.modifier),i.push(", _type")):i.push(", undefined, _type"),i.push(")")}function lAr(i,e){const{helper:t,needIndent:r}=i;i.push(`${t("normalize")}([`),i.indent(r());const n=e.items.length;for(let s=0;s1){i.push(`${t("plural")}([`),i.indent(r());const n=e.cases.length;for(let s=0;s{const t=bct(e.mode)?e.mode:"normal",r=bct(e.filename)?e.filename:"message.intl",n=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` -`,o=e.needIndent?e.needIndent:t!=="arrow",a=i.helpers||[],l=oAr(i,{mode:t,filename:r,sourceMap:n,breakLineCode:s,needIndent:o});l.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${zNt(a.map(h=>`${h}: _${h}`),", ")} } = ctx`),l.newline()),l.push("return "),QW(l,i),l.deindent(o),l.push("}"),delete i.helpers;const{code:u,map:c}=l.context();return{ast:i,code:u,map:c?c.toJSON():void 0}};function dAr(i,e={}){const t=UNt({},e),r=!!t.jit,n=!!t.minify,s=t.optimize==null?!0:t.optimize,a=eAr(t).parse(i);return r?(s&&rAr(a),n&&hU(a),{ast:a,code:""}):(iAr(a,t),hAr(a,t))}/*! + */function FIr(i,e,t){return{line:i,column:e,offset:t}}function w_e(i,e,t){return{start:i,end:e}}const kIr=/\{([0-9a-zA-Z]+)\}/g;function GNt(i,...e){return e.length===1&&LIr(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),i.replace(kIr,(t,r)=>e.hasOwnProperty(r)?e[r]:"")}const UNt=Object.assign,bct=i=>typeof i=="string",LIr=i=>i!==null&&typeof i=="object";function zNt(i,e=""){return i.reduce((t,r,n)=>n===0?t+r:t+e+r,"")}const Gqe={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},NIr={[Gqe.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function $Ir(i,e,...t){const r=GNt(NIr[i],...t||[]),n={message:String(r),code:i};return e&&(n.location=e),n}const va={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},BIr={[va.EXPECTED_TOKEN]:"Expected token: '{0}'",[va.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[va.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[va.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[va.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[va.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[va.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[va.EMPTY_PLACEHOLDER]:"Empty placeholder",[va.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[va.INVALID_LINKED_FORMAT]:"Invalid linked format",[va.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[va.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[va.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[va.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[va.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[va.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function KY(i,e,t={}){const{domain:r,messages:n,args:s}=t,o=GNt((n||BIr)[i]||"",...s||[]),a=new SyntaxError(String(o));return a.code=i,e&&(a.location=e),a.domain=r,a}function jIr(i){throw i}const SM=" ",GIr="\r",P1=` +`,UIr="\u2028",zIr="\u2029";function VIr(i){const e=i;let t=0,r=1,n=1,s=0;const o=V=>e[V]===GIr&&e[V+1]===P1,a=V=>e[V]===P1,l=V=>e[V]===zIr,u=V=>e[V]===UIr,c=V=>o(V)||a(V)||l(V)||u(V),h=()=>t,p=()=>r,m=()=>n,v=()=>s,w=V=>o(V)||l(V)||u(V)?P1:e[V],S=()=>w(t),I=()=>w(t+s);function R(){return s=0,c(t)&&(r++,n=0),o(t)&&t++,t++,n++,e[t]}function L(){return o(t+s)&&s++,s++,e[t+s]}function k(){t=0,r=1,n=1,s=0}function B(V=0){s=V}function $(){const V=t+s;for(;V!==t;)R();s=0}return{index:h,line:p,column:m,peekOffset:v,charAt:w,currentChar:S,currentPeek:I,next:R,peek:L,reset:k,resetPeek:B,skipToPeek:$}}const CD=void 0,HIr=".",wct="'",WIr="tokenizer";function qIr(i,e={}){const t=e.location!==!1,r=VIr(i),n=()=>r.index(),s=()=>FIr(r.line(),r.column(),r.index()),o=s(),a=n(),l={currentType:14,offset:a,startLoc:o,endLoc:o,lastType:14,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=e;function h(ke,me,ie,...ge){const je=u();if(me.column+=ie,me.offset+=ie,c){const rt=t?w_e(je.startLoc,me):null,Me=KY(ke,rt,{domain:WIr,args:ge});c(Me)}}function p(ke,me,ie){ke.endLoc=s(),ke.currentType=me;const ge={type:me};return t&&(ge.loc=w_e(ke.startLoc,ke.endLoc)),ie!=null&&(ge.value=ie),ge}const m=ke=>p(ke,14);function v(ke,me){return ke.currentChar()===me?(ke.next(),me):(h(va.EXPECTED_TOKEN,s(),0,me),"")}function w(ke){let me="";for(;ke.currentPeek()===SM||ke.currentPeek()===P1;)me+=ke.currentPeek(),ke.peek();return me}function S(ke){const me=w(ke);return ke.skipToPeek(),me}function I(ke){if(ke===CD)return!1;const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me===95}function R(ke){if(ke===CD)return!1;const me=ke.charCodeAt(0);return me>=48&&me<=57}function L(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=I(ke.currentPeek());return ke.resetPeek(),ge}function k(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=ke.currentPeek()==="-"?ke.peek():ke.currentPeek(),je=R(ge);return ke.resetPeek(),je}function B(ke,me){const{currentType:ie}=me;if(ie!==2)return!1;w(ke);const ge=ke.currentPeek()===wct;return ke.resetPeek(),ge}function $(ke,me){const{currentType:ie}=me;if(ie!==8)return!1;w(ke);const ge=ke.currentPeek()===".";return ke.resetPeek(),ge}function V(ke,me){const{currentType:ie}=me;if(ie!==9)return!1;w(ke);const ge=I(ke.currentPeek());return ke.resetPeek(),ge}function Y(ke,me){const{currentType:ie}=me;if(!(ie===8||ie===12))return!1;w(ke);const ge=ke.currentPeek()===":";return ke.resetPeek(),ge}function K(ke,me){const{currentType:ie}=me;if(ie!==10)return!1;const ge=()=>{const rt=ke.currentPeek();return rt==="{"?I(ke.peek()):rt==="@"||rt==="%"||rt==="|"||rt===":"||rt==="."||rt===SM||!rt?!1:rt===P1?(ke.peek(),ge()):ne(ke,!1)},je=ge();return ke.resetPeek(),je}function Q(ke){w(ke);const me=ke.currentPeek()==="|";return ke.resetPeek(),me}function re(ke){const me=w(ke),ie=ke.currentPeek()==="%"&&ke.peek()==="{";return ke.resetPeek(),{isModulo:ie,hasSpace:me.length>0}}function ne(ke,me=!0){const ie=(je=!1,rt="",Me=!1)=>{const ht=ke.currentPeek();return ht==="{"?rt==="%"?!1:je:ht==="@"||!ht?rt==="%"?!0:je:ht==="%"?(ke.peek(),ie(je,"%",!0)):ht==="|"?rt==="%"||Me?!0:!(rt===SM||rt===P1):ht===SM?(ke.peek(),ie(!0,SM,Me)):ht===P1?(ke.peek(),ie(!0,P1,Me)):!0},ge=ie();return me&&ke.resetPeek(),ge}function de(ke,me){const ie=ke.currentChar();return ie===CD?CD:me(ie)?(ke.next(),ie):null}function pe(ke){const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36}function H(ke){return de(ke,pe)}function Z(ke){const me=ke.charCodeAt(0);return me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95||me===36||me===45}function ae(ke){return de(ke,Z)}function fe(ke){const me=ke.charCodeAt(0);return me>=48&&me<=57}function be(ke){return de(ke,fe)}function _e(ke){const me=ke.charCodeAt(0);return me>=48&&me<=57||me>=65&&me<=70||me>=97&&me<=102}function Ie(ke){return de(ke,_e)}function Te(ke){let me="",ie="";for(;me=be(ke);)ie+=me;return ie}function Be(ke){S(ke);const me=ke.currentChar();return me!=="%"&&h(va.EXPECTED_TOKEN,s(),0,me),ke.next(),"%"}function Ve(ke){let me="";for(;;){const ie=ke.currentChar();if(ie==="{"||ie==="}"||ie==="@"||ie==="|"||!ie)break;if(ie==="%")if(ne(ke))me+=ie,ke.next();else break;else if(ie===SM||ie===P1)if(ne(ke))me+=ie,ke.next();else{if(Q(ke))break;me+=ie,ke.next()}else me+=ie,ke.next()}return me}function $e(ke){S(ke);let me="",ie="";for(;me=ae(ke);)ie+=me;return ke.currentChar()===CD&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie}function tt(ke){S(ke);let me="";return ke.currentChar()==="-"?(ke.next(),me+=`-${Te(ke)}`):me+=Te(ke),ke.currentChar()===CD&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),me}function yt(ke){return ke!==wct&&ke!==P1}function Ct(ke){S(ke),v(ke,"'");let me="",ie="";for(;me=de(ke,yt);)me==="\\"?ie+=ot(ke):ie+=me;const ge=ke.currentChar();return ge===P1||ge===CD?(h(va.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),ge===P1&&(ke.next(),v(ke,"'")),ie):(v(ke,"'"),ie)}function ot(ke){const me=ke.currentChar();switch(me){case"\\":case"'":return ke.next(),`\\${me}`;case"u":return vt(ke,me,4);case"U":return vt(ke,me,6);default:return h(va.UNKNOWN_ESCAPE_SEQUENCE,s(),0,me),""}}function vt(ke,me,ie){v(ke,me);let ge="";for(let je=0;je{const ge=ke.currentChar();return ge==="{"||ge==="%"||ge==="@"||ge==="|"||ge==="("||ge===")"||!ge||ge===SM?ie:(ie+=ge,ke.next(),me(ie))};return me("")}function ct(ke){S(ke);const me=v(ke,"|");return S(ke),me}function st(ke,me){let ie=null;switch(ke.currentChar()){case"{":return me.braceNest>=1&&h(va.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),ke.next(),ie=p(me,2,"{"),S(ke),me.braceNest++,ie;case"}":return me.braceNest>0&&me.currentType===2&&h(va.EMPTY_PLACEHOLDER,s(),0),ke.next(),ie=p(me,3,"}"),me.braceNest--,me.braceNest>0&&S(ke),me.inLinked&&me.braceNest===0&&(me.inLinked=!1),ie;case"@":return me.braceNest>0&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie=Ze(ke,me)||m(me),me.braceNest=0,ie;default:{let je=!0,rt=!0,Me=!0;if(Q(ke))return me.braceNest>0&&h(va.UNTERMINATED_CLOSING_BRACE,s(),0),ie=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ie;if(me.braceNest>0&&(me.currentType===5||me.currentType===6||me.currentType===7))return h(va.UNTERMINATED_CLOSING_BRACE,s(),0),me.braceNest=0,ye(ke,me);if(je=L(ke,me))return ie=p(me,5,$e(ke)),S(ke),ie;if(rt=k(ke,me))return ie=p(me,6,tt(ke)),S(ke),ie;if(Me=B(ke,me))return ie=p(me,7,Ct(ke)),S(ke),ie;if(!je&&!rt&&!Me)return ie=p(me,13,Je(ke)),h(va.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ie.value),S(ke),ie;break}}return ie}function Ze(ke,me){const{currentType:ie}=me;let ge=null;const je=ke.currentChar();switch((ie===8||ie===9||ie===12||ie===10)&&(je===P1||je===SM)&&h(va.INVALID_LINKED_FORMAT,s(),0),je){case"@":return ke.next(),ge=p(me,8,"@"),me.inLinked=!0,ge;case".":return S(ke),ke.next(),p(me,9,".");case":":return S(ke),ke.next(),p(me,10,":");default:return Q(ke)?(ge=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ge):$(ke,me)||Y(ke,me)?(S(ke),Ze(ke,me)):V(ke,me)?(S(ke),p(me,12,it(ke))):K(ke,me)?(S(ke),je==="{"?st(ke,me)||ge:p(me,11,Ue(ke))):(ie===8&&h(va.INVALID_LINKED_FORMAT,s(),0),me.braceNest=0,me.inLinked=!1,ye(ke,me))}}function ye(ke,me){let ie={type:14};if(me.braceNest>0)return st(ke,me)||m(me);if(me.inLinked)return Ze(ke,me)||m(me);switch(ke.currentChar()){case"{":return st(ke,me)||m(me);case"}":return h(va.UNBALANCED_CLOSING_BRACE,s(),0),ke.next(),p(me,3,"}");case"@":return Ze(ke,me)||m(me);default:{if(Q(ke))return ie=p(me,1,ct(ke)),me.braceNest=0,me.inLinked=!1,ie;const{isModulo:je,hasSpace:rt}=re(ke);if(je)return rt?p(me,0,Ve(ke)):p(me,4,Be(ke));if(ne(ke))return p(me,0,Ve(ke));break}}return ie}function Ke(){const{currentType:ke,offset:me,startLoc:ie,endLoc:ge}=l;return l.lastType=ke,l.lastOffset=me,l.lastStartLoc=ie,l.lastEndLoc=ge,l.offset=n(),l.startLoc=s(),r.currentChar()===CD?p(l,14):ye(r,l)}return{nextToken:Ke,currentOffset:n,currentPosition:s,context:u}}const YIr="parser",XIr=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function JIr(i,e,t){switch(i){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||t,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function KIr(i={}){const e=i.location!==!1,{onError:t,onWarn:r}=i;function n(L,k,B,$,...V){const Y=L.currentPosition();if(Y.offset+=$,Y.column+=$,t){const K=e?w_e(B,Y):null,Q=KY(k,K,{domain:YIr,args:V});t(Q)}}function s(L,k,B,$,...V){const Y=L.currentPosition();if(Y.offset+=$,Y.column+=$,r){const K=e?w_e(B,Y):null;r($Ir(k,K,V))}}function o(L,k,B){const $={type:L};return e&&($.start=k,$.end=k,$.loc={start:B,end:B}),$}function a(L,k,B,$){e&&(L.end=k,L.loc&&(L.loc.end=B))}function l(L,k){const B=L.context(),$=o(3,B.offset,B.startLoc);return $.value=k,a($,L.currentOffset(),L.currentPosition()),$}function u(L,k){const B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(5,$,V);return Y.index=parseInt(k,10),L.nextToken(),a(Y,L.currentOffset(),L.currentPosition()),Y}function c(L,k,B){const $=L.context(),{lastOffset:V,lastStartLoc:Y}=$,K=o(4,V,Y);return K.key=k,B===!0&&(K.modulo=!0),L.nextToken(),a(K,L.currentOffset(),L.currentPosition()),K}function h(L,k){const B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(9,$,V);return Y.value=k.replace(XIr,JIr),L.nextToken(),a(Y,L.currentOffset(),L.currentPosition()),Y}function p(L){const k=L.nextToken(),B=L.context(),{lastOffset:$,lastStartLoc:V}=B,Y=o(8,$,V);return k.type!==12?(n(L,va.UNEXPECTED_EMPTY_LINKED_MODIFIER,B.lastStartLoc,0),Y.value="",a(Y,$,V),{nextConsumeToken:k,node:Y}):(k.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,B.lastStartLoc,0,yT(k)),Y.value=k.value||"",a(Y,L.currentOffset(),L.currentPosition()),{node:Y})}function m(L,k){const B=L.context(),$=o(7,B.offset,B.startLoc);return $.value=k,a($,L.currentOffset(),L.currentPosition()),$}function v(L){const k=L.context(),B=o(6,k.offset,k.startLoc);let $=L.nextToken();if($.type===9){const V=p(L);B.modifier=V.node,$=V.nextConsumeToken||L.nextToken()}switch($.type!==10&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),$=L.nextToken(),$.type===2&&($=L.nextToken()),$.type){case 11:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=m(L,$.value||"");break;case 5:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=c(L,$.value||"");break;case 6:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=u(L,$.value||"");break;case 7:$.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT($)),B.key=h(L,$.value||"");break;default:{n(L,va.UNEXPECTED_EMPTY_LINKED_KEY,k.lastStartLoc,0);const V=L.context(),Y=o(7,V.offset,V.startLoc);return Y.value="",a(Y,V.offset,V.startLoc),B.key=Y,a(B,V.offset,V.startLoc),{nextConsumeToken:$,node:B}}}return a(B,L.currentOffset(),L.currentPosition()),{node:B}}function w(L){const k=L.context(),B=k.currentType===1?L.currentOffset():k.offset,$=k.currentType===1?k.endLoc:k.startLoc,V=o(2,B,$);V.items=[];let Y=null,K=null;do{const ne=Y||L.nextToken();switch(Y=null,ne.type){case 0:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(l(L,ne.value||""));break;case 6:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(u(L,ne.value||""));break;case 4:K=!0;break;case 5:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(c(L,ne.value||"",!!K)),K&&(s(L,Gqe.USE_MODULO_SYNTAX,k.lastStartLoc,0,yT(ne)),K=null);break;case 7:ne.value==null&&n(L,va.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,yT(ne)),V.items.push(h(L,ne.value||""));break;case 8:{const de=v(L);V.items.push(de.node),Y=de.nextConsumeToken||null;break}}}while(k.currentType!==14&&k.currentType!==1);const Q=k.currentType===1?k.lastOffset:L.currentOffset(),re=k.currentType===1?k.lastEndLoc:L.currentPosition();return a(V,Q,re),V}function S(L,k,B,$){const V=L.context();let Y=$.items.length===0;const K=o(1,k,B);K.cases=[],K.cases.push($);do{const Q=w(L);Y||(Y=Q.items.length===0),K.cases.push(Q)}while(V.currentType!==14);return Y&&n(L,va.MUST_HAVE_MESSAGES_IN_PLURAL,B,0),a(K,L.currentOffset(),L.currentPosition()),K}function I(L){const k=L.context(),{offset:B,startLoc:$}=k,V=w(L);return k.currentType===14?V:S(L,B,$,V)}function R(L){const k=qIr(L,UNt({},i)),B=k.context(),$=o(0,B.offset,B.startLoc);return e&&$.loc&&($.loc.source=L),$.body=I(k),i.onCacheKey&&($.cacheKey=i.onCacheKey(L)),B.currentType!==14&&n(k,va.UNEXPECTED_LEXICAL_ANALYSIS,B.lastStartLoc,0,L[B.offset]||""),a($,k.currentOffset(),k.currentPosition()),$}return{parse:R}}function yT(i){if(i.type===14)return"EOF";const e=(i.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function ZIr(i,e={}){const t={ast:i,helpers:new Set};return{context:()=>t,helper:s=>(t.helpers.add(s),s)}}function xct(i,e){for(let t=0;tSct(t)),i}function Sct(i){if(i.items.length===1){const e=i.items[0];(e.type===3||e.type===9)&&(i.static=e.value,delete e.value)}else{const e=[];for(let t=0;ta;function u(S,I){a.code+=S}function c(S,I=!0){const R=I?n:"";u(s?R+" ".repeat(S):R)}function h(S=!0){const I=++a.indentLevel;S&&c(I)}function p(S=!0){const I=--a.indentLevel;S&&c(I)}function m(){c(a.indentLevel)}return{context:l,push:u,indent:h,deindent:p,newline:m,helper:S=>`_${S}`,needIndent:()=>a.needIndent}}function nAr(i,e){const{helper:t}=i;i.push(`${t("linked")}(`),QW(i,e.key),e.modifier?(i.push(", "),QW(i,e.modifier),i.push(", _type")):i.push(", undefined, _type"),i.push(")")}function sAr(i,e){const{helper:t,needIndent:r}=i;i.push(`${t("normalize")}([`),i.indent(r());const n=e.items.length;for(let s=0;s1){i.push(`${t("plural")}([`),i.indent(r());const n=e.cases.length;for(let s=0;s{const t=bct(e.mode)?e.mode:"normal",r=bct(e.filename)?e.filename:"message.intl",n=!!e.sourceMap,s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,o=e.needIndent?e.needIndent:t!=="arrow",a=i.helpers||[],l=rAr(i,{mode:t,filename:r,sourceMap:n,breakLineCode:s,needIndent:o});l.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${zNt(a.map(h=>`${h}: _${h}`),", ")} } = ctx`),l.newline()),l.push("return "),QW(l,i),l.deindent(o),l.push("}"),delete i.helpers;const{code:u,map:c}=l.context();return{ast:i,code:u,map:c?c.toJSON():void 0}};function uAr(i,e={}){const t=UNt({},e),r=!!t.jit,n=!!t.minify,s=t.optimize==null?!0:t.optimize,a=KIr(t).parse(i);return r?(s&&eAr(a),n&&hU(a),{ast:a,code:""}):(QIr(a,t),lAr(a,t))}/*! * core-base v9.13.1 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */function pAr(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hP().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hP().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hP().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const rL=[];rL[0]={w:[0],i:[3,0],"[":[4],o:[7]};rL[1]={w:[1],".":[2],"[":[4],o:[7]};rL[2]={w:[2],i:[3,0],0:[3,0]};rL[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};rL[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};rL[5]={"'":[4,0],o:8,l:[5,0]};rL[6]={'"':[4,0],o:8,l:[6,0]};const fAr=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function mAr(i){return fAr.test(i)}function gAr(i){const e=i.charCodeAt(0),t=i.charCodeAt(i.length-1);return e===t&&(e===34||e===39)?i.slice(1,-1):i}function yAr(i){if(i==null)return"o";switch(i.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return i;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function vAr(i){const e=i.trim();return i.charAt(0)==="0"&&isNaN(parseInt(i))?!1:mAr(e)?gAr(e):"*"+e}function _Ar(i){const e=[];let t=-1,r=0,n=0,s,o,a,l,u,c,h;const p=[];p[0]=()=>{o===void 0?o=a:o+=a},p[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},p[2]=()=>{p[0](),n++},p[3]=()=>{if(n>0)n--,r=4,p[0]();else{if(n=0,o===void 0||(o=vAr(o),o===!1))return!1;p[1]()}};function m(){const v=i[t+1];if(r===5&&v==="'"||r===6&&v==='"')return t++,a="\\"+v,p[0](),!0}for(;r!==null;)if(t++,s=i[t],!(s==="\\"&&m())){if(l=yAr(s),h=rL[r],u=h[l]||h.l||8,u===8||(r=u[0],u[1]!==void 0&&(c=p[u[1]],c&&(a=s,c()===!1))))return;if(r===7)return e}}const Tct=new Map;function bAr(i,e){return zc(i)?i[e]:null}function wAr(i,e){if(!zc(i))return null;let t=Tct.get(e);if(t||(t=_Ar(e),t&&Tct.set(e,t)),!t)return null;const r=t.length;let n=i,s=0;for(;si,SAr=i=>"",TAr="text",CAr=i=>i.length===0?"":kIr(i),EAr=FIr;function Cct(i,e){return i=Math.abs(i),e===2?i?i>1?1:0:1:i?Math.min(i,2):0}function IAr(i){const e=lg(i.pluralIndex)?i.pluralIndex:-1;return i.named&&(lg(i.named.count)||lg(i.named.n))?lg(i.named.count)?i.named.count:lg(i.named.n)?i.named.n:e:e}function AAr(i,e){e.count||(e.count=i),e.n||(e.n=i)}function MAr(i={}){const e=i.locale,t=IAr(i),r=zc(i.pluralRules)&&_s(e)&&Wh(i.pluralRules[e])?i.pluralRules[e]:Cct,n=zc(i.pluralRules)&&_s(e)&&Wh(i.pluralRules[e])?Cct:void 0,s=I=>I[r(t,I.length,n)],o=i.list||[],a=I=>o[I],l=i.named||{};lg(i.pluralIndex)&&AAr(t,l);const u=I=>l[I];function c(I){const R=Wh(i.messages)?i.messages(I):zc(i.messages)?i.messages[I]:!1;return R||(i.parent?i.parent.message(I):SAr)}const h=I=>i.modifiers?i.modifiers[I]:xAr,p=Xa(i.processor)&&Wh(i.processor.normalize)?i.processor.normalize:CAr,m=Xa(i.processor)&&Wh(i.processor.interpolate)?i.processor.interpolate:EAr,v=Xa(i.processor)&&_s(i.processor.type)?i.processor.type:TAr,S={list:a,named:u,plural:s,linked:(I,...R)=>{const[L,k]=R;let B="text",$="";R.length===1?zc(L)?($=L.modifier||$,B=L.type||B):_s(L)&&($=L||$):R.length===2&&(_s(L)&&($=L||$),_s(k)&&(B=k||B));const V=c(I)(S),Y=B==="vnode"&&wd(V)&&$?V[0]:V;return $?h($)(Y,B):Y},message:c,type:v,interpolate:m,normalize:p,values:p0({},o,l)};return S}let Sse=null;function OAr(i){Sse=i}function PAr(i,e,t){Sse&&Sse.emit("i18n:init",{timestamp:Date.now(),i18n:i,version:e,meta:t})}const RAr=DAr("function:translate");function DAr(i){return e=>Sse&&Sse.emit(i,e)}const VNt=Gqe.__EXTEND_POINT__,JL=oTe(VNt),FAr={NOT_FOUND_KEY:VNt,FALLBACK_TO_TRANSLATE:JL(),CANNOT_FORMAT_NUMBER:JL(),FALLBACK_TO_NUMBER_FORMAT:JL(),CANNOT_FORMAT_DATE:JL(),FALLBACK_TO_DATE_FORMAT:JL(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:JL(),__EXTEND_POINT__:JL()},HNt=va.__EXTEND_POINT__,KL=oTe(HNt),BC={INVALID_ARGUMENT:HNt,INVALID_DATE_ARGUMENT:KL(),INVALID_ISO_DATE_ARGUMENT:KL(),NOT_SUPPORT_NON_STRING_MESSAGE:KL(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:KL(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:KL(),NOT_SUPPORT_LOCALE_TYPE:KL(),__EXTEND_POINT__:KL()};function PA(i){return KY(i,null,void 0)}function zqe(i,e){return e.locale!=null?Ect(e.locale):Ect(i.locale)}let KMe;function Ect(i){if(_s(i))return i;if(Wh(i)){if(i.resolvedOnce&&KMe!=null)return KMe;if(i.constructor.name==="Function"){const e=i();if(DIr(e))throw PA(BC.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return KMe=e}else throw PA(BC.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw PA(BC.NOT_SUPPORT_LOCALE_TYPE)}function kAr(i,e,t){return[...new Set([t,...wd(e)?e:zc(e)?Object.keys(e):_s(e)?[e]:[t]])]}function WNt(i,e,t){const r=_s(t)?t:eq,n=i;n.__localeChainCache||(n.__localeChainCache=new Map);let s=n.__localeChainCache.get(r);if(!s){s=[];let o=[t];for(;wd(o);)o=Ict(s,o,e);const a=wd(e)||!Xa(e)?e:e.default?e.default:null;o=_s(a)?[a]:a,wd(o)&&Ict(s,o,!1),n.__localeChainCache.set(r,s)}return s}function Ict(i,e,t){let r=!0;for(let n=0;n`${i.charAt(0).toLocaleUpperCase()}${i.substr(1)}`;function BAr(){return{upper:(i,e)=>e==="text"&&_s(i)?i.toUpperCase():e==="vnode"&&zc(i)&&"__v_isVNode"in i?i.children.toUpperCase():i,lower:(i,e)=>e==="text"&&_s(i)?i.toLowerCase():e==="vnode"&&zc(i)&&"__v_isVNode"in i?i.children.toLowerCase():i,capitalize:(i,e)=>e==="text"&&_s(i)?Mct(i):e==="vnode"&&zc(i)&&"__v_isVNode"in i?Mct(i.children):i}}let qNt;function Oct(i){qNt=i}let YNt;function jAr(i){YNt=i}let XNt;function GAr(i){XNt=i}let JNt=null;const UAr=i=>{JNt=i},zAr=()=>JNt;let KNt=null;const Pct=i=>{KNt=i},VAr=()=>KNt;let Rct=0;function HAr(i={}){const e=Wh(i.onWarn)?i.onWarn:LIr,t=_s(i.version)?i.version:$Ar,r=_s(i.locale)||Wh(i.locale)?i.locale:eq,n=Wh(r)?eq:r,s=wd(i.fallbackLocale)||Xa(i.fallbackLocale)||_s(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:n,o=Xa(i.messages)?i.messages:{[n]:{}},a=Xa(i.datetimeFormats)?i.datetimeFormats:{[n]:{}},l=Xa(i.numberFormats)?i.numberFormats:{[n]:{}},u=p0({},i.modifiers||{},BAr()),c=i.pluralRules||{},h=Wh(i.missing)?i.missing:null,p=cu(i.missingWarn)||vk(i.missingWarn)?i.missingWarn:!0,m=cu(i.fallbackWarn)||vk(i.fallbackWarn)?i.fallbackWarn:!0,v=!!i.fallbackFormat,w=!!i.unresolving,S=Wh(i.postTranslation)?i.postTranslation:null,I=Xa(i.processor)?i.processor:null,R=cu(i.warnHtmlMessage)?i.warnHtmlMessage:!0,L=!!i.escapeParameter,k=Wh(i.messageCompiler)?i.messageCompiler:qNt,B=Wh(i.messageResolver)?i.messageResolver:YNt||bAr,$=Wh(i.localeFallbacker)?i.localeFallbacker:XNt||kAr,V=zc(i.fallbackContext)?i.fallbackContext:void 0,Y=i,K=zc(Y.__datetimeFormatters)?Y.__datetimeFormatters:new Map,Q=zc(Y.__numberFormatters)?Y.__numberFormatters:new Map,re=zc(Y.__meta)?Y.__meta:{};Rct++;const ne={version:t,cid:Rct,locale:r,fallbackLocale:s,messages:o,modifiers:u,pluralRules:c,missing:h,missingWarn:p,fallbackWarn:m,fallbackFormat:v,unresolving:w,postTranslation:S,processor:I,warnHtmlMessage:R,escapeParameter:L,messageCompiler:k,messageResolver:B,localeFallbacker:$,fallbackContext:V,onWarn:e,__meta:re};return ne.datetimeFormats=a,ne.numberFormats=l,ne.__datetimeFormatters=K,ne.__numberFormatters=Q,__INTLIFY_PROD_DEVTOOLS__&&PAr(ne,t,re),ne}function Vqe(i,e,t,r,n){const{missing:s,onWarn:o}=i;if(s!==null){const a=s(i,t,e,n);return _s(a)?a:e}else return e}function KJ(i,e,t){const r=i;r.__localeChainCache=new Map,i.localeFallbacker(i,t,e)}function WAr(i,e){return i===e?!1:i.split("-")[0]===e.split("-")[0]}function qAr(i,e){const t=e.indexOf(i);if(t===-1)return!1;for(let r=t+1;rYAr(t,i)}function YAr(i,e){const t=e.b||e.body;if((t.t||t.type)===1){const r=t,n=r.c||r.cases;return i.plural(n.reduce((s,o)=>[...s,Dct(i,o)],[]))}else return Dct(i,t)}function Dct(i,e){const t=e.s||e.static;if(t)return i.type==="text"?t:i.normalize([t]);{const r=(e.i||e.items).reduce((n,s)=>[...n,E$e(i,s)],[]);return i.normalize(r)}}function E$e(i,e){const t=e.t||e.type;switch(t){case 3:{const r=e;return r.v||r.value}case 9:{const r=e;return r.v||r.value}case 4:{const r=e;return i.interpolate(i.named(r.k||r.key))}case 5:{const r=e;return i.interpolate(i.list(r.i!=null?r.i:r.index))}case 6:{const r=e,n=r.m||r.modifier;return i.linked(E$e(i,r.k||r.key),n?E$e(i,n):void 0,i.type)}case 7:{const r=e;return r.v||r.value}case 8:{const r=e;return r.v||r.value}default:throw new Error(`unhandled node type on format message part: ${t}`)}}const ZNt=i=>i;let qz=Object.create(null);const tq=i=>zc(i)&&(i.t===0||i.type===0)&&("b"in i||"body"in i);function QNt(i,e={}){let t=!1;const r=e.onError||zIr;return e.onError=n=>{t=!0,r(n)},{...dAr(i,e),detectError:t}}const XAr=(i,e)=>{if(!_s(i))throw PA(BC.NOT_SUPPORT_NON_STRING_MESSAGE);{cu(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||ZNt)(i),n=qz[r];if(n)return n;const{code:s,detectError:o}=QNt(i,e),a=new Function(`return ${s}`)();return o?a:qz[r]=a}};function JAr(i,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&_s(i)){cu(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||ZNt)(i),n=qz[r];if(n)return n;const{ast:s,detectError:o}=QNt(i,{...e,location:!1,jit:!0}),a=ZMe(s);return o?a:qz[r]=a}else{const t=i.cacheKey;if(t){const r=qz[t];return r||(qz[t]=ZMe(i))}else return ZMe(i)}}const Fct=()=>"",eS=i=>Wh(i);function kct(i,...e){const{fallbackFormat:t,postTranslation:r,unresolving:n,messageCompiler:s,fallbackLocale:o,messages:a}=i,[l,u]=I$e(...e),c=cu(u.missingWarn)?u.missingWarn:i.missingWarn,h=cu(u.fallbackWarn)?u.fallbackWarn:i.fallbackWarn,p=cu(u.escapeParameter)?u.escapeParameter:i.escapeParameter,m=!!u.resolvedMessage,v=_s(u.default)||cu(u.default)?cu(u.default)?s?l:()=>l:u.default:t?s?l:()=>l:"",w=t||v!=="",S=zqe(i,u);p&&KAr(u);let[I,R,L]=m?[l,S,a[S]||{}]:e$t(i,l,S,o,h,c),k=I,B=l;if(!m&&!(_s(k)||tq(k)||eS(k))&&w&&(k=v,B=k),!m&&(!(_s(k)||tq(k)||eS(k))||!_s(R)))return n?aTe:l;let $=!1;const V=()=>{$=!0},Y=eS(k)?k:t$t(i,l,R,k,B,V);if($)return k;const K=e3r(i,R,L,u),Q=MAr(K),re=ZAr(i,Y,Q),ne=r?r(re,l):re;if(__INTLIFY_PROD_DEVTOOLS__){const de={timestamp:Date.now(),key:_s(l)?l:eS(k)?k.key:"",locale:R||(eS(k)?k.locale:""),format:_s(k)?k:eS(k)?k.source:"",message:ne};de.meta=p0({},i.__meta,zAr()||{}),RAr(de)}return ne}function KAr(i){wd(i.list)?i.list=i.list.map(e=>_s(e)?_ct(e):e):zc(i.named)&&Object.keys(i.named).forEach(e=>{_s(i.named[e])&&(i.named[e]=_ct(i.named[e]))})}function e$t(i,e,t,r,n,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:u}=i,c=u(i,r,t);let h={},p,m=null;const v="translate";for(let w=0;wr;return u.locale=t,u.key=e,u}const l=o(r,QAr(i,t,n,r,a,s));return l.locale=t,l.key=e,l.source=r,l}function ZAr(i,e,t){return e(t)}function I$e(...i){const[e,t,r]=i,n={};if(!_s(e)&&!lg(e)&&!eS(e)&&!tq(e))throw PA(BC.INVALID_ARGUMENT);const s=lg(e)?String(e):(eS(e),e);return lg(t)?n.plural=t:_s(t)?n.default=t:Xa(t)&&!sTe(t)?n.named=t:wd(t)&&(n.list=t),lg(r)?n.plural=r:_s(r)?n.default=r:Xa(r)&&p0(n,r),[s,n]}function QAr(i,e,t,r,n,s){return{locale:e,key:t,warnHtmlMessage:n,onError:o=>{throw s&&s(o),o},onCacheKey:o=>MIr(e,t,o)}}function e3r(i,e,t,r){const{modifiers:n,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:u,fallbackContext:c}=i,p={locale:e,modifiers:n,pluralRules:s,messages:m=>{let v=o(t,m);if(v==null&&c){const[,,w]=e$t(c,m,e,a,l,u);v=o(w,m)}if(_s(v)||tq(v)){let w=!1;const I=t$t(i,m,e,v,m,()=>{w=!0});return w?Fct:I}else return eS(v)?v:Fct}};return i.processor&&(p.processor=i.processor),r.list&&(p.list=r.list),r.named&&(p.named=r.named),lg(r.plural)&&(p.pluralIndex=r.plural),p}function Lct(i,...e){const{datetimeFormats:t,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=i,{__datetimeFormatters:a}=i,[l,u,c,h]=A$e(...e),p=cu(c.missingWarn)?c.missingWarn:i.missingWarn;cu(c.fallbackWarn)?c.fallbackWarn:i.fallbackWarn;const m=!!c.part,v=zqe(i,c),w=o(i,n,v);if(!_s(l)||l==="")return new Intl.DateTimeFormat(v,h).format(u);let S={},I,R=null;const L="datetime format";for(let $=0;${i$t.includes(l)?o[l]=t[l]:s[l]=t[l]}),_s(r)?s.locale=r:Xa(r)&&(o=r),Xa(n)&&(o=n),[s.key||"",a,s,o]}function Nct(i,e,t){const r=i;for(const n in t){const s=`${e}__${n}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function $ct(i,...e){const{numberFormats:t,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=i,{__numberFormatters:a}=i,[l,u,c,h]=M$e(...e),p=cu(c.missingWarn)?c.missingWarn:i.missingWarn;cu(c.fallbackWarn)?c.fallbackWarn:i.fallbackWarn;const m=!!c.part,v=zqe(i,c),w=o(i,n,v);if(!_s(l)||l==="")return new Intl.NumberFormat(v,h).format(u);let S={},I,R=null;const L="number format";for(let $=0;${r$t.includes(l)?o[l]=t[l]:s[l]=t[l]}),_s(r)?s.locale=r:Xa(r)&&(o=r),Xa(n)&&(o=n),[s.key||"",a,s,o]}function Bct(i,e,t){const r=i;for(const n in t){const s=`${e}__${n}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}pAr();/*! + */function cAr(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hP().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hP().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hP().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}const rL=[];rL[0]={w:[0],i:[3,0],"[":[4],o:[7]};rL[1]={w:[1],".":[2],"[":[4],o:[7]};rL[2]={w:[2],i:[3,0],0:[3,0]};rL[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};rL[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};rL[5]={"'":[4,0],o:8,l:[5,0]};rL[6]={'"':[4,0],o:8,l:[6,0]};const hAr=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function dAr(i){return hAr.test(i)}function pAr(i){const e=i.charCodeAt(0),t=i.charCodeAt(i.length-1);return e===t&&(e===34||e===39)?i.slice(1,-1):i}function fAr(i){if(i==null)return"o";switch(i.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return i;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function mAr(i){const e=i.trim();return i.charAt(0)==="0"&&isNaN(parseInt(i))?!1:dAr(e)?pAr(e):"*"+e}function gAr(i){const e=[];let t=-1,r=0,n=0,s,o,a,l,u,c,h;const p=[];p[0]=()=>{o===void 0?o=a:o+=a},p[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},p[2]=()=>{p[0](),n++},p[3]=()=>{if(n>0)n--,r=4,p[0]();else{if(n=0,o===void 0||(o=mAr(o),o===!1))return!1;p[1]()}};function m(){const v=i[t+1];if(r===5&&v==="'"||r===6&&v==='"')return t++,a="\\"+v,p[0](),!0}for(;r!==null;)if(t++,s=i[t],!(s==="\\"&&m())){if(l=fAr(s),h=rL[r],u=h[l]||h.l||8,u===8||(r=u[0],u[1]!==void 0&&(c=p[u[1]],c&&(a=s,c()===!1))))return;if(r===7)return e}}const Tct=new Map;function yAr(i,e){return zc(i)?i[e]:null}function vAr(i,e){if(!zc(i))return null;let t=Tct.get(e);if(t||(t=gAr(e),t&&Tct.set(e,t)),!t)return null;const r=t.length;let n=i,s=0;for(;si,bAr=i=>"",wAr="text",xAr=i=>i.length===0?"":RIr(i),SAr=PIr;function Cct(i,e){return i=Math.abs(i),e===2?i?i>1?1:0:1:i?Math.min(i,2):0}function TAr(i){const e=lg(i.pluralIndex)?i.pluralIndex:-1;return i.named&&(lg(i.named.count)||lg(i.named.n))?lg(i.named.count)?i.named.count:lg(i.named.n)?i.named.n:e:e}function CAr(i,e){e.count||(e.count=i),e.n||(e.n=i)}function EAr(i={}){const e=i.locale,t=TAr(i),r=zc(i.pluralRules)&&_s(e)&&Wh(i.pluralRules[e])?i.pluralRules[e]:Cct,n=zc(i.pluralRules)&&_s(e)&&Wh(i.pluralRules[e])?Cct:void 0,s=I=>I[r(t,I.length,n)],o=i.list||[],a=I=>o[I],l=i.named||{};lg(i.pluralIndex)&&CAr(t,l);const u=I=>l[I];function c(I){const R=Wh(i.messages)?i.messages(I):zc(i.messages)?i.messages[I]:!1;return R||(i.parent?i.parent.message(I):bAr)}const h=I=>i.modifiers?i.modifiers[I]:_Ar,p=Xa(i.processor)&&Wh(i.processor.normalize)?i.processor.normalize:xAr,m=Xa(i.processor)&&Wh(i.processor.interpolate)?i.processor.interpolate:SAr,v=Xa(i.processor)&&_s(i.processor.type)?i.processor.type:wAr,S={list:a,named:u,plural:s,linked:(I,...R)=>{const[L,k]=R;let B="text",$="";R.length===1?zc(L)?($=L.modifier||$,B=L.type||B):_s(L)&&($=L||$):R.length===2&&(_s(L)&&($=L||$),_s(k)&&(B=k||B));const V=c(I)(S),Y=B==="vnode"&&wd(V)&&$?V[0]:V;return $?h($)(Y,B):Y},message:c,type:v,interpolate:m,normalize:p,values:p0({},o,l)};return S}let Sse=null;function IAr(i){Sse=i}function AAr(i,e,t){Sse&&Sse.emit("i18n:init",{timestamp:Date.now(),i18n:i,version:e,meta:t})}const MAr=OAr("function:translate");function OAr(i){return e=>Sse&&Sse.emit(i,e)}const VNt=Gqe.__EXTEND_POINT__,JL=oTe(VNt),PAr={NOT_FOUND_KEY:VNt,FALLBACK_TO_TRANSLATE:JL(),CANNOT_FORMAT_NUMBER:JL(),FALLBACK_TO_NUMBER_FORMAT:JL(),CANNOT_FORMAT_DATE:JL(),FALLBACK_TO_DATE_FORMAT:JL(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:JL(),__EXTEND_POINT__:JL()},HNt=va.__EXTEND_POINT__,KL=oTe(HNt),BC={INVALID_ARGUMENT:HNt,INVALID_DATE_ARGUMENT:KL(),INVALID_ISO_DATE_ARGUMENT:KL(),NOT_SUPPORT_NON_STRING_MESSAGE:KL(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:KL(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:KL(),NOT_SUPPORT_LOCALE_TYPE:KL(),__EXTEND_POINT__:KL()};function PA(i){return KY(i,null,void 0)}function zqe(i,e){return e.locale!=null?Ect(e.locale):Ect(i.locale)}let KMe;function Ect(i){if(_s(i))return i;if(Wh(i)){if(i.resolvedOnce&&KMe!=null)return KMe;if(i.constructor.name==="Function"){const e=i();if(OIr(e))throw PA(BC.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return KMe=e}else throw PA(BC.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw PA(BC.NOT_SUPPORT_LOCALE_TYPE)}function RAr(i,e,t){return[...new Set([t,...wd(e)?e:zc(e)?Object.keys(e):_s(e)?[e]:[t]])]}function WNt(i,e,t){const r=_s(t)?t:eq,n=i;n.__localeChainCache||(n.__localeChainCache=new Map);let s=n.__localeChainCache.get(r);if(!s){s=[];let o=[t];for(;wd(o);)o=Ict(s,o,e);const a=wd(e)||!Xa(e)?e:e.default?e.default:null;o=_s(a)?[a]:a,wd(o)&&Ict(s,o,!1),n.__localeChainCache.set(r,s)}return s}function Ict(i,e,t){let r=!0;for(let n=0;n`${i.charAt(0).toLocaleUpperCase()}${i.substr(1)}`;function LAr(){return{upper:(i,e)=>e==="text"&&_s(i)?i.toUpperCase():e==="vnode"&&zc(i)&&"__v_isVNode"in i?i.children.toUpperCase():i,lower:(i,e)=>e==="text"&&_s(i)?i.toLowerCase():e==="vnode"&&zc(i)&&"__v_isVNode"in i?i.children.toLowerCase():i,capitalize:(i,e)=>e==="text"&&_s(i)?Mct(i):e==="vnode"&&zc(i)&&"__v_isVNode"in i?Mct(i.children):i}}let qNt;function Oct(i){qNt=i}let YNt;function NAr(i){YNt=i}let XNt;function $Ar(i){XNt=i}let JNt=null;const BAr=i=>{JNt=i},jAr=()=>JNt;let KNt=null;const Pct=i=>{KNt=i},GAr=()=>KNt;let Rct=0;function UAr(i={}){const e=Wh(i.onWarn)?i.onWarn:DIr,t=_s(i.version)?i.version:kAr,r=_s(i.locale)||Wh(i.locale)?i.locale:eq,n=Wh(r)?eq:r,s=wd(i.fallbackLocale)||Xa(i.fallbackLocale)||_s(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:n,o=Xa(i.messages)?i.messages:{[n]:{}},a=Xa(i.datetimeFormats)?i.datetimeFormats:{[n]:{}},l=Xa(i.numberFormats)?i.numberFormats:{[n]:{}},u=p0({},i.modifiers||{},LAr()),c=i.pluralRules||{},h=Wh(i.missing)?i.missing:null,p=cu(i.missingWarn)||vk(i.missingWarn)?i.missingWarn:!0,m=cu(i.fallbackWarn)||vk(i.fallbackWarn)?i.fallbackWarn:!0,v=!!i.fallbackFormat,w=!!i.unresolving,S=Wh(i.postTranslation)?i.postTranslation:null,I=Xa(i.processor)?i.processor:null,R=cu(i.warnHtmlMessage)?i.warnHtmlMessage:!0,L=!!i.escapeParameter,k=Wh(i.messageCompiler)?i.messageCompiler:qNt,B=Wh(i.messageResolver)?i.messageResolver:YNt||yAr,$=Wh(i.localeFallbacker)?i.localeFallbacker:XNt||RAr,V=zc(i.fallbackContext)?i.fallbackContext:void 0,Y=i,K=zc(Y.__datetimeFormatters)?Y.__datetimeFormatters:new Map,Q=zc(Y.__numberFormatters)?Y.__numberFormatters:new Map,re=zc(Y.__meta)?Y.__meta:{};Rct++;const ne={version:t,cid:Rct,locale:r,fallbackLocale:s,messages:o,modifiers:u,pluralRules:c,missing:h,missingWarn:p,fallbackWarn:m,fallbackFormat:v,unresolving:w,postTranslation:S,processor:I,warnHtmlMessage:R,escapeParameter:L,messageCompiler:k,messageResolver:B,localeFallbacker:$,fallbackContext:V,onWarn:e,__meta:re};return ne.datetimeFormats=a,ne.numberFormats=l,ne.__datetimeFormatters=K,ne.__numberFormatters=Q,__INTLIFY_PROD_DEVTOOLS__&&AAr(ne,t,re),ne}function Vqe(i,e,t,r,n){const{missing:s,onWarn:o}=i;if(s!==null){const a=s(i,t,e,n);return _s(a)?a:e}else return e}function KJ(i,e,t){const r=i;r.__localeChainCache=new Map,i.localeFallbacker(i,t,e)}function zAr(i,e){return i===e?!1:i.split("-")[0]===e.split("-")[0]}function VAr(i,e){const t=e.indexOf(i);if(t===-1)return!1;for(let r=t+1;rHAr(t,i)}function HAr(i,e){const t=e.b||e.body;if((t.t||t.type)===1){const r=t,n=r.c||r.cases;return i.plural(n.reduce((s,o)=>[...s,Dct(i,o)],[]))}else return Dct(i,t)}function Dct(i,e){const t=e.s||e.static;if(t)return i.type==="text"?t:i.normalize([t]);{const r=(e.i||e.items).reduce((n,s)=>[...n,E$e(i,s)],[]);return i.normalize(r)}}function E$e(i,e){const t=e.t||e.type;switch(t){case 3:{const r=e;return r.v||r.value}case 9:{const r=e;return r.v||r.value}case 4:{const r=e;return i.interpolate(i.named(r.k||r.key))}case 5:{const r=e;return i.interpolate(i.list(r.i!=null?r.i:r.index))}case 6:{const r=e,n=r.m||r.modifier;return i.linked(E$e(i,r.k||r.key),n?E$e(i,n):void 0,i.type)}case 7:{const r=e;return r.v||r.value}case 8:{const r=e;return r.v||r.value}default:throw new Error(`unhandled node type on format message part: ${t}`)}}const ZNt=i=>i;let qz=Object.create(null);const tq=i=>zc(i)&&(i.t===0||i.type===0)&&("b"in i||"body"in i);function QNt(i,e={}){let t=!1;const r=e.onError||jIr;return e.onError=n=>{t=!0,r(n)},{...uAr(i,e),detectError:t}}const WAr=(i,e)=>{if(!_s(i))throw PA(BC.NOT_SUPPORT_NON_STRING_MESSAGE);{cu(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||ZNt)(i),n=qz[r];if(n)return n;const{code:s,detectError:o}=QNt(i,e),a=new Function(`return ${s}`)();return o?a:qz[r]=a}};function qAr(i,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&_s(i)){cu(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||ZNt)(i),n=qz[r];if(n)return n;const{ast:s,detectError:o}=QNt(i,{...e,location:!1,jit:!0}),a=ZMe(s);return o?a:qz[r]=a}else{const t=i.cacheKey;if(t){const r=qz[t];return r||(qz[t]=ZMe(i))}else return ZMe(i)}}const Fct=()=>"",eS=i=>Wh(i);function kct(i,...e){const{fallbackFormat:t,postTranslation:r,unresolving:n,messageCompiler:s,fallbackLocale:o,messages:a}=i,[l,u]=I$e(...e),c=cu(u.missingWarn)?u.missingWarn:i.missingWarn,h=cu(u.fallbackWarn)?u.fallbackWarn:i.fallbackWarn,p=cu(u.escapeParameter)?u.escapeParameter:i.escapeParameter,m=!!u.resolvedMessage,v=_s(u.default)||cu(u.default)?cu(u.default)?s?l:()=>l:u.default:t?s?l:()=>l:"",w=t||v!=="",S=zqe(i,u);p&&YAr(u);let[I,R,L]=m?[l,S,a[S]||{}]:e$t(i,l,S,o,h,c),k=I,B=l;if(!m&&!(_s(k)||tq(k)||eS(k))&&w&&(k=v,B=k),!m&&(!(_s(k)||tq(k)||eS(k))||!_s(R)))return n?aTe:l;let $=!1;const V=()=>{$=!0},Y=eS(k)?k:t$t(i,l,R,k,B,V);if($)return k;const K=KAr(i,R,L,u),Q=EAr(K),re=XAr(i,Y,Q),ne=r?r(re,l):re;if(__INTLIFY_PROD_DEVTOOLS__){const de={timestamp:Date.now(),key:_s(l)?l:eS(k)?k.key:"",locale:R||(eS(k)?k.locale:""),format:_s(k)?k:eS(k)?k.source:"",message:ne};de.meta=p0({},i.__meta,jAr()||{}),MAr(de)}return ne}function YAr(i){wd(i.list)?i.list=i.list.map(e=>_s(e)?_ct(e):e):zc(i.named)&&Object.keys(i.named).forEach(e=>{_s(i.named[e])&&(i.named[e]=_ct(i.named[e]))})}function e$t(i,e,t,r,n,s){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:u}=i,c=u(i,r,t);let h={},p,m=null;const v="translate";for(let w=0;wr;return u.locale=t,u.key=e,u}const l=o(r,JAr(i,t,n,r,a,s));return l.locale=t,l.key=e,l.source=r,l}function XAr(i,e,t){return e(t)}function I$e(...i){const[e,t,r]=i,n={};if(!_s(e)&&!lg(e)&&!eS(e)&&!tq(e))throw PA(BC.INVALID_ARGUMENT);const s=lg(e)?String(e):(eS(e),e);return lg(t)?n.plural=t:_s(t)?n.default=t:Xa(t)&&!sTe(t)?n.named=t:wd(t)&&(n.list=t),lg(r)?n.plural=r:_s(r)?n.default=r:Xa(r)&&p0(n,r),[s,n]}function JAr(i,e,t,r,n,s){return{locale:e,key:t,warnHtmlMessage:n,onError:o=>{throw s&&s(o),o},onCacheKey:o=>EIr(e,t,o)}}function KAr(i,e,t,r){const{modifiers:n,pluralRules:s,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:u,fallbackContext:c}=i,p={locale:e,modifiers:n,pluralRules:s,messages:m=>{let v=o(t,m);if(v==null&&c){const[,,w]=e$t(c,m,e,a,l,u);v=o(w,m)}if(_s(v)||tq(v)){let w=!1;const I=t$t(i,m,e,v,m,()=>{w=!0});return w?Fct:I}else return eS(v)?v:Fct}};return i.processor&&(p.processor=i.processor),r.list&&(p.list=r.list),r.named&&(p.named=r.named),lg(r.plural)&&(p.pluralIndex=r.plural),p}function Lct(i,...e){const{datetimeFormats:t,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=i,{__datetimeFormatters:a}=i,[l,u,c,h]=A$e(...e),p=cu(c.missingWarn)?c.missingWarn:i.missingWarn;cu(c.fallbackWarn)?c.fallbackWarn:i.fallbackWarn;const m=!!c.part,v=zqe(i,c),w=o(i,n,v);if(!_s(l)||l==="")return new Intl.DateTimeFormat(v,h).format(u);let S={},I,R=null;const L="datetime format";for(let $=0;${i$t.includes(l)?o[l]=t[l]:s[l]=t[l]}),_s(r)?s.locale=r:Xa(r)&&(o=r),Xa(n)&&(o=n),[s.key||"",a,s,o]}function Nct(i,e,t){const r=i;for(const n in t){const s=`${e}__${n}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function $ct(i,...e){const{numberFormats:t,unresolving:r,fallbackLocale:n,onWarn:s,localeFallbacker:o}=i,{__numberFormatters:a}=i,[l,u,c,h]=M$e(...e),p=cu(c.missingWarn)?c.missingWarn:i.missingWarn;cu(c.fallbackWarn)?c.fallbackWarn:i.fallbackWarn;const m=!!c.part,v=zqe(i,c),w=o(i,n,v);if(!_s(l)||l==="")return new Intl.NumberFormat(v,h).format(u);let S={},I,R=null;const L="number format";for(let $=0;${r$t.includes(l)?o[l]=t[l]:s[l]=t[l]}),_s(r)?s.locale=r:Xa(r)&&(o=r),Xa(n)&&(o=n),[s.key||"",a,s,o]}function Bct(i,e,t){const r=i;for(const n in t){const s=`${e}__${n}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}cAr();/*! * vue-i18n v9.13.1 * (c) 2024 kazuya kawaguchi * Released under the MIT License. - */const t3r="9.13.1";function i3r(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(hP().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(hP().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hP().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hP().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hP().__INTLIFY_PROD_DEVTOOLS__=!1)}const n$t=FAr.__EXTEND_POINT__,TM=oTe(n$t);TM(),TM(),TM(),TM(),TM(),TM(),TM(),TM(),TM();const s$t=BC.__EXTEND_POINT__,A_=oTe(s$t),bg={UNEXPECTED_RETURN_TYPE:s$t,INVALID_ARGUMENT:A_(),MUST_BE_CALL_SETUP_TOP:A_(),NOT_INSTALLED:A_(),NOT_AVAILABLE_IN_LEGACY_MODE:A_(),REQUIRED_VALUE:A_(),INVALID_VALUE:A_(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:A_(),NOT_INSTALLED_WITH_PROVIDE:A_(),UNEXPECTED_ERROR:A_(),NOT_COMPATIBLE_LEGACY_VUE_I18N:A_(),BRIDGE_SUPPORT_VUE_2_ONLY:A_(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:A_(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:A_(),__EXTEND_POINT__:A_()};function oy(i,...e){return KY(i,null,void 0)}const O$e=iL("__translateVNode"),P$e=iL("__datetimeParts"),R$e=iL("__numberParts"),o$t=iL("__setPluralRules"),a$t=iL("__injectWithOption"),D$e=iL("__dispose");function Tse(i){if(!zc(i))return i;for(const e in i)if(b_e(i,e))if(!e.includes("."))zc(i[e])&&Tse(i[e]);else{const t=e.split("."),r=t.length-1;let n=i,s=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(o[l]=o[l]||{},Age(u,o[l])):Age(u,o)}else _s(a)&&Age(JSON.parse(a),o)}),n==null&&s)for(const a in o)b_e(o,a)&&Tse(o[a]);return o}function l$t(i){return i.type}function u$t(i,e,t){let r=zc(e.messages)?e.messages:{};"__i18nGlobal"in t&&(r=lTe(i.locale.value,{messages:r,__i18n:t.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(s=>{i.mergeLocaleMessage(s,r[s])});{if(zc(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{i.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(zc(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{i.mergeNumberFormat(o,e.numberFormats[o])})}}}function jct(i){return Vn(SR,null,i,0)}const Gct="__INTLIFY_META__",Uct=()=>[],r3r=()=>!1;let zct=0;function Vct(i){return(e,t,r,n)=>i(t,r,Df()||void 0,n)}const n3r=()=>{const i=Df();let e=null;return i&&(e=l$t(i)[Gct])?{[Gct]:e}:null};function Hqe(i={},e){const{__root:t,__injectWithOption:r}=i,n=t===void 0,s=i.flatJson,o=__e?vi:qae,a=!!i.translateExistCompatible;let l=cu(i.inheritLocale)?i.inheritLocale:!0;const u=o(t&&l?t.locale.value:_s(i.locale)?i.locale:eq),c=o(t&&l?t.fallbackLocale.value:_s(i.fallbackLocale)||wd(i.fallbackLocale)||Xa(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:u.value),h=o(lTe(u.value,i)),p=o(Xa(i.datetimeFormats)?i.datetimeFormats:{[u.value]:{}}),m=o(Xa(i.numberFormats)?i.numberFormats:{[u.value]:{}});let v=t?t.missingWarn:cu(i.missingWarn)||vk(i.missingWarn)?i.missingWarn:!0,w=t?t.fallbackWarn:cu(i.fallbackWarn)||vk(i.fallbackWarn)?i.fallbackWarn:!0,S=t?t.fallbackRoot:cu(i.fallbackRoot)?i.fallbackRoot:!0,I=!!i.fallbackFormat,R=Wh(i.missing)?i.missing:null,L=Wh(i.missing)?Vct(i.missing):null,k=Wh(i.postTranslation)?i.postTranslation:null,B=t?t.warnHtmlMessage:cu(i.warnHtmlMessage)?i.warnHtmlMessage:!0,$=!!i.escapeParameter;const V=t?t.modifiers:Xa(i.modifiers)?i.modifiers:{};let Y=i.pluralRules||t&&t.pluralRules,K;K=(()=>{n&&Pct(null);const Me={version:t3r,locale:u.value,fallbackLocale:c.value,messages:h.value,modifiers:V,pluralRules:Y,missing:L===null?void 0:L,missingWarn:v,fallbackWarn:w,fallbackFormat:I,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:B,escapeParameter:$,messageResolver:i.messageResolver,messageCompiler:i.messageCompiler,__meta:{framework:"vue"}};Me.datetimeFormats=p.value,Me.numberFormats=m.value,Me.__datetimeFormatters=Xa(K)?K.__datetimeFormatters:void 0,Me.__numberFormatters=Xa(K)?K.__numberFormatters:void 0;const ht=HAr(Me);return n&&Pct(ht),ht})(),KJ(K,u.value,c.value);function re(){return[u.value,c.value,h.value,p.value,m.value]}const ne=Hr({get:()=>u.value,set:Me=>{u.value=Me,K.locale=u.value}}),de=Hr({get:()=>c.value,set:Me=>{c.value=Me,K.fallbackLocale=c.value,KJ(K,u.value,Me)}}),pe=Hr(()=>h.value),H=Hr(()=>p.value),Z=Hr(()=>m.value);function ae(){return Wh(k)?k:null}function fe(Me){k=Me,K.postTranslation=Me}function be(){return R}function _e(Me){Me!==null&&(L=Vct(Me)),R=Me,K.missing=L}const Ie=(Me,ht,Ht,_t,Fe,Yt)=>{re();let A;try{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=t?VAr():void 0),A=Me(K)}finally{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=void 0)}if(Ht!=="translate exists"&&lg(A)&&A===aTe||Ht==="translate exists"&&!A){const[ue,G]=ht();return t&&S?_t(t):Fe(ue)}else{if(Yt(A))return A;throw oy(bg.UNEXPECTED_RETURN_TYPE)}};function Te(...Me){return Ie(ht=>Reflect.apply(kct,null,[ht,...Me]),()=>I$e(...Me),"translate",ht=>Reflect.apply(ht.t,ht,[...Me]),ht=>ht,ht=>_s(ht))}function Be(...Me){const[ht,Ht,_t]=Me;if(_t&&!zc(_t))throw oy(bg.INVALID_ARGUMENT);return Te(ht,Ht,p0({resolvedMessage:!0},_t||{}))}function Ve(...Me){return Ie(ht=>Reflect.apply(Lct,null,[ht,...Me]),()=>A$e(...Me),"datetime format",ht=>Reflect.apply(ht.d,ht,[...Me]),()=>Act,ht=>_s(ht))}function $e(...Me){return Ie(ht=>Reflect.apply($ct,null,[ht,...Me]),()=>M$e(...Me),"number format",ht=>Reflect.apply(ht.n,ht,[...Me]),()=>Act,ht=>_s(ht))}function tt(Me){return Me.map(ht=>_s(ht)||lg(ht)||cu(ht)?jct(String(ht)):ht)}const Ct={normalize:tt,interpolate:Me=>Me,type:"vnode"};function ot(...Me){return Ie(ht=>{let Ht;const _t=ht;try{_t.processor=Ct,Ht=Reflect.apply(kct,null,[_t,...Me])}finally{_t.processor=null}return Ht},()=>I$e(...Me),"translate",ht=>ht[O$e](...Me),ht=>[jct(ht)],ht=>wd(ht))}function vt(...Me){return Ie(ht=>Reflect.apply($ct,null,[ht,...Me]),()=>M$e(...Me),"number format",ht=>ht[R$e](...Me),Uct,ht=>_s(ht)||wd(ht))}function At(...Me){return Ie(ht=>Reflect.apply(Lct,null,[ht,...Me]),()=>A$e(...Me),"datetime format",ht=>ht[P$e](...Me),Uct,ht=>_s(ht)||wd(ht))}function Je(Me){Y=Me,K.pluralRules=Y}function it(Me,ht){return Ie(()=>{if(!Me)return!1;const Ht=_s(ht)?ht:u.value,_t=st(Ht),Fe=K.messageResolver(_t,Me);return a?Fe!=null:tq(Fe)||eS(Fe)||_s(Fe)},()=>[Me],"translate exists",Ht=>Reflect.apply(Ht.te,Ht,[Me,ht]),r3r,Ht=>cu(Ht))}function Ue(Me){let ht=null;const Ht=WNt(K,c.value,u.value);for(let _t=0;_t{l&&(u.value=Me,K.locale=Me,KJ(K,u.value,c.value))}),rl(t.fallbackLocale,Me=>{l&&(c.value=Me,K.fallbackLocale=Me,KJ(K,u.value,c.value))}));const rt={id:zct,locale:ne,fallbackLocale:de,get inheritLocale(){return l},set inheritLocale(Me){l=Me,Me&&t&&(u.value=t.locale.value,c.value=t.fallbackLocale.value,KJ(K,u.value,c.value))},get availableLocales(){return Object.keys(h.value).sort()},messages:pe,get modifiers(){return V},get pluralRules(){return Y||{}},get isGlobal(){return n},get missingWarn(){return v},set missingWarn(Me){v=Me,K.missingWarn=v},get fallbackWarn(){return w},set fallbackWarn(Me){w=Me,K.fallbackWarn=w},get fallbackRoot(){return S},set fallbackRoot(Me){S=Me},get fallbackFormat(){return I},set fallbackFormat(Me){I=Me,K.fallbackFormat=I},get warnHtmlMessage(){return B},set warnHtmlMessage(Me){B=Me,K.warnHtmlMessage=Me},get escapeParameter(){return $},set escapeParameter(Me){$=Me,K.escapeParameter=Me},t:Te,getLocaleMessage:st,setLocaleMessage:Ze,mergeLocaleMessage:ye,getPostTranslationHandler:ae,setPostTranslationHandler:fe,getMissingHandler:be,setMissingHandler:_e,[o$t]:Je};return rt.datetimeFormats=H,rt.numberFormats=Z,rt.rt=Be,rt.te=it,rt.tm=ct,rt.d=Ve,rt.n=$e,rt.getDateTimeFormat=Ke,rt.setDateTimeFormat=ke,rt.mergeDateTimeFormat=me,rt.getNumberFormat=ie,rt.setNumberFormat=ge,rt.mergeNumberFormat=je,rt[a$t]=r,rt[O$e]=ot,rt[P$e]=At,rt[R$e]=vt,rt}function s3r(i){const e=_s(i.locale)?i.locale:eq,t=_s(i.fallbackLocale)||wd(i.fallbackLocale)||Xa(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:e,r=Wh(i.missing)?i.missing:void 0,n=cu(i.silentTranslationWarn)||vk(i.silentTranslationWarn)?!i.silentTranslationWarn:!0,s=cu(i.silentFallbackWarn)||vk(i.silentFallbackWarn)?!i.silentFallbackWarn:!0,o=cu(i.fallbackRoot)?i.fallbackRoot:!0,a=!!i.formatFallbackMessages,l=Xa(i.modifiers)?i.modifiers:{},u=i.pluralizationRules,c=Wh(i.postTranslation)?i.postTranslation:void 0,h=_s(i.warnHtmlInMessage)?i.warnHtmlInMessage!=="off":!0,p=!!i.escapeParameterHtml,m=cu(i.sync)?i.sync:!0;let v=i.messages;if(Xa(i.sharedMessages)){const $=i.sharedMessages;v=Object.keys($).reduce((Y,K)=>{const Q=Y[K]||(Y[K]={});return p0(Q,$[K]),Y},v||{})}const{__i18n:w,__root:S,__injectWithOption:I}=i,R=i.datetimeFormats,L=i.numberFormats,k=i.flatJson,B=i.translateExistCompatible;return{locale:e,fallbackLocale:t,messages:v,flatJson:k,datetimeFormats:R,numberFormats:L,missing:r,missingWarn:n,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:h,escapeParameter:p,messageResolver:i.messageResolver,inheritLocale:m,translateExistCompatible:B,__i18n:w,__root:S,__injectWithOption:I}}function F$e(i={},e){{const t=Hqe(s3r(i)),{__extender:r}=i,n={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return cu(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=cu(s)?!s:s},get silentFallbackWarn(){return cu(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=cu(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){const[o,a,l]=s,u={};let c=null,h=null;if(!_s(o))throw oy(bg.INVALID_ARGUMENT);const p=o;return _s(a)?u.locale=a:wd(a)?c=a:Xa(a)&&(h=a),wd(l)?c=l:Xa(l)&&(h=l),Reflect.apply(t.t,t,[p,c||h||{},u])},rt(...s){return Reflect.apply(t.rt,t,[...s])},tc(...s){const[o,a,l]=s,u={plural:1};let c=null,h=null;if(!_s(o))throw oy(bg.INVALID_ARGUMENT);const p=o;return _s(a)?u.locale=a:lg(a)?u.plural=a:wd(a)?c=a:Xa(a)&&(h=a),_s(l)?u.locale=l:wd(l)?c=l:Xa(l)&&(h=l),Reflect.apply(t.t,t,[p,c||h||{},u])},te(s,o){return t.te(s,o)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,o){t.setLocaleMessage(s,o)},mergeLocaleMessage(s,o){t.mergeLocaleMessage(s,o)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,o){t.setDateTimeFormat(s,o)},mergeDateTimeFormat(s,o){t.mergeDateTimeFormat(s,o)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,o){t.setNumberFormat(s,o)},mergeNumberFormat(s,o){t.mergeNumberFormat(s,o)},getChoiceIndex(s,o){return-1}};return n.__extender=r,n}}const Wqe={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:i=>i==="parent"||i==="global",default:"parent"},i18n:{type:Object}};function o3r({slots:i},e){return e.length===1&&e[0]==="default"?(i.default?i.default():[]).reduce((r,n)=>[...r,...n.type===Ks?n.children:[n]],[]):e.reduce((t,r)=>{const n=i[r];return n&&(t[r]=n()),t},{})}function c$t(i){return Ks}const a3r=Xr({name:"i18n-t",props:p0({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:i=>lg(i)||!isNaN(i)}},Wqe),setup(i,e){const{slots:t,attrs:r}=e,n=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return()=>{const s=Object.keys(t).filter(h=>h!=="_"),o={};i.locale&&(o.locale=i.locale),i.plural!==void 0&&(o.plural=_s(i.plural)?+i.plural:i.plural);const a=o3r(e,s),l=n[O$e](i.keypath,a,o),u=p0({},r),c=_s(i.tag)||zc(i.tag)?i.tag:c$t();return dx(c,u,l)}}}),Hct=a3r;function l3r(i){return wd(i)&&!_s(i[0])}function h$t(i,e,t,r){const{slots:n,attrs:s}=e;return()=>{const o={part:!0};let a={};i.locale&&(o.locale=i.locale),_s(i.format)?o.key=i.format:zc(i.format)&&(_s(i.format.key)&&(o.key=i.format.key),a=Object.keys(i.format).reduce((p,m)=>t.includes(m)?p0({},p,{[m]:i.format[m]}):p,{}));const l=r(i.value,o,a);let u=[o.key];wd(l)?u=l.map((p,m)=>{const v=n[p.type],w=v?v({[p.type]:p.value,index:m,parts:l}):[p.value];return l3r(w)&&(w[0].key=`${p.type}-${m}`),w}):_s(l)&&(u=[l]);const c=p0({},s),h=_s(i.tag)||zc(i.tag)?i.tag:c$t();return dx(h,c,u)}}const u3r=Xr({name:"i18n-n",props:p0({value:{type:Number,required:!0},format:{type:[String,Object]}},Wqe),setup(i,e){const t=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return h$t(i,e,r$t,(...r)=>t[R$e](...r))}}),Wct=u3r,c3r=Xr({name:"i18n-d",props:p0({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Wqe),setup(i,e){const t=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return h$t(i,e,i$t,(...r)=>t[P$e](...r))}}),qct=c3r;function h3r(i,e){const t=i;if(i.mode==="composition")return t.__getInstance(e)||i.global;{const r=t.__getInstance(e);return r!=null?r.__composer:i.global.__composer}}function d3r(i){const e=o=>{const{instance:a,modifiers:l,value:u}=o;if(!a||!a.$)throw oy(bg.UNEXPECTED_ERROR);const c=h3r(i,a.$),h=Yct(u);return[Reflect.apply(c.t,c,[...Xct(h)]),c]};return{created:(o,a)=>{const[l,u]=e(a);__e&&i.global===u&&(o.__i18nWatcher=rl(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=u,o.textContent=l},unmounted:o=>{__e&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,u=Yct(a);o.textContent=Reflect.apply(l.t,l,[...Xct(u)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Yct(i){if(_s(i))return{path:i};if(Xa(i)){if(!("path"in i))throw oy(bg.REQUIRED_VALUE,"path");return i}else throw oy(bg.INVALID_VALUE)}function Xct(i){const{path:e,locale:t,args:r,choice:n,plural:s}=i,o={},a=r||{};return _s(t)&&(o.locale=t),lg(n)&&(o.plural=n),lg(s)&&(o.plural=s),[e,a,o]}function p3r(i,e,...t){const r=Xa(t[0])?t[0]:{},n=!!r.useI18nComponentName;(cu(r.globalInstall)?r.globalInstall:!0)&&([n?"i18n":Hct.name,"I18nT"].forEach(o=>i.component(o,Hct)),[Wct.name,"I18nN"].forEach(o=>i.component(o,Wct)),[qct.name,"I18nD"].forEach(o=>i.component(o,qct))),i.directive("t",d3r(e))}function f3r(i,e,t){return{beforeCreate(){const r=Df();if(!r)throw oy(bg.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const s=n.i18n;if(n.__i18n&&(s.__i18n=n.__i18n),s.__root=e,this===this.$root)this.$i18n=Jct(i,s);else{s.__injectWithOption=!0,s.__extender=t.__vueI18nExtend,this.$i18n=F$e(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Jct(i,n);else{this.$i18n=F$e({__i18n:n.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=i;n.__i18nGlobal&&u$t(e,n,n),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),t.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Df();if(!r)throw oy(bg.UNEXPECTED_ERROR);const n=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),t.__deleteInstance(r),delete this.$i18n}}}function Jct(i,e){i.locale=e.locale||i.locale,i.fallbackLocale=e.fallbackLocale||i.fallbackLocale,i.missing=e.missing||i.missing,i.silentTranslationWarn=e.silentTranslationWarn||i.silentFallbackWarn,i.silentFallbackWarn=e.silentFallbackWarn||i.silentFallbackWarn,i.formatFallbackMessages=e.formatFallbackMessages||i.formatFallbackMessages,i.postTranslation=e.postTranslation||i.postTranslation,i.warnHtmlInMessage=e.warnHtmlInMessage||i.warnHtmlInMessage,i.escapeParameterHtml=e.escapeParameterHtml||i.escapeParameterHtml,i.sync=e.sync||i.sync,i.__composer[o$t](e.pluralizationRules||i.pluralizationRules);const t=lTe(i.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(r=>i.mergeLocaleMessage(r,t[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>i.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>i.mergeNumberFormat(r,e.numberFormats[r])),i}const m3r=iL("global-vue-i18n");function g3r(i={},e){const t=__VUE_I18N_LEGACY_API__&&cu(i.legacy)?i.legacy:__VUE_I18N_LEGACY_API__,r=cu(i.globalInjection)?i.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&t?!!i.allowComposition:!0,s=new Map,[o,a]=y3r(i,t),l=iL("");function u(p){return s.get(p)||null}function c(p,m){s.set(p,m)}function h(p){s.delete(p)}{const p={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},get allowComposition(){return n},async install(m,...v){if(m.__VUE_I18N_SYMBOL__=l,m.provide(m.__VUE_I18N_SYMBOL__,p),Xa(v[0])){const I=v[0];p.__composerExtend=I.__composerExtend,p.__vueI18nExtend=I.__vueI18nExtend}let w=null;!t&&r&&(w=E3r(m,p.global)),__VUE_I18N_FULL_INSTALL__&&p3r(m,p,...v),__VUE_I18N_LEGACY_API__&&t&&m.mixin(f3r(a,a.__composer,p));const S=m.unmount;m.unmount=()=>{w&&w(),p.dispose(),S()}},get global(){return a},dispose(){o.stop()},__instances:s,__getInstance:u,__setInstance:c,__deleteInstance:h};return p}}function Qn(i={}){const e=Df();if(e==null)throw oy(bg.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw oy(bg.NOT_INSTALLED);const t=v3r(e),r=b3r(t),n=l$t(e),s=_3r(i,n);if(__VUE_I18N_LEGACY_API__&&t.mode==="legacy"&&!i.__useComponent){if(!t.allowComposition)throw oy(bg.NOT_AVAILABLE_IN_LEGACY_MODE);return T3r(e,s,r,i)}if(s==="global")return u$t(r,i,n),r;if(s==="parent"){let l=w3r(t,e,i.__useComponent);return l==null&&(l=r),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=p0({},i);"__i18n"in n&&(l.__i18n=n.__i18n),r&&(l.__root=r),a=Hqe(l),o.__composerExtend&&(a[D$e]=o.__composerExtend(a)),S3r(o,e,a),o.__setInstance(e,a)}return a}function y3r(i,e,t){const r=Wae();{const n=__VUE_I18N_LEGACY_API__&&e?r.run(()=>F$e(i)):r.run(()=>Hqe(i));if(n==null)throw oy(bg.UNEXPECTED_ERROR);return[r,n]}}function v3r(i){{const e=eo(i.isCE?m3r:i.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw oy(i.isCE?bg.NOT_INSTALLED_WITH_PROVIDE:bg.UNEXPECTED_ERROR);return e}}function _3r(i,e){return sTe(i)?"__i18n"in e?"local":"global":i.useScope?i.useScope:"local"}function b3r(i){return i.mode==="composition"?i.global:i.global.__composer}function w3r(i,e,t=!1){let r=null;const n=e.root;let s=x3r(e,t);for(;s!=null;){const o=i;if(i.mode==="composition")r=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(r=a.__composer,t&&r&&!r[a$t]&&(r=null))}if(r!=null||n===s)break;s=s.parent}return r}function x3r(i,e=!1){return i==null?null:e&&i.vnode.ctx||i.parent}function S3r(i,e,t){Fa(()=>{},e),s7(()=>{const r=t;i.__deleteInstance(e);const n=r[D$e];n&&(n(),delete r[D$e])},e)}function T3r(i,e,t,r={}){const n=e==="local",s=qae(null);if(n&&i.proxy&&!(i.proxy.$options.i18n||i.proxy.$options.__i18n))throw oy(bg.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=cu(r.inheritLocale)?r.inheritLocale:!_s(r.locale),a=vi(!n||o?t.locale.value:_s(r.locale)?r.locale:eq),l=vi(!n||o?t.fallbackLocale.value:_s(r.fallbackLocale)||wd(r.fallbackLocale)||Xa(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),u=vi(lTe(a.value,r)),c=vi(Xa(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),h=vi(Xa(r.numberFormats)?r.numberFormats:{[a.value]:{}}),p=n?t.missingWarn:cu(r.missingWarn)||vk(r.missingWarn)?r.missingWarn:!0,m=n?t.fallbackWarn:cu(r.fallbackWarn)||vk(r.fallbackWarn)?r.fallbackWarn:!0,v=n?t.fallbackRoot:cu(r.fallbackRoot)?r.fallbackRoot:!0,w=!!r.fallbackFormat,S=Wh(r.missing)?r.missing:null,I=Wh(r.postTranslation)?r.postTranslation:null,R=n?t.warnHtmlMessage:cu(r.warnHtmlMessage)?r.warnHtmlMessage:!0,L=!!r.escapeParameter,k=n?t.modifiers:Xa(r.modifiers)?r.modifiers:{},B=r.pluralRules||n&&t.pluralRules;function $(){return[a.value,l.value,u.value,c.value,h.value]}const V=Hr({get:()=>s.value?s.value.locale.value:a.value,set:Ue=>{s.value&&(s.value.locale.value=Ue),a.value=Ue}}),Y=Hr({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:Ue=>{s.value&&(s.value.fallbackLocale.value=Ue),l.value=Ue}}),K=Hr(()=>s.value?s.value.messages.value:u.value),Q=Hr(()=>c.value),re=Hr(()=>h.value);function ne(){return s.value?s.value.getPostTranslationHandler():I}function de(Ue){s.value&&s.value.setPostTranslationHandler(Ue)}function pe(){return s.value?s.value.getMissingHandler():S}function H(Ue){s.value&&s.value.setMissingHandler(Ue)}function Z(Ue){return $(),Ue()}function ae(...Ue){return s.value?Z(()=>Reflect.apply(s.value.t,null,[...Ue])):Z(()=>"")}function fe(...Ue){return s.value?Reflect.apply(s.value.rt,null,[...Ue]):""}function be(...Ue){return s.value?Z(()=>Reflect.apply(s.value.d,null,[...Ue])):Z(()=>"")}function _e(...Ue){return s.value?Z(()=>Reflect.apply(s.value.n,null,[...Ue])):Z(()=>"")}function Ie(Ue){return s.value?s.value.tm(Ue):{}}function Te(Ue,ct){return s.value?s.value.te(Ue,ct):!1}function Be(Ue){return s.value?s.value.getLocaleMessage(Ue):{}}function Ve(Ue,ct){s.value&&(s.value.setLocaleMessage(Ue,ct),u.value[Ue]=ct)}function $e(Ue,ct){s.value&&s.value.mergeLocaleMessage(Ue,ct)}function tt(Ue){return s.value?s.value.getDateTimeFormat(Ue):{}}function yt(Ue,ct){s.value&&(s.value.setDateTimeFormat(Ue,ct),c.value[Ue]=ct)}function Ct(Ue,ct){s.value&&s.value.mergeDateTimeFormat(Ue,ct)}function ot(Ue){return s.value?s.value.getNumberFormat(Ue):{}}function vt(Ue,ct){s.value&&(s.value.setNumberFormat(Ue,ct),h.value[Ue]=ct)}function At(Ue,ct){s.value&&s.value.mergeNumberFormat(Ue,ct)}const Je={get id(){return s.value?s.value.id:-1},locale:V,fallbackLocale:Y,messages:K,datetimeFormats:Q,numberFormats:re,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(Ue){s.value&&(s.value.inheritLocale=Ue)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(u.value)},get modifiers(){return s.value?s.value.modifiers:k},get pluralRules(){return s.value?s.value.pluralRules:B},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:p},set missingWarn(Ue){s.value&&(s.value.missingWarn=Ue)},get fallbackWarn(){return s.value?s.value.fallbackWarn:m},set fallbackWarn(Ue){s.value&&(s.value.missingWarn=Ue)},get fallbackRoot(){return s.value?s.value.fallbackRoot:v},set fallbackRoot(Ue){s.value&&(s.value.fallbackRoot=Ue)},get fallbackFormat(){return s.value?s.value.fallbackFormat:w},set fallbackFormat(Ue){s.value&&(s.value.fallbackFormat=Ue)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:R},set warnHtmlMessage(Ue){s.value&&(s.value.warnHtmlMessage=Ue)},get escapeParameter(){return s.value?s.value.escapeParameter:L},set escapeParameter(Ue){s.value&&(s.value.escapeParameter=Ue)},t:ae,getPostTranslationHandler:ne,setPostTranslationHandler:de,getMissingHandler:pe,setMissingHandler:H,rt:fe,d:be,n:_e,tm:Ie,te:Te,getLocaleMessage:Be,setLocaleMessage:Ve,mergeLocaleMessage:$e,getDateTimeFormat:tt,setDateTimeFormat:yt,mergeDateTimeFormat:Ct,getNumberFormat:ot,setNumberFormat:vt,mergeNumberFormat:At};function it(Ue){Ue.locale.value=a.value,Ue.fallbackLocale.value=l.value,Object.keys(u.value).forEach(ct=>{Ue.mergeLocaleMessage(ct,u.value[ct])}),Object.keys(c.value).forEach(ct=>{Ue.mergeDateTimeFormat(ct,c.value[ct])}),Object.keys(h.value).forEach(ct=>{Ue.mergeNumberFormat(ct,h.value[ct])}),Ue.escapeParameter=L,Ue.fallbackFormat=w,Ue.fallbackRoot=v,Ue.fallbackWarn=m,Ue.missingWarn=p,Ue.warnHtmlMessage=R}return E0(()=>{if(i.proxy==null||i.proxy.$i18n==null)throw oy(bg.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Ue=s.value=i.proxy.$i18n.__composer;e==="global"?(a.value=Ue.locale.value,l.value=Ue.fallbackLocale.value,u.value=Ue.messages.value,c.value=Ue.datetimeFormats.value,h.value=Ue.numberFormats.value):n&&it(Ue)}),Je}const C3r=["locale","fallbackLocale","availableLocales"],Kct=["t","rt","d","n","tm","te"];function E3r(i,e){const t=Object.create(null);return C3r.forEach(n=>{const s=Object.getOwnPropertyDescriptor(e,n);if(!s)throw oy(bg.UNEXPECTED_ERROR);const o=Wu(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(t,n,o)}),i.config.globalProperties.$i18n=t,Kct.forEach(n=>{const s=Object.getOwnPropertyDescriptor(e,n);if(!s||!s.value)throw oy(bg.UNEXPECTED_ERROR);Object.defineProperty(i.config.globalProperties,`$${n}`,s)}),()=>{delete i.config.globalProperties.$i18n,Kct.forEach(n=>{delete i.config.globalProperties[`$${n}`]})}}i3r();__INTLIFY_JIT_COMPILATION__?Oct(JAr):Oct(XAr);jAr(wAr);GAr(WNt);if(__INTLIFY_PROD_DEVTOOLS__){const i=hP();i.__INTLIFY__=!0,OAr(i.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const I3r={en:{"lang-code":"en","lang-dir":"ltr","lang-en":"English","lang-fr":"anglais","lang-native":"English","ramp.about.open":"Open About RAMP","ramp.about":"About RAMP","keyboardInstructions.title":"Keyboard Instructions","keyboardInstructions.open":"Open keyboard instructions","keyboardInstructions.app":"Use 'Tab' to navigate between sections of the application.","keyboardInstructions.lists":"Use the arrow keys to move between items in lists. With a list item selected you can press 'Space' or 'Enter' to click the item. You can also navigate within the list item using 'Tab'.","keyboardInstructions.map":"When the map is selected, use the arrow keys to move around and 'Enter' to select a point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Switch to metric map scale","map.toggleScaleToImperial":"Switch to imperial map scale","map.coordinates.east":"E","map.coordinates.west":"W","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Change Language","map.language.short":"EN-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"current","map.export":"export map","notifications.open":"Open Notifications Panel","notifications.title":"Notifications","notifications.empty":"No new notifications.","notifications.controls.dismiss":"Dismiss","notifications.controls.expand":"Expand","notifications.controls.collapse":"Collapse","notifications.controls.clearAll":"Clear All","panels.access":"Press enter or space to access the panel","panels.controls.close":"Close","panels.controls.pin":"Pin","panels.controls.unpin":"Unpin","panels.controls.back":"Back","panels.controls.optionsMenu":"More","panels.controls.minimize":"Minimize","panels.controls.expand":"Expand","panels.controls.collapse":"Collapse","panels.controls.moveRight":"Move Right","panels.controls.moveLeft":"Move Left","panels.controls.items":"Use the arrow keys to navigate the items","panels.alert.open":"{name} panel opened","panels.alert.close":"{name} panel closed","panels.alert.minimize":"{name} panel minimized","layer.error":"{id} failed to load","layer.longload":"{id} is taking longer than expected to load","layer.longdraw":"{id} is taking longer than expected to draw","layer.mismatch":"{name} cannot be displayed in the current projection","layer.filtersdisabled":"Filters have been disabled for {name}","layer.filterwarning":"You are attempting to use a grid that contains unmodifiable layers. Filtering will be partially disabled.","layer.noexportmap":"{name} was attempted to be added as a Map Image Layer but Map Export is not enabled for the service","caption.attributionDefaultText":"Powered by ESRI","caption.attributionLogoAltText":"ESRI logo","caption.attributionLink":"https://www.esri.com/"},fr:{"lang-code":"fr","lang-dir":"ltr","lang-en":"French","lang-fr":"français","lang-native":"Français","ramp.about.open":"Ouvrir À propos de PCAR","ramp.about":"À propos de PCAR","keyboardInstructions.title":"Instructions clavier","keyboardInstructions.open":"Instructions clavier ouvert","keyboardInstructions.app":"Utilisez la touche Tab pour vous déplacer entre les sections de l'application.","keyboardInstructions.lists":"Lorsqu'un élément de la liste est sélectionné, vous pouvez appuyer sur « Espace » ou « Entrée » pour cliquer sur l'élément. Vous pouvez également vous déplacer au sein de l'élément de la liste au moyen de la touche « Tab ».","keyboardInstructions.map":"Lorsque la carte est sélectionnée, utilisez le pavé curseur pour vous déplacer et appuyez sur « Entrée » pour sélectionner un point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Passer à l'échelle métrique","map.toggleScaleToImperial":"Passer à l'échelle impériale","map.coordinates.east":"E","map.coordinates.west":"O","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Changer de langue","map.language.short":"FR-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"actuel","map.export":"exporter la carte","notifications.open":"Ouvrir la fenêtre des notifications","notifications.title":"Notifications","notifications.empty":"Aucune nouvelle notification.","notifications.controls.dismiss":"Rejeter","notifications.controls.expand":"Développer","notifications.controls.collapse":"Réduire","notifications.controls.clearAll":"Effacer tout","panels.access":"Appuyez sur Entrée ou sur la barre d'espacement pour accéder au panneau","panels.controls.close":"Fermer","panels.controls.pin":"Épingler","panels.controls.unpin":"Désépingler","panels.controls.back":"Retour","panels.controls.optionsMenu":"Plus","panels.controls.minimize":"Réduire","panels.controls.expand":"Développer","panels.controls.collapse":"Réduire","panels.controls.moveRight":"Aller à droite","panels.controls.moveLeft":"Aller à gauche","panels.controls.items":"Utilisez les touches fléchées pour naviguer entre les éléments","panels.alert.open":"Fenêtre {name} ouverte","panels.alert.close":"Fenêtre {name} fermée","panels.alert.minimize":"Fenêtre {name} réduite","layer.error":"Échec du chargement de {id}","layer.longload":"Le chargement de {id} met plus de temps que prévu","layer.longdraw":"{id} prend plus de temps que prévu à extraire","layer.mismatch":"{id} ne peut pas s'afficher dans la projection actuelle","layer.filtersdisabled":"Les filtres ont été désactivés pour {name}","layer.filterwarning":"Vous essayez d'utiliser une grille qui contient des couches non modifiables. Le filtrage sera partiellement désactivé.","layer.noexportmap":"La tentative d’ajouter {name} comme couche d’imagerie cartographique a échouée car elle n’a pu être activé pour ce service","caption.attributionDefaultText":"Propulsé par ESRI","caption.attributionLogoAltText":"Logo ESRI","caption.attributionLink":"https://www.esri.com/fr-fr/home"}},Zct="en",A3r={en:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}},fr:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}}};function M3r(){return g3r({legacy:!1,locale:document.documentElement.getAttribute("lang")||Zct,fallbackLocale:Zct,globalInjection:!0,messages:I3r,numberFormats:A3r})}var d$t={exports:{}};/*! + */const ZAr="9.13.1";function QAr(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(hP().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(hP().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(hP().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(hP().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(hP().__INTLIFY_PROD_DEVTOOLS__=!1)}const n$t=PAr.__EXTEND_POINT__,TM=oTe(n$t);TM(),TM(),TM(),TM(),TM(),TM(),TM(),TM(),TM();const s$t=BC.__EXTEND_POINT__,A_=oTe(s$t),bg={UNEXPECTED_RETURN_TYPE:s$t,INVALID_ARGUMENT:A_(),MUST_BE_CALL_SETUP_TOP:A_(),NOT_INSTALLED:A_(),NOT_AVAILABLE_IN_LEGACY_MODE:A_(),REQUIRED_VALUE:A_(),INVALID_VALUE:A_(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:A_(),NOT_INSTALLED_WITH_PROVIDE:A_(),UNEXPECTED_ERROR:A_(),NOT_COMPATIBLE_LEGACY_VUE_I18N:A_(),BRIDGE_SUPPORT_VUE_2_ONLY:A_(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:A_(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:A_(),__EXTEND_POINT__:A_()};function oy(i,...e){return KY(i,null,void 0)}const O$e=iL("__translateVNode"),P$e=iL("__datetimeParts"),R$e=iL("__numberParts"),o$t=iL("__setPluralRules"),a$t=iL("__injectWithOption"),D$e=iL("__dispose");function Tse(i){if(!zc(i))return i;for(const e in i)if(b_e(i,e))if(!e.includes("."))zc(i[e])&&Tse(i[e]);else{const t=e.split("."),r=t.length-1;let n=i,s=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(o[l]=o[l]||{},Age(u,o[l])):Age(u,o)}else _s(a)&&Age(JSON.parse(a),o)}),n==null&&s)for(const a in o)b_e(o,a)&&Tse(o[a]);return o}function l$t(i){return i.type}function u$t(i,e,t){let r=zc(e.messages)?e.messages:{};"__i18nGlobal"in t&&(r=lTe(i.locale.value,{messages:r,__i18n:t.__i18nGlobal}));const n=Object.keys(r);n.length&&n.forEach(s=>{i.mergeLocaleMessage(s,r[s])});{if(zc(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{i.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(zc(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{i.mergeNumberFormat(o,e.numberFormats[o])})}}}function jct(i){return Vn(SR,null,i,0)}const Gct="__INTLIFY_META__",Uct=()=>[],e3r=()=>!1;let zct=0;function Vct(i){return(e,t,r,n)=>i(t,r,Df()||void 0,n)}const t3r=()=>{const i=Df();let e=null;return i&&(e=l$t(i)[Gct])?{[Gct]:e}:null};function Hqe(i={},e){const{__root:t,__injectWithOption:r}=i,n=t===void 0,s=i.flatJson,o=__e?vi:qae,a=!!i.translateExistCompatible;let l=cu(i.inheritLocale)?i.inheritLocale:!0;const u=o(t&&l?t.locale.value:_s(i.locale)?i.locale:eq),c=o(t&&l?t.fallbackLocale.value:_s(i.fallbackLocale)||wd(i.fallbackLocale)||Xa(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:u.value),h=o(lTe(u.value,i)),p=o(Xa(i.datetimeFormats)?i.datetimeFormats:{[u.value]:{}}),m=o(Xa(i.numberFormats)?i.numberFormats:{[u.value]:{}});let v=t?t.missingWarn:cu(i.missingWarn)||vk(i.missingWarn)?i.missingWarn:!0,w=t?t.fallbackWarn:cu(i.fallbackWarn)||vk(i.fallbackWarn)?i.fallbackWarn:!0,S=t?t.fallbackRoot:cu(i.fallbackRoot)?i.fallbackRoot:!0,I=!!i.fallbackFormat,R=Wh(i.missing)?i.missing:null,L=Wh(i.missing)?Vct(i.missing):null,k=Wh(i.postTranslation)?i.postTranslation:null,B=t?t.warnHtmlMessage:cu(i.warnHtmlMessage)?i.warnHtmlMessage:!0,$=!!i.escapeParameter;const V=t?t.modifiers:Xa(i.modifiers)?i.modifiers:{};let Y=i.pluralRules||t&&t.pluralRules,K;K=(()=>{n&&Pct(null);const Me={version:ZAr,locale:u.value,fallbackLocale:c.value,messages:h.value,modifiers:V,pluralRules:Y,missing:L===null?void 0:L,missingWarn:v,fallbackWarn:w,fallbackFormat:I,unresolving:!0,postTranslation:k===null?void 0:k,warnHtmlMessage:B,escapeParameter:$,messageResolver:i.messageResolver,messageCompiler:i.messageCompiler,__meta:{framework:"vue"}};Me.datetimeFormats=p.value,Me.numberFormats=m.value,Me.__datetimeFormatters=Xa(K)?K.__datetimeFormatters:void 0,Me.__numberFormatters=Xa(K)?K.__numberFormatters:void 0;const ht=UAr(Me);return n&&Pct(ht),ht})(),KJ(K,u.value,c.value);function re(){return[u.value,c.value,h.value,p.value,m.value]}const ne=Hr({get:()=>u.value,set:Me=>{u.value=Me,K.locale=u.value}}),de=Hr({get:()=>c.value,set:Me=>{c.value=Me,K.fallbackLocale=c.value,KJ(K,u.value,Me)}}),pe=Hr(()=>h.value),H=Hr(()=>p.value),Z=Hr(()=>m.value);function ae(){return Wh(k)?k:null}function fe(Me){k=Me,K.postTranslation=Me}function be(){return R}function _e(Me){Me!==null&&(L=Vct(Me)),R=Me,K.missing=L}const Ie=(Me,ht,Ht,_t,Fe,Yt)=>{re();let A;try{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=t?GAr():void 0),A=Me(K)}finally{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=void 0)}if(Ht!=="translate exists"&&lg(A)&&A===aTe||Ht==="translate exists"&&!A){const[ue,G]=ht();return t&&S?_t(t):Fe(ue)}else{if(Yt(A))return A;throw oy(bg.UNEXPECTED_RETURN_TYPE)}};function Te(...Me){return Ie(ht=>Reflect.apply(kct,null,[ht,...Me]),()=>I$e(...Me),"translate",ht=>Reflect.apply(ht.t,ht,[...Me]),ht=>ht,ht=>_s(ht))}function Be(...Me){const[ht,Ht,_t]=Me;if(_t&&!zc(_t))throw oy(bg.INVALID_ARGUMENT);return Te(ht,Ht,p0({resolvedMessage:!0},_t||{}))}function Ve(...Me){return Ie(ht=>Reflect.apply(Lct,null,[ht,...Me]),()=>A$e(...Me),"datetime format",ht=>Reflect.apply(ht.d,ht,[...Me]),()=>Act,ht=>_s(ht))}function $e(...Me){return Ie(ht=>Reflect.apply($ct,null,[ht,...Me]),()=>M$e(...Me),"number format",ht=>Reflect.apply(ht.n,ht,[...Me]),()=>Act,ht=>_s(ht))}function tt(Me){return Me.map(ht=>_s(ht)||lg(ht)||cu(ht)?jct(String(ht)):ht)}const Ct={normalize:tt,interpolate:Me=>Me,type:"vnode"};function ot(...Me){return Ie(ht=>{let Ht;const _t=ht;try{_t.processor=Ct,Ht=Reflect.apply(kct,null,[_t,...Me])}finally{_t.processor=null}return Ht},()=>I$e(...Me),"translate",ht=>ht[O$e](...Me),ht=>[jct(ht)],ht=>wd(ht))}function vt(...Me){return Ie(ht=>Reflect.apply($ct,null,[ht,...Me]),()=>M$e(...Me),"number format",ht=>ht[R$e](...Me),Uct,ht=>_s(ht)||wd(ht))}function At(...Me){return Ie(ht=>Reflect.apply(Lct,null,[ht,...Me]),()=>A$e(...Me),"datetime format",ht=>ht[P$e](...Me),Uct,ht=>_s(ht)||wd(ht))}function Je(Me){Y=Me,K.pluralRules=Y}function it(Me,ht){return Ie(()=>{if(!Me)return!1;const Ht=_s(ht)?ht:u.value,_t=st(Ht),Fe=K.messageResolver(_t,Me);return a?Fe!=null:tq(Fe)||eS(Fe)||_s(Fe)},()=>[Me],"translate exists",Ht=>Reflect.apply(Ht.te,Ht,[Me,ht]),e3r,Ht=>cu(Ht))}function Ue(Me){let ht=null;const Ht=WNt(K,c.value,u.value);for(let _t=0;_t{l&&(u.value=Me,K.locale=Me,KJ(K,u.value,c.value))}),rl(t.fallbackLocale,Me=>{l&&(c.value=Me,K.fallbackLocale=Me,KJ(K,u.value,c.value))}));const rt={id:zct,locale:ne,fallbackLocale:de,get inheritLocale(){return l},set inheritLocale(Me){l=Me,Me&&t&&(u.value=t.locale.value,c.value=t.fallbackLocale.value,KJ(K,u.value,c.value))},get availableLocales(){return Object.keys(h.value).sort()},messages:pe,get modifiers(){return V},get pluralRules(){return Y||{}},get isGlobal(){return n},get missingWarn(){return v},set missingWarn(Me){v=Me,K.missingWarn=v},get fallbackWarn(){return w},set fallbackWarn(Me){w=Me,K.fallbackWarn=w},get fallbackRoot(){return S},set fallbackRoot(Me){S=Me},get fallbackFormat(){return I},set fallbackFormat(Me){I=Me,K.fallbackFormat=I},get warnHtmlMessage(){return B},set warnHtmlMessage(Me){B=Me,K.warnHtmlMessage=Me},get escapeParameter(){return $},set escapeParameter(Me){$=Me,K.escapeParameter=Me},t:Te,getLocaleMessage:st,setLocaleMessage:Ze,mergeLocaleMessage:ye,getPostTranslationHandler:ae,setPostTranslationHandler:fe,getMissingHandler:be,setMissingHandler:_e,[o$t]:Je};return rt.datetimeFormats=H,rt.numberFormats=Z,rt.rt=Be,rt.te=it,rt.tm=ct,rt.d=Ve,rt.n=$e,rt.getDateTimeFormat=Ke,rt.setDateTimeFormat=ke,rt.mergeDateTimeFormat=me,rt.getNumberFormat=ie,rt.setNumberFormat=ge,rt.mergeNumberFormat=je,rt[a$t]=r,rt[O$e]=ot,rt[P$e]=At,rt[R$e]=vt,rt}function i3r(i){const e=_s(i.locale)?i.locale:eq,t=_s(i.fallbackLocale)||wd(i.fallbackLocale)||Xa(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:e,r=Wh(i.missing)?i.missing:void 0,n=cu(i.silentTranslationWarn)||vk(i.silentTranslationWarn)?!i.silentTranslationWarn:!0,s=cu(i.silentFallbackWarn)||vk(i.silentFallbackWarn)?!i.silentFallbackWarn:!0,o=cu(i.fallbackRoot)?i.fallbackRoot:!0,a=!!i.formatFallbackMessages,l=Xa(i.modifiers)?i.modifiers:{},u=i.pluralizationRules,c=Wh(i.postTranslation)?i.postTranslation:void 0,h=_s(i.warnHtmlInMessage)?i.warnHtmlInMessage!=="off":!0,p=!!i.escapeParameterHtml,m=cu(i.sync)?i.sync:!0;let v=i.messages;if(Xa(i.sharedMessages)){const $=i.sharedMessages;v=Object.keys($).reduce((Y,K)=>{const Q=Y[K]||(Y[K]={});return p0(Q,$[K]),Y},v||{})}const{__i18n:w,__root:S,__injectWithOption:I}=i,R=i.datetimeFormats,L=i.numberFormats,k=i.flatJson,B=i.translateExistCompatible;return{locale:e,fallbackLocale:t,messages:v,flatJson:k,datetimeFormats:R,numberFormats:L,missing:r,missingWarn:n,fallbackWarn:s,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:h,escapeParameter:p,messageResolver:i.messageResolver,inheritLocale:m,translateExistCompatible:B,__i18n:w,__root:S,__injectWithOption:I}}function F$e(i={},e){{const t=Hqe(i3r(i)),{__extender:r}=i,n={id:t.id,get locale(){return t.locale.value},set locale(s){t.locale.value=s},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(s){t.fallbackLocale.value=s},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(s){},get missing(){return t.getMissingHandler()},set missing(s){t.setMissingHandler(s)},get silentTranslationWarn(){return cu(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(s){t.missingWarn=cu(s)?!s:s},get silentFallbackWarn(){return cu(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(s){t.fallbackWarn=cu(s)?!s:s},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(s){t.fallbackFormat=s},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(s){t.setPostTranslationHandler(s)},get sync(){return t.inheritLocale},set sync(s){t.inheritLocale=s},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(s){t.warnHtmlMessage=s!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(s){t.escapeParameter=s},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(s){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...s){const[o,a,l]=s,u={};let c=null,h=null;if(!_s(o))throw oy(bg.INVALID_ARGUMENT);const p=o;return _s(a)?u.locale=a:wd(a)?c=a:Xa(a)&&(h=a),wd(l)?c=l:Xa(l)&&(h=l),Reflect.apply(t.t,t,[p,c||h||{},u])},rt(...s){return Reflect.apply(t.rt,t,[...s])},tc(...s){const[o,a,l]=s,u={plural:1};let c=null,h=null;if(!_s(o))throw oy(bg.INVALID_ARGUMENT);const p=o;return _s(a)?u.locale=a:lg(a)?u.plural=a:wd(a)?c=a:Xa(a)&&(h=a),_s(l)?u.locale=l:wd(l)?c=l:Xa(l)&&(h=l),Reflect.apply(t.t,t,[p,c||h||{},u])},te(s,o){return t.te(s,o)},tm(s){return t.tm(s)},getLocaleMessage(s){return t.getLocaleMessage(s)},setLocaleMessage(s,o){t.setLocaleMessage(s,o)},mergeLocaleMessage(s,o){t.mergeLocaleMessage(s,o)},d(...s){return Reflect.apply(t.d,t,[...s])},getDateTimeFormat(s){return t.getDateTimeFormat(s)},setDateTimeFormat(s,o){t.setDateTimeFormat(s,o)},mergeDateTimeFormat(s,o){t.mergeDateTimeFormat(s,o)},n(...s){return Reflect.apply(t.n,t,[...s])},getNumberFormat(s){return t.getNumberFormat(s)},setNumberFormat(s,o){t.setNumberFormat(s,o)},mergeNumberFormat(s,o){t.mergeNumberFormat(s,o)},getChoiceIndex(s,o){return-1}};return n.__extender=r,n}}const Wqe={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:i=>i==="parent"||i==="global",default:"parent"},i18n:{type:Object}};function r3r({slots:i},e){return e.length===1&&e[0]==="default"?(i.default?i.default():[]).reduce((r,n)=>[...r,...n.type===Ks?n.children:[n]],[]):e.reduce((t,r)=>{const n=i[r];return n&&(t[r]=n()),t},{})}function c$t(i){return Ks}const n3r=Xr({name:"i18n-t",props:p0({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:i=>lg(i)||!isNaN(i)}},Wqe),setup(i,e){const{slots:t,attrs:r}=e,n=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return()=>{const s=Object.keys(t).filter(h=>h!=="_"),o={};i.locale&&(o.locale=i.locale),i.plural!==void 0&&(o.plural=_s(i.plural)?+i.plural:i.plural);const a=r3r(e,s),l=n[O$e](i.keypath,a,o),u=p0({},r),c=_s(i.tag)||zc(i.tag)?i.tag:c$t();return dx(c,u,l)}}}),Hct=n3r;function s3r(i){return wd(i)&&!_s(i[0])}function h$t(i,e,t,r){const{slots:n,attrs:s}=e;return()=>{const o={part:!0};let a={};i.locale&&(o.locale=i.locale),_s(i.format)?o.key=i.format:zc(i.format)&&(_s(i.format.key)&&(o.key=i.format.key),a=Object.keys(i.format).reduce((p,m)=>t.includes(m)?p0({},p,{[m]:i.format[m]}):p,{}));const l=r(i.value,o,a);let u=[o.key];wd(l)?u=l.map((p,m)=>{const v=n[p.type],w=v?v({[p.type]:p.value,index:m,parts:l}):[p.value];return s3r(w)&&(w[0].key=`${p.type}-${m}`),w}):_s(l)&&(u=[l]);const c=p0({},s),h=_s(i.tag)||zc(i.tag)?i.tag:c$t();return dx(h,c,u)}}const o3r=Xr({name:"i18n-n",props:p0({value:{type:Number,required:!0},format:{type:[String,Object]}},Wqe),setup(i,e){const t=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return h$t(i,e,r$t,(...r)=>t[R$e](...r))}}),Wct=o3r,a3r=Xr({name:"i18n-d",props:p0({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Wqe),setup(i,e){const t=i.i18n||Qn({useScope:i.scope,__useComponent:!0});return h$t(i,e,i$t,(...r)=>t[P$e](...r))}}),qct=a3r;function l3r(i,e){const t=i;if(i.mode==="composition")return t.__getInstance(e)||i.global;{const r=t.__getInstance(e);return r!=null?r.__composer:i.global.__composer}}function u3r(i){const e=o=>{const{instance:a,modifiers:l,value:u}=o;if(!a||!a.$)throw oy(bg.UNEXPECTED_ERROR);const c=l3r(i,a.$),h=Yct(u);return[Reflect.apply(c.t,c,[...Xct(h)]),c]};return{created:(o,a)=>{const[l,u]=e(a);__e&&i.global===u&&(o.__i18nWatcher=rl(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=u,o.textContent=l},unmounted:o=>{__e&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,u=Yct(a);o.textContent=Reflect.apply(l.t,l,[...Xct(u)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function Yct(i){if(_s(i))return{path:i};if(Xa(i)){if(!("path"in i))throw oy(bg.REQUIRED_VALUE,"path");return i}else throw oy(bg.INVALID_VALUE)}function Xct(i){const{path:e,locale:t,args:r,choice:n,plural:s}=i,o={},a=r||{};return _s(t)&&(o.locale=t),lg(n)&&(o.plural=n),lg(s)&&(o.plural=s),[e,a,o]}function c3r(i,e,...t){const r=Xa(t[0])?t[0]:{},n=!!r.useI18nComponentName;(cu(r.globalInstall)?r.globalInstall:!0)&&([n?"i18n":Hct.name,"I18nT"].forEach(o=>i.component(o,Hct)),[Wct.name,"I18nN"].forEach(o=>i.component(o,Wct)),[qct.name,"I18nD"].forEach(o=>i.component(o,qct))),i.directive("t",u3r(e))}function h3r(i,e,t){return{beforeCreate(){const r=Df();if(!r)throw oy(bg.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const s=n.i18n;if(n.__i18n&&(s.__i18n=n.__i18n),s.__root=e,this===this.$root)this.$i18n=Jct(i,s);else{s.__injectWithOption=!0,s.__extender=t.__vueI18nExtend,this.$i18n=F$e(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Jct(i,n);else{this.$i18n=F$e({__i18n:n.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=i;n.__i18nGlobal&&u$t(e,n,n),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),t.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=Df();if(!r)throw oy(bg.UNEXPECTED_ERROR);const n=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),t.__deleteInstance(r),delete this.$i18n}}}function Jct(i,e){i.locale=e.locale||i.locale,i.fallbackLocale=e.fallbackLocale||i.fallbackLocale,i.missing=e.missing||i.missing,i.silentTranslationWarn=e.silentTranslationWarn||i.silentFallbackWarn,i.silentFallbackWarn=e.silentFallbackWarn||i.silentFallbackWarn,i.formatFallbackMessages=e.formatFallbackMessages||i.formatFallbackMessages,i.postTranslation=e.postTranslation||i.postTranslation,i.warnHtmlInMessage=e.warnHtmlInMessage||i.warnHtmlInMessage,i.escapeParameterHtml=e.escapeParameterHtml||i.escapeParameterHtml,i.sync=e.sync||i.sync,i.__composer[o$t](e.pluralizationRules||i.pluralizationRules);const t=lTe(i.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(r=>i.mergeLocaleMessage(r,t[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>i.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>i.mergeNumberFormat(r,e.numberFormats[r])),i}const d3r=iL("global-vue-i18n");function p3r(i={},e){const t=__VUE_I18N_LEGACY_API__&&cu(i.legacy)?i.legacy:__VUE_I18N_LEGACY_API__,r=cu(i.globalInjection)?i.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&t?!!i.allowComposition:!0,s=new Map,[o,a]=f3r(i,t),l=iL("");function u(p){return s.get(p)||null}function c(p,m){s.set(p,m)}function h(p){s.delete(p)}{const p={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},get allowComposition(){return n},async install(m,...v){if(m.__VUE_I18N_SYMBOL__=l,m.provide(m.__VUE_I18N_SYMBOL__,p),Xa(v[0])){const I=v[0];p.__composerExtend=I.__composerExtend,p.__vueI18nExtend=I.__vueI18nExtend}let w=null;!t&&r&&(w=S3r(m,p.global)),__VUE_I18N_FULL_INSTALL__&&c3r(m,p,...v),__VUE_I18N_LEGACY_API__&&t&&m.mixin(h3r(a,a.__composer,p));const S=m.unmount;m.unmount=()=>{w&&w(),p.dispose(),S()}},get global(){return a},dispose(){o.stop()},__instances:s,__getInstance:u,__setInstance:c,__deleteInstance:h};return p}}function Qn(i={}){const e=Df();if(e==null)throw oy(bg.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw oy(bg.NOT_INSTALLED);const t=m3r(e),r=y3r(t),n=l$t(e),s=g3r(i,n);if(__VUE_I18N_LEGACY_API__&&t.mode==="legacy"&&!i.__useComponent){if(!t.allowComposition)throw oy(bg.NOT_AVAILABLE_IN_LEGACY_MODE);return w3r(e,s,r,i)}if(s==="global")return u$t(r,i,n),r;if(s==="parent"){let l=v3r(t,e,i.__useComponent);return l==null&&(l=r),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=p0({},i);"__i18n"in n&&(l.__i18n=n.__i18n),r&&(l.__root=r),a=Hqe(l),o.__composerExtend&&(a[D$e]=o.__composerExtend(a)),b3r(o,e,a),o.__setInstance(e,a)}return a}function f3r(i,e,t){const r=Wae();{const n=__VUE_I18N_LEGACY_API__&&e?r.run(()=>F$e(i)):r.run(()=>Hqe(i));if(n==null)throw oy(bg.UNEXPECTED_ERROR);return[r,n]}}function m3r(i){{const e=eo(i.isCE?d3r:i.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw oy(i.isCE?bg.NOT_INSTALLED_WITH_PROVIDE:bg.UNEXPECTED_ERROR);return e}}function g3r(i,e){return sTe(i)?"__i18n"in e?"local":"global":i.useScope?i.useScope:"local"}function y3r(i){return i.mode==="composition"?i.global:i.global.__composer}function v3r(i,e,t=!1){let r=null;const n=e.root;let s=_3r(e,t);for(;s!=null;){const o=i;if(i.mode==="composition")r=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=o.__getInstance(s);a!=null&&(r=a.__composer,t&&r&&!r[a$t]&&(r=null))}if(r!=null||n===s)break;s=s.parent}return r}function _3r(i,e=!1){return i==null?null:e&&i.vnode.ctx||i.parent}function b3r(i,e,t){Fa(()=>{},e),s7(()=>{const r=t;i.__deleteInstance(e);const n=r[D$e];n&&(n(),delete r[D$e])},e)}function w3r(i,e,t,r={}){const n=e==="local",s=qae(null);if(n&&i.proxy&&!(i.proxy.$options.i18n||i.proxy.$options.__i18n))throw oy(bg.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=cu(r.inheritLocale)?r.inheritLocale:!_s(r.locale),a=vi(!n||o?t.locale.value:_s(r.locale)?r.locale:eq),l=vi(!n||o?t.fallbackLocale.value:_s(r.fallbackLocale)||wd(r.fallbackLocale)||Xa(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:a.value),u=vi(lTe(a.value,r)),c=vi(Xa(r.datetimeFormats)?r.datetimeFormats:{[a.value]:{}}),h=vi(Xa(r.numberFormats)?r.numberFormats:{[a.value]:{}}),p=n?t.missingWarn:cu(r.missingWarn)||vk(r.missingWarn)?r.missingWarn:!0,m=n?t.fallbackWarn:cu(r.fallbackWarn)||vk(r.fallbackWarn)?r.fallbackWarn:!0,v=n?t.fallbackRoot:cu(r.fallbackRoot)?r.fallbackRoot:!0,w=!!r.fallbackFormat,S=Wh(r.missing)?r.missing:null,I=Wh(r.postTranslation)?r.postTranslation:null,R=n?t.warnHtmlMessage:cu(r.warnHtmlMessage)?r.warnHtmlMessage:!0,L=!!r.escapeParameter,k=n?t.modifiers:Xa(r.modifiers)?r.modifiers:{},B=r.pluralRules||n&&t.pluralRules;function $(){return[a.value,l.value,u.value,c.value,h.value]}const V=Hr({get:()=>s.value?s.value.locale.value:a.value,set:Ue=>{s.value&&(s.value.locale.value=Ue),a.value=Ue}}),Y=Hr({get:()=>s.value?s.value.fallbackLocale.value:l.value,set:Ue=>{s.value&&(s.value.fallbackLocale.value=Ue),l.value=Ue}}),K=Hr(()=>s.value?s.value.messages.value:u.value),Q=Hr(()=>c.value),re=Hr(()=>h.value);function ne(){return s.value?s.value.getPostTranslationHandler():I}function de(Ue){s.value&&s.value.setPostTranslationHandler(Ue)}function pe(){return s.value?s.value.getMissingHandler():S}function H(Ue){s.value&&s.value.setMissingHandler(Ue)}function Z(Ue){return $(),Ue()}function ae(...Ue){return s.value?Z(()=>Reflect.apply(s.value.t,null,[...Ue])):Z(()=>"")}function fe(...Ue){return s.value?Reflect.apply(s.value.rt,null,[...Ue]):""}function be(...Ue){return s.value?Z(()=>Reflect.apply(s.value.d,null,[...Ue])):Z(()=>"")}function _e(...Ue){return s.value?Z(()=>Reflect.apply(s.value.n,null,[...Ue])):Z(()=>"")}function Ie(Ue){return s.value?s.value.tm(Ue):{}}function Te(Ue,ct){return s.value?s.value.te(Ue,ct):!1}function Be(Ue){return s.value?s.value.getLocaleMessage(Ue):{}}function Ve(Ue,ct){s.value&&(s.value.setLocaleMessage(Ue,ct),u.value[Ue]=ct)}function $e(Ue,ct){s.value&&s.value.mergeLocaleMessage(Ue,ct)}function tt(Ue){return s.value?s.value.getDateTimeFormat(Ue):{}}function yt(Ue,ct){s.value&&(s.value.setDateTimeFormat(Ue,ct),c.value[Ue]=ct)}function Ct(Ue,ct){s.value&&s.value.mergeDateTimeFormat(Ue,ct)}function ot(Ue){return s.value?s.value.getNumberFormat(Ue):{}}function vt(Ue,ct){s.value&&(s.value.setNumberFormat(Ue,ct),h.value[Ue]=ct)}function At(Ue,ct){s.value&&s.value.mergeNumberFormat(Ue,ct)}const Je={get id(){return s.value?s.value.id:-1},locale:V,fallbackLocale:Y,messages:K,datetimeFormats:Q,numberFormats:re,get inheritLocale(){return s.value?s.value.inheritLocale:o},set inheritLocale(Ue){s.value&&(s.value.inheritLocale=Ue)},get availableLocales(){return s.value?s.value.availableLocales:Object.keys(u.value)},get modifiers(){return s.value?s.value.modifiers:k},get pluralRules(){return s.value?s.value.pluralRules:B},get isGlobal(){return s.value?s.value.isGlobal:!1},get missingWarn(){return s.value?s.value.missingWarn:p},set missingWarn(Ue){s.value&&(s.value.missingWarn=Ue)},get fallbackWarn(){return s.value?s.value.fallbackWarn:m},set fallbackWarn(Ue){s.value&&(s.value.missingWarn=Ue)},get fallbackRoot(){return s.value?s.value.fallbackRoot:v},set fallbackRoot(Ue){s.value&&(s.value.fallbackRoot=Ue)},get fallbackFormat(){return s.value?s.value.fallbackFormat:w},set fallbackFormat(Ue){s.value&&(s.value.fallbackFormat=Ue)},get warnHtmlMessage(){return s.value?s.value.warnHtmlMessage:R},set warnHtmlMessage(Ue){s.value&&(s.value.warnHtmlMessage=Ue)},get escapeParameter(){return s.value?s.value.escapeParameter:L},set escapeParameter(Ue){s.value&&(s.value.escapeParameter=Ue)},t:ae,getPostTranslationHandler:ne,setPostTranslationHandler:de,getMissingHandler:pe,setMissingHandler:H,rt:fe,d:be,n:_e,tm:Ie,te:Te,getLocaleMessage:Be,setLocaleMessage:Ve,mergeLocaleMessage:$e,getDateTimeFormat:tt,setDateTimeFormat:yt,mergeDateTimeFormat:Ct,getNumberFormat:ot,setNumberFormat:vt,mergeNumberFormat:At};function it(Ue){Ue.locale.value=a.value,Ue.fallbackLocale.value=l.value,Object.keys(u.value).forEach(ct=>{Ue.mergeLocaleMessage(ct,u.value[ct])}),Object.keys(c.value).forEach(ct=>{Ue.mergeDateTimeFormat(ct,c.value[ct])}),Object.keys(h.value).forEach(ct=>{Ue.mergeNumberFormat(ct,h.value[ct])}),Ue.escapeParameter=L,Ue.fallbackFormat=w,Ue.fallbackRoot=v,Ue.fallbackWarn=m,Ue.missingWarn=p,Ue.warnHtmlMessage=R}return E0(()=>{if(i.proxy==null||i.proxy.$i18n==null)throw oy(bg.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const Ue=s.value=i.proxy.$i18n.__composer;e==="global"?(a.value=Ue.locale.value,l.value=Ue.fallbackLocale.value,u.value=Ue.messages.value,c.value=Ue.datetimeFormats.value,h.value=Ue.numberFormats.value):n&&it(Ue)}),Je}const x3r=["locale","fallbackLocale","availableLocales"],Kct=["t","rt","d","n","tm","te"];function S3r(i,e){const t=Object.create(null);return x3r.forEach(n=>{const s=Object.getOwnPropertyDescriptor(e,n);if(!s)throw oy(bg.UNEXPECTED_ERROR);const o=Wu(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(t,n,o)}),i.config.globalProperties.$i18n=t,Kct.forEach(n=>{const s=Object.getOwnPropertyDescriptor(e,n);if(!s||!s.value)throw oy(bg.UNEXPECTED_ERROR);Object.defineProperty(i.config.globalProperties,`$${n}`,s)}),()=>{delete i.config.globalProperties.$i18n,Kct.forEach(n=>{delete i.config.globalProperties[`$${n}`]})}}QAr();__INTLIFY_JIT_COMPILATION__?Oct(qAr):Oct(WAr);NAr(vAr);$Ar(WNt);if(__INTLIFY_PROD_DEVTOOLS__){const i=hP();i.__INTLIFY__=!0,IAr(i.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const T3r={en:{"lang-code":"en","lang-dir":"ltr","lang-en":"English","lang-fr":"anglais","lang-native":"English","ramp.about.open":"Open About RAMP","ramp.about":"About RAMP","keyboardInstructions.title":"Keyboard Instructions","keyboardInstructions.open":"Open keyboard instructions","keyboardInstructions.app":"Use 'Tab' to navigate between sections of the application.","keyboardInstructions.lists":"Use the arrow keys to move between items in lists. With a list item selected you can press 'Space' or 'Enter' to click the item. You can also navigate within the list item using 'Tab'.","keyboardInstructions.map":"When the map is selected, use the arrow keys to move around and 'Enter' to select a point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Switch to metric map scale","map.toggleScaleToImperial":"Switch to imperial map scale","map.coordinates.east":"E","map.coordinates.west":"W","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Change Language","map.language.short":"EN-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"current","map.export":"export map","notifications.open":"Open Notifications Panel","notifications.title":"Notifications","notifications.empty":"No new notifications.","notifications.controls.dismiss":"Dismiss","notifications.controls.expand":"Expand","notifications.controls.collapse":"Collapse","notifications.controls.clearAll":"Clear All","panels.access":"Press enter or space to access the panel","panels.controls.close":"Close","panels.controls.pin":"Pin","panels.controls.unpin":"Unpin","panels.controls.back":"Back","panels.controls.optionsMenu":"More","panels.controls.minimize":"Minimize","panels.controls.expand":"Expand","panels.controls.collapse":"Collapse","panels.controls.moveRight":"Move Right","panels.controls.moveLeft":"Move Left","panels.controls.items":"Use the arrow keys to navigate the items","panels.alert.open":"{name} panel opened","panels.alert.close":"{name} panel closed","panels.alert.minimize":"{name} panel minimized","layer.error":"{id} failed to load","layer.longload":"{id} is taking longer than expected to load","layer.longdraw":"{id} is taking longer than expected to draw","layer.mismatch":"{name} cannot be displayed in the current projection","layer.filtersdisabled":"Filters have been disabled for {name}","layer.filterwarning":"You are attempting to use a grid that contains unmodifiable layers. Filtering will be partially disabled.","layer.noexportmap":"{name} was attempted to be added as a Map Image Layer but Map Export is not enabled for the service","caption.attributionDefaultText":"Powered by ESRI","caption.attributionLogoAltText":"ESRI logo","caption.attributionLink":"https://www.esri.com/"},fr:{"lang-code":"fr","lang-dir":"ltr","lang-en":"French","lang-fr":"français","lang-native":"Français","ramp.about.open":"Ouvrir À propos de PCAR","ramp.about":"À propos de PCAR","keyboardInstructions.title":"Instructions clavier","keyboardInstructions.open":"Instructions clavier ouvert","keyboardInstructions.app":"Utilisez la touche Tab pour vous déplacer entre les sections de l'application.","keyboardInstructions.lists":"Lorsqu'un élément de la liste est sélectionné, vous pouvez appuyer sur « Espace » ou « Entrée » pour cliquer sur l'élément. Vous pouvez également vous déplacer au sein de l'élément de la liste au moyen de la touche « Tab ».","keyboardInstructions.map":"Lorsque la carte est sélectionnée, utilisez le pavé curseur pour vous déplacer et appuyez sur « Entrée » pour sélectionner un point.","keyboardInstructions.OK":"OK","map.toggleScaleToMetric":"Passer à l'échelle métrique","map.toggleScaleToImperial":"Passer à l'échelle impériale","map.coordinates.east":"E","map.coordinates.west":"O","map.coordinates.north":"N","map.coordinates.south":"S","map.changeLanguage":"Changer de langue","map.language.short":"FR-CA","map.language.en":"English","map.language.fr":"Français","map.language.curr":"actuel","map.export":"exporter la carte","notifications.open":"Ouvrir la fenêtre des notifications","notifications.title":"Notifications","notifications.empty":"Aucune nouvelle notification.","notifications.controls.dismiss":"Rejeter","notifications.controls.expand":"Développer","notifications.controls.collapse":"Réduire","notifications.controls.clearAll":"Effacer tout","panels.access":"Appuyez sur Entrée ou sur la barre d'espacement pour accéder au panneau","panels.controls.close":"Fermer","panels.controls.pin":"Épingler","panels.controls.unpin":"Désépingler","panels.controls.back":"Retour","panels.controls.optionsMenu":"Plus","panels.controls.minimize":"Réduire","panels.controls.expand":"Développer","panels.controls.collapse":"Réduire","panels.controls.moveRight":"Aller à droite","panels.controls.moveLeft":"Aller à gauche","panels.controls.items":"Utilisez les touches fléchées pour naviguer entre les éléments","panels.alert.open":"Fenêtre {name} ouverte","panels.alert.close":"Fenêtre {name} fermée","panels.alert.minimize":"Fenêtre {name} réduite","layer.error":"Échec du chargement de {id}","layer.longload":"Le chargement de {id} met plus de temps que prévu","layer.longdraw":"{id} prend plus de temps que prévu à extraire","layer.mismatch":"{id} ne peut pas s'afficher dans la projection actuelle","layer.filtersdisabled":"Les filtres ont été désactivés pour {name}","layer.filterwarning":"Vous essayez d'utiliser une grille qui contient des couches non modifiables. Le filtrage sera partiellement désactivé.","layer.noexportmap":"La tentative d’ajouter {name} comme couche d’imagerie cartographique a échouée car elle n’a pu être activé pour ce service","caption.attributionDefaultText":"Propulsé par ESRI","caption.attributionLogoAltText":"Logo ESRI","caption.attributionLink":"https://www.esri.com/fr-fr/home"}},Zct="en",C3r={en:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}},fr:{number:{style:"decimal",useGrouping:!1,maximumFractionDigits:20}}};function E3r(){return p3r({legacy:!1,locale:document.documentElement.getAttribute("lang")||Zct,fallbackLocale:Zct,globalInjection:!0,messages:T3r,numberFormats:C3r})}var d$t={exports:{}};/*! * screenfull * v5.0.2 - 2020-02-13 * (c) Sindre Sorhus; MIT License -*/(function(i){(function(){var e=typeof window<"u"&&typeof window.document<"u"?window.document:{},t=i.exports,r=function(){for(var o,a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],l=0,u=a.length,c={};l-1}function Bi(ft,Wt){var hi=this.__data__,Pi=qn(hi,ft);return Pi<0?hi.push([ft,Wt]):hi[Pi][1]=Wt,this}Xt.prototype.clear=wi,Xt.prototype.delete=pi,Xt.prototype.get=Ri,Xt.prototype.has=Ui,Xt.prototype.set=Bi;function mi(ft){var Wt=-1,hi=ft?ft.length:0;for(this.clear();++Wt-1&&ft%1==0&&ft-1&&ft%1==0&&ft<=n}function jn(ft){var Wt=typeof ft;return!!ft&&(Wt=="object"||Wt=="function")}function co(ft){return!!ft&&typeof ft=="object"}function ua(ft){return Fi(ft)?Tn(ft):Ss(ft)}function Hs(){return[]}function Ll(){return!1}i.exports=xt})(x_e,x_e.exports);var P3r=x_e.exports;const Qct=X3(P3r),S_e=xp("maptip",()=>{const i=vi(void 0),e=vi(void 0),t=vi("");function r(o){i.value=o}function n(o){e.value=o}function s(o){t.value=o}return{maptipInstance:i,maptipPoint:e,content:t,setMaptipInstance:r,setMaptipPoint:n,setMaptipContent:s}}),R3r=Xr({__name:"esri-map",setup(i){const e=S_e(),t=eo("iApi"),r=Hr(()=>e.maptipPoint),n=Hr(()=>e.maptipInstance),s=Hr(()=>e.content),o=Zl([]);o.push(rl(r,()=>{if(r.value){let l,u;const c=t.geo.map.getPixelWidth()/2,h=0,p=t.geo.map.mapPointToScreenPoint(r.value);l=p.screenX-c,u=h-p.screenY,n.value.setProps({offset:[l,u]}),s.value&&s.value!==""&&n.value.show()}else n.value.hide()})),o.push(rl(s,l=>{l&&l!==""&&r?(n.value.setContent(l),n.value.show()):n.value.hide()})),Ka(()=>{o.forEach(l=>l())});const a=()=>{t.geo.map.setMouseFocus()};return(l,u)=>{const c=Nn("tippy");return Ur((qt(),si("div",{name:"esriMap",id:"esriMap",class:"h-full overflow-hidden",onMousedown:a,onKeydown:u[0]||(u[0]=Ph(ia(()=>{},["prevent"]),["up","down","left","right"]))},null,544)),[[c,{allowHTML:!0,zIndex:150,theme:"ramp4",trigger:"manual",appendTo:"parent",arrow:!1,delay:200,duration:[200,200]}]])}}});var p$t={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},qqe={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},D3r=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],T_e={CSS:{},springs:{}};function RA(i,e,t){return Math.min(Math.max(i,e),t)}function ere(i,e){return i.indexOf(e)>-1}function QMe(i,e){return i.apply(null,e)}var No={arr:function(i){return Array.isArray(i)},obj:function(i){return ere(Object.prototype.toString.call(i),"Object")},pth:function(i){return No.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return i.nodeType||No.svg(i)},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},nil:function(i){return No.und(i)||i===null},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return No.hex(i)||No.rgb(i)||No.hsl(i)},key:function(i){return!p$t.hasOwnProperty(i)&&!qqe.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function f$t(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m$t(i,e){var t=f$t(i),r=RA(No.und(t[0])?1:t[0],.1,100),n=RA(No.und(t[1])?100:t[1],.1,100),s=RA(No.und(t[2])?10:t[2],.1,100),o=RA(No.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),u=l<1?a*Math.sqrt(1-l*l):0,c=1,h=l<1?(l*a+-o)/u:-o+a;function p(v){var w=e?e*v/1e3:v;return l<1?w=Math.exp(-w*l*a)*(c*Math.cos(u*w)+h*Math.sin(u*w)):w=(c+h*w)*Math.exp(-w*a),v===0||v===1?v:1-w}function m(){var v=T_e.springs[i];if(v)return v;for(var w=1/6,S=0,I=0;;)if(S+=w,p(S)===1){if(I++,I>=16)break}else I=0;var R=S*w*1e3;return T_e.springs[i]=R,R}return e?p:m}function F3r(i){return i===void 0&&(i=10),function(e){return Math.ceil(RA(e,1e-6,1)*i)*(1/i)}}var k3r=function(){var i=11,e=1/(i-1);function t(c,h){return 1-3*h+3*c}function r(c,h){return 3*h-6*c}function n(c){return 3*c}function s(c,h,p){return((t(h,p)*c+r(h,p))*c+n(h))*c}function o(c,h,p){return 3*t(h,p)*c*c+2*r(h,p)*c+n(h)}function a(c,h,p,m,v){var w,S,I=0;do S=h+(p-h)/2,w=s(S,m,v)-c,w>0?p=S:h=S;while(Math.abs(w)>1e-7&&++I<10);return S}function l(c,h,p,m){for(var v=0;v<4;++v){var w=o(h,p,m);if(w===0)return h;var S=s(h,p,m)-c;h-=S/w}return h}function u(c,h,p,m){if(!(0<=c&&c<=1&&0<=p&&p<=1))return;var v=new Float32Array(i);if(c!==h||p!==m)for(var w=0;w=.001?l(I,$,c,p):V===0?$:a(I,R,R+e,c,p)}return function(I){return c===h&&p===m||I===0||I===1?I:s(S(I),h,m)}}return u}(),g$t=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=RA(r,1,10),o=RA(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}},i["easeOutIn"+r]=function(s,o){return function(a){return a<.5?(1-n(s,o)(1-a*2))/2:(n(s,o)(a*2-1)+1)/2}}}),i}();function Yqe(i,e){if(No.fnc(i))return i;var t=i.split("(")[0],r=g$t[t],n=f$t(i);switch(t){case"spring":return m$t(i,e);case"cubicBezier":return QMe(k3r,n);case"steps":return QMe(F3r,n);default:return QMe(r,n)}}function y$t(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function uTe(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s1&&(v-=1),v<1/6?p+(m-p)*6*v:v<1/2?m:v<2/3?p+(m-p)*(2/3-v)*6:p}var a,l,u;if(r==0)a=l=u=n;else{var c=n<.5?n*(1+r):n+r-n*r,h=2*n-c;a=o(h,c,t+1/3),l=o(h,c,t),u=o(h,c,t-1/3)}return"rgba("+a*255+","+l*255+","+u*255+","+s+")"}function B3r(i){if(No.rgb(i))return L3r(i);if(No.hex(i))return N3r(i);if(No.hsl(i))return $3r(i)}function HP(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function j3r(i){if(ere(i,"translate")||i==="perspective")return"px";if(ere(i,"rotate")||ere(i,"skew"))return"deg"}function L$e(i,e){return No.fnc(i)?i(e.target,e.id,e.total):i}function DA(i,e){return i.getAttribute(e)}function Kqe(i,e,t){var r=HP(e);if(Xqe([t,"deg","rad","turn"],r))return e;var n=T_e.CSS[e+t];if(!No.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var u=l*parseFloat(e);return T_e.CSS[e+t]=u,u}function v$t(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?Kqe(i,n,t):n}}function Zqe(i,e){if(No.dom(i)&&!No.inp(i)&&(!No.nil(DA(i,e))||No.svg(i)&&i[e]))return"attribute";if(No.dom(i)&&Xqe(D3r,e))return"transform";if(No.dom(i)&&e!=="transform"&&v$t(i,e))return"css";if(i[e]!=null)return"object"}function _$t(i){if(No.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function G3r(i,e,t,r){var n=ere(e,"scale")?1:0+j3r(e),s=_$t(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?Kqe(i,s,r):s}function Qqe(i,e,t,r){switch(Zqe(i,e)){case"transform":return G3r(i,e,r,t);case"css":return v$t(i,e,t);case"attribute":return DA(i,e);default:return i[e]||0}}function eYe(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=HP(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function b$t(i,e){if(No.col(i))return B3r(i);if(/\s/g.test(i))return i;var t=HP(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function tYe(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function U3r(i){return Math.PI*2*DA(i,"r")}function z3r(i){return DA(i,"width")*2+DA(i,"height")*2}function V3r(i){return tYe({x:DA(i,"x1"),y:DA(i,"y1")},{x:DA(i,"x2"),y:DA(i,"y2")})}function w$t(i){for(var e=i.points,t=0,r,n=0;n0&&(t+=tYe(r,s)),r=s}return t}function H3r(i){var e=i.points;return w$t(i)+tYe(e.getItem(e.numberOfItems-1),e.getItem(0))}function x$t(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return U3r(i);case"rect":return z3r(i);case"line":return V3r(i);case"polyline":return w$t(i);case"polygon":return H3r(i)}}function W3r(i){var e=x$t(i);return i.setAttribute("stroke-dasharray",e),e}function q3r(i){for(var e=i.parentNode;No.svg(e)&&No.svg(e.parentNode);)e=e.parentNode;return e}function S$t(i,e){var t=e||{},r=t.el||q3r(i),n=r.getBoundingClientRect(),s=DA(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o,h:a,vW:l[2],vH:l[3]}}function Y3r(i,e){var t=No.str(i)?y$t(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:S$t(t),totalLength:x$t(t)*(r/100)}}}function X3r(i,e,t){function r(c){c===void 0&&(c=0);var h=e+c>=1?e+c:0;return i.el.getPointAtLength(h)}var n=S$t(i.el,i.svg),s=r(),o=r(-1),a=r(1),l=t?1:n.w/n.vW,u=t?1:n.h/n.vH;switch(i.property){case"x":return(s.x-n.x)*l;case"y":return(s.y-n.y)*u;case"angle":return Math.atan2(a.y-o.y,a.x-o.x)*180/Math.PI}}function tht(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=b$t(No.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:No.str(i)||e?r.split(t):[]}}function iYe(i){var e=i?cTe(No.arr(i)?i.map(eht):eht(i)):[];return uTe(e,function(t,r,n){return n.indexOf(t)===r})}function T$t(i){var e=iYe(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:_$t(t)}}})}function J3r(i,e){var t=Jqe(e);if(/^spring/.test(t.easing)&&(t.duration=m$t(t.easing)),No.arr(i)){var r=i.length,n=r===2&&!No.obj(i[0]);n?i={value:i}:No.fnc(e.duration)||(t.duration=e.duration/r)}var s=No.arr(i)?i:[i];return s.map(function(o,a){var l=No.obj(o)&&!No.pth(o)?o:{value:o};return No.und(l.delay)&&(l.delay=a?0:e.delay),No.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return hTe(o,t)})}function K3r(i){for(var e=uTe(cTe(i.map(function(s){return Object.keys(s)})),function(s){return No.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var u in a)No.key(u)?u==o&&(l.value=a[u]):l[u]=a[u];return l})},n=0;n0&&(i=requestAnimationFrame(t))}function t(n){for(var s=MC.length,o=0;o0?requestAnimationFrame(t):void 0}function r(){bp.suspendWhenDocumentHidden&&(rht()?i=cancelAnimationFrame(i):(MC.forEach(function(n){return n._onDocumentVisibility()}),A$t()))}return typeof document<"u"&&document.addEventListener("visibilitychange",r),e}();function rht(){return!!document&&document.hidden}function bp(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(R){var L=window.Promise&&new Promise(function(k){return o=k});return R.finished=L,L}var l=rMr(i);a(l);function u(){var R=l.direction;R!=="alternate"&&(l.direction=R!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(L){return L.reversed=l.reversed})}function c(R){return l.reversed?l.duration-R:R}function h(){e=0,t=c(l.currentTime)*(1/bp.speed)}function p(R,L){L&&L.seek(R-L.timelineOffset)}function m(R){if(l.reversePlayback)for(var k=s;k--;)p(R,n[k]);else for(var L=0;L2||(be=Math.round(be*pe)/pe)),H.push(be)}var Te=de.length;if(!Te)ae=H[0];else{ae=de[0];for(var Be=0;Be0&&(l.began=!0,w("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,w("loopBegin")),$<=k&&l.currentTime!==0&&v(0),($>=B&&l.currentTime!==L||!L)&&v(L),$>k&&$=L&&(t=0,S(),l.remaining?(e=r,w("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,w("loopComplete"),w("complete"),!l.passThrough&&"Promise"in window&&(o(),a(l)))))}return l.reset=function(){var R=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=R==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var L=s;L--;)l.children[L].reset();(l.reversed&&l.loop!==!0||R==="alternate"&&l.loop===1)&&l.remaining++,v(l.reversed?l.duration:0)},l._onDocumentVisibility=h,l.set=function(R,L){return E$t(R,L),l},l.tick=function(R){r=R,e||(e=r),I((r+(t-e))*bp.speed)},l.seek=function(R){I(c(R))},l.pause=function(){l.paused=!0,h()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,MC.push(l),h(),A$t())},l.reverse=function(){u(),l.completed=!l.reversed,h()},l.restart=function(){l.reset(),l.play()},l.remove=function(R){var L=iYe(R);M$t(L,l)},l.reset(),l.autoplay&&l.play(),l}function nht(i,e){for(var t=e.length;t--;)Xqe(i,e[t].animatable.target)&&e.splice(t,1)}function M$t(i,e){var t=e.animations,r=e.children;nht(i,t);for(var n=r.length;n--;){var s=r[n],o=s.animations;nht(i,o),!o.length&&!s.children.length&&r.splice(n,1)}!t.length&&!r.length&&e.pause()}function nMr(i){for(var e=iYe(i),t=MC.length;t--;){var r=MC[t];M$t(e,r)}}function sMr(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?Yqe(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",u=o==="last",c=No.arr(i),h=parseFloat(c?i[0]:i),p=c?parseFloat(i[1]):0,m=HP(c?i[1]:i)||0,v=e.start||0+(c?h:0),w=[],S=0;return function(I,R,L){if(a&&(o=0),l&&(o=(L-1)/2),u&&(o=L-1),!w.length){for(var k=0;k-1&&MC.splice(n,1);function o(p){p.passThrough=!0}for(var a=0;a=a?n.target.classList.add(o):n.target.classList.remove(o)})})}):void 0}observe(e){this.resizeObserver?.observe(e)}}const aMr=["data-cy"],P$t=Xr({__name:"panel-container",props:{panel:{type:Object,required:!0}},setup(i){const e=i,t=vi(null),r=vi(!1);Fa(()=>{e.panel.teleport&&new O$t({xs:0,sm:461,...e.panel.teleport.breakpoints}).observe(t.value)});const n=(l,u,c)=>{if(r.value)return u();bp({targets:l,opacity:{value:c,duration:400,easing:"cubicBezier(.5, .05, .1, .3)"},complete:u})},s=(l,u)=>{n(l,u,[0,1])},o=l=>{l.classList.contains("screen-spinner")||(r.value=e.panel.isScreenLoaded(e.panel.route.screen),t.value.querySelectorAll("[focus-item").forEach(u=>u.classList.remove("default-focus-style")))},a=(l,u)=>{n(l,u,[0,1])};return(l,u)=>{const c=Nn("focus-container");return qt(),si("div",{class:Wn(["shadow-tm bg-white h-full xs:mr-0 sm:mr-12 last:mr-0 pointer-events-auto min-w-0 shrink-0",i.panel.expanded?"flex-grow max-w-full":""]),style:s_(i.panel.style),"data-cy":i.panel.id,ref_key:"componentEl",ref:t},[Vn(eL,{onBeforeLeave:o,onLeave:a,onEnter:s},{default:Rn(()=>[Ur((qt(),Dn(xR(i.panel.route.screen),Kae(i.panel.route.props,{panel:i.panel}),null,16,["panel"])),[[c]])]),_:1})],14,aMr)}}}),w0=xp("panel",()=>{const i=vi(void 0),e=vi(void 0),t=vi(0),r=vi(0),n=vi(!1),s=vi(!0),o=vi({}),a=vi({}),l=vi([]),u=vi([]),c=vi([]),h=Hr(()=>r.value);function p(re){return re==="xs"&&c.value.length>0?[c.value.slice().pop()]:c.value}function m(re){const ne=[];return re.forEach(de=>{de in a.value&&ne.push(a.value[de].getPromise())}),ne}function v(re){$(re),k(),e.value=void 0}function w(re){V(re),k()}function S(re,ne){Y(re,ne),k()}function I(re){K(re),k()}function R(re){t.value=re,k()}function L(re){n.value=re}function k(){let re=t.value;const ne=[],de=350,pe=12;for(let H=l.value.length-1;H>=0;H--){let Z=l.value[H].width||de;n.value?Z=re:Z+=pe,(re>=Z&&!n.value||ne.length===0)&&(re-=Z,ne.unshift(l.value[H]))}if(i.value&&!ne.includes(i.value)&&!n.value){let H;for(let be=0;be=(i.value.width||de)?ne.unshift(i.value):e.value||(H=ne.shift(),ne.unshift(i.value));const Z=l.value.indexOf(i.value),ae=l.value.indexOf(H),fe=l.value.slice();ae>-1&&(fe.splice(Z,1),fe.splice(ae,0,i.value)),l.value=fe}r.value=re,c.value=ne}function B(re){if(o.value={...o.value,[re.id]:re},re.id in a.value)a.value[re.id].resolveMe();else{const ne=new Af;ne.resolveMe(),a.value={...a.value,[re.id]:ne}}}function $(re){re.teleport?u.value=[...u.value,re]:(l.value=[...l.value,re],e.value=re)}function V(re){if(re.teleport){const ne=u.value.indexOf(re);ne!==-1&&(u.value=[...u.value.slice(0,ne),...u.value.slice(ne+1)])}else{const ne=l.value.indexOf(re);ne!==-1&&(l.value=[...l.value.slice(0,ne),...l.value.slice(ne+1)])}}function Y(re,ne){const de=l.value.indexOf(re),pe=ne==="right"?1:-1;c.value.includes(l.value[de+pe])&&([l.value[de],l.value[de+pe]]=[l.value[de+pe],l.value[de]])}function K(re){o.value[re.id]!==void 0&&delete o.value[re.id],a.value[re.id]!==void 0&&delete a.value[re.id];const ne=c.value.indexOf(re);ne!==-1&&(c.value=[...c.value.slice(0,ne),...c.value.slice(ne+1)]),i.value&&i.value.id==re.id&&(i.value=void 0)}function Q(re){a.value={...a.value,[re]:new Af}}return{items:o,regPromises:a,orderedItems:l,pinned:i,priority:e,visible:c,stackWidth:t,remWidth:r,mobileView:n,reorderable:s,teleported:u,getRemainingWidth:h,getVisible:p,getRegPromises:m,openPanel:v,closePanel:w,movePanel:S,removePanel:I,setStackWidth:R,setMobileView:L,updateVisible:k,registerPanel:B,addRegPromise:Q}}),lMr=Xr({__name:"panel-stack",setup(i){const e=w0(),t=eo("iApi"),r=vi(),n=Hr(()=>e.mobileView);Fa(()=>{new ResizeObserver(c=>{const h=!(t?.$vApp.$root?.$refs["app-size"]).classList.contains("sm");n.value!==h&&(e.mobileView=h,t?.event.emit(ln.RAMP_MOBILEVIEW_CHANGE,h)),e.setStackWidth(c[0].contentRect.width)}).observe(r.value?.$el)});const s=u=>e.getVisible(u),o=(u,c)=>{l(u,c,[[6,0],[0,1]])},a=(u,c)=>{const[h,p]=[u.children[0].getBoundingClientRect(),u.parentElement.getBoundingClientRect()];u.style.width=`${h.width}px`,u.style.height=`${h.height}px`,u.style.left=`${h.left-p.left}px`,u.style.position="absolute",l(u,c,[[0,-6],[1,0]])},l=(u,c,h)=>{bp({targets:u,duration:300,translateY:{value:h[0],easing:"cubicBezier(.5, .05, .1, .3)"},opacity:{value:h[1],duration:250,easing:"cubicBezier(.5, .05, .1, .3)"},complete:c})};return(u,c)=>(qt(),Dn(XSe,{onEnter:o,onLeave:a,name:"panel-container",tag:"div",ref_key:"el",ref:r},{default:Rn(()=>[(qt(!0),si(Ks,null,hu(s(ri(t).screenSize),h=>(qt(),Dn(P$t,{key:`${h.id}`,panel:h},null,8,["panel"]))),128))]),_:1},512))}}),ml=(i,e)=>{const t=i.__vccOpts||i;for(const[r,n]of e)t[r]=n;return t},uMr=ml(lMr,[["__scopeId","data-v-6def3362"]]);var Pb="top",$S="bottom",BS="right",Rb="left",rYe="auto",rle=[Pb,$S,BS,Rb],iq="start",Cse="end",cMr="clippingParents",R$t="viewport",ZJ="popper",hMr="reference",sht=rle.reduce(function(i,e){return i.concat([e+"-"+iq,e+"-"+Cse])},[]),D$t=[].concat(rle,[rYe]).reduce(function(i,e){return i.concat([e,e+"-"+iq,e+"-"+Cse])},[]),dMr="beforeRead",pMr="read",fMr="afterRead",mMr="beforeMain",gMr="main",yMr="afterMain",vMr="beforeWrite",_Mr="write",bMr="afterWrite",wMr=[dMr,pMr,fMr,mMr,gMr,yMr,vMr,_Mr,bMr];function b3(i){return i?(i.nodeName||"").toLowerCase():null}function Nx(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function wB(i){var e=Nx(i).Element;return i instanceof e||i instanceof Element}function CS(i){var e=Nx(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function nYe(i){if(typeof ShadowRoot>"u")return!1;var e=Nx(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function xMr(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!CS(s)||!b3(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function SMr(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,u){return l[u]="",l},{});!CS(n)||!b3(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const TMr={name:"applyStyles",enabled:!0,phase:"write",fn:xMr,effect:SMr,requires:["computeStyles"]};function XA(i){return i.split("-")[0]}var u9=Math.max,C_e=Math.min,rq=Math.round;function N$e(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function F$t(){return!/^((?!chrome|android).)*safari/i.test(N$e())}function nq(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&CS(i)&&(n=i.offsetWidth>0&&rq(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&rq(r.height)/i.offsetHeight||1);var o=wB(i)?Nx(i):window,a=o.visualViewport,l=!F$t()&&t,u=(r.left+(l&&a?a.offsetLeft:0))/n,c=(r.top+(l&&a?a.offsetTop:0))/s,h=r.width/n,p=r.height/s;return{width:h,height:p,top:c,right:u+h,bottom:c+p,left:u,x:u,y:c}}function sYe(i){var e=nq(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function k$t(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&nYe(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function TR(i){return Nx(i).getComputedStyle(i)}function CMr(i){return["table","td","th"].indexOf(b3(i))>=0}function nL(i){return((wB(i)?i.ownerDocument:i.document)||window.document).documentElement}function dTe(i){return b3(i)==="html"?i:i.assignedSlot||i.parentNode||(nYe(i)?i.host:null)||nL(i)}function oht(i){return!CS(i)||TR(i).position==="fixed"?null:i.offsetParent}function EMr(i){var e=/firefox/i.test(N$e()),t=/Trident/i.test(N$e());if(t&&CS(i)){var r=TR(i);if(r.position==="fixed")return null}var n=dTe(i);for(nYe(n)&&(n=n.host);CS(n)&&["html","body"].indexOf(b3(n))<0;){var s=TR(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function nle(i){for(var e=Nx(i),t=oht(i);t&&CMr(t)&&TR(t).position==="static";)t=oht(t);return t&&(b3(t)==="html"||b3(t)==="body"&&TR(t).position==="static")?e:t||EMr(i)||e}function oYe(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function tre(i,e,t){return u9(i,C_e(e,t))}function IMr(i,e,t){var r=tre(i,e,t);return r>t?t:r}function L$t(){return{top:0,right:0,bottom:0,left:0}}function N$t(i){return Object.assign({},L$t(),i)}function $$t(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var AMr=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,N$t(typeof e!="number"?e:$$t(e,rle))};function MMr(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=XA(t.placement),l=oYe(a),u=[Rb,BS].indexOf(a)>=0,c=u?"height":"width";if(!(!s||!o)){var h=AMr(n.padding,t),p=sYe(s),m=l==="y"?Pb:Rb,v=l==="y"?$S:BS,w=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],S=o[l]-t.rects.reference[l],I=nle(s),R=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,L=w/2-S/2,k=h[m],B=R-p[c]-h[v],$=R/2-p[c]/2+L,V=tre(k,$,B),Y=l;t.modifiersData[r]=(e={},e[Y]=V,e.centerOffset=V-$,e)}}function OMr(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||k$t(e.elements.popper,n)&&(e.elements.arrow=n))}const PMr={name:"arrow",enabled:!0,phase:"main",fn:MMr,effect:OMr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function sq(i){return i.split("-")[1]}var RMr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function DMr(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:rq(t*n)/n||0,y:rq(r*n)/n||0}}function aht(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,u=i.adaptive,c=i.roundOffsets,h=i.isFixed,p=o.x,m=p===void 0?0:p,v=o.y,w=v===void 0?0:v,S=typeof c=="function"?c({x:m,y:w}):{x:m,y:w};m=S.x,w=S.y;var I=o.hasOwnProperty("x"),R=o.hasOwnProperty("y"),L=Rb,k=Pb,B=window;if(u){var $=nle(t),V="clientHeight",Y="clientWidth";if($===Nx(t)&&($=nL(t),TR($).position!=="static"&&a==="absolute"&&(V="scrollHeight",Y="scrollWidth")),$=$,n===Pb||(n===Rb||n===BS)&&s===Cse){k=$S;var K=h&&$===B&&B.visualViewport?B.visualViewport.height:$[V];w-=K-r.height,w*=l?1:-1}if(n===Rb||(n===Pb||n===$S)&&s===Cse){L=BS;var Q=h&&$===B&&B.visualViewport?B.visualViewport.width:$[Y];m-=Q-r.width,m*=l?1:-1}}var re=Object.assign({position:a},u&&RMr),ne=c===!0?DMr({x:m,y:w},Nx(t)):{x:m,y:w};if(m=ne.x,w=ne.y,l){var de;return Object.assign({},re,(de={},de[k]=R?"0":"",de[L]=I?"0":"",de.transform=(B.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",de))}return Object.assign({},re,(e={},e[k]=R?w+"px":"",e[L]=I?m+"px":"",e.transform="",e))}function FMr(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:XA(e.placement),variation:sq(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,aht(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,aht(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const kMr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:FMr,data:{}};var Zhe={passive:!0};function LMr(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=Nx(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(c){c.addEventListener("scroll",t.update,Zhe)}),a&&l.addEventListener("resize",t.update,Zhe),function(){s&&u.forEach(function(c){c.removeEventListener("scroll",t.update,Zhe)}),a&&l.removeEventListener("resize",t.update,Zhe)}}const NMr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:LMr,data:{}};var $Mr={left:"right",right:"left",bottom:"top",top:"bottom"};function Mge(i){return i.replace(/left|right|bottom|top/g,function(e){return $Mr[e]})}var BMr={start:"end",end:"start"};function lht(i){return i.replace(/start|end/g,function(e){return BMr[e]})}function aYe(i){var e=Nx(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function lYe(i){return nq(nL(i)).left+aYe(i).scrollLeft}function jMr(i,e){var t=Nx(i),r=nL(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var u=F$t();(u||!u&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+lYe(i),y:l}}function GMr(i){var e,t=nL(i),r=aYe(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=u9(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=u9(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+lYe(i),l=-r.scrollTop;return TR(n||t).direction==="rtl"&&(a+=u9(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function uYe(i){var e=TR(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function B$t(i){return["html","body","#document"].indexOf(b3(i))>=0?i.ownerDocument.body:CS(i)&&uYe(i)?i:B$t(dTe(i))}function ire(i,e){var t;e===void 0&&(e=[]);var r=B$t(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=Nx(r),o=n?[s].concat(s.visualViewport||[],uYe(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(ire(dTe(o)))}function $$e(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function UMr(i,e){var t=nq(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function uht(i,e,t){return e===R$t?$$e(jMr(i,t)):wB(e)?UMr(e,t):$$e(GMr(nL(i)))}function zMr(i){var e=ire(dTe(i)),t=["absolute","fixed"].indexOf(TR(i).position)>=0,r=t&&CS(i)?nle(i):i;return wB(r)?e.filter(function(n){return wB(n)&&k$t(n,r)&&b3(n)!=="body"}):[]}function VMr(i,e,t,r){var n=e==="clippingParents"?zMr(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,u){var c=uht(i,u,r);return l.top=u9(c.top,l.top),l.right=C_e(c.right,l.right),l.bottom=C_e(c.bottom,l.bottom),l.left=u9(c.left,l.left),l},uht(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function j$t(i){var e=i.reference,t=i.element,r=i.placement,n=r?XA(r):null,s=r?sq(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Pb:l={x:o,y:e.y-t.height};break;case $S:l={x:o,y:e.y+e.height};break;case BS:l={x:e.x+e.width,y:a};break;case Rb:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=n?oYe(n):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case iq:l[u]=l[u]-(e[c]/2-t[c]/2);break;case Cse:l[u]=l[u]+(e[c]/2-t[c]/2);break}}return l}function xB(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?cMr:a,u=t.rootBoundary,c=u===void 0?R$t:u,h=t.elementContext,p=h===void 0?ZJ:h,m=t.altBoundary,v=m===void 0?!1:m,w=t.padding,S=w===void 0?0:w,I=N$t(typeof S!="number"?S:$$t(S,rle)),R=p===ZJ?hMr:ZJ,L=i.rects.popper,k=i.elements[v?R:p],B=VMr(wB(k)?k:k.contextElement||nL(i.elements.popper),l,c,o),$=nq(i.elements.reference),V=j$t({reference:$,element:L,strategy:"absolute",placement:n}),Y=$$e(Object.assign({},L,V)),K=p===ZJ?Y:$,Q={top:B.top-K.top+I.top,bottom:K.bottom-B.bottom+I.bottom,left:B.left-K.left+I.left,right:K.right-B.right+I.right},re=i.modifiersData.offset;if(p===ZJ&&re){var ne=re[n];Object.keys(Q).forEach(function(de){var pe=[BS,$S].indexOf(de)>=0?1:-1,H=[Pb,$S].indexOf(de)>=0?"y":"x";Q[de]+=ne[H]*pe})}return Q}function HMr(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?D$t:l,c=sq(r),h=c?a?sht:sht.filter(function(v){return sq(v)===c}):rle,p=h.filter(function(v){return u.indexOf(v)>=0});p.length===0&&(p=h);var m=p.reduce(function(v,w){return v[w]=xB(i,{placement:w,boundary:n,rootBoundary:s,padding:o})[XA(w)],v},{});return Object.keys(m).sort(function(v,w){return m[v]-m[w]})}function WMr(i){if(XA(i)===rYe)return[];var e=Mge(i);return[lht(i),e,lht(e)]}function qMr(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,h=t.rootBoundary,p=t.altBoundary,m=t.flipVariations,v=m===void 0?!0:m,w=t.allowedAutoPlacements,S=e.options.placement,I=XA(S),R=I===S,L=l||(R||!v?[Mge(S)]:WMr(S)),k=[S].concat(L).reduce(function(Ve,$e){return Ve.concat(XA($e)===rYe?HMr(e,{placement:$e,boundary:c,rootBoundary:h,padding:u,flipVariations:v,allowedAutoPlacements:w}):$e)},[]),B=e.rects.reference,$=e.rects.popper,V=new Map,Y=!0,K=k[0],Q=0;Q=0,H=pe?"width":"height",Z=xB(e,{placement:re,boundary:c,rootBoundary:h,altBoundary:p,padding:u}),ae=pe?de?BS:Rb:de?$S:Pb;B[H]>$[H]&&(ae=Mge(ae));var fe=Mge(ae),be=[];if(s&&be.push(Z[ne]<=0),a&&be.push(Z[ae]<=0,Z[fe]<=0),be.every(function(Ve){return Ve})){K=re,Y=!1;break}V.set(re,be)}if(Y)for(var _e=v?3:1,Ie=function($e){var tt=k.find(function(yt){var Ct=V.get(yt);if(Ct)return Ct.slice(0,$e).every(function(ot){return ot})});if(tt)return K=tt,"break"},Te=_e;Te>0;Te--){var Be=Ie(Te);if(Be==="break")break}e.placement!==K&&(e.modifiersData[r]._skip=!0,e.placement=K,e.reset=!0)}}const YMr={name:"flip",enabled:!0,phase:"main",fn:qMr,requiresIfExists:["offset"],data:{_skip:!1}};function cht(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function hht(i){return[Pb,BS,$S,Rb].some(function(e){return i[e]>=0})}function XMr(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=xB(e,{elementContext:"reference"}),a=xB(e,{altBoundary:!0}),l=cht(o,r),u=cht(a,n,s),c=hht(l),h=hht(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const JMr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XMr};function KMr(i,e,t){var r=XA(i),n=[Rb,Pb].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Rb,BS].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function ZMr(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=D$t.reduce(function(c,h){return c[h]=KMr(h,e.rects,s),c},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}const QMr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ZMr};function eOr(i){var e=i.state,t=i.name;e.modifiersData[t]=j$t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const tOr={name:"popperOffsets",enabled:!0,phase:"read",fn:eOr,data:{}};function iOr(i){return i==="x"?"y":"x"}function rOr(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,h=t.padding,p=t.tether,m=p===void 0?!0:p,v=t.tetherOffset,w=v===void 0?0:v,S=xB(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:c}),I=XA(e.placement),R=sq(e.placement),L=!R,k=oYe(I),B=iOr(k),$=e.modifiersData.popperOffsets,V=e.rects.reference,Y=e.rects.popper,K=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,Q=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),re=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if($){if(s){var de,pe=k==="y"?Pb:Rb,H=k==="y"?$S:BS,Z=k==="y"?"height":"width",ae=$[k],fe=ae+S[pe],be=ae-S[H],_e=m?-Y[Z]/2:0,Ie=R===iq?V[Z]:Y[Z],Te=R===iq?-Y[Z]:-V[Z],Be=e.elements.arrow,Ve=m&&Be?sYe(Be):{width:0,height:0},$e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:L$t(),tt=$e[pe],yt=$e[H],Ct=tre(0,V[Z],Ve[Z]),ot=L?V[Z]/2-_e-Ct-tt-Q.mainAxis:Ie-Ct-tt-Q.mainAxis,vt=L?-V[Z]/2+_e+Ct+yt+Q.mainAxis:Te+Ct+yt+Q.mainAxis,At=e.elements.arrow&&nle(e.elements.arrow),Je=At?k==="y"?At.clientTop||0:At.clientLeft||0:0,it=(de=re?.[k])!=null?de:0,Ue=ae+ot-it-Je,ct=ae+vt-it,st=tre(m?C_e(fe,Ue):fe,ae,m?u9(be,ct):be);$[k]=st,ne[k]=st-ae}if(a){var Ze,ye=k==="x"?Pb:Rb,Ke=k==="x"?$S:BS,ke=$[B],me=B==="y"?"height":"width",ie=ke+S[ye],ge=ke-S[Ke],je=[Pb,Rb].indexOf(I)!==-1,rt=(Ze=re?.[B])!=null?Ze:0,Me=je?ie:ke-V[me]-Y[me]-rt+Q.altAxis,ht=je?ke+V[me]+Y[me]-rt-Q.altAxis:ge,Ht=m&&je?IMr(Me,ke,ht):tre(m?Me:ie,ke,m?ht:ge);$[B]=Ht,ne[B]=Ht-ke}e.modifiersData[r]=ne}}const nOr={name:"preventOverflow",enabled:!0,phase:"main",fn:rOr,requiresIfExists:["offset"]};function sOr(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function oOr(i){return i===Nx(i)||!CS(i)?aYe(i):sOr(i)}function aOr(i){var e=i.getBoundingClientRect(),t=rq(e.width)/i.offsetWidth||1,r=rq(e.height)/i.offsetHeight||1;return t!==1||r!==1}function lOr(i,e,t){t===void 0&&(t=!1);var r=CS(e),n=CS(e)&&aOr(e),s=nL(e),o=nq(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((b3(e)!=="body"||uYe(s))&&(a=oOr(e)),CS(e)?(l=nq(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=lYe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function uOr(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function cOr(i){var e=uOr(i);return wMr.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function hOr(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function dOr(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var dht={placement:"bottom",modifiers:[],strategy:"absolute"};function pht(){for(var i=arguments.length,e=new Array(i),t=0;t{r.value.update()})),Fa(()=>{window.addEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)},{capture:!0}),window.addEventListener("blur",()=>{t.value=!1}),window.addEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)}),Bv(()=>{const l={name:"overflowScroll",enabled:!0,phase:"main",fn({state:u}){const{bottom:c}=xB(u);c>0?(u.styles.popper.overflowY=c>100?"auto":void 0,u.styles.popper.overflowX="hidden",u.styles.popper.height=`${u.rects.popper.height-c-8}px`):u.styles.popper.height="auto"}};a.value&&o.value&&(r.value=G$t(a.value,o.value,{placement:e.position||"bottom",modifiers:[l,{name:"offset",options:{offset:[0,5]}}],...e.popperOptions}))})}),Ka(()=>{n.forEach(l=>l()),window.removeEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)},{capture:!0}),window.removeEventListener("blur",()=>{t.value=!1}),window.removeEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)}),t.value=!1}),(l,u)=>{const c=Nn("tippy");return qt(),si("div",{ref_key:"el",ref:s},[Ur((qt(),si("button",{type:"button",class:"text-gray-500 hover:text-black dropdown-button",onClick:u[0]||(u[0]=h=>t.value=!t.value),content:i.tooltip,"aria-label":i.ariaLabel?String(i.ariaLabel):String(i.tooltip),ref_key:"dropdownTrigger",ref:a},[Em(l.$slots,"header")],8,mOr)),[[c,{placement:i.tooltipPlacement,theme:i.tooltipTheme,animation:i.tooltipAnimation,appendTo:"parent"}]]),Ur(Ot("div",{onClick:u[1]||(u[1]=h=>r.value.update()),class:Wn(["rv-dropdown shadow-md border border-gray:200 py-8 bg-white rounded z-10",{"text-center":i.centered}]),ref_key:"dropdown",ref:o},[Em(l.$slots,"default",{close:()=>t.value=!t.value})],2),[[bf,t.value]])],512)}}}),w3=xp("notification",()=>{const i=vi([]),e=vi({}),t=Hr(()=>i.value.length>=99?99:i.value.length);function r(u){i.value=[u,...i.value]}function n(u){if(i.value.includes(u)){const c=i.value.indexOf(u);u instanceof U$t&&l(u),c>-1&&i.value.splice(c,1)}}function s(u){e.value[u.id]=u}function o(u,c){e.value[u]&&(e.value[u].messageList.push(c),i.value.includes(e.value[u])||(i.value=[e.value[u],...i.value]))}function a(){Object.values(e.value).forEach(u=>l(u)),i.value=[]}function l(u){const c=i.value.indexOf(u);c>-1&&i.value.splice(c,1),u.messageList=[]}return{notificationStack:i,groups:e,notificationNumber:t,showNotification:r,removeNotification:n,registerGroup:s,addToGroup:o,clearAll:a}}),gOr={class:"h-full flex flex-col"},yOr={class:"w-full flex mb-6"},vOr=["content","aria-label"],_Or=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1),bOr=[_Or],wOr=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const e=w3(),{t}=Qn(),r=Hr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Ko("panel-screen"),l=Nn("tippy");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(t)("notifications.title")),1)]),content:Rn(()=>[Ot("div",gOr,[Ot("div",yOr,[Ur((qt(),si("button",{type:"button",onClick:n,class:Wn(["p-4 ml-auto",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:ri(t)("notifications.controls.clearAll"),"aria-label":ri(t)("notifications.controls.clearAll")},bOr,10,vOr)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])]),Vn(z$t,{class:"overflow-y-auto"})])]),_:1},8,["panel"])}}});var K1=(i=>(i.ERROR="error",i.INFO="info",i.WARNING="warning",i))(K1||{});class xOr extends tf{notificationStore;constructor(e){super(e),this.$iApi.panel.register({id:"notifications",config:{screens:{"notifications-screen":Da(wOr)},alertName:"notifications.title"}}),this.notificationStore=w3(this.$vApp.$pinia)}show(e,t){this.notificationStore.showNotification({type:e,message:t})}addGroup(e,t,r){if(this.getGroup(e))throw new Error("Duplicate notification group id registration: "+e);const n=new U$t(this.$iApi,e,t,r);return this.notificationStore.registerGroup(n),n}getGroup(e){return this.notificationStore.groups[e]}}class U$t extends tf{notificationStore=w3(this.$vApp.$pinia);id;message;type;messageList=[];constructor(e,t,r,n){super(e),this.id=t,this.type=r,this.message=n}show(e){this.notificationStore.addToGroup(this.id,e)}}const SOr=["content"],TOr={class:"flex items-center text-left"},COr={class:"select-text cursor-text"},EOr=Ot("span",{class:"flex-grow"},null,-1),IOr=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Ot("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1),AOr=[IOr],MOr=["content"],OOr=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Ot("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1),POr=[OOr],ROr={key:0,class:"text-left"},DOr=Xr({__name:"notification-item",props:{notification:{type:Object,required:!0}},setup(i){const e=i,t=w3(),{t:r}=Qn(),n=vi(!1),s=Zl({[K1.WARNING]:"⚠",[K1.INFO]:"ℹ️",[K1.ERROR]:"❌"}),o=l=>{t.removeNotification(l)},a=()=>{if(!e.notification.messageList)return!1};return(l,u)=>{const c=Nn("tippy");return Ur((qt(),si("li",{class:Wn(["flex-col default-focus-style p-4",i.notification.messageList?"cursor-pointer":""]),content:ri(r)(n.value?"notifications.controls.collapse":"notifications.controls.expand"),onClick:u[1]||(u[1]=h=>n.value=!n.value)},[Ot("div",TOr,[Ot("span",null,[Xs(br(s[i.notification.type])+" ",1),Ot("span",COr,br(i.notification.message),1)]),EOr,i.notification.messageList?(qt(),si("div",{key:0,class:Wn(["dropdown-icon p-4 pointer-events-none",{"transform -rotate-180":n.value}])},AOr,2)):Yr("",!0),Ur((qt(),si("button",{type:"button",onClick:u[0]||(u[0]=ia(h=>o(i.notification),["stop"])),class:"mx-4 p-4",content:ri(r)("notifications.controls.dismiss")},POr,8,MOr)),[[c,{theme:"ramp4",animation:"scale"}]])]),i.notification.messageList&&n.value?(qt(),si("div",ROr,[(qt(!0),si(Ks,null,hu(i.notification.messageList,(h,p)=>(qt(),si("p",{key:i.notification.id+h+p},br(h),1))),128))])):Yr("",!0)],10,SOr)),[[c,{onShow:a,theme:"ramp4",animation:"scale"}]])}}}),FOr=["content"],kOr={key:0,class:"w-full border-b border-black"},LOr={key:1,class:"flex flex-col items-center h-full"},NOr=Ot("span",{class:"flex-grow"},null,-1),$Or=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-48 w-48 fill-current"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})],-1),BOr=Ot("span",{style:{"flex-grow":"6"}},null,-1),z$t=Xr({__name:"notification-list",setup(i){const e=w3(),{t}=Qn(),r=vi(),n=()=>{r.value._tippy.hide()},s=a=>{a.key==="Tab"&&r.value?.matches(":focus")&&r.value._tippy.show()};Fa(()=>{r.value?.addEventListener("blur",n),r.value?.addEventListener("keyup",s)}),Ka(()=>{r.value?.removeEventListener("blur",n),r.value?.removeEventListener("keyup",s)});const o=Hr(()=>e.notificationStack);return(a,l)=>{const u=Nn("focus-item"),c=Nn("focus-list"),h=Nn("tippy");return qt(),si("div",null,[o.value.length>0?Ur((qt(),si("ul",{key:0,content:ri(t)("panels.controls.items"),ref_key:"el",ref:r},[(qt(!0),si(Ks,null,hu(o.value,(p,m)=>(qt(),si(Ks,{key:p.message+m},[m>0?(qt(),si("div",kOr)):Yr("",!0),Ur(Vn(DOr,{class:Wn([p.type]),notification:p},null,8,["class","notification"]),[[u]])],64))),128))],8,FOr)),[[c],[h,{trigger:"manual",placement:"top-start"}]]):(qt(),si("div",LOr,[NOr,$Or,Ot("span",null,br(ri(t)("notifications.empty")),1),BOr]))])}}}),V$t=i=>(Dc("data-v-7bd23611"),i=i(),Fc(),i),jOr={class:"flex items-center hover:text-white"},GOr=["aria-label"],UOr=V$t(()=>Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"},null,-1)),zOr=[UOr],VOr={key:0,class:"number rounded-full w-18 text-white"},HOr={class:"notification-dropdown pointer-events-auto bg-white rounded text-center text-black w-500 h-256 flex flex-col p-0"},WOr={class:"pb-8 border-b border-gray-600"},qOr={class:"absolute flex right-3 top-3"},YOr=["content","aria-label"],XOr=V$t(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1)),JOr=[XOr],KOr=Xr({__name:"caption-button",setup(i){const e=w3(),{t}=Qn(),r=Hr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Ko("close"),l=Nn("tippy");return qt(),Dn(cYe,{position:"top-start",tooltip:ri(t)("notifications.title"),tooltipPlacement:"top",class:"pointer-events-auto sm:flex ml-4 mr-8"},{header:Rn(()=>[Ot("div",jOr,[(qt(),si("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-label":ri(t)("notifications.open")},zOr,8,GOr)),r.value&&r.value>0?(qt(),si("span",VOr,br(r.value),1)):Yr("",!0)])]),default:Rn(u=>[Ot("div",HOr,[Ot("div",null,[Ot("h4",WOr,br(ri(t)("notifications.title")),1),Ot("div",qOr,[Ur((qt(),si("button",{type:"button",onClick:n,class:Wn(["p-4 mr-6",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:ri(t)("notifications.controls.clearAll"),"aria-label":ri(t)("notifications.controls.clearAll")},JOr,10,YOr)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale",appendTo:"parent"}]]),Vn(a,{onClick:u.close},null,8,["onClick"])])]),Vn(z$t,{class:"overflow-y-auto h-230"})])]),_:1},8,["tooltip"])}}}),ZOr=ml(KOr,[["__scopeId","data-v-7bd23611"]]),H$t=i=>(Dc("data-v-02cf9ee5"),i=i(),Fc(),i),QOr={class:"flex hover:text-white"},ePr=["aria-label"],tPr=H$t(()=>Ot("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"},null,-1)),iPr=[tPr],rPr={class:"about-ramp-dropdown pointer-events-auto bg-white rounded w-256 h-50"},nPr={class:"pb-8 border-b border-gray-600 mb-10"},sPr={class:"absolute right-5 top-5"},oPr={class:"select-text"},aPr={class:"font-bold cursor-text"},lPr={class:"text-sm cursor-text"},uPr={class:"text-sm cursor-text"},cPr=H$t(()=>Ot("div",{class:"mt-5"},[Ot("a",{class:"text-sm underline text-blue-600",href:"https://github.com/ramp4-pcar4/ramp4-pcar4",target:"_blank"},[Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"inline-block fill-black w-16 h-16"},[Ot("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})]),Xs(" ramp4-pcar4 ")])],-1)),hPr=Xr({__name:"about-ramp-dropdown",props:{position:{type:String,default:"top-start"}},setup(i){const{t:e}=Qn(),t=Hr(()=>`${iK.major}.${iK.minor}.${iK.patch}`),r=Hr(()=>iK.hash.slice(0,9)),n=Hr(()=>{let s=new Date(iK.timestamp);if(isNaN(s))return"dev mode, no date";{const o=a=>a<10?"0"+a.toString():a.toString();return`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()} ${s.getHours()}:${o(s.getMinutes())}:${o(s.getSeconds())}`}});return(s,o)=>{const a=Ko("close"),l=Ko("dropdown-menu"),u=Nn("focus-item");return Ur((qt(),Dn(l,{class:"pointer-events-auto sm:flex",position:i.position,tooltip:ri(e)("ramp.about"),tooltipPlacement:i.position},{header:Rn(()=>[Ot("div",QOr,[(qt(),si("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20","aria-label":ri(e)("ramp.about.open")},iPr,8,ePr))])]),default:Rn(c=>[Ot("div",rPr,[Ot("div",null,[Ot("h4",nPr,br(ri(e)("ramp.about")),1),Ot("div",sPr,[Vn(a,{onClick:c.close},null,8,["onClick"])]),Ot("div",oPr,[Ot("div",null,[Ot("span",aPr,br(t.value),1),Ot("span",lPr," ["+br(r.value)+"] ",1)]),Ot("div",null,[Ot("span",uPr,br(n.value),1)]),cPr])])])]),_:1},8,["position","tooltip","tooltipPlacement"])),[[u]])}}}),W$t=ml(hPr,[["__scopeId","data-v-02cf9ee5"]]),dPr={class:"map-caption absolute bottom-0 flex justify-end pointer-events-auto cursor-default select-none text-gray-200 bg-black-75 left-0 right-0 py-2 sm:py-6"},pPr={key:0,class:"relative top-2 sm:top-1 ml-4 sm:ml-0 shrink-0"},fPr=["href","aria-label"],mPr=["src","alt"],gPr={key:1,class:"relative ml-10 top-2 text-sm sm:text-base"},yPr=Ot("span",{class:"flex-grow w-15"},null,-1),vPr={class:"flex min-w-fit justify-end"},_Pr={key:0,class:"pl-8 px-14 sm:block display-none relative top-2"},bPr=["aria-pressed","aria-label","content"],wPr={class:"relative top-1 text-sm sm:text-base"},xPr={class:"text-gray-200 hover:text-white text-sm sm:text-base pb-5"},SPr=["onClick"],TPr={key:0,class:"sr-only"},CPr=Xr({__name:"map-caption",setup(i){const e=oF(),t=bm(),{t:r}=Qn(),n=eo("iApi"),s=Hr(()=>e.scale),o=Hr(()=>e.attribution),a=Hr(()=>e.coords),l=Hr(()=>e.langtoggle),u=Hr(()=>t.config.map),c=vi([]),h=Zl([]);h.push(rl(u,w=>{w&&n.geo.map.caption.createCaption(u.value?.caption)})),Ka(()=>{h.forEach(w=>w())}),n7(()=>{Bv(()=>{n.$i18n.locale.value&&c.value.length==0&&(c.value=n.$i18n.availableLocales)})});const p=w=>{n.$i18n.locale.value!=w&&n.setLanguage(w)},m=()=>{e.toggleScale(),n.geo.map.caption.updateScale()},v=(w=!1)=>r(w?"map.toggleScaleToMetric":"map.toggleScaleToImperial");return(w,S)=>{const I=Ko("dropdown-menu"),R=Nn("truncate"),L=Nn("tippy");return qt(),si("div",dPr,[Vn(W$t,{class:"sm:block display-none ml-8 mr-4",position:"top-end"}),Vn(ZOr,{class:"sm:block display-none"}),o.value?.logo.disabled?Yr("",!0):(qt(),si("span",pPr,[Ot("a",{class:"pointer-events-auto cursor-pointer",href:o.value?.logo.link,target:"_blank","aria-label":o.value?.logo.altText},[Ot("img",{class:"object-contain h-18 sm:h-26",src:o.value?.logo.value,alt:o.value?.logo.altText},null,8,mPr)],8,fPr)])),o.value?.text.disabled?Yr("",!0):Ur((qt(),si("span",gPr,[Xs(br(o.value?.text.value),1)])),[[R,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),yPr,Ot("div",vPr,[a.value?.disabled?Yr("",!0):Ur((qt(),si("div",_Pr,[Xs(br(a.value?.formattedString),1)])),[[R,{options:{hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),s.value?.disabled?Yr("",!0):Ur((qt(),si("button",{key:1,type:"button",class:"flex-shrink-0 mx-2 sm:mx-10 px-4 pointer-events-auto cursor-pointer border-none",onClick:m,"aria-pressed":s.value?.isImperialScale,"aria-label":` +*/(function(i){(function(){var e=typeof window<"u"&&typeof window.document<"u"?window.document:{},t=i.exports,r=function(){for(var o,a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],l=0,u=a.length,c={};l-1}function Bi(ft,Wt){var hi=this.__data__,Pi=qn(hi,ft);return Pi<0?hi.push([ft,Wt]):hi[Pi][1]=Wt,this}Xt.prototype.clear=wi,Xt.prototype.delete=pi,Xt.prototype.get=Ri,Xt.prototype.has=Ui,Xt.prototype.set=Bi;function mi(ft){var Wt=-1,hi=ft?ft.length:0;for(this.clear();++Wt-1&&ft%1==0&&ft-1&&ft%1==0&&ft<=n}function jn(ft){var Wt=typeof ft;return!!ft&&(Wt=="object"||Wt=="function")}function co(ft){return!!ft&&typeof ft=="object"}function ua(ft){return Fi(ft)?Cn(ft):Ss(ft)}function Hs(){return[]}function Ll(){return!1}i.exports=xt})(x_e,x_e.exports);var A3r=x_e.exports;const Qct=X3(A3r),S_e=xp("maptip",()=>{const i=vi(void 0),e=vi(void 0),t=vi("");function r(o){i.value=o}function n(o){e.value=o}function s(o){t.value=o}return{maptipInstance:i,maptipPoint:e,content:t,setMaptipInstance:r,setMaptipPoint:n,setMaptipContent:s}}),M3r=Xr({__name:"esri-map",setup(i){const e=S_e(),t=eo("iApi"),r=Hr(()=>e.maptipPoint),n=Hr(()=>e.maptipInstance),s=Hr(()=>e.content),o=Zl([]);o.push(rl(r,()=>{if(r.value){let l,u;const c=t.geo.map.getPixelWidth()/2,h=0,p=t.geo.map.mapPointToScreenPoint(r.value);l=p.screenX-c,u=h-p.screenY,n.value.setProps({offset:[l,u]}),s.value&&s.value!==""&&n.value.show()}else n.value.hide()})),o.push(rl(s,l=>{l&&l!==""&&r?(n.value.setContent(l),n.value.show()):n.value.hide()})),Ka(()=>{o.forEach(l=>l())});const a=()=>{t.geo.map.setMouseFocus()};return(l,u)=>{const c=Nn("tippy");return Ur((qt(),si("div",{name:"esriMap",id:"esriMap",class:"h-full overflow-hidden",onMousedown:a,onKeydown:u[0]||(u[0]=Ph(ia(()=>{},["prevent"]),["up","down","left","right"]))},null,544)),[[c,{allowHTML:!0,zIndex:150,theme:"ramp4",trigger:"manual",appendTo:"parent",arrow:!1,delay:200,duration:[200,200]}]])}}});var p$t={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},qqe={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},O3r=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],T_e={CSS:{},springs:{}};function RA(i,e,t){return Math.min(Math.max(i,e),t)}function ere(i,e){return i.indexOf(e)>-1}function QMe(i,e){return i.apply(null,e)}var No={arr:function(i){return Array.isArray(i)},obj:function(i){return ere(Object.prototype.toString.call(i),"Object")},pth:function(i){return No.obj(i)&&i.hasOwnProperty("totalLength")},svg:function(i){return i instanceof SVGElement},inp:function(i){return i instanceof HTMLInputElement},dom:function(i){return i.nodeType||No.svg(i)},str:function(i){return typeof i=="string"},fnc:function(i){return typeof i=="function"},und:function(i){return typeof i>"u"},nil:function(i){return No.und(i)||i===null},hex:function(i){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(i)},rgb:function(i){return/^rgb/.test(i)},hsl:function(i){return/^hsl/.test(i)},col:function(i){return No.hex(i)||No.rgb(i)||No.hsl(i)},key:function(i){return!p$t.hasOwnProperty(i)&&!qqe.hasOwnProperty(i)&&i!=="targets"&&i!=="keyframes"}};function f$t(i){var e=/\(([^)]+)\)/.exec(i);return e?e[1].split(",").map(function(t){return parseFloat(t)}):[]}function m$t(i,e){var t=f$t(i),r=RA(No.und(t[0])?1:t[0],.1,100),n=RA(No.und(t[1])?100:t[1],.1,100),s=RA(No.und(t[2])?10:t[2],.1,100),o=RA(No.und(t[3])?0:t[3],.1,100),a=Math.sqrt(n/r),l=s/(2*Math.sqrt(n*r)),u=l<1?a*Math.sqrt(1-l*l):0,c=1,h=l<1?(l*a+-o)/u:-o+a;function p(v){var w=e?e*v/1e3:v;return l<1?w=Math.exp(-w*l*a)*(c*Math.cos(u*w)+h*Math.sin(u*w)):w=(c+h*w)*Math.exp(-w*a),v===0||v===1?v:1-w}function m(){var v=T_e.springs[i];if(v)return v;for(var w=1/6,S=0,I=0;;)if(S+=w,p(S)===1){if(I++,I>=16)break}else I=0;var R=S*w*1e3;return T_e.springs[i]=R,R}return e?p:m}function P3r(i){return i===void 0&&(i=10),function(e){return Math.ceil(RA(e,1e-6,1)*i)*(1/i)}}var R3r=function(){var i=11,e=1/(i-1);function t(c,h){return 1-3*h+3*c}function r(c,h){return 3*h-6*c}function n(c){return 3*c}function s(c,h,p){return((t(h,p)*c+r(h,p))*c+n(h))*c}function o(c,h,p){return 3*t(h,p)*c*c+2*r(h,p)*c+n(h)}function a(c,h,p,m,v){var w,S,I=0;do S=h+(p-h)/2,w=s(S,m,v)-c,w>0?p=S:h=S;while(Math.abs(w)>1e-7&&++I<10);return S}function l(c,h,p,m){for(var v=0;v<4;++v){var w=o(h,p,m);if(w===0)return h;var S=s(h,p,m)-c;h-=S/w}return h}function u(c,h,p,m){if(!(0<=c&&c<=1&&0<=p&&p<=1))return;var v=new Float32Array(i);if(c!==h||p!==m)for(var w=0;w=.001?l(I,$,c,p):V===0?$:a(I,R,R+e,c,p)}return function(I){return c===h&&p===m||I===0||I===1?I:s(S(I),h,m)}}return u}(),g$t=function(){var i={linear:function(){return function(r){return r}}},e={Sine:function(){return function(r){return 1-Math.cos(r*Math.PI/2)}},Circ:function(){return function(r){return 1-Math.sqrt(1-r*r)}},Back:function(){return function(r){return r*r*(3*r-2)}},Bounce:function(){return function(r){for(var n,s=4;r<((n=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((n*3-2)/22-r,2)}},Elastic:function(r,n){r===void 0&&(r=1),n===void 0&&(n=.5);var s=RA(r,1,10),o=RA(n,.1,2);return function(a){return a===0||a===1?a:-s*Math.pow(2,10*(a-1))*Math.sin((a-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},t=["Quad","Cubic","Quart","Quint","Expo"];return t.forEach(function(r,n){e[r]=function(){return function(s){return Math.pow(s,n+2)}}}),Object.keys(e).forEach(function(r){var n=e[r];i["easeIn"+r]=n,i["easeOut"+r]=function(s,o){return function(a){return 1-n(s,o)(1-a)}},i["easeInOut"+r]=function(s,o){return function(a){return a<.5?n(s,o)(a*2)/2:1-n(s,o)(a*-2+2)/2}},i["easeOutIn"+r]=function(s,o){return function(a){return a<.5?(1-n(s,o)(1-a*2))/2:(n(s,o)(a*2-1)+1)/2}}}),i}();function Yqe(i,e){if(No.fnc(i))return i;var t=i.split("(")[0],r=g$t[t],n=f$t(i);switch(t){case"spring":return m$t(i,e);case"cubicBezier":return QMe(R3r,n);case"steps":return QMe(P3r,n);default:return QMe(r,n)}}function y$t(i){try{var e=document.querySelectorAll(i);return e}catch{return}}function uTe(i,e){for(var t=i.length,r=arguments.length>=2?arguments[1]:void 0,n=[],s=0;s1&&(v-=1),v<1/6?p+(m-p)*6*v:v<1/2?m:v<2/3?p+(m-p)*(2/3-v)*6:p}var a,l,u;if(r==0)a=l=u=n;else{var c=n<.5?n*(1+r):n+r-n*r,h=2*n-c;a=o(h,c,t+1/3),l=o(h,c,t),u=o(h,c,t-1/3)}return"rgba("+a*255+","+l*255+","+u*255+","+s+")"}function L3r(i){if(No.rgb(i))return D3r(i);if(No.hex(i))return F3r(i);if(No.hsl(i))return k3r(i)}function HP(i){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(i);if(e)return e[1]}function N3r(i){if(ere(i,"translate")||i==="perspective")return"px";if(ere(i,"rotate")||ere(i,"skew"))return"deg"}function L$e(i,e){return No.fnc(i)?i(e.target,e.id,e.total):i}function DA(i,e){return i.getAttribute(e)}function Kqe(i,e,t){var r=HP(e);if(Xqe([t,"deg","rad","turn"],r))return e;var n=T_e.CSS[e+t];if(!No.und(n))return n;var s=100,o=document.createElement(i.tagName),a=i.parentNode&&i.parentNode!==document?i.parentNode:document.body;a.appendChild(o),o.style.position="absolute",o.style.width=s+t;var l=s/o.offsetWidth;a.removeChild(o);var u=l*parseFloat(e);return T_e.CSS[e+t]=u,u}function v$t(i,e,t){if(e in i.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),n=i.style[e]||getComputedStyle(i).getPropertyValue(r)||"0";return t?Kqe(i,n,t):n}}function Zqe(i,e){if(No.dom(i)&&!No.inp(i)&&(!No.nil(DA(i,e))||No.svg(i)&&i[e]))return"attribute";if(No.dom(i)&&Xqe(O3r,e))return"transform";if(No.dom(i)&&e!=="transform"&&v$t(i,e))return"css";if(i[e]!=null)return"object"}function _$t(i){if(No.dom(i)){for(var e=i.style.transform||"",t=/(\w+)\(([^)]*)\)/g,r=new Map,n;n=t.exec(e);)r.set(n[1],n[2]);return r}}function $3r(i,e,t,r){var n=ere(e,"scale")?1:0+N3r(e),s=_$t(i).get(e)||n;return t&&(t.transforms.list.set(e,s),t.transforms.last=e),r?Kqe(i,s,r):s}function Qqe(i,e,t,r){switch(Zqe(i,e)){case"transform":return $3r(i,e,r,t);case"css":return v$t(i,e,t);case"attribute":return DA(i,e);default:return i[e]||0}}function eYe(i,e){var t=/^(\*=|\+=|-=)/.exec(i);if(!t)return i;var r=HP(i)||0,n=parseFloat(e),s=parseFloat(i.replace(t[0],""));switch(t[0][0]){case"+":return n+s+r;case"-":return n-s+r;case"*":return n*s+r}}function b$t(i,e){if(No.col(i))return L3r(i);if(/\s/g.test(i))return i;var t=HP(i),r=t?i.substr(0,i.length-t.length):i;return e?r+e:r}function tYe(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function B3r(i){return Math.PI*2*DA(i,"r")}function j3r(i){return DA(i,"width")*2+DA(i,"height")*2}function G3r(i){return tYe({x:DA(i,"x1"),y:DA(i,"y1")},{x:DA(i,"x2"),y:DA(i,"y2")})}function w$t(i){for(var e=i.points,t=0,r,n=0;n0&&(t+=tYe(r,s)),r=s}return t}function U3r(i){var e=i.points;return w$t(i)+tYe(e.getItem(e.numberOfItems-1),e.getItem(0))}function x$t(i){if(i.getTotalLength)return i.getTotalLength();switch(i.tagName.toLowerCase()){case"circle":return B3r(i);case"rect":return j3r(i);case"line":return G3r(i);case"polyline":return w$t(i);case"polygon":return U3r(i)}}function z3r(i){var e=x$t(i);return i.setAttribute("stroke-dasharray",e),e}function V3r(i){for(var e=i.parentNode;No.svg(e)&&No.svg(e.parentNode);)e=e.parentNode;return e}function S$t(i,e){var t=e||{},r=t.el||V3r(i),n=r.getBoundingClientRect(),s=DA(r,"viewBox"),o=n.width,a=n.height,l=t.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:o,h:a,vW:l[2],vH:l[3]}}function H3r(i,e){var t=No.str(i)?y$t(i)[0]:i,r=e||100;return function(n){return{property:n,el:t,svg:S$t(t),totalLength:x$t(t)*(r/100)}}}function W3r(i,e,t){function r(c){c===void 0&&(c=0);var h=e+c>=1?e+c:0;return i.el.getPointAtLength(h)}var n=S$t(i.el,i.svg),s=r(),o=r(-1),a=r(1),l=t?1:n.w/n.vW,u=t?1:n.h/n.vH;switch(i.property){case"x":return(s.x-n.x)*l;case"y":return(s.y-n.y)*u;case"angle":return Math.atan2(a.y-o.y,a.x-o.x)*180/Math.PI}}function tht(i,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=b$t(No.pth(i)?i.totalLength:i,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:No.str(i)||e?r.split(t):[]}}function iYe(i){var e=i?cTe(No.arr(i)?i.map(eht):eht(i)):[];return uTe(e,function(t,r,n){return n.indexOf(t)===r})}function T$t(i){var e=iYe(i);return e.map(function(t,r){return{target:t,id:r,total:e.length,transforms:{list:_$t(t)}}})}function q3r(i,e){var t=Jqe(e);if(/^spring/.test(t.easing)&&(t.duration=m$t(t.easing)),No.arr(i)){var r=i.length,n=r===2&&!No.obj(i[0]);n?i={value:i}:No.fnc(e.duration)||(t.duration=e.duration/r)}var s=No.arr(i)?i:[i];return s.map(function(o,a){var l=No.obj(o)&&!No.pth(o)?o:{value:o};return No.und(l.delay)&&(l.delay=a?0:e.delay),No.und(l.endDelay)&&(l.endDelay=a===s.length-1?e.endDelay:0),l}).map(function(o){return hTe(o,t)})}function Y3r(i){for(var e=uTe(cTe(i.map(function(s){return Object.keys(s)})),function(s){return No.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),t={},r=function(s){var o=e[s];t[o]=i.map(function(a){var l={};for(var u in a)No.key(u)?u==o&&(l.value=a[u]):l[u]=a[u];return l})},n=0;n0&&(i=requestAnimationFrame(t))}function t(n){for(var s=MC.length,o=0;o0?requestAnimationFrame(t):void 0}function r(){bp.suspendWhenDocumentHidden&&(rht()?i=cancelAnimationFrame(i):(MC.forEach(function(n){return n._onDocumentVisibility()}),A$t()))}return typeof document<"u"&&document.addEventListener("visibilitychange",r),e}();function rht(){return!!document&&document.hidden}function bp(i){i===void 0&&(i={});var e=0,t=0,r=0,n,s=0,o=null;function a(R){var L=window.Promise&&new Promise(function(k){return o=k});return R.finished=L,L}var l=eMr(i);a(l);function u(){var R=l.direction;R!=="alternate"&&(l.direction=R!=="normal"?"normal":"reverse"),l.reversed=!l.reversed,n.forEach(function(L){return L.reversed=l.reversed})}function c(R){return l.reversed?l.duration-R:R}function h(){e=0,t=c(l.currentTime)*(1/bp.speed)}function p(R,L){L&&L.seek(R-L.timelineOffset)}function m(R){if(l.reversePlayback)for(var k=s;k--;)p(R,n[k]);else for(var L=0;L2||(be=Math.round(be*pe)/pe)),H.push(be)}var Te=de.length;if(!Te)ae=H[0];else{ae=de[0];for(var Be=0;Be0&&(l.began=!0,w("begin")),!l.loopBegan&&l.currentTime>0&&(l.loopBegan=!0,w("loopBegin")),$<=k&&l.currentTime!==0&&v(0),($>=B&&l.currentTime!==L||!L)&&v(L),$>k&&$=L&&(t=0,S(),l.remaining?(e=r,w("loopComplete"),l.loopBegan=!1,l.direction==="alternate"&&u()):(l.paused=!0,l.completed||(l.completed=!0,w("loopComplete"),w("complete"),!l.passThrough&&"Promise"in window&&(o(),a(l)))))}return l.reset=function(){var R=l.direction;l.passThrough=!1,l.currentTime=0,l.progress=0,l.paused=!0,l.began=!1,l.loopBegan=!1,l.changeBegan=!1,l.completed=!1,l.changeCompleted=!1,l.reversePlayback=!1,l.reversed=R==="reverse",l.remaining=l.loop,n=l.children,s=n.length;for(var L=s;L--;)l.children[L].reset();(l.reversed&&l.loop!==!0||R==="alternate"&&l.loop===1)&&l.remaining++,v(l.reversed?l.duration:0)},l._onDocumentVisibility=h,l.set=function(R,L){return E$t(R,L),l},l.tick=function(R){r=R,e||(e=r),I((r+(t-e))*bp.speed)},l.seek=function(R){I(c(R))},l.pause=function(){l.paused=!0,h()},l.play=function(){l.paused&&(l.completed&&l.reset(),l.paused=!1,MC.push(l),h(),A$t())},l.reverse=function(){u(),l.completed=!l.reversed,h()},l.restart=function(){l.reset(),l.play()},l.remove=function(R){var L=iYe(R);M$t(L,l)},l.reset(),l.autoplay&&l.play(),l}function nht(i,e){for(var t=e.length;t--;)Xqe(i,e[t].animatable.target)&&e.splice(t,1)}function M$t(i,e){var t=e.animations,r=e.children;nht(i,t);for(var n=r.length;n--;){var s=r[n],o=s.animations;nht(i,o),!o.length&&!s.children.length&&r.splice(n,1)}!t.length&&!r.length&&e.pause()}function tMr(i){for(var e=iYe(i),t=MC.length;t--;){var r=MC[t];M$t(e,r)}}function iMr(i,e){e===void 0&&(e={});var t=e.direction||"normal",r=e.easing?Yqe(e.easing):null,n=e.grid,s=e.axis,o=e.from||0,a=o==="first",l=o==="center",u=o==="last",c=No.arr(i),h=parseFloat(c?i[0]:i),p=c?parseFloat(i[1]):0,m=HP(c?i[1]:i)||0,v=e.start||0+(c?h:0),w=[],S=0;return function(I,R,L){if(a&&(o=0),l&&(o=(L-1)/2),u&&(o=L-1),!w.length){for(var k=0;k-1&&MC.splice(n,1);function o(p){p.passThrough=!0}for(var a=0;a=a?n.target.classList.add(o):n.target.classList.remove(o)})})}):void 0}observe(e){this.resizeObserver?.observe(e)}}const nMr=["data-cy"],P$t=Xr({__name:"panel-container",props:{panel:{type:Object,required:!0}},setup(i){const e=i,t=vi(null),r=vi(!1);Fa(()=>{e.panel.teleport&&new O$t({xs:0,sm:461,...e.panel.teleport.breakpoints}).observe(t.value)});const n=(l,u,c)=>{if(r.value)return u();bp({targets:l,opacity:{value:c,duration:400,easing:"cubicBezier(.5, .05, .1, .3)"},complete:u})},s=(l,u)=>{n(l,u,[0,1])},o=l=>{l.classList.contains("screen-spinner")||(r.value=e.panel.isScreenLoaded(e.panel.route.screen),t.value.querySelectorAll("[focus-item").forEach(u=>u.classList.remove("default-focus-style")))},a=(l,u)=>{n(l,u,[0,1])};return(l,u)=>{const c=Nn("focus-container");return qt(),si("div",{class:Wn(["shadow-tm bg-white h-full xs:mr-0 sm:mr-12 last:mr-0 pointer-events-auto min-w-0 shrink-0",i.panel.expanded?"flex-grow max-w-full":""]),style:s_(i.panel.style),"data-cy":i.panel.id,ref_key:"componentEl",ref:t},[Vn(eL,{onBeforeLeave:o,onLeave:a,onEnter:s},{default:Rn(()=>[Ur((qt(),Dn(xR(i.panel.route.screen),Kae(i.panel.route.props,{panel:i.panel}),null,16,["panel"])),[[c]])]),_:1})],14,nMr)}}}),w0=xp("panel",()=>{const i=vi(void 0),e=vi(void 0),t=vi(0),r=vi(0),n=vi(!1),s=vi(!0),o=vi({}),a=vi({}),l=vi([]),u=vi([]),c=vi([]),h=Hr(()=>r.value);function p(re){return re==="xs"&&c.value.length>0?[c.value.slice().pop()]:c.value}function m(re){const ne=[];return re.forEach(de=>{de in a.value&&ne.push(a.value[de].getPromise())}),ne}function v(re){$(re),k(),e.value=void 0}function w(re){V(re),k()}function S(re,ne){Y(re,ne),k()}function I(re){K(re),k()}function R(re){t.value=re,k()}function L(re){n.value=re}function k(){let re=t.value;const ne=[],de=350,pe=12;for(let H=l.value.length-1;H>=0;H--){let Z=l.value[H].width||de;n.value?Z=re:Z+=pe,(re>=Z&&!n.value||ne.length===0)&&(re-=Z,ne.unshift(l.value[H]))}if(i.value&&!ne.includes(i.value)&&!n.value){let H;for(let be=0;be=(i.value.width||de)?ne.unshift(i.value):e.value||(H=ne.shift(),ne.unshift(i.value));const Z=l.value.indexOf(i.value),ae=l.value.indexOf(H),fe=l.value.slice();ae>-1&&(fe.splice(Z,1),fe.splice(ae,0,i.value)),l.value=fe}r.value=re,c.value=ne}function B(re){if(o.value={...o.value,[re.id]:re},re.id in a.value)a.value[re.id].resolveMe();else{const ne=new Af;ne.resolveMe(),a.value={...a.value,[re.id]:ne}}}function $(re){re.teleport?u.value=[...u.value,re]:(l.value=[...l.value,re],e.value=re)}function V(re){if(re.teleport){const ne=u.value.indexOf(re);ne!==-1&&(u.value=[...u.value.slice(0,ne),...u.value.slice(ne+1)])}else{const ne=l.value.indexOf(re);ne!==-1&&(l.value=[...l.value.slice(0,ne),...l.value.slice(ne+1)])}}function Y(re,ne){const de=l.value.indexOf(re),pe=ne==="right"?1:-1;c.value.includes(l.value[de+pe])&&([l.value[de],l.value[de+pe]]=[l.value[de+pe],l.value[de]])}function K(re){o.value[re.id]!==void 0&&delete o.value[re.id],a.value[re.id]!==void 0&&delete a.value[re.id];const ne=c.value.indexOf(re);ne!==-1&&(c.value=[...c.value.slice(0,ne),...c.value.slice(ne+1)]),i.value&&i.value.id==re.id&&(i.value=void 0)}function Q(re){a.value={...a.value,[re]:new Af}}return{items:o,regPromises:a,orderedItems:l,pinned:i,priority:e,visible:c,stackWidth:t,remWidth:r,mobileView:n,reorderable:s,teleported:u,getRemainingWidth:h,getVisible:p,getRegPromises:m,openPanel:v,closePanel:w,movePanel:S,removePanel:I,setStackWidth:R,setMobileView:L,updateVisible:k,registerPanel:B,addRegPromise:Q}}),sMr=Xr({__name:"panel-stack",setup(i){const e=w0(),t=eo("iApi"),r=vi(),n=Hr(()=>e.mobileView);Fa(()=>{new ResizeObserver(c=>{const h=!(t?.$vApp.$root?.$refs["app-size"]).classList.contains("sm");n.value!==h&&(e.mobileView=h,t?.event.emit(ln.RAMP_MOBILEVIEW_CHANGE,h)),e.setStackWidth(c[0].contentRect.width)}).observe(r.value?.$el)});const s=u=>e.getVisible(u),o=(u,c)=>{l(u,c,[[6,0],[0,1]])},a=(u,c)=>{const[h,p]=[u.children[0].getBoundingClientRect(),u.parentElement.getBoundingClientRect()];u.style.width=`${h.width}px`,u.style.height=`${h.height}px`,u.style.left=`${h.left-p.left}px`,u.style.position="absolute",l(u,c,[[0,-6],[1,0]])},l=(u,c,h)=>{bp({targets:u,duration:300,translateY:{value:h[0],easing:"cubicBezier(.5, .05, .1, .3)"},opacity:{value:h[1],duration:250,easing:"cubicBezier(.5, .05, .1, .3)"},complete:c})};return(u,c)=>(qt(),Dn(XSe,{onEnter:o,onLeave:a,name:"panel-container",tag:"div",ref_key:"el",ref:r},{default:Rn(()=>[(qt(!0),si(Ks,null,hu(s(ri(t).screenSize),h=>(qt(),Dn(P$t,{key:`${h.id}`,panel:h},null,8,["panel"]))),128))]),_:1},512))}}),ml=(i,e)=>{const t=i.__vccOpts||i;for(const[r,n]of e)t[r]=n;return t},oMr=ml(sMr,[["__scopeId","data-v-6def3362"]]);var Pb="top",$S="bottom",BS="right",Rb="left",rYe="auto",rle=[Pb,$S,BS,Rb],iq="start",Cse="end",aMr="clippingParents",R$t="viewport",ZJ="popper",lMr="reference",sht=rle.reduce(function(i,e){return i.concat([e+"-"+iq,e+"-"+Cse])},[]),D$t=[].concat(rle,[rYe]).reduce(function(i,e){return i.concat([e,e+"-"+iq,e+"-"+Cse])},[]),uMr="beforeRead",cMr="read",hMr="afterRead",dMr="beforeMain",pMr="main",fMr="afterMain",mMr="beforeWrite",gMr="write",yMr="afterWrite",vMr=[uMr,cMr,hMr,dMr,pMr,fMr,mMr,gMr,yMr];function b3(i){return i?(i.nodeName||"").toLowerCase():null}function Nx(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function wB(i){var e=Nx(i).Element;return i instanceof e||i instanceof Element}function CS(i){var e=Nx(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function nYe(i){if(typeof ShadowRoot>"u")return!1;var e=Nx(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function _Mr(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!CS(s)||!b3(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function bMr(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,u){return l[u]="",l},{});!CS(n)||!b3(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}const wMr={name:"applyStyles",enabled:!0,phase:"write",fn:_Mr,effect:bMr,requires:["computeStyles"]};function XA(i){return i.split("-")[0]}var u9=Math.max,C_e=Math.min,rq=Math.round;function N$e(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function F$t(){return!/^((?!chrome|android).)*safari/i.test(N$e())}function nq(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&CS(i)&&(n=i.offsetWidth>0&&rq(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&rq(r.height)/i.offsetHeight||1);var o=wB(i)?Nx(i):window,a=o.visualViewport,l=!F$t()&&t,u=(r.left+(l&&a?a.offsetLeft:0))/n,c=(r.top+(l&&a?a.offsetTop:0))/s,h=r.width/n,p=r.height/s;return{width:h,height:p,top:c,right:u+h,bottom:c+p,left:u,x:u,y:c}}function sYe(i){var e=nq(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function k$t(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&nYe(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function TR(i){return Nx(i).getComputedStyle(i)}function xMr(i){return["table","td","th"].indexOf(b3(i))>=0}function nL(i){return((wB(i)?i.ownerDocument:i.document)||window.document).documentElement}function dTe(i){return b3(i)==="html"?i:i.assignedSlot||i.parentNode||(nYe(i)?i.host:null)||nL(i)}function oht(i){return!CS(i)||TR(i).position==="fixed"?null:i.offsetParent}function SMr(i){var e=/firefox/i.test(N$e()),t=/Trident/i.test(N$e());if(t&&CS(i)){var r=TR(i);if(r.position==="fixed")return null}var n=dTe(i);for(nYe(n)&&(n=n.host);CS(n)&&["html","body"].indexOf(b3(n))<0;){var s=TR(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function nle(i){for(var e=Nx(i),t=oht(i);t&&xMr(t)&&TR(t).position==="static";)t=oht(t);return t&&(b3(t)==="html"||b3(t)==="body"&&TR(t).position==="static")?e:t||SMr(i)||e}function oYe(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function tre(i,e,t){return u9(i,C_e(e,t))}function TMr(i,e,t){var r=tre(i,e,t);return r>t?t:r}function L$t(){return{top:0,right:0,bottom:0,left:0}}function N$t(i){return Object.assign({},L$t(),i)}function $$t(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var CMr=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,N$t(typeof e!="number"?e:$$t(e,rle))};function EMr(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=XA(t.placement),l=oYe(a),u=[Rb,BS].indexOf(a)>=0,c=u?"height":"width";if(!(!s||!o)){var h=CMr(n.padding,t),p=sYe(s),m=l==="y"?Pb:Rb,v=l==="y"?$S:BS,w=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],S=o[l]-t.rects.reference[l],I=nle(s),R=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,L=w/2-S/2,k=h[m],B=R-p[c]-h[v],$=R/2-p[c]/2+L,V=tre(k,$,B),Y=l;t.modifiersData[r]=(e={},e[Y]=V,e.centerOffset=V-$,e)}}function IMr(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||k$t(e.elements.popper,n)&&(e.elements.arrow=n))}const AMr={name:"arrow",enabled:!0,phase:"main",fn:EMr,effect:IMr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function sq(i){return i.split("-")[1]}var MMr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function OMr(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:rq(t*n)/n||0,y:rq(r*n)/n||0}}function aht(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,u=i.adaptive,c=i.roundOffsets,h=i.isFixed,p=o.x,m=p===void 0?0:p,v=o.y,w=v===void 0?0:v,S=typeof c=="function"?c({x:m,y:w}):{x:m,y:w};m=S.x,w=S.y;var I=o.hasOwnProperty("x"),R=o.hasOwnProperty("y"),L=Rb,k=Pb,B=window;if(u){var $=nle(t),V="clientHeight",Y="clientWidth";if($===Nx(t)&&($=nL(t),TR($).position!=="static"&&a==="absolute"&&(V="scrollHeight",Y="scrollWidth")),$=$,n===Pb||(n===Rb||n===BS)&&s===Cse){k=$S;var K=h&&$===B&&B.visualViewport?B.visualViewport.height:$[V];w-=K-r.height,w*=l?1:-1}if(n===Rb||(n===Pb||n===$S)&&s===Cse){L=BS;var Q=h&&$===B&&B.visualViewport?B.visualViewport.width:$[Y];m-=Q-r.width,m*=l?1:-1}}var re=Object.assign({position:a},u&&MMr),ne=c===!0?OMr({x:m,y:w},Nx(t)):{x:m,y:w};if(m=ne.x,w=ne.y,l){var de;return Object.assign({},re,(de={},de[k]=R?"0":"",de[L]=I?"0":"",de.transform=(B.devicePixelRatio||1)<=1?"translate("+m+"px, "+w+"px)":"translate3d("+m+"px, "+w+"px, 0)",de))}return Object.assign({},re,(e={},e[k]=R?w+"px":"",e[L]=I?m+"px":"",e.transform="",e))}function PMr(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:XA(e.placement),variation:sq(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,aht(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,aht(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const RMr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:PMr,data:{}};var Zhe={passive:!0};function DMr(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=Nx(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(c){c.addEventListener("scroll",t.update,Zhe)}),a&&l.addEventListener("resize",t.update,Zhe),function(){s&&u.forEach(function(c){c.removeEventListener("scroll",t.update,Zhe)}),a&&l.removeEventListener("resize",t.update,Zhe)}}const FMr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:DMr,data:{}};var kMr={left:"right",right:"left",bottom:"top",top:"bottom"};function Mge(i){return i.replace(/left|right|bottom|top/g,function(e){return kMr[e]})}var LMr={start:"end",end:"start"};function lht(i){return i.replace(/start|end/g,function(e){return LMr[e]})}function aYe(i){var e=Nx(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function lYe(i){return nq(nL(i)).left+aYe(i).scrollLeft}function NMr(i,e){var t=Nx(i),r=nL(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var u=F$t();(u||!u&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+lYe(i),y:l}}function $Mr(i){var e,t=nL(i),r=aYe(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=u9(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=u9(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+lYe(i),l=-r.scrollTop;return TR(n||t).direction==="rtl"&&(a+=u9(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function uYe(i){var e=TR(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function B$t(i){return["html","body","#document"].indexOf(b3(i))>=0?i.ownerDocument.body:CS(i)&&uYe(i)?i:B$t(dTe(i))}function ire(i,e){var t;e===void 0&&(e=[]);var r=B$t(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=Nx(r),o=n?[s].concat(s.visualViewport||[],uYe(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(ire(dTe(o)))}function $$e(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function BMr(i,e){var t=nq(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function uht(i,e,t){return e===R$t?$$e(NMr(i,t)):wB(e)?BMr(e,t):$$e($Mr(nL(i)))}function jMr(i){var e=ire(dTe(i)),t=["absolute","fixed"].indexOf(TR(i).position)>=0,r=t&&CS(i)?nle(i):i;return wB(r)?e.filter(function(n){return wB(n)&&k$t(n,r)&&b3(n)!=="body"}):[]}function GMr(i,e,t,r){var n=e==="clippingParents"?jMr(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,u){var c=uht(i,u,r);return l.top=u9(c.top,l.top),l.right=C_e(c.right,l.right),l.bottom=C_e(c.bottom,l.bottom),l.left=u9(c.left,l.left),l},uht(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function j$t(i){var e=i.reference,t=i.element,r=i.placement,n=r?XA(r):null,s=r?sq(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Pb:l={x:o,y:e.y-t.height};break;case $S:l={x:o,y:e.y+e.height};break;case BS:l={x:e.x+e.width,y:a};break;case Rb:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=n?oYe(n):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case iq:l[u]=l[u]-(e[c]/2-t[c]/2);break;case Cse:l[u]=l[u]+(e[c]/2-t[c]/2);break}}return l}function xB(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?aMr:a,u=t.rootBoundary,c=u===void 0?R$t:u,h=t.elementContext,p=h===void 0?ZJ:h,m=t.altBoundary,v=m===void 0?!1:m,w=t.padding,S=w===void 0?0:w,I=N$t(typeof S!="number"?S:$$t(S,rle)),R=p===ZJ?lMr:ZJ,L=i.rects.popper,k=i.elements[v?R:p],B=GMr(wB(k)?k:k.contextElement||nL(i.elements.popper),l,c,o),$=nq(i.elements.reference),V=j$t({reference:$,element:L,strategy:"absolute",placement:n}),Y=$$e(Object.assign({},L,V)),K=p===ZJ?Y:$,Q={top:B.top-K.top+I.top,bottom:K.bottom-B.bottom+I.bottom,left:B.left-K.left+I.left,right:K.right-B.right+I.right},re=i.modifiersData.offset;if(p===ZJ&&re){var ne=re[n];Object.keys(Q).forEach(function(de){var pe=[BS,$S].indexOf(de)>=0?1:-1,H=[Pb,$S].indexOf(de)>=0?"y":"x";Q[de]+=ne[H]*pe})}return Q}function UMr(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?D$t:l,c=sq(r),h=c?a?sht:sht.filter(function(v){return sq(v)===c}):rle,p=h.filter(function(v){return u.indexOf(v)>=0});p.length===0&&(p=h);var m=p.reduce(function(v,w){return v[w]=xB(i,{placement:w,boundary:n,rootBoundary:s,padding:o})[XA(w)],v},{});return Object.keys(m).sort(function(v,w){return m[v]-m[w]})}function zMr(i){if(XA(i)===rYe)return[];var e=Mge(i);return[lht(i),e,lht(e)]}function VMr(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,h=t.rootBoundary,p=t.altBoundary,m=t.flipVariations,v=m===void 0?!0:m,w=t.allowedAutoPlacements,S=e.options.placement,I=XA(S),R=I===S,L=l||(R||!v?[Mge(S)]:zMr(S)),k=[S].concat(L).reduce(function(Ve,$e){return Ve.concat(XA($e)===rYe?UMr(e,{placement:$e,boundary:c,rootBoundary:h,padding:u,flipVariations:v,allowedAutoPlacements:w}):$e)},[]),B=e.rects.reference,$=e.rects.popper,V=new Map,Y=!0,K=k[0],Q=0;Q=0,H=pe?"width":"height",Z=xB(e,{placement:re,boundary:c,rootBoundary:h,altBoundary:p,padding:u}),ae=pe?de?BS:Rb:de?$S:Pb;B[H]>$[H]&&(ae=Mge(ae));var fe=Mge(ae),be=[];if(s&&be.push(Z[ne]<=0),a&&be.push(Z[ae]<=0,Z[fe]<=0),be.every(function(Ve){return Ve})){K=re,Y=!1;break}V.set(re,be)}if(Y)for(var _e=v?3:1,Ie=function($e){var tt=k.find(function(yt){var Ct=V.get(yt);if(Ct)return Ct.slice(0,$e).every(function(ot){return ot})});if(tt)return K=tt,"break"},Te=_e;Te>0;Te--){var Be=Ie(Te);if(Be==="break")break}e.placement!==K&&(e.modifiersData[r]._skip=!0,e.placement=K,e.reset=!0)}}const HMr={name:"flip",enabled:!0,phase:"main",fn:VMr,requiresIfExists:["offset"],data:{_skip:!1}};function cht(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function hht(i){return[Pb,BS,$S,Rb].some(function(e){return i[e]>=0})}function WMr(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=xB(e,{elementContext:"reference"}),a=xB(e,{altBoundary:!0}),l=cht(o,r),u=cht(a,n,s),c=hht(l),h=hht(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}const qMr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WMr};function YMr(i,e,t){var r=XA(i),n=[Rb,Pb].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Rb,BS].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function XMr(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=D$t.reduce(function(c,h){return c[h]=YMr(h,e.rects,s),c},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}const JMr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:XMr};function KMr(i){var e=i.state,t=i.name;e.modifiersData[t]=j$t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const ZMr={name:"popperOffsets",enabled:!0,phase:"read",fn:KMr,data:{}};function QMr(i){return i==="x"?"y":"x"}function eOr(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,h=t.padding,p=t.tether,m=p===void 0?!0:p,v=t.tetherOffset,w=v===void 0?0:v,S=xB(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:c}),I=XA(e.placement),R=sq(e.placement),L=!R,k=oYe(I),B=QMr(k),$=e.modifiersData.popperOffsets,V=e.rects.reference,Y=e.rects.popper,K=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,Q=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),re=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if($){if(s){var de,pe=k==="y"?Pb:Rb,H=k==="y"?$S:BS,Z=k==="y"?"height":"width",ae=$[k],fe=ae+S[pe],be=ae-S[H],_e=m?-Y[Z]/2:0,Ie=R===iq?V[Z]:Y[Z],Te=R===iq?-Y[Z]:-V[Z],Be=e.elements.arrow,Ve=m&&Be?sYe(Be):{width:0,height:0},$e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:L$t(),tt=$e[pe],yt=$e[H],Ct=tre(0,V[Z],Ve[Z]),ot=L?V[Z]/2-_e-Ct-tt-Q.mainAxis:Ie-Ct-tt-Q.mainAxis,vt=L?-V[Z]/2+_e+Ct+yt+Q.mainAxis:Te+Ct+yt+Q.mainAxis,At=e.elements.arrow&&nle(e.elements.arrow),Je=At?k==="y"?At.clientTop||0:At.clientLeft||0:0,it=(de=re?.[k])!=null?de:0,Ue=ae+ot-it-Je,ct=ae+vt-it,st=tre(m?C_e(fe,Ue):fe,ae,m?u9(be,ct):be);$[k]=st,ne[k]=st-ae}if(a){var Ze,ye=k==="x"?Pb:Rb,Ke=k==="x"?$S:BS,ke=$[B],me=B==="y"?"height":"width",ie=ke+S[ye],ge=ke-S[Ke],je=[Pb,Rb].indexOf(I)!==-1,rt=(Ze=re?.[B])!=null?Ze:0,Me=je?ie:ke-V[me]-Y[me]-rt+Q.altAxis,ht=je?ke+V[me]+Y[me]-rt-Q.altAxis:ge,Ht=m&&je?TMr(Me,ke,ht):tre(m?Me:ie,ke,m?ht:ge);$[B]=Ht,ne[B]=Ht-ke}e.modifiersData[r]=ne}}const tOr={name:"preventOverflow",enabled:!0,phase:"main",fn:eOr,requiresIfExists:["offset"]};function iOr(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function rOr(i){return i===Nx(i)||!CS(i)?aYe(i):iOr(i)}function nOr(i){var e=i.getBoundingClientRect(),t=rq(e.width)/i.offsetWidth||1,r=rq(e.height)/i.offsetHeight||1;return t!==1||r!==1}function sOr(i,e,t){t===void 0&&(t=!1);var r=CS(e),n=CS(e)&&nOr(e),s=nL(e),o=nq(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((b3(e)!=="body"||uYe(s))&&(a=rOr(e)),CS(e)?(l=nq(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=lYe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function oOr(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function aOr(i){var e=oOr(i);return vMr.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function lOr(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function uOr(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var dht={placement:"bottom",modifiers:[],strategy:"absolute"};function pht(){for(var i=arguments.length,e=new Array(i),t=0;t{r.value.update()})),Fa(()=>{window.addEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)},{capture:!0}),window.addEventListener("blur",()=>{t.value=!1}),window.addEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)}),Bv(()=>{const l={name:"overflowScroll",enabled:!0,phase:"main",fn({state:u}){const{bottom:c}=xB(u);c>0?(u.styles.popper.overflowY=c>100?"auto":void 0,u.styles.popper.overflowX="hidden",u.styles.popper.height=`${u.rects.popper.height-c-8}px`):u.styles.popper.height="auto"}};a.value&&o.value&&(r.value=G$t(a.value,o.value,{placement:e.position||"bottom",modifiers:[l,{name:"offset",options:{offset:[0,5]}}],...e.popperOptions}))})}),Ka(()=>{n.forEach(l=>l()),window.removeEventListener("click",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)},{capture:!0}),window.removeEventListener("blur",()=>{t.value=!1}),window.removeEventListener("focusin",l=>{(!s.value||!s.value.contains(l.target))&&(t.value=!1)}),t.value=!1}),(l,u)=>{const c=Nn("tippy");return qt(),si("div",{ref_key:"el",ref:s},[Ur((qt(),si("button",{type:"button",class:"text-gray-500 hover:text-black dropdown-button",onClick:u[0]||(u[0]=h=>t.value=!t.value),content:i.tooltip,"aria-label":i.ariaLabel?String(i.ariaLabel):String(i.tooltip),ref_key:"dropdownTrigger",ref:a},[Em(l.$slots,"header")],8,dOr)),[[c,{placement:i.tooltipPlacement,theme:i.tooltipTheme,animation:i.tooltipAnimation,appendTo:"parent"}]]),Ur(Ot("div",{onClick:u[1]||(u[1]=h=>r.value.update()),class:Wn(["rv-dropdown shadow-md border border-gray:200 py-8 bg-white rounded z-10",{"text-center":i.centered}]),ref_key:"dropdown",ref:o},[Em(l.$slots,"default",{close:()=>t.value=!t.value})],2),[[bf,t.value]])],512)}}}),w3=xp("notification",()=>{const i=vi([]),e=vi({}),t=Hr(()=>i.value.length>=99?99:i.value.length);function r(u){i.value=[u,...i.value]}function n(u){if(i.value.includes(u)){const c=i.value.indexOf(u);u instanceof U$t&&l(u),c>-1&&i.value.splice(c,1)}}function s(u){e.value[u.id]=u}function o(u,c){e.value[u]&&(e.value[u].messageList.push(c),i.value.includes(e.value[u])||(i.value=[e.value[u],...i.value]))}function a(){Object.values(e.value).forEach(u=>l(u)),i.value=[]}function l(u){const c=i.value.indexOf(u);c>-1&&i.value.splice(c,1),u.messageList=[]}return{notificationStack:i,groups:e,notificationNumber:t,showNotification:r,removeNotification:n,registerGroup:s,addToGroup:o,clearAll:a}}),pOr={class:"h-full flex flex-col"},fOr={class:"w-full flex mb-6"},mOr=["content","aria-label"],gOr=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1),yOr=[gOr],vOr=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const e=w3(),{t}=Qn(),r=Hr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Ko("panel-screen"),l=Nn("tippy");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(t)("notifications.title")),1)]),content:Rn(()=>[Ot("div",pOr,[Ot("div",fOr,[Ur((qt(),si("button",{type:"button",onClick:n,class:Wn(["p-4 ml-auto",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:ri(t)("notifications.controls.clearAll"),"aria-label":ri(t)("notifications.controls.clearAll")},yOr,10,mOr)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale"}]])]),Vn(z$t,{class:"overflow-y-auto"})])]),_:1},8,["panel"])}}});var K1=(i=>(i.ERROR="error",i.INFO="info",i.WARNING="warning",i))(K1||{});class _Or extends tf{notificationStore;constructor(e){super(e),this.$iApi.panel.register({id:"notifications",config:{screens:{"notifications-screen":Da(vOr)},alertName:"notifications.title"}}),this.notificationStore=w3(this.$vApp.$pinia)}show(e,t){this.notificationStore.showNotification({type:e,message:t})}addGroup(e,t,r){if(this.getGroup(e))throw new Error("Duplicate notification group id registration: "+e);const n=new U$t(this.$iApi,e,t,r);return this.notificationStore.registerGroup(n),n}getGroup(e){return this.notificationStore.groups[e]}}class U$t extends tf{notificationStore=w3(this.$vApp.$pinia);id;message;type;messageList=[];constructor(e,t,r,n){super(e),this.id=t,this.type=r,this.message=n}show(e){this.notificationStore.addToGroup(this.id,e)}}const bOr=["content"],wOr={class:"flex items-center text-left"},xOr={class:"select-text cursor-text"},SOr=Ot("span",{class:"flex-grow"},null,-1),TOr=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Ot("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1),COr=[TOr],EOr=["content"],IOr=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Ot("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1),AOr=[IOr],MOr={key:0,class:"text-left"},OOr=Xr({__name:"notification-item",props:{notification:{type:Object,required:!0}},setup(i){const e=i,t=w3(),{t:r}=Qn(),n=vi(!1),s=Zl({[K1.WARNING]:"⚠",[K1.INFO]:"ℹ️",[K1.ERROR]:"❌"}),o=l=>{t.removeNotification(l)},a=()=>{if(!e.notification.messageList)return!1};return(l,u)=>{const c=Nn("tippy");return Ur((qt(),si("li",{class:Wn(["flex-col default-focus-style p-4",i.notification.messageList?"cursor-pointer":""]),content:ri(r)(n.value?"notifications.controls.collapse":"notifications.controls.expand"),onClick:u[1]||(u[1]=h=>n.value=!n.value)},[Ot("div",wOr,[Ot("span",null,[Xs(br(s[i.notification.type])+" ",1),Ot("span",xOr,br(i.notification.message),1)]),SOr,i.notification.messageList?(qt(),si("div",{key:0,class:Wn(["dropdown-icon p-4 pointer-events-none",{"transform -rotate-180":n.value}])},COr,2)):Yr("",!0),Ur((qt(),si("button",{type:"button",onClick:u[0]||(u[0]=ia(h=>o(i.notification),["stop"])),class:"mx-4 p-4",content:ri(r)("notifications.controls.dismiss")},AOr,8,EOr)),[[c,{theme:"ramp4",animation:"scale"}]])]),i.notification.messageList&&n.value?(qt(),si("div",MOr,[(qt(!0),si(Ks,null,hu(i.notification.messageList,(h,p)=>(qt(),si("p",{key:i.notification.id+h+p},br(h),1))),128))])):Yr("",!0)],10,bOr)),[[c,{onShow:a,theme:"ramp4",animation:"scale"}]])}}}),POr=["content"],ROr={key:0,class:"w-full border-b border-black"},DOr={key:1,class:"flex flex-col items-center h-full"},FOr=Ot("span",{class:"flex-grow"},null,-1),kOr=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-48 w-48 fill-current"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"})],-1),LOr=Ot("span",{style:{"flex-grow":"6"}},null,-1),z$t=Xr({__name:"notification-list",setup(i){const e=w3(),{t}=Qn(),r=vi(),n=()=>{r.value._tippy.hide()},s=a=>{a.key==="Tab"&&r.value?.matches(":focus")&&r.value._tippy.show()};Fa(()=>{r.value?.addEventListener("blur",n),r.value?.addEventListener("keyup",s)}),Ka(()=>{r.value?.removeEventListener("blur",n),r.value?.removeEventListener("keyup",s)});const o=Hr(()=>e.notificationStack);return(a,l)=>{const u=Nn("focus-item"),c=Nn("focus-list"),h=Nn("tippy");return qt(),si("div",null,[o.value.length>0?Ur((qt(),si("ul",{key:0,content:ri(t)("panels.controls.items"),ref_key:"el",ref:r},[(qt(!0),si(Ks,null,hu(o.value,(p,m)=>(qt(),si(Ks,{key:p.message+m},[m>0?(qt(),si("div",ROr)):Yr("",!0),Ur(Vn(OOr,{class:Wn([p.type]),notification:p},null,8,["class","notification"]),[[u]])],64))),128))],8,POr)),[[c],[h,{trigger:"manual",placement:"top-start"}]]):(qt(),si("div",DOr,[FOr,kOr,Ot("span",null,br(ri(t)("notifications.empty")),1),LOr]))])}}}),V$t=i=>(Dc("data-v-7bd23611"),i=i(),Fc(),i),NOr={class:"flex items-center hover:text-white"},$Or=["aria-label"],BOr=V$t(()=>Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"},null,-1)),jOr=[BOr],GOr={key:0,class:"number rounded-full w-18 text-white"},UOr={class:"notification-dropdown pointer-events-auto bg-white rounded text-center text-black w-500 h-256 flex flex-col p-0"},zOr={class:"pb-8 border-b border-gray-600"},VOr={class:"absolute flex right-3 top-3"},HOr=["content","aria-label"],WOr=V$t(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current h-24 w-24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z"})],-1)),qOr=[WOr],YOr=Xr({__name:"caption-button",setup(i){const e=w3(),{t}=Qn(),r=Hr(()=>e.notificationNumber),n=()=>e.clearAll();return(s,o)=>{const a=Ko("close"),l=Nn("tippy");return qt(),Dn(cYe,{position:"top-start",tooltip:ri(t)("notifications.title"),tooltipPlacement:"top",class:"pointer-events-auto sm:flex ml-4 mr-8"},{header:Rn(()=>[Ot("div",NOr,[(qt(),si("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","aria-label":ri(t)("notifications.open")},jOr,8,$Or)),r.value&&r.value>0?(qt(),si("span",GOr,br(r.value),1)):Yr("",!0)])]),default:Rn(u=>[Ot("div",UOr,[Ot("div",null,[Ot("h4",zOr,br(ri(t)("notifications.title")),1),Ot("div",VOr,[Ur((qt(),si("button",{type:"button",onClick:n,class:Wn(["p-4 mr-6",[r.value?"text-gray-500 hover:text-black":"text-gray-300 cursor-default pointer-events-none"]]),content:ri(t)("notifications.controls.clearAll"),"aria-label":ri(t)("notifications.controls.clearAll")},qOr,10,HOr)),[[l,{placement:"bottom",theme:"ramp4",animation:"scale",appendTo:"parent"}]]),Vn(a,{onClick:u.close},null,8,["onClick"])])]),Vn(z$t,{class:"overflow-y-auto h-230"})])]),_:1},8,["tooltip"])}}}),XOr=ml(YOr,[["__scopeId","data-v-7bd23611"]]),H$t=i=>(Dc("data-v-02cf9ee5"),i=i(),Fc(),i),JOr={class:"flex hover:text-white"},KOr=["aria-label"],ZOr=H$t(()=>Ot("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"},null,-1)),QOr=[ZOr],ePr={class:"about-ramp-dropdown pointer-events-auto bg-white rounded w-256 h-50"},tPr={class:"pb-8 border-b border-gray-600 mb-10"},iPr={class:"absolute right-5 top-5"},rPr={class:"select-text"},nPr={class:"font-bold cursor-text"},sPr={class:"text-sm cursor-text"},oPr={class:"text-sm cursor-text"},aPr=H$t(()=>Ot("div",{class:"mt-5"},[Ot("a",{class:"text-sm underline text-blue-600",href:"https://github.com/ramp4-pcar4/ramp4-pcar4",target:"_blank"},[Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"inline-block fill-black w-16 h-16"},[Ot("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})]),Xs(" ramp4-pcar4 ")])],-1)),lPr=Xr({__name:"about-ramp-dropdown",props:{position:{type:String,default:"top-start"}},setup(i){const{t:e}=Qn(),t=Hr(()=>`${iK.major}.${iK.minor}.${iK.patch}`),r=Hr(()=>iK.hash.slice(0,9)),n=Hr(()=>{let s=new Date(iK.timestamp);if(isNaN(s))return"dev mode, no date";{const o=a=>a<10?"0"+a.toString():a.toString();return`${s.getFullYear()}-${s.getMonth()+1}-${s.getDate()} ${s.getHours()}:${o(s.getMinutes())}:${o(s.getSeconds())}`}});return(s,o)=>{const a=Ko("close"),l=Ko("dropdown-menu"),u=Nn("focus-item");return Ur((qt(),Dn(l,{class:"pointer-events-auto sm:flex",position:i.position,tooltip:ri(e)("ramp.about"),tooltipPlacement:i.position},{header:Rn(()=>[Ot("div",JOr,[(qt(),si("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20","aria-label":ri(e)("ramp.about.open")},QOr,8,KOr))])]),default:Rn(c=>[Ot("div",ePr,[Ot("div",null,[Ot("h4",tPr,br(ri(e)("ramp.about")),1),Ot("div",iPr,[Vn(a,{onClick:c.close},null,8,["onClick"])]),Ot("div",rPr,[Ot("div",null,[Ot("span",nPr,br(t.value),1),Ot("span",sPr," ["+br(r.value)+"] ",1)]),Ot("div",null,[Ot("span",oPr,br(n.value),1)]),aPr])])])]),_:1},8,["position","tooltip","tooltipPlacement"])),[[u]])}}}),W$t=ml(lPr,[["__scopeId","data-v-02cf9ee5"]]),uPr={class:"map-caption absolute bottom-0 flex justify-end pointer-events-auto cursor-default select-none text-gray-200 bg-black-75 left-0 right-0 py-2 sm:py-6"},cPr={key:0,class:"relative top-2 sm:top-1 ml-4 sm:ml-0 shrink-0"},hPr=["href","aria-label"],dPr=["src","alt"],pPr={key:1,class:"relative ml-10 top-2 text-sm sm:text-base"},fPr=Ot("span",{class:"flex-grow w-15"},null,-1),mPr={class:"flex min-w-fit justify-end"},gPr={key:0,class:"pl-8 px-14 sm:block display-none relative top-2"},yPr=["aria-pressed","aria-label","content"],vPr={class:"relative top-1 text-sm sm:text-base"},_Pr={class:"text-gray-200 hover:text-white text-sm sm:text-base pb-5"},bPr=["onClick"],wPr={key:0,class:"sr-only"},xPr=Xr({__name:"map-caption",setup(i){const e=oF(),t=bm(),{t:r}=Qn(),n=eo("iApi"),s=Hr(()=>e.scale),o=Hr(()=>e.attribution),a=Hr(()=>e.coords),l=Hr(()=>e.langtoggle),u=Hr(()=>t.config.map),c=vi([]),h=Zl([]);h.push(rl(u,w=>{w&&n.geo.map.caption.createCaption(u.value?.caption)})),Ka(()=>{h.forEach(w=>w())}),n7(()=>{Bv(()=>{n.$i18n.locale.value&&c.value.length==0&&(c.value=n.$i18n.availableLocales)})});const p=w=>{n.$i18n.locale.value!=w&&n.setLanguage(w)},m=()=>{e.toggleScale(),n.geo.map.caption.updateScale()},v=(w=!1)=>r(w?"map.toggleScaleToMetric":"map.toggleScaleToImperial");return(w,S)=>{const I=Ko("dropdown-menu"),R=Nn("truncate"),L=Nn("tippy");return qt(),si("div",uPr,[Vn(W$t,{class:"sm:block display-none ml-8 mr-4",position:"top-end"}),Vn(XOr,{class:"sm:block display-none"}),o.value?.logo.disabled?Yr("",!0):(qt(),si("span",cPr,[Ot("a",{class:"pointer-events-auto cursor-pointer",href:o.value?.logo.link,target:"_blank","aria-label":o.value?.logo.altText},[Ot("img",{class:"object-contain h-18 sm:h-26",src:o.value?.logo.value,alt:o.value?.logo.altText},null,8,dPr)],8,hPr)])),o.value?.text.disabled?Yr("",!0):Ur((qt(),si("span",pPr,[Xs(br(o.value?.text.value),1)])),[[R,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),fPr,Ot("div",mPr,[a.value?.disabled?Yr("",!0):Ur((qt(),si("div",gPr,[Xs(br(a.value?.formattedString),1)])),[[R,{options:{hideOnClick:!1,theme:"ramp4",animation:"scale"}}]]),s.value?.disabled?Yr("",!0):Ur((qt(),si("button",{key:1,type:"button",class:"flex-shrink-0 mx-2 sm:mx-10 px-4 pointer-events-auto cursor-pointer border-none",onClick:m,"aria-pressed":s.value?.isImperialScale,"aria-label":` ${s.value?.label} - ${v(s.value?.isImperialScale)} - `,content:v(s.value?.isImperialScale)},[Ot("span",{class:"border-solid border-2 border-white border-t-0 h-5 mr-4 inline-block",style:s_({width:s.value?.width})},null,4),Ot("span",wPr,br(s.value?.label),1)],8,bPr)),[[L,{delay:[300,0],placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale",touch:["hold",200]}]]),l.value?.disabled?Yr("",!0):(qt(),Dn(I,{key:2,class:"flex-shrink-0 pointer-events-auto focus:outline-none px-4 mr-4 relative top-2",position:"top-end",tooltip:ri(r)("map.changeLanguage"),ariaLabel:`${ri(r)("map.language.short")} - ${ri(r)("map.changeLanguage")}`},{header:Rn(()=>[Ot("span",xPr,br(ri(r)("map.language.short")),1)]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(c.value,(k,B)=>(qt(),si("a",{key:`${k}-${B}`,class:Wn(["flex-auto items-center text-sm sm:text-base cursor-pointer",{"font-bold":k===ri(n).$i18n.locale.value}]),href:"javascript:;",onClick:$=>p(k)},[Xs(br(ri(r)("map.language."+k))+" ",1),k===ri(n).$i18n.locale.value?(qt(),si("span",TPr,br(ri(r)("map.language.curr")),1)):Yr("",!0)],10,SPr))),128))]),_:1},8,["tooltip","ariaLabel"]))])])}}}),EPr=i=>(Dc("data-v-4181d508"),i=i(),Fc(),i),IPr=["content"],APr=EPr(()=>Ot("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),MPr={key:0,class:"number absolute -top-2 -right-2 text-white w-18 rounded-full"},OPr=Xr({__name:"floating-button",setup(i){const e=w3(),t=eo("iApi"),{t:r}=Qn(),n=Hr(()=>e.notificationNumber);return(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{type:"button",onClick:o[0]||(o[0]=l=>ri(t).panel.get("notifications").open()),class:"pointer-events-auto items-center absolute left-8 bottom-36 p-6 block sm:display-none bg-black-75 rounded-full text-gray-400 hover:text-white",content:ri(r)("notifications.title")},[APr,n.value&&n.value>0?(qt(),si("span",MPr,br(n.value),1)):Yr("",!0)],8,IPr)),[[a]])}}}),PPr=ml(OPr,[["__scopeId","data-v-4181d508"]]),RPr={class:"flex items-center mb-20"},DPr={class:"text-xl"},FPr=Xr({__name:"keyboard-instructions",setup(i){const e=eo("iApi"),{t}=Qn(),r=vi(!1),n=vi(["app","lists","map"]),s=vi([]),o=vi(null),a=vi(null);Fa(()=>{s.value.push(e.event.on("openKeyboardInstructions",()=>{r.value=!0,Bv(()=>{o.value.focus()})}))}),Ka(()=>{s.value.forEach(u=>e?.event.off(u))});const l=u=>{u.key==="Tab"?u.shiftKey&&u.target===o.value?(u.preventDefault(),a.value.focus()):!u.shiftKey&&u.target===a.value&&(u.preventDefault(),o.value.focus()):u.key==="Escape"&&(u.preventDefault(),r.value=!1)};return(u,c)=>{const h=Ko("close");return r.value?(qt(),si("div",{key:0,class:"absolute inset-0 flex justify-center items-center bg-opacity-30 bg-black z-50 pointer-events-auto",onClick:c[3]||(c[3]=p=>r.value=!1),onKeydown:l},[Ot("div",{class:"bg-white w-500 pointer-events-auto shadow-2xl p-20 flex flex-col",onClick:c[2]||(c[2]=ia(()=>{},["stop","prevent"])),tabindex:"0",ref_key:"firstEl",ref:o},[Ot("div",RPr,[Ot("h2",DPr,br(ri(t)("keyboardInstructions.title")),1),Vn(h,{class:"ml-auto",onClick:c[0]||(c[0]=p=>r.value=!1)})]),(qt(!0),si(Ks,null,hu(n.value,p=>(qt(),si("p",{class:"whitespace-pre-line pb-10",key:p},br(ri(t)(`keyboardInstructions.${p}`)),1))),128)),Ot("button",{type:"button",class:"mt-auto self-end mr-10 mb-10 px-20 py-10",onClick:c[1]||(c[1]=p=>r.value=!1),ref_key:"lastEl",ref:a},br(ri(t)("keyboardInstructions.OK")),513)],512)],32)):Yr("",!0)}}}),dU=xp("instance",()=>({started:vi(!1)})),q$t=i=>(Dc("data-v-8c24ed63"),i=i(),Fc(),i),kPr={class:"h-full relative"},LPr={class:"inner-shell absolute top-0 left-0 h-full w-full pointer-events-none"},NPr=q$t(()=>Ot("div",{class:"sr-only screen-reader-alert"},null,-1)),$Pr={class:"absolute top-8 w-full flex justify-center"},BPr={key:1,class:"w-full h-full"},jPr=q$t(()=>Ot("div",{class:"spinner relative inset-x-1/2 inset-y-9/20"},null,-1)),GPr=[jPr],UPr=Xr({__name:"shell",setup(i){const e=eo("iApi"),t=dU(),r=oA(),n=w0(),{t:s}=Qn(),o=Hr(()=>r.items.appbar),a=()=>{e?.event.emit("openKeyboardInstructions")},l=()=>n.teleported;return(u,c)=>(qt(),si("div",kPr,[Ot("div",LPr,[NPr,Ot("div",$Pr,[Ot("button",{type:"button",class:"bg-white opacity-0 focus:opacity-100 z-50 shadow-md px-10",onClick:a},br(ri(s)("keyboardInstructions.open")),1)]),Vn(FPr),Vn(uMr,{class:"panel-stack sm:flex absolute inset-0 overflow-hidden sm:p-12 z-10 sm:pl-80 xs:pl-40 sm:pb-48 xs:pb-28 xs:pr-0 sm:pr-40"}),o.value?Yr("",!0):(qt(),Dn(PPr,{key:0})),Vn(CPr,{class:"z-30"})]),ri(t).started?(qt(),Dn(R3r,{key:0})):(qt(),si("div",BPr,GPr)),(qt(!0),si(Ks,null,hu(l(),h=>(qt(),Dn(cqe,{to:h.teleport?.target,key:h.id},[(qt(),Dn(P$t,{key:`${h.id}`,panel:h},null,8,["panel"]))],8,["to"]))),128))]))}}),zPr=ml(UPr,[["__scopeId","data-v-8c24ed63"]]);/*! + `,content:v(s.value?.isImperialScale)},[Ot("span",{class:"border-solid border-2 border-white border-t-0 h-5 mr-4 inline-block",style:s_({width:s.value?.width})},null,4),Ot("span",vPr,br(s.value?.label),1)],8,yPr)),[[L,{delay:[300,0],placement:"top",hideOnClick:!1,theme:"ramp4",animation:"scale",touch:["hold",200]}]]),l.value?.disabled?Yr("",!0):(qt(),Dn(I,{key:2,class:"flex-shrink-0 pointer-events-auto focus:outline-none px-4 mr-4 relative top-2",position:"top-end",tooltip:ri(r)("map.changeLanguage"),ariaLabel:`${ri(r)("map.language.short")} - ${ri(r)("map.changeLanguage")}`},{header:Rn(()=>[Ot("span",_Pr,br(ri(r)("map.language.short")),1)]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(c.value,(k,B)=>(qt(),si("a",{key:`${k}-${B}`,class:Wn(["flex-auto items-center text-sm sm:text-base cursor-pointer",{"font-bold":k===ri(n).$i18n.locale.value}]),href:"javascript:;",onClick:$=>p(k)},[Xs(br(ri(r)("map.language."+k))+" ",1),k===ri(n).$i18n.locale.value?(qt(),si("span",wPr,br(ri(r)("map.language.curr")),1)):Yr("",!0)],10,bPr))),128))]),_:1},8,["tooltip","ariaLabel"]))])])}}}),SPr=i=>(Dc("data-v-4181d508"),i=i(),Fc(),i),TPr=["content"],CPr=SPr(()=>Ot("svg",{class:"fill-current w-24 h-24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),EPr={key:0,class:"number absolute -top-2 -right-2 text-white w-18 rounded-full"},IPr=Xr({__name:"floating-button",setup(i){const e=w3(),t=eo("iApi"),{t:r}=Qn(),n=Hr(()=>e.notificationNumber);return(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{type:"button",onClick:o[0]||(o[0]=l=>ri(t).panel.get("notifications").open()),class:"pointer-events-auto items-center absolute left-8 bottom-36 p-6 block sm:display-none bg-black-75 rounded-full text-gray-400 hover:text-white",content:ri(r)("notifications.title")},[CPr,n.value&&n.value>0?(qt(),si("span",EPr,br(n.value),1)):Yr("",!0)],8,TPr)),[[a]])}}}),APr=ml(IPr,[["__scopeId","data-v-4181d508"]]),MPr={class:"flex items-center mb-20"},OPr={class:"text-xl"},PPr=Xr({__name:"keyboard-instructions",setup(i){const e=eo("iApi"),{t}=Qn(),r=vi(!1),n=vi(["app","lists","map"]),s=vi([]),o=vi(null),a=vi(null);Fa(()=>{s.value.push(e.event.on("openKeyboardInstructions",()=>{r.value=!0,Bv(()=>{o.value.focus()})}))}),Ka(()=>{s.value.forEach(u=>e?.event.off(u))});const l=u=>{u.key==="Tab"?u.shiftKey&&u.target===o.value?(u.preventDefault(),a.value.focus()):!u.shiftKey&&u.target===a.value&&(u.preventDefault(),o.value.focus()):u.key==="Escape"&&(u.preventDefault(),r.value=!1)};return(u,c)=>{const h=Ko("close");return r.value?(qt(),si("div",{key:0,class:"absolute inset-0 flex justify-center items-center bg-opacity-30 bg-black z-50 pointer-events-auto",onClick:c[3]||(c[3]=p=>r.value=!1),onKeydown:l},[Ot("div",{class:"bg-white w-500 pointer-events-auto shadow-2xl p-20 flex flex-col",onClick:c[2]||(c[2]=ia(()=>{},["stop","prevent"])),tabindex:"0",ref_key:"firstEl",ref:o},[Ot("div",MPr,[Ot("h2",OPr,br(ri(t)("keyboardInstructions.title")),1),Vn(h,{class:"ml-auto",onClick:c[0]||(c[0]=p=>r.value=!1)})]),(qt(!0),si(Ks,null,hu(n.value,p=>(qt(),si("p",{class:"whitespace-pre-line pb-10",key:p},br(ri(t)(`keyboardInstructions.${p}`)),1))),128)),Ot("button",{type:"button",class:"mt-auto self-end mr-10 mb-10 px-20 py-10",onClick:c[1]||(c[1]=p=>r.value=!1),ref_key:"lastEl",ref:a},br(ri(t)("keyboardInstructions.OK")),513)],512)],32)):Yr("",!0)}}}),dU=xp("instance",()=>({started:vi(!1)})),q$t=i=>(Dc("data-v-8c24ed63"),i=i(),Fc(),i),RPr={class:"h-full relative"},DPr={class:"inner-shell absolute top-0 left-0 h-full w-full pointer-events-none"},FPr=q$t(()=>Ot("div",{class:"sr-only screen-reader-alert"},null,-1)),kPr={class:"absolute top-8 w-full flex justify-center"},LPr={key:1,class:"w-full h-full"},NPr=q$t(()=>Ot("div",{class:"spinner relative inset-x-1/2 inset-y-9/20"},null,-1)),$Pr=[NPr],BPr=Xr({__name:"shell",setup(i){const e=eo("iApi"),t=dU(),r=oA(),n=w0(),{t:s}=Qn(),o=Hr(()=>r.items.appbar),a=()=>{e?.event.emit("openKeyboardInstructions")},l=()=>n.teleported;return(u,c)=>(qt(),si("div",RPr,[Ot("div",DPr,[FPr,Ot("div",kPr,[Ot("button",{type:"button",class:"bg-white opacity-0 focus:opacity-100 z-50 shadow-md px-10",onClick:a},br(ri(s)("keyboardInstructions.open")),1)]),Vn(PPr),Vn(oMr,{class:"panel-stack sm:flex absolute inset-0 overflow-hidden sm:p-12 z-10 sm:pl-80 xs:pl-40 sm:pb-48 xs:pb-28 xs:pr-0 sm:pr-40"}),o.value?Yr("",!0):(qt(),Dn(APr,{key:0})),Vn(xPr,{class:"z-30"})]),ri(t).started?(qt(),Dn(M3r,{key:0})):(qt(),si("div",LPr,$Pr)),(qt(!0),si(Ks,null,hu(l(),h=>(qt(),Dn(cqe,{to:h.teleport?.target,key:h.id},[(qt(),Dn(P$t,{key:`${h.id}`,panel:h},null,8,["panel"]))],8,["to"]))),128))]))}}),jPr=ml(BPr,[["__scopeId","data-v-8c24ed63"]]);/*! * vue-tippy v6.4.4 * (c) 2024 * @license MIT - */var Db="top",jS="bottom",GS="right",Fb="left",hYe="auto",sle=[Db,jS,GS,Fb],oq="start",Ese="end",VPr="clippingParents",Y$t="viewport",QJ="popper",HPr="reference",fht=sle.reduce(function(i,e){return i.concat([e+"-"+oq,e+"-"+Ese])},[]),X$t=[].concat(sle,[hYe]).reduce(function(i,e){return i.concat([e,e+"-"+oq,e+"-"+Ese])},[]),WPr="beforeRead",qPr="read",YPr="afterRead",XPr="beforeMain",JPr="main",KPr="afterMain",ZPr="beforeWrite",QPr="write",eRr="afterWrite",tRr=[WPr,qPr,YPr,XPr,JPr,KPr,ZPr,QPr,eRr];function x3(i){return i?(i.nodeName||"").toLowerCase():null}function OE(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function aq(i){var e=OE(i).Element;return i instanceof e||i instanceof Element}function ES(i){var e=OE(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function J$t(i){if(typeof ShadowRoot>"u")return!1;var e=OE(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function iRr(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!ES(s)||!x3(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function rRr(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,u){return l[u]="",l},{});!ES(n)||!x3(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var K$t={name:"applyStyles",enabled:!0,phase:"write",fn:iRr,effect:rRr,requires:["computeStyles"]};function JA(i){return i.split("-")[0]}var c9=Math.max,E_e=Math.min,lq=Math.round;function uq(i,e){e===void 0&&(e=!1);var t=i.getBoundingClientRect(),r=1,n=1;if(ES(i)&&e){var s=i.offsetHeight,o=i.offsetWidth;o>0&&(r=lq(t.width)/o||1),s>0&&(n=lq(t.height)/s||1)}return{width:t.width/r,height:t.height/n,top:t.top/n,right:t.right/r,bottom:t.bottom/n,left:t.left/r,x:t.left/r,y:t.top/n}}function dYe(i){var e=uq(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Z$t(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&J$t(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function S3(i){return OE(i).getComputedStyle(i)}function nRr(i){return["table","td","th"].indexOf(x3(i))>=0}function sL(i){return((aq(i)?i.ownerDocument:i.document)||window.document).documentElement}function pTe(i){return x3(i)==="html"?i:i.assignedSlot||i.parentNode||(J$t(i)?i.host:null)||sL(i)}function mht(i){return!ES(i)||S3(i).position==="fixed"?null:i.offsetParent}function sRr(i){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&ES(i)){var r=S3(i);if(r.position==="fixed")return null}for(var n=pTe(i);ES(n)&&["html","body"].indexOf(x3(n))<0;){var s=S3(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function ole(i){for(var e=OE(i),t=mht(i);t&&nRr(t)&&S3(t).position==="static";)t=mht(t);return t&&(x3(t)==="html"||x3(t)==="body"&&S3(t).position==="static")?e:t||sRr(i)||e}function pYe(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function rre(i,e,t){return c9(i,E_e(e,t))}function oRr(i,e,t){var r=rre(i,e,t);return r>t?t:r}function Q$t(){return{top:0,right:0,bottom:0,left:0}}function e6t(i){return Object.assign({},Q$t(),i)}function t6t(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var aRr=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,e6t(typeof e!="number"?e:t6t(e,sle))};function lRr(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=JA(t.placement),l=pYe(a),u=[Fb,GS].indexOf(a)>=0,c=u?"height":"width";if(!(!s||!o)){var h=aRr(n.padding,t),p=dYe(s),m=l==="y"?Db:Fb,v=l==="y"?jS:GS,w=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],S=o[l]-t.rects.reference[l],I=ole(s),R=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,L=w/2-S/2,k=h[m],B=R-p[c]-h[v],$=R/2-p[c]/2+L,V=rre(k,$,B),Y=l;t.modifiersData[r]=(e={},e[Y]=V,e.centerOffset=V-$,e)}}function uRr(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Z$t(e.elements.popper,n)&&(e.elements.arrow=n))}var cRr={name:"arrow",enabled:!0,phase:"main",fn:lRr,effect:uRr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cq(i){return i.split("-")[1]}var hRr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function dRr(i){var e=i.x,t=i.y,r=window,n=r.devicePixelRatio||1;return{x:lq(e*n)/n||0,y:lq(t*n)/n||0}}function ght(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,u=i.adaptive,c=i.roundOffsets,h=i.isFixed,p=c===!0?dRr(o):typeof c=="function"?c(o):o,m=p.x,v=m===void 0?0:m,w=p.y,S=w===void 0?0:w,I=o.hasOwnProperty("x"),R=o.hasOwnProperty("y"),L=Fb,k=Db,B=window;if(u){var $=ole(t),V="clientHeight",Y="clientWidth";if($===OE(t)&&($=sL(t),S3($).position!=="static"&&a==="absolute"&&(V="scrollHeight",Y="scrollWidth")),$=$,n===Db||(n===Fb||n===GS)&&s===Ese){k=jS;var K=h&&B.visualViewport?B.visualViewport.height:$[V];S-=K-r.height,S*=l?1:-1}if(n===Fb||(n===Db||n===jS)&&s===Ese){L=GS;var Q=h&&B.visualViewport?B.visualViewport.width:$[Y];v-=Q-r.width,v*=l?1:-1}}var re=Object.assign({position:a},u&&hRr);if(l){var ne;return Object.assign({},re,(ne={},ne[k]=R?"0":"",ne[L]=I?"0":"",ne.transform=(B.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",ne))}return Object.assign({},re,(e={},e[k]=R?S+"px":"",e[L]=I?v+"px":"",e.transform="",e))}function pRr(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:JA(e.placement),variation:cq(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ght(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ght(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var fRr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pRr,data:{}},Qhe={passive:!0};function mRr(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=OE(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(c){c.addEventListener("scroll",t.update,Qhe)}),a&&l.addEventListener("resize",t.update,Qhe),function(){s&&u.forEach(function(c){c.removeEventListener("scroll",t.update,Qhe)}),a&&l.removeEventListener("resize",t.update,Qhe)}}var gRr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mRr,data:{}},yRr={left:"right",right:"left",bottom:"top",top:"bottom"};function Oge(i){return i.replace(/left|right|bottom|top/g,function(e){return yRr[e]})}var vRr={start:"end",end:"start"};function yht(i){return i.replace(/start|end/g,function(e){return vRr[e]})}function fYe(i){var e=OE(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function mYe(i){return uq(sL(i)).left+fYe(i).scrollLeft}function _Rr(i){var e=OE(i),t=sL(i),r=e.visualViewport,n=t.clientWidth,s=t.clientHeight,o=0,a=0;return r&&(n=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:n,height:s,x:o+mYe(i),y:a}}function bRr(i){var e,t=sL(i),r=fYe(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=c9(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=c9(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+mYe(i),l=-r.scrollTop;return S3(n||t).direction==="rtl"&&(a+=c9(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function gYe(i){var e=S3(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function i6t(i){return["html","body","#document"].indexOf(x3(i))>=0?i.ownerDocument.body:ES(i)&&gYe(i)?i:i6t(pTe(i))}function nre(i,e){var t;e===void 0&&(e=[]);var r=i6t(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=OE(r),o=n?[s].concat(s.visualViewport||[],gYe(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(nre(pTe(o)))}function B$e(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function wRr(i){var e=uq(i);return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function vht(i,e){return e===Y$t?B$e(_Rr(i)):aq(e)?wRr(e):B$e(bRr(sL(i)))}function xRr(i){var e=nre(pTe(i)),t=["absolute","fixed"].indexOf(S3(i).position)>=0,r=t&&ES(i)?ole(i):i;return aq(r)?e.filter(function(n){return aq(n)&&Z$t(n,r)&&x3(n)!=="body"&&(t?S3(n).position!=="static":!0)}):[]}function SRr(i,e,t){var r=e==="clippingParents"?xRr(i):[].concat(e),n=[].concat(r,[t]),s=n[0],o=n.reduce(function(a,l){var u=vht(i,l);return a.top=c9(u.top,a.top),a.right=E_e(u.right,a.right),a.bottom=E_e(u.bottom,a.bottom),a.left=c9(u.left,a.left),a},vht(i,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function r6t(i){var e=i.reference,t=i.element,r=i.placement,n=r?JA(r):null,s=r?cq(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Db:l={x:o,y:e.y-t.height};break;case jS:l={x:o,y:e.y+e.height};break;case GS:l={x:e.x+e.width,y:a};break;case Fb:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=n?pYe(n):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case oq:l[u]=l[u]-(e[c]/2-t[c]/2);break;case Ese:l[u]=l[u]+(e[c]/2-t[c]/2);break}}return l}function Ise(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.boundary,o=s===void 0?VPr:s,a=t.rootBoundary,l=a===void 0?Y$t:a,u=t.elementContext,c=u===void 0?QJ:u,h=t.altBoundary,p=h===void 0?!1:h,m=t.padding,v=m===void 0?0:m,w=e6t(typeof v!="number"?v:t6t(v,sle)),S=c===QJ?HPr:QJ,I=i.rects.popper,R=i.elements[p?S:c],L=SRr(aq(R)?R:R.contextElement||sL(i.elements.popper),o,l),k=uq(i.elements.reference),B=r6t({reference:k,element:I,strategy:"absolute",placement:n}),$=B$e(Object.assign({},I,B)),V=c===QJ?$:k,Y={top:L.top-V.top+w.top,bottom:V.bottom-L.bottom+w.bottom,left:L.left-V.left+w.left,right:V.right-L.right+w.right},K=i.modifiersData.offset;if(c===QJ&&K){var Q=K[n];Object.keys(Y).forEach(function(re){var ne=[GS,jS].indexOf(re)>=0?1:-1,de=[Db,jS].indexOf(re)>=0?"y":"x";Y[re]+=Q[de]*ne})}return Y}function TRr(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?X$t:l,c=cq(r),h=c?a?fht:fht.filter(function(v){return cq(v)===c}):sle,p=h.filter(function(v){return u.indexOf(v)>=0});p.length===0&&(p=h);var m=p.reduce(function(v,w){return v[w]=Ise(i,{placement:w,boundary:n,rootBoundary:s,padding:o})[JA(w)],v},{});return Object.keys(m).sort(function(v,w){return m[v]-m[w]})}function CRr(i){if(JA(i)===hYe)return[];var e=Oge(i);return[yht(i),e,yht(e)]}function ERr(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,h=t.rootBoundary,p=t.altBoundary,m=t.flipVariations,v=m===void 0?!0:m,w=t.allowedAutoPlacements,S=e.options.placement,I=JA(S),R=I===S,L=l||(R||!v?[Oge(S)]:CRr(S)),k=[S].concat(L).reduce(function(Ve,$e){return Ve.concat(JA($e)===hYe?TRr(e,{placement:$e,boundary:c,rootBoundary:h,padding:u,flipVariations:v,allowedAutoPlacements:w}):$e)},[]),B=e.rects.reference,$=e.rects.popper,V=new Map,Y=!0,K=k[0],Q=0;Q=0,H=pe?"width":"height",Z=Ise(e,{placement:re,boundary:c,rootBoundary:h,altBoundary:p,padding:u}),ae=pe?de?GS:Fb:de?jS:Db;B[H]>$[H]&&(ae=Oge(ae));var fe=Oge(ae),be=[];if(s&&be.push(Z[ne]<=0),a&&be.push(Z[ae]<=0,Z[fe]<=0),be.every(function(Ve){return Ve})){K=re,Y=!1;break}V.set(re,be)}if(Y)for(var _e=v?3:1,Ie=function($e){var tt=k.find(function(yt){var Ct=V.get(yt);if(Ct)return Ct.slice(0,$e).every(function(ot){return ot})});if(tt)return K=tt,"break"},Te=_e;Te>0;Te--){var Be=Ie(Te);if(Be==="break")break}e.placement!==K&&(e.modifiersData[r]._skip=!0,e.placement=K,e.reset=!0)}}var IRr={name:"flip",enabled:!0,phase:"main",fn:ERr,requiresIfExists:["offset"],data:{_skip:!1}};function _ht(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function bht(i){return[Db,GS,jS,Fb].some(function(e){return i[e]>=0})}function ARr(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Ise(e,{elementContext:"reference"}),a=Ise(e,{altBoundary:!0}),l=_ht(o,r),u=_ht(a,n,s),c=bht(l),h=bht(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}var MRr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ARr};function ORr(i,e,t){var r=JA(i),n=[Fb,Db].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Fb,GS].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function PRr(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=X$t.reduce(function(c,h){return c[h]=ORr(h,e.rects,s),c},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}var RRr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:PRr};function DRr(i){var e=i.state,t=i.name;e.modifiersData[t]=r6t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var FRr={name:"popperOffsets",enabled:!0,phase:"read",fn:DRr,data:{}};function kRr(i){return i==="x"?"y":"x"}function LRr(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,h=t.padding,p=t.tether,m=p===void 0?!0:p,v=t.tetherOffset,w=v===void 0?0:v,S=Ise(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:c}),I=JA(e.placement),R=cq(e.placement),L=!R,k=pYe(I),B=kRr(k),$=e.modifiersData.popperOffsets,V=e.rects.reference,Y=e.rects.popper,K=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,Q=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),re=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if($){if(s){var de,pe=k==="y"?Db:Fb,H=k==="y"?jS:GS,Z=k==="y"?"height":"width",ae=$[k],fe=ae+S[pe],be=ae-S[H],_e=m?-Y[Z]/2:0,Ie=R===oq?V[Z]:Y[Z],Te=R===oq?-Y[Z]:-V[Z],Be=e.elements.arrow,Ve=m&&Be?dYe(Be):{width:0,height:0},$e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Q$t(),tt=$e[pe],yt=$e[H],Ct=rre(0,V[Z],Ve[Z]),ot=L?V[Z]/2-_e-Ct-tt-Q.mainAxis:Ie-Ct-tt-Q.mainAxis,vt=L?-V[Z]/2+_e+Ct+yt+Q.mainAxis:Te+Ct+yt+Q.mainAxis,At=e.elements.arrow&&ole(e.elements.arrow),Je=At?k==="y"?At.clientTop||0:At.clientLeft||0:0,it=(de=re?.[k])!=null?de:0,Ue=ae+ot-it-Je,ct=ae+vt-it,st=rre(m?E_e(fe,Ue):fe,ae,m?c9(be,ct):be);$[k]=st,ne[k]=st-ae}if(a){var Ze,ye=k==="x"?Db:Fb,Ke=k==="x"?jS:GS,ke=$[B],me=B==="y"?"height":"width",ie=ke+S[ye],ge=ke-S[Ke],je=[Db,Fb].indexOf(I)!==-1,rt=(Ze=re?.[B])!=null?Ze:0,Me=je?ie:ke-V[me]-Y[me]-rt+Q.altAxis,ht=je?ke+V[me]+Y[me]-rt-Q.altAxis:ge,Ht=m&&je?oRr(Me,ke,ht):rre(m?Me:ie,ke,m?ht:ge);$[B]=Ht,ne[B]=Ht-ke}e.modifiersData[r]=ne}}var NRr={name:"preventOverflow",enabled:!0,phase:"main",fn:LRr,requiresIfExists:["offset"]};function $Rr(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function BRr(i){return i===OE(i)||!ES(i)?fYe(i):$Rr(i)}function jRr(i){var e=i.getBoundingClientRect(),t=lq(e.width)/i.offsetWidth||1,r=lq(e.height)/i.offsetHeight||1;return t!==1||r!==1}function GRr(i,e,t){t===void 0&&(t=!1);var r=ES(e),n=ES(e)&&jRr(e),s=sL(e),o=uq(i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((x3(e)!=="body"||gYe(s))&&(a=BRr(e)),ES(e)?(l=uq(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=mYe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function URr(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function zRr(i){var e=URr(i);return tRr.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function VRr(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function HRr(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var wht={placement:"bottom",modifiers:[],strategy:"absolute"};function xht(){for(var i=arguments.length,e=new Array(i),t=0;t-1}function u6t(i,e){return typeof i=="function"?i.apply(void 0,e):i}function Sht(i,e){if(e===0)return i;var t;return function(r){clearTimeout(t),t=setTimeout(function(){i(r)},e)}}function JRr(i,e){var t=Object.assign({},i);return e.forEach(function(r){delete t[r]}),t}function KRr(i){return i.split(/\s+/).filter(Boolean)}function L6(i){return[].concat(i)}function Tht(i,e){i.indexOf(e)===-1&&i.push(e)}function ZRr(i){return i.filter(function(e,t){return i.indexOf(e)===t})}function c6t(i){return i.split("-")[0]}function hq(i){return[].slice.call(i)}function Cht(i){return Object.keys(i).reduce(function(e,t){return i[t]!==void 0&&(e[t]=i[t]),e},{})}function h9(){return document.createElement("div")}function fTe(i){return["Element","Fragment"].some(function(e){return yYe(i,e)})}function QRr(i){return yYe(i,"NodeList")}function vYe(i){return yYe(i,"MouseEvent")}function eDr(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function tDr(i){return fTe(i)?[i]:QRr(i)?hq(i):Array.isArray(i)?i:hq(document.querySelectorAll(i))}function tOe(i,e){i.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Ase(i,e){i.forEach(function(t){t&&t.setAttribute("data-state",e)})}function h6t(i){var e,t=L6(i),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function iDr(i,e){var t=e.clientX,r=e.clientY;return i.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,u=c6t(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=u==="bottom"?c.top.y:0,p=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,v=u==="left"?c.right.x:0,w=s.top-r+h>l,S=r-s.bottom-p>l,I=s.left-t+m>l,R=t-s.right-v>l;return w||S||I||R})}function iOe(i,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){i[r](n,t)})}function Eht(i,e){for(var t=e;t;){var r;if(i.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var aA={isTouch:!1},Iht=0;function rDr(){aA.isTouch||(aA.isTouch=!0,window.performance&&document.addEventListener("mousemove",d6t))}function d6t(){var i=performance.now();i-Iht<20&&(aA.isTouch=!1,document.removeEventListener("mousemove",d6t)),Iht=i}function nDr(){var i=document.activeElement;if(eDr(i)){var e=i._tippy;i.blur&&!e.state.isVisible&&i.blur()}}function sDr(){document.addEventListener("touchstart",rDr,p$),window.addEventListener("blur",nDr)}var oDr=typeof window<"u"&&typeof document<"u",aDr=oDr?!!window.msCrypto:!1,lDr={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},uDr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},jC=Object.assign({appendTo:l6t,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},lDr,uDr),cDr=Object.keys(jC),hDr=function(e){var t=Object.keys(e);t.forEach(function(r){jC[r]=e[r]})};function p6t(i){var e=i.plugins||[],t=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=i[s]!==void 0?i[s]:(a=jC[s])!=null?a:o}return r},{});return Object.assign({},i,t)}function dDr(i,e){var t=e?Object.keys(p6t(Object.assign({},jC,{plugins:e}))):cDr,r=t.reduce(function(n,s){var o=(i.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return r}function Aht(i,e){var t=Object.assign({},e,{content:u6t(e.content,[i])},e.ignoreAttributes?{}:dDr(i,e.plugins));return t.aria=Object.assign({},jC.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var pDr=function(){return"innerHTML"};function j$e(i,e){i[pDr()]=e}function Mht(i){var e=h9();return i===!0?e.className=o6t:(e.className=a6t,fTe(i)?e.appendChild(i):j$e(e,i)),e}function Oht(i,e){fTe(e.content)?(j$e(i,""),i.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?j$e(i,e.content):i.textContent=e.content)}function I_e(i){var e=i.firstElementChild,t=hq(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(n6t)}),arrow:t.find(function(r){return r.classList.contains(o6t)||r.classList.contains(a6t)}),backdrop:t.find(function(r){return r.classList.contains(s6t)})}}function f6t(i){var e=h9(),t=h9();t.className=XRr,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=h9();r.className=n6t,r.setAttribute("data-state","hidden"),Oht(r,i.props),e.appendChild(t),t.appendChild(r),n(i.props,i.props);function n(s,o){var a=I_e(e),l=a.box,u=a.content,c=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Oht(u,i.props),o.arrow?c?s.arrow!==o.arrow&&(l.removeChild(c),l.appendChild(Mht(o.arrow))):l.appendChild(Mht(o.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:n}}f6t.$$tippy=!0;var fDr=1,ede=[],rOe=[];function mDr(i,e){var t=Aht(i,Object.assign({},jC,p6t(Cht(e)))),r,n,s,o=!1,a=!1,l=!1,u=!1,c,h,p,m=[],v=Sht(Ue,t.interactiveDebounce),w,S=fDr++,I=null,R=ZRr(t.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},k={id:S,reference:i,popper:h9(),popperInstance:I,props:t,state:L,plugins:R,clearDelayTimeouts:Me,setProps:ht,setContent:Ht,show:_t,hide:Fe,hideWithInteractivity:Yt,enable:je,disable:rt,unmount:A,destroy:ue};if(!t.render)return k;var B=t.render(k),$=B.popper,V=B.onUpdate;$.setAttribute("data-tippy-root",""),$.id="tippy-"+k.id,k.popper=$,i._tippy=k,$._tippy=k;var Y=R.map(function(G){return G.fn(k)}),K=i.hasAttribute("aria-expanded");return At(),_e(),ae(),fe("onCreate",[k]),t.showOnCreate&&ie(),$.addEventListener("mouseenter",function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()}),$.addEventListener("mouseleave",function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&pe().addEventListener("mousemove",v)}),k;function Q(){var G=k.props.touch;return Array.isArray(G)?G:[G,0]}function re(){return Q()[0]==="hold"}function ne(){var G;return!!((G=k.props.render)!=null&&G.$$tippy)}function de(){return w||i}function pe(){var G=de().parentNode;return G?h6t(G):document}function H(){return I_e($)}function Z(G){return k.state.isMounted&&!k.state.isVisible||aA.isTouch||c&&c.type==="focus"?0:eOe(k.props.delay,G?0:1,jC.delay)}function ae(G){G===void 0&&(G=!1),$.style.pointerEvents=k.props.interactive&&!G?"":"none",$.style.zIndex=""+k.props.zIndex}function fe(G,E,_){if(_===void 0&&(_=!0),Y.forEach(function(b){b[G]&&b[G].apply(b,E)}),_){var g;(g=k.props)[G].apply(g,E)}}function be(){var G=k.props.aria;if(G.content){var E="aria-"+G.content,_=$.id,g=L6(k.props.triggerTarget||i);g.forEach(function(b){var C=b.getAttribute(E);if(k.state.isVisible)b.setAttribute(E,C?C+" "+_:_);else{var O=C&&C.replace(_,"").trim();O?b.setAttribute(E,O):b.removeAttribute(E)}})}}function _e(){if(!(K||!k.props.aria.expanded)){var G=L6(k.props.triggerTarget||i);G.forEach(function(E){k.props.interactive?E.setAttribute("aria-expanded",k.state.isVisible&&E===de()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ie(){pe().removeEventListener("mousemove",v),ede=ede.filter(function(G){return G!==v})}function Te(G){if(!(aA.isTouch&&(l||G.type==="mousedown"))){var E=G.composedPath&&G.composedPath()[0]||G.target;if(!(k.props.interactive&&Eht($,E))){if(L6(k.props.triggerTarget||i).some(function(_){return Eht(_,E)})){if(aA.isTouch||k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else fe("onClickOutside",[k,G]);k.props.hideOnClick===!0&&(k.clearDelayTimeouts(),k.hide(),a=!0,setTimeout(function(){a=!1}),k.state.isMounted||tt())}}}function Be(){l=!0}function Ve(){l=!1}function $e(){var G=pe();G.addEventListener("mousedown",Te,!0),G.addEventListener("touchend",Te,p$),G.addEventListener("touchstart",Ve,p$),G.addEventListener("touchmove",Be,p$)}function tt(){var G=pe();G.removeEventListener("mousedown",Te,!0),G.removeEventListener("touchend",Te,p$),G.removeEventListener("touchstart",Ve,p$),G.removeEventListener("touchmove",Be,p$)}function yt(G,E){ot(G,function(){!k.state.isVisible&&$.parentNode&&$.parentNode.contains($)&&E()})}function Ct(G,E){ot(G,E)}function ot(G,E){var _=H().box;function g(b){b.target===_&&(iOe(_,"remove",g),E())}if(G===0)return E();iOe(_,"remove",h),iOe(_,"add",g),h=g}function vt(G,E,_){_===void 0&&(_=!1);var g=L6(k.props.triggerTarget||i);g.forEach(function(b){b.addEventListener(G,E,_),m.push({node:b,eventType:G,handler:E,options:_})})}function At(){re()&&(vt("touchstart",it,{passive:!0}),vt("touchend",ct,{passive:!0})),KRr(k.props.trigger).forEach(function(G){if(G!=="manual")switch(vt(G,it),G){case"mouseenter":vt("mouseleave",ct);break;case"focus":vt(aDr?"focusout":"blur",st);break;case"focusin":vt("focusout",st);break}})}function Je(){m.forEach(function(G){var E=G.node,_=G.eventType,g=G.handler,b=G.options;E.removeEventListener(_,g,b)}),m=[]}function it(G){var E,_=!1;if(!(!k.state.isEnabled||Ze(G)||a)){var g=((E=c)==null?void 0:E.type)==="focus";c=G,w=G.currentTarget,_e(),!k.state.isVisible&&vYe(G)&&ede.forEach(function(b){return b(G)}),G.type==="click"&&(k.props.trigger.indexOf("mouseenter")<0||o)&&k.props.hideOnClick!==!1&&k.state.isVisible?_=!0:ie(G),G.type==="click"&&(o=!_),_&&!g&&ge(G)}}function Ue(G){var E=G.target,_=de().contains(E)||$.contains(E);if(!(G.type==="mousemove"&&_)){var g=me().concat($).map(function(b){var C,O=b._tippy,F=(C=O.popperInstance)==null?void 0:C.state;return F?{popperRect:b.getBoundingClientRect(),popperState:F,props:t}:null}).filter(Boolean);iDr(g,G)&&(Ie(),ge(G))}}function ct(G){var E=Ze(G)||k.props.trigger.indexOf("click")>=0&&o;if(!E){if(k.props.interactive){k.hideWithInteractivity(G);return}ge(G)}}function st(G){k.props.trigger.indexOf("focusin")<0&&G.target!==de()||k.props.interactive&&G.relatedTarget&&$.contains(G.relatedTarget)||ge(G)}function Ze(G){return aA.isTouch?re()!==G.type.indexOf("touch")>=0:!1}function ye(){Ke();var G=k.props,E=G.popperOptions,_=G.placement,g=G.offset,b=G.getReferenceClientRect,C=G.moveTransition,O=ne()?I_e($).arrow:null,F=b?{getBoundingClientRect:b,contextElement:b.contextElement||de()}:i,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var J=q.state;if(ne()){var ee=H(),he=ee.box;["placement","reference-hidden","escaped"].forEach(function(Ee){Ee==="placement"?he.setAttribute("data-placement",J.placement):J.attributes.popper["data-popper-"+Ee]?he.setAttribute("data-"+Ee,""):he.removeAttribute("data-"+Ee)}),J.attributes.popper={}}}},j=[{name:"offset",options:{offset:g}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!C}},N];ne()&&O&&j.push({name:"arrow",options:{element:O,padding:3}}),j.push.apply(j,E?.modifiers||[]),k.popperInstance=YRr(F,$,Object.assign({},E,{placement:_,onFirstUpdate:p,modifiers:j}))}function Ke(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function ke(){var G=k.props.appendTo,E,_=de();k.props.interactive&&G===l6t||G==="parent"?E=_.parentNode:E=u6t(G,[_]),E.contains($)||E.appendChild($),k.state.isMounted=!0,ye()}function me(){return hq($.querySelectorAll("[data-tippy-root]"))}function ie(G){k.clearDelayTimeouts(),G&&fe("onTrigger",[k,G]),$e();var E=Z(!0),_=Q(),g=_[0],b=_[1];aA.isTouch&&g==="hold"&&b&&(E=b),E?r=setTimeout(function(){k.show()},E):k.show()}function ge(G){if(k.clearDelayTimeouts(),fe("onUntrigger",[k,G]),!k.state.isVisible){tt();return}if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var E=Z(!1);E?n=setTimeout(function(){k.state.isVisible&&k.hide()},E):s=requestAnimationFrame(function(){k.hide()})}}function je(){k.state.isEnabled=!0}function rt(){k.hide(),k.state.isEnabled=!1}function Me(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function ht(G){if(!k.state.isDestroyed){fe("onBeforeUpdate",[k,G]),Je();var E=k.props,_=Aht(i,Object.assign({},E,Cht(G),{ignoreAttributes:!0}));k.props=_,At(),E.interactiveDebounce!==_.interactiveDebounce&&(Ie(),v=Sht(Ue,_.interactiveDebounce)),E.triggerTarget&&!_.triggerTarget?L6(E.triggerTarget).forEach(function(g){g.removeAttribute("aria-expanded")}):_.triggerTarget&&i.removeAttribute("aria-expanded"),_e(),ae(),V&&V(E,_),k.popperInstance&&(ye(),me().forEach(function(g){requestAnimationFrame(g._tippy.popperInstance.forceUpdate)})),fe("onAfterUpdate",[k,G])}}function Ht(G){k.setProps({content:G})}function _t(){var G=k.state.isVisible,E=k.state.isDestroyed,_=!k.state.isEnabled,g=aA.isTouch&&!k.props.touch,b=eOe(k.props.duration,0,jC.duration);if(!(G||E||_||g)&&!de().hasAttribute("disabled")&&(fe("onShow",[k],!1),k.props.onShow(k)!==!1)){if(k.state.isVisible=!0,ne()&&($.style.visibility="visible"),ae(),$e(),k.state.isMounted||($.style.transition="none"),ne()){var C=H(),O=C.box,F=C.content;tOe([O,F],0)}p=function(){var j;if(!(!k.state.isVisible||u)){if(u=!0,$.offsetHeight,$.style.transition=k.props.moveTransition,ne()&&k.props.animation){var W=H(),q=W.box,J=W.content;tOe([q,J],b),Ase([q,J],"visible")}be(),_e(),Tht(rOe,k),(j=k.popperInstance)==null||j.forceUpdate(),fe("onMount",[k]),k.props.animation&&ne()&&Ct(b,function(){k.state.isShown=!0,fe("onShown",[k])})}},ke()}}function Fe(){var G=!k.state.isVisible,E=k.state.isDestroyed,_=!k.state.isEnabled,g=eOe(k.props.duration,1,jC.duration);if(!(G||E||_)&&(fe("onHide",[k],!1),k.props.onHide(k)!==!1)){if(k.state.isVisible=!1,k.state.isShown=!1,u=!1,o=!1,ne()&&($.style.visibility="hidden"),Ie(),tt(),ae(!0),ne()){var b=H(),C=b.box,O=b.content;k.props.animation&&(tOe([C,O],g),Ase([C,O],"hidden"))}be(),_e(),k.props.animation?ne()&&yt(g,k.unmount):k.unmount()}}function Yt(G){pe().addEventListener("mousemove",v),Tht(ede,v),v(G)}function A(){k.state.isVisible&&k.hide(),k.state.isMounted&&(Ke(),me().forEach(function(G){G._tippy.unmount()}),$.parentNode&&$.parentNode.removeChild($),rOe=rOe.filter(function(G){return G!==k}),k.state.isMounted=!1,fe("onHidden",[k]))}function ue(){k.state.isDestroyed||(k.clearDelayTimeouts(),k.unmount(),Je(),delete i._tippy,k.state.isDestroyed=!0,fe("onDestroy",[k]))}}function Co(i,e){e===void 0&&(e={});var t=jC.plugins.concat(e.plugins||[]);sDr();var r=Object.assign({},e,{plugins:t}),n=tDr(i),s=n.reduce(function(o,a){var l=a&&mDr(a,r);return l&&o.push(l),o},[]);return fTe(i)?s[0]:s}Co.defaultProps=jC;Co.setDefaultProps=hDr;Co.currentInput=aA;var gDr=Object.assign({},K$t,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),yDr=function(e,t){var r;t===void 0&&(t={});var n=e,s=[],o=[],a,l=t.overrides,u=[],c=!1;function h(){o=n.map(function(k){return L6(k.props.triggerTarget||k.reference)}).reduce(function(k,B){return k.concat(B)},[])}function p(){s=n.map(function(k){return k.reference})}function m(k){n.forEach(function(B){k?B.enable():B.disable()})}function v(k){return n.map(function(B){var $=B.setProps;return B.setProps=function(V){$(V),B.reference===a&&k.setProps(V)},function(){B.setProps=$}})}function w(k,B){var $=o.indexOf(B);if(B!==a){a=B;var V=(l||[]).concat("content").reduce(function(Y,K){return Y[K]=n[$].props[K],Y},{});k.setProps(Object.assign({},V,{getReferenceClientRect:typeof V.getReferenceClientRect=="function"?V.getReferenceClientRect:function(){var Y;return(Y=s[$])==null?void 0:Y.getBoundingClientRect()}}))}}m(!1),p(),h();var S={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){a=null},onClickOutside:function($){$.props.showOnCreate&&!c&&(c=!0,a=null)},onShow:function($){$.props.showOnCreate&&!c&&(c=!0,w($,s[0]))},onTrigger:function($,V){w($,V.currentTarget)}}}},I=Co(h9(),Object.assign({},JRr(t,["overrides"]),{plugins:[S].concat(t.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((r=t.popperOptions)==null?void 0:r.modifiers)||[],[gDr])})})),R=I.show;I.show=function(k){if(R(),!a&&k==null)return w(I,s[0]);if(!(a&&k==null)){if(typeof k=="number")return s[k]&&w(I,s[k]);if(n.indexOf(k)>=0){var B=k.reference;return w(I,B)}if(s.indexOf(k)>=0)return w(I,k)}},I.showNext=function(){var k=s[0];if(!a)return I.show(0);var B=s.indexOf(a);I.show(s[B+1]||k)},I.showPrevious=function(){var k=s[s.length-1];if(!a)return I.show(k);var B=s.indexOf(a),$=s[B-1]||k;I.show($)};var L=I.setProps;return I.setProps=function(k){l=k.overrides||l,L(k)},I.setInstances=function(k){m(!0),u.forEach(function(B){return B()}),n=k,m(!1),p(),h(),u=v(I),I.setProps({triggerTarget:o})},u=v(I),I},vDr={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(!((t=e.props.render)!=null&&t.$$tippy))return{};var r=I_e(e.popper),n=r.box,s=r.content,o=e.props.animateFill?_Dr():null;return{onCreate:function(){o&&(n.insertBefore(o,n.firstElementChild),n.setAttribute("data-animatefill",""),n.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var l=n.style.transitionDuration,u=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(u/10)+"ms",o.style.transitionDuration=l,Ase([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&Ase([o],"hidden")}}}};function _Dr(){var i=h9();return i.className=s6t,Ase([i],"hidden"),i}var G$e={clientX:0,clientY:0},tde=[];function m6t(i){var e=i.clientX,t=i.clientY;G$e={clientX:e,clientY:t}}function bDr(i){i.addEventListener("mousemove",m6t)}function wDr(i){i.removeEventListener("mousemove",m6t)}var xDr={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,r=h6t(e.props.triggerTarget||t),n=!1,s=!1,o=!0,a=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function u(){r.addEventListener("mousemove",p)}function c(){r.removeEventListener("mousemove",p)}function h(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function p(w){var S=w.target?t.contains(w.target):!0,I=e.props.followCursor,R=w.clientX,L=w.clientY,k=t.getBoundingClientRect(),B=R-k.left,$=L-k.top;(S||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var Y=t.getBoundingClientRect(),K=R,Q=L;I==="initial"&&(K=Y.left+B,Q=Y.top+$);var re=I==="horizontal"?Y.top:Q,ne=I==="vertical"?Y.right:K,de=I==="horizontal"?Y.bottom:Q,pe=I==="vertical"?Y.left:K;return{width:ne-pe,height:de-re,top:re,right:ne,bottom:de,left:pe}}})}function m(){e.props.followCursor&&(tde.push({instance:e,doc:r}),bDr(r))}function v(){tde=tde.filter(function(w){return w.instance!==e}),tde.filter(function(w){return w.doc===r}).length===0&&wDr(r)}return{onCreate:m,onDestroy:v,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(S,I){var R=I.followCursor;n||R!==void 0&&a.followCursor!==R&&(v(),R?(m(),e.state.isMounted&&!s&&!l()&&u()):(c(),h()))},onMount:function(){e.props.followCursor&&!s&&(o&&(p(G$e),o=!1),l()||u())},onTrigger:function(S,I){vYe(I)&&(G$e={clientX:I.clientX,clientY:I.clientY}),s=I.type==="focus"},onHidden:function(){e.props.followCursor&&(h(),c(),o=!0)}}}};function SDr(i,e){var t;return{popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat((((t=i.popperOptions)==null?void 0:t.modifiers)||[]).filter(function(r){var n=r.name;return n!==e.name}),[e])})}}var TDr={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t=e.reference;function r(){return!!e.props.inlinePositioning}var n,s=-1,o=!1,a=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(m){var v=m.state;r()&&(a.indexOf(v.placement)!==-1&&(a=[]),n!==v.placement&&a.indexOf(v.placement)===-1&&(a.push(v.placement),e.setProps({getReferenceClientRect:function(){return u(v.placement)}})),n=v.placement)}};function u(p){return CDr(c6t(p),t.getBoundingClientRect(),hq(t.getClientRects()),s)}function c(p){o=!0,e.setProps(p),o=!1}function h(){o||c(SDr(e.props,l))}return{onCreate:h,onAfterUpdate:h,onTrigger:function(m,v){if(vYe(v)){var w=hq(e.reference.getClientRects()),S=w.find(function(R){return R.left-2<=v.clientX&&R.right+2>=v.clientX&&R.top-2<=v.clientY&&R.bottom+2>=v.clientY}),I=w.indexOf(S);s=I>-1?I:s}},onHidden:function(){s=-1}}}};function CDr(i,e,t,r){if(t.length<2||i===null)return e;if(t.length===2&&r>=0&&t[0].left>t[1].right)return t[r]||e;switch(i){case"top":case"bottom":{var n=t[0],s=t[t.length-1],o=i==="top",a=n.top,l=s.bottom,u=o?n.left:s.left,c=o?n.right:s.right,h=c-u,p=l-a;return{top:a,bottom:l,left:u,right:c,width:h,height:p}}case"left":case"right":{var m=Math.min.apply(Math,t.map(function($){return $.left})),v=Math.max.apply(Math,t.map(function($){return $.right})),w=t.filter(function($){return i==="left"?$.left===m:$.right===v}),S=w[0].top,I=w[w.length-1].bottom,R=m,L=v,k=L-R,B=I-S;return{top:S,bottom:I,left:R,right:L,width:k,height:B}}default:return e}}var EDr={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,r=e.popper;function n(){return e.popperInstance?e.popperInstance.state.elements.reference:t}function s(u){return e.props.sticky===!0||e.props.sticky===u}var o=null,a=null;function l(){var u=s("reference")?n().getBoundingClientRect():null,c=s("popper")?r.getBoundingClientRect():null;(u&&Pht(o,u)||c&&Pht(a,c))&&e.popperInstance&&e.popperInstance.update(),o=u,a=c,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Pht(i,e){return i&&e?i.top!==e.top||i.right!==e.right||i.bottom!==e.bottom||i.left!==e.left:!0}Co.setDefaultProps({render:f6t});Co.setDefaultProps({onShow:i=>{if(!i.props.content)return!1}});function _Ye(i,e={},t={mount:!0,appName:"Tippy"}){t=Object.assign({mount:!0,appName:"Tippy"},t);const r=Df(),n=vi(),s=vi({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1}),o=qae();let a=null;const l=()=>a||(a=document.createDocumentFragment(),a),u=V=>{let Y,K=Wu(V)?V.value:V;return _3(K)?(o.value||(o.value=YW({name:t.appName,setup:()=>()=>Wu(V)?V.value:V}),r&&Object.assign(o.value._context,r.appContext),o.value.mount(l())),Y=()=>l()):typeof K=="object"?(o.value||(o.value=YW({name:t.appName,setup:()=>()=>dx(Wu(V)?V.value:V)}),r&&Object.assign(o.value._context,r.appContext),o.value.mount(l())),Y=()=>l()):Y=K,Y},c=V=>{let Y={};return Wu(V)?Y=V.value||{}:TS(V)?Y={...V}:Y={...V},Y.content&&(Y.content=u(Y.content)),Y.triggerTarget&&(Y.triggerTarget=Wu(Y.triggerTarget)?Y.triggerTarget.value:Y.triggerTarget),(!Y.plugins||!Array.isArray(Y.plugins))&&(Y.plugins=[]),Y.plugins=Y.plugins.filter(K=>K.name!=="vueTippyReactiveState"),Y.plugins.push({name:"vueTippyReactiveState",fn:()=>({onCreate(){s.value.isEnabled=!0},onMount(){s.value.isMounted=!0},onShow(){s.value.isMounted=!0,s.value.isVisible=!0},onShown(){s.value.isShown=!0},onHide(){s.value.isMounted=!1,s.value.isVisible=!1},onHidden(){s.value.isShown=!1},onUnmounted(){s.value.isMounted=!1},onDestroy(){s.value.isDestroyed=!0}})}),Y},h=()=>{n.value&&n.value.setProps(c(e))},p=()=>{!n.value||!e.content||n.value.setContent(u(e.content))},m=V=>{var Y;(Y=n.value)===null||Y===void 0||Y.setContent(u(V))},v=V=>{var Y;(Y=n.value)===null||Y===void 0||Y.setProps(c(V))},w=()=>{var V;n.value&&(n.value.destroy(),n.value=void 0),a=null,(V=o.value)===null||V===void 0||V.unmount(),o.value=void 0},S=()=>{var V;(V=n.value)===null||V===void 0||V.show()},I=()=>{var V;(V=n.value)===null||V===void 0||V.hide()},R=()=>{var V;(V=n.value)===null||V===void 0||V.disable(),s.value.isEnabled=!1},L=()=>{var V;(V=n.value)===null||V===void 0||V.enable(),s.value.isEnabled=!0},k=()=>{var V;(V=n.value)===null||V===void 0||V.unmount()},B=()=>{if(!i)return;let V=Wu(i)?i.value:i;typeof V=="function"&&(V=V()),V&&(n.value=Co(V,c(e)),V.$tippy=$)},$={tippy:n,refresh:h,refreshContent:p,setContent:m,setProps:v,destroy:w,hide:I,show:S,disable:R,enable:L,unmount:k,mount:B,state:s};return t.mount&&(r?r.isMounted?B():Fa(B):B()),r&&s7(()=>{w()}),Wu(e)||TS(e)?rl(e,h,{immediate:!1}):Wu(e.content)&&rl(e.content,p,{immediate:!1}),$}function IDr(i,e){const t=vi();return Fa(()=>{const n=(Array.isArray(i)?i.map(s=>s.value):typeof i=="function"?i():i.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);t.value=yDr(n,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:t}}function ADr(i){return typeof i=="function"?i():ri(i)}function MDr(i){var e,t;const r=ADr(i);return(t=(e=r)===null||e===void 0?void 0:e.$el)!==null&&t!==void 0?t:r}const ODr=Xr({props:{to:{type:[String,Function]},tag:{type:[String,Object],default:"span"},contentTag:{type:[String,Object],default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Co.defaultProps.appendTo},aria:{default:()=>Co.defaultProps.aria},delay:{default:()=>Co.defaultProps.delay},duration:{default:()=>Co.defaultProps.duration},getReferenceClientRect:{default:()=>Co.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Co.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Co.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Co.defaultProps.interactive},interactiveBorder:{default:()=>Co.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Co.defaultProps.interactiveDebounce},moveTransition:{default:()=>Co.defaultProps.moveTransition},offset:{default:()=>Co.defaultProps.offset},onAfterUpdate:{default:()=>Co.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Co.defaultProps.onBeforeUpdate},onCreate:{default:()=>Co.defaultProps.onCreate},onDestroy:{default:()=>Co.defaultProps.onDestroy},onHidden:{default:()=>Co.defaultProps.onHidden},onHide:{default:()=>Co.defaultProps.onHide},onMount:{default:()=>Co.defaultProps.onMount},onShow:{default:()=>Co.defaultProps.onShow},onShown:{default:()=>Co.defaultProps.onShown},onTrigger:{default:()=>Co.defaultProps.onTrigger},onUntrigger:{default:()=>Co.defaultProps.onUntrigger},onClickOutside:{default:()=>Co.defaultProps.onClickOutside},placement:{default:()=>Co.defaultProps.placement},plugins:{default:()=>Co.defaultProps.plugins},popperOptions:{default:()=>Co.defaultProps.popperOptions},render:{default:()=>Co.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Co.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Co.defaultProps.touch},trigger:{default:()=>Co.defaultProps.trigger},triggerTarget:{default:()=>Co.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Co.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Co.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Co.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Co.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Co.defaultProps.allowHTML},animation:{default:()=>Co.defaultProps.animation},arrow:{default:()=>Co.defaultProps.arrow},content:{default:()=>Co.defaultProps.content},inertia:{default:()=>Co.defaultProps.inertia},maxWidth:{default:()=>Co.defaultProps.maxWidth},role:{default:()=>Co.defaultProps.role},theme:{default:()=>Co.defaultProps.theme},zIndex:{default:()=>Co.defaultProps.zIndex}},emits:["state"],setup(i,{slots:e,emit:t,expose:r}){const n=vi(),s=vi(),o=vi(),a=vi(!1),l=()=>{let m={...i};for(const v of["to","tag","contentTag","contentClass"])m.hasOwnProperty(v)&&delete m[v];return m};let u=()=>MDr(n);i.to&&(typeof Element<"u"&&i.to instanceof Element?u=()=>i.to:i.to==="parent"?u=()=>{let m=n.value;return m||(m=n.value=s.value.parentElement),m}:(typeof i.to=="string"||i.to instanceof String)&&(u=()=>document.querySelector(i.to)));const c=_Ye(u,l());let h=e.content;!h&&i.to==="parent"&&(h=e.default),Fa(()=>{a.value=!0,Bv(()=>{h&&c.setContent(()=>o.value)})}),rl(c.state,()=>{t("state",ri(c.state))},{immediate:!0,deep:!0}),rl(()=>i,()=>{c.setProps(l()),h&&c.setContent(()=>o.value)},{deep:!0});let p=Zl({elem:n,contentElem:o,mounted:a,...c});return r(p),()=>{const m=(typeof i.contentTag=="string",i.contentTag),v=h?dx(m,{ref:o,style:{display:a.value?"inherit":"none"},class:i.contentClass},h(p)):null;if(i.to==="parent"){const I=[];if(!n.value){const R=dx("span",{ref:s,"data-v-tippy":"",style:{display:"none"}});I.push(R)}return v&&I.push(v),I}const w=e.default?e.default(p):[];if(!i.tag){const I=dx(w[0],{ref:n,"data-v-tippy":""});return v?[I,v]:I}const S=(typeof i.tag=="string",i.tag);return dx(S,{ref:n,"data-v-tippy":""},v?[w,v]:w)}}}),PDr=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let U$e={};Object.keys(Co.defaultProps).forEach(i=>{PDr.includes(i)?U$e[i]={type:Boolean,default:function(){return Co.defaultProps[i]}}:U$e[i]={default:function(){return Co.defaultProps[i]}}});const RDr=Xr({props:U$e,setup(i){const e=vi([]),{singleton:t}=IDr(e,i);return{instances:e,singleton:t}},mounted(){var i;const t=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(t).map(r=>r._tippy).filter(Boolean),(i=this.singleton)===null||i===void 0||i.setInstances(this.instances)},render(){let i=this.$slots.default?this.$slots.default():[];return dx(()=>i)}}),DDr={mounted(i,e,t){const r=typeof e.value=="string"?{content:e.value}:e.value||{},n=Object.keys(e.modifiers||{}),s=n.find(a=>a!=="arrow"),o=n.findIndex(a=>a==="arrow")!==-1;s&&(r.placement=r.placement||s),o&&(r.arrow=r.arrow!==void 0?r.arrow:!0),t.props&&t.props.onTippyShow&&(r.onShow=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyShow(...a)}),t.props&&t.props.onTippyShown&&(r.onShown=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyShown(...a)}),t.props&&t.props.onTippyHidden&&(r.onHidden=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyHidden(...a)}),t.props&&t.props.onTippyHide&&(r.onHide=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyHide(...a)}),t.props&&t.props.onTippyMount&&(r.onMount=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyMount(...a)}),i.getAttribute("title")&&!r.content&&(r.content=i.getAttribute("title"),i.removeAttribute("title")),i.getAttribute("content")&&!r.content&&(r.content=i.getAttribute("content")),_Ye(i,r)},unmounted(i){i.$tippy?i.$tippy.destroy():i._tippy&&i._tippy.destroy()},updated(i,e){const t=typeof e.value=="string"?{content:e.value}:e.value||{};i.getAttribute("title")&&!t.content&&(t.content=i.getAttribute("title"),i.removeAttribute("title")),i.getAttribute("content")&&!t.content&&(t.content=i.getAttribute("content")),i.$tippy?i.$tippy.setProps(t||{}):i._tippy&&i._tippy.setProps(t||{})}},FDr={install(i,e={}){Co.setDefaultProps(e.defaultProps||{}),i.directive(e.directive||"tippy",DDr),i.component(e.component||"tippy",ODr),i.component(e.componentSingleton||"tippy-singleton",RDr)}},g6t=Co.setDefaultProps;g6t({ignoreAttributes:!0,plugins:[EDr,TDr,xDr,vDr]});const kDr=FDr,LDr=Xr({name:"App",components:{Shell:zPr},setup(){const i=Df();Fa(()=>{new O$t().observe(i?.proxy?.$refs["app-size"]),g6t({aria:{content:"labelledby"},theme:"ramp4",animation:"scale",inertia:!0,trigger:"mouseenter manual focus",touch:["hold",200],delay:[300,0],appendTo:()=>document.fullscreenElement||document.body})})}}),NDr=["lang"],$Dr={class:"h-full",ref:"app-size"};function BDr(i,e,t,r,n,s){const o=Ko("shell");return qt(),si("div",{class:"ramp-app ramp-styles animation-enabled",lang:i.$i18n.locale},[Ot("div",$Dr,[Vn(o)],512)],8,NDr)}const jDr=ml(LDr,[["render",BDr]]),lA="focus-list",ZL="focus-item",GDr="focus-icon",UDr="focus-container",rH=`[${lA}],[${UDr}]`,ide="truncate-text",rde="show-truncate",Yz="focused",y6t=`button,input,select,a,textarea,[contenteditable],[${lA}],[${GDr}]`,zDr={mounted(i,e){+i.getAttribute("tabindex")<=0&&i.setAttribute("tabindex","0"),i.toggleAttribute(lA,!0),new VDr(i,e.value)},updated(i){v6t(i)}};function v6t(i){i.querySelectorAll(y6t).forEach(t=>{if(t.closest(rH)===i||t.closest(rH)===t&&t.parentElement.closest(rH)===i)if(t.closest(`[${lA}],.${Yz}`).classList.contains(Yz))t.setAttribute("tabindex","0");else{t.setAttribute("tabindex","-1");return}})}class VDr{element;highlightedItem;isHorizontal;isClicked;isTapped;constructor(e,t){this.element=e,this.highlightedItem=this.element,this.isHorizontal=t==="horizontal",this.isClicked=!1,this.isTapped=!1,this.setTabIndex(-1),this.element.setAttribute("role","group");const r=this;e.addEventListener("keydown",function(n){r.onKeydown(n)}),e.addEventListener("click",function(n){r.onClick(n)}),e.addEventListener("focus",function(){r.onFocus()}),e.addEventListener("blur",function(){r.onBlur()}),e.addEventListener("mousedown",function(){r.onMousedown()}),e.addEventListener("touchstart",function(){r.onTouchstart()})}setTabIndex(e,t=this.element){t.querySelectorAll(y6t).forEach(n=>{(e===-1||n.closest(rH)===this.element||n.closest(rH)===n&&n.parentElement.closest(rH)===this.element||n.closest(`[${lA}],.${Yz}`).classList.contains(Yz))&&n.setAttribute("tabindex",e.toString())})}defocusItem(e){e.classList.remove(Yz),this.setTabIndex(-1,e),e._tippy&&e._tippy.hide(),e.getAttribute(ZL)===rde&&e.querySelector(`[${ide}]`)?._tippy?.hide()}focusItem(e){e.classList.add(Yz),this.setAriaActiveDescendant(e),this.setTabIndex(0,e),e.scrollIntoView({block:"nearest"}),e._tippy&&!this.isTapped&&e._tippy.show(),e.getAttribute(ZL)===rde&&e.querySelector(`[${ide}]`)?._tippy?.show(),this.isTapped=!1}setAriaActiveDescendant(e){this.element.setAttribute("aria-activedescendant",e.getAttribute("id"))}shiftHighlight(e,t=!1){if(this.defocusItem(this.highlightedItem),t)if(this.highlightedItem===this.element)this.highlightedItem=e[e.length-1];else{const r=Array.prototype.indexOf.call(e,this.highlightedItem);this.highlightedItem=e[r-1]||e[e.length-1]}else if(this.highlightedItem===this.element)this.highlightedItem=e[0];else{const r=Array.prototype.indexOf.call(e,this.highlightedItem);this.highlightedItem=e[r+1]||e[0]}this.element.focus(),this.focusItem(this.highlightedItem)}onKeydown(e){const t=this,r=Array.prototype.filter.call(this.element.querySelectorAll(`[${ZL}]`),n=>n.closest(`[${lA}]`)===t.element&&!!n.offsetParent);if(r.length!==0)switch(e.key){case"Up":case"ArrowUp":if(this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r,!0);break;case"Down":case"ArrowDown":if(this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r);break;case"Left":case"ArrowLeft":if(!this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r,!0);break;case"Right":case"ArrowRight":if(!this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r);break;case"Esc":case"Escape":this.highlightedItem!==this.element&&(e.preventDefault(),e.stopPropagation(),this.defocusItem(this.highlightedItem),this.highlightedItem=this.element,this.element.removeAttribute("aria-activedescendant"),this.element.focus());break;case"Enter":case" ":e.target===this.element&&this.highlightedItem!==this.element&&(e.preventDefault(),e.stopPropagation(),this.highlightedItem.click());break}}onClick(e){this.defocusItem(this.highlightedItem);let t=e.target;if(!t.hasAttribute(lA))for(;t.parentElement.closest(`[${lA}]`)!==this.element;)t=t.parentElement.closest(`[${lA}]`);this.highlightedItem=t.closest(`[${ZL}]`)||t.closest(`[${lA}]`)||this.highlightedItem,t.hasAttribute(`${ZL}`)&&this.element.focus(),this.highlightedItem!==this.element?this.focusItem(this.highlightedItem):this.element.removeAttribute("aria-activedescendant")}onFocus(){this.highlightedItem&&!this.isClicked&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.show(),this.highlightedItem.getAttribute(ZL)===rde&&this.highlightedItem.querySelector(`[${ide}]`)?._tippy?.show()),this.isClicked=!1,this.element.hasAttribute("aria-activedescendant")||this.highlightedItem===this.element||this.setAriaActiveDescendant(this.highlightedItem),v6t(this.element)}onBlur(){this.highlightedItem&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.hide(),this.highlightedItem.getAttribute(ZL)===rde&&this.highlightedItem.querySelector(`[${ide}]`)?._tippy?.hide())}onMousedown(){this.isClicked=!0}onTouchstart(){this.isTapped=!0}}const Rht="focus-item",HDr={beforeMount(i,e){i.hasAttribute("id")||i.setAttribute("id",WDr()),e.value?i.setAttribute(Rht,e.value):i.toggleAttribute(Rht,!0)}};function WDr(){let i;do i="focus-item-"+Math.random().toString(36).substring(2,9);while(document.getElementById(i)!==null);return i}const bYe="focus-container",_6t="focus-list",qDr="focus-icon",nOe=`[${_6t}],[${bYe}]`,Dht=`button,input,select,a,textarea,[contenteditable],.ag-tab-guard,[${_6t}],[${bYe}],[${qDr}]`;let sOe=[];const YDr={mounted(i){[...document.querySelectorAll(".inner-shell")].some(t=>t.contains(i))&&sOe.push(new XDr(i))},beforeUnmount(i){sOe=sOe.filter(e=>e.element===i?(e.removeEventListeners(),!1):!0)}};class XDr{element;constructor(e){this.element=e,this.element.toggleAttribute(bYe,!0),this.element.tabIndex=0,this.disableTabbing();const t=this;this.element.addEventListener("keypress",function(r){t.onKeypress(r)}),this.element.addEventListener("click",function(){t.onClick()}),this.element.addEventListener("focusout",function(r){t.onFocusOut(r)}),this.element.addEventListener("focus",function(){t.onFocus()})}removeEventListeners(){const e=this;this.element.removeEventListener("keypress",function(t){e.onKeypress(t)}),this.element.removeEventListener("click",function(){e.onClick()}),this.element.removeEventListener("focusout",function(t){e.onFocusOut(t)}),this.element.removeEventListener("focus",function(){e.onFocus()})}onKeypress(e){e.target===this.element&&(e.key==="Enter"||e.key===" ")&&this.enableTabbing().focus()}onClick(){this.enableTabbing()}onFocusOut(e){this.element.contains(e.relatedTarget)||this.disableTabbing()}onFocus(){this.disableTabbing()}disableTabbing(){Array.prototype.filter.call(this.element.querySelectorAll(Dht),()=>!0).forEach(t=>{t.tabIndex=-1})}enableTabbing(){let e;return Array.prototype.map.call(this.element.querySelectorAll(Dht),t=>{(t.closest(nOe)===this.element||t.closest(nOe)===t&&t.parentElement.closest(nOe)===this.element)&&t.offsetParent&&(t.tabIndex=0,e===void 0&&(e=t))}),e}}const JDr="aaa1rp3barth4b_ott3vie4c1le2ogado5udhabi7c_ademy5centure6ountant_s9o1tor4d_s1ult4e_g1ro2tna4f_l1rica5g_akhan5ency5i_g1rbus3force5tel5kdn3l_faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m_azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o_l2partments8p_le4q_uarelle8r_ab1mco4chi3my2pa2t_e3s_da2ia2sociates9t_hleta5torney7u_ction5di_ble3o3spost5thor3o_s4vianca6w_s2x_a2z_ure5ba_by2idu3namex3narepublic11d1k2r_celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b_c1t1va3cg1n2d1e_ats2uty4er2ntley5rlin4st_buy5t2f1g1h_arti5i_ble3d1ke2ng_o3o1z2j1lack_friday9ockbuster8g1omberg7ue3m_s1w2n_pparibas9o_ats3ehringer8fa2m1nd2o_k_ing5sch2tik2on4t1utique6x2r_adesco6idgestone9oadway5ker3ther5ussels7s1t1uild_ers6siness6y1zz3v1w1y1z_h3ca_b1fe2l_l1vinklein9m_era3p2non3petown5ital_one8r_avan4ds2e_er_s4s2sa1e1h1ino4t_ering5holic7ba1n1re2s2c1d1enter4o1rn3f_a1d2g1h_anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i_priani6rcle4sco3tadel4i_c2y_eats7k1l_aims4eaning6ick2nic1que6othing5ud3ub_med6m1n1o_ach3des3ffee4llege4ogne5m_cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking_channel11l1p2rsica5untry4pon_s4rses6pa2r_edit_card4union9icket5own3s1uise_s6u_isinella9v1w1x1y_mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e_al_er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si_gn4v2hl2iamonds6et2gital5rect_ory7scount3ver5h2y2j1k1m1np2o_cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c_o2deka3u_cation8e1g1mail3erck5nergy4gineer_ing9terprises10pson4quipment8r_icsson6ni3s_q1tate5t_isalat7u_rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n_s2rm_ers5shion4t3edex3edback6rrari3ero6i_at2delity5o2lm2nal1nce1ial7re_stone6mdale6sh_ing5t_ness6j1k1lickr3ghts4r2orist4wers5y2m1o_o_d_network8tball6rd1ex2sale4um3undation8x2r_ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n_d2rniture7tbol5yi3ga_l_lery3o1up4me_s3p1rden4y2b_iz3d_n2e_a1nt_ing5orge5f1g_ee3h1i_ft_s3ves2ing5l_ass3e1obal2o4m_ail3bh2o1x2n1odaddy5ld_point6f2o_dyear5g_le4p1t1v2p1q1r_ainger5phics5tis4een3ipe3ocery4up4s1t1u_ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc_bank7ealth_care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k_t2m1n1ockey4ldings5iday5medepot5goods5s_ense7nda3rse3spital5t_ing5t_eles2s3mail5use3w2r1sbc3t1u_ghes5yatt3undai7ibm2cbc2e1u2d1e_ee3fm2kano4l1m_amat4db2mo_bilien9n_c1dustries8finiti5o2g1k1stitute6urance4e4t_ernational10uit4vestments10o1piranga7q1r_ish4s_maili5t_anbul7t_au2v3jaguar4va3cb2e_ep2tzt3welry6io2ll2m_p2nj2o_bs1urg4t1y2p_morgan6rs3uegos4niper7kaufen5ddi3e_rryhotels6logistics9properties14fh2g1h1i_a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p_mg2n2r_d1ed3uokgroup8w1y_oto4z2la_caixa5mborghini8er3ncaster5ia3d_rover6xess5salle5t_ino3robe5w_yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i_dl2fe_insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan_s3cker3us3l1ndon4tte1o3ve3pl_financial11r1s1t_d_a3u_ndbeck6xe1ury5v1y2ma_cys3drid4if1son4keup4n_agement7go3p1rket_ing3s4riott5shalls7serati6ttel5ba2c_kinsey7d1e_d_ia3et2lbourne7me1orial6n_u2rckmsd7g1h1iami3crosoft7l1ni1t2t_subishi9k1l_b1s2m_a2n1o_bi_le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to_rcycles9v_ie4p1q1r1s_d2t_n1r2u_seum3ic3tual5v1w1x1y1z2na_b1goya4me2tura4vy3ba2c1e_c1t_bank4flix4work5ustar5w_s2xt_direct7us4f_l2g_o2hk2i_co2ke1on3nja3ssan1y5l1o_kia3rthwesternmutual14on4w_ruz3tv4p1r_a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan_group9dnavy5lo3m_ega4ne1g1l_ine5oo2pen3racle3nge4g_anic5igins6saka4tsuka4t2vh3pa_ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e_t2f_izer5g1h_armacy6d1ilips5one2to_graphy6s4ysio5ics1tet2ures6d1n_g1k2oneer5zza4k1l_ace2y_station9umbing5s3m1n_c2ohl2ker3litie5rn2st3r_america6xi3ess3ime3o_d_uctions8f1gressive8mo2perties3y5tection8u_dential9s1t1ub2w_c2y2qa1pon3uebec3st5racing4dio4e_ad1lestate6tor2y4cipes5d_stone5umbrella9hab3ise_n3t2liance6n_t_als5pair3ort3ublican8st_aurant8view_s5xroth6ich_ardli6oh3l1o1p2o_cher3ks3deo3gers4om3s_vp3u_gby3hr2n2w_e2yukyu6sa_arland6fe_ty4kura4le1on3msclub4ung5ndvik_coromant12ofi4p1rl2s1ve2xo3b_i1s2c_a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e_arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x_y3fr2g1h_angrila6rp2w2ell3ia1ksha5oes2p_ping5uji3w_time7i_lk2na1gles5te3j1k_i_n2y_pe4l_ing4m_art3ile4n_cf3o_ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa_ce3ort2t3r_l2s1t_ada2ples4r1tebank4farm7c_group6ockholm6rage3e3ream4udio2y3yle4u_cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y_dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x_i3c_i2d_k2eam2ch_nology8l1masek5nnis4va3f1g1h_d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j_maxx4x2k_maxx5l1m_all4n1o_day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r_ade1ing4ining5vel_channel7ers_insurance16ust3v2t1ube2i1nes3shu4v_s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va_cations7na1guard7c1e_gas3ntures6risign5mögensberater2ung14sicherung10t2g1i_ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u_elos6wales2mart4ter4ng_gou5tch_es6eather_channel12bcam3er2site5d_ding5ibo2r3f1hoswho6ien2ki2lliamhill9n_dows4e1ners6me2olterskluwer11odside6rk_s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u_tube6t1un3za_ppos4ra3ero3ip2m1one3uerich6w2",KDr="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत_म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里_大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",dq=(i,e)=>{for(const t in e)i[t]=e[t];return i},z$e="numeric",V$e="ascii",H$e="alpha",Pge="asciinumeric",nde="alphanumeric",W$e="domain",b6t="emoji",ZDr="scheme",QDr="slashscheme",Fht="whitespace";function e4r(i,e){return i in e||(e[i]=[]),e[i]}function _8(i,e,t){e[z$e]&&(e[Pge]=!0,e[nde]=!0),e[V$e]&&(e[Pge]=!0,e[H$e]=!0),e[Pge]&&(e[nde]=!0),e[H$e]&&(e[nde]=!0),e[nde]&&(e[W$e]=!0),e[b6t]&&(e[W$e]=!0);for(const r in e){const n=e4r(r,t);n.indexOf(i)<0&&n.push(i)}}function t4r(i,e){const t={};for(const r in e)e[r].indexOf(i)>=0&&(t[r]=!0);return t}function rx(i){i===void 0&&(i=null),this.j={},this.jr=[],this.jd=null,this.t=i}rx.groups={};rx.prototype={accepts(){return!!this.t},go(i){const e=this,t=e.j[i];if(t)return t;for(let r=0;ri.ta(e,t,r,n),h2=(i,e,t,r,n)=>i.tr(e,t,r,n),kht=(i,e,t,r,n)=>i.ts(e,t,r,n),Ln=(i,e,t,r,n)=>i.tt(e,t,r,n),cO="WORD",q$e="UWORD",Mse="LOCALHOST",Y$e="TLD",X$e="UTLD",Rge="SCHEME",pU="SLASH_SCHEME",A_e="NUM",w6t="WS",wYe="NL",Xz="OPENBRACE",sre="OPENBRACKET",ore="OPENANGLEBRACKET",are="OPENPAREN",N6="CLOSEBRACE",Jz="CLOSEBRACKET",Kz="CLOSEANGLEBRACKET",$6="CLOSEPAREN",M_e="AMPERSAND",O_e="APOSTROPHE",P_e="ASTERISK",_5="AT",R_e="BACKSLASH",D_e="BACKTICK",F_e="CARET",G5="COLON",xYe="COMMA",k_e="DOLLAR",WI="DOT",L_e="EQUALS",SYe="EXCLAMATION",qI="HYPHEN",N_e="PERCENT",$_e="PIPE",B_e="PLUS",j_e="POUND",G_e="QUERY",TYe="QUOTE",CYe="SEMI",HO="SLASH",lre="TILDE",U_e="UNDERSCORE",x6t="EMOJI",z_e="SYM";var S6t=Object.freeze({__proto__:null,WORD:cO,UWORD:q$e,LOCALHOST:Mse,TLD:Y$e,UTLD:X$e,SCHEME:Rge,SLASH_SCHEME:pU,NUM:A_e,WS:w6t,NL:wYe,OPENBRACE:Xz,OPENBRACKET:sre,OPENANGLEBRACKET:ore,OPENPAREN:are,CLOSEBRACE:N6,CLOSEBRACKET:Jz,CLOSEANGLEBRACKET:Kz,CLOSEPAREN:$6,AMPERSAND:M_e,APOSTROPHE:O_e,ASTERISK:P_e,AT:_5,BACKSLASH:R_e,BACKTICK:D_e,CARET:F_e,COLON:G5,COMMA:xYe,DOLLAR:k_e,DOT:WI,EQUALS:L_e,EXCLAMATION:SYe,HYPHEN:qI,PERCENT:N_e,PIPE:$_e,PLUS:B_e,POUND:j_e,QUERY:G_e,QUOTE:TYe,SEMI:CYe,SLASH:HO,TILDE:lre,UNDERSCORE:U_e,EMOJI:x6t,SYM:z_e});const Sj=/[a-z]/,oOe=/\p{L}/u,aOe=/\p{Emoji}/u,lOe=/\d/,Lht=/\s/,Nht=` -`,i4r="️",r4r="‍";let sde=null,ode=null;function n4r(i){i===void 0&&(i=[]);const e={};rx.groups=e;const t=new rx;sde==null&&(sde=$ht(JDr)),ode==null&&(ode=$ht(KDr)),Ln(t,"'",O_e),Ln(t,"{",Xz),Ln(t,"[",sre),Ln(t,"<",ore),Ln(t,"(",are),Ln(t,"}",N6),Ln(t,"]",Jz),Ln(t,">",Kz),Ln(t,")",$6),Ln(t,"&",M_e),Ln(t,"*",P_e),Ln(t,"@",_5),Ln(t,"`",D_e),Ln(t,"^",F_e),Ln(t,":",G5),Ln(t,",",xYe),Ln(t,"$",k_e),Ln(t,".",WI),Ln(t,"=",L_e),Ln(t,"!",SYe),Ln(t,"-",qI),Ln(t,"%",N_e),Ln(t,"|",$_e),Ln(t,"+",B_e),Ln(t,"#",j_e),Ln(t,"?",G_e),Ln(t,'"',TYe),Ln(t,"/",HO),Ln(t,";",CYe),Ln(t,"~",lre),Ln(t,"_",U_e),Ln(t,"\\",R_e);const r=h2(t,lOe,A_e,{[z$e]:!0});h2(r,lOe,r);const n=h2(t,Sj,cO,{[V$e]:!0});h2(n,Sj,n);const s=h2(t,oOe,q$e,{[H$e]:!0});h2(s,Sj),h2(s,oOe,s);const o=h2(t,Lht,w6t,{[Fht]:!0});Ln(t,Nht,wYe,{[Fht]:!0}),Ln(o,Nht),h2(o,Lht,o);const a=h2(t,aOe,x6t,{[b6t]:!0});h2(a,aOe,a),Ln(a,i4r,a);const l=Ln(a,r4r);h2(l,aOe,a);const u=[[Sj,n]],c=[[Sj,null],[oOe,s]];for(let h=0;hh[0]>p[0]?1:-1);for(let h=0;h=0?v[W$e]=!0:Sj.test(p)?lOe.test(p)?v[Pge]=!0:v[V$e]=!0:v[z$e]=!0,kht(t,p,p,v)}return kht(t,"localhost",Mse,{ascii:!0}),t.jd=new rx(z_e),{start:t,tokens:dq({groups:e},S6t)}}function s4r(i,e){const t=o4r(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=t.length,n=[];let s=0,o=0;for(;o=0&&(h+=t[o].length,p++),u+=t[o].length,s+=t[o].length,o++;s-=h,o-=p,u-=h,n.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return n}function o4r(i){const e=[],t=i.length;let r=0;for(;r56319||r+1===t||(s=i.charCodeAt(r+1))<56320||s>57343?i[r]:i.slice(r,r+2);e.push(o),r+=o.length}return e}function ED(i,e,t,r,n){let s;const o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(t.join(""));let o=parseInt(i.substring(r,r+s),10);for(;o>0;o--)t.pop();r+=s}else i[r]==="_"?(e.push(t.join("")),r++):(t.push(i[r]),r++)}return e}const Ose={defaultProtocol:"http",events:null,format:Bht,formatHref:Bht,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function EYe(i,e){e===void 0&&(e=null);let t=dq({},Ose);i&&(t=dq(t,i instanceof EYe?i.o:i));const r=t.ignoreTags,n=[];for(let s=0;st?r.substring(0,t)+"…":r},toFormattedHref(i){return i.get("formatHref",this.toHref(i.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(i){return i===void 0&&(i=Ose.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(i),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(i){return{type:this.t,value:this.toFormattedString(i),isLink:this.isLink,href:this.toFormattedHref(i),start:this.startIndex(),end:this.endIndex()}},validate(i){return i.get("validate",this.toString(),this)},render(i){const e=this,t=this.toFormattedHref(i),r=i.get("tagName",t,e),n=this.toFormattedString(i),s={},o=i.get("className",t,e),a=i.get("target",t,e),l=i.get("rel",t,e),u=i.getObj("attributes",t,e),c=i.getObj("events",t,e);return s.href=t,o&&(s.class=o),a&&(s.target=a),l&&(s.rel=l),u&&dq(s,u),{tagName:r,attributes:s,content:n,eventListeners:c}}};function mTe(i,e){class t extends T6t{constructor(n,s){super(n,s),this.t=i}}for(const r in e)t.prototype[r]=e[r];return t.t=i,t}const jht=mTe("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ght=mTe("text"),a4r=mTe("nl"),QL=mTe("url",{isLink:!0,toHref(i){return i===void 0&&(i=Ose.defaultProtocol),this.hasProtocol()?this.v:`${i}://${this.v}`},hasProtocol(){const i=this.tk;return i.length>=2&&i[0].t!==Mse&&i[1].t===G5}}),Ng=i=>new rx(i);function l4r(i){let{groups:e}=i;const t=e.domain.concat([M_e,P_e,_5,R_e,D_e,F_e,k_e,L_e,qI,A_e,N_e,$_e,B_e,j_e,HO,z_e,lre,U_e]),r=[O_e,Kz,N6,Jz,$6,G5,xYe,WI,SYe,ore,Xz,sre,are,G_e,TYe,CYe],n=[M_e,O_e,P_e,R_e,D_e,F_e,N6,k_e,L_e,qI,A_e,Xz,N_e,$_e,B_e,j_e,G_e,HO,z_e,lre,U_e],s=Ng(),o=Ln(s,lre);Io(o,n,o),Io(o,e.domain,o);const a=Ng(),l=Ng(),u=Ng();Io(s,e.domain,a),Io(s,e.scheme,l),Io(s,e.slashscheme,u),Io(a,n,o),Io(a,e.domain,a);const c=Ln(a,_5);Ln(o,_5,c),Ln(l,_5,c),Ln(u,_5,c);const h=Ln(o,WI);Io(h,n,o),Io(h,e.domain,o);const p=Ng();Io(c,e.domain,p),Io(p,e.domain,p);const m=Ln(p,WI);Io(m,e.domain,p);const v=Ng(jht);Io(m,e.tld,v),Io(m,e.utld,v),Ln(c,Mse,v);const w=Ln(p,qI);Io(w,e.domain,p),Io(v,e.domain,p),Ln(v,WI,m),Ln(v,qI,w);const S=Ln(v,G5);Io(S,e.numeric,jht);const I=Ln(a,qI),R=Ln(a,WI);Io(I,e.domain,a),Io(R,n,o),Io(R,e.domain,a);const L=Ng(QL);Io(R,e.tld,L),Io(R,e.utld,L),Io(L,e.domain,a),Io(L,n,o),Ln(L,WI,R),Ln(L,qI,I),Ln(L,_5,c);const k=Ln(L,G5),B=Ng(QL);Io(k,e.numeric,B);const $=Ng(QL),V=Ng();Io($,t,$),Io($,r,V),Io(V,t,$),Io(V,r,V),Ln(L,HO,$),Ln(B,HO,$);const Y=Ln(l,G5),K=Ln(u,G5),Q=Ln(K,HO);Ln(Q,HO,Y),Io(l,e.domain,a),Ln(l,WI,R),Ln(l,qI,I),Io(u,e.domain,a),Ln(u,WI,R),Ln(u,qI,I),Io(Y,e.domain,$),Ln(Y,HO,$);const re=Ln($,Xz),ne=Ln($,sre),de=Ln($,ore),pe=Ln($,are);Ln(V,Xz,re),Ln(V,sre,ne),Ln(V,ore,de),Ln(V,are,pe),Ln(re,N6,$),Ln(ne,Jz,$),Ln(de,Kz,$),Ln(pe,$6,$),Ln(re,N6,$);const H=Ng(QL),Z=Ng(QL),ae=Ng(QL),fe=Ng(QL);Io(re,t,H),Io(ne,t,Z),Io(de,t,ae),Io(pe,t,fe);const be=Ng(),_e=Ng(),Ie=Ng(),Te=Ng();return Io(re,r),Io(ne,r),Io(de,r),Io(pe,r),Io(H,t,H),Io(Z,t,Z),Io(ae,t,ae),Io(fe,t,fe),Io(H,r,H),Io(Z,r,Z),Io(ae,r,ae),Io(fe,r,fe),Io(be,t,be),Io(_e,t,Z),Io(Ie,t,ae),Io(Te,t,fe),Io(be,r,be),Io(_e,r,_e),Io(Ie,r,Ie),Io(Te,r,Te),Ln(Z,Jz,$),Ln(ae,Kz,$),Ln(fe,$6,$),Ln(H,N6,$),Ln(_e,Jz,$),Ln(Ie,Kz,$),Ln(Te,$6,$),Ln(be,$6,$),Ln(s,Mse,L),Ln(s,wYe,a4r),{start:s,tokens:S6t}}function u4r(i,e,t){let r=t.length,n=0,s=[],o=[];for(;n=0&&p++,n++,c++;if(p<0)n-=c,n0&&(s.push(uOe(Ght,e,o)),o=[]),n-=p,c-=p;const m=h.t,v=t.slice(n-c,n);s.push(uOe(m,e,v))}}return o.length>0&&s.push(uOe(Ght,e,o)),s}function uOe(i,e,t){const r=t[0].s,n=t[t.length-1].e,s=e.slice(r,n);return new i(s,t)}const R1={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function c4r(){R1.scanner=n4r(R1.customSchemes);for(let i=0;i",lt:"<",nbsp:" ",quot:'"'},p4r=/^#[xX]([A-Fa-f0-9]+)$/,f4r=/^#([0-9]+)$/,m4r=/^([A-Za-z0-9]+)$/,g4r=function(){function i(e){this.named=e}return i.prototype.parse=function(e){if(e){var t=e.match(p4r);if(t)return String.fromCharCode(parseInt(t[1],16));if(t=e.match(f4r),t)return String.fromCharCode(parseInt(t[1],10));if(t=e.match(m4r),t)return this.named[t[1]]||"&"+t[1]+";"}},i}(),y4r=/[\t\n\f ]/,v4r=/[A-Za-z]/,_4r=/\r\n?/g;function L0(i){return y4r.test(i)}function Uht(i){return v4r.test(i)}function b4r(i){return i.replace(_4r,` -`)}var w4r=function(){function i(e,t,r){r===void 0&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var n=this.peek();if(n==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&n===` -`){var s=this.tagNameBuffer.toLowerCase();(s==="pre"||s==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var n=this.peek(),s=this.tagNameBuffer;n==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):n==="&"&&s!=="script"&&s!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(n))},tagOpen:function(){var n=this.consume();n==="!"?this.transitionTo("markupDeclarationOpen"):n==="/"?this.transitionTo("endTagOpen"):(n==="@"||n===":"||Uht(n))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(n))},markupDeclarationOpen:function(){var n=this.consume();if(n==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var s=n.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();s==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var n=this.consume();L0(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();L0(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();L0(n)?this.transitionTo("afterDoctypeName"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase())},afterDoctypeName:function(){var n=this.consume();if(!L0(n))if(n===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var s=n.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),o=s.toUpperCase()==="PUBLIC",a=s.toUpperCase()==="SYSTEM";(o||a)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),o?this.transitionTo("afterDoctypePublicKeyword"):a&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var n=this.peek();L0(n)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):n==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):n==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):n===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},doctypePublicIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},afterDoctypePublicIdentifier:function(){var n=this.consume();L0(n)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var n=this.consume();L0(n)||(n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},doctypeSystemIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},afterDoctypeSystemIdentifier:function(){var n=this.consume();L0(n)||n===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var n=this.consume();n==="-"?this.transitionTo("commentStartDash"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(n),this.transitionTo("comment"))},commentStartDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var n=this.consume();n==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(n)},commentEndDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+n),this.transitionTo("comment"))},commentEnd:function(){var n=this.consume();n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+n),this.transitionTo("comment"))},tagName:function(){var n=this.consume();L0(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();L0(n)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):n==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(n)},beforeAttributeName:function(){var n=this.peek();if(L0(n)){this.consume();return}else n==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var n=this.peek();L0(n)?(this.transitionTo("afterAttributeName"),this.consume()):n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==='"'||n==="'"||n==="<"?(this.delegate.reportSyntaxError(n+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(n)):(this.consume(),this.delegate.appendToAttributeName(n))},afterAttributeName:function(){var n=this.peek();if(L0(n)){this.consume();return}else n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n))},beforeAttributeValue:function(){var n=this.peek();L0(n)?this.consume():n==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(n))},attributeValueDoubleQuoted:function(){var n=this.consume();n==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueSingleQuoted:function(){var n=this.consume();n==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueUnquoted:function(){var n=this.peek();L0(n)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):n===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(n))},afterAttributeValueQuoted:function(){var n=this.peek();L0(n)?(this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var n=this.peek();n===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var n=this.consume();(n==="@"||n===":"||Uht(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return i.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},i.prototype.transitionTo=function(e){this.state=e},i.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},i.prototype.tokenizePart=function(e){for(this.input+=b4r(e);this.index"||e==="style"&&this.input.substring(this.index,this.index+8)!==""||e==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},i}(),x4r=function(){function i(e,t){t===void 0&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new w4r(this,e,t.mode),this._currentAttribute=void 0}return i.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},i.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},i.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},i.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},i.prototype.current=function(){var e=this.token;if(e===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return e;for(var t=0;t=0))continue;let c=r.length;I4r(l,t,++o,r),o+=r.length-c-1}else if(a.type!==J$e)r.push(a);else{const l=E4r(a.chars,s);r.push.apply(r,l)}}for(let o=0;o0&&(l+=" "+O4r(a.attributes).join(" ")),a.selfClosing&&(l+=" /"),l+=">",n.push(l);break}case E6t:n.push(``);break;case J$e:n.push(K$e(a.chars));break;case T4r:n.push(``);break;case C4r:{let l=`",n.push(l);break}}}return n.join("")}function E4r(i,e){const t=h4r(i),r=[];for(let n=0;n0;){let s=e[t];s.type===V_e&&s.tagName.toUpperCase()===i?n++:s.type===E6t&&s.tagName.toUpperCase()===i&&n--,r.push(s),t++}return r}function A4r(i){let{tagName:e,attributes:t,content:r}=i;return`<${e} ${M4r(t)}>${K$e(r)}`}function K$e(i){return i.replace(/&/g,"&").replace(//g,">")}function I6t(i){return i.replace(/"/g,""")}function M4r(i){const e=[];for(const t in i){const r=i[t]+"";e.push(`${t}="${I6t(r)}"`)}return e.join(" ")}function O4r(i){const e=[];for(let t=0;t=i.reference.scrollWidth)return!1}const k4r=i=>{const e={"<":"<",">":">",'"':""","'":"'"};return i.replace(/[<>"']/g,t=>e[t])};function zht(i){if(i===null)return"";const e=k4r(i);return gTe(e,{target:"_blank",validate:{url:t=>/^https?:\/\//.test(t)}})}const L4r=["content"],N4r={key:0,class:"flex flex-shrink-0 items-center border-b border-solid border-gray-600 px-8 h-48 overflow-hidden",tabindex:"-1"},$4r={class:"flex-grow text-lg py-16 pl-8 min-w-0"},B4r={key:0,class:"flex"},j4r={key:1,class:"p-8 flex-grow overflow-y-auto"},G4r={key:2,class:"px-16 py-16 border-t border-gray-400 default-focus-style"},U4r=Xr({__name:"panel-screen",props:{header:{type:Boolean,default:!0},content:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},panel:{type:Object,required:!0}},setup(i){const e=i,{t}=Qn(),r=w0(),n=dy(),s=eo("iApi"),o=vi(),a=Hr(()=>s?.fixture.get("appbar")?n.temporary:[]),l=Hr(()=>r.mobileView),u=Hr(()=>r.reorderable),c=()=>!l.value&&!e.panel.teleport,h=p=>{e.panel.move(p),p==="left"&&Bv(()=>{(o.value?.querySelector(".move-left")).focus()})};return Fa(()=>{o.value?.addEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.addEventListener("keyup",p=>{p.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),Ka(()=>{o.value?.removeEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.removeEventListener("keyup",p=>{p.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),(p,m)=>{const v=Ko("back"),w=Ko("panel-options-menu"),S=Ko("left"),I=Ko("right"),R=Ko("pin"),L=Ko("expand"),k=Ko("minimize"),B=Ko("close"),$=Nn("truncate"),V=Nn("focus-item"),Y=Nn("tippy");return Ur((qt(),si("div",{class:"h-full flex flex-col items-stretch",content:ri(t)("panels.access"),ref_key:"el",ref:o},[i.header?(qt(),si("header",N4r,[Vn(v,{class:Wn(i.panel.teleport?"display-none":"block sm:display-none"),onClick:m[0]||(m[0]=K=>i.panel.close())},null,8,["class"]),Ur((qt(),si("h2",$4r,[Em(p.$slots,"header")])),[[$]]),p.$slots.controls?(qt(),Dn(w,{key:0},{default:Rn(()=>[Em(p.$slots,"controls")]),_:3})):Yr("",!0),Ot("div",{class:Wn(i.panel.teleport?"flex":"display-none sm:flex")},[i.panel.teleport?Yr("",!0):(qt(),si("div",B4r,[u.value?(qt(),Dn(S,{key:0,onClick:m[1]||(m[1]=K=>h("left")),active:!i.panel.isLeftMostPanel},null,8,["active"])):Yr("",!0),u.value?(qt(),Dn(I,{key:1,onClick:m[2]||(m[2]=K=>h("right")),active:!i.panel.isRightMostPanel},null,8,["active"])):Yr("",!0),Vn(R,{onClick:m[3]||(m[3]=K=>i.panel.pin()),active:i.panel.isPinned},null,8,["active"]),i.panel.controls&&i.panel.controls.expand?(qt(),Dn(L,{key:2,onClick:m[4]||(m[4]=K=>i.panel.expand()),active:i.panel.expanded},null,8,["active"])):Yr("",!0)])),i.panel.button&&a.value?.includes(i.panel.id)?(qt(),Dn(k,{key:1,onClick:m[5]||(m[5]=K=>i.panel.minimize())})):Yr("",!0),Vn(B,{onClick:m[6]||(m[6]=K=>i.panel.close())})],2)])):Yr("",!0),i.content?(qt(),si("div",j4r,[Em(p.$slots,"content")])):Yr("",!0),i.footer?Ur((qt(),si("div",G4r,[Em(p.$slots,"footer")])),[[V]]):Yr("",!0)],8,L4r)),[[Y,{trigger:"manual",onShow:c,popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}}),z4r={class:"relative",tabindex:"-1"},V4r=["content","aria-label"],H4r=["transform"],W4r=Ot("path",{d:"M298.028 214.267L285.793 96H328c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24H56C42.745 0 32 10.745 32 24v48c0 13.255 10.745 24 24 24h42.207L85.972 214.267C37.465 236.82 0 277.261 0 328c0 13.255 10.745 24 24 24h136v104.007c0 1.242.289 2.467.845 3.578l24 48c2.941 5.882 11.364 5.893 14.311 0l24-48a8.008 8.008 0 0 0 .845-3.578V352h136c13.255 0 24-10.745 24-24-.001-51.183-37.983-91.42-85.973-113.733z"},null,-1),q4r=[W4r],Y4r=Xr({__name:"pin",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",z4r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)(i.active?"panels.controls.unpin":"panels.controls.pin"),"aria-label":ri(e)(i.active?"panels.controls.unpin":"panels.controls.pin")},[(qt(),si("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",transform:`rotate(${i.active?30:0})`},q4r,8,H4r))],10,V4r)),[[n,{placement:"bottom",hideOnClick:!1}]])])}}}),X4r={class:"relative",tabindex:"-1"},J4r=["content","aria-label"],K4r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Ot("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1),Z4r=[K4r],Q4r=Xr({__name:"close",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",X4r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.close"),"aria-label":ri(e)("panels.controls.close")},Z4r,10,J4r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),e5r={class:"relative",tabindex:"-1"},t5r=["content","aria-label"],i5r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current w-16 h-16",viewBox:"0 0 16 16"},[Ot("path",{d:"M20.485784919653916,7.578491965389372h-14.170000000000005l3.5800000000000054,-3.589999999999997l-1.409999999999993,-1.4099999999999984l-6.000000000000008,6.0000000000000275l6.000000000000008,6l1.409999999999993,-1.4100000000000001l-3.58,-3.59h14.170000000000007Z",transform:"matrix(0.865803 0 0 0.865803 -1.99071 0.638058)"})],-1),r5r=[i5r],n5r=Xr({__name:"back",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",e5r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.back"),"aria-label":ri(e)("panels.controls.back")},r5r,10,t5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),s5r={class:"w-32 h-32"},o5r=["content"],a5r={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},l5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),u5r=Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),c5r=Ot("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"},null,-1),h5r=[l5r,u5r,c5r],d5r={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},p5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),f5r=Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),m5r=Ot("path",{d:"M8 19h3v3h2v-3h3l-4-4-4 4zm8-15h-3V1h-2v3H8l4 4 4-4zM4 9v2h16V9H4z"},null,-1),g5r=Ot("path",{d:"M4 12h16v2H4z"},null,-1),y5r=[p5r,f5r,m5r,g5r],v5r=Xr({__name:"expand",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",s5r,[Ur((qt(),si("button",{type:"button",class:"text-gray-500 hover:text-black focus:text-black w-full h-full flex justify-center items-center",content:ri(e)(`panels.controls.${i.active?"collapse":"expand"}`)},[i.active?(qt(),si("svg",d5r,y5r)):(qt(),si("svg",a5r,h5r))],8,o5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale",hideOnClick:!1}]])])}}}),_5r={class:"relative",tabindex:"-1"},b5r=["content","aria-label"],w5r=Ot("svg",{class:"fill-current w-20 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M6 19h12v2H6z"})],-1),x5r=[w5r],S5r=Xr({__name:"minimize",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",_5r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-6",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.minimize"),"aria-label":ri(e)("panels.controls.minimize")},x5r,10,b5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),T5r={class:"relative",tabindex:"-1"},C5r=["content","aria-label"],E5r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[Ot("path",{d:"M 8.59 16.34 L 13.17 11.75 L 8.59 7.16 L 10 5.75 L 16 11.75 L 10 17.75 Z"})],-1),I5r=[E5r],A5r=Xr({__name:"right",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",T5r,[Ur((qt(),si("button",{type:"button",class:Wn(["p-8",{"text-gray-500 hover:text-black focus:text-black":i.active,"text-gray-300":!i.active}]),content:ri(e)("panels.controls.moveRight"),"aria-label":ri(e)("panels.controls.moveRight")},I5r,10,C5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),M5r={class:"relative",tabindex:"-1"},O5r=["content","aria-label"],P5r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[Ot("path",{d:"M 15.41 16.09 L 10.83 11.5 L 15.41 6.91 L 14 5.5 L 8 11.5 L 14 17.5 Z"})],-1),R5r=[P5r],D5r=Xr({__name:"left",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",M5r,[Ur((qt(),si("button",{type:"button",class:Wn(["p-8 move-left",{"text-gray-500 hover:text-black focus:text-black":i.active,"text-gray-300":!i.active}]),content:ri(e)("panels.controls.moveLeft"),"aria-label":ri(e)("panels.controls.moveLeft")},R5r,10,O5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),F5r=i=>(Dc("data-v-9e477d20"),i=i(),Fc(),i),k5r=F5r(()=>Ot("div",{class:"p-6"},[Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20"},[Ot("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)),L5r=Xr({__name:"panel-options-menu",setup(i){const{t:e}=Qn();return(t,r)=>(qt(),Dn(cYe,{class:"flex",tooltip:ri(e)("panels.controls.optionsMenu"),popperOptions:{strategy:"fixed"},position:"bottom-end"},{header:Rn(()=>[k5r]),default:Rn(()=>[Em(t.$slots,"default",{},void 0,!0)]),_:3},8,["tooltip"]))}}),N5r=ml(L5r,[["__scopeId","data-v-9e477d20"]]),$5r={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},B5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),j5r=Ot("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},null,-1),G5r=[B5r,j5r],U5r={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},z5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),V5r=Ot("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},null,-1),H5r=[z5r,V5r],W5r=Xr({__name:"fullscreen-nav",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{t.toggleFullscreen()};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("mapnav.fullscreen")},{default:Rn(()=>[ri(t).isFullscreen?(qt(),si("svg",$5r,G5r)):(qt(),si("svg",U5r,H5r))]),_:1},8,["tooltip"])}}}),q5r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})],-1),Y5r=Xr({__name:"geolocator-nav",setup(i){const{t:e}=Qn(),t=eo("iApi");let r=Zl([]);const n=async()=>{if(r.length)s(r);else{const a=await o({maximumAge:1/0,timeout:5e3}).catch(l=>{l.code===GeolocationPositionError.PERMISSION_DENIED?t.notify.show(K1.ERROR,e("mapnav.geolocator.error.permission")):t.notify.show(K1.ERROR,e("mapnav.geolocator.error.internal"))});a&&(r=[a.coords.longitude,a.coords.latitude],s(r))}},s=a=>{let l=new s0("geolocation",a,xl.latLongSR(),!0);t.geo.map.zoomMapTo(l)},o=a=>new Promise((l,u)=>navigator.geolocation.getCurrentPosition(l,u,a));return(a,l)=>{const u=Ko("mapnav-button");return qt(),Dn(u,{onClickFunction:n,tooltip:ri(e)("mapnav.geolocator")},{default:Rn(()=>[q5r]),_:1},8,["tooltip"])}}}),X5r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),Ot("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),J5r=Xr({__name:"home-nav",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{const n=t.geo.map.getExtentSet();t.geo.map.zoomMapTo(n.fullExtent)};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("mapnav.home")},{default:Rn(()=>[X5r]),_:1},8,["tooltip"])}}}),K5r={class:"relative w-32 h-32 text-gray-600 hover:text-black",tabindex:"-1"},Z5r=["content","aria-label"],Q5r=Xr({__name:"button",props:{onClickFunction:{type:Function,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(i){return(e,t)=>{const r=Nn("focus-item"),n=Nn("tippy");return qt(),si("div",K5r,[Ur((qt(),si("button",{type:"button",class:"w-full h-full default-focus-style focus:outline-none",onClick:t[0]||(t[0]=s=>i.onClickFunction()),content:i.tooltip,"aria-label":typeof i.tooltip=="string"?i.tooltip:""},[Em(e.$slots,"default")],8,Z5r)),[[r],[n,{placement:"left"}]])])}}}),eFr={class:"relative",tabindex:"-1"},tFr=["content","aria-label"],iFr=Xr({__name:"button",props:{onClickFunction:{type:Function,required:!0},id:{type:String,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(i){const e=i,t=eo("iApi"),r=()=>t?.event.emit(ln.APPBAR_BUTTON_CLICK,e.id);return(n,s)=>{const o=Nn("focus-item"),a=Nn("tippy");return qt(),si("div",eFr,[Ur((qt(),si("button",{type:"button",class:"py-6 w-full h-full",onClick:s[0]||(s[0]=()=>{i.onClickFunction(),r()}),content:i.tooltip,"aria-label":String(i.tooltip)},[Em(n.$slots,"default",{},void 0,!0)],8,tFr)),[[o],[a,{placement:"right"}]])])}}}),rFr=ml(iFr,[["__scopeId","data-v-0af0697e"]]),yTe=xp("areas-of-interest",()=>({areas:vi([])})),pq=xp("export",()=>{const i=vi({title:!0,map:!0,mapElements:!0,legend:!0,footnote:!0,timestamp:!0}),e=vi("");function t(r){if(i.value[r.name]!==void 0){const n=i.value[r.name];i.value[r.name]=r.selected!==void 0?r.selected:!n}}return{componentSelectedState:i,fileName:e,toggleSelected:t}}),ure=xp("extentguard",()=>{const i=vi(!1);function e(l){i.value=l}const t=vi(!1);function r(l){t.value=l}const n=vi(!1);function s(l){n.value=l}const o=vi([]);function a(l){o.value=l}return{active:i,setActive:e,enforcing:t,setEnforcing:r,alwaysOn:n,setAlwaysOn:s,extentSetIds:o,setExtentSetIds:a}}),bP=function i(e){function t(n,s,o){var a,l={};if(Array.isArray(n))return n.concat(s);for(a in n)l[o?a.toLowerCase():a]=n[a];for(a in s){var u=o?a.toLowerCase():a,c=s[a];l[u]=u in l&&typeof c=="object"?t(l[u],c,u=="headers"):c}return l}function r(n,s,o,a,l){var u=typeof n!="string"?(s=n).url:n,c={config:s},h=t(e,s),p={};a=a||h.data,(h.transformRequest||[]).map(function(m){a=m(a,h.headers)||a}),h.auth&&(p.authorization=h.auth),a&&typeof a=="object"&&typeof a.append!="function"&&typeof a.text!="function"&&(a=JSON.stringify(a),p["content-type"]="application/json");try{p[h.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+h.xsrfCookieName+"=([^;]*)"))[2])}catch{}return h.baseURL&&(u=u.replace(/^(?!.*\/\/)\/?/,h.baseURL+"/")),h.params&&(u+=(~u.indexOf("?")?"&":"?")+(h.paramsSerializer?h.paramsSerializer(h.params):new URLSearchParams(h.params))),(h.fetch||fetch)(u,{method:(o||h.method||"get").toUpperCase(),body:a,headers:t(h.headers,p,!0),credentials:h.withCredentials?"include":l}).then(function(m){for(var v in m)typeof m[v]!="function"&&(c[v]=m[v]);return h.responseType=="stream"?(c.data=m.body,c):m[h.responseType||"text"]().then(function(w){c.data=w,c.data=JSON.parse(w)}).catch(Object).then(function(){return(h.validateStatus?h.validateStatus(m.status):m.ok)?c:Promise.reject(c)})})}return e=e||{},r.request=r,r.get=function(n,s){return r(n,s,"get")},r.delete=function(n,s){return r(n,s,"delete")},r.head=function(n,s){return r(n,s,"head")},r.options=function(n,s){return r(n,s,"options")},r.post=function(n,s,o){return r(n,o,"post",s)},r.put=function(n,s,o){return r(n,o,"put",s)},r.patch=function(n,s,o){return r(n,o,"patch",s)},r.all=Promise.all.bind(Promise),r.spread=function(n){return n.apply.bind(n,n)},r.CancelToken=typeof AbortController=="function"?AbortController:Object,r.defaults=e,r.create=i,r}(),nFr={A:10,B:12,C:11,E:13,G:24,H:24,J:24,K:35,L:35,M:35,N:35,P:35,R:46,S:47,T:48,V:59,X:[62,61],Y:60},cOe={en:{},fr:{}};class sFr{list={};listFetched=!1;constructor(e,t){bP.get(t).then(r=>{r.data.definitions.forEach(n=>cOe[e][n.code]=n.description),Object.keys(cOe[e]).forEach(n=>{this.list[n]=cOe[e][n]}),this.listFetched=!0})}fsaToProvinces(e){const t={};let r=nFr[e.substring(0,1).toUpperCase()];return typeof r=="number"&&(r=[r]),r.forEach(n=>{t[n]=this.list[n]}),t}}function oFr(i,e){return new sFr(i,e)}const ade={en:{ADDRESS:"Street Address",FSA:"Forward Sortation Area",NTS:"National Topographic System",COORD:"Latitude/Longitude",SCALE:"Scale"},fr:{ADDRESS:"Adresse Municipale",FSA:"Région De Tri D'Acheminement",NTS:"Système National De Référence Cartographique",COORD:"Latitude/Longitude",SCALE:"Échelle"}};class aFr{allTypes={};validTypes={};filterComplete=!1;typesFetched=!1;constructor(e,t){bP.get(t).then(r=>{r.data.definitions.forEach(n=>{ade[e][n.code]=n.term.split(`${n.code}-`)[1]}),Object.keys(ade[e]).forEach(n=>{this.allTypes[n]=ade[e][n],this.validTypes[n]=ade[e][n]}),this.typesFetched=!0})}filterValidTypes(e){if(this.filterComplete)return this.validTypes;if(e=typeof e=="string"?[e]:e,e&&e.length>0)for(const t of e)delete this.validTypes[t];return this.filterComplete=!0,this.validTypes}}function lFr(i,e){return new aFr(i,e)}function uFr(i,e){const t=/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)(\s*[,|;\s]\s*)[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)[*]$/,r=/^\d{2,3}[A-P]/,n=/^[ABCEGHJKLMNPRSTVXY]\d[A-Z]/;if(t.test(e)&&!i.disabledSearchTypes.includes("LAT/LNG")){const s=e.slice(0,-1);return new cFr(i,s)}else return n.test(e)&&!i.disabledSearchTypes.includes("FSA")?new hFr(i,e):r.test(e)&&!i.disabledSearchTypes.includes("NTS")?new dFr(i,e.substring(0,6).toUpperCase()):new pFr(i,e)}class vTe{config;query;failedServs=[];results=[];onComplete;latLongResult;featureResults=[];resultType="geoname";constructor(e,t){this.query=t,this.config=e}search(){return this.jsonRequest(this.getUrl()).then(e=>this.normalizeNameItems(e.items)).catch(()=>(console.error("Geoname service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}getUrl(e,t,r,n){let s="";return e?s=this.config.geoLocateUrl+"?q="+this.query:(r&&n?s=`${this.config.geoNameUrl}?lat=${r}&lon=${n}&num=${this.config.maxResults}`:s=`${this.config.geoNameUrl}?q=${this.query}&num=${this.config.maxResults}`,this.config.categories.length>0&&(s+=`&concise=${this.config.categories.join(",")}`),this.config.officialOnly&&(s+="&category=O")),s}normalizeNameItems(e){return e.filter(t=>this.config.types.validTypes[t.concise.code]).map(t=>({name:t.name,location:t.location,province:this.config.provinces.list[t.province.code],type:this.config.types.allTypes[t.concise.code],LatLon:{lat:t.latitude,lon:t.longitude},bbox:t.bbox,order:this.config.sortOrder.indexOf(t.concise.code)>=0?this.config.sortOrder.indexOf(t.concise.code):this.config.sortOrder.length}))}jsonRequest(e){return new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="json",n.onload=()=>{if(n.status===200){const s=typeof n.response=="string"?JSON.parse(n.response):n.response;t(s)}else r("Could not load results from remote service.")},n.send()})}locateByQuery(){return this.jsonRequest(this.getUrl(!0,void 0))}nameByLatLon(e,t,r){return this.jsonRequest(this.getUrl(!1,r,e,t)).then(n=>this.normalizeNameItems(n.items)).catch(()=>(console.error("LatLon service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}}class cFr extends vTe{constructor(e,t){super(e,t),this.resultType="latlong";const n=t.split(/[\s|,|;|]/).filter(a=>!isNaN(a)&&a!=="").map(a=>parseFloat(a)),s=.015,o=[n[1]-s,n[0]-s,n[1]+s,n[0]+s];this.latLongResult={name:`${n[0]},${n[1]}`,location:{latitude:n[0],longitude:n[1]},type:"Latitude/Longitude",position:[n[1],n[0]],bbox:o},this.onComplete=new Promise((a,l)=>{this.nameByLatLon(n[0],n[1]).then(u=>{u?(this.results=u,a(this)):l("Given lat lon coordinates cannot be found")})})}}class hFr extends vTe{constructor(e,t){t=t.substring(0,3).toUpperCase(),super(e,t),this.resultType="fsa",this.onComplete=new Promise(r=>{this.formatLocationResult().then(n=>{n?(this.featureResults.push(n),this.nameByLatLon(n.LatLon.lat,n.LatLon.lon,Object.keys(n._provinces).map(s=>parseInt(s))).then(s=>{this.results=s,r(this)})):(console.log("FSA code given cannot be found."),r(this))})})}formatLocationResult(){return this.locateByQuery().then(e=>{if(e.length===1&&this.query){const t=this.config.provinces.fsaToProvinces(this.query);return{fsa:this.query,code:"FSA",desc:this.config.types.allTypes.FSA,province:Object.keys(t).map(r=>t[r]).join(","),_provinces:t,LatLon:{lat:e[0].geometry.coordinates[1],lon:e[0].geometry.coordinates[0]}}}}).catch(()=>{console.error("FSA service failed"),this.failedServs.push("geolocation")})}}class dFr extends vTe{unitName;unit;mapSheets=[];constructor(e,t){super(e,t),this.resultType="nts",t=isNaN(parseInt(t[2]))?"0"+t:t,this.unitName=t,this.onComplete=new Promise(r=>{this.locateByQuery().then(n=>{if(n.length>0&&this.query){const s=this.locateToResult(n);this.unit=s[0],this.mapSheets=s,this.featureResults.push(this.unit),this.nameByLatLon(this.unit.LatLon.lat,this.unit.LatLon.lon).then(o=>{this.results=o,r(this)})}else console.log("Given NTS code not found"),r(this)}).catch(()=>{console.error("NTS service failed"),this.failedServs.push("geolocation"),r(this)})})}locateToResult(e){return e.map(r=>{const n=r.title.split(" ");return{nts:n.shift()||"",location:n.join(" "),code:"NTS",desc:this.config.types.allTypes.NTS,LatLon:{lat:r.geometry.coordinates[1],lon:r.geometry.coordinates[0]},bbox:r.bbox}})}equals(e){return this.unitName===e.unitName}}class pFr extends vTe{constructor(e,t){t=encodeURIComponent(t.trim()),super(e,t),this.resultType="address",this.onComplete=new Promise(r=>{this.locateByQuery().then(n=>{this.featureResults=this.locateToResult(n),this.search().then(s=>{this.results=s,r(this)})}).catch(()=>{this.failedServs.push("geolocation"),console.error("Address service failed"),this.search().then(n=>{this.results=n,r(this)})})})}locateToResult(e){return this.config.categories.length>0&&!this.config.categories.includes("ADDR")?[]:e.filter(r=>r.type?.includes("Street")).map(r=>{const[n,s,o]=r.title.split(", ");return{name:n,city:s.split(" Of ").pop(),province:o,desc:this.config.types.allTypes.ADDRESS,LatLon:{lat:r.geometry.coordinates[1],lon:r.geometry.coordinates[0]}}})}}const Vht="https://geogratis.gc.ca/services/geolocation/@{language}/locate",Hht="https://geogratis.gc.ca/services/geoname/@{language}/geonames.json",Wht="https://geogratis.gc.ca/services/geoname/@{language}/codes/province.json",qht="https://geogratis.gc.ca/services/geoname/@{language}/codes/concise.json",fFr={10:"NL",11:"PE",12:"NS",13:"NB",24:"QC",35:"ON",46:"MB",47:"SK",48:"AB",59:"BC",60:"YU",61:"NT",62:"NU",72:"UF",73:"IW"};class Yht{config;constructor(e,t){let r,n,s,o;const a=t?.serviceUrls;a?(r=a.geoLocation?a.geoLocation:Vht,n=a.geoNames?a.geoNames:Hht,s=a.geoProvince?a.geoProvince:Wht,o=a.geoTypes?a.geoTypes:qht):(r=Vht,n=Hht,s=Wht,o=qht),r=r.replace("@{language}",e),n=n.replace("@{language}",e),s=s.replace("@{language}",e),o=o.replace("@{language}",e);const l=t?.settings;let u,c,h,p,m;l?(u=l.categories?l.categories:[],c=l.sortOrder?l.sortOrder:[],h=l.disabledSearchTypes?l.disabledSearchTypes:[],p=l.maxResults>0?l.maxResults:100,m=!!l.officialOnly):(u=[],c=[],h=[],p=100,m=!1),this.config={language:e,geoNameUrl:n,geoLocateUrl:r,types:lFr(e,o),provinces:oFr(e,s),categories:u,sortOrder:c,disabledSearchTypes:h,maxResults:p,officialOnly:m},this.config.types.filterValidTypes(t?.excludeTypes),this._provinceList=[],this._typeList=[],this._excludedTypes=t?.excludeTypes||[]}get provinceList(){return this._provinceList}get typeList(){return this._typeList}set provinceList(e){this._provinceList=e}set typeList(e){this._typeList=e}levenshteinDistance(e,t){t=t.toLowerCase().trim();const r=decodeURI(e.query.toLowerCase().replace("*","")),n=[];for(let s=0;s<=t.length;s++){n[s]=[s];for(let o=1;o<=r.length;o++)n[s][o]=s===0?o:Math.min(n[s][o-1]+1,n[s-1][o]+.2,n[s-1][o-1]+(r[o-1]===t[s-1]?0:1))}return n[t.length][r.length]}findProvinceObj(e){return this.provinceList.find(t=>t.name===e)}query(e){return uFr(this.config,e.toUpperCase()).onComplete.then(t=>{let r=[];t.featureResults.length>0?t.resultType==="fsa"?r=t.featureResults.map(s=>({name:s.fsa,bbox:[s.LatLon.lon+.02,s.LatLon.lat-.02,s.LatLon.lon-.02,s.LatLon.lat+.02],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:-1})):t.resultType==="nts"?r=t.featureResults.map(s=>({name:s.nts,bbox:s.bbox??[s.LatLon.lon+.02,s.LatLon.lat-.02,s.LatLon.lon-.02,s.LatLon.lat+.02],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.location,latitude:s.LatLon.lat,longitude:s.LatLon.lon},order:-1})):t.resultType==="address"&&(r=t.featureResults.map(s=>({name:s.name,bbox:[s.LatLon.lon+.002,s.LatLon.lat-.002,s.LatLon.lon-.002,s.LatLon.lat+.002],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.city,latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:this.config.sortOrder.indexOf("ADDR")>=0?this.config.sortOrder.indexOf("ADDR"):this.config.sortOrder.length})),this.config.sortOrder.length>0&&(r=r.sort((s,o)=>this.levenshteinDistance(t,s.name)>this.levenshteinDistance(t,o.name)?1:-1))):t.resultType==="latlong"&&(r=[t.latLongResult],r[0].order=-1);const n=t.results.map(s=>({name:s.name,bbox:s.bbox,type:s.type,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.location,latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:s.order}));return{results:r.concat(n).slice(0,this.config.maxResults).sort((s,o)=>this.config.sortOrder.length>0?s.order>o.order?1:-1:this.levenshteinDistance(t,s.name)>this.levenshteinDistance(t,o.name)?1:-1),failedServs:t.failedServs}})}fetchProvinces(){return new Promise(e=>{const t=setInterval(()=>{if(this.config.provinces.listFetched){clearInterval(t);const r=[],n={code:-1,abbr:"...",name:"..."};r.push(n);const s=this.config.provinces.list;for(const o in s)r.push({code:o,abbr:fFr[o],name:s[o]});this.provinceList=r,e(this.provinceList)}})})}fetchTypes(){return new Promise(e=>{const t=setInterval(()=>{if(this.config.types.typesFetched){clearInterval(t);const r=[],n={code:-1,name:"..."};r.push(n);const s=this.config.types.allTypes;for(const o in s)this._excludedTypes.includes(o)||r.push({code:o,name:s[o]});this.typeList=r,e(this.typeList)}},250)})}}function Xht(i,e,t){return i&&e.extent&&(t=t.filter(r=>r.bbox[0]<=e.extent.xmax&&r.bbox[1]<=e.extent.ymax&&r.bbox[2]>=e.extent.xmin&&r.bbox[3]>=e.extent.ymin)),e.province&&e.province!=="..."&&(t=t.filter(r=>r.location.province?.name&&r.location.province.name===e.province)),e.type&&e.type!=="..."&&(t=t.filter(r=>r.type===e.type)),t}const SB=xp("geosearch",()=>{const i=vi(new Yht("en",void 0)),e=vi({type:"",province:"",extent:void 0}),t=vi(!1),r=vi(""),n=vi(""),s=vi(""),o=vi([]),a=vi([]),l=vi(!1),u=vi([]),c=Hr(()=>new Promise(L=>{i.value.fetchProvinces().then(k=>{k.sort((B,$)=>B.name>$.name?1:-1),L(k)})})),h=Hr(()=>new Promise(L=>{i.value.fetchTypes().then(k=>{k.sort((B,$)=>B.name>$.name?1:-1),L(k)})}));function p(L,k){i.value=new Yht(L,k)}function m(L){l.value=!0;const k=r.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim();if(!k)o.value=[],a.value=[],l.value=!1;else if(k&&k!==s.value||L){const B=setInterval(()=>{i.value.config.provinces.listFetched&&i.value.config.types.typesFetched&&(clearInterval(B),i.value.query(`${k}*`).then($=>{u.value=$.failedServs,s.value=k,a.value=$.results;const V=Xht(t.value,e.value,a.value);o.value=V||[],l.value=!1}))},250)}else{const B=Xht(t.value,e.value,a.value);o.value=B||[],l.value=!1}}function v(L){e.value.province=typeof L.province>"u"?"":L.province,m(L.forceReRun)}function w(L){e.value.type=typeof L.type>"u"?"":L.type,m(L.forceReRun)}function S(L){s.value=r.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim(),r.value=L,m()}function I(L){const k={a:"àáâãäåāăąǎȁȃȧạảấầẩẫậắằẳẵặ",b:"ḃɓḅḇ",c:"çćĉċč",d:"ďḋḍḏḑḓ",e:"èéêëēĕėęěȅȇẹẻẽếềểễệ",f:"ƒḟ",g:"ĝğġģǧǵḡ",h:"ĥȟḣḥḧḩḫẖ",i:"ìíîïĩīĭįıȉȋịỉĩ",j:"ĵǰɉ",k:"ķĸƙḳḵ",l:"ĺļľŀłḷḹḻḽ",m:"ḿṁṃ",n:"ñńņňʼnŋǹṅṇṉṋ",o:"òóôõöōŏőơǒǫǭȍȏȯọỏốồổỗộớờởỡợ",p:"ṕṗ",r:"ŕŗřȑȓṛṝṟ",s:"śŝşšșṡṣṥṧṩ",t:"ţťŧțṫṭṯṱẗ",u:"ùúûüũūŭůűųưǔǖǘǚǜȕȗụủứừửữự",v:"ṽṿ",w:"ẁẃŵẅẇẉẋ",x:"ẋẍ",y:"ỳýŷÿỹȳẏẙỵỷỹ",z:"źżžẑẓẕ"};L=L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),n.value=Array.from(L).map(B=>Object.keys(k).includes(B)?"["+B+k[B]+"]":B.replace(/["$!*+?^{}()|[\]\\]/g,"").replace(/[.\\]/g,"\\$&").trim()).join("")}function R(L){if(L.visible!==void 0&&(t.value=L.visible),L.extent.sr.wkid!==4326)throw new Error("an extent that was not projected to wkid 4326 was passed to the geosearch store");e.value.extent=L.extent,m()}return{GSservice:i,queryParams:e,resultsVisible:t,searchVal:r,searchRegex:n,lastSearchVal:s,searchResults:o,savedResults:a,loadingResults:l,failedServices:u,getProvinces:c,getTypes:h,initService:p,runQuery:m,setProvince:v,setType:w,setSearchTerm:S,setSearchRegex:I,setMapExtent:R}}),_Te=xp("help",()=>({location:vi("./help/")}));var WO=(i=>(i.Visibility="visibilityButton",i.Expand="expandButton",i))(WO||{}),sp=(i=>(i.Item="item",i.Placeholder="placeholder",i.Error="error",i))(sp||{});class bTe extends tf{_uid;_name;_type;_children=[];_parent=void 0;_loadPromise;_hidden;_expanded;_visibility;_exclusive;_controls;_disabledControls;_lastVisible;_visibleChildren;constructor(e,t,r){super(e),this._uid=sH.sharedUtils.generateUUID(),this._name=t.name,this._type=t.type??"placeholder",this._parent=r,this._children=[],this._loadPromise=new Af,this._hidden=t.hidden??!1,this._expanded=t.expanded??!0,this._visibility=!0,this._exclusive=t.exclusive??!1,this._controls=t.controls?.slice()??["visibilityButton","expandButton"],this._disabledControls=t.disabledControls?.slice(),this._lastVisible,this._visibleChildren=[]}get uid(){return this._uid}get name(){return this._name}set name(e){this._name=e}get type(){return this._type}get children(){return this._children}set children(e){this._children=e}get parent(){return this._parent}set parent(e){this._parent=e}get loadPromise(){return this._loadPromise.getPromise()}get hidden(){return this._hidden}get expanded(){return this._expanded}get visibility(){return this._visibility}get exclusive(){return this._exclusive}controlAvailable(e){return this._disabledControls?.includes(e)?!1:this._controls?.includes(e)}setControl(e,t){t&&this._disabledControls?.includes(e)?(this._disabledControls=this._disabledControls.filter(r=>r!==e),this._controls?.push(e)):!t&&this._controls?.includes(e)&&(this._controls=this._controls.filter(r=>r!==e),this._disabledControls?.push(e))}toggleHidden(e){this._hidden=e??!this.hidden}toggleExpanded(e){this._expanded=e??!this.expanded}toggleVisibility(e,t=!0){if(this.visibility!==e){if(this._visibility=e??!this.visibility,!this.exclusive)this.visibility?this._visibleChildren.length>0?this._visibleChildren.forEach(r=>r.toggleVisibility(!0,!1)):this.children.forEach(r=>r.toggleVisibility(!0,!1)):this.children.forEach(r=>r.toggleVisibility(!1,!1));else if(this.visibility)if(this._lastVisible&&(!(this._lastVisible instanceof ou)||this._lastVisible.layerControlAvailable(ya.Visibility)))this._lastVisible.toggleVisibility(!0);else{const r=this.children.find(n=>!(n instanceof ou)||n.layerControlAvailable(ya.Visibility));r&&r.toggleVisibility(!0)}else this._lastVisible=this.children.find(r=>r.visibility),this._lastVisible?.toggleVisibility(!1);this.parent&&t&&this.parent.checkVisibility(this)}}checkVisibilityRules(){this.parent&&!this.parent.visibility?this.toggleVisibility(!1,!1):this.parent?.exclusive&&this.parent.children.some(t=>t.visibility&&t!==this&&t.type==="item")&&this.toggleVisibility(!1,!1)}checkVisibility(e){this instanceof ou&&!this.layerControlAvailable(ya.Visibility)||(this.exclusive?e.visibility?(this.children.forEach(t=>{t.uid!==e.uid&&t.toggleVisibility(!1,!1)}),this._lastVisible=e,this._visibility=!0,this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1),this._lastVisible=e):this.children.some(t=>t.visibility)?(this._visibility=!0,this._visibleChildren=this.children.filter(t=>t.visibility),this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this._visibleChildren=[],this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1)),this.parent&&this.parent.checkVisibility(this))}getConfig(){const e={name:this._name,hidden:this._hidden,expanded:this._expanded,exclusive:this._exclusive,controls:this._controls,disabledControls:this._disabledControls},t=[];return this.children.forEach(r=>{t.push(r.getConfig())}),this.exclusive?e.exclusiveVisibility=t:e.children=t,e}onAdded(){}onRemoved(){this.toggleVisibility(!1)}load(){this._type="item",this._loadPromise.resolveMe(),this.checkVisibilityRules()}reload(){this._type="placeholder",this._loadPromise=new Af}error(){this._type="error",this._loadPromise.rejectMe(),this.checkVisibilityRules()}}class ou extends bTe{_layerId;_layerIdx;_layerUid="";_layer;_layerInitVis;_layerRedrawing=!1;_layerOffscale=!1;_loadCancelled=!1;_treeGrown=!1;_customSymbology=!1;_coverIcon;_description;_symbologyExpanded;_origLayerControls;_origLayerDisabledControls;_layerControls;_layerDisabledControls;_symbologyRenderStyle;_symbologyStack;handlers=[];constructor(e,t,r){super(e,t,r),this._type=sp.Placeholder,this._layerId=t.layerId,this._layerIdx=t.sublayerIndex,this._layerControls=t.layerControls??[],this._origLayerControls=t.layerControls,this._layerDisabledControls=t.disabledLayerControls??[],this._origLayerDisabledControls=t.disabledLayerControls,this._layerRedrawing=!1,this._symbologyExpanded=t.symbologyExpanded||!1,t.coverIcon&&(this._coverIcon=t.coverIcon),t.description&&(this._description=t.description),this._symbologyRenderStyle=t.symbologyRenderStyle??"icons",this._customSymbology=!!t.symbologyStack,this._symbologyStack=t.symbologyStack?.map(n=>({uid:this.$iApi.geo.shared.generateUUID(),label:n.text,definitionClause:n.sqlQuery,imgUrl:n.image??"",drawPromise:Promise.resolve(),visibility:!0,lastVisibility:!0}))}get parentLayerId(){return this._layerIdx?this._layerId.slice(0,this._layerId.length-`-${this._layerIdx}`.length):void 0}get layerId(){return this._layerId}get layerIdx(){return this._layerIdx}get layerUid(){return this._layerUid}get layer(){return this._layer}set layer(e){this._layer=e,this._layerId=e.id,this._layerIdx=e.layerIdx,this._layerUid=e.uid,this._name=this._name||e.name,this._symbologyStack=this._customSymbology?this._symbologyStack:e.legend,this.updateLayerControls()}get layerOffscale(){return this._layerOffscale}set layerOffscale(e){this._layerOffscale=e}get layerRedrawing(){return this._layerRedrawing}set layerRedrawing(e){this._layerRedrawing=e}get coverIcon(){return this._coverIcon}set coverIcon(e){this._coverIcon=e}get description(){return this._description}set description(e){this._description=e}get symbologyExpanded(){return this._symbologyExpanded}get treeGrown(){return this._treeGrown}set treeGrown(e){this._treeGrown=e}get loadCancelled(){return this._loadCancelled}set loadCancelled(e){this._loadCancelled=e}get origLayerControls(){return this._origLayerControls}get origDisabledLayerControls(){return this._origLayerDisabledControls}set symbologyRenderStyle(e){this._symbologyRenderStyle=e}get symbologyRenderStyle(){return this._symbologyRenderStyle}set symbologyStack(e){this._symbologyStack=e}get symbologyStack(){return this._symbologyStack}getConfig(){const e={layerId:this._layerId,sublayerIndex:this._layerIdx,layerControls:this._layerControls,disabledLayerControls:this._layerDisabledControls,symbologyExpanded:this._symbologyExpanded,coverIcon:this._coverIcon,description:this._description};return{...super.getConfig(),...e}}toggleVisibility(e,t=!0,r=!1){if(!((!this.layerControlAvailable(ya.Visibility)||this._loadCancelled)&&!r)&&(super.toggleVisibility(e,t),this.layer&&this.layer.layerExists)){this.layer.visibility=this.visibility;const n=this._symbologyStack.some(s=>s.lastVisbility);this._symbologyStack.forEach(s=>{n||(s.lastVisbility=!0),s.visibility=this.visibility?s.lastVisbility:!1})}}toggleSymbology(e){return this._symbologyExpanded=e??!this._symbologyExpanded,this._symbologyExpanded}setSymbologyVisibility(e,t){this._symbologyStack.some(r=>((e===void 0||r.uid===e)&&(r.visibility=t,r.lastVisbility=t),e!==void 0&&r.uid===e))}load(e){if(e){if(this._layer=e instanceof Rse?e:this.$iApi.geo.layer.getLayer(this._layerId??this._layerUid),this.layer=e,this._layerRedrawing=e.mapLayer&&e.drawState!==fb.UP_TO_DATE,this._loadCancelled){this.toggleVisibility(!1,!0,!0);return}this._layer?.loadPromise().then(()=>{this._layer?.layerType===pn.MAPIMAGE&&!this._layerIdx?(this.error(),console.error(`MapImageLayer has no sublayerIndex defined for layer: ${this._layerId}.`)):(this._layerInitVis=typeof this._layerInitVis<"u"?this._visibility:e.visibility,super.load(),this.toggleVisibility(this._layerInitVis,!0,!0),e.visibility||this.setSymbologyVisibility(void 0,!1)),this.handlers.push(this.$iApi.event.on(ln.LAYER_VISIBILITYCHANGE,t=>{t.layer.uid===this.layer.uid&&this._type===sp.Item&&this.toggleVisibility(t.visibility,!0,!0)})),this.handlers.push(this.$iApi.event.on(ln.LAYER_DRAWSTATECHANGE,t=>{this.layer.uid===t.layer.uid&&(t.layer.drawState===fb.REFRESH?this.layerRedrawing=!0:setTimeout(()=>{this.layerRedrawing=t.layer.drawState===fb.REFRESH},500))})),this._layerOffscale=this.$iApi.geo.map.created?this.layer?.isOffscale():!1,this.handlers.push(this.$iApi.event.on(ln.MAP_SCALECHANGE,()=>{this.$iApi.geo.map.created&&(this._layerOffscale=this.layer?.isOffscale())}))}).catch(()=>{this.error()})}}error(){this.updateLayerControls(),super.error(),this.toggleVisibility(!1,!0,!0)}layerControlAvailable(e){return this._layerDisabledControls?.includes(e)?!1:!!this._layerControls?.includes(e)}updateLayerControls(){const e=this.$iApi.geo.layer.getLayerControls(this.layerId)??this.$iApi.geo.layer.getLayerControls(this.parentLayerId??"");this._origLayerControls||(this._layerControls=e?.controls??[]),this._origLayerDisabledControls||(this._layerDisabledControls=e?.disabledControls??[])}}var fU=(i=>(i.Title="title",i.Text="text",i.Image="image",i.Markdown="markdown",i.Template="template",i))(fU||{});class H_e extends bTe{_infoType;_content;constructor(e,t,r){super(e,t,r),this._infoType=t.infoType??"title",this._content=t.content??"",t.infoType==="template"&&this.$element.component(`${this._uid}-info-section`,{template:this._content}),(t.infoType||t.content)&&(this._controls=t.controls?.slice()??[WO.Expand]),super.load()}get infoType(){return this._infoType}get content(){return this._content}set content(e){this._content=e}getConfig(){const e={infoType:this._infoType,content:this._content};return{...super.getConfig(),...e}}}const U5=xp("legend",()=>{const i=vi(),e=vi([]),t=vi([]);function r(o){if(o.parent===void 0)e.value.push(o.item);else{if(!(o.item instanceof H_e)&&!(o.item instanceof ou)){console.error("attempted to add an unsupported legend item type");return}o.parent.children.push(o.item)}}function n(o){const a=l=>(l=l.filter(u=>(u===o&&!u.children.length&&u.onRemoved(),u!==o)),l.forEach(u=>{u.children=a(u.children)}),l=l.filter(u=>!(u instanceof H_e&&!u.children.length&&u.content==="")),l);e.value=a(e.value)}function s(o){if(o.oldItem.parent===void 0){const a=e.value,l=a.indexOf(o.oldItem);l>-1&&(e.value[l]=o.newItem),e.value=a}else{const a=o.oldItem.parent.children,l=a.indexOf(o.oldItem);l>-1&&(a[l]=o.newItem),o.oldItem.parent.children=a}}return{legendConfig:i,children:e,headerControls:t,addItem:r,removeItem:n,replaceItem:s}}),oL=xp("mapnav",()=>{const i=vi({}),e=vi([]);function t(r){r in i.value&&delete i.value[r];const n=e.value.indexOf(r);n!==-1&&e.value.splice(n,1)}return{items:i,order:e,removeItem:t}}),IYe=xp("metadata",()=>{const i=vi(""),e=vi({type:"LineString",coordinates:[]});return{status:i,response:e}}),wTe=xp("northarrow",()=>{const i=vi(""),e=vi("");return{arrowIcon:i,poleIcon:e}}),ale=xp("overviewmap",()=>{const i=vi({lodSets:[],extentSets:[],basemaps:[],tileSchemas:[],initialBasemapId:""}),e=vi({}),t=vi(!0),r=vi(1.5),n=vi("#FF0000"),s=vi(1),o=vi("#000000"),a=vi(.25);function l(u){i.value.initialBasemapId=u}return{mapConfig:i,basemaps:e,startMinimized:t,expandFactor:r,borderColour:n,borderWidth:s,areaColour:o,areaOpacity:a,updateInitialBasemap:l}}),Pse=xp("scrollguard",()=>{const i=vi(!1);function e(t){i.value=t}return{enabled:i,setEnabled:e}});var ap=(i=>(i[i.UPLOAD=0]="UPLOAD",i[i.FORMAT=1]="FORMAT",i[i.CONFIGURE=2]="CONFIGURE",i))(ap||{});const AYe=xp("wizard",()=>{const i={id:"Placeholder",layerType:pn.UNKNOWN,url:""},e=vi(),t=vi(""),r=vi(""),n=vi(!0),s=vi(null),o=vi({config:i,configOptions:[]}),a=vi(ap.UPLOAD);function l(u){switch(a.value){case ap.UPLOAD:u===ap.UPLOAD?t.value="":u===ap.FORMAT&&(a.value=ap.FORMAT);break;case ap.FORMAT:u===ap.UPLOAD?(s.value&&(t.value="",s.value=null),r.value="",a.value=ap.UPLOAD):u===ap.CONFIGURE&&(a.value=ap.CONFIGURE);break;case ap.CONFIGURE:u===ap.UPLOAD?(t.value="",r.value="",s.value=null,n.value=!0,o.value={config:i,configOptions:[]},a.value=ap.UPLOAD):u===ap.FORMAT&&(o.value={config:i,configOptions:[]},n.value=!0,a.value=ap.FORMAT);break}}return{layerSource:e,url:t,typeSelection:r,nested:n,fileData:s,layerInfo:o,currStep:a,goToStep:l}});class mFr{fixture;panel;event;geo;notify;ui;startRequired=!1;$vApp;$element;$i18n;_isFullscreen;constructor(e,t,r){this.event=new AIr(this);const n=gFr(e,this);this.$vApp=n.app,this.$element=n.element,this.$i18n=n.i18n,this.fixture=new qLr(this),this.panel=new YLr(this),this.geo=new HLr(this),this.ui={maptip:this.geo.map.maptip,exposeOids:!1,exposeMeasurements:!0,getZoomIcon:()=>"",formatNumber:()=>"",scrollToInstance:!1,suppressNumberLocalization:!1,escapeHtml:()=>"",isPlainText:()=>!0},this.notify=new xOr(this),this._isFullscreen=UE.isEnabled&&!!this.$vApp.$root&&UE.isFullscreen&&UE.element===this.$vApp.$root.$el,UE.isEnabled&&UE.onchange(()=>{this._isFullscreen=UE.isEnabled&&!!this.$vApp.$root&&UE.isFullscreen&&UE.element===this.$vApp.$root.$el}),this.initialize(t,r)}initialize(e,t){const r=bm(this.$vApp.$pinia),n=w0(this.$vApp.$pinia),s=S_e(this.$vApp.$pinia);if(e?.configs!==void 0){const a=e.configs,l=a[this.$i18n.locale.value]??a[Object.keys(a)[0]];r.newConfig(l),r.registerConfig({config:l,configLangs:Object.keys(a),allLangs:Object.keys(this.$i18n.messages.value)});for(const m in a)r.registerConfig({config:a[m],configLangs:[m]});r.activeBasemapConfig=l.map.basemaps.find(m=>m.id===l.map.initialBasemapId);const u=setInterval(()=>{const m=this.$vApp.$el.querySelector("#esriMap");if(m&&(clearInterval(u),this.geo.map.createMap(l.map,m),m._tippy.hide(0),s.setMaptipInstance(m._tippy),l.layers&&l.layers.length>0)){let v=0;l.layers.forEach(w=>{const S=this.geo.layer.createLayer(w);this.geo.map.addLayer(S,v),S.mapLayer&&v++})}},100);if(l.panels){if(l.panels.open&&l.panels.open.length>0){const m=l.panels.open.map(v=>v.id);this.panel.isRegistered(m).then(()=>{l.panels?.open?.forEach(v=>{this.panel.open({id:v.id,screen:v.screen}),v.pin&&this.panel.pin(v.id)})})}n.reorderable=l.panels.reorderable??!0}!l.system?.animate&&this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.remove("animation-enabled"),l.system?.proxyUrl&&(this.geo.proxy=l.system.proxyUrl),l.system?.exposeOid&&(this.ui.exposeOids=l.system.exposeOid),l.system?.exposeMeasurements!=null&&(this.ui.exposeMeasurements=l.system.exposeMeasurements),l.system?.scrollToInstance&&(this.ui.scrollToInstance=l.system?.scrollToInstance),l.system?.suppressNumberLocalization&&(this.ui.suppressNumberLocalization=l.system?.suppressNumberLocalization);const c={magnify:'',globe:''},h=l.system?.zoomIcon||"globe",p=c[h]||h;this.ui.getZoomIcon=()=>p,this.ui.formatNumber=m=>this.ui.suppressNumberLocalization?m.toString():this.$i18n.n(m,"number"),this.ui.escapeHtml=m=>{const v={"<":"<",">":">",'"':""","'":"'"};return m.replace(/[<>"']/g,w=>v[w])},this.ui.isPlainText=m=>typeof m=="string"?!this.containsValidHtml(m)&&!this.representsObject(m):!1}t||(t={});const o=dU(this.$vApp.$pinia);t?.startRequired?(this.startRequired=!0,o.started=!1):(this.startRequired=!1,o.started=!0,this.event.emit(ln.MAP_START)),(t.loadDefaultFixtures!==!1||e?.startingFixtures!==void 0)&&this.fixture.addDefaultFixtures(e?.startingFixtures),t.loadDefaultEvents!==!1&&this.event.addDefaultEvents()}reload(e,t){const r=dU(this.$vApp.$pinia),n=w3(this.$vApp.$pinia),s=bm(this.$vApp.$pinia),o=oA(this.$vApp.$pinia),a=H1(this.$vApp.$pinia),l=bB(this.$vApp.$pinia);Object.keys(o.items).forEach(h=>{this.fixture.exists(h)&&this.fixture.remove(h)}),Object.keys(l.grids).forEach(h=>{l.removeGrid(h)}),r.started=!1,this.geo.map.destroyMap(),a.$reset(),this.event.offAll(),e===void 0&&(e=JSON.parse(JSON.stringify({startingFixtures:s.startingFixtures,configs:s.registeredConfigs}))),n.clearAll(),this.geo.map.maptip.clear(),this.initialize(e,t)}component(e,t){if(t){const r=this.$element.component(e,t);return this.event.emit(ln.COMPONENT,e),r}return this.$element.component(e)}get screenSize(){if(!this.$vApp?.$root||!this.$vApp.$root.$refs["app-size"])return null;const e=this.$vApp.$root.$refs["app-size"].classList;return e.contains("lg")?"lg":e.contains("md")?"md":e.contains("sm")?"sm":"xs"}getConfig(){const e=bm(this.$vApp.$pinia);return JSON.parse(JSON.stringify(e.getActiveConfig(this.language)))}useStore(e){if(!(["appbar","areas-of-interest","details","export","extentguard","geosearch","grid","help","legend","mapnav","metadata","northarrow","overviewmap","scrollguard","wizard"].includes(e)&&!this.fixture.exists(e)))switch(e){case"appbar":return dy(this.$vApp.$pinia);case"areas-of-interest":return yTe(this.$vApp.$pinia);case"details":return tL(this.$vApp.$pinia);case"export":return pq(this.$vApp.$pinia);case"extentguard":return ure(this.$vApp.$pinia);case"geosearch":return SB(this.$vApp.$pinia);case"grid":return bB(this.$vApp.$pinia);case"help":return _Te(this.$vApp.$pinia);case"legend":return U5(this.$vApp.$pinia);case"mapnav":return oL(this.$vApp.$pinia);case"metadata":return IYe(this.$vApp.$pinia);case"northarrow":return wTe(this.$vApp.$pinia);case"overviewmap":return ale(this.$vApp.$pinia);case"scrollguard":return Pse(this.$vApp.$pinia);case"wizard":return AYe(this.$vApp.$pinia);case"config":return bm(this.$vApp.$pinia);case"fixture":return oA(this.$vApp.$pinia);case"instance":return dU(this.$vApp.$pinia);case"layer":return H1(this.$vApp.$pinia);case"map-caption":return oF(this.$vApp.$pinia);case"maptip":return S_e(this.$vApp.$pinia);case"notification":return w3(this.$vApp.$pinia);case"panel":return w0(this.$vApp.$pinia);default:console.error(`The store ${e} does not exist.`);return}}setLanguage(e){if(this.$i18n.locale.value===e)return;const r=bm(this.$vApp.$pinia).registeredLangs;if(r[e]===r[this.$i18n.locale.value]){this.$i18n.locale.value=e;return}this.$i18n.locale.value=e;const n=this.getConfig();this.event.emit(ln.CONFIG_CHANGE,n),this.reload()}get language(){return this.$vApp.$i18n.locale}get animate(){return!!(this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.contains("animation-enabled"))}toggleFullscreen(){UE.isEnabled&&UE.toggle(this.$element._container||void 0)}get isFullscreen(){return this._isFullscreen}get started(){return dU(this.$vApp.$pinia).started}updateAlert(e){const t=this.$vApp.$el.querySelector(".screen-reader-alert");t.childNodes.length>0&&(t.innerHTML="");const r=document.createElement("span");r.setAttribute("role","alert");const n=document.createTextNode(e);r.appendChild(n),t.insertBefore(r,null)}scrollToInstance(){this.ui.scrollToInstance&&this.$element._container?.scrollIntoView({behavior:"smooth"})}start(){const e=dU(this.$vApp.$pinia);!e.started&&this.startRequired?(this.event.emit(ln.MAP_START),e.started=!0):e.started&&console.warn("start has already been called")}containsValidHtml(e){return/<(\w+)([^>]*)>(.*?)<\/\1>/.test(e)}representsObject(e){return/^(?:\[\s*(?:[\s\S]*?)\s*\]|\{\s*(?:[\s\S]*?)\s*\})$/.test(e)}}function gFr(i,e){const t=bIr();t.use(({store:o})=>{const a=Qct(o.$state);o.$reset=()=>o.$patch(Qct(a))});const r=M3r(),n=YW(jDr).use(r).use(kDr,{directive:"tippy",component:"tippy"}).use(t);n.directive("focus-container",YDr),n.directive("focus-list",zDr),n.directive("focus-item",HDr),n.directive("truncate",D4r),n.component("panel-screen",U4r),n.component("pin",Y4r),n.component("close",Q4r),n.component("back",n5r),n.component("expand",v5r),n.component("panel-options-menu",N5r),n.component("dropdown-menu",cYe),n.component("minimize",S5r),n.component("right",A5r),n.component("left",D5r),n.component("fullscreen-nav-button",W5r),n.component("geolocator-nav-button",Y5r),n.component("home-nav-button",J5r),n.component("mapnav-button",Q5r),n.component("appbar-button",rFr),n.component("transition",eL),n.component("transition-group",XSe),n.config.globalProperties.$iApi=e,n.config.globalProperties.$pinia=t,n.provide("iApi",e);const s=n.mount(i);return{element:n,app:s,i18n:r.global}}class A6t{esriBasemap;config;constructor(e){this.config=e,this.esriBasemap=new kV({baseLayers:e.layers.map(t=>{if(t.layerType===pn.TILE)return new KHe({url:t.url,opacity:t.opacity});if(t.layerType===pn.MAPIMAGE)return new qHe({url:t.url,opacity:t.opacity});if(t.layerType===pn.OSM)return new XHe({opacity:t.opacity});throw new Error(`Unsupported layer type provided to basemap config: ${t.layerType}`)}),title:e.name||"",id:e.id})}get tileSchemaId(){return this.config.tileSchemaId}get id(){return this.config.id}get name(){return this.config.name}set name(e){this.config.name=e||""}get description(){return this.config.description}set description(e){this.config.description=e||""}get altText(){return this.config.altText}set altText(e){this.config.altText=e||""}get attribution(){return this.config.attribution}set attribution(e){this.config.attribution=e}get backgroundColour(){return this.config.backgroundColour??"#FFFFFF"}}class M6t extends tf{esriMap;_basemapStore;created=!1;trackFirstBasemap=!1;esriView;_viewPromise;get viewPromise(){return this._viewPromise.getPromise()}_rampSR;_rampExtentSet;_targetDiv;handlers;pointZoomScale;constructor(e){super(e),this.esriMap=void 0,this._basemapStore=[],this._viewPromise=new Af,this.handlers=[],this.pointZoomScale=5e4}noMapErr(){console.error("Attempted to manipulate the map before calling createMap()")}abstractError(){throw new Error("Attempted to call an abstract method in the parent CommonMapAPI")}labelsDefault={visible:void 0};createMap(e,t){this._basemapStore=e.basemaps.map(n=>{const s=new A6t(n);return s.esriBasemap.baseLayers.forEach(o=>{o.watch("loadStatus",()=>{o.loadStatus==="loaded"?this.trackFirstBasemap=!1:o.loadStatus==="failed"&&(this.$iApi.notify.show(K1.ERROR,this.$iApi.$i18n.t("layer.error",{id:s.name})),this.trackFirstBasemap&&this.recoverBasemap(s.tileSchemaId))})}),s}),e.labelsDefault&&(this.labelsDefault.visible=e.labelsDefault.visible);const r={};this.esriMap=Da(new ZDt(r)),this.pointZoomScale=e.pointZoomScale&&e.pointZoomScale>0?e.pointZoomScale:5e4,this._targetDiv=t,this.createMapView(e.initialBasemapId)}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMapView(),this.esriMap.destroy(),delete this.esriMap,this._basemapStore.forEach(e=>e.esriBasemap.destroy()),this._basemapStore=[]}reloadMap(e,t){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMap(),this.createMap(e,t)}createMapView(e){this.abstractError()}destroyMapView(){if(!this.esriView){this.noMapErr();return}this._viewPromise=new Af,this.created=!1,this.handlers.forEach(e=>e.handler.remove()),this.handlers=[],this.esriView.map=null,this.esriView.container=null,this.esriView.spatialReference=null,this.esriView.extent=null,this.esriView.navigation=null,this.esriView.destroy(),delete this.esriView}findBasemap(e){const t=this._basemapStore.find(r=>r.id===e);if(t)return t;throw new Error(`Invalid basemap id requested: ${e}`)}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const t=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(t.esriBasemap)}setBasemap(e){return this.abstractError(),!1}recoverBasemap(e){}getCurrentBasemapId(){if(this.esriMap)return this.esriMap.basemap.id;this.noMapErr()}geomToMapSR(e){if(!this._rampSR)throw new Error("call to map.geomToMapSR before the map spatial ref was created");return this._rampSR.isEqual(e.sr)?Promise.resolve(e):this.$iApi.geo.proj.projectGeometry(this._rampSR,e)}async zoomMapTo(e,t,r=!0,n=200,s="ease"){if(this.esriView){if(e.invalid())throw new Error("attempt to zoom to invalid geometry");const o=await this.geomToMapSR(e),a={target:this.$iApi.geo.geom.geomRampToEsri(o)};o.type===cl.POINT&&(a.scale=t||this.pointZoomScale);const l={animate:r,duration:n,easing:s};return this.viewPromise.then(()=>this.esriView.goTo(a,l))}else this.noMapErr()}getZoomLevel(){return this.esriView?this.esriView.zoom:(this.noMapErr(),1)}getScale(){return this.esriView?this.esriView.scale:(this.noMapErr(),1)}getResolution(){return this.esriView?this.esriView.resolution:(this.noMapErr(),1)}getExtent(){return this.esriView?Yh.fromESRI(this.esriView.extent):(this.noMapErr(),Yh.fromParams("i_am_error",0,1,0,1))}getExtentSet(){return this._rampExtentSet?this._rampExtentSet:(this.noMapErr(),rse.fromConfig({id:"i_am_error_extent_set",default:{xmin:0,xmax:1,ymin:0,ymax:1,spatialReference:{wkid:4326}}}))}getSR(){return this._rampSR?this._rampSR.clone():(this.noMapErr(),xl.latLongSR())}getPixelHeight(){return this.esriView?this.esriView.height:(this.noMapErr(),1)}getPixelWidth(){return this.esriView?this.esriView.width:(this.noMapErr(),1)}setPointZoomScale(e){return e>0?(this.pointZoomScale=e,!0):(console.error(`Cannot set pointZoomScale to non-positive number: ${e}.`),!1)}}class yFr extends tf{maptipStore;constructor(e){super(e),this.maptipStore=S_e(this.$vApp.$pinia)}#e=void 0;#t=void 0;async checkAtCoord(e){this.#t=e;const t=await this.$iApi.geo.map.getGraphicAtCoord(e);if(this.#t!==e)return;if(!t){this.clear();return}const r=this.$iApi.geo.layer.getLayer(t.layerId);if(r?.geomType!=cl.POLYGON&&this.#e&&this.#e.layerId===t.layerId&&this.#e.oid===t.oid&&this.#e.layerIdx===t.layerIdx)return;if(this.clear(),this.#e=t,!r){console.error(`graphic hit test returned non-existent layer id: ${t.layerId}`);return}if(!r.hovertips)return;const n=await r.getIcon(t.oid),s=await r.getGraphic(t.oid,{getAttribs:!0});this.setPoint(this.$iApi.geo.map.screenPointToMapPoint(e)),this.$iApi.event.emit(ln.MAP_GRAPHICHIT,{layer:r,graphicHit:t,attributes:s.attributes,icon:n,screenPoint:e})}generateDefaultMaptip(e){this.setContent(`
${e.icon}${e.attributes[e.layer.config.tooltipField||e.layer.nameField]}
`)}clear(){this.#e=void 0,this.maptipStore.setMaptipPoint(void 0),this.maptipStore.setMaptipContent("")}getInstance(){return this.maptipStore.maptipInstance}getPoint(){return this.maptipStore.maptipPoint}setPoint(e){this.maptipStore.setMaptipPoint(e)}setContent(e){this.maptipStore.setMaptipContent(e)}}class vFr extends M6t{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:pn.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=ale(this.$vApp.$pinia)}createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?this.findBasemap(e):e;this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const r=this.overviewmapStore.expandFactor;this.esriView=Da(new CFt({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(r)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",n=>{n.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",n=>{n.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",n=>{n.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",n=>{n.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",n=>{n.stopPropagation(),this.mapDrag(n)})}),this.esriView.container.addEventListener("touchmove",n=>{n.preventDefault()}),this.esriView.watch("fatalError",()=>{const n=new IntersectionObserver(s=>{s.forEach(o=>{o.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),n.disconnect())})});n.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new Ax(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",r=this.overviewmapStore.borderWidth??1,n=this.overviewmapStore.areaColour??"#000000",s=this.overviewmapStore.areaOpacity??.25,o=`${n}${Math.round(s*255).toString(16)}`;e.style=new jW({fill:{colour:o},outline:{colour:t,width:r}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),await this.overviewGraphicLayer.terminate(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer)}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}findBasemap(e){const t=this._basemapStore.find(r=>r.id===e);if(t)return t;{const n=bm(this.$vApp.$pinia).config.map;if(n){const s=n.basemaps.find(o=>o.id===e);if(s)return new A6t(s)}}throw new Error(`Invalid basemap id requested: ${e}`)}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=this.findBasemap(e),n=(this.getCurrentBasemapId()?this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return n?(this.destroyMapView(),this.createMapView(t)):this.applyBasemap(t),n}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=Da(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),r=this.esriView.toMap({x:e.x,y:e.y}),n=this.startExtent.clone().offset(r.x-t.x,r.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=n,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(n),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,r=this.zoomMapTo(e.expand(t),void 0,!1),n=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(n),n.geometry=e,this.overviewGraphicLayer.addGraphic(n),r}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class _Fr extends tf{DEFAULT_POINT_FORMATTERS={LAT_LONG_DMS:this.formatLatLongDMS,LAT_LONG_DD:this.formatLatLongDD,LAT_LONG_DDM:this.formatLatLongDDM,WEB_MERCATOR:this.formatMercator,CANADA_ATLAS_LAMBERT:this.formatLambert,UTM:this.formatUTM,BASEMAP:this.formatBasemap};pointFormatter;constructor(e){super(e),this.pointFormatter=this.DEFAULT_POINT_FORMATTERS.LAT_LONG_DMS}createCaption(e){if(!e)return;const t=oF(this.$vApp.$pinia);if(t.coords.disabled=!1,t.scale.disabled=!1,t.scale.isImperialScale=!1,e.mapCoords)if(e.mapCoords.disabled)t.coords.disabled=!0;else{const r=e.mapCoords.formatter;r!==void 0&&this.setPointFormatter(r)}if(e.scaleBar)if(e.scaleBar.disabled)t.scale.disabled=!0;else{const r=e.scaleBar.imperialScale;r!==void 0&&(t.toggleScale(r),this.$iApi.geo.map.viewPromise.then(()=>{this.updateScale()}))}t.langtoggle={disabled:e?.langToggle?.disabled??!1}}updateAttribution(e){const t={disabled:!1,value:this.$iApi.$i18n.t("caption.attributionDefaultText")},r={disabled:!1,altText:this.$iApi.$i18n.t("caption.attributionLogoAltText"),link:this.$iApi.$i18n.t("caption.attributionLink"),value:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAkCAYAAADWzlesAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADO9JREFUeNq0Wgl0jlca/pfvzyo6qNBSmhLLKE1kKEUtB9NTat+OYnBacwwJY19DZRC7sR41th60lWaizFSqRTOEw0lsrQSJGFIESSxJ/uRfv3nef+7Vt9f3p2E695z3fMt97/3ufe+7PO+9n9n0UzELsjKyiHdUdMZnVHTl2VyFe9nO7Kc/Io+4epUxmpWxeVkbr3hvUebgFf15GL9XUwZHndtAAYI09jGvIghOuoEwLOLeYiBoXrwGfZjYYOWAvWyMGlsk2YebXeV3NUEW1qcT5BBX4jUbCYEmHwwKEfdW1gEXgoWtiIlNRFeezcrkrQaTNSuraRYDdImrR1ylAALZBPnkXIJ0wRskeG2Cj3jsoFI2HhcfDDFWA9UBNdZZyc/PP4Z3HZYsWTLGbrffond0Xb9+/Qy6P3jw4F+HDx8+mu7XrVs3c+7cuX+i+3nz5o3n/Rw4cGAdf/7hhx9SZ8yYEcffHT9+/G/8uaSkJGvDhg3D8P3moNdXrlw5UtYVFxfnXL9+/V8PHz68grr2N2/eTC4tLb2E+9+Cotq1a/dOenr6njt37nxPdOrUqd0dO3bsjromoHBQKBPkEyFUB71MH6SPbNy4cRqfkMvlenzixImtqO/x3XffbXc6nSW5ubnpOTk5J1NTU/cQH91//fXXu3/88ccLy5cvj6d34B8gaBA9JyQk/OWjjz5aIu8Fz2DiWbZs2QLx/A4m0Qf9f/n48eNsPEeDfrdly5Y/U31UVNT7dJ04ceIsGseNGzfS6DkuLq4v8YE6Y/G+93g8XKZ6QUHBRVHfAPQC0xJfCRAv65EkeUP6gFx11JEkfw/qTc8ff/zxKofDUXrv3r08rOIBeU9CWbx48SLej5y4LGlpaf9YuHDhUv5OtqH+6Vty0riPAbWjheH8n3322VYpuG+//Xa5mGB7CGM8hKN7vV5dLfHx8WNI20E1aN4WP97YZyc7d+6MM5vNHRs2bDg3NjY23e12l5w8eZJWzIUJ9IdmlI4bNy4tICAgtHbt2hGdOnXaSe3oftu2bWmBgYFOn3MwmwcQLViwIJOeYVYJGGAZVuW2zWZzCZ6hoIGapnmknUMTQnr16vUeTOKydHqyHrx9t27dunro0KEfzJw5M4Pe3bp166Z0pHXr1g0Fj2EYCw8PD+N+SjNwUuSAKnxexOkswOWxZN63b9/MAQMGzIUwx5WXl99eunTpFLx+hJU/K9o/yM7OPhgZGdk5KSkpp0WLFv+Vrq7/na5nz57dR1dM6t7hw4e3DRkyJG7WrFlxgudzukIw58TzV3SF3Z+ByUzFbTk5O9j8fVH/JV3PnTv3uRijSdSR5/empKRkT5kypQxCC+UTxMKVQXuyWBT5WbiS4VFjIZLHWQsLN1ZFgFbm0U1KSNWUUMlDp9kAh0iNdCkRwiva2FjUsjJeJ5sYRYQwCGIYNGk8tC1UCuDQoUOb+vbtuxuPRUJ4FVwIFhZ7pUD45OXEbUpo9DIz8hgAFk0BORblWypm8BiQzkKnpoRnM+PxsEWhiYfFxMTUHTx4cDOYhg7tzM7IyLhNCiYEUEbCMxsAGYuCGjl4ClKE4GY+xCnIw95zBKqxvmyCOJqT7dws5ntZzLcoaJEjQiPUahMaESzudWEqhBEeiSuZvUvzA1+lxIMEhbD7QGYKUl0rBAgxC9vlq6IzNZZ9BYt+rMw8pBDLmSZZFBPQmBC8imaofo1roa5oKH82aQaaIH0CDTZM0sCBAxvBKbZ+7bXXGr3yyisN4ZjMDx48uAeAkofQdHbt2rUXhIpJKevMJwSLfqq3bt365enTp3eFh365SZMmBGpMFRUVZcAV1wFmzs2ZMyddtCkXk9ESExOjq1Wr9iLCbwAilA9xwrnlwimS4G2ffvppj1atWrWoWbNmbWCKAtj9V5MnT84cMWJEvTfeeKM+wqSFzCEoKMgJ3HEVgO6SkTlKMwgUgImwArn2DpMmTYrDALP0XyjEA9sbjTZtQZGij7qghqBWoK4AWPswkbLK+qHIsWPHjoXgfwvUhsZAAEflg+dfg0kuBlosUuvoO2jXl65qXWZm5g7UNRPIOIQLQqpcmECMJIAuRp1UVmiCACmTxAReFx+LhnPqV1hY+O9n6evIkSObSXCEHI0WASDtMMJ0uVHb7du3E6p9HxpxQK0DjN4r0Gc9kSZYeZiSNkuaUOv06dPTO3fuPNj0DAWgKWTFihVL+vfvT0J8kfohAsobV6tWrYbP0hf460pnLE2AF2jB21DvIKO2gO6FNB+ERJtaB+xjY37NN3+LogmkHi9s2rTp3bZt277LG8NuK5AopXbv3n0O7Gtsjx49ZmNye6GOD1RBwD9MFUKoSQSc30UdzJUrV26uWrVqP7D/lt27d+9/9OhRMas7gjYbhROzkv9R2wcHBwdWshjkYL1G7SBQTXGwTwQQLLIqWsGeGFAhVyFSO6C7Naj7ADRUJENDQGMjIiLmQl0LVLUbNWrUItSPhBNcodYhFyFklwAiYf0RNKZZs2YfFhUVXYcAvhFm0FFc++fl5eX4Mxto7JnRo0cvID4yHWSz70dHRw+khAxZ6yGVH8ndftS9DWokciWNx15fTN2zZ0+f6tWr1+LS279/fwYgcz4LPzJvdyGVLUFidFiVOIRAqx8KlQysZCdKboJUXL58uRAmMLFp06aLRbh1cGhrVEiD3nzzzTXIcU5R6gC6vXfv3kuIGgSIyq1Wq6cqpmdhiNAXFtu0adNeZVq9enUWA0xywyVECC4AicwttQ2SrvpkYnfv3i1X6xo0aPAiJv2H+fPnt27UqFEN4YsCDBCk33Lt2rW8kSNHJuP2LqUc4kq+4KFAgg6LxeKtSl+a4hMC6tSp85QD27VrVy9I1U2SJaKYS/ZG8Rf5uhVXq91ud4aEhATINo0bN46glUQMv4aQV46MMpj3iRVvsGjRohFEENQtygCRmZ5B6DsqNNPFANJT5cyZM5RoPRBE/qREaJYEYm4aZ1WFwDG9ppoClebNm9czPV/xYXOo6J4xY8Z84I8Jgq9HBCDVfsKECR+mpqZ+gSQnRVQHGTm4CxcuXBP9l4qrneUNPtheVSFYKtkF/jUKqWbx2LFjUxBJViA82asSZvv06TPq+PHjE/D4GzI70jiVT+xDyBzDo8DhZyoWNXsD4Cn/FYVQLKgIofCfMIkhgKyr4bhO8pBoVGgvsEuXLq+SEIw0Qayyl5H+vIPUmJf2ZYOwz5twXE05U/369TfBZu+wvMBpkH7L3dwyYZ+l4uoRPL50FzCcQuAJstvIyMjacG5Rw4YN64b7V9XBxcbGdgJq/cZIE4TT0/2ceTyzJsiMj0JSxfnz50+rTECBUUq2aGd2WC7Izib+WFwdLJs0sczT1w+Q3d34+PhTSKQ2w4GeVL9LTtefY1Q2YEz/qxC8LIe3f/LJJ2kqU79+/WIGDRpUj+0L8N0lG7B6N+QGiS1btgxR9ha8gi949uzZ0UiENgBSR4iQyFNiL0zkrh+V/78XfjJDq1aWnJx85dixY8kqRE1KSopNSUkZ0K1btwjhsGpMmzatbVZW1nTy/JQbQHUXA26HMRul/gOQHkcBUK1BBGiJFHgtcMV7YqeXeEM7dOhQB4lXh6dCS1kZaZbDSBjinV6ZhsBkdAMz0o00SO4hhIrUl7K/7vfv37+hP0eBw8tBftFRpNNNExMThyMqlKp8SEXsADy5t1GM+qF6CHwe+hifm5t7Ta1PSEiYj7rWIhsMZaCPEkDyL+2PHj36hdqO3lGd4KkuYbN0jC5h22TPRT179pwCZ5j9rKqF0FWtd+/eL0kBA9Y2kRudvBB4og2al1CM+iFsgQFfJTCkaZrboL2DhUfd4NjAadROvHPyvUsLayxNghxaMWw0D1EhFiguqSrxXWZ/EN7IyZMnX5QHn127dk0Gxo+nnd6q9EHf2rx58zJgC1oxSrQKgR1cKl9YWJhdOFg329TlC1oBM3YYZJ8OubcozVZTJPjkzEEwOBGr1yIr+xz23xX23i48PPxVjiqRQV6GRuetXLkSbiPpCsPuTulzEAYPAh+cnzp1ao+YmJi31D5gevkwo3sZGRmn0M+RzMzMAhFtaGG0ixcvfpmfn39WbpNBC1zILK8KHqdykCsXszQ7O/sE8WMBNKGlbrxLF1HsSeQyV5JQBSrJUghLdDQmKB46ywTJFTKzfqqxftScwM1OjGXY/Vl0UU7IHcq3XMrutkz0QsX3bOwEWo5TfsNj9hMxjP5VCFR2fPl/AS4xMH7u71X6CWR92JQjer5t72AHLrpyKGRRhKbCZrNybhJg8HvBU+385Qv8DMKi/BjBEaKuHJK42YDU/x789cFhu1s5cFH/hTAp3/UqhzMm5cTM6G8br/qnyi8lTWYDoZiUP1TUEyc1Ble1D5OSA+gG7U0GR3b+fhUy+kVIN0Kb/xFgANrk0XIqRaL0AAAAAElFTkSuQmCC"},n={text:{value:"",disabled:!1},logo:{disabled:!1,altText:"",link:"",value:""}};if(e?(e.logo?e.logo.disabled?n.logo.disabled=!0:(n.logo.altText=e.logo.altText||r.altText,n.logo.link=e.logo.link||r.link,n.logo.value=e.logo.value||r.value):(n.logo.altText=r.altText,n.logo.link=r.link,n.logo.value=r.value),e.text?e.text.disabled?n.text.disabled=!0:n.text.value=e.text.value||t.value:n.text.value=t.value,oF(this.$vApp.$pinia).setAttribution(n)):(n.logo.altText=r.altText,n.logo.link=r.link,n.logo.value=r.value,n.text.value=t.value),!e||e.text?.disabled||!e.text){if(!this.$iApi.geo.map.esriMap){console.warn("Attempted to fetch map attribution with undefined map");return}let s="";const o=5e3,a=20,l=this.$iApi.geo.map.esriMap.basemap.baseLayers.map(u=>new Promise(c=>{let h=0;const p=o/a,m=setInterval(function(){u.loaded&&!u.loadError?(clearInterval(m),c(u)):h>p&&(clearInterval(m),c(null)),h++},a)})).toArray();Promise.all(l).then(u=>{s=u.filter(h=>h?.copyright).map(h=>h.copyright).join(" | "),n.text.value=s||n.text.value||t.value,oF(this.$vApp.$pinia).setAttribution(n)})}}updateScale(){const e=oF(this.$vApp.$pinia),t=e.scale;if(t?.disabled)return;const r=t?.isImperialScale||!1,n=this.scaleHelper().find(s=>s.isImperialScale===r)??{isImperialScale:!1,units:"error",pixels:1,distance:1};e.scale={width:`${n.pixels}px`,label:`${this.$iApi.$i18n.n(n.distance,"number")}${n.units}`,isImperialScale:r}}async formatPoint(e){return e?await this.pointFormatter(e):""}setPointFormatter(e){if(typeof e=="string"){if(!(e in this.DEFAULT_POINT_FORMATTERS)){console.warn(`Could not find point formatter with id: ${e}`);return}this.pointFormatter=this.DEFAULT_POINT_FORMATTERS[e]}else this.pointFormatter=e}scaleHelper(){const e=window.innerWidth>600?70:35,t=this.$iApi.geo.map.getResolution(),r=[],n=t*e,s=1609.34,o=3.28084,a=n>1e3?["km","mi"]:["m","ft"];for(let l=0;l<2;l++){const u=l===1;if(r.push({isImperialScale:u,units:a[l],pixels:0,distance:0}),n>1e3){const c=t*e/(u?s:1e3),h=Math.round(c).toString().length,p=Math.pow(10,h-1);r[l].distance=Math.ceil(c/p)*p,r[l].pixels=r[l].distance*(u?s:1e3)/t}else r[l].distance=Math.ceil(u?n*o:n),r[l].pixels=n/t}return r}wrapValue(e,t,r){return((e-t)%(r-t)+(r-t))%(r-t)+t}async formatLatLongDMS(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.floor(Math.abs(r))*(r<0?-1:1),a=Math.floor(Math.abs((r-o)*60)),l=Math.floor((Math.abs(r)-Math.abs(o)-a/60)*3600),u=Math.floor(Math.abs(n))*(n<0?-1:1),c=Math.floor(Math.abs((n-u)*60)),h=Math.floor((Math.abs(n)-Math.abs(u)-c/60)*3600);return`${this.$iApi.$i18n.n(Math.abs(o),"number")}${s} ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(l,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(u),"number")}${s} ${this.$iApi.$i18n.n(c,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(h,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDDM(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.floor(Math.abs(r))*(r<0?-1:1),a=Math.abs((r-o)*60),l=Math.floor(Math.abs(n))*(n<0?-1:1),u=Math.abs((n-l)*60);return`${this.$iApi.$i18n.n(Math.abs(o),"number")}${s} ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(l),"number")}${s} ${this.$iApi.$i18n.n(u,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDD(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.abs(r),a=Math.abs(n);return`${this.$iApi.$i18n.n(o,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${s} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${s} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatMercator(e){const t=await this.$iApi.geo.proj.projectGeometry(102100,e);return`${this.$iApi.$i18n.n(Math.floor(t.x),"number")} m | ${this.$iApi.$i18n.n(Math.floor(t.y),"number")} m`}async formatLambert(e){const t=await this.$iApi.geo.proj.projectGeometry(3978,e);return`${this.$iApi.$i18n.n(Math.abs(Math.floor(t.x)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(0>t.x?"west":"east"))} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(t.y)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(t.y>0?"north":"south"))}`}async formatUTM(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s=Math.ceil((n+180)/6),o=await this.$iApi.geo.proj.projectGeometry(parseInt("326"+s),e);return`${this.$iApi.$i18n.n(s,"number",{minimumIntegerDigits:2})} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} ${this.$iApi.$i18n.n(Math.floor(o.x),"number")} m${this.$iApi.$i18n.t("map.coordinates.east")} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(o.y)),"number")} m${this.$iApi.$i18n.t("map.coordinates.north")}`}async formatBasemap(e){const t=await this.$iApi.geo.proj.projectGeometry(this.$iApi.geo.map.getSR(),e);return`${this.$iApi.$i18n.n(t.x,"number")} | ${this.$iApi.$i18n.n(t.y,"number")}`}}class bFr extends M6t{maptip;caption;mapMouseThrottle;layerDefaultTimes={draw:0,load:0};constructor(e){super(e),this.maptip=new yFr(e),this.caption=new _Fr(e),this.mapMouseThrottle=0}createMap(e,t){this.setMapMouseThrottle(e.mapMouseThrottle??0),this.trackFirstBasemap=!0,super.createMap(e,t),this.layerDefaultTimes.draw=e.layerTimeDefault?.expectedDrawTime??1e4,this.layerDefaultTimes.load=e.layerTimeDefault?.expectedLoadTime??1e4,this.viewPromise.then(()=>{this.$iApi.event.emit(ln.MAP_CREATED)})}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.$iApi.geo.layer.allLayersOnMap(!1).map(e=>e.uid).forEach(e=>this.removeLayer(e)),super.destroyMap(),this.$iApi.event.emit(ln.MAP_DESTROYED)}createMapView(e){const r=bm(this.$vApp.$pinia).config.map;if(!r)throw new Error("Attempted to create map view without a map config");const n=(typeof e=="string"?this.findBasemap(e):e)||this.findBasemap(r.initialBasemapId),s=r.tileSchemas.find(l=>l.id===n.tileSchemaId);if(!s)throw new Error(`Could not find tile schema for the given basemap id: ${n.id}`);const o=r.extentSets.find(l=>l.id===s.extentSetId);if(!o)throw new Error(`Could not find extent set with the given id: ${s.extentSetId}`);this._rampExtentSet=rse.fromConfig(o),this._rampSR=this._rampExtentSet.sr.clone();const a=r.lodSets.find(l=>l.id===s.lodSetId);if(!a)throw new Error(`Could not find lod set with the given id: ${s.lodSetId}`);this.esriView=Da(new CFt({map:this.esriMap,container:this._targetDiv,constraints:{lods:a.lods,rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this._rampExtentSet.defaultExtent.toESRI(),navigation:{browserTouchPanEnabled:!1},background:{color:n.backgroundColour}})),this.esriView.ui.components=[],this.handlers.push({type:"extent",handler:this.esriView.watch("extent",l=>{if(l){const u=this.$iApi.geo.geom.geomEsriToRamp(l,"map_extent_event");this.$iApi.event.emit(ln.MAP_EXTENTCHANGE,u),this.$iApi.event.emit(ln.FILTER_CHANGE,{extent:u,filterKey:pm.EXTENT})}})}),this.handlers.push({type:"scale",handler:this.esriView.watch("scale",l=>{this.$iApi.event.emit(ln.MAP_SCALECHANGE,l)})}),this.handlers.push({type:"resize",handler:this.esriView.on("resize",l=>{this.$iApi.event.emit(ln.MAP_RESIZED,{height:l.height,width:l.width})})}),this.handlers.push({type:"click",handler:this.esriView.on("click",l=>{this.$iApi.event.emit(ln.MAP_CLICK,this.$iApi.geo.geom.esriMapClickToRamp(l,"map_click_point"))})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",l=>{this.$iApi.event.emit(ln.MAP_DOUBLECLICK,this.$iApi.geo.geom.esriMapClickToRamp(l,"map_doubleclick_point"))})}),this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),this.handlers.push({type:"pointer-move-start",handler:this.esriView.on("pointer-move",xE(100,!0,l=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE_START,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-move-end",handler:this.esriView.on("pointer-move",xE(100,l=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE_END,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-leave",handler:this.esriView.on("pointer-leave",l=>{setTimeout(()=>{this.$iApi.event.emit(ln.MAP_MOUSELEAVE,l.native)},Math.max(this.mapMouseThrottle,100)+1)})}),this.handlers.push({type:"pointer-down",handler:this.esriView.on("pointer-down",l=>{this.$iApi.event.emit(ln.MAP_MOUSEDOWN,l.native)})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",l=>{this.$iApi.event.emit(ln.MAP_KEYDOWN,l.native),l.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",l=>{this.$iApi.event.emit(ln.MAP_KEYUP,l.native),l.stopPropagation()})}),this.handlers.push({type:"focus",handler:this.esriView.on("focus",l=>{this.$iApi.event.emit(ln.MAP_FOCUS,l.native)})}),this.handlers.push({type:"blur",handler:this.esriView.on("blur",l=>{this.$iApi.event.emit(ln.MAP_BLUR,l.native)})}),this.esriView.container.addEventListener("touchmove",l=>{l.preventDefault()}),this.esriView.watch("fatalError",()=>{const l=new IntersectionObserver(u=>{u.forEach(c=>{c.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),l.disconnect())})});l.observe(this.esriView.container)}),this.esriView.when(()=>{if(this._viewPromise.resolveMe(),this.created=!0,this.applyBasemap(n),s.recoveryBasemap?.basemapId){const l=s.recoveryBasemap.timeout??8e3;l>0&&setTimeout(()=>{this.trackFirstBasemap&&this.recoverBasemap(s.id)},l)}})}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const t=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(t.esriBasemap);const r=bm(this.$vApp.$pinia);r.activeBasemapConfig=t.config}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=bm(this.$vApp.$pinia),r=this.findBasemap(e),s=t.activeBasemapConfig.tileSchemaId!==r.tileSchemaId;if(s){const o=this.getExtent().center(),a=this.getScale();this._viewPromise=new Af,this.created=!1,this.$iApi.event.emit(ln.MAP_REFRESH_START),this.destroyMapView(),this.createMapView(r),this.viewPromise.then(()=>{this.$iApi.event.emit(ln.MAP_REFRESH_END),this.$iApi.event.emit(ln.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s});const l=this.findClosestScale(a);this.$iApi.geo.proj.projectGeometry(this._rampSR,o).then(u=>this.zoomMapTo(u,l,!1))})}else this.applyBasemap(r),this.esriView.background=new vFt({color:new bR(r.backgroundColour).toESRI()}),this.$iApi.event.emit(ln.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s});return s}recoverBasemap(e){this.esriMap||this.noMapErr(),this.trackFirstBasemap=!1;const r=bm(this.$vApp.$pinia).config.map;if(r){const n=r.tileSchemas.find(s=>s.id===e);if(n?.recoveryBasemap?.basemapId){const s=this.findBasemap(n.recoveryBasemap.basemapId);this.applyBasemap(s)}}}addLayer(e,t=void 0){return new Promise((r,n)=>{if(this.esriMap||(this.noMapErr(),n()),e.initiationState!==ey.INITIATING&&e.initiationState!==ey.INITIATED&&e.layerState!==Ud.ERROR&&e.initiate(),e.mapLayer&&t===void 0){const l=this.$iApi.geo.layer.layerOrderIds();if(e.isCosmetic)t=l.length;else{const u=this.$iApi.geo.layer.allLayers();let c=!0;for(let h=l.length-1;h>=0&&c;h--){const p=u.find(m=>m.id===l[h]);p&&!p.isCosmetic&&(t=h+1,c=!1)}c&&(t=0)}}H1(this.$vApp.$pinia).addLayer(e,t);let o=0;const a=setInterval(()=>{o+=250,o>=2e4||e.layerState===Ud.ERROR?(clearInterval(a),e.onError(),console.error(`Failed to add layer: ${e.id}.`),n()):e.initiationState===ey.INITIATED&&(e.esriLayer||!e.mapLayer)&&(clearInterval(a),e.mapLayer?this.insertToEsriMap(e):e.onLoad(),this.$iApi.event.emit(ln.LAYER_REGISTERED,e),r())},250)})}insertToEsriMap(e){let t=0;const r=this.$iApi.geo.layer.getLayerPosition(e.id)??-1;if(r>0){const n=this.$iApi.geo.layer.layerOrderIds(),s=this.$iApi.geo.layer.allLayers();for(let o=r-1;o>-1;o--){const a=n[o],l=s.find(u=>u.id===a);if(l&&l.esriLayer){const u=this.esriMap.layers.indexOf(l.esriLayer);if(u>-1){t=u+1;break}}else l||console.error("ESRI Layer insert encountered bad state. Layer likely inserted at bottom of map.")}}r>-1&&this.esriMap?.add(e.esriLayer,t)}reorder(e,t,r=!1){if(t<0){console.error("Negative index passed to map reorder");return}if(!this.esriMap){this.noMapErr();return}if(e.isSublayer&&(e=e.parentLayer),!e.mapLayer){console.error("Attempted to reorder a data layer");return}const n=this.$iApi.geo.layer.allLayers();let s=this.$iApi.geo.layer.layerOrderIds();if(r){if(e.isCosmetic)return;if(t>0){const l=s.filter(u=>{const c=n.find(h=>h.id===u);return c?!c.isCosmetic:(console.error("Layer reorder had critical error"),!1)});t>=l.length&&(console.error("non-cosmetic reorder index was too high"),t=l.length-1),t=s.indexOf(l[t])}}else t>=s.length&&(console.error("reorder index was too high"),t=s.length-1);const o=s.indexOf(e.id);if(o===t)return;if(H1(this.$vApp.$pinia).reorderLayer(e,t),e.esriLayer&&this.esriMap.layers.indexOf(e.esriLayer)>-1){let l=0;if(t>0){s=this.$iApi.geo.layer.layerOrderIds();for(let u=t-1;u>-1;u--){const c=s[u],h=n.find(p=>p.id===c);if(h&&h.esriLayer){const p=this.esriMap.layers.indexOf(h.esriLayer);if(p>-1){const m=tn.isRemoved)&&this.removeLayer(r.parentLayer)}removeLayer(e){if(!this.esriMap){this.noMapErr();return}let t;if(e instanceof Rse?t=e:t=this.$iApi.geo.layer.getLayer(e),!t)throw new Error("Layer could not be found for removal.");if(t.isSublayer){this.removeSublayer(t);return}if(t.mapLayer&&!t.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");t.supportsSublayers&&t.sublayers.some(n=>!n.isRemoved)&&t.sublayers.forEach(n=>this.removeSublayer(n)),t.terminate();const r=H1(this.$vApp.$pinia);r.removeLayer(t),r.removeLayerConfig(t.id),t.mapLayer&&this.esriMap.remove(t.esriLayer),t.isRemoved=!0,this.$iApi.event.emit(ln.LAYER_REMOVE,t)}setMapMouseThrottle(e){if(e<0)return console.error("Cannot set map mouse throttle to value that is less than 0."),!1;this.mapMouseThrottle=e;const t=this.handlers.findIndex(r=>r.type==="pointer-move");if(t!==-1){const r=this.handlers[t];this.handlers.splice(t,1),r.handler.remove()}return t!==-1&&this.esriView&&this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),!0}createMouseMoveHandler(){if(!this.esriView){this.noMapErr();return}return _P(this.mapMouseThrottle,e=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE,this.$iApi.geo.geom.esriMapMouseToRamp(e))})}async zoomToLevel(e){if(this.esriView)return this.esriView.goTo({zoom:e});this.noMapErr()}async zoomIn(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom+1);this.noMapErr()}async zoomOut(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom-1);this.noMapErr()}async zoomToVisibleScale(e){if(!this.esriView){this.noMapErr();return}const t=e.isOffScale(this.getScale());if(!t.offScale)return;const r=this.esriView.constraints.lods;if(!r)return this.zoomMapTo(this.getExtent().center(),(t.zoomIn,e.minScale));const n=t.zoomIn?r:[...r].reverse(),s=n.find(o=>t.zoomIn?o.scalee.maxScale)||n[n.length-1];return this.zoomToLevel(s.level)}findClosestScale(e){const t=this.esriView?.constraints.lods;if(!t)return e;const r=t.map(s=>Math.abs(s.scale-e)),n=r.indexOf(Math.min(...r));return t[n].scale}async takeScreenshot(e){if(this.esriView)return e.quality||(e.quality=1),e.format||(e.format="png"),this.esriView.takeScreenshot(e);throw new Error("Export attempted without a map view available")}screenPointToMapPoint(e){return this.esriView?s0.fromESRI(this.esriView.toMap({x:e.screenX,y:e.screenY}),"mappoint"):(this.noMapErr(),new s0("i_am_error",[0,0],void 0,!0))}mapPointToScreenPoint(e){if(this.esriView){const t=this.esriView.toScreen(e.toESRI());return{screenX:t.x,screenY:t.y}}else return this.noMapErr(),{screenX:1,screenY:1}}runIdentify(e){const t=this.$iApi.geo.layer.allLayersOnMap(!1).filter(u=>u.canIdentify());let r;if(e instanceof s0){const u=this.mapPointToScreenPoint(e);r={mapPoint:e,screenX:u.screenX,screenY:u.screenY,button:0,input:"mouse",clickTime:Date.now()}}else r=e;if(t===void 0)return{click:r,results:[]};let n=Promise.resolve([]);t.some(u=>u.identifyMode===sg.HYBRID||u.identifyMode===sg.SYMBOLIC)&&(n=this.esriView.hitTest({x:r.screenX,y:r.screenY}).then(u=>u.results.map(c=>({layerId:c.layer.id,layerIdx:0,oid:c.graphic.getObjectId()}))));const s={geometry:r.mapPoint,hitTest:n},o=t.filter(u=>u.supportsIdentify).map(u=>(s.tolerance=r.input=="touch"?u.touchTolerance:u.mouseTolerance,u.runIdentify(s))).flat(),a=Date.now();o.forEach(u=>{u.requestTime=a});const l={results:o,click:r};return this.$iApi.event.emit(ln.MAP_IDENTIFY,l),l}async getGraphicAtCoord(e){if(!this.esriView){this.noMapErr();return}const t=this.$iApi.geo.layer.allLayersOnMap(!1).filter(l=>l.supportsFeatures||l.layerType===pn.GRAPHIC);if(t.length===0)return;const r=await this.esriView.hitTest({x:e.screenX,y:e.screenY});if(r.results.length===0)return;const n=r.results;let s,o;const a=new Set;if(n.some(l=>{if(a.has(l.layer.id))return!1;const u=t.find(c=>c.id===l.layer.id);return u?(!u.isCosmetic&&u.layerType!==pn.GRAPHIC&&(s=u,o=l.graphic),!0):(a.add(l.layer.id),!1)}),s&&o)return{oid:o.getObjectId(),layerId:s.id,layerIdx:s.getLayerTree().layerIdx}}_activeKeys=[];_panInterval;_mouseFocus=!1;mapKeyDown(e){const t=["=","-"];["Shift","Control","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this._activeKeys.some(n=>t.includes(n))||this.keyPan()):t.includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this.keyZoom(e)):e.key==="Enter"?this.runIdentify(this.getExtent().center()):e.key==="Tab"&&this._activeKeys.push(e.key)}mapKeyUp(e){const t=["=","-"];this._activeKeys.includes(e.key)&&!t.includes(e.key)&&(this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this._activeKeys.some(r=>t.includes(r))||this.keyPan())}setMouseFocus(){this._mouseFocus=!0}stopKeyPan(){this._activeKeys.includes("Tab")&&(this._mouseFocus=!1),this._activeKeys=[],clearInterval(this._panInterval)}get keysActive(){return this._activeKeys.filter(e=>!["Control","Shift"].includes(e)).length!==0}get mouseFocus(){return this._mouseFocus}async keyZoom(e){clearInterval(this._panInterval),e.key==="="?await this.zoomIn():e.key==="-"&&await this.zoomOut(),this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this.keyPan()}keyPan(){if(clearInterval(this._panInterval),!this.keysActive)return;const e=this.getExtent().center(),t=this.mapPointToScreenPoint(e),r=this.screenPointToMapPoint({screenX:t.screenX+5,screenY:t.screenY+5}),n=Math.abs(r.x-e.x),s=Math.abs(r.y-e.y);let o=0,a=0,l=1;for(let c=0;c{e.x+=l*o,e.y+=l*a,this.zoomMapTo(e,u,!1)},25)}}const wFr={geometryType:"point",renderer:{type:"simple",symbol:{type:"esriSMS",style:"esriSMSCircle",color:[67,100,255,200],size:7,outline:{color:[0,0,0,255],width:1}}}},xFr={geometryType:"polyline",renderer:{type:"simple",symbol:{type:"esriSLS",style:"esriSLSSolid",color:[90,90,90,200],width:2}}},SFr={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[76,76,125,200],outline:{type:"esriSLS",style:"esriSLSSolid",color:[110,110,110,255],width:1}}}},TFr={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[255,0,0,64],outline:{type:"esriSLS",style:"esriSLSSolid",color:[240,128,128,255],width:1}}}},CFr={circlePoint:wFr,solidLine:xFr,outlinedPoly:SFr,boundingBoxPoly:TFr};var O6t={exports:{}};(function(i,e){(function(t,r){if(i.exports=r(MFt()),typeof t.navigator=="object"){if(!t.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");t.Terraformer.ArcGIS=r(t.Terraformer)}})(Hh,function(t){var r={};function n(S){var I=0,R=0,L=[],k,B,$,V;$=S.match(/((\+|\-)[^\+\-]+)/g),V=parseInt($[0],32);for(var Y=1;Y<$.length;Y+=2)k=parseInt($[Y],32)+I,I=k,B=parseInt($[Y+1],32)+R,R=B,L.push([k/V,B/V]);return L}function s(S){return o(S[0],S[S.length-1])||S.push(S[0]),S}function o(S,I){for(var R=0;R=0}function u(S){var I=[],R=S.slice(0),L=s(R.shift().slice(0));if(L.length>=4){l(L)||L.reverse(),I.push(L);for(var k=0;k=4&&(l(B)&&B.reverse(),I.push(B))}}return I}function c(S){for(var I=[],R=0;R=0;k--){var B=L[k].slice(0);I.push(B)}return I}function h(S,I){var R=t.Tools.arraysIntersectArrays(S,I),L=t.Tools.coordinatesContainPoint(S,I[0]);return!!(!R&&L)}function p(S){for(var I=[],R=[],L,k,B,$=0;$=0;L--)if(k=I[L][0],h(k,B)){I[L].push(B),Q=!0;break}Q||K.push(B)}for(;K.length;){B=K.pop();var re=!1;for(L=I.length-1;L>=0;L--)if(k=I[L][0],t.Tools.arraysIntersectArrays(k,B)){I[L].push(B),re=!0;break}re||I.push([B.reverse()])}return I.length===1?{type:"Polygon",coordinates:I[0]}:{type:"MultiPolygon",coordinates:I}}function m(S,I){var R={};return I=I||{},I.idAttribute=I.idAttribute||void 0,S.spatialReference&&(S.spatialReference.wkid===3857||S.spatialReference.wkid===102100)&&(R.crs=t.MercatorCRS),typeof S.x=="number"&&typeof S.y=="number"&&(R.type="Point",R.coordinates=[S.x,S.y],(S.z||S.m)&&R.coordinates.push(S.z),S.m&&R.coordinates.push(S.m)),S.points&&(R.type="MultiPoint",R.coordinates=S.points.slice(0)),S.paths&&(S.paths.length===1?(R.type="LineString",R.coordinates=S.paths[0].slice(0)):(R.type="MultiLineString",R.coordinates=S.paths.slice(0))),S.rings&&(R=p(S.rings.slice(0))),typeof S.xmin=="number"&&typeof S.ymin=="number"&&typeof S.xmax=="number"&&typeof S.ymax=="number"&&(R.type="Polygon",R.coordinates=[[[S.xmax,S.ymax],[S.xmin,S.ymax],[S.xmin,S.ymin],[S.xmax,S.ymin],[S.xmax,S.ymax]]]),(S.compressedGeometry||S.geometry||S.attributes)&&(R.type="Feature",S.compressedGeometry&&(S.geometry={paths:[n(S.compressedGeometry)]}),R.geometry=S.geometry?m(S.geometry):null,R.properties=S.attributes?a(S.attributes):null,S.attributes&&(R.id=S.attributes[I.idAttribute]||S.attributes.OBJECTID||S.attributes.FID)),new t.Primitive(R)}function v(S,I){var R;I=I||{};var L=I.idAttribute||"OBJECTID";I.sr?R={wkid:I.sr}:S&&S.crs&&S.crs.properties.name!="urn:ogc:def:crs:OGC:1.3:CRS84"?R=null:R={wkid:4326};var k={},B;switch(S.type){case"Point":k.x=S.coordinates[0],k.y=S.coordinates[1],S.coordinates[2]&&(k.z=S.coordinates[2]),S.coordinates[3]&&(k.m=S.coordinates[3]),k.spatialReference=R;break;case"MultiPoint":k.points=S.coordinates.slice(0),k.spatialReference=R;break;case"LineString":k.paths=[S.coordinates.slice(0)],k.spatialReference=R;break;case"MultiLineString":k.paths=S.coordinates.slice(0),k.spatialReference=R;break;case"Polygon":k.rings=u(S.coordinates.slice(0)),k.spatialReference=R;break;case"MultiPolygon":k.rings=c(S.coordinates.slice(0)),k.spatialReference=R;break;case"Feature":S.geometry&&(k.geometry=v(S.geometry,I)),k.attributes=S.properties?a(S.properties):{},S.id&&(k.attributes[L]=S.id);break;case"FeatureCollection":for(k=[],B=0;B=v)return p;if(R)return R=!1,h;var B=w,$;if(u.charCodeAt(B)===34){for(var V=B;V++"u")return!1;var e=OE(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function QPr(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!ES(s)||!x3(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function eRr(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,u){return l[u]="",l},{});!ES(n)||!x3(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var K$t={name:"applyStyles",enabled:!0,phase:"write",fn:QPr,effect:eRr,requires:["computeStyles"]};function JA(i){return i.split("-")[0]}var c9=Math.max,E_e=Math.min,lq=Math.round;function uq(i,e){e===void 0&&(e=!1);var t=i.getBoundingClientRect(),r=1,n=1;if(ES(i)&&e){var s=i.offsetHeight,o=i.offsetWidth;o>0&&(r=lq(t.width)/o||1),s>0&&(n=lq(t.height)/s||1)}return{width:t.width/r,height:t.height/n,top:t.top/n,right:t.right/r,bottom:t.bottom/n,left:t.left/r,x:t.left/r,y:t.top/n}}function dYe(i){var e=uq(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Z$t(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&J$t(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function S3(i){return OE(i).getComputedStyle(i)}function tRr(i){return["table","td","th"].indexOf(x3(i))>=0}function sL(i){return((aq(i)?i.ownerDocument:i.document)||window.document).documentElement}function pTe(i){return x3(i)==="html"?i:i.assignedSlot||i.parentNode||(J$t(i)?i.host:null)||sL(i)}function mht(i){return!ES(i)||S3(i).position==="fixed"?null:i.offsetParent}function iRr(i){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&ES(i)){var r=S3(i);if(r.position==="fixed")return null}for(var n=pTe(i);ES(n)&&["html","body"].indexOf(x3(n))<0;){var s=S3(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function ole(i){for(var e=OE(i),t=mht(i);t&&tRr(t)&&S3(t).position==="static";)t=mht(t);return t&&(x3(t)==="html"||x3(t)==="body"&&S3(t).position==="static")?e:t||iRr(i)||e}function pYe(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function rre(i,e,t){return c9(i,E_e(e,t))}function rRr(i,e,t){var r=rre(i,e,t);return r>t?t:r}function Q$t(){return{top:0,right:0,bottom:0,left:0}}function e6t(i){return Object.assign({},Q$t(),i)}function t6t(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var nRr=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,e6t(typeof e!="number"?e:t6t(e,sle))};function sRr(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=JA(t.placement),l=pYe(a),u=[Fb,GS].indexOf(a)>=0,c=u?"height":"width";if(!(!s||!o)){var h=nRr(n.padding,t),p=dYe(s),m=l==="y"?Db:Fb,v=l==="y"?jS:GS,w=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],S=o[l]-t.rects.reference[l],I=ole(s),R=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,L=w/2-S/2,k=h[m],B=R-p[c]-h[v],$=R/2-p[c]/2+L,V=rre(k,$,B),Y=l;t.modifiersData[r]=(e={},e[Y]=V,e.centerOffset=V-$,e)}}function oRr(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Z$t(e.elements.popper,n)&&(e.elements.arrow=n))}var aRr={name:"arrow",enabled:!0,phase:"main",fn:sRr,effect:oRr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function cq(i){return i.split("-")[1]}var lRr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uRr(i){var e=i.x,t=i.y,r=window,n=r.devicePixelRatio||1;return{x:lq(e*n)/n||0,y:lq(t*n)/n||0}}function ght(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,u=i.adaptive,c=i.roundOffsets,h=i.isFixed,p=c===!0?uRr(o):typeof c=="function"?c(o):o,m=p.x,v=m===void 0?0:m,w=p.y,S=w===void 0?0:w,I=o.hasOwnProperty("x"),R=o.hasOwnProperty("y"),L=Fb,k=Db,B=window;if(u){var $=ole(t),V="clientHeight",Y="clientWidth";if($===OE(t)&&($=sL(t),S3($).position!=="static"&&a==="absolute"&&(V="scrollHeight",Y="scrollWidth")),$=$,n===Db||(n===Fb||n===GS)&&s===Ese){k=jS;var K=h&&B.visualViewport?B.visualViewport.height:$[V];S-=K-r.height,S*=l?1:-1}if(n===Fb||(n===Db||n===jS)&&s===Ese){L=GS;var Q=h&&B.visualViewport?B.visualViewport.width:$[Y];v-=Q-r.width,v*=l?1:-1}}var re=Object.assign({position:a},u&&lRr);if(l){var ne;return Object.assign({},re,(ne={},ne[k]=R?"0":"",ne[L]=I?"0":"",ne.transform=(B.devicePixelRatio||1)<=1?"translate("+v+"px, "+S+"px)":"translate3d("+v+"px, "+S+"px, 0)",ne))}return Object.assign({},re,(e={},e[k]=R?S+"px":"",e[L]=I?v+"px":"",e.transform="",e))}function cRr(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,u={placement:JA(e.placement),variation:cq(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ght(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ght(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var hRr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:cRr,data:{}},Qhe={passive:!0};function dRr(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=OE(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&u.forEach(function(c){c.addEventListener("scroll",t.update,Qhe)}),a&&l.addEventListener("resize",t.update,Qhe),function(){s&&u.forEach(function(c){c.removeEventListener("scroll",t.update,Qhe)}),a&&l.removeEventListener("resize",t.update,Qhe)}}var pRr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dRr,data:{}},fRr={left:"right",right:"left",bottom:"top",top:"bottom"};function Oge(i){return i.replace(/left|right|bottom|top/g,function(e){return fRr[e]})}var mRr={start:"end",end:"start"};function yht(i){return i.replace(/start|end/g,function(e){return mRr[e]})}function fYe(i){var e=OE(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function mYe(i){return uq(sL(i)).left+fYe(i).scrollLeft}function gRr(i){var e=OE(i),t=sL(i),r=e.visualViewport,n=t.clientWidth,s=t.clientHeight,o=0,a=0;return r&&(n=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:n,height:s,x:o+mYe(i),y:a}}function yRr(i){var e,t=sL(i),r=fYe(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=c9(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=c9(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+mYe(i),l=-r.scrollTop;return S3(n||t).direction==="rtl"&&(a+=c9(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function gYe(i){var e=S3(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function i6t(i){return["html","body","#document"].indexOf(x3(i))>=0?i.ownerDocument.body:ES(i)&&gYe(i)?i:i6t(pTe(i))}function nre(i,e){var t;e===void 0&&(e=[]);var r=i6t(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=OE(r),o=n?[s].concat(s.visualViewport||[],gYe(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(nre(pTe(o)))}function B$e(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function vRr(i){var e=uq(i);return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function vht(i,e){return e===Y$t?B$e(gRr(i)):aq(e)?vRr(e):B$e(yRr(sL(i)))}function _Rr(i){var e=nre(pTe(i)),t=["absolute","fixed"].indexOf(S3(i).position)>=0,r=t&&ES(i)?ole(i):i;return aq(r)?e.filter(function(n){return aq(n)&&Z$t(n,r)&&x3(n)!=="body"&&(t?S3(n).position!=="static":!0)}):[]}function bRr(i,e,t){var r=e==="clippingParents"?_Rr(i):[].concat(e),n=[].concat(r,[t]),s=n[0],o=n.reduce(function(a,l){var u=vht(i,l);return a.top=c9(u.top,a.top),a.right=E_e(u.right,a.right),a.bottom=E_e(u.bottom,a.bottom),a.left=c9(u.left,a.left),a},vht(i,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function r6t(i){var e=i.reference,t=i.element,r=i.placement,n=r?JA(r):null,s=r?cq(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case Db:l={x:o,y:e.y-t.height};break;case jS:l={x:o,y:e.y+e.height};break;case GS:l={x:e.x+e.width,y:a};break;case Fb:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var u=n?pYe(n):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case oq:l[u]=l[u]-(e[c]/2-t[c]/2);break;case Ese:l[u]=l[u]+(e[c]/2-t[c]/2);break}}return l}function Ise(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.boundary,o=s===void 0?GPr:s,a=t.rootBoundary,l=a===void 0?Y$t:a,u=t.elementContext,c=u===void 0?QJ:u,h=t.altBoundary,p=h===void 0?!1:h,m=t.padding,v=m===void 0?0:m,w=e6t(typeof v!="number"?v:t6t(v,sle)),S=c===QJ?UPr:QJ,I=i.rects.popper,R=i.elements[p?S:c],L=bRr(aq(R)?R:R.contextElement||sL(i.elements.popper),o,l),k=uq(i.elements.reference),B=r6t({reference:k,element:I,strategy:"absolute",placement:n}),$=B$e(Object.assign({},I,B)),V=c===QJ?$:k,Y={top:L.top-V.top+w.top,bottom:V.bottom-L.bottom+w.bottom,left:L.left-V.left+w.left,right:V.right-L.right+w.right},K=i.modifiersData.offset;if(c===QJ&&K){var Q=K[n];Object.keys(Y).forEach(function(re){var ne=[GS,jS].indexOf(re)>=0?1:-1,de=[Db,jS].indexOf(re)>=0?"y":"x";Y[re]+=Q[de]*ne})}return Y}function wRr(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?X$t:l,c=cq(r),h=c?a?fht:fht.filter(function(v){return cq(v)===c}):sle,p=h.filter(function(v){return u.indexOf(v)>=0});p.length===0&&(p=h);var m=p.reduce(function(v,w){return v[w]=Ise(i,{placement:w,boundary:n,rootBoundary:s,padding:o})[JA(w)],v},{});return Object.keys(m).sort(function(v,w){return m[v]-m[w]})}function xRr(i){if(JA(i)===hYe)return[];var e=Oge(i);return[yht(i),e,yht(e)]}function SRr(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,h=t.rootBoundary,p=t.altBoundary,m=t.flipVariations,v=m===void 0?!0:m,w=t.allowedAutoPlacements,S=e.options.placement,I=JA(S),R=I===S,L=l||(R||!v?[Oge(S)]:xRr(S)),k=[S].concat(L).reduce(function(Ve,$e){return Ve.concat(JA($e)===hYe?wRr(e,{placement:$e,boundary:c,rootBoundary:h,padding:u,flipVariations:v,allowedAutoPlacements:w}):$e)},[]),B=e.rects.reference,$=e.rects.popper,V=new Map,Y=!0,K=k[0],Q=0;Q=0,H=pe?"width":"height",Z=Ise(e,{placement:re,boundary:c,rootBoundary:h,altBoundary:p,padding:u}),ae=pe?de?GS:Fb:de?jS:Db;B[H]>$[H]&&(ae=Oge(ae));var fe=Oge(ae),be=[];if(s&&be.push(Z[ne]<=0),a&&be.push(Z[ae]<=0,Z[fe]<=0),be.every(function(Ve){return Ve})){K=re,Y=!1;break}V.set(re,be)}if(Y)for(var _e=v?3:1,Ie=function($e){var tt=k.find(function(yt){var Ct=V.get(yt);if(Ct)return Ct.slice(0,$e).every(function(ot){return ot})});if(tt)return K=tt,"break"},Te=_e;Te>0;Te--){var Be=Ie(Te);if(Be==="break")break}e.placement!==K&&(e.modifiersData[r]._skip=!0,e.placement=K,e.reset=!0)}}var TRr={name:"flip",enabled:!0,phase:"main",fn:SRr,requiresIfExists:["offset"],data:{_skip:!1}};function _ht(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function bht(i){return[Db,GS,jS,Fb].some(function(e){return i[e]>=0})}function CRr(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Ise(e,{elementContext:"reference"}),a=Ise(e,{altBoundary:!0}),l=_ht(o,r),u=_ht(a,n,s),c=bht(l),h=bht(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}var ERr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:CRr};function IRr(i,e,t){var r=JA(i),n=[Fb,Db].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[Fb,GS].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function ARr(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=X$t.reduce(function(c,h){return c[h]=IRr(h,e.rects,s),c},{}),a=o[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=o}var MRr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ARr};function ORr(i){var e=i.state,t=i.name;e.modifiersData[t]=r6t({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var PRr={name:"popperOffsets",enabled:!0,phase:"read",fn:ORr,data:{}};function RRr(i){return i==="x"?"y":"x"}function DRr(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,h=t.padding,p=t.tether,m=p===void 0?!0:p,v=t.tetherOffset,w=v===void 0?0:v,S=Ise(e,{boundary:l,rootBoundary:u,padding:h,altBoundary:c}),I=JA(e.placement),R=cq(e.placement),L=!R,k=pYe(I),B=RRr(k),$=e.modifiersData.popperOffsets,V=e.rects.reference,Y=e.rects.popper,K=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,Q=typeof K=="number"?{mainAxis:K,altAxis:K}:Object.assign({mainAxis:0,altAxis:0},K),re=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ne={x:0,y:0};if($){if(s){var de,pe=k==="y"?Db:Fb,H=k==="y"?jS:GS,Z=k==="y"?"height":"width",ae=$[k],fe=ae+S[pe],be=ae-S[H],_e=m?-Y[Z]/2:0,Ie=R===oq?V[Z]:Y[Z],Te=R===oq?-Y[Z]:-V[Z],Be=e.elements.arrow,Ve=m&&Be?dYe(Be):{width:0,height:0},$e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Q$t(),tt=$e[pe],yt=$e[H],Ct=rre(0,V[Z],Ve[Z]),ot=L?V[Z]/2-_e-Ct-tt-Q.mainAxis:Ie-Ct-tt-Q.mainAxis,vt=L?-V[Z]/2+_e+Ct+yt+Q.mainAxis:Te+Ct+yt+Q.mainAxis,At=e.elements.arrow&&ole(e.elements.arrow),Je=At?k==="y"?At.clientTop||0:At.clientLeft||0:0,it=(de=re?.[k])!=null?de:0,Ue=ae+ot-it-Je,ct=ae+vt-it,st=rre(m?E_e(fe,Ue):fe,ae,m?c9(be,ct):be);$[k]=st,ne[k]=st-ae}if(a){var Ze,ye=k==="x"?Db:Fb,Ke=k==="x"?jS:GS,ke=$[B],me=B==="y"?"height":"width",ie=ke+S[ye],ge=ke-S[Ke],je=[Db,Fb].indexOf(I)!==-1,rt=(Ze=re?.[B])!=null?Ze:0,Me=je?ie:ke-V[me]-Y[me]-rt+Q.altAxis,ht=je?ke+V[me]+Y[me]-rt-Q.altAxis:ge,Ht=m&&je?rRr(Me,ke,ht):rre(m?Me:ie,ke,m?ht:ge);$[B]=Ht,ne[B]=Ht-ke}e.modifiersData[r]=ne}}var FRr={name:"preventOverflow",enabled:!0,phase:"main",fn:DRr,requiresIfExists:["offset"]};function kRr(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function LRr(i){return i===OE(i)||!ES(i)?fYe(i):kRr(i)}function NRr(i){var e=i.getBoundingClientRect(),t=lq(e.width)/i.offsetWidth||1,r=lq(e.height)/i.offsetHeight||1;return t!==1||r!==1}function $Rr(i,e,t){t===void 0&&(t=!1);var r=ES(e),n=ES(e)&&NRr(e),s=sL(e),o=uq(i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((x3(e)!=="body"||gYe(s))&&(a=LRr(e)),ES(e)?(l=uq(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=mYe(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function BRr(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function jRr(i){var e=BRr(i);return ZPr.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function GRr(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function URr(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var wht={placement:"bottom",modifiers:[],strategy:"absolute"};function xht(){for(var i=arguments.length,e=new Array(i),t=0;t-1}function u6t(i,e){return typeof i=="function"?i.apply(void 0,e):i}function Sht(i,e){if(e===0)return i;var t;return function(r){clearTimeout(t),t=setTimeout(function(){i(r)},e)}}function qRr(i,e){var t=Object.assign({},i);return e.forEach(function(r){delete t[r]}),t}function YRr(i){return i.split(/\s+/).filter(Boolean)}function L6(i){return[].concat(i)}function Tht(i,e){i.indexOf(e)===-1&&i.push(e)}function XRr(i){return i.filter(function(e,t){return i.indexOf(e)===t})}function c6t(i){return i.split("-")[0]}function hq(i){return[].slice.call(i)}function Cht(i){return Object.keys(i).reduce(function(e,t){return i[t]!==void 0&&(e[t]=i[t]),e},{})}function h9(){return document.createElement("div")}function fTe(i){return["Element","Fragment"].some(function(e){return yYe(i,e)})}function JRr(i){return yYe(i,"NodeList")}function vYe(i){return yYe(i,"MouseEvent")}function KRr(i){return!!(i&&i._tippy&&i._tippy.reference===i)}function ZRr(i){return fTe(i)?[i]:JRr(i)?hq(i):Array.isArray(i)?i:hq(document.querySelectorAll(i))}function tOe(i,e){i.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Ase(i,e){i.forEach(function(t){t&&t.setAttribute("data-state",e)})}function h6t(i){var e,t=L6(i),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function QRr(i,e){var t=e.clientX,r=e.clientY;return i.every(function(n){var s=n.popperRect,o=n.popperState,a=n.props,l=a.interactiveBorder,u=c6t(o.placement),c=o.modifiersData.offset;if(!c)return!0;var h=u==="bottom"?c.top.y:0,p=u==="top"?c.bottom.y:0,m=u==="right"?c.left.x:0,v=u==="left"?c.right.x:0,w=s.top-r+h>l,S=r-s.bottom-p>l,I=s.left-t+m>l,R=t-s.right-v>l;return w||S||I||R})}function iOe(i,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(n){i[r](n,t)})}function Eht(i,e){for(var t=e;t;){var r;if(i.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var aA={isTouch:!1},Iht=0;function eDr(){aA.isTouch||(aA.isTouch=!0,window.performance&&document.addEventListener("mousemove",d6t))}function d6t(){var i=performance.now();i-Iht<20&&(aA.isTouch=!1,document.removeEventListener("mousemove",d6t)),Iht=i}function tDr(){var i=document.activeElement;if(KRr(i)){var e=i._tippy;i.blur&&!e.state.isVisible&&i.blur()}}function iDr(){document.addEventListener("touchstart",eDr,p$),window.addEventListener("blur",tDr)}var rDr=typeof window<"u"&&typeof document<"u",nDr=rDr?!!window.msCrypto:!1,sDr={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},oDr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},jC=Object.assign({appendTo:l6t,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},sDr,oDr),aDr=Object.keys(jC),lDr=function(e){var t=Object.keys(e);t.forEach(function(r){jC[r]=e[r]})};function p6t(i){var e=i.plugins||[],t=e.reduce(function(r,n){var s=n.name,o=n.defaultValue;if(s){var a;r[s]=i[s]!==void 0?i[s]:(a=jC[s])!=null?a:o}return r},{});return Object.assign({},i,t)}function uDr(i,e){var t=e?Object.keys(p6t(Object.assign({},jC,{plugins:e}))):aDr,r=t.reduce(function(n,s){var o=(i.getAttribute("data-tippy-"+s)||"").trim();if(!o)return n;if(s==="content")n[s]=o;else try{n[s]=JSON.parse(o)}catch{n[s]=o}return n},{});return r}function Aht(i,e){var t=Object.assign({},e,{content:u6t(e.content,[i])},e.ignoreAttributes?{}:uDr(i,e.plugins));return t.aria=Object.assign({},jC.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var cDr=function(){return"innerHTML"};function j$e(i,e){i[cDr()]=e}function Mht(i){var e=h9();return i===!0?e.className=o6t:(e.className=a6t,fTe(i)?e.appendChild(i):j$e(e,i)),e}function Oht(i,e){fTe(e.content)?(j$e(i,""),i.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?j$e(i,e.content):i.textContent=e.content)}function I_e(i){var e=i.firstElementChild,t=hq(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(n6t)}),arrow:t.find(function(r){return r.classList.contains(o6t)||r.classList.contains(a6t)}),backdrop:t.find(function(r){return r.classList.contains(s6t)})}}function f6t(i){var e=h9(),t=h9();t.className=WRr,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=h9();r.className=n6t,r.setAttribute("data-state","hidden"),Oht(r,i.props),e.appendChild(t),t.appendChild(r),n(i.props,i.props);function n(s,o){var a=I_e(e),l=a.box,u=a.content,c=a.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Oht(u,i.props),o.arrow?c?s.arrow!==o.arrow&&(l.removeChild(c),l.appendChild(Mht(o.arrow))):l.appendChild(Mht(o.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:n}}f6t.$$tippy=!0;var hDr=1,ede=[],rOe=[];function dDr(i,e){var t=Aht(i,Object.assign({},jC,p6t(Cht(e)))),r,n,s,o=!1,a=!1,l=!1,u=!1,c,h,p,m=[],v=Sht(Ue,t.interactiveDebounce),w,S=hDr++,I=null,R=XRr(t.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},k={id:S,reference:i,popper:h9(),popperInstance:I,props:t,state:L,plugins:R,clearDelayTimeouts:Me,setProps:ht,setContent:Ht,show:_t,hide:Fe,hideWithInteractivity:Yt,enable:je,disable:rt,unmount:A,destroy:ue};if(!t.render)return k;var B=t.render(k),$=B.popper,V=B.onUpdate;$.setAttribute("data-tippy-root",""),$.id="tippy-"+k.id,k.popper=$,i._tippy=k,$._tippy=k;var Y=R.map(function(G){return G.fn(k)}),K=i.hasAttribute("aria-expanded");return At(),_e(),ae(),fe("onCreate",[k]),t.showOnCreate&&ie(),$.addEventListener("mouseenter",function(){k.props.interactive&&k.state.isVisible&&k.clearDelayTimeouts()}),$.addEventListener("mouseleave",function(){k.props.interactive&&k.props.trigger.indexOf("mouseenter")>=0&&pe().addEventListener("mousemove",v)}),k;function Q(){var G=k.props.touch;return Array.isArray(G)?G:[G,0]}function re(){return Q()[0]==="hold"}function ne(){var G;return!!((G=k.props.render)!=null&&G.$$tippy)}function de(){return w||i}function pe(){var G=de().parentNode;return G?h6t(G):document}function H(){return I_e($)}function Z(G){return k.state.isMounted&&!k.state.isVisible||aA.isTouch||c&&c.type==="focus"?0:eOe(k.props.delay,G?0:1,jC.delay)}function ae(G){G===void 0&&(G=!1),$.style.pointerEvents=k.props.interactive&&!G?"":"none",$.style.zIndex=""+k.props.zIndex}function fe(G,E,_){if(_===void 0&&(_=!0),Y.forEach(function(b){b[G]&&b[G].apply(b,E)}),_){var g;(g=k.props)[G].apply(g,E)}}function be(){var G=k.props.aria;if(G.content){var E="aria-"+G.content,_=$.id,g=L6(k.props.triggerTarget||i);g.forEach(function(b){var C=b.getAttribute(E);if(k.state.isVisible)b.setAttribute(E,C?C+" "+_:_);else{var O=C&&C.replace(_,"").trim();O?b.setAttribute(E,O):b.removeAttribute(E)}})}}function _e(){if(!(K||!k.props.aria.expanded)){var G=L6(k.props.triggerTarget||i);G.forEach(function(E){k.props.interactive?E.setAttribute("aria-expanded",k.state.isVisible&&E===de()?"true":"false"):E.removeAttribute("aria-expanded")})}}function Ie(){pe().removeEventListener("mousemove",v),ede=ede.filter(function(G){return G!==v})}function Te(G){if(!(aA.isTouch&&(l||G.type==="mousedown"))){var E=G.composedPath&&G.composedPath()[0]||G.target;if(!(k.props.interactive&&Eht($,E))){if(L6(k.props.triggerTarget||i).some(function(_){return Eht(_,E)})){if(aA.isTouch||k.state.isVisible&&k.props.trigger.indexOf("click")>=0)return}else fe("onClickOutside",[k,G]);k.props.hideOnClick===!0&&(k.clearDelayTimeouts(),k.hide(),a=!0,setTimeout(function(){a=!1}),k.state.isMounted||tt())}}}function Be(){l=!0}function Ve(){l=!1}function $e(){var G=pe();G.addEventListener("mousedown",Te,!0),G.addEventListener("touchend",Te,p$),G.addEventListener("touchstart",Ve,p$),G.addEventListener("touchmove",Be,p$)}function tt(){var G=pe();G.removeEventListener("mousedown",Te,!0),G.removeEventListener("touchend",Te,p$),G.removeEventListener("touchstart",Ve,p$),G.removeEventListener("touchmove",Be,p$)}function yt(G,E){ot(G,function(){!k.state.isVisible&&$.parentNode&&$.parentNode.contains($)&&E()})}function Ct(G,E){ot(G,E)}function ot(G,E){var _=H().box;function g(b){b.target===_&&(iOe(_,"remove",g),E())}if(G===0)return E();iOe(_,"remove",h),iOe(_,"add",g),h=g}function vt(G,E,_){_===void 0&&(_=!1);var g=L6(k.props.triggerTarget||i);g.forEach(function(b){b.addEventListener(G,E,_),m.push({node:b,eventType:G,handler:E,options:_})})}function At(){re()&&(vt("touchstart",it,{passive:!0}),vt("touchend",ct,{passive:!0})),YRr(k.props.trigger).forEach(function(G){if(G!=="manual")switch(vt(G,it),G){case"mouseenter":vt("mouseleave",ct);break;case"focus":vt(nDr?"focusout":"blur",st);break;case"focusin":vt("focusout",st);break}})}function Je(){m.forEach(function(G){var E=G.node,_=G.eventType,g=G.handler,b=G.options;E.removeEventListener(_,g,b)}),m=[]}function it(G){var E,_=!1;if(!(!k.state.isEnabled||Ze(G)||a)){var g=((E=c)==null?void 0:E.type)==="focus";c=G,w=G.currentTarget,_e(),!k.state.isVisible&&vYe(G)&&ede.forEach(function(b){return b(G)}),G.type==="click"&&(k.props.trigger.indexOf("mouseenter")<0||o)&&k.props.hideOnClick!==!1&&k.state.isVisible?_=!0:ie(G),G.type==="click"&&(o=!_),_&&!g&&ge(G)}}function Ue(G){var E=G.target,_=de().contains(E)||$.contains(E);if(!(G.type==="mousemove"&&_)){var g=me().concat($).map(function(b){var C,O=b._tippy,F=(C=O.popperInstance)==null?void 0:C.state;return F?{popperRect:b.getBoundingClientRect(),popperState:F,props:t}:null}).filter(Boolean);QRr(g,G)&&(Ie(),ge(G))}}function ct(G){var E=Ze(G)||k.props.trigger.indexOf("click")>=0&&o;if(!E){if(k.props.interactive){k.hideWithInteractivity(G);return}ge(G)}}function st(G){k.props.trigger.indexOf("focusin")<0&&G.target!==de()||k.props.interactive&&G.relatedTarget&&$.contains(G.relatedTarget)||ge(G)}function Ze(G){return aA.isTouch?re()!==G.type.indexOf("touch")>=0:!1}function ye(){Ke();var G=k.props,E=G.popperOptions,_=G.placement,g=G.offset,b=G.getReferenceClientRect,C=G.moveTransition,O=ne()?I_e($).arrow:null,F=b?{getBoundingClientRect:b,contextElement:b.contextElement||de()}:i,N={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var J=q.state;if(ne()){var ee=H(),he=ee.box;["placement","reference-hidden","escaped"].forEach(function(Ee){Ee==="placement"?he.setAttribute("data-placement",J.placement):J.attributes.popper["data-popper-"+Ee]?he.setAttribute("data-"+Ee,""):he.removeAttribute("data-"+Ee)}),J.attributes.popper={}}}},j=[{name:"offset",options:{offset:g}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!C}},N];ne()&&O&&j.push({name:"arrow",options:{element:O,padding:3}}),j.push.apply(j,E?.modifiers||[]),k.popperInstance=HRr(F,$,Object.assign({},E,{placement:_,onFirstUpdate:p,modifiers:j}))}function Ke(){k.popperInstance&&(k.popperInstance.destroy(),k.popperInstance=null)}function ke(){var G=k.props.appendTo,E,_=de();k.props.interactive&&G===l6t||G==="parent"?E=_.parentNode:E=u6t(G,[_]),E.contains($)||E.appendChild($),k.state.isMounted=!0,ye()}function me(){return hq($.querySelectorAll("[data-tippy-root]"))}function ie(G){k.clearDelayTimeouts(),G&&fe("onTrigger",[k,G]),$e();var E=Z(!0),_=Q(),g=_[0],b=_[1];aA.isTouch&&g==="hold"&&b&&(E=b),E?r=setTimeout(function(){k.show()},E):k.show()}function ge(G){if(k.clearDelayTimeouts(),fe("onUntrigger",[k,G]),!k.state.isVisible){tt();return}if(!(k.props.trigger.indexOf("mouseenter")>=0&&k.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(G.type)>=0&&o)){var E=Z(!1);E?n=setTimeout(function(){k.state.isVisible&&k.hide()},E):s=requestAnimationFrame(function(){k.hide()})}}function je(){k.state.isEnabled=!0}function rt(){k.hide(),k.state.isEnabled=!1}function Me(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(s)}function ht(G){if(!k.state.isDestroyed){fe("onBeforeUpdate",[k,G]),Je();var E=k.props,_=Aht(i,Object.assign({},E,Cht(G),{ignoreAttributes:!0}));k.props=_,At(),E.interactiveDebounce!==_.interactiveDebounce&&(Ie(),v=Sht(Ue,_.interactiveDebounce)),E.triggerTarget&&!_.triggerTarget?L6(E.triggerTarget).forEach(function(g){g.removeAttribute("aria-expanded")}):_.triggerTarget&&i.removeAttribute("aria-expanded"),_e(),ae(),V&&V(E,_),k.popperInstance&&(ye(),me().forEach(function(g){requestAnimationFrame(g._tippy.popperInstance.forceUpdate)})),fe("onAfterUpdate",[k,G])}}function Ht(G){k.setProps({content:G})}function _t(){var G=k.state.isVisible,E=k.state.isDestroyed,_=!k.state.isEnabled,g=aA.isTouch&&!k.props.touch,b=eOe(k.props.duration,0,jC.duration);if(!(G||E||_||g)&&!de().hasAttribute("disabled")&&(fe("onShow",[k],!1),k.props.onShow(k)!==!1)){if(k.state.isVisible=!0,ne()&&($.style.visibility="visible"),ae(),$e(),k.state.isMounted||($.style.transition="none"),ne()){var C=H(),O=C.box,F=C.content;tOe([O,F],0)}p=function(){var j;if(!(!k.state.isVisible||u)){if(u=!0,$.offsetHeight,$.style.transition=k.props.moveTransition,ne()&&k.props.animation){var W=H(),q=W.box,J=W.content;tOe([q,J],b),Ase([q,J],"visible")}be(),_e(),Tht(rOe,k),(j=k.popperInstance)==null||j.forceUpdate(),fe("onMount",[k]),k.props.animation&&ne()&&Ct(b,function(){k.state.isShown=!0,fe("onShown",[k])})}},ke()}}function Fe(){var G=!k.state.isVisible,E=k.state.isDestroyed,_=!k.state.isEnabled,g=eOe(k.props.duration,1,jC.duration);if(!(G||E||_)&&(fe("onHide",[k],!1),k.props.onHide(k)!==!1)){if(k.state.isVisible=!1,k.state.isShown=!1,u=!1,o=!1,ne()&&($.style.visibility="hidden"),Ie(),tt(),ae(!0),ne()){var b=H(),C=b.box,O=b.content;k.props.animation&&(tOe([C,O],g),Ase([C,O],"hidden"))}be(),_e(),k.props.animation?ne()&&yt(g,k.unmount):k.unmount()}}function Yt(G){pe().addEventListener("mousemove",v),Tht(ede,v),v(G)}function A(){k.state.isVisible&&k.hide(),k.state.isMounted&&(Ke(),me().forEach(function(G){G._tippy.unmount()}),$.parentNode&&$.parentNode.removeChild($),rOe=rOe.filter(function(G){return G!==k}),k.state.isMounted=!1,fe("onHidden",[k]))}function ue(){k.state.isDestroyed||(k.clearDelayTimeouts(),k.unmount(),Je(),delete i._tippy,k.state.isDestroyed=!0,fe("onDestroy",[k]))}}function Co(i,e){e===void 0&&(e={});var t=jC.plugins.concat(e.plugins||[]);iDr();var r=Object.assign({},e,{plugins:t}),n=ZRr(i),s=n.reduce(function(o,a){var l=a&&dDr(a,r);return l&&o.push(l),o},[]);return fTe(i)?s[0]:s}Co.defaultProps=jC;Co.setDefaultProps=lDr;Co.currentInput=aA;var pDr=Object.assign({},K$t,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),fDr=function(e,t){var r;t===void 0&&(t={});var n=e,s=[],o=[],a,l=t.overrides,u=[],c=!1;function h(){o=n.map(function(k){return L6(k.props.triggerTarget||k.reference)}).reduce(function(k,B){return k.concat(B)},[])}function p(){s=n.map(function(k){return k.reference})}function m(k){n.forEach(function(B){k?B.enable():B.disable()})}function v(k){return n.map(function(B){var $=B.setProps;return B.setProps=function(V){$(V),B.reference===a&&k.setProps(V)},function(){B.setProps=$}})}function w(k,B){var $=o.indexOf(B);if(B!==a){a=B;var V=(l||[]).concat("content").reduce(function(Y,K){return Y[K]=n[$].props[K],Y},{});k.setProps(Object.assign({},V,{getReferenceClientRect:typeof V.getReferenceClientRect=="function"?V.getReferenceClientRect:function(){var Y;return(Y=s[$])==null?void 0:Y.getBoundingClientRect()}}))}}m(!1),p(),h();var S={fn:function(){return{onDestroy:function(){m(!0)},onHidden:function(){a=null},onClickOutside:function($){$.props.showOnCreate&&!c&&(c=!0,a=null)},onShow:function($){$.props.showOnCreate&&!c&&(c=!0,w($,s[0]))},onTrigger:function($,V){w($,V.currentTarget)}}}},I=Co(h9(),Object.assign({},qRr(t,["overrides"]),{plugins:[S].concat(t.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((r=t.popperOptions)==null?void 0:r.modifiers)||[],[pDr])})})),R=I.show;I.show=function(k){if(R(),!a&&k==null)return w(I,s[0]);if(!(a&&k==null)){if(typeof k=="number")return s[k]&&w(I,s[k]);if(n.indexOf(k)>=0){var B=k.reference;return w(I,B)}if(s.indexOf(k)>=0)return w(I,k)}},I.showNext=function(){var k=s[0];if(!a)return I.show(0);var B=s.indexOf(a);I.show(s[B+1]||k)},I.showPrevious=function(){var k=s[s.length-1];if(!a)return I.show(k);var B=s.indexOf(a),$=s[B-1]||k;I.show($)};var L=I.setProps;return I.setProps=function(k){l=k.overrides||l,L(k)},I.setInstances=function(k){m(!0),u.forEach(function(B){return B()}),n=k,m(!1),p(),h(),u=v(I),I.setProps({triggerTarget:o})},u=v(I),I},mDr={name:"animateFill",defaultValue:!1,fn:function(e){var t;if(!((t=e.props.render)!=null&&t.$$tippy))return{};var r=I_e(e.popper),n=r.box,s=r.content,o=e.props.animateFill?gDr():null;return{onCreate:function(){o&&(n.insertBefore(o,n.firstElementChild),n.setAttribute("data-animatefill",""),n.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var l=n.style.transitionDuration,u=Number(l.replace("ms",""));s.style.transitionDelay=Math.round(u/10)+"ms",o.style.transitionDuration=l,Ase([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&Ase([o],"hidden")}}}};function gDr(){var i=h9();return i.className=s6t,Ase([i],"hidden"),i}var G$e={clientX:0,clientY:0},tde=[];function m6t(i){var e=i.clientX,t=i.clientY;G$e={clientX:e,clientY:t}}function yDr(i){i.addEventListener("mousemove",m6t)}function vDr(i){i.removeEventListener("mousemove",m6t)}var _Dr={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,r=h6t(e.props.triggerTarget||t),n=!1,s=!1,o=!0,a=e.props;function l(){return e.props.followCursor==="initial"&&e.state.isVisible}function u(){r.addEventListener("mousemove",p)}function c(){r.removeEventListener("mousemove",p)}function h(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function p(w){var S=w.target?t.contains(w.target):!0,I=e.props.followCursor,R=w.clientX,L=w.clientY,k=t.getBoundingClientRect(),B=R-k.left,$=L-k.top;(S||!e.props.interactive)&&e.setProps({getReferenceClientRect:function(){var Y=t.getBoundingClientRect(),K=R,Q=L;I==="initial"&&(K=Y.left+B,Q=Y.top+$);var re=I==="horizontal"?Y.top:Q,ne=I==="vertical"?Y.right:K,de=I==="horizontal"?Y.bottom:Q,pe=I==="vertical"?Y.left:K;return{width:ne-pe,height:de-re,top:re,right:ne,bottom:de,left:pe}}})}function m(){e.props.followCursor&&(tde.push({instance:e,doc:r}),yDr(r))}function v(){tde=tde.filter(function(w){return w.instance!==e}),tde.filter(function(w){return w.doc===r}).length===0&&vDr(r)}return{onCreate:m,onDestroy:v,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(S,I){var R=I.followCursor;n||R!==void 0&&a.followCursor!==R&&(v(),R?(m(),e.state.isMounted&&!s&&!l()&&u()):(c(),h()))},onMount:function(){e.props.followCursor&&!s&&(o&&(p(G$e),o=!1),l()||u())},onTrigger:function(S,I){vYe(I)&&(G$e={clientX:I.clientX,clientY:I.clientY}),s=I.type==="focus"},onHidden:function(){e.props.followCursor&&(h(),c(),o=!0)}}}};function bDr(i,e){var t;return{popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat((((t=i.popperOptions)==null?void 0:t.modifiers)||[]).filter(function(r){var n=r.name;return n!==e.name}),[e])})}}var wDr={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t=e.reference;function r(){return!!e.props.inlinePositioning}var n,s=-1,o=!1,a=[],l={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(m){var v=m.state;r()&&(a.indexOf(v.placement)!==-1&&(a=[]),n!==v.placement&&a.indexOf(v.placement)===-1&&(a.push(v.placement),e.setProps({getReferenceClientRect:function(){return u(v.placement)}})),n=v.placement)}};function u(p){return xDr(c6t(p),t.getBoundingClientRect(),hq(t.getClientRects()),s)}function c(p){o=!0,e.setProps(p),o=!1}function h(){o||c(bDr(e.props,l))}return{onCreate:h,onAfterUpdate:h,onTrigger:function(m,v){if(vYe(v)){var w=hq(e.reference.getClientRects()),S=w.find(function(R){return R.left-2<=v.clientX&&R.right+2>=v.clientX&&R.top-2<=v.clientY&&R.bottom+2>=v.clientY}),I=w.indexOf(S);s=I>-1?I:s}},onHidden:function(){s=-1}}}};function xDr(i,e,t,r){if(t.length<2||i===null)return e;if(t.length===2&&r>=0&&t[0].left>t[1].right)return t[r]||e;switch(i){case"top":case"bottom":{var n=t[0],s=t[t.length-1],o=i==="top",a=n.top,l=s.bottom,u=o?n.left:s.left,c=o?n.right:s.right,h=c-u,p=l-a;return{top:a,bottom:l,left:u,right:c,width:h,height:p}}case"left":case"right":{var m=Math.min.apply(Math,t.map(function($){return $.left})),v=Math.max.apply(Math,t.map(function($){return $.right})),w=t.filter(function($){return i==="left"?$.left===m:$.right===v}),S=w[0].top,I=w[w.length-1].bottom,R=m,L=v,k=L-R,B=I-S;return{top:S,bottom:I,left:R,right:L,width:k,height:B}}default:return e}}var SDr={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,r=e.popper;function n(){return e.popperInstance?e.popperInstance.state.elements.reference:t}function s(u){return e.props.sticky===!0||e.props.sticky===u}var o=null,a=null;function l(){var u=s("reference")?n().getBoundingClientRect():null,c=s("popper")?r.getBoundingClientRect():null;(u&&Pht(o,u)||c&&Pht(a,c))&&e.popperInstance&&e.popperInstance.update(),o=u,a=c,e.state.isMounted&&requestAnimationFrame(l)}return{onMount:function(){e.props.sticky&&l()}}}};function Pht(i,e){return i&&e?i.top!==e.top||i.right!==e.right||i.bottom!==e.bottom||i.left!==e.left:!0}Co.setDefaultProps({render:f6t});Co.setDefaultProps({onShow:i=>{if(!i.props.content)return!1}});function _Ye(i,e={},t={mount:!0,appName:"Tippy"}){t=Object.assign({mount:!0,appName:"Tippy"},t);const r=Df(),n=vi(),s=vi({isEnabled:!1,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1}),o=qae();let a=null;const l=()=>a||(a=document.createDocumentFragment(),a),u=V=>{let Y,K=Wu(V)?V.value:V;return _3(K)?(o.value||(o.value=YW({name:t.appName,setup:()=>()=>Wu(V)?V.value:V}),r&&Object.assign(o.value._context,r.appContext),o.value.mount(l())),Y=()=>l()):typeof K=="object"?(o.value||(o.value=YW({name:t.appName,setup:()=>()=>dx(Wu(V)?V.value:V)}),r&&Object.assign(o.value._context,r.appContext),o.value.mount(l())),Y=()=>l()):Y=K,Y},c=V=>{let Y={};return Wu(V)?Y=V.value||{}:TS(V)?Y={...V}:Y={...V},Y.content&&(Y.content=u(Y.content)),Y.triggerTarget&&(Y.triggerTarget=Wu(Y.triggerTarget)?Y.triggerTarget.value:Y.triggerTarget),(!Y.plugins||!Array.isArray(Y.plugins))&&(Y.plugins=[]),Y.plugins=Y.plugins.filter(K=>K.name!=="vueTippyReactiveState"),Y.plugins.push({name:"vueTippyReactiveState",fn:()=>({onCreate(){s.value.isEnabled=!0},onMount(){s.value.isMounted=!0},onShow(){s.value.isMounted=!0,s.value.isVisible=!0},onShown(){s.value.isShown=!0},onHide(){s.value.isMounted=!1,s.value.isVisible=!1},onHidden(){s.value.isShown=!1},onUnmounted(){s.value.isMounted=!1},onDestroy(){s.value.isDestroyed=!0}})}),Y},h=()=>{n.value&&n.value.setProps(c(e))},p=()=>{!n.value||!e.content||n.value.setContent(u(e.content))},m=V=>{var Y;(Y=n.value)===null||Y===void 0||Y.setContent(u(V))},v=V=>{var Y;(Y=n.value)===null||Y===void 0||Y.setProps(c(V))},w=()=>{var V;n.value&&(n.value.destroy(),n.value=void 0),a=null,(V=o.value)===null||V===void 0||V.unmount(),o.value=void 0},S=()=>{var V;(V=n.value)===null||V===void 0||V.show()},I=()=>{var V;(V=n.value)===null||V===void 0||V.hide()},R=()=>{var V;(V=n.value)===null||V===void 0||V.disable(),s.value.isEnabled=!1},L=()=>{var V;(V=n.value)===null||V===void 0||V.enable(),s.value.isEnabled=!0},k=()=>{var V;(V=n.value)===null||V===void 0||V.unmount()},B=()=>{if(!i)return;let V=Wu(i)?i.value:i;typeof V=="function"&&(V=V()),V&&(n.value=Co(V,c(e)),V.$tippy=$)},$={tippy:n,refresh:h,refreshContent:p,setContent:m,setProps:v,destroy:w,hide:I,show:S,disable:R,enable:L,unmount:k,mount:B,state:s};return t.mount&&(r?r.isMounted?B():Fa(B):B()),r&&s7(()=>{w()}),Wu(e)||TS(e)?rl(e,h,{immediate:!1}):Wu(e.content)&&rl(e.content,p,{immediate:!1}),$}function TDr(i,e){const t=vi();return Fa(()=>{const n=(Array.isArray(i)?i.map(s=>s.value):typeof i=="function"?i():i.value).map(s=>s instanceof Element?s._tippy:s).filter(Boolean);t.value=fDr(n,e?{allowHTML:!0,...e}:{allowHTML:!0})}),{singleton:t}}function CDr(i){return typeof i=="function"?i():ri(i)}function EDr(i){var e,t;const r=CDr(i);return(t=(e=r)===null||e===void 0?void 0:e.$el)!==null&&t!==void 0?t:r}const IDr=Xr({props:{to:{type:[String,Function]},tag:{type:[String,Object],default:"span"},contentTag:{type:[String,Object],default:"span"},contentClass:{type:String,default:null},appendTo:{default:()=>Co.defaultProps.appendTo},aria:{default:()=>Co.defaultProps.aria},delay:{default:()=>Co.defaultProps.delay},duration:{default:()=>Co.defaultProps.duration},getReferenceClientRect:{default:()=>Co.defaultProps.getReferenceClientRect},hideOnClick:{type:[Boolean,String],default:()=>Co.defaultProps.hideOnClick},ignoreAttributes:{type:Boolean,default:()=>Co.defaultProps.ignoreAttributes},interactive:{type:Boolean,default:()=>Co.defaultProps.interactive},interactiveBorder:{default:()=>Co.defaultProps.interactiveBorder},interactiveDebounce:{default:()=>Co.defaultProps.interactiveDebounce},moveTransition:{default:()=>Co.defaultProps.moveTransition},offset:{default:()=>Co.defaultProps.offset},onAfterUpdate:{default:()=>Co.defaultProps.onAfterUpdate},onBeforeUpdate:{default:()=>Co.defaultProps.onBeforeUpdate},onCreate:{default:()=>Co.defaultProps.onCreate},onDestroy:{default:()=>Co.defaultProps.onDestroy},onHidden:{default:()=>Co.defaultProps.onHidden},onHide:{default:()=>Co.defaultProps.onHide},onMount:{default:()=>Co.defaultProps.onMount},onShow:{default:()=>Co.defaultProps.onShow},onShown:{default:()=>Co.defaultProps.onShown},onTrigger:{default:()=>Co.defaultProps.onTrigger},onUntrigger:{default:()=>Co.defaultProps.onUntrigger},onClickOutside:{default:()=>Co.defaultProps.onClickOutside},placement:{default:()=>Co.defaultProps.placement},plugins:{default:()=>Co.defaultProps.plugins},popperOptions:{default:()=>Co.defaultProps.popperOptions},render:{default:()=>Co.defaultProps.render},showOnCreate:{type:Boolean,default:()=>Co.defaultProps.showOnCreate},touch:{type:[Boolean,String,Array],default:()=>Co.defaultProps.touch},trigger:{default:()=>Co.defaultProps.trigger},triggerTarget:{default:()=>Co.defaultProps.triggerTarget},animateFill:{type:Boolean,default:()=>Co.defaultProps.animateFill},followCursor:{type:[Boolean,String],default:()=>Co.defaultProps.followCursor},inlinePositioning:{type:Boolean,default:()=>Co.defaultProps.inlinePositioning},sticky:{type:[Boolean,String],default:()=>Co.defaultProps.sticky},allowHTML:{type:Boolean,default:()=>Co.defaultProps.allowHTML},animation:{default:()=>Co.defaultProps.animation},arrow:{default:()=>Co.defaultProps.arrow},content:{default:()=>Co.defaultProps.content},inertia:{default:()=>Co.defaultProps.inertia},maxWidth:{default:()=>Co.defaultProps.maxWidth},role:{default:()=>Co.defaultProps.role},theme:{default:()=>Co.defaultProps.theme},zIndex:{default:()=>Co.defaultProps.zIndex}},emits:["state"],setup(i,{slots:e,emit:t,expose:r}){const n=vi(),s=vi(),o=vi(),a=vi(!1),l=()=>{let m={...i};for(const v of["to","tag","contentTag","contentClass"])m.hasOwnProperty(v)&&delete m[v];return m};let u=()=>EDr(n);i.to&&(typeof Element<"u"&&i.to instanceof Element?u=()=>i.to:i.to==="parent"?u=()=>{let m=n.value;return m||(m=n.value=s.value.parentElement),m}:(typeof i.to=="string"||i.to instanceof String)&&(u=()=>document.querySelector(i.to)));const c=_Ye(u,l());let h=e.content;!h&&i.to==="parent"&&(h=e.default),Fa(()=>{a.value=!0,Bv(()=>{h&&c.setContent(()=>o.value)})}),rl(c.state,()=>{t("state",ri(c.state))},{immediate:!0,deep:!0}),rl(()=>i,()=>{c.setProps(l()),h&&c.setContent(()=>o.value)},{deep:!0});let p=Zl({elem:n,contentElem:o,mounted:a,...c});return r(p),()=>{const m=(typeof i.contentTag=="string",i.contentTag),v=h?dx(m,{ref:o,style:{display:a.value?"inherit":"none"},class:i.contentClass},h(p)):null;if(i.to==="parent"){const I=[];if(!n.value){const R=dx("span",{ref:s,"data-v-tippy":"",style:{display:"none"}});I.push(R)}return v&&I.push(v),I}const w=e.default?e.default(p):[];if(!i.tag){const I=dx(w[0],{ref:n,"data-v-tippy":""});return v?[I,v]:I}const S=(typeof i.tag=="string",i.tag);return dx(S,{ref:n,"data-v-tippy":""},v?[w,v]:w)}}}),ADr=["a11y","allowHTML","arrow","flip","flipOnUpdate","hideOnClick","ignoreAttributes","inertia","interactive","lazy","multiple","showOnInit","touch","touchHold"];let U$e={};Object.keys(Co.defaultProps).forEach(i=>{ADr.includes(i)?U$e[i]={type:Boolean,default:function(){return Co.defaultProps[i]}}:U$e[i]={default:function(){return Co.defaultProps[i]}}});const MDr=Xr({props:U$e,setup(i){const e=vi([]),{singleton:t}=TDr(e,i);return{instances:e,singleton:t}},mounted(){var i;const t=this.$el.parentElement.querySelectorAll("[data-v-tippy]");this.instances=Array.from(t).map(r=>r._tippy).filter(Boolean),(i=this.singleton)===null||i===void 0||i.setInstances(this.instances)},render(){let i=this.$slots.default?this.$slots.default():[];return dx(()=>i)}}),ODr={mounted(i,e,t){const r=typeof e.value=="string"?{content:e.value}:e.value||{},n=Object.keys(e.modifiers||{}),s=n.find(a=>a!=="arrow"),o=n.findIndex(a=>a==="arrow")!==-1;s&&(r.placement=r.placement||s),o&&(r.arrow=r.arrow!==void 0?r.arrow:!0),t.props&&t.props.onTippyShow&&(r.onShow=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyShow(...a)}),t.props&&t.props.onTippyShown&&(r.onShown=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyShown(...a)}),t.props&&t.props.onTippyHidden&&(r.onHidden=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyHidden(...a)}),t.props&&t.props.onTippyHide&&(r.onHide=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyHide(...a)}),t.props&&t.props.onTippyMount&&(r.onMount=function(...a){var l;return(l=t.props)===null||l===void 0?void 0:l.onTippyMount(...a)}),i.getAttribute("title")&&!r.content&&(r.content=i.getAttribute("title"),i.removeAttribute("title")),i.getAttribute("content")&&!r.content&&(r.content=i.getAttribute("content")),_Ye(i,r)},unmounted(i){i.$tippy?i.$tippy.destroy():i._tippy&&i._tippy.destroy()},updated(i,e){const t=typeof e.value=="string"?{content:e.value}:e.value||{};i.getAttribute("title")&&!t.content&&(t.content=i.getAttribute("title"),i.removeAttribute("title")),i.getAttribute("content")&&!t.content&&(t.content=i.getAttribute("content")),i.$tippy?i.$tippy.setProps(t||{}):i._tippy&&i._tippy.setProps(t||{})}},PDr={install(i,e={}){Co.setDefaultProps(e.defaultProps||{}),i.directive(e.directive||"tippy",ODr),i.component(e.component||"tippy",IDr),i.component(e.componentSingleton||"tippy-singleton",MDr)}},g6t=Co.setDefaultProps;g6t({ignoreAttributes:!0,plugins:[SDr,wDr,_Dr,mDr]});const RDr=PDr,DDr=Xr({name:"App",components:{Shell:jPr},setup(){const i=Df();Fa(()=>{new O$t().observe(i?.proxy?.$refs["app-size"]),g6t({aria:{content:"labelledby"},theme:"ramp4",animation:"scale",inertia:!0,trigger:"mouseenter manual focus",touch:["hold",200],delay:[300,0],appendTo:()=>document.fullscreenElement||document.body})})}}),FDr=["lang"],kDr={class:"h-full",ref:"app-size"};function LDr(i,e,t,r,n,s){const o=Ko("shell");return qt(),si("div",{class:"ramp-app ramp-styles animation-enabled",lang:i.$i18n.locale},[Ot("div",kDr,[Vn(o)],512)],8,FDr)}const NDr=ml(DDr,[["render",LDr]]),lA="focus-list",ZL="focus-item",$Dr="focus-icon",BDr="focus-container",rH=`[${lA}],[${BDr}]`,ide="truncate-text",rde="show-truncate",Yz="focused",y6t=`button,input,select,a,textarea,[contenteditable],[${lA}],[${$Dr}]`,jDr={mounted(i,e){+i.getAttribute("tabindex")<=0&&i.setAttribute("tabindex","0"),i.toggleAttribute(lA,!0),new GDr(i,e.value)},updated(i){v6t(i)}};function v6t(i){i.querySelectorAll(y6t).forEach(t=>{if(t.closest(rH)===i||t.closest(rH)===t&&t.parentElement.closest(rH)===i)if(t.closest(`[${lA}],.${Yz}`).classList.contains(Yz))t.setAttribute("tabindex","0");else{t.setAttribute("tabindex","-1");return}})}class GDr{element;highlightedItem;isHorizontal;isClicked;isTapped;constructor(e,t){this.element=e,this.highlightedItem=this.element,this.isHorizontal=t==="horizontal",this.isClicked=!1,this.isTapped=!1,this.setTabIndex(-1),this.element.setAttribute("role","group");const r=this;e.addEventListener("keydown",function(n){r.onKeydown(n)}),e.addEventListener("click",function(n){r.onClick(n)}),e.addEventListener("focus",function(){r.onFocus()}),e.addEventListener("blur",function(){r.onBlur()}),e.addEventListener("mousedown",function(){r.onMousedown()}),e.addEventListener("touchstart",function(){r.onTouchstart()})}setTabIndex(e,t=this.element){t.querySelectorAll(y6t).forEach(n=>{(e===-1||n.closest(rH)===this.element||n.closest(rH)===n&&n.parentElement.closest(rH)===this.element||n.closest(`[${lA}],.${Yz}`).classList.contains(Yz))&&n.setAttribute("tabindex",e.toString())})}defocusItem(e){e.classList.remove(Yz),this.setTabIndex(-1,e),e._tippy&&e._tippy.hide(),e.getAttribute(ZL)===rde&&e.querySelector(`[${ide}]`)?._tippy?.hide()}focusItem(e){e.classList.add(Yz),this.setAriaActiveDescendant(e),this.setTabIndex(0,e),e.scrollIntoView({block:"nearest"}),e._tippy&&!this.isTapped&&e._tippy.show(),e.getAttribute(ZL)===rde&&e.querySelector(`[${ide}]`)?._tippy?.show(),this.isTapped=!1}setAriaActiveDescendant(e){this.element.setAttribute("aria-activedescendant",e.getAttribute("id"))}shiftHighlight(e,t=!1){if(this.defocusItem(this.highlightedItem),t)if(this.highlightedItem===this.element)this.highlightedItem=e[e.length-1];else{const r=Array.prototype.indexOf.call(e,this.highlightedItem);this.highlightedItem=e[r-1]||e[e.length-1]}else if(this.highlightedItem===this.element)this.highlightedItem=e[0];else{const r=Array.prototype.indexOf.call(e,this.highlightedItem);this.highlightedItem=e[r+1]||e[0]}this.element.focus(),this.focusItem(this.highlightedItem)}onKeydown(e){const t=this,r=Array.prototype.filter.call(this.element.querySelectorAll(`[${ZL}]`),n=>n.closest(`[${lA}]`)===t.element&&!!n.offsetParent);if(r.length!==0)switch(e.key){case"Up":case"ArrowUp":if(this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r,!0);break;case"Down":case"ArrowDown":if(this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r);break;case"Left":case"ArrowLeft":if(!this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r,!0);break;case"Right":case"ArrowRight":if(!this.isHorizontal)break;e.preventDefault(),e.stopPropagation(),this.shiftHighlight(r);break;case"Esc":case"Escape":this.highlightedItem!==this.element&&(e.preventDefault(),e.stopPropagation(),this.defocusItem(this.highlightedItem),this.highlightedItem=this.element,this.element.removeAttribute("aria-activedescendant"),this.element.focus());break;case"Enter":case" ":e.target===this.element&&this.highlightedItem!==this.element&&(e.preventDefault(),e.stopPropagation(),this.highlightedItem.click());break}}onClick(e){this.defocusItem(this.highlightedItem);let t=e.target;if(!t.hasAttribute(lA))for(;t.parentElement.closest(`[${lA}]`)!==this.element;)t=t.parentElement.closest(`[${lA}]`);this.highlightedItem=t.closest(`[${ZL}]`)||t.closest(`[${lA}]`)||this.highlightedItem,t.hasAttribute(`${ZL}`)&&this.element.focus(),this.highlightedItem!==this.element?this.focusItem(this.highlightedItem):this.element.removeAttribute("aria-activedescendant")}onFocus(){this.highlightedItem&&!this.isClicked&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.show(),this.highlightedItem.getAttribute(ZL)===rde&&this.highlightedItem.querySelector(`[${ide}]`)?._tippy?.show()),this.isClicked=!1,this.element.hasAttribute("aria-activedescendant")||this.highlightedItem===this.element||this.setAriaActiveDescendant(this.highlightedItem),v6t(this.element)}onBlur(){this.highlightedItem&&(this.highlightedItem._tippy&&this.highlightedItem._tippy.hide(),this.highlightedItem.getAttribute(ZL)===rde&&this.highlightedItem.querySelector(`[${ide}]`)?._tippy?.hide())}onMousedown(){this.isClicked=!0}onTouchstart(){this.isTapped=!0}}const Rht="focus-item",UDr={beforeMount(i,e){i.hasAttribute("id")||i.setAttribute("id",zDr()),e.value?i.setAttribute(Rht,e.value):i.toggleAttribute(Rht,!0)}};function zDr(){let i;do i="focus-item-"+Math.random().toString(36).substring(2,9);while(document.getElementById(i)!==null);return i}const bYe="focus-container",_6t="focus-list",VDr="focus-icon",nOe=`[${_6t}],[${bYe}]`,Dht=`button,input,select,a,textarea,[contenteditable],.ag-tab-guard,[${_6t}],[${bYe}],[${VDr}]`;let sOe=[];const HDr={mounted(i){[...document.querySelectorAll(".inner-shell")].some(t=>t.contains(i))&&sOe.push(new WDr(i))},beforeUnmount(i){sOe=sOe.filter(e=>e.element===i?(e.removeEventListeners(),!1):!0)}};class WDr{element;constructor(e){this.element=e,this.element.toggleAttribute(bYe,!0),this.element.tabIndex=0,this.disableTabbing();const t=this;this.element.addEventListener("keypress",function(r){t.onKeypress(r)}),this.element.addEventListener("click",function(){t.onClick()}),this.element.addEventListener("focusout",function(r){t.onFocusOut(r)}),this.element.addEventListener("focus",function(){t.onFocus()})}removeEventListeners(){const e=this;this.element.removeEventListener("keypress",function(t){e.onKeypress(t)}),this.element.removeEventListener("click",function(){e.onClick()}),this.element.removeEventListener("focusout",function(t){e.onFocusOut(t)}),this.element.removeEventListener("focus",function(){e.onFocus()})}onKeypress(e){e.target===this.element&&(e.key==="Enter"||e.key===" ")&&this.enableTabbing().focus()}onClick(){this.enableTabbing()}onFocusOut(e){this.element.contains(e.relatedTarget)||this.disableTabbing()}onFocus(){this.disableTabbing()}disableTabbing(){Array.prototype.filter.call(this.element.querySelectorAll(Dht),()=>!0).forEach(t=>{t.tabIndex=-1})}enableTabbing(){let e;return Array.prototype.map.call(this.element.querySelectorAll(Dht),t=>{(t.closest(nOe)===this.element||t.closest(nOe)===t&&t.parentElement.closest(nOe)===this.element)&&t.offsetParent&&(t.tabIndex=0,e===void 0&&(e=t))}),e}}const qDr="aaa1rp3barth4b_ott3vie4c1le2ogado5udhabi7c_ademy5centure6ountant_s9o1tor4d_s1ult4e_g1ro2tna4f_l1rica5g_akhan5ency5i_g1rbus3force5tel5kdn3l_faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m_azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o_l2partments8p_le4q_uarelle8r_ab1mco4chi3my2pa2t_e3s_da2ia2sociates9t_hleta5torney7u_ction5di_ble3o3spost5thor3o_s4vianca6w_s2x_a2z_ure5ba_by2idu3namex3narepublic11d1k2r_celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b_c1t1va3cg1n2d1e_ats2uty4er2ntley5rlin4st_buy5t2f1g1h_arti5i_ble3d1ke2ng_o3o1z2j1lack_friday9ockbuster8g1omberg7ue3m_s1w2n_pparibas9o_ats3ehringer8fa2m1nd2o_k_ing5sch2tik2on4t1utique6x2r_adesco6idgestone9oadway5ker3ther5ussels7s1t1uild_ers6siness6y1zz3v1w1y1z_h3ca_b1fe2l_l1vinklein9m_era3p2non3petown5ital_one8r_avan4ds2e_er_s4s2sa1e1h1ino4t_ering5holic7ba1n1re2s2c1d1enter4o1rn3f_a1d2g1h_anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i_priani6rcle4sco3tadel4i_c2y_eats7k1l_aims4eaning6ick2nic1que6othing5ud3ub_med6m1n1o_ach3des3ffee4llege4ogne5m_cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking_channel11l1p2rsica5untry4pon_s4rses6pa2r_edit_card4union9icket5own3s1uise_s6u_isinella9v1w1x1y_mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e_al_er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si_gn4v2hl2iamonds6et2gital5rect_ory7scount3ver5h2y2j1k1m1np2o_cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c_o2deka3u_cation8e1g1mail3erck5nergy4gineer_ing9terprises10pson4quipment8r_icsson6ni3s_q1tate5t_isalat7u_rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n_s2rm_ers5shion4t3edex3edback6rrari3ero6i_at2delity5o2lm2nal1nce1ial7re_stone6mdale6sh_ing5t_ness6j1k1lickr3ghts4r2orist4wers5y2m1o_o_d_network8tball6rd1ex2sale4um3undation8x2r_ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n_d2rniture7tbol5yi3ga_l_lery3o1up4me_s3p1rden4y2b_iz3d_n2e_a1nt_ing5orge5f1g_ee3h1i_ft_s3ves2ing5l_ass3e1obal2o4m_ail3bh2o1x2n1odaddy5ld_point6f2o_dyear5g_le4p1t1v2p1q1r_ainger5phics5tis4een3ipe3ocery4up4s1t1u_ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc_bank7ealth_care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k_t2m1n1ockey4ldings5iday5medepot5goods5s_ense7nda3rse3spital5t_ing5t_eles2s3mail5use3w2r1sbc3t1u_ghes5yatt3undai7ibm2cbc2e1u2d1e_ee3fm2kano4l1m_amat4db2mo_bilien9n_c1dustries8finiti5o2g1k1stitute6urance4e4t_ernational10uit4vestments10o1piranga7q1r_ish4s_maili5t_anbul7t_au2v3jaguar4va3cb2e_ep2tzt3welry6io2ll2m_p2nj2o_bs1urg4t1y2p_morgan6rs3uegos4niper7kaufen5ddi3e_rryhotels6logistics9properties14fh2g1h1i_a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p_mg2n2r_d1ed3uokgroup8w1y_oto4z2la_caixa5mborghini8er3ncaster5ia3d_rover6xess5salle5t_ino3robe5w_yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i_dl2fe_insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan_s3cker3us3l1ndon4tte1o3ve3pl_financial11r1s1t_d_a3u_ndbeck6xe1ury5v1y2ma_cys3drid4if1son4keup4n_agement7go3p1rket_ing3s4riott5shalls7serati6ttel5ba2c_kinsey7d1e_d_ia3et2lbourne7me1orial6n_u2rckmsd7g1h1iami3crosoft7l1ni1t2t_subishi9k1l_b1s2m_a2n1o_bi_le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to_rcycles9v_ie4p1q1r1s_d2t_n1r2u_seum3ic3tual5v1w1x1y1z2na_b1goya4me2tura4vy3ba2c1e_c1t_bank4flix4work5ustar5w_s2xt_direct7us4f_l2g_o2hk2i_co2ke1on3nja3ssan1y5l1o_kia3rthwesternmutual14on4w_ruz3tv4p1r_a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan_group9dnavy5lo3m_ega4ne1g1l_ine5oo2pen3racle3nge4g_anic5igins6saka4tsuka4t2vh3pa_ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e_t2f_izer5g1h_armacy6d1ilips5one2to_graphy6s4ysio5ics1tet2ures6d1n_g1k2oneer5zza4k1l_ace2y_station9umbing5s3m1n_c2ohl2ker3litie5rn2st3r_america6xi3ess3ime3o_d_uctions8f1gressive8mo2perties3y5tection8u_dential9s1t1ub2w_c2y2qa1pon3uebec3st5racing4dio4e_ad1lestate6tor2y4cipes5d_stone5umbrella9hab3ise_n3t2liance6n_t_als5pair3ort3ublican8st_aurant8view_s5xroth6ich_ardli6oh3l1o1p2o_cher3ks3deo3gers4om3s_vp3u_gby3hr2n2w_e2yukyu6sa_arland6fe_ty4kura4le1on3msclub4ung5ndvik_coromant12ofi4p1rl2s1ve2xo3b_i1s2c_a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e_arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x_y3fr2g1h_angrila6rp2w2ell3ia1ksha5oes2p_ping5uji3w_time7i_lk2na1gles5te3j1k_i_n2y_pe4l_ing4m_art3ile4n_cf3o_ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa_ce3ort2t3r_l2s1t_ada2ples4r1tebank4farm7c_group6ockholm6rage3e3ream4udio2y3yle4u_cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y_dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x_i3c_i2d_k2eam2ch_nology8l1masek5nnis4va3f1g1h_d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j_maxx4x2k_maxx5l1m_all4n1o_day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r_ade1ing4ining5vel_channel7ers_insurance16ust3v2t1ube2i1nes3shu4v_s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va_cations7na1guard7c1e_gas3ntures6risign5mögensberater2ung14sicherung10t2g1i_ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u_elos6wales2mart4ter4ng_gou5tch_es6eather_channel12bcam3er2site5d_ding5ibo2r3f1hoswho6ien2ki2lliamhill9n_dows4e1ners6me2olterskluwer11odside6rk_s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u_tube6t1un3za_ppos4ra3ero3ip2m1one3uerich6w2",YDr="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत_म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里_大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",dq=(i,e)=>{for(const t in e)i[t]=e[t];return i},z$e="numeric",V$e="ascii",H$e="alpha",Pge="asciinumeric",nde="alphanumeric",W$e="domain",b6t="emoji",XDr="scheme",JDr="slashscheme",Fht="whitespace";function KDr(i,e){return i in e||(e[i]=[]),e[i]}function _8(i,e,t){e[z$e]&&(e[Pge]=!0,e[nde]=!0),e[V$e]&&(e[Pge]=!0,e[H$e]=!0),e[Pge]&&(e[nde]=!0),e[H$e]&&(e[nde]=!0),e[nde]&&(e[W$e]=!0),e[b6t]&&(e[W$e]=!0);for(const r in e){const n=KDr(r,t);n.indexOf(i)<0&&n.push(i)}}function ZDr(i,e){const t={};for(const r in e)e[r].indexOf(i)>=0&&(t[r]=!0);return t}function rx(i){i===void 0&&(i=null),this.j={},this.jr=[],this.jd=null,this.t=i}rx.groups={};rx.prototype={accepts(){return!!this.t},go(i){const e=this,t=e.j[i];if(t)return t;for(let r=0;ri.ta(e,t,r,n),h2=(i,e,t,r,n)=>i.tr(e,t,r,n),kht=(i,e,t,r,n)=>i.ts(e,t,r,n),Ln=(i,e,t,r,n)=>i.tt(e,t,r,n),cO="WORD",q$e="UWORD",Mse="LOCALHOST",Y$e="TLD",X$e="UTLD",Rge="SCHEME",pU="SLASH_SCHEME",A_e="NUM",w6t="WS",wYe="NL",Xz="OPENBRACE",sre="OPENBRACKET",ore="OPENANGLEBRACKET",are="OPENPAREN",N6="CLOSEBRACE",Jz="CLOSEBRACKET",Kz="CLOSEANGLEBRACKET",$6="CLOSEPAREN",M_e="AMPERSAND",O_e="APOSTROPHE",P_e="ASTERISK",_5="AT",R_e="BACKSLASH",D_e="BACKTICK",F_e="CARET",G5="COLON",xYe="COMMA",k_e="DOLLAR",WI="DOT",L_e="EQUALS",SYe="EXCLAMATION",qI="HYPHEN",N_e="PERCENT",$_e="PIPE",B_e="PLUS",j_e="POUND",G_e="QUERY",TYe="QUOTE",CYe="SEMI",HO="SLASH",lre="TILDE",U_e="UNDERSCORE",x6t="EMOJI",z_e="SYM";var S6t=Object.freeze({__proto__:null,WORD:cO,UWORD:q$e,LOCALHOST:Mse,TLD:Y$e,UTLD:X$e,SCHEME:Rge,SLASH_SCHEME:pU,NUM:A_e,WS:w6t,NL:wYe,OPENBRACE:Xz,OPENBRACKET:sre,OPENANGLEBRACKET:ore,OPENPAREN:are,CLOSEBRACE:N6,CLOSEBRACKET:Jz,CLOSEANGLEBRACKET:Kz,CLOSEPAREN:$6,AMPERSAND:M_e,APOSTROPHE:O_e,ASTERISK:P_e,AT:_5,BACKSLASH:R_e,BACKTICK:D_e,CARET:F_e,COLON:G5,COMMA:xYe,DOLLAR:k_e,DOT:WI,EQUALS:L_e,EXCLAMATION:SYe,HYPHEN:qI,PERCENT:N_e,PIPE:$_e,PLUS:B_e,POUND:j_e,QUERY:G_e,QUOTE:TYe,SEMI:CYe,SLASH:HO,TILDE:lre,UNDERSCORE:U_e,EMOJI:x6t,SYM:z_e});const Sj=/[a-z]/,oOe=/\p{L}/u,aOe=/\p{Emoji}/u,lOe=/\d/,Lht=/\s/,Nht=` +`,QDr="️",e4r="‍";let sde=null,ode=null;function t4r(i){i===void 0&&(i=[]);const e={};rx.groups=e;const t=new rx;sde==null&&(sde=$ht(qDr)),ode==null&&(ode=$ht(YDr)),Ln(t,"'",O_e),Ln(t,"{",Xz),Ln(t,"[",sre),Ln(t,"<",ore),Ln(t,"(",are),Ln(t,"}",N6),Ln(t,"]",Jz),Ln(t,">",Kz),Ln(t,")",$6),Ln(t,"&",M_e),Ln(t,"*",P_e),Ln(t,"@",_5),Ln(t,"`",D_e),Ln(t,"^",F_e),Ln(t,":",G5),Ln(t,",",xYe),Ln(t,"$",k_e),Ln(t,".",WI),Ln(t,"=",L_e),Ln(t,"!",SYe),Ln(t,"-",qI),Ln(t,"%",N_e),Ln(t,"|",$_e),Ln(t,"+",B_e),Ln(t,"#",j_e),Ln(t,"?",G_e),Ln(t,'"',TYe),Ln(t,"/",HO),Ln(t,";",CYe),Ln(t,"~",lre),Ln(t,"_",U_e),Ln(t,"\\",R_e);const r=h2(t,lOe,A_e,{[z$e]:!0});h2(r,lOe,r);const n=h2(t,Sj,cO,{[V$e]:!0});h2(n,Sj,n);const s=h2(t,oOe,q$e,{[H$e]:!0});h2(s,Sj),h2(s,oOe,s);const o=h2(t,Lht,w6t,{[Fht]:!0});Ln(t,Nht,wYe,{[Fht]:!0}),Ln(o,Nht),h2(o,Lht,o);const a=h2(t,aOe,x6t,{[b6t]:!0});h2(a,aOe,a),Ln(a,QDr,a);const l=Ln(a,e4r);h2(l,aOe,a);const u=[[Sj,n]],c=[[Sj,null],[oOe,s]];for(let h=0;hh[0]>p[0]?1:-1);for(let h=0;h=0?v[W$e]=!0:Sj.test(p)?lOe.test(p)?v[Pge]=!0:v[V$e]=!0:v[z$e]=!0,kht(t,p,p,v)}return kht(t,"localhost",Mse,{ascii:!0}),t.jd=new rx(z_e),{start:t,tokens:dq({groups:e},S6t)}}function i4r(i,e){const t=r4r(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=t.length,n=[];let s=0,o=0;for(;o=0&&(h+=t[o].length,p++),u+=t[o].length,s+=t[o].length,o++;s-=h,o-=p,u-=h,n.push({t:c.t,v:e.slice(s-u,s),s:s-u,e:s})}return n}function r4r(i){const e=[],t=i.length;let r=0;for(;r56319||r+1===t||(s=i.charCodeAt(r+1))<56320||s>57343?i[r]:i.slice(r,r+2);e.push(o),r+=o.length}return e}function ED(i,e,t,r,n){let s;const o=e.length;for(let a=0;a=0;)s++;if(s>0){e.push(t.join(""));let o=parseInt(i.substring(r,r+s),10);for(;o>0;o--)t.pop();r+=s}else i[r]==="_"?(e.push(t.join("")),r++):(t.push(i[r]),r++)}return e}const Ose={defaultProtocol:"http",events:null,format:Bht,formatHref:Bht,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function EYe(i,e){e===void 0&&(e=null);let t=dq({},Ose);i&&(t=dq(t,i instanceof EYe?i.o:i));const r=t.ignoreTags,n=[];for(let s=0;st?r.substring(0,t)+"…":r},toFormattedHref(i){return i.get("formatHref",this.toHref(i.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(i){return i===void 0&&(i=Ose.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(i),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(i){return{type:this.t,value:this.toFormattedString(i),isLink:this.isLink,href:this.toFormattedHref(i),start:this.startIndex(),end:this.endIndex()}},validate(i){return i.get("validate",this.toString(),this)},render(i){const e=this,t=this.toFormattedHref(i),r=i.get("tagName",t,e),n=this.toFormattedString(i),s={},o=i.get("className",t,e),a=i.get("target",t,e),l=i.get("rel",t,e),u=i.getObj("attributes",t,e),c=i.getObj("events",t,e);return s.href=t,o&&(s.class=o),a&&(s.target=a),l&&(s.rel=l),u&&dq(s,u),{tagName:r,attributes:s,content:n,eventListeners:c}}};function mTe(i,e){class t extends T6t{constructor(n,s){super(n,s),this.t=i}}for(const r in e)t.prototype[r]=e[r];return t.t=i,t}const jht=mTe("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Ght=mTe("text"),n4r=mTe("nl"),QL=mTe("url",{isLink:!0,toHref(i){return i===void 0&&(i=Ose.defaultProtocol),this.hasProtocol()?this.v:`${i}://${this.v}`},hasProtocol(){const i=this.tk;return i.length>=2&&i[0].t!==Mse&&i[1].t===G5}}),Ng=i=>new rx(i);function s4r(i){let{groups:e}=i;const t=e.domain.concat([M_e,P_e,_5,R_e,D_e,F_e,k_e,L_e,qI,A_e,N_e,$_e,B_e,j_e,HO,z_e,lre,U_e]),r=[O_e,Kz,N6,Jz,$6,G5,xYe,WI,SYe,ore,Xz,sre,are,G_e,TYe,CYe],n=[M_e,O_e,P_e,R_e,D_e,F_e,N6,k_e,L_e,qI,A_e,Xz,N_e,$_e,B_e,j_e,G_e,HO,z_e,lre,U_e],s=Ng(),o=Ln(s,lre);Io(o,n,o),Io(o,e.domain,o);const a=Ng(),l=Ng(),u=Ng();Io(s,e.domain,a),Io(s,e.scheme,l),Io(s,e.slashscheme,u),Io(a,n,o),Io(a,e.domain,a);const c=Ln(a,_5);Ln(o,_5,c),Ln(l,_5,c),Ln(u,_5,c);const h=Ln(o,WI);Io(h,n,o),Io(h,e.domain,o);const p=Ng();Io(c,e.domain,p),Io(p,e.domain,p);const m=Ln(p,WI);Io(m,e.domain,p);const v=Ng(jht);Io(m,e.tld,v),Io(m,e.utld,v),Ln(c,Mse,v);const w=Ln(p,qI);Io(w,e.domain,p),Io(v,e.domain,p),Ln(v,WI,m),Ln(v,qI,w);const S=Ln(v,G5);Io(S,e.numeric,jht);const I=Ln(a,qI),R=Ln(a,WI);Io(I,e.domain,a),Io(R,n,o),Io(R,e.domain,a);const L=Ng(QL);Io(R,e.tld,L),Io(R,e.utld,L),Io(L,e.domain,a),Io(L,n,o),Ln(L,WI,R),Ln(L,qI,I),Ln(L,_5,c);const k=Ln(L,G5),B=Ng(QL);Io(k,e.numeric,B);const $=Ng(QL),V=Ng();Io($,t,$),Io($,r,V),Io(V,t,$),Io(V,r,V),Ln(L,HO,$),Ln(B,HO,$);const Y=Ln(l,G5),K=Ln(u,G5),Q=Ln(K,HO);Ln(Q,HO,Y),Io(l,e.domain,a),Ln(l,WI,R),Ln(l,qI,I),Io(u,e.domain,a),Ln(u,WI,R),Ln(u,qI,I),Io(Y,e.domain,$),Ln(Y,HO,$);const re=Ln($,Xz),ne=Ln($,sre),de=Ln($,ore),pe=Ln($,are);Ln(V,Xz,re),Ln(V,sre,ne),Ln(V,ore,de),Ln(V,are,pe),Ln(re,N6,$),Ln(ne,Jz,$),Ln(de,Kz,$),Ln(pe,$6,$),Ln(re,N6,$);const H=Ng(QL),Z=Ng(QL),ae=Ng(QL),fe=Ng(QL);Io(re,t,H),Io(ne,t,Z),Io(de,t,ae),Io(pe,t,fe);const be=Ng(),_e=Ng(),Ie=Ng(),Te=Ng();return Io(re,r),Io(ne,r),Io(de,r),Io(pe,r),Io(H,t,H),Io(Z,t,Z),Io(ae,t,ae),Io(fe,t,fe),Io(H,r,H),Io(Z,r,Z),Io(ae,r,ae),Io(fe,r,fe),Io(be,t,be),Io(_e,t,Z),Io(Ie,t,ae),Io(Te,t,fe),Io(be,r,be),Io(_e,r,_e),Io(Ie,r,Ie),Io(Te,r,Te),Ln(Z,Jz,$),Ln(ae,Kz,$),Ln(fe,$6,$),Ln(H,N6,$),Ln(_e,Jz,$),Ln(Ie,Kz,$),Ln(Te,$6,$),Ln(be,$6,$),Ln(s,Mse,L),Ln(s,wYe,n4r),{start:s,tokens:S6t}}function o4r(i,e,t){let r=t.length,n=0,s=[],o=[];for(;n=0&&p++,n++,c++;if(p<0)n-=c,n0&&(s.push(uOe(Ght,e,o)),o=[]),n-=p,c-=p;const m=h.t,v=t.slice(n-c,n);s.push(uOe(m,e,v))}}return o.length>0&&s.push(uOe(Ght,e,o)),s}function uOe(i,e,t){const r=t[0].s,n=t[t.length-1].e,s=e.slice(r,n);return new i(s,t)}const R1={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function a4r(){R1.scanner=t4r(R1.customSchemes);for(let i=0;i",lt:"<",nbsp:" ",quot:'"'},c4r=/^#[xX]([A-Fa-f0-9]+)$/,h4r=/^#([0-9]+)$/,d4r=/^([A-Za-z0-9]+)$/,p4r=function(){function i(e){this.named=e}return i.prototype.parse=function(e){if(e){var t=e.match(c4r);if(t)return String.fromCharCode(parseInt(t[1],16));if(t=e.match(h4r),t)return String.fromCharCode(parseInt(t[1],10));if(t=e.match(d4r),t)return this.named[t[1]]||"&"+t[1]+";"}},i}(),f4r=/[\t\n\f ]/,m4r=/[A-Za-z]/,g4r=/\r\n?/g;function L0(i){return f4r.test(i)}function Uht(i){return m4r.test(i)}function y4r(i){return i.replace(g4r,` +`)}var v4r=function(){function i(e,t,r){r===void 0&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var n=this.peek();if(n==="<"&&!this.isIgnoredEndTag())this.transitionTo("tagOpen"),this.markTagStart(),this.consume();else{if(this.mode==="precompile"&&n===` +`){var s=this.tagNameBuffer.toLowerCase();(s==="pre"||s==="textarea")&&this.consume()}this.transitionTo("data"),this.delegate.beginData()}},data:function(){var n=this.peek(),s=this.tagNameBuffer;n==="<"&&!this.isIgnoredEndTag()?(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume()):n==="&"&&s!=="script"&&s!=="style"?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(n))},tagOpen:function(){var n=this.consume();n==="!"?this.transitionTo("markupDeclarationOpen"):n==="/"?this.transitionTo("endTagOpen"):(n==="@"||n===":"||Uht(n))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(n))},markupDeclarationOpen:function(){var n=this.consume();if(n==="-"&&this.peek()==="-")this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment();else{var s=n.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase();s==="DOCTYPE"&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())}},doctype:function(){var n=this.consume();L0(n)&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var n=this.consume();L0(n)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase()))},doctypeName:function(){var n=this.consume();L0(n)?this.transitionTo("afterDoctypeName"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(n.toLowerCase())},afterDoctypeName:function(){var n=this.consume();if(!L0(n))if(n===">")this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var s=n.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),o=s.toUpperCase()==="PUBLIC",a=s.toUpperCase()==="SYSTEM";(o||a)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),o?this.transitionTo("afterDoctypePublicKeyword"):a&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var n=this.peek();L0(n)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):n==='"'?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):n==="'"?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):n===">"&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},doctypePublicIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypePublicIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(n)},afterDoctypePublicIdentifier:function(){var n=this.consume();L0(n)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var n=this.consume();L0(n)||(n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):n==='"'?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):n==="'"&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var n=this.consume();n==='"'?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},doctypeSystemIdentifierSingleQuoted:function(){var n=this.consume();n==="'"?this.transitionTo("afterDoctypeSystemIdentifier"):n===">"?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(n)},afterDoctypeSystemIdentifier:function(){var n=this.consume();L0(n)||n===">"&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var n=this.consume();n==="-"?this.transitionTo("commentStartDash"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(n),this.transitionTo("comment"))},commentStartDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var n=this.consume();n==="-"?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(n)},commentEndDash:function(){var n=this.consume();n==="-"?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+n),this.transitionTo("comment"))},commentEnd:function(){var n=this.consume();n===">"?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+n),this.transitionTo("comment"))},tagName:function(){var n=this.consume();L0(n)?this.transitionTo("beforeAttributeName"):n==="/"?this.transitionTo("selfClosingStartTag"):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(n)},endTagName:function(){var n=this.consume();L0(n)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):n==="/"?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):n===">"?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(n)},beforeAttributeName:function(){var n=this.peek();if(L0(n)){this.consume();return}else n==="/"?(this.transitionTo("selfClosingStartTag"),this.consume()):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==="="?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var n=this.peek();L0(n)?(this.transitionTo("afterAttributeName"),this.consume()):n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.transitionTo("beforeAttributeValue"),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):n==='"'||n==="'"||n==="<"?(this.delegate.reportSyntaxError(n+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(n)):(this.consume(),this.delegate.appendToAttributeName(n))},afterAttributeName:function(){var n=this.peek();if(L0(n)){this.consume();return}else n==="/"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="="?(this.consume(),this.transitionTo("beforeAttributeValue")):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(n))},beforeAttributeValue:function(){var n=this.peek();L0(n)?this.consume():n==='"'?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n==="'"?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):n===">"?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(n))},attributeValueDoubleQuoted:function(){var n=this.consume();n==='"'?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueSingleQuoted:function(){var n=this.consume();n==="'"?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):n==="&"?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(n)},attributeValueUnquoted:function(){var n=this.peek();L0(n)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):n==="&"?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):n===">"?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(n))},afterAttributeValueQuoted:function(){var n=this.peek();L0(n)?(this.consume(),this.transitionTo("beforeAttributeName")):n==="/"?(this.consume(),this.transitionTo("selfClosingStartTag")):n===">"?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){var n=this.peek();n===">"?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var n=this.consume();(n==="@"||n===":"||Uht(n))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(n))}},this.reset()}return i.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},i.prototype.transitionTo=function(e){this.state=e},i.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},i.prototype.tokenizePart=function(e){for(this.input+=y4r(e);this.index"||e==="style"&&this.input.substring(this.index,this.index+8)!==""||e==="script"&&this.input.substring(this.index,this.index+9)!=="<\/script>"},i}(),_4r=function(){function i(e,t){t===void 0&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new v4r(this,e,t.mode),this._currentAttribute=void 0}return i.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},i.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},i.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},i.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},i.prototype.current=function(){var e=this.token;if(e===null)throw new Error("token was unexpectedly null");if(arguments.length===0)return e;for(var t=0;t=0))continue;let c=r.length;T4r(l,t,++o,r),o+=r.length-c-1}else if(a.type!==J$e)r.push(a);else{const l=S4r(a.chars,s);r.push.apply(r,l)}}for(let o=0;o0&&(l+=" "+I4r(a.attributes).join(" ")),a.selfClosing&&(l+=" /"),l+=">",n.push(l);break}case E6t:n.push(``);break;case J$e:n.push(K$e(a.chars));break;case w4r:n.push(``);break;case x4r:{let l=`",n.push(l);break}}}return n.join("")}function S4r(i,e){const t=l4r(i),r=[];for(let n=0;n0;){let s=e[t];s.type===V_e&&s.tagName.toUpperCase()===i?n++:s.type===E6t&&s.tagName.toUpperCase()===i&&n--,r.push(s),t++}return r}function C4r(i){let{tagName:e,attributes:t,content:r}=i;return`<${e} ${E4r(t)}>${K$e(r)}`}function K$e(i){return i.replace(/&/g,"&").replace(//g,">")}function I6t(i){return i.replace(/"/g,""")}function E4r(i){const e=[];for(const t in i){const r=i[t]+"";e.push(`${t}="${I6t(r)}"`)}return e.join(" ")}function I4r(i){const e=[];for(let t=0;t=i.reference.scrollWidth)return!1}const R4r=i=>{const e={"<":"<",">":">",'"':""","'":"'"};return i.replace(/[<>"']/g,t=>e[t])};function zht(i){if(i===null)return"";const e=R4r(i);return gTe(e,{target:"_blank",validate:{url:t=>/^https?:\/\//.test(t)}})}const D4r=["content"],F4r={key:0,class:"flex flex-shrink-0 items-center border-b border-solid border-gray-600 px-8 h-48 overflow-hidden",tabindex:"-1"},k4r={class:"flex-grow text-lg py-16 pl-8 min-w-0"},L4r={key:0,class:"flex"},N4r={key:1,class:"p-8 flex-grow overflow-y-auto"},$4r={key:2,class:"px-16 py-16 border-t border-gray-400 default-focus-style"},B4r=Xr({__name:"panel-screen",props:{header:{type:Boolean,default:!0},content:{type:Boolean,default:!0},footer:{type:Boolean,default:!1},panel:{type:Object,required:!0}},setup(i){const e=i,{t}=Qn(),r=w0(),n=dy(),s=eo("iApi"),o=vi(),a=Hr(()=>s?.fixture.get("appbar")?n.temporary:[]),l=Hr(()=>r.mobileView),u=Hr(()=>r.reorderable),c=()=>!l.value&&!e.panel.teleport,h=p=>{e.panel.move(p),p==="left"&&Bv(()=>{(o.value?.querySelector(".move-left")).focus()})};return Fa(()=>{o.value?.addEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.addEventListener("keyup",p=>{p.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),Ka(()=>{o.value?.removeEventListener("blur",()=>{o.value._tippy.hide()}),o.value?.removeEventListener("keyup",p=>{p.key==="Tab"&&o.value?.matches(":focus")&&o.value._tippy.show()})}),(p,m)=>{const v=Ko("back"),w=Ko("panel-options-menu"),S=Ko("left"),I=Ko("right"),R=Ko("pin"),L=Ko("expand"),k=Ko("minimize"),B=Ko("close"),$=Nn("truncate"),V=Nn("focus-item"),Y=Nn("tippy");return Ur((qt(),si("div",{class:"h-full flex flex-col items-stretch",content:ri(t)("panels.access"),ref_key:"el",ref:o},[i.header?(qt(),si("header",F4r,[Vn(v,{class:Wn(i.panel.teleport?"display-none":"block sm:display-none"),onClick:m[0]||(m[0]=K=>i.panel.close())},null,8,["class"]),Ur((qt(),si("h2",k4r,[Em(p.$slots,"header")])),[[$]]),p.$slots.controls?(qt(),Dn(w,{key:0},{default:Rn(()=>[Em(p.$slots,"controls")]),_:3})):Yr("",!0),Ot("div",{class:Wn(i.panel.teleport?"flex":"display-none sm:flex")},[i.panel.teleport?Yr("",!0):(qt(),si("div",L4r,[u.value?(qt(),Dn(S,{key:0,onClick:m[1]||(m[1]=K=>h("left")),active:!i.panel.isLeftMostPanel},null,8,["active"])):Yr("",!0),u.value?(qt(),Dn(I,{key:1,onClick:m[2]||(m[2]=K=>h("right")),active:!i.panel.isRightMostPanel},null,8,["active"])):Yr("",!0),Vn(R,{onClick:m[3]||(m[3]=K=>i.panel.pin()),active:i.panel.isPinned},null,8,["active"]),i.panel.controls&&i.panel.controls.expand?(qt(),Dn(L,{key:2,onClick:m[4]||(m[4]=K=>i.panel.expand()),active:i.panel.expanded},null,8,["active"])):Yr("",!0)])),i.panel.button&&a.value?.includes(i.panel.id)?(qt(),Dn(k,{key:1,onClick:m[5]||(m[5]=K=>i.panel.minimize())})):Yr("",!0),Vn(B,{onClick:m[6]||(m[6]=K=>i.panel.close())})],2)])):Yr("",!0),i.content?(qt(),si("div",N4r,[Em(p.$slots,"content")])):Yr("",!0),i.footer?Ur((qt(),si("div",$4r,[Em(p.$slots,"footer")])),[[V]]):Yr("",!0)],8,D4r)),[[Y,{trigger:"manual",onShow:c,popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}}),j4r={class:"relative",tabindex:"-1"},G4r=["content","aria-label"],U4r=["transform"],z4r=Ot("path",{d:"M298.028 214.267L285.793 96H328c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24H56C42.745 0 32 10.745 32 24v48c0 13.255 10.745 24 24 24h42.207L85.972 214.267C37.465 236.82 0 277.261 0 328c0 13.255 10.745 24 24 24h136v104.007c0 1.242.289 2.467.845 3.578l24 48c2.941 5.882 11.364 5.893 14.311 0l24-48a8.008 8.008 0 0 0 .845-3.578V352h136c13.255 0 24-10.745 24-24-.001-51.183-37.983-91.42-85.973-113.733z"},null,-1),V4r=[z4r],H4r=Xr({__name:"pin",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",j4r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)(i.active?"panels.controls.unpin":"panels.controls.pin"),"aria-label":ri(e)(i.active?"panels.controls.unpin":"panels.controls.pin")},[(qt(),si("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",transform:`rotate(${i.active?30:0})`},V4r,8,U4r))],10,G4r)),[[n,{placement:"bottom",hideOnClick:!1}]])])}}}),W4r={class:"relative",tabindex:"-1"},q4r=["content","aria-label"],Y4r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[Ot("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1),X4r=[Y4r],J4r=Xr({__name:"close",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",W4r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.close"),"aria-label":ri(e)("panels.controls.close")},X4r,10,q4r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),K4r={class:"relative",tabindex:"-1"},Z4r=["content","aria-label"],Q4r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",class:"fill-current w-16 h-16",viewBox:"0 0 16 16"},[Ot("path",{d:"M20.485784919653916,7.578491965389372h-14.170000000000005l3.5800000000000054,-3.589999999999997l-1.409999999999993,-1.4099999999999984l-6.000000000000008,6.0000000000000275l6.000000000000008,6l1.409999999999993,-1.4100000000000001l-3.58,-3.59h14.170000000000007Z",transform:"matrix(0.865803 0 0 0.865803 -1.99071 0.638058)"})],-1),e5r=[Q4r],t5r=Xr({__name:"back",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",K4r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-8",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.back"),"aria-label":ri(e)("panels.controls.back")},e5r,10,Z4r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),i5r={class:"w-32 h-32"},r5r=["content"],n5r={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},s5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),o5r=Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),a5r=Ot("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"},null,-1),l5r=[s5r,o5r,a5r],u5r={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"h-24 w-24 fill-current transform rotate-90"},c5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),h5r=Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"},null,-1),d5r=Ot("path",{d:"M8 19h3v3h2v-3h3l-4-4-4 4zm8-15h-3V1h-2v3H8l4 4 4-4zM4 9v2h16V9H4z"},null,-1),p5r=Ot("path",{d:"M4 12h16v2H4z"},null,-1),f5r=[c5r,h5r,d5r,p5r],m5r=Xr({__name:"expand",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",i5r,[Ur((qt(),si("button",{type:"button",class:"text-gray-500 hover:text-black focus:text-black w-full h-full flex justify-center items-center",content:ri(e)(`panels.controls.${i.active?"collapse":"expand"}`)},[i.active?(qt(),si("svg",u5r,f5r)):(qt(),si("svg",n5r,l5r))],8,r5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale",hideOnClick:!1}]])])}}}),g5r={class:"relative",tabindex:"-1"},y5r=["content","aria-label"],v5r=Ot("svg",{class:"fill-current w-20 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M6 19h12v2H6z"})],-1),_5r=[v5r],b5r=Xr({__name:"minimize",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",g5r,[Ur((qt(),si("button",{type:"button",class:Wn(["text-gray-500 hover:text-black focus:text-black p-6",{"text-gray-700":i.active}]),content:ri(e)("panels.controls.minimize"),"aria-label":ri(e)("panels.controls.minimize")},_5r,10,y5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),w5r={class:"relative",tabindex:"-1"},x5r=["content","aria-label"],S5r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[Ot("path",{d:"M 8.59 16.34 L 13.17 11.75 L 8.59 7.16 L 10 5.75 L 16 11.75 L 10 17.75 Z"})],-1),T5r=[S5r],C5r=Xr({__name:"right",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",w5r,[Ur((qt(),si("button",{type:"button",class:Wn(["p-8",{"text-gray-500 hover:text-black focus:text-black":i.active,"text-gray-300":!i.active}]),content:ri(e)("panels.controls.moveRight"),"aria-label":ri(e)("panels.controls.moveRight")},T5r,10,x5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),E5r={class:"relative",tabindex:"-1"},I5r=["content","aria-label"],A5r=Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"4 4 16 16"},[Ot("path",{d:"M 15.41 16.09 L 10.83 11.5 L 15.41 6.91 L 14 5.5 L 8 11.5 L 14 17.5 Z"})],-1),M5r=[A5r],O5r=Xr({__name:"left",props:{active:Boolean},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return qt(),si("div",E5r,[Ur((qt(),si("button",{type:"button",class:Wn(["p-8 move-left",{"text-gray-500 hover:text-black focus:text-black":i.active,"text-gray-300":!i.active}]),content:ri(e)("panels.controls.moveLeft"),"aria-label":ri(e)("panels.controls.moveLeft")},M5r,10,I5r)),[[n,{placement:"bottom",theme:"ramp4",animation:"scale"}]])])}}}),P5r=i=>(Dc("data-v-9e477d20"),i=i(),Fc(),i),R5r=P5r(()=>Ot("div",{class:"p-6"},[Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-20 h-20"},[Ot("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)),D5r=Xr({__name:"panel-options-menu",setup(i){const{t:e}=Qn();return(t,r)=>(qt(),Dn(cYe,{class:"flex",tooltip:ri(e)("panels.controls.optionsMenu"),popperOptions:{strategy:"fixed"},position:"bottom-end"},{header:Rn(()=>[R5r]),default:Rn(()=>[Em(t.$slots,"default",{},void 0,!0)]),_:3},8,["tooltip"]))}}),F5r=ml(D5r,[["__scopeId","data-v-9e477d20"]]),k5r={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},L5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),N5r=Ot("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},null,-1),$5r=[L5r,N5r],B5r={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},j5r=Ot("path",{d:"M0 0h24v24H0z",fill:"none"},null,-1),G5r=Ot("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},null,-1),U5r=[j5r,G5r],z5r=Xr({__name:"fullscreen-nav",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{t.toggleFullscreen()};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("mapnav.fullscreen")},{default:Rn(()=>[ri(t).isFullscreen?(qt(),si("svg",k5r,$5r)):(qt(),si("svg",B5r,U5r))]),_:1},8,["tooltip"])}}}),V5r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"})],-1),H5r=Xr({__name:"geolocator-nav",setup(i){const{t:e}=Qn(),t=eo("iApi");let r=Zl([]);const n=async()=>{if(r.length)s(r);else{const a=await o({maximumAge:1/0,timeout:5e3}).catch(l=>{l.code===GeolocationPositionError.PERMISSION_DENIED?t.notify.show(K1.ERROR,e("mapnav.geolocator.error.permission")):t.notify.show(K1.ERROR,e("mapnav.geolocator.error.internal"))});a&&(r=[a.coords.longitude,a.coords.latitude],s(r))}},s=a=>{let l=new s0("geolocation",a,xl.latLongSR(),!0);t.geo.map.zoomMapTo(l)},o=a=>new Promise((l,u)=>navigator.geolocation.getCurrentPosition(l,u,a));return(a,l)=>{const u=Ko("mapnav-button");return qt(),Dn(u,{onClickFunction:n,tooltip:ri(e)("mapnav.geolocator")},{default:Rn(()=>[V5r]),_:1},8,["tooltip"])}}}),W5r=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),Ot("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),q5r=Xr({__name:"home-nav",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{const n=t.geo.map.getExtentSet();t.geo.map.zoomMapTo(n.fullExtent)};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("mapnav.home")},{default:Rn(()=>[W5r]),_:1},8,["tooltip"])}}}),Y5r={class:"relative w-32 h-32 text-gray-600 hover:text-black",tabindex:"-1"},X5r=["content","aria-label"],J5r=Xr({__name:"button",props:{onClickFunction:{type:Function,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(i){return(e,t)=>{const r=Nn("focus-item"),n=Nn("tippy");return qt(),si("div",Y5r,[Ur((qt(),si("button",{type:"button",class:"w-full h-full default-focus-style focus:outline-none",onClick:t[0]||(t[0]=s=>i.onClickFunction()),content:i.tooltip,"aria-label":typeof i.tooltip=="string"?i.tooltip:""},[Em(e.$slots,"default")],8,X5r)),[[r],[n,{placement:"left"}]])])}}}),K5r={class:"relative",tabindex:"-1"},Z5r=["content","aria-label"],Q5r=Xr({__name:"button",props:{onClickFunction:{type:Function,required:!0},id:{type:String,required:!0},tooltip:{type:[String,Boolean],default:!1}},setup(i){const e=i,t=eo("iApi"),r=()=>t?.event.emit(ln.APPBAR_BUTTON_CLICK,e.id);return(n,s)=>{const o=Nn("focus-item"),a=Nn("tippy");return qt(),si("div",K5r,[Ur((qt(),si("button",{type:"button",class:"py-6 w-full h-full",onClick:s[0]||(s[0]=()=>{i.onClickFunction(),r()}),content:i.tooltip,"aria-label":String(i.tooltip)},[Em(n.$slots,"default",{},void 0,!0)],8,Z5r)),[[o],[a,{placement:"right"}]])])}}}),eFr=ml(Q5r,[["__scopeId","data-v-0af0697e"]]),yTe=xp("areas-of-interest",()=>({areas:vi([])})),pq=xp("export",()=>{const i=vi({title:!0,map:!0,mapElements:!0,legend:!0,footnote:!0,timestamp:!0}),e=vi("");function t(r){if(i.value[r.name]!==void 0){const n=i.value[r.name];i.value[r.name]=r.selected!==void 0?r.selected:!n}}return{componentSelectedState:i,fileName:e,toggleSelected:t}}),ure=xp("extentguard",()=>{const i=vi(!1);function e(l){i.value=l}const t=vi(!1);function r(l){t.value=l}const n=vi(!1);function s(l){n.value=l}const o=vi([]);function a(l){o.value=l}return{active:i,setActive:e,enforcing:t,setEnforcing:r,alwaysOn:n,setAlwaysOn:s,extentSetIds:o,setExtentSetIds:a}}),bP=function i(e){function t(n,s,o){var a,l={};if(Array.isArray(n))return n.concat(s);for(a in n)l[o?a.toLowerCase():a]=n[a];for(a in s){var u=o?a.toLowerCase():a,c=s[a];l[u]=u in l&&typeof c=="object"?t(l[u],c,u=="headers"):c}return l}function r(n,s,o,a,l){var u=typeof n!="string"?(s=n).url:n,c={config:s},h=t(e,s),p={};a=a||h.data,(h.transformRequest||[]).map(function(m){a=m(a,h.headers)||a}),h.auth&&(p.authorization=h.auth),a&&typeof a=="object"&&typeof a.append!="function"&&typeof a.text!="function"&&(a=JSON.stringify(a),p["content-type"]="application/json");try{p[h.xsrfHeaderName]=decodeURIComponent(document.cookie.match(RegExp("(^|; )"+h.xsrfCookieName+"=([^;]*)"))[2])}catch{}return h.baseURL&&(u=u.replace(/^(?!.*\/\/)\/?/,h.baseURL+"/")),h.params&&(u+=(~u.indexOf("?")?"&":"?")+(h.paramsSerializer?h.paramsSerializer(h.params):new URLSearchParams(h.params))),(h.fetch||fetch)(u,{method:(o||h.method||"get").toUpperCase(),body:a,headers:t(h.headers,p,!0),credentials:h.withCredentials?"include":l}).then(function(m){for(var v in m)typeof m[v]!="function"&&(c[v]=m[v]);return h.responseType=="stream"?(c.data=m.body,c):m[h.responseType||"text"]().then(function(w){c.data=w,c.data=JSON.parse(w)}).catch(Object).then(function(){return(h.validateStatus?h.validateStatus(m.status):m.ok)?c:Promise.reject(c)})})}return e=e||{},r.request=r,r.get=function(n,s){return r(n,s,"get")},r.delete=function(n,s){return r(n,s,"delete")},r.head=function(n,s){return r(n,s,"head")},r.options=function(n,s){return r(n,s,"options")},r.post=function(n,s,o){return r(n,o,"post",s)},r.put=function(n,s,o){return r(n,o,"put",s)},r.patch=function(n,s,o){return r(n,o,"patch",s)},r.all=Promise.all.bind(Promise),r.spread=function(n){return n.apply.bind(n,n)},r.CancelToken=typeof AbortController=="function"?AbortController:Object,r.defaults=e,r.create=i,r}(),tFr={A:10,B:12,C:11,E:13,G:24,H:24,J:24,K:35,L:35,M:35,N:35,P:35,R:46,S:47,T:48,V:59,X:[62,61],Y:60},cOe={en:{},fr:{}};class iFr{list={};listFetched=!1;constructor(e,t){bP.get(t).then(r=>{r.data.definitions.forEach(n=>cOe[e][n.code]=n.description),Object.keys(cOe[e]).forEach(n=>{this.list[n]=cOe[e][n]}),this.listFetched=!0})}fsaToProvinces(e){const t={};let r=tFr[e.substring(0,1).toUpperCase()];return typeof r=="number"&&(r=[r]),r.forEach(n=>{t[n]=this.list[n]}),t}}function rFr(i,e){return new iFr(i,e)}const ade={en:{ADDRESS:"Street Address",FSA:"Forward Sortation Area",NTS:"National Topographic System",COORD:"Latitude/Longitude",SCALE:"Scale"},fr:{ADDRESS:"Adresse Municipale",FSA:"Région De Tri D'Acheminement",NTS:"Système National De Référence Cartographique",COORD:"Latitude/Longitude",SCALE:"Échelle"}};class nFr{allTypes={};validTypes={};filterComplete=!1;typesFetched=!1;constructor(e,t){bP.get(t).then(r=>{r.data.definitions.forEach(n=>{ade[e][n.code]=n.term.split(`${n.code}-`)[1]}),Object.keys(ade[e]).forEach(n=>{this.allTypes[n]=ade[e][n],this.validTypes[n]=ade[e][n]}),this.typesFetched=!0})}filterValidTypes(e){if(this.filterComplete)return this.validTypes;if(e=typeof e=="string"?[e]:e,e&&e.length>0)for(const t of e)delete this.validTypes[t];return this.filterComplete=!0,this.validTypes}}function sFr(i,e){return new nFr(i,e)}function oFr(i,e){const t=/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)(\s*[,|;\s]\s*)[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)[*]$/,r=/^\d{2,3}[A-P]/,n=/^[ABCEGHJKLMNPRSTVXY]\d[A-Z]/;if(t.test(e)&&!i.disabledSearchTypes.includes("LAT/LNG")){const s=e.slice(0,-1);return new aFr(i,s)}else return n.test(e)&&!i.disabledSearchTypes.includes("FSA")?new lFr(i,e):r.test(e)&&!i.disabledSearchTypes.includes("NTS")?new uFr(i,e.substring(0,6).toUpperCase()):new cFr(i,e)}class vTe{config;query;failedServs=[];results=[];onComplete;latLongResult;featureResults=[];resultType="geoname";constructor(e,t){this.query=t,this.config=e}search(){return this.jsonRequest(this.getUrl()).then(e=>this.normalizeNameItems(e.items)).catch(()=>(console.error("Geoname service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}getUrl(e,t,r,n){let s="";return e?s=this.config.geoLocateUrl+"?q="+this.query:(r&&n?s=`${this.config.geoNameUrl}?lat=${r}&lon=${n}&num=${this.config.maxResults}`:s=`${this.config.geoNameUrl}?q=${this.query}&num=${this.config.maxResults}`,this.config.categories.length>0&&(s+=`&concise=${this.config.categories.join(",")}`),this.config.officialOnly&&(s+="&category=O")),s}normalizeNameItems(e){return e.filter(t=>this.config.types.validTypes[t.concise.code]).map(t=>({name:t.name,location:t.location,province:this.config.provinces.list[t.province.code],type:this.config.types.allTypes[t.concise.code],LatLon:{lat:t.latitude,lon:t.longitude},bbox:t.bbox,order:this.config.sortOrder.indexOf(t.concise.code)>=0?this.config.sortOrder.indexOf(t.concise.code):this.config.sortOrder.length}))}jsonRequest(e){return new Promise((t,r)=>{const n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="json",n.onload=()=>{if(n.status===200){const s=typeof n.response=="string"?JSON.parse(n.response):n.response;t(s)}else r("Could not load results from remote service.")},n.send()})}locateByQuery(){return this.jsonRequest(this.getUrl(!0,void 0))}nameByLatLon(e,t,r){return this.jsonRequest(this.getUrl(!1,r,e,t)).then(n=>this.normalizeNameItems(n.items)).catch(()=>(console.error("LatLon service failed"),this.failedServs.push("geoname"),this.normalizeNameItems([])))}}class aFr extends vTe{constructor(e,t){super(e,t),this.resultType="latlong";const n=t.split(/[\s|,|;|]/).filter(a=>!isNaN(a)&&a!=="").map(a=>parseFloat(a)),s=.015,o=[n[1]-s,n[0]-s,n[1]+s,n[0]+s];this.latLongResult={name:`${n[0]},${n[1]}`,location:{latitude:n[0],longitude:n[1]},type:"Latitude/Longitude",position:[n[1],n[0]],bbox:o},this.onComplete=new Promise((a,l)=>{this.nameByLatLon(n[0],n[1]).then(u=>{u?(this.results=u,a(this)):l("Given lat lon coordinates cannot be found")})})}}class lFr extends vTe{constructor(e,t){t=t.substring(0,3).toUpperCase(),super(e,t),this.resultType="fsa",this.onComplete=new Promise(r=>{this.formatLocationResult().then(n=>{n?(this.featureResults.push(n),this.nameByLatLon(n.LatLon.lat,n.LatLon.lon,Object.keys(n._provinces).map(s=>parseInt(s))).then(s=>{this.results=s,r(this)})):(console.log("FSA code given cannot be found."),r(this))})})}formatLocationResult(){return this.locateByQuery().then(e=>{if(e.length===1&&this.query){const t=this.config.provinces.fsaToProvinces(this.query);return{fsa:this.query,code:"FSA",desc:this.config.types.allTypes.FSA,province:Object.keys(t).map(r=>t[r]).join(","),_provinces:t,LatLon:{lat:e[0].geometry.coordinates[1],lon:e[0].geometry.coordinates[0]}}}}).catch(()=>{console.error("FSA service failed"),this.failedServs.push("geolocation")})}}class uFr extends vTe{unitName;unit;mapSheets=[];constructor(e,t){super(e,t),this.resultType="nts",t=isNaN(parseInt(t[2]))?"0"+t:t,this.unitName=t,this.onComplete=new Promise(r=>{this.locateByQuery().then(n=>{if(n.length>0&&this.query){const s=this.locateToResult(n);this.unit=s[0],this.mapSheets=s,this.featureResults.push(this.unit),this.nameByLatLon(this.unit.LatLon.lat,this.unit.LatLon.lon).then(o=>{this.results=o,r(this)})}else console.log("Given NTS code not found"),r(this)}).catch(()=>{console.error("NTS service failed"),this.failedServs.push("geolocation"),r(this)})})}locateToResult(e){return e.map(r=>{const n=r.title.split(" ");return{nts:n.shift()||"",location:n.join(" "),code:"NTS",desc:this.config.types.allTypes.NTS,LatLon:{lat:r.geometry.coordinates[1],lon:r.geometry.coordinates[0]},bbox:r.bbox}})}equals(e){return this.unitName===e.unitName}}class cFr extends vTe{constructor(e,t){t=encodeURIComponent(t.trim()),super(e,t),this.resultType="address",this.onComplete=new Promise(r=>{this.locateByQuery().then(n=>{this.featureResults=this.locateToResult(n),this.search().then(s=>{this.results=s,r(this)})}).catch(()=>{this.failedServs.push("geolocation"),console.error("Address service failed"),this.search().then(n=>{this.results=n,r(this)})})})}locateToResult(e){return this.config.categories.length>0&&!this.config.categories.includes("ADDR")?[]:e.filter(r=>r.type?.includes("Street")).map(r=>{const[n,s,o]=r.title.split(", ");return{name:n,city:s.split(" Of ").pop(),province:o,desc:this.config.types.allTypes.ADDRESS,LatLon:{lat:r.geometry.coordinates[1],lon:r.geometry.coordinates[0]}}})}}const Vht="https://geogratis.gc.ca/services/geolocation/@{language}/locate",Hht="https://geogratis.gc.ca/services/geoname/@{language}/geonames.json",Wht="https://geogratis.gc.ca/services/geoname/@{language}/codes/province.json",qht="https://geogratis.gc.ca/services/geoname/@{language}/codes/concise.json",hFr={10:"NL",11:"PE",12:"NS",13:"NB",24:"QC",35:"ON",46:"MB",47:"SK",48:"AB",59:"BC",60:"YU",61:"NT",62:"NU",72:"UF",73:"IW"};class Yht{config;constructor(e,t){let r,n,s,o;const a=t?.serviceUrls;a?(r=a.geoLocation?a.geoLocation:Vht,n=a.geoNames?a.geoNames:Hht,s=a.geoProvince?a.geoProvince:Wht,o=a.geoTypes?a.geoTypes:qht):(r=Vht,n=Hht,s=Wht,o=qht),r=r.replace("@{language}",e),n=n.replace("@{language}",e),s=s.replace("@{language}",e),o=o.replace("@{language}",e);const l=t?.settings;let u,c,h,p,m;l?(u=l.categories?l.categories:[],c=l.sortOrder?l.sortOrder:[],h=l.disabledSearchTypes?l.disabledSearchTypes:[],p=l.maxResults>0?l.maxResults:100,m=!!l.officialOnly):(u=[],c=[],h=[],p=100,m=!1),this.config={language:e,geoNameUrl:n,geoLocateUrl:r,types:sFr(e,o),provinces:rFr(e,s),categories:u,sortOrder:c,disabledSearchTypes:h,maxResults:p,officialOnly:m},this.config.types.filterValidTypes(t?.excludeTypes),this._provinceList=[],this._typeList=[],this._excludedTypes=t?.excludeTypes||[]}get provinceList(){return this._provinceList}get typeList(){return this._typeList}set provinceList(e){this._provinceList=e}set typeList(e){this._typeList=e}levenshteinDistance(e,t){t=t.toLowerCase().trim();const r=decodeURI(e.query.toLowerCase().replace("*","")),n=[];for(let s=0;s<=t.length;s++){n[s]=[s];for(let o=1;o<=r.length;o++)n[s][o]=s===0?o:Math.min(n[s][o-1]+1,n[s-1][o]+.2,n[s-1][o-1]+(r[o-1]===t[s-1]?0:1))}return n[t.length][r.length]}findProvinceObj(e){return this.provinceList.find(t=>t.name===e)}query(e){return oFr(this.config,e.toUpperCase()).onComplete.then(t=>{let r=[];t.featureResults.length>0?t.resultType==="fsa"?r=t.featureResults.map(s=>({name:s.fsa,bbox:[s.LatLon.lon+.02,s.LatLon.lat-.02,s.LatLon.lon-.02,s.LatLon.lat+.02],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:-1})):t.resultType==="nts"?r=t.featureResults.map(s=>({name:s.nts,bbox:s.bbox??[s.LatLon.lon+.02,s.LatLon.lat-.02,s.LatLon.lon-.02,s.LatLon.lat+.02],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.location,latitude:s.LatLon.lat,longitude:s.LatLon.lon},order:-1})):t.resultType==="address"&&(r=t.featureResults.map(s=>({name:s.name,bbox:[s.LatLon.lon+.002,s.LatLon.lat-.002,s.LatLon.lon-.002,s.LatLon.lat+.002],type:s.desc,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.city,latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:this.config.sortOrder.indexOf("ADDR")>=0?this.config.sortOrder.indexOf("ADDR"):this.config.sortOrder.length})),this.config.sortOrder.length>0&&(r=r.sort((s,o)=>this.levenshteinDistance(t,s.name)>this.levenshteinDistance(t,o.name)?1:-1))):t.resultType==="latlong"&&(r=[t.latLongResult],r[0].order=-1);const n=t.results.map(s=>({name:s.name,bbox:s.bbox,type:s.type,position:[s.LatLon.lon,s.LatLon.lat],location:{city:s.location,latitude:s.LatLon.lat,longitude:s.LatLon.lon,province:this.findProvinceObj(s.province)},order:s.order}));return{results:r.concat(n).slice(0,this.config.maxResults).sort((s,o)=>this.config.sortOrder.length>0?s.order>o.order?1:-1:this.levenshteinDistance(t,s.name)>this.levenshteinDistance(t,o.name)?1:-1),failedServs:t.failedServs}})}fetchProvinces(){return new Promise(e=>{const t=setInterval(()=>{if(this.config.provinces.listFetched){clearInterval(t);const r=[],n={code:-1,abbr:"...",name:"..."};r.push(n);const s=this.config.provinces.list;for(const o in s)r.push({code:o,abbr:hFr[o],name:s[o]});this.provinceList=r,e(this.provinceList)}})})}fetchTypes(){return new Promise(e=>{const t=setInterval(()=>{if(this.config.types.typesFetched){clearInterval(t);const r=[],n={code:-1,name:"..."};r.push(n);const s=this.config.types.allTypes;for(const o in s)this._excludedTypes.includes(o)||r.push({code:o,name:s[o]});this.typeList=r,e(this.typeList)}},250)})}}function Xht(i,e,t){return i&&e.extent&&(t=t.filter(r=>r.bbox[0]<=e.extent.xmax&&r.bbox[1]<=e.extent.ymax&&r.bbox[2]>=e.extent.xmin&&r.bbox[3]>=e.extent.ymin)),e.province&&e.province!=="..."&&(t=t.filter(r=>r.location.province?.name&&r.location.province.name===e.province)),e.type&&e.type!=="..."&&(t=t.filter(r=>r.type===e.type)),t}const SB=xp("geosearch",()=>{const i=vi(new Yht("en",void 0)),e=vi({type:"",province:"",extent:void 0}),t=vi(!1),r=vi(""),n=vi(""),s=vi(""),o=vi([]),a=vi([]),l=vi(!1),u=vi([]),c=Hr(()=>new Promise(L=>{i.value.fetchProvinces().then(k=>{k.sort((B,$)=>B.name>$.name?1:-1),L(k)})})),h=Hr(()=>new Promise(L=>{i.value.fetchTypes().then(k=>{k.sort((B,$)=>B.name>$.name?1:-1),L(k)})}));function p(L,k){i.value=new Yht(L,k)}function m(L){l.value=!0;const k=r.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim();if(!k)o.value=[],a.value=[],l.value=!1;else if(k&&k!==s.value||L){const B=setInterval(()=>{i.value.config.provinces.listFetched&&i.value.config.types.typesFetched&&(clearInterval(B),i.value.query(`${k}*`).then($=>{u.value=$.failedServs,s.value=k,a.value=$.results;const V=Xht(t.value,e.value,a.value);o.value=V||[],l.value=!1}))},250)}else{const B=Xht(t.value,e.value,a.value);o.value=B||[],l.value=!1}}function v(L){e.value.province=typeof L.province>"u"?"":L.province,m(L.forceReRun)}function w(L){e.value.type=typeof L.type>"u"?"":L.type,m(L.forceReRun)}function S(L){s.value=r.value.replace(/["!*$+?^{}()|[\]\\]/g,"").trim(),r.value=L,m()}function I(L){const k={a:"àáâãäåāăąǎȁȃȧạảấầẩẫậắằẳẵặ",b:"ḃɓḅḇ",c:"çćĉċč",d:"ďḋḍḏḑḓ",e:"èéêëēĕėęěȅȇẹẻẽếềểễệ",f:"ƒḟ",g:"ĝğġģǧǵḡ",h:"ĥȟḣḥḧḩḫẖ",i:"ìíîïĩīĭįıȉȋịỉĩ",j:"ĵǰɉ",k:"ķĸƙḳḵ",l:"ĺļľŀłḷḹḻḽ",m:"ḿṁṃ",n:"ñńņňʼnŋǹṅṇṉṋ",o:"òóôõöōŏőơǒǫǭȍȏȯọỏốồổỗộớờởỡợ",p:"ṕṗ",r:"ŕŗřȑȓṛṝṟ",s:"śŝşšșṡṣṥṧṩ",t:"ţťŧțṫṭṯṱẗ",u:"ùúûüũūŭůűųưǔǖǘǚǜȕȗụủứừửữự",v:"ṽṿ",w:"ẁẃŵẅẇẉẋ",x:"ẋẍ",y:"ỳýŷÿỹȳẏẙỵỷỹ",z:"źżžẑẓẕ"};L=L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),n.value=Array.from(L).map(B=>Object.keys(k).includes(B)?"["+B+k[B]+"]":B.replace(/["$!*+?^{}()|[\]\\]/g,"").replace(/[.\\]/g,"\\$&").trim()).join("")}function R(L){if(L.visible!==void 0&&(t.value=L.visible),L.extent.sr.wkid!==4326)throw new Error("an extent that was not projected to wkid 4326 was passed to the geosearch store");e.value.extent=L.extent,m()}return{GSservice:i,queryParams:e,resultsVisible:t,searchVal:r,searchRegex:n,lastSearchVal:s,searchResults:o,savedResults:a,loadingResults:l,failedServices:u,getProvinces:c,getTypes:h,initService:p,runQuery:m,setProvince:v,setType:w,setSearchTerm:S,setSearchRegex:I,setMapExtent:R}}),_Te=xp("help",()=>({location:vi("./help/")}));var WO=(i=>(i.Visibility="visibilityButton",i.Expand="expandButton",i))(WO||{}),sp=(i=>(i.Item="item",i.Placeholder="placeholder",i.Error="error",i))(sp||{});class bTe extends tf{_uid;_name;_type;_children=[];_parent=void 0;_loadPromise;_hidden;_expanded;_visibility;_exclusive;_controls;_disabledControls;_lastVisible;_visibleChildren;constructor(e,t,r){super(e),this._uid=sH.sharedUtils.generateUUID(),this._name=t.name,this._type=t.type??"placeholder",this._parent=r,this._children=[],this._loadPromise=new Af,this._hidden=t.hidden??!1,this._expanded=t.expanded??!0,this._visibility=!0,this._exclusive=t.exclusive??!1,this._controls=t.controls?.slice()??["visibilityButton","expandButton"],this._disabledControls=t.disabledControls?.slice(),this._lastVisible,this._visibleChildren=[]}get uid(){return this._uid}get name(){return this._name}set name(e){this._name=e}get type(){return this._type}get children(){return this._children}set children(e){this._children=e}get parent(){return this._parent}set parent(e){this._parent=e}get loadPromise(){return this._loadPromise.getPromise()}get hidden(){return this._hidden}get expanded(){return this._expanded}get visibility(){return this._visibility}get exclusive(){return this._exclusive}controlAvailable(e){return this._disabledControls?.includes(e)?!1:this._controls?.includes(e)}setControl(e,t){t&&this._disabledControls?.includes(e)?(this._disabledControls=this._disabledControls.filter(r=>r!==e),this._controls?.push(e)):!t&&this._controls?.includes(e)&&(this._controls=this._controls.filter(r=>r!==e),this._disabledControls?.push(e))}toggleHidden(e){this._hidden=e??!this.hidden}toggleExpanded(e){this._expanded=e??!this.expanded}toggleVisibility(e,t=!0){if(this.visibility!==e){if(this._visibility=e??!this.visibility,!this.exclusive)this.visibility?this._visibleChildren.length>0?this._visibleChildren.forEach(r=>r.toggleVisibility(!0,!1)):this.children.forEach(r=>r.toggleVisibility(!0,!1)):this.children.forEach(r=>r.toggleVisibility(!1,!1));else if(this.visibility)if(this._lastVisible&&(!(this._lastVisible instanceof ou)||this._lastVisible.layerControlAvailable(ya.Visibility)))this._lastVisible.toggleVisibility(!0);else{const r=this.children.find(n=>!(n instanceof ou)||n.layerControlAvailable(ya.Visibility));r&&r.toggleVisibility(!0)}else this._lastVisible=this.children.find(r=>r.visibility),this._lastVisible?.toggleVisibility(!1);this.parent&&t&&this.parent.checkVisibility(this)}}checkVisibilityRules(){this.parent&&!this.parent.visibility?this.toggleVisibility(!1,!1):this.parent?.exclusive&&this.parent.children.some(t=>t.visibility&&t!==this&&t.type==="item")&&this.toggleVisibility(!1,!1)}checkVisibility(e){this instanceof ou&&!this.layerControlAvailable(ya.Visibility)||(this.exclusive?e.visibility?(this.children.forEach(t=>{t.uid!==e.uid&&t.toggleVisibility(!1,!1)}),this._lastVisible=e,this._visibility=!0,this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1),this._lastVisible=e):this.children.some(t=>t.visibility)?(this._visibility=!0,this._visibleChildren=this.children.filter(t=>t.visibility),this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!0)):(this._visibility=!1,this._visibleChildren=[],this instanceof ou&&this.layer&&this.layer.layerExists&&(this.layer.visibility=!1)),this.parent&&this.parent.checkVisibility(this))}getConfig(){const e={name:this._name,hidden:this._hidden,expanded:this._expanded,exclusive:this._exclusive,controls:this._controls,disabledControls:this._disabledControls},t=[];return this.children.forEach(r=>{t.push(r.getConfig())}),this.exclusive?e.exclusiveVisibility=t:e.children=t,e}onAdded(){}onRemoved(){this.toggleVisibility(!1)}load(){this._type="item",this._loadPromise.resolveMe(),this.checkVisibilityRules()}reload(){this._type="placeholder",this._loadPromise=new Af}error(){this._type="error",this._loadPromise.rejectMe(),this.checkVisibilityRules()}}class ou extends bTe{_layerId;_layerIdx;_layerUid="";_layer;_layerInitVis;_layerRedrawing=!1;_layerOffscale=!1;_loadCancelled=!1;_treeGrown=!1;_customSymbology=!1;_coverIcon;_description;_symbologyExpanded;_origLayerControls;_origLayerDisabledControls;_layerControls;_layerDisabledControls;_symbologyRenderStyle;_symbologyStack;handlers=[];constructor(e,t,r){super(e,t,r),this._type=sp.Placeholder,this._layerId=t.layerId,this._layerIdx=t.sublayerIndex,this._layerControls=t.layerControls??[],this._origLayerControls=t.layerControls,this._layerDisabledControls=t.disabledLayerControls??[],this._origLayerDisabledControls=t.disabledLayerControls,this._layerRedrawing=!1,this._symbologyExpanded=t.symbologyExpanded||!1,t.coverIcon&&(this._coverIcon=t.coverIcon),t.description&&(this._description=t.description),this._symbologyRenderStyle=t.symbologyRenderStyle??"icons",this._customSymbology=!!t.symbologyStack,this._symbologyStack=t.symbologyStack?.map(n=>({uid:this.$iApi.geo.shared.generateUUID(),label:n.text,definitionClause:n.sqlQuery,imgUrl:n.image??"",drawPromise:Promise.resolve(),visibility:!0,lastVisibility:!0}))}get parentLayerId(){return this._layerIdx?this._layerId.slice(0,this._layerId.length-`-${this._layerIdx}`.length):void 0}get layerId(){return this._layerId}get layerIdx(){return this._layerIdx}get layerUid(){return this._layerUid}get layer(){return this._layer}set layer(e){this._layer=e,this._layerId=e.id,this._layerIdx=e.layerIdx,this._layerUid=e.uid,this._name=this._name||e.name,this._symbologyStack=this._customSymbology?this._symbologyStack:e.legend,this.updateLayerControls()}get layerOffscale(){return this._layerOffscale}set layerOffscale(e){this._layerOffscale=e}get layerRedrawing(){return this._layerRedrawing}set layerRedrawing(e){this._layerRedrawing=e}get coverIcon(){return this._coverIcon}set coverIcon(e){this._coverIcon=e}get description(){return this._description}set description(e){this._description=e}get symbologyExpanded(){return this._symbologyExpanded}get treeGrown(){return this._treeGrown}set treeGrown(e){this._treeGrown=e}get loadCancelled(){return this._loadCancelled}set loadCancelled(e){this._loadCancelled=e}get origLayerControls(){return this._origLayerControls}get origDisabledLayerControls(){return this._origLayerDisabledControls}set symbologyRenderStyle(e){this._symbologyRenderStyle=e}get symbologyRenderStyle(){return this._symbologyRenderStyle}set symbologyStack(e){this._symbologyStack=e}get symbologyStack(){return this._symbologyStack}getConfig(){const e={layerId:this._layerId,sublayerIndex:this._layerIdx,layerControls:this._layerControls,disabledLayerControls:this._layerDisabledControls,symbologyExpanded:this._symbologyExpanded,coverIcon:this._coverIcon,description:this._description};return{...super.getConfig(),...e}}toggleVisibility(e,t=!0,r=!1){if(!((!this.layerControlAvailable(ya.Visibility)||this._loadCancelled)&&!r)&&(super.toggleVisibility(e,t),this.layer&&this.layer.layerExists)){this.layer.visibility=this.visibility;const n=this._symbologyStack.some(s=>s.lastVisbility);this._symbologyStack.forEach(s=>{n||(s.lastVisbility=!0),s.visibility=this.visibility?s.lastVisbility:!1})}}toggleSymbology(e){return this._symbologyExpanded=e??!this._symbologyExpanded,this._symbologyExpanded}setSymbologyVisibility(e,t){this._symbologyStack.some(r=>((e===void 0||r.uid===e)&&(r.visibility=t,r.lastVisbility=t),e!==void 0&&r.uid===e))}load(e){if(e){if(this._layer=e instanceof Rse?e:this.$iApi.geo.layer.getLayer(this._layerId??this._layerUid),this.layer=e,this._layerRedrawing=e.mapLayer&&e.drawState!==fb.UP_TO_DATE,this._loadCancelled){this.toggleVisibility(!1,!0,!0);return}this._layer?.loadPromise().then(()=>{this._layer?.layerType===pn.MAPIMAGE&&!this._layerIdx?(this.error(),console.error(`MapImageLayer has no sublayerIndex defined for layer: ${this._layerId}.`)):(this._layerInitVis=typeof this._layerInitVis<"u"?this._visibility:e.visibility,super.load(),this.toggleVisibility(this._layerInitVis,!0,!0),e.visibility||this.setSymbologyVisibility(void 0,!1)),this.handlers.push(this.$iApi.event.on(ln.LAYER_VISIBILITYCHANGE,t=>{t.layer.uid===this.layer.uid&&this._type===sp.Item&&this.toggleVisibility(t.visibility,!0,!0)})),this.handlers.push(this.$iApi.event.on(ln.LAYER_DRAWSTATECHANGE,t=>{this.layer.uid===t.layer.uid&&(t.layer.drawState===fb.REFRESH?this.layerRedrawing=!0:setTimeout(()=>{this.layerRedrawing=t.layer.drawState===fb.REFRESH},500))})),this._layerOffscale=this.$iApi.geo.map.created?this.layer?.isOffscale():!1,this.handlers.push(this.$iApi.event.on(ln.MAP_SCALECHANGE,()=>{this.$iApi.geo.map.created&&(this._layerOffscale=this.layer?.isOffscale())}))}).catch(()=>{this.error()})}}error(){this.updateLayerControls(),super.error(),this.toggleVisibility(!1,!0,!0)}layerControlAvailable(e){return this._layerDisabledControls?.includes(e)?!1:!!this._layerControls?.includes(e)}updateLayerControls(){const e=this.$iApi.geo.layer.getLayerControls(this.layerId)??this.$iApi.geo.layer.getLayerControls(this.parentLayerId??"");this._origLayerControls||(this._layerControls=e?.controls??[]),this._origLayerDisabledControls||(this._layerDisabledControls=e?.disabledControls??[])}}var fU=(i=>(i.Title="title",i.Text="text",i.Image="image",i.Markdown="markdown",i.Template="template",i))(fU||{});class H_e extends bTe{_infoType;_content;constructor(e,t,r){super(e,t,r),this._infoType=t.infoType??"title",this._content=t.content??"",t.infoType==="template"&&this.$element.component(`${this._uid}-info-section`,{template:this._content}),(t.infoType||t.content)&&(this._controls=t.controls?.slice()??[WO.Expand]),super.load()}get infoType(){return this._infoType}get content(){return this._content}set content(e){this._content=e}getConfig(){const e={infoType:this._infoType,content:this._content};return{...super.getConfig(),...e}}}const U5=xp("legend",()=>{const i=vi(),e=vi([]),t=vi([]);function r(o){if(o.parent===void 0)e.value.push(o.item);else{if(!(o.item instanceof H_e)&&!(o.item instanceof ou)){console.error("attempted to add an unsupported legend item type");return}o.parent.children.push(o.item)}}function n(o){const a=l=>(l=l.filter(u=>(u===o&&!u.children.length&&u.onRemoved(),u!==o)),l.forEach(u=>{u.children=a(u.children)}),l=l.filter(u=>!(u instanceof H_e&&!u.children.length&&u.content==="")),l);e.value=a(e.value)}function s(o){if(o.oldItem.parent===void 0){const a=e.value,l=a.indexOf(o.oldItem);l>-1&&(e.value[l]=o.newItem),e.value=a}else{const a=o.oldItem.parent.children,l=a.indexOf(o.oldItem);l>-1&&(a[l]=o.newItem),o.oldItem.parent.children=a}}return{legendConfig:i,children:e,headerControls:t,addItem:r,removeItem:n,replaceItem:s}}),oL=xp("mapnav",()=>{const i=vi({}),e=vi([]);function t(r){r in i.value&&delete i.value[r];const n=e.value.indexOf(r);n!==-1&&e.value.splice(n,1)}return{items:i,order:e,removeItem:t}}),IYe=xp("metadata",()=>{const i=vi(""),e=vi({type:"LineString",coordinates:[]});return{status:i,response:e}}),wTe=xp("northarrow",()=>{const i=vi(""),e=vi("");return{arrowIcon:i,poleIcon:e}}),ale=xp("overviewmap",()=>{const i=vi({lodSets:[],extentSets:[],basemaps:[],tileSchemas:[],initialBasemapId:""}),e=vi({}),t=vi(!0),r=vi(1.5),n=vi("#FF0000"),s=vi(1),o=vi("#000000"),a=vi(.25);function l(u){i.value.initialBasemapId=u}return{mapConfig:i,basemaps:e,startMinimized:t,expandFactor:r,borderColour:n,borderWidth:s,areaColour:o,areaOpacity:a,updateInitialBasemap:l}}),Pse=xp("scrollguard",()=>{const i=vi(!1);function e(t){i.value=t}return{enabled:i,setEnabled:e}});var ap=(i=>(i[i.UPLOAD=0]="UPLOAD",i[i.FORMAT=1]="FORMAT",i[i.CONFIGURE=2]="CONFIGURE",i))(ap||{});const AYe=xp("wizard",()=>{const i={id:"Placeholder",layerType:pn.UNKNOWN,url:""},e=vi(),t=vi(""),r=vi(""),n=vi(!0),s=vi(null),o=vi({config:i,configOptions:[]}),a=vi(ap.UPLOAD);function l(u){switch(a.value){case ap.UPLOAD:u===ap.UPLOAD?t.value="":u===ap.FORMAT&&(a.value=ap.FORMAT);break;case ap.FORMAT:u===ap.UPLOAD?(s.value&&(t.value="",s.value=null),r.value="",a.value=ap.UPLOAD):u===ap.CONFIGURE&&(a.value=ap.CONFIGURE);break;case ap.CONFIGURE:u===ap.UPLOAD?(t.value="",r.value="",s.value=null,n.value=!0,o.value={config:i,configOptions:[]},a.value=ap.UPLOAD):u===ap.FORMAT&&(o.value={config:i,configOptions:[]},n.value=!0,a.value=ap.FORMAT);break}}return{layerSource:e,url:t,typeSelection:r,nested:n,fileData:s,layerInfo:o,currStep:a,goToStep:l}});class dFr{fixture;panel;event;geo;notify;ui;startRequired=!1;$vApp;$element;$i18n;_isFullscreen;constructor(e,t,r){this.event=new CIr(this);const n=pFr(e,this);this.$vApp=n.app,this.$element=n.element,this.$i18n=n.i18n,this.fixture=new VLr(this),this.panel=new HLr(this),this.geo=new ULr(this),this.ui={maptip:this.geo.map.maptip,exposeOids:!1,exposeMeasurements:!0,getZoomIcon:()=>"",formatNumber:()=>"",scrollToInstance:!1,suppressNumberLocalization:!1,escapeHtml:()=>"",isPlainText:()=>!0},this.notify=new _Or(this),this._isFullscreen=UE.isEnabled&&!!this.$vApp.$root&&UE.isFullscreen&&UE.element===this.$vApp.$root.$el,UE.isEnabled&&UE.onchange(()=>{this._isFullscreen=UE.isEnabled&&!!this.$vApp.$root&&UE.isFullscreen&&UE.element===this.$vApp.$root.$el}),this.initialize(t,r)}initialize(e,t){const r=bm(this.$vApp.$pinia),n=w0(this.$vApp.$pinia),s=S_e(this.$vApp.$pinia);if(e?.configs!==void 0){const a=e.configs,l=a[this.$i18n.locale.value]??a[Object.keys(a)[0]];r.newConfig(l),r.registerConfig({config:l,configLangs:Object.keys(a),allLangs:Object.keys(this.$i18n.messages.value)});for(const m in a)r.registerConfig({config:a[m],configLangs:[m]});r.activeBasemapConfig=l.map.basemaps.find(m=>m.id===l.map.initialBasemapId);const u=setInterval(()=>{const m=this.$vApp.$el.querySelector("#esriMap");if(m&&(clearInterval(u),this.geo.map.createMap(l.map,m),m._tippy.hide(0),s.setMaptipInstance(m._tippy),l.layers&&l.layers.length>0)){let v=0;l.layers.forEach(w=>{const S=this.geo.layer.createLayer(w);this.geo.map.addLayer(S,v),S.mapLayer&&v++})}},100);if(l.panels){if(l.panels.open&&l.panels.open.length>0){const m=l.panels.open.map(v=>v.id);this.panel.isRegistered(m).then(()=>{l.panels?.open?.forEach(v=>{this.panel.open({id:v.id,screen:v.screen}),v.pin&&this.panel.pin(v.id)})})}n.reorderable=l.panels.reorderable??!0}!l.system?.animate&&this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.remove("animation-enabled"),l.system?.proxyUrl&&(this.geo.proxy=l.system.proxyUrl),l.system?.exposeOid&&(this.ui.exposeOids=l.system.exposeOid),l.system?.exposeMeasurements!=null&&(this.ui.exposeMeasurements=l.system.exposeMeasurements),l.system?.scrollToInstance&&(this.ui.scrollToInstance=l.system?.scrollToInstance),l.system?.suppressNumberLocalization&&(this.ui.suppressNumberLocalization=l.system?.suppressNumberLocalization);const c={magnify:'',globe:''},h=l.system?.zoomIcon||"globe",p=c[h]||h;this.ui.getZoomIcon=()=>p,this.ui.formatNumber=m=>this.ui.suppressNumberLocalization?m.toString():this.$i18n.n(m,"number"),this.ui.escapeHtml=m=>{const v={"<":"<",">":">",'"':""","'":"'"};return m.replace(/[<>"']/g,w=>v[w])},this.ui.isPlainText=m=>typeof m=="string"?!this.containsValidHtml(m)&&!this.representsObject(m):!1}t||(t={});const o=dU(this.$vApp.$pinia);t?.startRequired?(this.startRequired=!0,o.started=!1):(this.startRequired=!1,o.started=!0,this.event.emit(ln.MAP_START)),(t.loadDefaultFixtures!==!1||e?.startingFixtures!==void 0)&&this.fixture.addDefaultFixtures(e?.startingFixtures),t.loadDefaultEvents!==!1&&this.event.addDefaultEvents()}reload(e,t){const r=dU(this.$vApp.$pinia),n=w3(this.$vApp.$pinia),s=bm(this.$vApp.$pinia),o=oA(this.$vApp.$pinia),a=H1(this.$vApp.$pinia),l=bB(this.$vApp.$pinia);Object.keys(o.items).forEach(h=>{this.fixture.exists(h)&&this.fixture.remove(h)}),Object.keys(l.grids).forEach(h=>{l.removeGrid(h)}),r.started=!1,this.geo.map.destroyMap(),a.$reset(),this.event.offAll(),e===void 0&&(e=JSON.parse(JSON.stringify({startingFixtures:s.startingFixtures,configs:s.registeredConfigs}))),n.clearAll(),this.geo.map.maptip.clear(),this.initialize(e,t)}component(e,t){if(t){const r=this.$element.component(e,t);return this.event.emit(ln.COMPONENT,e),r}return this.$element.component(e)}get screenSize(){if(!this.$vApp?.$root||!this.$vApp.$root.$refs["app-size"])return null;const e=this.$vApp.$root.$refs["app-size"].classList;return e.contains("lg")?"lg":e.contains("md")?"md":e.contains("sm")?"sm":"xs"}getConfig(){const e=bm(this.$vApp.$pinia);return JSON.parse(JSON.stringify(e.getActiveConfig(this.language)))}useStore(e){if(!(["appbar","areas-of-interest","details","export","extentguard","geosearch","grid","help","legend","mapnav","metadata","northarrow","overviewmap","scrollguard","wizard"].includes(e)&&!this.fixture.exists(e)))switch(e){case"appbar":return dy(this.$vApp.$pinia);case"areas-of-interest":return yTe(this.$vApp.$pinia);case"details":return tL(this.$vApp.$pinia);case"export":return pq(this.$vApp.$pinia);case"extentguard":return ure(this.$vApp.$pinia);case"geosearch":return SB(this.$vApp.$pinia);case"grid":return bB(this.$vApp.$pinia);case"help":return _Te(this.$vApp.$pinia);case"legend":return U5(this.$vApp.$pinia);case"mapnav":return oL(this.$vApp.$pinia);case"metadata":return IYe(this.$vApp.$pinia);case"northarrow":return wTe(this.$vApp.$pinia);case"overviewmap":return ale(this.$vApp.$pinia);case"scrollguard":return Pse(this.$vApp.$pinia);case"wizard":return AYe(this.$vApp.$pinia);case"config":return bm(this.$vApp.$pinia);case"fixture":return oA(this.$vApp.$pinia);case"instance":return dU(this.$vApp.$pinia);case"layer":return H1(this.$vApp.$pinia);case"map-caption":return oF(this.$vApp.$pinia);case"maptip":return S_e(this.$vApp.$pinia);case"notification":return w3(this.$vApp.$pinia);case"panel":return w0(this.$vApp.$pinia);default:console.error(`The store ${e} does not exist.`);return}}setLanguage(e){if(this.$i18n.locale.value===e)return;const r=bm(this.$vApp.$pinia).registeredLangs;if(r[e]===r[this.$i18n.locale.value]){this.$i18n.locale.value=e;return}this.$i18n.locale.value=e;const n=this.getConfig();this.event.emit(ln.CONFIG_CHANGE,n),this.reload()}get language(){return this.$vApp.$i18n.locale}get animate(){return!!(this.$element._container&&this.$element._container.children[0]&&this.$element._container.children[0].classList.contains("animation-enabled"))}toggleFullscreen(){UE.isEnabled&&UE.toggle(this.$element._container||void 0)}get isFullscreen(){return this._isFullscreen}get started(){return dU(this.$vApp.$pinia).started}updateAlert(e){const t=this.$vApp.$el.querySelector(".screen-reader-alert");t.childNodes.length>0&&(t.innerHTML="");const r=document.createElement("span");r.setAttribute("role","alert");const n=document.createTextNode(e);r.appendChild(n),t.insertBefore(r,null)}scrollToInstance(){this.ui.scrollToInstance&&this.$element._container?.scrollIntoView({behavior:"smooth"})}start(){const e=dU(this.$vApp.$pinia);!e.started&&this.startRequired?(this.event.emit(ln.MAP_START),e.started=!0):e.started&&console.warn("start has already been called")}containsValidHtml(e){return/<(\w+)([^>]*)>(.*?)<\/\1>/.test(e)}representsObject(e){return/^(?:\[\s*(?:[\s\S]*?)\s*\]|\{\s*(?:[\s\S]*?)\s*\})$/.test(e)}}function pFr(i,e){const t=yIr();t.use(({store:o})=>{const a=Qct(o.$state);o.$reset=()=>o.$patch(Qct(a))});const r=E3r(),n=YW(NDr).use(r).use(RDr,{directive:"tippy",component:"tippy"}).use(t);n.directive("focus-container",HDr),n.directive("focus-list",jDr),n.directive("focus-item",UDr),n.directive("truncate",O4r),n.component("panel-screen",B4r),n.component("pin",H4r),n.component("close",J4r),n.component("back",t5r),n.component("expand",m5r),n.component("panel-options-menu",F5r),n.component("dropdown-menu",cYe),n.component("minimize",b5r),n.component("right",C5r),n.component("left",O5r),n.component("fullscreen-nav-button",z5r),n.component("geolocator-nav-button",H5r),n.component("home-nav-button",q5r),n.component("mapnav-button",J5r),n.component("appbar-button",eFr),n.component("transition",eL),n.component("transition-group",XSe),n.config.globalProperties.$iApi=e,n.config.globalProperties.$pinia=t,n.provide("iApi",e);const s=n.mount(i);return{element:n,app:s,i18n:r.global}}class A6t{esriBasemap;config;constructor(e){this.config=e,this.esriBasemap=new kV({baseLayers:e.layers.map(t=>{if(t.layerType===pn.TILE)return new KHe({url:t.url,opacity:t.opacity});if(t.layerType===pn.MAPIMAGE)return new qHe({url:t.url,opacity:t.opacity});if(t.layerType===pn.OSM)return new XHe({opacity:t.opacity});throw new Error(`Unsupported layer type provided to basemap config: ${t.layerType}`)}),title:e.name||"",id:e.id})}get tileSchemaId(){return this.config.tileSchemaId}get id(){return this.config.id}get name(){return this.config.name}set name(e){this.config.name=e||""}get description(){return this.config.description}set description(e){this.config.description=e||""}get altText(){return this.config.altText}set altText(e){this.config.altText=e||""}get attribution(){return this.config.attribution}set attribution(e){this.config.attribution=e}get backgroundColour(){return this.config.backgroundColour??"#FFFFFF"}}class M6t extends tf{esriMap;_basemapStore;created=!1;trackFirstBasemap=!1;esriView;_viewPromise;get viewPromise(){return this._viewPromise.getPromise()}_rampSR;_rampExtentSet;_targetDiv;handlers;pointZoomScale;constructor(e){super(e),this.esriMap=void 0,this._basemapStore=[],this._viewPromise=new Af,this.handlers=[],this.pointZoomScale=5e4}noMapErr(){console.error("Attempted to manipulate the map before calling createMap()")}abstractError(){throw new Error("Attempted to call an abstract method in the parent CommonMapAPI")}labelsDefault={visible:void 0};createMap(e,t){this._basemapStore=e.basemaps.map(n=>{const s=new A6t(n);return s.esriBasemap.baseLayers.forEach(o=>{o.watch("loadStatus",()=>{o.loadStatus==="loaded"?this.trackFirstBasemap=!1:o.loadStatus==="failed"&&(this.$iApi.notify.show(K1.ERROR,this.$iApi.$i18n.t("layer.error",{id:s.name})),this.trackFirstBasemap&&this.recoverBasemap(s.tileSchemaId))})}),s}),e.labelsDefault&&(this.labelsDefault.visible=e.labelsDefault.visible);const r={};this.esriMap=Da(new ZDt(r)),this.pointZoomScale=e.pointZoomScale&&e.pointZoomScale>0?e.pointZoomScale:5e4,this._targetDiv=t,this.createMapView(e.initialBasemapId)}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMapView(),this.esriMap.destroy(),delete this.esriMap,this._basemapStore.forEach(e=>e.esriBasemap.destroy()),this._basemapStore=[]}reloadMap(e,t){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.destroyMap(),this.createMap(e,t)}createMapView(e){this.abstractError()}destroyMapView(){if(!this.esriView){this.noMapErr();return}this._viewPromise=new Af,this.created=!1,this.handlers.forEach(e=>e.handler.remove()),this.handlers=[],this.esriView.map=null,this.esriView.container=null,this.esriView.spatialReference=null,this.esriView.extent=null,this.esriView.navigation=null,this.esriView.destroy(),delete this.esriView}findBasemap(e){const t=this._basemapStore.find(r=>r.id===e);if(t)return t;throw new Error(`Invalid basemap id requested: ${e}`)}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const t=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(t.esriBasemap)}setBasemap(e){return this.abstractError(),!1}recoverBasemap(e){}getCurrentBasemapId(){if(this.esriMap)return this.esriMap.basemap.id;this.noMapErr()}geomToMapSR(e){if(!this._rampSR)throw new Error("call to map.geomToMapSR before the map spatial ref was created");return this._rampSR.isEqual(e.sr)?Promise.resolve(e):this.$iApi.geo.proj.projectGeometry(this._rampSR,e)}async zoomMapTo(e,t,r=!0,n=200,s="ease"){if(this.esriView){if(e.invalid())throw new Error("attempt to zoom to invalid geometry");const o=await this.geomToMapSR(e),a={target:this.$iApi.geo.geom.geomRampToEsri(o)};o.type===cl.POINT&&(a.scale=t||this.pointZoomScale);const l={animate:r,duration:n,easing:s};return this.viewPromise.then(()=>this.esriView.goTo(a,l))}else this.noMapErr()}getZoomLevel(){return this.esriView?this.esriView.zoom:(this.noMapErr(),1)}getScale(){return this.esriView?this.esriView.scale:(this.noMapErr(),1)}getResolution(){return this.esriView?this.esriView.resolution:(this.noMapErr(),1)}getExtent(){return this.esriView?Yh.fromESRI(this.esriView.extent):(this.noMapErr(),Yh.fromParams("i_am_error",0,1,0,1))}getExtentSet(){return this._rampExtentSet?this._rampExtentSet:(this.noMapErr(),rse.fromConfig({id:"i_am_error_extent_set",default:{xmin:0,xmax:1,ymin:0,ymax:1,spatialReference:{wkid:4326}}}))}getSR(){return this._rampSR?this._rampSR.clone():(this.noMapErr(),xl.latLongSR())}getPixelHeight(){return this.esriView?this.esriView.height:(this.noMapErr(),1)}getPixelWidth(){return this.esriView?this.esriView.width:(this.noMapErr(),1)}setPointZoomScale(e){return e>0?(this.pointZoomScale=e,!0):(console.error(`Cannot set pointZoomScale to non-positive number: ${e}.`),!1)}}class fFr extends tf{maptipStore;constructor(e){super(e),this.maptipStore=S_e(this.$vApp.$pinia)}#e=void 0;#t=void 0;async checkAtCoord(e){this.#t=e;const t=await this.$iApi.geo.map.getGraphicAtCoord(e);if(this.#t!==e)return;if(!t){this.clear();return}const r=this.$iApi.geo.layer.getLayer(t.layerId);if(r?.geomType!=cl.POLYGON&&this.#e&&this.#e.layerId===t.layerId&&this.#e.oid===t.oid&&this.#e.layerIdx===t.layerIdx)return;if(this.clear(),this.#e=t,!r){console.error(`graphic hit test returned non-existent layer id: ${t.layerId}`);return}if(!r.hovertips)return;const n=await r.getIcon(t.oid),s=await r.getGraphic(t.oid,{getAttribs:!0});this.setPoint(this.$iApi.geo.map.screenPointToMapPoint(e)),this.$iApi.event.emit(ln.MAP_GRAPHICHIT,{layer:r,graphicHit:t,attributes:s.attributes,icon:n,screenPoint:e})}generateDefaultMaptip(e){this.setContent(`
${e.icon}${e.attributes[e.layer.config.tooltipField||e.layer.nameField]}
`)}clear(){this.#e=void 0,this.maptipStore.setMaptipPoint(void 0),this.maptipStore.setMaptipContent("")}getInstance(){return this.maptipStore.maptipInstance}getPoint(){return this.maptipStore.maptipPoint}setPoint(e){this.maptipStore.setMaptipPoint(e)}setContent(e){this.maptipStore.setMaptipContent(e)}}class mFr extends M6t{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:pn.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=ale(this.$vApp.$pinia)}createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?this.findBasemap(e):e;this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const r=this.overviewmapStore.expandFactor;this.esriView=Da(new CFt({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(r)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",n=>{n.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",n=>{n.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",n=>{n.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",n=>{n.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",n=>{n.stopPropagation(),this.mapDrag(n)})}),this.esriView.container.addEventListener("touchmove",n=>{n.preventDefault()}),this.esriView.watch("fatalError",()=>{const n=new IntersectionObserver(s=>{s.forEach(o=>{o.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),n.disconnect())})});n.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new Ax(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",r=this.overviewmapStore.borderWidth??1,n=this.overviewmapStore.areaColour??"#000000",s=this.overviewmapStore.areaOpacity??.25,o=`${n}${Math.round(s*255).toString(16)}`;e.style=new jW({fill:{colour:o},outline:{colour:t,width:r}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),await this.overviewGraphicLayer.terminate(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer)}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}findBasemap(e){const t=this._basemapStore.find(r=>r.id===e);if(t)return t;{const n=bm(this.$vApp.$pinia).config.map;if(n){const s=n.basemaps.find(o=>o.id===e);if(s)return new A6t(s)}}throw new Error(`Invalid basemap id requested: ${e}`)}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=this.findBasemap(e),n=(this.getCurrentBasemapId()?this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return n?(this.destroyMapView(),this.createMapView(t)):this.applyBasemap(t),n}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=Da(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),r=this.esriView.toMap({x:e.x,y:e.y}),n=this.startExtent.clone().offset(r.x-t.x,r.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=n,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(n),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,r=this.zoomMapTo(e.expand(t),void 0,!1),n=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(n),n.geometry=e,this.overviewGraphicLayer.addGraphic(n),r}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class gFr extends tf{DEFAULT_POINT_FORMATTERS={LAT_LONG_DMS:this.formatLatLongDMS,LAT_LONG_DD:this.formatLatLongDD,LAT_LONG_DDM:this.formatLatLongDDM,WEB_MERCATOR:this.formatMercator,CANADA_ATLAS_LAMBERT:this.formatLambert,UTM:this.formatUTM,BASEMAP:this.formatBasemap};pointFormatter;constructor(e){super(e),this.pointFormatter=this.DEFAULT_POINT_FORMATTERS.LAT_LONG_DMS}createCaption(e){if(!e)return;const t=oF(this.$vApp.$pinia);if(t.coords.disabled=!1,t.scale.disabled=!1,t.scale.isImperialScale=!1,e.mapCoords)if(e.mapCoords.disabled)t.coords.disabled=!0;else{const r=e.mapCoords.formatter;r!==void 0&&this.setPointFormatter(r)}if(e.scaleBar)if(e.scaleBar.disabled)t.scale.disabled=!0;else{const r=e.scaleBar.imperialScale;r!==void 0&&(t.toggleScale(r),this.$iApi.geo.map.viewPromise.then(()=>{this.updateScale()}))}t.langtoggle={disabled:e?.langToggle?.disabled??!1}}updateAttribution(e){const t={disabled:!1,value:this.$iApi.$i18n.t("caption.attributionDefaultText")},r={disabled:!1,altText:this.$iApi.$i18n.t("caption.attributionLogoAltText"),link:this.$iApi.$i18n.t("caption.attributionLink"),value:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAkCAYAAADWzlesAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADO9JREFUeNq0Wgl0jlca/pfvzyo6qNBSmhLLKE1kKEUtB9NTat+OYnBacwwJY19DZRC7sR41th60lWaizFSqRTOEw0lsrQSJGFIESSxJ/uRfv3nef+7Vt9f3p2E695z3fMt97/3ufe+7PO+9n9n0UzELsjKyiHdUdMZnVHTl2VyFe9nO7Kc/Io+4epUxmpWxeVkbr3hvUebgFf15GL9XUwZHndtAAYI09jGvIghOuoEwLOLeYiBoXrwGfZjYYOWAvWyMGlsk2YebXeV3NUEW1qcT5BBX4jUbCYEmHwwKEfdW1gEXgoWtiIlNRFeezcrkrQaTNSuraRYDdImrR1ylAALZBPnkXIJ0wRskeG2Cj3jsoFI2HhcfDDFWA9UBNdZZyc/PP4Z3HZYsWTLGbrffond0Xb9+/Qy6P3jw4F+HDx8+mu7XrVs3c+7cuX+i+3nz5o3n/Rw4cGAdf/7hhx9SZ8yYEcffHT9+/G/8uaSkJGvDhg3D8P3moNdXrlw5UtYVFxfnXL9+/V8PHz68grr2N2/eTC4tLb2E+9+Cotq1a/dOenr6njt37nxPdOrUqd0dO3bsjromoHBQKBPkEyFUB71MH6SPbNy4cRqfkMvlenzixImtqO/x3XffbXc6nSW5ubnpOTk5J1NTU/cQH91//fXXu3/88ccLy5cvj6d34B8gaBA9JyQk/OWjjz5aIu8Fz2DiWbZs2QLx/A4m0Qf9f/n48eNsPEeDfrdly5Y/U31UVNT7dJ04ceIsGseNGzfS6DkuLq4v8YE6Y/G+93g8XKZ6QUHBRVHfAPQC0xJfCRAv65EkeUP6gFx11JEkfw/qTc8ff/zxKofDUXrv3r08rOIBeU9CWbx48SLej5y4LGlpaf9YuHDhUv5OtqH+6Vty0riPAbWjheH8n3322VYpuG+//Xa5mGB7CGM8hKN7vV5dLfHx8WNI20E1aN4WP97YZyc7d+6MM5vNHRs2bDg3NjY23e12l5w8eZJWzIUJ9IdmlI4bNy4tICAgtHbt2hGdOnXaSe3oftu2bWmBgYFOn3MwmwcQLViwIJOeYVYJGGAZVuW2zWZzCZ6hoIGapnmknUMTQnr16vUeTOKydHqyHrx9t27dunro0KEfzJw5M4Pe3bp166Z0pHXr1g0Fj2EYCw8PD+N+SjNwUuSAKnxexOkswOWxZN63b9/MAQMGzIUwx5WXl99eunTpFLx+hJU/K9o/yM7OPhgZGdk5KSkpp0WLFv+Vrq7/na5nz57dR1dM6t7hw4e3DRkyJG7WrFlxgudzukIw58TzV3SF3Z+ByUzFbTk5O9j8fVH/JV3PnTv3uRijSdSR5/empKRkT5kypQxCC+UTxMKVQXuyWBT5WbiS4VFjIZLHWQsLN1ZFgFbm0U1KSNWUUMlDp9kAh0iNdCkRwiva2FjUsjJeJ5sYRYQwCGIYNGk8tC1UCuDQoUOb+vbtuxuPRUJ4FVwIFhZ7pUD45OXEbUpo9DIz8hgAFk0BORblWypm8BiQzkKnpoRnM+PxsEWhiYfFxMTUHTx4cDOYhg7tzM7IyLhNCiYEUEbCMxsAGYuCGjl4ClKE4GY+xCnIw95zBKqxvmyCOJqT7dws5ntZzLcoaJEjQiPUahMaESzudWEqhBEeiSuZvUvzA1+lxIMEhbD7QGYKUl0rBAgxC9vlq6IzNZZ9BYt+rMw8pBDLmSZZFBPQmBC8imaofo1roa5oKH82aQaaIH0CDTZM0sCBAxvBKbZ+7bXXGr3yyisN4ZjMDx48uAeAkofQdHbt2rUXhIpJKevMJwSLfqq3bt365enTp3eFh365SZMmBGpMFRUVZcAV1wFmzs2ZMyddtCkXk9ESExOjq1Wr9iLCbwAilA9xwrnlwimS4G2ffvppj1atWrWoWbNmbWCKAtj9V5MnT84cMWJEvTfeeKM+wqSFzCEoKMgJ3HEVgO6SkTlKMwgUgImwArn2DpMmTYrDALP0XyjEA9sbjTZtQZGij7qghqBWoK4AWPswkbLK+qHIsWPHjoXgfwvUhsZAAEflg+dfg0kuBlosUuvoO2jXl65qXWZm5g7UNRPIOIQLQqpcmECMJIAuRp1UVmiCACmTxAReFx+LhnPqV1hY+O9n6evIkSObSXCEHI0WASDtMMJ0uVHb7du3E6p9HxpxQK0DjN4r0Gc9kSZYeZiSNkuaUOv06dPTO3fuPNj0DAWgKWTFihVL+vfvT0J8kfohAsobV6tWrYbP0hf460pnLE2AF2jB21DvIKO2gO6FNB+ERJtaB+xjY37NN3+LogmkHi9s2rTp3bZt277LG8NuK5AopXbv3n0O7Gtsjx49ZmNye6GOD1RBwD9MFUKoSQSc30UdzJUrV26uWrVqP7D/lt27d+9/9OhRMas7gjYbhROzkv9R2wcHBwdWshjkYL1G7SBQTXGwTwQQLLIqWsGeGFAhVyFSO6C7Naj7ADRUJENDQGMjIiLmQl0LVLUbNWrUItSPhBNcodYhFyFklwAiYf0RNKZZs2YfFhUVXYcAvhFm0FFc++fl5eX4Mxto7JnRo0cvID4yHWSz70dHRw+khAxZ6yGVH8ndftS9DWokciWNx15fTN2zZ0+f6tWr1+LS279/fwYgcz4LPzJvdyGVLUFidFiVOIRAqx8KlQysZCdKboJUXL58uRAmMLFp06aLRbh1cGhrVEiD3nzzzTXIcU5R6gC6vXfv3kuIGgSIyq1Wq6cqpmdhiNAXFtu0adNeZVq9enUWA0xywyVECC4AicwttQ2SrvpkYnfv3i1X6xo0aPAiJv2H+fPnt27UqFEN4YsCDBCk33Lt2rW8kSNHJuP2LqUc4kq+4KFAgg6LxeKtSl+a4hMC6tSp85QD27VrVy9I1U2SJaKYS/ZG8Rf5uhVXq91ud4aEhATINo0bN46glUQMv4aQV46MMpj3iRVvsGjRohFEENQtygCRmZ5B6DsqNNPFANJT5cyZM5RoPRBE/qREaJYEYm4aZ1WFwDG9ppoClebNm9czPV/xYXOo6J4xY8Z84I8Jgq9HBCDVfsKECR+mpqZ+gSQnRVQHGTm4CxcuXBP9l4qrneUNPtheVSFYKtkF/jUKqWbx2LFjUxBJViA82asSZvv06TPq+PHjE/D4GzI70jiVT+xDyBzDo8DhZyoWNXsD4Cn/FYVQLKgIofCfMIkhgKyr4bhO8pBoVGgvsEuXLq+SEIw0Qayyl5H+vIPUmJf2ZYOwz5twXE05U/369TfBZu+wvMBpkH7L3dwyYZ+l4uoRPL50FzCcQuAJstvIyMjacG5Rw4YN64b7V9XBxcbGdgJq/cZIE4TT0/2ceTyzJsiMj0JSxfnz50+rTECBUUq2aGd2WC7Izib+WFwdLJs0sczT1w+Q3d34+PhTSKQ2w4GeVL9LTtefY1Q2YEz/qxC8LIe3f/LJJ2kqU79+/WIGDRpUj+0L8N0lG7B6N+QGiS1btgxR9ha8gi949uzZ0UiENgBSR4iQyFNiL0zkrh+V/78XfjJDq1aWnJx85dixY8kqRE1KSopNSUkZ0K1btwjhsGpMmzatbVZW1nTy/JQbQHUXA26HMRul/gOQHkcBUK1BBGiJFHgtcMV7YqeXeEM7dOhQB4lXh6dCS1kZaZbDSBjinV6ZhsBkdAMz0o00SO4hhIrUl7K/7vfv37+hP0eBw8tBftFRpNNNExMThyMqlKp8SEXsADy5t1GM+qF6CHwe+hifm5t7Ta1PSEiYj7rWIhsMZaCPEkDyL+2PHj36hdqO3lGd4KkuYbN0jC5h22TPRT179pwCZ5j9rKqF0FWtd+/eL0kBA9Y2kRudvBB4og2al1CM+iFsgQFfJTCkaZrboL2DhUfd4NjAadROvHPyvUsLayxNghxaMWw0D1EhFiguqSrxXWZ/EN7IyZMnX5QHn127dk0Gxo+nnd6q9EHf2rx58zJgC1oxSrQKgR1cKl9YWJhdOFg329TlC1oBM3YYZJ8OubcozVZTJPjkzEEwOBGr1yIr+xz23xX23i48PPxVjiqRQV6GRuetXLkSbiPpCsPuTulzEAYPAh+cnzp1ao+YmJi31D5gevkwo3sZGRmn0M+RzMzMAhFtaGG0ixcvfpmfn39WbpNBC1zILK8KHqdykCsXszQ7O/sE8WMBNKGlbrxLF1HsSeQyV5JQBSrJUghLdDQmKB46ywTJFTKzfqqxftScwM1OjGXY/Vl0UU7IHcq3XMrutkz0QsX3bOwEWo5TfsNj9hMxjP5VCFR2fPl/AS4xMH7u71X6CWR92JQjer5t72AHLrpyKGRRhKbCZrNybhJg8HvBU+385Qv8DMKi/BjBEaKuHJK42YDU/x789cFhu1s5cFH/hTAp3/UqhzMm5cTM6G8br/qnyi8lTWYDoZiUP1TUEyc1Ble1D5OSA+gG7U0GR3b+fhUy+kVIN0Kb/xFgANrk0XIqRaL0AAAAAElFTkSuQmCC"},n={text:{value:"",disabled:!1},logo:{disabled:!1,altText:"",link:"",value:""}};if(e?(e.logo?e.logo.disabled?n.logo.disabled=!0:(n.logo.altText=e.logo.altText||r.altText,n.logo.link=e.logo.link||r.link,n.logo.value=e.logo.value||r.value):(n.logo.altText=r.altText,n.logo.link=r.link,n.logo.value=r.value),e.text?e.text.disabled?n.text.disabled=!0:n.text.value=e.text.value||t.value:n.text.value=t.value,oF(this.$vApp.$pinia).setAttribution(n)):(n.logo.altText=r.altText,n.logo.link=r.link,n.logo.value=r.value,n.text.value=t.value),!e||e.text?.disabled||!e.text){if(!this.$iApi.geo.map.esriMap){console.warn("Attempted to fetch map attribution with undefined map");return}let s="";const o=5e3,a=20,l=this.$iApi.geo.map.esriMap.basemap.baseLayers.map(u=>new Promise(c=>{let h=0;const p=o/a,m=setInterval(function(){u.loaded&&!u.loadError?(clearInterval(m),c(u)):h>p&&(clearInterval(m),c(null)),h++},a)})).toArray();Promise.all(l).then(u=>{s=u.filter(h=>h?.copyright).map(h=>h.copyright).join(" | "),n.text.value=s||n.text.value||t.value,oF(this.$vApp.$pinia).setAttribution(n)})}}updateScale(){const e=oF(this.$vApp.$pinia),t=e.scale;if(t?.disabled)return;const r=t?.isImperialScale||!1,n=this.scaleHelper().find(s=>s.isImperialScale===r)??{isImperialScale:!1,units:"error",pixels:1,distance:1};e.scale={width:`${n.pixels}px`,label:`${this.$iApi.$i18n.n(n.distance,"number")}${n.units}`,isImperialScale:r}}async formatPoint(e){return e?await this.pointFormatter(e):""}setPointFormatter(e){if(typeof e=="string"){if(!(e in this.DEFAULT_POINT_FORMATTERS)){console.warn(`Could not find point formatter with id: ${e}`);return}this.pointFormatter=this.DEFAULT_POINT_FORMATTERS[e]}else this.pointFormatter=e}scaleHelper(){const e=window.innerWidth>600?70:35,t=this.$iApi.geo.map.getResolution(),r=[],n=t*e,s=1609.34,o=3.28084,a=n>1e3?["km","mi"]:["m","ft"];for(let l=0;l<2;l++){const u=l===1;if(r.push({isImperialScale:u,units:a[l],pixels:0,distance:0}),n>1e3){const c=t*e/(u?s:1e3),h=Math.round(c).toString().length,p=Math.pow(10,h-1);r[l].distance=Math.ceil(c/p)*p,r[l].pixels=r[l].distance*(u?s:1e3)/t}else r[l].distance=Math.ceil(u?n*o:n),r[l].pixels=n/t}return r}wrapValue(e,t,r){return((e-t)%(r-t)+(r-t))%(r-t)+t}async formatLatLongDMS(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.floor(Math.abs(r))*(r<0?-1:1),a=Math.floor(Math.abs((r-o)*60)),l=Math.floor((Math.abs(r)-Math.abs(o)-a/60)*3600),u=Math.floor(Math.abs(n))*(n<0?-1:1),c=Math.floor(Math.abs((n-u)*60)),h=Math.floor((Math.abs(n)-Math.abs(u)-c/60)*3600);return`${this.$iApi.$i18n.n(Math.abs(o),"number")}${s} ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(l,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(u),"number")}${s} ${this.$iApi.$i18n.n(c,"number",{minimumIntegerDigits:2})}' ${this.$iApi.$i18n.n(h,"number",{minimumIntegerDigits:2})}" ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDDM(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.floor(Math.abs(r))*(r<0?-1:1),a=Math.abs((r-o)*60),l=Math.floor(Math.abs(n))*(n<0?-1:1),u=Math.abs((n-l)*60);return`${this.$iApi.$i18n.n(Math.abs(o),"number")}${s} ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(Math.abs(l),"number")}${s} ${this.$iApi.$i18n.n(u,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatLatLongDD(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s="°",o=Math.abs(r),a=Math.abs(n);return`${this.$iApi.$i18n.n(o,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${s} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} | ${this.$iApi.$i18n.n(a,"number",{minimumIntegerDigits:2,minimumFractionDigits:5,maximumFractionDigits:5})}${s} ${this.$iApi.$i18n.t("map.coordinates."+(0>n?"west":"east"))}`}async formatMercator(e){const t=await this.$iApi.geo.proj.projectGeometry(102100,e);return`${this.$iApi.$i18n.n(Math.floor(t.x),"number")} m | ${this.$iApi.$i18n.n(Math.floor(t.y),"number")} m`}async formatLambert(e){const t=await this.$iApi.geo.proj.projectGeometry(3978,e);return`${this.$iApi.$i18n.n(Math.abs(Math.floor(t.x)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(0>t.x?"west":"east"))} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(t.y)),"number")} m ${this.$iApi.$i18n.t("map.coordinates."+(t.y>0?"north":"south"))}`}async formatUTM(e){const t=await this.$iApi.geo.proj.projectGeometry(4326,e),r=this.wrapValue(t.y,-90,90),n=this.wrapValue(t.x,-180,180),s=Math.ceil((n+180)/6),o=await this.$iApi.geo.proj.projectGeometry(parseInt("326"+s),e);return`${this.$iApi.$i18n.n(s,"number",{minimumIntegerDigits:2})} ${this.$iApi.$i18n.t("map.coordinates."+(r>0?"north":"south"))} ${this.$iApi.$i18n.n(Math.floor(o.x),"number")} m${this.$iApi.$i18n.t("map.coordinates.east")} | ${this.$iApi.$i18n.n(Math.abs(Math.floor(o.y)),"number")} m${this.$iApi.$i18n.t("map.coordinates.north")}`}async formatBasemap(e){const t=await this.$iApi.geo.proj.projectGeometry(this.$iApi.geo.map.getSR(),e);return`${this.$iApi.$i18n.n(t.x,"number")} | ${this.$iApi.$i18n.n(t.y,"number")}`}}class yFr extends M6t{maptip;caption;mapMouseThrottle;layerDefaultTimes={draw:0,load:0};constructor(e){super(e),this.maptip=new fFr(e),this.caption=new gFr(e),this.mapMouseThrottle=0}createMap(e,t){this.setMapMouseThrottle(e.mapMouseThrottle??0),this.trackFirstBasemap=!0,super.createMap(e,t),this.layerDefaultTimes.draw=e.layerTimeDefault?.expectedDrawTime??1e4,this.layerDefaultTimes.load=e.layerTimeDefault?.expectedLoadTime??1e4,this.viewPromise.then(()=>{this.$iApi.event.emit(ln.MAP_CREATED)})}destroyMap(){if(!this.esriMap||!this.esriView){this.noMapErr();return}this.$iApi.geo.layer.allLayersOnMap(!1).map(e=>e.uid).forEach(e=>this.removeLayer(e)),super.destroyMap(),this.$iApi.event.emit(ln.MAP_DESTROYED)}createMapView(e){const r=bm(this.$vApp.$pinia).config.map;if(!r)throw new Error("Attempted to create map view without a map config");const n=(typeof e=="string"?this.findBasemap(e):e)||this.findBasemap(r.initialBasemapId),s=r.tileSchemas.find(l=>l.id===n.tileSchemaId);if(!s)throw new Error(`Could not find tile schema for the given basemap id: ${n.id}`);const o=r.extentSets.find(l=>l.id===s.extentSetId);if(!o)throw new Error(`Could not find extent set with the given id: ${s.extentSetId}`);this._rampExtentSet=rse.fromConfig(o),this._rampSR=this._rampExtentSet.sr.clone();const a=r.lodSets.find(l=>l.id===s.lodSetId);if(!a)throw new Error(`Could not find lod set with the given id: ${s.lodSetId}`);this.esriView=Da(new CFt({map:this.esriMap,container:this._targetDiv,constraints:{lods:a.lods,rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this._rampExtentSet.defaultExtent.toESRI(),navigation:{browserTouchPanEnabled:!1},background:{color:n.backgroundColour}})),this.esriView.ui.components=[],this.handlers.push({type:"extent",handler:this.esriView.watch("extent",l=>{if(l){const u=this.$iApi.geo.geom.geomEsriToRamp(l,"map_extent_event");this.$iApi.event.emit(ln.MAP_EXTENTCHANGE,u),this.$iApi.event.emit(ln.FILTER_CHANGE,{extent:u,filterKey:pm.EXTENT})}})}),this.handlers.push({type:"scale",handler:this.esriView.watch("scale",l=>{this.$iApi.event.emit(ln.MAP_SCALECHANGE,l)})}),this.handlers.push({type:"resize",handler:this.esriView.on("resize",l=>{this.$iApi.event.emit(ln.MAP_RESIZED,{height:l.height,width:l.width})})}),this.handlers.push({type:"click",handler:this.esriView.on("click",l=>{this.$iApi.event.emit(ln.MAP_CLICK,this.$iApi.geo.geom.esriMapClickToRamp(l,"map_click_point"))})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",l=>{this.$iApi.event.emit(ln.MAP_DOUBLECLICK,this.$iApi.geo.geom.esriMapClickToRamp(l,"map_doubleclick_point"))})}),this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),this.handlers.push({type:"pointer-move-start",handler:this.esriView.on("pointer-move",xE(100,!0,l=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE_START,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-move-end",handler:this.esriView.on("pointer-move",xE(100,l=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE_END,this.$iApi.geo.geom.esriMapMouseToRamp(l))}))}),this.handlers.push({type:"pointer-leave",handler:this.esriView.on("pointer-leave",l=>{setTimeout(()=>{this.$iApi.event.emit(ln.MAP_MOUSELEAVE,l.native)},Math.max(this.mapMouseThrottle,100)+1)})}),this.handlers.push({type:"pointer-down",handler:this.esriView.on("pointer-down",l=>{this.$iApi.event.emit(ln.MAP_MOUSEDOWN,l.native)})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",l=>{this.$iApi.event.emit(ln.MAP_KEYDOWN,l.native),l.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",l=>{this.$iApi.event.emit(ln.MAP_KEYUP,l.native),l.stopPropagation()})}),this.handlers.push({type:"focus",handler:this.esriView.on("focus",l=>{this.$iApi.event.emit(ln.MAP_FOCUS,l.native)})}),this.handlers.push({type:"blur",handler:this.esriView.on("blur",l=>{this.$iApi.event.emit(ln.MAP_BLUR,l.native)})}),this.esriView.container.addEventListener("touchmove",l=>{l.preventDefault()}),this.esriView.watch("fatalError",()=>{const l=new IntersectionObserver(u=>{u.forEach(c=>{c.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),l.disconnect())})});l.observe(this.esriView.container)}),this.esriView.when(()=>{if(this._viewPromise.resolveMe(),this.created=!0,this.applyBasemap(n),s.recoveryBasemap?.basemapId){const l=s.recoveryBasemap.timeout??8e3;l>0&&setTimeout(()=>{this.trackFirstBasemap&&this.recoverBasemap(s.id)},l)}})}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}applyBasemap(e){if(!this.esriMap){this.noMapErr();return}const t=typeof e=="string"?this.findBasemap(e):e;this.esriMap.basemap=Qs(t.esriBasemap);const r=bm(this.$vApp.$pinia);r.activeBasemapConfig=t.config}setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=bm(this.$vApp.$pinia),r=this.findBasemap(e),s=t.activeBasemapConfig.tileSchemaId!==r.tileSchemaId;if(s){const o=this.getExtent().center(),a=this.getScale();this._viewPromise=new Af,this.created=!1,this.$iApi.event.emit(ln.MAP_REFRESH_START),this.destroyMapView(),this.createMapView(r),this.viewPromise.then(()=>{this.$iApi.event.emit(ln.MAP_REFRESH_END),this.$iApi.event.emit(ln.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s});const l=this.findClosestScale(a);this.$iApi.geo.proj.projectGeometry(this._rampSR,o).then(u=>this.zoomMapTo(u,l,!1))})}else this.applyBasemap(r),this.esriView.background=new vFt({color:new bR(r.backgroundColour).toESRI()}),this.$iApi.event.emit(ln.MAP_BASEMAPCHANGE,{basemapId:e,schemaChanged:s});return s}recoverBasemap(e){this.esriMap||this.noMapErr(),this.trackFirstBasemap=!1;const r=bm(this.$vApp.$pinia).config.map;if(r){const n=r.tileSchemas.find(s=>s.id===e);if(n?.recoveryBasemap?.basemapId){const s=this.findBasemap(n.recoveryBasemap.basemapId);this.applyBasemap(s)}}}addLayer(e,t=void 0){return new Promise((r,n)=>{if(this.esriMap||(this.noMapErr(),n()),e.initiationState!==ey.INITIATING&&e.initiationState!==ey.INITIATED&&e.layerState!==Ud.ERROR&&e.initiate(),e.mapLayer&&t===void 0){const l=this.$iApi.geo.layer.layerOrderIds();if(e.isCosmetic)t=l.length;else{const u=this.$iApi.geo.layer.allLayers();let c=!0;for(let h=l.length-1;h>=0&&c;h--){const p=u.find(m=>m.id===l[h]);p&&!p.isCosmetic&&(t=h+1,c=!1)}c&&(t=0)}}H1(this.$vApp.$pinia).addLayer(e,t);let o=0;const a=setInterval(()=>{o+=250,o>=2e4||e.layerState===Ud.ERROR?(clearInterval(a),e.onError(),console.error(`Failed to add layer: ${e.id}.`),n()):e.initiationState===ey.INITIATED&&(e.esriLayer||!e.mapLayer)&&(clearInterval(a),e.mapLayer?this.insertToEsriMap(e):e.onLoad(),this.$iApi.event.emit(ln.LAYER_REGISTERED,e),r())},250)})}insertToEsriMap(e){let t=0;const r=this.$iApi.geo.layer.getLayerPosition(e.id)??-1;if(r>0){const n=this.$iApi.geo.layer.layerOrderIds(),s=this.$iApi.geo.layer.allLayers();for(let o=r-1;o>-1;o--){const a=n[o],l=s.find(u=>u.id===a);if(l&&l.esriLayer){const u=this.esriMap.layers.indexOf(l.esriLayer);if(u>-1){t=u+1;break}}else l||console.error("ESRI Layer insert encountered bad state. Layer likely inserted at bottom of map.")}}r>-1&&this.esriMap?.add(e.esriLayer,t)}reorder(e,t,r=!1){if(t<0){console.error("Negative index passed to map reorder");return}if(!this.esriMap){this.noMapErr();return}if(e.isSublayer&&(e=e.parentLayer),!e.mapLayer){console.error("Attempted to reorder a data layer");return}const n=this.$iApi.geo.layer.allLayers();let s=this.$iApi.geo.layer.layerOrderIds();if(r){if(e.isCosmetic)return;if(t>0){const l=s.filter(u=>{const c=n.find(h=>h.id===u);return c?!c.isCosmetic:(console.error("Layer reorder had critical error"),!1)});t>=l.length&&(console.error("non-cosmetic reorder index was too high"),t=l.length-1),t=s.indexOf(l[t])}}else t>=s.length&&(console.error("reorder index was too high"),t=s.length-1);const o=s.indexOf(e.id);if(o===t)return;if(H1(this.$vApp.$pinia).reorderLayer(e,t),e.esriLayer&&this.esriMap.layers.indexOf(e.esriLayer)>-1){let l=0;if(t>0){s=this.$iApi.geo.layer.layerOrderIds();for(let u=t-1;u>-1;u--){const c=s[u],h=n.find(p=>p.id===c);if(h&&h.esriLayer){const p=this.esriMap.layers.indexOf(h.esriLayer);if(p>-1){const m=tn.isRemoved)&&this.removeLayer(r.parentLayer)}removeLayer(e){if(!this.esriMap){this.noMapErr();return}let t;if(e instanceof Rse?t=e:t=this.$iApi.geo.layer.getLayer(e),!t)throw new Error("Layer could not be found for removal.");if(t.isSublayer){this.removeSublayer(t);return}if(t.mapLayer&&!t.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");t.supportsSublayers&&t.sublayers.some(n=>!n.isRemoved)&&t.sublayers.forEach(n=>this.removeSublayer(n)),t.terminate();const r=H1(this.$vApp.$pinia);r.removeLayer(t),r.removeLayerConfig(t.id),t.mapLayer&&this.esriMap.remove(t.esriLayer),t.isRemoved=!0,this.$iApi.event.emit(ln.LAYER_REMOVE,t)}setMapMouseThrottle(e){if(e<0)return console.error("Cannot set map mouse throttle to value that is less than 0."),!1;this.mapMouseThrottle=e;const t=this.handlers.findIndex(r=>r.type==="pointer-move");if(t!==-1){const r=this.handlers[t];this.handlers.splice(t,1),r.handler.remove()}return t!==-1&&this.esriView&&this.handlers.push({type:"pointer-move",handler:this.esriView.on("pointer-move",this.createMouseMoveHandler())}),!0}createMouseMoveHandler(){if(!this.esriView){this.noMapErr();return}return _P(this.mapMouseThrottle,e=>{this.$iApi.event.emit(ln.MAP_MOUSEMOVE,this.$iApi.geo.geom.esriMapMouseToRamp(e))})}async zoomToLevel(e){if(this.esriView)return this.esriView.goTo({zoom:e});this.noMapErr()}async zoomIn(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom+1);this.noMapErr()}async zoomOut(){if(this.esriView)return this.zoomToLevel(this.esriView.zoom-1);this.noMapErr()}async zoomToVisibleScale(e){if(!this.esriView){this.noMapErr();return}const t=e.isOffScale(this.getScale());if(!t.offScale)return;const r=this.esriView.constraints.lods;if(!r)return this.zoomMapTo(this.getExtent().center(),(t.zoomIn,e.minScale));const n=t.zoomIn?r:[...r].reverse(),s=n.find(o=>t.zoomIn?o.scalee.maxScale)||n[n.length-1];return this.zoomToLevel(s.level)}findClosestScale(e){const t=this.esriView?.constraints.lods;if(!t)return e;const r=t.map(s=>Math.abs(s.scale-e)),n=r.indexOf(Math.min(...r));return t[n].scale}async takeScreenshot(e){if(this.esriView)return e.quality||(e.quality=1),e.format||(e.format="png"),this.esriView.takeScreenshot(e);throw new Error("Export attempted without a map view available")}screenPointToMapPoint(e){return this.esriView?s0.fromESRI(this.esriView.toMap({x:e.screenX,y:e.screenY}),"mappoint"):(this.noMapErr(),new s0("i_am_error",[0,0],void 0,!0))}mapPointToScreenPoint(e){if(this.esriView){const t=this.esriView.toScreen(e.toESRI());return{screenX:t.x,screenY:t.y}}else return this.noMapErr(),{screenX:1,screenY:1}}runIdentify(e){const t=this.$iApi.geo.layer.allLayersOnMap(!1).filter(u=>u.canIdentify());let r;if(e instanceof s0){const u=this.mapPointToScreenPoint(e);r={mapPoint:e,screenX:u.screenX,screenY:u.screenY,button:0,input:"mouse",clickTime:Date.now()}}else r=e;if(t===void 0)return{click:r,results:[]};let n=Promise.resolve([]);t.some(u=>u.identifyMode===sg.HYBRID||u.identifyMode===sg.SYMBOLIC)&&(n=this.esriView.hitTest({x:r.screenX,y:r.screenY}).then(u=>u.results.map(c=>({layerId:c.layer.id,layerIdx:0,oid:c.graphic.getObjectId()}))));const s={geometry:r.mapPoint,hitTest:n},o=t.filter(u=>u.supportsIdentify).map(u=>(s.tolerance=r.input=="touch"?u.touchTolerance:u.mouseTolerance,u.runIdentify(s))).flat(),a=Date.now();o.forEach(u=>{u.requestTime=a});const l={results:o,click:r};return this.$iApi.event.emit(ln.MAP_IDENTIFY,l),l}async getGraphicAtCoord(e){if(!this.esriView){this.noMapErr();return}const t=this.$iApi.geo.layer.allLayersOnMap(!1).filter(l=>l.supportsFeatures||l.layerType===pn.GRAPHIC);if(t.length===0)return;const r=await this.esriView.hitTest({x:e.screenX,y:e.screenY});if(r.results.length===0)return;const n=r.results;let s,o;const a=new Set;if(n.some(l=>{if(a.has(l.layer.id))return!1;const u=t.find(c=>c.id===l.layer.id);return u?(!u.isCosmetic&&u.layerType!==pn.GRAPHIC&&(s=u,o=l.graphic),!0):(a.add(l.layer.id),!1)}),s&&o)return{oid:o.getObjectId(),layerId:s.id,layerIdx:s.getLayerTree().layerIdx}}_activeKeys=[];_panInterval;_mouseFocus=!1;mapKeyDown(e){const t=["=","-"];["Shift","Control","ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this._activeKeys.some(n=>t.includes(n))||this.keyPan()):t.includes(e.key)&&!this._activeKeys.includes(e.key)?(this._activeKeys.push(e.key),this.keyZoom(e)):e.key==="Enter"?this.runIdentify(this.getExtent().center()):e.key==="Tab"&&this._activeKeys.push(e.key)}mapKeyUp(e){const t=["=","-"];this._activeKeys.includes(e.key)&&!t.includes(e.key)&&(this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this._activeKeys.some(r=>t.includes(r))||this.keyPan())}setMouseFocus(){this._mouseFocus=!0}stopKeyPan(){this._activeKeys.includes("Tab")&&(this._mouseFocus=!1),this._activeKeys=[],clearInterval(this._panInterval)}get keysActive(){return this._activeKeys.filter(e=>!["Control","Shift"].includes(e)).length!==0}get mouseFocus(){return this._mouseFocus}async keyZoom(e){clearInterval(this._panInterval),e.key==="="?await this.zoomIn():e.key==="-"&&await this.zoomOut(),this._activeKeys.splice(this._activeKeys.indexOf(e.key),1),this.keyPan()}keyPan(){if(clearInterval(this._panInterval),!this.keysActive)return;const e=this.getExtent().center(),t=this.mapPointToScreenPoint(e),r=this.screenPointToMapPoint({screenX:t.screenX+5,screenY:t.screenY+5}),n=Math.abs(r.x-e.x),s=Math.abs(r.y-e.y);let o=0,a=0,l=1;for(let c=0;c{e.x+=l*o,e.y+=l*a,this.zoomMapTo(e,u,!1)},25)}}const vFr={geometryType:"point",renderer:{type:"simple",symbol:{type:"esriSMS",style:"esriSMSCircle",color:[67,100,255,200],size:7,outline:{color:[0,0,0,255],width:1}}}},_Fr={geometryType:"polyline",renderer:{type:"simple",symbol:{type:"esriSLS",style:"esriSLSSolid",color:[90,90,90,200],width:2}}},bFr={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[76,76,125,200],outline:{type:"esriSLS",style:"esriSLSSolid",color:[110,110,110,255],width:1}}}},wFr={geometryType:"polygon",renderer:{type:"simple",symbol:{type:"esriSFS",style:"esriSFSSolid",color:[255,0,0,64],outline:{type:"esriSLS",style:"esriSLSSolid",color:[240,128,128,255],width:1}}}},xFr={circlePoint:vFr,solidLine:_Fr,outlinedPoly:bFr,boundingBoxPoly:wFr};var O6t={exports:{}};(function(i,e){(function(t,r){if(i.exports=r(MFt()),typeof t.navigator=="object"){if(!t.Terraformer)throw new Error("Terraformer.ArcGIS requires the core Terraformer library. https://github.com/esri/Terraformer");t.Terraformer.ArcGIS=r(t.Terraformer)}})(Hh,function(t){var r={};function n(S){var I=0,R=0,L=[],k,B,$,V;$=S.match(/((\+|\-)[^\+\-]+)/g),V=parseInt($[0],32);for(var Y=1;Y<$.length;Y+=2)k=parseInt($[Y],32)+I,I=k,B=parseInt($[Y+1],32)+R,R=B,L.push([k/V,B/V]);return L}function s(S){return o(S[0],S[S.length-1])||S.push(S[0]),S}function o(S,I){for(var R=0;R=0}function u(S){var I=[],R=S.slice(0),L=s(R.shift().slice(0));if(L.length>=4){l(L)||L.reverse(),I.push(L);for(var k=0;k=4&&(l(B)&&B.reverse(),I.push(B))}}return I}function c(S){for(var I=[],R=0;R=0;k--){var B=L[k].slice(0);I.push(B)}return I}function h(S,I){var R=t.Tools.arraysIntersectArrays(S,I),L=t.Tools.coordinatesContainPoint(S,I[0]);return!!(!R&&L)}function p(S){for(var I=[],R=[],L,k,B,$=0;$=0;L--)if(k=I[L][0],h(k,B)){I[L].push(B),Q=!0;break}Q||K.push(B)}for(;K.length;){B=K.pop();var re=!1;for(L=I.length-1;L>=0;L--)if(k=I[L][0],t.Tools.arraysIntersectArrays(k,B)){I[L].push(B),re=!0;break}re||I.push([B.reverse()])}return I.length===1?{type:"Polygon",coordinates:I[0]}:{type:"MultiPolygon",coordinates:I}}function m(S,I){var R={};return I=I||{},I.idAttribute=I.idAttribute||void 0,S.spatialReference&&(S.spatialReference.wkid===3857||S.spatialReference.wkid===102100)&&(R.crs=t.MercatorCRS),typeof S.x=="number"&&typeof S.y=="number"&&(R.type="Point",R.coordinates=[S.x,S.y],(S.z||S.m)&&R.coordinates.push(S.z),S.m&&R.coordinates.push(S.m)),S.points&&(R.type="MultiPoint",R.coordinates=S.points.slice(0)),S.paths&&(S.paths.length===1?(R.type="LineString",R.coordinates=S.paths[0].slice(0)):(R.type="MultiLineString",R.coordinates=S.paths.slice(0))),S.rings&&(R=p(S.rings.slice(0))),typeof S.xmin=="number"&&typeof S.ymin=="number"&&typeof S.xmax=="number"&&typeof S.ymax=="number"&&(R.type="Polygon",R.coordinates=[[[S.xmax,S.ymax],[S.xmin,S.ymax],[S.xmin,S.ymin],[S.xmax,S.ymin],[S.xmax,S.ymax]]]),(S.compressedGeometry||S.geometry||S.attributes)&&(R.type="Feature",S.compressedGeometry&&(S.geometry={paths:[n(S.compressedGeometry)]}),R.geometry=S.geometry?m(S.geometry):null,R.properties=S.attributes?a(S.attributes):null,S.attributes&&(R.id=S.attributes[I.idAttribute]||S.attributes.OBJECTID||S.attributes.FID)),new t.Primitive(R)}function v(S,I){var R;I=I||{};var L=I.idAttribute||"OBJECTID";I.sr?R={wkid:I.sr}:S&&S.crs&&S.crs.properties.name!="urn:ogc:def:crs:OGC:1.3:CRS84"?R=null:R={wkid:4326};var k={},B;switch(S.type){case"Point":k.x=S.coordinates[0],k.y=S.coordinates[1],S.coordinates[2]&&(k.z=S.coordinates[2]),S.coordinates[3]&&(k.m=S.coordinates[3]),k.spatialReference=R;break;case"MultiPoint":k.points=S.coordinates.slice(0),k.spatialReference=R;break;case"LineString":k.paths=[S.coordinates.slice(0)],k.spatialReference=R;break;case"MultiLineString":k.paths=S.coordinates.slice(0),k.spatialReference=R;break;case"Polygon":k.rings=u(S.coordinates.slice(0)),k.spatialReference=R;break;case"MultiPolygon":k.rings=c(S.coordinates.slice(0)),k.spatialReference=R;break;case"Feature":S.geometry&&(k.geometry=v(S.geometry,I)),k.attributes=S.properties?a(S.properties):{},S.id&&(k.attributes[L]=S.id);break;case"FeatureCollection":for(k=[],B=0;B=v)return p;if(R)return R=!1,h;var B=w,$;if(u.charCodeAt(B)===34){for(var V=B;V++=0?0:1],n=Math.abs(i),s=Math.floor(n),o=n-s,a=o*60,l=Math.floor(a),u=Math.floor((a-l)*60);return{whole:s,minutes:l,seconds:u,dir:r}}function Q$e(i,e){if(e||(e="NSEW"),typeof i!="string")return null;i=i.toUpperCase();var t=/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/,r=i.match(t);if(!r)return null;var n=r[0],s;if(r[1]&&r[5]?(s=r[1],n=n.slice(0,-1)):s=r[1]||r[5],s&&e.indexOf(s)===-1)return null;var o=r[2]?parseFloat(r[2]):0,a=r[3]?parseFloat(r[3])/60:0,l=r[4]?parseFloat(r[4])/3600:0,u=o<0?-1:1;return(s==="S"||s==="W")&&(u*=-1),{val:(Math.abs(o)+a+l)*u,dim:s,matched:n,remain:i.slice(n.length)}}function UFr(i,e){i=i.trim();var t=Q$e(i,e);if(!t)return null;i=t.remain.trim();var r=Q$e(i,e);return!r||r.remain?null:t.dim?zFr(t.val,r.val,t.dim):[t.val,r.val]}function zFr(i,e,t){if(t==="N"||t==="S")return[i,e];if(t==="W"||t==="E")return[e,i]}var VFr=ZY.exports,nH=BFr,Jht=VFr,D6t=/(Lat)(itude)?/gi,F6t=/(L)(on|ng)(gitude)?/i;function k6t(i,e){var t,r,n;for(var s in i)r=s.match(e),r&&(!t||r[0].length/s.length>n)&&(n=r[0].length/s.length,t=s);return t}function L6t(i){return k6t(i,D6t)}function N6t(i){return k6t(i,F6t)}function HFr(i){return!!i.match(D6t)}function WFr(i){return!!i.match(F6t)}function Kht(i){return typeof i=="object"?Object.keys(i).length:0}function $6t(i){var e=[",",";"," ","|"],t=[];return e.forEach(function(r){var n=nH.dsvFormat(r).parse(i);if(n.length>=1){for(var s=Kht(n[0]),o=0;o"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(l,u){(function(c){(function(){const h=c.URL;u.exports=(p,m)=>{if(!m)return p;const v=new h(p);return v.pathname=`${v.pathname}.${m}`,v.href}}).call(this)}).call(this,typeof Hh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{}],4:[function(l,u){function c(w){let S=0,I=1;const R=w.length;for(let L,k;I{const p=new c;await p.loadAsync(h);const m=p.file(/.+/),v={};return await Promise.all(m.map(async w=>{let S;S=w.name.slice(-3).toLowerCase()==="shp"||w.name.slice(-3).toLowerCase()==="dbf"?await w.async("nodebuffer"):await w.async("text"),v[w.name]=S})),v}},{jszip:11}],6:[function(l,u,c){function h(V){var Y=V.length;if(0>16,re[ne++]=255&pe>>8,re[ne++]=255&pe;return Q===2&&(pe=R[V.charCodeAt(H)]<<2|R[V.charCodeAt(H+1)]>>4,re[ne++]=255&pe),Q===1&&(pe=R[V.charCodeAt(H)]<<10|R[V.charCodeAt(H+1)]<<4|R[V.charCodeAt(H+2)]>>2,re[ne++]=255&pe>>8,re[ne++]=255&pe),re}function v(V){return I[63&V>>18]+I[63&V>>12]+I[63&V>>6]+I[63&V]}function w(V,Y,K){for(var Q=[],re=Y,ne;rede?de:ne+re));return K===1?(pe=V[Y-1],Q.push(I[pe>>2]+I[63&pe<<4]+"==")):K===2&&(pe=(V[Y-2]<<8)+V[Y-1],Q.push(I[pe>>10]+I[63&pe>>4]+I[63&pe<<2]+"=")),Q.join("")}c.byteLength=function(V){var Y=h(V),K=Y[0],Q=Y[1];return 3*(K+Q)/4-Q},c.toByteArray=m,c.fromByteArray=S;for(var I=[],R=[],L=typeof Uint8Array>"u"?Array:Uint8Array,k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=0,$=k.length;B<$;++B)I[B]=k[B],R[k.charCodeAt(B)]=B;R[45]=62,R[95]=63},{}],7:[function(){},{}],8:[function(l,u,c){(function(){(function(){function h(me){if(2147483647me)throw new RangeError('The value "'+me+'" is invalid for option "size"')}function w(me,ie,ge){return v(me),0>=me||ie===void 0?h(me):typeof ge=="string"?h(me).fill(ie,ge):h(me).fill(ie)}function S(me){return v(me),h(0>me?0:0|B(me))}function I(me,ie){if((typeof ie!="string"||ie==="")&&(ie="utf8"),!p.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);var ge=0|$(me,ie),je=h(ge),rt=je.write(me,ie);return rt!==ge&&(je=je.slice(0,rt)),je}function R(me){for(var ie=0>me.length?0:0|B(me.length),ge=h(ie),je=0;jeie||me.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|me}function $(me,ie){if(p.isBuffer(me))return me.length;if(ArrayBuffer.isView(me)||st(me,ArrayBuffer))return me.byteLength;if(typeof me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof me);var ge=me.length,je=2>>1;case"base64":return Ue(me).length;default:if(rt)return je?-1:At(me).length;ie=(""+ie).toLowerCase(),rt=!0}}function V(me,ie,ge){var je=!1;if((ie===void 0||0>ie)&&(ie=0),ie>this.length||((ge===void 0||ge>this.length)&&(ge=this.length),0>=ge)||(ge>>>=0,ie>>>=0,ge<=ie))return"";for(me||(me="utf8");;)switch(me){case"hex":return Te(this,ie,ge);case"utf8":case"utf-8":return fe(this,ie,ge);case"ascii":return _e(this,ie,ge);case"latin1":case"binary":return Ie(this,ie,ge);case"base64":return ae(this,ie,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Be(this,ie,ge);default:if(je)throw new TypeError("Unknown encoding: "+me);me=(me+"").toLowerCase(),je=!0}}function Y(me,ie,ge){var je=me[ie];me[ie]=me[ge],me[ge]=je}function K(me,ie,ge,je,rt){if(me.length===0)return-1;if(typeof ge=="string"?(je=ge,ge=0):2147483647ge&&(ge=-2147483648),ge=+ge,Ze(ge)&&(ge=rt?0:me.length-1),0>ge&&(ge=me.length+ge),ge>=me.length){if(rt)return-1;ge=me.length-1}else if(0>ge)if(rt)ge=0;else return-1;if(typeof ie=="string"&&(ie=p.from(ie,je)),p.isBuffer(ie))return ie.length===0?-1:Q(me,ie,ge,je,rt);if(typeof ie=="number")return ie&=255,typeof Uint8Array.prototype.indexOf=="function"?rt?Uint8Array.prototype.indexOf.call(me,ie,ge):Uint8Array.prototype.lastIndexOf.call(me,ie,ge):Q(me,[ie],ge,je,rt);throw new TypeError("val must be string, number or Buffer")}function Q(me,ie,ge,je,rt){function Me(G,E){return ht===1?G[E]:G.readUInt16BE(E*ht)}var ht=1,Ht=me.length,_t=ie.length;if(je!==void 0&&(je=(je+"").toLowerCase(),je==="ucs2"||je==="ucs-2"||je==="utf16le"||je==="utf-16le")){if(2>me.length||2>ie.length)return-1;ht=2,Ht/=2,_t/=2,ge/=2}var Fe;if(rt){var Yt=-1;for(Fe=ge;FeHt&&(ge=Ht-_t),Fe=ge;0<=Fe;Fe--){for(var A=!0,ue=0;ue<_t;ue++)if(Me(me,Fe+ue)!==Me(ie,ue)){A=!1;break}if(A)return Fe}return-1}function re(me,ie,ge,je){ge=+ge||0;var rt=me.length-ge;je?(je=+je,je>rt&&(je=rt)):je=rt;var Me=ie.length;je>Me/2&&(je=Me/2);for(var ht=0,Ht;htMe&&(ht=Me):Ht===2?(_t=me[rt+1],(192&_t)==128&&(A=(31&Me)<<6|63&_t,127A||57343A&&(ht=A)))}ht===null?(ht=65533,Ht=1):65535>>10),ht=56320|1023&ht),je.push(ht),rt+=Ht}return be(je)}function be(me){var ie=me.length;if(ie<=4096)return o.apply(String,me);for(var ge="",je=0;jeie)&&(ie=0),(!ge||0>ge||ge>je)&&(ge=je);for(var rt="",Me=ie;Meme)throw new RangeError("offset is not uint");if(me+ie>ge)throw new RangeError("Trying to access beyond buffer length")}function $e(me,ie,ge,je,rt,Me){if(!p.isBuffer(me))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>rt||ieme.length)throw new RangeError("Index out of range")}function tt(me,ie,ge,je){if(ge+je>me.length)throw new RangeError("Index out of range");if(0>ge)throw new RangeError("Index out of range")}function yt(me,ie,ge,je,rt){return ie=+ie,ge>>>=0,rt||tt(me,ie,ge,4),Ke.write(me,ie,ge,je,23,4),ge+4}function Ct(me,ie,ge,je,rt){return ie=+ie,ge>>>=0,rt||tt(me,ie,ge,8),Ke.write(me,ie,ge,je,52,8),ge+8}function ot(me){if(me=me.split("=")[0],me=me.trim().replace(ke,""),2>me.length)return"";for(;me.length%4!=0;)me+="=";return me}function vt(me){return 16>me?"0"+me.toString(16):me.toString(16)}function At(me,ie){ie=ie||1/0;for(var ge=me.length,je=null,rt=[],Me=0,ht;Meht){if(!je){if(56319ht){-1<(ie-=3)&&rt.push(239,191,189),je=ht;continue}ht=(je-55296<<10|ht-56320)+65536}else je&&-1<(ie-=3)&&rt.push(239,191,189);if(je=null,128>ht){if(0>(ie-=1))break;rt.push(ht)}else if(2048>ht){if(0>(ie-=2))break;rt.push(192|ht>>6,128|63&ht)}else if(65536>ht){if(0>(ie-=3))break;rt.push(224|ht>>12,128|63&ht>>6,128|63&ht)}else if(1114112>ht){if(0>(ie-=4))break;rt.push(240|ht>>18,128|63&ht>>12,128|63&ht>>6,128|63&ht)}else throw new Error("Invalid code point")}return rt}function Je(me){for(var ie=[],ge=0;ge(ie-=2));++je)rt=me.charCodeAt(je),Me=rt>>8,ht=rt%256,ge.push(ht),ge.push(Me);return ge}function Ue(me){return ye.toByteArray(ot(me))}function ct(me,ie,ge,je){for(var rt=0;rt=ie.length||rt>=me.length);++rt)ie[rt+ge]=me[rt];return rt}function st(me,ie){return me instanceof ie||me!=null&&me.constructor!=null&&me.constructor.name!=null&&me.constructor.name===ie.name}function Ze(me){return me!==me}var ye=l("base64-js"),Ke=l("ieee754");c.Buffer=p,c.SlowBuffer=function(me){return+me!=me&&(me=0),p.alloc(+me)},c.INSPECT_MAX_BYTES=50,c.kMaxLength=2147483647,p.TYPED_ARRAY_SUPPORT=function(){try{var me=new Uint8Array(1);return me.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},me.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){return p.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){return p.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),p.poolSize=8192,p.from=function(me,ie,ge){return m(me,ie,ge)},p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(me,ie,ge){return w(me,ie,ge)},p.allocUnsafe=function(me){return S(me)},p.allocUnsafeSlow=function(me){return S(me)},p.isBuffer=function(me){return me!=null&&me._isBuffer===!0&&me!==p.prototype},p.compare=function(me,ie){if(st(me,Uint8Array)&&(me=p.from(me,me.offset,me.byteLength)),st(ie,Uint8Array)&&(ie=p.from(ie,ie.offset,ie.byteLength)),!p.isBuffer(me)||!p.isBuffer(ie))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(me===ie)return 0;for(var ge=me.length,je=ie.length,rt=0,Me=a(ge,je);rtie&&(me+=" ... "),""},p.prototype.compare=function(me,ie,ge,je,rt){if(st(me,Uint8Array)&&(me=p.from(me,me.offset,me.byteLength)),!p.isBuffer(me))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof me);if(ie===void 0&&(ie=0),ge===void 0&&(ge=me?me.length:0),je===void 0&&(je=0),rt===void 0&&(rt=this.length),0>ie||ge>me.length||0>je||rt>this.length)throw new RangeError("out of range index");if(je>=rt&&ie>=ge)return 0;if(je>=rt)return-1;if(ie>=ge)return 1;if(ie>>>=0,ge>>>=0,je>>>=0,rt>>>=0,this===me)return 0;for(var Me=rt-je,ht=ge-ie,Ht=a(Me,ht),_t=this.slice(je,rt),Fe=me.slice(ie,ge),Yt=0;Yt>>=0,isFinite(ge)?(ge>>>=0,je===void 0&&(je="utf8")):(je=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var rt=this.length-ie;if((ge===void 0||ge>rt)&&(ge=rt),0ge||0>ie)||ie>this.length)throw new RangeError("Attempt to write outside buffer bounds");je||(je="utf8");for(var Me=!1;;)switch(je){case"hex":return re(this,me,ie,ge);case"utf8":case"utf-8":return ne(this,me,ie,ge);case"ascii":return de(this,me,ie,ge);case"latin1":case"binary":return pe(this,me,ie,ge);case"base64":return H(this,me,ie,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,me,ie,ge);default:if(Me)throw new TypeError("Unknown encoding: "+je);je=(""+je).toLowerCase(),Me=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(me,ie){var ge=this.length;me=~~me,ie=ie===void 0?ge:~~ie,0>me?(me+=ge,0>me&&(me=0)):me>ge&&(me=ge),0>ie?(ie+=ge,0>ie&&(ie=0)):ie>ge&&(ie=ge),ie>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me],rt=1,Me=0;++Me>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me+--ie],rt=1;0>>=0,ie||Ve(me,1,this.length),this[me]},p.prototype.readUInt16LE=function(me,ie){return me>>>=0,ie||Ve(me,2,this.length),this[me]|this[me+1]<<8},p.prototype.readUInt16BE=function(me,ie){return me>>>=0,ie||Ve(me,2,this.length),this[me]<<8|this[me+1]},p.prototype.readUInt32LE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),(this[me]|this[me+1]<<8|this[me+2]<<16)+16777216*this[me+3]},p.prototype.readUInt32BE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),16777216*this[me]+(this[me+1]<<16|this[me+2]<<8|this[me+3])},p.prototype.readIntLE=function(me,ie,ge){me>>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me],rt=1,Me=0;++Me=rt&&(je-=s(2,8*ie)),je},p.prototype.readIntBE=function(me,ie,ge){me>>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=ie,rt=1,Me=this[me+--je];0=rt&&(Me-=s(2,8*ie)),Me},p.prototype.readInt8=function(me,ie){return me>>>=0,ie||Ve(me,1,this.length),128&this[me]?-1*(255-this[me]+1):this[me]},p.prototype.readInt16LE=function(me,ie){me>>>=0,ie||Ve(me,2,this.length);var ge=this[me]|this[me+1]<<8;return 32768&ge?4294901760|ge:ge},p.prototype.readInt16BE=function(me,ie){me>>>=0,ie||Ve(me,2,this.length);var ge=this[me+1]|this[me]<<8;return 32768&ge?4294901760|ge:ge},p.prototype.readInt32LE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),this[me]|this[me+1]<<8|this[me+2]<<16|this[me+3]<<24},p.prototype.readInt32BE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),this[me]<<24|this[me+1]<<16|this[me+2]<<8|this[me+3]},p.prototype.readFloatLE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),Ke.read(this,me,!0,23,4)},p.prototype.readFloatBE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),Ke.read(this,me,!1,23,4)},p.prototype.readDoubleLE=function(me,ie){return me>>>=0,ie||Ve(me,8,this.length),Ke.read(this,me,!0,52,8)},p.prototype.readDoubleBE=function(me,ie){return me>>>=0,ie||Ve(me,8,this.length),Ke.read(this,me,!1,52,8)},p.prototype.writeUIntLE=function(me,ie,ge,je){if(me=+me,ie>>>=0,ge>>>=0,!je){var rt=s(2,8*ge)-1;$e(this,me,ie,ge,rt,0)}var Me=1,ht=0;for(this[ie]=255&me;++ht>>=0,ge>>>=0,!je){var rt=s(2,8*ge)-1;$e(this,me,ie,ge,rt,0)}var Me=ge-1,ht=1;for(this[ie+Me]=255&me;0<=--Me&&(ht*=256);)this[ie+Me]=255&me/ht;return ie+ge},p.prototype.writeUInt8=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,1,255,0),this[ie]=255&me,ie+1},p.prototype.writeUInt16LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,65535,0),this[ie]=255&me,this[ie+1]=me>>>8,ie+2},p.prototype.writeUInt16BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,65535,0),this[ie]=me>>>8,this[ie+1]=255&me,ie+2},p.prototype.writeUInt32LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,4294967295,0),this[ie+3]=me>>>24,this[ie+2]=me>>>16,this[ie+1]=me>>>8,this[ie]=255&me,ie+4},p.prototype.writeUInt32BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,4294967295,0),this[ie]=me>>>24,this[ie+1]=me>>>16,this[ie+2]=me>>>8,this[ie+3]=255&me,ie+4},p.prototype.writeIntLE=function(me,ie,ge,je){if(me=+me,ie>>>=0,!je){var rt=s(2,8*ge-1);$e(this,me,ie,ge,rt-1,-rt)}var Me=0,ht=1,Ht=0;for(this[ie]=255&me;++Meme&&Ht===0&&this[ie+Me-1]!==0&&(Ht=1),this[ie+Me]=255&(me/ht>>0)-Ht;return ie+ge},p.prototype.writeIntBE=function(me,ie,ge,je){if(me=+me,ie>>>=0,!je){var rt=s(2,8*ge-1);$e(this,me,ie,ge,rt-1,-rt)}var Me=ge-1,ht=1,Ht=0;for(this[ie+Me]=255&me;0<=--Me&&(ht*=256);)0>me&&Ht===0&&this[ie+Me+1]!==0&&(Ht=1),this[ie+Me]=255&(me/ht>>0)-Ht;return ie+ge},p.prototype.writeInt8=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,1,127,-128),0>me&&(me=255+me+1),this[ie]=255&me,ie+1},p.prototype.writeInt16LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,32767,-32768),this[ie]=255&me,this[ie+1]=me>>>8,ie+2},p.prototype.writeInt16BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,32767,-32768),this[ie]=me>>>8,this[ie+1]=255&me,ie+2},p.prototype.writeInt32LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,2147483647,-2147483648),this[ie]=255&me,this[ie+1]=me>>>8,this[ie+2]=me>>>16,this[ie+3]=me>>>24,ie+4},p.prototype.writeInt32BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,2147483647,-2147483648),0>me&&(me=4294967295+me+1),this[ie]=me>>>24,this[ie+1]=me>>>16,this[ie+2]=me>>>8,this[ie+3]=255&me,ie+4},p.prototype.writeFloatLE=function(me,ie,ge){return yt(this,me,ie,!0,ge)},p.prototype.writeFloatBE=function(me,ie,ge){return yt(this,me,ie,!1,ge)},p.prototype.writeDoubleLE=function(me,ie,ge){return Ct(this,me,ie,!0,ge)},p.prototype.writeDoubleBE=function(me,ie,ge){return Ct(this,me,ie,!1,ge)},p.prototype.copy=function(me,ie,ge,je){if(!p.isBuffer(me))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),je||je===0||(je=this.length),ie>=me.length&&(ie=me.length),ie||(ie=0),0ie)throw new RangeError("targetStart out of bounds");if(0>ge||ge>=this.length)throw new RangeError("Index out of range");if(0>je)throw new RangeError("sourceEnd out of bounds");je>this.length&&(je=this.length),me.length-iert||je==="latin1")&&(me=rt)}}else typeof me=="number"&&(me&=255);if(0>ie||this.length>>=0,ge=ge===void 0?this.length:ge>>>0,me||(me=0);var Me;if(typeof me=="number")for(Me=ie;Me */c.read=function(h,p,m,v,w){var S=8*w-v-1,I=(1<>1,L=-7,k=m?w-1:0,B=m?-1:1,$=h[p+k],V,Y;for(k+=B,V=$&(1<<-L)-1,$>>=-L,L+=S;0>=-L,L+=v;0>1,B=w===23?s(2,-24)-s(2,-77):0,$=v?0:S-1,V=v?1:-1,Y=0>p||p===0&&0>1/p?1:0,K,Q,re;for(p=n(p),isNaN(p)||p===1/0?(Q=isNaN(p)?1:0,K=L):(K=t(r(p)/I),1>p*(re=s(2,-K))&&(K--,re*=2),p+=1<=K+k?B/re:B*s(2,1-k),2<=p*re&&(K++,re/=2),K+k>=L?(Q=0,K=L):1<=K+k?(Q=(p*re-1)*s(2,w),K+=k):(Q=p*s(2,k-1)*s(2,w),K=0));8<=w;h[m+$]=255&Q,$+=V,Q/=256,w-=8);for(K=K<"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{}],11:[function(l,u,c){(function(h,p,m){(function(){/*! +`)}function a(u){return u.map(l).join(i)}function l(u){return u==null?"":e.test(u+="")?'"'+u.replace(/\"/g,'""')+'"':u}return{parse:r,parseRows:n,format:s,formatRows:o}}var xTe=MYe(","),IFr=xTe.parse,AFr=xTe.parseRows,MFr=xTe.format,OFr=xTe.formatRows,STe=MYe(" "),PFr=STe.parse,RFr=STe.parseRows,DFr=STe.format,FFr=STe.formatRows;const kFr=Object.freeze(Object.defineProperty({__proto__:null,csvFormat:MFr,csvFormatRows:OFr,csvParse:IFr,csvParseRows:AFr,dsvFormat:MYe,tsvFormat:DFr,tsvFormatRows:FFr,tsvParse:PFr,tsvParseRows:RFr},Symbol.toStringTag,{value:"Module"})),LFr=wSe(kFr);var ZY={exports:{}};ZY.exports=NFr;ZY.exports.pair=BFr;ZY.exports.format=Z$e;ZY.exports.formatPair=$Fr;ZY.exports.coordToDMS=R6t;function NFr(i,e){var t=Q$e(i,e);return t===null?null:t.val}function $Fr(i){return Z$e(i.lat,"lat")+" "+Z$e(i.lon,"lon")}function Z$e(i,e){var t=R6t(i,e);return t.whole+"° "+(t.minutes?t.minutes+"' ":"")+(t.seconds?t.seconds+'" ':"")+t.dir}function R6t(i,e){var t={lat:["N","S"],lon:["E","W"]}[e]||"",r=t[i>=0?0:1],n=Math.abs(i),s=Math.floor(n),o=n-s,a=o*60,l=Math.floor(a),u=Math.floor((a-l)*60);return{whole:s,minutes:l,seconds:u,dir:r}}function Q$e(i,e){if(e||(e="NSEW"),typeof i!="string")return null;i=i.toUpperCase();var t=/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/,r=i.match(t);if(!r)return null;var n=r[0],s;if(r[1]&&r[5]?(s=r[1],n=n.slice(0,-1)):s=r[1]||r[5],s&&e.indexOf(s)===-1)return null;var o=r[2]?parseFloat(r[2]):0,a=r[3]?parseFloat(r[3])/60:0,l=r[4]?parseFloat(r[4])/3600:0,u=o<0?-1:1;return(s==="S"||s==="W")&&(u*=-1),{val:(Math.abs(o)+a+l)*u,dim:s,matched:n,remain:i.slice(n.length)}}function BFr(i,e){i=i.trim();var t=Q$e(i,e);if(!t)return null;i=t.remain.trim();var r=Q$e(i,e);return!r||r.remain?null:t.dim?jFr(t.val,r.val,t.dim):[t.val,r.val]}function jFr(i,e,t){if(t==="N"||t==="S")return[i,e];if(t==="W"||t==="E")return[e,i]}var GFr=ZY.exports,nH=LFr,Jht=GFr,D6t=/(Lat)(itude)?/gi,F6t=/(L)(on|ng)(gitude)?/i;function k6t(i,e){var t,r,n;for(var s in i)r=s.match(e),r&&(!t||r[0].length/s.length>n)&&(n=r[0].length/s.length,t=s);return t}function L6t(i){return k6t(i,D6t)}function N6t(i){return k6t(i,F6t)}function UFr(i){return!!i.match(D6t)}function zFr(i){return!!i.match(F6t)}function Kht(i){return typeof i=="object"?Object.keys(i).length:0}function $6t(i){var e=[",",";"," ","|"],t=[];return e.forEach(function(r){var n=nH.dsvFormat(r).parse(i);if(n.length>=1){for(var s=Kht(n[0]),o=0;o"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(l,u){(function(c){(function(){const h=c.URL;u.exports=(p,m)=>{if(!m)return p;const v=new h(p);return v.pathname=`${v.pathname}.${m}`,v.href}}).call(this)}).call(this,typeof Hh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{}],4:[function(l,u){function c(w){let S=0,I=1;const R=w.length;for(let L,k;I{const p=new c;await p.loadAsync(h);const m=p.file(/.+/),v={};return await Promise.all(m.map(async w=>{let S;S=w.name.slice(-3).toLowerCase()==="shp"||w.name.slice(-3).toLowerCase()==="dbf"?await w.async("nodebuffer"):await w.async("text"),v[w.name]=S})),v}},{jszip:11}],6:[function(l,u,c){function h(V){var Y=V.length;if(0>16,re[ne++]=255&pe>>8,re[ne++]=255&pe;return Q===2&&(pe=R[V.charCodeAt(H)]<<2|R[V.charCodeAt(H+1)]>>4,re[ne++]=255&pe),Q===1&&(pe=R[V.charCodeAt(H)]<<10|R[V.charCodeAt(H+1)]<<4|R[V.charCodeAt(H+2)]>>2,re[ne++]=255&pe>>8,re[ne++]=255&pe),re}function v(V){return I[63&V>>18]+I[63&V>>12]+I[63&V>>6]+I[63&V]}function w(V,Y,K){for(var Q=[],re=Y,ne;rede?de:ne+re));return K===1?(pe=V[Y-1],Q.push(I[pe>>2]+I[63&pe<<4]+"==")):K===2&&(pe=(V[Y-2]<<8)+V[Y-1],Q.push(I[pe>>10]+I[63&pe>>4]+I[63&pe<<2]+"=")),Q.join("")}c.byteLength=function(V){var Y=h(V),K=Y[0],Q=Y[1];return 3*(K+Q)/4-Q},c.toByteArray=m,c.fromByteArray=S;for(var I=[],R=[],L=typeof Uint8Array>"u"?Array:Uint8Array,k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=0,$=k.length;B<$;++B)I[B]=k[B],R[k.charCodeAt(B)]=B;R[45]=62,R[95]=63},{}],7:[function(){},{}],8:[function(l,u,c){(function(){(function(){function h(me){if(2147483647me)throw new RangeError('The value "'+me+'" is invalid for option "size"')}function w(me,ie,ge){return v(me),0>=me||ie===void 0?h(me):typeof ge=="string"?h(me).fill(ie,ge):h(me).fill(ie)}function S(me){return v(me),h(0>me?0:0|B(me))}function I(me,ie){if((typeof ie!="string"||ie==="")&&(ie="utf8"),!p.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);var ge=0|$(me,ie),je=h(ge),rt=je.write(me,ie);return rt!==ge&&(je=je.slice(0,rt)),je}function R(me){for(var ie=0>me.length?0:0|B(me.length),ge=h(ie),je=0;jeie||me.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|me}function $(me,ie){if(p.isBuffer(me))return me.length;if(ArrayBuffer.isView(me)||st(me,ArrayBuffer))return me.byteLength;if(typeof me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof me);var ge=me.length,je=2>>1;case"base64":return Ue(me).length;default:if(rt)return je?-1:At(me).length;ie=(""+ie).toLowerCase(),rt=!0}}function V(me,ie,ge){var je=!1;if((ie===void 0||0>ie)&&(ie=0),ie>this.length||((ge===void 0||ge>this.length)&&(ge=this.length),0>=ge)||(ge>>>=0,ie>>>=0,ge<=ie))return"";for(me||(me="utf8");;)switch(me){case"hex":return Te(this,ie,ge);case"utf8":case"utf-8":return fe(this,ie,ge);case"ascii":return _e(this,ie,ge);case"latin1":case"binary":return Ie(this,ie,ge);case"base64":return ae(this,ie,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Be(this,ie,ge);default:if(je)throw new TypeError("Unknown encoding: "+me);me=(me+"").toLowerCase(),je=!0}}function Y(me,ie,ge){var je=me[ie];me[ie]=me[ge],me[ge]=je}function K(me,ie,ge,je,rt){if(me.length===0)return-1;if(typeof ge=="string"?(je=ge,ge=0):2147483647ge&&(ge=-2147483648),ge=+ge,Ze(ge)&&(ge=rt?0:me.length-1),0>ge&&(ge=me.length+ge),ge>=me.length){if(rt)return-1;ge=me.length-1}else if(0>ge)if(rt)ge=0;else return-1;if(typeof ie=="string"&&(ie=p.from(ie,je)),p.isBuffer(ie))return ie.length===0?-1:Q(me,ie,ge,je,rt);if(typeof ie=="number")return ie&=255,typeof Uint8Array.prototype.indexOf=="function"?rt?Uint8Array.prototype.indexOf.call(me,ie,ge):Uint8Array.prototype.lastIndexOf.call(me,ie,ge):Q(me,[ie],ge,je,rt);throw new TypeError("val must be string, number or Buffer")}function Q(me,ie,ge,je,rt){function Me(G,E){return ht===1?G[E]:G.readUInt16BE(E*ht)}var ht=1,Ht=me.length,_t=ie.length;if(je!==void 0&&(je=(je+"").toLowerCase(),je==="ucs2"||je==="ucs-2"||je==="utf16le"||je==="utf-16le")){if(2>me.length||2>ie.length)return-1;ht=2,Ht/=2,_t/=2,ge/=2}var Fe;if(rt){var Yt=-1;for(Fe=ge;FeHt&&(ge=Ht-_t),Fe=ge;0<=Fe;Fe--){for(var A=!0,ue=0;ue<_t;ue++)if(Me(me,Fe+ue)!==Me(ie,ue)){A=!1;break}if(A)return Fe}return-1}function re(me,ie,ge,je){ge=+ge||0;var rt=me.length-ge;je?(je=+je,je>rt&&(je=rt)):je=rt;var Me=ie.length;je>Me/2&&(je=Me/2);for(var ht=0,Ht;htMe&&(ht=Me):Ht===2?(_t=me[rt+1],(192&_t)==128&&(A=(31&Me)<<6|63&_t,127A||57343A&&(ht=A)))}ht===null?(ht=65533,Ht=1):65535>>10),ht=56320|1023&ht),je.push(ht),rt+=Ht}return be(je)}function be(me){var ie=me.length;if(ie<=4096)return o.apply(String,me);for(var ge="",je=0;jeie)&&(ie=0),(!ge||0>ge||ge>je)&&(ge=je);for(var rt="",Me=ie;Meme)throw new RangeError("offset is not uint");if(me+ie>ge)throw new RangeError("Trying to access beyond buffer length")}function $e(me,ie,ge,je,rt,Me){if(!p.isBuffer(me))throw new TypeError('"buffer" argument must be a Buffer instance');if(ie>rt||ieme.length)throw new RangeError("Index out of range")}function tt(me,ie,ge,je){if(ge+je>me.length)throw new RangeError("Index out of range");if(0>ge)throw new RangeError("Index out of range")}function yt(me,ie,ge,je,rt){return ie=+ie,ge>>>=0,rt||tt(me,ie,ge,4),Ke.write(me,ie,ge,je,23,4),ge+4}function Ct(me,ie,ge,je,rt){return ie=+ie,ge>>>=0,rt||tt(me,ie,ge,8),Ke.write(me,ie,ge,je,52,8),ge+8}function ot(me){if(me=me.split("=")[0],me=me.trim().replace(ke,""),2>me.length)return"";for(;me.length%4!=0;)me+="=";return me}function vt(me){return 16>me?"0"+me.toString(16):me.toString(16)}function At(me,ie){ie=ie||1/0;for(var ge=me.length,je=null,rt=[],Me=0,ht;Meht){if(!je){if(56319ht){-1<(ie-=3)&&rt.push(239,191,189),je=ht;continue}ht=(je-55296<<10|ht-56320)+65536}else je&&-1<(ie-=3)&&rt.push(239,191,189);if(je=null,128>ht){if(0>(ie-=1))break;rt.push(ht)}else if(2048>ht){if(0>(ie-=2))break;rt.push(192|ht>>6,128|63&ht)}else if(65536>ht){if(0>(ie-=3))break;rt.push(224|ht>>12,128|63&ht>>6,128|63&ht)}else if(1114112>ht){if(0>(ie-=4))break;rt.push(240|ht>>18,128|63&ht>>12,128|63&ht>>6,128|63&ht)}else throw new Error("Invalid code point")}return rt}function Je(me){for(var ie=[],ge=0;ge(ie-=2));++je)rt=me.charCodeAt(je),Me=rt>>8,ht=rt%256,ge.push(ht),ge.push(Me);return ge}function Ue(me){return ye.toByteArray(ot(me))}function ct(me,ie,ge,je){for(var rt=0;rt=ie.length||rt>=me.length);++rt)ie[rt+ge]=me[rt];return rt}function st(me,ie){return me instanceof ie||me!=null&&me.constructor!=null&&me.constructor.name!=null&&me.constructor.name===ie.name}function Ze(me){return me!==me}var ye=l("base64-js"),Ke=l("ieee754");c.Buffer=p,c.SlowBuffer=function(me){return+me!=me&&(me=0),p.alloc(+me)},c.INSPECT_MAX_BYTES=50,c.kMaxLength=2147483647,p.TYPED_ARRAY_SUPPORT=function(){try{var me=new Uint8Array(1);return me.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},me.foo()===42}catch{return!1}}(),p.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){return p.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){return p.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&p[Symbol.species]===p&&Object.defineProperty(p,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),p.poolSize=8192,p.from=function(me,ie,ge){return m(me,ie,ge)},p.prototype.__proto__=Uint8Array.prototype,p.__proto__=Uint8Array,p.alloc=function(me,ie,ge){return w(me,ie,ge)},p.allocUnsafe=function(me){return S(me)},p.allocUnsafeSlow=function(me){return S(me)},p.isBuffer=function(me){return me!=null&&me._isBuffer===!0&&me!==p.prototype},p.compare=function(me,ie){if(st(me,Uint8Array)&&(me=p.from(me,me.offset,me.byteLength)),st(ie,Uint8Array)&&(ie=p.from(ie,ie.offset,ie.byteLength)),!p.isBuffer(me)||!p.isBuffer(ie))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(me===ie)return 0;for(var ge=me.length,je=ie.length,rt=0,Me=a(ge,je);rtie&&(me+=" ... "),""},p.prototype.compare=function(me,ie,ge,je,rt){if(st(me,Uint8Array)&&(me=p.from(me,me.offset,me.byteLength)),!p.isBuffer(me))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof me);if(ie===void 0&&(ie=0),ge===void 0&&(ge=me?me.length:0),je===void 0&&(je=0),rt===void 0&&(rt=this.length),0>ie||ge>me.length||0>je||rt>this.length)throw new RangeError("out of range index");if(je>=rt&&ie>=ge)return 0;if(je>=rt)return-1;if(ie>=ge)return 1;if(ie>>>=0,ge>>>=0,je>>>=0,rt>>>=0,this===me)return 0;for(var Me=rt-je,ht=ge-ie,Ht=a(Me,ht),_t=this.slice(je,rt),Fe=me.slice(ie,ge),Yt=0;Yt>>=0,isFinite(ge)?(ge>>>=0,je===void 0&&(je="utf8")):(je=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var rt=this.length-ie;if((ge===void 0||ge>rt)&&(ge=rt),0ge||0>ie)||ie>this.length)throw new RangeError("Attempt to write outside buffer bounds");je||(je="utf8");for(var Me=!1;;)switch(je){case"hex":return re(this,me,ie,ge);case"utf8":case"utf-8":return ne(this,me,ie,ge);case"ascii":return de(this,me,ie,ge);case"latin1":case"binary":return pe(this,me,ie,ge);case"base64":return H(this,me,ie,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,me,ie,ge);default:if(Me)throw new TypeError("Unknown encoding: "+je);je=(""+je).toLowerCase(),Me=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},p.prototype.slice=function(me,ie){var ge=this.length;me=~~me,ie=ie===void 0?ge:~~ie,0>me?(me+=ge,0>me&&(me=0)):me>ge&&(me=ge),0>ie?(ie+=ge,0>ie&&(ie=0)):ie>ge&&(ie=ge),ie>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me],rt=1,Me=0;++Me>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me+--ie],rt=1;0>>=0,ie||Ve(me,1,this.length),this[me]},p.prototype.readUInt16LE=function(me,ie){return me>>>=0,ie||Ve(me,2,this.length),this[me]|this[me+1]<<8},p.prototype.readUInt16BE=function(me,ie){return me>>>=0,ie||Ve(me,2,this.length),this[me]<<8|this[me+1]},p.prototype.readUInt32LE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),(this[me]|this[me+1]<<8|this[me+2]<<16)+16777216*this[me+3]},p.prototype.readUInt32BE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),16777216*this[me]+(this[me+1]<<16|this[me+2]<<8|this[me+3])},p.prototype.readIntLE=function(me,ie,ge){me>>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=this[me],rt=1,Me=0;++Me=rt&&(je-=s(2,8*ie)),je},p.prototype.readIntBE=function(me,ie,ge){me>>>=0,ie>>>=0,ge||Ve(me,ie,this.length);for(var je=ie,rt=1,Me=this[me+--je];0=rt&&(Me-=s(2,8*ie)),Me},p.prototype.readInt8=function(me,ie){return me>>>=0,ie||Ve(me,1,this.length),128&this[me]?-1*(255-this[me]+1):this[me]},p.prototype.readInt16LE=function(me,ie){me>>>=0,ie||Ve(me,2,this.length);var ge=this[me]|this[me+1]<<8;return 32768&ge?4294901760|ge:ge},p.prototype.readInt16BE=function(me,ie){me>>>=0,ie||Ve(me,2,this.length);var ge=this[me+1]|this[me]<<8;return 32768&ge?4294901760|ge:ge},p.prototype.readInt32LE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),this[me]|this[me+1]<<8|this[me+2]<<16|this[me+3]<<24},p.prototype.readInt32BE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),this[me]<<24|this[me+1]<<16|this[me+2]<<8|this[me+3]},p.prototype.readFloatLE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),Ke.read(this,me,!0,23,4)},p.prototype.readFloatBE=function(me,ie){return me>>>=0,ie||Ve(me,4,this.length),Ke.read(this,me,!1,23,4)},p.prototype.readDoubleLE=function(me,ie){return me>>>=0,ie||Ve(me,8,this.length),Ke.read(this,me,!0,52,8)},p.prototype.readDoubleBE=function(me,ie){return me>>>=0,ie||Ve(me,8,this.length),Ke.read(this,me,!1,52,8)},p.prototype.writeUIntLE=function(me,ie,ge,je){if(me=+me,ie>>>=0,ge>>>=0,!je){var rt=s(2,8*ge)-1;$e(this,me,ie,ge,rt,0)}var Me=1,ht=0;for(this[ie]=255&me;++ht>>=0,ge>>>=0,!je){var rt=s(2,8*ge)-1;$e(this,me,ie,ge,rt,0)}var Me=ge-1,ht=1;for(this[ie+Me]=255&me;0<=--Me&&(ht*=256);)this[ie+Me]=255&me/ht;return ie+ge},p.prototype.writeUInt8=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,1,255,0),this[ie]=255&me,ie+1},p.prototype.writeUInt16LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,65535,0),this[ie]=255&me,this[ie+1]=me>>>8,ie+2},p.prototype.writeUInt16BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,65535,0),this[ie]=me>>>8,this[ie+1]=255&me,ie+2},p.prototype.writeUInt32LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,4294967295,0),this[ie+3]=me>>>24,this[ie+2]=me>>>16,this[ie+1]=me>>>8,this[ie]=255&me,ie+4},p.prototype.writeUInt32BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,4294967295,0),this[ie]=me>>>24,this[ie+1]=me>>>16,this[ie+2]=me>>>8,this[ie+3]=255&me,ie+4},p.prototype.writeIntLE=function(me,ie,ge,je){if(me=+me,ie>>>=0,!je){var rt=s(2,8*ge-1);$e(this,me,ie,ge,rt-1,-rt)}var Me=0,ht=1,Ht=0;for(this[ie]=255&me;++Meme&&Ht===0&&this[ie+Me-1]!==0&&(Ht=1),this[ie+Me]=255&(me/ht>>0)-Ht;return ie+ge},p.prototype.writeIntBE=function(me,ie,ge,je){if(me=+me,ie>>>=0,!je){var rt=s(2,8*ge-1);$e(this,me,ie,ge,rt-1,-rt)}var Me=ge-1,ht=1,Ht=0;for(this[ie+Me]=255&me;0<=--Me&&(ht*=256);)0>me&&Ht===0&&this[ie+Me+1]!==0&&(Ht=1),this[ie+Me]=255&(me/ht>>0)-Ht;return ie+ge},p.prototype.writeInt8=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,1,127,-128),0>me&&(me=255+me+1),this[ie]=255&me,ie+1},p.prototype.writeInt16LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,32767,-32768),this[ie]=255&me,this[ie+1]=me>>>8,ie+2},p.prototype.writeInt16BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,2,32767,-32768),this[ie]=me>>>8,this[ie+1]=255&me,ie+2},p.prototype.writeInt32LE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,2147483647,-2147483648),this[ie]=255&me,this[ie+1]=me>>>8,this[ie+2]=me>>>16,this[ie+3]=me>>>24,ie+4},p.prototype.writeInt32BE=function(me,ie,ge){return me=+me,ie>>>=0,ge||$e(this,me,ie,4,2147483647,-2147483648),0>me&&(me=4294967295+me+1),this[ie]=me>>>24,this[ie+1]=me>>>16,this[ie+2]=me>>>8,this[ie+3]=255&me,ie+4},p.prototype.writeFloatLE=function(me,ie,ge){return yt(this,me,ie,!0,ge)},p.prototype.writeFloatBE=function(me,ie,ge){return yt(this,me,ie,!1,ge)},p.prototype.writeDoubleLE=function(me,ie,ge){return Ct(this,me,ie,!0,ge)},p.prototype.writeDoubleBE=function(me,ie,ge){return Ct(this,me,ie,!1,ge)},p.prototype.copy=function(me,ie,ge,je){if(!p.isBuffer(me))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),je||je===0||(je=this.length),ie>=me.length&&(ie=me.length),ie||(ie=0),0ie)throw new RangeError("targetStart out of bounds");if(0>ge||ge>=this.length)throw new RangeError("Index out of range");if(0>je)throw new RangeError("sourceEnd out of bounds");je>this.length&&(je=this.length),me.length-iert||je==="latin1")&&(me=rt)}}else typeof me=="number"&&(me&=255);if(0>ie||this.length>>=0,ge=ge===void 0?this.length:ge>>>0,me||(me=0);var Me;if(typeof me=="number")for(Me=ie;Me */c.read=function(h,p,m,v,w){var S=8*w-v-1,I=(1<>1,L=-7,k=m?w-1:0,B=m?-1:1,$=h[p+k],V,Y;for(k+=B,V=$&(1<<-L)-1,$>>=-L,L+=S;0>=-L,L+=v;0>1,B=w===23?s(2,-24)-s(2,-77):0,$=v?0:S-1,V=v?1:-1,Y=0>p||p===0&&0>1/p?1:0,K,Q,re;for(p=n(p),isNaN(p)||p===1/0?(Q=isNaN(p)?1:0,K=L):(K=t(r(p)/I),1>p*(re=s(2,-K))&&(K--,re*=2),p+=1<=K+k?B/re:B*s(2,1-k),2<=p*re&&(K++,re/=2),K+k>=L?(Q=0,K=L):1<=K+k?(Q=(p*re-1)*s(2,w),K+=k):(Q=p*s(2,k-1)*s(2,w),K=0));8<=w;h[m+$]=255&Q,$+=V,Q/=256,w-=8);for(K=K<"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{}],11:[function(l,u,c){(function(h,p,m){(function(){/*! JSZip v3.6.0 - A JavaScript class for generating and reading zip files @@ -139,13 +139,13 @@ northing meters`+i;var p=h/2,m=0,v=0,w,S,I,R,L;return p>0&&(w=1e5/Math.pow(10,p) \0`,_+=_e(A,2),_+=ct.magic,_+=_e(Fe,2),_+=_e(Yt,2),_+=_e(_t.crc32,4),_+=_e(_t.compressedSize,4),_+=_e(_t.uncompressedSize,4),_+=_e(Ze.length,2),_+=_e(je.length,2),{fileRecord:yt.LOCAL_FILE_HEADER+_+Ze+je,dirRecord:yt.CENTRAL_FILE_HEADER+_e(G,2)+_+_e(ke.length,2)+"\0\0\0\0"+_e(ue,4)+_e(At,4)+Ze+je+ke}}function Te(Ct,ot,vt,At){Ve.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=ot,this.zipPlatform=vt,this.encodeFileName=At,this.streamFiles=Ct,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var Be=fe("../utils"),Ve=fe("../stream/GenericWorker"),$e=fe("../utf8"),tt=fe("../crc32"),yt=fe("../signature");Be.inherits(Te,Ve),Te.prototype.push=function(Ct){var ot=Ct.meta.percent||0,vt=this.entriesCount,At=this._sources.length;this.accumulate?this.contentBuffer.push(Ct):(this.bytesWritten+=Ct.data.length,Ve.prototype.push.call(this,{data:Ct.data,meta:{currentFile:this.currentFile,percent:vt?(ot+100*(vt-At-1))/vt:100}}))},Te.prototype.openedSource=function(Ct){this.currentSourceOffset=this.bytesWritten,this.currentFile=Ct.file.name;var ot=this.streamFiles&&!Ct.file.dir;if(ot){var vt=Ie(Ct,ot,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:vt.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Te.prototype.closedSource=function(Ct){this.accumulate=!1;var ot=this.streamFiles&&!Ct.file.dir,vt=Ie(Ct,ot,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName),At;if(this.dirRecords.push(vt.dirRecord),ot)this.push({data:(At=Ct,yt.DATA_DESCRIPTOR+_e(At.crc32,4)+_e(At.compressedSize,4)+_e(At.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:vt.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Te.prototype.flush=function(){for(var Ct=this.bytesWritten,ot=0;otTe)throw new Error("End of data reached (data length = "+this.length+", asked index = "+Te+"). Corrupted zip ?")},setIndex:function(Te){this.checkIndex(Te),this.index=Te},skip:function(Te){this.setIndex(this.index+Te)},byteAt:function(){},readInt:function(Te){var Be=0,Ve;for(this.checkOffset(Te),Ve=this.index+Te-1;Ve>=this.index;Ve--)Be=(Be<<8)+this.byteAt(Ve);return this.index+=Te,Be},readString:function(Te){return Ie.transformTo("string",this.readData(Te))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var Te=this.readInt(4);return new Date(Date.UTC(1980+(127&Te>>25),(15&Te>>21)-1,31&Te>>16,31&Te>>11,63&Te>>5,(31&Te)<<1))}},be.exports=_e},{"../utils":32}],19:[function(fe,be){function _e(Te){Ie.call(this,Te)}var Ie=fe("./Uint8ArrayReader");fe("../utils").inherits(_e,Ie),_e.prototype.readData=function(Te){this.checkOffset(Te);var Be=this.data.slice(this.zero+this.index,this.zero+this.index+Te);return this.index+=Te,Be},be.exports=_e},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(fe,be){function _e(Te){Ie.call(this,Te)}var Ie=fe("./DataReader");fe("../utils").inherits(_e,Ie),_e.prototype.byteAt=function(Te){return this.data.charCodeAt(this.zero+Te)},_e.prototype.lastIndexOfSignature=function(Te){return this.data.lastIndexOf(Te)-this.zero},_e.prototype.readAndCheckSignature=function(Te){return Te===this.readData(4)},_e.prototype.readData=function(Te){this.checkOffset(Te);var Be=this.data.slice(this.zero+this.index,this.zero+this.index+Te);return this.index+=Te,Be},be.exports=_e},{"../utils":32,"./DataReader":18}],21:[function(fe,be){function _e(Te){Ie.call(this,Te)}var Ie=fe("./ArrayReader");fe("../utils").inherits(_e,Ie),_e.prototype.readData=function(Te){if(this.checkOffset(Te),Te===0)return new Uint8Array(0);var Be=this.data.subarray(this.zero+this.index,this.zero+this.index+Te);return this.index+=Te,Be},be.exports=_e},{"../utils":32,"./ArrayReader":17}],22:[function(fe,be){var _e=fe("../utils"),Ie=fe("../support"),Te=fe("./ArrayReader"),Be=fe("./StringReader"),Ve=fe("./NodeBufferReader"),$e=fe("./Uint8ArrayReader");be.exports=function(tt){var yt=_e.getTypeOf(tt);return _e.checkSupport(yt),yt!=="string"||Ie.uint8array?yt==="nodebuffer"?new Ve(tt):Ie.uint8array?new $e(_e.transformTo("uint8array",tt)):new Te(_e.transformTo("array",tt)):new Be(tt)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(fe,be,_e){_e.LOCAL_FILE_HEADER="PK",_e.CENTRAL_FILE_HEADER="PK",_e.CENTRAL_DIRECTORY_END="PK",_e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",_e.ZIP64_CENTRAL_DIRECTORY_END="PK",_e.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(fe,be){function _e(Be){Ie.call(this,"ConvertWorker to "+Be),this.destType=Be}var Ie=fe("./GenericWorker"),Te=fe("../utils");Te.inherits(_e,Ie),_e.prototype.processChunk=function(Be){this.push({data:Te.transformTo(this.destType,Be.data),meta:Be.meta})},be.exports=_e},{"../utils":32,"./GenericWorker":28}],25:[function(fe,be){function _e(){Ie.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var Ie=fe("./GenericWorker"),Te=fe("../crc32");fe("../utils").inherits(_e,Ie),_e.prototype.processChunk=function(Be){this.streamInfo.crc32=Te(Be.data,this.streamInfo.crc32||0),this.push(Be)},be.exports=_e},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(fe,be){function _e(Be){Te.call(this,"DataLengthProbe for "+Be),this.propName=Be,this.withStreamInfo(Be,0)}var Ie=fe("../utils"),Te=fe("./GenericWorker");Ie.inherits(_e,Te),_e.prototype.processChunk=function(Be){if(Be){var Ve=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Ve+Be.data.length}Te.prototype.processChunk.call(this,Be)},be.exports=_e},{"../utils":32,"./GenericWorker":28}],27:[function(fe,be){function _e(Be){Te.call(this,"DataWorker");var Ve=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Be.then(function($e){Ve.dataIsReady=!0,Ve.data=$e,Ve.max=$e&&$e.length||0,Ve.type=Ie.getTypeOf($e),Ve.isPaused||Ve._tickAndRepeat()},function($e){Ve.error($e)})}var Ie=fe("../utils"),Te=fe("./GenericWorker");Ie.inherits(_e,Te),_e.prototype.cleanUp=function(){Te.prototype.cleanUp.call(this),this.data=null},_e.prototype.resume=function(){return!!Te.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Ie.delay(this._tickAndRepeat,[],this)),!0)},_e.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Ie.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},_e.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Be=null,Ve=a(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":Be=this.data.substring(this.index,Ve);break;case"uint8array":Be=this.data.subarray(this.index,Ve);break;case"array":case"nodebuffer":Be=this.data.slice(this.index,Ve)}return this.index=Ve,this.push({data:Be,meta:{percent:this.max?100*(this.index/this.max):0}})},be.exports=_e},{"../utils":32,"./GenericWorker":28}],28:[function(fe,be){function _e(Ie){this.name=Ie||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}_e.prototype={push:function(Ie){this.emit("data",Ie)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(Ie){this.emit("error",Ie)}return!0},error:function(Ie){return!this.isFinished&&(this.isPaused?this.generatedError=Ie:(this.isFinished=!0,this.emit("error",Ie),this.previous&&this.previous.error(Ie),this.cleanUp()),!0)},on:function(Ie,Te){return this._listeners[Ie].push(Te),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(Ie,Te){if(this._listeners[Ie])for(var Be=0;Be "+Ie:Ie}},be.exports=_e},{}],29:[function(fe,be){function _e(Ct,ot,vt){var At=ot;ot==="blob"||ot==="arraybuffer"?At="uint8array":ot==="base64"&&(At="string");try{this._internalType=At,this._outputType=ot,this._mimeType=vt,Ie.checkSupport(At),this._worker=Ct.pipe(new Te(At)),Ct.lock()}catch(Je){this._worker=new Be("error"),this._worker.error(Je)}}var Ie=fe("../utils"),Te=fe("./ConvertWorker"),Be=fe("./GenericWorker"),Ve=fe("../base64"),$e=fe("../support"),tt=fe("../external"),yt=null;if($e.nodestream)try{yt=fe("../nodejs/NodejsStreamOutputAdapter")}catch{}_e.prototype={accumulate:function(Ct){return ot=this,vt=Ct,new tt.Promise(function(At,Je){var it=[],Ue=ot._internalType,ct=ot._outputType,st=ot._mimeType;ot.on("data",function(Ze,ye){it.push(Ze),vt&&vt(ye)}).on("error",function(Ze){it=[],Je(Ze)}).on("end",function(){try{var Ze=function(ye,Ke,ke){return ye==="blob"?Ie.newBlob(Ie.transformTo("arraybuffer",Ke),ke):ye==="base64"?Ve.encode(Ke):Ie.transformTo(ye,Ke)}(ct,function(ye,Ke){var ke=0,me=null,ie=0,ge;for(ge=0;ge"u")_e.blob=!1;else{var Ie=new ArrayBuffer(0);try{_e.blob=new Blob([Ie],{type:"application/zip"}).size===0}catch{try{var Te=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);Te.append(Ie),_e.blob=Te.getBlob("application/zip").size===0}catch{_e.blob=!1}}}try{_e.nodestream=!!fe("readable-stream").Readable}catch{_e.nodestream=!1}},{"readable-stream":16}],31:[function(fe,be,_e){function Ie(){tt.call(this,"utf-8 decode"),this.leftOver=null}function Te(){tt.call(this,"utf-8 encode")}for(var Be=fe("./utils"),Ve=fe("./support"),$e=fe("./nodejsUtils"),tt=fe("./stream/GenericWorker"),yt=Array(256),Ct=0;256>Ct;Ct++)yt[Ct]=252<=Ct?6:248<=Ct?5:240<=Ct?4:224<=Ct?3:192<=Ct?2:1;yt[254]=yt[254]=1,_e.utf8encode=function(ot){return Ve.nodebuffer?$e.newBufferFrom(ot,"utf-8"):function(vt){var At=vt.length,Je=0,it,Ue,ct,st,Ze;for(st=0;stUe?1:2048>Ue?2:65536>Ue?3:4;for(it=Ve.uint8array?new Uint8Array(Je):Array(Je),st=Ze=0;ZeUe?it[Ze++]=Ue:(2048>Ue?it[Ze++]=192|Ue>>>6:(65536>Ue?it[Ze++]=224|Ue>>>12:(it[Ze++]=240|Ue>>>18,it[Ze++]=128|63&Ue>>>12),it[Ze++]=128|63&Ue>>>6),it[Ze++]=128|63&Ue);return it}(ot)},_e.utf8decode=function(ot){return Ve.nodebuffer?Be.transformTo("nodebuffer",ot).toString("utf-8"):function(vt){var At=vt.length,Je=Array(2*At),it,Ue,ct,st;for(it=Ue=0;it(ct=vt[it++]))Je[Ue++]=ct;else if(4<(st=yt[ct]))Je[Ue++]=65533,it+=st-1;else{for(ct&=st===2?31:st===3?15:7;1ct?Je[Ue++]=ct:(ct-=65536,Je[Ue++]=55296|1023&ct>>10,Je[Ue++]=56320|1023&ct)}return Je.length!==Ue&&(Je.subarray?Je=Je.subarray(0,Ue):Je.length=Ue),Be.applyFromCharCode(Je)}(ot=Be.transformTo(Ve.uint8array?"uint8array":"array",ot))},Be.inherits(Ie,tt),Ie.prototype.processChunk=function(ot){var vt=Be.transformTo(Ve.uint8array?"uint8array":"array",ot.data);if(this.leftOver&&this.leftOver.length){if(Ve.uint8array){var At=vt;(vt=new Uint8Array(At.length+this.leftOver.length)).set(this.leftOver,0),vt.set(At,this.leftOver.length)}else vt=this.leftOver.concat(vt);this.leftOver=null}var Je=function(Ue,ct){var st;for((ct=ct||Ue.length)>Ue.length&&(ct=Ue.length),st=ct-1;0<=st&&(192&Ue[st])==128;)st--;return 0>st||st===0?ct:st+yt[Ue[st]]>ct?st:ct}(vt),it=vt;Je!==vt.length&&(Ve.uint8array?(it=vt.subarray(0,Je),this.leftOver=vt.subarray(Je,vt.length)):(it=vt.slice(0,Je),this.leftOver=vt.slice(Je,vt.length))),this.push({data:_e.utf8decode(it),meta:ot.meta})},Ie.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:_e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},_e.Utf8DecodeWorker=Ie,Be.inherits(Te,tt),Te.prototype.processChunk=function(ot){this.push({data:_e.utf8encode(ot.data),meta:ot.meta})},_e.Utf8EncodeWorker=Te},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(fe,be,_e){function Ie(Je){return Je}function Te(Je,it){for(var Ue=0;Ue(Ue=Je.charCodeAt(ct))?"0":"")+Ue.toString(16).toUpperCase();return it},_e.delay=function(Je,it,Ue){Ct(function(){Je.apply(Ue||null,it||[])})},_e.inherits=function(Je,it){function Ue(){}Ue.prototype=it.prototype,Je.prototype=new Ue},_e.extend=function(){var Je={},it,Ue;for(it=0;ittt)throw this.isSignature(0,Be.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(tt);var yt=tt;if(this.checkSignature(Be.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Te.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Te.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Te.MAX_VALUE_16BITS||this.centralDirRecords===Te.MAX_VALUE_16BITS||this.centralDirSize===Te.MAX_VALUE_32BITS||this.centralDirOffset===Te.MAX_VALUE_32BITS){if(this.zip64=!0,0>(tt=this.reader.lastIndexOfSignature(Be.ZIP64_CENTRAL_DIRECTORY_LOCATOR)))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(tt),this.checkSignature(Be.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Be.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Be.ZIP64_CENTRAL_DIRECTORY_END),0>this.relativeOffsetEndOfZip64CentralDir))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Be.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var Ct=this.centralDirOffset+this.centralDirSize;this.zip64&&(Ct+=20,Ct+=12+this.zip64EndOfCentralSize);var ot=yt-Ct;if(0ot)throw new Error("Corrupted zip: missing "+n(ot)+" bytes.")},prepareReader:function(tt){this.reader=Ie(tt)},load:function(tt){this.prepareReader(tt),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},be.exports=_e},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(fe,be){function _e(Ct,ot){this.options=Ct,this.loadOptions=ot}var Ie=fe("./reader/readerFor"),Te=fe("./utils"),Be=fe("./compressedObject"),Ve=fe("./crc32"),$e=fe("./utf8"),tt=fe("./compressions"),yt=fe("./support");_e.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(Ct){var ot,vt;if(Ct.skip(22),this.fileNameLength=Ct.readInt(2),vt=Ct.readInt(2),this.fileName=Ct.readData(this.fileNameLength),Ct.skip(vt),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((ot=function(At){for(var Je in tt)if(tt.hasOwnProperty(Je)&&tt[Je].magic===At)return tt[Je];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+Te.pretty(this.compressionMethod)+" unknown (inner file : "+Te.transformTo("string",this.fileName)+")");this.decompressed=new Be(this.compressedSize,this.uncompressedSize,this.crc32,ot,Ct.readData(this.compressedSize))},readCentralPart:function(Ct){this.versionMadeBy=Ct.readInt(2),Ct.skip(2),this.bitFlag=Ct.readInt(2),this.compressionMethod=Ct.readString(2),this.date=Ct.readDate(),this.crc32=Ct.readInt(4),this.compressedSize=Ct.readInt(4),this.uncompressedSize=Ct.readInt(4);var ot=Ct.readInt(2);if(this.extraFieldsLength=Ct.readInt(2),this.fileCommentLength=Ct.readInt(2),this.diskNumberStart=Ct.readInt(2),this.internalFileAttributes=Ct.readInt(2),this.externalFileAttributes=Ct.readInt(4),this.localHeaderOffset=Ct.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");Ct.skip(ot),this.readExtraFields(Ct),this.parseZIP64ExtraField(Ct),this.fileComment=Ct.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var Ct=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),Ct==0&&(this.dosPermissions=63&this.externalFileAttributes),Ct==3&&(this.unixPermissions=65535&this.externalFileAttributes>>16),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var Ct=Ie(this.extraFields[1].value);this.uncompressedSize===Te.MAX_VALUE_32BITS&&(this.uncompressedSize=Ct.readInt(8)),this.compressedSize===Te.MAX_VALUE_32BITS&&(this.compressedSize=Ct.readInt(8)),this.localHeaderOffset===Te.MAX_VALUE_32BITS&&(this.localHeaderOffset=Ct.readInt(8)),this.diskNumberStart===Te.MAX_VALUE_32BITS&&(this.diskNumberStart=Ct.readInt(4))}},readExtraFields:function(Ct){var ot=Ct.index+this.extraFieldsLength,vt,At,Je;for(this.extraFields||(this.extraFields={});Ct.index+4"u"?typeof window>"u"?{}:window:self:ae)},{}],37:[function(fe,be){function _e(){}function Ie(Je){if(typeof Je!="function")throw new TypeError("resolver must be a function");this.state=At,this.queue=[],this.outcome=void 0,Je!==_e&&$e(this,Je)}function Te(Je,it,Ue){this.promise=Je,typeof it=="function"&&(this.onFulfilled=it,this.callFulfilled=this.otherCallFulfilled),typeof Ue=="function"&&(this.onRejected=Ue,this.callRejected=this.otherCallRejected)}function Be(Je,it,Ue){yt(function(){var ct;try{ct=it(Ue)}catch(st){return Ct.reject(Je,st)}ct===Je?Ct.reject(Je,new TypeError("Cannot resolve promise with itself")):Ct.resolve(Je,ct)})}function Ve(Je){var it=Je&&Je.then;if(Je&&(typeof Je=="object"||typeof Je=="function")&&typeof it=="function")return function(){it.apply(Je,arguments)}}function $e(Je,it){function Ue(ye){st||(st=!0,Ct.reject(Je,ye))}function ct(ye){st||(st=!0,Ct.resolve(Je,ye))}var st=!1,Ze=tt(function(){it(ct,Ue)});Ze.status==="error"&&Ue(Ze.value)}function tt(Je,it){var Ue={};try{Ue.value=Je(it),Ue.status="success"}catch(ct){Ue.status="error",Ue.value=ct}return Ue}var yt=fe("immediate"),Ct={},ot=["REJECTED"],vt=["FULFILLED"],At=["PENDING"];(be.exports=Ie).prototype.finally=function(Je){if(typeof Je!="function")return this;var it=this.constructor;return this.then(function(Ue){return it.resolve(Je()).then(function(){return Ue})},function(Ue){return it.resolve(Je()).then(function(){throw Ue})})},Ie.prototype.catch=function(Je){return this.then(null,Je)},Ie.prototype.then=function(Je,it){if(typeof Je!="function"&&this.state===vt||typeof it!="function"&&this.state===ot)return this;var Ue=new this.constructor(_e);return this.state===At?this.queue.push(new Te(Ue,Je,it)):Be(Ue,this.state===vt?Je:it,this.outcome),Ue},Te.prototype.callFulfilled=function(Je){Ct.resolve(this.promise,Je)},Te.prototype.otherCallFulfilled=function(Je){Be(this.promise,this.onFulfilled,Je)},Te.prototype.callRejected=function(Je){Ct.reject(this.promise,Je)},Te.prototype.otherCallRejected=function(Je){Be(this.promise,this.onRejected,Je)},Ct.resolve=function(Je,it){var Ue=tt(Ve,it);if(Ue.status==="error")return Ct.reject(Je,Ue.value);var ct=Ue.value;if(ct)$e(Je,ct);else{Je.state=vt,Je.outcome=it;for(var st=-1,Ze=Je.queue.length;++stvt.windowBits&&(vt.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new yt,this.strm.avail_out=0;var At=Be.deflateInit2(this.strm,vt.level,vt.method,vt.windowBits,vt.memLevel,vt.strategy);if(At!==0)throw new Error(tt[At]);if(vt.header&&Be.deflateSetHeader(this.strm,vt.header),vt.dictionary){var Je;if(Je=typeof vt.dictionary=="string"?$e.string2buf(vt.dictionary):Ct.call(vt.dictionary)==="[object ArrayBuffer]"?new Uint8Array(vt.dictionary):vt.dictionary,(At=Be.deflateSetDictionary(this.strm,Je))!==0)throw new Error(tt[At]);this._dict_set=!0}}function Te(ot,vt){var At=new Ie(vt);if(At.push(ot,!0),At.err)throw At.msg||tt[At.err];return At.result}var Be=fe("./zlib/deflate"),Ve=fe("./utils/common"),$e=fe("./utils/strings"),tt=fe("./zlib/messages"),yt=fe("./zlib/zstream"),Ct=Object.prototype.toString;Ie.prototype.push=function(ot,vt){var At=this.strm,Je=this.options.chunkSize,it,Ue;if(this.ended)return!1;Ue=vt===~~vt?vt:vt===!0?4:0,At.input=typeof ot=="string"?$e.string2buf(ot):Ct.call(ot)==="[object ArrayBuffer]"?new Uint8Array(ot):ot,At.next_in=0,At.avail_in=At.input.length;do{if(At.avail_out===0&&(At.output=new Ve.Buf8(Je),At.next_out=0,At.avail_out=Je),(it=Be.deflate(At,Ue))!==1&&it!==0)return this.onEnd(it),!(this.ended=!0);At.avail_out!==0&&(At.avail_in!==0||Ue!==4&&Ue!==2)||(this.options.to==="string"?this.onData($e.buf2binstring(Ve.shrinkBuf(At.output,At.next_out))):this.onData(Ve.shrinkBuf(At.output,At.next_out)))}while((0Je.windowBits&&(Je.windowBits=-Je.windowBits,Je.windowBits===0&&(Je.windowBits=-15)),!(0<=Je.windowBits&&16>Je.windowBits)||At&&At.windowBits||(Je.windowBits+=32),15Je.windowBits&&!(15&Je.windowBits)&&(Je.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;var it=Be.inflateInit2(this.strm,Je.windowBits);if(it!==tt.Z_OK)throw new Error(yt[it]);this.header=new ot,Be.inflateGetHeader(this.strm,this.header)}function Te(At,Je){var it=new Ie(Je);if(it.push(At,!0),it.err)throw it.msg||yt[it.err];return it.result}var Be=fe("./zlib/inflate"),Ve=fe("./utils/common"),$e=fe("./utils/strings"),tt=fe("./zlib/constants"),yt=fe("./zlib/messages"),Ct=fe("./zlib/zstream"),ot=fe("./zlib/gzheader"),vt=Object.prototype.toString;Ie.prototype.push=function(At,Je){var it=this.strm,Ue=this.options.chunkSize,ct=this.options.dictionary,st=!1,Ze,ye,Ke,ke,me,ie;if(this.ended)return!1;ye=Je===~~Je?Je:Je===!0?tt.Z_FINISH:tt.Z_NO_FLUSH,it.input=typeof At=="string"?$e.binstring2buf(At):vt.call(At)==="[object ArrayBuffer]"?new Uint8Array(At):At,it.next_in=0,it.avail_in=it.input.length;do{if(it.avail_out===0&&(it.output=new Ve.Buf8(Ue),it.next_out=0,it.avail_out=Ue),(Ze=Be.inflate(it,tt.Z_NO_FLUSH))===tt.Z_NEED_DICT&&ct&&(ie=typeof ct=="string"?$e.string2buf(ct):vt.call(ct)==="[object ArrayBuffer]"?new Uint8Array(ct):ct,Ze=Be.inflateSetDictionary(this.strm,ie)),Ze===tt.Z_BUF_ERROR&&st===!0&&(Ze=tt.Z_OK,st=!1),Ze!==tt.Z_STREAM_END&&Ze!==tt.Z_OK)return this.onEnd(Ze),!(this.ended=!0);it.next_out&&(it.avail_out!==0&&Ze!==tt.Z_STREAM_END&&(it.avail_in!==0||ye!==tt.Z_FINISH&&ye!==tt.Z_SYNC_FLUSH)||(this.options.to==="string"?(Ke=$e.utf8border(it.output,it.next_out),ke=it.next_out-Ke,me=$e.buf2string(it.output,Ke),it.next_out=ke,it.avail_out=Ue-ke,ke&&Ve.arraySet(it.output,it.output,Ke,ke,0),this.onData(me)):this.onData(Ve.shrinkBuf(it.output,it.next_out)))),it.avail_in===0&&it.avail_out===0&&(st=!0)}while((0Ct&&(yt.subarray&&Ve||!yt.subarray&&Be))return o.apply(null,Te.shrinkBuf(yt,Ct));for(var ot="",vt=0;vttt;tt++)$e[tt]=252<=tt?6:248<=tt?5:240<=tt?4:224<=tt?3:192<=tt?2:1;$e[254]=$e[254]=1,_e.string2buf=function(yt){var Ct=yt.length,ot=0,vt,At,Je,it,Ue;for(it=0;itAt?1:2048>At?2:65536>At?3:4;for(vt=new Te.Buf8(ot),it=Ue=0;UeAt?vt[Ue++]=At:(2048>At?vt[Ue++]=192|At>>>6:(65536>At?vt[Ue++]=224|At>>>12:(vt[Ue++]=240|At>>>18,vt[Ue++]=128|63&At>>>12),vt[Ue++]=128|63&At>>>6),vt[Ue++]=128|63&At);return vt},_e.buf2binstring=function(yt){return Ie(yt,yt.length)},_e.binstring2buf=function(yt){for(var Ct=new Te.Buf8(yt.length),ot=0,vt=Ct.length;ot(it=yt[At++]))vt[Je++]=it;else if(4<(Ue=$e[it]))vt[Je++]=65533,At+=Ue-1;else{for(it&=Ue===2?31:Ue===3?15:7;1it?vt[Je++]=it:(it-=65536,vt[Je++]=55296|1023&it>>10,vt[Je++]=56320|1023&it)}return Ie(vt,Je)},_e.utf8border=function(yt,Ct){var ot;for((Ct=Ct||yt.length)>yt.length&&(Ct=yt.length),ot=Ct-1;0<=ot&&(192&yt[ot])==128;)ot--;return 0>ot||ot===0?Ct:ot+$e[yt[ot]]>Ct?ot:Ct}},{"./common":41}],43:[function(fe,be){be.exports=function(_e,Ie,Te,Be){for(var Ve=0|65535&_e,$e=0|65535&_e>>>16,tt=0;Te!==0;){for(Te-=tt=2e3Te;Te++){Be=Te;for(var Ve=0;8>Ve;Ve++)Be=1&Be?3988292384^Be>>>1:Be>>>1;Ie[Te]=Be}return Ie}();be.exports=function(Ie,Te,Be,Ve){Ie^=-1;for(var $e=Ve;$e>>8^_e[255&(Ie^Te[$e])];return-1^Ie}},{}],46:[function(fe,be,_e){function Ie(ge,je){return ge.msg=me[je],je}function Te(ge){return(ge<<1)-(4ge.avail_out&&(rt=ge.avail_out),rt!==0&&(Ze.arraySet(ge.output,je.pending_buf,je.pending_out,rt,ge.next_out),ge.next_out+=rt,je.pending_out+=rt,ge.total_out+=rt,ge.avail_out-=rt,je.pending-=rt,je.pending===0&&(je.pending_out=0))}function $e(ge,je){ye._tr_flush_block(ge,0<=ge.block_start?ge.block_start:-1,ge.strstart-ge.block_start,je),ge.block_start=ge.strstart,Ve(ge.strm)}function tt(ge,je){ge.pending_buf[ge.pending++]=je}function yt(ge,je){ge.pending_buf[ge.pending++]=255&je>>>8,ge.pending_buf[ge.pending++]=255&je}function Ct(ge,je){var rt=ge.max_chain_length,Me=ge.strstart,ht=ge.prev_length,Ht=ge.nice_match,_t=ge.strstart>ge.w_size-262?ge.strstart-(ge.w_size-262):0,Fe=ge.window,Yt=ge.w_mask,A=ge.prev,ue=ge.strstart+258,G=Fe[Me+ht-1],E=Fe[Me+ht],_,g;ge.prev_length>=ge.good_match&&(rt>>=2),Ht>ge.lookahead&&(Ht=ge.lookahead);do if(Fe[(_=je)+ht]===E&&Fe[_+ht-1]===G&&Fe[_]===Fe[Me]&&Fe[++_]===Fe[Me+1]){Me+=2,_++;do;while(Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Fe[++Me]===Fe[++_]&&Me_t&&--rt!=0);return ht<=ge.lookahead?ht:ge.lookahead}function ot(ge){var je=ge.w_size,rt,Me,ht,Ht,_t,Fe,Yt,A,ue,G;do{if(Ht=ge.window_size-ge.lookahead-ge.strstart,ge.strstart>=je+(je-262)){for(Ze.arraySet(ge.window,ge.window,je,je,0),ge.match_start-=je,ge.strstart-=je,ge.block_start-=je,rt=Me=ge.hash_size;ht=ge.head[--rt],ge.head[rt]=je<=ht?ht-je:0,--Me;);for(rt=Me=je;ht=ge.prev[--rt],ge.prev[rt]=je<=ht?ht-je:0,--Me;);Ht+=je}if(ge.strm.avail_in===0)break;if(Fe=ge.strm,Yt=ge.window,A=ge.strstart+ge.lookahead,G=void 0,(ue=Ht)<(G=Fe.avail_in)&&(G=ue),Me=G===0?0:(Fe.avail_in-=G,Ze.arraySet(Yt,Fe.input,Fe.next_in,G,A),Fe.state.wrap===1?Fe.adler=Ke(Fe.adler,Yt,G,A):Fe.state.wrap===2&&(Fe.adler=ke(Fe.adler,Yt,G,A)),Fe.next_in+=G,Fe.total_in+=G,G),ge.lookahead+=Me,3<=ge.lookahead+ge.insert)for(_t=ge.strstart-ge.insert,ge.ins_h=ge.window[_t],ge.ins_h=(ge.ins_h<ge.lookahead+ge.insert)););}while(ge.lookahead<262&&ge.strm.avail_in!==0)}function vt(ge,je){for(var rt,Me;;){if(ge.lookahead<262){if(ot(ge),ge.lookahead<262&&je===0)return 1;if(ge.lookahead===0)break}if(rt=0,3<=ge.lookahead&&(ge.ins_h=(ge.ins_h<=ge.match_length&&(ge.strategy===1||ge.match_length===3&&4096je.wrap&&(je.wrap=-je.wrap),je.status=je.wrap?42:113,ge.adler=je.wrap===2?0:1,je.last_flush=0,ye._tr_init(je),0):Ie(ge,-2)}function ct(ge){var je=Ue(ge),rt;return je===0&&((rt=ge.state).window_size=2*rt.w_size,Be(rt.head),rt.max_lazy_match=ie[rt.level].max_lazy,rt.good_match=ie[rt.level].good_length,rt.nice_match=ie[rt.level].nice_length,rt.max_chain_length=ie[rt.level].max_chain,rt.strstart=0,rt.block_start=0,rt.lookahead=0,rt.insert=0,rt.match_length=rt.prev_length=2,rt.match_available=0,rt.ins_h=0),je}function st(ge,je,rt,Me,ht,Ht){if(!ge)return-2;var _t=1;if(je===-1&&(je=6),0>Me?(_t=0,Me=-Me):15ht||9Me||15je||9Ht||4ge.pending_buf_size-5&&(rt=ge.pending_buf_size-5);;){if(1>=ge.lookahead){if(ot(ge),ge.lookahead===0&&je===0)return 1;if(ge.lookahead===0)break}ge.strstart+=ge.lookahead,ge.lookahead=0;var Me=ge.block_start+rt;if((ge.strstart===0||ge.strstart>=Me)&&(ge.lookahead=ge.strstart-Me,ge.strstart=Me,$e(ge,!1),ge.strm.avail_out===0)||ge.strstart-ge.block_start>=ge.w_size-262&&($e(ge,!1),ge.strm.avail_out===0))return 1}return ge.insert=0,je===4?($e(ge,!0),ge.strm.avail_out===0?3:4):(ge.strstart>ge.block_start&&($e(ge,!1),ge.strm.avail_out),1)}),new Je(4,4,8,4,vt),new Je(4,5,16,8,vt),new Je(4,6,32,32,vt),new Je(4,4,16,16,At),new Je(8,16,32,32,At),new Je(8,16,128,128,At),new Je(8,32,128,256,At),new Je(32,128,258,1024,At),new Je(32,258,258,4096,At)],_e.deflateInit=function(ge,je){return st(ge,je,8,15,8,0)},_e.deflateInit2=st,_e.deflateReset=ct,_e.deflateResetKeep=Ue,_e.deflateSetHeader=function(ge,je){return ge&&ge.state&&ge.state.wrap===2?(ge.state.gzhead=je,0):-2},_e.deflate=function(ge,je){var rt,Me,ht,Ht;if(!ge||!ge.state||5je)return ge?Ie(ge,-2):-2;if(Me=ge.state,!ge.output||!ge.input&&ge.avail_in!==0||Me.status===666&&je!==4)return Ie(ge,ge.avail_out===0?-5:-2);if(Me.strm=ge,rt=Me.last_flush,Me.last_flush=je,Me.status===42)if(Me.wrap===2)ge.adler=0,tt(Me,31),tt(Me,139),tt(Me,8),Me.gzhead?(tt(Me,(Me.gzhead.text?1:0)+(Me.gzhead.hcrc?2:0)+(Me.gzhead.extra?4:0)+(Me.gzhead.name?8:0)+(Me.gzhead.comment?16:0)),tt(Me,255&Me.gzhead.time),tt(Me,255&Me.gzhead.time>>8),tt(Me,255&Me.gzhead.time>>16),tt(Me,255&Me.gzhead.time>>24),tt(Me,Me.level===9?2:2<=Me.strategy||2>Me.level?4:0),tt(Me,255&Me.gzhead.os),Me.gzhead.extra&&Me.gzhead.extra.length&&(tt(Me,255&Me.gzhead.extra.length),tt(Me,255&Me.gzhead.extra.length>>8)),Me.gzhead.hcrc&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending,0)),Me.gzindex=0,Me.status=69):(tt(Me,0),tt(Me,0),tt(Me,0),tt(Me,0),tt(Me,0),tt(Me,Me.level===9?2:2<=Me.strategy||2>Me.level?4:0),tt(Me,3),Me.status=113);else{var _t=8+(Me.w_bits-8<<4)<<8;_t|=(2<=Me.strategy||2>Me.level?0:6>Me.level?1:Me.level===6?2:3)<<6,Me.strstart!==0&&(_t|=32),_t+=31-_t%31,Me.status=113,yt(Me,_t),Me.strstart!==0&&(yt(Me,ge.adler>>>16),yt(Me,65535&ge.adler)),ge.adler=1}if(Me.status===69)if(Me.gzhead.extra){for(ht=Me.pending;Me.gzindex<(65535&Me.gzhead.extra.length)&&(Me.pending!==Me.pending_buf_size||(Me.gzhead.hcrc&&Me.pending>ht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Ve(ge),ht=Me.pending,Me.pending!==Me.pending_buf_size));)tt(Me,255&Me.gzhead.extra[Me.gzindex]),Me.gzindex++;Me.gzhead.hcrc&&Me.pending>ht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Me.gzindex===Me.gzhead.extra.length&&(Me.gzindex=0,Me.status=73)}else Me.status=73;if(Me.status===73)if(Me.gzhead.name){ht=Me.pending;do{if(Me.pending===Me.pending_buf_size&&(Me.gzhead.hcrc&&Me.pending>ht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Ve(ge),ht=Me.pending,Me.pending===Me.pending_buf_size)){Ht=1;break}Ht=Me.gzindexht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Ht===0&&(Me.gzindex=0,Me.status=91)}else Me.status=91;if(Me.status===91)if(Me.gzhead.comment){ht=Me.pending;do{if(Me.pending===Me.pending_buf_size&&(Me.gzhead.hcrc&&Me.pending>ht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Ve(ge),ht=Me.pending,Me.pending===Me.pending_buf_size)){Ht=1;break}Ht=Me.gzindexht&&(ge.adler=ke(ge.adler,Me.pending_buf,Me.pending-ht,ht)),Ht===0&&(Me.status=103)}else Me.status=103;if(Me.status===103&&(Me.gzhead.hcrc?(Me.pending+2>Me.pending_buf_size&&Ve(ge),Me.pending+2<=Me.pending_buf_size&&(tt(Me,255&ge.adler),tt(Me,255&ge.adler>>8),ge.adler=0,Me.status=113)):Me.status=113),Me.pending!==0){if(Ve(ge),ge.avail_out===0)return Me.last_flush=-1,0}else if(ge.avail_in===0&&Te(je)<=Te(rt)&&je!==4)return Ie(ge,-5);if(Me.status===666&&ge.avail_in!==0)return Ie(ge,-5);if(ge.avail_in!==0||Me.lookahead!==0||je!==0&&Me.status!==666){var Fe=Me.strategy===2?function(Yt,A){for(var ue;;){if(Yt.lookahead===0&&(ot(Yt),Yt.lookahead===0)){if(A===0)return 1;break}if(Yt.match_length=0,ue=ye._tr_tally(Yt,0,Yt.window[Yt.strstart]),Yt.lookahead--,Yt.strstart++,ue&&($e(Yt,!1),Yt.strm.avail_out===0))return 1}return Yt.insert=0,A===4?($e(Yt,!0),Yt.strm.avail_out===0?3:4):Yt.last_lit&&($e(Yt,!1),Yt.strm.avail_out===0)?1:2}(Me,je):Me.strategy===3?function(Yt,A){for(var ue=Yt.window,G,E,_,g;;){if(258>=Yt.lookahead){if(ot(Yt),258>=Yt.lookahead&&A===0)return 1;if(Yt.lookahead===0)break}if(Yt.match_length=0,3<=Yt.lookahead&&0Yt.lookahead&&(Yt.match_length=Yt.lookahead)}if(3<=Yt.match_length?(G=ye._tr_tally(Yt,1,Yt.match_length-3),Yt.lookahead-=Yt.match_length,Yt.strstart+=Yt.match_length,Yt.match_length=0):(G=ye._tr_tally(Yt,0,Yt.window[Yt.strstart]),Yt.lookahead--,Yt.strstart++),G&&($e(Yt,!1),Yt.strm.avail_out===0))return 1}return Yt.insert=0,A===4?($e(Yt,!0),Yt.strm.avail_out===0?3:4):Yt.last_lit&&($e(Yt,!1),Yt.strm.avail_out===0)?1:2}(Me,je):ie[Me.level].func(Me,je);if(Fe!==3&&Fe!==4||(Me.status=666),Fe===1||Fe===3)return ge.avail_out===0&&(Me.last_flush=-1),0;if(Fe===2&&(je===1?ye._tr_align(Me):je!=5&&(ye._tr_stored_block(Me,0,0,!1),je==3&&(Be(Me.head),Me.lookahead===0&&(Me.strstart=0,Me.block_start=0,Me.insert=0))),Ve(ge),ge.avail_out===0))return Me.last_flush=-1,0}return je===4?0>=Me.wrap?1:(Me.wrap===2?(tt(Me,255&ge.adler),tt(Me,255&ge.adler>>8),tt(Me,255&ge.adler>>16),tt(Me,255&ge.adler>>24),tt(Me,255&ge.total_in),tt(Me,255&ge.total_in>>8),tt(Me,255&ge.total_in>>16),tt(Me,255&ge.total_in>>24)):(yt(Me,ge.adler>>>16),yt(Me,65535&ge.adler)),Ve(ge),0=Me.w_size&&(_t===0&&(Be(Me.head),Me.strstart=0,Me.block_start=0,Me.insert=0),ue=new Ze.Buf8(Me.w_size),Ze.arraySet(ue,je,rt-Me.w_size,Me.w_size,0),je=ue,rt=Me.w_size),Fe=ge.avail_in,Yt=ge.next_in,A=ge.input,ge.avail_in=rt,ge.next_in=0,ge.input=je,ot(Me);Me.lookahead>=3;){for(ht=Me.strstart,Ht=Me.lookahead-2;Me.ins_h=(Me.ins_h<Ue&&(it+=rt[Be++]<>>=ke=Ke>>>24,Ue-=ke,(ke=255&Ke>>>16)==0)Me[$e++]=65535&Ke;else{if(!(16&ke)){if(!(64&ke)){Ke=ct[(65535&Ke)+(it&(1<>>=ke,Ue-=ke),15>Ue&&(it+=rt[Be++]<>>=ke=Ke>>>24,Ue-=ke,!(16&(ke=255&Ke>>>16))){if(!(64&ke)){Ke=st[(65535&Ke)+(it&(1<>>=ke,Ue-=ke,(ke=$e-tt)>3,it&=(1<<(Ue-=me<<3))-1,_e.next_in=Be,_e.next_out=$e,_e.avail_in=Be>>24)+(65280&Ze>>>8)+((65280&Ze)<<8)+((255&Ze)<<24)}function Te(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ot.Buf16(320),this.work=new ot.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Be(Ze){var ye;return Ze&&Ze.state?(ye=Ze.state,Ze.total_in=Ze.total_out=ye.total=0,Ze.msg="",ye.wrap&&(Ze.adler=1&ye.wrap),ye.mode=1,ye.last=0,ye.havedict=0,ye.dmax=32768,ye.head=null,ye.hold=0,ye.bits=0,ye.lencode=ye.lendyn=new ot.Buf32(852),ye.distcode=ye.distdyn=new ot.Buf32(592),ye.sane=1,ye.back=-1,0):-2}function Ve(Ze){var ye;return Ze&&Ze.state?((ye=Ze.state).wsize=0,ye.whave=0,ye.wnext=0,Be(Ze)):-2}function $e(Ze,ye){var Ke,ke;return Ze&&Ze.state?(ke=Ze.state,0>ye?(Ke=0,ye=-ye):(Ke=1+(ye>>4),48>ye&&(ye&=15)),ye&&(8>ye||15ye;)Ze.lens[ye++]=8;for(;256>ye;)Ze.lens[ye++]=9;for(;280>ye;)Ze.lens[ye++]=7;for(;288>ye;)Ze.lens[ye++]=8;for(it(1,Ze.lens,0,288,ct,0,Ze.work,{bits:9}),ye=0;32>ye;)Ze.lens[ye++]=5;it(2,Ze.lens,0,32,st,0,Ze.work,{bits:5}),Ue=!1}Ze.lencode=ct,Ze.lenbits=9,Ze.distcode=st,Ze.distbits=5}function Ct(Ze,ye,Ke,ke){var me=Ze.state,ie;return me.window===null&&(me.wsize=1<=me.wsize?(ot.arraySet(me.window,ye,Ke-me.wsize,me.wsize,0),me.wnext=0,me.whave=me.wsize):(ke<(ie=me.wsize-me.wnext)&&(ie=ke),ot.arraySet(me.window,ye,Ke-ke,ie,me.wnext),(ke-=ie)?(ot.arraySet(me.window,ye,Ke-ke,ke,0),me.wnext=ke,me.whave=me.wsize):(me.wnext+=ie,me.wnext===me.wsize&&(me.wnext=0),me.whaveFe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>8,ie.check=At(ie.check,ke,2,0),Fe=_t=0,ie.mode=2;break}if(ie.flags=0,ie.head&&(ie.head.done=!1),!(1&ie.wrap)||(((255&_t)<<8)+(_t>>8))%31){Ze.msg="incorrect header check",ie.mode=30;break}if((15&_t)!=8){Ze.msg="unknown compression method",ie.mode=30;break}if(Fe-=4,N=8+(15&(_t>>>=4)),ie.wbits===0)ie.wbits=N;else if(N>ie.wbits){Ze.msg="invalid window size",ie.mode=30;break}ie.dmax=1<Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>8),512&ie.flags&&(ke[0]=255&_t,ke[1]=255&_t>>>8,ie.check=At(ie.check,ke,2,0)),Fe=_t=0,ie.mode=3;case 3:for(;32>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>8,ke[2]=255&_t>>>16,ke[3]=255&_t>>>24,ie.check=At(ie.check,ke,4,0)),Fe=_t=0,ie.mode=4;case 4:for(;16>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>8),512&ie.flags&&(ke[0]=255&_t,ke[1]=255&_t>>>8,ie.check=At(ie.check,ke,2,0)),Fe=_t=0,ie.mode=5;case 5:if(1024&ie.flags){for(;16>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>8,ie.check=At(ie.check,ke,2,0)),Fe=_t=0}else ie.head&&(ie.head.extra=null);ie.mode=6;case 6:if(1024&ie.flags&&(ht<(ue=ie.length)&&(ue=ht),ue&&(ie.head&&(N=ie.head.extra_len-ie.length,ie.head.extra||(ie.head.extra=Array(ie.head.extra_len)),ot.arraySet(ie.head.extra,ge,rt,ue,N)),512&ie.flags&&(ie.check=At(ie.check,ge,ue,rt)),ht-=ue,rt+=ue,ie.length-=ue),ie.length))break e;ie.length=0,ie.mode=7;case 7:if(2048&ie.flags){if(ht===0)break e;for(ue=0;N=ge[rt+ue++],ie.head&&N&&65536>ie.length&&(ie.head.name+=o(N)),N&&ueie.length&&(ie.head.comment+=o(N)),N&&ueFe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>9,ie.head.done=!0),Ze.adler=ie.check=0,ie.mode=12;break;case 10:for(;32>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=7&Fe,Fe-=7&Fe,ie.mode=27;break}for(;3>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=1)){case 0:ie.mode=14;break;case 1:if(yt(ie),ie.mode=20,ye!==6)break;_t>>>=2,Fe-=2;break e;case 2:ie.mode=17;break;case 3:Ze.msg="invalid block type",ie.mode=30}_t>>>=2,Fe-=2;break;case 14:for(_t>>>=7&Fe,Fe-=7&Fe;32>Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>16)){Ze.msg="invalid stored block lengths",ie.mode=30;break}if(ie.length=65535&_t,Fe=_t=0,ie.mode=15,ye===6)break e;case 15:ie.mode=16;case 16:if(ue=ie.length){if(htFe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=5,Fe-=5,ie.ndist=1+(31&_t),_t>>>=5,Fe-=5,ie.ncode=4+(15&_t),_t>>>=4,Fe-=4,286Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=3,Fe-=3}for(;19>ie.have;)ie.lens[me[ie.have++]]=0;if(ie.lencode=ie.lendyn,ie.lenbits=7,W={bits:ie.lenbits},j=it(0,ie.lens,0,19,ie.lencode,0,ie.work,W),ie.lenbits=W.bits,j){Ze.msg="invalid code lengths set",ie.mode=30;break}ie.have=0,ie.mode=19;case 19:for(;ie.have>>16,b=65535&Ke,!((_=Ke>>>24)<=Fe);){if(ht===0)break e;ht--,_t+=ge[rt++]<b)_t>>>=_,Fe-=_,ie.lens[ie.have++]=b;else{if(b===16){for(q=_+2;Fe>>=_,Fe-=_,ie.have===0){Ze.msg="invalid bit length repeat",ie.mode=30;break}N=ie.lens[ie.have-1],ue=3+(3&_t),_t>>>=2,Fe-=2}else if(b===17){for(q=_+3;Fe>>=_)),_t>>>=3,Fe-=3}else{for(q=_+7;Fe>>=_)),_t>>>=7,Fe-=7}if(ie.have+ue>ie.nlen+ie.ndist){Ze.msg="invalid bit length repeat",ie.mode=30;break}for(;ue--;)ie.lens[ie.have++]=N}}if(ie.mode===30)break;if(ie.lens[256]===0){Ze.msg="invalid code -- missing end-of-block",ie.mode=30;break}if(ie.lenbits=9,W={bits:ie.lenbits},j=it(1,ie.lens,0,ie.nlen,ie.lencode,0,ie.work,W),ie.lenbits=W.bits,j){Ze.msg="invalid literal/lengths set",ie.mode=30;break}if(ie.distbits=6,ie.distcode=ie.distdyn,W={bits:ie.distbits},j=it(2,ie.lens,ie.nlen,ie.ndist,ie.distcode,0,ie.work,W),ie.distbits=W.bits,j){Ze.msg="invalid distances set",ie.mode=30;break}if(ie.mode=20,ye===6)break e;case 20:ie.mode=21;case 21:if(6<=ht&&258<=Ht){Ze.next_out=Me,Ze.avail_out=Ht,Ze.next_in=rt,Ze.avail_in=ht,ie.hold=_t,ie.bits=Fe,Je(Ze,A),Me=Ze.next_out,je=Ze.output,Ht=Ze.avail_out,rt=Ze.next_in,ge=Ze.input,ht=Ze.avail_in,_t=ie.hold,Fe=ie.bits,ie.mode===12&&(ie.back=-1);break}for(ie.back=0;g=255&(Ke=ie.lencode[_t&(1<>>16,b=65535&Ke,!((_=Ke>>>24)<=Fe);){if(ht===0)break e;ht--,_t+=ge[rt++]<>C)])>>>16,b=65535&Ke,!(C+(_=Ke>>>24)<=Fe);){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=C,Fe-=C,ie.back+=C}if(_t>>>=_,Fe-=_,ie.back+=_,ie.length=b,g===0){ie.mode=26;break}if(32&g){ie.back=-1,ie.mode=12;break}if(64&g){Ze.msg="invalid literal/length code",ie.mode=30;break}ie.extra=15&g,ie.mode=22;case 22:if(ie.extra){for(q=ie.extra;Fe>>=ie.extra,Fe-=ie.extra,ie.back+=ie.extra}ie.was=ie.length,ie.mode=23;case 23:for(;g=255&(Ke=ie.distcode[_t&(1<>>16,b=65535&Ke,!((_=Ke>>>24)<=Fe);){if(ht===0)break e;ht--,_t+=ge[rt++]<>C)])>>>16,b=65535&Ke,!(C+(_=Ke>>>24)<=Fe);){if(ht===0)break e;ht--,_t+=ge[rt++]<>>=C,Fe-=C,ie.back+=C}if(_t>>>=_,Fe-=_,ie.back+=_,64&g){Ze.msg="invalid distance code",ie.mode=30;break}ie.offset=b,ie.extra=15&g,ie.mode=24;case 24:if(ie.extra){for(q=ie.extra;Fe>>=ie.extra,Fe-=ie.extra,ie.back+=ie.extra}if(ie.offset>ie.dmax){Ze.msg="invalid distance too far back",ie.mode=30;break}ie.mode=25;case 25:if(Ht===0)break e;if(ue=A-Ht,ie.offset>ue){if((ue=ie.offset-ue)>ie.whave&&ie.sane){Ze.msg="invalid distance too far back",ie.mode=30;break}G=ue>ie.wnext?(ue-=ie.wnext,ie.wsize-ue):ie.wnext-ue,ue>ie.length&&(ue=ie.length),E=ie.window}else E=je,G=Me-ie.offset,ue=ie.length;for(HtFe;){if(ht===0)break e;ht--,_t|=ge[rt++]<Fe;){if(ht===0)break e;ht--,_t+=ge[rt++]<ie.mode&&(27>ie.mode||ye!==4))&&Ct(Ze,Ze.output,Ze.next_out,A-Ze.avail_out)?(ie.mode=31,-4):(Yt-=Ze.avail_in,A-=Ze.avail_out,Ze.total_in+=Yt,Ze.total_out+=A,ie.total+=A,ie.wrap&&A&&(Ze.adler=ie.check=ie.flags?At(ie.check,je,A,Ze.next_out-A):vt(ie.check,je,A,Ze.next_out-A)),Ze.data_type=ie.bits+(ie.last?64:0)+(ie.mode===12?128:0)+(ie.mode===20||ie.mode===15?256:0),(Yt==0&&A===0||ye===4)&&j===0&&(j=-5),j)},_e.inflateEnd=function(Ze){if(!Ze||!Ze.state)return-2;var ye=Ze.state;return ye.window&&(ye.window=null),Ze.state=null,0},_e.inflateGetHeader=function(Ze,ye){var Ke;return Ze&&Ze.state&&2&(Ke=Ze.state).wrap?((Ke.head=ye).done=!1,0):-2},_e.inflateSetDictionary=function(Ze,ye){var Ke=ye.length,ke;return Ze&&Ze.state?(ke=Ze.state).wrap!==0&&ke.mode!==11?-2:ke.mode===11&&vt(1,ye,Ke,0)!==ke.check?-3:Ct(Ze,ye,Ke,Ke)?(ke.mode=31,-4):(ke.havedict=1,0):-2},_e.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(fe,be){var _e=fe("../utils/common"),Ie=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Te=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Be=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Ve=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];be.exports=function($e,tt,yt,Ct,ot,vt,At,Je){var it=Je.bits,Ue=0,ct=0,st=0,Ze=0,ye=0,Ke=0,ke=0,me=0,ie=0,ge=0,je=null,rt=0,Me=new _e.Buf16(16),ht=new _e.Buf16(16),Ht=null,_t=0,Fe,Yt,A,ue,G,E,_,g,b;for(Ue=0;15>=Ue;Ue++)Me[Ue]=0;for(ct=0;ct=Ue;Ue++)if(me<<=1,0>(me-=Me[Ue]))return-1;if(0Ue;Ue++)ht[Ue+1]=ht[Ue]+Me[Ue];for(ct=0;ctE?(g=Ht[_t+At[ct]],je[rt+At[ct]]):(g=96,0),Fe=1<>ke)+(Yt-=Fe)]=0|(_<<24|g<<16|b),Yt!==0;);for(Fe=1<>=1;if(Fe===0?ge=0:(ge&=Fe-1,ge+=Fe),ct++,--Me[Ue]==0){if(Ue===Ze)break;Ue=tt[yt+At[ct]]}if(ye=(me-=Me[Ke+ke]));)Ke++,me<<=1;if(ie+=1<E?ht[E]:ht[256+(E>>>7)]}function $e(E,_){E.pending_buf[E.pending++]=255&_,E.pending_buf[E.pending++]=255&_>>>8}function tt(E,_,g){E.bi_valid>16-g?(E.bi_buf|=65535&_<>16-E.bi_valid,E.bi_valid+=g-16):(E.bi_buf|=65535&_<>>=1,g<<=1,0<--_;);return g>>>1}function ot(E,_,g){var b=Array(16),C=0,O,F;for(O=1;O<=15;O++)b[O]=C=C+g[O-1]<<1;for(F=0;F<=_;F++){var N=E[2*F+1];N!==0&&(E[2*F]=Ct(b[N]++,N))}}function vt(E){var _;for(_=0;286>_;_++)E.dyn_ltree[2*_]=0;for(_=0;30>_;_++)E.dyn_dtree[2*_]=0;for(_=0;19>_;_++)E.bl_tree[2*_]=0;E.dyn_ltree[512]=1,E.opt_len=E.static_len=0,E.last_lit=E.matches=0}function At(E){8E.heap_len;)g[2*(W=E.heap[++E.heap_len]=2>F?++F:0)]=1,E.depth[W]=0,E.opt_len--,C&&(E.static_len-=b[2*W+1]);for(_.max_code=F,N=E.heap_len>>1;1<=N;N--)it(E,g,N);for(W=O;N=E.heap[1],E.heap[1]=E.heap[E.heap_len--],it(E,g,1),j=E.heap[1],E.heap[--E.heap_max]=N,E.heap[--E.heap_max]=j,g[2*W]=g[2*N]+g[2*j],E.depth[W]=(E.depth[N]>=E.depth[j]?E.depth[N]:E.depth[j])+1,g[2*N+1]=g[2*j+1]=W,E.heap[1]=W++,it(E,g,1),2<=E.heap_len;);E.heap[--E.heap_max]=E.heap[1],function(q,J){var ee=J.dyn_tree,he=J.max_code,Ee=J.stat_desc.static_tree,De=J.stat_desc.has_stree,pt=J.stat_desc.extra_bits,Et=J.stat_desc.extra_base,Ye=J.stat_desc.max_length,jt=0,ei,Xt,wi,pi,Ri,Ui;for(pi=0;pi<=15;pi++)q.bl_count[pi]=0;for(ee[2*q.heap[q.heap_max]+1]=0,ei=q.heap_max+1;573>ei;ei++)Ye<(pi=ee[2*ee[2*(Xt=q.heap[ei])+1]+1]+1)&&(pi=Ye,jt++),ee[2*Xt+1]=pi,he=O?E.bl_tree[34]++:E.bl_tree[36]++:(W!==b&&E.bl_tree[2*W]++,E.bl_tree[32]++),b=W,N=(O=0)===C?(F=138,3):W===C?(F=6,3):(F=7,4))}function Ze(E,_,g){var b=-1,C=_[1],O=0,F=7,N=4,j,W;for(C===0&&(F=138,N=3),j=0;j<=g;j++)if(W=C,C=_[2*(j+1)+1],!(++O=O?(yt(E,17,E.bl_tree),tt(E,O-3,3)):(yt(E,18,E.bl_tree),tt(E,O-11,7)):(W!==b&&(yt(E,W,E.bl_tree),O--),yt(E,16,E.bl_tree),tt(E,O-3,2));b=W,N=(O=0)===C?(F=138,3):W===C?(F=6,3):(F=7,4)}}function ye(E,_,g,b){var C,O,F;tt(E,0+(b?1:0),3),O=_,F=g,At(C=E),$e(C,F),$e(C,~F),Ke.arraySet(C.pending_buf,C.window,O,F,C.pending),C.pending+=F}var Ke=fe("../utils/common"),ke=15,me=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ie=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ge=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],je=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=Array(576);Ie(rt);var Me=Array(60);Ie(Me);var ht=Array(512);Ie(ht);var Ht=Array(256);Ie(Ht);var _t=Array(29);Ie(_t);var Fe=Array(30),Yt,A,ue;Ie(Fe);var G=!1;_e._tr_init=function(E){G||(function(){var _=Array(ke+1),g,b,C,O,F;for(O=C=0;28>O;O++)for(_t[O]=C,g=0;g<1<O;O++)for(Fe[O]=F,g=0;g<1<>=7;30>O;O++)for(Fe[O]=F<<7,g=0;g<1<=g;)rt[2*g+1]=8,g++,_[8]++;for(;255>=g;)rt[2*g+1]=9,g++,_[9]++;for(;279>=g;)rt[2*g+1]=7,g++,_[7]++;for(;287>=g;)rt[2*g+1]=8,g++,_[8]++;for(ot(rt,287,_),g=0;30>g;g++)Me[2*g+1]=5,Me[2*g]=Ct(g,5);Yt=new Te(rt,me,257,286,ke),A=new Te(Me,ie,0,30,ke),ue=new Te([],ge,0,19,7)}(),G=!0),E.l_desc=new Be(E.dyn_ltree,Yt),E.d_desc=new Be(E.dyn_dtree,A),E.bl_desc=new Be(E.bl_tree,ue),E.bi_buf=0,E.bi_valid=0,vt(E)},_e._tr_stored_block=ye,_e._tr_flush_block=function(E,_,g,b){var C=0,O,F;0=W;W++,j>>>=1)if(1&j&&N.dyn_ltree[2*W]!==0)return 0;if(N.dyn_ltree[18]!==0||N.dyn_ltree[20]!==0||N.dyn_ltree[26]!==0)return 1;for(W=32;256>W;W++)if(N.dyn_ltree[2*W]!==0)return 1;return 0}(E)),ct(E,E.l_desc),ct(E,E.d_desc),C=function(N){var j;for(st(N,N.dyn_ltree,N.l_desc.max_code),st(N,N.dyn_dtree,N.d_desc.max_code),ct(N,N.bl_desc),j=18;3<=j&&N.bl_tree[2*je[j]+1]===0;j--);return N.opt_len+=3*(j+1)+5+5+4,j}(E),O=E.opt_len+3+7>>>3,(F=E.static_len+3+7>>>3)<=O&&(O=F)):O=F=g+5,g+4<=O&&_!==-1?ye(E,_,g,b):E.strategy===4||F===O?(tt(E,2+(b?1:0),3),Ue(E,rt,Me)):(tt(E,4+(b?1:0),3),function(N,j,W,q){var J;for(tt(N,j-257,5),tt(N,W-1,5),tt(N,q-4,4),J=0;J>>8,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&_,E.pending_buf[E.l_buf+E.last_lit]=255&g,E.last_lit++,_===0?E.dyn_ltree[2*g]++:(E.matches++,_--,E.dyn_ltree[2*(Ht[g]+256+1)]++,E.dyn_dtree[2*Ve(_)]++),E.last_lit===E.lit_bufsize-1},_e._tr_align=function(E){var _;tt(E,2,3),yt(E,256,rt),(_=E).bi_valid===16?($e(_,_.bi_buf),_.bi_buf=0,_.bi_valid=0):8<=_.bi_valid&&(_.pending_buf[_.pending++]=255&_.bi_buf,_.bi_buf>>=8,_.bi_valid-=8)}},{"../utils/common":41}],53:[function(fe,be){be.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(fe,be){be.exports=typeof m=="function"?m:function(){var _e=[].slice.apply(arguments);_e.splice(1,0,0),setTimeout.apply(null,_e)}},{}]},{},[10])(10)})}).call(this,de===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:de)},{}]},{},[1])(1)})}).call(this,K===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:K)},{}]},{},[1])(1)})}).call(this,B===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:B)},{}]},{},[1])(1)})}).call(this,I===void 0?typeof self>"u"?typeof window>"u"?{}:window:self:I)},{}]},{},[1])(1)})}).call(this,typeof h>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:h)},{}]},{},[1])(1)})}).call(this)}).call(this,typeof Hh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh,l("buffer").Buffer,l("timers").setImmediate)},{buffer:8,timers:22}],12:[function(l,u){function c(){}function h($){if(typeof $!="function")throw new TypeError("resolver must be a function");this.state=B,this.queue=[],this.outcome=void 0,$!==c&&w(this,$)}function p($,V,Y){this.promise=$,typeof V=="function"&&(this.onFulfilled=V,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}function m($,V,Y){I(function(){var K;try{K=V(Y)}catch(Q){return R.reject($,Q)}K===$?R.reject($,new TypeError("Cannot resolve promise with itself")):R.resolve($,K)})}function v($){var V=$&&$.then;if($&&(typeof $=="object"||typeof $=="function")&&typeof V=="function")return function(){V.apply($,arguments)}}function w($,V){function Y(ne){Q||(Q=!0,R.reject($,ne))}function K(ne){Q||(Q=!0,R.resolve($,ne))}var Q=!1,re=S(function(){V(K,Y)});re.status==="error"&&Y(re.value)}function S($,V){var Y={};try{Y.value=$(V),Y.status="success"}catch(K){Y.status="error",Y.value=K}return Y}var I=l("immediate"),R={},L=["REJECTED"],k=["FULFILLED"],B=["PENDING"];u.exports=h,h.prototype.finally=function($){if(typeof $!="function")return this;var V=this.constructor;return this.then(function(Y){return V.resolve($()).then(function(){return Y})},function(Y){return V.resolve($()).then(function(){throw Y})})},h.prototype.catch=function($){return this.then(null,$)},h.prototype.then=function($,V){if(typeof $!="function"&&this.state===k||typeof V!="function"&&this.state===L)return this;var Y=new this.constructor(c);if(this.state!==B){var K=this.state===k?$:V;m(Y,K,this.outcome)}else this.queue.push(new p(Y,$,V));return Y},p.prototype.callFulfilled=function($){R.resolve(this.promise,$)},p.prototype.otherCallFulfilled=function($){m(this.promise,this.onFulfilled,$)},p.prototype.callRejected=function($){R.reject(this.promise,$)},p.prototype.otherCallRejected=function($){m(this.promise,this.onRejected,$)},R.resolve=function($,V){var Y=S(v,V);if(Y.status==="error")return R.reject($,Y.value);var K=Y.value;if(K)w($,K);else{$.state=k,$.outcome=V;for(var Q=-1,re=$.queue.length;++Q=this._max)&&(this._max=1/0),this._lengthCalculator=$.length||h,typeof this._lengthCalculator!="function"&&(this._lengthCalculator=h),this._allowStale=$.stale||!1,this._maxAge=$.maxAge||null,this._dispose=$.dispose,void this.reset()):new m($)}function v($,V,Y){p(V);var K=$._cache[V];return K&&(w($,K)?(L($,K),!$._allowStale&&(K=void 0)):Y&&S($,K),K&&(K=K.value)),K}function w($,V){if(!V||!V.maxAge&&!$._maxAge)return!1;var Y=!1,K=Date.now()-V.now;return Y=V.maxAge?K>V.maxAge:$._maxAge&&K>$._maxAge,Y}function S($,V){R($,V),V.lu=$._mru++,$._lruList[V.lu]=V}function I($){for(;$._lru<$._mru&&$._length>$._max;)L($,$._lruList[$._lru])}function R($,V){for(delete $._lruList[V.lu];$._lru<$._mru&&!$._lruList[$._lru];)$._lru++}function L($,V){V&&($._dispose&&$._dispose(V.key,V.value),$._length-=V.length,$._itemCount--,delete $._cache[V.key],R($,V))}function k($,V,Y,K,Q,re){this.key=$,this.value=V,this.lu=Y,this.length=K,this.now=Q,re&&(this.maxAge=re)}typeof u=="object"&&u.exports?u.exports=m:this.LRUCache=m;var B=!1;Object.defineProperty(m.prototype,"max",{set:function($){$&&typeof $=="number"&&!(0>=$)||($=1/0),this._max=$,this._length>this._max&&I(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(m.prototype,"lengthCalculator",{set:function($){if(typeof $!="function")for(var V in this._lengthCalculator=h,this._length=this._itemCount,this._cache)this._cache[V].length=1;else for(var V in this._lengthCalculator=$,this._length=0,this._cache)this._cache[V].length=this._lengthCalculator(this._cache[V].value),this._length+=this._cache[V].length;this._length>this._max&&I(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(m.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(m.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),m.prototype.forEach=function($,V){V=V||this;for(var Y=0,K=this._itemCount,Q=this._mru-1;0<=Q&&Ythis._max?(L(this,this._cache[$]),!1):(this._dispose&&this._dispose($,this._cache[$].value),this._cache[$].now=K,this._cache[$].maxAge=Y,this._cache[$].value=V,this._length+=Q-this._cache[$].length,this._cache[$].length=Q,this.get($),this._length>this._max&&I(this),!0);var re=new k($,V,this._mru++,Q,K,Y);return re.length>this._max?(this._dispose&&this._dispose($,V),!1):(this._length+=re.length,this._lruList[re.lu]=this._cache[$]=re,this._itemCount++,this._length>this._max&&I(this),!0)},m.prototype.has=function($){if(p($),!c(this._cache,$))return!1;var V=this._cache[$];return!w(this,V)},m.prototype.get=function($){return p($),v(this,$,!0)},m.prototype.peek=function($){return p($),v(this,$,!1)},m.prototype.pop=function(){var $=this._lruList[this._lru];return L(this,$),$||null},m.prototype.del=function($){p($),L(this,this._cache[$])},m.prototype.load=function($){this.reset();for(var V=Date.now(),Y=$.length-1,K;0<=Y;Y--){K=$[Y],p(K.k);var Q=K.e||0;if(Q===0)this.set(K.k,K.v);else{var re=Q-V;0-1.001*z)nt=-z;else if(nt>z&&nt<1.001*z)nt=z;else{if(nt<-z)return{x:-1/0,y:-1/0,z:te.z};if(nt>z)return{x:1/0,y:1/0,z:te.z}}return lt>S&&(lt-=2*S),Ut=k(nt),xi=B(nt),Jt=Ut*Ut,Nt=Ae/$(1-xe*Jt),{x:(Nt+It)*xi*B(lt),y:(Nt+It)*xi*k(lt),z:(Nt*(1-xe)+It)*Ut}}function ge(te,xe,Ae,lt){var nt=1e-12,It=te.x,Nt=te.y,Ut=te.z?te.z:0,Jt,xi,Di,ki,ir,$r,mn,Kr,xn,Gn,Ds,Fn,yo,or,Ce,ze;if(Jt=$(It*It+Nt*Nt),xi=$(It*It+Nt*Nt+Ut*Ut),!(Jt/Aent*nt&&yo<30);return Ce=I(Ds/n(Gn)),{x:or,y:Ce,z:ze}}function je(te,xe,Ae){if(xe===1)return{x:te.x+Ae[0],y:te.y+Ae[1],z:te.z+Ae[2]};if(xe===2){var lt=Ae[0],nt=Ae[1],It=Ae[2],Nt=Ae[3],Ut=Ae[4],Jt=Ae[5],xi=Ae[6];return{x:xi*(te.x-Jt*te.y+Ut*te.z)+lt,y:xi*(Jt*te.x+te.y-Nt*te.z)+nt,z:xi*(-Ut*te.x+Nt*te.y+te.z)+It}}}function rt(te,xe,Ae){if(xe===1)return{x:te.x-Ae[0],y:te.y-Ae[1],z:te.z-Ae[2]};if(xe===2){var lt=Ae[0],nt=Ae[1],It=Ae[2],Nt=Ae[3],Ut=Ae[4],Jt=Ae[5],xi=Ae[6],Di=(te.x-lt)/xi,ki=(te.y-nt)/xi,ir=(te.z-It)/xi;return{x:Di+Jt*ki-Ut*ir,y:-Jt*Di+ki+Nt*ir,z:Ut*Di-Nt*ki+ir}}}function Me(te){return te===1||te===2}function ht(te,xe,Ae){if(te.grids===null||te.grids.length===0)return console.log("Grid shift grids not found"),-1;for(var lt={x:-Ae.x,y:Ae.y},nt={x:m,y:m},It=[],Nt=0,Ut;Ntlt.y||Di>lt.x||$rUt&&n(Jt.y)>Ut);if(0>Nt)return console.log("Inverse grid shift iterator failed to converge."),lt;lt.x=fn(It.x+Ae.ll[0]),lt.y=It.y+Ae.ll[1]}else isNaN(It.x)||(lt.x=te.x+It.x,lt.y=te.y+It.y);return lt}function _t(te,xe){var Ae={x:te.x/xe.del[0],y:te.y/xe.del[1]},lt={x:t(Ae.x),y:t(Ae.y)},nt={x:Ae.x-1*lt.x,y:Ae.y-1*lt.y},It={x:m,y:m},Nt;if(0>lt.x||lt.x>=xe.lim[0]||0>lt.y||lt.y>=xe.lim[1])return It;Nt=lt.y*xe.lim[0]+lt.x;var Ut={x:xe.cvs[Nt][0],y:xe.cvs[Nt][1]};Nt++;var Jt={x:xe.cvs[Nt][0],y:xe.cvs[Nt][1]};Nt+=xe.lim[0];var xi={x:xe.cvs[Nt][0],y:xe.cvs[Nt][1]};Nt--;var Di={x:xe.cvs[Nt][0],y:xe.cvs[Nt][1]},ki=nt.x*nt.y,ir=nt.x*(1-nt.y),$r=(1-nt.x)*(1-nt.y),mn=(1-nt.x)*nt.y;return It.x=$r*Ut.x+ir*Jt.x+mn*Di.x+ki*xi.x,It.y=$r*Ut.y+ir*Jt.y+mn*Di.y+ki*xi.y,It}function Fe(te){var xe=Number.isFinite;if(typeof xe=="function"){if(xe(te))return;throw new TypeError("coordinates must be finite numbers")}if(typeof te!="number"||te!==te||!isFinite(te))throw new TypeError("coordinates must be finite numbers")}function Yt(te,xe){return(te.datum.datum_type===1||te.datum.datum_type===2)&&xe.datumCode!=="WGS84"||(xe.datum.datum_type===1||xe.datum.datum_type===2)&&te.datumCode!=="WGS84"}function A(te,xe,Ae){var lt;if(Array.isArray(Ae)&&(Ae=kt(Ae)),Xe(Ae),te.datum&&xe.datum&&Yt(te,xe)&&(lt=new ke("WGS84"),Ae=A(te,lt,Ae),te=lt),te.axis!=="enu"&&(Ae=Oi(te,!1,Ae)),te.projName==="longlat")Ae={x:Ae.x*Mn,y:Ae.y*Mn,z:Ae.z||0};else if(te.to_meter&&(Ae={x:Ae.x*te.to_meter,y:Ae.y*te.to_meter,z:Ae.z||0}),Ae=te.inverse(Ae),!Ae)return;return te.from_greenwich&&(Ae.x+=te.from_greenwich),Ae=Hi(te.datum,xe.datum,Ae),!Ae?void 0:(xe.from_greenwich&&(Ae={x:Ae.x-xe.from_greenwich,y:Ae.y,z:Ae.z||0}),xe.projName==="longlat"?Ae={x:Ae.x*yn,y:Ae.y*yn,z:Ae.z||0}:(Ae=xe.forward(Ae),xe.to_meter&&(Ae={x:Ae.x/xe.to_meter,y:Ae.y/xe.to_meter,z:Ae.z||0})),xe.axis==="enu"?Ae:Oi(xe,!0,Ae))}function ue(te,xe,Ae){var lt,nt,It;return Array.isArray(Ae)?(lt=A(te,xe,Ae)||{x:NaN,y:NaN},2"u"?(xe=te,te=Le,lt=!0):(typeof xe.x<"u"||Array.isArray(xe))&&(Ae=xe,xe=te,te=Le,lt=!0),xe=G(xe),Ae?ue(te,xe,Ae):(nt={forward:function(It){return ue(te,xe,It)},inverse:function(It){return ue(xe,te,It)}},lt&&(nt.oProj=xe),nt)}function _(te,xe){return xe=xe||5,j(O({lat:te[1],lon:te[0]}),xe)}function g(te){var xe=F(ee(te.toUpperCase()));return xe.lat&&xe.lon?[xe.lon,xe.lat]:[(xe.left+xe.right)/2,(xe.top+xe.bottom)/2]}function b(te){return te*(S/180)}function C(te){return 180*(te/S)}function O(te){var xe=te.lat,Ae=te.lon,lt=6378137,nt=.00669438,It=.9996,Nt=b(xe),Ut,Jt,xi,Di,ki,ir;ir=t((Ae+180)/6)+1,Ae===180&&(ir=60),56<=xe&&64>xe&&3<=Ae&&12>Ae&&(ir=32),72<=xe&&84>xe&&(0<=Ae&&9>Ae?ir=31:9<=Ae&&21>Ae?ir=33:21<=Ae&&33>Ae?ir=35:33<=Ae&&42>Ae&&(ir=37)),Ut=nt/(1-nt),Jt=lt/$(1-nt*k(Nt)*k(Nt)),xi=L(Nt)*L(Nt),Di=Ut*B(Nt)*B(Nt),ki=lt*((1-nt/4-3*nt*nt/64-5*nt*nt*nt/256)*Nt-(3*nt/8+3*nt*nt/32+45*nt*nt*nt/1024)*k(2*Nt)+(15*nt*nt/256+45*nt*nt*nt/1024)*k(4*Nt)-35*nt*nt*nt/3072*k(6*Nt));var $r=It*Jt*(65+65*(65*(65*(1-xi+Di)))/6+65*(65*(65*(65*(65*(5-18*xi+xi*xi+72*Di-58*Ut)))))/120)+5e5,mn=It*(ki+Jt*L(Nt)*(4225/2+65*(65*(65*(65*(5-xi+9*Di+4*Di*Di))))/24+65*(65*(65*(65*(65*(65*(61-58*xi+xi*xi+600*Di-330*Ut))))))/720));return 0>xe&&(mn+=1e7),{northing:w(mn),easting:w($r),zoneNumber:ir,zoneLetter:N(xe)}}function F(te){var xe=te.northing,Ae=te.easting,lt=te.zoneLetter,nt=te.zoneNumber;if(0>nt||60lt&&(xi-=1e7),Gn=6*(nt-1)-180+3,Di=Ut/(1-Ut),xn=xi/It,Ds=xn/(Nt*(1-Ut/4-3*Ut*Ut/64-5*Ut*Ut*Ut/256)),Fn=Ds+(3*Jt/2-27*Jt*Jt*Jt/32)*k(2*Ds)+(21*Jt*Jt/16-55*Jt*Jt*Jt*Jt/32)*k(4*Ds)+151*Jt*Jt*Jt/96*k(6*Ds),ki=Nt/$(1-Ut*k(Fn)*k(Fn)),ir=L(Fn)*L(Fn),$r=Di*B(Fn)*B(Fn),mn=Nt*(1-Ut)/s(1-Ut*k(Fn)*k(Fn),1.5),Kr=(Ae-5e5)/(ki*It);var yo=Fn-ki*L(Fn)/mn*(Kr*Kr/2-(5+3*ir+10*$r-4*$r*$r-9*Di)*Kr*Kr*Kr*Kr/24+(61+90*ir+298*$r+45*ir*ir-252*Di-3*$r*$r)*Kr*Kr*Kr*Kr*Kr*Kr/720);yo=C(yo);var or=(Kr-(1+2*ir+$r)*Kr*Kr*Kr/6+(5-2*$r+28*ir-3*$r*$r+8*Di+24*ir*ir)*Kr*Kr*Kr*Kr*Kr/120)/B(Fn);or=Gn+C(or);var Ce;if(te.accuracy){var ze=F({northing:te.northing+te.accuracy,easting:te.easting+te.accuracy,zoneLetter:te.zoneLetter,zoneNumber:te.zoneNumber});Ce={top:ze.lat,right:ze.lon,bottom:yo,left:or}}else Ce={lat:yo,lon:or};return Ce}function N(te){var xe="Z";return 84>=te&&72<=te?xe="X":72>te&&64<=te?xe="W":64>te&&56<=te?xe="V":56>te&&48<=te?xe="U":48>te&&40<=te?xe="T":40>te&&32<=te?xe="S":32>te&&24<=te?xe="R":24>te&&16<=te?xe="Q":16>te&&8<=te?xe="P":8>te&&0<=te?xe="N":0>te&&-8<=te?xe="M":-8>te&&-16<=te?xe="L":-16>te&&-24<=te?xe="K":-24>te&&-32<=te?xe="J":-32>te&&-40<=te?xe="H":-40>te&&-48<=te?xe="G":-48>te&&-56<=te?xe="F":-56>te&&-64<=te?xe="E":-64>te&&-72<=te?xe="D":-72>te&&-80<=te&&(xe="C"),xe}function j(te,xe){var Ae="00000"+te.easting,lt="00000"+te.northing;return te.zoneNumber+te.zoneLetter+W(te.easting,te.northing,te.zoneNumber)+Ae.substr(Ae.length-5,xe)+lt.substr(lt.length-5,xe)}function W(te,xe,Ae){var lt=q(Ae),nt=t(te/1e5),It=t(xe/1e5)%20;return J(nt,It,lt)}function q(te){var xe=te%6;return xe===0&&(xe=6),xe}function J(te,xe,Ae){var lt=Ae-1,nt="AJSAJS".charCodeAt(lt),It="AFAFAF".charCodeAt(lt),Nt=nt+te-1,Ut=It+xe,Jt=!1;90nt&&73nt)&&Jt)&&Nt++,(Nt===79||79>nt&&79nt)&&Jt)&&(Nt++,Nt===73&&Nt++),90It&&73It)&&Jt)&&Ut++,(Ut===79||79>It&&79It)&&Jt)&&(Ut++,Ut===73&&Ut++),86xe)throw"MGRSPoint bad conversion from: "+te;var Ut=te.charAt(nt++);if("A">=Ut||Ut==="B"||Ut==="Y"||"Z"<=Ut||Ut==="I"||Ut==="O")throw"MGRSPoint zone letter "+Ut+" not handled: "+te;Ae=te.substring(nt,nt+=2);for(var Jt=q(Nt),xi=he(Ae.charAt(0),Jt),Di=Ee(Ae.charAt(1),Jt);Di"u"){var lt=te.split(",");this.x=parseFloat(lt[0],10),this.y=parseFloat(lt[1],10),this.z=parseFloat(lt[2],10)||0}else this.x=te,this.y=xe,this.z=Ae||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function Et(te){var xe=typeof te.PROJECTION=="object"?Object.keys(te.PROJECTION)[0]:te.PROJECTION;return"no_uoff"in te||"no_off"in te||["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(xe)!==-1}function Ye(){var te=Math.pi,xe=0,Ae=0,lt=0,nt=0,It=0,Nt=0,Ut=0,Jt,xi,Di,ki,ir,$r,mn,Kr,xn,Gn,Ds;this.no_off=Et(this),this.no_rot="no_rot"in this;var Fn=!1;"alpha"in this&&(Fn=!0);var yo=!1;if("rectified_grid_angle"in this&&(yo=!0),Fn&&(Ut=this.alpha),yo&&(xe=this.rectified_grid_angle*Mn),Fn||yo)Ae=this.longc;else if(lt=this.long1,It=this.lat1,nt=this.long2,Nt=this.lat2,n(It-Nt)<=$n||(Jt=n(It))<=$n||n(Jt-z)<=$n||n(n(this.lat0)-z)<=$n||n(n(Nt)-z)<=$n)throw new Error;var or=1-this.es;xi=$(or),n(this.lat0)>Dt?(Kr=k(this.lat0),Di=B(this.lat0),Jt=1-this.es*Kr*Kr,this.B=Di*Di,this.B=$(1+this.es*this.B*this.B/or),this.A=this.B*this.k0*xi/Jt,ki=this.B*xi/(Di*$(Jt)),ir=ki*ki-1,0>=ir?ir=0:(ir=$(ir),0>this.lat0&&(ir=-ir)),this.E=ir+=ki,this.E*=s(qr(this.e,this.lat0,Kr),this.B)):(this.B=1/xi,this.A=this.k0,this.E=ki=ir=1),Fn||yo?(Fn?(Ds=h(k(Ut)/ki),!yo&&(xe=Ut)):(Ds=xe,Ut=h(ki*k(Ds))),this.lam0=Ae-h(.5*(ir-1/ir)*L(Ds))/this.B):($r=s(qr(this.e,It,k(It)),this.B),mn=s(qr(this.e,Nt,k(Nt)),this.B),ir=this.E/$r,xn=(mn-$r)/(mn+$r),Gn=this.E*this.E,Gn=(Gn-mn*$r)/(Gn+mn*$r),Jt=lt-nt,Jt<-te?nt-=Un:Jt>te&&(nt+=Un),this.lam0=fn(.5*(lt+nt)-I(Gn*L(.5*this.B*(lt-nt))/xn)/this.B),Ds=I(2*k(this.B*fn(lt-this.lam0))/(ir-1/ir)),xe=Ut=h(ki*k(Ds))),this.singam=k(Ds),this.cosgam=B(Ds),this.sinrot=k(xe),this.cosrot=B(xe),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=n(this.ArB*I($(ki*ki-1)/B(Ut))),0>this.lat0&&(this.u_0=-this.u_0)),ir=.5*Ds,this.v_pole_n=this.ArB*r(L(Pt-ir)),this.v_pole_s=this.ArB*r(L(Pt+ir))}function jt(te){var xe=[],Ae;return xe[0]=te*kh,Ae=te*te,xe[0]+=Ae*Qv,xe[1]=Ae*I0,Ae*=te,xe[0]+=Ae*_y,xe[1]+=Ae*e1,xe[2]=Ae*Nl,xe}function ei(te,xe){var Ae=te+te;return te+xe[0]*k(Ae)+xe[1]*k(Ae+Ae)+xe[2]*k(Ae+Ae+Ae)}function Xt(te,xe,Ae,lt){var nt;return tePt&&nt<=z+Pt?(lt.value=Qa.AREA_1,nt-=z):nt>z+Pt||nt<=-(z+Pt)?(lt.value=Qa.AREA_2,nt=0<=nt?nt-Qi:nt+Qi):(lt.value=Qa.AREA_3,nt+=z)),nt}function wi(te,xe){var Ae=te+xe;return Ae<-Qi?Ae+=Un:Ae>+Qi&&(Ae-=Un),Ae}function pi(te,xe,Ae,lt){for(var nt=xe,It;lt&&(It=te(nt),nt-=It,!(n(It)=this.text.length)return;te=this.text[this.place++]}switch(this.state){case ai:return this.neutral(te);case Al:return this.keyword(te);case Ma:return this.quoted(te);case _n:return this.afterquote(te);case eu:return this.number(te)}},Y.prototype.afterquote=function(te){if(te==='"')return this.word+='"',void(this.state=Ma);if(la.test(te))return this.word=this.word.trim(),void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in afterquote yet, index '+this.place)},Y.prototype.afterItem=function(te){return te===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=ai)):te==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ai,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=Ss))):void 0},Y.prototype.number=function(te){if(gi.test(te))return void(this.word+=te);if(la.test(te))return this.word=parseFloat(this.word),void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in number yet, index '+this.place)},Y.prototype.quoted=function(te){return te==='"'?void(this.state=_n):void(this.word+=te)},Y.prototype.keyword=function(te){if(/[A-Za-z84]/.test(te))return void(this.word+=te);if(te==="["){var xe=[];return xe.push(this.word),this.level++,this.root===null?this.root=xe:this.currentObject.push(xe),this.stack.push(this.currentObject),this.currentObject=xe,void(this.state=ai)}if(la.test(te))return void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in keyword yet, index '+this.place)},Y.prototype.neutral=function(te){if(/[A-Za-z]/.test(te))return this.word=te,void(this.state=Al);if(te==='"')return this.word="",void(this.state=Ma);if(gi.test(te))return this.word=te,void(this.state=eu);if(la.test(te))return void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in neutral yet, index '+this.place)},Y.prototype.output=function(){for(;this.placete?-1:1},fn=function(te){return n(te)<=Qi?te:te-gl(te)*Un},qr=function(te,xe,Ae){var lt=te*Ae;return lt=s((1-lt)/(1+lt),.5*te),L(.5*(z-xe))/lt},Gu=function(te,xe){for(var Ae=z-2*I(xe),lt=0,nt,It;15>=lt;lt++)if(nt=te*k(Ae),It=z-2*I(xe*s((1-nt)/(1+nt),.5*te))-Ae,Ae+=It,1e-10>=n(It))return Ae;return-9999},dc=[{init:Be,forward:function(te){var xe=te.x,Ae=te.y;if(90Ae*yn&&180xe*yn)return null;var lt,nt;if(n(n(Ae)-z)<=Dt)return null;if(this.sphere)lt=this.x0+this.a*this.k0*fn(xe-this.long0),nt=this.y0+this.a*this.k0*r(L(Pt+.5*Ae));else{var It=k(Ae),Nt=qr(this.e,Ae,It);lt=this.x0+this.a*this.k0*fn(xe-this.long0),nt=this.y0-this.a*this.k0*r(Nt)}return te.x=lt,te.y=nt,te},inverse:function(te){var xe=te.x-this.x0,Ae=te.y-this.y0,lt,nt;if(this.sphere)nt=z-2*I(R(-Ae/(this.a*this.k0)));else{var It=R(-Ae/(this.a*this.k0));if(nt=Gu(this.e,It),nt===-9999)return null}return lt=fn(this.long0+xe/(this.a*this.k0)),te.x=lt,te.y=nt,te},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Ve,inverse:Ve,names:["longlat","identity"]}],Re={},Ne=[],dt={};dt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},dt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},dt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},dt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},dt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},dt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},dt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},dt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},dt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},dt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},dt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},dt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},dt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},dt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},dt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},dt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},dt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},dt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},dt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},dt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},dt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},dt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},dt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},dt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},dt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},dt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},dt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},dt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},dt.hough={a:6378270,rf:297,ellipseName:"Hough"},dt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},dt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},dt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},dt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},dt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},dt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},dt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},dt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},dt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},dt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},dt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},dt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Gt=dt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};dt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ti={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},oi={};ke.projections={start:function(){dc.forEach($e)},add:$e,get:function(te){if(!te)return!1;var xe=te.toLowerCase();if(typeof Re[xe]<"u"&&Ne[Re[xe]])return Ne[Re[xe]]}},ke.projections.start();var Hi=function(te,xe,Ae){if(me(te,xe)||te.datum_type===Ui||xe.datum_type===Ui)return Ae;var lt=te.a,nt=te.es;if(te.datum_type===Ri){var It=ht(te,!1,Ae);if(It!==0)return;lt=Bi,nt=mi}var Nt=xe.a,Ut=xe.b,Jt=xe.es;if(xe.datum_type===Ri&&(Nt=Bi,Ut=6356752314e-3,Jt=mi),nt===Jt&<===Nt&&!Me(te.datum_type)&&!Me(xe.datum_type))return Ae;if(Ae=ie(Ae,nt,lt),Me(te.datum_type)&&(Ae=je(Ae,te.datum_type,te.datum_params)),Me(xe.datum_type)&&(Ae=rt(Ae,xe.datum_type,xe.datum_params)),Ae=ge(Ae,Jt,Nt,Ut),xe.datum_type===Ri){var xi=ht(xe,!0,Ae);if(xi!==0)return}return Ae},Oi=function(te,xe,Ae){var lt=Ae.x,nt=Ae.y,It=Ae.z||0,Nt={},Ut,Jt,xi;for(xi=0;3>xi;xi++)if(!(xe&&xi===2&&Ae.z===void 0))switch(xi===0?(Ut=lt,Jt="ew".indexOf(te.axis[xi])===-1?"y":"x"):xi===1?(Ut=nt,Jt="ns".indexOf(te.axis[xi])===-1?"x":"y"):(Ut=It,Jt="z"),te.axis[xi]){case"e":Nt[Jt]=Ut;break;case"w":Nt[Jt]=-Ut;break;case"n":Nt[Jt]=Ut;break;case"s":Nt[Jt]=-Ut;break;case"u":Ae[Jt]!==void 0&&(Nt.z=Ut);break;case"d":Ae[Jt]!==void 0&&(Nt.z=-Ut);break;default:return null}return Nt},kt=function(te){var xe={x:te[0],y:te[1]};return 2Dt?L(Ae):0,Kr=s(mn,2),xn=s(Kr,2);Nt=1-this.es*s(nt,2),Di/=$(Nt);var Gn=Fi(Ae,nt,It,this.en);Ut=this.a*(this.k0*Di*(1+ki/6*(1-Kr+ir+ki/20*(5-18*Kr+xn+14*ir-58*Kr*ir+ki/42*(61+179*xn-xn*Kr-479*Kr)))))+this.x0,Jt=this.a*(this.k0*(Gn-this.ml0+nt*lt*Di/2*(1+ki/12*(5-Kr+9*ir+4*$r+ki/30*(61+xn-58*Kr+270*ir-330*Kr*ir+ki/56*(1385+543*xn-xn*Kr-3111*Kr))))))+this.y0}else{var xi=It*k(lt);if(n(n(xi)-1)Dt)return 93;Jt=0}else Jt=p(Jt);0>Ae&&(Jt=-Jt),Jt=this.a*this.k0*(Jt-this.lat0)+this.y0}return te.x=Ut,te.y=Jt,te},inverse:function(te){var xe=(te.x-this.x0)*(1/this.a),Ae=(te.y-this.y0)*(1/this.a),lt,nt,It,Nt;if(this.es)if(lt=this.ml0+Ae/this.k0,nt=mr(lt,this.es,this.en),n(nt)Dt?L(nt):0,mn=this.ep2*s(ir,2),Kr=s(mn,2),xn=s($r,2),Gn=s(xn,2);lt=1-this.es*s(ki,2);var Ds=xe*$(lt)/this.k0,Fn=s(Ds,2);lt*=$r,It=nt-.5*(lt*Fn/(1-this.es))*(1-Fn/12*(5+3*xn-9*mn*xn+mn-4*Kr-Fn/30*(61+90*xn-252*mn*xn+45*Gn+46*mn-Fn/56*(1385+3633*xn+4095*Gn+1574*Gn*xn)))),Nt=fn(this.long0+Ds*(1-Fn/6*(1+2*xn+mn-Fn/20*(5+28*xn+24*Gn+8*mn*xn+6*mn-Fn/42*(61+662*xn+1320*Gn+720*Gn*xn))))/ir)}else It=z*gl(Ae),Nt=0;else{var Ut=R(xe/this.k0),Jt=.5*(Ut-1/Ut),xi=this.lat0+Ae/this.k0,Di=B(xi);lt=$((1-s(Di,2))/(1+s(Jt,2))),It=h(lt),0>Ae&&(It=-It),Nt=Jt===0&&Di===0?0:fn(v(Jt,Di)+this.long0)}return te.x=Nt,te.y=It,te},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Gr=function(te){var xe=R(te);return xe=(xe-1/xe)/2,xe},zr=function(te,xe){var Ae=Math.max;te=n(te),xe=n(xe);var lt=Ae(te,xe),nt=a(te,xe)/(lt||1);return lt*$(1+s(nt,2))},jn=function(te){var xe=1+te,Ae=xe-1;return Ae===0?te:te*r(xe)/Ae},co=function(te){var xe=n(te);return xe=jn(xe*(1+xe/(zr(1,xe)+1))),0>te?-xe:xe},ua=function(te,xe){for(var Ae=2*B(2*xe),lt=te.length-1,nt=te[lt],It=0,Nt;0<=--lt;)Nt=-It+Ae*nt+te[lt],It=nt,nt=Nt;return xe+Nt*k(2*xe)},Hs=function(te,xe){for(var Ae=2*B(xe),lt=te.length-1,nt=te[lt],It=0,Nt;0<=--lt;)Nt=-It+Ae*nt+te[lt],It=nt,nt=Nt;return k(xe)*Nt},Ll=function(te){var xe=R(te);return xe=(xe+1/xe)/2,xe},ft=function(te,xe,Ae){for(var lt=k(xe),nt=B(xe),It=Gr(Ae),Nt=Ll(Ae),Ut=2*nt*Nt,Jt=-2*lt*It,xi=te.length-1,Di=te[xi],ki=0,ir=0,$r=0,mn,Kr;0<=--xi;)mn=ir,Kr=ki,ir=Di,ki=$r,Di=-mn+Ut*ir-Jt*ki+te[xi],$r=-Kr+Jt*ir+Ut*ki;return Ut=lt*Nt,Jt=nt*It,[Ut*Di-Jt*$r,Ut*$r+Jt*Di]},Wt={init:function(){if(!this.approx&&(isNaN(this.es)||0>=this.es))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(yr.init.apply(this),this.forward=yr.forward,this.inverse=yr.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var te=this.es/(1+$(1-this.es)),xe=te/(2-te),Ae=xe;this.cgb[0]=xe*(2+xe*(-2/3+xe*(-2+xe*(116/45+xe*(26/45+xe*(-2854/675)))))),this.cbg[0]=xe*(-2+xe*(2/3+xe*(4/3+xe*(-82/45+xe*(32/45+xe*(4642/4725)))))),Ae*=xe,this.cgb[1]=Ae*(7/3+xe*(-8/5+xe*(-227/45+xe*(2704/315+xe*(2323/945))))),this.cbg[1]=Ae*(5/3+xe*(-16/15+xe*(-13/9+xe*(904/315+xe*(-1522/945))))),Ae*=xe,this.cgb[2]=Ae*(56/15+xe*(-136/35+xe*(-1262/105+xe*(73814/2835)))),this.cbg[2]=Ae*(-26/15+xe*(34/21+xe*(8/5+xe*(-12686/2835)))),Ae*=xe,this.cgb[3]=Ae*(4279/630+xe*(-332/35+xe*(-399572/14175))),this.cbg[3]=Ae*(1237/630+xe*(-12/5+xe*(-24832/14175))),Ae*=xe,this.cgb[4]=Ae*(4174/315+xe*(-144838/6237)),this.cbg[4]=Ae*(-734/315+xe*(109598/31185)),Ae*=xe,this.cgb[5]=Ae*(601676/22275),this.cbg[5]=Ae*(444337/155925),Ae=s(xe,2),this.Qn=this.k0/(1+xe)*(1+Ae*(1/4+Ae*(1/64+Ae/256))),this.utg[0]=xe*(-.5+xe*(2/3+xe*(-37/96+xe*(1/360+xe*(81/512+xe*(-96199/604800)))))),this.gtu[0]=xe*(.5+xe*(-2/3+xe*(5/16+xe*(41/180+xe*(-127/288+xe*(7891/37800)))))),this.utg[1]=Ae*(-1/48+xe*(-1/15+xe*(437/1440+xe*(-46/105+xe*(1118711/3870720))))),this.gtu[1]=Ae*(13/48+xe*(-3/5+xe*(557/1440+xe*(281/630+xe*(-1983433/1935360))))),Ae*=xe,this.utg[2]=Ae*(-17/480+xe*(37/840+xe*(209/4480+xe*(-5569/90720)))),this.gtu[2]=Ae*(61/240+xe*(-103/140+xe*(15061/26880+xe*(167603/181440)))),Ae*=xe,this.utg[3]=Ae*(-4397/161280+xe*(11/504+xe*(830251/7257600))),this.gtu[3]=Ae*(49561/161280+xe*(-179/168+xe*(6601661/7257600))),Ae*=xe,this.utg[4]=Ae*(-4583/161280+xe*(108847/3991680)),this.gtu[4]=Ae*(34729/80640+xe*(-3418889/1995840)),Ae*=xe,this.utg[5]=Ae*(-20648693/638668800),this.gtu[5]=Ae*(212378941/319334400);var lt=ua(this.cbg,this.lat0);this.Zb=-this.Qn*(lt+Hs(this.gtu,2*lt))},forward:function(te){var xe=fn(te.x-this.long0),Ae=te.y;Ae=ua(this.cbg,Ae);var lt=k(Ae),nt=B(Ae),It=k(xe),Nt=B(xe);Ae=v(lt,Nt*nt),xe=v(It*nt,zr(lt,nt*Nt)),xe=co(L(xe));var Ut=ft(this.gtu,2*Ae,2*xe);Ae+=Ut[0],xe+=Ut[1];var Jt,xi;return 2.623395162778>=n(xe)?(Jt=this.a*(this.Qn*xe)+this.x0,xi=this.a*(this.Qn*Ae+this.Zb)+this.y0):(Jt=1/0,xi=1/0),te.x=Jt,te.y=xi,te},inverse:function(te){var xe=(te.x-this.x0)*(1/this.a),Ae=(te.y-this.y0)*(1/this.a);Ae=(Ae-this.Zb)/this.Qn,xe/=this.Qn;var lt,nt;if(2.623395162778>=n(xe)){var It=ft(this.utg,2*Ae,2*xe);Ae+=It[0],xe+=It[1],xe=I(Gr(xe));var Nt=k(Ae),Ut=B(Ae),Jt=k(xe),xi=B(xe);Ae=v(Nt*xi,zr(Jt,xi*Ut)),xe=v(Jt,xi*Ut),lt=fn(xe+this.long0),nt=ua(this.cgb,Ae)}else lt=1/0,nt=1/0;return te.x=lt,te.y=nt,te},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},hi=function(te,xe){if(te===void 0){if(te=t(30*(fn(xe)+S)/S)+1,0>te)return 0;if(60Dt){if(It=this.E/s(qr(this.e,te.y,k(te.y)),this.B),Nt=1/It,Ae=.5*(It-Nt),lt=.5*(It+Nt),k(this.B*te.x),nt=(Ae*this.singam-86*this.cosgam)/lt,n(n(nt)-1)Jt?-z:z;else{if(xe.y=this.E/$((1+Jt)/(1-Jt)),xe.y=Gu(this.e,s(xe.y,1/this.B)),xe.y===1/0)throw new Error;xe.x=-this.rB*v(It*this.cosgam-Ut*this.singam,B(this.BrA*Ae))}return xe.x+=this.lam0,xe},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Sa={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(n(this.lat1+this.lat2)Dt?r(lt/Ut)/r(nt/Jt):xe,isNaN(this.ns)&&(this.ns=xe),this.f0=lt/(this.ns*s(nt,this.ns)),this.rh=this.a*this.f0*s(xi,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(te){var xe=te.x,Ae=te.y;n(2*n(Ae)-S)<=Dt&&(Ae=gl(Ae)*(z-2*Dt));var lt=n(n(Ae)-z),nt,It;if(lt>Dt)nt=qr(this.e,Ae,k(Ae)),It=this.a*this.f0*s(nt,this.ns);else{if(lt=Ae*this.ns,0>=lt)return null;It=0}var Nt=this.ns*fn(xe-this.long0);return te.x=this.k0*(It*k(Nt))+this.x0,te.y=this.k0*(this.rh-It*B(Nt))+this.y0,te},inverse:function(te){var xe=(te.x-this.x0)/this.k0,Ae=this.rh-(te.y-this.y0)/this.k0,lt,nt,It,Nt,Ut;0n(Jt-te.y)&&(xi=1),Jt=te.y,Di+=1;while(xi===0&&15>Di);return 15<=Di?null:te},names:["Krovak","krovak"]},go=function(te,xe,Ae,lt,nt){return te*nt-xe*k(2*nt)+Ae*k(4*nt)-lt*k(6*nt)},tu=function(te){return 1-.25*te*(1+te/16*(3+1.25*te))},Uu=function(te){return .375*te*(1+.25*te*(1+.46875*te))},pc=function(te){return .05859375*te*te*(1+.75*te)},Fh=function(te){return te*te*te*(35/3072)},Zr=function(te,xe,Ae){var lt=xe*Ae;return te/$(1-lt*lt)},Ps=function(te){return n(te)Ut;Ut++)if(Nt=(te-(xe*It-Ae*k(2*It)+lt*k(4*It)-nt*k(6*It)))/(xe-2*Ae*B(2*It)+4*lt*B(4*It)-6*nt*B(6*It)),It+=Nt,1e-10>=n(Nt))return It;return NaN},Ou={init:function(){this.sphere||(this.e0=tu(this.es),this.e1=Uu(this.es),this.e2=pc(this.es),this.e3=Fh(this.es),this.ml0=this.a*go(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(te){var xe=te.x,Ae=te.y,lt,nt;if(xe=fn(xe-this.long0),this.sphere)lt=this.a*h(B(Ae)*k(xe)),nt=this.a*(v(L(Ae),B(xe))-this.lat0);else{var It=k(Ae),Nt=B(Ae),Ut=Zr(this.a,this.e,It),Jt=L(Ae)*L(Ae),xi=xe*B(Ae),Di=xi*xi,ki=this.es*Nt*Nt/(1-this.es),ir=this.a*go(this.e0,this.e1,this.e2,this.e3,Ae);lt=Ut*xi*(1-Di*Jt*(1/6-(8-Jt+8*ki)*Di/120)),nt=ir-this.ml0+Ut*It/Nt*Di*(.5+(5-Jt+6*ki)*Di/24)}return te.x=lt+this.x0,te.y=nt+this.y0,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe=te.x/this.a,Ae=te.y/this.a,lt,nt;if(this.sphere){var It=Ae+this.lat0;lt=h(k(It)*B(xe)),nt=v(L(xe),B(It))}else{var Nt=this.ml0/this.a+Ae,Ut=ca(Nt,this.e0,this.e1,this.e2,this.e3);if(n(n(Ut)-z)<=Dt)return te.x=this.long0,te.y=z,0>Ae&&(te.y*=-1),te;var Jt=Zr(this.a,this.e,k(Ut)),xi=Jt*Jt*Jt/this.a/this.a*(1-this.es),Di=s(L(Ut),2),ki=xe*this.a/Jt,ir=ki*ki;lt=Ut-Jt*L(Ut)/xi*ki*ki*(.5-(1+3*Di)*ki*ki/24),nt=ki*(1-ir*(Di/3+(1+3*Di)*Di*ir/15))/B(Ut)}return te.x=fn(nt+this.long0),te.y=Ps(lt),te},names:["Cassini","Cassini_Soldner","cass"]},Za=function(te,xe){var Ae;return 1e-7this.lat0?this.S_POLE:this.N_POLE:n(te)Dt?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*$(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(te){var xe=te.x,Ae=te.y;this.sin_phi=k(Ae),this.cos_phi=B(Ae);var lt=Za(this.e3,this.sin_phi,this.cos_phi),nt=this.a*$(this.c-this.ns0*lt)/this.ns0,It=this.ns0*fn(xe-this.long0),Nt=nt*k(It)+this.x0,Ut=this.rh-nt*B(It)+this.y0;return te.x=Nt,te.y=Ut,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt;return te.x-=this.x0,te.y=this.rh-te.y+this.y0,0<=this.ns0?(xe=$(te.x*te.x+te.y*te.y),lt=1):(xe=-$(te.x*te.x+te.y*te.y),lt=-1),nt=0,xe!==0&&(nt=v(lt*te.x,lt*te.y)),lt=xe*this.ns0/this.a,this.sphere?Nt=h((this.c-lt*lt)/(2*this.ns0)):(Ae=(this.c-lt*lt)/this.ns0,Nt=this.phi1z(this.e3,Ae)),It=fn(nt/this.ns0+this.long0),te.x=It,te.y=Nt,te},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(te,xe){var Ae=Ml(.5*xe),lt,nt,It,Nt,Ut;if(te=Jt;Jt++)if(lt=k(Ae),nt=B(Ae),It=te*lt,Nt=1-It*It,Ut=.5*Nt*Nt/nt*(xe/(1-te*te)-lt/Nt+.5/te*r((1-It)/(1+It))),Ae+=Ut,1e-7>=n(Ut))return Ae;return null}},Xc={init:function(){this.sin_p14=k(this.lat0),this.cos_p14=B(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(te){var xe=te.x,Ae=te.y,lt,nt,It,Nt,Ut,Jt,xi,Di;return It=fn(xe-this.long0),lt=k(Ae),nt=B(Ae),Nt=B(It),Jt=this.sin_p14*lt+this.cos_p14*nt*Nt,Ut=1,0n(n(xe)-Ae))return 0>xe?-1*z:z;for(var lt=h(.5*xe),nt=0,It,Nt,Ut,Jt;30>nt;nt++)if(Nt=k(lt),Ut=B(lt),Jt=te*Nt,It=s(1-Jt*Jt,2)/(2*Ut)*(xe/(1-te*te)-Nt/(1-Jt*Jt)+.5/te*r((1-Jt)/(1+Jt))),lt+=It,1e-10>=n(It))return lt;return NaN},by={init:function(){this.sphere||(this.k0=na(this.e,k(this.lat_ts),B(this.lat_ts)))},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt,It;if(this.sphere)nt=this.x0+this.a*lt*B(this.lat_ts),It=this.y0+this.a*k(Ae)/B(this.lat_ts);else{var Nt=Za(this.e,k(Ae));nt=this.x0+this.a*this.k0*lt,It=this.y0+.5*(this.a*Nt)/this.k0}return te.x=nt,te.y=It,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe,Ae;return this.sphere?(xe=fn(this.long0+te.x/this.a/B(this.lat_ts)),Ae=h(te.y/this.a*B(this.lat_ts))):(Ae=Bm(this.e,2*te.y*this.k0/this.a),xe=fn(this.long0+te.x/(this.a*this.k0))),te.x=xe,te.y=Ae,te},names:["cea"]},A0={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=B(this.lat_ts)},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt=Ps(Ae-this.lat0);return te.x=this.x0+this.a*lt*this.rc,te.y=this.y0+this.a*nt,te},inverse:function(te){var xe=te.x,Ae=te.y;return te.x=fn(this.long0+(xe-this.x0)/(this.a*this.rc)),te.y=Ps(this.lat0+(Ae-this.y0)/this.a),te},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Nf={init:function(){this.temp=this.b/this.a,this.es=1-s(this.temp,2),this.e=$(this.es),this.e0=tu(this.es),this.e1=Uu(this.es),this.e2=pc(this.es),this.e3=Fh(this.es),this.ml0=this.a*go(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt,It,Nt;if(Nt=lt*k(Ae),this.sphere)n(Ae)<=Dt?(nt=this.a*lt,It=-1*this.a*this.lat0):(nt=this.a*k(Nt)/L(Ae),It=this.a*(Ps(Ae-this.lat0)+(1-B(Nt))/L(Ae)));else if(n(Ae)<=Dt)nt=this.a*lt,It=-1*this.ml0;else{var Ut=Zr(this.a,this.e,k(Ae))/L(Ae);nt=Ut*k(Nt),It=this.a*go(this.e0,this.e1,this.e2,this.e3,Ae)-this.ml0+Ut*(1-B(Nt))}return te.x=nt+this.x0,te.y=It+this.y0,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt,Ut,Jt,xi;if(lt=te.x-this.x0,nt=te.y-this.y0,this.sphere)if(n(nt+this.a*this.lat0)<=Dt)xe=fn(lt/this.a+this.long0),Ae=0;else{Nt=this.lat0+nt/this.a,Ut=lt*lt/this.a/this.a+Nt*Nt,Jt=Nt;var Di;for(It=20;It;--It)if(Di=L(Jt),xi=-1*(Nt*(Jt*Di+1)-Jt-.5*(Jt*Jt+Ut)*Di)/((Jt-Nt)/Di-1),Jt+=xi,n(xi)<=Dt){Ae=Jt;break}xe=fn(this.long0+h(lt*L(Jt)/this.a)/k(Ae))}else if(n(nt+this.ml0)<=Dt)Ae=0,xe=fn(this.long0+lt/this.a);else{Nt=(this.ml0+nt)/this.a,Ut=lt*lt/this.a/this.a+Nt*Nt,Jt=Nt;var ki,ir,$r,mn,Kr;for(It=20;It;--It)if(Kr=this.e*k(Jt),ki=$(1-Kr*Kr)*L(Jt),ir=this.a*go(this.e0,this.e1,this.e2,this.e3,Jt),$r=this.e0-2*this.e1*B(2*Jt)+4*this.e2*B(4*Jt)-6*this.e3*B(6*Jt),mn=ir/this.a,xi=(Nt*(ki*mn+1)-mn-.5*ki*(mn*mn+Ut))/(this.es*k(2*Jt)*(mn*mn+Ut-2*Nt*mn)/(4*ki)+(Nt-mn)*(ki*$r-2/k(2*Jt))-$r),Jt-=xi,n(xi)<=Dt){Ae=Jt;break}ki=$(1-this.es*s(k(Ae),2))*L(Ae),xe=fn(this.long0+h(lt*ki/this.a)/k(Ae))}return te.x=xe,te.y=Ae,te},names:["Polyconic","poly"]},Pg={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(te){var xe=te.x,Ae=te.y,lt=Ae-this.lat0,nt=xe-this.long0,It=1,Nt=0,Ut;for(Ut=1;10>=Ut;Ut++)It*=1e-5*(lt/ar),Nt+=this.A[Ut]*It;var Jt=Nt,xi=nt,Di=1,ki=0,ir=0,$r=0,mn,Kr;for(Ut=1;6>=Ut;Ut++)mn=Di*Jt-ki*xi,Kr=ki*Jt+Di*xi,Di=mn,ki=Kr,ir=ir+this.B_re[Ut]*Di-this.B_im[Ut]*ki,$r=$r+this.B_im[Ut]*Di+this.B_re[Ut]*ki;return te.x=$r*this.a+this.x0,te.y=ir*this.a+this.y0,te},inverse:function(te){var xe=te.x,Ae=te.y,lt=xe-this.x0,nt=Ae-this.y0,It=nt/this.a,Nt=lt/this.a,Ut=1,Jt=0,xi=0,Di=0,ki,ir,$r;for(ki=1;6>=ki;ki++)ir=Ut*It-Jt*Nt,$r=Jt*It+Ut*Nt,Ut=ir,Jt=$r,xi=xi+this.C_re[ki]*Ut-this.C_im[ki]*Jt,Di=Di+this.C_im[ki]*Ut+this.C_re[ki]*Jt;for(var mn=0;mn=ki;ki++)Fn=Kr*xi-xn*Di,yo=xn*xi+Kr*Di,Kr=Fn,xn=yo,Gn+=(ki-1)*(this.B_re[ki]*Kr-this.B_im[ki]*xn),Ds+=(ki-1)*(this.B_im[ki]*Kr+this.B_re[ki]*xn);Kr=1,xn=0;var or=this.B_re[1],Ce=this.B_im[1];for(ki=2;6>=ki;ki++)Fn=Kr*xi-xn*Di,yo=xn*xi+Kr*Di,Kr=Fn,xn=yo,or+=ki*(this.B_re[ki]*Kr-this.B_im[ki]*xn),Ce+=ki*(this.B_im[ki]*Kr+this.B_re[ki]*xn);var ze=or*or+Ce*Ce;xi=(Gn*or+Ds*Ce)/ze,Di=(Ds*or-Gn*Ce)/ze}var mt=xi,Ft=Di,ni=1,bi=0;for(ki=1;9>=ki;ki++)ni*=mt,bi+=this.D[ki]*ni;var Li=this.lat0+1e5*(bi*ar),Yi=this.long0+Ft;return te.x=Yi,te.y=Li,te},names:["New_Zealand_Map_Grid","nzmg"]},Kd={init:function(){},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt=this.x0+this.a*lt,It=this.y0+1.25*(this.a*r(L(S/4+Ae/2.5)));return te.x=nt,te.y=It,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe=fn(this.long0+te.x/this.a),Ae=2.5*(I(R(.8*te.y/this.a))-S/4);return te.x=xe,te.y=Ae,te},names:["Miller_Cylindrical","mill"]},$f={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=$((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=fi(this.es)},forward:function(te){var xe=te.x,Ae=te.y,lt,nt;if(xe=fn(xe-this.long0),this.sphere){if(!this.m)Ae=this.n===1?Ae:h(this.n*k(Ae));else for(var It=this.n*k(Ae),Nt=20,Ut;Nt&&(Ut=(this.m*Ae+k(Ae)-It)/(this.m+B(Ae)),Ae-=Ut,!(n(Ut)S&&(lt=S),Ae=(2*xe+k(2*xe))/S,1lt&&(mn=-mn),nt=this.x0+mn;var Kr=Jt+ki;return mn=S*this.R*(ir*Kr-Ut*$(($r+Jt)*(Jt+1)-Kr*Kr))/($r+Jt),It=0<=Ae?this.y0+mn:this.y0-mn,te.x=nt,te.y=It,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt,Ut,Jt,xi,Di,ki,ir,$r;return te.x-=this.x0,te.y-=this.y0,ki=S*this.R,lt=te.x/ki,nt=te.y/ki,It=lt*lt+nt*nt,Nt=-n(nt)*(1+It),Ut=Nt-2*nt*nt+lt*lt,Jt=-2*Nt+1+2*nt*nt+It*It,$r=nt*nt/Jt+(2*Ut*Ut*Ut/Jt/Jt/Jt-9*Nt*Ut/Jt/Jt)/27,xi=(Nt-Ut*Ut/3/Jt)/Jt,Di=2*$(-xi/3),ki=3*$r/xi/Di,12*z*this.a?void 0:(Ae=xe/this.a,lt=k(Ae),nt=B(Ae),It=this.long0,n(xe)<=Dt?Nt=this.lat0:(Nt=Ml(nt*this.sin_p12+te.y*lt*this.cos_p12/xe),Ut=n(this.lat0)-z,It=n(Ut)<=Dt?0<=this.lat0?fn(this.long0+v(te.x,-te.y)):fn(this.long0-v(-te.x,te.y)):fn(this.long0+v(te.x*lt,xe*this.cos_p12*nt-te.y*this.sin_p12*lt))),te.x=It,te.y=Nt,te)):(Jt=tu(this.es),xi=Uu(this.es),Di=pc(this.es),ki=Fh(this.es),n(this.sin_p12-1)<=Dt?(ir=this.a*go(Jt,xi,Di,ki,z),xe=$(te.x*te.x+te.y*te.y),$r=ir-xe,Nt=ca($r/this.a,Jt,xi,Di,ki),It=fn(this.long0+v(te.x,-1*te.y)),te.x=It,te.y=Nt,te):n(this.sin_p12+1)<=Dt?(ir=this.a*go(Jt,xi,Di,ki,z),xe=$(te.x*te.x+te.y*te.y),$r=xe-ir,Nt=ca($r/this.a,Jt,xi,Di,ki),It=fn(this.long0+v(te.x,te.y)),te.x=It,te.y=Nt,te):(xe=$(te.x*te.x+te.y*te.y),xn=v(te.x,te.y),mn=Zr(this.a,this.e,this.sin_p12),Gn=B(xn),Ds=this.e*this.cos_p12*Gn,Fn=-Ds*Ds/(1-this.es),yo=3*this.es*(1-Fn)*this.sin_p12*this.cos_p12*Gn/(1-this.es),or=xe/mn,Ce=or-Fn*(1+Fn)*s(or,3)/6-yo*(1+3*Fn)*s(or,4)/24,ze=1-Fn*Ce*Ce/2-or*Ce*Ce*Ce/6,Kr=h(this.sin_p12*B(Ce)+this.cos_p12*k(Ce)*Gn),It=fn(this.long0+h(k(xn)*k(Ce)/B(Kr))),mt=k(Kr),Nt=v((mt-this.es*ze*this.sin_p12)*L(Kr),mt*(1-this.es)),te.x=It,te.y=Nt,te))},names:["Azimuthal_Equidistant","aeqd"]},fc={init:function(){this.sin_p14=k(this.lat0),this.cos_p14=B(this.lat0)},forward:function(te){var xe=te.x,Ae=te.y,lt,nt,It,Nt,Ut,Jt,xi,Di;return It=fn(xe-this.long0),lt=k(Ae),nt=B(Ae),Nt=B(It),Jt=this.sin_p14*lt+this.cos_p14*nt*Nt,Ut=1,(0=z-Pt/2?rn.TOP:this.lat0<=-(z-Pt/2)?rn.BOTTOM:n(this.long0)<=Pt?rn.FRONT:n(this.long0)<=z+Pt?0=Pt&&nt<=z+Pt?(Ae.value=Qa.AREA_0,It=nt-z):nt>z+Pt||nt<=-(z+Pt)?(Ae.value=Qa.AREA_1,It=0-(z+Pt)&&nt<=-Pt?(Ae.value=Qa.AREA_2,It=nt+z):(Ae.value=Qa.AREA_3,It=nt);else if(this.face===rn.BOTTOM)Nt=z+lt,nt>=Pt&&nt<=z+Pt?(Ae.value=Qa.AREA_0,It=-nt+z):nt=-Pt?(Ae.value=Qa.AREA_1,It=-nt):nt<-Pt&&nt>=-(z+Pt)?(Ae.value=Qa.AREA_2,It=-nt-z):(Ae.value=Qa.AREA_3,It=0=n(te.y)?Ae.value=Qa.AREA_0:0<=te.y&&te.y>=n(te.x)?(Ae.value=Qa.AREA_1,lt-=z):0>te.x&&-te.x>=n(te.y)?(Ae.value=Qa.AREA_2,lt=0>lt?lt+Qi:lt-Qi):(Ae.value=Qa.AREA_3,lt+=z),ki=Qi/12*L(lt),Ut=k(ki)/(B(ki)-1/$(2)),Jt=I(Ut),It=B(lt),Nt=L(nt),xi=1-It*It*Nt*Nt*(1-B(I(1/B(Jt)))),-1>xi?xi=-1:1Jt?Jt+Qi:Jt-Qi:Ae.value===Qa.AREA_2?Jt-z:Jt;else if(this.face===rn.BOTTOM)Di=p(xi),xe.phi=Di-z,xe.lam=Ae.value===Qa.AREA_0?-Jt+z:Ae.value===Qa.AREA_1?-Jt:Ae.value===Qa.AREA_2?-Jt-z:0>Jt?-Jt-Qi:-Jt+Qi;else{var ir,$r,mn;ir=xi,ki=ir*ir,mn=1<=ki?0:$(1-ki)*k(Jt),ki+=mn*mn,$r=1<=ki?0:$(1-ki),Ae.value===Qa.AREA_1?(ki=$r,$r=-mn,mn=ki):Ae.value===Qa.AREA_2?($r=-$r,mn=-mn):Ae.value===Qa.AREA_3&&(ki=$r,$r=mn,mn=-ki),this.face===rn.RIGHT?(ki=ir,ir=-$r,$r=ki):this.face===rn.BACK?(ir=-ir,$r=-$r):this.face===rn.LEFT&&(ki=ir,ir=$r,$r=-ki),xe.phi=p(-mn)-z,xe.lam=v($r,ir),this.face===rn.RIGHT?xe.lam=wi(xe.lam,-z):this.face===rn.BACK?xe.lam=wi(xe.lam,-Qi):this.face===rn.LEFT&&(xe.lam=wi(xe.lam,+z))}if(this.es!==0){var Kr,xn,Gn;Kr=0>xe.phi?1:0,xn=L(xe.phi),Gn=this.b/$(xn*xn+this.one_minus_f_squared),xe.phi=I($(this.a*this.a-Gn*Gn)/(this.one_minus_f*Gn)),Kr&&(xe.phi=-xe.phi)}return xe.lam+=this.long0,te.x=xe.lam,te.y=xe.phi,te},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ve=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],oe=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ce=.8487,we=1.3523,He=yn/5,St=function(te,xe){return te[0]+xe*(te[1]+xe*(te[2]+xe*te[3]))},ut=function(te,xe){return te[1]+xe*(2*te[2]+3*xe*te[3])},Bt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(te){var xe=fn(te.x-this.long0),Ae=n(te.y),lt=t(Ae*He);0>lt?lt=0:18<=lt&&(lt=17),Ae=yn*(Ae-1/He*lt);var nt={x:St(ve[lt],Ae)*xe,y:St(oe[lt],Ae)};return 0>te.y&&(nt.y=-nt.y),nt.x=nt.x*this.a*ce+this.x0,nt.y=nt.y*this.a*we+this.y0,nt},inverse:function(te){var xe={x:(te.x-this.x0)/(this.a*ce),y:n(te.y-this.y0)/(this.a*we)};if(1<=xe.y)xe.x/=ve[18][0],xe.y=0>te.y?-z:z;else{var Ae=t(18*xe.y);for(0>Ae?Ae=0:18<=Ae&&(Ae=17);;)if(oe[Ae][0]>xe.y)--Ae;else if(oe[Ae+1][0]<=xe.y)++Ae;else break;var lt=oe[Ae],nt=5*(xe.y-lt[0])/(oe[Ae+1][0]-lt[0]);nt=pi(function(It){return(St(lt,It)-xe.y)/ut(lt,It)},nt,Dt,100),xe.x/=St(ve[Ae],nt),xe.y=(5*Ae+nt)*Mn,0>te.y&&(xe.y=-xe.y)}return xe.x=fn(xe.x+this.long0),xe},names:["Robinson","robin"]},Ge={init:function(){this.name="geocent"},forward:function(te){var xe=ie(te,this.es,this.a);return xe},inverse:function(te){var xe=ge(te,this.es,this.a,this.b);return xe},names:["Geocentric","geocentric","geocent","Geocent"]},et={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},zt={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},ii={init:function(){if(Object.keys(zt).forEach(function(Ae){if(typeof this[Ae]>"u")this[Ae]=zt[Ae].def;else{if(zt[Ae].num&&isNaN(this[Ae]))throw new Error("Invalid parameter value, must be numeric "+Ae+" = "+this[Ae]);zt[Ae].num&&(this[Ae]=parseFloat(this[Ae]))}zt[Ae].degrees&&(this[Ae]*=Mn)}.bind(this)),n(n(this.lat0)-z)this.lat0?et.S_POLE:et.N_POLE:n(this.lat0)=this.pn1||1e10 */var m=l("buffer"),v=m.Buffer;v.from&&v.alloc&&v.allocUnsafe&&v.allocUnsafeSlow?u.exports=m:(h(m,c),c.Buffer=p),p.prototype=Object.create(v.prototype),h(v,p),p.from=function(w,S,I){if(typeof w=="number")throw new TypeError("Argument must not be a number");return v(w,S,I)},p.alloc=function(w,S,I){if(typeof w!="number")throw new TypeError("Argument must be a number");var R=v(w);return S===void 0?R.fill(0):typeof I=="string"?R.fill(S,I):R.fill(S),R},p.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return v(w)},p.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m.SlowBuffer(w)}},{buffer:8}],19:[function(l,u,c){function h(Q){if(!Q)return"utf8";for(var re;;)switch(Q){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return Q;default:if(re)return;Q=(""+Q).toLowerCase(),re=!0}}function p(Q){var re=h(Q);if(typeof re!="string"&&(Y.isEncoding===K||!K(Q)))throw new Error("Unknown encoding: "+Q);return re||Q}function m(Q){this.encoding=p(Q);var re;switch(this.encoding){case"utf16le":this.text=R,this.end=L,re=4;break;case"utf8":this.fillLast=I,re=4;break;case"base64":this.text=k,this.end=B,re=3;break;default:return this.write=$,void(this.end=V)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(re)}function v(Q){return 127>=Q?0:Q>>5==6?2:Q>>4==14?3:Q>>3==30?4:Q>>6==2?-1:-2}function w(Q,re,ne){var de=re.length-1;if(de=de)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1],ne.slice(0,-1)}return ne}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Q[Q.length-1],Q.toString("utf16le",re,Q.length-1)}function L(Q){var re=Q&&Q.length?this.write(Q):"";if(this.lastNeed){var ne=this.lastTotal-this.lastNeed;return re+this.lastChar.toString("utf16le",0,ne)}return re}function k(Q,re){var ne=(Q.length-re)%3;return ne==0?Q.toString("base64",re):(this.lastNeed=3-ne,this.lastTotal=3,ne==1?this.lastChar[0]=Q[Q.length-1]:(this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1]),Q.toString("base64",re,Q.length-ne))}function B(Q){var re=Q&&Q.length?this.write(Q):"";return this.lastNeed?re+this.lastChar.toString("base64",0,3-this.lastNeed):re}function $(Q){return Q.toString(this.encoding)}function V(Q){return Q&&Q.length?this.write(Q):""}var Y=l("safe-buffer").Buffer,K=Y.isEncoding||function(Q){switch(Q=""+Q,Q&&Q.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=m,m.prototype.write=function(Q){if(Q.length===0)return"";var re,ne;if(this.lastNeed){if(re=this.fillLast(Q),re===void 0)return"";ne=this.lastNeed,this.lastNeed=0}else ne=0;return ne_t||57343<_t)Ht.push(_t);else if(56320<=_t&&57343>=_t)Ht.push(65533);else if(55296<=_t&&56319>=_t)if(ht===Me-1)Ht.push(65533);else{var Fe=rt.charCodeAt(ht+1);56320<=Fe&&57343>=Fe?(Ht.push(65536+((1023&_t)<<10)+(1023&Fe)),ht+=1):Ht.push(65533)}ht+=1}return Ht}function w(je){for(var rt="",Me=0,ht;Me=ht?rt+=o(ht):(ht-=65536,rt+=o((ht>>10)+55296,(1023&ht)+56320));return rt}function S(je){return 0<=je&&127>=je}function I(je){this.tokens=[].slice.call(je),this.tokens.reverse()}function R(je,rt){if(je)throw TypeError("Decoder error");return rt||65533}function L(je){throw TypeError("The code point "+je+" could not be encoded.")}function k(je){return je=(je+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ke,je)?Ke[je]:null}function B(je,rt){return rt&&rt[je]||null}function $(je,rt){var Me=rt.indexOf(je);return Me===-1?null:Me}function V(je){if(!("encoding-indexes"in c))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return c["encoding-indexes"][je]}function Y(je){if(39419je||1237575>6*ht)+Ht];0>6*(ht-1);_t.push(128|63&Fe),ht-=1}return _t}}function Z(je,rt){var Me=rt.fatal;this.handler=function(ht,Ht){if(Ht===-1)return-1;if(S(Ht))return Ht;var _t=je[Ht-128];return _t===null?R(Me):_t}}function ae(je,rt){rt.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(st(ht))return ht;var Ht=$(ht,je);return Ht===null&&L(ht),Ht+128}}function fe(je){var rt=je.fatal,Me=0,ht=0,Ht=0;this.handler=function(_t,Fe){if(Fe===-1&&Me===0&&ht===0&&Ht===0)return-1;Fe===-1&&(Me!==0||ht!==0||Ht!==0)&&(Me=0,ht=0,Ht=0,R(rt));var Yt;if(Ht!==0){Yt=null,h(Fe,48,57)&&(Yt=Y(10*(126*(10*(Me-129)+ht-48)+Ht-129)+Fe-48));var A=[ht,Ht,Fe];return Me=0,ht=0,Ht=0,Yt===null?(_t.prepend(A),R(rt)):Yt}if(ht!==0)return h(Fe,129,254)?(Ht=Fe,null):(_t.prepend([ht,Fe]),Me=0,ht=0,R(rt));if(Me!==0){if(h(Fe,48,57))return ht=Fe,null;var ue=Me,G=null;Me=0;var E=127>Fe?64:65;return(h(Fe,64,126)||h(Fe,128,254))&&(G=190*(ue-129)+(Fe-E)),Yt=G===null?null:B(G,V("gb18030")),Yt===null&&S(Fe)&&_t.prepend(Fe),Yt===null?R(rt):Yt}return S(Fe)?Fe:Fe===128?8364:h(Fe,129,254)?(Me=Fe,null):R(rt)}}function be(je,rt){je.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(st(ht))return ht;if(ht===58853)return L(ht);if(rt&&ht===8364)return 128;var Ht=$(ht,V("gb18030"));if(Ht!==null){var _t=ct(Ht/190)+129,Fe=Ht%190,Yt=63>Fe?64:65;return[_t,Fe+Yt]}if(rt)return L(ht);Ht=K(ht);var A=ct(Ht/10/126/10);Ht-=10*(126*(10*A));var ue=ct(Ht/10/126);Ht-=126*(10*ue);var G=ct(Ht/10),E=Ht-10*G;return[A+129,ue+48,G+129,E+48]}}function _e(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0;var Yt=127>Ht?64:98;switch((h(Ht,64,126)||h(Ht,161,254))&&(Fe=157*(_t-129)+(Ht-Yt)),Fe){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var A=Fe===null?null:B(Fe,V("big5"));return A===null&&S(Ht)&&ht.prepend(Ht),A===null?R(rt):A}return S(Ht)?Ht:h(Ht,129,254)?(Me=Ht,null):R(rt)}}function Ie(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;var ht=re(Me);if(ht===null)return L(Me);var Ht=ct(ht/157)+129;if(161>Ht)return L(Me);var _t=ht%157,Fe=63>_t?64:98;return[Ht,_t+Fe]}}function Te(je){var rt=je.fatal,Me=!1,ht=0;this.handler=function(Ht,_t){if(_t===-1&&ht!==0)return ht=0,R(rt);if(_t===-1&&ht===0)return-1;if(ht===142&&h(_t,161,223))return ht=0,65216+_t;if(ht===143&&h(_t,161,254))return Me=!0,ht=_t,null;if(ht!==0){var Fe=ht;ht=0;var Yt=null;return h(Fe,161,254)&&h(_t,161,254)&&(Yt=B(94*(Fe-161)+(_t-161),V(Me?"jis0212":"jis0208"))),Me=!1,h(_t,161,254)||Ht.prepend(_t),Yt===null?R(rt):Yt}return S(_t)?_t:_t===142||_t===143||h(_t,161,254)?(ht=_t,null):R(rt)}}function Be(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;if(Me===165)return 92;if(Me===8254)return 126;if(h(Me,65377,65439))return[142,Me-65377+161];Me===8722&&(Me=65293);var ht=$(Me,V("jis0208"));if(ht===null)return L(Me);var Ht=ct(ht/94)+161;return[Ht,ht%94+161]}}function Ve(je){var rt=je.fatal,Me={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},ht=Me.ASCII,Ht=Me.ASCII,_t=0,Fe=!1;this.handler=function(Yt,A){switch(ht){default:case Me.ASCII:return A===27?(ht=Me.EscapeStart,null):h(A,0,127)&&A!==14&&A!==15&&A!==27?(Fe=!1,A):A===-1?-1:(Fe=!1,R(rt));case Me.Roman:return A===27?(ht=Me.EscapeStart,null):A===92?(Fe=!1,165):A===126?(Fe=!1,8254):h(A,0,127)&&A!==14&&A!==15&&A!==27&&A!==92&&A!==126?(Fe=!1,A):A===-1?-1:(Fe=!1,R(rt));case Me.Katakana:return A===27?(ht=Me.EscapeStart,null):h(A,33,95)?(Fe=!1,65344+A):A===-1?-1:(Fe=!1,R(rt));case Me.LeadByte:return A===27?(ht=Me.EscapeStart,null):h(A,33,126)?(Fe=!1,_t=A,ht=Me.TrailByte,null):A===-1?-1:(Fe=!1,R(rt));case Me.TrailByte:if(A===27)return ht=Me.EscapeStart,R(rt);if(h(A,33,126)){ht=Me.LeadByte;var ue=94*(_t-33)+A-33,G=B(ue,V("jis0208"));return G===null?R(rt):G}return A===-1?(ht=Me.LeadByte,Yt.prepend(A),R(rt)):(ht=Me.LeadByte,R(rt));case Me.EscapeStart:return A===36||A===40?(_t=A,ht=Me.Escape,null):(Yt.prepend(A),Fe=!1,ht=Ht,R(rt));case Me.Escape:var E=_t;_t=0;var _=null;if(E===40&&A===66&&(_=Me.ASCII),E===40&&A===74&&(_=Me.Roman),E===40&&A===73&&(_=Me.Katakana),E===36&&(A===64||A===66)&&(_=Me.LeadByte),_!==null){ht=ht=_;var g=Fe;return Fe=!0,g?R(rt):null}return Yt.prepend([E,A]),Fe=!1,ht=Ht,R(rt)}}}function $e(je){je.fatal;var rt={ASCII:0,Roman:1,jis0208:2},Me=rt.ASCII;this.handler=function(ht,Ht){if(Ht===-1&&Me!==rt.ASCII)return ht.prepend(Ht),Me=rt.ASCII,[27,40,66];if(Ht===-1&&Me===rt.ASCII)return-1;if((Me===rt.ASCII||Me===rt.Roman)&&(Ht===14||Ht===15||Ht===27))return L(65533);if(Me===rt.ASCII&&st(Ht))return Ht;if(Me===rt.Roman&&(st(Ht)&&Ht!==92&&Ht!==126||Ht==165||Ht==8254)){if(st(Ht))return Ht;if(Ht===165)return 92;if(Ht===8254)return 126}if(st(Ht)&&Me!==rt.ASCII)return ht.prepend(Ht),Me=rt.ASCII,[27,40,66];if((Ht===165||Ht===8254)&&Me!==rt.Roman)return ht.prepend(Ht),Me=rt.Roman,[27,40,74];Ht===8722&&(Ht=65293);var _t=$(Ht,V("jis0208"));if(_t===null)return L(Ht);if(Me!==rt.jis0208)return ht.prepend(Ht),Me=rt.jis0208,[27,36,66];var Fe=ct(_t/94)+33;return[Fe,_t%94+33]}}function tt(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0;var Yt=127>Ht?64:65,A=160>_t?129:193;if((h(Ht,64,126)||h(Ht,128,252))&&(Fe=188*(_t-A)+Ht-Yt),h(Fe,8836,10715))return 48508+Fe;var ue=Fe===null?null:B(Fe,V("jis0208"));return ue===null&&S(Ht)&&ht.prepend(Ht),ue===null?R(rt):ue}return S(Ht)||Ht===128?Ht:h(Ht,161,223)?65216+Ht:h(Ht,129,159)||h(Ht,224,252)?(Me=Ht,null):R(rt)}}function yt(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me)||Me===128)return Me;if(Me===165)return 92;if(Me===8254)return 126;if(h(Me,65377,65439))return Me-65377+161;Me===8722&&(Me=65293);var ht=Q(Me);if(ht===null)return L(Me);var Ht=ct(ht/188),_t=31>Ht?129:193,Fe=ht%188,Yt=63>Fe?64:65;return[Ht+_t,Fe+Yt]}}function Ct(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0,h(Ht,65,254)&&(Fe=190*(_t-129)+(Ht-65));var Yt=Fe===null?null:B(Fe,V("euc-kr"));return Fe===null&&S(Ht)&&ht.prepend(Ht),Yt===null?R(rt):Yt}return S(Ht)?Ht:h(Ht,129,254)?(Me=Ht,null):R(rt)}}function ot(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;var ht=$(Me,V("euc-kr"));if(ht===null)return L(Me);var Ht=ct(ht/190)+129;return[Ht,ht%190+65]}}function vt(je,rt){var Me=je>>8,ht=255&je;return rt?[Me,ht]:[ht,Me]}function At(je,rt){var Me=rt.fatal,ht=null,Ht=null;this.handler=function(_t,Fe){if(Fe===-1&&(ht!==null||Ht!==null))return R(Me);if(Fe===-1&&ht===null&&Ht===null)return-1;if(ht===null)return ht=Fe,null;var Yt;if(Yt=je?(ht<<8)+Fe:(Fe<<8)+ht,ht=null,Ht!==null){var A=Ht;return Ht=null,h(Yt,56320,57343)?65536+1024*(A-55296)+(Yt-56320):(_t.prepend(vt(Yt,je)),R(Me))}return h(Yt,55296,56319)?(Ht=Yt,null):h(Yt,56320,57343)?R(Me):Yt}}function Je(je,rt){rt.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(h(ht,0,65535))return vt(ht,je);var Ht=vt((ht-65536>>10)+55296,je),_t=vt((1023&ht-65536)+56320,je);return Ht.concat(_t)}}function it(je){je.fatal,this.handler=function(rt,Me){return Me===-1?-1:S(Me)?Me:63360+Me-128}}function Ue(je){je.fatal,this.handler=function(rt,Me){return Me===-1?-1:st(Me)?Me:h(Me,63360,63487)?Me-63360+128:L(Me)}}typeof u<"u"&&u.exports&&!c["encoding-indexes"]&&l("./encoding-indexes.js");var ct=t,st=S,Ze=-1;I.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ze},prepend:function(je){if(Array.isArray(je))for(var rt=je;rt.length;)this.tokens.push(rt.pop());else this.tokens.push(je)},push:function(je){if(Array.isArray(je))for(var rt=je;rt.length;)this.tokens.unshift(rt.shift());else this.tokens.unshift(je)}};var ye=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Ke={};ye.forEach(function(je){je.encodings.forEach(function(rt){rt.labels.forEach(function(Me){Ke[Me]=rt})})});var ke={},me={},ie,ge;Object.defineProperty&&(Object.defineProperty(ne.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(ne.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(ne.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),ne.prototype.decode=function(je,rt){var Me;Me=typeof je=="object"&&je instanceof ArrayBuffer?new Uint8Array(je):typeof je=="object"&&"buffer"in je&&je.buffer instanceof ArrayBuffer?new Uint8Array(je.buffer,je.byteOffset,je.byteLength):new Uint8Array(0),rt=m(rt),this._do_not_flush||(this._decoder=me[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!rt.stream;for(var ht=new I(Me),Ht=[],_t,Fe;Fe=ht.read(),Fe!==Ze&&(_t=this._decoder.handler(ht,Fe),_t!==-1);)_t!==null&&(Array.isArray(_t)?Ht.push.apply(Ht,_t):Ht.push(_t));if(!this._do_not_flush){do{if(_t=this._decoder.handler(ht,ht.read()),_t===-1)break;_t!==null&&(Array.isArray(_t)?Ht.push.apply(Ht,_t):Ht.push(_t))}while(!ht.endOfStream());this._decoder=null}return function(Yt){return!p(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(0arguments.length)&&S.call(arguments,1);return I[k]=!0,v(function(){I[k]&&(B?L.apply(null,B):L.call(null),c.clearImmediate(k))}),k},c.clearImmediate=typeof p=="function"?p:function(L){delete I[L]}}).call(this)}).call(this,l("timers").setImmediate,l("timers").clearImmediate)},{"process/browser.js":16,timers:22}],23:[function(l,u){(function(c){(function(){function h(ne){if(!ne)throw new Error("forgot to pass buffer");return $.isBuffer(ne)?ne:p(ne)?$.from(ne):p(ne.buffer)?ne.BYTES_PER_ELEMENT===1?$.from(ne):$.from(ne.buffer):void 0}function p(ne){return ne instanceof c.ArrayBuffer||Object.prototype.toString.call(ne)==="[object ArrayBuffer]"}function m(ne,de){return typeof ne=="string"&&Y.has(ne)?k.resolve(Y.get(ne)):m.getShapefile(ne,de).then(function(pe){return typeof ne=="string"&&Y.set(ne,pe),pe})}async function v(ne,de){const pe=await I(ne);return m.parseZip(pe,de)}let w=l("proj4");w.default&&(w=w.default);const S=l("./unzip"),I=l("./binaryajax"),R=l("./parseShp"),L=l("parsedbf"),k=l("lie"),B=l("lru-cache"),$=l("buffer").Buffer,V=c.URL,Y=new B({max:20});m.combine=function([ne,de]){const pe={type:"FeatureCollection",features:[]};let H=0;const Z=ne.length;for(de||(de=[]);H{const de=await k.all([I(ne,"shp"),I(ne,"prj")]);let pe=!1;try{de[1]&&(pe=w(de[1]))}catch{pe=!1}return R(de[0],pe)},Q=async ne=>{const[de,pe]=await k.all([I(ne,"dbf"),I(ne,"cpg")]);return de?L(de,pe):void 0},re=(ne,de)=>new V(ne).pathname.slice(-4).toLowerCase()===de;m.getShapefile=async function(ne,de){if(typeof ne!="string")return m.parseZip(ne);if(re(ne,".zip"))return v(ne,de);const pe=await k.all([K(ne),Q(ne)]);return m.combine(pe)},m.parseShp=function(ne,de){if(ne=h(ne),$.isBuffer(de)&&(de=de.toString()),typeof de=="string")try{de=w(de)}catch{de=!1}return R(ne,de)},m.parseDbf=function(ne,de){return ne=h(ne),L(ne,de)},u.exports=m}).call(this)}).call(this,typeof Hh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{"./binaryajax":2,"./parseShp":4,"./unzip":5,buffer:8,lie:12,"lru-cache":13,parsedbf:15,proj4:17}]},{},[23])(23)})})(B6t);var ZFr=B6t.exports;const QFr=X3(ZFr),ekr={Point:"circlePoint",MultiPoint:"circlePoint",LineString:"solidLine",MultiLineString:"solidLine",Polygon:"outlinedPoly",MultiPolygon:"outlinedPoly"};function tkr(i){if(i.type!=="FeatureCollection")throw new Error("GeoJSON is not in FeatureCollection format");let e=!0,t=!0;for(let r=0;rr.indexOf(" ")>-1;e.fields?.forEach(r=>{if(r.name&&t(r.name)){const n=r.name;let s,o="_",a;do s=n.replace(/ /g,o),a=e.fields?.find(l=>l.name===s),a&&(o+="_");while(a);r.alias=n,r.name=s;for(let l=0;ln.coordinates);i.features[e].geometry={type:`Multi${t[0].type}`,coordinates:r}}}function nkr(i){return i==="MultiLineString"?"LineString":i==="MultiPolygon"?"Polygon":i}class skr extends tf{async fetchFileData(e,t){const r=await bP.get(e,{responseType:"arrayBuffer"});switch(t){case pn.GEOJSON:case pn.DATAJSON:return JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r.data)));case pn.SHAPEFILE:return r.data;case pn.CSV:case pn.DATACSV:return new TextDecoder("utf-8").decode(new Uint8Array(r.data));default:console.error(`Unsupported file type passed to fetchFileData- '${t}'`)}}extractGeoJsonFields(e){if(e.features.length<1)throw new Error("GeoJSON field extraction requires at least one feature");let t="";for(let o=0;o({name:o,type:"string"}));let n=0;const s=Object.keys(e.features[0].properties);for(;ns.includes(a)).forEach(a=>{const l=o.properties[a];if(l!=null){const u=r.findIndex(c=>c.name===a);r[u]={name:a,type:this.inferType(l)},s.splice(s.indexOf(a),1)}}),s.length===0)break;n++}return r}extractCsvFields(e,t=","){return hOe.dsv.dsvFormat(t).parseRows(e)[0].map(n=>({name:n,type:j1.STRING}))}filterCsvLatLonFields(e,t=","){const r=hOe.dsv.dsvFormat(t).parseRows(e),n=r[0],s={lat:JSON.parse(JSON.stringify(n)),lon:JSON.parse(JSON.stringify(n))};for(let o=0;o90)&&u!==-1&&s.lat.splice(u,1),(isNaN(l)||l<-180||l>180)&&c!==-1&&s.lon.splice(c,1),u===-1&&c===-1)break}return s}async geoJsonToEsriJson(e,t){let r,n="EPSG:4326",s;const o={objectIdField:"OBJECTID",fields:[{name:"OBJECTID",type:j1.OID}]};tkr(e);const a=e.features[0].geometry.type,l=ekr[a],u=JSON.parse(JSON.stringify(CFr[l]));if(e.crs&&e.crs.type==="name"&&(n=e.crs.properties.name),t){if(t.sourceProjection&&(n=t.sourceProjection),t.targetSR)r=t.targetSR;else throw new Error("geoJsonToEsriJson - missing opts.targetSR arguement");t.layerId?s=t.layerId:s=this.$iApi.geo.shared.generateUUID(),t.colour&&(u.renderer.symbol.color=new bR(t.colour).toArcServer())}else throw new Error("geoJsonToEsriJson - missing opts arguement");o.renderer=_x.fromJSON(u.renderer),o.fields=(o.fields||[]).concat(t.fieldMetadata?.exclusiveFields?this.extractGeoJsonFields(e).filter(v=>t.fieldMetadata?.fieldInfo?.find(w=>w.name===v.name)):this.extractGeoJsonFields(e)),t.fieldMetadata?.enforceOrder&&t.fieldMetadata?.fieldInfo&&t.fieldMetadata?.fieldInfo.length>0&&(o.fields=this.$iApi.geo.attributes.orderFields(o.fields,t.fieldMetadata?.fieldInfo)),ikr(e,o);const c=this.$iApi.geo.proj.normalizeProj(r);if(t){if(t.latField){const v=o.fields.find(w=>w.name===t.latField||w.alias===t.latField);v&&(v.type=j1.DOUBLE)}if(t.lonField){const v=o.fields.find(w=>w.name===t.lonField||w.alias===t.lonField);v&&(v.type=j1.DOUBLE)}}await this.$iApi.geo.proj.checkProjBomber([n,r]);const h=new Xi(r);await this.$iApi.geo.proj.projectGeoJson(e,n,c);const p=IFr.convert(e,{sr:8888});o.geometryType=this.$iApi.geo.geom.geoJsonGeomTypeToEsriGeomType(a);const m=o.fields.map(v=>v.name);for(let v=0;v{m.includes(S)?(Array.isArray(w.attributes[S])||typeof w.attributes[S]=="object")&&w.attributes[S]!=null&&(w.attributes[S]=JSON.stringify(w.attributes[S])):delete w.attributes[S]})}return o.source=p,o.spatialReference=h,o.id=s,o}async csvToGeoJson(e,t){const r={latfield:"Lat",lonfield:"Long",delimiter:","};return t&&(t.latfield&&(r.latfield=t.latfield),t.lonfield&&(r.lonfield=t.lonfield),t.delimiter&&(r.delimiter=t.delimiter)),new Promise((n,s)=>{hOe.csv2geojson(e,r,(o,a)=>{o?(console.error("csv conversion error"),console.error(o),s(o)):(a.features.map(l=>{l.properties[r.lonfield]=l.geometry.coordinates[0],l.properties[r.latfield]=l.geometry.coordinates[1]}),n(a))})})}async shapefileToGeoJson(e){return QFr(e)}inferType(e){return typeof e=="number"?j1.DOUBLE:j1.STRING}rawDataJsonParser(e,t=!1){let r;return typeof e=="string"?r=JSON.parse(e):t?r=structuredClone(e):r=e,r}}const okr=[4326,4269,4258,31467,31468,31469,2166,2167,2168,2036,2044,2045,2065,2081,2082,2083,2085,2086,2091,2092,2093,2096,2097,2098,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2193,2199,2200,2206,2207,2208,2209,2210,2211,2212,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2935,2936,2937,2938,2939,2940,2941,2953,2963,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3034,3035,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3058,3059,3068,3114,3115,3116,3117,3118,3120,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3146,3147,3150,3151,3152,3300,3301,3328,3329,3330,3331,3332,3333,3334,3335,3346,3350,3351,3352,3366,3386,3387,3388,3389,3390,3396,3397,3398,3399,3407,3414,3416,3764,3788,3789,3790,3791,3793,3795,3796,3819,3821,3823,3824,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3851,3852,3854,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3888,3889,3906,3907,3908,3909,3910,3911,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4040,4041,4042,4043,4044,4045,4046,4047,4052,4053,4054,4055,4074,4075,4080,4081,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4178,4179,4180,4181,4182,4183,4184,4185,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4322,4324,4327,4329,4339,4341,4343,4345,4347,4349,4351,4353,4355,4357,4359,4361,4363,4365,4367,4369,4371,4373,4375,4377,4379,4381,4383,4386,4388,4417,4434,4463,4466,4469,4470,4472,4475,4480,4482,4483,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4557,4558,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4839,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4883,4885,4887,4889,4891,4893,4895,4898,4900,4901,4902,4903,4904,4907,4909,4921,4923,4925,4927,4929,4931,4933,4935,4937,4939,4941,4943,4945,4947,4949,4951,4953,4955,4957,4959,4961,4963,4965,4967,4969,4971,4973,4975,4977,4979,4981,4983,4985,4987,4989,4991,4993,4995,4997,4999,5012,5013,5017,5048,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5132,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5224,5228,5229,5233,5245,5246,5251,5252,5253,5254,5255,5256,5257,5258,5259,5263,5264,5269,5270,5271,5272,5273,5274,5275,5801,5802,5803,5804,5808,5809,5810,5811,5812,5813,5814,5815,5816,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,20092,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21453,21454,21455,21456,21457,21458,21459,21460,21461,21462,21463,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21896,21897,21898,21899,22171,22172,22173,22174,22175,22176,22177,22181,22182,22183,22184,22185,22186,22187,22191,22192,22193,22194,22195,22196,22197,25884,27205,27206,27207,27208,27209,27210,27211,27212,27213,27214,27215,27216,27217,27218,27219,27220,27221,27222,27223,27224,27225,27226,27227,27228,27229,27230,27231,27232,27391,27392,27393,27394,27395,27396,27397,27398,27492,28402,28403,28404,28405,28406,28407,28408,28409,28410,28411,28412,28413,28414,28415,28416,28417,28418,28419,28420,28421,28422,28423,28424,28425,28426,28427,28428,28429,28430,28431,28432,28462,28463,28464,28465,28466,28467,28468,28469,28470,28471,28472,28473,28474,28475,28476,28477,28478,28479,28480,28481,28482,28483,28484,28485,28486,28487,28488,28489,28490,28491,28492,29701,29702,30161,30162,30163,30164,30165,30166,30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177,30178,30179,30800,31251,31252,31253,31254,31255,31256,31257,31258,31259,31275,31276,31277,31278,31279,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31466,31700];function _k(i,e){return i.then(function(t){return[null,t]}).catch(function(t){return[t,void 0]})}var OYe={},TTe={};(function(i){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+t+"]*",n=new RegExp("^"+r+"$"),s=function(a,l){const u=[];let c=l.exec(a);for(;c;){const h=[];h.startIndex=l.lastIndex-c[0].length;const p=c.length;for(let m=0;m"u")};i.isExist=function(a){return typeof a<"u"},i.isEmptyObject=function(a){return Object.keys(a).length===0},i.merge=function(a,l,u){if(l){const c=Object.keys(l),h=c.length;for(let p=0;p"&&i[s]!==" "&&i[s]!==" "&&i[s]!==` -`&&i[s]!=="\r";s++)l+=i[s];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),s--),!mkr(l)){let h;return l.trim().length===0?h="Invalid space after '<'.":h="Tag '"+l+"' is an invalid name.",sm("InvalidTag",h,j_(i,s))}const u=ckr(i,s);if(u===!1)return sm("InvalidAttr","Attributes for '"+l+"' have open quote.",j_(i,s));let c=u.value;if(s=u.index,c[c.length-1]==="/"){const h=s-c.length;c=c.substring(0,c.length-1);const p=tdt(c,e);if(p===!0)r=!0;else return sm(p.err.code,p.err.msg,j_(i,h+p.err.line))}else if(a)if(u.tagClosed){if(c.trim().length>0)return sm("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",j_(i,o));{const h=t.pop();if(l!==h.tagName){let p=j_(i,h.tagStartPos);return sm("InvalidTag","Expected closing tag '"+h.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+l+"'.",j_(i,o))}t.length==0&&(n=!0)}}else return sm("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",j_(i,s));else{const h=tdt(c,e);if(h!==!0)return sm(h.err.code,h.err.msg,j_(i,s-c.length+h.err.line));if(n===!0)return sm("InvalidXml","Multiple possible root nodes found.",j_(i,s));e.unpairedTags.indexOf(l)!==-1||t.push({tagName:l,tagStartPos:o}),r=!0}for(s++;s0)return sm("InvalidXml","Invalid '"+JSON.stringify(t.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return sm("InvalidXml","Start tag expected.",1);return!0};function Zht(i){return i===" "||i===" "||i===` -`||i==="\r"}function Qht(i,e){const t=e;for(;e5&&r==="xml")return sm("InvalidXml","XML declaration allowed only at the start of the document.",j_(i,e));if(i[e]=="?"&&i[e+1]==">"){e++;break}else continue}return e}function edt(i,e){if(i.length>e+5&&i[e+1]==="-"&&i[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(i.length>e+8&&i[e+1]==="D"&&i[e+2]==="O"&&i[e+3]==="C"&&i[e+4]==="T"&&i[e+5]==="Y"&&i[e+6]==="P"&&i[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(i.length>e+9&&i[e+1]==="["&&i[e+2]==="C"&&i[e+3]==="D"&&i[e+4]==="A"&&i[e+5]==="T"&&i[e+6]==="A"&&i[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const lkr='"',ukr="'";function ckr(i,e){let t="",r="",n=!1;for(;e"&&r===""){n=!0;break}t+=i[e]}return r!==""?!1:{value:t,index:e,tagClosed:n}}const hkr=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function tdt(i,e){const t=PYe.getAllMatches(i,hkr),r={};for(let n=0;n!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(i,e,t){return i}},gkr=function(i){return Object.assign({},j6t,i)};RYe.buildOptions=gkr;RYe.defaultOptions=j6t;class ykr{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var vkr=ykr;const _kr=TTe;function bkr(i,e){const t={};if(i[e+3]==="O"&&i[e+4]==="C"&&i[e+5]==="T"&&i[e+6]==="Y"&&i[e+7]==="P"&&i[e+8]==="E"){e=e+9;let r=1,n=!1,s=!1,o="";for(;e"){if(s?i[e-1]==="-"&&i[e-2]==="-"&&(s=!1,r--):r--,r===0)break}else i[e]==="["?n=!0:o+=i[e];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function wkr(i,e){let t="";for(;e0&&n&&t[2]!==".")return i;if(!e.leadingZeros&&s.length>0&&!n&&t[1]!==".")return i;{const l=Number(t),u=""+l;return u.search(/[eE]/)!==-1||a?e.eNotation?l:i:t.indexOf(".")!==-1?u==="0"&&o===""||u===o||n&&u==="-"+o?l:i:s?o===u||n+o===u?l:i:t===u||t===n+u?l:i}}else return i}}function Dkr(i){return i&&i.indexOf(".")!==-1&&(i=i.replace(/0+$/,""),i==="."?i="0":i[0]==="."?i="0"+i:i[i.length-1]==="."&&(i=i.substr(0,i.length-1))),i}var Fkr=Rkr;const DYe=TTe,tK=vkr,kkr=Akr,Lkr=Fkr;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,DYe.nameRegexp);let Nkr=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=$kr,this.parseXml=zkr,this.parseTextData=Bkr,this.resolveNameSpace=jkr,this.buildAttributesMap=Ukr,this.isItStopNode=qkr,this.replaceEntitiesValue=Hkr,this.readStopNodeData=Xkr,this.saveTextToParentTag=Wkr,this.addChild=Vkr}};function $kr(i){const e=Object.keys(i);for(let t=0;t0)){o||(i=this.replaceEntitiesValue(i));const a=this.options.tagValueProcessor(e,i,t,n,s);return a==null?i:typeof a!=typeof i||a!==i?a:this.options.trimValues?t6e(i,this.options.parseTagValue,this.options.numberParseOptions):i.trim()===i?t6e(i,this.options.parseTagValue,this.options.numberParseOptions):i}}function jkr(i){if(this.options.removeNSPrefix){const e=i.split(":"),t=i.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(i=t+e[1])}return i}const Gkr=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ukr(i,e,t){if(!this.options.ignoreAttributes&&typeof i=="string"){const r=DYe.getAllMatches(i,Gkr),n=r.length,s={};for(let o=0;o",s,"Closing Tag is not closed.");let l=i.substring(s+2,a).trim();if(this.options.removeNSPrefix){const h=l.indexOf(":");h!==-1&&(l=l.substr(h+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),t&&(r=this.saveTextToParentTag(r,t,n));const u=n.substring(n.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(c=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=n.lastIndexOf("."),n=n.substring(0,c),t=this.tagsNodeStack.pop(),r="",s=a}else if(i[s+1]==="?"){let a=e6e(i,s,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,t,n),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const l=new tK(a.tagName);l.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(l[":@"]=this.buildAttributesMap(a.tagExp,n,a.tagName)),this.addChild(t,l,n)}s=a.closeIndex+1}else if(i.substr(s+1,3)==="!--"){const a=b8(i,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=i.substring(s+4,a-2);r=this.saveTextToParentTag(r,t,n),t.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=a}else if(i.substr(s+1,2)==="!D"){const a=kkr(i,s);this.docTypeEntities=a.entities,s=a.i}else if(i.substr(s+1,2)==="!["){const a=b8(i,"]]>",s,"CDATA is not closed.")-2,l=i.substring(s+9,a);if(r=this.saveTextToParentTag(r,t,n),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}]);else{let u=this.parseTextData(l,t.tagname,n,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}s=a+2}else{let a=e6e(i,s,this.options.removeNSPrefix),l=a.tagName;const u=a.rawTagName;let c=a.tagExp,h=a.attrExpPresent,p=a.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),t&&r&&t.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,t,n,!1));const m=t;if(m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(t=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),l!==e.tagname&&(n+=n?"."+l:l),this.isItStopNode(this.options.stopNodes,n,l)){let v="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)s=a.closeIndex;else if(this.options.unpairedTags.indexOf(l)!==-1)s=a.closeIndex;else{const S=this.readStopNodeData(i,u,p+1);if(!S)throw new Error(`Unexpected end of ${u}`);s=S.i,v=S.tagContent}const w=new tK(l);l!==c&&h&&(w[":@"]=this.buildAttributesMap(c,n,l)),v&&(v=this.parseTextData(v,l,n,!0,h,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),w.add(this.options.textNodeName,v),this.addChild(t,w,n)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){l[l.length-1]==="/"?(l=l.substr(0,l.length-1),n=n.substr(0,n.length-1),c=l):c=c.substr(0,c.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const v=new tK(l);l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,n,l)),this.addChild(t,v,n),n=n.substr(0,n.lastIndexOf("."))}else{const v=new tK(l);this.tagsNodeStack.push(t),l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,n,l)),this.addChild(t,v,n),t=v}r="",s=p}}else r+=i[s];return e.child};function Vkr(i,e,t){const r=this.options.updateTag(e.tagname,t,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),i.addChild(e))}const Hkr=function(i){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];i=i.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];i=i.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];i=i.replace(t.regex,t.val)}i=i.replace(this.ampEntity.regex,this.ampEntity.val)}return i};function Wkr(i,e,t,r){return i&&(r===void 0&&(r=Object.keys(e.child).length===0),i=this.parseTextData(i,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),i!==void 0&&i!==""&&e.add(this.options.textNodeName,i),i=""),i}function qkr(i,e,t){const r="*."+t;for(const n in i){const s=i[n];if(r===s||e===s)return!0}return!1}function Ykr(i,e,t=">"){let r,n="";for(let s=e;s",t,`${e} is not closed`);if(i.substring(t+2,s).trim()===e&&(n--,n===0))return{tagContent:i.substring(r,t),i:s};t=s}else if(i[t+1]==="?")t=b8(i,"?>",t+1,"StopNode is not closed.");else if(i.substr(t+1,3)==="!--")t=b8(i,"-->",t+3,"StopNode is not closed.");else if(i.substr(t+1,2)==="![")t=b8(i,"]]>",t,"StopNode is not closed.")-2;else{const s=e6e(i,t,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&n++,t=s.closeIndex)}}function t6e(i,e,t){if(e&&typeof i=="string"){const r=i.trim();return r==="true"?!0:r==="false"?!1:Lkr(i,t)}else return DYe.isExist(i)?i:""}var Jkr=Nkr,G6t={};function Kkr(i,e){return U6t(i,e)}function U6t(i,e,t){let r;const n={};for(let s=0;s0&&(n[e.textNodeName]=r):r!==void 0&&(n[e.textNodeName]=r),n}function Zkr(i){const e=Object.keys(i);for(let t=0;t0&&(t=aLr),z6t(i,e,"",t)}function z6t(i,e,t,r){let n="",s=!1;for(let o=0;o`,s=!1;continue}else if(l===e.commentPropName){n+=r+``,s=!0;continue}else if(l[0]==="?"){const v=idt(a[":@"],e),w=l==="?xml"?"":r;let S=a[l][0][e.textNodeName];S=S.length!==0?" "+S:"",n+=w+`<${l}${S}${v}?>`,s=!0;continue}let c=r;c!==""&&(c+=e.indentBy);const h=idt(a[":@"],e),p=r+`<${l}${h}`,m=z6t(a[l],e,u,c);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?n+=p+">":n+=p+"/>":(!m||m.length===0)&&e.suppressEmptyNode?n+=p+"/>":m&&m.endsWith(">")?n+=p+`>${m}${r}`:(n+=p+">",m&&r!==""&&(m.includes("/>")||m.includes("`),s=!0}return n}function uLr(i){const e=Object.keys(i);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function aL(i){this.options=Object.assign({},pLr,i),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gLr),this.processTextOrObjNode=fLr,this.options.format?(this.indentate=mLr,this.tagEndChar=`> +northing meters`+te;var ir=ki/2,$r=0,mn=0,Kr,xn,Gn,Ds,Fn;return 0"u"){var lt=te.split(",");this.x=parseFloat(lt[0],10),this.y=parseFloat(lt[1],10),this.z=parseFloat(lt[2],10)||0}else this.x=te,this.y=xe,this.z=Ae||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function Et(te){var xe=typeof te.PROJECTION=="object"?Object.keys(te.PROJECTION)[0]:te.PROJECTION;return"no_uoff"in te||"no_off"in te||["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(xe)!==-1}function Ye(){var te=Math.pi,xe=0,Ae=0,lt=0,nt=0,It=0,Nt=0,Ut=0,Jt,xi,Di,ki,ir,$r,mn,Kr,xn,Gn,Ds;this.no_off=Et(this),this.no_rot="no_rot"in this;var Fn=!1;"alpha"in this&&(Fn=!0);var yo=!1;if("rectified_grid_angle"in this&&(yo=!0),Fn&&(Ut=this.alpha),yo&&(xe=this.rectified_grid_angle*Mn),Fn||yo)Ae=this.longc;else if(lt=this.long1,It=this.lat1,nt=this.long2,Nt=this.lat2,n(It-Nt)<=$n||(Jt=n(It))<=$n||n(Jt-z)<=$n||n(n(this.lat0)-z)<=$n||n(n(Nt)-z)<=$n)throw new Error;var or=1-this.es;xi=$(or),n(this.lat0)>Dt?(Kr=k(this.lat0),Di=B(this.lat0),Jt=1-this.es*Kr*Kr,this.B=Di*Di,this.B=$(1+this.es*this.B*this.B/or),this.A=this.B*this.k0*xi/Jt,ki=this.B*xi/(Di*$(Jt)),ir=ki*ki-1,0>=ir?ir=0:(ir=$(ir),0>this.lat0&&(ir=-ir)),this.E=ir+=ki,this.E*=s(qr(this.e,this.lat0,Kr),this.B)):(this.B=1/xi,this.A=this.k0,this.E=ki=ir=1),Fn||yo?(Fn?(Ds=h(k(Ut)/ki),!yo&&(xe=Ut)):(Ds=xe,Ut=h(ki*k(Ds))),this.lam0=Ae-h(.5*(ir-1/ir)*L(Ds))/this.B):($r=s(qr(this.e,It,k(It)),this.B),mn=s(qr(this.e,Nt,k(Nt)),this.B),ir=this.E/$r,xn=(mn-$r)/(mn+$r),Gn=this.E*this.E,Gn=(Gn-mn*$r)/(Gn+mn*$r),Jt=lt-nt,Jt<-te?nt-=Un:Jt>te&&(nt+=Un),this.lam0=fn(.5*(lt+nt)-I(Gn*L(.5*this.B*(lt-nt))/xn)/this.B),Ds=I(2*k(this.B*fn(lt-this.lam0))/(ir-1/ir)),xe=Ut=h(ki*k(Ds))),this.singam=k(Ds),this.cosgam=B(Ds),this.sinrot=k(xe),this.cosrot=B(xe),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=n(this.ArB*I($(ki*ki-1)/B(Ut))),0>this.lat0&&(this.u_0=-this.u_0)),ir=.5*Ds,this.v_pole_n=this.ArB*r(L(Pt-ir)),this.v_pole_s=this.ArB*r(L(Pt+ir))}function jt(te){var xe=[],Ae;return xe[0]=te*kh,Ae=te*te,xe[0]+=Ae*Qv,xe[1]=Ae*I0,Ae*=te,xe[0]+=Ae*_y,xe[1]+=Ae*e1,xe[2]=Ae*Nl,xe}function ei(te,xe){var Ae=te+te;return te+xe[0]*k(Ae)+xe[1]*k(Ae+Ae)+xe[2]*k(Ae+Ae+Ae)}function Xt(te,xe,Ae,lt){var nt;return tePt&&nt<=z+Pt?(lt.value=Qa.AREA_1,nt-=z):nt>z+Pt||nt<=-(z+Pt)?(lt.value=Qa.AREA_2,nt=0<=nt?nt-Qi:nt+Qi):(lt.value=Qa.AREA_3,nt+=z)),nt}function wi(te,xe){var Ae=te+xe;return Ae<-Qi?Ae+=Un:Ae>+Qi&&(Ae-=Un),Ae}function pi(te,xe,Ae,lt){for(var nt=xe,It;lt&&(It=te(nt),nt-=It,!(n(It)=this.text.length)return;te=this.text[this.place++]}switch(this.state){case ai:return this.neutral(te);case Al:return this.keyword(te);case Ma:return this.quoted(te);case _n:return this.afterquote(te);case eu:return this.number(te)}},Y.prototype.afterquote=function(te){if(te==='"')return this.word+='"',void(this.state=Ma);if(la.test(te))return this.word=this.word.trim(),void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in afterquote yet, index '+this.place)},Y.prototype.afterItem=function(te){return te===","?(this.word!==null&&this.currentObject.push(this.word),this.word=null,void(this.state=ai)):te==="]"?(this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ai,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=Ss))):void 0},Y.prototype.number=function(te){if(gi.test(te))return void(this.word+=te);if(la.test(te))return this.word=parseFloat(this.word),void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in number yet, index '+this.place)},Y.prototype.quoted=function(te){return te==='"'?void(this.state=_n):void(this.word+=te)},Y.prototype.keyword=function(te){if(/[A-Za-z84]/.test(te))return void(this.word+=te);if(te==="["){var xe=[];return xe.push(this.word),this.level++,this.root===null?this.root=xe:this.currentObject.push(xe),this.stack.push(this.currentObject),this.currentObject=xe,void(this.state=ai)}if(la.test(te))return void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in keyword yet, index '+this.place)},Y.prototype.neutral=function(te){if(/[A-Za-z]/.test(te))return this.word=te,void(this.state=Al);if(te==='"')return this.word="",void(this.state=Ma);if(gi.test(te))return this.word=te,void(this.state=eu);if(la.test(te))return void this.afterItem(te);throw new Error(`havn't handled "`+te+'" in neutral yet, index '+this.place)},Y.prototype.output=function(){for(;this.placete?-1:1},fn=function(te){return n(te)<=Qi?te:te-gl(te)*Un},qr=function(te,xe,Ae){var lt=te*Ae;return lt=s((1-lt)/(1+lt),.5*te),L(.5*(z-xe))/lt},Gu=function(te,xe){for(var Ae=z-2*I(xe),lt=0,nt,It;15>=lt;lt++)if(nt=te*k(Ae),It=z-2*I(xe*s((1-nt)/(1+nt),.5*te))-Ae,Ae+=It,1e-10>=n(It))return Ae;return-9999},dc=[{init:Be,forward:function(te){var xe=te.x,Ae=te.y;if(90Ae*yn&&180xe*yn)return null;var lt,nt;if(n(n(Ae)-z)<=Dt)return null;if(this.sphere)lt=this.x0+this.a*this.k0*fn(xe-this.long0),nt=this.y0+this.a*this.k0*r(L(Pt+.5*Ae));else{var It=k(Ae),Nt=qr(this.e,Ae,It);lt=this.x0+this.a*this.k0*fn(xe-this.long0),nt=this.y0-this.a*this.k0*r(Nt)}return te.x=lt,te.y=nt,te},inverse:function(te){var xe=te.x-this.x0,Ae=te.y-this.y0,lt,nt;if(this.sphere)nt=z-2*I(R(-Ae/(this.a*this.k0)));else{var It=R(-Ae/(this.a*this.k0));if(nt=Gu(this.e,It),nt===-9999)return null}return lt=fn(this.long0+xe/(this.a*this.k0)),te.x=lt,te.y=nt,te},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Ve,inverse:Ve,names:["longlat","identity"]}],Re={},Ne=[],dt={};dt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},dt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},dt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},dt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},dt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},dt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},dt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},dt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},dt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},dt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},dt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},dt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},dt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},dt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},dt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},dt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},dt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},dt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},dt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},dt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},dt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},dt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},dt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},dt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},dt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},dt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},dt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},dt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},dt.hough={a:6378270,rf:297,ellipseName:"Hough"},dt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},dt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},dt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},dt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},dt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},dt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},dt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},dt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},dt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},dt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},dt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},dt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Gt=dt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};dt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ti={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},oi={};ke.projections={start:function(){dc.forEach($e)},add:$e,get:function(te){if(!te)return!1;var xe=te.toLowerCase();if(typeof Re[xe]<"u"&&Ne[Re[xe]])return Ne[Re[xe]]}},ke.projections.start();var Hi=function(te,xe,Ae){if(me(te,xe)||te.datum_type===Ui||xe.datum_type===Ui)return Ae;var lt=te.a,nt=te.es;if(te.datum_type===Ri){var It=ht(te,!1,Ae);if(It!==0)return;lt=Bi,nt=mi}var Nt=xe.a,Ut=xe.b,Jt=xe.es;if(xe.datum_type===Ri&&(Nt=Bi,Ut=6356752314e-3,Jt=mi),nt===Jt&<===Nt&&!Me(te.datum_type)&&!Me(xe.datum_type))return Ae;if(Ae=ie(Ae,nt,lt),Me(te.datum_type)&&(Ae=je(Ae,te.datum_type,te.datum_params)),Me(xe.datum_type)&&(Ae=rt(Ae,xe.datum_type,xe.datum_params)),Ae=ge(Ae,Jt,Nt,Ut),xe.datum_type===Ri){var xi=ht(xe,!0,Ae);if(xi!==0)return}return Ae},Oi=function(te,xe,Ae){var lt=Ae.x,nt=Ae.y,It=Ae.z||0,Nt={},Ut,Jt,xi;for(xi=0;3>xi;xi++)if(!(xe&&xi===2&&Ae.z===void 0))switch(xi===0?(Ut=lt,Jt="ew".indexOf(te.axis[xi])===-1?"y":"x"):xi===1?(Ut=nt,Jt="ns".indexOf(te.axis[xi])===-1?"x":"y"):(Ut=It,Jt="z"),te.axis[xi]){case"e":Nt[Jt]=Ut;break;case"w":Nt[Jt]=-Ut;break;case"n":Nt[Jt]=Ut;break;case"s":Nt[Jt]=-Ut;break;case"u":Ae[Jt]!==void 0&&(Nt.z=Ut);break;case"d":Ae[Jt]!==void 0&&(Nt.z=-Ut);break;default:return null}return Nt},kt=function(te){var xe={x:te[0],y:te[1]};return 2Dt?L(Ae):0,Kr=s(mn,2),xn=s(Kr,2);Nt=1-this.es*s(nt,2),Di/=$(Nt);var Gn=Fi(Ae,nt,It,this.en);Ut=this.a*(this.k0*Di*(1+ki/6*(1-Kr+ir+ki/20*(5-18*Kr+xn+14*ir-58*Kr*ir+ki/42*(61+179*xn-xn*Kr-479*Kr)))))+this.x0,Jt=this.a*(this.k0*(Gn-this.ml0+nt*lt*Di/2*(1+ki/12*(5-Kr+9*ir+4*$r+ki/30*(61+xn-58*Kr+270*ir-330*Kr*ir+ki/56*(1385+543*xn-xn*Kr-3111*Kr))))))+this.y0}else{var xi=It*k(lt);if(n(n(xi)-1)Dt)return 93;Jt=0}else Jt=p(Jt);0>Ae&&(Jt=-Jt),Jt=this.a*this.k0*(Jt-this.lat0)+this.y0}return te.x=Ut,te.y=Jt,te},inverse:function(te){var xe=(te.x-this.x0)*(1/this.a),Ae=(te.y-this.y0)*(1/this.a),lt,nt,It,Nt;if(this.es)if(lt=this.ml0+Ae/this.k0,nt=mr(lt,this.es,this.en),n(nt)Dt?L(nt):0,mn=this.ep2*s(ir,2),Kr=s(mn,2),xn=s($r,2),Gn=s(xn,2);lt=1-this.es*s(ki,2);var Ds=xe*$(lt)/this.k0,Fn=s(Ds,2);lt*=$r,It=nt-.5*(lt*Fn/(1-this.es))*(1-Fn/12*(5+3*xn-9*mn*xn+mn-4*Kr-Fn/30*(61+90*xn-252*mn*xn+45*Gn+46*mn-Fn/56*(1385+3633*xn+4095*Gn+1574*Gn*xn)))),Nt=fn(this.long0+Ds*(1-Fn/6*(1+2*xn+mn-Fn/20*(5+28*xn+24*Gn+8*mn*xn+6*mn-Fn/42*(61+662*xn+1320*Gn+720*Gn*xn))))/ir)}else It=z*gl(Ae),Nt=0;else{var Ut=R(xe/this.k0),Jt=.5*(Ut-1/Ut),xi=this.lat0+Ae/this.k0,Di=B(xi);lt=$((1-s(Di,2))/(1+s(Jt,2))),It=h(lt),0>Ae&&(It=-It),Nt=Jt===0&&Di===0?0:fn(v(Jt,Di)+this.long0)}return te.x=Nt,te.y=It,te},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Gr=function(te){var xe=R(te);return xe=(xe-1/xe)/2,xe},zr=function(te,xe){var Ae=Math.max;te=n(te),xe=n(xe);var lt=Ae(te,xe),nt=a(te,xe)/(lt||1);return lt*$(1+s(nt,2))},jn=function(te){var xe=1+te,Ae=xe-1;return Ae===0?te:te*r(xe)/Ae},co=function(te){var xe=n(te);return xe=jn(xe*(1+xe/(zr(1,xe)+1))),0>te?-xe:xe},ua=function(te,xe){for(var Ae=2*B(2*xe),lt=te.length-1,nt=te[lt],It=0,Nt;0<=--lt;)Nt=-It+Ae*nt+te[lt],It=nt,nt=Nt;return xe+Nt*k(2*xe)},Hs=function(te,xe){for(var Ae=2*B(xe),lt=te.length-1,nt=te[lt],It=0,Nt;0<=--lt;)Nt=-It+Ae*nt+te[lt],It=nt,nt=Nt;return k(xe)*Nt},Ll=function(te){var xe=R(te);return xe=(xe+1/xe)/2,xe},ft=function(te,xe,Ae){for(var lt=k(xe),nt=B(xe),It=Gr(Ae),Nt=Ll(Ae),Ut=2*nt*Nt,Jt=-2*lt*It,xi=te.length-1,Di=te[xi],ki=0,ir=0,$r=0,mn,Kr;0<=--xi;)mn=ir,Kr=ki,ir=Di,ki=$r,Di=-mn+Ut*ir-Jt*ki+te[xi],$r=-Kr+Jt*ir+Ut*ki;return Ut=lt*Nt,Jt=nt*It,[Ut*Di-Jt*$r,Ut*$r+Jt*Di]},Wt={init:function(){if(!this.approx&&(isNaN(this.es)||0>=this.es))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(yr.init.apply(this),this.forward=yr.forward,this.inverse=yr.inverse),this.x0=this.x0===void 0?0:this.x0,this.y0=this.y0===void 0?0:this.y0,this.long0=this.long0===void 0?0:this.long0,this.lat0=this.lat0===void 0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var te=this.es/(1+$(1-this.es)),xe=te/(2-te),Ae=xe;this.cgb[0]=xe*(2+xe*(-2/3+xe*(-2+xe*(116/45+xe*(26/45+xe*(-2854/675)))))),this.cbg[0]=xe*(-2+xe*(2/3+xe*(4/3+xe*(-82/45+xe*(32/45+xe*(4642/4725)))))),Ae*=xe,this.cgb[1]=Ae*(7/3+xe*(-8/5+xe*(-227/45+xe*(2704/315+xe*(2323/945))))),this.cbg[1]=Ae*(5/3+xe*(-16/15+xe*(-13/9+xe*(904/315+xe*(-1522/945))))),Ae*=xe,this.cgb[2]=Ae*(56/15+xe*(-136/35+xe*(-1262/105+xe*(73814/2835)))),this.cbg[2]=Ae*(-26/15+xe*(34/21+xe*(8/5+xe*(-12686/2835)))),Ae*=xe,this.cgb[3]=Ae*(4279/630+xe*(-332/35+xe*(-399572/14175))),this.cbg[3]=Ae*(1237/630+xe*(-12/5+xe*(-24832/14175))),Ae*=xe,this.cgb[4]=Ae*(4174/315+xe*(-144838/6237)),this.cbg[4]=Ae*(-734/315+xe*(109598/31185)),Ae*=xe,this.cgb[5]=Ae*(601676/22275),this.cbg[5]=Ae*(444337/155925),Ae=s(xe,2),this.Qn=this.k0/(1+xe)*(1+Ae*(1/4+Ae*(1/64+Ae/256))),this.utg[0]=xe*(-.5+xe*(2/3+xe*(-37/96+xe*(1/360+xe*(81/512+xe*(-96199/604800)))))),this.gtu[0]=xe*(.5+xe*(-2/3+xe*(5/16+xe*(41/180+xe*(-127/288+xe*(7891/37800)))))),this.utg[1]=Ae*(-1/48+xe*(-1/15+xe*(437/1440+xe*(-46/105+xe*(1118711/3870720))))),this.gtu[1]=Ae*(13/48+xe*(-3/5+xe*(557/1440+xe*(281/630+xe*(-1983433/1935360))))),Ae*=xe,this.utg[2]=Ae*(-17/480+xe*(37/840+xe*(209/4480+xe*(-5569/90720)))),this.gtu[2]=Ae*(61/240+xe*(-103/140+xe*(15061/26880+xe*(167603/181440)))),Ae*=xe,this.utg[3]=Ae*(-4397/161280+xe*(11/504+xe*(830251/7257600))),this.gtu[3]=Ae*(49561/161280+xe*(-179/168+xe*(6601661/7257600))),Ae*=xe,this.utg[4]=Ae*(-4583/161280+xe*(108847/3991680)),this.gtu[4]=Ae*(34729/80640+xe*(-3418889/1995840)),Ae*=xe,this.utg[5]=Ae*(-20648693/638668800),this.gtu[5]=Ae*(212378941/319334400);var lt=ua(this.cbg,this.lat0);this.Zb=-this.Qn*(lt+Hs(this.gtu,2*lt))},forward:function(te){var xe=fn(te.x-this.long0),Ae=te.y;Ae=ua(this.cbg,Ae);var lt=k(Ae),nt=B(Ae),It=k(xe),Nt=B(xe);Ae=v(lt,Nt*nt),xe=v(It*nt,zr(lt,nt*Nt)),xe=co(L(xe));var Ut=ft(this.gtu,2*Ae,2*xe);Ae+=Ut[0],xe+=Ut[1];var Jt,xi;return 2.623395162778>=n(xe)?(Jt=this.a*(this.Qn*xe)+this.x0,xi=this.a*(this.Qn*Ae+this.Zb)+this.y0):(Jt=1/0,xi=1/0),te.x=Jt,te.y=xi,te},inverse:function(te){var xe=(te.x-this.x0)*(1/this.a),Ae=(te.y-this.y0)*(1/this.a);Ae=(Ae-this.Zb)/this.Qn,xe/=this.Qn;var lt,nt;if(2.623395162778>=n(xe)){var It=ft(this.utg,2*Ae,2*xe);Ae+=It[0],xe+=It[1],xe=I(Gr(xe));var Nt=k(Ae),Ut=B(Ae),Jt=k(xe),xi=B(xe);Ae=v(Nt*xi,zr(Jt,xi*Ut)),xe=v(Jt,xi*Ut),lt=fn(xe+this.long0),nt=ua(this.cgb,Ae)}else lt=1/0,nt=1/0;return te.x=lt,te.y=nt,te},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},hi=function(te,xe){if(te===void 0){if(te=t(30*(fn(xe)+S)/S)+1,0>te)return 0;if(60Dt){if(It=this.E/s(qr(this.e,te.y,k(te.y)),this.B),Nt=1/It,Ae=.5*(It-Nt),lt=.5*(It+Nt),k(this.B*te.x),nt=(Ae*this.singam-86*this.cosgam)/lt,n(n(nt)-1)Jt?-z:z;else{if(xe.y=this.E/$((1+Jt)/(1-Jt)),xe.y=Gu(this.e,s(xe.y,1/this.B)),xe.y===1/0)throw new Error;xe.x=-this.rB*v(It*this.cosgam-Ut*this.singam,B(this.BrA*Ae))}return xe.x+=this.lam0,xe},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Sa={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(n(this.lat1+this.lat2)Dt?r(lt/Ut)/r(nt/Jt):xe,isNaN(this.ns)&&(this.ns=xe),this.f0=lt/(this.ns*s(nt,this.ns)),this.rh=this.a*this.f0*s(xi,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(te){var xe=te.x,Ae=te.y;n(2*n(Ae)-S)<=Dt&&(Ae=gl(Ae)*(z-2*Dt));var lt=n(n(Ae)-z),nt,It;if(lt>Dt)nt=qr(this.e,Ae,k(Ae)),It=this.a*this.f0*s(nt,this.ns);else{if(lt=Ae*this.ns,0>=lt)return null;It=0}var Nt=this.ns*fn(xe-this.long0);return te.x=this.k0*(It*k(Nt))+this.x0,te.y=this.k0*(this.rh-It*B(Nt))+this.y0,te},inverse:function(te){var xe=(te.x-this.x0)/this.k0,Ae=this.rh-(te.y-this.y0)/this.k0,lt,nt,It,Nt,Ut;0n(Jt-te.y)&&(xi=1),Jt=te.y,Di+=1;while(xi===0&&15>Di);return 15<=Di?null:te},names:["Krovak","krovak"]},go=function(te,xe,Ae,lt,nt){return te*nt-xe*k(2*nt)+Ae*k(4*nt)-lt*k(6*nt)},tu=function(te){return 1-.25*te*(1+te/16*(3+1.25*te))},Uu=function(te){return .375*te*(1+.25*te*(1+.46875*te))},pc=function(te){return .05859375*te*te*(1+.75*te)},Fh=function(te){return te*te*te*(35/3072)},Zr=function(te,xe,Ae){var lt=xe*Ae;return te/$(1-lt*lt)},Ps=function(te){return n(te)Ut;Ut++)if(Nt=(te-(xe*It-Ae*k(2*It)+lt*k(4*It)-nt*k(6*It)))/(xe-2*Ae*B(2*It)+4*lt*B(4*It)-6*nt*B(6*It)),It+=Nt,1e-10>=n(Nt))return It;return NaN},Ou={init:function(){this.sphere||(this.e0=tu(this.es),this.e1=Uu(this.es),this.e2=pc(this.es),this.e3=Fh(this.es),this.ml0=this.a*go(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(te){var xe=te.x,Ae=te.y,lt,nt;if(xe=fn(xe-this.long0),this.sphere)lt=this.a*h(B(Ae)*k(xe)),nt=this.a*(v(L(Ae),B(xe))-this.lat0);else{var It=k(Ae),Nt=B(Ae),Ut=Zr(this.a,this.e,It),Jt=L(Ae)*L(Ae),xi=xe*B(Ae),Di=xi*xi,ki=this.es*Nt*Nt/(1-this.es),ir=this.a*go(this.e0,this.e1,this.e2,this.e3,Ae);lt=Ut*xi*(1-Di*Jt*(1/6-(8-Jt+8*ki)*Di/120)),nt=ir-this.ml0+Ut*It/Nt*Di*(.5+(5-Jt+6*ki)*Di/24)}return te.x=lt+this.x0,te.y=nt+this.y0,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe=te.x/this.a,Ae=te.y/this.a,lt,nt;if(this.sphere){var It=Ae+this.lat0;lt=h(k(It)*B(xe)),nt=v(L(xe),B(It))}else{var Nt=this.ml0/this.a+Ae,Ut=ca(Nt,this.e0,this.e1,this.e2,this.e3);if(n(n(Ut)-z)<=Dt)return te.x=this.long0,te.y=z,0>Ae&&(te.y*=-1),te;var Jt=Zr(this.a,this.e,k(Ut)),xi=Jt*Jt*Jt/this.a/this.a*(1-this.es),Di=s(L(Ut),2),ki=xe*this.a/Jt,ir=ki*ki;lt=Ut-Jt*L(Ut)/xi*ki*ki*(.5-(1+3*Di)*ki*ki/24),nt=ki*(1-ir*(Di/3+(1+3*Di)*Di*ir/15))/B(Ut)}return te.x=fn(nt+this.long0),te.y=Ps(lt),te},names:["Cassini","Cassini_Soldner","cass"]},Za=function(te,xe){var Ae;return 1e-7this.lat0?this.S_POLE:this.N_POLE:n(te)Dt?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*$(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(te){var xe=te.x,Ae=te.y;this.sin_phi=k(Ae),this.cos_phi=B(Ae);var lt=Za(this.e3,this.sin_phi,this.cos_phi),nt=this.a*$(this.c-this.ns0*lt)/this.ns0,It=this.ns0*fn(xe-this.long0),Nt=nt*k(It)+this.x0,Ut=this.rh-nt*B(It)+this.y0;return te.x=Nt,te.y=Ut,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt;return te.x-=this.x0,te.y=this.rh-te.y+this.y0,0<=this.ns0?(xe=$(te.x*te.x+te.y*te.y),lt=1):(xe=-$(te.x*te.x+te.y*te.y),lt=-1),nt=0,xe!==0&&(nt=v(lt*te.x,lt*te.y)),lt=xe*this.ns0/this.a,this.sphere?Nt=h((this.c-lt*lt)/(2*this.ns0)):(Ae=(this.c-lt*lt)/this.ns0,Nt=this.phi1z(this.e3,Ae)),It=fn(nt/this.ns0+this.long0),te.x=It,te.y=Nt,te},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(te,xe){var Ae=Ml(.5*xe),lt,nt,It,Nt,Ut;if(te=Jt;Jt++)if(lt=k(Ae),nt=B(Ae),It=te*lt,Nt=1-It*It,Ut=.5*Nt*Nt/nt*(xe/(1-te*te)-lt/Nt+.5/te*r((1-It)/(1+It))),Ae+=Ut,1e-7>=n(Ut))return Ae;return null}},Xc={init:function(){this.sin_p14=k(this.lat0),this.cos_p14=B(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(te){var xe=te.x,Ae=te.y,lt,nt,It,Nt,Ut,Jt,xi,Di;return It=fn(xe-this.long0),lt=k(Ae),nt=B(Ae),Nt=B(It),Jt=this.sin_p14*lt+this.cos_p14*nt*Nt,Ut=1,0n(n(xe)-Ae))return 0>xe?-1*z:z;for(var lt=h(.5*xe),nt=0,It,Nt,Ut,Jt;30>nt;nt++)if(Nt=k(lt),Ut=B(lt),Jt=te*Nt,It=s(1-Jt*Jt,2)/(2*Ut)*(xe/(1-te*te)-Nt/(1-Jt*Jt)+.5/te*r((1-Jt)/(1+Jt))),lt+=It,1e-10>=n(It))return lt;return NaN},by={init:function(){this.sphere||(this.k0=na(this.e,k(this.lat_ts),B(this.lat_ts)))},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt,It;if(this.sphere)nt=this.x0+this.a*lt*B(this.lat_ts),It=this.y0+this.a*k(Ae)/B(this.lat_ts);else{var Nt=Za(this.e,k(Ae));nt=this.x0+this.a*this.k0*lt,It=this.y0+.5*(this.a*Nt)/this.k0}return te.x=nt,te.y=It,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe,Ae;return this.sphere?(xe=fn(this.long0+te.x/this.a/B(this.lat_ts)),Ae=h(te.y/this.a*B(this.lat_ts))):(Ae=Bm(this.e,2*te.y*this.k0/this.a),xe=fn(this.long0+te.x/(this.a*this.k0))),te.x=xe,te.y=Ae,te},names:["cea"]},A0={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=B(this.lat_ts)},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt=Ps(Ae-this.lat0);return te.x=this.x0+this.a*lt*this.rc,te.y=this.y0+this.a*nt,te},inverse:function(te){var xe=te.x,Ae=te.y;return te.x=fn(this.long0+(xe-this.x0)/(this.a*this.rc)),te.y=Ps(this.lat0+(Ae-this.y0)/this.a),te},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Nf={init:function(){this.temp=this.b/this.a,this.es=1-s(this.temp,2),this.e=$(this.es),this.e0=tu(this.es),this.e1=Uu(this.es),this.e2=pc(this.es),this.e3=Fh(this.es),this.ml0=this.a*go(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt,It,Nt;if(Nt=lt*k(Ae),this.sphere)n(Ae)<=Dt?(nt=this.a*lt,It=-1*this.a*this.lat0):(nt=this.a*k(Nt)/L(Ae),It=this.a*(Ps(Ae-this.lat0)+(1-B(Nt))/L(Ae)));else if(n(Ae)<=Dt)nt=this.a*lt,It=-1*this.ml0;else{var Ut=Zr(this.a,this.e,k(Ae))/L(Ae);nt=Ut*k(Nt),It=this.a*go(this.e0,this.e1,this.e2,this.e3,Ae)-this.ml0+Ut*(1-B(Nt))}return te.x=nt+this.x0,te.y=It+this.y0,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt,Ut,Jt,xi;if(lt=te.x-this.x0,nt=te.y-this.y0,this.sphere)if(n(nt+this.a*this.lat0)<=Dt)xe=fn(lt/this.a+this.long0),Ae=0;else{Nt=this.lat0+nt/this.a,Ut=lt*lt/this.a/this.a+Nt*Nt,Jt=Nt;var Di;for(It=20;It;--It)if(Di=L(Jt),xi=-1*(Nt*(Jt*Di+1)-Jt-.5*(Jt*Jt+Ut)*Di)/((Jt-Nt)/Di-1),Jt+=xi,n(xi)<=Dt){Ae=Jt;break}xe=fn(this.long0+h(lt*L(Jt)/this.a)/k(Ae))}else if(n(nt+this.ml0)<=Dt)Ae=0,xe=fn(this.long0+lt/this.a);else{Nt=(this.ml0+nt)/this.a,Ut=lt*lt/this.a/this.a+Nt*Nt,Jt=Nt;var ki,ir,$r,mn,Kr;for(It=20;It;--It)if(Kr=this.e*k(Jt),ki=$(1-Kr*Kr)*L(Jt),ir=this.a*go(this.e0,this.e1,this.e2,this.e3,Jt),$r=this.e0-2*this.e1*B(2*Jt)+4*this.e2*B(4*Jt)-6*this.e3*B(6*Jt),mn=ir/this.a,xi=(Nt*(ki*mn+1)-mn-.5*ki*(mn*mn+Ut))/(this.es*k(2*Jt)*(mn*mn+Ut-2*Nt*mn)/(4*ki)+(Nt-mn)*(ki*$r-2/k(2*Jt))-$r),Jt-=xi,n(xi)<=Dt){Ae=Jt;break}ki=$(1-this.es*s(k(Ae),2))*L(Ae),xe=fn(this.long0+h(lt*ki/this.a)/k(Ae))}return te.x=xe,te.y=Ae,te},names:["Polyconic","poly"]},Pg={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(te){var xe=te.x,Ae=te.y,lt=Ae-this.lat0,nt=xe-this.long0,It=1,Nt=0,Ut;for(Ut=1;10>=Ut;Ut++)It*=1e-5*(lt/ar),Nt+=this.A[Ut]*It;var Jt=Nt,xi=nt,Di=1,ki=0,ir=0,$r=0,mn,Kr;for(Ut=1;6>=Ut;Ut++)mn=Di*Jt-ki*xi,Kr=ki*Jt+Di*xi,Di=mn,ki=Kr,ir=ir+this.B_re[Ut]*Di-this.B_im[Ut]*ki,$r=$r+this.B_im[Ut]*Di+this.B_re[Ut]*ki;return te.x=$r*this.a+this.x0,te.y=ir*this.a+this.y0,te},inverse:function(te){var xe=te.x,Ae=te.y,lt=xe-this.x0,nt=Ae-this.y0,It=nt/this.a,Nt=lt/this.a,Ut=1,Jt=0,xi=0,Di=0,ki,ir,$r;for(ki=1;6>=ki;ki++)ir=Ut*It-Jt*Nt,$r=Jt*It+Ut*Nt,Ut=ir,Jt=$r,xi=xi+this.C_re[ki]*Ut-this.C_im[ki]*Jt,Di=Di+this.C_im[ki]*Ut+this.C_re[ki]*Jt;for(var mn=0;mn=ki;ki++)Fn=Kr*xi-xn*Di,yo=xn*xi+Kr*Di,Kr=Fn,xn=yo,Gn+=(ki-1)*(this.B_re[ki]*Kr-this.B_im[ki]*xn),Ds+=(ki-1)*(this.B_im[ki]*Kr+this.B_re[ki]*xn);Kr=1,xn=0;var or=this.B_re[1],Ce=this.B_im[1];for(ki=2;6>=ki;ki++)Fn=Kr*xi-xn*Di,yo=xn*xi+Kr*Di,Kr=Fn,xn=yo,or+=ki*(this.B_re[ki]*Kr-this.B_im[ki]*xn),Ce+=ki*(this.B_im[ki]*Kr+this.B_re[ki]*xn);var ze=or*or+Ce*Ce;xi=(Gn*or+Ds*Ce)/ze,Di=(Ds*or-Gn*Ce)/ze}var mt=xi,Ft=Di,ni=1,bi=0;for(ki=1;9>=ki;ki++)ni*=mt,bi+=this.D[ki]*ni;var Li=this.lat0+1e5*(bi*ar),Yi=this.long0+Ft;return te.x=Yi,te.y=Li,te},names:["New_Zealand_Map_Grid","nzmg"]},Kd={init:function(){},forward:function(te){var xe=te.x,Ae=te.y,lt=fn(xe-this.long0),nt=this.x0+this.a*lt,It=this.y0+1.25*(this.a*r(L(S/4+Ae/2.5)));return te.x=nt,te.y=It,te},inverse:function(te){te.x-=this.x0,te.y-=this.y0;var xe=fn(this.long0+te.x/this.a),Ae=2.5*(I(R(.8*te.y/this.a))-S/4);return te.x=xe,te.y=Ae,te},names:["Miller_Cylindrical","mill"]},$f={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=$((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=fi(this.es)},forward:function(te){var xe=te.x,Ae=te.y,lt,nt;if(xe=fn(xe-this.long0),this.sphere){if(!this.m)Ae=this.n===1?Ae:h(this.n*k(Ae));else for(var It=this.n*k(Ae),Nt=20,Ut;Nt&&(Ut=(this.m*Ae+k(Ae)-It)/(this.m+B(Ae)),Ae-=Ut,!(n(Ut)S&&(lt=S),Ae=(2*xe+k(2*xe))/S,1lt&&(mn=-mn),nt=this.x0+mn;var Kr=Jt+ki;return mn=S*this.R*(ir*Kr-Ut*$(($r+Jt)*(Jt+1)-Kr*Kr))/($r+Jt),It=0<=Ae?this.y0+mn:this.y0-mn,te.x=nt,te.y=It,te},inverse:function(te){var xe,Ae,lt,nt,It,Nt,Ut,Jt,xi,Di,ki,ir,$r;return te.x-=this.x0,te.y-=this.y0,ki=S*this.R,lt=te.x/ki,nt=te.y/ki,It=lt*lt+nt*nt,Nt=-n(nt)*(1+It),Ut=Nt-2*nt*nt+lt*lt,Jt=-2*Nt+1+2*nt*nt+It*It,$r=nt*nt/Jt+(2*Ut*Ut*Ut/Jt/Jt/Jt-9*Nt*Ut/Jt/Jt)/27,xi=(Nt-Ut*Ut/3/Jt)/Jt,Di=2*$(-xi/3),ki=3*$r/xi/Di,12*z*this.a?void 0:(Ae=xe/this.a,lt=k(Ae),nt=B(Ae),It=this.long0,n(xe)<=Dt?Nt=this.lat0:(Nt=Ml(nt*this.sin_p12+te.y*lt*this.cos_p12/xe),Ut=n(this.lat0)-z,It=n(Ut)<=Dt?0<=this.lat0?fn(this.long0+v(te.x,-te.y)):fn(this.long0-v(-te.x,te.y)):fn(this.long0+v(te.x*lt,xe*this.cos_p12*nt-te.y*this.sin_p12*lt))),te.x=It,te.y=Nt,te)):(Jt=tu(this.es),xi=Uu(this.es),Di=pc(this.es),ki=Fh(this.es),n(this.sin_p12-1)<=Dt?(ir=this.a*go(Jt,xi,Di,ki,z),xe=$(te.x*te.x+te.y*te.y),$r=ir-xe,Nt=ca($r/this.a,Jt,xi,Di,ki),It=fn(this.long0+v(te.x,-1*te.y)),te.x=It,te.y=Nt,te):n(this.sin_p12+1)<=Dt?(ir=this.a*go(Jt,xi,Di,ki,z),xe=$(te.x*te.x+te.y*te.y),$r=xe-ir,Nt=ca($r/this.a,Jt,xi,Di,ki),It=fn(this.long0+v(te.x,te.y)),te.x=It,te.y=Nt,te):(xe=$(te.x*te.x+te.y*te.y),xn=v(te.x,te.y),mn=Zr(this.a,this.e,this.sin_p12),Gn=B(xn),Ds=this.e*this.cos_p12*Gn,Fn=-Ds*Ds/(1-this.es),yo=3*this.es*(1-Fn)*this.sin_p12*this.cos_p12*Gn/(1-this.es),or=xe/mn,Ce=or-Fn*(1+Fn)*s(or,3)/6-yo*(1+3*Fn)*s(or,4)/24,ze=1-Fn*Ce*Ce/2-or*Ce*Ce*Ce/6,Kr=h(this.sin_p12*B(Ce)+this.cos_p12*k(Ce)*Gn),It=fn(this.long0+h(k(xn)*k(Ce)/B(Kr))),mt=k(Kr),Nt=v((mt-this.es*ze*this.sin_p12)*L(Kr),mt*(1-this.es)),te.x=It,te.y=Nt,te))},names:["Azimuthal_Equidistant","aeqd"]},fc={init:function(){this.sin_p14=k(this.lat0),this.cos_p14=B(this.lat0)},forward:function(te){var xe=te.x,Ae=te.y,lt,nt,It,Nt,Ut,Jt,xi,Di;return It=fn(xe-this.long0),lt=k(Ae),nt=B(Ae),Nt=B(It),Jt=this.sin_p14*lt+this.cos_p14*nt*Nt,Ut=1,(0=z-Pt/2?rn.TOP:this.lat0<=-(z-Pt/2)?rn.BOTTOM:n(this.long0)<=Pt?rn.FRONT:n(this.long0)<=z+Pt?0=Pt&&nt<=z+Pt?(Ae.value=Qa.AREA_0,It=nt-z):nt>z+Pt||nt<=-(z+Pt)?(Ae.value=Qa.AREA_1,It=0-(z+Pt)&&nt<=-Pt?(Ae.value=Qa.AREA_2,It=nt+z):(Ae.value=Qa.AREA_3,It=nt);else if(this.face===rn.BOTTOM)Nt=z+lt,nt>=Pt&&nt<=z+Pt?(Ae.value=Qa.AREA_0,It=-nt+z):nt=-Pt?(Ae.value=Qa.AREA_1,It=-nt):nt<-Pt&&nt>=-(z+Pt)?(Ae.value=Qa.AREA_2,It=-nt-z):(Ae.value=Qa.AREA_3,It=0=n(te.y)?Ae.value=Qa.AREA_0:0<=te.y&&te.y>=n(te.x)?(Ae.value=Qa.AREA_1,lt-=z):0>te.x&&-te.x>=n(te.y)?(Ae.value=Qa.AREA_2,lt=0>lt?lt+Qi:lt-Qi):(Ae.value=Qa.AREA_3,lt+=z),ki=Qi/12*L(lt),Ut=k(ki)/(B(ki)-1/$(2)),Jt=I(Ut),It=B(lt),Nt=L(nt),xi=1-It*It*Nt*Nt*(1-B(I(1/B(Jt)))),-1>xi?xi=-1:1Jt?Jt+Qi:Jt-Qi:Ae.value===Qa.AREA_2?Jt-z:Jt;else if(this.face===rn.BOTTOM)Di=p(xi),xe.phi=Di-z,xe.lam=Ae.value===Qa.AREA_0?-Jt+z:Ae.value===Qa.AREA_1?-Jt:Ae.value===Qa.AREA_2?-Jt-z:0>Jt?-Jt-Qi:-Jt+Qi;else{var ir,$r,mn;ir=xi,ki=ir*ir,mn=1<=ki?0:$(1-ki)*k(Jt),ki+=mn*mn,$r=1<=ki?0:$(1-ki),Ae.value===Qa.AREA_1?(ki=$r,$r=-mn,mn=ki):Ae.value===Qa.AREA_2?($r=-$r,mn=-mn):Ae.value===Qa.AREA_3&&(ki=$r,$r=mn,mn=-ki),this.face===rn.RIGHT?(ki=ir,ir=-$r,$r=ki):this.face===rn.BACK?(ir=-ir,$r=-$r):this.face===rn.LEFT&&(ki=ir,ir=$r,$r=-ki),xe.phi=p(-mn)-z,xe.lam=v($r,ir),this.face===rn.RIGHT?xe.lam=wi(xe.lam,-z):this.face===rn.BACK?xe.lam=wi(xe.lam,-Qi):this.face===rn.LEFT&&(xe.lam=wi(xe.lam,+z))}if(this.es!==0){var Kr,xn,Gn;Kr=0>xe.phi?1:0,xn=L(xe.phi),Gn=this.b/$(xn*xn+this.one_minus_f_squared),xe.phi=I($(this.a*this.a-Gn*Gn)/(this.one_minus_f*Gn)),Kr&&(xe.phi=-xe.phi)}return xe.lam+=this.long0,te.x=xe.lam,te.y=xe.phi,te},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ve=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],oe=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ce=.8487,we=1.3523,He=yn/5,St=function(te,xe){return te[0]+xe*(te[1]+xe*(te[2]+xe*te[3]))},ut=function(te,xe){return te[1]+xe*(2*te[2]+3*xe*te[3])},Bt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(te){var xe=fn(te.x-this.long0),Ae=n(te.y),lt=t(Ae*He);0>lt?lt=0:18<=lt&&(lt=17),Ae=yn*(Ae-1/He*lt);var nt={x:St(ve[lt],Ae)*xe,y:St(oe[lt],Ae)};return 0>te.y&&(nt.y=-nt.y),nt.x=nt.x*this.a*ce+this.x0,nt.y=nt.y*this.a*we+this.y0,nt},inverse:function(te){var xe={x:(te.x-this.x0)/(this.a*ce),y:n(te.y-this.y0)/(this.a*we)};if(1<=xe.y)xe.x/=ve[18][0],xe.y=0>te.y?-z:z;else{var Ae=t(18*xe.y);for(0>Ae?Ae=0:18<=Ae&&(Ae=17);;)if(oe[Ae][0]>xe.y)--Ae;else if(oe[Ae+1][0]<=xe.y)++Ae;else break;var lt=oe[Ae],nt=5*(xe.y-lt[0])/(oe[Ae+1][0]-lt[0]);nt=pi(function(It){return(St(lt,It)-xe.y)/ut(lt,It)},nt,Dt,100),xe.x/=St(ve[Ae],nt),xe.y=(5*Ae+nt)*Mn,0>te.y&&(xe.y=-xe.y)}return xe.x=fn(xe.x+this.long0),xe},names:["Robinson","robin"]},Ge={init:function(){this.name="geocent"},forward:function(te){var xe=ie(te,this.es,this.a);return xe},inverse:function(te){var xe=ge(te,this.es,this.a,this.b);return xe},names:["Geocentric","geocentric","geocent","Geocent"]},et={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},zt={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},ii={init:function(){if(Object.keys(zt).forEach(function(Ae){if(typeof this[Ae]>"u")this[Ae]=zt[Ae].def;else{if(zt[Ae].num&&isNaN(this[Ae]))throw new Error("Invalid parameter value, must be numeric "+Ae+" = "+this[Ae]);zt[Ae].num&&(this[Ae]=parseFloat(this[Ae]))}zt[Ae].degrees&&(this[Ae]*=Mn)}.bind(this)),n(n(this.lat0)-z)this.lat0?et.S_POLE:et.N_POLE:n(this.lat0)=this.pn1||1e10 */var m=l("buffer"),v=m.Buffer;v.from&&v.alloc&&v.allocUnsafe&&v.allocUnsafeSlow?u.exports=m:(h(m,c),c.Buffer=p),p.prototype=Object.create(v.prototype),h(v,p),p.from=function(w,S,I){if(typeof w=="number")throw new TypeError("Argument must not be a number");return v(w,S,I)},p.alloc=function(w,S,I){if(typeof w!="number")throw new TypeError("Argument must be a number");var R=v(w);return S===void 0?R.fill(0):typeof I=="string"?R.fill(S,I):R.fill(S),R},p.allocUnsafe=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return v(w)},p.allocUnsafeSlow=function(w){if(typeof w!="number")throw new TypeError("Argument must be a number");return m.SlowBuffer(w)}},{buffer:8}],19:[function(l,u,c){function h(Q){if(!Q)return"utf8";for(var re;;)switch(Q){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return Q;default:if(re)return;Q=(""+Q).toLowerCase(),re=!0}}function p(Q){var re=h(Q);if(typeof re!="string"&&(Y.isEncoding===K||!K(Q)))throw new Error("Unknown encoding: "+Q);return re||Q}function m(Q){this.encoding=p(Q);var re;switch(this.encoding){case"utf16le":this.text=R,this.end=L,re=4;break;case"utf8":this.fillLast=I,re=4;break;case"base64":this.text=k,this.end=B,re=3;break;default:return this.write=$,void(this.end=V)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(re)}function v(Q){return 127>=Q?0:Q>>5==6?2:Q>>4==14?3:Q>>3==30?4:Q>>6==2?-1:-2}function w(Q,re,ne){var de=re.length-1;if(de=de)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1],ne.slice(0,-1)}return ne}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Q[Q.length-1],Q.toString("utf16le",re,Q.length-1)}function L(Q){var re=Q&&Q.length?this.write(Q):"";if(this.lastNeed){var ne=this.lastTotal-this.lastNeed;return re+this.lastChar.toString("utf16le",0,ne)}return re}function k(Q,re){var ne=(Q.length-re)%3;return ne==0?Q.toString("base64",re):(this.lastNeed=3-ne,this.lastTotal=3,ne==1?this.lastChar[0]=Q[Q.length-1]:(this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1]),Q.toString("base64",re,Q.length-ne))}function B(Q){var re=Q&&Q.length?this.write(Q):"";return this.lastNeed?re+this.lastChar.toString("base64",0,3-this.lastNeed):re}function $(Q){return Q.toString(this.encoding)}function V(Q){return Q&&Q.length?this.write(Q):""}var Y=l("safe-buffer").Buffer,K=Y.isEncoding||function(Q){switch(Q=""+Q,Q&&Q.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=m,m.prototype.write=function(Q){if(Q.length===0)return"";var re,ne;if(this.lastNeed){if(re=this.fillLast(Q),re===void 0)return"";ne=this.lastNeed,this.lastNeed=0}else ne=0;return ne_t||57343<_t)Ht.push(_t);else if(56320<=_t&&57343>=_t)Ht.push(65533);else if(55296<=_t&&56319>=_t)if(ht===Me-1)Ht.push(65533);else{var Fe=rt.charCodeAt(ht+1);56320<=Fe&&57343>=Fe?(Ht.push(65536+((1023&_t)<<10)+(1023&Fe)),ht+=1):Ht.push(65533)}ht+=1}return Ht}function w(je){for(var rt="",Me=0,ht;Me=ht?rt+=o(ht):(ht-=65536,rt+=o((ht>>10)+55296,(1023&ht)+56320));return rt}function S(je){return 0<=je&&127>=je}function I(je){this.tokens=[].slice.call(je),this.tokens.reverse()}function R(je,rt){if(je)throw TypeError("Decoder error");return rt||65533}function L(je){throw TypeError("The code point "+je+" could not be encoded.")}function k(je){return je=(je+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ke,je)?Ke[je]:null}function B(je,rt){return rt&&rt[je]||null}function $(je,rt){var Me=rt.indexOf(je);return Me===-1?null:Me}function V(je){if(!("encoding-indexes"in c))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return c["encoding-indexes"][je]}function Y(je){if(39419je||1237575>6*ht)+Ht];0>6*(ht-1);_t.push(128|63&Fe),ht-=1}return _t}}function Z(je,rt){var Me=rt.fatal;this.handler=function(ht,Ht){if(Ht===-1)return-1;if(S(Ht))return Ht;var _t=je[Ht-128];return _t===null?R(Me):_t}}function ae(je,rt){rt.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(st(ht))return ht;var Ht=$(ht,je);return Ht===null&&L(ht),Ht+128}}function fe(je){var rt=je.fatal,Me=0,ht=0,Ht=0;this.handler=function(_t,Fe){if(Fe===-1&&Me===0&&ht===0&&Ht===0)return-1;Fe===-1&&(Me!==0||ht!==0||Ht!==0)&&(Me=0,ht=0,Ht=0,R(rt));var Yt;if(Ht!==0){Yt=null,h(Fe,48,57)&&(Yt=Y(10*(126*(10*(Me-129)+ht-48)+Ht-129)+Fe-48));var A=[ht,Ht,Fe];return Me=0,ht=0,Ht=0,Yt===null?(_t.prepend(A),R(rt)):Yt}if(ht!==0)return h(Fe,129,254)?(Ht=Fe,null):(_t.prepend([ht,Fe]),Me=0,ht=0,R(rt));if(Me!==0){if(h(Fe,48,57))return ht=Fe,null;var ue=Me,G=null;Me=0;var E=127>Fe?64:65;return(h(Fe,64,126)||h(Fe,128,254))&&(G=190*(ue-129)+(Fe-E)),Yt=G===null?null:B(G,V("gb18030")),Yt===null&&S(Fe)&&_t.prepend(Fe),Yt===null?R(rt):Yt}return S(Fe)?Fe:Fe===128?8364:h(Fe,129,254)?(Me=Fe,null):R(rt)}}function be(je,rt){je.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(st(ht))return ht;if(ht===58853)return L(ht);if(rt&&ht===8364)return 128;var Ht=$(ht,V("gb18030"));if(Ht!==null){var _t=ct(Ht/190)+129,Fe=Ht%190,Yt=63>Fe?64:65;return[_t,Fe+Yt]}if(rt)return L(ht);Ht=K(ht);var A=ct(Ht/10/126/10);Ht-=10*(126*(10*A));var ue=ct(Ht/10/126);Ht-=126*(10*ue);var G=ct(Ht/10),E=Ht-10*G;return[A+129,ue+48,G+129,E+48]}}function _e(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0;var Yt=127>Ht?64:98;switch((h(Ht,64,126)||h(Ht,161,254))&&(Fe=157*(_t-129)+(Ht-Yt)),Fe){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var A=Fe===null?null:B(Fe,V("big5"));return A===null&&S(Ht)&&ht.prepend(Ht),A===null?R(rt):A}return S(Ht)?Ht:h(Ht,129,254)?(Me=Ht,null):R(rt)}}function Ie(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;var ht=re(Me);if(ht===null)return L(Me);var Ht=ct(ht/157)+129;if(161>Ht)return L(Me);var _t=ht%157,Fe=63>_t?64:98;return[Ht,_t+Fe]}}function Te(je){var rt=je.fatal,Me=!1,ht=0;this.handler=function(Ht,_t){if(_t===-1&&ht!==0)return ht=0,R(rt);if(_t===-1&&ht===0)return-1;if(ht===142&&h(_t,161,223))return ht=0,65216+_t;if(ht===143&&h(_t,161,254))return Me=!0,ht=_t,null;if(ht!==0){var Fe=ht;ht=0;var Yt=null;return h(Fe,161,254)&&h(_t,161,254)&&(Yt=B(94*(Fe-161)+(_t-161),V(Me?"jis0212":"jis0208"))),Me=!1,h(_t,161,254)||Ht.prepend(_t),Yt===null?R(rt):Yt}return S(_t)?_t:_t===142||_t===143||h(_t,161,254)?(ht=_t,null):R(rt)}}function Be(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;if(Me===165)return 92;if(Me===8254)return 126;if(h(Me,65377,65439))return[142,Me-65377+161];Me===8722&&(Me=65293);var ht=$(Me,V("jis0208"));if(ht===null)return L(Me);var Ht=ct(ht/94)+161;return[Ht,ht%94+161]}}function Ve(je){var rt=je.fatal,Me={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},ht=Me.ASCII,Ht=Me.ASCII,_t=0,Fe=!1;this.handler=function(Yt,A){switch(ht){default:case Me.ASCII:return A===27?(ht=Me.EscapeStart,null):h(A,0,127)&&A!==14&&A!==15&&A!==27?(Fe=!1,A):A===-1?-1:(Fe=!1,R(rt));case Me.Roman:return A===27?(ht=Me.EscapeStart,null):A===92?(Fe=!1,165):A===126?(Fe=!1,8254):h(A,0,127)&&A!==14&&A!==15&&A!==27&&A!==92&&A!==126?(Fe=!1,A):A===-1?-1:(Fe=!1,R(rt));case Me.Katakana:return A===27?(ht=Me.EscapeStart,null):h(A,33,95)?(Fe=!1,65344+A):A===-1?-1:(Fe=!1,R(rt));case Me.LeadByte:return A===27?(ht=Me.EscapeStart,null):h(A,33,126)?(Fe=!1,_t=A,ht=Me.TrailByte,null):A===-1?-1:(Fe=!1,R(rt));case Me.TrailByte:if(A===27)return ht=Me.EscapeStart,R(rt);if(h(A,33,126)){ht=Me.LeadByte;var ue=94*(_t-33)+A-33,G=B(ue,V("jis0208"));return G===null?R(rt):G}return A===-1?(ht=Me.LeadByte,Yt.prepend(A),R(rt)):(ht=Me.LeadByte,R(rt));case Me.EscapeStart:return A===36||A===40?(_t=A,ht=Me.Escape,null):(Yt.prepend(A),Fe=!1,ht=Ht,R(rt));case Me.Escape:var E=_t;_t=0;var _=null;if(E===40&&A===66&&(_=Me.ASCII),E===40&&A===74&&(_=Me.Roman),E===40&&A===73&&(_=Me.Katakana),E===36&&(A===64||A===66)&&(_=Me.LeadByte),_!==null){ht=ht=_;var g=Fe;return Fe=!0,g?R(rt):null}return Yt.prepend([E,A]),Fe=!1,ht=Ht,R(rt)}}}function $e(je){je.fatal;var rt={ASCII:0,Roman:1,jis0208:2},Me=rt.ASCII;this.handler=function(ht,Ht){if(Ht===-1&&Me!==rt.ASCII)return ht.prepend(Ht),Me=rt.ASCII,[27,40,66];if(Ht===-1&&Me===rt.ASCII)return-1;if((Me===rt.ASCII||Me===rt.Roman)&&(Ht===14||Ht===15||Ht===27))return L(65533);if(Me===rt.ASCII&&st(Ht))return Ht;if(Me===rt.Roman&&(st(Ht)&&Ht!==92&&Ht!==126||Ht==165||Ht==8254)){if(st(Ht))return Ht;if(Ht===165)return 92;if(Ht===8254)return 126}if(st(Ht)&&Me!==rt.ASCII)return ht.prepend(Ht),Me=rt.ASCII,[27,40,66];if((Ht===165||Ht===8254)&&Me!==rt.Roman)return ht.prepend(Ht),Me=rt.Roman,[27,40,74];Ht===8722&&(Ht=65293);var _t=$(Ht,V("jis0208"));if(_t===null)return L(Ht);if(Me!==rt.jis0208)return ht.prepend(Ht),Me=rt.jis0208,[27,36,66];var Fe=ct(_t/94)+33;return[Fe,_t%94+33]}}function tt(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0;var Yt=127>Ht?64:65,A=160>_t?129:193;if((h(Ht,64,126)||h(Ht,128,252))&&(Fe=188*(_t-A)+Ht-Yt),h(Fe,8836,10715))return 48508+Fe;var ue=Fe===null?null:B(Fe,V("jis0208"));return ue===null&&S(Ht)&&ht.prepend(Ht),ue===null?R(rt):ue}return S(Ht)||Ht===128?Ht:h(Ht,161,223)?65216+Ht:h(Ht,129,159)||h(Ht,224,252)?(Me=Ht,null):R(rt)}}function yt(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me)||Me===128)return Me;if(Me===165)return 92;if(Me===8254)return 126;if(h(Me,65377,65439))return Me-65377+161;Me===8722&&(Me=65293);var ht=Q(Me);if(ht===null)return L(Me);var Ht=ct(ht/188),_t=31>Ht?129:193,Fe=ht%188,Yt=63>Fe?64:65;return[Ht+_t,Fe+Yt]}}function Ct(je){var rt=je.fatal,Me=0;this.handler=function(ht,Ht){if(Ht===-1&&Me!==0)return Me=0,R(rt);if(Ht===-1&&Me===0)return-1;if(Me!==0){var _t=Me,Fe=null;Me=0,h(Ht,65,254)&&(Fe=190*(_t-129)+(Ht-65));var Yt=Fe===null?null:B(Fe,V("euc-kr"));return Fe===null&&S(Ht)&&ht.prepend(Ht),Yt===null?R(rt):Yt}return S(Ht)?Ht:h(Ht,129,254)?(Me=Ht,null):R(rt)}}function ot(je){je.fatal,this.handler=function(rt,Me){if(Me===-1)return-1;if(st(Me))return Me;var ht=$(Me,V("euc-kr"));if(ht===null)return L(Me);var Ht=ct(ht/190)+129;return[Ht,ht%190+65]}}function vt(je,rt){var Me=je>>8,ht=255&je;return rt?[Me,ht]:[ht,Me]}function At(je,rt){var Me=rt.fatal,ht=null,Ht=null;this.handler=function(_t,Fe){if(Fe===-1&&(ht!==null||Ht!==null))return R(Me);if(Fe===-1&&ht===null&&Ht===null)return-1;if(ht===null)return ht=Fe,null;var Yt;if(Yt=je?(ht<<8)+Fe:(Fe<<8)+ht,ht=null,Ht!==null){var A=Ht;return Ht=null,h(Yt,56320,57343)?65536+1024*(A-55296)+(Yt-56320):(_t.prepend(vt(Yt,je)),R(Me))}return h(Yt,55296,56319)?(Ht=Yt,null):h(Yt,56320,57343)?R(Me):Yt}}function Je(je,rt){rt.fatal,this.handler=function(Me,ht){if(ht===-1)return-1;if(h(ht,0,65535))return vt(ht,je);var Ht=vt((ht-65536>>10)+55296,je),_t=vt((1023&ht-65536)+56320,je);return Ht.concat(_t)}}function it(je){je.fatal,this.handler=function(rt,Me){return Me===-1?-1:S(Me)?Me:63360+Me-128}}function Ue(je){je.fatal,this.handler=function(rt,Me){return Me===-1?-1:st(Me)?Me:h(Me,63360,63487)?Me-63360+128:L(Me)}}typeof u<"u"&&u.exports&&!c["encoding-indexes"]&&l("./encoding-indexes.js");var ct=t,st=S,Ze=-1;I.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Ze},prepend:function(je){if(Array.isArray(je))for(var rt=je;rt.length;)this.tokens.push(rt.pop());else this.tokens.push(je)},push:function(je){if(Array.isArray(je))for(var rt=je;rt.length;)this.tokens.unshift(rt.shift());else this.tokens.unshift(je)}};var ye=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Ke={};ye.forEach(function(je){je.encodings.forEach(function(rt){rt.labels.forEach(function(Me){Ke[Me]=rt})})});var ke={},me={},ie,ge;Object.defineProperty&&(Object.defineProperty(ne.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(ne.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(ne.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),ne.prototype.decode=function(je,rt){var Me;Me=typeof je=="object"&&je instanceof ArrayBuffer?new Uint8Array(je):typeof je=="object"&&"buffer"in je&&je.buffer instanceof ArrayBuffer?new Uint8Array(je.buffer,je.byteOffset,je.byteLength):new Uint8Array(0),rt=m(rt),this._do_not_flush||(this._decoder=me[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=!!rt.stream;for(var ht=new I(Me),Ht=[],_t,Fe;Fe=ht.read(),Fe!==Ze&&(_t=this._decoder.handler(ht,Fe),_t!==-1);)_t!==null&&(Array.isArray(_t)?Ht.push.apply(Ht,_t):Ht.push(_t));if(!this._do_not_flush){do{if(_t=this._decoder.handler(ht,ht.read()),_t===-1)break;_t!==null&&(Array.isArray(_t)?Ht.push.apply(Ht,_t):Ht.push(_t))}while(!ht.endOfStream());this._decoder=null}return function(Yt){return!p(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(0arguments.length)&&S.call(arguments,1);return I[k]=!0,v(function(){I[k]&&(B?L.apply(null,B):L.call(null),c.clearImmediate(k))}),k},c.clearImmediate=typeof p=="function"?p:function(L){delete I[L]}}).call(this)}).call(this,l("timers").setImmediate,l("timers").clearImmediate)},{"process/browser.js":16,timers:22}],23:[function(l,u){(function(c){(function(){function h(ne){if(!ne)throw new Error("forgot to pass buffer");return $.isBuffer(ne)?ne:p(ne)?$.from(ne):p(ne.buffer)?ne.BYTES_PER_ELEMENT===1?$.from(ne):$.from(ne.buffer):void 0}function p(ne){return ne instanceof c.ArrayBuffer||Object.prototype.toString.call(ne)==="[object ArrayBuffer]"}function m(ne,de){return typeof ne=="string"&&Y.has(ne)?k.resolve(Y.get(ne)):m.getShapefile(ne,de).then(function(pe){return typeof ne=="string"&&Y.set(ne,pe),pe})}async function v(ne,de){const pe=await I(ne);return m.parseZip(pe,de)}let w=l("proj4");w.default&&(w=w.default);const S=l("./unzip"),I=l("./binaryajax"),R=l("./parseShp"),L=l("parsedbf"),k=l("lie"),B=l("lru-cache"),$=l("buffer").Buffer,V=c.URL,Y=new B({max:20});m.combine=function([ne,de]){const pe={type:"FeatureCollection",features:[]};let H=0;const Z=ne.length;for(de||(de=[]);H{const de=await k.all([I(ne,"shp"),I(ne,"prj")]);let pe=!1;try{de[1]&&(pe=w(de[1]))}catch{pe=!1}return R(de[0],pe)},Q=async ne=>{const[de,pe]=await k.all([I(ne,"dbf"),I(ne,"cpg")]);return de?L(de,pe):void 0},re=(ne,de)=>new V(ne).pathname.slice(-4).toLowerCase()===de;m.getShapefile=async function(ne,de){if(typeof ne!="string")return m.parseZip(ne);if(re(ne,".zip"))return v(ne,de);const pe=await k.all([K(ne),Q(ne)]);return m.combine(pe)},m.parseShp=function(ne,de){if(ne=h(ne),$.isBuffer(de)&&(de=de.toString()),typeof de=="string")try{de=w(de)}catch{de=!1}return R(ne,de)},m.parseDbf=function(ne,de){return ne=h(ne),L(ne,de)},u.exports=m}).call(this)}).call(this,typeof Hh>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:Hh)},{"./binaryajax":2,"./parseShp":4,"./unzip":5,buffer:8,lie:12,"lru-cache":13,parsedbf:15,proj4:17}]},{},[23])(23)})})(B6t);var XFr=B6t.exports;const JFr=X3(XFr),KFr={Point:"circlePoint",MultiPoint:"circlePoint",LineString:"solidLine",MultiLineString:"solidLine",Polygon:"outlinedPoly",MultiPolygon:"outlinedPoly"};function ZFr(i){if(i.type!=="FeatureCollection")throw new Error("GeoJSON is not in FeatureCollection format");let e=!0,t=!0;for(let r=0;rr.indexOf(" ")>-1;e.fields?.forEach(r=>{if(r.name&&t(r.name)){const n=r.name;let s,o="_",a;do s=n.replace(/ /g,o),a=e.fields?.find(l=>l.name===s),a&&(o+="_");while(a);r.alias=n,r.name=s;for(let l=0;ln.coordinates);i.features[e].geometry={type:`Multi${t[0].type}`,coordinates:r}}}function tkr(i){return i==="MultiLineString"?"LineString":i==="MultiPolygon"?"Polygon":i}class ikr extends tf{async fetchFileData(e,t){const r=await bP.get(e,{responseType:"arrayBuffer"});switch(t){case pn.GEOJSON:case pn.DATAJSON:return JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r.data)));case pn.SHAPEFILE:return r.data;case pn.CSV:case pn.DATACSV:return new TextDecoder("utf-8").decode(new Uint8Array(r.data));default:console.error(`Unsupported file type passed to fetchFileData- '${t}'`)}}extractGeoJsonFields(e){if(e.features.length<1)throw new Error("GeoJSON field extraction requires at least one feature");let t="";for(let o=0;o({name:o,type:"string"}));let n=0;const s=Object.keys(e.features[0].properties);for(;ns.includes(a)).forEach(a=>{const l=o.properties[a];if(l!=null){const u=r.findIndex(c=>c.name===a);r[u]={name:a,type:this.inferType(l)},s.splice(s.indexOf(a),1)}}),s.length===0)break;n++}return r}extractCsvFields(e,t=","){return hOe.dsv.dsvFormat(t).parseRows(e)[0].map(n=>({name:n,type:j1.STRING}))}filterCsvLatLonFields(e,t=","){const r=hOe.dsv.dsvFormat(t).parseRows(e),n=r[0],s={lat:JSON.parse(JSON.stringify(n)),lon:JSON.parse(JSON.stringify(n))};for(let o=0;o90)&&u!==-1&&s.lat.splice(u,1),(isNaN(l)||l<-180||l>180)&&c!==-1&&s.lon.splice(c,1),u===-1&&c===-1)break}return s}async geoJsonToEsriJson(e,t){let r,n="EPSG:4326",s;const o={objectIdField:"OBJECTID",fields:[{name:"OBJECTID",type:j1.OID}]};ZFr(e);const a=e.features[0].geometry.type,l=KFr[a],u=JSON.parse(JSON.stringify(xFr[l]));if(e.crs&&e.crs.type==="name"&&(n=e.crs.properties.name),t){if(t.sourceProjection&&(n=t.sourceProjection),t.targetSR)r=t.targetSR;else throw new Error("geoJsonToEsriJson - missing opts.targetSR arguement");t.layerId?s=t.layerId:s=this.$iApi.geo.shared.generateUUID(),t.colour&&(u.renderer.symbol.color=new bR(t.colour).toArcServer())}else throw new Error("geoJsonToEsriJson - missing opts arguement");o.renderer=_x.fromJSON(u.renderer),o.fields=(o.fields||[]).concat(t.fieldMetadata?.exclusiveFields?this.extractGeoJsonFields(e).filter(v=>t.fieldMetadata?.fieldInfo?.find(w=>w.name===v.name)):this.extractGeoJsonFields(e)),t.fieldMetadata?.enforceOrder&&t.fieldMetadata?.fieldInfo&&t.fieldMetadata?.fieldInfo.length>0&&(o.fields=this.$iApi.geo.attributes.orderFields(o.fields,t.fieldMetadata?.fieldInfo)),QFr(e,o);const c=this.$iApi.geo.proj.normalizeProj(r);if(t){if(t.latField){const v=o.fields.find(w=>w.name===t.latField||w.alias===t.latField);v&&(v.type=j1.DOUBLE)}if(t.lonField){const v=o.fields.find(w=>w.name===t.lonField||w.alias===t.lonField);v&&(v.type=j1.DOUBLE)}}await this.$iApi.geo.proj.checkProjBomber([n,r]);const h=new Xi(r);await this.$iApi.geo.proj.projectGeoJson(e,n,c);const p=TFr.convert(e,{sr:8888});o.geometryType=this.$iApi.geo.geom.geoJsonGeomTypeToEsriGeomType(a);const m=o.fields.map(v=>v.name);for(let v=0;v{m.includes(S)?(Array.isArray(w.attributes[S])||typeof w.attributes[S]=="object")&&w.attributes[S]!=null&&(w.attributes[S]=JSON.stringify(w.attributes[S])):delete w.attributes[S]})}return o.source=p,o.spatialReference=h,o.id=s,o}async csvToGeoJson(e,t){const r={latfield:"Lat",lonfield:"Long",delimiter:","};return t&&(t.latfield&&(r.latfield=t.latfield),t.lonfield&&(r.lonfield=t.lonfield),t.delimiter&&(r.delimiter=t.delimiter)),new Promise((n,s)=>{hOe.csv2geojson(e,r,(o,a)=>{o?(console.error("csv conversion error"),console.error(o),s(o)):(a.features.map(l=>{l.properties[r.lonfield]=l.geometry.coordinates[0],l.properties[r.latfield]=l.geometry.coordinates[1]}),n(a))})})}async shapefileToGeoJson(e){return JFr(e)}inferType(e){return typeof e=="number"?j1.DOUBLE:j1.STRING}rawDataJsonParser(e,t=!1){let r;return typeof e=="string"?r=JSON.parse(e):t?r=structuredClone(e):r=e,r}}const rkr=[4326,4269,4258,31467,31468,31469,2166,2167,2168,2036,2044,2045,2065,2081,2082,2083,2085,2086,2091,2092,2093,2096,2097,2098,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2193,2199,2200,2206,2207,2208,2209,2210,2211,2212,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2935,2936,2937,2938,2939,2940,2941,2953,2963,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3034,3035,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3058,3059,3068,3114,3115,3116,3117,3118,3120,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3146,3147,3150,3151,3152,3300,3301,3328,3329,3330,3331,3332,3333,3334,3335,3346,3350,3351,3352,3366,3386,3387,3388,3389,3390,3396,3397,3398,3399,3407,3414,3416,3764,3788,3789,3790,3791,3793,3795,3796,3819,3821,3823,3824,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3851,3852,3854,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3888,3889,3906,3907,3908,3909,3910,3911,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4040,4041,4042,4043,4044,4045,4046,4047,4052,4053,4054,4055,4074,4075,4080,4081,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4178,4179,4180,4181,4182,4183,4184,4185,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4322,4324,4327,4329,4339,4341,4343,4345,4347,4349,4351,4353,4355,4357,4359,4361,4363,4365,4367,4369,4371,4373,4375,4377,4379,4381,4383,4386,4388,4417,4434,4463,4466,4469,4470,4472,4475,4480,4482,4483,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4557,4558,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4839,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4883,4885,4887,4889,4891,4893,4895,4898,4900,4901,4902,4903,4904,4907,4909,4921,4923,4925,4927,4929,4931,4933,4935,4937,4939,4941,4943,4945,4947,4949,4951,4953,4955,4957,4959,4961,4963,4965,4967,4969,4971,4973,4975,4977,4979,4981,4983,4985,4987,4989,4991,4993,4995,4997,4999,5012,5013,5017,5048,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5132,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5224,5228,5229,5233,5245,5246,5251,5252,5253,5254,5255,5256,5257,5258,5259,5263,5264,5269,5270,5271,5272,5273,5274,5275,5801,5802,5803,5804,5808,5809,5810,5811,5812,5813,5814,5815,5816,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,20092,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21453,21454,21455,21456,21457,21458,21459,21460,21461,21462,21463,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21896,21897,21898,21899,22171,22172,22173,22174,22175,22176,22177,22181,22182,22183,22184,22185,22186,22187,22191,22192,22193,22194,22195,22196,22197,25884,27205,27206,27207,27208,27209,27210,27211,27212,27213,27214,27215,27216,27217,27218,27219,27220,27221,27222,27223,27224,27225,27226,27227,27228,27229,27230,27231,27232,27391,27392,27393,27394,27395,27396,27397,27398,27492,28402,28403,28404,28405,28406,28407,28408,28409,28410,28411,28412,28413,28414,28415,28416,28417,28418,28419,28420,28421,28422,28423,28424,28425,28426,28427,28428,28429,28430,28431,28432,28462,28463,28464,28465,28466,28467,28468,28469,28470,28471,28472,28473,28474,28475,28476,28477,28478,28479,28480,28481,28482,28483,28484,28485,28486,28487,28488,28489,28490,28491,28492,29701,29702,30161,30162,30163,30164,30165,30166,30167,30168,30169,30170,30171,30172,30173,30174,30175,30176,30177,30178,30179,30800,31251,31252,31253,31254,31255,31256,31257,31258,31259,31275,31276,31277,31278,31279,31281,31282,31283,31284,31285,31286,31287,31288,31289,31290,31466,31700];function _k(i,e){return i.then(function(t){return[null,t]}).catch(function(t){return[t,void 0]})}var OYe={},TTe={};(function(i){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+t+"]*",n=new RegExp("^"+r+"$"),s=function(a,l){const u=[];let c=l.exec(a);for(;c;){const h=[];h.startIndex=l.lastIndex-c[0].length;const p=c.length;for(let m=0;m"u")};i.isExist=function(a){return typeof a<"u"},i.isEmptyObject=function(a){return Object.keys(a).length===0},i.merge=function(a,l,u){if(l){const c=Object.keys(l),h=c.length;for(let p=0;p"&&i[s]!==" "&&i[s]!==" "&&i[s]!==` +`&&i[s]!=="\r";s++)l+=i[s];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),s--),!dkr(l)){let h;return l.trim().length===0?h="Invalid space after '<'.":h="Tag '"+l+"' is an invalid name.",sm("InvalidTag",h,j_(i,s))}const u=akr(i,s);if(u===!1)return sm("InvalidAttr","Attributes for '"+l+"' have open quote.",j_(i,s));let c=u.value;if(s=u.index,c[c.length-1]==="/"){const h=s-c.length;c=c.substring(0,c.length-1);const p=tdt(c,e);if(p===!0)r=!0;else return sm(p.err.code,p.err.msg,j_(i,h+p.err.line))}else if(a)if(u.tagClosed){if(c.trim().length>0)return sm("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",j_(i,o));{const h=t.pop();if(l!==h.tagName){let p=j_(i,h.tagStartPos);return sm("InvalidTag","Expected closing tag '"+h.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+l+"'.",j_(i,o))}t.length==0&&(n=!0)}}else return sm("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",j_(i,s));else{const h=tdt(c,e);if(h!==!0)return sm(h.err.code,h.err.msg,j_(i,s-c.length+h.err.line));if(n===!0)return sm("InvalidXml","Multiple possible root nodes found.",j_(i,s));e.unpairedTags.indexOf(l)!==-1||t.push({tagName:l,tagStartPos:o}),r=!0}for(s++;s0)return sm("InvalidXml","Invalid '"+JSON.stringify(t.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return sm("InvalidXml","Start tag expected.",1);return!0};function Zht(i){return i===" "||i===" "||i===` +`||i==="\r"}function Qht(i,e){const t=e;for(;e5&&r==="xml")return sm("InvalidXml","XML declaration allowed only at the start of the document.",j_(i,e));if(i[e]=="?"&&i[e+1]==">"){e++;break}else continue}return e}function edt(i,e){if(i.length>e+5&&i[e+1]==="-"&&i[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(i.length>e+8&&i[e+1]==="D"&&i[e+2]==="O"&&i[e+3]==="C"&&i[e+4]==="T"&&i[e+5]==="Y"&&i[e+6]==="P"&&i[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(i.length>e+9&&i[e+1]==="["&&i[e+2]==="C"&&i[e+3]==="D"&&i[e+4]==="A"&&i[e+5]==="T"&&i[e+6]==="A"&&i[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const skr='"',okr="'";function akr(i,e){let t="",r="",n=!1;for(;e"&&r===""){n=!0;break}t+=i[e]}return r!==""?!1:{value:t,index:e,tagClosed:n}}const lkr=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function tdt(i,e){const t=PYe.getAllMatches(i,lkr),r={};for(let n=0;n!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(i,e,t){return i}},pkr=function(i){return Object.assign({},j6t,i)};RYe.buildOptions=pkr;RYe.defaultOptions=j6t;class fkr{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var mkr=fkr;const gkr=TTe;function ykr(i,e){const t={};if(i[e+3]==="O"&&i[e+4]==="C"&&i[e+5]==="T"&&i[e+6]==="Y"&&i[e+7]==="P"&&i[e+8]==="E"){e=e+9;let r=1,n=!1,s=!1,o="";for(;e"){if(s?i[e-1]==="-"&&i[e-2]==="-"&&(s=!1,r--):r--,r===0)break}else i[e]==="["?n=!0:o+=i[e];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function vkr(i,e){let t="";for(;e0&&n&&t[2]!==".")return i;if(!e.leadingZeros&&s.length>0&&!n&&t[1]!==".")return i;{const l=Number(t),u=""+l;return u.search(/[eE]/)!==-1||a?e.eNotation?l:i:t.indexOf(".")!==-1?u==="0"&&o===""||u===o||n&&u==="-"+o?l:i:s?o===u||n+o===u?l:i:t===u||t===n+u?l:i}}else return i}}function Okr(i){return i&&i.indexOf(".")!==-1&&(i=i.replace(/0+$/,""),i==="."?i="0":i[0]==="."?i="0"+i:i[i.length-1]==="."&&(i=i.substr(0,i.length-1))),i}var Pkr=Mkr;const DYe=TTe,tK=mkr,Rkr=Ckr,Dkr=Pkr;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,DYe.nameRegexp);let Fkr=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=kkr,this.parseXml=jkr,this.parseTextData=Lkr,this.resolveNameSpace=Nkr,this.buildAttributesMap=Bkr,this.isItStopNode=Vkr,this.replaceEntitiesValue=Ukr,this.readStopNodeData=Wkr,this.saveTextToParentTag=zkr,this.addChild=Gkr}};function kkr(i){const e=Object.keys(i);for(let t=0;t0)){o||(i=this.replaceEntitiesValue(i));const a=this.options.tagValueProcessor(e,i,t,n,s);return a==null?i:typeof a!=typeof i||a!==i?a:this.options.trimValues?t6e(i,this.options.parseTagValue,this.options.numberParseOptions):i.trim()===i?t6e(i,this.options.parseTagValue,this.options.numberParseOptions):i}}function Nkr(i){if(this.options.removeNSPrefix){const e=i.split(":"),t=i.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(i=t+e[1])}return i}const $kr=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Bkr(i,e,t){if(!this.options.ignoreAttributes&&typeof i=="string"){const r=DYe.getAllMatches(i,$kr),n=r.length,s={};for(let o=0;o",s,"Closing Tag is not closed.");let l=i.substring(s+2,a).trim();if(this.options.removeNSPrefix){const h=l.indexOf(":");h!==-1&&(l=l.substr(h+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),t&&(r=this.saveTextToParentTag(r,t,n));const u=n.substring(n.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(c=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=n.lastIndexOf("."),n=n.substring(0,c),t=this.tagsNodeStack.pop(),r="",s=a}else if(i[s+1]==="?"){let a=e6e(i,s,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,t,n),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const l=new tK(a.tagName);l.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(l[":@"]=this.buildAttributesMap(a.tagExp,n,a.tagName)),this.addChild(t,l,n)}s=a.closeIndex+1}else if(i.substr(s+1,3)==="!--"){const a=b8(i,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=i.substring(s+4,a-2);r=this.saveTextToParentTag(r,t,n),t.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=a}else if(i.substr(s+1,2)==="!D"){const a=Rkr(i,s);this.docTypeEntities=a.entities,s=a.i}else if(i.substr(s+1,2)==="!["){const a=b8(i,"]]>",s,"CDATA is not closed.")-2,l=i.substring(s+9,a);if(r=this.saveTextToParentTag(r,t,n),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}]);else{let u=this.parseTextData(l,t.tagname,n,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}s=a+2}else{let a=e6e(i,s,this.options.removeNSPrefix),l=a.tagName;const u=a.rawTagName;let c=a.tagExp,h=a.attrExpPresent,p=a.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),t&&r&&t.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,t,n,!1));const m=t;if(m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(t=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),l!==e.tagname&&(n+=n?"."+l:l),this.isItStopNode(this.options.stopNodes,n,l)){let v="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)s=a.closeIndex;else if(this.options.unpairedTags.indexOf(l)!==-1)s=a.closeIndex;else{const S=this.readStopNodeData(i,u,p+1);if(!S)throw new Error(`Unexpected end of ${u}`);s=S.i,v=S.tagContent}const w=new tK(l);l!==c&&h&&(w[":@"]=this.buildAttributesMap(c,n,l)),v&&(v=this.parseTextData(v,l,n,!0,h,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),w.add(this.options.textNodeName,v),this.addChild(t,w,n)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){l[l.length-1]==="/"?(l=l.substr(0,l.length-1),n=n.substr(0,n.length-1),c=l):c=c.substr(0,c.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const v=new tK(l);l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,n,l)),this.addChild(t,v,n),n=n.substr(0,n.lastIndexOf("."))}else{const v=new tK(l);this.tagsNodeStack.push(t),l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,n,l)),this.addChild(t,v,n),t=v}r="",s=p}}else r+=i[s];return e.child};function Gkr(i,e,t){const r=this.options.updateTag(e.tagname,t,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),i.addChild(e))}const Ukr=function(i){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];i=i.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];i=i.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];i=i.replace(t.regex,t.val)}i=i.replace(this.ampEntity.regex,this.ampEntity.val)}return i};function zkr(i,e,t,r){return i&&(r===void 0&&(r=Object.keys(e.child).length===0),i=this.parseTextData(i,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),i!==void 0&&i!==""&&e.add(this.options.textNodeName,i),i=""),i}function Vkr(i,e,t){const r="*."+t;for(const n in i){const s=i[n];if(r===s||e===s)return!0}return!1}function Hkr(i,e,t=">"){let r,n="";for(let s=e;s",t,`${e} is not closed`);if(i.substring(t+2,s).trim()===e&&(n--,n===0))return{tagContent:i.substring(r,t),i:s};t=s}else if(i[t+1]==="?")t=b8(i,"?>",t+1,"StopNode is not closed.");else if(i.substr(t+1,3)==="!--")t=b8(i,"-->",t+3,"StopNode is not closed.");else if(i.substr(t+1,2)==="![")t=b8(i,"]]>",t,"StopNode is not closed.")-2;else{const s=e6e(i,t,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&n++,t=s.closeIndex)}}function t6e(i,e,t){if(e&&typeof i=="string"){const r=i.trim();return r==="true"?!0:r==="false"?!1:Dkr(i,t)}else return DYe.isExist(i)?i:""}var qkr=Fkr,G6t={};function Ykr(i,e){return U6t(i,e)}function U6t(i,e,t){let r;const n={};for(let s=0;s0&&(n[e.textNodeName]=r):r!==void 0&&(n[e.textNodeName]=r),n}function Xkr(i){const e=Object.keys(i);for(let t=0;t0&&(t=nLr),z6t(i,e,"",t)}function z6t(i,e,t,r){let n="",s=!1;for(let o=0;o`,s=!1;continue}else if(l===e.commentPropName){n+=r+``,s=!0;continue}else if(l[0]==="?"){const v=idt(a[":@"],e),w=l==="?xml"?"":r;let S=a[l][0][e.textNodeName];S=S.length!==0?" "+S:"",n+=w+`<${l}${S}${v}?>`,s=!0;continue}let c=r;c!==""&&(c+=e.indentBy);const h=idt(a[":@"],e),p=r+`<${l}${h}`,m=z6t(a[l],e,u,c);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?n+=p+">":n+=p+"/>":(!m||m.length===0)&&e.suppressEmptyNode?n+=p+"/>":m&&m.endsWith(">")?n+=p+`>${m}${r}`:(n+=p+">",m&&r!==""&&(m.includes("/>")||m.includes("`),s=!0}return n}function oLr(i){const e=Object.keys(i);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function aL(i){this.options=Object.assign({},cLr,i),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=pLr),this.processTextOrObjNode=hLr,this.options.format?(this.indentate=dLr,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}aL.prototype.build=function(i){return this.options.preserveOrder?dLr(i,this.options):(Array.isArray(i)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(i={[this.options.arrayNodeName]:i}),this.j2x(i,0).val)};aL.prototype.j2x=function(i,e){let t="",r="";for(let n in i)if(Object.prototype.hasOwnProperty.call(i,n))if(typeof i[n]>"u")this.isAttribute(n)&&(r+="");else if(i[n]===null)this.isAttribute(n)?r+="":n[0]==="?"?r+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+n+"/"+this.tagEndChar;else if(i[n]instanceof Date)r+=this.buildTextValNode(i[n],n,"",e);else if(typeof i[n]!="object"){const s=this.isAttribute(n);if(s)t+=this.buildAttrPairStr(s,""+i[n]);else if(n===this.options.textNodeName){let o=this.options.tagValueProcessor(n,""+i[n]);r+=this.replaceEntitiesValue(o)}else r+=this.buildTextValNode(i[n],n,"",e)}else if(Array.isArray(i[n])){const s=i[n].length;let o="";for(let a=0;a"u"||(l===null?n[0]==="?"?r+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+n+"/"+this.tagEndChar:typeof l=="object"?this.options.oneListGroup?o+=this.j2x(l,e+1).val:o+=this.processTextOrObjNode(l,n,e):o+=this.buildTextValNode(l,n,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,n,"",e)),r+=o}else if(this.options.attributesGroupName&&n===this.options.attributesGroupName){const s=Object.keys(i[n]),o=s.length;for(let a=0;a"+i+n:this.options.commentPropName!==!1&&e===this.options.commentPropName&&s.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+"<"+e+t+s+this.tagEndChar+i+this.indentate(r)+n}};aL.prototype.closeTag=function(i){let e="";return this.options.unpairedTags.indexOf(i)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+t+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,i);return n=this.replaceEntitiesValue(n),n===""?this.indentate(r)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+t+">"+n+"0&&this.options.processEntities)for(let e=0;e0&&s.features[0].geometry.type===jp.POINT&&s.features.forEach(m=>{const v=m.geometry.coordinates;m.properties.rvInternalCoordX=v[0],m.properties.rvInternalCoordY=v[1]}),s}reversedAxisWKIDs(){return okr}parseCapabilities(e){const t=()=>{let o=e;if(e.indexOf("?")===-1)o+="?service=WMS&request=GetCapabilities";else{const a=new sse(e.toUpperCase());"SERVICE"in a.queryMap||(o+="&service=WMS"),"REQUEST"in a.queryMap||(o+="&request=GetCapabilities")}return zi(o,{responseType:"xml"}).then(a=>a.data)},r=new Promise(o=>{t().then(a=>o(a)).catch(()=>{console.error("Get capabilities failed; trying the second time;"),o(t())})}),n=o=>{let a=o.Layer;return a?(Array.isArray(a)||(a=[a]),a.map(l=>{const u=l.Name,c=l.Title;let h=l.Style;const p=[],m={};return h&&(Array.isArray(h)||(h=[h]),h.forEach(v=>{const w=v.Name;if(p.push(w),v.LegendURL){const I=v.LegendURL.OnlineResource["@_xlink:href"];m[w]=I.replaceAll("&","&")}})),{name:u?.toString()??null,title:c,queryable:l["@_queryable"]==="1",layers:n(l),allStyles:p,styleToURL:m,currentStyle:p[0]}})):[]},s=o=>{let a=o.Format;return Array.isArray(a)||(a=[a]),a};return r.then(o=>{if(!o)return[];const a=new XMLSerializer().serializeToString(o),l={ignoreAttributes:!1},u=new wLr.XMLParser(l).parse(a);if("ServiceExceptionReport"in u)return console.error(u.ServiceExceptionReport.ServiceException),[];const c=u.WMS_Capabilities.Capability;return{layers:n(c),queryTypes:s(c.Request.GetFeatureInfo)}})}}class fq{static makeRawItem(e,t){const r=Promise.resolve();return Zl({format:e,data:t,started:!0,loaded:!0,loading:r,load(){return r}})}static makeOidItem(e,t){const r=new Af,n={format:z8.ESRI,data:void 0,started:!1,loaded:!1,loading:r.getPromise(),async load(){if(!this.started){this.started=!0;const s=await t.getGraphic(e,{getAttribs:!0});this.data=s.attributes,this.loaded=!0,r.resolveMe()}return r.getPromise()}};return Zl(n)}}class SLr extends tf{files;ogc;constructor(e){super(e),this.files=new skr(e),this.ogc=new xLr(e)}createLayer(e){let t;switch(e.layerType){case pn.FEATURE:t=ILr;break;case pn.MAPIMAGE:t=ALr;break;case pn.GRAPHIC:t=q6t;break;case pn.TILE:t=Y6t;break;case pn.WFS:t=DLr;break;case pn.DATATABLE:t=kLr;break;case pn.WMS:t=RLr;break;case pn.GEOJSON:t=TLr;break;case pn.CSV:t=ELr;break;case pn.DATAJSON:t=FLr;break;case pn.IMAGERY:t=PLr;break;case pn.SHAPEFILE:t=CLr;break;case pn.OSM:t=OLr;break;default:throw new Error("Unsupported Layer Type "+e.layerType)}return new t(e,this.$iApi)}getLayer(e){return H1(this.$vApp.$pinia).getLayerByAny(e)}getSublayer(e,t){const r=H1(this.$vApp.$pinia).getLayerById(e);if(r&&r.supportsSublayers&&ts===r);return n===-1?void 0:n}else return}layerOrderIds(){return H1(this.$vApp.$pinia).mapOrder.slice(0)||[]}allLayers(){return H1(this.$vApp.$pinia).layers||[]}allActiveLayers(){return this.allLayers().filter(e=>e.layerState!==Ud.ERROR&&e.initiationState===ey.INITIATED)}allLayersOnMap(e=!0){let t=this.allLayers().filter(r=>r.mapLayer&&r.initiationState===ey.INITIATED);if(e){const r=this.layerOrderIds(),n=new Map(r.map((s,o)=>[s,o]));t.sort((s,o)=>n.get(s.id)-n.get(o.id))}return t}allDataLayers(){return this.allLayers().filter(e=>!e.mapLayer&&e.initiationState===ey.INITIATED)}allErrorLayers(){return this.allLayers().filter(e=>e.layerState===Ud.ERROR)}allInitiatingLayers(){return this.allLayers().filter(e=>e.initiationState===ey.INITIATING)}getLayerControls(e){const t=this.getLayer(e);if(!t)return;const r=t.config.controls?.slice()??[ya.BoundaryZoom,ya.Datatable,ya.Identify,ya.Metadata,ya.Opacity,ya.Refresh,ya.Reload,ya.Remove,ya.Settings,ya.Symbology,ya.Visibility],n=[];return t.supportsFeatures||n.push(ya.Datatable),t.extent===void 0&&n.push(ya.BoundaryZoom),(t.config?.metadata||(t.isSublayer?t.parentLayer?.config?.metadata:{})||{}).url||n.push(ya.Metadata),!t.mapLayer&&!t.config.controls?.includes(ya.Settings)&&n.push(ya.Settings),n.forEach(o=>{const a=r?.indexOf(o)??-1;a!==-1&&r?.splice(a,1)}),{controls:r,disabledControls:t.config.disabledControls??[]}}async loadLayerMetadata(e){if(!e.trim())throw new Error("url missing on layer server metadata request.");const[t,r]=await _k(zi(e,{query:{f:"json"}}));if(!r)throw console.error(`Service metadata load error: ${e}`,t),new Error(`Service metadata load error: ${e}`);if(!r.data)throw console.error(`Service metadata load error: ${e}`),new Error(`Service metadata load error: ${e}`);const n=r.data,s={geometryType:cl.NONE,minScale:0,maxScale:0,canModifyLayer:!0,extent:void 0,defaultVisibility:!0,fields:[],displayField:"",objectIdField:"",renderer:void 0,currentVersion:0,name:"",dataFormat:l0.UNKNOWN,mapLayer:!0};if(s.name=n.name||"",s.currentVersion=n.currentVersion||-1,s.minScale=n.effectiveMinScale||n.minScale||0,s.maxScale=n.effectiveMaxScale||n.maxScale||0,s.extent=n.extent?Yh.fromArcServer(n.extent,"layer_extent"):void 0,s.defaultVisibility=n.defaultVisibility??!0,s.canModifyLayer=n.canModifyLayer??!0,n.type==="Feature Layer"||n.type==="Table"){if(s.dataFormat=l0.ESRI_FEATURE,s.displayField=n.displayField||"",Array.isArray(n.fields)){const o=n.fields.map(l=>Fo.fromJSON(l));s.fields=o.map(l=>({name:l.name,alias:l.alias,type:l.type,length:l.length})),o.every(l=>l.type==="oid"?(s.objectIdField=l.name,!1):!0)&&(s.objectIdField=n.objectIdField||(console.error(`Encountered service with no OID defined: ${e}`),"")),n.type==="Feature Layer"?(s.geometryType=this.$iApi.geo.geom.serverGeomTypeToRampGeomType(n.geometryType),n?.drawingInfo?.renderer&&(s.renderer=YC(n.drawingInfo.renderer))):s.mapLayer=!1}}else s.dataFormat=l0.ESRI_RASTER;return s}async loadFeatureCount(e,t=""){if(!e)return console.error("A layer without a url attempted to run the server based feature count routine."),0;const r={query:{f:"json",where:t||"1=1",returnCountOnly:!0,returnGeometry:!1}},[n,s]=await _k(zi(`${e}/query`,r));return s?s.data?Number.isInteger(s.data.count)?s.data.count:(console.error(`Funny result (${s.data.count}) during feature count: ${e}`),0):(console.error(`Unable to load feature count: ${e}`),0):(console.error(`Feature count request unsuccessful: ${e}`,n),0)}}class Rse extends tf{config={};id;uid;name;layerState;initiationState;drawState;layerIdx;layerType;layerFormat;dataFormat;supportsIdentify;supportsFeatures;mapLayer;featureCount;fields;fieldList;nameField;oidField;expectedTime;supportsSublayers;isSublayer;isRemoved;isFile;isCosmetic;userAdded;identify;identifyMode;hovertips;geomType;legend;maxLoadTime;esriLayer;esriSubLayer;esriView;extent;canModifyLayer;canReload;url;_parentLayer;_sublayers;constructor(e,t){super(t),this.config=e,this.id="",this.uid="",this.name="error",this.layerState=Ud.NEW,this.drawState=fb.NOT_LOADED,this.initiationState=ey.NEW,this.layerIdx=-1,this.layerFormat=zx.UNKNOWN,this.layerType=pn.UNKNOWN,this.dataFormat=l0.UNKNOWN,this.supportsIdentify=!1,this.identifyMode=sg.NONE,this.supportsFeatures=!1,this.mapLayer=!0,this.featureCount=0,this.fields=[],this.fieldList="",this.nameField="",this.oidField="",this.supportsSublayers=!1,this.isSublayer=!1,this.isRemoved=!1,this.isFile=!1,this.isCosmetic=!1,this.userAdded=!1,this.identify=!1,this.hovertips=!1,this.geomType=cl.UNKNOWN,this.legend=[],this._sublayers=[],this.expectedTime={draw:0,load:0},this.maxLoadTime=0,this.canModifyLayer=!0,this.canReload=!0,this.url=""}async initiate(){return Promise.resolve()}async terminate(){return Promise.resolve()}async reload(){return Promise.resolve()}loadPromise(){return Promise.resolve()}get isLoaded(){return!1}get layerExists(){return!1}getLayerTree(){return new q1e(0,"Fake tree","getLayerTree() was not implemented in layer")}getSR(){return xl.latLongSR()}get visibility(){return!1}set visibility(e){}get opacity(){return 0}set opacity(e){}get scaleSet(){return new EFt}set scaleSet(e){}isOffscale(e=void 0){return!1}zoomToVisibleScale(){return Promise.resolve()}zoomToLayerBoundary(){return Promise.resolve()}get mouseTolerance(){return 0}set mouseTolerance(e){}get touchTolerance(){return 0}set touchTolerance(e){}get drawOrder(){return[]}canIdentify(){return!1}runIdentify(e){return[]}getAttributes(){return Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){}clearFeatureCache(){}downloadedAttributes(){return 0}attribLoadAborted(){return!1}getTabularAttributes(){return Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,t){return Promise.resolve(new Ax(new Kk))}getIcon(e){return Promise.resolve("")}getSqlFilter(e){return""}setSqlFilter(e,t){}applySqlFilter(e=[]){}getFilterOIDs(e=[],t=void 0){return Promise.resolve(void 0)}getGraphicExtent(e){return Promise.resolve(Yh.fromParams("fake",0,0,0,0))}get parentLayer(){if(this.isSublayer)return this._parentLayer;throw new Error("Attempted to get parent layer of a non-sublayer object")}set parentLayer(e){if(!this.isSublayer&&e)throw new Error("Attempted to set parent layer for a non-sublayer object");this._parentLayer=e}get sublayers(){return this._sublayers}onLoad(){}onError(){}updateLayerState(e){}updateDrawState(e){}updateInitiationState(e){}uidToIdx(e){if(e===this.uid)return-1;{const t=this._sublayers.findIndex(r=>r?.uid===e);if(t===-1)throw new Error(`Attempt to access non-existing unique id [layerid ${this.id}, uid ${e}]`);return t}}getSublayer(e){if(!this.supportsSublayers){console.warn(`Attempted to call getSublayer on a layer (layer id: ${this.id}) that does not support FCs`);return}let t;if(typeof e=="string"?t=this.uidToIdx(e):t=e,this._sublayers[t]===void 0)throw new Error(`Attempt to access non-existing layer index [layerid ${this.id}, lookup value ${e}]`);return this._sublayers[t]}controlAvailable(e){const t=this.$iApi.geo.layer.getLayerControls(this.id);return t?.disabledControls?.includes(e)?!1:t?.controls.includes(e)??!1}}class H6t extends Rse{timers;origRampConfig;loadDefProm;loadPromFulfilled;layerTree;constructor(e,t){super(e,t),this.name=e.name||"",this.geomType=cl.NONE,this.dataFormat=l0.UNKNOWN,this.layerType=pn.UNKNOWN,this.layerFormat=zx.UNKNOWN;const r=t.geo.map.layerDefaultTimes;this.expectedTime.draw=e.expectedDrawTime??r.draw,this.expectedTime.load=e.expectedLoadTime??r.draw,this.timers={draw:void 0,load:void 0},this.origRampConfig=e,this.id=e.id||"",this.uid=this.$iApi.geo.shared.generateUUID(),this.isCosmetic=!1,this.isRemoved=!1,this.isSublayer=!1,this.supportsIdentify=!1,this.mapLayer=!0,this.identifyMode=sg.NONE,this.supportsFeatures=!1,this.hovertips=!1,this.supportsSublayers=!1,this.isFile=!1,this.layerState=Ud.NEW,this.initiationState=ey.NEW,this.drawState=fb.NOT_LOADED,this.loadDefProm=new Af,this.url=this.origRampConfig.url,this.canReload=!!(this.url||this.origRampConfig.caching),this.loadPromFulfilled=!1,this.layerTree=new q1e(0,this.uid,this.name,!0),this.maxLoadTime=e.maxLoadTime??2e4}updateInitiationState(e){this.initiationState=e,this.$iApi.event.emit(ln.LAYER_INITIATIONSTATECHANGE,{state:e,layer:this})}updateLayerState(e){this.layerState=e,this.$iApi.event.emit(ln.LAYER_LAYERSTATECHANGE,{state:e,layer:this})}updateDrawState(e){this.drawState=e,e===fb.REFRESH?this.startTimer("draw"):e===fb.UP_TO_DATE&&this.stopTimer("draw"),this.$iApi.event.emit(ln.LAYER_DRAWSTATECHANGE,{state:e,layer:this})}async initiate(){this.updateInitiationState(ey.INITIATING),this.startTimer("load");const[e]=await _k(this.onInitiate());this.drawState!==fb.UP_TO_DATE&&this.startTimer("draw"),e&&(console.error(e.message),this.onError()),this.updateInitiationState(ey.INITIATED)}async onInitiate(){if(this.isSublayer)return console.warn("Attempted to initiate a sublayer as a CommonLayer"),Promise.resolve();this.initiationState===ey.INITIATED&&console.error(`Encountered layer initialize while already initiated, layer id ${this.id}`)}async terminate(){this.updateInitiationState(ey.TERMINATING),await Promise.all(this.sublayers.map(e=>e.terminate())),this.loadDefProm=new Af,this.loadPromFulfilled=!1,this.updateLayerState(Ud.NEW),this.updateDrawState(fb.NOT_LOADED),this.updateInitiationState(ey.TERMINATED)}onLoad(){let e=!1;const t=setTimeout(()=>{this.maxLoadTime&&(e=!0,this.onError())},this.maxLoadTime);try{const r=this.onLoadActions();Promise.all(r).then(()=>{clearTimeout(t),e?this.visibility=!1:(this.loadPromFulfilled&&(this.loadDefProm=new Af),this.loadDefProm.resolveMe(),this.loadPromFulfilled=!0,this.stopTimer("load"),this.sublayers.forEach(n=>n.onLoad()),this.updateLayerState(Ud.LOADED))}).catch(()=>{clearTimeout(t),this.onError()})}catch(r){console.error("Encountered error on layer load: ",r),clearTimeout(t),this.onError()}}onError(){this.loadPromFulfilled&&(this.loadDefProm=new Af),this.loadDefProm.rejectMe(),this.loadPromFulfilled=!0,this.sublayers.forEach(e=>e.onError()),this.$iApi.notify.show(K1.ERROR,this.$iApi.$i18n.t("layer.error",{id:this.id})),this.stopTimer("draw"),this.stopTimer("load"),this.updateLayerState(Ud.ERROR)}onLoadActions(){return[]}loadPromise(){return this.loadDefProm.getPromise()}get isLoaded(){return this.layerState===Ud.LOADED}canIdentify(){return this.supportsIdentify&&this.isLoaded&&this.visibility&&this.identify&&!this.scaleSet.isOffScale(this.$iApi.geo.map.getScale()).offScale}getLayerTree(){return this.layerTree}stubError(){throw new Error(`Attempted to use a method not valid for ${this.layerType}`)}getAttributes(){return this.stubError(),Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){this.stubError()}clearFeatureCache(){this.stubError()}getTabularAttributes(){return this.stubError(),Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,t){return this.stubError(),Promise.resolve(new Ax(new Kk))}getIcon(e){return this.stubError(),Promise.resolve("")}getSqlFilter(e){return this.stubError(),""}setSqlFilter(e,t){this.stubError()}getFilterOIDs(e=[],t=void 0){return this.stubError(),Promise.resolve(void 0)}getGraphicExtent(e){return this.stubError(),Promise.resolve(Yh.fromParams("fake",0,0,0,0))}applySqlFilter(e=[]){this.stubError()}setCustomParameter(e,t,r=!0){this.stubError()}startTimer(e){this.stopTimer(e),this.expectedTime[e]>0&&(this.timers[e]=window.setTimeout(()=>this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t(`layer.long${e}`,{id:this.name||this.id})),this.expectedTime[e]))}stopTimer(e){this.timers[e]&&(clearTimeout(this.timers[e]),this.timers[e]=void 0)}}class o7 extends H6t{_serverVisibility;_scaleSet;_mouseTolerance;_touchTolerance;_drawOrder;_lastFilterUpdate="";viewDefProm;esriWatches;constructor(e,t){super(e,t),this._scaleSet=new EFt,this._mouseTolerance=e.mouseTolerance!=null?e.mouseTolerance:5,this._touchTolerance=e.touchTolerance!=null?e.touchTolerance:15,this._drawOrder=[],this._serverVisibility=void 0,this.isCosmetic=e.cosmetic||!1,this.extent=e.extent?Yh.fromConfig(`${this.id}_extent`,e.extent):void 0,this.viewDefProm=new Af,this.esriWatches=[]}noLayerErr(){console.error("Attempted to manipulate the layer but no layer found. Likely .initiate() was not finished or failed."),console.trace()}async onInitiate(){if(await super.onInitiate(),!this.esriLayer){this.noLayerErr();return}this.esriWatches.push(this.esriLayer.watch("visible",e=>{this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("opacity",e=>{this.$iApi.event.emit(ln.LAYER_OPACITYCHANGE,{opacity:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("loadStatus",e=>{const t={"not-loaded":Ud.LOADING,loading:Ud.LOADING,loaded:Ud.LOADED,failed:Ud.ERROR};e==="loaded"?this.onLoad():e==="failed"?this.onError():this.updateLayerState(t[e])})),this.esriLayer.on("layerview-create",e=>{this.esriView=e.layerView,this.esriWatches.push(e.layerView.watch("updating",t=>{this.updateDrawState(t?fb.REFRESH:fb.UP_TO_DATE)})),this.viewDefProm.resolveMe()}),this.sublayers.forEach(e=>e.initiate())}async terminate(){await super.terminate(),this.viewDefProm=new Af,this.esriWatches.forEach(e=>e.remove()),this.esriWatches=[]}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}if(this.initiationState===ey.INITIATED&&(this.esriLayer&&this.$iApi.geo.map.esriMap.layers.findIndex(t=>t.id===this.id)>-1&&this.$iApi.geo.map.esriMap.layers.remove(this.esriLayer),this.$iApi.event.emit(ln.LAYER_RELOAD_START,this),this.sublayers.forEach(e=>this.$iApi.event.emit(ln.LAYER_RELOAD_START,e)),await this.terminate()),await this.initiate(),!this.esriLayer){console.error("ESRI layer failed to re-create during reload.");return}this.$iApi.geo.map.insertToEsriMap(this),this.$iApi.event.emit(ln.LAYER_RELOAD_END,this),this.sublayers.forEach(e=>this.$iApi.event.emit(ln.LAYER_RELOAD_END,e))}makeEsriLayerConfig(e){return{id:e.id,url:e.url,opacity:e?.state?.opacity??1,visible:e?.state?.visibility??!0}}onLoadActions(){const e=super.onLoadActions();this.name||(this.name=this.esriLayer?.title||this.id),this.isCosmetic||(this.identify=this.config.state?.identify??this.supportsIdentify);const t=this.$iApi.geo.proj.checkProj(this.getSR()).then(r=>r?Promise.resolve():Promise.reject());return e.push(t),e}mapCheck(){return this.$iApi.geo.map.created?!0:(console.error("Attempting to use map-dependent logic before the layer has been added to the map"),console.trace(),!1)}get scaleSet(){return this._scaleSet}set scaleSet(e){this._scaleSet=e}isOffscale(e=void 0){let t;if(typeof e>"u")if(this.mapCheck())t=this.$iApi.geo.map.getScale();else return!1;else t=e;return this.scaleSet.isOffScale(t).offScale}zoomToVisibleScale(){return this.mapCheck()?this.$iApi.geo.map.zoomToVisibleScale(this.scaleSet):Promise.resolve()}zoomToLayerBoundary(){return this.extent?this.mapCheck()?this.$iApi.geo.map.zoomMapTo(this.extent):Promise.resolve():(console.error(`Attempted to zoom to boundary of a layer with no extent (Layer Id: ${this.id})`),Promise.resolve())}get mouseTolerance(){return this._mouseTolerance}set mouseTolerance(e){if(!this.supportsIdentify){console.warn("Attempted to set click tolerance on a layer that doesn't support identify");return}if(e<0){console.error("Attempted to set a negative click tolerance");return}this._mouseTolerance=e}get touchTolerance(){return this._touchTolerance}set touchTolerance(e){if(!this.supportsIdentify){console.warn("Attempted to set touch tolerance on a layer that doesn't support identify");return}if(e<0){console.error("Attempted to set a negative touch tolerance");return}this._touchTolerance=e}get layerExists(){return!!this.esriLayer}get drawOrder(){return this._drawOrder}get visibility(){return this.esriLayer?this.esriLayer.visible:(this.noLayerErr(),!1)}set visibility(e){this.esriLayer?this.esriLayer.visible=e:this.noLayerErr()}checkVisibility(){this.supportsSublayers&&(this.visibility=this.sublayers.some(e=>e.visibility))}get opacity(){return this.esriLayer?this.esriLayer.opacity:(this.noLayerErr(),0)}set opacity(e){this.esriLayer?this.esriLayer.opacity=e:this.noLayerErr()}getSR(){return this.esriLayer?xl.fromESRI(this.esriLayer.spatialReference):(this.noLayerErr(),xl.latLongSR())}}class FYe extends o7{attribs;renderer;serviceUrl;canModifyLayer;filter;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.geomType=cl.UNKNOWN,this.serviceUrl="",this.fieldList="",this.canModifyLayer=!0,this.filter=new IFt(e.permanentFilteredQuery||"",e.initialFilteredQuery||""),this.hovertips=e.state?.hovertips??!0,this.attribs=new J6t}notLoadedErr(){console.error("Attempted to manipulate the layer before it was loaded"),console.trace()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}async loadLayerMetadata(e={}){if(!this.serviceUrl)return;const t=await this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl);if(this.geomType=t.geometryType,this.attribs.quickCache=new Z6t(this.geomType),this.scaleSet.minScale=t.minScale,this.scaleSet.maxScale=t.maxScale,this.dataFormat=t.dataFormat,this.extent=this.extent??t.extent,this._serverVisibility=t.defaultVisibility,this.dataFormat===l0.ESRI_FEATURE){this.supportsFeatures=!0,this.canModifyLayer=this.layerType===pn.SUBLAYER?t.canModifyLayer:!0,this.fields=t.fields,this.nameField=t.displayField,this.oidField=t.objectIdField,this.drawOrder.forEach(s=>{s.field&&this.fields.findIndex(o=>o.name===s.field)===-1&&console.error(`Draw order for layer ${this.id} references invalid field ${s.field}`)});const r=e&&e.customRenderer&&e.customRenderer.type?e.customRenderer:t.renderer;this.renderer=this.$iApi.geo.symbology.makeRenderer(r,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const n={supportsLimit:(t.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:"*",permanentFilter:this.getSqlFilter(pm.PERMANENT)};this.attribs.attLoader=new K6t(this.$iApi,n),this.origRampConfig.name||(this.name=t.name??this.id)}else this.supportsFeatures=!1}getAttributes(){return this.attribs.attLoader.getAttribs()}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(e,t){let r={},n=new Kk;const s=this.$iApi.geo.map;let o=!1,a=!1,l=0;if(t.getAttribs||t.getStyle){const c=this.attribs.quickCache.getAttribs(e);if(c)r=c;else if(this.attribs.attLoader.isLoaded()||this.isFile){const h=await this.attribs.attLoader.getAttribs();r=h.features[h.oidIndex[e]]}else o=!0}if(t.getGeom){l=s.getScale();const c=this.attribs.quickCache.getGeom(e,l);c?n=c:a=!0}if(o||a){const c={oid:e,serviceUrl:this.serviceUrl,includeGeometry:a,attribs:this.fieldList};a&&(c.mapSR=s.getSR().wkid?.toString(),this.attribs.quickCache.isPoint||(c.maxOffset=s.esriView?.resolution));const h=await this.$iApi.geo.attributes.loadSingleFeature(c);a&&(this.attribs.quickCache.setGeom(e,h.geometry,l),n=h.geometry),(o||typeof this.attribs.quickCache.getAttribs(e)>"u")&&(this.attribs.quickCache.setAttribs(e,h.attributes),o&&(r=h.attributes))}const u=new Ax(n,"",t.getAttribs?r:void 0);if(t.getStyle){const c=Qs(this.renderer.getGraphicSymbol(r));u.style=this.$iApi.geo.geom.styleEsriToRamp(c)}return u}async getIcon(e){if(!this.renderer)throw new Error("getIcon called before renderer is defined");const t=await this.getGraphic(e,{getAttribs:!0});return this.$iApi.geo.symbology.getGraphicIcon(t.attributes||{},this.renderer)}setSqlFilter(e,t){const r=this.filter.getSql(e);if(t===r)return;this.filter.setSql(e,t),this.$iApi.event.emit(ln.FILTER_CHANGE,{uid:this.uid,filterKey:e});const n=`${this.uid}-${e}-${t}`;this._lastFilterUpdate=n,setTimeout(()=>{this._lastFilterUpdate===n&&this.applySqlFilter()},100)}applySqlFilter(e=[]){throw new Error(`attempted to apply sql filter ${e} to a layer not equipped for it. likely a new subclass of AttribLayer did not override applySqlFilter`)}getSqlFilter(e){return this.filter.getSql(e)}getCombinedSqlFilter(e){return this.filter.getCombinedSql(e)}async getFilterOIDs(e=[],t=void 0){const r=this.filter.getCombinedSql(e),n=!!t;if(!(r||n))return;t&&this.filter.setExtent(t);const s=this.filter.sqlActiveFilters(e);let o=this.filter.getCache(s,n);if(!o){const a={filterGeometry:t,filterSql:r,includeGeometry:!1};o=this.queryOIDs(a),this.filter.setCache(o,s,n)}return o}queryOIDs(e){this.isFile&&(console.error("a file layer called a server based query function"),console.trace());const t={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(t)}async queryFeaturesDiscrete(e){const t=await this.queryOIDs(e),r={getGeom:!!e.includeGeometry,getAttribs:!0};return t.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const t=await this.queryFeaturesDiscrete(e);return Promise.all(t.map(r=>r.graphic))}configDrawOrder(e,t){Array.isArray(e.drawOrder)&&e.drawOrder.length>0&&(t.orderBy=e.drawOrder.map(r=>{const n=r.ascending??!0?"ascending":"descending";return r.field?{field:r.field,order:n}:{valueExpression:r.arcade,order:n}}),this._drawOrder=e.drawOrder.slice())}}class W6t extends o7{constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.GRAPHIC,this.hovertips=!1}_graphics=[];makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}getGraphicCount(){return this._graphics.length}getLocalGraphic(e){return this._graphics.find(t=>t.id===e)}getEsriGraphic(e){return this.esriLayer?.graphics.find(t=>t.id===e)}notLoadedErr(){console.error("Attempted to manipulate the layer before it was loaded"),console.trace()}get graphics(){return this._graphics.slice()}async addGraphic(e){if(!this.esriLayer){this.noLayerErr();return}let t;e instanceof Array?t=e:t=[e];const r=t.filter(l=>this._graphics.findIndex(c=>c.id===l.id)===-1?(this._graphics.push(l),!0):(console.error(`Attempting to add graphic with id '${l.id}' that has already been added.`),!1)),n=this.$iApi.geo.map.getSR(),s=r.map(l=>this.$iApi.geo.proj.projectGeometry(n,l.geometry)),o=await Promise.all(s),a=r.map((l,u)=>{const c=new Ax(o[u],l.id,l.attributes);return c.style=l.style,this.$iApi.geo.geom.graphicRampToEsri(c)});this.esriLayer.addMany(a)}removeGraphic(e){if(!this.esriLayer){this.noLayerErr();return}if(typeof e>"u"){this.esriLayer.removeAll(),this._graphics=[];return}let t;Array.isArray(e)?t=e:t=[e],t.map(n=>typeof n=="string"?n:n.id).forEach(n=>{const s=this.esriLayer.graphics.findIndex(a=>a.id===n);s>-1&&this.esriLayer.graphics.removeAt(s);const o=this._graphics.findIndex(a=>a.id===n);o>-1&&this._graphics.splice(o,1)})}}class q6t extends W6t{constructor(e,t){super(e,t),this.layerType=pn.GRAPHIC}async onInitiate(){this.esriLayer=Da(new nHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();return this.layerTree.name=this.name,this.updateDrawState(fb.UP_TO_DATE),e}}class CTe extends FYe{esriJson;sourceGeoJson;tooltipField;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.isFile=!0,this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.FEATURE,this.tooltipField="",e.identifyMode&&e.identifyMode!==sg.NONE?this.identifyMode=e.identifyMode:this.identifyMode=sg.HYBRID}async reload(){if(this.origRampConfig.caching!==!0&&!this.origRampConfig.url){console.error("Attempted to reload file layer from non server source without caching enabled.");return}await super.reload()}async onInitiate(){if(!this.sourceGeoJson)throw new Error("File Layer is missing source data.");const e={layerId:this.origRampConfig.id||"",targetSR:this.$iApi.geo.map.getSR(),...this.origRampConfig.latField&&{latField:this.origRampConfig.latField},...this.origRampConfig.longField&&{lonField:this.origRampConfig.longField},colour:this.origRampConfig.colour,fieldMetadata:this.origRampConfig.fieldMetadata};this.esriJson=await this.$iApi.geo.layer.files.geoJsonToEsriJson(this.sourceGeoJson,e),this.esriLayer=Da(new yh(this.makeEsriLayerConfig(this.origRampConfig))),this.esriJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData,delete this.sourceGeoJson,await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e),r="OBJECTID";return["source","objectIdField","id","fields","renderer","spatialReference","geometryType"].forEach(s=>{t[s]=this.esriJson[s]}),this.origRampConfig.nameField?t.displayField=this.$iApi.geo.attributes.fieldValidator(t.fields,this.origRampConfig.nameField)||r:t.displayField=r,t.outFields=["*"],delete t.url,this.configDrawOrder(e,t),t}onLoadActions(){const e=super.onLoadActions();return this.esriLayer&&this.origRampConfig.customRenderer?.type&&(this.esriLayer.renderer=YC(this.config.customRenderer)),this.layerTree.name=this.name,this.extractLayerMetadata(),this.origRampConfig.tooltipField?this.tooltipField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.tooltipField)||this.nameField:this.tooltipField=this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList),this.featureCount=this.esriLayer?.source.length||0,e.push(this.viewDefProm.getPromise()),this.filter.getCombinedSql()&&Promise.all(e).then(()=>{this.applySqlFilter()}),e}runIdentify(e){if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[],a=[];if(this.identifyMode===sg.HYBRID||this.identifyMode===sg.GEOMETRIC){const l={includeGeometry:!1};this.geomType!==cl.POLYGON&&e.geometry.type===cl.POINT?l.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):l.filterGeometry=e.geometry,l.filterSql=this.getCombinedSqlFilter(),s=this.queryFeatures(l).then(u=>{o=u})}return e.hitTest&&(this.identifyMode===sg.HYBRID||this.identifyMode===sg.SYMBOLIC)&&(n=s.then(async()=>{const l=await e.hitTest;a=await Promise.all(l.filter(u=>u.layerId===this.id&&o.findIndex(c=>u.oid===c.attributes[this.oidField])===-1).map(u=>u.oid))})),Promise.all([n,s]).then(()=>{o.forEach(l=>{r.items.push(fq.makeRawItem(z8.ESRI,l.attributes))}),a.forEach(l=>{r.items.push(fq.makeOidItem(l,this))}),r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}extractLayerMetadata(){const e=this.esriLayer;if(!e)throw new Error("file layer attempted to extract data from esri layer, esri layer did not exist");this.supportsFeatures=!0,this.geomType=this.$iApi.geo.geom.clientGeomTypeToRampGeomType(e.geometryType),this.scaleSet.minScale=e.minScale||0,this.scaleSet.maxScale=e.maxScale||0,this.extent=this.extent??Yh.fromESRI(e.fullExtent,this.id+"_extent");const t=Da(e.fields.slice());this.fields=t.map(n=>({name:n.name,alias:n.alias,type:n.type,length:n.length})),this.nameField=e.displayField,this.oidField=e.objectIdField,this.renderer=this.$iApi.geo.symbology.makeRenderer(e.renderer,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const r={sourceGraphics:e.source,oidField:this.oidField,attribs:"*",batchSize:-1};this.attribs.attLoader=new NLr(this.$iApi,r)}async getGraphic(e,t){let r;if(!t.getGeom&&this.attribs.attLoader.isLoaded()){const n=await this.attribs.attLoader.getAttribs();r=new Ax(new Kk,"",n.features[n.oidIndex[e]])}else{const n={filterOIDs:[e],includeGeometry:!!t.getGeom},s=await this.queryFeatures(n);if(s.length===0)throw new Error(`Could not find object id ${e}`);s.length!==1&&console.warn("did not get a single result on a query for a specific object id"),r=s[0]}if(t.getStyle){const n=Qs(this.renderer.getGraphicSymbol(r.attributes));r.style=this.$iApi.geo.geom.styleEsriToRamp(n)}return r}async queryFeatures(e){const t={layer:this,...e};return this.$iApi.geo.query.geoJsonQuery(t)}async queryOIDs(e){const t={layer:this,...e};return(await this.$iApi.geo.query.geoJsonQuery(t)).map(n=>n.attributes?n.attributes[this.oidField]:-1)}applySqlFilter(e=[]){if(!this.esriView){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);Qs(this.esriView).filter=new QF({where:t})}}class TLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.GEOJSON}async onInitiate(){if(this.origRampConfig.rawData)this.sourceGeoJson=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)this.sourceGeoJson=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("GeoJson layer config contains no raw data or url");await super.onInitiate()}}class CLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.SHAPEFILE}async onInitiate(){let e;if(this.origRampConfig.rawData&&this.origRampConfig.rawData instanceof ArrayBuffer)e=this.origRampConfig.rawData;else if(this.origRampConfig.url)e=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("shapefile config contains no url or no/invalid raw data");this.sourceGeoJson=await this.$iApi.geo.layer.files.shapefileToGeoJson(e),await super.onInitiate()}}class ELr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.CSV}async onInitiate(){if(!this.origRampConfig.latField||!this.origRampConfig.longField)throw new Error("csv file config missing lat or long field names");let e;if(this.origRampConfig.rawData&&typeof this.origRampConfig.rawData=="string")e=this.origRampConfig.rawData;else if(this.origRampConfig.url)e=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Csv file config contains no raw data or url");this.sourceGeoJson=await this.$iApi.geo.layer.files.csvToGeoJson(e,{latfield:this.origRampConfig.latField,lonfield:this.origRampConfig.longField}),await super.onInitiate()}}class ILr extends FYe{tooltipField;constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.tooltipField="",this.supportsIdentify=!0,this.layerType=pn.FEATURE,this.layerFormat=zx.FEATURE,e.identifyMode&&e.identifyMode!==sg.NONE?this.identifyMode=e.identifyMode:this.identifyMode=sg.HYBRID}async onInitiate(){Da(this.esriLayer=new yh(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e);return(e.initialFilteredQuery||e.permanentFilteredQuery)&&(t.definitionExpression=this.filter.getCombinedSql()),this.configDrawOrder(e,t),t}onLoadActions(){const e=super.onLoadActions(),t=this.esriLayer&&this.origRampConfig.customRenderer?.type;t&&(this.esriLayer.renderer=YC(this.origRampConfig.customRenderer));const r=this.esriLayer.parsedUrl.path,s=this.$iApi.geo.shared.parseUrlIndex(r).index||0;this.serviceUrl=r;const o=this.loadLayerMetadata(t?{customRenderer:this.esriLayer?.renderer}:{}).then(()=>{this.visibility=this.origRampConfig?.state?.visibility??this._serverVisibility??!0,this.nameField=this.origRampConfig.nameField||this.nameField||"",this.tooltipField=this.origRampConfig.tooltipField||this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList)}),a=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(pm.PERMANENT)).then(l=>{this.featureCount=l});return this.layerTree.name=this.name,this.layerTree.layerIdx=s,e.push(o,a),e}runIdentify(e){if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===sg.HYBRID||this.identifyMode===sg.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==cl.POLYGON&&e.geometry.type===cl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryOIDs(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===sg.HYBRID||this.identifyMode===sg.SYMBOLIC)&&(n=s.then(async()=>{(await e.hitTest).filter(l=>l.layerId===this.id&&o.findIndex(u=>l.oid===u)===-1).forEach(l=>{o.push(l.oid)})})),Promise.all([n,s]).then(()=>{o.forEach(a=>{r.items.push(fq.makeOidItem(a,this))}),r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}applySqlFilter(e=[]){if(!this.esriLayer){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);this.esriLayer.definitionExpression=t}getGraphicExtent(e){return new Promise((t,r)=>{if(!this.esriLayer)this.noLayerErr(),r();else if(!["multipoint","polyline","polygon"].includes(this.esriLayer.geometryType))console.error(`Attempted to query extent for invalid geometry type ${this.esriLayer.geometryType}.`),r();else{const n=this.attribs.quickCache.getExtent(e);n?t(n):this.esriLayer.queryExtent({objectIds:[e],outSpatialReference:this.$iApi.geo.map.getSR().toESRI()}).then(s=>{const o=Yh.fromESRI(s.extent);this.attribs.quickCache.setExtent(e,o),t(o)}).catch(()=>{console.error(`Extent querying failed for ${e}.`),r()})}})}}class ALr extends o7{isDynamic;origState;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.supportsSublayers=!0,this.layerType=pn.MAPIMAGE,this.layerFormat=zx.MAPIMAGE,this.isDynamic=!1,this.hovertips=!1,this.layerTree.layerIdx=-1,this.identifyMode=sg.GEOMETRIC}async onInitiate(){this.esriLayer=Da(new qHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e);return this.origState={visibility:t.visible,opacity:t.opacity},t.visible=!1,e.imageFormat&&(t.imageFormat=e.imageFormat),t}onLoadActions(){const e=super.onLoadActions();if(!this.esriLayer)return this.noLayerErr(),e;if(this.layerTree.name=this.name,!this.esriLayer.capabilities.exportMap)throw this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.noexportmap",{name:this.name||this.id})),new Error("Service does not support Map Image Layer, Map Export is not enabled");this.isDynamic=this.esriLayer.capabilities.exportMap.supportsDynamicLayers,this.extent=this.extent??Yh.fromESRI(this.esriLayer.fullExtent,this.id+"_extent");const t=o=>{const a=this.esriLayer?.allSublayers.find(l=>l.id===o);if(!a)throw new Error("attempt to find map image sublayer failed");return a},r={};this.origRampConfig.sublayers.forEach(o=>{r[o.index||0]=o});const n=[],s=(o,a)=>{const l=o.id,u=r[l];if(o.sublayers&&o.sublayers.length>0){const c=(u?u.name:"")||o.title||"",h=new q1e(l,"",c,!1);a.findChildByIdx(l)||a.children.push(h),o.sublayers.reverse().forEach(p=>{s(p,h)})}else{this._sublayers[l]||(this._sublayers[l]=new MLr({id:`${this.id}-${l}`,index:l,layerType:pn.SUBLAYER,name:u?.name,state:u?.state??{opacity:this.opacity,visibility:this.visibility,hovertips:this.hovertips,identify:this.identify},extent:u?.extent,controls:u?.controls,disabledControls:u?.disabledControls,initialFilteredQuery:u?.initialFilteredQuery,permanentFilteredQuery:u?.permanentFilteredQuery,labels:u?.labels},this.$iApi,this));const c=this._sublayers[l];if(c.isRemoved)return;if(c.name=u?.name||o.title||"",n.push(c),!a.children.map(h=>h.layerIdx).includes(l)){const h=new q1e(l,c.uid,c.name,!1);a.children.push(h)}c.esriWatches.push(o.watch("visible",()=>{this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:c.visibility,layer:c}),c.parentLayer?.checkVisibility()}),o.watch("opacity",h=>{this.$iApi.event.emit(ln.LAYER_OPACITYCHANGE,{opacity:h,layer:c})}))}};return this.origRampConfig.sublayers.forEach(o=>{if(!o.cosmetic){const a=t(o.index||0);s(a,this.layerTree)}}),n.forEach(o=>{const a=t(o.layerIdx),l=r[o.layerIdx];o.serviceUrl=a.url,o.fetchEsriSublayer(this),o.initiate();const u=o.esriSubLayer&&l?.customRenderer?.type;u&&(o.esriSubLayer.renderer=YC(l.customRenderer));const c=o.loadLayerMetadata(u?{customRenderer:o.esriSubLayer?.renderer}:{}).then(()=>{const h=r[o.layerIdx];return h?(o.visibility=o.isRemoved?!1:h.state?.visibility??(this.origState.visibility?o._serverVisibility??this.origState.visibility:this.origState.visibility??o._serverVisibility)??!0,o.opacity=h.state?.opacity??this.origState.opacity??1,o.nameField=h.nameField||o.nameField||"",this.$iApi.geo.attributes.applyFieldMetadata(o,h.fieldMetadata),o.canModifyLayer||this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.filtersdisabled",{name:o.name||o.id}))):this.$iApi.geo.attributes.applyFieldMetadata(o),o.supportsFeatures?(o.updateFieldList(),this.$iApi.geo.layer.loadFeatureCount(o.serviceUrl,o.getSqlFilter(pm.PERMANENT)).then(p=>{o.featureCount=p})):Promise.resolve()});e.push(c)}),this.esriLayer.allSublayers.forEach(o=>{!o.sublayers&&!n.find(a=>a.layerIdx===o.id)?(o.visible=!1,o.opacity=0):o.sublayers&&(o.visible=!0)}),this.visibility=this.origState.visibility??!0,e}updateLayerState(e){super.updateLayerState(e),this.sublayers.forEach(t=>t.updateLayerState(e))}updateDrawState(e){super.updateDrawState(e),this.sublayers.forEach(t=>t.updateDrawState(e))}runIdentify(e){if(!this.canIdentify())return[];e.sublayerIds&&(e.sublayerIds=e.sublayerIds.map(n=>typeof n=="number"?this.layerTree?.findChildByIdx(n)?.uid:n));const t=e.sublayerIds?this._sublayers.filter(n=>e.sublayerIds?.includes(n.uid)):this._sublayers.filter(n=>n.canIdentify());if(t.length===0)return[];let r;return e.geometry.type===cl.POINT&&(r=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance)),t.map(n=>{const s=new Af,o={},a=Zl({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:n.uid,requestTime:Date.now()});return n.geomType!==cl.POLYGON&&r?o.filterGeometry=r:o.filterGeometry=e.geometry,o.filterSql=n.getCombinedSqlFilter(),n.queryOIDs(o).then(l=>{l.forEach(u=>{a.items.push(fq.makeOidItem(u,n))}),a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),a})}}const rdt="Accessed labelVisibility prior to layer being loaded";class MLr extends FYe{tooltipField;constructor(e,t,r){if(super(e,t),this.layerType=pn.SUBLAYER,this.layerFormat=zx.MAPIMAGE,this.isSublayer=!0,this.layerIdx=e.index,this.parentLayer=r,this.dataFormat=l0.ESRI_FEATURE,this.tooltipField="",this.hovertips=!1,this.url=this.parentLayer?.url,this.canReload=!!(this.url||this.origRampConfig.caching),!r.esriLayer)throw new Error("Map Image Layer with no internal esri layer encountered in sublayer creation");this.fetchEsriSublayer(r),(e.initialFilteredQuery||e.permanentFilteredQuery)&&this.applySqlFilter()}fetchEsriSublayer(e){if(!e.esriLayer){console.error("Attempted to fetch the ESRI sublayer when parent has no ESRI layer");return}this.esriSubLayer=Da(e.esriLayer.allSublayers.find(t=>t.id===this.layerIdx))}onLoadActions(){return this.layerTree=this.parentLayer.getLayerTree().findChildByUid(this.uid),this.layerTree.name=this.name,this.layerTree.layerIdx=this.layerIdx,this.identify=this.config.state.identify!=null?this.config.state.identify:this.supportsIdentify,[]}async onInitiate(){const e=this.labelVizOverride();e!==void 0&&(this.labelVisibility=e),this.initiationState=ey.INITIATED}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}this.parentLayer?.reload()}get layerExists(){return!!(this.parentLayer?.esriLayer&&this.esriSubLayer)}get visibility(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),!1):this.esriSubLayer.visible}set visibility(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.esriSubLayer.visible=e}get opacity(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.esriSubLayer.opacity}set opacity(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.isDynamic||console.warn(`Opacity of a Map Image Sublayer was set. The service does not support sublayer opacity. LayerId ${this.id}`),this.esriSubLayer.opacity=e}get mouseTolerance(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.parentLayer.mouseTolerance}set mouseTolerance(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.mouseTolerance=e}get touchTolerance(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.parentLayer.touchTolerance}set touchTolerance(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.touchTolerance=e}applySqlFilter(e=[]){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);this.esriSubLayer.definitionExpression=t}getSR(){return this.parentLayer?.esriLayer?xl.fromESRI(this._parentLayer?.esriLayer?.spatialReference):(this.noLayerErr(),xl.latLongSR())}updateFieldList(){this.attribs.attLoader.updateFieldList(this.fieldList)}get labelVisibility(){return this.esriSubLayer?this.esriSubLayer.labelsVisible:(console.error(rdt),!1)}set labelVisibility(e){this.esriSubLayer?this.esriSubLayer.labelsVisible=e:console.error(rdt)}labelVizOverride(){let e=this.origRampConfig.labels?.visible;if(e!==void 0||(e=this.$iApi.geo.map.labelsDefault?.visible,e!==void 0))return e}}class OLr extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.OSM,this.layerFormat=zx.OSM,this.dataFormat=l0.OSM_TILE,this.supportsFeatures=!1}async onInitiate(){this.esriLayer=Da(new XHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.generatePlaceholderSymbology("O","#03fc4e"),r={uid:this.$iApi.geo.shared.generateUUID(),label:"OpenStreetMap",svgcode:t.svgcode,esriStandard:!0,drawPromise:Promise.resolve()};return this.legend.push(r),e}}class PLr extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.IMAGERY,this.layerFormat=zx.IMAGERY,this.dataFormat=l0.ESRI_RASTER}async onInitiate(){this.esriLayer=Da(new gDt(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(t),e}}class Y6t extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.TILE,this.layerFormat=zx.TILE,this.dataFormat=l0.ESRI_TILE}async onInitiate(){this.esriLayer=Da(new KHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(t),e.push(this.checkProj()),e}checkProj(){const e=this.getSR(),r=this.$iApi.geo.map.getSR().isEqual(e);if(this.layerState===Ud.LOADED&&!r)this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),this.onError();else if(this.layerState===Ud.ERROR&&r)this.reload();else if(this.layerState!==Ud.ERROR&&!r)return this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),Promise.reject();return Promise.resolve()}}class RLr extends o7{sublayerNames;mimeType;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.layerType=pn.WMS,this.layerFormat=zx.WMS,this.mimeType=e.featureInfoMimeType||"",this.sublayerNames=[],this.dataFormat=l0.OGC_RASTER,this.identifyMode=sg.GEOMETRIC}async onInitiate(){this.esriLayer=Da(new YDt(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e),r=e.sublayers;this.sublayerNames=r.map(s=>s.id||"error_no_wms_id");const n=r.map(s=>s.currentStyle).join();return t.customParameters={styles:n},e.url.indexOf("/geomet")!==-1&&(t.customParameters.layers=r[0].id),t}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=r=>{let n=!1;return r.forEach(s=>{this.sublayerNames.indexOf(s.name)>-1||s.sublayers&&s.sublayers.length>0&&t(s.sublayers)?n=!0:s.visible=!1}),n};return this.esriLayer?t(this.esriLayer.sublayers):this.noLayerErr(),this.loadSymbology(),e}canIdentify(){return super.canIdentify()}runIdentify(e){if(e.geometry.type!==cl.POINT)throw new Error("a point must be used for WMS Identify");if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});return this.getFeatureInfo(this.sublayerNames,e.geometry,this.mimeType).then(n=>{if(n){let s=!0,o;typeof n!="string"?o=z8.JSON:n.indexOf("Search returned no results")===-1&&n!==""?o=z8.TEXT:(s=!1,o=z8.UNKNOWN),s&&r.items.push(fq.makeRawItem(o,n))}r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}setCustomParameter(e,t,r=!0){this.esriLayer?(this.esriLayer.customLayerParameters||(this.esriLayer.customLayerParameters={}),this.esriLayer.customLayerParameters[e]=t,r&&this.esriLayer.refresh()):this.noLayerErr()}getFeatureInfo(e,t,r){const n=this.$iApi.geo.map,s=this.esriLayer;if(!n.esriView)throw new Error("WMS get feature, no map view exists. Cannot derive click coords");if(!s)throw this.noLayerErr(),new Error("wms get feature failed, no layer");let o,a;const l=n.getExtent(),u=s.spatialReferences,c=e.join(","),h=n.esriView.toScreen(t.toESRI()),p=Math.floor(h.x),m=Math.floor(h.y),w={"application/json":"json","text/html":"text","text/plain":"text"}[r]||"text",S=n.getSR();S.wkid?o=S.wkid:(o=4326,console.error("Map is likely in a WKT projection. WMS Identify request will likely fail.")),u&&u.length>1?u.indexOf(o)===-1&&(S.latestWkid&&u.indexOf(S.latestWkid)>-1?o=S.latestWkid:console.error("WMS service does not support the maps projection. Identify request will likely fail.")):console.error("No supported wkid/epsg code found for WMS service. Identify request will likely fail."),s.version==="1.3"||s.version==="1.3.0"?(a={CRS:"EPSG:"+o,I:p,J:m,STYLES:"",FORMAT:s.imageFormat},this.$iApi.geo.layer.ogc.reversedAxisWKIDs().indexOf(o)>-1&&(a.BBOX=`${l.ymin},${l.xmin},${l.ymax},${l.xmax}`)):a={SRS:"EPSG:"+o,X:p,Y:m},Object.prototype.hasOwnProperty.call(a,"BBOX")||(a.BBOX=`${l.xmin},${l.ymin},${l.xmax},${l.ymax}`);const I={SERVICE:"WMS",REQUEST:"GetFeatureInfo",VERSION:s.version,WIDTH:n.getPixelWidth(),HEIGHT:n.getPixelHeight(),QUERY_LAYERS:c,LAYERS:c,INFO_FORMAT:r},R=s.customLayerParameters;return R&&Object.keys(R).forEach(L=>{L.toLowerCase()!=="styles"&&(I[L]=R[L])}),Object.keys(I).forEach(L=>a[L]=I[L]),zi(s.url.split("?")[0],{query:a,responseType:w})}getLegendUrls(e){if(!this.esriLayer)return this.noLayerErr(),[];const t=new Map;this.esriLayer.allSublayers.forEach(n=>{n.visible&&(n.legendUrl&&this.origRampConfig.sublayers?.forEach(s=>{if(s.id&&s.currentStyle&&s.id===n.name){const o=new sse(n.legendUrl);"STYLE"in o.queryMap&&o.queryMap.STYLE!==s.currentStyle&&(n.legendUrl=o.updateQuery({STYLE:s.currentStyle}))}}),t.set(n.name,n.legendUrl))});const r=e.map(n=>n.styleLegends&&n.currentStyle?n.styleLegends.find(s=>s.name===n.currentStyle).url:void 0);return r.forEach((n,s)=>{n||(r[s]=t.get(e[s].id))}),r}getWMSLayerTitle(e){if(!this.esriLayer)return"";let t;return this.esriLayer.allSublayers.some(r=>{if(r.name===e)return t=r.title,!0}),t||""}loadSymbology(){const e=this.config.sublayers,t=this.getLegendUrls(e.map(r=>({id:r.id,styleLegends:r.styleLegends,currentStyle:r.currentStyle}))).map((r,n)=>{const s=e[n].name||this.getWMSLayerTitle(e[n].id)||e[n].id,o={uid:this.$iApi.geo.shared.generateUUID(),label:s,svgcode:"",esriStandard:!1,drawPromise:this.$iApi.geo.symbology.generateWMSSymbology(r).then(a=>{o.svgcode=a.svgcode,o.imgHeight=a.imgHeight,o.imgWidth=a.imgWidth})};return o});this.legend=t}}class DLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.WFS}async onInitiate(){const e=new sse(this.config.url),{offset:t,limit:r}=e.queryMap;this.sourceGeoJson=await this.$iApi.geo.layer.ogc.loadWfsData(this.config.url,-1,parseInt(t)||0,parseInt(r)||1e3,void 0,this.config.xyInAttribs),await super.onInitiate()}}class X6t extends H6t{sourceJson;attribs;_visibility;constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.NOLAYER,this.drawState=fb.NOT_VISUAL,this.attribs=new J6t,this.supportsFeatures=!0,this.mapLayer=!1,this.isFile=!1,this._visibility=e.state?.visibility??!0,this.expectedTime.draw=0}async onInitiate(){if(this.sourceJson){const e=this.sourceJson;if(e.data.length===0||e.fields.length===0)throw new Error("Data layer with no columns or now rows.");const t=e.fields.slice(),r=e.data[0].slice(),n=/ /gi;this.fields=t.map((o,a)=>{let l="",u=o;o.indexOf(" ")>-1&&(l=o,u=o.trim().replace(n,"-"),e.fields[a]=u);const c=this.$iApi.geo.layer.files.inferType(r[a]);return{name:u,alias:l,type:c,length:c===j1.STRING?256:void 0}}),this.oidField="rampOID",this.fields.push({name:this.oidField,type:j1.OID}),e.fields.push(this.oidField),e.data.forEach((o,a)=>o.push(a+1)),this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.fieldList="*";const s={batchSize:-1,sourceDataJson:e,oidField:this.oidField,attribs:"*"};this.attribs.attLoader=new $Lr(this.$iApi,s),await this.attribs.attLoader.getAttribs(),this.featureCount=e.data.length,this.origRampConfig.nameField?this.nameField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.nameField)||this.oidField:this.nameField=this.oidField,this.sourceJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData}else throw new Error("Attempted to initiate file based data layer, sourceJson is missing")}async terminate(){await super.terminate()}async reload(){this.initiationState===ey.INITIATED&&(this.$iApi.event.emit(ln.LAYER_RELOAD_START,this),await this.terminate()),await this.initiate(),this.layerState!==Ud.ERROR&&this.onLoad(),setTimeout(()=>{this.$iApi.event.emit(ln.LAYER_RELOAD_END,this)},300)}onLoadActions(){const e=super.onLoadActions();return this.legend=[{uid:this.$iApi.geo.shared.generateUUID(),label:"",svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.getIcon(0).then(t=>{this.legend[0].svgcode=t})}],e}getAttributes(){return this.attribs.attLoader.getAttribs()}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(e,t){let r={};if(this.attribs.attLoader.isLoaded()){const n=await this.attribs.attLoader.getAttribs();r=n.features[n.oidIndex[e]]}else throw new Error("Non ESRI data layer did not have attributes populated.");return new Ax(new Kk,"",r)}async getIcon(e){return' D '}async getFilterOIDs(e=[],t=void 0){}abortAttributeLoad(){}attribLoadAborted(){return!1}clearFeatureCache(){}downloadedAttributes(){return this.featureCount}get layerExists(){return this.isLoaded}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this}))}}class FLr extends X6t{constructor(e,t){super(e,t),this.layerType=pn.DATAJSON}async onInitiate(){if(this.origRampConfig.rawData)this.sourceJson=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)this.sourceJson=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Json Data layer config contains no raw data or url");await super.onInitiate()}}class kLr extends X6t{filter;serviceUrl;constructor(e,t){super(e,t),this.layerType=pn.DATATABLE,this.serviceUrl=e.url,this.filter=new IFt(e.permanentFilteredQuery||"",e.initialFilteredQuery||"")}async onInitiate(){}onLoadActions(){const e=super.onLoadActions(),r=this.$iApi.geo.shared.parseUrlIndex(this.serviceUrl).index||0,n=this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl).then(o=>{this.name||(this.name=o.name),this.layerTree.name=this.name,this.oidField=o.objectIdField,this.nameField=this.origRampConfig.nameField||o.displayField||"",this.fields=o.fields,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata);const a={supportsLimit:(o.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:this.fieldList,permanentFilter:this.getSqlFilter(pm.PERMANENT)};this.attribs.attLoader=new K6t(this.$iApi,a),this.attribs.quickCache=new Z6t(this.geomType)}),s=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(pm.PERMANENT)).then(o=>{this.featureCount=o});return this.layerTree.layerIdx=r,e.push(n,s),e}async getGraphic(e,t){let r={};const n=this.attribs.quickCache.getAttribs(e);if(n)r=n;else if(this.attribs.attLoader.isLoaded()){const o=await this.attribs.attLoader.getAttribs();r=o.features[o.oidIndex[e]]}else{const o={oid:e,serviceUrl:this.serviceUrl,includeGeometry:!1,attribs:this.fieldList},a=await this.$iApi.geo.attributes.loadSingleFeature(o);this.attribs.quickCache.setAttribs(e,a.attributes),r=a.attributes}return new Ax(new Kk,"",r)}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}setSqlFilter(e,t){const r=this.filter.getSql(e);t!==r&&(this.filter.setSql(e,t),this.$iApi.event.emit(ln.FILTER_CHANGE,{uid:this.uid,filterKey:e}))}getSqlFilter(e){return this.filter.getSql(e)}getCombinedSqlFilter(e){return this.filter.getCombinedSql(e)}async getFilterOIDs(e=[],t=void 0){const r=this.filter.getCombinedSql(e);if(!r)return;const n=this.filter.sqlActiveFilters(e);let s=this.filter.getCache(n,!1);if(!s){const o={filterSql:r,includeGeometry:!1};s=this.queryOIDs(o),this.filter.setCache(s,n,!1)}return s}queryOIDs(e){const t={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(t)}async queryFeaturesDiscrete(e){const t=await this.queryOIDs(e),r={getAttribs:!0};return t.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const t=await this.queryFeaturesDiscrete(e);return Promise.all(t.map(r=>r.graphic))}}class LLr extends tf{oidIndexer(e,t){e.features.forEach((r,n)=>{e.oidIndex[r[t]]=n})}async arcGisBatchLoad(e,t){if(t.loadAbortFlag)return[];const r=e.permanentFilter?` AND ${e.permanentFilter}`:"",n={query:{where:`${e.oidField}>${e.maxId}${r}`,outFields:e.attribs,orderByFields:e.oidField,returnGeometry:"false",f:"json"}},[s,o]=await _k(zi(e.serviceUrl+"/query",n));if(!o)return console.error(`ArcGIS batch load error: ${e.serviceUrl}`,s),Promise.reject(new Error(`ArcGIS batch load error: ${e.serviceUrl}`));if(!o.data||!o.data.features)return console.error(`ArcGIS batch load gave no data/features: ${e.serviceUrl}`),Promise.reject(new Error(`ArcGIS batch load gave no data/features: ${e.serviceUrl}`));const a=o.data.features,l=a.length;if(l>0){t.loadedCount+=l;let u;if(e.supportsLimit?u=o.data.exceededTransferLimit:(e.batchSize===-1&&(e.batchSize=l),u=l>=e.batchSize),u){e.maxId=a[l-1].attributes[e.oidField];const c=await this.arcGisBatchLoad(e,t);return t.loadAbortFlag?[]:a.concat(c)}else return t.loadAbortFlag?[]:a}else return[]}async loadArcGisServerAttributes(e,t){e.maxId=-1,e.batchSize=-1;const n={features:(await this.arcGisBatchLoad(e,t)).map(s=>s.attributes),oidIndex:{}};return this.oidIndexer(n,e.oidField),t.loadIsDone=!0,n}async loadGraphicsAttributes(e,t){if(!e.sourceGraphics)throw new Error("No .sourceGraphics provided to file layer attribute loader");const n={features:e.sourceGraphics.map(s=>Qs(s).attributes).toArray(),oidIndex:{}};return this.oidIndexer(n,e.oidField),t.loadIsDone=!0,t.loadedCount=n.features.length,n}async loadCompactJsonAttributes(e,t){if(!e.sourceDataJson)throw new Error("No .sourceDataJson provided to file data-layer attribute loader");const r=e.sourceDataJson.fields,s={features:e.sourceDataJson.data.map(o=>{const a={};return o.forEach((l,u)=>{a[r[u]]=l}),a}),oidIndex:{}};return this.oidIndexer(s,e.oidField),t.loadIsDone=!0,t.loadedCount=s.features.length,e.sourceDataJson=void 0,s}async loadSingleFeature(e){const t={query:{f:"json",objectIds:e.oid,returnGeometry:e.includeGeometry,outFields:e.attribs}};typeof e.maxOffset<"u"&&(t.query.maxAllowableOffset=e.maxOffset),typeof e.mapSR<"u"&&(t.query.outSR=e.mapSR),typeof e.geometryPrecision<"u"&&e.geometryPrecision>=0&&(t.query.geometryPrecision=e.geometryPrecision);const[r,n]=await _k(zi(e.serviceUrl+"/query",t));if(!n)return console.error(`ArcGIS single feature load error: ${e.serviceUrl}`,r),Promise.reject(new Error(`ArcGIS single feature load error: ${e.serviceUrl}`));if(!n.data||!n.data.features)return console.error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`),Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`));const s=n.data.features;if(s.length>0){const o=s[0];let a;if(e.includeGeometry){o.geometry.spatialReference=n.data.spatialReference;const l=Ro(o.geometry);a=this.$iApi.geo.geom.geomEsriToRamp(l)}else a=new Kk;return new Ax(a,"",o.attributes)}return Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`))}orderFields(e,t){const r=(s,o)=>s.findIndex(a=>a.name===o),n=(s,o)=>{const a=r(t,s.name),l=r(t,o.name);return a===-1&&l===-1?r(e,s.name)-r(e,o.name):a===-1?1:l===-1?-1:a-l};return e.slice().sort(n)}applyFieldMetadata(e,t=void 0){if(!t||!t.fieldInfo){e.fieldList="*";return}if(t?.enforceOrder&&t?.fieldInfo&&t?.fieldInfo.length>0&&(e.fields=this.orderFields(e.fields,t.fieldInfo),e.fieldList=t.fieldInfo.map(r=>r.name).join(",")),t.exclusiveFields){t.fieldInfo.find(n=>n.name===e.oidField)||t.fieldInfo.push({name:e.oidField}),e.fieldList=t.fieldInfo.map(n=>n.name).join(",");const r=t.fieldInfo;e.fields=e.fields.filter(n=>r.find(s=>s.name===n.name))}else e.fieldList="*";t.fieldInfo.forEach(r=>{if(r.alias){const n=e.fields.find(s=>s.name===r.name);n&&(n.alias=r.alias)}})}fieldValidator(e,t){if(e.findIndex(r=>r.name===t)===-1){const r=e.find(n=>n.alias===t);return r?r.name:(console.warn(`Cannot find name field in layer field list: ${t}`),"")}else return t}async generateTabularAttributes(e,t){return t.attLoader.tabularAttributesCache||(t.attLoader.tabularAttributesCache=this.$iApi.geo.attributes.generateTabularAttributesWorker(e,t)),t.attLoader.tabularAttributesCache}async generateTabularAttributesWorker(e,t){if(e.dataFormat===l0.ESRI_RASTER)throw new Error("Attempting to get attributes on a raster layer.");const r=await t.attLoader.getAttribs();if(!r.features||r.features.length===0)return{columns:[],rows:[],fields:[],oidField:""};const n=e.fields.filter(o=>Object.prototype.hasOwnProperty.call(r.features[0],Qs(o).name)).map(o=>({data:Qs(o).name,title:Qs(o).alias||Qs(o).name})),s=r.features.map(o=>{const a=HY({},o);return a.rvInteractive="",a.rvSymbol=e.getIcon(o[e.oidField]),a.rvUid=e.uid,a});return n.forEach(o=>{if(o.data.slice(-2)==="()"){const a=function(){return this[o.data]},l=o.data.slice(0,-2);s.forEach(u=>{u[l]=a})}}),{columns:n,rows:s,fields:e.fields,oidField:e.oidField}}}class J6t{_attribLoader;_quickCache;get attLoader(){if(this._attribLoader)return this._attribLoader;throw console.trace(),new Error("Attempted to load attributes prior to layer being loaded.")}set attLoader(e){this._attribLoader=e}get quickCache(){if(this._quickCache)return this._quickCache;throw console.trace(),new Error("Attempted to access attribute cache prior to layer being loaded.")}set quickCache(e){this._quickCache=e}clearAll(){this._attribLoader&&this._attribLoader.destroyAttribs(),this._quickCache&&this._quickCache.clearAll()}}class ndt{loadedCount;loadAbortFlag;loadIsDone;constructor(){this.loadedCount=0,this.loadAbortFlag=!1,this.loadIsDone=!1}}class kYe extends tf{aac;loadPromise;details;tabularAttributesCache;constructor(e,t){super(e),this.aac=new ndt,this.details=t}updateFieldList(e){this.details.attribs=e}getAttribs(){return this.loadPromise||(this.aac=new ndt,this.loadPromise=this.loadPromiseGenerator()),this.loadPromise}abortAttribLoad(){this.aac.loadAbortFlag=!0}destroyAttribs(){this.loadPromise=void 0,this.tabularAttributesCache=void 0,this.aac.loadIsDone=!1,this.aac.loadedCount=0}loadCount(){return this.aac.loadedCount}isLoaded(){return this.aac.loadIsDone}isLoadAborted(){return this.aac.loadAbortFlag}loadPromiseGenerator(){return Promise.reject(new Error("Subclass of AttributeLoaderBase did not implement loadPromiseGenerator"))}}class K6t extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadArcGisServerAttributes(this.details,this.aac)}}class NLr extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadGraphicsAttributes(this.details,this.aac)}}class $Lr extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadCompactJsonAttributes(this.details,this.aac)}}class Z6t{attribs;geoms;extents;isPoint;constructor(e){this.attribs={},this.geoms={},this.extents={},this.isPoint=e==="point"}getScaleStore(e){return this.geoms[e]||(this.geoms[e]={}),this.geoms[e]}getGeomStore(e=void 0){if(this.isPoint)return this.geoms;if(typeof e>"u")throw new Error("Attempted to access geometry store for non-point layer without providing a map scale");return this.getScaleStore(e)}getAttribs(e){return this.attribs[e]}setAttribs(e,t){this.attribs[e]=t}getGeom(e,t=void 0){return this.getGeomStore(t)[e]}setGeom(e,t,r=void 0){const n=this.getGeomStore(r);n[e]=t}getExtent(e){return this.extents[e]}setExtent(e,t){this.extents[e]=t}clearAll(){this.attribs={},this.geoms={},this.extents={}}}class LYe{innerRenderer;symbolUnits;defaultUnit;type;falseRenderer;constructor(e,t,r=!1){this.innerRenderer=e,this.symbolUnits=[],this.falseRenderer=r,this.type=qxe.Unknown}makeSearchParams(e){return e}searchRenderer(e){const t=this.makeSearchParams(e),r=this.symbolUnits.find(s=>s.match(t));if(r)return r;if(this.defaultUnit)return this.defaultUnit;console.error(`renderer search could not find match for ${t}`);const n=new ETe(this);return n.svgCode="",n}getGraphicIcon(e){return this.searchRenderer(e).svgCode}getGraphicSymbol(e){return this.searchRenderer(e).symbol}rendererToLegend(){throw new Error("rendererToLegend not implemented in subclass")}getFieldDelimiter(e,t){let r="'";if(!t||t.length===0)return r;const n=t.find(s=>s.name===e);return n&&n.type&&n.type!=="string"&&(r=""),r}cleanFieldName(e,t){if(!e)return e;let r=t.find(n=>n.name===e);if(r)return e;{const n=e.toLowerCase();return r=t.find(s=>s.name.toLowerCase()===n),r?r.name:e}}makeElseClause(){return this.falseRenderer?"":`(NOT (${this.symbolUnits.map(t=>t.definitionClause).join(" OR ")}))`}}class ETe{isDefault=!1;svgCode="";symbol;definitionClause="";label="";parent;constructor(e){this.parent=e,this.symbol=new Jh}match(e){return!!e}}class BLr extends LYe{constructor(e,t){super(e,t),this.type=qxe.Simple;const r=new ETe(this);r.label=e.label||"",r.symbol=e.symbol,r.definitionClause="",this.symbolUnits.push(r)}}class jLr extends LYe{delim;keyFields;constructor(e,t,r=!1){super(e,t,r),this.type=qxe.Unique,this.delim=e.fieldDelimiter||", ";const n=o=>o.replace(/'/g,"''");this.keyFields=[e.field,e.field2,e.field3].filter(o=>o).map(o=>this.cleanFieldName(o,t));const s=this.keyFields.map(o=>this.getFieldDelimiter(o,t));if(e.uniqueValueInfos.forEach(o=>{const a=new sdt(this,o.value);if(a.label=o.label||"",a.symbol=o.symbol,!this.falseRenderer){const l=a.matchValue.split(this.delim),u=this.keyFields.map((c,h)=>l[h]===""?`${c} IS NULL`:`${c} = ${s[h]}${n(l[h])}${s[h]}`).join(" AND ");a.definitionClause=`(${u})`,a.matchValue=a.matchValue.replace(//g,"")}this.symbolUnits.push(a)}),e.defaultSymbol){const o=new sdt(this,"");o.isDefault=!0,o.label=e.defaultLabel||"",o.symbol=e.defaultSymbol,o.definitionClause=this.makeElseClause(),this.defaultUnit=o}}makeSearchParams(e){return this.keyFields.map(t=>{let r=e[t]===null?"":e[t];return typeof r!="string"&&(r=r.toString()),r}).join(this.delim)}}class sdt extends ETe{matchValue;constructor(e,t){super(e),typeof t=="number"?this.matchValue=t.toString():this.matchValue=t}match(e){return this.matchValue===e}}class GLr extends LYe{valField;constructor(e,t,r=!1){if(super(e,t,r),this.valField=this.cleanFieldName(e.field,t),e.classBreakInfos.forEach((n,s)=>{const o=s===0,a=new odt(this,n.minValue,n.maxValue,o);a.label=n.label||"",a.symbol=n.symbol,this.falseRenderer||(a.definitionClause=`(${this.valField} >${o?"=":""} ${n.minValue} AND ${this.valField} <= ${n.maxValue})`),this.symbolUnits.push(a)}),e.defaultSymbol){const n=new odt(this,0,0,!1);n.isDefault=!0,n.label=e.defaultLabel||"",n.symbol=e.defaultSymbol,n.definitionClause=this.makeElseClause(),this.defaultUnit=n}}makeSearchParams(e){return parseFloat(e[this.valField])}}class odt extends ETe{minValue;maxValue;firstBreak;constructor(e,t,r,n){super(e),this.minValue=t,this.maxValue=r,this.firstBreak=n}match(e){return this.minValue===this.maxValue?this.maxValue===e:this.firstBreak?this.minValue<=e&&this.maxValue>=e:this.minValue=e}}var Q6t={exports:{}};/*! +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}aL.prototype.build=function(i){return this.options.preserveOrder?uLr(i,this.options):(Array.isArray(i)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(i={[this.options.arrayNodeName]:i}),this.j2x(i,0).val)};aL.prototype.j2x=function(i,e){let t="",r="";for(let n in i)if(Object.prototype.hasOwnProperty.call(i,n))if(typeof i[n]>"u")this.isAttribute(n)&&(r+="");else if(i[n]===null)this.isAttribute(n)?r+="":n[0]==="?"?r+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+n+"/"+this.tagEndChar;else if(i[n]instanceof Date)r+=this.buildTextValNode(i[n],n,"",e);else if(typeof i[n]!="object"){const s=this.isAttribute(n);if(s)t+=this.buildAttrPairStr(s,""+i[n]);else if(n===this.options.textNodeName){let o=this.options.tagValueProcessor(n,""+i[n]);r+=this.replaceEntitiesValue(o)}else r+=this.buildTextValNode(i[n],n,"",e)}else if(Array.isArray(i[n])){const s=i[n].length;let o="";for(let a=0;a"u"||(l===null?n[0]==="?"?r+=this.indentate(e)+"<"+n+"?"+this.tagEndChar:r+=this.indentate(e)+"<"+n+"/"+this.tagEndChar:typeof l=="object"?this.options.oneListGroup?o+=this.j2x(l,e+1).val:o+=this.processTextOrObjNode(l,n,e):o+=this.buildTextValNode(l,n,"",e))}this.options.oneListGroup&&(o=this.buildObjectNode(o,n,"",e)),r+=o}else if(this.options.attributesGroupName&&n===this.options.attributesGroupName){const s=Object.keys(i[n]),o=s.length;for(let a=0;a"+i+n:this.options.commentPropName!==!1&&e===this.options.commentPropName&&s.length===0?this.indentate(r)+``+this.newLine:this.indentate(r)+"<"+e+t+s+this.tagEndChar+i+this.indentate(r)+n}};aL.prototype.closeTag=function(i){let e="";return this.options.unpairedTags.indexOf(i)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+``+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+t+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(e,i);return n=this.replaceEntitiesValue(n),n===""?this.indentate(r)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+t+">"+n+"0&&this.options.processEntities)for(let e=0;e0&&s.features[0].geometry.type===jp.POINT&&s.features.forEach(m=>{const v=m.geometry.coordinates;m.properties.rvInternalCoordX=v[0],m.properties.rvInternalCoordY=v[1]}),s}reversedAxisWKIDs(){return rkr}parseCapabilities(e){const t=()=>{let o=e;if(e.indexOf("?")===-1)o+="?service=WMS&request=GetCapabilities";else{const a=new sse(e.toUpperCase());"SERVICE"in a.queryMap||(o+="&service=WMS"),"REQUEST"in a.queryMap||(o+="&request=GetCapabilities")}return zi(o,{responseType:"xml"}).then(a=>a.data)},r=new Promise(o=>{t().then(a=>o(a)).catch(()=>{console.error("Get capabilities failed; trying the second time;"),o(t())})}),n=o=>{let a=o.Layer;return a?(Array.isArray(a)||(a=[a]),a.map(l=>{const u=l.Name,c=l.Title;let h=l.Style;const p=[],m={};return h&&(Array.isArray(h)||(h=[h]),h.forEach(v=>{const w=v.Name;if(p.push(w),v.LegendURL){const I=v.LegendURL.OnlineResource["@_xlink:href"];m[w]=I.replaceAll("&","&")}})),{name:u?.toString()??null,title:c,queryable:l["@_queryable"]==="1",layers:n(l),allStyles:p,styleToURL:m,currentStyle:p[0]}})):[]},s=o=>{let a=o.Format;return Array.isArray(a)||(a=[a]),a};return r.then(o=>{if(!o)return[];const a=new XMLSerializer().serializeToString(o),l={ignoreAttributes:!1},u=new vLr.XMLParser(l).parse(a);if("ServiceExceptionReport"in u)return console.error(u.ServiceExceptionReport.ServiceException),[];const c=u.WMS_Capabilities.Capability;return{layers:n(c),queryTypes:s(c.Request.GetFeatureInfo)}})}}class fq{static makeRawItem(e,t){const r=Promise.resolve();return Zl({format:e,data:t,started:!0,loaded:!0,loading:r,load(){return r}})}static makeOidItem(e,t){const r=new Af,n={format:z8.ESRI,data:void 0,started:!1,loaded:!1,loading:r.getPromise(),async load(){if(!this.started){this.started=!0;const s=await t.getGraphic(e,{getAttribs:!0});this.data=s.attributes,this.loaded=!0,r.resolveMe()}return r.getPromise()}};return Zl(n)}}class bLr extends tf{files;ogc;constructor(e){super(e),this.files=new ikr(e),this.ogc=new _Lr(e)}createLayer(e){let t;switch(e.layerType){case pn.FEATURE:t=TLr;break;case pn.MAPIMAGE:t=CLr;break;case pn.GRAPHIC:t=q6t;break;case pn.TILE:t=Y6t;break;case pn.WFS:t=OLr;break;case pn.DATATABLE:t=RLr;break;case pn.WMS:t=MLr;break;case pn.GEOJSON:t=wLr;break;case pn.CSV:t=SLr;break;case pn.DATAJSON:t=PLr;break;case pn.IMAGERY:t=ALr;break;case pn.SHAPEFILE:t=xLr;break;case pn.OSM:t=ILr;break;default:throw new Error("Unsupported Layer Type "+e.layerType)}return new t(e,this.$iApi)}getLayer(e){return H1(this.$vApp.$pinia).getLayerByAny(e)}getSublayer(e,t){const r=H1(this.$vApp.$pinia).getLayerById(e);if(r&&r.supportsSublayers&&ts===r);return n===-1?void 0:n}else return}layerOrderIds(){return H1(this.$vApp.$pinia).mapOrder.slice(0)||[]}allLayers(){return H1(this.$vApp.$pinia).layers||[]}allActiveLayers(){return this.allLayers().filter(e=>e.layerState!==Ud.ERROR&&e.initiationState===ey.INITIATED)}allLayersOnMap(e=!0){let t=this.allLayers().filter(r=>r.mapLayer&&r.initiationState===ey.INITIATED);if(e){const r=this.layerOrderIds(),n=new Map(r.map((s,o)=>[s,o]));t.sort((s,o)=>n.get(s.id)-n.get(o.id))}return t}allDataLayers(){return this.allLayers().filter(e=>!e.mapLayer&&e.initiationState===ey.INITIATED)}allErrorLayers(){return this.allLayers().filter(e=>e.layerState===Ud.ERROR)}allInitiatingLayers(){return this.allLayers().filter(e=>e.initiationState===ey.INITIATING)}getLayerControls(e){const t=this.getLayer(e);if(!t)return;const r=t.config.controls?.slice()??[ya.BoundaryZoom,ya.Datatable,ya.Identify,ya.Metadata,ya.Opacity,ya.Refresh,ya.Reload,ya.Remove,ya.Settings,ya.Symbology,ya.Visibility],n=[];return t.supportsFeatures||n.push(ya.Datatable),t.extent===void 0&&n.push(ya.BoundaryZoom),(t.config?.metadata||(t.isSublayer?t.parentLayer?.config?.metadata:{})||{}).url||n.push(ya.Metadata),!t.mapLayer&&!t.config.controls?.includes(ya.Settings)&&n.push(ya.Settings),n.forEach(o=>{const a=r?.indexOf(o)??-1;a!==-1&&r?.splice(a,1)}),{controls:r,disabledControls:t.config.disabledControls??[]}}async loadLayerMetadata(e){if(!e.trim())throw new Error("url missing on layer server metadata request.");const[t,r]=await _k(zi(e,{query:{f:"json"}}));if(!r)throw console.error(`Service metadata load error: ${e}`,t),new Error(`Service metadata load error: ${e}`);if(!r.data)throw console.error(`Service metadata load error: ${e}`),new Error(`Service metadata load error: ${e}`);const n=r.data,s={geometryType:cl.NONE,minScale:0,maxScale:0,canModifyLayer:!0,extent:void 0,defaultVisibility:!0,fields:[],displayField:"",objectIdField:"",renderer:void 0,currentVersion:0,name:"",dataFormat:l0.UNKNOWN,mapLayer:!0};if(s.name=n.name||"",s.currentVersion=n.currentVersion||-1,s.minScale=n.effectiveMinScale||n.minScale||0,s.maxScale=n.effectiveMaxScale||n.maxScale||0,s.extent=n.extent?Yh.fromArcServer(n.extent,"layer_extent"):void 0,s.defaultVisibility=n.defaultVisibility??!0,s.canModifyLayer=n.canModifyLayer??!0,n.type==="Feature Layer"||n.type==="Table"){if(s.dataFormat=l0.ESRI_FEATURE,s.displayField=n.displayField||"",Array.isArray(n.fields)){const o=n.fields.map(l=>Fo.fromJSON(l));s.fields=o.map(l=>({name:l.name,alias:l.alias,type:l.type,length:l.length})),o.every(l=>l.type==="oid"?(s.objectIdField=l.name,!1):!0)&&(s.objectIdField=n.objectIdField||(console.error(`Encountered service with no OID defined: ${e}`),"")),n.type==="Feature Layer"?(s.geometryType=this.$iApi.geo.geom.serverGeomTypeToRampGeomType(n.geometryType),n?.drawingInfo?.renderer&&(s.renderer=YC(n.drawingInfo.renderer))):s.mapLayer=!1}}else s.dataFormat=l0.ESRI_RASTER;return s}async loadFeatureCount(e,t=""){if(!e)return console.error("A layer without a url attempted to run the server based feature count routine."),0;const r={query:{f:"json",where:t||"1=1",returnCountOnly:!0,returnGeometry:!1}},[n,s]=await _k(zi(`${e}/query`,r));return s?s.data?Number.isInteger(s.data.count)?s.data.count:(console.error(`Funny result (${s.data.count}) during feature count: ${e}`),0):(console.error(`Unable to load feature count: ${e}`),0):(console.error(`Feature count request unsuccessful: ${e}`,n),0)}}class Rse extends tf{config={};id;uid;name;layerState;initiationState;drawState;layerIdx;layerType;layerFormat;dataFormat;supportsIdentify;supportsFeatures;mapLayer;featureCount;fields;fieldList;nameField;oidField;expectedTime;supportsSublayers;isSublayer;isRemoved;isFile;isCosmetic;userAdded;identify;identifyMode;hovertips;geomType;legend;maxLoadTime;esriLayer;esriSubLayer;esriView;extent;canModifyLayer;canReload;url;_parentLayer;_sublayers;constructor(e,t){super(t),this.config=e,this.id="",this.uid="",this.name="error",this.layerState=Ud.NEW,this.drawState=fb.NOT_LOADED,this.initiationState=ey.NEW,this.layerIdx=-1,this.layerFormat=zx.UNKNOWN,this.layerType=pn.UNKNOWN,this.dataFormat=l0.UNKNOWN,this.supportsIdentify=!1,this.identifyMode=sg.NONE,this.supportsFeatures=!1,this.mapLayer=!0,this.featureCount=0,this.fields=[],this.fieldList="",this.nameField="",this.oidField="",this.supportsSublayers=!1,this.isSublayer=!1,this.isRemoved=!1,this.isFile=!1,this.isCosmetic=!1,this.userAdded=!1,this.identify=!1,this.hovertips=!1,this.geomType=cl.UNKNOWN,this.legend=[],this._sublayers=[],this.expectedTime={draw:0,load:0},this.maxLoadTime=0,this.canModifyLayer=!0,this.canReload=!0,this.url=""}async initiate(){return Promise.resolve()}async terminate(){return Promise.resolve()}async reload(){return Promise.resolve()}loadPromise(){return Promise.resolve()}get isLoaded(){return!1}get layerExists(){return!1}getLayerTree(){return new q1e(0,"Fake tree","getLayerTree() was not implemented in layer")}getSR(){return xl.latLongSR()}get visibility(){return!1}set visibility(e){}get opacity(){return 0}set opacity(e){}get scaleSet(){return new EFt}set scaleSet(e){}isOffscale(e=void 0){return!1}zoomToVisibleScale(){return Promise.resolve()}zoomToLayerBoundary(){return Promise.resolve()}get mouseTolerance(){return 0}set mouseTolerance(e){}get touchTolerance(){return 0}set touchTolerance(e){}get drawOrder(){return[]}canIdentify(){return!1}runIdentify(e){return[]}getAttributes(){return Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){}clearFeatureCache(){}downloadedAttributes(){return 0}attribLoadAborted(){return!1}getTabularAttributes(){return Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,t){return Promise.resolve(new Ax(new Kk))}getIcon(e){return Promise.resolve("")}getSqlFilter(e){return""}setSqlFilter(e,t){}applySqlFilter(e=[]){}getFilterOIDs(e=[],t=void 0){return Promise.resolve(void 0)}getGraphicExtent(e){return Promise.resolve(Yh.fromParams("fake",0,0,0,0))}get parentLayer(){if(this.isSublayer)return this._parentLayer;throw new Error("Attempted to get parent layer of a non-sublayer object")}set parentLayer(e){if(!this.isSublayer&&e)throw new Error("Attempted to set parent layer for a non-sublayer object");this._parentLayer=e}get sublayers(){return this._sublayers}onLoad(){}onError(){}updateLayerState(e){}updateDrawState(e){}updateInitiationState(e){}uidToIdx(e){if(e===this.uid)return-1;{const t=this._sublayers.findIndex(r=>r?.uid===e);if(t===-1)throw new Error(`Attempt to access non-existing unique id [layerid ${this.id}, uid ${e}]`);return t}}getSublayer(e){if(!this.supportsSublayers){console.warn(`Attempted to call getSublayer on a layer (layer id: ${this.id}) that does not support FCs`);return}let t;if(typeof e=="string"?t=this.uidToIdx(e):t=e,this._sublayers[t]===void 0)throw new Error(`Attempt to access non-existing layer index [layerid ${this.id}, lookup value ${e}]`);return this._sublayers[t]}controlAvailable(e){const t=this.$iApi.geo.layer.getLayerControls(this.id);return t?.disabledControls?.includes(e)?!1:t?.controls.includes(e)??!1}}class H6t extends Rse{timers;origRampConfig;loadDefProm;loadPromFulfilled;layerTree;constructor(e,t){super(e,t),this.name=e.name||"",this.geomType=cl.NONE,this.dataFormat=l0.UNKNOWN,this.layerType=pn.UNKNOWN,this.layerFormat=zx.UNKNOWN;const r=t.geo.map.layerDefaultTimes;this.expectedTime.draw=e.expectedDrawTime??r.draw,this.expectedTime.load=e.expectedLoadTime??r.draw,this.timers={draw:void 0,load:void 0},this.origRampConfig=e,this.id=e.id||"",this.uid=this.$iApi.geo.shared.generateUUID(),this.isCosmetic=!1,this.isRemoved=!1,this.isSublayer=!1,this.supportsIdentify=!1,this.mapLayer=!0,this.identifyMode=sg.NONE,this.supportsFeatures=!1,this.hovertips=!1,this.supportsSublayers=!1,this.isFile=!1,this.layerState=Ud.NEW,this.initiationState=ey.NEW,this.drawState=fb.NOT_LOADED,this.loadDefProm=new Af,this.url=this.origRampConfig.url,this.canReload=!!(this.url||this.origRampConfig.caching),this.loadPromFulfilled=!1,this.layerTree=new q1e(0,this.uid,this.name,!0),this.maxLoadTime=e.maxLoadTime??2e4}updateInitiationState(e){this.initiationState=e,this.$iApi.event.emit(ln.LAYER_INITIATIONSTATECHANGE,{state:e,layer:this})}updateLayerState(e){this.layerState=e,this.$iApi.event.emit(ln.LAYER_LAYERSTATECHANGE,{state:e,layer:this})}updateDrawState(e){this.drawState=e,e===fb.REFRESH?this.startTimer("draw"):e===fb.UP_TO_DATE&&this.stopTimer("draw"),this.$iApi.event.emit(ln.LAYER_DRAWSTATECHANGE,{state:e,layer:this})}async initiate(){this.updateInitiationState(ey.INITIATING),this.startTimer("load");const[e]=await _k(this.onInitiate());this.drawState!==fb.UP_TO_DATE&&this.startTimer("draw"),e&&(console.error(e.message),this.onError()),this.updateInitiationState(ey.INITIATED)}async onInitiate(){if(this.isSublayer)return console.warn("Attempted to initiate a sublayer as a CommonLayer"),Promise.resolve();this.initiationState===ey.INITIATED&&console.error(`Encountered layer initialize while already initiated, layer id ${this.id}`)}async terminate(){this.updateInitiationState(ey.TERMINATING),await Promise.all(this.sublayers.map(e=>e.terminate())),this.loadDefProm=new Af,this.loadPromFulfilled=!1,this.updateLayerState(Ud.NEW),this.updateDrawState(fb.NOT_LOADED),this.updateInitiationState(ey.TERMINATED)}onLoad(){let e=!1;const t=setTimeout(()=>{this.maxLoadTime&&(e=!0,this.onError())},this.maxLoadTime);try{const r=this.onLoadActions();Promise.all(r).then(()=>{clearTimeout(t),e?this.visibility=!1:(this.loadPromFulfilled&&(this.loadDefProm=new Af),this.loadDefProm.resolveMe(),this.loadPromFulfilled=!0,this.stopTimer("load"),this.sublayers.forEach(n=>n.onLoad()),this.updateLayerState(Ud.LOADED))}).catch(()=>{clearTimeout(t),this.onError()})}catch(r){console.error("Encountered error on layer load: ",r),clearTimeout(t),this.onError()}}onError(){this.loadPromFulfilled&&(this.loadDefProm=new Af),this.loadDefProm.rejectMe(),this.loadPromFulfilled=!0,this.sublayers.forEach(e=>e.onError()),this.$iApi.notify.show(K1.ERROR,this.$iApi.$i18n.t("layer.error",{id:this.id})),this.stopTimer("draw"),this.stopTimer("load"),this.updateLayerState(Ud.ERROR)}onLoadActions(){return[]}loadPromise(){return this.loadDefProm.getPromise()}get isLoaded(){return this.layerState===Ud.LOADED}canIdentify(){return this.supportsIdentify&&this.isLoaded&&this.visibility&&this.identify&&!this.scaleSet.isOffScale(this.$iApi.geo.map.getScale()).offScale}getLayerTree(){return this.layerTree}stubError(){throw new Error(`Attempted to use a method not valid for ${this.layerType}`)}getAttributes(){return this.stubError(),Promise.resolve({features:[],oidIndex:{}})}abortAttributeLoad(){this.stubError()}clearFeatureCache(){this.stubError()}getTabularAttributes(){return this.stubError(),Promise.resolve({columns:[],rows:[],fields:[],oidField:"error"})}getGraphic(e,t){return this.stubError(),Promise.resolve(new Ax(new Kk))}getIcon(e){return this.stubError(),Promise.resolve("")}getSqlFilter(e){return this.stubError(),""}setSqlFilter(e,t){this.stubError()}getFilterOIDs(e=[],t=void 0){return this.stubError(),Promise.resolve(void 0)}getGraphicExtent(e){return this.stubError(),Promise.resolve(Yh.fromParams("fake",0,0,0,0))}applySqlFilter(e=[]){this.stubError()}setCustomParameter(e,t,r=!0){this.stubError()}startTimer(e){this.stopTimer(e),this.expectedTime[e]>0&&(this.timers[e]=window.setTimeout(()=>this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t(`layer.long${e}`,{id:this.name||this.id})),this.expectedTime[e]))}stopTimer(e){this.timers[e]&&(clearTimeout(this.timers[e]),this.timers[e]=void 0)}}class o7 extends H6t{_serverVisibility;_scaleSet;_mouseTolerance;_touchTolerance;_drawOrder;_lastFilterUpdate="";viewDefProm;esriWatches;constructor(e,t){super(e,t),this._scaleSet=new EFt,this._mouseTolerance=e.mouseTolerance!=null?e.mouseTolerance:5,this._touchTolerance=e.touchTolerance!=null?e.touchTolerance:15,this._drawOrder=[],this._serverVisibility=void 0,this.isCosmetic=e.cosmetic||!1,this.extent=e.extent?Yh.fromConfig(`${this.id}_extent`,e.extent):void 0,this.viewDefProm=new Af,this.esriWatches=[]}noLayerErr(){console.error("Attempted to manipulate the layer but no layer found. Likely .initiate() was not finished or failed."),console.trace()}async onInitiate(){if(await super.onInitiate(),!this.esriLayer){this.noLayerErr();return}this.esriWatches.push(this.esriLayer.watch("visible",e=>{this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("opacity",e=>{this.$iApi.event.emit(ln.LAYER_OPACITYCHANGE,{opacity:e,layer:this})})),this.esriWatches.push(this.esriLayer.watch("loadStatus",e=>{const t={"not-loaded":Ud.LOADING,loading:Ud.LOADING,loaded:Ud.LOADED,failed:Ud.ERROR};e==="loaded"?this.onLoad():e==="failed"?this.onError():this.updateLayerState(t[e])})),this.esriLayer.on("layerview-create",e=>{this.esriView=e.layerView,this.esriWatches.push(e.layerView.watch("updating",t=>{this.updateDrawState(t?fb.REFRESH:fb.UP_TO_DATE)})),this.viewDefProm.resolveMe()}),this.sublayers.forEach(e=>e.initiate())}async terminate(){await super.terminate(),this.viewDefProm=new Af,this.esriWatches.forEach(e=>e.remove()),this.esriWatches=[]}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}if(this.initiationState===ey.INITIATED&&(this.esriLayer&&this.$iApi.geo.map.esriMap.layers.findIndex(t=>t.id===this.id)>-1&&this.$iApi.geo.map.esriMap.layers.remove(this.esriLayer),this.$iApi.event.emit(ln.LAYER_RELOAD_START,this),this.sublayers.forEach(e=>this.$iApi.event.emit(ln.LAYER_RELOAD_START,e)),await this.terminate()),await this.initiate(),!this.esriLayer){console.error("ESRI layer failed to re-create during reload.");return}this.$iApi.geo.map.insertToEsriMap(this),this.$iApi.event.emit(ln.LAYER_RELOAD_END,this),this.sublayers.forEach(e=>this.$iApi.event.emit(ln.LAYER_RELOAD_END,e))}makeEsriLayerConfig(e){return{id:e.id,url:e.url,opacity:e?.state?.opacity??1,visible:e?.state?.visibility??!0}}onLoadActions(){const e=super.onLoadActions();this.name||(this.name=this.esriLayer?.title||this.id),this.isCosmetic||(this.identify=this.config.state?.identify??this.supportsIdentify);const t=this.$iApi.geo.proj.checkProj(this.getSR()).then(r=>r?Promise.resolve():Promise.reject());return e.push(t),e}mapCheck(){return this.$iApi.geo.map.created?!0:(console.error("Attempting to use map-dependent logic before the layer has been added to the map"),console.trace(),!1)}get scaleSet(){return this._scaleSet}set scaleSet(e){this._scaleSet=e}isOffscale(e=void 0){let t;if(typeof e>"u")if(this.mapCheck())t=this.$iApi.geo.map.getScale();else return!1;else t=e;return this.scaleSet.isOffScale(t).offScale}zoomToVisibleScale(){return this.mapCheck()?this.$iApi.geo.map.zoomToVisibleScale(this.scaleSet):Promise.resolve()}zoomToLayerBoundary(){return this.extent?this.mapCheck()?this.$iApi.geo.map.zoomMapTo(this.extent):Promise.resolve():(console.error(`Attempted to zoom to boundary of a layer with no extent (Layer Id: ${this.id})`),Promise.resolve())}get mouseTolerance(){return this._mouseTolerance}set mouseTolerance(e){if(!this.supportsIdentify){console.warn("Attempted to set click tolerance on a layer that doesn't support identify");return}if(e<0){console.error("Attempted to set a negative click tolerance");return}this._mouseTolerance=e}get touchTolerance(){return this._touchTolerance}set touchTolerance(e){if(!this.supportsIdentify){console.warn("Attempted to set touch tolerance on a layer that doesn't support identify");return}if(e<0){console.error("Attempted to set a negative touch tolerance");return}this._touchTolerance=e}get layerExists(){return!!this.esriLayer}get drawOrder(){return this._drawOrder}get visibility(){return this.esriLayer?this.esriLayer.visible:(this.noLayerErr(),!1)}set visibility(e){this.esriLayer?this.esriLayer.visible=e:this.noLayerErr()}checkVisibility(){this.supportsSublayers&&(this.visibility=this.sublayers.some(e=>e.visibility))}get opacity(){return this.esriLayer?this.esriLayer.opacity:(this.noLayerErr(),0)}set opacity(e){this.esriLayer?this.esriLayer.opacity=e:this.noLayerErr()}getSR(){return this.esriLayer?xl.fromESRI(this.esriLayer.spatialReference):(this.noLayerErr(),xl.latLongSR())}}class FYe extends o7{attribs;renderer;serviceUrl;canModifyLayer;filter;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.geomType=cl.UNKNOWN,this.serviceUrl="",this.fieldList="",this.canModifyLayer=!0,this.filter=new IFt(e.permanentFilteredQuery||"",e.initialFilteredQuery||""),this.hovertips=e.state?.hovertips??!0,this.attribs=new J6t}notLoadedErr(){console.error("Attempted to manipulate the layer before it was loaded"),console.trace()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}async loadLayerMetadata(e={}){if(!this.serviceUrl)return;const t=await this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl);if(this.geomType=t.geometryType,this.attribs.quickCache=new Z6t(this.geomType),this.scaleSet.minScale=t.minScale,this.scaleSet.maxScale=t.maxScale,this.dataFormat=t.dataFormat,this.extent=this.extent??t.extent,this._serverVisibility=t.defaultVisibility,this.dataFormat===l0.ESRI_FEATURE){this.supportsFeatures=!0,this.canModifyLayer=this.layerType===pn.SUBLAYER?t.canModifyLayer:!0,this.fields=t.fields,this.nameField=t.displayField,this.oidField=t.objectIdField,this.drawOrder.forEach(s=>{s.field&&this.fields.findIndex(o=>o.name===s.field)===-1&&console.error(`Draw order for layer ${this.id} references invalid field ${s.field}`)});const r=e&&e.customRenderer&&e.customRenderer.type?e.customRenderer:t.renderer;this.renderer=this.$iApi.geo.symbology.makeRenderer(r,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const n={supportsLimit:(t.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:"*",permanentFilter:this.getSqlFilter(pm.PERMANENT)};this.attribs.attLoader=new K6t(this.$iApi,n),this.origRampConfig.name||(this.name=t.name??this.id)}else this.supportsFeatures=!1}getAttributes(){return this.attribs.attLoader.getAttribs()}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(e,t){let r={},n=new Kk;const s=this.$iApi.geo.map;let o=!1,a=!1,l=0;if(t.getAttribs||t.getStyle){const c=this.attribs.quickCache.getAttribs(e);if(c)r=c;else if(this.attribs.attLoader.isLoaded()||this.isFile){const h=await this.attribs.attLoader.getAttribs();r=h.features[h.oidIndex[e]]}else o=!0}if(t.getGeom){l=s.getScale();const c=this.attribs.quickCache.getGeom(e,l);c?n=c:a=!0}if(o||a){const c={oid:e,serviceUrl:this.serviceUrl,includeGeometry:a,attribs:this.fieldList};a&&(c.mapSR=s.getSR().wkid?.toString(),this.attribs.quickCache.isPoint||(c.maxOffset=s.esriView?.resolution));const h=await this.$iApi.geo.attributes.loadSingleFeature(c);a&&(this.attribs.quickCache.setGeom(e,h.geometry,l),n=h.geometry),(o||typeof this.attribs.quickCache.getAttribs(e)>"u")&&(this.attribs.quickCache.setAttribs(e,h.attributes),o&&(r=h.attributes))}const u=new Ax(n,"",t.getAttribs?r:void 0);if(t.getStyle){const c=Qs(this.renderer.getGraphicSymbol(r));u.style=this.$iApi.geo.geom.styleEsriToRamp(c)}return u}async getIcon(e){if(!this.renderer)throw new Error("getIcon called before renderer is defined");const t=await this.getGraphic(e,{getAttribs:!0});return this.$iApi.geo.symbology.getGraphicIcon(t.attributes||{},this.renderer)}setSqlFilter(e,t){const r=this.filter.getSql(e);if(t===r)return;this.filter.setSql(e,t),this.$iApi.event.emit(ln.FILTER_CHANGE,{uid:this.uid,filterKey:e});const n=`${this.uid}-${e}-${t}`;this._lastFilterUpdate=n,setTimeout(()=>{this._lastFilterUpdate===n&&this.applySqlFilter()},100)}applySqlFilter(e=[]){throw new Error(`attempted to apply sql filter ${e} to a layer not equipped for it. likely a new subclass of AttribLayer did not override applySqlFilter`)}getSqlFilter(e){return this.filter.getSql(e)}getCombinedSqlFilter(e){return this.filter.getCombinedSql(e)}async getFilterOIDs(e=[],t=void 0){const r=this.filter.getCombinedSql(e),n=!!t;if(!(r||n))return;t&&this.filter.setExtent(t);const s=this.filter.sqlActiveFilters(e);let o=this.filter.getCache(s,n);if(!o){const a={filterGeometry:t,filterSql:r,includeGeometry:!1};o=this.queryOIDs(a),this.filter.setCache(o,s,n)}return o}queryOIDs(e){this.isFile&&(console.error("a file layer called a server based query function"),console.trace());const t={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(t)}async queryFeaturesDiscrete(e){const t=await this.queryOIDs(e),r={getGeom:!!e.includeGeometry,getAttribs:!0};return t.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const t=await this.queryFeaturesDiscrete(e);return Promise.all(t.map(r=>r.graphic))}configDrawOrder(e,t){Array.isArray(e.drawOrder)&&e.drawOrder.length>0&&(t.orderBy=e.drawOrder.map(r=>{const n=r.ascending??!0?"ascending":"descending";return r.field?{field:r.field,order:n}:{valueExpression:r.arcade,order:n}}),this._drawOrder=e.drawOrder.slice())}}class W6t extends o7{constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.GRAPHIC,this.hovertips=!1}_graphics=[];makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}getGraphicCount(){return this._graphics.length}getLocalGraphic(e){return this._graphics.find(t=>t.id===e)}getEsriGraphic(e){return this.esriLayer?.graphics.find(t=>t.id===e)}notLoadedErr(){console.error("Attempted to manipulate the layer before it was loaded"),console.trace()}get graphics(){return this._graphics.slice()}async addGraphic(e){if(!this.esriLayer){this.noLayerErr();return}let t;e instanceof Array?t=e:t=[e];const r=t.filter(l=>this._graphics.findIndex(c=>c.id===l.id)===-1?(this._graphics.push(l),!0):(console.error(`Attempting to add graphic with id '${l.id}' that has already been added.`),!1)),n=this.$iApi.geo.map.getSR(),s=r.map(l=>this.$iApi.geo.proj.projectGeometry(n,l.geometry)),o=await Promise.all(s),a=r.map((l,u)=>{const c=new Ax(o[u],l.id,l.attributes);return c.style=l.style,this.$iApi.geo.geom.graphicRampToEsri(c)});this.esriLayer.addMany(a)}removeGraphic(e){if(!this.esriLayer){this.noLayerErr();return}if(typeof e>"u"){this.esriLayer.removeAll(),this._graphics=[];return}let t;Array.isArray(e)?t=e:t=[e],t.map(n=>typeof n=="string"?n:n.id).forEach(n=>{const s=this.esriLayer.graphics.findIndex(a=>a.id===n);s>-1&&this.esriLayer.graphics.removeAt(s);const o=this._graphics.findIndex(a=>a.id===n);o>-1&&this._graphics.splice(o,1)})}}class q6t extends W6t{constructor(e,t){super(e,t),this.layerType=pn.GRAPHIC}async onInitiate(){this.esriLayer=Da(new nHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();return this.layerTree.name=this.name,this.updateDrawState(fb.UP_TO_DATE),e}}class CTe extends FYe{esriJson;sourceGeoJson;tooltipField;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.isFile=!0,this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.FEATURE,this.tooltipField="",e.identifyMode&&e.identifyMode!==sg.NONE?this.identifyMode=e.identifyMode:this.identifyMode=sg.HYBRID}async reload(){if(this.origRampConfig.caching!==!0&&!this.origRampConfig.url){console.error("Attempted to reload file layer from non server source without caching enabled.");return}await super.reload()}async onInitiate(){if(!this.sourceGeoJson)throw new Error("File Layer is missing source data.");const e={layerId:this.origRampConfig.id||"",targetSR:this.$iApi.geo.map.getSR(),...this.origRampConfig.latField&&{latField:this.origRampConfig.latField},...this.origRampConfig.longField&&{lonField:this.origRampConfig.longField},colour:this.origRampConfig.colour,fieldMetadata:this.origRampConfig.fieldMetadata};this.esriJson=await this.$iApi.geo.layer.files.geoJsonToEsriJson(this.sourceGeoJson,e),this.esriLayer=Da(new yh(this.makeEsriLayerConfig(this.origRampConfig))),this.esriJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData,delete this.sourceGeoJson,await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e),r="OBJECTID";return["source","objectIdField","id","fields","renderer","spatialReference","geometryType"].forEach(s=>{t[s]=this.esriJson[s]}),this.origRampConfig.nameField?t.displayField=this.$iApi.geo.attributes.fieldValidator(t.fields,this.origRampConfig.nameField)||r:t.displayField=r,t.outFields=["*"],delete t.url,this.configDrawOrder(e,t),t}onLoadActions(){const e=super.onLoadActions();return this.esriLayer&&this.origRampConfig.customRenderer?.type&&(this.esriLayer.renderer=YC(this.config.customRenderer)),this.layerTree.name=this.name,this.extractLayerMetadata(),this.origRampConfig.tooltipField?this.tooltipField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.tooltipField)||this.nameField:this.tooltipField=this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList),this.featureCount=this.esriLayer?.source.length||0,e.push(this.viewDefProm.getPromise()),this.filter.getCombinedSql()&&Promise.all(e).then(()=>{this.applySqlFilter()}),e}runIdentify(e){if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[],a=[];if(this.identifyMode===sg.HYBRID||this.identifyMode===sg.GEOMETRIC){const l={includeGeometry:!1};this.geomType!==cl.POLYGON&&e.geometry.type===cl.POINT?l.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):l.filterGeometry=e.geometry,l.filterSql=this.getCombinedSqlFilter(),s=this.queryFeatures(l).then(u=>{o=u})}return e.hitTest&&(this.identifyMode===sg.HYBRID||this.identifyMode===sg.SYMBOLIC)&&(n=s.then(async()=>{const l=await e.hitTest;a=await Promise.all(l.filter(u=>u.layerId===this.id&&o.findIndex(c=>u.oid===c.attributes[this.oidField])===-1).map(u=>u.oid))})),Promise.all([n,s]).then(()=>{o.forEach(l=>{r.items.push(fq.makeRawItem(z8.ESRI,l.attributes))}),a.forEach(l=>{r.items.push(fq.makeOidItem(l,this))}),r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}extractLayerMetadata(){const e=this.esriLayer;if(!e)throw new Error("file layer attempted to extract data from esri layer, esri layer did not exist");this.supportsFeatures=!0,this.geomType=this.$iApi.geo.geom.clientGeomTypeToRampGeomType(e.geometryType),this.scaleSet.minScale=e.minScale||0,this.scaleSet.maxScale=e.maxScale||0,this.extent=this.extent??Yh.fromESRI(e.fullExtent,this.id+"_extent");const t=Da(e.fields.slice());this.fields=t.map(n=>({name:n.name,alias:n.alias,type:n.type,length:n.length})),this.nameField=e.displayField,this.oidField=e.objectIdField,this.renderer=this.$iApi.geo.symbology.makeRenderer(e.renderer,this.fields),this.legend=this.$iApi.geo.symbology.rendererToLegend(this.renderer);const r={sourceGraphics:e.source,oidField:this.oidField,attribs:"*",batchSize:-1};this.attribs.attLoader=new FLr(this.$iApi,r)}async getGraphic(e,t){let r;if(!t.getGeom&&this.attribs.attLoader.isLoaded()){const n=await this.attribs.attLoader.getAttribs();r=new Ax(new Kk,"",n.features[n.oidIndex[e]])}else{const n={filterOIDs:[e],includeGeometry:!!t.getGeom},s=await this.queryFeatures(n);if(s.length===0)throw new Error(`Could not find object id ${e}`);s.length!==1&&console.warn("did not get a single result on a query for a specific object id"),r=s[0]}if(t.getStyle){const n=Qs(this.renderer.getGraphicSymbol(r.attributes));r.style=this.$iApi.geo.geom.styleEsriToRamp(n)}return r}async queryFeatures(e){const t={layer:this,...e};return this.$iApi.geo.query.geoJsonQuery(t)}async queryOIDs(e){const t={layer:this,...e};return(await this.$iApi.geo.query.geoJsonQuery(t)).map(n=>n.attributes?n.attributes[this.oidField]:-1)}applySqlFilter(e=[]){if(!this.esriView){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);Qs(this.esriView).filter=new QF({where:t})}}class wLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.GEOJSON}async onInitiate(){if(this.origRampConfig.rawData)this.sourceGeoJson=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)this.sourceGeoJson=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("GeoJson layer config contains no raw data or url");await super.onInitiate()}}class xLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.SHAPEFILE}async onInitiate(){let e;if(this.origRampConfig.rawData&&this.origRampConfig.rawData instanceof ArrayBuffer)e=this.origRampConfig.rawData;else if(this.origRampConfig.url)e=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("shapefile config contains no url or no/invalid raw data");this.sourceGeoJson=await this.$iApi.geo.layer.files.shapefileToGeoJson(e),await super.onInitiate()}}class SLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.CSV}async onInitiate(){if(!this.origRampConfig.latField||!this.origRampConfig.longField)throw new Error("csv file config missing lat or long field names");let e;if(this.origRampConfig.rawData&&typeof this.origRampConfig.rawData=="string")e=this.origRampConfig.rawData;else if(this.origRampConfig.url)e=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Csv file config contains no raw data or url");this.sourceGeoJson=await this.$iApi.geo.layer.files.csvToGeoJson(e,{latfield:this.origRampConfig.latField,lonfield:this.origRampConfig.longField}),await super.onInitiate()}}class TLr extends FYe{tooltipField;constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.tooltipField="",this.supportsIdentify=!0,this.layerType=pn.FEATURE,this.layerFormat=zx.FEATURE,e.identifyMode&&e.identifyMode!==sg.NONE?this.identifyMode=e.identifyMode:this.identifyMode=sg.HYBRID}async onInitiate(){Da(this.esriLayer=new yh(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e);return(e.initialFilteredQuery||e.permanentFilteredQuery)&&(t.definitionExpression=this.filter.getCombinedSql()),this.configDrawOrder(e,t),t}onLoadActions(){const e=super.onLoadActions(),t=this.esriLayer&&this.origRampConfig.customRenderer?.type;t&&(this.esriLayer.renderer=YC(this.origRampConfig.customRenderer));const r=this.esriLayer.parsedUrl.path,s=this.$iApi.geo.shared.parseUrlIndex(r).index||0;this.serviceUrl=r;const o=this.loadLayerMetadata(t?{customRenderer:this.esriLayer?.renderer}:{}).then(()=>{this.visibility=this.origRampConfig?.state?.visibility??this._serverVisibility??!0,this.nameField=this.origRampConfig.nameField||this.nameField||"",this.tooltipField=this.origRampConfig.tooltipField||this.nameField,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.attribs.attLoader.updateFieldList(this.fieldList)}),a=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(pm.PERMANENT)).then(l=>{this.featureCount=l});return this.layerTree.name=this.name,this.layerTree.layerIdx=s,e.push(o,a),e}runIdentify(e){if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});let n=Promise.resolve(),s=Promise.resolve(),o=[];if(this.identifyMode===sg.HYBRID||this.identifyMode===sg.GEOMETRIC){const a={includeGeometry:!1};this.geomType!==cl.POLYGON&&e.geometry.type===cl.POINT?a.filterGeometry=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance):a.filterGeometry=e.geometry,a.filterSql=this.getCombinedSqlFilter(),s=this.queryOIDs(a).then(l=>{o=l})}return e.hitTest&&(this.identifyMode===sg.HYBRID||this.identifyMode===sg.SYMBOLIC)&&(n=s.then(async()=>{(await e.hitTest).filter(l=>l.layerId===this.id&&o.findIndex(u=>l.oid===u)===-1).forEach(l=>{o.push(l.oid)})})),Promise.all([n,s]).then(()=>{o.forEach(a=>{r.items.push(fq.makeOidItem(a,this))}),r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}applySqlFilter(e=[]){if(!this.esriLayer){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);this.esriLayer.definitionExpression=t}getGraphicExtent(e){return new Promise((t,r)=>{if(!this.esriLayer)this.noLayerErr(),r();else if(!["multipoint","polyline","polygon"].includes(this.esriLayer.geometryType))console.error(`Attempted to query extent for invalid geometry type ${this.esriLayer.geometryType}.`),r();else{const n=this.attribs.quickCache.getExtent(e);n?t(n):this.esriLayer.queryExtent({objectIds:[e],outSpatialReference:this.$iApi.geo.map.getSR().toESRI()}).then(s=>{const o=Yh.fromESRI(s.extent);this.attribs.quickCache.setExtent(e,o),t(o)}).catch(()=>{console.error(`Extent querying failed for ${e}.`),r()})}})}}class CLr extends o7{isDynamic;origState;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.supportsSublayers=!0,this.layerType=pn.MAPIMAGE,this.layerFormat=zx.MAPIMAGE,this.isDynamic=!1,this.hovertips=!1,this.layerTree.layerIdx=-1,this.identifyMode=sg.GEOMETRIC}async onInitiate(){this.esriLayer=Da(new qHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e);return this.origState={visibility:t.visible,opacity:t.opacity},t.visible=!1,e.imageFormat&&(t.imageFormat=e.imageFormat),t}onLoadActions(){const e=super.onLoadActions();if(!this.esriLayer)return this.noLayerErr(),e;if(this.layerTree.name=this.name,!this.esriLayer.capabilities.exportMap)throw this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.noexportmap",{name:this.name||this.id})),new Error("Service does not support Map Image Layer, Map Export is not enabled");this.isDynamic=this.esriLayer.capabilities.exportMap.supportsDynamicLayers,this.extent=this.extent??Yh.fromESRI(this.esriLayer.fullExtent,this.id+"_extent");const t=o=>{const a=this.esriLayer?.allSublayers.find(l=>l.id===o);if(!a)throw new Error("attempt to find map image sublayer failed");return a},r={};this.origRampConfig.sublayers.forEach(o=>{r[o.index||0]=o});const n=[],s=(o,a)=>{const l=o.id,u=r[l];if(o.sublayers&&o.sublayers.length>0){const c=(u?u.name:"")||o.title||"",h=new q1e(l,"",c,!1);a.findChildByIdx(l)||a.children.push(h),o.sublayers.reverse().forEach(p=>{s(p,h)})}else{this._sublayers[l]||(this._sublayers[l]=new ELr({id:`${this.id}-${l}`,index:l,layerType:pn.SUBLAYER,name:u?.name,state:u?.state??{opacity:this.opacity,visibility:this.visibility,hovertips:this.hovertips,identify:this.identify},extent:u?.extent,controls:u?.controls,disabledControls:u?.disabledControls,initialFilteredQuery:u?.initialFilteredQuery,permanentFilteredQuery:u?.permanentFilteredQuery,labels:u?.labels},this.$iApi,this));const c=this._sublayers[l];if(c.isRemoved)return;if(c.name=u?.name||o.title||"",n.push(c),!a.children.map(h=>h.layerIdx).includes(l)){const h=new q1e(l,c.uid,c.name,!1);a.children.push(h)}c.esriWatches.push(o.watch("visible",()=>{this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:c.visibility,layer:c}),c.parentLayer?.checkVisibility()}),o.watch("opacity",h=>{this.$iApi.event.emit(ln.LAYER_OPACITYCHANGE,{opacity:h,layer:c})}))}};return this.origRampConfig.sublayers.forEach(o=>{if(!o.cosmetic){const a=t(o.index||0);s(a,this.layerTree)}}),n.forEach(o=>{const a=t(o.layerIdx),l=r[o.layerIdx];o.serviceUrl=a.url,o.fetchEsriSublayer(this),o.initiate();const u=o.esriSubLayer&&l?.customRenderer?.type;u&&(o.esriSubLayer.renderer=YC(l.customRenderer));const c=o.loadLayerMetadata(u?{customRenderer:o.esriSubLayer?.renderer}:{}).then(()=>{const h=r[o.layerIdx];return h?(o.visibility=o.isRemoved?!1:h.state?.visibility??(this.origState.visibility?o._serverVisibility??this.origState.visibility:this.origState.visibility??o._serverVisibility)??!0,o.opacity=h.state?.opacity??this.origState.opacity??1,o.nameField=h.nameField||o.nameField||"",this.$iApi.geo.attributes.applyFieldMetadata(o,h.fieldMetadata),o.canModifyLayer||this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.filtersdisabled",{name:o.name||o.id}))):this.$iApi.geo.attributes.applyFieldMetadata(o),o.supportsFeatures?(o.updateFieldList(),this.$iApi.geo.layer.loadFeatureCount(o.serviceUrl,o.getSqlFilter(pm.PERMANENT)).then(p=>{o.featureCount=p})):Promise.resolve()});e.push(c)}),this.esriLayer.allSublayers.forEach(o=>{!o.sublayers&&!n.find(a=>a.layerIdx===o.id)?(o.visible=!1,o.opacity=0):o.sublayers&&(o.visible=!0)}),this.visibility=this.origState.visibility??!0,e}updateLayerState(e){super.updateLayerState(e),this.sublayers.forEach(t=>t.updateLayerState(e))}updateDrawState(e){super.updateDrawState(e),this.sublayers.forEach(t=>t.updateDrawState(e))}runIdentify(e){if(!this.canIdentify())return[];e.sublayerIds&&(e.sublayerIds=e.sublayerIds.map(n=>typeof n=="number"?this.layerTree?.findChildByIdx(n)?.uid:n));const t=e.sublayerIds?this._sublayers.filter(n=>e.sublayerIds?.includes(n.uid)):this._sublayers.filter(n=>n.canIdentify());if(t.length===0)return[];let r;return e.geometry.type===cl.POINT&&(r=this.$iApi.geo.query.makeClickBuffer(e.geometry,e.tolerance)),t.map(n=>{const s=new Af,o={},a=Zl({items:[],loading:s.getPromise(),loaded:!1,errored:!1,uid:n.uid,requestTime:Date.now()});return n.geomType!==cl.POLYGON&&r?o.filterGeometry=r:o.filterGeometry=e.geometry,o.filterSql=n.getCombinedSqlFilter(),n.queryOIDs(o).then(l=>{l.forEach(u=>{a.items.push(fq.makeOidItem(u,n))}),a.loaded=!0,s.resolveMe()}).catch(()=>{a.errored=!0,s.resolveMe()}),a})}}const rdt="Accessed labelVisibility prior to layer being loaded";class ELr extends FYe{tooltipField;constructor(e,t,r){if(super(e,t),this.layerType=pn.SUBLAYER,this.layerFormat=zx.MAPIMAGE,this.isSublayer=!0,this.layerIdx=e.index,this.parentLayer=r,this.dataFormat=l0.ESRI_FEATURE,this.tooltipField="",this.hovertips=!1,this.url=this.parentLayer?.url,this.canReload=!!(this.url||this.origRampConfig.caching),!r.esriLayer)throw new Error("Map Image Layer with no internal esri layer encountered in sublayer creation");this.fetchEsriSublayer(r),(e.initialFilteredQuery||e.permanentFilteredQuery)&&this.applySqlFilter()}fetchEsriSublayer(e){if(!e.esriLayer){console.error("Attempted to fetch the ESRI sublayer when parent has no ESRI layer");return}this.esriSubLayer=Da(e.esriLayer.allSublayers.find(t=>t.id===this.layerIdx))}onLoadActions(){return this.layerTree=this.parentLayer.getLayerTree().findChildByUid(this.uid),this.layerTree.name=this.name,this.layerTree.layerIdx=this.layerIdx,this.identify=this.config.state.identify!=null?this.config.state.identify:this.supportsIdentify,[]}async onInitiate(){const e=this.labelVizOverride();e!==void 0&&(this.labelVisibility=e),this.initiationState=ey.INITIATED}async reload(){if(!this.$iApi.geo.map.esriMap){console.error("Attempted layer reload when no map exists");return}this.parentLayer?.reload()}get layerExists(){return!!(this.parentLayer?.esriLayer&&this.esriSubLayer)}get visibility(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),!1):this.esriSubLayer.visible}set visibility(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.esriSubLayer.visible=e}get opacity(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.esriSubLayer.opacity}set opacity(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.isDynamic||console.warn(`Opacity of a Map Image Sublayer was set. The service does not support sublayer opacity. LayerId ${this.id}`),this.esriSubLayer.opacity=e}get mouseTolerance(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.parentLayer.mouseTolerance}set mouseTolerance(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.mouseTolerance=e}get touchTolerance(){return!this.parentLayer?.esriLayer||!this.esriSubLayer?(this.noLayerErr(),0):this.parentLayer.touchTolerance}set touchTolerance(e){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}this.parentLayer.touchTolerance=e}applySqlFilter(e=[]){if(!this.parentLayer?.esriLayer||!this.esriSubLayer){this.noLayerErr();return}const t=this.filter.getCombinedSql(e);this.esriSubLayer.definitionExpression=t}getSR(){return this.parentLayer?.esriLayer?xl.fromESRI(this._parentLayer?.esriLayer?.spatialReference):(this.noLayerErr(),xl.latLongSR())}updateFieldList(){this.attribs.attLoader.updateFieldList(this.fieldList)}get labelVisibility(){return this.esriSubLayer?this.esriSubLayer.labelsVisible:(console.error(rdt),!1)}set labelVisibility(e){this.esriSubLayer?this.esriSubLayer.labelsVisible=e:console.error(rdt)}labelVizOverride(){let e=this.origRampConfig.labels?.visible;if(e!==void 0||(e=this.$iApi.geo.map.labelsDefault?.visible,e!==void 0))return e}}class ILr extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.OSM,this.layerFormat=zx.OSM,this.dataFormat=l0.OSM_TILE,this.supportsFeatures=!1}async onInitiate(){this.esriLayer=Da(new XHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.generatePlaceholderSymbology("O","#03fc4e"),r={uid:this.$iApi.geo.shared.generateUUID(),label:"OpenStreetMap",svgcode:t.svgcode,esriStandard:!0,drawPromise:Promise.resolve()};return this.legend.push(r),e}}class ALr extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.IMAGERY,this.layerFormat=zx.IMAGERY,this.dataFormat=l0.ESRI_RASTER}async onInitiate(){this.esriLayer=Da(new gDt(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(t),e}}class Y6t extends o7{constructor(e,t){super(e,t),this.supportsIdentify=!1,this.layerType=pn.TILE,this.layerFormat=zx.TILE,this.dataFormat=l0.ESRI_TILE}async onInitiate(){this.esriLayer=Da(new KHe(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){return super.makeEsriLayerConfig(e)}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=this.$iApi.geo.symbology.mapServerToLocalLegend(this.origRampConfig.url).then(r=>{this.legend=r});return e.push(t),e.push(this.checkProj()),e}checkProj(){const e=this.getSR(),r=this.$iApi.geo.map.getSR().isEqual(e);if(this.layerState===Ud.LOADED&&!r)this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),this.onError();else if(this.layerState===Ud.ERROR&&r)this.reload();else if(this.layerState!==Ud.ERROR&&!r)return this.$iApi.notify.show(K1.WARNING,this.$iApi.$i18n.t("layer.mismatch",{name:this.name||this.id})),Promise.reject();return Promise.resolve()}}class MLr extends o7{sublayerNames;mimeType;constructor(e,t){super(e,t),this.supportsIdentify=!0,this.layerType=pn.WMS,this.layerFormat=zx.WMS,this.mimeType=e.featureInfoMimeType||"",this.sublayerNames=[],this.dataFormat=l0.OGC_RASTER,this.identifyMode=sg.GEOMETRIC}async onInitiate(){this.esriLayer=Da(new YDt(this.makeEsriLayerConfig(this.origRampConfig))),await super.onInitiate()}makeEsriLayerConfig(e){const t=super.makeEsriLayerConfig(e),r=e.sublayers;this.sublayerNames=r.map(s=>s.id||"error_no_wms_id");const n=r.map(s=>s.currentStyle).join();return t.customParameters={styles:n},e.url.indexOf("/geomet")!==-1&&(t.customParameters.layers=r[0].id),t}onLoadActions(){const e=super.onLoadActions();this.layerTree.name=this.name;const t=r=>{let n=!1;return r.forEach(s=>{this.sublayerNames.indexOf(s.name)>-1||s.sublayers&&s.sublayers.length>0&&t(s.sublayers)?n=!0:s.visible=!1}),n};return this.esriLayer?t(this.esriLayer.sublayers):this.noLayerErr(),this.loadSymbology(),e}canIdentify(){return super.canIdentify()}runIdentify(e){if(e.geometry.type!==cl.POINT)throw new Error("a point must be used for WMS Identify");if(!this.canIdentify())return[];const t=new Af,r=Zl({items:[],loading:t.getPromise(),loaded:!1,errored:!1,uid:this.uid,requestTime:Date.now()});return this.getFeatureInfo(this.sublayerNames,e.geometry,this.mimeType).then(n=>{if(n){let s=!0,o;typeof n!="string"?o=z8.JSON:n.indexOf("Search returned no results")===-1&&n!==""?o=z8.TEXT:(s=!1,o=z8.UNKNOWN),s&&r.items.push(fq.makeRawItem(o,n))}r.loaded=!0,t.resolveMe()}).catch(()=>{r.errored=!0,t.resolveMe()}),[r]}setCustomParameter(e,t,r=!0){this.esriLayer?(this.esriLayer.customLayerParameters||(this.esriLayer.customLayerParameters={}),this.esriLayer.customLayerParameters[e]=t,r&&this.esriLayer.refresh()):this.noLayerErr()}getFeatureInfo(e,t,r){const n=this.$iApi.geo.map,s=this.esriLayer;if(!n.esriView)throw new Error("WMS get feature, no map view exists. Cannot derive click coords");if(!s)throw this.noLayerErr(),new Error("wms get feature failed, no layer");let o,a;const l=n.getExtent(),u=s.spatialReferences,c=e.join(","),h=n.esriView.toScreen(t.toESRI()),p=Math.floor(h.x),m=Math.floor(h.y),w={"application/json":"json","text/html":"text","text/plain":"text"}[r]||"text",S=n.getSR();S.wkid?o=S.wkid:(o=4326,console.error("Map is likely in a WKT projection. WMS Identify request will likely fail.")),u&&u.length>1?u.indexOf(o)===-1&&(S.latestWkid&&u.indexOf(S.latestWkid)>-1?o=S.latestWkid:console.error("WMS service does not support the maps projection. Identify request will likely fail.")):console.error("No supported wkid/epsg code found for WMS service. Identify request will likely fail."),s.version==="1.3"||s.version==="1.3.0"?(a={CRS:"EPSG:"+o,I:p,J:m,STYLES:"",FORMAT:s.imageFormat},this.$iApi.geo.layer.ogc.reversedAxisWKIDs().indexOf(o)>-1&&(a.BBOX=`${l.ymin},${l.xmin},${l.ymax},${l.xmax}`)):a={SRS:"EPSG:"+o,X:p,Y:m},Object.prototype.hasOwnProperty.call(a,"BBOX")||(a.BBOX=`${l.xmin},${l.ymin},${l.xmax},${l.ymax}`);const I={SERVICE:"WMS",REQUEST:"GetFeatureInfo",VERSION:s.version,WIDTH:n.getPixelWidth(),HEIGHT:n.getPixelHeight(),QUERY_LAYERS:c,LAYERS:c,INFO_FORMAT:r},R=s.customLayerParameters;return R&&Object.keys(R).forEach(L=>{L.toLowerCase()!=="styles"&&(I[L]=R[L])}),Object.keys(I).forEach(L=>a[L]=I[L]),zi(s.url.split("?")[0],{query:a,responseType:w})}getLegendUrls(e){if(!this.esriLayer)return this.noLayerErr(),[];const t=new Map;this.esriLayer.allSublayers.forEach(n=>{n.visible&&(n.legendUrl&&this.origRampConfig.sublayers?.forEach(s=>{if(s.id&&s.currentStyle&&s.id===n.name){const o=new sse(n.legendUrl);"STYLE"in o.queryMap&&o.queryMap.STYLE!==s.currentStyle&&(n.legendUrl=o.updateQuery({STYLE:s.currentStyle}))}}),t.set(n.name,n.legendUrl))});const r=e.map(n=>n.styleLegends&&n.currentStyle?n.styleLegends.find(s=>s.name===n.currentStyle).url:void 0);return r.forEach((n,s)=>{n||(r[s]=t.get(e[s].id))}),r}getWMSLayerTitle(e){if(!this.esriLayer)return"";let t;return this.esriLayer.allSublayers.some(r=>{if(r.name===e)return t=r.title,!0}),t||""}loadSymbology(){const e=this.config.sublayers,t=this.getLegendUrls(e.map(r=>({id:r.id,styleLegends:r.styleLegends,currentStyle:r.currentStyle}))).map((r,n)=>{const s=e[n].name||this.getWMSLayerTitle(e[n].id)||e[n].id,o={uid:this.$iApi.geo.shared.generateUUID(),label:s,svgcode:"",esriStandard:!1,drawPromise:this.$iApi.geo.symbology.generateWMSSymbology(r).then(a=>{o.svgcode=a.svgcode,o.imgHeight=a.imgHeight,o.imgWidth=a.imgWidth})};return o});this.legend=t}}class OLr extends CTe{constructor(e,t){super(e,t),this.layerType=pn.WFS}async onInitiate(){const e=new sse(this.config.url),{offset:t,limit:r}=e.queryMap;this.sourceGeoJson=await this.$iApi.geo.layer.ogc.loadWfsData(this.config.url,-1,parseInt(t)||0,parseInt(r)||1e3,void 0,this.config.xyInAttribs),await super.onInitiate()}}class X6t extends H6t{sourceJson;attribs;_visibility;constructor(e,t){super(e,t),this.dataFormat=l0.ESRI_FEATURE,this.layerFormat=zx.NOLAYER,this.drawState=fb.NOT_VISUAL,this.attribs=new J6t,this.supportsFeatures=!0,this.mapLayer=!1,this.isFile=!1,this._visibility=e.state?.visibility??!0,this.expectedTime.draw=0}async onInitiate(){if(this.sourceJson){const e=this.sourceJson;if(e.data.length===0||e.fields.length===0)throw new Error("Data layer with no columns or now rows.");const t=e.fields.slice(),r=e.data[0].slice(),n=/ /gi;this.fields=t.map((o,a)=>{let l="",u=o;o.indexOf(" ")>-1&&(l=o,u=o.trim().replace(n,"-"),e.fields[a]=u);const c=this.$iApi.geo.layer.files.inferType(r[a]);return{name:u,alias:l,type:c,length:c===j1.STRING?256:void 0}}),this.oidField="rampOID",this.fields.push({name:this.oidField,type:j1.OID}),e.fields.push(this.oidField),e.data.forEach((o,a)=>o.push(a+1)),this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata),this.fieldList="*";const s={batchSize:-1,sourceDataJson:e,oidField:this.oidField,attribs:"*"};this.attribs.attLoader=new kLr(this.$iApi,s),await this.attribs.attLoader.getAttribs(),this.featureCount=e.data.length,this.origRampConfig.nameField?this.nameField=this.$iApi.geo.attributes.fieldValidator(this.fields,this.origRampConfig.nameField)||this.oidField:this.nameField=this.oidField,this.sourceJson=void 0,this.origRampConfig.caching||delete this.origRampConfig.rawData}else throw new Error("Attempted to initiate file based data layer, sourceJson is missing")}async terminate(){await super.terminate()}async reload(){this.initiationState===ey.INITIATED&&(this.$iApi.event.emit(ln.LAYER_RELOAD_START,this),await this.terminate()),await this.initiate(),this.layerState!==Ud.ERROR&&this.onLoad(),setTimeout(()=>{this.$iApi.event.emit(ln.LAYER_RELOAD_END,this)},300)}onLoadActions(){const e=super.onLoadActions();return this.legend=[{uid:this.$iApi.geo.shared.generateUUID(),label:"",svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.getIcon(0).then(t=>{this.legend[0].svgcode=t})}],e}getAttributes(){return this.attribs.attLoader.getAttribs()}getTabularAttributes(){return this.$iApi.geo.attributes.generateTabularAttributes(this,this.attribs)}async getGraphic(e,t){let r={};if(this.attribs.attLoader.isLoaded()){const n=await this.attribs.attLoader.getAttribs();r=n.features[n.oidIndex[e]]}else throw new Error("Non ESRI data layer did not have attributes populated.");return new Ax(new Kk,"",r)}async getIcon(e){return' D '}async getFilterOIDs(e=[],t=void 0){}abortAttributeLoad(){}attribLoadAborted(){return!1}clearFeatureCache(){}downloadedAttributes(){return this.featureCount}get layerExists(){return this.isLoaded}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this.$iApi.event.emit(ln.LAYER_VISIBILITYCHANGE,{visibility:e,layer:this}))}}class PLr extends X6t{constructor(e,t){super(e,t),this.layerType=pn.DATAJSON}async onInitiate(){if(this.origRampConfig.rawData)this.sourceJson=this.$iApi.geo.layer.files.rawDataJsonParser(this.origRampConfig.rawData,this.origRampConfig.caching);else if(this.origRampConfig.url)this.sourceJson=await this.$iApi.geo.layer.files.fetchFileData(this.origRampConfig.url,this.layerType);else throw new Error("Json Data layer config contains no raw data or url");await super.onInitiate()}}class RLr extends X6t{filter;serviceUrl;constructor(e,t){super(e,t),this.layerType=pn.DATATABLE,this.serviceUrl=e.url,this.filter=new IFt(e.permanentFilteredQuery||"",e.initialFilteredQuery||"")}async onInitiate(){}onLoadActions(){const e=super.onLoadActions(),r=this.$iApi.geo.shared.parseUrlIndex(this.serviceUrl).index||0,n=this.$iApi.geo.layer.loadLayerMetadata(this.serviceUrl).then(o=>{this.name||(this.name=o.name),this.layerTree.name=this.name,this.oidField=o.objectIdField,this.nameField=this.origRampConfig.nameField||o.displayField||"",this.fields=o.fields,this.$iApi.geo.attributes.applyFieldMetadata(this,this.origRampConfig.fieldMetadata);const a={supportsLimit:(o.currentVersion||1)>=10.1,serviceUrl:this.serviceUrl,oidField:this.oidField,batchSize:-1,attribs:this.fieldList,permanentFilter:this.getSqlFilter(pm.PERMANENT)};this.attribs.attLoader=new K6t(this.$iApi,a),this.attribs.quickCache=new Z6t(this.geomType)}),s=this.$iApi.geo.layer.loadFeatureCount(this.serviceUrl,this.getSqlFilter(pm.PERMANENT)).then(o=>{this.featureCount=o});return this.layerTree.layerIdx=r,e.push(n,s),e}async getGraphic(e,t){let r={};const n=this.attribs.quickCache.getAttribs(e);if(n)r=n;else if(this.attribs.attLoader.isLoaded()){const o=await this.attribs.attLoader.getAttribs();r=o.features[o.oidIndex[e]]}else{const o={oid:e,serviceUrl:this.serviceUrl,includeGeometry:!1,attribs:this.fieldList},a=await this.$iApi.geo.attributes.loadSingleFeature(o);this.attribs.quickCache.setAttribs(e,a.attributes),r=a.attributes}return new Ax(new Kk,"",r)}abortAttributeLoad(){this.attribs.attLoader.abortAttribLoad()}clearFeatureCache(){this.attribs.clearAll()}downloadedAttributes(){return this.isLoaded?this.attribs.attLoader.loadCount():0}attribLoadAborted(){return this.isLoaded?this.attribs.attLoader.isLoadAborted():!1}setSqlFilter(e,t){const r=this.filter.getSql(e);t!==r&&(this.filter.setSql(e,t),this.$iApi.event.emit(ln.FILTER_CHANGE,{uid:this.uid,filterKey:e}))}getSqlFilter(e){return this.filter.getSql(e)}getCombinedSqlFilter(e){return this.filter.getCombinedSql(e)}async getFilterOIDs(e=[],t=void 0){const r=this.filter.getCombinedSql(e);if(!r)return;const n=this.filter.sqlActiveFilters(e);let s=this.filter.getCache(n,!1);if(!s){const o={filterSql:r,includeGeometry:!1};s=this.queryOIDs(o),this.filter.setCache(s,n,!1)}return s}queryOIDs(e){const t={url:this.serviceUrl,...e};return this.$iApi.geo.query.arcGisServerQueryIds(t)}async queryFeaturesDiscrete(e){const t=await this.queryOIDs(e),r={getAttribs:!0};return t.map(n=>({oid:n,graphic:this.getGraphic(n,r)}))}async queryFeatures(e){const t=await this.queryFeaturesDiscrete(e);return Promise.all(t.map(r=>r.graphic))}}class DLr extends tf{oidIndexer(e,t){e.features.forEach((r,n)=>{e.oidIndex[r[t]]=n})}async arcGisBatchLoad(e,t){if(t.loadAbortFlag)return[];const r=e.permanentFilter?` AND ${e.permanentFilter}`:"",n={query:{where:`${e.oidField}>${e.maxId}${r}`,outFields:e.attribs,orderByFields:e.oidField,returnGeometry:"false",f:"json"}},[s,o]=await _k(zi(e.serviceUrl+"/query",n));if(!o)return console.error(`ArcGIS batch load error: ${e.serviceUrl}`,s),Promise.reject(new Error(`ArcGIS batch load error: ${e.serviceUrl}`));if(!o.data||!o.data.features)return console.error(`ArcGIS batch load gave no data/features: ${e.serviceUrl}`),Promise.reject(new Error(`ArcGIS batch load gave no data/features: ${e.serviceUrl}`));const a=o.data.features,l=a.length;if(l>0){t.loadedCount+=l;let u;if(e.supportsLimit?u=o.data.exceededTransferLimit:(e.batchSize===-1&&(e.batchSize=l),u=l>=e.batchSize),u){e.maxId=a[l-1].attributes[e.oidField];const c=await this.arcGisBatchLoad(e,t);return t.loadAbortFlag?[]:a.concat(c)}else return t.loadAbortFlag?[]:a}else return[]}async loadArcGisServerAttributes(e,t){e.maxId=-1,e.batchSize=-1;const n={features:(await this.arcGisBatchLoad(e,t)).map(s=>s.attributes),oidIndex:{}};return this.oidIndexer(n,e.oidField),t.loadIsDone=!0,n}async loadGraphicsAttributes(e,t){if(!e.sourceGraphics)throw new Error("No .sourceGraphics provided to file layer attribute loader");const n={features:e.sourceGraphics.map(s=>Qs(s).attributes).toArray(),oidIndex:{}};return this.oidIndexer(n,e.oidField),t.loadIsDone=!0,t.loadedCount=n.features.length,n}async loadCompactJsonAttributes(e,t){if(!e.sourceDataJson)throw new Error("No .sourceDataJson provided to file data-layer attribute loader");const r=e.sourceDataJson.fields,s={features:e.sourceDataJson.data.map(o=>{const a={};return o.forEach((l,u)=>{a[r[u]]=l}),a}),oidIndex:{}};return this.oidIndexer(s,e.oidField),t.loadIsDone=!0,t.loadedCount=s.features.length,e.sourceDataJson=void 0,s}async loadSingleFeature(e){const t={query:{f:"json",objectIds:e.oid,returnGeometry:e.includeGeometry,outFields:e.attribs}};typeof e.maxOffset<"u"&&(t.query.maxAllowableOffset=e.maxOffset),typeof e.mapSR<"u"&&(t.query.outSR=e.mapSR),typeof e.geometryPrecision<"u"&&e.geometryPrecision>=0&&(t.query.geometryPrecision=e.geometryPrecision);const[r,n]=await _k(zi(e.serviceUrl+"/query",t));if(!n)return console.error(`ArcGIS single feature load error: ${e.serviceUrl}`,r),Promise.reject(new Error(`ArcGIS single feature load error: ${e.serviceUrl}`));if(!n.data||!n.data.features)return console.error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`),Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`));const s=n.data.features;if(s.length>0){const o=s[0];let a;if(e.includeGeometry){o.geometry.spatialReference=n.data.spatialReference;const l=Ro(o.geometry);a=this.$iApi.geo.geom.geomEsriToRamp(l)}else a=new Kk;return new Ax(a,"",o.attributes)}return Promise.reject(new Error(`Could not locate feature ${e.oid} for layer ${e.serviceUrl}`))}orderFields(e,t){const r=(s,o)=>s.findIndex(a=>a.name===o),n=(s,o)=>{const a=r(t,s.name),l=r(t,o.name);return a===-1&&l===-1?r(e,s.name)-r(e,o.name):a===-1?1:l===-1?-1:a-l};return e.slice().sort(n)}applyFieldMetadata(e,t=void 0){if(!t||!t.fieldInfo){e.fieldList="*";return}if(t?.enforceOrder&&t?.fieldInfo&&t?.fieldInfo.length>0&&(e.fields=this.orderFields(e.fields,t.fieldInfo),e.fieldList=t.fieldInfo.map(r=>r.name).join(",")),t.exclusiveFields){t.fieldInfo.find(n=>n.name===e.oidField)||t.fieldInfo.push({name:e.oidField}),e.fieldList=t.fieldInfo.map(n=>n.name).join(",");const r=t.fieldInfo;e.fields=e.fields.filter(n=>r.find(s=>s.name===n.name))}else e.fieldList="*";t.fieldInfo.forEach(r=>{if(r.alias){const n=e.fields.find(s=>s.name===r.name);n&&(n.alias=r.alias)}})}fieldValidator(e,t){if(e.findIndex(r=>r.name===t)===-1){const r=e.find(n=>n.alias===t);return r?r.name:(console.warn(`Cannot find name field in layer field list: ${t}`),"")}else return t}async generateTabularAttributes(e,t){return t.attLoader.tabularAttributesCache||(t.attLoader.tabularAttributesCache=this.$iApi.geo.attributes.generateTabularAttributesWorker(e,t)),t.attLoader.tabularAttributesCache}async generateTabularAttributesWorker(e,t){if(e.dataFormat===l0.ESRI_RASTER)throw new Error("Attempting to get attributes on a raster layer.");const r=await t.attLoader.getAttribs();if(!r.features||r.features.length===0)return{columns:[],rows:[],fields:[],oidField:""};const n=e.fields.filter(o=>Object.prototype.hasOwnProperty.call(r.features[0],Qs(o).name)).map(o=>({data:Qs(o).name,title:Qs(o).alias||Qs(o).name})),s=r.features.map(o=>{const a=HY({},o);return a.rvInteractive="",a.rvSymbol=e.getIcon(o[e.oidField]),a.rvUid=e.uid,a});return n.forEach(o=>{if(o.data.slice(-2)==="()"){const a=function(){return this[o.data]},l=o.data.slice(0,-2);s.forEach(u=>{u[l]=a})}}),{columns:n,rows:s,fields:e.fields,oidField:e.oidField}}}class J6t{_attribLoader;_quickCache;get attLoader(){if(this._attribLoader)return this._attribLoader;throw console.trace(),new Error("Attempted to load attributes prior to layer being loaded.")}set attLoader(e){this._attribLoader=e}get quickCache(){if(this._quickCache)return this._quickCache;throw console.trace(),new Error("Attempted to access attribute cache prior to layer being loaded.")}set quickCache(e){this._quickCache=e}clearAll(){this._attribLoader&&this._attribLoader.destroyAttribs(),this._quickCache&&this._quickCache.clearAll()}}class ndt{loadedCount;loadAbortFlag;loadIsDone;constructor(){this.loadedCount=0,this.loadAbortFlag=!1,this.loadIsDone=!1}}class kYe extends tf{aac;loadPromise;details;tabularAttributesCache;constructor(e,t){super(e),this.aac=new ndt,this.details=t}updateFieldList(e){this.details.attribs=e}getAttribs(){return this.loadPromise||(this.aac=new ndt,this.loadPromise=this.loadPromiseGenerator()),this.loadPromise}abortAttribLoad(){this.aac.loadAbortFlag=!0}destroyAttribs(){this.loadPromise=void 0,this.tabularAttributesCache=void 0,this.aac.loadIsDone=!1,this.aac.loadedCount=0}loadCount(){return this.aac.loadedCount}isLoaded(){return this.aac.loadIsDone}isLoadAborted(){return this.aac.loadAbortFlag}loadPromiseGenerator(){return Promise.reject(new Error("Subclass of AttributeLoaderBase did not implement loadPromiseGenerator"))}}class K6t extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadArcGisServerAttributes(this.details,this.aac)}}class FLr extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadGraphicsAttributes(this.details,this.aac)}}class kLr extends kYe{constructor(e,t){super(e,t)}loadPromiseGenerator(){return this.$iApi.geo.attributes.loadCompactJsonAttributes(this.details,this.aac)}}class Z6t{attribs;geoms;extents;isPoint;constructor(e){this.attribs={},this.geoms={},this.extents={},this.isPoint=e==="point"}getScaleStore(e){return this.geoms[e]||(this.geoms[e]={}),this.geoms[e]}getGeomStore(e=void 0){if(this.isPoint)return this.geoms;if(typeof e>"u")throw new Error("Attempted to access geometry store for non-point layer without providing a map scale");return this.getScaleStore(e)}getAttribs(e){return this.attribs[e]}setAttribs(e,t){this.attribs[e]=t}getGeom(e,t=void 0){return this.getGeomStore(t)[e]}setGeom(e,t,r=void 0){const n=this.getGeomStore(r);n[e]=t}getExtent(e){return this.extents[e]}setExtent(e,t){this.extents[e]=t}clearAll(){this.attribs={},this.geoms={},this.extents={}}}class LYe{innerRenderer;symbolUnits;defaultUnit;type;falseRenderer;constructor(e,t,r=!1){this.innerRenderer=e,this.symbolUnits=[],this.falseRenderer=r,this.type=qxe.Unknown}makeSearchParams(e){return e}searchRenderer(e){const t=this.makeSearchParams(e),r=this.symbolUnits.find(s=>s.match(t));if(r)return r;if(this.defaultUnit)return this.defaultUnit;console.error(`renderer search could not find match for ${t}`);const n=new ETe(this);return n.svgCode="",n}getGraphicIcon(e){return this.searchRenderer(e).svgCode}getGraphicSymbol(e){return this.searchRenderer(e).symbol}rendererToLegend(){throw new Error("rendererToLegend not implemented in subclass")}getFieldDelimiter(e,t){let r="'";if(!t||t.length===0)return r;const n=t.find(s=>s.name===e);return n&&n.type&&n.type!=="string"&&(r=""),r}cleanFieldName(e,t){if(!e)return e;let r=t.find(n=>n.name===e);if(r)return e;{const n=e.toLowerCase();return r=t.find(s=>s.name.toLowerCase()===n),r?r.name:e}}makeElseClause(){return this.falseRenderer?"":`(NOT (${this.symbolUnits.map(t=>t.definitionClause).join(" OR ")}))`}}class ETe{isDefault=!1;svgCode="";symbol;definitionClause="";label="";parent;constructor(e){this.parent=e,this.symbol=new Jh}match(e){return!!e}}class LLr extends LYe{constructor(e,t){super(e,t),this.type=qxe.Simple;const r=new ETe(this);r.label=e.label||"",r.symbol=e.symbol,r.definitionClause="",this.symbolUnits.push(r)}}class NLr extends LYe{delim;keyFields;constructor(e,t,r=!1){super(e,t,r),this.type=qxe.Unique,this.delim=e.fieldDelimiter||", ";const n=o=>o.replace(/'/g,"''");this.keyFields=[e.field,e.field2,e.field3].filter(o=>o).map(o=>this.cleanFieldName(o,t));const s=this.keyFields.map(o=>this.getFieldDelimiter(o,t));if(e.uniqueValueInfos.forEach(o=>{const a=new sdt(this,o.value);if(a.label=o.label||"",a.symbol=o.symbol,!this.falseRenderer){const l=a.matchValue.split(this.delim),u=this.keyFields.map((c,h)=>l[h]===""?`${c} IS NULL`:`${c} = ${s[h]}${n(l[h])}${s[h]}`).join(" AND ");a.definitionClause=`(${u})`,a.matchValue=a.matchValue.replace(//g,"")}this.symbolUnits.push(a)}),e.defaultSymbol){const o=new sdt(this,"");o.isDefault=!0,o.label=e.defaultLabel||"",o.symbol=e.defaultSymbol,o.definitionClause=this.makeElseClause(),this.defaultUnit=o}}makeSearchParams(e){return this.keyFields.map(t=>{let r=e[t]===null?"":e[t];return typeof r!="string"&&(r=r.toString()),r}).join(this.delim)}}class sdt extends ETe{matchValue;constructor(e,t){super(e),typeof t=="number"?this.matchValue=t.toString():this.matchValue=t}match(e){return this.matchValue===e}}class $Lr extends LYe{valField;constructor(e,t,r=!1){if(super(e,t,r),this.valField=this.cleanFieldName(e.field,t),e.classBreakInfos.forEach((n,s)=>{const o=s===0,a=new odt(this,n.minValue,n.maxValue,o);a.label=n.label||"",a.symbol=n.symbol,this.falseRenderer||(a.definitionClause=`(${this.valField} >${o?"=":""} ${n.minValue} AND ${this.valField} <= ${n.maxValue})`),this.symbolUnits.push(a)}),e.defaultSymbol){const n=new odt(this,0,0,!1);n.isDefault=!0,n.label=e.defaultLabel||"",n.symbol=e.defaultSymbol,n.definitionClause=this.makeElseClause(),this.defaultUnit=n}}makeSearchParams(e){return parseFloat(e[this.valField])}}class odt extends ETe{minValue;maxValue;firstBreak;constructor(e,t,r,n){super(e),this.minValue=t,this.maxValue=r,this.firstBreak=n}match(e){return this.minValue===this.maxValue?this.maxValue===e:this.firstBreak?this.minValue<=e&&this.maxValue>=e:this.minValue=e}}var Q6t={exports:{}};/*! * svg.js - A lightweight library for manipulating and animating SVG. * @version 2.7.1 * https://svgdotjs.github.io/ @@ -158,14 +158,14 @@ northing meters`+te;var ir=ki/2,$r=0,mn=0,Kr,xn,Gn,Ds,Fn;return 0"u")return this;if(typeof fe=="string"||s.Color.isRgb(fe)||fe&&typeof fe.fill=="function")this.attr(H,fe);else for(Z=c[H].length-1;Z>=0;Z--)fe[c[H][Z]]!=null&&this.attr(c.prefix(H,c[H][Z]),fe[c[H][Z]]);return this},s.extend(s.Element,s.FX,ae)}),s.extend(s.Element,s.FX,{rotate:function(H,Z,ae){return this.transform({rotation:H,cx:Z,cy:ae})},skew:function(H,Z,ae,fe){return arguments.length==1||arguments.length==3?this.transform({skew:H,cx:Z,cy:ae}):this.transform({skewX:H,skewY:Z,cx:ae,cy:fe})},scale:function(H,Z,ae,fe){return arguments.length==1||arguments.length==3?this.transform({scale:H,cx:Z,cy:ae}):this.transform({scaleX:H,scaleY:Z,cx:ae,cy:fe})},translate:function(H,Z){return this.transform({x:H,y:Z})},flip:function(H,Z){return Z=typeof H=="number"?H:Z,this.transform({flip:H||"both",offset:Z})},matrix:function(H){return this.attr("transform",new s.Matrix(arguments.length==6?[].slice.call(arguments):H))},opacity:function(H){return this.attr("opacity",H)},dx:function(H){return this.x(new s.Number(H).plus(this instanceof s.FX?0:this.x()),!0)},dy:function(H){return this.y(new s.Number(H).plus(this instanceof s.FX?0:this.y()),!0)},dmove:function(H,Z){return this.dx(H).dy(Z)}}),s.extend(s.Rect,s.Ellipse,s.Circle,s.Gradient,s.FX,{radius:function(H,Z){var ae=(this._target||this).type;return ae=="radial"||ae=="circle"?this.attr("r",new s.Number(H)):this.rx(H).ry(Z??H)}}),s.extend(s.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(H){return this.node.getPointAtLength(H)}}),s.extend(s.Parent,s.Text,s.Tspan,s.FX,{font:function(H,Z){if(typeof H=="object")for(Z in H)this.font(Z,H[Z]);return H=="leading"?this.leading(Z):H=="anchor"?this.attr("text-anchor",Z):H=="size"||H=="family"||H=="weight"||H=="stretch"||H=="variant"||H=="style"?this.attr("font-"+H,Z):this.attr(H,Z)}}),s.Set=s.invent({create:function(H){H instanceof s.Set?this.members=H.members.slice():Array.isArray(H)?this.members=H:this.clear()},extend:{add:function(){var H,Z,ae=[].slice.call(arguments);for(H=0,Z=ae.length;H-1&&this.members.splice(Z,1),this},each:function(H){for(var Z=0,ae=this.members.length;Z=0},index:function(H){return this.members.indexOf(H)},get:function(H){return this.members[H]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new s.RBox;var H=this.members[0].rbox(this.members[0].doc());return this.each(function(){H=H.merge(this.rbox(this.doc()))}),H}},construct:{set:function(H){return new s.Set(H)}}}),s.FX.Set=s.invent({create:function(H){this.set=H}}),s.Set.inherit=function(){var H,Z=[];for(var H in s.Shape.prototype)typeof s.Shape.prototype[H]=="function"&&typeof s.Set.prototype[H]!="function"&&Z.push(H);Z.forEach(function(ae){s.Set.prototype[ae]=function(){for(var fe=0,be=this.members.length;fe=0;H--)delete this.memory()[arguments[H]];return this},memory:function(){return this._memory||(this._memory={})}}),s.get=function(H){var Z=r.getElementById(re(H)||H);return s.adopt(Z)},s.select=function(H,Z){return new s.Set(s.utils.map((Z||r).querySelectorAll(H),function(ae){return s.adopt(ae)}))},s.extend(s.Parent,{select:function(H){return s.select(H,this.node)}});function h(H,Z,ae,fe){return ae+fe.replace(s.regex.dots," .")}function p(H){for(var Z=H.slice(0),ae=Z.length;ae--;)Array.isArray(Z[ae])&&(Z[ae]=p(Z[ae]));return Z}function m(H,Z){return H instanceof Z}function v(H,Z){return(H.matches||H.matchesSelector||H.msMatchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector).call(H,Z)}function w(H){return H.toLowerCase().replace(/-(.)/g,function(Z,ae){return ae.toUpperCase()})}function S(H){return H.charAt(0).toUpperCase()+H.slice(1)}function I(H){return H.length==4?["#",H.substring(1,2),H.substring(1,2),H.substring(2,3),H.substring(2,3),H.substring(3,4),H.substring(3,4)].join(""):H}function R(H){var Z=H.toString(16);return Z.length==1?"0"+Z:Z}function L(H,Z,ae){if(Z==null||ae==null){var fe=H.bbox();Z==null?Z=fe.width/fe.height*ae:ae==null&&(ae=fe.height/fe.width*Z)}return{width:Z,height:ae}}function k(H,Z,ae){return{x:Z*H.a+ae*H.c+0,y:Z*H.b+ae*H.d+0}}function B(H){return{a:H[0],b:H[1],c:H[2],d:H[3],e:H[4],f:H[5]}}function $(H){return H instanceof s.Matrix||(H=new s.Matrix(H)),H}function V(H,Z){H.cx=H.cx==null?Z.bbox().cx:H.cx,H.cy=H.cy==null?Z.bbox().cy:H.cy}function Y(H){for(var Z=0,ae=H.length,fe="";Z=0;Z--)H.childNodes[Z]instanceof t.SVGElement&&K(H.childNodes[Z]);return s.adopt(H).id(s.eid(H.nodeName))}function Q(H){return H.x==null&&(H.x=0,H.y=0,H.width=0,H.height=0),H.w=H.width,H.h=H.height,H.x2=H.x+H.width,H.y2=H.y+H.height,H.cx=H.x+H.width/2,H.cy=H.y+H.height/2,H}function re(H){var Z=(H||"").toString().match(s.regex.reference);if(Z)return Z[1]}function ne(H){return Math.abs(H)>1e-37?H:0}var de="abcdef".split("");if(typeof t.CustomEvent!="function"){var pe=function(H,Z){Z=Z||{bubbles:!1,cancelable:!1,detail:void 0};var ae=r.createEvent("CustomEvent");return ae.initCustomEvent(H,Z.bubbles,Z.cancelable,Z.detail),ae};pe.prototype=t.Event.prototype,s.CustomEvent=pe}else s.CustomEvent=t.CustomEvent;return function(H){for(var Z=0,ae=["moz","webkit"],fe=0;fe{const o={name:n,image:s,svgcode:""};return e(s).then(a=>{o.svgcode=a}),o})}listToIconSymbology(e){return this.listToSymbology(this.renderSymbologyIcon,e)}listToImageSymbology(e){return this.listToSymbology(this.renderSymbologyImage,e)}async renderSymbologyImage(e,t=null){t===null&&(t=Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,0,0));const r=await this.$iApi.geo.shared.convertImagetoDataURL(e);if(r===e)return"";const{loader:n}=await this.svgDrawImage(t,r);return t.viewbox(0,0,n.width,n.height),t.svg()}async renderSymbologyIcon(e,t=null){if(t===null){const s=window.document.createElement("div");s.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),window.document.body.appendChild(s),t=Tj(s).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE)}const r=await this.$iApi.geo.shared.convertImagetoDataURL(e),{image:n}=await this.svgDrawImage(t,r);return n.center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),this.fitInto(n,this.CONTENT_IMAGE_SIZE),t.svg()}generatePlaceholderSymbology(e,t="#000"){const r=Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE);return r.rect(this.CONTENT_IMAGE_SIZE,this.CONTENT_IMAGE_SIZE).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).fill(t),r.text(e[0].toUpperCase()).size(23).fill("#fff").attr({"font-weight":"bold","font-family":"Roboto"}).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).tspan(e[0].toUpperCase()).addClass("grid-icons").attr({dy:"29.900000000000002",x:"7.6875"}),{name:e,svgcode:r.svg()}}async generateBlankSymbology(){return Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).svg()}async symbolToSvg(e){const t=this,r=1.33333,n=window.document.createElement("div");n.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),window.document.body.appendChild(n);const s=Tj(n).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE),o={path({size:v,path:w}){return s.path(w).size(v*r)},circle({size:v}){return s.circle(v*r)},cross({size:v}){return s.path("M 0,10 L 20,10 M 10,0 L 10,20").size(v*r)},x({size:v}){return s.path("M 0,0 L 20,20 M 20,0 L 0,20").size(v*r)},triangle({size:v}){return s.path("M 20,20 L 10,0 0,20 Z").size(v*r)},diamond({size:v}){return s.path("M 20,10 L 10,0 0,10 10,20 Z").size(v*r)},square({size:v}){return s.path("M 0,0 20,0 20,20 0,20 Z").size(v*r)}},a={[K_.SOLID]:"none",[K_.NONE]:"none",[K_.DASH]:"5.333,4",[K_.DOT]:"1.333,4",[K_.DASHDOT]:"5.333,4,1.333,4",[K_.LONGDASH]:"10.666,4",[K_.LONGDASHDOT]:"10.666,4,1.333,4",[K_.LONGDASHDOTDOT]:"10.666,4,1.333,4,1.333,4",[K_.SHORTDOT]:"1.333,1.333",[K_.SHORTDASH]:"5.333,1.333",[K_.SHORTDASHDOT]:"5.333,1.333,1.333,1.333",[K_.SHORTDASHDOTDOT]:"5.333,1.333,1.333,1.333,1.333,1.333"},l={color:"#000",opacity:1,width:1,linecap:"square",linejoin:"miter",miterlimit:4},u={color:[0,0,0,0],width:0,style:a.none},c={solid:v=>({color:v.colour,opacity:v.opacity}),none:()=>"transparent",horizontal:(v,w)=>s.pattern(5,5,I=>I.line(0,5/2,5,5/2)).stroke(w),vertical:(v,w)=>s.pattern(5,5,I=>I.line(5/2,0,5/2,5)).stroke(w),"forward-diagonal":(v,w)=>s.pattern(5,5,I=>{I.line(0,0,5,5).stroke(w),I.line(0,0,5,5).move(0,5).stroke(w),I.line(0,0,5,5).move(5,0).stroke(w)}),"backward-diagonal":(v,w)=>s.pattern(5,5,I=>{I.line(5,0,0,5).stroke(w),I.line(5,0,0,5).move(5/2,5/2).stroke(w),I.line(5,0,0,5).move(-5/2,-5/2).stroke(w)}),cross:(v,w)=>s.pattern(5,5,I=>{I.line(5/2,0,5/2,5).stroke(w),I.line(0,5/2,5,5/2).stroke(w)}),"diagonal-cross":(v,w)=>s.pattern(7,7,I=>{I.line(0,0,7,7).stroke(w),I.line(7,0,0,7).stroke(w)})},h={"simple-marker"(){const v=m(e.color);e.outline=e.outline||u;const w=m(e.outline.color),S=p({color:w.colour,opacity:w.opacity,width:e.outline.width,dasharray:a[e.outline.style]}),I=o[e.style](e).fill({color:v.colour,opacity:v.opacity}).stroke(S).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).rotate(e.angle||0);t.fitInto(I,t.CONTENT_SIZE)},"simple-line"(){const v=m(e.color),w=p({color:v.colour,opacity:v.opacity,width:e.width,linecap:"butt",dasharray:a[e.style]}),S=t.CONTENT_PADDING,I=t.CONTAINER_SIZE-t.CONTENT_PADDING;s.line(S,S,I,I).stroke(w)},esriCLS(){this["simple-line"]()},"simple-fill"(){const v=m(e.color),w=p({color:v.colour,opacity:v.opacity}),S=c[e.style](v,w);e.outline=e.outline||u;const I=m(e.outline.color),R=p({color:I.colour,opacity:I.opacity,width:e.outline.width,linecap:"butt",dasharray:a[e.outline.style]});s.rect(t.CONTENT_SIZE,t.CONTENT_SIZE).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).fill(S).stroke(R)},text(){console.error("no support for feature service legend of text symbols")},"picture-fill"(){const v=e.imageData?`data:${e.contentType};base64,${e.imageData}`:e.url,w=e.width*e.xscale,S=e.height*e.yscale;e.outline=e.outline||u;const I=m(e.outline.color),R=p({color:I.colour,opacity:I.opacity,width:e.outline.width,dasharray:a[e.outline.style]});return t.$iApi.geo.shared.convertImagetoDataURL(v).then(k=>{const B=s.pattern(w,S,$=>$.image(k,w,S));s.rect(t.CONTENT_SIZE,t.CONTENT_SIZE).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).fill(B).stroke(R)})},"picture-marker"(){const v=e.source,w=v&&v.imageData?`data:${v.contentType};base64,${v.imageData}`:e.url;return t.$iApi.geo.shared.convertImagetoDataURL(w).then(I=>t.svgDrawImage(s,I)).then(({image:I})=>{I.center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).rotate(e.angle||0),t.fitInto(I,t.CONTENT_IMAGE_SIZE)})}};try{return await Promise.resolve(h[e.type]()),window.document.body.removeChild(n),s.svg()}catch(v){return console.error(v),this.generateBlankSymbology()}function p(v){return Object.assign({},l,v)}function m(v){return v?{colour:`rgb(${v.r},${v.g},${v.b})`,opacity:v.a}:{colour:"rgb(0, 0, 0)",opacity:0}}}async svgDrawImage(e,t,r=0,n=0,s=!0){return new Promise((o,a)=>{const l=e.image(t,r,n,s).loaded(u=>o({image:l,loader:u})).error(u=>{a(u),console.error(u)})})}fitInto(e,t){const r=e.node.getBoundingClientRect(),n=t/Math.max(r.width,r.height);n<1&&e.scale(n)}rendererToLegend(e){let t;const r=e.symbolUnits.slice(0);if(e.defaultUnit&&r.push(e.defaultUnit),e.falseRenderer)t=r.map(n=>[n]);else{const n=new Map;r.forEach(s=>{const o=n.get(s.label);o?o.push(s):n.set(s.label,[s])}),t=[],n.forEach(s=>t.push(s))}return t.map(n=>{const s=n[0],o={uid:this.$iApi.geo.shared.generateUUID(),label:s.label||"",definitionClause:n.length===1?s.definitionClause:`(${n.map(a=>a.definitionClause).join(" OR ")})`,svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.symbolToSvg(s.symbol).then(a=>{o.svgcode=a,n.forEach(l=>{l.svgCode=a})})};return o})}async getMapServerLegend(e){if(!e)throw new Error("Legend server request is missing the required url.");const t={query:{f:"json"}},r={layers:[]},[n,s]=await _k(zi(`${e}/legend`,t));return s?s.data?s.data:(console.error(`Error loading legend data for ${e}`),r):(console.error(`Error loading legend for ${e}`,n),r)}mapServerLegendToRenderer(e,t){const r=e.layers.find(s=>s.layerId===t);let n;if(typeof r<"u")return n={type:"uniqueValue",field:"fakefield",uniqueValueInfos:r.legend.map(s=>({label:s.label,value:s.label,symbol:{type:"esriPMS",imageData:s.imageData,contentType:s.contentType}}))},this.makeRenderer(YC(n),[],!0);throw new Error("attempted to make renderer from non-existing legend data")}mapServerLegendToRendererAll(e){const t=e.layers.map(n=>n.legend.map(s=>({label:s.label,value:s.label,symbol:{type:"esriPMS",imageData:s.imageData,contentType:s.contentType}}))),r={type:"uniqueValue",field1:"fakefield",uniqueValueInfos:[].concat(...t)};return this.makeRenderer(YC(r),[],!0)}async mapServerToLocalLegend(e,t=void 0){const r=await this.getMapServerLegend(e);let n,s;return typeof t>"u"?(s=0,n=this.mapServerLegendToRendererAll(r)):(s=parseInt(t),n=this.mapServerLegendToRenderer(r,s)),this.rendererToLegend(n)}}class VLr extends tf{constructor(e){super(e)}async arcGisServerQueryIds(e){const t=new Kn;t.returnGeometry=!1,e.filterSql&&(t.where=e.filterSql),e.filterGeometry&&(t.geometry=this.queryGeometryHelper(e.filterGeometry,!1,this.$iApi.geo.map.getScale(),e.sourceSR),t.spatialRelationship="intersects");const r=await uSe(e.url,t);return Array.isArray(r)?r:[]}async geoJsonQuery(e){const t=new Kn;if(t.returnGeometry=!!e.includeGeometry,t.outFields=["*"],e.filterGeometry&&(t.geometry=this.queryGeometryHelper(e.filterGeometry,!0),t.spatialRelationship="intersects"),e.filterSql&&(t.where=e.filterSql),e.filterOIDs&&(t.objectIds=e.filterOIDs),await e.layer.loadPromise(),!e.layer.esriLayer)throw new Error("file layer being queried contains no ESRI layer");return(await e.layer.esriLayer.queryFeatures(t)).features.map((n,s)=>{let o;return t.returnGeometry?o=this.$iApi.geo.geom.geomEsriToRamp(n.geometry,`queryResult${s}`):o=new Kk,new Ax(o,"",n.attributes)})}queryGeometryHelper(e,t,r,n){let s;return!t&&e.type===cl.EXTENT?r&&n&&r>2e7&&e.sr.wkid===3978&&n.wkid===4326?s=e.toESRI():s=e.toPolygon().toESRI():s=e.toESRI(),s}makeClickBuffer(e,t=5){const r=this.$iApi.geo.map,n=r.getExtent(),s=t*(n.xmax-n.xmin)/r.getPixelWidth();return new Yh("ze_buffer",[e.x-s,e.y-s],[e.x+s,e.y+s],e.sr)}}class HLr extends tf{attributes;geom;layer;map;proj;query;shared;symbology;constructor(e){super(e),this.geom=sH.geom,this.proj=sH.proj,this.shared=sH.sharedUtils,this.map=new bFr(e),this.layer=new SLr(e),this.attributes=new LLr(e),this.query=new VLr(e),this.symbology=new zLr(e),Array.isArray(Ho.request.interceptors)||(Ho.request.interceptors=[]),Ho.request.interceptors.push({before:t=>{t.url.includes("?blankTile=false")&&(t.url=t.url.replace("?blankTile=false","?blankTile=true"))}})}set proxy(e){Ho.request.proxyUrl=e}get proxy(){return Ho.request.proxyUrl||""}}const WLr=Object.assign({"../fixtures/appbar/index.ts":()=>Promise.resolve().then(()=>oSn),"../fixtures/areas-of-interest/index.ts":()=>Promise.resolve().then(()=>ISn),"../fixtures/basemap/index.ts":()=>Promise.resolve().then(()=>ZSn),"../fixtures/crosshairs/index.ts":()=>Promise.resolve().then(()=>sTn),"../fixtures/details/index.ts":()=>Promise.resolve().then(()=>BCn),"../fixtures/export-footnote/index.ts":()=>Promise.resolve().then(()=>zCn),"../fixtures/export-legend/index.ts":()=>Promise.resolve().then(()=>ZCn),"../fixtures/export-map/index.ts":()=>Promise.resolve().then(()=>eEn),"../fixtures/export-northarrow/index.ts":()=>Promise.resolve().then(()=>iEn),"../fixtures/export-scalebar/index.ts":()=>Promise.resolve().then(()=>nEn),"../fixtures/export-timestamp/index.ts":()=>Promise.resolve().then(()=>oEn),"../fixtures/export-title/index.ts":()=>Promise.resolve().then(()=>lEn),"../fixtures/export/index.ts":()=>Promise.resolve().then(()=>CEn),"../fixtures/extentguard/index.ts":()=>Promise.resolve().then(()=>AEn),"../fixtures/gazebo/index.ts":()=>Promise.resolve().then(()=>iIn),"../fixtures/geosearch/index.ts":()=>Promise.resolve().then(()=>JIn),"../fixtures/grid/index.ts":()=>Promise.resolve().then(()=>qMn),"../fixtures/help/index.ts":()=>Promise.resolve().then(()=>MOn),"../fixtures/hilight/index.ts":()=>Promise.resolve().then(()=>DOn),"../fixtures/layer-reorder/index.ts":()=>Promise.resolve().then(()=>JPn),"../fixtures/legend/index.ts":()=>Promise.resolve().then(()=>nRn),"../fixtures/mapnav/index.ts":()=>Promise.resolve().then(()=>wRn),"../fixtures/metadata/index.ts":()=>Promise.resolve().then(()=>NRn),"../fixtures/northarrow/index.ts":()=>Promise.resolve().then(()=>XRn),"../fixtures/overviewmap/index.ts":()=>Promise.resolve().then(()=>aDn),"../fixtures/panguard/index.ts":()=>Promise.resolve().then(()=>pDn),"../fixtures/scrollguard/index.ts":()=>Promise.resolve().then(()=>bDn),"../fixtures/settings/index.ts":()=>Promise.resolve().then(()=>ZDn),"../fixtures/snowman/index.ts":()=>Promise.resolve().then(()=>n4n),"../fixtures/wizard/index.ts":()=>Promise.resolve().then(()=>W5n)});class qLr extends tf{constructor(e){super(e)}exists(e){return e in oA(this.$vApp.$pinia).items}async add(e,t){let r;if(e in oA(this.$vApp.$pinia).items)return this.get(e);if(t){if(typeof t!="function")throw new Error("malformed fixture constructor");r=Yu.updateBaseToInstance(new t,e,this.$iApi)}else{const n=(await WLr[`../fixtures/${e}/index.ts`]()).default;r=new n(e,this.$iApi)}return oA(this.$vApp.$pinia).addFixture(r),this.$iApi.event.emit(ln.FIXTURE_ADDED,r),this.$iApi.geo.map.created&&r.initialized?.(),r}remove(e){const t=this.get(e);if(!t)throw new Error(`Could not find fixture ${e} for removal`);return oA(this.$vApp.$pinia).removeFixture(t),this.$iApi.event.emit(ln.FIXTURE_REMOVED,t),t}get(e){const t=[];typeof e=="string"?t.push(e):Array.isArray(e)?t.push(...e):t.push(e.id);const r=t.map(n=>{const s=oA(this.$vApp.$pinia).items[n];if(s)return s});return r.length===1?r[0]:r}isLoaded(e){const t=oA(this.$vApp.$pinia),r=Array.isArray(e)?e:[e];return r.forEach(n=>{t.loadPromises[n]===void 0&&t.addLoadPromise(n)}),Promise.all(t.getLoadPromises(r))}addDefaultFixtures(e){(!Array.isArray(e)||e.length===0)&&(e=["appbar","basemap","crosshairs","details","geosearch","grid","help","hilight","layer-reorder","legend","mapnav","northarrow","overviewmap","panguard","scrollguard","settings","wizard"]);const t=bm(this.$vApp.$pinia);return t.startingFixtures=e,Promise.all(e.map(r=>this.add(r)))}}class Yu extends tf{static updateBaseToInstance(e,t,r){const n=new Yu(t,r);return Object.defineProperties(e,{id:{value:t},$iApi:{value:r},$vApp:{get(){return n.$vApp}},remove:{value:n.remove},extend:{value:n.extend},config:{get(){return n.config}},mount:{value:n.mount}}),e}id;constructor(e,t){super(t),this.id=e}remove(){return this.$iApi.fixture.remove(this),this}extend(e,t={}){const r=Xr({extends:e,iApi:this.$iApi,data(){return{...t}}}),n=YW(r),{el:s}=this.mount(r,{props:{...t.propsData},app:n});return s}mount(e,{props:t,children:r,element:n,app:s}={}){let o=n,a=dx(e,t,r);return s&&s._context&&(a.appContext=s._context),o?VP(a,o):VP(a,o=document.createElement("div")),{vNode:a,destroy:()=>{o&&VP(null,o),o=null,a=null},el:o}}get config(){return bm(this.$vApp.$pinia).config.fixtures[this.id]}getLayerFixtureConfig(e){return this.getLayerFixtureConfigs()[e]}getLayerFixtureConfigs(){const e={},t=(r,n=void 0)=>{if(r.fixtures&&r.fixtures[this.id]!==void 0){let s=r.id;n!==void 0&&(s=`${n.id}-${r.index}`),e[s]=r.fixtures[this.id]}r.sublayers&&r.sublayers.forEach(s=>t(s,r))};return this.$iApi.geo.layer.allLayers().forEach(r=>t(r.config)),e}handlePanelWidths(e){if(this.config?.panelWidth){const t={};typeof this.config?.panelWidth=="number"&&(this.config.panelWidth={default:this.config?.panelWidth}),this.config.panelWidth.default&&e.forEach(r=>{t[r]=this.config.panelWidth.default});for(const r in this.config.panelWidth)r!="default"&&(t[r]=this.config.panelWidth[r]);for(const r in t){const n=this.$iApi.panel.get(r);this.$iApi.panel.setStyle(n,{"flex-basis":`${t[r]}px`})}}}handlePanelTeleports(e){if(this.config?.panelTeleport){const t=w0(this.$vApp.$pinia),r=!!this.config.panelTeleport.target;e.forEach(n=>{t.items[n].teleport=r?this.config.panelTeleport:this.config.panelTeleport[n],t.items[n].style.width="100%"})}}}class YLr extends tf{panelStore=w0(this.$vApp.$pinia);register(e,t){const r=XLr(e)?{[e.id]:e.config}:e;if(t){const s=t.i18n||{},o=this.$iApi.$i18n;Object.entries(s.messages||{}).forEach(a=>o.mergeLocaleMessage(...a)),Object.entries(s.dateTimeFormats||{}).forEach(a=>o.mergeDateTimeFormat(...a)),Object.entries(s.numberFormats||{}).forEach(a=>o.mergeNumberFormat(...a))}const n=Object.entries(r).reduce((s,[o,a])=>(s.push(new Zz(this.$iApi,o,a)),s),[]);return n.forEach(s=>this.panelStore.registerPanel(s)),n.length===1?n[0]:n.reduce((s,o)=>(s[o.id]=o,s),{})}isRegistered(e){const t=Array.isArray(e)?e:[e];return t.forEach(r=>{this.panelStore.regPromises[r]===void 0&&this.panelStore.addRegPromise(r)}),Promise.all(this.panelStore.getRegPromises(t))}remove(e){const t=this.get(e);t&&(t.isOpen&&this.close(t),this.panelStore.removePanel(t))}get(e){const t=typeof e=="string"?e:e.id;return this.panelStore.items[t]}open(e){let t,r,n;if(typeof e=="string"||e instanceof Zz?t=this.get(e):(t=this.get(e.id),{screen:r,props:n}=e),!t)return t;if(t.isOpen&&!t.isVisible)t.minimize();else if(t.isOpen)return t;return r||(t.route&&!n?{screen:r,props:n}=t.route:r=Object.keys(t.screens).pop()),this.show(t,{screen:r,props:n})?(this.panelStore.openPanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.open",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_OPENED,t)):console.error(`Failed to open ${t.id} panel.`),t}get opened(){return this.panelStore.orderedItems.concat(this.panelStore.teleported)}get visible(){return this.panelStore.visible.concat(this.panelStore.teleported)}close(e){const t=this.get(e);return t&&(t.isPinned&&t.pin(!1),this.panelStore.closePanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.close",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_CLOSED,t),t)}minimize(e){const t=this.get(e);return t&&(t.isPinned&&t.pin(!1),this.panelStore.closePanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.minimize",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_MINIMIZED,t),t)}move(e,t){const r=this.get(e);return r&&(this.panelStore.movePanel(r,t),r)}toggle(e,t){let r;return typeof e=="string"||e instanceof Zz?r=this.get(e):r=this.get(e.id),r&&(t=typeof t<"u"?t:!r.isVisible,t!==r.isVisible&&(t?this.open(e):this.close(r)),r)}toggleMinimize(e,t){let r;return typeof e=="string"||e instanceof Zz?r=this.get(e):r=this.get(e.id),r&&(t=typeof t<"u"?t:!r.isVisible,t!==r.isVisible&&(t?this.open(r):this.minimize(r)),r)}pin(e,t){const r=this.get(e);return!r||(t=typeof t<"u"?t:!r.isPinned,!r.isPinned&&!t)||(this.panelStore.pinned=t?r:void 0),r}get pinned(){return this.panelStore.pinned||void 0}show(e,t){const r=this.get(e);if(!r)return r;if(r.screens[t.screen]){if(r.screens[t.screen]?.props){const n=Object.keys(r.screens[t.screen]?.props).filter(o=>o!=="panel"),s=t.props?Object.keys(t.props):[];for(let o=0;o(Dc("data-v-a3c61802"),i=i(),Fc(),i),ZLr=KLr(()=>Ot("div",{class:"loader"},null,-1));function QLr(i,e){const t=Ko("panel-screen");return qt(),Dn(t,{header:!1,class:"screen-spinner"},{content:Rn(()=>[ZLr]),_:1})}const eNr=ml(JLr,[["render",QLr],["__scopeId","data-v-a3c61802"]]),tNr=Object.assign({"../fixtures/areas-of-interest/screen.vue":()=>Promise.resolve().then(()=>SSn),"../fixtures/basemap/screen.vue":()=>Promise.resolve().then(()=>qSn),"../fixtures/export/screen.vue":()=>Promise.resolve().then(()=>xEn),"../fixtures/geosearch/screen.vue":()=>Promise.resolve().then(()=>VIn),"../fixtures/grid/screen.vue":()=>Promise.resolve().then(()=>VMn),"../fixtures/help/screen.vue":()=>Promise.resolve().then(()=>TOn),"../fixtures/layer-reorder/screen.vue":()=>Promise.resolve().then(()=>WPn),"../fixtures/legend/screen.vue":()=>Promise.resolve().then(()=>tRn),"../fixtures/metadata/screen.vue":()=>Promise.resolve().then(()=>FRn),"../fixtures/settings/screen.vue":()=>Promise.resolve().then(()=>XDn),"../fixtures/wizard/screen.vue":()=>Promise.resolve().then(()=>U5n)});class Zz extends tf{id;screens;loadedScreens=[];alertName;teleport;controls;button;isScreenLoaded(e){return this.loadedScreens.indexOf(e)!==-1}registerScreen(e){const t=this.screens[e];let r;if(Q2r(t)||Z2r(t))r=t,this.loadedScreens.push(e);else{let n;typeof t=="string"?n=tNr[`../fixtures/${t}`]():n=t();const s=new Promise((o,a)=>{n.then(l=>{this.loadedScreens.push(e),o(eSr(l)?l.default:l)}),n.catch(l=>a(l))});r=fse({loader:()=>s,loadingComponent:eNr,delay:200})}this.$iApi.$element.component(e,r)}style;expanded;get width(){if(!(!this.style.width||this.style.width.slice(-2)!=="px"))return parseInt(this.style.width)}route;constructor(e,t,r){if(super(e),{id:this.id,screens:this.screens,style:this.style,expanded:this.expanded,alertName:this.alertName,button:this.button,controls:this.controls}={id:t,style:{},expanded:!1,controls:{expand:!1,...r.controls},...r},Object.keys(this.screens).length===0)throw new Error("panel must have at least a single screen");this.route={screen:Object.keys(this.screens).pop()},this.style["flex-basis"]||(this.style["flex-basis"]=this.style.width||"350px"),this.style.width="80%"}open(e){return typeof e>"u"?this.$iApi.panel.open(this):this.$iApi.panel.open({id:this.id,...typeof e=="string"?{screen:e}:e}),this}get isOpen(){return this.$iApi.panel.opened.indexOf(this)!==-1}get isVisible(){return this.$iApi.panel.visible.indexOf(this)!==-1}close(){return this.$iApi.panel.close(this),this}minimize(){return this.$iApi.panel.minimize(this),this}move(e){return this.$iApi.panel.move(this,e),this}get isLeftMostPanel(){if(this.$iApi.panel.visible.length>0){for(const e of this.$iApi.panel.visible)if(!e.teleport)return this.id===e.id}return!1}get isRightMostPanel(){if(this.$iApi.panel.visible.length>0){for(let e=this.$iApi.panel.visible.length-1;e>=0;e--)if(!this.$iApi.panel.visible[e].teleport)return this.id===this.$iApi.panel.visible[e].id}return!1}remove(){return this.$iApi.panel.remove(this),this}toggle(e){return typeof e>"u"?this.$iApi.panel.toggle(this,!this.isOpen):typeof e=="boolean"?e!==this.isOpen&&this.$iApi.panel.toggle(this,e):this.$iApi.panel.toggle({id:this.id,screen:e.screen,props:e.props},typeof e.toggle<"u"?e.toggle:!this.isOpen),this}toggleMinimize(e){return typeof e>"u"||typeof e=="boolean"?this.$iApi.panel.toggleMinimize(this,e):this.$iApi.panel.toggleMinimize({id:this.id,screen:e.screen,props:e.props},typeof e.toggle<"u"?e.toggle:!this.isOpen),this}pin(e){return e=typeof e<"u"?e:!this.isPinned,this.$iApi.panel.pin(this,e),this}get isPinned(){return!!this.$iApi.panel.pinned&&this.$iApi.panel.pinned.id===this.id}show(e){const t=typeof e=="string"?{screen:e}:e;return this.route=t,this.$iApi.panel.show(this,t),this}setStyles(e,t=!1){return this.$iApi.panel.setStyle(this,e,t),this}expand(e){return this.$iApi.panel.expand(this,e),this}}console.info(`RAMP v4.8.0 [${"75d28aa6ec0555f069781708224190508190de79".slice(0,9)}] (Built on ${new Date("Tue Aug 27 14:26:11 2024 -0400").toLocaleString()})`);const iK={major:"4",minor:"8",patch:"0",timestamp:"Tue Aug 27 14:26:11 2024 -0400",hash:"75d28aa6ec0555f069781708224190508190de79"},e8t=(i,e,t)=>new mFr(i,e,t),sH=new K2r;function iNr(i,e){let t=e.responseType;t?t!=="array-buffer"&&t!=="blob"&&t!=="json"&&t!=="native"&&t!=="native-request-init"&&t!=="text"&&(t="text"):t="json",e.responseType=t;const r=e.signal;return delete e.signal,globalThis.invokeStaticMessage("request",{url:i,options:e},{signal:r}).then(async n=>{let s,o,a,l,u;if(n.data)if(n.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(s=new Blob([n.data]),t!=="json"&&t!=="text"||(l=await s.text(),t!=="json")))){try{o=JSON.parse(l||null)}catch(c){const h={...c,url:i,requestOptions:e};throw new qe("request:server",c.message,h)}if(o.error){const c={...o.error,url:i,requestOptions:e};throw new qe("request:server",o.error.message,c)}}}else t==="native"&&(n.data.signal=r,a=await fetch(n.data.url,n.data),n.httpStatus=a.status);switch(t){case"blob":u=s;break;case"json":u=o;break;case"native":u=a;break;case"text":u=l;break;default:u=n.data}return{data:u,httpStatus:n.httpStatus,requestOptions:e,ssl:n.ssl,url:i}})}const rNr=Object.freeze(Object.defineProperty({__proto__:null,execute:iNr},Symbol.toStringTag,{value:"Module"})),dOe="esri-identity-modal",pOe={base:dOe,info:`${dOe}__info`,notice:`${dOe}__notice`},nNr="ArcGIS Online";let Sw=class extends my{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle),input:()=>Promise.resolve().then(()=>aFn),label:()=>Promise.resolve().then(()=>dFn),modal:()=>Promise.resolve().then(()=>OFn),notice:()=>Promise.resolve().then(()=>wZe)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:n,oAuthPrompt:s,server:o,resource:a,error:l}=this,{info:u,oAuthInfo:c,lblItem:h,invalidUser:p,noAuthService:m,lblUser:v,lblPwd:w,lblCancel:S,lblSigning:I,lblOk:R}=r;return er("div",{class:this.classes(pOe.base,N5t())},er("form",{bind:this,onsubmit:this._submit},er("calcite-modal",{bind:this,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteModalClose:this._cancel,onCalciteModalOpen:this._focusUsernameInput},er("div",{slot:"header"},t),er("div",{slot:"content"},er("div",{class:pOe.info},xC(s?c:u,{server:o&&/\.arcgis\.com/i.test(o)?nNr:o,resource:`(${a||h})`})),l?er("calcite-notice",{class:pOe.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},er("div",{slot:"message"},l.details?.httpStatus?p:m)):null,s?null:[er("calcite-label",null,v,er("calcite-input",{afterCreate:L=>this._usernameInputNode=L,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),er("calcite-label",null,w,er("calcite-input",{afterCreate:L=>this._passwordInputNode=L,bind:this,name:"password",required:!0,type:"password",value:""}))]),er("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"secondary",type:"button",width:"full"},S),er("calcite-button",{loading:!!n,slot:"primary",type:"submit",width:"full"},n?I:R))))}_focusUsernameInput(){requestAnimationFrame(()=>{this._usernameInputNode?.setFocus()})}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};x([D({readOnly:!0})],Sw.prototype,"container",void 0),x([D(),Sg("esri/t9n/common")],Sw.prototype,"commonMessages",void 0),x([D()],Sw.prototype,"error",void 0),x([D(),Sg("esri/identity/t9n/identity")],Sw.prototype,"messages",void 0),x([D()],Sw.prototype,"oAuthPrompt",void 0),x([D()],Sw.prototype,"open",void 0),x([D()],Sw.prototype,"signingIn",void 0),x([D()],Sw.prototype,"server",void 0),x([D({readOnly:!0})],Sw.prototype,"title",null),x([D()],Sw.prototype,"resource",void 0),Sw=x([Qe("esri.identity.IdentityModal")],Sw);const adt=Sw,fOe="esriJSAPIOAuth";let i6e=class{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(fOe,JSON.stringify(e))}catch(n){return console.warn(n),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",n=new FormData;if(n.append("f","json"),n.append("auth_token",this.refreshToken||this.token),n.append("client_id",t.appId),n.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(r,n);else{const s=new XMLHttpRequest;s.open("POST",r),s.send(n)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(fOe,JSON.stringify(e))}catch(n){console.log(n)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(fOe);if(t)try{e=JSON.parse(t)}catch(r){console.warn(r)}}return e}};i6e.prototype.declaredClass="esri.identity.OAuthCredential";var r6e;let Ey=r6e=class extends Ci{constructor(i){super(i),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return r6e.fromJSON(this.toJSON())}};x([D({json:{write:!0}})],Ey.prototype,"appId",void 0),x([D({json:{write:!0}})],Ey.prototype,"authNamespace",void 0),x([D({json:{write:!0}})],Ey.prototype,"expiration",void 0),x([D({json:{write:!0}})],Ey.prototype,"flowType",void 0),x([D({json:{write:!0}})],Ey.prototype,"forceLogin",void 0),x([D({json:{write:!0}})],Ey.prototype,"forceUserId",void 0),x([D({json:{write:!0}})],Ey.prototype,"locale",void 0),x([D({json:{write:!0}})],Ey.prototype,"minTimeUntilExpiration",void 0),x([D({json:{write:!0}})],Ey.prototype,"popup",void 0),x([D({json:{write:!0}})],Ey.prototype,"popupCallbackUrl",void 0),x([D({json:{write:!0}})],Ey.prototype,"popupWindowFeatures",void 0),x([D({json:{write:!0}})],Ey.prototype,"portalUrl",void 0),x([D({json:{write:!0}})],Ey.prototype,"preserveUrlHash",void 0),x([D({json:{write:!0}})],Ey.prototype,"userId",void 0),Ey=r6e=x([Qe("esri.identity.OAuthInfo")],Ey);const ldt=Ey;let Tw=class extends Ci{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};x([D({json:{write:!0}})],Tw.prototype,"adminTokenServiceUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"currentVersion",void 0),x([D({json:{write:!0}})],Tw.prototype,"hasPortal",void 0),x([D({json:{write:!0}})],Tw.prototype,"hasServer",void 0),x([D({json:{write:!0}})],Tw.prototype,"owningSystemUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"owningTenant",void 0),x([D({json:{write:!0}})],Tw.prototype,"server",void 0),x([D({json:{write:!0}})],Tw.prototype,"shortLivedTokenValidity",void 0),x([D({json:{write:!0}})],Tw.prototype,"tokenServiceUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"webTierAuth",void 0),Tw=x([Qe("esri.identity.ServerInfo")],Tw);const mOe=Tw,Dge={},t8t=i=>{const e=new Qy(i.owningSystemUrl).host,t=new Qy(i.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(t)},n6e=(i,e)=>!!(t8t(i)&&e&&e.some(t=>t.test(i.server)));let Fge=null,kge=null;try{Fge=window.localStorage,kge=window.sessionStorage}catch{}let i8t=class extends rd{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=Yo(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(r=>{r.owningSystemUrl&&this._portals.push(r.owningSystemUrl),r.hasPortal&&this._portals.push(r.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const n=this.findOAuthInfo(r.portalUrl);n&&t.splice(t.indexOf(n),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let n,s=this.findServerInfo(t),o=!0;s||(s=new mOe,s.server=this._getServerInstanceRoot(t),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(t),s.hasPortal=!0),this.registerServers([s])),n=this._findCredential(t),n?(delete e.server,Object.assign(n,e),o=!1):(n=new hd({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),n.resources=[t],this.credentials.push(n)),n.emitTokenChange(!1),o||n.refreshServerTokens()}toJSON(){return BUe({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,n=e.credentials;if(t){const s=[];t.forEach(o=>{o.server&&o.tokenServiceUrl&&s.push(o.declaredClass?o:new mOe(o))}),s.length&&this.registerServers(s)}if(r){const s=[];r.forEach(o=>{o.appId&&s.push(o.declaredClass?o:new ldt(o))}),s.length&&this.registerOAuthInfos(s)}n&&n.forEach(s=>{s.server&&s.token&&s.expires&&s.expires>Date.now()&&((s=s.declaredClass?s:new hd(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const n=this._isServerRsrc(e)?"server":"portal";if(t){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&t===s.userId&&s.scope===n){r=s;break}}else for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&this._getIdenticalSvcIdx(e,s)!==-1&&s.scope===n){r=s;break}return r}getCredential(e,t){let r,n,s=!0;t&&(r=!!t.token,n=t.error,s=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const o=new AbortController,a=ac();if(t.signal&&Qh(t.signal,()=>{o.abort()}),Qh(o,()=>{a.reject(new qe("identity-manager:user-aborted","ABORTED"))}),xg(o))return a.promise;t.signal=o.signal;const l=this._isAdminResource(e),u=r?this.findCredential(e):null;let c;if(u&&n&&n.details&&n.details.httpStatus===498)u.destroy();else if(u)return c=new qe("identity-manager:not-authorized","You are currently signed in as: '"+u.userId+"'. You do not have access to this resource: "+e,{error:n}),a.reject(c),a.promise;const h=this._findCredential(e,t);if(h)return a.resolve(h),a.promise;let p=this.findServerInfo(e);if(p)!p.hasPortal&&p.server&&p.owningSystemUrl&&this._hasSameServerInstance(p.server,p.owningSystemUrl)&&(p.hasPortal=!0),!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const m=this._getTokenSvcUrl(e);if(!m)return c=new qe("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(c),a.promise;p=new mOe,p.server=this._getServerInstanceRoot(e),typeof m=="string"?(p.tokenServiceUrl=m,p.hasPortal=!0):(p._restInfoPms=m,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&p._selfReq===void 0&&(s||_v(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(m=>m.tokenServiceUrl===p.tokenServiceUrl))&&(p._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,a,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const n=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new Qy(this._appOrigin),o=e.shortLivedTokenValidity;let a,l,u,c,h,p,m,v;t&&(v=this.tokenValidity||o||this._defaultTokenValidity,v>o&&o>0&&(v=o)),r&&(a=r.isAdmin,l=r.serverUrl,u=r.token,p=r.signal,m=r.ssl,e.customParameters=r.customParameters),a?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,h=new Qy(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!m&&s.scheme==="http"&&(_v(s.uri,c,!0)||h.scheme==="https"&&s.host===h.host&&s.port==="7080"&&h.port==="7443")&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const w={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:l,token:u,expiration:v,referer:a||n?this._appOrigin:null,client:a?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};return n||(w.withCredentials=!1),zi(c,w).then(S=>{const I=S.data;if(!I?.token)return new qe("identity-manager:authentication-failed","Unable to generate token");const R=e.server;return Dge[R]||(Dge[R]={}),t&&(Dge[R][t.username]=t.password),I.validity=v,I})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,r){let n=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let o;const a={f:"json"};if(s.scope==="portal")if(t&&(this._doPortalSignIn(e)||r?.force))o=s.server+"/sharing/rest/oauth2/validateAppAccess",a.client_id=t;else{if(!s.token)return{credential:s};o=s.server+"/sharing/rest"}else{if(!s.token)return{credential:s};o=s.server+"/rest/services"}return s.token&&(a.token=s.token),zi(o,{query:a,authMode:"anonymous"}).then(l=>{if(l.data.valid===!1)throw new qe("identity-manager:not-authorized",`You are currently signed in as: '${s.userId}'.`,l.data);return n=!!l.data.viewOnlyUserTypeApp,{credential:s}}).catch(l=>{if(l.name==="identity-manager:not-authorized")throw l;const u=l.details?.httpStatus;if(u===498)throw s.destroy(),new qe("identity-manager:not-authenticated","User is not signed in.");if(u===400)throw new qe("identity-manager:invalid-request");return{credential:s}})}).then(s=>({credential:s.credential,viewOnly:n}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(mP(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const n=ac(),s=()=>{l?.remove(),u?.remove(),this.dialog?.destroy(),this.dialog=l=u=null},o=()=>{s(),this._oAuthDfd=null,n.reject(new qe("identity-manager:user-aborted","ABORTED"))};r.signal&&Qh(r.signal,()=>{o()});const a=new adt({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=a,this.emit("dialog-create");let l=a.on("cancel",o),u=a.on("submit",c=>{this.generateToken(t,c,{isAdmin:r.isAdmin,signal:r.signal}).then(h=>{s();const p=new hd({userId:c.username,server:t.server,token:h.token,expires:h.expires!=null?Number(h.expires):null,ssl:!!h.ssl,isAdmin:r.isAdmin,validity:h.validity});n.resolve(p)}).catch(h=>{a.error=h,a.signingIn=!1})});return n.promise}oAuthSignIn(e,t,r,n){this._oAuthDfd=ac();const s=this._oAuthDfd;let o;n?.signal&&Qh(n.signal,()=>{const p=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;p&&!p.closed?p.close():this.dialog&&c()}),s.resUrl_=e,s.sinfo_=t,s.oinfo_=r;const a=r._oAuthCred;if(a.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&t.currentVersion>=8.4)){let p=crypto.getRandomValues(new Uint8Array(32));o=YAe(p),a.codeVerifier=o,p=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=YAe(p),a.save()||(a.codeVerifier=o=null)}else a.codeVerifier=null;let l,u;this._getCodeChallenge(o).then(p=>{const m=!n||n.oAuthPopupConfirmation!==!1;if(!r.popup||!m)return void this._doOAuthSignIn(e,t,r,p);const v=new adt({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=v,this.emit("dialog-create"),l=v.on("cancel",c),u=v.on("submit",()=>{h(),this._doOAuthSignIn(e,t,r,p)})});const c=()=>{h(),this._oAuthDfd=null,s.reject(new qe("identity-manager:user-aborted","ABORTED"))},h=()=>{l?.remove(),u?.remove(),this.dialog?.destroy(),this.dialog=null};return s.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=BA(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&t.data?.type==="arcgis:auth:requestCredential"){const r=t.source;this.getCredential(e).then(n=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:n.expires,server:n.server,ssl:n.ssl,token:n.token,userId:n.userId}},t.origin)}).catch(n=>{r.postMessage({type:"arcgis:auth:error",error:{name:n.name,message:n.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const r=mP(e);let n=!1;if(r.access_token&&r.expires_in&&r.state&&r.hasOwnProperty("username"))try{r.state=JSON.parse(r.state),r.state.portalUrl&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}n&&(window.location.hash=r.state?.hash||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const r=mP(t);let n=!1;if(r.code&&r.state)try{r.state=JSON.parse(r.state),r.state.portalUrl&&r.state.uid&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}if(n){const s={...r};["code","error","error_description","message_code","persist","state"].forEach(l=>{delete s[l]});const o=Lb(s),a=window.location.pathname+(o?`?${o}`:"")+(r.state?.hash||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,t,r,n,s){return e=e.replace(/^http:/i,"https:"),zi(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:n&&s?{grant_type:"authorization_code",code:t,redirect_uri:n,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(o=>o.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(r=>YAe(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new qe("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let r,n,s,o,a=-1;const l=t?.token,u=t?.resource,c=this._isServerRsrc(e)?"server":"portal",h=this.credentials.filter(p=>this._hasSameServerInstance(p.server,e)&&p.scope===c);if(e=u||e,h.length)if(h.length===1){if(r=h[0],s=this.findServerInfo(r.server),n=s?.owningSystemUrl,o=n?this.findCredential(n,r.userId):void 0,a=this._getIdenticalSvcIdx(e,r),!l)return a===-1&&r.resources.push(e),this._addResource(e,o),r;a!==-1&&(r.resources.splice(a,1),this._removeResource(e,o))}else{let p,m;if(h.some(v=>(m=this._getIdenticalSvcIdx(e,v),m!==-1&&(p=v,s=this.findServerInfo(p.server),n=s?.owningSystemUrl,o=n?this.findCredential(n,p.userId):void 0,a=m,!0))),l)p&&(p.resources.splice(a,1),this._removeResource(e,o));else if(p)return this._addResource(e,o),p}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!_v(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!_v(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new Qy(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return r===-1&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),r!==-1||HCt(t)||(r=t.indexOf("/sharing")),r===-1&&t.substr(-1)==="/"&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(Ho.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return r!==-1&&(e=e.substring(r+t.length+1)),e=X1(e),Yo(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const n=this._getSuffix(e).toLowerCase(),s=this._getSuffix(t).toLowerCase();if(r=n===s,!r){const o=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=n.replaceAll(o,"$1")===s.replaceAll(o,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new Qy(e.toLowerCase()),r=this._portalConfig;let n=this._gwDomains.some(s=>s.regex.test(t.uri));return!n&&r&&(n=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),n||Ho.portalUrl&&(n=_v(t,Ho.portalUrl,!0)),n||(n=this._portals.some(s=>this._hasSameServerInstance(s,t.uri))),n=n||this._agsPortal.test(t.path),n}_isIdProvider(e,t){let r=-1,n=-1;this._gwDomains.forEach((o,a)=>{r===-1&&o.regex.test(e)&&(r=a),n===-1&&o.regex.test(t)&&(n=a)});let s=!1;if(r>-1&&n>-1&&(r===0||r===4?n!==0&&n!==4||(s=!0):r===1?n!==1&&n!==2||(s=!0):r===2?n===2&&(s=!0):r===3&&n===3&&(s=!0)),!s){const o=this.findServerInfo(t),a=o?.owningSystemUrl;a&&t8t(o)&&this._isPortalDomain(a)&&this._isIdProvider(e,a)&&(s=!0)}return s}_getIdenticalSvcIdx(e,t){let r=-1;for(let n=0;no.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let s="";if(this._gwDomains.some(o=>(o.regex.test(e)&&(s=o.tokenServiceUrl),!!s)),s||this._portals.some(o=>(this._hasSameServerInstance(o,e)&&(s=o+this._gwTokenUrl),!!s)),s||(n=e.toLowerCase().indexOf("/sharing"),n!==-1&&(s=e.substring(0,n)+this._gwTokenUrl)),s||(s=this._getOrigin(e)+this._gwTokenUrl),s){const o=new Qy(e).port;/^http:\/\//i.test(e)&&o==="7080"&&(s=s.replace(/:7080/i,":7443")),s=s.replace(/http:/i,"https:")}return s}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const n=t._oAuthCred;if(e.code){const o=n.codeVerifier;return n.codeVerifier=null,n.stateUID=null,n.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),o).then(a=>{const l=new hd({userId:a.username,server:r.server,token:a.access_token,expires:Date.now()+1e3*a.expires_in,ssl:a.ssl,oAuthState:e.state,_oAuthCred:n});return t.userId=l.userId,n.storage=a.persist?Fge:kge,n.refreshToken=a.refresh_token,n.token=null,n.expires=a.refresh_token_expires_in?Date.now()+1e3*a.refresh_token_expires_in:null,n.userId=l.userId,n.ssl=l.ssl,n.save(),l})}const s=new hd({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:n});return t.userId=s.userId,n.storage=e.persist?Fge:kge,n.refreshToken=null,n.token=s.token,n.expires=s.expires,n.userId=s.userId,n.ssl=s.ssl,n.save(),Promise.resolve(s)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r=e.error==="access_denied",n=new qe(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(n)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(r=>{t.resolve(r)}).catch(r=>{t.reject(r)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(mP(e)))}_exchangeToken(e,t,r){return zi(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then(n=>n.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),zi(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,t){let r;return this._gwDomains.some(n=>(n.regex.test(e)&&(r=n.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),zi(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(n=>n.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,n=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(n?n.hasPortal||n.owningSystemUrl&&this._isPortalDomain(n.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||_v(r,e,!0)))}_checkProtocol(e,t,r,n){let s=!0;const o=n?t.adminTokenServiceUrl:t.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&Qoe(o)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!s)&&r(new qe("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,t,r,n,s,o){return n||(n=ac()),n.resUrl_=e,n.sinfo_=t,n.options_=r,n.admin_=s,n.refresh_=o,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(n)):this._xoReqs.push(n):this._doSignIn(n),n.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=u=>{const c=e.options_?.resource,h=e.resUrl_,p=e.refresh_;let m=!1;this.credentials.includes(u)||(p&&this.credentials.includes(p)?(p.userId=u.userId,p.token=u.token,p.expires=u.expires,p.validity=u.validity,p.ssl=u.ssl,p.creationTime=u.creationTime,m=!0,u=p):this.credentials.push(u)),u.resources||(u.resources=[]),u.resources.includes(c||h)||u.resources.push(c||h),u.scope=this._isServerRsrc(h)?"server":"portal",u.emitTokenChange();const v=this._soReqs,w={};this._soReqs=[],v.forEach(S=>{if(!this._isIdenticalService(h,S.resUrl_)){const I=this._getSuffix(S.resUrl_);w[I]||(w[I]=!0,u.resources.push(S.resUrl_))}}),e.resolve(u),v.forEach(S=>{this._hasSameServerInstance(this._getServerInstanceRoot(h),S.resUrl_)?S.resolve(u):this._soReqs.push(S)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,m||this.emit("credential-create",{credential:u}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=u=>{e.reject(u),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},n=(u,c,h,p)=>{const m=e.sinfo_,v=!e.options_||e.options_.prompt!==!1,w=m.hasPortal&&this._findOAuthInfo(e.resUrl_);let S,I;if(u)t(new hd({userId:u,server:m.server,token:h||null,expires:p!=null?Number(p):null,ssl:!!c}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const R=BA(window,"message",L=>{L.source===window.parent&&L.data&&(L.data.type==="arcgis:auth:credential"?(R.remove(),L.data.credential.expires{R.remove()})}else if(w){let R=w._oAuthCred;if(!R){const L=new i6e(w,Fge),k=new i6e(w,kge);L.isValid()&&k.isValid()?L.expires>k.expires?(R=L,k.destroy()):(R=k,L.destroy()):R=L.isValid()?L:k,w._oAuthCred=R}if(R.isValid()){S=new hd({userId:R.userId,server:m.server,token:R.token,expires:R.expires,ssl:R.ssl,_oAuthCred:R});const L=w.appId!==R.appId&&this._doPortalSignIn(e.resUrl_);L||R.refreshToken?(e._pendingDfd=R.refreshToken?this._getOAuthToken(m.server,R.refreshToken,R.appId).then(k=>(S.expires=Date.now()+1e3*k.expires_in,S.token=k.access_token,S)):Promise.resolve(S),e._pendingDfd.then(k=>L?this._exchangeToken(k.server,w.appId,k.token).then(B=>(k.token=B,k)).catch(()=>k):k).then(k=>{t(k)}).catch(()=>{R?.destroy(),n()})):t(S)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(w.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===R.stateUID&&R.codeVerifier)){const L=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(L,w,m).then(k=>{t(k)}).catch(r)}else{const L=()=>{v?e._pendingDfd=this.oAuthSignIn(e.resUrl_,m,w,e.options_).then(t,r):(I=new qe("identity-manager:not-authenticated","User is not signed in."),r(I))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(m.server,w.appId).then(k=>{_v(k.portalUrl,this._appOrigin,!0)?(S=new hd({userId:k.username,server:m.server,expires:Date.now()+1e3*k.expires_in,token:k.token}),t(S)):L()}).catch(L):L()}}else if(v){if(this._checkProtocol(e.resUrl_,m,r,e.admin_)){let R=e.options_;e.admin_&&(R=R||{},R.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,m,R).then(t,r)}}else I=new qe("identity-manager:not-authenticated","User is not signed in."),r(I)},s=()=>{const u=e.sinfo_,c=u.owningSystemUrl,h=e.options_;let p,m,v,w;if(h&&(p=h.token,m=h.error,v=h.prompt),w=this._findCredential(c,{token:p,resource:e.resUrl_}),!w){for(const S of this.credentials)if(this._isIdProvider(c,S.server)){w=S;break}}if(w){const S=this.findCredential(e.resUrl_,w.userId);if(S)t(S);else if(n6e(u,this._legacyFed)){const I=w.toJSON();I.server=u.server,I.resources=null,t(new hd(I))}else(e._pendingDfd=this.generateToken(this.findServerInfo(w.server),null,{serverUrl:e.resUrl_,token:w.token,signal:e.options_.signal,ssl:w.ssl})).then(I=>{t(new hd({userId:w?.userId,server:u.server,token:I.token,expires:I.expires!=null?Number(I.expires):null,ssl:!!I.ssl,isAdmin:e.admin_,validity:I.validity}))},r)}else this._busy=null,p&&(e.options_.token=null),(e._pendingDfd=this.getCredential(c.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:u.owningTenant,signal:e.options_.signal,token:p,error:m,prompt:v})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},S=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(S)})};this._errbackFunc=r;const o=e.sinfo_.owningSystemUrl,a=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(u=>{const c=e.sinfo_;if(c._restInfoPms){c.adminTokenServiceUrl=c._restInfoPms.adminUrl,c._restInfoPms=null,c.tokenServiceUrl=(uS("authInfo.tokenServicesUrl",u)||uS("authInfo.tokenServiceUrl",u)||uS("tokenServiceUrl",u))??null,c.shortLivedTokenValidity=uS("authInfo.shortLivedTokenValidity",u)??null,c.currentVersion=u.currentVersion,c.owningTenant=u.owningTenant;const h=c.owningSystemUrl=u.owningSystemUrl;h&&this._portals.push(h)}a&&c.owningSystemUrl?s():n()},()=>{e.sinfo_._restInfoPms=null;const u=new qe("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(u)}):a&&o?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(u=>{const c={};let h,p,m,v;return u&&(h=u.user?.username,c.username=h,c.allSSL=u.allSSL,p=u.supportsOAuth,v=parseFloat(u.currentVersion),u.portalMode==="multitenant"&&(m=u.customBaseUrl),e.sinfo_.currentVersion=v),e.sinfo_.webTierAuth=!!h,h&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:c.allSSL}).catch(()=>null).then(w=>(c.portalToken=w&&w.token,c.tokenExpiration=w&&w.expires,c)):!h&&p&&v>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:m,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>c):c}).catch(()=>null).then(u=>{e.sinfo_._selfReq=null,u?n(u.username,u.allSSL,u.portalToken,u.tokenExpiration):n()}):n()}_generateOAuthInfo(e){let t,r=null,n=e.portalUrl;const s=e.customBaseUrl,o=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let l=r.indexOf("?");l>-1&&(r=r.slice(0,l)),l=r.search(/\/(apps|home)\//),r=l>-1?r.slice(0,l):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=zi(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new ldt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return n=n.replace(/^http:/i,"https:"),zi(n+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:xf(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(l=>{if(l.data.valid){const u=this._defaultOAuthInfo.clone();l.data.urlKey&&s?u.portalUrl="https://"+l.data.urlKey.toLowerCase()+"."+s:u.portalUrl=n,u.popup=window!==window.top||!(_v(n,this._appOrigin)||this._gwDomains.some(c=>c.regex.test(n)&&c.regex.test(this._appOrigin))),this.oAuthInfos.push(u)}})})}_doOAuthSignIn(e,t,r,n){const s=r._oAuthCred,o={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(o.hash=window.location.hash),s.stateUID&&(o.uid=s.stateUID);const a={client_id:r.appId,response_type:s.codeVerifier?"code":"token",state:JSON.stringify(o),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!s.codeVerifier)};r.forceLogin&&(a.force_login=!0),r.forceUserId&&r.userId&&(a.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(a.redirectToUserOrgUrl=!0),s.codeVerifier&&(a.code_challenge=n||s.codeVerifier,a.code_challenge_method=n?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",u=l+"?"+Lb(a);if(r.popup){const c=window.open(u,"esriJSAPIOAuth",r.popupWindowFeatures);if(c)c.focus(),this._oAuthDfd.oAuthWin_=c,this._oAuthIntervalId=setInterval(()=>{if(c.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const h=this._oAuthDfd;if(h){const p=new qe("identity-manager:user-aborted","ABORTED");h.reject(p)}}},500),this._oAuthOnPopupHandle=BA(window,["arcgis:auth:hash","arcgis:auth:location:search"],h=>{h.type==="arcgis:auth:hash"?this.setOAuthResponseHash(h.detail):this._setOAuthResponseQueryString(h.detail)});else{const h=new qe("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(h)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:a,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=u}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return xf(e.popupCallbackUrl);if(t){const n=Yo(r);return n.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete n.query[s]}),gg(n.path,n.query)}return r}};i8t.prototype.declaredClass="esri.identity.IdentityManagerBase";let hd=class extends rd.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const e=no.findServerInfo(this.server),t=e?.owningSystemUrl,r=!!t&&this.scope==="server",n=r&&n6e(e,no._legacyFed),s=e.webTierAuth,o=s&&no.normalizeWebTierAuth,a=Dge[this.server],l=a?.[this.userId];let u,c=this.resources&&this.resources[0],h=r?no.findServerInfo(t):null,p={username:this.userId,password:l};if(s&&!o)return;r&&!h&&no.serverInfos.some(v=>(no._isIdProvider(t,v.server)&&(h=v),!!h));const m=h?no.findCredential(h.server,this.userId):null;if(!r||m){if(!n){if(r)u={serverUrl:c,token:m?.token,ssl:m&&m.ssl};else if(o)p=null,u={ssl:this.ssl};else{if(!l){let v;return c&&(c=no._sanitizeUrl(c),this._enqueued=1,v=no._enqueue(c,e,null,null,this.isAdmin,this),v.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),v}this.isAdmin&&(u={isAdmin:!0})}return no.generateToken(r?h:e,r?null:p,u).then(v=>{this.token=v.token,this.expires=v.expires!=null?Number(v.expires):null,this.creationTime=Date.now(),this.validity=v.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}m?.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&no.credentials.forEach(e=>{const t=no.findServerInfo(e.server),r=t?.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&e.scope==="server"&&(no._hasSameServerInstance(this.server,r)||no._isIdProvider(r,this.server))&&(n6e(t,no._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server?no.findServerInfo(this.server):null,r=t?.owningSystemUrl,n=r?no.findServerInfo(r):null;e===!1||r&&this.scope!=="portal"&&(!n?.webTierAuth||no.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=no.credentials.indexOf(this);e>-1&&no.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=BUe({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};x([D()],hd.prototype,"creationTime",void 0),x([D()],hd.prototype,"expires",void 0),x([D()],hd.prototype,"isAdmin",void 0),x([D()],hd.prototype,"oAuthState",void 0),x([D()],hd.prototype,"resources",void 0),x([D()],hd.prototype,"scope",void 0),x([D()],hd.prototype,"server",void 0),x([D()],hd.prototype,"ssl",void 0),x([D()],hd.prototype,"token",void 0),x([D()],hd.prototype,"tokenRefreshBuffer",void 0),x([D()],hd.prototype,"userId",void 0),x([D()],hd.prototype,"validity",void 0),hd=x([Qe("esri.identity.Credential")],hd);let r8t=class extends i8t{};r8t.prototype.declaredClass="esri.identity.IdentityManager";const n8t=new r8t;WWi(n8t);const sNr=Object.freeze(Object.defineProperty({__proto__:null,default:n8t},Symbol.toStringTag,{value:"Module"}));var udt,rK,cdt,s8t={exports:{}};udt=s8t,rK=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(rK=rK||__filename),cdt=function(i={}){var e,t,r=i;r.ready=new Promise((Oe,ui)=>{e=Oe,t=ui});var n,s,o,a=Object.assign({},r),l="./this.program",u=typeof window=="object",c=typeof importScripts=="function",h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function m(Oe){return r.locateFile?r.locateFile(Oe,p):p+Oe}if(h){var v=require("fs"),w=require("path");p=c?w.dirname(p)+"/":__dirname+"/",n=(Oe,ui)=>(Oe=ot(Oe)?new URL(Oe):w.normalize(Oe),v.readFileSync(Oe,ui?void 0:"utf8")),o=Oe=>{var ui=n(Oe,!0);return ui.buffer||(ui=new Uint8Array(ui)),ui},s=(Oe,ui,Zi,Or=!0)=>{Oe=ot(Oe)?new URL(Oe):w.normalize(Oe),v.readFile(Oe,Or?void 0:"utf8",(wn,vo)=>{wn?Zi(wn):ui(Or?vo.buffer:vo)})},!r.thisProgram&&process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),r.inspect=()=>"[Emscripten Module object]"}else(u||c)&&(c?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),rK&&(p=rK),p=p.indexOf("blob:")!==0?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=Oe=>{var ui=new XMLHttpRequest;return ui.open("GET",Oe,!1),ui.send(null),ui.responseText},c&&(o=Oe=>{var ui=new XMLHttpRequest;return ui.open("GET",Oe,!1),ui.responseType="arraybuffer",ui.send(null),new Uint8Array(ui.response)}),s=(Oe,ui,Zi)=>{var Or=new XMLHttpRequest;Or.open("GET",Oe,!0),Or.responseType="arraybuffer",Or.onload=()=>{Or.status==200||Or.status==0&&Or.response?ui(Or.response):Zi()},Or.onerror=Zi,Or.send(null)});var S,I,R=console.log.bind(console),L=console.error.bind(console);Object.assign(r,a),a=null,typeof WebAssembly!="object"&&$e("no native wasm support detected");var k,B,$,V,Y,K,Q,re=!1;function ne(Oe,ui){Oe||$e(ui)}function de(){var Oe=I.buffer;r.HEAP8=k=new Int8Array(Oe),r.HEAP16=$=new Int16Array(Oe),r.HEAPU8=B=new Uint8Array(Oe),r.HEAPU16=new Uint16Array(Oe),r.HEAP32=V=new Int32Array(Oe),r.HEAPU32=Y=new Uint32Array(Oe),r.HEAPF32=K=new Float32Array(Oe),r.HEAPF64=Q=new Float64Array(Oe)}var pe=[],H=[],Z=[];function ae(){ct(pe)}function fe(){ct(H)}function be(){ct(Z)}function _e(Oe){H.unshift(Oe)}var Ie=0,Te=null;function Be(Oe){Ie++}function Ve(Oe){if(--Ie==0&&Te){var ui=Te;Te=null,ui()}}function $e(Oe){L(Oe="Aborted("+Oe+")"),re=!0,Oe+=". Build with -sASSERTIONS for more info.";var ui=new WebAssembly.RuntimeError(Oe);throw t(ui),ui}var tt,yt="data:application/octet-stream;base64,";function Ct(Oe){return Oe.startsWith(yt)}function ot(Oe){return Oe.startsWith("file://")}function vt(Oe){if(Oe==tt&&S)return new Uint8Array(S);if(o)return o(Oe);throw"both async and sync fetching of the wasm failed"}function At(Oe){if(u||c){if(typeof fetch=="function"&&!ot(Oe))return fetch(Oe,{credentials:"same-origin"}).then(ui=>{if(!ui.ok)throw"failed to load wasm binary file at '"+Oe+"'";return ui.arrayBuffer()}).catch(()=>vt(Oe));if(s)return new Promise((ui,Zi)=>{s(Oe,Or=>ui(new Uint8Array(Or)),Zi)})}return Promise.resolve().then(()=>vt(Oe))}function Je(Oe,ui,Zi){return At(Oe).then(Or=>WebAssembly.instantiate(Or,ui)).then(Or=>Or).then(Zi,Or=>{L(`failed to asynchronously prepare wasm: ${Or}`),$e(Or)})}function it(Oe,ui,Zi,Or){return Oe||typeof WebAssembly.instantiateStreaming!="function"||Ct(ui)||ot(ui)||h||typeof fetch!="function"?Je(ui,Zi,Or):fetch(ui,{credentials:"same-origin"}).then(wn=>WebAssembly.instantiateStreaming(wn,Zi).then(Or,function(vo){return L(`wasm streaming compile failed: ${vo}`),L("falling back to ArrayBuffer instantiation"),Je(ui,Zi,Or)}))}function Ue(){var Oe={a:j};function ui(Or,wn){return W=Or.exports,I=W.t,de(),_e(W.u),Ve(),W}function Zi(Or){ui(Or.instance)}return Be(),it(S,tt,Oe,Zi).catch(t),{}}Ct(tt="pe-wasm.wasm")||(tt=m(tt));var ct=Oe=>{for(;Oe.length>0;)Oe.shift()(r)};function st(Oe,ui="i8"){switch(ui.endsWith("*")&&(ui="*"),ui){case"i1":case"i8":return k[Oe>>0];case"i16":return $[Oe>>1];case"i32":return V[Oe>>2];case"i64":$e("to do getValue(i64) use WASM_BIGINT");case"float":return K[Oe>>2];case"double":return Q[Oe>>3];case"*":return Y[Oe>>2];default:$e(`invalid type for getValue: ${ui}`)}}var Ze=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,ye=(Oe,ui,Zi)=>{for(var Or=ui+Zi,wn=ui;Oe[wn]&&!(wn>=Or);)++wn;if(wn-ui>16&&Oe.buffer&&Ze)return Ze.decode(Oe.subarray(ui,wn));for(var vo="";ui>10,56320|1023&aT)}}else vo+=String.fromCharCode((31&iu)<<6|Ol)}else vo+=String.fromCharCode(iu)}return vo},Ke=(Oe,ui)=>Oe?ye(B,Oe,ui):"";function ke(Oe,ui,Zi){return 0}var me=(Oe,ui,Zi,Or)=>{if(!(Or>0))return 0;for(var wn=Zi,vo=Zi+Or-1,iu=0;iu=55296&&Ol<=57343&&(Ol=65536+((1023&Ol)<<10)|1023&Oe.charCodeAt(++iu)),Ol<=127){if(Zi>=vo)break;ui[Zi++]=Ol}else if(Ol<=2047){if(Zi+1>=vo)break;ui[Zi++]=192|Ol>>6,ui[Zi++]=128|63&Ol}else if(Ol<=65535){if(Zi+2>=vo)break;ui[Zi++]=224|Ol>>12,ui[Zi++]=128|Ol>>6&63,ui[Zi++]=128|63&Ol}else{if(Zi+3>=vo)break;ui[Zi++]=240|Ol>>18,ui[Zi++]=128|Ol>>12&63,ui[Zi++]=128|Ol>>6&63,ui[Zi++]=128|63&Ol}}return ui[Zi]=0,Zi-wn},ie=(Oe,ui,Zi)=>me(Oe,B,ui,Zi);function ge(Oe,ui,Zi){return 0}function je(Oe,ui,Zi,Or){}var rt=Oe=>Oe%4==0&&(Oe%100!=0||Oe%400==0),Me=[0,31,60,91,121,152,182,213,244,274,305,335],ht=[0,31,59,90,120,151,181,212,243,273,304,334],Ht=Oe=>(rt(Oe.getFullYear())?Me:ht)[Oe.getMonth()]+Oe.getDate()-1,_t=(Oe,ui)=>ui+2097152>>>0<4194305-!!Oe?(Oe>>>0)+4294967296*ui:NaN;function Fe(Oe,ui,Zi){var Or=_t(Oe,ui),wn=new Date(1e3*Or);V[Zi>>2]=wn.getSeconds(),V[Zi+4>>2]=wn.getMinutes(),V[Zi+8>>2]=wn.getHours(),V[Zi+12>>2]=wn.getDate(),V[Zi+16>>2]=wn.getMonth(),V[Zi+20>>2]=wn.getFullYear()-1900,V[Zi+24>>2]=wn.getDay();var vo=0|Ht(wn);V[Zi+28>>2]=vo,V[Zi+36>>2]=-60*wn.getTimezoneOffset();var iu=new Date(wn.getFullYear(),0,1),Ol=new Date(wn.getFullYear(),6,1).getTimezoneOffset(),jm=iu.getTimezoneOffset(),aT=0|(Ol!=jm&&wn.getTimezoneOffset()==Math.min(jm,Ol));V[Zi+32>>2]=aT}var Yt=Oe=>{for(var ui=0,Zi=0;Zi=55296&&Or<=57343?(ui+=4,++Zi):ui+=3}return ui},A=Oe=>{var ui=Yt(Oe)+1,Zi=J(ui);return Zi&&ie(Oe,Zi,ui),Zi},ue=()=>2147483648,G=Oe=>{var ui=(Oe-I.buffer.byteLength+65535)/65536;try{return I.grow(ui),de(),1}catch{}},E={},_=()=>l||"./this.program",g=()=>{if(!g.strings){var Oe={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_()};for(var ui in E)E[ui]===void 0?delete Oe[ui]:Oe[ui]=E[ui];var Zi=[];for(var ui in Oe)Zi.push(`${ui}=${Oe[ui]}`);g.strings=Zi}return g.strings},b=(Oe,ui)=>{for(var Zi=0;Zi>0]=Oe.charCodeAt(Zi);k[ui>>0]=0};function C(Oe,ui,Zi,Or,wn){return 70}var O=[null,[],[]],F=(Oe,ui)=>{var Zi=O[Oe];ui===0||ui===10?((Oe===1?R:L)(ye(Zi,0)),Zi.length=0):Zi.push(ui)};function N(Oe,ui,Zi){var Or=Yt(Oe)+1,wn=new Array(Or);return me(Oe,wn,0,wn.length),wn}var j={c:ke,r:(Oe,ui,Zi)=>{},h:ge,d:je,p:Oe=>{},o:(Oe,ui)=>{},q:(Oe,ui,Zi)=>{},j:Fe,n:(Oe,ui,Zi)=>{var Or=new Date().getFullYear(),wn=new Date(Or,0,1),vo=new Date(Or,6,1),iu=wn.getTimezoneOffset(),Ol=vo.getTimezoneOffset(),jm=Math.max(iu,Ol);function aT(vL){var Qb=vL.toTimeString().match(/\(([A-Za-z ]+)\)$/);return Qb?Qb[1]:"GMT"}Y[Oe>>2]=60*jm,V[ui>>2]=+(iu!=Ol);var CX=aT(wn),yL=aT(vo),E7=A(CX),I7=A(yL);Ol>2]=E7,Y[Zi+4>>2]=I7):(Y[Zi>>2]=I7,Y[Zi+4>>2]=E7)},l:()=>{$e("")},i:()=>Date.now(),s:(Oe,ui,Zi)=>B.copyWithin(Oe,ui,ui+Zi),m:Oe=>{var ui=B.length;Oe>>>=0;var Zi=ue();if(Oe>Zi)return!1;for(var Or=(Ol,jm)=>Ol+(jm-Ol%jm)%jm,wn=1;wn<=4;wn*=2){var vo=ui*(1+.2/wn);vo=Math.min(vo,Oe+100663296);var iu=Math.min(Zi,Or(Math.max(Oe,vo),65536));if(G(iu))return!0}return!1},e:(Oe,ui)=>{var Zi=0;return g().forEach((Or,wn)=>{var vo=ui+Zi;Y[Oe+4*wn>>2]=vo,b(Or,vo),Zi+=Or.length+1}),0},f:(Oe,ui)=>{var Zi=g();Y[Oe>>2]=Zi.length;var Or=0;return Zi.forEach(wn=>Or+=wn.length+1),Y[ui>>2]=Or,0},a:Oe=>52,g:(Oe,ui,Zi,Or)=>52,k:C,b:(Oe,ui,Zi,Or)=>{for(var wn=0,vo=0;vo>2],Ol=Y[ui+4>>2];ui+=8;for(var jm=0;jm>2]=wn,0}},W=Ue();r._webidl_free=Oe=>(r._webidl_free=W.v)(Oe),r._webidl_malloc=Oe=>(r._webidl_malloc=W.w)(Oe);var q,J=Oe=>(J=W.x)(Oe),ee=r._emscripten_bind_PeObject_getCode_0=Oe=>(ee=r._emscripten_bind_PeObject_getCode_0=W.y)(Oe),he=r._emscripten_bind_PeObject_getName_1=(Oe,ui)=>(he=r._emscripten_bind_PeObject_getName_1=W.z)(Oe,ui),Ee=r._emscripten_bind_PeObject_getType_0=Oe=>(Ee=r._emscripten_bind_PeObject_getType_0=W.A)(Oe),De=r._emscripten_bind_PeCoordsys_getCode_0=Oe=>(De=r._emscripten_bind_PeCoordsys_getCode_0=W.B)(Oe),pt=r._emscripten_bind_PeCoordsys_getName_1=(Oe,ui)=>(pt=r._emscripten_bind_PeCoordsys_getName_1=W.C)(Oe,ui),Et=r._emscripten_bind_PeCoordsys_getType_0=Oe=>(Et=r._emscripten_bind_PeCoordsys_getType_0=W.D)(Oe),Ye=r._emscripten_bind_VoidPtr___destroy___0=Oe=>(Ye=r._emscripten_bind_VoidPtr___destroy___0=W.E)(Oe),jt=r._emscripten_bind_PeDatum_getSpheroid_0=Oe=>(jt=r._emscripten_bind_PeDatum_getSpheroid_0=W.F)(Oe),ei=r._emscripten_bind_PeDatum_getCode_0=Oe=>(ei=r._emscripten_bind_PeDatum_getCode_0=W.G)(Oe),Xt=r._emscripten_bind_PeDatum_getName_1=(Oe,ui)=>(Xt=r._emscripten_bind_PeDatum_getName_1=W.H)(Oe,ui),wi=r._emscripten_bind_PeDatum_getType_0=Oe=>(wi=r._emscripten_bind_PeDatum_getType_0=W.I)(Oe),pi=r._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=Oe=>(pi=r._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=W.J)(Oe),Ri=r._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=Oe=>(Ri=r._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=W.K)(Oe),Ui=r._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=Oe=>(Ui=r._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=W.L)(Oe),Bi=r._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=Oe=>(Bi=r._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=W.M)(Oe),mi=r._emscripten_bind_PeDefs_get_PE_DD_MAX_0=Oe=>(mi=r._emscripten_bind_PeDefs_get_PE_DD_MAX_0=W.N)(Oe),ar=r._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=Oe=>(ar=r._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=W.O)(Oe),z=r._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=Oe=>(z=r._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=W.P)(Oe),Wi=r._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=Oe=>(Wi=r._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=W.Q)(Oe),Fr=r._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=Oe=>(Fr=r._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=W.R)(Oe),ds=r._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=Oe=>(ds=r._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=W.S)(Oe),Dt=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=Oe=>(Dt=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=W.T)(Oe),Mn=r._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=Oe=>(Mn=r._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=W.U)(Oe),yn=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=Oe=>(yn=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=W.V)(Oe),Pt=r._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=Oe=>(Pt=r._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=W.W)(Oe),Un=r._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=Oe=>(Un=r._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=W.X)(Oe),Qi=r._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=Oe=>(Qi=r._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=W.Y)(Oe),Tn=r._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=Oe=>(Tn=r._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=W.Z)(Oe),bs=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=Oe=>(bs=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=W._)(Oe),qn=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=Oe=>(qn=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=W.$)(Oe),ko=r._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=Oe=>(ko=r._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=W.aa)(Oe),ai=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=Oe=>(ai=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=W.ba)(Oe),Al=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=Oe=>(Al=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=W.ca)(Oe),eu=r._emscripten_bind_PeDefs_get_PE_PARM_X0_0=Oe=>(eu=r._emscripten_bind_PeDefs_get_PE_PARM_X0_0=W.da)(Oe),Ma=r._emscripten_bind_PeDefs_get_PE_PARM_ND_0=Oe=>(Ma=r._emscripten_bind_PeDefs_get_PE_PARM_ND_0=W.ea)(Oe),_n=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=Oe=>(_n=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=W.fa)(Oe),Ss=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=Oe=>(Ss=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=W.ga)(Oe),la=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=Oe=>(la=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=W.ha)(Oe),gi=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=Oe=>(gi=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=W.ia)(Oe),lr=r._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=Oe=>(lr=r._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=W.ja)(Oe),Rr=r._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=Oe=>(Rr=r._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=W.ka)(Oe),Os=r._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=Oe=>(Os=r._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=W.la)(Oe),Js=r._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=Oe=>(Js=r._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=W.ma)(Oe),vs=r._emscripten_bind_PeFactory_initialize_1=(Oe,ui)=>(vs=r._emscripten_bind_PeFactory_initialize_1=W.na)(Oe,ui),na=r._emscripten_bind_PeFactory_factoryByType_2=(Oe,ui,Zi)=>(na=r._emscripten_bind_PeFactory_factoryByType_2=W.oa)(Oe,ui,Zi),gl=r._emscripten_bind_PeFactory_fromString_2=(Oe,ui,Zi)=>(gl=r._emscripten_bind_PeFactory_fromString_2=W.pa)(Oe,ui,Zi),fn=r._emscripten_bind_PeFactory_getCode_1=(Oe,ui)=>(fn=r._emscripten_bind_PeFactory_getCode_1=W.qa)(Oe,ui),qr=r._emscripten_bind_PeGCSExtent_PeGCSExtent_6=(Oe,ui,Zi,Or,wn,vo)=>(qr=r._emscripten_bind_PeGCSExtent_PeGCSExtent_6=W.ra)(Oe,ui,Zi,Or,wn,vo),Gu=r._emscripten_bind_PeGCSExtent_getLLon_0=Oe=>(Gu=r._emscripten_bind_PeGCSExtent_getLLon_0=W.sa)(Oe),dc=r._emscripten_bind_PeGCSExtent_getSLat_0=Oe=>(dc=r._emscripten_bind_PeGCSExtent_getSLat_0=W.ta)(Oe),Re=r._emscripten_bind_PeGCSExtent_getRLon_0=Oe=>(Re=r._emscripten_bind_PeGCSExtent_getRLon_0=W.ua)(Oe),Ne=r._emscripten_bind_PeGCSExtent_getNLat_0=Oe=>(Ne=r._emscripten_bind_PeGCSExtent_getNLat_0=W.va)(Oe),dt=r._emscripten_bind_PeGCSExtent___destroy___0=Oe=>(dt=r._emscripten_bind_PeGCSExtent___destroy___0=W.wa)(Oe),Gt=r._emscripten_bind_PeGeogcs_getDatum_0=Oe=>(Gt=r._emscripten_bind_PeGeogcs_getDatum_0=W.xa)(Oe),ti=r._emscripten_bind_PeGeogcs_getPrimem_0=Oe=>(ti=r._emscripten_bind_PeGeogcs_getPrimem_0=W.ya)(Oe),oi=r._emscripten_bind_PeGeogcs_getUnit_0=Oe=>(oi=r._emscripten_bind_PeGeogcs_getUnit_0=W.za)(Oe),Hi=r._emscripten_bind_PeGeogcs_getCode_0=Oe=>(Hi=r._emscripten_bind_PeGeogcs_getCode_0=W.Aa)(Oe),Oi=r._emscripten_bind_PeGeogcs_getName_1=(Oe,ui)=>(Oi=r._emscripten_bind_PeGeogcs_getName_1=W.Ba)(Oe,ui),kt=r._emscripten_bind_PeGeogcs_getType_0=Oe=>(kt=r._emscripten_bind_PeGeogcs_getType_0=W.Ca)(Oe),Xe=r._emscripten_bind_PeGeogtran_isEqual_1=(Oe,ui)=>(Xe=r._emscripten_bind_PeGeogtran_isEqual_1=W.Da)(Oe,ui),Le=r._emscripten_bind_PeGeogtran_getGeogcs1_0=Oe=>(Le=r._emscripten_bind_PeGeogtran_getGeogcs1_0=W.Ea)(Oe),xt=r._emscripten_bind_PeGeogtran_getGeogcs2_0=Oe=>(xt=r._emscripten_bind_PeGeogtran_getGeogcs2_0=W.Fa)(Oe),Zt=r._emscripten_bind_PeGeogtran_getParameters_0=Oe=>(Zt=r._emscripten_bind_PeGeogtran_getParameters_0=W.Ga)(Oe),Rt=r._emscripten_bind_PeGeogtran_loadConstants_0=Oe=>(Rt=r._emscripten_bind_PeGeogtran_loadConstants_0=W.Ha)(Oe),fi=r._emscripten_bind_PeGeogtran_getCode_0=Oe=>(fi=r._emscripten_bind_PeGeogtran_getCode_0=W.Ia)(Oe),Fi=r._emscripten_bind_PeGeogtran_getName_1=(Oe,ui)=>(Fi=r._emscripten_bind_PeGeogtran_getName_1=W.Ja)(Oe,ui),mr=r._emscripten_bind_PeGeogtran_getType_0=Oe=>(mr=r._emscripten_bind_PeGeogtran_getType_0=W.Ka)(Oe),yr=r._emscripten_bind_PeGTlistExtended_getGTlist_6=(Oe,ui,Zi,Or,wn,vo,iu)=>(yr=r._emscripten_bind_PeGTlistExtended_getGTlist_6=W.La)(Oe,ui,Zi,Or,wn,vo,iu),Gr=r._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=Oe=>(Gr=r._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=W.Ma)(Oe),zr=r._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=Oe=>(zr=r._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=W.Na)(Oe),jn=r._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=Oe=>(jn=r._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=W.Oa)(Oe),co=r._emscripten_bind_PeGTlistExtendedEntry_Delete_1=(Oe,ui)=>(co=r._emscripten_bind_PeGTlistExtendedEntry_Delete_1=W.Pa)(Oe,ui),ua=r._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=Oe=>(ua=r._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=W.Qa)(Oe),Hs=r._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=Oe=>(Hs=r._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=W.Ra)(Oe),Ll=r._emscripten_bind_PeHorizon_getNump_0=Oe=>(Ll=r._emscripten_bind_PeHorizon_getNump_0=W.Sa)(Oe),ft=r._emscripten_bind_PeHorizon_getKind_0=Oe=>(ft=r._emscripten_bind_PeHorizon_getKind_0=W.Ta)(Oe),Wt=r._emscripten_bind_PeHorizon_getInclusive_0=Oe=>(Wt=r._emscripten_bind_PeHorizon_getInclusive_0=W.Ua)(Oe),hi=r._emscripten_bind_PeHorizon_getSize_0=Oe=>(hi=r._emscripten_bind_PeHorizon_getSize_0=W.Va)(Oe),Pi=r._emscripten_bind_PeHorizon_getCoord_0=Oe=>(Pi=r._emscripten_bind_PeHorizon_getCoord_0=W.Wa)(Oe),vr=r._emscripten_bind_PeInteger_PeInteger_1=Oe=>(vr=r._emscripten_bind_PeInteger_PeInteger_1=W.Xa)(Oe),Lr=r._emscripten_bind_PeInteger_get_val_0=Oe=>(Lr=r._emscripten_bind_PeInteger_get_val_0=W.Ya)(Oe),on=r._emscripten_bind_PeInteger_set_val_1=(Oe,ui)=>(on=r._emscripten_bind_PeInteger_set_val_1=W.Za)(Oe,ui),dn=r._emscripten_bind_PeInteger___destroy___0=Oe=>(dn=r._emscripten_bind_PeInteger___destroy___0=W._a)(Oe),Ir=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=Oe=>(Ir=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=W.$a)(Oe),$n=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=Oe=>($n=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=W.ab)(Oe),fa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=Oe=>(fa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=W.bb)(Oe),Sa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=Oe=>(Sa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=W.cb)(Oe),ma=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=Oe=>(ma=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=W.db)(Oe),go=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=Oe=>(go=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=W.eb)(Oe),tu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=Oe=>(tu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=W.fb)(Oe),Uu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=Oe=>(Uu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=W.gb)(Oe),pc=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=Oe=>(pc=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=W.hb)(Oe),Fh=r._emscripten_bind_PeParameter_getValue_0=Oe=>(Fh=r._emscripten_bind_PeParameter_getValue_0=W.ib)(Oe),Zr=r._emscripten_bind_PeParameter_getCode_0=Oe=>(Zr=r._emscripten_bind_PeParameter_getCode_0=W.jb)(Oe),Ps=r._emscripten_bind_PeParameter_getName_1=(Oe,ui)=>(Ps=r._emscripten_bind_PeParameter_getName_1=W.kb)(Oe,ui),ca=r._emscripten_bind_PeParameter_getType_0=Oe=>(ca=r._emscripten_bind_PeParameter_getType_0=W.lb)(Oe),Ou=r._emscripten_bind_PePCSInfo_getCentralMeridian_0=Oe=>(Ou=r._emscripten_bind_PePCSInfo_getCentralMeridian_0=W.mb)(Oe),Za=r._emscripten_bind_PePCSInfo_getDomainMinx_0=Oe=>(Za=r._emscripten_bind_PePCSInfo_getDomainMinx_0=W.nb)(Oe),kh=r._emscripten_bind_PePCSInfo_getDomainMiny_0=Oe=>(kh=r._emscripten_bind_PePCSInfo_getDomainMiny_0=W.ob)(Oe),Qv=r._emscripten_bind_PePCSInfo_getDomainMaxx_0=Oe=>(Qv=r._emscripten_bind_PePCSInfo_getDomainMaxx_0=W.pb)(Oe),_y=r._emscripten_bind_PePCSInfo_getDomainMaxy_0=Oe=>(_y=r._emscripten_bind_PePCSInfo_getDomainMaxy_0=W.qb)(Oe),I0=r._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=Oe=>(I0=r._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=W.rb)(Oe),e1=r._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=Oe=>(e1=r._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=W.sb)(Oe),Nl=r._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=Oe=>(Nl=r._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=W.tb)(Oe),Sp=r._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=Oe=>(Sp=r._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=W.ub)(Oe),Ml=r._emscripten_bind_PePCSInfo_isDensificationNeeded_0=Oe=>(Ml=r._emscripten_bind_PePCSInfo_isDensificationNeeded_0=W.vb)(Oe),Og=r._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=Oe=>(Og=r._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=W.wb)(Oe),Xc=r._emscripten_bind_PePCSInfo_isPannableRectangle_0=Oe=>(Xc=r._emscripten_bind_PePCSInfo_isPannableRectangle_0=W.xb)(Oe),Bm=r._emscripten_bind_PePCSInfo_generate_2=(Oe,ui,Zi)=>(Bm=r._emscripten_bind_PePCSInfo_generate_2=W.yb)(Oe,ui,Zi),by=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=Oe=>(by=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=W.zb)(Oe),A0=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=Oe=>(A0=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=W.Ab)(Oe),Nf=r._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=Oe=>(Nf=r._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=W.Bb)(Oe),Pg=r._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=Oe=>(Pg=r._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=W.Cb)(Oe),Kd=r._emscripten_bind_PePrimem_getLongitude_0=Oe=>(Kd=r._emscripten_bind_PePrimem_getLongitude_0=W.Db)(Oe),$f=r._emscripten_bind_PePrimem_getCode_0=Oe=>($f=r._emscripten_bind_PePrimem_getCode_0=W.Eb)(Oe),Jc=r._emscripten_bind_PePrimem_getName_1=(Oe,ui)=>(Jc=r._emscripten_bind_PePrimem_getName_1=W.Fb)(Oe,ui),t1=r._emscripten_bind_PePrimem_getType_0=Oe=>(t1=r._emscripten_bind_PePrimem_getType_0=W.Gb)(Oe),hh=r._emscripten_bind_PeProjcs_getGeogcs_0=Oe=>(hh=r._emscripten_bind_PeProjcs_getGeogcs_0=W.Hb)(Oe),Lh=r._emscripten_bind_PeProjcs_getParameters_0=Oe=>(Lh=r._emscripten_bind_PeProjcs_getParameters_0=W.Ib)(Oe),fc=r._emscripten_bind_PeProjcs_getUnit_0=Oe=>(fc=r._emscripten_bind_PeProjcs_getUnit_0=W.Jb)(Oe),rn=r._emscripten_bind_PeProjcs_loadConstants_0=Oe=>(rn=r._emscripten_bind_PeProjcs_loadConstants_0=W.Kb)(Oe),Qa=r._emscripten_bind_PeProjcs_horizonGcsGenerate_0=Oe=>(Qa=r._emscripten_bind_PeProjcs_horizonGcsGenerate_0=W.Lb)(Oe),wy=r._emscripten_bind_PeProjcs_horizonPcsGenerate_0=Oe=>(wy=r._emscripten_bind_PeProjcs_horizonPcsGenerate_0=W.Mb)(Oe),ve=r._emscripten_bind_PeProjcs_getCode_0=Oe=>(ve=r._emscripten_bind_PeProjcs_getCode_0=W.Nb)(Oe),oe=r._emscripten_bind_PeProjcs_getName_1=(Oe,ui)=>(oe=r._emscripten_bind_PeProjcs_getName_1=W.Ob)(Oe,ui),ce=r._emscripten_bind_PeProjcs_getType_0=Oe=>(ce=r._emscripten_bind_PeProjcs_getType_0=W.Pb)(Oe),we=r._emscripten_bind_PeSpheroid_getAxis_0=Oe=>(we=r._emscripten_bind_PeSpheroid_getAxis_0=W.Qb)(Oe),He=r._emscripten_bind_PeSpheroid_getFlattening_0=Oe=>(He=r._emscripten_bind_PeSpheroid_getFlattening_0=W.Rb)(Oe),St=r._emscripten_bind_PeSpheroid_getCode_0=Oe=>(St=r._emscripten_bind_PeSpheroid_getCode_0=W.Sb)(Oe),ut=r._emscripten_bind_PeSpheroid_getName_1=(Oe,ui)=>(ut=r._emscripten_bind_PeSpheroid_getName_1=W.Tb)(Oe,ui),Bt=r._emscripten_bind_PeSpheroid_getType_0=Oe=>(Bt=r._emscripten_bind_PeSpheroid_getType_0=W.Ub)(Oe),Ge=r._emscripten_bind_PeUnit_getUnitFactor_0=Oe=>(Ge=r._emscripten_bind_PeUnit_getUnitFactor_0=W.Vb)(Oe),et=r._emscripten_bind_PeUnit_getCode_0=Oe=>(et=r._emscripten_bind_PeUnit_getCode_0=W.Wb)(Oe),zt=r._emscripten_bind_PeUnit_getName_1=(Oe,ui)=>(zt=r._emscripten_bind_PeUnit_getName_1=W.Xb)(Oe,ui),ii=r._emscripten_bind_PeUnit_getType_0=Oe=>(ii=r._emscripten_bind_PeUnit_getType_0=W.Yb)(Oe),te=r._emscripten_bind_PeVersion_version_string_0=Oe=>(te=r._emscripten_bind_PeVersion_version_string_0=W.Zb)(Oe);function xe(){function Oe(){q||(q=!0,r.calledRun=!0,re||(fe(),e(r),be()))}Ie>0||(ae(),Ie>0||Oe())}function Ae(){}function lt(Oe){return(Oe||Ae).__cache__}function nt(Oe,ui){var Zi=lt(ui),Or=Zi[Oe];return Or||((Or=Object.create((ui||Ae).prototype)).ptr=Oe,Zi[Oe]=Or)}function It(Oe,ui){return nt(Oe.ptr,ui)}function Nt(Oe){if(!Oe.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";Oe.__destroy__(),delete lt(Oe.__class__)[Oe.ptr]}function Ut(Oe,ui){return Oe.ptr===ui.ptr}function Jt(Oe){return Oe.ptr}function xi(Oe){return Oe.__class__}r._pe_getPeGTlistExtendedEntrySize=()=>(r._pe_getPeGTlistExtendedEntrySize=W._b)(),r._pe_getPeGTlistExtendedGTsSize=()=>(r._pe_getPeGTlistExtendedGTsSize=W.$b)(),r._pe_getPeHorizonSize=()=>(r._pe_getPeHorizonSize=W.ac)(),r._pe_geog_to_geog=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_geog=W.cc)(Oe,ui,Zi,Or,wn),r._pe_geog_to_proj=(Oe,ui,Zi)=>(r._pe_geog_to_proj=W.dc)(Oe,ui,Zi),r._pe_geog_to_dd=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_dd=W.ec)(Oe,ui,Zi,Or,wn),r._pe_dd_to_geog=(Oe,ui,Zi,Or)=>(r._pe_dd_to_geog=W.fc)(Oe,ui,Zi,Or),r._pe_geog_to_ddm=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_ddm=W.gc)(Oe,ui,Zi,Or,wn),r._pe_ddm_to_geog=(Oe,ui,Zi,Or)=>(r._pe_ddm_to_geog=W.hc)(Oe,ui,Zi,Or),r._pe_geog_to_dms=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_dms=W.ic)(Oe,ui,Zi,Or,wn),r._pe_dms_to_geog=(Oe,ui,Zi,Or)=>(r._pe_dms_to_geog=W.jc)(Oe,ui,Zi,Or),r._pe_geog_to_mgrs_extended=(Oe,ui,Zi,Or,wn,vo,iu)=>(r._pe_geog_to_mgrs_extended=W.kc)(Oe,ui,Zi,Or,wn,vo,iu),r._pe_mgrs_to_geog_extended=(Oe,ui,Zi,Or,wn)=>(r._pe_mgrs_to_geog_extended=W.lc)(Oe,ui,Zi,Or,wn),r._pe_geog_to_usng=(Oe,ui,Zi,Or,wn,vo,iu)=>(r._pe_geog_to_usng=W.mc)(Oe,ui,Zi,Or,wn,vo,iu),r._pe_usng_to_geog=(Oe,ui,Zi,Or)=>(r._pe_usng_to_geog=W.nc)(Oe,ui,Zi,Or),r._pe_geog_to_utm=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_utm=W.oc)(Oe,ui,Zi,Or,wn),r._pe_utm_to_geog=(Oe,ui,Zi,Or,wn)=>(r._pe_utm_to_geog=W.pc)(Oe,ui,Zi,Or,wn),r._pe_object_to_string_ext=(Oe,ui,Zi)=>(r._pe_object_to_string_ext=W.qc)(Oe,ui,Zi),r._pe_proj_to_geog_center=(Oe,ui,Zi,Or)=>(r._pe_proj_to_geog_center=W.rc)(Oe,ui,Zi,Or),r.___start_em_js=2033306,r.___stop_em_js=2033404,r.getValue=st,r.UTF8ToString=Ke,Te=function Oe(){q||xe(),q||(Te=Oe)},xe(),Ae.prototype=Object.create(Ae.prototype),Ae.prototype.constructor=Ae,Ae.prototype.__class__=Ae,Ae.__cache__={},r.WrapperObject=Ae,r.getCache=lt,r.wrapPointer=nt,r.castObject=It,r.NULL=nt(0),r.destroy=Nt,r.compare=Ut,r.getPointer=Jt,r.getClass=xi;var Di={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(Di.needed){for(var Oe=0;Oe=Di.size?(ne(wn>0),Di.needed+=wn,Zi=r._webidl_malloc(wn),Di.temps.push(Zi)):(Zi=Di.buffer+Di.pos,Di.pos+=wn),Zi},copy(Oe,ui,Zi){switch(Zi>>>=0,ui.BYTES_PER_ELEMENT){case 2:Zi>>>=1;break;case 4:Zi>>>=2;break;case 8:Zi>>>=3}for(var Or=0;Orn?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=r,this._maxValue=n>-3e38?n:0)}},cNr=class{constructor(e,t,r,n,s={}){this._mainMethod=t,this._transferLists=r,this._listeners=[],this._promise=$R(e,{...s,schedule:n}).then(o=>{if(this._thread===void 0){this._thread=o,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const a of this._listeners)this._connectListener(a)}else o.close()}),this._promise.catch(o=>di.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,t){const r={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(r),this._connectListener(r),wa(()=>{r.removed=!0,FUe(this._listeners,r),this._thread&&r.threadHandle!=null&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,r){if(this._thread){const n=this._transferLists[e],s=n?n(t):[];return this._thread.invoke(e,t,{transferList:s,signal:r})}return this._promise?this._promise.then(()=>(hn(r),this.invokeMethod(e,t,r))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}},hdt=class extends cNr{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},r):Promise.resolve(null)}release(){--this.ref<=0&&(cre.forEach((e,t)=>{e===this&&cre.delete(t)}),this.destroy())}};const cre=new Map;function hNr(i=null){let e=cre.get(i);return e||(i!=null?(e=new hdt(t=>i.immediate.schedule(t)),cre.set(i,e)):(e=new hdt,cre.set(null,e))),++e.ref,e}let Qm=class extends JHe(Xv(Rc(Yc(Ql(Il))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=hNr()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._lercDecoder=e4(this._lercDecoder)}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map(n=>n.toLowerCase().trim());return r?{operations:{supportsTileMap:r.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(e,t){let r=t.currentVersion;return r||(r=9.3),r}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:r=>{if(r.typeKeywords){for(let n=0;nthis._fetchImageService(t))),Promise.resolve(this)}fetchTile(e,t,r,n){const s=(n=n||{signal:null}).signal!=null?n.signal:n.signal=new AbortController().signal,o={responseType:"array-buffer",signal:s},a={noDataValue:n.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,r,n)).then(()=>zi(this.getTileUrl(e,t,r),o)).then(l=>this._lercDecoder.decode(l.data,a,s)).then(l=>new uNr(l))}getTileUrl(e,t,r){const n=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,s=Lb({...this.parsedUrl.query,blankTile:!n&&null});return`${this.parsedUrl.path}/tile/${e}/${t}/${r}${s?"?"+s:""}`}async queryElevation(e,t){const{ElevationQuery:r}=await Promise.resolve().then(()=>Zbe);return hn(t),new r().query(this,e,t)}async createElevationSampler(e,t){const{ElevationQuery:r}=await Promise.resolve().then(()=>Zbe);return hn(t),new r().createSampler(this,e,t)}_fetchTileAvailability(e,t,r,n){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,t,r,n):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},r=await zi(this.parsedUrl.path,t);r.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[o8t]}};x([D({readOnly:!0})],Qm.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities"])],Qm.prototype,"readCapabilities",null),x([D({json:{read:{source:"copyrightText"}}})],Qm.prototype,"copyright",void 0),x([D({readOnly:!0,type:DY})],Qm.prototype,"heightModelInfo",void 0),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Qm.prototype,"path",void 0),x([D({type:["show","hide"]})],Qm.prototype,"listMode",void 0),x([D({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],Qm.prototype,"minScale",void 0),x([D({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],Qm.prototype,"maxScale",void 0),x([D({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],Qm.prototype,"opacity",void 0),x([D({type:["ArcGISTiledElevationServiceLayer"]})],Qm.prototype,"operationalLayerType",void 0),x([D()],Qm.prototype,"sourceJSON",void 0),x([D({json:{read:!1},value:"elevation",readOnly:!0})],Qm.prototype,"type",void 0),x([D(C0)],Qm.prototype,"url",void 0),x([D()],Qm.prototype,"version",void 0),x([Mi("version",["currentVersion"])],Qm.prototype,"readVersion",null),Qm=x([Qe("esri.layers.ElevationLayer")],Qm);const o8t=Symbol("default-fetch-tile");Qm.prototype.fetchTile[o8t]=!0;const dNr=Qm,a8t=Object.freeze(Object.defineProperty({__proto__:null,default:dNr},Symbol.toStringTag,{value:"Module"}));async function pNr(i,e={},t){await i.load(t);const r=Iu(i.itemUrl,"resources"),{start:n=1,num:s=10,sortOrder:o="asc",sortField:a="resource"}=e,l={query:{start:n,num:s,sortOrder:o,sortField:a,token:i.apiKey},signal:t?.signal},u=await i.portal.request(r,l);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:c,size:h,resource:p})=>({created:new Date(c),size:h,resource:i.resourceFromPath(p)}))}}async function fNr(i,e,t,r){const n=new Map;for(const{resource:o,content:a,compress:l,access:u}of e){if(!o.hasPath())throw new qe(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const[c,h]=l8t(o.path),p=`${c}/${l??""}/${u??""}`;n.has(p)||n.set(p,{prefix:c,compress:l,access:u,files:[]}),n.get(p).files.push({fileName:h,content:a})}await i.load(r);const s=Iu(i.userItemUrl,t==="add"?"addResources":"updateResources");for(const{prefix:o,compress:a,access:l,files:u}of n.values())for(let h=0;h(await Promise.resolve().then(()=>NFn)).default,BuildingSceneLayer:async()=>(await Promise.resolve().then(()=>rkn)).default,CatalogLayer:async()=>(await Promise.resolve().then(()=>ckn)).default,CSVLayer:async()=>(await Promise.resolve().then(()=>dkn)).default,DimensionLayer:async()=>(await Promise.resolve().then(()=>gkn)).default,ElevationLayer:async()=>(await Promise.resolve().then(()=>a8t)).default,FeatureLayer:async()=>(await Promise.resolve().then(()=>rHe)).default,GeoJSONLayer:async()=>(await Promise.resolve().then(()=>_kn)).default,GeoRSSLayer:async()=>(await Promise.resolve().then(()=>Ckn)).default,GroupLayer:async()=>(await Promise.resolve().then(()=>HKt)).default,ImageryLayer:async()=>(await Promise.resolve().then(()=>gdr)).default,ImageryTileLayer:async()=>(await Promise.resolve().then(()=>Qkn)).default,IntegratedMeshLayer:async()=>(await Promise.resolve().then(()=>cLn)).default,KMLLayer:async()=>(await Promise.resolve().then(()=>pLn)).default,LineOfSightLayer:async()=>(await Promise.resolve().then(()=>vLn)).default,LinkChartLayer:async()=>(await Promise.resolve().then(()=>fNn)).default,MapImageLayer:async()=>(await Promise.resolve().then(()=>spr)).default,MapNotesLayer:async()=>(await Promise.resolve().then(()=>yNn)).default,MediaLayer:async()=>(await Promise.resolve().then(()=>FNn)).default,OGCFeatureLayer:async()=>(await Promise.resolve().then(()=>NNn)).default,OpenStreetMapLayer:async()=>(await Promise.resolve().then(()=>apr)).default,OrientedImageryLayer:async()=>(await Promise.resolve().then(()=>t$n)).default,PointCloudLayer:async()=>(await Promise.resolve().then(()=>l$n)).default,RouteLayer:async()=>(await Promise.resolve().then(()=>H$n)).default,SceneLayer:async()=>(await Promise.resolve().then(()=>l6n)).default,StreamLayer:async()=>(await Promise.resolve().then(()=>c6n)).default,SubtypeGroupLayer:async()=>(await Promise.resolve().then(()=>y6n)).default,TileLayer:async()=>(await Promise.resolve().then(()=>cpr)).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.resolve().then(()=>_6n)).default,UnknownLayer:async()=>(await Promise.resolve().then(()=>w6n)).default,UnsupportedLayer:async()=>(await Promise.resolve().then(()=>S6n)).default,VectorTileLayer:async()=>(await Promise.resolve().then(()=>$6n)).default,VoxelLayer:async()=>(await Promise.resolve().then(()=>X6n)).default,WFSLayer:async()=>(await Promise.resolve().then(()=>K6n)).default,WMSLayer:async()=>(await Promise.resolve().then(()=>Tpr)).default,WMTSLayer:async()=>(await Promise.resolve().then(()=>v8n)).default,WebTileLayer:async()=>(await Promise.resolve().then(()=>opr)).default};function vNr(i){return NYe(i,"notes")}function _Nr(i){return NYe(i,"markup")}function bNr(i){return NYe(i,"route")}function NYe(i,e){return!(!i.layerType||i.layerType!=="ArcGISFeatureLayer")&&i.featureCollectionType===e}async function lle(i,e){const t=r_(i);if(!t)throw new qe("invalid-url","Invalid scene service url");const r={...e,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await wNr(r),r.sceneLayerItem==null)return ddt(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const n=await SNr(r);if(!n?.url)throw new qe("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=n;const s=await ddt(n.url,r);return s.portalItem=n,s}async function wNr(i){const e=(await h8t(i)).serviceItemId;if(!e)return null;const t=new yg({id:e,apiKey:i.apiKey}),r=await xNr(i);r!=null&&(t.portal=new Bu({url:r}));try{return t.load({signal:i.signal})}catch(n){return _a(n),null}}async function h8t(i){if(i.rootDocument)return i.rootDocument;const e={query:{f:"json",...i.customParameters,token:i.apiKey},responseType:"json",signal:i.signal};try{const t=await zi(i.sceneServerUrl,e);i.rootDocument=t.data}catch{i.rootDocument={}}return i.rootDocument}async function xNr(i){const e=no?.findServerInfo(i.sceneServerUrl);if(e?.owningSystemUrl)return e.owningSystemUrl;const t=i.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await zi(t,{query:{f:"json"},responseType:"json",signal:i.signal})).data.owningSystemUrl;if(r)return r}catch(r){_a(r)}return null}async function ddt(i,e){const t=r_(i);if(!t)throw new qe("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,n=e.layerId;if(n==null)return{serverUrl:r};const s=h8t(e),o=e.featureServiceItem?await e.featureServiceItem.fetchData("json"):null,a=(o?.layers?.[0]||o?.tables?.[0])?.customParameters,l=v=>{const w={query:{f:"json",...a},responseType:"json",authMode:v,signal:e.signal};return zi(r,w)},u=l("anonymous").catch(()=>l("no-prompt")),[c,h]=await Promise.all([u,s]),p=h?.layers,m=c.data&&c.data.layers;if(!Array.isArray(m))throw new Error("expected layers array");if(Array.isArray(p)){for(let v=0;vn.type==="Feature Service")||null;if(!t)return null;const r=new yg({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return _a(t),null}}function d9(i){const e={id:i.id,name:i.name};return i.type==="Oriented Imagery Layer"&&(e.layerType="OrientedImageryLayer"),e}async function d8t(i,e,t){if(i?.layers==null||i?.tables==null){const r=await t.fetchServiceMetadata(e,{customParameters:TB(i)?.customParameters});(i=i||{}).layers=i.layers||r?.layers?.map(d9),i.tables=i.tables||r?.tables?.map(d9)}return i}function p8t(i){const{layers:e,tables:t}=i;return e?.length?e[0].id:t?.length?t[0].id:null}function TB(i){if(!i)return null;const{layers:e,tables:t}=i;return e?.length?e[0]:t?.length?t[0]:null}function ule(i){return(i?.layers?.length??0)+(i?.tables?.length??0)}function $Ye(i){const e=[];return i?.layers?.forEach(t=>{t.layerType==="SubtypeGroupLayer"&&e.push(t.id)}),e}function f8t(i){return i?.layers?.filter(({layerType:e})=>e==="OrientedImageryLayer").map(({id:e})=>e)}function m8t(i){return i?.layers?.filter(({layerType:e})=>e==="CatalogLayer").map(({id:e})=>e)}async function g8t(i,e,t){if(!i?.url)return e??{};if(e??={},!e.layers){const s=await t.fetchServiceMetadata(i.url);e.layers=s.layers?.map(d9)}const{serverUrl:r,portalItem:n}=await lle(i.url,{sceneLayerItem:i,customParameters:TB(e)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return e.tables=[],e;if(!e.tables&&n){const s=await n.fetchData();if(s?.tables)e.tables=s.tables.map(d9);else{const o=await t.fetchServiceMetadata(r,{customParameters:TB(s)?.customParameters});e.tables=o?.tables?.map(d9)}}if(e.tables)for(const s of e.tables)s.url=`${r}/${s.id}`;return e}async function TNr(i){!i.portalItem||i.portalItem instanceof yg||(i={...i,portalItem:new yg(i.portalItem)});const e=await CNr(i.portalItem);return new e.constructor({portalItem:i.portalItem,...e.properties})}async function CNr(i){await i.load();const e=new ITe;return ENr(await BYe(i,e))}async function BYe(i,e){switch(i.type){case"3DTiles Service":return kNr();case"CSV":return LNr();case"Feature Collection":return ONr(i);case"Feature Service":return ANr(i,e);case"Feed":return GNr();case"GeoJson":return FNr();case"Group Layer":return UNr();case"Image Service":return PNr(i,e);case"KML":return NNr();case"Map Service":return INr(i,e);case"Media Layer":return zNr();case"Scene Service":return MNr(i,e);case"Stream Service":return RNr();case"Vector Tile Service":return DNr();case"WFS":return $Nr();case"WMS":return BNr();case"WMTS":return jNr();default:throw new qe("portal:unknown-item-type","Unknown item type '${type}'",{type:i.type})}}async function ENr(i){const e=i.className,t=xv[e];return{constructor:await t(),properties:i.properties}}async function INr(i,e){return await VNr(i,e)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function ANr(i,e){const t=await y8t(i,e);if(typeof t=="object"){const{sourceJSON:r,className:n}=t,s={sourceJSON:r};return t.id!=null&&(s.layerId=t.id),{className:n||"FeatureLayer",properties:s}}return{className:"GroupLayer"}}async function MNr(i,e){const t=await y8t(i,e,async()=>{try{if(!i.url)return[];const{serverUrl:r}=await lle(i.url,{sceneLayerItem:i});return(await e.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof t=="object"){const r={};let n;if(t.id!=null?(r.layerId=t.id,n=`${i.url}/layers/${t.id}`):n=i.url,i.typeKeywords?.length){for(const o of Object.keys(_ie))if(i.typeKeywords.includes(o))return{className:_ie[o]}}const s=await e.fetchServiceMetadata(n,{customParameters:await e.fetchCustomParameters(i,o=>TB(o)?.customParameters)});return{className:_ie[s?.layerType]||"SceneLayer",properties:r}}return t===!1&&(await e.fetchServiceMetadata(i.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function ONr(i){await i.load();const e=Q8(i,"Map Notes"),t=Q8(i,"Markup");if(e||t)return{className:"MapNotesLayer"};if(Q8(i,"Route Layer"))return{className:"RouteLayer"};const r=await i.fetchData();return ule(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function PNr(i,e){await i.load();const t=i.typeKeywords?.map(l=>l.toLowerCase())??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchItemData(i),n=r?.layerType;if(n==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(n==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const s=await e.fetchServiceMetadata(i.url,{customParameters:await e.fetchCustomParameters(i)}),o=s.cacheType?.toLowerCase(),a=s.capabilities?.toLowerCase().includes("tilesonly");return o==="map"||a?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function RNr(){return{className:"StreamLayer"}}function DNr(){return{className:"VectorTileLayer"}}function FNr(){return{className:"GeoJSONLayer"}}function kNr(){return{className:"IntegratedMesh3DTilesLayer"}}function LNr(){return{className:"CSVLayer"}}function NNr(){return{className:"KMLLayer"}}function $Nr(){return{className:"WFSLayer"}}function BNr(){return{className:"WMSLayer"}}function jNr(){return{className:"WMTSLayer"}}function GNr(){return{className:"StreamLayer"}}function UNr(){return{className:"GroupLayer"}}function zNr(){return{className:"MediaLayer"}}async function VNr(i,e){const{tileInfo:t}=await e.fetchServiceMetadata(i.url,{customParameters:await e.fetchCustomParameters(i)});return t}async function y8t(i,e,t){const{url:r,type:n}=i,s=n==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(s){const l=await e.fetchServiceMetadata(r,{customParameters:await e.fetchCustomParameters(i,u=>TB(u)?.customParameters)});if(l.type==="Oriented Imagery Layer")return{id:l.id,className:"OrientedImageryLayer",sourceJSON:l}}return{}}await i.load();let o=await e.fetchItemData(i);if(s){const l=await d8t(o,r,e),u=gOe(l);if(typeof u=="object"){const c=$Ye(l),h=f8t(l),p=m8t(l);u.className=u.id!=null&&c.includes(u.id)?"SubtypeGroupLayer":u.id!=null&&h?.includes(u.id)?"OrientedImageryLayer":u.id!=null&&p?.includes(u.id)?"CatalogLayer":"FeatureLayer"}return u}if(n==="Scene Service"&&(o=await g8t(i,o,e)),ule(o)>0)return gOe(o);const a=await e.fetchServiceMetadata(r);return t&&(a.tables=await t()),gOe(a)}function gOe(i){return ule(i)===1&&{id:p8t(i)}}const HNr=Object.freeze(Object.defineProperty({__proto__:null,fromItem:TNr,selectLayerClassPath:BYe},Symbol.toStringTag,{value:"Module"}));async function v8t(i,e,t){if(!e)return;const r=e.map(s=>QNr(s,t)),n=await Promise.allSettled(r);for(const s of n)s.status==="rejected"||s.value&&i.add(s.value)}const WNr={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},qNr={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},YNr={ArcGISFeatureLayer:"FeatureLayer"},XNr={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},_8t={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},b8t={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},w8t={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},JNr={..._8t,LinkChartLayer:"LinkChartLayer"},KNr={...b8t},ZNr={...w8t};async function QNr(i,e){return e$r(await t$r(i,e),i,e)}async function e$r(i,e,t){const r=new i;return r.read(e,t.context),r.type==="group"&&(e.layerType==="GroupLayer"?await GYe(r,e,t):jYe(e)?r$r(r,e,t.context):x8t(e)&&await n$r(r,e,t.context)),await Oae(r,t.context),r}async function t$r(i,e){const t=e.context,r=i$r(t);let n=i.layerType||i.type;!n&&e?.defaultLayerType&&(n=e.defaultLayerType);const s=r[n];let o=s?xv[s]:xv.UnknownLayer;if(jYe(i)){const a=t?.portal;if(i.itemId){const l=new yg({id:i.itemId,portal:a});await l.load();const u=(await BYe(l,new ITe)).className||"UnknownLayer";o=xv[u]}}else n==="ArcGISFeatureLayer"?vNr(i)||_Nr(i)?o=xv.MapNotesLayer:bNr(i)?o=xv.RouteLayer:x8t(i)&&(o=xv.GroupLayer):i.wmtsInfo?.url&&i.wmtsInfo.layerIdentifier?o=xv.WMTSLayer:n==="WFS"&&i.wfsInfo?.version!=="2.0.0"&&(o=xv.UnsupportedLayer);return o()}function x8t(i){return i.layerType!=="ArcGISFeatureLayer"||jYe(i)?!1:(i.featureCollection?.layers?.length??0)>1}function jYe(i){return i.type==="Feature Collection"}function i$r(i){let e;switch(i.origin){case"web-scene":switch(i.layerContainerType){case"basemap":e=XNr;break;case"ground":e=qNr;break;case"tables":e=YNr;break;default:e=WNr}break;case"link-chart":switch(i.layerContainerType){case"basemap":e=ZNr;break;case"tables":e=KNr;break;default:e=JNr}break;default:switch(i.layerContainerType){case"basemap":e=w8t;break;case"tables":e=b8t;break;default:e=_8t}}return e}async function GYe(i,e,t){const r=new dr,n=v8t(r,Array.isArray(e.layers)?e.layers:[],t);try{try{if(await n,i.type==="group")return i.layers.addMany(r),i}catch(s){i.destroy();for(const o of r)o.destroy();throw s}}catch(s){throw s}}function r$r(i,e,t){e.itemId&&(i.portalItem=new yg({id:e.itemId,portal:t?.portal}),i.when(()=>{const r=n=>{const s=n.layerId;S8t(n,i,e,s,t);const o=e.featureCollection?.layers?.[s];o&&n.read(o,t)};i.layers?.forEach(r),i.tables?.forEach(r)}))}async function n$r(i,e,t){const r=xv.FeatureLayer,n=await r(),s=e.featureCollection,o=s?.showLegend,a=s?.layers?.map((l,u)=>{const c=new n;c.read(l,t);const h={...t,ignoreDefaults:!0};return S8t(c,i,e,u,h),o!=null&&c.read({showLegend:o},h),c});i.layers.addMany(a??[])}function S8t(i,e,t,r,n){i.read({id:`${e.id}-sublayer-${r}`,visibility:t.visibleLayers?.includes(r)??!0},n)}const T8t=Object.freeze(Object.defineProperty({__proto__:null,populateGroupLayer:GYe,populateOperationalLayers:v8t},Symbol.toStringTag,{value:"Module"}));var W_e;(function(i){i.TimeZoneNotRecognized="TimeZoneNotRecognized"})(W_e||(W_e={}));const s$r={[W_e.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};let o$r=class C8t extends Error{constructor(e,t){super(m0(s$r[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,C8t)}};function Cj(i,e,t){return it?i-t:0}function Ej(i,e,t){return it?t:i}let ao=class sf{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,r=1,n=0,s=0,o=0,a=0,l){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(o)||isNaN(a))return null;const u=Sn.local(e,t).daysInMonth;let c=Sn.fromObject({day:Ej(r,1,u),year:e,month:Ej(t,1,12),hour:Ej(n,0,23),minute:Ej(s,0,59),second:Ej(o,0,59),millisecond:Ej(a,0,999)},{zone:B1(l)});return c=c.plus({months:Cj(t,1,12),days:Cj(r,1,u),hours:Cj(n,0,23),minutes:Cj(s,0,59),seconds:Cj(o,0,59),milliseconds:Cj(a,0,999)}),new sf(c)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const r=B1(t);return e.isUnknownTimeZone||r===hb.instance?sf.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new sf(e._date.setZone(r))}static dateJSToArcadeDate(e){return new sf(Sn.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const r=B1(t);return new sf(Sn.fromJSDate(e,{zone:r}))}static unknownEpochToArcadeDate(e){return new sf(Sn.fromMillis(e,{zone:hb.instance}))}static unknownDateJSToArcadeDate(e){return new sf(Sn.fromMillis(e.getTime(),{zone:hb.instance}))}static epochToArcadeDate(e,t="system"){const r=B1(t);return new sf(Sn.fromMillis(e,{zone:r}))}static dateTimeToArcadeDate(e){return new sf(e)}clone(){return new sf(this._date)}changeTimeZone(e){const t=B1(e);return sf.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const r=B1(t);return e.zone===hb.instance||r===hb.instance?sf.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new sf(e.setZone(r))}static nowToArcadeDate(e){const t=B1(e);return new sf(Sn.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new sf(Sn.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===sf.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===hb.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new sf(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new sf(this._date.toUTC())}toLocal(){return new sf(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=Sn.fromISO(e,{setZone:!0});return new sf(t)}};function B1(i,e=!0){if(i instanceof zk)return i;if(i.toLowerCase()==="system")return"system";if(i.toLowerCase()==="utc")return"UTC";if(i.toLowerCase()==="unknown")return hb.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(i)){const r=If.parseSpecifier("UTC"+(i.startsWith("+")||i.startsWith("-")?"":"+")+i);if(r)return r}const t=$b.create(i);if(!t.isValid){if(e)throw new o$r(W_e.TimeZoneNotRecognized);return null}return t}var tr;(function(i){i.InvalidFunctionParameters="InvalidFunctionParameters",i.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",i.UnsupportedSqlFunction="UnsupportedSqlFunction",i.UnsupportedOperator="UnsupportedOperator",i.UnsupportedSyntax="UnsupportedSyntax",i.UnsupportedIsRhs="UnsupportedIsRhs",i.UnsupportedIsLhs="UnsupportedIsLhs",i.InvalidDataType="InvalidDataType",i.CannotCastValue="CannotCastValue",i.FunctionNotRecognized="FunctionNotRecognized",i.InvalidTime="InvalidTime",i.InvalidParameterCount="InvalidParameterCount",i.InvalidTimeStamp="InvalidTimeStamp",i.InvalidDate="InvalidDate",i.InvalidOperator="InvalidOperator",i.IllegalInterval="IllegalInterval",i.YearMonthIntervals="YearMonthIntervals",i.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",i.MissingStatisticParameters="MissingStatisticParameters"})(tr||(tr={}));const a$r={[tr.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[tr.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[tr.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[tr.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[tr.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[tr.UnsupportedOperator]:"Unsupported operator - {operator}",[tr.UnsupportedSyntax]:"Unsupported syntax - {node}",[tr.UnsupportedSqlFunction]:"Sql function not found = {function}",[tr.InvalidDataType]:"Invalid sql data type",[tr.InvalidDate]:"Invalid date encountered",[tr.InvalidOperator]:"Invalid operator encountered",[tr.InvalidTime]:"Invalid time encountered",[tr.IllegalInterval]:"Illegal interval",[tr.FunctionNotRecognized]:"Function not recognized",[tr.InvalidTimeStamp]:"Invalid timestamp encountered",[tr.InvalidParameterCount]:"Invalid parameter count for call to {name}",[tr.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[tr.YearMonthIntervals]:"Year-Month Intervals not supported",[tr.CannotCastValue]:"Cannot cast value to the required data type"};let fr=class E8t extends Error{constructor(e,t){super(m0(a$r[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,E8t)}};var pl;(function(i){i.NeverReach="NeverReach",i.NotImplemented="NotImplemented",i.Cancelled="Cancelled",i.InvalidStatResponse="InvalidStatResponse",i.InvalidRequest="InvalidRequest",i.RequestFailed="RequestFailed",i.MissingFeatures="MissingFeatures",i.AggregationFieldNotFound="AggregationFieldNotFound",i.DataElementsNotFound="DataElementsNotFound"})(pl||(pl={}));const l$r={[pl.Cancelled]:"Cancelled",[pl.InvalidStatResponse]:"Invalid statistics response from service",[pl.InvalidRequest]:"Invalid request",[pl.RequestFailed]:"Request failed - {reason}",[pl.MissingFeatures]:"Missing features",[pl.AggregationFieldNotFound]:"Aggregation field not found",[pl.DataElementsNotFound]:"Data elements not found on service",[pl.NeverReach]:"Encountered unreachable logic",[pl.NotImplemented]:"Not implemented"};let wc=class I8t extends Error{constructor(e,t){super(m0(l$r[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,I8t)}};function pdt(i){i=i.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of i.match(t)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}let Lu=class Cw{constructor(e,t,r){this._year=e,this._month=t,this._day=r,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof Cw&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new Cw(this._year,this._month,this._day)}toDateTime(e){return Sn.fromObject({day:this.day,month:this.month,year:this.year},{zone:B1(e)})}toDateTimeLuxon(e){return Sn.fromObject({day:this.day,month:this.month,year:this.year},{zone:B1(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=pdt(e)),!e)return"";const r=this.toDateTime("unknown");return ao.dateTimeToArcadeDate(r).toFormat(e,{locale:Am(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return ao.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return Cw.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return Sn.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=Sn.fromMillis(e,{zone:If.utcInstance});return t.isValid?Cw.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=Sn.fromSeconds(e,{zone:If.utcInstance});return t.isValid?Cw.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new Cw(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,r){const n=new Cw(e,t,r);return n.isValid===!1?null:n}static fromDateJS(e){return Cw.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return Cw.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];if(t)(t=pdt(t))&&r.push(t);else if(t===null||t===""){const n=Sn.fromISO(e,{setZone:!0});return n.isValid?Cw.fromParts(n.year,n.month,n.day):null}for(const n of r){const s=Sn.fromFormat(e,t??n);if(s.isValid)return new Cw(s.year,s.month,s.day)}return null}static fromNow(e="system"){const t=Sn.fromJSDate(new Date).setZone(B1(e));return new Cw(t.year,t.month,t.day)}};function fdt(i){return Number.isNaN(i)||i===0?i:Math.trunc(i)}let o_=class mU{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??=Sn.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return fdt(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return fdt(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return mU.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new mU(Sn.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new mU(e.toISO({includeOffset:!0}))}static fromParts(e,t,r=0,n=0,s=0,o=0,a=0,l=!1,u=0,c=0){const h=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}`;let p="";o<10&&(p="0");let m=`${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${p+o.toString()}`;a!==0&&(m+="."+a.toString().padStart(3,"0"));const v=`${l?"-":"+"}${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new mU(h+"T"+m+v)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return mU.fromDateTime(t)}};function uA(i){if(i==null)return null;if(typeof i=="number")return i;let e=i.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function mdt(i){if(i==null)return null;switch(i.type){case"polygon":case"multipoint":case"polyline":return i.extent;case"point":return new hr({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y,spatialReference:i.spatialReference});case"extent":return i}return null}function au(i){if(i==null)return null;if(typeof i=="number")return i;let e=i.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function hp(i){if(i==null)return null;const e=i.clone();return i.cache._geVersion!==void 0&&(e.cache._geVersion=i.cache._geVersion),e}function ude(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}function gdt(i){if(!i)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const r of i.match(e)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=r;break;case"A":case"a":t+="a";break;default:t+=`'${r}'`}return t}let Nu=class EI{constructor(e,t,r,n){this._hour=e,this._minute=t,this._second=r,this._millisecond=n,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof EI&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new EI(this.hour,this.minute,this.second,this.millisecond)}isValid(){return ude(this.hour)&&ude(this.minute)&&ude(this.second)&&ude(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=gdt(e))?Sn.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:Am(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,r,n){const s=new EI(e,t,r,n);return s.isValid()?s:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new EI(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),n=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new EI(n,r,t,s)}static fromDateJS(e){return new EI(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new EI(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];t?(t=gdt(t))&&r.push(t):t!==null&&t!==""||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const n of r){const s=Sn.fromFormat(e,n);if(s.isValid)return new EI(s.hour,s.minute,s.second,s.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return EI.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return Sn.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}};function u$r(i,e){const t=A8t[i.toLowerCase()];if(t==null)throw new fr(tr.FunctionNotRecognized);if(e.lengtht.maxParams)throw new fr(tr.InvalidParameterCount,{name:i.toUpperCase()});return t.evaluate(e)}function ydt(i,e){const t=A8t[i.toLowerCase()];return t!=null&&e>=t.minParams&&e<=t.maxParams}const A8t={min:{minParams:1,maxParams:1,evaluate:i=>vdt(i[0],"min")},max:{minParams:1,maxParams:1,evaluate:i=>vdt(i[0],"max")},avg:{minParams:1,maxParams:1,evaluate:i=>M8t(i[0])},sum:{minParams:1,maxParams:1,evaluate:i=>c$r(i[0])},stddev:{minParams:1,maxParams:1,evaluate:i=>h$r(i[0])},count:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].length},var:{minParams:1,maxParams:1,evaluate:i=>O8t(i[0])}};function M8t(i){if(i===null)return null;let e=0,t=0;for(let r=0;r=s)&&(t=n,r=s)}return t}function c$r(i){if(i===null)return null;let e=0;for(let t=0;tr!==null)).length===0)return null;const e=M8t(i);if(e===null)return null;let t=0;for(const r of i){if(!UYe(r))throw new fr(tr.InvalidValueForAggregateFunction);t+=(e-r)**2}return t/(i.length-1)}let o0=class II{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(e){if(e.precision!==null||e.secondary!==null)throw new fr(tr.PrimarySecondaryQualifiers)}static _parseSecondsComponent(e,t){if(t.includes(".")){const r=t.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(t)}static createFromMilliseconds(e){const t=new II;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,r){let n=null;const s=new II;if(s.op=r==="-"?"-":"+",t.type==="interval-period"){II._fixDefaults(t);const o=new RegExp("^[0-9]{1,}$");if(t.period==="year"||t.period==="month")throw new fr(tr.YearMonthIntervals);if(t.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new fr(tr.IllegalInterval);II._parseSecondsComponent(s,e)}else{if(!o.test(e))throw new fr(tr.IllegalInterval);s[t.period]=parseFloat(e)}}else{if(II._fixDefaults(t.start),II._fixDefaults(t.end),t.start.period==="year"||t.start.period==="month"||t.end.period==="year"||t.end.period==="month")throw new fr(tr.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new fr(tr.IllegalInterval);s[t.start.period]=parseFloat(e.split(" ")[0]),s[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!n.test(e))throw new fr(tr.IllegalInterval);{s[t.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1])}break;case"second":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new fr(tr.IllegalInterval);{s[t.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),II._parseSecondsComponent(s,o[2])}break;default:throw new fr(tr.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new fr(tr.IllegalInterval);s.hour=parseFloat(e.split(":")[0]),s.minute=parseFloat(e.split(":")[1]);break;case"second":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new fr(tr.IllegalInterval);{const o=e.split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),II._parseSecondsComponent(s,o[2])}break;default:throw new fr(tr.IllegalInterval)}break;case"minute":if(t.end.period!=="second")throw new fr(tr.IllegalInterval);if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new fr(tr.IllegalInterval);{const o=e.split(":");s.minute=parseFloat(o[0]),II._parseSecondsComponent(s,o[1])}break;default:throw new fr(tr.IllegalInterval)}}return s}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}};const d$r=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,p$r=/^(\d{1,2}):(\d{1,2})$/,f$r=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,P8t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,m$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,g$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,y$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,v$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function ATe(i,e){if(e instanceof zk)return e===hb.instance?Sn.fromMillis(i.getTime(),{zone:hb.instance}):Sn.fromJSDate(i,{zone:e});switch(e){case"system":case"local":case null:return Sn.fromJSDate(i);default:return e?.toLowerCase()==="unknown"?Sn.fromMillis(i.getTime(),{zone:hb.instance}):Sn.fromJSDate(i,{zone:e})}}function N1(i){return typeof i=="number"}function $1(i){return typeof i=="string"||i instanceof String}function ID(i){return i instanceof o0}function tS(i){return i instanceof Date}function gd(i){return i instanceof Sn}function yd(i){return i instanceof Lu}function pp(i){return i instanceof Nu}function vd(i){return i instanceof o_}function zYe(i){let e=d$r.exec(i);if(e!==null){const[,t,r,n]=e,s=Nu.fromParts(parseInt(t,10),parseInt(r,10),parseInt(n,10),0);if(s!==null)return s;throw new fr(tr.InvalidTime)}if(e=p$r.exec(i),e!==null){const[,t,r]=e,n=Nu.fromParts(parseInt(t,10),parseInt(r,10),0,0);if(n!==null)return n;throw new fr(tr.InvalidTime)}if(e=f$r.exec(i),e!==null){const[,t,r,n,s]=e,o=Nu.fromParts(parseInt(t,10),parseInt(r,10),parseInt(n,10),parseInt(s,10));if(o!==null)return o;throw new fr(tr.InvalidTime)}throw new fr(tr.InvalidTime)}function MTe(i,e,t=!1){let r=m$r.exec(i);if(r!==null){const[,n,s,o,a,l,u,c]=r,h=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:parseInt(a,10),minute:parseInt(l,10),second:parseInt(u,10),millisecond:c?parseInt(c.replace(".",""),10):0},{zone:b3e(e)});if(h.isValid===!1)throw new fr(tr.InvalidTimeStamp);return h}if(r=g$r.exec(i),r!==null){const[,n,s,o,a,l,u,c,h,p,m]=r,v=o_.fromParts(parseInt(n,10),parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(l,10),parseInt(u,10),c?parseInt(c.replace(".",""),10):0,h==="-",parseInt(p,10),parseInt(m,10));if(v.isValid===!1)throw new fr(tr.InvalidTimeStamp);return v}if(r=y$r.exec(i),r!==null){const[,n,s,o,a,l,u,c,h]=r,p=o_.fromParts(parseInt(n,10),parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(l,10),0,0,u==="-",parseInt(c,10),parseInt(h,10));if(p.isValid===!1)throw new fr(tr.InvalidTimeStamp);return p}if(r=v$r.exec(i),r!==null){const[,n,s,o,a,l]=r,u=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:parseInt(a,10),minute:parseInt(l,10),second:0},{zone:b3e(e)});if(u.isValid===!1)throw new fr(tr.InvalidTimeStamp);return u}if(r=P8t.exec(i),r!==null){const[,n,s,o]=r,a=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:0,minute:0,second:0},{zone:b3e(e)});if(a.isValid===!1)throw new fr(tr.InvalidTimeStamp);return a}throw new fr(tr.InvalidTimeStamp)}function R8t(i,e){const t=P8t.exec(i);if(t===null)try{return MTe(i,e)}catch{throw new fr(tr.InvalidDate)}const[,r,n,s]=t,o=Lu.fromParts(parseInt(r,10),parseInt(n,10),parseInt(s,10));if(o===null)throw new fr(tr.InvalidDate);return o}const _$r=321408e5,b$r=26784e5,w$r=864e5,x$r=36e5,S$r=6e4;function yOe(i){return!!gd(i)||!!vd(i)}function T$r(i){return!!gd(i)||!!yd(i)||!!vd(i)||!!pp(i)}function cde(i){if(gd(i))return i.toMillis();if(yd(i))return i.toNumber();if(vd(i))return i.toMilliseconds();throw new fr(tr.InvalidDataType)}function iS(i,e,t,r){if(i==null||e==null)return null;if(N1(i)){if(N1(e))return OC(i,e,t);if($1(e))return C$r(i,e,t);if(T$r(e))throw new fr(tr.InvalidOperator);if(yd(e))throw new fr(tr.InvalidOperator)}else if($1(i)){if(N1(e))return E$r(i,e,t);if($1(e))return I$r(i,e,t);if(gd(e))throw new fr(tr.InvalidOperator);if(yd(e))throw new fr(tr.InvalidOperator);if(pp(e))throw new fr(tr.InvalidOperator);if(vd(e))throw new fr(tr.InvalidOperator)}else if(gd(i)){if(yOe(e)){if(i instanceof Sn&&RG(i.zone)){if(e instanceof Sn&&RG(e.zone)===!1||e instanceof o_)return nK(i,e,t)}else if(e instanceof Sn&&RG(e.zone)&&(i instanceof Sn&&RG(i.zone)===!1||i instanceof o_))return nK(i,e,t);return OC(cde(i),cde(e),t)}if($1(e))throw new fr(tr.InvalidOperator);if(yd(e))return A$r(i,e,t);if(pp(e))throw new fr(tr.InvalidOperator);if(N1(e))throw new fr(tr.InvalidOperator)}else if(yd(i)){if(vd(e))return P$r(i,e,t);if(gd(e))return O$r(i,e,t);if($1(e))throw new fr(tr.InvalidOperator);if(yd(e))return OC(i.toNumber(),e.toNumber(),t);if(pp(e))throw new fr(tr.InvalidOperator);if(N1(e))throw new fr(tr.InvalidOperator)}else if(pp(i)){if(pp(e))return OC(i.toNumber(),e.toNumber(),t);if($1(e))throw new fr(tr.InvalidOperator);if(N1(e))throw new fr(tr.InvalidOperator);if(yd(e))throw new fr(tr.InvalidOperator);if(yOe(e))throw new fr(tr.InvalidOperator)}else if(vd(i)){if(yOe(e))return e instanceof Sn&&RG(e.zone)?nK(i,e,t):OC(cde(i),cde(e),t);if($1(e))throw new fr(tr.InvalidOperator);if(yd(e))return M$r(i,e,t);if(pp(e))throw new fr(tr.InvalidOperator);if(N1(e))throw new fr(tr.InvalidOperator)}switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function OC(i,e,t){switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function C$r(i,e,t){const r=parseFloat(e);if(!isNaN(r))return OC(i,r,t);const n=i.toString();switch(t){case"<>":return n!==e;case"=":return n===e;case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}}function E$r(i,e,t){const r=parseFloat(i);if(!isNaN(r))return OC(r,e,t);const n=e.toString();switch(t){case"<>":return i!==n;case"=":return i===n;case">":return i>n;case"<":return i=":return i>=n;case"<=":return i<=n}}function I$r(i,e,t){switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function A$r(i,e,t){const r=e.toDateTimeLuxon(i.zone);return OC((i=i.startOf("day")).toMillis(),r.toMillis(),t)}function M$r(i,e,t){const r=e.toDateTimeLuxon(i.toDateTime().zone);return OC((i=i.startOfDay()).toMilliseconds(),r.toMillis(),t)}function O$r(i,e,t){const r=i.toDateTimeLuxon(e.zone);return e=e.startOf("day"),OC(r.toMillis(),e.toMillis(),t)}function P$r(i,e,t){const r=i.toDateTimeLuxon(e.toDateTime().zone);return e=e.startOfDay(),OC(r.toMillis(),e.toMilliseconds(),t)}function nK(i,e,t){i instanceof o_&&(i=i.toDateTime()),e instanceof o_&&(e=e.toDateTime());const r=_dt(i),n=_dt(e);switch(t){case"<>":return r!==n;case"=":return r===n;case">":return r>n;case"<":return r=":return r>=n;case"<=":return r<=n}}function _dt(i){return i.year*_$r+i.month*b$r+i.day*w$r+i.hour*x$r+i.minute*S$r+1e3*i.second+i.millisecond}function VYe(i,e,t){const r=F8t[i.toLowerCase()];if(r==null)throw new fr(tr.FunctionNotRecognized);if(e.lengthr.maxParams)throw new fr(tr.InvalidParameterCount,{name:i.toUpperCase()});return r.evaluate(e,t)}function R$r(i,e){const t=F8t[i.toLowerCase()];return t!=null&&e>=t.minParams&&e<=t.maxParams}function OTe(i){return typeof i=="string"||i instanceof String}function vOe(i){return!tS(i)&&!yd(i)&&!gd(i)&&!pp(i)&&!vd(i)}function D8t(i){return yd(i)||pp(i)?i.toString():vd(i)?i.toSQLValue():gd(i)?i.millisecond===0?i.toFormat("yyyy-LL-dd HH:mm:ss"):i.toSQL({includeOffset:!1}):tS(i)?D8t(Sn.fromJSDate(i)):i.toString()}function D$r(i){if(tS(i))return Lu.fromDateJS(i);if(gd(i))return Lu.fromParts(i.year,i.month,i.day);if(yd(i))return i;if(pp(i))throw new fr(tr.CannotCastValue);if(vd(i)&&Lu.fromParts(i.year,i.month,i.day)===null)throw new fr(tr.CannotCastValue);if(OTe(i)){const e=Lu.fromReader(i);if(e!==null&&e.isValid)return e}throw new fr(tr.CannotCastValue)}function F$r(i,e,t){if(tS(i))return ATe(i,e);if(gd(i))return i;if(yd(i))return i.toDateTimeLuxon("unknown");if(pp(i))throw new fr(tr.CannotCastValue);if(vd(i))return i;if(OTe(i))return MTe(i,"unknown",t);throw new fr(tr.CannotCastValue)}function k$r(i){if(tS(i))return Nu.fromDateJS(i);if(gd(i))return Nu.fromDateTime(i);if(yd(i))throw new fr(tr.CannotCastValue);if(pp(i))return i;if(vd(i))return Nu.fromSqlTimeStampOffset(i);if(OTe(i))return zYe(i);throw new fr(tr.CannotCastValue)}const F8t={extract:{minParams:2,maxParams:2,evaluate:([i,e])=>{if(e==null)return null;if(tS(e))switch(i.toUpperCase()){case"SECOND":return e.getSeconds();case"MINUTE":return e.getMinutes();case"HOUR":return e.getHours();case"DAY":return e.getDate();case"MONTH":return e.getMonth()+1;case"YEAR":return e.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(gd(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour;case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new fr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(yd(e))switch(i.toUpperCase()){case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new fr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(pp(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour}else if(vd(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour;case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":return e.timezoneOffsetHour;case"TIMEZONE_MINUTE":return e.timezoneOffsetMinutes}throw new fr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:i=>{if(i.length===2){const[e,t]=i;return e==null||t==null?null:e.toString().substring(t-1)}if(i.length===3){const[e,t,r]=i;return e==null||t==null||r==null?null:r<=0?"":e.toString().substring(t-1,t+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([i,e])=>i==null||e==null?null:e.indexOf(i)+1},trim:{minParams:2,maxParams:3,evaluate:i=>{const e=i.length===3,t=e?i[1]:" ",r=e?i[2]:i[1];if(t==null||r==null)return null;const n=`(${UUe(t)})`;switch(i[0]){case"BOTH":return r.replaceAll(new RegExp(`^${n}*|${n}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${n}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${n}*$`,"g"),"")}throw new fr(tr.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.abs(i[0])},ceiling:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.ceil(i[0])},floor:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.floor(i[0])},log:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])},log10:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sin(i[0])},cos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cos(i[0])},tan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tan(i[0])},asin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.asin(i[0])},acos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.acos(i[0])},atan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.atan(i[0])},sign:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0]>0?1:i[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]**i[1]},mod:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]%i[1]},round:{minParams:1,maxParams:2,evaluate:i=>{const e=i[0],t=i.length===2?10**i[1]:1;return e==null?null:Math.round(e*t)/t}},truncate:{minParams:1,maxParams:2,evaluate:i=>i[0]==null?null:i.length===1?parseInt(i[0].toFixed(0),10):parseFloat(i[0].toFixed(i[1]))},char_length:{minParams:1,maxParams:1,evaluate:i=>OTe(i[0])?i[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:i=>{let e="";for(let t=0;ti[0]==null?null:i[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:i=>{for(const e of i)if(e!==null)return e;return null}},cosh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cosh(i[0])},sinh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sinh(i[0])},tanh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tanh(i[0])},nullif:{minParams:2,maxParams:2,evaluate:(i,e)=>iS(i[0],i[1],"=")?null:i[0]},cast:{minParams:2,maxParams:2,evaluate:(i,e)=>{const t=i[0],r=i[1];if(t===null)return null;switch(r.type){case"integer":{if(!vOe(t))throw new fr(tr.CannotCastValue);const n=parseInt(t,10);if(isNaN(n))throw new fr(tr.CannotCastValue);return n}case"smallint":{if(!vOe(t))throw new fr(tr.CannotCastValue);const n=parseInt(t,10);if(isNaN(n))throw new fr(tr.CannotCastValue);if(n>32767||n<-32767)throw new fr(tr.CannotCastValue);return n}case"float":case"real":{if(!vOe(t))throw new fr(tr.CannotCastValue);const n=parseFloat(t);if(isNaN(n))throw new fr(tr.CannotCastValue);return n}case"time":return k$r(t);case"date":return D$r(t);case"timestamp":return F$r(t,e,r.withtimezone===!0);case"varchar":{const n=D8t(t);if(n.length>r.size)throw new fr(tr.CannotCastValue);return n}default:throw new fr(tr.InvalidDataType)}}}};function k8t(i,e,t,r){if(i==="||")return VYe("concat",[e,t],r);if(e===null||t===null)return null;if(N1(e)){if(N1(t))return HYe(e,t,i);if(ID(t))return z$r(e,t,i);if(pp(t))return Q$r();if(yd(t))return e6r();if(vd(t))return Z$r();if(gd(t))return J$r();if($1(t))return t6r(e,t,i);throw new fr(tr.InvalidOperator)}if(yd(e)){if(N1(t))return Y$r(e,t,i);if(ID(t))return V$r(e,t,i);if(pp(t))return u6r();if(yd(t))return l6r(e,t,i);if(vd(t))return a6r(e,t,i);if(gd(t))return o6r(e,t,i);if($1(t))return x6r();throw new fr(tr.InvalidOperator)}if(pp(e)){if(N1(t))return X$r(e,t,i);if(ID(t))return B$r(e,t,i);if(pp(t))return y6r();if(yd(t))return m6r();if(vd(t))return g6r();if(gd(t))return f6r();if($1(t))return S6r();throw new fr(tr.InvalidOperator)}if(ID(e)){if(N1(t))return U$r(e,t,i);if(ID(t))return G$r(e,t,i);if(pp(t))return N$r(e,t,i);if(yd(t))return $$r(e,t,i);if(vd(t))return j$r(e,t,i);if(gd(t))return L$r(e,t,i);if($1(t))return n6r();throw new fr(tr.InvalidOperator)}if(gd(e)){if(N1(t))return q$r(e,t,i);if(ID(t))return H$r(e,t,i);if(pp(t))return w6r();if(yd(t))return _6r(e,t,i);if(vd(t))return b6r(e,t,i);if(gd(t))return v6r(e,t,i);if($1(t))return T6r();throw new fr(tr.InvalidOperator)}if(vd(e)){if(N1(t))return K$r(e,t,i);if(ID(t))return W$r(e,t,i);if(pp(t))return c6r();if(yd(t))return h6r(e,t,i);if(vd(t))return p6r(e,t,i);if(gd(t))return d6r(e,t,i);if($1(t))return C6r();throw new fr(tr.InvalidOperator)}if($1(e)){if(N1(t))return i6r(e,t,i);if(ID(t))return s6r();if(pp(t))return E6r();if(yd(t))return I6r();if(vd(t))return M6r();if(gd(t))return A6r();if($1(t))return r6r(e,t,i);throw new fr(tr.InvalidOperator)}throw new fr(tr.InvalidOperator)}function HYe(i,e,t){switch(t){case"+":return i+e;case"-":return i-e;case"*":return i*e;case"/":return i/e}throw new fr(tr.InvalidOperator)}function L$r(i,e,t){switch(t){case"+":return e.plus({milliseconds:i.valueInMilliseconds()});case"-":return i.valueInMilliseconds()-e.toMillis()}throw new fr(tr.InvalidOperator)}function N$r(i,e,t){if(t==="+")return e.plus("milliseconds",i.valueInMilliseconds());throw new fr(tr.InvalidOperator)}function $$r(i,e,t){if(t==="+")return e.plus("milliseconds",i.valueInMilliseconds());throw new fr(tr.InvalidOperator)}function B$r(i,e,t){switch(t){case"+":return i.plus("milliseconds",e.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*e.valueInMilliseconds())}throw new fr(tr.InvalidOperator)}function j$r(i,e,t){if(t==="+")return e.addMilliseconds(i.valueInMilliseconds());throw new fr(tr.InvalidOperator)}function G$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i.valueInMilliseconds()+e.valueInMilliseconds());case"-":return o0.createFromMilliseconds(i.valueInMilliseconds()-e.valueInMilliseconds());case"*":return o0.createFromMilliseconds(i.valueInMilliseconds()*e.valueInMilliseconds());case"/":return o0.createFromMilliseconds(i.valueInMilliseconds()/e.valueInMilliseconds())}throw new fr(tr.InvalidOperator)}function U$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i.valueInMilliseconds()+e);case"-":return o0.createFromMilliseconds(i.valueInMilliseconds()-e);case"*":return o0.createFromMilliseconds(i.valueInMilliseconds()*e);case"/":return o0.createFromMilliseconds(i.valueInMilliseconds()/e)}throw new fr(tr.InvalidOperator)}function z$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i+e.valueInMilliseconds());case"-":return o0.createFromMilliseconds(i-e.valueInMilliseconds());case"*":return o0.createFromMilliseconds(i*e.valueInMilliseconds());case"/":return o0.createFromMilliseconds(i/e.valueInMilliseconds())}throw new fr(tr.InvalidOperator)}function V$r(i,e,t){switch(t){case"+":return i.plus("milliseconds",e.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*e.valueInMilliseconds())}throw new fr(tr.InvalidOperator)}function H$r(i,e,t){switch(t){case"+":return i.plus({milliseconds:e.valueInMilliseconds()});case"-":return i.minus({milliseconds:e.valueInMilliseconds()})}throw new fr(tr.InvalidOperator)}function W$r(i,e,t){switch(t){case"+":return i.addMilliseconds(e.valueInMilliseconds());case"-":return i.addMilliseconds(-1*e.valueInMilliseconds())}throw new fr(tr.InvalidOperator)}function q$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus({milliseconds:r});case"-":return i.minus({milliseconds:r})}throw new fr(tr.InvalidOperator)}function Y$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus("milliseconds",r);case"-":return i.plus("milliseconds",-1*r)}throw new fr(tr.InvalidOperator)}function X$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus("milliseconds",r);case"-":return i.plus("milliseconds",-1*r)}throw new fr(tr.InvalidOperator)}function J$r(i,e,t){throw new fr(tr.InvalidOperator)}function K$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.addMilliseconds(r);case"-":return i.addMilliseconds(-1*r)}throw new fr(tr.InvalidOperator)}function Z$r(i,e,t){throw new fr(tr.InvalidOperator)}function Q$r(i,e,t){throw new fr(tr.InvalidOperator)}function e6r(i,e,t){throw new fr(tr.InvalidOperator)}function t6r(i,e,t){const r=parseFloat(e);if(isNaN(r))throw new fr(tr.InvalidOperator);return HYe(i,r,t)}function i6r(i,e,t){const r=parseFloat(i);if(isNaN(r))throw new fr(tr.InvalidOperator);return HYe(r,e,t)}function r6r(i,e,t){if(t==="+")return i+e;throw new fr(tr.InvalidOperator)}function n6r(i,e,t){throw new fr(tr.InvalidOperator)}function s6r(i,e,t){throw new fr(tr.InvalidOperator)}function o6r(i,e,t){if(t==="-")return i.toDateTimeLuxon(e.zone).diff(e).as("days");throw new fr(tr.InvalidOperator)}function a6r(i,e,t){if(t==="-")return i.toDateTimeLuxon(e.toDateTime().zone).diff(e.toDateTime()).as("days");throw new fr(tr.InvalidOperator)}function l6r(i,e,t){if(t==="-")return i.toDateTimeLuxon("UTC").diff(e.toDateTimeLuxon("UTC")).as("days");throw new fr(tr.InvalidOperator)}function u6r(i,e,t){throw new fr(tr.InvalidOperator)}function c6r(i,e,t){throw new fr(tr.InvalidOperator)}function h6r(i,e,t){if(t==="-")return i.toDateTime().diff(e.toDateTimeLuxon(i.toDateTime().zone)).as("days");throw new fr(tr.InvalidOperator)}function d6r(i,e,t){if(t==="-")return i.toDateTime().diff(e).as("days");throw new fr(tr.InvalidOperator)}function p6r(i,e,t){if(t==="-")return i.toDateTime().diff(e.toDateTime()).as("days");throw new fr(tr.InvalidOperator)}function f6r(i,e,t){throw new fr(tr.InvalidOperator)}function m6r(i,e,t){throw new fr(tr.InvalidOperator)}function g6r(i,e,t){throw new fr(tr.InvalidOperator)}function y6r(i,e,t){throw new fr(tr.InvalidOperator)}function v6r(i,e,t){if(t==="-")return i.diff(e).as("days");throw new fr(tr.InvalidOperator)}function _6r(i,e,t){if(t==="-")return i.diff(e.toDateTimeLuxon(i.zone)).as("days");throw new fr(tr.InvalidOperator)}function b6r(i,e,t){if(t==="-")return i.diff(e.toDateTime()).as("days");throw new fr(tr.InvalidOperator)}function w6r(i,e,t){throw new fr(tr.InvalidOperator)}function x6r(i,e,t){throw new fr(tr.InvalidOperator)}function S6r(i,e,t){throw new fr(tr.InvalidOperator)}function T6r(i,e,t){throw new fr(tr.InvalidOperator)}function C6r(i,e,t){throw new fr(tr.InvalidOperator)}function E6r(i,e,t){throw new fr(tr.InvalidOperator)}function I6r(i,e,t){throw new fr(tr.InvalidOperator)}function A6r(i,e,t){throw new fr(tr.InvalidOperator)}function M6r(i,e,t){throw new fr(tr.InvalidOperator)}var bdt,wdt,L8t={exports:{}};wdt=function(){function i(n,s){function o(){this.constructor=n}o.prototype=s.prototype,n.prototype=new o}function e(n,s,o,a){var l=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(l,e.prototype),l.expected=s,l.found=o,l.location=a,l.name="SyntaxError",l}function t(n,s,o){return o=o||" ",n.length>s?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function r(n,s){var o,a={},l=(s=s!==void 0?s:{}).grammarSource,u={start:ka},c=ka,h="!",p="=",m=">=",v=">",w="<=",S="<>",I="<",R="!=",L="+",k="-",B="||",$="*",V="/",Y="@",K="'",Q="N'",re="''",ne=".",de="null",pe="true",H="false",Z="in",ae="is",fe="like",be="escape",_e="not",Ie="and",Te="or",Be="between",Ve="from",$e="for",tt="substring",yt="extract",Ct="trim",ot="position",vt="timestamp",At="date",Je="time",it="leading",Ue="trailing",ct="both",st="cast",Ze="as",ye="integer",Ke="smallint",ke="float",me="real",ie="varchar",ge="to",je="interval",rt="year",Me="timezone_hour",ht="timezone_minute",Ht="month",_t="day",Fe="hour",Yt="minute",A="second",ue="case",G="end",E="when",_="then",g="else",b=",",C="(",O=")",F="`",N=/^[A-Za-z_\x80-\uFFFF]/,j=/^[A-Za-z0-9_]/,W=/^[A-Za-z0-9_.\x80-\uFFFF]/,q=/^["]/,J=/^[^']/,ee=/^[0-9]/,he=/^[eE]/,Ee=/^[+\-]/,De=/^[ \t\n\r]/,pt=/^[^`]/,Et=Ts("!",!1),Ye=Ts("=",!1),jt=Ts(">=",!1),ei=Ts(">",!1),Xt=Ts("<=",!1),wi=Ts("<>",!1),pi=Ts("<",!1),Ri=Ts("!=",!1),Ui=Ts("+",!1),Bi=Ts("-",!1),mi=Ts("||",!1),ar=Ts("*",!1),z=Ts("/",!1),Wi=M0([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Fr=M0([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ds=M0([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Dt=M0(['"'],!1,!1),Mn=Ts("@",!1),yn=Ts("'",!1),Pt=Ts("N'",!1),Un=Ts("''",!1),Qi=M0(["'"],!0,!1),Tn=Ts(".",!1),bs=M0([["0","9"]],!1,!1),qn=M0(["e","E"],!1,!1),ko=M0(["+","-"],!1,!1),ai=Ts("NULL",!0),Al=Ts("TRUE",!0),eu=Ts("FALSE",!0),Ma=Ts("IN",!0),_n=Ts("IS",!0),Ss=Ts("LIKE",!0),la=Ts("ESCAPE",!0),gi=Ts("NOT",!0),lr=Ts("AND",!0),Rr=Ts("OR",!0),Os=Ts("BETWEEN",!0),Js=Ts("FROM",!0),vs=Ts("FOR",!0),na=Ts("SUBSTRING",!0),gl=Ts("EXTRACT",!0),fn=Ts("TRIM",!0),qr=Ts("POSITION",!0),Gu=Ts("TIMESTAMP",!0),dc=Ts("DATE",!0),Re=Ts("TIME",!0),Ne=Ts("LEADING",!0),dt=Ts("TRAILING",!0),Gt=Ts("BOTH",!0),ti=Ts("CAST",!0),oi=Ts("AS",!0),Hi=Ts("INTEGER",!0),Oi=Ts("SMALLINT",!0),kt=Ts("FLOAT",!0),Xe=Ts("REAL",!0),Le=Ts("VARCHAR",!0),xt=Ts("TO",!0),Zt=Ts("INTERVAL",!0),Rt=Ts("YEAR",!0),fi=Ts("TIMEZONE_HOUR",!0),Fi=Ts("TIMEZONE_MINUTE",!0),mr=Ts("MONTH",!0),yr=Ts("DAY",!0),Gr=Ts("HOUR",!0),zr=Ts("MINUTE",!0),jn=Ts("SECOND",!0),co=Ts("CASE",!0),ua=Ts("END",!0),Hs=Ts("WHEN",!0),Ll=Ts("THEN",!0),ft=Ts("ELSE",!0),Wt=Ts(",",!1),hi=Ts("(",!1),Pi=Ts(")",!1),vr=M0([" "," ",` -`,"\r"],!1,!1),Lr=Ts("`",!1),on=M0(["`"],!0,!1),dn=function(le){return le},Ir=function(le,gt){var $t={type:"expression-list"},ci=BIe(le,gt);return $t.value=ci,$t},$n=function(le,gt){return AL(le,gt)},fa=function(le,gt){return AL(le,gt)},Sa=function(le){return zue("NOT",le)},ma=function(le,gt){return gt==""||gt==null||gt==null?le:gt.type=="arithmetic"?AL(le,gt.tail):Vue(gt.op,le,gt.right,gt.escape)},go=function(le){return{type:"arithmetic",tail:le}},tu=function(le,gt){return{op:le+"NOT",right:gt}},Uu=function(le,gt){return{op:le,right:gt}},pc=function(le,gt,$t){return{op:"NOT"+le,right:{type:"expression-list",value:[gt,$t]}}},Fh=function(le,gt,$t){return{op:le,right:{type:"expression-list",value:[gt,$t]}}},Zr=function(le){return le[0]+" "+le[2]},Ps=function(le){return le[0]+" "+le[2]},ca=function(le,gt,$t){return{op:le,right:gt,escape:$t.value}},Ou=function(le,gt){return{op:le,right:gt,escape:""}},Za=function(le,gt){return{op:le,right:gt}},kh=function(le){return{op:le,right:{type:"expression-list",value:[]}}},Qv=function(le,gt){return{op:le,right:gt}},_y=function(le,gt){return AL(le,gt)},I0=function(le,gt){return AL(le,gt)},e1=function(le){return le.paren=!0,le},Nl=function(le){return/^CURRENT_DATE$/i.test(le)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(le)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:le}},Sp=function(le){return{type:"column-reference",table:"",column:le,delimited:!0}},Ml=function(le){return le},Og=function(le,gt){return le+gt.join("")},Xc=function(le,gt){return le+gt.join("")},Bm=function(le){return le},by=function(le){return le.join("")},A0=function(){return'"'},Nf=function(le){return{type:"parameter",value:le[1]}},Pg=function(le,gt){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:le},gt]}}},Kd=function(le,gt,$t){return{type:"function",name:"substring",args:{type:"expression-list",value:$t?[le,gt,$t[2]]:[le,gt]}}},$f=function(le,gt){return{type:"function",name:"cast",args:{type:"expression-list",value:[le,gt]}}},Jc=function(){return{type:"data-type",value:{type:"integer"}}},t1=function(){return{type:"data-type",value:{type:"smallint"}}},hh=function(){return{type:"data-type",value:{type:"float"}}},Lh=function(){return{type:"data-type",value:{type:"real"}}},fc=function(){return{type:"data-type",value:{type:"date"}}},rn=function(){return{type:"data-type",value:{type:"timestamp"}}},Qa=function(){return{type:"data-type",value:{type:"time"}}},wy=function(le){return{type:"data-type",value:{type:"varchar",size:parseInt(le)}}},ve=function(le,gt,$t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:le??"BOTH"},gt,$t]}}},oe=function(le,gt){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:le??"BOTH"},gt]}}},ce=function(le,gt){return{type:"function",name:"position",args:{type:"expression-list",value:[le,gt]}}},we=function(le,gt){return{type:"function",name:le,args:gt||{type:"expression-list",value:[]}}},He=function(le){return le.type==="string"&&jIe(le.value),{type:"timestamp",value:le.value}},St=function(le){return le.type==="string"&&GIe(le.value),{type:"time",value:le.value}},ut=function(le,gt,$t){return{type:"interval",value:gt,qualifier:$t,op:le}},Bt=function(le,gt){return{type:"interval",value:le,qualifier:gt,op:""}},Ge=function(le,gt){return{type:"interval-qualifier",start:le,end:gt}},et=function(le,gt){return{type:"interval-period",period:le.value,precision:gt,secondary:null}},zt=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},ii=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},te=function(le,gt){return{type:"interval-period",period:"second",precision:le,secondary:gt}},xe=function(le){return{type:"interval-period",period:"second",precision:le,secondary:null}},Ae=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},lt=function(le,gt){return{type:"interval-period",period:le.value,precision:gt,secondary:null}},nt=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},It=function(le,gt){return{type:"interval-period",period:"second",precision:le,secondary:gt}},Nt=function(le){return{type:"interval-period",period:"second",precision:le,secondary:null}},Ut=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Jt=function(){return{type:"string",value:"day"}},xi=function(){return{type:"string",value:"hour"}},Di=function(){return{type:"string",value:"minute"}},ki=function(){return{type:"string",value:"month"}},ir=function(){return{type:"string",value:"year"}},$r=function(le){return parseFloat(le)},mn=function(le){return parseFloat(le)},Kr=function(le){return le.type==="string"&&UIe(le.value),{type:"date",value:le.value}},xn=function(){return{type:"null",value:null}},Gn=function(){return{type:"boolean",value:!0}},Ds=function(){return{type:"boolean",value:!1}},Fn=function(){return"'"},yo=function(le){return{type:"string",value:le.join("")}},or=function(le,gt){return{type:"case-expression",format:"simple",operand:le,clauses:gt,else:null}},Ce=function(le,gt,$t){return{type:"case-expression",format:"simple",operand:le,clauses:gt,else:$t.value}},ze=function(le){return{type:"case-expression",format:"searched",clauses:le,else:null}},mt=function(le,gt){return{type:"case-expression",format:"searched",clauses:le,else:gt.value}},Ft=function(le,gt){return{type:"when-clause",operand:le,value:gt}},ni=function(le,gt){return{type:"when-clause",operand:le,value:gt}},bi=function(le){return{type:"else-clause",value:le}},Li=function(le){return{type:"number",value:le}},Yi=function(le,gt,$t){return parseFloat(le+gt+$t)},xr=function(le,gt){return parseFloat(le+gt)},Ar=function(le,gt){return parseFloat(le+gt)},Qr=function(le){return parseFloat(le)},ls=function(le,gt){return le[0]+gt},an=function(le){return"."+(le??"")},so=function(le,gt){return le+gt},Zs=function(le){return le.join("")},$l=function(le,gt){return"e"+(gt===null?"":gt)},za=function(){return"IN"},Ed=function(){return"IS"},Oe=function(){return"LIKE"},ui=function(){return"ESCAPE"},Zi=function(){return"NOT"},Or=function(){return"AND"},wn=function(){return"OR"},vo=function(){return"BETWEEN"},iu=function(){return"FROM"},Ol=function(){return"FOR"},jm=function(){return"SUBSTRING"},aT=function(){return"EXTRACT"},CX=function(){return"TRIM"},yL=function(){return"POSITION"},E7=function(){return"TIMESTAMP"},I7=function(){return"DATE"},vL=function(){return"TIME"},Qb=function(){return"LEADING"},PE=function(){return"TRAILING"},XEe=function(){return"BOTH"},pue=function(){return"CAST"},fue=function(){return"AS"},EX=function(){return"INTEGER"},mue=function(){return"SMALLINT"},gue=function(){return"FLOAT"},JEe=function(){return"REAL"},yue=function(){return"VARCHAR"},x_=function(){return"TO"},Tp=function(){return"INTERVAL"},KEe=function(){return"YEAR"},ZEe=function(){return"TIMEZONE_HOUR"},QEe=function(){return"TIMEZONE_MINUTE"},vue=function(){return"MONTH"},A7=function(){return"DAY"},_ue=function(){return"HOUR"},eIe=function(){return"MINUTE"},tIe=function(){return"SECOND"},IX=function(){return"CASE"},iIe=function(){return"END"},rIe=function(){return"WHEN"},nIe=function(){return"THEN"},sIe=function(){return"ELSE"},AX=function(le){return le},oIe=function(le){return le.join("")},We=0,Cr=0,_o=[{line:1,column:1}],Rg=0,Dg=[],rr=0;if("startRule"in s){if(!(s.startRule in u))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');c=u[s.startRule]}function MX(le,gt){throw aIe(le,gt=gt!==void 0?gt:OX(Cr,We))}function Ts(le,gt){return{type:"literal",text:le,ignoreCase:gt}}function M0(le,gt,$t){return{type:"class",parts:le,inverted:gt,ignoreCase:$t}}function ew(){return{type:"end"}}function _L(le){var gt,$t=_o[le];if($t)return $t;for(gt=le-1;!_o[gt];)gt--;for($t={line:($t=_o[gt]).line,column:$t.column};gtRg&&(Rg=We,Dg=[]),Dg.push(le))}function aIe(le,gt){return new e(le,null,null,gt)}function bue(le,gt,$t){return new e(e.buildMessage(le,gt),le,gt,$t)}function ka(){var le,gt;return le=We,Sr(),(gt=Mr())!==a?(Sr(),Cr=le,le=dn(gt)):(We=le,le=a),le}function wue(){var le,gt,$t,ci,es,Wl,Pu,Nh;if(le=We,(gt=Mr())!==a){for($t=[],ci=We,es=Sr(),(Wl=DE())!==a?(Pu=Sr(),(Nh=Mr())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(Wl=DE())!==a?(Pu=Sr(),(Nh=Mr())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Cr=le,le=Ir(gt,$t)}else We=le,le=a;return le}function Mr(){var le,gt,$t,ci,es,Wl,Pu,Nh;if(le=We,(gt=M7())!==a){for($t=[],ci=We,es=Sr(),(Wl=Fue())!==a?(Pu=Sr(),(Nh=M7())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(Wl=Fue())!==a?(Pu=Sr(),(Nh=M7())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Cr=le,le=$n(gt,$t)}else We=le,le=a;return le}function M7(){var le,gt,$t,ci,es,Wl,Pu,Nh;if(le=We,(gt=O7())!==a){for($t=[],ci=We,es=Sr(),(Wl=$7())!==a?(Pu=Sr(),(Nh=O7())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(Wl=$7())!==a?(Pu=Sr(),(Nh=O7())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Cr=le,le=fa(gt,$t)}else We=le,le=a;return le}function O7(){var le,gt,$t,ci,es;return le=We,(gt=t2())===a&&(gt=We,n.charCodeAt(We)===33?($t=h,We++):($t=a,rr===0&&En(Et)),$t!==a?(ci=We,rr++,n.charCodeAt(We)===61?(es=p,We++):(es=a,rr===0&&En(Ye)),rr--,es===a?ci=void 0:(We=ci,ci=a),ci!==a?gt=$t=[$t,ci]:(We=gt,gt=a)):(We=gt,gt=a)),gt!==a?($t=Sr(),(ci=O7())!==a?(Cr=le,le=Sa(ci)):(We=le,le=a)):(We=le,le=a),le===a&&(le=lIe()),le}function lIe(){var le,gt,$t;return le=We,(gt=tw())!==a?(Sr(),($t=uIe())===a&&($t=null),Cr=le,le=ma(gt,$t)):(We=le,le=a),le}function uIe(){var le;return(le=xue())===a&&(le=cIe())===a&&(le=PX())===a&&(le=Tue())===a&&(le=sn()),le}function xue(){var le,gt,$t,ci,es,Wl,Pu;if(le=We,gt=[],$t=We,ci=Sr(),(es=Sue())!==a?(Wl=Sr(),(Pu=tw())!==a?$t=ci=[ci,es,Wl,Pu]:(We=$t,$t=a)):(We=$t,$t=a),$t!==a)for(;$t!==a;)gt.push($t),$t=We,ci=Sr(),(es=Sue())!==a?(Wl=Sr(),(Pu=tw())!==a?$t=ci=[ci,es,Wl,Pu]:(We=$t,$t=a)):(We=$t,$t=a);else gt=a;return gt!==a&&(Cr=le,gt=go(gt)),le=gt}function Sue(){var le;return n.substr(We,2)===m?(le=m,We+=2):(le=a,rr===0&&En(jt)),le===a&&(n.charCodeAt(We)===62?(le=v,We++):(le=a,rr===0&&En(ei)),le===a&&(n.substr(We,2)===w?(le=w,We+=2):(le=a,rr===0&&En(Xt)),le===a&&(n.substr(We,2)===S?(le=S,We+=2):(le=a,rr===0&&En(wi)),le===a&&(n.charCodeAt(We)===60?(le=I,We++):(le=a,rr===0&&En(pi)),le===a&&(n.charCodeAt(We)===61?(le=p,We++):(le=a,rr===0&&En(Ye)),le===a&&(n.substr(We,2)===R?(le=R,We+=2):(le=a,rr===0&&En(Ri)))))))),le}function Tue(){var le,gt,$t,ci;return le=We,(gt=N7())!==a?(Sr(),($t=t2())!==a?(Sr(),(ci=tw())!==a?(Cr=le,le=tu(gt,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=N7())!==a?(Sr(),($t=tw())!==a?(Cr=le,le=Uu(gt,$t)):(We=le,le=a)):(We=le,le=a)),le}function PX(){var le,gt,$t,ci,es,Wl;return le=We,(gt=t2())!==a?(Sr(),($t=WX())!==a?(Sr(),(ci=tw())!==a?(Sr(),(es=$7())!==a?(Sr(),(Wl=tw())!==a?(Cr=le,le=pc($t,ci,Wl)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=WX())!==a?(Sr(),($t=tw())!==a?(Sr(),(ci=$7())!==a?(Sr(),(es=tw())!==a?(Cr=le,le=Fh(gt,$t,es)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function RX(){var le,gt,$t,ci,es;return le=We,gt=We,($t=t2())!==a?(ci=Sr(),(es=Due())!==a?gt=$t=[$t,ci,es]:(We=gt,gt=a)):(We=gt,gt=a),gt!==a&&(Cr=le,gt=Zr(gt)),(le=gt)===a&&(le=Due()),le}function DX(){var le,gt,$t,ci,es;return le=We,gt=We,($t=t2())!==a?(ci=Sr(),(es=HX())!==a?gt=$t=[$t,ci,es]:(We=gt,gt=a)):(We=gt,gt=a),gt!==a&&(Cr=le,gt=Ps(gt)),(le=gt)===a&&(le=HX()),le}function sn(){var le,gt,$t,ci;return le=We,(gt=RX())!==a?(Sr(),($t=cM())!==a?(Sr(),EIe()!==a?(Sr(),(ci=GX())!==a?(Cr=le,le=ca(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=RX())!==a?(Sr(),($t=cM())!==a?(Cr=le,le=Ou(gt,$t)):(We=le,le=a)):(We=le,le=a)),le}function cIe(){var le,gt,$t,ci;return le=We,(gt=DX())!==a?(Sr(),($t=Bf())!==a?(Sr(),(ci=wue())!==a?(Sr(),Gm()!==a?(Cr=le,le=Za(gt,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=DX())!==a?(Sr(),($t=Bf())!==a?(Sr(),(ci=Gm())!==a?(Cr=le,le=kh(gt)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=DX())!==a?(Sr(),($t=F7())!==a?(Cr=le,le=Qv(gt,$t)):(We=le,le=a)):(We=le,le=a))),le}function tw(){var le,gt,$t,ci,es,Wl,Pu,Nh;if(le=We,(gt=iw())!==a){for($t=[],ci=We,es=Sr(),(Wl=FX())!==a?(Pu=Sr(),(Nh=iw())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(Wl=FX())!==a?(Pu=Sr(),(Nh=iw())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Cr=le,le=_y(gt,$t)}else We=le,le=a;return le}function FX(){var le;return n.charCodeAt(We)===43?(le=L,We++):(le=a,rr===0&&En(Ui)),le===a&&(n.charCodeAt(We)===45?(le=k,We++):(le=a,rr===0&&En(Bi)),le===a&&(n.substr(We,2)===B?(le=B,We+=2):(le=a,rr===0&&En(mi)))),le}function iw(){var le,gt,$t,ci,es,Wl,Pu,Nh;if(le=We,(gt=bL())!==a){for($t=[],ci=We,es=Sr(),(Wl=Cue())!==a?(Pu=Sr(),(Nh=bL())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(Wl=Cue())!==a?(Pu=Sr(),(Nh=bL())!==a?ci=es=[es,Wl,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Cr=le,le=I0(gt,$t)}else We=le,le=a;return le}function Cue(){var le;return n.charCodeAt(We)===42?(le=$,We++):(le=a,rr===0&&En(ar)),le===a&&(n.charCodeAt(We)===47?(le=V,We++):(le=a,rr===0&&En(z))),le}function bL(){var le,gt;return(le=rf())===a&&(le=LX())===a&&(le=fIe())===a&&(le=mIe())===a&&(le=Fg())===a&&(le=NX())===a&&(le=Id())===a&&(le=L7())===a&&(le=wL())===a&&(le=F7())===a&&(le=We,Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Gm()!==a?(Cr=le,le=e1(gt)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function wL(){var le,gt;return le=We,(gt=hIe())!==a&&(Cr=le,gt=Nl(gt)),(le=gt)===a&&(le=We,(gt=R7())!==a&&(Cr=le,gt=Sp(gt)),le=gt),le}function hIe(){var le,gt;return le=We,(gt=dIe())!==a&&(Cr=le,gt=Ml(gt)),le=gt}function dIe(){var le,gt,$t,ci;if(le=We,(gt=kX())!==a){for($t=[],ci=Eue();ci!==a;)$t.push(ci),ci=Eue();Cr=le,le=Og(gt,$t)}else We=le,le=a;return le}function P7(){var le,gt,$t,ci;if(le=We,(gt=kX())!==a){for($t=[],ci=bo();ci!==a;)$t.push(ci),ci=bo();Cr=le,le=Xc(gt,$t)}else We=le,le=a;return le}function kX(){var le;return N.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Wi)),le}function bo(){var le;return j.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Fr)),le}function Eue(){var le;return W.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(ds)),le}function R7(){var le,gt;return le=We,D7()!==a?(gt=Iue(),D7()!==a?(Cr=le,le=Bm(gt)):(We=le,le=a)):(We=le,le=a),le}function Iue(){var le,gt,$t;for(le=We,gt=[],$t=Aue();$t!==a;)gt.push($t),$t=Aue();return Cr=le,le=gt=by(gt)}function Aue(){var le;return(le=Mue())===a&&(le=pIe()),le}function pIe(){var le;return le=We,D7()!==a&&D7()!==a?(Cr=le,le=A0()):(We=le,le=a),le}function Mue(){var le;return W.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(ds)),le}function D7(){var le;return q.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Dt)),le}function F7(){var le,gt,$t,ci;return le=We,gt=We,n.charCodeAt(We)===64?($t=Y,We++):($t=a,rr===0&&En(Mn)),$t!==a&&(ci=P7())!==a?gt=$t=[$t,ci]:(We=gt,gt=a),gt!==a&&(Cr=le,gt=Nf(gt)),le=gt}function LX(){var le,gt,$t;return le=We,IIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=gIe())!==a?(Sr(),qX()!==a?(Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Cr=le,le=Pg(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function fIe(){var le,gt,$t,ci,es,Wl,Pu;return le=We,YX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),qX()!==a?(Sr(),($t=Mr())!==a?(Sr(),ci=We,(es=kue())!==a?(Wl=Sr(),(Pu=Mr())!==a?ci=es=[es,Wl,Pu,Sr()]:(We=ci,ci=a)):(We=ci,ci=a),ci===a&&(ci=null),(es=Gm())!==a?(Cr=le,le=Kd(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function NX(){var le,gt,$t;return le=We,PIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),RIe()!==a?(Sr(),($t=lT())!==a?(Sr(),Gm()!==a?(Cr=le,le=$f(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function lT(){var le,gt,$t;return le=We,(gt=Bue())!==a&&(Cr=le,gt=Jc()),(le=gt)===a&&(le=We,(gt=DIe())!==a&&(Cr=le,gt=t1()),(le=gt)===a&&(le=We,(gt=FIe())!==a&&(Cr=le,gt=hh()),(le=gt)===a&&(le=We,(gt=jue())!==a&&(Cr=le,gt=Lh()),(le=gt)===a&&(le=We,(gt=CL())!==a&&(Cr=le,gt=fc()),(le=gt)===a&&(le=We,(gt=Lue())!==a&&(Cr=le,gt=rn()),(le=gt)===a&&(le=We,(gt=Nue())!==a&&(Cr=le,gt=Qa()),(le=gt)===a&&(le=We,(gt=Va())!==a?(Sr(),Bf()!==a?(Sr(),($t=pM())!==a?(Sr(),Gm()!==a?(Cr=le,le=wy($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)))))))),le}function mIe(){var le,gt,$t,ci;return le=We,XX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=RE())===a&&(gt=null),Sr(),($t=Mr())!==a?(Sr(),qX()!==a?(Sr(),(ci=Mr())!==a?(Sr(),Gm()!==a?(Cr=le,le=ve(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,XX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=RE())===a&&(gt=null),Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Cr=le,le=oe(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function RE(){var le;return(le=$ue())===a&&(le=MIe())===a&&(le=OIe()),le}function Fg(){var le,gt,$t;return le=We,AIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),HX()!==a?(Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Cr=le,le=ce(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function Id(){var le,gt,$t;return le=We,(gt=NIe())!==a?(Sr(),Bf()!==a?(Sr(),($t=wue())===a&&($t=null),Sr(),Gm()!==a?(Cr=le,le=we(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function gIe(){var le;return(le=B7())===a&&(le=KX())===a&&(le=kg())===a&&(le=EL())===a&&(le=nD())===a&&(le=i2())===a&&(le=LIe())===a&&(le=fM()),le}function rf(){var le;return(le=GX())===a&&(le=SIe())===a&&(le=wIe())===a&&(le=bIe())===a&&(le=_Ie())===a&&(le=yIe())===a&&(le=xL())===a&&(le=$X()),le}function yIe(){var le,gt;return le=We,Lue()!==a?(Sr(),(gt=cM())!==a?(Cr=le,le=He(gt)):(We=le,le=a)):(We=le,le=a),le}function $X(){var le,gt;return le=We,Nue()!==a?(Sr(),(gt=cM())!==a?(Cr=le,le=St(gt)):(We=le,le=a)):(We=le,le=a),le}function xL(){var le,gt,$t,ci;return le=We,JX()!==a?(Sr(),n.charCodeAt(We)===45?(gt=k,We++):(gt=a,rr===0&&En(Bi)),gt===a&&(n.charCodeAt(We)===43?(gt=L,We++):(gt=a,rr===0&&En(Ui))),gt!==a?(Sr(),($t=cM())!==a?(Sr(),(ci=BX())!==a?(Cr=le,le=ut(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,JX()!==a?(Sr(),(gt=cM())!==a?(Sr(),($t=BX())!==a?(Cr=le,le=Bt(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function BX(){var le,gt,$t;return le=We,(gt=Oue())!==a?(Sr(),kIe()!==a?(Sr(),($t=jX())!==a?(Cr=le,le=Ge(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=vIe()),le}function Oue(){var le,gt,$t;return le=We,(gt=iD())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),Gm()!==a?(Cr=le,le=et(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=iD())!==a&&(Cr=le,gt=zt(gt)),le=gt),le}function jX(){var le,gt,$t,ci;return le=We,(gt=iD())!==a&&(Cr=le,gt=ii(gt)),(le=gt)===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),DE()!==a?(Sr(),(ci=k7())!==a?(Sr(),Gm()!==a?(Cr=le,le=te($t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),Gm()!==a?(Cr=le,le=xe($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a&&(Cr=le,gt=Ae()),le=gt))),le}function vIe(){var le,gt,$t,ci;return le=We,(gt=iD())!==a?(Sr(),Bf()!==a?(Sr(),($t=k7())!==a?(Sr(),Gm()!==a?(Cr=le,le=lt(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=iD())!==a&&(Cr=le,gt=nt(gt)),(le=gt)===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),DE()!==a?(Sr(),(ci=k7())!==a?(Sr(),Gm()!==a?(Cr=le,le=It($t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=k7())!==a?(Sr(),Gm()!==a?(Cr=le,le=Nt($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a&&(Cr=le,gt=Ut()),le=gt)))),le}function iD(){var le,gt;return le=We,(gt=kg())!==a&&(Cr=le,gt=Jt()),(le=gt)===a&&(le=We,(gt=EL())!==a&&(Cr=le,gt=xi()),(le=gt)===a&&(le=We,(gt=nD())!==a&&(Cr=le,gt=Di()),(le=gt)===a&&(le=We,(gt=KX())!==a&&(Cr=le,gt=ki()),(le=gt)===a&&(le=We,(gt=B7())!==a&&(Cr=le,gt=ir()),le=gt)))),le}function k7(){var le,gt;return le=We,(gt=pM())!==a&&(Cr=le,gt=$r(gt)),le=gt}function rD(){var le,gt;return le=We,(gt=pM())!==a&&(Cr=le,gt=mn(gt)),le=gt}function _Ie(){var le,gt;return le=We,CL()!==a?(Sr(),(gt=cM())!==a?(Cr=le,le=Kr(gt)):(We=le,le=a)):(We=le,le=a),le}function bIe(){var le,gt;return le=We,(gt=TIe())!==a&&(Cr=le,gt=xn()),le=gt}function wIe(){var le,gt;return le=We,(gt=e2())!==a&&(Cr=le,gt=Gn()),(le=gt)===a&&(le=We,(gt=CIe())!==a&&(Cr=le,gt=Ds()),le=gt),le}function cM(){var le;return(le=GX())===a&&(le=F7()),le}function GX(){var le,gt,$t,ci,es;if(le=We,n.charCodeAt(We)===39?(gt=K,We++):(gt=a,rr===0&&En(yn)),gt===a&&(n.substr(We,2)===Q?(gt=Q,We+=2):(gt=a,rr===0&&En(Pt))),gt!==a){for($t=[],ci=We,n.substr(We,2)===re?(es=re,We+=2):(es=a,rr===0&&En(Un)),es!==a&&(Cr=ci,es=Fn()),(ci=es)===a&&(J.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(Qi)));ci!==a;)$t.push(ci),ci=We,n.substr(We,2)===re?(es=re,We+=2):(es=a,rr===0&&En(Un)),es!==a&&(Cr=ci,es=Fn()),(ci=es)===a&&(J.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(Qi)));n.charCodeAt(We)===39?(ci=K,We++):(ci=a,rr===0&&En(yn)),ci!==a?(Cr=le,le=yo($t)):(We=le,le=a)}else We=le,le=a;return le}function L7(){var le;return(le=UX())===a&&(le=xIe()),le}function UX(){var le,gt,$t,ci,es;if(le=We,IL()!==a)if(Sr(),(gt=Mr())!==a){for(Sr(),$t=[],ci=dM();ci!==a;)$t.push(ci),ci=dM();ci=Sr(),(es=j7())!==a?(Cr=le,le=or(gt,$t)):(We=le,le=a)}else We=le,le=a;else We=le,le=a;if(le===a)if(le=We,IL()!==a)if(Sr(),(gt=Mr())!==a){for(Sr(),$t=[],ci=dM();ci!==a;)$t.push(ci),ci=dM();ci=Sr(),(es=SL())!==a?(Sr(),j7()!==a?(Cr=le,le=Ce(gt,$t,es)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;else We=le,le=a;return le}function xIe(){var le,gt,$t,ci;if(le=We,IL()!==a){for(Sr(),gt=[],$t=hM();$t!==a;)gt.push($t),$t=hM();$t=Sr(),(ci=j7())!==a?(Cr=le,le=ze(gt)):(We=le,le=a)}else We=le,le=a;if(le===a)if(le=We,IL()!==a){for(Sr(),gt=[],$t=hM();$t!==a;)gt.push($t),$t=hM();$t=Sr(),(ci=SL())!==a?(Sr(),j7()!==a?(Cr=le,le=mt(gt,ci)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;return le}function hM(){var le,gt,$t;return le=We,Gue()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Uue()!==a?(Sr(),($t=Mr())!==a?(Cr=le,le=Ft(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function dM(){var le,gt,$t;return le=We,Gue()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Uue()!==a?(Sr(),($t=Mr())!==a?(Cr=le,le=ni(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function SL(){var le,gt;return le=We,G7()!==a?(Sr(),(gt=Mr())!==a?(Cr=le,le=bi(gt)):(We=le,le=a)):(We=le,le=a),le}function SIe(){var le,gt,$t,ci;return le=We,(gt=zX())!==a?($t=We,rr++,ci=kX(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Li(gt)):(We=le,le=a)):(We=le,le=a),le}function zX(){var le,gt,$t,ci;return le=We,(gt=TL())!==a&&($t=Pue())!==a&&(ci=Rue())!==a?(Cr=le,le=Yi(gt,$t,ci)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&($t=Pue())!==a?(Cr=le,le=xr(gt,$t)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&($t=Rue())!==a?(Cr=le,le=Ar(gt,$t)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&(Cr=le,gt=Qr(gt)),le=gt))),le}function TL(){var le,gt,$t;return(le=pM())===a&&(le=We,n.charCodeAt(We)===45?(gt=k,We++):(gt=a,rr===0&&En(Bi)),gt===a&&(n.charCodeAt(We)===43?(gt=L,We++):(gt=a,rr===0&&En(Ui))),gt!==a&&($t=pM())!==a?(Cr=le,le=ls(gt,$t)):(We=le,le=a)),le}function Pue(){var le,gt,$t;return le=We,n.charCodeAt(We)===46?(gt=ne,We++):(gt=a,rr===0&&En(Tn)),gt!==a?(($t=pM())===a&&($t=null),Cr=le,le=an($t)):(We=le,le=a),le}function Rue(){var le,gt,$t;return le=We,(gt=S_())!==a&&($t=pM())!==a?(Cr=le,le=so(gt,$t)):(We=le,le=a),le}function pM(){var le,gt,$t;if(le=We,gt=[],($t=VX())!==a)for(;$t!==a;)gt.push($t),$t=VX();else gt=a;return gt!==a&&(Cr=le,gt=Zs(gt)),le=gt}function VX(){var le;return ee.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(bs)),le}function S_(){var le,gt,$t;return le=We,he.test(n.charAt(We))?(gt=n.charAt(We),We++):(gt=a,rr===0&&En(qn)),gt!==a?(Ee.test(n.charAt(We))?($t=n.charAt(We),We++):($t=a,rr===0&&En(ko)),$t===a&&($t=null),Cr=le,le=$l(gt,$t)):(We=le,le=a),le}function TIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===de?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ai)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function e2(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===pe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Al)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function CIe(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===H?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(eu)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function HX(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Z?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(Ma)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=za()):(We=le,le=a)):(We=le,le=a),le}function N7(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===ae?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(_n)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Ed()):(We=le,le=a)):(We=le,le=a),le}function Due(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===fe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Ss)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Oe()):(We=le,le=a)):(We=le,le=a),le}function EIe(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===be?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(la)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=ui()):(We=le,le=a)):(We=le,le=a),le}function t2(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===_e?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(gi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Zi()):(We=le,le=a)):(We=le,le=a),le}function $7(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===Ie?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(lr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Or()):(We=le,le=a)):(We=le,le=a),le}function Fue(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Te?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(Rr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=wn()):(We=le,le=a)):(We=le,le=a),le}function WX(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===Be?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Os)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=vo()):(We=le,le=a)):(We=le,le=a),le}function qX(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Ve?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Js)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=iu()):(We=le,le=a)):(We=le,le=a),le}function kue(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===$e?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(vs)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Ol()):(We=le,le=a)):(We=le,le=a),le}function YX(){var le,gt,$t,ci;return le=We,n.substr(We,9).toLowerCase()===tt?(gt=n.substr(We,9),We+=9):(gt=a,rr===0&&En(na)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=jm()):(We=le,le=a)):(We=le,le=a),le}function IIe(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===yt?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(gl)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=aT()):(We=le,le=a)):(We=le,le=a),le}function XX(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Ct?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(fn)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=CX()):(We=le,le=a)):(We=le,le=a),le}function AIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===ot?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(qr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=yL()):(We=le,le=a)):(We=le,le=a),le}function Lue(){var le,gt,$t,ci;return le=We,n.substr(We,9).toLowerCase()===vt?(gt=n.substr(We,9),We+=9):(gt=a,rr===0&&En(Gu)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=E7()):(We=le,le=a)):(We=le,le=a),le}function CL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===At?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(dc)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=I7()):(We=le,le=a)):(We=le,le=a),le}function Nue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Je?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Re)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=vL()):(We=le,le=a)):(We=le,le=a),le}function $ue(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===it?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Ne)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Qb()):(We=le,le=a)):(We=le,le=a),le}function MIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===Ue?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(dt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=PE()):(We=le,le=a)):(We=le,le=a),le}function OIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===ct?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Gt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=XEe()):(We=le,le=a)):(We=le,le=a),le}function PIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===st?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ti)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=pue()):(We=le,le=a)):(We=le,le=a),le}function RIe(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Ze?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(oi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=fue()):(We=le,le=a)):(We=le,le=a),le}function Bue(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===ye?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Hi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=EX()):(We=le,le=a)):(We=le,le=a),le}function DIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===Ke?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(Oi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=mue()):(We=le,le=a)):(We=le,le=a),le}function FIe(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===ke?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(kt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=gue()):(We=le,le=a)):(We=le,le=a),le}function jue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===me?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Xe)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=JEe()):(We=le,le=a)):(We=le,le=a),le}function Va(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===ie?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Le)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=yue()):(We=le,le=a)):(We=le,le=a),le}function kIe(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===ge?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(xt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=x_()):(We=le,le=a)):(We=le,le=a),le}function JX(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===je?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(Zt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=Tp()):(We=le,le=a)):(We=le,le=a),le}function B7(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===rt?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Rt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=KEe()):(We=le,le=a)):(We=le,le=a),le}function LIe(){var le,gt,$t,ci;return le=We,n.substr(We,13).toLowerCase()===Me?(gt=n.substr(We,13),We+=13):(gt=a,rr===0&&En(fi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=ZEe()):(We=le,le=a)):(We=le,le=a),le}function fM(){var le,gt,$t,ci;return le=We,n.substr(We,15).toLowerCase()===ht?(gt=n.substr(We,15),We+=15):(gt=a,rr===0&&En(Fi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=QEe()):(We=le,le=a)):(We=le,le=a),le}function KX(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===Ht?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(mr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=vue()):(We=le,le=a)):(We=le,le=a),le}function kg(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===_t?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(yr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=A7()):(We=le,le=a)):(We=le,le=a),le}function EL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Fe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Gr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=_ue()):(We=le,le=a)):(We=le,le=a),le}function nD(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===Yt?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(zr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=eIe()):(We=le,le=a)):(We=le,le=a),le}function i2(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===A?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(jn)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=tIe()):(We=le,le=a)):(We=le,le=a),le}function IL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===ue?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(co)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=IX()):(We=le,le=a)):(We=le,le=a),le}function j7(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===G?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(ua)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=iIe()):(We=le,le=a)):(We=le,le=a),le}function Gue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===E?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Hs)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=rIe()):(We=le,le=a)):(We=le,le=a),le}function Uue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===_?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Ll)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=nIe()):(We=le,le=a)):(We=le,le=a),le}function G7(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===g?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ft)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Cr=le,le=sIe()):(We=le,le=a)):(We=le,le=a),le}function DE(){var le;return n.charCodeAt(We)===44?(le=b,We++):(le=a,rr===0&&En(Wt)),le}function Bf(){var le;return n.charCodeAt(We)===40?(le=C,We++):(le=a,rr===0&&En(hi)),le}function Gm(){var le;return n.charCodeAt(We)===41?(le=O,We++):(le=a,rr===0&&En(Pi)),le}function Sr(){var le,gt;for(le=[],gt=U7();gt!==a;)le.push(gt),gt=U7();return le}function U7(){var le;return De.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(vr)),le}function NIe(){var le,gt,$t,ci;if(le=We,(gt=P7())!==a&&(Cr=le,gt=AX(gt)),(le=gt)===a)if(le=We,n.charCodeAt(We)===96?(gt=F,We++):(gt=a,rr===0&&En(Lr)),gt!==a){if($t=[],pt.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(on)),ci!==a)for(;ci!==a;)$t.push(ci),pt.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(on));else $t=a;$t!==a?(n.charCodeAt(We)===96?(ci=F,We++):(ci=a,rr===0&&En(Lr)),ci!==a?(Cr=le,le=oIe($t)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;return le}function zue(le,gt){return{type:"unary-expression",operator:le,expr:gt}}function Vue(le,gt,$t,ci){var es={type:"binary-expression",operator:le,left:gt,right:$t};return ci!==void 0&&(es.escape=ci),es}function $Ie(le,gt){for(var $t=[le],ci=0;ci"u")return this;if(typeof fe=="string"||s.Color.isRgb(fe)||fe&&typeof fe.fill=="function")this.attr(H,fe);else for(Z=c[H].length-1;Z>=0;Z--)fe[c[H][Z]]!=null&&this.attr(c.prefix(H,c[H][Z]),fe[c[H][Z]]);return this},s.extend(s.Element,s.FX,ae)}),s.extend(s.Element,s.FX,{rotate:function(H,Z,ae){return this.transform({rotation:H,cx:Z,cy:ae})},skew:function(H,Z,ae,fe){return arguments.length==1||arguments.length==3?this.transform({skew:H,cx:Z,cy:ae}):this.transform({skewX:H,skewY:Z,cx:ae,cy:fe})},scale:function(H,Z,ae,fe){return arguments.length==1||arguments.length==3?this.transform({scale:H,cx:Z,cy:ae}):this.transform({scaleX:H,scaleY:Z,cx:ae,cy:fe})},translate:function(H,Z){return this.transform({x:H,y:Z})},flip:function(H,Z){return Z=typeof H=="number"?H:Z,this.transform({flip:H||"both",offset:Z})},matrix:function(H){return this.attr("transform",new s.Matrix(arguments.length==6?[].slice.call(arguments):H))},opacity:function(H){return this.attr("opacity",H)},dx:function(H){return this.x(new s.Number(H).plus(this instanceof s.FX?0:this.x()),!0)},dy:function(H){return this.y(new s.Number(H).plus(this instanceof s.FX?0:this.y()),!0)},dmove:function(H,Z){return this.dx(H).dy(Z)}}),s.extend(s.Rect,s.Ellipse,s.Circle,s.Gradient,s.FX,{radius:function(H,Z){var ae=(this._target||this).type;return ae=="radial"||ae=="circle"?this.attr("r",new s.Number(H)):this.rx(H).ry(Z??H)}}),s.extend(s.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(H){return this.node.getPointAtLength(H)}}),s.extend(s.Parent,s.Text,s.Tspan,s.FX,{font:function(H,Z){if(typeof H=="object")for(Z in H)this.font(Z,H[Z]);return H=="leading"?this.leading(Z):H=="anchor"?this.attr("text-anchor",Z):H=="size"||H=="family"||H=="weight"||H=="stretch"||H=="variant"||H=="style"?this.attr("font-"+H,Z):this.attr(H,Z)}}),s.Set=s.invent({create:function(H){H instanceof s.Set?this.members=H.members.slice():Array.isArray(H)?this.members=H:this.clear()},extend:{add:function(){var H,Z,ae=[].slice.call(arguments);for(H=0,Z=ae.length;H-1&&this.members.splice(Z,1),this},each:function(H){for(var Z=0,ae=this.members.length;Z=0},index:function(H){return this.members.indexOf(H)},get:function(H){return this.members[H]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new s.RBox;var H=this.members[0].rbox(this.members[0].doc());return this.each(function(){H=H.merge(this.rbox(this.doc()))}),H}},construct:{set:function(H){return new s.Set(H)}}}),s.FX.Set=s.invent({create:function(H){this.set=H}}),s.Set.inherit=function(){var H,Z=[];for(var H in s.Shape.prototype)typeof s.Shape.prototype[H]=="function"&&typeof s.Set.prototype[H]!="function"&&Z.push(H);Z.forEach(function(ae){s.Set.prototype[ae]=function(){for(var fe=0,be=this.members.length;fe=0;H--)delete this.memory()[arguments[H]];return this},memory:function(){return this._memory||(this._memory={})}}),s.get=function(H){var Z=r.getElementById(re(H)||H);return s.adopt(Z)},s.select=function(H,Z){return new s.Set(s.utils.map((Z||r).querySelectorAll(H),function(ae){return s.adopt(ae)}))},s.extend(s.Parent,{select:function(H){return s.select(H,this.node)}});function h(H,Z,ae,fe){return ae+fe.replace(s.regex.dots," .")}function p(H){for(var Z=H.slice(0),ae=Z.length;ae--;)Array.isArray(Z[ae])&&(Z[ae]=p(Z[ae]));return Z}function m(H,Z){return H instanceof Z}function v(H,Z){return(H.matches||H.matchesSelector||H.msMatchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector).call(H,Z)}function w(H){return H.toLowerCase().replace(/-(.)/g,function(Z,ae){return ae.toUpperCase()})}function S(H){return H.charAt(0).toUpperCase()+H.slice(1)}function I(H){return H.length==4?["#",H.substring(1,2),H.substring(1,2),H.substring(2,3),H.substring(2,3),H.substring(3,4),H.substring(3,4)].join(""):H}function R(H){var Z=H.toString(16);return Z.length==1?"0"+Z:Z}function L(H,Z,ae){if(Z==null||ae==null){var fe=H.bbox();Z==null?Z=fe.width/fe.height*ae:ae==null&&(ae=fe.height/fe.width*Z)}return{width:Z,height:ae}}function k(H,Z,ae){return{x:Z*H.a+ae*H.c+0,y:Z*H.b+ae*H.d+0}}function B(H){return{a:H[0],b:H[1],c:H[2],d:H[3],e:H[4],f:H[5]}}function $(H){return H instanceof s.Matrix||(H=new s.Matrix(H)),H}function V(H,Z){H.cx=H.cx==null?Z.bbox().cx:H.cx,H.cy=H.cy==null?Z.bbox().cy:H.cy}function Y(H){for(var Z=0,ae=H.length,fe="";Z=0;Z--)H.childNodes[Z]instanceof t.SVGElement&&K(H.childNodes[Z]);return s.adopt(H).id(s.eid(H.nodeName))}function Q(H){return H.x==null&&(H.x=0,H.y=0,H.width=0,H.height=0),H.w=H.width,H.h=H.height,H.x2=H.x+H.width,H.y2=H.y+H.height,H.cx=H.x+H.width/2,H.cy=H.y+H.height/2,H}function re(H){var Z=(H||"").toString().match(s.regex.reference);if(Z)return Z[1]}function ne(H){return Math.abs(H)>1e-37?H:0}var de="abcdef".split("");if(typeof t.CustomEvent!="function"){var pe=function(H,Z){Z=Z||{bubbles:!1,cancelable:!1,detail:void 0};var ae=r.createEvent("CustomEvent");return ae.initCustomEvent(H,Z.bubbles,Z.cancelable,Z.detail),ae};pe.prototype=t.Event.prototype,s.CustomEvent=pe}else s.CustomEvent=t.CustomEvent;return function(H){for(var Z=0,ae=["moz","webkit"],fe=0;fe{const o={name:n,image:s,svgcode:""};return e(s).then(a=>{o.svgcode=a}),o})}listToIconSymbology(e){return this.listToSymbology(this.renderSymbologyIcon,e)}listToImageSymbology(e){return this.listToSymbology(this.renderSymbologyImage,e)}async renderSymbologyImage(e,t=null){t===null&&(t=Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,0,0));const r=await this.$iApi.geo.shared.convertImagetoDataURL(e);if(r===e)return"";const{loader:n}=await this.svgDrawImage(t,r);return t.viewbox(0,0,n.width,n.height),t.svg()}async renderSymbologyIcon(e,t=null){if(t===null){const s=window.document.createElement("div");s.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),window.document.body.appendChild(s),t=Tj(s).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE)}const r=await this.$iApi.geo.shared.convertImagetoDataURL(e),{image:n}=await this.svgDrawImage(t,r);return n.center(this.CONTAINER_CENTER,this.CONTAINER_CENTER),this.fitInto(n,this.CONTENT_IMAGE_SIZE),t.svg()}generatePlaceholderSymbology(e,t="#000"){const r=Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE);return r.rect(this.CONTENT_IMAGE_SIZE,this.CONTENT_IMAGE_SIZE).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).fill(t),r.text(e[0].toUpperCase()).size(23).fill("#fff").attr({"font-weight":"bold","font-family":"Roboto"}).center(this.CONTAINER_CENTER,this.CONTAINER_CENTER).tspan(e[0].toUpperCase()).addClass("grid-icons").attr({dy:"29.900000000000002",x:"7.6875"}),{name:e,svgcode:r.svg()}}async generateBlankSymbology(){return Tj(window.document.createElement("div")).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).svg()}async symbolToSvg(e){const t=this,r=1.33333,n=window.document.createElement("div");n.setAttribute("style","opacity:0;position:fixed;left:100%;top:100%;overflow:hidden"),window.document.body.appendChild(n);const s=Tj(n).size(this.CONTAINER_SIZE,this.CONTAINER_SIZE).viewbox(0,0,this.CONTAINER_SIZE,this.CONTAINER_SIZE),o={path({size:v,path:w}){return s.path(w).size(v*r)},circle({size:v}){return s.circle(v*r)},cross({size:v}){return s.path("M 0,10 L 20,10 M 10,0 L 10,20").size(v*r)},x({size:v}){return s.path("M 0,0 L 20,20 M 20,0 L 0,20").size(v*r)},triangle({size:v}){return s.path("M 20,20 L 10,0 0,20 Z").size(v*r)},diamond({size:v}){return s.path("M 20,10 L 10,0 0,10 10,20 Z").size(v*r)},square({size:v}){return s.path("M 0,0 20,0 20,20 0,20 Z").size(v*r)}},a={[K_.SOLID]:"none",[K_.NONE]:"none",[K_.DASH]:"5.333,4",[K_.DOT]:"1.333,4",[K_.DASHDOT]:"5.333,4,1.333,4",[K_.LONGDASH]:"10.666,4",[K_.LONGDASHDOT]:"10.666,4,1.333,4",[K_.LONGDASHDOTDOT]:"10.666,4,1.333,4,1.333,4",[K_.SHORTDOT]:"1.333,1.333",[K_.SHORTDASH]:"5.333,1.333",[K_.SHORTDASHDOT]:"5.333,1.333,1.333,1.333",[K_.SHORTDASHDOTDOT]:"5.333,1.333,1.333,1.333,1.333,1.333"},l={color:"#000",opacity:1,width:1,linecap:"square",linejoin:"miter",miterlimit:4},u={color:[0,0,0,0],width:0,style:a.none},c={solid:v=>({color:v.colour,opacity:v.opacity}),none:()=>"transparent",horizontal:(v,w)=>s.pattern(5,5,I=>I.line(0,5/2,5,5/2)).stroke(w),vertical:(v,w)=>s.pattern(5,5,I=>I.line(5/2,0,5/2,5)).stroke(w),"forward-diagonal":(v,w)=>s.pattern(5,5,I=>{I.line(0,0,5,5).stroke(w),I.line(0,0,5,5).move(0,5).stroke(w),I.line(0,0,5,5).move(5,0).stroke(w)}),"backward-diagonal":(v,w)=>s.pattern(5,5,I=>{I.line(5,0,0,5).stroke(w),I.line(5,0,0,5).move(5/2,5/2).stroke(w),I.line(5,0,0,5).move(-5/2,-5/2).stroke(w)}),cross:(v,w)=>s.pattern(5,5,I=>{I.line(5/2,0,5/2,5).stroke(w),I.line(0,5/2,5,5/2).stroke(w)}),"diagonal-cross":(v,w)=>s.pattern(7,7,I=>{I.line(0,0,7,7).stroke(w),I.line(7,0,0,7).stroke(w)})},h={"simple-marker"(){const v=m(e.color);e.outline=e.outline||u;const w=m(e.outline.color),S=p({color:w.colour,opacity:w.opacity,width:e.outline.width,dasharray:a[e.outline.style]}),I=o[e.style](e).fill({color:v.colour,opacity:v.opacity}).stroke(S).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).rotate(e.angle||0);t.fitInto(I,t.CONTENT_SIZE)},"simple-line"(){const v=m(e.color),w=p({color:v.colour,opacity:v.opacity,width:e.width,linecap:"butt",dasharray:a[e.style]}),S=t.CONTENT_PADDING,I=t.CONTAINER_SIZE-t.CONTENT_PADDING;s.line(S,S,I,I).stroke(w)},esriCLS(){this["simple-line"]()},"simple-fill"(){const v=m(e.color),w=p({color:v.colour,opacity:v.opacity}),S=c[e.style](v,w);e.outline=e.outline||u;const I=m(e.outline.color),R=p({color:I.colour,opacity:I.opacity,width:e.outline.width,linecap:"butt",dasharray:a[e.outline.style]});s.rect(t.CONTENT_SIZE,t.CONTENT_SIZE).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).fill(S).stroke(R)},text(){console.error("no support for feature service legend of text symbols")},"picture-fill"(){const v=e.imageData?`data:${e.contentType};base64,${e.imageData}`:e.url,w=e.width*e.xscale,S=e.height*e.yscale;e.outline=e.outline||u;const I=m(e.outline.color),R=p({color:I.colour,opacity:I.opacity,width:e.outline.width,dasharray:a[e.outline.style]});return t.$iApi.geo.shared.convertImagetoDataURL(v).then(k=>{const B=s.pattern(w,S,$=>$.image(k,w,S));s.rect(t.CONTENT_SIZE,t.CONTENT_SIZE).center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).fill(B).stroke(R)})},"picture-marker"(){const v=e.source,w=v&&v.imageData?`data:${v.contentType};base64,${v.imageData}`:e.url;return t.$iApi.geo.shared.convertImagetoDataURL(w).then(I=>t.svgDrawImage(s,I)).then(({image:I})=>{I.center(t.CONTAINER_CENTER,t.CONTAINER_CENTER).rotate(e.angle||0),t.fitInto(I,t.CONTENT_IMAGE_SIZE)})}};try{return await Promise.resolve(h[e.type]()),window.document.body.removeChild(n),s.svg()}catch(v){return console.error(v),this.generateBlankSymbology()}function p(v){return Object.assign({},l,v)}function m(v){return v?{colour:`rgb(${v.r},${v.g},${v.b})`,opacity:v.a}:{colour:"rgb(0, 0, 0)",opacity:0}}}async svgDrawImage(e,t,r=0,n=0,s=!0){return new Promise((o,a)=>{const l=e.image(t,r,n,s).loaded(u=>o({image:l,loader:u})).error(u=>{a(u),console.error(u)})})}fitInto(e,t){const r=e.node.getBoundingClientRect(),n=t/Math.max(r.width,r.height);n<1&&e.scale(n)}rendererToLegend(e){let t;const r=e.symbolUnits.slice(0);if(e.defaultUnit&&r.push(e.defaultUnit),e.falseRenderer)t=r.map(n=>[n]);else{const n=new Map;r.forEach(s=>{const o=n.get(s.label);o?o.push(s):n.set(s.label,[s])}),t=[],n.forEach(s=>t.push(s))}return t.map(n=>{const s=n[0],o={uid:this.$iApi.geo.shared.generateUUID(),label:s.label||"",definitionClause:n.length===1?s.definitionClause:`(${n.map(a=>a.definitionClause).join(" OR ")})`,svgcode:"",esriStandard:!0,visibility:!0,lastVisbility:!0,drawPromise:this.symbolToSvg(s.symbol).then(a=>{o.svgcode=a,n.forEach(l=>{l.svgCode=a})})};return o})}async getMapServerLegend(e){if(!e)throw new Error("Legend server request is missing the required url.");const t={query:{f:"json"}},r={layers:[]},[n,s]=await _k(zi(`${e}/legend`,t));return s?s.data?s.data:(console.error(`Error loading legend data for ${e}`),r):(console.error(`Error loading legend for ${e}`,n),r)}mapServerLegendToRenderer(e,t){const r=e.layers.find(s=>s.layerId===t);let n;if(typeof r<"u")return n={type:"uniqueValue",field:"fakefield",uniqueValueInfos:r.legend.map(s=>({label:s.label,value:s.label,symbol:{type:"esriPMS",imageData:s.imageData,contentType:s.contentType}}))},this.makeRenderer(YC(n),[],!0);throw new Error("attempted to make renderer from non-existing legend data")}mapServerLegendToRendererAll(e){const t=e.layers.map(n=>n.legend.map(s=>({label:s.label,value:s.label,symbol:{type:"esriPMS",imageData:s.imageData,contentType:s.contentType}}))),r={type:"uniqueValue",field1:"fakefield",uniqueValueInfos:[].concat(...t)};return this.makeRenderer(YC(r),[],!0)}async mapServerToLocalLegend(e,t=void 0){const r=await this.getMapServerLegend(e);let n,s;return typeof t>"u"?(s=0,n=this.mapServerLegendToRendererAll(r)):(s=parseInt(t),n=this.mapServerLegendToRenderer(r,s)),this.rendererToLegend(n)}}class GLr extends tf{constructor(e){super(e)}async arcGisServerQueryIds(e){const t=new Kn;t.returnGeometry=!1,e.filterSql&&(t.where=e.filterSql),e.filterGeometry&&(t.geometry=this.queryGeometryHelper(e.filterGeometry,!1,this.$iApi.geo.map.getScale(),e.sourceSR),t.spatialRelationship="intersects");const r=await uSe(e.url,t);return Array.isArray(r)?r:[]}async geoJsonQuery(e){const t=new Kn;if(t.returnGeometry=!!e.includeGeometry,t.outFields=["*"],e.filterGeometry&&(t.geometry=this.queryGeometryHelper(e.filterGeometry,!0),t.spatialRelationship="intersects"),e.filterSql&&(t.where=e.filterSql),e.filterOIDs&&(t.objectIds=e.filterOIDs),await e.layer.loadPromise(),!e.layer.esriLayer)throw new Error("file layer being queried contains no ESRI layer");return(await e.layer.esriLayer.queryFeatures(t)).features.map((n,s)=>{let o;return t.returnGeometry?o=this.$iApi.geo.geom.geomEsriToRamp(n.geometry,`queryResult${s}`):o=new Kk,new Ax(o,"",n.attributes)})}queryGeometryHelper(e,t,r,n){let s;return!t&&e.type===cl.EXTENT?r&&n&&r>2e7&&e.sr.wkid===3978&&n.wkid===4326?s=e.toESRI():s=e.toPolygon().toESRI():s=e.toESRI(),s}makeClickBuffer(e,t=5){const r=this.$iApi.geo.map,n=r.getExtent(),s=t*(n.xmax-n.xmin)/r.getPixelWidth();return new Yh("ze_buffer",[e.x-s,e.y-s],[e.x+s,e.y+s],e.sr)}}class ULr extends tf{attributes;geom;layer;map;proj;query;shared;symbology;constructor(e){super(e),this.geom=sH.geom,this.proj=sH.proj,this.shared=sH.sharedUtils,this.map=new yFr(e),this.layer=new bLr(e),this.attributes=new DLr(e),this.query=new GLr(e),this.symbology=new jLr(e),Array.isArray(Ho.request.interceptors)||(Ho.request.interceptors=[]),Ho.request.interceptors.push({before:t=>{t.url.includes("?blankTile=false")&&(t.url=t.url.replace("?blankTile=false","?blankTile=true"))}})}set proxy(e){Ho.request.proxyUrl=e}get proxy(){return Ho.request.proxyUrl||""}}const zLr=Object.assign({"../fixtures/appbar/index.ts":()=>Promise.resolve().then(()=>rSn),"../fixtures/areas-of-interest/index.ts":()=>Promise.resolve().then(()=>TSn),"../fixtures/basemap/index.ts":()=>Promise.resolve().then(()=>XSn),"../fixtures/crosshairs/index.ts":()=>Promise.resolve().then(()=>iTn),"../fixtures/details/index.ts":()=>Promise.resolve().then(()=>LCn),"../fixtures/export-footnote/index.ts":()=>Promise.resolve().then(()=>jCn),"../fixtures/export-legend/index.ts":()=>Promise.resolve().then(()=>XCn),"../fixtures/export-map/index.ts":()=>Promise.resolve().then(()=>KCn),"../fixtures/export-northarrow/index.ts":()=>Promise.resolve().then(()=>QCn),"../fixtures/export-scalebar/index.ts":()=>Promise.resolve().then(()=>tEn),"../fixtures/export-timestamp/index.ts":()=>Promise.resolve().then(()=>rEn),"../fixtures/export-title/index.ts":()=>Promise.resolve().then(()=>sEn),"../fixtures/export/index.ts":()=>Promise.resolve().then(()=>xEn),"../fixtures/extentguard/index.ts":()=>Promise.resolve().then(()=>CEn),"../fixtures/gazebo/index.ts":()=>Promise.resolve().then(()=>QEn),"../fixtures/geosearch/index.ts":()=>Promise.resolve().then(()=>qIn),"../fixtures/grid/index.ts":()=>Promise.resolve().then(()=>VMn),"../fixtures/help/index.ts":()=>Promise.resolve().then(()=>EOn),"../fixtures/hilight/index.ts":()=>Promise.resolve().then(()=>OOn),"../fixtures/layer-reorder/index.ts":()=>Promise.resolve().then(()=>qPn),"../fixtures/legend/index.ts":()=>Promise.resolve().then(()=>tRn),"../fixtures/mapnav/index.ts":()=>Promise.resolve().then(()=>vRn),"../fixtures/metadata/index.ts":()=>Promise.resolve().then(()=>FRn),"../fixtures/northarrow/index.ts":()=>Promise.resolve().then(()=>WRn),"../fixtures/overviewmap/index.ts":()=>Promise.resolve().then(()=>nDn),"../fixtures/panguard/index.ts":()=>Promise.resolve().then(()=>cDn),"../fixtures/scrollguard/index.ts":()=>Promise.resolve().then(()=>yDn),"../fixtures/settings/index.ts":()=>Promise.resolve().then(()=>XDn),"../fixtures/snowman/index.ts":()=>Promise.resolve().then(()=>t4n),"../fixtures/wizard/index.ts":()=>Promise.resolve().then(()=>z5n)});class VLr extends tf{constructor(e){super(e)}exists(e){return e in oA(this.$vApp.$pinia).items}async add(e,t){let r;if(e in oA(this.$vApp.$pinia).items)return this.get(e);if(t){if(typeof t!="function")throw new Error("malformed fixture constructor");r=Yu.updateBaseToInstance(new t,e,this.$iApi)}else{const n=(await zLr[`../fixtures/${e}/index.ts`]()).default;r=new n(e,this.$iApi)}return oA(this.$vApp.$pinia).addFixture(r),this.$iApi.event.emit(ln.FIXTURE_ADDED,r),this.$iApi.geo.map.created&&r.initialized?.(),r}remove(e){const t=this.get(e);if(!t)throw new Error(`Could not find fixture ${e} for removal`);return oA(this.$vApp.$pinia).removeFixture(t),this.$iApi.event.emit(ln.FIXTURE_REMOVED,t),t}get(e){const t=[];typeof e=="string"?t.push(e):Array.isArray(e)?t.push(...e):t.push(e.id);const r=t.map(n=>{const s=oA(this.$vApp.$pinia).items[n];if(s)return s});return r.length===1?r[0]:r}isLoaded(e){const t=oA(this.$vApp.$pinia),r=Array.isArray(e)?e:[e];return r.forEach(n=>{t.loadPromises[n]===void 0&&t.addLoadPromise(n)}),Promise.all(t.getLoadPromises(r))}addDefaultFixtures(e){(!Array.isArray(e)||e.length===0)&&(e=["appbar","basemap","crosshairs","details","geosearch","grid","help","hilight","layer-reorder","legend","mapnav","northarrow","overviewmap","panguard","scrollguard","settings","wizard"]);const t=bm(this.$vApp.$pinia);return t.startingFixtures=e,Promise.all(e.map(r=>this.add(r)))}}class Yu extends tf{static updateBaseToInstance(e,t,r){const n=new Yu(t,r);return Object.defineProperties(e,{id:{value:t},$iApi:{value:r},$vApp:{get(){return n.$vApp}},remove:{value:n.remove},extend:{value:n.extend},config:{get(){return n.config}},mount:{value:n.mount}}),e}id;constructor(e,t){super(t),this.id=e}remove(){return this.$iApi.fixture.remove(this),this}extend(e,t={}){const r=Xr({extends:e,iApi:this.$iApi,data(){return{...t}}}),n=YW(r),{el:s}=this.mount(r,{props:{...t.propsData},app:n});return s}mount(e,{props:t,children:r,element:n,app:s}={}){let o=n,a=dx(e,t,r);return s&&s._context&&(a.appContext=s._context),o?VP(a,o):VP(a,o=document.createElement("div")),{vNode:a,destroy:()=>{o&&VP(null,o),o=null,a=null},el:o}}get config(){return bm(this.$vApp.$pinia).config.fixtures[this.id]}getLayerFixtureConfig(e){return this.getLayerFixtureConfigs()[e]}getLayerFixtureConfigs(){const e={},t=(r,n=void 0)=>{if(r.fixtures&&r.fixtures[this.id]!==void 0){let s=r.id;n!==void 0&&(s=`${n.id}-${r.index}`),e[s]=r.fixtures[this.id]}r.sublayers&&r.sublayers.forEach(s=>t(s,r))};return this.$iApi.geo.layer.allLayers().forEach(r=>t(r.config)),e}handlePanelWidths(e){if(this.config?.panelWidth){const t={};typeof this.config?.panelWidth=="number"&&(this.config.panelWidth={default:this.config?.panelWidth}),this.config.panelWidth.default&&e.forEach(r=>{t[r]=this.config.panelWidth.default});for(const r in this.config.panelWidth)r!="default"&&(t[r]=this.config.panelWidth[r]);for(const r in t){const n=this.$iApi.panel.get(r);this.$iApi.panel.setStyle(n,{"flex-basis":`${t[r]}px`})}}}handlePanelTeleports(e){if(this.config?.panelTeleport){const t=w0(this.$vApp.$pinia),r=!!this.config.panelTeleport.target;e.forEach(n=>{t.items[n].teleport=r?this.config.panelTeleport:this.config.panelTeleport[n],t.items[n].style.width="100%"})}}}class HLr extends tf{panelStore=w0(this.$vApp.$pinia);register(e,t){const r=WLr(e)?{[e.id]:e.config}:e;if(t){const s=t.i18n||{},o=this.$iApi.$i18n;Object.entries(s.messages||{}).forEach(a=>o.mergeLocaleMessage(...a)),Object.entries(s.dateTimeFormats||{}).forEach(a=>o.mergeDateTimeFormat(...a)),Object.entries(s.numberFormats||{}).forEach(a=>o.mergeNumberFormat(...a))}const n=Object.entries(r).reduce((s,[o,a])=>(s.push(new Zz(this.$iApi,o,a)),s),[]);return n.forEach(s=>this.panelStore.registerPanel(s)),n.length===1?n[0]:n.reduce((s,o)=>(s[o.id]=o,s),{})}isRegistered(e){const t=Array.isArray(e)?e:[e];return t.forEach(r=>{this.panelStore.regPromises[r]===void 0&&this.panelStore.addRegPromise(r)}),Promise.all(this.panelStore.getRegPromises(t))}remove(e){const t=this.get(e);t&&(t.isOpen&&this.close(t),this.panelStore.removePanel(t))}get(e){const t=typeof e=="string"?e:e.id;return this.panelStore.items[t]}open(e){let t,r,n;if(typeof e=="string"||e instanceof Zz?t=this.get(e):(t=this.get(e.id),{screen:r,props:n}=e),!t)return t;if(t.isOpen&&!t.isVisible)t.minimize();else if(t.isOpen)return t;return r||(t.route&&!n?{screen:r,props:n}=t.route:r=Object.keys(t.screens).pop()),this.show(t,{screen:r,props:n})?(this.panelStore.openPanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.open",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_OPENED,t)):console.error(`Failed to open ${t.id} panel.`),t}get opened(){return this.panelStore.orderedItems.concat(this.panelStore.teleported)}get visible(){return this.panelStore.visible.concat(this.panelStore.teleported)}close(e){const t=this.get(e);return t&&(t.isPinned&&t.pin(!1),this.panelStore.closePanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.close",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_CLOSED,t),t)}minimize(e){const t=this.get(e);return t&&(t.isPinned&&t.pin(!1),this.panelStore.closePanel(t),this.$iApi.updateAlert(this.$iApi.$i18n.t("panels.alert.minimize",{name:t.alertName?this.$iApi.$i18n.t(t.alertName):t.id})),this.$iApi.event.emit(ln.PANEL_MINIMIZED,t),t)}move(e,t){const r=this.get(e);return r&&(this.panelStore.movePanel(r,t),r)}toggle(e,t){let r;return typeof e=="string"||e instanceof Zz?r=this.get(e):r=this.get(e.id),r&&(t=typeof t<"u"?t:!r.isVisible,t!==r.isVisible&&(t?this.open(e):this.close(r)),r)}toggleMinimize(e,t){let r;return typeof e=="string"||e instanceof Zz?r=this.get(e):r=this.get(e.id),r&&(t=typeof t<"u"?t:!r.isVisible,t!==r.isVisible&&(t?this.open(r):this.minimize(r)),r)}pin(e,t){const r=this.get(e);return!r||(t=typeof t<"u"?t:!r.isPinned,!r.isPinned&&!t)||(this.panelStore.pinned=t?r:void 0),r}get pinned(){return this.panelStore.pinned||void 0}show(e,t){const r=this.get(e);if(!r)return r;if(r.screens[t.screen]){if(r.screens[t.screen]?.props){const n=Object.keys(r.screens[t.screen]?.props).filter(o=>o!=="panel"),s=t.props?Object.keys(t.props):[];for(let o=0;o(Dc("data-v-a3c61802"),i=i(),Fc(),i),XLr=YLr(()=>Ot("div",{class:"loader"},null,-1));function JLr(i,e){const t=Ko("panel-screen");return qt(),Dn(t,{header:!1,class:"screen-spinner"},{content:Rn(()=>[XLr]),_:1})}const KLr=ml(qLr,[["render",JLr],["__scopeId","data-v-a3c61802"]]),ZLr=Object.assign({"../fixtures/areas-of-interest/screen.vue":()=>Promise.resolve().then(()=>bSn),"../fixtures/basemap/screen.vue":()=>Promise.resolve().then(()=>VSn),"../fixtures/export/screen.vue":()=>Promise.resolve().then(()=>_En),"../fixtures/geosearch/screen.vue":()=>Promise.resolve().then(()=>GIn),"../fixtures/grid/screen.vue":()=>Promise.resolve().then(()=>GMn),"../fixtures/help/screen.vue":()=>Promise.resolve().then(()=>wOn),"../fixtures/layer-reorder/screen.vue":()=>Promise.resolve().then(()=>zPn),"../fixtures/legend/screen.vue":()=>Promise.resolve().then(()=>ZPn),"../fixtures/metadata/screen.vue":()=>Promise.resolve().then(()=>PRn),"../fixtures/settings/screen.vue":()=>Promise.resolve().then(()=>WDn),"../fixtures/wizard/screen.vue":()=>Promise.resolve().then(()=>B5n)});class Zz extends tf{id;screens;loadedScreens=[];alertName;teleport;controls;button;isScreenLoaded(e){return this.loadedScreens.indexOf(e)!==-1}registerScreen(e){const t=this.screens[e];let r;if(J2r(t)||X2r(t))r=t,this.loadedScreens.push(e);else{let n;typeof t=="string"?n=ZLr[`../fixtures/${t}`]():n=t();const s=new Promise((o,a)=>{n.then(l=>{this.loadedScreens.push(e),o(K2r(l)?l.default:l)}),n.catch(l=>a(l))});r=fse({loader:()=>s,loadingComponent:KLr,delay:200})}this.$iApi.$element.component(e,r)}style;expanded;get width(){if(!(!this.style.width||this.style.width.slice(-2)!=="px"))return parseInt(this.style.width)}route;constructor(e,t,r){if(super(e),{id:this.id,screens:this.screens,style:this.style,expanded:this.expanded,alertName:this.alertName,button:this.button,controls:this.controls}={id:t,style:{},expanded:!1,controls:{expand:!1,...r.controls},...r},Object.keys(this.screens).length===0)throw new Error("panel must have at least a single screen");this.route={screen:Object.keys(this.screens).pop()},this.style["flex-basis"]||(this.style["flex-basis"]=this.style.width||"350px"),this.style.width="80%"}open(e){return typeof e>"u"?this.$iApi.panel.open(this):this.$iApi.panel.open({id:this.id,...typeof e=="string"?{screen:e}:e}),this}get isOpen(){return this.$iApi.panel.opened.indexOf(this)!==-1}get isVisible(){return this.$iApi.panel.visible.indexOf(this)!==-1}close(){return this.$iApi.panel.close(this),this}minimize(){return this.$iApi.panel.minimize(this),this}move(e){return this.$iApi.panel.move(this,e),this}get isLeftMostPanel(){if(this.$iApi.panel.visible.length>0){for(const e of this.$iApi.panel.visible)if(!e.teleport)return this.id===e.id}return!1}get isRightMostPanel(){if(this.$iApi.panel.visible.length>0){for(let e=this.$iApi.panel.visible.length-1;e>=0;e--)if(!this.$iApi.panel.visible[e].teleport)return this.id===this.$iApi.panel.visible[e].id}return!1}remove(){return this.$iApi.panel.remove(this),this}toggle(e){return typeof e>"u"?this.$iApi.panel.toggle(this,!this.isOpen):typeof e=="boolean"?e!==this.isOpen&&this.$iApi.panel.toggle(this,e):this.$iApi.panel.toggle({id:this.id,screen:e.screen,props:e.props},typeof e.toggle<"u"?e.toggle:!this.isOpen),this}toggleMinimize(e){return typeof e>"u"||typeof e=="boolean"?this.$iApi.panel.toggleMinimize(this,e):this.$iApi.panel.toggleMinimize({id:this.id,screen:e.screen,props:e.props},typeof e.toggle<"u"?e.toggle:!this.isOpen),this}pin(e){return e=typeof e<"u"?e:!this.isPinned,this.$iApi.panel.pin(this,e),this}get isPinned(){return!!this.$iApi.panel.pinned&&this.$iApi.panel.pinned.id===this.id}show(e){const t=typeof e=="string"?{screen:e}:e;return this.route=t,this.$iApi.panel.show(this,t),this}setStyles(e,t=!1){return this.$iApi.panel.setStyle(this,e,t),this}expand(e){return this.$iApi.panel.expand(this,e),this}}console.info(`RAMP v4.8.0 [${"75d28aa6ec0555f069781708224190508190de79".slice(0,9)}] (Built on ${new Date("Tue Aug 27 14:26:11 2024 -0400").toLocaleString()})`);const iK={major:"4",minor:"8",patch:"0",timestamp:"Tue Aug 27 14:26:11 2024 -0400",hash:"75d28aa6ec0555f069781708224190508190de79"},e8t=(i,e,t)=>new dFr(i,e,t),sH=new Y2r;function QLr(i,e){let t=e.responseType;t?t!=="array-buffer"&&t!=="blob"&&t!=="json"&&t!=="native"&&t!=="native-request-init"&&t!=="text"&&(t="text"):t="json",e.responseType=t;const r=e.signal;return delete e.signal,globalThis.invokeStaticMessage("request",{url:i,options:e},{signal:r}).then(async n=>{let s,o,a,l,u;if(n.data)if(n.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(s=new Blob([n.data]),t!=="json"&&t!=="text"||(l=await s.text(),t!=="json")))){try{o=JSON.parse(l||null)}catch(c){const h={...c,url:i,requestOptions:e};throw new qe("request:server",c.message,h)}if(o.error){const c={...o.error,url:i,requestOptions:e};throw new qe("request:server",o.error.message,c)}}}else t==="native"&&(n.data.signal=r,a=await fetch(n.data.url,n.data),n.httpStatus=a.status);switch(t){case"blob":u=s;break;case"json":u=o;break;case"native":u=a;break;case"text":u=l;break;default:u=n.data}return{data:u,httpStatus:n.httpStatus,requestOptions:e,ssl:n.ssl,url:i}})}const eNr=Object.freeze(Object.defineProperty({__proto__:null,execute:QLr},Symbol.toStringTag,{value:"Module"})),dOe="esri-identity-modal",pOe={base:dOe,info:`${dOe}__info`,notice:`${dOe}__notice`},tNr="ArcGIS Online";let Sw=class extends my{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return Y3({button:()=>Promise.resolve().then(()=>Xle),input:()=>Promise.resolve().then(()=>nFn),label:()=>Promise.resolve().then(()=>uFn),modal:()=>Promise.resolve().then(()=>IFn),notice:()=>Promise.resolve().then(()=>wZe)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:n,oAuthPrompt:s,server:o,resource:a,error:l}=this,{info:u,oAuthInfo:c,lblItem:h,invalidUser:p,noAuthService:m,lblUser:v,lblPwd:w,lblCancel:S,lblSigning:I,lblOk:R}=r;return er("div",{class:this.classes(pOe.base,N5t())},er("form",{bind:this,onsubmit:this._submit},er("calcite-modal",{bind:this,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteModalClose:this._cancel,onCalciteModalOpen:this._focusUsernameInput},er("div",{slot:"header"},t),er("div",{slot:"content"},er("div",{class:pOe.info},xC(s?c:u,{server:o&&/\.arcgis\.com/i.test(o)?tNr:o,resource:`(${a||h})`})),l?er("calcite-notice",{class:pOe.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},er("div",{slot:"message"},l.details?.httpStatus?p:m)):null,s?null:[er("calcite-label",null,v,er("calcite-input",{afterCreate:L=>this._usernameInputNode=L,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),er("calcite-label",null,w,er("calcite-input",{afterCreate:L=>this._passwordInputNode=L,bind:this,name:"password",required:!0,type:"password",value:""}))]),er("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"secondary",type:"button",width:"full"},S),er("calcite-button",{loading:!!n,slot:"primary",type:"submit",width:"full"},n?I:R))))}_focusUsernameInput(){requestAnimationFrame(()=>{this._usernameInputNode?.setFocus()})}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};x([D({readOnly:!0})],Sw.prototype,"container",void 0),x([D(),Sg("esri/t9n/common")],Sw.prototype,"commonMessages",void 0),x([D()],Sw.prototype,"error",void 0),x([D(),Sg("esri/identity/t9n/identity")],Sw.prototype,"messages",void 0),x([D()],Sw.prototype,"oAuthPrompt",void 0),x([D()],Sw.prototype,"open",void 0),x([D()],Sw.prototype,"signingIn",void 0),x([D()],Sw.prototype,"server",void 0),x([D({readOnly:!0})],Sw.prototype,"title",null),x([D()],Sw.prototype,"resource",void 0),Sw=x([Qe("esri.identity.IdentityModal")],Sw);const adt=Sw,fOe="esriJSAPIOAuth";let i6e=class{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(fOe,JSON.stringify(e))}catch(n){return console.warn(n),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",n=new FormData;if(n.append("f","json"),n.append("auth_token",this.refreshToken||this.token),n.append("client_id",t.appId),n.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(r,n);else{const s=new XMLHttpRequest;s.open("POST",r),s.send(n)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(fOe,JSON.stringify(e))}catch(n){console.log(n)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(fOe);if(t)try{e=JSON.parse(t)}catch(r){console.warn(r)}}return e}};i6e.prototype.declaredClass="esri.identity.OAuthCredential";var r6e;let Ey=r6e=class extends Ci{constructor(i){super(i),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return r6e.fromJSON(this.toJSON())}};x([D({json:{write:!0}})],Ey.prototype,"appId",void 0),x([D({json:{write:!0}})],Ey.prototype,"authNamespace",void 0),x([D({json:{write:!0}})],Ey.prototype,"expiration",void 0),x([D({json:{write:!0}})],Ey.prototype,"flowType",void 0),x([D({json:{write:!0}})],Ey.prototype,"forceLogin",void 0),x([D({json:{write:!0}})],Ey.prototype,"forceUserId",void 0),x([D({json:{write:!0}})],Ey.prototype,"locale",void 0),x([D({json:{write:!0}})],Ey.prototype,"minTimeUntilExpiration",void 0),x([D({json:{write:!0}})],Ey.prototype,"popup",void 0),x([D({json:{write:!0}})],Ey.prototype,"popupCallbackUrl",void 0),x([D({json:{write:!0}})],Ey.prototype,"popupWindowFeatures",void 0),x([D({json:{write:!0}})],Ey.prototype,"portalUrl",void 0),x([D({json:{write:!0}})],Ey.prototype,"preserveUrlHash",void 0),x([D({json:{write:!0}})],Ey.prototype,"userId",void 0),Ey=r6e=x([Qe("esri.identity.OAuthInfo")],Ey);const ldt=Ey;let Tw=class extends Ci{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};x([D({json:{write:!0}})],Tw.prototype,"adminTokenServiceUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"currentVersion",void 0),x([D({json:{write:!0}})],Tw.prototype,"hasPortal",void 0),x([D({json:{write:!0}})],Tw.prototype,"hasServer",void 0),x([D({json:{write:!0}})],Tw.prototype,"owningSystemUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"owningTenant",void 0),x([D({json:{write:!0}})],Tw.prototype,"server",void 0),x([D({json:{write:!0}})],Tw.prototype,"shortLivedTokenValidity",void 0),x([D({json:{write:!0}})],Tw.prototype,"tokenServiceUrl",void 0),x([D({json:{write:!0}})],Tw.prototype,"webTierAuth",void 0),Tw=x([Qe("esri.identity.ServerInfo")],Tw);const mOe=Tw,Dge={},t8t=i=>{const e=new Qy(i.owningSystemUrl).host,t=new Qy(i.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(t)},n6e=(i,e)=>!!(t8t(i)&&e&&e.some(t=>t.test(i.server)));let Fge=null,kge=null;try{Fge=window.localStorage,kge=window.sessionStorage}catch{}let i8t=class extends rd{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=Yo(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(r=>{r.owningSystemUrl&&this._portals.push(r.owningSystemUrl),r.hasPortal&&this._portals.push(r.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const n=this.findOAuthInfo(r.portalUrl);n&&t.splice(t.indexOf(n),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let n,s=this.findServerInfo(t),o=!0;s||(s=new mOe,s.server=this._getServerInstanceRoot(t),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(t),s.hasPortal=!0),this.registerServers([s])),n=this._findCredential(t),n?(delete e.server,Object.assign(n,e),o=!1):(n=new hd({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),n.resources=[t],this.credentials.push(n)),n.emitTokenChange(!1),o||n.refreshServerTokens()}toJSON(){return BUe({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,n=e.credentials;if(t){const s=[];t.forEach(o=>{o.server&&o.tokenServiceUrl&&s.push(o.declaredClass?o:new mOe(o))}),s.length&&this.registerServers(s)}if(r){const s=[];r.forEach(o=>{o.appId&&s.push(o.declaredClass?o:new ldt(o))}),s.length&&this.registerOAuthInfos(s)}n&&n.forEach(s=>{s.server&&s.token&&s.expires&&s.expires>Date.now()&&((s=s.declaredClass?s:new hd(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const n=this._isServerRsrc(e)?"server":"portal";if(t){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&t===s.userId&&s.scope===n){r=s;break}}else for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&this._getIdenticalSvcIdx(e,s)!==-1&&s.scope===n){r=s;break}return r}getCredential(e,t){let r,n,s=!0;t&&(r=!!t.token,n=t.error,s=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const o=new AbortController,a=ac();if(t.signal&&Qh(t.signal,()=>{o.abort()}),Qh(o,()=>{a.reject(new qe("identity-manager:user-aborted","ABORTED"))}),xg(o))return a.promise;t.signal=o.signal;const l=this._isAdminResource(e),u=r?this.findCredential(e):null;let c;if(u&&n&&n.details&&n.details.httpStatus===498)u.destroy();else if(u)return c=new qe("identity-manager:not-authorized","You are currently signed in as: '"+u.userId+"'. You do not have access to this resource: "+e,{error:n}),a.reject(c),a.promise;const h=this._findCredential(e,t);if(h)return a.resolve(h),a.promise;let p=this.findServerInfo(e);if(p)!p.hasPortal&&p.server&&p.owningSystemUrl&&this._hasSameServerInstance(p.server,p.owningSystemUrl)&&(p.hasPortal=!0),!p.hasServer&&this._isServerRsrc(e)&&(p._restInfoPms=this._getTokenSvcUrl(e),p.hasServer=!0);else{const m=this._getTokenSvcUrl(e);if(!m)return c=new qe("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),a.reject(c),a.promise;p=new mOe,p.server=this._getServerInstanceRoot(e),typeof m=="string"?(p.tokenServiceUrl=m,p.hasPortal=!0):(p._restInfoPms=m,p.hasServer=!0),this.registerServers([p])}return p.hasPortal&&p._selfReq===void 0&&(s||_v(p.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(m=>m.tokenServiceUrl===p.tokenServiceUrl))&&(p._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(p.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,p,t,a,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const n=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new Qy(this._appOrigin),o=e.shortLivedTokenValidity;let a,l,u,c,h,p,m,v;t&&(v=this.tokenValidity||o||this._defaultTokenValidity,v>o&&o>0&&(v=o)),r&&(a=r.isAdmin,l=r.serverUrl,u=r.token,p=r.signal,m=r.ssl,e.customParameters=r.customParameters),a?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,h=new Qy(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!m&&s.scheme==="http"&&(_v(s.uri,c,!0)||h.scheme==="https"&&s.host===h.host&&s.port==="7080"&&h.port==="7443")&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const w={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:l,token:u,expiration:v,referer:a||n?this._appOrigin:null,client:a?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:p,...r?.ioArgs};return n||(w.withCredentials=!1),zi(c,w).then(S=>{const I=S.data;if(!I?.token)return new qe("identity-manager:authentication-failed","Unable to generate token");const R=e.server;return Dge[R]||(Dge[R]={}),t&&(Dge[R][t.username]=t.password),I.validity=v,I})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,r){let n=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let o;const a={f:"json"};if(s.scope==="portal")if(t&&(this._doPortalSignIn(e)||r?.force))o=s.server+"/sharing/rest/oauth2/validateAppAccess",a.client_id=t;else{if(!s.token)return{credential:s};o=s.server+"/sharing/rest"}else{if(!s.token)return{credential:s};o=s.server+"/rest/services"}return s.token&&(a.token=s.token),zi(o,{query:a,authMode:"anonymous"}).then(l=>{if(l.data.valid===!1)throw new qe("identity-manager:not-authorized",`You are currently signed in as: '${s.userId}'.`,l.data);return n=!!l.data.viewOnlyUserTypeApp,{credential:s}}).catch(l=>{if(l.name==="identity-manager:not-authorized")throw l;const u=l.details?.httpStatus;if(u===498)throw s.destroy(),new qe("identity-manager:not-authenticated","User is not signed in.");if(u===400)throw new qe("identity-manager:invalid-request");return{credential:s}})}).then(s=>({credential:s.credential,viewOnly:n}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(mP(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const n=ac(),s=()=>{l?.remove(),u?.remove(),this.dialog?.destroy(),this.dialog=l=u=null},o=()=>{s(),this._oAuthDfd=null,n.reject(new qe("identity-manager:user-aborted","ABORTED"))};r.signal&&Qh(r.signal,()=>{o()});const a=new adt({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=a,this.emit("dialog-create");let l=a.on("cancel",o),u=a.on("submit",c=>{this.generateToken(t,c,{isAdmin:r.isAdmin,signal:r.signal}).then(h=>{s();const p=new hd({userId:c.username,server:t.server,token:h.token,expires:h.expires!=null?Number(h.expires):null,ssl:!!h.ssl,isAdmin:r.isAdmin,validity:h.validity});n.resolve(p)}).catch(h=>{a.error=h,a.signingIn=!1})});return n.promise}oAuthSignIn(e,t,r,n){this._oAuthDfd=ac();const s=this._oAuthDfd;let o;n?.signal&&Qh(n.signal,()=>{const p=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;p&&!p.closed?p.close():this.dialog&&c()}),s.resUrl_=e,s.sinfo_=t,s.oinfo_=r;const a=r._oAuthCred;if(a.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&t.currentVersion>=8.4)){let p=crypto.getRandomValues(new Uint8Array(32));o=YAe(p),a.codeVerifier=o,p=crypto.getRandomValues(new Uint8Array(32)),a.stateUID=YAe(p),a.save()||(a.codeVerifier=o=null)}else a.codeVerifier=null;let l,u;this._getCodeChallenge(o).then(p=>{const m=!n||n.oAuthPopupConfirmation!==!1;if(!r.popup||!m)return void this._doOAuthSignIn(e,t,r,p);const v=new adt({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=v,this.emit("dialog-create"),l=v.on("cancel",c),u=v.on("submit",()=>{h(),this._doOAuthSignIn(e,t,r,p)})});const c=()=>{h(),this._oAuthDfd=null,s.reject(new qe("identity-manager:user-aborted","ABORTED"))},h=()=>{l?.remove(),u?.remove(),this.dialog?.destroy(),this.dialog=null};return s.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=BA(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&t.data?.type==="arcgis:auth:requestCredential"){const r=t.source;this.getCredential(e).then(n=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:n.expires,server:n.server,ssl:n.ssl,token:n.token,userId:n.userId}},t.origin)}).catch(n=>{r.postMessage({type:"arcgis:auth:error",error:{name:n.name,message:n.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const r=mP(e);let n=!1;if(r.access_token&&r.expires_in&&r.state&&r.hasOwnProperty("username"))try{r.state=JSON.parse(r.state),r.state.portalUrl&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}n&&(window.location.hash=r.state?.hash||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const r=mP(t);let n=!1;if(r.code&&r.state)try{r.state=JSON.parse(r.state),r.state.portalUrl&&r.state.uid&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}if(n){const s={...r};["code","error","error_description","message_code","persist","state"].forEach(l=>{delete s[l]});const o=Lb(s),a=window.location.pathname+(o?`?${o}`:"")+(r.state?.hash||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,t,r,n,s){return e=e.replace(/^http:/i,"https:"),zi(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:n&&s?{grant_type:"authorization_code",code:t,redirect_uri:n,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(o=>o.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(r=>YAe(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new qe("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let r,n,s,o,a=-1;const l=t?.token,u=t?.resource,c=this._isServerRsrc(e)?"server":"portal",h=this.credentials.filter(p=>this._hasSameServerInstance(p.server,e)&&p.scope===c);if(e=u||e,h.length)if(h.length===1){if(r=h[0],s=this.findServerInfo(r.server),n=s?.owningSystemUrl,o=n?this.findCredential(n,r.userId):void 0,a=this._getIdenticalSvcIdx(e,r),!l)return a===-1&&r.resources.push(e),this._addResource(e,o),r;a!==-1&&(r.resources.splice(a,1),this._removeResource(e,o))}else{let p,m;if(h.some(v=>(m=this._getIdenticalSvcIdx(e,v),m!==-1&&(p=v,s=this.findServerInfo(p.server),n=s?.owningSystemUrl,o=n?this.findCredential(n,p.userId):void 0,a=m,!0))),l)p&&(p.resources.splice(a,1),this._removeResource(e,o));else if(p)return this._addResource(e,o),p}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!_v(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!_v(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new Qy(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return r===-1&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),r!==-1||HCt(t)||(r=t.indexOf("/sharing")),r===-1&&t.substr(-1)==="/"&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(Ho.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return r!==-1&&(e=e.substring(r+t.length+1)),e=X1(e),Yo(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const n=this._getSuffix(e).toLowerCase(),s=this._getSuffix(t).toLowerCase();if(r=n===s,!r){const o=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=n.replaceAll(o,"$1")===s.replaceAll(o,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new Qy(e.toLowerCase()),r=this._portalConfig;let n=this._gwDomains.some(s=>s.regex.test(t.uri));return!n&&r&&(n=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),n||Ho.portalUrl&&(n=_v(t,Ho.portalUrl,!0)),n||(n=this._portals.some(s=>this._hasSameServerInstance(s,t.uri))),n=n||this._agsPortal.test(t.path),n}_isIdProvider(e,t){let r=-1,n=-1;this._gwDomains.forEach((o,a)=>{r===-1&&o.regex.test(e)&&(r=a),n===-1&&o.regex.test(t)&&(n=a)});let s=!1;if(r>-1&&n>-1&&(r===0||r===4?n!==0&&n!==4||(s=!0):r===1?n!==1&&n!==2||(s=!0):r===2?n===2&&(s=!0):r===3&&n===3&&(s=!0)),!s){const o=this.findServerInfo(t),a=o?.owningSystemUrl;a&&t8t(o)&&this._isPortalDomain(a)&&this._isIdProvider(e,a)&&(s=!0)}return s}_getIdenticalSvcIdx(e,t){let r=-1;for(let n=0;no.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let s="";if(this._gwDomains.some(o=>(o.regex.test(e)&&(s=o.tokenServiceUrl),!!s)),s||this._portals.some(o=>(this._hasSameServerInstance(o,e)&&(s=o+this._gwTokenUrl),!!s)),s||(n=e.toLowerCase().indexOf("/sharing"),n!==-1&&(s=e.substring(0,n)+this._gwTokenUrl)),s||(s=this._getOrigin(e)+this._gwTokenUrl),s){const o=new Qy(e).port;/^http:\/\//i.test(e)&&o==="7080"&&(s=s.replace(/:7080/i,":7443")),s=s.replace(/http:/i,"https:")}return s}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const n=t._oAuthCred;if(e.code){const o=n.codeVerifier;return n.codeVerifier=null,n.stateUID=null,n.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),o).then(a=>{const l=new hd({userId:a.username,server:r.server,token:a.access_token,expires:Date.now()+1e3*a.expires_in,ssl:a.ssl,oAuthState:e.state,_oAuthCred:n});return t.userId=l.userId,n.storage=a.persist?Fge:kge,n.refreshToken=a.refresh_token,n.token=null,n.expires=a.refresh_token_expires_in?Date.now()+1e3*a.refresh_token_expires_in:null,n.userId=l.userId,n.ssl=l.ssl,n.save(),l})}const s=new hd({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:n});return t.userId=s.userId,n.storage=e.persist?Fge:kge,n.refreshToken=null,n.token=s.token,n.expires=s.expires,n.userId=s.userId,n.ssl=s.ssl,n.save(),Promise.resolve(s)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r=e.error==="access_denied",n=new qe(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(n)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(r=>{t.resolve(r)}).catch(r=>{t.reject(r)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(mP(e)))}_exchangeToken(e,t,r){return zi(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then(n=>n.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),zi(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,t){let r;return this._gwDomains.some(n=>(n.regex.test(e)&&(r=n.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),zi(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(n=>n.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,n=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(n?n.hasPortal||n.owningSystemUrl&&this._isPortalDomain(n.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||_v(r,e,!0)))}_checkProtocol(e,t,r,n){let s=!0;const o=n?t.adminTokenServiceUrl:t.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&Qoe(o)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!s)&&r(new qe("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,t,r,n,s,o){return n||(n=ac()),n.resUrl_=e,n.sinfo_=t,n.options_=r,n.admin_=s,n.refresh_=o,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(n)):this._xoReqs.push(n):this._doSignIn(n),n.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=u=>{const c=e.options_?.resource,h=e.resUrl_,p=e.refresh_;let m=!1;this.credentials.includes(u)||(p&&this.credentials.includes(p)?(p.userId=u.userId,p.token=u.token,p.expires=u.expires,p.validity=u.validity,p.ssl=u.ssl,p.creationTime=u.creationTime,m=!0,u=p):this.credentials.push(u)),u.resources||(u.resources=[]),u.resources.includes(c||h)||u.resources.push(c||h),u.scope=this._isServerRsrc(h)?"server":"portal",u.emitTokenChange();const v=this._soReqs,w={};this._soReqs=[],v.forEach(S=>{if(!this._isIdenticalService(h,S.resUrl_)){const I=this._getSuffix(S.resUrl_);w[I]||(w[I]=!0,u.resources.push(S.resUrl_))}}),e.resolve(u),v.forEach(S=>{this._hasSameServerInstance(this._getServerInstanceRoot(h),S.resUrl_)?S.resolve(u):this._soReqs.push(S)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,m||this.emit("credential-create",{credential:u}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=u=>{e.reject(u),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},n=(u,c,h,p)=>{const m=e.sinfo_,v=!e.options_||e.options_.prompt!==!1,w=m.hasPortal&&this._findOAuthInfo(e.resUrl_);let S,I;if(u)t(new hd({userId:u,server:m.server,token:h||null,expires:p!=null?Number(p):null,ssl:!!c}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const R=BA(window,"message",L=>{L.source===window.parent&&L.data&&(L.data.type==="arcgis:auth:credential"?(R.remove(),L.data.credential.expires{R.remove()})}else if(w){let R=w._oAuthCred;if(!R){const L=new i6e(w,Fge),k=new i6e(w,kge);L.isValid()&&k.isValid()?L.expires>k.expires?(R=L,k.destroy()):(R=k,L.destroy()):R=L.isValid()?L:k,w._oAuthCred=R}if(R.isValid()){S=new hd({userId:R.userId,server:m.server,token:R.token,expires:R.expires,ssl:R.ssl,_oAuthCred:R});const L=w.appId!==R.appId&&this._doPortalSignIn(e.resUrl_);L||R.refreshToken?(e._pendingDfd=R.refreshToken?this._getOAuthToken(m.server,R.refreshToken,R.appId).then(k=>(S.expires=Date.now()+1e3*k.expires_in,S.token=k.access_token,S)):Promise.resolve(S),e._pendingDfd.then(k=>L?this._exchangeToken(k.server,w.appId,k.token).then(B=>(k.token=B,k)).catch(()=>k):k).then(k=>{t(k)}).catch(()=>{R?.destroy(),n()})):t(S)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(w.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===R.stateUID&&R.codeVerifier)){const L=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(L,w,m).then(k=>{t(k)}).catch(r)}else{const L=()=>{v?e._pendingDfd=this.oAuthSignIn(e.resUrl_,m,w,e.options_).then(t,r):(I=new qe("identity-manager:not-authenticated","User is not signed in."),r(I))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(m.server,w.appId).then(k=>{_v(k.portalUrl,this._appOrigin,!0)?(S=new hd({userId:k.username,server:m.server,expires:Date.now()+1e3*k.expires_in,token:k.token}),t(S)):L()}).catch(L):L()}}else if(v){if(this._checkProtocol(e.resUrl_,m,r,e.admin_)){let R=e.options_;e.admin_&&(R=R||{},R.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,m,R).then(t,r)}}else I=new qe("identity-manager:not-authenticated","User is not signed in."),r(I)},s=()=>{const u=e.sinfo_,c=u.owningSystemUrl,h=e.options_;let p,m,v,w;if(h&&(p=h.token,m=h.error,v=h.prompt),w=this._findCredential(c,{token:p,resource:e.resUrl_}),!w){for(const S of this.credentials)if(this._isIdProvider(c,S.server)){w=S;break}}if(w){const S=this.findCredential(e.resUrl_,w.userId);if(S)t(S);else if(n6e(u,this._legacyFed)){const I=w.toJSON();I.server=u.server,I.resources=null,t(new hd(I))}else(e._pendingDfd=this.generateToken(this.findServerInfo(w.server),null,{serverUrl:e.resUrl_,token:w.token,signal:e.options_.signal,ssl:w.ssl})).then(I=>{t(new hd({userId:w?.userId,server:u.server,token:I.token,expires:I.expires!=null?Number(I.expires):null,ssl:!!I.ssl,isAdmin:e.admin_,validity:I.validity}))},r)}else this._busy=null,p&&(e.options_.token=null),(e._pendingDfd=this.getCredential(c.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:u.owningTenant,signal:e.options_.signal,token:p,error:m,prompt:v})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},S=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(S)})};this._errbackFunc=r;const o=e.sinfo_.owningSystemUrl,a=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(u=>{const c=e.sinfo_;if(c._restInfoPms){c.adminTokenServiceUrl=c._restInfoPms.adminUrl,c._restInfoPms=null,c.tokenServiceUrl=(uS("authInfo.tokenServicesUrl",u)||uS("authInfo.tokenServiceUrl",u)||uS("tokenServiceUrl",u))??null,c.shortLivedTokenValidity=uS("authInfo.shortLivedTokenValidity",u)??null,c.currentVersion=u.currentVersion,c.owningTenant=u.owningTenant;const h=c.owningSystemUrl=u.owningSystemUrl;h&&this._portals.push(h)}a&&c.owningSystemUrl?s():n()},()=>{e.sinfo_._restInfoPms=null;const u=new qe("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(u)}):a&&o?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(u=>{const c={};let h,p,m,v;return u&&(h=u.user?.username,c.username=h,c.allSSL=u.allSSL,p=u.supportsOAuth,v=parseFloat(u.currentVersion),u.portalMode==="multitenant"&&(m=u.customBaseUrl),e.sinfo_.currentVersion=v),e.sinfo_.webTierAuth=!!h,h&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:c.allSSL}).catch(()=>null).then(w=>(c.portalToken=w&&w.token,c.tokenExpiration=w&&w.expires,c)):!h&&p&&v>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:m,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>c):c}).catch(()=>null).then(u=>{e.sinfo_._selfReq=null,u?n(u.username,u.allSSL,u.portalToken,u.tokenExpiration):n()}):n()}_generateOAuthInfo(e){let t,r=null,n=e.portalUrl;const s=e.customBaseUrl,o=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let l=r.indexOf("?");l>-1&&(r=r.slice(0,l)),l=r.search(/\/(apps|home)\//),r=l>-1?r.slice(0,l):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=zi(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new ldt({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return n=n.replace(/^http:/i,"https:"),zi(n+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:xf(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(l=>{if(l.data.valid){const u=this._defaultOAuthInfo.clone();l.data.urlKey&&s?u.portalUrl="https://"+l.data.urlKey.toLowerCase()+"."+s:u.portalUrl=n,u.popup=window!==window.top||!(_v(n,this._appOrigin)||this._gwDomains.some(c=>c.regex.test(n)&&c.regex.test(this._appOrigin))),this.oAuthInfos.push(u)}})})}_doOAuthSignIn(e,t,r,n){const s=r._oAuthCred,o={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(o.hash=window.location.hash),s.stateUID&&(o.uid=s.stateUID);const a={client_id:r.appId,response_type:s.codeVerifier?"code":"token",state:JSON.stringify(o),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!s.codeVerifier)};r.forceLogin&&(a.force_login=!0),r.forceUserId&&r.userId&&(a.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(a.redirectToUserOrgUrl=!0),s.codeVerifier&&(a.code_challenge=n||s.codeVerifier,a.code_challenge_method=n?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",u=l+"?"+Lb(a);if(r.popup){const c=window.open(u,"esriJSAPIOAuth",r.popupWindowFeatures);if(c)c.focus(),this._oAuthDfd.oAuthWin_=c,this._oAuthIntervalId=setInterval(()=>{if(c.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const h=this._oAuthDfd;if(h){const p=new qe("identity-manager:user-aborted","ABORTED");h.reject(p)}}},500),this._oAuthOnPopupHandle=BA(window,["arcgis:auth:hash","arcgis:auth:location:search"],h=>{h.type==="arcgis:auth:hash"?this.setOAuthResponseHash(h.detail):this._setOAuthResponseQueryString(h.detail)});else{const h=new qe("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(h)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:a,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=u}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return xf(e.popupCallbackUrl);if(t){const n=Yo(r);return n.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete n.query[s]}),gg(n.path,n.query)}return r}};i8t.prototype.declaredClass="esri.identity.IdentityManagerBase";let hd=class extends rd.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const e=no.findServerInfo(this.server),t=e?.owningSystemUrl,r=!!t&&this.scope==="server",n=r&&n6e(e,no._legacyFed),s=e.webTierAuth,o=s&&no.normalizeWebTierAuth,a=Dge[this.server],l=a?.[this.userId];let u,c=this.resources&&this.resources[0],h=r?no.findServerInfo(t):null,p={username:this.userId,password:l};if(s&&!o)return;r&&!h&&no.serverInfos.some(v=>(no._isIdProvider(t,v.server)&&(h=v),!!h));const m=h?no.findCredential(h.server,this.userId):null;if(!r||m){if(!n){if(r)u={serverUrl:c,token:m?.token,ssl:m&&m.ssl};else if(o)p=null,u={ssl:this.ssl};else{if(!l){let v;return c&&(c=no._sanitizeUrl(c),this._enqueued=1,v=no._enqueue(c,e,null,null,this.isAdmin,this),v.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),v}this.isAdmin&&(u={isAdmin:!0})}return no.generateToken(r?h:e,r?null:p,u).then(v=>{this.token=v.token,this.expires=v.expires!=null?Number(v.expires):null,this.creationTime=Date.now(),this.validity=v.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}m?.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&no.credentials.forEach(e=>{const t=no.findServerInfo(e.server),r=t?.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&e.scope==="server"&&(no._hasSameServerInstance(this.server,r)||no._isIdProvider(r,this.server))&&(n6e(t,no._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server?no.findServerInfo(this.server):null,r=t?.owningSystemUrl,n=r?no.findServerInfo(r):null;e===!1||r&&this.scope!=="portal"&&(!n?.webTierAuth||no.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=no.credentials.indexOf(this);e>-1&&no.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=BUe({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};x([D()],hd.prototype,"creationTime",void 0),x([D()],hd.prototype,"expires",void 0),x([D()],hd.prototype,"isAdmin",void 0),x([D()],hd.prototype,"oAuthState",void 0),x([D()],hd.prototype,"resources",void 0),x([D()],hd.prototype,"scope",void 0),x([D()],hd.prototype,"server",void 0),x([D()],hd.prototype,"ssl",void 0),x([D()],hd.prototype,"token",void 0),x([D()],hd.prototype,"tokenRefreshBuffer",void 0),x([D()],hd.prototype,"userId",void 0),x([D()],hd.prototype,"validity",void 0),hd=x([Qe("esri.identity.Credential")],hd);let r8t=class extends i8t{};r8t.prototype.declaredClass="esri.identity.IdentityManager";const n8t=new r8t;zWi(n8t);const iNr=Object.freeze(Object.defineProperty({__proto__:null,default:n8t},Symbol.toStringTag,{value:"Module"}));var udt,rK,cdt,s8t={exports:{}};udt=s8t,rK=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(rK=rK||__filename),cdt=function(i={}){var e,t,r=i;r.ready=new Promise((Oe,ui)=>{e=Oe,t=ui});var n,s,o,a=Object.assign({},r),l="./this.program",u=typeof window=="object",c=typeof importScripts=="function",h=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function m(Oe){return r.locateFile?r.locateFile(Oe,p):p+Oe}if(h){var v=require("fs"),w=require("path");p=c?w.dirname(p)+"/":__dirname+"/",n=(Oe,ui)=>(Oe=ot(Oe)?new URL(Oe):w.normalize(Oe),v.readFileSync(Oe,ui?void 0:"utf8")),o=Oe=>{var ui=n(Oe,!0);return ui.buffer||(ui=new Uint8Array(ui)),ui},s=(Oe,ui,Zi,Or=!0)=>{Oe=ot(Oe)?new URL(Oe):w.normalize(Oe),v.readFile(Oe,Or?void 0:"utf8",(wn,vo)=>{wn?Zi(wn):ui(Or?vo.buffer:vo)})},!r.thisProgram&&process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),r.inspect=()=>"[Emscripten Module object]"}else(u||c)&&(c?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),rK&&(p=rK),p=p.indexOf("blob:")!==0?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",n=Oe=>{var ui=new XMLHttpRequest;return ui.open("GET",Oe,!1),ui.send(null),ui.responseText},c&&(o=Oe=>{var ui=new XMLHttpRequest;return ui.open("GET",Oe,!1),ui.responseType="arraybuffer",ui.send(null),new Uint8Array(ui.response)}),s=(Oe,ui,Zi)=>{var Or=new XMLHttpRequest;Or.open("GET",Oe,!0),Or.responseType="arraybuffer",Or.onload=()=>{Or.status==200||Or.status==0&&Or.response?ui(Or.response):Zi()},Or.onerror=Zi,Or.send(null)});var S,I,R=console.log.bind(console),L=console.error.bind(console);Object.assign(r,a),a=null,typeof WebAssembly!="object"&&$e("no native wasm support detected");var k,B,$,V,Y,K,Q,re=!1;function ne(Oe,ui){Oe||$e(ui)}function de(){var Oe=I.buffer;r.HEAP8=k=new Int8Array(Oe),r.HEAP16=$=new Int16Array(Oe),r.HEAPU8=B=new Uint8Array(Oe),r.HEAPU16=new Uint16Array(Oe),r.HEAP32=V=new Int32Array(Oe),r.HEAPU32=Y=new Uint32Array(Oe),r.HEAPF32=K=new Float32Array(Oe),r.HEAPF64=Q=new Float64Array(Oe)}var pe=[],H=[],Z=[];function ae(){ct(pe)}function fe(){ct(H)}function be(){ct(Z)}function _e(Oe){H.unshift(Oe)}var Ie=0,Te=null;function Be(Oe){Ie++}function Ve(Oe){if(--Ie==0&&Te){var ui=Te;Te=null,ui()}}function $e(Oe){L(Oe="Aborted("+Oe+")"),re=!0,Oe+=". Build with -sASSERTIONS for more info.";var ui=new WebAssembly.RuntimeError(Oe);throw t(ui),ui}var tt,yt="data:application/octet-stream;base64,";function Ct(Oe){return Oe.startsWith(yt)}function ot(Oe){return Oe.startsWith("file://")}function vt(Oe){if(Oe==tt&&S)return new Uint8Array(S);if(o)return o(Oe);throw"both async and sync fetching of the wasm failed"}function At(Oe){if(u||c){if(typeof fetch=="function"&&!ot(Oe))return fetch(Oe,{credentials:"same-origin"}).then(ui=>{if(!ui.ok)throw"failed to load wasm binary file at '"+Oe+"'";return ui.arrayBuffer()}).catch(()=>vt(Oe));if(s)return new Promise((ui,Zi)=>{s(Oe,Or=>ui(new Uint8Array(Or)),Zi)})}return Promise.resolve().then(()=>vt(Oe))}function Je(Oe,ui,Zi){return At(Oe).then(Or=>WebAssembly.instantiate(Or,ui)).then(Or=>Or).then(Zi,Or=>{L(`failed to asynchronously prepare wasm: ${Or}`),$e(Or)})}function it(Oe,ui,Zi,Or){return Oe||typeof WebAssembly.instantiateStreaming!="function"||Ct(ui)||ot(ui)||h||typeof fetch!="function"?Je(ui,Zi,Or):fetch(ui,{credentials:"same-origin"}).then(wn=>WebAssembly.instantiateStreaming(wn,Zi).then(Or,function(vo){return L(`wasm streaming compile failed: ${vo}`),L("falling back to ArrayBuffer instantiation"),Je(ui,Zi,Or)}))}function Ue(){var Oe={a:j};function ui(Or,wn){return W=Or.exports,I=W.t,de(),_e(W.u),Ve(),W}function Zi(Or){ui(Or.instance)}return Be(),it(S,tt,Oe,Zi).catch(t),{}}Ct(tt="pe-wasm.wasm")||(tt=m(tt));var ct=Oe=>{for(;Oe.length>0;)Oe.shift()(r)};function st(Oe,ui="i8"){switch(ui.endsWith("*")&&(ui="*"),ui){case"i1":case"i8":return k[Oe>>0];case"i16":return $[Oe>>1];case"i32":return V[Oe>>2];case"i64":$e("to do getValue(i64) use WASM_BIGINT");case"float":return K[Oe>>2];case"double":return Q[Oe>>3];case"*":return Y[Oe>>2];default:$e(`invalid type for getValue: ${ui}`)}}var Ze=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,ye=(Oe,ui,Zi)=>{for(var Or=ui+Zi,wn=ui;Oe[wn]&&!(wn>=Or);)++wn;if(wn-ui>16&&Oe.buffer&&Ze)return Ze.decode(Oe.subarray(ui,wn));for(var vo="";ui>10,56320|1023&aT)}}else vo+=String.fromCharCode((31&iu)<<6|Ol)}else vo+=String.fromCharCode(iu)}return vo},Ke=(Oe,ui)=>Oe?ye(B,Oe,ui):"";function ke(Oe,ui,Zi){return 0}var me=(Oe,ui,Zi,Or)=>{if(!(Or>0))return 0;for(var wn=Zi,vo=Zi+Or-1,iu=0;iu=55296&&Ol<=57343&&(Ol=65536+((1023&Ol)<<10)|1023&Oe.charCodeAt(++iu)),Ol<=127){if(Zi>=vo)break;ui[Zi++]=Ol}else if(Ol<=2047){if(Zi+1>=vo)break;ui[Zi++]=192|Ol>>6,ui[Zi++]=128|63&Ol}else if(Ol<=65535){if(Zi+2>=vo)break;ui[Zi++]=224|Ol>>12,ui[Zi++]=128|Ol>>6&63,ui[Zi++]=128|63&Ol}else{if(Zi+3>=vo)break;ui[Zi++]=240|Ol>>18,ui[Zi++]=128|Ol>>12&63,ui[Zi++]=128|Ol>>6&63,ui[Zi++]=128|63&Ol}}return ui[Zi]=0,Zi-wn},ie=(Oe,ui,Zi)=>me(Oe,B,ui,Zi);function ge(Oe,ui,Zi){return 0}function je(Oe,ui,Zi,Or){}var rt=Oe=>Oe%4==0&&(Oe%100!=0||Oe%400==0),Me=[0,31,60,91,121,152,182,213,244,274,305,335],ht=[0,31,59,90,120,151,181,212,243,273,304,334],Ht=Oe=>(rt(Oe.getFullYear())?Me:ht)[Oe.getMonth()]+Oe.getDate()-1,_t=(Oe,ui)=>ui+2097152>>>0<4194305-!!Oe?(Oe>>>0)+4294967296*ui:NaN;function Fe(Oe,ui,Zi){var Or=_t(Oe,ui),wn=new Date(1e3*Or);V[Zi>>2]=wn.getSeconds(),V[Zi+4>>2]=wn.getMinutes(),V[Zi+8>>2]=wn.getHours(),V[Zi+12>>2]=wn.getDate(),V[Zi+16>>2]=wn.getMonth(),V[Zi+20>>2]=wn.getFullYear()-1900,V[Zi+24>>2]=wn.getDay();var vo=0|Ht(wn);V[Zi+28>>2]=vo,V[Zi+36>>2]=-60*wn.getTimezoneOffset();var iu=new Date(wn.getFullYear(),0,1),Ol=new Date(wn.getFullYear(),6,1).getTimezoneOffset(),jm=iu.getTimezoneOffset(),aT=0|(Ol!=jm&&wn.getTimezoneOffset()==Math.min(jm,Ol));V[Zi+32>>2]=aT}var Yt=Oe=>{for(var ui=0,Zi=0;Zi=55296&&Or<=57343?(ui+=4,++Zi):ui+=3}return ui},A=Oe=>{var ui=Yt(Oe)+1,Zi=J(ui);return Zi&&ie(Oe,Zi,ui),Zi},ue=()=>2147483648,G=Oe=>{var ui=(Oe-I.buffer.byteLength+65535)/65536;try{return I.grow(ui),de(),1}catch{}},E={},_=()=>l||"./this.program",g=()=>{if(!g.strings){var Oe={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_()};for(var ui in E)E[ui]===void 0?delete Oe[ui]:Oe[ui]=E[ui];var Zi=[];for(var ui in Oe)Zi.push(`${ui}=${Oe[ui]}`);g.strings=Zi}return g.strings},b=(Oe,ui)=>{for(var Zi=0;Zi>0]=Oe.charCodeAt(Zi);k[ui>>0]=0};function C(Oe,ui,Zi,Or,wn){return 70}var O=[null,[],[]],F=(Oe,ui)=>{var Zi=O[Oe];ui===0||ui===10?((Oe===1?R:L)(ye(Zi,0)),Zi.length=0):Zi.push(ui)};function N(Oe,ui,Zi){var Or=Yt(Oe)+1,wn=new Array(Or);return me(Oe,wn,0,wn.length),wn}var j={c:ke,r:(Oe,ui,Zi)=>{},h:ge,d:je,p:Oe=>{},o:(Oe,ui)=>{},q:(Oe,ui,Zi)=>{},j:Fe,n:(Oe,ui,Zi)=>{var Or=new Date().getFullYear(),wn=new Date(Or,0,1),vo=new Date(Or,6,1),iu=wn.getTimezoneOffset(),Ol=vo.getTimezoneOffset(),jm=Math.max(iu,Ol);function aT(vL){var Qb=vL.toTimeString().match(/\(([A-Za-z ]+)\)$/);return Qb?Qb[1]:"GMT"}Y[Oe>>2]=60*jm,V[ui>>2]=+(iu!=Ol);var CX=aT(wn),yL=aT(vo),E7=A(CX),I7=A(yL);Ol>2]=E7,Y[Zi+4>>2]=I7):(Y[Zi>>2]=I7,Y[Zi+4>>2]=E7)},l:()=>{$e("")},i:()=>Date.now(),s:(Oe,ui,Zi)=>B.copyWithin(Oe,ui,ui+Zi),m:Oe=>{var ui=B.length;Oe>>>=0;var Zi=ue();if(Oe>Zi)return!1;for(var Or=(Ol,jm)=>Ol+(jm-Ol%jm)%jm,wn=1;wn<=4;wn*=2){var vo=ui*(1+.2/wn);vo=Math.min(vo,Oe+100663296);var iu=Math.min(Zi,Or(Math.max(Oe,vo),65536));if(G(iu))return!0}return!1},e:(Oe,ui)=>{var Zi=0;return g().forEach((Or,wn)=>{var vo=ui+Zi;Y[Oe+4*wn>>2]=vo,b(Or,vo),Zi+=Or.length+1}),0},f:(Oe,ui)=>{var Zi=g();Y[Oe>>2]=Zi.length;var Or=0;return Zi.forEach(wn=>Or+=wn.length+1),Y[ui>>2]=Or,0},a:Oe=>52,g:(Oe,ui,Zi,Or)=>52,k:C,b:(Oe,ui,Zi,Or)=>{for(var wn=0,vo=0;vo>2],Ol=Y[ui+4>>2];ui+=8;for(var jm=0;jm>2]=wn,0}},W=Ue();r._webidl_free=Oe=>(r._webidl_free=W.v)(Oe),r._webidl_malloc=Oe=>(r._webidl_malloc=W.w)(Oe);var q,J=Oe=>(J=W.x)(Oe),ee=r._emscripten_bind_PeObject_getCode_0=Oe=>(ee=r._emscripten_bind_PeObject_getCode_0=W.y)(Oe),he=r._emscripten_bind_PeObject_getName_1=(Oe,ui)=>(he=r._emscripten_bind_PeObject_getName_1=W.z)(Oe,ui),Ee=r._emscripten_bind_PeObject_getType_0=Oe=>(Ee=r._emscripten_bind_PeObject_getType_0=W.A)(Oe),De=r._emscripten_bind_PeCoordsys_getCode_0=Oe=>(De=r._emscripten_bind_PeCoordsys_getCode_0=W.B)(Oe),pt=r._emscripten_bind_PeCoordsys_getName_1=(Oe,ui)=>(pt=r._emscripten_bind_PeCoordsys_getName_1=W.C)(Oe,ui),Et=r._emscripten_bind_PeCoordsys_getType_0=Oe=>(Et=r._emscripten_bind_PeCoordsys_getType_0=W.D)(Oe),Ye=r._emscripten_bind_VoidPtr___destroy___0=Oe=>(Ye=r._emscripten_bind_VoidPtr___destroy___0=W.E)(Oe),jt=r._emscripten_bind_PeDatum_getSpheroid_0=Oe=>(jt=r._emscripten_bind_PeDatum_getSpheroid_0=W.F)(Oe),ei=r._emscripten_bind_PeDatum_getCode_0=Oe=>(ei=r._emscripten_bind_PeDatum_getCode_0=W.G)(Oe),Xt=r._emscripten_bind_PeDatum_getName_1=(Oe,ui)=>(Xt=r._emscripten_bind_PeDatum_getName_1=W.H)(Oe,ui),wi=r._emscripten_bind_PeDatum_getType_0=Oe=>(wi=r._emscripten_bind_PeDatum_getType_0=W.I)(Oe),pi=r._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=Oe=>(pi=r._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=W.J)(Oe),Ri=r._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=Oe=>(Ri=r._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=W.K)(Oe),Ui=r._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=Oe=>(Ui=r._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=W.L)(Oe),Bi=r._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=Oe=>(Bi=r._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=W.M)(Oe),mi=r._emscripten_bind_PeDefs_get_PE_DD_MAX_0=Oe=>(mi=r._emscripten_bind_PeDefs_get_PE_DD_MAX_0=W.N)(Oe),ar=r._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=Oe=>(ar=r._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=W.O)(Oe),z=r._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=Oe=>(z=r._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=W.P)(Oe),Wi=r._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=Oe=>(Wi=r._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=W.Q)(Oe),Fr=r._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=Oe=>(Fr=r._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=W.R)(Oe),ds=r._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=Oe=>(ds=r._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=W.S)(Oe),Dt=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=Oe=>(Dt=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=W.T)(Oe),Mn=r._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=Oe=>(Mn=r._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=W.U)(Oe),yn=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=Oe=>(yn=r._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=W.V)(Oe),Pt=r._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=Oe=>(Pt=r._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=W.W)(Oe),Un=r._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=Oe=>(Un=r._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=W.X)(Oe),Qi=r._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=Oe=>(Qi=r._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=W.Y)(Oe),Cn=r._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=Oe=>(Cn=r._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=W.Z)(Oe),bs=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=Oe=>(bs=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=W._)(Oe),qn=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=Oe=>(qn=r._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=W.$)(Oe),ko=r._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=Oe=>(ko=r._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=W.aa)(Oe),ai=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=Oe=>(ai=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=W.ba)(Oe),Al=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=Oe=>(Al=r._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=W.ca)(Oe),eu=r._emscripten_bind_PeDefs_get_PE_PARM_X0_0=Oe=>(eu=r._emscripten_bind_PeDefs_get_PE_PARM_X0_0=W.da)(Oe),Ma=r._emscripten_bind_PeDefs_get_PE_PARM_ND_0=Oe=>(Ma=r._emscripten_bind_PeDefs_get_PE_PARM_ND_0=W.ea)(Oe),_n=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=Oe=>(_n=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=W.fa)(Oe),Ss=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=Oe=>(Ss=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=W.ga)(Oe),la=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=Oe=>(la=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=W.ha)(Oe),gi=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=Oe=>(gi=r._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=W.ia)(Oe),lr=r._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=Oe=>(lr=r._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=W.ja)(Oe),Rr=r._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=Oe=>(Rr=r._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=W.ka)(Oe),Os=r._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=Oe=>(Os=r._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=W.la)(Oe),Js=r._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=Oe=>(Js=r._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=W.ma)(Oe),vs=r._emscripten_bind_PeFactory_initialize_1=(Oe,ui)=>(vs=r._emscripten_bind_PeFactory_initialize_1=W.na)(Oe,ui),na=r._emscripten_bind_PeFactory_factoryByType_2=(Oe,ui,Zi)=>(na=r._emscripten_bind_PeFactory_factoryByType_2=W.oa)(Oe,ui,Zi),gl=r._emscripten_bind_PeFactory_fromString_2=(Oe,ui,Zi)=>(gl=r._emscripten_bind_PeFactory_fromString_2=W.pa)(Oe,ui,Zi),fn=r._emscripten_bind_PeFactory_getCode_1=(Oe,ui)=>(fn=r._emscripten_bind_PeFactory_getCode_1=W.qa)(Oe,ui),qr=r._emscripten_bind_PeGCSExtent_PeGCSExtent_6=(Oe,ui,Zi,Or,wn,vo)=>(qr=r._emscripten_bind_PeGCSExtent_PeGCSExtent_6=W.ra)(Oe,ui,Zi,Or,wn,vo),Gu=r._emscripten_bind_PeGCSExtent_getLLon_0=Oe=>(Gu=r._emscripten_bind_PeGCSExtent_getLLon_0=W.sa)(Oe),dc=r._emscripten_bind_PeGCSExtent_getSLat_0=Oe=>(dc=r._emscripten_bind_PeGCSExtent_getSLat_0=W.ta)(Oe),Re=r._emscripten_bind_PeGCSExtent_getRLon_0=Oe=>(Re=r._emscripten_bind_PeGCSExtent_getRLon_0=W.ua)(Oe),Ne=r._emscripten_bind_PeGCSExtent_getNLat_0=Oe=>(Ne=r._emscripten_bind_PeGCSExtent_getNLat_0=W.va)(Oe),dt=r._emscripten_bind_PeGCSExtent___destroy___0=Oe=>(dt=r._emscripten_bind_PeGCSExtent___destroy___0=W.wa)(Oe),Gt=r._emscripten_bind_PeGeogcs_getDatum_0=Oe=>(Gt=r._emscripten_bind_PeGeogcs_getDatum_0=W.xa)(Oe),ti=r._emscripten_bind_PeGeogcs_getPrimem_0=Oe=>(ti=r._emscripten_bind_PeGeogcs_getPrimem_0=W.ya)(Oe),oi=r._emscripten_bind_PeGeogcs_getUnit_0=Oe=>(oi=r._emscripten_bind_PeGeogcs_getUnit_0=W.za)(Oe),Hi=r._emscripten_bind_PeGeogcs_getCode_0=Oe=>(Hi=r._emscripten_bind_PeGeogcs_getCode_0=W.Aa)(Oe),Oi=r._emscripten_bind_PeGeogcs_getName_1=(Oe,ui)=>(Oi=r._emscripten_bind_PeGeogcs_getName_1=W.Ba)(Oe,ui),kt=r._emscripten_bind_PeGeogcs_getType_0=Oe=>(kt=r._emscripten_bind_PeGeogcs_getType_0=W.Ca)(Oe),Xe=r._emscripten_bind_PeGeogtran_isEqual_1=(Oe,ui)=>(Xe=r._emscripten_bind_PeGeogtran_isEqual_1=W.Da)(Oe,ui),Le=r._emscripten_bind_PeGeogtran_getGeogcs1_0=Oe=>(Le=r._emscripten_bind_PeGeogtran_getGeogcs1_0=W.Ea)(Oe),xt=r._emscripten_bind_PeGeogtran_getGeogcs2_0=Oe=>(xt=r._emscripten_bind_PeGeogtran_getGeogcs2_0=W.Fa)(Oe),Zt=r._emscripten_bind_PeGeogtran_getParameters_0=Oe=>(Zt=r._emscripten_bind_PeGeogtran_getParameters_0=W.Ga)(Oe),Rt=r._emscripten_bind_PeGeogtran_loadConstants_0=Oe=>(Rt=r._emscripten_bind_PeGeogtran_loadConstants_0=W.Ha)(Oe),fi=r._emscripten_bind_PeGeogtran_getCode_0=Oe=>(fi=r._emscripten_bind_PeGeogtran_getCode_0=W.Ia)(Oe),Fi=r._emscripten_bind_PeGeogtran_getName_1=(Oe,ui)=>(Fi=r._emscripten_bind_PeGeogtran_getName_1=W.Ja)(Oe,ui),mr=r._emscripten_bind_PeGeogtran_getType_0=Oe=>(mr=r._emscripten_bind_PeGeogtran_getType_0=W.Ka)(Oe),yr=r._emscripten_bind_PeGTlistExtended_getGTlist_6=(Oe,ui,Zi,Or,wn,vo,iu)=>(yr=r._emscripten_bind_PeGTlistExtended_getGTlist_6=W.La)(Oe,ui,Zi,Or,wn,vo,iu),Gr=r._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=Oe=>(Gr=r._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=W.Ma)(Oe),zr=r._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=Oe=>(zr=r._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=W.Na)(Oe),jn=r._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=Oe=>(jn=r._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=W.Oa)(Oe),co=r._emscripten_bind_PeGTlistExtendedEntry_Delete_1=(Oe,ui)=>(co=r._emscripten_bind_PeGTlistExtendedEntry_Delete_1=W.Pa)(Oe,ui),ua=r._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=Oe=>(ua=r._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=W.Qa)(Oe),Hs=r._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=Oe=>(Hs=r._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=W.Ra)(Oe),Ll=r._emscripten_bind_PeHorizon_getNump_0=Oe=>(Ll=r._emscripten_bind_PeHorizon_getNump_0=W.Sa)(Oe),ft=r._emscripten_bind_PeHorizon_getKind_0=Oe=>(ft=r._emscripten_bind_PeHorizon_getKind_0=W.Ta)(Oe),Wt=r._emscripten_bind_PeHorizon_getInclusive_0=Oe=>(Wt=r._emscripten_bind_PeHorizon_getInclusive_0=W.Ua)(Oe),hi=r._emscripten_bind_PeHorizon_getSize_0=Oe=>(hi=r._emscripten_bind_PeHorizon_getSize_0=W.Va)(Oe),Pi=r._emscripten_bind_PeHorizon_getCoord_0=Oe=>(Pi=r._emscripten_bind_PeHorizon_getCoord_0=W.Wa)(Oe),vr=r._emscripten_bind_PeInteger_PeInteger_1=Oe=>(vr=r._emscripten_bind_PeInteger_PeInteger_1=W.Xa)(Oe),Lr=r._emscripten_bind_PeInteger_get_val_0=Oe=>(Lr=r._emscripten_bind_PeInteger_get_val_0=W.Ya)(Oe),on=r._emscripten_bind_PeInteger_set_val_1=(Oe,ui)=>(on=r._emscripten_bind_PeInteger_set_val_1=W.Za)(Oe,ui),dn=r._emscripten_bind_PeInteger___destroy___0=Oe=>(dn=r._emscripten_bind_PeInteger___destroy___0=W._a)(Oe),Ir=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=Oe=>(Ir=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=W.$a)(Oe),$n=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=Oe=>($n=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=W.ab)(Oe),fa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=Oe=>(fa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=W.bb)(Oe),Sa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=Oe=>(Sa=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=W.cb)(Oe),ma=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=Oe=>(ma=r._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=W.db)(Oe),go=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=Oe=>(go=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=W.eb)(Oe),tu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=Oe=>(tu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=W.fb)(Oe),Uu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=Oe=>(Uu=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=W.gb)(Oe),pc=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=Oe=>(pc=r._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=W.hb)(Oe),Fh=r._emscripten_bind_PeParameter_getValue_0=Oe=>(Fh=r._emscripten_bind_PeParameter_getValue_0=W.ib)(Oe),Zr=r._emscripten_bind_PeParameter_getCode_0=Oe=>(Zr=r._emscripten_bind_PeParameter_getCode_0=W.jb)(Oe),Ps=r._emscripten_bind_PeParameter_getName_1=(Oe,ui)=>(Ps=r._emscripten_bind_PeParameter_getName_1=W.kb)(Oe,ui),ca=r._emscripten_bind_PeParameter_getType_0=Oe=>(ca=r._emscripten_bind_PeParameter_getType_0=W.lb)(Oe),Ou=r._emscripten_bind_PePCSInfo_getCentralMeridian_0=Oe=>(Ou=r._emscripten_bind_PePCSInfo_getCentralMeridian_0=W.mb)(Oe),Za=r._emscripten_bind_PePCSInfo_getDomainMinx_0=Oe=>(Za=r._emscripten_bind_PePCSInfo_getDomainMinx_0=W.nb)(Oe),kh=r._emscripten_bind_PePCSInfo_getDomainMiny_0=Oe=>(kh=r._emscripten_bind_PePCSInfo_getDomainMiny_0=W.ob)(Oe),Qv=r._emscripten_bind_PePCSInfo_getDomainMaxx_0=Oe=>(Qv=r._emscripten_bind_PePCSInfo_getDomainMaxx_0=W.pb)(Oe),_y=r._emscripten_bind_PePCSInfo_getDomainMaxy_0=Oe=>(_y=r._emscripten_bind_PePCSInfo_getDomainMaxy_0=W.qb)(Oe),I0=r._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=Oe=>(I0=r._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=W.rb)(Oe),e1=r._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=Oe=>(e1=r._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=W.sb)(Oe),Nl=r._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=Oe=>(Nl=r._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=W.tb)(Oe),Sp=r._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=Oe=>(Sp=r._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=W.ub)(Oe),Ml=r._emscripten_bind_PePCSInfo_isDensificationNeeded_0=Oe=>(Ml=r._emscripten_bind_PePCSInfo_isDensificationNeeded_0=W.vb)(Oe),Og=r._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=Oe=>(Og=r._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=W.wb)(Oe),Xc=r._emscripten_bind_PePCSInfo_isPannableRectangle_0=Oe=>(Xc=r._emscripten_bind_PePCSInfo_isPannableRectangle_0=W.xb)(Oe),Bm=r._emscripten_bind_PePCSInfo_generate_2=(Oe,ui,Zi)=>(Bm=r._emscripten_bind_PePCSInfo_generate_2=W.yb)(Oe,ui,Zi),by=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=Oe=>(by=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=W.zb)(Oe),A0=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=Oe=>(A0=r._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=W.Ab)(Oe),Nf=r._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=Oe=>(Nf=r._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=W.Bb)(Oe),Pg=r._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=Oe=>(Pg=r._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=W.Cb)(Oe),Kd=r._emscripten_bind_PePrimem_getLongitude_0=Oe=>(Kd=r._emscripten_bind_PePrimem_getLongitude_0=W.Db)(Oe),$f=r._emscripten_bind_PePrimem_getCode_0=Oe=>($f=r._emscripten_bind_PePrimem_getCode_0=W.Eb)(Oe),Jc=r._emscripten_bind_PePrimem_getName_1=(Oe,ui)=>(Jc=r._emscripten_bind_PePrimem_getName_1=W.Fb)(Oe,ui),t1=r._emscripten_bind_PePrimem_getType_0=Oe=>(t1=r._emscripten_bind_PePrimem_getType_0=W.Gb)(Oe),hh=r._emscripten_bind_PeProjcs_getGeogcs_0=Oe=>(hh=r._emscripten_bind_PeProjcs_getGeogcs_0=W.Hb)(Oe),Lh=r._emscripten_bind_PeProjcs_getParameters_0=Oe=>(Lh=r._emscripten_bind_PeProjcs_getParameters_0=W.Ib)(Oe),fc=r._emscripten_bind_PeProjcs_getUnit_0=Oe=>(fc=r._emscripten_bind_PeProjcs_getUnit_0=W.Jb)(Oe),rn=r._emscripten_bind_PeProjcs_loadConstants_0=Oe=>(rn=r._emscripten_bind_PeProjcs_loadConstants_0=W.Kb)(Oe),Qa=r._emscripten_bind_PeProjcs_horizonGcsGenerate_0=Oe=>(Qa=r._emscripten_bind_PeProjcs_horizonGcsGenerate_0=W.Lb)(Oe),wy=r._emscripten_bind_PeProjcs_horizonPcsGenerate_0=Oe=>(wy=r._emscripten_bind_PeProjcs_horizonPcsGenerate_0=W.Mb)(Oe),ve=r._emscripten_bind_PeProjcs_getCode_0=Oe=>(ve=r._emscripten_bind_PeProjcs_getCode_0=W.Nb)(Oe),oe=r._emscripten_bind_PeProjcs_getName_1=(Oe,ui)=>(oe=r._emscripten_bind_PeProjcs_getName_1=W.Ob)(Oe,ui),ce=r._emscripten_bind_PeProjcs_getType_0=Oe=>(ce=r._emscripten_bind_PeProjcs_getType_0=W.Pb)(Oe),we=r._emscripten_bind_PeSpheroid_getAxis_0=Oe=>(we=r._emscripten_bind_PeSpheroid_getAxis_0=W.Qb)(Oe),He=r._emscripten_bind_PeSpheroid_getFlattening_0=Oe=>(He=r._emscripten_bind_PeSpheroid_getFlattening_0=W.Rb)(Oe),St=r._emscripten_bind_PeSpheroid_getCode_0=Oe=>(St=r._emscripten_bind_PeSpheroid_getCode_0=W.Sb)(Oe),ut=r._emscripten_bind_PeSpheroid_getName_1=(Oe,ui)=>(ut=r._emscripten_bind_PeSpheroid_getName_1=W.Tb)(Oe,ui),Bt=r._emscripten_bind_PeSpheroid_getType_0=Oe=>(Bt=r._emscripten_bind_PeSpheroid_getType_0=W.Ub)(Oe),Ge=r._emscripten_bind_PeUnit_getUnitFactor_0=Oe=>(Ge=r._emscripten_bind_PeUnit_getUnitFactor_0=W.Vb)(Oe),et=r._emscripten_bind_PeUnit_getCode_0=Oe=>(et=r._emscripten_bind_PeUnit_getCode_0=W.Wb)(Oe),zt=r._emscripten_bind_PeUnit_getName_1=(Oe,ui)=>(zt=r._emscripten_bind_PeUnit_getName_1=W.Xb)(Oe,ui),ii=r._emscripten_bind_PeUnit_getType_0=Oe=>(ii=r._emscripten_bind_PeUnit_getType_0=W.Yb)(Oe),te=r._emscripten_bind_PeVersion_version_string_0=Oe=>(te=r._emscripten_bind_PeVersion_version_string_0=W.Zb)(Oe);function xe(){function Oe(){q||(q=!0,r.calledRun=!0,re||(fe(),e(r),be()))}Ie>0||(ae(),Ie>0||Oe())}function Ae(){}function lt(Oe){return(Oe||Ae).__cache__}function nt(Oe,ui){var Zi=lt(ui),Or=Zi[Oe];return Or||((Or=Object.create((ui||Ae).prototype)).ptr=Oe,Zi[Oe]=Or)}function It(Oe,ui){return nt(Oe.ptr,ui)}function Nt(Oe){if(!Oe.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";Oe.__destroy__(),delete lt(Oe.__class__)[Oe.ptr]}function Ut(Oe,ui){return Oe.ptr===ui.ptr}function Jt(Oe){return Oe.ptr}function xi(Oe){return Oe.__class__}r._pe_getPeGTlistExtendedEntrySize=()=>(r._pe_getPeGTlistExtendedEntrySize=W._b)(),r._pe_getPeGTlistExtendedGTsSize=()=>(r._pe_getPeGTlistExtendedGTsSize=W.$b)(),r._pe_getPeHorizonSize=()=>(r._pe_getPeHorizonSize=W.ac)(),r._pe_geog_to_geog=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_geog=W.cc)(Oe,ui,Zi,Or,wn),r._pe_geog_to_proj=(Oe,ui,Zi)=>(r._pe_geog_to_proj=W.dc)(Oe,ui,Zi),r._pe_geog_to_dd=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_dd=W.ec)(Oe,ui,Zi,Or,wn),r._pe_dd_to_geog=(Oe,ui,Zi,Or)=>(r._pe_dd_to_geog=W.fc)(Oe,ui,Zi,Or),r._pe_geog_to_ddm=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_ddm=W.gc)(Oe,ui,Zi,Or,wn),r._pe_ddm_to_geog=(Oe,ui,Zi,Or)=>(r._pe_ddm_to_geog=W.hc)(Oe,ui,Zi,Or),r._pe_geog_to_dms=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_dms=W.ic)(Oe,ui,Zi,Or,wn),r._pe_dms_to_geog=(Oe,ui,Zi,Or)=>(r._pe_dms_to_geog=W.jc)(Oe,ui,Zi,Or),r._pe_geog_to_mgrs_extended=(Oe,ui,Zi,Or,wn,vo,iu)=>(r._pe_geog_to_mgrs_extended=W.kc)(Oe,ui,Zi,Or,wn,vo,iu),r._pe_mgrs_to_geog_extended=(Oe,ui,Zi,Or,wn)=>(r._pe_mgrs_to_geog_extended=W.lc)(Oe,ui,Zi,Or,wn),r._pe_geog_to_usng=(Oe,ui,Zi,Or,wn,vo,iu)=>(r._pe_geog_to_usng=W.mc)(Oe,ui,Zi,Or,wn,vo,iu),r._pe_usng_to_geog=(Oe,ui,Zi,Or)=>(r._pe_usng_to_geog=W.nc)(Oe,ui,Zi,Or),r._pe_geog_to_utm=(Oe,ui,Zi,Or,wn)=>(r._pe_geog_to_utm=W.oc)(Oe,ui,Zi,Or,wn),r._pe_utm_to_geog=(Oe,ui,Zi,Or,wn)=>(r._pe_utm_to_geog=W.pc)(Oe,ui,Zi,Or,wn),r._pe_object_to_string_ext=(Oe,ui,Zi)=>(r._pe_object_to_string_ext=W.qc)(Oe,ui,Zi),r._pe_proj_to_geog_center=(Oe,ui,Zi,Or)=>(r._pe_proj_to_geog_center=W.rc)(Oe,ui,Zi,Or),r.___start_em_js=2033306,r.___stop_em_js=2033404,r.getValue=st,r.UTF8ToString=Ke,Te=function Oe(){q||xe(),q||(Te=Oe)},xe(),Ae.prototype=Object.create(Ae.prototype),Ae.prototype.constructor=Ae,Ae.prototype.__class__=Ae,Ae.__cache__={},r.WrapperObject=Ae,r.getCache=lt,r.wrapPointer=nt,r.castObject=It,r.NULL=nt(0),r.destroy=Nt,r.compare=Ut,r.getPointer=Jt,r.getClass=xi;var Di={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(Di.needed){for(var Oe=0;Oe=Di.size?(ne(wn>0),Di.needed+=wn,Zi=r._webidl_malloc(wn),Di.temps.push(Zi)):(Zi=Di.buffer+Di.pos,Di.pos+=wn),Zi},copy(Oe,ui,Zi){switch(Zi>>>=0,ui.BYTES_PER_ELEMENT){case 2:Zi>>>=1;break;case 4:Zi>>>=2;break;case 8:Zi>>>=3}for(var Or=0;Orn?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=r,this._maxValue=n>-3e38?n:0)}},aNr=class{constructor(e,t,r,n,s={}){this._mainMethod=t,this._transferLists=r,this._listeners=[],this._promise=$R(e,{...s,schedule:n}).then(o=>{if(this._thread===void 0){this._thread=o,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const a of this._listeners)this._connectListener(a)}else o.close()}),this._promise.catch(o=>di.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,t){const r={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(r),this._connectListener(r),wa(()=>{r.removed=!0,FUe(this._listeners,r),this._thread&&r.threadHandle!=null&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,r){if(this._thread){const n=this._transferLists[e],s=n?n(t):[];return this._thread.invoke(e,t,{transferList:s,signal:r})}return this._promise?this._promise.then(()=>(hn(r),this.invokeMethod(e,t,r))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}},hdt=class extends aNr{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},r):Promise.resolve(null)}release(){--this.ref<=0&&(cre.forEach((e,t)=>{e===this&&cre.delete(t)}),this.destroy())}};const cre=new Map;function lNr(i=null){let e=cre.get(i);return e||(i!=null?(e=new hdt(t=>i.immediate.schedule(t)),cre.set(i,e)):(e=new hdt,cre.set(null,e))),++e.ref,e}let Qm=class extends JHe(Xv(Rc(Yc(Ql(Il))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=lNr()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._lercDecoder=e4(this._lercDecoder)}readCapabilities(e,t){const r=t.capabilities&&t.capabilities.split(",").map(n=>n.toLowerCase().trim());return r?{operations:{supportsTileMap:r.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(e,t){let r=t.currentVersion;return r||(r=9.3),r}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:r=>{if(r.typeKeywords){for(let n=0;nthis._fetchImageService(t))),Promise.resolve(this)}fetchTile(e,t,r,n){const s=(n=n||{signal:null}).signal!=null?n.signal:n.signal=new AbortController().signal,o={responseType:"array-buffer",signal:s},a={noDataValue:n.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,r,n)).then(()=>zi(this.getTileUrl(e,t,r),o)).then(l=>this._lercDecoder.decode(l.data,a,s)).then(l=>new oNr(l))}getTileUrl(e,t,r){const n=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,s=Lb({...this.parsedUrl.query,blankTile:!n&&null});return`${this.parsedUrl.path}/tile/${e}/${t}/${r}${s?"?"+s:""}`}async queryElevation(e,t){const{ElevationQuery:r}=await Promise.resolve().then(()=>Zbe);return hn(t),new r().query(this,e,t)}async createElevationSampler(e,t){const{ElevationQuery:r}=await Promise.resolve().then(()=>Zbe);return hn(t),new r().createSampler(this,e,t)}_fetchTileAvailability(e,t,r,n){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,t,r,n):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},r=await zi(this.parsedUrl.path,t);r.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[o8t]}};x([D({readOnly:!0})],Qm.prototype,"capabilities",void 0),x([Mi("service","capabilities",["capabilities"])],Qm.prototype,"readCapabilities",null),x([D({json:{read:{source:"copyrightText"}}})],Qm.prototype,"copyright",void 0),x([D({readOnly:!0,type:DY})],Qm.prototype,"heightModelInfo",void 0),x([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Qm.prototype,"path",void 0),x([D({type:["show","hide"]})],Qm.prototype,"listMode",void 0),x([D({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],Qm.prototype,"minScale",void 0),x([D({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],Qm.prototype,"maxScale",void 0),x([D({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],Qm.prototype,"opacity",void 0),x([D({type:["ArcGISTiledElevationServiceLayer"]})],Qm.prototype,"operationalLayerType",void 0),x([D()],Qm.prototype,"sourceJSON",void 0),x([D({json:{read:!1},value:"elevation",readOnly:!0})],Qm.prototype,"type",void 0),x([D(C0)],Qm.prototype,"url",void 0),x([D()],Qm.prototype,"version",void 0),x([Mi("version",["currentVersion"])],Qm.prototype,"readVersion",null),Qm=x([Qe("esri.layers.ElevationLayer")],Qm);const o8t=Symbol("default-fetch-tile");Qm.prototype.fetchTile[o8t]=!0;const uNr=Qm,a8t=Object.freeze(Object.defineProperty({__proto__:null,default:uNr},Symbol.toStringTag,{value:"Module"}));async function cNr(i,e={},t){await i.load(t);const r=Iu(i.itemUrl,"resources"),{start:n=1,num:s=10,sortOrder:o="asc",sortField:a="resource"}=e,l={query:{start:n,num:s,sortOrder:o,sortField:a,token:i.apiKey},signal:t?.signal},u=await i.portal.request(r,l);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:c,size:h,resource:p})=>({created:new Date(c),size:h,resource:i.resourceFromPath(p)}))}}async function hNr(i,e,t,r){const n=new Map;for(const{resource:o,content:a,compress:l,access:u}of e){if(!o.hasPath())throw new qe(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const[c,h]=l8t(o.path),p=`${c}/${l??""}/${u??""}`;n.has(p)||n.set(p,{prefix:c,compress:l,access:u,files:[]}),n.get(p).files.push({fileName:h,content:a})}await i.load(r);const s=Iu(i.userItemUrl,t==="add"?"addResources":"updateResources");for(const{prefix:o,compress:a,access:l,files:u}of n.values())for(let h=0;h(await Promise.resolve().then(()=>FFn)).default,BuildingSceneLayer:async()=>(await Promise.resolve().then(()=>ekn)).default,CatalogLayer:async()=>(await Promise.resolve().then(()=>akn)).default,CSVLayer:async()=>(await Promise.resolve().then(()=>ukn)).default,DimensionLayer:async()=>(await Promise.resolve().then(()=>pkn)).default,ElevationLayer:async()=>(await Promise.resolve().then(()=>a8t)).default,FeatureLayer:async()=>(await Promise.resolve().then(()=>rHe)).default,GeoJSONLayer:async()=>(await Promise.resolve().then(()=>gkn)).default,GeoRSSLayer:async()=>(await Promise.resolve().then(()=>xkn)).default,GroupLayer:async()=>(await Promise.resolve().then(()=>HKt)).default,ImageryLayer:async()=>(await Promise.resolve().then(()=>pdr)).default,ImageryTileLayer:async()=>(await Promise.resolve().then(()=>Jkn)).default,IntegratedMeshLayer:async()=>(await Promise.resolve().then(()=>aLn)).default,KMLLayer:async()=>(await Promise.resolve().then(()=>cLn)).default,LineOfSightLayer:async()=>(await Promise.resolve().then(()=>mLn)).default,LinkChartLayer:async()=>(await Promise.resolve().then(()=>hNn)).default,MapImageLayer:async()=>(await Promise.resolve().then(()=>ipr)).default,MapNotesLayer:async()=>(await Promise.resolve().then(()=>fNn)).default,MediaLayer:async()=>(await Promise.resolve().then(()=>PNn)).default,OGCFeatureLayer:async()=>(await Promise.resolve().then(()=>FNn)).default,OpenStreetMapLayer:async()=>(await Promise.resolve().then(()=>npr)).default,OrientedImageryLayer:async()=>(await Promise.resolve().then(()=>ZNn)).default,PointCloudLayer:async()=>(await Promise.resolve().then(()=>s$n)).default,RouteLayer:async()=>(await Promise.resolve().then(()=>U$n)).default,SceneLayer:async()=>(await Promise.resolve().then(()=>s6n)).default,StreamLayer:async()=>(await Promise.resolve().then(()=>a6n)).default,SubtypeGroupLayer:async()=>(await Promise.resolve().then(()=>f6n)).default,TileLayer:async()=>(await Promise.resolve().then(()=>apr)).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.resolve().then(()=>g6n)).default,UnknownLayer:async()=>(await Promise.resolve().then(()=>v6n)).default,UnsupportedLayer:async()=>(await Promise.resolve().then(()=>b6n)).default,VectorTileLayer:async()=>(await Promise.resolve().then(()=>k6n)).default,VoxelLayer:async()=>(await Promise.resolve().then(()=>W6n)).default,WFSLayer:async()=>(await Promise.resolve().then(()=>Y6n)).default,WMSLayer:async()=>(await Promise.resolve().then(()=>wpr)).default,WMTSLayer:async()=>(await Promise.resolve().then(()=>m8n)).default,WebTileLayer:async()=>(await Promise.resolve().then(()=>rpr)).default};function mNr(i){return NYe(i,"notes")}function gNr(i){return NYe(i,"markup")}function yNr(i){return NYe(i,"route")}function NYe(i,e){return!(!i.layerType||i.layerType!=="ArcGISFeatureLayer")&&i.featureCollectionType===e}async function lle(i,e){const t=r_(i);if(!t)throw new qe("invalid-url","Invalid scene service url");const r={...e,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await vNr(r),r.sceneLayerItem==null)return ddt(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const n=await bNr(r);if(!n?.url)throw new qe("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=n;const s=await ddt(n.url,r);return s.portalItem=n,s}async function vNr(i){const e=(await h8t(i)).serviceItemId;if(!e)return null;const t=new yg({id:e,apiKey:i.apiKey}),r=await _Nr(i);r!=null&&(t.portal=new Bu({url:r}));try{return t.load({signal:i.signal})}catch(n){return _a(n),null}}async function h8t(i){if(i.rootDocument)return i.rootDocument;const e={query:{f:"json",...i.customParameters,token:i.apiKey},responseType:"json",signal:i.signal};try{const t=await zi(i.sceneServerUrl,e);i.rootDocument=t.data}catch{i.rootDocument={}}return i.rootDocument}async function _Nr(i){const e=no?.findServerInfo(i.sceneServerUrl);if(e?.owningSystemUrl)return e.owningSystemUrl;const t=i.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await zi(t,{query:{f:"json"},responseType:"json",signal:i.signal})).data.owningSystemUrl;if(r)return r}catch(r){_a(r)}return null}async function ddt(i,e){const t=r_(i);if(!t)throw new qe("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,n=e.layerId;if(n==null)return{serverUrl:r};const s=h8t(e),o=e.featureServiceItem?await e.featureServiceItem.fetchData("json"):null,a=(o?.layers?.[0]||o?.tables?.[0])?.customParameters,l=v=>{const w={query:{f:"json",...a},responseType:"json",authMode:v,signal:e.signal};return zi(r,w)},u=l("anonymous").catch(()=>l("no-prompt")),[c,h]=await Promise.all([u,s]),p=h?.layers,m=c.data&&c.data.layers;if(!Array.isArray(m))throw new Error("expected layers array");if(Array.isArray(p)){for(let v=0;vn.type==="Feature Service")||null;if(!t)return null;const r=new yg({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return _a(t),null}}function d9(i){const e={id:i.id,name:i.name};return i.type==="Oriented Imagery Layer"&&(e.layerType="OrientedImageryLayer"),e}async function d8t(i,e,t){if(i?.layers==null||i?.tables==null){const r=await t.fetchServiceMetadata(e,{customParameters:TB(i)?.customParameters});(i=i||{}).layers=i.layers||r?.layers?.map(d9),i.tables=i.tables||r?.tables?.map(d9)}return i}function p8t(i){const{layers:e,tables:t}=i;return e?.length?e[0].id:t?.length?t[0].id:null}function TB(i){if(!i)return null;const{layers:e,tables:t}=i;return e?.length?e[0]:t?.length?t[0]:null}function ule(i){return(i?.layers?.length??0)+(i?.tables?.length??0)}function $Ye(i){const e=[];return i?.layers?.forEach(t=>{t.layerType==="SubtypeGroupLayer"&&e.push(t.id)}),e}function f8t(i){return i?.layers?.filter(({layerType:e})=>e==="OrientedImageryLayer").map(({id:e})=>e)}function m8t(i){return i?.layers?.filter(({layerType:e})=>e==="CatalogLayer").map(({id:e})=>e)}async function g8t(i,e,t){if(!i?.url)return e??{};if(e??={},!e.layers){const s=await t.fetchServiceMetadata(i.url);e.layers=s.layers?.map(d9)}const{serverUrl:r,portalItem:n}=await lle(i.url,{sceneLayerItem:i,customParameters:TB(e)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return e.tables=[],e;if(!e.tables&&n){const s=await n.fetchData();if(s?.tables)e.tables=s.tables.map(d9);else{const o=await t.fetchServiceMetadata(r,{customParameters:TB(s)?.customParameters});e.tables=o?.tables?.map(d9)}}if(e.tables)for(const s of e.tables)s.url=`${r}/${s.id}`;return e}async function wNr(i){!i.portalItem||i.portalItem instanceof yg||(i={...i,portalItem:new yg(i.portalItem)});const e=await xNr(i.portalItem);return new e.constructor({portalItem:i.portalItem,...e.properties})}async function xNr(i){await i.load();const e=new ITe;return SNr(await BYe(i,e))}async function BYe(i,e){switch(i.type){case"3DTiles Service":return RNr();case"CSV":return DNr();case"Feature Collection":return INr(i);case"Feature Service":return CNr(i,e);case"Feed":return $Nr();case"GeoJson":return PNr();case"Group Layer":return BNr();case"Image Service":return ANr(i,e);case"KML":return FNr();case"Map Service":return TNr(i,e);case"Media Layer":return jNr();case"Scene Service":return ENr(i,e);case"Stream Service":return MNr();case"Vector Tile Service":return ONr();case"WFS":return kNr();case"WMS":return LNr();case"WMTS":return NNr();default:throw new qe("portal:unknown-item-type","Unknown item type '${type}'",{type:i.type})}}async function SNr(i){const e=i.className,t=xv[e];return{constructor:await t(),properties:i.properties}}async function TNr(i,e){return await GNr(i,e)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function CNr(i,e){const t=await y8t(i,e);if(typeof t=="object"){const{sourceJSON:r,className:n}=t,s={sourceJSON:r};return t.id!=null&&(s.layerId=t.id),{className:n||"FeatureLayer",properties:s}}return{className:"GroupLayer"}}async function ENr(i,e){const t=await y8t(i,e,async()=>{try{if(!i.url)return[];const{serverUrl:r}=await lle(i.url,{sceneLayerItem:i});return(await e.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof t=="object"){const r={};let n;if(t.id!=null?(r.layerId=t.id,n=`${i.url}/layers/${t.id}`):n=i.url,i.typeKeywords?.length){for(const o of Object.keys(_ie))if(i.typeKeywords.includes(o))return{className:_ie[o]}}const s=await e.fetchServiceMetadata(n,{customParameters:await e.fetchCustomParameters(i,o=>TB(o)?.customParameters)});return{className:_ie[s?.layerType]||"SceneLayer",properties:r}}return t===!1&&(await e.fetchServiceMetadata(i.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function INr(i){await i.load();const e=Q8(i,"Map Notes"),t=Q8(i,"Markup");if(e||t)return{className:"MapNotesLayer"};if(Q8(i,"Route Layer"))return{className:"RouteLayer"};const r=await i.fetchData();return ule(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function ANr(i,e){await i.load();const t=i.typeKeywords?.map(l=>l.toLowerCase())??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchItemData(i),n=r?.layerType;if(n==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(n==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const s=await e.fetchServiceMetadata(i.url,{customParameters:await e.fetchCustomParameters(i)}),o=s.cacheType?.toLowerCase(),a=s.capabilities?.toLowerCase().includes("tilesonly");return o==="map"||a?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function MNr(){return{className:"StreamLayer"}}function ONr(){return{className:"VectorTileLayer"}}function PNr(){return{className:"GeoJSONLayer"}}function RNr(){return{className:"IntegratedMesh3DTilesLayer"}}function DNr(){return{className:"CSVLayer"}}function FNr(){return{className:"KMLLayer"}}function kNr(){return{className:"WFSLayer"}}function LNr(){return{className:"WMSLayer"}}function NNr(){return{className:"WMTSLayer"}}function $Nr(){return{className:"StreamLayer"}}function BNr(){return{className:"GroupLayer"}}function jNr(){return{className:"MediaLayer"}}async function GNr(i,e){const{tileInfo:t}=await e.fetchServiceMetadata(i.url,{customParameters:await e.fetchCustomParameters(i)});return t}async function y8t(i,e,t){const{url:r,type:n}=i,s=n==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(s){const l=await e.fetchServiceMetadata(r,{customParameters:await e.fetchCustomParameters(i,u=>TB(u)?.customParameters)});if(l.type==="Oriented Imagery Layer")return{id:l.id,className:"OrientedImageryLayer",sourceJSON:l}}return{}}await i.load();let o=await e.fetchItemData(i);if(s){const l=await d8t(o,r,e),u=gOe(l);if(typeof u=="object"){const c=$Ye(l),h=f8t(l),p=m8t(l);u.className=u.id!=null&&c.includes(u.id)?"SubtypeGroupLayer":u.id!=null&&h?.includes(u.id)?"OrientedImageryLayer":u.id!=null&&p?.includes(u.id)?"CatalogLayer":"FeatureLayer"}return u}if(n==="Scene Service"&&(o=await g8t(i,o,e)),ule(o)>0)return gOe(o);const a=await e.fetchServiceMetadata(r);return t&&(a.tables=await t()),gOe(a)}function gOe(i){return ule(i)===1&&{id:p8t(i)}}const UNr=Object.freeze(Object.defineProperty({__proto__:null,fromItem:wNr,selectLayerClassPath:BYe},Symbol.toStringTag,{value:"Module"}));async function v8t(i,e,t){if(!e)return;const r=e.map(s=>JNr(s,t)),n=await Promise.allSettled(r);for(const s of n)s.status==="rejected"||s.value&&i.add(s.value)}const zNr={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},VNr={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},HNr={ArcGISFeatureLayer:"FeatureLayer"},WNr={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},_8t={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},b8t={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},w8t={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},qNr={..._8t,LinkChartLayer:"LinkChartLayer"},YNr={...b8t},XNr={...w8t};async function JNr(i,e){return KNr(await ZNr(i,e),i,e)}async function KNr(i,e,t){const r=new i;return r.read(e,t.context),r.type==="group"&&(e.layerType==="GroupLayer"?await GYe(r,e,t):jYe(e)?e$r(r,e,t.context):x8t(e)&&await t$r(r,e,t.context)),await Oae(r,t.context),r}async function ZNr(i,e){const t=e.context,r=QNr(t);let n=i.layerType||i.type;!n&&e?.defaultLayerType&&(n=e.defaultLayerType);const s=r[n];let o=s?xv[s]:xv.UnknownLayer;if(jYe(i)){const a=t?.portal;if(i.itemId){const l=new yg({id:i.itemId,portal:a});await l.load();const u=(await BYe(l,new ITe)).className||"UnknownLayer";o=xv[u]}}else n==="ArcGISFeatureLayer"?mNr(i)||gNr(i)?o=xv.MapNotesLayer:yNr(i)?o=xv.RouteLayer:x8t(i)&&(o=xv.GroupLayer):i.wmtsInfo?.url&&i.wmtsInfo.layerIdentifier?o=xv.WMTSLayer:n==="WFS"&&i.wfsInfo?.version!=="2.0.0"&&(o=xv.UnsupportedLayer);return o()}function x8t(i){return i.layerType!=="ArcGISFeatureLayer"||jYe(i)?!1:(i.featureCollection?.layers?.length??0)>1}function jYe(i){return i.type==="Feature Collection"}function QNr(i){let e;switch(i.origin){case"web-scene":switch(i.layerContainerType){case"basemap":e=WNr;break;case"ground":e=VNr;break;case"tables":e=HNr;break;default:e=zNr}break;case"link-chart":switch(i.layerContainerType){case"basemap":e=XNr;break;case"tables":e=YNr;break;default:e=qNr}break;default:switch(i.layerContainerType){case"basemap":e=w8t;break;case"tables":e=b8t;break;default:e=_8t}}return e}async function GYe(i,e,t){const r=new dr,n=v8t(r,Array.isArray(e.layers)?e.layers:[],t);try{try{if(await n,i.type==="group")return i.layers.addMany(r),i}catch(s){i.destroy();for(const o of r)o.destroy();throw s}}catch(s){throw s}}function e$r(i,e,t){e.itemId&&(i.portalItem=new yg({id:e.itemId,portal:t?.portal}),i.when(()=>{const r=n=>{const s=n.layerId;S8t(n,i,e,s,t);const o=e.featureCollection?.layers?.[s];o&&n.read(o,t)};i.layers?.forEach(r),i.tables?.forEach(r)}))}async function t$r(i,e,t){const r=xv.FeatureLayer,n=await r(),s=e.featureCollection,o=s?.showLegend,a=s?.layers?.map((l,u)=>{const c=new n;c.read(l,t);const h={...t,ignoreDefaults:!0};return S8t(c,i,e,u,h),o!=null&&c.read({showLegend:o},h),c});i.layers.addMany(a??[])}function S8t(i,e,t,r,n){i.read({id:`${e.id}-sublayer-${r}`,visibility:t.visibleLayers?.includes(r)??!0},n)}const T8t=Object.freeze(Object.defineProperty({__proto__:null,populateGroupLayer:GYe,populateOperationalLayers:v8t},Symbol.toStringTag,{value:"Module"}));var W_e;(function(i){i.TimeZoneNotRecognized="TimeZoneNotRecognized"})(W_e||(W_e={}));const i$r={[W_e.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};let r$r=class C8t extends Error{constructor(e,t){super(m0(i$r[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,C8t)}};function Cj(i,e,t){return it?i-t:0}function Ej(i,e,t){return it?t:i}let ao=class sf{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,r=1,n=0,s=0,o=0,a=0,l){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(n)||isNaN(s)||isNaN(o)||isNaN(a))return null;const u=Sn.local(e,t).daysInMonth;let c=Sn.fromObject({day:Ej(r,1,u),year:e,month:Ej(t,1,12),hour:Ej(n,0,23),minute:Ej(s,0,59),second:Ej(o,0,59),millisecond:Ej(a,0,999)},{zone:B1(l)});return c=c.plus({months:Cj(t,1,12),days:Cj(r,1,u),hours:Cj(n,0,23),minutes:Cj(s,0,59),seconds:Cj(o,0,59),milliseconds:Cj(a,0,999)}),new sf(c)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const r=B1(t);return e.isUnknownTimeZone||r===hb.instance?sf.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new sf(e._date.setZone(r))}static dateJSToArcadeDate(e){return new sf(Sn.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const r=B1(t);return new sf(Sn.fromJSDate(e,{zone:r}))}static unknownEpochToArcadeDate(e){return new sf(Sn.fromMillis(e,{zone:hb.instance}))}static unknownDateJSToArcadeDate(e){return new sf(Sn.fromMillis(e.getTime(),{zone:hb.instance}))}static epochToArcadeDate(e,t="system"){const r=B1(t);return new sf(Sn.fromMillis(e,{zone:r}))}static dateTimeToArcadeDate(e){return new sf(e)}clone(){return new sf(this._date)}changeTimeZone(e){const t=B1(e);return sf.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const r=B1(t);return e.zone===hb.instance||r===hb.instance?sf.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new sf(e.setZone(r))}static nowToArcadeDate(e){const t=B1(e);return new sf(Sn.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new sf(Sn.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===sf.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===hb.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new sf(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new sf(this._date.toUTC())}toLocal(){return new sf(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=Sn.fromISO(e,{setZone:!0});return new sf(t)}};function B1(i,e=!0){if(i instanceof zk)return i;if(i.toLowerCase()==="system")return"system";if(i.toLowerCase()==="utc")return"UTC";if(i.toLowerCase()==="unknown")return hb.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(i)){const r=If.parseSpecifier("UTC"+(i.startsWith("+")||i.startsWith("-")?"":"+")+i);if(r)return r}const t=$b.create(i);if(!t.isValid){if(e)throw new r$r(W_e.TimeZoneNotRecognized);return null}return t}var tr;(function(i){i.InvalidFunctionParameters="InvalidFunctionParameters",i.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",i.UnsupportedSqlFunction="UnsupportedSqlFunction",i.UnsupportedOperator="UnsupportedOperator",i.UnsupportedSyntax="UnsupportedSyntax",i.UnsupportedIsRhs="UnsupportedIsRhs",i.UnsupportedIsLhs="UnsupportedIsLhs",i.InvalidDataType="InvalidDataType",i.CannotCastValue="CannotCastValue",i.FunctionNotRecognized="FunctionNotRecognized",i.InvalidTime="InvalidTime",i.InvalidParameterCount="InvalidParameterCount",i.InvalidTimeStamp="InvalidTimeStamp",i.InvalidDate="InvalidDate",i.InvalidOperator="InvalidOperator",i.IllegalInterval="IllegalInterval",i.YearMonthIntervals="YearMonthIntervals",i.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",i.MissingStatisticParameters="MissingStatisticParameters"})(tr||(tr={}));const n$r={[tr.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[tr.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[tr.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[tr.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[tr.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[tr.UnsupportedOperator]:"Unsupported operator - {operator}",[tr.UnsupportedSyntax]:"Unsupported syntax - {node}",[tr.UnsupportedSqlFunction]:"Sql function not found = {function}",[tr.InvalidDataType]:"Invalid sql data type",[tr.InvalidDate]:"Invalid date encountered",[tr.InvalidOperator]:"Invalid operator encountered",[tr.InvalidTime]:"Invalid time encountered",[tr.IllegalInterval]:"Illegal interval",[tr.FunctionNotRecognized]:"Function not recognized",[tr.InvalidTimeStamp]:"Invalid timestamp encountered",[tr.InvalidParameterCount]:"Invalid parameter count for call to {name}",[tr.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[tr.YearMonthIntervals]:"Year-Month Intervals not supported",[tr.CannotCastValue]:"Cannot cast value to the required data type"};let pr=class E8t extends Error{constructor(e,t){super(m0(n$r[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,E8t)}};var pl;(function(i){i.NeverReach="NeverReach",i.NotImplemented="NotImplemented",i.Cancelled="Cancelled",i.InvalidStatResponse="InvalidStatResponse",i.InvalidRequest="InvalidRequest",i.RequestFailed="RequestFailed",i.MissingFeatures="MissingFeatures",i.AggregationFieldNotFound="AggregationFieldNotFound",i.DataElementsNotFound="DataElementsNotFound"})(pl||(pl={}));const s$r={[pl.Cancelled]:"Cancelled",[pl.InvalidStatResponse]:"Invalid statistics response from service",[pl.InvalidRequest]:"Invalid request",[pl.RequestFailed]:"Request failed - {reason}",[pl.MissingFeatures]:"Missing features",[pl.AggregationFieldNotFound]:"Aggregation field not found",[pl.DataElementsNotFound]:"Data elements not found on service",[pl.NeverReach]:"Encountered unreachable logic",[pl.NotImplemented]:"Not implemented"};let wc=class I8t extends Error{constructor(e,t){super(m0(s$r[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,I8t)}};function pdt(i){i=i.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of i.match(t)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}let Lu=class Cw{constructor(e,t,r){this._year=e,this._month=t,this._day=r,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof Cw&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new Cw(this._year,this._month,this._day)}toDateTime(e){return Sn.fromObject({day:this.day,month:this.month,year:this.year},{zone:B1(e)})}toDateTimeLuxon(e){return Sn.fromObject({day:this.day,month:this.month,year:this.year},{zone:B1(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=pdt(e)),!e)return"";const r=this.toDateTime("unknown");return ao.dateTimeToArcadeDate(r).toFormat(e,{locale:Am(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return ao.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return Cw.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return Sn.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=Sn.fromMillis(e,{zone:If.utcInstance});return t.isValid?Cw.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=Sn.fromSeconds(e,{zone:If.utcInstance});return t.isValid?Cw.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new Cw(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,r){const n=new Cw(e,t,r);return n.isValid===!1?null:n}static fromDateJS(e){return Cw.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return Cw.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];if(t)(t=pdt(t))&&r.push(t);else if(t===null||t===""){const n=Sn.fromISO(e,{setZone:!0});return n.isValid?Cw.fromParts(n.year,n.month,n.day):null}for(const n of r){const s=Sn.fromFormat(e,t??n);if(s.isValid)return new Cw(s.year,s.month,s.day)}return null}static fromNow(e="system"){const t=Sn.fromJSDate(new Date).setZone(B1(e));return new Cw(t.year,t.month,t.day)}};function fdt(i){return Number.isNaN(i)||i===0?i:Math.trunc(i)}let o_=class mU{constructor(e){this._timeStampOffset=e,this._date=null}toDateTime(){return this._date??=Sn.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return fdt(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return fdt(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return mU.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new mU(Sn.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new mU(e.toISO({includeOffset:!0}))}static fromParts(e,t,r=0,n=0,s=0,o=0,a=0,l=!1,u=0,c=0){const h=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}`;let p="";o<10&&(p="0");let m=`${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${p+o.toString()}`;a!==0&&(m+="."+a.toString().padStart(3,"0"));const v=`${l?"-":"+"}${u.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new mU(h+"T"+m+v)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return mU.fromDateTime(t)}};function uA(i){if(i==null)return null;if(typeof i=="number")return i;let e=i.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function mdt(i){if(i==null)return null;switch(i.type){case"polygon":case"multipoint":case"polyline":return i.extent;case"point":return new hr({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y,spatialReference:i.spatialReference});case"extent":return i}return null}function au(i){if(i==null)return null;if(typeof i=="number")return i;let e=i.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function hp(i){if(i==null)return null;const e=i.clone();return i.cache._geVersion!==void 0&&(e.cache._geVersion=i.cache._geVersion),e}function ude(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}function gdt(i){if(!i)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const r of i.match(e)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=r;break;case"A":case"a":t+="a";break;default:t+=`'${r}'`}return t}let Nu=class EI{constructor(e,t,r,n){this._hour=e,this._minute=t,this._second=r,this._millisecond=n,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof EI&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new EI(this.hour,this.minute,this.second,this.millisecond)}isValid(){return ude(this.hour)&&ude(this.minute)&&ude(this.second)&&ude(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=gdt(e))?Sn.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:Am(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,r,n){const s=new EI(e,t,r,n);return s.isValid()?s:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new EI(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),n=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new EI(n,r,t,s)}static fromDateJS(e){return new EI(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new EI(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];t?(t=gdt(t))&&r.push(t):t!==null&&t!==""||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const n of r){const s=Sn.fromFormat(e,n);if(s.isValid)return new EI(s.hour,s.minute,s.second,s.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return EI.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return Sn.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}};function o$r(i,e){const t=A8t[i.toLowerCase()];if(t==null)throw new pr(tr.FunctionNotRecognized);if(e.lengtht.maxParams)throw new pr(tr.InvalidParameterCount,{name:i.toUpperCase()});return t.evaluate(e)}function ydt(i,e){const t=A8t[i.toLowerCase()];return t!=null&&e>=t.minParams&&e<=t.maxParams}const A8t={min:{minParams:1,maxParams:1,evaluate:i=>vdt(i[0],"min")},max:{minParams:1,maxParams:1,evaluate:i=>vdt(i[0],"max")},avg:{minParams:1,maxParams:1,evaluate:i=>M8t(i[0])},sum:{minParams:1,maxParams:1,evaluate:i=>a$r(i[0])},stddev:{minParams:1,maxParams:1,evaluate:i=>l$r(i[0])},count:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].length},var:{minParams:1,maxParams:1,evaluate:i=>O8t(i[0])}};function M8t(i){if(i===null)return null;let e=0,t=0;for(let r=0;r=s)&&(t=n,r=s)}return t}function a$r(i){if(i===null)return null;let e=0;for(let t=0;tr!==null)).length===0)return null;const e=M8t(i);if(e===null)return null;let t=0;for(const r of i){if(!UYe(r))throw new pr(tr.InvalidValueForAggregateFunction);t+=(e-r)**2}return t/(i.length-1)}let o0=class II{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(e){if(e.precision!==null||e.secondary!==null)throw new pr(tr.PrimarySecondaryQualifiers)}static _parseSecondsComponent(e,t){if(t.includes(".")){const r=t.split(".");e.second=parseFloat(r[0]),e.millis=parseInt(r[1],10)}else e.second=parseFloat(t)}static createFromMilliseconds(e){const t=new II;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,r){let n=null;const s=new II;if(s.op=r==="-"?"-":"+",t.type==="interval-period"){II._fixDefaults(t);const o=new RegExp("^[0-9]{1,}$");if(t.period==="year"||t.period==="month")throw new pr(tr.YearMonthIntervals);if(t.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(e))throw new pr(tr.IllegalInterval);II._parseSecondsComponent(s,e)}else{if(!o.test(e))throw new pr(tr.IllegalInterval);s[t.period]=parseFloat(e)}}else{if(II._fixDefaults(t.start),II._fixDefaults(t.end),t.start.period==="year"||t.start.period==="month"||t.end.period==="year"||t.end.period==="month")throw new pr(tr.YearMonthIntervals);switch(t.start.period){case"day":switch(t.end.period){case"hour":if(n=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!n.test(e))throw new pr(tr.IllegalInterval);s[t.start.period]=parseFloat(e.split(" ")[0]),s[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!n.test(e))throw new pr(tr.IllegalInterval);{s[t.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1])}break;case"second":if(n=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new pr(tr.IllegalInterval);{s[t.start.period]=parseFloat(e.split(" ")[0]);const o=e.split(" ")[1].split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),II._parseSecondsComponent(s,o[2])}break;default:throw new pr(tr.IllegalInterval)}break;case"hour":switch(t.end.period){case"minute":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!n.test(e))throw new pr(tr.IllegalInterval);s.hour=parseFloat(e.split(":")[0]),s.minute=parseFloat(e.split(":")[1]);break;case"second":if(n=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new pr(tr.IllegalInterval);{const o=e.split(":");s.hour=parseFloat(o[0]),s.minute=parseFloat(o[1]),II._parseSecondsComponent(s,o[2])}break;default:throw new pr(tr.IllegalInterval)}break;case"minute":if(t.end.period!=="second")throw new pr(tr.IllegalInterval);if(n=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!n.test(e))throw new pr(tr.IllegalInterval);{const o=e.split(":");s.minute=parseFloat(o[0]),II._parseSecondsComponent(s,o[1])}break;default:throw new pr(tr.IllegalInterval)}}return s}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}};const u$r=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,c$r=/^(\d{1,2}):(\d{1,2})$/,h$r=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,P8t=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,d$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,p$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,f$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,m$r=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function ATe(i,e){if(e instanceof zk)return e===hb.instance?Sn.fromMillis(i.getTime(),{zone:hb.instance}):Sn.fromJSDate(i,{zone:e});switch(e){case"system":case"local":case null:return Sn.fromJSDate(i);default:return e?.toLowerCase()==="unknown"?Sn.fromMillis(i.getTime(),{zone:hb.instance}):Sn.fromJSDate(i,{zone:e})}}function N1(i){return typeof i=="number"}function $1(i){return typeof i=="string"||i instanceof String}function ID(i){return i instanceof o0}function tS(i){return i instanceof Date}function gd(i){return i instanceof Sn}function yd(i){return i instanceof Lu}function pp(i){return i instanceof Nu}function vd(i){return i instanceof o_}function zYe(i){let e=u$r.exec(i);if(e!==null){const[,t,r,n]=e,s=Nu.fromParts(parseInt(t,10),parseInt(r,10),parseInt(n,10),0);if(s!==null)return s;throw new pr(tr.InvalidTime)}if(e=c$r.exec(i),e!==null){const[,t,r]=e,n=Nu.fromParts(parseInt(t,10),parseInt(r,10),0,0);if(n!==null)return n;throw new pr(tr.InvalidTime)}if(e=h$r.exec(i),e!==null){const[,t,r,n,s]=e,o=Nu.fromParts(parseInt(t,10),parseInt(r,10),parseInt(n,10),parseInt(s,10));if(o!==null)return o;throw new pr(tr.InvalidTime)}throw new pr(tr.InvalidTime)}function MTe(i,e,t=!1){let r=d$r.exec(i);if(r!==null){const[,n,s,o,a,l,u,c]=r,h=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:parseInt(a,10),minute:parseInt(l,10),second:parseInt(u,10),millisecond:c?parseInt(c.replace(".",""),10):0},{zone:b3e(e)});if(h.isValid===!1)throw new pr(tr.InvalidTimeStamp);return h}if(r=p$r.exec(i),r!==null){const[,n,s,o,a,l,u,c,h,p,m]=r,v=o_.fromParts(parseInt(n,10),parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(l,10),parseInt(u,10),c?parseInt(c.replace(".",""),10):0,h==="-",parseInt(p,10),parseInt(m,10));if(v.isValid===!1)throw new pr(tr.InvalidTimeStamp);return v}if(r=f$r.exec(i),r!==null){const[,n,s,o,a,l,u,c,h]=r,p=o_.fromParts(parseInt(n,10),parseInt(s,10),parseInt(o,10),parseInt(a,10),parseInt(l,10),0,0,u==="-",parseInt(c,10),parseInt(h,10));if(p.isValid===!1)throw new pr(tr.InvalidTimeStamp);return p}if(r=m$r.exec(i),r!==null){const[,n,s,o,a,l]=r,u=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:parseInt(a,10),minute:parseInt(l,10),second:0},{zone:b3e(e)});if(u.isValid===!1)throw new pr(tr.InvalidTimeStamp);return u}if(r=P8t.exec(i),r!==null){const[,n,s,o]=r,a=Sn.fromObject({year:parseInt(n,10),month:parseInt(s,10),day:parseInt(o,10),hour:0,minute:0,second:0},{zone:b3e(e)});if(a.isValid===!1)throw new pr(tr.InvalidTimeStamp);return a}throw new pr(tr.InvalidTimeStamp)}function R8t(i,e){const t=P8t.exec(i);if(t===null)try{return MTe(i,e)}catch{throw new pr(tr.InvalidDate)}const[,r,n,s]=t,o=Lu.fromParts(parseInt(r,10),parseInt(n,10),parseInt(s,10));if(o===null)throw new pr(tr.InvalidDate);return o}const g$r=321408e5,y$r=26784e5,v$r=864e5,_$r=36e5,b$r=6e4;function yOe(i){return!!gd(i)||!!vd(i)}function w$r(i){return!!gd(i)||!!yd(i)||!!vd(i)||!!pp(i)}function cde(i){if(gd(i))return i.toMillis();if(yd(i))return i.toNumber();if(vd(i))return i.toMilliseconds();throw new pr(tr.InvalidDataType)}function iS(i,e,t,r){if(i==null||e==null)return null;if(N1(i)){if(N1(e))return OC(i,e,t);if($1(e))return x$r(i,e,t);if(w$r(e))throw new pr(tr.InvalidOperator);if(yd(e))throw new pr(tr.InvalidOperator)}else if($1(i)){if(N1(e))return S$r(i,e,t);if($1(e))return T$r(i,e,t);if(gd(e))throw new pr(tr.InvalidOperator);if(yd(e))throw new pr(tr.InvalidOperator);if(pp(e))throw new pr(tr.InvalidOperator);if(vd(e))throw new pr(tr.InvalidOperator)}else if(gd(i)){if(yOe(e)){if(i instanceof Sn&&RG(i.zone)){if(e instanceof Sn&&RG(e.zone)===!1||e instanceof o_)return nK(i,e,t)}else if(e instanceof Sn&&RG(e.zone)&&(i instanceof Sn&&RG(i.zone)===!1||i instanceof o_))return nK(i,e,t);return OC(cde(i),cde(e),t)}if($1(e))throw new pr(tr.InvalidOperator);if(yd(e))return C$r(i,e,t);if(pp(e))throw new pr(tr.InvalidOperator);if(N1(e))throw new pr(tr.InvalidOperator)}else if(yd(i)){if(vd(e))return A$r(i,e,t);if(gd(e))return I$r(i,e,t);if($1(e))throw new pr(tr.InvalidOperator);if(yd(e))return OC(i.toNumber(),e.toNumber(),t);if(pp(e))throw new pr(tr.InvalidOperator);if(N1(e))throw new pr(tr.InvalidOperator)}else if(pp(i)){if(pp(e))return OC(i.toNumber(),e.toNumber(),t);if($1(e))throw new pr(tr.InvalidOperator);if(N1(e))throw new pr(tr.InvalidOperator);if(yd(e))throw new pr(tr.InvalidOperator);if(yOe(e))throw new pr(tr.InvalidOperator)}else if(vd(i)){if(yOe(e))return e instanceof Sn&&RG(e.zone)?nK(i,e,t):OC(cde(i),cde(e),t);if($1(e))throw new pr(tr.InvalidOperator);if(yd(e))return E$r(i,e,t);if(pp(e))throw new pr(tr.InvalidOperator);if(N1(e))throw new pr(tr.InvalidOperator)}switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function OC(i,e,t){switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function x$r(i,e,t){const r=parseFloat(e);if(!isNaN(r))return OC(i,r,t);const n=i.toString();switch(t){case"<>":return n!==e;case"=":return n===e;case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}}function S$r(i,e,t){const r=parseFloat(i);if(!isNaN(r))return OC(r,e,t);const n=e.toString();switch(t){case"<>":return i!==n;case"=":return i===n;case">":return i>n;case"<":return i=":return i>=n;case"<=":return i<=n}}function T$r(i,e,t){switch(t){case"<>":return i!==e;case"=":return i===e;case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}}function C$r(i,e,t){const r=e.toDateTimeLuxon(i.zone);return OC((i=i.startOf("day")).toMillis(),r.toMillis(),t)}function E$r(i,e,t){const r=e.toDateTimeLuxon(i.toDateTime().zone);return OC((i=i.startOfDay()).toMilliseconds(),r.toMillis(),t)}function I$r(i,e,t){const r=i.toDateTimeLuxon(e.zone);return e=e.startOf("day"),OC(r.toMillis(),e.toMillis(),t)}function A$r(i,e,t){const r=i.toDateTimeLuxon(e.toDateTime().zone);return e=e.startOfDay(),OC(r.toMillis(),e.toMilliseconds(),t)}function nK(i,e,t){i instanceof o_&&(i=i.toDateTime()),e instanceof o_&&(e=e.toDateTime());const r=_dt(i),n=_dt(e);switch(t){case"<>":return r!==n;case"=":return r===n;case">":return r>n;case"<":return r=":return r>=n;case"<=":return r<=n}}function _dt(i){return i.year*g$r+i.month*y$r+i.day*v$r+i.hour*_$r+i.minute*b$r+1e3*i.second+i.millisecond}function VYe(i,e,t){const r=F8t[i.toLowerCase()];if(r==null)throw new pr(tr.FunctionNotRecognized);if(e.lengthr.maxParams)throw new pr(tr.InvalidParameterCount,{name:i.toUpperCase()});return r.evaluate(e,t)}function M$r(i,e){const t=F8t[i.toLowerCase()];return t!=null&&e>=t.minParams&&e<=t.maxParams}function OTe(i){return typeof i=="string"||i instanceof String}function vOe(i){return!tS(i)&&!yd(i)&&!gd(i)&&!pp(i)&&!vd(i)}function D8t(i){return yd(i)||pp(i)?i.toString():vd(i)?i.toSQLValue():gd(i)?i.millisecond===0?i.toFormat("yyyy-LL-dd HH:mm:ss"):i.toSQL({includeOffset:!1}):tS(i)?D8t(Sn.fromJSDate(i)):i.toString()}function O$r(i){if(tS(i))return Lu.fromDateJS(i);if(gd(i))return Lu.fromParts(i.year,i.month,i.day);if(yd(i))return i;if(pp(i))throw new pr(tr.CannotCastValue);if(vd(i)&&Lu.fromParts(i.year,i.month,i.day)===null)throw new pr(tr.CannotCastValue);if(OTe(i)){const e=Lu.fromReader(i);if(e!==null&&e.isValid)return e}throw new pr(tr.CannotCastValue)}function P$r(i,e,t){if(tS(i))return ATe(i,e);if(gd(i))return i;if(yd(i))return i.toDateTimeLuxon("unknown");if(pp(i))throw new pr(tr.CannotCastValue);if(vd(i))return i;if(OTe(i))return MTe(i,"unknown",t);throw new pr(tr.CannotCastValue)}function R$r(i){if(tS(i))return Nu.fromDateJS(i);if(gd(i))return Nu.fromDateTime(i);if(yd(i))throw new pr(tr.CannotCastValue);if(pp(i))return i;if(vd(i))return Nu.fromSqlTimeStampOffset(i);if(OTe(i))return zYe(i);throw new pr(tr.CannotCastValue)}const F8t={extract:{minParams:2,maxParams:2,evaluate:([i,e])=>{if(e==null)return null;if(tS(e))switch(i.toUpperCase()){case"SECOND":return e.getSeconds();case"MINUTE":return e.getMinutes();case"HOUR":return e.getHours();case"DAY":return e.getDate();case"MONTH":return e.getMonth()+1;case"YEAR":return e.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(gd(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour;case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new pr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(yd(e))switch(i.toUpperCase()){case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new pr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}else if(pp(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour}else if(vd(e))switch(i.toUpperCase()){case"SECOND":return e.second;case"MINUTE":return e.minute;case"HOUR":return e.hour;case"DAY":return e.day;case"MONTH":return e.month;case"YEAR":return e.year;case"TIMEZONE_HOUR":return e.timezoneOffsetHour;case"TIMEZONE_MINUTE":return e.timezoneOffsetMinutes}throw new pr(tr.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:i=>{if(i.length===2){const[e,t]=i;return e==null||t==null?null:e.toString().substring(t-1)}if(i.length===3){const[e,t,r]=i;return e==null||t==null||r==null?null:r<=0?"":e.toString().substring(t-1,t+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([i,e])=>i==null||e==null?null:e.indexOf(i)+1},trim:{minParams:2,maxParams:3,evaluate:i=>{const e=i.length===3,t=e?i[1]:" ",r=e?i[2]:i[1];if(t==null||r==null)return null;const n=`(${UUe(t)})`;switch(i[0]){case"BOTH":return r.replaceAll(new RegExp(`^${n}*|${n}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${n}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${n}*$`,"g"),"")}throw new pr(tr.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.abs(i[0])},ceiling:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.ceil(i[0])},floor:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.floor(i[0])},log:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])},log10:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sin(i[0])},cos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cos(i[0])},tan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tan(i[0])},asin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.asin(i[0])},acos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.acos(i[0])},atan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.atan(i[0])},sign:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0]>0?1:i[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]**i[1]},mod:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]%i[1]},round:{minParams:1,maxParams:2,evaluate:i=>{const e=i[0],t=i.length===2?10**i[1]:1;return e==null?null:Math.round(e*t)/t}},truncate:{minParams:1,maxParams:2,evaluate:i=>i[0]==null?null:i.length===1?parseInt(i[0].toFixed(0),10):parseFloat(i[0].toFixed(i[1]))},char_length:{minParams:1,maxParams:1,evaluate:i=>OTe(i[0])?i[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:i=>{let e="";for(let t=0;ti[0]==null?null:i[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:i=>{for(const e of i)if(e!==null)return e;return null}},cosh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cosh(i[0])},sinh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sinh(i[0])},tanh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tanh(i[0])},nullif:{minParams:2,maxParams:2,evaluate:(i,e)=>iS(i[0],i[1],"=")?null:i[0]},cast:{minParams:2,maxParams:2,evaluate:(i,e)=>{const t=i[0],r=i[1];if(t===null)return null;switch(r.type){case"integer":{if(!vOe(t))throw new pr(tr.CannotCastValue);const n=parseInt(t,10);if(isNaN(n))throw new pr(tr.CannotCastValue);return n}case"smallint":{if(!vOe(t))throw new pr(tr.CannotCastValue);const n=parseInt(t,10);if(isNaN(n))throw new pr(tr.CannotCastValue);if(n>32767||n<-32767)throw new pr(tr.CannotCastValue);return n}case"float":case"real":{if(!vOe(t))throw new pr(tr.CannotCastValue);const n=parseFloat(t);if(isNaN(n))throw new pr(tr.CannotCastValue);return n}case"time":return R$r(t);case"date":return O$r(t);case"timestamp":return P$r(t,e,r.withtimezone===!0);case"varchar":{const n=D8t(t);if(n.length>r.size)throw new pr(tr.CannotCastValue);return n}default:throw new pr(tr.InvalidDataType)}}}};function k8t(i,e,t,r){if(i==="||")return VYe("concat",[e,t],r);if(e===null||t===null)return null;if(N1(e)){if(N1(t))return HYe(e,t,i);if(ID(t))return j$r(e,t,i);if(pp(t))return J$r();if(yd(t))return K$r();if(vd(t))return X$r();if(gd(t))return q$r();if($1(t))return Z$r(e,t,i);throw new pr(tr.InvalidOperator)}if(yd(e)){if(N1(t))return H$r(e,t,i);if(ID(t))return G$r(e,t,i);if(pp(t))return o6r();if(yd(t))return s6r(e,t,i);if(vd(t))return n6r(e,t,i);if(gd(t))return r6r(e,t,i);if($1(t))return _6r();throw new pr(tr.InvalidOperator)}if(pp(e)){if(N1(t))return W$r(e,t,i);if(ID(t))return L$r(e,t,i);if(pp(t))return f6r();if(yd(t))return d6r();if(vd(t))return p6r();if(gd(t))return h6r();if($1(t))return b6r();throw new pr(tr.InvalidOperator)}if(ID(e)){if(N1(t))return B$r(e,t,i);if(ID(t))return $$r(e,t,i);if(pp(t))return F$r(e,t,i);if(yd(t))return k$r(e,t,i);if(vd(t))return N$r(e,t,i);if(gd(t))return D$r(e,t,i);if($1(t))return t6r();throw new pr(tr.InvalidOperator)}if(gd(e)){if(N1(t))return V$r(e,t,i);if(ID(t))return U$r(e,t,i);if(pp(t))return v6r();if(yd(t))return g6r(e,t,i);if(vd(t))return y6r(e,t,i);if(gd(t))return m6r(e,t,i);if($1(t))return w6r();throw new pr(tr.InvalidOperator)}if(vd(e)){if(N1(t))return Y$r(e,t,i);if(ID(t))return z$r(e,t,i);if(pp(t))return a6r();if(yd(t))return l6r(e,t,i);if(vd(t))return c6r(e,t,i);if(gd(t))return u6r(e,t,i);if($1(t))return x6r();throw new pr(tr.InvalidOperator)}if($1(e)){if(N1(t))return Q$r(e,t,i);if(ID(t))return i6r();if(pp(t))return S6r();if(yd(t))return T6r();if(vd(t))return E6r();if(gd(t))return C6r();if($1(t))return e6r(e,t,i);throw new pr(tr.InvalidOperator)}throw new pr(tr.InvalidOperator)}function HYe(i,e,t){switch(t){case"+":return i+e;case"-":return i-e;case"*":return i*e;case"/":return i/e}throw new pr(tr.InvalidOperator)}function D$r(i,e,t){switch(t){case"+":return e.plus({milliseconds:i.valueInMilliseconds()});case"-":return i.valueInMilliseconds()-e.toMillis()}throw new pr(tr.InvalidOperator)}function F$r(i,e,t){if(t==="+")return e.plus("milliseconds",i.valueInMilliseconds());throw new pr(tr.InvalidOperator)}function k$r(i,e,t){if(t==="+")return e.plus("milliseconds",i.valueInMilliseconds());throw new pr(tr.InvalidOperator)}function L$r(i,e,t){switch(t){case"+":return i.plus("milliseconds",e.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*e.valueInMilliseconds())}throw new pr(tr.InvalidOperator)}function N$r(i,e,t){if(t==="+")return e.addMilliseconds(i.valueInMilliseconds());throw new pr(tr.InvalidOperator)}function $$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i.valueInMilliseconds()+e.valueInMilliseconds());case"-":return o0.createFromMilliseconds(i.valueInMilliseconds()-e.valueInMilliseconds());case"*":return o0.createFromMilliseconds(i.valueInMilliseconds()*e.valueInMilliseconds());case"/":return o0.createFromMilliseconds(i.valueInMilliseconds()/e.valueInMilliseconds())}throw new pr(tr.InvalidOperator)}function B$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i.valueInMilliseconds()+e);case"-":return o0.createFromMilliseconds(i.valueInMilliseconds()-e);case"*":return o0.createFromMilliseconds(i.valueInMilliseconds()*e);case"/":return o0.createFromMilliseconds(i.valueInMilliseconds()/e)}throw new pr(tr.InvalidOperator)}function j$r(i,e,t){switch(t){case"+":return o0.createFromMilliseconds(i+e.valueInMilliseconds());case"-":return o0.createFromMilliseconds(i-e.valueInMilliseconds());case"*":return o0.createFromMilliseconds(i*e.valueInMilliseconds());case"/":return o0.createFromMilliseconds(i/e.valueInMilliseconds())}throw new pr(tr.InvalidOperator)}function G$r(i,e,t){switch(t){case"+":return i.plus("milliseconds",e.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*e.valueInMilliseconds())}throw new pr(tr.InvalidOperator)}function U$r(i,e,t){switch(t){case"+":return i.plus({milliseconds:e.valueInMilliseconds()});case"-":return i.minus({milliseconds:e.valueInMilliseconds()})}throw new pr(tr.InvalidOperator)}function z$r(i,e,t){switch(t){case"+":return i.addMilliseconds(e.valueInMilliseconds());case"-":return i.addMilliseconds(-1*e.valueInMilliseconds())}throw new pr(tr.InvalidOperator)}function V$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus({milliseconds:r});case"-":return i.minus({milliseconds:r})}throw new pr(tr.InvalidOperator)}function H$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus("milliseconds",r);case"-":return i.plus("milliseconds",-1*r)}throw new pr(tr.InvalidOperator)}function W$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.plus("milliseconds",r);case"-":return i.plus("milliseconds",-1*r)}throw new pr(tr.InvalidOperator)}function q$r(i,e,t){throw new pr(tr.InvalidOperator)}function Y$r(i,e,t){const r=1e3*e*24*60*60;switch(t){case"+":return i.addMilliseconds(r);case"-":return i.addMilliseconds(-1*r)}throw new pr(tr.InvalidOperator)}function X$r(i,e,t){throw new pr(tr.InvalidOperator)}function J$r(i,e,t){throw new pr(tr.InvalidOperator)}function K$r(i,e,t){throw new pr(tr.InvalidOperator)}function Z$r(i,e,t){const r=parseFloat(e);if(isNaN(r))throw new pr(tr.InvalidOperator);return HYe(i,r,t)}function Q$r(i,e,t){const r=parseFloat(i);if(isNaN(r))throw new pr(tr.InvalidOperator);return HYe(r,e,t)}function e6r(i,e,t){if(t==="+")return i+e;throw new pr(tr.InvalidOperator)}function t6r(i,e,t){throw new pr(tr.InvalidOperator)}function i6r(i,e,t){throw new pr(tr.InvalidOperator)}function r6r(i,e,t){if(t==="-")return i.toDateTimeLuxon(e.zone).diff(e).as("days");throw new pr(tr.InvalidOperator)}function n6r(i,e,t){if(t==="-")return i.toDateTimeLuxon(e.toDateTime().zone).diff(e.toDateTime()).as("days");throw new pr(tr.InvalidOperator)}function s6r(i,e,t){if(t==="-")return i.toDateTimeLuxon("UTC").diff(e.toDateTimeLuxon("UTC")).as("days");throw new pr(tr.InvalidOperator)}function o6r(i,e,t){throw new pr(tr.InvalidOperator)}function a6r(i,e,t){throw new pr(tr.InvalidOperator)}function l6r(i,e,t){if(t==="-")return i.toDateTime().diff(e.toDateTimeLuxon(i.toDateTime().zone)).as("days");throw new pr(tr.InvalidOperator)}function u6r(i,e,t){if(t==="-")return i.toDateTime().diff(e).as("days");throw new pr(tr.InvalidOperator)}function c6r(i,e,t){if(t==="-")return i.toDateTime().diff(e.toDateTime()).as("days");throw new pr(tr.InvalidOperator)}function h6r(i,e,t){throw new pr(tr.InvalidOperator)}function d6r(i,e,t){throw new pr(tr.InvalidOperator)}function p6r(i,e,t){throw new pr(tr.InvalidOperator)}function f6r(i,e,t){throw new pr(tr.InvalidOperator)}function m6r(i,e,t){if(t==="-")return i.diff(e).as("days");throw new pr(tr.InvalidOperator)}function g6r(i,e,t){if(t==="-")return i.diff(e.toDateTimeLuxon(i.zone)).as("days");throw new pr(tr.InvalidOperator)}function y6r(i,e,t){if(t==="-")return i.diff(e.toDateTime()).as("days");throw new pr(tr.InvalidOperator)}function v6r(i,e,t){throw new pr(tr.InvalidOperator)}function _6r(i,e,t){throw new pr(tr.InvalidOperator)}function b6r(i,e,t){throw new pr(tr.InvalidOperator)}function w6r(i,e,t){throw new pr(tr.InvalidOperator)}function x6r(i,e,t){throw new pr(tr.InvalidOperator)}function S6r(i,e,t){throw new pr(tr.InvalidOperator)}function T6r(i,e,t){throw new pr(tr.InvalidOperator)}function C6r(i,e,t){throw new pr(tr.InvalidOperator)}function E6r(i,e,t){throw new pr(tr.InvalidOperator)}var bdt,wdt,L8t={exports:{}};wdt=function(){function i(n,s){function o(){this.constructor=n}o.prototype=s.prototype,n.prototype=new o}function e(n,s,o,a){var l=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(l,e.prototype),l.expected=s,l.found=o,l.location=a,l.name="SyntaxError",l}function t(n,s,o){return o=o||" ",n.length>s?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function r(n,s){var o,a={},l=(s=s!==void 0?s:{}).grammarSource,u={start:ka},c=ka,h="!",p="=",m=">=",v=">",w="<=",S="<>",I="<",R="!=",L="+",k="-",B="||",$="*",V="/",Y="@",K="'",Q="N'",re="''",ne=".",de="null",pe="true",H="false",Z="in",ae="is",fe="like",be="escape",_e="not",Ie="and",Te="or",Be="between",Ve="from",$e="for",tt="substring",yt="extract",Ct="trim",ot="position",vt="timestamp",At="date",Je="time",it="leading",Ue="trailing",ct="both",st="cast",Ze="as",ye="integer",Ke="smallint",ke="float",me="real",ie="varchar",ge="to",je="interval",rt="year",Me="timezone_hour",ht="timezone_minute",Ht="month",_t="day",Fe="hour",Yt="minute",A="second",ue="case",G="end",E="when",_="then",g="else",b=",",C="(",O=")",F="`",N=/^[A-Za-z_\x80-\uFFFF]/,j=/^[A-Za-z0-9_]/,W=/^[A-Za-z0-9_.\x80-\uFFFF]/,q=/^["]/,J=/^[^']/,ee=/^[0-9]/,he=/^[eE]/,Ee=/^[+\-]/,De=/^[ \t\n\r]/,pt=/^[^`]/,Et=Ts("!",!1),Ye=Ts("=",!1),jt=Ts(">=",!1),ei=Ts(">",!1),Xt=Ts("<=",!1),wi=Ts("<>",!1),pi=Ts("<",!1),Ri=Ts("!=",!1),Ui=Ts("+",!1),Bi=Ts("-",!1),mi=Ts("||",!1),ar=Ts("*",!1),z=Ts("/",!1),Wi=M0([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Fr=M0([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ds=M0([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Dt=M0(['"'],!1,!1),Mn=Ts("@",!1),yn=Ts("'",!1),Pt=Ts("N'",!1),Un=Ts("''",!1),Qi=M0(["'"],!0,!1),Cn=Ts(".",!1),bs=M0([["0","9"]],!1,!1),qn=M0(["e","E"],!1,!1),ko=M0(["+","-"],!1,!1),ai=Ts("NULL",!0),Al=Ts("TRUE",!0),eu=Ts("FALSE",!0),Ma=Ts("IN",!0),_n=Ts("IS",!0),Ss=Ts("LIKE",!0),la=Ts("ESCAPE",!0),gi=Ts("NOT",!0),lr=Ts("AND",!0),Rr=Ts("OR",!0),Os=Ts("BETWEEN",!0),Js=Ts("FROM",!0),vs=Ts("FOR",!0),na=Ts("SUBSTRING",!0),gl=Ts("EXTRACT",!0),fn=Ts("TRIM",!0),qr=Ts("POSITION",!0),Gu=Ts("TIMESTAMP",!0),dc=Ts("DATE",!0),Re=Ts("TIME",!0),Ne=Ts("LEADING",!0),dt=Ts("TRAILING",!0),Gt=Ts("BOTH",!0),ti=Ts("CAST",!0),oi=Ts("AS",!0),Hi=Ts("INTEGER",!0),Oi=Ts("SMALLINT",!0),kt=Ts("FLOAT",!0),Xe=Ts("REAL",!0),Le=Ts("VARCHAR",!0),xt=Ts("TO",!0),Zt=Ts("INTERVAL",!0),Rt=Ts("YEAR",!0),fi=Ts("TIMEZONE_HOUR",!0),Fi=Ts("TIMEZONE_MINUTE",!0),mr=Ts("MONTH",!0),yr=Ts("DAY",!0),Gr=Ts("HOUR",!0),zr=Ts("MINUTE",!0),jn=Ts("SECOND",!0),co=Ts("CASE",!0),ua=Ts("END",!0),Hs=Ts("WHEN",!0),Ll=Ts("THEN",!0),ft=Ts("ELSE",!0),Wt=Ts(",",!1),hi=Ts("(",!1),Pi=Ts(")",!1),vr=M0([" "," ",` +`,"\r"],!1,!1),Lr=Ts("`",!1),on=M0(["`"],!0,!1),dn=function(le){return le},Ir=function(le,gt){var $t={type:"expression-list"},ci=BIe(le,gt);return $t.value=ci,$t},$n=function(le,gt){return AL(le,gt)},fa=function(le,gt){return AL(le,gt)},Sa=function(le){return zue("NOT",le)},ma=function(le,gt){return gt==""||gt==null||gt==null?le:gt.type=="arithmetic"?AL(le,gt.tail):Vue(gt.op,le,gt.right,gt.escape)},go=function(le){return{type:"arithmetic",tail:le}},tu=function(le,gt){return{op:le+"NOT",right:gt}},Uu=function(le,gt){return{op:le,right:gt}},pc=function(le,gt,$t){return{op:"NOT"+le,right:{type:"expression-list",value:[gt,$t]}}},Fh=function(le,gt,$t){return{op:le,right:{type:"expression-list",value:[gt,$t]}}},Zr=function(le){return le[0]+" "+le[2]},Ps=function(le){return le[0]+" "+le[2]},ca=function(le,gt,$t){return{op:le,right:gt,escape:$t.value}},Ou=function(le,gt){return{op:le,right:gt,escape:""}},Za=function(le,gt){return{op:le,right:gt}},kh=function(le){return{op:le,right:{type:"expression-list",value:[]}}},Qv=function(le,gt){return{op:le,right:gt}},_y=function(le,gt){return AL(le,gt)},I0=function(le,gt){return AL(le,gt)},e1=function(le){return le.paren=!0,le},Nl=function(le){return/^CURRENT_DATE$/i.test(le)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(le)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:le}},Sp=function(le){return{type:"column-reference",table:"",column:le,delimited:!0}},Ml=function(le){return le},Og=function(le,gt){return le+gt.join("")},Xc=function(le,gt){return le+gt.join("")},Bm=function(le){return le},by=function(le){return le.join("")},A0=function(){return'"'},Nf=function(le){return{type:"parameter",value:le[1]}},Pg=function(le,gt){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:le},gt]}}},Kd=function(le,gt,$t){return{type:"function",name:"substring",args:{type:"expression-list",value:$t?[le,gt,$t[2]]:[le,gt]}}},$f=function(le,gt){return{type:"function",name:"cast",args:{type:"expression-list",value:[le,gt]}}},Jc=function(){return{type:"data-type",value:{type:"integer"}}},t1=function(){return{type:"data-type",value:{type:"smallint"}}},hh=function(){return{type:"data-type",value:{type:"float"}}},Lh=function(){return{type:"data-type",value:{type:"real"}}},fc=function(){return{type:"data-type",value:{type:"date"}}},rn=function(){return{type:"data-type",value:{type:"timestamp"}}},Qa=function(){return{type:"data-type",value:{type:"time"}}},wy=function(le){return{type:"data-type",value:{type:"varchar",size:parseInt(le)}}},ve=function(le,gt,$t){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:le??"BOTH"},gt,$t]}}},oe=function(le,gt){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:le??"BOTH"},gt]}}},ce=function(le,gt){return{type:"function",name:"position",args:{type:"expression-list",value:[le,gt]}}},we=function(le,gt){return{type:"function",name:le,args:gt||{type:"expression-list",value:[]}}},He=function(le){return le.type==="string"&&jIe(le.value),{type:"timestamp",value:le.value}},St=function(le){return le.type==="string"&&GIe(le.value),{type:"time",value:le.value}},ut=function(le,gt,$t){return{type:"interval",value:gt,qualifier:$t,op:le}},Bt=function(le,gt){return{type:"interval",value:le,qualifier:gt,op:""}},Ge=function(le,gt){return{type:"interval-qualifier",start:le,end:gt}},et=function(le,gt){return{type:"interval-period",period:le.value,precision:gt,secondary:null}},zt=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},ii=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},te=function(le,gt){return{type:"interval-period",period:"second",precision:le,secondary:gt}},xe=function(le){return{type:"interval-period",period:"second",precision:le,secondary:null}},Ae=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},lt=function(le,gt){return{type:"interval-period",period:le.value,precision:gt,secondary:null}},nt=function(le){return{type:"interval-period",period:le.value,precision:null,secondary:null}},It=function(le,gt){return{type:"interval-period",period:"second",precision:le,secondary:gt}},Nt=function(le){return{type:"interval-period",period:"second",precision:le,secondary:null}},Ut=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Jt=function(){return{type:"string",value:"day"}},xi=function(){return{type:"string",value:"hour"}},Di=function(){return{type:"string",value:"minute"}},ki=function(){return{type:"string",value:"month"}},ir=function(){return{type:"string",value:"year"}},$r=function(le){return parseFloat(le)},mn=function(le){return parseFloat(le)},Kr=function(le){return le.type==="string"&&UIe(le.value),{type:"date",value:le.value}},xn=function(){return{type:"null",value:null}},Gn=function(){return{type:"boolean",value:!0}},Ds=function(){return{type:"boolean",value:!1}},Fn=function(){return"'"},yo=function(le){return{type:"string",value:le.join("")}},or=function(le,gt){return{type:"case-expression",format:"simple",operand:le,clauses:gt,else:null}},Ce=function(le,gt,$t){return{type:"case-expression",format:"simple",operand:le,clauses:gt,else:$t.value}},ze=function(le){return{type:"case-expression",format:"searched",clauses:le,else:null}},mt=function(le,gt){return{type:"case-expression",format:"searched",clauses:le,else:gt.value}},Ft=function(le,gt){return{type:"when-clause",operand:le,value:gt}},ni=function(le,gt){return{type:"when-clause",operand:le,value:gt}},bi=function(le){return{type:"else-clause",value:le}},Li=function(le){return{type:"number",value:le}},Yi=function(le,gt,$t){return parseFloat(le+gt+$t)},wr=function(le,gt){return parseFloat(le+gt)},Ar=function(le,gt){return parseFloat(le+gt)},Qr=function(le){return parseFloat(le)},ls=function(le,gt){return le[0]+gt},an=function(le){return"."+(le??"")},so=function(le,gt){return le+gt},Zs=function(le){return le.join("")},$l=function(le,gt){return"e"+(gt===null?"":gt)},za=function(){return"IN"},Ed=function(){return"IS"},Oe=function(){return"LIKE"},ui=function(){return"ESCAPE"},Zi=function(){return"NOT"},Or=function(){return"AND"},wn=function(){return"OR"},vo=function(){return"BETWEEN"},iu=function(){return"FROM"},Ol=function(){return"FOR"},jm=function(){return"SUBSTRING"},aT=function(){return"EXTRACT"},CX=function(){return"TRIM"},yL=function(){return"POSITION"},E7=function(){return"TIMESTAMP"},I7=function(){return"DATE"},vL=function(){return"TIME"},Qb=function(){return"LEADING"},PE=function(){return"TRAILING"},XEe=function(){return"BOTH"},pue=function(){return"CAST"},fue=function(){return"AS"},EX=function(){return"INTEGER"},mue=function(){return"SMALLINT"},gue=function(){return"FLOAT"},JEe=function(){return"REAL"},yue=function(){return"VARCHAR"},x_=function(){return"TO"},Tp=function(){return"INTERVAL"},KEe=function(){return"YEAR"},ZEe=function(){return"TIMEZONE_HOUR"},QEe=function(){return"TIMEZONE_MINUTE"},vue=function(){return"MONTH"},A7=function(){return"DAY"},_ue=function(){return"HOUR"},eIe=function(){return"MINUTE"},tIe=function(){return"SECOND"},IX=function(){return"CASE"},iIe=function(){return"END"},rIe=function(){return"WHEN"},nIe=function(){return"THEN"},sIe=function(){return"ELSE"},AX=function(le){return le},oIe=function(le){return le.join("")},We=0,Tr=0,_o=[{line:1,column:1}],Rg=0,Dg=[],rr=0;if("startRule"in s){if(!(s.startRule in u))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');c=u[s.startRule]}function MX(le,gt){throw aIe(le,gt=gt!==void 0?gt:OX(Tr,We))}function Ts(le,gt){return{type:"literal",text:le,ignoreCase:gt}}function M0(le,gt,$t){return{type:"class",parts:le,inverted:gt,ignoreCase:$t}}function ew(){return{type:"end"}}function _L(le){var gt,$t=_o[le];if($t)return $t;for(gt=le-1;!_o[gt];)gt--;for($t={line:($t=_o[gt]).line,column:$t.column};gtRg&&(Rg=We,Dg=[]),Dg.push(le))}function aIe(le,gt){return new e(le,null,null,gt)}function bue(le,gt,$t){return new e(e.buildMessage(le,gt),le,gt,$t)}function ka(){var le,gt;return le=We,Sr(),(gt=Mr())!==a?(Sr(),Tr=le,le=dn(gt)):(We=le,le=a),le}function wue(){var le,gt,$t,ci,es,ql,Pu,Nh;if(le=We,(gt=Mr())!==a){for($t=[],ci=We,es=Sr(),(ql=DE())!==a?(Pu=Sr(),(Nh=Mr())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(ql=DE())!==a?(Pu=Sr(),(Nh=Mr())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Tr=le,le=Ir(gt,$t)}else We=le,le=a;return le}function Mr(){var le,gt,$t,ci,es,ql,Pu,Nh;if(le=We,(gt=M7())!==a){for($t=[],ci=We,es=Sr(),(ql=Fue())!==a?(Pu=Sr(),(Nh=M7())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(ql=Fue())!==a?(Pu=Sr(),(Nh=M7())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Tr=le,le=$n(gt,$t)}else We=le,le=a;return le}function M7(){var le,gt,$t,ci,es,ql,Pu,Nh;if(le=We,(gt=O7())!==a){for($t=[],ci=We,es=Sr(),(ql=$7())!==a?(Pu=Sr(),(Nh=O7())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(ql=$7())!==a?(Pu=Sr(),(Nh=O7())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Tr=le,le=fa(gt,$t)}else We=le,le=a;return le}function O7(){var le,gt,$t,ci,es;return le=We,(gt=t2())===a&&(gt=We,n.charCodeAt(We)===33?($t=h,We++):($t=a,rr===0&&En(Et)),$t!==a?(ci=We,rr++,n.charCodeAt(We)===61?(es=p,We++):(es=a,rr===0&&En(Ye)),rr--,es===a?ci=void 0:(We=ci,ci=a),ci!==a?gt=$t=[$t,ci]:(We=gt,gt=a)):(We=gt,gt=a)),gt!==a?($t=Sr(),(ci=O7())!==a?(Tr=le,le=Sa(ci)):(We=le,le=a)):(We=le,le=a),le===a&&(le=lIe()),le}function lIe(){var le,gt,$t;return le=We,(gt=tw())!==a?(Sr(),($t=uIe())===a&&($t=null),Tr=le,le=ma(gt,$t)):(We=le,le=a),le}function uIe(){var le;return(le=xue())===a&&(le=cIe())===a&&(le=PX())===a&&(le=Tue())===a&&(le=sn()),le}function xue(){var le,gt,$t,ci,es,ql,Pu;if(le=We,gt=[],$t=We,ci=Sr(),(es=Sue())!==a?(ql=Sr(),(Pu=tw())!==a?$t=ci=[ci,es,ql,Pu]:(We=$t,$t=a)):(We=$t,$t=a),$t!==a)for(;$t!==a;)gt.push($t),$t=We,ci=Sr(),(es=Sue())!==a?(ql=Sr(),(Pu=tw())!==a?$t=ci=[ci,es,ql,Pu]:(We=$t,$t=a)):(We=$t,$t=a);else gt=a;return gt!==a&&(Tr=le,gt=go(gt)),le=gt}function Sue(){var le;return n.substr(We,2)===m?(le=m,We+=2):(le=a,rr===0&&En(jt)),le===a&&(n.charCodeAt(We)===62?(le=v,We++):(le=a,rr===0&&En(ei)),le===a&&(n.substr(We,2)===w?(le=w,We+=2):(le=a,rr===0&&En(Xt)),le===a&&(n.substr(We,2)===S?(le=S,We+=2):(le=a,rr===0&&En(wi)),le===a&&(n.charCodeAt(We)===60?(le=I,We++):(le=a,rr===0&&En(pi)),le===a&&(n.charCodeAt(We)===61?(le=p,We++):(le=a,rr===0&&En(Ye)),le===a&&(n.substr(We,2)===R?(le=R,We+=2):(le=a,rr===0&&En(Ri)))))))),le}function Tue(){var le,gt,$t,ci;return le=We,(gt=N7())!==a?(Sr(),($t=t2())!==a?(Sr(),(ci=tw())!==a?(Tr=le,le=tu(gt,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=N7())!==a?(Sr(),($t=tw())!==a?(Tr=le,le=Uu(gt,$t)):(We=le,le=a)):(We=le,le=a)),le}function PX(){var le,gt,$t,ci,es,ql;return le=We,(gt=t2())!==a?(Sr(),($t=WX())!==a?(Sr(),(ci=tw())!==a?(Sr(),(es=$7())!==a?(Sr(),(ql=tw())!==a?(Tr=le,le=pc($t,ci,ql)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=WX())!==a?(Sr(),($t=tw())!==a?(Sr(),(ci=$7())!==a?(Sr(),(es=tw())!==a?(Tr=le,le=Fh(gt,$t,es)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function RX(){var le,gt,$t,ci,es;return le=We,gt=We,($t=t2())!==a?(ci=Sr(),(es=Due())!==a?gt=$t=[$t,ci,es]:(We=gt,gt=a)):(We=gt,gt=a),gt!==a&&(Tr=le,gt=Zr(gt)),(le=gt)===a&&(le=Due()),le}function DX(){var le,gt,$t,ci,es;return le=We,gt=We,($t=t2())!==a?(ci=Sr(),(es=HX())!==a?gt=$t=[$t,ci,es]:(We=gt,gt=a)):(We=gt,gt=a),gt!==a&&(Tr=le,gt=Ps(gt)),(le=gt)===a&&(le=HX()),le}function sn(){var le,gt,$t,ci;return le=We,(gt=RX())!==a?(Sr(),($t=cM())!==a?(Sr(),EIe()!==a?(Sr(),(ci=GX())!==a?(Tr=le,le=ca(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=RX())!==a?(Sr(),($t=cM())!==a?(Tr=le,le=Ou(gt,$t)):(We=le,le=a)):(We=le,le=a)),le}function cIe(){var le,gt,$t,ci;return le=We,(gt=DX())!==a?(Sr(),($t=Bf())!==a?(Sr(),(ci=wue())!==a?(Sr(),Gm()!==a?(Tr=le,le=Za(gt,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=DX())!==a?(Sr(),($t=Bf())!==a?(Sr(),(ci=Gm())!==a?(Tr=le,le=kh(gt)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=DX())!==a?(Sr(),($t=F7())!==a?(Tr=le,le=Qv(gt,$t)):(We=le,le=a)):(We=le,le=a))),le}function tw(){var le,gt,$t,ci,es,ql,Pu,Nh;if(le=We,(gt=iw())!==a){for($t=[],ci=We,es=Sr(),(ql=FX())!==a?(Pu=Sr(),(Nh=iw())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(ql=FX())!==a?(Pu=Sr(),(Nh=iw())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Tr=le,le=_y(gt,$t)}else We=le,le=a;return le}function FX(){var le;return n.charCodeAt(We)===43?(le=L,We++):(le=a,rr===0&&En(Ui)),le===a&&(n.charCodeAt(We)===45?(le=k,We++):(le=a,rr===0&&En(Bi)),le===a&&(n.substr(We,2)===B?(le=B,We+=2):(le=a,rr===0&&En(mi)))),le}function iw(){var le,gt,$t,ci,es,ql,Pu,Nh;if(le=We,(gt=bL())!==a){for($t=[],ci=We,es=Sr(),(ql=Cue())!==a?(Pu=Sr(),(Nh=bL())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);ci!==a;)$t.push(ci),ci=We,es=Sr(),(ql=Cue())!==a?(Pu=Sr(),(Nh=bL())!==a?ci=es=[es,ql,Pu,Nh]:(We=ci,ci=a)):(We=ci,ci=a);Tr=le,le=I0(gt,$t)}else We=le,le=a;return le}function Cue(){var le;return n.charCodeAt(We)===42?(le=$,We++):(le=a,rr===0&&En(ar)),le===a&&(n.charCodeAt(We)===47?(le=V,We++):(le=a,rr===0&&En(z))),le}function bL(){var le,gt;return(le=rf())===a&&(le=LX())===a&&(le=fIe())===a&&(le=mIe())===a&&(le=Fg())===a&&(le=NX())===a&&(le=Id())===a&&(le=L7())===a&&(le=wL())===a&&(le=F7())===a&&(le=We,Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Gm()!==a?(Tr=le,le=e1(gt)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function wL(){var le,gt;return le=We,(gt=hIe())!==a&&(Tr=le,gt=Nl(gt)),(le=gt)===a&&(le=We,(gt=R7())!==a&&(Tr=le,gt=Sp(gt)),le=gt),le}function hIe(){var le,gt;return le=We,(gt=dIe())!==a&&(Tr=le,gt=Ml(gt)),le=gt}function dIe(){var le,gt,$t,ci;if(le=We,(gt=kX())!==a){for($t=[],ci=Eue();ci!==a;)$t.push(ci),ci=Eue();Tr=le,le=Og(gt,$t)}else We=le,le=a;return le}function P7(){var le,gt,$t,ci;if(le=We,(gt=kX())!==a){for($t=[],ci=bo();ci!==a;)$t.push(ci),ci=bo();Tr=le,le=Xc(gt,$t)}else We=le,le=a;return le}function kX(){var le;return N.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Wi)),le}function bo(){var le;return j.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Fr)),le}function Eue(){var le;return W.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(ds)),le}function R7(){var le,gt;return le=We,D7()!==a?(gt=Iue(),D7()!==a?(Tr=le,le=Bm(gt)):(We=le,le=a)):(We=le,le=a),le}function Iue(){var le,gt,$t;for(le=We,gt=[],$t=Aue();$t!==a;)gt.push($t),$t=Aue();return Tr=le,le=gt=by(gt)}function Aue(){var le;return(le=Mue())===a&&(le=pIe()),le}function pIe(){var le;return le=We,D7()!==a&&D7()!==a?(Tr=le,le=A0()):(We=le,le=a),le}function Mue(){var le;return W.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(ds)),le}function D7(){var le;return q.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(Dt)),le}function F7(){var le,gt,$t,ci;return le=We,gt=We,n.charCodeAt(We)===64?($t=Y,We++):($t=a,rr===0&&En(Mn)),$t!==a&&(ci=P7())!==a?gt=$t=[$t,ci]:(We=gt,gt=a),gt!==a&&(Tr=le,gt=Nf(gt)),le=gt}function LX(){var le,gt,$t;return le=We,IIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=gIe())!==a?(Sr(),qX()!==a?(Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Tr=le,le=Pg(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function fIe(){var le,gt,$t,ci,es,ql,Pu;return le=We,YX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),qX()!==a?(Sr(),($t=Mr())!==a?(Sr(),ci=We,(es=kue())!==a?(ql=Sr(),(Pu=Mr())!==a?ci=es=[es,ql,Pu,Sr()]:(We=ci,ci=a)):(We=ci,ci=a),ci===a&&(ci=null),(es=Gm())!==a?(Tr=le,le=Kd(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function NX(){var le,gt,$t;return le=We,PIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),RIe()!==a?(Sr(),($t=lT())!==a?(Sr(),Gm()!==a?(Tr=le,le=$f(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function lT(){var le,gt,$t;return le=We,(gt=Bue())!==a&&(Tr=le,gt=Jc()),(le=gt)===a&&(le=We,(gt=DIe())!==a&&(Tr=le,gt=t1()),(le=gt)===a&&(le=We,(gt=FIe())!==a&&(Tr=le,gt=hh()),(le=gt)===a&&(le=We,(gt=jue())!==a&&(Tr=le,gt=Lh()),(le=gt)===a&&(le=We,(gt=CL())!==a&&(Tr=le,gt=fc()),(le=gt)===a&&(le=We,(gt=Lue())!==a&&(Tr=le,gt=rn()),(le=gt)===a&&(le=We,(gt=Nue())!==a&&(Tr=le,gt=Qa()),(le=gt)===a&&(le=We,(gt=Va())!==a?(Sr(),Bf()!==a?(Sr(),($t=pM())!==a?(Sr(),Gm()!==a?(Tr=le,le=wy($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)))))))),le}function mIe(){var le,gt,$t,ci;return le=We,XX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=RE())===a&&(gt=null),Sr(),($t=Mr())!==a?(Sr(),qX()!==a?(Sr(),(ci=Mr())!==a?(Sr(),Gm()!==a?(Tr=le,le=ve(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,XX()!==a?(Sr(),Bf()!==a?(Sr(),(gt=RE())===a&&(gt=null),Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Tr=le,le=oe(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function RE(){var le;return(le=$ue())===a&&(le=MIe())===a&&(le=OIe()),le}function Fg(){var le,gt,$t;return le=We,AIe()!==a?(Sr(),Bf()!==a?(Sr(),(gt=Mr())!==a?(Sr(),HX()!==a?(Sr(),($t=Mr())!==a?(Sr(),Gm()!==a?(Tr=le,le=ce(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function Id(){var le,gt,$t;return le=We,(gt=NIe())!==a?(Sr(),Bf()!==a?(Sr(),($t=wue())===a&&($t=null),Sr(),Gm()!==a?(Tr=le,le=we(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function gIe(){var le;return(le=B7())===a&&(le=KX())===a&&(le=kg())===a&&(le=EL())===a&&(le=nD())===a&&(le=i2())===a&&(le=LIe())===a&&(le=fM()),le}function rf(){var le;return(le=GX())===a&&(le=SIe())===a&&(le=wIe())===a&&(le=bIe())===a&&(le=_Ie())===a&&(le=yIe())===a&&(le=xL())===a&&(le=$X()),le}function yIe(){var le,gt;return le=We,Lue()!==a?(Sr(),(gt=cM())!==a?(Tr=le,le=He(gt)):(We=le,le=a)):(We=le,le=a),le}function $X(){var le,gt;return le=We,Nue()!==a?(Sr(),(gt=cM())!==a?(Tr=le,le=St(gt)):(We=le,le=a)):(We=le,le=a),le}function xL(){var le,gt,$t,ci;return le=We,JX()!==a?(Sr(),n.charCodeAt(We)===45?(gt=k,We++):(gt=a,rr===0&&En(Bi)),gt===a&&(n.charCodeAt(We)===43?(gt=L,We++):(gt=a,rr===0&&En(Ui))),gt!==a?(Sr(),($t=cM())!==a?(Sr(),(ci=BX())!==a?(Tr=le,le=ut(gt,$t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,JX()!==a?(Sr(),(gt=cM())!==a?(Sr(),($t=BX())!==a?(Tr=le,le=Bt(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)),le}function BX(){var le,gt,$t;return le=We,(gt=Oue())!==a?(Sr(),kIe()!==a?(Sr(),($t=jX())!==a?(Tr=le,le=Ge(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=vIe()),le}function Oue(){var le,gt,$t;return le=We,(gt=iD())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),Gm()!==a?(Tr=le,le=et(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=iD())!==a&&(Tr=le,gt=zt(gt)),le=gt),le}function jX(){var le,gt,$t,ci;return le=We,(gt=iD())!==a&&(Tr=le,gt=ii(gt)),(le=gt)===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),DE()!==a?(Sr(),(ci=k7())!==a?(Sr(),Gm()!==a?(Tr=le,le=te($t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),Gm()!==a?(Tr=le,le=xe($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a&&(Tr=le,gt=Ae()),le=gt))),le}function vIe(){var le,gt,$t,ci;return le=We,(gt=iD())!==a?(Sr(),Bf()!==a?(Sr(),($t=k7())!==a?(Sr(),Gm()!==a?(Tr=le,le=lt(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=iD())!==a&&(Tr=le,gt=nt(gt)),(le=gt)===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=rD())!==a?(Sr(),DE()!==a?(Sr(),(ci=k7())!==a?(Sr(),Gm()!==a?(Tr=le,le=It($t,ci)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a?(Sr(),Bf()!==a?(Sr(),($t=k7())!==a?(Sr(),Gm()!==a?(Tr=le,le=Nt($t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le===a&&(le=We,(gt=i2())!==a&&(Tr=le,gt=Ut()),le=gt)))),le}function iD(){var le,gt;return le=We,(gt=kg())!==a&&(Tr=le,gt=Jt()),(le=gt)===a&&(le=We,(gt=EL())!==a&&(Tr=le,gt=xi()),(le=gt)===a&&(le=We,(gt=nD())!==a&&(Tr=le,gt=Di()),(le=gt)===a&&(le=We,(gt=KX())!==a&&(Tr=le,gt=ki()),(le=gt)===a&&(le=We,(gt=B7())!==a&&(Tr=le,gt=ir()),le=gt)))),le}function k7(){var le,gt;return le=We,(gt=pM())!==a&&(Tr=le,gt=$r(gt)),le=gt}function rD(){var le,gt;return le=We,(gt=pM())!==a&&(Tr=le,gt=mn(gt)),le=gt}function _Ie(){var le,gt;return le=We,CL()!==a?(Sr(),(gt=cM())!==a?(Tr=le,le=Kr(gt)):(We=le,le=a)):(We=le,le=a),le}function bIe(){var le,gt;return le=We,(gt=TIe())!==a&&(Tr=le,gt=xn()),le=gt}function wIe(){var le,gt;return le=We,(gt=e2())!==a&&(Tr=le,gt=Gn()),(le=gt)===a&&(le=We,(gt=CIe())!==a&&(Tr=le,gt=Ds()),le=gt),le}function cM(){var le;return(le=GX())===a&&(le=F7()),le}function GX(){var le,gt,$t,ci,es;if(le=We,n.charCodeAt(We)===39?(gt=K,We++):(gt=a,rr===0&&En(yn)),gt===a&&(n.substr(We,2)===Q?(gt=Q,We+=2):(gt=a,rr===0&&En(Pt))),gt!==a){for($t=[],ci=We,n.substr(We,2)===re?(es=re,We+=2):(es=a,rr===0&&En(Un)),es!==a&&(Tr=ci,es=Fn()),(ci=es)===a&&(J.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(Qi)));ci!==a;)$t.push(ci),ci=We,n.substr(We,2)===re?(es=re,We+=2):(es=a,rr===0&&En(Un)),es!==a&&(Tr=ci,es=Fn()),(ci=es)===a&&(J.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(Qi)));n.charCodeAt(We)===39?(ci=K,We++):(ci=a,rr===0&&En(yn)),ci!==a?(Tr=le,le=yo($t)):(We=le,le=a)}else We=le,le=a;return le}function L7(){var le;return(le=UX())===a&&(le=xIe()),le}function UX(){var le,gt,$t,ci,es;if(le=We,IL()!==a)if(Sr(),(gt=Mr())!==a){for(Sr(),$t=[],ci=dM();ci!==a;)$t.push(ci),ci=dM();ci=Sr(),(es=j7())!==a?(Tr=le,le=or(gt,$t)):(We=le,le=a)}else We=le,le=a;else We=le,le=a;if(le===a)if(le=We,IL()!==a)if(Sr(),(gt=Mr())!==a){for(Sr(),$t=[],ci=dM();ci!==a;)$t.push(ci),ci=dM();ci=Sr(),(es=SL())!==a?(Sr(),j7()!==a?(Tr=le,le=Ce(gt,$t,es)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;else We=le,le=a;return le}function xIe(){var le,gt,$t,ci;if(le=We,IL()!==a){for(Sr(),gt=[],$t=hM();$t!==a;)gt.push($t),$t=hM();$t=Sr(),(ci=j7())!==a?(Tr=le,le=ze(gt)):(We=le,le=a)}else We=le,le=a;if(le===a)if(le=We,IL()!==a){for(Sr(),gt=[],$t=hM();$t!==a;)gt.push($t),$t=hM();$t=Sr(),(ci=SL())!==a?(Sr(),j7()!==a?(Tr=le,le=mt(gt,ci)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;return le}function hM(){var le,gt,$t;return le=We,Gue()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Uue()!==a?(Sr(),($t=Mr())!==a?(Tr=le,le=Ft(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function dM(){var le,gt,$t;return le=We,Gue()!==a?(Sr(),(gt=Mr())!==a?(Sr(),Uue()!==a?(Sr(),($t=Mr())!==a?(Tr=le,le=ni(gt,$t)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a)):(We=le,le=a),le}function SL(){var le,gt;return le=We,G7()!==a?(Sr(),(gt=Mr())!==a?(Tr=le,le=bi(gt)):(We=le,le=a)):(We=le,le=a),le}function SIe(){var le,gt,$t,ci;return le=We,(gt=zX())!==a?($t=We,rr++,ci=kX(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Li(gt)):(We=le,le=a)):(We=le,le=a),le}function zX(){var le,gt,$t,ci;return le=We,(gt=TL())!==a&&($t=Pue())!==a&&(ci=Rue())!==a?(Tr=le,le=Yi(gt,$t,ci)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&($t=Pue())!==a?(Tr=le,le=wr(gt,$t)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&($t=Rue())!==a?(Tr=le,le=Ar(gt,$t)):(We=le,le=a),le===a&&(le=We,(gt=TL())!==a&&(Tr=le,gt=Qr(gt)),le=gt))),le}function TL(){var le,gt,$t;return(le=pM())===a&&(le=We,n.charCodeAt(We)===45?(gt=k,We++):(gt=a,rr===0&&En(Bi)),gt===a&&(n.charCodeAt(We)===43?(gt=L,We++):(gt=a,rr===0&&En(Ui))),gt!==a&&($t=pM())!==a?(Tr=le,le=ls(gt,$t)):(We=le,le=a)),le}function Pue(){var le,gt,$t;return le=We,n.charCodeAt(We)===46?(gt=ne,We++):(gt=a,rr===0&&En(Cn)),gt!==a?(($t=pM())===a&&($t=null),Tr=le,le=an($t)):(We=le,le=a),le}function Rue(){var le,gt,$t;return le=We,(gt=S_())!==a&&($t=pM())!==a?(Tr=le,le=so(gt,$t)):(We=le,le=a),le}function pM(){var le,gt,$t;if(le=We,gt=[],($t=VX())!==a)for(;$t!==a;)gt.push($t),$t=VX();else gt=a;return gt!==a&&(Tr=le,gt=Zs(gt)),le=gt}function VX(){var le;return ee.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(bs)),le}function S_(){var le,gt,$t;return le=We,he.test(n.charAt(We))?(gt=n.charAt(We),We++):(gt=a,rr===0&&En(qn)),gt!==a?(Ee.test(n.charAt(We))?($t=n.charAt(We),We++):($t=a,rr===0&&En(ko)),$t===a&&($t=null),Tr=le,le=$l(gt,$t)):(We=le,le=a),le}function TIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===de?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ai)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function e2(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===pe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Al)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function CIe(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===H?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(eu)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?le=gt=[gt,$t]:(We=le,le=a)):(We=le,le=a),le}function HX(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Z?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(Ma)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=za()):(We=le,le=a)):(We=le,le=a),le}function N7(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===ae?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(_n)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Ed()):(We=le,le=a)):(We=le,le=a),le}function Due(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===fe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Ss)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Oe()):(We=le,le=a)):(We=le,le=a),le}function EIe(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===be?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(la)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=ui()):(We=le,le=a)):(We=le,le=a),le}function t2(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===_e?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(gi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Zi()):(We=le,le=a)):(We=le,le=a),le}function $7(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===Ie?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(lr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Or()):(We=le,le=a)):(We=le,le=a),le}function Fue(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Te?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(Rr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=wn()):(We=le,le=a)):(We=le,le=a),le}function WX(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===Be?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Os)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=vo()):(We=le,le=a)):(We=le,le=a),le}function qX(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Ve?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Js)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=iu()):(We=le,le=a)):(We=le,le=a),le}function kue(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===$e?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(vs)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Ol()):(We=le,le=a)):(We=le,le=a),le}function YX(){var le,gt,$t,ci;return le=We,n.substr(We,9).toLowerCase()===tt?(gt=n.substr(We,9),We+=9):(gt=a,rr===0&&En(na)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=jm()):(We=le,le=a)):(We=le,le=a),le}function IIe(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===yt?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(gl)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=aT()):(We=le,le=a)):(We=le,le=a),le}function XX(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Ct?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(fn)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=CX()):(We=le,le=a)):(We=le,le=a),le}function AIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===ot?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(qr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=yL()):(We=le,le=a)):(We=le,le=a),le}function Lue(){var le,gt,$t,ci;return le=We,n.substr(We,9).toLowerCase()===vt?(gt=n.substr(We,9),We+=9):(gt=a,rr===0&&En(Gu)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=E7()):(We=le,le=a)):(We=le,le=a),le}function CL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===At?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(dc)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=I7()):(We=le,le=a)):(We=le,le=a),le}function Nue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Je?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Re)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=vL()):(We=le,le=a)):(We=le,le=a),le}function $ue(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===it?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Ne)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Qb()):(We=le,le=a)):(We=le,le=a),le}function MIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===Ue?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(dt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=PE()):(We=le,le=a)):(We=le,le=a),le}function OIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===ct?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Gt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=XEe()):(We=le,le=a)):(We=le,le=a),le}function PIe(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===st?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ti)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=pue()):(We=le,le=a)):(We=le,le=a),le}function RIe(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===Ze?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(oi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=fue()):(We=le,le=a)):(We=le,le=a),le}function Bue(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===ye?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Hi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=EX()):(We=le,le=a)):(We=le,le=a),le}function DIe(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===Ke?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(Oi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=mue()):(We=le,le=a)):(We=le,le=a),le}function FIe(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===ke?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(kt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=gue()):(We=le,le=a)):(We=le,le=a),le}function jue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===me?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Xe)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=JEe()):(We=le,le=a)):(We=le,le=a),le}function Va(){var le,gt,$t,ci;return le=We,n.substr(We,7).toLowerCase()===ie?(gt=n.substr(We,7),We+=7):(gt=a,rr===0&&En(Le)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=yue()):(We=le,le=a)):(We=le,le=a),le}function kIe(){var le,gt,$t,ci;return le=We,n.substr(We,2).toLowerCase()===ge?(gt=n.substr(We,2),We+=2):(gt=a,rr===0&&En(xt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=x_()):(We=le,le=a)):(We=le,le=a),le}function JX(){var le,gt,$t,ci;return le=We,n.substr(We,8).toLowerCase()===je?(gt=n.substr(We,8),We+=8):(gt=a,rr===0&&En(Zt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=Tp()):(We=le,le=a)):(We=le,le=a),le}function B7(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===rt?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Rt)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=KEe()):(We=le,le=a)):(We=le,le=a),le}function LIe(){var le,gt,$t,ci;return le=We,n.substr(We,13).toLowerCase()===Me?(gt=n.substr(We,13),We+=13):(gt=a,rr===0&&En(fi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=ZEe()):(We=le,le=a)):(We=le,le=a),le}function fM(){var le,gt,$t,ci;return le=We,n.substr(We,15).toLowerCase()===ht?(gt=n.substr(We,15),We+=15):(gt=a,rr===0&&En(Fi)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=QEe()):(We=le,le=a)):(We=le,le=a),le}function KX(){var le,gt,$t,ci;return le=We,n.substr(We,5).toLowerCase()===Ht?(gt=n.substr(We,5),We+=5):(gt=a,rr===0&&En(mr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=vue()):(We=le,le=a)):(We=le,le=a),le}function kg(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===_t?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(yr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=A7()):(We=le,le=a)):(We=le,le=a),le}function EL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===Fe?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Gr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=_ue()):(We=le,le=a)):(We=le,le=a),le}function nD(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===Yt?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(zr)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=eIe()):(We=le,le=a)):(We=le,le=a),le}function i2(){var le,gt,$t,ci;return le=We,n.substr(We,6).toLowerCase()===A?(gt=n.substr(We,6),We+=6):(gt=a,rr===0&&En(jn)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=tIe()):(We=le,le=a)):(We=le,le=a),le}function IL(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===ue?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(co)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=IX()):(We=le,le=a)):(We=le,le=a),le}function j7(){var le,gt,$t,ci;return le=We,n.substr(We,3).toLowerCase()===G?(gt=n.substr(We,3),We+=3):(gt=a,rr===0&&En(ua)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=iIe()):(We=le,le=a)):(We=le,le=a),le}function Gue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===E?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Hs)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=rIe()):(We=le,le=a)):(We=le,le=a),le}function Uue(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===_?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(Ll)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=nIe()):(We=le,le=a)):(We=le,le=a),le}function G7(){var le,gt,$t,ci;return le=We,n.substr(We,4).toLowerCase()===g?(gt=n.substr(We,4),We+=4):(gt=a,rr===0&&En(ft)),gt!==a?($t=We,rr++,ci=bo(),rr--,ci===a?$t=void 0:(We=$t,$t=a),$t!==a?(Tr=le,le=sIe()):(We=le,le=a)):(We=le,le=a),le}function DE(){var le;return n.charCodeAt(We)===44?(le=b,We++):(le=a,rr===0&&En(Wt)),le}function Bf(){var le;return n.charCodeAt(We)===40?(le=C,We++):(le=a,rr===0&&En(hi)),le}function Gm(){var le;return n.charCodeAt(We)===41?(le=O,We++):(le=a,rr===0&&En(Pi)),le}function Sr(){var le,gt;for(le=[],gt=U7();gt!==a;)le.push(gt),gt=U7();return le}function U7(){var le;return De.test(n.charAt(We))?(le=n.charAt(We),We++):(le=a,rr===0&&En(vr)),le}function NIe(){var le,gt,$t,ci;if(le=We,(gt=P7())!==a&&(Tr=le,gt=AX(gt)),(le=gt)===a)if(le=We,n.charCodeAt(We)===96?(gt=F,We++):(gt=a,rr===0&&En(Lr)),gt!==a){if($t=[],pt.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(on)),ci!==a)for(;ci!==a;)$t.push(ci),pt.test(n.charAt(We))?(ci=n.charAt(We),We++):(ci=a,rr===0&&En(on));else $t=a;$t!==a?(n.charCodeAt(We)===96?(ci=F,We++):(ci=a,rr===0&&En(Lr)),ci!==a?(Tr=le,le=oIe($t)):(We=le,le=a)):(We=le,le=a)}else We=le,le=a;return le}function zue(le,gt){return{type:"unary-expression",operator:le,expr:gt}}function Vue(le,gt,$t,ci){var es={type:"binary-expression",operator:le,left:gt,right:$t};return ci!==void 0&&(es.escape=ci),es}function $Ie(le,gt){for(var $t=[le],ci=0;ci `+c+` `+p+` | `+u.line+" | "+m+` `+p+" | "+t("",l.column-1," ")+t("",v,"^")}else s+=` - at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(m){return'"'+l(m.text)+'"'},class:function(m){var v=m.parts.map(function(w){return Array.isArray(w)?u(w[0])+"-"+u(w[1]):u(w)});return"["+(m.inverted?"^":"")+v.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function a(m){return m.charCodeAt(0).toString(16).toUpperCase()}function l(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function u(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function c(m){return o[m.type](m)}function h(m){var v,w,S=m.map(c);if(S.sort(),S.length>0){for(v=1,w=1;v=")&&iS(e,t[1],"<=")}static notbetween(e,t,r){return e==null||t[0]==null||t[1]==null?null:iS(e,t[0],"<")||iS(e,t[1],">")}static ternaryNot(e){return Nge(e)}static ternaryAnd(e,t){return B8t(e,t)}static ternaryOr(e,t){return j8t(e,t)}},ta=class N8t{constructor(e,t,r="UTC"){this.fieldsIndex=t,this.timeZone=r,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=P6r.parse(e);const{isStandardized:n,isAggregate:s,referencedFieldNames:o}=this._extractExpressionInfo(t);this._referencedFieldNames=o,this.isStandardized=n,this.isAggregate=s}static convertValueToStorageFormat(e,t=null){if(t===null)return tS(e)?e.getTime():gd(e)?e.toMillis():vd(e)?e.toStorageFormat():pp(e)?e.toStorageString():yd(e)?e.toStorageFormat():e;switch(t){case"date":return tS(e)?e.getTime():gd(e)?e.toMillis():vd(e)?e.toMilliseconds():yd(e)?e.toNumber():e;case"date-only":return tS(e)?Lu.fromDateJS(e).toString():vd(e)?Lu.fromSqlTimeStampOffset(e).toString():gd(e)?Lu.fromDateTime(e).toString():e;case"time-only":return tS(e)?Nu.fromDateJS(e).toStorageString():gd(e)?Nu.fromDateTime(e).toStorageString():vd(e)?Nu.fromSqlTimeStampOffset(e).toStorageString():pp(e)?e.toStorageString():e;case"timestamp-offset":if(tS(e))return o_.fromJSDate(e).toStorageFormat();if(gd(e))return o_.fromDateTime(e).toStorageFormat();if(vd(e))return e.toStorageFormat()}return e}static create(e,t,r="UTC"){return new N8t(e,t,r)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=gU){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=gU){const r=this._evaluateNode(this.parseTree,e,t,null);return r instanceof o0?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=gU){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):yi("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}testFeature(e,t=gU){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=gU){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):yi("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,e=>{e.type==="current-time"?this._hasDateFunctions=!0:e.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||R6r.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,t=>{t.type==="function"&&e.add(t.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,t=>{if(t.type==="function"){const r=t.name.toLowerCase(),n=t.args.value[0];if(n.type==="column-reference"){const s=n.column,o=`${r}-${s}`;e.has(o)||e.set(o,{aggregateType:r,field:s})}}}),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,t=>{t.type==="parameter"&&e.add(t.value.toLowerCase())}),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",e).bind(D6r)}_extractExpressionInfo(e){const t=[],r=new Set;let n=!0,s=!1;return this._visitAll(this.parseTree,o=>{switch(o.type){case"column-reference":{const a=e?.get(o.column);let l,u;a?l=u=a.name??"":(u=o.column,l=u.toLowerCase()),r.has(l)||(r.add(l),t.push(u)),o.column=u;break}case"function":{const{name:a,args:l}=o,u=l.value.length;n&&(n=R$r(a,u)),s===!1&&(s=ydt(a,u));break}}}),{referencedFieldNames:Array.from(t),isStandardized:n,isAggregate:s}}_visitAll(e,t){if(e!=null)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,t);e.format==="simple"&&this._visitAll(e.operand,t),e.else!==null&&this._visitAll(e.else,t);break;case"expression-list":for(const r of e.value)this._visitAll(r,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if(e.format==="simple"){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let n=0;n=",this.timeZone)&&iS(o,a[1],"<=",this.timeZone)}case"NOTBETWEEN":{const o=this._evaluateNode(e.left,t,r,n),a=this._evaluateNode(e.right,t,r,n);return o==null||a[0]==null||a[1]==null?null:iS(o,a[0],"<",this.timeZone)||iS(o,a[1],">",this.timeZone)}case"LIKE":return a6e(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.escape);case"NOT LIKE":return Nge(a6e(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return iS(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return k8t(e.operator,this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=R8t(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=MTe(e.value,"unknown"),e.parsedValue;case"time":return zYe(e.value);case"current-time":return e.mode==="date"?Lu.fromNow(this.timeZone):ATe(new Date,this.timeZone);case"column-reference":return G8t(t,e.column,this.fieldsIndex,r);case"data-type":return e.value;case"function":{if(this.isAggregate&&ydt(e.name,e.args.value.length)){const a=[];for(const l of e.args?.value||[]){const u=[];for(const c of n||[])u.push(this._evaluateNode(l,c,r,null));a.push(u)}return u$r(e.name,a)}const o=this._evaluateNode(e.args,t,r,n);return VYe(e.name,o,this.timeZone)}}throw new fr(tr.UnsupportedSyntax,{node:e.type})}};function $8t(i){return i===!0}function s6e(i){return Array.isArray(i)?i:[i]}function Nge(i){return i!==null?i!==!0:null}function B8t(i,e){return i!=null&&e!=null?i===!0&&e===!0:i!==!1&&e!==!1&&null}function j8t(i,e){return i!=null&&e!=null?i===!0||e===!0:i===!0||e===!0||null}function o6e(i,e){if(i==null)return null;let t=!1;for(const r of e)if(r==null)t=null;else if(i===r){t=!0;break}return t}const xdt="-[]/{}()*+?.\\^$|";var B6;function F6r(i,e){const t=e;let r="",n=B6.Normal;for(let s=0;s(k6r(i)?i.attributes:i)[e]},L6r=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:ta,defaultAttributeAdapter:gU},Symbol.toStringTag,{value:"Module"}));let QY=class{constructor(e){this.source=e}},eX=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e.toLowerCase()];return t?{syntax:t.script,uri:t.uri}:null}};var wt;(function(i){i.AsyncNotEnabled="AsyncNotEnabled",i.ModulesNotSupported="ModulesNotSupported",i.CircularModules="CircularModules",i.CannotCompareDateAndTime="CannotCompareDateAndTime",i.NeverReach="NeverReach",i.UnsupportedHashType="UnsupportedHashType",i.InvalidParameter="InvalidParameter",i.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",i.UnexpectedToken="UnexpectedToken",i.Unrecognized="Unrecognized",i.UnrecognizedType="UnrecognizedType",i.MaximumCallDepth="MaximumCallDepth",i.BooleanConditionRequired="BooleanConditionRequired",i.TypeNotAllowedInFeature="TypeNotAllowedInFeature",i.KeyMustBeString="KeyMustBeString",i.WrongNumberOfParameters="WrongNumberOfParameters",i.CallNonFunction="CallNonFunction",i.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",i.NoFunctionInDictionary="NoFunctionInDictionary",i.NoFunctionInArray="NoFunctionInArray",i.AssignModuleFunction="AssignModuleFunction",i.LogicExpressionOrAnd="LogicExpressionOrAnd",i.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",i.FunctionNotFound="FunctionNotFound",i.InvalidMemberAccessKey="InvalidMemberAccessKey",i.UnsupportedUnaryOperator="UnsupportUnaryOperator",i.InvalidIdentifier="InvalidIdentifier",i.MemberOfNull="MemberOfNull",i.UnsupportedOperator="UnsupportedOperator",i.Cancelled="Cancelled",i.ModuleAccessorMustBeString="ModuleAccessorMustBeString",i.ModuleExportNotFound="ModuleExportNotFound",i.Immutable="Immutable",i.OutOfBounds="OutOfBounds",i.IllegalResult="IllegalResult",i.FieldNotFound="FieldNotFound",i.PortalRequired="PortalRequired",i.LogicError="LogicError",i.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",i.KeyAccessorMustBeString="KeyAccessorMustBeString",i.WrongSpatialReference="WrongSpatialReference",i.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",i.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(wt||(wt={}));const U8t={[wt.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[wt.LogicError]:"Logic error - {reason}",[wt.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[wt.NeverReach]:"Encountered unreachable logic",[wt.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[wt.ModuleAccessorMustBeString]:"Module accessor must be a string",[wt.ModuleExportNotFound]:"Module has no export with provided identifier",[wt.ModulesNotSupported]:"Current profile does not support modules",[wt.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[wt.FunctionNotFound]:"Function not found",[wt.FieldNotFound]:"Key not found - {key}",[wt.CircularModules]:"Circular module dependencies are not allowed",[wt.Cancelled]:"Execution cancelled",[wt.UnsupportedHashType]:"Type not supported in hash function",[wt.IllegalResult]:"Value is not a supported return type",[wt.PortalRequired]:"Portal is required",[wt.InvalidParameter]:"Invalid parameter",[wt.WrongNumberOfParameters]:"Call with wrong number of parameters",[wt.Unrecognized]:"Unrecognized code structure",[wt.UnrecognizedType]:"Unrecognized type",[wt.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[wt.BooleanConditionRequired]:"Conditions must use booleans",[wt.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[wt.NoFunctionInArray]:"Arrays cannot contain functions.",[wt.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[wt.KeyAccessorMustBeString]:"Accessor must be a string",[wt.KeyMustBeString]:"Object keys must be a string",[wt.Immutable]:"Object is immutable",[wt.UnexpectedToken]:"Unexpected token",[wt.MemberOfNull]:"Cannot access property of null object",[wt.MaximumCallDepth]:"Exceeded maximum function depth",[wt.OutOfBounds]:"Out of bounds",[wt.InvalidIdentifier]:"Identifier not recognized",[wt.CallNonFunction]:"Expression is not a function",[wt.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[wt.AssignModuleFunction]:"Cannot assign function to module variable",[wt.UnsupportedUnaryOperator]:"Unsupported unary operator",[wt.UnsupportedOperator]:"Unsupported operator",[wt.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[wt.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[wt.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[wt.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[wt.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let N6r=class extends Error{constructor(...e){super(...e)}},Sdt=class z8t extends N6r{constructor(e,t){super(WYe(t)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,z8t),t?.loc&&(this.loc=t.loc)}},Mt=class V8t extends Error{constructor(e,t,r,n){super("Execution error - "+WYe(r)+m0(U8t[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,V8t),r?.loc&&(this.loc=r.loc)}};function WYe(i){return i&&i.loc?`Line : ${i.loc.start?.line}, ${i.loc.start?.column}: `:""}let f0=class H8t extends Error{constructor(e,t,r,n){super("Compilation error - "+WYe(r)+m0(U8t[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,H8t),r?.loc&&(this.loc=r.loc)}},hde=class W8t extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,W8t)}};function q8t(i,e,t){return t.declaredRootClass==="esri.arcade.arcadeexecutionerror"||t.declaredRootClass==="esri.arcade.arcadecompilationerror"?t.loc===null&&e?.loc?new Sdt(t,{cause:t}):t:(t.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||t.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||t.declaredRootClass,e?.loc?new Sdt(t,{cause:t}):t)}var p9;(function(i){i.UnrecognizedUri="UnrecognizedUri",i.UnsupportedUriProtocol="UnsupportedUriProtocol"})(p9||(p9={}));const $6r={[p9.UnrecognizedUri]:"Unrecognized uri - {uri}",[p9.UnsupportedUriProtocol]:"Unrecognized uri protocol"};let _Oe=class Y8t extends Error{constructor(e,t){super(m0($6r[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,Y8t)}},bk=class{constructor(){}};function wk(i,e,t){if(i instanceof bk&&!(i instanceof US)){const r=new US;return r.fn=i,r.parameterEvaluator=t,r.context=e,r}return i}let T3=class extends bk{constructor(e){super(),this.fn=e}createFunction(e){return(...t)=>this.fn(e,{preparsed:!0,arguments:t})}call(e,t){return this.fn(e,t)}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{a=a.map(u=>u instanceof bk&&!(u instanceof US)?wk(u,e,n):u);const l=this.call(r,{args:a});return qp(l)?l.then(u=>wk(u,r,n)):l})}},US=class extends bk{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,t){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}marshalledCall(e,t,r){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}},ug=class{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){const e=[];for(let t=0;t1&&s[0]in bOe&&(i=s[0],e=!0),e||(i="en")}const[t,r,n="#,##0.###"]=bOe[i];return{decimal:t,group:r,pattern:n}}function H6r(i,e){const t=K8t((e={...e}).locale);e.customs=t;const r=e.pattern||t.pattern;return isNaN(i)||Math.abs(i)===1/0?null:W6r(i,r,e)}const Z8t=/[#0,]*[#0](?:\.0*#*)?/;function W6r(i,e,t){const r=(t=t||{}).customs.group,n=t.customs.decimal,s=e.split(";"),o=s[0];if((e=s[i<0?1:0]||"-"+o).includes("%"))i*=100;else if(e.includes("‰"))i*=1e3;else{if(e.includes("¤"))throw new Error("currency notation not supported");if(e.includes("E"))throw new Error("exponential notation not supported")}const a=Z8t,l=o.match(a);if(!l)throw new Error("unable to find a number expression in pattern: "+e);return t.fractional===!1&&(t.places=0),e.replace(a,q6r(i,l[0],{decimal:n,group:r,places:t.places,round:t.round}))}function q6r(i,e,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=e.split("."),n=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;n?s=t.places.substring(n+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(i=Number(i.toFixed(Number(s))));const o=String(Math.abs(i)).split("."),a=o[1]||"";if(r[1]||t.places){n&&(t.places=t.places.substring(0,n));const v=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+v>a.length&&(o[1]=a.padEnd(Number(v),"0")),+so[0].length&&(o[0]=o[0].padStart(u,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-u)));let c,h,p=r[0].lastIndexOf(",");if(p!==-1){c=r[0].length-p-1;const v=r[0].substr(0,p);p=v.lastIndexOf(","),p!==-1&&(h=v.length-p-1)}const m=[];for(let v=o[0];v;){const w=v.length-c;m.push(w>0?v.substr(w):v),v=w>0?v.slice(0,w):"",h&&(c=h,h=void 0)}return o[0]=m.reverse().join(t.group||","),o.join(t.decimal||".")}function Q8t(i){const e=K8t((i=i||{}).locale),t=i.pattern||e.pattern,r=e.group,n=e.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const o=t.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:Lse(o,l=>(l="(?:"+UUe(l,".")+")").replace(Z8t,u=>{const c={signed:!1,separator:i.strict?r:[r,""],fractional:i.fractional,decimal:n,exponent:!1},h=u.split(".");let p=i.places;h.length===1&&s!==1&&(h[1]="###"),h.length===1||p===0?c.fractional=!1:(p===void 0&&(p=i.pattern?h[1].lastIndexOf("0")+1:1/0),p&&i.fractional==null&&(c.fractional=!0),!i.places&&+p1&&(c.groupSize=m.pop().length,m.length>1&&(c.groupSize2=m.pop().length)),"("+Y6r(c)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:n,factor:s}}function e9t(i,e){const t=Q8t(e),r=new RegExp("^"+t.regexp+"$").exec(i);if(!r)return NaN;let n=r[1];if(!r[1]){if(!r[2])return NaN;n=r[2],t.factor*=-1}return n=n.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(n)*t.factor}function Y6r(i){"places"in(i=i||{})||(i.places=1/0),typeof i.decimal!="string"&&(i.decimal="."),"fractional"in i&&!String(i.places).startsWith("0")||(i.fractional=[!0,!1]),"exponent"in i||(i.exponent=[!0,!1]),"eSigned"in i||(i.eSigned=[!0,!1]);const e=Cdt(i),t=Lse(i.fractional,n=>{let s="";return n&&i.places!==0&&(s="\\"+i.decimal,i.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+i.places+"}"),s},!0);let r=e+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+Lse(i.exponent,n=>n?"([eE]"+Cdt({signed:i.eSigned})+")":"")}function Cdt(i){return"signed"in(i=i||{})||(i.signed=[!0,!1]),"separator"in i?"groupSize"in i||(i.groupSize=3):i.separator="",Lse(i.signed,e=>e?"[-+]":"",!0)+Lse(i.separator,e=>{if(!e)return"(?:\\d+)";(e=UUe(e))===" "?e="\\s":e===" "&&(e="\\s\\xa0");const t=i.groupSize,r=i.groupSize2;if(r){const n="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+e+"]\\d{"+r+"})*["+e+"]\\d{"+t+"})";return t-r>0?"(?:"+n+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":n}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+e+"]\\d{"+t+"})*)"},!0)}const Lse=(i,e,t)=>{if(!(i instanceof Array))return e(i);const r=[];for(let n=0;n"("+(e?"?:":"")+i+")";let t9t=class{constructor(e){this.value=e}},i9t=class{constructor(e){this.value=e}};const C3=i9t,id=t9t,nn={type:"VOID"},Mm={type:"BREAK"},J3={type:"CONTINUE"};function gS(i,e,t){return e===""||e==null||e===t||e===t?i:i=i.split(e).join(t)}function mu(i){return i instanceof bk}function YYe(i){return i instanceof QY}function CR(i){return!!Jr(i)||!!uo(i)||!!qa(i)||!!Jo(i)||!!Pa(i)||!!ha(i)||i===null||i===nn||typeof i=="number"}function gn(i,e){return i===void 0?e:i}function XYe(i){return i==null?"":cn(i)||Jn(i)?"Array":qa(i)?"Date":Pa(i)?"Time":Jo(i)?"DateOnly":Jr(i)?"String":ha(i)?"Boolean":uo(i)?"Number":i?.declaredClass==="esri.arcade.Attachment"?"Attachment":i?.declaredClass==="esri.arcade.Portal"?"Portal":i?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":DTe(i)?"KnowledgeGraph":i instanceof QY?"Module":Sl(i)?"Feature":i instanceof $i?"Point":i instanceof $s?"Polygon":i instanceof lo?"Polyline":i instanceof Oh?"Multipoint":i instanceof hr?"Extent":mu(i)?"Function":wl(i)?"FeatureSet":cle(i)?"FeatureSetCollection":i===nn?"":typeof i=="number"&&isNaN(i)?"Number":"Unrecognized Type"}function Jr(i){return typeof i=="string"||i instanceof String}function ha(i){return typeof i=="boolean"}function uo(i){return typeof i=="number"}function YI(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}function tX(i){return i instanceof Nr}function cn(i){return i instanceof Array}function Sl(i){return i?.arcadeDeclaredClass==="esri.arcade.Feature"}function wl(i){return i?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function RTe(i){return i?.declaredClass==="esri.arcade.Dictionary"}function cle(i){return i?.declaredRootClass==="esri.arcade.featureSetCollection"}function DTe(i){return i?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Jn(i){return i instanceof ug}function qa(i){return i instanceof ao}function Jo(i){return i instanceof Lu}function Pa(i){return i instanceof Nu}function h6e(i){return i!=null&&typeof i=="object"}function Nse(i){return i instanceof Date}function Vi(i,e,t,r,n){if(i.lengtht)throw new Mt(r,wt.WrongNumberOfParameters,n)}function d6e(i){return i<0?-Math.round(-i):Math.round(i)}function yU(){let i=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,e=>{const t=(i+16*Math.random())%16|0;return i=Math.floor(i/16),(e==="x"?t:3&t|8).toString(16)})}function JYe(i,e){return isNaN(i)||e==null||e===""?i.toString():(e=gS(e,"‰",""),e=gS(e,"¤",""),H6r(i,{pattern:e}))}function FTe(i,e){return e==null||e===""?i.toISOString(!0):i.toFormat(KYe(e),{locale:Am(),numberingSystem:"latn"})}function KYe(i,e=!1){i=i.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const n of i.match(r)||[])switch(n){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"Z":t+="Z";break;case"ZZ":t+="ZZ";break;case"ZZZ":t+="ZZZ";break;case"ZZZZ":t+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":t+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":t+="'S'";break;case"SS":t+="'SS'";break;case"SSS":t+="u";break;case"A":case"a":t+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":t+=n;break;default:n.length>=2&&n.slice(0,1)==="["&&n.slice(-1)==="]"?t+=`'${n.slice(1,-1)}'`:t+=`'${n}'`}return t}function Qo(i,e,t){switch(t){case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}return!1}function kTe(i,e,t){if(i===null){if(e===null||e===nn)return Qo(null,null,t);if(uo(e))return Qo(0,e,t);if(Jr(e)||ha(e))return Qo(0,Ai(e),t);if(qa(e))return Qo(0,e.toNumber(),t);if(Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}if(i===nn){if(e===null||e===nn)return Qo(null,null,t);if(uo(e))return Qo(0,e,t);if(Jr(e)||ha(e))return Qo(0,Ai(e),t);if(qa(e))return Qo(0,e.toNumber(),t);if(Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}else if(uo(i)){if(uo(e))return Qo(i,e,t);if(ha(e))return Qo(i,Ai(e),t);if(e===null||e===nn)return Qo(i,0,t);if(Jr(e))return Qo(i,Ai(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}else if(Jr(i)){if(Jr(e))return Qo(en(i),en(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(Ai(i),e.toNumber(),t);if(uo(e))return Qo(Ai(i),e,t);if(e===null||e===nn)return Qo(Ai(i),0,t);if(ha(e))return Qo(Ai(i),Ai(e),t)}else if(qa(i)){if(qa(e))return i.timeZone!==e.timeZone&&(i.isUnknownTimeZone?i=ao.arcadeDateAndZoneToArcadeDate(i,e.timeZone):e.isUnknownTimeZone&&(e=ao.arcadeDateAndZoneToArcadeDate(e,i.timeZone))),Qo(i.toNumber(),e.toNumber(),t);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(Jo(e))return Qo(i.toNumber(),e.toNumber(),t)}else if(ha(i)){if(ha(e))return Qo(i,e,t);if(uo(e))return Qo(Ai(i),Ai(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(Ai(i),e.toNumber(),t);if(e===null||e===nn)return Qo(Ai(i),0,t);if(Jr(e))return Qo(Ai(i),Ai(e),t)}else if(Jo(i)){if(qa(e))return Qo(i.toNumber(),e.toNumber(),t);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(Jo(e))return Qo(i.toNumber(),e.toNumber(),t)}else if(Pa(i)){if(qa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))return Qo(i.toNumber(),e.toNumber(),t);if(Jo(e))throw new Mt(null,wt.CannotCompareDateAndTime,null)}return!!a_(i,e)&&(t==="<="||t===">=")}function a_(i,e){if(i===e||i===null&&e===nn||e===null&&i===nn)return!0;if(qa(i)&&qa(e)||Pa(i)&&Pa(e)||Jo(i)&&Jo(e))return i.equals(e);if(i instanceof l6e||i instanceof a7)return i.equalityTest(e);if(i instanceof $i&&e instanceof $i){const t=i.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(t!=null)return t===r}return!!(h6e(i)&&h6e(e)&&(i._arcadeCacheId===e._arcadeCacheId&&i._arcadeCacheId!==void 0&&i._arcadeCacheId!==null||i._underlyingGraphic===e._underlyingGraphic&&i._underlyingGraphic!==void 0&&i._underlyingGraphic!==null))}function en(i,e){if(Jr(i))return i;if(i===null)return"";if(uo(i))return JYe(i,e);if(ha(i))return i.toString();if(qa(i))return FTe(i,e);if(Pa(i)||Jo(i))return i.toFormat(e);if(i instanceof Nr)return JSON.stringify(i.toJSON());if(cn(i)){const t=[];for(let r=0;rr.key===n.key?0:r.key==="spatialReference"?1:n.key==="spatialReference"||r.keyn.key?1:0);if(cn(i)){const r=[];for(let n=0;n0)return i;return null}if(i instanceof lo){if(i.paths.length===0)return null;for(const e of i.paths)if(e.length>0)return i;return null}return i instanceof Oh?i.points.length===0?null:i:i instanceof hr?i.xmin==="NaN"||i.xmin===null||isNaN(i.xmin)?null:i:null}function ZYe(i,e){if(!i||!i.domain)return e;let t=null,r=null;if(qa(e))t=e.toNumber();else if(Jo(e))t=e.toString();else if(Pa(e))t=e.toStorageString();else if(i.field.type==="string"||i.field.type==="esriFieldTypeString")t=en(e);else{if(e==null)return null;if(e==="")return e;t=Ai(e)}for(let n=0;nc[l]===r&&(n=c.domains?.[o.name],n&&n.type==="inherited"&&(n=Edt(o.name,e),s=!0),!0)),s||n||(n=Edt(i,e)),{field:o,domain:n}}function Edt(i,e){let t;return e.fields.some(r=>(r.name.toLowerCase()===i.toLowerCase()&&(t=r.domain),!!t)),t}function p6e(i,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const t=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const u={key:a,value:o[a]},c={key:l,value:o[l]};return n(u,c)}});var n;const s=[];return function o(a){if(a?.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a===void 0)return;if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);let l,u;if(Array.isArray(a)){for(u="[",l=0;l0&&(s=i[0].spatialReference,t=i[0].hasZ,r=i[0].hasM)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else{if(!Jn(i))throw new Mt(null,wt.InvalidParameter,null);for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:(q8(n)||(n=n.slice(0).reverse()),new $s({rings:[n],spatialReference:s,hasZ:t,hasM:r}))}return i}function db(i,e){if(cn(i)||Jn(i)){let t=!1,r=!1,n=[],s=e;if(cn(i)){for(const o of i)mq(n,o);n.length>0&&(s=i[0].spatialReference,t=i[0].hasZ===!0,r=i[0].hasM===!0)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else if(Jn(i)){for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:new lo({paths:[n],spatialReference:s,hasZ:t,hasM:r})}return i}function m9(i,e){if(cn(i)||Jn(i)){let t=!1,r=!1,n=[],s=e;if(cn(i)){for(const o of i)mq(n,o);n.length>0&&(s=i[0].spatialReference,t=i[0].hasZ===!0,r=i[0].hasM===!0)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else if(Jn(i)){for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:new Oh({points:n,spatialReference:s,hasZ:t,hasM:r})}return i}function r9t(i,e=!1){const t=[];if(i===null)return t;if(cn(i)===!0){for(let r=0;r{setTimeout(()=>{e(i)},0)})):i}function LTe(i,e,t){switch(t){case"&":return i&e;case"|":return i|e;case"^":return i^e;case"<<":return i<>":return i>>e;case">>>":return i>>>e}}function xk(i,e=null){return i==null?null:ha(i)||uo(i)||Jr(i)?i:i instanceof Nr?e?.keepGeometryType===!0?i:i.toJSON():i instanceof ug?i.toArray().map(t=>xk(t,e)):i instanceof Array?i.map(t=>xk(t,e)):Nse(i)?i:qa(i)?i.toJSDate():Pa(i)?i.toString():Jo(i)?i.toJSDate():i!==null&&typeof i=="object"&&i.castAsJson!==void 0?i.castAsJson(e):null}async function Z6r(i,e,t,r,n){const s=await eXe(i,e,t);n[r]=s}async function eXe(i,e=null,t=null){if(i instanceof ug&&(i=i.toArray()),i==null)return null;if(CR(i)||i instanceof Nr||Nse(i)||qa(i))return xk(i,t);if(i instanceof Array){const r=[],n=[];for(const s of i)s===null||CR(s)||s instanceof Nr||Nse(s)||qa(s)?n.push(xk(s,t)):(n.push(null),r.push(Z6r(s,e,t,n.length-1,n)));return r.length>0&&await Promise.all(r),n}return i!==null&&typeof i=="object"&&i.castAsJsonAsync!==void 0?i.castAsJsonAsync(e,t):null}function hle(i){return tXe(i)?i.parent:i}function tXe(i){return i&&"declaredClass"in i&&i.declaredClass==="esri.layers.support.SubtypeSublayer"}function Bse(i){return i&&"declaredClass"in i&&i.declaredClass==="esri.layers.SubtypeGroupLayer"}function iXe(i,e,t){const r=hle(i.fullSchema());return r===null||!r.fields?null:f9(e,r,i,t)}function dre(i){const e=hle(i.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(t=>({name:t.name,code:t.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(t=>({name:t.name,code:t.id})):[]}:null:null}function rXe(i,e,t,r){const n=hle(i.fullSchema());if(n===null||!n.fields)return null;const s=f9(e,n,i,r);if(t===void 0)try{t=i.field(e)}catch{return null}return ZYe(s,t)}function nXe(i,e,t,r){const n=hle(i.fullSchema());if(n===null||!n.fields)return null;if(t===void 0){try{t=i.field(e)}catch{return null}return t}return QYe(f9(e,n,i,r),t)}function Es(i){return i?.timeZone??"system"}function sXe(i){const e=hle(i.fullSchema());if(e===null||!e.fields)return null;const t=[];for(const r of e.fields)t.push(u6e(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:q_e[e.geometryType]===void 0?"":q_e[e.geometryType],fields:t}}function n9t(i,e){return i==="system"&&(i=ao.systemTimeZoneCanonicalName),{version:s9t,engineVersion:tae,timeZone:i,spatialReference:e instanceof Xi?e.toJSON():e,application:Ho.applicationName??"",engine:"web",locale:Am()}}const s9t="1.24",o9t=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:i9t,ReturnResultE:t9t,absRound:d6e,arcadeVersion:s9t,autoCastArrayOfPointsToMultiPoint:m9,autoCastArrayOfPointsToPolygon:$se,autoCastArrayOfPointsToPolyline:db,autoCastFeatureToGeometry:Bn,binaryOperator:LTe,breakResult:Mm,castAsJson:xk,castAsJsonAsync:eXe,continueResult:J3,defaultExecutingContext:n9t,defaultTimeZone:Es,defaultUndefined:gn,equalityTest:a_,featureDomainCodeLookup:nXe,featureDomainValueLookup:rXe,featureFullDomain:iXe,featureSchema:sXe,featureSubtypes:dre,fixNullGeometry:m$,fixSpatialReference:zh,formatDate:FTe,formatNumber:JYe,generateUUID:yU,getDomain:f9,getDomainCode:QYe,getDomainValue:ZYe,getType:XYe,greaterThanLessThan:kTe,implicitResult:C3,isArray:cn,isBoolean:ha,isDate:qa,isDateOnly:Jo,isDictionary:RTe,isFeature:Sl,isFeatureSet:wl,isFeatureSetCollection:cle,isFunctionParameter:mu,isGeometry:tX,isImmutableArray:Jn,isInteger:YI,isJsDate:Nse,isKnowledgeGraph:DTe,isModule:YYe,isNumber:uo,isObject:h6e,isSimpleType:CR,isString:Jr,isSubtypeGrouplayer:Bse,isSubtypeSublayer:tXe,isTime:Pa,multiReplace:gS,parseGeometryFromJson:K6r,pcCheck:Vi,returnResult:id,stableStringify:p6e,standardiseDateFormat:KYe,tick:hre,toBoolean:nx,toDate:eg,toNumber:Ai,toNumberArray:f$,toString:en,toStringArray:r9t,toStringExplicit:Sb,voidOperation:nn},Symbol.toStringTag,{value:"Module"}));function Q6r(i){a9t=i}let a9t;function jse(i){return i===null?null:qa(i)?i.clone():CR(i)?i:tX(i)?i.clone():Jn(i)?i.toArray().map(e=>jse(e)):cn(i)?i.map(e=>jse(e)):Sl(i)?a9t.createFromArcadeFeature(i):cle(i)||wl(i)?i:RTe(i)||i?.declaredClass==="esri.arcade.Attachment"?i.deepClone():(i?.declaredClass==="esri.arcade.Portal"||DTe(i)||i instanceof QY||mu(i),i)}function J_e(i,e,t=!1,r=!1){if(i==null)return null;if(uo(i))return Ai(i);if(ha(i))return nx(i);if(Jr(i))return en(i);if(qa(i))return eg(i,e);if(Jo(i)||Pa(i))return i;if(cn(i)){const s=[];for(const o of i)s.push(J_e(o,e,t,r));return s}if(r&&tX(i))return i;const n=new vn;n.immutable=!1;for(const s of Object.keys(i)){const o=i[s];o!==void 0&&n.setField(s,J_e(o,e,t,r))}return n.immutable=t,n}let vn=class Bge{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof Bge?e.attributes:e??{}}field(e){const t=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const n in this.attributes)if(n.toLowerCase()===t)return this.attributes[n];throw new Mt(null,wt.FieldNotFound,null,{key:e})}setField(e,t){if(this.immutable)throw new Mt(null,wt.Immutable,null);if(mu(t))throw new Mt(null,wt.NoFunctionInDictionary,null);const r=e.toLowerCase();if(t instanceof Date&&(t=ao.dateJSToArcadeDate(t)),this.attributes[e]===void 0){for(const n in this.attributes)if(n.toLowerCase()===r)return void(this.attributes[n]=t);this.attributes[e]=t}else this.attributes[e]=t}hasField(e){const t=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===t)return!0;return!1}keys(){let e=[];for(const t in this.attributes)e.push(t);return e=e.sort(),e}castToText(e=!1){let t="";for(const r in this.attributes){t!==""&&(t+=",");const n=this.attributes[r];n==null?t+=JSON.stringify(r)+":null":ha(n)||uo(n)||Jr(n)?t+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Nr?t+=JSON.stringify(r)+":"+Sb(n):n instanceof ug||n instanceof Array?t+=JSON.stringify(r)+":"+Sb(n,null,e):n instanceof ao?t+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(t+=JSON.stringify(r)+":"+n.castToText(e))}return"{"+t+"}"}static convertObjectToArcadeDictionary(e,t,r=!0,n=!1){const s=new Bge;s.immutable=!1;for(const o in e){const a=e[o];a!==void 0&&s.setField(o.toString(),J_e(a,t,r,n))}return s.immutable=r,s}static convertJsonToArcade(e,t,r=!1,n=!1){return J_e(e,t,r,n)}castAsJson(e=null){const t={};for(let r in this.attributes){const n=this.attributes[r];n!==void 0&&(e?.keyTranslate&&(r=e.keyTranslate(r)),t[r]=xk(n,e))}return t}async castDictionaryValueAsJsonAsync(e,t,r,n=null,s){const o=await eXe(r,n,s);return e[t]=o,o}async castAsJsonAsync(e=null,t=null){const r={},n=[];for(let s in this.attributes){const o=this.attributes[s];t?.keyTranslate&&(s=t.keyTranslate(s)),o!==void 0&&(CR(o)||o instanceof Nr||o instanceof ao?r[s]=xk(o,t):n.push(this.castDictionaryValueAsJsonAsync(r,s,o,e,t)))}return n.length>0&&await Promise.all(n),r}deepClone(){const e=new Bge;e.immutable=!1;for(const t of this.keys())e.setField(t,jse(this.field(t)));return e}},Lc=class O2{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(e,t){const r=new O2;return r.contextTimeZone=t??null,r._geometry=e.geometry!=null?e.geometry:null,e.attributes===void 0||e.attributes===null?r.attributes={}:r.attributes=e.attributes,e._sourceLayer?(r._layer=e._sourceLayer,r._fieldTypesFixed=!1):e._layer?(r._layer=e._layer,r._fieldTypesFixed=!1):e.layer&&"fields"in e.layer?(r._layer=e.layer,r._fieldTypesFixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(r._layer=e.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(e){if(e instanceof O2){const r=new O2;return r._fieldTypesFixed=e._fieldTypesFixed,r.attributes=e.attributes,r._geometry=e._geometry,r._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(r._layer=e._layer),r.fieldsIndex=e.fieldsIndex,r.contextTimeZone=e.contextTimeZone,r}const t={};for(const r of e.keys())t[r]=e.field(r);return O2.createFromGraphicLikeObject(e.geometry(),t,e.fullSchema(),e.contextTimeZone)}static createFromOptimisedFeature(e,t,r){const n=new O2;return n._geometry=e.geometry?{geometry:e.geometry}:null,n._optimizedGeomDefinition=r,n.attributes=e.attributes||{},n._layer=t,n._fieldTypesFixed=!1,n}static createFromArcadeDictionary(e,t){const r=new O2;return r.attributes=e.field("attributes"),r.attributes!==null&&r.attributes instanceof vn?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=e.field("geometry"),r._geometry!==null&&(r._geometry instanceof vn?r._geometry=O2.parseGeometryFromDictionary(r._geometry,t):r._geometry instanceof Nr||(r._geometry=null)),r}static createFromGraphicLikeObject(e,t,r=null,n){const s=new O2;return s.contextTimeZone=n??null,t===null&&(t={}),s.attributes=t,s._geometry=e??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(e){return e===null?null:wl(e)?e.getFieldsIndex():e.fieldsIndex?e.fieldsIndex:Cd.fromLayerJSON({datesInUnknownTimezone:e.datesInUnknownTimezone,fields:e.fields,timeInfo:e.timeInfo,editFieldsInfo:e.editFieldsInfo,dateFieldsTimeReference:e.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(e,t,r=null){t===null&&(t={}),this.attributes=t,this._geometry=e??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(e=!1){let t="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){t!==""&&(t+=",");const n=this.attributes[r];n==null?t+=JSON.stringify(r)+":null":ha(n)||uo(n)||Jr(n)?t+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Nr?t+=JSON.stringify(r)+":"+Sb(n):n instanceof Nu||n instanceof Lu?t+=`${JSON.stringify(r)}:${JSON.stringify(n.toString())}`:n instanceof ug||n instanceof Array?t+=JSON.stringify(r)+":"+Sb(n,null,e):n instanceof ao?t+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(t+=JSON.stringify(r)+":"+n.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":Sb(this.geometry()))+',"attributes":{'+t+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const e=[],t=this._layer.fields;for(let r=0;r0&&this._fixAllFields(e),this._fieldTypesFixed=!0}isUnknownDateTimeField(e){return this.fieldsIndex?.getTimeZone(e)==="unknown"}_fixAllFields(e){this.attributes={...this.attributes};const t=this.contextTimeZone??"system";for(let r=0;r!t&&(n.type==="Identifier"&&n.name&&n.name.toLowerCase()===r&&(t=!0),!0)),t}function u9t(i){const e=[];return Hu(i,t=>(t.type==="ImportDeclaration"&&t.source&&t.source.value&&e.push({libname:t.specifiers[0].local.name.toLowerCase(),source:t.source.value}),!0)),e}function i8r(i,e){let t=!1;const r=e.toLowerCase();return Hu(i,n=>!t&&(n.type!=="CallExpression"||n.callee.type!=="Identifier"||!n.callee.name||n.callee.name.toLowerCase()!==r||(t=!0,!1))),t}function r8r(i){const e=[];return Hu(i,t=>t.type!=="MemberExpression"||t.object.type!=="Identifier"||(t.computed===!1&&t.object&&t.object.name&&t.property&&t.property.type==="Identifier"&&t.property.name?e.push(t.object.name.toLowerCase()+"."+t.property.name.toLowerCase()):t.object&&t.object.name&&t.property&&t.property.type==="Literal"&&typeof t.property.value=="string"&&e.push(t.object.name.toLowerCase()+"."+t.property.value?.toString().toLowerCase()),!1)),e}function n8r(i){const e=[];return Hu(i,t=>{if(t.type==="CallExpression"){if(t.callee.type==="Identifier"&&t.callee.name.toLowerCase()==="expects"){let r="";for(let n=0;n<(t.arguments||[]).length;n++)n===0?t.arguments[n].type==="Identifier"&&(r=t.arguments[n].name.toLowerCase()):r&&t.arguments[n].type==="Literal"&&Adt(t.arguments[n].value)&&e.push(r+"."+t.arguments[n].value.toLowerCase());return!1}if(t.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(t.callee.name.toLowerCase())&&t.arguments.length>=2){let r="";return t.arguments[0].type==="Identifier"&&(r=t.arguments[0].name.toLowerCase()),r&&t.arguments[1].type==="Literal"&&Adt(t.arguments[1].value)&&e.push(r+"."+t.arguments[1].value.toLowerCase()),!1}}return t.type!=="MemberExpression"||t.object.type!=="Identifier"||(t.computed===!1&&t.object&&t.object.name&&t.property&&t.property.type==="Identifier"&&t.property.name?e.push(t.object.name.toLowerCase()+"."+t.property.name.toLowerCase()):t.object&&t.object.name&&t.property&&t.property.type==="Literal"&&typeof t.property.value=="string"&&e.push(t.object.name.toLowerCase()+"."+t.property.value?.toString().toLowerCase()),!1)}),e}function f6e(i){const e=[];return Hu(i,t=>(t.type==="CallExpression"&&t.callee.type==="Identifier"&&e.push(t.callee.name.toLowerCase()),!0)),e}function dle(i,e=[]){let t=null;if(i.usesFeatureSet===void 0){t===null&&(t=f6e(i)),i.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(l9t(i,r)){i.usesFeatureSet=!0,i.isAsync=!0;break}}}if(i.usesModules===void 0&&(i.usesModules=!1,u9t(i).length>0&&(i.usesModules=!0)),i.usesGeometry===void 0){i.usesGeometry=!1,t===null&&(t=f6e(i));for(let r=0;r0||l.length>0;)if(a.length>0&&l.length>0){let h=u(a[0],l[0]);isNaN(h)&&(h=0),h<=0?(c.push(a[0]),a=a.slice(1)):(c.push(l[0]),l=l.slice(1))}else a.length>0?(c.push(a[0]),a=a.slice(1)):l.length>0&&(c.push(l[0]),l=l.slice(1));return c}async function n(a,l){const u=a.length,c=Math.floor(u/2);if(u===0)return[];if(u===1)return[a[0]];const h=[await n(a.slice(0,c),l),await n(a.slice(c,u),l)];return s(h[0],h[1],l,[])}async function s(a,l,u,c){const h=c;if(!(a.length>0||l.length>0))return c;if(a.length>0&&l.length>0){let p=await u(a[0],l[0]);return isNaN(p)&&(p=1),p<=0?(h.push(a[0]),a=a.slice(1)):(h.push(l[0]),l=l.slice(1)),s(a,l,u,c)}return a.length>0?(h.push(a[0]),s(a=a.slice(1),l,u,c)):l.length>0?(h.push(l[0]),s(a,l=l.slice(1),u,c)):void 0}function o(a,l,u,c){Vi(u,1,2,a,l);let h=u[0];if(Jn(h)&&(h=h.toArray()),cn(h)===!1)throw new Mt(a,wt.InvalidParameter,l);if(u.length>1){if(mu(u[1])===!1)throw new Mt(a,wt.InvalidParameter,l);let S=h;const I=u[1].createFunction(a);return c?n(S,I):(S=t(S,(R,L)=>I(R,L)),S)}let p=h;if(p.length===0)return[];const m={};for(let S=0;S1||w==="String"?t(p,(S,I)=>{if(S==null||S===nn)return I==null||I===nn?0:1;if(I==null||I===nn)return-1;const R=en(S),L=en(I);return RS-I):w==="Boolean"?t(p,(S,I)=>S===I?0:I?-1:1):w==="Date"?t(p,(S,I)=>I-S):p.slice(0),p}i.functions.array=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,0,2,a,l),h.length===0)return[];if(h.length===1&&h[0]===null)return[];if(cn(h[0])){if(h.length===2&&ha(h[1])===!1)throw new Mt(a,wt.InvalidParameter,l);return gn(h[1],!1)===!0?jse(h[0]):h[0].slice(0)}if(Jn(h[0])){if(h.length===2&&ha(h[1])===!1)throw new Mt(a,wt.InvalidParameter,l);return gn(h[1],!1)===!0?jse(h[0]):h[0].toArray().slice(0)}const p=Ai(h[0]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=gn(h[1],null),v=new Array(p);return v.fill(m),v})},i.functions.front=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),Jn(h[0])){if(h[0].length()<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0].get(0)}if(cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0][0]}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.back=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),Jn(h[0])){if(h[0].length()<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0].get(h[0].length()-1)}if(cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0][h[0].length-1]}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.push=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,2,a,l),cn(h[0]))return h[0][h[0].length]=h[1],h[0].length;throw new Mt(a,wt.InvalidParameter,l)})},i.functions.pop=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);const p=h[0][h[0].length-1];return h[0].length=h[0].length-1,p}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.erase=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,2,2,a,l),cn(h[0])){let p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=h[0];if(m.length<=0)throw new Mt(a,wt.OutOfBounds,l);if(p<0&&(p=m.length+p),p<0)throw new Mt(a,wt.OutOfBounds,l);if(p>=m.length)throw new Mt(a,wt.OutOfBounds,l);return m.splice(p,1),nn}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.insert=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,3,3,a,l),cn(h[0])){const p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=h[2],v=h[0];if(p>v.length)throw new Mt(a,wt.OutOfBounds,l);if(p<0&&p<-1*v.length)throw new Mt(a,wt.OutOfBounds,l);return p===v.length?(v[p]=m,nn):(v.splice(p,0,m),nn)}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.resize=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,2,3,a,l),cn(h[0])){const p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);if(p<0)throw new Mt(a,wt.InvalidParameter,l);const m=gn(h[2],null),v=h[0];if(v.length>=p)return v.length=p,nn;const w=v.length;v.length=p;for(let S=w;S{if(Vi(h,2,2,a,l),cn(h[0])){const p=h[1];return h[0].findIndex(m=>a_(m,p))>-1}if(Jn(h[0])){const p=h[1];return h[0].toArray().findIndex(m=>a_(m,p))>-1}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.slice=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,3,a,l),cn(h[0])){const p=Ai(gn(h[1],0)),m=Ai(gn(h[2],h[0].length));if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);if(isNaN(m)||YI(m)===!1)throw new Mt(a,wt.InvalidParameter,l);return h[0].slice(p,m)}if(Jn(h[0])){const p=h[0],m=Ai(gn(h[1],0)),v=Ai(gn(h[2],p.length()));if(isNaN(m)||YI(m)===!1)throw new Mt(a,wt.InvalidParameter,l);if(isNaN(v)||YI(v)===!1)throw new Mt(a,wt.InvalidParameter,l);return p.toArray().slice(m,v)}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.splice=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{const p=[];for(let m=0;m{if(Vi(h,2,2,a,l),cn(h[0]))return Ai(h[1])>=h[0].length?h[0].slice(0):h[0].slice(0,Ai(h[1]));if(Jn(h[0]))return Ai(h[1])>=h[0].length()?h[0].slice(0):h[0].slice(0,Ai(h[1]));throw new Mt(a,wt.InvalidParameter,l)})},i.functions.first=function(a,l){return i.standardFunction(a,l,(u,c,h)=>(Vi(h,1,1,a,l),cn(h[0])?h[0].length===0?null:h[0][0]:Jn(h[0])?h[0].length()===0?null:h[0].get(0):null))},i.mode==="sync"&&(i.functions.sort=function(a,l){return i.standardFunction(a,l,(u,c,h)=>o(a,l,h,!1))},i.functions.any=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=p(v);if(ha(w)&&w===!0)return!0}return!1})},i.functions.all=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m)if(p(v)!==!0)return!1;return!0})},i.functions.none=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m)if(p(v)===!0)return!1;return!0})},i.functions.reduce=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,3,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);return h.length===2?m.length===0?null:m.reduce((v,w)=>{const S=p(v,w);return v=S!==void 0&&S!==nn?S:null}):m.reduce((v,w)=>{const S=p(v,w);return v=S!==void 0&&S!==nn?S:null},h[2])})},i.functions.map=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=p(w);S!==void 0&&S!==nn?v.push(S):v.push(null)}return v})},i.functions.filter=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m)p(w)===!0&&v.push(w);return v})}),i.mode==="async"&&(i.functions.sort=function(a,l){return i.standardFunctionAsync(a,l,(u,c,h)=>o(a,l,h,!0))},i.functions.any=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,ha(S)&&S===!0)return!0}return!1})},i.functions.all=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,S!==!0)return!1}return!0})},i.functions.none=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,S===!0)return!1}return!0})},i.functions.filter=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=await p(w);let I=null;I=qp(I)?await S:S,I===!0&&v.push(w)}return v})},i.functions.reduce=function(a,l){return i.standardFunctionAsync(a,l,(u,c,h)=>{Vi(h,2,3,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);let v=null;if(h.length>2){const w=gn(h[2],null);v=m.reduce(async(S,I)=>{let R=await S;return R!==void 0&&R!==nn||(R=null),p(R,I)},Promise.resolve(w))}else{if(m.length===0)return null;v=m.reduce(async(w,S,I)=>{if(I<=1)return p(w,S);let R=await w;return R!==void 0&&R!==nn||(R=null),p(R,S)})}return v.then(w=>w!==void 0&&w!==nn?w:null)})},i.functions.map=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=await p(w);let I=null;I=qp(I)?await S:S,I!==void 0&&I!==nn?v.push(I):v.push(null)}return v})})}const Z_e=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:s8r},Symbol.toStringTag,{value:"Module"}));function o8r(i,e,t){return i+(a8r(t)?u8r:l8r)[e]}function a8r(i){return i%4==0&&(i%100!=0||i%400==0)}const l8r=[0,31,59,90,120,151,181,212,243,273,304,334],u8r=[0,31,60,91,121,152,182,213,244,274,305,335];function zE(i){return i===null?i:i.isValid===!1?null:i}function sK(i,e){return i===""||i.toLowerCase().trim()==="default"?Es(e):i==="z"||i==="Z"?"UTC":i}function EM(i,e){return Jo(i)?i.toArcadeDate():eg(i,Es(e))}function oXe(i,e){i.today=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=new Date;return a.setHours(0,0,0,0),ao.dateJSAndZoneToArcadeDate(a,Es(t))})},i.time=function(t,r){return e(t,r,(n,s,o)=>{switch(Vi(o,0,4,t,r),o.length){case 0:{const a=ao.nowToArcadeDate(Es(t));return new Nu(a.hour,a.minute,a.second,a.millisecond)}case 1:{if(Pa(o[0]))return o[0].clone();if(qa(o[0]))return new Nu(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(Jo(o[0]))return new Nu(0,0,0,0);if(Jr(o[0]))return Nu.fromString(o[0]);const a=Ai(o[0]);return isNaN(a)===!1?Nu.fromMilliseconds(a):null}case 2:return Jr(o[0])&&Jr(o[1])?Nu.fromString(o[0],o[1]):Nu.fromParts(Ai(o[0]),Ai(o[1]),0,0);case 3:return Nu.fromParts(Ai(o[0]),Ai(o[1]),Ai(o[2]),0);case 4:return Nu.fromParts(Ai(o[0]),Ai(o[1]),Ai(o[2]),Ai(o[3]))}throw new Mt(t,wt.InvalidParameter,r)})},i.dateonly=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,3,t,r),o.length===3)return Lu.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]));if(o.length===2){const a=en(o[1]);return a===""?null:a==="X"?Lu.fromSeconds(Ai(o[0])):a==="x"?Lu.fromMilliseconds(Ai(o[0])):Lu.fromString(en(o[0]),a)}if(o.length===1){if(Jr(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return Lu.fromString(o[0]+"-01-01")}if(Jo(o[0]))return o[0].clone();if(qa(o[0]))return Lu.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const a=Ai(o[0]);return isNaN(a)===!1?Lu.fromMilliseconds(a):Jr(o[0])?Lu.fromString(o[0]):null}if(o.length===0){const a=ao.nowToArcadeDate(Es(t));return a.isValid===!1?null:Lu.fromParts(a.year,a.monthJS+1,a.day)}return null})},i.changetimezone=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),o[0]===null)return null;if(Jo(o[0]))throw new Mt(t,wt.CannotChangeTimeZoneDateOnly,r);if(Jo(o[0]))throw new Mt(t,wt.CannotChangeTimeZoneTime,r);const a=eg(o[0],Es(t));if(a===null)throw new Mt(t,wt.InvalidParameter,r);const l=B1(sK(en(o[1]),t),!1);if(l===null)return null;const u=ao.arcadeDateAndZoneToArcadeDate(a,l);return u.isValid===!1?null:u})},i.timezone=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,2,t,r),Pa(o[0])||Jo(o[0]))return"Unknown";const a=eg(o[0],Es(t));if(a===null)return null;const l=a.timeZone;return l==="system"?ao.systemTimeZoneCanonicalName:l.toLowerCase()==="utc"?"UTC":l.toLowerCase()==="unknown"?"Unknown":l})},i.timezoneoffset=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:60*a.timeZoneOffset*1e3})},i.now=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=ao.nowToArcadeDate(Es(t));return a.isValid===!1?null:a})},i.timestamp=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=ao.nowUTCToArcadeDate();return a.isValid===!1?null:a})},i.toutc=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:a.toUTC()})},i.tolocal=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:a.toLocal()})},i.day=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.day})},i.month=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.monthJS})},i.year=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.year})},i.hour=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].hour;const a=eg(o[0],Es(t));return a===null?NaN:a.hour})},i.second=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].second;const a=eg(o[0],Es(t));return a===null?NaN:a.second})},i.millisecond=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].millisecond;const a=eg(o[0],Es(t));return a===null?NaN:a.millisecond})},i.minute=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].minute;const a=eg(o[0],Es(t));return a===null?NaN:a.minute})},i.week=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=EM(o[0],Es(t));if(a===null)return NaN;const l=Ai(gn(o[1],0));if(l<0||l>6)throw new Mt(t,wt.InvalidParameter,r);const u=a.day,c=a.monthJS,h=a.year,p=a.dayOfWeekJS,m=o8r(u,c,h)-1,v=Math.floor(m/7);return p-l+(p-l<0?7:0){Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.dayOfWeekJS})},i.isoweekday=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.dayOfWeekISO})},i.isomonth=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.monthISO})},i.isoweek=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.weekISO})},i.isoyear=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.yearISO})},i.date=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,8,t,r),o.length===3){if(Jo(o[0])&&Pa(o[1])&&Jr(o[2])){const a=B1(sK(en(o[2])??"unknown",t),!1);return a===null?null:zE(ao.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,a))}return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),0,0,0,0,Es(t)))}if(o.length===4)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),0,0,0,Es(t)));if(o.length===5)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),0,0,Es(t)));if(o.length===6)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),0,Es(t)));if(o.length===7)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),Ai(o[6]),Es(t)));if(o.length===8){const a=B1(sK(en(o[7])??"unknown",t),!1);return a===null?null:zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),Ai(o[6]),a))}if(o.length===2){if(Jo(o[0])&&Jr(o[1])){const u=B1(sK(en(o[1])??"unknown",t),!1);return u===null?null:zE(ao.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,u))}if(Jo(o[0])&&Pa(o[1]))return zE(ao.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let a,l=en(o[1]);return l===""?null:(l=KYe(l,!0),a=l==="X"?Sn.fromSeconds(Ai(o[0])):l==="x"?Sn.fromMillis(Ai(o[0])):Sn.fromFormat(en(o[0]),l,{locale:Am(),numberingSystem:"latn"}),a.isValid?ao.dateTimeToArcadeDate(a):null)}if(o.length===1){if(Jo(o[0]))return zE(ao.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(Jr(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return eg(o[0]+"-01-01",Es(t))}const a=Ai(o[0]);if(isNaN(a)===!1){const l=Sn.fromMillis(a);return l.isValid?ao.dateTimeAndZoneToArcadeDate(l,Es(t)):null}return eg(o[0],Es(t))}return o.length===0?ao.nowToArcadeDate(Es(t)):null})},i.datediff=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Pa(o[0]))return Pa(o[1])?o[0].difference(o[1],en(o[2])):NaN;if(Pa(o[1]))return NaN;if(Jo(o[0]))return Jo(o[1])?o[0].difference(o[1],en(o[2])):NaN;if(Jo(o[1]))return NaN;let a=eg(o[0],Es(t)),l=eg(o[1],Es(t));if(a===null||l===null)return NaN;let u=gn(o[3],"");switch(u!==""&&u!==null?(u=sK(en(u),t),a=ao.arcadeDateAndZoneToArcadeDate(a,u),l=ao.arcadeDateAndZoneToArcadeDate(l,u)):a.timeZone!==l.timeZone&&(a.isUnknownTimeZone?a=ao.arcadeDateAndZoneToArcadeDate(a,l.timeZone):l=(l.isUnknownTimeZone,ao.arcadeDateAndZoneToArcadeDate(l,a.timeZone))),en(o[2]).toLowerCase()){case"days":case"day":case"d":return a.diff(l,"days");case"months":case"month":return a.diff(l,"months");case"minutes":case"minute":case"m":return o[2]==="M"?a.diff(l,"months"):a.diff(l,"minutes");case"seconds":case"second":case"s":return a.diff(l,"seconds");case"milliseconds":case"millisecond":case"ms":default:return a.diff(l);case"hours":case"hour":case"h":return a.diff(l,"hours");case"years":case"year":case"y":return a.diff(l,"years")}})},i.dateadd=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=Ai(o[1]);if(isNaN(a)||a===1/0||a===-1/0)return Pa(o[0])||Jo(o[0])?o[0].clone():eg(o[0],Es(t));let l="milliseconds";switch(en(o[2]).toLowerCase()){case"days":case"day":case"d":l="days",a=Jo(o[0])?a:d6e(a);break;case"months":case"month":l="months",a=Jo(o[0])?a:d6e(a);break;case"minutes":case"minute":case"m":l=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":l="seconds";break;case"milliseconds":case"millisecond":case"ms":l="milliseconds";break;case"hours":case"hour":case"h":l="hours";break;case"years":case"year":case"y":l="years"}if(Pa(o[0])||Jo(o[0]))return o[0].plus(l,a);const u=eg(o[0],Es(t));return u===null?null:u.plus({[l]:a})})}}function og(i,e,t){return Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]!==void 0&&e[2]!==void 0?(i[2]*t-e[2]*t)**2:0))}function c9t(i,e,t){return Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]!==void 0&&e[2]!==void 0?(i[2]*t-e[2]*t)**2:0))}const ZQ=[];for(const i of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=i[0];for(let t=1;t0?(r.x/=n,r.y/=n,e&&(r.z/=n),t&&(r.m/=n)):(r.x=i[0][0],r.y=i[0][1],e&&(r.z=i[0][2]),t&&e?r.m=i[0][3]:t&&(r.m=i[0][2])),r}function c8r(i,e,t,r){const n={x:(i[0]+e[0])/2,y:(i[1]+e[1])/2};return t&&(n.z=(i[2]+e[2])/2),t&&r?n.m=(i[3]+e[3])/2:r&&(n.m=(i[2]+e[2])/2),n}function h8r(i,e){if(i.length<=1)return 0;let t=0;for(let r=1;r0?(t.x/=n,t.y/=n,i.hasZ===!0&&(t.z/=n),i.hasM===!0&&(t.m/=n),new $i(t)):r>0?(e.x/=r,e.y/=r,i.hasZ===!0&&(t.z/=r),i.hasM===!0&&(e.m/=r),new $i(e)):null}function p9t(i){if(i.points.length===0)return null;let e=0,t=0,r=0,n=0;for(let o=0;o=r;)i-=e;return i}function f9t(i,e){return Math.atan2(e.y-i.y,e.x-i.x)}function m8r(i,e){return BTe(f9t(i,e),2*Math.PI)*(180/Math.PI)}function g8r(i,e){return BTe(Math.PI/2-f9t(i,e),2*Math.PI)*(180/Math.PI)}function m9t(i,e,t){const r={x:i.x-e.x,y:i.y-e.y},n={x:t.x-e.x,y:t.y-e.y};return Math.atan2(f8r(r,n),p8r(r,n))}function y8r(i,e,t){return yb(BTe(m9t(i,e,t),2*Math.PI))}function v8r(i,e,t){return yb(BTe(-1*m9t(i,e,t),2*Math.PI))}pre[9002]=.3048,pre[9003]=.3048006096012192,pre[9095]=.3048007491;const $g=[0,0];function Odt(i){for(let e=0;e1&&(r=1)),r<=.5?[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]:[t[0]-(t[0]-e[0])*(1-r),t[1]-(t[1]-e[1])*(1-r)]}function dde(i){return i&&i.arcadeDeclaredClass==="esri.arcade.Feature"}function aXe(i,e){i.ringisclockwise=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=[];if(o[0]===null)return!1;if(cn(o[0]))for(const l of o[0]){if(!(l instanceof $i))throw new Mt(t,wt.InvalidParameter,r);a.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}else if(o[0]instanceof a7)a=o[0]._elements;else{if(!Jn(o[0]))throw new Mt(t,wt.InvalidParameter,r);for(const l of o[0].toArray()){if(!(l instanceof $i))throw new Mt(t,wt.InvalidParameter,r);a.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}}return!(a.length<3)&&q8(a)})},i.polygon=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof $s))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof $s)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new $s(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.polyline=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof lo))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof lo)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new lo(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.point=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof $i))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof $i)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new $i(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.multipoint=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof Oh))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof Oh)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new Oh(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.extent=function(t,r){return e(t,r,(n,s,o)=>{o=Bn(o),Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn)a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference);else if(o[0]instanceof $i){const l={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},u=o[0];u.hasZ?(l.zmin=u.z,l.zmax=u.z):u.hasM&&(l.mmin=u.m,l.mmax=u.m),a=Ro(l)}else if(o[0]instanceof $s)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof lo)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof Oh)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof hr)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new hr(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.geometry=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]===null)return null;if(dde(o[0]))a=zh(o[0].geometry(),t.spatialReference);else if(o[0]instanceof vn)a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference);else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(Ro(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.setgeometry=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),!dde(o[0]))throw new Mt(t,wt.InvalidParameter,r);if(o[0].immutable===!0)throw new Mt(t,wt.Immutable,r);if(!(o[1]instanceof Nr||o[1]===null))throw new Mt(t,wt.InvalidParameter,r);return o[0]._geometry=o[1],nn})},i.feature=function(t,r){return e(t,r,(n,s,o)=>{if(o.length===0)throw new Mt(t,wt.WrongNumberOfParameters,r);let a=null;if(o.length===1)if(Jr(o[0]))a=Lc.fromJson(JSON.parse(o[0]),t.timeZone);else if(dde(o[0]))a=Lc.createFromArcadeFeature(o[0]);else if(o[0]instanceof Nr)a=Lc.createFromGraphicLikeObject(o[0],null,null,t.timeZone);else{if(!(o[0]instanceof vn))throw new Mt(t,wt.InvalidParameter,r);{let l=o[0].hasField("geometry")?o[0].field("geometry"):null,u=o[0].hasField("attributes")?o[0].field("attributes"):null;l!==null&&l instanceof vn&&(l=Lc.parseGeometryFromDictionary(l,t.spatialReference)),u!==null&&(u=Lc.parseAttributesFromDictionary(u)),a=Lc.createFromGraphicLikeObject(l,u,null,t.timeZone)}}else if(o.length===2){let l=null,u=null;if(o[0]!==null)if(o[0]instanceof Nr)l=o[0];else{if(!(l instanceof vn))throw new Mt(t,wt.InvalidParameter,r);l=Lc.parseGeometryFromDictionary(o[0],t.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof vn))throw new Mt(t,wt.InvalidParameter,r);u=Lc.parseAttributesFromDictionary(o[1])}a=Lc.createFromGraphicLikeObject(l,u,null,t.timeZone)}else{let l=null;const u={};if(o[0]!==null)if(o[0]instanceof Nr)l=o[0];else{if(!(l instanceof vn))throw new Mt(t,wt.InvalidParameter,r);l=Lc.parseGeometryFromDictionary(o[0],t.spatialReference)}for(let c=1;c{if(o.length===0||o.length===1&&o[0]===null){const u=new vn;return u.immutable=!1,u}if(o.length===1&&Jr(o[0]))try{const u=JSON.parse(o[0]),c=vn.convertObjectToArcadeDictionary(u,Es(t),!1);return c.immutable=!1,c}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&o[0]instanceof Nr)try{const u=o[0].toJSON();u.hasZ=o[0].hasZ===!0,u.hasM=o[0].hasM===!0;const c=vn.convertObjectToArcadeDictionary(u,Es(t),!1);return c.immutable=!1,c}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&Sl(o[0]))try{const u=new vn;u.immutable=!1,u.setField("geometry",o[0].geometry());const c=new vn;c.immutable=!1,u.setField("attributes",c);for(const h of o[0].keys())c.setField(h,o[0].field(h));return u}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&o[0]instanceof vn)try{const u=new vn;u.immutable=!1;for(const c of o[0].keys())u.setField(c,o[0].field(c));return u}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===2&&o[0]instanceof vn&&ha(o[1]))try{if(o[1]!==!0){const u=new vn;u.immutable=!1;for(const c of o[0].keys())u.setField(c,o[0].field(c));return u}return o[0].deepClone()}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length%2!=0)throw new Mt(t,wt.WrongNumberOfParameters,r);const a={};for(let u=0;u{Vi(o,2,2,t,r);const a=en(o[1]);if(dde(o[0])||o[0]instanceof vn)return o[0].hasField(a);if(o[0]instanceof Nr){const l=tE(o[0],a,null,null,2);return!l||l.keystate!=="notfound"}throw new Mt(t,wt.InvalidParameter,r)})},i.hasvalue=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),cn(o[1])||Jn(o[1])){const l=o[1];let u=[];if(Jn(l))u=l.toArray();else{if(!cn(l))throw new Mt(t,wt.InvalidParameter,r);u=l}let c=o[0];if(c===null)return!1;for(const h of u)if(Sl(c)){if(Jr(h)===!1||!c.hasField(h)||(c=c.field(h),c===null))return!1}else if(c instanceof vn){if(Jr(h)===!1||!c.hasField(h)||(c=c.field(h),c===null))return!1}else if(c instanceof Nr){if(Jr(h)===!1||(c=tE(c,h,null,null,0),c===null))return!1}else if(cn(c)){if(uo(h)===!1||(c=c[h],c==null))return!1}else if(!Jn(c)||uo(h)===!1||(c=c.get(h),c==null))return!1;return!0}if(o[0]===null||o[1]===null)return!1;const a=en(o[1]);return Sl(o[0])||o[0]instanceof vn?!!o[0].hasField(a)&&o[0].field(a)!==null:o[0]instanceof Nr?tE(o[0],a,null,null,0)!==null:!1})},i.indexof=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);const a=o[1];if(cn(o[0])){for(let l=0;l{if(o=Bn(o),Vi(o,2,3,t,r),!(o[0]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(!(o[1]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);return o.length===2?m8r(o[0],o[1]):y8r(o[0],o[1],o[2])})},i.bearing=function(t,r){return e(t,r,(n,s,o)=>{if(o=Bn(o),Vi(o,2,3,t,r),!(o[0]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(!(o[1]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);return o.length===2?g8r(o[0],o[1]):v8r(o[0],o[1],o[2])})},i.isselfintersecting=function(t,r){return e(t,r,(n,s,o)=>{o=Bn(o),Vi(o,1,1,t,r);let a=o[0];if(a instanceof $s)return a.isSelfIntersecting;if(a instanceof lo)return a=a.paths,Odt(a);if(a instanceof Oh){const l=a.points;for(let u=0;u0&&u[0][a]===e)return{partId:n,distanceAlong:s,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:u[0][0],y:u[0][1],...i.hasZ?{z:u[0][l]}:{},...i.hasM?{m:u[0][a]}:{}}),segmentId:0};let c=-1;for(let h=1;he&&e>u[h-1][a]){const w=(e-u[h-1][a])/m*p;let S=i.hasZ?y9t(u[h-1],u[h],w,r):v9t(u[h-1],u[h],w);S=[...S,e];const I=new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:S[0],y:S[1],...i.hasZ?{z:S[l]}:{},...i.hasM?{m:S[a]}:{}});return{partId:n,distanceAlong:s+o(u[h-1],[I.x,I.y,...I.hasZ?[I.z]:[],...I.hasM?[I.m]:[]],r),coordinate:I,segmentId:c}}s+=p}}return null}function b9t(i,e){if(!i)return null;switch(i.type){case"extent":case"multipoint":case"mesh":case"point":return null}const t=i.type==="polygon"?i.rings:i.paths;if(e<0)return null;let r=1;(i.spatialReference.vcsWkid||i.spatialReference.latestVcsWkid)&&(r=l7(i.spatialReference)/pu(i.spatialReference));let n=0;const s=i.hasZ?3:2,o=2,a=i.hasZ?og:g9t;let l=-1;if(e===0)return t.length===0||t[0].length===0?null:{partId:0,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:t[0][0][0],y:t[0][0][1],...i.hasZ?{z:t[0][0][o]}:{},...i.hasM?{m:t[0][0][s]}:{}}),segmentId:0};for(const u of t){l++;let c=-1;for(let h=1;he){let v=i.hasZ?y9t(u[h-1],u[h],e-n,r):v9t(u[h-1],u[h],e-n);return v=[...v,m6e(u[h-1][s],u[h][s],p,e-n)],{partId:l,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:v[0],y:v[1],...i.hasZ?{z:v[o]}:{},...i.hasM?{m:v[s]}:{}}),segmentId:c}}n=m}}return null}function E8r(i,e){if(!i||!e)return null;let t=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(t=l7(e.spatialReference)/pu(e.spatialReference));let r=null,n=0;return r=i,n=i.hasZ&&e.hasZ?og([e.x,e.y,e.z],[i.x,i.y,i.z],t):tP([e.x,e.y],[i.x,i.y],!1),{coordinate:r,distance:n}}function I8r(i,e){if(!i||!e)return null;let t=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(t=l7(e.spatialReference)/pu(e.spatialReference));let r=null,n=0,s=Number.MAX_VALUE,o=-1,a=-1;for(const l of i.points||[]){a++;const u=i.hasZ&&e.hasZ?c9t([l[0],l[1],l[2]],[e.x,e.y,e.z],t):h9t([l[0],l[1]],[e.x,e.y]);u(a=Bn(a),t(r,n,a),a[0]===null||a[1]===null||Wa.disjoint(a[0],a[1])))},i.intersects=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.intersects(a[0],a[1])))},i.touches=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.touches(a[0],a[1])))},i.crosses=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.crosses(a[0],a[1])))},i.within=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.within(a[0],a[1])))},i.contains=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.contains(a[0],a[1])))},i.overlaps=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.overlaps(a[0],a[1])))},i.equals=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),a[0]===a[1]||(a[0]instanceof Nr&&a[1]instanceof Nr?Wa.equals(a[0],a[1]):(qa(a[0])&&qa(a[1])||Pa(a[0])&&Pa(a[1])||!(!Jo(a[0])||!Jo(a[1])))&&a[0].equals(a[1]))))},i.relate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,3,3,r,n),a[0]instanceof Nr&&a[1]instanceof Nr)return Wa.relate(a[0],a[1],en(a[2]));if(a[0]instanceof Nr&&a[1]===null||a[1]instanceof Nr&&a[0]===null||a[0]===null&&a[1]===null)return!1;throw new Mt(r,wt.InvalidParameter,n)})},i.intersection=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]===null||a[1]===null?null:Wa.intersect(a[0],a[1])))},i.union=function(r,n){return e(r,n,(s,o,a)=>{const l=[];if((a=Bn(a)).length===0)throw new Mt(r,wt.WrongNumberOfParameters,n);if(a.length===1)if(cn(a[0])){const u=Bn(a[0]);for(let c=0;c(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]===null?hp(a[0]):a[0]===null?null:Wa.difference(a[0],a[1])))},i.symmetricdifference=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]===null&&a[1]===null?null:a[0]===null?hp(a[1]):a[1]===null?hp(a[0]):Wa.symmetricDifference(a[0],a[1])))},i.clip=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[1]instanceof hr)&&a[1]!==null)throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[1]===null?null:Wa.clip(a[0],a[1])})},i.cut=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[1]instanceof lo)&&a[1]!==null)throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null)return[];if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[1]===null?[hp(a[0])]:Wa.cut(a[0],a[1])})},i.area=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=$se(a[0],r.spatialReference);return l===null?0:Wa.planarArea(l,uA(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.planarArea(a[0],uA(gn(a[1],-1)))})},i.areageodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=$se(a[0],r.spatialReference);return l===null?0:Wa.geodesicArea(l,uA(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.geodesicArea(a[0],uA(gn(a[1],-1)))})},i.length=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:Wa.planarLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.planarLength(a[0],au(gn(a[1],-1)))})},i.length3d=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:l.hasZ===!0?Rdt(l,au(gn(a[1],-1))):Wa.planarLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[0].hasZ===!0?Rdt(a[0],au(gn(a[1],-1))):Wa.planarLength(a[0],au(gn(a[1],-1)))})},i.lengthgeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:Wa.geodesicLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.geodesicLength(a[0],au(gn(a[1],-1)))})},i.distance=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);let l=a[0];(cn(a[0])||Jn(a[0]))&&(l=m9(a[0],r.spatialReference));let u=a[1];if((cn(a[1])||Jn(a[1]))&&(u=m9(a[1],r.spatialReference)),!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(u instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.distance(l,u,au(gn(a[2],-1)))})},i.distancegeodetic=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);const l=a[0],u=a[1];if(!(l instanceof $i))throw new Mt(r,wt.InvalidParameter,n);if(!(u instanceof $i))throw new Mt(r,wt.InvalidParameter,n);const c=new lo({paths:[],spatialReference:l.spatialReference});return c.addPath([l,u]),Wa.geodesicLength(c,au(gn(a[2],-1)))})},i.densify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);if(l<=0)throw new Mt(r,wt.InvalidParameter,n);return a[0]instanceof $s||a[0]instanceof lo?Wa.densify(a[0],l,au(gn(a[2],-1))):a[0]instanceof hr?Wa.densify(Pdt(a[0]),l,au(gn(a[2],-1))):a[0]})},i.densifygeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);if(l<=0)throw new Mt(r,wt.InvalidParameter,n);return a[0]instanceof $s||a[0]instanceof lo?Wa.geodesicDensify(a[0],l,au(gn(a[2],-1))):a[0]instanceof hr?Wa.geodesicDensify(Pdt(a[0]),l,au(gn(a[2],-1))):a[0]})},i.generalize=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,4,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return Wa.generalize(a[0],l,nx(gn(a[2],!0)),au(gn(a[3],-1)))})},i.buffer=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return l===0?hp(a[0]):Wa.buffer(a[0],l,au(gn(a[2],-1)))})},i.buffergeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return l===0?hp(a[0]):Wa.geodesicBuffer(a[0],l,au(gn(a[2],-1)))})},i.offset=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,6,r,n),a[0]===null)return null;if(!(a[0]instanceof $s||a[0]instanceof lo))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);const u=Ai(gn(a[4],10));if(isNaN(u))throw new Mt(r,wt.InvalidParameter,n);const c=Ai(gn(a[5],0));if(isNaN(c))throw new Mt(r,wt.InvalidParameter,n);return Wa.offset(a[0],l,au(gn(a[2],-1)),en(gn(a[3],"round")).toLowerCase(),u,c)})},i.rotate=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);let l=a[0];if(l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);l instanceof hr&&(l=$s.fromExtent(l));const u=Ai(a[1]);if(isNaN(u))throw new Mt(r,wt.InvalidParameter,n);const c=gn(a[2],null);if(c===null)return Wa.rotate(l,u);if(c instanceof $i)return Wa.rotate(l,u,c);throw new Mt(r,wt.InvalidParameter,n)})},i.centroid=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=m9(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return l instanceof $i?zh(hp(a[0]),r.spatialReference):l instanceof $s?l.centroid:l instanceof lo?d9t(l):l instanceof Oh?p9t(l):l instanceof hr?l.center:null})},i.measuretocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const u=_9t(l,a[1]);return u?vn.convertObjectToArcadeDictionary(u,Es(r),!1,!0):null})},i.pointtocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);const u=a[1];if(u===null)return null;if(!(u instanceof $i))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const c=w9t(l,u);return c?vn.convertObjectToArcadeDictionary(c,Es(r),!1,!0):null})},i.distancetocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const u=b9t(l,a[1]);return u?vn.convertObjectToArcadeDictionary(u,Es(r),!1,!0):null})},i.multiparttosinglepart=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,1,1,r,n);const l=[];if(a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(a[0]instanceof $i)return[zh(hp(a[0]),r.spatialReference)];if(a[0]instanceof hr)return[zh(hp(a[0]),r.spatialReference)];const u=Wa.simplify(a[0]);if(u instanceof $s){const c=[],h=[];for(let p=0;p{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return!0;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.isSimple(a[0])})},i.simplify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.simplify(a[0])})},i.convexhull=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.convexHull(a[0])})},i.nearestcoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[0]instanceof Nr||a[0]===null))throw new Mt(r,wt.InvalidParameter,n);if(!(a[1]instanceof $i||a[1]===null))throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null||a[1]===null)return null;const l=Wa.nearestCoordinate(a[0],a[1]);return l===null||l.isEmpty?null:vn.convertObjectToArcadeDictionary({coordinate:l.coordinate,distance:l.distance,sideOfLine:l.distance===0?"straddle":l.isRightSide?"right":"left"},Es(r),!1,!0)})},i.nearestvertex=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[0]instanceof Nr||a[0]===null))throw new Mt(r,wt.InvalidParameter,n);if(!(a[1]instanceof $i||a[1]===null))throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null||a[1]===null)return null;const l=Wa.nearestVertex(a[0],a[1]);return l===null||l.isEmpty?null:vn.convertObjectToArcadeDictionary({coordinate:l.coordinate,distance:l.distance,sideOfLine:l.distance===0?"straddle":l.isRightSide?"right":"left"},Es(r),!1,!0)})}}function xOe(i,e,t){return t===void 0||+t==0?Math[i](e):(e=+e,t=+t,isNaN(e)||typeof t!="number"||t%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[i](+(e[0]+"e"+(e[1]?+e[1]-t:-t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t))))}function lXe(i,e){function t(r,n,s){const o=Ai(r);return isNaN(o)?o:isNaN(n)||isNaN(s)||n>s?NaN:os?s:o}i.number=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,1,2,r,n);const l=a[0];if(uo(l))return l;if(l===null)return 0;if(qa(l)||Pa(l)||Jo(l))return l.toNumber();if(ha(l))return Number(l);if(cn(l))return NaN;if(l===""||l===void 0)return Number(l);if(Jr(l)){if(a[1]!==void 0){let u=gS(a[1],"‰","");return u=gS(u,"¤",""),e9t(l,{pattern:u})}return Number(l.trim())}return Number(l)})},i.abs=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.abs(Ai(a[0]))))},i.acos=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.acos(Ai(a[0]))))},i.asin=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.asin(Ai(a[0]))))},i.atan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.atan(Ai(a[0]))))},i.atan2=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),Math.atan2(Ai(a[0]),Ai(a[1]))))},i.ceil=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("ceil",Ai(a[0]),-1*l)}return Math.ceil(Ai(a[0]))})},i.round=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("round",Ai(a[0]),-1*l)}return Math.round(Ai(a[0]))})},i.floor=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("floor",Ai(a[0]),-1*l)}return Math.floor(Ai(a[0]))})},i.cos=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.cos(Ai(a[0]))))},i.isnan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),typeof a[0]=="number"&&isNaN(a[0])))},i.exp=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.exp(Ai(a[0]))))},i.log=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.log(Ai(a[0]))))},i.pow=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),Ai(a[0])**Ai(a[1])))},i.random=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,0,0,r,n),Math.random()))},i.sin=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.sin(Ai(a[0]))))},i.sqrt=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.sqrt(Ai(a[0]))))},i.tan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.tan(Ai(a[0]))))},i.isempty=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),a[0]===null||a[0]===""||a[0]===void 0||a[0]===nn))},i.boolean=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,1,1,r,n);const l=a[0];return nx(l)})},i.constrain=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,3,3,r,n);const l=Ai(a[1]),u=Ai(a[2]);if(cn(a[0])){const c=[];for(const h of a[0])c.push(t(h,l,u));return c}if(Jn(a[0])){const c=[];for(let h=0;h=e&&e!==-1)return t}return t}function PC(i,e,t=1e3){switch(i.toLowerCase()){case"distinct":return P8r(e,t);case"avg":case"mean":return S9t(f$(e));case"min":return Math.min.apply(Math,f$(e));case"sum":return O8r(f$(e));case"max":return Math.max.apply(Math,f$(e));case"stdev":case"stddev":return Math.sqrt(Ddt(f$(e)));case"var":case"variance":return Ddt(f$(e));case"count":return e.length}return 0}function AD(i,e,t,r){if(r.length===1){if(cn(r[0]))return PC(i,r[0],-1);if(Jn(r[0]))return PC(i,r[0].toArray(),-1)}return PC(i,r,-1)}function uXe(i,e){i.stdev=function(t,r){return e(t,r,(n,s,o)=>AD("stdev",n,s,o))},i.variance=function(t,r){return e(t,r,(n,s,o)=>AD("variance",n,s,o))},i.average=function(t,r){return e(t,r,(n,s,o)=>AD("mean",n,s,o))},i.mean=function(t,r){return e(t,r,(n,s,o)=>AD("mean",n,s,o))},i.sum=function(t,r){return e(t,r,(n,s,o)=>AD("sum",n,s,o))},i.min=function(t,r){return e(t,r,(n,s,o)=>AD("min",n,s,o))},i.max=function(t,r){return e(t,r,(n,s,o)=>AD("max",n,s,o))},i.distinct=function(t,r){return e(t,r,(n,s,o)=>AD("distinct",n,s,o))},i.count=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),cn(o[0])||Jr(o[0]))return o[0].length;if(Jn(o[0]))return o[0].length();throw new Mt(t,wt.InvalidParameter,r)})}}let IB=class extends vn{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},T9t=class C9t extends vn{constructor(e,t,r,n,s,o,a){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",t),this.setField("contenttype",r),this.setField("size",n),this.setField("exifinfo",o),this.setField("keywords",a),this.immutable=!0}deepClone(){return new C9t(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const cXe=i=>(e,t,r)=>(r=r||14,+i(e,t).toFixed(r)),R8r=(i,e)=>i+e,D8r=(i,e)=>i*e,F8r=(i,e)=>i/e,Fdt=(i,e,t)=>cXe(R8r)(i,e,t),oH=(i,e,t)=>cXe(D8r)(i,e,t),Q_e=(i,e,t)=>cXe(F8r)(i,e,t),ebe=360,k8r=400,L8r=2*Math.PI,GC=3600,kdt=3240,fre=60,z5=60,Ldt=180*GC/Math.PI,QQ=ebe*fre*z5,SOe=90*GC,Ij=180*GC,N8r=270*GC,E9t="ᵍ",eee="°";function oK(i){if(Jr(i)===!1)throw new Mt(null,wt.InvalidParameter,null);return i}function g6e(i,e){const t=10**e;return Math.round(i*t)/t}function $8r(i,e){return i%e}function Aj(i){const e=parseFloat(i.toString().replace(Math.trunc(i).toString(),"0"))*Math.sign(i);return i<0?{fraction:e,integer:Math.ceil(i)}:{fraction:e,integer:Math.floor(i)}}var _c,Hn,Tu,y6e;function eV(i,e){switch(i){case _c.north:return e==="SHORT"?"N":"North";case _c.east:return e==="SHORT"?"E":"East";case _c.south:return e==="SHORT"?"S":"South";case _c.west:return e==="SHORT"?"W":"West"}}function TOe(i,e){return i-Math.floor(i/e)*e}function COe(i){switch(i){case Hn.truncated_degrees:case Hn.decimal_degrees:return ebe;case Hn.radians:return L8r;case Hn.gradians:return k8r;case Hn.seconds:return QQ;case Hn.fractional_degree_minutes:return fre;case Hn.fractional_minute_seconds:return z5;default:throw new Mt(null,wt.LogicError,null,{reason:"unsupported evaluations"})}}function Ndt(i){switch(i.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Tu.north_azimuth;case"POLAR":return Tu.polar;case"QUADRANT":return Tu.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Tu.south_azimuth}throw new Mt(null,wt.LogicError,null,{reason:"unsupported directionType"})}function $dt(i){switch(i.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return Hn.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return Hn.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return Hn.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return Hn.gradians}throw new Mt(null,wt.LogicError,null,{reason:"unsupported units"})}(function(i){i[i.north=0]="north",i[i.east=1]="east",i[i.south=2]="south",i[i.west=3]="west"})(_c||(_c={})),function(i){i[i.decimal_degrees=1]="decimal_degrees",i[i.seconds=2]="seconds",i[i.degrees_minutes_seconds=3]="degrees_minutes_seconds",i[i.radians=4]="radians",i[i.gradians=5]="gradians",i[i.truncated_degrees=6]="truncated_degrees",i[i.fractional_degree_minutes=7]="fractional_degree_minutes",i[i.fractional_minute_seconds=8]="fractional_minute_seconds"}(Hn||(Hn={})),function(i){i[i.north_azimuth=1]="north_azimuth",i[i.polar=2]="polar",i[i.quadrant=3]="quadrant",i[i.south_azimuth=4]="south_azimuth"}(Tu||(Tu={})),function(i){i[i.meridian=0]="meridian",i[i.direction=1]="direction"}(y6e||(y6e={}));let gq=class jge{constructor(e,t,r){this.m_degrees=e,this.m_minutes=t,this.m_seconds=r}getField(e){switch(e){case Hn.decimal_degrees:case Hn.truncated_degrees:return this.m_degrees;case Hn.fractional_degree_minutes:return this.m_minutes;case Hn.seconds:case Hn.fractional_minute_seconds:return this.m_seconds;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(e){const t=Aj(e).fraction;let r=Aj(e).integer;const n=Math.floor(r/GC);r-=n*GC;const s=Math.floor(r/z5);return r-=s*z5,new jge(n,s,r+t)}static numberToDms(e){const t=Aj(e).fraction,r=Aj(e).integer,n=oH(Aj(100*t).fraction,100),s=Aj(100*t).integer;return new jge(r,s,n)}format(e,t){let r=g6e(this.m_seconds,t),n=this.m_minutes,s=this.m_degrees;if(e===Hn.seconds||e===Hn.fractional_minute_seconds)z5<=r&&(r-=z5,++n),fre<=n&&(n=0,++s),ebe<=s&&(s=0);else if(e===Hn.fractional_degree_minutes)r=0,n=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,fre<=n&&(n=0,++s),ebe<=s&&(s=0);else if(e===Hn.decimal_degrees||e===Hn.truncated_degrees){const o=Q_e(this.m_seconds,GC),a=Q_e(this.m_minutes,fre);s=Math.round(this.m_degrees+a+o),n=0,r=0}return new jge(s,n,r)}static dmsToSeconds(e,t,r){return e*GC+t*z5+r}},B8r=class{constructor(e,t,r){this.meridian=e,this.angle=t,this.direction=r}fetchAzimuth(e){return e===y6e.meridian?this.meridian:this.direction}},b5=class hO{constructor(e){this._angle=e}static createFromAngleAndDirection(e,t){return new hO(new FA(hO._convertDirectionFormat(e.extractAngularUnits(Hn.seconds),t,Tu.north_azimuth)))}getAngle(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:case Tu.south_azimuth:case Tu.polar:return new FA(hO._convertDirectionFormat(t,Tu.north_azimuth,e));case Tu.quadrant:{const r=hO.secondsNorthAzimuthToQuadrant(t);return new FA(r.angle)}}}getMeridian(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:return _c.north;case Tu.south_azimuth:return _c.south;case Tu.polar:return _c.east;case Tu.quadrant:return hO.secondsNorthAzimuthToQuadrant(t).meridian}}getDirection(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:return _c.east;case Tu.south_azimuth:return _c.west;case Tu.polar:return _c.north;case Tu.quadrant:return hO.secondsNorthAzimuthToQuadrant(t).direction}}static secondsNorthAzimuthToQuadrant(e){const t=e<=SOe||e>=N8r?_c.north:_c.south,r=t===_c.north?Math.min(QQ-e,e):Math.abs(e-Ij),n=e>Ij?_c.west:_c.east;return new B8r(t,r,n)}static createFromAngleMeridianAndDirection(e,t,r){return new hO(new FA(hO.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(Hn.seconds),t,r)))}static secondsQuadrantToNorthAzimuth(e,t,r){return t===_c.north?r===_c.east?e:QQ-e:r===_c.east?Ij-e:Ij+e}static _convertDirectionFormat(e,t,r){let n=0;switch(t){case Tu.north_azimuth:n=e;break;case Tu.polar:n=SOe-e;break;case Tu.quadrant:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"});case Tu.south_azimuth:n=e+Ij}let s=0;switch(r){case Tu.north_azimuth:s=n;break;case Tu.polar:s=SOe-n;break;case Tu.quadrant:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"});case Tu.south_azimuth:s=n-Ij}return s=$8r(s,QQ),s<0?QQ+s:s}};function Bdt(i,e,t){let r=null;switch(e){case Hn.decimal_degrees:r=oH(i,GC);break;case Hn.seconds:r=i;break;case Hn.gradians:r=oH(i,kdt);break;case Hn.radians:r=oH(i,Ldt);break;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}switch(t){case Hn.decimal_degrees:return Q_e(r,GC);case Hn.seconds:return r;case Hn.gradians:return Q_e(r,kdt);case Hn.radians:return r/Ldt;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}let FA=class v6e{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,t){return new v6e(Bdt(e,t,Hn.seconds))}extractAngularUnits(e){return Bdt(this._seconds,Hn.seconds,Gse(e))}static createFromDegreesMinutesSeconds(e,t,r){return new v6e(Fdt(Fdt(oH(e,GC),oH(t,z5)),r))}};function Gse(i){switch(Of(i),i){case Hn.decimal_degrees:case Hn.truncated_degrees:case Hn.degrees_minutes_seconds:return Hn.decimal_degrees;case Hn.gradians:return Hn.gradians;case Hn.fractional_degree_minutes:return Hn.fractional_degree_minutes;case Hn.radians:return Hn.radians;case Hn.seconds:case Hn.fractional_minute_seconds:return Hn.seconds}}let j8r=class I9t{constructor(e,t,r,n){this.view=e,this.angle=t,this.merdian=r,this.direction=n,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,t,r){return new I9t(e,t.getAngle(r),t.getMeridian(r),t.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let e=null,t=Hn.truncated_degrees,r=0;for(let n=0;n0?1:0),"0");case Hn.truncated_degrees:case Hn.fractional_degree_minutes:return s=TOe(n.fetchFormattedDms().getField(e),COe(e)),s.toFixed(r).padStart(t+r+(r>0?1:0),"0");case Hn.fractional_minute_seconds:return s=TOe(g6e(n.fetchDms().getField(e),r),COe(e)),s.toFixed(r).padStart(t+r+(r>0?1:0),"0");default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}function U8r(i,e,t){if(t===Tu.quadrant)throw new Mt(null,wt.LogicError,null,{reason:"conversion error"});if(e===Hn.degrees_minutes_seconds){const r=gq.numberToDms(i);return b5.createFromAngleAndDirection(FA.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),t)}return b5.createFromAngleAndDirection(FA.createFromAngleAndUnits(i,Gse(e)),t)}function z8r(i){switch(Ai(i)){case 1:return{first:_c.north,second:_c.east};case 2:return{first:_c.south,second:_c.east};case 3:return{first:_c.south,second:_c.west};case 4:return{first:_c.north,second:_c.west}}return null}function jdt(i){switch(i.toUpperCase().trim()){case"N":case"NORTH":return _c.north;case"E":case"EAST":return _c.east;case"S":case"SOUTH":return _c.south;case"W":case"WEST":return _c.west}return null}function Mj(i){const e=parseFloat(i);if(uo(e)){if(isNaN(e))throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"});return e}throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}function EOe(i,e,t){const r=t===Tu.quadrant;let n=null,s=null,o=0,a=0,l=0;if(r){if(i.length<2)throw new Mt(null,wt.LogicError,null,{reason:"conversion error"});l=1;const u=z8r(en(i[i.length-1]));if(u?(n=u.first,s=u.second):(o=1,n=jdt(en(i[0])),s=jdt(en(i[i.length-1]))),n===null||s===null)throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}switch(e){case Hn.decimal_degrees:case Hn.radians:case Hn.gradians:if(i.length===0)throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"});return r?b5.createFromAngleMeridianAndDirection(FA.createFromAngleAndUnits(Mj(i[o]),Gse(e)),n,s):b5.createFromAngleAndDirection(FA.createFromAngleAndUnits(Mj(i[o]),Gse(e)),t);case Hn.degrees_minutes_seconds:if(a=i.length-l-o,a===3){const u=FA.createFromDegreesMinutesSeconds(Mj(i[o]),Mj(i[o+1]),Mj(i[o+2]));return r?b5.createFromAngleMeridianAndDirection(u,n,s):b5.createFromAngleAndDirection(u,t)}if(a===1){const u=Mj(i[o]),c=gq.numberToDms(u),h=FA.createFromDegreesMinutesSeconds(c.m_degrees,c.m_minutes,c.m_seconds);return r?b5.createFromAngleMeridianAndDirection(h,n,s):b5.createFromAngleAndDirection(h,t)}}throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}function V8r(i){const e=new Set([" ","-","/","'",'"',"\\","^",eee,E9t," ","\r",` -`,"*"]);let t="";for(let r=0;rr!=="")}function H8r(i,e,t){if(uo(i))return U8r(Ai(i),e,t);if(Jr(i))return EOe(V8r(i),e,t);if(cn(i))return EOe(i,e,t);if(Jn(i))return EOe(i.toArray(),e,t);throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}function W8r(i,e,t){const r=Gse(t);if(r&&t!==Hn.degrees_minutes_seconds)return i.getAngle(e).extractAngularUnits(r);throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}function q8r(i,e,t){const r=i.getAngle(e);if(e===Tu.quadrant&&t===Hn.degrees_minutes_seconds){const n=gq.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[eV(i.getMeridian(e),"SHORT"),n.m_degrees,n.m_minutes,n.m_seconds,eV(i.getDirection(e),"SHORT")]}if(t===Hn.degrees_minutes_seconds){const n=gq.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[n.m_degrees,n.m_minutes,n.m_seconds]}return e===Tu.quadrant?[eV(i.getMeridian(e),"SHORT"),r.extractAngularUnits(t),eV(i.getDirection(e),"SHORT")]:[r.extractAngularUnits(t)]}function Y8r(i,e){let t="";switch(i){case Hn.decimal_degrees:t=e===Tu.quadrant?"DD.DD"+eee:"DDD.DD"+eee;break;case Hn.degrees_minutes_seconds:t=e===Tu.quadrant?"dd"+eee+` mm' ss"`:"ddd"+eee+` mm' ss.ss"`;break;case Hn.radians:t="R.RR";break;case Hn.gradians:t="GGG.GG"+E9t;break;default:throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}return e===Tu.quadrant&&(t="p "+t+" b"),t}function _6e(i,e,t){const r={padding:0,rounding:0,newpos:e};let n=!1;for(;e>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(t++,n=65536+((1023&n)<<10|1023&i.charCodeAt(t)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(e)}let Z8r=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const r of e)isNaN(r)?t.push("NaN"):r===1/0?t.push("Infinity"):r===-1/0?t.push("-Infinity"):r===0?t.push("0"):t.push(r.toString(16));this.update(zdt(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(zdt(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const r of this._bufs)e.set(r,t),t+=r.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const r=e;let n=t+Udt&4294967295,s=0;if(r.length>=16){const a=[t+Oj+Pj&4294967295,t+Pj&4294967295,t+0&4294967295,t-Oj&4294967295],l=e,u=l.length-16;let c=0;for(s=0;(4294967280&s)<=u;s+=4){const h=s,p=l[h]+(l[h+1]<<8),m=l[h+2]+(l[h+3]<<8),v=p*Pj+(m*Pj<<16);let w=a[c]+v&4294967295;w=w<<13|w>>>19;const S=65535&w,I=w>>>16;a[c]=S*Oj+(I*Oj<<16)&4294967295,c=c+1&3}n=(a[0]<<1|a[0]>>>31)+(a[1]<<7|a[1]>>>25)+(a[2]<<12|a[2]>>>20)+(a[3]<<18|a[3]>>>14)&4294967295}n=n+e.length&4294967295;const o=e.length-4;for(;s<=o;s+=4){const a=s,l=r[a]+(r[a+1]<<8),u=r[a+2]+(r[a+3]<<8);n=n+(l*pde+(u*pde<<16))&4294967295,n=n<<17|n>>>15,n=(65535&n)*Gdt+((n>>>16)*Gdt<<16)&4294967295}for(;s>>21,n=(65535&n)*Oj+((n>>>16)*Oj<<16)&4294967295;return n^=n>>>15,n=((65535&n)*Pj&4294967295)+((n>>>16)*Pj<<16),n^=n>>>13,n=((65535&n)*pde&4294967295)+((n>>>16)*pde<<16),n^=n>>>16,n<0?n+4294967296:n}};function Q8r(i){return i.loadStatus==="loaded"&&i.user?.sourceJSON?i.user.sourceJSON:null}function e9r(i,e){return!!i&&eze(i,e?.restUrl||"")}function Vdt(i,e){if(!i||!e)return i===e;if(i.x===e.x&&i.y===e.y){if(i.hasZ){if(i.z!==e.z)return!1}else if(e.hasZ)return!1;if(i.hasM){if(i.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function P2(i,e,t){if(i!==null)if(cn(i)){if(e.updateUint8Array([61]),t.map.has(i)){const r=t.map.get(i);e.updateIntArray([61237541^r])}else{t.map.set(i,t.currentLength++);for(const r of i)P2(r,e,t);t.map.delete(i),t.currentLength--}e.updateUint8Array([199])}else if(Jn(i)){if(e.updateUint8Array([61]),t.map.has(i)){const r=t.map.get(i);e.updateIntArray([61237541^r])}else{t.map.set(i,t.currentLength++);for(const r of i.toArray())P2(r,e,t);t.map.delete(i),t.currentLength--}e.updateUint8Array([199])}else{if(qa(i))return e.updateIntArray([i.toNumber()]),void e.updateUint8Array([241]);if(Jo(i))return e.updateIntArray([i.toNumber()]),void e.updateIntArray([257]);if(Pa(i))return e.updateIntArray([i.toNumber()]),void e.updateIntArray([263]);if(Jr(i))return e.updateIntArray([i.length]),e.updateWithString(i),void e.updateUint8Array([41]);if(ha(i))e.updateUint8Array([i===!0?1:0,113]);else{if(uo(i))return e.updateFloatArray([i]),void e.updateUint8Array([173]);if(i instanceof T9t)throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(i instanceof IB)throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(!(i instanceof vn)){if(Sl(i))throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(i instanceof $i)return e.updateIntArray([3833836621]),e.updateIntArray([0]),e.updateFloatArray([i.x]),e.updateIntArray([1]),e.updateFloatArray([i.y]),i.hasZ&&(e.updateIntArray([2]),e.updateFloatArray([i.z])),i.hasM&&(e.updateIntArray([3]),e.updateFloatArray([i.m])),e.updateIntArray([3765347959]),void P2(i.spatialReference.wkid,e,t);if(i instanceof $s){e.updateIntArray([1266616829]);for(let r=0;r(Vi(o,1,1,t,r),new IB(en(o[0]))))},i.typeof=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=XYe(o[0]);if(a==="Unrecognized Type")throw new Mt(t,wt.UnrecognizedType,r);return a})},i.trim=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,1,t,r),en(o[0]).trim()))},i.tohex=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=Ai(o[0]);return isNaN(a)?a:a.toString(16)})},i.upper=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,1,t,r),en(o[0]).toUpperCase()))},i.proper=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);let a=1;o.length===2&&en(o[1]).toLowerCase()==="firstword"&&(a=2);const l=/\s/,u=en(o[0]);let c="",h=!0;for(let p=0;p(Vi(o,1,1,t,r),en(o[0]).toLowerCase()))},i.guid=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,1,t,r),o.length>0)switch(en(o[0]).toLowerCase()){case"digits":return yU().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return yU();case"digits-hyphen-braces":return"{"+yU()+"}";case"digits-hyphen-parentheses":return"("+yU()+")"}return"{"+yU()+"}"})},i.standardizeguid=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=en(o[0]);if(a===""||a===null)return"";const l=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(a);if(!l)return"";const u=l.groups;switch(a=u.partA+"-"+u.partB+"-"+u.partC+"-"+u.partD+"-"+u.partE,en(o[1]).toLowerCase()){case"digits":return a.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return a;case"digits-hyphen-braces":return"{"+a+"}";case"digits-hyphen-parentheses":return"("+a+")"}return"{"+a+"}"})},i.console=function(t,r){return e(t,r,(n,s,o)=>(o.length===0||(o.length===1?t.console(en(o[0])):t.console(en(o))),nn))},i.mid=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=Ai(o[1]);if(isNaN(a))return"";if(a<0&&(a=0),o.length===2)return en(o[0]).substr(a);let l=Ai(o[2]);return isNaN(l)?"":(l<0&&(l=0),en(o[0]).substr(a,l))})},i.find=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=0;if(o.length>2){if(a=Ai(gn(o[2],0)),isNaN(a))return-1;a<0&&(a=0)}return en(o[1]).indexOf(en(o[0]),a)})},i.left=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=Ai(o[1]);return isNaN(a)?"":(a<0&&(a=0),en(o[0]).substr(0,a))})},i.right=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=Ai(o[1]);return isNaN(a)?"":(a<0&&(a=0),en(o[0]).substr(-1*a,a))})},i.split=function(t,r){return e(t,r,(n,s,o)=>{let a;Vi(o,2,4,t,r);let l=Ai(gn(o[2],-1));const u=nx(gn(o[3],!1));if(l===-1||l===null||u===!0?a=en(o[0]).split(en(o[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),a=en(o[0]).split(en(o[1]),l)),u===!1)return a;const c=[];for(let h=0;h=l);h++)a[h]!==""&&a[h]!==void 0&&c.push(a[h]);return c})},i.text=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,2,t,r),Sb(o[0],o[1])))},i.concatenate=function(t,r){return e(t,r,(n,s,o)=>{const a=[];if(o.length<1)return"";if(cn(o[0])){const l=gn(o[2],"");for(let u=0;u1?a.join(o[1]):a.join("")}if(Jn(o[0])){const l=gn(o[2],"");for(let u=0;u1?a.join(o[1]):a.join("")}for(let l=0;l{if(Vi(o,1,1,t,r),cn(o[0])){const a=o[0].slice(0);return a.reverse(),a}if(Jn(o[0])){const a=o[0].toArray().slice(0);return a.reverse(),a}throw new Mt(t,wt.InvalidParameter,r)})},i.replace=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,3,4,t,r);const a=en(o[0]),l=en(o[1]),u=en(o[2]);return o.length!==4||nx(o[3])?gS(a,l,u):a.replace(l,u)})},i.schema=function(t,r){return e(t,r,(n,s,o)=>{if(Sl(o[0])){const a=sXe(o[0]);return a?vn.convertObjectToArcadeDictionary(a,Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypes=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);return a?vn.convertObjectToArcadeDictionary(a,Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypecode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);if(!a)return null;if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const u of a.subtypes)if(u.code===l)return u.code;return null}return null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypename=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);if(!a)return"";if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const u of a.subtypes)if(u.code===l)return u.name;return""}return""}throw new Mt(t,wt.InvalidParameter,r)})},i.gdbversion=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0]))return o[0].gdbVersion();throw new Mt(t,wt.InvalidParameter,r)})},i.domain=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,3,t,r),Sl(o[0])){const a=iXe(o[0],en(o[1]),o[2]===void 0?void 0:o[2]);return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?vn.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:Y_e[a.field.type],codedValues:a.domain.codedValues.map(l=>({name:l.name,code:l.code}))},Es(t)):vn.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:Y_e[a.field.type],min:a.domain.minValue,max:a.domain.maxValue},Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.domainname=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Sl(o[0]))return rXe(o[0],en(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new Mt(t,wt.InvalidParameter,r)})},i.domaincode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Sl(o[0]))return nXe(o[0],en(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new Mt(t,wt.InvalidParameter,r)})},i.urlencode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),o[0]===null)return"";if(o[0]instanceof vn){let a="";for(const l of o[0].keys()){const u=o[0].field(l);a!==""&&(a+="&"),a+=u===null?encodeURIComponent(l)+"=":encodeURIComponent(l)+"="+encodeURIComponent(u)}return a}return encodeURIComponent(en(o[0]))})},i.hash=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=new Z8r(0);return P2(o[0],a,{context:t,node:r,map:new Map,currentLength:0}),a.digest()})},i.convertdirection=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,3,3,t,r),K8r(o[0],o[1],o[2])))},i.fromjson=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Jr(o[0])===!1)throw new Mt(t,wt.InvalidParameter,r);return vn.convertJsonToArcade(JSON.parse(en(o[0])),Es(t))})},i.expects=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);return nn})},i.tocharcode=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=Ai(gn(o[1],0)),l=en(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Mt(t,wt.OutOfBounds,r);return l.charCodeAt(a)})},i.tocodepoint=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=Ai(gn(o[1],0)),l=en(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Mt(t,wt.OutOfBounds,r);return l.codePointAt(a)})},i.fromcharcode=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);const a=o.map(l=>Math.trunc(Ai(l))).filter(l=>l>=0&&l<=65535);return a.length===0?null:String.fromCharCode.apply(null,a)})},i.fromcodepoint=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);let a;try{a=o.map(l=>Math.trunc(Ai(l))).filter(l=>l<=1114111&&l>>>0===l)}catch{return null}return a.length===0?null:String.fromCodePoint.apply(null,a)})},i.getuser=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,2,t,r);let a=gn(o[1],"");if(a=a===!0||a===!1?"":en(a),a!==null&&a!=="")return null;if(o.length===0||o[0]instanceof IB){let l=null;if(l=t.services?.portal?t.services.portal:Bu.getDefault(),o.length>0&&!e9r(o[0].field("url"),l)||!l)return null;if(a===""){const u=Q8r(l);if(u){const c=JSON.parse(JSON.stringify(u));for(const h of["lastLogin","created","modified"])c[h]!==void 0&&c[h]!==null&&(c[h]=new Date(c[h]));return vn.convertObjectToArcadeDictionary(c,Es(t))}}return null}throw new Mt(t,wt.InvalidParameter,r)})},i.getenvironment=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,0,0,t,r),vn.convertObjectToArcadeDictionary(n9t(Es(t),t.spatialReference),Es(t),!0)))}}let t9r=class extends bk{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new Mt(e,wt.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{a=a.map(u=>!mu(u)||u instanceof US?u:wk(u,e,n));const l=this.call(r,{arguments:a});return qp(l)?l.then(u=>wk(u,r,n)):l})}};function Ww(i,e,t){try{return t(i,null,e.arguments)}catch(r){throw r}}function Xn(i,e){try{switch(e.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return m9r(i,e);case"VariableDeclaration":return f9r(i,e);case"BlockStatement":case"Program":return b6e(i,e);case"FunctionDeclaration":return p9r(i,e);case"ImportDeclaration":return h9r(i,e);case"ExportNamedDeclaration":return d9r(i,e);case"ReturnStatement":return c9r(i,e);case"IfStatement":return A9t(i,e);case"ExpressionStatement":return u9r(i,e);case"AssignmentExpression":return l9r(i,e);case"UpdateExpression":return o9r(i,e);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return _9r(i,e);case"TemplateElement":return JSON.stringify(e.value?e.value.cooked:"");case"ForStatement":return s9r(i,e);case"ForInStatement":return n9r(i,e);case"WhileStatement":return a9r(i,e);case"Identifier":return x9r(i,e);case"MemberExpression":return g9r(i,e);case"Literal":return e.value===null||e.value===void 0?"null":JSON.stringify(e.value);case"CallExpression":return S9r(i,e);case"UnaryExpression":return y9r(i,e);case"BinaryExpression":return b9r(i,e);case"LogicalExpression":return w9r(i,e);case"ArrayExpression":return v9r(i,e);case"ObjectExpression":return i9r(i,e);case"Property":return r9r(i,e);case"Array":throw new f0(i,wt.NeverReach,e);default:throw new f0(i,wt.Unrecognized,e)}}catch(t){throw t}}function i9r(i,e){let t="lang.dictionary([";for(let r=0;r0&&(t+=","),t+="lang.strCheck("+(n.key.type==="Identifier"?"'"+n.key.name+"'":Xn(i,n.key))+",'ObjectExpression'),lang.aCheck("+Xn(i,n.value)+", 'ObjectExpression')"}return t+="])",t}function r9r(i,e){throw new f0(i,wt.NeverReach,e)}function n9r(i,e){const t=Tb(i),r=Tb(i),n=Tb(i);let s="var "+t+" = "+Xn(i,e.right)+`; + at `+c}return s},e.buildMessage=function(n,s){var o={literal:function(m){return'"'+l(m.text)+'"'},class:function(m){var v=m.parts.map(function(w){return Array.isArray(w)?u(w[0])+"-"+u(w[1]):u(w)});return"["+(m.inverted?"^":"")+v.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(m){return m.description}};function a(m){return m.charCodeAt(0).toString(16).toUpperCase()}function l(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function u(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+a(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+a(v)})}function c(m){return o[m.type](m)}function h(m){var v,w,S=m.map(c);if(S.sort(),S.length>0){for(v=1,w=1;v=")&&iS(e,t[1],"<=")}static notbetween(e,t,r){return e==null||t[0]==null||t[1]==null?null:iS(e,t[0],"<")||iS(e,t[1],">")}static ternaryNot(e){return Nge(e)}static ternaryAnd(e,t){return B8t(e,t)}static ternaryOr(e,t){return j8t(e,t)}},ta=class N8t{constructor(e,t,r="UTC"){this.fieldsIndex=t,this.timeZone=r,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=A6r.parse(e);const{isStandardized:n,isAggregate:s,referencedFieldNames:o}=this._extractExpressionInfo(t);this._referencedFieldNames=o,this.isStandardized=n,this.isAggregate=s}static convertValueToStorageFormat(e,t=null){if(t===null)return tS(e)?e.getTime():gd(e)?e.toMillis():vd(e)?e.toStorageFormat():pp(e)?e.toStorageString():yd(e)?e.toStorageFormat():e;switch(t){case"date":return tS(e)?e.getTime():gd(e)?e.toMillis():vd(e)?e.toMilliseconds():yd(e)?e.toNumber():e;case"date-only":return tS(e)?Lu.fromDateJS(e).toString():vd(e)?Lu.fromSqlTimeStampOffset(e).toString():gd(e)?Lu.fromDateTime(e).toString():e;case"time-only":return tS(e)?Nu.fromDateJS(e).toStorageString():gd(e)?Nu.fromDateTime(e).toStorageString():vd(e)?Nu.fromSqlTimeStampOffset(e).toStorageString():pp(e)?e.toStorageString():e;case"timestamp-offset":if(tS(e))return o_.fromJSDate(e).toStorageFormat();if(gd(e))return o_.fromDateTime(e).toStorageFormat();if(vd(e))return e.toStorageFormat()}return e}static create(e,t,r="UTC"){return new N8t(e,t,r)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=gU){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=gU){const r=this._evaluateNode(this.parseTree,e,t,null);return r instanceof o0?r.valueInMilliseconds()/864e5:r}calculateValueCompiled(e,t=gU){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):yi("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}testFeature(e,t=gU){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=gU){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):yi("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,e=>{e.type==="current-time"?this._hasDateFunctions=!0:e.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||M6r.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,t=>{t.type==="function"&&e.add(t.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,t=>{if(t.type==="function"){const r=t.name.toLowerCase(),n=t.args.value[0];if(n.type==="column-reference"){const s=n.column,o=`${r}-${s}`;e.has(o)||e.set(o,{aggregateType:r,field:s})}}}),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,t=>{t.type==="parameter"&&e.add(t.value.toLowerCase())}),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",e).bind(O6r)}_extractExpressionInfo(e){const t=[],r=new Set;let n=!0,s=!1;return this._visitAll(this.parseTree,o=>{switch(o.type){case"column-reference":{const a=e?.get(o.column);let l,u;a?l=u=a.name??"":(u=o.column,l=u.toLowerCase()),r.has(l)||(r.add(l),t.push(u)),o.column=u;break}case"function":{const{name:a,args:l}=o,u=l.value.length;n&&(n=M$r(a,u)),s===!1&&(s=ydt(a,u));break}}}),{referencedFieldNames:Array.from(t),isStandardized:n,isAggregate:s}}_visitAll(e,t){if(e!=null)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const r of e.clauses)this._visitAll(r,t);e.format==="simple"&&this._visitAll(e.operand,t),e.else!==null&&this._visitAll(e.else,t);break;case"expression-list":for(const r of e.value)this._visitAll(r,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if(e.format==="simple"){const r=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let n=0;n=",this.timeZone)&&iS(o,a[1],"<=",this.timeZone)}case"NOTBETWEEN":{const o=this._evaluateNode(e.left,t,r,n),a=this._evaluateNode(e.right,t,r,n);return o==null||a[0]==null||a[1]==null?null:iS(o,a[0],"<",this.timeZone)||iS(o,a[1],">",this.timeZone)}case"LIKE":return a6e(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.escape);case"NOT LIKE":return Nge(a6e(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return iS(this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),e.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return k8t(e.operator,this._evaluateNode(e.left,t,r,n),this._evaluateNode(e.right,t,r,n),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=R8t(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=MTe(e.value,"unknown"),e.parsedValue;case"time":return zYe(e.value);case"current-time":return e.mode==="date"?Lu.fromNow(this.timeZone):ATe(new Date,this.timeZone);case"column-reference":return G8t(t,e.column,this.fieldsIndex,r);case"data-type":return e.value;case"function":{if(this.isAggregate&&ydt(e.name,e.args.value.length)){const a=[];for(const l of e.args?.value||[]){const u=[];for(const c of n||[])u.push(this._evaluateNode(l,c,r,null));a.push(u)}return o$r(e.name,a)}const o=this._evaluateNode(e.args,t,r,n);return VYe(e.name,o,this.timeZone)}}throw new pr(tr.UnsupportedSyntax,{node:e.type})}};function $8t(i){return i===!0}function s6e(i){return Array.isArray(i)?i:[i]}function Nge(i){return i!==null?i!==!0:null}function B8t(i,e){return i!=null&&e!=null?i===!0&&e===!0:i!==!1&&e!==!1&&null}function j8t(i,e){return i!=null&&e!=null?i===!0||e===!0:i===!0||e===!0||null}function o6e(i,e){if(i==null)return null;let t=!1;for(const r of e)if(r==null)t=null;else if(i===r){t=!0;break}return t}const xdt="-[]/{}()*+?.\\^$|";var B6;function P6r(i,e){const t=e;let r="",n=B6.Normal;for(let s=0;s(R6r(i)?i.attributes:i)[e]},D6r=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:ta,defaultAttributeAdapter:gU},Symbol.toStringTag,{value:"Module"}));let QY=class{constructor(e){this.source=e}},eX=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e.toLowerCase()];return t?{syntax:t.script,uri:t.uri}:null}};var wt;(function(i){i.AsyncNotEnabled="AsyncNotEnabled",i.ModulesNotSupported="ModulesNotSupported",i.CircularModules="CircularModules",i.CannotCompareDateAndTime="CannotCompareDateAndTime",i.NeverReach="NeverReach",i.UnsupportedHashType="UnsupportedHashType",i.InvalidParameter="InvalidParameter",i.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",i.UnexpectedToken="UnexpectedToken",i.Unrecognized="Unrecognized",i.UnrecognizedType="UnrecognizedType",i.MaximumCallDepth="MaximumCallDepth",i.BooleanConditionRequired="BooleanConditionRequired",i.TypeNotAllowedInFeature="TypeNotAllowedInFeature",i.KeyMustBeString="KeyMustBeString",i.WrongNumberOfParameters="WrongNumberOfParameters",i.CallNonFunction="CallNonFunction",i.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",i.NoFunctionInDictionary="NoFunctionInDictionary",i.NoFunctionInArray="NoFunctionInArray",i.AssignModuleFunction="AssignModuleFunction",i.LogicExpressionOrAnd="LogicExpressionOrAnd",i.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",i.FunctionNotFound="FunctionNotFound",i.InvalidMemberAccessKey="InvalidMemberAccessKey",i.UnsupportedUnaryOperator="UnsupportUnaryOperator",i.InvalidIdentifier="InvalidIdentifier",i.MemberOfNull="MemberOfNull",i.UnsupportedOperator="UnsupportedOperator",i.Cancelled="Cancelled",i.ModuleAccessorMustBeString="ModuleAccessorMustBeString",i.ModuleExportNotFound="ModuleExportNotFound",i.Immutable="Immutable",i.OutOfBounds="OutOfBounds",i.IllegalResult="IllegalResult",i.FieldNotFound="FieldNotFound",i.PortalRequired="PortalRequired",i.LogicError="LogicError",i.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",i.KeyAccessorMustBeString="KeyAccessorMustBeString",i.WrongSpatialReference="WrongSpatialReference",i.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",i.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(wt||(wt={}));const U8t={[wt.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[wt.LogicError]:"Logic error - {reason}",[wt.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[wt.NeverReach]:"Encountered unreachable logic",[wt.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[wt.ModuleAccessorMustBeString]:"Module accessor must be a string",[wt.ModuleExportNotFound]:"Module has no export with provided identifier",[wt.ModulesNotSupported]:"Current profile does not support modules",[wt.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[wt.FunctionNotFound]:"Function not found",[wt.FieldNotFound]:"Key not found - {key}",[wt.CircularModules]:"Circular module dependencies are not allowed",[wt.Cancelled]:"Execution cancelled",[wt.UnsupportedHashType]:"Type not supported in hash function",[wt.IllegalResult]:"Value is not a supported return type",[wt.PortalRequired]:"Portal is required",[wt.InvalidParameter]:"Invalid parameter",[wt.WrongNumberOfParameters]:"Call with wrong number of parameters",[wt.Unrecognized]:"Unrecognized code structure",[wt.UnrecognizedType]:"Unrecognized type",[wt.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[wt.BooleanConditionRequired]:"Conditions must use booleans",[wt.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[wt.NoFunctionInArray]:"Arrays cannot contain functions.",[wt.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[wt.KeyAccessorMustBeString]:"Accessor must be a string",[wt.KeyMustBeString]:"Object keys must be a string",[wt.Immutable]:"Object is immutable",[wt.UnexpectedToken]:"Unexpected token",[wt.MemberOfNull]:"Cannot access property of null object",[wt.MaximumCallDepth]:"Exceeded maximum function depth",[wt.OutOfBounds]:"Out of bounds",[wt.InvalidIdentifier]:"Identifier not recognized",[wt.CallNonFunction]:"Expression is not a function",[wt.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[wt.AssignModuleFunction]:"Cannot assign function to module variable",[wt.UnsupportedUnaryOperator]:"Unsupported unary operator",[wt.UnsupportedOperator]:"Unsupported operator",[wt.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[wt.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[wt.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[wt.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[wt.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let F6r=class extends Error{constructor(...e){super(...e)}},Sdt=class z8t extends F6r{constructor(e,t){super(WYe(t)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,z8t),t?.loc&&(this.loc=t.loc)}},Mt=class V8t extends Error{constructor(e,t,r,n){super("Execution error - "+WYe(r)+m0(U8t[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,V8t),r?.loc&&(this.loc=r.loc)}};function WYe(i){return i&&i.loc?`Line : ${i.loc.start?.line}, ${i.loc.start?.column}: `:""}let f0=class H8t extends Error{constructor(e,t,r,n){super("Compilation error - "+WYe(r)+m0(U8t[t],n)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,H8t),r?.loc&&(this.loc=r.loc)}},hde=class W8t extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,W8t)}};function q8t(i,e,t){return t.declaredRootClass==="esri.arcade.arcadeexecutionerror"||t.declaredRootClass==="esri.arcade.arcadecompilationerror"?t.loc===null&&e?.loc?new Sdt(t,{cause:t}):t:(t.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||t.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||t.declaredRootClass,e?.loc?new Sdt(t,{cause:t}):t)}var p9;(function(i){i.UnrecognizedUri="UnrecognizedUri",i.UnsupportedUriProtocol="UnsupportedUriProtocol"})(p9||(p9={}));const k6r={[p9.UnrecognizedUri]:"Unrecognized uri - {uri}",[p9.UnsupportedUriProtocol]:"Unrecognized uri protocol"};let _Oe=class Y8t extends Error{constructor(e,t){super(m0(k6r[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,Y8t)}},bk=class{constructor(){}};function wk(i,e,t){if(i instanceof bk&&!(i instanceof US)){const r=new US;return r.fn=i,r.parameterEvaluator=t,r.context=e,r}return i}let T3=class extends bk{constructor(e){super(),this.fn=e}createFunction(e){return(...t)=>this.fn(e,{preparsed:!0,arguments:t})}call(e,t){return this.fn(e,t)}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{a=a.map(u=>u instanceof bk&&!(u instanceof US)?wk(u,e,n):u);const l=this.call(r,{args:a});return qp(l)?l.then(u=>wk(u,r,n)):l})}},US=class extends bk{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,t){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}marshalledCall(e,t,r){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}},ug=class{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){const e=[];for(let t=0;t1&&s[0]in bOe&&(i=s[0],e=!0),e||(i="en")}const[t,r,n="#,##0.###"]=bOe[i];return{decimal:t,group:r,pattern:n}}function U6r(i,e){const t=K8t((e={...e}).locale);e.customs=t;const r=e.pattern||t.pattern;return isNaN(i)||Math.abs(i)===1/0?null:z6r(i,r,e)}const Z8t=/[#0,]*[#0](?:\.0*#*)?/;function z6r(i,e,t){const r=(t=t||{}).customs.group,n=t.customs.decimal,s=e.split(";"),o=s[0];if((e=s[i<0?1:0]||"-"+o).includes("%"))i*=100;else if(e.includes("‰"))i*=1e3;else{if(e.includes("¤"))throw new Error("currency notation not supported");if(e.includes("E"))throw new Error("exponential notation not supported")}const a=Z8t,l=o.match(a);if(!l)throw new Error("unable to find a number expression in pattern: "+e);return t.fractional===!1&&(t.places=0),e.replace(a,V6r(i,l[0],{decimal:n,group:r,places:t.places,round:t.round}))}function V6r(i,e,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=e.split("."),n=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;n?s=t.places.substring(n+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(i=Number(i.toFixed(Number(s))));const o=String(Math.abs(i)).split("."),a=o[1]||"";if(r[1]||t.places){n&&(t.places=t.places.substring(0,n));const v=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+v>a.length&&(o[1]=a.padEnd(Number(v),"0")),+so[0].length&&(o[0]=o[0].padStart(u,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-u)));let c,h,p=r[0].lastIndexOf(",");if(p!==-1){c=r[0].length-p-1;const v=r[0].substr(0,p);p=v.lastIndexOf(","),p!==-1&&(h=v.length-p-1)}const m=[];for(let v=o[0];v;){const w=v.length-c;m.push(w>0?v.substr(w):v),v=w>0?v.slice(0,w):"",h&&(c=h,h=void 0)}return o[0]=m.reverse().join(t.group||","),o.join(t.decimal||".")}function Q8t(i){const e=K8t((i=i||{}).locale),t=i.pattern||e.pattern,r=e.group,n=e.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const o=t.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:Lse(o,l=>(l="(?:"+UUe(l,".")+")").replace(Z8t,u=>{const c={signed:!1,separator:i.strict?r:[r,""],fractional:i.fractional,decimal:n,exponent:!1},h=u.split(".");let p=i.places;h.length===1&&s!==1&&(h[1]="###"),h.length===1||p===0?c.fractional=!1:(p===void 0&&(p=i.pattern?h[1].lastIndexOf("0")+1:1/0),p&&i.fractional==null&&(c.fractional=!0),!i.places&&+p1&&(c.groupSize=m.pop().length,m.length>1&&(c.groupSize2=m.pop().length)),"("+H6r(c)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:n,factor:s}}function e9t(i,e){const t=Q8t(e),r=new RegExp("^"+t.regexp+"$").exec(i);if(!r)return NaN;let n=r[1];if(!r[1]){if(!r[2])return NaN;n=r[2],t.factor*=-1}return n=n.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(n)*t.factor}function H6r(i){"places"in(i=i||{})||(i.places=1/0),typeof i.decimal!="string"&&(i.decimal="."),"fractional"in i&&!String(i.places).startsWith("0")||(i.fractional=[!0,!1]),"exponent"in i||(i.exponent=[!0,!1]),"eSigned"in i||(i.eSigned=[!0,!1]);const e=Cdt(i),t=Lse(i.fractional,n=>{let s="";return n&&i.places!==0&&(s="\\"+i.decimal,i.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+i.places+"}"),s},!0);let r=e+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+Lse(i.exponent,n=>n?"([eE]"+Cdt({signed:i.eSigned})+")":"")}function Cdt(i){return"signed"in(i=i||{})||(i.signed=[!0,!1]),"separator"in i?"groupSize"in i||(i.groupSize=3):i.separator="",Lse(i.signed,e=>e?"[-+]":"",!0)+Lse(i.separator,e=>{if(!e)return"(?:\\d+)";(e=UUe(e))===" "?e="\\s":e===" "&&(e="\\s\\xa0");const t=i.groupSize,r=i.groupSize2;if(r){const n="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+e+"]\\d{"+r+"})*["+e+"]\\d{"+t+"})";return t-r>0?"(?:"+n+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":n}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+e+"]\\d{"+t+"})*)"},!0)}const Lse=(i,e,t)=>{if(!(i instanceof Array))return e(i);const r=[];for(let n=0;n"("+(e?"?:":"")+i+")";let t9t=class{constructor(e){this.value=e}},i9t=class{constructor(e){this.value=e}};const C3=i9t,id=t9t,nn={type:"VOID"},Mm={type:"BREAK"},J3={type:"CONTINUE"};function gS(i,e,t){return e===""||e==null||e===t||e===t?i:i=i.split(e).join(t)}function mu(i){return i instanceof bk}function YYe(i){return i instanceof QY}function CR(i){return!!Jr(i)||!!uo(i)||!!qa(i)||!!Jo(i)||!!Pa(i)||!!ha(i)||i===null||i===nn||typeof i=="number"}function gn(i,e){return i===void 0?e:i}function XYe(i){return i==null?"":cn(i)||Jn(i)?"Array":qa(i)?"Date":Pa(i)?"Time":Jo(i)?"DateOnly":Jr(i)?"String":ha(i)?"Boolean":uo(i)?"Number":i?.declaredClass==="esri.arcade.Attachment"?"Attachment":i?.declaredClass==="esri.arcade.Portal"?"Portal":i?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":DTe(i)?"KnowledgeGraph":i instanceof QY?"Module":Sl(i)?"Feature":i instanceof $i?"Point":i instanceof $s?"Polygon":i instanceof lo?"Polyline":i instanceof Oh?"Multipoint":i instanceof hr?"Extent":mu(i)?"Function":wl(i)?"FeatureSet":cle(i)?"FeatureSetCollection":i===nn?"":typeof i=="number"&&isNaN(i)?"Number":"Unrecognized Type"}function Jr(i){return typeof i=="string"||i instanceof String}function ha(i){return typeof i=="boolean"}function uo(i){return typeof i=="number"}function YI(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i}function tX(i){return i instanceof Nr}function cn(i){return i instanceof Array}function Sl(i){return i?.arcadeDeclaredClass==="esri.arcade.Feature"}function wl(i){return i?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function RTe(i){return i?.declaredClass==="esri.arcade.Dictionary"}function cle(i){return i?.declaredRootClass==="esri.arcade.featureSetCollection"}function DTe(i){return i?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Jn(i){return i instanceof ug}function qa(i){return i instanceof ao}function Jo(i){return i instanceof Lu}function Pa(i){return i instanceof Nu}function h6e(i){return i!=null&&typeof i=="object"}function Nse(i){return i instanceof Date}function Vi(i,e,t,r,n){if(i.lengtht)throw new Mt(r,wt.WrongNumberOfParameters,n)}function d6e(i){return i<0?-Math.round(-i):Math.round(i)}function yU(){let i=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,e=>{const t=(i+16*Math.random())%16|0;return i=Math.floor(i/16),(e==="x"?t:3&t|8).toString(16)})}function JYe(i,e){return isNaN(i)||e==null||e===""?i.toString():(e=gS(e,"‰",""),e=gS(e,"¤",""),U6r(i,{pattern:e}))}function FTe(i,e){return e==null||e===""?i.toISOString(!0):i.toFormat(KYe(e),{locale:Am(),numberingSystem:"latn"})}function KYe(i,e=!1){i=i.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let t="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const n of i.match(r)||[])switch(n){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"Z":t+="Z";break;case"ZZ":t+="ZZ";break;case"ZZZ":t+="ZZZ";break;case"ZZZZ":t+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":t+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":t+="'S'";break;case"SS":t+="'SS'";break;case"SSS":t+="u";break;case"A":case"a":t+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":t+=n;break;default:n.length>=2&&n.slice(0,1)==="["&&n.slice(-1)==="]"?t+=`'${n.slice(1,-1)}'`:t+=`'${n}'`}return t}function Qo(i,e,t){switch(t){case">":return i>e;case"<":return i=":return i>=e;case"<=":return i<=e}return!1}function kTe(i,e,t){if(i===null){if(e===null||e===nn)return Qo(null,null,t);if(uo(e))return Qo(0,e,t);if(Jr(e)||ha(e))return Qo(0,Ai(e),t);if(qa(e))return Qo(0,e.toNumber(),t);if(Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}if(i===nn){if(e===null||e===nn)return Qo(null,null,t);if(uo(e))return Qo(0,e,t);if(Jr(e)||ha(e))return Qo(0,Ai(e),t);if(qa(e))return Qo(0,e.toNumber(),t);if(Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}else if(uo(i)){if(uo(e))return Qo(i,e,t);if(ha(e))return Qo(i,Ai(e),t);if(e===null||e===nn)return Qo(i,0,t);if(Jr(e))return Qo(i,Ai(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(i,e.toNumber(),t)}else if(Jr(i)){if(Jr(e))return Qo(en(i),en(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(Ai(i),e.toNumber(),t);if(uo(e))return Qo(Ai(i),e,t);if(e===null||e===nn)return Qo(Ai(i),0,t);if(ha(e))return Qo(Ai(i),Ai(e),t)}else if(qa(i)){if(qa(e))return i.timeZone!==e.timeZone&&(i.isUnknownTimeZone?i=ao.arcadeDateAndZoneToArcadeDate(i,e.timeZone):e.isUnknownTimeZone&&(e=ao.arcadeDateAndZoneToArcadeDate(e,i.timeZone))),Qo(i.toNumber(),e.toNumber(),t);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(Jo(e))return Qo(i.toNumber(),e.toNumber(),t)}else if(ha(i)){if(ha(e))return Qo(i,e,t);if(uo(e))return Qo(Ai(i),Ai(e),t);if(qa(e)||Pa(e)||Jo(e))return Qo(Ai(i),e.toNumber(),t);if(e===null||e===nn)return Qo(Ai(i),0,t);if(Jr(e))return Qo(Ai(i),Ai(e),t)}else if(Jo(i)){if(qa(e))return Qo(i.toNumber(),e.toNumber(),t);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(Jo(e))return Qo(i.toNumber(),e.toNumber(),t)}else if(Pa(i)){if(qa(e))throw new Mt(null,wt.CannotCompareDateAndTime,null);if(e===null||e===nn)return Qo(i.toNumber(),0,t);if(uo(e))return Qo(i.toNumber(),e,t);if(ha(e)||Jr(e))return Qo(i.toNumber(),Ai(e),t);if(Pa(e))return Qo(i.toNumber(),e.toNumber(),t);if(Jo(e))throw new Mt(null,wt.CannotCompareDateAndTime,null)}return!!a_(i,e)&&(t==="<="||t===">=")}function a_(i,e){if(i===e||i===null&&e===nn||e===null&&i===nn)return!0;if(qa(i)&&qa(e)||Pa(i)&&Pa(e)||Jo(i)&&Jo(e))return i.equals(e);if(i instanceof l6e||i instanceof a7)return i.equalityTest(e);if(i instanceof $i&&e instanceof $i){const t=i.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(t!=null)return t===r}return!!(h6e(i)&&h6e(e)&&(i._arcadeCacheId===e._arcadeCacheId&&i._arcadeCacheId!==void 0&&i._arcadeCacheId!==null||i._underlyingGraphic===e._underlyingGraphic&&i._underlyingGraphic!==void 0&&i._underlyingGraphic!==null))}function en(i,e){if(Jr(i))return i;if(i===null)return"";if(uo(i))return JYe(i,e);if(ha(i))return i.toString();if(qa(i))return FTe(i,e);if(Pa(i)||Jo(i))return i.toFormat(e);if(i instanceof Nr)return JSON.stringify(i.toJSON());if(cn(i)){const t=[];for(let r=0;rr.key===n.key?0:r.key==="spatialReference"?1:n.key==="spatialReference"||r.keyn.key?1:0);if(cn(i)){const r=[];for(let n=0;n0)return i;return null}if(i instanceof lo){if(i.paths.length===0)return null;for(const e of i.paths)if(e.length>0)return i;return null}return i instanceof Oh?i.points.length===0?null:i:i instanceof hr?i.xmin==="NaN"||i.xmin===null||isNaN(i.xmin)?null:i:null}function ZYe(i,e){if(!i||!i.domain)return e;let t=null,r=null;if(qa(e))t=e.toNumber();else if(Jo(e))t=e.toString();else if(Pa(e))t=e.toStorageString();else if(i.field.type==="string"||i.field.type==="esriFieldTypeString")t=en(e);else{if(e==null)return null;if(e==="")return e;t=Ai(e)}for(let n=0;nc[l]===r&&(n=c.domains?.[o.name],n&&n.type==="inherited"&&(n=Edt(o.name,e),s=!0),!0)),s||n||(n=Edt(i,e)),{field:o,domain:n}}function Edt(i,e){let t;return e.fields.some(r=>(r.name.toLowerCase()===i.toLowerCase()&&(t=r.domain),!!t)),t}function p6e(i,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const t=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(n=e.cmp,function(o){return function(a,l){const u={key:a,value:o[a]},c={key:l,value:o[l]};return n(u,c)}});var n;const s=[];return function o(a){if(a?.toJSON&&typeof a.toJSON=="function"&&(a=a.toJSON()),a===void 0)return;if(typeof a=="number")return isFinite(a)?""+a:"null";if(typeof a!="object")return JSON.stringify(a);let l,u;if(Array.isArray(a)){for(u="[",l=0;l0&&(s=i[0].spatialReference,t=i[0].hasZ,r=i[0].hasM)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else{if(!Jn(i))throw new Mt(null,wt.InvalidParameter,null);for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:(q8(n)||(n=n.slice(0).reverse()),new $s({rings:[n],spatialReference:s,hasZ:t,hasM:r}))}return i}function db(i,e){if(cn(i)||Jn(i)){let t=!1,r=!1,n=[],s=e;if(cn(i)){for(const o of i)mq(n,o);n.length>0&&(s=i[0].spatialReference,t=i[0].hasZ===!0,r=i[0].hasM===!0)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else if(Jn(i)){for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:new lo({paths:[n],spatialReference:s,hasZ:t,hasM:r})}return i}function m9(i,e){if(cn(i)||Jn(i)){let t=!1,r=!1,n=[],s=e;if(cn(i)){for(const o of i)mq(n,o);n.length>0&&(s=i[0].spatialReference,t=i[0].hasZ===!0,r=i[0].hasM===!0)}else if(i instanceof a7)n=i._elements,n.length>0&&(t=i._hasZ,r=i._hasM,s=i.get(0).spatialReference);else if(Jn(i)){for(const o of i.toArray())mq(n,o);n.length>0&&(s=i.get(0).spatialReference,t=i.get(0).hasZ===!0,r=i.get(0).hasM===!0)}return n.length===0?null:new Oh({points:n,spatialReference:s,hasZ:t,hasM:r})}return i}function r9t(i,e=!1){const t=[];if(i===null)return t;if(cn(i)===!0){for(let r=0;r{setTimeout(()=>{e(i)},0)})):i}function LTe(i,e,t){switch(t){case"&":return i&e;case"|":return i|e;case"^":return i^e;case"<<":return i<>":return i>>e;case">>>":return i>>>e}}function xk(i,e=null){return i==null?null:ha(i)||uo(i)||Jr(i)?i:i instanceof Nr?e?.keepGeometryType===!0?i:i.toJSON():i instanceof ug?i.toArray().map(t=>xk(t,e)):i instanceof Array?i.map(t=>xk(t,e)):Nse(i)?i:qa(i)?i.toJSDate():Pa(i)?i.toString():Jo(i)?i.toJSDate():i!==null&&typeof i=="object"&&i.castAsJson!==void 0?i.castAsJson(e):null}async function X6r(i,e,t,r,n){const s=await eXe(i,e,t);n[r]=s}async function eXe(i,e=null,t=null){if(i instanceof ug&&(i=i.toArray()),i==null)return null;if(CR(i)||i instanceof Nr||Nse(i)||qa(i))return xk(i,t);if(i instanceof Array){const r=[],n=[];for(const s of i)s===null||CR(s)||s instanceof Nr||Nse(s)||qa(s)?n.push(xk(s,t)):(n.push(null),r.push(X6r(s,e,t,n.length-1,n)));return r.length>0&&await Promise.all(r),n}return i!==null&&typeof i=="object"&&i.castAsJsonAsync!==void 0?i.castAsJsonAsync(e,t):null}function hle(i){return tXe(i)?i.parent:i}function tXe(i){return i&&"declaredClass"in i&&i.declaredClass==="esri.layers.support.SubtypeSublayer"}function Bse(i){return i&&"declaredClass"in i&&i.declaredClass==="esri.layers.SubtypeGroupLayer"}function iXe(i,e,t){const r=hle(i.fullSchema());return r===null||!r.fields?null:f9(e,r,i,t)}function dre(i){const e=hle(i.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(t=>({name:t.name,code:t.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(t=>({name:t.name,code:t.id})):[]}:null:null}function rXe(i,e,t,r){const n=hle(i.fullSchema());if(n===null||!n.fields)return null;const s=f9(e,n,i,r);if(t===void 0)try{t=i.field(e)}catch{return null}return ZYe(s,t)}function nXe(i,e,t,r){const n=hle(i.fullSchema());if(n===null||!n.fields)return null;if(t===void 0){try{t=i.field(e)}catch{return null}return t}return QYe(f9(e,n,i,r),t)}function Es(i){return i?.timeZone??"system"}function sXe(i){const e=hle(i.fullSchema());if(e===null||!e.fields)return null;const t=[];for(const r of e.fields)t.push(u6e(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:q_e[e.geometryType]===void 0?"":q_e[e.geometryType],fields:t}}function n9t(i,e){return i==="system"&&(i=ao.systemTimeZoneCanonicalName),{version:s9t,engineVersion:tae,timeZone:i,spatialReference:e instanceof Xi?e.toJSON():e,application:Ho.applicationName??"",engine:"web",locale:Am()}}const s9t="1.24",o9t=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:i9t,ReturnResultE:t9t,absRound:d6e,arcadeVersion:s9t,autoCastArrayOfPointsToMultiPoint:m9,autoCastArrayOfPointsToPolygon:$se,autoCastArrayOfPointsToPolyline:db,autoCastFeatureToGeometry:Bn,binaryOperator:LTe,breakResult:Mm,castAsJson:xk,castAsJsonAsync:eXe,continueResult:J3,defaultExecutingContext:n9t,defaultTimeZone:Es,defaultUndefined:gn,equalityTest:a_,featureDomainCodeLookup:nXe,featureDomainValueLookup:rXe,featureFullDomain:iXe,featureSchema:sXe,featureSubtypes:dre,fixNullGeometry:m$,fixSpatialReference:zh,formatDate:FTe,formatNumber:JYe,generateUUID:yU,getDomain:f9,getDomainCode:QYe,getDomainValue:ZYe,getType:XYe,greaterThanLessThan:kTe,implicitResult:C3,isArray:cn,isBoolean:ha,isDate:qa,isDateOnly:Jo,isDictionary:RTe,isFeature:Sl,isFeatureSet:wl,isFeatureSetCollection:cle,isFunctionParameter:mu,isGeometry:tX,isImmutableArray:Jn,isInteger:YI,isJsDate:Nse,isKnowledgeGraph:DTe,isModule:YYe,isNumber:uo,isObject:h6e,isSimpleType:CR,isString:Jr,isSubtypeGrouplayer:Bse,isSubtypeSublayer:tXe,isTime:Pa,multiReplace:gS,parseGeometryFromJson:Y6r,pcCheck:Vi,returnResult:id,stableStringify:p6e,standardiseDateFormat:KYe,tick:hre,toBoolean:nx,toDate:eg,toNumber:Ai,toNumberArray:f$,toString:en,toStringArray:r9t,toStringExplicit:Sb,voidOperation:nn},Symbol.toStringTag,{value:"Module"}));function J6r(i){a9t=i}let a9t;function jse(i){return i===null?null:qa(i)?i.clone():CR(i)?i:tX(i)?i.clone():Jn(i)?i.toArray().map(e=>jse(e)):cn(i)?i.map(e=>jse(e)):Sl(i)?a9t.createFromArcadeFeature(i):cle(i)||wl(i)?i:RTe(i)||i?.declaredClass==="esri.arcade.Attachment"?i.deepClone():(i?.declaredClass==="esri.arcade.Portal"||DTe(i)||i instanceof QY||mu(i),i)}function J_e(i,e,t=!1,r=!1){if(i==null)return null;if(uo(i))return Ai(i);if(ha(i))return nx(i);if(Jr(i))return en(i);if(qa(i))return eg(i,e);if(Jo(i)||Pa(i))return i;if(cn(i)){const s=[];for(const o of i)s.push(J_e(o,e,t,r));return s}if(r&&tX(i))return i;const n=new vn;n.immutable=!1;for(const s of Object.keys(i)){const o=i[s];o!==void 0&&n.setField(s,J_e(o,e,t,r))}return n.immutable=t,n}let vn=class Bge{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof Bge?e.attributes:e??{}}field(e){const t=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const n in this.attributes)if(n.toLowerCase()===t)return this.attributes[n];throw new Mt(null,wt.FieldNotFound,null,{key:e})}setField(e,t){if(this.immutable)throw new Mt(null,wt.Immutable,null);if(mu(t))throw new Mt(null,wt.NoFunctionInDictionary,null);const r=e.toLowerCase();if(t instanceof Date&&(t=ao.dateJSToArcadeDate(t)),this.attributes[e]===void 0){for(const n in this.attributes)if(n.toLowerCase()===r)return void(this.attributes[n]=t);this.attributes[e]=t}else this.attributes[e]=t}hasField(e){const t=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===t)return!0;return!1}keys(){let e=[];for(const t in this.attributes)e.push(t);return e=e.sort(),e}castToText(e=!1){let t="";for(const r in this.attributes){t!==""&&(t+=",");const n=this.attributes[r];n==null?t+=JSON.stringify(r)+":null":ha(n)||uo(n)||Jr(n)?t+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Nr?t+=JSON.stringify(r)+":"+Sb(n):n instanceof ug||n instanceof Array?t+=JSON.stringify(r)+":"+Sb(n,null,e):n instanceof ao?t+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(t+=JSON.stringify(r)+":"+n.castToText(e))}return"{"+t+"}"}static convertObjectToArcadeDictionary(e,t,r=!0,n=!1){const s=new Bge;s.immutable=!1;for(const o in e){const a=e[o];a!==void 0&&s.setField(o.toString(),J_e(a,t,r,n))}return s.immutable=r,s}static convertJsonToArcade(e,t,r=!1,n=!1){return J_e(e,t,r,n)}castAsJson(e=null){const t={};for(let r in this.attributes){const n=this.attributes[r];n!==void 0&&(e?.keyTranslate&&(r=e.keyTranslate(r)),t[r]=xk(n,e))}return t}async castDictionaryValueAsJsonAsync(e,t,r,n=null,s){const o=await eXe(r,n,s);return e[t]=o,o}async castAsJsonAsync(e=null,t=null){const r={},n=[];for(let s in this.attributes){const o=this.attributes[s];t?.keyTranslate&&(s=t.keyTranslate(s)),o!==void 0&&(CR(o)||o instanceof Nr||o instanceof ao?r[s]=xk(o,t):n.push(this.castDictionaryValueAsJsonAsync(r,s,o,e,t)))}return n.length>0&&await Promise.all(n),r}deepClone(){const e=new Bge;e.immutable=!1;for(const t of this.keys())e.setField(t,jse(this.field(t)));return e}},Lc=class O2{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(e,t){const r=new O2;return r.contextTimeZone=t??null,r._geometry=e.geometry!=null?e.geometry:null,e.attributes===void 0||e.attributes===null?r.attributes={}:r.attributes=e.attributes,e._sourceLayer?(r._layer=e._sourceLayer,r._fieldTypesFixed=!1):e._layer?(r._layer=e._layer,r._fieldTypesFixed=!1):e.layer&&"fields"in e.layer?(r._layer=e.layer,r._fieldTypesFixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(r._layer=e.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(e){if(e instanceof O2){const r=new O2;return r._fieldTypesFixed=e._fieldTypesFixed,r.attributes=e.attributes,r._geometry=e._geometry,r._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(r._layer=e._layer),r.fieldsIndex=e.fieldsIndex,r.contextTimeZone=e.contextTimeZone,r}const t={};for(const r of e.keys())t[r]=e.field(r);return O2.createFromGraphicLikeObject(e.geometry(),t,e.fullSchema(),e.contextTimeZone)}static createFromOptimisedFeature(e,t,r){const n=new O2;return n._geometry=e.geometry?{geometry:e.geometry}:null,n._optimizedGeomDefinition=r,n.attributes=e.attributes||{},n._layer=t,n._fieldTypesFixed=!1,n}static createFromArcadeDictionary(e,t){const r=new O2;return r.attributes=e.field("attributes"),r.attributes!==null&&r.attributes instanceof vn?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=e.field("geometry"),r._geometry!==null&&(r._geometry instanceof vn?r._geometry=O2.parseGeometryFromDictionary(r._geometry,t):r._geometry instanceof Nr||(r._geometry=null)),r}static createFromGraphicLikeObject(e,t,r=null,n){const s=new O2;return s.contextTimeZone=n??null,t===null&&(t={}),s.attributes=t,s._geometry=e??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(e){return e===null?null:wl(e)?e.getFieldsIndex():e.fieldsIndex?e.fieldsIndex:Cd.fromLayerJSON({datesInUnknownTimezone:e.datesInUnknownTimezone,fields:e.fields,timeInfo:e.timeInfo,editFieldsInfo:e.editFieldsInfo,dateFieldsTimeReference:e.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(e,t,r=null){t===null&&(t={}),this.attributes=t,this._geometry=e??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(e=!1){let t="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){t!==""&&(t+=",");const n=this.attributes[r];n==null?t+=JSON.stringify(r)+":null":ha(n)||uo(n)||Jr(n)?t+=JSON.stringify(r)+":"+JSON.stringify(n):n instanceof Nr?t+=JSON.stringify(r)+":"+Sb(n):n instanceof Nu||n instanceof Lu?t+=`${JSON.stringify(r)}:${JSON.stringify(n.toString())}`:n instanceof ug||n instanceof Array?t+=JSON.stringify(r)+":"+Sb(n,null,e):n instanceof ao?t+=e?JSON.stringify(r)+":"+JSON.stringify(n.getTime()):JSON.stringify(r)+":"+n.stringify():n!==null&&typeof n=="object"&&n.castToText!==void 0&&(t+=JSON.stringify(r)+":"+n.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":Sb(this.geometry()))+',"attributes":{'+t+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const e=[],t=this._layer.fields;for(let r=0;r0&&this._fixAllFields(e),this._fieldTypesFixed=!0}isUnknownDateTimeField(e){return this.fieldsIndex?.getTimeZone(e)==="unknown"}_fixAllFields(e){this.attributes={...this.attributes};const t=this.contextTimeZone??"system";for(let r=0;r!t&&(n.type==="Identifier"&&n.name&&n.name.toLowerCase()===r&&(t=!0),!0)),t}function u9t(i){const e=[];return Hu(i,t=>(t.type==="ImportDeclaration"&&t.source&&t.source.value&&e.push({libname:t.specifiers[0].local.name.toLowerCase(),source:t.source.value}),!0)),e}function Q6r(i,e){let t=!1;const r=e.toLowerCase();return Hu(i,n=>!t&&(n.type!=="CallExpression"||n.callee.type!=="Identifier"||!n.callee.name||n.callee.name.toLowerCase()!==r||(t=!0,!1))),t}function e8r(i){const e=[];return Hu(i,t=>t.type!=="MemberExpression"||t.object.type!=="Identifier"||(t.computed===!1&&t.object&&t.object.name&&t.property&&t.property.type==="Identifier"&&t.property.name?e.push(t.object.name.toLowerCase()+"."+t.property.name.toLowerCase()):t.object&&t.object.name&&t.property&&t.property.type==="Literal"&&typeof t.property.value=="string"&&e.push(t.object.name.toLowerCase()+"."+t.property.value?.toString().toLowerCase()),!1)),e}function t8r(i){const e=[];return Hu(i,t=>{if(t.type==="CallExpression"){if(t.callee.type==="Identifier"&&t.callee.name.toLowerCase()==="expects"){let r="";for(let n=0;n<(t.arguments||[]).length;n++)n===0?t.arguments[n].type==="Identifier"&&(r=t.arguments[n].name.toLowerCase()):r&&t.arguments[n].type==="Literal"&&Adt(t.arguments[n].value)&&e.push(r+"."+t.arguments[n].value.toLowerCase());return!1}if(t.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(t.callee.name.toLowerCase())&&t.arguments.length>=2){let r="";return t.arguments[0].type==="Identifier"&&(r=t.arguments[0].name.toLowerCase()),r&&t.arguments[1].type==="Literal"&&Adt(t.arguments[1].value)&&e.push(r+"."+t.arguments[1].value.toLowerCase()),!1}}return t.type!=="MemberExpression"||t.object.type!=="Identifier"||(t.computed===!1&&t.object&&t.object.name&&t.property&&t.property.type==="Identifier"&&t.property.name?e.push(t.object.name.toLowerCase()+"."+t.property.name.toLowerCase()):t.object&&t.object.name&&t.property&&t.property.type==="Literal"&&typeof t.property.value=="string"&&e.push(t.object.name.toLowerCase()+"."+t.property.value?.toString().toLowerCase()),!1)}),e}function f6e(i){const e=[];return Hu(i,t=>(t.type==="CallExpression"&&t.callee.type==="Identifier"&&e.push(t.callee.name.toLowerCase()),!0)),e}function dle(i,e=[]){let t=null;if(i.usesFeatureSet===void 0){t===null&&(t=f6e(i)),i.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(l9t(i,r)){i.usesFeatureSet=!0,i.isAsync=!0;break}}}if(i.usesModules===void 0&&(i.usesModules=!1,u9t(i).length>0&&(i.usesModules=!0)),i.usesGeometry===void 0){i.usesGeometry=!1,t===null&&(t=f6e(i));for(let r=0;r0||l.length>0;)if(a.length>0&&l.length>0){let h=u(a[0],l[0]);isNaN(h)&&(h=0),h<=0?(c.push(a[0]),a=a.slice(1)):(c.push(l[0]),l=l.slice(1))}else a.length>0?(c.push(a[0]),a=a.slice(1)):l.length>0&&(c.push(l[0]),l=l.slice(1));return c}async function n(a,l){const u=a.length,c=Math.floor(u/2);if(u===0)return[];if(u===1)return[a[0]];const h=[await n(a.slice(0,c),l),await n(a.slice(c,u),l)];return s(h[0],h[1],l,[])}async function s(a,l,u,c){const h=c;if(!(a.length>0||l.length>0))return c;if(a.length>0&&l.length>0){let p=await u(a[0],l[0]);return isNaN(p)&&(p=1),p<=0?(h.push(a[0]),a=a.slice(1)):(h.push(l[0]),l=l.slice(1)),s(a,l,u,c)}return a.length>0?(h.push(a[0]),s(a=a.slice(1),l,u,c)):l.length>0?(h.push(l[0]),s(a,l=l.slice(1),u,c)):void 0}function o(a,l,u,c){Vi(u,1,2,a,l);let h=u[0];if(Jn(h)&&(h=h.toArray()),cn(h)===!1)throw new Mt(a,wt.InvalidParameter,l);if(u.length>1){if(mu(u[1])===!1)throw new Mt(a,wt.InvalidParameter,l);let S=h;const I=u[1].createFunction(a);return c?n(S,I):(S=t(S,(R,L)=>I(R,L)),S)}let p=h;if(p.length===0)return[];const m={};for(let S=0;S1||w==="String"?t(p,(S,I)=>{if(S==null||S===nn)return I==null||I===nn?0:1;if(I==null||I===nn)return-1;const R=en(S),L=en(I);return RS-I):w==="Boolean"?t(p,(S,I)=>S===I?0:I?-1:1):w==="Date"?t(p,(S,I)=>I-S):p.slice(0),p}i.functions.array=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,0,2,a,l),h.length===0)return[];if(h.length===1&&h[0]===null)return[];if(cn(h[0])){if(h.length===2&&ha(h[1])===!1)throw new Mt(a,wt.InvalidParameter,l);return gn(h[1],!1)===!0?jse(h[0]):h[0].slice(0)}if(Jn(h[0])){if(h.length===2&&ha(h[1])===!1)throw new Mt(a,wt.InvalidParameter,l);return gn(h[1],!1)===!0?jse(h[0]):h[0].toArray().slice(0)}const p=Ai(h[0]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=gn(h[1],null),v=new Array(p);return v.fill(m),v})},i.functions.front=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),Jn(h[0])){if(h[0].length()<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0].get(0)}if(cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0][0]}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.back=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),Jn(h[0])){if(h[0].length()<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0].get(h[0].length()-1)}if(cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);return h[0][h[0].length-1]}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.push=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,2,a,l),cn(h[0]))return h[0][h[0].length]=h[1],h[0].length;throw new Mt(a,wt.InvalidParameter,l)})},i.functions.pop=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,1,a,l),cn(h[0])){if(h[0].length<=0)throw new Mt(a,wt.OutOfBounds,l);const p=h[0][h[0].length-1];return h[0].length=h[0].length-1,p}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.erase=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,2,2,a,l),cn(h[0])){let p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=h[0];if(m.length<=0)throw new Mt(a,wt.OutOfBounds,l);if(p<0&&(p=m.length+p),p<0)throw new Mt(a,wt.OutOfBounds,l);if(p>=m.length)throw new Mt(a,wt.OutOfBounds,l);return m.splice(p,1),nn}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.insert=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,3,3,a,l),cn(h[0])){const p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);const m=h[2],v=h[0];if(p>v.length)throw new Mt(a,wt.OutOfBounds,l);if(p<0&&p<-1*v.length)throw new Mt(a,wt.OutOfBounds,l);return p===v.length?(v[p]=m,nn):(v.splice(p,0,m),nn)}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.resize=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,2,3,a,l),cn(h[0])){const p=Ai(h[1]);if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);if(p<0)throw new Mt(a,wt.InvalidParameter,l);const m=gn(h[2],null),v=h[0];if(v.length>=p)return v.length=p,nn;const w=v.length;v.length=p;for(let S=w;S{if(Vi(h,2,2,a,l),cn(h[0])){const p=h[1];return h[0].findIndex(m=>a_(m,p))>-1}if(Jn(h[0])){const p=h[1];return h[0].toArray().findIndex(m=>a_(m,p))>-1}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.slice=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{if(Vi(h,1,3,a,l),cn(h[0])){const p=Ai(gn(h[1],0)),m=Ai(gn(h[2],h[0].length));if(isNaN(p)||YI(p)===!1)throw new Mt(a,wt.InvalidParameter,l);if(isNaN(m)||YI(m)===!1)throw new Mt(a,wt.InvalidParameter,l);return h[0].slice(p,m)}if(Jn(h[0])){const p=h[0],m=Ai(gn(h[1],0)),v=Ai(gn(h[2],p.length()));if(isNaN(m)||YI(m)===!1)throw new Mt(a,wt.InvalidParameter,l);if(isNaN(v)||YI(v)===!1)throw new Mt(a,wt.InvalidParameter,l);return p.toArray().slice(m,v)}throw new Mt(a,wt.InvalidParameter,l)})},i.functions.splice=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{const p=[];for(let m=0;m{if(Vi(h,2,2,a,l),cn(h[0]))return Ai(h[1])>=h[0].length?h[0].slice(0):h[0].slice(0,Ai(h[1]));if(Jn(h[0]))return Ai(h[1])>=h[0].length()?h[0].slice(0):h[0].slice(0,Ai(h[1]));throw new Mt(a,wt.InvalidParameter,l)})},i.functions.first=function(a,l){return i.standardFunction(a,l,(u,c,h)=>(Vi(h,1,1,a,l),cn(h[0])?h[0].length===0?null:h[0][0]:Jn(h[0])?h[0].length()===0?null:h[0].get(0):null))},i.mode==="sync"&&(i.functions.sort=function(a,l){return i.standardFunction(a,l,(u,c,h)=>o(a,l,h,!1))},i.functions.any=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=p(v);if(ha(w)&&w===!0)return!0}return!1})},i.functions.all=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m)if(p(v)!==!0)return!1;return!0})},i.functions.none=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m)if(p(v)===!0)return!1;return!0})},i.functions.reduce=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,3,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);return h.length===2?m.length===0?null:m.reduce((v,w)=>{const S=p(v,w);return v=S!==void 0&&S!==nn?S:null}):m.reduce((v,w)=>{const S=p(v,w);return v=S!==void 0&&S!==nn?S:null},h[2])})},i.functions.map=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=p(w);S!==void 0&&S!==nn?v.push(S):v.push(null)}return v})},i.functions.filter=function(a,l){return i.standardFunction(a,l,(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m)p(w)===!0&&v.push(w);return v})}),i.mode==="async"&&(i.functions.sort=function(a,l){return i.standardFunctionAsync(a,l,(u,c,h)=>o(a,l,h,!0))},i.functions.any=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,ha(S)&&S===!0)return!0}return!1})},i.functions.all=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,S!==!0)return!1}return!0})},i.functions.none=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);for(const v of m){const w=await p(v);let S=null;if(S=qp(S)?await w:w,S===!0)return!1}return!0})},i.functions.filter=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=await p(w);let I=null;I=qp(I)?await S:S,I===!0&&v.push(w)}return v})},i.functions.reduce=function(a,l){return i.standardFunctionAsync(a,l,(u,c,h)=>{Vi(h,2,3,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l);let v=null;if(h.length>2){const w=gn(h[2],null);v=m.reduce(async(S,I)=>{let R=await S;return R!==void 0&&R!==nn||(R=null),p(R,I)},Promise.resolve(w))}else{if(m.length===0)return null;v=m.reduce(async(w,S,I)=>{if(I<=1)return p(w,S);let R=await w;return R!==void 0&&R!==nn||(R=null),p(R,S)})}return v.then(w=>w!==void 0&&w!==nn?w:null)})},i.functions.map=function(a,l){return i.standardFunctionAsync(a,l,async(u,c,h)=>{Vi(h,2,2,a,l);const p=h[1].createFunction(a),m=e(h[0],a,l),v=[];for(const w of m){const S=await p(w);let I=null;I=qp(I)?await S:S,I!==void 0&&I!==nn?v.push(I):v.push(null)}return v})})}const Z_e=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:i8r},Symbol.toStringTag,{value:"Module"}));function r8r(i,e,t){return i+(n8r(t)?o8r:s8r)[e]}function n8r(i){return i%4==0&&(i%100!=0||i%400==0)}const s8r=[0,31,59,90,120,151,181,212,243,273,304,334],o8r=[0,31,60,91,121,152,182,213,244,274,305,335];function zE(i){return i===null?i:i.isValid===!1?null:i}function sK(i,e){return i===""||i.toLowerCase().trim()==="default"?Es(e):i==="z"||i==="Z"?"UTC":i}function EM(i,e){return Jo(i)?i.toArcadeDate():eg(i,Es(e))}function oXe(i,e){i.today=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=new Date;return a.setHours(0,0,0,0),ao.dateJSAndZoneToArcadeDate(a,Es(t))})},i.time=function(t,r){return e(t,r,(n,s,o)=>{switch(Vi(o,0,4,t,r),o.length){case 0:{const a=ao.nowToArcadeDate(Es(t));return new Nu(a.hour,a.minute,a.second,a.millisecond)}case 1:{if(Pa(o[0]))return o[0].clone();if(qa(o[0]))return new Nu(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(Jo(o[0]))return new Nu(0,0,0,0);if(Jr(o[0]))return Nu.fromString(o[0]);const a=Ai(o[0]);return isNaN(a)===!1?Nu.fromMilliseconds(a):null}case 2:return Jr(o[0])&&Jr(o[1])?Nu.fromString(o[0],o[1]):Nu.fromParts(Ai(o[0]),Ai(o[1]),0,0);case 3:return Nu.fromParts(Ai(o[0]),Ai(o[1]),Ai(o[2]),0);case 4:return Nu.fromParts(Ai(o[0]),Ai(o[1]),Ai(o[2]),Ai(o[3]))}throw new Mt(t,wt.InvalidParameter,r)})},i.dateonly=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,3,t,r),o.length===3)return Lu.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]));if(o.length===2){const a=en(o[1]);return a===""?null:a==="X"?Lu.fromSeconds(Ai(o[0])):a==="x"?Lu.fromMilliseconds(Ai(o[0])):Lu.fromString(en(o[0]),a)}if(o.length===1){if(Jr(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return Lu.fromString(o[0]+"-01-01")}if(Jo(o[0]))return o[0].clone();if(qa(o[0]))return Lu.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const a=Ai(o[0]);return isNaN(a)===!1?Lu.fromMilliseconds(a):Jr(o[0])?Lu.fromString(o[0]):null}if(o.length===0){const a=ao.nowToArcadeDate(Es(t));return a.isValid===!1?null:Lu.fromParts(a.year,a.monthJS+1,a.day)}return null})},i.changetimezone=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),o[0]===null)return null;if(Jo(o[0]))throw new Mt(t,wt.CannotChangeTimeZoneDateOnly,r);if(Jo(o[0]))throw new Mt(t,wt.CannotChangeTimeZoneTime,r);const a=eg(o[0],Es(t));if(a===null)throw new Mt(t,wt.InvalidParameter,r);const l=B1(sK(en(o[1]),t),!1);if(l===null)return null;const u=ao.arcadeDateAndZoneToArcadeDate(a,l);return u.isValid===!1?null:u})},i.timezone=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,2,t,r),Pa(o[0])||Jo(o[0]))return"Unknown";const a=eg(o[0],Es(t));if(a===null)return null;const l=a.timeZone;return l==="system"?ao.systemTimeZoneCanonicalName:l.toLowerCase()==="utc"?"UTC":l.toLowerCase()==="unknown"?"Unknown":l})},i.timezoneoffset=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:60*a.timeZoneOffset*1e3})},i.now=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=ao.nowToArcadeDate(Es(t));return a.isValid===!1?null:a})},i.timestamp=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,0,t,r);const a=ao.nowUTCToArcadeDate();return a.isValid===!1?null:a})},i.toutc=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:a.toUTC()})},i.tolocal=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=eg(o[0],Es(t));return a===null?null:a.toLocal()})},i.day=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.day})},i.month=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.monthJS})},i.year=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.year})},i.hour=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].hour;const a=eg(o[0],Es(t));return a===null?NaN:a.hour})},i.second=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].second;const a=eg(o[0],Es(t));return a===null?NaN:a.second})},i.millisecond=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].millisecond;const a=eg(o[0],Es(t));return a===null?NaN:a.millisecond})},i.minute=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Pa(o[0]))return o[0].minute;const a=eg(o[0],Es(t));return a===null?NaN:a.minute})},i.week=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=EM(o[0],Es(t));if(a===null)return NaN;const l=Ai(gn(o[1],0));if(l<0||l>6)throw new Mt(t,wt.InvalidParameter,r);const u=a.day,c=a.monthJS,h=a.year,p=a.dayOfWeekJS,m=r8r(u,c,h)-1,v=Math.floor(m/7);return p-l+(p-l<0?7:0){Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.dayOfWeekJS})},i.isoweekday=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.dayOfWeekISO})},i.isomonth=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.monthISO})},i.isoweek=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.weekISO})},i.isoyear=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=EM(o[0],Es(t));return a===null?NaN:a.yearISO})},i.date=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,8,t,r),o.length===3){if(Jo(o[0])&&Pa(o[1])&&Jr(o[2])){const a=B1(sK(en(o[2])??"unknown",t),!1);return a===null?null:zE(ao.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,a))}return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),0,0,0,0,Es(t)))}if(o.length===4)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),0,0,0,Es(t)));if(o.length===5)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),0,0,Es(t)));if(o.length===6)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),0,Es(t)));if(o.length===7)return zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),Ai(o[6]),Es(t)));if(o.length===8){const a=B1(sK(en(o[7])??"unknown",t),!1);return a===null?null:zE(ao.fromParts(Ai(o[0]),Ai(o[1])+1,Ai(o[2]),Ai(o[3]),Ai(o[4]),Ai(o[5]),Ai(o[6]),a))}if(o.length===2){if(Jo(o[0])&&Jr(o[1])){const u=B1(sK(en(o[1])??"unknown",t),!1);return u===null?null:zE(ao.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,u))}if(Jo(o[0])&&Pa(o[1]))return zE(ao.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let a,l=en(o[1]);return l===""?null:(l=KYe(l,!0),a=l==="X"?Sn.fromSeconds(Ai(o[0])):l==="x"?Sn.fromMillis(Ai(o[0])):Sn.fromFormat(en(o[0]),l,{locale:Am(),numberingSystem:"latn"}),a.isValid?ao.dateTimeToArcadeDate(a):null)}if(o.length===1){if(Jo(o[0]))return zE(ao.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(Jr(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return eg(o[0]+"-01-01",Es(t))}const a=Ai(o[0]);if(isNaN(a)===!1){const l=Sn.fromMillis(a);return l.isValid?ao.dateTimeAndZoneToArcadeDate(l,Es(t)):null}return eg(o[0],Es(t))}return o.length===0?ao.nowToArcadeDate(Es(t)):null})},i.datediff=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Pa(o[0]))return Pa(o[1])?o[0].difference(o[1],en(o[2])):NaN;if(Pa(o[1]))return NaN;if(Jo(o[0]))return Jo(o[1])?o[0].difference(o[1],en(o[2])):NaN;if(Jo(o[1]))return NaN;let a=eg(o[0],Es(t)),l=eg(o[1],Es(t));if(a===null||l===null)return NaN;let u=gn(o[3],"");switch(u!==""&&u!==null?(u=sK(en(u),t),a=ao.arcadeDateAndZoneToArcadeDate(a,u),l=ao.arcadeDateAndZoneToArcadeDate(l,u)):a.timeZone!==l.timeZone&&(a.isUnknownTimeZone?a=ao.arcadeDateAndZoneToArcadeDate(a,l.timeZone):l=(l.isUnknownTimeZone,ao.arcadeDateAndZoneToArcadeDate(l,a.timeZone))),en(o[2]).toLowerCase()){case"days":case"day":case"d":return a.diff(l,"days");case"months":case"month":return a.diff(l,"months");case"minutes":case"minute":case"m":return o[2]==="M"?a.diff(l,"months"):a.diff(l,"minutes");case"seconds":case"second":case"s":return a.diff(l,"seconds");case"milliseconds":case"millisecond":case"ms":default:return a.diff(l);case"hours":case"hour":case"h":return a.diff(l,"hours");case"years":case"year":case"y":return a.diff(l,"years")}})},i.dateadd=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=Ai(o[1]);if(isNaN(a)||a===1/0||a===-1/0)return Pa(o[0])||Jo(o[0])?o[0].clone():eg(o[0],Es(t));let l="milliseconds";switch(en(o[2]).toLowerCase()){case"days":case"day":case"d":l="days",a=Jo(o[0])?a:d6e(a);break;case"months":case"month":l="months",a=Jo(o[0])?a:d6e(a);break;case"minutes":case"minute":case"m":l=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":l="seconds";break;case"milliseconds":case"millisecond":case"ms":l="milliseconds";break;case"hours":case"hour":case"h":l="hours";break;case"years":case"year":case"y":l="years"}if(Pa(o[0])||Jo(o[0]))return o[0].plus(l,a);const u=eg(o[0],Es(t));return u===null?null:u.plus({[l]:a})})}}function og(i,e,t){return Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]!==void 0&&e[2]!==void 0?(i[2]*t-e[2]*t)**2:0))}function c9t(i,e,t){return Math.sqrt((i[0]-e[0])**2+(i[1]-e[1])**2+(i[2]!==void 0&&e[2]!==void 0?(i[2]*t-e[2]*t)**2:0))}const ZQ=[];for(const i of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=i[0];for(let t=1;t0?(r.x/=n,r.y/=n,e&&(r.z/=n),t&&(r.m/=n)):(r.x=i[0][0],r.y=i[0][1],e&&(r.z=i[0][2]),t&&e?r.m=i[0][3]:t&&(r.m=i[0][2])),r}function a8r(i,e,t,r){const n={x:(i[0]+e[0])/2,y:(i[1]+e[1])/2};return t&&(n.z=(i[2]+e[2])/2),t&&r?n.m=(i[3]+e[3])/2:r&&(n.m=(i[2]+e[2])/2),n}function l8r(i,e){if(i.length<=1)return 0;let t=0;for(let r=1;r0?(t.x/=n,t.y/=n,i.hasZ===!0&&(t.z/=n),i.hasM===!0&&(t.m/=n),new $i(t)):r>0?(e.x/=r,e.y/=r,i.hasZ===!0&&(t.z/=r),i.hasM===!0&&(e.m/=r),new $i(e)):null}function p9t(i){if(i.points.length===0)return null;let e=0,t=0,r=0,n=0;for(let o=0;o=r;)i-=e;return i}function f9t(i,e){return Math.atan2(e.y-i.y,e.x-i.x)}function d8r(i,e){return BTe(f9t(i,e),2*Math.PI)*(180/Math.PI)}function p8r(i,e){return BTe(Math.PI/2-f9t(i,e),2*Math.PI)*(180/Math.PI)}function m9t(i,e,t){const r={x:i.x-e.x,y:i.y-e.y},n={x:t.x-e.x,y:t.y-e.y};return Math.atan2(h8r(r,n),c8r(r,n))}function f8r(i,e,t){return yb(BTe(m9t(i,e,t),2*Math.PI))}function m8r(i,e,t){return yb(BTe(-1*m9t(i,e,t),2*Math.PI))}pre[9002]=.3048,pre[9003]=.3048006096012192,pre[9095]=.3048007491;const $g=[0,0];function Odt(i){for(let e=0;e1&&(r=1)),r<=.5?[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]:[t[0]-(t[0]-e[0])*(1-r),t[1]-(t[1]-e[1])*(1-r)]}function dde(i){return i&&i.arcadeDeclaredClass==="esri.arcade.Feature"}function aXe(i,e){i.ringisclockwise=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=[];if(o[0]===null)return!1;if(cn(o[0]))for(const l of o[0]){if(!(l instanceof $i))throw new Mt(t,wt.InvalidParameter,r);a.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}else if(o[0]instanceof a7)a=o[0]._elements;else{if(!Jn(o[0]))throw new Mt(t,wt.InvalidParameter,r);for(const l of o[0].toArray()){if(!(l instanceof $i))throw new Mt(t,wt.InvalidParameter,r);a.push(l.hasZ?l.hasM?[l.x,l.y,l.z,l.m]:[l.x,l.y,l.z]:[l.x,l.y])}}return!(a.length<3)&&q8(a)})},i.polygon=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof $s))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof $s)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new $s(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.polyline=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof lo))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof lo)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new lo(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.point=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof $i))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof $i)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new $i(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.multipoint=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn){if(a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference),!(a instanceof Oh))throw new Mt(t,wt.InvalidParameter,r)}else if(o[0]instanceof Oh)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new Oh(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.extent=function(t,r){return e(t,r,(n,s,o)=>{o=Bn(o),Vi(o,1,1,t,r);let a=null;if(o[0]instanceof vn)a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference);else if(o[0]instanceof $i){const l={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},u=o[0];u.hasZ?(l.zmin=u.z,l.zmax=u.z):u.hasM&&(l.mmin=u.m,l.mmax=u.m),a=Ro(l)}else if(o[0]instanceof $s)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof lo)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof Oh)a=Ro(o[0].extent?.toJSON());else if(o[0]instanceof hr)a=Ro(o[0].toJSON());else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(new hr(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.geometry=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);let a=null;if(o[0]===null)return null;if(dde(o[0]))a=zh(o[0].geometry(),t.spatialReference);else if(o[0]instanceof vn)a=zh(Lc.parseGeometryFromDictionary(o[0],t.spatialReference),t.spatialReference);else{const l=JSON.parse(o[0]);l&&!l.spatialReference&&(l.spatialReference=t.spatialReference),a=zh(Ro(l),t.spatialReference)}if(a!==null&&a.spatialReference.equals(t.spatialReference)===!1)throw new Mt(t,wt.WrongSpatialReference,r);return m$(a)})},i.setgeometry=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),!dde(o[0]))throw new Mt(t,wt.InvalidParameter,r);if(o[0].immutable===!0)throw new Mt(t,wt.Immutable,r);if(!(o[1]instanceof Nr||o[1]===null))throw new Mt(t,wt.InvalidParameter,r);return o[0]._geometry=o[1],nn})},i.feature=function(t,r){return e(t,r,(n,s,o)=>{if(o.length===0)throw new Mt(t,wt.WrongNumberOfParameters,r);let a=null;if(o.length===1)if(Jr(o[0]))a=Lc.fromJson(JSON.parse(o[0]),t.timeZone);else if(dde(o[0]))a=Lc.createFromArcadeFeature(o[0]);else if(o[0]instanceof Nr)a=Lc.createFromGraphicLikeObject(o[0],null,null,t.timeZone);else{if(!(o[0]instanceof vn))throw new Mt(t,wt.InvalidParameter,r);{let l=o[0].hasField("geometry")?o[0].field("geometry"):null,u=o[0].hasField("attributes")?o[0].field("attributes"):null;l!==null&&l instanceof vn&&(l=Lc.parseGeometryFromDictionary(l,t.spatialReference)),u!==null&&(u=Lc.parseAttributesFromDictionary(u)),a=Lc.createFromGraphicLikeObject(l,u,null,t.timeZone)}}else if(o.length===2){let l=null,u=null;if(o[0]!==null)if(o[0]instanceof Nr)l=o[0];else{if(!(l instanceof vn))throw new Mt(t,wt.InvalidParameter,r);l=Lc.parseGeometryFromDictionary(o[0],t.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof vn))throw new Mt(t,wt.InvalidParameter,r);u=Lc.parseAttributesFromDictionary(o[1])}a=Lc.createFromGraphicLikeObject(l,u,null,t.timeZone)}else{let l=null;const u={};if(o[0]!==null)if(o[0]instanceof Nr)l=o[0];else{if(!(l instanceof vn))throw new Mt(t,wt.InvalidParameter,r);l=Lc.parseGeometryFromDictionary(o[0],t.spatialReference)}for(let c=1;c{if(o.length===0||o.length===1&&o[0]===null){const u=new vn;return u.immutable=!1,u}if(o.length===1&&Jr(o[0]))try{const u=JSON.parse(o[0]),c=vn.convertObjectToArcadeDictionary(u,Es(t),!1);return c.immutable=!1,c}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&o[0]instanceof Nr)try{const u=o[0].toJSON();u.hasZ=o[0].hasZ===!0,u.hasM=o[0].hasM===!0;const c=vn.convertObjectToArcadeDictionary(u,Es(t),!1);return c.immutable=!1,c}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&Sl(o[0]))try{const u=new vn;u.immutable=!1,u.setField("geometry",o[0].geometry());const c=new vn;c.immutable=!1,u.setField("attributes",c);for(const h of o[0].keys())c.setField(h,o[0].field(h));return u}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===1&&o[0]instanceof vn)try{const u=new vn;u.immutable=!1;for(const c of o[0].keys())u.setField(c,o[0].field(c));return u}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length===2&&o[0]instanceof vn&&ha(o[1]))try{if(o[1]!==!0){const u=new vn;u.immutable=!1;for(const c of o[0].keys())u.setField(c,o[0].field(c));return u}return o[0].deepClone()}catch{throw new Mt(t,wt.InvalidParameter,r)}if(o.length%2!=0)throw new Mt(t,wt.WrongNumberOfParameters,r);const a={};for(let u=0;u{Vi(o,2,2,t,r);const a=en(o[1]);if(dde(o[0])||o[0]instanceof vn)return o[0].hasField(a);if(o[0]instanceof Nr){const l=tE(o[0],a,null,null,2);return!l||l.keystate!=="notfound"}throw new Mt(t,wt.InvalidParameter,r)})},i.hasvalue=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,2,t,r),cn(o[1])||Jn(o[1])){const l=o[1];let u=[];if(Jn(l))u=l.toArray();else{if(!cn(l))throw new Mt(t,wt.InvalidParameter,r);u=l}let c=o[0];if(c===null)return!1;for(const h of u)if(Sl(c)){if(Jr(h)===!1||!c.hasField(h)||(c=c.field(h),c===null))return!1}else if(c instanceof vn){if(Jr(h)===!1||!c.hasField(h)||(c=c.field(h),c===null))return!1}else if(c instanceof Nr){if(Jr(h)===!1||(c=tE(c,h,null,null,0),c===null))return!1}else if(cn(c)){if(uo(h)===!1||(c=c[h],c==null))return!1}else if(!Jn(c)||uo(h)===!1||(c=c.get(h),c==null))return!1;return!0}if(o[0]===null||o[1]===null)return!1;const a=en(o[1]);return Sl(o[0])||o[0]instanceof vn?!!o[0].hasField(a)&&o[0].field(a)!==null:o[0]instanceof Nr?tE(o[0],a,null,null,0)!==null:!1})},i.indexof=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);const a=o[1];if(cn(o[0])){for(let l=0;l{if(o=Bn(o),Vi(o,2,3,t,r),!(o[0]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(!(o[1]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);return o.length===2?d8r(o[0],o[1]):f8r(o[0],o[1],o[2])})},i.bearing=function(t,r){return e(t,r,(n,s,o)=>{if(o=Bn(o),Vi(o,2,3,t,r),!(o[0]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(!(o[1]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof $i))throw new Mt(t,wt.InvalidParameter,r);return o.length===2?p8r(o[0],o[1]):m8r(o[0],o[1],o[2])})},i.isselfintersecting=function(t,r){return e(t,r,(n,s,o)=>{o=Bn(o),Vi(o,1,1,t,r);let a=o[0];if(a instanceof $s)return a.isSelfIntersecting;if(a instanceof lo)return a=a.paths,Odt(a);if(a instanceof Oh){const l=a.points;for(let u=0;u0&&u[0][a]===e)return{partId:n,distanceAlong:s,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:u[0][0],y:u[0][1],...i.hasZ?{z:u[0][l]}:{},...i.hasM?{m:u[0][a]}:{}}),segmentId:0};let c=-1;for(let h=1;he&&e>u[h-1][a]){const w=(e-u[h-1][a])/m*p;let S=i.hasZ?y9t(u[h-1],u[h],w,r):v9t(u[h-1],u[h],w);S=[...S,e];const I=new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:S[0],y:S[1],...i.hasZ?{z:S[l]}:{},...i.hasM?{m:S[a]}:{}});return{partId:n,distanceAlong:s+o(u[h-1],[I.x,I.y,...I.hasZ?[I.z]:[],...I.hasM?[I.m]:[]],r),coordinate:I,segmentId:c}}s+=p}}return null}function b9t(i,e){if(!i)return null;switch(i.type){case"extent":case"multipoint":case"mesh":case"point":return null}const t=i.type==="polygon"?i.rings:i.paths;if(e<0)return null;let r=1;(i.spatialReference.vcsWkid||i.spatialReference.latestVcsWkid)&&(r=l7(i.spatialReference)/pu(i.spatialReference));let n=0;const s=i.hasZ?3:2,o=2,a=i.hasZ?og:g9t;let l=-1;if(e===0)return t.length===0||t[0].length===0?null:{partId:0,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:t[0][0][0],y:t[0][0][1],...i.hasZ?{z:t[0][0][o]}:{},...i.hasM?{m:t[0][0][s]}:{}}),segmentId:0};for(const u of t){l++;let c=-1;for(let h=1;he){let v=i.hasZ?y9t(u[h-1],u[h],e-n,r):v9t(u[h-1],u[h],e-n);return v=[...v,m6e(u[h-1][s],u[h][s],p,e-n)],{partId:l,coordinate:new $i({hasZ:i.hasZ,hasM:i.hasM,spatialReference:i.spatialReference,x:v[0],y:v[1],...i.hasZ?{z:v[o]}:{},...i.hasM?{m:v[s]}:{}}),segmentId:c}}n=m}}return null}function S8r(i,e){if(!i||!e)return null;let t=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(t=l7(e.spatialReference)/pu(e.spatialReference));let r=null,n=0;return r=i,n=i.hasZ&&e.hasZ?og([e.x,e.y,e.z],[i.x,i.y,i.z],t):tP([e.x,e.y],[i.x,i.y],!1),{coordinate:r,distance:n}}function T8r(i,e){if(!i||!e)return null;let t=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(t=l7(e.spatialReference)/pu(e.spatialReference));let r=null,n=0,s=Number.MAX_VALUE,o=-1,a=-1;for(const l of i.points||[]){a++;const u=i.hasZ&&e.hasZ?c9t([l[0],l[1],l[2]],[e.x,e.y,e.z],t):h9t([l[0],l[1]],[e.x,e.y]);u(a=Bn(a),t(r,n,a),a[0]===null||a[1]===null||Wa.disjoint(a[0],a[1])))},i.intersects=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.intersects(a[0],a[1])))},i.touches=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.touches(a[0],a[1])))},i.crosses=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.crosses(a[0],a[1])))},i.within=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.within(a[0],a[1])))},i.contains=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.contains(a[0],a[1])))},i.overlaps=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]!==null&&Wa.overlaps(a[0],a[1])))},i.equals=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),a[0]===a[1]||(a[0]instanceof Nr&&a[1]instanceof Nr?Wa.equals(a[0],a[1]):(qa(a[0])&&qa(a[1])||Pa(a[0])&&Pa(a[1])||!(!Jo(a[0])||!Jo(a[1])))&&a[0].equals(a[1]))))},i.relate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,3,3,r,n),a[0]instanceof Nr&&a[1]instanceof Nr)return Wa.relate(a[0],a[1],en(a[2]));if(a[0]instanceof Nr&&a[1]===null||a[1]instanceof Nr&&a[0]===null||a[0]===null&&a[1]===null)return!1;throw new Mt(r,wt.InvalidParameter,n)})},i.intersection=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]===null||a[1]===null?null:Wa.intersect(a[0],a[1])))},i.union=function(r,n){return e(r,n,(s,o,a)=>{const l=[];if((a=Bn(a)).length===0)throw new Mt(r,wt.WrongNumberOfParameters,n);if(a.length===1)if(cn(a[0])){const u=Bn(a[0]);for(let c=0;c(a=Bn(a),t(r,n,a),a[0]!==null&&a[1]===null?hp(a[0]):a[0]===null?null:Wa.difference(a[0],a[1])))},i.symmetricdifference=function(r,n){return e(r,n,(s,o,a)=>(a=Bn(a),t(r,n,a),a[0]===null&&a[1]===null?null:a[0]===null?hp(a[1]):a[1]===null?hp(a[0]):Wa.symmetricDifference(a[0],a[1])))},i.clip=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[1]instanceof hr)&&a[1]!==null)throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[1]===null?null:Wa.clip(a[0],a[1])})},i.cut=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[1]instanceof lo)&&a[1]!==null)throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null)return[];if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[1]===null?[hp(a[0])]:Wa.cut(a[0],a[1])})},i.area=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=$se(a[0],r.spatialReference);return l===null?0:Wa.planarArea(l,uA(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.planarArea(a[0],uA(gn(a[1],-1)))})},i.areageodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=$se(a[0],r.spatialReference);return l===null?0:Wa.geodesicArea(l,uA(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.geodesicArea(a[0],uA(gn(a[1],-1)))})},i.length=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:Wa.planarLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.planarLength(a[0],au(gn(a[1],-1)))})},i.length3d=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:l.hasZ===!0?Rdt(l,au(gn(a[1],-1))):Wa.planarLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return a[0].hasZ===!0?Rdt(a[0],au(gn(a[1],-1))):Wa.planarLength(a[0],au(gn(a[1],-1)))})},i.lengthgeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),(a=Bn(a))[0]===null)return 0;if(cn(a[0])||Jn(a[0])){const l=db(a[0],r.spatialReference);return l===null?0:Wa.geodesicLength(l,au(gn(a[1],-1)))}if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.geodesicLength(a[0],au(gn(a[1],-1)))})},i.distance=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);let l=a[0];(cn(a[0])||Jn(a[0]))&&(l=m9(a[0],r.spatialReference));let u=a[1];if((cn(a[1])||Jn(a[1]))&&(u=m9(a[1],r.spatialReference)),!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(u instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.distance(l,u,au(gn(a[2],-1)))})},i.distancegeodetic=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);const l=a[0],u=a[1];if(!(l instanceof $i))throw new Mt(r,wt.InvalidParameter,n);if(!(u instanceof $i))throw new Mt(r,wt.InvalidParameter,n);const c=new lo({paths:[],spatialReference:l.spatialReference});return c.addPath([l,u]),Wa.geodesicLength(c,au(gn(a[2],-1)))})},i.densify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);if(l<=0)throw new Mt(r,wt.InvalidParameter,n);return a[0]instanceof $s||a[0]instanceof lo?Wa.densify(a[0],l,au(gn(a[2],-1))):a[0]instanceof hr?Wa.densify(Pdt(a[0]),l,au(gn(a[2],-1))):a[0]})},i.densifygeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);if(l<=0)throw new Mt(r,wt.InvalidParameter,n);return a[0]instanceof $s||a[0]instanceof lo?Wa.geodesicDensify(a[0],l,au(gn(a[2],-1))):a[0]instanceof hr?Wa.geodesicDensify(Pdt(a[0]),l,au(gn(a[2],-1))):a[0]})},i.generalize=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,4,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return Wa.generalize(a[0],l,nx(gn(a[2],!0)),au(gn(a[3],-1)))})},i.buffer=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return l===0?hp(a[0]):Wa.buffer(a[0],l,au(gn(a[2],-1)))})},i.buffergeodetic=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,3,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);return l===0?hp(a[0]):Wa.geodesicBuffer(a[0],l,au(gn(a[2],-1)))})},i.offset=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,6,r,n),a[0]===null)return null;if(!(a[0]instanceof $s||a[0]instanceof lo))throw new Mt(r,wt.InvalidParameter,n);const l=Ai(a[1]);if(isNaN(l))throw new Mt(r,wt.InvalidParameter,n);const u=Ai(gn(a[4],10));if(isNaN(u))throw new Mt(r,wt.InvalidParameter,n);const c=Ai(gn(a[5],0));if(isNaN(c))throw new Mt(r,wt.InvalidParameter,n);return Wa.offset(a[0],l,au(gn(a[2],-1)),en(gn(a[3],"round")).toLowerCase(),u,c)})},i.rotate=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,2,3,r,n);let l=a[0];if(l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);l instanceof hr&&(l=$s.fromExtent(l));const u=Ai(a[1]);if(isNaN(u))throw new Mt(r,wt.InvalidParameter,n);const c=gn(a[2],null);if(c===null)return Wa.rotate(l,u);if(c instanceof $i)return Wa.rotate(l,u,c);throw new Mt(r,wt.InvalidParameter,n)})},i.centroid=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=m9(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return l instanceof $i?zh(hp(a[0]),r.spatialReference):l instanceof $s?l.centroid:l instanceof lo?d9t(l):l instanceof Oh?p9t(l):l instanceof hr?l.center:null})},i.measuretocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const u=_9t(l,a[1]);return u?vn.convertObjectToArcadeDictionary(u,Es(r),!1,!0):null})},i.pointtocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);const u=a[1];if(u===null)return null;if(!(u instanceof $i))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const c=w9t(l,u);return c?vn.convertObjectToArcadeDictionary(c,Es(r),!1,!0):null})},i.distancetocoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),a[0]===null)return null;let l=a[0];if((cn(a[0])||Jn(a[0]))&&(l=db(a[0],r.spatialReference)),l===null)return null;if(!(l instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(!(l instanceof lo))throw new Mt(r,wt.InvalidParameter,n);if(uo(a[1]===!1))throw new Mt(r,wt.InvalidParameter,n);const u=b9t(l,a[1]);return u?vn.convertObjectToArcadeDictionary(u,Es(r),!1,!0):null})},i.multiparttosinglepart=function(r,n){return e(r,n,(s,o,a)=>{a=Bn(a),Vi(a,1,1,r,n);const l=[];if(a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);if(a[0]instanceof $i)return[zh(hp(a[0]),r.spatialReference)];if(a[0]instanceof hr)return[zh(hp(a[0]),r.spatialReference)];const u=Wa.simplify(a[0]);if(u instanceof $s){const c=[],h=[];for(let p=0;p{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return!0;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.isSimple(a[0])})},i.simplify=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.simplify(a[0])})},i.convexhull=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,1,1,r,n),a[0]===null)return null;if(!(a[0]instanceof Nr))throw new Mt(r,wt.InvalidParameter,n);return Wa.convexHull(a[0])})},i.nearestcoordinate=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[0]instanceof Nr||a[0]===null))throw new Mt(r,wt.InvalidParameter,n);if(!(a[1]instanceof $i||a[1]===null))throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null||a[1]===null)return null;const l=Wa.nearestCoordinate(a[0],a[1]);return l===null||l.isEmpty?null:vn.convertObjectToArcadeDictionary({coordinate:l.coordinate,distance:l.distance,sideOfLine:l.distance===0?"straddle":l.isRightSide?"right":"left"},Es(r),!1,!0)})},i.nearestvertex=function(r,n){return e(r,n,(s,o,a)=>{if(a=Bn(a),Vi(a,2,2,r,n),!(a[0]instanceof Nr||a[0]===null))throw new Mt(r,wt.InvalidParameter,n);if(!(a[1]instanceof $i||a[1]===null))throw new Mt(r,wt.InvalidParameter,n);if(a[0]===null||a[1]===null)return null;const l=Wa.nearestVertex(a[0],a[1]);return l===null||l.isEmpty?null:vn.convertObjectToArcadeDictionary({coordinate:l.coordinate,distance:l.distance,sideOfLine:l.distance===0?"straddle":l.isRightSide?"right":"left"},Es(r),!1,!0)})}}function xOe(i,e,t){return t===void 0||+t==0?Math[i](e):(e=+e,t=+t,isNaN(e)||typeof t!="number"||t%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[i](+(e[0]+"e"+(e[1]?+e[1]-t:-t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t))))}function lXe(i,e){function t(r,n,s){const o=Ai(r);return isNaN(o)?o:isNaN(n)||isNaN(s)||n>s?NaN:os?s:o}i.number=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,1,2,r,n);const l=a[0];if(uo(l))return l;if(l===null)return 0;if(qa(l)||Pa(l)||Jo(l))return l.toNumber();if(ha(l))return Number(l);if(cn(l))return NaN;if(l===""||l===void 0)return Number(l);if(Jr(l)){if(a[1]!==void 0){let u=gS(a[1],"‰","");return u=gS(u,"¤",""),e9t(l,{pattern:u})}return Number(l.trim())}return Number(l)})},i.abs=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.abs(Ai(a[0]))))},i.acos=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.acos(Ai(a[0]))))},i.asin=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.asin(Ai(a[0]))))},i.atan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.atan(Ai(a[0]))))},i.atan2=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),Math.atan2(Ai(a[0]),Ai(a[1]))))},i.ceil=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("ceil",Ai(a[0]),-1*l)}return Math.ceil(Ai(a[0]))})},i.round=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("round",Ai(a[0]),-1*l)}return Math.round(Ai(a[0]))})},i.floor=function(r,n){return e(r,n,(s,o,a)=>{if(Vi(a,1,2,r,n),a.length===2){let l=Ai(a[1]);return isNaN(l)&&(l=0),xOe("floor",Ai(a[0]),-1*l)}return Math.floor(Ai(a[0]))})},i.cos=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.cos(Ai(a[0]))))},i.isnan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),typeof a[0]=="number"&&isNaN(a[0])))},i.exp=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.exp(Ai(a[0]))))},i.log=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.log(Ai(a[0]))))},i.pow=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,2,2,r,n),Ai(a[0])**Ai(a[1])))},i.random=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,0,0,r,n),Math.random()))},i.sin=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.sin(Ai(a[0]))))},i.sqrt=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.sqrt(Ai(a[0]))))},i.tan=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),Math.tan(Ai(a[0]))))},i.isempty=function(r,n){return e(r,n,(s,o,a)=>(Vi(a,1,1,r,n),a[0]===null||a[0]===""||a[0]===void 0||a[0]===nn))},i.boolean=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,1,1,r,n);const l=a[0];return nx(l)})},i.constrain=function(r,n){return e(r,n,(s,o,a)=>{Vi(a,3,3,r,n);const l=Ai(a[1]),u=Ai(a[2]);if(cn(a[0])){const c=[];for(const h of a[0])c.push(t(h,l,u));return c}if(Jn(a[0])){const c=[];for(let h=0;h=e&&e!==-1)return t}return t}function PC(i,e,t=1e3){switch(i.toLowerCase()){case"distinct":return A8r(e,t);case"avg":case"mean":return S9t(f$(e));case"min":return Math.min.apply(Math,f$(e));case"sum":return I8r(f$(e));case"max":return Math.max.apply(Math,f$(e));case"stdev":case"stddev":return Math.sqrt(Ddt(f$(e)));case"var":case"variance":return Ddt(f$(e));case"count":return e.length}return 0}function AD(i,e,t,r){if(r.length===1){if(cn(r[0]))return PC(i,r[0],-1);if(Jn(r[0]))return PC(i,r[0].toArray(),-1)}return PC(i,r,-1)}function uXe(i,e){i.stdev=function(t,r){return e(t,r,(n,s,o)=>AD("stdev",n,s,o))},i.variance=function(t,r){return e(t,r,(n,s,o)=>AD("variance",n,s,o))},i.average=function(t,r){return e(t,r,(n,s,o)=>AD("mean",n,s,o))},i.mean=function(t,r){return e(t,r,(n,s,o)=>AD("mean",n,s,o))},i.sum=function(t,r){return e(t,r,(n,s,o)=>AD("sum",n,s,o))},i.min=function(t,r){return e(t,r,(n,s,o)=>AD("min",n,s,o))},i.max=function(t,r){return e(t,r,(n,s,o)=>AD("max",n,s,o))},i.distinct=function(t,r){return e(t,r,(n,s,o)=>AD("distinct",n,s,o))},i.count=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),cn(o[0])||Jr(o[0]))return o[0].length;if(Jn(o[0]))return o[0].length();throw new Mt(t,wt.InvalidParameter,r)})}}let IB=class extends vn{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},T9t=class C9t extends vn{constructor(e,t,r,n,s,o,a){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",t),this.setField("contenttype",r),this.setField("size",n),this.setField("exifinfo",o),this.setField("keywords",a),this.immutable=!0}deepClone(){return new C9t(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const cXe=i=>(e,t,r)=>(r=r||14,+i(e,t).toFixed(r)),M8r=(i,e)=>i+e,O8r=(i,e)=>i*e,P8r=(i,e)=>i/e,Fdt=(i,e,t)=>cXe(M8r)(i,e,t),oH=(i,e,t)=>cXe(O8r)(i,e,t),Q_e=(i,e,t)=>cXe(P8r)(i,e,t),ebe=360,R8r=400,D8r=2*Math.PI,GC=3600,kdt=3240,fre=60,z5=60,Ldt=180*GC/Math.PI,QQ=ebe*fre*z5,SOe=90*GC,Ij=180*GC,F8r=270*GC,E9t="ᵍ",eee="°";function oK(i){if(Jr(i)===!1)throw new Mt(null,wt.InvalidParameter,null);return i}function g6e(i,e){const t=10**e;return Math.round(i*t)/t}function k8r(i,e){return i%e}function Aj(i){const e=parseFloat(i.toString().replace(Math.trunc(i).toString(),"0"))*Math.sign(i);return i<0?{fraction:e,integer:Math.ceil(i)}:{fraction:e,integer:Math.floor(i)}}var _c,Hn,Tu,y6e;function eV(i,e){switch(i){case _c.north:return e==="SHORT"?"N":"North";case _c.east:return e==="SHORT"?"E":"East";case _c.south:return e==="SHORT"?"S":"South";case _c.west:return e==="SHORT"?"W":"West"}}function TOe(i,e){return i-Math.floor(i/e)*e}function COe(i){switch(i){case Hn.truncated_degrees:case Hn.decimal_degrees:return ebe;case Hn.radians:return D8r;case Hn.gradians:return R8r;case Hn.seconds:return QQ;case Hn.fractional_degree_minutes:return fre;case Hn.fractional_minute_seconds:return z5;default:throw new Mt(null,wt.LogicError,null,{reason:"unsupported evaluations"})}}function Ndt(i){switch(i.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Tu.north_azimuth;case"POLAR":return Tu.polar;case"QUADRANT":return Tu.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Tu.south_azimuth}throw new Mt(null,wt.LogicError,null,{reason:"unsupported directionType"})}function $dt(i){switch(i.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return Hn.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return Hn.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return Hn.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return Hn.gradians}throw new Mt(null,wt.LogicError,null,{reason:"unsupported units"})}(function(i){i[i.north=0]="north",i[i.east=1]="east",i[i.south=2]="south",i[i.west=3]="west"})(_c||(_c={})),function(i){i[i.decimal_degrees=1]="decimal_degrees",i[i.seconds=2]="seconds",i[i.degrees_minutes_seconds=3]="degrees_minutes_seconds",i[i.radians=4]="radians",i[i.gradians=5]="gradians",i[i.truncated_degrees=6]="truncated_degrees",i[i.fractional_degree_minutes=7]="fractional_degree_minutes",i[i.fractional_minute_seconds=8]="fractional_minute_seconds"}(Hn||(Hn={})),function(i){i[i.north_azimuth=1]="north_azimuth",i[i.polar=2]="polar",i[i.quadrant=3]="quadrant",i[i.south_azimuth=4]="south_azimuth"}(Tu||(Tu={})),function(i){i[i.meridian=0]="meridian",i[i.direction=1]="direction"}(y6e||(y6e={}));let gq=class jge{constructor(e,t,r){this.m_degrees=e,this.m_minutes=t,this.m_seconds=r}getField(e){switch(e){case Hn.decimal_degrees:case Hn.truncated_degrees:return this.m_degrees;case Hn.fractional_degree_minutes:return this.m_minutes;case Hn.seconds:case Hn.fractional_minute_seconds:return this.m_seconds;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(e){const t=Aj(e).fraction;let r=Aj(e).integer;const n=Math.floor(r/GC);r-=n*GC;const s=Math.floor(r/z5);return r-=s*z5,new jge(n,s,r+t)}static numberToDms(e){const t=Aj(e).fraction,r=Aj(e).integer,n=oH(Aj(100*t).fraction,100),s=Aj(100*t).integer;return new jge(r,s,n)}format(e,t){let r=g6e(this.m_seconds,t),n=this.m_minutes,s=this.m_degrees;if(e===Hn.seconds||e===Hn.fractional_minute_seconds)z5<=r&&(r-=z5,++n),fre<=n&&(n=0,++s),ebe<=s&&(s=0);else if(e===Hn.fractional_degree_minutes)r=0,n=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,fre<=n&&(n=0,++s),ebe<=s&&(s=0);else if(e===Hn.decimal_degrees||e===Hn.truncated_degrees){const o=Q_e(this.m_seconds,GC),a=Q_e(this.m_minutes,fre);s=Math.round(this.m_degrees+a+o),n=0,r=0}return new jge(s,n,r)}static dmsToSeconds(e,t,r){return e*GC+t*z5+r}},L8r=class{constructor(e,t,r){this.meridian=e,this.angle=t,this.direction=r}fetchAzimuth(e){return e===y6e.meridian?this.meridian:this.direction}},b5=class hO{constructor(e){this._angle=e}static createFromAngleAndDirection(e,t){return new hO(new FA(hO._convertDirectionFormat(e.extractAngularUnits(Hn.seconds),t,Tu.north_azimuth)))}getAngle(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:case Tu.south_azimuth:case Tu.polar:return new FA(hO._convertDirectionFormat(t,Tu.north_azimuth,e));case Tu.quadrant:{const r=hO.secondsNorthAzimuthToQuadrant(t);return new FA(r.angle)}}}getMeridian(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:return _c.north;case Tu.south_azimuth:return _c.south;case Tu.polar:return _c.east;case Tu.quadrant:return hO.secondsNorthAzimuthToQuadrant(t).meridian}}getDirection(e){const t=this._angle.extractAngularUnits(Hn.seconds);switch(e){case Tu.north_azimuth:return _c.east;case Tu.south_azimuth:return _c.west;case Tu.polar:return _c.north;case Tu.quadrant:return hO.secondsNorthAzimuthToQuadrant(t).direction}}static secondsNorthAzimuthToQuadrant(e){const t=e<=SOe||e>=F8r?_c.north:_c.south,r=t===_c.north?Math.min(QQ-e,e):Math.abs(e-Ij),n=e>Ij?_c.west:_c.east;return new L8r(t,r,n)}static createFromAngleMeridianAndDirection(e,t,r){return new hO(new FA(hO.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(Hn.seconds),t,r)))}static secondsQuadrantToNorthAzimuth(e,t,r){return t===_c.north?r===_c.east?e:QQ-e:r===_c.east?Ij-e:Ij+e}static _convertDirectionFormat(e,t,r){let n=0;switch(t){case Tu.north_azimuth:n=e;break;case Tu.polar:n=SOe-e;break;case Tu.quadrant:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"});case Tu.south_azimuth:n=e+Ij}let s=0;switch(r){case Tu.north_azimuth:s=n;break;case Tu.polar:s=SOe-n;break;case Tu.quadrant:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"});case Tu.south_azimuth:s=n-Ij}return s=k8r(s,QQ),s<0?QQ+s:s}};function Bdt(i,e,t){let r=null;switch(e){case Hn.decimal_degrees:r=oH(i,GC);break;case Hn.seconds:r=i;break;case Hn.gradians:r=oH(i,kdt);break;case Hn.radians:r=oH(i,Ldt);break;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}switch(t){case Hn.decimal_degrees:return Q_e(r,GC);case Hn.seconds:return r;case Hn.gradians:return Q_e(r,kdt);case Hn.radians:return r/Ldt;default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}let FA=class v6e{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,t){return new v6e(Bdt(e,t,Hn.seconds))}extractAngularUnits(e){return Bdt(this._seconds,Hn.seconds,Gse(e))}static createFromDegreesMinutesSeconds(e,t,r){return new v6e(Fdt(Fdt(oH(e,GC),oH(t,z5)),r))}};function Gse(i){switch(Of(i),i){case Hn.decimal_degrees:case Hn.truncated_degrees:case Hn.degrees_minutes_seconds:return Hn.decimal_degrees;case Hn.gradians:return Hn.gradians;case Hn.fractional_degree_minutes:return Hn.fractional_degree_minutes;case Hn.radians:return Hn.radians;case Hn.seconds:case Hn.fractional_minute_seconds:return Hn.seconds}}let N8r=class I9t{constructor(e,t,r,n){this.view=e,this.angle=t,this.merdian=r,this.direction=n,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,t,r){return new I9t(e,t.getAngle(r),t.getMeridian(r),t.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let e=null,t=Hn.truncated_degrees,r=0;for(let n=0;n0?1:0),"0");case Hn.truncated_degrees:case Hn.fractional_degree_minutes:return s=TOe(n.fetchFormattedDms().getField(e),COe(e)),s.toFixed(r).padStart(t+r+(r>0?1:0),"0");case Hn.fractional_minute_seconds:return s=TOe(g6e(n.fetchDms().getField(e),r),COe(e)),s.toFixed(r).padStart(t+r+(r>0?1:0),"0");default:throw new Mt(null,wt.LogicError,null,{reason:"unexpected evaluation"})}}function B8r(i,e,t){if(t===Tu.quadrant)throw new Mt(null,wt.LogicError,null,{reason:"conversion error"});if(e===Hn.degrees_minutes_seconds){const r=gq.numberToDms(i);return b5.createFromAngleAndDirection(FA.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),t)}return b5.createFromAngleAndDirection(FA.createFromAngleAndUnits(i,Gse(e)),t)}function j8r(i){switch(Ai(i)){case 1:return{first:_c.north,second:_c.east};case 2:return{first:_c.south,second:_c.east};case 3:return{first:_c.south,second:_c.west};case 4:return{first:_c.north,second:_c.west}}return null}function jdt(i){switch(i.toUpperCase().trim()){case"N":case"NORTH":return _c.north;case"E":case"EAST":return _c.east;case"S":case"SOUTH":return _c.south;case"W":case"WEST":return _c.west}return null}function Mj(i){const e=parseFloat(i);if(uo(e)){if(isNaN(e))throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"});return e}throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}function EOe(i,e,t){const r=t===Tu.quadrant;let n=null,s=null,o=0,a=0,l=0;if(r){if(i.length<2)throw new Mt(null,wt.LogicError,null,{reason:"conversion error"});l=1;const u=j8r(en(i[i.length-1]));if(u?(n=u.first,s=u.second):(o=1,n=jdt(en(i[0])),s=jdt(en(i[i.length-1]))),n===null||s===null)throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}switch(e){case Hn.decimal_degrees:case Hn.radians:case Hn.gradians:if(i.length===0)throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"});return r?b5.createFromAngleMeridianAndDirection(FA.createFromAngleAndUnits(Mj(i[o]),Gse(e)),n,s):b5.createFromAngleAndDirection(FA.createFromAngleAndUnits(Mj(i[o]),Gse(e)),t);case Hn.degrees_minutes_seconds:if(a=i.length-l-o,a===3){const u=FA.createFromDegreesMinutesSeconds(Mj(i[o]),Mj(i[o+1]),Mj(i[o+2]));return r?b5.createFromAngleMeridianAndDirection(u,n,s):b5.createFromAngleAndDirection(u,t)}if(a===1){const u=Mj(i[o]),c=gq.numberToDms(u),h=FA.createFromDegreesMinutesSeconds(c.m_degrees,c.m_minutes,c.m_seconds);return r?b5.createFromAngleMeridianAndDirection(h,n,s):b5.createFromAngleAndDirection(h,t)}}throw new Mt(null,wt.LogicError,null,{reason:"invalid conversion"})}function G8r(i){const e=new Set([" ","-","/","'",'"',"\\","^",eee,E9t," ","\r",` +`,"*"]);let t="";for(let r=0;rr!=="")}function U8r(i,e,t){if(uo(i))return B8r(Ai(i),e,t);if(Jr(i))return EOe(G8r(i),e,t);if(cn(i))return EOe(i,e,t);if(Jn(i))return EOe(i.toArray(),e,t);throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}function z8r(i,e,t){const r=Gse(t);if(r&&t!==Hn.degrees_minutes_seconds)return i.getAngle(e).extractAngularUnits(r);throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}function V8r(i,e,t){const r=i.getAngle(e);if(e===Tu.quadrant&&t===Hn.degrees_minutes_seconds){const n=gq.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[eV(i.getMeridian(e),"SHORT"),n.m_degrees,n.m_minutes,n.m_seconds,eV(i.getDirection(e),"SHORT")]}if(t===Hn.degrees_minutes_seconds){const n=gq.secondsToDMS(r.extractAngularUnits(Hn.seconds));return[n.m_degrees,n.m_minutes,n.m_seconds]}return e===Tu.quadrant?[eV(i.getMeridian(e),"SHORT"),r.extractAngularUnits(t),eV(i.getDirection(e),"SHORT")]:[r.extractAngularUnits(t)]}function H8r(i,e){let t="";switch(i){case Hn.decimal_degrees:t=e===Tu.quadrant?"DD.DD"+eee:"DDD.DD"+eee;break;case Hn.degrees_minutes_seconds:t=e===Tu.quadrant?"dd"+eee+` mm' ss"`:"ddd"+eee+` mm' ss.ss"`;break;case Hn.radians:t="R.RR";break;case Hn.gradians:t="GGG.GG"+E9t;break;default:throw new Mt(null,wt.LogicError,null,{reason:"conversion error"})}return e===Tu.quadrant&&(t="p "+t+" b"),t}function _6e(i,e,t){const r={padding:0,rounding:0,newpos:e};let n=!1;for(;e>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(t++,n=65536+((1023&n)<<10|1023&i.charCodeAt(t)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return new Uint8Array(e)}let X8r=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const r of e)isNaN(r)?t.push("NaN"):r===1/0?t.push("Infinity"):r===-1/0?t.push("-Infinity"):r===0?t.push("0"):t.push(r.toString(16));this.update(zdt(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(zdt(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const r of this._bufs)e.set(r,t),t+=r.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const r=e;let n=t+Udt&4294967295,s=0;if(r.length>=16){const a=[t+Oj+Pj&4294967295,t+Pj&4294967295,t+0&4294967295,t-Oj&4294967295],l=e,u=l.length-16;let c=0;for(s=0;(4294967280&s)<=u;s+=4){const h=s,p=l[h]+(l[h+1]<<8),m=l[h+2]+(l[h+3]<<8),v=p*Pj+(m*Pj<<16);let w=a[c]+v&4294967295;w=w<<13|w>>>19;const S=65535&w,I=w>>>16;a[c]=S*Oj+(I*Oj<<16)&4294967295,c=c+1&3}n=(a[0]<<1|a[0]>>>31)+(a[1]<<7|a[1]>>>25)+(a[2]<<12|a[2]>>>20)+(a[3]<<18|a[3]>>>14)&4294967295}n=n+e.length&4294967295;const o=e.length-4;for(;s<=o;s+=4){const a=s,l=r[a]+(r[a+1]<<8),u=r[a+2]+(r[a+3]<<8);n=n+(l*pde+(u*pde<<16))&4294967295,n=n<<17|n>>>15,n=(65535&n)*Gdt+((n>>>16)*Gdt<<16)&4294967295}for(;s>>21,n=(65535&n)*Oj+((n>>>16)*Oj<<16)&4294967295;return n^=n>>>15,n=((65535&n)*Pj&4294967295)+((n>>>16)*Pj<<16),n^=n>>>13,n=((65535&n)*pde&4294967295)+((n>>>16)*pde<<16),n^=n>>>16,n<0?n+4294967296:n}};function J8r(i){return i.loadStatus==="loaded"&&i.user?.sourceJSON?i.user.sourceJSON:null}function K8r(i,e){return!!i&&eze(i,e?.restUrl||"")}function Vdt(i,e){if(!i||!e)return i===e;if(i.x===e.x&&i.y===e.y){if(i.hasZ){if(i.z!==e.z)return!1}else if(e.hasZ)return!1;if(i.hasM){if(i.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function P2(i,e,t){if(i!==null)if(cn(i)){if(e.updateUint8Array([61]),t.map.has(i)){const r=t.map.get(i);e.updateIntArray([61237541^r])}else{t.map.set(i,t.currentLength++);for(const r of i)P2(r,e,t);t.map.delete(i),t.currentLength--}e.updateUint8Array([199])}else if(Jn(i)){if(e.updateUint8Array([61]),t.map.has(i)){const r=t.map.get(i);e.updateIntArray([61237541^r])}else{t.map.set(i,t.currentLength++);for(const r of i.toArray())P2(r,e,t);t.map.delete(i),t.currentLength--}e.updateUint8Array([199])}else{if(qa(i))return e.updateIntArray([i.toNumber()]),void e.updateUint8Array([241]);if(Jo(i))return e.updateIntArray([i.toNumber()]),void e.updateIntArray([257]);if(Pa(i))return e.updateIntArray([i.toNumber()]),void e.updateIntArray([263]);if(Jr(i))return e.updateIntArray([i.length]),e.updateWithString(i),void e.updateUint8Array([41]);if(ha(i))e.updateUint8Array([i===!0?1:0,113]);else{if(uo(i))return e.updateFloatArray([i]),void e.updateUint8Array([173]);if(i instanceof T9t)throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(i instanceof IB)throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(!(i instanceof vn)){if(Sl(i))throw new Mt(t.context,wt.UnsupportedHashType,t.node);if(i instanceof $i)return e.updateIntArray([3833836621]),e.updateIntArray([0]),e.updateFloatArray([i.x]),e.updateIntArray([1]),e.updateFloatArray([i.y]),i.hasZ&&(e.updateIntArray([2]),e.updateFloatArray([i.z])),i.hasM&&(e.updateIntArray([3]),e.updateFloatArray([i.m])),e.updateIntArray([3765347959]),void P2(i.spatialReference.wkid,e,t);if(i instanceof $s){e.updateIntArray([1266616829]);for(let r=0;r(Vi(o,1,1,t,r),new IB(en(o[0]))))},i.typeof=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=XYe(o[0]);if(a==="Unrecognized Type")throw new Mt(t,wt.UnrecognizedType,r);return a})},i.trim=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,1,t,r),en(o[0]).trim()))},i.tohex=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=Ai(o[0]);return isNaN(a)?a:a.toString(16)})},i.upper=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,1,t,r),en(o[0]).toUpperCase()))},i.proper=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);let a=1;o.length===2&&en(o[1]).toLowerCase()==="firstword"&&(a=2);const l=/\s/,u=en(o[0]);let c="",h=!0;for(let p=0;p(Vi(o,1,1,t,r),en(o[0]).toLowerCase()))},i.guid=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,0,1,t,r),o.length>0)switch(en(o[0]).toLowerCase()){case"digits":return yU().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return yU();case"digits-hyphen-braces":return"{"+yU()+"}";case"digits-hyphen-parentheses":return"("+yU()+")"}return"{"+yU()+"}"})},i.standardizeguid=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=en(o[0]);if(a===""||a===null)return"";const l=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(a);if(!l)return"";const u=l.groups;switch(a=u.partA+"-"+u.partB+"-"+u.partC+"-"+u.partD+"-"+u.partE,en(o[1]).toLowerCase()){case"digits":return a.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return a;case"digits-hyphen-braces":return"{"+a+"}";case"digits-hyphen-parentheses":return"("+a+")"}return"{"+a+"}"})},i.console=function(t,r){return e(t,r,(n,s,o)=>(o.length===0||(o.length===1?t.console(en(o[0])):t.console(en(o))),nn))},i.mid=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=Ai(o[1]);if(isNaN(a))return"";if(a<0&&(a=0),o.length===2)return en(o[0]).substr(a);let l=Ai(o[2]);return isNaN(l)?"":(l<0&&(l=0),en(o[0]).substr(a,l))})},i.find=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,3,t,r);let a=0;if(o.length>2){if(a=Ai(gn(o[2],0)),isNaN(a))return-1;a<0&&(a=0)}return en(o[1]).indexOf(en(o[0]),a)})},i.left=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=Ai(o[1]);return isNaN(a)?"":(a<0&&(a=0),en(o[0]).substr(0,a))})},i.right=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,2,2,t,r);let a=Ai(o[1]);return isNaN(a)?"":(a<0&&(a=0),en(o[0]).substr(-1*a,a))})},i.split=function(t,r){return e(t,r,(n,s,o)=>{let a;Vi(o,2,4,t,r);let l=Ai(gn(o[2],-1));const u=nx(gn(o[3],!1));if(l===-1||l===null||u===!0?a=en(o[0]).split(en(o[1])):(isNaN(l)&&(l=-1),l<-1&&(l=-1),a=en(o[0]).split(en(o[1]),l)),u===!1)return a;const c=[];for(let h=0;h=l);h++)a[h]!==""&&a[h]!==void 0&&c.push(a[h]);return c})},i.text=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,1,2,t,r),Sb(o[0],o[1])))},i.concatenate=function(t,r){return e(t,r,(n,s,o)=>{const a=[];if(o.length<1)return"";if(cn(o[0])){const l=gn(o[2],"");for(let u=0;u1?a.join(o[1]):a.join("")}if(Jn(o[0])){const l=gn(o[2],"");for(let u=0;u1?a.join(o[1]):a.join("")}for(let l=0;l{if(Vi(o,1,1,t,r),cn(o[0])){const a=o[0].slice(0);return a.reverse(),a}if(Jn(o[0])){const a=o[0].toArray().slice(0);return a.reverse(),a}throw new Mt(t,wt.InvalidParameter,r)})},i.replace=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,3,4,t,r);const a=en(o[0]),l=en(o[1]),u=en(o[2]);return o.length!==4||nx(o[3])?gS(a,l,u):a.replace(l,u)})},i.schema=function(t,r){return e(t,r,(n,s,o)=>{if(Sl(o[0])){const a=sXe(o[0]);return a?vn.convertObjectToArcadeDictionary(a,Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypes=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);return a?vn.convertObjectToArcadeDictionary(a,Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypecode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);if(!a)return null;if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const u of a.subtypes)if(u.code===l)return u.code;return null}return null}throw new Mt(t,wt.InvalidParameter,r)})},i.subtypename=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0])){const a=dre(o[0]);if(!a)return"";if(a.subtypeField&&o[0].hasField(a.subtypeField)){const l=o[0].field(a.subtypeField);for(const u of a.subtypes)if(u.code===l)return u.name;return""}return""}throw new Mt(t,wt.InvalidParameter,r)})},i.gdbversion=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Sl(o[0]))return o[0].gdbVersion();throw new Mt(t,wt.InvalidParameter,r)})},i.domain=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,3,t,r),Sl(o[0])){const a=iXe(o[0],en(o[1]),o[2]===void 0?void 0:o[2]);return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?vn.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:Y_e[a.field.type],codedValues:a.domain.codedValues.map(l=>({name:l.name,code:l.code}))},Es(t)):vn.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:Y_e[a.field.type],min:a.domain.minValue,max:a.domain.maxValue},Es(t)):null}throw new Mt(t,wt.InvalidParameter,r)})},i.domainname=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Sl(o[0]))return rXe(o[0],en(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new Mt(t,wt.InvalidParameter,r)})},i.domaincode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,2,4,t,r),Sl(o[0]))return nXe(o[0],en(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new Mt(t,wt.InvalidParameter,r)})},i.urlencode=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),o[0]===null)return"";if(o[0]instanceof vn){let a="";for(const l of o[0].keys()){const u=o[0].field(l);a!==""&&(a+="&"),a+=u===null?encodeURIComponent(l)+"=":encodeURIComponent(l)+"="+encodeURIComponent(u)}return a}return encodeURIComponent(en(o[0]))})},i.hash=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,1,t,r);const a=new X8r(0);return P2(o[0],a,{context:t,node:r,map:new Map,currentLength:0}),a.digest()})},i.convertdirection=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,3,3,t,r),Y8r(o[0],o[1],o[2])))},i.fromjson=function(t,r){return e(t,r,(n,s,o)=>{if(Vi(o,1,1,t,r),Jr(o[0])===!1)throw new Mt(t,wt.InvalidParameter,r);return vn.convertJsonToArcade(JSON.parse(en(o[0])),Es(t))})},i.expects=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);return nn})},i.tocharcode=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=Ai(gn(o[1],0)),l=en(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Mt(t,wt.OutOfBounds,r);return l.charCodeAt(a)})},i.tocodepoint=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,1,2,t,r);const a=Ai(gn(o[1],0)),l=en(o[0]);if(l.length===0&&o.length===1)return null;if(l.length<=a||a<0)throw new Mt(t,wt.OutOfBounds,r);return l.codePointAt(a)})},i.fromcharcode=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);const a=o.map(l=>Math.trunc(Ai(l))).filter(l=>l>=0&&l<=65535);return a.length===0?null:String.fromCharCode.apply(null,a)})},i.fromcodepoint=function(t,r){return e(t,r,(n,s,o)=>{if(o.length<1)throw new Mt(t,wt.WrongNumberOfParameters,r);let a;try{a=o.map(l=>Math.trunc(Ai(l))).filter(l=>l<=1114111&&l>>>0===l)}catch{return null}return a.length===0?null:String.fromCodePoint.apply(null,a)})},i.getuser=function(t,r){return e(t,r,(n,s,o)=>{Vi(o,0,2,t,r);let a=gn(o[1],"");if(a=a===!0||a===!1?"":en(a),a!==null&&a!=="")return null;if(o.length===0||o[0]instanceof IB){let l=null;if(l=t.services?.portal?t.services.portal:Bu.getDefault(),o.length>0&&!K8r(o[0].field("url"),l)||!l)return null;if(a===""){const u=J8r(l);if(u){const c=JSON.parse(JSON.stringify(u));for(const h of["lastLogin","created","modified"])c[h]!==void 0&&c[h]!==null&&(c[h]=new Date(c[h]));return vn.convertObjectToArcadeDictionary(c,Es(t))}}return null}throw new Mt(t,wt.InvalidParameter,r)})},i.getenvironment=function(t,r){return e(t,r,(n,s,o)=>(Vi(o,0,0,t,r),vn.convertObjectToArcadeDictionary(n9t(Es(t),t.spatialReference),Es(t),!0)))}}let Z8r=class extends bk{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new Mt(e,wt.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{a=a.map(u=>!mu(u)||u instanceof US?u:wk(u,e,n));const l=this.call(r,{arguments:a});return qp(l)?l.then(u=>wk(u,r,n)):l})}};function Ww(i,e,t){try{return t(i,null,e.arguments)}catch(r){throw r}}function Xn(i,e){try{switch(e.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return d9r(i,e);case"VariableDeclaration":return h9r(i,e);case"BlockStatement":case"Program":return b6e(i,e);case"FunctionDeclaration":return c9r(i,e);case"ImportDeclaration":return l9r(i,e);case"ExportNamedDeclaration":return u9r(i,e);case"ReturnStatement":return a9r(i,e);case"IfStatement":return A9t(i,e);case"ExpressionStatement":return o9r(i,e);case"AssignmentExpression":return s9r(i,e);case"UpdateExpression":return r9r(i,e);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return g9r(i,e);case"TemplateElement":return JSON.stringify(e.value?e.value.cooked:"");case"ForStatement":return i9r(i,e);case"ForInStatement":return t9r(i,e);case"WhileStatement":return n9r(i,e);case"Identifier":return _9r(i,e);case"MemberExpression":return p9r(i,e);case"Literal":return e.value===null||e.value===void 0?"null":JSON.stringify(e.value);case"CallExpression":return b9r(i,e);case"UnaryExpression":return f9r(i,e);case"BinaryExpression":return y9r(i,e);case"LogicalExpression":return v9r(i,e);case"ArrayExpression":return m9r(i,e);case"ObjectExpression":return Q8r(i,e);case"Property":return e9r(i,e);case"Array":throw new f0(i,wt.NeverReach,e);default:throw new f0(i,wt.Unrecognized,e)}}catch(t){throw t}}function Q8r(i,e){let t="lang.dictionary([";for(let r=0;r0&&(t+=","),t+="lang.strCheck("+(n.key.type==="Identifier"?"'"+n.key.name+"'":Xn(i,n.key))+",'ObjectExpression'),lang.aCheck("+Xn(i,n.value)+", 'ObjectExpression')"}return t+="])",t}function e9r(i,e){throw new f0(i,wt.NeverReach,e)}function t9r(i,e){const t=Tb(i),r=Tb(i),n=Tb(i);let s="var "+t+" = "+Xn(i,e.right)+`; `;e.left.type==="VariableDeclaration"&&(s+=Xn(i,e.left));let o=e.left.type==="VariableDeclaration"?e.left.declarations[0].id.name:e.left.name;o=o.toLowerCase(),$x(o);let a="";i.localScope!==null&&(i.localScope[o]!==void 0?a="lscope['"+o+"']":i.localScope._SymbolsMap[o]!==void 0&&(a="lscope['"+i.localScope._SymbolsMap[o]+"']"));let l="";if(a===""){if(i.globalScope[o]!==void 0)a="gscope['"+o+"']";else if(i.globalScope._SymbolsMap[o]!==void 0)a="gscope['"+i.globalScope._SymbolsMap[o]+"']";else if(i.localScope!==null)if(i.undeclaredGlobalsInFunctions.has(o))a="gscope['"+i.undeclaredGlobalsInFunctions.get(o).manglename+"']",l=i.undeclaredGlobalsInFunctions.get(o).manglename;else{const u={manglename:SE(i),node:e.left};i.undeclaredGlobalsInFunctions.set(o,u),a="gscope['"+u.manglename+"']",l=u.manglename}}return l&&(s+="lang.chkAssig('"+l+`',runtimeCtx); `),s+="if ("+t+`===null) { lastStatement = lc.voidOperation; } `,s+="else if (lc.isArray("+t+") || lc.isString("+t+")) {",s+="var "+r+"="+t+`.length; @@ -201,7 +201,7 @@ northing meters`+te;var ir=ki/2,$r=0,mn=0,Kr,xn,Gn,Ds,Fn;return 00&&(s+=", "),s+=Xn(i,e.arguments[o]);return s+="]",i.isAsync?"(yield lang.callModuleFunction("+Xn(i,e.callee.object)+","+s+","+n+",runtimeCtx))":"lang.callModuleFunction("+Xn(i,e.callee.object)+","+s+","+n+",runtimeCtx)"}if(e.callee.type!=="Identifier")throw new f0(i,wt.FunctionNotFound,e);const t=e.callee.name.toLowerCase();if(t==="iif")return T9r(i,e);if(t==="when")return E9r(i,e);if(t==="defaultvalue")return C9r(i,e);if(t==="decode")return I9r(i,e);let r="";if(i.localScope!==null&&(i.localScope[t]!==void 0?r="lscope['"+t+"']":i.localScope._SymbolsMap[t]!==void 0&&(r="lscope['"+i.localScope._SymbolsMap[t]+"']")),r===""){if(i.globalScope[t]!==void 0)r="gscope['"+t+"']";else if(i.globalScope._SymbolsMap[t]!==void 0)r="gscope['"+i.globalScope._SymbolsMap[t]+"']";else if(i.localScope!==null)if(i.undeclaredGlobalsInFunctions.has(t))r="gscope[lang.chkAssig('"+i.undeclaredGlobalsInFunctions.get(t).manglename+"',runtimeCtx)]";else{const n={manglename:SE(i),node:e.argument};i.undeclaredGlobalsInFunctions.set(t,n),r="gscope[lang.chkAssig('"+n.manglename+"',runtimeCtx)]"}}if(r!==""){let n="[";for(let s=0;s0&&(n+=", "),n+=Xn(i,e.arguments[s]);return n+="]",i.isAsync?"(yield lang.callfunc("+r+","+n+",runtimeCtx) )":"lang.callfunc("+r+","+n+",runtimeCtx)"}throw new f0(i,wt.FunctionNotFound,e)}catch(t){throw t}}function T9r(i,e){try{if(e.arguments.length!==3)throw new f0(i,wt.WrongNumberOfParameters,e);const t=Tb(i);return`${i.isAsync?`(yield (function() { +`}function d9r(i,e){let t=e.init===null?null:Xn(i,e.init);t===nn&&(t=null);const r=e.id.name.toLowerCase();if($x(r),i.localScope!==null){if(i.localScope[r]!==void 0)return"lscope['"+r+"']="+t+"; ";if(i.localScope._SymbolsMap[r]!==void 0)return"lscope['"+i.localScope._SymbolsMap[r]+"']="+t+"; ";{const s=SE(i);return i.localScope._SymbolsMap[r]=s,i.mangleMap[r]=s,"lscope['"+s+"']="+t+"; "}}if(i.globalScope[r]!==void 0)return"gscope['"+r+"']="+t+"; ";if(i.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+i.globalScope._SymbolsMap[r]+"']="+t+"; ";if(i.undeclaredGlobalsInFunctions.has(r)){const s=i.undeclaredGlobalsInFunctions.get(r).manglename;return i.globalScope._SymbolsMap[r]=s,i.mangleMap[r]=s,i.undeclaredGlobalsInFunctions.delete(r),"gscope[lang.setAssig('"+s+"', runtimeCtx)]="+t+"; "}const n=SE(i);return i.globalScope._SymbolsMap[r]=n,i.mangleMap[r]=n,"gscope['"+n+"']="+t+"; "}function p9r(i,e){try{let t;return e.computed===!0?t=Xn(i,e.property):(t="'"+e.property.name+"'",$x(e.property.name)),"lang.member("+Xn(i,e.object)+","+t+")"}catch(t){throw t}}function f9r(i,e){try{return"lang.unary("+Xn(i,e.argument)+",'"+e.operator+"')"}catch(t){throw t}}function m9r(i,e){try{const t=[];for(let r=0;r0&&(s+=", "),s+=Xn(i,e.arguments[o]);return s+="]",i.isAsync?"(yield lang.callModuleFunction("+Xn(i,e.callee.object)+","+s+","+n+",runtimeCtx))":"lang.callModuleFunction("+Xn(i,e.callee.object)+","+s+","+n+",runtimeCtx)"}if(e.callee.type!=="Identifier")throw new f0(i,wt.FunctionNotFound,e);const t=e.callee.name.toLowerCase();if(t==="iif")return w9r(i,e);if(t==="when")return S9r(i,e);if(t==="defaultvalue")return x9r(i,e);if(t==="decode")return T9r(i,e);let r="";if(i.localScope!==null&&(i.localScope[t]!==void 0?r="lscope['"+t+"']":i.localScope._SymbolsMap[t]!==void 0&&(r="lscope['"+i.localScope._SymbolsMap[t]+"']")),r===""){if(i.globalScope[t]!==void 0)r="gscope['"+t+"']";else if(i.globalScope._SymbolsMap[t]!==void 0)r="gscope['"+i.globalScope._SymbolsMap[t]+"']";else if(i.localScope!==null)if(i.undeclaredGlobalsInFunctions.has(t))r="gscope[lang.chkAssig('"+i.undeclaredGlobalsInFunctions.get(t).manglename+"',runtimeCtx)]";else{const n={manglename:SE(i),node:e.argument};i.undeclaredGlobalsInFunctions.set(t,n),r="gscope[lang.chkAssig('"+n.manglename+"',runtimeCtx)]"}}if(r!==""){let n="[";for(let s=0;s0&&(n+=", "),n+=Xn(i,e.arguments[s]);return n+="]",i.isAsync?"(yield lang.callfunc("+r+","+n+",runtimeCtx) )":"lang.callfunc("+r+","+n+",runtimeCtx)"}throw new f0(i,wt.FunctionNotFound,e)}catch(t){throw t}}function w9r(i,e){try{if(e.arguments.length!==3)throw new f0(i,wt.WrongNumberOfParameters,e);const t=Tb(i);return`${i.isAsync?`(yield (function() { return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} var ${t} = ${Xn(i,e.arguments[0])}; @@ -264,7 +264,7 @@ northing meters`+te;var ir=ki/2,$r=0,mn=0,Kr,xn,Gn,Ds,Fn;return 03)throw new f0(i,wt.WrongNumberOfParameters,e);const t=Tb(i),r=Tb(i),n=Tb(i),s=Tb(i);return e.arguments.length===3?`${i.isAsync?`(yield (function() { + ${i.isAsync?"})}()))":"}()"}`}catch(t){throw t}}function x9r(i,e){try{if(e.arguments.length<2||e.arguments.length>3)throw new f0(i,wt.WrongNumberOfParameters,e);const t=Tb(i),r=Tb(i),n=Tb(i),s=Tb(i);return e.arguments.length===3?`${i.isAsync?`(yield (function() { return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} var ${t} = ${Xn(i,e.arguments[0])}; var ${r} = ${Xn(i,e.arguments[1])}; @@ -341,7 +341,7 @@ northing meters`+te;var ir=ki/2,$r=0,mn=0,Kr,xn,Gn,Ds,Fn;return 0{throw new Mt(i,wt.Unrecognized,e)})}catch(t){throw t}},hm.decode=function(i,e){try{return Ww(i,e,(t,r,n)=>{throw new Mt(i,wt.Unrecognized,e)})}catch(t){throw t}},hm.when=function(i,e){try{return Ww(i,e,(t,r,n)=>{throw new Mt(i,wt.Unrecognized,e)})}catch(t){throw t}},hm.defaultvalue=function(i,e){try{return Ww(i,e,(t,r,n)=>{throw new Mt(i,wt.Unrecognized,e)})}catch(t){throw t}};const yq={};for(const i in hm)yq[i]=new T3(hm[i]);x9t(hm,Ww);for(const i in hm)hm[i]=new T3(hm[i]);const dXe=function(){};dXe.prototype=hm;const pXe=function(){};function M9t(i,e,t){const r={};i||(i={}),t||(t={}),r._SymbolsMap={},r.textformatting=1,r.infinity=1,r.pi=1;for(const n in e)r[n]=1;for(const n in t)r[n]=1;for(const n in i)r[n]=1;return r}function O9t(i,e,t,r){const n=t?new pXe:new dXe;i||(i={}),e||(e={});const s=new vn({newline:` -`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,n._SymbolsMap={textformatting:1,infinity:1,pi:1},n.textformatting=s,n.infinity=Number.POSITIVE_INFINITY,n.pi=Math.PI;for(const o in e)n[o]=e[o],n._SymbolsMap[o]=1;for(const o in i)n._SymbolsMap[o]=1,i[o]&&i[o].declaredClass==="esri.Graphic"?n[o]=Lc.createFromGraphic(i[o],r??null):n[o]=i[o];return n}pXe.prototype=yq;function AB(i,e){const t={mode:e,compiled:!0,functions:{},signatures:[],standardFunction:Ww,standardFunctionAsync:Ww,evaluateIdentifier:A9r};for(let r=0;r0){if(t.substr(0,2).toLowerCase()!=="_t"&&i.localStack[i.localStack.length-1][t]!==void 0)return i.localStack[i.localStack.length-1][t];const n=i.mangleMap[t];if(n!==void 0&&i.localStack[i.localStack.length-1][n]!==void 0)return i.localStack[i.localStack.length-1][n]}if(t.substr(0,2).toLowerCase()!=="_t"&&i.globalScope[t]!==void 0||i.globalScope._SymbolsMap[t]===1)return i.globalScope[t];const r=i.mangleMap[t];return r!==void 0?i.globalScope[r]:void 0}AB([Z_e],"sync"),AB([Z_e],"async");let IOe=0;const P9t={isNumber:i=>uo(i),isArray:i=>cn(i),isImmutableArray:i=>Jn(i),isFeature:i=>Sl(i),isString:i=>Jr(i),isDictionary:i=>RTe(i),isGeometry:i=>tX(i),geometryMember:(i,e,t,r,n=1)=>tE(i,e,t,r,n),error(i){throw new Mt(null,i,null)},__awaiter:(i,e,t,r)=>new Promise((n,s)=>{function o(u){try{l(r.next(u))}catch(c){s(c)}}function a(u){try{l(r.throw(u))}catch(c){s(c)}}function l(u){u.done?n(u.value):u.value?.then?u.value.then(o,a):(IOe++,IOe%100==0?setTimeout(()=>{IOe=0,o(u.value)},0):o(u.value))}l((r=r.apply(i,e||[])).next())}),functionDepthchecker:(i,e)=>function(){if(e.depthCounter.depth++,e.localStack.push([]),e.depthCounter.depth>64)throw new Mt(null,wt.MaximumCallDepth,null);const t=i.apply(this,arguments);return qp(t)?t.then(r=>(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,r)):(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,t)},chkAssig(i,e){if(e.gdefs[i]===void 0)throw new Mt(e,wt.InvalidIdentifier,null);return i},mustBoolean(i,e){if(i===!0||i===!1)return i;throw new Mt(e,wt.BooleanConditionRequired,null)},setAssig:(i,e)=>(e.gdefs[i]=1,i),castString:i=>en(i),aCheck(i,e){if(mu(i))throw e==="ArrayExpression"?new Mt(null,wt.NoFunctionInArray,null):e==="ObjectExpression"?new Mt(null,wt.NoFunctionInDictionary,null):new Mt(null,wt.NoFunctionInTemplateLiteral,null);return i===nn?null:i},Dictionary:vn,Feature:Lc,UserDefinedCompiledFunction:t9r,dictionary(i){const e={},t=new Map;for(let n=0;n>":case">>>":case"^":case"&":return LTe(Ai(i),Ai(e),t);case"==":case"=":return a_(i,e);case"!=":return!a_(i,e);case"<":case">":case"<=":case">=":return kTe(i,e,t);case"+":return Jr(i)||Jr(e)?en(i)+en(e):Ai(i)+Ai(e);case"-":return Ai(i)-Ai(e);case"*":return Ai(i)*Ai(e);case"/":return Ai(i)/Ai(e);case"%":return Ai(i)%Ai(e);default:throw new Mt(null,wt.UnsupportedOperator,null)}},assign(i,e,t){switch(e){case"=":return i===nn?null:i;case"/=":return Ai(t)/Ai(i);case"*=":return Ai(t)*Ai(i);case"-=":return Ai(t)-Ai(i);case"+=":return Jr(t)||Jr(i)?en(t)+en(i):Ai(t)+Ai(i);case"%=":return Ai(t)%Ai(i);default:throw new Mt(null,wt.UnsupportedOperator,null)}},update(i,e,t,r){const n=Ai(i[e]);return i[e]=t==="++"?n+1:n-1,r===!1?n:t==="++"?n+1:n-1},graphicToFeature:(i,e,t)=>i===null?null:Lc.createFromGraphicLikeObject(i.geometry,i.attributes,e,t.timeZone),memberupdate(i,e,t,r){let n;if(cn(i)){if(!uo(e))throw new Mt(null,wt.ArrayAccessorMustBeNumber,null);if(e<0&&(e=i.length+e),e<0||e>=i.length)throw new Mt(null,wt.OutOfBounds,null);n=Ai(i[e]),i[e]=t==="++"?n+1:n-1}else if(i instanceof vn){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)!==!0)throw new Mt(null,wt.FieldNotFound,null,{key:e});n=Ai(i.field(e)),i.setField(e,t==="++"?n+1:n-1)}else if(Sl(i)){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)!==!0)throw new Mt(null,wt.FieldNotFound,null);n=Ai(i.field(e)),i.setField(e,t==="++"?n+1:n-1)}else{if(Jn(i))throw new Mt(null,wt.Immutable,null);if(!(i instanceof tee))throw new Mt(null,wt.InvalidIdentifier,null);if(Jr(e)===!1)throw new Mt(null,wt.ModuleAccessorMustBeString,null);if(i.hasGlobal(e)!==!0)throw new Mt(null,wt.ModuleExportNotFound,null);n=Ai(i.global(e)),i.setGlobal(e,t==="++"?n+1:n-1)}return r===!1?n:t==="++"?n+1:n-1},assignmember(i,e,t,r){if(cn(i)){if(!uo(e))throw new Mt(null,wt.ArrayAccessorMustBeNumber,null);if(e<0&&(e=i.length+e),e<0||e>i.length)throw new Mt(null,wt.OutOfBounds,null);if(e===i.length){if(t!=="=")throw new Mt(null,wt.OutOfBounds,null);i[e]=this.assign(r,t,i[e])}else i[e]=this.assign(r,t,i[e])}else if(i instanceof vn){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)===!0)i.setField(e,this.assign(r,t,i.field(e)));else{if(t!=="=")throw new Mt(null,wt.FieldNotFound,null);i.setField(e,this.assign(r,t,null))}}else if(Sl(i)){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)===!0)i.setField(e,this.assign(r,t,i.field(e)));else{if(t!=="=")throw new Mt(null,wt.FieldNotFound,null);i.setField(e,this.assign(r,t,null))}}else{if(Jn(i))throw new Mt(null,wt.Immutable,null);if(!(i instanceof tee))throw new Mt(null,wt.InvalidIdentifier,null);if(Jr(e)===!1)throw new Mt(null,wt.ModuleAccessorMustBeString,null);if(!i.hasGlobal(e))throw new Mt(null,wt.ModuleExportNotFound,null);i.setGlobal(e,this.assign(r,t,i.global(e)))}},member(i,e){if(i===null)throw new Mt(null,wt.MemberOfNull,null);if(i instanceof vn||Sl(i)){if(Jr(e))return i.field(e);throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(i instanceof Nr){if(Jr(e))return tE(i,e,null,null);throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(cn(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length+e),e>=i.length||e<0)throw new Mt(null,wt.OutOfBounds,null);return i[e]}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(Jr(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length+e),e>=i.length||e<0)throw new Mt(null,wt.OutOfBounds,null);return i[e]}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(Jn(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length()+e),e>=i.length()||e<0)throw new Mt(null,wt.OutOfBounds,null);return i.get(e)}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(i instanceof tee){if(Jr(e))return i.global(e);throw new Mt(null,wt.InvalidMemberAccessKey,null)}throw new Mt(null,wt.InvalidMemberAccessKey,null)},callfunc:(i,e,t)=>i.call(t,{arguments:e,preparsed:!0}),loadModule(i,e){const t=e.moduleFactoryMap[i];if(e.moduleSingletons[t])return e.moduleSingletons[t];const r=e.moduleFactory[t]({vars:{},moduleSingletons:e.moduleSingletons,depthCounter:e.depthCounter,console:e.console,abortSignal:e.abortSignal,isAsync:e.isAsync,services:e.services,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor},e.spatialReference);return e.moduleSingletons[t]=r,r},callModuleFunction(i,e,t,r){if(!(i instanceof tee))throw new Mt(null,wt.FunctionNotFound,null);const n=i.global(t);if(mu(n)===!1)throw new Mt(null,wt.CallNonFunction,null);return n.call(r,{preparsed:!0,arguments:e})}};function tbe(i){console.log(i)}function R9t(i,e,t=!1){e===null&&(e={vars:{},customfunctions:{}});let r=null;i.usesModules&&(r=new eX(null,i.loadedModules));const n={isAsync:t,globalScope:M9t(e.vars,t?yq:hm,e.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:e.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:tbe,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let s=Xn(n,i);s===""&&(s="lc.voidOperation; "),n.undeclaredGlobalsInFunctions.size>0&&n.undeclaredGlobalsInFunctions.forEach(p=>{throw new f0(e,wt.InvalidIdentifier,p.node)});let o="";o=t?`var runtimeCtx=this.prepare(context, true); +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});s.immutable=!1,n._SymbolsMap={textformatting:1,infinity:1,pi:1},n.textformatting=s,n.infinity=Number.POSITIVE_INFINITY,n.pi=Math.PI;for(const o in e)n[o]=e[o],n._SymbolsMap[o]=1;for(const o in i)n._SymbolsMap[o]=1,i[o]&&i[o].declaredClass==="esri.Graphic"?n[o]=Lc.createFromGraphic(i[o],r??null):n[o]=i[o];return n}pXe.prototype=yq;function AB(i,e){const t={mode:e,compiled:!0,functions:{},signatures:[],standardFunction:Ww,standardFunctionAsync:Ww,evaluateIdentifier:C9r};for(let r=0;r0){if(t.substr(0,2).toLowerCase()!=="_t"&&i.localStack[i.localStack.length-1][t]!==void 0)return i.localStack[i.localStack.length-1][t];const n=i.mangleMap[t];if(n!==void 0&&i.localStack[i.localStack.length-1][n]!==void 0)return i.localStack[i.localStack.length-1][n]}if(t.substr(0,2).toLowerCase()!=="_t"&&i.globalScope[t]!==void 0||i.globalScope._SymbolsMap[t]===1)return i.globalScope[t];const r=i.mangleMap[t];return r!==void 0?i.globalScope[r]:void 0}AB([Z_e],"sync"),AB([Z_e],"async");let IOe=0;const P9t={isNumber:i=>uo(i),isArray:i=>cn(i),isImmutableArray:i=>Jn(i),isFeature:i=>Sl(i),isString:i=>Jr(i),isDictionary:i=>RTe(i),isGeometry:i=>tX(i),geometryMember:(i,e,t,r,n=1)=>tE(i,e,t,r,n),error(i){throw new Mt(null,i,null)},__awaiter:(i,e,t,r)=>new Promise((n,s)=>{function o(u){try{l(r.next(u))}catch(c){s(c)}}function a(u){try{l(r.throw(u))}catch(c){s(c)}}function l(u){u.done?n(u.value):u.value?.then?u.value.then(o,a):(IOe++,IOe%100==0?setTimeout(()=>{IOe=0,o(u.value)},0):o(u.value))}l((r=r.apply(i,e||[])).next())}),functionDepthchecker:(i,e)=>function(){if(e.depthCounter.depth++,e.localStack.push([]),e.depthCounter.depth>64)throw new Mt(null,wt.MaximumCallDepth,null);const t=i.apply(this,arguments);return qp(t)?t.then(r=>(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,r)):(e.depthCounter.depth--,e.localStack.length=e.localStack.length-1,t)},chkAssig(i,e){if(e.gdefs[i]===void 0)throw new Mt(e,wt.InvalidIdentifier,null);return i},mustBoolean(i,e){if(i===!0||i===!1)return i;throw new Mt(e,wt.BooleanConditionRequired,null)},setAssig:(i,e)=>(e.gdefs[i]=1,i),castString:i=>en(i),aCheck(i,e){if(mu(i))throw e==="ArrayExpression"?new Mt(null,wt.NoFunctionInArray,null):e==="ObjectExpression"?new Mt(null,wt.NoFunctionInDictionary,null):new Mt(null,wt.NoFunctionInTemplateLiteral,null);return i===nn?null:i},Dictionary:vn,Feature:Lc,UserDefinedCompiledFunction:Z8r,dictionary(i){const e={},t=new Map;for(let n=0;n>":case">>>":case"^":case"&":return LTe(Ai(i),Ai(e),t);case"==":case"=":return a_(i,e);case"!=":return!a_(i,e);case"<":case">":case"<=":case">=":return kTe(i,e,t);case"+":return Jr(i)||Jr(e)?en(i)+en(e):Ai(i)+Ai(e);case"-":return Ai(i)-Ai(e);case"*":return Ai(i)*Ai(e);case"/":return Ai(i)/Ai(e);case"%":return Ai(i)%Ai(e);default:throw new Mt(null,wt.UnsupportedOperator,null)}},assign(i,e,t){switch(e){case"=":return i===nn?null:i;case"/=":return Ai(t)/Ai(i);case"*=":return Ai(t)*Ai(i);case"-=":return Ai(t)-Ai(i);case"+=":return Jr(t)||Jr(i)?en(t)+en(i):Ai(t)+Ai(i);case"%=":return Ai(t)%Ai(i);default:throw new Mt(null,wt.UnsupportedOperator,null)}},update(i,e,t,r){const n=Ai(i[e]);return i[e]=t==="++"?n+1:n-1,r===!1?n:t==="++"?n+1:n-1},graphicToFeature:(i,e,t)=>i===null?null:Lc.createFromGraphicLikeObject(i.geometry,i.attributes,e,t.timeZone),memberupdate(i,e,t,r){let n;if(cn(i)){if(!uo(e))throw new Mt(null,wt.ArrayAccessorMustBeNumber,null);if(e<0&&(e=i.length+e),e<0||e>=i.length)throw new Mt(null,wt.OutOfBounds,null);n=Ai(i[e]),i[e]=t==="++"?n+1:n-1}else if(i instanceof vn){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)!==!0)throw new Mt(null,wt.FieldNotFound,null,{key:e});n=Ai(i.field(e)),i.setField(e,t==="++"?n+1:n-1)}else if(Sl(i)){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)!==!0)throw new Mt(null,wt.FieldNotFound,null);n=Ai(i.field(e)),i.setField(e,t==="++"?n+1:n-1)}else{if(Jn(i))throw new Mt(null,wt.Immutable,null);if(!(i instanceof tee))throw new Mt(null,wt.InvalidIdentifier,null);if(Jr(e)===!1)throw new Mt(null,wt.ModuleAccessorMustBeString,null);if(i.hasGlobal(e)!==!0)throw new Mt(null,wt.ModuleExportNotFound,null);n=Ai(i.global(e)),i.setGlobal(e,t==="++"?n+1:n-1)}return r===!1?n:t==="++"?n+1:n-1},assignmember(i,e,t,r){if(cn(i)){if(!uo(e))throw new Mt(null,wt.ArrayAccessorMustBeNumber,null);if(e<0&&(e=i.length+e),e<0||e>i.length)throw new Mt(null,wt.OutOfBounds,null);if(e===i.length){if(t!=="=")throw new Mt(null,wt.OutOfBounds,null);i[e]=this.assign(r,t,i[e])}else i[e]=this.assign(r,t,i[e])}else if(i instanceof vn){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)===!0)i.setField(e,this.assign(r,t,i.field(e)));else{if(t!=="=")throw new Mt(null,wt.FieldNotFound,null);i.setField(e,this.assign(r,t,null))}}else if(Sl(i)){if(Jr(e)===!1)throw new Mt(null,wt.KeyAccessorMustBeString,null);if(i.hasField(e)===!0)i.setField(e,this.assign(r,t,i.field(e)));else{if(t!=="=")throw new Mt(null,wt.FieldNotFound,null);i.setField(e,this.assign(r,t,null))}}else{if(Jn(i))throw new Mt(null,wt.Immutable,null);if(!(i instanceof tee))throw new Mt(null,wt.InvalidIdentifier,null);if(Jr(e)===!1)throw new Mt(null,wt.ModuleAccessorMustBeString,null);if(!i.hasGlobal(e))throw new Mt(null,wt.ModuleExportNotFound,null);i.setGlobal(e,this.assign(r,t,i.global(e)))}},member(i,e){if(i===null)throw new Mt(null,wt.MemberOfNull,null);if(i instanceof vn||Sl(i)){if(Jr(e))return i.field(e);throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(i instanceof Nr){if(Jr(e))return tE(i,e,null,null);throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(cn(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length+e),e>=i.length||e<0)throw new Mt(null,wt.OutOfBounds,null);return i[e]}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(Jr(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length+e),e>=i.length||e<0)throw new Mt(null,wt.OutOfBounds,null);return i[e]}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(Jn(i)){if(uo(e)&&isFinite(e)&&Math.floor(e)===e){if(e<0&&(e=i.length()+e),e>=i.length()||e<0)throw new Mt(null,wt.OutOfBounds,null);return i.get(e)}throw new Mt(null,wt.InvalidMemberAccessKey,null)}if(i instanceof tee){if(Jr(e))return i.global(e);throw new Mt(null,wt.InvalidMemberAccessKey,null)}throw new Mt(null,wt.InvalidMemberAccessKey,null)},callfunc:(i,e,t)=>i.call(t,{arguments:e,preparsed:!0}),loadModule(i,e){const t=e.moduleFactoryMap[i];if(e.moduleSingletons[t])return e.moduleSingletons[t];const r=e.moduleFactory[t]({vars:{},moduleSingletons:e.moduleSingletons,depthCounter:e.depthCounter,console:e.console,abortSignal:e.abortSignal,isAsync:e.isAsync,services:e.services,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor},e.spatialReference);return e.moduleSingletons[t]=r,r},callModuleFunction(i,e,t,r){if(!(i instanceof tee))throw new Mt(null,wt.FunctionNotFound,null);const n=i.global(t);if(mu(n)===!1)throw new Mt(null,wt.CallNonFunction,null);return n.call(r,{preparsed:!0,arguments:e})}};function tbe(i){console.log(i)}function R9t(i,e,t=!1){e===null&&(e={vars:{},customfunctions:{}});let r=null;i.usesModules&&(r=new eX(null,i.loadedModules));const n={isAsync:t,globalScope:M9t(e.vars,t?yq:hm,e.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:e.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:tbe,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let s=Xn(n,i);s===""&&(s="lc.voidOperation; "),n.undeclaredGlobalsInFunctions.size>0&&n.undeclaredGlobalsInFunctions.forEach(p=>{throw new f0(e,wt.InvalidIdentifier,p.node)});let o="";o=t?`var runtimeCtx=this.prepare(context, true); var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; return lang.__awaiter(this, void 0, void 0, function* () { @@ -374,7 +374,7 @@ return lang.__awaiter(this, void 0, void 0, function* () { var lastStatement=lc.voidOperation; `+s+` return lastStatement; } - return this.postProcess(mainBody()); `;const a=n.moduleFactory,l=n.moduleFactoryMap,u=n.exports,c={};for(const p in u)c[p]=n.mangleMap[p]!==void 0?n.mangleMap[p]:p;const h={lc:o9t,lang:P9t,mangles:n.mangleMap,postProcess(p){if(p instanceof id&&(p=p.value),p instanceof C3&&(p=p.value),p===nn&&(p=null),p===Mm)throw new Mt(null,wt.IllegalResult,null);if(p===J3)throw new Mt(null,wt.IllegalResult,null);if(mu(p))throw new Mt(null,wt.IllegalResult,null);return p},prepare(p,m){let v=p.spatialReference;v==null&&(v=Xi.WebMercator);const w=O9t(p.vars,p.customfunctions,m,p.timeZone);return{localStack:[],isAsync:m,moduleFactory:a,moduleFactoryMap:l,mangleMap:this.mangles,moduleSingletons:{},exports:u,gdefs:{},exportmangle:c,spatialReference:v,globalScope:w,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??tbe,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(h)}async function M9r(){return AB([await Promise.resolve().then(()=>A8n)],"async"),!0}let tee=class extends QY{constructor(e){super(null),this.moduleContext=e}hasGlobal(e){return this.moduleContext.exports[e]===void 0&&(e=e.toLowerCase()),this.moduleContext.exports[e]!==void 0}setGlobal(e,t){const r=this.moduleContext.globalScope,n=e.toLowerCase();if(mu(t))throw new Mt(null,wt.AssignModuleFunction,null);r[this.moduleContext.exportmangle[n]]=t}global(e){const t=this.moduleContext.globalScope;e=e.toLowerCase();const r=t[this.moduleContext.exportmangle[e]];if(r===void 0)throw new Mt(null,wt.InvalidIdentifier,null);if(mu(r)&&!(r instanceof US)){const n=new US;return n.fn=r,n.parameterEvaluator=Ww,n.context=this.moduleContext,t[this.moduleContext.exportmangle[e]]=n,n}return r}};function O9r(i,e,t=!1){const r={isAsync:t,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new eX(null,i.loadedModules),globalScope:M9t(e.vars,t?yq:hm,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:tbe,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let n=Xn(r,i);n===""&&(n="lc.voidOperation; ");let s="";s=t?`var runtimeCtx=this.prepare(context, true); + return this.postProcess(mainBody()); `;const a=n.moduleFactory,l=n.moduleFactoryMap,u=n.exports,c={};for(const p in u)c[p]=n.mangleMap[p]!==void 0?n.mangleMap[p]:p;const h={lc:o9t,lang:P9t,mangles:n.mangleMap,postProcess(p){if(p instanceof id&&(p=p.value),p instanceof C3&&(p=p.value),p===nn&&(p=null),p===Mm)throw new Mt(null,wt.IllegalResult,null);if(p===J3)throw new Mt(null,wt.IllegalResult,null);if(mu(p))throw new Mt(null,wt.IllegalResult,null);return p},prepare(p,m){let v=p.spatialReference;v==null&&(v=Xi.WebMercator);const w=O9t(p.vars,p.customfunctions,m,p.timeZone);return{localStack:[],isAsync:m,moduleFactory:a,moduleFactoryMap:l,mangleMap:this.mangles,moduleSingletons:{},exports:u,gdefs:{},exportmangle:c,spatialReference:v,globalScope:w,abortSignal:p.abortSignal===void 0||p.abortSignal===null?{aborted:!1}:p.abortSignal,localScope:null,services:p.services,console:p.console??tbe,lrucache:p.lrucache,timeZone:p.timeZone??null,interceptor:p.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(h)}async function E9r(){return AB([await Promise.resolve().then(()=>C8n)],"async"),!0}let tee=class extends QY{constructor(e){super(null),this.moduleContext=e}hasGlobal(e){return this.moduleContext.exports[e]===void 0&&(e=e.toLowerCase()),this.moduleContext.exports[e]!==void 0}setGlobal(e,t){const r=this.moduleContext.globalScope,n=e.toLowerCase();if(mu(t))throw new Mt(null,wt.AssignModuleFunction,null);r[this.moduleContext.exportmangle[n]]=t}global(e){const t=this.moduleContext.globalScope;e=e.toLowerCase();const r=t[this.moduleContext.exportmangle[e]];if(r===void 0)throw new Mt(null,wt.InvalidIdentifier,null);if(mu(r)&&!(r instanceof US)){const n=new US;return n.fn=r,n.parameterEvaluator=Ww,n.context=this.moduleContext,t[this.moduleContext.exportmangle[e]]=n,n}return r}};function I9r(i,e,t=!1){const r={isAsync:t,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new eX(null,i.loadedModules),globalScope:M9t(e.vars,t?yq:hm,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:tbe,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let n=Xn(r,i);n===""&&(n="lc.voidOperation; ");let s="";s=t?`var runtimeCtx=this.prepare(context, true); var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; return lang.__awaiter(this, void 0, void 0, function* () { @@ -391,28 +391,28 @@ return lang.__awaiter(this, void 0, void 0, function* () { `+n+` return lastStatement; } mainBody(); - return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,a=r.moduleFactoryMap,l=r.exports,u={};for(const h in l)u[h]=r.mangleMap[h]!==void 0?r.mangleMap[h]:h;const c={lc:o9t,lang:P9t,mangles:r.mangleMap,prepareModule:h=>new tee(h),prepare(h,p){let m=h.spatialReference;m==null&&(m=new Xi({wkid:102100}));const v=O9t(h.vars,h.customfunctions,p,h.timeZone);return{localStack:[],isAsync:p,exports:l,exportmangle:u,gdefs:{},moduleFactory:o,moduleFactoryMap:a,moduleSingletons:h.moduleSingletons,mangleMap:this.mangles,spatialReference:m,globalScope:v,abortSignal:h.abortSignal===void 0||h.abortSignal===null?{aborted:!1}:h.abortSignal,localScope:null,services:h.services,console:h.console??tbe,lrucache:h.lrucache,timeZone:h.timeZone??null,interceptor:h.interceptor,symbols:{symbolCounter:0},depthCounter:h.depthCounter}}};return new Function("context","spatialReference",s).bind(c)}var Na,ws;(function(i){i.Break="break",i.Continue="continue",i.Else="else",i.False="false",i.For="for",i.From="from",i.Function="function",i.If="if",i.Import="import",i.Export="export",i.In="in",i.Null="null",i.Return="return",i.True="true",i.Var="var",i.While="while"})(Na||(Na={})),function(i){i.AssignmentExpression="AssignmentExpression",i.ArrayExpression="ArrayExpression",i.BlockComment="BlockComment",i.BlockStatement="BlockStatement",i.BinaryExpression="BinaryExpression",i.BreakStatement="BreakStatement",i.CallExpression="CallExpression",i.ContinueStatement="ContinueStatement",i.EmptyStatement="EmptyStatement",i.ExpressionStatement="ExpressionStatement",i.ExportNamedDeclaration="ExportNamedDeclaration",i.ExportSpecifier="ExportSpecifier",i.ForStatement="ForStatement",i.ForInStatement="ForInStatement",i.FunctionDeclaration="FunctionDeclaration",i.Identifier="Identifier",i.IfStatement="IfStatement",i.ImportDeclaration="ImportDeclaration",i.ImportDefaultSpecifier="ImportDefaultSpecifier",i.LineComment="LineComment",i.Literal="Literal",i.LogicalExpression="LogicalExpression",i.MemberExpression="MemberExpression",i.ObjectExpression="ObjectExpression",i.Program="Program",i.Property="Property",i.ReturnStatement="ReturnStatement",i.TemplateElement="TemplateElement",i.TemplateLiteral="TemplateLiteral",i.UnaryExpression="UnaryExpression",i.UpdateExpression="UpdateExpression",i.VariableDeclaration="VariableDeclaration",i.VariableDeclarator="VariableDeclarator",i.WhileStatement="WhileStatement"}(ws||(ws={}));const w6e=["++","--"],D9t=["-","+","!","~"],F9t=["=","/=","*=","%=","+=","-="],k9t=["||","&&"],P9r=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],R9r={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var Fs;(function(i){i[i.Unknown=0]="Unknown",i[i.BooleanLiteral=1]="BooleanLiteral",i[i.EOF=2]="EOF",i[i.Identifier=3]="Identifier",i[i.Keyword=4]="Keyword",i[i.NullLiteral=5]="NullLiteral",i[i.NumericLiteral=6]="NumericLiteral",i[i.Punctuator=7]="Punctuator",i[i.StringLiteral=8]="StringLiteral",i[i.Template=10]="Template"})(Fs||(Fs={}));const D9r=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var ps;(function(i){i.InvalidModuleUri="InvalidModuleUri",i.ForInOfLoopInitializer="ForInOfLoopInitializer",i.IdentiferExpected="IdentiferExpected",i.InvalidEscapedReservedWord="InvalidEscapedReservedWord",i.InvalidExpression="InvalidExpression",i.InvalidFunctionIdentifier="InvalidFunctionIdentifier",i.InvalidHexEscapeSequence="InvalidHexEscapeSequence",i.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",i.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",i.InvalidTemplateHead="InvalidTemplateHead",i.InvalidVariableAssignment="InvalidVariableAssignment",i.KeyMustBeString="KeyMustBeString",i.NoFunctionInsideBlock="NoFunctionInsideBlock",i.NoFunctionInsideFunction="NoFunctionInsideFunction",i.ModuleExportRootOnly="ModuleExportRootOnly",i.ModuleImportRootOnly="ModuleImportRootOnly",i.PunctuatorExpected="PunctuatorExpected",i.TemplateOctalLiteral="TemplateOctalLiteral",i.UnexpectedBoolean="UnexpectedBoolean",i.UnexpectedEndOfScript="UnexpectedEndOfScript",i.UnexpectedIdentifier="UnexpectedIdentifier",i.UnexpectedKeyword="UnexpectedKeyword",i.UnexpectedNull="UnexpectedNull",i.UnexpectedNumber="UnexpectedNumber",i.UnexpectedPunctuator="UnexpectedPunctuator",i.UnexpectedString="UnexpectedString",i.UnexpectedTemplate="UnexpectedTemplate",i.UnexpectedToken="UnexpectedToken"})(ps||(ps={}));const F9r={[ps.InvalidModuleUri]:"Module uri must be a text literal.",[ps.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[ps.IdentiferExpected]:"'${value}' is an invalid identifier.",[ps.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[ps.InvalidExpression]:"Invalid expression.",[ps.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[ps.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[ps.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[ps.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[ps.InvalidTemplateHead]:"Invalid template structure.",[ps.InvalidVariableAssignment]:"Invalid variable assignment.",[ps.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[ps.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[ps.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[ps.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[ps.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[ps.PunctuatorExpected]:"'${value}' expected.",[ps.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[ps.UnexpectedBoolean]:"Unexpected boolean literal.",[ps.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[ps.UnexpectedIdentifier]:"Unexpected identifier.",[ps.UnexpectedKeyword]:"Unexpected keyword.",[ps.UnexpectedNull]:"Unexpected null literal.",[ps.UnexpectedNumber]:"Unexpected number.",[ps.UnexpectedPunctuator]:"Unexpected ponctuator.",[ps.UnexpectedString]:"Unexpected text literal.",[ps.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[ps.UnexpectedToken]:"Unexpected token '${value}'."};let Use=class L9t extends Error{constructor({code:e,index:t,line:r,column:n,len:s=0,description:o,data:a}){super(`${o??e}`),this.declaredRootClass="esri.arcade.lib.parsingerror",this.name="ParsingError",this.code=e,this.index=t,this.line=r,this.column=n,this.len=s,this.data=a,this.description=o,this.range={start:{line:r,column:n-1},end:{line:r,column:n+s}},Error.captureStackTrace?.(this,L9t)}};function k9r(i){return i?.type===ws.Program}function Wdt(i){return i?.type===ws.BlockStatement}function L9r(i){return i?.type===ws.BlockComment}function N9r(i){return i?.type===ws.EmptyStatement}function $9r(i){return i?.type===ws.VariableDeclarator}function AOe(i,e){return!!e&&e.loc.end.line===i.loc.start.line&&e.loc.end.column<=i.loc.start.column}function qdt(i,e){return i.range[0]>=e.range[0]&&i.range[1]<=e.range[1]}let B9r=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!Wdt(e)||e.body.length!==0)return;const t=[];for(let r=this._newComments.length-1;r>=0;--r){const n=this._newComments[r];e.range[1]>=n.range[0]&&(t.unshift(n),this._newComments.splice(r,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){if(!e)return;const t=this._nodeStack[this._nodeStack.length-1];if(Wdt(e)&&qdt(t,e))for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];qdt(s,e)&&(t.trailingComments=[...t.trailingComments??[],s],this._newComments.splice(n,1))}let r=[];if(this._newComments.length>0)for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];AOe(s,t)?(t.trailingComments=[...t.trailingComments??[],s],this._newComments.splice(n,1)):AOe(s,e)&&(r.unshift(s),this._newComments.splice(n,1))}t?.trailingComments&&AOe(t.trailingComments[0],e)&&(r=[...r,...t.trailingComments],delete t.trailingComments),r.length>0&&(e.trailingComments=r)}attachLeadingComments(e){if(!e)return;let t;for(;this._nodeStack.length>0;){const s=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=s.range[0]))break;t=s,this._nodeStack.pop()}const r=[],n=[];if(t){for(let s=(t.leadingComments?.length??0)-1;s>=0;--s){const o=t.leadingComments[s];e.range[0]>=o.range[1]?(r.unshift(o),t.leadingComments.splice(s,1)):$9r(e)&&!L9r(o)&&(n.unshift(o),t.leadingComments.splice(s,1))}return t.leadingComments?.length===0&&delete t.leadingComments,r.length&&(e.leadingComments=r),void(n.length&&(e.trailingComments=[...n,...e.trailingComments??[]]))}for(let s=this._newComments.length-1;s>=0;--s){const o=this._newComments[s];e.range[0]>=o.range[0]&&(r.unshift(o),this._newComments.splice(s,1))}r.length&&(e.leadingComments=r)}attachComments(e){if(k9r(e)&&e.body.length>0){const t=this._nodeStack[this._nodeStack.length-1];return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}};function x6e(i,e){const t=F9r[i];return e?t.replaceAll(/\${(.*?)}/g,(r,n)=>e[n]?.toString()??""):t}let j9r=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description=e.description??x6e(e.code,e.data),new Use(e)}tolerateError(e){e.description=e.description??x6e(e.code,e.data);const t=new Use(e);if(!this.tolerant)throw t;this.recordError(t)}};function Ydt(i,e){if(!i)throw new Error("ASSERT: "+e)}const Xdt={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},yl={fromCodePoint:i=>i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023)),isWhiteSpace:i=>i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(i),isLineTerminator:i=>i===10||i===13||i===8232||i===8233,isIdentifierStart:i=>i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&Xdt.NonAsciiIdentifierStart.test(yl.fromCodePoint(i)),isIdentifierPart:i=>i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&Xdt.NonAsciiIdentifierPart.test(yl.fromCodePoint(i)),isDecimalDigit:i=>i>=48&&i<=57,isHexDigit:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102,isOctalDigit:i=>i>=48&&i<=55};function Jdt(i){return"0123456789abcdef".indexOf(i.toLowerCase())}function MOe(i){return"01234567".indexOf(i)}const j6=[[],[],[]];w6e.forEach(i=>j6[i.length-1].push(i)),D9t.forEach(i=>j6[i.length-1].push(i)),k9t.forEach(i=>j6[i.length-1].push(i)),F9t.forEach(i=>j6[i.length-1].push(i)),P9r.forEach(i=>j6[i.length-1].push(i));let G9r=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=ps.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(e=ps.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const t=[],r=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){const s=this.source.charCodeAt(this.index);if(++this.index,yl.isLineTerminator(s)){if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};const o={multiLine:!1,start:r+e,end:this.index-1,range:[r,this.index-1],loc:n};t.push(o)}return s===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart};const s={multiLine:!1,start:r+e,end:this.index,range:[r,this.index],loc:n};t.push(s)}return t}skipMultiLineComment(){const e=[],t=this.index-2,r={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(yl.isLineTerminator(n))n===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(n===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:r};e.push(s)}return e}++this.index}else++this.index}if(r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const n={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:r};e.push(n)}return this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(yl.isWhiteSpace(t))++this.index;else if(yl.isLineTerminator(t))++this.index,t===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;const r=this.skipSingleLineComment(2);e=[...e,...r]}else{if(t!==42)break;{this.index+=2;const r=this.skipMultiLineComment();e=[...e,...r]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===Na.If||e===Na.In;case 3:return e===Na.Var||e===Na.For;case 4:return e===Na.Else;case 5:return e===Na.Break||e===Na.While;case 6:return e===Na.Return||e===Na.Import||e===Na.Export;case 8:return e===Na.Function||e===Na.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(t=1024*(t-55296)+r-56320+65536)}return t}scanHexEscape(e){const t=e==="u"?4:2;let r=0;for(let n=0;n1114111||e!=="}")&&this.throwUnexpectedToken(),yl.fromCodePoint(t)}getIdentifier(){const e=this.index++;for(;!this.eof();){const t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!yl.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),r=yl.fromCodePoint(t);for(this.index+=r.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),e!==null&&e!=="\\"&&yl.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken()),r=e);!this.eof()&&(t=this.codePointAt(this.index),yl.isIdentifierPart(t));)e=yl.fromCodePoint(t),r+=e,this.index+=e.length,t===92&&(r=r.substring(0,r.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),e!==null&&e!=="\\"&&yl.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken()),r+=e);return r}octalToDecimal(e){let t=e!=="0",r=MOe(e);return!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,r=8*r+MOe(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+MOe(this.source[this.index++]))),{code:r,octal:t}}scanIdentifier(){let e;const t=this.index,r=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=r.length===1?Fs.Identifier:this.isKeyword(r)?Fs.Keyword:r.toLowerCase()===Na.Null?Fs.NullLiteral:r.toLowerCase()===Na.True||r.toLowerCase()===Na.False?Fs.BooleanLiteral:Fs.Identifier,e!==Fs.Identifier&&t+r.length!==this.index){const n=this.index;this.index=t,this.tolerateUnexpectedToken(ps.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){const e=this.index;let t=this.source[this.index];switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:for(let r=j6.length;r>0;r--)if(t=this.source.substring(this.index,this.index+r),j6[r-1].includes(t)){this.index+=r;break}}return this.index===e&&this.throwUnexpectedToken(),{type:Fs.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&yl.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return t.length===0&&this.throwUnexpectedToken(),yl.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;t+=this.source[this.index++]}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(yl.isIdentifierStart(r)||yl.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:Fs.NumericLiteral,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let r="",n=!1;for(yl.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||r.length!==0||this.throwUnexpectedToken(),(yl.isIdentifierStart(this.source.charCodeAt(this.index))||yl.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){const e=this.index;let t=this.source[e];Ydt(yl.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(t!=="."){if(r=this.source[this.index++],t=this.source[this.index],r==="0"){if(t==="x"||t==="X")return++this.index,this.scanHexLiteral(e);if(t==="b"||t==="B")return++this.index,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if(t==="."){for(r+=this.source[this.index++];yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if(t==="e"||t==="E")if(r+=this.source[this.index++],t=this.source[this.index],t!=="+"&&t!=="-"||(r+=this.source[this.index++]),yl.isDecimalDigit(this.source.charCodeAt(this.index)))for(;yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return yl.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let t=this.source[e];Ydt(t==="'"||t==='"',"String literal must starts with a quote"),++this.index;let r=!1,n="";for(;!this.eof();){let s=this.source[this.index++];if(s===t){t="";break}if(s==="\\")if(s=this.source[this.index++],s&&yl.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,s==="\r"&&this.source[this.index]===` + return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,a=r.moduleFactoryMap,l=r.exports,u={};for(const h in l)u[h]=r.mangleMap[h]!==void 0?r.mangleMap[h]:h;const c={lc:o9t,lang:P9t,mangles:r.mangleMap,prepareModule:h=>new tee(h),prepare(h,p){let m=h.spatialReference;m==null&&(m=new Xi({wkid:102100}));const v=O9t(h.vars,h.customfunctions,p,h.timeZone);return{localStack:[],isAsync:p,exports:l,exportmangle:u,gdefs:{},moduleFactory:o,moduleFactoryMap:a,moduleSingletons:h.moduleSingletons,mangleMap:this.mangles,spatialReference:m,globalScope:v,abortSignal:h.abortSignal===void 0||h.abortSignal===null?{aborted:!1}:h.abortSignal,localScope:null,services:h.services,console:h.console??tbe,lrucache:h.lrucache,timeZone:h.timeZone??null,interceptor:h.interceptor,symbols:{symbolCounter:0},depthCounter:h.depthCounter}}};return new Function("context","spatialReference",s).bind(c)}var Na,ws;(function(i){i.Break="break",i.Continue="continue",i.Else="else",i.False="false",i.For="for",i.From="from",i.Function="function",i.If="if",i.Import="import",i.Export="export",i.In="in",i.Null="null",i.Return="return",i.True="true",i.Var="var",i.While="while"})(Na||(Na={})),function(i){i.AssignmentExpression="AssignmentExpression",i.ArrayExpression="ArrayExpression",i.BlockComment="BlockComment",i.BlockStatement="BlockStatement",i.BinaryExpression="BinaryExpression",i.BreakStatement="BreakStatement",i.CallExpression="CallExpression",i.ContinueStatement="ContinueStatement",i.EmptyStatement="EmptyStatement",i.ExpressionStatement="ExpressionStatement",i.ExportNamedDeclaration="ExportNamedDeclaration",i.ExportSpecifier="ExportSpecifier",i.ForStatement="ForStatement",i.ForInStatement="ForInStatement",i.FunctionDeclaration="FunctionDeclaration",i.Identifier="Identifier",i.IfStatement="IfStatement",i.ImportDeclaration="ImportDeclaration",i.ImportDefaultSpecifier="ImportDefaultSpecifier",i.LineComment="LineComment",i.Literal="Literal",i.LogicalExpression="LogicalExpression",i.MemberExpression="MemberExpression",i.ObjectExpression="ObjectExpression",i.Program="Program",i.Property="Property",i.ReturnStatement="ReturnStatement",i.TemplateElement="TemplateElement",i.TemplateLiteral="TemplateLiteral",i.UnaryExpression="UnaryExpression",i.UpdateExpression="UpdateExpression",i.VariableDeclaration="VariableDeclaration",i.VariableDeclarator="VariableDeclarator",i.WhileStatement="WhileStatement"}(ws||(ws={}));const w6e=["++","--"],D9t=["-","+","!","~"],F9t=["=","/=","*=","%=","+=","-="],k9t=["||","&&"],A9r=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],M9r={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var Fs;(function(i){i[i.Unknown=0]="Unknown",i[i.BooleanLiteral=1]="BooleanLiteral",i[i.EOF=2]="EOF",i[i.Identifier=3]="Identifier",i[i.Keyword=4]="Keyword",i[i.NullLiteral=5]="NullLiteral",i[i.NumericLiteral=6]="NumericLiteral",i[i.Punctuator=7]="Punctuator",i[i.StringLiteral=8]="StringLiteral",i[i.Template=10]="Template"})(Fs||(Fs={}));const O9r=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var ps;(function(i){i.InvalidModuleUri="InvalidModuleUri",i.ForInOfLoopInitializer="ForInOfLoopInitializer",i.IdentiferExpected="IdentiferExpected",i.InvalidEscapedReservedWord="InvalidEscapedReservedWord",i.InvalidExpression="InvalidExpression",i.InvalidFunctionIdentifier="InvalidFunctionIdentifier",i.InvalidHexEscapeSequence="InvalidHexEscapeSequence",i.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",i.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",i.InvalidTemplateHead="InvalidTemplateHead",i.InvalidVariableAssignment="InvalidVariableAssignment",i.KeyMustBeString="KeyMustBeString",i.NoFunctionInsideBlock="NoFunctionInsideBlock",i.NoFunctionInsideFunction="NoFunctionInsideFunction",i.ModuleExportRootOnly="ModuleExportRootOnly",i.ModuleImportRootOnly="ModuleImportRootOnly",i.PunctuatorExpected="PunctuatorExpected",i.TemplateOctalLiteral="TemplateOctalLiteral",i.UnexpectedBoolean="UnexpectedBoolean",i.UnexpectedEndOfScript="UnexpectedEndOfScript",i.UnexpectedIdentifier="UnexpectedIdentifier",i.UnexpectedKeyword="UnexpectedKeyword",i.UnexpectedNull="UnexpectedNull",i.UnexpectedNumber="UnexpectedNumber",i.UnexpectedPunctuator="UnexpectedPunctuator",i.UnexpectedString="UnexpectedString",i.UnexpectedTemplate="UnexpectedTemplate",i.UnexpectedToken="UnexpectedToken"})(ps||(ps={}));const P9r={[ps.InvalidModuleUri]:"Module uri must be a text literal.",[ps.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[ps.IdentiferExpected]:"'${value}' is an invalid identifier.",[ps.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[ps.InvalidExpression]:"Invalid expression.",[ps.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[ps.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[ps.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[ps.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[ps.InvalidTemplateHead]:"Invalid template structure.",[ps.InvalidVariableAssignment]:"Invalid variable assignment.",[ps.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[ps.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[ps.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[ps.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[ps.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[ps.PunctuatorExpected]:"'${value}' expected.",[ps.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[ps.UnexpectedBoolean]:"Unexpected boolean literal.",[ps.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[ps.UnexpectedIdentifier]:"Unexpected identifier.",[ps.UnexpectedKeyword]:"Unexpected keyword.",[ps.UnexpectedNull]:"Unexpected null literal.",[ps.UnexpectedNumber]:"Unexpected number.",[ps.UnexpectedPunctuator]:"Unexpected ponctuator.",[ps.UnexpectedString]:"Unexpected text literal.",[ps.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[ps.UnexpectedToken]:"Unexpected token '${value}'."};let Use=class L9t extends Error{constructor({code:e,index:t,line:r,column:n,len:s=0,description:o,data:a}){super(`${o??e}`),this.declaredRootClass="esri.arcade.lib.parsingerror",this.name="ParsingError",this.code=e,this.index=t,this.line=r,this.column=n,this.len=s,this.data=a,this.description=o,this.range={start:{line:r,column:n-1},end:{line:r,column:n+s}},Error.captureStackTrace?.(this,L9t)}};function R9r(i){return i?.type===ws.Program}function Wdt(i){return i?.type===ws.BlockStatement}function D9r(i){return i?.type===ws.BlockComment}function F9r(i){return i?.type===ws.EmptyStatement}function k9r(i){return i?.type===ws.VariableDeclarator}function AOe(i,e){return!!e&&e.loc.end.line===i.loc.start.line&&e.loc.end.column<=i.loc.start.column}function qdt(i,e){return i.range[0]>=e.range[0]&&i.range[1]<=e.range[1]}let L9r=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(e){if(!Wdt(e)||e.body.length!==0)return;const t=[];for(let r=this._newComments.length-1;r>=0;--r){const n=this._newComments[r];e.range[1]>=n.range[0]&&(t.unshift(n),this._newComments.splice(r,1))}t.length&&(e.innerComments=t)}attachTrailingComments(e){if(!e)return;const t=this._nodeStack[this._nodeStack.length-1];if(Wdt(e)&&qdt(t,e))for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];qdt(s,e)&&(t.trailingComments=[...t.trailingComments??[],s],this._newComments.splice(n,1))}let r=[];if(this._newComments.length>0)for(let n=this._newComments.length-1;n>=0;--n){const s=this._newComments[n];AOe(s,t)?(t.trailingComments=[...t.trailingComments??[],s],this._newComments.splice(n,1)):AOe(s,e)&&(r.unshift(s),this._newComments.splice(n,1))}t?.trailingComments&&AOe(t.trailingComments[0],e)&&(r=[...r,...t.trailingComments],delete t.trailingComments),r.length>0&&(e.trailingComments=r)}attachLeadingComments(e){if(!e)return;let t;for(;this._nodeStack.length>0;){const s=this._nodeStack[this._nodeStack.length-1];if(!(e.range[0]<=s.range[0]))break;t=s,this._nodeStack.pop()}const r=[],n=[];if(t){for(let s=(t.leadingComments?.length??0)-1;s>=0;--s){const o=t.leadingComments[s];e.range[0]>=o.range[1]?(r.unshift(o),t.leadingComments.splice(s,1)):k9r(e)&&!D9r(o)&&(n.unshift(o),t.leadingComments.splice(s,1))}return t.leadingComments?.length===0&&delete t.leadingComments,r.length&&(e.leadingComments=r),void(n.length&&(e.trailingComments=[...n,...e.trailingComments??[]]))}for(let s=this._newComments.length-1;s>=0;--s){const o=this._newComments[s];e.range[0]>=o.range[0]&&(r.unshift(o),this._newComments.splice(s,1))}r.length&&(e.leadingComments=r)}attachComments(e){if(R9r(e)&&e.body.length>0){const t=this._nodeStack[this._nodeStack.length-1];return t?(t.trailingComments=[...t.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(e.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(e),this.attachLeadingComments(e),this.insertInnerComments(e),this._nodeStack.push(e)}collectComment(e){this.comments.push(e),this._newComments.push(e)}};function x6e(i,e){const t=P9r[i];return e?t.replaceAll(/\${(.*?)}/g,(r,n)=>e[n]?.toString()??""):t}let N9r=class{constructor(e=!1){this.tolerant=e,this.errors=[]}recordError(e){this.errors.push(e)}tolerate(e){if(!this.tolerant)throw e;this.recordError(e)}throwError(e){throw e.description=e.description??x6e(e.code,e.data),new Use(e)}tolerateError(e){e.description=e.description??x6e(e.code,e.data);const t=new Use(e);if(!this.tolerant)throw t;this.recordError(t)}};function Ydt(i,e){if(!i)throw new Error("ASSERT: "+e)}const Xdt={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},yl={fromCodePoint:i=>i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023)),isWhiteSpace:i=>i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(i),isLineTerminator:i=>i===10||i===13||i===8232||i===8233,isIdentifierStart:i=>i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&Xdt.NonAsciiIdentifierStart.test(yl.fromCodePoint(i)),isIdentifierPart:i=>i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&Xdt.NonAsciiIdentifierPart.test(yl.fromCodePoint(i)),isDecimalDigit:i=>i>=48&&i<=57,isHexDigit:i=>i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102,isOctalDigit:i=>i>=48&&i<=55};function Jdt(i){return"0123456789abcdef".indexOf(i.toLowerCase())}function MOe(i){return"01234567".indexOf(i)}const j6=[[],[],[]];w6e.forEach(i=>j6[i.length-1].push(i)),D9t.forEach(i=>j6[i.length-1].push(i)),k9t.forEach(i=>j6[i.length-1].push(i)),F9t.forEach(i=>j6[i.length-1].push(i)),A9r.forEach(i=>j6[i.length-1].push(i));let $9r=class{constructor(e,t){this.source=e,this.errorHandler=t,this._length=e.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=ps.UnexpectedToken){this.errorHandler.throwError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(e=ps.UnexpectedToken){this.errorHandler.tolerateError({code:e,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(e){const t=[],r=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}};for(;!this.eof();){const s=this.source.charCodeAt(this.index);if(++this.index,yl.isLineTerminator(s)){if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};const o={multiLine:!1,start:r+e,end:this.index-1,range:[r,this.index-1],loc:n};t.push(o)}return s===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart};const s={multiLine:!1,start:r+e,end:this.index,range:[r,this.index],loc:n};t.push(s)}return t}skipMultiLineComment(){const e=[],t=this.index-2,r={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(yl.isLineTerminator(n))n===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(n===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const s={multiLine:!0,start:t+2,end:this.index-2,range:[t,this.index],loc:r};e.push(s)}return e}++this.index}else++this.index}if(r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const n={multiLine:!0,start:t+2,end:this.index,range:[t,this.index],loc:r};e.push(n)}return this.tolerateUnexpectedToken(),e}scanComments(){let e=[];for(;!this.eof();){let t=this.source.charCodeAt(this.index);if(yl.isWhiteSpace(t))++this.index;else if(yl.isLineTerminator(t))++this.index,t===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(t!==47)break;if(t=this.source.charCodeAt(this.index+1),t===47){this.index+=2;const r=this.skipSingleLineComment(2);e=[...e,...r]}else{if(t!==42)break;{this.index+=2;const r=this.skipMultiLineComment();e=[...e,...r]}}}}return e}isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return e===Na.If||e===Na.In;case 3:return e===Na.Var||e===Na.For;case 4:return e===Na.Else;case 5:return e===Na.Break||e===Na.While;case 6:return e===Na.Return||e===Na.Import||e===Na.Export;case 8:return e===Na.Function||e===Na.Continue;default:return!1}}codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(t=1024*(t-55296)+r-56320+65536)}return t}scanHexEscape(e){const t=e==="u"?4:2;let r=0;for(let n=0;n1114111||e!=="}")&&this.throwUnexpectedToken(),yl.fromCodePoint(t)}getIdentifier(){const e=this.index++;for(;!this.eof();){const t=this.source.charCodeAt(this.index);if(t===92)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!yl.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)}getComplexIdentifier(){let e,t=this.codePointAt(this.index),r=yl.fromCodePoint(t);for(this.index+=r.length,t===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),e!==null&&e!=="\\"&&yl.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken()),r=e);!this.eof()&&(t=this.codePointAt(this.index),yl.isIdentifierPart(t));)e=yl.fromCodePoint(t),r+=e,this.index+=e.length,t===92&&(r=r.substring(0,r.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,e=this.scanUnicodeCodePointEscape()):(e=this.scanHexEscape("u"),e!==null&&e!=="\\"&&yl.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken()),r+=e);return r}octalToDecimal(e){let t=e!=="0",r=MOe(e);return!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,r=8*r+MOe(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+MOe(this.source[this.index++]))),{code:r,octal:t}}scanIdentifier(){let e;const t=this.index,r=this.source.charCodeAt(t)===92?this.getComplexIdentifier():this.getIdentifier();if(e=r.length===1?Fs.Identifier:this.isKeyword(r)?Fs.Keyword:r.toLowerCase()===Na.Null?Fs.NullLiteral:r.toLowerCase()===Na.True||r.toLowerCase()===Na.False?Fs.BooleanLiteral:Fs.Identifier,e!==Fs.Identifier&&t+r.length!==this.index){const n=this.index;this.index=t,this.tolerateUnexpectedToken(ps.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanPunctuator(){const e=this.index;let t=this.source[this.index];switch(t){case"(":case"{":t==="{"&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:for(let r=j6.length;r>0;r--)if(t=this.source.substring(this.index,this.index+r),j6[r-1].includes(t)){this.index+=r;break}}return this.index===e&&this.throwUnexpectedToken(),{type:Fs.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanHexLiteral(e){let t="";for(;!this.eof()&&yl.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return t.length===0&&this.throwUnexpectedToken(),yl.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanBinaryLiteral(e){let t="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;t+=this.source[this.index++]}if(t.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(yl.isIdentifierStart(r)||yl.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:Fs.NumericLiteral,value:parseInt(t,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanOctalLiteral(e,t){let r="",n=!1;for(yl.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&yl.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||r.length!==0||this.throwUnexpectedToken(),(yl.isIdentifierStart(this.source.charCodeAt(this.index))||yl.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanNumericLiteral(){const e=this.index;let t=this.source[e];Ydt(yl.isDecimalDigit(t.charCodeAt(0))||t===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(t!=="."){if(r=this.source[this.index++],t=this.source[this.index],r==="0"){if(t==="x"||t==="X")return++this.index,this.scanHexLiteral(e);if(t==="b"||t==="B")return++this.index,this.scanBinaryLiteral(e);if(t==="o"||t==="O")return this.scanOctalLiteral(t,e)}for(;yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if(t==="."){for(r+=this.source[this.index++];yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if(t==="e"||t==="E")if(r+=this.source[this.index++],t=this.source[this.index],t!=="+"&&t!=="-"||(r+=this.source[this.index++]),yl.isDecimalDigit(this.source.charCodeAt(this.index)))for(;yl.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return yl.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:Fs.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanStringLiteral(){const e=this.index;let t=this.source[e];Ydt(t==="'"||t==='"',"String literal must starts with a quote"),++this.index;let r=!1,n="";for(;!this.eof();){let s=this.source[this.index++];if(s===t){t="";break}if(s==="\\")if(s=this.source[this.index++],s&&yl.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,s==="\r"&&this.source[this.index]===` `&&++this.index,this.lineStart=this.index;else switch(s){case"u":if(this.source[this.index]==="{")++this.index,n+=this.scanUnicodeCodePointEscape();else{const o=this.scanHexEscape(s);o===null&&this.throwUnexpectedToken(),n+=o}break;case"x":{const o=this.scanHexEscape(s);o===null&&this.throwUnexpectedToken(ps.InvalidHexEscapeSequence),n+=o;break}case"n":n+=` `;break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;case"8":case"9":n+=s,this.tolerateUnexpectedToken();break;default:if(s&&yl.isOctalDigit(s.charCodeAt(0))){const o=this.octalToDecimal(s);r=o.octal||r,n+=String.fromCharCode(o.code)}else n+=s}else{if(yl.isLineTerminator(s.charCodeAt(0)))break;n+=s}}return t!==""&&(this.index=e,this.throwUnexpectedToken()),{type:Fs.StringLiteral,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}scanTemplate(){let e="",t=!1;const r=this.index,n=this.source[r]==="`";let s=!1,o=2;for(++this.index;!this.eof();){let a=this.source[this.index++];if(a==="`"){o=1,s=!0,t=!0;break}if(a!=="$")if(a!=="\\")yl.isLineTerminator(a.charCodeAt(0))?(++this.lineNumber,a==="\r"&&this.source[this.index]===` `&&++this.index,this.lineStart=this.index,e+=` `):e+=a;else if(a=this.source[this.index++],yl.isLineTerminator(a.charCodeAt(0)))++this.lineNumber,a==="\r"&&this.source[this.index]===` `&&++this.index,this.lineStart=this.index;else switch(a){case"n":e+=` -`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,e+=this.scanUnicodeCodePointEscape();else{const l=this.index,u=this.scanHexEscape(a);u!==null?e+=u:(this.index=l,e+=a)}break;case"x":{const l=this.scanHexEscape(a);l===null&&this.throwUnexpectedToken(ps.InvalidHexEscapeSequence),e+=l;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:a==="0"?(yl.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(ps.TemplateOctalLiteral),e+="\0"):yl.isOctalDigit(a.charCodeAt(0))?this.throwUnexpectedToken(ps.TemplateOctalLiteral):e+=a}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,t=!0;break}e+=a}}return t||this.throwUnexpectedToken(),n||this.curlyStack.pop(),{type:Fs.Template,value:this.source.slice(r+1,this.index-o),cooked:e,head:n,tail:s,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}lex(){if(this.eof())return{type:Fs.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return yl.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?yl.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():yl.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&yl.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}};var C1,mre;function Kdt(i,e=0){let t=i.start-i.lineStart,r=i.lineNumber;return t<0&&(t+=e,r--),{index:i.start,line:r,column:t}}function Zdt(i){return[{index:i.range[0],...i.loc.start},{index:i.range[1],...i.loc.end}]}function Qdt(i){return R9r[i]??0}(function(i){i[i.None=0]="None",i[i.Function=1]="Function",i[i.IfClause=2]="IfClause",i[i.ForLoop=4]="ForLoop",i[i.WhileLoop=8]="WhileLoop"})(C1||(C1={})),function(i){i[i.AsObject=0]="AsObject",i[i.Automatic=1]="Automatic"}(mre||(mre={}));let U9r=class{constructor(e,t={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new B9r),this.errorHandler=new j9r(this.options.tolerant),this.scanner=new G9r(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:C1.None,curlyParsingType:mre.AsObject},this.rawToken={type:Fs.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:r,invalidTypes:n}){r?.some(s=>e.type===s)||n?.some(s=>e.type===s)&&this.throwError(ps.InvalidExpression,t)}throwError(e,t,r=this.endMarker){const{index:n,line:s,column:o}=t,a=r.index-n-1;this.errorHandler.throwError({code:e,index:n,line:s,column:o+1,len:a})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:t}=e;let r,{code:n,data:s}=e;if(t){if(!n)switch(t.type){case Fs.EOF:n=ps.UnexpectedEndOfScript;break;case Fs.Identifier:n=ps.UnexpectedIdentifier;break;case Fs.NumericLiteral:n=ps.UnexpectedNumber;break;case Fs.StringLiteral:n=ps.UnexpectedString;break;case Fs.Template:n=ps.UnexpectedTemplate}r=t.value.toString()}else r="ILLEGAL";n=n??ps.UnexpectedToken,s||(s={value:r});const o=x6e(n,s);if(t){const u=t.start,c=t.lineNumber,h=t.start-t.lineStart+1;return new Use({code:n,index:u,line:c,column:h,len:t.end-t.start-1,data:s,description:o})}const{index:a,line:l}=this.endMarker;return new Use({code:n,index:a,line:l,column:this.endMarker.column+1,data:s,description:o})}throwUnexpectedToken(e={}){throw e.rawToken=e.rawToken??this.rawToken,this.unexpectedTokenError(e)}collectComments(e){const{commentHandler:t}=this;t&&e.length&&e.forEach(r=>{const n={type:r.multiLine?ws.BlockComment:ws.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};t.collectComment(n)})}peekAhead(e){const t=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),n=e.call(this,t);return this.scanner.restoreState(r),n}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:D9r[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==Fs.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate||this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){const t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:ps.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==Fs.Keyword||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==Fs.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===Fs.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===Fs.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===Fs.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===Fs.Punctuator&&e?.length)return e.find(this.matchPunctuator,this)}isolateCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=t,r}inheritCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&t,r}withBlockContext(e,t){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|e;const n=this.context.curlyParsingType;this.context.curlyParsingType=mre.Automatic;const s=t.call(this);return this.context.blockContext=r,this.context.curlyParsingType=n,s}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator)return this.rawToken.type===Fs.EOF||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column)):void this.throwUnexpectedToken({rawToken:this.rawToken})}parsePrimaryExpression(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case Fs.Identifier:return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:t.value,...this.getItemLocation(e)});case Fs.NumericLiteral:case Fs.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case Fs.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value.toLowerCase()===Na.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case Fs.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case Fs.Template:return this.parseTemplateLiteral();case Fs.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression);case"[":return this.inheritCoverGrammar(this.parseArrayInitializer);case"{":return this.inheritCoverGrammar(this.parseObjectExpression);default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case Fs.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const e=this.captureStartMarker();this.expectPunctuator("[");const t=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(ps.InvalidExpression,r)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:ws.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case Fs.StringLiteral:return this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case Fs.Identifier:case Fs.BooleanLiteral:case Fs.NullLiteral:case Fs.Keyword:return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(ps.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,t=this.captureStartMarker(),r=this.parseObjectPropertyKey();let n=!1,s=null;return this.matchPunctuator(":")?(this.readNextRawToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression)):e.type===Fs.Identifier?(n=!0,s=this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:ws.Property,kind:"init",key:r,value:s,shorthand:n,...this.getItemLocation(t)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:ws.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const t=this.rawToken;t.type!==Fs.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:ps.InvalidTemplateHead,rawToken:t});const r=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:s,tail:o}=t,a=this.finalize({type:ws.TemplateElement,value:{raw:n,cooked:s},tail:o,...this.getItemLocation(r)});return a.loc.start.column++,a.loc.end.column=a.loc.end.column-(o?1:2),a}parseTemplateLiteral(){const e=this.captureStartMarker(),t=[],r=[];let n=this.parseTemplateElement(!0);for(r.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize({type:ws.TemplateLiteral,quasis:r,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");const e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");const e=[];if(!this.matchPunctuator(")"))for(;;){const t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==Fs.NullLiteral&&e.type!==Fs.Identifier&&e.type!==Fs.Keyword&&e.type!==Fs.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let t=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let n;for(;n=this.getMatchingPunctuator("([.");)switch(n){case"(":{this.context.isAssignmentTarget=!1,t.type!==ws.Identifier&&t.type!==ws.MemberExpression&&this.throwError(ps.IdentiferExpected,e,r);const s=this.parseArguments();t=this.finalize({type:ws.CallExpression,callee:t,arguments:s,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const s=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),t=this.finalize({type:ws.MemberExpression,computed:!0,object:t,property:s,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const s=this.parseMemberName();t=this.finalize({type:ws.MemberExpression,computed:!1,object:t,property:s,...this.getItemLocation(e)});continue}}return t}parseUpdateExpression(){const e=this.captureStartMarker();let t=this.getMatchingPunctuator(w6e);if(t){this.readNextRawToken();const o=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseUnaryExpression);return a.type!==ws.Identifier&&a.type!==ws.MemberExpression&&a.type!==ws.CallExpression&&this.throwError(ps.InvalidExpression,o),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:ws.UpdateExpression,operator:t,argument:a,prefix:!0,...this.getItemLocation(e)})}const r=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseLeftHandSideExpression),s=this.captureStartMarker();return this.hasLineTerminator?n:(t=this.getMatchingPunctuator(w6e),t?(n.type!==ws.Identifier&&n.type!==ws.MemberExpression&&this.throwError(ps.InvalidExpression,r,s),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:ws.UpdateExpression,operator:t,argument:n,prefix:!1,...this.getItemLocation(e)})):n)}parseUnaryExpression(){const e=this.getMatchingPunctuator(D9t);if(e){const t=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:ws.UnaryExpression,operator:e,argument:r,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let t=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==Fs.Punctuator)return t;const r=this.rawToken.value;let n=Qdt(r);if(n===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const s=[e,this.rawToken];let o=t,a=this.inheritCoverGrammar(this.parseUnaryExpression);const l=[o,r,a],u=[n];for(;this.rawToken.type===Fs.Punctuator&&(n=Qdt(this.rawToken.value))>0;){for(;l.length>2&&n<=u[u.length-1];){a=l.pop();const p=l.pop();u.pop(),o=l.pop(),s.pop();const m=s[s.length-1],v=Kdt(m,m.lineStart);l.push(this.finalize(this.createBinaryOrLogicalExpression(v,p,o,a)))}l.push(this.rawToken.value),u.push(n),s.push(this.rawToken),this.readNextRawToken(),l.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let c=l.length-1;t=l[c];let h=s.pop();for(;c>1;){const p=s.pop();if(!p)break;const m=h?.lineStart,v=Kdt(p,m),w=l[c-1];t=this.finalize(this.createBinaryOrLogicalExpression(v,w,l[c-2],t)),c-=2,h=p}return t}createBinaryOrLogicalExpression(e,t,r,n){const s=k9t.includes(t)?ws.LogicalExpression:ws.BinaryExpression;return s===ws.BinaryExpression||(r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,...Zdt(r)),n.type!==ws.AssignmentExpression&&n.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,...Zdt(r))),{type:s,operator:t,left:r,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),n=this.getMatchingPunctuator(F9t);if(!n)return t;t.type!==ws.Identifier&&t.type!==ws.MemberExpression&&this.throwError(ps.InvalidExpression,e,r),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const s=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:ws.AssignmentExpression,left:t,operator:n,right:s,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(e){const t=[];for(;this.rawToken.type!==Fs.EOF&&!this.matchPunctuator(e);){const r=this.parseStatementListItem();N9r(r)||t.push(r)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(Na.Function)?this.parseFunctionDeclaration():this.matchKeyword(Na.Export)?this.parseExportDeclaration():this.matchKeyword(Na.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:ws.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:ws.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===mre.AsObject?this.parseObjectStatement():this.peekAhead(e=>{let t=e();return(t.type===Fs.Identifier||t.type===Fs.StringLiteral)&&(t=e(),t.type===Fs.Punctuator&&t.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==Fs.Identifier)return null;const t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){const e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:ps.IdentiferExpected});let r=null;if(this.matchPunctuator("=")){this.readNextRawToken();const n=this.rawToken;try{r=this.isolateCoverGrammar(this.parseAssignmentExpression)}catch{this.throwUnexpectedToken({rawToken:n,code:ps.InvalidVariableAssignment})}}return this.finalize({type:ws.VariableDeclarator,id:t,init:r,...this.getItemLocation(e)})}parseVariableDeclarationList(){const e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){const e=this.captureStartMarker();this.expectKeyword(Na.Var);const t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:ws.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:ws.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:ws.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(C1.IfClause,this.parseStatement)}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.If),this.expectPunctuator("(");const t=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,t,n);const s=this.parseIfClause();let o=null;return this.matchKeyword(Na.Else)&&(this.readNextRawToken(),o=this.parseIfClause()),this.finalize({type:ws.IfStatement,test:r,consequent:s,alternate:o,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.While),this.expectPunctuator("(");const t=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,t,n);const s=this.withBlockContext(C1.WhileLoop,this.parseStatement);return this.finalize({type:ws.WhileStatement,test:r,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,r=null,n=null,s=null;const o=this.captureStartMarker();if(this.expectKeyword(Na.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(Na.Var)){const l=this.captureStartMarker();this.readNextRawToken();const u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(Na.In)?(u[0].init&&this.throwError(ps.ForInOfLoopInitializer,l),n=this.finalize({type:ws.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(l)}),this.readNextRawToken(),s=this.parseExpression()):(this.matchKeyword(Na.In)&&this.throwError(ps.InvalidLeftHandSideInForIn,l),e=this.finalize({type:ws.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(l)}),this.expectPunctuator(";"))}else{const l=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword(Na.In)?(this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInForIn,u),e.type!==ws.Identifier&&this.throwError(ps.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),n=e,s=this.parseExpression(),e=null):(this.context.isAssignmentTarget=l,this.expectPunctuator(";"))}n||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const a=this.withBlockContext(C1.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return n&&s?this.finalize({type:ws.ForInStatement,left:n,right:s,body:a,...this.getItemLocation(o)}):this.finalize({type:ws.ForStatement,init:e,test:t,update:r,body:a,...this.getItemLocation(o)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword(Na.Continue),this.consumeSemicolon(),this.finalize({type:ws.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword(Na.Break),this.consumeSemicolon(),this.finalize({type:ws.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.Return);const t=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==Fs.EOF||this.rawToken.type===Fs.StringLiteral||this.rawToken.type===Fs.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:ws.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case Fs.BooleanLiteral:case Fs.NullLiteral:case Fs.NumericLiteral:case Fs.StringLiteral:case Fs.Template:case Fs.Identifier:return this.parseExpressionStatement();case Fs.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case Fs.Keyword:switch(this.rawToken.value.toLowerCase()){case Na.Break:return this.parseBreakStatement();case Na.Continue:return this.parseContinueStatement();case Na.For:return this.parseForStatement();case Na.Function:return this.parseFunctionDeclaration();case Na.If:return this.parseIfStatement();case Na.Return:return this.parseReturnStatement();case Na.Var:return this.parseVariableDeclaration();case Na.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==Fs.EOF;){const t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:ps.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&C1.Function)===C1.Function&&this.throwUnexpectedToken({code:ps.NoFunctionInsideFunction}),(this.context.blockContext&C1.WhileLoop)!==C1.WhileLoop&&(this.context.blockContext&C1.IfClause)!==C1.IfClause||this.throwUnexpectedToken({code:ps.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword(Na.Function);const t=this.parseIdentifier();t||this.throwUnexpectedToken({code:ps.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),n=this.context.blockContext;this.context.blockContext=this.context.blockContext|C1.Function;const s=this.parseBlock();return this.context.blockContext=n,this.finalize({type:ws.FunctionDeclaration,id:t,params:r,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),t=this.parseStatements(),r=this.finalize({type:ws.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==C1.None&&this.throwUnexpectedToken({code:ps.ModuleExportRootOnly});let e=null;const t=this.captureStartMarker();return this.expectKeyword(Na.Export),this.matchKeyword(Na.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:ps.InvalidExpression}),this.finalize({type:ws.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){const e=this.captureStartMarker(),t=this.rawToken;if(t.type===Fs.StringLiteral)return this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(ps.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:ps.IdentiferExpected}),this.finalize({type:ws.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==C1.None&&this.throwUnexpectedToken({code:ps.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword(Na.Import);const t=this.parseDefaultSpecifier();this.expectContextualKeyword(Na.From);const r=this.parseModuleSpecifier();return this.finalize({type:ws.ImportDeclaration,specifiers:[t],source:r,...this.getItemLocation(e)})}};function z9r(i,e,t){return new U9r(i,e,t).parseScript()}function ibe(i,e=[]){const t=z9r(i);if(t.body===null||t.body===void 0)throw new Use({index:0,line:0,column:0,data:null,description:"",code:ps.InvalidExpression});return t.loadedModules={},dle(t,e),t}let V9r=class S6e{constructor(e){const t=this;t._keys=[],t._values=[],t.length=0,e&&e.forEach(r=>{t.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((e,t)=>[e,this._values[t]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const t=this._keys.indexOf(e);return t>-1?this._values[t]:null}deepGet(e){if(!e?.length)return null;const t=(r,n)=>r==null?null:n.length?t(r instanceof S6e?r.get(n[0]):r[n[0]],n.slice(1)):r;return t(this.get(e[0]),e.slice(1))}set(e,t){const r=this,n=this._keys.indexOf(e);return n>-1?r._values[n]=t:(r._keys.push(e),r._values.push(t),r.length=r._values.length),this}sortedSet(e,t,r,n){const s=this,o=this._keys.length,a=r||0,l=n!==void 0?n:o-1;if(o===0)return s._keys.push(e),s._values.push(t),s;if(e===this._keys[a])return this._values.splice(a,0,t),this;if(e===this._keys[l])return this._values.splice(l,0,t),this;if(e>this._keys[l])return this._keys.splice(l+1,0,e),this._values.splice(l+1,0,t),this;if(e=l)return this;const u=a+Math.floor((l-a)/2);return ethis._keys[u]?this.sortedSet(e,t,u+1,l):this}size(){return this.length}clear(){const e=this;return e._keys.length=e.length=e._values.length=0,this}delete(e){const t=this,r=t._keys.indexOf(e);return r>-1&&(t._keys.splice(r,1),t._values.splice(r,1),t.length=t._keys.length,!0)}forEach(e){this._keys.forEach((t,r)=>{e(this._values[r],t,r)})}map(e){return this.keys().map((t,r)=>e(this._values[r],t,r))}filter(e){const t=this;return t._keys.forEach((r,n)=>{e(t._values[n],r,n)===!1&&t.delete(r)}),this}clone(){return new S6e(this.entries())}},ept=class{constructor(e=20){this._maxEntries=e,this._values=new V9r}delete(e){this._values.has(e)&&this._values.delete(e)}get(e){let t=null;return this._values.has(e)&&(t=this._values.get(e),this._values.delete(e),this._values.set(e,t)),t}put(e,t){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(e,t)}},H9r=class{constructor(e=20){this._maxEntries=e,this._cache=new ept(this._maxEntries)}clear(){this._cache=new ept(this._maxEntries)}addToCache(e,t){this._cache.put(e,t)}removeFromCache(e){this._cache.delete(e)}getFromCache(e){return this._cache.get(e)}},vU=class dO{constructor(e){this.portalUri=e}normalizeModuleUri(e){const t=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([\?|\/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id\=(?.+)$/gi,n=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([\?|\/].*)?$/gi;if(e.startsWith("portal+")){let a=e.substring(7),l="",u=a,c=!1;for(const m of[r,s,n]){const v=m.exec(a);if(v!==null){const w=v.groups;u=w.itemid,l=w.portalurl,c=!0;break}}if(c===!1){if(!t.test(a))throw new _Oe(p9.UnsupportedUriProtocol,{uri:e});u=a,l=this.portalUri}u.includes("/")&&(u=u.split("/")[0]),u.includes("?")&&(u=u.split("?")[0]);let h="current";const p=o.exec(u);if(p!==null){const m=p.groups;u=m.itemid,h=m.versionstring}return a=new Bu({url:l}).restUrl+"/content/items/"+u+"/resources/"+h+".arc",{url:a,scheme:"portal",uri:"PO:"+a}}if(e.startsWith("mock")){if(e==="mock")return{url:"",scheme:"mock",data:` +`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,e+=this.scanUnicodeCodePointEscape();else{const l=this.index,u=this.scanHexEscape(a);u!==null?e+=u:(this.index=l,e+=a)}break;case"x":{const l=this.scanHexEscape(a);l===null&&this.throwUnexpectedToken(ps.InvalidHexEscapeSequence),e+=l;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:a==="0"?(yl.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(ps.TemplateOctalLiteral),e+="\0"):yl.isOctalDigit(a.charCodeAt(0))?this.throwUnexpectedToken(ps.TemplateOctalLiteral):e+=a}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,t=!0;break}e+=a}}return t||this.throwUnexpectedToken(),n||this.curlyStack.pop(),{type:Fs.Template,value:this.source.slice(r+1,this.index-o),cooked:e,head:n,tail:s,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}lex(){if(this.eof())return{type:Fs.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return yl.isIdentifierStart(e)?this.scanIdentifier():e===40||e===41||e===59?this.scanPunctuator():e===39||e===34?this.scanStringLiteral():e===46?yl.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():yl.isDecimalDigit(e)?this.scanNumericLiteral():e===96||e===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():e>=55296&&e<57343&&yl.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}};var C1,mre;function Kdt(i,e=0){let t=i.start-i.lineStart,r=i.lineNumber;return t<0&&(t+=e,r--),{index:i.start,line:r,column:t}}function Zdt(i){return[{index:i.range[0],...i.loc.start},{index:i.range[1],...i.loc.end}]}function Qdt(i){return M9r[i]??0}(function(i){i[i.None=0]="None",i[i.Function=1]="Function",i[i.IfClause=2]="IfClause",i[i.ForLoop=4]="ForLoop",i[i.WhileLoop=8]="WhileLoop"})(C1||(C1={})),function(i){i[i.AsObject=0]="AsObject",i[i.Automatic=1]="Automatic"}(mre||(mre={}));let B9r=class{constructor(e,t={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof t.tokens=="boolean"&&t.tokens,comments:typeof t.comments=="boolean"&&t.comments,tolerant:typeof t.tolerant=="boolean"&&t.tolerant},this.options.comments&&(this.commentHandler=new L9r),this.errorHandler=new N9r(this.options.tolerant),this.scanner=new $9r(e,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:C1.None,curlyParsingType:mre.AsObject},this.rawToken={type:Fs.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(e,t,{validTypes:r,invalidTypes:n}){r?.some(s=>e.type===s)||n?.some(s=>e.type===s)&&this.throwError(ps.InvalidExpression,t)}throwError(e,t,r=this.endMarker){const{index:n,line:s,column:o}=t,a=r.index-n-1;this.errorHandler.throwError({code:e,index:n,line:s,column:o+1,len:a})}tolerateError(e,t){throw new Error("######################################### !!!")}unexpectedTokenError(e={}){const{rawToken:t}=e;let r,{code:n,data:s}=e;if(t){if(!n)switch(t.type){case Fs.EOF:n=ps.UnexpectedEndOfScript;break;case Fs.Identifier:n=ps.UnexpectedIdentifier;break;case Fs.NumericLiteral:n=ps.UnexpectedNumber;break;case Fs.StringLiteral:n=ps.UnexpectedString;break;case Fs.Template:n=ps.UnexpectedTemplate}r=t.value.toString()}else r="ILLEGAL";n=n??ps.UnexpectedToken,s||(s={value:r});const o=x6e(n,s);if(t){const u=t.start,c=t.lineNumber,h=t.start-t.lineStart+1;return new Use({code:n,index:u,line:c,column:h,len:t.end-t.start-1,data:s,description:o})}const{index:a,line:l}=this.endMarker;return new Use({code:n,index:a,line:l,column:this.endMarker.column+1,data:s,description:o})}throwUnexpectedToken(e={}){throw e.rawToken=e.rawToken??this.rawToken,this.unexpectedTokenError(e)}collectComments(e){const{commentHandler:t}=this;t&&e.length&&e.forEach(r=>{const n={type:r.multiLine?ws.BlockComment:ws.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};t.collectComment(n)})}peekAhead(e){const t=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),n=e.call(this,t);return this.scanner.restoreState(r),n}getSourceValue(e){return this.scanner.source.slice(e.start,e.end)}convertToToken(e){return{type:O9r[e.type],value:this.getSourceValue(e),range:[e.start,e.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const e=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=e.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==Fs.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(e){return{range:[e.index,this.endMarker.index],loc:{start:{line:e.line,column:e.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(e){return(this.delegate||this.commentHandler)&&(this.commentHandler?.attachComments(e),this.delegate?.(e)),e}expectPunctuator(e){const t=this.rawToken;this.matchPunctuator(e)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:t,code:ps.PunctuatorExpected,data:{value:e}})}expectKeyword(e){this.rawToken.type!==Fs.Keyword||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(e){this.rawToken.type!==Fs.Identifier||this.rawToken.value.toLowerCase()!==e?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(e){return this.rawToken.type===Fs.Keyword&&this.rawToken.value.toLowerCase()===e}matchContextualKeyword(e){return this.rawToken.type===Fs.Identifier&&this.rawToken.value===e}matchPunctuator(e){return this.rawToken.type===Fs.Punctuator&&this.rawToken.value===e}getMatchingPunctuator(e){if(typeof e=="string"&&(e=e.split("")),this.rawToken.type===Fs.Punctuator&&e?.length)return e.find(this.matchPunctuator,this)}isolateCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=t,r}inheritCoverGrammar(e){const t=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=e.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&t,r}withBlockContext(e,t){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|e;const n=this.context.curlyParsingType;this.context.curlyParsingType=mre.Automatic;const s=t.call(this);return this.context.blockContext=r,this.context.curlyParsingType=n,s}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator)return this.rawToken.type===Fs.EOF||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column)):void this.throwUnexpectedToken({rawToken:this.rawToken})}parsePrimaryExpression(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case Fs.Identifier:return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:t.value,...this.getItemLocation(e)});case Fs.NumericLiteral:case Fs.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:typeof t.value=="string",...this.getItemLocation(e)});case Fs.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value.toLowerCase()===Na.True,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case Fs.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:ws.Literal,value:null,raw:this.getSourceValue(t),isString:!1,...this.getItemLocation(e)});case Fs.Template:return this.parseTemplateLiteral();case Fs.Punctuator:switch(t.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression);case"[":return this.inheritCoverGrammar(this.parseArrayInitializer);case"{":return this.inheritCoverGrammar(this.parseObjectExpression);default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case Fs.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const e=this.captureStartMarker();this.expectPunctuator("[");const t=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(ps.InvalidExpression,r)):(t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:ws.ArrayExpression,elements:t,...this.getItemLocation(e)})}parseObjectPropertyKey(){const e=this.captureStartMarker(),t=this.rawToken;switch(t.type){case Fs.StringLiteral:return this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});case Fs.Identifier:case Fs.BooleanLiteral:case Fs.NullLiteral:case Fs.Keyword:return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:t.value,...this.getItemLocation(e)});default:this.throwError(ps.KeyMustBeString,e)}}parseObjectProperty(){const e=this.rawToken,t=this.captureStartMarker(),r=this.parseObjectPropertyKey();let n=!1,s=null;return this.matchPunctuator(":")?(this.readNextRawToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression)):e.type===Fs.Identifier?(n=!0,s=this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:ws.Property,kind:"init",key:r,value:s,shorthand:n,...this.getItemLocation(t)})}parseObjectExpression(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=[];for(;!this.matchPunctuator("}");)t.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:ws.ObjectExpression,properties:t,...this.getItemLocation(e)})}parseTemplateElement(e=!1){const t=this.rawToken;t.type!==Fs.Template&&this.throwUnexpectedToken({rawToken:t}),e&&!t.head&&this.throwUnexpectedToken({code:ps.InvalidTemplateHead,rawToken:t});const r=this.captureStartMarker();this.readNextRawToken();const{value:n,cooked:s,tail:o}=t,a=this.finalize({type:ws.TemplateElement,value:{raw:n,cooked:s},tail:o,...this.getItemLocation(r)});return a.loc.start.column++,a.loc.end.column=a.loc.end.column-(o?1:2),a}parseTemplateLiteral(){const e=this.captureStartMarker(),t=[],r=[];let n=this.parseTemplateElement(!0);for(r.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize({type:ws.TemplateLiteral,quasis:r,expressions:t,...this.getItemLocation(e)})}parseGroupExpression(){this.expectPunctuator("(");const e=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.expectPunctuator(")"),e}parseArguments(){this.expectPunctuator("(");const e=[];if(!this.matchPunctuator(")"))for(;;){const t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseMemberName(){const e=this.rawToken,t=this.captureStartMarker();return this.readNextRawToken(),e.type!==Fs.NullLiteral&&e.type!==Fs.Identifier&&e.type!==Fs.Keyword&&e.type!==Fs.BooleanLiteral&&this.throwUnexpectedToken({rawToken:e}),this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})}parseLeftHandSideExpression(){const e=this.captureStartMarker();let t=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let n;for(;n=this.getMatchingPunctuator("([.");)switch(n){case"(":{this.context.isAssignmentTarget=!1,t.type!==ws.Identifier&&t.type!==ws.MemberExpression&&this.throwError(ps.IdentiferExpected,e,r);const s=this.parseArguments();t=this.finalize({type:ws.CallExpression,callee:t,arguments:s,...this.getItemLocation(e)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const s=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),t=this.finalize({type:ws.MemberExpression,computed:!0,object:t,property:s,...this.getItemLocation(e)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const s=this.parseMemberName();t=this.finalize({type:ws.MemberExpression,computed:!1,object:t,property:s,...this.getItemLocation(e)});continue}}return t}parseUpdateExpression(){const e=this.captureStartMarker();let t=this.getMatchingPunctuator(w6e);if(t){this.readNextRawToken();const o=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseUnaryExpression);return a.type!==ws.Identifier&&a.type!==ws.MemberExpression&&a.type!==ws.CallExpression&&this.throwError(ps.InvalidExpression,o),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.context.isAssignmentTarget=!1,this.finalize({type:ws.UpdateExpression,operator:t,argument:a,prefix:!0,...this.getItemLocation(e)})}const r=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseLeftHandSideExpression),s=this.captureStartMarker();return this.hasLineTerminator?n:(t=this.getMatchingPunctuator(w6e),t?(n.type!==ws.Identifier&&n.type!==ws.MemberExpression&&this.throwError(ps.InvalidExpression,r,s),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:ws.UpdateExpression,operator:t,argument:n,prefix:!1,...this.getItemLocation(e)})):n)}parseUnaryExpression(){const e=this.getMatchingPunctuator(D9t);if(e){const t=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:ws.UnaryExpression,operator:e,argument:r,prefix:!0,...this.getItemLocation(t)})}return this.parseUpdateExpression()}parseBinaryExpression(){const e=this.rawToken;let t=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==Fs.Punctuator)return t;const r=this.rawToken.value;let n=Qdt(r);if(n===0)return t;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const s=[e,this.rawToken];let o=t,a=this.inheritCoverGrammar(this.parseUnaryExpression);const l=[o,r,a],u=[n];for(;this.rawToken.type===Fs.Punctuator&&(n=Qdt(this.rawToken.value))>0;){for(;l.length>2&&n<=u[u.length-1];){a=l.pop();const p=l.pop();u.pop(),o=l.pop(),s.pop();const m=s[s.length-1],v=Kdt(m,m.lineStart);l.push(this.finalize(this.createBinaryOrLogicalExpression(v,p,o,a)))}l.push(this.rawToken.value),u.push(n),s.push(this.rawToken),this.readNextRawToken(),l.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let c=l.length-1;t=l[c];let h=s.pop();for(;c>1;){const p=s.pop();if(!p)break;const m=h?.lineStart,v=Kdt(p,m),w=l[c-1];t=this.finalize(this.createBinaryOrLogicalExpression(v,w,l[c-2],t)),c-=2,h=p}return t}createBinaryOrLogicalExpression(e,t,r,n){const s=k9t.includes(t)?ws.LogicalExpression:ws.BinaryExpression;return s===ws.BinaryExpression||(r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,...Zdt(r)),n.type!==ws.AssignmentExpression&&n.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,...Zdt(r))),{type:s,operator:t,left:r,right:n,...this.getItemLocation(e)}}parseAssignmentExpression(){const e=this.captureStartMarker(),t=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),n=this.getMatchingPunctuator(F9t);if(!n)return t;t.type!==ws.Identifier&&t.type!==ws.MemberExpression&&this.throwError(ps.InvalidExpression,e,r),this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInAssignment,e),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const s=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:ws.AssignmentExpression,left:t,operator:n,right:s,...this.getItemLocation(e)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(e){const t=[];for(;this.rawToken.type!==Fs.EOF&&!this.matchPunctuator(e);){const r=this.parseStatementListItem();F9r(r)||t.push(r)}return t}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(Na.Function)?this.parseFunctionDeclaration():this.matchKeyword(Na.Export)?this.parseExportDeclaration():this.matchKeyword(Na.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const e=this.captureStartMarker();this.expectPunctuator("{");const t=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:ws.BlockStatement,body:t,...this.getItemLocation(e)})}parseObjectStatement(){const e=this.captureStartMarker(),t=this.parseObjectExpression();return this.finalize({type:ws.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===mre.AsObject?this.parseObjectStatement():this.peekAhead(e=>{let t=e();return(t.type===Fs.Identifier||t.type===Fs.StringLiteral)&&(t=e(),t.type===Fs.Punctuator&&t.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const e=this.rawToken;if(e.type!==Fs.Identifier)return null;const t=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:ws.Identifier,name:e.value,...this.getItemLocation(t)})}parseVariableDeclarator(){const e=this.captureStartMarker(),t=this.parseIdentifier();t||this.throwUnexpectedToken({code:ps.IdentiferExpected});let r=null;if(this.matchPunctuator("=")){this.readNextRawToken();const n=this.rawToken;try{r=this.isolateCoverGrammar(this.parseAssignmentExpression)}catch{this.throwUnexpectedToken({rawToken:n,code:ps.InvalidVariableAssignment})}}return this.finalize({type:ws.VariableDeclarator,id:t,init:r,...this.getItemLocation(e)})}parseVariableDeclarationList(){const e=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),e.push(this.parseVariableDeclarator());return e}parseVariableDeclaration(){const e=this.captureStartMarker();this.expectKeyword(Na.Var);const t=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:ws.VariableDeclaration,declarations:t,kind:"var",...this.getItemLocation(e)})}parseEmptyStatement(){const e=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:ws.EmptyStatement,...this.getItemLocation(e)})}parseExpressionStatement(){const e=this.captureStartMarker(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:ws.ExpressionStatement,expression:t,...this.getItemLocation(e)})}parseIfClause(){return this.withBlockContext(C1.IfClause,this.parseStatement)}parseIfStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.If),this.expectPunctuator("(");const t=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,t,n);const s=this.parseIfClause();let o=null;return this.matchKeyword(Na.Else)&&(this.readNextRawToken(),o=this.parseIfClause()),this.finalize({type:ws.IfStatement,test:r,consequent:s,alternate:o,...this.getItemLocation(e)})}parseWhileStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.While),this.expectPunctuator("(");const t=this.captureStartMarker(),r=this.parseExpression(),n=this.captureStartMarker();this.expectPunctuator(")"),r.type!==ws.AssignmentExpression&&r.type!==ws.UpdateExpression||this.throwError(ps.InvalidExpression,t,n);const s=this.withBlockContext(C1.WhileLoop,this.parseStatement);return this.finalize({type:ws.WhileStatement,test:r,body:s,...this.getItemLocation(e)})}parseForStatement(){let e=null,t=null,r=null,n=null,s=null;const o=this.captureStartMarker();if(this.expectKeyword(Na.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(Na.Var)){const l=this.captureStartMarker();this.readNextRawToken();const u=this.parseVariableDeclarationList();u.length===1&&this.matchKeyword(Na.In)?(u[0].init&&this.throwError(ps.ForInOfLoopInitializer,l),n=this.finalize({type:ws.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(l)}),this.readNextRawToken(),s=this.parseExpression()):(this.matchKeyword(Na.In)&&this.throwError(ps.InvalidLeftHandSideInForIn,l),e=this.finalize({type:ws.VariableDeclaration,declarations:u,kind:"var",...this.getItemLocation(l)}),this.expectPunctuator(";"))}else{const l=this.context.isAssignmentTarget,u=this.captureStartMarker();e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword(Na.In)?(this.context.isAssignmentTarget||this.tolerateError(ps.InvalidLeftHandSideInForIn,u),e.type!==ws.Identifier&&this.throwError(ps.InvalidLeftHandSideInForIn,u),this.readNextRawToken(),n=e,s=this.parseExpression(),e=null):(this.context.isAssignmentTarget=l,this.expectPunctuator(";"))}n||(this.matchPunctuator(";")||(t=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const a=this.withBlockContext(C1.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return n&&s?this.finalize({type:ws.ForInStatement,left:n,right:s,body:a,...this.getItemLocation(o)}):this.finalize({type:ws.ForStatement,init:e,test:t,update:r,body:a,...this.getItemLocation(o)})}parseContinueStatement(){const e=this.captureStartMarker();return this.expectKeyword(Na.Continue),this.consumeSemicolon(),this.finalize({type:ws.ContinueStatement,...this.getItemLocation(e)})}parseBreakStatement(){const e=this.captureStartMarker();return this.expectKeyword(Na.Break),this.consumeSemicolon(),this.finalize({type:ws.BreakStatement,...this.getItemLocation(e)})}parseReturnStatement(){const e=this.captureStartMarker();this.expectKeyword(Na.Return);const t=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==Fs.EOF||this.rawToken.type===Fs.StringLiteral||this.rawToken.type===Fs.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:ws.ReturnStatement,argument:t,...this.getItemLocation(e)})}parseStatement(){switch(this.rawToken.type){case Fs.BooleanLiteral:case Fs.NullLiteral:case Fs.NumericLiteral:case Fs.StringLiteral:case Fs.Template:case Fs.Identifier:return this.parseExpressionStatement();case Fs.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case Fs.Keyword:switch(this.rawToken.value.toLowerCase()){case Na.Break:return this.parseBreakStatement();case Na.Continue:return this.parseContinueStatement();case Na.For:return this.parseForStatement();case Na.Function:return this.parseFunctionDeclaration();case Na.If:return this.parseIfStatement();case Na.Return:return this.parseReturnStatement();case Na.Var:return this.parseVariableDeclaration();case Na.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const e=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==Fs.EOF;){const t=this.parseIdentifier();if(t||this.throwUnexpectedToken({rawToken:this.rawToken,code:ps.IdentiferExpected}),e.push(t),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),e}parseFunctionDeclaration(){(this.context.blockContext&C1.Function)===C1.Function&&this.throwUnexpectedToken({code:ps.NoFunctionInsideFunction}),(this.context.blockContext&C1.WhileLoop)!==C1.WhileLoop&&(this.context.blockContext&C1.IfClause)!==C1.IfClause||this.throwUnexpectedToken({code:ps.NoFunctionInsideBlock});const e=this.captureStartMarker();this.expectKeyword(Na.Function);const t=this.parseIdentifier();t||this.throwUnexpectedToken({code:ps.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),n=this.context.blockContext;this.context.blockContext=this.context.blockContext|C1.Function;const s=this.parseBlock();return this.context.blockContext=n,this.finalize({type:ws.FunctionDeclaration,id:t,params:r,body:s,...this.getItemLocation(e)})}parseScript(){const e=this.captureStartMarker(),t=this.parseStatements(),r=this.finalize({type:ws.Program,body:t,...this.getItemLocation(e)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==C1.None&&this.throwUnexpectedToken({code:ps.ModuleExportRootOnly});let e=null;const t=this.captureStartMarker();return this.expectKeyword(Na.Export),this.matchKeyword(Na.Var)?e=this.parseVariableDeclaration():this.matchKeyword("function")?e=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:ps.InvalidExpression}),this.finalize({type:ws.ExportNamedDeclaration,declaration:e,specifiers:[],source:null,...this.getItemLocation(t)})}parseModuleSpecifier(){const e=this.captureStartMarker(),t=this.rawToken;if(t.type===Fs.StringLiteral)return this.readNextRawToken(),this.finalize({type:ws.Literal,value:t.value,raw:this.getSourceValue(t),isString:!0,...this.getItemLocation(e)});this.throwError(ps.InvalidModuleUri,e)}parseDefaultSpecifier(){const e=this.captureStartMarker(),t=this.parseIdentifier();return t||this.throwUnexpectedToken({code:ps.IdentiferExpected}),this.finalize({type:ws.ImportDefaultSpecifier,local:t,...this.getItemLocation(e)})}parseImportDeclaration(){this.context.blockContext!==C1.None&&this.throwUnexpectedToken({code:ps.ModuleImportRootOnly});const e=this.captureStartMarker();this.expectKeyword(Na.Import);const t=this.parseDefaultSpecifier();this.expectContextualKeyword(Na.From);const r=this.parseModuleSpecifier();return this.finalize({type:ws.ImportDeclaration,specifiers:[t],source:r,...this.getItemLocation(e)})}};function j9r(i,e,t){return new B9r(i,e,t).parseScript()}function ibe(i,e=[]){const t=j9r(i);if(t.body===null||t.body===void 0)throw new Use({index:0,line:0,column:0,data:null,description:"",code:ps.InvalidExpression});return t.loadedModules={},dle(t,e),t}let G9r=class S6e{constructor(e){const t=this;t._keys=[],t._values=[],t.length=0,e&&e.forEach(r=>{t.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((e,t)=>[e,this._values[t]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const t=this._keys.indexOf(e);return t>-1?this._values[t]:null}deepGet(e){if(!e?.length)return null;const t=(r,n)=>r==null?null:n.length?t(r instanceof S6e?r.get(n[0]):r[n[0]],n.slice(1)):r;return t(this.get(e[0]),e.slice(1))}set(e,t){const r=this,n=this._keys.indexOf(e);return n>-1?r._values[n]=t:(r._keys.push(e),r._values.push(t),r.length=r._values.length),this}sortedSet(e,t,r,n){const s=this,o=this._keys.length,a=r||0,l=n!==void 0?n:o-1;if(o===0)return s._keys.push(e),s._values.push(t),s;if(e===this._keys[a])return this._values.splice(a,0,t),this;if(e===this._keys[l])return this._values.splice(l,0,t),this;if(e>this._keys[l])return this._keys.splice(l+1,0,e),this._values.splice(l+1,0,t),this;if(e=l)return this;const u=a+Math.floor((l-a)/2);return ethis._keys[u]?this.sortedSet(e,t,u+1,l):this}size(){return this.length}clear(){const e=this;return e._keys.length=e.length=e._values.length=0,this}delete(e){const t=this,r=t._keys.indexOf(e);return r>-1&&(t._keys.splice(r,1),t._values.splice(r,1),t.length=t._keys.length,!0)}forEach(e){this._keys.forEach((t,r)=>{e(this._values[r],t,r)})}map(e){return this.keys().map((t,r)=>e(this._values[r],t,r))}filter(e){const t=this;return t._keys.forEach((r,n)=>{e(t._values[n],r,n)===!1&&t.delete(r)}),this}clone(){return new S6e(this.entries())}},ept=class{constructor(e=20){this._maxEntries=e,this._values=new G9r}delete(e){this._values.has(e)&&this._values.delete(e)}get(e){let t=null;return this._values.has(e)&&(t=this._values.get(e),this._values.delete(e),this._values.set(e,t)),t}put(e,t){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(e,t)}},U9r=class{constructor(e=20){this._maxEntries=e,this._cache=new ept(this._maxEntries)}clear(){this._cache=new ept(this._maxEntries)}addToCache(e,t){this._cache.put(e,t)}removeFromCache(e){this._cache.delete(e)}getFromCache(e){return this._cache.get(e)}},vU=class dO{constructor(e){this.portalUri=e}normalizeModuleUri(e){const t=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([\?|\/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id\=(?.+)$/gi,n=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,s=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([\?|\/].*)?$/gi;if(e.startsWith("portal+")){let a=e.substring(7),l="",u=a,c=!1;for(const m of[r,s,n]){const v=m.exec(a);if(v!==null){const w=v.groups;u=w.itemid,l=w.portalurl,c=!0;break}}if(c===!1){if(!t.test(a))throw new _Oe(p9.UnsupportedUriProtocol,{uri:e});u=a,l=this.portalUri}u.includes("/")&&(u=u.split("/")[0]),u.includes("?")&&(u=u.split("?")[0]);let h="current";const p=o.exec(u);if(p!==null){const m=p.groups;u=m.itemid,h=m.versionstring}return a=new Bu({url:l}).restUrl+"/content/items/"+u+"/resources/"+h+".arc",{url:a,scheme:"portal",uri:"PO:"+a}}if(e.startsWith("mock")){if(e==="mock")return{url:"",scheme:"mock",data:` export var hello = 1; export function helloWorld() { return "Hello World " + hello; } - `,uri:"mock"};const a=e.replace("mock:","");if(dO.mocks[a]!==void 0)return{url:"",scheme:"mock",data:dO.mocks[a],uri:e}}throw new _Oe(p9.UnrecognizedUri,{uri:e})}async fetchModule(e){const t=dO.cachedModules.getFromCache(e.uri);if(t)return t;const r=this.fetchSource(e);dO.cachedModules.addToCache(e.uri,r);let n=null;try{n=await r}catch(s){throw dO.cachedModules.removeFromCache(e.uri),s}return n}async fetchSource(e){if(e.scheme==="portal"){const t=await zi(e.url,{responseType:"text",query:{}});if(t.data)return ibe(t.data,[])}if(e.scheme==="mock")return ibe(e.data??"",[]);throw new _Oe(p9.UnsupportedUriProtocol)}static create(e){return new dO(e)}static getDefault(){return this._default??(dO._default=dO._moduleResolverFactory())}static set moduleResolverClass(e){this._moduleResolverFactory=e,this._default=null}};vU.mocks={},vU.cachedModules=new H9r(30),vU._default=null,vU._moduleResolverFactory=()=>{const i=Bu.getDefault();return new vU(i.url)};let W9r=class extends bk{constructor(e,t){super(),this.definition=null,this.context=null,this.definition=e,this.context=t}createFunction(e){return(...t)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new Mt(e,wt.MaximumCallDepth,null);return OOe(this.definition,r,t,null)}}call(e,t){return iP(e,t,(r,n,s)=>{const o={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(o.depthCounter.depth>64)throw new Mt(e,wt.MaximumCallDepth,t);return OOe(this.definition,o,s,t)})}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{const l={spatialReference:e.spatialReference,globalScope:r.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map(u=>!mu(u)||u instanceof US?u:wk(u,e,n)),wk(OOe(this.definition,l,a,t),r,n)})}},vq=class extends QY{constructor(e){super(e)}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=ss(this.executingContext,t.node),t.valueset=!0),mu(t.value)&&!(t.value instanceof US)){const r=new US;r.fn=t.value,r.parameterEvaluator=iP,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(mu(t))throw new Mt(null,wt.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Xi({wkid:102100})),this.moduleScope=j9t({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new eX(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??G9t,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},ss(this.executingContext,this.source.syntax)}};function q9r(i,e){const t=[];for(let r=0;r=r.length)throw new Mt(i,wt.OutOfBounds,e);t=Ai(r[n]),r[n]=e.operator==="++"?t+1:t-1}else if(r instanceof vn){if(Jr(n)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Mt(i,wt.FieldNotFound,e);t=Ai(r.field(n)),r.setField(n,e.operator==="++"?t+1:t-1)}else if(Sl(r)){if(Jr(n)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Mt(i,wt.FieldNotFound,e);t=Ai(r.field(n)),r.setField(n,e.operator==="++"?t+1:t-1)}else{if(Jn(r))throw new Mt(i,wt.Immutable,e);if(!(r instanceof vq))throw new Mt(i,wt.InvalidParameter,e);if(Jr(n)===!1)throw new Mt(i,wt.ModuleAccessorMustBeString,e);if(r.hasGlobal(n)!==!0)throw new Mt(i,wt.ModuleExportNotFound,e);t=Ai(r.global(n)),r.setGlobal(n,e.operator==="++"?t+1:t-1)}return e.prefix===!1?t:e.operator==="++"?t+1:t-1}if(r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"",!r)throw new Mt(i,wt.InvalidIdentifier,e);if(i.localScope!=null&&i.localScope[r]!==void 0)return t=Ai(i.localScope[r].value),i.localScope[r]={value:e.operator==="++"?t+1:t-1,valueset:!0,node:e},e.prefix===!1?t:e.operator==="++"?t+1:t-1;if(i.globalScope[r]!==void 0)return t=Ai(i.globalScope[r].value),i.globalScope[r]={value:e.operator==="++"?t+1:t-1,valueset:!0,node:e},e.prefix===!1?t:e.operator==="++"?t+1:t-1;throw new Mt(i,wt.InvalidIdentifier,e)}function AM(i,e,t,r,n){switch(e){case"=":return i===nn?null:i;case"/=":return Ai(t)/Ai(i);case"*=":return Ai(t)*Ai(i);case"-=":return Ai(t)-Ai(i);case"+=":return Jr(t)||Jr(i)?en(t)+en(i):Ai(t)+Ai(i);case"%=":return Ai(t)%Ai(i);default:throw new Mt(n,wt.UnsupportedOperator,r)}}function tBr(i,e){let t=null,r="";if(e.left.type==="MemberExpression"){if(t=ss(i,e.left.object),e.left.computed===!0)r=ss(i,e.left.property);else{if(e.left.property.type!=="Identifier")throw new Mt(i,wt.InvalidIdentifier,e);r=e.left.property.name}const s=ss(i,e.right);if(cn(t)){if(!uo(r))throw new Mt(i,wt.ArrayAccessorMustBeNumber,e);if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Mt(i,wt.OutOfBounds,e);if(r===t.length){if(e.operator!=="=")throw new Mt(i,wt.OutOfBounds,e);t[r]=AM(s,e.operator,t[r],e,i)}else t[r]=AM(s,e.operator,t[r],e,i)}else if(t instanceof vn){if(Jr(r)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(t.hasField(r)===!0)t.setField(r,AM(s,e.operator,t.field(r),e,i));else{if(e.operator!=="=")throw new Mt(i,wt.FieldNotFound,e,{key:r});t.setField(r,AM(s,e.operator,null,e,i))}}else if(Sl(t)){if(Jr(r)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(t.hasField(r)===!0)t.setField(r,AM(s,e.operator,t.field(r),e,i));else{if(e.operator!=="=")throw new Mt(i,wt.FieldNotFound,e,{key:r});t.setField(r,AM(s,e.operator,null,e,i))}}else{if(Jn(t))throw new Mt(i,wt.Immutable,e);if(!(t instanceof vq))throw new Mt(i,wt.InvalidIdentifier,e);if(Jr(r)===!1)throw new Mt(i,wt.ModuleAccessorMustBeString,e);if(t.hasGlobal(r)!==!0)throw new Mt(i,wt.ModuleExportNotFound,e);t.setGlobal(r,AM(s,e.operator,t.global(r),e,i))}return nn}t=e.left.name.toLowerCase();const n=ss(i,e.right);if(i.localScope!=null&&i.localScope[t]!==void 0)return i.localScope[t]={value:AM(n,e.operator,i.localScope[t].value,e,i),valueset:!0,node:e.right},nn;if(i.globalScope[t]!==void 0)return i.globalScope[t]={value:AM(n,e.operator,i.globalScope[t].value,e,i),valueset:!0,node:e.right},nn;throw new Mt(i,wt.InvalidIdentifier,e)}function iBr(i,e){if(e.expression.type==="AssignmentExpression"||e.expression.type==="UpdateExpression")return ss(i,e.expression);if(e.expression.type==="CallExpression"){const t=ss(i,e.expression);return t===nn?nn:new C3(t)}{const t=ss(i,e.expression);return t===nn?nn:new C3(t)}}function rBr(i,e){const t=ss(i,e.test);if(t===!0)return ss(i,e.consequent);if(t===!1)return e.alternate!==null?ss(i,e.alternate):nn;throw new Mt(i,wt.BooleanConditionRequired,e)}function nBr(i,e){let t=nn;for(let r=0;r=t.length||r<0)throw new Mt(i,wt.OutOfBounds,e);return t[r]}throw new Mt(i,wt.InvalidMemberAccessKey,e)}if(Jr(t)){if(uo(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new Mt(i,wt.OutOfBounds,e);return t[r]}throw new Mt(i,wt.InvalidMemberAccessKey,e)}if(Jn(t)){if(uo(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new Mt(i,wt.OutOfBounds,e);return t.get(r)}throw new Mt(i,wt.InvalidMemberAccessKey,e)}throw new Mt(i,wt.InvalidMemberAccessKey,e)}}catch(t){throw t}}function dBr(i,e){try{const t=ss(i,e.argument);if(ha(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*Ai(t);if(e.operator==="+")return 1*Ai(t);if(e.operator==="~")return~Ai(t);throw new Mt(i,wt.UnsupportedUnaryOperator,e)}if(e.operator==="~")return~Ai(t);if(e.operator==="-")return-1*Ai(t);if(e.operator==="+")return 1*Ai(t);throw new Mt(i,wt.UnsupportedUnaryOperator,e)}catch(t){throw t}}function pBr(i,e){try{const t=[];for(let r=0;r>":case">>>":case"^":case"&":return LTe(Ai(r),Ai(n),e.operator);case"==":return a_(r,n);case"!=":return!a_(r,n);case"<":case">":case"<=":case">=":return kTe(r,n,e.operator);case"+":return Jr(r)||Jr(n)?en(r)+en(n):Ai(r)+Ai(n);case"-":return Ai(r)-Ai(n);case"*":return Ai(r)*Ai(n);case"/":return Ai(r)/Ai(n);case"%":return Ai(r)%Ai(n);default:throw new Mt(i,wt.UnsupportedOperator,e)}}catch(t){throw t}}function mBr(i,e){try{const t=ss(i,e.left);if(ha(t))switch(e.operator){case"||":if(t===!0)return t;{const r=ss(i,e.right);if(ha(r))return r;throw new Mt(i,wt.LogicExpressionOrAnd,e)}case"&&":if(t===!1)return t;{const r=ss(i,e.right);if(ha(r))return r;throw new Mt(i,wt.LogicExpressionOrAnd,e)}default:throw new Mt(i,wt.LogicExpressionOrAnd,e)}throw new Mt(i,wt.LogicalExpressionOnlyBoolean,e)}catch(t){throw t}}function gBr(i,e){return e.value?e.value.cooked:""}function yBr(i,e,t){if(mu(i))throw new Mt(e,wt.NoFunctionInTemplateLiteral,t);return i}function vBr(i,e){let t="",r=0;for(const n of e.quasis)t+=n.value?n.value.cooked:"",n.tail===!1&&(t+=e.expressions[r]?en(yBr(ss(i,e.expressions[r]),i,e)):"",r++);return t}function N9t(i,e){let t;try{const r=e.name.toLowerCase();if(i.localScope!=null&&i.localScope[r]!==void 0)return t=i.localScope[r],t.valueset===!0||(t.value=ss(i,t.node),t.valueset=!0),t.value;if(i.globalScope[r]!==void 0)return t=i.globalScope[r],t.valueset===!0||(t.value=ss(i,t.node),t.valueset=!0),t.value;throw new Mt(i,wt.InvalidIdentifier,e)}catch(r){throw r}}function _Br(i,e){try{if(e.callee.type==="MemberExpression"){const t=ss(i,e.callee.object);if(!(t instanceof vq))throw new Mt(i,wt.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:ss(i,e.callee.property);if(!t.hasGlobal(r))throw new Mt(i,wt.FunctionNotFound,e);const n=t.global(r);if(!mu(n))throw new Mt(i,wt.CallNonFunction,e);return n.call(i,e)}if(e.callee.type!=="Identifier")throw new Mt(i,wt.FunctionNotFound,e);if(i.localScope!=null&&i.localScope[e.callee.name.toLowerCase()]!==void 0){const t=i.localScope[e.callee.name.toLowerCase()];if(mu(t.value))return t.value.call(i,e);throw new Mt(i,wt.CallNonFunction,e)}if(i.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=i.globalScope[e.callee.name.toLowerCase()];if(mu(t.value))return t.value.call(i,e);throw new Mt(i,wt.CallNonFunction,e)}throw new Mt(i,wt.FunctionNotFound,e)}catch(t){throw t}}const dv={};function $9t(i,e,t,r){try{const n=e.arguments,s=ss(i,n[t]);if(a_(s,r))return ss(i,n[t+1]);{const o=n.length-t;return o===1?ss(i,n[t]):o===2?null:o===3?ss(i,n[t+2]):$9t(i,e,t+2,r)}}catch(n){throw n}}function B9t(i,e,t,r){try{const n=e.arguments;if(r===!0)return ss(i,n[t+1]);if(n.length-t===3)return ss(i,n[t+2]);{const s=ss(i,n[t+2]);if(ha(s)===!1)throw new Mt(i,wt.BooleanConditionRequired,n[t+2]);return B9t(i,e,t+2,s)}}catch(n){throw n}}function OOe(i,e,t,r){try{const n=i.body;if(t.length!==i.params.length)throw new Mt(e,wt.WrongNumberOfParameters,r);if(e.localScope!=null)for(let o=0;oqZe);return V9t=!0,M8r(i),!0}let ROe=null;function yXe(){return ROe!==null||(ROe=Y9t()),ROe}async function Y9t(){await M9r(),iE=await Promise.resolve().then(()=>H9n);for(const i of C6e)iE.extend(i),AB(i,"async");return C6e=null,!0}function X9t(){return z9t}function J9t(){return!!iE}function K9t(){return V9t}let DOe=null;function vXe(){return DOe||(DOe=Z9t(),DOe)}async function Z9t(){await yXe();const[i,e,t,r,n,s]=await Promise.all([Promise.resolve().then(()=>yBn),Promise.resolve().then(()=>xBn),Promise.resolve().then(()=>TBn),Promise.resolve().then(()=>EBn),Promise.resolve().then(()=>ABn),Promise.resolve().then(()=>RBn)]);return rBt=i,iE.extend([e,t,r,n,s]),AB([e,t,r,n,s],"async"),z9t=!0,!0}function Q9t(i,e=[]){return i.usesFeatureSet===void 0&&dle(i,e),i.usesFeatureSet===!0}function EBr(i,e=[]){return i.isAsync===void 0&&dle(i,e),i.isAsync===!0}function IBr(i,e){if(e){for(const t of e)if(jTe(i,t))return!0;return!1}return!1}async function eBt(i,e,t=[],r=!1,n=null){return _Xe(new Set,i,e,t,r,n)}async function _Xe(i,e,t,r=[],n=!1,s=null){const o=typeof e=="string"?fXe(e):e,a=[];return o&&(K9t()===!1&&(GTe(o)||n)&&a.push(gXe()),J9t()===!1&&(o.isAsync===!0||t)&&a.push(yXe()),X9t()===!1&&(Q9t(o)||IBr(o,r))&&a.push(vXe())),a.length&&await Promise.all(a),await tBt(i,o,s,t,n),!0}function ABr(i,e=[]){return i.usesModules===void 0&&dle(i,e),i.usesModules===!0}async function tBt(i,e,t=null,r=!1,n=!1){const s=u9t(e);t===null&&s.length>0&&(t=vU.getDefault()),e.loadedModules={};for(const o of s){Of(t);const a=t.normalizeModuleUri(o.source);if(i.has(a.uri))throw new Mt(null,wt.CircularModules,null);i.add(a.uri);const l=await t.fetchModule(a);await _Xe(i,l,r,[],n,t),i.delete(a.uri),l.isAsync&&(e.isAsync=!0),l.usesFeatureSet&&(e.usesFeatureSet=!0),l.usesGeometry&&(e.usesGeometry=!0),e.loadedModules[o.libname]={uri:a.uri,script:l}}}function iBt(i){if(GTe(i))return!0;const e=f6e(i);let t=!1;for(let r=0;r{tpt.test(o)&&(o=o.replace(tpt,""),n.push(o))});const s=n.filter(o=>o.includes("*"));return n=n.filter(o=>!s.includes(o)),e&&s.forEach(o=>{const a=new RegExp(`^${o.split(/\*+/).map(PBr).join(".*")}$`,"i");e.forEach(l=>a.test(l)?n.push(l):null)}),[...new Set(n.sort())]}function GBr(i){return jTe(i,"$view")}function UBr(i,e){return!!i&&jTe(i,e)}function zBr(i){if(!(!i||i.spatialReference==null&&(i.scale==null||i.viewingMode==null)))return{view:i.viewingMode&&i.scale!=null?new vn({viewingMode:i.viewingMode,scale:i.scale}):null,sr:i.spatialReference}}function VBr({url:i,spatialReference:e,lrucache:t,interceptor:r}){const n=UTe();return n?n.createFeatureSetCollectionFromService(i,e,t,r):null}function HBr({layer:i,spatialReference:e,outFields:t,returnGeometry:r,lrucache:n,interceptor:s}){if(i===null)return null;const o=UTe();return o?o.constructFeatureSet(i,e,t,r??!0,n,s):null}function WBr(i){if(i?.map===null)return null;const e=UTe();return e?e.createFeatureSetCollectionFromMap(i.map,i.spatialReference,i.lrucache,i.interceptor):null}function qBr(i,e){return vn.convertJsonToArcade(i,e)}function YBr(i,e,t=[]){return eBt(i,e,t)}function XBr(){return gXe()}function JBr(){return vXe()}function KBr(i){return i.type==="simple"||i.type==="class-breaks"||i.type==="unique-value"||i.type==="dot-density"||i.type==="dictionary"||i.type==="pie-chart"}function ZBr(i){return i.declaredClass==="esri.layers.support.LabelClass"}function QBr(i){return i.declaredClass==="esri.PopupTemplate"}function nBt(i,e){if(!i)return!1;if(typeof i=="string")return e(i);const t=i;if(KBr(t)){if(t.type==="dot-density"){const s=t.attributes?.some(o=>e(o.valueExpression));if(s)return s}const r=t.visualVariables,n=!!r&&r.some(s=>{let o=e(s.valueExpression);return s.type==="size"&&(ipt(s.minSize)&&(o=o||e(s.minSize.valueExpression)),ipt(s.maxSize)&&(o=o||e(s.maxSize.valueExpression))),o});return!(!("valueExpression"in t)||!e(t.valueExpression))||n}if(ZBr(t)){const r=t.labelExpressionInfo?.expression;return!(!r||!e(r))||!1}return!!QBr(t)&&(!!t.expressionInfos&&t.expressionInfos.some(r=>e(r.expression))||Array.isArray(t.content)&&t.content.some(r=>r.type==="expression"&&e(r.expressionInfo?.expression)))}function e7r(i){const e=ple(i);return!!e&&iBt(e)}function t7r(i){return nBt(i,e7r)}function i7r(i){const e=ple(i);return!!e&>e(e)}function r7r(i){return nBt(i,i7r)}function ipt(i){return i&&i.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const n7r=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:vn,arcade:MBr,arcadeFeature:Lc,convertFeatureLayerToFeatureSet:HBr,convertJsonToArcade:qBr,convertMapToFeatureSetCollection:WBr,convertServiceUrlToWorkspace:VBr,createExecContext:FBr,createFeature:kBr,createFunction:DBr,createSyntaxTree:ple,dependsOnView:GBr,enableFeatureSetOperations:JBr,enableGeometryOperations:XBr,evalSyntaxTree:NBr,executeAsyncFunction:BBr,executeFunction:$Br,extractFieldNames:jBr,getArcadeType:RBr,getViewInfo:zBr,hasGeometryFunctions:t7r,hasGeometryOperations:r7r,hasVariable:UBr,loadScriptDependencies:YBr,updateExecContext:LBr},Symbol.toStringTag,{value:"Module"}));function s7r(i){return i=i||globalThis.location.hostname,o7r.some(e=>i?.match(e)!=null)}function E6e(i,e){return i&&(e=e||globalThis.location.hostname)?e.match(sBt)!=null||e.match(aBt)!=null?i.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(oBt)!=null||e.match(lBt)!=null?i.replace("static.arcgis.com","staticqa.arcgis.com"):i:i}const sBt=/^devext.arcgis.com$/,oBt=/^qaext.arcgis.com$/,aBt=/^[\w-]*\.mapsdevext.arcgis.com$/,lBt=/^[\w-]*\.mapsqa.arcgis.com$/,o7r=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,sBt,oBt,/^jsapps.esri.com$/,aBt,lBt];function a7r(i,e,t,r){const n=i.name;return n==null?Promise.reject(new qe("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):i.styleName&&i.styleName==="Esri2DPointSymbolsStyle"?l7r(n,e,r):UMt(i,e,r).then(s=>cBt(s,n,e,t,Vir,r))}function uBt(i,e){return e.items.find(t=>t.name===i)}function cBt(i,e,t,r,n,s){const o=t?.portal!=null?t.portal:Bu.getDefault(),a={portal:o,url:Yo(i.baseUrl),origin:"portal-item"},l=uBt(e,i.data);if(!l){const m=`The symbol name '${e}' could not be found`;return Promise.reject(new qe("symbolstyleutils:symbol-name-not-found",m,{symbolName:e}))}let u=mE(n(l,r),a),c=l.thumbnail?.href??null;const h=l.thumbnail?.imageData;s7r()&&(u=E6e(u)??"",c=E6e(c));const p={portal:o,url:Yo(eae(u)),origin:"portal-item"};return wVe(u,s).then(m=>{const v=r==="cimRef"?zMt(m.data):m.data,w=wae(v,p);if(w&&JF(w)){if(c){const S=mE(c,a);w.thumbnail=new X8({url:S})}else h&&(w.thumbnail=new X8({url:`data:image/png;base64,${h}`}));i.styleUrl?w.styleOrigin=new Rne({portal:t.portal,styleUrl:i.styleUrl,name:e}):i.styleName&&(w.styleOrigin=new Rne({portal:t.portal,styleName:i.styleName,name:e}))}return w})}function l7r(i,e,t){const r=Hir.replaceAll(/\{SymbolName\}/gi,i),n=e.portal!=null?e.portal:Bu.getDefault();return wVe(r,t).then(s=>{const o=zMt(s.data);return wae(o,{portal:n,url:Yo(eae(r)),origin:"portal-item"})})}const u7r=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:cBt,getStyleItemFromStyle:uBt,resolveWebStyleSymbol:a7r},Symbol.toStringTag,{value:"Module"}));function c7r(i,e){for(var t=0;tr[n]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var hBt={exports:{}};(function(i,e){function t(){function n(A){if(typeof A=="number")return ye.Tc.Zg(A);if(A==null)return null;if(ht[A]!=null)return ye.Tc.Zg(ht[A]);throw Error("Unrecognised Unit Type")}function s(A){if(typeof A=="number")return ye.Tc.Zg(A);if(A==null)return null;if(Ht[A]!=null)return ye.Tc.Zg(Ht[A]);throw Error("Unrecognised Unit Type")}function o(A){if(A)switch(A){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function a(A,ue,G,E){if(G==null||G.B())return null;switch(G.getType()){case ye.qn.Point:return A.exportPoint(ue,G,E);case ye.qn.Polygon:return A.exportPolygon(ue,G,E);case ye.qn.Polyline:return A.exportPolyline(ue,G,E);case ye.qn.MultiPoint:return A.exportMultipoint(ue,G,E);case ye.qn.Envelope:return A.exportExtent(ue,G,E)}return null}function l(A,ue,G,E){if(G.getType()!==ye.qn.Point)throw Error("Geometry not Point");return A.exportPoint(ue,G,E)}function u(A,ue,G){return A.convertToGEGeometry(ue,G)}function c(A){var ue=A.wkid;A=A.wkt2||A.wkt;var G=_t.get(ue||A);return G==null&&(ue!==-1&&ue!=null?(G=ye.Eg.create(ue),_t.set(ue,G)):A&&(G=ye.Eg.qP(A),_t.set(A,G)),Yt.has(ue||A)&&G.VW(Yt.get(ue||A))),G}function h(A){var ue,G,E;if(A==null)return null;var _=c(A);return A=_.Hd(),_=_.Kn(),(ue={}).tolerance=_,ue.unitType=A==null?-1:A.od,ue.unitID=A==null?-1:A.Ec(),ue.unitBaseFactor=A==null?0:A.ai,ue.unitSquareDerivative=A==null?0:(E=(G=ye.Tc.aG(A))===null||G===void 0?void 0:G.Ec())!==null&&E!==void 0?E:0,ue}function p(A,ue,G,E){return G==null?null:(G=ye.$b.clip(u(A,Fe,G),u(A,Fe,E),c(ue)),a(A,Fe,G,ue))}function m(A,ue,G,E){G=ye.$b.dl(u(A,Fe,G),u(A,Fe,E),c(ue)),E=[];for(var _=0;_>6)>>1},E.Rn=function(_){return(32&_)!=0},E.US=function(_){return(128&_)!=0},E.yd=function(_){return(256&_)!=0},E.xj=function(_){return(512&_)!=0},E.Hc=function(_){return(1024&_)!=0},E.prototype.Of=function(){var _=this.Ia();return this.copyTo(_),_},E.prototype.mg=function(){return null},E.jg=function(_){var g=_.Ia();return _.copyTo(g),g},E.prototype.vc=function(){0<=this.VA&&(this.VA+=2147483649)},E.Ax=function(_){var g=_.getType();if(E.xj(g))return _.I();if(_.B())return 0;if(g==197)return 4;if(g==33)return 1;if(E.yd(g))return 2;throw A.i.fa("missing type")},E}();A.aa=G})(ye||(ye={})),Ke=ye||(ye={}),ke=function(){function A(){this.y=this.x=0}return A.construct=function(ue,G){var E=new A;return E.x=ue,E.y=G,E},A.al=function(ue){var G=new A;return G.x=ue.x,G.y=ue.y,G},A.prototype.ma=function(ue,G){this.x=ue,this.y=G},A.prototype.L=function(ue){this.x=ue.x,this.y=ue.y},A.prototype.fq=function(ue,G){return this.x===ue&&this.y===G},A.prototype.Rz=function(ue){return 2220446049250313e-31>=Math.abs(this.x-ue.x)&&2220446049250313e-31>=Math.abs(this.y-ue.y)},A.prototype.qb=function(ue){return this.x===ue.x&&this.y===ue.y},A.prototype.Nb=function(ue){return ue==this||ue instanceof A&&this.x==ue.x&&this.y==ue.y},A.prototype.sub=function(ue){this.x-=ue.x,this.y-=ue.y},A.prototype.uc=function(ue,G){this.x=ue.x-G.x,this.y=ue.y-G.y},A.prototype.add=function(ue,G){G!==void 0?(this.x=ue.x+G.x,this.y=ue.y+G.y):(this.x+=ue.x,this.y+=ue.y)},A.prototype.Sq=function(){this.x=-this.x,this.y=-this.y},A.prototype.mt=function(ue){this.x=-ue.x,this.y=-ue.y},A.prototype.NS=function(ue,G,E){this.x=ue.x*(1-E)+G.x*E,this.y=ue.y*(1-E)+G.y*E},A.prototype.Ct=function(ue,G){this.x=this.x*ue+G.x,this.y=this.y*ue+G.y},A.prototype.HW=function(ue,G,E){this.x=G.x*ue+E.x,this.y=G.y*ue+E.y},A.prototype.scale=function(ue){this.x*=ue,this.y*=ue},A.prototype.compare=function(ue){return this.yue.y?1:this.xue.x?1:0},A.prototype.normalize=function(){var ue=this.length();ue==0&&(this.x=1,this.y=0),this.x/=ue,this.y/=ue},A.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},A.prototype.Sk=function(){return this.x*this.x+this.y*this.y},A.tb=function(ue,G){return Math.sqrt(this.yc(ue,G))},A.Oy=function(ue,G,E,_){return ue-=E,G-=_,Math.sqrt(ue*ue+G*G)},A.prototype.Qh=function(ue){return this.x*ue.x+this.y*ue.y},A.prototype.fD=function(ue){return Math.abs(this.x*ue.x)+Math.abs(this.y*ue.y)},A.prototype.wi=function(ue){return this.x*ue.y-this.y*ue.x},A.prototype.Bt=function(ue,G){var E=-this.x*G+this.y*ue;this.x=this.x*ue+this.y*G,this.y=E},A.prototype.Hv=function(){var ue=this.x;this.x=-this.y,this.y=ue},A.prototype.MG=function(ue){this.x=-ue.y,this.y=ue.x},A.prototype.ar=function(){var ue=this.x;this.x=this.y,this.y=-ue},A.prototype.qu=function(){return 0(ue=ue.wi(G))?1:0(E=_.value())?-1:0E?-1:0=g?E+(_-E)*g:_-(_-E)*(1-g)},G.OG=function(E,_,g,b){.5>=g?(b.x=E.x+(_.x-E.x)*g,b.y=E.y+(_.y-E.y)*g):(b.x=_.x-(_.x-E.x)*(1-g),b.y=_.y-(_.y-E.y)*(1-g))},G.lT=function(E,_,g,b,C,O){.5>=C?(O.x=E+(g-E)*C,O.y=_+(b-_)*C):(O.x=g-(g-E)*(1-C),O.y=b-(b-_)*(1-C))},G}()}(ye||(ye={})),function(A){var ue=function(G){function E(){var _=G.call(this)||this;return _.sa=0,_.na=0,_.pa=0,_.la=0,_.ka=null,_}return me(E,G),E.prototype.ac=function(){return A.h.construct(this.sa,this.na)},E.prototype.Yp=function(_){_.x=this.sa,_.y=this.na},E.prototype.Dc=function(_){this.em(0,_)},E.prototype.ZB=function(_,g){this.em(0,A.h.construct(_,g))},E.prototype.To=function(_){this.hD(0,_)},E.prototype.setStart=function(_){this.uD(0,_)},E.prototype.wv=function(_,g){return this.Od(0,_,g)},E.prototype.YB=function(_,g,b){this.tn(0,_,g,b)},E.prototype.wc=function(){return A.h.construct(this.pa,this.la)},E.prototype.Tr=function(_){_.x=this.pa,_.y=this.la},E.prototype.Qc=function(_){this.em(1,_)},E.prototype.Ql=function(_,g){this.em(1,A.h.construct(_,g))},E.prototype.Po=function(_){this.hD(1,_)},E.prototype.setEnd=function(_){this.uD(1,_)},E.prototype.gv=function(_,g){return this.Od(1,_,g)},E.prototype.OB=function(_,g,b){this.tn(1,_,g,b)},E.prototype.Db=function(){return 1},E.prototype.B=function(){return this.Ac()},E.prototype.Oa=function(){},E.prototype.Ke=function(){return 0},E.prototype.Ea=function(_,g,b,C,O){return this.KM(_,g,b,C,O)},E.prototype.isIntersecting=function(_,g){return this.zr(_,g,!1)!=0},E.prototype.qs=function(_,g){return this.ru(_,g,!1)},E.prototype.ru=function(){return null},E.prototype.Ac=function(){return!1},E.prototype.ay=function(_){if(this.vc(),this.ka==null&&0<_)this.ka=A.O.lg(2*_);else if(this.ka!=null&&this.ka.length<2*_){for(var g=this.ka.slice(0),b=this.ka.length;b<2*_;b++)g[b]=0;this.ka=g}},E.gM=function(_,g,b){if(0=A.ra.Va(g))throw A.i.ce();var C=this.description.Pf(g);return 0<=C?(this.ka!=null&&this.ay(this.description.Ae.length-2),this.ka[E.Gg(this.description,_)+this.description.$j(C)-2+b]):A.ra.se(g)},E.prototype.tn=function(_,g,b,C){if(this.vc(),b>=A.ra.Va(g))throw A.i.ce();var O=this.description.Pf(g);0>O&&(this.re(g),O=this.description.Pf(g)),g==0?_!=0?b!=0?this.la=C:this.pa=C:b!=0?this.na=C:this.sa=C:(this.ka==null&&this.ay(this.description.Ae.length-2),this.ka[E.Gg(this.description,_)+this.description.$j(O)-2+b]=C)},E.prototype.copyTo=function(_){if(_.getType()!=this.getType())throw A.i.N();_.description=this.description,_.ay(this.description.Ae.length-2),E.gM(this.ka,_.ka,2*(this.description.Ae.length-2)),_.sa=this.sa,_.na=this.na,_.pa=this.pa,_.la=this.la,_.vc(),this.op(_)},E.prototype.Tg=function(_,g){var b=new A.Nc;return this.Ac()?(b.Oa(),b):(b.oa=this.Od(0,_,g),b.va=b.oa,b.Lk(this.Od(1,_,g)),b)},E.prototype.ZI=function(_){this.Ac()?_.Oa():(_.oa=this.Od(0,0,0),_.va=_.oa,_.Lk(this.Od(1,0,0)))},E.prototype.Tw=function(_,g){g.Nf(this.description),g.Cb(this.hc(_));for(var b=1,C=this.description.Aa;bg||g>=this.wa)throw A.i.fa("index out of bounds");this.mc(),b.Nf(this.description),b.B()&&b.un();for(var C=0;Cg||g>=this.I())throw A.i.ce();this.mc(),this.za[0].tc(2*g,b)},_.prototype.Na=function(g){var b=new A.h;return this.D(g,b),b},_.prototype.Gc=function(g,b){this.za[0].tc(2*g,b)},_.prototype.Cb=function(g,b,C){if(0>g||g>=this.wa)throw A.i.ce();this.mc();var O=this.za[0];C!==void 0?(O.write(2*g,b),O.write(2*g+1,C)):O.Tt(2*g,b),this.Pc(1993)},_.prototype.Cz=function(){if(void 0>=this.I())throw A.i.ce();this.mc();var g=this.za[0],b=new A.Nd;return b.x=g.read(NaN),b.y=g.read(NaN),b.z=this.hasAttribute(1)?this.za[1].eg():A.ra.se(1),b},_.prototype.dC=function(g){if(0>g||g>=this.I())throw A.i.ce();this.re(1),this.mc(),this.Pc(1993);var b=this.za[0];b.write(2*g,(void 0).x),b.write(2*g+1,(void 0).y),this.za[1].pr(g,(void 0).z)},_.prototype.Uc=function(g,b,C){if(0>b||b>=this.wa)throw A.i.ce();var O=A.ra.Va(g);if(C>=O)throw A.i.ce();this.mc();var F=this.description.Pf(g);return 0<=F?this.za[F].eg(b*O+C):A.ra.se(g)},_.prototype.yF=function(g,b){return this.Uc(g,b)},_.prototype.setAttribute=function(g,b,C,O){if(0>b||b>=this.wa)throw A.i.ce();var F=A.ra.Va(g);if(C>=F)throw A.i.ce();this.re(g),this.mc(),g=this.description.Pf(g),this.Pc(1993),this.za[g].pr(b*F+C,O)},_.prototype.ub=function(g){return this.wx(),this.re(g),this.mc(),this.za[this.description.Pf(g)]},_.prototype.hn=function(g,b){if(b!=null&&A.ra.Tp(g)!=b.Tp())throw A.i.N();this.re(g),g=this.description.Pf(g),this.za==null&&(this.za=A.Yc.qI(this.description.Aa)),this.za[g]=b,this.Pc(16777215)},_.prototype.sn=function(g){var b=null;if(this.za!=null){var C=A.ee.Iw(g,this.description);b=[];for(var O=0,F=g.Aa;Othis.wa+5?(5*this.wa+3)/4:this.wa),this.za[g].resize(O*C,A.ra.se(b))),Og)throw A.i.N();g!=this.wa&&(this.wa=g,this.Pc(65535))},_.prototype.om=function(g){if(!this.ak(1)){if(!this.ak(2))return 0;if(this.QT>=g)return this.ak(8)?1:2}return-1},_.prototype.Ch=function(g,b){if(this.QT=b,g==-1)this.Lf(1,!0),this.Lf(8,!0);else if(this.Lf(1,!1),this.Lf(8,!0),g==0)this.Lf(2,!1),this.Lf(4,!1);else if(g==1)this.Lf(2,!0),this.Lf(4,!1);else{if(g!=2)throw A.i.fa("internal error.");this.Lf(2,!0),this.Lf(4,!0)}},_.prototype.lM=function(){this.Bb!=null&&(this.Bb=null)},_.prototype.kD=function(g,b,C,O){if(0>g||g>=this.wa||0>b||b>=this.wa)throw A.i.fa("index out of bounds");this.mc(),O.Nf(this.description),O.B()&&O.un();for(var F=0;Fg||g>=this.wa)throw A.i.ce();this.mc();var b=new A.Sa;b.Nf(this.description),b.B()&&b.un();for(var C=0;Cg||g>=this.wa)throw A.i.ce();if(b.B())throw A.i.N();this.mc();for(var C=b.description,O=0;OA.O.bB(this.Tm)>>1:_!=-1)?E=_:b=F,_=!0;;){if(0>b){if((F=O[7*E])==-1){b=E,g=this.ob.Ll([-1,-1,E,g,this.gl(),-1,-1]),(O=this.ob.o)[7*E]=g;break}E=F}else{if((F=O[7*E+1])==-1){b=O[7*E+6],g=this.ob.Ll([-1,-1,E,g,this.gl(),-1,-1]),(O=this.ob.o)[7*E+1]=g;break}E=F}_&&(b*=-1,_=!1)}return this.oy(g,O),O[7*g+2]===-1&&(O[7*C]=g),this.vp(b,g,C,O),g},G.prototype.FF=function(){return this.iR(this.Qe)},G.prototype.vd=function(E,_){_=_==-1?this.Qe:_,this.Rv?this.LP(E,_):this.iY(E,_)},G.prototype.search=function(E,_){for(_=this.sv(_);_!=-1;){var g=this.Zn.compare(this,E,_);if(g==0)return _;_=0>g?this.ll(_):this.Xp(_)}return-1},G.prototype.IW=function(E){for(var _=this.sv(-1),g=-1;_!=-1;){var b=E.compare(this,_);if(b==0)return _;0>b?_=this.ll(_):(g=_,_=this.Xp(_))}return g},G.prototype.uJ=function(E){for(var _=this.sv(-1),g=-1;_!=-1;){var b=E.compare(this,_);if(b==0)return _;0>b?(g=_,_=this.ll(_)):_=this.Xp(_)}return g},G.prototype.ja=function(E){return this.ob.T(E,3)},G.prototype.ll=function(E){return this.ob.T(E,0)},G.prototype.Xp=function(E){return this.ob.T(E,1)},G.prototype.getParent=function(E){return this.ob.T(E,2)},G.prototype.lb=function(E){return this.ob.T(E,6)},G.prototype.we=function(E){return this.ob.T(E,5)},G.prototype.rc=function(E){return E==-1?this.kl(this.Qe):this.kl(E)},G.prototype.Fc=function(E){return E==-1?this.Zr(this.Qe):this.Zr(E)},G.prototype.ZR=function(E){return E==-1?this.bG(this.Qe):this.bG(E)},G.prototype.Sj=function(E,_){this.NB(E,_)},G.prototype.sv=function(E){return E==-1?this.YF(this.Qe):this.YF(E)},G.prototype.clear=function(){this.ob.mj(!1),this.Qe=-1},G.prototype.size=function(E){return E==-1?this.$F(this.Qe):this.$F(E)},G.prototype.KN=function(E,_){for(var g=_[7*E],b=_[7*E+1],C=_[7*E+4];g!=-1||b!=-1;){var O=g!=-1?_[7*g+4]:2147483647;if(b=b!=-1?_[7*b+4]:2147483647,C<=Math.min(O,b))break;O<=b?this.sJ(g,_):this.rJ(E,_),g=_[7*E],b=_[7*E+1]}},G.prototype.oy=function(E,_){if(this.Rv)for(var g=_[7*E+4],b=_[7*E+2];b!=-1&&_[7*b+4]>g;)_[7*b]==E?this.sJ(E,_):this.rJ(b,_),b=_[7*E+2]},G.prototype.rJ=function(E,_){var g=_[7*E+1];_[7*g+2]=_[7*E+2],_[7*E+2]=g;var b=_[7*g];_[7*E+1]=b,b!=-1&&(_[7*b+2]=E),_[7*g]=E,(b=_[7*g+2])!=-1&&(_[7*b]==E?_[7*b]=g:_[7*b+1]=g)},G.prototype.sJ=function(E,_){var g=_[7*E+2];_[7*E+2]=_[7*g+2],_[7*g+2]=E;var b=_[7*E+1];_[7*g]=b,b!=-1&&(_[7*b+2]=g),_[7*E+1]=g,(b=_[7*E+2])!=-1&&(_[7*b]===g?_[7*b]=E:_[7*b+1]=E)},G.prototype.Pk=function(E,_){this.ob.S(E,2,_)},G.prototype.TB=function(E,_){this.ob.S(E,0,_)},G.prototype.XB=function(E,_){this.ob.S(E,1,_)},G.prototype.WB=function(E,_){this.ob.S(E,5,_)},G.prototype.ex=function(E,_){this.ob.S(E,6,_)},G.prototype.XJ=function(E,_){this.ob.S(_,0,E)},G.prototype.rX=function(E){this.ob.S(E,4,0)},G.prototype.uX=function(E,_){this.ob.S(_,5,E)},G.prototype.YF=function(E){return E==-1?-1:this.ob.T(E,0)},G.prototype.kl=function(E){return E==-1?-1:this.ob.T(E,1)},G.prototype.Zr=function(E){return E==-1?-1:this.ob.T(E,2)},G.prototype.iR=function(E){return E==-1?-1:this.ob.T(E,3)},G.prototype.$F=function(E){return E==-1?0:this.ob.T(E,4)},G.prototype.bG=function(E){return this.ob.T(E,5)},G.prototype.Pw=function(){return this.ob.Ll([-1,-1,-1,void 0,this.gl(),-1,-1])},G.prototype.fl=function(E){E!=-1&&this.ob.jd(E)},G.prototype.gl=function(){return this.Tm=A.O.bB(this.Tm),1073741823&this.Tm},G.prototype.FD=function(E,_,g){var b=this.ob.o;if(g==-1||b[7*g]==-1)return E=this.ob.Ll([-1,-1,-1,E,this.gl(),-1,-1]),(b=this.ob.o)[7*g]=E,this.vp(-1,E,g,b),E;for(var C=g==-1?-1:b[7*g];;){var O=_==-1?1:this.Zn.compare(this,E,C);if(0>O){if((O=this.ll(C))==-1){_=C,E=this.ob.Ll([-1,-1,C,E,this.gl(),-1,-1]),(b=this.ob.o)[7*C]=E;break}C=O}else{if(_==1&&O==0)return b[7*g+3]=C,-1;if((O=b[7*C+1])==-1){_=b[7*C+6],E=this.ob.Ll([-1,-1,C,E,this.gl(),-1,-1]),(b=this.ob.o)[7*C+1]=E;break}C=O}}return this.oy(E,b),b[7*E+2]===-1&&(b[7*g]=E),this.vp(_,E,g,b),E},G.prototype.vp=function(E,_,g,b){if(E!=-1){var C=b[7*E+5];b[7*E+5]=_}else C=g==-1?-1:b[7*g+2];b[7*_+5]=C,C!=-1&&(b[7*C+6]=_),b[7*_+6]=E,E==(g==-1?-1:b[7*g+1])&&(b[7*g+1]=_),E==-1&&(b[7*g+2]=_),b[7*g+4]=(g==-1?0:b[7*g+4])+1},G.prototype.AB=function(E,_){var g=this.ob.o,b=g[7*E+5];E=g[7*E+6],b!=-1?g[7*b+6]=E:g[7*_+1]=E,E!=-1?g[7*E+5]=b:g[7*_+2]=b,g[7*_+4]=_===-1?-1:g[7*_+4]-1},G.prototype.iY=function(E,_){this.AB(E,_);var g=this.ll(E),b=this.Xp(E),C=this.getParent(E),O=E;if(g!=-1&&b!=-1){this.Tm=A.O.bB(this.Tm);var F=1073741823=E.oa:E.va>=this.oa},G.prototype.move=function(E){this.B()||(this.oa+=E,this.va+=E)},G.prototype.normalize=function(){if(!isNaN(this.oa)){if(this.oa>this.va){var E=this.oa;this.oa=this.va,this.va=E}isNaN(this.va)&&this.Oa()}},G.prototype.Oa=function(){this.va=this.oa=NaN},G.prototype.B=function(){return isNaN(this.oa)},G.prototype.Zb=function(E){typeof E=="number"?this.B()?this.va=this.oa=E:this.Lk(E):E.B()||(this.B()?(this.oa=E.oa,this.va=E.va):(this.oa>E.oa&&(this.oa=E.oa),this.vathis.va&&this.Oa()))},G.prototype.Lk=function(E){Ethis.va&&(this.va=E)},G.prototype.contains=function(E){return typeof E=="number"?E>=this.oa&&E<=this.va:E.oa>=this.oa&&E.va<=this.va},G.prototype.Ea=function(E){this.B()||E.B()?this.Oa():(this.oaE.va&&(this.va=E.va),this.oa>this.va&&this.Oa())},G.prototype.W=function(E){this.B()||(this.oa-=E,this.va+=E,this.va_?(this.oa=_,this.va=E):(this.oa=E,this.va=_)},G.prototype.It=function(E){return A.O.Rk(E,this.oa,this.va)},G.prototype.R=function(){return this.va-this.oa},G.prototype.sf=function(){return .5*(this.oa+this.va)},G.prototype.Nb=function(E){return E==this||E instanceof G&&(!(!this.B()||!E.B())||this.oa==E.oa&&this.va==E.va)},G.prototype.cc=function(){return A.O.uj(A.O.uj())},G}();A.Nc=ue}(ye||(ye={})),function(A){var ue=new A.Nc,G=new A.Nc,E=function(){this.ne=null,this.pb=-1,this.sb=new A.yb,this.qA=55555555,this.Tv=this.Vv=!1,this.Uf=new A.Nc,this.Uf.KB(0,0)};A.IY=E;var _=function(){function g(b,C,O){this.g=b,this.Hk=NaN,this.NH=this.Kq=0,this.OH=NaN,this.qa=C,this.Nq=10*C,this.PH=this.QH=NaN,this.rg=!1,this.Dm=this.gt=this.Lo=this.Xs=this.Ws=-1,this.gA=O,this.TA=new E,this.YH=new E,A.O.truncate(3*b.fd/2)}return g.prototype.mG=function(b,C,O,F){b.ne=F===null?null:F[O[5*C]],b.Tv=b.ne!=null,b.Tv||((F=O[5*C+2])!==-1&&this.g.mW(O[5*C],O[5*F],b.sb),b.ne=b.sb,b.Uf.KB(b.sb.sa,b.sb.pa),b.Uf.va+=this.qa,b.sb.rI(),b.Vv=b.sb.la==b.sb.na,b.Vv||(b.qA=(b.sb.pa-b.sb.sa)/(b.sb.la-b.sb.na)))},g.prototype.OO=function(b,C){var O=b.zr(C,this.qa,!0);return O!=0?O==2?this.Qy():this.xi():(b.Yp(ge),b.Tr(je),C.Yp(rt),C.Tr(Me),ie.ma(this.Kq,this.Hk),ge.qb(rt)&&this.Hk==ge.y?0>je.compare(Me)?ie.L(je):ie.L(Me):ge.qb(Me)&&this.Hk==ge.y?0>je.compare(rt)?ie.L(je):ie.L(rt):rt.qb(je)&&this.Hk==rt.y?0>ge.compare(Me)?ie.L(ge):ie.L(Me):je.qb(Me)&&this.Hk==je.y&&(0>ge.compare(rt)?ie.L(ge):ie.L(rt)),b.Pe(ie.y,ie.x)O&&0>b?-1:0C.pa){if(C.pa>C.sa&&C.la-C.na<2*this.qa&&b.vi(C.pa,C.la,this.qa))return this.xi()}else if((C.la-C.na)/(C.pa-C.sa)*(b.pa-b.sa)C.sa&&C.la-C.na<2*this.qa&&b.vi(C.pa,C.la,this.qa))return this.xi()}else if((C.la-C.na)/(C.pa-C.sa)*(b.sa-b.pa)F&&0>O?-1:0C+j?O:F.vi(b.sa,b.na,this.qa)?this.xi():NC+j?O:F.vi(b.pa,b.la,this.qa)?this.xi():NN?1:0)},g.prototype.Kr=function(){this.rg=!1},g.prototype.rm=function(){return this.Ni},g.prototype.$J=function(b,C){this.Hk=b,this.Kq=C,this.gt=this.Lo=this.Xs=this.Ws=-1},g.prototype.compare=function(b,C,O){return this.rg?-1:(b=b.ja(O),this.Dm=O,this.RE(C,C,b,b))},g.prototype.RE=function(b,C,O,F){if(this.Lo==C)var N=this.TA;else this.Lo=C,N=this.TA,this.TA.pb=b,this.mG(N,C,this.g.td.o,this.g.We);if(j==null){this.gt=F;var j=this.YH;this.YH.pb=O,this.mG(j,F,this.g.td.o,this.g.We)}return N.Tv||j.Tv?this.NO(C,F,N,j):N.Uf.vathis.Uf.va)return 1;if(this.ie.na==this.ie.la)return this.Dm=E,this.rg=!0,0;this.ie.rI(),g=this.ie.ac(),(_=new A.h).uc(this.ie.wc(),g),_.ar();var b=new A.h;return b.uc(this.Gq,g),g=_.Qh(b),(g/=_.length())<10*-this.qa?-1:g>10*this.qa?1:this.ie.qs(this.Gq,this.qa)&&((_=Math.abs(g))g?-1:1},G}();A.aM=ue}(ye||(ye={})),function(A){function ue(E,_,g,b){g=new Float64Array(E.subarray(g,b)),E.set(g,_)}var G=function(){function E(_){this.Pb=this.pk=!1,this.o=null;var g=_;2>g&&(g=2),this.o=new Float64Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Float64Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Float64Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Float64Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Float64Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();var j=this.size-N;if(jF&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g)throw A.i.N();if(g!=0){this.size<(g<<1)+_&&this.resize((g<<1)+_),g+=0;for(var C=0;C_||0>g||0>C||this.size_||0>g||this.size<(g>>1)+_)throw A.i.N();if(g!=0){g=0+g;for(var C=0;Cg&&(g=2),this.o=new Int32Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Int32Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Int32Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Int32Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Int32Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();if(ue(this.o,_+C,_,_+(N-_)),this.o==g.o&&_F&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g||0>C||this.sizeg-_?E.rG(this.o,_,g,b):E.qB(this.o,_,g-1,b)},E.prototype.Tp=function(){return 2},E.prototype.Fc=function(){return this.o[this.size-1]},E.prototype.If=function(){this.resize(this.size-1)},E.prototype.bX=function(_){this.o[this.size-1]=_},E.prototype.SV=function(_){_=g&&0=b))for(;;){if(9>b-g){E.rG(_,g,b+1,C);break}var O=_[g];E.tx(_,g,b);for(var F=g,N=g;N=C(_[N],O)&&(E.tx(_,F,N),F+=1);E.tx(_,F,b),F-gg&&(g=2),this.o=new Int8Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Int8Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Int8Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Int8Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Int8Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();if(ue(this.o,_+C,_,_+(N-_)),this.o==g.o&&_F&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g||0>C||this.sizeE?-E:E},G.ti=function(E){return 3552713678800501e-30>E},G.KC=function(E,_,g){return G.P(E-_)<=g*(1+(G.P(E)+G.P(_))/2)},G.Y=function(E,_){return G.KC(E,_,3552713678800501e-30)},G.FL=function(E){return 3552713678800501e-30>=G.P(E)},G.Cd=function(E){return G.FL(E)},G}();A.s=ue,A.F=function(){function G(){}return G.gp=function(E,_){var g=0;return(E=ue.P(E))+(_=ue.P(_))!=0&&(E>_?(g=_/E,g=E*Math.sqrt(1+g*g)):(g=E/_,g=_*Math.sqrt(1+g*g))),g},G.Wq=function(E,_,g,b,C){for(var O=[0,0,0],F=[0,0,0],N=0;2>=N;N++)_[N]-=E[N],g[N]-=_[N];g=O[1]*F[2]-O[2]*F[1],_=O[2]*F[0]-O[0]*F[2],O=O[0]*F[1]-O[1]*F[0],E=-1*(g*E[0]+_*E[1]+O*E[2]),b[0]=g,b[1]=_,b[2]=O,b[3]=E,F=G.on(b),b[0]/=F,b[1]/=F,b[2]/=F,b[3]/=F,C!=0&&(F=ue.Cd(O)?ue.Cd(E)?ue.Mb(1,_):-ue.Mb(1,E):ue.Mb(1,O),F*=ue.Mb(1,C),b[0]*=F,b[1]*=F,b[2]*=F,b[3]*=F)},G.zx=function(E,_,g){g[0]=E[1]*_[2]-_[1]*E[2],g[1]=E[2]*_[0]-_[2]*E[0],g[2]=E[0]*_[1]-_[0]*E[1]},G.St=function(E,_){return E[0]*_[0]+E[1]*_[1]+E[2]*_[2]},G.on=function(E){return G.gp(G.gp(E[0],E[1]),E[2])},G.cl=function(E,_,g,b,C,O,F,N){E=G.n(E,_,g);var j=Math.cos(g);O.u=(E+C)*j*Math.cos(b),F.u=(E+C)*j*Math.sin(b),N.u=(E*(1-_)+C)*Math.sin(g)},G.jO=function(E,_,g,b,C,O,F){var N=G.gp(_,g),j=1*Math.sqrt(1-E),W=j/1;if(ue.Y(N,0))O.u=0,C.u=ue.Mb(1.570796326794897,b),F.u=ue.P(b)-j;else{O.u=Math.atan2(g,_),g=Math.atan2(1*b,j*N),O=Math.cos(g);var q=Math.sin(g);_=j*E/(1-E),E*=1,g=Math.atan2(b+_*q*q*q,N-E*O*O*O),3.141592653589793E){var g=Math.sqrt(1-E),b=(1-g)/(1+g),C=b*b,O=b*C,F=b*O,N=b*F,j=b*N,W=b*j,q=1.572916666666667*O-3.2578125*N+4.295068359375*W;E=2.142578125*F-6.071484375*j,g=3.129296875*N-11.249837239583334*W;var J=4.775276692708333*j,ee=7.958636765252976*W,he=Math.cos(2*_);return _+Math.sin(2*_)*(1.5*b-.84375*O+.525390625*N-.2688395182291667*W-q+g-ee+he*(2*(1.3125*C-1.71875*F+1.650146484375*j)-4*E+6*J+he*(4*q-12*g+24*ee+he*(8*E-32*J+he*(16*g-80*ee+he*(32*J+64*he*ee))))))}for(g=1-E,b=E/2,O=(C=ue.P(_))*G.Zu(E)/(1.570796326794897*g),F=9999,j=C,C=0;1e-16C;C++)W=G.w(E,j),N=j-(q=(N=(G.kG(j,E)-b*Math.sin(2*j)/W)/g-O)/(W=1/(W*W*W))),F=ue.P(q),j=N;return 0<=_?j:-j},G.qW=function(E,_){return ue.ti(_)?E:E*G.Zu(_)/1.570796326794897},G.ba=function(E){return 0>(E=G.pF(E,6.283185307179586))?E+6.283185307179586:3.141592653589793>ue.P(E)||ue.Y(ue.P(E),3.141592653589793)?E:E-6.283185307179586},G.pF=function(E,_){return E-Math.floor(E/_)*_},G.Ah=function(E,_){if(.006884661117170036>_){var g=(_=(1-(_=Math.sqrt(1-_)))/(1+_))*_,b=g*g;return E/(1+_)*(1+.25*g+.015625*b+.00390625*g*b)*1.570796326794897}return E*G.Zu(_)},G.Vq=function(E,_){var g=ue.Mb(1,Math.sin(_));return _=1.570796326794897>=(_=ue.P(G.pF(_,3.141592653589793)))?_:3.141592653589793-_,(ue.Y(_,1.570796326794897)?_:Math.atan(Math.sqrt(1-E)*Math.tan(_)))*g},G.q=function(E,_,g){if(.006884661117170036>_){var b=(_=(1-(_=Math.sqrt(1-_)))/(1+_))*_,C=_*b,O=_*C,F=_*O,N=_*F,j=_*N,W=-.7291666666666666*C+.2278645833333333*F+.03987630208333334*j,q=.615234375*O-.21533203125*N,J=-.54140625*F+.20302734375*j,ee=.48876953125*N,he=-.4488699776785715*j,Ee=Math.cos(2*g);return E/(1+_)*((1+.25*b+.015625*O+.00390625*N)*g+Math.sin(2*g)*(-1.5*_+.1875*C+.0234375*F+.00732421875*j-W+J-he+Ee*(2*(.9375*b-.234375*O-.03662109375*N)-4*q+6*ee+Ee*(4*W-12*J+24*he+Ee*(8*q-32*ee+Ee*(16*J-80*he+Ee*(32*ee+64*Ee*he)))))))}return E*(G.kG(g,_)-.5*_*Math.sin(2*g)/G.w(_,g))},G.w=function(E,_){return _=Math.sin(_),Math.sqrt(1-E*_*_)},G.Zu=function(E){return ue.KC(E,1,2220446049250313e-31)?1:1>E?G.Xw(0,1-E)-E/3*G.Uw(0,1-E):NaN},G.kG=function(E,_){var g=ue.Mb(1,E);E=ue.P(E);var b=Math.floor(E/1.570796326794897);if(1<_)_=E==0?0:NaN;else if(ue.Cd(b))_=(E=G.sin(E))*G.Xw(1-E*E,1-_*E*E)-_/3*E*E*E*G.Uw(1-E*E,1-_*E*E);else{var C=A.O.truncate(b%2),O=G.Zu(_);0ue.P(b)&&1e-4>ue.P(C)&&1e-4>ue.P(O));)O=Math.sqrt(N),_+=E/((g=Math.sqrt(j))*(j+(O=Math.sqrt(F)*(O+g)+O*g))),E*=.25,F=.25*(F+O),N=.25*(N+O),j=.25*(j+O);return N=(F=b*C)-(j=O*O),3*_+E*(1+(j=F-6*j)*(.10227272727272728*j-.2142857142857143-.1730769230769231*O*(b=j+N+N))+O*(.1666666666666667*b+O*(-.4090909090909091*N+.1153846153846154*O*F)))/(g*Math.sqrt(g))},G.Xw=function(E,_){for(var g,b,C,O,F=1;b=2-((g=(E+_+F)/3)+E)/g,C=2-(g+_)/g,O=2-(g+F)/g,!(1e-4>ue.P(b)&&1e-4>ue.P(C)&&1e-4>ue.P(O));F=.25*(F+g))g=Math.sqrt(_),b=Math.sqrt(F),E=.25*(E+(g=Math.sqrt(E)*(g+b)+g*b)),_=.25*(_+g);return(1+(.04166666666666666*(E=b*C-O*O)-.1-.06818181818181818*(_=b*C*O))*E+.07142857142857142*_)/Math.sqrt(g)},G.Qw=function(E,_){if(ue.ti(E)||_==0||ue.Y(ue.P(_),1.570796326794897))return _;if(.006884661117170036>E){var g=E*E,b=E*g,C=E*b,O=E*C,F=E*O,N=E*F,j=-(.02708333333333333*b+.03430059523809524*C+.03149181547619048*O+.02634359154541446*F+.02156896735835538*N),W=.007669890873015873*C+.01299603174603175*O+.0148051353064374*F+.01454454953803912*N,q=-(.002275545634920635*O+.004830845032667949*F+.006558395368616723*N),J=.0006957236677288761*F+.001775193002406544*N,ee=-.000217324089394402*N,he=Math.cos(2*_);return _+Math.sin(2*_)*(-(.5*E+.2083333333333333*g+.09375*b+.04878472222222222*C+.02916666666666667*O+.01938905423280423*F+.01388255931712963*N)-j+q-ee+he*(2*(.1041666666666667*g+.0875*b+.06050347222222222*C+.04151785714285714*O+.02958958540013228*F+.02203667534722222*N)-4*W+6*J+he*(4*j-12*q+24*ee+he*(8*W-32*J+he*(16*q-80*ee+he*(32*J+64*he*ee))))))}return _==0||ue.Y(ue.P(_),1.570796326794897)?g=_:(C=(b=Math.sqrt(E))*Math.sin(_),g=Math.tan(.7853981633974483+_/2)*Math.pow((1-C)/(1+C),b/2),g=2*Math.atan(g)-1.570796326794897),g},G.yO=function(E,_){if(ue.ti(E)||_==0||ue.Y(ue.P(_),1.570796326794897))return _;if(.006884661117170036>E){var g=E*(J=E*(q=E*(he=E*E))),b=E*(ee=E*g),C=.05833333333333333*q+.07232142857142858*J+.05634300595238095*g+.0355325796406526*ee+.020235546186067*b,O=.02653149801587302*J+.04379960317460317*g+.0429211791776896*ee+.03255384637546096*b,F=.01294022817460318*g+.02668104344536636*ee+.03155651254609588*b,N=.00659454790965208*ee+.0163075268674227*b,j=.003463473736911237*b,W=Math.cos(2*_);return _+Math.sin(2*_)*(.5*E+.2083333333333333*he+.08333333333333333*q+.03611111111111111*J+.01875*g+.01195601851851852*ee+.008863673941798942*b-C+F-j+W*(2*(.1458333333333333*he+.1208333333333333*q+.07039930555555556*J+.03616071428571429*g+.01839451058201058*ee+.01017113095238095*b)-4*O+6*N+W*(4*C-12*F+24*j+W*(8*O-32*N+W*(16*F-80*j+W*(32*N+64*W*j))))))}var q=Math.sqrt(E),J=q/2,ee=Math.tan(.7853981633974483+_/2);E=0,C=1;for(var he=_;C!=0;he=b)g=q*Math.sin(he),b=ee*Math.pow((1+g)/(1-g),J),b=2*Math.atan(b)-1.570796326794897,E++,(ue.Y(b,he)||3e4this.Kk&&(this.Kk=0);var g=this.Ue.getType();if(this.jH=g==A.Sc.PE_TYPE_PROJCS?2:1,g==A.Sc.PE_TYPE_PROJCS&&!E.loadConstants())throw A.i.N("PeProjcs.loadConstants failed");_=g==A.Sc.PE_TYPE_GEOGCS?this.Ue:this.Ue.getGeogcs(),g!=A.Sc.PE_TYPE_GEOGCS&&A.pf.getCode(_),this.Eo=E.getUnit(),this.RH=_.getPrimem().getLongitude(),this.wH=E=_.getUnit().getUnitFactor(),E=Math.PI/(180*E),1e-10>Math.abs(E-1)&&(E=1),this.GA=E,g&A.Sc.PE_TYPE_PROJCS?(_=this.Ue,this.HA=1/_.getUnit().getUnitFactor(),this.sw=.001/this.Ue.getUnit().getUnitFactor(),this.tw=A.Cg.generate(_,A.Cg.PE_PCSINFO_OPTION_NONE),this.zl=this.tw.isPannableRectangle(),this.bA=A.zb.qN(this.tw.getCentralMeridian(),this.GA)):(this.KA=this.zl=!0,this.HA=0,g=1/_.getUnit().getUnitFactor(),this.sw=.001/_.getDatum().getSpheroid().getAxis()*g,this.bA=0),this.zl&&(this.xx(),this.DK(),this.nY(),this.CK(),this.lY(),this.mY())}return G.prototype.$r=function(){return this.Kk},G.prototype.kk=function(){return this.tw},G.Py=function(E,_){return E==_||E!=null&&_!=null&&E.Kk==0&&_.Kk==0&&E.As===_.As},G.prototype.Wc=function(){return this.zl},G.prototype.gh=function(E){E.K(this.so)},G.prototype.pv=function(){return this.so.v},G.prototype.ov=function(){return this.so.C},G.prototype.GR=function(E){E.K(this.uw)},G.prototype.lY=function(){var E=this.Ue.getType();if(E==A.Sc.PE_TYPE_PROJCS){E=this.Ue;var _=this.kk().getCentralMeridian(),g=E.getGeogcs();if(g==null)throw A.i.fa("internal error");_=[[_+(g=1/g.getUnit().getUnitFactor()*Math.PI),0]],A.ej.geogToProj(E,1,_),_=_[0][0],g=E.getParameters()[A.Sc.PE_PARM_X0].getValue();var b=this.ml();E=new A.l,b.A(E),_=(b=Math.abs(_-g))+g,g=-1*b+g,b=E.H,E=E.G;var C=new A.l;C.K(g,E,_,b),this.so==null&&(this.so=C)}else{if(E!=A.Sc.PE_TYPE_GEOGCS)throw A.i.fa("internal error");g=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(E=new A.l).K(-g,-g/2,g,g/2),this.so==null&&(this.so=E)}},G.prototype.mY=function(){var E=this.Ue.getType();if(E==A.Sc.PE_TYPE_PROJCS){var _=this.Ue;if(E=this.kk().getCentralMeridian(),(_=_.getGeogcs())==null)throw A.i.fa("internal error");_=1/_.getUnit().getUnitFactor()*Math.PI;var g=this.Vr(),b=new A.l;g.A(b),(g=new A.l).K(E-_,b.G,E+_,b.H),this.uw==null&&(this.uw=g)}else{if(E!=A.Sc.PE_TYPE_GEOGCS)throw A.i.fa("internal error");_=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(E=new A.l).K(-_,-_/2,_,_/2),this.uw==null&&(this.uw=E)}},G.prototype.bf=function(){return this.GA},G.prototype.pm=function(){return this.HA},G.prototype.Vr=function(){if(this.zl)return this.ul;var E=this.ul;return E??(this.xx(),this.ul)},G.prototype.Wr=function(){return this.zl?null:(this.ul!=null||this.xx(),this.YG)},G.prototype.xx=function(){if(this.Ue.getType()==A.Sc.PE_TYPE_PROJCS){var E=this.Ue,_=E.getGeogcs(),g=E.horizonGcsGenerate();if(g!=null){var b=g[0].getNump(),C=g[0].getKind();E=0j&&(g=-400*O,q.K(g,q.G,g+5*N,q.H)),g=new A.Fh(q),this.ul==null&&(this.ul=g,this.Iv=E);else{if(j=new A.Da,N=this.kk().isGcsHorizonMultiOverlap(),q=A.gu.bF(_,A.hu.Integer64),N){for(j=new A.gL,W=A.Gh.local().V(j,q,null),ee=0;eethis.ss&&(this.ss=0),this.Eo=_=this.KT.getUnit(),this.IH=1/_.getUnitFactor(),A.pf.getCode(E)}return G.Py=function(E,_){return E==_||E!=null&&_!=null&&E.ss==0&&_.ss==0&&E.As===_.As},G.prototype.$r=function(){return this.ss},G}();A.PL=ue}(ye||(ye={})),function(A){A.Yg=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F){if(C!=null||O!=null||F!=null){g=A.F.ba(g),E=A.F.ba(E),_=A.F.ba(_),b=A.F.ba(b),1.570796326794897_?g:A.F.ba(3.141592653589793-g):Math.atan2(q*he,j*J-W*q*ee)),F!=null&&(A.s.Y(A.s.P(b),1.570796326794897)?F.u=0>b?E:A.F.ba(3.141592653589793-E):(F.u=Math.atan2(j*he,J*j*ee-q*W),F.u=A.F.ba(F.u+3.141592653589793)))}}},ue.rf=function(G,E,_,g,b,C,O){if(C!=null||O!=null){E=A.F.ba(E),_=A.F.ba(_),1.570796326794897J?b:A.F.ba(3.141592653589793-b):E:A.s.Y(A.s.P(_),1.570796326794897)&&A.s.Y(G,3.141592653589793)?0>_?b:A.F.ba(3.141592653589793-b):A.F.ba(E+Math.atan2(q*N,j*g-W*q*F)))}},ue}()}(ye||(ye={})),function(A){A.Wk=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=new A.ga(0),W=new A.ga(0),q=[0,0,0],J=[0,0,0],ee=[0,0,0],he=new A.ga(0),Ee=new A.ga(0),De=new A.ga(0),pt=new A.ga(0),Et=new A.ga(0);if(O!=null||F!=null||N!=null)if(A.s.ti(E))A.Yg.tb(G,_,g,b,C,O,F,N);else{b=A.F.ba(b),_=A.F.ba(_);var Ye=A.F.ba(b-_);if(A.s.Y(g,C)&&(A.s.Y(_,b)||A.s.Y(A.s.P(g),1.570796326794897)))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.Y(g,-C)){if(A.s.Y(A.s.P(g),1.570796326794897))return O!=null&&(O.u=2*A.F.Ah(G,E)),F!=null&&(F.u=0Ye){jt=1;var ei=_;_=b,b=ei,ei=g,g=C,C=ei}Ye=A.F.ot(E,g);var Xt=A.F.ot(E,C);F==null&&N==null||(A.Yg.tb(G,_,Ye,b,Xt,null,j,W),j=Math.atan2(Math.sin(j.u)*Math.cos(g-Ye),Math.cos(j.u)),W=Math.atan2(Math.sin(W.u)*Math.cos(C-Xt),Math.cos(W.u)),jt!=0&&(ei=j,j=W,W=ei),F!=null&&(F.u=j),N!=null&&(N.u=W)),O!=null&&(A.F.cl(1,E,g,_,0,De,pt,Et),q[0]=De.u,q[1]=pt.u,q[2]=Et.u,A.F.cl(1,E,C,b,0,De,pt,Et),J[0]=De.u,J[1]=pt.u,J[2]=Et.u,ee[0]=q[1]*J[2]-J[1]*q[2],ee[1]=-(q[0]*J[2]-J[0]*q[2]),ee[2]=q[0]*J[1]-J[0]*q[1],E=1-A.F.w(E,A.F.Vq(E,A.F.Qj(E,Math.acos(ee[2]/Math.sqrt(ee[0]*ee[0]+ee[1]*ee[1]+ee[2]*ee[2]))))),E*=2-E,F=Math.atan2(-ee[1],-ee[0]),ee=A.F.ba(F-1.570796326794897),F=A.F.ba(F+1.570796326794897),ee=A.s.P(A.F.ba(_-ee))<=A.s.P(A.F.ba(_-F))?ee:F,A.Yg.tb(1,ee,0,_,Ye,he,null,null),A.Yg.tb(1,ee,0,b,Xt,Ee,null,null),3.141592653589793b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),_=A.F.ba(_),g=A.F.ba(g),1.570796326794897=A.s.P(C)?1:-1);C=A.F.ba(_+Math.atan(Math.tan(C)*-Math.sin(De))),A.Yg.tb(G,C,0,_,De,null,W,null),De=A.s.P(1.570796326794897-A.s.P(W.u)),De=A.F.Qj(E,De),De=1-A.F.w(E,A.F.Vq(E,De)),De*=2-De,A.F.cl(1,E,0,C,0,ee,he,Ee),q[0]=ee.u,q[1]=he.u,q[2]=Ee.u,A.F.cl(1,E,g,_,0,ee,he,Ee),J[0]=ee.u,J[1]=he.u,J[2]=Ee.u,g=Math.acos((q[0]*J[0]+q[1]*J[1]+q[2]*J[2])/Math.sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2])),g=A.F.Qj(De,g),b=0<(g=A.F.q(G,De,g)+b*pt)?W.u:A.F.ba(W.u+3.141592653589793),G=A.s.P(g)/A.F.Ah(G,De)*1.570796326794897,G=A.F.Rq(De,G),G=A.F.ot(De,G),A.Yg.rf(1,C,0,G,b,O,j),F!=null&&(N=j.u),F!=null&&(F.u=A.F.Qj(E,N))}},ue}()}(ye||(ye={})),function(A){A.cu=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=0,W=0,q=0;if(O!=null||F!=null||N!=null)if(A.s.ti(E))A.Yg.tb(G,_,g,b,C,O,F,N);else{var J=A.F.ba(b-_);if(A.s.Y(g,C)&&(A.s.Cd(J)||A.s.Y(A.s.P(g),1.570796326794897)))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.Y(g,-C)){if(A.s.Y(A.s.P(g),1.570796326794897))return O!=null&&(O.u=2*A.F.Ah(G,E)),F!=null&&(F.u=0=pi&&!A.s.Y(Ri,jt));if(wi!=0)ee=(he*=j)*(256+he*(he*(74-47*he)-128))/1024,O!=null&&(O.u=Ee*(1+he*(4096+he*(he*(320-175*he)-768))/16384)*(mi-ee*Ui*(W+ee/4*(Bi*(2*q-1)-ee/6*W*(4*Ui*Ui-3)*(4*q-3))))),F!=null&&(F.u=A.s.Y(A.s.P(g),1.570796326794897)?0>g?b:A.F.ba(3.141592653589793-b):Math.atan2(Et*Xt,E*Ye-pt*Et*ei)),N!=null&&(A.s.Y(A.s.P(C),1.570796326794897)?N.u=0>C?_:A.F.ba(3.141592653589793-_):(N.u=Math.atan2(E*Xt,E*Ye*ei-pt*Et),N.u=A.F.ba(N.u+3.141592653589793)));else{jt=A.s.Mb(3.141592653589793,J),Bi=pt*Ye-E*Et,mi=Math.acos(Bi),Ui=Math.sin(mi),j=1,pi=ar=0;do q=ar,ei=1-.25*(ar=ee*(j*=j)*(1+ee+ee*ee))+.1875*(W=ee*ee*(ei=j*j)*(1+2.25*ee))-.1953125*(wi=ee*ee*ee*ei*j),ar=.25*ar-.25*W+.29296875*wi,Xt=.03125*W-.05859375*wi,wi*=.00651041666666667,W=Bi-2*pt*Ye/j,1=pi&&!A.s.Y(q,ar));O!=null&&(ei=1+(he*=j*=j)*(4096+he*(he*(320-175*he)-768))/16384,A.s.Y(g,-C)?O.u=3.141592653589793*Ee*ei:(W=Bi-2*pt*Ye/j,j=Math.acos(W),Bi=Math.cos(2*j),Ri=Math.cos(3*j),O.u=Ee*(ei*mi+he*(he*(128+he*(35*he-60))-512)/2048*Ui*W+he*(5*he-4)/6144*he*he*Math.sin(2*mi)*Bi+wi*Math.sin(3*mi)*Ri+-762939453125e-16*he*he*he*he*Math.sin(4*mi)*Math.cos(4*j)))),F!=null&&(A.s.Cd(g)&&A.s.Cd(C)?(j=Math.sqrt(1-ar*ar),F.u=Math.acos(j),0>J&&(F.u*=-1)):A.s.Y(A.s.P(g),1.570796326794897)?F.u=0>g?b:A.F.ba(3.141592653589793-b):(O=ar/E,Ee=Math.sqrt(1-O*O),0>E*Ye-pt*Et*Math.cos(jt)&&(Ee*=-1),F.u=Math.atan2(O,Ee),A.s.Y(g,-C)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(0A.s.P(F.u)||0>g&&1.570796326794897C?_:A.F.ba(3.141592653589793-_):(J=ar/Et,O=Math.sqrt(1-J*J),Ee=Math.sin(jt/2),0>Math.sin(De-G)-2*E*Ye*Ee*Ee&&(O*=-1),N.u=Math.atan2(J,O),N.u=A.F.ba(N.u+3.141592653589793),A.s.Y(g,-C)&&!A.s.Cd(g)&&!A.s.Y(A.s.P(g),1.570796326794897)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(F!=null?Ee=F.u:(O=ar/E,Ee=Math.sqrt(1-O*O),0>E*Ye-pt*Et*Math.cos(jt)&&(Ee*=-1),Ee=Math.atan2(O,Ee),A.s.Y(g,-C)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(0A.s.P(Ee)||0>g&&1.570796326794897=A.s.P(Ee)&&1.570796326794897A.s.P(N.u))&&(N.u=-1*A.F.ba(N.u+3.141592653589793))))}}}},ue.rf=function(G,E,_,g,b,C,O,F){if(O!=null||F!=null)if(A.s.ti(E))A.Yg.rf(G,_,g,b,C,O,F);else if(C=A.F.ba(C),A.s.Y(A.s.P(g),1.570796326794897)||A.s.Cd(C)||A.s.Y(A.s.P(C),3.141592653589793))A.Wk.rf(G,E,_,g,b,C,O,F);else{var N=A.s.P(C)==1.570796326794897?0:Math.cos(C),j=A.s.P(C)==3.141592653589793?0:Math.sin(C);A.s.Y(A.s.P(g),1.570796326794897)&&(_=0),C=1-Math.sqrt(1-E);var W=A.F.Vq(E,g);g=A.s.P(W)==1.570796326794897?0:Math.cos(W);var q=Math.sin(W);W=Math.atan2(Math.tan(W),N);var J=g*j,ee=J*J,he=1-ee,Ee=E/(1-E)*he,De=(E=Ee*(256+Ee*(Ee*(74-47*Ee)-128))/1024)/4,pt=E/6,Et=b/(G*(1-C)*(1+Ee*(4096+Ee*(Ee*(320-175*Ee)-768))/16384)),Ye=Et;do{var jt=Ye;b=A.s.P(Ye)==1.570796326794897?0:Math.cos(Ye);var ei=(Ee=A.s.P(Ye)==3.141592653589793?0:Math.sin(Ye))*Ee;Ye=E*Ee*((G=Math.cos(2*W+Ye))+De*(b*(2*(Ye=G*G)-1)-pt*G*(4*ei-3)*(4*Ye-3)))+Et}while(!A.s.Y(jt,Ye));b=A.s.P(Ye)==1.570796326794897?0:Math.cos(Ye),Ee=A.s.P(Ye)==3.141592653589793?0:Math.sin(Ye),O!=null&&(j=Math.atan2(Ee*j,g*b-q*Ee*N),he=C/16*he*(4+C*(4-3*he)),G=Math.cos(2*W+Ye),O.u=A.F.ba(_+(j-(1-he)*C*J*(Ye+he*Ee*(G+he*b*(2*G*G-1)))))),F!=null&&(he=q*Ee-g*b*N,he=(1-C)*Math.sqrt(ee+he*he),F.u=Math.atan2(q*b+g*Ee*N,he))}},ue}()}(ye||(ye={})),function(A){A.PC=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=A.F.ba(b-_),W=A.s.Y(A.s.P(g),1.570796326794897),q=A.s.Y(A.s.P(C),1.570796326794897);if(A.s.Y(g,C)&&(A.s.Cd(j)||W))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.ti(E)){var J=Math.sin(g),ee=Math.sin(C);J=Math.sqrt((1+J)/(1-J)),ee=Math.sqrt((1+ee)/(1-ee)),J=Math.log(ee)-Math.log(J),J=Math.atan2(j,J),O!=null&&(O.u=A.s.Y(g,C)?A.s.P(G*Math.cos(g)*j):A.s.P((G*C-G*g)/Math.cos(J)))}else ee=A.F.Qw(E,C),J=Math.sin(A.F.Qw(E,g)),ee=Math.sin(ee),J=Math.sqrt((1+J)/(1-J)),ee=Math.sqrt((1+ee)/(1-ee)),J=Math.log(ee)-Math.log(J),J=Math.atan2(j,J),O!=null&&(A.s.Y(g,C)?O.u=A.s.P(G*j*Math.cos(g)/A.F.w(E,g)):(j=A.F.q(G,E,g),G=A.F.q(G,E,C),O.u=A.s.P((G-j)/Math.cos(J))));F==null&&N==null||(O=A.F.ba(J+3.141592653589793),W&&q||!W&&!q||(W?J=0>g?b:A.F.ba(3.141592653589793-b):q&&(O=0>C?_:A.F.ba(3.141592653589793-_))),F!=null&&(F.u=J),N!=null&&(N.u=O))}},ue.rf=function(G,E,_,g,b,C,O,F){C=A.F.ba(C),0>b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),A.s.ti(E)?A.s.Y(A.s.P(g),1.570796326794897)?(_=0>g?C:A.F.ba(3.141592653589793-C),3.141592653589793>=(C=b/G%6.283185307179586)?G=g-A.s.Mb(C,g):(_=A.F.ba(_+3.141592653589793),G=-g+A.s.Mb(C-3.141592653589793,g))):A.s.Y(A.s.P(C),1.570796326794897)?(_=A.F.ba(_+A.s.Mb(b,C)/(G*Math.cos(g))),G=g):(G=g+b*Math.cos(C)/G,1.570796326794897g?C:A.F.ba(3.141592653589793-C),C=b/A.F.qW(G,E),3.141592653589793>=(C%=6.283185307179586)?G=g-A.s.Mb(C,g):(_=A.F.ba(_+3.141592653589793),G=-g+A.s.Mb(C-3.141592653589793,g)),G=A.F.Rq(E,G)):A.s.Y(A.s.P(C),1.570796326794897)?(_=A.F.ba(_+A.s.Mb(b,C)*A.F.w(E,g)/(G*Math.cos(g))),G=g):(G=1.570796326794897*(b*Math.cos(C)+A.F.q(G,E,g))/A.F.Ah(G,E),1.570796326794897Math.PI||Math.abs(g.y)>.5*Math.PI||Math.abs(b.y)>.5*Math.PI||(Math.abs(g.y)==.5*Math.PI||Math.abs(b.y)==.5*Math.PI)&&g.x!=b.x)return NaN;if(C=E.cB(C,Math.min(g.x,b.x),Math.max(g.x,b.x)),!new A.Nc(g.x,b.x).contains(C))return NaN;var O=ue.construct(g);if(b=ue.construct(b),O=E.Yu(_,O),b=E.Yu(_,b),(b=O.cF(b)).z.qg())return g.y;var F=new A.Wb;F.set(b.x),F.jm(b.z),F.No(-1);var N=new A.Wb;N.set(b.y),N.jm(b.z),N.No(-1);var j=new A.Wb;return j.set(N),j.Ag(N),(O=new A.Wb).set(F),O.Ag(F),O.add(j),O.sqrt(),O.qg()||F.qg()&&N.qg()?g.y:(g=Math.atan2(N.value(),F.value()),g=Math.atan2(O.value()*Math.cos(g-C),1-_),C=E.DP(_,A.h.construct(C,g)),_=new A.Nd(C.x,C.y,-C.z),C=b.value().Qh(C),_=b.value().Qh(_),Math.abs(_)Math.PI||Math.abs(g.y)>.5*Math.PI||Math.abs(b.y)>.5*Math.PI||(Math.abs(g.y)==.5*Math.PI||Math.abs(b.y)==.5*Math.PI)&&g.x!=b.x||Math.abs(C)>=.5*Math.PI||0C&&b.y>C||0>g.y&&0>b.y&&g.yMath.abs(O[1]-g.x)&&(g=O[0],O[0]=O[1],O[1]=g)),C))},E.cB=function(_,g,b){return _>b?_-=2*(g=Math.ceil((_-b)/(2*Math.PI)))*Math.PI:_b.x?(b.x-=b.x%360,-180>b.x&&(b.x+=360)):180b.y&&(b.y=-90);for(var C=-180,O=180,F=(G=5*_)-1,N=(E=(G+31)/32)-1;0<=N;N--)for(var j=F-32*N,W=Math.min(32,G-32*N),q=1;q=J?(g[N]|=1<=J?(g[N]|=1<>C&31;if(31<(C+=5)){var N=37-C;F&=(1<E)for(O=0;O<_-E;O++)g.push("0");else _=E[0]?E:'"'+E.trim()+'"'}var G=[];A.XC=function(){function E(){}return E.EQ=function(_){try{for(var g=0;g_||_>this.Aa)throw A.i.N();return this.bg[_]},E.prototype.Pf=function(_){return this.uh[_]},E.lz=function(_){return E.JM[_]},E.Tp=function(_){return E.SM[_]},E.Va=function(_){return E.rM[_]},E.prototype.hasAttribute=function(_){return 0<=this.uh[_]},E.prototype.iG=function(){return this.hasAttribute(1)},E.se=function(_){return E.eD[_]},E.prototype.LR=function(_){return this.Vs[_]},E.DG=function(_,g){return E.eD[_]===g},E.prototype.Nb=function(_){return this===_},E.prototype.An=function(){for(var _=A.O.Th(this.bg[0]),g=1;g++F&&G(O,j,C.eu),W[0]?N?j=F:(W=O.c,j=O.e+j+1):++j;W.lengthO.Bd&&W[0]?"-":"")+(1j?"e":"e+")+j:O.toString()}function G(O,F,N,j){var W=O.c,q=O.e+F+1;if(N===1?j=5<=W[q]:N===2?j=5q||W[q+1]!==void 0||1&W[q-1]):N===3?j=j||W[q]!==void 0||0>q:(j=!1,N!==0&&E("!Big.RM!")),1>q||!W[0])j?(O.e=-F,O.c=[1]):O.c=[O.e=0];else{if(W.length=q--,j)for(;9<++W[q];)W[q]=0,q--||(++O.e,W.unshift(1));for(q=W.length;!W[--q];W.pop());}return O}function E(O){throw(O=Error(O)).name="BigError",O}var _=-7,g=21,b=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,C=function(){function O(F){if(F instanceof O)this.Bd=F.Bd,this.e=F.e,this.c=F.c.slice();else{var N,j,W;for(F===0&&0>1/F?F="-0":b.test(F+="")||E(NaN),this.Bd=F.charAt(0)=="-"?(F=F.slice(1),-1):1,-1<(N=F.indexOf("."))&&(F=F.replace(".","")),0<(j=F.search(/e/i))?(0>N&&(N=j),N+=+F.slice(j+1),F=F.substring(0,j)):0>N&&(N=F.length),j=0;F.charAt(j)=="0";j++);if(j==(W=F.length))this.c=[this.e=0];else{for(;F.charAt(--W)=="0";);for(this.e=N-j-1,this.c=[],N=0;j<=W;this.c[N++]=+F.charAt(j++));}}}return O.prototype.abs=function(){var F=new O(this);return F.Bd=1,F},O.prototype.cmp=function(F){var N=this.c,j=(F=new O(F)).c,W=this.Bd,q=F.Bd,J=this.e,ee=F.e;if(!N[0]||!j[0])return N[0]?W:j[0]?-q:0;if(W!=q)return W;if(F=0>W,J!=ee)return J>(ee^F)?1:-1;for(W=-1,q=(J=N.length)<(ee=j.length)?J:ee;++W(j[W]^F)?1:-1;return J==ee?0:J>(ee^F)?1:-1},O.prototype.jm=function(F){var N=this.c,j=(F=new O(F)).c,W=this.Bd==F.Bd?1:-1,q=O.rr;if((q!==~~q||0>q||1e6Xt?0:Xt,he.unshift(0);Et++ee;ee++){if(J!=(Et=pt.length))var wi=J>Et?1:-1;else{var pi=-1;for(wi=0;++pipt[pi]?1:-1;break}}if(!(0>wi))break;for(F=Et==J?j:he;Et;){if(pt[--Et]Xt&&G(Ye,q,O.eu,pt[0]!==void 0),Ye},O.prototype.fS=function(){return 0this.cmp(0)},O.prototype.jt=function(F){var N,j=this.Bd,W=(F=new O(F)).Bd;if(j!=W)return F.Bd=-W,this.tI(F);var q=this.c.slice(),J=this.e,ee=F.c,he=F.e;if(!q[0]||!ee[0])return ee[0]?(F.Bd=-W,F):new O(q[0]?this:0);if(j=J-he){for((N=0>j)?(j=-j,J=q):(he=J,J=ee),J.reverse(),W=j;W--;J.push(0));J.reverse()}else for(J=((N=q.lengthj;){if(q[--J]W.length-J.length&&(j=J,J=W,W=j),N=J.length,j=0;N;)j=(W[--N]=W[N]+J[N]+j)/10|0,W[N]%=10;for(j&&(W.unshift(j),++q),N=W.length;W[--N]==0;W.pop());return F.c=W,F.e=q,F},O.prototype.pow=function(F){var N=this,j=new O(1),W=j,q=0>F;for((F!==~~F||-1e6>F||1e6>=1;)N=N.lr(N);return q?j.jm(W):W},O.prototype.round=function(F,N){var j=this;return F==null?F=0:(F!==~~F||0>F||1e6N&&E(NaN),(N=Math.sqrt(this.toString()))==0||N==1/0?((N=F.join("")).length+j&1||(N+="0"),(F=new O(Math.sqrt(N).toString())).e=((j+1)/2|0)-(0>j||1&j)):F=new O(N.toString()),N=F.e+(O.rr+=4);do j=F,F=W.lr(j.tI(this.jm(j)));while(j.c.slice(0,N).join("")!==F.c.slice(0,N).join(""));return G(F,O.rr-=4,O.eu),F},O.prototype.lr=function(F){var N=this.c,j=(F=new O(F)).c,W=N.length,q=j.length,J=this.e,ee=F.e;if(F.Bd=this.Bd==F.Bd?1:-1,!N[0]||!j[0])return new O(0*F.Bd);if(F.e=J+ee,WJ;)q=he[ee]+j[J]*N[ee-J-1]+q,he[ee--]=q%10,q=q/10|0;he[ee]=(he[ee]+q)%10}for(q&&++F.e,he[0]||he.shift(),J=he.length;!he[--J];he.pop());return F.c=he,F},O.prototype.toString=function(){var F=this.e,N=this.c.join(""),j=N.length;if(F<=_||F>=g)N=N.charAt(0)+(1F?"e":"e+")+F;else if(0>F){for(;++F;N="0"+N);N="0."+N}else if(0j)for(F-=j;F--;N+="0");else Fthis.Bd&&this.c[0]?"-"+N:N},O.prototype.toExponential=function(F){return F==null?F=this.c.length-1:(F!==~~F||0>F||1e6=F&&(W=ue(this,this.e+F),0>this.Bd&&this.c[0]&&0>W.indexOf("-")&&(W="-"+W));return _=N,g=j,W||E("!toFix!"),W},O.prototype.toPrecision=function(F){return F==null?this.toString():((F!==~~F||1>F||1e6C.get(J)?(C.set(N,2147483647),N=J):C.set(J,2147483647),j++;else{if(!(1&j))C.set(N,2147483647);else if(_)return g!=null&&(g[0]=!0),null;F.L(q),N=J,j=1}if(!(1&j))C.set(N,2147483647);else if(_)return g!=null&&(g[0]=!0),null;if(!_)for(C.Vd(0,C.size,function(he,Ee){return he-Ee}),J=0,ee=C.size;Jg-_)b.nr(_,g,E);else{var C=!0;try{for(var O=1/0,F=-1/0,N=_;NF&&(F=j)}if(this.reset(g-_,O,F,g-_)){for(N=_;NC&&b.nr(_+C,_+g,E);100E||g==_)&&(E=Math.min(G.hL,E),this.yf.Jb(E),this.yf.resize(E),this.yf.Wj(0,0,this.yf.size),this.EH=_,this.ys.resize(b),this.Es=(g-_)/(E-1),!0)},G.prototype.zF=function(E){return A.O.truncate((E-this.EH)/this.Es)},G.hL=65536,G}();A.Xt=ue}(ye||(ye={})),function(A){var ue,G;(G=ue||(ue={}))[G.enum_line=1]="enum_line",G[G.enum_arc=2]="enum_arc",G[G.enum_dummy=4]="enum_dummy",G[G.enum_concave_dip=8]="enum_concave_dip",G[G.enum_connection=3]="enum_connection";var E=function(){function O(){}return O.Qu=function(F,N,j,W,q,J){var ee=new O;return ee.Im=new A.h,ee.Vm=new A.h,ee.aw=new A.h,ee.Im.L(F),ee.Vm.L(N),ee.aw.L(j),ee.Co=W,ee.qh=q,ee.sh=J,ee},O.construct=function(F,N,j,W){var q=new O;return q.Im=new A.h,q.Vm=new A.h,q.aw=new A.h,q.Im.L(F),q.Vm.L(N),q.aw.Rc(),q.Co=4,q.qh=j,q.sh=W,q},O}(),_=function(){function O(F,N,j,W,q,J){this.Yv=null,this.ya=0,this.EA=F,this.bI=this.$H=0,this.Ka=N,this.Mj=j,this.vk=W,this.Dq=q,this.Ub=J}return O.prototype.next=function(){for(var F=new A.Sa;;){if(this.ya==this.EA.I())return null;if(this.EA.ve(this.ya,F),this.ya++,!F.B())break}var N=!1;if(this.Yv==null&&(this.$H=F.Lg(),this.bI=F.ih(),this.Yv=C.buffer(F,this.Ka,this.Mj,this.vk,this.Dq,this.Ub),N=!0),this.yaW)throw A.i.N();if(F.B())return new A.Da(F.description);var ee=new A.l;return F.xc(ee),0=q&&(q=96),J.rb=Math.abs(J.Ka),J.Kv=J.rb!=0?1/J.rb:0,isNaN(W)||W==0?W=1e-5*J.rb:W>.5*J.rb&&(W=.5*J.rb),12>q&&(q=12),(F=Math.abs(N)*(1-Math.cos(Math.PI/q)))>W?W=F:(F=Math.PI/Math.acos(1-W/Math.abs(N)))(q=A.O.truncate(F))&&(q=12,W=Math.abs(N)*(1-Math.cos(Math.PI/q))),J.vk=W,J.Dq=q,J.tA=Math.min(J.ct,.25*W),J.lE()},O.prototype.cv=function(){if(this.Id==null)this.Id=[];else if(this.Id.length!==0)return;var F=this.qE();F=A.O.truncate((F+3)/4);var N=.5*Math.PI/F;this.oA=N;for(var j=0;j<4*F;j++)this.Id.push(null);var W=Math.cos(N);N=Math.sin(N);var q=A.h.construct(0,1);for(j=0;j=this.Ka&&(F=new A.l,this.X.A(F),F.R()<=2*-this.Ka||F.ca()<=2*this.Ka))return new A.Da(this.X.description)}switch(this.X.getType()){case 33:return this.PN();case 550:return this.ON();case 1607:return this.RN();case 1736:return this.QN();case 197:return this.LN();default:throw A.i.Qa()}},O.prototype.RN=function(){if(this.EG(this.X)){var F=new A.Sa;this.X.ve(0,F);var N=new A.l;return this.X.A(N),F.Cb(N.sf()),this.Gu(F)}return this.X=this.WV(this.X),F=new g(this,this.oq),A.Gh.local().V(F,this.Mj,this.Ub).next()},O.prototype.QN=function(){if(this.Ka==0)return this.X;var F=A.Yl.local();if(this.cv(),this.X=F.V(this.X,null,!1,this.Ub),0>this.Ka){var N=this.X;return N=this.py(N,0,N.da()),F.V(N,this.Mj,!1,this.Ub)}return this.EG(this.X)?(F=new A.Sa,this.X.ve(0,F),N=new A.l,this.X.A(N),F.Cb(N.sf()),this.Gu(F)):(F=new b(this),A.Gh.local().V(F,this.Mj,this.Ub).next())},O.prototype.py=function(F,N,j){for(var W=new A.Da(F.description);NF.Ja(N))){var q=F.Ir(N),J=new A.l;if(F.Rj(N,J),0=this.Ka){if(this.Ka==0)F.ad(this.X,!1);else{var N=new A.Fh;this.X.bn(N),N.W(this.Ka,this.Ka),F.ad(N,!1)}return F}return F.ad(this.X,!1),this.X=F,this.jE(F,0)},O.prototype.jE=function(F,N){this.cv();var j=new A.Da(F.description),W=new A.h,q=new A.h,J=new A.h,ee=new A.h,he=new A.h,Ee=new A.h,De=new A.h,pt=new A.h,Et=F.Ja(N),Ye=F.Ba(N),jt=0;for(N=F.Ja(N);jtF.Ja(N))return null;if(this.FG(F,N)&&0(F=-1>F?4:2*Math.PI/Math.acos(F)+.5)?F=4:F>this.Dq&&(F=this.Dq),A.O.truncate(F)},O.prototype.GD=function(F,N,j,W,q){this.cv();var J=new A.h;J.uc(j,N),J.scale(this.Kv);var ee=new A.h;ee.uc(W,N),ee.scale(this.Kv),0>(J=Math.atan2(J.y,J.x)/this.oA)&&(J=this.Id.length+J),J=this.Id.length-J,0>(ee=Math.atan2(ee.y,ee.x)/this.oA)&&(ee=this.Id.length+ee),(ee=this.Id.length-ee)J.I(ee))return 0>q||(q=F,J=new A.Sa,q.ve(q.Ba(N),J),this.yu(j,J)),1;var he=J.Na(J.Xa(J.Ob(ee))),Ee=new A.Dd;if(Ee.gg(-he.x,-he.y),J.Oc(Ee),W&&(this.tQ(J,ee,q),2>J.I(ee)))return 0>q||(q=F,J=new A.Sa,q.ve(q.Ba(N),J),this.yu(j,J)),1;this.Zd.length=0;var De=J.Ob(ee);N=J.Xa(De);var pt=q==1?J.Ma(N):J.U(N);F=q==1?J.U(N):J.Ma(N);var Et=!0;W=new A.h,ee=new A.h;var Ye=new A.h,jt=new A.h,ei=new A.h,Xt=new A.h,wi=new A.h,pi=new A.h,Ri=new A.h,Ui=new A.h,Bi=this.rb;De=J.Ja(De);for(var mi=0;mipt||0>Et&&pt==0?this.Zd.push(E.Qu(jt,ei,W,2,this.Zd.length+1,this.Zd.length-1)):jt.qb(ei)||(this.Zd.push(E.construct(jt,W,this.Zd.length+1,this.Zd.length-1,"dummy")),this.Zd.push(E.construct(W,ei,this.Zd.length+1,this.Zd.length-1,"dummy"))),Xt.add(ee,Ri),this.Zd.push(E.Qu(ei,Xt,W,1,this.Zd.length+1,this.Zd.length-1)),jt.L(Xt),Ui.L(Ri),Ye.L(W),W.L(ee),pi.L(wi),pt=N,N=F,Et=!1,F=q==1?J.U(N):J.Ma(N);return this.Zd[this.Zd.length-1].qh=0,this.Zd[0].sh=this.Zd.length-1,this.YV(j),Ee.gg(he.x,he.y),j.YD(Ee,j.da()-1),1},O.prototype.YV=function(F){for(var N=this.zO(),j=!0,W=N+1,q=N;W!=N;q=W){var J=this.Zd[q];W=J.qh!=-1?J.qh:(q+1)%this.Zd.length,J.Co!=0&&(j&&F.Lt(J.Im),J.Co==2?this.GD(F,J.aw,J.Im,J.Vm,!0):F.Ci(J.Vm),j=!1)}},O.prototype.zO=function(){this.Ks==null&&(this.Ks=[null,null,null,null,null,null,null,null,null]);for(var F=0,N=0,j=this.Zd.length;N=this.rb)return!0}return!1},O.prototype.tQ=function(F,N,j){for(var W=0;1>W;W++){var q=!1,J=F.Ob(N),ee=F.Ja(J);if(ee==0)break;var he=ee;if(3>ee)break;!F.dc(J)&&(he=ee-1),J=F.Xa(J),ee=0Wi||0>Fr&&Wi==0||!this.Fv(jt,Et,Ye)||(wi.L(Ye),ds=!1,++ar,q=!0),ds){if(0.5*this.vk?(Xt.add(jt,Et),Xt.scale(.5),Ui.normalize(),Ui.ar(),Bi.L(Ui),Bi.scale(mi-ar),Xt.add(Bi),F.mf(ee,Xt)):F.pd(ee,!0),ar=0}jt.L(Et),De=J}Et.L(Ye),ee=J,J=Ee,Ee=0N?(this.oq=!1,F):(this.oq=!0,A.Fg.Mk(F,this.ct,!1,!0,this.Ub))},O.prototype.yu=function(F,N){if(N=N.D(),this.Id!=null&&this.Id.length!==0){var j=new A.h;j.L(this.Id[0]),j.Ct(this.rb,N),F.Lt(j);for(var W=1,q=this.Id.length;W=g?1:-1;case 1:if(E.G=g?1:-1;case 2:if(E.v>=g&&E.C>g)break;return E.C<=g?1:-1;case 3:if(!(E.G>=g&&E.H>g))return E.H<=g?1:-1}return 0},G.prototype.Ay=function(E,_){return E.getType()==1736?this.Cy(E,_):this.Dy(E)},G.prototype.Cy=function(E,_){if(this.Ca.R()==0||this.Ca.ca()==0)return E.Ia();var g=new A.l;E.xc(g),this.X=this.g.Ib(E);var b=new A.l,C=new A.l,O=new A.h,F=new A.h,N=[0,0,0,0,0,0,0,0,0],j=[0,0,0,0,0,0,0,0,0];new A.ig;var W=new A.yb,q=new A.ia(0);q.Jb(Math.min(100,E.I()));for(var J=!1,ee=0;!J&&4>ee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=g.v<=De&&g.C>=De;break;case 1:De=this.Ca.G,he=g.G<=De&&g.H>=De;break;case 2:De=this.Ca.C,he=g.v<=De&&g.C>=De;break;case 3:De=this.Ca.H,he=g.G<=De&&g.H>=De}if(he)for(J=!0,he=this.g.Ob(this.X);he!=-1;){var pt=-1,Et=-1,Ye=this.g.Xa(he),jt=Ye;do{var ei=this.g.bc(jt);ei==null&&(ei=W,this.g.D(jt,O),ei.Dc(O),this.g.D(this.g.U(jt),F),ei.Qc(F)),ei.A(b);var Xt=this.Lh(b,ee,De),wi=0,pi=-1;if(Xt==-1){wi=0<(ei=ei.cq(Ee,De,N,j))?this.g.Ul(jt,j,ei):0,wi+=1;var Ri=jt,Ui=this.g.U(Ri);for(ei=0;eithis.g.Ja(he)?this.g.Zq(he):this.g.Rb(he)}}return J?E.Ia():(this.FB(),0<_&&this.My(_),this.g.Ne(this.X))},G.prototype.Dy=function(E){var _=new A.l,g=new A.l,b=[0,0,0,0,0,0,0,0,0],C=[0,0,0,0,0,0,0,0,0],O=new A.ig,F=E,N=new A.l;E.xc(N);for(var j=0;4>j;j++){var W=!1,q=(1&j)!=0,J=0;switch(j){case 0:J=this.Ca.v,W=N.v<=J&&N.C>=J;break;case 1:J=this.Ca.G,W=N.G<=J&&N.H>=J;break;case 2:J=this.Ca.C,W=N.v<=J&&N.C>=J;break;case 3:J=this.Ca.H,W=N.G<=J&&N.H>=J}if(W){W=F,F=E.Ia(),(W=W.Ga()).Zi();for(var ee,he=new A.h;W.$a();)for(var Ee,De=!0;W.Ha();){var pt=W.ha();pt.A(_);var Et=this.Lh(_,j,J);if(Et==-1){if(0<(Et=pt.cq(q,J,b,C))){var Ye=0;ee=pt.ac();for(var jt=0;jt<=Et;jt++)if(Ye!=(Ee=jt=(j=A.O.truncate(Math.min(Math.ceil(j/E),2048)))))){for(var W=1;WC.size)){var q=this;C.Vd(0,C.size,function(Xt,wi){return q.Mh(Xt,wi)}),g=new A.h,O=new A.h,F=new A.h,O.Rc();var J=-1;N=new A.ia(0),j=new A.ia(0),W=this.g.Gd();for(var ee=this.g.Gd(),he=0,Ee=C.size;hethis.Mh(J,Et)&&(this.g.D(Et,g),E?g.y==_:g.x==_)&&(N.add(J),Ye=!0,this.g.Ra(J,ee,1)),0>this.Mh(J,De)&&(this.g.D(De,g),E?g.y==_:g.x==_)&&(Ye||N.add(J),this.g.Ra(J,W,1))}for(pt=0,Ye=N.size;ptthis.Mh(Ee,pt)&&(this.g.D(pt,N),E?N.y==_:N.x==_)&&(De=pt),pt=-1;var Et=this.g.Ma(Ee);if(0>this.Mh(Ee,Et)&&(this.g.D(Et,N),E?N.y==_:N.x==_)&&(pt=Et),De!=-1&&pt!=-1)this.Kh(Ee,b,C),this.g.pd(Ee,!1),this.Kh(De,b,C),this.g.pd(De,!1),q=!0;else if(De!=-1||pt!=-1){for(Et=he+1;Etthis.Mh(Ye,jt)&&(this.g.D(jt,N),E?N.y==_:N.x==_)&&(ei=jt),jt=this.g.Ma(Ye);var Xt=-1;if(0>this.Mh(Ye,jt)&&(this.g.D(jt,N),E?N.y==_:N.x==_)&&(Xt=jt),ei!=-1&&Xt!=-1){this.Kh(Ye,b,C),this.g.pd(Ye,!1),this.Kh(ei,b,C),this.g.pd(ei,!1),q=!0;break}if(De!=-1&&Xt!=-1){this.zt(b,Ee,De,Ye,Xt,C),q=!0;break}if(pt!=-1&&ei!=-1){this.zt(b,Ye,ei,Ee,pt,C),q=!0;break}}}if(q)break}}}if(!q)break}J=O,j.L(g)}}this.g.Td(C)},G.prototype.Kh=function(E,_,g){g=this.g.Pa(E,g),_.set(g,-1),g=this.g.Pa(E,this.ji),this.dd.set(g,-1),(_=this.g.bd(E))!=-1&&this.g.Xa(_)==E&&(this.g.Jf(_,-1),this.g.Wg(_,-1))},G.prototype.zt=function(E,_,g,b,C,O){this.g.Bc(_,b),this.g.Cc(b,_),this.g.Cc(g,C),this.g.Bc(C,g),this.Kh(b,E,O),this.g.mi(b,!1),this.Kh(C,E,O),this.g.mi(C,!0)},G.prototype.Ty=function(){for(var E=0,_=this.dd.size;E<_;E++){var g=this.dd.get(E);g!=-1&&this.g.aj(g,-1)}for(var b=0,C=0,O=this.g.Ob(this.X);O!=-1;){var F=this.g.Xa(O);if(F==-1||O!=this.g.bd(F)){var N=O;O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)}else{g=F,N=0;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),this.g.pd(F,!1)),N=O,O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)):(this.g.cp(O,!1),this.g.Wg(O,this.g.Ma(F)),this.g.Vj(O,N),C+=N,b++,O=this.g.Rb(O))}}for(E=0,_=this.dd.size;E<_;E++)if((g=this.dd.get(E))!=-1&&(O=this.g.bd(g))==-1){O=this.g.vf(this.X,-1),N=0,F=g;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(0<=(g=this.g.Pa(F,this.ji))&&this.dd.set(g,-1),this.g.pd(F,!1)),N=O,this.g.Jf(N,-1),this.g.$q(N)):(this.g.kn(O,!0),this.g.Vj(O,N),this.g.Jf(O,F),this.g.Wg(O,this.g.Ma(F)),this.g.cp(O,!1),C+=N,b++)}for(this.g.Rl(this.X,b),this.g.Tj(this.X,C),E=0,_=this.g.ld;_!=-1;_=this.g.ue(_))E+=this.g.I(_);this.g.bC(E)},G.By=function(E,_,g){return new G(_).Ay(E,g)},G.clip=function(E,_,g,b){if(E.B())return E;if(_.B())return E.Ia();if((g=E.getType())==33)return b=E.D(),_.contains(b)?E:E.Ia();if(g==197)return b=new A.l,E.A(b),b.Ea(_)?(_=new A.Fh,E.copyTo(_),_.Xo(b),_):E.Ia();var C=new A.l;if(E.xc(C),_.contains(C))return E;if(!_.isIntersecting(C))return E.Ia();if((C=E.Bb)!=null&&(C=C.Fk)!=null){if((C=C.Ro(_))==1){if(g!=1736)throw A.i.Qa();return(E=new A.Da(E.description)).tp(_),E}if(C==0)return E.Ia()}switch(g){case 550:g=null,C=E.I();for(var O=E.ub(0),F=0,N=0;N=g?1:-1;case 1:if(E.G=g?1:-1;case 2:if(E.v>=g&&E.C>g)break;return E.C<=g?1:-1;case 3:if(!(E.G>=g&&E.H>g))return E.H<=g?1:-1}return 0},G.prototype.Ay=function(E,_){return E.getType()==1736?this.Cy(E,_):this.Dy(E)},G.prototype.Cy=function(E,_){if(this.Ca.R()==0||this.Ca.ca()==0)return E.Ia();var g=new A.l;E.xc(g),this.X=this.g.Ib(E);var b=new A.l,C=new A.l,O=new A.h,F=new A.h,N=[0,0,0,0,0,0,0,0,0],j=[0,0,0,0,0,0,0,0,0],W=new A.yb,q=new A.ia(0);q.Jb(256);for(var J=!1,ee=0;!J&&4>ee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=g.v<=De&&g.C>=De;break;case 1:De=this.Ca.G,he=g.G<=De&&g.H>=De;break;case 2:De=this.Ca.C,he=g.v<=De&&g.C>=De;break;case 3:De=this.Ca.H,he=g.G<=De&&g.H>=De}if(he)for(J=!0,he=this.g.Ob(this.X);he!=-1;){var pt=!0,Et=-1,Ye=-1,jt=this.g.Xa(he),ei=jt;do{var Xt=this.g.bc(ei);Xt==null&&(Xt=W,this.g.D(ei,O),Xt.Dc(O),this.g.D(this.g.U(ei),F),Xt.Qc(F)),Xt.A(b);var wi=this.Lh(b,ee,De),pi=0,Ri=-1;if(wi==-1){pi=0<(Xt=Xt.cq(Ee,De,N,j))?this.g.LX(ei,j,Xt):0,pi+=1;var Ui=ei,Bi=this.g.U(Ui);for(Xt=0;Xtee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=N.v<=De&&N.C>=De;break;case 1:De=this.Ca.G,he=N.G<=De&&N.H>=De;break;case 2:De=this.Ca.C,he=N.v<=De&&N.C>=De;break;case 3:De=this.Ca.H,he=N.G<=De&&N.H>=De}if(he)for(he=F,F=E.Ia(),(he=he.Ga()).Zi();he.$a();)for(var pt,Et=!0;he.Ha();){var Ye=he.ha();Ye.A(_);var jt=this.Lh(_,ee,De);if(jt==-1){if(0<(jt=Ye.cq(Ee,De,b,C))){var ei=0;Ye.Yp(j);for(var Xt=0;Xt<=jt;Xt++)if(ei!=(pt=Xtb.x&&(b.x+=E)}else J=_.y-this.Ca.G,C.y=A.lc.sign(g.y-_.y),b.y=E*A.lc.Cn(Math.floor(Math.abs(J/E)),J)+this.Ca.G,0>b.y&&(b.y+=E);J=q!=0?g.y-_.y:g.x-_.x;var ee=Math.abs(J);if(65536=Ee||(O[ee]=Ee,ee++)}ee!=0&&this.g.Ul(j,O,ee)}}j=W}while(j!=N)}},G.prototype.Vl=function(E,_){for(var g=-1,b=new A.h,C=null,O=this.g.Ob(this.X);O!=-1;O=this.g.Rb(O))for(var F=this.g.Xa(O),N=0,j=this.g.Ja(O);NC.size)){var q=this;C.Vd(0,C.size,function(Xt,wi){return q.Mh(Xt,wi)}),g=new A.h,O=new A.h,F=new A.h,O.Rc();var J=-1;N=new A.ia(0),j=new A.ia(0),W=null;for(var ee=this.g.Gd(),he=this.g.Gd(),Ee=0,De=C.size;EeO.compare(g)&&(E?g.y==_:g.x==_)&&(N.add(J),jt=!0,this.g.Ra(J,he,1)),this.g.D(pt,g),0>O.compare(g)&&(E?g.y==_:g.x==_)&&(jt||N.add(J),this.g.Ra(J,ee,1))}for(Et=0,jt=N.size;Etj.compare(N)&&(E?N.y==_:N.x==_)&&(De=pt),pt=-1;var Et=this.g.Ma(Ee);if(this.g.D(Et,N),0>j.compare(N)&&(E?N.y==_:N.x==_)&&(pt=Et),De!=-1&&pt!=-1)this.Kh(Ee,b,C),this.g.pd(Ee,!1),this.Kh(De,b,C),this.g.pd(De,!1),q=!0;else if(De!=-1||pt!=-1){for(Et=he+1;Etj.compare(N)&&(E?N.y==_:N.x==_)&&(ei=jt),jt=this.g.Ma(Ye);var Xt=-1;if(this.g.D(jt,N),0>j.compare(N)&&(E?N.y==_:N.x==_)&&(Xt=jt),ei!=-1&&Xt!=-1){this.Kh(Ye,b,C),this.g.pd(Ye,!1),this.Kh(ei,b,C),this.g.pd(ei,!1),q=!0;break}if(De!=-1&&Xt!=-1){this.zt(b,Ee,De,Ye,Xt,C),q=!0;break}if(pt!=-1&&ei!=-1){this.zt(b,Ye,ei,Ee,pt,C),q=!0;break}}}if(q)break}}}if(!q)break}J=O,j.L(g)}this.g.Td(C)}},G.prototype.Kh=function(E,_,g){g=this.g.Pa(E,g),_.set(g,-1),g=this.g.Pa(E,this.ji),this.dd.set(g,-1),(_=this.g.bd(E))!=-1&&this.g.Xa(_)==E&&(this.g.Jf(_,-1),this.g.Wg(_,-1))},G.prototype.zt=function(E,_,g,b,C,O){this.g.Bc(_,b),this.g.Cc(b,_),this.g.Cc(g,C),this.g.Bc(C,g),this.Kh(b,E,O),this.g.mi(b,!1),this.Kh(C,E,O),this.g.mi(C,!0)},G.prototype.Ty=function(){for(var E=0,_=this.dd.size;E<_;E++){var g=this.dd.get(E);g!=-1&&this.g.aj(g,-1)}for(var b=0,C=0,O=this.g.Ob(this.X);O!=-1;){var F=this.g.Xa(O);if(F==-1||O!=this.g.bd(F)){var N=O;O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)}else{g=F,N=0;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);this.g.cp(O,!1),this.g.Wg(O,this.g.Ma(F)),this.g.Vj(O,N),C+=N,b++,O=this.g.Rb(O)}}for(E=0,_=this.dd.size;E<_;E++)if((g=this.dd.get(E))!=-1&&(O=this.g.bd(g))==-1){O=this.g.vf(this.X,-1),N=0,F=g;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(0<=(g=this.g.Pa(F,this.ji))&&this.dd.set(g,-1),this.g.pd(F,!1)),N=O,this.g.Jf(N,-1),this.g.$q(N)):(this.g.kn(O,!0),this.g.Vj(O,N),this.g.Jf(O,F),this.g.Wg(O,this.g.Ma(F)),this.g.cp(O,!1),C+=N,b++)}for(this.g.Rl(this.X,b),this.g.Tj(this.X,C),E=0,_=this.g.ld;_!=-1;_=this.g.ue(_))E+=this.g.I(_);this.g.bC(E)},G.By=function(E,_,g,b){return new G(_,b).Ay(E,g)},G.clip=function(E,_,g,b,C){return G.Nu(E,_,null,g,b,C)},G.Nu=function(E,_,g,b,C,O){var F=E.getType();if(F==33)return C=E.D(),_.contains(C)?E:E.Ia();if(F==197)return C=new A.l,E.A(C),C.Ea(_)?(_=new A.Fh,E.copyTo(_),_.Xo(C),_):E.Ia();if(E.B())return E;if(_.B())return E.Ia();var N=new A.l;if(E.xc(N),_.contains(N))return E;if(!_.isIntersecting(N))return E.Ia();if((g!=null||isNaN(b))&&A.ta.ty(g,_,!1),!A.aa.xj(F))throw A.i.N();if((g=E.Bb)!=null&&(g=g.Fk)!=null){if((g=g.Ro(_))==1){if(F!=1736)throw A.i.fa("internal error");return(E=new A.Da(E.description)).tp(_),E}if(g==0)return E.Ia()}switch(F){case 550:for(O=null,F=E.I(),g=E.ub(0),b=0,C=new A.h,N=0;N=N;N+=1)for(var j=0;1>=j;j+=1){var W=_.jG(O+N,F+j),q=this.xl.rR(W);q!=-1&&(this.pq[C]=q,this.xs[C]=W,C++)}for(O=C-1;1<=O;O--)for(q=this.pq[O],F=O-1;0<=F;F--)if(q==this.pq[F]){this.xs[F]=-1,O!=--C&&(this.xs[O]=this.xs[C],this.pq[O]=this.pq[C]);break}for(F=0;FF.Db())throw A.i.N();return N==0||F.B()?F:((J=new O(J)).ko=F,J.Ka=N,J.qa=q,J.Ki=j,J.CA=W,J.Rx())},O.prototype.eM=function(){var F=this.ko,N=F.ac(),j=F.wc(),W=new A.h;return W.uc(j,N),W.normalize(),W.Hv(),W.scale(this.Ka),N.add(W),j.add(W),W=F.Ia(),F.Dc(N),F.Qc(j),W},O.prototype.dM=function(){var F=this.ko;if(0J&&(0this.Ka?-G:G,-1Ee&&(.017453292519943295>(De=2*Math.acos(Ee))&&(De=.017453292519943295),1<(ee=A.O.truncate(G/De+1.5))&&(he/=ee)),De=Ye+_,Ye=g.Pd(J,this.Ka,De),F==0&&(Ye.type|=1024),this.fc(Ye,F),Ee=this.Ka/Math.cos(he/2),De+=he/2,(Ye=g.Pd(J,Ee,De)).type|=1024,this.fc(Ye);0<--ee;)De+=he,(Ye=g.Pd(J,Ee,De)).type|=1024,this.fc(Ye);(Ye=g.Pd(J,this.Ka,jt-_)).type|=1024,this.fc(Ye)}else if(this.Ki==1)Ye=g.Pd(J,this.Ka,Ye+_),this.fc(Ye,F),Ye=g.Pd(J,this.Ka,jt-_),this.fc(Ye);else if(this.Ki==0)for(Ee=1-j/Math.abs(this.Ka),ee=1,he=jt-_-(Ye+_),-1Ee&&(.017453292519943295>(De=2*Math.acos(Ee))&&(De=.017453292519943295),1<(ee=A.O.truncate(Math.abs(he)/De+1.5))&&(he/=ee)),Ee=this.Ka/Math.cos(.5*he),De=Ye+_+.5*he,Ye=g.Pd(J,Ee,De),this.fc(Ye,F);0<--ee;)De+=he,Ye=g.Pd(J,Ee,De),this.fc(Ye);else this.Ki==2?(Ee=ee.x-J.x,De=ee.y-J.y,.99999999<(ee=(Ee*(pt=he.x-J.x)+De*(Et=he.y-J.y))/Math.sqrt(Ee*Ee+De*De)/Math.sqrt(pt*pt+Et*Et))?(Ye=g.Pd(J,1.4142135623730951*this.Ka,jt-.25*G),this.fc(Ye,F),Ye=g.Pd(J,1.4142135623730951*this.Ka,jt+.25*G),this.fc(Ye)):(ee=Math.abs(this.Ka/Math.sin(.5*Math.acos(ee))))>(he=Math.abs(this.CA*this.Ka))?(Ee=.5*(jt-Ye),Ee=this.Ka/Math.abs(Math.sin(Ee)),Ye=g.Pd(J,Ee,.5*(Ye+jt)),jt=A.h.construct(Ye.x,Ye.y),Ye=A.h.construct(J.x,J.y),(J=new A.h).uc(jt,Ye),(jt=new A.h).HW(he/J.length(),J,Ye),Ye=(ee-he)*Math.abs(this.Ka)/Math.sqrt(ee*ee-this.Ka*this.Ka),0Ye&&(jt-=E),ee=Ye-jt<_):(jt(Ee=1.4142135623730951*this.Ka)?Ye+.25*G:Ye+.75*G,Ye=g.Pd(J,Ee,De),this.fc(Ye,F),De=0>Ee?jt-.25*G:jt-.75*G,Ye=g.Pd(J,Ee,De),this.fc(Ye)):(Ee=.5*(jt-Ye),Ee=this.Ka/Math.abs(Math.sin(Ee)),jtN))for(var j=0;j=W+1;N--)(j=g.al(F.Na(N))).type|=1024,this.wg.push(j);if(this.mE())if(2<=this.Yb.length){for(F=-1,(q=(1024&this.Yb[this.gf-1].type)!=0)||(F=0),N=1;N=Math.min(j.x,W.x)&&Math.max(j.x,W.x)>=Math.min(F.x,N.x)&&Math.max(F.y,N.y)>=Math.min(j.y,W.y)&&Math.max(j.y,W.y)>=Math.min(F.y,N.y)},O.prototype.xQ=function(F,N,j,W,q){q.bE=!1;var J=(N.y-F.y)*(W.x-j.x)-(N.x-F.x)*(W.y-j.y),ee=(j.y-F.y)*(N.x-F.x)-(j.x-F.x)*(N.y-F.y);if(0<=(J=J==0?2:ee/J)&&1>=J){var he=J;if(J=(W.y-j.y)*(N.x-F.x)-(W.x-j.x)*(N.y-F.y),ee=(F.y-j.y)*(W.x-j.x)-(F.x-j.x)*(W.y-j.y),0<=(J=J==0?2:ee/J)&&1>=J)return q.an=g.TO(F.x+J*(N.x-F.x),F.y+J*(N.y-F.y)),q.an.Uh=j.Uh+he*(W.Uh-j.Uh),he!=0&&he!=1||J!=0&&J!=1||(q.bE=!0),q.VY=J,q.WY=he,!((he==0||he==1)&&0J||(J==0||J==1)&&0he)}return!1},O.prototype.QO=function(F){for(;this.Yb[F].shF-(O*=2))return!0;C=new A.h;var N=new A.h,j=new A.h;b.tc(O,C),b.tc(O+2,N),b.tc(O+4,j);var W=g.Wu(N,j,C);if(W.ps()||!g.um(W.value()))return!1;var q=A.h.construct(N.x,N.y),J=new A.h;for(O+=6;OF;F++){b.mB(F,O);var N=this.Cr(O);if(N!=-1){b.Hf(F,C);var j=this.g.fc(this.Ss,C);this.Fa.Sj(N,j)}}},g.prototype.oN=function(b){var C=new A.Sa,O=b.ac();if((O=this.Cr(O))!=-1){b.To(C);var F=this.g.fc(this.Ss,C);this.Fa.Sj(O,F)}O=b.wc(),(O=this.Cr(O))!=-1&&(b.Po(C),b=this.g.fc(this.Ss,C),this.Fa.Sj(O,b))},g.prototype.nN=function(b){var C=b.D();(C=this.Cr(C))!=-1&&(b=this.g.fc(this.Ss,b),this.Fa.Sj(C,b))},g.prototype.Cr=function(b){var C=-1;if(this.Fa.size(-1)==0)return this.Fa.addElement(-4,-1);if(this.Fa.size(-1)==1){var O=this.g.Na(this.Fa.ja(this.Fa.rc(-1)));return b.Rz(O)||(C=this.Fa.xn(-5)),C}return this.pC(b)},g.prototype.pC=function(b){var C=-1;do{var O=this.Fa.rc(-1),F=this.Fa.Fc(-1),N=this.Fa.ja(O),j=this.Fa.ja(F),W=new A.h,q=new A.h;if(this.Xh.D(N,W),this.Xh.D(j,q),N=A.h.Uq(q,b,W),g.um(N))C=this.Fa.xn(-1),(W=this.nC(b,F,O))!=O&&this.oC(b,O,this.Fa.we(W));else if(g.CG(N)){q=this.Fa.sv(-1);var J=this.Fa.rc(-1),ee=this.Fa.Fc(-1);for(N=new A.h,j=new A.h;J!=this.Fa.we(ee);){var he=this.Fa.ja(q);this.Xh.D(he,N),he=A.h.Uq(N,b,W),g.CG(he)?(ee=q,q=this.Fa.ll(q)):(J=q,q=this.Fa.Xp(q))}if(q=ee,W=J,he=this.Fa.ja(q),J=this.Fa.ja(W),this.Xh.D(he,N),this.Xh.D(J,j),W!=O&&(N=A.h.Uq(j,b,N),!g.um(N)))continue;C=this.Fa.zu(W,q,-2,!1),this.oC(b,q,F),this.nC(b,W,O)}else this.sb==null&&(this.sb=new A.yb),this.sb.Dc(q),this.sb.Qc(W),0>(W=this.sb.fe(b,!0))?(W=this.Fa.we(F),this.Fa.vd(F,-1),C=this.Fa.xn(-3),this.nC(b,W,O)):1b},g.CG=function(b){return 0C)throw A.i.fa("Internal Error: max number of iterations exceeded");var N=this.nM(_);if(b=b||N,this.tH&&(N=this.g.Gp(_,!0,!1)!=0,b=b||N),N=!1,(O==0||F||A.$t.kI(!0,this.g,E,null,this.nd))&&(N=this.sM(g),b=b||N),!N)break;A.mp.zp(this.nd)}return b},G}();A.Tk=ue}(ye||(ye={})),function(A){var ue=function(){function E(_){this.$d=this.Mc=null,this.Ys=0,this.Ub=_,this.cA=!0}return E.prototype.uv=function(_,g){var b=this.g.bc(_);if(b==null){if(!this.g.ed(_,g))return null;b=g}return b},E.prototype.Xq=function(){var _;_===void 0&&(_=!1),this.Ys++,(_||!(4095&this.Ys))&&(this.Ys=0,A.mp.zp(this.Ub))},E.prototype.nP=function(){var _=this.g.Yq(!1),g=!1,b=new A.yb,C=new A.yb,O=new A.l;O.Oa();var F=new A.l;F.Oa();for(var N=new A.Sa,j=new A.TC,W=_.next();W!=-1;W=_.next()){A.mp.zp(this.Ub);var q=null,J=!1;if(!A.aa.Rn(this.g.ic(_.ck))){if((q=this.uv(W,b))==null)continue;if(q.A(O),O.W(this.qa,this.qa),q.Bi(this.qa)){if(!q.Bi(0))continue;J=!0,q=null}}var ee=this.g.Yq(_),he=ee.next();for(he!=-1&&(he=ee.next());he!=-1;he=ee.next()){var Ee=null,De=!1;if(!A.aa.Rn(this.g.ic(ee.ck))){if((Ee=this.uv(he,C))==null)continue;if(Ee.A(F),Ee.Bi(this.qa)){if(!Ee.Bi(0))continue;De=!0,Ee=null}}var pt=0,Et=0;if(q!=null&&Ee!=null)O.HG(F)&&(j.Oo(q),j.Oo(Ee),j.Ea(this.qa,!1),0<(pt=j.ol(0))+(Et=j.ol(1))&&(this.g.jr(W,j,0,!0),this.g.jr(he,j,1,!0)),j.clear());else if(q!=null){var Ye=new A.h;if(this.g.D(he,Ye),O.contains(Ye)){if(j.Oo(q),this.g.Vi(he,N),j.Kz(this.qa,N,!1),0<(pt=j.ol(0)))if(this.g.jr(W,j,0,!0),De){for(De=-1,Ye=this.g.U(he);Ye!=-1&&Ye!=he&&(De=Ye,(Ee=this.uv(Ye,C))!=null&&Ee.Bi(0));Ye=this.g.U(Ye));for(Ye=he;Ye!=-1&&(this.g.Dh(Ye,j.Bf),Ye!=De);Ye=this.g.U(Ye));}else this.g.Dh(he,j.Bf);j.clear()}}else{if(Ee==null)continue;if(Ye=new A.h,this.g.D(W,Ye),F.W(this.qa,this.qa),F.contains(Ye)){if(j.Oo(Ee),this.g.Vi(W,N),j.Kz(this.qa,N,!1),0<(Et=j.ol(0)))if(this.g.jr(he,j,0,!0),J){for(De=-1,Ye=this.g.U(W);Ye!=-1&&Ye!=W&&(De=Ye,(Ee=this.uv(Ye,C))!=null&&Ee.Bi(0));Ye=this.g.U(Ye));for(Ye=W;Ye!=-1&&(this.g.Dh(Ye,j.Bf),Ye!=De);Ye=this.g.U(Ye));}else this.g.Dh(W,j.Bf);j.clear()}}if(pt+Et!=0){if(pt!=0){if((q=this.g.bc(W))==null){if(!this.g.ed(W,b))continue;q=b,b.A(O)}else q.A(O);if(q.Bi(this.qa))break}g=!0}}}return g},E.prototype.oP=function(){return this.QU()},E.prototype.QU=function(){return new A.RC().PX(this.g,this.qa)},E.prototype.lI=function(){var _=!1;this.Mc==null&&(this.Mc=new A.Yj);var g=new A.ia(0);g.Jb(this.g.fd+1);for(var b=this.g.Yq(),C=b.next();C!=-1;C=b.next())g.add(C);this.g.nx(g,g.size),g.add(-1),b=this.g.Gd(),C=this.g.Gd(),this.$d=new A.UC(this.g,this.qa,!this.cA),this.Mc.Vo(this.$d);var O=new A.ia(0),F=new A.ia(0),N=0;new A.h;var j=this.g.td;this.g.vb.mc();for(var W,q,J=this.g.vb.za[0].o,ee=g.get(N++);ee!=-1;){var he=W=J[2*(q=j.T(ee,0))],Ee=q=J[2*q+1];do{var De=j.T(ee,2),pt=j.T(ee,1);if(De!=-1){var Et=j.T(De,0),Ye=J[2*Et];0>(Ee<(Et=J[2*Et+1])?-1:Ee>Et?1:heYe?1:0)&&(F.add(ee),F.add(De))}pt!=-1&&(Ye=J[2*(Et=j.T(pt,0))],0>(Ee<(Et=J[2*Et+1])?-1:Ee>Et?1:heYe?1:0)&&(F.add(pt),F.add(pt))),(Ye=this.g.Pa(ee,b))!=-1&&(O.add(Ye),this.g.Ra(ee,b,-1)),(Ye=this.g.Pa(ee,C))!=-1&&(O.add(Ye),this.g.Ra(ee,C,-1)),(ee=g.get(N++))!==-1&&(he=J[2*(Ee=j.T(ee,0))],Ee=J[2*Ee+1])}while(ee!=-1&&he===W&&Ee===q);for(he=O.size==1&&F.size==2,Ye=Ee=-1,De=0,pt=O.size;De_.fd?_=g.nP():g.oP())},E.V=function(_,g,b){return E.fQ(_,_.IF(),g,b)},E.kI=function(_,g,b,C,O){if(!E.yE(g))return!1;var F=new E(O);if(F.g=g,F.qa=b,F.cA=_,F.lI())return C?.Wt(F.Ni),!0;var N=new A.Dd;return N.$B(),g.Oc(N),(F=new E(O)).g=g,F.qa=b,F.cA=_,_=F.lI(),N.$B(),g.Oc(N),!!_&&(C?.Wt(F.Ni),!0)},E.Ml=function(_,g){return!(16>(_=_.I()))&&2*_+Math.log(_)*Math.LOG10E/Math.log(2)*g<1*_*g},E.lP=function(_,g,b,C){var O=g.getType();if(A.aa.Hc(O))return new E(C).mP(_,g,b);throw A.i.fa("crack_A_with_B")},E.prototype.mP=function(_,g,b){var C=new A.l;_.xc(C);var O=new A.l;if(g.xc(O),O.W(b,b),!O.isIntersecting(C))return _;var F=_.Bb,N=null;F!=null&&(N=F.Fb),E.Ml(_,_.I())&&(N=A.ta.jj(_,O));var j=N!=null?N.getIterator():null,W=g.Ga();g=_.Ga();var q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(O=[];W.$a();)for(;W.Ha();){var J=W.ha();if(N!=null){for(j.Uo(J,b),F=j.next();F!=-1;F=j.next())if(this.Xq(),g.Vb(N.ja(F),-1),g.Ha()){var ee=(F=g.ha()).Ea(J,null,q,null,b);for(F=0;Fg.t?1:_.tg.index?1:-1},E}()}(ye||(ye={})),function(A){var ue;(ue=A.KK||(A.KK={}))[ue.Left=0]="Left",ue[ue.Right=1]="Right",ue[ue.Coincident=2]="Coincident",ue[ue.Undefined=3]="Undefined",ue[ue.Uncut=4]="Uncut";var G=function(g,b,C,O,F,N,j,W,q,J,ee){this.X=g,this.bt=b,this.Ns=C,this.tg=O,this.Lm=J,this.Al=ee};A.uY=G;var E=function(){function g(b,C){this.JH=b,this.Hi=C}return g.prototype.qM=function(b,C){var O=new A.h;this.Hi.D(b,O);var F=new A.h;return this.Hi.D(C,F),(O=O.compare(F))!=0?O:(b=this.Hi.Pa(b,this.JH))<(C=this.Hi.Pa(C,this.JH))?-1:b==C?0:1},g}(),_=function(g,b,C,O,F,N,j,W,q){this.tg=g,this.Ns=b,this.OA=C,this.UH=O,this.Ei=F,this.Al=N,this.Lm=j,this.VH=W,this.OT=q};A.tY=_,A.LK=function(){function g(){}return g.JK=function(b,C,O,F,N,j){if(C.B())b=new G(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else if(O.B())b=new G(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else{var W=new A.gd;if(W.Ib(C),W.Ib(O),A.Tk.V(W,F,j,!0),W.fd==0)b=new G(C.Ia(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else{for(C=0,O=W.Gd(),F=W.ld;F!=-1;F=W.ue(F))for(j=W.Ob(F);j!=-1;j=W.Rb(j))for(var q=W.Xa(j),J=0,ee=W.Ja(j);J(Ee=Ee.Ea(q,null,ee,he,0))&&(F=new _(N,F,ee[0],NaN,Ee,W,j,he[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1)),!0},g.wM=function(b,C,O,F,N,j,W){var q=new A.yb,J=new A.yb,ee=[0,0],he=[0,0],Ee=C.bc(N);return Ee==null&&(C.ed(N,q),Ee=q),(q=C.bc(W))==null&&(C.ed(W,J),q=J),2>(Ee=Ee.Ea(q,null,ee,he,0))&&(F=new _(N,F,ee[0],NaN,Ee,W,j,he[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0)},g.xM=function(b,C,O,F,N,j,W,q){var J=new A.yb,ee=new A.yb,he=[0,0],Ee=[0,0],De=C.bc(N);return De==null&&(C.ed(N,J),De=J),(J=C.bc(W))==null&&(C.ed(W,ee),J=ee),(De=De.Ea(J,null,he,Ee,0))==2?(F=new _(N,F,he[0],he[1],De,W,j,Ee[0],Ee[1]),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0):(ee=!1,N==q&&(F=new _(N,F,he[0],NaN,De,W,j,Ee[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),ee=!0),ee)},g.yM=function(b,C,O,F,N,j,W,q){var J=new A.yb,ee=new A.yb,he=[0,0],Ee=[0,0],De=C.bc(N);return De==null&&(C.ed(N,J),De=J),(J=C.bc(W))==null&&(C.ed(W,ee),J=ee),(De=De.Ea(J,null,he,Ee,0))==2?(F=new _(N,F,he[0],he[1],De,W,j,Ee[0],Ee[1]),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0):(ee=!1,N==q&&(F=new _(N,F,he[0],NaN,De,W,j,Ee[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),ee=!0),ee)},g.cM=function(b,C,O,F){var N=[];N[0]=new A.h,N[1]=new A.h,N[2]=new A.h,N[3]=new A.h;var j=new A.h,W=new A.h,q=new A.h,J=new A.h,ee=null;F!=null&&(ee=new A.ig).Or();var he=0,Ee=null,De=new A.yb;new A.yb;for(var pt=O.Ob(O.ld);pt!=-1;pt=O.Rb(pt)){for(var Et=4,Ye=-1,jt=-1,ei=-1,Xt=-1,wi=NaN,pi=!0,Ri=!1,Ui=!0,Bi=!0,mi=!0,ar=0,z=pt,Wi=0,Fr=O.Xa(pt),ds=O.Ja(pt),Dt=0;Dt=C.length-2||C[he+2].Ns!=Ye)&&(Et=0):Et=1):((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,3,Ye,Pt,Un,Et,z,jt,Wi,Qi,Tn),F.push(qn)):null.add(ar)),Et=1):Et!=0?((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,0,Ye,Pt,Un,Et,z,jt,Wi,Qi,Tn),F.push(qn)):null.add(ar)),ko?(he>=C.length-2||C[he+2].Ns!=Ye)&&(Et=1):Et=0):((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,3,Ye,Pt,Un,Et,z,jt,Wi,Qi,Tn),F.push(qn)):null.add(ar)),Et=0),(Un!=yn||ai&&yn==0)&&(yn=Un,z=Ye,jt=Pt,Wi=Un,ei=Qi,Xt=Tn,wi=bs,pi=Ui=!1,Bi=mi=!0))}}he++}yn!=1&&(mi&&(F!=null?Ee=new A.Ta:ar=0),F!=null?(Mn.ah(yn,1,ee),Ee.oc(ee.get(),Bi)):ar++,Bi=mi=!1,Ui=!0)}Ui&&(Un=1,Pt=O.rj(pt),Pt=O.Ma(Pt),Tn=Qi=-1,bs=NaN,pi?F!=null?(qn=new G(Ee,4,Ye,Pt,Un,Et,z,jt,Wi,Qi,Tn),F.push(qn)):null.add(ar):(pi=Et==1?0:Et==0?1:3,F!=null?(qn=new G(Ee,pi,Ye,Pt,Un,Et,z,jt,Wi,Qi,Tn),F.push(qn)):null.add(ar)))}},g.CM=function(b,C,O,F,N,j){var W=O[F].VH;if(W==1)return g.AM(b,C,O,F,N,j);if(W==0)return g.BM(b,C,O,F,N,j);throw A.i.Qa()},g.AM=function(b,C,O,F,N,j){var W=new A.yb,q=O[F].tg,J=O[F].Lm,ee=O[F].Al,he=-1,Ee=-1,De=-1,pt=-1;if(!b&&0.01*_&&(b*=1+(1+(E=E.xb/_))*E),this.pb=g,this.xb=b+2220446049250313e-31*Math.abs(g)},G.prototype.sqrt=function(){if(0<=this.pb){var E=Math.sqrt(this.pb),_=this.pb>10*this.xb?.5*this.xb/E:this.pb>this.xb?E-Math.sqrt(this.pb-this.xb):Math.max(E,Math.sqrt(this.pb+this.xb)-E);_+=2220446049250313e-31*Math.abs(E)}else this.pb<-1*this.xb?_=E=NaN:(E=0,_=Math.sqrt(this.xb));this.pb=E,this.xb=_},G.prototype.sin=function(E){var _=Math.sin(E.pb),g=Math.cos(E.pb);this.pb=_,_=Math.abs(_),this.xb=(Math.abs(g)+.5*_*E.xb)*E.xb+2220446049250313e-31*_},G.prototype.cos=function(E){var _=Math.sin(E.pb),g=Math.cos(E.pb);this.pb=g,g=Math.abs(g),this.xb=(Math.abs(_)+.5*g*E.xb)*E.xb+2220446049250313e-31*g},G.prototype.qg=function(){return Math.abs(this.pb)<=this.xb},G.prototype.ps=function(){return this.qg()&&this.xb!=0},G}();A.Wb=ue}(ye||(ye={}));var ie=new ye.h,ge=new ye.h,je=new ye.h,rt=new ye.h,Me=new ye.h;(function(A){var ue,G;(G=ue||(ue={}))[G.closedPath=1]="closedPath",G[G.exteriorPath=2]="exteriorPath",G[G.ringAreaValid=4]="ringAreaValid";var E=function(){function _(g,b,C,O,F,N,j){b!==void 0?(this.ib=g,this.ck=b,this.bl=C,this.ii=O,this.ya=N,this.hA=j,this.ew=F):(this.ib=g.ib,this.ck=g.ck,this.bl=g.bl,this.ii=g.ii,this.ya=g.ya,this.hA=g.hA,this.ew=g.ew),this.bH=!0}return _.prototype.next=function(){return this.bH?(this.bH=!1,this.ii):this.ii!=-1?(this.ii=this.ib.U(this.ii),this.ya++,this.ii!=-1&&this.ii!=this.ew?this.ii:this.$T()):-1},_.prototype.$T=function(){for(this.bl=this.ib.Rb(this.bl),this.ya=0;this.ck!=-1;){for(;this.bl!=-1;this.bl=this.ib.Rb(this.bl))if(this.ew=this.ii=this.ib.Xa(this.bl),this.ii!=-1)return this.ii;if(this.ck=this.ib.ue(this.ck),this.ck==-1)break;this.hA&&!A.aa.Hc(this.ib.ic(this.ck))||(this.bl=this.ib.Ob(this.ck))}return-1},_.AP=function(g,b,C,O,F,N,j){return new _(g,b,C,O,F,N,j)},_}();A.zY=E,ue=function(){function _(){this.jo=this.Am=this.wk=this.cd=this.Ck=this.vo=this.Oi=this.md=this.bi=this.Sg=this.We=this.Il=null,this.qw=this.ld=-1,this.fd=0,this.fA=!1,this.ht=this.it=this.vb=null}return _.prototype.Sh=function(g){return this.We!=null?this.We[g]:null},_.prototype.Xg=function(g,b){if(this.We==null){if(b==null)return;this.We=[];for(var C=0,O=this.vb.I();C=this.Oi.size&&(g=16>b?16:A.O.truncate(3*b/2),this.Oi.resize(g),this.vo.resize(g)),this.Oi.set(b,0),this.vo.set(b,0),b},_.prototype.sF=function(g){this.md.jd(g)},_.prototype.Vy=function(g){this.td.jd(g),this.fd--},_.prototype.oI=function(g){this.md==null&&(this.md=new A.$c(8),this.td=new A.$c(5),this.Oi=new A.be(0),this.vo=new A.be(0));var b=this.td.Ce(),C=0<=g?g:b;if(this.td.S(b,0,C),0>g){if(C>=this.vb.I()){if(g=16>C?16:A.O.truncate(3*C/2),this.vb.resize(g),this.We!=null)for(var O=0;Ob.Ja(O))){var N=this.vf(g,-1);this.kn(N,b.dc(O));for(var j=b.Ba(O),W=b.Vc(O);jg.Ja(b))return C;this.Il.Fd(g,g.Ba(b),g.Vc(b)),this.it=this.vb.ub(0);var O=this.vf(C,-1);this.kn(O,g.dc(b)||!0);var F=this.We!=null&&g.Ve!=null,N=g.Ba(b);for(b=g.Vc(b);N=b.size&&b.resize(Math.max(A.O.truncate(1.25*g),16),-1),b.write(g,C)},_.prototype.KF=function(g,b){return(g=this.JF(g))<(b=this.wk[b]).size?b.read(g):-1},_.prototype.aF=function(){this.wk==null&&(this.wk=[]);for(var g=0;gq:2>q)?(j=this.Zq(j),O=0ee){var he=ee;W!=null&&(he=0he){var Ee=he;if(W!=null&&(Ee=0O||F>this.fd-1)throw A.i.N("invalid call");if(O>F&&!this.dc(g))throw A.i.N("cannot iterate across an open path");for(g=0;b!=C;b=this.U(b))O=this.Ua(b),(F=this.Sh(O))!=null?g+=F.Qb():(F=this.Ua(this.U(b)),g+=this.vb.yr(O,F));return g},_.prototype.Dh=function(g,b){var C=this.Ua(g);this.vb.Ht(C,b),(C=this.Sh(C))!=null&&C.setStart(b),(g=this.Ma(g))!=-1&&(g=this.Ua(g),this.Sh(g)!=null&&C.setEnd(b))},_.prototype.Vi=function(g,b){g=this.Ua(g),this.vb.ve(g,b)},_.prototype.mf=function(g,b){this.Cb(g,b.x,b.y)},_.prototype.Cb=function(g,b,C){var O=this.Ua(g);this.vb.Cb(O,b,C),(O=this.Sh(O))!=null&&O.ZB(b,C),(g=this.Ma(g))!=-1&&(g=this.Ua(g),this.Sh(g)!=null&&O.Ql(b,C))},_.prototype.D=function(g,b){this.vb.D(this.td.T(g,0),b)},_.prototype.Gc=function(g,b){this.vb.za[0].tc(2*this.td.T(g,0),b)},_.prototype.Na=function(g){var b=new A.h;return this.vb.D(this.td.T(g,0),b),b},_.prototype.dG=function(g,b){this.it.tc(2*g,b)},_.prototype.Uc=function(g,b,C){return this.vb.Uc(g,this.Ua(b),C)},_.prototype.setAttribute=function(g,b,C,O){this.vb.setAttribute(g,this.Ua(b),C,O)},_.prototype.Ua=function(g){return this.td.T(g,0)},_.prototype.ih=function(){var g=new A.h;return this.D(void 0,g),g.y},_.prototype.fq=function(g,b){g=this.Ua(g),b=this.Ua(b);var C=this.vb.za[0].o;return C[2*g]===C[2*b]&&C[2*g+1]===C[2*b+1]},_.prototype.Dv=function(g,b){g=this.Ua(g);var C=this.vb.za[0].o;return C[2*g]===b.x&&C[2*g+1]===b.y},_.prototype.vX=function(g,b){if(1>b&&(b=1),this.Sg==null){if(b==1)return;this.Sg=A.Yc.Dn(this.vb.I(),1)}(g=this.Ua(g))>=this.Sg.size&&this.Sg.resize(g+1,1),this.Sg.write(g,b)},_.prototype.cG=function(g){return g=this.Ua(g),this.Sg==null||g>=this.Sg.size?1:this.Sg.read(g)},_.prototype.Ra=function(g,b,C){b=this.bi[b],g=this.Ua(g),b.sizeF?1:NW?1:0})},_.prototype.jS=function(){for(var g=this.ld;g!=-1;g=this.ue(g))if(!A.aa.Hc(this.ic(g)))return!0;return!1},_.prototype.hC=function(g,b){for(var C=this.Ob(g),O=this.Ob(b),F=this.kv(g),N=this.kv(b),j=this.Ob(g);j!=-1;j=this.Rb(j))this.gx(j,b);for(j=this.Ob(b);j!=-1;j=this.Rb(j))this.gx(j,g);this.Zo(g,O),this.Zo(b,C),this.$o(g,N),this.$o(b,F),C=this.I(g),O=this.da(g),F=this.da(b),this.Tj(g,this.I(b)),this.Tj(b,C),this.Rl(g,F),this.Rl(b,O),C=this.cd.T(g,2),this.cd.S(g,2,this.cd.T(b,2)),this.cd.S(b,2,C)},_}(),A.gd=ue})(ye||(ye={})),function(A){var ue=function(G){function E(_,g,b,C){var O=G.call(this)||this;return O.$=new A.l,_===void 0?O.UE():typeof _=="number"?O.VO(_,g,b,C):_ instanceof A.Sa?g!==void 0?O.Qu(_,g,b):O.WO(_):_ instanceof A.ra?g!==void 0?O.YO(_,g):O.XO(_):_ instanceof A.l?O.UO(_):O.UE(),O}return me(E,G),E.prototype.Qu=function(_,g,b){this.description=A.ee.og(),this.$.Oa(),_.B()||this.tu(_,g,b)},E.prototype.UO=function(_){this.description=A.ee.og(),this.$.K(_),this.$.normalize()},E.prototype.XO=function(_){if(_==null)throw A.i.N();this.description=_,this.$.Oa()},E.prototype.YO=function(_,g){if(_==null)throw A.i.N();this.description=_,this.$.K(g),this.$.normalize()},E.prototype.UE=function(){this.description=A.ee.og(),this.$.Oa()},E.prototype.WO=function(_){this.description=A.ee.og(),this.$.Oa(),_.B()||this.tu(_)},E.prototype.VO=function(_,g,b,C){this.description=A.ee.og(),this.K(_,g,b,C)},E.prototype.K=function(_,g,b,C){if(this.vc(),typeof _=="number")this.$.K(_,g,b,C);else for(this.Oa(),g=0,b=_.length;g=A.ra.Va(g))throw A.i.N();var C=this.description.Pf(g);return this.ou(),0<=C?this.ka[this.kR(this.description,_)+this.description.LR(C)-2+b]:A.ra.se(g)},E.prototype.ou=function(){if(this.vc(),this.ka==null&&2=A.ra.Va(g))throw A.i.ce();var C=this.description.Pf(g);return 0<=C?(this.ou(),this.ka[E.Gg(this.description,_)+this.description.$j(C)-2+b]):A.ra.se(g)},E.prototype.vD=function(_,g,b,C){if(this.vc(),g==0)_!=0?b!=0?this.$.H=C:this.$.C=C:b!=0?this.$.G=C:this.$.v=C;else{if(b>=A.ra.Va(g))throw A.i.ce();if(!this.hasAttribute(g)){if(A.ra.DG(g,C))return;this.re(g)}g=this.description.Pf(g),this.ou(),this.ka[E.Gg(this.description,_)+this.description.$j(g)-2+b]=C}},E.Gg=function(_,g){return g*(_.Ae.length-2)},E.prototype.Ea=function(_){this.vc();var g=new A.l;return _.A(g),this.$.Ea(g)},E.prototype.isIntersecting=function(_){return _ instanceof A.l?this.$.isIntersecting(_):this.$.isIntersecting(_.$)},E.prototype.Ju=function(_,g){this.vc(),_.B()?this.Oa():g!==void 0?this.tu(_,g):this.$.Ju(_.Lg(),_.ih())},E.prototype.offset=function(_,g){this.vc(),this.$.offset(_,g)},E.prototype.normalize=function(){this.vc(),this.$.normalize()},E.prototype.sf=function(_){if(_===void 0){if(_=new A.Sa(this.description),this.B())return _;for(g=this.description.Aa,b=1;bthis.C&&(this.C=b.x),b.ythis.H&&(this.H=b.y)}}else if(E==null||E.length==0)this.Oa();else for(b=E[0],this.K(b.x,b.y),g=1;gE?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_)):E instanceof A.h||E instanceof A.Nd?this.Zb(E.x,E.y):E instanceof G&&!E.B()&&(this.Zb(E.v,E.G),this.Zb(E.C,E.H))},G.prototype.Lk=function(E,_){this.v>E?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_)},G.prototype.W=function(E,_){this.B()||(this.v-=E,this.C+=E,this.G-=_,this.H+=_,(this.v>this.C||this.G>this.H)&&this.Oa())},G.prototype.scale=function(E){0>E&&this.Oa(),this.B()||(this.v*=E,this.C*=E,this.G*=E,this.H*=E)},G.prototype.zoom=function(E,_){this.B()||this.K(this.sf(),E*this.R(),_*this.ca())},G.prototype.isIntersecting=function(E){return!this.B()&&!E.B()&&(this.v<=E.v?this.C>=E.v:E.C>=this.v)&&(this.G<=E.G?this.H>=E.G:E.H>=this.G)},G.prototype.HG=function(E){return(this.v<=E.v?this.C>=E.v:E.C>=this.v)&&(this.G<=E.G?this.H>=E.G:E.H>=this.G)},G.prototype.Ea=function(E){return!this.B()&&!E.B()&&(E.v>this.v&&(this.v=E.v),E.Cthis.G&&(this.G=E.G),E.HE.length)throw A.i.N();E[0]!=null?E[0].ma(this.v,this.G):E[0]=A.h.construct(this.v,this.G),E[1]!=null?E[1].ma(this.v,this.H):E[1]=A.h.construct(this.v,this.H),E[2]!=null?E[2].ma(this.C,this.H):E[2]=A.h.construct(this.C,this.H),E[3]!=null?E[3].ma(this.C,this.G):E[3]=A.h.construct(this.C,this.G)},G.prototype.wF=function(){return this.B()?0:this.R()*this.ca()},G.prototype.yR=function(){return this.B()?0:2*(this.R()+this.ca())},G.prototype.gk=function(){return(this.C+this.v)/2},G.prototype.Jp=function(){return(this.H+this.G)/2},G.prototype.R=function(){return this.C-this.v},G.prototype.ca=function(){return this.H-this.G},G.prototype.move=function(E,_){this.B()||(this.v+=E,this.G+=_,this.C+=E,this.H+=_)},G.prototype.Ju=function(E,_){if(_!==void 0)this.move(E-this.gk(),_-this.Jp());else if(E instanceof A.h)this.Ju(E.x,E.y);else{if(!(E instanceof A.Sa))throw A.i.N();_=(this.C-this.v)/2;var g=(this.H-this.G)/2;this.v=E.Lg()-_,this.C=E.Lg()+_,this.G=E.ih()-g,this.H=E.ih()+g}},G.prototype.offset=function(E,_){this.v+=E,this.C+=E,this.G+=_,this.H+=_},G.prototype.normalize=function(){if(!this.B()){var E=Math.min(this.v,this.C),_=Math.max(this.v,this.C);this.v=E,this.C=_,E=Math.min(this.G,this.H),_=Math.max(this.G,this.H),this.G=E,this.H=_}},G.prototype.dn=function(E){E.ma(this.v,this.G)},G.prototype.$I=function(E){E.ma(this.C,this.G)},G.prototype.cJ=function(E){E.ma(this.v,this.H)},G.prototype.en=function(E){E.ma(this.C,this.H)},G.prototype.fT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},G.prototype.sf=function(){return A.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},G.prototype.mz=function(){return A.h.construct(this.v,this.G)},G.prototype.contains=function(E,_){if(_!==void 0)return E>=this.v&&E<=this.C&&_>=this.G&&_<=this.H;if(E instanceof A.Sa)return this.contains(E.Lg(),E.ih());if(E instanceof A.h)return this.contains(E.x,E.y);if(E instanceof G)return E.v>=this.v&&E.C<=this.C&&E.G>=this.G&&E.H<=this.H;throw A.i.N()},G.prototype.hm=function(E,_){if(_!==void 0)return E>this.v&&Ethis.G&&_this.v&&E.Cthis.G&&E.H>>32);var _=A.O.Th(E);return E=this.C,E=A.O.truncate(E^E>>>32),_=A.O.Th(E,_),E=this.G,E=A.O.truncate(E^E>>>32),_=A.O.Th(E,_),E=this.H,E=A.O.truncate(E^E>>>32),A.O.Th(E,_)},G.prototype.xr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},G.prototype.zy=function(E,_){var g=this.Zj(E),b=this.Zj(_);if(g&b)return 0;if(!(g|b))return 4;var C=(g!=0?1:0)|(b!=0?2:0);do{var O=_.x-E.x,F=_.y-E.y;if(O>F?g&G.YC?(g&G.ju?(E.y+=F*(this.v-E.x)/O,E.x=this.v):(E.y+=F*(this.C-E.x)/O,E.x=this.C),g=this.Zj(E)):b&G.YC?(b&G.ju?(_.y+=F*(this.v-_.x)/O,_.x=this.v):(_.y+=F*(this.C-_.x)/O,_.x=this.C),b=this.Zj(_)):g!=0?(g&G.ku?(E.x+=O*(this.G-E.y)/F,E.y=this.G):(E.x+=O*(this.H-E.y)/F,E.y=this.H),g=this.Zj(E)):(b&G.ku?(_.x+=O*(this.G-_.y)/F,_.y=this.G):(_.x+=O*(this.H-_.y)/F,_.y=this.H),b=this.Zj(_)):g&G.ZC?(g&G.ku?(E.x+=O*(this.G-E.y)/F,E.y=this.G):(E.x+=O*(this.H-E.y)/F,E.y=this.H),g=this.Zj(E)):b&G.ZC?(b&G.ku?(_.x+=O*(this.G-_.y)/F,_.y=this.G):(_.x+=O*(this.H-_.y)/F,_.y=this.H),b=this.Zj(_)):g!=0?(g&G.ju?(E.y+=F*(this.v-E.x)/O,E.x=this.v):(E.y+=F*(this.C-E.x)/O,E.x=this.C),g=this.Zj(E)):(b&G.ju?(_.y+=F*(this.v-_.x)/O,_.x=this.v):(_.y+=F*(this.C-_.x)/O,_.x=this.C),b=this.Zj(_)),(g&b)!=0)return 0}while(g|b);return C},G.prototype.Zj=function(E){return(E.xthis.C?1:0)<<1|(E.ythis.H?1:0)<<3},G.prototype.Bi=function(E){return!this.B()&&(this.R()<=E||this.ca()<=E)},G.prototype.tb=function(E){return E instanceof A.h?Math.sqrt(this.iK(E)):Math.sqrt(this.px(E))},G.prototype.px=function(E){var _=0,g=0,b=this.v-E.C;return b>_&&(_=b),(b=this.G-E.H)>g&&(g=b),(b=E.v-this.C)>_&&(_=b),(b=E.G-this.H)>g&&(g=b),_*_+g*g},G.prototype.iK=function(E){var _=0,g=0,b=this.v-E.x;return b>_&&(_=b),(b=this.G-E.y)>g&&(g=b),(b=E.x-this.C)>_&&(_=b),(b=E.y-this.H)>g&&(g=b),_*_+g*g},G.prototype.cn=function(E){this.B()?E.Oa():E.K(this.v,this.C)},G.ju=1,G.ku=4,G.YC=3,G.ZC=12,G}();A.l=ue}(ye||(ye={})),function(A){var ue,G;(G=ue||(ue={}))[G.initialize=0]="initialize",G[G.initializeRed=1]="initializeRed",G[G.initializeBlue=2]="initializeBlue",G[G.initializeRedBlue=3]="initializeRedBlue",G[G.sweep=4]="sweep",G[G.sweepBruteForce=5]="sweepBruteForce",G[G.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",G[G.sweepRedBlue=7]="sweepRedBlue",G[G.sweepRed=8]="sweepRed",G[G.sweepBlue=9]="sweepBlue",G[G.iterate=10]="iterate",G[G.iterateRed=11]="iterateRed",G[G.iterateBlue=12]="iterateBlue",G[G.iterateBruteForce=13]="iterateBruteForce",G[G.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",G[G.resetRed=15]="resetRed",G[G.resetBlue=16]="resetBlue";var E=function(){function _(g,b){this.ci=g,this.dH=b}return _.prototype.nr=function(g,b,C){this.ci.JX(C,g,b,this.dH)},_.prototype.$p=function(g){return this.ci.Rr(g,this.dH)},_}();ue=function(){function _(){this.ow=this.oo=this.ff=this.rd=null,this.wq=new A.l,this.Am=this.Hj=this.Ij=this.Ad=this.Ef=this.Ld=this.cw=this.fo=this.qd=this.Eb=null,this.Xb=-1,this.qa=0,this.Nk()}return _.prototype.kr=function(){this.Nk(),this.Pv=!0,this.Eb==null?(this.fo=new A.ia(0),this.Eb=[]):(this.fo.Bh(0),this.Eb.length=0)},_.prototype.ad=function(g,b){if(!this.Pv)throw A.i.Hb();var C=new A.l;C.K(b),this.fo.add(g),this.Eb.push(C)},_.prototype.Fp=function(){if(!this.Pv)throw A.i.Hb();this.Pv=!1,this.Eb!=null&&0this.Eb.length)return this.pe=this.Eb.length,this.Xb=5,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.rd.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.rd.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.ff==null&&(this.ff=new A.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new A.ia(0)),this.ff.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.ff==null&&(this.ff=new A.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new A.ia(0)),this.rd.kr();for(var g=0;g>1;return _.eq(g)?(this.rd.remove(b),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1)):(this.oo.EB(this.Eb[b].v,this.Eb[b].C,this.qa),this.Vf=b,this.Xb=10,!0)},_.prototype.QX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Rg=this.Vf=this.pe,this.Xb=13,!0)},_.prototype.RX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Vf=this.pe,this.Rg=this.qd.length,this.Xb=14,!0)},_.prototype.SX=function(){var g=this.Ld.get(this.pe-1),b=this.Ef.get(this.Rg-1),C=this.Rr(g,!0),O=this.Rr(b,!1);return C>O?this.ux():C>1;if(_.eq(g))return this.Df!=-1&&this.Ij.get(b)!=-1?(this.Ad.jd(this.Df,this.Ij.get(b)),this.Ij.set(b,-1)):this.rd.remove(b),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Cf!=-1&&0>1;if(_.eq(g))return this.Cf!=-1&&this.Hj.get(b)!=-1?(this.Ad.jd(this.Cf,this.Hj.get(b)),this.Hj.set(b,-1)):this.ff.remove(b),this.Rg!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Df!=-1&&0>1;return this.rd.vj(g),this.Xb=4,!0},_.prototype.jT=function(){if(this.Vf=this.oo.next(),this.Vf!=-1)return!1;this.Af=this.Vf=-1;var g=this.Ef.get(this.Rg)>>1;return this.ff.vj(g),this.Xb=7,!0},_.prototype.gT=function(){if(this.Af=this.ow.next(),this.Af!=-1)return!1;var g=this.Ld.get(this.pe)>>1;return this.rd.vj(g),this.Xb=7,!0},_.prototype.hT=function(){if(--this.Rg==-1)return this.Xb=5,!0;this.wq.K(this.Eb[this.pe]);var g=this.Eb[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(g)||(this.Af=this.Rg,!1)},_.prototype.iT=function(){if(--this.Rg==-1)return this.Xb=6,!0;this.wq.K(this.Eb[this.pe]);var g=this.qd[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(g)||(this.Af=this.Rg,!1)},_.prototype.kJ=function(){return this.rd==null?(this.Ic=!0,!1):(this.pe=this.Ld.size,0>1],_.eq(g)?b.G-C:b.H+C):(b=this.qd[g>>1],_.eq(g)?b.G-C:b.H+C)},_}(),A.xC=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.construct=function(E,_,g,b,C,O){var F=new G;return F.v=E,F.G=_,F.Ye=g,F.C=b,F.H=C,F.Bg=O,F},G.prototype.Oa=function(){this.Ye=this.v=NaN},G.prototype.B=function(){return isNaN(this.v)},G.prototype.XS=function(){return isNaN(this.Ye)},G.prototype.K=function(E,_,g,b,C,O){b!==void 0?typeof E=="number"?(this.v=E,this.G=_,this.Ye=g,this.C=b,this.H=C,this.Bg=O):(this.v=E.x-.5*_,this.C=this.v+_,this.G=E.y-.5*g,this.H=this.G+g,this.Ye=E.z-.5*b,this.Bg=this.Ye+b):(this.v=E,this.G=_,this.Ye=g,this.C=E,this.H=_,this.Bg=g)},G.prototype.move=function(E){this.v+=E.x,this.G+=E.y,this.Ye+=E.z,this.C+=E.x,this.H+=E.y,this.Bg+=E.z},G.prototype.copyTo=function(E){E.v=this.v,E.G=this.G,E.C=this.C,E.H=this.H},G.prototype.Lk=function(E,_,g){this.v>E?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_),isNaN(this.Ye)==0?this.Ye>g?this.Ye=g:this.BgE.length)throw A.i.N();E[0]=new A.Nd(this.v,this.G,this.Ye),E[1]=new A.Nd(this.v,this.H,this.Ye),E[2]=new A.Nd(this.C,this.H,this.Ye),E[3]=new A.Nd(this.C,this.G,this.Ye),E[4]=new A.Nd(this.v,this.G,this.Bg),E[5]=new A.Nd(this.v,this.H,this.Bg),E[6]=new A.Nd(this.C,this.H,this.Bg),E[7]=new A.Nd(this.C,this.G,this.Bg)},G.prototype.Zw=function(E){if(E==null||E.length==0)this.Oa();else{var _=E[0];for(this.K(_.x,_.y,_.z),_=1;_this.FA;){var N=this.sd.ha();if(C.L(N.ac()),O.L(N.wc()),C.scale(this.Wa.ec),O.scale(this.Wa.ec),A.cj.Mu(C,O)?C.x=O.x:A.cj.Ku(C,O)&&(O.x=C.x),this.uk.length=0,A.cj.tF(this.Wa.Tb,this.Wa.kc,this.Wa.ze,C,O,this.Wa.QA,this.Wa.Zs,F,this.Nj,this.Gs,this.uk,this.bw),this.co!=null&&(N=this.uk.slice(0),this.co.qG(this.co.da()-1,N,N.length-1)),A.cj.Lu(C,O)?(this.qq.Oa(),this.Wa.sy(C,this.sl,this.qq),this.Xn=!0):(this.qq.Oa(),this.Xn=this.xy(F[0],this.qq)),this.Xn){if(this.sd.li(),this.sd.Ez()){this.sd.li(),this.sd.ha();break}this.sd.DW();break}g==null&&(g=new A.Da).Yk(null,0),this.OD(g),b++}if(this.bw[0]=0,0=this.Nj[0]){var F=this.di+1.570796326794897;C=F+3.141592653589793-(this.di-this.Nj[0])}else C=(F=this.di+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Nj[0]-this.di));var N=!(this.di>=this.Nj[0]&&3.141592653589793>=this.di-this.Nj[0])&&!(this.diF;)W-=6.283185307179586;Wb.x-this.sk[0]?this.sk[0]-=6.283185307179586:3.141592653589793F?j.xX():j.$n=F,C=g.getType(),A.aa.yd(C)?((C=new A.Ta(g.description)).oc(g,!0),g=C,C=1607):C==197&&(C=new A.l,g.A(C),C.R()<=j.qa||C.ca()<=j.qa?((C=new A.Ta(g.description)).ad(g,!1),g=C,C=1607):((C=new A.Da(g.description)).ad(g,!1),g=C,C=1736)),j.yX(),A.aa.Rn(C)||j.zX(),j.rb<=.5*j.$n)return C!=1736?new A.Da(g.description):j.Wv?g:A.cj.Qr(g,j.Qg,j.ze,j.QA,-1,N);if(0>j.Ka&&C!=1736)return new A.Da(g.description);if(j.Wv&&A.aa.Hc(C)?(b=A.cj.Qr(g,b,4,NaN,j.$n,N),g=A.cb.zh(b,j.Qg,j.Jc)):g=A.cb.zh(g,j.Qg,j.Jc),(g=A.Hh.lj(g,j.Jc)).B())return new A.Da(g.description);switch(!j.Wv&&A.aa.Hc(C)&&(g=A.cj.pI(j.ec,g)),g=_.KX(g,j.Jc),C){case 1736:b=j.UN(g);break;case 1607:b=j.VN(g);break;case 550:b=j.SN(g);break;case 33:b=j.TN(g);break;default:throw A.i.fa("corrupted_geometry")}return(j=A.cb.zh(b,j.Jc,j.Qg)).Jl(g.description),j},_.prototype.UN=function(g){var b=new A.Da;g=new G(this,g,b),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),g=A.ip.nj(g,this.Jc,2);var C=new A.Dd;return C.scale(1/this.ec,1/this.ec),b.Oc(C),b=A.ip.nj(b,this.Jc,2),0<=this.Ka?A.Gh.local().V(b,g,this.Jc,this.Ub):A.kp.local().V(b,g,this.Jc,this.Ub)},_.prototype.VN=function(g){return g=new G(this,g,null),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),A.ip.nj(g,this.Jc,2)},_.prototype.SN=function(g){return g=new ue(this,g),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),A.ip.nj(g,this.Jc,2)},_.prototype.TN=function(g){(g=g.D()).scale(this.ec);var b=new A.Da;return this.sy(g,!1,b),A.ip.nj(b,this.Jc,2)},_.prototype.xy=function(g,b,C,O,F,N){var j=g[0],W=g[g.length-1],q=j.y>W.y?j.y:W.y,J=A.F.q(this.Tb,this.kc,j.yg.Ke()&&(this.UV(g),!0)},_.prototype.OI=function(g,b,C){var O=C.I(),F=0N.x?(N=this.zq,O.gg(-this.Js,0)):(N=-this.zq,O.gg(this.Js,0)),b.add(g,!1),g.Oa(),C.add(b,!1),C.Oc(O),F=new A.l,C.A(F),F.W((this.Js-F.R())/2,0),F.G=-this.zq,F.H=this.zq;for(var W=0;W=j));)A.kb.yi(g,b,F.x,F.y,O,Xt,De,pt),q?Ye.ma(De.u,pt.u):(Et.ma(De.u,pt.u),_.gJ(F.x,Et.x,jt.x,J),Ye.ma(J[0]+Et.x,Et.y),jt.L(Ye)),Ye.scale(C),ee.wf(0,-1,Ye),N=Xt,Xt=ei++*W}},_.dJ=function(g,b,C,O,F,N,j,W,q,J){var ee=new A.h,he=new A.h,Ee=new A.ga(0),De=new A.ga(0);for(A.kb.yi(g,b,O.x,O.y,C,F,Ee,De),ee.ma(Ee.u,De.u),A.kb.yi(g,b,O.x,O.y,C,N,Ee,De),he.ma(Ee.u,De.u),C=new A.ga(0),A.kb.Xy(g,b,j.x,j.y,ee.x,ee.y,C),q[0]=C.u,A.kb.Xy(g,b,j.x,j.y,he.x,he.y,C),J[0]=C.u;q[0]<=J[0];)q[0]+=6.283185307179586;for(;q[0]>J[0];)q[0]-=6.283185307179586;for(;q[0]>=W;)q[0]-=6.283185307179586,J[0]-=6.283185307179586;for(;q[0]N[ee]?1:0}),b=g.Ia(),W=0;Wthis.rb/g&&(g=this.rb/500),.01>g&&(g=.01),this.$n=g},_}();A.VK=E}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.Mf=function(E,_){var g=new A.h;g.L(_),E.push(g)},G.up=function(E,_){E.add(_.x),E.add(_.y)},G.hB=function(E){E.Bh(E.size-2)},G.oB=function(E,_){_.ma(E.get(E.size-2),E.get(E.size-1))},G.Qr=function(E,_,g,b,C,O){if(E==null)throw A.i.N();var F=E.getType();if(E.B()||A.aa.Rn(F))return E;var N=new G;N.Qg=_,N.Jc=A.cb.sc(_);var j=A.cb.vv(N.Jc);if(N.Ub=O,N.Tb=A.cb.ev(N.Jc),N.kc=j*(2-j),N.ec=N.Jc.Hd().ai,N.Aq=N.Jc.Kn(),N.Zs=N.Aq*N.ec,N.AA=b,N.zA=C,N.ze=g,F==197?(g=new A.Da(E.description)).ad(E,!1):A.aa.yd(F)?(g=new A.Ta(E.description)).oc(E,!0):g=E,N.ze!=4){if((_=N.Qg.Nb(N.Jc)==0?A.cb.zh(g,N.Qg,N.Jc):A.Hh.lj(g,N.Jc)).B())return _;_=G.pI(N.ec,_),_=N.Zy(_),_=A.ip.nj(_,N.Jc,N.ze),N=A.cb.zh(_,N.Jc,N.Qg)}else{if(A.Eg.Sb(_)==2?(E=A.cb.ml(),(_=A.Xj.local().V(g,E,_,O))==E&&(_=new A.Da,E.copyTo(_))):_=A.Hh.lj(g,N.Jc),_.B())return _;N=N.CX(_)}return N},G.pI=function(E,_){var g=new A.l;if(_.xc(g),3.141592653589793>g.R()*E)return _;var b=!1;g=_.Ga();for(var C=new A.h,O=new A.h;g.$a();)for(;g.Ha();){var F=g.ha();if(C.L(F.ac()),O.L(F.wc()),C.scale(E),O.scale(E),3.141592653589793O.x-C.x)for(;-6.283185307179586>O.x-C.x;)O.x+=6.283185307179586;G.Wi(O.x,NaN,De),J.L(O)}else W.L(O),G.AU(W),G.Wi(W.x,Ee,De),J.ma(De[0]+W.x,W.y);.5>Math.abs(J.x-O.x)&&J.L(O),j?(F.Tw(0,he),ee.L(q),ee.scale(1/E),he.Cb(ee),(N=g.vm())?b.nf(he):b.lineTo(he),g.Qn()&&!_.dc(g.gb)&&(F.Tw(1,he),ee.L(J),ee.scale(1/E),he.Cb(ee),b.lineTo(he))):((N=g.vm())&&b.Hz(null,0),F=b.da()-1,ee.L(q),ee.scale(1/E),b.wf(F,-1,ee),g.Qn()&&!_.dc(g.gb)&&(ee.L(J),ee.scale(1/E),b.wf(F,-1,ee)))}return b},G.tF=function(E,_,g,b,C,O,F,N,j,W,q,J){var ee=new A.h,he=new A.h,Ee=0Et&&(Et+=6.283185307179586),0>(De=De.u)&&(De+=6.283185307179586),j!=null&&(j[0]=pt),W!=null&&(W[0]=Et),q!=null&&(q[0]=De),W=j=NaN,J!=null&&(j=((W=A.F.Ah(E,_))-(q=A.F.q(E,_,b.y)))/pt,W=(W+q)/pt),q=G.Mu(b,C),De=G.Ku(b,C),Et=q||De;var Ye=G.FE(b,C,N),jt=new A.ga(0),ei=new A.ga(0),Xt=new A.h,wi=new A.h,pi=new A.h;G.Wi(b.x,NaN,he);var Ri=[he[0]];if(pt<=O)G.Mf(ee,b),G.Wi(C.x,NaN,he),J?.add(0),Et?(q&&G.kB(b,C,J,ee),De&&G.iB(b,C,J,ee)):Ye?G.jB(b,C,Ee,j,W,J,ee):0pi.x&&(he[0]+=6.283185307179586,pi.ma(he[0]+Xt.x,Xt.y)):Bi.xF.x?F.x+=6.283185307179586:3.141592653589793z;z++)if(Bi=Ui[z]*W+(1-Ui[z])*j,A.kb.oj(E,_,b.x,b.y,Bi*C,O,pt,Et,g),Xt.ma(pt.u,Et.u),z==0&&(ar=Bi,wi.L(Xt)),G.WW(jt,Xt,ei,Ri),Ri.hc(Ri.fe(Xt,!0),pi),A.kb.wd(E,_,Xt.x,Xt.y,pi.x,pi.y,Ye,null,null,2),Ye.u>q){mi=!0;break}mi?(ei.L(wi),W=ar,G.up(F,ei),N.add(W)):(G.hB(F),N.En(N.size-1,1,N.size-1),0=F&&Mn.u<=O&&3.141592653589793>Math.abs(Ee.x-De.x)||b.Ux(mi,ar)<=C));Ri++){var ai=ds[Ri]*ar+(1-ds[Ri])*mi;if(b.hc(ai,J),pi?pt.ma(J.x*g,J.y*g):(wi[0][0]=J.x,wi[0][1]=J.y,A.cb.vt(),pt.x=wi[0][0]*g,pt.y=wi[0][1]*g),Ri==0&&(ko=ai,he.L(J),Ye.L(pt),0O||3.141592653589793<=Math.abs(Ee.x-De.x)))){qn=!0;break}if(z&&0O||3.141592653589793<=Math.abs(Ee.x-pt.x)){qn=!0;break}}else if(0F){qn=!0;break}if(z){if(A.kb.wd(E,_,Xt.x,Xt.y,Et.x,Et.y,Tn,null,null,2),Tn.u>F){qn=!0;break}if(A.kb.wd(E,_,Et.x,Et.y,pt.x,pt.y,bs,null,null,2),bs.u>F){qn=!0;break}}}}qn?(q.L(he),De.L(Ye),ar=ko,G.up(Ui,q),G.up(Wi,De),Fr.add(ar)):(G.hB(Ui),G.hB(Wi),Fr.En(Fr.size-1,1,Fr.size-1),G.Mf(j,q),Bi+=Mn.u,N?.add(Bi),0Math.abs(_.x-E.x)?(b.Dc(E),3.141592653589793<=g.x-E.x?b.Ql(g.x-6.283185307179586,g.y):3.141592653589793<=E.x-g.x?b.Ql(g.x+6.283185307179586,g.y):b.Ql(g.x,g.y)):(b.Dc(g),3.141592653589793<=E.x-g.x?b.Ql(E.x-6.283185307179586,E.y):3.141592653589793<=g.x-E.x?b.Ql(E.x+6.283185307179586,E.y):b.Ql(E.x,E.y))},G.YJ=function(E,_){for(var g=0;gE.x)for(;-3.141592653589793>E.x;)E.x+=6.283185307179586;if(3.141592653589793G.v+b&&OG?-G:G},ue.Mb=function(G,E){return 0<=E?ue.P(G):-ue.P(G)},ue.Y=function(G,E){return G==E||ue.P(G-E)<=ue.JC*(1+(ue.P(G)+ue.P(E))/2)},ue.Cd=function(G){return G==0||ue.P(G)<=ue.JC},ue.Ah=function(G,E){var _=(E=(1-(E=Math.sqrt(1-E)))/(1+E))*E;return G/(1+E)*(1+_*(.25+_*(.015625+1/256*_)))*ue.EL},ue.EL=1.5707963267948966,ue.JC=3552713678800501e-30,ue}()}(ye||(ye={})),function(A){var ue=function(E){this.Wf=E,this.Kk=this.Wf.getCode(),0>this.Kk&&(this.Kk=0)};A.DY=ue;var G=function(){function E(_){_===void 0&&(_=null),this.Cj=null,this.Un=!1,_!==null&&(this.Cj=new ue(_))}return E.prototype.Ec=function(){return this.Cj!=null?this.Cj.Kk:0},E.prototype.Of=function(){var _=new E;return this.copyTo(_),_},E.prototype.copyTo=function(_){_.Cj=this.Cj,_.Un=this.Un},E.prototype.Qz=function(){this.Un=!this.Un},E.prototype.qm=function(){return this.Cj!=null?this.Cj.Wf:null},E.prototype.LJ=function(_){if(0>=_)throw A.i.N();if(_!=this.Ec()){if((_=A.pf.geogtran(_))==null)throw A.i.N("Geogtran not found.");this.Cj=new ue(_)}},E.prototype.Bz=function(){return this.Cj==null?null:this.Cj.Wf.toString()},E.prototype.tX=function(_){if(_==null)throw A.i.N();var g=null;try{g=A.pf.fromString(A.Sc.PE_TYPE_GEOGTRAN,_)}catch{throw A.i.N()}this.Cj=new ue(g)},E.prototype.Nb=function(_){return _==this||!(!(_ instanceof E)||(0>=this.Ec()||this.Ec()!=_.Ec())&&!this.qm().isEqual(_.qm()))&&this.Un==_.Un},E.prototype.toString=function(){var _="GeographicTransformation: "+this.Bz();return 200<_.length?_.substring(0,197)+"... ("+_.length.toString()+" characters)":_},E.create=function(_,g){var b=new E;return b.LJ(_),g&&b.Qz(),b},E.uP=function(_,g){var b=new E;return b.tX(_),g&&b.Qz(),b},E}();A.Dx=G}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.construct=function(_,g,b,C){var O=new E;return O.hw=_,O.iw=g,O.QY=b,O.RY=C,O},E.Ey=function(_,g){return _.hw==g.hw?_.iw==g.iw?0:_.iwE.I())},G.BE=function(E){return!(E.B()||E.getType()!=1607&&E.getType()!=1736||20>E.I())},G}();A.Uk=ue}(ye||(ye={})),function(A){A.$b=function(){function ue(){}return ue.TT=function(G){var E=new A.Da;return E.sx(G.es(),G.gs()),E.yj(G.es(),G.fs()),E.yj(G.ds(),G.fs()),E.yj(G.ds(),G.gs()),E},ue.zh=function(G,E){return G===null?null:A.Hx.local().V(G,E,null)},ue.jY=function(G,E){var _=A.Gh.local();return G=new A.Zc(G),_.V(G,E,null).next()},ue.im=function(G,E,_){return A.kp.local().V(G,E,_,null)},ue.ep=function(G,E,_){return A.Kx.local().V(G,E,_,null)},ue.VX=function(G,E,_){var g=A.Kx.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.Nb=function(G,E,_){return A.dj.local().V(3,G,E,_,null)},ue.TP=function(G,E,_){return A.dj.local().V(4,G,E,_,null)},ue.RS=function(G,E,_){var g=A.Xj.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.QP=function(G,E,_){var g=A.kp.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.Ea=function(G,E,_){return A.Xj.local().V(G,E,_,null)},ue.QS=function(G,E,_){if((G=A.Xj.local().V(G,E,_,null,1))===null)return[];if(G.getType()===550){for(E=[],_=0;_G.Db())return 0;var g=null;if(E!=null){if(g=E.Hd(),_!=null&&g.Ec()!=_.Ec()&&g.od!=_.od)throw A.i.Xk()}else if(_!=null)throw A.i.N();G.getType()==1736||G.getType()==197?E=G.mg():A.aa.yd(G.getType())?(E=new A.Ta(G.description)).oc(G,!0):E=G,G=0,E=E.Ga();for(var b=new A.h,C=new A.h;E.$a();)for(;E.Ha();){var O=E.ha();O.Yp(b),O.Tr(C),G+=A.h.tb(b,C)}return g!==null&&_!==null&&(G=A.Tc.Nh(G,g,_)),G},ue.fP=function(G){return G.points!==void 0?ue.mS(G,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM):G.rings!==void 0?ue.lG(G.rings,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM,"P"):G.paths!==void 0?ue.lG(G.paths,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM,"L"):G.x!==void 0?ue.nS(G):G.xmin!==void 0?ue.lS(G):null},ue.nS=function(G){if(G.x==null||G.x=="NaN")return new A.Sa;var E=new A.Sa(G.x,G.y);return G.z!==void 0&&G.z!==null&&E.wX(G.z),G.m!==void 0&&G.m!==null&&E.hX(G.m),E},ue.lS=function(G){if(G.xmin==null||G.xmin=="NaN")return new A.Fh;var E=new A.Fh(G.xmin,G.ymin,G.xmax,G.ymax);return G.zmin!==void 0&&G.zmin!==null&&E.setInterval(1,0,G.zmin,G.zmax),G.mmin!==void 0&&G.mmin!==null&&E.setInterval(2,0,G.mmin,G.mmax),E},ue.mS=function(G,E,_){var g=0,b=new A.de,C=3*G.points.length;C%2!=0&&C++,2>C&&(C=2);var O=A.O.truncate(3*G.points.length/2);4>O?O=4:16>O&&(O=16),C=A.Yc.Dn(C,0);var F=A.Yc.Dn(O);O=A.Yc.Dn(O);for(var N=0;N=C?(J[ee]=!1,W+=1,F.add(j),N.add(b),j+=he):J[ee]=!0}for((g=3*j)%2!=0&&g++,2>g&&(g=2),4>(ee=A.O.truncate(3*j/2))?ee=4:16>ee&&(ee=16),g=A.Yc.Dn(g,0),b=A.Yc.Dn(ee),C=A.Yc.Dn(ee),ee=he=0;eeF)throw A.i.N();this.Qi.oa=O-N,this.Qi.va=F+N,this.hi.resize(0),this.he=0,this.sg[0]=0},C.prototype.Uo=function(O,F){this.Qi.oa=O-F,this.Qi.va=O+F,this.hi.resize(0),this.he=0,this.sg[0]=0},C.prototype.next=function(){if(!this.Ya.lq)throw A.i.Hb();if(0>this.he)return-1;for(var O=!0;O;)switch(this.sg[this.he]){case 1:O=this.FU();break;case 2:O=this.GU();break;case 3:O=this.HU();break;case 4:O=this.IU();break;case 5:O=this.GW();break;case 6:O=this.kT();break;case 7:O=this.tN();break;case 0:O=this.Gz();break;default:throw A.i.Qa()}return this.Og!=-1?this.Mp()>>1:-1},C.construct=function(O){var F=new C;return F.Ya=O,F.hi.Jb(20),F.he=-1,F},C.prototype.Gz=function(){return this.Og=this.vH=this.Mi=this.Lc=-1,this.Ya.me!=null&&0=this.Qi.oa?(this.ei=this.QR(),!1):(this.he--,!0)},C.prototype.tN=function(){return this.Og=this.ei,this.Og!=-1&&b.gq(this.Mp())?(this.ei=this.SF(),!1):(this.he--,!0)},C.prototype.SF=function(){return this.Ya.Sf?this.Ya.$f.lb(this.Og):this.Ya.Ti.lb(this.Og)},C.prototype.QR=function(){return this.Ya.Sf?this.Ya.$f.we(this.Og):this.Ya.Ti.we(this.Og)},C.prototype.Mp=function(){return this.Ya.Sf?this.Ya.$f.ja(this.Og):this.Ya.Ti.getData(this.Og)},C}();A.EY=g;var b=function(){function C(O){this.Am=this.$h=this.$f=this.Ti=this.Km=this.Ej=this.me=this.Fj=null,this.Sf=O,this.lq=this.Sv=!1}return C.prototype.kr=function(){this.Nk(!0)},C.prototype.Br=function(O,F){if(!this.Sv)throw A.i.Hb();this.Fj.push(new A.Nc(O,F))},C.prototype.Fp=function(){if(!this.Sv)throw A.i.fa("invalid call");this.Sv=!1,this.lq=!0,this.Sf||(this.vS(),this.Zv=this.Fj.length)},C.prototype.vj=function(O){if(!this.Sf||!this.lq)throw A.i.N("invalid call");if(this.kf==-1){var F=this.Fj.length;if(this.iA){var N=new A.ia(0);N.Jb(2*F),this.bJ(N),this.$h.Jb(2*F),this.$h.resize(0),this.aJ(N),this.Km.resize(F,-1),this.Km.Wj(-1,0,F),this.iA=!1}else this.Km.Wj(-1,0,F);this.kf=this.Tu()}F=this.pG(O<<1,this.kf),N=this.$f.addElement(1+(O<<1),this.xz(F)),this.VJ(F,N),this.Km.set(O,F),this.Zv++},C.prototype.remove=function(O){if(!this.Sf||!this.lq)throw A.i.fa("invalid call");var F=this.Km.get(O);if(F==-1)throw A.i.N("the interval does not exist in the interval tree");this.Km.set(O,-1),this.Zv--;var N=this.xz(F),j=this.$f.ZR(N);this.$f.vd(this.wR(F),N),this.$f.vd(this.TR(F),N),(O=this.$f.size(N))==0&&(this.$f.MP(N),this.ZJ(j,-1)),this.Ej.jd(F),N=this.UF(j);var W=this.qj(j),q=this.lk(j);for(F=0;!(0>1);W!=-1?this.VJ(W,this.Ti.addElement(this.xz(W),j)):(W=this.pG(j,this.kf),N.set(j>>1,W))}},C.prototype.pG=function(O,F){var N=F,j=F,W=-1,q=0,J=this.$h.size-1,ee=0,he=O>>1,Ee=NaN,De=NaN,pt=!0,Et=this.DR(he);for(he=this.AR(he);pt;){qYe&&(YeYe)F!=-1&&(F==N?(j=N,Ee=Ye,De=(F=this.lk(N))!=-1?this.Np(F):NaN):De>1];return C.gq(O)?F.oa:F.va},C}();A.sr=b}(ye||(ye={})),function(A){var ue=function(){function G(E){if(E==null)throw A.i.fa("Invalid arguement");this.hf=E;var _=E.nR();_.hS()?E.ef.IG()?this.lo=A.si.PannableFold:this.lo=A.si.Clip:this.lo=A.si.DontClip,_.iS()?E.Yf.IG()?this.Qm=A.si.PannableFold:this.Qm=A.si.Clip:this.Qm=A.si.DontClip,this.Bm=_.Jr,this.mH=_.Vu,E=this.hf.sH,this.aH=E.hs(2147483648),this.Uv=E.hs(1073741824)}return G.zh=function(E,_,g){return _.ww.zh(E,g)},G.Rt=function(E,_,g,b){return E.ww.Rt(_,g,b)},G.Qt=function(E,_,g,b){if(g=0>g?_.length:g,(E=E.ww.Rt(_,g,b))==g)return E;for(var C=_=0;CC.H){var he=A.l.construct(N.v-1,C.G,N.C+1,C.H);if((ee=A.ri.Nu(ee,he,g,NaN,0,_)).B())return ee}N.R()>2*C.R()&&(ee=A.zb.Hp(ee,-2*C.R(),2*C.R(),g,!0,0,!0,_))}N=this.mH,(C=!isNaN(N))&&(ee=A.Xl.local().V(ee,N,_)),he=W?b.kk():null;var Ee=NaN;j&&(Ee=g.zi());var De=b.Wr()!=null;if(this.aH)j&&(A.zb.ur(g,Ee,ee,F),C&&(j=g.hh(),N*=(Ee=g.sc().hh())/j)),A.zb.tr(this.hf,ee,J,F),C&&(j=g.sc().hh(),N*=(Ee=b.sc().hh())/j),g=ee;else{var pt=new A.Ta(ee.description);pt.DD(ee),j&&(A.zb.ur(g,Ee,pt,F),C&&(j=g.hh(),N*=(Ee=g.sc().hh())/j)),A.zb.tr(this.hf,pt,J,F),C&&(j=g.sc().pm(),N*=(Ee=b.sc().pm())/j),J=NaN,W?(he=b.kk(),J=b.zi()):isNaN(this.Bm)||(J=this.Bm),j=G.tv(g)|G.tv(b),Ee=10*q.Xd(0),this.Uv&&(j=3,Ee=0),g=A.zb.UQ(ee,g,pt,q,J,_,j,Ee)}return De&&(g=A.zb.XD(g,b,_)),W&&(O||(W=q.Oe().R(),g.Tg(0,0).R()>=W-q.Xd(0)&&(q=he.getNorthPoleLocation(),W=he.getSouthPoleLocation(),ee=he.getNorthPoleGeometry(),he=he.getSouthPoleGeometry(),J=0,ee==A.Cg.PE_POLE_POINT&&q!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(J=1),he==A.Cg.PE_POLE_POINT&&W!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(J|=2),J!==0&&(O=!0))),g=A.zb.Mz(g,b,this.Qm,_),C&&(g=A.Xl.local().V(g,N,_)),A.zb.Lx(b,g,F)),g.B()||(O&&(g=A.Yl.local().V(g,b,!1,_)),E!=null&&(g=E.Zk(g,!1),this.wp(E,A.bm.reverse,g),g=E.$k(g,!1))),g},G.tv=function(E){if(E.Sb()!=2)return 0;var _=0,g=E.kk();E=g.getNorthPoleLocation();var b=g.getSouthPoleLocation(),C=g.getNorthPoleGeometry();return g=g.getSouthPoleGeometry(),C==A.Cg.PE_POLE_POINT&&E!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(_=1),g==A.Cg.PE_POLE_POINT&&b!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(_|=2),_},G.prototype.hW=function(E,_){var g=this.hf.ef,b=this.hf.Yf,C=g.Sb(),O=b.Sb(),F=A.O.Fu(Math.min(E.I(),64)),N=A.Ta.jg(E);C==3&&(C=(g=(E=g.Ji).fk()).Sb(),N=E.$k(N,!0),this.wp(E,A.bm.forward,N),N=E.Zk(N,!0)),E=null,O==3&&(O=(b=(E=b.Ji).fk()).Sb());var j=C==2;C=(O=O==2)?b.sc():b;var W=!O&&!this.Uv;if(j){if((N=A.zb.UI(N,g,this.lo,_)).B())return N}else{var q=new A.l;N.xc(q);var J=g.Oe();if((q.GJ.H)&&(q=A.l.construct(q.v-1,J.G,q.C+1,J.H),(N=A.ri.Nu(N,q,g,NaN,0,_)).B()))return N}var ee=NaN;j&&(ee=g.zi()),q=b.Wr()!=null,J=this.mH;var he=!isNaN(J);if(he&&(N=A.Xl.local().V(N,J,_)),this.aH)j&&A.zb.ur(g,ee,N,F),he&&(j=g.hh(),J*=(ee=g.sc().hh())/j),A.zb.tr(this.hf,N,W,F),he&&(j=g.sc().hh(),J*=(ee=b.sc().hh())/j),g=N;else{var Ee=new A.Ta(N.description);Ee.DD(N),j&&(A.zb.ur(g,ee,Ee,F),he&&(j=g.hh(),J*=(ee=g.sc().hh())/j)),A.zb.tr(this.hf,Ee,W,F),he&&(j=g.sc().hh(),J*=(ee=b.sc().hh())/j),W=NaN,O?W=b.zi():isNaN(this.Bm)||(W=this.Bm),j=G.tv(g)|G.tv(b),ee=10*C.Xd(0),this.Uv&&(j=3,ee=0),g=A.zb.VQ(N,g,Ee,C,W,_,j,ee)}return q&&(g=A.zb.XD(g,b,_)),O&&(g=A.zb.Mz(g,b,this.Qm,_),he&&(g=A.Xl.local().V(g,J,_)),A.zb.Lx(b,g,F)),g.B()||E!=null&&(g=E.Zk(g,!1),this.wp(E,A.bm.reverse,g),g=E.$k(g,!1)),g},G.prototype.eW=function(E,_){var g=(E.ca()+E.R())/400;return g!=0?(g=A.Xl.local().V(E,g,_),g=this.VI(g,_),_=E.Ia(),g.bn(_)):(_=new A.Sa(E.Ip()),g=this.XI(_),_=E.Ia(),g.B()?_.Oa():(E.copyTo(_),E=g.D(),_.K(E.x,E.y,E.x,E.y))),_},G.prototype.fW=function(E,_){E=A.aa.jg(E);var g=this.hf.ef,b=this.hf.Yf,C=g.Sb(),O=b.Sb(),F=A.O.Fu(Math.min(E.I(),64));if(C==3){var N=g.Ji;C=(g=N.fk()).Sb(),E=N.Zk(E,!0),this.wp(N,A.bm.forward,E),E=N.$k(E,!0)}if(C==2){if(this.lo==A.si.Clip?E=A.Xj.local().V(E,g.ml(),g,_):g.Wc()&&(C=new A.l,E.xc(C),g.Oe().contains(C)||(this.lo==A.si.PannableFold&&(E=A.zb.lj(E,g)),A.zb.Jt(E,g.Oe(),g.Xd(0),!0),E=A.zb.Fn(E,g,0,!0,0,_))),E.B())return E;A.zb.ur(g,0,E,F)}else A.zb.Jt(E,g.Oe(),g.Xd(0),!0);return A.zb.tr(this.hf,E,!1,F),g=0,C=!1,N=null,O==3&&(C=!0,O=(b=(N=b.Ji).fk()).Sb()),(O=O==2)?g=b.zi():isNaN(this.Bm)||(g=this.Bm),O&&this.Qm!=A.si.Clip||(E=A.zb.Fn(E,b.sc(),g,!1,0,_)),O&&(E=A.zb.Mz(E,b,this.Qm,_),A.zb.Lx(b,E,F),E.B())||C&&(E=N.Zk(E,!0),this.wp(N,A.bm.reverse,E),E=N.$k(E,!0)),E},G.prototype.wp=function(E,_,g){var b=g.I();if(b!=0){for(var C=g.ub(0),O=A.O.lg(200,0),F=[],N=0;NC.v+O&&N_?this.wv(g,b):this.gv(g,b);case 1:var C=this.wv(g,b);return g=this.gv(g,b),A.lc.hq(C,g,_);case 2:throw A.i.fa("not implemented")}throw A.i.Qa()},E.prototype.fe=function(_,g){var b=this.pa-this.sa,C=this.la-this.na,O=b*b+C*C;return O==0?.5:(_=((_.x-this.sa)*b+(_.y-this.na)*C)/O,g||(0>_?_=0:1<_&&(_=1)),_)},E.prototype.cq=function(_,g,b,C){if(_){if((_=this.la-this.na)==0)return g==this.la?-1:0;if(0>(g=(g-this.na)/_)||1(g=(g-this.sa)/_)||1(g=8881784197001252e-31*(Math.abs(b.x*g.y)+Math.abs(b.y*g.x)))?-1:_<-g?1:0},E.prototype.rp=function(_,g,b,C){var O=this.sa,F=this.na,N=_-O,j=g-F;if((N=Math.sqrt(N*N+j*j))<=Math.max(b,6661338147750939e-31*N))return C&&N==0?NaN:0;if(N=_-this.pa,j=g-this.la,(N=Math.sqrt(N*N+j*j))<=Math.max(b,6661338147750939e-31*N))return C&&N==0?NaN:1;if(N=this.pa-this.sa,j=this.la-this.na,0<(C=Math.sqrt(N*N+j*j))){var W=1/C,q=_-O,J=g-F,ee=q*(N*=W)+J*(j*=W),he=17763568394002505e-31*(Math.abs(q*N)+Math.abs(J*j)),Ee=N;if(N=-j,j=Ee,ee<-(he=Math.max(b,he))||ee>C+he)return NaN;if(Math.abs(q*N+J*j)<=Math.max(b,17763568394002505e-31*(Math.abs(q*N)+Math.abs(J*j)))&&(.5>=(N=A.O.Rk(ee*W,0,1))?(j=this.sa+(this.pa-this.sa)*N,C=this.na+(this.la-this.na)*N):(j=this.pa-(this.pa-this.sa)*(1-N),C=this.la-(this.la-this.na)*(1-N)),A.h.Oy(j,C,_,g)<=b)){if(.5>N){if(A.h.Oy(j,C,O,F)<=b)return 0}else if(A.h.Oy(j,C,this.pa,this.la)<=b)return 1;return N}}return NaN},E.prototype.Nb=function(_){return _!=null&&(_==this||_.constructor===this.constructor&&this.FM(_))},E.prototype.rD=function(_,g,b){var C=b?this.sa:this.pa;b=b?this.na:this.la;var O=new A.h;return O.x=_.pa-C,O.y=_.la-b,!(g.Qh(O)>6661338147750939e-31*g.fD(O))||(O.x=_.sa-C,O.y=_.na-b,g.Qh(O)<=6661338147750939e-31*g.fD(O))},E.prototype.qD=function(_){var g=new A.h;return g.x=this.pa-this.sa,g.y=this.la-this.na,!!this.rD(_,g,!1)&&(g.Sq(),!!this.rD(_,g,!0))},E.NM=function(_,g){var b=_.uu(g.sa,g.na),C=_.uu(g.pa,g.la);return!(0>b&&0>C||0b&&0>C||0(C=g.Qb())?_.qD(g):g.qD(_)))},E.LM=function(_,g,b){var C=A.h.construct(NaN,NaN),O=_.pa-_.sa,F=_.la-_.na,N=g.pa-g.sa,j=g.la-g.na,W=N*F-O*j;if(W==0)return C;var q=8881784197001252e-31*(Math.abs(N*F)+Math.abs(O*j)),J=g.sa-_.sa,ee=g.na-_.na,he=N*ee-J*j,Ee=he/W,De=Math.abs(W);return Ee<-(N=(8881784197001252e-31*(Math.abs(N*ee)+Math.abs(J*j))*De+q*Math.abs(he))/(W*W)+2220446049250313e-31*Math.abs(Ee))||Ee>1+N||(N=(j=O*ee-J*F)/W)<-(O=(8881784197001252e-31*(Math.abs(O*ee)+Math.abs(J*F))*De+q*Math.abs(j))/(W*W)+2220446049250313e-31*Math.abs(N))||N>1+O||(Ee=A.O.Rk(Ee,0,1),O=A.O.Rk(N,0,1),F=_.hc(Ee),W=g.hc(O),(q=new A.h).uc(F,W),q.length()>b&&(q.add(F,W),q.scale(.5),Ee=_.fe(q,!1),O=g.fe(q,!1),_=_.hc(Ee),g=g.hc(O),_.sub(g),_.length()>b)||C.ma(Ee,O)),C},E.OM=function(_,g,b,C){var O=0;if((_.sa==g.sa&&_.na==g.na||_.sa==g.pa&&_.na==g.la)&&(O++,!C))return 1;if(_.pa==g.sa&&_.la==g.na||_.pa==g.pa&&_.la==g.la){if(++O==2)return 2;if(!C)return 1}return g.vi(_.sa,_.na,b)||g.vi(_.pa,_.la,b)||_.vi(g.sa,g.na,b)||_.vi(g.pa,g.la,b)?1:C&&O!=0||E.NM(_,g)==0?0:1},E.Zx=function(_,g,b,C,O,F){var N=0,j=_.rp(g.sa,g.na,F,!1),W=_.rp(g.pa,g.la,F,!1),q=g.rp(_.sa,_.na,F,!1),J=g.rp(_.pa,_.la,F,!1);return isNaN(j)||(C!=null&&(C[N]=j),O!=null&&(O[N]=0),b!=null&&(b[N]=A.h.construct(g.sa,g.na)),N++),isNaN(W)||(C!=null&&(C[N]=W),O!=null&&(O[N]=1),b!=null&&(b[N]=A.h.construct(g.pa,g.la)),N++),N==2||isNaN(q)||j==0&&q==0||W==0&&q==1||(C!=null&&(C[N]=0),O!=null&&(O[N]=q),b!=null&&(b[N]=A.h.construct(_.sa,_.na)),N++),N==2||isNaN(J)||j==1&&J==0||W==1&&J==1||(C!=null&&(C[N]=1),O!=null&&(O[N]=J),b!=null&&(b[N]=A.h.construct(g.pa,g.la)),N++),0C[1]&&(_=C[0],C[0]=C[1],C[1]=_,O!=null&&(C=O[0],O[0]=O[1],O[1]=C),b!=null&&(O=A.h.construct(b[0].x,b[0].y),b[0]=b[1],b[1]=O)),N):(N=E.LM(_,g,F),isNaN(N.x)?0:(b!=null&&(b[0]=_.hc(N.x)),C!=null&&(C[0]=N.x),O!=null&&(O[0]=N.y),1))},E.prototype.eG=function(){return 0},E.prototype.op=function(){},E.prototype.toString=function(){return"Line: ["+this.sa.toString()+", "+this.na.toString()+", "+this.pa.toString()+", "+this.la.toString()+"]"},E}(A.SC);A.yb=ue}(ye||(ye={})),function(A){var ue=function(){function G(){this.Jm=[],this.ya=-1}return G.prototype.La=function(){return this.ya},G.prototype.next=function(){if(this.Jm!=null&&this.Jm.length!=0){this.ya++;var E=this.Jm[0];return this.Jm=1>=this.Jm.length?[]:this.Jm.slice(1),E}return this.Jm=null},G.prototype.ZX=function(E){this.Jm.push(E)},G.prototype.qe=function(){},G}();A.gL=ue}(ye||(ye={})),function(A){var ue;(ue=A.SL||(A.SL={}))[ue.enumFillRuleOddEven=0]="enumFillRuleOddEven",ue[ue.enumFillRuleWinding=1]="enumFillRuleWinding";var G=function(E){function _(g,b){var C=E.call(this)||this;if(C.xf=!1,C.Eq=null,C.sq=0,C.rq=0,C.Aj=null,C.Mg=!1,C.nb=null,C.mb=null,C.Ve=null,C.Lj=null,C.Sd=null,C.tq=0,C.gb=0,C.xq=0,b===void 0)C.xf=g,C.Mg=!1,C.tq=0,C.sq=0,C.rq=0,C.wa=0,C.description=A.ee.og();else{if(b==null)throw A.i.N();C.xf=g,C.Mg=!1,C.tq=0,C.sq=0,C.rq=0,C.wa=0,C.description=b}return C.Aj=null,C.gb=0,C}return me(_,E),_.prototype.tm=function(){return 0b)throw A.i.Qa();if(this.dc(g)){if(this.mb==null)throw A.i.Qa();var C=this.wa,O=this.Ba(g),F=this.Vc(g);this.dm(this.wa+1),this.mc();for(var N=0,j=this.description.Aa;Ng;b--)C=this.nb.read(b),this.nb.write(b,C+1);this.mb.KE(g,1)}},_.prototype.Ap=function(){if(this.wx(),g===void 0){this.Mg=!1;var g=this.da()-1}var b=this.mb.read(g);this.mb.write(g,1|b),this.Ve!=null&&(g=this.Vc(g)-1,this.Ve.write(g,1),this.Lj.write(g,-1))},_.prototype.dc=function(g){return(1&this.mb.read(g))!=0},_.prototype.Nn=function(g){if(this.dc(g))return!0;var b=this.Ba(g);return!(b>(g=this.Vc(g)-1))&&(b=this.Na(b),g=this.Na(g),b.qb(g))},_.prototype.yv=function(g){return(2&this.mb.read(g))!=0},_.prototype.oc=function(g,b){if(this.Jl(g.description),g.getType()!=322)throw A.i.Qa();var C=new A.Sa;(b||this.B())&&(g.To(C),this.nf(C)),g.Po(C),this.lineTo(C)},_.prototype.tp=function(g){var b=this.wa==0;this.sx(g.v,g.G),this.yj(g.v,g.H),this.yj(g.C,g.H),this.yj(g.C,g.G),this.Ap(),this.Mg=!1,b&&this.Lf(256,!1)},_.prototype.ad=function(g,b){if(!g.B()){for(var C=this.wa==0,O=new A.Sa(this.description),F=0;4>F;F++)g.Hf(b?4-F-1:F,O),F==0?this.nf(O):this.lineTo(O);this.Ap(),this.Mg=!1,C&&!b&&this.Lf(256,!1)}},_.prototype.add=function(g,b){for(var C=0;Cb&&(b=g.da()-1),b>=g.da()||0>C||0>O||O>g.rv(b))throw A.i.fa("index out of bounds");if(O!=0){var N=g.dc(b)&&C+O==g.rv(b);if(!N||O!=1){if(this.Mg=!1,this.Jl(g.description),C=g.Ba(b)+C+1,F&&(O++,C--),N&&O--,N=this.wa,this.dm(this.wa+O),this.mc(),F){if(O==0)return;this.nb.add(this.wa),F=g.mb.read(b),F&=-5,this.xf&&(F|=1),this.mb.write(this.mb.size-1,F),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.wa);F=0;for(var j=this.description.Aa;FJ||g.za[J]==null?this.za[F].Ln(q*N,A.ra.se(W),O*q,q*N):this.za[F].Mn(q*N,g.za[J],q*C,O*q,!0,q,q*N)}if(this.tm()||g.yv(b))throw A.i.Qa();this.Pc(1993)}}},_.prototype.oJ=function(){for(var g=0,b=this.da();g=this.da())throw A.i.N();var b=this.Ba(g),C=this.Ja(g);g=this.dc(g)?1:0;for(var O=0,F=this.description.Aa;Og&&(g=b-1),g>=b)throw A.i.N();for(var C=this.Ba(g),O=this.Ja(g),F=0,N=this.description.Aa;F=b.da())throw A.i.N();var F=this.da();if(g>F)throw A.i.N();0>g&&(g=F),0>C&&(C=b.da()-1),this.Mg=!1,this.Jl(b.description),b.mc();var N=b.Ba(C),j=b.Ja(C),W=this.wa,q=b.dc(C)&&!O?1:0;this.dm(this.wa+j),this.mc();for(var J=g=g+1;O--)N=this.nb.read(O-1),this.nb.write(O,N+j);for(b.yv(C),this.mb.add(0),O=F-1;O>=g+1;O--)F=this.mb.read(O),F&=-5,this.mb.write(O+1,F);F=b.JR().read(C),F&=-5,this.xf&&(F|=1),this.mb.write(g,F)},_.prototype.Hz=function(g,b){var C=-1,O=this.da();if(C>O)throw A.i.N();0>C&&(C=O),this.Mg=!1;var F=this.wa;this.dm(this.wa+b),this.mc();var N=C=C+1;F--)N=this.nb.read(F-1),this.nb.write(F,N+b);for(this.mb.add(0),F=O-1;F>=C+1;F--)b=this.mb.read(F),b&=-5,this.mb.write(F+1,b);this.xf&&this.mb.write(C,1)},_.prototype.qG=function(g,b,C){var O=-1;if(0>g&&(g=this.da()),g>this.da()||O>this.Ja(g)||C>b.length)throw A.i.fa("index out of bounds");if(C!=0){g==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>O&&(O=this.Ja(g)),this.mc();var F=this.wa;this.dm(this.wa+C),this.mc();for(var N=0,j=this.description.Aa;Ng&&(g=this.da()),g>=O||b>this.Ja(g))throw A.i.fa("index out of bounds");g==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>b&&(b=this.Ja(g));var F=this.wa;this.dm(this.wa+1),this.mc();var N=this.Ba(g);this.za[0].vj(2*(N+b),C,2*F),C=1;for(var j=this.description.Aa;Cg&&(g=C-1),g>=C||b>=this.Ja(g))throw A.i.fa("index out of bounds");this.mc();var O=this.Ba(g);0>b&&(b=this.Ja(g)-1),b=O+b,O=0;for(var F=this.description.Aa;O=g+1;C--)b=this.nb.read(C),this.nb.write(C,b-1);this.wa--,this.Pg--,this.Pc(1993)},_.prototype.uE=function(g,b,C){var O=this.Ba(g)+b;if((C=this.Ba(C)+void 0)O||C>this.I()-1)throw A.i.N();b=0,(g=this.Ga()).Vb(O);do{for(;g.Ha()&&(O=g.ha(),g.wb()!=C);)b+=O=O.Qb();if(g.wb()==C)break}while(g.$a());return b},_.prototype.fO=function(g,b,C){if(b=this.Ba(g)+b,C=this.Ba(g)+C,0>b||C>this.I()-1)throw A.i.N();var O=this.Ga();if(b>C){if(!this.dc(g))throw A.i.N("cannot iterate across an open path");O.JB()}var F=g=0;O.Vb(b);do F+=g,g=O.ha().Qb();while(O.wb()!=C);return F},_.prototype.mg=function(){return A.pi.gm(this,null)},_.prototype.KS=function(g,b,C){for(var O=g;Ob){var N=this.tm(),j=0;b=this.wa}else N=this.yv(b),j=this.Ba(b),b=this.Vc(b);for(;j=this.Ba(b))return b;b--}else b++;if(0<=b&&b=this.Ba(b)&&gC){for(b=0;bb;){var O=b+(C-b>>1);if(g=(b=this.Vc(O))))return this.gb=O;b=O+1}}return this.gb=b},_.prototype.yz=function(){var g=this.I();if(!this.xf){g-=this.da();for(var b=0,C=this.da();bC.RR()))return!0;this.Bb.yD(null)}return C=A.Nx.create(this,g,b),this.Bb.yD(C),!0},_.prototype.cc=function(){var g=E.prototype.cc.call(this);if(!this.Ac()){var b=this.da();this.nb!=null&&this.nb.An(g,0,b+1),this.mb!=null&&this.mb.An(g,0,b)}return g},_.prototype.ZF=function(g){return this.Ve!=null?this.Ve.read(g):1},_.prototype.bc=function(g,b,C){var O=this.sz(g);if(g==this.Vc(O)-1&&!this.dc(O))throw A.i.fa("index out of bounds");this.mc();var F=this.Ve,N=1;if(F!=null&&(N=7&F.read(g)),N!==1)throw A.i.Qa();if(b.Or(),b=b.get(),C?b.Nf(A.ee.og()):b.Nf(this.description),O=g==this.Vc(O)-1&&this.dc(O)?this.Ba(O):g+1,F=new A.h,this.D(g,F),b.Dc(F),this.D(O,F),b.Qc(F),!C)for(C=1,F=this.description.Aa;C=this.da())throw A.i.N();if(this.B())b.Oa();else{if(this.yv(g))throw A.i.fa("not implemented");var C=this.ub(0),O=new A.h,F=new A.l;F.Oa();var N=this.Ba(g);for(g=this.Vc(g);Nthis.I())&&(g=A.ta.nE(this),this.Bb.WM(g),!0)},_.prototype.hM=function(){if(this.Bb==null&&(this.Bb=new A.Uk),this.Bb.zo==null){this.Bb.xD(null);var g=A.ta.YN(this);this.Bb.xD(g)}},_.prototype.Yo=function(g){this.xq=g},_.prototype.In=function(){return this.xq},_.prototype.DD=function(g){if(this==g)throw A.i.fa("MultiPathImpl.add");for(var b=this.da(),C=0;C=(b=this.Vc(b))||gb?_.I():b,0>g||g>_.I()||bg?b:g,0>b||0>g)throw A.i.N();if(g!=0){b=g-0,g=this.wa,this.resize(this.wa+b);for(var C=0;C_||_>=this.I())throw A.i.fa("index out of bounds");this.mc();for(var g=0,b=this.description.Aa;gg||g>=this.wa||b_?_:G},ue.Th=function(G,E){var _=5381;return((_=((_=((_=E!==void 0?(E<<5)+E+(255&G):(_<<5)+_+(255&G))<<5)+_+(G>>8&255))<<5)+_+(G>>16&255))<<5)+_+(G>>24&255)&2147483647},ue.uj=function(){throw Error("Not Implemented")},ue.bB=function(G){return ue.aU(G)+12345&2147483647},ue.XG=function(G){var E=32,_=G%ue.Qx|0,g=G/ue.Qx|0;return(E&=63)==0?G:(32>E?(G=_>>>E|g<<32-E,E=g>>E):(G=g>>E-32,E=0<=g?0:-1),E*ue.Qx+(G>>>0))},ue.aU=function(G){var E=1103515245,_=65535&E;return((E-_)*(G|=0)|0)+(_*G|0)|0},ue.truncate=function(G){return 0>G?-1*Math.floor(Math.abs(G)):Math.floor(G)},ue.MAX_SAFE_INTEGER=Math.pow(2,53)-1,ue.MIN_SAFE_INTEGER=-ue.MAX_SAFE_INTEGER,ue.VC=65536,ue.Qx=ue.VC*ue.VC,ue}()}(ye||(ye={})),function(A){var ue;(ue=A.CL||(A.CL={}))[ue.Project=0]="Project",ue[ue.Union=1]="Union",ue[ue.Difference=2]="Difference",ue[ue.Proximity2D=3]="Proximity2D",ue[ue.Relate=4]="Relate",ue[ue.Equals=5]="Equals",ue[ue.Disjoint=6]="Disjoint",ue[ue.Intersects=7]="Intersects",ue[ue.Within=8]="Within",ue[ue.Contains=9]="Contains",ue[ue.Crosses=10]="Crosses",ue[ue.Touches=11]="Touches",ue[ue.Overlaps=12]="Overlaps",ue[ue.Buffer=13]="Buffer",ue[ue.Distance=14]="Distance",ue[ue.Intersection=15]="Intersection",ue[ue.Clip=16]="Clip",ue[ue.Cut=17]="Cut",ue[ue.DensifyByLength=18]="DensifyByLength",ue[ue.DensifyByAngle=19]="DensifyByAngle",ue[ue.LabelPoint=20]="LabelPoint",ue[ue.GeodesicBuffer=21]="GeodesicBuffer",ue[ue.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",ue[ue.ShapePreservingDensify=23]="ShapePreservingDensify",ue[ue.GeodeticLength=24]="GeodeticLength",ue[ue.GeodeticArea=25]="GeodeticArea",ue[ue.Simplify=26]="Simplify",ue[ue.SimplifyOGC=27]="SimplifyOGC",ue[ue.Offset=28]="Offset",ue[ue.Generalize=29]="Generalize",ue[ue.SymmetricDifference=30]="SymmetricDifference",ue[ue.ConvexHull=31]="ConvexHull",ue[ue.Boundary=32]="Boundary",ue[ue.SimpleRelation=33]="SimpleRelation";var G=function(){function E(){}return E.prototype.getType=function(){return null},E.prototype.wn=function(){},E.prototype.Iu=function(){return!1},E}();A.Je=G}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 13},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O){return _ instanceof A.aa?(O=new A.Zc(_),this.V(O,g,[b],!1,C).next()):C===!0?(b=new A.BC(_,g,b,!1,O),A.Gh.local().V(b,g,O)):new A.BC(_,g,b,!1,O)},E.instance=null,E}(A.Je);A.AC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C){this.ya=-1,this.Rd=E,this.$z=_,this.Cs=g,this.tT=new A.l,this.tT.Oa(),this.eo=-1,this.Ub=C}return G.prototype.next=function(){for(var E;(E=this.Rd.next())!=null;)return this.ya=this.Rd.La(),this.eo+1=E.I():E.da()==1&&(2>=E.I()||A.Zt.JG(E,0)))},G}();A.DC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 17},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O){return new A.nL(_,g,b,C,O)},E.instance=null,E}(A.Je);A.mL=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C){if(this.Tf=null,_==null||g==null)throw A.i.fa("invalid argument");this.qT=E,this.nA=_,this.lH=g,E=A.ta.mv(_,g),this.qa=A.ta.Wd(b,E,!0),this.kH=-1,this.nd=C}return G.prototype.La=function(){return 0},G.prototype.next=function(){return this.RQ(),++this.kHthis.Tf.length&&(this.Tf.length=0)},G.prototype.SQ=function(){var E=new A.ia(0),_=new A.gd,g=_.aF(),b=_.Ib(this.nA),C=_.Ib(this.lH),O=new A.Fg;try{O.Ft(_,this.qa,this.nd),O.dl(g,b,C,E);var F=_.Ne(b),N=new A.Da,j=new A.Da;for(this.Tf.length=0,this.Tf.push(N),this.Tf.push(j),b=0;b=g)throw A.i.N();return new A.oL(_,g,b)},E.instance=null,E}(A.Je);A.Xl=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_){this.ya=-1,this.Rd=E,this.Ps=_}return G.prototype.La=function(){return this.ya},G.prototype.next=function(){var E;return(E=this.Rd.next())!=null?(this.ya=this.Rd.La(),this.NP(E)):null},G.prototype.NP=function(E){if(E.B()||1>E.Db())return E;var _=E.getType();if(_==1736||_==1607)return this.Ny(E);if(A.aa.yd(_))return this.PP(E);if(_==197)return this.OP(E);throw A.i.Qa()},G.prototype.PP=function(E){if(E.Qb()<=this.Ps)return E;var _=new A.Ta(E.description);return _.oc(E,!0),this.Ny(_)},G.prototype.OP=function(E){var _=new A.Da(E.description);_.ad(E,!1);var g=new A.l;return E.A(g),E=g.ca(),g.R()<=this.Ps&&E<=this.Ps?_:this.Ny(_)},G.prototype.Ny=function(E){for(var _=E.Ia(),g=E.Ga();g.$a();)for(var b=!0;g.Ha();){var C=g.ha();if(C.getType()!=322)throw A.i.fa("not implemented");var O=g.On(),F=C.Qb();if(F>this.Ps){var N=Math.ceil(F/this.Ps);F=new A.Sa(E.description),b&&(C.To(F),_.nf(F));var j=b=1/N,W=0;for(--N;WF)return _;var N=_.getType(),j=g.getType(),W=new A.l,q=new A.l,J=new A.l;_.A(W),g.A(q),J.K(W),J.Zb(q);var ee=(J=A.ta.Wd(b,J,!0))*Math.sqrt(2)*1.00001,he=new A.l;if(he.K(W),he.W(ee,ee),!he.isIntersecting(q))return _;if(O==1&&F==2)return E.KV(_,g,j,b,C);if(N==33)switch(A.Vk.yd(j)?(b=new A.Ta(g.description),b.oc(g,!0)):b=g,j){case 1736:return E.XU(_,b,J);case 1607:return E.YU(_,b,J);case 550:return E.VU(_,b,J);case 197:return E.UU(_,b,J);case 33:return E.WU(_,b,J);default:throw A.i.N()}else if(N==550)switch(j){case 1736:return E.nU(_,g,J);case 197:return E.lU(_,g,J);case 33:return E.mU(_,g,J)}return A.Fg.im(_,g,b,C)},E.XU=function(_,g,b){return A.hd.KG(g,_,b)==0?_:_.Ia()},E.YU=function(_,g,b){var C=_.D();g=g.Ga();for(var O=b*Math.sqrt(2)*1.00001,F=O*O,N=new A.l;g.$a();)for(;g.Ha();){var j=g.ha();if(j.A(N),N.W(O,O),N.contains(C)){if(j.qs(C,b))return _.Ia();var W=j.ac();if(A.h.yc(C,W)<=F||(W=j.wc(),A.h.yc(C,W)<=F))return _.Ia()}}return _},E.VU=function(_,g,b){var C=g.ub(0);g=g.I();var O=_.D(),F=new A.h;b=b*Math.sqrt(2)*1.00001,b*=b;for(var N=0;Ng.I()?this.gE(_,g,b):(this.Nt(),_=this.gE(g,_,b),this.Nt(),_):_.getType()==550&&A.aa.Hc(g.getType())?(_=this.hE(g,_,b),this.Nt(),_):g.getType()==550&&A.aa.Hc(_.getType())?this.hE(_,g,b):_.getType()==550&&g.getType()==550?_.I()>g.I()?this.iE(_,g):(this.Nt(),_=this.iE(g,_),this.Nt(),_):0},E.prototype.gE=function(_,g,b){var C=_.Ga(),O=g.Ga(),F=new A.l,N=new A.l,j=17976931348623157e292;if(!b&&this.pY(_,g,C,O))return 0;for(;C.$a();)for(;C.Ha();)if((_=C.ha()).A(F),!(F.px(this.oh)>j)){for(;O.$a();)for(;O.Ha();)if((g=O.ha()).A(N),F.px(N)F)){for(var q=0;qC)){for(var q=0;qE.Ja(_))){var C=E.Ba(_),O=E.Vc(_)-1,F=E.ub(0),N=E.dc(_),j=new A.ia(0);j.Jb(E.Ja(_)+1);var W=new A.ia(0);for(W.Jb(E.Ja(_)+1),j.add(N?C:O),j.add(C),C=new A.h;1this.DH&&N>O&&(C=b,O=N)}return C},G.prototype.qe=function(){},G}();A.sL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 29},E.prototype.V=function(_,g,b,C){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C).next()):new A.sL(_,g,b,C)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.instance=null,E}(A.Je);A.EC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 21},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O,F,N,j){return _ instanceof A.aa?(j=new A.Zc(_),this.V(j,g,b,[C],O,F,!1,N).next()):N===!0?(b=new A.GC(_,g,b,C,O,!1,!1,j),A.Gh.local().V(b,g,j)):new A.GC(_,g,b,C,O,!1,!1,j)},E.instance=null,E}(A.Je);A.FC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C,O,F,N){if(O)throw A.i.Ie();if(_==null)throw A.i.N();this.ya=-1,this.Ms=E,this.vg=_,this.ze=g,this.Cs=b,this.$n=C,this.eo=-1,this.Ub=N,this.uT=new A.l,this.uT.Oa()}return G.prototype.next=function(){for(var E;(E=this.Ms.next())!=null;)return this.ya=this.Ms.La(),this.eo+1_.Db())return 0;if(b==4)throw A.i.Ie();var C=A.cb.sc(g),O=A.cb.vv(C),F=A.cb.ev(C);O*=2-O;var N=C.Hd().ai,j=_.getType();if(j==1736||j==197)var W=_.mg();else A.aa.yd(j)?(W=new A.Ta(_.description)).oc(_,!0):W=_;if(C.Nb(g)==0){if(A.cb.Wc(g)){W=A.Hh.lj(W,g),j==1607&&W==_&&(W=A.aa.jg(_)),_=new A.Nc,A.cb.gh(g).cn(_),j=0;for(var q=W.I();j=this.Fi||7C||g==0&&_==550&&this.Dj==33?this.nJ():G.HB(E,b);if((this.Fi==-1||this.Fi==4)&&_==197&&this.Dj==197)return g=this.Se,_=new A.l,E.A(_),b=new A.l,g.A(b),_.Ea(b),g=new A.Fh,E.copyTo(g),g.Xo(_),g;if(_==197&&A.aa.tf(this.Dj)==0||this.Dj==197&&A.aa.tf(_)==0)return b=_==197?E:this.Se,E=_==197?this.Se:E,_=new A.l,b.A(_),A.Ud.clip(E,_,g,0);if(A.aa.tf(_)==0&&0N&&(N=g.yz()),O=g.I()+b.I(),N*b.I()>Math.log(O)*O*4)return null;O=null,N=b.Ga(),j!=null&&j.Fb!=null&&(O=j.Fb),O==null&&20Ye){if(O!=null)for(b==null?b=O.vR(jt,C):b.Uo(jt,C),Ye=b.next();Ye!=-1;Ye=b.next()){N.Vb(O.ja(Ye)),Ye=N.ha();var ei=jt.Ea(Ye,null,W,null,C);for(Ye=0;YeEt?(ee=j.wb()-g.Ba(pt),he=1,Et=Et==0?3:2):he++:(E.oc(Xt,Et==0),Et=1);break;case 0:Et=0,ee=-1,he=0;break;default:return null}Xt=pi}}}else{if(0>(Ye=this.QD(_,jt.ac(),C)))return null;Ye==1?(2>Et&&(ee=j.wb()-g.Ba(pt),Et=Et==0?3:2),he++):(ee=-1,he=0)}q.clear(!1)}else Ye!=0&&Ye==1&&(Et==0?(Et=3,ee=j.wb()-g.Ba(pt)):Et==1?(Et=2,ee=j.wb()-g.Ba(pt)):he++)}2<=Et&&(E.Dr(g,pt,ee,he,Et==3),ee=-1)}return E},G.prototype.QD=function(E,_,g){return A.Dg.wm(E,_,g)},G.prototype.RD=function(E,_,g){var b=_.ac();_=_.wc();var C=A.Dg.wm(E,b,g),O=A.Dg.wm(E,_,g);return C==1&&O==0||C==0&&O==1?-1:C==0||O==0?0:C==1||O==1?1:((C=new A.h).add(b,_),C.scale(.5),(E=A.Dg.wm(E,C,g))==0?0:E==1?1:-1)},G.HB=function(E,_){return _?E:E.Ia()},G.prototype.nJ=function(){return this.yH==null&&(this.yH=this.Se.Ia()),this.yH},G.prototype.qe=function(){},G}();A.HC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 28},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O,F,N){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C,O,F,N).next()):new A.xL(_,g,b,C,O,F,N)},E.instance=null,E}(A.Je);A.IC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C,O,F){this.ya=-1,this.Rd=E,this.Mj=_,this.Ka=g,this.Ki=b,this.CA=C,this.uH=O,this.nd=F}return G.prototype.next=function(){var E=this.Rd.next();return E!=null?(this.ya=this.Rd.La(),this.jL(E)):null},G.prototype.La=function(){return this.ya},G.prototype.jL=function(E){var _=0>=this.uH?A.ta.kj(this.Mj,E,!1):this.uH;return A.IK.V(E,this.Ka,this.Ki,this.CA,_,this.nd)},G.prototype.qe=function(){},G}();A.xL=ue}(ye||(ye={})),function(A){var ue;(ue=A.NK||(A.NK={}))[ue.clipToDomainOnly=1]="clipToDomainOnly",ue[ue.clipWithHorizon=2]="clipWithHorizon",ue[ue.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var G=function(E){function _(){return E!==null&&E.apply(this,arguments)||this}return me(_,E),_.prototype.getType=function(){return 0},_.local=function(){return _.instance===null&&(_.instance=new _),_.instance},_.prototype.V=function(g,b,C){return g instanceof A.aa?(g=new A.Zc(g),this.V(g,b,C).next()):new A.yL(g,b,C)},_.prototype.transform=function(g,b,C,O){return A.bu.transform(g,b,C,O,!0)},_.prototype.Qt=function(g,b,C,O){return A.bu.Qt(g,b,C,O)},_.instance=null,_}(A.Je);A.Hx=G}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){this.ya=-1,this.Rd=E,this.MT=_,this.nd=g}return G.prototype.next=function(){var E=this.Rd.next();return E!=null?(this.ya=this.Rd.La(),A.bu.zh(E,this.MT,this.nd)):null},G.prototype.La=function(){return this.ya},G.prototype.qe=function(){},G}();A.yL=ue}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.prototype.reset=function(){this.ph=this.xk=-1,this.us=this.kq=!1},E.prototype.AQ=function(_,g,b){for(_.Vb(g,b);_.Ha();){var C=_.ha();if((C=C.Qb())!=0)return _.wb()}for(_.Vb(g,b);_.Ez();)if((C=(C=_.li()).Qb())!=0)return _.wb();return-1},E.prototype.BQ=function(_,g){for(_.Vb(g,-1);_.Ez();)if(_.li().Qb()!=0)return _.wb();return-1},E.prototype.zQ=function(_,g){for(_.Vb(g,-1),_.ha();_.Ha();)if(_.ha().Qb()!=0)return _.wb();return-1},E.prototype.yQ=function(_,g,b,C){if(this.xk=this.AQ(g,b,C),this.xk!=-1){g.Vb(this.xk,-1);var O=g.ha(),F=O.hc(O.fe(_,!1));if(b=A.h.yc(F,_),(C=new A.h).L(F),C.sub(O.ac()),(F=new A.h).L(_),F.sub(O.ac()),this.kq=0>C.wi(F),this.ph=this.zQ(g,this.xk),this.ph!=-1){g.Vb(this.ph,-1);var N=(O=g.ha()).fe(_,!1);N=O.hc(N);var j=A.h.yc(N,_);j>b?this.ph=-1:(C.L(N),C.sub(O.ac()),F.L(_),F.sub(O.ac()),this.us=0>C.wi(F))}this.ph==-1&&(this.ph=this.BQ(g,this.xk),this.ph!=-1&&(g.Vb(this.ph,-1),N=(O=g.ha()).fe(_,!1),N=O.hc(N),(j=A.h.yc(N,_))>b?this.ph=-1:(C.L(N),C.sub(O.ac()),F.L(_),F.sub(O.ac()),this.us=0>C.wi(F),_=this.xk,this.xk=this.ph,this.ph=_,_=this.kq,this.kq=this.us,this.us=_)))}},E.prototype.cO=function(_,g,b,C,O){return b=b.Ga(),this.yQ(_,b,C,O),this.xk!=-1&&this.ph==-1?this.kq:this.xk!=-1&&this.ph!=-1?this.kq==this.us?this.kq:(b.Vb(this.xk,-1),_=b.ha().kg(),b.Vb(this.ph,-1),g=b.ha().kg(),0<=_.wi(g)):g},E}(),G=function(E){function _(){return E!==null&&E.apply(this,arguments)||this}return me(_,E),_.local=function(){return _.instance===null&&(_.instance=new _),_.instance},_.prototype.getType=function(){return 3},_.prototype.nz=function(g,b,C){var O;if(O===void 0&&(O=!1),g.B())return new A.$l;b=b.D();var F=g,N=g.getType();switch(N==197&&((F=new A.Da).ad(g,!1),N=1736),N){case 33:return this.xI(F,b);case 550:return this.jI(F,b);case 1607:case 1736:return this.bU(F,b,C,O);default:throw A.i.fa("not implemented")}},_.prototype.oz=function(g,b){if(g.B())return new A.$l;b=b.D();var C=g,O=g.getType();switch(O==197&&((C=new A.Da).ad(g,!1),O=1736),O){case 33:return this.xI(C,b);case 550:case 1607:case 1736:return this.jI(C,b);default:throw A.i.fa("not implemented")}},_.prototype.pz=function(g,b,C,O){if(0>O)throw A.i.N();if(g.B())return[];b=b.D();var F=g,N=g.getType();switch(N==197&&((F=new A.Da).ad(g,!1),N=1736),N){case 33:return this.TU(F,b,C,O);case 550:case 1607:case 1736:return this.tU(F,b,C,O);default:throw A.i.fa("not implemented")}},_.prototype.bU=function(g,b,C,O){if(g.getType()==1736&&C&&(C=new A.l,g.A(C),C=A.ta.Wd(null,C,!1),(O?A.hd.Yd(g,b,0):A.hd.Yd(g,b,C))!=0)){var F=new A.$l(b,0,0);return O&&F.WJ(!0),F}var N=g.Ga();F=new A.h;for(var j=C=-1,W=17976931348623157e292,q=0;N.$a();)for(;N.Ha();){var J=N.ha();J=J.hc(J.fe(b,!1));var ee=A.h.yc(J,b);eeA.h.Uq(b,J.ac(),J.wc()),1=b||(g.length=O),g.slice(0)},_.instance=null,_}(A.Je);A.Ix=G}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 4},E.prototype.V=function(_,g,b,C,O){return A.am.yB(_,g,b,C,O)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.Iu=function(_){return A.Vt.wy(_)},E.prototype.wn=function(_,g,b){A.Vt.CD(_,g,b)},E.instance=null,E}(A.Je);A.zL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 33},E.prototype.V=function(_,g,b,C,O){return _===1073741824?!A.ud.zB(g,b,C,4,O):A.ud.zB(g,b,C,_,O)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.Iu=function(_){return A.Vt.wy(_)},E.prototype.wn=function(_,g,b){A.Vt.CD(_,g,b)},E.instance=null,E}(A.Je);A.dj=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b){if(this.nd=b,this.rT=g,this.ya=-1,E==null)throw A.i.N();this.yk=E,this.Mj=_}return G.prototype.next=function(){var E;if((E=this.yk.next())!=null){if(this.ya=this.yk.La(),this.nd!=null&&!this.nd.progress(-1,-1))throw A.i.fu("user_canceled");return this.eC(E)}return null},G.prototype.La=function(){return this.ya},G.prototype.eC=function(E){if(E==null)throw A.i.N();return A.Jx.cK(E,this.Mj,this.rT,this.nd)},G.prototype.qe=function(){},G}();A.AL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 26},E.prototype.V=function(_,g,b,C){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C).next()):new A.AL(_,g,b,C)},E.prototype.rs=function(_,g,b,C,O){return 0<(C!==void 0?A.Jx.rs(_,g,b,C,O):A.Jx.rs(_,g,!1,null,b))},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.instance=null,E}(A.Je);A.Yl=ue}(ye||(ye={})),function(A){var ue=function(){function O(){this.yq=0}return O.prototype.nX=function(F){this.yq&=-2,this.yq|=F?1:0},O.prototype.Wp=function(){return(1&this.yq)!=0},O.prototype.XF=function(){return this.Wp()?0:1},O}();A.xY=ue;var G=function(){},E=function(O,F,N,j){this.x=O,this.y=F,this.Ai=N,this.xm=j},_=function(){function O(F){this.Be=F}return O.prototype.compare=function(F,N,j){return F=F.ja(j),N=this.Be.lf.read(2*N),0>(N-=F=this.Be.lf.read(2*F))?-1:0J?1:0},O}(),b=function(){function O(F,N){this.YI=new A.h,this.parent=F,this.dS=N}return O.prototype.nr=function(F,N,j){var W=this.parent,q=this.dS;j.Vd(F,N,function(J,ee){return W.Mh(J,ee,q)})},O.prototype.$p=function(F){return F=this.parent.gi.get(F),this.parent.lf.tc(2*(F>>1),this.YI),this.YI.y+(1&F?this.parent.Oj:-this.parent.Oj)},O}(),C=function(){function O(F,N,j,W,q){this.nH=F.description,this.X=F,this.Qg=N,this.Oj=A.ta.kj(this.Qg,F,!1),this.Bo=A.ta.kj(this.Qg,F,!0),this.xA=j,this.oT=this.nH.Aa,this.hb=[],this.po=[],this.mh=new A.jp,this.fb=new A.Yj,this.ke=new A.Md,this.ZG=this.ql=q}return O.prototype.eT=function(){return this.ZG=!0,(!A.aa.Hc(this.X.getType())||this.GE()&&this.DE(!1))&&this.mO()?A.aa.Hc(this.X.getType())?this.pO()?this.X.getType()==1607?this.rO()?2:0:this.sO()?this.tO():0:0:2:0},O.prototype.kC=function(F,N){var j=this.lf.read(2*F);F=this.lf.read(2*F+1);var W=this.lf.read(2*N);N=this.lf.read(2*N+1);var q=!A.Yt.Cv(j,F,W,N,this.Oj*this.Oj);return q||this.X.Db()!=0&&j==W&&F==N},O.prototype.GE=function(){for(var F=this.X,N=F.xf?3:2,j=0,W=F.da();jthis.Oj)){if(F&&W){var J=q.wv(1,0);if(q=q.wv(1,0),Math.abs(q-J)>N)continue}return this.ke=new A.Md(2,j.wb(),-1),!1}}return!0},O.prototype.mO=function(){var F=this.X,N=null;A.aa.Hc(this.X.getType())&&(N=this.X);var j=(this.ZG||this.ql)&&N!=null,W=F.I();this.lf=F.ub(0),this.gi=new A.ia(0),this.gi.Jb(2*W),this.fi=new A.ia(0),this.fi.Jb(2*W),j&&(this.Fl==null&&(this.Fl=new A.ia(0)),this.Fl.Jb(W));for(var q=F=0;q=N.Vc(F);)F++;this.Fl.add(F)}for(new A.Xt().sort(this.fi,0,2*W,new b(this,j)),this.fb.clear(),this.fb.Vo(new _(this)),this.fb.De(W),N=0,W*=2;N>1,(1&F)==0){if(F=this.fb.addElement(j,-1),(q=this.fb.we(F))!=-1&&!this.kC(this.fb.ja(q),j))return this.ke=new A.Md(3,j,this.fb.ja(q)),!1;var J=this.fb.lb(F);if(J!=-1&&!this.kC(this.fb.ja(J),j))return this.ke=new A.Md(3,j,this.fb.ja(J)),!1}else if(F=this.fb.search(j,-1),q=this.fb.we(F),J=this.fb.lb(F),this.fb.vd(F,-1),q!=-1&&J!=-1&&!this.kC(this.fb.ja(q),this.fb.ja(J)))return this.ke=new A.Md(3,this.fb.ja(q),this.fb.ja(J)),!1;return!0},O.prototype.pO=function(){return 10>this.X.I()?this.nO():this.oO()},O.prototype.oO=function(){var F=new A.gd;F.Ib(this.X);var N=new A.Md;return!A.$t.kI(!1,F,this.Oj,N,this.nd)||(N.Jo=F.Ua(N.Jo),N.Ko=F.Ua(N.Ko),this.ke.Wt(N),!1)},O.prototype.nO=function(){var F=this.X,N=F.Ga();for(F=F.Ga();N.$a();)for(;N.Ha();){var j=N.ha();if(!N.Qn()||!N.$S()){F.BW(N);do for(;F.Ha();){var W=F.ha();if((W=j.zr(W,this.Oj,!0))!=0)return this.ke=new A.Md(W==2?5:4,N.wb(),F.wb()),!1}while(F.$a())}}return!0},O.prototype.sO=function(){var F=this.X;this.hb.length=0,this.po.length=0,this.Zf=F.Ga(),this.Zf.JB();var N=new A.ia(0);N.Jb(10);var j=NaN,W=0,q=0;for(F=2*F.I();q>=1;var ee=this.lf.read(2*J),he=this.lf.read(2*J+1);if(N.size!=0&&(ee!=j||he!=W)){if(!this.RI(N))return!1;N?.clear(!1)}N.add(J),j=ee,W=he}}return!!this.RI(N)},O.prototype.rO=function(){for(var F=this.X,N=Array(F.da()),j=0,W=F.da();j>1;this.lf.tc(2*J,q);var ee=N[j=this.Fl.get(J)],he=F.Ba(j),Ee=F.Vc(j)-1;W.el=J==he||J==Ee,W.ny=this.ql?!ee&&W.el:W.el,W.Ai=j,W.x=q.x,W.y=q.y,W.xm=J;for(var De=new G,pt=1,Et=this.fi.size;pt>1,this.lf.tc(2*J,q),(j=this.Fl.get(J))!=W.Ai&&(ee=N[j],he=F.Ba(j),Ee=F.Vc(j)-1);var Ye=J==he||J==Ee,jt=this.ql?!ee&&W.el:W.el;if(De.x=q.x,De.y=q.y,De.Ai=j,De.xm=J,De.ny=jt,De.el=Ye,De.x==W.x&&De.y==W.y){if(this.ql){if(!(De.ny&&W.ny||De.Ai==W.Ai&&(De.el||W.el)))return this.ke=new A.Md(8,De.xm,W.xm),!1}else if(!De.el||!W.el)return this.ke=new A.Md(5,De.xm,W.xm),!1}j=W,W=De,De=j}return!0},O.prototype.JE=function(){for(var F=this.X,N=[],j=-1,W=!1,q=0,J=F.da();q>1;this.lf.tc(2*ee,W),q=this.Fl.get(ee),j=new E(W.x,W.y,q,ee,N[q]),F=[];var he=1;for(J=this.fi.size;he>1,this.lf.tc(2*ee,W),q=this.Fl.get(ee),(q=new E(W.x,W.y,q,ee,N[q])).x==j.x&&q.y==j.y){if(q.Ai==j.Ai)return this.ke=new A.Md(9,q.xm,j.xm),!1;0<=N[q.Ai]&&N[q.Ai]==N[j.Ai]&&(F.length!=0&&F[F.length-1]==j||F.push(j),F.push(q))}j=q}if(F.length==0)return!0;for(q=new A.jp(!0),A.O.$u(N,-1),W=-1,(he=new A.h).Rc(),j=0,J=F.length;j=F.Ke())return this.ke=new A.Md(6,F.da()==1?1:-1,-1),0;if(F.da()==1)return this.ql&&!this.JE()?0:2;this.to=A.ia.qf(F.da(),0),this.JA=A.ia.qf(F.da(),-1);for(var N=-1,j=0,W=0,q=F.da();WJ?0:256),0N||j>=1,(W=this.lf.read(2*j+1))!=this.Mo&&F.size!=0){if(!this.ut(F))return 0;F?.clear(!1)}F.add(j),this.Mo=W}return 0q.la){var ee=this.Zf.wb(),he=this.Su(q,W,this.Zf.gb,!0);0F.Ja(N.gb))){j.EW();for(var De,pt,Et=!0;N.Ha();){var Ye=N.ha(),jt=j.li();if(N.wb()>j.wb())break;Et&&(he.add(N.wb()),Ee.add(j.ik()),Et=!1),pt=he.Fc();var ei=N.ik();if(1this.Bo?he.add(N.ik()):J&&(De=F.Uc(1,he.Fc(),0),Ye=Ye.gv(1,0),Math.abs(Ye-De)>ee&&he.add(N.ik())),pt>this.Bo?Ee.add(j.wb()):J&&(De=F.Uc(1,Ee.Fc(),0),Ye=jt.gv(1,0),Math.abs(Ye-De)>ee&&Ee.add(j.wb()))}if(he.Fc()Ee.size?he.If():Ee.If():(he.Fc()!=Ee.Fc()&&Ee.If(),Ee.If()),2<=Ee.size+he.size){for(Et=new A.Sa,jt=0,Ye=he.size;jt>1;var q=W>>1,J=new A.h,ee=new A.h;return this.lf.tc(2*N,J),J.y+=1&F?this.Oj:-this.Oj,this.lf.tc(2*q,ee),ee.y+=1&W?this.Oj:-this.Oj,(F=J.compare(ee))==0&&j?0>(j=this.Fl.get(N)-this.Fl.get(q))?-1:0q.x)return 1;if(W.yq.y)return 1;for(W=1;WEe)return 1}}return 0},O.prototype.PO=function(F,N){var j=this.Ou(F,N);return j==0?FN?1:0F?_:g;if(_.B())return g;if(g.B())return _;var N=new A.l,j=new A.l,W=new A.l;return _.A(N),g.A(j),W.K(N),W.Zb(j),N=A.ta.Wd(b,W,!0),j=_.getType(),W=g.getType(),j==33&&W==33?E.aV(_,g,N):j!=W?0F?_:g:j==550?E.iI(_,g,N):E.iI(g,_,N):A.Fg.ep(_,g,b,C)},E.aV=function(_,g,b){b=b*Math.sqrt(2)*1.00001,b*=b;var C=_.D(),O=g.D(),F=new A.de(_.description);return A.h.yc(C,O)>b&&(F.add(_),F.add(g)),F},E.iI=function(_,g,b){var C=_.ub(0),O=_.I(),F=g.D(),N=_.Ia();b=b*Math.sqrt(2)*1.00001;var j=new A.l;if(_.A(j),j.W(b,b),j.contains(F)){b*=b,j=!1;for(var W=[],q=0;qthis.zk||0>this.bo)throw A.i.Qa();if(this.AH[this.bo])break}return this.ya++,this.fG(this.bo)}return this.ya=0,this.bo=this.zk,this.fG(this.zk)},_.prototype.La=function(){return this.ya},_.prototype.qK=function(){if(this.Ic)return!0;var g=null;if(this.Rd!=null&&(g=this.Rd.next())==null&&(this.Ic=!0,this.Rd=null),A.mp.zp(this.Ub),g!=null){var b=g.Db();this.AH[b]=!0,b>=this.zk&&!this.jA&&(this.ND(b,!1,g),b>this.zk&&!this.jA&&this.zW(b))}if(0this.Do.length)for(var F=0,N=Math.max(2,g+1);Fb?A.F.Wq(q,W,j,J,0):A.F.Wq(q,j,W,J,0),he=[0,0,0],Ee=[0,0,0];var Et=[0,0,0];j=[0,0,0],ee=[0,0,0];var Ye=Math.acos(J[2]/1),jt=1-E,ei=Math.tan(Ye),Xt=1+ei*ei/jt,wi=2*q[2]*ei/jt;for(jt=(-wi+(ei=Math.sqrt(wi*wi-4*Xt*(q[2]*q[2]/jt-1))))/(Xt*=2),wi=(-wi-ei)/Xt,ei=Math.tan(Ye),Ye=(jt+wi)/2,q=((Xt=ei*jt+q[2])+(ei*wi+q[2]))/2,ei=A.F.gp(jt-Ye,Xt-q),jt=q/pt*1.570796326794897,wi=0;100>wi&&(Xt=(Xt=A.F.w(E,jt))*Xt/Math.cos(jt)*(Math.sin(jt)-q*Xt/(1-E)),!A.s.Cd(Xt));wi++)jt-=Xt;q=A.F.n(1,E,jt)*Math.cos(jt),ei=1-ei/(q=Math.sqrt((q-Ye)*(q+Ye))),ei*=2-ei,Xt=A.F.on(he),Ye=A.F.on(Ee),jt=A.F.on(Et);var pi=A.F.St(Et,he);wi=A.F.St(Et,Ee),A.F.zx(Et,he,j),A.F.zx(Et,Ee,ee),he=Math.acos(pi/(jt*Xt)),Ee=Math.acos(wi/(jt*Ye)),Ee*=A.s.Mb(1,A.F.St(j,ee)),(1.570796326794897<=A.s.P(he)&&1.570796326794897<=A.s.P(Ee)||3.141592653589793ee&&0>b)&&(b=A.F.ba(b+3.141592653589793)),O!=null&&(O.u=j),F!=null&&(F.u=ee),N!=null&&(N.u=b)}}},ue.rf=function(G,E,_,g,b,C,O,F){var N=[0,0,0],j=[0,0,0],W=[0,0,0],q=[0,0,0],J=[0,0,0],ee=[0,0,0],he=[0,0,0],Ee=[0,0,0,0],De=new A.ga(0),pt=new A.ga(0),Et=new A.ga(0),Ye=new A.ga(0),jt=new A.ga(0),ei=new A.ga(0);if(O!=null&&F!=null)if(A.s.ti(E))A.Yg.rf(G,_,g,b,C,O,F);else if(A.s.Cd(b))O!=null&&(O.u=_),F!=null&&(F.u=g);else if(C=A.F.ba(C),0>b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),_=A.F.ba(_),g=A.F.ba(g),1.570796326794897C?A.F.Wq(he,J,N,Ee,0):A.F.Wq(he,N,J,Ee,0),N=Math.acos(Ee[2]/1),Ee=Math.atan2(-Ee[1],-Ee[0]),g=1-E,jt=1+(J=Math.tan(N))*J/g,g=(-(Ye=2*he[2]*J/g)+(J=Math.sqrt(Ye*Ye-4*jt*(he[2]*he[2]/g-1))))/(jt*=2),Ye=(-Ye-J)/jt,J=Math.tan(N),N=(g+Ye)/2,he=((jt=J*g+he[2])+(J*Ye+he[2]))/2,J=A.F.gp(g-N,jt-he),Xt=he/Xt*1.570796326794897,g=0;100>g&&(Ye=(Ye=A.F.w(E,Xt))*Ye/Math.cos(Xt)*(Math.sin(Xt)-he*Ye/(1-E)),!A.s.Cd(Ye));g++)Xt-=Ye;Xt=A.F.n(1,E,Xt)*Math.cos(Xt),he=1-J/(Xt=Math.sqrt((Xt-N)*(Xt+N))),he*=2-he,ee=Math.acos(A.F.St(ee,j)/(A.F.on(ee)*A.F.on(j))),ee*=A.s.Mb(1,j[0]),C=(A.F.q(Xt,he,A.F.Qj(he,ee))+G*A.s.Mb(1,C))/A.F.Ah(Xt,he),C=A.F.ba(1.570796326794897*C),C=A.F.Rq(he,C),A.F.n(Xt,he,C),J=A.F.ba(Ee+_),_=Math.cos(J),C=Math.sin(J),W[0]=q[0]*_+q[1]*-C,W[1]=q[0]*C+q[1]*_,W[2]=q[2],A.F.jO(E,W[0],W[1],W[2],Et,pt,De),O!=null&&(O.u=pt.u),F!=null&&(F.u=Et.u)}},ue}()}(ye||(ye={})),function(A){var ue=function(){function b(C){this.Ya=null,this.wt=new A.h,this.xt=new A.h,this.g=C}return b.prototype.compare=function(C,O,F){return this.g.Gc(O,this.wt),this.g.Gc(C.ja(F),this.xt),this.wt.compare(this.xt)},b}(),G=function(){function b(C){this.Bf=new A.h,this.Dk=new A.h,this.g=C}return b.prototype.Dh=function(C){this.Bf.L(C)},b.prototype.compare=function(C,O){return this.g.Gc(C.ja(O),this.Dk),this.Bf.compare(this.Dk)},b}(),E=function(b){function C(O){var F=b.call(this,O.g,O.qa,!1)||this;return F.ib=O,F}return me(C,b),C.prototype.compare=function(O,F,N){if(this.rg)return-1;var j=this.ib.Qd.Jn(this.ib.Rh(F));O=O.ja(N);var W=this.ib.Qd.Jn(this.ib.Rh(O));return this.Dm=N,this.RE(F,j,O,W)},C}(A.UC),_=function(b){function C(O){var F=b.call(this,O.g,O.qa)||this;return F.ib=O,F}return me(C,b),C.prototype.compare=function(O,F){return this.rg?-1:(O=this.ib.Qd.Jn(this.ib.Rh(O.ja(F))),this.Dm=F,this.SE(F,O))},C}(A.aM),g=function(){function b(){this.Mc=this.df=this.jo=this.Qd=this.lh=this.zd=this.hb=this.g=null,this.Ng=!1,this.vh=this.Nm=this.ie=this.Gk=this.nh=this.Ak=this.Ff=this.$d=null,this.xh=this.Jq=this.UA=this.qa=0,this.Xv=this.Wn=!1,this.yo=new A.h,this.Pi=new A.h,this.hb=new A.$c(8),this.zd=new A.$c(5),this.lh=new A.au,this.Qd=new A.au,this.Ng=!1,this.vh=new A.h,this.vh.ma(0,0),this.qa=0,this.xh=-1,this.Wn=!1,this.g=null,this.df=new A.Yj,this.Mc=new A.Yj,this.nh=new A.ia(0),this.Gk=new A.TC,this.Ff=new A.ia(0),this.Ak=new A.ia(0),this.jo=new A.Sa}return b.prototype.PX=function(C,O){var F=new A.Dd;return F.$B(),C.Oc(F),this.er(C),this.Wn=!1,this.qa=O,this.UA=O*O,O=this.jC(),C.Oc(F),O||(this.qQ(),O||this.jC()),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null,this.Wn},b.prototype.TX=function(C,O){this.er(C),this.Wn=!1,this.qa=O,this.UA=O*O,this.Ng=!1,this.jC(),this.Ng||(this.Ng=C.Gp(O,!0,!1)==1),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null},b.prototype.pg=function(C,O){return this.hb.T(C,0+O)},b.prototype.LB=function(C,O,F){this.hb.S(C,0+O,F)},b.prototype.Rh=function(C){return this.hb.T(C,2)},b.prototype.ZW=function(C,O){this.hb.S(C,2,O)},b.prototype.RF=function(C,O){return this.hb.T(C,3+O)},b.prototype.Pp=function(C){return this.hb.T(C,7)},b.prototype.Pl=function(C,O){this.hb.S(C,7,O)},b.prototype.Rp=function(C,O){return this.hb.T(C,3+this.Op(C,O))},b.prototype.fr=function(C,O,F){this.hb.S(C,3+this.Op(C,O),F)},b.prototype.NR=function(C,O){return this.hb.T(C,5+this.Op(C,O))},b.prototype.hr=function(C,O,F){this.hb.S(C,5+this.Op(C,O),F)},b.prototype.Sr=function(C){return this.zd.T(C,0)},b.prototype.UW=function(C,O){this.zd.S(C,0,O)},b.prototype.ez=function(C){return this.zd.T(C,4)},b.prototype.cr=function(C,O){this.zd.S(C,4,O)},b.prototype.il=function(C){return this.zd.T(C,1)},b.prototype.ln=function(C,O){this.zd.S(C,1,O)},b.prototype.dz=function(C){return this.zd.T(C,3)},b.prototype.Et=function(C,O){this.zd.S(C,3,O)},b.prototype.Ym=function(C){var O=this.zd.Ce(),F=this.lh.Ph();return this.UW(O,F),C!=-1?(this.lh.addElement(F,C),this.g.Ra(C,this.xh,O),this.cr(O,this.g.Ua(C))):this.cr(O,-1),O},b.prototype.HP=function(C){this.zd.jd(C)},b.prototype.LD=function(C,O){this.lh.addElement(this.Sr(C),O),this.g.Ra(O,this.xh,C)},b.prototype.nt=function(C){var O=this.hb.Ce(),F=this.Qd.Ph();return this.ZW(O,F),C!=-1&&this.Qd.addElement(F,C),O},b.prototype.MD=function(C,O){this.Qd.addElement(this.Rh(C),O)},b.prototype.Uu=function(C){this.hb.jd(C),0<=(C=this.nh.lF(C))&&this.nh.SV(C)},b.prototype.hj=function(C,O){if(this.pg(C,0)==-1)this.LB(C,0,O);else{if(this.pg(C,1)!=-1)throw A.i.Qa();this.LB(C,1,O)}this.ky(C,O)},b.prototype.ky=function(C,O){var F=this.il(O);if(F!=-1){var N=this.Rp(F,O);this.hr(N,O,C),this.fr(C,O,N),this.fr(F,O,C),this.hr(C,O,F)}else this.hr(C,O,C),this.fr(C,O,C),this.ln(O,C)},b.prototype.Op=function(C,O){return this.pg(C,0)==O?0:1},b.prototype.Xm=function(C,O){var F,N=this.dz(O);if(N!=-1&&(this.df.vd(N,-1),this.Et(O,-1)),(N=this.il(O))!=-1){var j=F=N;do{var W=!1,q=this.Op(F,O),J=this.RF(F,q);if(this.pg(F,q+1&1)==C){if(this.Xu(F),this.Qd.bh(this.Rh(F)),this.Uu(F),F==J){N=-1;break}N==F&&(N=this.il(O),j=J,W=!0)}F=J}while(F!=j||W);if(N!=-1){do q=this.Op(F,O),J=this.RF(F,q),this.LB(F,q,C),F=J;while(F!=j);(F=this.il(C))!=-1?(j=this.Rp(F,C),W=this.Rp(N,C),j==F?(this.ln(C,N),this.ky(F,C),this.ln(C,F)):W==N&&this.ky(N,C),this.fr(N,C,j),this.hr(j,C,N),this.fr(F,C,W),this.hr(W,C,F)):this.ln(C,N)}}for(N=this.Sr(C),F=this.Sr(O),j=this.lh.rc(F);j!=-1;j=this.lh.lb(j))this.g.Ra(this.lh.ja(j),this.xh,C);this.lh.Hy(N,F),this.HP(O)},b.prototype.UT=function(C,O){var F=this.pg(C,0),N=this.pg(C,1),j=this.pg(O,0),W=this.pg(O,1);this.Qd.Hy(this.Rh(C),this.Rh(O)),O==this.il(F)&&this.ln(F,C),O==this.il(N)&&this.ln(N,C),this.Xu(O),this.Uu(O),F==j&&N==W||N==j&&F==W||(this.Hn(F,this.yo),this.Hn(j,this.Pi),this.yo.qb(this.Pi)?(F!=j&&this.Xm(F,j),N!=W&&this.Xm(N,W)):(N!=j&&this.Xm(N,j),F!=W&&this.Xm(F,W)))},b.prototype.Xu=function(C){var O=this.pg(C,1);this.dF(C,this.pg(C,0)),this.dF(C,O)},b.prototype.dF=function(C,O){var F=this.Rp(C,O),N=this.NR(C,O),j=this.il(O);F!=C?(this.fr(N,O,F),this.hr(F,O,N),j==C&&this.ln(O,F)):this.ln(O,-1)},b.prototype.WD=function(C,O,F){var N=this.Qd.rc(C),j=this.Qd.ja(N);C=this.Le(j);var W=this.Le(this.g.U(j));for(this.g.jr(j,O,F,!0),N=this.Qd.lb(N);N!=-1;N=this.Qd.lb(N)){j=this.Qd.ja(N);var q=this.Le(j)==C;this.g.jr(j,O,F,q)}N=O.Vp(F,0).ac(),O=O.Vp(F,O.ol(F)-1).wc(),this.BK(C,N),this.BK(W,O)},b.prototype.ZE=function(C,O,F){var N=this.Rh(C),j=this.pg(C,0),W=this.pg(C,1),q=this.nt(-1);for(this.nh.add(q),this.Pl(q,-3),this.Ff.add(q),this.hj(q,j),C=1,O=O.ol(F);Cthis.ez(q)&&this.cr(q,this.g.Ua(W))),q=this.Ff.get(C),C-=2,this.MD(q,W),W=this.g.U(W);while(0<=C)}this.Ff.clear(!1)},b.prototype.Le=function(C){return this.g.Pa(C,this.xh)},b.prototype.TI=function(C,O,F){var N=this.pg(O,0),j=new A.h;this.Hn(N,j);var W=new A.h,q=this.pg(O,1);this.Hn(q,W);var J=F.ol(C),ee=F.Vp(C,0),he=new A.h;if(ee.Yp(he),!j.qb(he)){if(!this.Ng){var Ee=j.compare(this.vh);0>Ee*(he=he.compare(this.vh))&&(this.Ng=!0)}this.vF(N,this.Ff),this.Ak.add(N)}for(!this.Ng&&1ee.compare(this.vh))&&(this.Ng=!0)),C=(ee=F.Vp(C,J-1)).wc(),W.qb(C)||(this.Ng||0>(Ee=W.compare(this.vh))*(he=C.compare(this.vh))&&(this.Ng=!0),this.vF(q,this.Ff),this.Ak.add(q)),this.Ff.add(O),W=0,q=this.Ff.size;WMath.max(100,this.g.fd)){this.nh.clear(!1),this.Ng=!0;break}var C=this.nh.Fc();this.nh.If(),this.Pl(C,-1),this.WS(C)!=-1&&this.wS(C),this.Vn=!1}},b.prototype.wS=function(C){if(this.Vn){var O=this.Mc.zu(this.MH,this.GH,C,!0);this.Vn=!1}else O=this.Mc.KD(C);O==-1?this.UT(this.Mc.ja(this.Mc.FF()),C):(this.Pl(C,O),this.$d.rg&&(this.$d.Kr(),this.oF(this.$d.Dm,O)))},b.prototype.WS=function(C){var O=this.pg(C,0);if(C=this.pg(C,1),this.Hn(O,this.yo),this.Hn(C,this.Pi),A.h.yc(this.yo,this.Pi)<=this.UA)return this.Ng=!0,-1;var F=this.yo.compare(this.vh),N=this.Pi.compare(this.vh);return 0>=F&&0=N&&0C&&(this.re(_),C=this.description.Pf(_)),this.ka==null&&this.un(),this.ka[this.description.$j(C)+g]=b},E.prototype.getType=function(){return 33},E.prototype.Db=function(){return 0},E.prototype.Oa=function(){this.vc(),this.ka!=null&&(this.ka[0]=NaN,this.ka[1]=NaN)},E.prototype.sn=function(_){if(this.ka!=null){for(var g=A.ee.Iw(_,this.description),b=[],C=0,O=0,F=_.Aa;O>>32),_=A.O.Th(C,_)}return _},E.prototype.mg=function(){return null},E}(A.aa);A.Sa=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){E!==void 0&&(this.x=E,this.y=_,this.z=g)}return G.construct=function(E,_,g){var b=new G;return b.x=E,b.y=_,b.z=g,b},G.prototype.K=function(E,_,g){this.x=E,this.y=_,this.z=g},G.prototype.lx=function(){this.z=this.y=this.x=0},G.prototype.normalize=function(){var E=this.length();E==0&&(this.x/=E,this.y/=E,this.z/=E)},G.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},G.prototype.sub=function(E){return new G(this.x-E.x,this.y-E.y,this.z-E.z)},G.prototype.Ag=function(E){new G(this.x*E,this.y*E,this.z*E)},G.prototype.Qh=function(E){return this.x*E.x+this.y*E.y+this.z*E.z},G}();A.Nd=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){this.Gw=this.DA=null,this.Xf=_,this.FT=_.y-g,this.ET=_.y+g,this.Ew=0,this.dA=E,this.qa=g,this.RT=g*g,this.eA=g!=0,this.Lv=!1}return G.prototype.result=function(){return this.Ew!=0?1:0},G.prototype.ZM=function(E){return E=E.hc(E.fe(this.Xf,!1)),A.h.yc(E,this.Xf)<=this.RT},G.prototype.fF=function(E){if(!this.eA&&(this.dA&&this.Xf.qb(E.ac())||this.Xf.qb(E.wc())))this.Lv=!0;else if(E.na==this.Xf.y&&E.na==E.la){if(this.dA&&!this.eA){var _=Math.max(E.sa,E.pa);this.Xf.x>Math.min(E.sa,E.pa)&&this.Xf.x<_&&(this.Lv=!0)}}else{var g=!1;if(_=Math.max(E.sa,E.pa),this.Xf.x>_?g=!0:this.Xf.x>=Math.min(E.sa,E.pa)&&(g=0E.wc().y?1:-1)}}},G.prototype.SI=function(E){var _=E.Tg(0,1);if(_.oa>this.ET||_.vathis.Xf.y||_.va(E=E.I()))&&2*E+Math.log(E)/Math.log(2)*_<1*E*_},G}();A.Dg=ue}(ye||(ye={})),function(A){var ue=function(G){function E(_){return G.call(this,!0,_)||this}return me(E,G),E.prototype.Ia=function(){return new E(this.description)},E.prototype.Db=function(){return 2},E.prototype.getType=function(){return 1736},E.prototype.xG=function(_,g,b){this.JS(_,g,b)},E.prototype.qR=function(){this.FR()},E}(A.Vk);A.Da=ue}(ye||(ye={})),function(A){(function(ue){ue[ue.PiPOutside=0]="PiPOutside",ue[ue.PiPInside=1]="PiPInside",ue[ue.PiPBoundary=2]="PiPBoundary"})(A.RL||(A.RL={})),A.hd=function(){function ue(){}return ue.KG=function(G,E,_){return(G=A.Dg.bT(G,E,_))==0?0:G==1?1:2},ue.Yd=function(G,E,_){return(G=A.Dg.wm(G,E,_))==0?0:G==1?1:2},ue.WX=function(G,E,_,g,b){if(E.length<_||b.length<_)throw A.i.N();for(var C=0;C<_;C++)b[C]=ue.Yd(G,E[C],g)},ue.sK=function(G,E,_,g,b){if(G.getType()==1736)ue.WX(G,E,_,g,b);else{if(G.getType()!=197)throw A.i.fa("invalid_call");var C=new A.l;G.A(C),ue.$M(C,E,_,g,b)}},ue.$M=function(G,E,_,g,b){if(E.length<_||b.length<_)throw A.i.N();if(G.B())for(g=0;g<_;g++)b[g]=0;else for(G.W(.5*-g,.5*-g),G.W(.5*g,.5*g),g=0;g<_;g++)G.contains(E[g])?b[g]=1:G.contains(E[g])?b[g]=2:b[g]=0},ue.YX=function(G,E,_,g,b){for(var C=0;C<_;C++)b[C]=G.qs(E[C],g)?2:0},ue.XX=function(G,E,_,g,b){var C=G.Bb,O=null;C!=null&&(O=C.Fk),C=_;for(var F=0;F<_;F++)if(b[F]=1,O!=null){var N=E[F];O.So(N.x,N.y)==0&&(b[F]=0,C--)}if(C!=0)for(G=G.Ga();G.$a()&&C!=0;)for(;G.Ha()&&C!=0;)for(O=G.ha(),F=0;F<_&&C!=0;F++)b[F]==1&&O.qs(E[F],g)&&(b[F]=2,C--);for(F=0;F<_;F++)b[F]==1&&(b[F]=0)},ue.tK=function(G,E,_,g,b){var C=G.getType();if(C==1607)ue.XX(G,E,_,g,b);else{if(!A.aa.yd(C))throw A.i.fa("Invalid call.");ue.YX(G,E,_,g,b)}},ue}()}(ye||(ye={})),function(A){var ue=function(G){function E(_,g){if(arguments.length==2){var b=G.call(this,!1,_.description)||this;b.nf(_),b.lineTo(g)}else b=G.call(this,!1,_)||this;return b}return me(E,G),E.prototype.Ia=function(){return new E(this.description)},E.prototype.Db=function(){return 1},E.prototype.getType=function(){return 1607},E.prototype.xG=function(_,g,b){this.KS(_,g,b)},E}(A.Vk);A.Ta=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.prototype.progress=function(){return!0},G.zp=function(E){if(E!=null&&!E.progress(-1,-1))throw A.i.WC()},G}();A.mp=ue}(ye||(ye={})),function(A){var ue;(ue=A.PK||(A.PK={}))[ue.clipWithInputHorizon=1]="clipWithInputHorizon",ue[ue.clipWithOutputHorizon=2]="clipWithOutputHorizon";var G=function(){function g(){this.Kg=3,this.Vu=this.Jr=NaN}return g.prototype.PW=function(b){this.QB(1,b)},g.prototype.QW=function(b){this.QB(2,b)},g.prototype.hS=function(){return this.hs(1)},g.prototype.iS=function(){return this.hs(2)},g.prototype.QB=function(b,C){this.Kg=C?this.Kg|b:this.Kg&~b},g.prototype.hs=function(b){return(this.Kg&b)!=0},g.prototype.Of=function(){var b=new g;return b.Jr=this.Jr,b.Vu=this.Vu,b.Kg=this.Kg,b},g}();A.yC=G,function(g){g[g.Dont_Geonomalize_Polygon=2147483648]="Dont_Geonomalize_Polygon",g[g.Dont_Adjust_At_Poles=1073741824]="Dont_Adjust_At_Poles"}(A.QK||(A.QK={}));var E=function(){function g(){this.Kg=0}return g.prototype.QB=function(b,C){this.Kg=C?this.Kg|b:this.Kg&~b},g.prototype.hs=function(b){return(this.Kg&b)!=0},g.jg=function(b){var C=new g;return C.Kg=b.Kg,C},g.prototype.mM=function(b){this.Kg=b.Kg},g}();A.AY=E;var _=function(){function g(b,C,O){this.ef=b,this.Yf=C,this.Uf=new A.l,this.Uf.K(O),this.AT=b.cc()+C.cc()+this.Uf.cc().toString()}return g.prototype.cc=function(){return this.AT},g.prototype.Nb=function(b){return this==b||this.ef.Nb(b.ef)&&this.Yf.Nb(b.Yf)&&this.Uf.Nb(b.Uf)},g}();A.FY=_,_=function(){function g(){this.Yf=this.ef=null,this.rH=new G,this.sH=new E,this.ww=this.Wf=null,this.mw=this.Tn=!0}return g.Nr=function(b,C,O,F){var N;F===void 0&&(F=null),N===void 0&&(N=null);var j=new g;return j.qp(b,C,O,F,N),j},g.prototype.qp=function(b,C,O,F,N){if(b==null||C==null)throw A.i.fa("invalidArgument");if(this.ef=b,this.Yf=C,this.mw=this.Tn=!1,F!=null&&(this.rH=F.Of()),N!=null&&this.sH.mM(N),N=!1,C.Sb()==1&&F!=null&&(F=F.Jr,isNaN(F)||F==0||(N=!0)),b==C)this.Tn=!N,this.mw=!0;else{F=b.Sb();var j=C.Sb();if(F==0||j==0){if(O!=null)throw A.i.N();b.Hd()!=null&&C.Hd()!=null&&(this.Tn=b.Hd().Nb(C.Hd()))}else F==3||j==3?this.Tn=b.Nb(C):this.ef.kS(this.Yf)?this.Tn=!N:this.Tn=!1,this.Wf=O,this.Wf!=null&&this.Wf.ix(),this.mw=(this.Wf==null||this.Wf.count()==0)&&this.ef.sc().Nb(this.Yf.sc())}this.oY()},g.prototype.isIdentity=function(){return this.Tn},g.prototype.nR=function(){return this.rH.Of()},g.prototype.Nb=function(b){return b==this||!!(b instanceof g&&this.ef.Nb(b.ef)&&this.Yf.Nb(b.Yf))&&(this.Wf==b.Wf||!(this.Wf==null||b.Wf==null||!this.Wf.Nb(b.Wf)))},g.prototype.oY=function(){this.ww=new A.bu(this)},g}(),A.vr=_}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.Cp=function(E){return E*G.oW},G.mx=function(E,_){return G.gP(_-E)},G.hP=function(E){return-360<=E&&720>E?(0>E?E+=360:360<=E&&(E-=360),E):(0>(E=A.lc.RK(E))&&(E+=360),E)},G.gP=function(E){return 180<(E=G.hP(E))&&(E-=360),E},G.oW=57.29577951308232,G}();A.qr=ue,A.Hh=function(){function G(){}return G.lj=function(E,_){var g=new A.l;E.A(g);var b=A.cb.gh(_),C=new A.l;return C.K(b),C.v=g.v,C.C=g.C,C.W(.01*C.ca(),0),_=A.ta.Wd(_,g,!1),C.contains(g)?E:A.Ud.clip(E,C,_,0)},G.ks=function(E,_,g,b,C){if(!A.cb.Wc(_))throw A.i.N();var O=A.ta.kj(_,E,!1),F=A.cb.gh(_),N=A.cb.sc(_),j=N.Hd().ai,W=A.cb.vv(N);N=A.cb.ev(N),W*=2-W;var q=new A.Nc;F.cn(q);var J=[[0,0],[0,0]];if(A.Eg.Sb(_)==2?b?(J[0][0]=G.Zm(C,q),J[0][1]=F.Jp(),A.cb.vt(),F=J[0][0]*j):(J[0][0]=F.gk(),J[0][1]=C,A.cb.vt(),F=J[0][1]*j):F=C*j,!b&&F!=0)throw A.i.N();var ee=new A.ga,he=new A.gd;E=he.Ib(E);for(var Ee=[0],De=new A.h,pt=new A.h,Et=new A.h,Ye=new A.h,jt=new A.h,ei=new A.h,Xt=he.Ob(E);Xt!=-1;Xt=he.Rb(Xt)){var wi=he.Xa(Xt);he.D(wi,Et);for(var pi=!1,Ri=wi=he.U(wi);Ri!=-1;Ri=he.U(Ri)){if(Ri==wi){if(pi)break;pi=!0}if(he.D(Ri,Ye),b&&OO||OO||!b&&O<-Et.y&&Ye.y>O||O<-Ye.y&&Et.y>O)do if(!(Math.abs(Et.x-Ye.x)>=.5*q.R())){if(A.Eg.Sb(_)==2?(J[0][0]=G.Zm(Et.x,q),J[0][1]=Et.y,J[1][0]=G.Zm(Ye.x,q),J[1][1]=Ye.y,A.cb.dW(),jt.x=J[0][0]*j,jt.y=J[0][1]*j,ei.x=J[1][0]*j,ei.y=J[1][1]*j):(jt.x=Et.x*j,jt.y=Et.y*j,ei.x=Ye.x*j,ei.y=Ye.y*j),ei.x=6.283185307179586*(Ye.x-Et.x)/q.R()+jt.x,b){if(pt.x=F,pt.y=G.Nz(N,W,jt,ei,F,g),isNaN(pt.y))break}else{if(pt.x=G.Lz(N,W,jt,ei,g),isNaN(pt.x))break;pt.y=0}A.kb.wd(N,W,jt.x,jt.y,ei.x,ei.y,ee,null,null,g);var Ui=ee.u;A.kb.wd(N,W,jt.x,jt.y,pt.x,pt.y,ee,null,null,g);var Bi=ee.u;A.Eg.Sb(_)==2?(J[0][0]=pt.x/j,J[0][1]=pt.y/j,A.cb.bR(),b?(De.y=J[0][1],De.x=C):(De.x=G.os(J[0][0],Et.x,Ye.x,q),De.y=C)):b?(De.x=C,De.y=pt.y/j):(De.x=G.os(pt.x/j,Et.x,Ye.x,q),De.y=C),Ee[0]=0b.x)var F=b;else F=g,g=b;b=new A.ga(0);var N=new A.ga(0),j=new A.ga(0);A.kb.wd(E,_,F.x,F.y,g.x,g.y,N,b,null,O);var W=N.u,q=0,J=1,ee=new A.h;for(ee.L(F);W*(J-q)>1e-12*E;){var he=.5*(q+J);if(A.kb.oj(E,_,F.x,F.y,W*he,b.u,N,j,O),ee.x=N.u,ee.y=j.u,ee.x==C)break;if(G.Sn(F.x,ee.x,C))J=he;else{if(!G.Sn(g.x,ee.x,C))return NaN;q=he}}return ee.y},G.Sn=function(E,_,g){return E=ue.Cp(E),_=ue.mx(E,ue.Cp(_)),(g=ue.mx(E,ue.Cp(g)))==0||0<_&&0_&&0>g&&g>=_},G.Zm=function(E,_){var g=_.va-_.oa;return _.It(E-Math.floor((E-_.oa)/g)*g)},G.os=function(E,_,g,b){var C=new A.Nc;for(C.K(_,g),g=b.R(),E=Math.floor((E-_)/g)*g+E,C=C.sf();Math.abs(E-C)>Math.abs(E+g-C);)E+=g;return E},G.Lz=function(E,_,g,b,C){if(g.y>b.y)var O=b;else O=g,g=b;if((b=new A.Nc).K(O.y,g.y),!b.contains(0)||3.141592653589793<=Math.abs(O.x-g.x))return NaN;if(O.x==g.x)return O.x;var F=new A.ga(0),N=new A.ga(0),j=new A.ga(0);A.kb.wd(E,_,O.x,O.y,g.x,g.y,N,F,null,C);var W=N.u,q=0,J=1,ee=new A.h;for(ee.L(O);W*(J-q)>1e-12*E;){var he=.5*(q+J);if(A.kb.oj(E,_,O.x,O.y,W*he,F.u,N,j,C),ee.x=N.u,ee.y=j.u,b.K(O.y,ee.y),ee.y==0)break;if(b.contains(0))J=he;else{if(b.K(g.y,ee.y),!b.contains(0))return NaN;q=he}}return ee.x},G.Hp=function(E,_,g,b,C,O,F){var N=new A.l;if(E.A(N),N.B())return E;var j=new A.Nc;N.cn(j);var W=new A.Nc;if(W.K(_,_+g),W.contains(j)&&W.va!=j.va)return E;var q=new A.l;q.K(N);var J=E.getType();if(J==33)return((N=(q=C?E:E.Of()).Lg())=W.va||F&&N==W.va)&&(N+=Math.ceil((W.oa-N)/g)*g,N=W.It(N),q.cC(N)),q;if(J==550){for(b=(q=C?E:E.Of()).ub(0),J=2*q.I(),E=!1,C=0;C=W.va||F&&N==W.va)&&(E=!0,N+=Math.ceil((W.oa-N)/g)*g,N=W.It(N),b.write(C,N));return E&&q.Pc(1993),q}if(W.contains(j))return E;if(J==197)return g=C?E:E.Of(),N.Ea(q),g.Xo(N),g;var ee=.1*Math.max(N.ca(),N.R());for(q.W(0,ee),F=E,W=b.Xd(0),E=A.Gh.local(),C=new A.Dd;;){var he=Math.floor((j.oa-_)/g),Ee=Math.ceil((j.va-_)/g);if(!(3q.v;)(ee=A.Ud.clip(F,q,W,0)).A(j),(J==1607?!ee.B()&&(j.R()>W||j.ca()>W):!ee.B()&&(J!=1736||j.R()>W))&&(ee.Oc(C),ee.A(j),_.A(O),O.W(W,W),O.isIntersecting(j)&&J==1736?_=E.V(_,ee,b,null):_.add(ee,!1)),q.move(g,0),C.shift(-g,0);return _},G.WI=function(E,_,g,b){var C=new A.de(g.description);C.Fd(g,0,-1),C=A.cb.zh(C,E,_);var O=g.I();if(b.Oa(),!A.cb.Wc(E)||O!=C.I())return!1;var F=new A.l;g.A(F);var N=new A.l;if(C.A(N),F=F.R(),N=N.R(),F!=0&&N!=0){if(N/=F,E=A.cb.gh(_).R()/A.cb.gh(E).R(),1e-10=g[C]?b[C]=g[C].toUpperCase():g[C];return b.join()}return g.toString(A.Sc.PE_STR_AUTH_TOP)},_.ur=function(g,b,C,O){var F=O.length,N=C.I();if(N!=0){var j=C.ub(0),W=Math.min(N,F),q=0,J=g.eh();isNaN(b)&&(b=0);for(var ee=g.Wc(),he=179*(g=ee?g.sc().Oe().R():0)/360;0pt*A.lc.sign(Et)&&Math.abs(De)>he&&(O[Ee][0]+=-pt*g)}j.uC(q<<1,W,O),q+=W,N-=W,W=Math.min(N,F)}C.Pc(1993)}},_.IL=function(g,b,C,O){var F=0,N=g.eh();isNaN(F)&&(F=0);var j=g.Wc(),W=g.bf();g=360*W,W*=179;for(var q=O.length,J=0;JEt*A.lc.sign(De)&&Math.abs(pt)>W&&(O[ee][0]-=Et*g)}A.ta.Iy(b,J,O,he),J+=he}}},_.Lx=function(g,b,C){var O=C.length,F=b.I();if(!(1>F)){var N=b.ub(0),j=Math.min(F,O),W=0,q=g.eh(),J=g.Wc(),ee=J?g.Oe().R():0,he=179*ee/360,Ee=0;for(J&&(Ee=g.zi());0pt*A.lc.sign(Et)&&Math.abs(De)>he&&(C[g][0]+=-pt*ee)}N.uC(W<<1,j,C),W+=j,F-=j,j=Math.min(F,O)}b.Pc(1993)}},_.HL=function(g,b,C,O){if(C!=0){var F=g.eh(),N=g.Wc(),j=N?g.Oe().R():0,W=179*j/360,q=0;for(N&&(q=g.zi()),g=0;gDe*A.lc.sign(b[he].x-q)&&Math.abs(Ee)>W&&(O[J][0]-=De*j)}A.ta.Iy(b,g,O,ee),g+=ee}}}},_.tr=function(g,b,C,O){var F=b.I();if(F!=0){var N=b.ub(0),j=g.ef,W=g.Yf,q=j.sc().Qp(),J=W.sc().Qp(),ee=j.bf(),he=W.bf();if((g=g.Wf)==null||g.count()==0){for(C=q/J,O=(j.Up()-W.Up())*he,J=-90*ee,g=90*ee,q=!1,he=1,j=2*F;heYe?O[he][1]=Ye:O[he][1]<-Ye&&(O[he][1]=-Ye));for(ee=0;eehe){if(Xt){var Tn=Ri+(Mn+11*ee&&(Xt=!1)}Xt||(Un=Pt+(mi-=A.lc.Cn(J,Un-ar)),++z,Dt=mi!=0,yn.x=Un)}else Wi||A.ta.AG(ds,Fr,yn,pi)&&(Wi=!0);Dt&&Ui.write(2*Mn,Un),ar=Un,ds.L(Fr),Fr.L(yn)}0g?j=1:0>=W&&0.99*W&&(j=-1)):j=-1),j!=0&&((b=new A.Da(F.description)).tp(q),(b=A.Xl.local().V(b,C,N)).add(F,!1),Ye=!0,F=b),Ye&&(F=A.Yl.local().V(F,O,!1,N)),F},_.vQ=function(g,b,C,O,F){var N=C.I(),j=C.Na(0),W=C.Na(N-1);F=(O=_.dv(O,F)).R(),j=A.lc.sign(W.x-j.x);var q=new A.l;C.xc(q);var J=O.gk();if(W=J-F,J+=F,0<=j){var ee=Math.ceil((W-q.v)/F);for(ee*=F;W>q.v+ee;)ee+=F;for(;Wq.v+ee;)ee+=F;he=ee,720W;)1024<=Et&&(Et=0),Ee.move(ee,0),De.Gb=ee,C.Oc(De),pt+=ee,O.v<=pt&&O.C>=pt&&(F=q.I()-1),C.Cb(0,he),he=C.Na(N-1),q.Dr(C,0,0,N-1,!1);return C=new A.Da(q.description),N=0j?N:!N)?(j=A.h.construct(W.x,O.H),C.Ci(j),j=A.h.construct(O.gk(),O.H),C.Ci(j),O=A.h.construct(g.x,O.H)):(j=A.h.construct(W.x,O.G),C.Ci(j),j=A.h.construct(O.gk(),O.G),C.Ci(j),O=A.h.construct(g.x,O.G)),C.Ci(O),C.xG(0,b,0),C.kO(F),C},_.uQ=function(g,b,C,O,F){var N=new A.Da(g.description);N.add(g,!1),N.DB(0,N.I()-1);var j=new A.l;N.xc(j);var W=(C=_.dv(b,C)).R(),q=Math.ceil((C.v-j.v)/W);for(q*=W;C.v>j.v+q;)q+=W;for(;C.vj.C)return F&&(F=N.Ke(),b=(N=A.Yl.local().V(N,b,!0,O)).Ke(),(b=A.lc.sign(F)!=A.lc.sign(b))&&N.oJ()),N;for((g=new A.Da(g.description)).add(N,!1),F=F||j.R()>W-b.Xd(0);j.v=C){W=!0;break}if(2&F&&J.y<=-C){W=!0;break}}if(!W)return!1;N=!1,g&&(N=b.Nn(0)),j=(g=new A.gd).Ib(b),W=g.Ob(j);var ee=-1,he=!0,Ee=new A.h;Ee.Rc(),q=new A.Sa;for(var De=-1,pt=g.Xa(W);pt!=-1;pt=g.U(pt)){J=g.Na(pt);var Et=1&F&&90<=J.y?1:0;if(Et|=2&F&&J.y<=-C?2:0,0W){if(new A.l().K(Ee.v-j,-W,Ee.C+j,W),(F=A.ri.Nu(F,b,g,NaN,0,O)).B())return F;F.A(Ee)}if(pt&&(b.HEe.H))return F.Ia();if(Ee.R()>J&&(F=_.Hp(F,ee-q,J,g,!0,0,!0,O)).A(Ee),(W=_.eO(Ee.v,Ee.C,b.v,b.C,J))!=0&&Ee.move(W,0),Ee.C>b.C||Ee.vb.C)for(;Ee.v>=b.C;)Ee.move(-J,0),W-=J;for(;Ee.vW;W++){if(Et?j=A.aa.Hc(N)?A.ri.clip(F,b,C,he,O):A.ri.clip(F,b,C,0,O):(j=A.Xj.local().V(F,De,g,O))==De&&(j=A.aa.jg(j)),b.v<=Ee.v&&b.C>=Ee.C||b.v>=Ee.v&&b.C<=Ee.C)return j;pt[W]=j,W==0&&(Ee.move(-J,0),(j=new A.Dd).gg(-J,0),F.Oc(j))}if(N==550)pt[0].Fd(pt[1],0,-1);else if(A.aa.Hc(N))pt[0].add(pt[1],!1);else{if(N!=33)throw A.i.fa("intersect_with_GCS_horizon: unexpected geometry type");pt[0].B()&&(pt[0]=pt[1])}return pt[0]}if(b.HEe.H)return F;for(N=0;!F.B()&&Ee.C>b.v;)N!=0&&((j=new A.Dd).gg(N,0),F.Oc(j)),A.dj.local().V(4,F,De,g,O)||De==(F=A.kp.local().V(F,De,g,O))&&(F=A.aa.jg(F)),N!=0&&((he=new A.Dd).gg(-N,0),F.Oc(he)),N-=J,Ee.move(-J,0);return F},_.yG=function(g,b,C,O){if(b!=0&&O!=ue.DontClip)if(O==ue.PannableFold){O=C.HR();for(var F=b,N=0;NO.H||g[N].yj||g[N].y<-j)&&(g[N].Rc(),F--);if(F!=0){(F=new A.l).Zw(g,b),j=C.Vr();var q=C.hv();N=j.getType()==197;var J=new A.l;if(j.A(J),!q||!(J.HF.H))if(q)if(_.av(g,b,J.gk()-W,O),F=b,N)for(N=0;N=J||j&&ee==J)&&(ee+=Math.ceil((b-ee)/C)*C,ee=A.O.Rk(ee,b,J),O.cC(ee)),O}if(g.B()||(ee=new A.l,g.A(ee),ee.B()))return g;var he=new A.Nc;ee.cn(he);var Ee=new A.Nc;if(Ee.K(b,J),Ee.contains(he))return g;if((J=new A.l).K(ee),q===550){for(W=(O=F?g:g.Of()).ub(0),q=2*O.I(),J=!1,b=0;b=Ee.va||j&&ee==Ee.va)&&(J=!0,ee+=Math.ceil((Ee.oa-ee)/C)*C,ee=Ee.It(ee),W.write(b,ee));return J&&O.Pc(1993),O}if(q==197)return C=F?g:g.Of(),ee.Ea(J),C.Xo(ee),C;var De=.1*Math.max(ee.ca(),ee.R());for(J.W(0,De),j=g,Ee=O.Xd(0),g=A.Gh.local(),F=new A.Dd;;){var pt=Math.floor((he.oa-b)/C),Et=Math.ceil((he.va-b)/C);if(!(3J.v;)(De=A.ri.clip(j,J,Ee,0,W)).A(he),(q==1607?!De.B()&&(he.R()>Ee||he.ca()>Ee):!De.B()&&(q!=1736||he.R()>Ee))&&(De.Oc(F),De.A(he),b.A(N),N.W(Ee,Ee),N.isIntersecting(he)&&q==1736?b=g.V(b,De,O,null):b.add(De,!1)),J.move(C,0),F.shift(-C,0);return b},_.av=function(g,b,C,O){for(var F=C+O,N=0;NF||j==F)||(j+=Math.ceil((C-j)/O)*O,j=A.O.Rk(j,C,F),g[N].x=j)}},_.Fn=function(g,b,C,O,F,N){if(!b.Wc())throw A.i.fa("fold_into_360_degree_range");if(g.B())return g;if(b.Sb()==2){C=b.pv();var j=b.ov()-C}else{var W=b.bf();j=360*W,C-=180*W}return _.Hp(g,C,j,b,O,F,!0,N)},_.qF=function(g,b,C,O){if(C.Sb()==2)O=C.pv(),C=C.ov()-O;else{var F=C.bf();C=360*F,O-=180*F}_.av(g,b,O,C)},_.lj=function(g,b){var C=b.Oe();if(g.getType()==33){var O=g.ih();return C.G<=O&&O<=C.H?g:g.Ia()}O=new A.l,g.A(O);var F=new A.l;return F.K(C),F.v=O.v,F.C=O.C,F.W(.01*F.ca(),0),C=A.ta.uy(b,O),F.contains(O)?g:A.ri.clip(g,F,C,0,null)},_.ir=function(g,b,C){return g>b.C&&g-b.CC.H?g[F].Rc():g[F].x=_.ir(g[F].x,C,O)},_.Jt=function(g,b,C,O){if(!g.B()){var F=g.getType();if(!O||F!=1736)if(A.aa.xj(F)){O=g.ub(0),F=0;for(var N=g.I();FO||OO)||!N&&(j!=0||O<-wi.y&&pi.y>O||O<-pi.y&&wi.y>O))do if(!(Math.abs(wi.x-pi.x)>=.5*he.R())){if(C.Sb()==2?(De[0][0]=_.Zm(wi.x,he),De[0][1]=wi.y,De[1][0]=_.Zm(pi.x,he),De[1][1]=pi.y,A.ej.projToGeogCenter(Ee,2,De,0),Ri.x=De[0][0]*q,Ri.y=De[0][1]*q,Ui.y=De[1][1]*q):(Ri.x=wi.x*q,Ri.y=wi.y*q,Ui.y=pi.y*q),Ui.x=2*(pi.x-wi.x)*Math.PI/he.R()+Ri.x,N){if(jt.x=W,jt.y=_.Nz(J,ee,Ri,Ui,W,F),isNaN(jt.y))break;Xt[0]=jt;var z=1}else if(F==E.GreatElliptic){var Wi=[0,0];if((z=A.Ox.Oz(ee,Ri,Ui,W,Wi))==0)break;jt.x=Wi[0],jt.y=W,Xt[0]=jt,z==2&&(ei.x=Wi[1],ei.y=W,Xt[1]=ei)}else{if(jt.x=_.Lz(J,ee,Ri,Ui,F),isNaN(jt.x))break;jt.y=0,Xt[0]=jt,z=1}var Fr=-1;for(Wi=0;WiEt[0]||(Fr=g.Ma(ar),g.Ul(Fr,Et,1),g.Cb(g.U(Fr),Ye.x,Ye.y),Fr=Et[0])}}while(!1);wi.L(pi)}}},_.Zm=function(g,b){var C=b.va-b.oa;return b.It(g-Math.floor((g-b.oa)/C)*C)},_.os=function(g,b,C,O){var F=new A.Nc;for(F.K(b,C),C=O.R(),g=Math.floor((g-b)/C)*C+g,F=F.sf();Math.abs(g-F)>Math.abs(g+C-F);)g+=C;return g},_.Sn=function(g,b,C){return g=A.qr.Cp(g),b=A.qr.mx(g,A.qr.Cp(b)),(C=A.qr.mx(g,A.qr.Cp(C)))==0||0b&&0>C&&C>=b},_.Nz=function(g,b,C,O,F,N){if(N==E.GreatElliptic)return A.Ox.SS(b,C,O,F);if(Math.abs(C.x-O.x)>=Math.PI||!_.Sn(C.x,O.x,F))return NaN;if(C.x>O.x)var j=O;else j=C,C=O;O=new A.ga;var W=new A.ga,q=new A.ga;A.kb.wd(g,b,j.x,j.y,C.x,C.y,W,O,null,N);var J=W.u,ee=0,he=1,Ee=new A.h;for(Ee.L(j);J*(he-ee)>1e-12*g;){var De=.5*(ee+he);if(A.kb.oj(g,b,j.x,j.y,J*De,O.u,W,q,N),Ee.x=W.u,Ee.y=q.u,Ee.x==F)break;if(_.Sn(j.x,Ee.x,F))he=De;else{if(!_.Sn(C.x,Ee.x,F))return NaN;ee=De}}return Ee.y},_.Lz=function(g,b,C,O,F){if(F==E.GreatElliptic)return g=[0,0],A.Ox.Oz(b,C,O,0,g),g[0];if(C.y>O.y)var N=O;else N=C,C=O;if((O=new A.Nc).K(N.y,C.y),!O.contains(0)||Math.abs(N.x-C.x)>=Math.PI)return NaN;if(N.x==C.x)return N.x;var j=new A.ga,W=new A.ga,q=new A.ga;A.kb.wd(g,b,N.x,N.y,C.x,C.y,W,j,null,F);var J=W.u,ee=0,he=1,Ee=new A.h;for(Ee.L(N);J*(he-ee)>1e-12*g;){var De=.5*(ee+he);if(A.kb.oj(g,b,N.x,N.y,J*De,j.u,W,q,F),Ee.x=W.u,Ee.y=q.u,O.K(N.y,Ee.y),Ee.y==0)break;if(O.contains(0))he=De;else{if(O.K(C.y,Ee.y),!O.contains(0))return NaN;ee=De}}return Ee.x},_.WI=function(g,b,C,O){if(!g.ef.Wc())return!1;var F=new A.de(b.description);if(F.Fd(b,0,-1),O=A.Hx.local().V(F,g,O),F=b.I(),C.Oa(),F!=O.I())return!1;var N=new A.l;b.A(N);var j=new A.l;if(O.A(j),N=N.R(),j=j.R(),N!=0&&j!=0){if(j/=N,g=g.Yf.gh().R()/g.ef.gh().R(),1e-10=180*b&&(g-=360*b),g},_.UI=function(g,b,C,O){if(C==ue.Clip){var F=b.ml();F.getType()==197?(C=new A.l,F.A(C),F=A.ta.uy(b,C),g=A.ri.clip(g,C,F,5e4*b.pm(),O)):A.dj.local().V(1,F,g,b,O)||(g=A.Xj.local().V(g,F,b,O))==F&&(g=A.Vk.jg(g))}else b.Wc()&&(O=new A.l,g.xc(O),b.Oe().contains(O)||(_.Jt(g,b.Oe(),b.Xd(0),!0),C==ue.PannableFold&&(g=_.lj(g,b)),g=_.Fn(g,b,0,!0,1e5*b.pm(),null)));return g},_.XD=function(g,b,C){var O=b.Wr();if(O==null)return g;var F=(b=b.sc()).Oe().R(),N=new A.l;g.xc(N);var j=new A.Nc;N.cn(j),N=O.Ga(),O=null;for(var W=new A.Dd;N.$a();)for(;N.Ha();){var q=N.ha(),J=q.Tg(0,0),ee=new A.Nc;for(ee.K(J.oa,J.va),J=0;ee.va>j.oa;)ee.move(-F),--J;for(;ee.oa<=j.va;){if(ee.isIntersecting(j)){O==null&&(O=new A.Ta);var he=A.yb.cP(q.ac(),q.wc());J!=0&&(W.gg(J*F,0),he.Oc(W)),O.oc(he,!0)}ee.move(F),++J}}return O!=null?(b=A.ta.gO(b,O),b=A.ta.Er(b),A.$t.lP(g,O,b,C)):g},_.eO=function(g,b,C,O,F){return g>=C&&b<=O?0:_.tE(.5*(b+g),C,O,F)},_.tE=function(g,b,C,O){return A.lc.round((.5*(C+b)-g)/O)*O},_.VQ=function(g,b,C,O,F,N,j,W){var q=_.dv(O,F),J=q.R(),ee=J/360,he=_.pE*ee,Ee=g.ub(0),De=b.Wc(),pt=De?J/b.Oe().R():0;b=g.Ia();for(var Et=0,Ye=C.da();Ethe){if(jt){var Qi=wi+Dt-1,Tn=wi;(!pi||Dt+11*ee&&(De=!1)}jt||(Pt=yn+(Ui-=A.lc.Cn(J,Pt-Bi)),++mi,ds=Ui!=0,Mn.x=Pt)}else z||A.ta.AG(Wi,Fr,Mn,ar)&&(z=!0);ds&&Ri.write(2*Dt,Pt),Bi=Pt,Wi.L(Fr),Fr.L(Mn)}mi!=0&&ei.Pc(1993),jt=ei.Na(0),Xt=ei.Na(Xt-1),A.h.tb(jt,Xt),ei=_.wQ(ei,O,isNaN(F)?0:F,N),b.add(ei,!1)}return g=O.Xd(0),C=q.R()/180,_.Jt(b,q,.1*g,!1),A.ri.clip(b,q,g,C,N)},_.wQ=function(g,b,C,O){return _.Fn(g,b,C,!0,0,O)},_.OS=function(g,b,C,O){var F=g.getType();if(F==1736)for(b=b!=null?b.Xd(0):0,F=0;FC)for(var F=new A.Sa,N=0;NC)for(var F=new A.Sa,N=0;Nthis.Io},E.prototype.fz=function(){if(this.B())throw A.i.fa("invalid call");return new A.Sa(this.Bs.x,this.Bs.y)},E.prototype.Ua=function(){if(this.B())throw A.i.fa("invalid call");return this.Io},E.prototype.hz=function(){if(this.B())throw A.i.fa("invalid call");return this.Ka},E.prototype.Sz=function(){return(1&this.nw)!=0},E.prototype.ey=function(_,g,b,C){this.Bs.x=_,this.Bs.y=g,this.Io=b,this.Ka=C},E}();A.$l=G}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.prototype.Uo=function(_,g){if(this.th.resize(0),this.Ii.length=0,this.tk=-1,_.xc(this.Ek),this.Ek.W(g,g),this.Ek.isIntersecting(this.Fb.Ca)){var b=_.getType();(this.vs=A.aa.yd(b))?(this.TH=_.ac(),this.SH=_.wc(),this.qa=g):this.qa=NaN,this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf)}else this.Qs=-1},E.prototype.Xi=function(_,g){this.th.resize(0),this.Ii.length=0,this.tk=-1,this.Ek.K(_),this.Ek.W(g,g),this.qa=NaN,this.Ek.isIntersecting(this.Fb.Ca)?(this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf),this.vs=!1):this.Qs=-1},E.prototype.next=function(){if(this.th.size==0)return-1;this.tk=this.Qs;var _=null,g=null,b=null,C=null;this.vs&&(_=new A.h,g=new A.h,b=new A.l);for(var O=!1;!O;){for(;this.tk!=-1;){var F=this.Fb.bz(this.Fb.fv(this.tk));if(F.isIntersecting(this.Ek)){if(!this.vs){O=!0;break}if(_.L(this.TH),g.L(this.SH),b.K(F),b.W(this.qa,this.qa),0N;N++){var j=this.Fb.Lp(F,N);if(j!=-1&&0>C);O==0?(g.v=.5*(g.v+g.C),g.G=.5*(g.G+g.H)):O==1?(g.C=.5*(g.v+g.C),g.G=.5*(g.G+g.H)):(O==2?g.C=.5*(g.v+g.C):g.v=.5*(g.v+g.C),g.H=.5*(g.G+g.H))}return g},E.prototype.WR=function(_){return this.Az(_)},E.prototype.vR=function(_,g){return ue.bP(this,_,g)},E.prototype.MF=function(_,g){return ue.aP(this,_,g)},E.prototype.getIterator=function(){return ue.$O(this)},E.prototype.Nk=function(_,g){if(0>g||32<2*g)throw A.i.N("invalid height");this.BT=g,this.Ca.K(_),this.kf=this.jf.Ce(),this.jx(this.kf,0),this.ax(this.kf,0),this.NJ(this.kf,0),this.KJ(this.kf,0)},E.prototype.zv=function(_,g,b,C,O,F,N){if(!C.contains(g))return b==0?-1:this.zv(_,g,0,this.Ca,this.kf,F,N);if(!F)for(var j=O;j!=-1;j=this.IR(j))this.jx(j,this.Az(j)+1);(j=new A.l).K(C),C=O;var W=[];for(W[0]=new A.l,W[1]=new A.l,W[2]=new A.l,W[3]=new A.l;bJ;J++)if(W[J].contains(g)){q=!0;var ee=this.Lp(C,J);ee==-1&&(ee=this.rP(C,J)),this.jx(ee,this.Az(ee)+1),C=ee,j.K(W[J]);break}if(!q)break}return this.sS(_,g,b,j,C,F,O,N)},E.prototype.sS=function(_,g,b,C,O,F,N,j){var W=this.NF(O);if(F){if(O==N)return j;this.SP(j),F=j}else F=this.tP(),this.NB(F,_),this.KW(this.fv(F),g);return this.mX(F,O),W!=-1?(this.hx(F,W),this.bx(W,F)):this.GJ(O,F),this.SB(O,F),this.ax(O,this.lv(O)+1),this.hO(O)&&this.MQ(b,C,O),F},E.prototype.SP=function(_){var g=this.WF(_),b=this.NF(g),C=this.OR(_),O=this.nv(_);this.Ur(g)==_?(O!=-1?this.hx(O,-1):this.SB(g,-1),this.GJ(g,O)):b==_?(this.bx(C,-1),this.SB(g,C)):(this.hx(O,C),this.bx(C,O)),this.hx(_,-1),this.bx(_,-1),this.ax(g,this.lv(g)-1)},E.EJ=function(_,g){var b=.5*(_.v+_.C),C=.5*(_.G+_.H);g[0].K(b,C,_.C,_.H),g[1].K(_.v,C,b,_.H),g[2].K(_.v,_.G,b,C),g[3].K(b,_.G,_.C,C)},E.prototype.hO=function(_){return this.lv(_)==8&&!this.gG(_)},E.prototype.MQ=function(_,g,b){var C=this.Ur(b);do{var O=this.fv(C),F=this.Zh.T(C,0);O=this.bz(O),this.zv(F,O,_,g,b,!0,C),C=F=this.nv(C)}while(C!=-1)},E.prototype.iO=function(_){return 8<=this.lv(_)||this.gG(_)},E.prototype.gG=function(_){return this.Lp(_,0)!=-1||this.Lp(_,1)!=-1||this.Lp(_,2)!=-1||this.Lp(_,3)!=-1},E.prototype.rP=function(_,g){var b=this.jf.Ce();return this.OW(_,g,b),this.jx(b,0),this.ax(b,0),this.Pk(b,_),this.KJ(b,this.jv(_)+1),this.NJ(b,g<<2*this.jv(_)|this.QF(_)),b},E.prototype.tP=function(){var _=this.Zh.Ce();if(0>4)]|=this.iH<<2*(15&O)},_}();A.HY=G;var E=function(){function _(g,b,C){this.Vh=null,this.SA=this.Ik=this.cI=this.aI=this.Es=this.qH=this.Gf=this.Um=0,this.Ri=this.Jk=this.vl=null,this.Fz(g,b,C)}return _.create=function(g,b,C){if(!_.zE(g))throw A.i.N();return _.wP(g,b,C)},_.pW=function(g){switch(g){case 0:g=1024;break;case 1:g=16384;break;case 2:g=262144;break;default:throw A.i.fa("Internal Error")}return g},_.zE=function(g){return!(g.B()||g.getType()!=1607&&g.getType()!=1736)},_.prototype.rQ=function(g,b){b=b.Ga();for(var C=new A.h,O=new A.h;b.$a();)for(;b.Ha();){var F=b.ha();if(F.getType()!=322)throw A.i.fa("Internal Error");g.Eh(F.ac(),C),g.Eh(F.wc(),O),this.Ri.jy(C.x,C.y,O.x,O.y)}this.Ri.iJ(A.Px.Cx)},_.prototype.sQ=function(){throw A.i.fa("Internal Error")},_.prototype.Ry=function(g,b){for(var C=1;4>C;C++)g.jy(b[C-1].x,b[C-1].y,b[C].x,b[C].y);g.jy(b[3].x,b[3].y,b[0].x,b[0].y),this.Ri.iJ(A.Px.Cx)},_.prototype.rK=function(g,b,C){for(var O=[null,null,null,null],F=0;F(De=F.length());De==0?F.ma(1,0):(pt||ee.L(q),F.scale(C/De),N.ma(-F.y,F.x),j.ma(F.y,-F.x),W.sub(F),q.add(F),O[0].add(W,N),O[1].add(W,j),O[2].add(q,j),O[3].add(q,N),pt?he=!0:this.Ry(g,O))}else he&&(this.Ry(g,O),he=!1),Ee=!0}he&&this.Ry(g,O)}},_.prototype.sC=function(g){return A.O.truncate(g*this.qH+this.aI)},_.prototype.tC=function(g){return A.O.truncate(g*this.Es+this.cI)},_.wP=function(g,b,C){return new _(g,b,C)},_.prototype.Fz=function(g,b,C){this.Gf=Math.max(A.O.truncate(2*Math.sqrt(C)+.5),64),this.Um=A.O.truncate((2*this.Gf+31)/32),this.vl=new A.l,this.Ik=b,C=0;for(var O=this.Gf,F=this.Um;8<=O;)C+=O*F,O=A.O.truncate(O/2),F=A.O.truncate((2*O+31)/32);this.Vh=A.O.lg(C,0),this.Ri=new A.Px,C=new G(this.Vh,this.Um,this),this.Ri.AX(this.Gf,this.Gf,C),g.A(this.vl),this.vl.W(b,b),O=new A.l;var N=b*(F=A.l.construct(1,1,this.Gf-2,this.Gf-2)).R();switch(b*=F.ca(),O.K(this.vl.sf(),Math.max(N,this.vl.R()),Math.max(b,this.vl.ca())),this.SA=this.Ik,this.Jk=new A.Dd,this.Jk.pS(O,F),new A.Dd,g.getType()){case 550:C.setColor(this.Ri,2),this.sQ();break;case 1607:C.setColor(this.Ri,2),this.rK(this.Ri,g,this.SA);break;case 1736:C.setColor(this.Ri,1),this.rQ(this.Jk,g),C.setColor(this.Ri,2),this.rK(this.Ri,g,this.SA)}this.qH=this.Jk.bb,this.Es=this.Jk.ab,this.aI=this.Jk.Gb,this.cI=this.Jk.Lb,this.XN()},_.prototype.XN=function(){this.Ri.flush();for(var g=0,b=this.Gf*this.Um,C=this.Gf,O=A.O.truncate(this.Gf/2),F=this.Um,N=A.O.truncate((2*O+31)/32);8>4;J=2*(15&J);var Ee=ee>>4;ee=2*(15&ee);var De=this.Vh[g+F*j+he]>>J&3;De|=this.Vh[g+F*j+Ee]>>ee&3,De|=this.Vh[g+F*W+he]>>J&3,De|=this.Vh[g+F*W+Ee]>>ee&3,this.Vh[b+N*C+(q>>4)]|=De<<2*(15&q)}C=O,F=N,g=b,O=A.O.truncate(C/2),N=A.O.truncate((2*O+31)/32),b=g+F*C}},_.prototype.So=function(g,b){return this.vl.contains(g,b)?(g=this.sC(g),b=this.tC(b),0>g||g>=this.Gf||0>b||b>=this.Gf||(b=this.Vh[this.Um*b+(g>>4)]>>2*(15&g)&3)==0?0:b==1?1:2):0},_.prototype.Ro=function(g){if(!g.Ea(this.vl))return 0;var b=this.sC(g.v),C=this.sC(g.C),O=this.tC(g.G);if(g=this.tC(g.H),0>b&&(b=0),0>O&&(O=0),C>=this.Gf&&(C=this.Gf-1),g>=this.Gf&&(g=this.Gf-1),b>C||O>g)return 0;for(var F=Math.max(C-b,1)*Math.max(g-O,1),N=0,j=this.Um,W=this.Gf,q=0;;){if(32>F||16>W){for(F=O;F<=g;F++)for(var J=b;J<=C;J++)if(1<(q=this.Vh[N+j*F+(J>>4)]>>2*(15&J)&3))return 2;if(q==0)return 0;if(q==1)return 1}N+=j*W,W=A.O.truncate(W/2),j=A.O.truncate((2*W+31)/32),b=A.O.truncate(b/2),O=A.O.truncate(O/2),C=A.O.truncate(C/2),g=A.O.truncate(g/2),F=Math.max(C-b,1)*Math.max(g-O,1)}},_.prototype.RR=function(){return this.Gf*this.Um},_}();A.Nx=E}(ye||(ye={})),function(A){var ue;(ue=A.VL||(A.VL={}))[ue.contains=1]="contains",ue[ue.within=2]="within",ue[ue.equals=3]="equals",ue[ue.disjoint=4]="disjoint",ue[ue.touches=8]="touches",ue[ue.crosses=16]="crosses",ue[ue.overlaps=32]="overlaps",ue[ue.unknown=0]="unknown",ue[ue.intersects=1073741824]="intersects";var G=function(){function _(){}return _.construct=function(g,b,C,O,F,N,j,W){var q=new _;return q.pw=g,q.Mm=b,q.Kj=C,q.Si=O,q.BH=F,q.SY=N,q.TY=j,q.UY=W,q},_}();A.Vt=function(){function _(){}return _.CD=function(g,b,C){if(_.wy(g)){var O=A.ta.kj(b,g,!1);b=!1,A.Uk.CE(g)&&(b=b||g.lu(O,C)),(O=g.getType())!=1736&&O!=1607||!A.Uk.AE(g)||C==0||(b=b||g.fj(C)),O!=1736&&O!=1607||!A.Uk.BE(g)||C==0||b||g.hM()}},_.wy=function(g){return A.Uk.CE(g)||A.Uk.AE(g)||A.Uk.BE(g)},_}();var E=function(){function _(){this.rh=[]}return _.zB=function(g,b,C,O,F){var N=g.getType(),j=b.getType();if(N==197){if(j==197)return _.tW(g,b,C,O);if(j==33)return O==2?O=1:O==1&&(O=2),_.hJ(b,g,C,O)}else if(N==33){if(j==197)return _.hJ(g,b,C,O);if(j==33)return _.vW(g,b,C,O)}if(g.B()||b.B())return O==4;var W=new A.l;g.A(W);var q=new A.l;b.A(q);var J=new A.l;if(J.K(W),J.Zb(q),C=A.ta.Wd(C,J,!1),_.dk(W,q,C))return O==4;switch(W=!1,A.Vk.yd(N)&&((N=new A.Ta(g.description)).oc(g,!0),g=N,N=1607),A.Vk.yd(j)&&((j=new A.Ta(b.description)).oc(b,!0),b=j,j=1607),N!=197&&j!=197?(g.Db()4*Math.max(g.I(),b.I())*C)&&_.Wz(g,b,C,!0)))},_.kV=function(g,b,C){var O=_.qc(g,b,!0);return O==4||O!=1&&O!=2&&O!=1073741824&&_.EI(g,b,C)},_.vV=function(g,b,C){var O=_.qc(g,b,!1);return O!=4&&O!=1&&O!=2&&_.II(g,b,C,null)},_.qV=function(g,b,C,O){var F=_.qc(g,b,!1);return F!=4&&F!=1&&F!=2&&_.FI(g,b,C,O)},_.Sw=function(g,b,C,O){var F=new A.l,N=new A.l;return g.A(F),b.A(N),!!_.zc(F,N,C)&&(F=_.qc(g,b,!1))!=4&&F!=2&&(F==1||_.BI(g,b,C,O))},_.lV=function(g,b,C){var O=_.qc(g,b,!0);return O==4||O!=1&&O!=1073741824&&_.EI(g,b,C)},_.wV=function(g,b,C,O){var F=_.qc(g,b,!1);return F!=4&&F!=1&&_.JI(g,b,C,O)},_.gV=function(g,b,C){var O=_.qc(g,b,!1);return O!=4&&O!=1&&_.DI(g,b,C,null)},_.fB=function(g,b,C,O){var F=new A.l,N=new A.l;return g.A(F),b.A(N),!!_.zc(F,N,C)&&(F=_.qc(g,b,!1))!=4&&(F==1||_.CI(g,b,C,O))},_.jV=function(g,b,C){return A.hd.KG(g,b,C)==0},_.uV=function(g,b,C){return b=b.D(),_.HI(g,b,C)},_.dV=function(g,b,C){return b=b.D(),_.AI(g,b,C)},_.iV=function(g,b,C){var O=_.qc(g,b,!1);if(O==4)return!0;if(O==1)return!1;O=new A.l,g.A(O),O.W(C,C);for(var F=new A.h,N=0;NC&&N.R()>C||N.ca()<=C&&N.R()<=C)&&(F=new A.Ta,N=new A.Sa,b.Hf(0,N),F.nf(N),b.Hf(2,N),F.lineTo(N),_.DI(g,F,C,O))},_.IV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!(!_.ek(O,F,C)||_.qc(g,b,!1)==4)&&(!!_.dI(g,b,C)||_.Wz(g,b,C,!1))},_.GV=function(g,b,C){return this.qc(g,b,!1)==4||!!new A.Zl(g,b,C,!0).next()&&!this.UG(g,b,C)},_.NI=function(g,b,C){if(_.qc(g,b,!1)==4)return!1;var O=new A.be(0);if(_.Xz(g,b,C,O)!=0)return!1;for(var F=new A.de,N=0;NC&&F.R()>C)&&_.ek(O,F,C)},_.DV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!_.zc(F,O,C)&&!_.TG(g,F,C)},_.OV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),F.ca()<=C&&F.R()<=C)return F=b.Ip(),_.Zz(g,F,C);if(F.ca()<=C||F.R()<=C)return F=new A.Ta,O=new A.Sa,b.Hf(0,O),F.nf(O),b.Hf(2,O),F.lineTo(O),_.NI(g,F,C);g=g.Ga(),b=new A.l,O=new A.l,b.K(F),O.K(F),b.W(-C,-C),O.W(C,C),F=!1;for(var N=new A.l,j=new A.l;g.$a();)for(;g.Ha();){if(g.ha().A(N),j.K(b),j.Ea(N),!j.B()&&(j.ca()>C||j.R()>C))return!1;j.K(O),j.Ea(N),j.B()||(F=!0)}return F},_.LV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!(_.zc(O,F,C)||_.zc(F,O,C)||_.zc(F,O,C)||F.ca()>C&&F.R()>C||F.ca()<=C&&F.R()<=C)&&(O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.WG(g,O,C))},_.RV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),!_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C)return _.zc(F,O,C);g=g.Ga(),(b=new A.l).K(F),b.W(-C,-C),F=!1,O=new A.l;for(var N=new A.l;g.$a();)for(;g.Ha();)g.ha().A(O),b.hm(O)?F=!0:(N.K(b),N.Ea(O),!N.B()&&(N.ca()>C||N.R()>C)&&(F=!0));return F},_.yV=function(g,b,C){var O=new A.l,F=new A.l;return b.A(F),g.A(O),!(!_.zc(O,F,C)||F.ca()>C&&F.R()>C)&&(F.ca()<=C&&F.R()<=C?(b=b.Ip(),_.SG(g,b,C)):(O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.ym(O,g,C,!1)))},_.BV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C)return O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.LI(g,O,C);g=g.Ga(),b=new A.l,(O=new A.l).K(F),b.K(F),O.W(-C,-C),b.W(C,C);for(var N=F=!1,j=new A.l,W=new A.l;g.$a();)for(;g.Ha();)if(g.ha().A(j),N||b.contains(j)||(N=!0),F||(W.K(O),W.Ea(j),!W.B()&&(W.ca()>C||W.R()>C)&&(F=!0)),F&&N)return!0;return!1},_.iU=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!!_.ek(O,F,C)&&(!!_.jU(g,b,C)||_.YA(g,b,C,!1,!0,!1))},_.gU=function(g,b,C){return!_.gI(g,b,C)},_.oU=function(g,b,C){return _.YA(g,b,C,!1,!1,!0)},_.eI=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!!_.zc(O,F,C)&&_.YA(b,g,C,!0,!1,!1)},_.Mw=function(g,b,C){C*=C;for(var O=new A.h,F=new A.h,N=0;NC||F.R()>C)&&_.ek(O,F,C)},_.fU=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C))return!1;for((b=new A.l).K(F),b.W(C,C),C=new A.h,F=0;FC?N.W(0,-C):N.W(-C,0);for(var W=0;WC){if(b.y>N.G&&b.yN.v&&b.xC?O.W(0,-C):O.W(-C,0),N.W(C,C);for(var j=new A.h,W=0;WC?j.y>O.G&&j.yO.v&&j.xC||F.R()>C)&&(b=b.Ip(),!_.kt(g,b,C))},_.eU=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C){b=new A.l,O=new A.l,b.K(F),F.ca()>C?b.W(0,-C):b.W(-C,0),O.K(F),O.W(C,C);for(var N=new A.h,j=!1,W=!1,q=0;qC?N.y>b.G&&N.yb.v&&N.xC*C},_.uI=function(g,b,C){return _.wI(g,b,C)},_.vI=function(g,b,C){var O=new A.l;return O.K(g),_.ek(O,b,C)},_.Rw=function(g,b,C){var O=new A.l;return O.K(b),O.W(C,C),!O.contains(g)},_.dB=function(g,b,C){if(b.ca()<=C&&b.R()<=C)return!1;var O=new A.l,F=new A.l;if(O.K(b),O.W(C,C),!O.contains(g))return!1;if(b.ca()<=C||b.R()<=C){if(F.K(b),b.ca()>C?F.W(0,-C):F.W(-C,0),b.ca()>C){if(g.y>F.G&&g.yF.v&&g.xC?O.W(0,-C):O.W(-C,0);var F=!1;return b.ca()>C?g.y>O.G&&g.yO.v&&g.xC&&g.R()>C&&(b.ca()<=C||b.R()<=C)?O=b:(O=g,g=b),O.ca()<=C||O.R()<=C){if(g.ca()<=C||g.R()<=C){b=new A.yb;var F=new A.yb,N=[0,0],j=[0,0],W=new A.h;return O.dn(W),b.Dc(W),O.en(W),b.Qc(W),g.dn(W),F.Dc(W),g.en(W),F.Qc(W),b.Ea(F,null,N,j,C),b.Ea(F,null,null,null,C)==1&&(N[0]==0||N[1]==1||j[0]==0||j[1]==1)}return b=new A.l,F=new A.l,b.K(g),b.W(-C,-C),F.K(b),F.Ea(O),!(!F.B()&&(F.ca()>C||F.R()>C))}return g.W(C,C),(F=new A.l).K(O),F.Ea(g),!(F.B()||!F.B()&&F.ca()>C&&F.R()>C)},_.bQ=function(g,b,C){if(_.zc(g,b,C)||_.zc(b,g,C)||g.ca()<=C&&g.R()<=C||b.ca()<=C&&b.R()<=C)return!1;if(g.ca()<=C||g.R()<=C){if(b.ca()>C&&b.R()>C)return!1;var O=new A.yb,F=new A.yb,N=[0,0],j=[0,0],W=new A.h;return g.dn(W),O.Dc(W),g.en(W),O.Qc(W),b.dn(W),F.Dc(W),b.en(W),F.Qc(W),O.Ea(F,null,N,j,C),O.Ea(F,null,null,null,C)==2&&(0N[1])&&(0j[1])}return!(b.ca()<=C||b.R()<=C)&&((O=new A.l).K(g),O.Ea(b),!(O.B()||O.ca()<=C||O.R()<=C))},_.jF=function(g,b,C){if(!_.zc(g,b,C))return!1;if(g.ca()<=C&&g.R()<=C)return g=g.sf(),_.eB(g,b,C);if(b.ca()<=C&&b.R()<=C)return b=b.sf(),_.eB(b,g,C);if(g.ca()<=C||g.R()<=C)return _.zc(g,b,C);if(b.ca()<=C||b.R()<=C){var O=new A.l;return O.K(g),O.W(-C,-C),O.hm(b)?!0:((g=new A.l).K(O),g.Ea(b),!(g.B()||g.ca()<=C&&g.R()<=C))}return _.zc(g,b,C)},_.aQ=function(g,b,C){if(_.zc(g,b,C)||_.zc(b,g,C)||g.ca()<=C&&g.R()<=C||b.ca()<=C&&b.R()<=C||b.ca()>C&&b.R()>C&&g.ca()>C&&g.R()>C)return!1;if(g.ca()>C&&g.R()>C)var O=b;else O=g,g=b;if(g.ca()>C&&g.R()>C){b=new A.l;var F=new A.l;return F.K(g),F.W(-C,-C),b.K(F),b.Ea(O),!(b.B()||b.ca()<=C&&b.R()<=C)}b=new A.yb,F=new A.yb;var N=[0,0],j=[0,0],W=new A.h;return O.dn(W),b.Dc(W),O.en(W),b.Qc(W),g.dn(W),F.Dc(W),g.en(W),F.Qc(W),b.Ea(F,null,N,j,C),b.Ea(F,null,null,null,C)==1&&0N[1]&&0j[1]},_.EI=function(g,b,C){var O=new A.l,F=new A.l,N=new A.Zl(g,b,C,!0);if(!N.next())return!0;if(this.UG(g,b,C))return!1;var j=g,W=null;b.getType()==1736&&(W=b);var q=!1,J=!1;do{var ee=N.nl(),he=N.hl();if(he=b.Na(b.Ba(he)),O.K(N.uz()),O.W(C,C),O.contains(he)&&(he=A.hd.Yd(j,he,0))!=0||b.getType()==1736&&(ee=g.Na(g.Ba(ee)),F.K(N.az()),F.W(C,C),F.contains(ee)&&(he=A.hd.Yd(W,ee,0))!=0))return!1;q||(!A.Dg.Ml(g,b.da()-1)||g.Bb!=null&&g.Bb.Fb!=null?j=g:(j=new A.Da,g.copyTo(j),j.fj(1)),q=!0),b.getType()!=1736||J||(J=b,!A.Dg.Ml(J,g.da()-1)||b.Bb!=null&&b.Bb.Fb!=null?W=b:(W=new A.Da,J.copyTo(W),W.fj(1)),J=!0)}while(N.next());return!0},_.zc=function(g,b,C){var O=new A.l;return O.K(g),O.W(C,C),O.contains(b)},_.ls=function(g,b,C){var O=new A.l;return O.K(b),O.W(C,C),b=new A.h,g.dn(b),!O.contains(b)||(g.$I(b),!O.contains(b)||(g.cJ(b),!O.contains(b)||(g.en(b),!O.contains(b))))},_.dI=function(g,b,C){if(g.da()!=b.da()||g.I()!=b.I())return!1;var O=new A.h,F=new A.h,N=!0;C*=C;for(var j=0;jC){N=!1;break}if(!N)break}return!!N},_.jU=function(g,b,C){if(g.I()!=b.I())return!1;var O=new A.h,F=new A.h,N=!0;C*=C;for(var j=0;jC){N=!1;break}return!!N},_.YA=function(g,b,C,O,F,N){var j=!1;if(g.I()>b.I()){O&&(O=!1,j=!0);var W=b}else W=g,g=b;if(b=null,F||N||j){b=new A.pn(g.I());for(var q=0;qb.I())var O=b;else O=g,g=b;b=new A.l;var F=new A.l,N=new A.l;O.A(b),g.A(F),b.W(C,C),F.W(C,C),N.K(b),N.Ea(F),F=new A.h;for(var j=new A.h,W=C*C,q=A.ta.oE(g,N),J=q.getIterator(),ee=0;eeC)return!1;if(Ye*(1-(ei=N.Si))<=C||ei==1)break}if(Ye*(1-ei)>C)return!1;J=0,ee.resize(0),he.rh.length=0}}return j},_.WG=function(g,b,C){if(1>_.Xz(g,b,C,null))return!1;var O=new A.l,F=new A.l;g.A(O),b.A(F);var N=_.ls(O,F,C);return O=_.ls(F,O,C),!(!N||!O)||(N&&!O?!_.ym(b,g,C,!1):O&&!N?!_.ym(g,b,C,!1):!_.ym(g,b,C,!1)&&!_.ym(b,g,C,!1))},_.Xz=function(g,b,C,O){function F(Fr,ds){return Ee.QE(Fr,ds)}if(g.yz()>b.yz())var N=b,j=g;else N=g,j=b;g=N.Ga(),b=j.Ga();var W=[0,0],q=[0,0],J=-1,ee=0,he=new A.ia(0),Ee=new _,De=new A.l,pt=new A.l,Et=new A.l;N.A(De),j.A(pt),De.W(C,C),pt.W(C,C),Et.K(De),Et.Ea(pt),N=null,O!=null&&(N=new A.h);var Ye=pt=pt=null,jt=j.Bb;for(jt!=null?(pt=jt.Fb,Ye=jt.zo,pt==null&&(pt=A.ta.jj(j,Et))):pt=A.ta.jj(j,Et),j=pt.getIterator(),jt=null,Ye!=null&&(jt=Ye.getIterator());g.$a();)for(Ye=0;g.Ha();){var ei=g.ha();if(ei.A(De),De.isIntersecting(Et)){if(jt!=null&&(jt.Xi(De,C),jt.next()==-1))continue;var Xt=ei.Qb();j.Uo(ei,C);for(var wi=j.next();wi!=-1;wi=j.next()){var pi=pt.ja(wi);b.Vb(pi);var Ri=b.ha(),Ui=Ri.Qb(),Bi=ei.Ea(Ri,null,W,q,C);if(0C)return 1;var z=Xt*(mi-wi);if(b.Ha()){if(Ri=b.ha(),(Bi=ei.Ea(Ri,null,W,null,C))==2){Bi=W[0];var Wi=W[1];if(z+(Bi=Xt*(Wi-Bi))>C)return 1}b.Vb(pi),b.ha()}if(!b.vm()){if(b.li(),Ri=b.li(),(Bi=ei.Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Xt*((Wi=W[1])-Bi))>C))return 1;b.Vb(pi),b.ha()}if(g.Ha()){if(pi=g.wb(),(Bi=(ei=g.ha()).Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Xt*((Wi=W[1])-Bi))>C))return 1;g.Vb(pi),g.ha()}if(!g.vm()){if(pi=g.wb(),g.li(),(Bi=(ei=g.li()).Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Ui*((Wi=W[1])-Bi))>C))return 1;g.Vb(pi),g.ha()}Ri=G.construct(g.wb(),g.gb,wi,mi,b.wb(),b.gb,J,ar),Ee.rh.push(Ri),he.add(he.size)}J=0,O!=null&&(ei.hc(wi,N),O.add(N.x),O.add(N.y))}}if(eeC)Ye=Xt*(Ri.Si-Ri.Kj),ei=Ri.Si,wi=Ri.Mm;else{if(Ri.Mm!=wi?(Ye=Xt*(Ri.Si-Ri.Kj),wi=Ri.Mm):Ye+=Xt*(Ri.Si-Ri.Kj),Ye>C)return 1;if((ei=Ri.Si)==1)break}Xt*(1-ei)>C&&(Ye=0),ee=0,he.resize(0),Ee.rh.length=0}}}return J},_.UG=function(g,b,C){var O=g.Ga(),F=b.Ga();for(g=new A.Zl(g,b,C,!1);g.next();){b=g.nl();var N=g.hl();if(O.Vb(b),F.Vb(N),b=O.ha(),0C)return!1;ee=!0}else if(Ee!=0){if(ee=W[0],he=q[0],0ee&&0he)return!1;ee=!0}}return!!ee&&(N=new A.l,j=new A.l,F=new A.l,g.A(N),b.A(j),N.W(1e3*C,1e3*C),j.W(1e3*C,1e3*C),F.K(N),F.Ea(j),!(10C&&(q=!0,J&&ee))return!0}else if(Ye!=0&&(Ye=De[0],jt=pt[0],0Ye&&0jt))return!0}if(F=new A.l,he=new A.l,F.K(N),F.W(1e3*C,1e3*C),he.K(j),he.W(1e3*C,1e3*C),W.K(F),W.Ea(he),N="",N=q?N+"**":N+"T*",J){if(10ee&&0he)))return O[0]=!0,!1}if(!J){for(O[0]=!0,j=new A.l,g.A(j),j.W(C,C),q=g,J=!1,W=new A.l,O=0,F=b.da();OJ&&0ee)return!1;J=!0}}return!!J&&(N=new A.l,j=new A.l,F=new A.l,g.A(N),b.A(j),N.W(1e3*C,1e3*C),j.W(1e3*C,1e3*C),F.K(N),F.Ea(j),!(10J&&0ee)return!0;J=!0}}return!!J&&(N=new A.l,j=new A.l,W=new A.l,q=new A.l,F=new A.l,g.A(N),b.A(j),_.ls(j,N,C)?(W.K(N),W.W(1e3*C,1e3*C),q.K(j),q.W(1e3*C,1e3*C),F.K(W),F.Ea(q),!(10N;N++){var j=O.charAt(N);if(j!="*"&&j!="T"&&j!="F"&&j!="0"&&j!="1"&&j!="2")throw A.i.fa("relation string")}if((N=this.MR(O,g.Db(),b.Db()))!=0)return A.ud.zB(g,b,C,N,F);N=new A.l,g.A(N),j=new A.l,b.A(j);var W=new A.l;if(W.K(N),W.Zb(j),C=A.ta.Wd(C,W,!1),g=this.WE(g,C),b=this.WE(b,C),g.B()||b.B())return this.uW(g,b,O);switch(N=g.getType(),j=b.getType(),W=!1,N){case 1736:switch(j){case 1736:W=this.rt(g,b,C,O,F);break;case 1607:W=this.$m(g,b,C,O,F);break;case 33:W=this.qt(g,b,C,O);break;case 550:W=this.pt(g,b,C,O,F)}break;case 1607:switch(j){case 1736:W=this.$m(b,g,C,this.Zp(O),F);break;case 1607:W=this.gB(g,b,C,O,F);break;case 33:W=this.tt(g,b,C,O,F);break;case 550:W=this.st(g,b,C,O,F)}break;case 33:switch(j){case 1736:W=this.qt(b,g,C,this.Zp(O));break;case 1607:W=this.tt(b,g,C,this.Zp(O),F);break;case 33:W=this.$U(g,b,C,O);break;case 550:W=this.lt(b,g,C,this.Zp(O))}break;case 550:switch(j){case 1736:W=this.pt(b,g,C,this.Zp(O),F);break;case 1607:W=this.st(b,g,C,this.Zp(O),F);break;case 550:W=this.ZA(g,b,C,O,F);break;case 33:W=this.lt(g,b,C,O)}break;default:W=!1}return W},_.rt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.xJ();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Cu(g,b),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Cu(g,b),O=!0):j==1?(N.ly(b),O=!0):j==2&&(N.ZD(g),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Bp(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.Sw=function(g,b,C,O){var F=new _;F.Yi(),F.bj("T*****F**"),F.xJ();var N=new A.l,j=new A.l;g.A(N),b.A(j);var W=!1;return A.ud.dk(N,j,C)&&(F.Cu(g,b),W=!0),W||((N=A.ud.qc(g,b,!1))==4?(F.Cu(g,b),W=!0):N==1?(F.ly(b),W=!0):N==2&&(F.ZD(g),W=!0)),W?this.fg(F.J,F.Xc):(g=(W=new A.gd).Ib(g),N=W.Ib(b),A.Tk.V(W,C,O,!1),C=W.Ne(N).mg(),W.Gp(0,!0,!0),A.rn.V(W,g,-1,!1,O),W.I(g)!=0&&(A.rn.V(W,N,-1,!1,O),F.er(W,O),(b=W.I(N)==0)||(F.Bp(g,N),F.j.Ug(),N=this.fg(F.J,F.Xc))?(g=W.Ne(g),g=(W=new A.gd).Ib(g),N=W.Ib(C),F.er(W,O),F.le=0,F.Yi(),F.bj(b?"T*****F**":"******F**"),F.IB(),F.Bp(g,N),F.j.Ug(),this.fg(F.J,F.Xc)):N))},_.$m=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.IB();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Du(g,b),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Du(g,b),O=!0):j==1&&(N.$D(b),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.kh=N.j.Dp(),_.Jw(b,N.j,N.kh),N.Bp(g,b),N.j.Ep(N.kh),N.j.Ug()),_.fg(N.J,N.Xc)},_.fB=function(g,b,C,O){var F=new _;F.Yi(),F.bj("T*****F**"),F.IB();var N=new A.l,j=new A.l;g.A(N),b.A(j);var W=!1;return A.ud.dk(N,j,C)&&(F.Du(g,b),W=!0),W||((N=A.ud.qc(g,b,!1))==4?(F.Du(g,b),W=!0):N==1&&(F.$D(b),W=!0)),W?this.fg(F.J,F.Xc):(g=(W=new A.gd).Ib(g),b=W.Ib(b),F.Wo(W,C,O),W.I(g)!=0&&(F.Bp(g,b),F.j.Ug(),this.fg(F.J,F.Xc)))},_.pt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.yJ();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Eu(g),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Eu(g),O=!0):j==1&&(N.zN(),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Gy(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.gB=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.eX(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.PG(g,b),W=!0),W||A.ud.qc(g,b,!1)!=4||(N.PG(g,b),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Yh=N.j.Dp(),N.kh=N.j.Dp(),_.Jw(g,N.j,N.Yh),_.Jw(b,N.j,N.kh),N.Bp(g,b),N.j.Ep(N.Yh),N.j.Ep(N.kh),N.j.Ug()),_.fg(N.J,N.Xc)},_.st=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.MJ(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.Vz(g),W=!0),W||A.ud.qc(g,b,!1)!=4||(N.Vz(g),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Yh=N.j.Dp(),_.Jw(g,N.j,N.Yh),N.Gy(g,b),N.j.Ep(N.Yh),N.j.Ug()),_.fg(N.J,N.Xc)},_.ZA=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.RJ(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.yI(),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Gy(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.qt=function(g,b,C,O){var F=new _;F.Yi(),F.bj(O),F.yJ();var N=new A.l;g.A(N),b=b.D();var j=!1;return A.ud.Rw(b,N,C)&&(F.Eu(g),j=!0),j||((C=A.hd.Yd(g,b,C))==1?(F.J[0]=0,F.J[2]=2,F.J[3]=-1,F.J[5]=1,F.J[6]=-1):C==2?(F.J[6]=-1,g.Ke()!=0?(F.J[0]=-1,F.J[3]=0,F.J[2]=2,F.J[5]=1):(F.J[0]=0,F.J[3]=-1,F.J[5]=-1,C=new A.l,g.A(C),F.J[2]=C.ca()==0&&C.R()==0?-1:1)):F.Eu(g)),this.fg(F.J,O)},_.tt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.MJ();var j=new A.l;g.A(j),O=b.D();var W=!1;if(A.ud.Rw(O,j,C)&&(N.Vz(g),W=!0),!W){j=null;var q=W=!1;(N.ea[0]||N.ea[6])&&(A.ud.Yz(g,O,C)?(N.ea[0]&&(j=A.pi.gm(g,F),q=!A.ud.kt(j,O,C),W=!0,N.J[0]=q?-1:0),N.J[6]=-1):(N.J[0]=-1,N.J[6]=0)),N.ea[3]&&(j!=null&&j.B()?N.J[3]=-1:(W||(j==null&&(j=A.pi.gm(g,F)),q=!A.ud.kt(j,O,C),W=!0),N.J[3]=q?0:-1)),N.ea[5]&&(j!=null&&j.B()?N.J[5]=-1:W&&!q?N.J[5]=0:(j==null&&(j=A.pi.gm(g,F)),F=A.ud.Nw(j,b,C),N.J[5]=F?-1:0)),N.ea[2]&&(g.Qb()!=0?N.J[2]=1:((F=new A.de(g.description)).Fd(g,0,g.I()),g=A.ud.Nw(F,b,C),N.J[2]=g?-1:0))}return this.fg(N.J,N.Xc)},_.lt=function(g,b,C,O){var F=new _;F.Yi(),F.bj(O),F.RJ();var N=new A.l;g.A(N),b=b.D();var j=!1;if(A.ud.Rw(b,N,C)&&(F.yI(),j=!0),!j){N=!1,j=!0,C*=C;for(var W=0;WN;N++)F[N]=-1;return A.h.yc(g,b)<=C*C?F[0]=0:(F[2]=0,F[6]=0),F[8]=2,_.fg(F,O)},_.fg=function(g,b){for(var C=0;9>C;C++)switch(b.charAt(C)){case"T":if(g[C]==-1)return!1;break;case"F":if(g[C]!=-1)return!1;break;case"0":if(g[C]!=0)return!1;break;case"1":if(g[C]!=1)return!1;break;case"2":if(g[C]!=2)return!1}return!0},_.uW=function(g,b,C){var O=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(g.B()&&b.B()){for(var F=0;9>F;F++)O[F]=-1;return this.fg(O,C)}return F=!1,g.B()&&(g=b,F=!0),O[0]=-1,O[1]=-1,O[3]=-1,O[4]=-1,O[6]=-1,O[7]=-1,O[8]=2,b=g.getType(),A.aa.Hc(b)?b==1736?g.Ke()!=0?(O[2]=2,O[5]=1):(O[5]=-1,b=new A.l,g.A(b),O[2]=b.ca()==0&&b.R()==0?0:1):(b=g.Qb()!=0,O[2]=b?1:0,O[5]=A.pi.aq(g)?0:-1):(O[2]=0,O[5]=-1),F&&this.vK(O),this.fg(O,C)},_.MR=function(g,b,C){return _.dQ(g)?3:_.UP(g)?4:_.cY(g,b,C)?8:_.CP(g,b,C)?16:_.eP(g)?1:_.EU(g,b,C)?32:0},_.dQ=function(g){return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="F"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="F"&&g.charAt(6)=="F"&&g.charAt(7)=="F"&&g.charAt(8)=="*"},_.UP=function(g){return g.charAt(0)=="F"&&g.charAt(1)=="F"&&g.charAt(2)=="*"&&g.charAt(3)=="F"&&g.charAt(4)=="F"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"},_.cY=function(g,b,C){return(b!=0||C!=0)&&((b!=2||C!=2)&&(g.charAt(0)=="F"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="T"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"||b==1&&C==1&&g.charAt(0)=="F"&&g.charAt(1)=="T"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*")||C!=0&&g.charAt(0)=="F"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="T"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*")},_.CP=function(g,b,C){return b>C?g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*":b==1&&C==1&&g.charAt(0)=="0"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"},_.eP=function(g){return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="F"&&g.charAt(7)=="F"&&g.charAt(8)=="*"},_.EU=function(g,b,C){if(b==C){if(b!=1)return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="T"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*";if(g.charAt(0)=="1"&&g.charAt(1)=="*"&&g.charAt(2)=="T"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*")return!0}return!1},_.Jw=function(g,b,C){g=b.La(g);for(var O=b.Re;O!=-1;O=b.Rf(O))if(b.xd(O)&g){var F=b.Me(O);if(F==-1)b.nn(O,C,0);else{var N=F,j=0;do b.dh(N)&g&&j++,N=b.jc(b.xa(N));while(N!=F);b.nn(O,C,j)}}},_.Zp=function(g){var b=""+g.charAt(0);return b+=g.charAt(3),b+=g.charAt(6),b+=g.charAt(1),b+=g.charAt(4),b+=g.charAt(7),b+=g.charAt(2),(b+=g.charAt(5))+g.charAt(8)},_.prototype.Yi=function(){for(var g=0;9>g;g++)this.J[g]=-2,this.Za[g]=-2},_.vK=function(g){var b=g[1],C=g[2],O=g[5];g[1]=g[3],g[2]=g[6],g[5]=g[7],g[3]=b,g[6]=C,g[7]=O},_.prototype.bj=function(g){for(this.Xc=g,g=0;9>g;g++)this.Xc.charAt(g)!="*"?(this.ea[g]=!0,this.le++):this.ea[g]=!1},_.prototype.UJ=function(){for(var g=0;9>g;g++)this.ea[g]&&this.J[g]==-2&&(this.J[g]=-1,this.ea[g]=!1)},_.prototype.pc=function(g){return this.J[g]!=-2&&(this.J[g]==-1?(this.ea[g]=!1,this.le--,!0):this.Xc.charAt(g)!="T"&&this.Xc.charAt(g)!="F"?!(this.J[g]N?1:0},_.prototype.reset=function(){this.yA=-1},_}(),E=function(){function _(){this.Wm=this.Gl=null,this.fb=new A.Yj,this.fb.RP(),this.$d=new G(this),this.fb.Vo(this.$d)}return _.prototype.HQ=function(){var g=!1;if(this.fw&&(g=this.IQ()),this.g.da(this.X)==1){var b=this.g.Ob(this.X);return g=this.g.wz(b),this.g.PB(b,!0),0>g&&(g=this.g.Xa(b),this.g.pJ(g),this.g.Wg(b,this.g.Ma(g)),!0)}for(this.El=this.g.Ky(),this.wo=this.g.Ky(),b=this.g.Ob(this.X);b!=-1;b=this.g.Rb(b))this.g.gr(b,this.El,0),this.g.gr(b,this.wo,-1);b=new A.ia(0),this.yh=NaN;var C=new A.h;this.et=this.g.da(this.X),this.ro=this.g.Gd(),this.Rs=this.g.Gd();for(var O=this.Gl.rc(this.Gl.je);O!=-1;O=this.Gl.lb(O)){var F=this.Gl.getData(O);if(this.g.Gc(F,C),C.y!=this.yh&&b.size!=0&&(g=this.ut(b)||g,this.$d.reset(),b.clear(!1)),b.add(F),this.yh=C.y,this.et==0)break}for(0=this.MA.length&&this.MA.push(new A.ig);var _=this.MA[this.Cw];return this.Cw++,_},E.prototype.clear=function(){this.wB(this.mo),this.wB(this.$s),this.wB(this.yw),this.Cw=0},E.prototype.Oo=function(_){this.mo.push(this.Ow(_))},E.prototype.ol=function(_){return _==0?this.$s.length:this.yw.length},E.prototype.Vp=function(_,g){return this.SR(_,g).$i},E.prototype.Ea=function(_,g){if(this.mo.length!=2)throw A.i.Qa();this.qa=_;var b=A.lc.ox(.01*_),C=!1,O=this.mo[0],F=this.mo[1];if(g||5&O.$i.zr(F.$i,_,!0)){if(O.$i.getType()==322){var N=O.$i;if(F.$i.getType()==322){g=F.$i;var j=A.yb.Zx(N,g,null,this.Fq,this.Bk,_);if(j==0)throw A.yb.Zx(N,g,null,this.Fq,this.Bk,_),A.i.Qa();_=Array(9),A.O.$u(_,null);for(var W=0;Wb&&(C=!0)):ee>Ee?(N.hc(q,pt),q=new A.h,g.hc(J,q),A.h.yc(pt,q)>b&&(C=!0)):(g.hc(J,pt),ee=new A.h,N.hc(q,ee),A.h.yc(pt,ee)>b&&(C=!0)),_[W]=pt}for(O=0,F=-1,W=0;W<=j;W++)(De=Wthis.Bk[1]&&(De=this.Bk[0],this.Bk[0]=this.Bk[1],this.Bk[1]=De,W=N[0],N[0]=N[1],N[1]=W),O=0,F=-1,W=0;W<=j;W++)(De=W=F;F++){if((g=1>F?this.Fq[F]:1)!=b){var N=this.aB();_.ah(b,g,N),O!=-1&&N.get().Dc(C),F!=1&&N.get().Qc(C),b=g,this.$s.push(this.Ow(N.get()))}O=F}this.Bf.Cb(C)}},E}();A.TC=G}(ye||(ye={})),function(A){var ue=function(){function G(E){this.Ds=this.rk=this.sb=null,this.ag=0,this.zm=!1,this.zf=-1,this.Cl=this.Jd=0,this.gb=-1,this.ib=E,this.ag=this.Wx(this.Cl),this.zm=!1,this.rk=null,this.Ds=new A.h}return G.prototype.BW=function(E){if(this.ib!=E.ib)throw A.i.Hb();this.zf=E.zf,this.Jd=E.Jd,this.gb=E.gb,this.Cl=E.Cl,this.ag=E.ag,this.zm=E.zm,this.rk=null},G.prototype.ha=function(){if(this.zf!=this.Jd&&this.BD(),this.zm)this.Jd=(this.Jd+1)%this.ag;else{if(this.Jd==this.ag)throw A.i.ce();this.Jd++}return this.rk},G.prototype.li=function(){if(this.zm)this.Jd=(this.ag+this.Jd-1)%this.ag;else{if(this.Jd==0)throw A.i.ce();this.Jd--}return this.Jd!=this.zf&&this.BD(),this.rk},G.prototype.DW=function(){this.zf=-1,this.Jd=0},G.prototype.EW=function(){this.Jd=this.ag,this.zf=-1},G.prototype.Vb=function(E,_){if(_===void 0&&(_=-1),0<=this.gb&&this.gb=g&&E=this.ib.Ba(_)&&E=this.ib.da())&&(this.zf=-1,this.Jd=0,this.ag=this.Wx(this.gb),this.ib.Ba(this.gb),this.ib.dc(this.gb),this.Cl++,!0)},G.prototype.Zi=function(){this.ag=this.Jd=this.zf=-1,this.Cl=0,this.gb=-1},G.prototype.Wx=function(E){if(this.ib.Ac())return 0;var _=1;return this.ib.dc(E)&&(_=0),this.ib.Ja(E)-_},G.prototype.On=function(){return this.zf==this.ag-1&&this.ib.dc(this.gb)},G.prototype.JB=function(){this.zm=!0},G.prototype.wb=function(){return this.ib.nb.o[this.gb]+this.zf},G.prototype.IM=function(){return this.ib.Ba(this.gb)},G.prototype.ik=function(){return this.On()?this.ib.Ba(this.gb):this.wb()+1},G.prototype.vm=function(){return this.zf==0},G.prototype.Qn=function(){return this.zf==this.ag-1},G.prototype.Ha=function(){return this.Jdthis.Jd||this.Jd>=this.ag)throw A.i.ce();this.zf=this.Jd;var E=this.wb();this.ib.mc();var _=this.ib.Ve,g=1;switch(_!=null&&(g=7&_.read(E)),_=this.ib.description,g){case 1:this.sb==null&&(this.sb=new A.yb),this.rk=this.sb;break;case 2:throw A.i.fa("internal error");default:throw A.i.Qa()}this.rk.Nf(_),g=this.ik(),this.ib.Gc(E,this.Ds),this.rk.Dc(this.Ds),this.ib.Gc(g,this.Ds),this.rk.Qc(this.Ds);for(var b=1,C=_.Aa;bC&&(O=_,_=b,b=O,O=g,g=C,C=O,O=-1),!(0>C||g>=this.pl)){0>_&&0>b?b=_=-1:_>=this.oi&&b>=this.oi&&(b=_=this.oi);var F=(b-_)/(C-g);C>this.pl&&(b=F*((C=this.pl)-g)+_),0>g&&(_=F*(0-g)+_,g=0);var N=Math.max(this.oi+1,8388607);-8388607>_?(g=(0-_)/F+g,_=0):_>N&&(g=(this.oi-_)/F+g,_=this.oi),-8388607>b?C=(0-_)/F+g:b>N&&(C=(this.oi-_)/F+g),(g=A.O.truncate(g))!=(C=A.O.truncate(C))&&((b=new ue).x=A.O.truncate(4294967296*_),b.y=g,b.H=C,b.WP=A.O.truncate(4294967296*F),b.dir=O,this.Wl==null&&(this.Wl=A.O.lg(this.pl,null)),b.next=this.Wl[b.y],this.Wl[b.y]=b,b.ythis.Kw&&(this.Kw=b.H),this.Tq++)}}},E.prototype.sN=function(){if(this.Jh!=null){for(var _=!1,g=null,b=this.Jh;b!=null;)if(b.y++,b.y==b.H){var C=b;b=b.next,g!=null?g.next=b:this.Jh=b,C.next=null}else b.x+=b.WP,g!=null&&g.x>b.x&&(_=!0),g=b,b=b.next;_&&(this.Jh=this.fK(this.Jh))}},E.prototype.lN=function(_){if(!(_>=this.pl)){var g=this.Wl[_];if(g!=null){this.Wl[_]=null,g=this.fK(g),this.Tq-=this.gK,_=this.Jh;for(var b=!0,C=g,O=null;_!=null&&C!=null;)_.x>C.x?(b&&(this.Jh=C),b=C.next,C.next=_,O!=null&&(O.next=C),O=C,C=b):(b=_.next,_.next=C,O!=null&&(O.next=_),O=_,_=b),b=!1;this.Jh==null&&(this.Jh=g)}}},E.eK=function(_,g){return 0>_?0:_>g?g:_},E.prototype.ZP=function(){if(this.Jh!=null){for(var _=0,g=this.Jh,b=A.O.truncate(A.O.XG(g.x)),C=g.next;C!=null;C=C.next)if(_=this.kF?1^_:_+C.dir,C.x>g.x){var O=A.O.truncate(A.O.XG(C.x));_!=0&&(g=E.eK(b,this.oi),(b=E.eK(O,this.oi))>g&&gthis.Kf[1].x&&(_=this.Kf[0],this.Kf[0]=this.Kf[1],this.Kf[1]=_):E.AN(this.Kf,g,function(O,F){return O==F?0:O.xF.x?1:0}),_=this.Kf[0],this.Kf[0]=null,b=_,C=1;Cthis.Wh.size)break;var j=this;for(this.xe.Vd(0,this.xe.size,function(W,q){return j.pM(W,q)}),g=0,b=this.xe.size;gDe?1:ptEt?1:0)==0&&(pt=(ee=j[W*ee+3])<(he=j[W*he+3])?-1:ee==he?0:1),pt}),this.Pq=this.g.Gd(),this.oe=new A.jp,this.RA=this.oe.Ph(0),this.oe.fn(g),C=0;Cj;j++){for(W=ee[j],q=g[j],J=j-1;0<=J&&ee[J]>W;)ee[J+1]=ee[J],g[J+1]=g[J],J--;ee[J+1]=W,g[J+1]=q}return ee=0,g[0]!=0&&(ee|=1),g[1]!=0&&(ee|=2),g[2]!=0&&(ee|=4),g[3]!=0&&(ee|=8),(ee==5||ee==10)&&(E==_?E?(this.g.Bc(N,b),this.g.Cc(b,N),this.g.Bc(C,F),this.g.Cc(F,C)):(this.g.Cc(N,b),this.g.Bc(b,N),this.g.Cc(C,F),this.g.Bc(F,C)):E?(this.g.Cc(b,O),this.g.Bc(O,b),this.g.Cc(F,C),this.g.Bc(C,F)):(this.g.Bc(b,O),this.g.Cc(O,b),this.g.Bc(F,C),this.g.Cc(C,F)),!0)},G.prototype.tD=function(E,_,g,b,C,O){this.MY?this.VM():this.UM(E,_,g,b,C,O)},G.prototype.VM=function(){throw A.i.fa("not implemented.")},G.prototype.UM=function(E,_,g,b,C,O){if(E!=_)E?(this.g.Bc(g,C),this.g.Cc(C,g),this.g.Bc(O,b),this.g.Cc(b,O),this.vn(C,g),this.ui(C,!0),this.g.mi(C,!0),this.bk(g),this.vn(O,b),this.ui(O,!0),this.g.mi(O,!1)):(this.g.Bc(C,g),this.g.Cc(g,C),this.g.Bc(b,O),this.g.Cc(O,b),this.vn(C,g),this.ui(C,!0),this.g.mi(C,!1),this.bk(g),this.vn(O,b),this.ui(O,!0),this.g.mi(O,!0)),this.bk(b);else{var F=E?g:b,N=_?C:O;for(E=E?b:g,_=_?O:C,C=!1,this.g.Bc(F,N),this.g.Bc(N,F),this.g.Cc(E,_),this.g.Cc(_,E),O=_;O!=N;)g=this.g.Ma(O),b=this.g.U(O),this.g.Cc(O,b),this.g.Bc(O,g),C=C||O==F,O=b;C||(g=this.g.Ma(N),b=this.g.U(N),this.g.Cc(N,b),this.g.Bc(N,g)),this.vn(N,F),this.ui(N,!0),this.g.mi(N,!1),this.bk(F),this.vn(_,E),this.ui(_,!0),this.g.mi(_,!1),this.bk(E)}},G.prototype.cD=function(){for(var E=!1,_=this.g.Ob(this.X);_!=-1;){for(var g=this.g.Xa(_),b=0,C=this.g.Ja(_);bthis.g.Ja(_)){for(E=this.g.Xa(_),b=0,C=this.g.Ja(_);b=_)throw A.i.N("Invalid or unsupported wkid: "+_);var g=new E;return g.dg=_,g},E.qP=function(_){if(_==null||_.length==0)throw A.i.N("Cannot create SpatialReference from null or empty text.");var g=new E;return g.wh=_,g},E.prototype.Nb=function(_){return this==_||_!=null&&this.constructor==_.constructor&&this.dg==_.dg&&(this.dg!=0||this.wh===_.wh)},E.prototype.toString=function(){return"[ tol: "+this.Kn()+"; wkid: "+this.Ec()+"; wkt: "+this.Bz()+"]"},E.prototype.cc=function(){if(this.pp!=="")return this.pp;var _=this.toString();if(Array.prototype.reduce)return this.pp="S"+_.split("").reduce(function(C,O){return(C=(C<<5)-C+O.charCodeAt(0))&C},0);var g=0;if(_.length===0)return"";for(var b=0;b<_.length;b++)g=(g<<5)-g+_.charCodeAt(b),g&=g;return this.pp="S"+g},E.prototype.Kn=function(){return this.Xd(0)},E.prototype.fh=function(){return this.su!==null?this.su:this.su=A.gu.yP(this)},E.ZN=2147483645,E.$N=9007199254740990,E}();A.Eg=G}(ye||(ye={})),function(A){var ue=function(G){function E(){var _=G!==null&&G.apply(this,arguments)||this;return _.Ji=null,_.ST=null,_.Hq=new A.ZL,_.Eo=null,_.jw=null,_}return me(E,G),E.yP=function(_){var g=new E;if(g.dg=_.dg,g.Ho=_.Ho,g.ZH=_.ZH,g.wh=_.wh,g.wh!==""&&g.wh!==null){_=E.kM(g.wh);var b=E.iM(g.wh);g.Hq.Xx(_,b,A.hu.Integer64),g.by(_),g.gy(b),g.dg=_.$r()}else _=E.jM(g.dg),g.by(_),g.gy(null),g.Hq.Xx(_,null,A.hu.Integer64);return g},E.prototype.Xd=function(_){return this.Hq.Kn(_)},E.iM=function(_){if(0>=_.length)throw A.i.N();var g=null;try{g=A.NC.fromString(_)}catch{g=null}return g==null?null:E.bD(g,!0)},E.prototype.by=function(_){this.Kd=_,this.Eo=this.Kd.Hd()},E.prototype.gy=function(_){this.KH=_,this.ST=this.KH!=null?this.KH.Eo:null},E.prototype.Wc=function(){return this.Sb()!=0&&this.Sb()!=3&&this.Kd.Wc()},E.prototype.IG=function(){return this.Sb()!=0&&(this.Sb()==3?this.Ji.fk().Wc():this.Kd.Wc())},E.prototype.eh=function(){return this.Kd!=null?this.Kd.Ue:null},E.prototype.pm=function(){return this.Kd.pm()},E.prototype.bf=function(){return this.Kd.bf()},E.prototype.hh=function(){return this.Kd!=null?this.Kd.sw:NaN},E.prototype.Up=function(){return this.Kd.Up()},E.prototype.Wr=function(){return this.Kd.Wr()},E.prototype.kk=function(){return this.Kd.kk()},E.prototype.kS=function(_){return A.OC.Py(this.Kd,_.Kd)},E.prototype.ml=function(){return this.Kd.ml()},E.prototype.Vr=function(){return this.Kd.Vr()},E.prototype.zi=function(){return this.Sb()==3?this.Ji.fk().zi():this.Kd.zi()},E.prototype.gh=function(){if(!this.Wc())throw A.i.N("!isPannable()");var _=new A.l;return this.Kd.gh(_),_},E.prototype.Oe=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.so},E.prototype.HR=function(){if(!this.Wc())throw A.i.N("!isPannable()");var _=new A.l;return this.Kd.GR(_),_},E.prototype.pv=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.pv()},E.prototype.ov=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.ov()},E.prototype.Xr=function(){return this.Ji!=null?this.Ji.fk().Xr():this.Kd.Xr()},E.prototype.PQ=function(){return this.Kd.hv()},E.prototype.Qp=function(){return this.Eo.getUnitFactor()},E.prototype.vz=function(_){return this.Hq.vz(_)},E.prototype.sc=function(){var _=this.Sb();if(_==1)return this;if(_==3)return this.Ji.fk().sc();if(_==0||_===4)throw A.i.fa("invalid call");if(this.jw!==null)return this.jw;if((_=this.eh().getGeogcs())==null)throw A.i.Qa();return this.jw=E.bF(_,this.Hq.VF())},E.bF=function(_,g){if(_==null)throw A.i.N("null pointer.");var b=new E;return _=E.mu(_,!0),b.Hq.Xx(_,null,g),b.by(_),b.gy(null),b.dg=_.$r(),b},E.prototype.Sb=function(){var _=this.eh();if(_!=null)switch(_.getType()){case A.Sc.PE_TYPE_GEOGCS:return 1;case A.Sc.PE_TYPE_PROJCS:return 2}return 4},E.prototype.hv=function(){return this.Kd.hv()},E.mu=function(_,g){var b=_.getCode();if(0>=b&&0<(b=A.pf.getCode(_))){if((_=A.pf.coordsys(b))==null)throw A.i.N("Text to wkid mapping had failed: "+b);return E.mu(_,g)}if(g&&0=b?_:A.pf.coordsys(b),_=new A.OC(_),E.lK[g]=_,0=_)throw A.i.N("Invalid or unsupported wkid: "+_);var g=E.qx[_];if(g!=null)return g;if((g=A.pf.coordsys(_))==null)throw A.i.N("Invalid or unsupported wkid: "+_);return(g=E.mu(g,!1)).$r()!=_&&(E.qx[_]=g),g},E.kM=function(_){if(_==null||_===void 0||_.length==0)throw A.i.N("Cannot create SpatialReference from null or empty text.");var g=null;try{g=A.pf.fromString(A.Sc.PE_TYPE_COORDSYS,_)}catch(b){throw A.i.N("Cannot create SpatialReference from text. "+b.message)}if(g===null)throw A.i.N("Cannot create SpatialReference from text. ");return E.mu(g,!0)},E.bD=function(_,g){var b,C=_.getCode();if(0>=C&&0<(C=A.pf.getCode(_))){if((C=A.pf.vertcs(C))===null)throw A.i.N();return E.bD(C,g)}if(g&&0=C||(b=A.pf.vertcs(C)),b===null)throw A.i.N();return b=new A.PL(b),E.mK[_]=b,0g&&(this.Pj=g/(C-this.Fm)),b=this.Gm+b,(O=A.O.truncate((b-this.Gm)*this.Pj))>g&&(this.Pj=g/(b-this.Gm))}},_.prototype.aC=function(g){switch(g){case 0:this.Ik=void 0;case 1:this.Mq=void 0;case 2:this.Lq=void 0}},_.prototype.Kn=function(g){switch(g){case 0:return this.Ik;case 1:return this.Mq;case 2:return this.Lq}return 0},_.prototype.vz=function(g){if(this.Rm==ue.FloatingPoint)return 0;switch(g){case 0:return 1/this.Pj;case 1:case 2:return 1/this.Fo;default:return 0}},_.prototype.toString=function(){var g="SRPD [m_toleranceXY: "+this.Ik.toString();return(g=(g=(g=(g=(g=(g=(g=(g=(g=g+";m_falseX: "+this.Fm.toString())+";m_falseY: "+this.Gm.toString())+";m_unitsXY: "+this.Pj.toString())+";m_falseZ: "+this.sA.toString())+";m_unitsZ: "+this.Fo.toString())+";m_falseM: "+this.rA.toString())+";m_toleranceZ: "+this.Mq.toString())+";m_toleranceM: "+this.Lq.toString())+";m_precision: "+this.Rm.toString())+"] "},_}();A.ZL=E}(ye||(ye={})),function(A){function ue(C,O){return 89.99999O&&(O=-89.99999),O*=.017453292519943,[111319.49079327169*C,31890685e-1*Math.log((1+Math.sin(O))/(1-Math.sin(O)))]}function G(C,O,F){return C=C/6378137*57.29577951308232,F?[C,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*O/6378137)))]:[C-360*Math.floor((C+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*O/6378137)))]}function E(C,O,F){var N=C.Of();if(C.getType()===33)O=O(N.Lg(),N.ih()),N.Cb(O[0],O[1]);else if(C.getType()===197){var j=O(C.es(),C.gs(),F);O=O(C.ds(),C.fs(),F),N.K(j[0],j[1],O[0],O[1])}else for(j=new A.h,C=0;CF&&(F=637.100877141506);for(var N,j=[],W=0;Wthis.Hg&&this.Dz(E)},G.prototype.tx=function(E,_){E*=this.stride,_*=this.stride;for(var g=0;gthis.ns.va)return 1;O=C.na==C.la;var F=b.na==b.la;if(O||F){if(O&&F)return 0;if(C.na==b.na&&C.sa==b.sa)return O?1:-1;if(C.la==b.la&&C.pa==b.pa)return O?-1:1}return(O=C.Pe(this.yh,this.ms.oa))==(F=b.Pe(this.yh,this.ns.oa))&&((F=.5*((O=Math.min(C.la,b.la))+this.yh))==this.yh&&(F=O),O=C.Pe(F,this.ms.oa),F=b.Pe(F,this.ns.oa)),OF?1:0},g.prototype.aK=function(b){this.yh=b},g}(),_=function(){function g(b){this.ib=b,this.WH=new A.ig,this.Bf=new A.h,this.wA=new A.Nc}return g.prototype.kX=function(b){this.Bf.L(b)},g.prototype.compare=function(b,C){return this.ib.pB(b.ja(C),this.WH),b=this.WH.get(),this.wA.K(b.sa,b.pa),this.Bf.xthis.wA.va?1:(b=b.Pe(this.Bf.y,this.Bf.x),this.Bf.xb?1:0)},g}();ue=function(){function g(){this.hH=this.Di=this.Gi=this.kA=this.Yn=this.ye=this.Kc=this.jh=this.ge=null,this.Go=this.xg=-1,this.gH=!0,this.pA=!1,this.lA=NaN,this.Ni=new A.Md,this.bO=2147483647,this.aO=A.O.truncate(-2147483648),this.cg=this.ae=this.Hl=this.Cq=this.Cm=this.Bq=this.Os=this.Re=-1,this.wa=0}return g.prototype.yy=function(b){this.lA=b},g.prototype.Ym=function(){this.ge==null&&(this.ge=new A.$c(8));var b=this.ge.Ce();return this.ge.S(b,1,0),b},g.prototype.vU=function(){this.Kc==null&&(this.Kc=new A.$c(8));var b=this.Kc.Ce();this.Kc.S(b,2,0),this.Kc.S(b,3,0);var C=this.Kc.Ce();return this.Kc.S(C,2,0),this.Kc.S(C,3,0),this.JJ(b,C),this.JJ(C,b),b},g.prototype.mI=function(){this.ye==null&&(this.ye=new A.$c(8));var b=this.ye.Ce();return this.ye.S(b,2,0),b},g.prototype.TW=function(b,C){this.ge.S(b,7,C)},g.prototype.mn=function(b,C){this.ge.S(b,2,C)},g.prototype.SW=function(b,C){this.ge.S(b,1,C)},g.prototype.lX=function(b,C){this.ge.S(b,3,C)},g.prototype.iX=function(b,C){this.ge.S(b,4,C)},g.prototype.cr=function(b,C){this.ge.S(b,5,C)},g.prototype.eR=function(b){return this.ge.T(b,5)},g.prototype.RW=function(b,C){this.ge.S(b,6,C)},g.prototype.cN=function(b,C){this.RW(C,b)},g.prototype.IJ=function(b,C){this.Kc.S(b,1,C)},g.prototype.JJ=function(b,C){this.Kc.S(b,4,C)},g.prototype.Tl=function(b,C){this.Kc.S(b,5,C)},g.prototype.Sl=function(b,C){this.Kc.S(b,6,C)},g.prototype.$W=function(b,C){this.Kc.S(b,2,C)},g.prototype.$w=function(b,C){this.Kc.S(b,3,C)},g.prototype.LF=function(b){return this.Kc.T(b,3)},g.prototype.Gt=function(b,C){this.Kc.S(b,7,C)},g.prototype.EK=function(b,C){if(this.mm(b)!=-1)for(C=C?-1:b,b=this.mm(b);b!=-1;b=this.js(b))this.g.Ra(this.tj(b),this.Cq,C)},g.prototype.yx=function(b,C){b!=-1&&(this.EK(b,C),this.EK(this.xa(b),C))},g.prototype.Dt=function(b,C){this.ye.S(b,1,C)},g.prototype.Vg=function(b,C){this.ye.S(b,2,C)},g.prototype.jn=function(b,C){this.ye.S(b,3,C),this.NW(b,this.dR(C)),this.MW(C,b)},g.prototype.MW=function(b,C){this.ye.S(b,4,C)},g.prototype.NW=function(b,C){this.ye.S(b,5,C)},g.prototype.DJ=function(b,C){this.ye.S(b,6,C)},g.prototype.BJ=function(b,C){this.ye.S(b,7,C)},g.prototype.AJ=function(b,C){this.Yn.write(b,C)},g.prototype.CJ=function(b,C){this.kA.write(b,C)},g.prototype.kY=function(b){var C=0,O=0,F=this.AF(b),N=new A.h,j=new A.h,W=new A.h;this.Yr(F,N),j.L(N);var q=F;do this.lm(q,W),O+=A.h.tb(j,W),this.$e(this.xa(q))!=b&&(C+=(W.x-N.x-(j.x-N.x))*(W.y-N.y+(j.y-N.y))*.5),j.L(W),q=this.jc(q);while(q!=F);this.Yn.write(b,C),this.kA.write(b,O)},g.prototype.PU=function(b,C){var O=new E(this),F=new A.Yj;F.De(A.O.truncate(this.wa/2)),F.Vo(O);for(var N=new A.ia(0),j=this.$g(),W=null,q=0,J=new A.h,ee=this.Re;ee!=-1;ee=this.Rf(ee)){if(!(255&++q)&&C!=null&&!C.progress(-1,-1))throw A.i.WC();var he=this.Me(ee);if(he!=-1){if(N.Bh(0),!this.gY(F,j,N,he)){this.D(ee,J),O.aK(J.y);var Ee=he;do{var De=this.Ab(Ee,j);De!=-1&&(F.vd(De,-1),this.Kb(Ee,j,-2)),Ee=this.jc(this.xa(Ee))}while(he!=Ee);Ee=he;do(De=this.Ab(Ee,j))==-1&&(De=F.addElement(Ee,-1),N.add(De)),Ee=this.jc(this.xa(Ee));while(he!=Ee)}for(he=N.size-1;0<=he;he--)De=N.get(he),Ee=F.ja(De),this.Kb(this.xa(Ee),j,De),this.OU(F,De,b)}else this.cz(ee)==-1&&(W==null&&(W=new _(this)),this.D(ee,J),W.kX(J),Ee=F.IW(W),he=this.Hl,Ee!=-1&&(De=F.ja(Ee),this.$e(De)==this.$e(this.xa(De))&&(De=this.OF(F,Ee)),De!=-1&&(he=this.$e(De))),this.cN(he,ee))}this.Jg(j)},g.prototype.OU=function(b,C,O){var F=b.ja(C),N=this.$e(F);if(this.Gn(N)==-1){var j=this.OF(b,C),W=this.xa(F),q=this.$e(W);this.Kp(N),this.Kp(q);var J=this.Gn(N),ee=this.Gn(q);if(j==-1&&J==-1&&(q==N?(this.jn(q,this.Hl),J=ee=this.Hl):(ee==-1&&(this.jn(q,this.Hl),ee=this.Hl),this.jn(N,q),J=q)),j!=-1){var he=this.$e(j);ee==-1&&(0>=this.Kp(he)?(ee=this.Gn(he),this.jn(q,ee)):(this.jn(q,he),ee=he),q==N&&(J=ee))}J==-1&&this.hY(N,q),O==0?this.jW(b,C,F,j,N,q):O==5?this.kW(b,C,F,W,N,q):O==4&&this.iW(F,j,N,q)}},g.prototype.jW=function(b,C,O,F,N,j){var W=this.hk(N);if(F!=-1){var q=this.hk(j),J=this.hk(this.$e(F));F=W&q&J,J^=J&this.dh(O),(J|=F)!=0&&(this.Vg(j,q|J),this.Vg(N,J|W),W=W||J)}for(C=b.lb(C);C!=-1&&(F=b.ja(C),O=this.$e(this.xa(F)),N=this.hk(O),j=this.dh(F),q=this.$e(F),F=N&(J=this.hk(q))&W,W^=W&j,(W|=F)!=0);C=b.lb(C))this.Vg(O,N|W),this.Vg(q,J|W)},g.prototype.kW=function(b,C,O,F,N,j){if(N!=j){O=this.Ab(O,this.cg),O+=this.Ab(F,this.cg),F=0;var W=new A.ia(0),q=new A.ia(0);q.add(0);for(var J=b.rc(-1);J!=C;J=b.lb(J)){var ee=b.ja(J),he=this.xa(ee),Ee=this.$e(ee),De=this.$e(he);if(Ee!=De){if(ee=this.Ab(ee,this.cg),F+=ee+=this.Ab(he,this.cg),he=!1,W.size!=0&&W.Fc()==De&&(q.If(),W.If(),he=!0),this.Gn(De)==-1)throw A.i.Qa();he&&this.Gn(De)==Ee||(q.add(F),W.add(Ee))}}F+=O,W.size!=0&&W.Fc()==j&&(q.If(),W.If()),F!=0?q.Fc()==0&&(b=this.g.ld,b=this.La(b),this.Vg(N,b)):q.Fc()!=0&&(b=this.g.ld,b=this.La(b),this.Vg(N,b))}},g.prototype.iW=function(b,C,O,F){var N=this.La(this.g.ld);if(C==-1)this.Vg(F,this.Go),1&(b=this.Ab(b,this.xg))?this.Vg(O,N):this.Vg(O,this.Go);else{var j=this.hk(F);j==0?(j=this.hk(this.$e(C)),this.Vg(F,j),1&(b=this.Ab(b,this.xg))?this.Vg(O,j==N?this.Go:N):this.Vg(O,j)):1&(b=this.Ab(b,this.xg))?this.Vg(O,j==N?this.Go:N):this.Vg(O,j)}},g.prototype.gY=function(b,C,O,F){var N=F,j=-1,W=-1,q=0;do{if(q==2)return!1;var J=this.Ab(N,C);if(J!=-1){if(j!=-1)return!1;j=J}else{if(W!=-1)return!1;W=N}q++,N=this.jc(this.xa(N))}while(F!=N);return W!=-1&&j!=-1&&(this.Kb(b.ja(j),C,-2),b.Sj(j,W),O.add(j),!0)},g.prototype.hY=function(b,C){var O=this.Kp(b);if(O!=0){var F=this.Kp(C);0F||0>O&&0ee.compare(N)?J=1:j=-1,this.Kb(Ee,this.ae,0),this.Kb(he,this.ae,0),this.Kb(he,this.cg,J),this.Kb(Ee,this.cg,j)):b==7?(this.Kb(Ee,this.ae,this.Go),this.Kb(he,this.ae,q==1736?W:0)):b==4&&(this.Kb(Ee,this.ae,0),this.Kb(he,this.ae,0),this.Kb(he,this.xg,1),this.Kb(Ee,this.xg,1)),q=q==1736?this.aO:0,this.$w(he,W|q),this.$w(Ee,W|q)}}}}},g.prototype.VT=function(b,C){var O=this.mm(C);if(O!=-1){var F=this.mm(b);this.jh.S(O,1,F),this.Gt(b,O),this.Gt(C,-1)}b=this.xa(b),C=this.xa(C),(O=this.mm(C))!=-1&&(F=this.mm(b),this.jh.S(O,1,F),this.Gt(b,O),this.Gt(C,-1))},g.prototype.IX=function(b){function C(ei,Xt){return F.HO(ei,Xt)}var O=new A.ia(0);O.Jb(10);for(var F=this,N=this.Re;N!=-1;N=this.Rf(N)){O.clear(!1);var j=this.Me(N);if(j!=-1){var W=j;do O.add(W),W=this.jc(this.xa(W));while(W!=j);if(1_.Db())return G.ki(G.Xe(_.Ia()),E,"&")}return O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.Av(F,_),E=G.ki(C.Ne(b),E,"&"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.bW=function(E,_,g){if(E.B()||_.B())return E.Ia();var b=[null],C=[0],O=_.Db()==2;if(_.Db()!=1&&_.Db()!=2)throw A.i.Qa();return b[0]=E.D(),O?A.hd.sK(_,b,1,g,C):A.hd.tK(_,b,1,g,C),C[0]==0?E.Ia():E},G.prototype.LU=function(E,_,g,b,C){if(E.B())return E;var O=new A.gd;return E=O.Ib(E),this.Mk(O,E,_,g,b,C)},G.prototype.NU=function(E,_,g,b,C,O){if(C&&E.ic(_)!=550){var F=new A.RC;F.TX(E,g),F.Ng?(A.Tk.V(E,g,O,!0),C=!1):this.j.yy(g)}else A.Tk.V(E,g,O,!0),C=!1;if(b&&E.ic(_)!=550?this.j.wJ(E,_,O):this.j.vJ(E,_,O),this.j.pA)return this.j.Ug(),this.j=null,this.Mk(E,_,g,b,!1,O);if(this.j.yy(NaN),O=this.j.La(_),this.bq(O+1),this.Gj[O]=!0,E.ic(_)==1736||b&&E.ic(_)!=550)return E.Yo(_,0),_=this.Ot(_,-1,-1),(E=E.Ne(_)).Yo(0),C?E.Ch(1,0):(E.Ch(2,g),E.fm()),E;if(E.ic(_)==1607)return _=this.Pt(-1),E=E.Ne(_),C||E.Ch(2,g),E;if(E.ic(_)==550)return _=this.mr(),E=E.Ne(_),C||E.Ch(2,g),E;throw A.i.Qa()},G.prototype.Mk=function(E,_,g,b,C,O){this.j=new A.iu;try{return this.NU(E,_,g,b,C,O)}finally{this.j.Ug()}},G.Mk=function(E,_,g,b,C){return new G().LU(E,_,g,b,C)},G.prototype.MU=function(E,_,g,b){this.Mv=E,this.j=new A.iu,E=_.In(g);var C=_.ic(g);if(E!=1||C==550?this.j.vJ(_,g,b):this.j.wJ(_,g,b),!this.j.pA)if(this.j.yy(NaN),b=this.j.La(g),this.bq(b+1),this.Gj[b]=!0,_.ic(g)==1736||E==1&&_.ic(g)!=550)_.Yo(g,0),b=this.Ot(g,-1,-1),_.hC(b,g),_.BB(b);else if(_.ic(g)==1607)b=this.Pt(-1),_.hC(b,g),_.BB(b);else{if(_.ic(g)!=550)throw A.i.fa("internal error");b=this.mr(),_.hC(b,g),_.BB(b)}},G.prototype.im=function(E,_){var g=A.aa.tf(this.j.g.ic(E)),b=A.aa.tf(this.j.g.ic(_));if(g>b)return E;var C=this.j.La(E),O=this.j.La(_);if(this.bq(1+(C|O)),this.Gj[this.j.La(E)]=!0,g==2&&b==2)return this.Ot(E,_,-1);if(g==1&&b==2||g==1&&b==1)return this.Pt(-1);if(g==0)return this.mr();throw A.i.Qa()},G.prototype.Av=function(E,_){var g=A.aa.tf(this.j.g.ic(E)),b=A.aa.tf(this.j.g.ic(_)),C=this.j.La(E),O=this.j.La(_);if(this.bq(1+(C|O)),this.Gj[this.j.La(E)|this.j.La(_)]=!0,C=-1,1_.Db())return G.ki(G.Xe(E),E,"-");var C=new A.l;E.A(C);var O=new A.l;if(_.A(O),!C.isIntersecting(O))return G.ki(G.Xe(E),E,"-");var F=new A.l;return F.K(C),F.Zb(O),g=A.ta.Wd(g,F,!0),O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.im(F,_),b=C.Ne(b),E=G.ki(b,E,"-"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.VP=function(E,_,g){if(2>E.length)throw A.i.N("not enough geometries to dissolve");for(var b=0,C=0,O=E.length;CW?G.Xe(E[q]):(E=b==2,_=A.ta.Wd(b==0?_:null,F,!0),new G().Mk(N,j,_,E,!0,g))},G.Pz=function(E,_,g,b){var C=[null,null,null],O=new A.l;E.A(O);var F=new A.l;_.A(F);var N=new A.l;if(N.K(O),N.Zb(F),g=A.ta.Wd(g,N,!0),(N=new A.l).K(F),F=A.ta.Er(g),N.W(F,F),!O.isIntersecting(N)){if(E.Db()<=_.Db())return C[(E=G.ki(G.Xe(E.Ia()),E,"&")).Db()]=E,C;if(E.Db()>_.Db())return C[(E=G.ki(G.Xe(_.Ia()),E,"&")).Db()]=E,C}for(F=new G,N=(O=new A.gd).Ib(G.Xe(E)),_=O.Ib(G.Xe(_)),F.Ft(O,g,b),b=F.Pz(N,_),_=0;__.Db())return G.ki(G.Xe(E),E,"^");if(E.Db()<_.Db()||E.B())return G.ki(G.Xe(_),E,"^");if(_.B())return G.ki(G.Xe(E),E,"^");var C=new A.l;E.A(C);var O=new A.l;_.A(O);var F=new A.l;return F.K(C),F.Zb(O),g=A.ta.Wd(g,F,!0),O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.ep(F,_),E=G.ki(C.Ne(b),E,"^"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.prototype.LQ=function(E,_){var g=this.j.g;E=g.vf(E,-1);for(var b=_.size,C=0;Cg;g++)_[g]=new A.h;E.nB(_),this.fY(_,_),E.Zw(_,4)}},G.prototype.fY=function(E,_){for(var g=0;g(_=.5*_.Sk())?Math.sqrt(b):Math.sqrt(_))},G.prototype.RB=function(){this.bb=1,this.jb=this.Gb=this.eb=0,this.ab=1,this.Lb=0},G.prototype.isIdentity=function(E){if(E!==void 0){var _=A.h.construct(0,1);return this.Eh(_,_),_.sub(A.h.construct(0,1)),_.Sk()>E*E?!1:(_.ma(0,0),this.Eh(_,_),!(_.Sk()>E*E)&&(_.ma(1,0),this.Eh(_,_),_.sub(A.h.construct(1,0)),_.Sk()<=E*E))}return this.bb==1&&this.ab==1&&this.eb==0&&this.Gb==0&&this.jb==0&&this.Lb==0},G.prototype.Bi=function(E){return Math.abs(this.bb*this.ab-this.jb*this.eb)<=2*E*(Math.abs(this.bb*this.ab)+Math.abs(this.jb*this.eb))},G.prototype.gg=function(E,_){this.bb=1,this.eb=0,this.Gb=E,this.jb=0,this.ab=1,this.Lb=_},G.prototype.setScale=function(E,_){_!==void 0?(this.bb=E,this.jb=this.Gb=this.eb=0,this.ab=_,this.Lb=0):this.setScale(E,E)},G.prototype.$B=function(){this.bb=0,this.eb=1,this.Gb=0,this.jb=1,this.Lb=this.ab=0},G.prototype.setRotate=function(E){this.pX(Math.cos(E),Math.sin(E))},G.prototype.pX=function(E,_){this.bb=E,this.eb=-_,this.Gb=0,this.jb=_,this.ab=E,this.Lb=0},G.prototype.shift=function(E,_){this.Gb+=E,this.Lb+=_},G.prototype.scale=function(E,_){this.bb*=E,this.eb*=E,this.Gb*=E,this.jb*=_,this.ab*=_,this.Lb*=_},G.prototype.flipX=function(E,_){this.bb=-this.bb,this.eb=-this.eb,this.Gb=E+_-this.Gb},G.prototype.flipY=function(E,_){this.jb=-this.jb,this.ab=-this.ab,this.Lb=E+_-this.Lb},G.prototype.rotate=function(E){var _=new G;_.setRotate(E),this.multiply(_)},G.prototype.inverse=function(E){if(E!==void 0){var _=this.bb*this.ab-this.eb*this.jb;_==0?E.lx():(_=1/_,E.Gb=(this.eb*this.Lb-this.Gb*this.ab)*_,E.Lb=(this.Gb*this.jb-this.bb*this.Lb)*_,E.bb=this.ab*_,E.eb=-this.eb*_,E.jb=-this.jb*_,E.ab=this.bb*_)}else this.inverse(this)},G}();A.Dd=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.prototype.lx=function(){this.hg=this.Lb=this.Gb=this.He=this.Fe=this.Ee=this.Ge=this.ab=this.eb=this.Ze=this.jb=this.bb=0},G.prototype.setScale=function(E,_,g){this.bb=E,this.eb=this.Ze=this.jb=0,this.ab=_,this.Fe=this.Ee=this.Ge=0,this.He=g,this.hg=this.Lb=this.Gb=0},G.prototype.setTranslate=function(E,_,g){this.bb=1,this.eb=this.Ze=this.jb=0,this.ab=1,this.Fe=this.Ee=this.Ge=0,this.He=1,this.Gb=E,this.Lb=_,this.hg=g},G.prototype.translate=function(E,_,g){this.Gb+=E,this.Lb+=_,this.hg+=g},G.prototype.mC=function(E){if(!E.B()){for(var _=new A.Nd[8],g=0;8>g;g++)_[g]=new A.Nd;E.nB(_),this.transform(_,8,_),E.Zw(_)}},G.prototype.transform=function(E,_,g){for(var b=0;b<_;b++){var C=new A.Nd,O=E[b];C.x=this.bb*O.x+this.eb*O.y+this.Ee*O.z+this.Gb,C.y=this.jb*O.x+this.ab*O.y+this.Fe*O.z+this.Lb,C.z=this.Ze*O.x+this.Ge*O.y+this.He*O.z+this.hg,g[b]=C}},G.prototype.fp=function(E){var _=new A.Nd;return _.x=this.bb*E.x+this.eb*E.y+this.Ee*E.z+this.Gb,_.y=this.jb*E.x+this.ab*E.y+this.Fe*E.z+this.Lb,_.z=this.Ze*E.x+this.Ge*E.y+this.He*E.z+this.hg,_},G.prototype.Ag=function(E){G.multiply(this,E,this)},G.multiply=function(E,_,g){var b=E.bb*_.bb+E.jb*_.eb+E.Ze*_.Ee,C=E.bb*_.jb+E.jb*_.ab+E.Ze*_.Fe,O=E.bb*_.Ze+E.jb*_.Ge+E.Ze*_.He,F=E.eb*_.bb+E.ab*_.eb+E.Ge*_.Ee,N=E.eb*_.jb+E.ab*_.ab+E.Ge*_.Fe,j=E.eb*_.Ze+E.ab*_.Ge+E.Ge*_.He,W=E.Ee*_.bb+E.Fe*_.eb+E.He*_.Ee,q=E.Ee*_.jb+E.Fe*_.ab+E.He*_.Fe,J=E.Ee*_.Ze+E.Fe*_.Ge+E.He*_.He,ee=E.Gb*_.bb+E.Lb*_.eb+E.hg*_.Ee+_.Gb,he=E.Gb*_.jb+E.Lb*_.ab+E.hg*_.Fe+_.Lb;E=E.Gb*_.Ze+E.Lb*_.Ge+E.hg*_.He+_.hg,g.bb=b,g.jb=C,g.Ze=O,g.eb=F,g.ab=N,g.Ge=j,g.Ee=W,g.Fe=q,g.He=J,g.Gb=ee,g.Lb=he,g.hg=E},G.inverse=function(E,_){var g=E.bb*(E.ab*E.He-E.Ge*E.Fe)-E.jb*(E.eb*E.He-E.Ge*E.Ee)+E.Ze*(E.eb*E.Fe-E.ab*E.Ee);if(g==0)throw A.i.fa("math singularity");var b=1/g;g=(E.ab*E.He-E.Ge*E.Fe)*b;var C=-(E.eb*E.He-E.Ge*E.Ee)*b,O=(E.eb*E.Fe-E.ab*E.Ee)*b,F=-(E.jb*E.He-E.Fe*E.Ze)*b,N=(E.bb*E.He-E.Ze*E.Ee)*b,j=-(E.bb*E.Fe-E.jb*E.Ee)*b,W=(E.jb*E.Ge-E.Ze*E.ab)*b,q=-(E.bb*E.Ge-E.Ze*E.eb)*b;b*=E.bb*E.ab-E.jb*E.eb;var J=-(E.Gb*g+E.Lb*C+E.hg*O),ee=-(E.Gb*F+E.Lb*N+E.hg*j);E=-(E.Gb*W+E.Lb*q+E.hg*b),_.bb=g,_.jb=F,_.Ze=W,_.eb=C,_.ab=N,_.Ge=q,_.Ee=O,_.Fe=j,_.He=b,_.Gb=J,_.Lb=ee,_.hg=E},G.prototype.Of=function(){var E=new G;return E.bb=this.bb,E.jb=this.jb,E.Ze=this.Ze,E.eb=this.eb,E.ab=this.ab,E.Ge=this.Ge,E.Ee=this.Ee,E.Fe=this.Fe,E.He=this.He,E.Gb=this.Gb,E.Lb=this.Lb,E.hg=this.hg,E},G}();A.JY=ue}(ye||(ye={})),function(A){var ue=function(E){function _(g){if(g!==void 0)g=E.call(this,g.cc(),g)||this;else{(g=E.call(this)||this).bg=[],g.bg[0]=0,g.Aa=1,g.uh=[];for(var b=0;10>b;b++)g.uh[b]=-1;g.uh[g.bg[0]]=0}return g.jq=!0,g}return me(_,E),_.prototype.re=function(g){this.hasAttribute(g)||(this.uh[g]=0,this.jD())},_.prototype.removeAttribute=function(g){if(g==0)throw A.i.N("Position attribue cannot be removed");this.hasAttribute(g)&&(this.uh[g]=-1,this.jD())},_.prototype.reset=function(){this.bg[0]=0,this.Aa=1;for(var g=0;gg;g++)0<=this.uh[g]&&(this.bg[b]=g,this.uh[g]=b,b++,this.Aa++);this.jq=!0},_.prototype.cc=function(){return this.jq&&(this.wl=this.An(),this.jq=!1),this.wl},_.prototype.Nb=function(g){if(g==null)return!1;if(g==this)return!0;if(!(g instanceof _)||g.Aa!=this.Aa)return!1;for(var b=0;bO;O++)!g.hasAttribute(O)&&b.hasAttribute(O)&&(C==null&&(C=new _(g)),C.re(O));return C!=null?C.EF():g},_}(A.ra);A.ee=ue;var G=function(){function E(){this.map=[];var _=new ue;this.add(_),(_=new ue).re(1),this.add(_)}return E.kz=function(){return E.bL},E.prototype.$R=function(){return E.ft},E.prototype.add=function(_){var g=_.cc();if(E.ft!=null&&E.ft.cc()==g&&_.GG(E.ft))return E.ft;if(E.Dw!=null&&E.Dw.cc()==g&&_.GG(E.Dw))return E.Dw;var b=null;return this.map[g]!==void 0&&(b=this.map[g]),b==null&&((b=_.tM()).Aa==1?E.ft=b:b.Aa==2&&b.kd(1)==1?E.Dw=b:this.map[g]=b),b},E.bL=new E,E}()}(ye||(ye={}));var ht={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Ht={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},_t=new(function(){function A(){this.RM=50,this.np=new Map,this.gj=[]}return A.prototype.clear=function(){this.gj.length=0,this.np.clear()},A.prototype.delete=function(ue){return!!this.np.delete(ue)&&(this.gj.splice(this.gj.indexOf(ue),1),!0)},A.prototype.get=function(ue){var G=this.np.get(ue);if(G!==void 0)return this.gj[0]!==ue&&(this.gj.splice(this.gj.indexOf(ue),1),this.gj.unshift(ue)),G},A.prototype.has=function(ue){return this.np.has(ue)},A.prototype.set=function(ue,G){return this.get(ue)!==void 0&&this.delete(ue),this.gj.unshift(ue),this.np.set(ue,G),this.oM(),this},A.prototype.oM=function(){for(;this.gj.length&&this.gj.length>this.RM;){var ue=this.gj.pop();this.np.delete(ue)}},A}()),Fe=((Ze={}).convertJSONToGeometry=function(A){return ye.$b.fP(A)},Ze.hasM=function(A){return A.hasAttribute(ye.Ih.M)},Ze.hasZ=function(A){return A.hasAttribute(ye.Ih.Z)},Ze.getPointX=function(A){return A.Lg()},Ze.getPointY=function(A){return A.ih()},Ze.getPointZ=function(A){return A.bS()},Ze.getPointM=function(A){return A.zR()},Ze.getXMin=function(A){return A.es()},Ze.getYMin=function(A){return A.gs()},Ze.getXMax=function(A){return A.ds()},Ze.getYMax=function(A){return A.fs()},Ze.getZExtent=function(A){return A.Tg(ye.Ih.Z,0)},Ze.getMExtent=function(A){return A.Tg(ye.Ih.M,0)},Ze.exportPaths=function(A){var ue=[],G=A.da(),E=null,_=null,g=A.hasAttribute(ye.Ih.Z),b=A.hasAttribute(ye.Ih.M);g&&(E=A.ub(ye.Ih.Z)),b&&(_=A.ub(ye.Ih.M));for(var C=new ye.h,O=0;OHKt)).default({title:t.parsedUrl.title});return await P7r(n,t,r),n}function spt(i,e){return i?i.find(t=>t.id===e):null}async function P7r(i,e,t){function r(s,o,a,l){const u={...t,layerId:o,sublayerTitleMode:"service-name"};return s!=null&&(u.url=s),a!=null&&(u.sourceJSON=a),l(u)}const n=e.sublayerConstructorProvider;for(const{id:s,serverUrl:o}of e.layers){const a=spt(e.sublayerInfos,s),l=(a&&n?.(a))??e.Constructor,u=r(o,s,a,c=>new l(c));i.add(u)}if(e.tables.length){const s=await rbe("FeatureLayer");e.tables.forEach(({id:o,serverUrl:a})=>{const l=r(a,o,spt(e.tableInfos,o),u=>new s(u));i.tables.add(l)})}}async function R7r(i,e){let t=r_(i);if(t==null&&(t=await D7r(i,e)),t==null)throw new qe("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:i});const{serverType:r,sublayer:n}=t;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},a=r==="FeatureServer",l=r==="SceneServer",u={parsedUrl:t,Constructor:null,layerId:a||l?n??void 0:void 0,layers:[],tables:[]};switch(r){case"MapServer":n!=null?s="FeatureLayer":s=await L7r(i,e)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const c=await IS(i,{customParameters:e}),{tileInfo:h,cacheType:p}=c;s=h?h?.format?.toUpperCase()!=="LERC"||p&&p.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const c=await IS(t.url.path,{customParameters:e});if(s="SceneLayer",c){const h=c?.layers;if(c?.layerType==="Voxel")s="VoxelLayer";else if(h?.length){const p=h[0]?.layerType;p!=null&&_ie[p]!=null&&(s=_ie[p])}}break}case"3DTilesServer":throw new qe("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(s="FeatureLayer",n!=null){const c=await IS(i,{customParameters:e});u.sourceJSON=c,c.type==="Oriented Imagery Layer"&&(s="OrientedImageryLayer")}break;default:s=o[r]}if(M7r[s]&&n==null){const c=await F7r(i,r,e);if(a&&(u.sublayerInfos=c.layerInfos,u.tableInfos=c.tableInfos),c.layers.length+c.tables.length!==1)u.layers=c.layers,u.tables=c.tables,a&&c.layerInfos?.length&&(u.sublayerConstructorProvider=await N7r(c.layerInfos));else if(a||l){const h=c.layerInfos?.[0]??c.tableInfos?.[0];u.layerId=c.layers[0]?.id??c.tables[0]?.id,u.sourceJSON=h,a&&h?.type==="Oriented Imagery Layer"&&(s="OrientedImageryLayer")}}return u.Constructor=await rbe(s),u}async function D7r(i,e){const t=await IS(i,{customParameters:e});let r=null,n=null;const s=t.type;if(s==="Feature Layer"||s==="Table"?(r="FeatureServer",n=t.id??null):s==="indexedVector"?r="VectorTileServer":t.hasOwnProperty("mapName")?r="MapServer":t.hasOwnProperty("bandCount")&&t.hasOwnProperty("pixelSizeX")?r="ImageServer":t.hasOwnProperty("maxRecordCount")&&t.hasOwnProperty("allowGeometryUpdates")?r="FeatureServer":t.hasOwnProperty("streamUrls")?r="StreamServer":opt(t)?(r="SceneServer",n=t.id):t.hasOwnProperty("layers")&&opt(t.layers?.[0])&&(r="SceneServer"),!r)return null;const o=n!=null?fOt(i):null;return{title:o!=null&&t.name||o2e(i),serverType:r,sublayer:n,url:{path:o!=null?o.serviceUrl:Yo(i).path}}}function opt(i){return i!=null&&i.hasOwnProperty("store")&&i.hasOwnProperty("id")&&typeof i.id=="number"}async function F7r(i,e,t){let r,n,s=!1;switch(e){case"FeatureServer":{const l=await bXe(i,{customParameters:t});s=!!l.layersJSON,r=l.layersJSON||l.serviceJSON;break}case"SceneServer":{const l=await k7r(i,t);r=l.serviceInfo,n=l.tableServerUrl;break}default:r=await IS(i,{customParameters:t})}const o=r?.layers,a=r?.tables;return{layers:o?.map(l=>({id:l.id})).reverse()||[],tables:a?.map(l=>({serverUrl:n,id:l.id})).reverse()||[],layerInfos:s?o:[],tableInfos:s?a:[]}}async function k7r(i,e){const t=await IS(i,{customParameters:e});if(!t.layers?.[0])return{serviceInfo:t};try{const{serverUrl:n}=await lle(i),s=await IS(n,{customParameters:e}).catch(()=>null);return s&&(t.tables=s.tables),{serviceInfo:t,tableServerUrl:n}}catch{return{serviceInfo:t}}}async function rbe(i){return(0,xv[i])()}async function L7r(i,e){return(await IS(i,{customParameters:e})).tileInfo}async function N7r(i){const e=[],t=[];if(i.forEach(s=>{const{type:o}=s;o==="Oriented Imagery Layer"?(e.push(o),t.push(rbe("OrientedImageryLayer"))):(e.push(o),t.push(rbe("FeatureLayer")))}),!t.length)return;const r=await Promise.all(t),n=new Map;return e.forEach((s,o)=>{n.set(s,r[o])}),s=>n.get(s.type)}const $7r=Object.freeze(Object.defineProperty({__proto__:null,fromUrl:O7r},Symbol.toStringTag,{value:"Module"}));function ZBt(i){return mW(i)||t1e(i)||i1e(i)}function QBt(i,e){const{format:t,timeZoneOptions:r,fieldType:n}=e??{};let s,o;if(r&&({timeZone:s,timeZoneName:o}=IAt(r.layerTimeZone,r.datesInUnknownTimezone,r.viewTimeZone,T6(t||"short-date-short-time"),n)),typeof i=="string"&&isNaN(Date.parse(n==="time-only"?`1970-01-01T${i}Z`:i)))return i;switch(n){case"date-only":{const a=T6(t||"short-date");return typeof i=="string"?oZi(i,{...a}):vb(i,{...a,timeZone:y0})}case"time-only":{const a=T6(t||"short-time");return typeof i=="string"?aZi(i,a):vb(i,{...a,timeZone:y0})}case"timestamp-offset":{if(!s&&typeof i=="string"&&new Date(i).toISOString()!==i)return i;const a=t||r?T6(t||"short-date-short-time"):void 0,l=a?{...a,timeZone:s,timeZoneName:o}:void 0;return typeof i=="string"?lZi(i,l):vb(i,l)}default:{const a=t||r?T6(t||"short-date-short-time"):void 0;return vb(typeof i=="string"?new Date(i):i,a?{...a,timeZone:s,timeZoneName:o}:void 0)}}}const B7r="",j7r="equal-interval",G7r=1,U7r=5,z7r=10,V7r=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,H7r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),W7r=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),q7r=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function RC(i){return i==null||typeof i=="string"&&!i?B7r:i}function wXe(i){const e=i.normalizationField!=null||i.normalizationType!=null,t=i.minValue!=null||i.maxValue!=null,r=!!i.sqlExpression&&i.supportsSQLExpression;return!e&&!t&&!r}function I6e(i){const e=i.returnDistinct?[...new Set(i.values)]:i.values,t=e.filter(s=>s!=null).sort(),r=t.length,n={count:r,min:t[0],max:t[r-1]};return i.supportsNullCount&&(n.nullcount=e.length-r),i.percentileParams&&(n.median=xXe(e,i.percentileParams)),n}function nbe(i){const{values:e,useSampleStdDev:t,supportsNullCount:r}=i;let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=null,a=null,l=null,u=null,c=0;const h=i.minValue==null?-1/0:i.minValue,p=i.maxValue==null?1/0:i.maxValue;for(const v of e)Number.isFinite(v)?v>=h&&v<=p&&(o=o===null?v:o+v,n=Math.min(n,v),s=Math.max(s,v),c++):typeof v=="string"&&c++;if(c&&o!=null){a=o/c;let v=0;for(const w of e)Number.isFinite(w)&&w>=h&&w<=p&&(v+=(w-a)**2);u=t?c>1?v/(c-1):0:c>0?v/c:0,l=Math.sqrt(u)}else n=null,s=null;const m={avg:a,count:c,max:s,min:n,stddev:l,sum:o,variance:u};return r&&(m.nullcount=e.length-c),i.percentileParams&&(m.median=xXe(e,i.percentileParams)),m}function xXe(i,e){const{fieldType:t,value:r,orderBy:n,isDiscrete:s}=e,o=SXe(t,n==="desc");if((i=[...i].filter(m=>m!=null).sort((m,v)=>o(m,v))).length===0)return null;if(r<=0)return i[0];if(r>=1)return i[i.length-1];const a=(i.length-1)*r,l=Math.floor(a),u=l+1,c=a%1,h=i[l],p=i[u];return u>=i.length||s||typeof h=="string"||typeof p=="string"?h:h*(1-c)+p*c}function SXe(i,e){if(i){if(H7r.has(i))return apt(e);if(W7r.has(i))return FOe(e,!1);if(i==="esriFieldTypeTimestampOffset")return K7r(e);const s=FOe(e,!0);if(i==="esriFieldTypeString")return s;if(i==="esriFieldTypeGUID"||i==="esriFieldTypeGlobalID")return(o,a)=>s(lpt(o),lpt(a))}const t=e?1:-1,r=apt(e),n=FOe(e,!0);return(s,o)=>typeof s=="number"&&typeof o=="number"?r(s,o):typeof s=="string"&&typeof o=="string"?n(s,o):t}const zTe=(i,e)=>i==null?e==null?0:1:e==null?-1:null,VTe=(i,e)=>i==null?e==null?0:-1:e==null?1:null;function Y7r(i){return i?zTe:VTe}const X7r=(i,e)=>VTe(i,e)??(i===e?0:new Date(i).getTime()-new Date(e).getTime()),J7r=(i,e)=>zTe(i,e)??(i===e?0:new Date(e).getTime()-new Date(i).getTime());function K7r(i){return i?J7r:X7r}const Z7r=(i,e)=>VTe(i,e)??(i===e?0:izTe(i,e)??(i===e?0:i{const s=t(r,n);return s??((r=r.toUpperCase())>(n=n.toUpperCase())?-1:r{const s=t(r,n);return s??((r=r.toUpperCase())<(n=n.toUpperCase())?-1:r>n?1:0)}}const ejr=(i,e)=>zTe(i,e)??e-i,tjr=(i,e)=>VTe(i,e)??i-e;function apt(i){return i?ejr:tjr}function lpt(i){return i.substr(24,12)+i.substr(19,4)+i.substr(16,2)+i.substr(14,2)+i.substr(11,2)+i.substr(9,2)+i.substr(6,2)+i.substr(4,2)+i.substr(2,2)+i.substr(0,2)}function e7t(i,e){let t;for(t in i)q7r.includes(t)&&(Number.isFinite(i[t])||(i[t]=null));return e&&["avg","stddev","variance"].forEach(r=>{i[r]!=null&&(i[r]=Math.ceil(i[r]??0))}),i}function t7t(i){const e={};for(let t of i)(t==null||typeof t=="string"&&t.trim()==="")&&(t=null),e[t]==null?e[t]={count:1,data:t}:e[t].count++;return{count:e}}function kOe(i){return i?.type!=="coded-value"?[]:i.codedValues.map(e=>e.code)}function i7t(i,e,t,r){const n=i.count,s=[];if(t&&e){const o=[],a=kOe(e[0]);for(const l of a)if(e[1]){const u=kOe(e[1]);for(const c of u)if(e[2]){const h=kOe(e[2]);for(const p of h)o.push(`${RC(l)}${r}${RC(c)}${r}${RC(p)}`)}else o.push(`${RC(l)}${r}${RC(c)}`)}else o.push(l);for(const l of o)n.hasOwnProperty(l)||(n[l]={data:l,count:0})}for(const o in n){const a=n[o];s.push({value:a.data,count:a.count,label:a.label})}return{uniqueValueInfos:s}}function r7t(i,e,t,r){let n=null;switch(e){case"log":i!==0&&(n=Math.log(i)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(r)&&r!==0&&(n=i/r*100);break;case"field":Number.isFinite(t)&&t!==0&&(n=i/t);break;case"natural-log":i>0&&(n=Math.log(i));break;case"square-root":i>0&&(n=i**.5)}return n}function TXe(i,e){const t=rjr({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||U7r});return i=ijr(i,e.minValue,e.maxValue),ocr({definition:t,values:i,normalizationTotal:e.normalizationTotal})}function ijr(i,e,t){const r=e??-1/0,n=t??1/0;return i.filter(s=>Number.isFinite(s)&&s>=r&&s<=n)}function rjr(i){const{breakCount:e,field:t,normalizationField:r,normalizationType:n}=i,s=i.classificationMethod||j7r,o=s==="standard-deviation"?i.standardDeviationInterval||G7r:void 0;return new ncr({breakCount:e,classificationField:t,classificationMethod:s,normalizationField:n==="field"?r:void 0,normalizationType:n,standardDeviationInterval:o})}function n7t(i,e){let t=i.classBreaks;const r=t.length,n=t[0]?.minValue,s=t[r-1]?.maxValue,o=e==="standard-deviation",a=V7r;return t=t.map(l=>{const u=l.label,c={minValue:l.minValue,maxValue:l.maxValue,label:u};if(o&&u){const h=u.match(a),p=h?.map(m=>+m.trim())??[];p.length===2?(c.minStdDev=p[0],c.maxStdDev=p[1],p[0]<0&&p[1]>0&&(c.hasAvg=!0)):p.length===1&&(u.includes("<")?(c.minStdDev=null,c.maxStdDev=p[0]):u.includes(">")&&(c.minStdDev=p[0],c.maxStdDev=null))}return c}),{minValue:n,maxValue:s,classBreakInfos:t,normalizationTotal:i.normalizationTotal}}function s7t(i,e){const t=njr(i,e);if(t.min==null&&t.max==null)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:e.normalizationTotal};const r=t.intervals,n=t.min??0,s=t.max??0,o=r.map((a,l)=>({minValue:r[l][0],maxValue:r[l][1],count:0}));for(const a of i)if(a!=null&&a>=n&&a<=s){const l=sjr(r,a);l>-1&&o[l].count++}return{bins:o,minValue:n,maxValue:s,normalizationTotal:e.normalizationTotal}}function njr(i,e){const{field:t,classificationMethod:r,standardDeviationInterval:n,normalizationType:s,normalizationField:o,normalizationTotal:a,minValue:l,maxValue:u}=e,c=e.numBins||z7r;let h=null,p=null,m=null;if((!r||r==="equal-interval")&&!s){if(l!=null&&u!=null)h=l,p=u;else{const v=nbe({values:i,minValue:l,maxValue:u,useSampleStdDev:!s,supportsNullCount:wXe({normalizationType:s,normalizationField:o,minValue:l,maxValue:u})});h=v.min??null,p=v.max??null}m=ojr(h??0,p??0,c)}else{const{classBreaks:v}=TXe(i,{field:t,normalizationType:s,normalizationField:o,normalizationTotal:a,classificationMethod:r,standardDeviationInterval:n,minValue:l,maxValue:u,numClasses:c});h=v[0].minValue,p=v[v.length-1].maxValue,m=v.map(w=>[w.minValue,w.maxValue])}return{min:h,max:p,intervals:m}}function sjr(i,e){let t=-1;for(let r=i.length-1;r>=0;r--)if(e>=i[r][0]){t=r;break}return t}function ojr(i,e,t){const r=(e-i)/t,n=[];let s,o=i;for(let a=1;a<=t;a++)s=o+r,s=Number(s.toFixed(16)),n.push([o,a===t?e:s]),o=s;return n}let MD=null;const ajr=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;function ljr(i,e,t){return i.x<0?i.x+=e:i.x>t&&(i.x-=e),i}function ujr(i,e,t,r){const n=_Et(t)?Zp(t):null,s=n?Math.round((n.valid[1]-n.valid[0])/e.scale[0]):null;return i.map(o=>{const a=new $i(o.geometry);return pir(e,a,a,a.hasZ,a.hasM),o.geometry=n?ljr(a,s??0,r[0]):a,o})}function cjr(i,e=18,t,r,n){const s=new Float64Array(r*n);e=Math.round(us(e));let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const l=Pir(t);for(const{geometry:u,attributes:c}of i){const{x:h,y:p}=u,m=Math.max(0,h-e),v=Math.max(0,p-e),w=Math.min(n,p+e),S=Math.min(r,h+e),I=+l(c);for(let R=v;R$.name.toLowerCase()===r.toLowerCase()),c=!!u&&hae(u),h=!!u&&ZBt(u),p=i.valueExpression,m=i.normalizationType,v=i.normalizationField,w=i.normalizationTotal,S=[],I=i.viewInfoParams;let R=null,L=null;if(p){if(!MD){const{arcadeUtils:$}=await e_();MD=$}MD.hasGeometryOperations(p)&&await MD.enableGeometryOperations(),R=MD.createFunction(p),L=I?MD.getViewInfo({viewingMode:I.viewingMode,scale:I.scale,spatialReference:new Xi(I.spatialReference)}):null}const k=i.fieldInfos,B=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&k?{fields:k}:null;return e.forEach($=>{const V=$.attributes;let Y;if(p){const K=B?{...$,layer:B}:$,Q=MD.createExecContext(K,L,l);Y=MD.executeFunction(R,Q)}else V&&(Y=V[r],n?(Y=`${RC(Y)}${o}${RC(V[n])}`,s&&(Y=`${Y}${o}${RC(V[s])}`)):typeof Y=="string"&&t&&(h?Y=Y?new Date(Y).getTime():null:c&&(Y=Y?o7t(Y):null)));if(m&&typeof Y=="number"&&isFinite(Y)){const K=V&&parseFloat(V[v]);Y=r7t(Y,m,K,w)}S.push(Y)}),S}async function hjr(i){const{attribute:e,features:t}=i,{normalizationType:r,normalizationField:n,minValue:s,maxValue:o,fieldType:a}=e,l=await HTe({field:e.field,valueExpression:e.valueExpression,normalizationType:r,normalizationField:n,normalizationTotal:e.normalizationTotal,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t),u=wXe({normalizationType:r,normalizationField:n,minValue:s,maxValue:o}),c={value:.5,fieldType:a},h=a==="esriFieldTypeString"?I6e({values:l,supportsNullCount:u,percentileParams:c}):nbe({values:l,minValue:s,maxValue:o,useSampleStdDev:!r,supportsNullCount:u,percentileParams:c});return e7t(h,a==="esriFieldTypeDate")}async function djr(i){const{attribute:e,features:t}=i,r=await HTe({field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:e.valueExpression,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t,!1),n=t7t(r);return i7t(n,e.domains,e.returnAllCodedValues,e.fieldDelimiter)}async function pjr(i){const{attribute:e,features:t}=i,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await HTe({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t),u=TXe(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numClasses:e.numClasses,minValue:e.minValue,maxValue:e.maxValue});return n7t(u,a)}async function fjr(i){const{attribute:e,features:t}=i,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await HTe({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t);return s7t(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numBins:e.numBins,minValue:e.minValue,maxValue:e.maxValue})}async function mjr(i){const{attribute:e,features:t}=i,{field:r,radius:n,transform:s,spatialReference:o}=e,a=e.size??[0,0],l=ujr(t??[],s,o,a);return cjr(l,n??void 0,r,a[0],a[1])}const gjr=Object.freeze(Object.defineProperty({__proto__:null,classBreaks:pjr,heatmapStatistics:mjr,histogram:fjr,summaryStatistics:hjr,uniqueValues:djr},Symbol.toStringTag,{value:"Module"}));function yjr(i){return(0,T7r[i.operation])(...i.parameters)}const vjr=Object.freeze(Object.defineProperty({__proto__:null,executeGEOperation:yjr},Symbol.toStringTag,{value:"Module"}));function _jr(i){return u7t(i)!=null||l7t(i)!=null}function bjr(i){return c7t.test(i)}function a7t(i){return u7t(i)??l7t(i)}function l7t(i){const e=new Date(i);return wjr(e,i)?Number.isNaN(e.getTime())?null:e.getTime()-6e4*e.getTimezoneOffset():null}function u7t(i){const e=c7t.exec(i);if(!e?.groups)return null;const t=e.groups,r=+t.year,n=+t.month-1,s=+t.day,o=+(t.hours??"0"),a=+(t.minutes??"0"),l=+(t.seconds??"0");if(o>23||a>59||l>59)return null;const u=t.ms??"0",c=u?+u.padEnd(3,"0").substring(0,3):0;let h;if(t.isUTC||!t.offsetSign)h=Date.UTC(r,n,s,o,a,l,c);else{const p=+t.offsetHours,m=+t.offsetMinutes;h=6e4*(t.offsetSign==="+"?-1:1)*(60*p+m)+Date.UTC(r,n,s,o,a,l,c)}return Number.isNaN(h)?null:h}const c7t=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/;function wjr(i,e){if(Number.isNaN(i.getTime()))return!1;let t=!0;if(Sjr&&/\d+\W*$/.test(e)){const r=e.match(/[a-zA-Z]{2,}/);if(r){let n=!1,s=0;for(;!n&&s<=r.length;)n=!xjr.test(r[s]),s++;t=!n}}return t}const xjr=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,Sjr=!Number.isNaN(new Date("technology 10").getTime());let sbe=class{constructor(e=9,t){this._compareMinX=upt,this._compareMinY=cpt,this._toBBox=r=>r,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),eN.prune(),gde.prune(),M_.prune(),yde.prune()}all(e){this._all(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(mde(e,r))for(eN.clear();r;){for(let s=0,o=r.children.length;s0;){if(r||(r=M_.pop(),n=M_.data[M_.length-1],s=yde.pop()??0,o=!0),r.leaf&&(t=KH(r.children,e,r.children.length,r.indexHint),t!==-1))return r.children.splice(t,1),M_.push(r),this._condense(M_),this;o||r.leaf||!NOe(r,a)?n?(s++,r=n.children[s],o=!1):r=null:(M_.push(r),yde.push(s),s=0,n=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let r=e;for(gde.clear();r;){if(r.leaf===!0)for(const n of r.children)t(n);else gde.pushArray(r.children);r=gde.pop()??null}}_build(e,t,r,n){const s=r-t+1;let o=this._maxEntries;if(s<=o){const c=new Gge(e.slice(t,r+1));return Rj(c,this._toBBox),c}n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/o**(n-1)));const a=new $Oe([]);a.height=n;const l=Math.ceil(s/o),u=l*Math.ceil(Math.sqrt(o));hpt(e,t,r,u,this._compareMinX);for(let c=t;c<=r;c+=u){const h=Math.min(c+u-1,r);hpt(e,c,h,l,this._compareMinY);for(let p=c;p<=h;p+=l){const m=Math.min(p+l-1,h);a.children.push(this._build(e,p,m,n-1))}}return Rj(a,this._toBBox),a}_chooseSubtree(e,t,r,n){for(;n.push(t),t.leaf!==!0&&n.length-1!==r;){let s,o=1/0,a=1/0;for(let l=0,u=t.children.length;l=0&&M_.data[t].children.length>this._maxEntries;)this._split(M_,t),t--;this._adjustParentBBoxes(s,M_,t)}_split(e,t){const r=e.data[t],n=r.children.length,s=this._minEntries;this._chooseSplitAxis(r,s,n);const o=this._chooseSplitIndex(r,s,n);if(!o)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const a=r.children.splice(o,r.children.length-o),l=r.leaf?new Gge(a):new $Oe(a);l.height=r.height,Rj(r,this._toBBox),Rj(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(r,l)}_splitRoot(e,t){this._data=new $Oe([e,t]),this._data.height=e.height+1,Rj(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,s,o;n=s=1/0;for(let a=t;a<=r-t;a++){const l=iee(e,0,a,this._toBBox),u=iee(e,a,r,this._toBBox),c=Cjr(l,u),h=LOe(l)+LOe(u);c=t;u--){const c=e.children[u];ree(a,e.leaf?s(c):c),l+=fde(a)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)ree(t.data[n],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(r.children.length===0)if(t>0){const n=e.data[t-1],s=n.children;s.splice(KH(s,r,s.length,n.indexHint),1)}else this.clear();else Rj(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}};function Rj(i,e){iee(i,0,i.children.length,e,i)}function iee(i,e,t,r,n){n||(n=new Gge([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=e;o=i.minX&&e.maxY>=i.minY}function hpt(i,e,t,r,n){const s=[e,t];for(;s.length;){const o=s.pop(),a=s.pop();if(o-a<=r)continue;const l=a+Math.ceil((o-a)/r/2)*r;I5t(i,l,a,o,n),s.push(a,l,l,o)}}const eN=new mg,gde=new mg,M_=new mg,yde=new mg({deallocator:void 0});let Ejr=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}},h7t=class extends Ejr{constructor(){super(...arguments),this.height=1,this.indexHint=new Yxe}},Gge=class extends h7t{constructor(e){super(),this.children=e,this.leaf=!0}},$Oe=class extends h7t{constructor(e){super(),this.children=e,this.leaf=!1}};const Ijr=5e4,nee={minX:0,minY:0,maxX:0,maxY:0};function Ajr(i){nee.minX=i[0],nee.minY=i[1],nee.maxX=i[2],nee.maxY=i[3]}function Mjr(i,e,t){Ajr(e),i.search(nee,t)}let CXe=class{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new sbe(9,yi("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((r,n)=>{e[t++]=n}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=Oze();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),Mjr(this._index,e,r=>t(this._idByBounds.get(r)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const r=this._boundsById.get(e);r&&(this._index.remove(r),this._idByBounds.delete(r))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>Ijr&&this._loadIndex()))}};const dpt=new $o,Ojr=new $o,A6e=new $o,BOe={esriGeometryPoint:hNe,esriGeometryPolyline:zHe,esriGeometryPolygon:VHe,esriGeometryMultipoint:UHe};function jOe(i,e,t,r=i.hasZ,n=i.hasM){if(e==null)return null;const s=i.hasZ&&r,o=i.hasM&&n;if(t){const a=wx(A6e,e,i.hasZ,i.hasM,"esriGeometryPoint",t,r,n);return hNe(a,s,o)}return hNe(e,s,o)}function wP(i,e,t,r,n,s,o=e,a=t){const l=e&&o,u=t&&a,c=r!=null?"coords"in r?r:r.geometry:null;if(c==null)return null;if(n){let h=DDt(Ojr,c,e,t,i,n,o,a);return s&&(h=wx(A6e,h,l,u,i,s)),BOe[i]?.(h,l,u)??null}if(s){const h=wx(A6e,c,e,t,i,s,o,a);return BOe[i]?.(h,l,u)??null}return Wdr(dpt,c,e,t,o,a),BOe[i]?.(dpt,l,u)??null}function aH(i){return i&&d7t in i?JSON.parse(JSON.stringify(i,Pjr)):i}const d7t="_geVersion",Pjr=(i,e)=>i!==d7t?e:void 0;function EXe(i,e){return i?e?4:3:e?3:2}function p7t(i,e,t,r){if(!e?.lengths.length)return null;i.lengths.length&&(i.lengths.length=0),i.coords.length&&(i.coords.length=0);const n=i.coords,s=[],o=t?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:a,coords:l}=e,u=EXe(t,r);let c=0;for(const h of a){const p=Rjr(o,l,c,h,t,r);p&&s.push(p),c+=h*u}if(s.sort((h,p)=>{let m=h[2]-p[2];return m===0&&t&&(m=h[4]-p[4]),m}),s.length){let h=6*s[0][2];n[0]=s[0][0]/h,n[1]=s[0][1]/h,t&&(h=6*s[0][4],n[2]=h!==0?s[0][3]/h:0),(n[0]o[1]||n[1]o[3]||t&&(n[2]o[5]))&&(n.length=0)}if(!n.length){const h=e.lengths[0]?Djr(l,0,a[0],t,r):null;if(!h)return null;n[0]=h[0],n[1]=h[1],t&&h.length>2&&(n[2]=h[2])}return i}function Rjr(i,e,t,r,n,s){const o=EXe(n,s);let a=t,l=t+o,u=0,c=0,h=0,p=0,m=0;for(let w=0,S=r-1;wi[1]&&(i[1]=I),Ri[3]&&(i[3]=R),n&&(Li[5]&&(i[5]=L))}if(p>0&&(p*=-1),m>0&&(m*=-1),!p)return null;const v=[u,c,.5*p];return n&&(v[3]=h,v[4]=.5*m),v}function Djr(i,e,t,r,n){const s=EXe(r,n);let o=e,a=e+s,l=0,u=0,c=0,h=0;for(let p=0,m=t-1;p0?r?[u/l,c/l,h/l]:[u/l,c/l]:t>0?r?[i[e],i[e+1],i[e+2]]:[i[e],i[e+1]]:null}function Fjr(i,e,t,r){const n=t-i,s=r-e;return Math.sqrt(n*n+s*s)}function kjr(i,e,t,r,n,s){const o=r-i,a=n-e,l=s-t;return Math.sqrt(o*o+a*a+l*l)}function Ljr(i,e,t,r){return[i+.5*(t-i),e+.5*(r-e)]}function Njr(i,e,t,r,n,s){return[i+.5*(r-i),e+.5*(n-e),t+.5*(s-t)]}const f7t={getObjectId:i=>i.objectId,getAttributes:i=>i.attributes,getAttribute:(i,e)=>i.attributes[e],cloneWithGeometry:(i,e)=>new ry(e,i.attributes,null,i.objectId),getGeometry:i=>i.geometry,getCentroid:(i,e)=>(i.centroid==null&&(i.centroid=p7t(new $o,i.geometry,e.hasZ,e.hasM)),i.centroid)},$jr=Dx();let rX=class{constructor(e){this.geometryInfo=e,this._boundsStore=new CXe,this._featuresById=new Map,this._markedIds=new Set,this.events=new rd,this.featureAdapter=f7t}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,r,n,s]=this.fullBounds;return{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:aH(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(r=>this._upsert(r));return this._emitChanged(),t.filter(Ga)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const r=this._featuresById.get(t);r&&this._remove(r)}this._emitChanged()}forEachBounds(e,t){for(const r of e){const n=this._boundsStore.get(r.objectId);n&&t(YQi($jr,n))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,r=>{t(this._featuresById.get(r))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,r)=>{this._markedIds.has(r)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(t==null)return void di.getLogger("esri.layers.graphics.data.FeatureStore").error(new qe("featurestore:invalid-feature","feature id is missing",{feature:e}));const r=this._featuresById.get(t);let n;if(this._markedIds.add(t),r?(e.displayId=r.displayId,n=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);n=O1e(n??Wo(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),n!=null&&this._boundsStore.set(t,n),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(t==null)return di.getLogger("esri.layers.graphics.data.FeatureStore").error(new qe("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const r=this._featuresById.get(t);if(!r)return this._add(e),e;this._markedIds.add(t);const{geometry:n,attributes:s}=e;for(const o in s)r.attributes[o]=s[o];return n&&(r.geometry=n,this._boundsStore.set(t,O1e(Wo(),n,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),r}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}};const GOe=[0,0];function m7t(i,e){if(!e)return null;if("x"in e){const t={x:0,y:0};return[t.x,t.y]=i(e.x,e.y,GOe),e.z!=null&&(t.z=e.z),e.m!=null&&(t.m=e.m),t}if("xmin"in e){const t={xmin:0,ymin:0,xmax:0,ymax:0};return[t.xmin,t.ymin]=i(e.xmin,e.ymin,GOe),[t.xmax,t.ymax]=i(e.xmax,e.ymax,GOe),e.hasZ&&(t.zmin=e.zmin,t.zmax=e.zmax,t.hasZ=!0),e.hasM&&(t.mmin=e.mmin,t.mmax=e.mmax,t.hasM=!0),t}return"rings"in e?{rings:ppt(e.rings,i),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:ppt(e.paths,i),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:g7t(e.points,i),hasM:e.hasM,hasZ:e.hasZ}:null}function ppt(i,e){const t=[];for(const r of i)t.push(g7t(r,e));return t}function g7t(i,e){const t=[];for(const r of i){const n=e(r[0],r[1],[0,0]);t.push(n),r.length>2&&n.push(r[2]),r.length>3&&n.push(r[3])}return t}async function Gv(i,e){if(!i||!e)return;const t=Array.isArray(i)?i.map(r=>r.geometry!=null?r.geometry.spatialReference:null).filter(Ga):[i];await Lx(t.map(r=>({source:r,dest:e})))}const y7t=m7t.bind(null,Z5),v7t=m7t.bind(null,DV);function Sf(i,e,t,r){if(!i||(t||(t=e,e=i.spatialReference),!Cm(e)||!Cm(t)||Ya(e,t)))return i;if(RV(e,t)){const n=Nb(t)?y7t(i):v7t(i);return n.spatialReference=t,n}return TW(Mu,[i],e,t,null,r)[0]}let Bjr=class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,r,n){if(!e?.length||!t||!r||Ya(t,r))return e;const s={geometries:e,inSpatialReference:t,outSpatialReference:r,geographicTransformation:n,resolve:ac()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:r,outSpatialReference:n,resolve:s,geographicTransformation:o}=e;RV(r,n)?Nb(n)?s(t.map(y7t)):s(t.map(v7t)):s(TW(Mu,t,r,n,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};const jjr=new Bjr;function Gjr(i,e,t,r){return jjr.push(i,e,t,r)}let Ujr=class{constructor(e,t){this._cache=new d3(e),this._invalidCache=new d3(t)}get(e,t){const r=`${t.uid}:${e}`,n=this._cache.get(r);if(n)return n;if(this._invalidCache.get(r)!=null)return null;try{const s=ta.create(e,t);return this._cache.put(r,s),s}catch(s){return this._invalidCache.put(r,s),null}}getError(e,t){const r=`${t.uid}:${e}`;return this._invalidCache.get(r)??null}};const _7t=new Ujr(50,500),yre="unsupported-query",b7t=" as ",w7t=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),x7t=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),zjr=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...w7t,...x7t]);function IXe(i,e,t={}){const r=w8(e,i);if(!r){const s=_7t.getError(e,i);throw new qe(yre,"invalid SQL expression",{expression:e,error:s})}const n=t.expressionName||"expression";if(t.validateStandardized&&!r.isStandardized)throw new qe(yre,`${n} is not standard`,{expression:e});if(t.validateAggregate&&!r.isAggregate)throw new qe(yre,`${n} does not contain a valid aggregate function`,{expression:e});return r.fieldNames}function Vjr(i,e,t,r){if(!t)return!0;const n="where clause";return OF(i,e,IXe(i,t,{validateStandardized:!0,expressionName:n}),{expressionName:n,query:r}),!0}function Hjr(i,e,t,r,n){if(!t)return!0;const s="having clause",o=IXe(i,t,{validateAggregate:!0,expressionName:s});if(OF(i,e,o,{expressionName:s,query:n}),!w8(t,i)?.getExpressions().every(u=>{const{aggregateType:c,field:h}=u,p=i.get(h)?.name;return r.some(m=>{const{onStatisticField:v,statisticType:w}=m;return i.get(v)?.name===p&&w.toLowerCase().trim()===c})}))throw new qe(yre,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function w8(i,e){return i?_7t.get(i,e):null}function S7t(i){return/\((.*?)\)/.test(i)?i:i.split(b7t)[0]}function Wjr(i){return i.split(b7t)[1]}function OF(i,e,t,r={}){const n=new Map;if(qjr(n,i,e,r.allowedFieldTypes??zjr,t),n.size){const s=r.expressionName??"expression";throw new qe(yre,`${s} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query})}}function qjr(i,e,t,r,n){const s=n.includes("*")?[...t,...n.filter(o=>o!=="*")]:n;for(const o of s)if(e.get(o))fpt(i,e,t,r,o);else try{const a=IXe(e,S7t(o),{validateStandardized:!0});for(const l of a)fpt(i,e,t,r,l)}catch(a){i.set(o,{type:"expression-error",expression:o,error:a})}}function fpt(i,e,t,r,n){const s=e.get(n);s?t.has(s.name)?r!=="all"&&r?.has(s.type)===!1&&i.set(n,{type:"invalid-type",fieldName:s.name,fieldType:wW.fromJSON(s.type),allowedFieldTypes:Array.from(r,o=>wW.fromJSON(o))}):i.set(n,{type:"missing-field",fieldName:s.name}):i.set(n,{type:"invalid-field",fieldName:n})}const T7t={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0};let vde=class{constructor(e,t,r){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=r,this.featureAdapter=t;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let s=0;for(const o of n){const a=S7t(o),l=this.fieldsIndex.get(a),u=l?null:w8(a,r),c=l?l.name:Wjr(o)||"FIELD_EXP_"+s++;this._fieldDataCache.set(o,{alias:c,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,r){const n=r?r.name:t;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:r||(s=w8(t,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),r?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,r=!0){const n=t.normalizationType,s=t.normalizationTotal,o=this.fieldsIndex.get(t.field),a=t1e(o)||i1e(o),l=hae(o);return e.map(u=>{let c=t.field&&this.getFieldValue(u,t.field,this.fieldsIndex.get(t.field));if(t.field2?(c=`${RC(c)}${t.fieldDelimiter}${RC(this.getFieldValue(u,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(c=`${c}${t.fieldDelimiter}${RC(this.getFieldValue(u,t.field3,this.fieldsIndex.get(t.field3)))}`)):typeof c=="string"&&r&&(a?c=c?new Date(c).getTime():null:l&&(c=c?o7t(c):null)),n&&Number.isFinite(c)){const h=n==="field"&&t.normalizationField?this.getFieldValue(u,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;c=r7t(c,n,h,s)}return c})}async getExpressionValues(e,t,r,n,s){const{arcadeUtils:o}=await e_(),a=o.hasGeometryOperations(t);a&&await o.enableGeometryOperations();const l=o.createFunction(t),u=o.getViewInfo(r),c={fields:this.fieldsIndex.fields};return e.map(h=>{const p={attributes:this.featureAdapter.getAttributes(h),layer:c,geometry:a?{...wP(n.geometryType,n.hasZ,n.hasM,this.featureAdapter.getGeometry(h)),spatialReference:r?.spatialReference}:null},m=o.createExecContext(p,u,s);return o.executeFunction(l,m)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:w8(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:w8(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const r={};for(const n of t){const{alias:s,clause:o}=this._fieldDataCache.get(n);r[s]=o?o.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,s)}return r}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,r=[];if(t)for(const o of t){const{alias:a}=this._fieldDataCache.get(o);r.push(e[a])}else for(const o in e)r.push(e[o]);const n=`${(t||["*"]).join(",")}=${r.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}};function mpt(i,e,t){return{objectId:i,target:e,distance:t,type:"vertex"}}function Yjr(i,e,t,r,n,s=!1){return{objectId:i,target:e,distance:t,type:"edge",start:r,end:n,draped:s}}let O_=class{constructor(e,t,r){this.items=e,this.query=t,this.geometryType=r.geometryType,this.hasM=r.hasM,this.hasZ=r.hasZ,this.fieldsIndex=r.fieldsIndex,this.objectIdField=r.objectIdField,this.spatialReference=r.spatialReference,this.featureAdapter=r.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new vde(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:r,outStatistics:n}=this.query;if(!t?.length)return 1;const o=new Map,a=new Map,l=new Set;for(const u of n){const{statisticType:c}=u,h=c!=="exceedslimit"?u.onStatisticField:void 0;if(!a.has(h)){const m=[];for(const v of t){const w=this._getAttributeValues(e,v,o);m.push(w)}a.set(h,this._calculateUniqueValues(m,e.returnDistinctValues))}const p=a.get(h);for(const m in p){const{data:v,items:w}=p[m],S=v.join(",");r&&!e.validateItems(w,r)||l.add(S)}}return l.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;Cm(this.query.outSR)&&!Ya(t.spatialReference,this.query.outSR)?e.queryGeometry=aH({spatialReference:this.query.outSR,...Sf(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=aH({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const r=this.featureAdapter,n=gpt(this.hasZ,this.hasM),{point:s,mode:o}=e,a=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(o,this.spatialReference,t),p=new ypt(null,0),m=new ypt(null,0),v={x:0,y:0,z:0};for(const w of this.items){const S=r.getGeometry(w);if(S==null)continue;const{coords:I,lengths:R}=S;if(p.coords=I,m.coords=I,e.returnEdge){let L=0;for(let k=0;kw.distance-S.distance),u}_getPointCreator(e,t,r){const n=r==null||Ya(t,r)?a=>a:a=>Sf(a,t,r),{hasZ:s}=this,o=0;return e==="3d"?s?({x:a,y:l,z:u})=>n({x:a,y:l,z:u}):({x:a,y:l})=>n({x:a,y:l,z:o}):({x:a,y:l})=>n({x:a,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,minValue:a,maxValue:l,scale:u,timeZone:c}=e,h=this.fieldsIndex.get(t),p=mW(h)||t1e(h)||i1e(h),m=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:u,timeZone:c}),v=wXe({normalizationType:s,normalizationField:n,minValue:a,maxValue:l}),w={value:.5,fieldType:h?.type},S=xie(h)?I6e({values:m,supportsNullCount:v,percentileParams:w}):nbe({values:m,minValue:a,maxValue:l,useSampleStdDev:!s,supportsNullCount:v,percentileParams:w});return e7t(S,p)}async createUniqueValuesResponse(e){const{field:t,valueExpression:r,domains:n,returnAllCodedValues:s,scale:o,timeZone:a}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:r,scale:o,timeZone:a},!1),u=t7t(l);return i7t(u,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:p,timeZone:m}=e,v=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:p,timeZone:m}),w=TXe(v,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return n7t(w,a)}async createHistogramResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:p,timeZone:m}=e,v=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:p,timeZone:m});return s7t(v,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,r){if(e.length>1&&t?.length)for(const n of t.reverse()){const s=n.split(" "),o=s[0],a=this.fieldsIndex.get(o),l=!!s[1]&&s[1].toLowerCase()==="desc",u=SXe(a?.type,l);e.sort((c,h)=>{const p=r(c,o,a),m=r(h,o,a);return u(p,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:p,returnZ:m,returnM:v}=e,w=h!=null&&t.length>(p||0)+h,S=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(I=>this.fieldsIndex.get(I)));return{exceededTransferLimit:w,features:this._createFeatures(e,t),fields:S,geometryType:r,hasM:n&&v,hasZ:s&&m,objectIdFieldName:o,spatialReference:aH(u||a),transform:c&&p1e(c)||null}}_createFeatures(e,t){const r=new vde(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:o,quantizationParameters:a,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:p,returnZ:m=!1,returnM:v=!1}=e,w=s&&m,S=n&&v;let I=[],R=0;const L=[...t];if(this._sortFeatures(L,o,(B,$,V)=>r.getFieldValue(B,$,V)),this.geometryType&&(l||u)){const B=p1e(a)??void 0,$=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const V of L){const Y=this.featureAdapter.getGeometry(V),K={attributes:r.getAttributes(V),geometry:wP(this.geometryType,this.hasZ,this.hasM,Y,c,B,w,S)};$&&Y&&!K.geometry&&(K.centroid=jOe(this,this.featureAdapter.getCentroid(V,this),B)),I[R++]=K}else if(!l&&u)for(const V of L)I[R++]={attributes:r.getAttributes(V),centroid:jOe(this,this.featureAdapter.getCentroid(V,this),B)};else for(const V of L)I[R++]={attributes:r.getAttributes(V),centroid:jOe(this,this.featureAdapter.getCentroid(V,this),B),geometry:wP(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(V),c,B,w,S)}}else for(const B of L){const $=r.getAttributes(B);$&&(I[R++]={attributes:$})}const k=h||0;if(p!=null){const B=k+p;I=I.slice(k,Math.min(I.length,B))}return I}_createExceedsLimitQueryResponse(e){let t=!1,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const o of e.outStatistics??[])if(o.statisticType==="exceedslimit"){r=o.maxPointCount!=null?o.maxPointCount:Number.POSITIVE_INFINITY,n=o.maxRecordCount!=null?o.maxRecordCount:Number.POSITIVE_INFINITY,s=o.maxVertexCount!=null?o.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>r;else if(this.items.length>n)t=!0;else{const o=gpt(this.hasZ,this.hasM),a=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=a.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/o>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},r=[],n=new Map,s=new Map,o=new Map,a=new Map,l=new vde(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:p,resultRecordCount:m}=e,v=c?.length,w=!!v,S=w?c[0]:null,I=w&&!this.fieldsIndex.get(S);for(const L of u??[]){const{outStatisticFieldName:k,statisticType:B}=L,$=L,V=B!=="exceedslimit"?L.onStatisticField:void 0,Y=B==="percentile_disc"||B==="percentile_cont",K=B==="EnvelopeAggregate"||B==="CentroidAggregate"||B==="ConvexHullAggregate",Q=w&&v===1&&(V===S||I)&&B==="count";if(w){if(!o.has(V)){const pe=[];for(const H of c){const Z=this._getAttributeValues(l,H,n);pe.push(Z)}o.set(V,this._calculateUniqueValues(pe,!K&&l.returnDistinctValues))}const ne=o.get(V);if(!ne)continue;const de=Object.keys(ne);for(const pe of de){const{count:H,data:Z,items:ae,itemPositions:fe}=ne[pe],be=Z.join(",");if(!h||l.validateItems(ae,h)){const _e=a.get(be)||{attributes:{}};if(K){_e.aggregateGeometries||(_e.aggregateGeometries={});const{aggregateGeometries:Te,outStatisticFieldName:Be}=await this._getAggregateGeometry($,ae);_e.aggregateGeometries[Be]=Te}else{let Te=null;if(Q)Te=H;else{const Be=this._getAttributeValues(l,V,n),Ve=fe.map($e=>Be[$e]);Te=Y&&"statisticParameters"in $?this._getPercentileValue($,Ve):this._getStatisticValue($,Ve,null,l.returnDistinctValues)}_e.attributes[k]=Te}let Ie=0;c.forEach((Te,Be)=>_e.attributes[this.fieldsIndex.get(Te)?Te:"EXPR_"+ ++Ie]=Z[Be]),a.set(be,_e)}}}else if(K){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:ne,outStatisticFieldName:de}=await this._getAggregateGeometry($,this.items);t.aggregateGeometries[de]=ne}else{const ne=this._getAttributeValues(l,V,n);t.attributes[k]=Y&&"statisticParameters"in $?this._getPercentileValue($,ne):this._getStatisticValue($,ne,s,l.returnDistinctValues)}const re=B!=="min"&&B!=="max"||!xie(this.fieldsIndex.get(V))&&!this._isAnyDateField(V)?null:this.fieldsIndex.get(V)?.type;r.push({name:k,alias:k,type:re||"esriFieldTypeDouble"})}const R=w?Array.from(a.values()):[t];return this._sortFeatures(R,p,(L,k)=>L.attributes[k]),m&&(R.length=Math.min(m,R.length)),{fields:r,features:R}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return mW(t)||t1e(t)||i1e(t)||hae(t)}async _getAggregateGeometry(e,t){const{convexHull:r,union:n}=await Promise.resolve().then(()=>iX),{statisticType:s,outStatisticFieldName:o}=e,{featureAdapter:a,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,p=t.map(w=>wP(u,c,h,a.getGeometry(w))),m=r(l,p,!0)[0],v={aggregateGeometries:null,outStatisticFieldName:null};if(s==="EnvelopeAggregate"){const w=m?Fze(m):I5e(n(l,p));v.aggregateGeometries={...w,spatialReference:l},v.outStatisticFieldName=o||"extent"}else if(s==="CentroidAggregate"){const w=m?p2e(m):MXi(I5e(n(l,p)));v.aggregateGeometries={x:w[0],y:w[1],spatialReference:l},v.outStatisticFieldName=o||"centroid"}else s==="ConvexHullAggregate"&&(v.aggregateGeometries=m,v.outStatisticFieldName=o||"convexHull");return v}_getStatisticValue(e,t,r,n){const{onStatisticField:s,statisticType:o}=e;let a=null;return a=r?.has(s)?r.get(s):xie(this.fieldsIndex.get(s))||this._isAnyDateField(s)?I6e({values:t,returnDistinct:n}):nbe({values:n?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),r&&r.set(s,a),a[o==="var"?"variance":o]}_getPercentileValue(e,t){const{onStatisticField:r,statisticParameters:n,statisticType:s}=e,{value:o,orderBy:a}=n,l=this.fieldsIndex.get(r);return xXe(t,{value:o,orderBy:a,fieldType:l?.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,t,r){if(r.has(t))return r.get(t);const n=this.fieldsIndex.get(t),s=this.items.map(o=>e.getFieldValue(o,t,n));return r.set(t,s),s}_calculateUniqueValues(e,t){const r={},n=this.items,s=n.length;for(let o=0;oSf(r,Yp));return(await Qjr())(o.spatialReference,o,e,s)}async function Qjr(){return(await Promise.resolve().then(()=>iX)).geodesicBuffer}function eGr(i){return i==="mesh"?MEt:REt(i)}function E7t(i,e){return i?e?4:3:e?3:2}function tGr(i,e,t,r){return I7t(i,e,t,r.coords[0],r.coords[1])}function iGr(i,e,t,r,n,s){const o=E7t(n,s),{coords:a,lengths:l}=r;if(!l)return!1;for(let u=0,c=0;u=o||v=o)&&h+(o-p)/(v-p)*(m-h)iX)}function _U(i,e,t,r,n){if(ed(e)&&t==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains")){const s=uB(new $o,e,!1,!1);return Promise.resolve(o=>tGr(s,!1,!1,o))}if(ed(e)&&t==="esriGeometryMultipoint"){const s=uB(new $o,e,!1,!1);if(i==="esriSpatialRelContains")return Promise.resolve(o=>iGr(s,!1,!1,o,r,n))}if(zd(e)&&t==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"))return Promise.resolve(s=>rae(e,wP(t,r,n,s)));if(zd(e)&&t==="esriGeometryMultipoint"&&i==="esriSpatialRelContains")return Promise.resolve(s=>nYi(e,wP(t,r,n,s)));if(zd(e)&&i==="esriSpatialRelIntersects"){const s=eGr(t);return Promise.resolve(o=>s(e,wP(t,r,n,o)))}return lGr().then(s=>{const o=s[nGr[i]].bind(null,e.spatialReference,e);return a=>o(wP(t,r,n,a))})}async function A7t(i,e,t){const{spatialRel:r,geometry:n}=i;if(n){if(!sGr(r))throw new qe(UOe,"Unsupported query spatial relationship",{query:i});if(Cm(n.spatialReference)&&Cm(t)){if(!oGr(n))throw new qe(UOe,"Unsupported query geometry type",{query:i});if(!aGr(e))throw new qe(UOe,"Unsupported layer geometry type",{query:i});if(i.outSR)return Gv(i.geometry?.spatialReference,i.outSR)}}}function _pt(i){if(zd(i))return!0;if(ed(i)){for(const e of i.rings)if(e.length!==5||e[0][0]!==e[1][0]||e[0][0]!==e[4][0]||e[2][0]!==e[3][0]||e[0][1]!==e[3][1]||e[0][1]!==e[4][1]||e[1][1]!==e[2][1])return!1;return!0}return!1}const _q="unsupported-query";async function bpt(i,{fieldsIndex:e,geometryType:t,spatialReference:r,availableFields:n}){if((i.distance??0)<0||i.geometryPrecision!=null||i.multipatchOption&&i.multipatchOption!=="xyFootprint"||i.pixelSize||i.relationParam||i.text)throw new qe(_q,"Unsupported query options",{query:i});return M7t(e,n,i),cGr(e,n,i),Promise.all([A7t(i,t,r),Gv(r,i.outSR)]).then(()=>i)}function M7t(i,e,t){const{outFields:r,orderByFields:n,returnDistinctValues:s,outStatistics:o}=t,a=o?o.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(n&&n.length>0){const l=" asc",u=" desc",c=n.map(h=>{const p=h.toLowerCase();return p.includes(l)?p.split(l)[0]:p.includes(u)?p.split(u)[0]:h}).filter(h=>!a.includes(h));OF(i,e,c,{expressionName:"orderByFields",query:t})}if(r&&r.length>0)OF(i,e,r,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(s)throw new qe(_q,"outFields should be specified for returnDistinctValues",{query:t});Vjr(i,e,t.where,t)}const uGr=new Set([...w7t,...x7t]);function cGr(i,e,t){const{outStatistics:r,groupByFieldsForStatistics:n,having:s}=t,o=n?.length,a=r?.length;if(s){if(!o||!a)throw new qe(_q,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});Hjr(i,e,s,r,t)}if(a){if(!pGr(r))return;const l=r.map(u=>u.onStatisticField).filter(Boolean);OF(i,e,l,{expressionName:"onStatisticFields",query:t}),o&&OF(i,e,n,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of r){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:p}=u;if(!p)throw new qe(_q,"statisticParameters should be set for percentile type",{definition:u,query:t})}else i.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&OF(i,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:uGr,query:t})}}}async function hGr(i,e,{fieldsIndex:t,geometryType:r,spatialReference:n,availableFields:s}){if((i.distance??0)<0||i.geometryPrecision!=null||i.multipatchOption||i.pixelSize||i.relationParam||i.text||i.outStatistics||i.groupByFieldsForStatistics||i.having||i.orderByFields)throw new qe(_q,"Unsupported query options",{query:i});return M7t(t,s,i),Promise.all([dGr(t,s,e,i),A7t(i,r,n),Gv(n,i.outSR)]).then(()=>i)}async function dGr(i,e,t,r){let n=[];if(t.valueExpression){const{arcadeUtils:s}=await e_();n=s.extractFieldNames(t.valueExpression)}if(t.field&&n.push(t.field),t.field2&&n.push(t.field2),t.field3&&n.push(t.field3),t.normalizationField&&n.push(t.normalizationField),!n.length&&!t.valueExpression)throw new qe(_q,"field or valueExpression is required",{params:t});OF(i,e,n,{expressionName:"statistics",query:r})}function pGr(i){return i!=null&&i.every(e=>e.statisticType!=="exceedslimit")}async function fGr(i,e){if(!i)return null;const t=e.featureAdapter,{startTimeField:r,endTimeField:n}=i;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await e.forEach(a=>{const l=t.getAttribute(a,r),u=t.getAttribute(a,n);l==null||isNaN(l)||(s=Math.min(s,l)),u==null||isNaN(u)||(o=Math.max(o,u))});else{const a=r||n;await e.forEach(l=>{const u=t.getAttribute(l,a);u==null||isNaN(u)||(s=Math.min(s,u),o=Math.max(o,u))})}return{start:s,end:o}}function O7t(i,e,t){if(!e||!i)return null;const{startTimeField:r,endTimeField:n}=i;if(!r&&!n)return null;const{start:s,end:o}=e;if(s===null&&o===null)return null;if(s===void 0&&o===void 0)return yGr();const a=t.getAttributeAsTimestamp?.bind(t)??t.getAttribute.bind(t);return r&&n?mGr(a,r,n,s,o):gGr(a,r||n,s,o)}function mGr(i,e,t,r,n){return r!=null&&n!=null?s=>{const o=i(s,e),a=i(s,t);return(o==null||o<=n)&&(a==null||a>=r)}:r!=null?s=>{const o=i(s,t);return o==null||o>=r}:n!=null?s=>{const o=i(s,e);return o==null||o<=n}:void 0}function gGr(i,e,t,r){return t!=null&&r!=null&&t===r?n=>i(n,e)===t:t!=null&&r!=null?n=>{const s=i(n,e);return s!=null&&s>=t&&s<=r}:t!=null?n=>{const s=i(n,e);return s!=null&&s>=t}:r!=null?n=>{const s=i(n,e);return s!=null&&s<=r}:void 0}function yGr(){return()=>!1}const P7t=Symbol("Yield");let vGr=class{constructor(){this._tasks=new Array,this._runningTasks=hB(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(this.length===0)return P7t;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,r){return++this._runningTasks.value,new Promise((n,s)=>this._tasks.push(new wpt(n,s,e,t,r))).finally(()=>--this._runningTasks.value)}unshift(e,t,r){return++this._runningTasks.value,new Promise((n,s)=>this._tasks.unshift(new wpt(n,s,e,t,r))).finally(()=>--this._runningTasks.value)}_process(e){if(this._tasks.length===0)return!1;const t=this._tasks.shift();try{const r=xg(t.signal);if(r&&!t.abortCallback)t.reject(Oc());else{const n=r?t.abortCallback?.(Oc()):t.callback(e);qp(n)?n.then(t.resolve,t.reject):t.resolve(n)}}catch(r){t.reject(r)}return!0}cancelAll(){const e=Oc();for(const t of this._tasks)if(t.abortCallback){const r=t.abortCallback(e);t.resolve(r)}else t.reject(e);this._tasks.length=0}},wpt=class{constructor(e,t,r,n=void 0,s=void 0){this.resolve=e,this.reject=t,this.callback=r,this.signal=n,this.abortCallback=s}},see=class extends un{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};x([D()],see.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),x([D()],see.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),see=x([Qe("esri.views.support.DebugFlags")],see);const _Gr=new see;var $w;(function(i){i[i.ANIMATING=0]="ANIMATING",i[i.INTERACTING=1]="INTERACTING",i[i.IDLE=2]="IDLE"})($w||($w={}));var Dl;(function(i){i.RESOURCE_CONTROLLER_IMMEDIATE="immediate",i.RESOURCE_CONTROLLER="schedule",i.SLIDE="slide",i.STREAM_DATA_LOADER="stream loader",i.ELEVATION_QUERY="elevation query",i.TERRAIN_SURFACE="terrain",i.SURFACE_GEOMETRY_UPDATES="surface geometry updates",i.LOD_RENDERER="LoD renderer",i.GRAPHICS_CORE="Graphics3D",i.I3S_CONTROLLER="I3S",i.POINT_CLOUD_LAYER="point cloud",i.FEATURE_TILE_FETCHER="feature fetcher",i.OVERLAY="overlay",i.STAGE="stage",i.GRAPHICS_DECONFLICTOR="graphics deconflictor",i.FILTER_VISIBILITY="Graphics3D filter visibility",i.SCALE_VISIBILITY="Graphics3D scale visibility",i.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",i.POINT_OF_INTEREST_FREQUENT="POI frequent",i.POINT_OF_INTEREST_INFREQUENT="POI infrequent",i.LABELER="labeler",i.FEATURE_QUERY_ENGINE="feature query",i.FEATURE_TILE_TREE="feature tile tree",i.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",i.ELEVATION_ALIGNMENT="elevation alignment",i.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",i.TEXT_TEXTURE_ATLAS="text texture atlas",i.TEXTURE_UNLOAD="texture unload",i.LINE_OF_SIGHT_TOOL="line of sight tool",i.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",i.ELEVATION_PROFILE="elevation profile",i.SNAPPING="snapping",i.SHADOW_ACCUMULATOR="shadow accumulator",i.CLOUDS_GENERATOR="clouds generator",i[i.NONE=0]="NONE",i[i.TEST_PRIO=1]="TEST_PRIO"})(Dl||(Dl={}));const tA=0,xpt=new Map([[Dl.RESOURCE_CONTROLLER_IMMEDIATE,tA],[Dl.RESOURCE_CONTROLLER,4],[Dl.SLIDE,tA],[Dl.STREAM_DATA_LOADER,tA],[Dl.ELEVATION_QUERY,tA],[Dl.TERRAIN_SURFACE,1],[Dl.SURFACE_GEOMETRY_UPDATES,1],[Dl.LOD_RENDERER,2],[Dl.GRAPHICS_CORE,2],[Dl.I3S_CONTROLLER,2],[Dl.POINT_CLOUD_LAYER,2],[Dl.FEATURE_TILE_FETCHER,2],[Dl.OVERLAY,4],[Dl.STAGE,4],[Dl.GRAPHICS_DECONFLICTOR,4],[Dl.FILTER_VISIBILITY,4],[Dl.SCALE_VISIBILITY,4],[Dl.FRUSTUM_VISIBILITY,4],[Dl.CLOUDS_GENERATOR,4],[Dl.POINT_OF_INTEREST_FREQUENT,6],[Dl.POINT_OF_INTEREST_INFREQUENT,30],[Dl.LABELER,8],[Dl.FEATURE_QUERY_ENGINE,8],[Dl.FEATURE_TILE_TREE,16],[Dl.FEATURE_TILE_TREE_ACTIVE,tA],[Dl.ELEVATION_ALIGNMENT,12],[Dl.ELEVATION_ALIGNMENT_SCENE,14],[Dl.TEXT_TEXTURE_ATLAS,12],[Dl.TEXTURE_UNLOAD,12],[Dl.LINE_OF_SIGHT_TOOL,16],[Dl.LINE_OF_SIGHT_TOOL_INTERACTIVE,tA],[Dl.SNAPPING,tA],[Dl.SHADOW_ACCUMULATOR,30]]);function Spt(i){return xpt.has(i)?xpt.get(i):typeof i=="number"?i:1}const Tpt=6.5,Cpt=1,bGr=30,Ept=1e3/30,Ipt=100,Apt=.9;var M6e,tN;(function(i){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=hB(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new fie("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new r,this._state=$w.INTERACTING,this._tasks=new mg,this._runQueue=new mg,this._load=0,this._idleStateCallbacks=new mg,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=Ki(()=>_Gr.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,js);for(const o of Object.keys(Dl))this.performanceInfo.tasks.set(Dl[o],new fie(Dl[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:Tpt,INTERACTING_BUDGET:Ept,IDLE_BUDGET:Ipt,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:o=>s._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),Hc(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,o){const a=new t(this,s,o);return this._tasks.push(a),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new fie(s)),a}registerIdleStateCallbacks(s,o){const a={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(a),this.state===$w.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(u){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===$w.IDLE&&u()),a.idleBegin=u},set idleEnd(u){a.idleEnd=u}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==$w.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let o=Tpt,a=s.frameDuration,l=Cpt;switch(this.state){case $w.IDLE:o=0,a=Math.max(Ipt,s.frameDuration),l=bGr;break;case $w.INTERACTING:a=Math.max(Ept,s.frameDuration);case $w.ANIMATING:}return a=a-s.elapsedFrameTime-o,this.state!==$w.IDLE&&as.idleBegin())),this._runIdle();break;case $w.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(o=>{o.name===s&&o.setPriority(s)})}_getState(s){if(this._runQueue.some(a=>a.name===s))return tN.SCHEDULED;let o=tN.IDLE;return this._tasks.forAll(a=>{a.name===s&&a.needsUpdate&&(a.schedulePriority<=1?o=tN.READY:o!==tN.READY&&(o=tN.WAITING))}),o}_getRuntime(s){let o=0;return this._tasks.forAll(a=>{a.name===s&&(o+=a.runtime)}),o}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(a=>{a.needsUpdate&&s.set(a.name,(s.get(a.name)||0)+1)}),s.size===0)return null;let o="";return s.forEach((a,l)=>{o+=a>1?` ${a}x ${l}`:` ${l}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((o,a)=>a.needsUpdate?++o:o,0);this._load=this._load*Apt+s*(1-Apt)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===tA&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,o=0;if(this._tasks.forAll(a=>{a.needsUpdate&&a.schedulePriority!==0&&a.basePriority!==tA&&a.blockFrame!==this._frameNumber&&(s=!0,o=Math.max(o,a.basePriority),a.schedulePriority===1?(a.schedulePriority=0,this._runQueue.push(a)):--a.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),a=this._runQueue.pop();this._budget.resetProgress();try{a.task.runTask(this._budget)===P7t&&(a.blockFrame=this._frameNumber)}catch(u){di.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,u),a.blockFrame=this._frameNumber}!this._budget.hasProgressed&&a.blockFrame!==this._frameNumber&&a.needsUpdate&&(a.name,Dl.I3S_CONTROLLER,a.blockFrame=this._frameNumber),a.schedulePriority=a.basePriority;const l=this._budget.now()-o;if(a.runtime+=l,this._frameTaskTimes.set(a.priority,this._frameTaskTimes.get(a.priority)+l),this._debug&&l>2*this._budget.budget&&console.log("Task",a.name,"used",l,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(Dl))this._frameTaskTimes.set(Dl[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((o,a)=>this.performanceInfo.tasks.get(a).record(o)),this.performanceInfo.total.record(s)}get test(){return this._test}}i.Scheduler=e;class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,o,a){this._scheduler=s,this.name=o,this.blockFrame=0,this.runtime=0,this._queue=new vGr,this._handles=new cY,this._basePriority=Spt(o),this.schedulePriority=this._basePriority,this._task=hB(a??this._queue),this._handles.add(v0(()=>this.task.running,l=>s.taskRunningChanged(l)))}remove(){this.processQueue(obe),this._scheduler.removeTask(this),this.schedule=Mpt.schedule,this.reschedule=Mpt.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){if(this.name===s)return;this.name=s;const o=Spt(s);this._basePriority!==tA&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,o,a){return this._queue.push(s,o,a)}reschedule(s,o,a){return this._queue.unshift(s,o,a)}processQueue(s){return this._queue.runTask(s)}}class r{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=$w.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,o){this._begin=this.now(),this._budget=s,this._state=o,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}i.Budget=r})(M6e||(M6e={})),function(i){i.SCHEDULED="s",i.READY="r",i.WAITING="w",i.IDLE="i"}(tN||(tN={}));const obe=(()=>{const i=new M6e.Budget;return i.enabled=!1,i})();let wGr=class{remove(){}processQueue(){}schedule(e,t,r){try{if(xg(t)){const n=Oc();return r?Promise.resolve(r(n)):Promise.reject(n)}return B4e(e(obe))}catch(n){return Promise.reject(n)}}reschedule(e,t,r){return this.schedule(e,t,r)}};const Mpt=new wGr,xGr="unsupported-query",SGr=new eMt(2e6);let TGr=0,lL=class{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:T7t},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new etr(TGr+++"$$",SGr)),this.fieldsIndex=W9(e.fieldsIndex)?e.fieldsIndex:Cd.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=Hc(this._frameTask),this.clearCache(),zo(this._geometryQueryCache),this._changeHandle=Hc(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const r=D1(t);try{return(await this._executeQuery(e,{},r)).createQueryResponse()}catch(n){if(n!==w5)throw n;return new O_([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const r=D1(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},r)).createQueryResponseForCount()}catch(n){if(n!==w5)throw n;return 0}}async executeQueryForExtent(e,t){const r=D1(t),n=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},r),o=s.size;return o?{count:o,extent:await this._getBounds(s.items,s.spatialReference,n||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===w5)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(r=>Array.from(r))}async executeQueryForIdSet(e,t){const r=D1(t);try{const n=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},r),s=n.items,o=new Set;return await this._reschedule(()=>{for(const a of s)o.add(n.featureAdapter.getObjectId(a))},r),o}catch(n){if(n===w5)return new Set;throw n}}async executeQueryForSnapping(e,t){const r=D1(t),{point:n,distance:s,returnEdge:o,vertexMode:a}=e;if(!o&&a==="none")return{candidates:[]};let l=li(e.query);l=await this._schedule(()=>AXe(l,this.definitionExpression,this.spatialReference),r),l=await this._reschedule(()=>bpt(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r);const u=!Ya(n.spatialReference,this.spatialReference);u&&await Gv(n.spatialReference,this.spatialReference);const c=typeof s=="number"?s:s.x,h=typeof s=="number"?s:s.y,p={xmin:n.x-c,xmax:n.x+c,ymin:n.y-h,ymax:n.y+h,spatialReference:n.spatialReference},m=u?Sf(p,this.spatialReference):p;if(!m)return{candidates:[]};const v=(await cy(Ro(n),null,{signal:r}))[0],w=(await cy(Ro(m),null,{signal:r}))[0];if(v==null||w==null)return{candidates:[]};const S=new O_(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(w.toJSON())),r),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(S),r),await this._reschedule(()=>this._executeTimeQuery(S),r),await this._reschedule(()=>this._executeAttributesQuery(S),r),await this._reschedule(()=>this._executeGeometryQueryForSnapping(S,r),r);const I=v.toJSON(),R=u?Sf(I,this.spatialReference):I,L=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:s;return S.createSnappingResponse({...e,point:R,distance:L},n.spatialReference)}async executeQueryForLatestObservations(e,t){const r=D1(t);if(!this.timeInfo?.trackIdField)throw new qe(xGr,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const n=await this._executeQuery(e,{},r);return await this._reschedule(()=>this._filterLatest(n),r),n.createQueryResponse()}catch(n){if(n!==w5)throw n;return new O_([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,r){const n=D1(r),{field:s,field2:o,field3:a,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:s,field2:o,field3:a,valueExpression:l},n)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=D1(e);this._timeExtentPromise||=fGr(this.timeInfo,this.featureStore);const[r,n]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return hn(t),{fullExtent:r,timeExtent:n}}async _getBounds(e,t,r){const n=p3t(Dx(),$V);await this.featureStore.forEachBounds(e,a=>sQ(n,a));const s={xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:aH(this.spatialReference)};this.hasZ&&isFinite(n[2])&&isFinite(n[5])&&(s.zmin=n[2],s.zmax=n[5]);const o=Sf(s,t,r);if(o.spatialReference=aH(r),o.xmax-o.xmin==0){const a=pu(o.spatialReference);o.xmin-=a,o.xmax+=a}if(o.ymax-o.ymin==0){const a=pu(o.spatialReference);o.ymin-=a,o.ymax+=a}if(this.hasZ&&o.zmin!=null&&o.zmax!=null&&o.zmax-o.zmin==0){const a=pu(o.spatialReference);o.zmin-=a,o.zmax+=a}return o}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(obe)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(obe)}async _getAllFeaturesQueryEngineResult(e){return new O_(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const r=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(n=>r.push(n))})().then(()=>r)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,r){e=li(e),e=await this._schedule(()=>vpt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>bpt(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r),e={...e,...t};const n=await this._reschedule(()=>this._executeSceneFilterQuery(e,r),r),s=await this._reschedule(()=>this._executeGeometryQuery(e,n,r),r);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),r),await this._reschedule(()=>this._executeObjectIdsQuery(s),r),await this._reschedule(()=>this._executeTimeQuery(s),r),await this._reschedule(()=>this._executeAttributesQuery(s),r),s}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:r,returnGeometry:n,returnCentroid:s}=e,o=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,l=o==null||Ya(o,a.spatialReference)?a:Sf(a,o);if(!l)return null;const u=n||s,c=Cm(r)&&!Ya(this.spatialReference,r)&&u?async w=>this._project(w,r):w=>w,h=this.featureAdapter,p=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!p.length)return null;const w=new Set;for(const R of p)w.add(h.getObjectId(R));const S=await this._reschedule(()=>this._getAllFeatures(),t),I=await this._reschedule(async()=>{const R=await _U("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),L=B=>!w.has(h.getObjectId(B))||R(h.getGeometry(B)),k=await this._runSpatialFilter(S,L,t);return new O_(k,e,this)},t);return c(I)}if(!p.length)return new O_([],e,this);if(this._canExecuteSinglePass(l,e))return c(new O_(p,e,this));const m=await _U("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),v=await this._runSpatialFilter(p,w=>m(h.getGeometry(w)),t);return c(new O_(v,e,this))}async _executeGeometryQuery(e,t,r){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:n,outSR:s,spatialRel:o,returnGeometry:a,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!n||u==null||Ya(u,n.spatialReference)?n:Sf(n,u),h=a||l,p=Cm(s)&&!Ya(this.spatialReference,s),m=this._geometryQueryCache&&t==null?JSON.stringify(p&&h?{originalFilterGeometry:n,spatialRelationship:o,outSpatialReference:s}:{originalFilterGeometry:n,spatialRelationship:o}):null,v=m?this._geometryQueryCache.get(m):null;if(v!=null)return new O_(v,e,this);const w=async k=>(p&&h&&await this._project(k,s),m&&this._geometryQueryCache.put(m,k.items,k.items.length+1),k);if(!c)return w(t??await this._getAllFeaturesQueryEngineResult(e));const S=this.featureAdapter;let I=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(n)),r);if(o==="esriSpatialRelDisjoint"){if(!I.length)return w(t??await this._getAllFeaturesQueryEngineResult(e));const k=new Set;for(const V of I)k.add(S.getObjectId(V));const B=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),r),$=await this._reschedule(async()=>{const V=await _U(o,c,this.geometryType,this.hasZ,this.hasM),Y=Q=>!k.has(S.getObjectId(Q))||V(S.getGeometry(Q)),K=await this._runSpatialFilter(B,Y,r);return new O_(K,e,this)},r);return w($)}if(t!=null){const k=new Yxe;I=I.filter(B=>KH(t.items,B,t.items.length,k)>=0)}if(!I.length){const k=new O_([],e,this);return m&&this._geometryQueryCache.put(m,k.items,1),k}if(this._canExecuteSinglePass(c,e))return w(new O_(I,e,this));const R=await _U(o,c,this.geometryType,this.hasZ,this.hasM),L=await this._runSpatialFilter(I,k=>R(S.getGeometry(k)),r);return w(new O_(L,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:r}=e,{spatialRel:n}=r;if(!e?.items?.length||!r.geometry||!n)return;const s=await _U(n,r.geometry,this.geometryType,this.hasZ,this.hasM),o=await this._runSpatialFilter(e.items,a=>s(a.geometry),t);e.items=o}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const n of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(n).forEach(s=>t.add(s));const r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>t.has(r(n)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>t.has(r(n)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=O7t(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=w8(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(r=>t.testFeature(r,this.featureAdapter))}}async _runSpatialFilter(e,t,r){if(!t)return e;if(this._frameTask==null)return e.filter(a=>t(a));let n=0;const s=new Array,o=async a=>{for(;no(u),r)}};return this._reschedule(a=>o(a),r).then(()=>s)}_filterLatest(e){const{trackIdField:t,startTimeField:r,endTimeField:n}=this.timeInfo,s=n||r,o=new Map,a=this.featureAdapter.getAttribute;for(const l of e.items){const u=a(l,t),c=a(l,s),h=o.get(u);(!h||c>a(h,s))&&o.set(u,l)}e.items=Array.from(o.values())}_canExecuteSinglePass(e,t){const{spatialRel:r}=t;return _pt(e)&&(r==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(r==="esriSpatialRelIntersects"||r==="esriSpatialRelContains"))}async _project(e,t){if(!t||Ya(this.spatialReference,t))return e;const r=this.featureAdapter;let n;try{const o=await this._getFullExtent();n=Une(this.spatialReference,t,o)}catch{}const s=await Gjr(e.items.map(o=>wP(this.geometryType,this.hasZ,this.hasM,r.getGeometry(o))),this.spatialReference,t,n);return e.items=s.map((o,a)=>r.cloneWithGeometry(e.items[a],Z2(o,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(_pt(e)){if(zd(e))return[cW(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(ed(e))return e.rings.map(t=>cW(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[gY(Wo(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(n=>this.featureStore.forEachInBounds(n,s=>t.add(s))));const r=Array.from(t.values());return t.clear(),r}async _executeQueryForStatistics(e,t,r){e=li(e);try{e=await this._schedule(()=>vpt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>hGr(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r);const n=await this._reschedule(()=>this._executeSceneFilterQuery(e,r),r),s=await this._reschedule(()=>this._executeGeometryQuery(e,n,r),r);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),r),await this._reschedule(()=>this._executeObjectIdsQuery(s),r),await this._reschedule(()=>this._executeTimeQuery(s),r),await this._reschedule(()=>this._executeAttributesQuery(s),r),s}catch(n){if(n!==w5)throw n;return new O_([],e,this)}}};const R7t=/^\s*"([\S\s]*)"\s*$/,D7t=/""/g,F7t=` -`,CGr=[","," ",";","|"," "];function*k7t(i,e,t){let r=0;for(;r<=i.length;){const n=i.indexOf(e,r),s=i.substring(r,n>-1?n:void 0);r+=s.length+e.length,t&&!s.trim()||(yield s)}}function L7t(i){const e=i.includes(`\r + `,uri:"mock"};const a=e.replace("mock:","");if(dO.mocks[a]!==void 0)return{url:"",scheme:"mock",data:dO.mocks[a],uri:e}}throw new _Oe(p9.UnrecognizedUri,{uri:e})}async fetchModule(e){const t=dO.cachedModules.getFromCache(e.uri);if(t)return t;const r=this.fetchSource(e);dO.cachedModules.addToCache(e.uri,r);let n=null;try{n=await r}catch(s){throw dO.cachedModules.removeFromCache(e.uri),s}return n}async fetchSource(e){if(e.scheme==="portal"){const t=await zi(e.url,{responseType:"text",query:{}});if(t.data)return ibe(t.data,[])}if(e.scheme==="mock")return ibe(e.data??"",[]);throw new _Oe(p9.UnsupportedUriProtocol)}static create(e){return new dO(e)}static getDefault(){return this._default??(dO._default=dO._moduleResolverFactory())}static set moduleResolverClass(e){this._moduleResolverFactory=e,this._default=null}};vU.mocks={},vU.cachedModules=new U9r(30),vU._default=null,vU._moduleResolverFactory=()=>{const i=Bu.getDefault();return new vU(i.url)};let z9r=class extends bk{constructor(e,t){super(),this.definition=null,this.context=null,this.definition=e,this.context=t}createFunction(e){return(...t)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new Mt(e,wt.MaximumCallDepth,null);return OOe(this.definition,r,t,null)}}call(e,t){return iP(e,t,(r,n,s)=>{const o={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(o.depthCounter.depth>64)throw new Mt(e,wt.MaximumCallDepth,t);return OOe(this.definition,o,s,t)})}marshalledCall(e,t,r,n){return n(e,t,(s,o,a)=>{const l={spatialReference:e.spatialReference,globalScope:r.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return a=a.map(u=>!mu(u)||u instanceof US?u:wk(u,e,n)),wk(OOe(this.definition,l,a,t),r,n)})}},vq=class extends QY{constructor(e){super(e)}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=ss(this.executingContext,t.node),t.valueset=!0),mu(t.value)&&!(t.value instanceof US)){const r=new US;r.fn=t.value,r.parameterEvaluator=iP,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(mu(t))throw new Mt(null,wt.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let t=e.spatialReference;t==null&&(t=new Xi({wkid:102100})),this.moduleScope=j9t({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new eX(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??G9t,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},ss(this.executingContext,this.source.syntax)}};function V9r(i,e){const t=[];for(let r=0;r=r.length)throw new Mt(i,wt.OutOfBounds,e);t=Ai(r[n]),r[n]=e.operator==="++"?t+1:t-1}else if(r instanceof vn){if(Jr(n)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Mt(i,wt.FieldNotFound,e);t=Ai(r.field(n)),r.setField(n,e.operator==="++"?t+1:t-1)}else if(Sl(r)){if(Jr(n)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(r.hasField(n)!==!0)throw new Mt(i,wt.FieldNotFound,e);t=Ai(r.field(n)),r.setField(n,e.operator==="++"?t+1:t-1)}else{if(Jn(r))throw new Mt(i,wt.Immutable,e);if(!(r instanceof vq))throw new Mt(i,wt.InvalidParameter,e);if(Jr(n)===!1)throw new Mt(i,wt.ModuleAccessorMustBeString,e);if(r.hasGlobal(n)!==!0)throw new Mt(i,wt.ModuleExportNotFound,e);t=Ai(r.global(n)),r.setGlobal(n,e.operator==="++"?t+1:t-1)}return e.prefix===!1?t:e.operator==="++"?t+1:t-1}if(r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"",!r)throw new Mt(i,wt.InvalidIdentifier,e);if(i.localScope!=null&&i.localScope[r]!==void 0)return t=Ai(i.localScope[r].value),i.localScope[r]={value:e.operator==="++"?t+1:t-1,valueset:!0,node:e},e.prefix===!1?t:e.operator==="++"?t+1:t-1;if(i.globalScope[r]!==void 0)return t=Ai(i.globalScope[r].value),i.globalScope[r]={value:e.operator==="++"?t+1:t-1,valueset:!0,node:e},e.prefix===!1?t:e.operator==="++"?t+1:t-1;throw new Mt(i,wt.InvalidIdentifier,e)}function AM(i,e,t,r,n){switch(e){case"=":return i===nn?null:i;case"/=":return Ai(t)/Ai(i);case"*=":return Ai(t)*Ai(i);case"-=":return Ai(t)-Ai(i);case"+=":return Jr(t)||Jr(i)?en(t)+en(i):Ai(t)+Ai(i);case"%=":return Ai(t)%Ai(i);default:throw new Mt(n,wt.UnsupportedOperator,r)}}function Z9r(i,e){let t=null,r="";if(e.left.type==="MemberExpression"){if(t=ss(i,e.left.object),e.left.computed===!0)r=ss(i,e.left.property);else{if(e.left.property.type!=="Identifier")throw new Mt(i,wt.InvalidIdentifier,e);r=e.left.property.name}const s=ss(i,e.right);if(cn(t)){if(!uo(r))throw new Mt(i,wt.ArrayAccessorMustBeNumber,e);if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Mt(i,wt.OutOfBounds,e);if(r===t.length){if(e.operator!=="=")throw new Mt(i,wt.OutOfBounds,e);t[r]=AM(s,e.operator,t[r],e,i)}else t[r]=AM(s,e.operator,t[r],e,i)}else if(t instanceof vn){if(Jr(r)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(t.hasField(r)===!0)t.setField(r,AM(s,e.operator,t.field(r),e,i));else{if(e.operator!=="=")throw new Mt(i,wt.FieldNotFound,e,{key:r});t.setField(r,AM(s,e.operator,null,e,i))}}else if(Sl(t)){if(Jr(r)===!1)throw new Mt(i,wt.KeyAccessorMustBeString,e);if(t.hasField(r)===!0)t.setField(r,AM(s,e.operator,t.field(r),e,i));else{if(e.operator!=="=")throw new Mt(i,wt.FieldNotFound,e,{key:r});t.setField(r,AM(s,e.operator,null,e,i))}}else{if(Jn(t))throw new Mt(i,wt.Immutable,e);if(!(t instanceof vq))throw new Mt(i,wt.InvalidIdentifier,e);if(Jr(r)===!1)throw new Mt(i,wt.ModuleAccessorMustBeString,e);if(t.hasGlobal(r)!==!0)throw new Mt(i,wt.ModuleExportNotFound,e);t.setGlobal(r,AM(s,e.operator,t.global(r),e,i))}return nn}t=e.left.name.toLowerCase();const n=ss(i,e.right);if(i.localScope!=null&&i.localScope[t]!==void 0)return i.localScope[t]={value:AM(n,e.operator,i.localScope[t].value,e,i),valueset:!0,node:e.right},nn;if(i.globalScope[t]!==void 0)return i.globalScope[t]={value:AM(n,e.operator,i.globalScope[t].value,e,i),valueset:!0,node:e.right},nn;throw new Mt(i,wt.InvalidIdentifier,e)}function Q9r(i,e){if(e.expression.type==="AssignmentExpression"||e.expression.type==="UpdateExpression")return ss(i,e.expression);if(e.expression.type==="CallExpression"){const t=ss(i,e.expression);return t===nn?nn:new C3(t)}{const t=ss(i,e.expression);return t===nn?nn:new C3(t)}}function eBr(i,e){const t=ss(i,e.test);if(t===!0)return ss(i,e.consequent);if(t===!1)return e.alternate!==null?ss(i,e.alternate):nn;throw new Mt(i,wt.BooleanConditionRequired,e)}function tBr(i,e){let t=nn;for(let r=0;r=t.length||r<0)throw new Mt(i,wt.OutOfBounds,e);return t[r]}throw new Mt(i,wt.InvalidMemberAccessKey,e)}if(Jr(t)){if(uo(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new Mt(i,wt.OutOfBounds,e);return t[r]}throw new Mt(i,wt.InvalidMemberAccessKey,e)}if(Jn(t)){if(uo(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new Mt(i,wt.OutOfBounds,e);return t.get(r)}throw new Mt(i,wt.InvalidMemberAccessKey,e)}throw new Mt(i,wt.InvalidMemberAccessKey,e)}}catch(t){throw t}}function uBr(i,e){try{const t=ss(i,e.argument);if(ha(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*Ai(t);if(e.operator==="+")return 1*Ai(t);if(e.operator==="~")return~Ai(t);throw new Mt(i,wt.UnsupportedUnaryOperator,e)}if(e.operator==="~")return~Ai(t);if(e.operator==="-")return-1*Ai(t);if(e.operator==="+")return 1*Ai(t);throw new Mt(i,wt.UnsupportedUnaryOperator,e)}catch(t){throw t}}function cBr(i,e){try{const t=[];for(let r=0;r>":case">>>":case"^":case"&":return LTe(Ai(r),Ai(n),e.operator);case"==":return a_(r,n);case"!=":return!a_(r,n);case"<":case">":case"<=":case">=":return kTe(r,n,e.operator);case"+":return Jr(r)||Jr(n)?en(r)+en(n):Ai(r)+Ai(n);case"-":return Ai(r)-Ai(n);case"*":return Ai(r)*Ai(n);case"/":return Ai(r)/Ai(n);case"%":return Ai(r)%Ai(n);default:throw new Mt(i,wt.UnsupportedOperator,e)}}catch(t){throw t}}function dBr(i,e){try{const t=ss(i,e.left);if(ha(t))switch(e.operator){case"||":if(t===!0)return t;{const r=ss(i,e.right);if(ha(r))return r;throw new Mt(i,wt.LogicExpressionOrAnd,e)}case"&&":if(t===!1)return t;{const r=ss(i,e.right);if(ha(r))return r;throw new Mt(i,wt.LogicExpressionOrAnd,e)}default:throw new Mt(i,wt.LogicExpressionOrAnd,e)}throw new Mt(i,wt.LogicalExpressionOnlyBoolean,e)}catch(t){throw t}}function pBr(i,e){return e.value?e.value.cooked:""}function fBr(i,e,t){if(mu(i))throw new Mt(e,wt.NoFunctionInTemplateLiteral,t);return i}function mBr(i,e){let t="",r=0;for(const n of e.quasis)t+=n.value?n.value.cooked:"",n.tail===!1&&(t+=e.expressions[r]?en(fBr(ss(i,e.expressions[r]),i,e)):"",r++);return t}function N9t(i,e){let t;try{const r=e.name.toLowerCase();if(i.localScope!=null&&i.localScope[r]!==void 0)return t=i.localScope[r],t.valueset===!0||(t.value=ss(i,t.node),t.valueset=!0),t.value;if(i.globalScope[r]!==void 0)return t=i.globalScope[r],t.valueset===!0||(t.value=ss(i,t.node),t.valueset=!0),t.value;throw new Mt(i,wt.InvalidIdentifier,e)}catch(r){throw r}}function gBr(i,e){try{if(e.callee.type==="MemberExpression"){const t=ss(i,e.callee.object);if(!(t instanceof vq))throw new Mt(i,wt.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:ss(i,e.callee.property);if(!t.hasGlobal(r))throw new Mt(i,wt.FunctionNotFound,e);const n=t.global(r);if(!mu(n))throw new Mt(i,wt.CallNonFunction,e);return n.call(i,e)}if(e.callee.type!=="Identifier")throw new Mt(i,wt.FunctionNotFound,e);if(i.localScope!=null&&i.localScope[e.callee.name.toLowerCase()]!==void 0){const t=i.localScope[e.callee.name.toLowerCase()];if(mu(t.value))return t.value.call(i,e);throw new Mt(i,wt.CallNonFunction,e)}if(i.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=i.globalScope[e.callee.name.toLowerCase()];if(mu(t.value))return t.value.call(i,e);throw new Mt(i,wt.CallNonFunction,e)}throw new Mt(i,wt.FunctionNotFound,e)}catch(t){throw t}}const dv={};function $9t(i,e,t,r){try{const n=e.arguments,s=ss(i,n[t]);if(a_(s,r))return ss(i,n[t+1]);{const o=n.length-t;return o===1?ss(i,n[t]):o===2?null:o===3?ss(i,n[t+2]):$9t(i,e,t+2,r)}}catch(n){throw n}}function B9t(i,e,t,r){try{const n=e.arguments;if(r===!0)return ss(i,n[t+1]);if(n.length-t===3)return ss(i,n[t+2]);{const s=ss(i,n[t+2]);if(ha(s)===!1)throw new Mt(i,wt.BooleanConditionRequired,n[t+2]);return B9t(i,e,t+2,s)}}catch(n){throw n}}function OOe(i,e,t,r){try{const n=i.body;if(t.length!==i.params.length)throw new Mt(e,wt.WrongNumberOfParameters,r);if(e.localScope!=null)for(let o=0;oqZe);return V9t=!0,E8r(i),!0}let ROe=null;function yXe(){return ROe!==null||(ROe=Y9t()),ROe}async function Y9t(){await E9r(),iE=await Promise.resolve().then(()=>U9n);for(const i of C6e)iE.extend(i),AB(i,"async");return C6e=null,!0}function X9t(){return z9t}function J9t(){return!!iE}function K9t(){return V9t}let DOe=null;function vXe(){return DOe||(DOe=Z9t(),DOe)}async function Z9t(){await yXe();const[i,e,t,r,n,s]=await Promise.all([Promise.resolve().then(()=>fBn),Promise.resolve().then(()=>_Bn),Promise.resolve().then(()=>wBn),Promise.resolve().then(()=>SBn),Promise.resolve().then(()=>CBn),Promise.resolve().then(()=>MBn)]);return rBt=i,iE.extend([e,t,r,n,s]),AB([e,t,r,n,s],"async"),z9t=!0,!0}function Q9t(i,e=[]){return i.usesFeatureSet===void 0&&dle(i,e),i.usesFeatureSet===!0}function SBr(i,e=[]){return i.isAsync===void 0&&dle(i,e),i.isAsync===!0}function TBr(i,e){if(e){for(const t of e)if(jTe(i,t))return!0;return!1}return!1}async function eBt(i,e,t=[],r=!1,n=null){return _Xe(new Set,i,e,t,r,n)}async function _Xe(i,e,t,r=[],n=!1,s=null){const o=typeof e=="string"?fXe(e):e,a=[];return o&&(K9t()===!1&&(GTe(o)||n)&&a.push(gXe()),J9t()===!1&&(o.isAsync===!0||t)&&a.push(yXe()),X9t()===!1&&(Q9t(o)||TBr(o,r))&&a.push(vXe())),a.length&&await Promise.all(a),await tBt(i,o,s,t,n),!0}function CBr(i,e=[]){return i.usesModules===void 0&&dle(i,e),i.usesModules===!0}async function tBt(i,e,t=null,r=!1,n=!1){const s=u9t(e);t===null&&s.length>0&&(t=vU.getDefault()),e.loadedModules={};for(const o of s){Of(t);const a=t.normalizeModuleUri(o.source);if(i.has(a.uri))throw new Mt(null,wt.CircularModules,null);i.add(a.uri);const l=await t.fetchModule(a);await _Xe(i,l,r,[],n,t),i.delete(a.uri),l.isAsync&&(e.isAsync=!0),l.usesFeatureSet&&(e.usesFeatureSet=!0),l.usesGeometry&&(e.usesGeometry=!0),e.loadedModules[o.libname]={uri:a.uri,script:l}}}function iBt(i){if(GTe(i))return!0;const e=f6e(i);let t=!1;for(let r=0;r{tpt.test(o)&&(o=o.replace(tpt,""),n.push(o))});const s=n.filter(o=>o.includes("*"));return n=n.filter(o=>!s.includes(o)),e&&s.forEach(o=>{const a=new RegExp(`^${o.split(/\*+/).map(ABr).join(".*")}$`,"i");e.forEach(l=>a.test(l)?n.push(l):null)}),[...new Set(n.sort())]}function $Br(i){return jTe(i,"$view")}function BBr(i,e){return!!i&&jTe(i,e)}function jBr(i){if(!(!i||i.spatialReference==null&&(i.scale==null||i.viewingMode==null)))return{view:i.viewingMode&&i.scale!=null?new vn({viewingMode:i.viewingMode,scale:i.scale}):null,sr:i.spatialReference}}function GBr({url:i,spatialReference:e,lrucache:t,interceptor:r}){const n=UTe();return n?n.createFeatureSetCollectionFromService(i,e,t,r):null}function UBr({layer:i,spatialReference:e,outFields:t,returnGeometry:r,lrucache:n,interceptor:s}){if(i===null)return null;const o=UTe();return o?o.constructFeatureSet(i,e,t,r??!0,n,s):null}function zBr(i){if(i?.map===null)return null;const e=UTe();return e?e.createFeatureSetCollectionFromMap(i.map,i.spatialReference,i.lrucache,i.interceptor):null}function VBr(i,e){return vn.convertJsonToArcade(i,e)}function HBr(i,e,t=[]){return eBt(i,e,t)}function WBr(){return gXe()}function qBr(){return vXe()}function YBr(i){return i.type==="simple"||i.type==="class-breaks"||i.type==="unique-value"||i.type==="dot-density"||i.type==="dictionary"||i.type==="pie-chart"}function XBr(i){return i.declaredClass==="esri.layers.support.LabelClass"}function JBr(i){return i.declaredClass==="esri.PopupTemplate"}function nBt(i,e){if(!i)return!1;if(typeof i=="string")return e(i);const t=i;if(YBr(t)){if(t.type==="dot-density"){const s=t.attributes?.some(o=>e(o.valueExpression));if(s)return s}const r=t.visualVariables,n=!!r&&r.some(s=>{let o=e(s.valueExpression);return s.type==="size"&&(ipt(s.minSize)&&(o=o||e(s.minSize.valueExpression)),ipt(s.maxSize)&&(o=o||e(s.maxSize.valueExpression))),o});return!(!("valueExpression"in t)||!e(t.valueExpression))||n}if(XBr(t)){const r=t.labelExpressionInfo?.expression;return!(!r||!e(r))||!1}return!!JBr(t)&&(!!t.expressionInfos&&t.expressionInfos.some(r=>e(r.expression))||Array.isArray(t.content)&&t.content.some(r=>r.type==="expression"&&e(r.expressionInfo?.expression)))}function KBr(i){const e=ple(i);return!!e&&iBt(e)}function ZBr(i){return nBt(i,KBr)}function QBr(i){const e=ple(i);return!!e&>e(e)}function e7r(i){return nBt(i,QBr)}function ipt(i){return i&&i.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const t7r=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:vn,arcade:EBr,arcadeFeature:Lc,convertFeatureLayerToFeatureSet:UBr,convertJsonToArcade:VBr,convertMapToFeatureSetCollection:zBr,convertServiceUrlToWorkspace:GBr,createExecContext:PBr,createFeature:RBr,createFunction:OBr,createSyntaxTree:ple,dependsOnView:$Br,enableFeatureSetOperations:qBr,enableGeometryOperations:WBr,evalSyntaxTree:FBr,executeAsyncFunction:LBr,executeFunction:kBr,extractFieldNames:NBr,getArcadeType:MBr,getViewInfo:jBr,hasGeometryFunctions:ZBr,hasGeometryOperations:e7r,hasVariable:BBr,loadScriptDependencies:HBr,updateExecContext:DBr},Symbol.toStringTag,{value:"Module"}));function i7r(i){return i=i||globalThis.location.hostname,r7r.some(e=>i?.match(e)!=null)}function E6e(i,e){return i&&(e=e||globalThis.location.hostname)?e.match(sBt)!=null||e.match(aBt)!=null?i.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(oBt)!=null||e.match(lBt)!=null?i.replace("static.arcgis.com","staticqa.arcgis.com"):i:i}const sBt=/^devext.arcgis.com$/,oBt=/^qaext.arcgis.com$/,aBt=/^[\w-]*\.mapsdevext.arcgis.com$/,lBt=/^[\w-]*\.mapsqa.arcgis.com$/,r7r=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,sBt,oBt,/^jsapps.esri.com$/,aBt,lBt];function n7r(i,e,t,r){const n=i.name;return n==null?Promise.reject(new qe("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):i.styleName&&i.styleName==="Esri2DPointSymbolsStyle"?s7r(n,e,r):UMt(i,e,r).then(s=>cBt(s,n,e,t,Gir,r))}function uBt(i,e){return e.items.find(t=>t.name===i)}function cBt(i,e,t,r,n,s){const o=t?.portal!=null?t.portal:Bu.getDefault(),a={portal:o,url:Yo(i.baseUrl),origin:"portal-item"},l=uBt(e,i.data);if(!l){const m=`The symbol name '${e}' could not be found`;return Promise.reject(new qe("symbolstyleutils:symbol-name-not-found",m,{symbolName:e}))}let u=mE(n(l,r),a),c=l.thumbnail?.href??null;const h=l.thumbnail?.imageData;i7r()&&(u=E6e(u)??"",c=E6e(c));const p={portal:o,url:Yo(eae(u)),origin:"portal-item"};return wVe(u,s).then(m=>{const v=r==="cimRef"?zMt(m.data):m.data,w=wae(v,p);if(w&&JF(w)){if(c){const S=mE(c,a);w.thumbnail=new X8({url:S})}else h&&(w.thumbnail=new X8({url:`data:image/png;base64,${h}`}));i.styleUrl?w.styleOrigin=new Rne({portal:t.portal,styleUrl:i.styleUrl,name:e}):i.styleName&&(w.styleOrigin=new Rne({portal:t.portal,styleName:i.styleName,name:e}))}return w})}function s7r(i,e,t){const r=Uir.replaceAll(/\{SymbolName\}/gi,i),n=e.portal!=null?e.portal:Bu.getDefault();return wVe(r,t).then(s=>{const o=zMt(s.data);return wae(o,{portal:n,url:Yo(eae(r)),origin:"portal-item"})})}const o7r=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:cBt,getStyleItemFromStyle:uBt,resolveWebStyleSymbol:n7r},Symbol.toStringTag,{value:"Module"}));function a7r(i,e){for(var t=0;tr[n]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}var hBt={exports:{}};(function(i,e){function t(){function n(A){if(typeof A=="number")return ye.Tc.Zg(A);if(A==null)return null;if(ht[A]!=null)return ye.Tc.Zg(ht[A]);throw Error("Unrecognised Unit Type")}function s(A){if(typeof A=="number")return ye.Tc.Zg(A);if(A==null)return null;if(Ht[A]!=null)return ye.Tc.Zg(Ht[A]);throw Error("Unrecognised Unit Type")}function o(A){if(A)switch(A){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function a(A,ue,G,E){if(G==null||G.B())return null;switch(G.getType()){case ye.qn.Point:return A.exportPoint(ue,G,E);case ye.qn.Polygon:return A.exportPolygon(ue,G,E);case ye.qn.Polyline:return A.exportPolyline(ue,G,E);case ye.qn.MultiPoint:return A.exportMultipoint(ue,G,E);case ye.qn.Envelope:return A.exportExtent(ue,G,E)}return null}function l(A,ue,G,E){if(G.getType()!==ye.qn.Point)throw Error("Geometry not Point");return A.exportPoint(ue,G,E)}function u(A,ue,G){return A.convertToGEGeometry(ue,G)}function c(A){var ue=A.wkid;A=A.wkt2||A.wkt;var G=_t.get(ue||A);return G==null&&(ue!==-1&&ue!=null?(G=ye.Eg.create(ue),_t.set(ue,G)):A&&(G=ye.Eg.qP(A),_t.set(A,G)),Yt.has(ue||A)&&G.VW(Yt.get(ue||A))),G}function h(A){var ue,G,E;if(A==null)return null;var _=c(A);return A=_.Hd(),_=_.Kn(),(ue={}).tolerance=_,ue.unitType=A==null?-1:A.od,ue.unitID=A==null?-1:A.Ec(),ue.unitBaseFactor=A==null?0:A.ai,ue.unitSquareDerivative=A==null?0:(E=(G=ye.Tc.aG(A))===null||G===void 0?void 0:G.Ec())!==null&&E!==void 0?E:0,ue}function p(A,ue,G,E){return G==null?null:(G=ye.$b.clip(u(A,Fe,G),u(A,Fe,E),c(ue)),a(A,Fe,G,ue))}function m(A,ue,G,E){G=ye.$b.dl(u(A,Fe,G),u(A,Fe,E),c(ue)),E=[];for(var _=0;_>6)>>1},E.Rn=function(_){return(32&_)!=0},E.US=function(_){return(128&_)!=0},E.yd=function(_){return(256&_)!=0},E.xj=function(_){return(512&_)!=0},E.Hc=function(_){return(1024&_)!=0},E.prototype.Of=function(){var _=this.Ia();return this.copyTo(_),_},E.prototype.mg=function(){return null},E.jg=function(_){var g=_.Ia();return _.copyTo(g),g},E.prototype.vc=function(){0<=this.VA&&(this.VA+=2147483649)},E.Ax=function(_){var g=_.getType();if(E.xj(g))return _.I();if(_.B())return 0;if(g==197)return 4;if(g==33)return 1;if(E.yd(g))return 2;throw A.i.fa("missing type")},E}();A.aa=G})(ye||(ye={})),Ke=ye||(ye={}),ke=function(){function A(){this.y=this.x=0}return A.construct=function(ue,G){var E=new A;return E.x=ue,E.y=G,E},A.al=function(ue){var G=new A;return G.x=ue.x,G.y=ue.y,G},A.prototype.ma=function(ue,G){this.x=ue,this.y=G},A.prototype.L=function(ue){this.x=ue.x,this.y=ue.y},A.prototype.fq=function(ue,G){return this.x===ue&&this.y===G},A.prototype.Rz=function(ue){return 2220446049250313e-31>=Math.abs(this.x-ue.x)&&2220446049250313e-31>=Math.abs(this.y-ue.y)},A.prototype.qb=function(ue){return this.x===ue.x&&this.y===ue.y},A.prototype.Nb=function(ue){return ue==this||ue instanceof A&&this.x==ue.x&&this.y==ue.y},A.prototype.sub=function(ue){this.x-=ue.x,this.y-=ue.y},A.prototype.uc=function(ue,G){this.x=ue.x-G.x,this.y=ue.y-G.y},A.prototype.add=function(ue,G){G!==void 0?(this.x=ue.x+G.x,this.y=ue.y+G.y):(this.x+=ue.x,this.y+=ue.y)},A.prototype.Sq=function(){this.x=-this.x,this.y=-this.y},A.prototype.mt=function(ue){this.x=-ue.x,this.y=-ue.y},A.prototype.NS=function(ue,G,E){this.x=ue.x*(1-E)+G.x*E,this.y=ue.y*(1-E)+G.y*E},A.prototype.Ct=function(ue,G){this.x=this.x*ue+G.x,this.y=this.y*ue+G.y},A.prototype.HW=function(ue,G,E){this.x=G.x*ue+E.x,this.y=G.y*ue+E.y},A.prototype.scale=function(ue){this.x*=ue,this.y*=ue},A.prototype.compare=function(ue){return this.yue.y?1:this.xue.x?1:0},A.prototype.normalize=function(){var ue=this.length();ue==0&&(this.x=1,this.y=0),this.x/=ue,this.y/=ue},A.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},A.prototype.Sk=function(){return this.x*this.x+this.y*this.y},A.tb=function(ue,G){return Math.sqrt(this.yc(ue,G))},A.Oy=function(ue,G,E,_){return ue-=E,G-=_,Math.sqrt(ue*ue+G*G)},A.prototype.Qh=function(ue){return this.x*ue.x+this.y*ue.y},A.prototype.fD=function(ue){return Math.abs(this.x*ue.x)+Math.abs(this.y*ue.y)},A.prototype.wi=function(ue){return this.x*ue.y-this.y*ue.x},A.prototype.Bt=function(ue,G){var E=-this.x*G+this.y*ue;this.x=this.x*ue+this.y*G,this.y=E},A.prototype.Hv=function(){var ue=this.x;this.x=-this.y,this.y=ue},A.prototype.MG=function(ue){this.x=-ue.y,this.y=ue.x},A.prototype.ar=function(){var ue=this.x;this.x=this.y,this.y=-ue},A.prototype.qu=function(){return 0(ue=ue.wi(G))?1:0(E=_.value())?-1:0E?-1:0=g?E+(_-E)*g:_-(_-E)*(1-g)},G.OG=function(E,_,g,b){.5>=g?(b.x=E.x+(_.x-E.x)*g,b.y=E.y+(_.y-E.y)*g):(b.x=_.x-(_.x-E.x)*(1-g),b.y=_.y-(_.y-E.y)*(1-g))},G.lT=function(E,_,g,b,C,O){.5>=C?(O.x=E+(g-E)*C,O.y=_+(b-_)*C):(O.x=g-(g-E)*(1-C),O.y=b-(b-_)*(1-C))},G}()}(ye||(ye={})),function(A){var ue=function(G){function E(){var _=G.call(this)||this;return _.sa=0,_.na=0,_.pa=0,_.la=0,_.ka=null,_}return me(E,G),E.prototype.ac=function(){return A.h.construct(this.sa,this.na)},E.prototype.Yp=function(_){_.x=this.sa,_.y=this.na},E.prototype.Dc=function(_){this.em(0,_)},E.prototype.ZB=function(_,g){this.em(0,A.h.construct(_,g))},E.prototype.To=function(_){this.hD(0,_)},E.prototype.setStart=function(_){this.uD(0,_)},E.prototype.wv=function(_,g){return this.Od(0,_,g)},E.prototype.YB=function(_,g,b){this.tn(0,_,g,b)},E.prototype.wc=function(){return A.h.construct(this.pa,this.la)},E.prototype.Tr=function(_){_.x=this.pa,_.y=this.la},E.prototype.Qc=function(_){this.em(1,_)},E.prototype.Ql=function(_,g){this.em(1,A.h.construct(_,g))},E.prototype.Po=function(_){this.hD(1,_)},E.prototype.setEnd=function(_){this.uD(1,_)},E.prototype.gv=function(_,g){return this.Od(1,_,g)},E.prototype.OB=function(_,g,b){this.tn(1,_,g,b)},E.prototype.Db=function(){return 1},E.prototype.B=function(){return this.Ac()},E.prototype.Oa=function(){},E.prototype.Ke=function(){return 0},E.prototype.Ea=function(_,g,b,C,O){return this.KM(_,g,b,C,O)},E.prototype.isIntersecting=function(_,g){return this.zr(_,g,!1)!=0},E.prototype.qs=function(_,g){return this.ru(_,g,!1)},E.prototype.ru=function(){return null},E.prototype.Ac=function(){return!1},E.prototype.ay=function(_){if(this.vc(),this.ka==null&&0<_)this.ka=A.O.lg(2*_);else if(this.ka!=null&&this.ka.length<2*_){for(var g=this.ka.slice(0),b=this.ka.length;b<2*_;b++)g[b]=0;this.ka=g}},E.gM=function(_,g,b){if(0=A.ra.Va(g))throw A.i.ce();var C=this.description.Pf(g);return 0<=C?(this.ka!=null&&this.ay(this.description.Ae.length-2),this.ka[E.Gg(this.description,_)+this.description.$j(C)-2+b]):A.ra.se(g)},E.prototype.tn=function(_,g,b,C){if(this.vc(),b>=A.ra.Va(g))throw A.i.ce();var O=this.description.Pf(g);0>O&&(this.re(g),O=this.description.Pf(g)),g==0?_!=0?b!=0?this.la=C:this.pa=C:b!=0?this.na=C:this.sa=C:(this.ka==null&&this.ay(this.description.Ae.length-2),this.ka[E.Gg(this.description,_)+this.description.$j(O)-2+b]=C)},E.prototype.copyTo=function(_){if(_.getType()!=this.getType())throw A.i.N();_.description=this.description,_.ay(this.description.Ae.length-2),E.gM(this.ka,_.ka,2*(this.description.Ae.length-2)),_.sa=this.sa,_.na=this.na,_.pa=this.pa,_.la=this.la,_.vc(),this.op(_)},E.prototype.Tg=function(_,g){var b=new A.Nc;return this.Ac()?(b.Oa(),b):(b.oa=this.Od(0,_,g),b.va=b.oa,b.Lk(this.Od(1,_,g)),b)},E.prototype.ZI=function(_){this.Ac()?_.Oa():(_.oa=this.Od(0,0,0),_.va=_.oa,_.Lk(this.Od(1,0,0)))},E.prototype.Tw=function(_,g){g.Nf(this.description),g.Cb(this.hc(_));for(var b=1,C=this.description.Aa;bg||g>=this.wa)throw A.i.fa("index out of bounds");this.mc(),b.Nf(this.description),b.B()&&b.un();for(var C=0;Cg||g>=this.I())throw A.i.ce();this.mc(),this.za[0].tc(2*g,b)},_.prototype.Na=function(g){var b=new A.h;return this.D(g,b),b},_.prototype.Gc=function(g,b){this.za[0].tc(2*g,b)},_.prototype.Cb=function(g,b,C){if(0>g||g>=this.wa)throw A.i.ce();this.mc();var O=this.za[0];C!==void 0?(O.write(2*g,b),O.write(2*g+1,C)):O.Tt(2*g,b),this.Pc(1993)},_.prototype.Cz=function(){if(void 0>=this.I())throw A.i.ce();this.mc();var g=this.za[0],b=new A.Nd;return b.x=g.read(NaN),b.y=g.read(NaN),b.z=this.hasAttribute(1)?this.za[1].eg():A.ra.se(1),b},_.prototype.dC=function(g){if(0>g||g>=this.I())throw A.i.ce();this.re(1),this.mc(),this.Pc(1993);var b=this.za[0];b.write(2*g,(void 0).x),b.write(2*g+1,(void 0).y),this.za[1].pr(g,(void 0).z)},_.prototype.Uc=function(g,b,C){if(0>b||b>=this.wa)throw A.i.ce();var O=A.ra.Va(g);if(C>=O)throw A.i.ce();this.mc();var F=this.description.Pf(g);return 0<=F?this.za[F].eg(b*O+C):A.ra.se(g)},_.prototype.yF=function(g,b){return this.Uc(g,b)},_.prototype.setAttribute=function(g,b,C,O){if(0>b||b>=this.wa)throw A.i.ce();var F=A.ra.Va(g);if(C>=F)throw A.i.ce();this.re(g),this.mc(),g=this.description.Pf(g),this.Pc(1993),this.za[g].pr(b*F+C,O)},_.prototype.ub=function(g){return this.wx(),this.re(g),this.mc(),this.za[this.description.Pf(g)]},_.prototype.hn=function(g,b){if(b!=null&&A.ra.Tp(g)!=b.Tp())throw A.i.N();this.re(g),g=this.description.Pf(g),this.za==null&&(this.za=A.Yc.qI(this.description.Aa)),this.za[g]=b,this.Pc(16777215)},_.prototype.sn=function(g){var b=null;if(this.za!=null){var C=A.ee.Iw(g,this.description);b=[];for(var O=0,F=g.Aa;Othis.wa+5?(5*this.wa+3)/4:this.wa),this.za[g].resize(O*C,A.ra.se(b))),Og)throw A.i.N();g!=this.wa&&(this.wa=g,this.Pc(65535))},_.prototype.om=function(g){if(!this.ak(1)){if(!this.ak(2))return 0;if(this.QT>=g)return this.ak(8)?1:2}return-1},_.prototype.Ch=function(g,b){if(this.QT=b,g==-1)this.Lf(1,!0),this.Lf(8,!0);else if(this.Lf(1,!1),this.Lf(8,!0),g==0)this.Lf(2,!1),this.Lf(4,!1);else if(g==1)this.Lf(2,!0),this.Lf(4,!1);else{if(g!=2)throw A.i.fa("internal error.");this.Lf(2,!0),this.Lf(4,!0)}},_.prototype.lM=function(){this.Bb!=null&&(this.Bb=null)},_.prototype.kD=function(g,b,C,O){if(0>g||g>=this.wa||0>b||b>=this.wa)throw A.i.fa("index out of bounds");this.mc(),O.Nf(this.description),O.B()&&O.un();for(var F=0;Fg||g>=this.wa)throw A.i.ce();this.mc();var b=new A.Sa;b.Nf(this.description),b.B()&&b.un();for(var C=0;Cg||g>=this.wa)throw A.i.ce();if(b.B())throw A.i.N();this.mc();for(var C=b.description,O=0;OA.O.bB(this.Tm)>>1:_!=-1)?E=_:b=F,_=!0;;){if(0>b){if((F=O[7*E])==-1){b=E,g=this.ob.Ll([-1,-1,E,g,this.gl(),-1,-1]),(O=this.ob.o)[7*E]=g;break}E=F}else{if((F=O[7*E+1])==-1){b=O[7*E+6],g=this.ob.Ll([-1,-1,E,g,this.gl(),-1,-1]),(O=this.ob.o)[7*E+1]=g;break}E=F}_&&(b*=-1,_=!1)}return this.oy(g,O),O[7*g+2]===-1&&(O[7*C]=g),this.vp(b,g,C,O),g},G.prototype.FF=function(){return this.iR(this.Qe)},G.prototype.vd=function(E,_){_=_==-1?this.Qe:_,this.Rv?this.LP(E,_):this.iY(E,_)},G.prototype.search=function(E,_){for(_=this.sv(_);_!=-1;){var g=this.Zn.compare(this,E,_);if(g==0)return _;_=0>g?this.ll(_):this.Xp(_)}return-1},G.prototype.IW=function(E){for(var _=this.sv(-1),g=-1;_!=-1;){var b=E.compare(this,_);if(b==0)return _;0>b?_=this.ll(_):(g=_,_=this.Xp(_))}return g},G.prototype.uJ=function(E){for(var _=this.sv(-1),g=-1;_!=-1;){var b=E.compare(this,_);if(b==0)return _;0>b?(g=_,_=this.ll(_)):_=this.Xp(_)}return g},G.prototype.ja=function(E){return this.ob.T(E,3)},G.prototype.ll=function(E){return this.ob.T(E,0)},G.prototype.Xp=function(E){return this.ob.T(E,1)},G.prototype.getParent=function(E){return this.ob.T(E,2)},G.prototype.lb=function(E){return this.ob.T(E,6)},G.prototype.we=function(E){return this.ob.T(E,5)},G.prototype.rc=function(E){return E==-1?this.kl(this.Qe):this.kl(E)},G.prototype.Fc=function(E){return E==-1?this.Zr(this.Qe):this.Zr(E)},G.prototype.ZR=function(E){return E==-1?this.bG(this.Qe):this.bG(E)},G.prototype.Sj=function(E,_){this.NB(E,_)},G.prototype.sv=function(E){return E==-1?this.YF(this.Qe):this.YF(E)},G.prototype.clear=function(){this.ob.mj(!1),this.Qe=-1},G.prototype.size=function(E){return E==-1?this.$F(this.Qe):this.$F(E)},G.prototype.KN=function(E,_){for(var g=_[7*E],b=_[7*E+1],C=_[7*E+4];g!=-1||b!=-1;){var O=g!=-1?_[7*g+4]:2147483647;if(b=b!=-1?_[7*b+4]:2147483647,C<=Math.min(O,b))break;O<=b?this.sJ(g,_):this.rJ(E,_),g=_[7*E],b=_[7*E+1]}},G.prototype.oy=function(E,_){if(this.Rv)for(var g=_[7*E+4],b=_[7*E+2];b!=-1&&_[7*b+4]>g;)_[7*b]==E?this.sJ(E,_):this.rJ(b,_),b=_[7*E+2]},G.prototype.rJ=function(E,_){var g=_[7*E+1];_[7*g+2]=_[7*E+2],_[7*E+2]=g;var b=_[7*g];_[7*E+1]=b,b!=-1&&(_[7*b+2]=E),_[7*g]=E,(b=_[7*g+2])!=-1&&(_[7*b]==E?_[7*b]=g:_[7*b+1]=g)},G.prototype.sJ=function(E,_){var g=_[7*E+2];_[7*E+2]=_[7*g+2],_[7*g+2]=E;var b=_[7*E+1];_[7*g]=b,b!=-1&&(_[7*b+2]=g),_[7*E+1]=g,(b=_[7*E+2])!=-1&&(_[7*b]===g?_[7*b]=E:_[7*b+1]=E)},G.prototype.Pk=function(E,_){this.ob.S(E,2,_)},G.prototype.TB=function(E,_){this.ob.S(E,0,_)},G.prototype.XB=function(E,_){this.ob.S(E,1,_)},G.prototype.WB=function(E,_){this.ob.S(E,5,_)},G.prototype.ex=function(E,_){this.ob.S(E,6,_)},G.prototype.XJ=function(E,_){this.ob.S(_,0,E)},G.prototype.rX=function(E){this.ob.S(E,4,0)},G.prototype.uX=function(E,_){this.ob.S(_,5,E)},G.prototype.YF=function(E){return E==-1?-1:this.ob.T(E,0)},G.prototype.kl=function(E){return E==-1?-1:this.ob.T(E,1)},G.prototype.Zr=function(E){return E==-1?-1:this.ob.T(E,2)},G.prototype.iR=function(E){return E==-1?-1:this.ob.T(E,3)},G.prototype.$F=function(E){return E==-1?0:this.ob.T(E,4)},G.prototype.bG=function(E){return this.ob.T(E,5)},G.prototype.Pw=function(){return this.ob.Ll([-1,-1,-1,void 0,this.gl(),-1,-1])},G.prototype.fl=function(E){E!=-1&&this.ob.jd(E)},G.prototype.gl=function(){return this.Tm=A.O.bB(this.Tm),1073741823&this.Tm},G.prototype.FD=function(E,_,g){var b=this.ob.o;if(g==-1||b[7*g]==-1)return E=this.ob.Ll([-1,-1,-1,E,this.gl(),-1,-1]),(b=this.ob.o)[7*g]=E,this.vp(-1,E,g,b),E;for(var C=g==-1?-1:b[7*g];;){var O=_==-1?1:this.Zn.compare(this,E,C);if(0>O){if((O=this.ll(C))==-1){_=C,E=this.ob.Ll([-1,-1,C,E,this.gl(),-1,-1]),(b=this.ob.o)[7*C]=E;break}C=O}else{if(_==1&&O==0)return b[7*g+3]=C,-1;if((O=b[7*C+1])==-1){_=b[7*C+6],E=this.ob.Ll([-1,-1,C,E,this.gl(),-1,-1]),(b=this.ob.o)[7*C+1]=E;break}C=O}}return this.oy(E,b),b[7*E+2]===-1&&(b[7*g]=E),this.vp(_,E,g,b),E},G.prototype.vp=function(E,_,g,b){if(E!=-1){var C=b[7*E+5];b[7*E+5]=_}else C=g==-1?-1:b[7*g+2];b[7*_+5]=C,C!=-1&&(b[7*C+6]=_),b[7*_+6]=E,E==(g==-1?-1:b[7*g+1])&&(b[7*g+1]=_),E==-1&&(b[7*g+2]=_),b[7*g+4]=(g==-1?0:b[7*g+4])+1},G.prototype.AB=function(E,_){var g=this.ob.o,b=g[7*E+5];E=g[7*E+6],b!=-1?g[7*b+6]=E:g[7*_+1]=E,E!=-1?g[7*E+5]=b:g[7*_+2]=b,g[7*_+4]=_===-1?-1:g[7*_+4]-1},G.prototype.iY=function(E,_){this.AB(E,_);var g=this.ll(E),b=this.Xp(E),C=this.getParent(E),O=E;if(g!=-1&&b!=-1){this.Tm=A.O.bB(this.Tm);var F=1073741823=E.oa:E.va>=this.oa},G.prototype.move=function(E){this.B()||(this.oa+=E,this.va+=E)},G.prototype.normalize=function(){if(!isNaN(this.oa)){if(this.oa>this.va){var E=this.oa;this.oa=this.va,this.va=E}isNaN(this.va)&&this.Oa()}},G.prototype.Oa=function(){this.va=this.oa=NaN},G.prototype.B=function(){return isNaN(this.oa)},G.prototype.Zb=function(E){typeof E=="number"?this.B()?this.va=this.oa=E:this.Lk(E):E.B()||(this.B()?(this.oa=E.oa,this.va=E.va):(this.oa>E.oa&&(this.oa=E.oa),this.vathis.va&&this.Oa()))},G.prototype.Lk=function(E){Ethis.va&&(this.va=E)},G.prototype.contains=function(E){return typeof E=="number"?E>=this.oa&&E<=this.va:E.oa>=this.oa&&E.va<=this.va},G.prototype.Ea=function(E){this.B()||E.B()?this.Oa():(this.oaE.va&&(this.va=E.va),this.oa>this.va&&this.Oa())},G.prototype.W=function(E){this.B()||(this.oa-=E,this.va+=E,this.va_?(this.oa=_,this.va=E):(this.oa=E,this.va=_)},G.prototype.It=function(E){return A.O.Rk(E,this.oa,this.va)},G.prototype.R=function(){return this.va-this.oa},G.prototype.sf=function(){return .5*(this.oa+this.va)},G.prototype.Nb=function(E){return E==this||E instanceof G&&(!(!this.B()||!E.B())||this.oa==E.oa&&this.va==E.va)},G.prototype.cc=function(){return A.O.uj(A.O.uj())},G}();A.Nc=ue}(ye||(ye={})),function(A){var ue=new A.Nc,G=new A.Nc,E=function(){this.ne=null,this.pb=-1,this.sb=new A.yb,this.qA=55555555,this.Tv=this.Vv=!1,this.Uf=new A.Nc,this.Uf.KB(0,0)};A.IY=E;var _=function(){function g(b,C,O){this.g=b,this.Hk=NaN,this.NH=this.Kq=0,this.OH=NaN,this.qa=C,this.Nq=10*C,this.PH=this.QH=NaN,this.rg=!1,this.Dm=this.gt=this.Lo=this.Xs=this.Ws=-1,this.gA=O,this.TA=new E,this.YH=new E,A.O.truncate(3*b.fd/2)}return g.prototype.mG=function(b,C,O,F){b.ne=F===null?null:F[O[5*C]],b.Tv=b.ne!=null,b.Tv||((F=O[5*C+2])!==-1&&this.g.mW(O[5*C],O[5*F],b.sb),b.ne=b.sb,b.Uf.KB(b.sb.sa,b.sb.pa),b.Uf.va+=this.qa,b.sb.rI(),b.Vv=b.sb.la==b.sb.na,b.Vv||(b.qA=(b.sb.pa-b.sb.sa)/(b.sb.la-b.sb.na)))},g.prototype.OO=function(b,C){var O=b.zr(C,this.qa,!0);return O!=0?O==2?this.Qy():this.xi():(b.Yp(ge),b.Tr(je),C.Yp(rt),C.Tr(Me),ie.ma(this.Kq,this.Hk),ge.qb(rt)&&this.Hk==ge.y?0>je.compare(Me)?ie.L(je):ie.L(Me):ge.qb(Me)&&this.Hk==ge.y?0>je.compare(rt)?ie.L(je):ie.L(rt):rt.qb(je)&&this.Hk==rt.y?0>ge.compare(Me)?ie.L(ge):ie.L(Me):je.qb(Me)&&this.Hk==je.y&&(0>ge.compare(rt)?ie.L(ge):ie.L(rt)),b.Pe(ie.y,ie.x)O&&0>b?-1:0C.pa){if(C.pa>C.sa&&C.la-C.na<2*this.qa&&b.vi(C.pa,C.la,this.qa))return this.xi()}else if((C.la-C.na)/(C.pa-C.sa)*(b.pa-b.sa)C.sa&&C.la-C.na<2*this.qa&&b.vi(C.pa,C.la,this.qa))return this.xi()}else if((C.la-C.na)/(C.pa-C.sa)*(b.sa-b.pa)F&&0>O?-1:0C+j?O:F.vi(b.sa,b.na,this.qa)?this.xi():NC+j?O:F.vi(b.pa,b.la,this.qa)?this.xi():NN?1:0)},g.prototype.Kr=function(){this.rg=!1},g.prototype.rm=function(){return this.Ni},g.prototype.$J=function(b,C){this.Hk=b,this.Kq=C,this.gt=this.Lo=this.Xs=this.Ws=-1},g.prototype.compare=function(b,C,O){return this.rg?-1:(b=b.ja(O),this.Dm=O,this.RE(C,C,b,b))},g.prototype.RE=function(b,C,O,F){if(this.Lo==C)var N=this.TA;else this.Lo=C,N=this.TA,this.TA.pb=b,this.mG(N,C,this.g.td.o,this.g.We);if(j==null){this.gt=F;var j=this.YH;this.YH.pb=O,this.mG(j,F,this.g.td.o,this.g.We)}return N.Tv||j.Tv?this.NO(C,F,N,j):N.Uf.vathis.Uf.va)return 1;if(this.ie.na==this.ie.la)return this.Dm=E,this.rg=!0,0;this.ie.rI(),g=this.ie.ac(),(_=new A.h).uc(this.ie.wc(),g),_.ar();var b=new A.h;return b.uc(this.Gq,g),g=_.Qh(b),(g/=_.length())<10*-this.qa?-1:g>10*this.qa?1:this.ie.qs(this.Gq,this.qa)&&((_=Math.abs(g))g?-1:1},G}();A.aM=ue}(ye||(ye={})),function(A){function ue(E,_,g,b){g=new Float64Array(E.subarray(g,b)),E.set(g,_)}var G=function(){function E(_){this.Pb=this.pk=!1,this.o=null;var g=_;2>g&&(g=2),this.o=new Float64Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Float64Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Float64Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Float64Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Float64Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();var j=this.size-N;if(jF&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g)throw A.i.N();if(g!=0){this.size<(g<<1)+_&&this.resize((g<<1)+_),g+=0;for(var C=0;C_||0>g||0>C||this.size_||0>g||this.size<(g>>1)+_)throw A.i.N();if(g!=0){g=0+g;for(var C=0;Cg&&(g=2),this.o=new Int32Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Int32Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Int32Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Int32Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Int32Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();if(ue(this.o,_+C,_,_+(N-_)),this.o==g.o&&_F&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g||0>C||this.sizeg-_?E.rG(this.o,_,g,b):E.qB(this.o,_,g-1,b)},E.prototype.Tp=function(){return 2},E.prototype.Fc=function(){return this.o[this.size-1]},E.prototype.If=function(){this.resize(this.size-1)},E.prototype.bX=function(_){this.o[this.size-1]=_},E.prototype.SV=function(_){_=g&&0=b))for(;;){if(9>b-g){E.rG(_,g,b+1,C);break}var O=_[g];E.tx(_,g,b);for(var F=g,N=g;N=C(_[N],O)&&(E.tx(_,F,N),F+=1);E.tx(_,F,b),F-gg&&(g=2),this.o=new Int8Array(g),this.size=_}return E.prototype.rotate=function(_,g,b){if(this.Pb)throw A.i.fa("invalid_call");if(g<_||g>b||_>b)throw A.i.N();_!=g&&b!=g&&(this.ni(_,g-_,1),this.ni(g,b-g,1),this.ni(_,b-_,1))},E.qf=function(_,g){var b=new E(_),C=b.o;if(2>_&&(_=2),g!==0)for(var O=0;O<_;O++)C[O]=g;return b},E.Bn=function(_){var g=new E(0);return g.o=new Int8Array(_.o),g.size=_.size,g},E.Lr=function(_,g){var b=new E(0);return b.size=_.size,b.size>g&&(b.size=g),2>(g=b.size)&&(g=2),b.o=new Int8Array(g),b.o.set(_.o.length<=g?_.o:_.o.subarray(0,g),0),b},E.prototype.Jb=function(_){0>=_||(this.o==null?this.o=new Int8Array(_):_<=this.o.length||(0this.o.length&&(b=A.O.truncate(64>_?Math.max(2*_,4):5*_/4),(b=new Int8Array(b)).set(this.o),this.o=b),b=this.o;for(var C=this.size;C<_;C++)b[C]=g}this.size=_},E.prototype.Bh=function(_){if((this.o==null||_>this.o.length)&&this.resize(_),this.pk)throw A.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=_},E.prototype.pr=function(_,g){this.write(_,g)},E.prototype.An=function(_,g,b){for(var C=this.size;gC||b>O&&C!=O)return!1;for(b>C&&(b=C);gO||b%O!=0))throw A.i.N();var F=this.size;if(this.resize(F+b),C)this.o.set(_.o.subarray(g,g+b),F);else{C=b;for(var N=0;NF||C%F!=0))throw A.i.N();if(ue(this.o,_+C,_,_+(N-_)),this.o==g.o&&_F&&(F=this.size),this.size+2*C>this.o.length?this.resize(this.size+2*C):this.size+=2*C,ue(this.o,_+2*C,_,_+(F-_)),O)for(O=0;O_||0>g||0>C||!O&&(0>=F||g%F!=0)||b.sizethis.size)throw A.i.Hb();0b||g%b!=0)throw A.i.Hb();for(var C=g>>1,O=0;Og||0>b||0>g||b+g>this.size)throw A.i.N();for(var C=g;C_||0>g||0>C)throw A.i.N();if(g!=0)for(this.size<(g<<1)+_&&this.resize((g<<1)+_),O||(_+=g-1<<1),O=O?2:-2,g+=C;C_||0>g||0>C||this.sizeE?-E:E},G.ti=function(E){return 3552713678800501e-30>E},G.KC=function(E,_,g){return G.P(E-_)<=g*(1+(G.P(E)+G.P(_))/2)},G.Y=function(E,_){return G.KC(E,_,3552713678800501e-30)},G.FL=function(E){return 3552713678800501e-30>=G.P(E)},G.Cd=function(E){return G.FL(E)},G}();A.s=ue,A.F=function(){function G(){}return G.gp=function(E,_){var g=0;return(E=ue.P(E))+(_=ue.P(_))!=0&&(E>_?(g=_/E,g=E*Math.sqrt(1+g*g)):(g=E/_,g=_*Math.sqrt(1+g*g))),g},G.Wq=function(E,_,g,b,C){for(var O=[0,0,0],F=[0,0,0],N=0;2>=N;N++)_[N]-=E[N],g[N]-=_[N];g=O[1]*F[2]-O[2]*F[1],_=O[2]*F[0]-O[0]*F[2],O=O[0]*F[1]-O[1]*F[0],E=-1*(g*E[0]+_*E[1]+O*E[2]),b[0]=g,b[1]=_,b[2]=O,b[3]=E,F=G.on(b),b[0]/=F,b[1]/=F,b[2]/=F,b[3]/=F,C!=0&&(F=ue.Cd(O)?ue.Cd(E)?ue.Mb(1,_):-ue.Mb(1,E):ue.Mb(1,O),F*=ue.Mb(1,C),b[0]*=F,b[1]*=F,b[2]*=F,b[3]*=F)},G.zx=function(E,_,g){g[0]=E[1]*_[2]-_[1]*E[2],g[1]=E[2]*_[0]-_[2]*E[0],g[2]=E[0]*_[1]-_[0]*E[1]},G.St=function(E,_){return E[0]*_[0]+E[1]*_[1]+E[2]*_[2]},G.on=function(E){return G.gp(G.gp(E[0],E[1]),E[2])},G.cl=function(E,_,g,b,C,O,F,N){E=G.n(E,_,g);var j=Math.cos(g);O.u=(E+C)*j*Math.cos(b),F.u=(E+C)*j*Math.sin(b),N.u=(E*(1-_)+C)*Math.sin(g)},G.jO=function(E,_,g,b,C,O,F){var N=G.gp(_,g),j=1*Math.sqrt(1-E),W=j/1;if(ue.Y(N,0))O.u=0,C.u=ue.Mb(1.570796326794897,b),F.u=ue.P(b)-j;else{O.u=Math.atan2(g,_),g=Math.atan2(1*b,j*N),O=Math.cos(g);var q=Math.sin(g);_=j*E/(1-E),E*=1,g=Math.atan2(b+_*q*q*q,N-E*O*O*O),3.141592653589793E){var g=Math.sqrt(1-E),b=(1-g)/(1+g),C=b*b,O=b*C,F=b*O,N=b*F,j=b*N,W=b*j,q=1.572916666666667*O-3.2578125*N+4.295068359375*W;E=2.142578125*F-6.071484375*j,g=3.129296875*N-11.249837239583334*W;var J=4.775276692708333*j,ee=7.958636765252976*W,he=Math.cos(2*_);return _+Math.sin(2*_)*(1.5*b-.84375*O+.525390625*N-.2688395182291667*W-q+g-ee+he*(2*(1.3125*C-1.71875*F+1.650146484375*j)-4*E+6*J+he*(4*q-12*g+24*ee+he*(8*E-32*J+he*(16*g-80*ee+he*(32*J+64*he*ee))))))}for(g=1-E,b=E/2,O=(C=ue.P(_))*G.Zu(E)/(1.570796326794897*g),F=9999,j=C,C=0;1e-16C;C++)W=G.w(E,j),N=j-(q=(N=(G.kG(j,E)-b*Math.sin(2*j)/W)/g-O)/(W=1/(W*W*W))),F=ue.P(q),j=N;return 0<=_?j:-j},G.qW=function(E,_){return ue.ti(_)?E:E*G.Zu(_)/1.570796326794897},G.ba=function(E){return 0>(E=G.pF(E,6.283185307179586))?E+6.283185307179586:3.141592653589793>ue.P(E)||ue.Y(ue.P(E),3.141592653589793)?E:E-6.283185307179586},G.pF=function(E,_){return E-Math.floor(E/_)*_},G.Ah=function(E,_){if(.006884661117170036>_){var g=(_=(1-(_=Math.sqrt(1-_)))/(1+_))*_,b=g*g;return E/(1+_)*(1+.25*g+.015625*b+.00390625*g*b)*1.570796326794897}return E*G.Zu(_)},G.Vq=function(E,_){var g=ue.Mb(1,Math.sin(_));return _=1.570796326794897>=(_=ue.P(G.pF(_,3.141592653589793)))?_:3.141592653589793-_,(ue.Y(_,1.570796326794897)?_:Math.atan(Math.sqrt(1-E)*Math.tan(_)))*g},G.q=function(E,_,g){if(.006884661117170036>_){var b=(_=(1-(_=Math.sqrt(1-_)))/(1+_))*_,C=_*b,O=_*C,F=_*O,N=_*F,j=_*N,W=-.7291666666666666*C+.2278645833333333*F+.03987630208333334*j,q=.615234375*O-.21533203125*N,J=-.54140625*F+.20302734375*j,ee=.48876953125*N,he=-.4488699776785715*j,Ee=Math.cos(2*g);return E/(1+_)*((1+.25*b+.015625*O+.00390625*N)*g+Math.sin(2*g)*(-1.5*_+.1875*C+.0234375*F+.00732421875*j-W+J-he+Ee*(2*(.9375*b-.234375*O-.03662109375*N)-4*q+6*ee+Ee*(4*W-12*J+24*he+Ee*(8*q-32*ee+Ee*(16*J-80*he+Ee*(32*ee+64*Ee*he)))))))}return E*(G.kG(g,_)-.5*_*Math.sin(2*g)/G.w(_,g))},G.w=function(E,_){return _=Math.sin(_),Math.sqrt(1-E*_*_)},G.Zu=function(E){return ue.KC(E,1,2220446049250313e-31)?1:1>E?G.Xw(0,1-E)-E/3*G.Uw(0,1-E):NaN},G.kG=function(E,_){var g=ue.Mb(1,E);E=ue.P(E);var b=Math.floor(E/1.570796326794897);if(1<_)_=E==0?0:NaN;else if(ue.Cd(b))_=(E=G.sin(E))*G.Xw(1-E*E,1-_*E*E)-_/3*E*E*E*G.Uw(1-E*E,1-_*E*E);else{var C=A.O.truncate(b%2),O=G.Zu(_);0ue.P(b)&&1e-4>ue.P(C)&&1e-4>ue.P(O));)O=Math.sqrt(N),_+=E/((g=Math.sqrt(j))*(j+(O=Math.sqrt(F)*(O+g)+O*g))),E*=.25,F=.25*(F+O),N=.25*(N+O),j=.25*(j+O);return N=(F=b*C)-(j=O*O),3*_+E*(1+(j=F-6*j)*(.10227272727272728*j-.2142857142857143-.1730769230769231*O*(b=j+N+N))+O*(.1666666666666667*b+O*(-.4090909090909091*N+.1153846153846154*O*F)))/(g*Math.sqrt(g))},G.Xw=function(E,_){for(var g,b,C,O,F=1;b=2-((g=(E+_+F)/3)+E)/g,C=2-(g+_)/g,O=2-(g+F)/g,!(1e-4>ue.P(b)&&1e-4>ue.P(C)&&1e-4>ue.P(O));F=.25*(F+g))g=Math.sqrt(_),b=Math.sqrt(F),E=.25*(E+(g=Math.sqrt(E)*(g+b)+g*b)),_=.25*(_+g);return(1+(.04166666666666666*(E=b*C-O*O)-.1-.06818181818181818*(_=b*C*O))*E+.07142857142857142*_)/Math.sqrt(g)},G.Qw=function(E,_){if(ue.ti(E)||_==0||ue.Y(ue.P(_),1.570796326794897))return _;if(.006884661117170036>E){var g=E*E,b=E*g,C=E*b,O=E*C,F=E*O,N=E*F,j=-(.02708333333333333*b+.03430059523809524*C+.03149181547619048*O+.02634359154541446*F+.02156896735835538*N),W=.007669890873015873*C+.01299603174603175*O+.0148051353064374*F+.01454454953803912*N,q=-(.002275545634920635*O+.004830845032667949*F+.006558395368616723*N),J=.0006957236677288761*F+.001775193002406544*N,ee=-.000217324089394402*N,he=Math.cos(2*_);return _+Math.sin(2*_)*(-(.5*E+.2083333333333333*g+.09375*b+.04878472222222222*C+.02916666666666667*O+.01938905423280423*F+.01388255931712963*N)-j+q-ee+he*(2*(.1041666666666667*g+.0875*b+.06050347222222222*C+.04151785714285714*O+.02958958540013228*F+.02203667534722222*N)-4*W+6*J+he*(4*j-12*q+24*ee+he*(8*W-32*J+he*(16*q-80*ee+he*(32*J+64*he*ee))))))}return _==0||ue.Y(ue.P(_),1.570796326794897)?g=_:(C=(b=Math.sqrt(E))*Math.sin(_),g=Math.tan(.7853981633974483+_/2)*Math.pow((1-C)/(1+C),b/2),g=2*Math.atan(g)-1.570796326794897),g},G.yO=function(E,_){if(ue.ti(E)||_==0||ue.Y(ue.P(_),1.570796326794897))return _;if(.006884661117170036>E){var g=E*(J=E*(q=E*(he=E*E))),b=E*(ee=E*g),C=.05833333333333333*q+.07232142857142858*J+.05634300595238095*g+.0355325796406526*ee+.020235546186067*b,O=.02653149801587302*J+.04379960317460317*g+.0429211791776896*ee+.03255384637546096*b,F=.01294022817460318*g+.02668104344536636*ee+.03155651254609588*b,N=.00659454790965208*ee+.0163075268674227*b,j=.003463473736911237*b,W=Math.cos(2*_);return _+Math.sin(2*_)*(.5*E+.2083333333333333*he+.08333333333333333*q+.03611111111111111*J+.01875*g+.01195601851851852*ee+.008863673941798942*b-C+F-j+W*(2*(.1458333333333333*he+.1208333333333333*q+.07039930555555556*J+.03616071428571429*g+.01839451058201058*ee+.01017113095238095*b)-4*O+6*N+W*(4*C-12*F+24*j+W*(8*O-32*N+W*(16*F-80*j+W*(32*N+64*W*j))))))}var q=Math.sqrt(E),J=q/2,ee=Math.tan(.7853981633974483+_/2);E=0,C=1;for(var he=_;C!=0;he=b)g=q*Math.sin(he),b=ee*Math.pow((1+g)/(1-g),J),b=2*Math.atan(b)-1.570796326794897,E++,(ue.Y(b,he)||3e4this.Kk&&(this.Kk=0);var g=this.Ue.getType();if(this.jH=g==A.Sc.PE_TYPE_PROJCS?2:1,g==A.Sc.PE_TYPE_PROJCS&&!E.loadConstants())throw A.i.N("PeProjcs.loadConstants failed");_=g==A.Sc.PE_TYPE_GEOGCS?this.Ue:this.Ue.getGeogcs(),g!=A.Sc.PE_TYPE_GEOGCS&&A.pf.getCode(_),this.Eo=E.getUnit(),this.RH=_.getPrimem().getLongitude(),this.wH=E=_.getUnit().getUnitFactor(),E=Math.PI/(180*E),1e-10>Math.abs(E-1)&&(E=1),this.GA=E,g&A.Sc.PE_TYPE_PROJCS?(_=this.Ue,this.HA=1/_.getUnit().getUnitFactor(),this.sw=.001/this.Ue.getUnit().getUnitFactor(),this.tw=A.Cg.generate(_,A.Cg.PE_PCSINFO_OPTION_NONE),this.zl=this.tw.isPannableRectangle(),this.bA=A.zb.qN(this.tw.getCentralMeridian(),this.GA)):(this.KA=this.zl=!0,this.HA=0,g=1/_.getUnit().getUnitFactor(),this.sw=.001/_.getDatum().getSpheroid().getAxis()*g,this.bA=0),this.zl&&(this.xx(),this.DK(),this.nY(),this.CK(),this.lY(),this.mY())}return G.prototype.$r=function(){return this.Kk},G.prototype.kk=function(){return this.tw},G.Py=function(E,_){return E==_||E!=null&&_!=null&&E.Kk==0&&_.Kk==0&&E.As===_.As},G.prototype.Wc=function(){return this.zl},G.prototype.gh=function(E){E.K(this.so)},G.prototype.pv=function(){return this.so.v},G.prototype.ov=function(){return this.so.C},G.prototype.GR=function(E){E.K(this.uw)},G.prototype.lY=function(){var E=this.Ue.getType();if(E==A.Sc.PE_TYPE_PROJCS){E=this.Ue;var _=this.kk().getCentralMeridian(),g=E.getGeogcs();if(g==null)throw A.i.fa("internal error");_=[[_+(g=1/g.getUnit().getUnitFactor()*Math.PI),0]],A.ej.geogToProj(E,1,_),_=_[0][0],g=E.getParameters()[A.Sc.PE_PARM_X0].getValue();var b=this.ml();E=new A.l,b.A(E),_=(b=Math.abs(_-g))+g,g=-1*b+g,b=E.H,E=E.G;var C=new A.l;C.K(g,E,_,b),this.so==null&&(this.so=C)}else{if(E!=A.Sc.PE_TYPE_GEOGCS)throw A.i.fa("internal error");g=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(E=new A.l).K(-g,-g/2,g,g/2),this.so==null&&(this.so=E)}},G.prototype.mY=function(){var E=this.Ue.getType();if(E==A.Sc.PE_TYPE_PROJCS){var _=this.Ue;if(E=this.kk().getCentralMeridian(),(_=_.getGeogcs())==null)throw A.i.fa("internal error");_=1/_.getUnit().getUnitFactor()*Math.PI;var g=this.Vr(),b=new A.l;g.A(b),(g=new A.l).K(E-_,b.G,E+_,b.H),this.uw==null&&(this.uw=g)}else{if(E!=A.Sc.PE_TYPE_GEOGCS)throw A.i.fa("internal error");_=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(E=new A.l).K(-_,-_/2,_,_/2),this.uw==null&&(this.uw=E)}},G.prototype.bf=function(){return this.GA},G.prototype.pm=function(){return this.HA},G.prototype.Vr=function(){if(this.zl)return this.ul;var E=this.ul;return E??(this.xx(),this.ul)},G.prototype.Wr=function(){return this.zl?null:(this.ul!=null||this.xx(),this.YG)},G.prototype.xx=function(){if(this.Ue.getType()==A.Sc.PE_TYPE_PROJCS){var E=this.Ue,_=E.getGeogcs(),g=E.horizonGcsGenerate();if(g!=null){var b=g[0].getNump(),C=g[0].getKind();E=0j&&(g=-400*O,q.K(g,q.G,g+5*N,q.H)),g=new A.Fh(q),this.ul==null&&(this.ul=g,this.Iv=E);else{if(j=new A.Da,N=this.kk().isGcsHorizonMultiOverlap(),q=A.gu.bF(_,A.hu.Integer64),N){for(j=new A.gL,W=A.Gh.local().V(j,q,null),ee=0;eethis.ss&&(this.ss=0),this.Eo=_=this.KT.getUnit(),this.IH=1/_.getUnitFactor(),A.pf.getCode(E)}return G.Py=function(E,_){return E==_||E!=null&&_!=null&&E.ss==0&&_.ss==0&&E.As===_.As},G.prototype.$r=function(){return this.ss},G}();A.PL=ue}(ye||(ye={})),function(A){A.Yg=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F){if(C!=null||O!=null||F!=null){g=A.F.ba(g),E=A.F.ba(E),_=A.F.ba(_),b=A.F.ba(b),1.570796326794897_?g:A.F.ba(3.141592653589793-g):Math.atan2(q*he,j*J-W*q*ee)),F!=null&&(A.s.Y(A.s.P(b),1.570796326794897)?F.u=0>b?E:A.F.ba(3.141592653589793-E):(F.u=Math.atan2(j*he,J*j*ee-q*W),F.u=A.F.ba(F.u+3.141592653589793)))}}},ue.rf=function(G,E,_,g,b,C,O){if(C!=null||O!=null){E=A.F.ba(E),_=A.F.ba(_),1.570796326794897J?b:A.F.ba(3.141592653589793-b):E:A.s.Y(A.s.P(_),1.570796326794897)&&A.s.Y(G,3.141592653589793)?0>_?b:A.F.ba(3.141592653589793-b):A.F.ba(E+Math.atan2(q*N,j*g-W*q*F)))}},ue}()}(ye||(ye={})),function(A){A.Wk=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=new A.ga(0),W=new A.ga(0),q=[0,0,0],J=[0,0,0],ee=[0,0,0],he=new A.ga(0),Ee=new A.ga(0),De=new A.ga(0),pt=new A.ga(0),Et=new A.ga(0);if(O!=null||F!=null||N!=null)if(A.s.ti(E))A.Yg.tb(G,_,g,b,C,O,F,N);else{b=A.F.ba(b),_=A.F.ba(_);var Ye=A.F.ba(b-_);if(A.s.Y(g,C)&&(A.s.Y(_,b)||A.s.Y(A.s.P(g),1.570796326794897)))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.Y(g,-C)){if(A.s.Y(A.s.P(g),1.570796326794897))return O!=null&&(O.u=2*A.F.Ah(G,E)),F!=null&&(F.u=0Ye){jt=1;var ei=_;_=b,b=ei,ei=g,g=C,C=ei}Ye=A.F.ot(E,g);var Xt=A.F.ot(E,C);F==null&&N==null||(A.Yg.tb(G,_,Ye,b,Xt,null,j,W),j=Math.atan2(Math.sin(j.u)*Math.cos(g-Ye),Math.cos(j.u)),W=Math.atan2(Math.sin(W.u)*Math.cos(C-Xt),Math.cos(W.u)),jt!=0&&(ei=j,j=W,W=ei),F!=null&&(F.u=j),N!=null&&(N.u=W)),O!=null&&(A.F.cl(1,E,g,_,0,De,pt,Et),q[0]=De.u,q[1]=pt.u,q[2]=Et.u,A.F.cl(1,E,C,b,0,De,pt,Et),J[0]=De.u,J[1]=pt.u,J[2]=Et.u,ee[0]=q[1]*J[2]-J[1]*q[2],ee[1]=-(q[0]*J[2]-J[0]*q[2]),ee[2]=q[0]*J[1]-J[0]*q[1],E=1-A.F.w(E,A.F.Vq(E,A.F.Qj(E,Math.acos(ee[2]/Math.sqrt(ee[0]*ee[0]+ee[1]*ee[1]+ee[2]*ee[2]))))),E*=2-E,F=Math.atan2(-ee[1],-ee[0]),ee=A.F.ba(F-1.570796326794897),F=A.F.ba(F+1.570796326794897),ee=A.s.P(A.F.ba(_-ee))<=A.s.P(A.F.ba(_-F))?ee:F,A.Yg.tb(1,ee,0,_,Ye,he,null,null),A.Yg.tb(1,ee,0,b,Xt,Ee,null,null),3.141592653589793b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),_=A.F.ba(_),g=A.F.ba(g),1.570796326794897=A.s.P(C)?1:-1);C=A.F.ba(_+Math.atan(Math.tan(C)*-Math.sin(De))),A.Yg.tb(G,C,0,_,De,null,W,null),De=A.s.P(1.570796326794897-A.s.P(W.u)),De=A.F.Qj(E,De),De=1-A.F.w(E,A.F.Vq(E,De)),De*=2-De,A.F.cl(1,E,0,C,0,ee,he,Ee),q[0]=ee.u,q[1]=he.u,q[2]=Ee.u,A.F.cl(1,E,g,_,0,ee,he,Ee),J[0]=ee.u,J[1]=he.u,J[2]=Ee.u,g=Math.acos((q[0]*J[0]+q[1]*J[1]+q[2]*J[2])/Math.sqrt(J[0]*J[0]+J[1]*J[1]+J[2]*J[2])),g=A.F.Qj(De,g),b=0<(g=A.F.q(G,De,g)+b*pt)?W.u:A.F.ba(W.u+3.141592653589793),G=A.s.P(g)/A.F.Ah(G,De)*1.570796326794897,G=A.F.Rq(De,G),G=A.F.ot(De,G),A.Yg.rf(1,C,0,G,b,O,j),F!=null&&(N=j.u),F!=null&&(F.u=A.F.Qj(E,N))}},ue}()}(ye||(ye={})),function(A){A.cu=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=0,W=0,q=0;if(O!=null||F!=null||N!=null)if(A.s.ti(E))A.Yg.tb(G,_,g,b,C,O,F,N);else{var J=A.F.ba(b-_);if(A.s.Y(g,C)&&(A.s.Cd(J)||A.s.Y(A.s.P(g),1.570796326794897)))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.Y(g,-C)){if(A.s.Y(A.s.P(g),1.570796326794897))return O!=null&&(O.u=2*A.F.Ah(G,E)),F!=null&&(F.u=0=pi&&!A.s.Y(Ri,jt));if(wi!=0)ee=(he*=j)*(256+he*(he*(74-47*he)-128))/1024,O!=null&&(O.u=Ee*(1+he*(4096+he*(he*(320-175*he)-768))/16384)*(mi-ee*Ui*(W+ee/4*(Bi*(2*q-1)-ee/6*W*(4*Ui*Ui-3)*(4*q-3))))),F!=null&&(F.u=A.s.Y(A.s.P(g),1.570796326794897)?0>g?b:A.F.ba(3.141592653589793-b):Math.atan2(Et*Xt,E*Ye-pt*Et*ei)),N!=null&&(A.s.Y(A.s.P(C),1.570796326794897)?N.u=0>C?_:A.F.ba(3.141592653589793-_):(N.u=Math.atan2(E*Xt,E*Ye*ei-pt*Et),N.u=A.F.ba(N.u+3.141592653589793)));else{jt=A.s.Mb(3.141592653589793,J),Bi=pt*Ye-E*Et,mi=Math.acos(Bi),Ui=Math.sin(mi),j=1,pi=ar=0;do q=ar,ei=1-.25*(ar=ee*(j*=j)*(1+ee+ee*ee))+.1875*(W=ee*ee*(ei=j*j)*(1+2.25*ee))-.1953125*(wi=ee*ee*ee*ei*j),ar=.25*ar-.25*W+.29296875*wi,Xt=.03125*W-.05859375*wi,wi*=.00651041666666667,W=Bi-2*pt*Ye/j,1=pi&&!A.s.Y(q,ar));O!=null&&(ei=1+(he*=j*=j)*(4096+he*(he*(320-175*he)-768))/16384,A.s.Y(g,-C)?O.u=3.141592653589793*Ee*ei:(W=Bi-2*pt*Ye/j,j=Math.acos(W),Bi=Math.cos(2*j),Ri=Math.cos(3*j),O.u=Ee*(ei*mi+he*(he*(128+he*(35*he-60))-512)/2048*Ui*W+he*(5*he-4)/6144*he*he*Math.sin(2*mi)*Bi+wi*Math.sin(3*mi)*Ri+-762939453125e-16*he*he*he*he*Math.sin(4*mi)*Math.cos(4*j)))),F!=null&&(A.s.Cd(g)&&A.s.Cd(C)?(j=Math.sqrt(1-ar*ar),F.u=Math.acos(j),0>J&&(F.u*=-1)):A.s.Y(A.s.P(g),1.570796326794897)?F.u=0>g?b:A.F.ba(3.141592653589793-b):(O=ar/E,Ee=Math.sqrt(1-O*O),0>E*Ye-pt*Et*Math.cos(jt)&&(Ee*=-1),F.u=Math.atan2(O,Ee),A.s.Y(g,-C)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(0A.s.P(F.u)||0>g&&1.570796326794897C?_:A.F.ba(3.141592653589793-_):(J=ar/Et,O=Math.sqrt(1-J*J),Ee=Math.sin(jt/2),0>Math.sin(De-G)-2*E*Ye*Ee*Ee&&(O*=-1),N.u=Math.atan2(J,O),N.u=A.F.ba(N.u+3.141592653589793),A.s.Y(g,-C)&&!A.s.Cd(g)&&!A.s.Y(A.s.P(g),1.570796326794897)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(F!=null?Ee=F.u:(O=ar/E,Ee=Math.sqrt(1-O*O),0>E*Ye-pt*Et*Math.cos(jt)&&(Ee*=-1),Ee=Math.atan2(O,Ee),A.s.Y(g,-C)&&A.s.P(A.F.ba(_-b))>3.141592653589793*(1-ee*Math.cos(g))&&(0A.s.P(Ee)||0>g&&1.570796326794897=A.s.P(Ee)&&1.570796326794897A.s.P(N.u))&&(N.u=-1*A.F.ba(N.u+3.141592653589793))))}}}},ue.rf=function(G,E,_,g,b,C,O,F){if(O!=null||F!=null)if(A.s.ti(E))A.Yg.rf(G,_,g,b,C,O,F);else if(C=A.F.ba(C),A.s.Y(A.s.P(g),1.570796326794897)||A.s.Cd(C)||A.s.Y(A.s.P(C),3.141592653589793))A.Wk.rf(G,E,_,g,b,C,O,F);else{var N=A.s.P(C)==1.570796326794897?0:Math.cos(C),j=A.s.P(C)==3.141592653589793?0:Math.sin(C);A.s.Y(A.s.P(g),1.570796326794897)&&(_=0),C=1-Math.sqrt(1-E);var W=A.F.Vq(E,g);g=A.s.P(W)==1.570796326794897?0:Math.cos(W);var q=Math.sin(W);W=Math.atan2(Math.tan(W),N);var J=g*j,ee=J*J,he=1-ee,Ee=E/(1-E)*he,De=(E=Ee*(256+Ee*(Ee*(74-47*Ee)-128))/1024)/4,pt=E/6,Et=b/(G*(1-C)*(1+Ee*(4096+Ee*(Ee*(320-175*Ee)-768))/16384)),Ye=Et;do{var jt=Ye;b=A.s.P(Ye)==1.570796326794897?0:Math.cos(Ye);var ei=(Ee=A.s.P(Ye)==3.141592653589793?0:Math.sin(Ye))*Ee;Ye=E*Ee*((G=Math.cos(2*W+Ye))+De*(b*(2*(Ye=G*G)-1)-pt*G*(4*ei-3)*(4*Ye-3)))+Et}while(!A.s.Y(jt,Ye));b=A.s.P(Ye)==1.570796326794897?0:Math.cos(Ye),Ee=A.s.P(Ye)==3.141592653589793?0:Math.sin(Ye),O!=null&&(j=Math.atan2(Ee*j,g*b-q*Ee*N),he=C/16*he*(4+C*(4-3*he)),G=Math.cos(2*W+Ye),O.u=A.F.ba(_+(j-(1-he)*C*J*(Ye+he*Ee*(G+he*b*(2*G*G-1)))))),F!=null&&(he=q*Ee-g*b*N,he=(1-C)*Math.sqrt(ee+he*he),F.u=Math.atan2(q*b+g*Ee*N,he))}},ue}()}(ye||(ye={})),function(A){A.PC=function(){function ue(){}return ue.tb=function(G,E,_,g,b,C,O,F,N){var j=A.F.ba(b-_),W=A.s.Y(A.s.P(g),1.570796326794897),q=A.s.Y(A.s.P(C),1.570796326794897);if(A.s.Y(g,C)&&(A.s.Cd(j)||W))O!=null&&(O.u=0),F!=null&&(F.u=0),N!=null&&(N.u=0);else{if(A.s.ti(E)){var J=Math.sin(g),ee=Math.sin(C);J=Math.sqrt((1+J)/(1-J)),ee=Math.sqrt((1+ee)/(1-ee)),J=Math.log(ee)-Math.log(J),J=Math.atan2(j,J),O!=null&&(O.u=A.s.Y(g,C)?A.s.P(G*Math.cos(g)*j):A.s.P((G*C-G*g)/Math.cos(J)))}else ee=A.F.Qw(E,C),J=Math.sin(A.F.Qw(E,g)),ee=Math.sin(ee),J=Math.sqrt((1+J)/(1-J)),ee=Math.sqrt((1+ee)/(1-ee)),J=Math.log(ee)-Math.log(J),J=Math.atan2(j,J),O!=null&&(A.s.Y(g,C)?O.u=A.s.P(G*j*Math.cos(g)/A.F.w(E,g)):(j=A.F.q(G,E,g),G=A.F.q(G,E,C),O.u=A.s.P((G-j)/Math.cos(J))));F==null&&N==null||(O=A.F.ba(J+3.141592653589793),W&&q||!W&&!q||(W?J=0>g?b:A.F.ba(3.141592653589793-b):q&&(O=0>C?_:A.F.ba(3.141592653589793-_))),F!=null&&(F.u=J),N!=null&&(N.u=O))}},ue.rf=function(G,E,_,g,b,C,O,F){C=A.F.ba(C),0>b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),A.s.ti(E)?A.s.Y(A.s.P(g),1.570796326794897)?(_=0>g?C:A.F.ba(3.141592653589793-C),3.141592653589793>=(C=b/G%6.283185307179586)?G=g-A.s.Mb(C,g):(_=A.F.ba(_+3.141592653589793),G=-g+A.s.Mb(C-3.141592653589793,g))):A.s.Y(A.s.P(C),1.570796326794897)?(_=A.F.ba(_+A.s.Mb(b,C)/(G*Math.cos(g))),G=g):(G=g+b*Math.cos(C)/G,1.570796326794897g?C:A.F.ba(3.141592653589793-C),C=b/A.F.qW(G,E),3.141592653589793>=(C%=6.283185307179586)?G=g-A.s.Mb(C,g):(_=A.F.ba(_+3.141592653589793),G=-g+A.s.Mb(C-3.141592653589793,g)),G=A.F.Rq(E,G)):A.s.Y(A.s.P(C),1.570796326794897)?(_=A.F.ba(_+A.s.Mb(b,C)*A.F.w(E,g)/(G*Math.cos(g))),G=g):(G=1.570796326794897*(b*Math.cos(C)+A.F.q(G,E,g))/A.F.Ah(G,E),1.570796326794897Math.PI||Math.abs(g.y)>.5*Math.PI||Math.abs(b.y)>.5*Math.PI||(Math.abs(g.y)==.5*Math.PI||Math.abs(b.y)==.5*Math.PI)&&g.x!=b.x)return NaN;if(C=E.cB(C,Math.min(g.x,b.x),Math.max(g.x,b.x)),!new A.Nc(g.x,b.x).contains(C))return NaN;var O=ue.construct(g);if(b=ue.construct(b),O=E.Yu(_,O),b=E.Yu(_,b),(b=O.cF(b)).z.qg())return g.y;var F=new A.Wb;F.set(b.x),F.jm(b.z),F.No(-1);var N=new A.Wb;N.set(b.y),N.jm(b.z),N.No(-1);var j=new A.Wb;return j.set(N),j.Ag(N),(O=new A.Wb).set(F),O.Ag(F),O.add(j),O.sqrt(),O.qg()||F.qg()&&N.qg()?g.y:(g=Math.atan2(N.value(),F.value()),g=Math.atan2(O.value()*Math.cos(g-C),1-_),C=E.DP(_,A.h.construct(C,g)),_=new A.Nd(C.x,C.y,-C.z),C=b.value().Qh(C),_=b.value().Qh(_),Math.abs(_)Math.PI||Math.abs(g.y)>.5*Math.PI||Math.abs(b.y)>.5*Math.PI||(Math.abs(g.y)==.5*Math.PI||Math.abs(b.y)==.5*Math.PI)&&g.x!=b.x||Math.abs(C)>=.5*Math.PI||0C&&b.y>C||0>g.y&&0>b.y&&g.yMath.abs(O[1]-g.x)&&(g=O[0],O[0]=O[1],O[1]=g)),C))},E.cB=function(_,g,b){return _>b?_-=2*(g=Math.ceil((_-b)/(2*Math.PI)))*Math.PI:_b.x?(b.x-=b.x%360,-180>b.x&&(b.x+=360)):180b.y&&(b.y=-90);for(var C=-180,O=180,F=(G=5*_)-1,N=(E=(G+31)/32)-1;0<=N;N--)for(var j=F-32*N,W=Math.min(32,G-32*N),q=1;q=J?(g[N]|=1<=J?(g[N]|=1<>C&31;if(31<(C+=5)){var N=37-C;F&=(1<E)for(O=0;O<_-E;O++)g.push("0");else _=E[0]?E:'"'+E.trim()+'"'}var G=[];A.XC=function(){function E(){}return E.EQ=function(_){try{for(var g=0;g_||_>this.Aa)throw A.i.N();return this.bg[_]},E.prototype.Pf=function(_){return this.uh[_]},E.lz=function(_){return E.JM[_]},E.Tp=function(_){return E.SM[_]},E.Va=function(_){return E.rM[_]},E.prototype.hasAttribute=function(_){return 0<=this.uh[_]},E.prototype.iG=function(){return this.hasAttribute(1)},E.se=function(_){return E.eD[_]},E.prototype.LR=function(_){return this.Vs[_]},E.DG=function(_,g){return E.eD[_]===g},E.prototype.Nb=function(_){return this===_},E.prototype.An=function(){for(var _=A.O.Th(this.bg[0]),g=1;g++F&&G(O,j,C.eu),W[0]?N?j=F:(W=O.c,j=O.e+j+1):++j;W.lengthO.Bd&&W[0]?"-":"")+(1j?"e":"e+")+j:O.toString()}function G(O,F,N,j){var W=O.c,q=O.e+F+1;if(N===1?j=5<=W[q]:N===2?j=5q||W[q+1]!==void 0||1&W[q-1]):N===3?j=j||W[q]!==void 0||0>q:(j=!1,N!==0&&E("!Big.RM!")),1>q||!W[0])j?(O.e=-F,O.c=[1]):O.c=[O.e=0];else{if(W.length=q--,j)for(;9<++W[q];)W[q]=0,q--||(++O.e,W.unshift(1));for(q=W.length;!W[--q];W.pop());}return O}function E(O){throw(O=Error(O)).name="BigError",O}var _=-7,g=21,b=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,C=function(){function O(F){if(F instanceof O)this.Bd=F.Bd,this.e=F.e,this.c=F.c.slice();else{var N,j,W;for(F===0&&0>1/F?F="-0":b.test(F+="")||E(NaN),this.Bd=F.charAt(0)=="-"?(F=F.slice(1),-1):1,-1<(N=F.indexOf("."))&&(F=F.replace(".","")),0<(j=F.search(/e/i))?(0>N&&(N=j),N+=+F.slice(j+1),F=F.substring(0,j)):0>N&&(N=F.length),j=0;F.charAt(j)=="0";j++);if(j==(W=F.length))this.c=[this.e=0];else{for(;F.charAt(--W)=="0";);for(this.e=N-j-1,this.c=[],N=0;j<=W;this.c[N++]=+F.charAt(j++));}}}return O.prototype.abs=function(){var F=new O(this);return F.Bd=1,F},O.prototype.cmp=function(F){var N=this.c,j=(F=new O(F)).c,W=this.Bd,q=F.Bd,J=this.e,ee=F.e;if(!N[0]||!j[0])return N[0]?W:j[0]?-q:0;if(W!=q)return W;if(F=0>W,J!=ee)return J>(ee^F)?1:-1;for(W=-1,q=(J=N.length)<(ee=j.length)?J:ee;++W(j[W]^F)?1:-1;return J==ee?0:J>(ee^F)?1:-1},O.prototype.jm=function(F){var N=this.c,j=(F=new O(F)).c,W=this.Bd==F.Bd?1:-1,q=O.rr;if((q!==~~q||0>q||1e6Xt?0:Xt,he.unshift(0);Et++ee;ee++){if(J!=(Et=pt.length))var wi=J>Et?1:-1;else{var pi=-1;for(wi=0;++pipt[pi]?1:-1;break}}if(!(0>wi))break;for(F=Et==J?j:he;Et;){if(pt[--Et]Xt&&G(Ye,q,O.eu,pt[0]!==void 0),Ye},O.prototype.fS=function(){return 0this.cmp(0)},O.prototype.jt=function(F){var N,j=this.Bd,W=(F=new O(F)).Bd;if(j!=W)return F.Bd=-W,this.tI(F);var q=this.c.slice(),J=this.e,ee=F.c,he=F.e;if(!q[0]||!ee[0])return ee[0]?(F.Bd=-W,F):new O(q[0]?this:0);if(j=J-he){for((N=0>j)?(j=-j,J=q):(he=J,J=ee),J.reverse(),W=j;W--;J.push(0));J.reverse()}else for(J=((N=q.lengthj;){if(q[--J]W.length-J.length&&(j=J,J=W,W=j),N=J.length,j=0;N;)j=(W[--N]=W[N]+J[N]+j)/10|0,W[N]%=10;for(j&&(W.unshift(j),++q),N=W.length;W[--N]==0;W.pop());return F.c=W,F.e=q,F},O.prototype.pow=function(F){var N=this,j=new O(1),W=j,q=0>F;for((F!==~~F||-1e6>F||1e6>=1;)N=N.lr(N);return q?j.jm(W):W},O.prototype.round=function(F,N){var j=this;return F==null?F=0:(F!==~~F||0>F||1e6N&&E(NaN),(N=Math.sqrt(this.toString()))==0||N==1/0?((N=F.join("")).length+j&1||(N+="0"),(F=new O(Math.sqrt(N).toString())).e=((j+1)/2|0)-(0>j||1&j)):F=new O(N.toString()),N=F.e+(O.rr+=4);do j=F,F=W.lr(j.tI(this.jm(j)));while(j.c.slice(0,N).join("")!==F.c.slice(0,N).join(""));return G(F,O.rr-=4,O.eu),F},O.prototype.lr=function(F){var N=this.c,j=(F=new O(F)).c,W=N.length,q=j.length,J=this.e,ee=F.e;if(F.Bd=this.Bd==F.Bd?1:-1,!N[0]||!j[0])return new O(0*F.Bd);if(F.e=J+ee,WJ;)q=he[ee]+j[J]*N[ee-J-1]+q,he[ee--]=q%10,q=q/10|0;he[ee]=(he[ee]+q)%10}for(q&&++F.e,he[0]||he.shift(),J=he.length;!he[--J];he.pop());return F.c=he,F},O.prototype.toString=function(){var F=this.e,N=this.c.join(""),j=N.length;if(F<=_||F>=g)N=N.charAt(0)+(1F?"e":"e+")+F;else if(0>F){for(;++F;N="0"+N);N="0."+N}else if(0j)for(F-=j;F--;N+="0");else Fthis.Bd&&this.c[0]?"-"+N:N},O.prototype.toExponential=function(F){return F==null?F=this.c.length-1:(F!==~~F||0>F||1e6=F&&(W=ue(this,this.e+F),0>this.Bd&&this.c[0]&&0>W.indexOf("-")&&(W="-"+W));return _=N,g=j,W||E("!toFix!"),W},O.prototype.toPrecision=function(F){return F==null?this.toString():((F!==~~F||1>F||1e6C.get(J)?(C.set(N,2147483647),N=J):C.set(J,2147483647),j++;else{if(!(1&j))C.set(N,2147483647);else if(_)return g!=null&&(g[0]=!0),null;F.L(q),N=J,j=1}if(!(1&j))C.set(N,2147483647);else if(_)return g!=null&&(g[0]=!0),null;if(!_)for(C.Vd(0,C.size,function(he,Ee){return he-Ee}),J=0,ee=C.size;Jg-_)b.nr(_,g,E);else{var C=!0;try{for(var O=1/0,F=-1/0,N=_;NF&&(F=j)}if(this.reset(g-_,O,F,g-_)){for(N=_;NC&&b.nr(_+C,_+g,E);100E||g==_)&&(E=Math.min(G.hL,E),this.yf.Jb(E),this.yf.resize(E),this.yf.Wj(0,0,this.yf.size),this.EH=_,this.ys.resize(b),this.Es=(g-_)/(E-1),!0)},G.prototype.zF=function(E){return A.O.truncate((E-this.EH)/this.Es)},G.hL=65536,G}();A.Xt=ue}(ye||(ye={})),function(A){var ue,G;(G=ue||(ue={}))[G.enum_line=1]="enum_line",G[G.enum_arc=2]="enum_arc",G[G.enum_dummy=4]="enum_dummy",G[G.enum_concave_dip=8]="enum_concave_dip",G[G.enum_connection=3]="enum_connection";var E=function(){function O(){}return O.Qu=function(F,N,j,W,q,J){var ee=new O;return ee.Im=new A.h,ee.Vm=new A.h,ee.aw=new A.h,ee.Im.L(F),ee.Vm.L(N),ee.aw.L(j),ee.Co=W,ee.qh=q,ee.sh=J,ee},O.construct=function(F,N,j,W){var q=new O;return q.Im=new A.h,q.Vm=new A.h,q.aw=new A.h,q.Im.L(F),q.Vm.L(N),q.aw.Rc(),q.Co=4,q.qh=j,q.sh=W,q},O}(),_=function(){function O(F,N,j,W,q,J){this.Yv=null,this.ya=0,this.EA=F,this.bI=this.$H=0,this.Ka=N,this.Mj=j,this.vk=W,this.Dq=q,this.Ub=J}return O.prototype.next=function(){for(var F=new A.Sa;;){if(this.ya==this.EA.I())return null;if(this.EA.ve(this.ya,F),this.ya++,!F.B())break}var N=!1;if(this.Yv==null&&(this.$H=F.Lg(),this.bI=F.ih(),this.Yv=C.buffer(F,this.Ka,this.Mj,this.vk,this.Dq,this.Ub),N=!0),this.yaW)throw A.i.N();if(F.B())return new A.Da(F.description);var ee=new A.l;return F.xc(ee),0=q&&(q=96),J.rb=Math.abs(J.Ka),J.Kv=J.rb!=0?1/J.rb:0,isNaN(W)||W==0?W=1e-5*J.rb:W>.5*J.rb&&(W=.5*J.rb),12>q&&(q=12),(F=Math.abs(N)*(1-Math.cos(Math.PI/q)))>W?W=F:(F=Math.PI/Math.acos(1-W/Math.abs(N)))(q=A.O.truncate(F))&&(q=12,W=Math.abs(N)*(1-Math.cos(Math.PI/q))),J.vk=W,J.Dq=q,J.tA=Math.min(J.ct,.25*W),J.lE()},O.prototype.cv=function(){if(this.Id==null)this.Id=[];else if(this.Id.length!==0)return;var F=this.qE();F=A.O.truncate((F+3)/4);var N=.5*Math.PI/F;this.oA=N;for(var j=0;j<4*F;j++)this.Id.push(null);var W=Math.cos(N);N=Math.sin(N);var q=A.h.construct(0,1);for(j=0;j=this.Ka&&(F=new A.l,this.X.A(F),F.R()<=2*-this.Ka||F.ca()<=2*this.Ka))return new A.Da(this.X.description)}switch(this.X.getType()){case 33:return this.PN();case 550:return this.ON();case 1607:return this.RN();case 1736:return this.QN();case 197:return this.LN();default:throw A.i.Qa()}},O.prototype.RN=function(){if(this.EG(this.X)){var F=new A.Sa;this.X.ve(0,F);var N=new A.l;return this.X.A(N),F.Cb(N.sf()),this.Gu(F)}return this.X=this.WV(this.X),F=new g(this,this.oq),A.Gh.local().V(F,this.Mj,this.Ub).next()},O.prototype.QN=function(){if(this.Ka==0)return this.X;var F=A.Yl.local();if(this.cv(),this.X=F.V(this.X,null,!1,this.Ub),0>this.Ka){var N=this.X;return N=this.py(N,0,N.da()),F.V(N,this.Mj,!1,this.Ub)}return this.EG(this.X)?(F=new A.Sa,this.X.ve(0,F),N=new A.l,this.X.A(N),F.Cb(N.sf()),this.Gu(F)):(F=new b(this),A.Gh.local().V(F,this.Mj,this.Ub).next())},O.prototype.py=function(F,N,j){for(var W=new A.Da(F.description);NF.Ja(N))){var q=F.Ir(N),J=new A.l;if(F.Rj(N,J),0=this.Ka){if(this.Ka==0)F.ad(this.X,!1);else{var N=new A.Fh;this.X.bn(N),N.W(this.Ka,this.Ka),F.ad(N,!1)}return F}return F.ad(this.X,!1),this.X=F,this.jE(F,0)},O.prototype.jE=function(F,N){this.cv();var j=new A.Da(F.description),W=new A.h,q=new A.h,J=new A.h,ee=new A.h,he=new A.h,Ee=new A.h,De=new A.h,pt=new A.h,Et=F.Ja(N),Ye=F.Ba(N),jt=0;for(N=F.Ja(N);jtF.Ja(N))return null;if(this.FG(F,N)&&0(F=-1>F?4:2*Math.PI/Math.acos(F)+.5)?F=4:F>this.Dq&&(F=this.Dq),A.O.truncate(F)},O.prototype.GD=function(F,N,j,W,q){this.cv();var J=new A.h;J.uc(j,N),J.scale(this.Kv);var ee=new A.h;ee.uc(W,N),ee.scale(this.Kv),0>(J=Math.atan2(J.y,J.x)/this.oA)&&(J=this.Id.length+J),J=this.Id.length-J,0>(ee=Math.atan2(ee.y,ee.x)/this.oA)&&(ee=this.Id.length+ee),(ee=this.Id.length-ee)J.I(ee))return 0>q||(q=F,J=new A.Sa,q.ve(q.Ba(N),J),this.yu(j,J)),1;var he=J.Na(J.Xa(J.Ob(ee))),Ee=new A.Dd;if(Ee.gg(-he.x,-he.y),J.Oc(Ee),W&&(this.tQ(J,ee,q),2>J.I(ee)))return 0>q||(q=F,J=new A.Sa,q.ve(q.Ba(N),J),this.yu(j,J)),1;this.Zd.length=0;var De=J.Ob(ee);N=J.Xa(De);var pt=q==1?J.Ma(N):J.U(N);F=q==1?J.U(N):J.Ma(N);var Et=!0;W=new A.h,ee=new A.h;var Ye=new A.h,jt=new A.h,ei=new A.h,Xt=new A.h,wi=new A.h,pi=new A.h,Ri=new A.h,Ui=new A.h,Bi=this.rb;De=J.Ja(De);for(var mi=0;mipt||0>Et&&pt==0?this.Zd.push(E.Qu(jt,ei,W,2,this.Zd.length+1,this.Zd.length-1)):jt.qb(ei)||(this.Zd.push(E.construct(jt,W,this.Zd.length+1,this.Zd.length-1,"dummy")),this.Zd.push(E.construct(W,ei,this.Zd.length+1,this.Zd.length-1,"dummy"))),Xt.add(ee,Ri),this.Zd.push(E.Qu(ei,Xt,W,1,this.Zd.length+1,this.Zd.length-1)),jt.L(Xt),Ui.L(Ri),Ye.L(W),W.L(ee),pi.L(wi),pt=N,N=F,Et=!1,F=q==1?J.U(N):J.Ma(N);return this.Zd[this.Zd.length-1].qh=0,this.Zd[0].sh=this.Zd.length-1,this.YV(j),Ee.gg(he.x,he.y),j.YD(Ee,j.da()-1),1},O.prototype.YV=function(F){for(var N=this.zO(),j=!0,W=N+1,q=N;W!=N;q=W){var J=this.Zd[q];W=J.qh!=-1?J.qh:(q+1)%this.Zd.length,J.Co!=0&&(j&&F.Lt(J.Im),J.Co==2?this.GD(F,J.aw,J.Im,J.Vm,!0):F.Ci(J.Vm),j=!1)}},O.prototype.zO=function(){this.Ks==null&&(this.Ks=[null,null,null,null,null,null,null,null,null]);for(var F=0,N=0,j=this.Zd.length;N=this.rb)return!0}return!1},O.prototype.tQ=function(F,N,j){for(var W=0;1>W;W++){var q=!1,J=F.Ob(N),ee=F.Ja(J);if(ee==0)break;var he=ee;if(3>ee)break;!F.dc(J)&&(he=ee-1),J=F.Xa(J),ee=0Wi||0>Fr&&Wi==0||!this.Fv(jt,Et,Ye)||(wi.L(Ye),ds=!1,++ar,q=!0),ds){if(0.5*this.vk?(Xt.add(jt,Et),Xt.scale(.5),Ui.normalize(),Ui.ar(),Bi.L(Ui),Bi.scale(mi-ar),Xt.add(Bi),F.mf(ee,Xt)):F.pd(ee,!0),ar=0}jt.L(Et),De=J}Et.L(Ye),ee=J,J=Ee,Ee=0N?(this.oq=!1,F):(this.oq=!0,A.Fg.Mk(F,this.ct,!1,!0,this.Ub))},O.prototype.yu=function(F,N){if(N=N.D(),this.Id!=null&&this.Id.length!==0){var j=new A.h;j.L(this.Id[0]),j.Ct(this.rb,N),F.Lt(j);for(var W=1,q=this.Id.length;W=g?1:-1;case 1:if(E.G=g?1:-1;case 2:if(E.v>=g&&E.C>g)break;return E.C<=g?1:-1;case 3:if(!(E.G>=g&&E.H>g))return E.H<=g?1:-1}return 0},G.prototype.Ay=function(E,_){return E.getType()==1736?this.Cy(E,_):this.Dy(E)},G.prototype.Cy=function(E,_){if(this.Ca.R()==0||this.Ca.ca()==0)return E.Ia();var g=new A.l;E.xc(g),this.X=this.g.Ib(E);var b=new A.l,C=new A.l,O=new A.h,F=new A.h,N=[0,0,0,0,0,0,0,0,0],j=[0,0,0,0,0,0,0,0,0];new A.ig;var W=new A.yb,q=new A.ia(0);q.Jb(Math.min(100,E.I()));for(var J=!1,ee=0;!J&&4>ee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=g.v<=De&&g.C>=De;break;case 1:De=this.Ca.G,he=g.G<=De&&g.H>=De;break;case 2:De=this.Ca.C,he=g.v<=De&&g.C>=De;break;case 3:De=this.Ca.H,he=g.G<=De&&g.H>=De}if(he)for(J=!0,he=this.g.Ob(this.X);he!=-1;){var pt=-1,Et=-1,Ye=this.g.Xa(he),jt=Ye;do{var ei=this.g.bc(jt);ei==null&&(ei=W,this.g.D(jt,O),ei.Dc(O),this.g.D(this.g.U(jt),F),ei.Qc(F)),ei.A(b);var Xt=this.Lh(b,ee,De),wi=0,pi=-1;if(Xt==-1){wi=0<(ei=ei.cq(Ee,De,N,j))?this.g.Ul(jt,j,ei):0,wi+=1;var Ri=jt,Ui=this.g.U(Ri);for(ei=0;eithis.g.Ja(he)?this.g.Zq(he):this.g.Rb(he)}}return J?E.Ia():(this.FB(),0<_&&this.My(_),this.g.Ne(this.X))},G.prototype.Dy=function(E){var _=new A.l,g=new A.l,b=[0,0,0,0,0,0,0,0,0],C=[0,0,0,0,0,0,0,0,0],O=new A.ig,F=E,N=new A.l;E.xc(N);for(var j=0;4>j;j++){var W=!1,q=(1&j)!=0,J=0;switch(j){case 0:J=this.Ca.v,W=N.v<=J&&N.C>=J;break;case 1:J=this.Ca.G,W=N.G<=J&&N.H>=J;break;case 2:J=this.Ca.C,W=N.v<=J&&N.C>=J;break;case 3:J=this.Ca.H,W=N.G<=J&&N.H>=J}if(W){W=F,F=E.Ia(),(W=W.Ga()).Zi();for(var ee,he=new A.h;W.$a();)for(var Ee,De=!0;W.Ha();){var pt=W.ha();pt.A(_);var Et=this.Lh(_,j,J);if(Et==-1){if(0<(Et=pt.cq(q,J,b,C))){var Ye=0;ee=pt.ac();for(var jt=0;jt<=Et;jt++)if(Ye!=(Ee=jt=(j=A.O.truncate(Math.min(Math.ceil(j/E),2048)))))){for(var W=1;WC.size)){var q=this;C.Vd(0,C.size,function(Xt,wi){return q.Mh(Xt,wi)}),g=new A.h,O=new A.h,F=new A.h,O.Rc();var J=-1;N=new A.ia(0),j=new A.ia(0),W=this.g.Gd();for(var ee=this.g.Gd(),he=0,Ee=C.size;hethis.Mh(J,Et)&&(this.g.D(Et,g),E?g.y==_:g.x==_)&&(N.add(J),Ye=!0,this.g.Ra(J,ee,1)),0>this.Mh(J,De)&&(this.g.D(De,g),E?g.y==_:g.x==_)&&(Ye||N.add(J),this.g.Ra(J,W,1))}for(pt=0,Ye=N.size;ptthis.Mh(Ee,pt)&&(this.g.D(pt,N),E?N.y==_:N.x==_)&&(De=pt),pt=-1;var Et=this.g.Ma(Ee);if(0>this.Mh(Ee,Et)&&(this.g.D(Et,N),E?N.y==_:N.x==_)&&(pt=Et),De!=-1&&pt!=-1)this.Kh(Ee,b,C),this.g.pd(Ee,!1),this.Kh(De,b,C),this.g.pd(De,!1),q=!0;else if(De!=-1||pt!=-1){for(Et=he+1;Etthis.Mh(Ye,jt)&&(this.g.D(jt,N),E?N.y==_:N.x==_)&&(ei=jt),jt=this.g.Ma(Ye);var Xt=-1;if(0>this.Mh(Ye,jt)&&(this.g.D(jt,N),E?N.y==_:N.x==_)&&(Xt=jt),ei!=-1&&Xt!=-1){this.Kh(Ye,b,C),this.g.pd(Ye,!1),this.Kh(ei,b,C),this.g.pd(ei,!1),q=!0;break}if(De!=-1&&Xt!=-1){this.zt(b,Ee,De,Ye,Xt,C),q=!0;break}if(pt!=-1&&ei!=-1){this.zt(b,Ye,ei,Ee,pt,C),q=!0;break}}}if(q)break}}}if(!q)break}J=O,j.L(g)}}this.g.Td(C)},G.prototype.Kh=function(E,_,g){g=this.g.Pa(E,g),_.set(g,-1),g=this.g.Pa(E,this.ji),this.dd.set(g,-1),(_=this.g.bd(E))!=-1&&this.g.Xa(_)==E&&(this.g.Jf(_,-1),this.g.Wg(_,-1))},G.prototype.zt=function(E,_,g,b,C,O){this.g.Bc(_,b),this.g.Cc(b,_),this.g.Cc(g,C),this.g.Bc(C,g),this.Kh(b,E,O),this.g.mi(b,!1),this.Kh(C,E,O),this.g.mi(C,!0)},G.prototype.Ty=function(){for(var E=0,_=this.dd.size;E<_;E++){var g=this.dd.get(E);g!=-1&&this.g.aj(g,-1)}for(var b=0,C=0,O=this.g.Ob(this.X);O!=-1;){var F=this.g.Xa(O);if(F==-1||O!=this.g.bd(F)){var N=O;O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)}else{g=F,N=0;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),this.g.pd(F,!1)),N=O,O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)):(this.g.cp(O,!1),this.g.Wg(O,this.g.Ma(F)),this.g.Vj(O,N),C+=N,b++,O=this.g.Rb(O))}}for(E=0,_=this.dd.size;E<_;E++)if((g=this.dd.get(E))!=-1&&(O=this.g.bd(g))==-1){O=this.g.vf(this.X,-1),N=0,F=g;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(0<=(g=this.g.Pa(F,this.ji))&&this.dd.set(g,-1),this.g.pd(F,!1)),N=O,this.g.Jf(N,-1),this.g.$q(N)):(this.g.kn(O,!0),this.g.Vj(O,N),this.g.Jf(O,F),this.g.Wg(O,this.g.Ma(F)),this.g.cp(O,!1),C+=N,b++)}for(this.g.Rl(this.X,b),this.g.Tj(this.X,C),E=0,_=this.g.ld;_!=-1;_=this.g.ue(_))E+=this.g.I(_);this.g.bC(E)},G.By=function(E,_,g){return new G(_).Ay(E,g)},G.clip=function(E,_,g,b){if(E.B())return E;if(_.B())return E.Ia();if((g=E.getType())==33)return b=E.D(),_.contains(b)?E:E.Ia();if(g==197)return b=new A.l,E.A(b),b.Ea(_)?(_=new A.Fh,E.copyTo(_),_.Xo(b),_):E.Ia();var C=new A.l;if(E.xc(C),_.contains(C))return E;if(!_.isIntersecting(C))return E.Ia();if((C=E.Bb)!=null&&(C=C.Fk)!=null){if((C=C.Ro(_))==1){if(g!=1736)throw A.i.Qa();return(E=new A.Da(E.description)).tp(_),E}if(C==0)return E.Ia()}switch(g){case 550:g=null,C=E.I();for(var O=E.ub(0),F=0,N=0;N=g?1:-1;case 1:if(E.G=g?1:-1;case 2:if(E.v>=g&&E.C>g)break;return E.C<=g?1:-1;case 3:if(!(E.G>=g&&E.H>g))return E.H<=g?1:-1}return 0},G.prototype.Ay=function(E,_){return E.getType()==1736?this.Cy(E,_):this.Dy(E)},G.prototype.Cy=function(E,_){if(this.Ca.R()==0||this.Ca.ca()==0)return E.Ia();var g=new A.l;E.xc(g),this.X=this.g.Ib(E);var b=new A.l,C=new A.l,O=new A.h,F=new A.h,N=[0,0,0,0,0,0,0,0,0],j=[0,0,0,0,0,0,0,0,0],W=new A.yb,q=new A.ia(0);q.Jb(256);for(var J=!1,ee=0;!J&&4>ee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=g.v<=De&&g.C>=De;break;case 1:De=this.Ca.G,he=g.G<=De&&g.H>=De;break;case 2:De=this.Ca.C,he=g.v<=De&&g.C>=De;break;case 3:De=this.Ca.H,he=g.G<=De&&g.H>=De}if(he)for(J=!0,he=this.g.Ob(this.X);he!=-1;){var pt=!0,Et=-1,Ye=-1,jt=this.g.Xa(he),ei=jt;do{var Xt=this.g.bc(ei);Xt==null&&(Xt=W,this.g.D(ei,O),Xt.Dc(O),this.g.D(this.g.U(ei),F),Xt.Qc(F)),Xt.A(b);var wi=this.Lh(b,ee,De),pi=0,Ri=-1;if(wi==-1){pi=0<(Xt=Xt.cq(Ee,De,N,j))?this.g.LX(ei,j,Xt):0,pi+=1;var Ui=ei,Bi=this.g.U(Ui);for(Xt=0;Xtee;ee++){var he=!1,Ee=(1&ee)!=0,De=0;switch(ee){case 0:De=this.Ca.v,he=N.v<=De&&N.C>=De;break;case 1:De=this.Ca.G,he=N.G<=De&&N.H>=De;break;case 2:De=this.Ca.C,he=N.v<=De&&N.C>=De;break;case 3:De=this.Ca.H,he=N.G<=De&&N.H>=De}if(he)for(he=F,F=E.Ia(),(he=he.Ga()).Zi();he.$a();)for(var pt,Et=!0;he.Ha();){var Ye=he.ha();Ye.A(_);var jt=this.Lh(_,ee,De);if(jt==-1){if(0<(jt=Ye.cq(Ee,De,b,C))){var ei=0;Ye.Yp(j);for(var Xt=0;Xt<=jt;Xt++)if(ei!=(pt=Xtb.x&&(b.x+=E)}else J=_.y-this.Ca.G,C.y=A.lc.sign(g.y-_.y),b.y=E*A.lc.Cn(Math.floor(Math.abs(J/E)),J)+this.Ca.G,0>b.y&&(b.y+=E);J=q!=0?g.y-_.y:g.x-_.x;var ee=Math.abs(J);if(65536=Ee||(O[ee]=Ee,ee++)}ee!=0&&this.g.Ul(j,O,ee)}}j=W}while(j!=N)}},G.prototype.Vl=function(E,_){for(var g=-1,b=new A.h,C=null,O=this.g.Ob(this.X);O!=-1;O=this.g.Rb(O))for(var F=this.g.Xa(O),N=0,j=this.g.Ja(O);NC.size)){var q=this;C.Vd(0,C.size,function(Xt,wi){return q.Mh(Xt,wi)}),g=new A.h,O=new A.h,F=new A.h,O.Rc();var J=-1;N=new A.ia(0),j=new A.ia(0),W=null;for(var ee=this.g.Gd(),he=this.g.Gd(),Ee=0,De=C.size;EeO.compare(g)&&(E?g.y==_:g.x==_)&&(N.add(J),jt=!0,this.g.Ra(J,he,1)),this.g.D(pt,g),0>O.compare(g)&&(E?g.y==_:g.x==_)&&(jt||N.add(J),this.g.Ra(J,ee,1))}for(Et=0,jt=N.size;Etj.compare(N)&&(E?N.y==_:N.x==_)&&(De=pt),pt=-1;var Et=this.g.Ma(Ee);if(this.g.D(Et,N),0>j.compare(N)&&(E?N.y==_:N.x==_)&&(pt=Et),De!=-1&&pt!=-1)this.Kh(Ee,b,C),this.g.pd(Ee,!1),this.Kh(De,b,C),this.g.pd(De,!1),q=!0;else if(De!=-1||pt!=-1){for(Et=he+1;Etj.compare(N)&&(E?N.y==_:N.x==_)&&(ei=jt),jt=this.g.Ma(Ye);var Xt=-1;if(this.g.D(jt,N),0>j.compare(N)&&(E?N.y==_:N.x==_)&&(Xt=jt),ei!=-1&&Xt!=-1){this.Kh(Ye,b,C),this.g.pd(Ye,!1),this.Kh(ei,b,C),this.g.pd(ei,!1),q=!0;break}if(De!=-1&&Xt!=-1){this.zt(b,Ee,De,Ye,Xt,C),q=!0;break}if(pt!=-1&&ei!=-1){this.zt(b,Ye,ei,Ee,pt,C),q=!0;break}}}if(q)break}}}if(!q)break}J=O,j.L(g)}this.g.Td(C)}},G.prototype.Kh=function(E,_,g){g=this.g.Pa(E,g),_.set(g,-1),g=this.g.Pa(E,this.ji),this.dd.set(g,-1),(_=this.g.bd(E))!=-1&&this.g.Xa(_)==E&&(this.g.Jf(_,-1),this.g.Wg(_,-1))},G.prototype.zt=function(E,_,g,b,C,O){this.g.Bc(_,b),this.g.Cc(b,_),this.g.Cc(g,C),this.g.Bc(C,g),this.Kh(b,E,O),this.g.mi(b,!1),this.Kh(C,E,O),this.g.mi(C,!0)},G.prototype.Ty=function(){for(var E=0,_=this.dd.size;E<_;E++){var g=this.dd.get(E);g!=-1&&this.g.aj(g,-1)}for(var b=0,C=0,O=this.g.Ob(this.X);O!=-1;){var F=this.g.Xa(O);if(F==-1||O!=this.g.bd(F)){var N=O;O=this.g.Rb(O),this.g.Jf(N,-1),this.g.$q(N)}else{g=F,N=0;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);this.g.cp(O,!1),this.g.Wg(O,this.g.Ma(F)),this.g.Vj(O,N),C+=N,b++,O=this.g.Rb(O)}}for(E=0,_=this.dd.size;E<_;E++)if((g=this.dd.get(E))!=-1&&(O=this.g.bd(g))==-1){O=this.g.vf(this.X,-1),N=0,F=g;do this.g.aj(g,O),N++,g=this.g.U(g);while(g!=F);2>=N?(g=this.g.Pa(F,this.ji),this.dd.set(g,-1),F=this.g.pd(F,!1),N==2&&(0<=(g=this.g.Pa(F,this.ji))&&this.dd.set(g,-1),this.g.pd(F,!1)),N=O,this.g.Jf(N,-1),this.g.$q(N)):(this.g.kn(O,!0),this.g.Vj(O,N),this.g.Jf(O,F),this.g.Wg(O,this.g.Ma(F)),this.g.cp(O,!1),C+=N,b++)}for(this.g.Rl(this.X,b),this.g.Tj(this.X,C),E=0,_=this.g.ld;_!=-1;_=this.g.ue(_))E+=this.g.I(_);this.g.bC(E)},G.By=function(E,_,g,b){return new G(_,b).Ay(E,g)},G.clip=function(E,_,g,b,C){return G.Nu(E,_,null,g,b,C)},G.Nu=function(E,_,g,b,C,O){var F=E.getType();if(F==33)return C=E.D(),_.contains(C)?E:E.Ia();if(F==197)return C=new A.l,E.A(C),C.Ea(_)?(_=new A.Fh,E.copyTo(_),_.Xo(C),_):E.Ia();if(E.B())return E;if(_.B())return E.Ia();var N=new A.l;if(E.xc(N),_.contains(N))return E;if(!_.isIntersecting(N))return E.Ia();if((g!=null||isNaN(b))&&A.ta.ty(g,_,!1),!A.aa.xj(F))throw A.i.N();if((g=E.Bb)!=null&&(g=g.Fk)!=null){if((g=g.Ro(_))==1){if(F!=1736)throw A.i.fa("internal error");return(E=new A.Da(E.description)).tp(_),E}if(g==0)return E.Ia()}switch(F){case 550:for(O=null,F=E.I(),g=E.ub(0),b=0,C=new A.h,N=0;N=N;N+=1)for(var j=0;1>=j;j+=1){var W=_.jG(O+N,F+j),q=this.xl.rR(W);q!=-1&&(this.pq[C]=q,this.xs[C]=W,C++)}for(O=C-1;1<=O;O--)for(q=this.pq[O],F=O-1;0<=F;F--)if(q==this.pq[F]){this.xs[F]=-1,O!=--C&&(this.xs[O]=this.xs[C],this.pq[O]=this.pq[C]);break}for(F=0;FF.Db())throw A.i.N();return N==0||F.B()?F:((J=new O(J)).ko=F,J.Ka=N,J.qa=q,J.Ki=j,J.CA=W,J.Rx())},O.prototype.eM=function(){var F=this.ko,N=F.ac(),j=F.wc(),W=new A.h;return W.uc(j,N),W.normalize(),W.Hv(),W.scale(this.Ka),N.add(W),j.add(W),W=F.Ia(),F.Dc(N),F.Qc(j),W},O.prototype.dM=function(){var F=this.ko;if(0J&&(0this.Ka?-G:G,-1Ee&&(.017453292519943295>(De=2*Math.acos(Ee))&&(De=.017453292519943295),1<(ee=A.O.truncate(G/De+1.5))&&(he/=ee)),De=Ye+_,Ye=g.Pd(J,this.Ka,De),F==0&&(Ye.type|=1024),this.fc(Ye,F),Ee=this.Ka/Math.cos(he/2),De+=he/2,(Ye=g.Pd(J,Ee,De)).type|=1024,this.fc(Ye);0<--ee;)De+=he,(Ye=g.Pd(J,Ee,De)).type|=1024,this.fc(Ye);(Ye=g.Pd(J,this.Ka,jt-_)).type|=1024,this.fc(Ye)}else if(this.Ki==1)Ye=g.Pd(J,this.Ka,Ye+_),this.fc(Ye,F),Ye=g.Pd(J,this.Ka,jt-_),this.fc(Ye);else if(this.Ki==0)for(Ee=1-j/Math.abs(this.Ka),ee=1,he=jt-_-(Ye+_),-1Ee&&(.017453292519943295>(De=2*Math.acos(Ee))&&(De=.017453292519943295),1<(ee=A.O.truncate(Math.abs(he)/De+1.5))&&(he/=ee)),Ee=this.Ka/Math.cos(.5*he),De=Ye+_+.5*he,Ye=g.Pd(J,Ee,De),this.fc(Ye,F);0<--ee;)De+=he,Ye=g.Pd(J,Ee,De),this.fc(Ye);else this.Ki==2?(Ee=ee.x-J.x,De=ee.y-J.y,.99999999<(ee=(Ee*(pt=he.x-J.x)+De*(Et=he.y-J.y))/Math.sqrt(Ee*Ee+De*De)/Math.sqrt(pt*pt+Et*Et))?(Ye=g.Pd(J,1.4142135623730951*this.Ka,jt-.25*G),this.fc(Ye,F),Ye=g.Pd(J,1.4142135623730951*this.Ka,jt+.25*G),this.fc(Ye)):(ee=Math.abs(this.Ka/Math.sin(.5*Math.acos(ee))))>(he=Math.abs(this.CA*this.Ka))?(Ee=.5*(jt-Ye),Ee=this.Ka/Math.abs(Math.sin(Ee)),Ye=g.Pd(J,Ee,.5*(Ye+jt)),jt=A.h.construct(Ye.x,Ye.y),Ye=A.h.construct(J.x,J.y),(J=new A.h).uc(jt,Ye),(jt=new A.h).HW(he/J.length(),J,Ye),Ye=(ee-he)*Math.abs(this.Ka)/Math.sqrt(ee*ee-this.Ka*this.Ka),0Ye&&(jt-=E),ee=Ye-jt<_):(jt(Ee=1.4142135623730951*this.Ka)?Ye+.25*G:Ye+.75*G,Ye=g.Pd(J,Ee,De),this.fc(Ye,F),De=0>Ee?jt-.25*G:jt-.75*G,Ye=g.Pd(J,Ee,De),this.fc(Ye)):(Ee=.5*(jt-Ye),Ee=this.Ka/Math.abs(Math.sin(Ee)),jtN))for(var j=0;j=W+1;N--)(j=g.al(F.Na(N))).type|=1024,this.wg.push(j);if(this.mE())if(2<=this.Yb.length){for(F=-1,(q=(1024&this.Yb[this.gf-1].type)!=0)||(F=0),N=1;N=Math.min(j.x,W.x)&&Math.max(j.x,W.x)>=Math.min(F.x,N.x)&&Math.max(F.y,N.y)>=Math.min(j.y,W.y)&&Math.max(j.y,W.y)>=Math.min(F.y,N.y)},O.prototype.xQ=function(F,N,j,W,q){q.bE=!1;var J=(N.y-F.y)*(W.x-j.x)-(N.x-F.x)*(W.y-j.y),ee=(j.y-F.y)*(N.x-F.x)-(j.x-F.x)*(N.y-F.y);if(0<=(J=J==0?2:ee/J)&&1>=J){var he=J;if(J=(W.y-j.y)*(N.x-F.x)-(W.x-j.x)*(N.y-F.y),ee=(F.y-j.y)*(W.x-j.x)-(F.x-j.x)*(W.y-j.y),0<=(J=J==0?2:ee/J)&&1>=J)return q.an=g.TO(F.x+J*(N.x-F.x),F.y+J*(N.y-F.y)),q.an.Uh=j.Uh+he*(W.Uh-j.Uh),he!=0&&he!=1||J!=0&&J!=1||(q.bE=!0),q.VY=J,q.WY=he,!((he==0||he==1)&&0J||(J==0||J==1)&&0he)}return!1},O.prototype.QO=function(F){for(;this.Yb[F].shF-(O*=2))return!0;C=new A.h;var N=new A.h,j=new A.h;b.tc(O,C),b.tc(O+2,N),b.tc(O+4,j);var W=g.Wu(N,j,C);if(W.ps()||!g.um(W.value()))return!1;var q=A.h.construct(N.x,N.y),J=new A.h;for(O+=6;OF;F++){b.mB(F,O);var N=this.Cr(O);if(N!=-1){b.Hf(F,C);var j=this.g.fc(this.Ss,C);this.Fa.Sj(N,j)}}},g.prototype.oN=function(b){var C=new A.Sa,O=b.ac();if((O=this.Cr(O))!=-1){b.To(C);var F=this.g.fc(this.Ss,C);this.Fa.Sj(O,F)}O=b.wc(),(O=this.Cr(O))!=-1&&(b.Po(C),b=this.g.fc(this.Ss,C),this.Fa.Sj(O,b))},g.prototype.nN=function(b){var C=b.D();(C=this.Cr(C))!=-1&&(b=this.g.fc(this.Ss,b),this.Fa.Sj(C,b))},g.prototype.Cr=function(b){var C=-1;if(this.Fa.size(-1)==0)return this.Fa.addElement(-4,-1);if(this.Fa.size(-1)==1){var O=this.g.Na(this.Fa.ja(this.Fa.rc(-1)));return b.Rz(O)||(C=this.Fa.xn(-5)),C}return this.pC(b)},g.prototype.pC=function(b){var C=-1;do{var O=this.Fa.rc(-1),F=this.Fa.Fc(-1),N=this.Fa.ja(O),j=this.Fa.ja(F),W=new A.h,q=new A.h;if(this.Xh.D(N,W),this.Xh.D(j,q),N=A.h.Uq(q,b,W),g.um(N))C=this.Fa.xn(-1),(W=this.nC(b,F,O))!=O&&this.oC(b,O,this.Fa.we(W));else if(g.CG(N)){q=this.Fa.sv(-1);var J=this.Fa.rc(-1),ee=this.Fa.Fc(-1);for(N=new A.h,j=new A.h;J!=this.Fa.we(ee);){var he=this.Fa.ja(q);this.Xh.D(he,N),he=A.h.Uq(N,b,W),g.CG(he)?(ee=q,q=this.Fa.ll(q)):(J=q,q=this.Fa.Xp(q))}if(q=ee,W=J,he=this.Fa.ja(q),J=this.Fa.ja(W),this.Xh.D(he,N),this.Xh.D(J,j),W!=O&&(N=A.h.Uq(j,b,N),!g.um(N)))continue;C=this.Fa.zu(W,q,-2,!1),this.oC(b,q,F),this.nC(b,W,O)}else this.sb==null&&(this.sb=new A.yb),this.sb.Dc(q),this.sb.Qc(W),0>(W=this.sb.fe(b,!0))?(W=this.Fa.we(F),this.Fa.vd(F,-1),C=this.Fa.xn(-3),this.nC(b,W,O)):1b},g.CG=function(b){return 0C)throw A.i.fa("Internal Error: max number of iterations exceeded");var N=this.nM(_);if(b=b||N,this.tH&&(N=this.g.Gp(_,!0,!1)!=0,b=b||N),N=!1,(O==0||F||A.$t.kI(!0,this.g,E,null,this.nd))&&(N=this.sM(g),b=b||N),!N)break;A.mp.zp(this.nd)}return b},G}();A.Tk=ue}(ye||(ye={})),function(A){var ue=function(){function E(_){this.$d=this.Mc=null,this.Ys=0,this.Ub=_,this.cA=!0}return E.prototype.uv=function(_,g){var b=this.g.bc(_);if(b==null){if(!this.g.ed(_,g))return null;b=g}return b},E.prototype.Xq=function(){var _;_===void 0&&(_=!1),this.Ys++,(_||!(4095&this.Ys))&&(this.Ys=0,A.mp.zp(this.Ub))},E.prototype.nP=function(){var _=this.g.Yq(!1),g=!1,b=new A.yb,C=new A.yb,O=new A.l;O.Oa();var F=new A.l;F.Oa();for(var N=new A.Sa,j=new A.TC,W=_.next();W!=-1;W=_.next()){A.mp.zp(this.Ub);var q=null,J=!1;if(!A.aa.Rn(this.g.ic(_.ck))){if((q=this.uv(W,b))==null)continue;if(q.A(O),O.W(this.qa,this.qa),q.Bi(this.qa)){if(!q.Bi(0))continue;J=!0,q=null}}var ee=this.g.Yq(_),he=ee.next();for(he!=-1&&(he=ee.next());he!=-1;he=ee.next()){var Ee=null,De=!1;if(!A.aa.Rn(this.g.ic(ee.ck))){if((Ee=this.uv(he,C))==null)continue;if(Ee.A(F),Ee.Bi(this.qa)){if(!Ee.Bi(0))continue;De=!0,Ee=null}}var pt=0,Et=0;if(q!=null&&Ee!=null)O.HG(F)&&(j.Oo(q),j.Oo(Ee),j.Ea(this.qa,!1),0<(pt=j.ol(0))+(Et=j.ol(1))&&(this.g.jr(W,j,0,!0),this.g.jr(he,j,1,!0)),j.clear());else if(q!=null){var Ye=new A.h;if(this.g.D(he,Ye),O.contains(Ye)){if(j.Oo(q),this.g.Vi(he,N),j.Kz(this.qa,N,!1),0<(pt=j.ol(0)))if(this.g.jr(W,j,0,!0),De){for(De=-1,Ye=this.g.U(he);Ye!=-1&&Ye!=he&&(De=Ye,(Ee=this.uv(Ye,C))!=null&&Ee.Bi(0));Ye=this.g.U(Ye));for(Ye=he;Ye!=-1&&(this.g.Dh(Ye,j.Bf),Ye!=De);Ye=this.g.U(Ye));}else this.g.Dh(he,j.Bf);j.clear()}}else{if(Ee==null)continue;if(Ye=new A.h,this.g.D(W,Ye),F.W(this.qa,this.qa),F.contains(Ye)){if(j.Oo(Ee),this.g.Vi(W,N),j.Kz(this.qa,N,!1),0<(Et=j.ol(0)))if(this.g.jr(he,j,0,!0),J){for(De=-1,Ye=this.g.U(W);Ye!=-1&&Ye!=W&&(De=Ye,(Ee=this.uv(Ye,C))!=null&&Ee.Bi(0));Ye=this.g.U(Ye));for(Ye=W;Ye!=-1&&(this.g.Dh(Ye,j.Bf),Ye!=De);Ye=this.g.U(Ye));}else this.g.Dh(W,j.Bf);j.clear()}}if(pt+Et!=0){if(pt!=0){if((q=this.g.bc(W))==null){if(!this.g.ed(W,b))continue;q=b,b.A(O)}else q.A(O);if(q.Bi(this.qa))break}g=!0}}}return g},E.prototype.oP=function(){return this.QU()},E.prototype.QU=function(){return new A.RC().PX(this.g,this.qa)},E.prototype.lI=function(){var _=!1;this.Mc==null&&(this.Mc=new A.Yj);var g=new A.ia(0);g.Jb(this.g.fd+1);for(var b=this.g.Yq(),C=b.next();C!=-1;C=b.next())g.add(C);this.g.nx(g,g.size),g.add(-1),b=this.g.Gd(),C=this.g.Gd(),this.$d=new A.UC(this.g,this.qa,!this.cA),this.Mc.Vo(this.$d);var O=new A.ia(0),F=new A.ia(0),N=0;new A.h;var j=this.g.td;this.g.vb.mc();for(var W,q,J=this.g.vb.za[0].o,ee=g.get(N++);ee!=-1;){var he=W=J[2*(q=j.T(ee,0))],Ee=q=J[2*q+1];do{var De=j.T(ee,2),pt=j.T(ee,1);if(De!=-1){var Et=j.T(De,0),Ye=J[2*Et];0>(Ee<(Et=J[2*Et+1])?-1:Ee>Et?1:heYe?1:0)&&(F.add(ee),F.add(De))}pt!=-1&&(Ye=J[2*(Et=j.T(pt,0))],0>(Ee<(Et=J[2*Et+1])?-1:Ee>Et?1:heYe?1:0)&&(F.add(pt),F.add(pt))),(Ye=this.g.Pa(ee,b))!=-1&&(O.add(Ye),this.g.Ra(ee,b,-1)),(Ye=this.g.Pa(ee,C))!=-1&&(O.add(Ye),this.g.Ra(ee,C,-1)),(ee=g.get(N++))!==-1&&(he=J[2*(Ee=j.T(ee,0))],Ee=J[2*Ee+1])}while(ee!=-1&&he===W&&Ee===q);for(he=O.size==1&&F.size==2,Ye=Ee=-1,De=0,pt=O.size;De_.fd?_=g.nP():g.oP())},E.V=function(_,g,b){return E.fQ(_,_.IF(),g,b)},E.kI=function(_,g,b,C,O){if(!E.yE(g))return!1;var F=new E(O);if(F.g=g,F.qa=b,F.cA=_,F.lI())return C?.Wt(F.Ni),!0;var N=new A.Dd;return N.$B(),g.Oc(N),(F=new E(O)).g=g,F.qa=b,F.cA=_,_=F.lI(),N.$B(),g.Oc(N),!!_&&(C?.Wt(F.Ni),!0)},E.Ml=function(_,g){return!(16>(_=_.I()))&&2*_+Math.log(_)*Math.LOG10E/Math.log(2)*g<1*_*g},E.lP=function(_,g,b,C){var O=g.getType();if(A.aa.Hc(O))return new E(C).mP(_,g,b);throw A.i.fa("crack_A_with_B")},E.prototype.mP=function(_,g,b){var C=new A.l;_.xc(C);var O=new A.l;if(g.xc(O),O.W(b,b),!O.isIntersecting(C))return _;var F=_.Bb,N=null;F!=null&&(N=F.Fb),E.Ml(_,_.I())&&(N=A.ta.jj(_,O));var j=N!=null?N.getIterator():null,W=g.Ga();g=_.Ga();var q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(O=[];W.$a();)for(;W.Ha();){var J=W.ha();if(N!=null){for(j.Uo(J,b),F=j.next();F!=-1;F=j.next())if(this.Xq(),g.Vb(N.ja(F),-1),g.Ha()){var ee=(F=g.ha()).Ea(J,null,q,null,b);for(F=0;Fg.t?1:_.tg.index?1:-1},E}()}(ye||(ye={})),function(A){var ue;(ue=A.KK||(A.KK={}))[ue.Left=0]="Left",ue[ue.Right=1]="Right",ue[ue.Coincident=2]="Coincident",ue[ue.Undefined=3]="Undefined",ue[ue.Uncut=4]="Uncut";var G=function(g,b,C,O,F,N,j,W,q,J,ee){this.X=g,this.bt=b,this.Ns=C,this.tg=O,this.Lm=J,this.Al=ee};A.uY=G;var E=function(){function g(b,C){this.JH=b,this.Hi=C}return g.prototype.qM=function(b,C){var O=new A.h;this.Hi.D(b,O);var F=new A.h;return this.Hi.D(C,F),(O=O.compare(F))!=0?O:(b=this.Hi.Pa(b,this.JH))<(C=this.Hi.Pa(C,this.JH))?-1:b==C?0:1},g}(),_=function(g,b,C,O,F,N,j,W,q){this.tg=g,this.Ns=b,this.OA=C,this.UH=O,this.Ei=F,this.Al=N,this.Lm=j,this.VH=W,this.OT=q};A.tY=_,A.LK=function(){function g(){}return g.JK=function(b,C,O,F,N,j){if(C.B())b=new G(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else if(O.B())b=new G(C,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else{var W=new A.gd;if(W.Ib(C),W.Ib(O),A.Tk.V(W,F,j,!0),W.fd==0)b=new G(C.Ia(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),N.push(b);else{for(C=0,O=W.Gd(),F=W.ld;F!=-1;F=W.ue(F))for(j=W.Ob(F);j!=-1;j=W.Rb(j))for(var q=W.Xa(j),J=0,ee=W.Ja(j);J(Ee=Ee.Ea(q,null,ee,he,0))&&(F=new _(N,F,ee[0],NaN,Ee,W,j,he[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1)),!0},g.wM=function(b,C,O,F,N,j,W){var q=new A.yb,J=new A.yb,ee=[0,0],he=[0,0],Ee=C.bc(N);return Ee==null&&(C.ed(N,q),Ee=q),(q=C.bc(W))==null&&(C.ed(W,J),q=J),2>(Ee=Ee.Ea(q,null,ee,he,0))&&(F=new _(N,F,ee[0],NaN,Ee,W,j,he[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0)},g.xM=function(b,C,O,F,N,j,W,q){var J=new A.yb,ee=new A.yb,he=[0,0],Ee=[0,0],De=C.bc(N);return De==null&&(C.ed(N,J),De=J),(J=C.bc(W))==null&&(C.ed(W,ee),J=ee),(De=De.Ea(J,null,he,Ee,0))==2?(F=new _(N,F,he[0],he[1],De,W,j,Ee[0],Ee[1]),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0):(ee=!1,N==q&&(F=new _(N,F,he[0],NaN,De,W,j,Ee[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),ee=!0),ee)},g.yM=function(b,C,O,F,N,j,W,q){var J=new A.yb,ee=new A.yb,he=[0,0],Ee=[0,0],De=C.bc(N);return De==null&&(C.ed(N,J),De=J),(J=C.bc(W))==null&&(C.ed(W,ee),J=ee),(De=De.Ea(J,null,he,Ee,0))==2?(F=new _(N,F,he[0],he[1],De,W,j,Ee[0],Ee[1]),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),!0):(ee=!1,N==q&&(F=new _(N,F,he[0],NaN,De,W,j,Ee[0],NaN),O.push(F),0>(F=C.Pa(N,b))&&C.Ra(N,b,O.length-1),ee=!0),ee)},g.cM=function(b,C,O,F){var N=[];N[0]=new A.h,N[1]=new A.h,N[2]=new A.h,N[3]=new A.h;var j=new A.h,W=new A.h,q=new A.h,J=new A.h,ee=null;F!=null&&(ee=new A.ig).Or();var he=0,Ee=null,De=new A.yb;new A.yb;for(var pt=O.Ob(O.ld);pt!=-1;pt=O.Rb(pt)){for(var Et=4,Ye=-1,jt=-1,ei=-1,Xt=-1,wi=NaN,pi=!0,Ri=!1,Ui=!0,Bi=!0,mi=!0,ar=0,z=pt,Wi=0,Fr=O.Xa(pt),ds=O.Ja(pt),Dt=0;Dt=C.length-2||C[he+2].Ns!=Ye)&&(Et=0):Et=1):((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,3,Ye,Pt,Un,Et,z,jt,Wi,Qi,Cn),F.push(qn)):null.add(ar)),Et=1):Et!=0?((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,0,Ye,Pt,Un,Et,z,jt,Wi,Qi,Cn),F.push(qn)):null.add(ar)),ko?(he>=C.length-2||C[he+2].Ns!=Ye)&&(Et=1):Et=0):((Un!=yn||ai&&yn==0)&&(F!=null?(qn=new G(Ee,3,Ye,Pt,Un,Et,z,jt,Wi,Qi,Cn),F.push(qn)):null.add(ar)),Et=0),(Un!=yn||ai&&yn==0)&&(yn=Un,z=Ye,jt=Pt,Wi=Un,ei=Qi,Xt=Cn,wi=bs,pi=Ui=!1,Bi=mi=!0))}}he++}yn!=1&&(mi&&(F!=null?Ee=new A.Ta:ar=0),F!=null?(Mn.ah(yn,1,ee),Ee.oc(ee.get(),Bi)):ar++,Bi=mi=!1,Ui=!0)}Ui&&(Un=1,Pt=O.rj(pt),Pt=O.Ma(Pt),Cn=Qi=-1,bs=NaN,pi?F!=null?(qn=new G(Ee,4,Ye,Pt,Un,Et,z,jt,Wi,Qi,Cn),F.push(qn)):null.add(ar):(pi=Et==1?0:Et==0?1:3,F!=null?(qn=new G(Ee,pi,Ye,Pt,Un,Et,z,jt,Wi,Qi,Cn),F.push(qn)):null.add(ar)))}},g.CM=function(b,C,O,F,N,j){var W=O[F].VH;if(W==1)return g.AM(b,C,O,F,N,j);if(W==0)return g.BM(b,C,O,F,N,j);throw A.i.Qa()},g.AM=function(b,C,O,F,N,j){var W=new A.yb,q=O[F].tg,J=O[F].Lm,ee=O[F].Al,he=-1,Ee=-1,De=-1,pt=-1;if(!b&&0.01*_&&(b*=1+(1+(E=E.xb/_))*E),this.pb=g,this.xb=b+2220446049250313e-31*Math.abs(g)},G.prototype.sqrt=function(){if(0<=this.pb){var E=Math.sqrt(this.pb),_=this.pb>10*this.xb?.5*this.xb/E:this.pb>this.xb?E-Math.sqrt(this.pb-this.xb):Math.max(E,Math.sqrt(this.pb+this.xb)-E);_+=2220446049250313e-31*Math.abs(E)}else this.pb<-1*this.xb?_=E=NaN:(E=0,_=Math.sqrt(this.xb));this.pb=E,this.xb=_},G.prototype.sin=function(E){var _=Math.sin(E.pb),g=Math.cos(E.pb);this.pb=_,_=Math.abs(_),this.xb=(Math.abs(g)+.5*_*E.xb)*E.xb+2220446049250313e-31*_},G.prototype.cos=function(E){var _=Math.sin(E.pb),g=Math.cos(E.pb);this.pb=g,g=Math.abs(g),this.xb=(Math.abs(_)+.5*g*E.xb)*E.xb+2220446049250313e-31*g},G.prototype.qg=function(){return Math.abs(this.pb)<=this.xb},G.prototype.ps=function(){return this.qg()&&this.xb!=0},G}();A.Wb=ue}(ye||(ye={}));var ie=new ye.h,ge=new ye.h,je=new ye.h,rt=new ye.h,Me=new ye.h;(function(A){var ue,G;(G=ue||(ue={}))[G.closedPath=1]="closedPath",G[G.exteriorPath=2]="exteriorPath",G[G.ringAreaValid=4]="ringAreaValid";var E=function(){function _(g,b,C,O,F,N,j){b!==void 0?(this.ib=g,this.ck=b,this.bl=C,this.ii=O,this.ya=N,this.hA=j,this.ew=F):(this.ib=g.ib,this.ck=g.ck,this.bl=g.bl,this.ii=g.ii,this.ya=g.ya,this.hA=g.hA,this.ew=g.ew),this.bH=!0}return _.prototype.next=function(){return this.bH?(this.bH=!1,this.ii):this.ii!=-1?(this.ii=this.ib.U(this.ii),this.ya++,this.ii!=-1&&this.ii!=this.ew?this.ii:this.$T()):-1},_.prototype.$T=function(){for(this.bl=this.ib.Rb(this.bl),this.ya=0;this.ck!=-1;){for(;this.bl!=-1;this.bl=this.ib.Rb(this.bl))if(this.ew=this.ii=this.ib.Xa(this.bl),this.ii!=-1)return this.ii;if(this.ck=this.ib.ue(this.ck),this.ck==-1)break;this.hA&&!A.aa.Hc(this.ib.ic(this.ck))||(this.bl=this.ib.Ob(this.ck))}return-1},_.AP=function(g,b,C,O,F,N,j){return new _(g,b,C,O,F,N,j)},_}();A.zY=E,ue=function(){function _(){this.jo=this.Am=this.wk=this.cd=this.Ck=this.vo=this.Oi=this.md=this.bi=this.Sg=this.We=this.Il=null,this.qw=this.ld=-1,this.fd=0,this.fA=!1,this.ht=this.it=this.vb=null}return _.prototype.Sh=function(g){return this.We!=null?this.We[g]:null},_.prototype.Xg=function(g,b){if(this.We==null){if(b==null)return;this.We=[];for(var C=0,O=this.vb.I();C=this.Oi.size&&(g=16>b?16:A.O.truncate(3*b/2),this.Oi.resize(g),this.vo.resize(g)),this.Oi.set(b,0),this.vo.set(b,0),b},_.prototype.sF=function(g){this.md.jd(g)},_.prototype.Vy=function(g){this.td.jd(g),this.fd--},_.prototype.oI=function(g){this.md==null&&(this.md=new A.$c(8),this.td=new A.$c(5),this.Oi=new A.be(0),this.vo=new A.be(0));var b=this.td.Ce(),C=0<=g?g:b;if(this.td.S(b,0,C),0>g){if(C>=this.vb.I()){if(g=16>C?16:A.O.truncate(3*C/2),this.vb.resize(g),this.We!=null)for(var O=0;Ob.Ja(O))){var N=this.vf(g,-1);this.kn(N,b.dc(O));for(var j=b.Ba(O),W=b.Vc(O);jg.Ja(b))return C;this.Il.Fd(g,g.Ba(b),g.Vc(b)),this.it=this.vb.ub(0);var O=this.vf(C,-1);this.kn(O,g.dc(b)||!0);var F=this.We!=null&&g.Ve!=null,N=g.Ba(b);for(b=g.Vc(b);N=b.size&&b.resize(Math.max(A.O.truncate(1.25*g),16),-1),b.write(g,C)},_.prototype.KF=function(g,b){return(g=this.JF(g))<(b=this.wk[b]).size?b.read(g):-1},_.prototype.aF=function(){this.wk==null&&(this.wk=[]);for(var g=0;gq:2>q)?(j=this.Zq(j),O=0ee){var he=ee;W!=null&&(he=0he){var Ee=he;if(W!=null&&(Ee=0O||F>this.fd-1)throw A.i.N("invalid call");if(O>F&&!this.dc(g))throw A.i.N("cannot iterate across an open path");for(g=0;b!=C;b=this.U(b))O=this.Ua(b),(F=this.Sh(O))!=null?g+=F.Qb():(F=this.Ua(this.U(b)),g+=this.vb.yr(O,F));return g},_.prototype.Dh=function(g,b){var C=this.Ua(g);this.vb.Ht(C,b),(C=this.Sh(C))!=null&&C.setStart(b),(g=this.Ma(g))!=-1&&(g=this.Ua(g),this.Sh(g)!=null&&C.setEnd(b))},_.prototype.Vi=function(g,b){g=this.Ua(g),this.vb.ve(g,b)},_.prototype.mf=function(g,b){this.Cb(g,b.x,b.y)},_.prototype.Cb=function(g,b,C){var O=this.Ua(g);this.vb.Cb(O,b,C),(O=this.Sh(O))!=null&&O.ZB(b,C),(g=this.Ma(g))!=-1&&(g=this.Ua(g),this.Sh(g)!=null&&O.Ql(b,C))},_.prototype.D=function(g,b){this.vb.D(this.td.T(g,0),b)},_.prototype.Gc=function(g,b){this.vb.za[0].tc(2*this.td.T(g,0),b)},_.prototype.Na=function(g){var b=new A.h;return this.vb.D(this.td.T(g,0),b),b},_.prototype.dG=function(g,b){this.it.tc(2*g,b)},_.prototype.Uc=function(g,b,C){return this.vb.Uc(g,this.Ua(b),C)},_.prototype.setAttribute=function(g,b,C,O){this.vb.setAttribute(g,this.Ua(b),C,O)},_.prototype.Ua=function(g){return this.td.T(g,0)},_.prototype.ih=function(){var g=new A.h;return this.D(void 0,g),g.y},_.prototype.fq=function(g,b){g=this.Ua(g),b=this.Ua(b);var C=this.vb.za[0].o;return C[2*g]===C[2*b]&&C[2*g+1]===C[2*b+1]},_.prototype.Dv=function(g,b){g=this.Ua(g);var C=this.vb.za[0].o;return C[2*g]===b.x&&C[2*g+1]===b.y},_.prototype.vX=function(g,b){if(1>b&&(b=1),this.Sg==null){if(b==1)return;this.Sg=A.Yc.Dn(this.vb.I(),1)}(g=this.Ua(g))>=this.Sg.size&&this.Sg.resize(g+1,1),this.Sg.write(g,b)},_.prototype.cG=function(g){return g=this.Ua(g),this.Sg==null||g>=this.Sg.size?1:this.Sg.read(g)},_.prototype.Ra=function(g,b,C){b=this.bi[b],g=this.Ua(g),b.sizeF?1:NW?1:0})},_.prototype.jS=function(){for(var g=this.ld;g!=-1;g=this.ue(g))if(!A.aa.Hc(this.ic(g)))return!0;return!1},_.prototype.hC=function(g,b){for(var C=this.Ob(g),O=this.Ob(b),F=this.kv(g),N=this.kv(b),j=this.Ob(g);j!=-1;j=this.Rb(j))this.gx(j,b);for(j=this.Ob(b);j!=-1;j=this.Rb(j))this.gx(j,g);this.Zo(g,O),this.Zo(b,C),this.$o(g,N),this.$o(b,F),C=this.I(g),O=this.da(g),F=this.da(b),this.Tj(g,this.I(b)),this.Tj(b,C),this.Rl(g,F),this.Rl(b,O),C=this.cd.T(g,2),this.cd.S(g,2,this.cd.T(b,2)),this.cd.S(b,2,C)},_}(),A.gd=ue})(ye||(ye={})),function(A){var ue=function(G){function E(_,g,b,C){var O=G.call(this)||this;return O.$=new A.l,_===void 0?O.UE():typeof _=="number"?O.VO(_,g,b,C):_ instanceof A.Sa?g!==void 0?O.Qu(_,g,b):O.WO(_):_ instanceof A.ra?g!==void 0?O.YO(_,g):O.XO(_):_ instanceof A.l?O.UO(_):O.UE(),O}return me(E,G),E.prototype.Qu=function(_,g,b){this.description=A.ee.og(),this.$.Oa(),_.B()||this.tu(_,g,b)},E.prototype.UO=function(_){this.description=A.ee.og(),this.$.K(_),this.$.normalize()},E.prototype.XO=function(_){if(_==null)throw A.i.N();this.description=_,this.$.Oa()},E.prototype.YO=function(_,g){if(_==null)throw A.i.N();this.description=_,this.$.K(g),this.$.normalize()},E.prototype.UE=function(){this.description=A.ee.og(),this.$.Oa()},E.prototype.WO=function(_){this.description=A.ee.og(),this.$.Oa(),_.B()||this.tu(_)},E.prototype.VO=function(_,g,b,C){this.description=A.ee.og(),this.K(_,g,b,C)},E.prototype.K=function(_,g,b,C){if(this.vc(),typeof _=="number")this.$.K(_,g,b,C);else for(this.Oa(),g=0,b=_.length;g=A.ra.Va(g))throw A.i.N();var C=this.description.Pf(g);return this.ou(),0<=C?this.ka[this.kR(this.description,_)+this.description.LR(C)-2+b]:A.ra.se(g)},E.prototype.ou=function(){if(this.vc(),this.ka==null&&2=A.ra.Va(g))throw A.i.ce();var C=this.description.Pf(g);return 0<=C?(this.ou(),this.ka[E.Gg(this.description,_)+this.description.$j(C)-2+b]):A.ra.se(g)},E.prototype.vD=function(_,g,b,C){if(this.vc(),g==0)_!=0?b!=0?this.$.H=C:this.$.C=C:b!=0?this.$.G=C:this.$.v=C;else{if(b>=A.ra.Va(g))throw A.i.ce();if(!this.hasAttribute(g)){if(A.ra.DG(g,C))return;this.re(g)}g=this.description.Pf(g),this.ou(),this.ka[E.Gg(this.description,_)+this.description.$j(g)-2+b]=C}},E.Gg=function(_,g){return g*(_.Ae.length-2)},E.prototype.Ea=function(_){this.vc();var g=new A.l;return _.A(g),this.$.Ea(g)},E.prototype.isIntersecting=function(_){return _ instanceof A.l?this.$.isIntersecting(_):this.$.isIntersecting(_.$)},E.prototype.Ju=function(_,g){this.vc(),_.B()?this.Oa():g!==void 0?this.tu(_,g):this.$.Ju(_.Lg(),_.ih())},E.prototype.offset=function(_,g){this.vc(),this.$.offset(_,g)},E.prototype.normalize=function(){this.vc(),this.$.normalize()},E.prototype.sf=function(_){if(_===void 0){if(_=new A.Sa(this.description),this.B())return _;for(g=this.description.Aa,b=1;bthis.C&&(this.C=b.x),b.ythis.H&&(this.H=b.y)}}else if(E==null||E.length==0)this.Oa();else for(b=E[0],this.K(b.x,b.y),g=1;gE?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_)):E instanceof A.h||E instanceof A.Nd?this.Zb(E.x,E.y):E instanceof G&&!E.B()&&(this.Zb(E.v,E.G),this.Zb(E.C,E.H))},G.prototype.Lk=function(E,_){this.v>E?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_)},G.prototype.W=function(E,_){this.B()||(this.v-=E,this.C+=E,this.G-=_,this.H+=_,(this.v>this.C||this.G>this.H)&&this.Oa())},G.prototype.scale=function(E){0>E&&this.Oa(),this.B()||(this.v*=E,this.C*=E,this.G*=E,this.H*=E)},G.prototype.zoom=function(E,_){this.B()||this.K(this.sf(),E*this.R(),_*this.ca())},G.prototype.isIntersecting=function(E){return!this.B()&&!E.B()&&(this.v<=E.v?this.C>=E.v:E.C>=this.v)&&(this.G<=E.G?this.H>=E.G:E.H>=this.G)},G.prototype.HG=function(E){return(this.v<=E.v?this.C>=E.v:E.C>=this.v)&&(this.G<=E.G?this.H>=E.G:E.H>=this.G)},G.prototype.Ea=function(E){return!this.B()&&!E.B()&&(E.v>this.v&&(this.v=E.v),E.Cthis.G&&(this.G=E.G),E.HE.length)throw A.i.N();E[0]!=null?E[0].ma(this.v,this.G):E[0]=A.h.construct(this.v,this.G),E[1]!=null?E[1].ma(this.v,this.H):E[1]=A.h.construct(this.v,this.H),E[2]!=null?E[2].ma(this.C,this.H):E[2]=A.h.construct(this.C,this.H),E[3]!=null?E[3].ma(this.C,this.G):E[3]=A.h.construct(this.C,this.G)},G.prototype.wF=function(){return this.B()?0:this.R()*this.ca()},G.prototype.yR=function(){return this.B()?0:2*(this.R()+this.ca())},G.prototype.gk=function(){return(this.C+this.v)/2},G.prototype.Jp=function(){return(this.H+this.G)/2},G.prototype.R=function(){return this.C-this.v},G.prototype.ca=function(){return this.H-this.G},G.prototype.move=function(E,_){this.B()||(this.v+=E,this.G+=_,this.C+=E,this.H+=_)},G.prototype.Ju=function(E,_){if(_!==void 0)this.move(E-this.gk(),_-this.Jp());else if(E instanceof A.h)this.Ju(E.x,E.y);else{if(!(E instanceof A.Sa))throw A.i.N();_=(this.C-this.v)/2;var g=(this.H-this.G)/2;this.v=E.Lg()-_,this.C=E.Lg()+_,this.G=E.ih()-g,this.H=E.ih()+g}},G.prototype.offset=function(E,_){this.v+=E,this.C+=E,this.G+=_,this.H+=_},G.prototype.normalize=function(){if(!this.B()){var E=Math.min(this.v,this.C),_=Math.max(this.v,this.C);this.v=E,this.C=_,E=Math.min(this.G,this.H),_=Math.max(this.G,this.H),this.G=E,this.H=_}},G.prototype.dn=function(E){E.ma(this.v,this.G)},G.prototype.$I=function(E){E.ma(this.C,this.G)},G.prototype.cJ=function(E){E.ma(this.v,this.H)},G.prototype.en=function(E){E.ma(this.C,this.H)},G.prototype.fT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},G.prototype.sf=function(){return A.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},G.prototype.mz=function(){return A.h.construct(this.v,this.G)},G.prototype.contains=function(E,_){if(_!==void 0)return E>=this.v&&E<=this.C&&_>=this.G&&_<=this.H;if(E instanceof A.Sa)return this.contains(E.Lg(),E.ih());if(E instanceof A.h)return this.contains(E.x,E.y);if(E instanceof G)return E.v>=this.v&&E.C<=this.C&&E.G>=this.G&&E.H<=this.H;throw A.i.N()},G.prototype.hm=function(E,_){if(_!==void 0)return E>this.v&&Ethis.G&&_this.v&&E.Cthis.G&&E.H>>32);var _=A.O.Th(E);return E=this.C,E=A.O.truncate(E^E>>>32),_=A.O.Th(E,_),E=this.G,E=A.O.truncate(E^E>>>32),_=A.O.Th(E,_),E=this.H,E=A.O.truncate(E^E>>>32),A.O.Th(E,_)},G.prototype.xr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},G.prototype.zy=function(E,_){var g=this.Zj(E),b=this.Zj(_);if(g&b)return 0;if(!(g|b))return 4;var C=(g!=0?1:0)|(b!=0?2:0);do{var O=_.x-E.x,F=_.y-E.y;if(O>F?g&G.YC?(g&G.ju?(E.y+=F*(this.v-E.x)/O,E.x=this.v):(E.y+=F*(this.C-E.x)/O,E.x=this.C),g=this.Zj(E)):b&G.YC?(b&G.ju?(_.y+=F*(this.v-_.x)/O,_.x=this.v):(_.y+=F*(this.C-_.x)/O,_.x=this.C),b=this.Zj(_)):g!=0?(g&G.ku?(E.x+=O*(this.G-E.y)/F,E.y=this.G):(E.x+=O*(this.H-E.y)/F,E.y=this.H),g=this.Zj(E)):(b&G.ku?(_.x+=O*(this.G-_.y)/F,_.y=this.G):(_.x+=O*(this.H-_.y)/F,_.y=this.H),b=this.Zj(_)):g&G.ZC?(g&G.ku?(E.x+=O*(this.G-E.y)/F,E.y=this.G):(E.x+=O*(this.H-E.y)/F,E.y=this.H),g=this.Zj(E)):b&G.ZC?(b&G.ku?(_.x+=O*(this.G-_.y)/F,_.y=this.G):(_.x+=O*(this.H-_.y)/F,_.y=this.H),b=this.Zj(_)):g!=0?(g&G.ju?(E.y+=F*(this.v-E.x)/O,E.x=this.v):(E.y+=F*(this.C-E.x)/O,E.x=this.C),g=this.Zj(E)):(b&G.ju?(_.y+=F*(this.v-_.x)/O,_.x=this.v):(_.y+=F*(this.C-_.x)/O,_.x=this.C),b=this.Zj(_)),(g&b)!=0)return 0}while(g|b);return C},G.prototype.Zj=function(E){return(E.xthis.C?1:0)<<1|(E.ythis.H?1:0)<<3},G.prototype.Bi=function(E){return!this.B()&&(this.R()<=E||this.ca()<=E)},G.prototype.tb=function(E){return E instanceof A.h?Math.sqrt(this.iK(E)):Math.sqrt(this.px(E))},G.prototype.px=function(E){var _=0,g=0,b=this.v-E.C;return b>_&&(_=b),(b=this.G-E.H)>g&&(g=b),(b=E.v-this.C)>_&&(_=b),(b=E.G-this.H)>g&&(g=b),_*_+g*g},G.prototype.iK=function(E){var _=0,g=0,b=this.v-E.x;return b>_&&(_=b),(b=this.G-E.y)>g&&(g=b),(b=E.x-this.C)>_&&(_=b),(b=E.y-this.H)>g&&(g=b),_*_+g*g},G.prototype.cn=function(E){this.B()?E.Oa():E.K(this.v,this.C)},G.ju=1,G.ku=4,G.YC=3,G.ZC=12,G}();A.l=ue}(ye||(ye={})),function(A){var ue,G;(G=ue||(ue={}))[G.initialize=0]="initialize",G[G.initializeRed=1]="initializeRed",G[G.initializeBlue=2]="initializeBlue",G[G.initializeRedBlue=3]="initializeRedBlue",G[G.sweep=4]="sweep",G[G.sweepBruteForce=5]="sweepBruteForce",G[G.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",G[G.sweepRedBlue=7]="sweepRedBlue",G[G.sweepRed=8]="sweepRed",G[G.sweepBlue=9]="sweepBlue",G[G.iterate=10]="iterate",G[G.iterateRed=11]="iterateRed",G[G.iterateBlue=12]="iterateBlue",G[G.iterateBruteForce=13]="iterateBruteForce",G[G.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",G[G.resetRed=15]="resetRed",G[G.resetBlue=16]="resetBlue";var E=function(){function _(g,b){this.ci=g,this.dH=b}return _.prototype.nr=function(g,b,C){this.ci.JX(C,g,b,this.dH)},_.prototype.$p=function(g){return this.ci.Rr(g,this.dH)},_}();ue=function(){function _(){this.ow=this.oo=this.ff=this.rd=null,this.wq=new A.l,this.Am=this.Hj=this.Ij=this.Ad=this.Ef=this.Ld=this.cw=this.fo=this.qd=this.Eb=null,this.Xb=-1,this.qa=0,this.Nk()}return _.prototype.kr=function(){this.Nk(),this.Pv=!0,this.Eb==null?(this.fo=new A.ia(0),this.Eb=[]):(this.fo.Bh(0),this.Eb.length=0)},_.prototype.ad=function(g,b){if(!this.Pv)throw A.i.Hb();var C=new A.l;C.K(b),this.fo.add(g),this.Eb.push(C)},_.prototype.Fp=function(){if(!this.Pv)throw A.i.Hb();this.Pv=!1,this.Eb!=null&&0this.Eb.length)return this.pe=this.Eb.length,this.Xb=5,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.rd.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.rd.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.ff==null&&(this.ff=new A.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new A.ia(0)),this.ff.kr();for(var g=0;gthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new A.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new A.ia(0)),this.ff==null&&(this.ff=new A.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new A.ia(0)),this.rd.kr();for(var g=0;g>1;return _.eq(g)?(this.rd.remove(b),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1)):(this.oo.EB(this.Eb[b].v,this.Eb[b].C,this.qa),this.Vf=b,this.Xb=10,!0)},_.prototype.QX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Rg=this.Vf=this.pe,this.Xb=13,!0)},_.prototype.RX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Vf=this.pe,this.Rg=this.qd.length,this.Xb=14,!0)},_.prototype.SX=function(){var g=this.Ld.get(this.pe-1),b=this.Ef.get(this.Rg-1),C=this.Rr(g,!0),O=this.Rr(b,!1);return C>O?this.ux():C>1;if(_.eq(g))return this.Df!=-1&&this.Ij.get(b)!=-1?(this.Ad.jd(this.Df,this.Ij.get(b)),this.Ij.set(b,-1)):this.rd.remove(b),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Cf!=-1&&0>1;if(_.eq(g))return this.Cf!=-1&&this.Hj.get(b)!=-1?(this.Ad.jd(this.Cf,this.Hj.get(b)),this.Hj.set(b,-1)):this.ff.remove(b),this.Rg!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Df!=-1&&0>1;return this.rd.vj(g),this.Xb=4,!0},_.prototype.jT=function(){if(this.Vf=this.oo.next(),this.Vf!=-1)return!1;this.Af=this.Vf=-1;var g=this.Ef.get(this.Rg)>>1;return this.ff.vj(g),this.Xb=7,!0},_.prototype.gT=function(){if(this.Af=this.ow.next(),this.Af!=-1)return!1;var g=this.Ld.get(this.pe)>>1;return this.rd.vj(g),this.Xb=7,!0},_.prototype.hT=function(){if(--this.Rg==-1)return this.Xb=5,!0;this.wq.K(this.Eb[this.pe]);var g=this.Eb[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(g)||(this.Af=this.Rg,!1)},_.prototype.iT=function(){if(--this.Rg==-1)return this.Xb=6,!0;this.wq.K(this.Eb[this.pe]);var g=this.qd[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(g)||(this.Af=this.Rg,!1)},_.prototype.kJ=function(){return this.rd==null?(this.Ic=!0,!1):(this.pe=this.Ld.size,0>1],_.eq(g)?b.G-C:b.H+C):(b=this.qd[g>>1],_.eq(g)?b.G-C:b.H+C)},_}(),A.xC=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.construct=function(E,_,g,b,C,O){var F=new G;return F.v=E,F.G=_,F.Ye=g,F.C=b,F.H=C,F.Bg=O,F},G.prototype.Oa=function(){this.Ye=this.v=NaN},G.prototype.B=function(){return isNaN(this.v)},G.prototype.XS=function(){return isNaN(this.Ye)},G.prototype.K=function(E,_,g,b,C,O){b!==void 0?typeof E=="number"?(this.v=E,this.G=_,this.Ye=g,this.C=b,this.H=C,this.Bg=O):(this.v=E.x-.5*_,this.C=this.v+_,this.G=E.y-.5*g,this.H=this.G+g,this.Ye=E.z-.5*b,this.Bg=this.Ye+b):(this.v=E,this.G=_,this.Ye=g,this.C=E,this.H=_,this.Bg=g)},G.prototype.move=function(E){this.v+=E.x,this.G+=E.y,this.Ye+=E.z,this.C+=E.x,this.H+=E.y,this.Bg+=E.z},G.prototype.copyTo=function(E){E.v=this.v,E.G=this.G,E.C=this.C,E.H=this.H},G.prototype.Lk=function(E,_,g){this.v>E?this.v=E:this.C_?this.G=_:this.H<_&&(this.H=_),isNaN(this.Ye)==0?this.Ye>g?this.Ye=g:this.BgE.length)throw A.i.N();E[0]=new A.Nd(this.v,this.G,this.Ye),E[1]=new A.Nd(this.v,this.H,this.Ye),E[2]=new A.Nd(this.C,this.H,this.Ye),E[3]=new A.Nd(this.C,this.G,this.Ye),E[4]=new A.Nd(this.v,this.G,this.Bg),E[5]=new A.Nd(this.v,this.H,this.Bg),E[6]=new A.Nd(this.C,this.H,this.Bg),E[7]=new A.Nd(this.C,this.G,this.Bg)},G.prototype.Zw=function(E){if(E==null||E.length==0)this.Oa();else{var _=E[0];for(this.K(_.x,_.y,_.z),_=1;_this.FA;){var N=this.sd.ha();if(C.L(N.ac()),O.L(N.wc()),C.scale(this.Wa.ec),O.scale(this.Wa.ec),A.cj.Mu(C,O)?C.x=O.x:A.cj.Ku(C,O)&&(O.x=C.x),this.uk.length=0,A.cj.tF(this.Wa.Tb,this.Wa.kc,this.Wa.ze,C,O,this.Wa.QA,this.Wa.Zs,F,this.Nj,this.Gs,this.uk,this.bw),this.co!=null&&(N=this.uk.slice(0),this.co.qG(this.co.da()-1,N,N.length-1)),A.cj.Lu(C,O)?(this.qq.Oa(),this.Wa.sy(C,this.sl,this.qq),this.Xn=!0):(this.qq.Oa(),this.Xn=this.xy(F[0],this.qq)),this.Xn){if(this.sd.li(),this.sd.Ez()){this.sd.li(),this.sd.ha();break}this.sd.DW();break}g==null&&(g=new A.Da).Yk(null,0),this.OD(g),b++}if(this.bw[0]=0,0=this.Nj[0]){var F=this.di+1.570796326794897;C=F+3.141592653589793-(this.di-this.Nj[0])}else C=(F=this.di+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Nj[0]-this.di));var N=!(this.di>=this.Nj[0]&&3.141592653589793>=this.di-this.Nj[0])&&!(this.diF;)W-=6.283185307179586;Wb.x-this.sk[0]?this.sk[0]-=6.283185307179586:3.141592653589793F?j.xX():j.$n=F,C=g.getType(),A.aa.yd(C)?((C=new A.Ta(g.description)).oc(g,!0),g=C,C=1607):C==197&&(C=new A.l,g.A(C),C.R()<=j.qa||C.ca()<=j.qa?((C=new A.Ta(g.description)).ad(g,!1),g=C,C=1607):((C=new A.Da(g.description)).ad(g,!1),g=C,C=1736)),j.yX(),A.aa.Rn(C)||j.zX(),j.rb<=.5*j.$n)return C!=1736?new A.Da(g.description):j.Wv?g:A.cj.Qr(g,j.Qg,j.ze,j.QA,-1,N);if(0>j.Ka&&C!=1736)return new A.Da(g.description);if(j.Wv&&A.aa.Hc(C)?(b=A.cj.Qr(g,b,4,NaN,j.$n,N),g=A.cb.zh(b,j.Qg,j.Jc)):g=A.cb.zh(g,j.Qg,j.Jc),(g=A.Hh.lj(g,j.Jc)).B())return new A.Da(g.description);switch(!j.Wv&&A.aa.Hc(C)&&(g=A.cj.pI(j.ec,g)),g=_.KX(g,j.Jc),C){case 1736:b=j.UN(g);break;case 1607:b=j.VN(g);break;case 550:b=j.SN(g);break;case 33:b=j.TN(g);break;default:throw A.i.fa("corrupted_geometry")}return(j=A.cb.zh(b,j.Jc,j.Qg)).Jl(g.description),j},_.prototype.UN=function(g){var b=new A.Da;g=new G(this,g,b),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),g=A.ip.nj(g,this.Jc,2);var C=new A.Dd;return C.scale(1/this.ec,1/this.ec),b.Oc(C),b=A.ip.nj(b,this.Jc,2),0<=this.Ka?A.Gh.local().V(b,g,this.Jc,this.Ub):A.kp.local().V(b,g,this.Jc,this.Ub)},_.prototype.VN=function(g){return g=new G(this,g,null),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),A.ip.nj(g,this.Jc,2)},_.prototype.SN=function(g){return g=new ue(this,g),g=A.Gh.local().V(g,this.Jc,this.Ub).next(),A.ip.nj(g,this.Jc,2)},_.prototype.TN=function(g){(g=g.D()).scale(this.ec);var b=new A.Da;return this.sy(g,!1,b),A.ip.nj(b,this.Jc,2)},_.prototype.xy=function(g,b,C,O,F,N){var j=g[0],W=g[g.length-1],q=j.y>W.y?j.y:W.y,J=A.F.q(this.Tb,this.kc,j.yg.Ke()&&(this.UV(g),!0)},_.prototype.OI=function(g,b,C){var O=C.I(),F=0N.x?(N=this.zq,O.gg(-this.Js,0)):(N=-this.zq,O.gg(this.Js,0)),b.add(g,!1),g.Oa(),C.add(b,!1),C.Oc(O),F=new A.l,C.A(F),F.W((this.Js-F.R())/2,0),F.G=-this.zq,F.H=this.zq;for(var W=0;W=j));)A.kb.yi(g,b,F.x,F.y,O,Xt,De,pt),q?Ye.ma(De.u,pt.u):(Et.ma(De.u,pt.u),_.gJ(F.x,Et.x,jt.x,J),Ye.ma(J[0]+Et.x,Et.y),jt.L(Ye)),Ye.scale(C),ee.wf(0,-1,Ye),N=Xt,Xt=ei++*W}},_.dJ=function(g,b,C,O,F,N,j,W,q,J){var ee=new A.h,he=new A.h,Ee=new A.ga(0),De=new A.ga(0);for(A.kb.yi(g,b,O.x,O.y,C,F,Ee,De),ee.ma(Ee.u,De.u),A.kb.yi(g,b,O.x,O.y,C,N,Ee,De),he.ma(Ee.u,De.u),C=new A.ga(0),A.kb.Xy(g,b,j.x,j.y,ee.x,ee.y,C),q[0]=C.u,A.kb.Xy(g,b,j.x,j.y,he.x,he.y,C),J[0]=C.u;q[0]<=J[0];)q[0]+=6.283185307179586;for(;q[0]>J[0];)q[0]-=6.283185307179586;for(;q[0]>=W;)q[0]-=6.283185307179586,J[0]-=6.283185307179586;for(;q[0]N[ee]?1:0}),b=g.Ia(),W=0;Wthis.rb/g&&(g=this.rb/500),.01>g&&(g=.01),this.$n=g},_}();A.VK=E}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.Mf=function(E,_){var g=new A.h;g.L(_),E.push(g)},G.up=function(E,_){E.add(_.x),E.add(_.y)},G.hB=function(E){E.Bh(E.size-2)},G.oB=function(E,_){_.ma(E.get(E.size-2),E.get(E.size-1))},G.Qr=function(E,_,g,b,C,O){if(E==null)throw A.i.N();var F=E.getType();if(E.B()||A.aa.Rn(F))return E;var N=new G;N.Qg=_,N.Jc=A.cb.sc(_);var j=A.cb.vv(N.Jc);if(N.Ub=O,N.Tb=A.cb.ev(N.Jc),N.kc=j*(2-j),N.ec=N.Jc.Hd().ai,N.Aq=N.Jc.Kn(),N.Zs=N.Aq*N.ec,N.AA=b,N.zA=C,N.ze=g,F==197?(g=new A.Da(E.description)).ad(E,!1):A.aa.yd(F)?(g=new A.Ta(E.description)).oc(E,!0):g=E,N.ze!=4){if((_=N.Qg.Nb(N.Jc)==0?A.cb.zh(g,N.Qg,N.Jc):A.Hh.lj(g,N.Jc)).B())return _;_=G.pI(N.ec,_),_=N.Zy(_),_=A.ip.nj(_,N.Jc,N.ze),N=A.cb.zh(_,N.Jc,N.Qg)}else{if(A.Eg.Sb(_)==2?(E=A.cb.ml(),(_=A.Xj.local().V(g,E,_,O))==E&&(_=new A.Da,E.copyTo(_))):_=A.Hh.lj(g,N.Jc),_.B())return _;N=N.CX(_)}return N},G.pI=function(E,_){var g=new A.l;if(_.xc(g),3.141592653589793>g.R()*E)return _;var b=!1;g=_.Ga();for(var C=new A.h,O=new A.h;g.$a();)for(;g.Ha();){var F=g.ha();if(C.L(F.ac()),O.L(F.wc()),C.scale(E),O.scale(E),3.141592653589793O.x-C.x)for(;-6.283185307179586>O.x-C.x;)O.x+=6.283185307179586;G.Wi(O.x,NaN,De),J.L(O)}else W.L(O),G.AU(W),G.Wi(W.x,Ee,De),J.ma(De[0]+W.x,W.y);.5>Math.abs(J.x-O.x)&&J.L(O),j?(F.Tw(0,he),ee.L(q),ee.scale(1/E),he.Cb(ee),(N=g.vm())?b.nf(he):b.lineTo(he),g.Qn()&&!_.dc(g.gb)&&(F.Tw(1,he),ee.L(J),ee.scale(1/E),he.Cb(ee),b.lineTo(he))):((N=g.vm())&&b.Hz(null,0),F=b.da()-1,ee.L(q),ee.scale(1/E),b.wf(F,-1,ee),g.Qn()&&!_.dc(g.gb)&&(ee.L(J),ee.scale(1/E),b.wf(F,-1,ee)))}return b},G.tF=function(E,_,g,b,C,O,F,N,j,W,q,J){var ee=new A.h,he=new A.h,Ee=0Et&&(Et+=6.283185307179586),0>(De=De.u)&&(De+=6.283185307179586),j!=null&&(j[0]=pt),W!=null&&(W[0]=Et),q!=null&&(q[0]=De),W=j=NaN,J!=null&&(j=((W=A.F.Ah(E,_))-(q=A.F.q(E,_,b.y)))/pt,W=(W+q)/pt),q=G.Mu(b,C),De=G.Ku(b,C),Et=q||De;var Ye=G.FE(b,C,N),jt=new A.ga(0),ei=new A.ga(0),Xt=new A.h,wi=new A.h,pi=new A.h;G.Wi(b.x,NaN,he);var Ri=[he[0]];if(pt<=O)G.Mf(ee,b),G.Wi(C.x,NaN,he),J?.add(0),Et?(q&&G.kB(b,C,J,ee),De&&G.iB(b,C,J,ee)):Ye?G.jB(b,C,Ee,j,W,J,ee):0pi.x&&(he[0]+=6.283185307179586,pi.ma(he[0]+Xt.x,Xt.y)):Bi.xF.x?F.x+=6.283185307179586:3.141592653589793z;z++)if(Bi=Ui[z]*W+(1-Ui[z])*j,A.kb.oj(E,_,b.x,b.y,Bi*C,O,pt,Et,g),Xt.ma(pt.u,Et.u),z==0&&(ar=Bi,wi.L(Xt)),G.WW(jt,Xt,ei,Ri),Ri.hc(Ri.fe(Xt,!0),pi),A.kb.wd(E,_,Xt.x,Xt.y,pi.x,pi.y,Ye,null,null,2),Ye.u>q){mi=!0;break}mi?(ei.L(wi),W=ar,G.up(F,ei),N.add(W)):(G.hB(F),N.En(N.size-1,1,N.size-1),0=F&&Mn.u<=O&&3.141592653589793>Math.abs(Ee.x-De.x)||b.Ux(mi,ar)<=C));Ri++){var ai=ds[Ri]*ar+(1-ds[Ri])*mi;if(b.hc(ai,J),pi?pt.ma(J.x*g,J.y*g):(wi[0][0]=J.x,wi[0][1]=J.y,A.cb.vt(),pt.x=wi[0][0]*g,pt.y=wi[0][1]*g),Ri==0&&(ko=ai,he.L(J),Ye.L(pt),0O||3.141592653589793<=Math.abs(Ee.x-De.x)))){qn=!0;break}if(z&&0O||3.141592653589793<=Math.abs(Ee.x-pt.x)){qn=!0;break}}else if(0F){qn=!0;break}if(z){if(A.kb.wd(E,_,Xt.x,Xt.y,Et.x,Et.y,Cn,null,null,2),Cn.u>F){qn=!0;break}if(A.kb.wd(E,_,Et.x,Et.y,pt.x,pt.y,bs,null,null,2),bs.u>F){qn=!0;break}}}}qn?(q.L(he),De.L(Ye),ar=ko,G.up(Ui,q),G.up(Wi,De),Fr.add(ar)):(G.hB(Ui),G.hB(Wi),Fr.En(Fr.size-1,1,Fr.size-1),G.Mf(j,q),Bi+=Mn.u,N?.add(Bi),0Math.abs(_.x-E.x)?(b.Dc(E),3.141592653589793<=g.x-E.x?b.Ql(g.x-6.283185307179586,g.y):3.141592653589793<=E.x-g.x?b.Ql(g.x+6.283185307179586,g.y):b.Ql(g.x,g.y)):(b.Dc(g),3.141592653589793<=E.x-g.x?b.Ql(E.x-6.283185307179586,E.y):3.141592653589793<=g.x-E.x?b.Ql(E.x+6.283185307179586,E.y):b.Ql(E.x,E.y))},G.YJ=function(E,_){for(var g=0;gE.x)for(;-3.141592653589793>E.x;)E.x+=6.283185307179586;if(3.141592653589793G.v+b&&OG?-G:G},ue.Mb=function(G,E){return 0<=E?ue.P(G):-ue.P(G)},ue.Y=function(G,E){return G==E||ue.P(G-E)<=ue.JC*(1+(ue.P(G)+ue.P(E))/2)},ue.Cd=function(G){return G==0||ue.P(G)<=ue.JC},ue.Ah=function(G,E){var _=(E=(1-(E=Math.sqrt(1-E)))/(1+E))*E;return G/(1+E)*(1+_*(.25+_*(.015625+1/256*_)))*ue.EL},ue.EL=1.5707963267948966,ue.JC=3552713678800501e-30,ue}()}(ye||(ye={})),function(A){var ue=function(E){this.Wf=E,this.Kk=this.Wf.getCode(),0>this.Kk&&(this.Kk=0)};A.DY=ue;var G=function(){function E(_){_===void 0&&(_=null),this.Cj=null,this.Un=!1,_!==null&&(this.Cj=new ue(_))}return E.prototype.Ec=function(){return this.Cj!=null?this.Cj.Kk:0},E.prototype.Of=function(){var _=new E;return this.copyTo(_),_},E.prototype.copyTo=function(_){_.Cj=this.Cj,_.Un=this.Un},E.prototype.Qz=function(){this.Un=!this.Un},E.prototype.qm=function(){return this.Cj!=null?this.Cj.Wf:null},E.prototype.LJ=function(_){if(0>=_)throw A.i.N();if(_!=this.Ec()){if((_=A.pf.geogtran(_))==null)throw A.i.N("Geogtran not found.");this.Cj=new ue(_)}},E.prototype.Bz=function(){return this.Cj==null?null:this.Cj.Wf.toString()},E.prototype.tX=function(_){if(_==null)throw A.i.N();var g=null;try{g=A.pf.fromString(A.Sc.PE_TYPE_GEOGTRAN,_)}catch{throw A.i.N()}this.Cj=new ue(g)},E.prototype.Nb=function(_){return _==this||!(!(_ instanceof E)||(0>=this.Ec()||this.Ec()!=_.Ec())&&!this.qm().isEqual(_.qm()))&&this.Un==_.Un},E.prototype.toString=function(){var _="GeographicTransformation: "+this.Bz();return 200<_.length?_.substring(0,197)+"... ("+_.length.toString()+" characters)":_},E.create=function(_,g){var b=new E;return b.LJ(_),g&&b.Qz(),b},E.uP=function(_,g){var b=new E;return b.tX(_),g&&b.Qz(),b},E}();A.Dx=G}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.construct=function(_,g,b,C){var O=new E;return O.hw=_,O.iw=g,O.QY=b,O.RY=C,O},E.Ey=function(_,g){return _.hw==g.hw?_.iw==g.iw?0:_.iwE.I())},G.BE=function(E){return!(E.B()||E.getType()!=1607&&E.getType()!=1736||20>E.I())},G}();A.Uk=ue}(ye||(ye={})),function(A){A.$b=function(){function ue(){}return ue.TT=function(G){var E=new A.Da;return E.sx(G.es(),G.gs()),E.yj(G.es(),G.fs()),E.yj(G.ds(),G.fs()),E.yj(G.ds(),G.gs()),E},ue.zh=function(G,E){return G===null?null:A.Hx.local().V(G,E,null)},ue.jY=function(G,E){var _=A.Gh.local();return G=new A.Zc(G),_.V(G,E,null).next()},ue.im=function(G,E,_){return A.kp.local().V(G,E,_,null)},ue.ep=function(G,E,_){return A.Kx.local().V(G,E,_,null)},ue.VX=function(G,E,_){var g=A.Kx.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.Nb=function(G,E,_){return A.dj.local().V(3,G,E,_,null)},ue.TP=function(G,E,_){return A.dj.local().V(4,G,E,_,null)},ue.RS=function(G,E,_){var g=A.Xj.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.QP=function(G,E,_){var g=A.kp.local();for(G=new A.Zc(G),E=new A.Zc(E),_=g.V(G,E,_,null),g=[];(E=_.next())!=null;)g.push(E);return g},ue.Ea=function(G,E,_){return A.Xj.local().V(G,E,_,null)},ue.QS=function(G,E,_){if((G=A.Xj.local().V(G,E,_,null,1))===null)return[];if(G.getType()===550){for(E=[],_=0;_G.Db())return 0;var g=null;if(E!=null){if(g=E.Hd(),_!=null&&g.Ec()!=_.Ec()&&g.od!=_.od)throw A.i.Xk()}else if(_!=null)throw A.i.N();G.getType()==1736||G.getType()==197?E=G.mg():A.aa.yd(G.getType())?(E=new A.Ta(G.description)).oc(G,!0):E=G,G=0,E=E.Ga();for(var b=new A.h,C=new A.h;E.$a();)for(;E.Ha();){var O=E.ha();O.Yp(b),O.Tr(C),G+=A.h.tb(b,C)}return g!==null&&_!==null&&(G=A.Tc.Nh(G,g,_)),G},ue.fP=function(G){return G.points!==void 0?ue.mS(G,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM):G.rings!==void 0?ue.lG(G.rings,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM,"P"):G.paths!==void 0?ue.lG(G.paths,G.hasZ!==void 0&&G.hasZ,G.hasM!==void 0&&G.hasM,"L"):G.x!==void 0?ue.nS(G):G.xmin!==void 0?ue.lS(G):null},ue.nS=function(G){if(G.x==null||G.x=="NaN")return new A.Sa;var E=new A.Sa(G.x,G.y);return G.z!==void 0&&G.z!==null&&E.wX(G.z),G.m!==void 0&&G.m!==null&&E.hX(G.m),E},ue.lS=function(G){if(G.xmin==null||G.xmin=="NaN")return new A.Fh;var E=new A.Fh(G.xmin,G.ymin,G.xmax,G.ymax);return G.zmin!==void 0&&G.zmin!==null&&E.setInterval(1,0,G.zmin,G.zmax),G.mmin!==void 0&&G.mmin!==null&&E.setInterval(2,0,G.mmin,G.mmax),E},ue.mS=function(G,E,_){var g=0,b=new A.de,C=3*G.points.length;C%2!=0&&C++,2>C&&(C=2);var O=A.O.truncate(3*G.points.length/2);4>O?O=4:16>O&&(O=16),C=A.Yc.Dn(C,0);var F=A.Yc.Dn(O);O=A.Yc.Dn(O);for(var N=0;N=C?(J[ee]=!1,W+=1,F.add(j),N.add(b),j+=he):J[ee]=!0}for((g=3*j)%2!=0&&g++,2>g&&(g=2),4>(ee=A.O.truncate(3*j/2))?ee=4:16>ee&&(ee=16),g=A.Yc.Dn(g,0),b=A.Yc.Dn(ee),C=A.Yc.Dn(ee),ee=he=0;eeF)throw A.i.N();this.Qi.oa=O-N,this.Qi.va=F+N,this.hi.resize(0),this.he=0,this.sg[0]=0},C.prototype.Uo=function(O,F){this.Qi.oa=O-F,this.Qi.va=O+F,this.hi.resize(0),this.he=0,this.sg[0]=0},C.prototype.next=function(){if(!this.Ya.lq)throw A.i.Hb();if(0>this.he)return-1;for(var O=!0;O;)switch(this.sg[this.he]){case 1:O=this.FU();break;case 2:O=this.GU();break;case 3:O=this.HU();break;case 4:O=this.IU();break;case 5:O=this.GW();break;case 6:O=this.kT();break;case 7:O=this.tN();break;case 0:O=this.Gz();break;default:throw A.i.Qa()}return this.Og!=-1?this.Mp()>>1:-1},C.construct=function(O){var F=new C;return F.Ya=O,F.hi.Jb(20),F.he=-1,F},C.prototype.Gz=function(){return this.Og=this.vH=this.Mi=this.Lc=-1,this.Ya.me!=null&&0=this.Qi.oa?(this.ei=this.QR(),!1):(this.he--,!0)},C.prototype.tN=function(){return this.Og=this.ei,this.Og!=-1&&b.gq(this.Mp())?(this.ei=this.SF(),!1):(this.he--,!0)},C.prototype.SF=function(){return this.Ya.Sf?this.Ya.$f.lb(this.Og):this.Ya.Ti.lb(this.Og)},C.prototype.QR=function(){return this.Ya.Sf?this.Ya.$f.we(this.Og):this.Ya.Ti.we(this.Og)},C.prototype.Mp=function(){return this.Ya.Sf?this.Ya.$f.ja(this.Og):this.Ya.Ti.getData(this.Og)},C}();A.EY=g;var b=function(){function C(O){this.Am=this.$h=this.$f=this.Ti=this.Km=this.Ej=this.me=this.Fj=null,this.Sf=O,this.lq=this.Sv=!1}return C.prototype.kr=function(){this.Nk(!0)},C.prototype.Br=function(O,F){if(!this.Sv)throw A.i.Hb();this.Fj.push(new A.Nc(O,F))},C.prototype.Fp=function(){if(!this.Sv)throw A.i.fa("invalid call");this.Sv=!1,this.lq=!0,this.Sf||(this.vS(),this.Zv=this.Fj.length)},C.prototype.vj=function(O){if(!this.Sf||!this.lq)throw A.i.N("invalid call");if(this.kf==-1){var F=this.Fj.length;if(this.iA){var N=new A.ia(0);N.Jb(2*F),this.bJ(N),this.$h.Jb(2*F),this.$h.resize(0),this.aJ(N),this.Km.resize(F,-1),this.Km.Wj(-1,0,F),this.iA=!1}else this.Km.Wj(-1,0,F);this.kf=this.Tu()}F=this.pG(O<<1,this.kf),N=this.$f.addElement(1+(O<<1),this.xz(F)),this.VJ(F,N),this.Km.set(O,F),this.Zv++},C.prototype.remove=function(O){if(!this.Sf||!this.lq)throw A.i.fa("invalid call");var F=this.Km.get(O);if(F==-1)throw A.i.N("the interval does not exist in the interval tree");this.Km.set(O,-1),this.Zv--;var N=this.xz(F),j=this.$f.ZR(N);this.$f.vd(this.wR(F),N),this.$f.vd(this.TR(F),N),(O=this.$f.size(N))==0&&(this.$f.MP(N),this.ZJ(j,-1)),this.Ej.jd(F),N=this.UF(j);var W=this.qj(j),q=this.lk(j);for(F=0;!(0>1);W!=-1?this.VJ(W,this.Ti.addElement(this.xz(W),j)):(W=this.pG(j,this.kf),N.set(j>>1,W))}},C.prototype.pG=function(O,F){var N=F,j=F,W=-1,q=0,J=this.$h.size-1,ee=0,he=O>>1,Ee=NaN,De=NaN,pt=!0,Et=this.DR(he);for(he=this.AR(he);pt;){qYe&&(YeYe)F!=-1&&(F==N?(j=N,Ee=Ye,De=(F=this.lk(N))!=-1?this.Np(F):NaN):De>1];return C.gq(O)?F.oa:F.va},C}();A.sr=b}(ye||(ye={})),function(A){var ue=function(){function G(E){if(E==null)throw A.i.fa("Invalid arguement");this.hf=E;var _=E.nR();_.hS()?E.ef.IG()?this.lo=A.si.PannableFold:this.lo=A.si.Clip:this.lo=A.si.DontClip,_.iS()?E.Yf.IG()?this.Qm=A.si.PannableFold:this.Qm=A.si.Clip:this.Qm=A.si.DontClip,this.Bm=_.Jr,this.mH=_.Vu,E=this.hf.sH,this.aH=E.hs(2147483648),this.Uv=E.hs(1073741824)}return G.zh=function(E,_,g){return _.ww.zh(E,g)},G.Rt=function(E,_,g,b){return E.ww.Rt(_,g,b)},G.Qt=function(E,_,g,b){if(g=0>g?_.length:g,(E=E.ww.Rt(_,g,b))==g)return E;for(var C=_=0;CC.H){var he=A.l.construct(N.v-1,C.G,N.C+1,C.H);if((ee=A.ri.Nu(ee,he,g,NaN,0,_)).B())return ee}N.R()>2*C.R()&&(ee=A.zb.Hp(ee,-2*C.R(),2*C.R(),g,!0,0,!0,_))}N=this.mH,(C=!isNaN(N))&&(ee=A.Xl.local().V(ee,N,_)),he=W?b.kk():null;var Ee=NaN;j&&(Ee=g.zi());var De=b.Wr()!=null;if(this.aH)j&&(A.zb.ur(g,Ee,ee,F),C&&(j=g.hh(),N*=(Ee=g.sc().hh())/j)),A.zb.tr(this.hf,ee,J,F),C&&(j=g.sc().hh(),N*=(Ee=b.sc().hh())/j),g=ee;else{var pt=new A.Ta(ee.description);pt.DD(ee),j&&(A.zb.ur(g,Ee,pt,F),C&&(j=g.hh(),N*=(Ee=g.sc().hh())/j)),A.zb.tr(this.hf,pt,J,F),C&&(j=g.sc().pm(),N*=(Ee=b.sc().pm())/j),J=NaN,W?(he=b.kk(),J=b.zi()):isNaN(this.Bm)||(J=this.Bm),j=G.tv(g)|G.tv(b),Ee=10*q.Xd(0),this.Uv&&(j=3,Ee=0),g=A.zb.UQ(ee,g,pt,q,J,_,j,Ee)}return De&&(g=A.zb.XD(g,b,_)),W&&(O||(W=q.Oe().R(),g.Tg(0,0).R()>=W-q.Xd(0)&&(q=he.getNorthPoleLocation(),W=he.getSouthPoleLocation(),ee=he.getNorthPoleGeometry(),he=he.getSouthPoleGeometry(),J=0,ee==A.Cg.PE_POLE_POINT&&q!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(J=1),he==A.Cg.PE_POLE_POINT&&W!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(J|=2),J!==0&&(O=!0))),g=A.zb.Mz(g,b,this.Qm,_),C&&(g=A.Xl.local().V(g,N,_)),A.zb.Lx(b,g,F)),g.B()||(O&&(g=A.Yl.local().V(g,b,!1,_)),E!=null&&(g=E.Zk(g,!1),this.wp(E,A.bm.reverse,g),g=E.$k(g,!1))),g},G.tv=function(E){if(E.Sb()!=2)return 0;var _=0,g=E.kk();E=g.getNorthPoleLocation();var b=g.getSouthPoleLocation(),C=g.getNorthPoleGeometry();return g=g.getSouthPoleGeometry(),C==A.Cg.PE_POLE_POINT&&E!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(_=1),g==A.Cg.PE_POLE_POINT&&b!=A.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(_|=2),_},G.prototype.hW=function(E,_){var g=this.hf.ef,b=this.hf.Yf,C=g.Sb(),O=b.Sb(),F=A.O.Fu(Math.min(E.I(),64)),N=A.Ta.jg(E);C==3&&(C=(g=(E=g.Ji).fk()).Sb(),N=E.$k(N,!0),this.wp(E,A.bm.forward,N),N=E.Zk(N,!0)),E=null,O==3&&(O=(b=(E=b.Ji).fk()).Sb());var j=C==2;C=(O=O==2)?b.sc():b;var W=!O&&!this.Uv;if(j){if((N=A.zb.UI(N,g,this.lo,_)).B())return N}else{var q=new A.l;N.xc(q);var J=g.Oe();if((q.GJ.H)&&(q=A.l.construct(q.v-1,J.G,q.C+1,J.H),(N=A.ri.Nu(N,q,g,NaN,0,_)).B()))return N}var ee=NaN;j&&(ee=g.zi()),q=b.Wr()!=null,J=this.mH;var he=!isNaN(J);if(he&&(N=A.Xl.local().V(N,J,_)),this.aH)j&&A.zb.ur(g,ee,N,F),he&&(j=g.hh(),J*=(ee=g.sc().hh())/j),A.zb.tr(this.hf,N,W,F),he&&(j=g.sc().hh(),J*=(ee=b.sc().hh())/j),g=N;else{var Ee=new A.Ta(N.description);Ee.DD(N),j&&(A.zb.ur(g,ee,Ee,F),he&&(j=g.hh(),J*=(ee=g.sc().hh())/j)),A.zb.tr(this.hf,Ee,W,F),he&&(j=g.sc().hh(),J*=(ee=b.sc().hh())/j),W=NaN,O?W=b.zi():isNaN(this.Bm)||(W=this.Bm),j=G.tv(g)|G.tv(b),ee=10*C.Xd(0),this.Uv&&(j=3,ee=0),g=A.zb.VQ(N,g,Ee,C,W,_,j,ee)}return q&&(g=A.zb.XD(g,b,_)),O&&(g=A.zb.Mz(g,b,this.Qm,_),he&&(g=A.Xl.local().V(g,J,_)),A.zb.Lx(b,g,F)),g.B()||E!=null&&(g=E.Zk(g,!1),this.wp(E,A.bm.reverse,g),g=E.$k(g,!1)),g},G.prototype.eW=function(E,_){var g=(E.ca()+E.R())/400;return g!=0?(g=A.Xl.local().V(E,g,_),g=this.VI(g,_),_=E.Ia(),g.bn(_)):(_=new A.Sa(E.Ip()),g=this.XI(_),_=E.Ia(),g.B()?_.Oa():(E.copyTo(_),E=g.D(),_.K(E.x,E.y,E.x,E.y))),_},G.prototype.fW=function(E,_){E=A.aa.jg(E);var g=this.hf.ef,b=this.hf.Yf,C=g.Sb(),O=b.Sb(),F=A.O.Fu(Math.min(E.I(),64));if(C==3){var N=g.Ji;C=(g=N.fk()).Sb(),E=N.Zk(E,!0),this.wp(N,A.bm.forward,E),E=N.$k(E,!0)}if(C==2){if(this.lo==A.si.Clip?E=A.Xj.local().V(E,g.ml(),g,_):g.Wc()&&(C=new A.l,E.xc(C),g.Oe().contains(C)||(this.lo==A.si.PannableFold&&(E=A.zb.lj(E,g)),A.zb.Jt(E,g.Oe(),g.Xd(0),!0),E=A.zb.Fn(E,g,0,!0,0,_))),E.B())return E;A.zb.ur(g,0,E,F)}else A.zb.Jt(E,g.Oe(),g.Xd(0),!0);return A.zb.tr(this.hf,E,!1,F),g=0,C=!1,N=null,O==3&&(C=!0,O=(b=(N=b.Ji).fk()).Sb()),(O=O==2)?g=b.zi():isNaN(this.Bm)||(g=this.Bm),O&&this.Qm!=A.si.Clip||(E=A.zb.Fn(E,b.sc(),g,!1,0,_)),O&&(E=A.zb.Mz(E,b,this.Qm,_),A.zb.Lx(b,E,F),E.B())||C&&(E=N.Zk(E,!0),this.wp(N,A.bm.reverse,E),E=N.$k(E,!0)),E},G.prototype.wp=function(E,_,g){var b=g.I();if(b!=0){for(var C=g.ub(0),O=A.O.lg(200,0),F=[],N=0;NC.v+O&&N_?this.wv(g,b):this.gv(g,b);case 1:var C=this.wv(g,b);return g=this.gv(g,b),A.lc.hq(C,g,_);case 2:throw A.i.fa("not implemented")}throw A.i.Qa()},E.prototype.fe=function(_,g){var b=this.pa-this.sa,C=this.la-this.na,O=b*b+C*C;return O==0?.5:(_=((_.x-this.sa)*b+(_.y-this.na)*C)/O,g||(0>_?_=0:1<_&&(_=1)),_)},E.prototype.cq=function(_,g,b,C){if(_){if((_=this.la-this.na)==0)return g==this.la?-1:0;if(0>(g=(g-this.na)/_)||1(g=(g-this.sa)/_)||1(g=8881784197001252e-31*(Math.abs(b.x*g.y)+Math.abs(b.y*g.x)))?-1:_<-g?1:0},E.prototype.rp=function(_,g,b,C){var O=this.sa,F=this.na,N=_-O,j=g-F;if((N=Math.sqrt(N*N+j*j))<=Math.max(b,6661338147750939e-31*N))return C&&N==0?NaN:0;if(N=_-this.pa,j=g-this.la,(N=Math.sqrt(N*N+j*j))<=Math.max(b,6661338147750939e-31*N))return C&&N==0?NaN:1;if(N=this.pa-this.sa,j=this.la-this.na,0<(C=Math.sqrt(N*N+j*j))){var W=1/C,q=_-O,J=g-F,ee=q*(N*=W)+J*(j*=W),he=17763568394002505e-31*(Math.abs(q*N)+Math.abs(J*j)),Ee=N;if(N=-j,j=Ee,ee<-(he=Math.max(b,he))||ee>C+he)return NaN;if(Math.abs(q*N+J*j)<=Math.max(b,17763568394002505e-31*(Math.abs(q*N)+Math.abs(J*j)))&&(.5>=(N=A.O.Rk(ee*W,0,1))?(j=this.sa+(this.pa-this.sa)*N,C=this.na+(this.la-this.na)*N):(j=this.pa-(this.pa-this.sa)*(1-N),C=this.la-(this.la-this.na)*(1-N)),A.h.Oy(j,C,_,g)<=b)){if(.5>N){if(A.h.Oy(j,C,O,F)<=b)return 0}else if(A.h.Oy(j,C,this.pa,this.la)<=b)return 1;return N}}return NaN},E.prototype.Nb=function(_){return _!=null&&(_==this||_.constructor===this.constructor&&this.FM(_))},E.prototype.rD=function(_,g,b){var C=b?this.sa:this.pa;b=b?this.na:this.la;var O=new A.h;return O.x=_.pa-C,O.y=_.la-b,!(g.Qh(O)>6661338147750939e-31*g.fD(O))||(O.x=_.sa-C,O.y=_.na-b,g.Qh(O)<=6661338147750939e-31*g.fD(O))},E.prototype.qD=function(_){var g=new A.h;return g.x=this.pa-this.sa,g.y=this.la-this.na,!!this.rD(_,g,!1)&&(g.Sq(),!!this.rD(_,g,!0))},E.NM=function(_,g){var b=_.uu(g.sa,g.na),C=_.uu(g.pa,g.la);return!(0>b&&0>C||0b&&0>C||0(C=g.Qb())?_.qD(g):g.qD(_)))},E.LM=function(_,g,b){var C=A.h.construct(NaN,NaN),O=_.pa-_.sa,F=_.la-_.na,N=g.pa-g.sa,j=g.la-g.na,W=N*F-O*j;if(W==0)return C;var q=8881784197001252e-31*(Math.abs(N*F)+Math.abs(O*j)),J=g.sa-_.sa,ee=g.na-_.na,he=N*ee-J*j,Ee=he/W,De=Math.abs(W);return Ee<-(N=(8881784197001252e-31*(Math.abs(N*ee)+Math.abs(J*j))*De+q*Math.abs(he))/(W*W)+2220446049250313e-31*Math.abs(Ee))||Ee>1+N||(N=(j=O*ee-J*F)/W)<-(O=(8881784197001252e-31*(Math.abs(O*ee)+Math.abs(J*F))*De+q*Math.abs(j))/(W*W)+2220446049250313e-31*Math.abs(N))||N>1+O||(Ee=A.O.Rk(Ee,0,1),O=A.O.Rk(N,0,1),F=_.hc(Ee),W=g.hc(O),(q=new A.h).uc(F,W),q.length()>b&&(q.add(F,W),q.scale(.5),Ee=_.fe(q,!1),O=g.fe(q,!1),_=_.hc(Ee),g=g.hc(O),_.sub(g),_.length()>b)||C.ma(Ee,O)),C},E.OM=function(_,g,b,C){var O=0;if((_.sa==g.sa&&_.na==g.na||_.sa==g.pa&&_.na==g.la)&&(O++,!C))return 1;if(_.pa==g.sa&&_.la==g.na||_.pa==g.pa&&_.la==g.la){if(++O==2)return 2;if(!C)return 1}return g.vi(_.sa,_.na,b)||g.vi(_.pa,_.la,b)||_.vi(g.sa,g.na,b)||_.vi(g.pa,g.la,b)?1:C&&O!=0||E.NM(_,g)==0?0:1},E.Zx=function(_,g,b,C,O,F){var N=0,j=_.rp(g.sa,g.na,F,!1),W=_.rp(g.pa,g.la,F,!1),q=g.rp(_.sa,_.na,F,!1),J=g.rp(_.pa,_.la,F,!1);return isNaN(j)||(C!=null&&(C[N]=j),O!=null&&(O[N]=0),b!=null&&(b[N]=A.h.construct(g.sa,g.na)),N++),isNaN(W)||(C!=null&&(C[N]=W),O!=null&&(O[N]=1),b!=null&&(b[N]=A.h.construct(g.pa,g.la)),N++),N==2||isNaN(q)||j==0&&q==0||W==0&&q==1||(C!=null&&(C[N]=0),O!=null&&(O[N]=q),b!=null&&(b[N]=A.h.construct(_.sa,_.na)),N++),N==2||isNaN(J)||j==1&&J==0||W==1&&J==1||(C!=null&&(C[N]=1),O!=null&&(O[N]=J),b!=null&&(b[N]=A.h.construct(g.pa,g.la)),N++),0C[1]&&(_=C[0],C[0]=C[1],C[1]=_,O!=null&&(C=O[0],O[0]=O[1],O[1]=C),b!=null&&(O=A.h.construct(b[0].x,b[0].y),b[0]=b[1],b[1]=O)),N):(N=E.LM(_,g,F),isNaN(N.x)?0:(b!=null&&(b[0]=_.hc(N.x)),C!=null&&(C[0]=N.x),O!=null&&(O[0]=N.y),1))},E.prototype.eG=function(){return 0},E.prototype.op=function(){},E.prototype.toString=function(){return"Line: ["+this.sa.toString()+", "+this.na.toString()+", "+this.pa.toString()+", "+this.la.toString()+"]"},E}(A.SC);A.yb=ue}(ye||(ye={})),function(A){var ue=function(){function G(){this.Jm=[],this.ya=-1}return G.prototype.La=function(){return this.ya},G.prototype.next=function(){if(this.Jm!=null&&this.Jm.length!=0){this.ya++;var E=this.Jm[0];return this.Jm=1>=this.Jm.length?[]:this.Jm.slice(1),E}return this.Jm=null},G.prototype.ZX=function(E){this.Jm.push(E)},G.prototype.qe=function(){},G}();A.gL=ue}(ye||(ye={})),function(A){var ue;(ue=A.SL||(A.SL={}))[ue.enumFillRuleOddEven=0]="enumFillRuleOddEven",ue[ue.enumFillRuleWinding=1]="enumFillRuleWinding";var G=function(E){function _(g,b){var C=E.call(this)||this;if(C.xf=!1,C.Eq=null,C.sq=0,C.rq=0,C.Aj=null,C.Mg=!1,C.nb=null,C.mb=null,C.Ve=null,C.Lj=null,C.Sd=null,C.tq=0,C.gb=0,C.xq=0,b===void 0)C.xf=g,C.Mg=!1,C.tq=0,C.sq=0,C.rq=0,C.wa=0,C.description=A.ee.og();else{if(b==null)throw A.i.N();C.xf=g,C.Mg=!1,C.tq=0,C.sq=0,C.rq=0,C.wa=0,C.description=b}return C.Aj=null,C.gb=0,C}return me(_,E),_.prototype.tm=function(){return 0b)throw A.i.Qa();if(this.dc(g)){if(this.mb==null)throw A.i.Qa();var C=this.wa,O=this.Ba(g),F=this.Vc(g);this.dm(this.wa+1),this.mc();for(var N=0,j=this.description.Aa;Ng;b--)C=this.nb.read(b),this.nb.write(b,C+1);this.mb.KE(g,1)}},_.prototype.Ap=function(){if(this.wx(),g===void 0){this.Mg=!1;var g=this.da()-1}var b=this.mb.read(g);this.mb.write(g,1|b),this.Ve!=null&&(g=this.Vc(g)-1,this.Ve.write(g,1),this.Lj.write(g,-1))},_.prototype.dc=function(g){return(1&this.mb.read(g))!=0},_.prototype.Nn=function(g){if(this.dc(g))return!0;var b=this.Ba(g);return!(b>(g=this.Vc(g)-1))&&(b=this.Na(b),g=this.Na(g),b.qb(g))},_.prototype.yv=function(g){return(2&this.mb.read(g))!=0},_.prototype.oc=function(g,b){if(this.Jl(g.description),g.getType()!=322)throw A.i.Qa();var C=new A.Sa;(b||this.B())&&(g.To(C),this.nf(C)),g.Po(C),this.lineTo(C)},_.prototype.tp=function(g){var b=this.wa==0;this.sx(g.v,g.G),this.yj(g.v,g.H),this.yj(g.C,g.H),this.yj(g.C,g.G),this.Ap(),this.Mg=!1,b&&this.Lf(256,!1)},_.prototype.ad=function(g,b){if(!g.B()){for(var C=this.wa==0,O=new A.Sa(this.description),F=0;4>F;F++)g.Hf(b?4-F-1:F,O),F==0?this.nf(O):this.lineTo(O);this.Ap(),this.Mg=!1,C&&!b&&this.Lf(256,!1)}},_.prototype.add=function(g,b){for(var C=0;Cb&&(b=g.da()-1),b>=g.da()||0>C||0>O||O>g.rv(b))throw A.i.fa("index out of bounds");if(O!=0){var N=g.dc(b)&&C+O==g.rv(b);if(!N||O!=1){if(this.Mg=!1,this.Jl(g.description),C=g.Ba(b)+C+1,F&&(O++,C--),N&&O--,N=this.wa,this.dm(this.wa+O),this.mc(),F){if(O==0)return;this.nb.add(this.wa),F=g.mb.read(b),F&=-5,this.xf&&(F|=1),this.mb.write(this.mb.size-1,F),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.wa);F=0;for(var j=this.description.Aa;FJ||g.za[J]==null?this.za[F].Ln(q*N,A.ra.se(W),O*q,q*N):this.za[F].Mn(q*N,g.za[J],q*C,O*q,!0,q,q*N)}if(this.tm()||g.yv(b))throw A.i.Qa();this.Pc(1993)}}},_.prototype.oJ=function(){for(var g=0,b=this.da();g=this.da())throw A.i.N();var b=this.Ba(g),C=this.Ja(g);g=this.dc(g)?1:0;for(var O=0,F=this.description.Aa;Og&&(g=b-1),g>=b)throw A.i.N();for(var C=this.Ba(g),O=this.Ja(g),F=0,N=this.description.Aa;F=b.da())throw A.i.N();var F=this.da();if(g>F)throw A.i.N();0>g&&(g=F),0>C&&(C=b.da()-1),this.Mg=!1,this.Jl(b.description),b.mc();var N=b.Ba(C),j=b.Ja(C),W=this.wa,q=b.dc(C)&&!O?1:0;this.dm(this.wa+j),this.mc();for(var J=g=g+1;O--)N=this.nb.read(O-1),this.nb.write(O,N+j);for(b.yv(C),this.mb.add(0),O=F-1;O>=g+1;O--)F=this.mb.read(O),F&=-5,this.mb.write(O+1,F);F=b.JR().read(C),F&=-5,this.xf&&(F|=1),this.mb.write(g,F)},_.prototype.Hz=function(g,b){var C=-1,O=this.da();if(C>O)throw A.i.N();0>C&&(C=O),this.Mg=!1;var F=this.wa;this.dm(this.wa+b),this.mc();var N=C=C+1;F--)N=this.nb.read(F-1),this.nb.write(F,N+b);for(this.mb.add(0),F=O-1;F>=C+1;F--)b=this.mb.read(F),b&=-5,this.mb.write(F+1,b);this.xf&&this.mb.write(C,1)},_.prototype.qG=function(g,b,C){var O=-1;if(0>g&&(g=this.da()),g>this.da()||O>this.Ja(g)||C>b.length)throw A.i.fa("index out of bounds");if(C!=0){g==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>O&&(O=this.Ja(g)),this.mc();var F=this.wa;this.dm(this.wa+C),this.mc();for(var N=0,j=this.description.Aa;Ng&&(g=this.da()),g>=O||b>this.Ja(g))throw A.i.fa("index out of bounds");g==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>b&&(b=this.Ja(g));var F=this.wa;this.dm(this.wa+1),this.mc();var N=this.Ba(g);this.za[0].vj(2*(N+b),C,2*F),C=1;for(var j=this.description.Aa;Cg&&(g=C-1),g>=C||b>=this.Ja(g))throw A.i.fa("index out of bounds");this.mc();var O=this.Ba(g);0>b&&(b=this.Ja(g)-1),b=O+b,O=0;for(var F=this.description.Aa;O=g+1;C--)b=this.nb.read(C),this.nb.write(C,b-1);this.wa--,this.Pg--,this.Pc(1993)},_.prototype.uE=function(g,b,C){var O=this.Ba(g)+b;if((C=this.Ba(C)+void 0)O||C>this.I()-1)throw A.i.N();b=0,(g=this.Ga()).Vb(O);do{for(;g.Ha()&&(O=g.ha(),g.wb()!=C);)b+=O=O.Qb();if(g.wb()==C)break}while(g.$a());return b},_.prototype.fO=function(g,b,C){if(b=this.Ba(g)+b,C=this.Ba(g)+C,0>b||C>this.I()-1)throw A.i.N();var O=this.Ga();if(b>C){if(!this.dc(g))throw A.i.N("cannot iterate across an open path");O.JB()}var F=g=0;O.Vb(b);do F+=g,g=O.ha().Qb();while(O.wb()!=C);return F},_.prototype.mg=function(){return A.pi.gm(this,null)},_.prototype.KS=function(g,b,C){for(var O=g;Ob){var N=this.tm(),j=0;b=this.wa}else N=this.yv(b),j=this.Ba(b),b=this.Vc(b);for(;j=this.Ba(b))return b;b--}else b++;if(0<=b&&b=this.Ba(b)&&gC){for(b=0;bb;){var O=b+(C-b>>1);if(g=(b=this.Vc(O))))return this.gb=O;b=O+1}}return this.gb=b},_.prototype.yz=function(){var g=this.I();if(!this.xf){g-=this.da();for(var b=0,C=this.da();bC.RR()))return!0;this.Bb.yD(null)}return C=A.Nx.create(this,g,b),this.Bb.yD(C),!0},_.prototype.cc=function(){var g=E.prototype.cc.call(this);if(!this.Ac()){var b=this.da();this.nb!=null&&this.nb.An(g,0,b+1),this.mb!=null&&this.mb.An(g,0,b)}return g},_.prototype.ZF=function(g){return this.Ve!=null?this.Ve.read(g):1},_.prototype.bc=function(g,b,C){var O=this.sz(g);if(g==this.Vc(O)-1&&!this.dc(O))throw A.i.fa("index out of bounds");this.mc();var F=this.Ve,N=1;if(F!=null&&(N=7&F.read(g)),N!==1)throw A.i.Qa();if(b.Or(),b=b.get(),C?b.Nf(A.ee.og()):b.Nf(this.description),O=g==this.Vc(O)-1&&this.dc(O)?this.Ba(O):g+1,F=new A.h,this.D(g,F),b.Dc(F),this.D(O,F),b.Qc(F),!C)for(C=1,F=this.description.Aa;C=this.da())throw A.i.N();if(this.B())b.Oa();else{if(this.yv(g))throw A.i.fa("not implemented");var C=this.ub(0),O=new A.h,F=new A.l;F.Oa();var N=this.Ba(g);for(g=this.Vc(g);Nthis.I())&&(g=A.ta.nE(this),this.Bb.WM(g),!0)},_.prototype.hM=function(){if(this.Bb==null&&(this.Bb=new A.Uk),this.Bb.zo==null){this.Bb.xD(null);var g=A.ta.YN(this);this.Bb.xD(g)}},_.prototype.Yo=function(g){this.xq=g},_.prototype.In=function(){return this.xq},_.prototype.DD=function(g){if(this==g)throw A.i.fa("MultiPathImpl.add");for(var b=this.da(),C=0;C=(b=this.Vc(b))||gb?_.I():b,0>g||g>_.I()||bg?b:g,0>b||0>g)throw A.i.N();if(g!=0){b=g-0,g=this.wa,this.resize(this.wa+b);for(var C=0;C_||_>=this.I())throw A.i.fa("index out of bounds");this.mc();for(var g=0,b=this.description.Aa;gg||g>=this.wa||b_?_:G},ue.Th=function(G,E){var _=5381;return((_=((_=((_=E!==void 0?(E<<5)+E+(255&G):(_<<5)+_+(255&G))<<5)+_+(G>>8&255))<<5)+_+(G>>16&255))<<5)+_+(G>>24&255)&2147483647},ue.uj=function(){throw Error("Not Implemented")},ue.bB=function(G){return ue.aU(G)+12345&2147483647},ue.XG=function(G){var E=32,_=G%ue.Qx|0,g=G/ue.Qx|0;return(E&=63)==0?G:(32>E?(G=_>>>E|g<<32-E,E=g>>E):(G=g>>E-32,E=0<=g?0:-1),E*ue.Qx+(G>>>0))},ue.aU=function(G){var E=1103515245,_=65535&E;return((E-_)*(G|=0)|0)+(_*G|0)|0},ue.truncate=function(G){return 0>G?-1*Math.floor(Math.abs(G)):Math.floor(G)},ue.MAX_SAFE_INTEGER=Math.pow(2,53)-1,ue.MIN_SAFE_INTEGER=-ue.MAX_SAFE_INTEGER,ue.VC=65536,ue.Qx=ue.VC*ue.VC,ue}()}(ye||(ye={})),function(A){var ue;(ue=A.CL||(A.CL={}))[ue.Project=0]="Project",ue[ue.Union=1]="Union",ue[ue.Difference=2]="Difference",ue[ue.Proximity2D=3]="Proximity2D",ue[ue.Relate=4]="Relate",ue[ue.Equals=5]="Equals",ue[ue.Disjoint=6]="Disjoint",ue[ue.Intersects=7]="Intersects",ue[ue.Within=8]="Within",ue[ue.Contains=9]="Contains",ue[ue.Crosses=10]="Crosses",ue[ue.Touches=11]="Touches",ue[ue.Overlaps=12]="Overlaps",ue[ue.Buffer=13]="Buffer",ue[ue.Distance=14]="Distance",ue[ue.Intersection=15]="Intersection",ue[ue.Clip=16]="Clip",ue[ue.Cut=17]="Cut",ue[ue.DensifyByLength=18]="DensifyByLength",ue[ue.DensifyByAngle=19]="DensifyByAngle",ue[ue.LabelPoint=20]="LabelPoint",ue[ue.GeodesicBuffer=21]="GeodesicBuffer",ue[ue.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",ue[ue.ShapePreservingDensify=23]="ShapePreservingDensify",ue[ue.GeodeticLength=24]="GeodeticLength",ue[ue.GeodeticArea=25]="GeodeticArea",ue[ue.Simplify=26]="Simplify",ue[ue.SimplifyOGC=27]="SimplifyOGC",ue[ue.Offset=28]="Offset",ue[ue.Generalize=29]="Generalize",ue[ue.SymmetricDifference=30]="SymmetricDifference",ue[ue.ConvexHull=31]="ConvexHull",ue[ue.Boundary=32]="Boundary",ue[ue.SimpleRelation=33]="SimpleRelation";var G=function(){function E(){}return E.prototype.getType=function(){return null},E.prototype.wn=function(){},E.prototype.Iu=function(){return!1},E}();A.Je=G}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 13},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O){return _ instanceof A.aa?(O=new A.Zc(_),this.V(O,g,[b],!1,C).next()):C===!0?(b=new A.BC(_,g,b,!1,O),A.Gh.local().V(b,g,O)):new A.BC(_,g,b,!1,O)},E.instance=null,E}(A.Je);A.AC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C){this.ya=-1,this.Rd=E,this.$z=_,this.Cs=g,this.tT=new A.l,this.tT.Oa(),this.eo=-1,this.Ub=C}return G.prototype.next=function(){for(var E;(E=this.Rd.next())!=null;)return this.ya=this.Rd.La(),this.eo+1=E.I():E.da()==1&&(2>=E.I()||A.Zt.JG(E,0)))},G}();A.DC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 17},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O){return new A.nL(_,g,b,C,O)},E.instance=null,E}(A.Je);A.mL=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C){if(this.Tf=null,_==null||g==null)throw A.i.fa("invalid argument");this.qT=E,this.nA=_,this.lH=g,E=A.ta.mv(_,g),this.qa=A.ta.Wd(b,E,!0),this.kH=-1,this.nd=C}return G.prototype.La=function(){return 0},G.prototype.next=function(){return this.RQ(),++this.kHthis.Tf.length&&(this.Tf.length=0)},G.prototype.SQ=function(){var E=new A.ia(0),_=new A.gd,g=_.aF(),b=_.Ib(this.nA),C=_.Ib(this.lH),O=new A.Fg;try{O.Ft(_,this.qa,this.nd),O.dl(g,b,C,E);var F=_.Ne(b),N=new A.Da,j=new A.Da;for(this.Tf.length=0,this.Tf.push(N),this.Tf.push(j),b=0;b=g)throw A.i.N();return new A.oL(_,g,b)},E.instance=null,E}(A.Je);A.Xl=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_){this.ya=-1,this.Rd=E,this.Ps=_}return G.prototype.La=function(){return this.ya},G.prototype.next=function(){var E;return(E=this.Rd.next())!=null?(this.ya=this.Rd.La(),this.NP(E)):null},G.prototype.NP=function(E){if(E.B()||1>E.Db())return E;var _=E.getType();if(_==1736||_==1607)return this.Ny(E);if(A.aa.yd(_))return this.PP(E);if(_==197)return this.OP(E);throw A.i.Qa()},G.prototype.PP=function(E){if(E.Qb()<=this.Ps)return E;var _=new A.Ta(E.description);return _.oc(E,!0),this.Ny(_)},G.prototype.OP=function(E){var _=new A.Da(E.description);_.ad(E,!1);var g=new A.l;return E.A(g),E=g.ca(),g.R()<=this.Ps&&E<=this.Ps?_:this.Ny(_)},G.prototype.Ny=function(E){for(var _=E.Ia(),g=E.Ga();g.$a();)for(var b=!0;g.Ha();){var C=g.ha();if(C.getType()!=322)throw A.i.fa("not implemented");var O=g.On(),F=C.Qb();if(F>this.Ps){var N=Math.ceil(F/this.Ps);F=new A.Sa(E.description),b&&(C.To(F),_.nf(F));var j=b=1/N,W=0;for(--N;WF)return _;var N=_.getType(),j=g.getType(),W=new A.l,q=new A.l,J=new A.l;_.A(W),g.A(q),J.K(W),J.Zb(q);var ee=(J=A.ta.Wd(b,J,!0))*Math.sqrt(2)*1.00001,he=new A.l;if(he.K(W),he.W(ee,ee),!he.isIntersecting(q))return _;if(O==1&&F==2)return E.KV(_,g,j,b,C);if(N==33)switch(A.Vk.yd(j)?(b=new A.Ta(g.description),b.oc(g,!0)):b=g,j){case 1736:return E.XU(_,b,J);case 1607:return E.YU(_,b,J);case 550:return E.VU(_,b,J);case 197:return E.UU(_,b,J);case 33:return E.WU(_,b,J);default:throw A.i.N()}else if(N==550)switch(j){case 1736:return E.nU(_,g,J);case 197:return E.lU(_,g,J);case 33:return E.mU(_,g,J)}return A.Fg.im(_,g,b,C)},E.XU=function(_,g,b){return A.hd.KG(g,_,b)==0?_:_.Ia()},E.YU=function(_,g,b){var C=_.D();g=g.Ga();for(var O=b*Math.sqrt(2)*1.00001,F=O*O,N=new A.l;g.$a();)for(;g.Ha();){var j=g.ha();if(j.A(N),N.W(O,O),N.contains(C)){if(j.qs(C,b))return _.Ia();var W=j.ac();if(A.h.yc(C,W)<=F||(W=j.wc(),A.h.yc(C,W)<=F))return _.Ia()}}return _},E.VU=function(_,g,b){var C=g.ub(0);g=g.I();var O=_.D(),F=new A.h;b=b*Math.sqrt(2)*1.00001,b*=b;for(var N=0;Ng.I()?this.gE(_,g,b):(this.Nt(),_=this.gE(g,_,b),this.Nt(),_):_.getType()==550&&A.aa.Hc(g.getType())?(_=this.hE(g,_,b),this.Nt(),_):g.getType()==550&&A.aa.Hc(_.getType())?this.hE(_,g,b):_.getType()==550&&g.getType()==550?_.I()>g.I()?this.iE(_,g):(this.Nt(),_=this.iE(g,_),this.Nt(),_):0},E.prototype.gE=function(_,g,b){var C=_.Ga(),O=g.Ga(),F=new A.l,N=new A.l,j=17976931348623157e292;if(!b&&this.pY(_,g,C,O))return 0;for(;C.$a();)for(;C.Ha();)if((_=C.ha()).A(F),!(F.px(this.oh)>j)){for(;O.$a();)for(;O.Ha();)if((g=O.ha()).A(N),F.px(N)F)){for(var q=0;qC)){for(var q=0;qE.Ja(_))){var C=E.Ba(_),O=E.Vc(_)-1,F=E.ub(0),N=E.dc(_),j=new A.ia(0);j.Jb(E.Ja(_)+1);var W=new A.ia(0);for(W.Jb(E.Ja(_)+1),j.add(N?C:O),j.add(C),C=new A.h;1this.DH&&N>O&&(C=b,O=N)}return C},G.prototype.qe=function(){},G}();A.sL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 29},E.prototype.V=function(_,g,b,C){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C).next()):new A.sL(_,g,b,C)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.instance=null,E}(A.Je);A.EC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 21},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O,F,N,j){return _ instanceof A.aa?(j=new A.Zc(_),this.V(j,g,b,[C],O,F,!1,N).next()):N===!0?(b=new A.GC(_,g,b,C,O,!1,!1,j),A.Gh.local().V(b,g,j)):new A.GC(_,g,b,C,O,!1,!1,j)},E.instance=null,E}(A.Je);A.FC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C,O,F,N){if(O)throw A.i.Ie();if(_==null)throw A.i.N();this.ya=-1,this.Ms=E,this.vg=_,this.ze=g,this.Cs=b,this.$n=C,this.eo=-1,this.Ub=N,this.uT=new A.l,this.uT.Oa()}return G.prototype.next=function(){for(var E;(E=this.Ms.next())!=null;)return this.ya=this.Ms.La(),this.eo+1_.Db())return 0;if(b==4)throw A.i.Ie();var C=A.cb.sc(g),O=A.cb.vv(C),F=A.cb.ev(C);O*=2-O;var N=C.Hd().ai,j=_.getType();if(j==1736||j==197)var W=_.mg();else A.aa.yd(j)?(W=new A.Ta(_.description)).oc(_,!0):W=_;if(C.Nb(g)==0){if(A.cb.Wc(g)){W=A.Hh.lj(W,g),j==1607&&W==_&&(W=A.aa.jg(_)),_=new A.Nc,A.cb.gh(g).cn(_),j=0;for(var q=W.I();j=this.Fi||7C||g==0&&_==550&&this.Dj==33?this.nJ():G.HB(E,b);if((this.Fi==-1||this.Fi==4)&&_==197&&this.Dj==197)return g=this.Se,_=new A.l,E.A(_),b=new A.l,g.A(b),_.Ea(b),g=new A.Fh,E.copyTo(g),g.Xo(_),g;if(_==197&&A.aa.tf(this.Dj)==0||this.Dj==197&&A.aa.tf(_)==0)return b=_==197?E:this.Se,E=_==197?this.Se:E,_=new A.l,b.A(_),A.Ud.clip(E,_,g,0);if(A.aa.tf(_)==0&&0N&&(N=g.yz()),O=g.I()+b.I(),N*b.I()>Math.log(O)*O*4)return null;O=null,N=b.Ga(),j!=null&&j.Fb!=null&&(O=j.Fb),O==null&&20Ye){if(O!=null)for(b==null?b=O.vR(jt,C):b.Uo(jt,C),Ye=b.next();Ye!=-1;Ye=b.next()){N.Vb(O.ja(Ye)),Ye=N.ha();var ei=jt.Ea(Ye,null,W,null,C);for(Ye=0;YeEt?(ee=j.wb()-g.Ba(pt),he=1,Et=Et==0?3:2):he++:(E.oc(Xt,Et==0),Et=1);break;case 0:Et=0,ee=-1,he=0;break;default:return null}Xt=pi}}}else{if(0>(Ye=this.QD(_,jt.ac(),C)))return null;Ye==1?(2>Et&&(ee=j.wb()-g.Ba(pt),Et=Et==0?3:2),he++):(ee=-1,he=0)}q.clear(!1)}else Ye!=0&&Ye==1&&(Et==0?(Et=3,ee=j.wb()-g.Ba(pt)):Et==1?(Et=2,ee=j.wb()-g.Ba(pt)):he++)}2<=Et&&(E.Dr(g,pt,ee,he,Et==3),ee=-1)}return E},G.prototype.QD=function(E,_,g){return A.Dg.wm(E,_,g)},G.prototype.RD=function(E,_,g){var b=_.ac();_=_.wc();var C=A.Dg.wm(E,b,g),O=A.Dg.wm(E,_,g);return C==1&&O==0||C==0&&O==1?-1:C==0||O==0?0:C==1||O==1?1:((C=new A.h).add(b,_),C.scale(.5),(E=A.Dg.wm(E,C,g))==0?0:E==1?1:-1)},G.HB=function(E,_){return _?E:E.Ia()},G.prototype.nJ=function(){return this.yH==null&&(this.yH=this.Se.Ia()),this.yH},G.prototype.qe=function(){},G}();A.HC=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 28},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.V=function(_,g,b,C,O,F,N){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C,O,F,N).next()):new A.xL(_,g,b,C,O,F,N)},E.instance=null,E}(A.Je);A.IC=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b,C,O,F){this.ya=-1,this.Rd=E,this.Mj=_,this.Ka=g,this.Ki=b,this.CA=C,this.uH=O,this.nd=F}return G.prototype.next=function(){var E=this.Rd.next();return E!=null?(this.ya=this.Rd.La(),this.jL(E)):null},G.prototype.La=function(){return this.ya},G.prototype.jL=function(E){var _=0>=this.uH?A.ta.kj(this.Mj,E,!1):this.uH;return A.IK.V(E,this.Ka,this.Ki,this.CA,_,this.nd)},G.prototype.qe=function(){},G}();A.xL=ue}(ye||(ye={})),function(A){var ue;(ue=A.NK||(A.NK={}))[ue.clipToDomainOnly=1]="clipToDomainOnly",ue[ue.clipWithHorizon=2]="clipWithHorizon",ue[ue.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var G=function(E){function _(){return E!==null&&E.apply(this,arguments)||this}return me(_,E),_.prototype.getType=function(){return 0},_.local=function(){return _.instance===null&&(_.instance=new _),_.instance},_.prototype.V=function(g,b,C){return g instanceof A.aa?(g=new A.Zc(g),this.V(g,b,C).next()):new A.yL(g,b,C)},_.prototype.transform=function(g,b,C,O){return A.bu.transform(g,b,C,O,!0)},_.prototype.Qt=function(g,b,C,O){return A.bu.Qt(g,b,C,O)},_.instance=null,_}(A.Je);A.Hx=G}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){this.ya=-1,this.Rd=E,this.MT=_,this.nd=g}return G.prototype.next=function(){var E=this.Rd.next();return E!=null?(this.ya=this.Rd.La(),A.bu.zh(E,this.MT,this.nd)):null},G.prototype.La=function(){return this.ya},G.prototype.qe=function(){},G}();A.yL=ue}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.prototype.reset=function(){this.ph=this.xk=-1,this.us=this.kq=!1},E.prototype.AQ=function(_,g,b){for(_.Vb(g,b);_.Ha();){var C=_.ha();if((C=C.Qb())!=0)return _.wb()}for(_.Vb(g,b);_.Ez();)if((C=(C=_.li()).Qb())!=0)return _.wb();return-1},E.prototype.BQ=function(_,g){for(_.Vb(g,-1);_.Ez();)if(_.li().Qb()!=0)return _.wb();return-1},E.prototype.zQ=function(_,g){for(_.Vb(g,-1),_.ha();_.Ha();)if(_.ha().Qb()!=0)return _.wb();return-1},E.prototype.yQ=function(_,g,b,C){if(this.xk=this.AQ(g,b,C),this.xk!=-1){g.Vb(this.xk,-1);var O=g.ha(),F=O.hc(O.fe(_,!1));if(b=A.h.yc(F,_),(C=new A.h).L(F),C.sub(O.ac()),(F=new A.h).L(_),F.sub(O.ac()),this.kq=0>C.wi(F),this.ph=this.zQ(g,this.xk),this.ph!=-1){g.Vb(this.ph,-1);var N=(O=g.ha()).fe(_,!1);N=O.hc(N);var j=A.h.yc(N,_);j>b?this.ph=-1:(C.L(N),C.sub(O.ac()),F.L(_),F.sub(O.ac()),this.us=0>C.wi(F))}this.ph==-1&&(this.ph=this.BQ(g,this.xk),this.ph!=-1&&(g.Vb(this.ph,-1),N=(O=g.ha()).fe(_,!1),N=O.hc(N),(j=A.h.yc(N,_))>b?this.ph=-1:(C.L(N),C.sub(O.ac()),F.L(_),F.sub(O.ac()),this.us=0>C.wi(F),_=this.xk,this.xk=this.ph,this.ph=_,_=this.kq,this.kq=this.us,this.us=_)))}},E.prototype.cO=function(_,g,b,C,O){return b=b.Ga(),this.yQ(_,b,C,O),this.xk!=-1&&this.ph==-1?this.kq:this.xk!=-1&&this.ph!=-1?this.kq==this.us?this.kq:(b.Vb(this.xk,-1),_=b.ha().kg(),b.Vb(this.ph,-1),g=b.ha().kg(),0<=_.wi(g)):g},E}(),G=function(E){function _(){return E!==null&&E.apply(this,arguments)||this}return me(_,E),_.local=function(){return _.instance===null&&(_.instance=new _),_.instance},_.prototype.getType=function(){return 3},_.prototype.nz=function(g,b,C){var O;if(O===void 0&&(O=!1),g.B())return new A.$l;b=b.D();var F=g,N=g.getType();switch(N==197&&((F=new A.Da).ad(g,!1),N=1736),N){case 33:return this.xI(F,b);case 550:return this.jI(F,b);case 1607:case 1736:return this.bU(F,b,C,O);default:throw A.i.fa("not implemented")}},_.prototype.oz=function(g,b){if(g.B())return new A.$l;b=b.D();var C=g,O=g.getType();switch(O==197&&((C=new A.Da).ad(g,!1),O=1736),O){case 33:return this.xI(C,b);case 550:case 1607:case 1736:return this.jI(C,b);default:throw A.i.fa("not implemented")}},_.prototype.pz=function(g,b,C,O){if(0>O)throw A.i.N();if(g.B())return[];b=b.D();var F=g,N=g.getType();switch(N==197&&((F=new A.Da).ad(g,!1),N=1736),N){case 33:return this.TU(F,b,C,O);case 550:case 1607:case 1736:return this.tU(F,b,C,O);default:throw A.i.fa("not implemented")}},_.prototype.bU=function(g,b,C,O){if(g.getType()==1736&&C&&(C=new A.l,g.A(C),C=A.ta.Wd(null,C,!1),(O?A.hd.Yd(g,b,0):A.hd.Yd(g,b,C))!=0)){var F=new A.$l(b,0,0);return O&&F.WJ(!0),F}var N=g.Ga();F=new A.h;for(var j=C=-1,W=17976931348623157e292,q=0;N.$a();)for(;N.Ha();){var J=N.ha();J=J.hc(J.fe(b,!1));var ee=A.h.yc(J,b);eeA.h.Uq(b,J.ac(),J.wc()),1=b||(g.length=O),g.slice(0)},_.instance=null,_}(A.Je);A.Ix=G}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 4},E.prototype.V=function(_,g,b,C,O){return A.am.yB(_,g,b,C,O)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.Iu=function(_){return A.Vt.wy(_)},E.prototype.wn=function(_,g,b){A.Vt.CD(_,g,b)},E.instance=null,E}(A.Je);A.zL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 33},E.prototype.V=function(_,g,b,C,O){return _===1073741824?!A.ud.zB(g,b,C,4,O):A.ud.zB(g,b,C,_,O)},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.prototype.Iu=function(_){return A.Vt.wy(_)},E.prototype.wn=function(_,g,b){A.Vt.CD(_,g,b)},E.instance=null,E}(A.Je);A.dj=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g,b){if(this.nd=b,this.rT=g,this.ya=-1,E==null)throw A.i.N();this.yk=E,this.Mj=_}return G.prototype.next=function(){var E;if((E=this.yk.next())!=null){if(this.ya=this.yk.La(),this.nd!=null&&!this.nd.progress(-1,-1))throw A.i.fu("user_canceled");return this.eC(E)}return null},G.prototype.La=function(){return this.ya},G.prototype.eC=function(E){if(E==null)throw A.i.N();return A.Jx.cK(E,this.Mj,this.rT,this.nd)},G.prototype.qe=function(){},G}();A.AL=ue}(ye||(ye={})),function(A){var ue=function(G){function E(){return G!==null&&G.apply(this,arguments)||this}return me(E,G),E.prototype.getType=function(){return 26},E.prototype.V=function(_,g,b,C){return _ instanceof A.aa?(_=new A.Zc(_),this.V(_,g,b,C).next()):new A.AL(_,g,b,C)},E.prototype.rs=function(_,g,b,C,O){return 0<(C!==void 0?A.Jx.rs(_,g,b,C,O):A.Jx.rs(_,g,!1,null,b))},E.local=function(){return E.instance===null&&(E.instance=new E),E.instance},E.instance=null,E}(A.Je);A.Yl=ue}(ye||(ye={})),function(A){var ue=function(){function O(){this.yq=0}return O.prototype.nX=function(F){this.yq&=-2,this.yq|=F?1:0},O.prototype.Wp=function(){return(1&this.yq)!=0},O.prototype.XF=function(){return this.Wp()?0:1},O}();A.xY=ue;var G=function(){},E=function(O,F,N,j){this.x=O,this.y=F,this.Ai=N,this.xm=j},_=function(){function O(F){this.Be=F}return O.prototype.compare=function(F,N,j){return F=F.ja(j),N=this.Be.lf.read(2*N),0>(N-=F=this.Be.lf.read(2*F))?-1:0J?1:0},O}(),b=function(){function O(F,N){this.YI=new A.h,this.parent=F,this.dS=N}return O.prototype.nr=function(F,N,j){var W=this.parent,q=this.dS;j.Vd(F,N,function(J,ee){return W.Mh(J,ee,q)})},O.prototype.$p=function(F){return F=this.parent.gi.get(F),this.parent.lf.tc(2*(F>>1),this.YI),this.YI.y+(1&F?this.parent.Oj:-this.parent.Oj)},O}(),C=function(){function O(F,N,j,W,q){this.nH=F.description,this.X=F,this.Qg=N,this.Oj=A.ta.kj(this.Qg,F,!1),this.Bo=A.ta.kj(this.Qg,F,!0),this.xA=j,this.oT=this.nH.Aa,this.hb=[],this.po=[],this.mh=new A.jp,this.fb=new A.Yj,this.ke=new A.Md,this.ZG=this.ql=q}return O.prototype.eT=function(){return this.ZG=!0,(!A.aa.Hc(this.X.getType())||this.GE()&&this.DE(!1))&&this.mO()?A.aa.Hc(this.X.getType())?this.pO()?this.X.getType()==1607?this.rO()?2:0:this.sO()?this.tO():0:0:2:0},O.prototype.kC=function(F,N){var j=this.lf.read(2*F);F=this.lf.read(2*F+1);var W=this.lf.read(2*N);N=this.lf.read(2*N+1);var q=!A.Yt.Cv(j,F,W,N,this.Oj*this.Oj);return q||this.X.Db()!=0&&j==W&&F==N},O.prototype.GE=function(){for(var F=this.X,N=F.xf?3:2,j=0,W=F.da();jthis.Oj)){if(F&&W){var J=q.wv(1,0);if(q=q.wv(1,0),Math.abs(q-J)>N)continue}return this.ke=new A.Md(2,j.wb(),-1),!1}}return!0},O.prototype.mO=function(){var F=this.X,N=null;A.aa.Hc(this.X.getType())&&(N=this.X);var j=(this.ZG||this.ql)&&N!=null,W=F.I();this.lf=F.ub(0),this.gi=new A.ia(0),this.gi.Jb(2*W),this.fi=new A.ia(0),this.fi.Jb(2*W),j&&(this.Fl==null&&(this.Fl=new A.ia(0)),this.Fl.Jb(W));for(var q=F=0;q=N.Vc(F);)F++;this.Fl.add(F)}for(new A.Xt().sort(this.fi,0,2*W,new b(this,j)),this.fb.clear(),this.fb.Vo(new _(this)),this.fb.De(W),N=0,W*=2;N>1,(1&F)==0){if(F=this.fb.addElement(j,-1),(q=this.fb.we(F))!=-1&&!this.kC(this.fb.ja(q),j))return this.ke=new A.Md(3,j,this.fb.ja(q)),!1;var J=this.fb.lb(F);if(J!=-1&&!this.kC(this.fb.ja(J),j))return this.ke=new A.Md(3,j,this.fb.ja(J)),!1}else if(F=this.fb.search(j,-1),q=this.fb.we(F),J=this.fb.lb(F),this.fb.vd(F,-1),q!=-1&&J!=-1&&!this.kC(this.fb.ja(q),this.fb.ja(J)))return this.ke=new A.Md(3,this.fb.ja(q),this.fb.ja(J)),!1;return!0},O.prototype.pO=function(){return 10>this.X.I()?this.nO():this.oO()},O.prototype.oO=function(){var F=new A.gd;F.Ib(this.X);var N=new A.Md;return!A.$t.kI(!1,F,this.Oj,N,this.nd)||(N.Jo=F.Ua(N.Jo),N.Ko=F.Ua(N.Ko),this.ke.Wt(N),!1)},O.prototype.nO=function(){var F=this.X,N=F.Ga();for(F=F.Ga();N.$a();)for(;N.Ha();){var j=N.ha();if(!N.Qn()||!N.$S()){F.BW(N);do for(;F.Ha();){var W=F.ha();if((W=j.zr(W,this.Oj,!0))!=0)return this.ke=new A.Md(W==2?5:4,N.wb(),F.wb()),!1}while(F.$a())}}return!0},O.prototype.sO=function(){var F=this.X;this.hb.length=0,this.po.length=0,this.Zf=F.Ga(),this.Zf.JB();var N=new A.ia(0);N.Jb(10);var j=NaN,W=0,q=0;for(F=2*F.I();q>=1;var ee=this.lf.read(2*J),he=this.lf.read(2*J+1);if(N.size!=0&&(ee!=j||he!=W)){if(!this.RI(N))return!1;N?.clear(!1)}N.add(J),j=ee,W=he}}return!!this.RI(N)},O.prototype.rO=function(){for(var F=this.X,N=Array(F.da()),j=0,W=F.da();j>1;this.lf.tc(2*J,q);var ee=N[j=this.Fl.get(J)],he=F.Ba(j),Ee=F.Vc(j)-1;W.el=J==he||J==Ee,W.ny=this.ql?!ee&&W.el:W.el,W.Ai=j,W.x=q.x,W.y=q.y,W.xm=J;for(var De=new G,pt=1,Et=this.fi.size;pt>1,this.lf.tc(2*J,q),(j=this.Fl.get(J))!=W.Ai&&(ee=N[j],he=F.Ba(j),Ee=F.Vc(j)-1);var Ye=J==he||J==Ee,jt=this.ql?!ee&&W.el:W.el;if(De.x=q.x,De.y=q.y,De.Ai=j,De.xm=J,De.ny=jt,De.el=Ye,De.x==W.x&&De.y==W.y){if(this.ql){if(!(De.ny&&W.ny||De.Ai==W.Ai&&(De.el||W.el)))return this.ke=new A.Md(8,De.xm,W.xm),!1}else if(!De.el||!W.el)return this.ke=new A.Md(5,De.xm,W.xm),!1}j=W,W=De,De=j}return!0},O.prototype.JE=function(){for(var F=this.X,N=[],j=-1,W=!1,q=0,J=F.da();q>1;this.lf.tc(2*ee,W),q=this.Fl.get(ee),j=new E(W.x,W.y,q,ee,N[q]),F=[];var he=1;for(J=this.fi.size;he>1,this.lf.tc(2*ee,W),q=this.Fl.get(ee),(q=new E(W.x,W.y,q,ee,N[q])).x==j.x&&q.y==j.y){if(q.Ai==j.Ai)return this.ke=new A.Md(9,q.xm,j.xm),!1;0<=N[q.Ai]&&N[q.Ai]==N[j.Ai]&&(F.length!=0&&F[F.length-1]==j||F.push(j),F.push(q))}j=q}if(F.length==0)return!0;for(q=new A.jp(!0),A.O.$u(N,-1),W=-1,(he=new A.h).Rc(),j=0,J=F.length;j=F.Ke())return this.ke=new A.Md(6,F.da()==1?1:-1,-1),0;if(F.da()==1)return this.ql&&!this.JE()?0:2;this.to=A.ia.qf(F.da(),0),this.JA=A.ia.qf(F.da(),-1);for(var N=-1,j=0,W=0,q=F.da();WJ?0:256),0N||j>=1,(W=this.lf.read(2*j+1))!=this.Mo&&F.size!=0){if(!this.ut(F))return 0;F?.clear(!1)}F.add(j),this.Mo=W}return 0q.la){var ee=this.Zf.wb(),he=this.Su(q,W,this.Zf.gb,!0);0F.Ja(N.gb))){j.EW();for(var De,pt,Et=!0;N.Ha();){var Ye=N.ha(),jt=j.li();if(N.wb()>j.wb())break;Et&&(he.add(N.wb()),Ee.add(j.ik()),Et=!1),pt=he.Fc();var ei=N.ik();if(1this.Bo?he.add(N.ik()):J&&(De=F.Uc(1,he.Fc(),0),Ye=Ye.gv(1,0),Math.abs(Ye-De)>ee&&he.add(N.ik())),pt>this.Bo?Ee.add(j.wb()):J&&(De=F.Uc(1,Ee.Fc(),0),Ye=jt.gv(1,0),Math.abs(Ye-De)>ee&&Ee.add(j.wb()))}if(he.Fc()Ee.size?he.If():Ee.If():(he.Fc()!=Ee.Fc()&&Ee.If(),Ee.If()),2<=Ee.size+he.size){for(Et=new A.Sa,jt=0,Ye=he.size;jt>1;var q=W>>1,J=new A.h,ee=new A.h;return this.lf.tc(2*N,J),J.y+=1&F?this.Oj:-this.Oj,this.lf.tc(2*q,ee),ee.y+=1&W?this.Oj:-this.Oj,(F=J.compare(ee))==0&&j?0>(j=this.Fl.get(N)-this.Fl.get(q))?-1:0q.x)return 1;if(W.yq.y)return 1;for(W=1;WEe)return 1}}return 0},O.prototype.PO=function(F,N){var j=this.Ou(F,N);return j==0?FN?1:0F?_:g;if(_.B())return g;if(g.B())return _;var N=new A.l,j=new A.l,W=new A.l;return _.A(N),g.A(j),W.K(N),W.Zb(j),N=A.ta.Wd(b,W,!0),j=_.getType(),W=g.getType(),j==33&&W==33?E.aV(_,g,N):j!=W?0F?_:g:j==550?E.iI(_,g,N):E.iI(g,_,N):A.Fg.ep(_,g,b,C)},E.aV=function(_,g,b){b=b*Math.sqrt(2)*1.00001,b*=b;var C=_.D(),O=g.D(),F=new A.de(_.description);return A.h.yc(C,O)>b&&(F.add(_),F.add(g)),F},E.iI=function(_,g,b){var C=_.ub(0),O=_.I(),F=g.D(),N=_.Ia();b=b*Math.sqrt(2)*1.00001;var j=new A.l;if(_.A(j),j.W(b,b),j.contains(F)){b*=b,j=!1;for(var W=[],q=0;qthis.zk||0>this.bo)throw A.i.Qa();if(this.AH[this.bo])break}return this.ya++,this.fG(this.bo)}return this.ya=0,this.bo=this.zk,this.fG(this.zk)},_.prototype.La=function(){return this.ya},_.prototype.qK=function(){if(this.Ic)return!0;var g=null;if(this.Rd!=null&&(g=this.Rd.next())==null&&(this.Ic=!0,this.Rd=null),A.mp.zp(this.Ub),g!=null){var b=g.Db();this.AH[b]=!0,b>=this.zk&&!this.jA&&(this.ND(b,!1,g),b>this.zk&&!this.jA&&this.zW(b))}if(0this.Do.length)for(var F=0,N=Math.max(2,g+1);Fb?A.F.Wq(q,W,j,J,0):A.F.Wq(q,j,W,J,0),he=[0,0,0],Ee=[0,0,0];var Et=[0,0,0];j=[0,0,0],ee=[0,0,0];var Ye=Math.acos(J[2]/1),jt=1-E,ei=Math.tan(Ye),Xt=1+ei*ei/jt,wi=2*q[2]*ei/jt;for(jt=(-wi+(ei=Math.sqrt(wi*wi-4*Xt*(q[2]*q[2]/jt-1))))/(Xt*=2),wi=(-wi-ei)/Xt,ei=Math.tan(Ye),Ye=(jt+wi)/2,q=((Xt=ei*jt+q[2])+(ei*wi+q[2]))/2,ei=A.F.gp(jt-Ye,Xt-q),jt=q/pt*1.570796326794897,wi=0;100>wi&&(Xt=(Xt=A.F.w(E,jt))*Xt/Math.cos(jt)*(Math.sin(jt)-q*Xt/(1-E)),!A.s.Cd(Xt));wi++)jt-=Xt;q=A.F.n(1,E,jt)*Math.cos(jt),ei=1-ei/(q=Math.sqrt((q-Ye)*(q+Ye))),ei*=2-ei,Xt=A.F.on(he),Ye=A.F.on(Ee),jt=A.F.on(Et);var pi=A.F.St(Et,he);wi=A.F.St(Et,Ee),A.F.zx(Et,he,j),A.F.zx(Et,Ee,ee),he=Math.acos(pi/(jt*Xt)),Ee=Math.acos(wi/(jt*Ye)),Ee*=A.s.Mb(1,A.F.St(j,ee)),(1.570796326794897<=A.s.P(he)&&1.570796326794897<=A.s.P(Ee)||3.141592653589793ee&&0>b)&&(b=A.F.ba(b+3.141592653589793)),O!=null&&(O.u=j),F!=null&&(F.u=ee),N!=null&&(N.u=b)}}},ue.rf=function(G,E,_,g,b,C,O,F){var N=[0,0,0],j=[0,0,0],W=[0,0,0],q=[0,0,0],J=[0,0,0],ee=[0,0,0],he=[0,0,0],Ee=[0,0,0,0],De=new A.ga(0),pt=new A.ga(0),Et=new A.ga(0),Ye=new A.ga(0),jt=new A.ga(0),ei=new A.ga(0);if(O!=null&&F!=null)if(A.s.ti(E))A.Yg.rf(G,_,g,b,C,O,F);else if(A.s.Cd(b))O!=null&&(O.u=_),F!=null&&(F.u=g);else if(C=A.F.ba(C),0>b&&(b=A.s.P(b),C=A.F.ba(C+3.141592653589793)),_=A.F.ba(_),g=A.F.ba(g),1.570796326794897C?A.F.Wq(he,J,N,Ee,0):A.F.Wq(he,N,J,Ee,0),N=Math.acos(Ee[2]/1),Ee=Math.atan2(-Ee[1],-Ee[0]),g=1-E,jt=1+(J=Math.tan(N))*J/g,g=(-(Ye=2*he[2]*J/g)+(J=Math.sqrt(Ye*Ye-4*jt*(he[2]*he[2]/g-1))))/(jt*=2),Ye=(-Ye-J)/jt,J=Math.tan(N),N=(g+Ye)/2,he=((jt=J*g+he[2])+(J*Ye+he[2]))/2,J=A.F.gp(g-N,jt-he),Xt=he/Xt*1.570796326794897,g=0;100>g&&(Ye=(Ye=A.F.w(E,Xt))*Ye/Math.cos(Xt)*(Math.sin(Xt)-he*Ye/(1-E)),!A.s.Cd(Ye));g++)Xt-=Ye;Xt=A.F.n(1,E,Xt)*Math.cos(Xt),he=1-J/(Xt=Math.sqrt((Xt-N)*(Xt+N))),he*=2-he,ee=Math.acos(A.F.St(ee,j)/(A.F.on(ee)*A.F.on(j))),ee*=A.s.Mb(1,j[0]),C=(A.F.q(Xt,he,A.F.Qj(he,ee))+G*A.s.Mb(1,C))/A.F.Ah(Xt,he),C=A.F.ba(1.570796326794897*C),C=A.F.Rq(he,C),A.F.n(Xt,he,C),J=A.F.ba(Ee+_),_=Math.cos(J),C=Math.sin(J),W[0]=q[0]*_+q[1]*-C,W[1]=q[0]*C+q[1]*_,W[2]=q[2],A.F.jO(E,W[0],W[1],W[2],Et,pt,De),O!=null&&(O.u=pt.u),F!=null&&(F.u=Et.u)}},ue}()}(ye||(ye={})),function(A){var ue=function(){function b(C){this.Ya=null,this.wt=new A.h,this.xt=new A.h,this.g=C}return b.prototype.compare=function(C,O,F){return this.g.Gc(O,this.wt),this.g.Gc(C.ja(F),this.xt),this.wt.compare(this.xt)},b}(),G=function(){function b(C){this.Bf=new A.h,this.Dk=new A.h,this.g=C}return b.prototype.Dh=function(C){this.Bf.L(C)},b.prototype.compare=function(C,O){return this.g.Gc(C.ja(O),this.Dk),this.Bf.compare(this.Dk)},b}(),E=function(b){function C(O){var F=b.call(this,O.g,O.qa,!1)||this;return F.ib=O,F}return me(C,b),C.prototype.compare=function(O,F,N){if(this.rg)return-1;var j=this.ib.Qd.Jn(this.ib.Rh(F));O=O.ja(N);var W=this.ib.Qd.Jn(this.ib.Rh(O));return this.Dm=N,this.RE(F,j,O,W)},C}(A.UC),_=function(b){function C(O){var F=b.call(this,O.g,O.qa)||this;return F.ib=O,F}return me(C,b),C.prototype.compare=function(O,F){return this.rg?-1:(O=this.ib.Qd.Jn(this.ib.Rh(O.ja(F))),this.Dm=F,this.SE(F,O))},C}(A.aM),g=function(){function b(){this.Mc=this.df=this.jo=this.Qd=this.lh=this.zd=this.hb=this.g=null,this.Ng=!1,this.vh=this.Nm=this.ie=this.Gk=this.nh=this.Ak=this.Ff=this.$d=null,this.xh=this.Jq=this.UA=this.qa=0,this.Xv=this.Wn=!1,this.yo=new A.h,this.Pi=new A.h,this.hb=new A.$c(8),this.zd=new A.$c(5),this.lh=new A.au,this.Qd=new A.au,this.Ng=!1,this.vh=new A.h,this.vh.ma(0,0),this.qa=0,this.xh=-1,this.Wn=!1,this.g=null,this.df=new A.Yj,this.Mc=new A.Yj,this.nh=new A.ia(0),this.Gk=new A.TC,this.Ff=new A.ia(0),this.Ak=new A.ia(0),this.jo=new A.Sa}return b.prototype.PX=function(C,O){var F=new A.Dd;return F.$B(),C.Oc(F),this.er(C),this.Wn=!1,this.qa=O,this.UA=O*O,O=this.jC(),C.Oc(F),O||(this.qQ(),O||this.jC()),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null,this.Wn},b.prototype.TX=function(C,O){this.er(C),this.Wn=!1,this.qa=O,this.UA=O*O,this.Ng=!1,this.jC(),this.Ng||(this.Ng=C.Gp(O,!0,!1)==1),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null},b.prototype.pg=function(C,O){return this.hb.T(C,0+O)},b.prototype.LB=function(C,O,F){this.hb.S(C,0+O,F)},b.prototype.Rh=function(C){return this.hb.T(C,2)},b.prototype.ZW=function(C,O){this.hb.S(C,2,O)},b.prototype.RF=function(C,O){return this.hb.T(C,3+O)},b.prototype.Pp=function(C){return this.hb.T(C,7)},b.prototype.Pl=function(C,O){this.hb.S(C,7,O)},b.prototype.Rp=function(C,O){return this.hb.T(C,3+this.Op(C,O))},b.prototype.fr=function(C,O,F){this.hb.S(C,3+this.Op(C,O),F)},b.prototype.NR=function(C,O){return this.hb.T(C,5+this.Op(C,O))},b.prototype.hr=function(C,O,F){this.hb.S(C,5+this.Op(C,O),F)},b.prototype.Sr=function(C){return this.zd.T(C,0)},b.prototype.UW=function(C,O){this.zd.S(C,0,O)},b.prototype.ez=function(C){return this.zd.T(C,4)},b.prototype.cr=function(C,O){this.zd.S(C,4,O)},b.prototype.il=function(C){return this.zd.T(C,1)},b.prototype.ln=function(C,O){this.zd.S(C,1,O)},b.prototype.dz=function(C){return this.zd.T(C,3)},b.prototype.Et=function(C,O){this.zd.S(C,3,O)},b.prototype.Ym=function(C){var O=this.zd.Ce(),F=this.lh.Ph();return this.UW(O,F),C!=-1?(this.lh.addElement(F,C),this.g.Ra(C,this.xh,O),this.cr(O,this.g.Ua(C))):this.cr(O,-1),O},b.prototype.HP=function(C){this.zd.jd(C)},b.prototype.LD=function(C,O){this.lh.addElement(this.Sr(C),O),this.g.Ra(O,this.xh,C)},b.prototype.nt=function(C){var O=this.hb.Ce(),F=this.Qd.Ph();return this.ZW(O,F),C!=-1&&this.Qd.addElement(F,C),O},b.prototype.MD=function(C,O){this.Qd.addElement(this.Rh(C),O)},b.prototype.Uu=function(C){this.hb.jd(C),0<=(C=this.nh.lF(C))&&this.nh.SV(C)},b.prototype.hj=function(C,O){if(this.pg(C,0)==-1)this.LB(C,0,O);else{if(this.pg(C,1)!=-1)throw A.i.Qa();this.LB(C,1,O)}this.ky(C,O)},b.prototype.ky=function(C,O){var F=this.il(O);if(F!=-1){var N=this.Rp(F,O);this.hr(N,O,C),this.fr(C,O,N),this.fr(F,O,C),this.hr(C,O,F)}else this.hr(C,O,C),this.fr(C,O,C),this.ln(O,C)},b.prototype.Op=function(C,O){return this.pg(C,0)==O?0:1},b.prototype.Xm=function(C,O){var F,N=this.dz(O);if(N!=-1&&(this.df.vd(N,-1),this.Et(O,-1)),(N=this.il(O))!=-1){var j=F=N;do{var W=!1,q=this.Op(F,O),J=this.RF(F,q);if(this.pg(F,q+1&1)==C){if(this.Xu(F),this.Qd.bh(this.Rh(F)),this.Uu(F),F==J){N=-1;break}N==F&&(N=this.il(O),j=J,W=!0)}F=J}while(F!=j||W);if(N!=-1){do q=this.Op(F,O),J=this.RF(F,q),this.LB(F,q,C),F=J;while(F!=j);(F=this.il(C))!=-1?(j=this.Rp(F,C),W=this.Rp(N,C),j==F?(this.ln(C,N),this.ky(F,C),this.ln(C,F)):W==N&&this.ky(N,C),this.fr(N,C,j),this.hr(j,C,N),this.fr(F,C,W),this.hr(W,C,F)):this.ln(C,N)}}for(N=this.Sr(C),F=this.Sr(O),j=this.lh.rc(F);j!=-1;j=this.lh.lb(j))this.g.Ra(this.lh.ja(j),this.xh,C);this.lh.Hy(N,F),this.HP(O)},b.prototype.UT=function(C,O){var F=this.pg(C,0),N=this.pg(C,1),j=this.pg(O,0),W=this.pg(O,1);this.Qd.Hy(this.Rh(C),this.Rh(O)),O==this.il(F)&&this.ln(F,C),O==this.il(N)&&this.ln(N,C),this.Xu(O),this.Uu(O),F==j&&N==W||N==j&&F==W||(this.Hn(F,this.yo),this.Hn(j,this.Pi),this.yo.qb(this.Pi)?(F!=j&&this.Xm(F,j),N!=W&&this.Xm(N,W)):(N!=j&&this.Xm(N,j),F!=W&&this.Xm(F,W)))},b.prototype.Xu=function(C){var O=this.pg(C,1);this.dF(C,this.pg(C,0)),this.dF(C,O)},b.prototype.dF=function(C,O){var F=this.Rp(C,O),N=this.NR(C,O),j=this.il(O);F!=C?(this.fr(N,O,F),this.hr(F,O,N),j==C&&this.ln(O,F)):this.ln(O,-1)},b.prototype.WD=function(C,O,F){var N=this.Qd.rc(C),j=this.Qd.ja(N);C=this.Le(j);var W=this.Le(this.g.U(j));for(this.g.jr(j,O,F,!0),N=this.Qd.lb(N);N!=-1;N=this.Qd.lb(N)){j=this.Qd.ja(N);var q=this.Le(j)==C;this.g.jr(j,O,F,q)}N=O.Vp(F,0).ac(),O=O.Vp(F,O.ol(F)-1).wc(),this.BK(C,N),this.BK(W,O)},b.prototype.ZE=function(C,O,F){var N=this.Rh(C),j=this.pg(C,0),W=this.pg(C,1),q=this.nt(-1);for(this.nh.add(q),this.Pl(q,-3),this.Ff.add(q),this.hj(q,j),C=1,O=O.ol(F);Cthis.ez(q)&&this.cr(q,this.g.Ua(W))),q=this.Ff.get(C),C-=2,this.MD(q,W),W=this.g.U(W);while(0<=C)}this.Ff.clear(!1)},b.prototype.Le=function(C){return this.g.Pa(C,this.xh)},b.prototype.TI=function(C,O,F){var N=this.pg(O,0),j=new A.h;this.Hn(N,j);var W=new A.h,q=this.pg(O,1);this.Hn(q,W);var J=F.ol(C),ee=F.Vp(C,0),he=new A.h;if(ee.Yp(he),!j.qb(he)){if(!this.Ng){var Ee=j.compare(this.vh);0>Ee*(he=he.compare(this.vh))&&(this.Ng=!0)}this.vF(N,this.Ff),this.Ak.add(N)}for(!this.Ng&&1ee.compare(this.vh))&&(this.Ng=!0)),C=(ee=F.Vp(C,J-1)).wc(),W.qb(C)||(this.Ng||0>(Ee=W.compare(this.vh))*(he=C.compare(this.vh))&&(this.Ng=!0),this.vF(q,this.Ff),this.Ak.add(q)),this.Ff.add(O),W=0,q=this.Ff.size;WMath.max(100,this.g.fd)){this.nh.clear(!1),this.Ng=!0;break}var C=this.nh.Fc();this.nh.If(),this.Pl(C,-1),this.WS(C)!=-1&&this.wS(C),this.Vn=!1}},b.prototype.wS=function(C){if(this.Vn){var O=this.Mc.zu(this.MH,this.GH,C,!0);this.Vn=!1}else O=this.Mc.KD(C);O==-1?this.UT(this.Mc.ja(this.Mc.FF()),C):(this.Pl(C,O),this.$d.rg&&(this.$d.Kr(),this.oF(this.$d.Dm,O)))},b.prototype.WS=function(C){var O=this.pg(C,0);if(C=this.pg(C,1),this.Hn(O,this.yo),this.Hn(C,this.Pi),A.h.yc(this.yo,this.Pi)<=this.UA)return this.Ng=!0,-1;var F=this.yo.compare(this.vh),N=this.Pi.compare(this.vh);return 0>=F&&0=N&&0C&&(this.re(_),C=this.description.Pf(_)),this.ka==null&&this.un(),this.ka[this.description.$j(C)+g]=b},E.prototype.getType=function(){return 33},E.prototype.Db=function(){return 0},E.prototype.Oa=function(){this.vc(),this.ka!=null&&(this.ka[0]=NaN,this.ka[1]=NaN)},E.prototype.sn=function(_){if(this.ka!=null){for(var g=A.ee.Iw(_,this.description),b=[],C=0,O=0,F=_.Aa;O>>32),_=A.O.Th(C,_)}return _},E.prototype.mg=function(){return null},E}(A.aa);A.Sa=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){E!==void 0&&(this.x=E,this.y=_,this.z=g)}return G.construct=function(E,_,g){var b=new G;return b.x=E,b.y=_,b.z=g,b},G.prototype.K=function(E,_,g){this.x=E,this.y=_,this.z=g},G.prototype.lx=function(){this.z=this.y=this.x=0},G.prototype.normalize=function(){var E=this.length();E==0&&(this.x/=E,this.y/=E,this.z/=E)},G.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},G.prototype.sub=function(E){return new G(this.x-E.x,this.y-E.y,this.z-E.z)},G.prototype.Ag=function(E){new G(this.x*E,this.y*E,this.z*E)},G.prototype.Qh=function(E){return this.x*E.x+this.y*E.y+this.z*E.z},G}();A.Nd=ue}(ye||(ye={})),function(A){var ue=function(){function G(E,_,g){this.Gw=this.DA=null,this.Xf=_,this.FT=_.y-g,this.ET=_.y+g,this.Ew=0,this.dA=E,this.qa=g,this.RT=g*g,this.eA=g!=0,this.Lv=!1}return G.prototype.result=function(){return this.Ew!=0?1:0},G.prototype.ZM=function(E){return E=E.hc(E.fe(this.Xf,!1)),A.h.yc(E,this.Xf)<=this.RT},G.prototype.fF=function(E){if(!this.eA&&(this.dA&&this.Xf.qb(E.ac())||this.Xf.qb(E.wc())))this.Lv=!0;else if(E.na==this.Xf.y&&E.na==E.la){if(this.dA&&!this.eA){var _=Math.max(E.sa,E.pa);this.Xf.x>Math.min(E.sa,E.pa)&&this.Xf.x<_&&(this.Lv=!0)}}else{var g=!1;if(_=Math.max(E.sa,E.pa),this.Xf.x>_?g=!0:this.Xf.x>=Math.min(E.sa,E.pa)&&(g=0E.wc().y?1:-1)}}},G.prototype.SI=function(E){var _=E.Tg(0,1);if(_.oa>this.ET||_.vathis.Xf.y||_.va(E=E.I()))&&2*E+Math.log(E)/Math.log(2)*_<1*E*_},G}();A.Dg=ue}(ye||(ye={})),function(A){var ue=function(G){function E(_){return G.call(this,!0,_)||this}return me(E,G),E.prototype.Ia=function(){return new E(this.description)},E.prototype.Db=function(){return 2},E.prototype.getType=function(){return 1736},E.prototype.xG=function(_,g,b){this.JS(_,g,b)},E.prototype.qR=function(){this.FR()},E}(A.Vk);A.Da=ue}(ye||(ye={})),function(A){(function(ue){ue[ue.PiPOutside=0]="PiPOutside",ue[ue.PiPInside=1]="PiPInside",ue[ue.PiPBoundary=2]="PiPBoundary"})(A.RL||(A.RL={})),A.hd=function(){function ue(){}return ue.KG=function(G,E,_){return(G=A.Dg.bT(G,E,_))==0?0:G==1?1:2},ue.Yd=function(G,E,_){return(G=A.Dg.wm(G,E,_))==0?0:G==1?1:2},ue.WX=function(G,E,_,g,b){if(E.length<_||b.length<_)throw A.i.N();for(var C=0;C<_;C++)b[C]=ue.Yd(G,E[C],g)},ue.sK=function(G,E,_,g,b){if(G.getType()==1736)ue.WX(G,E,_,g,b);else{if(G.getType()!=197)throw A.i.fa("invalid_call");var C=new A.l;G.A(C),ue.$M(C,E,_,g,b)}},ue.$M=function(G,E,_,g,b){if(E.length<_||b.length<_)throw A.i.N();if(G.B())for(g=0;g<_;g++)b[g]=0;else for(G.W(.5*-g,.5*-g),G.W(.5*g,.5*g),g=0;g<_;g++)G.contains(E[g])?b[g]=1:G.contains(E[g])?b[g]=2:b[g]=0},ue.YX=function(G,E,_,g,b){for(var C=0;C<_;C++)b[C]=G.qs(E[C],g)?2:0},ue.XX=function(G,E,_,g,b){var C=G.Bb,O=null;C!=null&&(O=C.Fk),C=_;for(var F=0;F<_;F++)if(b[F]=1,O!=null){var N=E[F];O.So(N.x,N.y)==0&&(b[F]=0,C--)}if(C!=0)for(G=G.Ga();G.$a()&&C!=0;)for(;G.Ha()&&C!=0;)for(O=G.ha(),F=0;F<_&&C!=0;F++)b[F]==1&&O.qs(E[F],g)&&(b[F]=2,C--);for(F=0;F<_;F++)b[F]==1&&(b[F]=0)},ue.tK=function(G,E,_,g,b){var C=G.getType();if(C==1607)ue.XX(G,E,_,g,b);else{if(!A.aa.yd(C))throw A.i.fa("Invalid call.");ue.YX(G,E,_,g,b)}},ue}()}(ye||(ye={})),function(A){var ue=function(G){function E(_,g){if(arguments.length==2){var b=G.call(this,!1,_.description)||this;b.nf(_),b.lineTo(g)}else b=G.call(this,!1,_)||this;return b}return me(E,G),E.prototype.Ia=function(){return new E(this.description)},E.prototype.Db=function(){return 1},E.prototype.getType=function(){return 1607},E.prototype.xG=function(_,g,b){this.KS(_,g,b)},E}(A.Vk);A.Ta=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.prototype.progress=function(){return!0},G.zp=function(E){if(E!=null&&!E.progress(-1,-1))throw A.i.WC()},G}();A.mp=ue}(ye||(ye={})),function(A){var ue;(ue=A.PK||(A.PK={}))[ue.clipWithInputHorizon=1]="clipWithInputHorizon",ue[ue.clipWithOutputHorizon=2]="clipWithOutputHorizon";var G=function(){function g(){this.Kg=3,this.Vu=this.Jr=NaN}return g.prototype.PW=function(b){this.QB(1,b)},g.prototype.QW=function(b){this.QB(2,b)},g.prototype.hS=function(){return this.hs(1)},g.prototype.iS=function(){return this.hs(2)},g.prototype.QB=function(b,C){this.Kg=C?this.Kg|b:this.Kg&~b},g.prototype.hs=function(b){return(this.Kg&b)!=0},g.prototype.Of=function(){var b=new g;return b.Jr=this.Jr,b.Vu=this.Vu,b.Kg=this.Kg,b},g}();A.yC=G,function(g){g[g.Dont_Geonomalize_Polygon=2147483648]="Dont_Geonomalize_Polygon",g[g.Dont_Adjust_At_Poles=1073741824]="Dont_Adjust_At_Poles"}(A.QK||(A.QK={}));var E=function(){function g(){this.Kg=0}return g.prototype.QB=function(b,C){this.Kg=C?this.Kg|b:this.Kg&~b},g.prototype.hs=function(b){return(this.Kg&b)!=0},g.jg=function(b){var C=new g;return C.Kg=b.Kg,C},g.prototype.mM=function(b){this.Kg=b.Kg},g}();A.AY=E;var _=function(){function g(b,C,O){this.ef=b,this.Yf=C,this.Uf=new A.l,this.Uf.K(O),this.AT=b.cc()+C.cc()+this.Uf.cc().toString()}return g.prototype.cc=function(){return this.AT},g.prototype.Nb=function(b){return this==b||this.ef.Nb(b.ef)&&this.Yf.Nb(b.Yf)&&this.Uf.Nb(b.Uf)},g}();A.FY=_,_=function(){function g(){this.Yf=this.ef=null,this.rH=new G,this.sH=new E,this.ww=this.Wf=null,this.mw=this.Tn=!0}return g.Nr=function(b,C,O,F){var N;F===void 0&&(F=null),N===void 0&&(N=null);var j=new g;return j.qp(b,C,O,F,N),j},g.prototype.qp=function(b,C,O,F,N){if(b==null||C==null)throw A.i.fa("invalidArgument");if(this.ef=b,this.Yf=C,this.mw=this.Tn=!1,F!=null&&(this.rH=F.Of()),N!=null&&this.sH.mM(N),N=!1,C.Sb()==1&&F!=null&&(F=F.Jr,isNaN(F)||F==0||(N=!0)),b==C)this.Tn=!N,this.mw=!0;else{F=b.Sb();var j=C.Sb();if(F==0||j==0){if(O!=null)throw A.i.N();b.Hd()!=null&&C.Hd()!=null&&(this.Tn=b.Hd().Nb(C.Hd()))}else F==3||j==3?this.Tn=b.Nb(C):this.ef.kS(this.Yf)?this.Tn=!N:this.Tn=!1,this.Wf=O,this.Wf!=null&&this.Wf.ix(),this.mw=(this.Wf==null||this.Wf.count()==0)&&this.ef.sc().Nb(this.Yf.sc())}this.oY()},g.prototype.isIdentity=function(){return this.Tn},g.prototype.nR=function(){return this.rH.Of()},g.prototype.Nb=function(b){return b==this||!!(b instanceof g&&this.ef.Nb(b.ef)&&this.Yf.Nb(b.Yf))&&(this.Wf==b.Wf||!(this.Wf==null||b.Wf==null||!this.Wf.Nb(b.Wf)))},g.prototype.oY=function(){this.ww=new A.bu(this)},g}(),A.vr=_}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.Cp=function(E){return E*G.oW},G.mx=function(E,_){return G.gP(_-E)},G.hP=function(E){return-360<=E&&720>E?(0>E?E+=360:360<=E&&(E-=360),E):(0>(E=A.lc.RK(E))&&(E+=360),E)},G.gP=function(E){return 180<(E=G.hP(E))&&(E-=360),E},G.oW=57.29577951308232,G}();A.qr=ue,A.Hh=function(){function G(){}return G.lj=function(E,_){var g=new A.l;E.A(g);var b=A.cb.gh(_),C=new A.l;return C.K(b),C.v=g.v,C.C=g.C,C.W(.01*C.ca(),0),_=A.ta.Wd(_,g,!1),C.contains(g)?E:A.Ud.clip(E,C,_,0)},G.ks=function(E,_,g,b,C){if(!A.cb.Wc(_))throw A.i.N();var O=A.ta.kj(_,E,!1),F=A.cb.gh(_),N=A.cb.sc(_),j=N.Hd().ai,W=A.cb.vv(N);N=A.cb.ev(N),W*=2-W;var q=new A.Nc;F.cn(q);var J=[[0,0],[0,0]];if(A.Eg.Sb(_)==2?b?(J[0][0]=G.Zm(C,q),J[0][1]=F.Jp(),A.cb.vt(),F=J[0][0]*j):(J[0][0]=F.gk(),J[0][1]=C,A.cb.vt(),F=J[0][1]*j):F=C*j,!b&&F!=0)throw A.i.N();var ee=new A.ga,he=new A.gd;E=he.Ib(E);for(var Ee=[0],De=new A.h,pt=new A.h,Et=new A.h,Ye=new A.h,jt=new A.h,ei=new A.h,Xt=he.Ob(E);Xt!=-1;Xt=he.Rb(Xt)){var wi=he.Xa(Xt);he.D(wi,Et);for(var pi=!1,Ri=wi=he.U(wi);Ri!=-1;Ri=he.U(Ri)){if(Ri==wi){if(pi)break;pi=!0}if(he.D(Ri,Ye),b&&OO||OO||!b&&O<-Et.y&&Ye.y>O||O<-Ye.y&&Et.y>O)do if(!(Math.abs(Et.x-Ye.x)>=.5*q.R())){if(A.Eg.Sb(_)==2?(J[0][0]=G.Zm(Et.x,q),J[0][1]=Et.y,J[1][0]=G.Zm(Ye.x,q),J[1][1]=Ye.y,A.cb.dW(),jt.x=J[0][0]*j,jt.y=J[0][1]*j,ei.x=J[1][0]*j,ei.y=J[1][1]*j):(jt.x=Et.x*j,jt.y=Et.y*j,ei.x=Ye.x*j,ei.y=Ye.y*j),ei.x=6.283185307179586*(Ye.x-Et.x)/q.R()+jt.x,b){if(pt.x=F,pt.y=G.Nz(N,W,jt,ei,F,g),isNaN(pt.y))break}else{if(pt.x=G.Lz(N,W,jt,ei,g),isNaN(pt.x))break;pt.y=0}A.kb.wd(N,W,jt.x,jt.y,ei.x,ei.y,ee,null,null,g);var Ui=ee.u;A.kb.wd(N,W,jt.x,jt.y,pt.x,pt.y,ee,null,null,g);var Bi=ee.u;A.Eg.Sb(_)==2?(J[0][0]=pt.x/j,J[0][1]=pt.y/j,A.cb.bR(),b?(De.y=J[0][1],De.x=C):(De.x=G.os(J[0][0],Et.x,Ye.x,q),De.y=C)):b?(De.x=C,De.y=pt.y/j):(De.x=G.os(pt.x/j,Et.x,Ye.x,q),De.y=C),Ee[0]=0b.x)var F=b;else F=g,g=b;b=new A.ga(0);var N=new A.ga(0),j=new A.ga(0);A.kb.wd(E,_,F.x,F.y,g.x,g.y,N,b,null,O);var W=N.u,q=0,J=1,ee=new A.h;for(ee.L(F);W*(J-q)>1e-12*E;){var he=.5*(q+J);if(A.kb.oj(E,_,F.x,F.y,W*he,b.u,N,j,O),ee.x=N.u,ee.y=j.u,ee.x==C)break;if(G.Sn(F.x,ee.x,C))J=he;else{if(!G.Sn(g.x,ee.x,C))return NaN;q=he}}return ee.y},G.Sn=function(E,_,g){return E=ue.Cp(E),_=ue.mx(E,ue.Cp(_)),(g=ue.mx(E,ue.Cp(g)))==0||0<_&&0_&&0>g&&g>=_},G.Zm=function(E,_){var g=_.va-_.oa;return _.It(E-Math.floor((E-_.oa)/g)*g)},G.os=function(E,_,g,b){var C=new A.Nc;for(C.K(_,g),g=b.R(),E=Math.floor((E-_)/g)*g+E,C=C.sf();Math.abs(E-C)>Math.abs(E+g-C);)E+=g;return E},G.Lz=function(E,_,g,b,C){if(g.y>b.y)var O=b;else O=g,g=b;if((b=new A.Nc).K(O.y,g.y),!b.contains(0)||3.141592653589793<=Math.abs(O.x-g.x))return NaN;if(O.x==g.x)return O.x;var F=new A.ga(0),N=new A.ga(0),j=new A.ga(0);A.kb.wd(E,_,O.x,O.y,g.x,g.y,N,F,null,C);var W=N.u,q=0,J=1,ee=new A.h;for(ee.L(O);W*(J-q)>1e-12*E;){var he=.5*(q+J);if(A.kb.oj(E,_,O.x,O.y,W*he,F.u,N,j,C),ee.x=N.u,ee.y=j.u,b.K(O.y,ee.y),ee.y==0)break;if(b.contains(0))J=he;else{if(b.K(g.y,ee.y),!b.contains(0))return NaN;q=he}}return ee.x},G.Hp=function(E,_,g,b,C,O,F){var N=new A.l;if(E.A(N),N.B())return E;var j=new A.Nc;N.cn(j);var W=new A.Nc;if(W.K(_,_+g),W.contains(j)&&W.va!=j.va)return E;var q=new A.l;q.K(N);var J=E.getType();if(J==33)return((N=(q=C?E:E.Of()).Lg())=W.va||F&&N==W.va)&&(N+=Math.ceil((W.oa-N)/g)*g,N=W.It(N),q.cC(N)),q;if(J==550){for(b=(q=C?E:E.Of()).ub(0),J=2*q.I(),E=!1,C=0;C=W.va||F&&N==W.va)&&(E=!0,N+=Math.ceil((W.oa-N)/g)*g,N=W.It(N),b.write(C,N));return E&&q.Pc(1993),q}if(W.contains(j))return E;if(J==197)return g=C?E:E.Of(),N.Ea(q),g.Xo(N),g;var ee=.1*Math.max(N.ca(),N.R());for(q.W(0,ee),F=E,W=b.Xd(0),E=A.Gh.local(),C=new A.Dd;;){var he=Math.floor((j.oa-_)/g),Ee=Math.ceil((j.va-_)/g);if(!(3q.v;)(ee=A.Ud.clip(F,q,W,0)).A(j),(J==1607?!ee.B()&&(j.R()>W||j.ca()>W):!ee.B()&&(J!=1736||j.R()>W))&&(ee.Oc(C),ee.A(j),_.A(O),O.W(W,W),O.isIntersecting(j)&&J==1736?_=E.V(_,ee,b,null):_.add(ee,!1)),q.move(g,0),C.shift(-g,0);return _},G.WI=function(E,_,g,b){var C=new A.de(g.description);C.Fd(g,0,-1),C=A.cb.zh(C,E,_);var O=g.I();if(b.Oa(),!A.cb.Wc(E)||O!=C.I())return!1;var F=new A.l;g.A(F);var N=new A.l;if(C.A(N),F=F.R(),N=N.R(),F!=0&&N!=0){if(N/=F,E=A.cb.gh(_).R()/A.cb.gh(E).R(),1e-10=g[C]?b[C]=g[C].toUpperCase():g[C];return b.join()}return g.toString(A.Sc.PE_STR_AUTH_TOP)},_.ur=function(g,b,C,O){var F=O.length,N=C.I();if(N!=0){var j=C.ub(0),W=Math.min(N,F),q=0,J=g.eh();isNaN(b)&&(b=0);for(var ee=g.Wc(),he=179*(g=ee?g.sc().Oe().R():0)/360;0pt*A.lc.sign(Et)&&Math.abs(De)>he&&(O[Ee][0]+=-pt*g)}j.uC(q<<1,W,O),q+=W,N-=W,W=Math.min(N,F)}C.Pc(1993)}},_.IL=function(g,b,C,O){var F=0,N=g.eh();isNaN(F)&&(F=0);var j=g.Wc(),W=g.bf();g=360*W,W*=179;for(var q=O.length,J=0;JEt*A.lc.sign(De)&&Math.abs(pt)>W&&(O[ee][0]-=Et*g)}A.ta.Iy(b,J,O,he),J+=he}}},_.Lx=function(g,b,C){var O=C.length,F=b.I();if(!(1>F)){var N=b.ub(0),j=Math.min(F,O),W=0,q=g.eh(),J=g.Wc(),ee=J?g.Oe().R():0,he=179*ee/360,Ee=0;for(J&&(Ee=g.zi());0pt*A.lc.sign(Et)&&Math.abs(De)>he&&(C[g][0]+=-pt*ee)}N.uC(W<<1,j,C),W+=j,F-=j,j=Math.min(F,O)}b.Pc(1993)}},_.HL=function(g,b,C,O){if(C!=0){var F=g.eh(),N=g.Wc(),j=N?g.Oe().R():0,W=179*j/360,q=0;for(N&&(q=g.zi()),g=0;gDe*A.lc.sign(b[he].x-q)&&Math.abs(Ee)>W&&(O[J][0]-=De*j)}A.ta.Iy(b,g,O,ee),g+=ee}}}},_.tr=function(g,b,C,O){var F=b.I();if(F!=0){var N=b.ub(0),j=g.ef,W=g.Yf,q=j.sc().Qp(),J=W.sc().Qp(),ee=j.bf(),he=W.bf();if((g=g.Wf)==null||g.count()==0){for(C=q/J,O=(j.Up()-W.Up())*he,J=-90*ee,g=90*ee,q=!1,he=1,j=2*F;heYe?O[he][1]=Ye:O[he][1]<-Ye&&(O[he][1]=-Ye));for(ee=0;eehe){if(Xt){var Cn=Ri+(Mn+11*ee&&(Xt=!1)}Xt||(Un=Pt+(mi-=A.lc.Cn(J,Un-ar)),++z,Dt=mi!=0,yn.x=Un)}else Wi||A.ta.AG(ds,Fr,yn,pi)&&(Wi=!0);Dt&&Ui.write(2*Mn,Un),ar=Un,ds.L(Fr),Fr.L(yn)}0g?j=1:0>=W&&0.99*W&&(j=-1)):j=-1),j!=0&&((b=new A.Da(F.description)).tp(q),(b=A.Xl.local().V(b,C,N)).add(F,!1),Ye=!0,F=b),Ye&&(F=A.Yl.local().V(F,O,!1,N)),F},_.vQ=function(g,b,C,O,F){var N=C.I(),j=C.Na(0),W=C.Na(N-1);F=(O=_.dv(O,F)).R(),j=A.lc.sign(W.x-j.x);var q=new A.l;C.xc(q);var J=O.gk();if(W=J-F,J+=F,0<=j){var ee=Math.ceil((W-q.v)/F);for(ee*=F;W>q.v+ee;)ee+=F;for(;Wq.v+ee;)ee+=F;he=ee,720W;)1024<=Et&&(Et=0),Ee.move(ee,0),De.Gb=ee,C.Oc(De),pt+=ee,O.v<=pt&&O.C>=pt&&(F=q.I()-1),C.Cb(0,he),he=C.Na(N-1),q.Dr(C,0,0,N-1,!1);return C=new A.Da(q.description),N=0j?N:!N)?(j=A.h.construct(W.x,O.H),C.Ci(j),j=A.h.construct(O.gk(),O.H),C.Ci(j),O=A.h.construct(g.x,O.H)):(j=A.h.construct(W.x,O.G),C.Ci(j),j=A.h.construct(O.gk(),O.G),C.Ci(j),O=A.h.construct(g.x,O.G)),C.Ci(O),C.xG(0,b,0),C.kO(F),C},_.uQ=function(g,b,C,O,F){var N=new A.Da(g.description);N.add(g,!1),N.DB(0,N.I()-1);var j=new A.l;N.xc(j);var W=(C=_.dv(b,C)).R(),q=Math.ceil((C.v-j.v)/W);for(q*=W;C.v>j.v+q;)q+=W;for(;C.vj.C)return F&&(F=N.Ke(),b=(N=A.Yl.local().V(N,b,!0,O)).Ke(),(b=A.lc.sign(F)!=A.lc.sign(b))&&N.oJ()),N;for((g=new A.Da(g.description)).add(N,!1),F=F||j.R()>W-b.Xd(0);j.v=C){W=!0;break}if(2&F&&J.y<=-C){W=!0;break}}if(!W)return!1;N=!1,g&&(N=b.Nn(0)),j=(g=new A.gd).Ib(b),W=g.Ob(j);var ee=-1,he=!0,Ee=new A.h;Ee.Rc(),q=new A.Sa;for(var De=-1,pt=g.Xa(W);pt!=-1;pt=g.U(pt)){J=g.Na(pt);var Et=1&F&&90<=J.y?1:0;if(Et|=2&F&&J.y<=-C?2:0,0W){if(new A.l().K(Ee.v-j,-W,Ee.C+j,W),(F=A.ri.Nu(F,b,g,NaN,0,O)).B())return F;F.A(Ee)}if(pt&&(b.HEe.H))return F.Ia();if(Ee.R()>J&&(F=_.Hp(F,ee-q,J,g,!0,0,!0,O)).A(Ee),(W=_.eO(Ee.v,Ee.C,b.v,b.C,J))!=0&&Ee.move(W,0),Ee.C>b.C||Ee.vb.C)for(;Ee.v>=b.C;)Ee.move(-J,0),W-=J;for(;Ee.vW;W++){if(Et?j=A.aa.Hc(N)?A.ri.clip(F,b,C,he,O):A.ri.clip(F,b,C,0,O):(j=A.Xj.local().V(F,De,g,O))==De&&(j=A.aa.jg(j)),b.v<=Ee.v&&b.C>=Ee.C||b.v>=Ee.v&&b.C<=Ee.C)return j;pt[W]=j,W==0&&(Ee.move(-J,0),(j=new A.Dd).gg(-J,0),F.Oc(j))}if(N==550)pt[0].Fd(pt[1],0,-1);else if(A.aa.Hc(N))pt[0].add(pt[1],!1);else{if(N!=33)throw A.i.fa("intersect_with_GCS_horizon: unexpected geometry type");pt[0].B()&&(pt[0]=pt[1])}return pt[0]}if(b.HEe.H)return F;for(N=0;!F.B()&&Ee.C>b.v;)N!=0&&((j=new A.Dd).gg(N,0),F.Oc(j)),A.dj.local().V(4,F,De,g,O)||De==(F=A.kp.local().V(F,De,g,O))&&(F=A.aa.jg(F)),N!=0&&((he=new A.Dd).gg(-N,0),F.Oc(he)),N-=J,Ee.move(-J,0);return F},_.yG=function(g,b,C,O){if(b!=0&&O!=ue.DontClip)if(O==ue.PannableFold){O=C.HR();for(var F=b,N=0;NO.H||g[N].yj||g[N].y<-j)&&(g[N].Rc(),F--);if(F!=0){(F=new A.l).Zw(g,b),j=C.Vr();var q=C.hv();N=j.getType()==197;var J=new A.l;if(j.A(J),!q||!(J.HF.H))if(q)if(_.av(g,b,J.gk()-W,O),F=b,N)for(N=0;N=J||j&&ee==J)&&(ee+=Math.ceil((b-ee)/C)*C,ee=A.O.Rk(ee,b,J),O.cC(ee)),O}if(g.B()||(ee=new A.l,g.A(ee),ee.B()))return g;var he=new A.Nc;ee.cn(he);var Ee=new A.Nc;if(Ee.K(b,J),Ee.contains(he))return g;if((J=new A.l).K(ee),q===550){for(W=(O=F?g:g.Of()).ub(0),q=2*O.I(),J=!1,b=0;b=Ee.va||j&&ee==Ee.va)&&(J=!0,ee+=Math.ceil((Ee.oa-ee)/C)*C,ee=Ee.It(ee),W.write(b,ee));return J&&O.Pc(1993),O}if(q==197)return C=F?g:g.Of(),ee.Ea(J),C.Xo(ee),C;var De=.1*Math.max(ee.ca(),ee.R());for(J.W(0,De),j=g,Ee=O.Xd(0),g=A.Gh.local(),F=new A.Dd;;){var pt=Math.floor((he.oa-b)/C),Et=Math.ceil((he.va-b)/C);if(!(3J.v;)(De=A.ri.clip(j,J,Ee,0,W)).A(he),(q==1607?!De.B()&&(he.R()>Ee||he.ca()>Ee):!De.B()&&(q!=1736||he.R()>Ee))&&(De.Oc(F),De.A(he),b.A(N),N.W(Ee,Ee),N.isIntersecting(he)&&q==1736?b=g.V(b,De,O,null):b.add(De,!1)),J.move(C,0),F.shift(-C,0);return b},_.av=function(g,b,C,O){for(var F=C+O,N=0;NF||j==F)||(j+=Math.ceil((C-j)/O)*O,j=A.O.Rk(j,C,F),g[N].x=j)}},_.Fn=function(g,b,C,O,F,N){if(!b.Wc())throw A.i.fa("fold_into_360_degree_range");if(g.B())return g;if(b.Sb()==2){C=b.pv();var j=b.ov()-C}else{var W=b.bf();j=360*W,C-=180*W}return _.Hp(g,C,j,b,O,F,!0,N)},_.qF=function(g,b,C,O){if(C.Sb()==2)O=C.pv(),C=C.ov()-O;else{var F=C.bf();C=360*F,O-=180*F}_.av(g,b,O,C)},_.lj=function(g,b){var C=b.Oe();if(g.getType()==33){var O=g.ih();return C.G<=O&&O<=C.H?g:g.Ia()}O=new A.l,g.A(O);var F=new A.l;return F.K(C),F.v=O.v,F.C=O.C,F.W(.01*F.ca(),0),C=A.ta.uy(b,O),F.contains(O)?g:A.ri.clip(g,F,C,0,null)},_.ir=function(g,b,C){return g>b.C&&g-b.CC.H?g[F].Rc():g[F].x=_.ir(g[F].x,C,O)},_.Jt=function(g,b,C,O){if(!g.B()){var F=g.getType();if(!O||F!=1736)if(A.aa.xj(F)){O=g.ub(0),F=0;for(var N=g.I();FO||OO)||!N&&(j!=0||O<-wi.y&&pi.y>O||O<-pi.y&&wi.y>O))do if(!(Math.abs(wi.x-pi.x)>=.5*he.R())){if(C.Sb()==2?(De[0][0]=_.Zm(wi.x,he),De[0][1]=wi.y,De[1][0]=_.Zm(pi.x,he),De[1][1]=pi.y,A.ej.projToGeogCenter(Ee,2,De,0),Ri.x=De[0][0]*q,Ri.y=De[0][1]*q,Ui.y=De[1][1]*q):(Ri.x=wi.x*q,Ri.y=wi.y*q,Ui.y=pi.y*q),Ui.x=2*(pi.x-wi.x)*Math.PI/he.R()+Ri.x,N){if(jt.x=W,jt.y=_.Nz(J,ee,Ri,Ui,W,F),isNaN(jt.y))break;Xt[0]=jt;var z=1}else if(F==E.GreatElliptic){var Wi=[0,0];if((z=A.Ox.Oz(ee,Ri,Ui,W,Wi))==0)break;jt.x=Wi[0],jt.y=W,Xt[0]=jt,z==2&&(ei.x=Wi[1],ei.y=W,Xt[1]=ei)}else{if(jt.x=_.Lz(J,ee,Ri,Ui,F),isNaN(jt.x))break;jt.y=0,Xt[0]=jt,z=1}var Fr=-1;for(Wi=0;WiEt[0]||(Fr=g.Ma(ar),g.Ul(Fr,Et,1),g.Cb(g.U(Fr),Ye.x,Ye.y),Fr=Et[0])}}while(!1);wi.L(pi)}}},_.Zm=function(g,b){var C=b.va-b.oa;return b.It(g-Math.floor((g-b.oa)/C)*C)},_.os=function(g,b,C,O){var F=new A.Nc;for(F.K(b,C),C=O.R(),g=Math.floor((g-b)/C)*C+g,F=F.sf();Math.abs(g-F)>Math.abs(g+C-F);)g+=C;return g},_.Sn=function(g,b,C){return g=A.qr.Cp(g),b=A.qr.mx(g,A.qr.Cp(b)),(C=A.qr.mx(g,A.qr.Cp(C)))==0||0b&&0>C&&C>=b},_.Nz=function(g,b,C,O,F,N){if(N==E.GreatElliptic)return A.Ox.SS(b,C,O,F);if(Math.abs(C.x-O.x)>=Math.PI||!_.Sn(C.x,O.x,F))return NaN;if(C.x>O.x)var j=O;else j=C,C=O;O=new A.ga;var W=new A.ga,q=new A.ga;A.kb.wd(g,b,j.x,j.y,C.x,C.y,W,O,null,N);var J=W.u,ee=0,he=1,Ee=new A.h;for(Ee.L(j);J*(he-ee)>1e-12*g;){var De=.5*(ee+he);if(A.kb.oj(g,b,j.x,j.y,J*De,O.u,W,q,N),Ee.x=W.u,Ee.y=q.u,Ee.x==F)break;if(_.Sn(j.x,Ee.x,F))he=De;else{if(!_.Sn(C.x,Ee.x,F))return NaN;ee=De}}return Ee.y},_.Lz=function(g,b,C,O,F){if(F==E.GreatElliptic)return g=[0,0],A.Ox.Oz(b,C,O,0,g),g[0];if(C.y>O.y)var N=O;else N=C,C=O;if((O=new A.Nc).K(N.y,C.y),!O.contains(0)||Math.abs(N.x-C.x)>=Math.PI)return NaN;if(N.x==C.x)return N.x;var j=new A.ga,W=new A.ga,q=new A.ga;A.kb.wd(g,b,N.x,N.y,C.x,C.y,W,j,null,F);var J=W.u,ee=0,he=1,Ee=new A.h;for(Ee.L(N);J*(he-ee)>1e-12*g;){var De=.5*(ee+he);if(A.kb.oj(g,b,N.x,N.y,J*De,j.u,W,q,F),Ee.x=W.u,Ee.y=q.u,O.K(N.y,Ee.y),Ee.y==0)break;if(O.contains(0))he=De;else{if(O.K(C.y,Ee.y),!O.contains(0))return NaN;ee=De}}return Ee.x},_.WI=function(g,b,C,O){if(!g.ef.Wc())return!1;var F=new A.de(b.description);if(F.Fd(b,0,-1),O=A.Hx.local().V(F,g,O),F=b.I(),C.Oa(),F!=O.I())return!1;var N=new A.l;b.A(N);var j=new A.l;if(O.A(j),N=N.R(),j=j.R(),N!=0&&j!=0){if(j/=N,g=g.Yf.gh().R()/g.ef.gh().R(),1e-10=180*b&&(g-=360*b),g},_.UI=function(g,b,C,O){if(C==ue.Clip){var F=b.ml();F.getType()==197?(C=new A.l,F.A(C),F=A.ta.uy(b,C),g=A.ri.clip(g,C,F,5e4*b.pm(),O)):A.dj.local().V(1,F,g,b,O)||(g=A.Xj.local().V(g,F,b,O))==F&&(g=A.Vk.jg(g))}else b.Wc()&&(O=new A.l,g.xc(O),b.Oe().contains(O)||(_.Jt(g,b.Oe(),b.Xd(0),!0),C==ue.PannableFold&&(g=_.lj(g,b)),g=_.Fn(g,b,0,!0,1e5*b.pm(),null)));return g},_.XD=function(g,b,C){var O=b.Wr();if(O==null)return g;var F=(b=b.sc()).Oe().R(),N=new A.l;g.xc(N);var j=new A.Nc;N.cn(j),N=O.Ga(),O=null;for(var W=new A.Dd;N.$a();)for(;N.Ha();){var q=N.ha(),J=q.Tg(0,0),ee=new A.Nc;for(ee.K(J.oa,J.va),J=0;ee.va>j.oa;)ee.move(-F),--J;for(;ee.oa<=j.va;){if(ee.isIntersecting(j)){O==null&&(O=new A.Ta);var he=A.yb.cP(q.ac(),q.wc());J!=0&&(W.gg(J*F,0),he.Oc(W)),O.oc(he,!0)}ee.move(F),++J}}return O!=null?(b=A.ta.gO(b,O),b=A.ta.Er(b),A.$t.lP(g,O,b,C)):g},_.eO=function(g,b,C,O,F){return g>=C&&b<=O?0:_.tE(.5*(b+g),C,O,F)},_.tE=function(g,b,C,O){return A.lc.round((.5*(C+b)-g)/O)*O},_.VQ=function(g,b,C,O,F,N,j,W){var q=_.dv(O,F),J=q.R(),ee=J/360,he=_.pE*ee,Ee=g.ub(0),De=b.Wc(),pt=De?J/b.Oe().R():0;b=g.Ia();for(var Et=0,Ye=C.da();Ethe){if(jt){var Qi=wi+Dt-1,Cn=wi;(!pi||Dt+11*ee&&(De=!1)}jt||(Pt=yn+(Ui-=A.lc.Cn(J,Pt-Bi)),++mi,ds=Ui!=0,Mn.x=Pt)}else z||A.ta.AG(Wi,Fr,Mn,ar)&&(z=!0);ds&&Ri.write(2*Dt,Pt),Bi=Pt,Wi.L(Fr),Fr.L(Mn)}mi!=0&&ei.Pc(1993),jt=ei.Na(0),Xt=ei.Na(Xt-1),A.h.tb(jt,Xt),ei=_.wQ(ei,O,isNaN(F)?0:F,N),b.add(ei,!1)}return g=O.Xd(0),C=q.R()/180,_.Jt(b,q,.1*g,!1),A.ri.clip(b,q,g,C,N)},_.wQ=function(g,b,C,O){return _.Fn(g,b,C,!0,0,O)},_.OS=function(g,b,C,O){var F=g.getType();if(F==1736)for(b=b!=null?b.Xd(0):0,F=0;FC)for(var F=new A.Sa,N=0;NC)for(var F=new A.Sa,N=0;Nthis.Io},E.prototype.fz=function(){if(this.B())throw A.i.fa("invalid call");return new A.Sa(this.Bs.x,this.Bs.y)},E.prototype.Ua=function(){if(this.B())throw A.i.fa("invalid call");return this.Io},E.prototype.hz=function(){if(this.B())throw A.i.fa("invalid call");return this.Ka},E.prototype.Sz=function(){return(1&this.nw)!=0},E.prototype.ey=function(_,g,b,C){this.Bs.x=_,this.Bs.y=g,this.Io=b,this.Ka=C},E}();A.$l=G}(ye||(ye={})),function(A){var ue=function(){function E(){}return E.prototype.Uo=function(_,g){if(this.th.resize(0),this.Ii.length=0,this.tk=-1,_.xc(this.Ek),this.Ek.W(g,g),this.Ek.isIntersecting(this.Fb.Ca)){var b=_.getType();(this.vs=A.aa.yd(b))?(this.TH=_.ac(),this.SH=_.wc(),this.qa=g):this.qa=NaN,this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf)}else this.Qs=-1},E.prototype.Xi=function(_,g){this.th.resize(0),this.Ii.length=0,this.tk=-1,this.Ek.K(_),this.Ek.W(g,g),this.qa=NaN,this.Ek.isIntersecting(this.Fb.Ca)?(this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf),this.vs=!1):this.Qs=-1},E.prototype.next=function(){if(this.th.size==0)return-1;this.tk=this.Qs;var _=null,g=null,b=null,C=null;this.vs&&(_=new A.h,g=new A.h,b=new A.l);for(var O=!1;!O;){for(;this.tk!=-1;){var F=this.Fb.bz(this.Fb.fv(this.tk));if(F.isIntersecting(this.Ek)){if(!this.vs){O=!0;break}if(_.L(this.TH),g.L(this.SH),b.K(F),b.W(this.qa,this.qa),0N;N++){var j=this.Fb.Lp(F,N);if(j!=-1&&0>C);O==0?(g.v=.5*(g.v+g.C),g.G=.5*(g.G+g.H)):O==1?(g.C=.5*(g.v+g.C),g.G=.5*(g.G+g.H)):(O==2?g.C=.5*(g.v+g.C):g.v=.5*(g.v+g.C),g.H=.5*(g.G+g.H))}return g},E.prototype.WR=function(_){return this.Az(_)},E.prototype.vR=function(_,g){return ue.bP(this,_,g)},E.prototype.MF=function(_,g){return ue.aP(this,_,g)},E.prototype.getIterator=function(){return ue.$O(this)},E.prototype.Nk=function(_,g){if(0>g||32<2*g)throw A.i.N("invalid height");this.BT=g,this.Ca.K(_),this.kf=this.jf.Ce(),this.jx(this.kf,0),this.ax(this.kf,0),this.NJ(this.kf,0),this.KJ(this.kf,0)},E.prototype.zv=function(_,g,b,C,O,F,N){if(!C.contains(g))return b==0?-1:this.zv(_,g,0,this.Ca,this.kf,F,N);if(!F)for(var j=O;j!=-1;j=this.IR(j))this.jx(j,this.Az(j)+1);(j=new A.l).K(C),C=O;var W=[];for(W[0]=new A.l,W[1]=new A.l,W[2]=new A.l,W[3]=new A.l;bJ;J++)if(W[J].contains(g)){q=!0;var ee=this.Lp(C,J);ee==-1&&(ee=this.rP(C,J)),this.jx(ee,this.Az(ee)+1),C=ee,j.K(W[J]);break}if(!q)break}return this.sS(_,g,b,j,C,F,O,N)},E.prototype.sS=function(_,g,b,C,O,F,N,j){var W=this.NF(O);if(F){if(O==N)return j;this.SP(j),F=j}else F=this.tP(),this.NB(F,_),this.KW(this.fv(F),g);return this.mX(F,O),W!=-1?(this.hx(F,W),this.bx(W,F)):this.GJ(O,F),this.SB(O,F),this.ax(O,this.lv(O)+1),this.hO(O)&&this.MQ(b,C,O),F},E.prototype.SP=function(_){var g=this.WF(_),b=this.NF(g),C=this.OR(_),O=this.nv(_);this.Ur(g)==_?(O!=-1?this.hx(O,-1):this.SB(g,-1),this.GJ(g,O)):b==_?(this.bx(C,-1),this.SB(g,C)):(this.hx(O,C),this.bx(C,O)),this.hx(_,-1),this.bx(_,-1),this.ax(g,this.lv(g)-1)},E.EJ=function(_,g){var b=.5*(_.v+_.C),C=.5*(_.G+_.H);g[0].K(b,C,_.C,_.H),g[1].K(_.v,C,b,_.H),g[2].K(_.v,_.G,b,C),g[3].K(b,_.G,_.C,C)},E.prototype.hO=function(_){return this.lv(_)==8&&!this.gG(_)},E.prototype.MQ=function(_,g,b){var C=this.Ur(b);do{var O=this.fv(C),F=this.Zh.T(C,0);O=this.bz(O),this.zv(F,O,_,g,b,!0,C),C=F=this.nv(C)}while(C!=-1)},E.prototype.iO=function(_){return 8<=this.lv(_)||this.gG(_)},E.prototype.gG=function(_){return this.Lp(_,0)!=-1||this.Lp(_,1)!=-1||this.Lp(_,2)!=-1||this.Lp(_,3)!=-1},E.prototype.rP=function(_,g){var b=this.jf.Ce();return this.OW(_,g,b),this.jx(b,0),this.ax(b,0),this.Pk(b,_),this.KJ(b,this.jv(_)+1),this.NJ(b,g<<2*this.jv(_)|this.QF(_)),b},E.prototype.tP=function(){var _=this.Zh.Ce();if(0>4)]|=this.iH<<2*(15&O)},_}();A.HY=G;var E=function(){function _(g,b,C){this.Vh=null,this.SA=this.Ik=this.cI=this.aI=this.Es=this.qH=this.Gf=this.Um=0,this.Ri=this.Jk=this.vl=null,this.Fz(g,b,C)}return _.create=function(g,b,C){if(!_.zE(g))throw A.i.N();return _.wP(g,b,C)},_.pW=function(g){switch(g){case 0:g=1024;break;case 1:g=16384;break;case 2:g=262144;break;default:throw A.i.fa("Internal Error")}return g},_.zE=function(g){return!(g.B()||g.getType()!=1607&&g.getType()!=1736)},_.prototype.rQ=function(g,b){b=b.Ga();for(var C=new A.h,O=new A.h;b.$a();)for(;b.Ha();){var F=b.ha();if(F.getType()!=322)throw A.i.fa("Internal Error");g.Eh(F.ac(),C),g.Eh(F.wc(),O),this.Ri.jy(C.x,C.y,O.x,O.y)}this.Ri.iJ(A.Px.Cx)},_.prototype.sQ=function(){throw A.i.fa("Internal Error")},_.prototype.Ry=function(g,b){for(var C=1;4>C;C++)g.jy(b[C-1].x,b[C-1].y,b[C].x,b[C].y);g.jy(b[3].x,b[3].y,b[0].x,b[0].y),this.Ri.iJ(A.Px.Cx)},_.prototype.rK=function(g,b,C){for(var O=[null,null,null,null],F=0;F(De=F.length());De==0?F.ma(1,0):(pt||ee.L(q),F.scale(C/De),N.ma(-F.y,F.x),j.ma(F.y,-F.x),W.sub(F),q.add(F),O[0].add(W,N),O[1].add(W,j),O[2].add(q,j),O[3].add(q,N),pt?he=!0:this.Ry(g,O))}else he&&(this.Ry(g,O),he=!1),Ee=!0}he&&this.Ry(g,O)}},_.prototype.sC=function(g){return A.O.truncate(g*this.qH+this.aI)},_.prototype.tC=function(g){return A.O.truncate(g*this.Es+this.cI)},_.wP=function(g,b,C){return new _(g,b,C)},_.prototype.Fz=function(g,b,C){this.Gf=Math.max(A.O.truncate(2*Math.sqrt(C)+.5),64),this.Um=A.O.truncate((2*this.Gf+31)/32),this.vl=new A.l,this.Ik=b,C=0;for(var O=this.Gf,F=this.Um;8<=O;)C+=O*F,O=A.O.truncate(O/2),F=A.O.truncate((2*O+31)/32);this.Vh=A.O.lg(C,0),this.Ri=new A.Px,C=new G(this.Vh,this.Um,this),this.Ri.AX(this.Gf,this.Gf,C),g.A(this.vl),this.vl.W(b,b),O=new A.l;var N=b*(F=A.l.construct(1,1,this.Gf-2,this.Gf-2)).R();switch(b*=F.ca(),O.K(this.vl.sf(),Math.max(N,this.vl.R()),Math.max(b,this.vl.ca())),this.SA=this.Ik,this.Jk=new A.Dd,this.Jk.pS(O,F),new A.Dd,g.getType()){case 550:C.setColor(this.Ri,2),this.sQ();break;case 1607:C.setColor(this.Ri,2),this.rK(this.Ri,g,this.SA);break;case 1736:C.setColor(this.Ri,1),this.rQ(this.Jk,g),C.setColor(this.Ri,2),this.rK(this.Ri,g,this.SA)}this.qH=this.Jk.bb,this.Es=this.Jk.ab,this.aI=this.Jk.Gb,this.cI=this.Jk.Lb,this.XN()},_.prototype.XN=function(){this.Ri.flush();for(var g=0,b=this.Gf*this.Um,C=this.Gf,O=A.O.truncate(this.Gf/2),F=this.Um,N=A.O.truncate((2*O+31)/32);8>4;J=2*(15&J);var Ee=ee>>4;ee=2*(15&ee);var De=this.Vh[g+F*j+he]>>J&3;De|=this.Vh[g+F*j+Ee]>>ee&3,De|=this.Vh[g+F*W+he]>>J&3,De|=this.Vh[g+F*W+Ee]>>ee&3,this.Vh[b+N*C+(q>>4)]|=De<<2*(15&q)}C=O,F=N,g=b,O=A.O.truncate(C/2),N=A.O.truncate((2*O+31)/32),b=g+F*C}},_.prototype.So=function(g,b){return this.vl.contains(g,b)?(g=this.sC(g),b=this.tC(b),0>g||g>=this.Gf||0>b||b>=this.Gf||(b=this.Vh[this.Um*b+(g>>4)]>>2*(15&g)&3)==0?0:b==1?1:2):0},_.prototype.Ro=function(g){if(!g.Ea(this.vl))return 0;var b=this.sC(g.v),C=this.sC(g.C),O=this.tC(g.G);if(g=this.tC(g.H),0>b&&(b=0),0>O&&(O=0),C>=this.Gf&&(C=this.Gf-1),g>=this.Gf&&(g=this.Gf-1),b>C||O>g)return 0;for(var F=Math.max(C-b,1)*Math.max(g-O,1),N=0,j=this.Um,W=this.Gf,q=0;;){if(32>F||16>W){for(F=O;F<=g;F++)for(var J=b;J<=C;J++)if(1<(q=this.Vh[N+j*F+(J>>4)]>>2*(15&J)&3))return 2;if(q==0)return 0;if(q==1)return 1}N+=j*W,W=A.O.truncate(W/2),j=A.O.truncate((2*W+31)/32),b=A.O.truncate(b/2),O=A.O.truncate(O/2),C=A.O.truncate(C/2),g=A.O.truncate(g/2),F=Math.max(C-b,1)*Math.max(g-O,1)}},_.prototype.RR=function(){return this.Gf*this.Um},_}();A.Nx=E}(ye||(ye={})),function(A){var ue;(ue=A.VL||(A.VL={}))[ue.contains=1]="contains",ue[ue.within=2]="within",ue[ue.equals=3]="equals",ue[ue.disjoint=4]="disjoint",ue[ue.touches=8]="touches",ue[ue.crosses=16]="crosses",ue[ue.overlaps=32]="overlaps",ue[ue.unknown=0]="unknown",ue[ue.intersects=1073741824]="intersects";var G=function(){function _(){}return _.construct=function(g,b,C,O,F,N,j,W){var q=new _;return q.pw=g,q.Mm=b,q.Kj=C,q.Si=O,q.BH=F,q.SY=N,q.TY=j,q.UY=W,q},_}();A.Vt=function(){function _(){}return _.CD=function(g,b,C){if(_.wy(g)){var O=A.ta.kj(b,g,!1);b=!1,A.Uk.CE(g)&&(b=b||g.lu(O,C)),(O=g.getType())!=1736&&O!=1607||!A.Uk.AE(g)||C==0||(b=b||g.fj(C)),O!=1736&&O!=1607||!A.Uk.BE(g)||C==0||b||g.hM()}},_.wy=function(g){return A.Uk.CE(g)||A.Uk.AE(g)||A.Uk.BE(g)},_}();var E=function(){function _(){this.rh=[]}return _.zB=function(g,b,C,O,F){var N=g.getType(),j=b.getType();if(N==197){if(j==197)return _.tW(g,b,C,O);if(j==33)return O==2?O=1:O==1&&(O=2),_.hJ(b,g,C,O)}else if(N==33){if(j==197)return _.hJ(g,b,C,O);if(j==33)return _.vW(g,b,C,O)}if(g.B()||b.B())return O==4;var W=new A.l;g.A(W);var q=new A.l;b.A(q);var J=new A.l;if(J.K(W),J.Zb(q),C=A.ta.Wd(C,J,!1),_.dk(W,q,C))return O==4;switch(W=!1,A.Vk.yd(N)&&((N=new A.Ta(g.description)).oc(g,!0),g=N,N=1607),A.Vk.yd(j)&&((j=new A.Ta(b.description)).oc(b,!0),b=j,j=1607),N!=197&&j!=197?(g.Db()4*Math.max(g.I(),b.I())*C)&&_.Wz(g,b,C,!0)))},_.kV=function(g,b,C){var O=_.qc(g,b,!0);return O==4||O!=1&&O!=2&&O!=1073741824&&_.EI(g,b,C)},_.vV=function(g,b,C){var O=_.qc(g,b,!1);return O!=4&&O!=1&&O!=2&&_.II(g,b,C,null)},_.qV=function(g,b,C,O){var F=_.qc(g,b,!1);return F!=4&&F!=1&&F!=2&&_.FI(g,b,C,O)},_.Sw=function(g,b,C,O){var F=new A.l,N=new A.l;return g.A(F),b.A(N),!!_.zc(F,N,C)&&(F=_.qc(g,b,!1))!=4&&F!=2&&(F==1||_.BI(g,b,C,O))},_.lV=function(g,b,C){var O=_.qc(g,b,!0);return O==4||O!=1&&O!=1073741824&&_.EI(g,b,C)},_.wV=function(g,b,C,O){var F=_.qc(g,b,!1);return F!=4&&F!=1&&_.JI(g,b,C,O)},_.gV=function(g,b,C){var O=_.qc(g,b,!1);return O!=4&&O!=1&&_.DI(g,b,C,null)},_.fB=function(g,b,C,O){var F=new A.l,N=new A.l;return g.A(F),b.A(N),!!_.zc(F,N,C)&&(F=_.qc(g,b,!1))!=4&&(F==1||_.CI(g,b,C,O))},_.jV=function(g,b,C){return A.hd.KG(g,b,C)==0},_.uV=function(g,b,C){return b=b.D(),_.HI(g,b,C)},_.dV=function(g,b,C){return b=b.D(),_.AI(g,b,C)},_.iV=function(g,b,C){var O=_.qc(g,b,!1);if(O==4)return!0;if(O==1)return!1;O=new A.l,g.A(O),O.W(C,C);for(var F=new A.h,N=0;NC&&N.R()>C||N.ca()<=C&&N.R()<=C)&&(F=new A.Ta,N=new A.Sa,b.Hf(0,N),F.nf(N),b.Hf(2,N),F.lineTo(N),_.DI(g,F,C,O))},_.IV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!(!_.ek(O,F,C)||_.qc(g,b,!1)==4)&&(!!_.dI(g,b,C)||_.Wz(g,b,C,!1))},_.GV=function(g,b,C){return this.qc(g,b,!1)==4||!!new A.Zl(g,b,C,!0).next()&&!this.UG(g,b,C)},_.NI=function(g,b,C){if(_.qc(g,b,!1)==4)return!1;var O=new A.be(0);if(_.Xz(g,b,C,O)!=0)return!1;for(var F=new A.de,N=0;NC&&F.R()>C)&&_.ek(O,F,C)},_.DV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!_.zc(F,O,C)&&!_.TG(g,F,C)},_.OV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),F.ca()<=C&&F.R()<=C)return F=b.Ip(),_.Zz(g,F,C);if(F.ca()<=C||F.R()<=C)return F=new A.Ta,O=new A.Sa,b.Hf(0,O),F.nf(O),b.Hf(2,O),F.lineTo(O),_.NI(g,F,C);g=g.Ga(),b=new A.l,O=new A.l,b.K(F),O.K(F),b.W(-C,-C),O.W(C,C),F=!1;for(var N=new A.l,j=new A.l;g.$a();)for(;g.Ha();){if(g.ha().A(N),j.K(b),j.Ea(N),!j.B()&&(j.ca()>C||j.R()>C))return!1;j.K(O),j.Ea(N),j.B()||(F=!0)}return F},_.LV=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!(_.zc(O,F,C)||_.zc(F,O,C)||_.zc(F,O,C)||F.ca()>C&&F.R()>C||F.ca()<=C&&F.R()<=C)&&(O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.WG(g,O,C))},_.RV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),!_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C)return _.zc(F,O,C);g=g.Ga(),(b=new A.l).K(F),b.W(-C,-C),F=!1,O=new A.l;for(var N=new A.l;g.$a();)for(;g.Ha();)g.ha().A(O),b.hm(O)?F=!0:(N.K(b),N.Ea(O),!N.B()&&(N.ca()>C||N.R()>C)&&(F=!0));return F},_.yV=function(g,b,C){var O=new A.l,F=new A.l;return b.A(F),g.A(O),!(!_.zc(O,F,C)||F.ca()>C&&F.R()>C)&&(F.ca()<=C&&F.R()<=C?(b=b.Ip(),_.SG(g,b,C)):(O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.ym(O,g,C,!1)))},_.BV=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C)return O=new A.Ta,F=new A.Sa,b.Hf(0,F),O.nf(F),b.Hf(2,F),O.lineTo(F),_.LI(g,O,C);g=g.Ga(),b=new A.l,(O=new A.l).K(F),b.K(F),O.W(-C,-C),b.W(C,C);for(var N=F=!1,j=new A.l,W=new A.l;g.$a();)for(;g.Ha();)if(g.ha().A(j),N||b.contains(j)||(N=!0),F||(W.K(O),W.Ea(j),!W.B()&&(W.ca()>C||W.R()>C)&&(F=!0)),F&&N)return!0;return!1},_.iU=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!!_.ek(O,F,C)&&(!!_.jU(g,b,C)||_.YA(g,b,C,!1,!0,!1))},_.gU=function(g,b,C){return!_.gI(g,b,C)},_.oU=function(g,b,C){return _.YA(g,b,C,!1,!1,!0)},_.eI=function(g,b,C){var O=new A.l,F=new A.l;return g.A(O),b.A(F),!!_.zc(O,F,C)&&_.YA(b,g,C,!0,!1,!1)},_.Mw=function(g,b,C){C*=C;for(var O=new A.h,F=new A.h,N=0;NC||F.R()>C)&&_.ek(O,F,C)},_.fU=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C))return!1;for((b=new A.l).K(F),b.W(C,C),C=new A.h,F=0;FC?N.W(0,-C):N.W(-C,0);for(var W=0;WC){if(b.y>N.G&&b.yN.v&&b.xC?O.W(0,-C):O.W(-C,0),N.W(C,C);for(var j=new A.h,W=0;WC?j.y>O.G&&j.yO.v&&j.xC||F.R()>C)&&(b=b.Ip(),!_.kt(g,b,C))},_.eU=function(g,b,C){var O=new A.l,F=new A.l;if(g.A(O),b.A(F),_.zc(F,O,C)||F.ca()<=C&&F.R()<=C)return!1;if(F.ca()<=C||F.R()<=C){b=new A.l,O=new A.l,b.K(F),F.ca()>C?b.W(0,-C):b.W(-C,0),O.K(F),O.W(C,C);for(var N=new A.h,j=!1,W=!1,q=0;qC?N.y>b.G&&N.yb.v&&N.xC*C},_.uI=function(g,b,C){return _.wI(g,b,C)},_.vI=function(g,b,C){var O=new A.l;return O.K(g),_.ek(O,b,C)},_.Rw=function(g,b,C){var O=new A.l;return O.K(b),O.W(C,C),!O.contains(g)},_.dB=function(g,b,C){if(b.ca()<=C&&b.R()<=C)return!1;var O=new A.l,F=new A.l;if(O.K(b),O.W(C,C),!O.contains(g))return!1;if(b.ca()<=C||b.R()<=C){if(F.K(b),b.ca()>C?F.W(0,-C):F.W(-C,0),b.ca()>C){if(g.y>F.G&&g.yF.v&&g.xC?O.W(0,-C):O.W(-C,0);var F=!1;return b.ca()>C?g.y>O.G&&g.yO.v&&g.xC&&g.R()>C&&(b.ca()<=C||b.R()<=C)?O=b:(O=g,g=b),O.ca()<=C||O.R()<=C){if(g.ca()<=C||g.R()<=C){b=new A.yb;var F=new A.yb,N=[0,0],j=[0,0],W=new A.h;return O.dn(W),b.Dc(W),O.en(W),b.Qc(W),g.dn(W),F.Dc(W),g.en(W),F.Qc(W),b.Ea(F,null,N,j,C),b.Ea(F,null,null,null,C)==1&&(N[0]==0||N[1]==1||j[0]==0||j[1]==1)}return b=new A.l,F=new A.l,b.K(g),b.W(-C,-C),F.K(b),F.Ea(O),!(!F.B()&&(F.ca()>C||F.R()>C))}return g.W(C,C),(F=new A.l).K(O),F.Ea(g),!(F.B()||!F.B()&&F.ca()>C&&F.R()>C)},_.bQ=function(g,b,C){if(_.zc(g,b,C)||_.zc(b,g,C)||g.ca()<=C&&g.R()<=C||b.ca()<=C&&b.R()<=C)return!1;if(g.ca()<=C||g.R()<=C){if(b.ca()>C&&b.R()>C)return!1;var O=new A.yb,F=new A.yb,N=[0,0],j=[0,0],W=new A.h;return g.dn(W),O.Dc(W),g.en(W),O.Qc(W),b.dn(W),F.Dc(W),b.en(W),F.Qc(W),O.Ea(F,null,N,j,C),O.Ea(F,null,null,null,C)==2&&(0N[1])&&(0j[1])}return!(b.ca()<=C||b.R()<=C)&&((O=new A.l).K(g),O.Ea(b),!(O.B()||O.ca()<=C||O.R()<=C))},_.jF=function(g,b,C){if(!_.zc(g,b,C))return!1;if(g.ca()<=C&&g.R()<=C)return g=g.sf(),_.eB(g,b,C);if(b.ca()<=C&&b.R()<=C)return b=b.sf(),_.eB(b,g,C);if(g.ca()<=C||g.R()<=C)return _.zc(g,b,C);if(b.ca()<=C||b.R()<=C){var O=new A.l;return O.K(g),O.W(-C,-C),O.hm(b)?!0:((g=new A.l).K(O),g.Ea(b),!(g.B()||g.ca()<=C&&g.R()<=C))}return _.zc(g,b,C)},_.aQ=function(g,b,C){if(_.zc(g,b,C)||_.zc(b,g,C)||g.ca()<=C&&g.R()<=C||b.ca()<=C&&b.R()<=C||b.ca()>C&&b.R()>C&&g.ca()>C&&g.R()>C)return!1;if(g.ca()>C&&g.R()>C)var O=b;else O=g,g=b;if(g.ca()>C&&g.R()>C){b=new A.l;var F=new A.l;return F.K(g),F.W(-C,-C),b.K(F),b.Ea(O),!(b.B()||b.ca()<=C&&b.R()<=C)}b=new A.yb,F=new A.yb;var N=[0,0],j=[0,0],W=new A.h;return O.dn(W),b.Dc(W),O.en(W),b.Qc(W),g.dn(W),F.Dc(W),g.en(W),F.Qc(W),b.Ea(F,null,N,j,C),b.Ea(F,null,null,null,C)==1&&0N[1]&&0j[1]},_.EI=function(g,b,C){var O=new A.l,F=new A.l,N=new A.Zl(g,b,C,!0);if(!N.next())return!0;if(this.UG(g,b,C))return!1;var j=g,W=null;b.getType()==1736&&(W=b);var q=!1,J=!1;do{var ee=N.nl(),he=N.hl();if(he=b.Na(b.Ba(he)),O.K(N.uz()),O.W(C,C),O.contains(he)&&(he=A.hd.Yd(j,he,0))!=0||b.getType()==1736&&(ee=g.Na(g.Ba(ee)),F.K(N.az()),F.W(C,C),F.contains(ee)&&(he=A.hd.Yd(W,ee,0))!=0))return!1;q||(!A.Dg.Ml(g,b.da()-1)||g.Bb!=null&&g.Bb.Fb!=null?j=g:(j=new A.Da,g.copyTo(j),j.fj(1)),q=!0),b.getType()!=1736||J||(J=b,!A.Dg.Ml(J,g.da()-1)||b.Bb!=null&&b.Bb.Fb!=null?W=b:(W=new A.Da,J.copyTo(W),W.fj(1)),J=!0)}while(N.next());return!0},_.zc=function(g,b,C){var O=new A.l;return O.K(g),O.W(C,C),O.contains(b)},_.ls=function(g,b,C){var O=new A.l;return O.K(b),O.W(C,C),b=new A.h,g.dn(b),!O.contains(b)||(g.$I(b),!O.contains(b)||(g.cJ(b),!O.contains(b)||(g.en(b),!O.contains(b))))},_.dI=function(g,b,C){if(g.da()!=b.da()||g.I()!=b.I())return!1;var O=new A.h,F=new A.h,N=!0;C*=C;for(var j=0;jC){N=!1;break}if(!N)break}return!!N},_.jU=function(g,b,C){if(g.I()!=b.I())return!1;var O=new A.h,F=new A.h,N=!0;C*=C;for(var j=0;jC){N=!1;break}return!!N},_.YA=function(g,b,C,O,F,N){var j=!1;if(g.I()>b.I()){O&&(O=!1,j=!0);var W=b}else W=g,g=b;if(b=null,F||N||j){b=new A.pn(g.I());for(var q=0;qb.I())var O=b;else O=g,g=b;b=new A.l;var F=new A.l,N=new A.l;O.A(b),g.A(F),b.W(C,C),F.W(C,C),N.K(b),N.Ea(F),F=new A.h;for(var j=new A.h,W=C*C,q=A.ta.oE(g,N),J=q.getIterator(),ee=0;eeC)return!1;if(Ye*(1-(ei=N.Si))<=C||ei==1)break}if(Ye*(1-ei)>C)return!1;J=0,ee.resize(0),he.rh.length=0}}return j},_.WG=function(g,b,C){if(1>_.Xz(g,b,C,null))return!1;var O=new A.l,F=new A.l;g.A(O),b.A(F);var N=_.ls(O,F,C);return O=_.ls(F,O,C),!(!N||!O)||(N&&!O?!_.ym(b,g,C,!1):O&&!N?!_.ym(g,b,C,!1):!_.ym(g,b,C,!1)&&!_.ym(b,g,C,!1))},_.Xz=function(g,b,C,O){function F(Fr,ds){return Ee.QE(Fr,ds)}if(g.yz()>b.yz())var N=b,j=g;else N=g,j=b;g=N.Ga(),b=j.Ga();var W=[0,0],q=[0,0],J=-1,ee=0,he=new A.ia(0),Ee=new _,De=new A.l,pt=new A.l,Et=new A.l;N.A(De),j.A(pt),De.W(C,C),pt.W(C,C),Et.K(De),Et.Ea(pt),N=null,O!=null&&(N=new A.h);var Ye=pt=pt=null,jt=j.Bb;for(jt!=null?(pt=jt.Fb,Ye=jt.zo,pt==null&&(pt=A.ta.jj(j,Et))):pt=A.ta.jj(j,Et),j=pt.getIterator(),jt=null,Ye!=null&&(jt=Ye.getIterator());g.$a();)for(Ye=0;g.Ha();){var ei=g.ha();if(ei.A(De),De.isIntersecting(Et)){if(jt!=null&&(jt.Xi(De,C),jt.next()==-1))continue;var Xt=ei.Qb();j.Uo(ei,C);for(var wi=j.next();wi!=-1;wi=j.next()){var pi=pt.ja(wi);b.Vb(pi);var Ri=b.ha(),Ui=Ri.Qb(),Bi=ei.Ea(Ri,null,W,q,C);if(0C)return 1;var z=Xt*(mi-wi);if(b.Ha()){if(Ri=b.ha(),(Bi=ei.Ea(Ri,null,W,null,C))==2){Bi=W[0];var Wi=W[1];if(z+(Bi=Xt*(Wi-Bi))>C)return 1}b.Vb(pi),b.ha()}if(!b.vm()){if(b.li(),Ri=b.li(),(Bi=ei.Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Xt*((Wi=W[1])-Bi))>C))return 1;b.Vb(pi),b.ha()}if(g.Ha()){if(pi=g.wb(),(Bi=(ei=g.ha()).Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Xt*((Wi=W[1])-Bi))>C))return 1;g.Vb(pi),g.ha()}if(!g.vm()){if(pi=g.wb(),g.li(),(Bi=(ei=g.li()).Ea(Ri,null,W,null,C))==2&&(Bi=W[0],z+(Bi=Ui*((Wi=W[1])-Bi))>C))return 1;g.Vb(pi),g.ha()}Ri=G.construct(g.wb(),g.gb,wi,mi,b.wb(),b.gb,J,ar),Ee.rh.push(Ri),he.add(he.size)}J=0,O!=null&&(ei.hc(wi,N),O.add(N.x),O.add(N.y))}}if(eeC)Ye=Xt*(Ri.Si-Ri.Kj),ei=Ri.Si,wi=Ri.Mm;else{if(Ri.Mm!=wi?(Ye=Xt*(Ri.Si-Ri.Kj),wi=Ri.Mm):Ye+=Xt*(Ri.Si-Ri.Kj),Ye>C)return 1;if((ei=Ri.Si)==1)break}Xt*(1-ei)>C&&(Ye=0),ee=0,he.resize(0),Ee.rh.length=0}}}return J},_.UG=function(g,b,C){var O=g.Ga(),F=b.Ga();for(g=new A.Zl(g,b,C,!1);g.next();){b=g.nl();var N=g.hl();if(O.Vb(b),F.Vb(N),b=O.ha(),0C)return!1;ee=!0}else if(Ee!=0){if(ee=W[0],he=q[0],0ee&&0he)return!1;ee=!0}}return!!ee&&(N=new A.l,j=new A.l,F=new A.l,g.A(N),b.A(j),N.W(1e3*C,1e3*C),j.W(1e3*C,1e3*C),F.K(N),F.Ea(j),!(10C&&(q=!0,J&&ee))return!0}else if(Ye!=0&&(Ye=De[0],jt=pt[0],0Ye&&0jt))return!0}if(F=new A.l,he=new A.l,F.K(N),F.W(1e3*C,1e3*C),he.K(j),he.W(1e3*C,1e3*C),W.K(F),W.Ea(he),N="",N=q?N+"**":N+"T*",J){if(10ee&&0he)))return O[0]=!0,!1}if(!J){for(O[0]=!0,j=new A.l,g.A(j),j.W(C,C),q=g,J=!1,W=new A.l,O=0,F=b.da();OJ&&0ee)return!1;J=!0}}return!!J&&(N=new A.l,j=new A.l,F=new A.l,g.A(N),b.A(j),N.W(1e3*C,1e3*C),j.W(1e3*C,1e3*C),F.K(N),F.Ea(j),!(10J&&0ee)return!0;J=!0}}return!!J&&(N=new A.l,j=new A.l,W=new A.l,q=new A.l,F=new A.l,g.A(N),b.A(j),_.ls(j,N,C)?(W.K(N),W.W(1e3*C,1e3*C),q.K(j),q.W(1e3*C,1e3*C),F.K(W),F.Ea(q),!(10N;N++){var j=O.charAt(N);if(j!="*"&&j!="T"&&j!="F"&&j!="0"&&j!="1"&&j!="2")throw A.i.fa("relation string")}if((N=this.MR(O,g.Db(),b.Db()))!=0)return A.ud.zB(g,b,C,N,F);N=new A.l,g.A(N),j=new A.l,b.A(j);var W=new A.l;if(W.K(N),W.Zb(j),C=A.ta.Wd(C,W,!1),g=this.WE(g,C),b=this.WE(b,C),g.B()||b.B())return this.uW(g,b,O);switch(N=g.getType(),j=b.getType(),W=!1,N){case 1736:switch(j){case 1736:W=this.rt(g,b,C,O,F);break;case 1607:W=this.$m(g,b,C,O,F);break;case 33:W=this.qt(g,b,C,O);break;case 550:W=this.pt(g,b,C,O,F)}break;case 1607:switch(j){case 1736:W=this.$m(b,g,C,this.Zp(O),F);break;case 1607:W=this.gB(g,b,C,O,F);break;case 33:W=this.tt(g,b,C,O,F);break;case 550:W=this.st(g,b,C,O,F)}break;case 33:switch(j){case 1736:W=this.qt(b,g,C,this.Zp(O));break;case 1607:W=this.tt(b,g,C,this.Zp(O),F);break;case 33:W=this.$U(g,b,C,O);break;case 550:W=this.lt(b,g,C,this.Zp(O))}break;case 550:switch(j){case 1736:W=this.pt(b,g,C,this.Zp(O),F);break;case 1607:W=this.st(b,g,C,this.Zp(O),F);break;case 550:W=this.ZA(g,b,C,O,F);break;case 33:W=this.lt(g,b,C,O)}break;default:W=!1}return W},_.rt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.xJ();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Cu(g,b),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Cu(g,b),O=!0):j==1?(N.ly(b),O=!0):j==2&&(N.ZD(g),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Bp(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.Sw=function(g,b,C,O){var F=new _;F.Yi(),F.bj("T*****F**"),F.xJ();var N=new A.l,j=new A.l;g.A(N),b.A(j);var W=!1;return A.ud.dk(N,j,C)&&(F.Cu(g,b),W=!0),W||((N=A.ud.qc(g,b,!1))==4?(F.Cu(g,b),W=!0):N==1?(F.ly(b),W=!0):N==2&&(F.ZD(g),W=!0)),W?this.fg(F.J,F.Xc):(g=(W=new A.gd).Ib(g),N=W.Ib(b),A.Tk.V(W,C,O,!1),C=W.Ne(N).mg(),W.Gp(0,!0,!0),A.rn.V(W,g,-1,!1,O),W.I(g)!=0&&(A.rn.V(W,N,-1,!1,O),F.er(W,O),(b=W.I(N)==0)||(F.Bp(g,N),F.j.Ug(),N=this.fg(F.J,F.Xc))?(g=W.Ne(g),g=(W=new A.gd).Ib(g),N=W.Ib(C),F.er(W,O),F.le=0,F.Yi(),F.bj(b?"T*****F**":"******F**"),F.IB(),F.Bp(g,N),F.j.Ug(),this.fg(F.J,F.Xc)):N))},_.$m=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.IB();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Du(g,b),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Du(g,b),O=!0):j==1&&(N.$D(b),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.kh=N.j.Dp(),_.Jw(b,N.j,N.kh),N.Bp(g,b),N.j.Ep(N.kh),N.j.Ug()),_.fg(N.J,N.Xc)},_.fB=function(g,b,C,O){var F=new _;F.Yi(),F.bj("T*****F**"),F.IB();var N=new A.l,j=new A.l;g.A(N),b.A(j);var W=!1;return A.ud.dk(N,j,C)&&(F.Du(g,b),W=!0),W||((N=A.ud.qc(g,b,!1))==4?(F.Du(g,b),W=!0):N==1&&(F.$D(b),W=!0)),W?this.fg(F.J,F.Xc):(g=(W=new A.gd).Ib(g),b=W.Ib(b),F.Wo(W,C,O),W.I(g)!=0&&(F.Bp(g,b),F.j.Ug(),this.fg(F.J,F.Xc)))},_.pt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.yJ();var j=new A.l,W=new A.l;return g.A(j),b.A(W),O=!1,A.ud.dk(j,W,C)&&(N.Eu(g),O=!0),O||((j=A.ud.qc(g,b,!1))==4?(N.Eu(g),O=!0):j==1&&(N.zN(),O=!0)),O||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Gy(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.gB=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.eX(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.PG(g,b),W=!0),W||A.ud.qc(g,b,!1)!=4||(N.PG(g,b),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Yh=N.j.Dp(),N.kh=N.j.Dp(),_.Jw(g,N.j,N.Yh),_.Jw(b,N.j,N.kh),N.Bp(g,b),N.j.Ep(N.Yh),N.j.Ep(N.kh),N.j.Ug()),_.fg(N.J,N.Xc)},_.st=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.MJ(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.Vz(g),W=!0),W||A.ud.qc(g,b,!1)!=4||(N.Vz(g),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Yh=N.j.Dp(),_.Jw(g,N.j,N.Yh),N.Gy(g,b),N.j.Ep(N.Yh),N.j.Ug()),_.fg(N.J,N.Xc)},_.ZA=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.RJ(),O=new A.l;var j=new A.l;g.A(O),b.A(j);var W=!1;return A.ud.dk(O,j,C)&&(N.yI(),W=!0),W||(g=(O=new A.gd).Ib(g),b=O.Ib(b),N.Wo(O,C,F),N.Gy(g,b),N.j.Ug()),_.fg(N.J,N.Xc)},_.qt=function(g,b,C,O){var F=new _;F.Yi(),F.bj(O),F.yJ();var N=new A.l;g.A(N),b=b.D();var j=!1;return A.ud.Rw(b,N,C)&&(F.Eu(g),j=!0),j||((C=A.hd.Yd(g,b,C))==1?(F.J[0]=0,F.J[2]=2,F.J[3]=-1,F.J[5]=1,F.J[6]=-1):C==2?(F.J[6]=-1,g.Ke()!=0?(F.J[0]=-1,F.J[3]=0,F.J[2]=2,F.J[5]=1):(F.J[0]=0,F.J[3]=-1,F.J[5]=-1,C=new A.l,g.A(C),F.J[2]=C.ca()==0&&C.R()==0?-1:1)):F.Eu(g)),this.fg(F.J,O)},_.tt=function(g,b,C,O,F){var N=new _;N.Yi(),N.bj(O),N.MJ();var j=new A.l;g.A(j),O=b.D();var W=!1;if(A.ud.Rw(O,j,C)&&(N.Vz(g),W=!0),!W){j=null;var q=W=!1;(N.ea[0]||N.ea[6])&&(A.ud.Yz(g,O,C)?(N.ea[0]&&(j=A.pi.gm(g,F),q=!A.ud.kt(j,O,C),W=!0,N.J[0]=q?-1:0),N.J[6]=-1):(N.J[0]=-1,N.J[6]=0)),N.ea[3]&&(j!=null&&j.B()?N.J[3]=-1:(W||(j==null&&(j=A.pi.gm(g,F)),q=!A.ud.kt(j,O,C),W=!0),N.J[3]=q?0:-1)),N.ea[5]&&(j!=null&&j.B()?N.J[5]=-1:W&&!q?N.J[5]=0:(j==null&&(j=A.pi.gm(g,F)),F=A.ud.Nw(j,b,C),N.J[5]=F?-1:0)),N.ea[2]&&(g.Qb()!=0?N.J[2]=1:((F=new A.de(g.description)).Fd(g,0,g.I()),g=A.ud.Nw(F,b,C),N.J[2]=g?-1:0))}return this.fg(N.J,N.Xc)},_.lt=function(g,b,C,O){var F=new _;F.Yi(),F.bj(O),F.RJ();var N=new A.l;g.A(N),b=b.D();var j=!1;if(A.ud.Rw(b,N,C)&&(F.yI(),j=!0),!j){N=!1,j=!0,C*=C;for(var W=0;WN;N++)F[N]=-1;return A.h.yc(g,b)<=C*C?F[0]=0:(F[2]=0,F[6]=0),F[8]=2,_.fg(F,O)},_.fg=function(g,b){for(var C=0;9>C;C++)switch(b.charAt(C)){case"T":if(g[C]==-1)return!1;break;case"F":if(g[C]!=-1)return!1;break;case"0":if(g[C]!=0)return!1;break;case"1":if(g[C]!=1)return!1;break;case"2":if(g[C]!=2)return!1}return!0},_.uW=function(g,b,C){var O=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(g.B()&&b.B()){for(var F=0;9>F;F++)O[F]=-1;return this.fg(O,C)}return F=!1,g.B()&&(g=b,F=!0),O[0]=-1,O[1]=-1,O[3]=-1,O[4]=-1,O[6]=-1,O[7]=-1,O[8]=2,b=g.getType(),A.aa.Hc(b)?b==1736?g.Ke()!=0?(O[2]=2,O[5]=1):(O[5]=-1,b=new A.l,g.A(b),O[2]=b.ca()==0&&b.R()==0?0:1):(b=g.Qb()!=0,O[2]=b?1:0,O[5]=A.pi.aq(g)?0:-1):(O[2]=0,O[5]=-1),F&&this.vK(O),this.fg(O,C)},_.MR=function(g,b,C){return _.dQ(g)?3:_.UP(g)?4:_.cY(g,b,C)?8:_.CP(g,b,C)?16:_.eP(g)?1:_.EU(g,b,C)?32:0},_.dQ=function(g){return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="F"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="F"&&g.charAt(6)=="F"&&g.charAt(7)=="F"&&g.charAt(8)=="*"},_.UP=function(g){return g.charAt(0)=="F"&&g.charAt(1)=="F"&&g.charAt(2)=="*"&&g.charAt(3)=="F"&&g.charAt(4)=="F"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"},_.cY=function(g,b,C){return(b!=0||C!=0)&&((b!=2||C!=2)&&(g.charAt(0)=="F"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="T"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"||b==1&&C==1&&g.charAt(0)=="F"&&g.charAt(1)=="T"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*")||C!=0&&g.charAt(0)=="F"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="T"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*")},_.CP=function(g,b,C){return b>C?g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*":b==1&&C==1&&g.charAt(0)=="0"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="*"&&g.charAt(7)=="*"&&g.charAt(8)=="*"},_.eP=function(g){return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="*"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="F"&&g.charAt(7)=="F"&&g.charAt(8)=="*"},_.EU=function(g,b,C){if(b==C){if(b!=1)return g.charAt(0)=="T"&&g.charAt(1)=="*"&&g.charAt(2)=="T"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*";if(g.charAt(0)=="1"&&g.charAt(1)=="*"&&g.charAt(2)=="T"&&g.charAt(3)=="*"&&g.charAt(4)=="*"&&g.charAt(5)=="*"&&g.charAt(6)=="T"&&g.charAt(7)=="*"&&g.charAt(8)=="*")return!0}return!1},_.Jw=function(g,b,C){g=b.La(g);for(var O=b.Re;O!=-1;O=b.Rf(O))if(b.xd(O)&g){var F=b.Me(O);if(F==-1)b.nn(O,C,0);else{var N=F,j=0;do b.dh(N)&g&&j++,N=b.jc(b.xa(N));while(N!=F);b.nn(O,C,j)}}},_.Zp=function(g){var b=""+g.charAt(0);return b+=g.charAt(3),b+=g.charAt(6),b+=g.charAt(1),b+=g.charAt(4),b+=g.charAt(7),b+=g.charAt(2),(b+=g.charAt(5))+g.charAt(8)},_.prototype.Yi=function(){for(var g=0;9>g;g++)this.J[g]=-2,this.Za[g]=-2},_.vK=function(g){var b=g[1],C=g[2],O=g[5];g[1]=g[3],g[2]=g[6],g[5]=g[7],g[3]=b,g[6]=C,g[7]=O},_.prototype.bj=function(g){for(this.Xc=g,g=0;9>g;g++)this.Xc.charAt(g)!="*"?(this.ea[g]=!0,this.le++):this.ea[g]=!1},_.prototype.UJ=function(){for(var g=0;9>g;g++)this.ea[g]&&this.J[g]==-2&&(this.J[g]=-1,this.ea[g]=!1)},_.prototype.pc=function(g){return this.J[g]!=-2&&(this.J[g]==-1?(this.ea[g]=!1,this.le--,!0):this.Xc.charAt(g)!="T"&&this.Xc.charAt(g)!="F"?!(this.J[g]N?1:0},_.prototype.reset=function(){this.yA=-1},_}(),E=function(){function _(){this.Wm=this.Gl=null,this.fb=new A.Yj,this.fb.RP(),this.$d=new G(this),this.fb.Vo(this.$d)}return _.prototype.HQ=function(){var g=!1;if(this.fw&&(g=this.IQ()),this.g.da(this.X)==1){var b=this.g.Ob(this.X);return g=this.g.wz(b),this.g.PB(b,!0),0>g&&(g=this.g.Xa(b),this.g.pJ(g),this.g.Wg(b,this.g.Ma(g)),!0)}for(this.El=this.g.Ky(),this.wo=this.g.Ky(),b=this.g.Ob(this.X);b!=-1;b=this.g.Rb(b))this.g.gr(b,this.El,0),this.g.gr(b,this.wo,-1);b=new A.ia(0),this.yh=NaN;var C=new A.h;this.et=this.g.da(this.X),this.ro=this.g.Gd(),this.Rs=this.g.Gd();for(var O=this.Gl.rc(this.Gl.je);O!=-1;O=this.Gl.lb(O)){var F=this.Gl.getData(O);if(this.g.Gc(F,C),C.y!=this.yh&&b.size!=0&&(g=this.ut(b)||g,this.$d.reset(),b.clear(!1)),b.add(F),this.yh=C.y,this.et==0)break}for(0=this.MA.length&&this.MA.push(new A.ig);var _=this.MA[this.Cw];return this.Cw++,_},E.prototype.clear=function(){this.wB(this.mo),this.wB(this.$s),this.wB(this.yw),this.Cw=0},E.prototype.Oo=function(_){this.mo.push(this.Ow(_))},E.prototype.ol=function(_){return _==0?this.$s.length:this.yw.length},E.prototype.Vp=function(_,g){return this.SR(_,g).$i},E.prototype.Ea=function(_,g){if(this.mo.length!=2)throw A.i.Qa();this.qa=_;var b=A.lc.ox(.01*_),C=!1,O=this.mo[0],F=this.mo[1];if(g||5&O.$i.zr(F.$i,_,!0)){if(O.$i.getType()==322){var N=O.$i;if(F.$i.getType()==322){g=F.$i;var j=A.yb.Zx(N,g,null,this.Fq,this.Bk,_);if(j==0)throw A.yb.Zx(N,g,null,this.Fq,this.Bk,_),A.i.Qa();_=Array(9),A.O.$u(_,null);for(var W=0;Wb&&(C=!0)):ee>Ee?(N.hc(q,pt),q=new A.h,g.hc(J,q),A.h.yc(pt,q)>b&&(C=!0)):(g.hc(J,pt),ee=new A.h,N.hc(q,ee),A.h.yc(pt,ee)>b&&(C=!0)),_[W]=pt}for(O=0,F=-1,W=0;W<=j;W++)(De=Wthis.Bk[1]&&(De=this.Bk[0],this.Bk[0]=this.Bk[1],this.Bk[1]=De,W=N[0],N[0]=N[1],N[1]=W),O=0,F=-1,W=0;W<=j;W++)(De=W=F;F++){if((g=1>F?this.Fq[F]:1)!=b){var N=this.aB();_.ah(b,g,N),O!=-1&&N.get().Dc(C),F!=1&&N.get().Qc(C),b=g,this.$s.push(this.Ow(N.get()))}O=F}this.Bf.Cb(C)}},E}();A.TC=G}(ye||(ye={})),function(A){var ue=function(){function G(E){this.Ds=this.rk=this.sb=null,this.ag=0,this.zm=!1,this.zf=-1,this.Cl=this.Jd=0,this.gb=-1,this.ib=E,this.ag=this.Wx(this.Cl),this.zm=!1,this.rk=null,this.Ds=new A.h}return G.prototype.BW=function(E){if(this.ib!=E.ib)throw A.i.Hb();this.zf=E.zf,this.Jd=E.Jd,this.gb=E.gb,this.Cl=E.Cl,this.ag=E.ag,this.zm=E.zm,this.rk=null},G.prototype.ha=function(){if(this.zf!=this.Jd&&this.BD(),this.zm)this.Jd=(this.Jd+1)%this.ag;else{if(this.Jd==this.ag)throw A.i.ce();this.Jd++}return this.rk},G.prototype.li=function(){if(this.zm)this.Jd=(this.ag+this.Jd-1)%this.ag;else{if(this.Jd==0)throw A.i.ce();this.Jd--}return this.Jd!=this.zf&&this.BD(),this.rk},G.prototype.DW=function(){this.zf=-1,this.Jd=0},G.prototype.EW=function(){this.Jd=this.ag,this.zf=-1},G.prototype.Vb=function(E,_){if(_===void 0&&(_=-1),0<=this.gb&&this.gb=g&&E=this.ib.Ba(_)&&E=this.ib.da())&&(this.zf=-1,this.Jd=0,this.ag=this.Wx(this.gb),this.ib.Ba(this.gb),this.ib.dc(this.gb),this.Cl++,!0)},G.prototype.Zi=function(){this.ag=this.Jd=this.zf=-1,this.Cl=0,this.gb=-1},G.prototype.Wx=function(E){if(this.ib.Ac())return 0;var _=1;return this.ib.dc(E)&&(_=0),this.ib.Ja(E)-_},G.prototype.On=function(){return this.zf==this.ag-1&&this.ib.dc(this.gb)},G.prototype.JB=function(){this.zm=!0},G.prototype.wb=function(){return this.ib.nb.o[this.gb]+this.zf},G.prototype.IM=function(){return this.ib.Ba(this.gb)},G.prototype.ik=function(){return this.On()?this.ib.Ba(this.gb):this.wb()+1},G.prototype.vm=function(){return this.zf==0},G.prototype.Qn=function(){return this.zf==this.ag-1},G.prototype.Ha=function(){return this.Jdthis.Jd||this.Jd>=this.ag)throw A.i.ce();this.zf=this.Jd;var E=this.wb();this.ib.mc();var _=this.ib.Ve,g=1;switch(_!=null&&(g=7&_.read(E)),_=this.ib.description,g){case 1:this.sb==null&&(this.sb=new A.yb),this.rk=this.sb;break;case 2:throw A.i.fa("internal error");default:throw A.i.Qa()}this.rk.Nf(_),g=this.ik(),this.ib.Gc(E,this.Ds),this.rk.Dc(this.Ds),this.ib.Gc(g,this.Ds),this.rk.Qc(this.Ds);for(var b=1,C=_.Aa;bC&&(O=_,_=b,b=O,O=g,g=C,C=O,O=-1),!(0>C||g>=this.pl)){0>_&&0>b?b=_=-1:_>=this.oi&&b>=this.oi&&(b=_=this.oi);var F=(b-_)/(C-g);C>this.pl&&(b=F*((C=this.pl)-g)+_),0>g&&(_=F*(0-g)+_,g=0);var N=Math.max(this.oi+1,8388607);-8388607>_?(g=(0-_)/F+g,_=0):_>N&&(g=(this.oi-_)/F+g,_=this.oi),-8388607>b?C=(0-_)/F+g:b>N&&(C=(this.oi-_)/F+g),(g=A.O.truncate(g))!=(C=A.O.truncate(C))&&((b=new ue).x=A.O.truncate(4294967296*_),b.y=g,b.H=C,b.WP=A.O.truncate(4294967296*F),b.dir=O,this.Wl==null&&(this.Wl=A.O.lg(this.pl,null)),b.next=this.Wl[b.y],this.Wl[b.y]=b,b.ythis.Kw&&(this.Kw=b.H),this.Tq++)}}},E.prototype.sN=function(){if(this.Jh!=null){for(var _=!1,g=null,b=this.Jh;b!=null;)if(b.y++,b.y==b.H){var C=b;b=b.next,g!=null?g.next=b:this.Jh=b,C.next=null}else b.x+=b.WP,g!=null&&g.x>b.x&&(_=!0),g=b,b=b.next;_&&(this.Jh=this.fK(this.Jh))}},E.prototype.lN=function(_){if(!(_>=this.pl)){var g=this.Wl[_];if(g!=null){this.Wl[_]=null,g=this.fK(g),this.Tq-=this.gK,_=this.Jh;for(var b=!0,C=g,O=null;_!=null&&C!=null;)_.x>C.x?(b&&(this.Jh=C),b=C.next,C.next=_,O!=null&&(O.next=C),O=C,C=b):(b=_.next,_.next=C,O!=null&&(O.next=_),O=_,_=b),b=!1;this.Jh==null&&(this.Jh=g)}}},E.eK=function(_,g){return 0>_?0:_>g?g:_},E.prototype.ZP=function(){if(this.Jh!=null){for(var _=0,g=this.Jh,b=A.O.truncate(A.O.XG(g.x)),C=g.next;C!=null;C=C.next)if(_=this.kF?1^_:_+C.dir,C.x>g.x){var O=A.O.truncate(A.O.XG(C.x));_!=0&&(g=E.eK(b,this.oi),(b=E.eK(O,this.oi))>g&&gthis.Kf[1].x&&(_=this.Kf[0],this.Kf[0]=this.Kf[1],this.Kf[1]=_):E.AN(this.Kf,g,function(O,F){return O==F?0:O.xF.x?1:0}),_=this.Kf[0],this.Kf[0]=null,b=_,C=1;Cthis.Wh.size)break;var j=this;for(this.xe.Vd(0,this.xe.size,function(W,q){return j.pM(W,q)}),g=0,b=this.xe.size;gDe?1:ptEt?1:0)==0&&(pt=(ee=j[W*ee+3])<(he=j[W*he+3])?-1:ee==he?0:1),pt}),this.Pq=this.g.Gd(),this.oe=new A.jp,this.RA=this.oe.Ph(0),this.oe.fn(g),C=0;Cj;j++){for(W=ee[j],q=g[j],J=j-1;0<=J&&ee[J]>W;)ee[J+1]=ee[J],g[J+1]=g[J],J--;ee[J+1]=W,g[J+1]=q}return ee=0,g[0]!=0&&(ee|=1),g[1]!=0&&(ee|=2),g[2]!=0&&(ee|=4),g[3]!=0&&(ee|=8),(ee==5||ee==10)&&(E==_?E?(this.g.Bc(N,b),this.g.Cc(b,N),this.g.Bc(C,F),this.g.Cc(F,C)):(this.g.Cc(N,b),this.g.Bc(b,N),this.g.Cc(C,F),this.g.Bc(F,C)):E?(this.g.Cc(b,O),this.g.Bc(O,b),this.g.Cc(F,C),this.g.Bc(C,F)):(this.g.Bc(b,O),this.g.Cc(O,b),this.g.Bc(F,C),this.g.Cc(C,F)),!0)},G.prototype.tD=function(E,_,g,b,C,O){this.MY?this.VM():this.UM(E,_,g,b,C,O)},G.prototype.VM=function(){throw A.i.fa("not implemented.")},G.prototype.UM=function(E,_,g,b,C,O){if(E!=_)E?(this.g.Bc(g,C),this.g.Cc(C,g),this.g.Bc(O,b),this.g.Cc(b,O),this.vn(C,g),this.ui(C,!0),this.g.mi(C,!0),this.bk(g),this.vn(O,b),this.ui(O,!0),this.g.mi(O,!1)):(this.g.Bc(C,g),this.g.Cc(g,C),this.g.Bc(b,O),this.g.Cc(O,b),this.vn(C,g),this.ui(C,!0),this.g.mi(C,!1),this.bk(g),this.vn(O,b),this.ui(O,!0),this.g.mi(O,!0)),this.bk(b);else{var F=E?g:b,N=_?C:O;for(E=E?b:g,_=_?O:C,C=!1,this.g.Bc(F,N),this.g.Bc(N,F),this.g.Cc(E,_),this.g.Cc(_,E),O=_;O!=N;)g=this.g.Ma(O),b=this.g.U(O),this.g.Cc(O,b),this.g.Bc(O,g),C=C||O==F,O=b;C||(g=this.g.Ma(N),b=this.g.U(N),this.g.Cc(N,b),this.g.Bc(N,g)),this.vn(N,F),this.ui(N,!0),this.g.mi(N,!1),this.bk(F),this.vn(_,E),this.ui(_,!0),this.g.mi(_,!1),this.bk(E)}},G.prototype.cD=function(){for(var E=!1,_=this.g.Ob(this.X);_!=-1;){for(var g=this.g.Xa(_),b=0,C=this.g.Ja(_);bthis.g.Ja(_)){for(E=this.g.Xa(_),b=0,C=this.g.Ja(_);b=_)throw A.i.N("Invalid or unsupported wkid: "+_);var g=new E;return g.dg=_,g},E.qP=function(_){if(_==null||_.length==0)throw A.i.N("Cannot create SpatialReference from null or empty text.");var g=new E;return g.wh=_,g},E.prototype.Nb=function(_){return this==_||_!=null&&this.constructor==_.constructor&&this.dg==_.dg&&(this.dg!=0||this.wh===_.wh)},E.prototype.toString=function(){return"[ tol: "+this.Kn()+"; wkid: "+this.Ec()+"; wkt: "+this.Bz()+"]"},E.prototype.cc=function(){if(this.pp!=="")return this.pp;var _=this.toString();if(Array.prototype.reduce)return this.pp="S"+_.split("").reduce(function(C,O){return(C=(C<<5)-C+O.charCodeAt(0))&C},0);var g=0;if(_.length===0)return"";for(var b=0;b<_.length;b++)g=(g<<5)-g+_.charCodeAt(b),g&=g;return this.pp="S"+g},E.prototype.Kn=function(){return this.Xd(0)},E.prototype.fh=function(){return this.su!==null?this.su:this.su=A.gu.yP(this)},E.ZN=2147483645,E.$N=9007199254740990,E}();A.Eg=G}(ye||(ye={})),function(A){var ue=function(G){function E(){var _=G!==null&&G.apply(this,arguments)||this;return _.Ji=null,_.ST=null,_.Hq=new A.ZL,_.Eo=null,_.jw=null,_}return me(E,G),E.yP=function(_){var g=new E;if(g.dg=_.dg,g.Ho=_.Ho,g.ZH=_.ZH,g.wh=_.wh,g.wh!==""&&g.wh!==null){_=E.kM(g.wh);var b=E.iM(g.wh);g.Hq.Xx(_,b,A.hu.Integer64),g.by(_),g.gy(b),g.dg=_.$r()}else _=E.jM(g.dg),g.by(_),g.gy(null),g.Hq.Xx(_,null,A.hu.Integer64);return g},E.prototype.Xd=function(_){return this.Hq.Kn(_)},E.iM=function(_){if(0>=_.length)throw A.i.N();var g=null;try{g=A.NC.fromString(_)}catch{g=null}return g==null?null:E.bD(g,!0)},E.prototype.by=function(_){this.Kd=_,this.Eo=this.Kd.Hd()},E.prototype.gy=function(_){this.KH=_,this.ST=this.KH!=null?this.KH.Eo:null},E.prototype.Wc=function(){return this.Sb()!=0&&this.Sb()!=3&&this.Kd.Wc()},E.prototype.IG=function(){return this.Sb()!=0&&(this.Sb()==3?this.Ji.fk().Wc():this.Kd.Wc())},E.prototype.eh=function(){return this.Kd!=null?this.Kd.Ue:null},E.prototype.pm=function(){return this.Kd.pm()},E.prototype.bf=function(){return this.Kd.bf()},E.prototype.hh=function(){return this.Kd!=null?this.Kd.sw:NaN},E.prototype.Up=function(){return this.Kd.Up()},E.prototype.Wr=function(){return this.Kd.Wr()},E.prototype.kk=function(){return this.Kd.kk()},E.prototype.kS=function(_){return A.OC.Py(this.Kd,_.Kd)},E.prototype.ml=function(){return this.Kd.ml()},E.prototype.Vr=function(){return this.Kd.Vr()},E.prototype.zi=function(){return this.Sb()==3?this.Ji.fk().zi():this.Kd.zi()},E.prototype.gh=function(){if(!this.Wc())throw A.i.N("!isPannable()");var _=new A.l;return this.Kd.gh(_),_},E.prototype.Oe=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.so},E.prototype.HR=function(){if(!this.Wc())throw A.i.N("!isPannable()");var _=new A.l;return this.Kd.GR(_),_},E.prototype.pv=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.pv()},E.prototype.ov=function(){if(!this.Wc())throw A.i.N("!isPannable()");return this.Kd.ov()},E.prototype.Xr=function(){return this.Ji!=null?this.Ji.fk().Xr():this.Kd.Xr()},E.prototype.PQ=function(){return this.Kd.hv()},E.prototype.Qp=function(){return this.Eo.getUnitFactor()},E.prototype.vz=function(_){return this.Hq.vz(_)},E.prototype.sc=function(){var _=this.Sb();if(_==1)return this;if(_==3)return this.Ji.fk().sc();if(_==0||_===4)throw A.i.fa("invalid call");if(this.jw!==null)return this.jw;if((_=this.eh().getGeogcs())==null)throw A.i.Qa();return this.jw=E.bF(_,this.Hq.VF())},E.bF=function(_,g){if(_==null)throw A.i.N("null pointer.");var b=new E;return _=E.mu(_,!0),b.Hq.Xx(_,null,g),b.by(_),b.gy(null),b.dg=_.$r(),b},E.prototype.Sb=function(){var _=this.eh();if(_!=null)switch(_.getType()){case A.Sc.PE_TYPE_GEOGCS:return 1;case A.Sc.PE_TYPE_PROJCS:return 2}return 4},E.prototype.hv=function(){return this.Kd.hv()},E.mu=function(_,g){var b=_.getCode();if(0>=b&&0<(b=A.pf.getCode(_))){if((_=A.pf.coordsys(b))==null)throw A.i.N("Text to wkid mapping had failed: "+b);return E.mu(_,g)}if(g&&0=b?_:A.pf.coordsys(b),_=new A.OC(_),E.lK[g]=_,0=_)throw A.i.N("Invalid or unsupported wkid: "+_);var g=E.qx[_];if(g!=null)return g;if((g=A.pf.coordsys(_))==null)throw A.i.N("Invalid or unsupported wkid: "+_);return(g=E.mu(g,!1)).$r()!=_&&(E.qx[_]=g),g},E.kM=function(_){if(_==null||_===void 0||_.length==0)throw A.i.N("Cannot create SpatialReference from null or empty text.");var g=null;try{g=A.pf.fromString(A.Sc.PE_TYPE_COORDSYS,_)}catch(b){throw A.i.N("Cannot create SpatialReference from text. "+b.message)}if(g===null)throw A.i.N("Cannot create SpatialReference from text. ");return E.mu(g,!0)},E.bD=function(_,g){var b,C=_.getCode();if(0>=C&&0<(C=A.pf.getCode(_))){if((C=A.pf.vertcs(C))===null)throw A.i.N();return E.bD(C,g)}if(g&&0=C||(b=A.pf.vertcs(C)),b===null)throw A.i.N();return b=new A.PL(b),E.mK[_]=b,0g&&(this.Pj=g/(C-this.Fm)),b=this.Gm+b,(O=A.O.truncate((b-this.Gm)*this.Pj))>g&&(this.Pj=g/(b-this.Gm))}},_.prototype.aC=function(g){switch(g){case 0:this.Ik=void 0;case 1:this.Mq=void 0;case 2:this.Lq=void 0}},_.prototype.Kn=function(g){switch(g){case 0:return this.Ik;case 1:return this.Mq;case 2:return this.Lq}return 0},_.prototype.vz=function(g){if(this.Rm==ue.FloatingPoint)return 0;switch(g){case 0:return 1/this.Pj;case 1:case 2:return 1/this.Fo;default:return 0}},_.prototype.toString=function(){var g="SRPD [m_toleranceXY: "+this.Ik.toString();return(g=(g=(g=(g=(g=(g=(g=(g=(g=g+";m_falseX: "+this.Fm.toString())+";m_falseY: "+this.Gm.toString())+";m_unitsXY: "+this.Pj.toString())+";m_falseZ: "+this.sA.toString())+";m_unitsZ: "+this.Fo.toString())+";m_falseM: "+this.rA.toString())+";m_toleranceZ: "+this.Mq.toString())+";m_toleranceM: "+this.Lq.toString())+";m_precision: "+this.Rm.toString())+"] "},_}();A.ZL=E}(ye||(ye={})),function(A){function ue(C,O){return 89.99999O&&(O=-89.99999),O*=.017453292519943,[111319.49079327169*C,31890685e-1*Math.log((1+Math.sin(O))/(1-Math.sin(O)))]}function G(C,O,F){return C=C/6378137*57.29577951308232,F?[C,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*O/6378137)))]:[C-360*Math.floor((C+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*O/6378137)))]}function E(C,O,F){var N=C.Of();if(C.getType()===33)O=O(N.Lg(),N.ih()),N.Cb(O[0],O[1]);else if(C.getType()===197){var j=O(C.es(),C.gs(),F);O=O(C.ds(),C.fs(),F),N.K(j[0],j[1],O[0],O[1])}else for(j=new A.h,C=0;CF&&(F=637.100877141506);for(var N,j=[],W=0;Wthis.Hg&&this.Dz(E)},G.prototype.tx=function(E,_){E*=this.stride,_*=this.stride;for(var g=0;gthis.ns.va)return 1;O=C.na==C.la;var F=b.na==b.la;if(O||F){if(O&&F)return 0;if(C.na==b.na&&C.sa==b.sa)return O?1:-1;if(C.la==b.la&&C.pa==b.pa)return O?-1:1}return(O=C.Pe(this.yh,this.ms.oa))==(F=b.Pe(this.yh,this.ns.oa))&&((F=.5*((O=Math.min(C.la,b.la))+this.yh))==this.yh&&(F=O),O=C.Pe(F,this.ms.oa),F=b.Pe(F,this.ns.oa)),OF?1:0},g.prototype.aK=function(b){this.yh=b},g}(),_=function(){function g(b){this.ib=b,this.WH=new A.ig,this.Bf=new A.h,this.wA=new A.Nc}return g.prototype.kX=function(b){this.Bf.L(b)},g.prototype.compare=function(b,C){return this.ib.pB(b.ja(C),this.WH),b=this.WH.get(),this.wA.K(b.sa,b.pa),this.Bf.xthis.wA.va?1:(b=b.Pe(this.Bf.y,this.Bf.x),this.Bf.xb?1:0)},g}();ue=function(){function g(){this.hH=this.Di=this.Gi=this.kA=this.Yn=this.ye=this.Kc=this.jh=this.ge=null,this.Go=this.xg=-1,this.gH=!0,this.pA=!1,this.lA=NaN,this.Ni=new A.Md,this.bO=2147483647,this.aO=A.O.truncate(-2147483648),this.cg=this.ae=this.Hl=this.Cq=this.Cm=this.Bq=this.Os=this.Re=-1,this.wa=0}return g.prototype.yy=function(b){this.lA=b},g.prototype.Ym=function(){this.ge==null&&(this.ge=new A.$c(8));var b=this.ge.Ce();return this.ge.S(b,1,0),b},g.prototype.vU=function(){this.Kc==null&&(this.Kc=new A.$c(8));var b=this.Kc.Ce();this.Kc.S(b,2,0),this.Kc.S(b,3,0);var C=this.Kc.Ce();return this.Kc.S(C,2,0),this.Kc.S(C,3,0),this.JJ(b,C),this.JJ(C,b),b},g.prototype.mI=function(){this.ye==null&&(this.ye=new A.$c(8));var b=this.ye.Ce();return this.ye.S(b,2,0),b},g.prototype.TW=function(b,C){this.ge.S(b,7,C)},g.prototype.mn=function(b,C){this.ge.S(b,2,C)},g.prototype.SW=function(b,C){this.ge.S(b,1,C)},g.prototype.lX=function(b,C){this.ge.S(b,3,C)},g.prototype.iX=function(b,C){this.ge.S(b,4,C)},g.prototype.cr=function(b,C){this.ge.S(b,5,C)},g.prototype.eR=function(b){return this.ge.T(b,5)},g.prototype.RW=function(b,C){this.ge.S(b,6,C)},g.prototype.cN=function(b,C){this.RW(C,b)},g.prototype.IJ=function(b,C){this.Kc.S(b,1,C)},g.prototype.JJ=function(b,C){this.Kc.S(b,4,C)},g.prototype.Tl=function(b,C){this.Kc.S(b,5,C)},g.prototype.Sl=function(b,C){this.Kc.S(b,6,C)},g.prototype.$W=function(b,C){this.Kc.S(b,2,C)},g.prototype.$w=function(b,C){this.Kc.S(b,3,C)},g.prototype.LF=function(b){return this.Kc.T(b,3)},g.prototype.Gt=function(b,C){this.Kc.S(b,7,C)},g.prototype.EK=function(b,C){if(this.mm(b)!=-1)for(C=C?-1:b,b=this.mm(b);b!=-1;b=this.js(b))this.g.Ra(this.tj(b),this.Cq,C)},g.prototype.yx=function(b,C){b!=-1&&(this.EK(b,C),this.EK(this.xa(b),C))},g.prototype.Dt=function(b,C){this.ye.S(b,1,C)},g.prototype.Vg=function(b,C){this.ye.S(b,2,C)},g.prototype.jn=function(b,C){this.ye.S(b,3,C),this.NW(b,this.dR(C)),this.MW(C,b)},g.prototype.MW=function(b,C){this.ye.S(b,4,C)},g.prototype.NW=function(b,C){this.ye.S(b,5,C)},g.prototype.DJ=function(b,C){this.ye.S(b,6,C)},g.prototype.BJ=function(b,C){this.ye.S(b,7,C)},g.prototype.AJ=function(b,C){this.Yn.write(b,C)},g.prototype.CJ=function(b,C){this.kA.write(b,C)},g.prototype.kY=function(b){var C=0,O=0,F=this.AF(b),N=new A.h,j=new A.h,W=new A.h;this.Yr(F,N),j.L(N);var q=F;do this.lm(q,W),O+=A.h.tb(j,W),this.$e(this.xa(q))!=b&&(C+=(W.x-N.x-(j.x-N.x))*(W.y-N.y+(j.y-N.y))*.5),j.L(W),q=this.jc(q);while(q!=F);this.Yn.write(b,C),this.kA.write(b,O)},g.prototype.PU=function(b,C){var O=new E(this),F=new A.Yj;F.De(A.O.truncate(this.wa/2)),F.Vo(O);for(var N=new A.ia(0),j=this.$g(),W=null,q=0,J=new A.h,ee=this.Re;ee!=-1;ee=this.Rf(ee)){if(!(255&++q)&&C!=null&&!C.progress(-1,-1))throw A.i.WC();var he=this.Me(ee);if(he!=-1){if(N.Bh(0),!this.gY(F,j,N,he)){this.D(ee,J),O.aK(J.y);var Ee=he;do{var De=this.Ab(Ee,j);De!=-1&&(F.vd(De,-1),this.Kb(Ee,j,-2)),Ee=this.jc(this.xa(Ee))}while(he!=Ee);Ee=he;do(De=this.Ab(Ee,j))==-1&&(De=F.addElement(Ee,-1),N.add(De)),Ee=this.jc(this.xa(Ee));while(he!=Ee)}for(he=N.size-1;0<=he;he--)De=N.get(he),Ee=F.ja(De),this.Kb(this.xa(Ee),j,De),this.OU(F,De,b)}else this.cz(ee)==-1&&(W==null&&(W=new _(this)),this.D(ee,J),W.kX(J),Ee=F.IW(W),he=this.Hl,Ee!=-1&&(De=F.ja(Ee),this.$e(De)==this.$e(this.xa(De))&&(De=this.OF(F,Ee)),De!=-1&&(he=this.$e(De))),this.cN(he,ee))}this.Jg(j)},g.prototype.OU=function(b,C,O){var F=b.ja(C),N=this.$e(F);if(this.Gn(N)==-1){var j=this.OF(b,C),W=this.xa(F),q=this.$e(W);this.Kp(N),this.Kp(q);var J=this.Gn(N),ee=this.Gn(q);if(j==-1&&J==-1&&(q==N?(this.jn(q,this.Hl),J=ee=this.Hl):(ee==-1&&(this.jn(q,this.Hl),ee=this.Hl),this.jn(N,q),J=q)),j!=-1){var he=this.$e(j);ee==-1&&(0>=this.Kp(he)?(ee=this.Gn(he),this.jn(q,ee)):(this.jn(q,he),ee=he),q==N&&(J=ee))}J==-1&&this.hY(N,q),O==0?this.jW(b,C,F,j,N,q):O==5?this.kW(b,C,F,W,N,q):O==4&&this.iW(F,j,N,q)}},g.prototype.jW=function(b,C,O,F,N,j){var W=this.hk(N);if(F!=-1){var q=this.hk(j),J=this.hk(this.$e(F));F=W&q&J,J^=J&this.dh(O),(J|=F)!=0&&(this.Vg(j,q|J),this.Vg(N,J|W),W=W||J)}for(C=b.lb(C);C!=-1&&(F=b.ja(C),O=this.$e(this.xa(F)),N=this.hk(O),j=this.dh(F),q=this.$e(F),F=N&(J=this.hk(q))&W,W^=W&j,(W|=F)!=0);C=b.lb(C))this.Vg(O,N|W),this.Vg(q,J|W)},g.prototype.kW=function(b,C,O,F,N,j){if(N!=j){O=this.Ab(O,this.cg),O+=this.Ab(F,this.cg),F=0;var W=new A.ia(0),q=new A.ia(0);q.add(0);for(var J=b.rc(-1);J!=C;J=b.lb(J)){var ee=b.ja(J),he=this.xa(ee),Ee=this.$e(ee),De=this.$e(he);if(Ee!=De){if(ee=this.Ab(ee,this.cg),F+=ee+=this.Ab(he,this.cg),he=!1,W.size!=0&&W.Fc()==De&&(q.If(),W.If(),he=!0),this.Gn(De)==-1)throw A.i.Qa();he&&this.Gn(De)==Ee||(q.add(F),W.add(Ee))}}F+=O,W.size!=0&&W.Fc()==j&&(q.If(),W.If()),F!=0?q.Fc()==0&&(b=this.g.ld,b=this.La(b),this.Vg(N,b)):q.Fc()!=0&&(b=this.g.ld,b=this.La(b),this.Vg(N,b))}},g.prototype.iW=function(b,C,O,F){var N=this.La(this.g.ld);if(C==-1)this.Vg(F,this.Go),1&(b=this.Ab(b,this.xg))?this.Vg(O,N):this.Vg(O,this.Go);else{var j=this.hk(F);j==0?(j=this.hk(this.$e(C)),this.Vg(F,j),1&(b=this.Ab(b,this.xg))?this.Vg(O,j==N?this.Go:N):this.Vg(O,j)):1&(b=this.Ab(b,this.xg))?this.Vg(O,j==N?this.Go:N):this.Vg(O,j)}},g.prototype.gY=function(b,C,O,F){var N=F,j=-1,W=-1,q=0;do{if(q==2)return!1;var J=this.Ab(N,C);if(J!=-1){if(j!=-1)return!1;j=J}else{if(W!=-1)return!1;W=N}q++,N=this.jc(this.xa(N))}while(F!=N);return W!=-1&&j!=-1&&(this.Kb(b.ja(j),C,-2),b.Sj(j,W),O.add(j),!0)},g.prototype.hY=function(b,C){var O=this.Kp(b);if(O!=0){var F=this.Kp(C);0F||0>O&&0ee.compare(N)?J=1:j=-1,this.Kb(Ee,this.ae,0),this.Kb(he,this.ae,0),this.Kb(he,this.cg,J),this.Kb(Ee,this.cg,j)):b==7?(this.Kb(Ee,this.ae,this.Go),this.Kb(he,this.ae,q==1736?W:0)):b==4&&(this.Kb(Ee,this.ae,0),this.Kb(he,this.ae,0),this.Kb(he,this.xg,1),this.Kb(Ee,this.xg,1)),q=q==1736?this.aO:0,this.$w(he,W|q),this.$w(Ee,W|q)}}}}},g.prototype.VT=function(b,C){var O=this.mm(C);if(O!=-1){var F=this.mm(b);this.jh.S(O,1,F),this.Gt(b,O),this.Gt(C,-1)}b=this.xa(b),C=this.xa(C),(O=this.mm(C))!=-1&&(F=this.mm(b),this.jh.S(O,1,F),this.Gt(b,O),this.Gt(C,-1))},g.prototype.IX=function(b){function C(ei,Xt){return F.HO(ei,Xt)}var O=new A.ia(0);O.Jb(10);for(var F=this,N=this.Re;N!=-1;N=this.Rf(N)){O.clear(!1);var j=this.Me(N);if(j!=-1){var W=j;do O.add(W),W=this.jc(this.xa(W));while(W!=j);if(1_.Db())return G.ki(G.Xe(_.Ia()),E,"&")}return O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.Av(F,_),E=G.ki(C.Ne(b),E,"&"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.bW=function(E,_,g){if(E.B()||_.B())return E.Ia();var b=[null],C=[0],O=_.Db()==2;if(_.Db()!=1&&_.Db()!=2)throw A.i.Qa();return b[0]=E.D(),O?A.hd.sK(_,b,1,g,C):A.hd.tK(_,b,1,g,C),C[0]==0?E.Ia():E},G.prototype.LU=function(E,_,g,b,C){if(E.B())return E;var O=new A.gd;return E=O.Ib(E),this.Mk(O,E,_,g,b,C)},G.prototype.NU=function(E,_,g,b,C,O){if(C&&E.ic(_)!=550){var F=new A.RC;F.TX(E,g),F.Ng?(A.Tk.V(E,g,O,!0),C=!1):this.j.yy(g)}else A.Tk.V(E,g,O,!0),C=!1;if(b&&E.ic(_)!=550?this.j.wJ(E,_,O):this.j.vJ(E,_,O),this.j.pA)return this.j.Ug(),this.j=null,this.Mk(E,_,g,b,!1,O);if(this.j.yy(NaN),O=this.j.La(_),this.bq(O+1),this.Gj[O]=!0,E.ic(_)==1736||b&&E.ic(_)!=550)return E.Yo(_,0),_=this.Ot(_,-1,-1),(E=E.Ne(_)).Yo(0),C?E.Ch(1,0):(E.Ch(2,g),E.fm()),E;if(E.ic(_)==1607)return _=this.Pt(-1),E=E.Ne(_),C||E.Ch(2,g),E;if(E.ic(_)==550)return _=this.mr(),E=E.Ne(_),C||E.Ch(2,g),E;throw A.i.Qa()},G.prototype.Mk=function(E,_,g,b,C,O){this.j=new A.iu;try{return this.NU(E,_,g,b,C,O)}finally{this.j.Ug()}},G.Mk=function(E,_,g,b,C){return new G().LU(E,_,g,b,C)},G.prototype.MU=function(E,_,g,b){this.Mv=E,this.j=new A.iu,E=_.In(g);var C=_.ic(g);if(E!=1||C==550?this.j.vJ(_,g,b):this.j.wJ(_,g,b),!this.j.pA)if(this.j.yy(NaN),b=this.j.La(g),this.bq(b+1),this.Gj[b]=!0,_.ic(g)==1736||E==1&&_.ic(g)!=550)_.Yo(g,0),b=this.Ot(g,-1,-1),_.hC(b,g),_.BB(b);else if(_.ic(g)==1607)b=this.Pt(-1),_.hC(b,g),_.BB(b);else{if(_.ic(g)!=550)throw A.i.fa("internal error");b=this.mr(),_.hC(b,g),_.BB(b)}},G.prototype.im=function(E,_){var g=A.aa.tf(this.j.g.ic(E)),b=A.aa.tf(this.j.g.ic(_));if(g>b)return E;var C=this.j.La(E),O=this.j.La(_);if(this.bq(1+(C|O)),this.Gj[this.j.La(E)]=!0,g==2&&b==2)return this.Ot(E,_,-1);if(g==1&&b==2||g==1&&b==1)return this.Pt(-1);if(g==0)return this.mr();throw A.i.Qa()},G.prototype.Av=function(E,_){var g=A.aa.tf(this.j.g.ic(E)),b=A.aa.tf(this.j.g.ic(_)),C=this.j.La(E),O=this.j.La(_);if(this.bq(1+(C|O)),this.Gj[this.j.La(E)|this.j.La(_)]=!0,C=-1,1_.Db())return G.ki(G.Xe(E),E,"-");var C=new A.l;E.A(C);var O=new A.l;if(_.A(O),!C.isIntersecting(O))return G.ki(G.Xe(E),E,"-");var F=new A.l;return F.K(C),F.Zb(O),g=A.ta.Wd(g,F,!0),O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.im(F,_),b=C.Ne(b),E=G.ki(b,E,"-"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.VP=function(E,_,g){if(2>E.length)throw A.i.N("not enough geometries to dissolve");for(var b=0,C=0,O=E.length;CW?G.Xe(E[q]):(E=b==2,_=A.ta.Wd(b==0?_:null,F,!0),new G().Mk(N,j,_,E,!0,g))},G.Pz=function(E,_,g,b){var C=[null,null,null],O=new A.l;E.A(O);var F=new A.l;_.A(F);var N=new A.l;if(N.K(O),N.Zb(F),g=A.ta.Wd(g,N,!0),(N=new A.l).K(F),F=A.ta.Er(g),N.W(F,F),!O.isIntersecting(N)){if(E.Db()<=_.Db())return C[(E=G.ki(G.Xe(E.Ia()),E,"&")).Db()]=E,C;if(E.Db()>_.Db())return C[(E=G.ki(G.Xe(_.Ia()),E,"&")).Db()]=E,C}for(F=new G,N=(O=new A.gd).Ib(G.Xe(E)),_=O.Ib(G.Xe(_)),F.Ft(O,g,b),b=F.Pz(N,_),_=0;__.Db())return G.ki(G.Xe(E),E,"^");if(E.Db()<_.Db()||E.B())return G.ki(G.Xe(_),E,"^");if(_.B())return G.ki(G.Xe(E),E,"^");var C=new A.l;E.A(C);var O=new A.l;_.A(O);var F=new A.l;return F.K(C),F.Zb(O),g=A.ta.Wd(g,F,!0),O=new G,F=(C=new A.gd).Ib(G.Xe(E)),_=C.Ib(G.Xe(_)),O.Ft(C,g,b),b=O.ep(F,_),E=G.ki(C.Ne(b),E,"^"),A.aa.Hc(E.getType())&&(E.Ch(2,g),E.getType()==1736&&E.fm()),E},G.prototype.LQ=function(E,_){var g=this.j.g;E=g.vf(E,-1);for(var b=_.size,C=0;Cg;g++)_[g]=new A.h;E.nB(_),this.fY(_,_),E.Zw(_,4)}},G.prototype.fY=function(E,_){for(var g=0;g(_=.5*_.Sk())?Math.sqrt(b):Math.sqrt(_))},G.prototype.RB=function(){this.bb=1,this.jb=this.Gb=this.eb=0,this.ab=1,this.Lb=0},G.prototype.isIdentity=function(E){if(E!==void 0){var _=A.h.construct(0,1);return this.Eh(_,_),_.sub(A.h.construct(0,1)),_.Sk()>E*E?!1:(_.ma(0,0),this.Eh(_,_),!(_.Sk()>E*E)&&(_.ma(1,0),this.Eh(_,_),_.sub(A.h.construct(1,0)),_.Sk()<=E*E))}return this.bb==1&&this.ab==1&&this.eb==0&&this.Gb==0&&this.jb==0&&this.Lb==0},G.prototype.Bi=function(E){return Math.abs(this.bb*this.ab-this.jb*this.eb)<=2*E*(Math.abs(this.bb*this.ab)+Math.abs(this.jb*this.eb))},G.prototype.gg=function(E,_){this.bb=1,this.eb=0,this.Gb=E,this.jb=0,this.ab=1,this.Lb=_},G.prototype.setScale=function(E,_){_!==void 0?(this.bb=E,this.jb=this.Gb=this.eb=0,this.ab=_,this.Lb=0):this.setScale(E,E)},G.prototype.$B=function(){this.bb=0,this.eb=1,this.Gb=0,this.jb=1,this.Lb=this.ab=0},G.prototype.setRotate=function(E){this.pX(Math.cos(E),Math.sin(E))},G.prototype.pX=function(E,_){this.bb=E,this.eb=-_,this.Gb=0,this.jb=_,this.ab=E,this.Lb=0},G.prototype.shift=function(E,_){this.Gb+=E,this.Lb+=_},G.prototype.scale=function(E,_){this.bb*=E,this.eb*=E,this.Gb*=E,this.jb*=_,this.ab*=_,this.Lb*=_},G.prototype.flipX=function(E,_){this.bb=-this.bb,this.eb=-this.eb,this.Gb=E+_-this.Gb},G.prototype.flipY=function(E,_){this.jb=-this.jb,this.ab=-this.ab,this.Lb=E+_-this.Lb},G.prototype.rotate=function(E){var _=new G;_.setRotate(E),this.multiply(_)},G.prototype.inverse=function(E){if(E!==void 0){var _=this.bb*this.ab-this.eb*this.jb;_==0?E.lx():(_=1/_,E.Gb=(this.eb*this.Lb-this.Gb*this.ab)*_,E.Lb=(this.Gb*this.jb-this.bb*this.Lb)*_,E.bb=this.ab*_,E.eb=-this.eb*_,E.jb=-this.jb*_,E.ab=this.bb*_)}else this.inverse(this)},G}();A.Dd=ue}(ye||(ye={})),function(A){var ue=function(){function G(){}return G.prototype.lx=function(){this.hg=this.Lb=this.Gb=this.He=this.Fe=this.Ee=this.Ge=this.ab=this.eb=this.Ze=this.jb=this.bb=0},G.prototype.setScale=function(E,_,g){this.bb=E,this.eb=this.Ze=this.jb=0,this.ab=_,this.Fe=this.Ee=this.Ge=0,this.He=g,this.hg=this.Lb=this.Gb=0},G.prototype.setTranslate=function(E,_,g){this.bb=1,this.eb=this.Ze=this.jb=0,this.ab=1,this.Fe=this.Ee=this.Ge=0,this.He=1,this.Gb=E,this.Lb=_,this.hg=g},G.prototype.translate=function(E,_,g){this.Gb+=E,this.Lb+=_,this.hg+=g},G.prototype.mC=function(E){if(!E.B()){for(var _=new A.Nd[8],g=0;8>g;g++)_[g]=new A.Nd;E.nB(_),this.transform(_,8,_),E.Zw(_)}},G.prototype.transform=function(E,_,g){for(var b=0;b<_;b++){var C=new A.Nd,O=E[b];C.x=this.bb*O.x+this.eb*O.y+this.Ee*O.z+this.Gb,C.y=this.jb*O.x+this.ab*O.y+this.Fe*O.z+this.Lb,C.z=this.Ze*O.x+this.Ge*O.y+this.He*O.z+this.hg,g[b]=C}},G.prototype.fp=function(E){var _=new A.Nd;return _.x=this.bb*E.x+this.eb*E.y+this.Ee*E.z+this.Gb,_.y=this.jb*E.x+this.ab*E.y+this.Fe*E.z+this.Lb,_.z=this.Ze*E.x+this.Ge*E.y+this.He*E.z+this.hg,_},G.prototype.Ag=function(E){G.multiply(this,E,this)},G.multiply=function(E,_,g){var b=E.bb*_.bb+E.jb*_.eb+E.Ze*_.Ee,C=E.bb*_.jb+E.jb*_.ab+E.Ze*_.Fe,O=E.bb*_.Ze+E.jb*_.Ge+E.Ze*_.He,F=E.eb*_.bb+E.ab*_.eb+E.Ge*_.Ee,N=E.eb*_.jb+E.ab*_.ab+E.Ge*_.Fe,j=E.eb*_.Ze+E.ab*_.Ge+E.Ge*_.He,W=E.Ee*_.bb+E.Fe*_.eb+E.He*_.Ee,q=E.Ee*_.jb+E.Fe*_.ab+E.He*_.Fe,J=E.Ee*_.Ze+E.Fe*_.Ge+E.He*_.He,ee=E.Gb*_.bb+E.Lb*_.eb+E.hg*_.Ee+_.Gb,he=E.Gb*_.jb+E.Lb*_.ab+E.hg*_.Fe+_.Lb;E=E.Gb*_.Ze+E.Lb*_.Ge+E.hg*_.He+_.hg,g.bb=b,g.jb=C,g.Ze=O,g.eb=F,g.ab=N,g.Ge=j,g.Ee=W,g.Fe=q,g.He=J,g.Gb=ee,g.Lb=he,g.hg=E},G.inverse=function(E,_){var g=E.bb*(E.ab*E.He-E.Ge*E.Fe)-E.jb*(E.eb*E.He-E.Ge*E.Ee)+E.Ze*(E.eb*E.Fe-E.ab*E.Ee);if(g==0)throw A.i.fa("math singularity");var b=1/g;g=(E.ab*E.He-E.Ge*E.Fe)*b;var C=-(E.eb*E.He-E.Ge*E.Ee)*b,O=(E.eb*E.Fe-E.ab*E.Ee)*b,F=-(E.jb*E.He-E.Fe*E.Ze)*b,N=(E.bb*E.He-E.Ze*E.Ee)*b,j=-(E.bb*E.Fe-E.jb*E.Ee)*b,W=(E.jb*E.Ge-E.Ze*E.ab)*b,q=-(E.bb*E.Ge-E.Ze*E.eb)*b;b*=E.bb*E.ab-E.jb*E.eb;var J=-(E.Gb*g+E.Lb*C+E.hg*O),ee=-(E.Gb*F+E.Lb*N+E.hg*j);E=-(E.Gb*W+E.Lb*q+E.hg*b),_.bb=g,_.jb=F,_.Ze=W,_.eb=C,_.ab=N,_.Ge=q,_.Ee=O,_.Fe=j,_.He=b,_.Gb=J,_.Lb=ee,_.hg=E},G.prototype.Of=function(){var E=new G;return E.bb=this.bb,E.jb=this.jb,E.Ze=this.Ze,E.eb=this.eb,E.ab=this.ab,E.Ge=this.Ge,E.Ee=this.Ee,E.Fe=this.Fe,E.He=this.He,E.Gb=this.Gb,E.Lb=this.Lb,E.hg=this.hg,E},G}();A.JY=ue}(ye||(ye={})),function(A){var ue=function(E){function _(g){if(g!==void 0)g=E.call(this,g.cc(),g)||this;else{(g=E.call(this)||this).bg=[],g.bg[0]=0,g.Aa=1,g.uh=[];for(var b=0;10>b;b++)g.uh[b]=-1;g.uh[g.bg[0]]=0}return g.jq=!0,g}return me(_,E),_.prototype.re=function(g){this.hasAttribute(g)||(this.uh[g]=0,this.jD())},_.prototype.removeAttribute=function(g){if(g==0)throw A.i.N("Position attribue cannot be removed");this.hasAttribute(g)&&(this.uh[g]=-1,this.jD())},_.prototype.reset=function(){this.bg[0]=0,this.Aa=1;for(var g=0;gg;g++)0<=this.uh[g]&&(this.bg[b]=g,this.uh[g]=b,b++,this.Aa++);this.jq=!0},_.prototype.cc=function(){return this.jq&&(this.wl=this.An(),this.jq=!1),this.wl},_.prototype.Nb=function(g){if(g==null)return!1;if(g==this)return!0;if(!(g instanceof _)||g.Aa!=this.Aa)return!1;for(var b=0;bO;O++)!g.hasAttribute(O)&&b.hasAttribute(O)&&(C==null&&(C=new _(g)),C.re(O));return C!=null?C.EF():g},_}(A.ra);A.ee=ue;var G=function(){function E(){this.map=[];var _=new ue;this.add(_),(_=new ue).re(1),this.add(_)}return E.kz=function(){return E.bL},E.prototype.$R=function(){return E.ft},E.prototype.add=function(_){var g=_.cc();if(E.ft!=null&&E.ft.cc()==g&&_.GG(E.ft))return E.ft;if(E.Dw!=null&&E.Dw.cc()==g&&_.GG(E.Dw))return E.Dw;var b=null;return this.map[g]!==void 0&&(b=this.map[g]),b==null&&((b=_.tM()).Aa==1?E.ft=b:b.Aa==2&&b.kd(1)==1?E.Dw=b:this.map[g]=b),b},E.bL=new E,E}()}(ye||(ye={}));var ht={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Ht={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},_t=new(function(){function A(){this.RM=50,this.np=new Map,this.gj=[]}return A.prototype.clear=function(){this.gj.length=0,this.np.clear()},A.prototype.delete=function(ue){return!!this.np.delete(ue)&&(this.gj.splice(this.gj.indexOf(ue),1),!0)},A.prototype.get=function(ue){var G=this.np.get(ue);if(G!==void 0)return this.gj[0]!==ue&&(this.gj.splice(this.gj.indexOf(ue),1),this.gj.unshift(ue)),G},A.prototype.has=function(ue){return this.np.has(ue)},A.prototype.set=function(ue,G){return this.get(ue)!==void 0&&this.delete(ue),this.gj.unshift(ue),this.np.set(ue,G),this.oM(),this},A.prototype.oM=function(){for(;this.gj.length&&this.gj.length>this.RM;){var ue=this.gj.pop();this.np.delete(ue)}},A}()),Fe=((Ze={}).convertJSONToGeometry=function(A){return ye.$b.fP(A)},Ze.hasM=function(A){return A.hasAttribute(ye.Ih.M)},Ze.hasZ=function(A){return A.hasAttribute(ye.Ih.Z)},Ze.getPointX=function(A){return A.Lg()},Ze.getPointY=function(A){return A.ih()},Ze.getPointZ=function(A){return A.bS()},Ze.getPointM=function(A){return A.zR()},Ze.getXMin=function(A){return A.es()},Ze.getYMin=function(A){return A.gs()},Ze.getXMax=function(A){return A.ds()},Ze.getYMax=function(A){return A.fs()},Ze.getZExtent=function(A){return A.Tg(ye.Ih.Z,0)},Ze.getMExtent=function(A){return A.Tg(ye.Ih.M,0)},Ze.exportPaths=function(A){var ue=[],G=A.da(),E=null,_=null,g=A.hasAttribute(ye.Ih.Z),b=A.hasAttribute(ye.Ih.M);g&&(E=A.ub(ye.Ih.Z)),b&&(_=A.ub(ye.Ih.M));for(var C=new ye.h,O=0;OHKt)).default({title:t.parsedUrl.title});return await A7r(n,t,r),n}function spt(i,e){return i?i.find(t=>t.id===e):null}async function A7r(i,e,t){function r(s,o,a,l){const u={...t,layerId:o,sublayerTitleMode:"service-name"};return s!=null&&(u.url=s),a!=null&&(u.sourceJSON=a),l(u)}const n=e.sublayerConstructorProvider;for(const{id:s,serverUrl:o}of e.layers){const a=spt(e.sublayerInfos,s),l=(a&&n?.(a))??e.Constructor,u=r(o,s,a,c=>new l(c));i.add(u)}if(e.tables.length){const s=await rbe("FeatureLayer");e.tables.forEach(({id:o,serverUrl:a})=>{const l=r(a,o,spt(e.tableInfos,o),u=>new s(u));i.tables.add(l)})}}async function M7r(i,e){let t=r_(i);if(t==null&&(t=await O7r(i,e)),t==null)throw new qe("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:i});const{serverType:r,sublayer:n}=t;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},a=r==="FeatureServer",l=r==="SceneServer",u={parsedUrl:t,Constructor:null,layerId:a||l?n??void 0:void 0,layers:[],tables:[]};switch(r){case"MapServer":n!=null?s="FeatureLayer":s=await D7r(i,e)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const c=await IS(i,{customParameters:e}),{tileInfo:h,cacheType:p}=c;s=h?h?.format?.toUpperCase()!=="LERC"||p&&p.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const c=await IS(t.url.path,{customParameters:e});if(s="SceneLayer",c){const h=c?.layers;if(c?.layerType==="Voxel")s="VoxelLayer";else if(h?.length){const p=h[0]?.layerType;p!=null&&_ie[p]!=null&&(s=_ie[p])}}break}case"3DTilesServer":throw new qe("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(s="FeatureLayer",n!=null){const c=await IS(i,{customParameters:e});u.sourceJSON=c,c.type==="Oriented Imagery Layer"&&(s="OrientedImageryLayer")}break;default:s=o[r]}if(E7r[s]&&n==null){const c=await P7r(i,r,e);if(a&&(u.sublayerInfos=c.layerInfos,u.tableInfos=c.tableInfos),c.layers.length+c.tables.length!==1)u.layers=c.layers,u.tables=c.tables,a&&c.layerInfos?.length&&(u.sublayerConstructorProvider=await F7r(c.layerInfos));else if(a||l){const h=c.layerInfos?.[0]??c.tableInfos?.[0];u.layerId=c.layers[0]?.id??c.tables[0]?.id,u.sourceJSON=h,a&&h?.type==="Oriented Imagery Layer"&&(s="OrientedImageryLayer")}}return u.Constructor=await rbe(s),u}async function O7r(i,e){const t=await IS(i,{customParameters:e});let r=null,n=null;const s=t.type;if(s==="Feature Layer"||s==="Table"?(r="FeatureServer",n=t.id??null):s==="indexedVector"?r="VectorTileServer":t.hasOwnProperty("mapName")?r="MapServer":t.hasOwnProperty("bandCount")&&t.hasOwnProperty("pixelSizeX")?r="ImageServer":t.hasOwnProperty("maxRecordCount")&&t.hasOwnProperty("allowGeometryUpdates")?r="FeatureServer":t.hasOwnProperty("streamUrls")?r="StreamServer":opt(t)?(r="SceneServer",n=t.id):t.hasOwnProperty("layers")&&opt(t.layers?.[0])&&(r="SceneServer"),!r)return null;const o=n!=null?fOt(i):null;return{title:o!=null&&t.name||o2e(i),serverType:r,sublayer:n,url:{path:o!=null?o.serviceUrl:Yo(i).path}}}function opt(i){return i!=null&&i.hasOwnProperty("store")&&i.hasOwnProperty("id")&&typeof i.id=="number"}async function P7r(i,e,t){let r,n,s=!1;switch(e){case"FeatureServer":{const l=await bXe(i,{customParameters:t});s=!!l.layersJSON,r=l.layersJSON||l.serviceJSON;break}case"SceneServer":{const l=await R7r(i,t);r=l.serviceInfo,n=l.tableServerUrl;break}default:r=await IS(i,{customParameters:t})}const o=r?.layers,a=r?.tables;return{layers:o?.map(l=>({id:l.id})).reverse()||[],tables:a?.map(l=>({serverUrl:n,id:l.id})).reverse()||[],layerInfos:s?o:[],tableInfos:s?a:[]}}async function R7r(i,e){const t=await IS(i,{customParameters:e});if(!t.layers?.[0])return{serviceInfo:t};try{const{serverUrl:n}=await lle(i),s=await IS(n,{customParameters:e}).catch(()=>null);return s&&(t.tables=s.tables),{serviceInfo:t,tableServerUrl:n}}catch{return{serviceInfo:t}}}async function rbe(i){return(0,xv[i])()}async function D7r(i,e){return(await IS(i,{customParameters:e})).tileInfo}async function F7r(i){const e=[],t=[];if(i.forEach(s=>{const{type:o}=s;o==="Oriented Imagery Layer"?(e.push(o),t.push(rbe("OrientedImageryLayer"))):(e.push(o),t.push(rbe("FeatureLayer")))}),!t.length)return;const r=await Promise.all(t),n=new Map;return e.forEach((s,o)=>{n.set(s,r[o])}),s=>n.get(s.type)}const k7r=Object.freeze(Object.defineProperty({__proto__:null,fromUrl:I7r},Symbol.toStringTag,{value:"Module"}));function ZBt(i){return mW(i)||t1e(i)||i1e(i)}function QBt(i,e){const{format:t,timeZoneOptions:r,fieldType:n}=e??{};let s,o;if(r&&({timeZone:s,timeZoneName:o}=IAt(r.layerTimeZone,r.datesInUnknownTimezone,r.viewTimeZone,T6(t||"short-date-short-time"),n)),typeof i=="string"&&isNaN(Date.parse(n==="time-only"?`1970-01-01T${i}Z`:i)))return i;switch(n){case"date-only":{const a=T6(t||"short-date");return typeof i=="string"?rZi(i,{...a}):vb(i,{...a,timeZone:y0})}case"time-only":{const a=T6(t||"short-time");return typeof i=="string"?nZi(i,a):vb(i,{...a,timeZone:y0})}case"timestamp-offset":{if(!s&&typeof i=="string"&&new Date(i).toISOString()!==i)return i;const a=t||r?T6(t||"short-date-short-time"):void 0,l=a?{...a,timeZone:s,timeZoneName:o}:void 0;return typeof i=="string"?sZi(i,l):vb(i,l)}default:{const a=t||r?T6(t||"short-date-short-time"):void 0;return vb(typeof i=="string"?new Date(i):i,a?{...a,timeZone:s,timeZoneName:o}:void 0)}}}const L7r="",N7r="equal-interval",$7r=1,B7r=5,j7r=10,G7r=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,U7r=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),z7r=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),V7r=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function RC(i){return i==null||typeof i=="string"&&!i?L7r:i}function wXe(i){const e=i.normalizationField!=null||i.normalizationType!=null,t=i.minValue!=null||i.maxValue!=null,r=!!i.sqlExpression&&i.supportsSQLExpression;return!e&&!t&&!r}function I6e(i){const e=i.returnDistinct?[...new Set(i.values)]:i.values,t=e.filter(s=>s!=null).sort(),r=t.length,n={count:r,min:t[0],max:t[r-1]};return i.supportsNullCount&&(n.nullcount=e.length-r),i.percentileParams&&(n.median=xXe(e,i.percentileParams)),n}function nbe(i){const{values:e,useSampleStdDev:t,supportsNullCount:r}=i;let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=null,a=null,l=null,u=null,c=0;const h=i.minValue==null?-1/0:i.minValue,p=i.maxValue==null?1/0:i.maxValue;for(const v of e)Number.isFinite(v)?v>=h&&v<=p&&(o=o===null?v:o+v,n=Math.min(n,v),s=Math.max(s,v),c++):typeof v=="string"&&c++;if(c&&o!=null){a=o/c;let v=0;for(const w of e)Number.isFinite(w)&&w>=h&&w<=p&&(v+=(w-a)**2);u=t?c>1?v/(c-1):0:c>0?v/c:0,l=Math.sqrt(u)}else n=null,s=null;const m={avg:a,count:c,max:s,min:n,stddev:l,sum:o,variance:u};return r&&(m.nullcount=e.length-c),i.percentileParams&&(m.median=xXe(e,i.percentileParams)),m}function xXe(i,e){const{fieldType:t,value:r,orderBy:n,isDiscrete:s}=e,o=SXe(t,n==="desc");if((i=[...i].filter(m=>m!=null).sort((m,v)=>o(m,v))).length===0)return null;if(r<=0)return i[0];if(r>=1)return i[i.length-1];const a=(i.length-1)*r,l=Math.floor(a),u=l+1,c=a%1,h=i[l],p=i[u];return u>=i.length||s||typeof h=="string"||typeof p=="string"?h:h*(1-c)+p*c}function SXe(i,e){if(i){if(U7r.has(i))return apt(e);if(z7r.has(i))return FOe(e,!1);if(i==="esriFieldTypeTimestampOffset")return Y7r(e);const s=FOe(e,!0);if(i==="esriFieldTypeString")return s;if(i==="esriFieldTypeGUID"||i==="esriFieldTypeGlobalID")return(o,a)=>s(lpt(o),lpt(a))}const t=e?1:-1,r=apt(e),n=FOe(e,!0);return(s,o)=>typeof s=="number"&&typeof o=="number"?r(s,o):typeof s=="string"&&typeof o=="string"?n(s,o):t}const zTe=(i,e)=>i==null?e==null?0:1:e==null?-1:null,VTe=(i,e)=>i==null?e==null?0:-1:e==null?1:null;function H7r(i){return i?zTe:VTe}const W7r=(i,e)=>VTe(i,e)??(i===e?0:new Date(i).getTime()-new Date(e).getTime()),q7r=(i,e)=>zTe(i,e)??(i===e?0:new Date(e).getTime()-new Date(i).getTime());function Y7r(i){return i?q7r:W7r}const X7r=(i,e)=>VTe(i,e)??(i===e?0:izTe(i,e)??(i===e?0:i{const s=t(r,n);return s??((r=r.toUpperCase())>(n=n.toUpperCase())?-1:r{const s=t(r,n);return s??((r=r.toUpperCase())<(n=n.toUpperCase())?-1:r>n?1:0)}}const K7r=(i,e)=>zTe(i,e)??e-i,Z7r=(i,e)=>VTe(i,e)??i-e;function apt(i){return i?K7r:Z7r}function lpt(i){return i.substr(24,12)+i.substr(19,4)+i.substr(16,2)+i.substr(14,2)+i.substr(11,2)+i.substr(9,2)+i.substr(6,2)+i.substr(4,2)+i.substr(2,2)+i.substr(0,2)}function e7t(i,e){let t;for(t in i)V7r.includes(t)&&(Number.isFinite(i[t])||(i[t]=null));return e&&["avg","stddev","variance"].forEach(r=>{i[r]!=null&&(i[r]=Math.ceil(i[r]??0))}),i}function t7t(i){const e={};for(let t of i)(t==null||typeof t=="string"&&t.trim()==="")&&(t=null),e[t]==null?e[t]={count:1,data:t}:e[t].count++;return{count:e}}function kOe(i){return i?.type!=="coded-value"?[]:i.codedValues.map(e=>e.code)}function i7t(i,e,t,r){const n=i.count,s=[];if(t&&e){const o=[],a=kOe(e[0]);for(const l of a)if(e[1]){const u=kOe(e[1]);for(const c of u)if(e[2]){const h=kOe(e[2]);for(const p of h)o.push(`${RC(l)}${r}${RC(c)}${r}${RC(p)}`)}else o.push(`${RC(l)}${r}${RC(c)}`)}else o.push(l);for(const l of o)n.hasOwnProperty(l)||(n[l]={data:l,count:0})}for(const o in n){const a=n[o];s.push({value:a.data,count:a.count,label:a.label})}return{uniqueValueInfos:s}}function r7t(i,e,t,r){let n=null;switch(e){case"log":i!==0&&(n=Math.log(i)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(r)&&r!==0&&(n=i/r*100);break;case"field":Number.isFinite(t)&&t!==0&&(n=i/t);break;case"natural-log":i>0&&(n=Math.log(i));break;case"square-root":i>0&&(n=i**.5)}return n}function TXe(i,e){const t=ejr({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||B7r});return i=Q7r(i,e.minValue,e.maxValue),rcr({definition:t,values:i,normalizationTotal:e.normalizationTotal})}function Q7r(i,e,t){const r=e??-1/0,n=t??1/0;return i.filter(s=>Number.isFinite(s)&&s>=r&&s<=n)}function ejr(i){const{breakCount:e,field:t,normalizationField:r,normalizationType:n}=i,s=i.classificationMethod||N7r,o=s==="standard-deviation"?i.standardDeviationInterval||$7r:void 0;return new tcr({breakCount:e,classificationField:t,classificationMethod:s,normalizationField:n==="field"?r:void 0,normalizationType:n,standardDeviationInterval:o})}function n7t(i,e){let t=i.classBreaks;const r=t.length,n=t[0]?.minValue,s=t[r-1]?.maxValue,o=e==="standard-deviation",a=G7r;return t=t.map(l=>{const u=l.label,c={minValue:l.minValue,maxValue:l.maxValue,label:u};if(o&&u){const h=u.match(a),p=h?.map(m=>+m.trim())??[];p.length===2?(c.minStdDev=p[0],c.maxStdDev=p[1],p[0]<0&&p[1]>0&&(c.hasAvg=!0)):p.length===1&&(u.includes("<")?(c.minStdDev=null,c.maxStdDev=p[0]):u.includes(">")&&(c.minStdDev=p[0],c.maxStdDev=null))}return c}),{minValue:n,maxValue:s,classBreakInfos:t,normalizationTotal:i.normalizationTotal}}function s7t(i,e){const t=tjr(i,e);if(t.min==null&&t.max==null)return{bins:[],minValue:t.min,maxValue:t.max,normalizationTotal:e.normalizationTotal};const r=t.intervals,n=t.min??0,s=t.max??0,o=r.map((a,l)=>({minValue:r[l][0],maxValue:r[l][1],count:0}));for(const a of i)if(a!=null&&a>=n&&a<=s){const l=ijr(r,a);l>-1&&o[l].count++}return{bins:o,minValue:n,maxValue:s,normalizationTotal:e.normalizationTotal}}function tjr(i,e){const{field:t,classificationMethod:r,standardDeviationInterval:n,normalizationType:s,normalizationField:o,normalizationTotal:a,minValue:l,maxValue:u}=e,c=e.numBins||j7r;let h=null,p=null,m=null;if((!r||r==="equal-interval")&&!s){if(l!=null&&u!=null)h=l,p=u;else{const v=nbe({values:i,minValue:l,maxValue:u,useSampleStdDev:!s,supportsNullCount:wXe({normalizationType:s,normalizationField:o,minValue:l,maxValue:u})});h=v.min??null,p=v.max??null}m=rjr(h??0,p??0,c)}else{const{classBreaks:v}=TXe(i,{field:t,normalizationType:s,normalizationField:o,normalizationTotal:a,classificationMethod:r,standardDeviationInterval:n,minValue:l,maxValue:u,numClasses:c});h=v[0].minValue,p=v[v.length-1].maxValue,m=v.map(w=>[w.minValue,w.maxValue])}return{min:h,max:p,intervals:m}}function ijr(i,e){let t=-1;for(let r=i.length-1;r>=0;r--)if(e>=i[r][0]){t=r;break}return t}function rjr(i,e,t){const r=(e-i)/t,n=[];let s,o=i;for(let a=1;a<=t;a++)s=o+r,s=Number(s.toFixed(16)),n.push([o,a===t?e:s]),o=s;return n}let MD=null;const njr=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;function sjr(i,e,t){return i.x<0?i.x+=e:i.x>t&&(i.x-=e),i}function ojr(i,e,t,r){const n=_Et(t)?Zp(t):null,s=n?Math.round((n.valid[1]-n.valid[0])/e.scale[0]):null;return i.map(o=>{const a=new $i(o.geometry);return cir(e,a,a,a.hasZ,a.hasM),o.geometry=n?sjr(a,s??0,r[0]):a,o})}function ajr(i,e=18,t,r,n){const s=new Float64Array(r*n);e=Math.round(us(e));let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const l=Air(t);for(const{geometry:u,attributes:c}of i){const{x:h,y:p}=u,m=Math.max(0,h-e),v=Math.max(0,p-e),w=Math.min(n,p+e),S=Math.min(r,h+e),I=+l(c);for(let R=v;R$.name.toLowerCase()===r.toLowerCase()),c=!!u&&hae(u),h=!!u&&ZBt(u),p=i.valueExpression,m=i.normalizationType,v=i.normalizationField,w=i.normalizationTotal,S=[],I=i.viewInfoParams;let R=null,L=null;if(p){if(!MD){const{arcadeUtils:$}=await e_();MD=$}MD.hasGeometryOperations(p)&&await MD.enableGeometryOperations(),R=MD.createFunction(p),L=I?MD.getViewInfo({viewingMode:I.viewingMode,scale:I.scale,spatialReference:new Xi(I.spatialReference)}):null}const k=i.fieldInfos,B=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&k?{fields:k}:null;return e.forEach($=>{const V=$.attributes;let Y;if(p){const K=B?{...$,layer:B}:$,Q=MD.createExecContext(K,L,l);Y=MD.executeFunction(R,Q)}else V&&(Y=V[r],n?(Y=`${RC(Y)}${o}${RC(V[n])}`,s&&(Y=`${Y}${o}${RC(V[s])}`)):typeof Y=="string"&&t&&(h?Y=Y?new Date(Y).getTime():null:c&&(Y=Y?o7t(Y):null)));if(m&&typeof Y=="number"&&isFinite(Y)){const K=V&&parseFloat(V[v]);Y=r7t(Y,m,K,w)}S.push(Y)}),S}async function ljr(i){const{attribute:e,features:t}=i,{normalizationType:r,normalizationField:n,minValue:s,maxValue:o,fieldType:a}=e,l=await HTe({field:e.field,valueExpression:e.valueExpression,normalizationType:r,normalizationField:n,normalizationTotal:e.normalizationTotal,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t),u=wXe({normalizationType:r,normalizationField:n,minValue:s,maxValue:o}),c={value:.5,fieldType:a},h=a==="esriFieldTypeString"?I6e({values:l,supportsNullCount:u,percentileParams:c}):nbe({values:l,minValue:s,maxValue:o,useSampleStdDev:!r,supportsNullCount:u,percentileParams:c});return e7t(h,a==="esriFieldTypeDate")}async function ujr(i){const{attribute:e,features:t}=i,r=await HTe({field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:e.valueExpression,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t,!1),n=t7t(r);return i7t(n,e.domains,e.returnAllCodedValues,e.fieldDelimiter)}async function cjr(i){const{attribute:e,features:t}=i,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await HTe({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t),u=TXe(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numClasses:e.numClasses,minValue:e.minValue,maxValue:e.maxValue});return n7t(u,a)}async function hjr(i){const{attribute:e,features:t}=i,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a}=e,l=await HTe({field:r,valueExpression:e.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:o,viewInfoParams:e.viewInfoParams,timeZone:e.timeZone,fieldInfos:e.fieldInfos},t);return s7t(l,{field:r,normalizationType:n,normalizationField:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:e.standardDeviationInterval,numBins:e.numBins,minValue:e.minValue,maxValue:e.maxValue})}async function djr(i){const{attribute:e,features:t}=i,{field:r,radius:n,transform:s,spatialReference:o}=e,a=e.size??[0,0],l=ojr(t??[],s,o,a);return ajr(l,n??void 0,r,a[0],a[1])}const pjr=Object.freeze(Object.defineProperty({__proto__:null,classBreaks:cjr,heatmapStatistics:djr,histogram:hjr,summaryStatistics:ljr,uniqueValues:ujr},Symbol.toStringTag,{value:"Module"}));function fjr(i){return(0,w7r[i.operation])(...i.parameters)}const mjr=Object.freeze(Object.defineProperty({__proto__:null,executeGEOperation:fjr},Symbol.toStringTag,{value:"Module"}));function gjr(i){return u7t(i)!=null||l7t(i)!=null}function yjr(i){return c7t.test(i)}function a7t(i){return u7t(i)??l7t(i)}function l7t(i){const e=new Date(i);return vjr(e,i)?Number.isNaN(e.getTime())?null:e.getTime()-6e4*e.getTimezoneOffset():null}function u7t(i){const e=c7t.exec(i);if(!e?.groups)return null;const t=e.groups,r=+t.year,n=+t.month-1,s=+t.day,o=+(t.hours??"0"),a=+(t.minutes??"0"),l=+(t.seconds??"0");if(o>23||a>59||l>59)return null;const u=t.ms??"0",c=u?+u.padEnd(3,"0").substring(0,3):0;let h;if(t.isUTC||!t.offsetSign)h=Date.UTC(r,n,s,o,a,l,c);else{const p=+t.offsetHours,m=+t.offsetMinutes;h=6e4*(t.offsetSign==="+"?-1:1)*(60*p+m)+Date.UTC(r,n,s,o,a,l,c)}return Number.isNaN(h)?null:h}const c7t=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/;function vjr(i,e){if(Number.isNaN(i.getTime()))return!1;let t=!0;if(bjr&&/\d+\W*$/.test(e)){const r=e.match(/[a-zA-Z]{2,}/);if(r){let n=!1,s=0;for(;!n&&s<=r.length;)n=!_jr.test(r[s]),s++;t=!n}}return t}const _jr=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,bjr=!Number.isNaN(new Date("technology 10").getTime());let sbe=class{constructor(e=9,t){this._compareMinX=upt,this._compareMinY=cpt,this._toBBox=r=>r,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),eN.prune(),gde.prune(),M_.prune(),yde.prune()}all(e){this._all(this._data,e)}search(e,t){let r=this._data;const n=this._toBBox;if(mde(e,r))for(eN.clear();r;){for(let s=0,o=r.children.length;s0;){if(r||(r=M_.pop(),n=M_.data[M_.length-1],s=yde.pop()??0,o=!0),r.leaf&&(t=KH(r.children,e,r.children.length,r.indexHint),t!==-1))return r.children.splice(t,1),M_.push(r),this._condense(M_),this;o||r.leaf||!NOe(r,a)?n?(s++,r=n.children[s],o=!1):r=null:(M_.push(r),yde.push(s),s=0,n=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let r=e;for(gde.clear();r;){if(r.leaf===!0)for(const n of r.children)t(n);else gde.pushArray(r.children);r=gde.pop()??null}}_build(e,t,r,n){const s=r-t+1;let o=this._maxEntries;if(s<=o){const c=new Gge(e.slice(t,r+1));return Rj(c,this._toBBox),c}n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/o**(n-1)));const a=new $Oe([]);a.height=n;const l=Math.ceil(s/o),u=l*Math.ceil(Math.sqrt(o));hpt(e,t,r,u,this._compareMinX);for(let c=t;c<=r;c+=u){const h=Math.min(c+u-1,r);hpt(e,c,h,l,this._compareMinY);for(let p=c;p<=h;p+=l){const m=Math.min(p+l-1,h);a.children.push(this._build(e,p,m,n-1))}}return Rj(a,this._toBBox),a}_chooseSubtree(e,t,r,n){for(;n.push(t),t.leaf!==!0&&n.length-1!==r;){let s,o=1/0,a=1/0;for(let l=0,u=t.children.length;l=0&&M_.data[t].children.length>this._maxEntries;)this._split(M_,t),t--;this._adjustParentBBoxes(s,M_,t)}_split(e,t){const r=e.data[t],n=r.children.length,s=this._minEntries;this._chooseSplitAxis(r,s,n);const o=this._chooseSplitIndex(r,s,n);if(!o)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const a=r.children.splice(o,r.children.length-o),l=r.leaf?new Gge(a):new $Oe(a);l.height=r.height,Rj(r,this._toBBox),Rj(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(r,l)}_splitRoot(e,t){this._data=new $Oe([e,t]),this._data.height=e.height+1,Rj(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let n,s,o;n=s=1/0;for(let a=t;a<=r-t;a++){const l=iee(e,0,a,this._toBBox),u=iee(e,a,r,this._toBBox),c=xjr(l,u),h=LOe(l)+LOe(u);c=t;u--){const c=e.children[u];ree(a,e.leaf?s(c):c),l+=fde(a)}return l}_adjustParentBBoxes(e,t,r){for(let n=r;n>=0;n--)ree(t.data[n],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(r.children.length===0)if(t>0){const n=e.data[t-1],s=n.children;s.splice(KH(s,r,s.length,n.indexHint),1)}else this.clear();else Rj(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}};function Rj(i,e){iee(i,0,i.children.length,e,i)}function iee(i,e,t,r,n){n||(n=new Gge([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=e;o=i.minX&&e.maxY>=i.minY}function hpt(i,e,t,r,n){const s=[e,t];for(;s.length;){const o=s.pop(),a=s.pop();if(o-a<=r)continue;const l=a+Math.ceil((o-a)/r/2)*r;I5t(i,l,a,o,n),s.push(a,l,l,o)}}const eN=new mg,gde=new mg,M_=new mg,yde=new mg({deallocator:void 0});let Sjr=class{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}},h7t=class extends Sjr{constructor(){super(...arguments),this.height=1,this.indexHint=new Yxe}},Gge=class extends h7t{constructor(e){super(),this.children=e,this.leaf=!0}},$Oe=class extends h7t{constructor(e){super(),this.children=e,this.leaf=!1}};const Tjr=5e4,nee={minX:0,minY:0,maxX:0,maxY:0};function Cjr(i){nee.minX=i[0],nee.minY=i[1],nee.maxX=i[2],nee.maxY=i[3]}function Ejr(i,e,t){Cjr(e),i.search(nee,t)}let CXe=class{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new sbe(9,yi("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((r,n)=>{e[t++]=n}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=Oze();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),Ejr(this._index,e,r=>t(this._idByBounds.get(r)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const r=this._boundsById.get(e);r&&(this._index.remove(r),this._idByBounds.delete(r))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>Tjr&&this._loadIndex()))}};const dpt=new $o,Ijr=new $o,A6e=new $o,BOe={esriGeometryPoint:hNe,esriGeometryPolyline:zHe,esriGeometryPolygon:VHe,esriGeometryMultipoint:UHe};function jOe(i,e,t,r=i.hasZ,n=i.hasM){if(e==null)return null;const s=i.hasZ&&r,o=i.hasM&&n;if(t){const a=wx(A6e,e,i.hasZ,i.hasM,"esriGeometryPoint",t,r,n);return hNe(a,s,o)}return hNe(e,s,o)}function wP(i,e,t,r,n,s,o=e,a=t){const l=e&&o,u=t&&a,c=r!=null?"coords"in r?r:r.geometry:null;if(c==null)return null;if(n){let h=DDt(Ijr,c,e,t,i,n,o,a);return s&&(h=wx(A6e,h,l,u,i,s)),BOe[i]?.(h,l,u)??null}if(s){const h=wx(A6e,c,e,t,i,s,o,a);return BOe[i]?.(h,l,u)??null}return zdr(dpt,c,e,t,o,a),BOe[i]?.(dpt,l,u)??null}function aH(i){return i&&d7t in i?JSON.parse(JSON.stringify(i,Ajr)):i}const d7t="_geVersion",Ajr=(i,e)=>i!==d7t?e:void 0;function EXe(i,e){return i?e?4:3:e?3:2}function p7t(i,e,t,r){if(!e?.lengths.length)return null;i.lengths.length&&(i.lengths.length=0),i.coords.length&&(i.coords.length=0);const n=i.coords,s=[],o=t?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:a,coords:l}=e,u=EXe(t,r);let c=0;for(const h of a){const p=Mjr(o,l,c,h,t,r);p&&s.push(p),c+=h*u}if(s.sort((h,p)=>{let m=h[2]-p[2];return m===0&&t&&(m=h[4]-p[4]),m}),s.length){let h=6*s[0][2];n[0]=s[0][0]/h,n[1]=s[0][1]/h,t&&(h=6*s[0][4],n[2]=h!==0?s[0][3]/h:0),(n[0]o[1]||n[1]o[3]||t&&(n[2]o[5]))&&(n.length=0)}if(!n.length){const h=e.lengths[0]?Ojr(l,0,a[0],t,r):null;if(!h)return null;n[0]=h[0],n[1]=h[1],t&&h.length>2&&(n[2]=h[2])}return i}function Mjr(i,e,t,r,n,s){const o=EXe(n,s);let a=t,l=t+o,u=0,c=0,h=0,p=0,m=0;for(let w=0,S=r-1;wi[1]&&(i[1]=I),Ri[3]&&(i[3]=R),n&&(Li[5]&&(i[5]=L))}if(p>0&&(p*=-1),m>0&&(m*=-1),!p)return null;const v=[u,c,.5*p];return n&&(v[3]=h,v[4]=.5*m),v}function Ojr(i,e,t,r,n){const s=EXe(r,n);let o=e,a=e+s,l=0,u=0,c=0,h=0;for(let p=0,m=t-1;p0?r?[u/l,c/l,h/l]:[u/l,c/l]:t>0?r?[i[e],i[e+1],i[e+2]]:[i[e],i[e+1]]:null}function Pjr(i,e,t,r){const n=t-i,s=r-e;return Math.sqrt(n*n+s*s)}function Rjr(i,e,t,r,n,s){const o=r-i,a=n-e,l=s-t;return Math.sqrt(o*o+a*a+l*l)}function Djr(i,e,t,r){return[i+.5*(t-i),e+.5*(r-e)]}function Fjr(i,e,t,r,n,s){return[i+.5*(r-i),e+.5*(n-e),t+.5*(s-t)]}const f7t={getObjectId:i=>i.objectId,getAttributes:i=>i.attributes,getAttribute:(i,e)=>i.attributes[e],cloneWithGeometry:(i,e)=>new ry(e,i.attributes,null,i.objectId),getGeometry:i=>i.geometry,getCentroid:(i,e)=>(i.centroid==null&&(i.centroid=p7t(new $o,i.geometry,e.hasZ,e.hasM)),i.centroid)},kjr=Dx();let rX=class{constructor(e){this.geometryInfo=e,this._boundsStore=new CXe,this._featuresById=new Map,this._markedIds=new Set,this.events=new rd,this.featureAdapter=f7t}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,r,n,s]=this.fullBounds;return{xmin:t,ymin:r,xmax:n,ymax:s,spatialReference:aH(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(r=>this._upsert(r));return this._emitChanged(),t.filter(Ga)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const r=this._featuresById.get(t);r&&this._remove(r)}this._emitChanged()}forEachBounds(e,t){for(const r of e){const n=this._boundsStore.get(r.objectId);n&&t(HQi(kjr,n))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,r=>{t(this._featuresById.get(r))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,r)=>{this._markedIds.has(r)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(t==null)return void di.getLogger("esri.layers.graphics.data.FeatureStore").error(new qe("featurestore:invalid-feature","feature id is missing",{feature:e}));const r=this._featuresById.get(t);let n;if(this._markedIds.add(t),r?(e.displayId=r.displayId,n=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);n=O1e(n??Wo(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),n!=null&&this._boundsStore.set(t,n),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(t==null)return di.getLogger("esri.layers.graphics.data.FeatureStore").error(new qe("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const r=this._featuresById.get(t);if(!r)return this._add(e),e;this._markedIds.add(t);const{geometry:n,attributes:s}=e;for(const o in s)r.attributes[o]=s[o];return n&&(r.geometry=n,this._boundsStore.set(t,O1e(Wo(),n,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),r}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}};const GOe=[0,0];function m7t(i,e){if(!e)return null;if("x"in e){const t={x:0,y:0};return[t.x,t.y]=i(e.x,e.y,GOe),e.z!=null&&(t.z=e.z),e.m!=null&&(t.m=e.m),t}if("xmin"in e){const t={xmin:0,ymin:0,xmax:0,ymax:0};return[t.xmin,t.ymin]=i(e.xmin,e.ymin,GOe),[t.xmax,t.ymax]=i(e.xmax,e.ymax,GOe),e.hasZ&&(t.zmin=e.zmin,t.zmax=e.zmax,t.hasZ=!0),e.hasM&&(t.mmin=e.mmin,t.mmax=e.mmax,t.hasM=!0),t}return"rings"in e?{rings:ppt(e.rings,i),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:ppt(e.paths,i),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:g7t(e.points,i),hasM:e.hasM,hasZ:e.hasZ}:null}function ppt(i,e){const t=[];for(const r of i)t.push(g7t(r,e));return t}function g7t(i,e){const t=[];for(const r of i){const n=e(r[0],r[1],[0,0]);t.push(n),r.length>2&&n.push(r[2]),r.length>3&&n.push(r[3])}return t}async function Gv(i,e){if(!i||!e)return;const t=Array.isArray(i)?i.map(r=>r.geometry!=null?r.geometry.spatialReference:null).filter(Ga):[i];await Lx(t.map(r=>({source:r,dest:e})))}const y7t=m7t.bind(null,Z5),v7t=m7t.bind(null,DV);function Sf(i,e,t,r){if(!i||(t||(t=e,e=i.spatialReference),!Cm(e)||!Cm(t)||Ya(e,t)))return i;if(RV(e,t)){const n=Nb(t)?y7t(i):v7t(i);return n.spatialReference=t,n}return TW(Mu,[i],e,t,null,r)[0]}let Ljr=class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,r,n){if(!e?.length||!t||!r||Ya(t,r))return e;const s={geometries:e,inSpatialReference:t,outSpatialReference:r,geographicTransformation:n,resolve:ac()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:r,outSpatialReference:n,resolve:s,geographicTransformation:o}=e;RV(r,n)?Nb(n)?s(t.map(y7t)):s(t.map(v7t)):s(TW(Mu,t,r,n,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};const Njr=new Ljr;function $jr(i,e,t,r){return Njr.push(i,e,t,r)}let Bjr=class{constructor(e,t){this._cache=new d3(e),this._invalidCache=new d3(t)}get(e,t){const r=`${t.uid}:${e}`,n=this._cache.get(r);if(n)return n;if(this._invalidCache.get(r)!=null)return null;try{const s=ta.create(e,t);return this._cache.put(r,s),s}catch(s){return this._invalidCache.put(r,s),null}}getError(e,t){const r=`${t.uid}:${e}`;return this._invalidCache.get(r)??null}};const _7t=new Bjr(50,500),yre="unsupported-query",b7t=" as ",w7t=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),x7t=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),jjr=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...w7t,...x7t]);function IXe(i,e,t={}){const r=w8(e,i);if(!r){const s=_7t.getError(e,i);throw new qe(yre,"invalid SQL expression",{expression:e,error:s})}const n=t.expressionName||"expression";if(t.validateStandardized&&!r.isStandardized)throw new qe(yre,`${n} is not standard`,{expression:e});if(t.validateAggregate&&!r.isAggregate)throw new qe(yre,`${n} does not contain a valid aggregate function`,{expression:e});return r.fieldNames}function Gjr(i,e,t,r){if(!t)return!0;const n="where clause";return OF(i,e,IXe(i,t,{validateStandardized:!0,expressionName:n}),{expressionName:n,query:r}),!0}function Ujr(i,e,t,r,n){if(!t)return!0;const s="having clause",o=IXe(i,t,{validateAggregate:!0,expressionName:s});if(OF(i,e,o,{expressionName:s,query:n}),!w8(t,i)?.getExpressions().every(u=>{const{aggregateType:c,field:h}=u,p=i.get(h)?.name;return r.some(m=>{const{onStatisticField:v,statisticType:w}=m;return i.get(v)?.name===p&&w.toLowerCase().trim()===c})}))throw new qe(yre,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function w8(i,e){return i?_7t.get(i,e):null}function S7t(i){return/\((.*?)\)/.test(i)?i:i.split(b7t)[0]}function zjr(i){return i.split(b7t)[1]}function OF(i,e,t,r={}){const n=new Map;if(Vjr(n,i,e,r.allowedFieldTypes??jjr,t),n.size){const s=r.expressionName??"expression";throw new qe(yre,`${s} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query})}}function Vjr(i,e,t,r,n){const s=n.includes("*")?[...t,...n.filter(o=>o!=="*")]:n;for(const o of s)if(e.get(o))fpt(i,e,t,r,o);else try{const a=IXe(e,S7t(o),{validateStandardized:!0});for(const l of a)fpt(i,e,t,r,l)}catch(a){i.set(o,{type:"expression-error",expression:o,error:a})}}function fpt(i,e,t,r,n){const s=e.get(n);s?t.has(s.name)?r!=="all"&&r?.has(s.type)===!1&&i.set(n,{type:"invalid-type",fieldName:s.name,fieldType:wW.fromJSON(s.type),allowedFieldTypes:Array.from(r,o=>wW.fromJSON(o))}):i.set(n,{type:"missing-field",fieldName:s.name}):i.set(n,{type:"invalid-field",fieldName:n})}const T7t={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0};let vde=class{constructor(e,t,r){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=r,this.featureAdapter=t;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let s=0;for(const o of n){const a=S7t(o),l=this.fieldsIndex.get(a),u=l?null:w8(a,r),c=l?l.name:zjr(o)||"FIELD_EXP_"+s++;this._fieldDataCache.set(o,{alias:c,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,r){const n=r?r.name:t;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:r||(s=w8(t,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),r?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,r=!0){const n=t.normalizationType,s=t.normalizationTotal,o=this.fieldsIndex.get(t.field),a=t1e(o)||i1e(o),l=hae(o);return e.map(u=>{let c=t.field&&this.getFieldValue(u,t.field,this.fieldsIndex.get(t.field));if(t.field2?(c=`${RC(c)}${t.fieldDelimiter}${RC(this.getFieldValue(u,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(c=`${c}${t.fieldDelimiter}${RC(this.getFieldValue(u,t.field3,this.fieldsIndex.get(t.field3)))}`)):typeof c=="string"&&r&&(a?c=c?new Date(c).getTime():null:l&&(c=c?o7t(c):null)),n&&Number.isFinite(c)){const h=n==="field"&&t.normalizationField?this.getFieldValue(u,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;c=r7t(c,n,h,s)}return c})}async getExpressionValues(e,t,r,n,s){const{arcadeUtils:o}=await e_(),a=o.hasGeometryOperations(t);a&&await o.enableGeometryOperations();const l=o.createFunction(t),u=o.getViewInfo(r),c={fields:this.fieldsIndex.fields};return e.map(h=>{const p={attributes:this.featureAdapter.getAttributes(h),layer:c,geometry:a?{...wP(n.geometryType,n.hasZ,n.hasM,this.featureAdapter.getGeometry(h)),spatialReference:r?.spatialReference}:null},m=o.createExecContext(p,u,s);return o.executeFunction(l,m)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:w8(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:w8(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const r={};for(const n of t){const{alias:s,clause:o}=this._fieldDataCache.get(n);r[s]=o?o.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,s)}return r}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,r=[];if(t)for(const o of t){const{alias:a}=this._fieldDataCache.get(o);r.push(e[a])}else for(const o in e)r.push(e[o]);const n=`${(t||["*"]).join(",")}=${r.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}};function mpt(i,e,t){return{objectId:i,target:e,distance:t,type:"vertex"}}function Hjr(i,e,t,r,n,s=!1){return{objectId:i,target:e,distance:t,type:"edge",start:r,end:n,draped:s}}let O_=class{constructor(e,t,r){this.items=e,this.query=t,this.geometryType=r.geometryType,this.hasM=r.hasM,this.hasZ=r.hasZ,this.fieldsIndex=r.fieldsIndex,this.objectIdField=r.objectIdField,this.spatialReference=r.spatialReference,this.featureAdapter=r.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new vde(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:r,outStatistics:n}=this.query;if(!t?.length)return 1;const o=new Map,a=new Map,l=new Set;for(const u of n){const{statisticType:c}=u,h=c!=="exceedslimit"?u.onStatisticField:void 0;if(!a.has(h)){const m=[];for(const v of t){const w=this._getAttributeValues(e,v,o);m.push(w)}a.set(h,this._calculateUniqueValues(m,e.returnDistinctValues))}const p=a.get(h);for(const m in p){const{data:v,items:w}=p[m],S=v.join(",");r&&!e.validateItems(w,r)||l.add(S)}}return l.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;Cm(this.query.outSR)&&!Ya(t.spatialReference,this.query.outSR)?e.queryGeometry=aH({spatialReference:this.query.outSR,...Sf(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=aH({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const r=this.featureAdapter,n=gpt(this.hasZ,this.hasM),{point:s,mode:o}=e,a=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(o,this.spatialReference,t),p=new ypt(null,0),m=new ypt(null,0),v={x:0,y:0,z:0};for(const w of this.items){const S=r.getGeometry(w);if(S==null)continue;const{coords:I,lengths:R}=S;if(p.coords=I,m.coords=I,e.returnEdge){let L=0;for(let k=0;kw.distance-S.distance),u}_getPointCreator(e,t,r){const n=r==null||Ya(t,r)?a=>a:a=>Sf(a,t,r),{hasZ:s}=this,o=0;return e==="3d"?s?({x:a,y:l,z:u})=>n({x:a,y:l,z:u}):({x:a,y:l})=>n({x:a,y:l,z:o}):({x:a,y:l})=>n({x:a,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,minValue:a,maxValue:l,scale:u,timeZone:c}=e,h=this.fieldsIndex.get(t),p=mW(h)||t1e(h)||i1e(h),m=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:u,timeZone:c}),v=wXe({normalizationType:s,normalizationField:n,minValue:a,maxValue:l}),w={value:.5,fieldType:h?.type},S=xie(h)?I6e({values:m,supportsNullCount:v,percentileParams:w}):nbe({values:m,minValue:a,maxValue:l,useSampleStdDev:!s,supportsNullCount:v,percentileParams:w});return e7t(S,p)}async createUniqueValuesResponse(e){const{field:t,valueExpression:r,domains:n,returnAllCodedValues:s,scale:o,timeZone:a}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:r,scale:o,timeZone:a},!1),u=t7t(l);return i7t(u,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:p,timeZone:m}=e,v=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:p,timeZone:m}),w=TXe(v,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return n7t(w,a)}async createHistogramResponse(e){const{field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:p,timeZone:m}=e,v=await this._getDataValues({field:t,valueExpression:r,normalizationField:n,normalizationType:s,normalizationTotal:o,scale:p,timeZone:m});return s7t(v,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:o,classificationMethod:a,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,r){if(e.length>1&&t?.length)for(const n of t.reverse()){const s=n.split(" "),o=s[0],a=this.fieldsIndex.get(o),l=!!s[1]&&s[1].toLowerCase()==="desc",u=SXe(a?.type,l);e.sort((c,h)=>{const p=r(c,o,a),m=r(h,o,a);return u(p,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:p,returnZ:m,returnM:v}=e,w=h!=null&&t.length>(p||0)+h,S=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(I=>this.fieldsIndex.get(I)));return{exceededTransferLimit:w,features:this._createFeatures(e,t),fields:S,geometryType:r,hasM:n&&v,hasZ:s&&m,objectIdFieldName:o,spatialReference:aH(u||a),transform:c&&p1e(c)||null}}_createFeatures(e,t){const r=new vde(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:o,quantizationParameters:a,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:p,returnZ:m=!1,returnM:v=!1}=e,w=s&&m,S=n&&v;let I=[],R=0;const L=[...t];if(this._sortFeatures(L,o,(B,$,V)=>r.getFieldValue(B,$,V)),this.geometryType&&(l||u)){const B=p1e(a)??void 0,$=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const V of L){const Y=this.featureAdapter.getGeometry(V),K={attributes:r.getAttributes(V),geometry:wP(this.geometryType,this.hasZ,this.hasM,Y,c,B,w,S)};$&&Y&&!K.geometry&&(K.centroid=jOe(this,this.featureAdapter.getCentroid(V,this),B)),I[R++]=K}else if(!l&&u)for(const V of L)I[R++]={attributes:r.getAttributes(V),centroid:jOe(this,this.featureAdapter.getCentroid(V,this),B)};else for(const V of L)I[R++]={attributes:r.getAttributes(V),centroid:jOe(this,this.featureAdapter.getCentroid(V,this),B),geometry:wP(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(V),c,B,w,S)}}else for(const B of L){const $=r.getAttributes(B);$&&(I[R++]={attributes:$})}const k=h||0;if(p!=null){const B=k+p;I=I.slice(k,Math.min(I.length,B))}return I}_createExceedsLimitQueryResponse(e){let t=!1,r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const o of e.outStatistics??[])if(o.statisticType==="exceedslimit"){r=o.maxPointCount!=null?o.maxPointCount:Number.POSITIVE_INFINITY,n=o.maxRecordCount!=null?o.maxRecordCount:Number.POSITIVE_INFINITY,s=o.maxVertexCount!=null?o.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>r;else if(this.items.length>n)t=!0;else{const o=gpt(this.hasZ,this.hasM),a=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=a.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/o>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},r=[],n=new Map,s=new Map,o=new Map,a=new Map,l=new vde(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:p,resultRecordCount:m}=e,v=c?.length,w=!!v,S=w?c[0]:null,I=w&&!this.fieldsIndex.get(S);for(const L of u??[]){const{outStatisticFieldName:k,statisticType:B}=L,$=L,V=B!=="exceedslimit"?L.onStatisticField:void 0,Y=B==="percentile_disc"||B==="percentile_cont",K=B==="EnvelopeAggregate"||B==="CentroidAggregate"||B==="ConvexHullAggregate",Q=w&&v===1&&(V===S||I)&&B==="count";if(w){if(!o.has(V)){const pe=[];for(const H of c){const Z=this._getAttributeValues(l,H,n);pe.push(Z)}o.set(V,this._calculateUniqueValues(pe,!K&&l.returnDistinctValues))}const ne=o.get(V);if(!ne)continue;const de=Object.keys(ne);for(const pe of de){const{count:H,data:Z,items:ae,itemPositions:fe}=ne[pe],be=Z.join(",");if(!h||l.validateItems(ae,h)){const _e=a.get(be)||{attributes:{}};if(K){_e.aggregateGeometries||(_e.aggregateGeometries={});const{aggregateGeometries:Te,outStatisticFieldName:Be}=await this._getAggregateGeometry($,ae);_e.aggregateGeometries[Be]=Te}else{let Te=null;if(Q)Te=H;else{const Be=this._getAttributeValues(l,V,n),Ve=fe.map($e=>Be[$e]);Te=Y&&"statisticParameters"in $?this._getPercentileValue($,Ve):this._getStatisticValue($,Ve,null,l.returnDistinctValues)}_e.attributes[k]=Te}let Ie=0;c.forEach((Te,Be)=>_e.attributes[this.fieldsIndex.get(Te)?Te:"EXPR_"+ ++Ie]=Z[Be]),a.set(be,_e)}}}else if(K){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:ne,outStatisticFieldName:de}=await this._getAggregateGeometry($,this.items);t.aggregateGeometries[de]=ne}else{const ne=this._getAttributeValues(l,V,n);t.attributes[k]=Y&&"statisticParameters"in $?this._getPercentileValue($,ne):this._getStatisticValue($,ne,s,l.returnDistinctValues)}const re=B!=="min"&&B!=="max"||!xie(this.fieldsIndex.get(V))&&!this._isAnyDateField(V)?null:this.fieldsIndex.get(V)?.type;r.push({name:k,alias:k,type:re||"esriFieldTypeDouble"})}const R=w?Array.from(a.values()):[t];return this._sortFeatures(R,p,(L,k)=>L.attributes[k]),m&&(R.length=Math.min(m,R.length)),{fields:r,features:R}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return mW(t)||t1e(t)||i1e(t)||hae(t)}async _getAggregateGeometry(e,t){const{convexHull:r,union:n}=await Promise.resolve().then(()=>iX),{statisticType:s,outStatisticFieldName:o}=e,{featureAdapter:a,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,p=t.map(w=>wP(u,c,h,a.getGeometry(w))),m=r(l,p,!0)[0],v={aggregateGeometries:null,outStatisticFieldName:null};if(s==="EnvelopeAggregate"){const w=m?Fze(m):I5e(n(l,p));v.aggregateGeometries={...w,spatialReference:l},v.outStatisticFieldName=o||"extent"}else if(s==="CentroidAggregate"){const w=m?p2e(m):EXi(I5e(n(l,p)));v.aggregateGeometries={x:w[0],y:w[1],spatialReference:l},v.outStatisticFieldName=o||"centroid"}else s==="ConvexHullAggregate"&&(v.aggregateGeometries=m,v.outStatisticFieldName=o||"convexHull");return v}_getStatisticValue(e,t,r,n){const{onStatisticField:s,statisticType:o}=e;let a=null;return a=r?.has(s)?r.get(s):xie(this.fieldsIndex.get(s))||this._isAnyDateField(s)?I6e({values:t,returnDistinct:n}):nbe({values:n?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),r&&r.set(s,a),a[o==="var"?"variance":o]}_getPercentileValue(e,t){const{onStatisticField:r,statisticParameters:n,statisticType:s}=e,{value:o,orderBy:a}=n,l=this.fieldsIndex.get(r);return xXe(t,{value:o,orderBy:a,fieldType:l?.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,t,r){if(r.has(t))return r.get(t);const n=this.fieldsIndex.get(t),s=this.items.map(o=>e.getFieldValue(o,t,n));return r.set(t,s),s}_calculateUniqueValues(e,t){const r={},n=this.items,s=n.length;for(let o=0;oSf(r,Yp));return(await Jjr())(o.spatialReference,o,e,s)}async function Jjr(){return(await Promise.resolve().then(()=>iX)).geodesicBuffer}function Kjr(i){return i==="mesh"?MEt:REt(i)}function E7t(i,e){return i?e?4:3:e?3:2}function Zjr(i,e,t,r){return I7t(i,e,t,r.coords[0],r.coords[1])}function Qjr(i,e,t,r,n,s){const o=E7t(n,s),{coords:a,lengths:l}=r;if(!l)return!1;for(let u=0,c=0;u=o||v=o)&&h+(o-p)/(v-p)*(m-h)iX)}function _U(i,e,t,r,n){if(ed(e)&&t==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains")){const s=uB(new $o,e,!1,!1);return Promise.resolve(o=>Zjr(s,!1,!1,o))}if(ed(e)&&t==="esriGeometryMultipoint"){const s=uB(new $o,e,!1,!1);if(i==="esriSpatialRelContains")return Promise.resolve(o=>Qjr(s,!1,!1,o,r,n))}if(zd(e)&&t==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"))return Promise.resolve(s=>rae(e,wP(t,r,n,s)));if(zd(e)&&t==="esriGeometryMultipoint"&&i==="esriSpatialRelContains")return Promise.resolve(s=>tYi(e,wP(t,r,n,s)));if(zd(e)&&i==="esriSpatialRelIntersects"){const s=Kjr(t);return Promise.resolve(o=>s(e,wP(t,r,n,o)))}return sGr().then(s=>{const o=s[tGr[i]].bind(null,e.spatialReference,e);return a=>o(wP(t,r,n,a))})}async function A7t(i,e,t){const{spatialRel:r,geometry:n}=i;if(n){if(!iGr(r))throw new qe(UOe,"Unsupported query spatial relationship",{query:i});if(Cm(n.spatialReference)&&Cm(t)){if(!rGr(n))throw new qe(UOe,"Unsupported query geometry type",{query:i});if(!nGr(e))throw new qe(UOe,"Unsupported layer geometry type",{query:i});if(i.outSR)return Gv(i.geometry?.spatialReference,i.outSR)}}}function _pt(i){if(zd(i))return!0;if(ed(i)){for(const e of i.rings)if(e.length!==5||e[0][0]!==e[1][0]||e[0][0]!==e[4][0]||e[2][0]!==e[3][0]||e[0][1]!==e[3][1]||e[0][1]!==e[4][1]||e[1][1]!==e[2][1])return!1;return!0}return!1}const _q="unsupported-query";async function bpt(i,{fieldsIndex:e,geometryType:t,spatialReference:r,availableFields:n}){if((i.distance??0)<0||i.geometryPrecision!=null||i.multipatchOption&&i.multipatchOption!=="xyFootprint"||i.pixelSize||i.relationParam||i.text)throw new qe(_q,"Unsupported query options",{query:i});return M7t(e,n,i),aGr(e,n,i),Promise.all([A7t(i,t,r),Gv(r,i.outSR)]).then(()=>i)}function M7t(i,e,t){const{outFields:r,orderByFields:n,returnDistinctValues:s,outStatistics:o}=t,a=o?o.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(n&&n.length>0){const l=" asc",u=" desc",c=n.map(h=>{const p=h.toLowerCase();return p.includes(l)?p.split(l)[0]:p.includes(u)?p.split(u)[0]:h}).filter(h=>!a.includes(h));OF(i,e,c,{expressionName:"orderByFields",query:t})}if(r&&r.length>0)OF(i,e,r,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(s)throw new qe(_q,"outFields should be specified for returnDistinctValues",{query:t});Gjr(i,e,t.where,t)}const oGr=new Set([...w7t,...x7t]);function aGr(i,e,t){const{outStatistics:r,groupByFieldsForStatistics:n,having:s}=t,o=n?.length,a=r?.length;if(s){if(!o||!a)throw new qe(_q,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});Ujr(i,e,s,r,t)}if(a){if(!cGr(r))return;const l=r.map(u=>u.onStatisticField).filter(Boolean);OF(i,e,l,{expressionName:"onStatisticFields",query:t}),o&&OF(i,e,n,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of r){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:p}=u;if(!p)throw new qe(_q,"statisticParameters should be set for percentile type",{definition:u,query:t})}else i.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&OF(i,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:oGr,query:t})}}}async function lGr(i,e,{fieldsIndex:t,geometryType:r,spatialReference:n,availableFields:s}){if((i.distance??0)<0||i.geometryPrecision!=null||i.multipatchOption||i.pixelSize||i.relationParam||i.text||i.outStatistics||i.groupByFieldsForStatistics||i.having||i.orderByFields)throw new qe(_q,"Unsupported query options",{query:i});return M7t(t,s,i),Promise.all([uGr(t,s,e,i),A7t(i,r,n),Gv(n,i.outSR)]).then(()=>i)}async function uGr(i,e,t,r){let n=[];if(t.valueExpression){const{arcadeUtils:s}=await e_();n=s.extractFieldNames(t.valueExpression)}if(t.field&&n.push(t.field),t.field2&&n.push(t.field2),t.field3&&n.push(t.field3),t.normalizationField&&n.push(t.normalizationField),!n.length&&!t.valueExpression)throw new qe(_q,"field or valueExpression is required",{params:t});OF(i,e,n,{expressionName:"statistics",query:r})}function cGr(i){return i!=null&&i.every(e=>e.statisticType!=="exceedslimit")}async function hGr(i,e){if(!i)return null;const t=e.featureAdapter,{startTimeField:r,endTimeField:n}=i;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await e.forEach(a=>{const l=t.getAttribute(a,r),u=t.getAttribute(a,n);l==null||isNaN(l)||(s=Math.min(s,l)),u==null||isNaN(u)||(o=Math.max(o,u))});else{const a=r||n;await e.forEach(l=>{const u=t.getAttribute(l,a);u==null||isNaN(u)||(s=Math.min(s,u),o=Math.max(o,u))})}return{start:s,end:o}}function O7t(i,e,t){if(!e||!i)return null;const{startTimeField:r,endTimeField:n}=i;if(!r&&!n)return null;const{start:s,end:o}=e;if(s===null&&o===null)return null;if(s===void 0&&o===void 0)return fGr();const a=t.getAttributeAsTimestamp?.bind(t)??t.getAttribute.bind(t);return r&&n?dGr(a,r,n,s,o):pGr(a,r||n,s,o)}function dGr(i,e,t,r,n){return r!=null&&n!=null?s=>{const o=i(s,e),a=i(s,t);return(o==null||o<=n)&&(a==null||a>=r)}:r!=null?s=>{const o=i(s,t);return o==null||o>=r}:n!=null?s=>{const o=i(s,e);return o==null||o<=n}:void 0}function pGr(i,e,t,r){return t!=null&&r!=null&&t===r?n=>i(n,e)===t:t!=null&&r!=null?n=>{const s=i(n,e);return s!=null&&s>=t&&s<=r}:t!=null?n=>{const s=i(n,e);return s!=null&&s>=t}:r!=null?n=>{const s=i(n,e);return s!=null&&s<=r}:void 0}function fGr(){return()=>!1}const P7t=Symbol("Yield");let mGr=class{constructor(){this._tasks=new Array,this._runningTasks=hB(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(this.length===0)return P7t;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,r){return++this._runningTasks.value,new Promise((n,s)=>this._tasks.push(new wpt(n,s,e,t,r))).finally(()=>--this._runningTasks.value)}unshift(e,t,r){return++this._runningTasks.value,new Promise((n,s)=>this._tasks.unshift(new wpt(n,s,e,t,r))).finally(()=>--this._runningTasks.value)}_process(e){if(this._tasks.length===0)return!1;const t=this._tasks.shift();try{const r=xg(t.signal);if(r&&!t.abortCallback)t.reject(Oc());else{const n=r?t.abortCallback?.(Oc()):t.callback(e);qp(n)?n.then(t.resolve,t.reject):t.resolve(n)}}catch(r){t.reject(r)}return!0}cancelAll(){const e=Oc();for(const t of this._tasks)if(t.abortCallback){const r=t.abortCallback(e);t.resolve(r)}else t.reject(e);this._tasks.length=0}},wpt=class{constructor(e,t,r,n=void 0,s=void 0){this.resolve=e,this.reject=t,this.callback=r,this.signal=n,this.abortCallback=s}},see=class extends un{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};x([D()],see.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),x([D()],see.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),see=x([Qe("esri.views.support.DebugFlags")],see);const gGr=new see;var $w;(function(i){i[i.ANIMATING=0]="ANIMATING",i[i.INTERACTING=1]="INTERACTING",i[i.IDLE=2]="IDLE"})($w||($w={}));var Dl;(function(i){i.RESOURCE_CONTROLLER_IMMEDIATE="immediate",i.RESOURCE_CONTROLLER="schedule",i.SLIDE="slide",i.STREAM_DATA_LOADER="stream loader",i.ELEVATION_QUERY="elevation query",i.TERRAIN_SURFACE="terrain",i.SURFACE_GEOMETRY_UPDATES="surface geometry updates",i.LOD_RENDERER="LoD renderer",i.GRAPHICS_CORE="Graphics3D",i.I3S_CONTROLLER="I3S",i.POINT_CLOUD_LAYER="point cloud",i.FEATURE_TILE_FETCHER="feature fetcher",i.OVERLAY="overlay",i.STAGE="stage",i.GRAPHICS_DECONFLICTOR="graphics deconflictor",i.FILTER_VISIBILITY="Graphics3D filter visibility",i.SCALE_VISIBILITY="Graphics3D scale visibility",i.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",i.POINT_OF_INTEREST_FREQUENT="POI frequent",i.POINT_OF_INTEREST_INFREQUENT="POI infrequent",i.LABELER="labeler",i.FEATURE_QUERY_ENGINE="feature query",i.FEATURE_TILE_TREE="feature tile tree",i.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",i.ELEVATION_ALIGNMENT="elevation alignment",i.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",i.TEXT_TEXTURE_ATLAS="text texture atlas",i.TEXTURE_UNLOAD="texture unload",i.LINE_OF_SIGHT_TOOL="line of sight tool",i.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",i.ELEVATION_PROFILE="elevation profile",i.SNAPPING="snapping",i.SHADOW_ACCUMULATOR="shadow accumulator",i.CLOUDS_GENERATOR="clouds generator",i[i.NONE=0]="NONE",i[i.TEST_PRIO=1]="TEST_PRIO"})(Dl||(Dl={}));const tA=0,xpt=new Map([[Dl.RESOURCE_CONTROLLER_IMMEDIATE,tA],[Dl.RESOURCE_CONTROLLER,4],[Dl.SLIDE,tA],[Dl.STREAM_DATA_LOADER,tA],[Dl.ELEVATION_QUERY,tA],[Dl.TERRAIN_SURFACE,1],[Dl.SURFACE_GEOMETRY_UPDATES,1],[Dl.LOD_RENDERER,2],[Dl.GRAPHICS_CORE,2],[Dl.I3S_CONTROLLER,2],[Dl.POINT_CLOUD_LAYER,2],[Dl.FEATURE_TILE_FETCHER,2],[Dl.OVERLAY,4],[Dl.STAGE,4],[Dl.GRAPHICS_DECONFLICTOR,4],[Dl.FILTER_VISIBILITY,4],[Dl.SCALE_VISIBILITY,4],[Dl.FRUSTUM_VISIBILITY,4],[Dl.CLOUDS_GENERATOR,4],[Dl.POINT_OF_INTEREST_FREQUENT,6],[Dl.POINT_OF_INTEREST_INFREQUENT,30],[Dl.LABELER,8],[Dl.FEATURE_QUERY_ENGINE,8],[Dl.FEATURE_TILE_TREE,16],[Dl.FEATURE_TILE_TREE_ACTIVE,tA],[Dl.ELEVATION_ALIGNMENT,12],[Dl.ELEVATION_ALIGNMENT_SCENE,14],[Dl.TEXT_TEXTURE_ATLAS,12],[Dl.TEXTURE_UNLOAD,12],[Dl.LINE_OF_SIGHT_TOOL,16],[Dl.LINE_OF_SIGHT_TOOL_INTERACTIVE,tA],[Dl.SNAPPING,tA],[Dl.SHADOW_ACCUMULATOR,30]]);function Spt(i){return xpt.has(i)?xpt.get(i):typeof i=="number"?i:1}const Tpt=6.5,Cpt=1,yGr=30,Ept=1e3/30,Ipt=100,Apt=.9;var M6e,tN;(function(i){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=hB(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new fie("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new r,this._state=$w.INTERACTING,this._tasks=new mg,this._runQueue=new mg,this._load=0,this._idleStateCallbacks=new mg,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=Ki(()=>gGr.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,js);for(const o of Object.keys(Dl))this.performanceInfo.tasks.set(Dl[o],new fie(Dl[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:Tpt,INTERACTING_BUDGET:Ept,IDLE_BUDGET:Ipt,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:o=>s._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),Hc(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,o){const a=new t(this,s,o);return this._tasks.push(a),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new fie(s)),a}registerIdleStateCallbacks(s,o){const a={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(a),this.state===$w.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(u){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===$w.IDLE&&u()),a.idleBegin=u},set idleEnd(u){a.idleEnd=u}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==$w.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let o=Tpt,a=s.frameDuration,l=Cpt;switch(this.state){case $w.IDLE:o=0,a=Math.max(Ipt,s.frameDuration),l=yGr;break;case $w.INTERACTING:a=Math.max(Ept,s.frameDuration);case $w.ANIMATING:}return a=a-s.elapsedFrameTime-o,this.state!==$w.IDLE&&as.idleBegin())),this._runIdle();break;case $w.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(o=>{o.name===s&&o.setPriority(s)})}_getState(s){if(this._runQueue.some(a=>a.name===s))return tN.SCHEDULED;let o=tN.IDLE;return this._tasks.forAll(a=>{a.name===s&&a.needsUpdate&&(a.schedulePriority<=1?o=tN.READY:o!==tN.READY&&(o=tN.WAITING))}),o}_getRuntime(s){let o=0;return this._tasks.forAll(a=>{a.name===s&&(o+=a.runtime)}),o}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(a=>{a.needsUpdate&&s.set(a.name,(s.get(a.name)||0)+1)}),s.size===0)return null;let o="";return s.forEach((a,l)=>{o+=a>1?` ${a}x ${l}`:` ${l}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((o,a)=>a.needsUpdate?++o:o,0);this._load=this._load*Apt+s*(1-Apt)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===tA&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,o=0;if(this._tasks.forAll(a=>{a.needsUpdate&&a.schedulePriority!==0&&a.basePriority!==tA&&a.blockFrame!==this._frameNumber&&(s=!0,o=Math.max(o,a.basePriority),a.schedulePriority===1?(a.schedulePriority=0,this._runQueue.push(a)):--a.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),a=this._runQueue.pop();this._budget.resetProgress();try{a.task.runTask(this._budget)===P7t&&(a.blockFrame=this._frameNumber)}catch(u){di.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,u),a.blockFrame=this._frameNumber}!this._budget.hasProgressed&&a.blockFrame!==this._frameNumber&&a.needsUpdate&&(a.name,Dl.I3S_CONTROLLER,a.blockFrame=this._frameNumber),a.schedulePriority=a.basePriority;const l=this._budget.now()-o;if(a.runtime+=l,this._frameTaskTimes.set(a.priority,this._frameTaskTimes.get(a.priority)+l),this._debug&&l>2*this._budget.budget&&console.log("Task",a.name,"used",l,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(Dl))this._frameTaskTimes.set(Dl[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((o,a)=>this.performanceInfo.tasks.get(a).record(o)),this.performanceInfo.total.record(s)}get test(){return this._test}}i.Scheduler=e;class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,o,a){this._scheduler=s,this.name=o,this.blockFrame=0,this.runtime=0,this._queue=new mGr,this._handles=new cY,this._basePriority=Spt(o),this.schedulePriority=this._basePriority,this._task=hB(a??this._queue),this._handles.add(v0(()=>this.task.running,l=>s.taskRunningChanged(l)))}remove(){this.processQueue(obe),this._scheduler.removeTask(this),this.schedule=Mpt.schedule,this.reschedule=Mpt.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){if(this.name===s)return;this.name=s;const o=Spt(s);this._basePriority!==tA&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,o,a){return this._queue.push(s,o,a)}reschedule(s,o,a){return this._queue.unshift(s,o,a)}processQueue(s){return this._queue.runTask(s)}}class r{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=$w.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,o){this._begin=this.now(),this._budget=s,this._state=o,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}i.Budget=r})(M6e||(M6e={})),function(i){i.SCHEDULED="s",i.READY="r",i.WAITING="w",i.IDLE="i"}(tN||(tN={}));const obe=(()=>{const i=new M6e.Budget;return i.enabled=!1,i})();let vGr=class{remove(){}processQueue(){}schedule(e,t,r){try{if(xg(t)){const n=Oc();return r?Promise.resolve(r(n)):Promise.reject(n)}return B4e(e(obe))}catch(n){return Promise.reject(n)}}reschedule(e,t,r){return this.schedule(e,t,r)}};const Mpt=new vGr,_Gr="unsupported-query",bGr=new eMt(2e6);let wGr=0,lL=class{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:T7t},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new Ker(wGr+++"$$",bGr)),this.fieldsIndex=W9(e.fieldsIndex)?e.fieldsIndex:Cd.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=Hc(this._frameTask),this.clearCache(),zo(this._geometryQueryCache),this._changeHandle=Hc(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const r=D1(t);try{return(await this._executeQuery(e,{},r)).createQueryResponse()}catch(n){if(n!==w5)throw n;return new O_([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const r=D1(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},r)).createQueryResponseForCount()}catch(n){if(n!==w5)throw n;return 0}}async executeQueryForExtent(e,t){const r=D1(t),n=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},r),o=s.size;return o?{count:o,extent:await this._getBounds(s.items,s.spatialReference,n||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===w5)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(r=>Array.from(r))}async executeQueryForIdSet(e,t){const r=D1(t);try{const n=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},r),s=n.items,o=new Set;return await this._reschedule(()=>{for(const a of s)o.add(n.featureAdapter.getObjectId(a))},r),o}catch(n){if(n===w5)return new Set;throw n}}async executeQueryForSnapping(e,t){const r=D1(t),{point:n,distance:s,returnEdge:o,vertexMode:a}=e;if(!o&&a==="none")return{candidates:[]};let l=li(e.query);l=await this._schedule(()=>AXe(l,this.definitionExpression,this.spatialReference),r),l=await this._reschedule(()=>bpt(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r);const u=!Ya(n.spatialReference,this.spatialReference);u&&await Gv(n.spatialReference,this.spatialReference);const c=typeof s=="number"?s:s.x,h=typeof s=="number"?s:s.y,p={xmin:n.x-c,xmax:n.x+c,ymin:n.y-h,ymax:n.y+h,spatialReference:n.spatialReference},m=u?Sf(p,this.spatialReference):p;if(!m)return{candidates:[]};const v=(await cy(Ro(n),null,{signal:r}))[0],w=(await cy(Ro(m),null,{signal:r}))[0];if(v==null||w==null)return{candidates:[]};const S=new O_(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(w.toJSON())),r),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(S),r),await this._reschedule(()=>this._executeTimeQuery(S),r),await this._reschedule(()=>this._executeAttributesQuery(S),r),await this._reschedule(()=>this._executeGeometryQueryForSnapping(S,r),r);const I=v.toJSON(),R=u?Sf(I,this.spatialReference):I,L=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:s;return S.createSnappingResponse({...e,point:R,distance:L},n.spatialReference)}async executeQueryForLatestObservations(e,t){const r=D1(t);if(!this.timeInfo?.trackIdField)throw new qe(_Gr,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const n=await this._executeQuery(e,{},r);return await this._reschedule(()=>this._filterLatest(n),r),n.createQueryResponse()}catch(n){if(n!==w5)throw n;return new O_([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,r){const n=D1(r),{field:s,field2:o,field3:a,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:s,field2:o,field3:a,valueExpression:l},n)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,r){const n=D1(r),{field:s,normalizationField:o,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:o,valueExpression:a},n)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=D1(e);this._timeExtentPromise||=hGr(this.timeInfo,this.featureStore);const[r,n]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return hn(t),{fullExtent:r,timeExtent:n}}async _getBounds(e,t,r){const n=p3t(Dx(),$V);await this.featureStore.forEachBounds(e,a=>sQ(n,a));const s={xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:aH(this.spatialReference)};this.hasZ&&isFinite(n[2])&&isFinite(n[5])&&(s.zmin=n[2],s.zmax=n[5]);const o=Sf(s,t,r);if(o.spatialReference=aH(r),o.xmax-o.xmin==0){const a=pu(o.spatialReference);o.xmin-=a,o.xmax+=a}if(o.ymax-o.ymin==0){const a=pu(o.spatialReference);o.ymin-=a,o.ymax+=a}if(this.hasZ&&o.zmin!=null&&o.zmax!=null&&o.zmax-o.zmin==0){const a=pu(o.spatialReference);o.zmin-=a,o.zmax+=a}return o}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(obe)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(obe)}async _getAllFeaturesQueryEngineResult(e){return new O_(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const r=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(n=>r.push(n))})().then(()=>r)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,r){e=li(e),e=await this._schedule(()=>vpt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>bpt(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r),e={...e,...t};const n=await this._reschedule(()=>this._executeSceneFilterQuery(e,r),r),s=await this._reschedule(()=>this._executeGeometryQuery(e,n,r),r);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),r),await this._reschedule(()=>this._executeObjectIdsQuery(s),r),await this._reschedule(()=>this._executeTimeQuery(s),r),await this._reschedule(()=>this._executeAttributesQuery(s),r),s}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:r,returnGeometry:n,returnCentroid:s}=e,o=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,l=o==null||Ya(o,a.spatialReference)?a:Sf(a,o);if(!l)return null;const u=n||s,c=Cm(r)&&!Ya(this.spatialReference,r)&&u?async w=>this._project(w,r):w=>w,h=this.featureAdapter,p=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!p.length)return null;const w=new Set;for(const R of p)w.add(h.getObjectId(R));const S=await this._reschedule(()=>this._getAllFeatures(),t),I=await this._reschedule(async()=>{const R=await _U("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),L=B=>!w.has(h.getObjectId(B))||R(h.getGeometry(B)),k=await this._runSpatialFilter(S,L,t);return new O_(k,e,this)},t);return c(I)}if(!p.length)return new O_([],e,this);if(this._canExecuteSinglePass(l,e))return c(new O_(p,e,this));const m=await _U("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),v=await this._runSpatialFilter(p,w=>m(h.getGeometry(w)),t);return c(new O_(v,e,this))}async _executeGeometryQuery(e,t,r){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:n,outSR:s,spatialRel:o,returnGeometry:a,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!n||u==null||Ya(u,n.spatialReference)?n:Sf(n,u),h=a||l,p=Cm(s)&&!Ya(this.spatialReference,s),m=this._geometryQueryCache&&t==null?JSON.stringify(p&&h?{originalFilterGeometry:n,spatialRelationship:o,outSpatialReference:s}:{originalFilterGeometry:n,spatialRelationship:o}):null,v=m?this._geometryQueryCache.get(m):null;if(v!=null)return new O_(v,e,this);const w=async k=>(p&&h&&await this._project(k,s),m&&this._geometryQueryCache.put(m,k.items,k.items.length+1),k);if(!c)return w(t??await this._getAllFeaturesQueryEngineResult(e));const S=this.featureAdapter;let I=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(n)),r);if(o==="esriSpatialRelDisjoint"){if(!I.length)return w(t??await this._getAllFeaturesQueryEngineResult(e));const k=new Set;for(const V of I)k.add(S.getObjectId(V));const B=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),r),$=await this._reschedule(async()=>{const V=await _U(o,c,this.geometryType,this.hasZ,this.hasM),Y=Q=>!k.has(S.getObjectId(Q))||V(S.getGeometry(Q)),K=await this._runSpatialFilter(B,Y,r);return new O_(K,e,this)},r);return w($)}if(t!=null){const k=new Yxe;I=I.filter(B=>KH(t.items,B,t.items.length,k)>=0)}if(!I.length){const k=new O_([],e,this);return m&&this._geometryQueryCache.put(m,k.items,1),k}if(this._canExecuteSinglePass(c,e))return w(new O_(I,e,this));const R=await _U(o,c,this.geometryType,this.hasZ,this.hasM),L=await this._runSpatialFilter(I,k=>R(S.getGeometry(k)),r);return w(new O_(L,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:r}=e,{spatialRel:n}=r;if(!e?.items?.length||!r.geometry||!n)return;const s=await _U(n,r.geometry,this.geometryType,this.hasZ,this.hasM),o=await this._runSpatialFilter(e.items,a=>s(a.geometry),t);e.items=o}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const n of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(n).forEach(s=>t.add(s));const r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>t.has(r(n)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),r=this.featureAdapter.getObjectId;e.items=e.items.filter(n=>t.has(r(n)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=O7t(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=w8(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(r=>t.testFeature(r,this.featureAdapter))}}async _runSpatialFilter(e,t,r){if(!t)return e;if(this._frameTask==null)return e.filter(a=>t(a));let n=0;const s=new Array,o=async a=>{for(;no(u),r)}};return this._reschedule(a=>o(a),r).then(()=>s)}_filterLatest(e){const{trackIdField:t,startTimeField:r,endTimeField:n}=this.timeInfo,s=n||r,o=new Map,a=this.featureAdapter.getAttribute;for(const l of e.items){const u=a(l,t),c=a(l,s),h=o.get(u);(!h||c>a(h,s))&&o.set(u,l)}e.items=Array.from(o.values())}_canExecuteSinglePass(e,t){const{spatialRel:r}=t;return _pt(e)&&(r==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(r==="esriSpatialRelIntersects"||r==="esriSpatialRelContains"))}async _project(e,t){if(!t||Ya(this.spatialReference,t))return e;const r=this.featureAdapter;let n;try{const o=await this._getFullExtent();n=Une(this.spatialReference,t,o)}catch{}const s=await $jr(e.items.map(o=>wP(this.geometryType,this.hasZ,this.hasM,r.getGeometry(o))),this.spatialReference,t,n);return e.items=s.map((o,a)=>r.cloneWithGeometry(e.items[a],Z2(o,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(_pt(e)){if(zd(e))return[cW(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(ed(e))return e.rings.map(t=>cW(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[gY(Wo(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(n=>this.featureStore.forEachInBounds(n,s=>t.add(s))));const r=Array.from(t.values());return t.clear(),r}async _executeQueryForStatistics(e,t,r){e=li(e);try{e=await this._schedule(()=>vpt(e,this.definitionExpression,this.spatialReference),r),e=await this._reschedule(()=>lGr(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),r);const n=await this._reschedule(()=>this._executeSceneFilterQuery(e,r),r),s=await this._reschedule(()=>this._executeGeometryQuery(e,n,r),r);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),r),await this._reschedule(()=>this._executeObjectIdsQuery(s),r),await this._reschedule(()=>this._executeTimeQuery(s),r),await this._reschedule(()=>this._executeAttributesQuery(s),r),s}catch(n){if(n!==w5)throw n;return new O_([],e,this)}}};const R7t=/^\s*"([\S\s]*)"\s*$/,D7t=/""/g,F7t=` +`,xGr=[","," ",";","|"," "];function*k7t(i,e,t){let r=0;for(;r<=i.length;){const n=i.indexOf(e,r),s=i.substring(r,n>-1?n:void 0);r+=s.length+e.length,t&&!s.trim()||(yield s)}}function L7t(i){const e=i.includes(`\r `)?`\r -`:F7t;return k7t(i,e,!0)}function N7t(i,e){return k7t(i,e,!1)}function EGr(i,e,t){i=i.trim(),e=e?.trim();const r=[],n=Array.from(new Set([t?.delimiter,...CGr])).filter(o=>o!=null);for(const o of n){const a=O6e(i,o).length,l=O6e(e,o).length??a;a>1&&r.push({weight:Math.min(a,l),delimiter:o})}const s=r.sort(({weight:o},{weight:a})=>a-o).map(({delimiter:o})=>o);for(const o of s){const a=IGr(B7t(i,o).names,t?.longitudeField,t?.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*$7t(i,e,t,r=()=>Object.create(null)){const n=L7t(i);n.next();let s="",o="",a=0,l=r(),u=0;e:for(const c of n){const h=N7t(c,t);for(const p of h)if(s+=o+p,o="",a+=j7t(p),a%2==0){if(a>0){const m=R7t.exec(s);if(!m){l=r(),u=0,s="",a=0;continue e}l[e[u]]=m[1].replaceAll(D7t,'"'),u++}else l[e[u]]=s,u++;s="",a=0}else o=t;a===0?(yield l,l=r(),u=0):o=F7t}}function B7t(i,e){const t=O6e(i,e).filter(n=>n!=null),r=t.map(n=>fW(n));for(let n=r.length-1;n>=0;n--)r[n]||(r.splice(n,1),t.splice(n,1));return{names:r,aliases:t}}function O6e(i,e){if(!i?.length)return[];const t=[];let r="",n="",s=0;const o=N7t(i,e);for(const a of o)if(r+=n+a,n="",s+=j7t(a),s%2==0){if(s>0){const l=R7t.exec(r);l&&t.push(l[1].replaceAll(D7t,'"'))}else t.push(r);r="",s=0}else n=e;return t}function j7t(i){let e=0,t=0;for(t=i.indexOf('"',t);t>=0;)e++,t=i.indexOf('"',t+1);return e}function IGr(i,e,t){e=fW(e)?.toLowerCase(),t=fW(t)?.toLowerCase();const r=i.map(o=>o.toLowerCase()),n=e?i[r.indexOf(e)]:null,s=t?i[r.indexOf(t)]:null;return{longitudeFieldName:n||i[r.indexOf(PGr.find(o=>r.includes(o)))],latitudeFieldName:s||i[r.indexOf(OGr.find(o=>r.includes(o)))]}}function AGr(i,e,t,r,n){const s=[],o=$7t(i,t,e),a=[];for(const l of o){if(a.length===10)break;a.push(l)}for(let l=0;lp[u]))){case"integer":h="esriFieldTypeInteger";break;case"double":h="esriFieldTypeDouble";break;case"date":h="esriFieldTypeDate";break;default:h="esriFieldTypeString"}s.push({name:u,type:h,alias:c,length:s8(h)})}}return s}function MGr(i){if(!i.length)return"string";const e=/[^+\-.,0-9]/;return i.map(t=>{if(t!==""){if(!e.test(t)){let r=P6e(t);if(!isNaN(r))return/[.,]/.test(t)||!Number.isInteger(r)||r>214783647||r<-214783648?"double":"integer";if(t.includes("E")&&(r=Number(t),!Number.isNaN(r)||t.includes(",")&&(t=t.replace(",","."),r=Number(t),!Number.isNaN(r))))return"double"}return _jr(t)?"date":"string"}}).reduce((t,r)=>t===void 0?r:r===void 0?t:t===r?r:t==="string"||r==="string"?"string":t==="double"||r==="double"?"double":void 0)}const P6e=function(){const i=Q8t(),e=new RegExp("^"+i.regexp+"$"),t=new RegExp("["+i.group+"\\s\\xa0]","g"),r=i.factor;return n=>{const s=e.exec(n);if(i.factor=r,!s)return NaN;let o=s[1];if(!s[1]){if(!s[2])return NaN;o=s[2],i.factor*=-1}return o=o.replace(t,"").replace(i.decimal,"."),+o*i.factor}}(),OGr=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],PGr=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];function KA(i){return{renderer:{type:"simple",symbol:i==="esriGeometryPoint"||i==="esriGeometryMultipoint"?xPt:i==="esriGeometryPolyline"?SPt:TPt}}}const RGr=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let DGr=1;function OXe(i,e){if(yi("esri-csp-restrictions"))return()=>({[e]:null,...i});try{let t=`this.${e} = null;`;for(const n in i)t+=`this${RGr.test(n)?`.${n}`:`["${n}"]`} = ${JSON.stringify(i[n])};`;const r=new Function(` - return class AttributesClass$${DGr++} { +`:F7t;return k7t(i,e,!0)}function N7t(i,e){return k7t(i,e,!1)}function SGr(i,e,t){i=i.trim(),e=e?.trim();const r=[],n=Array.from(new Set([t?.delimiter,...xGr])).filter(o=>o!=null);for(const o of n){const a=O6e(i,o).length,l=O6e(e,o).length??a;a>1&&r.push({weight:Math.min(a,l),delimiter:o})}const s=r.sort(({weight:o},{weight:a})=>a-o).map(({delimiter:o})=>o);for(const o of s){const a=TGr(B7t(i,o).names,t?.longitudeField,t?.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*$7t(i,e,t,r=()=>Object.create(null)){const n=L7t(i);n.next();let s="",o="",a=0,l=r(),u=0;e:for(const c of n){const h=N7t(c,t);for(const p of h)if(s+=o+p,o="",a+=j7t(p),a%2==0){if(a>0){const m=R7t.exec(s);if(!m){l=r(),u=0,s="",a=0;continue e}l[e[u]]=m[1].replaceAll(D7t,'"'),u++}else l[e[u]]=s,u++;s="",a=0}else o=t;a===0?(yield l,l=r(),u=0):o=F7t}}function B7t(i,e){const t=O6e(i,e).filter(n=>n!=null),r=t.map(n=>fW(n));for(let n=r.length-1;n>=0;n--)r[n]||(r.splice(n,1),t.splice(n,1));return{names:r,aliases:t}}function O6e(i,e){if(!i?.length)return[];const t=[];let r="",n="",s=0;const o=N7t(i,e);for(const a of o)if(r+=n+a,n="",s+=j7t(a),s%2==0){if(s>0){const l=R7t.exec(r);l&&t.push(l[1].replaceAll(D7t,'"'))}else t.push(r);r="",s=0}else n=e;return t}function j7t(i){let e=0,t=0;for(t=i.indexOf('"',t);t>=0;)e++,t=i.indexOf('"',t+1);return e}function TGr(i,e,t){e=fW(e)?.toLowerCase(),t=fW(t)?.toLowerCase();const r=i.map(o=>o.toLowerCase()),n=e?i[r.indexOf(e)]:null,s=t?i[r.indexOf(t)]:null;return{longitudeFieldName:n||i[r.indexOf(AGr.find(o=>r.includes(o)))],latitudeFieldName:s||i[r.indexOf(IGr.find(o=>r.includes(o)))]}}function CGr(i,e,t,r,n){const s=[],o=$7t(i,t,e),a=[];for(const l of o){if(a.length===10)break;a.push(l)}for(let l=0;lp[u]))){case"integer":h="esriFieldTypeInteger";break;case"double":h="esriFieldTypeDouble";break;case"date":h="esriFieldTypeDate";break;default:h="esriFieldTypeString"}s.push({name:u,type:h,alias:c,length:s8(h)})}}return s}function EGr(i){if(!i.length)return"string";const e=/[^+\-.,0-9]/;return i.map(t=>{if(t!==""){if(!e.test(t)){let r=P6e(t);if(!isNaN(r))return/[.,]/.test(t)||!Number.isInteger(r)||r>214783647||r<-214783648?"double":"integer";if(t.includes("E")&&(r=Number(t),!Number.isNaN(r)||t.includes(",")&&(t=t.replace(",","."),r=Number(t),!Number.isNaN(r))))return"double"}return gjr(t)?"date":"string"}}).reduce((t,r)=>t===void 0?r:r===void 0?t:t===r?r:t==="string"||r==="string"?"string":t==="double"||r==="double"?"double":void 0)}const P6e=function(){const i=Q8t(),e=new RegExp("^"+i.regexp+"$"),t=new RegExp("["+i.group+"\\s\\xa0]","g"),r=i.factor;return n=>{const s=e.exec(n);if(i.factor=r,!s)return NaN;let o=s[1];if(!s[1]){if(!s[2])return NaN;o=s[2],i.factor*=-1}return o=o.replace(t,"").replace(i.decimal,"."),+o*i.factor}}(),IGr=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],AGr=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"];function KA(i){return{renderer:{type:"simple",symbol:i==="esriGeometryPoint"||i==="esriGeometryMultipoint"?xPt:i==="esriGeometryPolyline"?SPt:TPt}}}const MGr=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let OGr=1;function OXe(i,e){if(yi("esri-csp-restrictions"))return()=>({[e]:null,...i});try{let t=`this.${e} = null;`;for(const n in i)t+=`this${MGr.test(n)?`.${n}`:`["${n}"]`} = ${JSON.stringify(i[n])};`;const r=new Function(` + return class AttributesClass$${OGr++} { constructor() { ${t}; } } - `)();return()=>new r}catch{return()=>({[e]:null,...i})}}function G7t(i={}){return[{name:"New Feature",description:"",prototype:{attributes:li(i)}}]}function WTe(i,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:i},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:T7t,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}const FGr=KA("esriGeometryPoint"),kGr=["csv"],LGr=[0,0];let NGr=class{constructor(e,t){this.x=e,this.y=t}},$Gr=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[r]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),n=BGr(r,e);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const s=await this._createFeatures(r);this._queryEngine.featureStore.addMany(s);const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=o,a){const{start:l,end:u}=a;n.layerDefinition.timeInfo.timeExtent=[l,u]}return n}async applyEdits(){throw new qe("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=pE(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),mo(n)||di.getLogger("esri.layers.CSVLayer").error(new qe("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:r}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:r}=this._loadOptions;if(!t)throw new qe("csv-layer:invalid-source","url not defined");const n=Yo(t);return(await zi(n.path,{query:{...n.query,...r},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:r,extent:n,timeInfo:s}=e.layerDefinition,o=new rX({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new lL({fieldsIndex:Cd.fromLayerJSON({fields:r,dateFieldsTimeReference:{timeZoneIANA:y0}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:t,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:r}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const l=[],u=s.fields.filter(v=>v.name!==n).map(v=>v.name);let c=0;const h={};for(const v of s.fields)if(v.type!=="esriFieldTypeOID"&&v.type!=="esriFieldTypeGlobalID"){const w=w2e(v);w!==void 0&&(h[v.name]=w)}const p=$7t(e,u,this._delimiter,OXe(h,n));for(const v of p){const w=this._parseCoordinateValue(v[t]),S=this._parseCoordinateValue(v[r]);if(S!=null&&w!=null&&!isNaN(w)&&!isNaN(S)){v[t]=w,v[r]=S;for(const I in v)if(I!==t&&I!==r){if(s.isDateField(I))v[I]=a7t(v[I]);else if(s.isNumericField(I)){const R=P6e(v[I]);isNaN(R)?v[I]=null:v[I]=R}}v[n]=c,c++,a.push(new NGr(S,w)),l.push(v)}}if(!Ya({wkid:4326},o))if(Nb(o))for(const v of a)[v.x,v.y]=Z5(v.x,v.y,LGr);else a=TW(Mu,a,Xi.WGS84,o,null,null);const m=[];for(let v=0;v181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await Gv(Yp,e)}catch{throw new qe("csv-layer:projection-not-supported","Projection not supported")}}};function BGr(i,e){const t=e.parsingOptions||{},r={delimiter:t.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:t.latitudeField,longitudeFieldName:t.longitudeField}},n=r.layerDefinition={name:o2e(e.url,kGr)||"csv",dateFieldsTimeReference:{timeZoneIANA:y0},drawingInfo:FGr,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:t.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:t.spatialReference||{wkid:4326}}},s=L7t(i),o=s.next().value?.trim(),a=s.next().value?.trim();if(!o)throw new qe("csv-layer:empty-csv","CSV is empty",{csv:i});const{delimiter:l,locationInfo:u}=EGr(o,a,t);if(!l)throw new qe("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:t});if(!u)throw new qe("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:t});r.locationInfo=u,r.delimiter=l;const{names:c,aliases:h}=B7t(o,l),p=AGr(i,r.delimiter,c,h,r.locationInfo);if(t.fields?.length){const v=new Cd(t.fields);for(const w of p){const S=v.get(w.name);S&&Object.assign(w,S)}}if(!p.some(v=>v.type==="esriFieldTypeOID"&&(n.objectIdField=v.name,!0))){const v={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=v.name,p.unshift(v)}n.fields=p;const m=new Cd(n.fields);if(r.locationInfo&&(r.locationInfo.latitudeFieldName=m.get(r.locationInfo.latitudeFieldName).name,r.locationInfo.longitudeFieldName=m.get(r.locationInfo.longitudeFieldName).name),n.timeInfo){const v=n.timeInfo;if(v.startTimeField){const w=m.get(v.startTimeField);w?(v.startTimeField=w.name,w.type="esriFieldTypeDate"):v.startTimeField=null}if(v.endTimeField){const w=m.get(v.endTimeField);w?(v.endTimeField=w.name,w.type="esriFieldTypeDate"):v.endTimeField=null}if(v.trackIdField){const w=m.get(v.trackIdField);v.trackIdField=w?w.name:null}v.startTimeField||v.endTimeField||(n.timeInfo=null)}return r}const jGr=Object.freeze(Object.defineProperty({__proto__:null,default:$Gr},Symbol.toStringTag,{value:"Module"}));let PXe=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=9;const o=this.TypedArrayConstructor;n===void 0&&(n=9*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)t[n]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[r++]=t[n]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;for(let l=0;l<9;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};PXe.ElementCount=9;let RXe=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=16;const o=this.TypedArrayConstructor;n===void 0&&(n=16*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)t[n]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[r++]=t[n]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;for(let l=0;l<16;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};RXe.ElementCount=16;let zR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.stride=n,this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}};zR.ElementCount=1;let VR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=2;const o=this.TypedArrayConstructor;n===void 0&&(n=2*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,dl(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};VR.ElementCount=2;let HR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=3;const o=this.TypedArrayConstructor;n===void 0&&(n=3*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,Zo(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,n){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=n}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};HR.ElementCount=3;let WR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const o=this.TypedArrayConstructor;n===void 0&&(n=4*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,k1(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};WR.ElementCount=4;let qTe=class U7t extends zR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}static fromTypedArray(e,t){return new U7t(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};qTe.ElementType="f32";let u7=class R6e extends VR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(R6e,e,t)}static fromTypedArray(e,t){return new R6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};u7.ElementType="f32";let Om=class D6e extends HR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(D6e,e,t)}static fromTypedArray(e,t){return new D6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Om.ElementType="f32";let E3=class F6e extends WR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(F6e,e,t)}static fromTypedArray(e,t){return new F6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};E3.ElementType="f32";let DXe=class k6e extends PXe{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(k6e,e,t)}static fromTypedArray(e,t){return new k6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};DXe.ElementType="f32";let FXe=class L6e extends PXe{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(L6e,e,t)}static fromTypedArray(e,t){return new L6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};FXe.ElementType="f64";let kXe=class N6e extends RXe{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(N6e,e,t)}static fromTypedArray(e,t){return new N6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};kXe.ElementType="f32";let LXe=class $6e extends RXe{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer($6e,e,t)}static fromTypedArray(e,t){return new $6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};LXe.ElementType="f64";let NXe=class B6e extends zR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B6e,e,t)}static fromTypedArray(e,t){return new B6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};NXe.ElementType="f64";let $Xe=class j6e extends VR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(j6e,e,t)}static fromTypedArray(e,t){return new j6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};$Xe.ElementType="f64";let zS=class G6e extends HR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(G6e,e,t)}static fromTypedArray(e,t){return new G6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};zS.ElementType="f64";let BXe=class U6e extends WR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(U6e,e,t)}static fromTypedArray(e,t){return new U6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};BXe.ElementType="f64";let YTe=class z6e extends zR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(z6e,e,t)}static fromTypedArray(e,t){return new z6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};YTe.ElementType="u8";let XTe=class V6e extends VR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(V6e,e,t)}static fromTypedArray(e,t){return new V6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};XTe.ElementType="u8";let bq=class H6e extends HR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(H6e,e,t)}static fromTypedArray(e,t){return new H6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};bq.ElementType="u8";let K3=class W6e extends WR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(W6e,e,t)}static fromTypedArray(e,t){return new W6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};K3.ElementType="u8";let JTe=class q6e extends zR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(q6e,e,t)}static fromTypedArray(e,t){return new q6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};JTe.ElementType="u16";let jXe=class Y6e extends VR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(Y6e,e,t)}static fromTypedArray(e,t){return new Y6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};jXe.ElementType="u16";let fle=class X6e extends HR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(X6e,e,t)}static fromTypedArray(e,t){return new X6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};fle.ElementType="u16";let nX=class J6e extends WR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(J6e,e,t)}static fromTypedArray(e,t){return new J6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};nX.ElementType="u16";let KTe=class K6e extends zR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(K6e,e,t)}static fromTypedArray(e,t){return new K6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};KTe.ElementType="u32";let GXe=class Z6e extends VR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Z6e,e,t)}static fromTypedArray(e,t){return new Z6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};GXe.ElementType="u32";let z7t=class Q6e extends HR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Q6e,e,t)}static fromTypedArray(e,t){return new Q6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};z7t.ElementType="u32";let V7t=class e8e extends WR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(e8e,e,t)}static fromTypedArray(e,t){return new e8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};V7t.ElementType="u32";let UXe=class t8e extends zR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(t8e,e,t)}static fromTypedArray(e,t){return new t8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};UXe.ElementType="i8";let ZTe=class i8e extends VR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(i8e,e,t)}static fromTypedArray(e,t){return new i8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};ZTe.ElementType="i8";let H7t=class r8e extends HR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(r8e,e,t)}static fromTypedArray(e,t){return new r8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};H7t.ElementType="i8";let W7t=class n8e extends WR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(n8e,e,t)}static fromTypedArray(e,t){return new n8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};W7t.ElementType="i8";let q7t=class s8e extends zR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(s8e,e,t)}static fromTypedArray(e,t){return new s8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};q7t.ElementType="i16";let mle=class o8e extends VR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(o8e,e,t)}static fromTypedArray(e,t){return new o8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};mle.ElementType="i16";let Y7t=class a8e extends HR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(a8e,e,t)}static fromTypedArray(e,t){return new a8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Y7t.ElementType="i16";let X7t=class l8e extends WR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(l8e,e,t)}static fromTypedArray(e,t){return new l8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};X7t.ElementType="i16";let J7t=class u8e extends zR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(u8e,e,t)}static fromTypedArray(e,t){return new u8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};J7t.ElementType="i32";let K7t=class c8e extends VR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(c8e,e,t)}static fromTypedArray(e,t){return new c8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};K7t.ElementType="i32";let Z7t=class h8e extends HR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(h8e,e,t)}static fromTypedArray(e,t){return new h8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Z7t.ElementType="i32";let Q7t=class d8e extends WR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(d8e,e,t)}static fromTypedArray(e,t){return new d8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Q7t.ElementType="i32";function p8e(i){switch(i){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}let GGr=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function Ch(i,e){if(!i){e=e||"Assertion";const t=new Error(e).stack;throw new GGr(`${e} at ${t}`)}}function Opt(i,e,t,r){let n,s=(t[0]-i[0])/e[0],o=(r[0]-i[0])/e[0];s>o&&(n=s,s=o,o=n);let a=(t[1]-i[1])/e[1],l=(r[1]-i[1])/e[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),lc&&(n=u,u=c,c=n),!(s>c||u>o)&&(cthis._fields.set(t[0],{...t[1],constructor:HGr(t[1].constructor)})))}vec2f(e,t){return this._appendField(e,u7,t),this}vec2f64(e,t){return this._appendField(e,$Xe,t),this}vec3f(e,t){return this._appendField(e,Om,t),this}vec3f64(e,t){return this._appendField(e,zS,t),this}vec4f(e,t){return this._appendField(e,E3,t),this}vec4f64(e,t){return this._appendField(e,BXe,t),this}mat3f(e,t){return this._appendField(e,DXe,t),this}mat3f64(e,t){return this._appendField(e,FXe,t),this}mat4f(e,t){return this._appendField(e,kXe,t),this}mat4f64(e,t){return this._appendField(e,LXe,t),this}vec4u8(e,t){return this._appendField(e,K3,t),this}f32(e,t){return this._appendField(e,qTe,t),this}f64(e,t){return this._appendField(e,NXe,t),this}u8(e,t){return this._appendField(e,YTe,t),this}u16(e,t){return this._appendField(e,JTe,t),this}i8(e,t){return this._appendField(e,UXe,t),this}vec2i8(e,t){return this._appendField(e,ZTe,t),this}vec2i16(e,t){return this._appendField(e,mle,t),this}vec2u8(e,t){return this._appendField(e,XTe,t),this}vec4u16(e,t){return this._appendField(e,nX,t),this}u32(e,t){return this._appendField(e,KTe,t),this}_appendField(e,t,r){if(this._fields.has(e))return void Ch(!1,`${e} already added to vertex buffer layout`);const n=t.ElementCount*p8e(t.ElementType),s=this._stride;this._stride+=n,this._fields.set(e,{size:n,constructor:t,offset:s,optional:r})}createBuffer(e){return new Ppt(this,e)}createView(e){return new Ppt(this,e)}clone(){const e=new tjt;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(t=>e=Math.max(e,p8e(t.constructor.ElementType))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}};function c7(){return new UGr}let zGr=class{constructor(e){this.fields=new Array,e.fields.forEach((t,r)=>{const n={...t,constructor:ijt(t.constructor)};this.fields.push([r,n])}),this.stride=e.stride}};const VGr=[qTe,u7,Om,E3,DXe,kXe,NXe,$Xe,zS,BXe,FXe,LXe,YTe,XTe,bq,K3,JTe,jXe,fle,nX,KTe,GXe,z7t,V7t,UXe,ZTe,H7t,W7t,q7t,mle,Y7t,X7t,J7t,K7t,Z7t,Q7t];function ijt(i){return`${i.ElementType}_${i.ElementCount}`}function HGr(i){return rjt.get(i)}const rjt=new Map;VGr.forEach(i=>rjt.set(ijt(i),i));function abe(i,e){return e.push(i.buffer),{buffer:i.buffer,layout:new zGr(i.layout)}}var lb,Eo,bn,I3,Bs,W1,wq,Ti,Hl,il,Is,Ls,gp,ks,gs,lc,vf,oa,sx,Hy;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(lb||(lb={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Eo||(Eo={})),function(i){i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(bn||(bn={})),function(i){i[i.ADD=32774]="ADD",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.SUBTRACT=32778]="SUBTRACT",i[i.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(I3||(I3={})),function(i){i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(Bs||(Bs={})),function(i){i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(W1||(W1={})),function(i){i[i.CW=2304]="CW",i[i.CCW=2305]="CCW"}(wq||(wq={})),function(i){i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT"}(Ti||(Ti={})),function(i){i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS"}(Hl||(Hl={})),function(i){i[i.ZERO=0]="ZERO",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP"}(il||(il={})),function(i){i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(Is||(Is={})),function(i){i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Ls||(Ls={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(gp||(gp={})),function(i){i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.RED=6403]="RED",i[i.RG=33319]="RG",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER"}(ks||(ks={})),function(i){i[i.RGBA4=32854]="RGBA4",i[i.R16F=33325]="R16F",i[i.RG16F=33327]="RG16F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.R32F=33326]="R32F",i[i.RG32F=33328]="RG32F",i[i.RGBA32F=34836]="RGBA32F",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB5_A1=32855]="RGB5_A1",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.RGB16F=34843]="RGB16F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.RGB565=36194]="RGB565",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2=32857]="RGB10_A2",i[i.RGB10_A2UI=36975]="RGB10_A2UI"}(gs||(gs={})),function(i){i[i.FLOAT=5126]="FLOAT",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.INT=5124]="INT",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(lc||(lc={})),function(i){i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(vf||(vf={})),function(i){i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.STATIC_READ=35045]="STATIC_READ",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.STREAM_COPY=35042]="STREAM_COPY"}(oa||(oa={})),function(i){i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER"}(sx||(sx={})),function(i){i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(Hy||(Hy={}));const zOe=33984;var bd,pv,f8e;(function(i){i[i.Texture=0]="Texture",i[i.BufferObject=1]="BufferObject",i[i.VertexArrayObject=2]="VertexArrayObject",i[i.Shader=3]="Shader",i[i.Program=4]="Program",i[i.FramebufferObject=5]="FramebufferObject",i[i.Renderbuffer=6]="Renderbuffer",i[i.TransformFeedback=7]="TransformFeedback",i[i.Sync=8]="Sync",i[i.UNCOUNTED=9]="UNCOUNTED",i[i.LinesOfCode=9]="LinesOfCode",i[i.Uniform=10]="Uniform",i[i.COUNT=11]="COUNT"})(bd||(bd={})),function(i){i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(pv||(pv={})),function(i){i[i.NONE=0]="NONE",i[i.BACK=1029]="BACK"}(f8e||(f8e={}));const m8e=33306;var Vh,uv,Rpt,Dpt,lbe,g8e,Fpt;(function(i){i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(Vh||(Vh={})),function(i){i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT=5124]="INT",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(uv||(uv={})),function(i){i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS"}(Rpt||(Rpt={})),function(i){i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED"}(Dpt||(Dpt={})),function(i){i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED"}(lbe||(lbe={})),function(i){i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(g8e||(g8e={})),function(i){i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(Fpt||(Fpt={}));let Vl=class{constructor(e,t,r,n,s,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=n,this.stride=s,this.normalized=o,this.divisor=a}};function zXe(i,e=0){const t=i.stride;return Array.from(i.fields.keys()).map(r=>{const n=i.fields.get(r),s=n.constructor.ElementCount,o=WGr(n.constructor.ElementType),a=n.offset,l=!(!n.optional||!n.optional.glNormalized);return new Vl(r,s,o,a,t,l,e)})}function WGr(i){const e=qGr[i];if(e)return e;throw new Error("BufferType not supported in WebGL")}const qGr={u8:Ti.UNSIGNED_BYTE,u16:Ti.UNSIGNED_SHORT,u32:Ti.UNSIGNED_INT,i8:Ti.BYTE,i16:Ti.SHORT,i32:Ti.INT,f32:Ti.FLOAT};var tn;(function(i){i.POSITION="position",i.NORMAL="normal",i.NORMALCOMPRESSED="normalCompressed",i.UV0="uv0",i.COLOR="color",i.SYMBOLCOLOR="symbolColor",i.SIZE="size",i.TANGENT="tangent",i.OFFSET="offset",i.PERSPECTIVEDIVIDE="perspectiveDivide",i.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",i.LENGTH="length",i.PREVPOSITION="prevPosition",i.NEXTPOSITION="nextPosition",i.SUBDIVISIONFACTOR="subdivisionFactor",i.COLORFEATUREATTRIBUTE="colorFeatureAttribute",i.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",i.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",i.DISTANCETOSTART="distanceToStart",i.UVMAPSPACE="uvMapSpace",i.BOUNDINGRECT="boundingRect",i.UVREGION="uvRegion",i.PROFILERIGHT="profileRight",i.PROFILEUP="profileUp",i.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",i.FEATUREVALUE="featureValue",i.INSTANCEMODELORIGINHI="instanceModelOriginHi",i.INSTANCEMODELORIGINLO="instanceModelOriginLo",i.INSTANCEMODEL="instanceModel",i.INSTANCEMODELNORMAL="instanceModelNormal",i.INSTANCECOLOR="instanceColor",i.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",i.LOCALTRANSFORM="localTransform",i.GLOBALTRANSFORM="globalTransform",i.BOUNDINGSPHERE="boundingSphere",i.MODELORIGIN="modelOrigin",i.MODELSCALEFACTORS="modelScaleFactors",i.FEATUREATTRIBUTE="featureAttribute",i.STATE="state",i.LODLEVEL="lodLevel",i.POSITION0="position0",i.POSITION1="position1",i.NORMAL2COMPRESSED="normal2Compressed",i.COMPONENTINDEX="componentIndex",i.VARIANTOFFSET="variantOffset",i.VARIANTSTROKE="variantStroke",i.VARIANTEXTENSION="variantExtension",i.SIDENESS="sideness",i.START="start",i.END="end",i.UP="up",i.EXTRUDE="extrude",i.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",i.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"})(tn||(tn={}));const njt=c7().vec3f(tn.POSITION).u16(tn.COMPONENTINDEX),YGr=c7().vec2u8(tn.SIDENESS);zXe(YGr);const y8e=c7().vec3f(tn.POSITION0).vec3f(tn.POSITION1).vec2i16(tn.NORMALCOMPRESSED).u16(tn.COMPONENTINDEX).u8(tn.VARIANTOFFSET,{glNormalized:!0}).u8(tn.VARIANTSTROKE).u8(tn.VARIANTEXTENSION,{glNormalized:!0}),v8e=c7().vec3f(tn.POSITION0).vec3f(tn.POSITION1).vec2i16(tn.NORMALCOMPRESSED).vec2i16(tn.NORMAL2COMPRESSED).u16(tn.COMPONENTINDEX).u8(tn.VARIANTOFFSET,{glNormalized:!0}).u8(tn.VARIANTSTROKE).u8(tn.VARIANTEXTENSION,{glNormalized:!0});tn.POSITION0,tn.POSITION1,tn.COMPONENTINDEX,tn.VARIANTOFFSET,tn.VARIANTSTROKE,tn.VARIANTEXTENSION,tn.NORMALCOMPRESSED,tn.NORMAL2COMPRESSED,tn.SIDENESS;const g$=-1;var kpt;function _8e(i,e,t,r=eUr){const n=i.vertices.position,s=i.vertices.componentIndex,o=Rx(r.anglePlanar),a=Rx(r.angleSignificantEdge),l=Math.cos(a),u=Math.cos(o),c=b8e.edge,h=c.position0,p=c.position1,m=c.faceNormal0,v=c.faceNormal1,w=QGr(i),S=ZGr(i),I=S.length/4,R=e.allocate(I);let L=0;const k=I,B=t.allocate(k);let $=0,V=0,Y=0;const K=uVi(0,I),Q=new Float32Array(I);Q.forEach((H,Z,ae)=>{n.getVec(S[4*Z],h),n.getVec(S[4*Z+1],p),ae[Z]=hR(h,p)}),K.sort((H,Z)=>Q[Z]-Q[H]);const re=new Array,ne=new Array;for(let H=0;He}function KGr(i,e){const t=Mze(i.cosAngle),r=b8e.fwd,n=b8e.ortho;return ZEt(r,i.position1,i.position0),t*(yE(qC(n,i.faceNormal0,i.faceNormal1),r)>0?-1:1)>e}function ZGr(i){const e=i.faces.length/3,t=i.faces,r=i.neighbors;let n=0;for(let a=0;a(e=e&&r===0,t=t&&r===n,!e&&!t)),e?iUr(i.length):t?QTe(i.length):U9(i)||i.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?tUr(i):i}function tUr(i){let e=!0;for(const t of i){if(t>=65536)return U9(i)?new Uint32Array(i):i;t>=256&&(e=!1)}return e?new Uint8Array(i):new Uint16Array(i)}function sjt(i){return i<=a3?new Array(i):i<=65536?new Uint16Array(i):new Uint32Array(i)}let Dj=(()=>{const i=new Uint32Array(131072);for(let e=0;e{const i=new Uint16Array(65536);for(let e=0;eDj.length){const e=Math.max(2*Dj.length,i);Dj=new Uint32Array(e);for(let t=0;t_de.length){const e=Math.max(2*_de.length,i);_de=new Uint8Array(e)}return new Uint8Array(_de.buffer,0,i)}function w8e(i,e,t){const r=Array.isArray(i),n=r?i.length/e:i.byteLength/(4*e),s=r?i:new Uint32Array(i,0,n*e),o=t?.minReduction??0,a=t?.originalIndices||null,l=a?a.length:0,u=t?.componentOffsets||null;let c=0;if(u)for(let $=0;$c&&(c=V)}else c=n;const h=Math.floor(1.1*c)+1;(VE==null||VE.length<2*h)&&(VE=new Uint32Array(_Xi(2*h)));for(let $=0;$<2*h;$++)VE[$]=0;let p=0;const m=!!u&&!!a,v=m?l:n;let w=sjt(n);const S=new Uint32Array(l),I=1.96;let R=o!==0?Math.ceil(4*I*I/(o*o)*o*(1-o)):v,L=1,k=u?u[1]:v;for(let $=0;$=h&&(Q-=h)}re===p&&(VE[2*Q]=K,VE[2*Q+1]=V+1,p++),w[V]=re}if(o!==0&&1-p/n>>2)|0;return r>>>0}let VE=null;function Lpt(i,e,t){const r=e/3,n=new Uint32Array(t+1),s=new Uint32Array(t+1),o=(I,R)=>{I{if(I{const L=2*I,k=R-I;for(let B=1;B=0&&u[L+2*Y]>$;Y--)u[L+2*Y+2]=u[L+2*Y],u[L+2*Y+3]=u[L+2*Y+1];u[L+2*Y+2]=$,u[L+2*Y+3]=V}};for(let I=0;II===i[3*R]?0:I===i[3*R+1]?1:I===i[3*R+2]?2:-1,w=(I,R)=>{const L=v(I,R);m[3*R+L]=-1},S=(I,R,L,k)=>{const B=v(I,R);m[3*R+B]=k;const $=v(L,k);m[3*k+$]=R};for(let I=0;I=0?1:-1)*(1-Math.abs(l)):a,c=n<=0?(l>=0?1:-1)*(1-Math.abs(a)):l,h=e*s;i[h]=Npt(u),i[h+1]=Npt(c)}function Npt(i){return uu(Math.round(32767*i),-32767,32767)}let ajt=class{updateSettings(e){this.settings=e,this._edgeHashFunction=e.reducedPrecision?aUr:oUr}write(e,t,r){const n=this._edgeHashFunction(r);wde.seed=n;const s=wde.getIntRange(0,255),o=wde.getIntRange(0,this.settings.variants-1),a=.7,l=wde.getFloat(),u=255*(.5*lUr(-(1-Math.min(l/a,1))+Math.max(0,l-a)/(1-a),1.2)+.5);e.position0.setVec(t,r.position0),e.position1.setVec(t,r.position1),e.componentIndex.set(t,r.componentIndex),e.variantOffset.set(t,s),e.variantStroke.set(t,o),e.variantExtension.set(t,u)}trim(e,t){return e.slice(0,t)}};const VXe=new Float32Array(6),ube=new Uint32Array(VXe.buffer),aF=new Uint32Array(1);function oUr(i){const e=VXe;e[0]=i.position0[0],e[1]=i.position0[1],e[2]=i.position0[2],e[3]=i.position1[0],e[4]=i.position1[1],e[5]=i.position1[2],aF[0]=5381;for(let t=0;tnull,write:()=>{},trim:()=>null},vUr=Object.freeze(Object.defineProperty({__proto__:null,default:dUr},Symbol.toStringTag,{value:"Module"}));let oee=class extends xs(Ci){constructor(e){super(e),this.type="georeferenced",this.origin=null}};x([Wr({georeferenced:"georeferenced"},{readOnly:!0})],oee.prototype,"type",void 0),x([D({type:[Number],nonNullable:!1,json:{write:!0}})],oee.prototype,"origin",void 0),oee=x([Qe("esri.geometry.support.MeshGeoreferencedVertexSpace")],oee);const UC=oee;let aee=class extends xs(Ci){constructor(e){super(e),this.type="local",this.origin=gr()}};x([Wr({local:"local"},{readOnly:!0})],aee.prototype,"type",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],aee.prototype,"origin",void 0),aee=x([Qe("esri.geometry.support.MeshLocalVertexSpace")],aee);const lH=aee,HXe=()=>di.getLogger("esri.views.3d.support.buffer.math");function ujt(i,e,t){Sk(i.typedBuffer,e.typedBuffer,t,i.typedBufferStride,e.typedBufferStride)}function Sk(i,e,t,r=3,n=r){if(i.length/r!==Math.ceil(e.length/n))return i;const s=i.length/r,o=t[0],a=t[1],l=t[2],u=t[4],c=t[5],h=t[6],p=t[8],m=t[9],v=t[10],w=t[12],S=t[13],I=t[14];let R=0,L=0;for(let k=0;k0){const p=1/Math.sqrt(h);i[o]=p*l,i[o+1]=p*u,i[o+2]=p*c}s+=r,o+=t}}function _Ur(i,e,t){const r=Math.min(i.count,e.count),n=i.typedBuffer,s=i.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride;let l=0,u=0;for(let c=0;c>t,n[u+1]=o[l+1]>>t,n[u+2]=o[l+2]>>t,l+=a,u+=s}Object.freeze(Object.defineProperty({__proto__:null,normalize:gle,normalizeView:hjt,scale:cbe,scaleView:E8e,shiftRight:_Ur,transformMat3:Z3,transformMat3View:cjt,transformMat4:Sk,transformMat4View:ujt,translate:WXe},Symbol.toStringTag,{value:"Module"}));function Upt(){return di.getLogger("esri.geometry.Mesh")}function bUr(i){const{vertexSpace:e}=i;if(e.origin!=null)return i.clone();const{anchor:t}=i,r=t.clone(),n=new UC({origin:[r.x,r.y,r.z]}),s=i.cloneWithVertexSpace(n),{position:o}=s.vertexAttributes;return s.vertexAttributes.position=WXe(new Float64Array(o.length),o,[-r.x,-r.y,-(r.z??0)]),s.vertexAttributesChanged(),s}function VS(i){return i.origin!=null}function djt(i){return VS(i.vertexSpace)}function hbe(i,e){if(!VS(i))return null;const[t,r,n]=i.origin;return new $i({x:t,y:r,z:n,spatialReference:e})}function wUr(i,e){const{x:t,y:r,z:n,spatialReference:s}=i,o=[t,r,n??0];if(e?.geographic!==void 0){if(UF(Upt(),"option: geographic",{replacement:"use vertexSpace option instead",version:"4.29",warnOnce:!0}),!e?.vertexSpace)return e?.geographic?new lH({origin:o}):new UC({origin:o});Upt().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")}if(!e?.vertexSpace)return s.isGeographic||s.isWebMercator?new lH({origin:o}):new UC({origin:o});switch(e.vertexSpace){case"local":return new lH({origin:o});case"georeferenced":return new UC({origin:o});case"georeferenced-absolute":return new UC}}function zpt(i){return i.isGeographic||i.isWebMercator?"local":"georeferenced"}function Vpt(i,e){return i==="local"?new lH({origin:e}):new UC({origin:e})}function Yd(){return[1,0,0,0,1,0,0,0,1]}function xUr(i){return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]]}function uH(i,e,t,r,n,s,o,a,l){return[i,e,t,r,n,s,o,a,l]}function SUr(i,e){return new Float64Array(i,e,9)}const h7=Yd();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:h7,clone:xUr,create:Yd,createView:SUr,fromValues:uH},Symbol.toStringTag,{value:"Module"}));function Pm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Vse(i){return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]]}function TUr(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w){return[i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w]}function CUr(i,e){return new Float64Array(i,e,16)}const ZA=Pm();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:ZA,clone:Vse,create:Pm,createView:CUr,fromValues:TUr},Symbol.toStringTag,{value:"Module"}));const EUr=new Xi(bEt),lee=new Xi(a2e),uee=new Xi(l2e);new Xi(gie);function Bx(i){const e=Hpt.get(i);if(e)return e;let t=EUr;if(i)if(i===lee)t=lee;else if(i===uee)t=uee;else{const r=i.wkid,n=i.latestWkid;if(r!=null||n!=null)eW(r)||eW(n)?t=lee:(tW(r)||tW(n))&&(t=uee);else{const s=i.wkt2??i.wkt;if(s){const o=s.toUpperCase();o===IUr?t=lee:o===AUr&&(t=uee)}}}return Hpt.set(i,t),t}const Hpt=new Map,IUr=lee.wkt.toUpperCase(),AUr=uee.wkt.toUpperCase();function pjt(i,e,t){const r=Math.sin(i),n=Math.cos(i),s=Math.sin(e),o=Math.cos(e),a=t;return a[0]=-r,a[4]=-s*n,a[8]=o*n,a[12]=0,a[1]=n,a[5]=-s*r,a[9]=o*r,a[13]=0,a[2]=0,a[6]=o,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}function MUr(i,e,t){return pjt(i,e,t),BR(t,t),t}function MB(i,e,t,r){if(i==null||r==null)return!1;const n=Bne(i,RPt),s=Bne(r,nar);if(n===s&&!Wpt(s)&&(n!==Gi.UNKNOWN||Ya(i,r)))return vOt(t,e),!0;if(Wpt(s)){const o=Lz[n][Gi.LON_LAT],a=Lz[Gi.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,OD,0),a(OD,0,PD,0),pjt(xde*OD[0],xde*OD[1],t),t[12]=PD[0],t[13]=PD[1],t[14]=PD[2],!0)}if((s===Gi.WEB_MERCATOR||s===Gi.PLATE_CARREE||s===Gi.WGS84)&&(n===Gi.WGS84||n===Gi.CGCS2000&&s===Gi.PLATE_CARREE||n===Gi.SPHERICAL_ECEF||n===Gi.WEB_MERCATOR)){const o=Lz[n][Gi.LON_LAT],a=Lz[Gi.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,OD,0),a(OD,0,PD,0),n===Gi.SPHERICAL_ECEF?MUr(xde*OD[0],xde*OD[1],t):Sae(t),t[12]=PD[0],t[13]=PD[1],t[14]=PD[2],!0)}return!1}function Wpt(i){return i===Gi.SPHERICAL_ECEF||i===Gi.SPHERICAL_MARS_PCPF||i===Gi.SPHERICAL_MOON_PCPF}const xde=Rx(1),OD=gr(),PD=gr();function dbe(i,e=!1){return i<=a3?e?new Array(i).fill(0):new Array(i):new Float64Array(i)}function OUr(i){return(U9(i)?i.length:i.byteLength/8)<=a3?Array.from(i):new Float64Array(i)}function PUr(i,e,t){return Array.isArray(i)?i.slice(e,e+t):i.subarray(e,e+t)}function RUr(i,e){for(let t=0;tc_()?(i[0]=e[0]/r,i[1]=e[1]/r,i[2]=e[2]/r):(i[0]=1,i[1]=0,i[2]=0),t}function vle(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=t[0],l=t[1],u=t[2],c=t[3];return i[0]=r*c+o*a+n*u-s*l,i[1]=n*c+o*l+s*a-r*u,i[2]=s*c+o*u+r*l-n*a,i[3]=o*c-r*a-n*l-s*u,i}function NUr(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l+o*a,i[1]=n*l+s*a,i[2]=s*l-n*a,i[3]=o*l-r*a,i}function $Ur(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l-s*a,i[1]=n*l+o*a,i[2]=s*l+r*a,i[3]=o*l-n*a,i}function BUr(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l+n*a,i[1]=n*l-r*a,i[2]=s*l+o*a,i[3]=o*l-s*a,i}function jUr(i,e){const t=e[0],r=e[1],n=e[2];return i[0]=t,i[1]=r,i[2]=n,i[3]=Math.sqrt(Math.abs(1-t*t-r*r-n*n)),i}function Uge(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3];let l,u,c,h,p,m=t[0],v=t[1],w=t[2],S=t[3];return u=n*m+s*v+o*w+a*S,u<0&&(u=-u,m=-m,v=-v,w=-w,S=-S),1-u>c_()?(l=Math.acos(u),c=Math.sin(l),h=Math.sin((1-r)*l)/c,p=Math.sin(r*l)/c):(h=1-r,p=r),i[0]=h*n+p*m,i[1]=h*s+p*v,i[2]=h*o+p*w,i[3]=h*a+p*S,i}function GUr(i){const e=sae,t=e(),r=e(),n=e(),s=Math.sqrt(1-t),o=Math.sqrt(t);return i[0]=s*Math.sin(2*Math.PI*r),i[1]=s*Math.cos(2*Math.PI*r),i[2]=o*Math.sin(2*Math.PI*n),i[3]=o*Math.cos(2*Math.PI*n),i}function UUr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=t*t+r*r+n*n+s*s,a=o?1/o:0;return i[0]=-t*a,i[1]=-r*a,i[2]=-n*a,i[3]=s*a,i}function PF(i,e){return i[0]=-e[0],i[1]=-e[1],i[2]=-e[2],i[3]=e[3],i}function mjt(i,e){const t=e[0]+e[4]+e[8];let r;if(t>0)r=Math.sqrt(t+1),i[3]=.5*r,r=.5/r,i[0]=(e[5]-e[7])*r,i[1]=(e[6]-e[2])*r,i[2]=(e[1]-e[3])*r;else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);const s=(n+1)%3,o=(n+2)%3;r=Math.sqrt(e[3*n+n]-e[3*s+s]-e[3*o+o]+1),i[n]=.5*r,r=.5/r,i[3]=(e[3*s+o]-e[3*o+s])*r,i[s]=(e[3*s+n]+e[3*n+s])*r,i[o]=(e[3*o+n]+e[3*n+o])*r}return i}function gjt(i,e,t,r){const n=.5*Math.PI/180;e*=n,t*=n,r*=n;const s=Math.sin(e),o=Math.cos(e),a=Math.sin(t),l=Math.cos(t),u=Math.sin(r),c=Math.cos(r);return i[0]=s*l*c-o*a*u,i[1]=o*a*c+s*l*u,i[2]=o*l*u-s*a*c,i[3]=o*l*c+s*a*u,i}function zUr(i){return"quat("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+")"}const VUr=Fne,yjt=k1,HUr=iMt,WUr=vle,qUr=oMt,YUr=cMt,XUr=dVe,vjt=cVe,JUr=vjt,_jt=hVe,KUr=_jt,qXe=uMt,bjt=dMt,ZUr=$2e;function QUr(i,e,t){const r=yE(e,t);return r<-.999999?(qC(HE,ezr,e),eIt(HE)<1e-6&&qC(HE,tzr,e),ly(HE,HE),ER(i,HE,Math.PI),i):r>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(qC(HE,e,t),i[0]=HE[0],i[1]=HE[1],i[2]=HE[2],i[3]=1+r,qXe(i,i))}const HE=gr(),ezr=Do(1,0,0),tzr=Do(0,1,0);function izr(i,e,t,r,n,s){return Uge(qpt,e,n,s),Uge(Ypt,t,r,s),Uge(i,qpt,Ypt,2*s*(1-s)),i}const qpt=Dm(),Ypt=Dm();function rzr(i,e,t,r){const n=nzr;return n[0]=t[0],n[3]=t[1],n[6]=t[2],n[1]=r[0],n[4]=r[1],n[7]=r[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],qXe(i,mjt(i,n))}const nzr=Yd();Object.freeze(Object.defineProperty({__proto__:null,add:HUr,calculateW:jUr,conjugate:PF,copy:VUr,dot:YUr,equals:ZUr,exactEquals:bjt,fromEuler:gjt,fromMat3:mjt,getAxisAngle:eCe,identity:LUr,invert:UUr,len:JUr,length:vjt,lerp:XUr,mul:WUr,multiply:vle,normalize:qXe,random:GUr,rotateX:NUr,rotateY:$Ur,rotateZ:BUr,rotationTo:QUr,scale:qUr,set:yjt,setAxes:rzr,setAxisAngle:ER,slerp:Uge,sqlerp:izr,sqrLen:KUr,squaredLength:_jt,str:zUr},Symbol.toStringTag,{value:"Module"}));function Q3(i=Sjt){return[i[0],i[1],i[2],i[3]]}function zge(i,e,t=Q3()){return Px(t,i),t[3]=e,t}function wjt(i,e=Q3()){const t=wOt(cee,i);return xjt(e,yb(eCe(e,t))),e}function Xpt(i,e,t=Q3()){return ER(cee,i,Hse(i)),ER(Jpt,e,Hse(e)),vle(cee,Jpt,cee),xjt(t,yb(eCe(t,cee)))}function szr(i,e,t,r=Q3()){return zge(XEt,i,Sde),zge(JEt,e,Kpt),zge(zve,t,Zpt),Xpt(Sde,Kpt,Sde),Xpt(Sde,Zpt,r),r}function ozr(i){return i[3]}function Hse(i){return Rx(i[3])}function xjt(i,e){return i[3]=e,i}const Sjt=[0,0,1,0],cee=Dm(),Jpt=Dm();Q3();const Sde=Q3(),Kpt=Q3(),Zpt=Q3();var I8e;let AI=I8e=class extends Ci{constructor(i){super(i),this.translation=gr(),this.rotationAxis=sW(Sjt),this.rotationAngle=0,this.scale=Do(1,1,1)}get rotation(){return zge(this.rotationAxis,this.rotationAngle)}set rotation(i){this.rotationAxis=Ef(i),this.rotationAngle=ozr(i)}get localMatrix(){const i=Pm();return ER(Qpt,this.rotation,Hse(this.rotation)),xOt(i,Qpt,this.translation,this.scale),i}get localMatrixInverse(){return AY(Pm(),this.localMatrix)}applyLocal(i,e){return c0(e,i,this.localMatrix)}applyLocalInverse(i,e){return c0(e,i,this.localMatrixInverse)}equals(i){return this===i||i!=null&&TOt(this.localMatrix,i.localMatrix)}clone(){const i={translation:Ef(this.translation),rotationAxis:Ef(this.rotationAxis),rotationAngle:this.rotationAngle,scale:Ef(this.scale)};return new I8e(i)}};x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"translation",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"rotationAxis",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],AI.prototype,"rotationAngle",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"scale",void 0),x([D()],AI.prototype,"rotation",null),x([D()],AI.prototype,"localMatrix",null),x([D()],AI.prototype,"localMatrixInverse",null),AI=I8e=x([Qe("esri.geometry.support.MeshTransform")],AI);const Qpt=Dm(),Tk=AI;function Tjt(i,e){return i.isGeographic||i.isWebMercator&&(e??!0)}function Cjt(i,e){switch(i.type){case"georeferenced":return e.isGeographic;case"local":return e.isGeographic||e.isWebMercator}}function YXe(i,e,t,r){if(r!==void 0){UF(di.getLogger(i),"option: geographic",{replacement:"use mesh vertexSpace and spatial reference to control how operations are performed",version:"4.29",warnOnce:!0});const n=e.type==="local";if(!VS(e)||r===n)return t.isGeographic||t.isWebMercator&&r;di.getLogger(i).warnOnce(`Specifying the 'geographic' parameter (${r}) for a Mesh vertex space of type "${e.type}" is not supported. This parameter will be ignored.`)}return Cjt(e,t)}const tCe=()=>di.getLogger("esri.geometry.support.meshUtils.normalProjection");function XXe(i,e,t,r,n){return rCe(r)?(iCe(WP.TO_PCPF,Om.fromTypedArray(i),zS.fromTypedArray(e),zS.fromTypedArray(t),r,Om.fromTypedArray(n)),n):(tCe().error("Cannot convert spatial reference to PCPF"),n)}function JXe(i,e,t,r,n){return rCe(r)?(iCe(WP.FROM_PCPF,Om.fromTypedArray(i),zS.fromTypedArray(e),zS.fromTypedArray(t),r,Om.fromTypedArray(n)),n):(tCe().error("Cannot convert to spatial reference from PCPF"),n)}function KXe(i,e,t){return sy(i,e,0,t,Bx(e),0,i.length/3),t}function ZXe(i,e,t){return sy(i,Bx(t),0,e,t,0,i.length/3),e}function azr(i,e,t){return y3(om,t),Z3(e,i,om),bWe(om)||gle(e,e),e}function lzr(i,e,t){if(y3(om,t),Z3(e,i,om,4),bWe(om)||gle(e,e,4),i!==e)for(let r=3;rnew Uint32Array(n))):this._createIndexAllThread(r,t)}_createIndexAllThread(e,t){const r=new Array(t.length/9);let n=0;for(let s=0;s!r.faces)?{position:t}:{position:t,components:e.components.map(r=>r.faces)}}_createPooledRBush(){return new sbe(9,yi("esri-csp-restrictions")?e=>e:[".minX",".minY",".maxX",".maxY"])}};function eft(i,e,t,r){return{minX:Math.min(i[e],i[t],i[r]),maxX:Math.max(i[e],i[t],i[r]),minY:Math.min(i[e+1],i[t+1],i[r+1]),maxY:Math.max(i[e+1],i[t+1],i[r+1]),p0:[i[e],i[e+1],i[e+2]],p1:[i[t],i[t+1],i[t+2]],p2:[i[r],i[r+1],i[r+2]]}}const bzr=Object.freeze(Object.defineProperty({__proto__:null,default:_zr},Symbol.toStringTag,{value:"Module"}));function tft(i=!1,e){if(i){const{elevationInfo:t,alignPointsInFeatures:r}=e;return new Szr(t,r)}return new wzr}let wzr=class{async alignCandidates(e,t,r){return e}notifyElevationSourceChange(){}};const xzr=1024;let Szr=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new d3(xzr),this._cacheVersion=0}async alignCandidates(e,t,r){const n=this._elevationInfo;return n==null||n.mode!=="absolute-height"||n.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,r):(this._alignAbsoluteElevationCandidates(e,t,n),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,r){const{offset:n,unit:s}=r;if(n==null)return;const o=WF(t),a=n*(Isr(s??"meters")/o);for(const l of e)switch(l.type){case"edge":l.start.z+=a,l.end.z+=a;continue;case"vertex":l.target.z+=a;continue}}async _alignComputedElevationCandidates(e,t,r){const n=new Map;for(const p of e)qh(n,p.objectId,Czr).push(p);const[s,o,a]=this._prepareQuery(n,t),l=await this._alignPointsInFeatures(s,r);if(hn(r),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,r);this._applyCacheAndResponse(s,l,o);const{drapedObjectIds:u,failedObjectIds:c}=l,h=[];for(const p of e){const{objectId:m}=p;u.has(m)&&p.type==="edge"&&(p.draped=!0),c.has(m)||h.push(p)}return h}_prepareQuery(e,t){const r=[],n=[];for(const[s,o]of e){const a=[];for(const l of o)this._addToQueriesOrCachedResult(s,l.target,a,n),l.type==="edge"&&(this._addToQueriesOrCachedResult(s,l.start,a,n),this._addToQueriesOrCachedResult(s,l.end,a,n));a.length!==0&&r.push({objectId:s,points:a})}return[{spatialReference:t.toJSON(),pointsInFeatures:r},n,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,r,n){const s=ift(e,t),o=this._alignmentsCache.get(s);o==null?r.push(t):n.push(new Tzr(t,o))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:r,failedObjectIds:n},s){for(const l of s)l.apply();let o=0;const a=this._alignmentsCache;for(const{objectId:l,points:u}of e.pointsInFeatures){if(n.has(l)){o+=u.length;continue}const c=!r.has(l);for(const h of u){const p=ift(l,h),m=t[o++];h.z=m,c&&a.put(p,m,1)}}}},Tzr=class{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}};function ift(i,{x:e,y:t,z:r,spatialReference:n}){return`${i}-${e}-${t}-${r??0}}-wkid:${n?.wkid}`}function Czr(){return[]}let Ezr=class{filter(e,t){return t}notifyElevationSourceChange(){}},Izr=class{filter(e,t){const{point:r,distance:n}=e,{z:s}=r;if(s==null||t.length===0)return t;const o=Rzr(n),a=this._updateCandidatesTo3D(t,r,o).filter(Azr);return a.sort(Dzr),a}_updateCandidatesTo3D(e,t,r){for(const n of e)switch(n.type){case"edge":Mzr(n,t,r);continue;case"vertex":Pzr(n,t,r);continue}return e}};function Azr(i){return i.distance<=1}function rft(i=!1){return i?new Izr:new Ezr}function Mzr(i,e,{x:t,y:r,z:n}){const{start:s,end:o,target:a}=i;i.draped||Ozr(a,e,s,o);const l=(e.x-a.x)/t,u=(e.y-a.y)/r,c=(e.z-a.z)/n;i.distance=Math.sqrt(l*l+u*u+c*c)}function Ozr(i,e,t,r){const n=r.x-t.x,s=r.y-t.y,o=r.z-t.z,a=n*n+s*s+o*o,l=(e.x-t.x)*n+(e.y-t.y)*s+o*(e.z-t.z),u=Math.min(1,Math.max(0,l/a)),c=t.x+n*u,h=t.y+s*u,p=t.z+o*u;i.x=c,i.y=h,i.z=p}function Pzr(i,e,{x:t,y:r,z:n}){const{target:s}=i,o=(e.x-s.x)/t,a=(e.y-s.y)/r,l=(e.z-s.z)/n,u=Math.sqrt(o*o+a*a+l*l);i.distance=u}function Rzr(i){return typeof i=="number"?{x:i,y:i,z:i}:i}function Dzr(i,e){return i.distance-e.distance}function nft(i=!1,e){return i?new Lzr(e):new Fzr}let Fzr=class{async fetch(){return[]}notifySymbologyChange(){}};const kzr=1024;let Lzr=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new d3(kzr),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const r=[],n=[],s=this._candidatesCache;for(const h of e){const p=sft(h),m=s.get(p);if(m)for(const v of m)n.push(li(v));else r.push(h),s.put(p,[],1)}if(r.length===0)return n;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(r,t);if(hn(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:c}=a;for(let h=0;he.callback(t)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};x([D()],Vge.prototype,"updating",void 0),Vge=x([Qe("esri.core.AsyncSequence")],Vge);let Nzr=class{constructor(e,t){this.data=e,this.resolution=t,this.state={type:vu.CREATED},this.alive=!0}process(e){switch(this.state.type){case vu.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case vu.FETCH_COUNT:break;case vu.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case vu.FETCH_FEATURES:break;case vu.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case vu.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case vu.CREATED:case vu.FETCH_COUNT:return 0;case vu.FETCHED_COUNT:return this.state.featureCount;case vu.FETCH_FEATURES:return this.state.previous.featureCount;case vu.FETCHED_FEATURES:return this.state.features.length;case vu.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case vu.CREATED:return"created";case vu.FETCH_COUNT:return"fetch-count";case vu.FETCHED_COUNT:return"fetched-count";case vu.FETCH_FEATURES:return"fetch-features";case vu.FETCHED_FEATURES:return"fetched-features";case vu.DONE:return"done"}}_gotoFetchCount(e,t){return{type:vu.FETCH_COUNT,previous:e,task:pE(async r=>{const n=await s5e(t.fetchCount(this,r));this.state.type===vu.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,n.ok?n.value:1/0))})}}_gotoFetchedCount(e,t){return{type:vu.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:vu.FETCH_FEATURES,previous:e,task:pE(async r=>{const n=await s5e(t.fetchFeatures(this,e.featureCount,r));this.state.type===vu.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,n.ok?n.value:[]))})}}_gotoFetchedFeatures(e,t){return{type:vu.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:vu.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:vu.CREATED},e.type){case vu.CREATED:case vu.FETCHED_COUNT:case vu.FETCHED_FEATURES:case vu.DONE:break;case vu.FETCH_COUNT:case vu.FETCH_FEATURES:e.task.abort()}}intersects(e){return e==null||!this.data.extent||(tB(e,oft),aae(this.data.extent,oft))}};var vu;(function(i){i[i.CREATED=0]="CREATED",i[i.FETCH_COUNT=1]="FETCH_COUNT",i[i.FETCHED_COUNT=2]="FETCHED_COUNT",i[i.FETCH_FEATURES=3]="FETCH_FEATURES",i[i.FETCHED_FEATURES=4]="FETCHED_FEATURES",i[i.DONE=5]="DONE"})(vu||(vu={}));const oft=Wo();let Rd=class extends un{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),r=bve(e,this._mandatoryOutFields);dHi(r,t)||(this._set("outFields",r),V4e(r,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),r=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(r)&&this._set("filter",r)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new Mb,this._pendingEdits=new Vge,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{UB(e,t,({id:r},{id:n})=>r===n)||this._process()},Kl),this.addHandles(v0(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}applyEdits(e){this._pendingEdits.push(e,async t=>{if(t.addedFeatures.length===0&&t.updatedFeatures.length===0&&t.deletedFeatures.length===0)return;for(const[,n]of this._pendingTiles)n.reset();const r={...t,deletedFeatures:t.deletedFeatures.map(({objectId:n,globalId:s})=>n&&n!==-1?n:this._lookupObjectIdByGlobalId(s))};await this._updatingHandles.addPromise(this.store.processEdits(r,(n,s)=>this._queryFeaturesById(n,s),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Fx(this.url))return;const e=pE(async t=>{try{const r=await hDt(this.url,new Kn({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=hr.fromJSON(r.data?.extent)}catch(r){_a(r),di.getLogger(this).warn("Failed to fetch data extent",r)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(wa(()=>e.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:r}of e.missingTiles){const n=this._pendingTiles.get(t.id);n?(n.resolution=r,n.alive=!0):this._createPendingTile(t,r)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const r=this.tilesOfInterest[t],n=this.store.process(r,(s,o)=>this._verifyTileComplexity(s,o),this.outFields);e==null?e=n:e.prepend(n)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,r)=>this._fetchCount(t,r),fetchFeatures:(t,r,n)=>this._fetchFeatures(t,r,n),finish:(t,r)=>this._finishPendingTile(t,r),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{e===s.attributes[t]&&(n=s.objectId??s.attributes[r])}),n==null)throw new Error(`Expected to find a feature with globalId ${e}`);return n}_queryFeaturesById(e,t){const r=this._createFeaturesQuery();return r.objectIds=e,this._queryFeatures(r,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:r}=this,{data:n}=await uDt(this.url,e,new bhr({sourceSpatialReference:r}),{query:this._configuration.customParameters,timeout:qOe,signal:t});return Vdr(n)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:r}=this,{data:n}=await OW(this.url,e,r,{query:this._configuration.customParameters,timeout:qOe,signal:t});return HHe(n,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),r=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,n=bve(mCt(this.outFields,r??new Set),this._mandatoryOutFields);return t.outFields=Array.from(n),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new Kn({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&e!=null?iB(e.data.extent,this.tileInfo.spatialReference):void 0}),r=this._configuration.filter;return r!=null&&(t.where=r.where,t.gdbVersion=r.gdbVersion,t.timeExtent=r.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,r){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:n,supportsCacheHint:s,tileMaxRecordCount:o,maxRecordCount:a,supportsResultType:l}=this.capabilities.query,u=n?Kn.MAX_MAX_RECORD_COUNT_FACTOR:1,c=u*((l||s)&&o?o:a||$zr);return e.start=t,n?(e.maxRecordCountFactor=Math.min(u,Math.ceil(r/c)),e.num=Math.min(r,e.maxRecordCountFactor*c)):e.num=Math.min(r,c),!0}};x([D({constructOnly:!0})],Rd.prototype,"url",void 0),x([D({constructOnly:!0})],Rd.prototype,"objectIdField",void 0),x([D({constructOnly:!0})],Rd.prototype,"globalIdField",void 0),x([D({constructOnly:!0})],Rd.prototype,"capabilities",void 0),x([D({constructOnly:!0})],Rd.prototype,"sourceSpatialReference",void 0),x([D({constructOnly:!0})],Rd.prototype,"spatialReference",void 0),x([D({constructOnly:!0})],Rd.prototype,"store",void 0),x([D({readOnly:!0})],Rd.prototype,"_minimumVerticesPerFeature",null),x([D()],Rd.prototype,"_mandatoryOutFields",null),x([D()],Rd.prototype,"outFields",null),x([D()],Rd.prototype,"suspended",void 0),x([D()],Rd.prototype,"filter",null),x([D()],Rd.prototype,"customParameters",null),x([D({readOnly:!0})],Rd.prototype,"_configuration",null),x([D()],Rd.prototype,"tileInfo",null),x([D()],Rd.prototype,"tileSize",null),x([D()],Rd.prototype,"tilesOfInterest",void 0),x([D({readOnly:!0})],Rd.prototype,"updating",null),x([D({readOnly:!0})],Rd.prototype,"updatingExcludingEdits",null),x([D({readOnly:!0})],Rd.prototype,"availability",void 0),x([D()],Rd.prototype,"hasZ",null),Rd=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],Rd);const $zr=2e3,qOe=6e5,Bzr=1e6,jzr=25,Gzr=1;let Uzr=class{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(t!=null&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[r,n]of this._store){if(this._byteSize<=e)break;this.delete(r),t(n)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}},y$=class extends un{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*RW.MEGABYTES,this._tileBounds=new CXe,this._tiles=new Uzr,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Wo()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const r=this.featureStore.upsertMany(t),n=r.map(s=>new Set(Object.keys(s.attributes))).reduce((s,o)=>z4e(s,o),new Set(Object.keys(r[0]?.attributes??[])));this._addTileStorage(e,new Set(r.map(s=>s.objectId)),zzr(r),n),this._tiles.applyByteSizeLimit(this.maximumByteSize,s=>this._removeTileStorage(s))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,r){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,r)}_addTileStorage(e,t,r,n){const s=e.id;this._tiles.set(s,new Wzr(e,t,r,n)),this._tileBounds.set(s,e.extent),this._tileFeatureCounts.set(s,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const n of e.objectIds)this._unreferenceFeature(n)===G6.REMOVED&&t.push(n);this.featureStore.removeManyById(t);const r=e.data.id;this._tiles.delete(r),this._tileBounds.delete(r)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const r of e)t.objectIds.delete(r);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,r){const n=(await t(e,r)).features,{hasZ:s,hasM:o}=this.featureStore;for(const a of n){const l=O1e(this._tmpBoundingRect,a.geometry,s,o);l!=null&&this._tileBounds.forEachInBounds(l,u=>{const c=this._tiles.get(u);this.featureStore.add(a);const h=a.objectId;c.objectIds.has(h)||(c.objectIds.add(h),this._referenceFeature(h),this._tileFeatureCounts.set(c.data.id,c.objectIds.size))})}}process(e,t=()=>!0,r){if(this.tileInfo==null||!e.extent||this.extent!=null&&!aae(tB(this.extent,this._tmpBoundingRect),e.extent))return new M8e(e);const n=this.getAttributesForTile(e.id);if(V4e(r,n))return new M8e(e);const s=this._createTileTree(e,this.tileInfo);return this._simplify(s,t,null,0,1),this._collectMissingTiles(e,s,this.tileInfo,r)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,r,n){const s=this._tileFeatureCounts.get(e.id);if(s!=null)return s;const o=await PHe(t,r,n);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const r=new aft(e.level,e.row,e.col);return t.updateTileInfo(r,fu.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,n=>{const s=this._tiles.get(n)?.data;s&&this._tilesAreRelated(e,s)&&this._populateChildren(r,s,t,this._tileFeatureCounts.get(s.id)||0)}),r}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const r=e.level>s,a=t.col>>s,l=e.row<<1,u=a-(e.col<<1)+(o-l<<1),c=e.children[u];if(c!=null)this._populateChildren(c,t,r,n);else{const h=new aft(e.level+1,o,a);r.updateTileInfo(h,fu.ExtrapolateOptions.POWER_OF_TWO),e.children[u]=h,this._populateChildren(h,t,r,n)}}_simplify(e,t,r,n,s){const o=s*s;if(e.isLeaf)return t(this.getFeatureCount(e),s)?0:(this._remove(e),r!=null&&(r.children[n]=null),o);const a=s/2,l=a*a;let u=0;for(let c=0;c{const o=this._tiles.get(s.id);if(o){r=r?z4e(r,o.attributeKeys):new Set(o.attributeKeys),n+=o.byteSize;for(const a of o.objectIds)t.has(a)||(t.add(a),this._referenceFeature(a));this._remove(s)}}),this._addTileStorage(e,t,n,r??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const r of e.children)r!=null&&(r.isLeaf?t(r):this._forEachLeaf(r,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&l),a):this._collectMissingTilesRecurse(u,t,a,n)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?G6.ADDED:G6.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),G6.REMOVED):(t>0&&this._refCounts.set(e,t),G6.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(e=>`${e.data.id}:[${Array.from(e.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(e=>`${e}:${this._refCounts.get(e)}`)}}};function zzr(i){return i.reduce((e,t)=>e+Vzr(t),0)}function Vzr(i){return 32+Hzr(i.geometry)+dVi(i.attributes)}function Hzr(i){if(i==null)return 0;const e=R4e(i.lengths,4);return 32+R4e(i.coords,8)+e}x([D({constructOnly:!0})],y$.prototype,"featureStore",void 0),x([D()],y$.prototype,"tileInfo",void 0),x([D()],y$.prototype,"extent",void 0),x([D()],y$.prototype,"maximumByteSize",void 0),y$=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],y$);let Wzr=class{constructor(e,t,r,n){this.data=e,this.objectIds=t,this.byteSize=r,this.attributeKeys=n}},aft=class{constructor(e,t,r){this.level=e,this.row=t,this.col=r,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}},M8e=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=pIt(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},qzr=class{constructor(e,t,r){this._tileInfo=e,this._extent=null,this.info=new M8e(t),r!=null&&(this._extent=tB(r))}addMissing(e,t,r,n){const s=new jY(null,e,t,r);this._tileInfo.updateTileInfo(s,fu.ExtrapolateOptions.POWER_OF_TWO),s.extent==null||this._extent!=null&&!aae(this._extent,s.extent)||(this.info.missingTiles.push({data:s,resolution:n}),this.info.coveredArea-=pIt(s.extent))}};const Yzr=.18751;var G6;(function(i){i[i.ADDED=0]="ADDED",i[i.REMOVED=1]="REMOVED",i[i.UNCHANGED=2]="UNCHANGED"})(G6||(G6={}));let bU=class extends rd.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ac(),this._elevationAligner=tft(),this._elevationFilter=rft(),this._symbologyCandidatesFetcher=nft(),this._updatingHandles=new Mb,this._editsUpdatingHandles=new Mb,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const r={query:e},n=await this.remoteClient.invoke("alignElevation",r,{signal:t});return hn(t),n},this._getSymbologyCandidates=async(e,t)=>{const r={candidates:e,spatialReference:this._spatialReference.toJSON()},n=await this.remoteClient.invoke("getSymbologyCandidates",r,{signal:t});return hn(t),n}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:r,timeInfo:n,fieldsIndex:s}=e.serviceInfo,{hasZ:o}=e,a=Xi.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new rX({...e.serviceInfo,hasZ:o,hasM:!1}),this._queryEngine=new lL({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:s,hasZ:o,hasM:!1,objectIdField:r,timeInfo:n}),this._featureFetcher=new Rd({store:new y$({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:Xi.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l=e.configuration.viewType==="3d";return this._elevationAligner=tft(l,{elevationInfo:e.elevationInfo!=null?ZB.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=rft(l),this.addHandles([Ki(()=>this._featureFetcher.availability,u=>this.emit("notify-availability",{availability:u}),Kl),Ki(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),vT}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.suspended=e,vT}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.outFields=new Set(e??[]),vT}async fetchCandidates(e,t){await this._whenSetup.promise,hn(t);const r=Jzr(e),n=t?.signal,s=await this._queryEngine.executeQueryForSnapping(r,n);hn(n);const o=await this._elevationAligner.alignCandidates(s.candidates,Xi.fromJSON(e.point.spatialReference)??Xi.WGS84,n);hn(n);const a=await this._symbologyCandidatesFetcher.fetch(o,n);hn(n);const l=a.length===0?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(r,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?fu.fromJSON(e.tileInfo):null,vT}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.refresh(),vT}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),await fR(()=>!this.updatingExcludingEdits,t),hn(t),vT}async getDebugInfo(e,t){return hn(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),hn(t);const r=ac();return this._pendingApplyEdits.set(e.id,r),this._featureFetcher.applyEdits(r.promise),this._editsUpdatingHandles.addPromise(r.promise),vT}async endApplyEdits(e,t){const r=this._pendingApplyEdits.get(e.id);return r&&r.resolve(e.edits),hn(t),vT}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),vT}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),vT}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=nft(e,this._getSymbologyCandidates),vT}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?Kn.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};x([D({readOnly:!0})],bU.prototype,"updating",null),x([D({readOnly:!0})],bU.prototype,"updatingExcludingEdits",null),x([D()],bU.prototype,"_isInitializing",void 0),bU=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],bU);const Xzr=bU;function Jzr(i){if(!i.filter)return{...i,query:{where:"1=1"}};const{distance:e,units:t,spatialRel:r,where:n,timeExtent:s,objectIds:o}=i.filter,a={geometry:i.filter.geometry?Ro(i.filter.geometry):void 0,distance:e,units:t,spatialRel:r,timeExtent:s,objectIds:o,where:n??"1=1"};return{...i,query:a}}const vT={result:{}},Kzr=Object.freeze(Object.defineProperty({__proto__:null,default:Xzr},Symbol.toStringTag,{value:"Module"})),Zzr={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function pbe(i){return Zzr[i]}function*Rjt(i){switch(i.type){case"Feature":yield i;break;case"FeatureCollection":for(const e of i.features)e&&(yield e)}}function*Qzr(i){if(i)switch(i.type){case"Point":yield i.coordinates;break;case"LineString":case"MultiPoint":yield*i.coordinates;break;case"MultiLineString":case"Polygon":for(const e of i.coordinates)yield*e;break;case"MultiPolygon":for(const e of i.coordinates)for(const t of e)yield*t}}function*eVr(i,e={}){const{geometryType:t,objectIdField:r}=e;for(const n of i){const{geometry:s,properties:o,id:a}=n;if(s&&pbe(s.type)!==t)continue;const l=o||{};let u;r&&(u=l[r],a==null||u||(l[r]=u=a)),yield new ry(s?nVr(new $o,s,e):null,l,null,u??void 0)}}function tVr(i){for(const e of i)if(e.length>2)return!0;return!1}function iVr(i){return!Djt(i)}function rVr(i){return Djt(i)}function Djt(i){let e=0;for(let t=0;t=0;r--)oJe(i,e[r],t);i.lengths.push(e.length)}function oJe(i,e,t){const[r,n,s]=e;i.coords.push(r,n),t.hasZ&&i.coords.push(s||0)}function hVr(i){switch(typeof i){case"string":return bjr(i)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function aJe(i,e=4326){if(!i)throw new qe("geojson-layer:empty","GeoJSON data is empty");if(i.type!=="Feature"&&i.type!=="FeatureCollection")throw new qe("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:i});const{crs:t}=i;if(!t)return;const r=typeof t=="string"?t:t.type==="name"?t.properties.name:t.type==="EPSG"?t.properties.code:null,n=fE({wkid:e})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${e})$`,"i");if(!r||!n.test(r))throw new qe("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function $jt(i,e={}){const t=[],r=new Set,n=new Set;let s,o=!1,a=null,l=!1,{geometryType:u=null}=e,c=!1;for(const p of Rjt(i)){const{geometry:m,properties:v,id:w}=p;if((!m||(u||(u=pbe(m.type)),pbe(m.type)===u))&&(o||(o=tVr(Qzr(m))),l||(l=w!=null,l&&(s=typeof w,v&&(a=Object.keys(v).filter(S=>v[S]===w)))),v&&a&&l&&w!=null&&(a.length>1?a=a.filter(S=>v[S]===w):a.length===1&&(a=v[a[0]]===w?a:[])),!c&&v)){let S=!0;for(const I in v){if(r.has(I))continue;const R=v[I];if(R==null){S=!1,n.add(I);continue}const L=hVr(R);if(L==="unknown"){n.add(I);continue}n.delete(I),r.add(I);const k=fW(I);k&&t.push({name:k,alias:I,type:L})}c=S}}const h=fW(a?.length===1&&a[0]||null)??void 0;if(h){for(const p of t)if(p.name===h&&wY(p)){p.type="esriFieldTypeOID";break}}return{fields:t,geometryType:u,hasZ:o,objectIdFieldName:h,objectIdFieldType:s,unknownFields:Array.from(n)}}function lJe(i,e){return Array.from(eVr(Rjt(i),e))}let dVr=class{constructor(){this.code=null,this.description=null}},pVr=class{constructor(e){this.error=new dVr,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}};function DC(i){return new pVr(i)}let fVr=class{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}};function cH(i){return new fVr(i)}const YOe=new Set;function RF(i,e,t,r=!1){YOe.clear();for(const n in t){const s=i.get(n);if(!s)continue;const o=mVr(s,t[n]);if(YOe.add(s.name),s&&(r||s.editable)){const a=qAt(s,o);if(a)return DC(pQi(a,s,o));e[s.name]=o}}for(const n of i?.requiredFields??[])if(!YOe.has(n.name))return DC(`missing required field "${n.name}"`);return null}function mVr(i,e){let t=e;return wY(i)&&typeof e=="string"?t=parseFloat(e):xie(i)&&e!=null&&typeof e!="string"?t=String(e):mW(i)&&typeof e=="string"&&(t=a7t(e)),oQi(t)}let vre;function fbe(i,e){if(!i||!Cm(e))return i;if("rings"in i||"paths"in i){if(vre==null)throw new TypeError("geometry engine not loaded");return vre.simplify(e,i)}return i}async function gVr(){return vre==null&&(vre=await Promise.resolve().then(()=>iX)),vre}async function Bjt(i,e){!Cm(i)||e!=="esriGeometryPolygon"&&e!=="esriGeometryPolyline"||await gVr()}const yVr={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};let vVr=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const r=[],[n]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),s=$jt(n,{geometryType:e.geometryType}),o=e.fields||s.fields||[],a=e.hasZ!=null?e.hasZ:s.hasZ,l=s.geometryType;let u=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const c=e.spatialReference||Yp;let h=e.timeInfo;o===s.fields&&s.unknownFields.length>0&&r.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});const p=new Cd(o);let m=p.get(u);m?(m.type!=="esriFieldTypeString"&&(m.type="esriFieldTypeOID"),m.editable=!1,m.nullable=!1,u=m.name):(m={alias:u,name:u,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(m));const v={};for(const V of o){if(V.name==null&&(V.name=V.alias),V.alias==null&&(V.alias=V.name),!V.name)throw new qe("geojson-layer:invalid-field-name","field name is missing",{field:V});if(!wW.jsonValues.includes(V.type))throw new qe("geojson-layer:invalid-field-type",`invalid type for field "${V.name}"`,{field:V});if(V.name!==m.name){const Y=w2e(V);Y!==void 0&&(v[V.name]=Y)}V.length==null&&(V.length=s8(V))}if(h){if(h.startTimeField){const V=p.get(h.startTimeField);V?(h.startTimeField=V.name,V.type="esriFieldTypeDate"):h.startTimeField=null}if(h.endTimeField){const V=p.get(h.endTimeField);V?(h.endTimeField=V.name,V.type="esriFieldTypeDate"):h.endTimeField=null}if(h.trackIdField){const V=p.get(h.trackIdField);V?h.trackIdField=V.name:(h.trackIdField=null,r.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:h}}))}h.startTimeField||h.endTimeField||(r.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:h}}),h=null)}const w=l?KA(l):void 0,S=p.dateFields.length?{timeZoneIANA:y0}:null,I={warnings:r,featureErrors:[],layerDefinition:{...yVr,drawingInfo:w??void 0,templates:G7t(v),extent:void 0,geometryType:l,objectIdField:u,fields:o,hasZ:!!a,timeInfo:h,dateFieldsTimeReference:S}};this._queryEngine=new lL({fieldsIndex:Cd.fromLayerJSON({fields:o,timeInfo:h,dateFieldsTimeReference:S}),geometryType:l,hasM:!1,hasZ:a,objectIdField:u,spatialReference:c,timeInfo:h,featureStore:new rX({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0});const R=this._queryEngine.fieldsIndex.requiredFields.indexOf(m);R>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(R,1),this._createDefaultAttributes=OXe(v,u);const L=await this._createFeatures(n);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,L);const k=this._normalizeFeatures(L,I.featureErrors);this._queryEngine.featureStore.addMany(k);const{fullExtent:B,timeExtent:$}=await this._queryEngine.fetchRecomputedExtents();if(I.layerDefinition.extent=B,$){const{start:V,end:Y}=$;I.layerDefinition.timeInfo.timeExtent=[V,Y]}return I}async applyEdits(e){const{spatialReference:t,geometryType:r}=this._queryEngine;return await Promise.all([Bjt(t,r),Gv(e.adds,t),Gv(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=pE(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,n);const s=this._normalizeFeatures(n);s&&this._queryEngine.featureStore.addMany(s)},n=>{this._queryEngine.featureStore.clear(),mo(n)||di.getLogger("esri.layers.GeoJSONLayer").error(new qe("geojson-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:r}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:r,objectIdField:n}=this._queryEngine,s=lJe(e,{geometryType:t,hasZ:r,objectIdField:n});if(!Ya(this._queryEngine.spatialReference,Yp))for(const o of s)o.geometry!=null&&(o.geometry=Z2(Sf(KC(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),Yp,this._queryEngine.spatialReference)));return s}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:r}=this._loadOptions,n=(await zi(t,{responseType:"json",query:{...r},signal:e})).data;return aJe(n),n}_normalizeFeatures(e,t){const{objectIdField:r,fieldsIndex:n}=this._queryEngine,s=[];for(const o of e){const a=this._createDefaultAttributes(),l=RF(n,a,o.attributes,!0);l?t?.push(l):(this._assignObjectId(a,o.attributes,!0),o.attributes=a,o.objectId=a[r],s.push(o))}return s}async _applyEdits(e){const{adds:t,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(s,t),r?.length&&this._applyUpdateEdits(s,r),n?.length){for(const l of n)s.deleteResults.push(cH(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:u,fieldsIndex:c}=this._queryEngine,h=[];for(const p of t){if(p.geometry&&n!==ah(p.geometry)){r.push(DC("Incorrect geometry type."));continue}const m=this._createDefaultAttributes(),v=RF(c,m,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(m,p.attributes),p.attributes=m,p.uid!=null){const w=p.attributes[a];e.uidToObjectId[p.uid]=w}if(p.geometry!=null){const w=p.geometry.spatialReference??l;p.geometry=Sf(fbe(p.geometry,w),w,l)}h.push(p),r.push(cH(p.attributes[a]))}}u.addMany(PW([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine;for(const c of t){const{attributes:h,geometry:p}=c,m=h?.[o];if(m==null){e.push(DC(`Identifier field ${o} missing`));continue}if(!l.has(m)){e.push(DC(`Feature with object id ${m} missing`));continue}const v=hSe(l.getFeature(m),r,s,n);if(p!=null){if(r!==ah(p)){e.push(DC("Incorrect geometry type."));continue}const w=p.spatialReference??a;v.geometry=Sf(fbe(p,w),w,a)}if(h){const w=RF(u,v.attributes,h);if(w){e.push(w);continue}}l.add(ODt(v,r,s,n,o)),e.push(cH(m))}}_createObjectIdGenerator(e,t){const r=e.fieldsIndex.get(e.objectIdField);if(r.type==="esriFieldTypeString")return()=>r.name+"-"+Date.now().toString(16);let n=Number.NEGATIVE_INFINITY;for(const s of t)s.objectId&&(n=Math.max(n,s.objectId));return n=Math.max(0,n)+1,()=>n++}_assignObjectId(e,t,r=!1){const n=this._queryEngine.objectIdField;e[n]=r&&n in t?t[n]:this._objectIdGenerator()}async _checkProjection(e){try{await Gv(Yp,e)}catch{throw new qe("geojson-layer","Projection not supported")}}};const _Vr=Object.freeze(Object.defineProperty({__proto__:null,default:vVr},Symbol.toStringTag,{value:"Module"}));var Hge={};Hge.defaultNoDataValue=Rrt(-1/0),Hge.decode=function(i,e){var t=(e=e||{}).encodedMaskData||e.encodedMaskData===null,r=SVr(i,e.inputOffset||0,t),n=e.noDataValue!=null?Rrt(e.noDataValue):Hge.defaultNoDataValue,s=bVr(r,e.pixelType||Float32Array,e.encodedMaskData,n,e.returnMask),o={width:r.width,height:r.height,pixelData:s.resultPixels,minValue:r.pixels.minValue,maxValue:r.pixels.maxValue,noDataValue:n};return s.resultMask&&(o.maskData=s.resultMask),e.returnEncodedMask&&r.mask&&(o.encodedMaskData=r.mask.bitset?r.mask.bitset:null),e.returnFileInfo&&(o.fileInfo=wVr(r,n),e.computeUsedBitDepths&&(o.fileInfo.bitDepths=xVr(r))),o};var bVr=function(i,e,t,r,n){var s,o,a=0,l=i.pixels.numBlocksX,u=i.pixels.numBlocksY,c=Math.floor(i.width/l),h=Math.floor(i.height/u),p=2*i.maxZError;t=t||(i.mask?i.mask.bitset:null),s=new e(i.width*i.height),n&&t&&(o=new Uint8Array(i.width*i.height));for(var m,v,w=new Float32Array(c*h),S=0;S<=u;S++){var I=S!==u?h:i.height%u;if(I!==0)for(var R=0;R<=l;R++){var L=R!==l?c:i.width%l;if(L!==0){var k,B,$,V,Y=S*i.width*h+R*c,K=i.width-L,Q=i.pixels.blocks[a];if(Q.encoding<2?(Q.encoding===0?k=Q.rawData:(TVr(Q.stuffedData,Q.bitsPerPixel,Q.numValidPixels,Q.offset,p,w,i.pixels.maxValue),k=w),B=0):$=Q.encoding===2?0:Q.offset,t)for(v=0;v>3],V<<=7&Y),m=0;m>3]),128&V?(o&&(o[Y]=1),s[Y++]=Q.encoding<2?k[B++]:$):(o&&(o[Y]=0),s[Y++]=r),V<<=1;Y+=K}else if(Q.encoding<2)for(v=0;v0){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),a=(s=new DataView(i,e,r.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(a>0)for(;a--;)o[u++]=s.getUint8(l++);else{var c=s.getUint8(l++);for(a=-a;a--;)o[u++]=c}a=s.getInt16(l,!0),l+=2}while(l0?1:0),v=p+(r.height%p>0?1:0);r.pixels.blocks=new Array(m*v);for(var w=1e9,S=0,I=0;I3)throw"Invalid block encoding ("+B.encoding+")";if(B.encoding!==2){if($!==0&&$!==2){if($>>=6,B.offsetType=$,$===2)B.offset=s.getInt8(1),L++;else if($===1)B.offset=s.getInt16(1,!0),L+=2;else{if($!==0)throw"Invalid block offset type";B.offset=s.getFloat32(1,!0),L+=4}if(w=Math.min(B.offset,w),B.encoding===1)if($=s.getUint8(L),L++,B.bitsPerPixel=63&$,$>>=6,B.numValidPixelsType=$,$===2)B.numValidPixels=s.getUint8(L),L++;else if($===1)B.numValidPixels=s.getUint16(L,!0),L+=2;else{if($!==0)throw"Invalid valid pixel count type";B.numValidPixels=s.getUint32(L,!0),L+=4}}var V;if(e+=L,B.encoding!=3){if(B.encoding===0){var Y=(r.pixels.numBytes-1)/4;if(Y!==Math.floor(Y))throw"uncompressed block has invalid length";V=new ArrayBuffer(4*Y),new Uint8Array(V).set(new Uint8Array(i,e,4*Y));for(var K=new Float32Array(V),Q=0;Q=e)l=u>>>p-e&c,p-=e;else{var w=e-p;l=(u&c)<>>(p=32-w)}s[a]=l{const c=u.type==="esriFieldTypeOID",h=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return l=u,c||h})&&(a=l.name)}return{geometryType:s,spatialReference:o,objectIdField:a,hasM:n,hasZ:r}}async _loadInitialFeatures(e,t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine,c=[];for(const m of t){if(m.uid!=null&&(e.assignedObjectIds[m.uid]=-1),m.geometry&&r!==ah(m.geometry)){e.featureErrors.push(DC("Incorrect geometry type."));continue}const v=this._createDefaultAttributes(),w=RF(u,v,m.attributes,!0);w?e.featureErrors.push(w):(this._assignObjectId(v,m.attributes,!0),m.attributes=v,m.uid!=null&&(e.assignedObjectIds[m.uid]=m.attributes[o]),m.geometry!=null&&(m.geometry=Sf(m.geometry,m.geometry.spatialReference,a)),c.push(m))}l.addMany(PW([],c,r,s,n,o));const{fullExtent:h,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=h,p){const{start:m,end:v}=p;e.layerDefinition.timeInfo.timeExtent=[m,v]}return e}async _applyEdits(e){const{adds:t,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(s,t),r?.length&&this._applyUpdateEdits(s,r),n?.length){for(const l of n)s.deleteResults.push(cH(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:u,fieldsIndex:c}=this._queryEngine,h=[];for(const p of t){if(p.geometry&&n!==ah(p.geometry)){r.push(DC("Incorrect geometry type."));continue}const m=this._createDefaultAttributes(),v=RF(c,m,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(m,p.attributes),p.attributes=m,p.uid!=null){const w=p.attributes[a];e.uidToObjectId[p.uid]=w}if(p.geometry!=null){const w=p.geometry.spatialReference??l;p.geometry=Sf(fbe(p.geometry,w),w,l)}h.push(p),r.push(cH(p.attributes[a]))}}u.addMany(PW([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine;for(const c of t){const{attributes:h,geometry:p}=c,m=h?.[o];if(m==null){e.push(DC(`Identifier field ${o} missing`));continue}if(!l.has(m)){e.push(DC(`Feature with object id ${m} missing`));continue}const v=hSe(l.getFeature(m),r,s,n);if(p!=null){if(r!==ah(p)){e.push(DC("Incorrect geometry type."));continue}const w=p.spatialReference??a;v.geometry=Sf(fbe(p,w),w,a)}if(h){const w=RF(u,v.attributes,h);if(w){e.push(w);continue}}l.add(ODt(v,r,s,n,o)),e.push(cH(m))}}_assignObjectId(e,t,r=!1){const n=this._queryEngine.objectIdField;r&&t&&isFinite(t[n])?e[n]=t[n]:e[n]=this._nextObjectId++}};const LVr=Object.freeze(Object.defineProperty({__proto__:null,default:kVr},Symbol.toStringTag,{value:"Module"}));let NVr=class{constructor(e,t,r){this.uid=e,this.geometry=t,this.attributes=r,this.visible=!0,this.objectId=null,this.centroid=null}},$Vr=class{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}};function BVr(i,e,t,r){if(e?.size&&t!=null&&i)for(const n in i){if(!e.has(n))continue;const s=i[n];typeof s=="string"&&s.length>t&&(r(n),i[n]="")}}function jVr(i,e){return e}function uJe(i,e,t,r){switch(t){case 0:return Wse(i,e+r,0);case 1:return i.originPosition==="lowerLeft"?Wse(i,e+r,1):zVr(i,e+r,1)}}function Gjt(i,e,t,r){return t===2?Wse(i,e,2):uJe(i,e,t,r)}function GVr(i,e,t,r){return t===2?Wse(i,e,3):uJe(i,e,t,r)}function UVr(i,e,t,r){return t===3?Wse(i,e,3):Gjt(i,e,t,r)}function Wse({translate:i,scale:e},t,r){return i[r]+t*e[r]}function zVr({translate:i,scale:e},t,r){return i[r]-t*e[r]}let VVr=class{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=jVr,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new $Vr}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=IY(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(t!=null)for(const r of e.features)t(r.geometry)}createSpatialReference(){return new Xi}addField(e,t){e.fields.push(Fo.fromJSON(t));const r=e.fields.map(n=>n.name);this._attributesConstructor=function(){for(const n of r)this[n]=null}}addFeature(e,t){const r=this._options.maxStringAttributeLength,n=this._options.maxStringAttributeFields;BVr(t.attributes,n,r,s=>{const o=t.attributes[e.objectIdFieldName];o!=null&&this._missingAttributes.push({objectId:o,attribute:s})}),e.features.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:n}=t,s=cB(r.clone(),r,!1,!1,this._transform),o=KC(s,n,!1,!1);let a=null;switch(n){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}o.type=a,e.queryGeometryType=n,e.queryGeometry=o}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,r,n)=>this.addCoordinatePoint(t,r,n),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,r,n)=>this._addCoordinatePolygon(t,r,n),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,r,n)=>this._addCoordinatePolyline(t,r,n),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,r,n)=>this._addCoordinateMultipoint(t,r,n),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:e.geometryType}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new NVr(vF(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((t,r)=>t+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,t){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}createPointGeometry(e){const t={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return t.hasZ&&(t.z=0),t.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const n=this._transform?this._applyTransform(this._transform,t,r,0):t;if(n!=null)switch(r){case 0:e.x=n;break;case 1:e.y=n;break;case 2:e.hasZ?e.z=n:e.m=n;break;case 3:e.m=n}}_transformPathLikeValue(e,t){let r=0;return t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e),this._transform?this._applyTransform(this._transform,e,t,r):e}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(n)}_createPolygonGeometry(e){return{type:"polygon",rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{type:"polyline",paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{type:"multipoint",points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const n=this._transformPathLikeValue(t,r),s=e[e.length-1],o=this._coordinateBuffer;if(o){if(r===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;s.push(new Float64Array(o.buffer,a,this._vertexDimension))}o[this._coordinateBufferPtr++]=n}}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?UVr:t?Gjt:r?GVr:uJe}},HVr=class{_parseFeatureQuery(e){const t=new VVr(e.options),r=lDt(e.buffer,t),n={...r,spatialReference:r.spatialReference?.toJSON(),fields:r.fields?r.fields.map(s=>s.toJSON()):void 0,missingAttributes:t.missingAttributes};return Promise.resolve(n)}};function WVr(){return new HVr}const qVr=Object.freeze(Object.defineProperty({__proto__:null,default:WVr},Symbol.toStringTag,{value:"Module"})),YVr=1e-30,xo=512,cJe=128,mbe=511,Ede=16777216,Ide=8,hJe=29,dJe=24,hee=4,XVr=0,lft=0,gbe=0,JVr=1,KVr=2,ZVr=3,QVr=4,eHr=5,tHr=6,iHr=12,aK=5,Ujt=6,uft=5,rHr=6;var Sv;(function(i){i[i.FilterFlags=0]="FilterFlags",i[i.Animation=1]="Animation",i[i.GPGPU=2]="GPGPU",i[i.VV=3]="VV",i[i.DD0=4]="DD0",i[i.DD1=5]="DD1",i[i.DD2=6]="DD2"})(Sv||(Sv={}));const nHr=3,pJe=1<=this._buffer.length){const t=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*gHr,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(t),n=new this._ctor(r);n.set(this._buffer,0),this._array=r,this._buffer=n,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,r){this._i16View[2*e]+=t,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.lengthu.name==="pos"||u.name==="position");if(!l)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:l},this._indices=new qge(Uint32Array,s),this._vertices=new qge(Uint32Array,o),this._metrics=new qge(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=a,this._instanceId=e}serialize(e){const t=this._indices.buffer(),r=this._vertices.buffer(),n=this._metrics.length?this._metrics.buffer():null;return e.push(t,r),{instanceId:this._instanceId,layout:this.layout,indices:t,vertices:r,metrics:n}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}},P8e=class{constructor(e,t=0){this._id=e,this._sizeHint=t,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new qge(Uint32Array,this._sizeHint*dH.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],r=this._entities.buffer();for(const n of this._instanceIdToVertexData.values())t.push(n.serialize(e));return{message:{data:t,entities:r},transferList:e}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,r,n){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e}metricEnd(){const e=this._current.writer;this._current.metric.bounds.length&&e.writeMetric(this._current.metric)}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}recordEnd(e=0){const t=this._current.vertexStart,r=this._current.writer.vertexCount-t;if(!r)return!1;const n=this._current.indexStart,s=this._current.writer.indexCount-n;return this._recordIndexStart=n,this._recordIndexCount=s,this._recordVertexStart=t,this._recordVertexCount=r,this._entities.incr(this._entityRecordCountOffset),qse.write(this._entities,this._current.instanceId,this._current.textureKey,n,s,t,r,e),!0}copyLast(e,t){const r=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),qse.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,r,this._recordVertexCount,0);const n=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,o=this._recordIndexStart+this._recordIndexCount,a=this._recordVertexCount;for(let S=this._recordIndexStart;S!==o;S++){const I=n.getValue(S);n.push(I+a)}const l=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,u=this._recordVertexStart*l,c=(this._recordVertexStart+this._recordVertexCount)*l;for(let S=u;S!==c;S++){const I=s.getValue(S);s.push(I)}const h=this._current.writer.layout.position,p=h.packPrecisionFactor??1,m=h.offset/Uint32Array.BYTES_PER_ELEMENT,v=e*p,w=t*p;for(let S=r*l;S<=s.length;S+=l)s.i1616Add(S+m,v,w);this.recordEnd()}copyLastFrom(e,t,r){const n=e._entities.getValue(e._entityIdIndex);if(n!==this._entities.getValue(this._entityIdIndex)){const I=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(n,I)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,o=this._current.vertexStart,a=e._current.vertexStart-o,l=this._current.writer.indexWriter,u=this._current.writer.vertexWriter,c=e._current.writer.indexWriter,h=e._current.writer.vertexWriter;for(let I=e._current.indexStart;I!==c.length;I++){const R=c.getValue(I);l.push(R-a)}for(let I=e._current.vertexStart*s;I!==h.length;I++){const R=h.getValue(I);u.push(R)}const p=this._current.writer.layout.position,m=p.packPrecisionFactor??1,v=p.offset/Uint32Array.BYTES_PER_ELEMENT,w=t*m,S=r*m;for(let I=o*s;I<=u.length;I+=s)u.i1616Add(I+v,w,S);this.recordEnd()}_getVertexWriter(e,t){const{stride:r}=t,n=this._instanceIdToVertexData;return n.has(e)||n.set(e,new _Hr(e,t,r,this._sizeHint)),n.get(e)}};function Yjt(i,e,t,r){const n=i.clone(),s=1<=s?(n.col=o-s,n.world+=1):n.col=o,n.row=a,n}const sCe=1,mJe=2,oCe=4,gJe=8,yJe=16,aCe=32,vJe=64,lCe=128;function XOe(i){switch(i){case sCe:case gJe:case aCe:return-1;case mJe:case vJe:return 0;case oCe:case yJe:case lCe:return 1}}function JOe(i){switch(i){case sCe:case mJe:case oCe:return-1;case gJe:case yJe:return 0;case aCe:case vJe:case lCe:return 1}}const hft=sCe|gJe|aCe,dft=oCe|yJe|lCe,pft=sCe|mJe|oCe,fft=aCe|vJe|lCe;let bHr=class{constructor(e,t,r,n=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=n,this._meshes={self:new P8e(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0,this._copyBufferedDataIntoSelf=r&&this._bufferingEnabled&&e.level===0}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<{const o=n.serialize(),a=1<=xo-s?hft:dft|hft)|(t<0+o?fft:t>=xo-o?pft:fft|pft));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<>8^t)+r|0;while(--r!=0)}return(1+t/(1<<31))/2}function xHr(i){return Math.floor(Xjt(i,SHr)*THr)}const SHr=53290320,THr=10;function wle(i){const e=i.map(({name:t,count:r,type:n})=>`${t}.${r}.${n}`).join(",");return Q1(e)}function dee(i,e,t,r,n,s,o){if(i.primitiveName===e){for(const a in i)if(a===t){let l=r?.readWithDefault(n,s,i[a]&&o);return i.type==="text"&&(l=l.toString()),void(i[a]=l)}}if("type"in i&&i.type!=null)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(i.symbolLayers)for(const a of i.symbolLayers)dee(a,e,t,r,n,s,o);break;case"CIMHatchFill":i.lineSymbol&&dee(i.lineSymbol,e,t,r,n,s,o);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(i.type==="CIMVectorMarker"&&i.markerGraphics)for(const a of i.markerGraphics)dee(a,e,t,r,n,s,o),dee(a.symbol,e,t,r,n,s,o)}}function Jjt(i){const e=i.width;return i.effects!=null?256:Math.max(1.25*e,8)}let xle=class{destroy(){}},Kjt=class extends xle{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,r){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}};const CHr=()=>di.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function Ade(i,e,t=!1){const{defaultValue:r,valueExpressionInfo:n,value:s}=e;if(n){const{expression:o}=n,a=await i.createComputedField({expression:o},t);return a?{...e,computed:a,defaultValue:r}:null}return{...e,computed:new Kjt(s),defaultValue:r}}async function mft(i,e){const{defaultValue:t,valueExpressionInfo:r}=e,{expression:n}=r,s=await i.createComputedField({expression:n});return s?{...e,computed:s,defaultValue:t}:null}const Zjt=i=>typeof i!="boolean"&&typeof i!="number"&&"valueExpressionInfo"in i,EHr=i=>i.some(e=>{for(const t in e){const r=e[t];if(Zjt(r))return!0}return!1});let IHr=class Qjt{static async create(e,t,r){const n={},s=new Map,o=new Map,a=new Map,l=new Map,u=new Map;for(const c in r.params){const h=r.params[c];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${c}. Nested array params are not supported`);n[c]=h}else if("valueExpressionInfo"in h){if(h.value){n[c]=h.value;continue}const p=await mft(e,h);if(!p){n[c]=h.defaultValue;continue}s.set(c,p),n[c]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(p=>p.overrides.length)){o.set(c,{effects:await Promise.all(h.effectInfos.map(async p=>{const m=p.overrides.map(v=>Ade(e,v));return{effect:p.effect,compiledOverrides:(await Promise.all(m)).filter(Ga)}}))});break}n[c]=h.effectInfos.map(p=>p.effect);break;case"cim-marker-placement-info":h.overrides.length&&a.set(c,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(p=>Ade(e,p)))).filter(Ga)}),n[c]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const m=h.overrides.map(v=>Ade(e,v,h.useLegacyLabelEvaluationRules));l.set(c,{compiledOverrides:(await Promise.all(m)).filter(Ga),rasterizationParam:h,objectIdToResourceId:new Map});continue}const p={type:"cim-rasterization-info",resource:h.resource};n[c]=await t.fetchResourceImmediate(p)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const m=h.overrides.map(v=>Ade(e,v));l.set(c,{compiledOverrides:(await Promise.all(m)).filter(Ga),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){l.set(c,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const p={type:"cim-rasterization-info",resource:h.resource};n[c]=await t.fetchResourceImmediate(p)??null;break}case"cim-marker-transform-param":{const{params:p}=h;if(EHr(p)){const m={compiledMarkerInfos:[]};await Promise.all(p.map(async v=>{const w={props:{}};for(const S in v)if(Zjt(v[S])){const I=await mft(e,v[S]);w.compiledExpressionMap||(w.compiledExpressionMap=new Map);const R=w.compiledExpressionMap;I&&R.set(S,I)}else w.props[S]=v[S];m.compiledMarkerInfos.push(w)})),u.set(c,m)}else n[c]={type:"cim-marker-transform-info",infos:p};break}default:n[c]=h}else n[c]=h}return new Qjt(r,n,s,o,a,l,u)}constructor(e,t,r,n,s,o,a){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=r,this._dynamicEffectProperties=n,this._dynamicPlacementProperties=s,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=a,this.evaluator=l=>l}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,r){for(const n of this._dynamicAsyncProperties.values()){const s=li(n.rasterizationParam.resource);n.rasterizationParam.resource.type==="animated"&&n.rasterizationParam.resource.randomizeStartTime&&(s.primitiveName="__RESERVED__PRIMITIVE__NAME__",s.startGroup=xHr(t.getObjectId()||0));for(const{primitiveName:a,propertyName:l,computed:u,defaultValue:c,valueExpressionInfo:h}of n.compiledOverrides)try{const p=n.rasterizationParam.resource.type==="animated"?s.primitiveName:a;dee(s,p,l,u,t,r,c)}catch(p){CHr().errorOnce(new qe("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${h?.expression}' (primitive: '${a}', property: '${l}')`,p))}const o=e.enqueueRequest({type:"cim-rasterization-info",resource:s});n.objectIdToResourceId.set(t.getObjectId(),o)}}evaluateMeshParams(e,t,r){for(const[n,s]of this._dynamicProperties.entries())this._resolvedMeshParams[n]=s.computed.readWithDefault(t,r,s.defaultValue);for(const[n,s]of this._dynamicPlacementProperties.entries())for(const{computed:o,defaultValue:a,propertyName:l}of s.compiledOverrides){const u=o.readWithDefault(t,r,a);s.placementInfo.placement[l]=u,this._resolvedMeshParams[n]=s.placementInfo.placement}for(const[n,s]of this._dynamicEffectProperties.entries())for(const o of s.effects){for(const{computed:a,defaultValue:l,propertyName:u}of o.compiledOverrides){const c=a.readWithDefault(t,r,l);o.effect[u]=c}this._resolvedMeshParams[n]=s.effects.map(a=>a.effect)}for(const[n,s]of this._dynamicTransformProperties.entries()){const o={type:"cim-marker-transform-info",infos:[]};for(const a of s.compiledMarkerInfos){const l={...a.props};if(a.compiledExpressionMap)for(const[u,c]of a.compiledExpressionMap){const h=c.computed.readWithDefault(t,r,c.defaultValue);l[u]=typeof h=="number"||typeof h=="boolean"?h:c.defaultValue}o.infos.push(l)}this._resolvedMeshParams[n]=o}for(const[n,s]of this._dynamicAsyncProperties.entries()){const o=s.objectIdToResourceId.get(t.getObjectId());if(o==null)continue;const a=e.getResource(o);this._resolvedMeshParams[n]=a}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}};const AHr=128e3;let KOe=null,eGt=null;async function tGt(){return KOe||(KOe=MHr()),KOe}async function MHr(){eGt=await(yi("esri-csp-restrictions")?await Promise.resolve().then(()=>kBn).then(e=>e.l):await Promise.resolve().then(()=>$Bn).then(e=>e.l)).default({locateFile:e=>Fl(`esri/core/libs/libtess/${e}`)})}function iGt(i,e){const t=Math.max(i.length,AHr);return eGt.triangulate(i,e,t)}var gft,yft,vft,rGt={exports:{}};gft=rGt,yft=function(){function i(ae,fe,be){be=be||2;var _e,Ie,Te,Be,Ve,$e,tt,yt=fe&&fe.length,Ct=yt?fe[0]*be:ae.length,ot=e(ae,0,Ct,be,!0),vt=[];if(!ot||ot.next===ot.prev)return vt;if(yt&&(ot=l(ae,fe,ot,be)),ae.length>80*be){_e=Te=ae[0],Ie=Be=ae[1];for(var At=be;AtTe&&(Te=Ve),$e>Be&&(Be=$e);tt=(tt=Math.max(Te-_e,Be-Ie))!==0?1/tt:0}return r(ot,vt,be,_e,Ie,tt),vt}function e(ae,fe,be,_e,Ie){var Te,Be;if(Ie===Z(ae,fe,be,_e)>0)for(Te=fe;Te=fe;Te-=_e)Be=de(Te,ae[Te],ae[Te+1],Be);if(Be&&B(Be,Be.next)){var Ve=Be.next;pe(Be),Be=Ve}return Be}function t(ae,fe){if(!ae)return ae;fe||(fe=ae);var be,_e=ae;do if(be=!1,_e.steiner||!B(_e,_e.next)&&k(_e.prev,_e,_e.next)!==0)_e=_e.next;else{var Ie=_e.prev;if(pe(_e),(_e=fe=Ie)===_e.next)break;be=!0}while(be||_e!==fe);return fe}function r(ae,fe,be,_e,Ie,Te,Be){if(ae){!Be&&Te&&v(ae,_e,Ie,Te);for(var Ve,$e,tt=ae;ae.prev!==ae.next;)if(Ve=ae.prev,$e=ae.next,Te?s(ae,_e,Ie,Te):n(ae))fe.push(Ve.i/be),fe.push(ae.i/be),fe.push($e.i/be),pe(ae),ae=$e.next,tt=$e.next;else if((ae=$e)===tt){Be?Be===1?r(ae=o(t(ae),fe,be),fe,be,_e,Ie,Te,2):Be===2&&a(ae,fe,be,_e,Ie,Te):r(t(ae),fe,be,_e,Ie,Te,1);break}}}function n(ae){var fe=ae.prev,be=ae,_e=ae.next;if(k(fe,be,_e)>=0)return!1;for(var Ie=ae.next.next;Ie!==ae.prev;){if(R(fe.x,fe.y,be.x,be.y,_e.x,_e.y,Ie.x,Ie.y)&&k(Ie.prev,Ie,Ie.next)>=0)return!1;Ie=Ie.next}return!0}function s(ae,fe,be,_e){var Ie=ae.prev,Te=ae,Be=ae.next;if(k(Ie,Te,Be)>=0)return!1;for(var Ve=Ie.xTe.x?Ie.x>Be.x?Ie.x:Be.x:Te.x>Be.x?Te.x:Be.x,yt=Ie.y>Te.y?Ie.y>Be.y?Ie.y:Be.y:Te.y>Be.y?Te.y:Be.y,Ct=S(Ve,$e,fe,be,_e),ot=S(tt,yt,fe,be,_e),vt=ae.prevZ,At=ae.nextZ;vt&&vt.z>=Ct&&At&&At.z<=ot;){if(vt!==ae.prev&&vt!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,vt.x,vt.y)&&k(vt.prev,vt,vt.next)>=0||(vt=vt.prevZ,At!==ae.prev&&At!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,At.x,At.y)&&k(At.prev,At,At.next)>=0))return!1;At=At.nextZ}for(;vt&&vt.z>=Ct;){if(vt!==ae.prev&&vt!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,vt.x,vt.y)&&k(vt.prev,vt,vt.next)>=0)return!1;vt=vt.prevZ}for(;At&&At.z<=ot;){if(At!==ae.prev&&At!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,At.x,At.y)&&k(At.prev,At,At.next)>=0)return!1;At=At.nextZ}return!0}function o(ae,fe,be){var _e=ae;do{var Ie=_e.prev,Te=_e.next.next;!B(Ie,Te)&&$(Ie,_e,_e.next,Te)&&Q(Ie,Te)&&Q(Te,Ie)&&(fe.push(Ie.i/be),fe.push(_e.i/be),fe.push(Te.i/be),pe(_e),pe(_e.next),_e=ae=Te),_e=_e.next}while(_e!==ae);return t(_e)}function a(ae,fe,be,_e,Ie,Te){var Be=ae;do{for(var Ve=Be.next.next;Ve!==Be.prev;){if(Be.i!==Ve.i&&L(Be,Ve)){var $e=ne(Be,Ve);return Be=t(Be,Be.next),$e=t($e,$e.next),r(Be,fe,be,_e,Ie,Te),void r($e,fe,be,_e,Ie,Te)}Ve=Ve.next}Be=Be.next}while(Be!==ae)}function l(ae,fe,be,_e){var Ie,Te,Be,Ve=[];for(Ie=0,Te=fe.length;Ie=_e.next.y&&_e.next.y!==_e.y){var Ve=_e.x+(Te-_e.y)*(_e.next.x-_e.x)/(_e.next.y-_e.y);if(Ve<=Ie&&Ve>Be){if(Be=Ve,Ve===Ie){if(Te===_e.y)return _e;if(Te===_e.next.y)return _e.next}be=_e.x<_e.next.x?_e:_e.next}}_e=_e.next}while(_e!==fe);if(!be)return null;if(Ie===Be)return be;var $e,tt=be,yt=be.x,Ct=be.y,ot=1/0;_e=be;do Ie>=_e.x&&_e.x>=yt&&Ie!==_e.x&&R(Tebe.x||_e.x===be.x&&m(be,_e)))&&(be=_e,ot=$e)),_e=_e.next;while(_e!==tt);return be}function m(ae,fe){return k(ae.prev,ae,fe.prev)<0&&k(fe.next,ae,ae.next)<0}function v(ae,fe,be,_e){var Ie=ae;do Ie.z===null&&(Ie.z=S(Ie.x,Ie.y,fe,be,_e)),Ie.prevZ=Ie.prev,Ie.nextZ=Ie.next,Ie=Ie.next;while(Ie!==ae);Ie.prevZ.nextZ=null,Ie.prevZ=null,w(Ie)}function w(ae){var fe,be,_e,Ie,Te,Be,Ve,$e,tt=1;do{for(be=ae,ae=null,Te=null,Be=0;be;){for(Be++,_e=be,Ve=0,fe=0;fe0||$e>0&&_e;)Ve!==0&&($e===0||!_e||be.z<=_e.z)?(Ie=be,be=be.nextZ,Ve--):(Ie=_e,_e=_e.nextZ,$e--),Te?Te.nextZ=Ie:ae=Ie,Ie.prevZ=Te,Te=Ie;be=_e}Te.nextZ=null,tt*=2}while(Be>1);return ae}function S(ae,fe,be,_e,Ie){return(ae=1431655765&((ae=858993459&((ae=252645135&((ae=16711935&((ae=32767*(ae-be)*Ie)|ae<<8))|ae<<4))|ae<<2))|ae<<1))|(fe=1431655765&((fe=858993459&((fe=252645135&((fe=16711935&((fe=32767*(fe-_e)*Ie)|fe<<8))|fe<<4))|fe<<2))|fe<<1))<<1}function I(ae){var fe=ae,be=ae;do(fe.x=0&&(ae-Be)*(_e-Ve)-(be-Be)*(fe-Ve)>=0&&(be-Be)*(Te-Ve)-(Ie-Be)*(_e-Ve)>=0}function L(ae,fe){return ae.next.i!==fe.i&&ae.prev.i!==fe.i&&!K(ae,fe)&&(Q(ae,fe)&&Q(fe,ae)&&re(ae,fe)&&(k(ae.prev,ae,fe.prev)||k(ae,fe.prev,fe))||B(ae,fe)&&k(ae.prev,ae,ae.next)>0&&k(fe.prev,fe,fe.next)>0)}function k(ae,fe,be){return(fe.y-ae.y)*(be.x-fe.x)-(fe.x-ae.x)*(be.y-fe.y)}function B(ae,fe){return ae.x===fe.x&&ae.y===fe.y}function $(ae,fe,be,_e){var Ie=Y(k(ae,fe,be)),Te=Y(k(ae,fe,_e)),Be=Y(k(be,_e,ae)),Ve=Y(k(be,_e,fe));return Ie!==Te&&Be!==Ve||!(Ie!==0||!V(ae,be,fe))||!(Te!==0||!V(ae,_e,fe))||!(Be!==0||!V(be,ae,_e))||!(Ve!==0||!V(be,fe,_e))}function V(ae,fe,be){return fe.x<=Math.max(ae.x,be.x)&&fe.x>=Math.min(ae.x,be.x)&&fe.y<=Math.max(ae.y,be.y)&&fe.y>=Math.min(ae.y,be.y)}function Y(ae){return ae>0?1:ae<0?-1:0}function K(ae,fe){var be=ae;do{if(be.i!==ae.i&&be.next.i!==ae.i&&be.i!==fe.i&&be.next.i!==fe.i&&$(be,be.next,ae,fe))return!0;be=be.next}while(be!==ae);return!1}function Q(ae,fe){return k(ae.prev,ae,ae.next)<0?k(ae,fe,ae.next)>=0&&k(ae,ae.prev,fe)>=0:k(ae,fe,ae.prev)<0||k(ae,ae.next,fe)<0}function re(ae,fe){var be=ae,_e=!1,Ie=(ae.x+fe.x)/2,Te=(ae.y+fe.y)/2;do be.y>Te!=be.next.y>Te&&be.next.y!==be.y&&Ie<(be.next.x-be.x)*(Te-be.y)/(be.next.y-be.y)+be.x&&(_e=!_e),be=be.next;while(be!==ae);return _e}function ne(ae,fe){var be=new H(ae.i,ae.x,ae.y),_e=new H(fe.i,fe.x,fe.y),Ie=ae.next,Te=fe.prev;return ae.next=fe,fe.prev=ae,be.next=Ie,Ie.prev=be,_e.next=be,be.prev=_e,Te.next=_e,_e.prev=Te,_e}function de(ae,fe,be,_e){var Ie=new H(ae,fe,be);return _e?(Ie.next=_e.next,Ie.prev=_e,_e.next.prev=Ie,_e.next=Ie):(Ie.prev=Ie,Ie.next=Ie),Ie}function pe(ae){ae.next.prev=ae.prev,ae.prev.next=ae.next,ae.prevZ&&(ae.prevZ.nextZ=ae.nextZ),ae.nextZ&&(ae.nextZ.prevZ=ae.prevZ)}function H(ae,fe,be){this.i=ae,this.x=fe,this.y=be,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Z(ae,fe,be,_e){for(var Ie=0,Te=fe,Be=be-_e;Te0&&(_e+=ae[Ie-1].length,be.holes.push(_e))}return be},i},(vft=yft())!==void 0&&(gft.exports=vft);const ybe=Cg(rGt.exports),OHr=512;var Yy,Vg;(function(i){i[i.Unknown=0]="Unknown",i[i.Point=1]="Point",i[i.LineString=2]="LineString",i[i.Polygon=3]="Polygon"})(Yy||(Yy={}));let Po=class Yge{constructor(e,t){this.x=e,this.y=t}clone(){return new Yge(this.x,this.y)}equals(e,t){return e===this.x&&t===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,t){return this.x=e,this.y=t,this}normalize(){const e=this.x,t=this.y,r=Math.sqrt(e*e+t*t);return this.x/=r,this.y/=r,this}rightPerpendicular(){const e=this.x;return this.x=this.y,this.y=-e,this}leftPerpendicular(){const e=this.x;return this.x=-this.y,this.y=e,this}move(e,t){return this.x+=e,this.y+=t,this}assign(e){return this.x=e.x,this.y=e.y,this}assignAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}assignSub(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}rotate(e,t){const r=this.x,n=this.y;return this.x=r*e-n*t,this.y=r*t+n*e,this}scale(e){return this.x*=e,this.y*=e,this}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}sub(e){return this.x-=e.x,this.y-=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}static distance(e,t){const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)}static add(e,t){return new Yge(e.x+t.x,e.y+t.y)}static sub(e,t){return new Yge(e.x-t.x,e.y-t.y)}},Mde=class{constructor(e,t,r){this.ratio=e,this.x=t,this.y=r}},uCe=class{constructor(e,t,r,n=8,s=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=n,this._pixelMargin=s,this._tileSize=OHr*n,this._dz=e,this._yPos=t,this._xPos=r}setPixelMargin(e){e!==this._pixelMargin&&(this._pixelMargin=e,this.setExtent(this._extent))}setExtent(e){this._extent=e,this._finalRatio=this._tileSize/e*(1<>this._dz;t>r&&(t=r),this._margin=t,this._xmin=r*this._xPos-t,this._ymin=r*this._yPos-t,this._xmax=this._xmin+r+2*t,this._ymax=this._ymin+r+2*t}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(e,t){this._pushLine(),this._prevIsIn=this._isIn(e,t),this._moveTo(e,t,this._prevIsIn),this._prevPt=new Po(e,t),this._firstPt=new Po(e,t),this._dist=0}lineTo(e,t){const r=this._isIn(e,t),n=new Po(e,t),s=Po.distance(this._prevPt,n);let o,a,l,u,c,h,p,m;if(r)this._prevIsIn?this._lineTo(e,t,!0):(o=this._prevPt,a=n,l=this._intersect(a,o),this._start=this._dist+s*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,o=n,l=this._intersect(a,o),this._lineTo(l.x,l.y,!0),this._lineTo(o.x,o.y,!1);else{const v=this._prevPt,w=n;if(v.x<=this._xmin&&w.x<=this._xmin||v.x>=this._xmax&&w.x>=this._xmax||v.y<=this._ymin&&w.y<=this._ymin||v.y>=this._ymax&&w.y>=this._ymax)this._lineTo(w.x,w.y,!1);else{const S=[];if((v.xthis._xmin||v.x>this._xmin&&w.x=this._ymax?h=!0:S.push(new Mde(u,this._xmin,m))),(v.xthis._xmax||v.x>this._xmax&&w.x=this._ymax?h=!0:S.push(new Mde(u,this._xmax,m))),(v.ythis._ymin||v.y>this._ymin&&w.y=this._xmax?c=!0:S.push(new Mde(u,p,this._ymin))),(v.ythis._ymax||v.y>this._ymax&&w.y=this._xmax?c=!0:S.push(new Mde(u,p,this._ymax))),S.length===0)c?h?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):h?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(S.length>1&&S[0].ratio>S[1].ratio)this._start=this._dist+s*S[1].ratio,this._lineTo(S[1].x,S[1].y,!0),this._lineTo(S[0].x,S[0].y,!0);else{this._start=this._dist+s*S[0].ratio;for(let I=0;I2){const e=this._firstPt,t=this._prevPt;e.x===t.x&&e.y===t.y||this.lineTo(e.x,e.y);const r=this._line;let n=r.length;for(;n>=4&&(r[0].x===r[1].x&&r[0].x===r[n-2].x||r[0].y===r[1].y&&r[0].y===r[n-2].y);)r.pop(),r[0].x=r[n-2].x,r[0].y=r[n-2].y,--n}}result(e=!0){return this._pushLine(),this._lines.length===0?null:(this._type===Yy.Polygon&&e&&RHr.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==Yy.LineString)throw new Error("Only valid for lines");this._pushLine();const e=this._lines,t=e.length;if(t===0)return null;const r=[];for(let n=0;n=this._xmin&&e<=this._xmax&&t>=this._ymin&&t<=this._ymax}_intersect(e,t){let r,n,s;if(t.x>=this._xmin&&t.x<=this._xmax)n=t.y<=this._ymin?this._ymin:this._ymax,s=(n-e.y)/(t.y-e.y),r=e.x+s*(t.x-e.x);else if(t.y>=this._ymin&&t.y<=this._ymax)r=t.x<=this._xmin?this._xmin:this._xmax,s=(r-e.x)/(t.x-e.x),n=e.y+s*(t.y-e.y);else{n=t.y<=this._ymin?this._ymin:this._ymax,r=t.x<=this._xmin?this._xmin:this._xmax;const o=(r-e.x)/(t.x-e.x),a=(n-e.y)/(t.y-e.y);o0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Yy.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Yy.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(e,t,r){this._type!==Yy.Polygon?r&&(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Po(e,t))):(r||(ethis._xmax&&(e=this._xmax),tthis._ymax&&(t=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Po(e,t)),this._isH=!1,this._isV=!1)}_lineTo(e,t,r){let n,s;if(this._type!==Yy.Polygon)if(r){if(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(n=this._line[this._line.length-1],n.equals(e,t)))return;this._line.push(new Po(e,t))}else this._line&&this._line.length>0&&this._pushLine();else if(r||(ethis._xmax&&(e=this._xmax),tthis._ymax&&(t=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){n=this._line[this._line.length-1];const o=n.x===e,a=n.y===t;if(o&&a)return;this._isH&&o||this._isV&&a?(n.x=e,n.y=t,s=this._line[this._line.length-2],s.x===e&&s.y===t?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(s=this._line[this._line.length-2],this._isH=s.x===e,this._isV=s.y===t)):(this._isH=s.x===e,this._isV=s.y===t)):(this._line.push(new Po(e,t)),this._isH=o,this._isV=a)}else this._line.push(new Po(e,t))}},PHr=class{setExtent(e){this._ratio=e===4096?1:4096/e}get validateTessellation(){return this._ratio<1}reset(e){this._lines=[],this._line=null}moveTo(e,t){this._line&&this._lines.push(this._line),this._line=[];const r=this._ratio;this._line.push(new Po(e*r,t*r))}lineTo(e,t){const r=this._ratio;this._line.push(new Po(e*r,t*r))}close(){const e=this._line;e&&!e[0].isEqual(e[e.length-1])&&e.push(e[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}};(function(i){i[i.sideLeft=0]="sideLeft",i[i.sideRight=1]="sideRight",i[i.sideTop=2]="sideTop",i[i.sideBottom=3]="sideBottom"})(Vg||(Vg={}));let RHr=class L4{static simplify(e,t,r){if(!r)return;const n=-t,s=e+t,o=-t,a=e+t,l=[],u=[],c=r.length;for(let p=0;pv.y?(l.push(p),l.push(I),l.push(Vg.sideLeft),l.push(-1)):(u.push(p),u.push(I),u.push(Vg.sideLeft),u.push(-1))),w.x>=s&&(w.y=a&&(w.x>v.x?(l.push(p),l.push(I),l.push(Vg.sideBottom),l.push(-1)):(u.push(p),u.push(I),u.push(Vg.sideBottom),u.push(-1)))),w=v}if(l.length===0||u.length===0)return;L4.fillParent(r,u,l),L4.fillParent(r,l,u);const h=[];L4.calcDeltas(h,u,l),L4.calcDeltas(h,l,u),L4.addDeltas(h,r)}static fillParent(e,t,r){const n=r.length,s=t.length;for(let o=0;o1&&n[o-2]===s?0:(n.push(s),L4.calcDelta(s,r,t,n)+1)}static addDeltas(e,t){const r=e.length;let n=0;for(let s=0;sn&&(n=o)}for(let s=0;si>=e&&i<=t||i>=t&&i<=e;function DHr(i,e,t,r,n,s,o){F8e=0;const a=(r-t)*s,l=n&&n.length,u=l?(n[0]-t)*s:a;let c,h,p,m,v,w=nGt(e,t,r,0,u,s,!0);if(w&&w.next!==w.prev){if(l&&(w=NHr(e,t,r,n,w,s)),a>80*s){c=p=e[0+t*s],h=m=e[1+t*s];for(let S=s;S0)for(let l=r;l=r;l-=s)a=_ft(l+e*s,i[l+e*s],i[l+1+e*s],a);return a&&S8(a,a.next)&&(Jse(a),a=a.next),a}function Yse(i,e=i){if(!i)return i;let t,r=i;do if(t=!1,r.steiner||!S8(r,r.next)&&r0(r.prev,r,r.next)!==0)r=r.next;else{if(Jse(r),r=e=r.prev,r===r.next)break;t=!0}while(t||r!==e);return e}function Xse(i,e,t,r,n,s,o,a){if(!i)return;!a&&s&&(i=sGt(i,r,n,s));let l=i;for(;i.prev!==i.next;){const u=i.prev,c=i.next;if(s?kHr(i,r,n,s):FHr(i))e.push(u.index/t+o),e.push(i.index/t+o),e.push(c.index/t+o),Jse(i),i=c.next,l=c.next;else if((i=c)===l){a?a===1?Xse(i=VHr(i,e,t,o),e,t,r,n,s,o,2):a===2&&HHr(i,e,t,r,n,s,o):Xse(Yse(i),e,t,r,n,s,o,1);break}}}function FHr(i){const e=i.prev,t=i,r=i.next;if(r0(e,t,r)>=0)return!1;let n=i.next.next;const s=n;let o=0;for(;n!==i.prev&&(o===0||n!==s);){if(o++,tV(e.x,e.y,t.x,t.y,r.x,r.y,n.x,n.y)&&r0(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function kHr(i,e,t,r){const n=i.prev,s=i,o=i.next;if(r0(n,s,o)>=0)return!1;const a=n.xs.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,c=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=R8e(a,l,e,t,r),p=R8e(u,c,e,t,r);let m=i.prevZ,v=i.nextZ;for(;m&&m.z>=h&&v&&v.z<=p;){if(m!==i.prev&&m!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&r0(m.prev,m,m.next)>=0||(m=m.prevZ,v!==i.prev&&v!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&r0(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;m&&m.z>=h;){if(m!==i.prev&&m!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&r0(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;v&&v.z<=p;){if(v!==i.prev&&v!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&r0(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function _ft(i,e,t,r){const n=vbe.create(i,e,t);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Jse(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function LHr(i){let e=i,t=i;do(e.x=t.next.y&&t.next.y!==t.y){const p=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=r&&p>o){if(o=p,p===r){if(n===t.y)return t;if(n===t.next.y)return t.next}s=t.x=t.x&&t.x>=l&&r!==t.x&&tV(ns.x)&&Kse(t,i)&&(s=t,h=c)),t=t.next;return s}function sGt(i,e,t,r){let n;for(;n!==i;n=n.next){if(n=n||i,n.z===null&&(n.z=R8e(n.x,n.y,e,t,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,sGt(i,e,t,r);n.prevZ=n.prev,n.nextZ=n.next}return i.prevZ.nextZ=null,i.prevZ=null,jHr(i)}function jHr(i){let e,t=1;for(;;){let r,n=i;i=null,e=null;let s=0;for(;n;){s++,r=n;let o=0;for(;o0||a>0&&r;){let l;o===0?(l=r,r=r.nextZ,a--):a!==0&&r?n.z<=r.z?(l=n,n=n.nextZ,o--):(l=r,r=r.nextZ,a--):(l=n,n=n.nextZ,o--),e?e.nextZ=l:i=l,l.prevZ=e,e=l}n=r}if(e.nextZ=null,t*=2,s<2)return i}}function r0(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function oGt(i,e,t,r){return!!(S8(i,e)&&S8(t,r)||S8(i,r)&&S8(t,e))||r0(i,e,t)>0!=r0(i,e,r)>0&&r0(t,r,i)>0!=r0(t,r,e)>0}function GHr(i,e){let t=i;do{if(t.index!==i.index&&t.next.index!==i.index&&t.index!==e.index&&t.next.index!==e.index&&oGt(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function UHr(i,e,t,r,n,s){let o=0;for(let a=r,l=n-s;a=0&&(i-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(r-a)>=0}function Kse(i,e){return r0(i.prev,i,i.next)<0?r0(i,e,i.next)>=0&&r0(i,i.prev,e)>=0:r0(i,e,i.prev)<0||r0(i,i.next,e)<0}function R8e(i,e,t,r,n){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-t)*n)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function S8(i,e){return i.x===e.x&&i.y===e.y}function zHr(i,e){return i.x-e.x}function VHr(i,e,t,r){let n=i;do{const s=n.prev,o=n.next.next;!S8(s,o)&&oGt(s,n,n.next,o)&&Kse(s,o)&&Kse(o,s)&&(e.push(s.index/t+r),e.push(n.index/t+r),e.push(o.index/t+r),Jse(n),Jse(n.next),n=i=o),n=n.next}while(n!==i);return n}function HHr(i,e,t,r,n,s,o){let a=i;do{let l=a.next.next;for(;l!==a.prev;){if(a.index!==l.index&&WHr(a,l)){let u=aGt(a,l);return a=Yse(a,a.next),u=Yse(u,u.next),Xse(a,e,t,r,n,s,o,0),void Xse(u,e,t,r,n,s,o,0)}l=l.next}a=a.next}while(a!==i)}function WHr(i,e){return i.next.index!==e.index&&i.prev.index!==e.index&&!GHr(i,e)&&Kse(i,e)&&Kse(e,i)&&qHr(i,e)}function qHr(i,e){let t=i,r=!1;const n=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==i);return r}function aGt(i,e){const t=vbe.create(i.index,i.x,i.y),r=vbe.create(e.index,e.x,e.y),n=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=n,n.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}let vbe=class lGt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,t,r){const n=F8e0))break;h+=I,p.push(a+c),c+=S}const m=o.length;DHr(o,t,a,a+c,p,2,s);const v=JHr(o,t,m,o.length,s),w=Math.abs(h);if(Math.abs((v-w)/Math.max(1e-7,w))>XHr)return o.length=0,!1;l=u,a+=c}return!0}function ZHr(i){const{coords:e,lengths:t}=i,{buffer:r}=iGt(e,t);return r}function QHr(i,e,t){let r=0;for(let n=0;nt||lt)return!0}r+=s}return!1}function uGt(i,e){if(i==null)return null;if(!QHr(i,-128,xo+128))return i;v$.setPixelMargin(e),v$.reset(Yy.Polygon);let t=0;for(let o=0;on||cn){o=!0;continue}l.push({x:u,y:c})}let h=!1;for(;i.nextPoint();)if(u=i.x,c=i.y,o)t.lineTo(u,c);else{if(un||cn){h=!0;break}l.push({x:u,y:c})}if(h)o=!0;else{if(o){const p=t.resultWithStarts();if(p)for(const m of p)s.push(m)}else s.push({line:l,start:0});a=i.nextPath(),o=!1}}return s=s.filter(l=>l.line.length>1),s.length===0?null:s}v$.setExtent(xo),k8e.setExtent(xo);let Ec=class{static fromOptimized(e,t,r=!1,n=!1,s=1){return new L8e().initialize(e,t,r,n,s)}static fromJSON(e,t=!1,r=!1){const[n,s]=wft(e);return new N8e().initialize(n,s,t,r,1)}static fromOptimizedCIM(e,t,r=!1,n=!1,s=1){return new xft().initialize(e,t,r,n,s)}static fromJSONCIM(e,t=!1,r=!1,n=1){const[s,o]=wft(e);return new Sft().initialize(s,o,t,r,n)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),r=e.geometryType;return t&&r?this.fromOptimized(t,r):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),r=e.geometryType;return t&&r?this.fromOptimizedCIM(t,r):null}static createEmptyOptimized(e,t=!1,r=!1,n=1){return new L8e().initialize(new $o,e,t,r,n)}static createEmptyJSON(e,t=!1,r=!1){return new N8e().initialize([],e,t,r,1)}static createEmptyOptimizedCIM(e,t=!1,r=!1,n=1){return new xft().initialize(new $o,e,t,r,n)}static createEmptyJSONCIM(e,t=!1,r=!1,n=1){return new Sft().initialize([],e,t,r,n)}asJSON(){const e=oae(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,r=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const n=e,s=t;for(;this.nextPoint();)r+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return r+=(e-n)*(t+s),-.5*r}invertY(){this.yFactor*=-1}},L8e=class cGt extends Ec{constructor(){super(...arguments),this._end=-1}initialize(e,t,r,n,s){return this.hasZ=r,this.hasM=n,this.geometryType=t,this._stride=2+Number(r)+Number(n),this._geometry=e,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=s,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(e){if(e>=0&&ee)for(;this._pathIndex>e&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(e){const t=this._pathOffset+e*this._stride;return t>=0&&t=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}pathLength(){const e=this._end,t=this._stride,r=this._geometry.coords;let n=0;for(let s=this._pathOffset+t;se+t)}get pathSize(){const{lengths:e}=this._geometry;return this._pathIndex<0||this._pathIndex>e.length-1?0:this._geometry.isPoint?1:e[this._pathIndex]}get totalSize(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(e){this._geometry.coords[this._pointOffset]=e}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(e){this._geometry.coords[this._pointOffset+1]=this.yFactor*e}get z(){return this._geometry.coords[this._pointOffset+2]}set z(e){this._geometry.coords[this._pointOffset+2]=e}get m(){const e=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+e]}set m(e){this._geometry.coords[this._pointOffset+3]=e}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function tWr(i){const e=[i.x,i.y];return i.z&&e.push(i.z),i.m&&e.push(i.m),e}function wft(i){return ed(i)?[i.rings,"esriGeometryPolygon"]:e0(i)?[i.paths,"esriGeometryPolyline"]:xF(i)?[[i.points],"esriGeometryMultipoint"]:zd(i)?[[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]],"esriGeometryEnvelope"]:dR(i)?[[[tWr(i)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let N8e=class hGt extends Ec{initialize(e,t,r,n,s){return this._paths=e,this.geometryType=t,this.hasZ=r,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=s,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(e){return this._pathIndex=e,this._pointIndex=-1,e>=0&&e=0&&e=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const e=this._currentPath.length,t=this._currentPath;let r=0;for(let n=1;ne.length).reduce((e,t)=>e+t)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(e){this._currentPoint[0]=e}get y(){return this.yFactor*this._currentPoint[1]}set y(e){this._currentPoint[1]=this.yFactor*e}get z(){return this._currentPoint[2]}set z(e){this._currentPoint[2]=e}get m(){return this._currentPoint[this._mIndex]}set m(e){this._currentPoint[this._mIndex]=e}get pathIndex(){return this._pathIndex}};const Pde=4,Rde=1;let xft=class dGt extends L8e{initialize(e,t,r,n,s){return super.initialize(e,t,r,n,s),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const e=new dGt().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return e._controlPoints=this._controlPoints,e}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(e){this._controlPoints[this.pathIndex].add(e)}getControlPointAt(e){return this._controlPoints[this.pathIndex].has(e)}},Sft=class pGt extends N8e{initialize(e,t,r,n,s){return super.initialize(e,t,r,n,s)}clone(){return new pGt().initialize(li(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Pde]=Rde}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Pde]===Rde}setControlPointAt(e){this._paths[this.pathIndex][e][Pde]=Rde}getControlPointAt(e){return this._paths[this.pathIndex][e][Pde]===Rde}};const iWr=512;let MM,$8e=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function _Je(i,e){MM||(MM=new uCe(0,0,0,1));const t=i.geometryType==="esriGeometryPolygon",r=t?Yy.Polygon:Yy.LineString,n=t?3:2;let s,o;for(MM.reset(r),MM.setPixelMargin(e+1),MM.setExtent(iWr);i.nextPath();)if(!(i.pathSize1&&R>0&&u>0&&(a*S+l*I)/R/u<=this._maxCosAngle&&e.setControlPointAt(m-1),m===1&&(c=S,h=I,p=R),R>0&&(n=v,s=w,a=S,l=I,u=R)}this._isClosed&&u>0&&p>0&&(a*c+l*h)/p/u<=this._maxCosAngle&&e.setControlPointAt(0)}}},sX=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function ZOe(i,e){i[4]=e}let Sle=class{constructor(e,t=!0,r=!0,n=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!r&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.internalPlacement=new sX}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.pathIndex0?[o/l,a/l]:[1,0]}getSegAngleCS(e,t){const[[r,n],[s,o]]=e;return this.getAngleCS(r,n,s,o,t)}cut(e,t,r,n,s,o){return[s<=0?[e,t]:this.getCoord2D(e,t,r,n,s),o>=1?[r,n]:this.getCoord2D(e,t,r,n,o)]}getSubCurve(e,t,r){const n=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(n,e,t,r)?n:null}appendSubCurve(e,t,r,n){e.startPath(),t.seekPathStart();let s=0,o=!0;if(!t.nextPoint())return!1;let a=t.x,l=t.y;for(;t.nextPoint();){const u=this.getLength(a,l,t.x,t.y);if(u!==0){if(o){if(s+u>r){const c=(r-s)/u;let h=1,p=!1;s+u>=n&&(h=(n-s)/u,p=!0);const m=this.cut(a,l,t.x,t.y,c,h);if(m&&e.pushPoints(m),p)break;o=!1}}else{if(s+u>n){const c=this.cut(a,l,t.x,t.y,0,(n-s)/u);c&&e.pushPoint(c[1]);break}e.pushXY(t.x,t.y)}s+=u,a=t.x,l=t.y}else a=t.x,l=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let r,n,s,o,a=0;for(r=e.x,n=e.y;e.nextPoint();r=s,n=o){s=e.x,o=e.y;const l=this.getLength(r,n,s,o);if(l!==0){if(a+l>t){const u=(t-a)/l;return this.getCoord2D(r,n,s,o,u)}a+=l}}return null}offset(e,t,r,n,s){if(!e||e.length<2)return null;let o=0,a=e[o++],l=o;for(;o=0==t<=0){if(I<1){const R=[v[0]-w[0],v[1]-w[1]];this.normalize(R);const L=Math.sqrt((1+I)/2);if(L>1/n){const k=-Math.abs(t)/L;c.push([h[0]-R[0]*k,h[1]-R[1]*k])}}}else switch(r){case xP.Mitered:{const R=Math.sqrt((1+I)/2);if(R>0&&1/R0){const L=1/R;let k=L;for(let B=1;B0){const s=Ec.createEmptyOptimizedCIM(e.geometryType),o=oae(e)[0],a=this._curveHelper.offset(o,this._size,xP.Rounded,4,this._offsetFlattenError);if(a)return s.pushPath(a),s}else if(this._size<0){const s=e.asJSON();if(Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._size>0)return Ec.fromJSONCIM({xmin:s.xmin-this._size,xmax:s.xmax+this._size,ymin:s.ymin-this._size,ymax:s.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const r=this._tileKey?_Je(e,this._maxInflateSize):e;if(!r)continue;const n=t.buffer(Xi.WebMercator,r.asJSON(),this._size,1);return n?Ec.fromJSONCIM(n):null}return null}},yGt=class gee{static local(){return gee.instance===null&&(gee.instance=new gee),gee.instance}execute(e,t,r,n,s){return new lWr(e,t,r)}};yGt.instance=null;let lWr=class{constructor(e,t,r){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=r,this._rule=t.rule??Gl.FullGeometry,this._defaultSize=this._defaultPointSize*r}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(oae(e));if(t&&t.length)return Ec.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,r,n){return[e[0]*t+r[0]*n,e[1]*t+r[1]*n]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,r){return[e[0]+t,e[1]+r]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const r=t/this._norm(e);e[0]*=r,e[1]*=r}_leftPerpendicular(e){const t=-e[1],r=e[0];e[0]=t,e[1]=r}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],r=-e[0];e[0]=t,e[1]=r}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,r){const n=e[0]*t-e[1]*r,s=e[0]*r+e[1]*t;e[0]=n,e[1]=s}_makeCtrlPt(e){const t=[e[0],e[1]];return ZOe(t,1),t}_addAngledTicks(e,t,r,n){const s=this._sub(r,t);this._normalize(s);const o=this._crossProduct(s,this._sub(n,t));let a;a=o>0?this._rightPerp(s):this._leftPerp(s);const l=Math.abs(o)/2,u=[];u.push([t[0]+(a[0]-s[0])*l,t[1]+(a[1]-s[1])*l]),u.push(t),u.push(r),u.push([r[0]+(a[0]+s[0])*l,r[1]+(a[1]+s[1])*l]),e.push(u)}_addBezier2(e,t,r,n,s){if(s--==0)return void e.push(n);const o=this._mid(t,r),a=this._mid(r,n),l=this._mid(o,a);this._addBezier2(e,t,o,l,s),this._addBezier2(e,l,a,n,s)}_addBezier3(e,t,r,n,s,o){if(o--==0)return void e.push(s);const a=this._mid(t,r),l=this._mid(r,n),u=this._mid(n,s),c=this._mid(a,l),h=this._mid(l,u),p=this._mid(c,h);this._addBezier3(e,t,a,c,p,o),this._addBezier3(e,p,h,u,s,o)}_add90DegArc(e,t,r,n,s){const o=s??this._crossProduct(this._sub(r,t),this._sub(n,t))>0,a=this._mid(t,r),l=this._sub(a,t);o?this._leftPerpendicular(l):this._rightPerpendicular(l),a[0]+=l[0],a[1]+=l[1],this._addBezier3(e,t,this._mix(t,.33333,a,.66667),this._mix(r,.33333,a,.66667),r,4)}_addArrow(e,t,r){const n=t[0],s=t[1],o=t[t.length-1],a=this._sub(n,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s)),u=.5*l,c=this._leftPerp(a),h=[o[0]-c[0]*l,o[1]-c[1]*l],p=t.length-1,m=[];m.push(r?[-c[0],-c[1]]:c);let v=[-a[0],-a[1]];for(let w=1;w0;w--)e.push([t[w][0]+m[w][0]*u,t[w][1]+m[w][1]*u]);e.push([h[0]+m[0][0]*u,h[1]+m[0][1]*u]),e.push([h[0]+m[0][0]*l,h[1]+m[0][1]*l]),e.push(n),e.push([h[0]-m[0][0]*l,h[1]-m[0][1]*l]),e.push([h[0]-m[0][0]*u,h[1]-m[0][1]*u]);for(let w=1;w=2?e[1]:this._add2(e[0],t*this._defaultSize,r*this._defaultSize)}_cp3(e,t,r,n){if(e.length>=3)return e[2];const s=this._mix(e[0],1-r,t,r),o=this._sub(t,e[0]);return this._normalize(o),this._rightPerpendicular(o),[s[0]+o[0]*n*this._defaultSize,s[1]+o[1]*n*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],r=this._cp2(e,-4,0),n=this._sub(t,r);this._normalize(n);const s=this._rightPerp(n);return[t,r,[t[0]+(s[0]-n[0])*this._defaultSize,t[1]+(s[1]-n[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],r=this._cp2(e,-4,0);let n;if(e.length>=3)n=e[e.length-1];else{const s=this._sub(t,r);this._normalize(s);const o=this._rightPerp(s);n=[t[0]+(o[0]-s[0])*this._defaultSize,t[1]+(o[1]-s[1])*this._defaultSize]}return[r,n]}_processGeom(e){if(!e)return null;const t=[];for(const r of e){if(!r||r.length===0)continue;const n=r.length;let s=r[0];switch(this._rule){case Gl.PerpendicularFromFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=[];l.push(a),l.push(this._mid(s,o)),t.push(l);break}case Gl.ReversedFirstSegment:{const o=this._cp2(r,0,-1);t.push([o,s]);break}case Gl.PerpendicularToSecondSegment:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=[];l.push(this._mid(o,a)),l.push(s),t.push(l);break}case Gl.SecondSegmentWithTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);let u;u=this._crossProduct(l,this._sub(s,o))>0?this._rightPerp(u):this._leftPerp(l);const c=[];c.push([o[0]+(u[0]-l[0])/3,o[1]+(u[1]-l[1])/3]),c.push(o),c.push(a),c.push([a[0]+(u[0]+l[0])/3,a[1]+(u[1]+l[1])/3]),t.push(c);break}case Gl.DoublePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push(s),h.push([a[0]+u[0]*c,a[1]+u[1]*c]),t.push(h);const p=[];p.push([a[0]-u[0]*c,a[1]-u[1]*c]),p.push(o),t.push(p);break}case Gl.OppositeToFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push([a[0]+u[0]*c,a[1]+u[1]*c]),h.push([a[0]-u[0]*c,a[1]-u[1]*c]),t.push(h);break}case Gl.TriplePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push([a[0]+u[0]*c*.8,a[1]+u[1]*c*.8]),h.push([l[0]+.8*(s[0]-l[0]),l[1]+.8*(s[1]-l[1])]),t.push(h),t.push([a,l]);const p=[];p.push([a[0]-u[0]*c*.8,a[1]-u[1]*c*.8]),p.push([l[0]+.8*(o[0]-l[0]),l[1]+.8*(o[1]-l[1])]),t.push(p);break}case Gl.HalfCircleFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o);let u=this._sub(o,s);const c=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),m=Math.sqrt((1-c)/2),v=[];let w;this._crossProduct(u,this._sub(a,s))>0?(v.push(s),u=this._sub(s,l),w=o):(v.push(o),u=this._sub(o,l),w=s),this._rotateDirect(u,p,m),u[0]/=p,u[1]/=p;for(let S=1;S<=18;S++)v.push(this._add(l,u)),this._rotateDirect(u,c,h);v.push(w),t.push(v);break}case Gl.HalfCircleSecondSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,1,-1);let l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o))/2;this._leftPerpendicular(l);const c=[o[0]+l[0]*u,o[1]+l[1]*u];l=this._sub(o,c);const h=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);u>0&&(p=-p);const m=[o];for(let v=1;v<=18;v++)this._rotateDirect(l,h,p),m.push(this._add(c,l));t.push(m);break}case Gl.HalfCircleExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-1);let l;if(n>=4)l=r[3];else{const v=this._sub(s,o);l=this._add(a,v)}const u=this._dist(o,a)/2/.75,c=this._sub(o,s);this._normalize(c,u);const h=this._sub(a,l);this._normalize(h,u);const p=[l,a];t.push(p);const m=[this._clone(a)];this._addBezier3(m,a,this._add(a,h),this._add(o,c),o,4),m.push(s),t.push(m);break}case Gl.OpenCircle:{const o=this._cp2(r,-2,0),a=this._sub(o,s),l=Math.cos(Math.PI/18),u=-Math.sin(Math.PI/18),c=[o];for(let h=1;h<=33;h++)this._rotateDirect(a,l,u),c.push(this._add(s,a));t.push(c);break}case Gl.CoverageEdgesWithTicks:{const o=this._cp2(r,0,-1);let a,l;if(n>=3)a=r[2];else{const p=this._sub(o,s),m=this._leftPerp(p);a=[s[0]+m[0]-.25*p[0],s[1]+m[1]-.25*p[1]]}if(n>=4)l=r[3];else{const p=this._mid(s,o),m=this._sub(s,o);this._normalize(m),this._leftPerpendicular(m);const v=this._crossProduct(m,this._sub(a,p));this._rightPerpendicular(m),l=[a[0]+m[0]*v*2,a[1]+m[1]*v*2]}const u=this._sub(o,s);let c,h;c=this._crossProduct(u,this._sub(a,s))>0?this._rightPerp(u):this._leftPerp(u),h=[],h.push(a),h.push(s),h.push([s[0]+(c[0]-u[0])/3,s[1]+(c[1]-u[1])/3]),t.push(h),c=this._crossProduct(u,this._sub(l,o))>0?this._rightPerp(c):this._leftPerp(u),h=[],h.push([o[0]+(c[0]+u[0])/3,o[1]+(c[1]+u[1])/3]),h.push(o),h.push(l),t.push(h);break}case Gl.GapExtentWithDoubleTicks:{const o=this._cp2(r,0,2),a=this._cp3(r,o,0,1);let l;if(n>=4)l=r[3];else{const u=this._sub(o,s);l=this._add(a,u)}this._addAngledTicks(t,s,o,this._mid(a,l)),this._addAngledTicks(t,a,l,this._mid(s,o));break}case Gl.GapExtentMidline:{const o=this._cp2(r,2,0),a=this._cp3(r,o,0,1);let l;if(n>=4)l=r[3];else{const c=this._sub(o,s);l=this._add(a,c)}const u=[];u.push(this._mid(s,a)),u.push(this._mid(o,l)),t.push(u);break}case Gl.Chevron:{const o=this._cp2(r,-1,-1);let a;if(n>=3)a=r[2];else{const l=this._sub(o,s);this._leftPerpendicular(l),a=this._add(s,l)}t.push([o,this._makeCtrlPt(s),a]);break}case Gl.PerpendicularWithArc:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,.5,-1);let l=this._sub(o,s);const u=this._norm(l);l[0]/=u,l[1]/=u;const c=this._crossProduct(l,this._sub(a,s));let h=this._dotProduct(l,this._sub(a,s));h<.05*u?h=.05*u:h>.95*u&&(h=.95*u);const p=[s[0]+l[0]*h,s[1]+l[1]*h];this._leftPerpendicular(l);let m=[];m.push([p[0]-l[0]*c,p[1]-l[1]*c]),m.push([p[0]+l[0]*c,p[1]+l[1]*c]),t.push(m);const v=[o[0]+l[0]*c,o[1]+l[1]*c];l=this._sub(o,v);const w=Math.cos(Math.PI/18);let S=Math.sin(Math.PI/18);c<0&&(S=-S),m=[s,o];for(let I=1;I<=9;I++)this._rotateDirect(l,w,S),m.push(this._add(v,l));t.push(m);break}case Gl.ClosedHalfCircle:{const o=this._cp2(r,2,0),a=this._mid(s,o),l=this._sub(o,a),u=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),h=[s,o];for(let p=1;p<=18;p++)this._rotateDirect(l,u,c),h.push(this._add(a,l));t.push(h);break}case Gl.TripleParallelExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-2),l=this._mid(s,o),u=this._sub(a,o);this._normalize(u);const c=Math.abs(this._crossProduct(u,this._sub(l,o)))/2,h=this._dist(o,a),p=[o,s];p.push([s[0]+u[0]*h*.5,s[1]+u[1]*h*.5]),t.push(p);const m=[];m.push([l[0]-u[0]*c,l[1]-u[1]*c]),m.push([l[0]+u[0]*h*.375,l[1]+u[1]*h*.375]),ZOe(m[m.length-1],1),m.push([l[0]+u[0]*h*.75,l[1]+u[1]*h*.75]),t.push(m);const v=[o,a];t.push(v);break}case Gl.ParallelWithTicks:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(a,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l),this._addAngledTicks(t,s,o,a),this._addAngledTicks(t,this._mix(s,1,l,u),this._mix(o,1,l,u),this._mid(s,o));break}case Gl.Parallel:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._leftPerp(l),c=this._crossProduct(l,this._sub(a,s));let h=[s,o];t.push(h),h=[],h.push([s[0]+u[0]*c,s[1]+u[1]*c]),h.push([o[0]+u[0]*c,o[1]+u[1]*c]),t.push(h);break}case Gl.PerpendicularToFirstSegment:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._mid(s,o),u=this._sub(o,s);this._normalize(u);const c=this._crossProduct(u,this._sub(a,s));this._leftPerpendicular(u);const h=[];h.push([l[0]-u[0]*c*.25,l[1]-u[1]*c*.25]),h.push([l[0]+u[0]*c*1.25,l[1]+u[1]*c*1.25]),t.push(h);break}case Gl.ParallelOffset:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]-l[0]*u,s[1]-l[1]*u]),c.push([o[0]-l[0]*u,o[1]-l[1]*u]),t.push(c);const h=[];h.push([s[0]+l[0]*u,s[1]+l[1]*u]),h.push([o[0]+l[0]*u,o[1]+l[1]*u]),t.push(h);break}case Gl.OffsetOpposite:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]-l[0]*u,s[1]-l[1]*u]),c.push([o[0]-l[0]*u,o[1]-l[1]*u]),t.push(c);break}case Gl.OffsetSame:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]+l[0]*u,s[1]+l[1]*u]),c.push([o[0]+l[0]*u,o[1]+l[1]*u]),t.push(c);break}case Gl.CircleWithArc:{let o=this._cp2(r,3,0);const a=this._cp3(r,o,.5,-1);let l,u;if(n>=4)l=r[3],u=this._crossProduct(this._sub(l,o),this._sub(a,o))>0;else{l=o,u=this._crossProduct(this._sub(l,s),this._sub(a,s))>0;const v=24*this._geomUnitsPerPoint,w=this._sub(l,s);this._normalize(w,v);const S=Math.sqrt(2)/2;this._rotateDirect(w,S,u?S:-S),o=this._add(s,w)}const c=this._sub(o,s),h=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),m=[o];for(let v=1;v<=36;v++)this._rotateDirect(c,h,p),m.push(this._add(s,c));this._add90DegArc(m,o,l,a,u),ZOe(m[m.length-8],1),t.push(m);break}case Gl.DoubleJog:{let o,a,l=this._cp2(r,-3,1);if(o=n>=3?r[2]:this._add(s,this._sub(s,l)),n>=4)a=r[3];else{const I=s;s=l,a=o;const R=this._dist(s,I),L=this._dist(a,I);let k=30*this._geomUnitsPerPoint;.5*R0?this._rotateDirect(w,v,-v):this._rotateDirect(w,v,v);let S=[];S.push(l),S.push(this._add(u,w)),S.push(this._sub(u,w)),S.push(s),t.push(S),w=this._sub(a,o),this._normalize(w,m),this._crossProduct(w,this._sub(s,o))<0?this._rotateDirect(w,v,v):this._rotateDirect(w,v,-v),S=[],S.push(o),S.push(this._add(c,w)),S.push(this._sub(c,w)),S.push(a),t.push(S);break}case Gl.PerpendicularOffset:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);this._crossProduct(l,this._sub(s,o))>0?this._rightPerpendicular(l):this._leftPerpendicular(l);const u=[l[0]/8,l[1]/8],c=this._sub(this._mid(o,a),u);t.push([c,s]);break}case Gl.LineExcludingLastSegment:{const o=this._arrowPath(r),a=[];let l=o.length-2;for(;l--;)a.push(o[l]);t.push(a);break}case Gl.MultivertexArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!1),t.push(a);break}case Gl.CrossedArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!0),t.push(a);break}case Gl.ChevronArrow:{const[o,a]=this._arrowLastSeg(r),l=10*this._geomUnitsPerPoint,u=this._sub(s,o);this._normalize(u);const c=this._crossProduct(u,this._sub(a,o)),h=this._leftPerp(u),p=[a[0]-h[0]*c*2,a[1]-h[1]*c*2],m=[];m.push([a[0]+u[0]*l,a[1]+u[1]*l]),m.push(s),m.push([p[0]+u[0]*l,p[1]+u[1]*l]),t.push(m);break}case Gl.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const c=[a[0]-l[0]*u,a[1]-l[1]*u],h=[];h.push([c[0]+l[0]*u*.5,c[1]+l[1]*u*.5]),h.push(this._mid(c,s)),h.push([c[0]-l[0]*u*.5,c[1]-l[1]*u*.5]),t.push(h);break}case Gl.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const c=[a[0]-l[0]*u,a[1]-l[1]*u];t.push([o,c]);break}case Gl.Arch:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=this._sub(s,o),u=this._mix(a,1,l,.55),c=this._mix(a,1,l,-.55),h=[s];this._addBezier2(h,s,u,a,4),this._addBezier2(h,a,c,o,4),t.push(h);break}case Gl.CurvedParallelTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);this._crossProduct(l,this._sub(s,o))>0?this._rightPerpendicular(l):this._leftPerpendicular(l);const u=[l[0]/8,l[1]/8],c=this._sub(this._mid(o,a),u),h=this._sub(this._mix(o,.75,a,.25),u),p=this._sub(this._mix(o,.25,a,.75),u),m=[o];this._addBezier2(m,o,h,c,3),this._addBezier2(m,c,p,a,3),t.push(m);for(let v=0;v<8;v++){const w=m[2*v+1],S=[this._clone(w)];S.push(this._add(w,[l[0]/4,l[1]/4])),t.push(S)}break}case Gl.Arc90Degrees:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=[o];this._add90DegArc(l,o,s,a),t.push(l);break}case Gl.FullGeometry:default:t.push(r)}}return t}},vGt=class yee{static local(){return yee.instance===null&&(yee.instance=new yee),yee.instance}execute(e,t,r,n,s){return new uWr(e,t,r)}};vGt.instance=null;let uWr=class extends cCe{constructor(e,t,r){super(e,!0,!0),this._curveHelper=new qR,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*r,this._endCut=(t.endCut!==void 0?t.endCut:1)*r,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*r,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:r,_middleCut:n}=this,s=e.pathLength(),o=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||r!==0||n!==0)if(t+r+n>=s)for(o.startPath();e.nextPoint();)o.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(o,e,0,t),this._curveHelper.appendSubCurve(o,e,.5*(s-n),.5*(s+n)),this._curveHelper.appendSubCurve(o,e,s-r,r)}else if(t===0&&r===0&&n===0)for(o.startPath();e.nextPoint();)o.pushXY(e.x,e.y);else t+r+n0&&(s/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(r){if(r.pathSize===0)if(s===0){const a=t.segment[0];r.pushXY(a[0],a[1])}else r.pushPoint(this.getSegCoord2D(t.segment,s));const o=t.segment[1];r.pushXY(o[0],o[1])}if(s=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==V5.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,n===V5.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,r){r.pathSize===0&&(s===0?r.pushPoint(t.segment[0]):r.pushPoint(this.getSegCoord2D(t.segment,s)));const o=t.abscissa/t.segmentLength;o===1?r.pushPoint(t.segment[1]):r.pushPoint(this.getSegCoord2D(t.segment,o))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(r=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(r),this._patternLength>0){const n=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,s=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let o=Math.round((this._partLength-(n+s))/this._patternLength);o<=0&&(o=n+s>0?0:1),this._partLengthRatio=this._partLength/(n+s+o*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)n-=t,t=this._pattern.nextValue(),o=!o;t-=n,o?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let r=this._walker.nextCurve(t);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}},bGt=class _ee{static local(){return _ee.instance===null&&(_ee.instance=new _ee),_ee.instance}execute(e,t,r,n,s,o){return new hWr(e,t,r,n,s,o)}};bGt.instance=null;let hWr=class{constructor(e,t,r,n,s,o){switch(this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._maxInflateSize=o*r,this._width=(t.width!==void 0?t.width:2)*r,t.method){case U6.Mitered:case U6.Bevelled:case U6.Rounded:case U6.TrueBuffer:case U6.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:Ec.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const r=this._tileKey?_Je(e,this._maxInflateSize):e.clone();if(!r)continue;const n=t.buffer(Xi.WebMercator,r.asJSON(),-this._width,1);if(n){for(const s of n.rings)if(s){r.startPath();for(const o of s.reverse())r.pushXY(o[0],r.yFactor*o[1])}}return r}}return null}},wGt=class bee{static local(){return bee.instance===null&&(bee.instance=new bee),bee.instance}execute(e,t,r,n,s){return new dWr(e,t,r)}};wGt.instance=null;let dWr=class extends cCe{constructor(e,t,r){super(e,!1,!0),this._curveHelper=new qR,this._length=(t.length!==void 0?t.length:20)*r,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const r=e.x,n=e.y;e.seekInPath(e.pathSize-1);const s=e.x,o=e.y,a=[s-r,o-n];this._curveHelper.normalize(a);const l=r+(s-r)*this._position/100,u=n+(o-n)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let h=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(h=-h),this._mirror=!this._mirror;const p=[l-this._length/2*c,u-this._length/2*h],m=[l+this._length/2*c,u+this._length/2*h];return t.pushPath([[r,n],p,m,[s,o]]),t}},xGt=class wee{static local(){return wee.instance===null&&(wee.instance=new wee),wee.instance}execute(e,t,r,n,s){return new pWr(e,t,r)}};xGt.instance=null;let pWr=class{constructor(e,t,r){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*r:0,this._offsetY=t.offsetY!==void 0?t.offsetY*r:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,r){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+r;return e.reset(),e}};const fWr=10;let SGt=class xee{static local(){return xee.instance===null&&(xee.instance=new xee),xee.instance}execute(e,t,r,n,s,o){return new mWr(e,t,r,n,s,o)}};SGt.instance=null;let mWr=class{constructor(e,t,r,n,s,o){this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._curveHelper=new qR,this._offset=(t.offset??1)*r,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(o*r),fWr),this._option=t.option,this._offsetFlattenError=Zse*r}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===xP.Rounded&&this._offset>0){const o=wF(e),a=this._curveHelper.offset(o,-this._offset,this._method,4,this._offsetFlattenError);if(a){const l=Ec.createEmptyOptimizedCIM(e.geometryType);return l.pushPath(a),l}return null}const s=e.asJSON();if(zd(s)&&Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._offset>0)return Ec.fromJSONCIM({xmin:s.xmin-this._offset,xmax:s.xmax+this._offset,ymin:s.ymin-this._offset,ymax:s.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const r=this._tileKey?_Je(e,this._maxInflateSize):e.clone();if(!r)continue;const n=t.offset(Xi.WebMercator,r.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return n?Ec.fromJSONCIM(n):null}return null}},TGt=class See{static local(){return See.instance===null&&(See.instance=new See),See.instance}execute(e,t,r,n,s){return new gWr(e,t,r)}};TGt.instance=null;let gWr=class{constructor(e,t,r){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return yWr(e.clone());e=this._inputGeometries.next()}return null}};function yWr(i){for(;i.nextPath();)for(let e=0;e0){const t=f2e(e),r=(t[2]+t[0])/2,n=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),r,n)}e=this._inputGeometries.next()}return null}_rotate(e,t,r){const n=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const o=e.x-t,a=e.y-r;e.x=t+o*n-a*s,e.y=r+o*s+a*n}return e.reset(),e}},EGt=class Cee{static local(){return Cee.instance===null&&(Cee.instance=new Cee),Cee.instance}execute(e,t,r,n,s){return new _Wr(e,t,r)}};EGt.instance=null;let _Wr=class{constructor(e,t,r){this._inputGeometries=e,this._xFactor=t.XScaleFactor!==void 0?t.XScaleFactor:1.15,this._yFactor=t.YScaleFactor!==void 0?t.YScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=f2e(e),r=(t[2]+t[0])/2,n=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),r,n)}}return null}_scaleCursor(e,t,r){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=r+(e.y-r)*this._yFactor;return e.reset(),e}},IGt=class Eee{static local(){return Eee.instance===null&&(Eee.instance=new Eee),Eee.instance}execute(e,t,r,n,s){return new bWr(e,t,r)}};IGt.instance=null;let bWr=class{constructor(e,t,r){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*r,this._period=(t.period!==void 0?t.period:3)*r,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new hCe,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new dCe,this._walker.updateTolerance(r)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=Ec.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const r=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case iV.Sinus:default:this._constructCurve(t,r,!1);break;case iV.Square:this._constructSquare(t,r);break;case iV.Triangle:this._constructTriangle(t,r);break;case iV.Random:this._constructCurve(t,r,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,r){let n=Math.round(t/this._period);n===0&&(n=1);const s=n*16+1,o=t/n,a=this._period/16,l=1/s,u=2*Math.PI*t/o,c=2*Math.PI*Math.random(),h=2*Math.PI*Math.random(),p=2*Math.PI*Math.random(),m=.75-Math.random()/2,v=.75-Math.random()/2,w=new qO;this._walker.curPointAndAngle(w),e.pushPoint(w.pt);let S=0;for(;;){if(!this._walker.nextPointAndAngle(a,w)){e.pushPoint(this._walker.getPathEnd());break}{const I=S;let R;if(S+=l,r){const L=this._height/2*(1+.3*Math.sin(m*u*I+c));R=L*Math.sin(u*I+h),R+=L*Math.sin(v*u*I+p),R/=2}else R=.5*this._height*Math.sin(.5*u*I);e.pushXY(w.pt[0]-R*w.sa,w.pt[1]+R*w.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let r=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new qO;this._walker.curPointAndAngle(s);const o=new qO;if(this._walker.nextPointAndAngle(this._period,o)){const a=new qO;this._walker.nextPointAndAngle(this._period,a)&&(r?(e.pushPoint(s.pt),r=!1):e.pushPoint(s.pt),e.pushXY(s.pt[0]-this._height/2*s.sa,s.pt[1]+this._height/2*s.ca),e.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),e.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca),n=!0)}}if(!n){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let r=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new qO;this._walker.curPointAndAngle(s);const o=new qO;if(this._walker.nextPointAndAngle(this._period/2,o)){const a=new qO;this._walker.nextPointAndAngle(this._period,a)&&(this._walker.nextPosition(this._period/2)&&(r?(e.pushPoint(s.pt),r=!1):e.pushPoint(s.pt),e.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),e.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca)),n=!0)}}if(!n){e.pushPoint(this._walker.getPathEnd());break}}}},AGt=class Iee{static local(){return Iee.instance===null&&(Iee.instance=new Iee),Iee.instance}execute(e,t,r,n,s){return new wWr(e,t,r)}};AGt.instance=null;let wWr=class extends Sle{constructor(e,t,r){super(e),this._geometryWalker=new dCe,this._geometryWalker.updateTolerance(r),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*r,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*r,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*r,this._pattern=new hCe,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(r),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===uC.WithFullGap&&this.isClosed?this._endings=uC.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,s=!0;switch(this._endings){case uC.NoConstraint:n=-this._position,n=this._adjustPosition(n),s=!1;break;case uC.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case uC.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case uC.WithMarkers:n=0;break;case uC.Custom:n=-this._position,n=this._adjustPosition(n),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,s))return null;this._pattern.reset();let o=0;for(;n>o;)n-=o,o=this._pattern.nextValue();o-=n,t=o,this.iteratePath=!0}const r=new qO;return this._geometryWalker.nextPointAndAngle(t,r)?this._endings===uC.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===uC.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(r.pt[0]-this._offset*r.sa,r.pt[1]+this._offset*r.ca),this._angleToLine&&this.internalPlacement.setRotateCS(r.ca,r.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},MGt=class Aee{static local(){return Aee.instance===null&&(Aee.instance=new Aee),Aee.instance}execute(e,t,r,n,s){return new xWr(e,t,r)}};MGt.instance=null;let xWr=class extends Sle{constructor(e,t,r){super(e,!1,!0),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*r:0,this._beginProcessed=!1}processPath(e){let t;switch(this._type){case Cb.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case Cb.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Cb.JustEnd:t=this._atExtremities(e,this._position,!1);case Cb.None:}return t}_atExtremities(e,t,r){if(r||e.seekPathEnd(),r?e.nextPoint():e.prevPoint()){let n=0,[s,o]=[0,0],[a,l]=[e.x,e.y];for(;r?e.nextPoint():e.prevPoint();){s=a,o=l,a=e.x,l=e.y;const u=this._curveHelper.getLength(s,o,a,l);if(n+u>t){const c=(t-n)/u,[h,p]=this._curveHelper.getAngleCS(s,o,a,l,c),m=this._curveHelper.getCoord2D(s,o,a,l,c);return this.internalPlacement.setTranslate(m[0]-this._offset*p,m[1]+this._offset*h),this._angleToLine&&this.internalPlacement.setRotateCS(-h,-p),this.internalPlacement}n+=u}}return null}},OGt=class Mee{static local(){return Mee.instance===null&&(Mee.instance=new Mee),Mee.instance}execute(e,t,r,n,s){return new SWr(e,t,r)}};OGt.instance=null;let SWr=class extends Sle{constructor(e,t,r){super(e),this._walker=new dCe,this._walker.updateTolerance(r),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*r:0,this._endGap=t.endPosition!==void 0?t.endPosition*r:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new hCe,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;t=l-this._prevPos,this._prevPos=l}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;t=l-this._prevPos,this._prevPos=l,this.iteratePath=!0}const r=new qO;if(!this._walker.nextPointAndAngle(t,r,V5.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(r.pt[0]-this._offset*r.sa,r.pt[1]+this._offset*r.ca);const n=this._isFirst&&this._flipFirst;let s,o;return this._angleToLine?(s=r.ca,o=r.sa):(s=1,o=0),n&&(s=-s,o=-o),this.internalPlacement.setRotateCS(s,o),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const RD=512,TWr=10,qE=24,bbe=1e-6;let PGt=class Oee{static local(){return Oee.instance===null&&(Oee.instance=new Oee),Oee.instance}execute(e,t,r,n,s){return new CWr(e,t,r,n,s)}};PGt.instance=null;let CWr=class _${constructor(e,t,r,n,s){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(t.stepX??16)*r,this._stepY=Math.abs(t.stepY??16)*r,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=t.gridType??_re.Fixed,this._gridType===_re.Random){const o=t.seed??13,a=1;this._randomLCG=new VC(o*a),this._randomness=(t.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=t.gridAngle??0,this._shiftOddRows=t.shiftOddRows??!1,this._offsetX=(t.offsetX??0)*r,this._offsetY=(t.offsetY??0)*r,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,l,u]=n.split("/"),c=parseFloat(o),h=parseFloat(a),p=parseFloat(l),m=parseFloat(u);this._graphicOriginX=-(m*2**c+p)*RD,this._graphicOriginY=h*RD,this._testInsidePolygon=!0}this._internalPlacement=new sX,this._calculateMinMax(e),this._geometryCursor=e}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!_$._randValues){_$._randValues=[];for(let e=0;e=R,this._polygonMin=this._verticalSubdivision?p:v,this._testInsidePolygon){let L=0-this._graphicOriginX-this._offsetX-this._stepX,k=RD-this._graphicOriginX-this._offsetX+this._stepX,B=-RD-this._graphicOriginY-this._offsetY-this._stepY,$=0-this._graphicOriginY-this._offsetY+this._stepY;if(S){const V=[[L,B],[L,$],[k,B],[k,$]];L=B=Number.MAX_VALUE,k=$=-Number.MAX_VALUE;for(const Y of V){const K=this._cosAngle*Y[0]-this._sinAngle*Y[1],Q=this._sinAngle*Y[0]+this._cosAngle*Y[1];L=Math.min(L,K),k=Math.max(k,K),B=Math.min(B,Q),$=Math.max($,Q)}}l=l!==Number.MAX_VALUE?Math.max(l,L):L,u=u!==Number.MAX_VALUE?Math.max(u,B):B,c=c!==-Number.MAX_VALUE?Math.min(c,k):k,h=h!==-Number.MAX_VALUE?Math.min(h,$):$}this._xMin=Math.round(l/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(u/this._stepY),this._yMax=Math.round(h/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(e,v,w,p,m)}_buildAccelerationMap(e,t,r,n,s){e.reset();const o=new Map,a=this._verticalSubdivision,l=a?s-n:r-t;let u=Math.ceil(l/TWr);if(u<=1)return;const c=Math.floor(l/u);let h,p,m,v,w,S,I,R,L,k,B;for(u++,this._delta=c,a?(L=-RD-2*this._stepY,k=2*this._stepY,B=n):(L=-2*this._stepX,k=RD+2*this._stepX,B=t);e.nextPath();)if(!(e.pathSize<2)&&e.nextPoint())for(h=e.x,p=e.y;e.nextPoint();h=m,p=v){if(m=e.x,v=e.y,a){if(p===v||pk&&v>k)continue;w=Math.min(p,v),S=Math.max(p,v)}else{if(h===m||hk&&m>k)continue;w=Math.min(h,m),S=Math.max(h,m)}for(;wI&&omt(R,h,p,m,v,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);const t=this._currentY*this._stepY+this._offsetY;let r,n;if(this._currentX++,this._gridType===_re.Random){const s=(this._currentX%qE+qE)%qE,o=(this._currentY%qE+qE)%qE;r=this._graphicOriginX+e+this._stepX*this._randomness*(.5-_$._randValues[o*qE+s])*2/3,n=this._graphicOriginY+t+this._stepY*this._randomness*(.5-_$._randValues[o*qE+s+1])*2/3}else r=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,n=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t;if(!this._testInsidePolygon||this._isInsidePolygon(r,n,this._geometryCursor))return this._internalPlacement.setTranslate(r,n),this._internalPlacement}}_isInsidePolygon(e,t,r){if(this._accelerationMap==null)return EWr(e,t,r);e+=bbe,t+=bbe;const n=this._verticalSubdivision,s=n?t:e,o=Math.floor((s-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let l,u,c,h=0;for(const p of a){if(l=p[0],u=p[1],n){if(l[1]>t==u[1]>t)continue;c=(u[0]-l[0])*(t-l[1])-(u[1]-l[1])*(e-l[0])}else{if(l[0]>e==u[0]>e)continue;c=(u[1]-l[1])*(e-l[0])-(u[0]-l[0])*(t-l[1])}c>0?h++:h--}return h!==0}};function EWr(i,e,t){let r,n,s,o,a=0;for(i+=bbe,e+=bbe,t.reset();t.nextPath();)if(t.nextPoint())for(r=t.x,n=t.y;t.nextPoint();r=s,n=o)s=t.x,o=t.y,n>e!=o>e&&((s-r)*(e-n)-(o-n)*(i-r)>0?a++:a--);return a!==0}function omt(i,e,t,r,n,s){let o=s.get(i);o||(o=[],s.set(i,o)),o.push([[e,t],[r,n]])}const IWr=.001;let RGt=class Pee{static local(){return Pee.instance===null&&(Pee.instance=new Pee),Pee.instance}execute(e,t,r,n,s){return new AWr(e,t,r)}};RGt.instance=null;let AWr=class extends Sle{constructor(e,t,r){super(e),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*r:0,this._epsilon=IWr*r}processPath(e){const t=this._position;if(this._relativeTo===z6.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[n,s]=[e.x,e.y],[o,a]=[0,0];for(;e.nextPoint();){o=e.x,a=e.y;const l=this._curveHelper.getLength(n,s,o,a);if(ln){const p=(n-o)/h,[m,v]=this._curveHelper.getAngleCS(a,l,u,c,p),w=this._curveHelper.getCoord2D(a,l,u,c,p),S=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(w[0]-S*v,w[1]+S*m),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-m,-v):this.internalPlacement.setRotateCS(m,v)),this.internalPlacement}a=u,l=c,o+=h}}return null}};const MWr=1e-15;let DGt=class Ree{static local(){return Ree.instance===null&&(Ree.instance=new Ree),Ree.instance}execute(e,t,r,n,s){return new OWr(e,t,r)}};DGt.instance=null;let OWr=class extends Sle{constructor(e,t,r){super(e),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let r=t[0],n=t[1];if(this._offset!==0){const s=Math.cos(t[2]),o=Math.sin(t[2]);r-=this._offset*o,n+=this._offset*s}return this.internalPlacement.setTranslate(r,n),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let r=0,n=!1,s=0,o=0;if(e.seekPathStart(),e.nextPoint()){let a=e.x,l=e.y,u=e.getControlPoint(),c=!0,h=e.nextPoint();for(;h;){const p=e.x,m=e.y,v=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(s=this._curveHelper.getAngle(a,l,p,m,0)),c?(c=!1,t?(r=s,n=u):(this._endPoints||this._controlPoints&&u)&&this._tags.push([a,l,s])):u?this._controlPoints&&this._tags.push([a,l,Fde(o,s)]):this._regularVertices&&this._tags.push([a,l,Fde(o,s)]),(this._angleToLine||this._offset!==0)&&(o=this._curveHelper.getAngle(a,l,p,m,1)),h=e.nextPoint(),h||(t?v||n?this._controlPoints&&this._tags.push([p,m,Fde(o,r)]):this._regularVertices&&this._tags.push([p,m,Fde(o,r)]):(this._endPoints||this._controlPoints&&v)&&this._tags.push([p,m,o])),a=p,l=m,u=v}}this._tagIterator=0}};function Fde(i,e){const t=Math.PI;for(;Math.abs(e-i)>t+2*MWr;)e-i>t?e-=2*t:e+=2*t;return(i+e)/2}const PWr=100*222045e-21;function FGt(i){if(i.totalSize===0)return null;const e=f2e(i);if(!e)return null;const t=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*PWr;let r=0,n=0;i.reset();for(let K=0;i.nextPath();K++){const Q=i.getCurrentRingArea();Q>n&&(n=Q,r=K)}if(i.seekPath(r),i.pathSize===0)return null;i.seekPathStart();const s=wIt(i);if(Math.abs(n)<=2*t*t)return[(s[0]+s[2])/2,(s[1]+s[3])/2];i.seekPathStart();const o=OXi(i,Wo());if(o===null)return null;if(i.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],u=[NaN,NaN,NaN,NaN];let c=!1,h=lK(o,i,!0);h.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],h=lK(o,i,!1)),l[0]=h.distance,u[0]=0;const p=[NaN,NaN];let m=!1,v=.25,w=-1,S=NaN;do if(S=NaN,a[1]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[1][0])||isNaN(a[1][1])||(h=lK(a[1],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[1],i))m=!0,l[1]=S,u[1]=b$(a[1],o);else if(!isNaN(S)&&S>w&&(w=S,p[0]=a[1][0],p[1]=a[1][1]),v-=.01,v<.1){if(!(w>=0))break;m=!0,l[1]=w,a[1][0]=p[0],a[1][1]=p[1],u[1]=b$(a[1],o)}while(!m);m=!1,v=.5,w=-1;let I=.01,R=1;do if(S=NaN,a[2]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[2][0])||isNaN(a[2][1])||(h=lK(a[2],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[2],i))m=!0,l[2]=S,u[2]=b$(a[2],o);else if(!isNaN(S)&&S>w)w=S,p[0]=a[2][0],p[1]=a[2][1];else if(S>w&&(w=S,p[0]=a[2][0],p[1]=a[2][1]),v=.5+I*R,I+=.01,R*=-1,v<.3||v>.7){if(!(w>=0))break;m=!0,l[2]=w,a[2][0]=p[0],a[2][1]=p[1],u[2]=b$(a[2],o)}while(!m);m=!1,v=.75,w=-1;do if(S=NaN,a[3]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[3][0])||isNaN(a[3][1])||(h=lK(a[3],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[3],i))m=!0,l[3]=S,u[3]=b$(a[3],o);else if(S>w&&(w=S,p[0]=a[3][0],p[1]=a[3][1]),v+=.01,v>.9){if(!(w>=0))break;m=!0,l[3]=w,a[3][0]=p[0],a[3][1]=p[1],u[3]=b$(a[3],o)}while(!m);const L=[0,1,2,3],k=c?0:1;let B;for(let K=k;K<4;K++)for(let Q=k;Q<3;Q++){const re=u[Q],ne=u[Q+1];FWr(re,ne)>0&&(B=L[Q],L[Q]=L[Q+1],L[Q+1]=B,u[Q]=ne,u[Q+1]=re)}let $=k,V=0,Y=0;for(let K=k;K<4;K++){switch(K){case 0:Y=2*l[L[K]];break;case 1:Y=1.66666666*l[L[K]];break;case 2:Y=1.33333333*l[L[K]];break;case 3:Y=l[L[K]]}Y>V&&(V=Y,$=L[K])}return a[$]}function Xge(i,e){let t,r,n,s,o=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(t=e.x,r=e.y;e.nextPoint();t=n,r=s)n=e.x,s=e.y,r>i[1]!=s>i[1]&&((n-t)*(i[1]-r)-(s-r)*(i[0]-t)>0?o++:o--);return o!==0}function lK(i,e,t){if(t&&Xge(i,e))return{coord:i,distance:0};let r=1/0,n=0,s=0,o=[0,0],a=[0,0];const l=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(o[0]=e.x,o[1]=e.y;e.nextPoint();o=a){a=[e.x,e.y],sIt(l,i,o,a);const u=b$(i,l);uo?wh)r&amt?(r&kde?(e[1]+=h*(s-e[0])/c,e[0]=s):(e[1]+=h*(a-e[0])/c,e[0]=a),r=YE(e,i)):n&amt?(n&kde?(t[1]+=h*(s-t[0])/c,t[0]=s):(t[1]+=h*(a-t[0])/c,t[0]=a),n=YE(t,i)):r?(r&Lde?(e[0]+=c*(o-e[1])/h,e[1]=o):(e[0]+=c*(l-e[1])/h,e[1]=l),r=YE(e,i)):(n&Lde?(t[0]+=c*(o-t[1])/h,t[1]=o):(t[0]+=c*(l-t[1])/h,t[1]=l),n=YE(t,i));else if(r&lmt?(r&Lde?(e[0]+=c*(o-e[1])/h,e[1]=o):(e[0]+=c*(l-e[1])/h,e[1]=l),r=YE(e,i)):n&lmt?(n&Lde?(t[0]+=c*(o-t[1])/h,t[1]=o):(t[0]+=c*(l-t[1])/h,t[1]=l),n=YE(t,i)):r?(r&kde?(e[1]+=h*(s-e[0])/c,e[0]=s):(e[1]+=h*(a-e[0])/c,e[0]=a),r=YE(e,i)):(n&kde?(t[1]+=h*(s-t[0])/c,t[0]=s):(t[1]+=h*(a-t[0])/c,t[0]=a),n=YE(t,i)),r&n)return 0}while(r|n);return u}function YE(i,e){return(i[0]e[2]?1:0)<<1|(i[1]e[3]?1:0)<<3}function tPe(i,e,t){return i+(e-i)*t}function b$(i,e){return(i[0]-e[0])*(i[0]-e[0])+(i[1]-e[1])*(i[1]-e[1])}function FWr(i,e){if(ie)return 1;if(i===e)return 0;const t=isNaN(i),r=isNaN(e);return tr?1:0}let kGt=class Dee{static local(){return Dee.instance===null&&(Dee.instance=new Dee),Dee.instance}execute(e,t,r,n,s){return new kWr(e,t,r)}};kGt.instance=null;let kWr=class{constructor(e,t,r){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*r:0,this._offsetY=t.offsetY!==void 0?t.offsetY*r:0,this._method=t.method!==void 0?t.method:rV.OnPolygon,this._internalPlacement=new sX}next(){const e=this._geometryCursor;return this._geometryCursor=null,e?this._polygonCenter(e):null}_polygonCenter(e){let t=!1;switch(this._method){case rV.CenterOfMass:{const r=kXi(e);r&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),t=!0)}break;case rV.BoundingBoxCenter:{const r=f2e(e);r&&(this._internalPlacement.setTranslate((r[2]+r[0])/2+this._offsetX,(r[3]+r[1])/2+this._offsetY),t=!0)}break;case rV.OnPolygon:default:{const r=FGt(e);r!==null&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function W8e(i){if(!i)return null;switch(i.type){case"CIMGeometricEffectAddControlPoints":return fGt.local();case"CIMGeometricEffectArrow":return mGt.local();case"CIMGeometricEffectBuffer":return gGt.local();case"CIMGeometricEffectControlMeasureLine":return yGt.local();case"CIMGeometricEffectCut":return vGt.local();case"CIMGeometricEffectDashes":return _Gt.local();case"CIMGeometricEffectDonut":return bGt.local();case"CIMGeometricEffectJog":return wGt.local();case"CIMGeometricEffectMove":return xGt.local();case"CIMGeometricEffectOffset":return SGt.local();case"CIMGeometricEffectReverse":return TGt.local();case"CIMGeometricEffectRotate":return CGt.local();case"CIMGeometricEffectScale":return EGt.local();case"CIMGeometricEffectWave":return IGt.local()}return null}function LGt(i){if(!i)return null;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":return AGt.local();case"CIMMarkerPlacementAtExtremities":return MGt.local();case"CIMMarkerPlacementAtRatioPositions":return OGt.local();case"CIMMarkerPlacementInsidePolygon":return PGt.local();case"CIMMarkerPlacementOnLine":return RGt.local();case"CIMMarkerPlacementOnVertices":return DGt.local();case"CIMMarkerPlacementPolygonCenter":return kGt.local()}return null}const Nde=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],Sq=["آ","أ","إ","ا"],LWr=["ﻵ","ﻷ","ﻹ","ﻻ"],NWr=["ﻶ","ﻸ","ﻺ","ﻼ"],wbe=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],$Wr=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],BWr=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],jWr=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],GWr=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],umt=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],UWr=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],cmt=["ء","ف"],zWr=["غ","ي"],VWr=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],HWr=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],Vt=0,Dr=1,oo=2,Bp=3,bt=4,iA=5,Jge=6,Tt=7,Z0=8,r1=9,_T=10,jo=11,qi=12,WWr=13,qWr=14,YWr=15,XWr=16,JWr=17,Cs=18,KWr=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],XI=100,ZWr=[XI+0,Vt,Vt,Vt,Vt,XI+1,XI+2,XI+3,Dr,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,XI+4,bt,bt,bt,Vt,bt,Vt,bt,Vt,bt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,XI+5,Tt,Tt,XI+6,XI+7],QWr=[[Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Jge,iA,Jge,Z0,iA,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,iA,iA,iA,Jge,Z0,bt,bt,jo,jo,jo,bt,bt,bt,bt,bt,_T,r1,_T,r1,r1,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,r1,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,Cs,Cs,Cs,Cs,Cs,Cs,iA,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,r1,bt,jo,jo,jo,jo,bt,bt,bt,bt,Vt,bt,bt,Cs,bt,bt,jo,jo,oo,oo,bt,Vt,bt,bt,bt,oo,Vt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Dr,qi,Dr,qi,qi,Dr,qi,qi,Dr,qi,bt,bt,bt,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt],[Bp,Bp,Bp,Bp,bt,bt,bt,bt,Tt,jo,jo,Tt,r1,Tt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Tt,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,jo,Bp,Bp,Tt,Tt,Tt,qi,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,Bp,bt,qi,qi,qi,qi,qi,qi,Tt,Tt,qi,qi,bt,qi,qi,qi,qi,Tt,Tt,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,Tt,Tt,Tt,Tt,Tt,Tt],[Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,Tt,Tt,qi,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Tt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,qi,qi,qi,qi,qi,qi,qi,qi,qi,Dr,Dr,bt,bt,bt,bt,Dr,bt,bt,bt,bt,bt],[Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Cs,Cs,Cs,Vt,Dr,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Z0,iA,WWr,qWr,YWr,XWr,JWr,r1,jo,jo,jo,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,r1,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Z0,Cs,Cs,Cs,Cs,Cs,bt,bt,bt,bt,bt,Cs,Cs,Cs,Cs,Cs,Cs,oo,Vt,bt,bt,oo,oo,oo,oo,oo,oo,_T,_T,bt,bt,bt,Vt,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,_T,_T,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,Dr,qi,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,_T,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,bt,Dr,Dr,Dr,Dr,Dr,bt,Dr,bt,Dr,Dr,bt,Dr,Dr,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt],[qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,r1,bt,r1,bt,bt,r1,bt,bt,bt,bt,bt,bt,bt,bt,bt,jo,bt,bt,_T,_T,bt,bt,bt,bt,bt,jo,jo,bt,bt,bt,bt,bt,Tt,Tt,Tt,Tt,Tt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,bt,Cs],[bt,bt,bt,jo,jo,jo,bt,bt,bt,bt,bt,_T,r1,_T,r1,r1,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,r1,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,bt,bt,bt,jo,jo,bt,bt,bt,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt]];let NGt=class{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(e,t,r){if(this.sourceToTarget=[],this.targetToSource=[],!e)return"";if(gqr(this.sourceToTarget,this.targetToSource,e.length),!this.checkParameters(t,r))return e;t=this.inputFormat,r=this.outputFormat;let n=e;const s=vqr,o=pmt(t.charAt(1)),a=pmt(r.charAt(1)),l=(t.charAt(0)==="I"?"L":t.charAt(0))+o,u=(r.charAt(0)==="I"?"L":r.charAt(0))+a,c=t.charAt(2)+r.charAt(2);s.defInFormat=l,s.defOutFormat=u,s.defSwap=c;const h=Fee(e,l,u,c,s);let p=!1;return r.charAt(1)==="R"?p=!0:r.charAt(1)!=="C"&&r.charAt(1)!=="D"||(p=this.checkContextual(h)==="rtl"),this.sourceToTarget=ux,this.targetToSource=yqr(this.sourceToTarget),Sbe=this.targetToSource,n=t.charAt(3)===r.charAt(3)?h:r.charAt(3)==="S"?tqr(p,h):nqr(h,p,!0),this.sourceToTarget=ux,this.targetToSource=Sbe,this.levels=pCe,n}_inputFormatSetter(e){if(!fmt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=e}_outputFormatSetter(e){if(!fmt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=e}checkParameters(e,t){return e?this._inputFormatSetter(e):e=this.inputFormat,t?this._outputFormatSetter(t):t=this.outputFormat,e!==t}checkContextual(e){let t=xbe(e);if(t!=="ltr"&&t!=="rtl"){try{t=document.dir.toLowerCase()}catch{}t!=="ltr"&&t!=="rtl"&&(t="ltr")}return t}hasBidiChar(e){return wqr.test(e)}};function Fee(i,e,t,r,n){const s=eqr(i,{inFormat:e,outFormat:t,swap:r},n);if(s.inFormat===s.outFormat)return i;e=s.inFormat,t=s.outFormat,r=s.swap;const o=e.substring(0,1),a=e.substring(1,4),l=t.substring(0,1),u=t.substring(1,4);if(n.inFormat=e,n.outFormat=t,n.swap=r,o==="L"&&t==="VLTR"){if(a==="LTR")return n.dir=Lj,DD(i,n);if(a==="RTL")return n.dir=kee,DD(i,n)}if(o==="V"&&l==="V")return n.dir=a==="RTL"?kee:Lj,iPe(i,n);if(o==="L"&&t==="VRTL")return a==="LTR"?(n.dir=Lj,i=DD(i,n)):(n.dir=kee,i=DD(i,n)),iPe(i);if(e==="VLTR"&&t==="LLTR")return n.dir=Lj,DD(i,n);if(o==="V"&&l==="L"&&a!==u)return i=iPe(i),a==="RTL"?Fee(i,"LLTR","VLTR",r,n):Fee(i,"LRTL","VRTL",r,n);if(e==="VRTL"&&t==="LRTL")return Fee(i,"LRTL","VRTL",r,n);if(o==="L"&&l==="L"){const c=n.swap;return n.swap=c.substr(0,1)+"N",a==="RTL"?(n.dir=kee,i=DD(i,n),n.swap="N"+c.substr(1,2),n.dir=Lj,i=DD(i,n)):(n.dir=Lj,i=DD(i,n),n.swap="N"+c.substr(1,2),i=Fee(i,"VLTR","LRTL",n.swap,n)),i}return i}function eqr(i,e,t){if(e.inFormat===void 0&&(e.inFormat=t.defInFormat),e.outFormat===void 0&&(e.outFormat=t.defOutFormat),e.swap===void 0&&(e.swap=t.defSwap),e.inFormat===e.outFormat)return e;const r=e.inFormat.substring(0,1),n=e.outFormat.substring(0,1);let s,o=e.inFormat.substring(1,4),a=e.outFormat.substring(1,4);return o.charAt(0)==="C"&&(s=xbe(i),o=s==="ltr"||s==="rtl"?s.toUpperCase():e.inFormat.charAt(2)==="L"?"LTR":"RTL",e.inFormat=r+o),a.charAt(0)==="C"&&(s=xbe(i),s==="rtl"?a="RTL":s==="ltr"?(s=rqr(i),a=s.toUpperCase()):a=e.outFormat.charAt(2)==="L"?"LTR":"RTL",e.outFormat=n+a),e}function tqr(i,e,t){if(e.length===0)return"";i===void 0&&(i=!0);const r=(e=String(e)).split("");let n=0,s=1,o=r.length;i||(n=r.length-1,s=-1,o=1);const a=iqr(r,n,s,o);let l="";for(let u=0;u-1?(jGt(Sbe,u,!i,-1),ux.splice(u,1)):l+=r[u];return l}function iqr(i,e,t,r,n){let s=0;const o=[];let a=0;for(let l=e;l*t="ﹰ"&&n[s]<"\uFEFF"){const a=i.charCodeAt(s);n[s]>="ﻵ"&&n[s]<="ﻼ"?(e?(s>0&&t&&n[s-1]===" "?r=r.substring(0,r.length-1)+"ل":(r+="ل",o=!0),r+=Sq[(a-65269)/2]):(r+=Sq[(a-65269)/2],r+="ل",s+10)if(p===16){for(let v=o;v-1){for(let v=o;v=0&&i[s]===Z0;s--)e[s]=r.dir}}function oqr(i,e,t){if(t.hiLevel!==0&&t.swap.substr(0,1)!==t.swap.substr(1,2))for(let r=0;r>8];return t=cmt[e]&&i<=zWr[e])return!0;return!1}function hmt(i,e,t,r){for(;e*t=i){for(s=c+1;s=i;)s++;for(o=c,a=s-1;o(n.lastArabic=!1,Vt),UBAT_R:()=>(n.lastArabic=!1,Dr),UBAT_ON:()=>bt,UBAT_AN:()=>Bp,UBAT_EN:()=>n.lastArabic?Bp:oo,UBAT_AL:()=>(n.lastArabic=!0,n.hasUbatAl=!0,Dr),UBAT_WS:()=>bt,UBAT_CS:()=>{let o,a;return r<1||r+1>=e.length||(o=t[r-1])!==oo&&o!==Bp||(a=e[r+1])!==oo&&a!==Bp?bt:(n.lastArabic&&(a=Bp),a===o?a:bt)},UBAT_ES:()=>(r>0?t[r-1]:iA)===oo&&r+1{if(r>0&&t[r-1]===oo)return oo;if(n.lastArabic)return bt;let o=r+1;const a=e.length;for(;o{if(n.inFormat==="VLTR"){const o=e.length;let a=r+1;for(;a=1425&&l<=2303||l===64286,c=e[a];if(u&&(c===Dr||c===Tt))return Dr}}return r<1||e[r-1]===iA?bt:t[r-1]},UBAT_B:()=>(n.lastArabic=!0,n.hasUbatB=!0,n.dir),UBAT_S:()=>(n.hasUbatS=!0,bt),UBAT_LRE:()=>(n.lastArabic=!1,bt),UBAT_RLE:()=>(n.lastArabic=!1,bt),UBAT_LRO:()=>(n.lastArabic=!1,bt),UBAT_RLO:()=>(n.lastArabic=!1,bt),UBAT_PDF:()=>(n.lastArabic=!1,bt),UBAT_BN:()=>bt}[KWr[s]]()}function hqr(i){let e,t=0,r=Nde.length-1;for(;t<=r;)if(e=Math.floor((t+r)/2),iNde[e][0]))return Nde[e][1];t=e+1}return i}function dqr(i){for(let e=0;e="ً"&&i<="ٕ"}function pmt(i){return i==="L"?"LTR":i==="R"?"RTL":i==="C"?"CLR":i==="D"?"CRL":""}function fqr(i,e,t,r){for(;e*te||!t&&i[n]===e)&&(i[n]+=r)}let ux=[],Sbe=[],pCe=[];const vqr={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},_qr=5,bqr=6,Lj=0,kee=1,fmt=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,wqr=/[\u0591-\u06ff\ufb1d-\ufefc]/,nPe=new NGt;function GGt(i){if(i==null)return["",!1];if(!nPe.hasBidiChar(i))return[i,!1];let e;return e=nPe.checkContextual(i)==="rtl"?"IDNNN":"ICNNN",[nPe.bidiTransform(i,e,"VLYSN"),!0]}const UGt="arial-unicode-ms",mmt="woff2",gmt=new Map,xqr=new Set;let Sqr=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Tqr(i){const e=VGt(i),t=gmt.get(e);if(t)return t.promise;const r=new FontFace(i.family,`url('${Ho.fontsUrl}/woff2/${e}.${mmt}') format('${mmt}')`,{style:i.style,weight:i.weight}),n=document.fonts;if(n.has(r)&&r.status==="loading")return r.loaded;const s=r.load().then(()=>(n.add(r),r));return gmt.set(e,new Sqr(r,s)),xqr.add(r),s}function zGt(i){if(!i)return UGt;const e=i.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}function VGt(i){const e=Cqr(i)+Eqr(i);return zGt(i.family)+(e.length>0?e:"-regular")}function Cqr(i){if(!i.weight)return"";switch(i.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Eqr(i){if(!i.style)return"";switch(i.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let Iqr=class{applyColorSubstituition(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:r,height:n}=e,s=this._rasterizationCanvas,o=s.getContext("2d",{willReadFrequently:!0});e!==s&&(s.width=r,s.height=n,o.drawImage(e,0,0,r,n));const a=o.getImageData(0,0,r,n).data;if(t){for(const u of t)if(u&&u.oldColor&&u.oldColor.length===4&&u.newColor&&u.newColor.length===4){const[c,h,p,m]=u.oldColor,[v,w,S,I]=u.newColor;if(c===v&&h===w&&p===S&&m===I)continue;for(let R=0;R0;let L=this._lineThroughWidthOffset,k=0;if(a){n.save();const re=t.backgroundColor??[0,0,0,0],ne=t.borderLine?.color??[0,0,0,0],de=2*us(t.borderLine?.size??0);n.fillStyle=oPe(re),n.strokeStyle=oPe(ne),n.lineWidth=de,n.fillRect(0,0,r.width,r.height),n.strokeRect(0,0,r.width,r.height),n.restore()}R&&this._renderHalo(n,S,I,L,k,t),k+=I,L+=S;for(const re of this._textLines)R?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(re,L,k),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(re,L,k)):(n.fillStyle=this._fillStyle,n.fillText(re,L,k)),s&&s!=="none"&&this._renderDecoration(n,L,k,s,o),k+=m;n.restore();const B=this._renderedWidth+2*this._lineThroughWidthOffset,$=this._renderedHeight,V=n.getImageData(0,0,B,$),Y=new Uint8Array(V.data);if(t.premultiplyColors){let re;for(let ne=0;ne600)&&(r+=.3*e.measureText("w").width),r+=2*us(this._parameters.halo.size),Math.round(r)}_computeLineHeight(){let e=1.275*this._parameters.size;const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*us(this._parameters.halo.size))}_renderDecoration(e,t,r,n,s,o){const a=.9*this._lineHeight,l=s==="bold"?.06:s==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const u=e.textBaseline;if(n==="underline")switch(u){case"top":r+=a;break;case"middle":r+=a/2}else if(n==="line-through")switch(u){case"top":r+=a/1.5;break;case"middle":r+=a/3}const c=o?1.5*o:Math.ceil(a*l);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=c,e.moveTo(t-this._lineThroughWidthOffset,r),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,r),e.stroke(),e.restore()}};function Mqr(i,e){return i==="center"?.5*e:i==="right"?e:0}const Oqr=()=>di.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var pA,sS;function qGt(i){if(!i)return pA.Center;switch(i){case"Left":case"left":return pA.Left;case"Right":case"right":return pA.Right;case"Justify":return Oqr().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),pA.Center;case"Center":case"center":return pA.Center}}function YGt(i){if(!i)return sS.Center;switch(i){case"Top":case"top":return sS.Top;case"Center":case"middle":return sS.Center;case"Baseline":case"baseline":return sS.Baseline;case"Bottom":case"bottom":return sS.Bottom}}function Pqr(i){switch(i){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${i}`),["center","middle"]}}function Rqr(i){switch(i){case pA.Right:case"right":return-1;case pA.Center:case"center":return 0;case pA.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${i}`),0}}function Dqr(i){switch(i){case sS.Top:case"top":return 1;case sS.Center:case"middle":return 0;case sS.Bottom:case sS.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${i}`),0}}(function(i){i[i.Left=-1]="Left",i[i.Center=0]="Center",i[i.Right=1]="Right"})(pA||(pA={})),function(i){i[i.Top=1]="Top",i[i.Center=0]="Center",i[i.Bottom=-1]="Bottom",i[i.Baseline=2]="Baseline"}(sS||(sS={}));let _d=class{constructor(e=0,t=0,r=0,n=0){this.x=e,this.y=t,this.width=r,this.height=n}get isEmpty(){return this.width<=0||this.height<=0}union(e){this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.width=Math.max(this.width,e.width),this.height=Math.max(this.height,e.height)}},T8=class q8e{constructor(e,t,r,n){this.computedX=0,this.computedY=0,this.center=Xp(e,t),this.centerT=NW(),this.halfWidth=r/2,this.halfHeight=n/2,this.width=r,this.height=n}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(e){this.center[0]=e}set y(e){this.center[1]=e}clone(){return new q8e(this.x,this.y,this.width,this.height)}serialize(e){return e.writeF32(this.center[0]),e.writeF32(this.center[1]),e.push(this.width),e.push(this.height),e}findCollisionDelta(e,t=4){const r=Math.abs(e.centerT[0]-this.centerT[0]),n=Math.abs(e.centerT[1]-this.centerT[1]),s=(e.halfWidth+this.halfWidth+t)/r,o=(e.halfHeight+this.halfHeight+t)/n,a=Math.min(s,o);return Math.log2(a)}extend(e){const t=Math.min(this.xmin,e.xmin),r=Math.min(this.ymin,e.ymin),n=Math.max(this.xmax,e.xmax)-t,s=Math.max(this.ymax,e.ymax)-r,o=t+n/2,a=r+s/2;this.width=n,this.height=s,this.halfWidth=n/2,this.halfHeight=s/2,this.x=o,this.y=a}static deserialize(e){const t=e.readF32(),r=e.readF32(),n=e.readInt32(),s=e.readInt32();return new q8e(t,r,n,s)}};const wJe=22,XGt=4,Fqr=wJe+XGt,kqr=wJe-6,ymt=3,Lqr=Math.PI/180,FD=8,Nqr=1.5;let JGt=class{constructor(e,t,r,n){this._rotationT=SS(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const s=r.rect,o=new Float32Array(8);e*=n,t*=n;const a=r.code?s.width*n:r.metrics.width,l=r.code?s.height*n:r.metrics.height;this.width=a,this.height=l,o[0]=e,o[1]=t,o[2]=e+a,o[3]=t,o[4]=e,o[5]=t+l,o[6]=e+a,o[7]=t+l,this._data=o,this._setTextureCoords(s),this._scale=n,this._mosaic=r,this.x=e,this.y=t,this.maxOffset=Math.max(e+a,t+l)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,Nae(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,r=t*this._scale,n=Math.abs(e)*this._scale,s=new Float32Array(8);s[0]=this.x,s[1]=this.y,s[2]=this.x+r,s[3]=this.y,s[4]=this.x,s[5]=this.y+n,s[6]=this.x+r,s[7]=this.y+n;const o=FW(SS(),this._rotationT,this._transform);d5t(s,s,o);let a=1/0,l=1/0,u=0,c=0;for(let w=0;w<4;w++){const S=s[2*w],I=s[2*w+1];a=Math.min(a,S),l=Math.min(l,I),u=Math.max(u,S),c=Math.max(c,I)}const h=u-a,p=c-l,m=a+h/2,v=l+p/2;this._bounds=new T8(m,v,h,p)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=FW(SS(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],yf(this._offsets.topLeft,this._offsets.topLeft,e),yf(this._offsets.topRight,this._offsets.topRight,e),yf(this._offsets.bottomLeft,this._offsets.bottomLeft,e),yf(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:r,height:n}){this._texcoords={topLeft:[e,t],topRight:[e+r,t],bottomLeft:[e,t+n],bottomRight:[e+r,t+n]}}};const $qr=(i,e)=>({code:0,page:0,sdf:!0,rect:new _d(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:i,left:0,top:0}});function uK(i,e){return i.forEach(t=>yf(t,t,e)),{topLeft:i[0],topRight:i[1],bottomLeft:i[2],bottomRight:i[3]}}let Bqr=class{constructor(e,t,r){this._rotation=0,this._decorate(e,t,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=r.angle!==0,this._transform=this._createGlyphTransform(this.bounds,r),this._borderLineSizePx=r.borderLineSizePx,(r.borderLineSizePx||r.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of e)n.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,r=Nae(SS(),e);FW(t,r,t);for(const n of this.glyphs)n.setTransform(this._transform)}_decorate(e,t,r){if(!r.decoration||r.decoration==="none"||!e.length)return;const n=r.scale,s=r.decoration==="underline"?Fqr:kqr,o=e[0].textureBinding;for(const a of t){const l=a.startX*n,u=a.startY*n,c=(a.width+a.glyphWidthEnd)*n;e.push(new JGt(l,u+s*n,$qr(c,o),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,r=(Nqr+t)/2,n=this._borderLineSizePx?r:0,{xmin:s,ymin:o,xmax:a,ymax:l,x:u,y:c,width:h,height:p}=this.bounds,m=[s-FD,o-FD],v=[a+FD,o-FD],w=[s-FD,l+FD],S=[a+FD,l+FD],I=uK([[m[0]-r,m[1]-r],[v[0]+r,v[1]-r],[m[0]+n,m[1]+n],[v[0]-n,v[1]+n]],e),R=uK([[w[0]+n,w[1]-n],[S[0]-n,S[1]-n],[w[0]-r,w[1]+r],[S[0]+r,S[1]+r]],e),L=uK([[m[0]-r,m[1]-r],[m[0]+n,m[1]+n],[w[0]-r,w[1]+r],[w[0]+n,w[1]-n]],e),k=uK([[v[0]-n,v[1]+n],[v[0]+r,v[1]-r],[S[0]-n,S[1]-n],[S[0]+r,S[1]+r]],e),B={main:uK([m,v,w,S],e),top:I,bot:R,left:L,right:k};return[new T8(u,c,h+2*r,p+2*r),B]}get boundsT(){const e=this.bounds,t=dl(NW(),e.x,e.y);if(yf(t,t,this._transform),this._hasRotation){const r=Math.max(e.width,e.height);return new T8(t[0],t[1],r,r)}return new T8(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,r=1/0,n=0,s=0;for(const l of e)t=Math.min(t,l.xTopLeft),r=Math.min(r,l.yTopLeft),n=Math.max(n,l.xBottomRight),s=Math.max(s,l.yBottomRight);const o=n-t,a=s-r;return new T8(t+o/2,r+a/2,o,a)}_createGlyphTransform(e,t){const r=Lqr*t.angle,n=SS(),s=NW();return VA(n,n,dl(s,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?sk(n,n,r):(VA(n,n,dl(s,e.x,e.y)),sk(n,n,r),VA(n,n,dl(s,-e.x,-e.y))),n}},$de=class{constructor(e,t,r,n,s,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,r)),this.end=Math.max(0,Math.max(t,r)),this.endi===10,vmt=i=>i===32;function jqr(i,e,t){const r=new Array,n=1/t.scale,s=t.maxLineWidth*n,o=e?i.length-1:0,a=e?-1:i.length,l=e?-1:1;let u=o,c=0,h=0,p=u,m=p,v=0,w=1/0,S=0;for(;u!==a;){const{code:R,metrics:L}=i[u],k=Math.abs(L.top);if(Y8e(R)||vmt(R)||(w=Math.min(w,k),S=Math.max(S,k+L.height)),Y8e(R))u!==o&&(r.push(new $de(i,p,u-l,c,w,S)),w=1/0,S=0),c=0,p=u+l,m=u+l,h=0;else if(vmt(R))m=u+l,h=0,v=L.advance,c+=L.advance;else if(c>s){if(m!==p){const B=m-2*l;c-=v,r.push(new $de(i,p,B,c-h,w,S)),w=1/0,S=0,p=m,c=h}else r.push(new $de(i,p,u-l,c,w,S)),w=1/0,S=0,p=u,m=u,c=0;c+=L.advance,h+=L.advance}else c+=L.advance,h+=L.advance;u+=l}const I=new $de(i,p,u-l,c,w,S);return I.start>=0&&I.enddi.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let w$=class MI{constructor(e){this._t=e}static createIdentity(){return new MI([1,0,0,0,1,0])}clone(){const e=this._t;return new MI(e.slice())}transform(e){const t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]}static createScale(e,t){return new MI([e,0,0,0,t,0])}scale(e,t){const r=this._t;return r[0]*=e,r[1]*=e,r[2]*=e,r[3]*=t,r[4]*=t,r[5]*=t,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(e,t){return new MI([0,0,e,0,0,t])}translate(e,t){const r=this._t;return r[2]+=e,r[5]+=t,this}static createRotate(e){const t=Math.cos(e),r=Math.sin(e);return new MI([t,-r,0,r,t,0])}rotate(e){return MI.multiply(this,MI.createRotate(e),this)}angle(){const e=this._t[0],t=this._t[3],r=Math.sqrt(e*e+t*t);return[e/r,t/r]}static multiply(e,t,r){const n=e._t,s=t._t,o=n[0]*s[0]+n[3]*s[1],a=n[1]*s[0]+n[4]*s[1],l=n[2]*s[0]+n[5]*s[1]+s[2],u=n[0]*s[3]+n[3]*s[4],c=n[1]*s[3]+n[4]*s[4],h=n[2]*s[3]+n[5]*s[4]+s[5],p=r._t;return p[0]=o,p[1]=a,p[2]=l,p[3]=u,p[4]=c,p[5]=h,r}invert(){const e=this._t;let t=e[0]*e[4]-e[1]*e[3];if(t===0)return new MI([0,0,0,0,0,0]);t=1/t;const r=(e[1]*e[5]-e[2]*e[4])*t,n=(e[2]*e[3]-e[0]*e[5])*t,s=e[4]*t,o=-e[1]*t,a=-e[3]*t,l=e[0]*t;return new MI([s,o,r,a,l,n])}},SJe=class{constructor(e,t){this._resourceManager=e,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new G3(sX,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(t||w$.createIdentity()),this._sizeTransfos.push(t?t.scaleRatio():1)}setTransform(e,t){this._transfos=[e||w$.createIdentity()],this._sizeTransfos=[t||(e?e.scaleRatio():1)]}setGeomUnitsPerPoint(e){this._geomUnitsPerPoint=e}transformPt(e){return this._transfos[this._transfos.length-1].transform(e)}transformSize(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(e){return this._transfos[this._transfos.length-1].invert().transform(e)}reverseTransformSize(e){return e/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(e){return e/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(e,t){const r=t?e.scaleRatio():1;w$.multiply(e,this.back(),e),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(e,t,r){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,t);break;case"CIMTextSymbol":this.drawTextSymbol(e,t,r)}}drawMultiLayerSymbol(e,t){if(!e||!t)return;const r=e.symbolLayers;if(!r)return;const n=e.effects;if(n&&n.length>0){const s=this.executeEffects(n,t);if(s){let o=s.next();for(;o;)this.drawSymbolLayers(r,o.asJSON()),o=s.next()}}else this.drawSymbolLayers(r,t)}executeEffects(e,t){const r=this._resourceManager.geometryEngine;let n=new $8e(Ec.fromJSONCIM(t));for(const s of e){const o=W8e(s);o&&(n=o.execute(n,s,this.geomUnitsPerPoint(),null,r))}return n}drawSymbolLayers(e,t){let r=e.length;for(;r--;){const n=e[r];if(!n||n.enable===!1)continue;const s=n.effects;if(s&&s.length>0){const o=this.executeEffects(s,t);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,t);if(this._earlyReturn)return}}drawSymbolLayer(e,t){switch(e.type){case"CIMSolidFill":this.drawSolidFill(t,e.color);break;case"CIMHatchFill":this.drawHatchFill(t,e);break;case"CIMPictureFill":this.drawPictureFill(t,e);break;case"CIMGradientFill":this.drawGradientFill(t,e);break;case"CIMSolidStroke":this.drawSolidStroke(t,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(t,e);break;case"CIMGradientStroke":this.drawGradientStroke(t,e);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(e,t)}}drawHatchFill(e,t){const r=this._buildHatchPolyline(t,e,this.geomUnitsPerPoint());r&&(this.pushClipPath(e),this.drawMultiLayerSymbol(t.lineSymbol,r),this.popClipPath())}drawPictureFill(e,t){}drawGradientFill(e,t){}drawPictureStroke(e,t){}drawGradientStroke(e,t){}drawMarkerLayer(e,t){const r=e.markerPlacement;if(r){const n=LGt(r);if(n){const s=r.type==="CIMMarkerPlacementInsidePolygon"||r.type==="CIMMarkerPlacementPolygonCenter"&&r.clipAtBoundary;s&&this.pushClipPath(t);const o=n.execute(Ec.fromJSONCIM(t),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(e,a),!this._earlyReturn););}s&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(dR(t))n.tx=t.x,n.ty=t.y,this.drawMarker(e,n);else if(ed(t)){const s=p2e(t);s&&([n.tx,n.ty]=s,this.drawMarker(e,n))}else for(const s of t.points)if(n.tx=s[0],n.ty=s[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,t){switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(e,t);break;case"CIMVectorMarker":this.drawVectorMarker(e,t)}}drawPictureMarker(e,t){if(!e)return;const r=this._resourceManager.getResource(e.url),n=rs(e.size,ph.CIMPictureMarker.size);if(r==null||n<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const a=s/o,l=rs(e.scaleX,1),u=w$.createIdentity(),c=e.anchorPoint;if(c){let S=c.x,I=c.y;e.anchorPointUnits!=="Absolute"&&(S*=n*a*l,I*=n),u.translate(-S,-I)}let h=rs(e.rotation);e.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&u.rotate(h*iN);let p=rs(e.offsetX),m=rs(e.offsetY);if(p||m){if(this._mapRotation){const S=iN*this._mapRotation,I=Math.cos(S),R=Math.sin(S),L=p*R+m*I;p=p*I-m*R,m=L}u.translate(p,m)}const v=this.geomUnitsPerPoint();v!==1&&u.scale(v,v);const w=t.getAngle();w&&u.rotate(w),u.translate(t.tx,t.ty),this.push(u,!1),this.drawImage(e,n),this.pop()}drawVectorMarker(e,t){if(!e)return;const r=e.markerGraphics;if(!r)return;const n=rs(e.size,ph.CIMVectorMarker.size),s=e.frame,o=s?s.ymax-s.ymin:0,a=n&&o?n/o:1,l=w$.createIdentity();s&&l.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const u=e.anchorPoint;if(u){let w=u.x,S=u.y;e.anchorPointUnits!=="Absolute"?s&&(w*=s.xmax-s.xmin,S*=s.ymax-s.ymin):(w/=a,S/=a),l.translate(-w,-S)}a!==1&&l.scale(a,a);let c=rs(e.rotation);e.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*iN);let h=rs(e.offsetX),p=rs(e.offsetY);if(h||p){if(this._mapRotation){const w=iN*this._mapRotation,S=Math.cos(w),I=Math.sin(w),R=h*I+p*S;h=h*S-p*I,p=R}l.translate(h,p)}const m=this.geomUnitsPerPoint();m!==1&&l.scale(m,m);const v=t.getAngle();v&&l.rotate(v),l.translate(t.tx,t.ty),this.push(l,e.scaleSymbolsProportionally);for(const w of r){w?.symbol&&w.geometry||Uqr().error("Invalid marker graphic",w);let S=w.textString;if(typeof S=="number"&&(S=S.toString()),this.drawSymbol(w.symbol,w.geometry,S),this._earlyReturn)break}this.pop()}drawTextSymbol(e,t,r){if(!e||!dR(t)||rs(e.height,ph.CIMTextSymbol.height)<=0)return;const n=w$.createIdentity();let s=rs(e.angle);s=-s,s&&n.rotate(s*iN);const o=rs(e.offsetX),a=rs(e.offsetY);(o||a)&&n.translate(o,a);const l=this.geomUnitsPerPoint();l!==1&&n.scale(l,l),n.translate(t.x,t.y),this.push(n,!1),this.drawText(e,r),this.pop()}_buildHatchPolyline(e,t,r){let n=rs(e.separation,ph.CIMHatchFill.separation)*r,s=rs(e.rotation);if(n===0)return null;n<0&&(n=-n);let o=0;const a=.5*n;for(;o>a;)o-=n;for(;o<-a;)o+=n;const l=Wo();gY(l,t),l[0]-=a,l[1]-=a,l[2]+=a,l[3]+=a;const u=[[l[0],l[1]],[l[0],l[3]],[l[2],l[3]],[l[2],l[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*iN),h=Math.sin(s*iN),p=-n*h,m=n*c;let v,w,S,I;o=rs(e.offsetX)*r*h-rs(e.offsetY)*r*c,v=S=Number.MAX_VALUE,w=I=-Number.MAX_VALUE;for(const Y of u){const K=Y[0],Q=Y[1],re=c*K+h*Q,ne=-h*K+c*Q;v=Math.min(v,re),S=Math.min(S,ne),w=Math.max(w,re),I=Math.max(I,ne)}S=Math.floor(S/n)*n;let R=c*v-h*S-p*o/n,L=h*v+c*S-m*o/n,k=c*w-h*S-p*o/n,B=h*w+c*S-m*o/n;const $=1+Math.round((I-S)/n),V=[];for(let Y=0;Y<$;Y++)R+=p,L+=m,k+=p,B+=m,V.push([[R,L],[k,B]]);return{paths:V}}},zqr=class extends SJe{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new bJe(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return cW(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(ed(e))this._processPath(e.rings,0);else if(e0(e))this._processPath(e.paths,0);else if(zd(e)){const t=V6(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,r){if(!e||this._clipCount>0||r==null||r<=0)return;const n=Math.max(.5*this.transformSize(rs(r,ph.CIMSolidStroke.width)),.5*KGt);if(ed(e))this._processPath(e.rings,n);else if(e0(e))this._processPath(e.paths,n);else if(zd(e)){const s=V6(e);s&&this._processPath(s.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){ed(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:r}=e,n=rs(e.scaleX,1);let s=n*t,o=t;const a=this._resourceManager.getResource(r);if(a!=null){const l=a.height/a.width;s=n*(t?l>1?t:t/l:a.width),o=t?l>1?t*l:t:a.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new WGt);const r=QGt(e);let[n,s]=this._textRasterizer.computeTextSize(t,r);n=uy(n),s=uy(s);let o=0;switch(e.horizontalAlignment){case"Left":o=n/2;break;case"Right":o=-n/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=s/2;break;case"Top":a=-s/2;break;case"Baseline":a=s/6}this._merge(this.transformPt([-n/2+o,-s/2+a]),0),this._merge(this.transformPt([-n/2+o,s/2+a]),0),this._merge(this.transformPt([n/2+o,-s/2+a]),0),this._merge(this.transformPt([n/2+o,s/2+a]),0)}_processPath(e,t){if(e)for(const r of e){const n=r?r.length:0;if(n>1){this._merge(this.transformPt(r[0]),t);for(let s=1;sthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Vqr=class extends SJe{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(e,t,r,n,s,o){const a=o*us(1);this.setTransform(),this.setGeomUnitsPerPoint(a),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/a,this._textInfo=n;const l=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=l?s:0,!yi("esri-mobile")){const u=uy(yi("hittest-2d-small-symbol-tolerance")*window.devicePixelRatio),c=uy(yi("hittest-2d-small-symbol-tolerance-threshold"));!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(iir))&&t?.type!=="CIMMeshSymbol"&&(PMt(t)??0)v.xTopLeft&&p-v.yBottomRight&&m<-v.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(zd(e)){const n=e;t=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(ed(e))t=e.rings;else{if(!e0(e))return;t=e.paths}const r=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(r,t)&&(this._earlyReturn=!0),!this._earlyReturn){const n=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(r,t,n)&&(this._earlyReturn=!0)}}_hitTestStroke(e,t){let r=null;if(zd(e)){const a=e;r=[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]}else if(ed(e))r=e.rings;else{if(!e0(e))return;r=e.paths}const n=this.reverseTransformPt(this._searchPoint),s=rs(t,ph.CIMSolidStroke.width)*this.geomUnitsPerPoint(),o=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(n,r,s/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(e,t){let r=0;for(const n of t){const s=n.length;for(let o=1;oe[1]!=l[1]>e[1]&&((l[0]-a[0])*(e[1]-a[1])-(l[1]-a[1])*(e[0]-a[0])>0?r++:r--)}}return r!==0}_nearLine(e,t,r){for(const n of t){const s=n.length;for(let o=1;o-r&&h1){let o=this.transformPt(n[0]);r.moveTo(o[0],o[1]);for(let a=1;ai?{spatialReference:i.spatialReference,rings:[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}:null,ZGt=(i,e,t)=>{switch(i){case"ExtraLeading":return 1+e/t;case"Multiple":return e;case"Exact":return e/t}};function QGt(i,e=1){const t=yVe(i),r=gVe(i.fontStyleName),n=i.fontFamilyName??UGt,{weight:s,style:o}=r,a=e*(i.height||5),l=EMt(i.horizontalAlignment),u=IMt(i.verticalAlignment),c=gP(i),h=gP(i.haloSymbol),p=h!=null?e*(i.haloSize??0):0,m=i.callout?.type==="CIMBackgroundCallout"?i.callout.backgroundSymbol:null,v=gP(m),w=kne(m),S=BV(m);return{color:c,size:a,horizontalAlignment:l,verticalAlignment:u,font:{family:n,style:sir(o),weight:oir(s),decoration:t},halo:{size:p||0,color:h,style:o},backgroundColor:v,borderLine:w!=null&&S!=null?{size:w,color:S}:null,pixelRatio:1,premultiplyColors:!0}}const qqr=1e-4;function Yqr(i){let e,t,r,n,s,o=i[0],a=1;for(;a=0?i:i+e}function eUt(i){return Tbe(i*Xqr,256)}function Zqr(i){return Tbe(i*Jqr,256)}function kD(i){return Math.log(i)*Kqr}function tg(i,e,t){return i*(1-t)+e*t}const Qqr=8,eYr=14,tYr=16;function tUt(i){return Qqr+Math.max((i-eYr)*tYr,0)}function iYr(i,e,t){let r,n,s,o=0;for(const a of t){r=a.length;for(let l=1;le!=s.y>e&&((s.x-n.x)*(e-n.y)-(s.y-n.y)*(i-n.x)>0?o++:o--)}return o!==0}function iUt(i,e,t,r){let n,s,o,a;const l=r*r;for(const u of t){const c=u.length;if(!(c<2)){n=u[0].x,s=u[0].y;for(let h=1;hdi.getLogger("esri.symbols.cim.CIMSymbolHelper");function oYr(i){let e;switch(i.type){case"cim":return i.data;case"web-style":return i;case"simple-marker":{const t=ym.fromSimpleMarker(i);if(!t)throw new Error("InternalError: Cannot convert symbol to CIM");e=t;break}case"picture-marker":e=ym.fromPictureMarker(i);break;case"simple-line":e=ym.fromSimpleLineSymbol(i);break;case"simple-fill":e=ym.fromSimpleFillSymbol(i);break;case"picture-fill":e=ym.fromPictureFillSymbol(i);break;case"text":e=ym.fromTextSymbol(i)}return{type:"CIMSymbolReference",symbol:e}}function Kge(i,e,t){switch(e.type){case"CIMSymbolReference":return Kge(i,e.symbol,t);case"CIMPointSymbol":t==null&&(t={x:0,y:0}),i.drawSymbol(e,t);break;case"CIMLineSymbol":t==null&&(t={paths:[[[0,0],[10,0]]]}),i.drawSymbol(e,t);break;case"CIMPolygonSymbol":t==null&&(t={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),i.drawSymbol(e,t);break;case"CIMTextSymbol":{const r={x:0,y:0};i.drawSymbol(e,r);break}case"CIMVectorMarker":{const r=new sX;i.drawMarker(e,r);break}}return i.envelope()}function aYr(i){if(!i)return 0;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(i.offset);default:return 0}}function lYr(i){if(!i)return 0;switch(i.type){case"CIMGeometricEffectArrow":return Math.abs(.5*i.width);case"CIMGeometricEffectBuffer":return Math.abs(i.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(i.length);case"CIMGeometricEffectJog":return Math.abs(.5*i.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(rs(i.offsetX)),Math.abs(rs(i.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(i.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(i.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(i.fromWidth),Math.abs(i.toWidth));case"CIMGeometricEffectWave":return Math.abs(i.amplitude);case"CIMGeometricEffectDonut":return Math.abs(i.width)}}function Ebe(i){if(!i)return 0;let e=0;for(const t of i)e+=lYr(t);return e}let xmt=class{static getSymbolInflateSize(e,t,r,n,s){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,n,s):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,n){let s=!0;const o=Wo();if(t?.markerGraphics)for(const a of t.markerGraphics){const l=[0,0,0,0];a.geometry&&(gY(o,a.geometry),l[0]=0,l[1]=0,l[2]=0,l[3]=0,this.getSymbolInflateSize(l,a.symbol,r,0,n),o[0]+=l[0],o[1]+=l[1],o[2]+=l[2],o[3]+=l[3],s?(e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],s=!1):(e[0]=Math.min(e[0],o[0]),e[1]=Math.min(e[1],o[1]),e[2]=Math.max(e[2],o[2]),e[3]=Math.max(e[3],o[3])))}return e}static _getInflateSize(e,t,r,n,s){if(fYr(t)){const o=this._getLayersInflateSize(e,t.symbolLayers,r,n,s),a=Ebe(t.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(e,t,s)}static _getLayersInflateSize(e,t,r,n,s){let o=!0;if(!t)return e;for(const a of t){if(!a)continue;let l=[0,0,0,0];switch(a.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=a;let h=c.width;h!=null&&(c.capStyle===Lv.Square||c.joinStyle===Eb.Miter?h/=1.4142135623730951:h/=2,l[0]=-h,l[1]=-h,l[2]=h,l[3]=h);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=a;if(a.type==="CIMVectorMarker"){const w=a;if(l=this._vectorMarkerBounds(l,w,r,s),w.frame){const S=(w.frame.xmin+w.frame.xmax)/2,I=(w.frame.ymin+w.frame.ymax)/2;if(l[0]-=S,l[1]-=I,l[2]-=S,l[3]-=I,w.size!=null){const R=w.size/(w.frame.ymax-w.frame.ymin);l[0]*=R,l[1]*=R,l[2]*=R,l[3]*=R}}}else if(a.type==="CIMPictureMarker"){const w=a,S=r.getResource(w.url);let I=1;if(S!=null&&S.height&&(I=S.width/S.height),c.size!=null){const R=c.size/2,L=c.size*I*w.scaleX/2;l=[-L,-R,L,R]}}else if(c.size!=null){const w=c.size/2;l=[-w,-w,w,w]}if(c.anchorPoint){let w,S;c.anchorPointUnits==="Absolute"?(w=c.anchorPoint.x,S=c.anchorPoint.y):(w=c.anchorPoint.x*(l[2]-l[0]),S=c.anchorPoint.y*(l[3]-l[1])),l[0]-=w,l[1]-=S,l[2]-=w,l[3]-=S}let h=rs(c.rotation);if(c.rotateClockwise&&(h=-h),n&&(h-=n),h){const w=bmt*h,S=Math.cos(w),I=Math.sin(w),R=Wo([fA,fA,-fA,-fA]);Bce(R,[l[0]*S-l[1]*I,l[0]*I+l[1]*S]),Bce(R,[l[0]*S-l[3]*I,l[0]*I+l[3]*S]),Bce(R,[l[2]*S-l[1]*I,l[2]*I+l[1]*S]),Bce(R,[l[2]*S-l[3]*I,l[2]*I+l[3]*S]),l=R}let p=rs(c.offsetX),m=rs(c.offsetY);if(n){const w=bmt*n,S=Math.cos(w),I=Math.sin(w),R=p*I+m*S;p=p*S-m*I,m=R}l[0]+=p,l[1]+=m,l[2]+=p,l[3]+=m;const v=aYr(c.markerPlacement);v>0&&(l[0]-=v,l[1]-=v,l[2]+=v,l[3]+=v);break}}const u=Ebe(a.effects);u>0&&(l[0]-=u,l[1]-=u,l[2]+=u,l[3]+=u),o?(e[0]=l[0],e[1]=l[1],e[2]=l[2],e[3]=l[3],o=!1):(e[0]=Math.min(e[0],l[0]),e[1]=Math.min(e[1],l[1]),e[2]=Math.max(e[2],l[2]),e[3]=Math.max(e[3],l[3]))}return e}static _getTextInflatedSize(e,t,r){const n=t.height??ph.CIMTextSymbol.height;if(e[0]=-n/2,e[1]=-n/2,e[2]=n/2,e[3]=n/2,!r)return e;const s=r.get(t);if(!s||!s.glyphMosaicItems.glyphs.length)return e;const{lineGapType:o,lineGap:a}=t,l=o?ZGt(o,a??0,n):0,u=t.callout?.type==="CIMBackgroundCallout",c=xJe(s.glyphMosaicItems,{scale:n/dJe,angle:rs(t.angle),xOffset:rs(t.offsetX),yOffset:rs(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:512,lineHeight:hJe*Math.max(.25,Math.min(l||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:u}).boundsT;return e[0]=c.x-c.halfWidth,e[1]=-c.y-c.halfHeight,e[2]=c.x+c.halfWidth,e[3]=-c.y+c.halfHeight,e}},ym=class Zge{static getEnvelope(e,t,r){if(!e)return null;const n=new zqr(r);if(Array.isArray(e)){let s;for(const o of e)s?s.union(Kge(n,o,t)):s=Kge(n,o,t);return s}return Kge(n,e,t)}static getTextureAnchor(e,t){const r=this.getEnvelope(e,null,t);if(!r)return[0,0,0];const n=(r.x+.5*r.width)*XE,s=(r.y+.5*r.height)*XE,o=r.width*XE+2,a=r.height*XE+2;return[-n/o,-s/a,a]}static rasterize(e,t,r,n,s=!0){const o=r||this.getEnvelope(t,null,n);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*XE,l=(o.y+.5*o.height)*XE;e.width=o.width*XE,e.height=o.height*XE,r||(e.width+=2,e.height+=2);const u=e.getContext("2d",{willReadFrequently:!0}),c=w$.createScale(XE,-XE);c.translate(.5*e.width-a,.5*e.height+l);const h=new Hqr(u,n,c);switch(t.type){case"CIMPointSymbol":{const v={type:"point",x:0,y:0};h.drawSymbol(t,v);break}case"CIMVectorMarker":{const v=new sX;h.drawMarker(t,v);break}}const p=u.getImageData(0,0,e.width,e.height),m=new Uint8Array(p.data);if(s){let v;for(let w=0;wh.width&&h.width>0?S*h.width:S),lineDashEnding:v,controlPointEnding:jy.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?Lv.Round:Lv.Butt,enable:!0,width:m,color:Ew(h.color),effects:w})}else!t||e.type!=="line-marker"||e.style!=="cross"&&e.style!=="x"?[a,l]=cK(n):([a,l]=cK(n),o.push({type:"CIMSolidStroke",enable:!0,width:t,color:Ew(s)}));o.push({type:"CIMSolidFill",enable:!0,color:Ew(s)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:rs(-e.angle),size:rs(u||6*t),offsetX:rs(e.xoffset),offsetY:rs(e.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:l,symbol:c}]}]}}static fromCIMHatchFill(e,t){const r=t*(e.separation??ph.CIMHatchFill.separation),n=r/2,s=li(e.lineSymbol);s.symbolLayers?.forEach(l=>{switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=t),l.effects?.forEach(u=>{if(u.type==="CIMGeometricEffectDashes"){const c=u.dashTemplate;u.dashTemplate=c.map(h=>h*t)}});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=t);const u=l.markerPlacement;u!=null&&"placementTemplate"in u&&(u.placementTemplate=u.placementTemplate.map(c=>c*t));break}}});let o=this._getLineSymbolPeriod(s)||wmt;for(;o{gYr(s,t,r),"url"in s&&s.url&&r.push(t.fetchResource(s.url,{signal:n}))}),r}static fetchFonts(e,t,r){if(e&&t){if("symbolLayers"in e&&e.symbolLayers){for(const n of e.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const s of n.markerGraphics)s?.symbol&&Zge.fetchFonts(s.symbol,t,r)}else if(e.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:s}=e;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=gVe(s),l=yVe(e),u=new mae({family:n,style:o,weight:a,decoration:l});r.push(t.loadFont(u).catch(()=>{Cbe().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers){for(const r of e.symbolLayers)if(r){const n=this._getEffectsRepeat(r.effects);if(n)return n;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const s=this._getPlacementRepeat(r.markerPlacement);if(s)return s}}}}}return 0}static _getEffectsRepeat(e){if(e){for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const r=t.dashTemplate;if(r&&r.length){let n=0;for(const s of r)n+=s;return 1&r.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return t.period;default:Cbe().error(`unsupported geometric effect type ${t.type}`)}}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let r=0;for(const n of t)r+=+n;return 1&t.length&&(r*=2),r}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const n=Math.abs(t.stepX),s=Math.abs(t.stepY),o=(t.randomness??100)/100;let a,l,u,c;if(t.gridType==="Random"){const h=uy(Hjt),p=Math.max(Math.floor(h/n),1),m=Math.max(Math.floor(h/s),1);a=p*n/2,l=m*s/2,u=2*l;const v=new VC(t.seed),w=o*n/1.5,S=o*s/1.5;c=[];for(let I=0;I({type:"CIMMarkerGraphic",geometry:h,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:u}}};function nUt(i,e){if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=i.symbolLayers;if(!t)return;for(const r of t)if(e(r),r.type==="CIMVectorMarker"){const n=r.markerGraphics;if(!n)continue;for(const s of n)if(s){const o=s.symbol;o&&nUt(o,e)}}break}}}const CJe=i=>{if(!i)return Lv.Butt;switch(i){case"butt":return Lv.Butt;case"square":return Lv.Square;case"round":return Lv.Round}},sUt=i=>{if(!i)return Eb.Miter;switch(i){case"miter":return Eb.Miter;case"round":return Eb.Round;case"bevel":return Eb.Bevel}},uYr=i=>{if(i==null)return"Center";switch(i){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},cYr=i=>{if(i==null)return"Center";switch(i){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Ew=i=>{if(!i)return[0,0,0,0];const{r:e,g:t,b:r,a:n}=i;return[e,t,r,255*n]},hYr=(i,e)=>{const t=dYr(e),r=pYr(i);return t&&r?`${t}-${r}`:`${t}${r}`},dYr=i=>{if(!i)return"";switch(i.toLowerCase()){case"bold":case"bolder":return"bold"}return""},pYr=i=>{if(!i)return"";switch(i.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Ibe=(i,e)=>{const t=yi("safari")?.001:0,r=e==="butt";switch(i){case"dash":case"esriSLSDash":return r?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return r?[4,3,1,3]:[3,4,t,4];case"dot":case"esriSLSDot":return r?[1,3]:[t,4];case"long-dash":case"esriSLSLongDash":return r?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return r?[8,3,1,3]:[7,4,t,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return r?[8,3,1,3,1,3]:[7,4,t,4,t,4];case"short-dash":case"esriSLSShortDash":return r?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return r?[4,1,1,1]:[3,2,t,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return r?[4,1,1,1,1,1]:[3,2,t,2,t,2];case"short-dot":case"esriSLSShortDot":return r?[1,1]:[t,2];case"solid":case"esriSLSSolid":case"none":return Cbe().error("Unexpected: style does not require rasterization"),[0,0];default:return Cbe().error(`Tried to rasterize SLS, but found an unexpected style: ${i}!`),[0,0]}};function fYr(i){return i.symbolLayers!==void 0}const cK=(i,e=100)=>{const t=e/2;let r,n;const s=i;if(s==="circle"||s==="esriSMSCircle"){let a=Math.acos(1-.25/t),l=Math.ceil(rUt/a/4);l===0&&(l=1),a=sYr/l,l*=4;const u=[];u.push([t,0]);for(let c=1;ci==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function gYr(i,e,t){if(!(!i.effects||e.geometryEngine!=null)){if(e.geometryEnginePromise)return void t.push(e.geometryEnginePromise);rir(i.effects)&&(e.geometryEnginePromise=nir(),t.push(e.geometryEnginePromise),e.geometryEnginePromise.then(r=>e.geometryEngine=r))}}function Smt(i){if(!i)return null;let e=null;const{cap:t,color:r,join:n,miterLimit:s,style:o,width:a}=i;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(e=[{type:"CIMGeometricEffectDashes",dashTemplate:Ibe(o,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Ew(r):[0,0,0,0],capStyle:CJe(t),joinStyle:sUt(n),miterLimit:s,width:a,effects:e}}const yYr=96/72;let J8e=class{static executeEffects(e,t,r,n){const s=yYr,o=Ebe(e);let a=new $8e(t);for(const l of e){const u=W8e(l);u&&(a=u.execute(a,l,s,r,n,o))}return a}static applyEffects(e,t,r){if(!e)return t;const n=Ebe(e);let s,o=new $8e(Ec.fromJSONCIM(t));for(const u of e){const c=W8e(u);c&&(o=c.execute(o,u,1,null,r,n))}const a=[];let l=null;for(;s=o.next();)a.push(...oae(s)),l=s.geometryType;return a.length===0||l===null?null:l==="esriGeometryPolygon"?{rings:a}:{paths:a}}},oUt=null;function EJe(){return oUt}async function vYr(){oUt=await Promise.resolve().then(()=>iX)}const _Yr=new Float32Array(1);new Uint32Array(_Yr.buffer);function cv(i,e){return 65535&i|e<<16}function aUt(i){switch(i){case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4}}function bYr(i){const e=[],t=[],r=[];for(const n of i){const s=aUt(n.type)*n.count;switch(s%2||s%4||4){case 4:e.push(n);continue;case 2:t.push(n);continue;case 1:r.push(n);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...t),e.push(...r),e}let wYr=class lUt{static fromVertexSpec({attributes:e},t){let r,n,s;const o=[];for(const m in e){const v=e[m];t?.[m]!==!1&&(v.pack==="position"?r={...v,name:m,offset:0}:v.pack==="id"?n={...v,name:m,offset:4}:m==="bitset"?s={...v,name:m,offset:7}:o.push({...v,name:m}))}const a=bYr(o),l=[];let u=8,c=1;for(const m of a)l.push({...m,offset:u}),u+=aUt(m.type)*m.count,m.packAlternating&&(c=Math.max(m.packAlternating.count,c));const h=Uint32Array.BYTES_PER_ELEMENT,p=u%h;return new lUt(r,n,s,l,u+(p?h-p:0),c)}constructor(e,t,r,n,s,o){this.position=e,this.id=t,this.bitset=r,this.standardAttributes=n,this.stride=s,this.packVertexCount=o,n.push(r),this._attributes=[e,t,r,...n]}get attributeLayout(){if(!this._attributeLayout){const e=wle(this._attributes),t=this._attributes.map(r=>({name:r.name,count:r.count,offset:r.offset,type:r.type,packPrecisionFactor:r.packPrecisionFactor,normalized:r.normalized??!1}));this._attributeLayout={attributes:t,hash:e,stride:this.stride}}return this._attributeLayout}};function xYr(i,e,t,r){const n=t.packPrecisionFactor??1;switch(t.type){case Ti.BYTE:if(t.count===1)i.setInt8(r+t.offset,e*n);else for(let s=0;sthis.vertexSpec.createComputedParams(s)}get _vertexPack(){if(!this._cachedVertexPack){const e=SYr.fromVertexSpec(this.vertexSpec,this._optionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){TYr(this._evaluator.inputMeshParams.params.effects?.effectInfos)&&await vYr()}enqueueRequest(e,t,r){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,r)}write(e,t,r,n,s){this.ensurePacked(t,r,n);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(e,r,void 0,s);const a=r.readGeometryForDisplay()?.clone();if(!a)return;const l=Ec.fromOptimizedCIM(a,r.geometryType),u=EJe();l.invertY();const c=e.id||"",h=J8e.executeEffects(o,l,c,u);let p;for(;p=h.next();)p.invertY(),this._write(e,r,p,s)}ensurePacked(e,t,r){if(!this._evaluator.hasDynamicProperties)return;const n=this._evaluator.evaluateMeshParams(e,t,r);this._vertexPack.pack(n,this._viewParams)}_writeVertex(e,t,r,n,s){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,r,n,o,s)}};const CYr=100,EYr=yi("featurelayer-fast-triangulation-enabled");let hUt=class extends oX{async loadDependencies(){await Promise.all([super.loadDependencies(),tGt()])}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);s&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,s),e.recordEnd())}_clip(e){if(!e)return null;const t=this.hasEffects;return uGt(e,t?256:8)}_writeGeometry(e,t,r){const n=r.maxLength>CYr,s=[],o=this.createTesselationParams(t);if(!n&&EYr&&KHr(s,r))return void(s.length&&this._writeVertices(e,t,r.coords,o,s));const a=ZHr(r);this._writeVertices(e,t,a,o)}_writeVertices(e,t,r,n,s){const o=t.getDisplayId(),a=e.vertexCount(),l=this.hasEffects;let u=0;if(s)for(const c of s){const h=r[2*c],p=r[2*c+1];l&&e.recordBounds(h,p,0,0),this._writeVertex(e,o,h,p,n),u++}else for(let c=0;ci,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:Ti.FLOAT,count:1,packTessellation:({inverseArea:i})=>i}}};let AYr=class extends hUt{constructor(){super(...arguments),this.vertexSpec=IYr}createTesselationParams(e){return{inverseArea:1/e.readGeometryArea()}}};const MYr=()=>di.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),OYr=0,PYr=100;function aX(i,e){return[!!i?.minScale&&e.scaleToZoom(i.minScale)||OYr,!!i?.maxScale&&e.scaleToZoom(i.maxScale)||PYr]}function hK(i){return 1<i,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)}}};let IJe=class extends hUt{constructor(){super(...arguments),this.vertexSpec=dUt}createTesselationParams(e){return null}};const fCe={createComputedParams:i=>i,attributes:{...dUt.attributes,tlbr:{count:4,type:Ti.UNSIGNED_SHORT,pack:({sprite:i})=>{const{rect:e,width:t,height:r}=i,n=e.x+Qg,s=e.y+Qg;return[n,s,n+t,s+r]}},inverseRasterizationScale:{count:1,type:Ti.BYTE,packPrecisionFactor:16,pack:({sprite:i})=>1/i.rasterizationScale}}};let pUt=class extends IJe{constructor(){super(...arguments),this.vertexSpec=fCe}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),e.recordEnd()}};var eoe;(function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"})(eoe||(eoe={}));const Cmt=3.14159265359/180,fUt=3.14159265359/128,FYr=1,kYr=1.1,LYr=1,Emt=24,NYr=8,$Yr=1e-5,Imt=.05,mUt=1e-30,mCe=4,AJe=0,gUt=2,yUt=5,vUt=6,_Ut=2,bUt=3,wUt=0,xUt=3,BYr=16777216;function MJe(i){const{sprite:e,aspectRatio:t,scaleProportionally:r}=i,n=us(i.height),s=n>0?n:e.height;let o=n*t;return o<=0?o=e.width:r&&(o*=e.width/e.height),{width:o,height:s}}function SUt(i){const{applyRandomOffset:e,sampleAlphaOnly:t}=i,{width:r,height:n}=MJe(i);return Tle([[gUt,e],[mCe,t],[vUt,ri,attributes:{...fCe.attributes,bitset:{count:1,type:Ti.UNSIGNED_BYTE,pack:SUt},width:{count:1,type:Ti.UNSIGNED_SHORT,pack:TUt},height:{count:1,type:Ti.UNSIGNED_SHORT,pack:CUt},offset:{count:2,type:Ti.SHORT,pack:({offsetX:i,offsetY:e})=>[us(i),-us(e)]},scale:{count:2,type:Ti.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:i,scaleY:e})=>[i,e]},angle:{count:1,type:Ti.UNSIGNED_BYTE,pack:({angle:i})=>Zqr(i)}}};let jYr=class extends pUt{constructor(){super(...arguments),this.vertexSpec=EUt}};function IUt(i,e){return i.x===e.x&&i.y===e.y}function GYr(i){if(!i)return;const e=i.length;if(e<=1)return;let t=0;for(let r=1;rr){s=!0;const L=(r-n)/v;v=r-n,c=(1-L)*o+L*c,h=(1-L)*a+L*h,--u}const w=this._writeVertex(o,a,0,0,p,m,m,-p,0,-1,n),S=this._writeVertex(o,a,0,0,p,m,-m,p,0,1,n);n+=v;const I=this._writeVertex(c,h,0,0,p,m,m,-p,0,-1,n),R=this._writeVertex(c,h,0,0,p,m,-m,p,0,1,n);this._writeTriangle(w,S,I),this._writeTriangle(S,I,R),o=c,a=h}}_tessellate(e,t){const r=e[0],n=e[e.length-1],s=IUt(r,n),o=s?3:2;if(e.length{const tt=Z(w,S,V,Y,Te,Be,_e,Ie,Ve,$e,H);return ne>=0&&de>=0&&tt>=0&&ae(ne,de,tt),ne=de,de=tt,tt};s&&(v=e[e.length-2],L.x=n.x-v.x,L.y=n.y-v.y,B=uPe(L),L.x/=B,L.y/=B);let be=!1;for(let _e=0;_epe&&(be=!0)),be){const yt=(pe-H)/k;k=pe-H,v={x:(1-yt)*v.x+yt*e[_e].x,y:(1-yt)*v.y+yt*e[_e].y},--_e}else v=e[_e];w=v.x,S=v.y;const Ie=_e<=0&&!be,Te=_e===e.length-1;if(Ie||(H+=k),I=Te?s?e[1]:null:e[_e+1],I?(L.x=I.x-w,L.y=I.y-S,B=uPe(L),L.x/=B,L.y/=B):(L.x=void 0,L.y=void 0),!s){if(Ie){d2($,L),V=$.x,Y=$.y,l===L1.SQUARE&&(fe(-L.y-L.x,L.x-L.y,L.x,L.y,0,-1),fe(L.y-L.x,-L.x-L.y,L.x,L.y,0,1)),l===L1.ROUND&&(fe(-L.y-L.x,L.x-L.y,L.x,L.y,-1,-1),fe(L.y-L.x,-L.x-L.y,L.x,L.y,-1,1)),l!==L1.ROUND&&l!==L1.BUTT||(fe(-L.y,L.x,L.x,L.y,0,-1),fe(L.y,-L.x,L.x,L.y,0,1));continue}if(Te){bT($,R),V=$.x,Y=$.y,l!==L1.ROUND&&l!==L1.BUTT||(fe(R.y,-R.x,-R.x,-R.y,0,-1),fe(-R.y,R.x,-R.x,-R.y,0,1)),l===L1.SQUARE&&(fe(R.y-R.x,-R.x-R.y,-R.x,-R.y,0,-1),fe(-R.y-R.x,R.x-R.y,-R.x,-R.y,0,1)),l===L1.ROUND&&(fe(R.y-R.x,-R.x-R.y,-R.x,-R.y,1,-1),fe(-R.y-R.x,R.x-R.y,-R.x,-R.y,1,1));continue}}let Be,Ve,$e=-UYr(R,L);if(Math.abs($e)<.01)Mmt(R,L)>0?($.x=R.x,$.y=R.y,$e=1,Be=Number.MAX_VALUE,Ve=!0):(d2($,L),$e=1,Be=1,Ve=!1);else{$.x=(R.x+L.x)/$e,$.y=(R.y+L.y)/$e,Be=uPe($);const yt=(Be-1)*p*a;Ve=Be>4||yt>k&&yt>B}V=$.x,Y=$.y;let tt=u;switch(u){case fv.BEVEL:Be<1.05&&(tt=fv.MITER);break;case fv.ROUND:Bec&&(tt=fv.BEVEL)}switch(tt){case fv.MITER:if(fe($.x,$.y,-R.x,-R.y,0,-1),fe(-$.x,-$.y,-R.x,-R.y,0,1),Te)break;if(m){const yt=be?0:H;ne=this._writeVertex(w,S,V,Y,L.x,L.y,$.x,$.y,0,-1,yt),de=this._writeVertex(w,S,V,Y,L.x,L.y,-$.x,-$.y,0,1,yt)}break;case fv.BEVEL:{const yt=$e<0;let Ct,ot,vt,At;if(yt){const ct=ne;ne=de,de=ct,Ct=K,ot=Q}else Ct=Q,ot=K;if(Ve)vt=yt?d2(this._innerPrev,R):bT(this._innerPrev,R),At=yt?bT(this._innerNext,L):d2(this._innerNext,L);else{const ct=yt?lPe(this._inner,$):Amt(this._inner,$);vt=ct,At=ct}const Je=yt?bT(this._bevelStart,R):d2(this._bevelStart,R);fe(vt.x,vt.y,-R.x,-R.y,Ct.x,Ct.y);const it=fe(Je.x,Je.y,-R.x,-R.y,ot.x,ot.y);if(Te)break;const Ue=yt?d2(this._bevelEnd,L):bT(this._bevelEnd,L);if(Ve){const ct=this._writeVertex(w,S,V,Y,-R.x,-R.y,0,0,0,0,H);ne=this._writeVertex(w,S,V,Y,L.x,L.y,At.x,At.y,Ct.x,Ct.y,H),de=this._writeVertex(w,S,V,Y,L.x,L.y,Ue.x,Ue.y,ot.x,ot.y,H),this._writeTriangle(it,ct,de)}else{if(m){const ct=this._bevelMiddle;ct.x=(Je.x+Ue.x)/2,ct.y=(Je.y+Ue.y)/2,Nj(re,ct,-R.x,-R.y),fe(ct.x,ct.y,-R.x,-R.y,re.x,re.y),Nj(re,ct,L.x,L.y),ne=this._writeVertex(w,S,V,Y,L.x,L.y,ct.x,ct.y,re.x,re.y,H),de=this._writeVertex(w,S,V,Y,L.x,L.y,At.x,At.y,Ct.x,Ct.y,H)}else{const ct=ne;ne=de,de=ct}fe(Ue.x,Ue.y,L.x,L.y,ot.x,ot.y)}if(yt){const ct=ne;ne=de,de=ct}break}case fv.ROUND:{const yt=$e<0;let Ct,ot;if(yt){const _t=ne;ne=de,de=_t,Ct=K,ot=Q}else Ct=Q,ot=K;const vt=yt?lPe(this._inner,$):Amt(this._inner,$);let At,Je;Ve?(At=yt?d2(this._innerPrev,R):bT(this._innerPrev,R),Je=yt?bT(this._innerNext,L):d2(this._innerNext,L)):(At=vt,Je=vt);const it=yt?bT(this._roundStart,R):d2(this._roundStart,R),Ue=yt?d2(this._roundEnd,L):bT(this._roundEnd,L),ct=fe(At.x,At.y,-R.x,-R.y,Ct.x,Ct.y),st=fe(it.x,it.y,-R.x,-R.y,ot.x,ot.y);if(Te)break;const Ze=this._writeVertex(w,S,V,Y,-R.x,-R.y,0,0,0,0,H);Ve||this._writeTriangle(ne,de,Ze);const ye=lPe(this._outer,vt),Ke=this._writeVertex(w,S,V,Y,L.x,L.y,Ue.x,Ue.y,ot.x,ot.y,H);let ke,me;const ie=Be>2;if(ie){let _t;Be!==Number.MAX_VALUE?(ye.x/=Be,ye.y/=Be,_t=Mmt(R,ye),_t=(Be*(_t*_t-1)+1)/_t):_t=-1,ke=yt?bT(this._startBreak,R):d2(this._startBreak,R),ke.x+=R.x*_t,ke.y+=R.y*_t,me=yt?d2(this._endBreak,L):bT(this._endBreak,L),me.x+=L.x*_t,me.y+=L.y*_t}Nj(re,ye,-R.x,-R.y);const ge=this._writeVertex(w,S,V,Y,-R.x,-R.y,ye.x,ye.y,re.x,re.y,H);Nj(re,ye,L.x,L.y);const je=m?this._writeVertex(w,S,V,Y,L.x,L.y,ye.x,ye.y,re.x,re.y,H):ge,rt=Ze,Me=m?this._writeVertex(w,S,V,Y,L.x,L.y,0,0,0,0,H):Ze;let ht=-1,Ht=-1;if(ie&&(Nj(re,ke,-R.x,-R.y),ht=this._writeVertex(w,S,V,Y,-R.x,-R.y,ke.x,ke.y,re.x,re.y,H),Nj(re,me,L.x,L.y),Ht=this._writeVertex(w,S,V,Y,L.x,L.y,me.x,me.y,re.x,re.y,H)),m?ie?(this._writeTriangle(rt,st,ht),this._writeTriangle(rt,ht,ge),this._writeTriangle(Me,je,Ht),this._writeTriangle(Me,Ht,Ke)):(this._writeTriangle(rt,st,ge),this._writeTriangle(Me,je,Ke)):ie?(this._writeTriangle(Ze,st,ht),this._writeTriangle(Ze,ht,Ht),this._writeTriangle(Ze,Ht,Ke)):(this._writeTriangle(Ze,st,ge),this._writeTriangle(Ze,je,Ke)),Ve?(ne=this._writeVertex(w,S,V,Y,L.x,L.y,Je.x,Je.y,Ct.x,Ct.y,H),de=Ke):(ne=m?this._writeVertex(w,S,V,Y,L.x,L.y,Je.x,Je.y,Ct.x,Ct.y,H):ct,this._writeTriangle(ne,Me,Ke),de=Ke),yt){const _t=ne;ne=de,de=_t}break}}}}},zYr=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const gCe={createComputedParams:i=>i,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:Ti.UNSIGNED_BYTE,count:1},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)},offset:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:e})=>[Bde(i,16),Bde(e,16)]},normal:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:i,normalY:e})=>[Bde(i,16),Bde(e,16)]},halfWidth:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:i})=>Tmt(us(.5*i),16)},referenceHalfWidth:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:i})=>Tmt(us(.5*i),16)}}};let VYr=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Omt=65535;let OJe=class extends oX{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=gCe,this._currentWrite=new VYr,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Omt,textured:!1},this._tessParams=new zYr,this._initializeTessellator()}writeLineVertices(e,t,r){const n=this._getLines(t);n!=null&&this._writeVertices(e,r,n)}_initializeTessellator(){this._lineTessellator=new AUt(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(e,t,r){const n=r??Ec.fromFeatureSetReaderCIM(t);n&&this._writeGeometry(e,t,n)}_writeGeometry(e,t,r,n){e.recordStart(this.instanceId,this.attributeLayout,n),this.writeLineVertices(e,r,t),e.recordEnd()}_getLines(e){return eWr(e,Jjt(this.evaluatedMeshParams))}_writeVertices(e,t,r){const{_currentWrite:n,_tessellationOptions:s,evaluatedMeshParams:o}=this,{width:a,capType:l,joinType:u,miterLimit:c,hasSizeVV:h}=o,p=us(.5*a);s.halfWidth=p,s.capType=RYr(l),s.joinType=DYr(u),s.miterLimit=c;const m=!h;n.out=e,n.id=t.getDisplayId(),n.vertexCount=0,n.indexCount=0,n.vertexFrom=e.vertexCount(),n.vertexBounds=m&&pi,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>0},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)}}},PJe={createComputedParams:i=>i,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>Tle([[AJe,!0]])},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>Xg(i)}}};let RJe=class extends OJe{constructor(){super(...arguments),this.vertexSpec=PJe}},DJe=class extends IJe{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=MUt,this._lineMeshWriter=this._createOutlineWriter(e,t,r,n)}_createOutlineWriter(e,t,r,n){return new RJe(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);s&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd())}_clip(e){return e?uGt(e,Jjt(this.evaluatedMeshParams)):null}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};var zl;(function(i){i[i.Pass=0]="Pass",i[i.Draw=1]="Draw"})(zl||(zl={}));const OUt=()=>di.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let PUt=class{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){OUt().error("Trying to include shader module multiple times with different sets of options.");const n=new Set;for(const s of Object.keys(r))r[s]!==e[s]&&n.add(s);for(const s of Object.keys(e))r[s]!==e[s]&&n.add(s);n.forEach(s=>console.error(` ${s}: current ${r[s]} new ${e[s]}`))}}else this._includedModules.set(e,t),e(this.builder,t)}},HYr=class extends PUt{constructor(){super(...arguments),this.vertex=new Pmt,this.fragment=new Pmt,this.attributes=new YYr,this.varyings=new XYr,this.extensions=new K8e,this.constants=new RUt}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const r=this.extensions.generateSource(e),n=this.attributes.generateSource(e),s=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),l=o.code.generateSource(),u=e==="vertex"?KYr:JYr(t),c=this.constants.generateSource().concat(o.constants.generateSource());return`${t?"#version 300 es":""} + `)();return()=>new r}catch{return()=>({[e]:null,...i})}}function G7t(i={}){return[{name:"New Feature",description:"",prototype:{attributes:li(i)}}]}function WTe(i,e){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:i},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:e,supportsDelete:e,supportsEditing:e,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:e,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:T7t,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:e,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}const PGr=KA("esriGeometryPoint"),RGr=["csv"],DGr=[0,0];let FGr=class{constructor(e,t){this.x=e,this.y=t}},kGr=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[r]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),n=LGr(r,e);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const s=await this._createFeatures(r);this._queryEngine.featureStore.addMany(s);const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=o,a){const{start:l,end:u}=a;n.layerDefinition.timeInfo.timeExtent=[l,u]}return n}async applyEdits(){throw new qe("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=pE(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),mo(n)||di.getLogger("esri.layers.CSVLayer").error(new qe("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:r}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:r}=this._loadOptions;if(!t)throw new qe("csv-layer:invalid-source","url not defined");const n=Yo(t);return(await zi(n.path,{query:{...n.query,...r},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:r,extent:n,timeInfo:s}=e.layerDefinition,o=new rX({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new lL({fieldsIndex:Cd.fromLayerJSON({fields:r,dateFieldsTimeReference:{timeZoneIANA:y0}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:t,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:r}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:o}=this._queryEngine;let a=[];const l=[],u=s.fields.filter(v=>v.name!==n).map(v=>v.name);let c=0;const h={};for(const v of s.fields)if(v.type!=="esriFieldTypeOID"&&v.type!=="esriFieldTypeGlobalID"){const w=w2e(v);w!==void 0&&(h[v.name]=w)}const p=$7t(e,u,this._delimiter,OXe(h,n));for(const v of p){const w=this._parseCoordinateValue(v[t]),S=this._parseCoordinateValue(v[r]);if(S!=null&&w!=null&&!isNaN(w)&&!isNaN(S)){v[t]=w,v[r]=S;for(const I in v)if(I!==t&&I!==r){if(s.isDateField(I))v[I]=a7t(v[I]);else if(s.isNumericField(I)){const R=P6e(v[I]);isNaN(R)?v[I]=null:v[I]=R}}v[n]=c,c++,a.push(new FGr(S,w)),l.push(v)}}if(!Ya({wkid:4326},o))if(Nb(o))for(const v of a)[v.x,v.y]=Z5(v.x,v.y,DGr);else a=TW(Mu,a,Xi.WGS84,o,null,null);const m=[];for(let v=0;v181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await Gv(Yp,e)}catch{throw new qe("csv-layer:projection-not-supported","Projection not supported")}}};function LGr(i,e){const t=e.parsingOptions||{},r={delimiter:t.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:t.latitudeField,longitudeFieldName:t.longitudeField}},n=r.layerDefinition={name:o2e(e.url,RGr)||"csv",dateFieldsTimeReference:{timeZoneIANA:y0},drawingInfo:PGr,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:t.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:t.spatialReference||{wkid:4326}}},s=L7t(i),o=s.next().value?.trim(),a=s.next().value?.trim();if(!o)throw new qe("csv-layer:empty-csv","CSV is empty",{csv:i});const{delimiter:l,locationInfo:u}=SGr(o,a,t);if(!l)throw new qe("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:t});if(!u)throw new qe("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:t});r.locationInfo=u,r.delimiter=l;const{names:c,aliases:h}=B7t(o,l),p=CGr(i,r.delimiter,c,h,r.locationInfo);if(t.fields?.length){const v=new Cd(t.fields);for(const w of p){const S=v.get(w.name);S&&Object.assign(w,S)}}if(!p.some(v=>v.type==="esriFieldTypeOID"&&(n.objectIdField=v.name,!0))){const v={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=v.name,p.unshift(v)}n.fields=p;const m=new Cd(n.fields);if(r.locationInfo&&(r.locationInfo.latitudeFieldName=m.get(r.locationInfo.latitudeFieldName).name,r.locationInfo.longitudeFieldName=m.get(r.locationInfo.longitudeFieldName).name),n.timeInfo){const v=n.timeInfo;if(v.startTimeField){const w=m.get(v.startTimeField);w?(v.startTimeField=w.name,w.type="esriFieldTypeDate"):v.startTimeField=null}if(v.endTimeField){const w=m.get(v.endTimeField);w?(v.endTimeField=w.name,w.type="esriFieldTypeDate"):v.endTimeField=null}if(v.trackIdField){const w=m.get(v.trackIdField);v.trackIdField=w?w.name:null}v.startTimeField||v.endTimeField||(n.timeInfo=null)}return r}const NGr=Object.freeze(Object.defineProperty({__proto__:null,default:kGr},Symbol.toStringTag,{value:"Module"}));let PXe=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=9;const o=this.TypedArrayConstructor;n===void 0&&(n=9*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)t[n]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[r++]=t[n]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;for(let l=0;l<9;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};PXe.ElementCount=9;let RXe=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=16;const o=this.TypedArrayConstructor;n===void 0&&(n=16*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)t[n]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[r++]=t[n]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;for(let l=0;l<16;++l)n[o++]=s[a++]}get buffer(){return this.typedBuffer.buffer}};RXe.ElementCount=16;let zR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.stride=n,this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}};zR.ElementCount=1;let VR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=2;const o=this.TypedArrayConstructor;n===void 0&&(n=2*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,dl(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};VR.ElementCount=2;let HR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=3;const o=this.TypedArrayConstructor;n===void 0&&(n=3*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,Zo(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,n){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=n}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};HR.ElementCount=3;let WR=class{constructor(e,t,r=0,n,s){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const o=this.TypedArrayConstructor;n===void 0&&(n=4*o.BYTES_PER_ELEMENT);const a=t.byteLength===0?0:r;this.typedBuffer=s==null?new o(t,a):new o(t,a,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const n=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,k1(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,t,r){const n=this.typedBuffer,s=t.typedBuffer;let o=e*this.typedBufferStride,a=r*t.typedBufferStride;n[o++]=s[a++],n[o++]=s[a++],n[o++]=s[a++],n[o]=s[a]}get buffer(){return this.typedBuffer.buffer}};WR.ElementCount=4;let qTe=class U7t extends zR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}static fromTypedArray(e,t){return new U7t(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};qTe.ElementType="f32";let u7=class R6e extends VR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(R6e,e,t)}static fromTypedArray(e,t){return new R6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};u7.ElementType="f32";let Om=class D6e extends HR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(D6e,e,t)}static fromTypedArray(e,t){return new D6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Om.ElementType="f32";let E3=class F6e extends WR{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(F6e,e,t)}static fromTypedArray(e,t){return new F6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};E3.ElementType="f32";let DXe=class k6e extends PXe{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(k6e,e,t)}static fromTypedArray(e,t){return new k6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};DXe.ElementType="f32";let FXe=class L6e extends PXe{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(L6e,e,t)}static fromTypedArray(e,t){return new L6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};FXe.ElementType="f64";let kXe=class N6e extends RXe{constructor(e,t=0,r,n){super(Float32Array,e,t,r,n),this.elementType="f32"}slice(e,t){return this.sliceBuffer(N6e,e,t)}static fromTypedArray(e,t){return new N6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};kXe.ElementType="f32";let LXe=class $6e extends RXe{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer($6e,e,t)}static fromTypedArray(e,t){return new $6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};LXe.ElementType="f64";let NXe=class B6e extends zR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B6e,e,t)}static fromTypedArray(e,t){return new B6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};NXe.ElementType="f64";let $Xe=class j6e extends VR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(j6e,e,t)}static fromTypedArray(e,t){return new j6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};$Xe.ElementType="f64";let zS=class G6e extends HR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(G6e,e,t)}static fromTypedArray(e,t){return new G6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};zS.ElementType="f64";let BXe=class U6e extends WR{constructor(e,t=0,r,n){super(Float64Array,e,t,r,n),this.elementType="f64"}slice(e,t){return this.sliceBuffer(U6e,e,t)}static fromTypedArray(e,t){return new U6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};BXe.ElementType="f64";let YTe=class z6e extends zR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(z6e,e,t)}static fromTypedArray(e,t){return new z6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};YTe.ElementType="u8";let XTe=class V6e extends VR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(V6e,e,t)}static fromTypedArray(e,t){return new V6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};XTe.ElementType="u8";let bq=class H6e extends HR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(H6e,e,t)}static fromTypedArray(e,t){return new H6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};bq.ElementType="u8";let K3=class W6e extends WR{constructor(e,t=0,r,n){super(Uint8Array,e,t,r,n),this.elementType="u8"}slice(e,t){return this.sliceBuffer(W6e,e,t)}static fromTypedArray(e,t){return new W6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};K3.ElementType="u8";let JTe=class q6e extends zR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(q6e,e,t)}static fromTypedArray(e,t){return new q6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};JTe.ElementType="u16";let jXe=class Y6e extends VR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(Y6e,e,t)}static fromTypedArray(e,t){return new Y6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};jXe.ElementType="u16";let fle=class X6e extends HR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(X6e,e,t)}static fromTypedArray(e,t){return new X6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};fle.ElementType="u16";let nX=class J6e extends WR{constructor(e,t=0,r,n){super(Uint16Array,e,t,r,n),this.elementType="u16"}slice(e,t){return this.sliceBuffer(J6e,e,t)}static fromTypedArray(e,t){return new J6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};nX.ElementType="u16";let KTe=class K6e extends zR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(K6e,e,t)}static fromTypedArray(e,t){return new K6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};KTe.ElementType="u32";let GXe=class Z6e extends VR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Z6e,e,t)}static fromTypedArray(e,t){return new Z6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};GXe.ElementType="u32";let z7t=class Q6e extends HR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Q6e,e,t)}static fromTypedArray(e,t){return new Q6e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};z7t.ElementType="u32";let V7t=class e8e extends WR{constructor(e,t=0,r,n){super(Uint32Array,e,t,r,n),this.elementType="u32"}slice(e,t){return this.sliceBuffer(e8e,e,t)}static fromTypedArray(e,t){return new e8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};V7t.ElementType="u32";let UXe=class t8e extends zR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(t8e,e,t)}static fromTypedArray(e,t){return new t8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};UXe.ElementType="i8";let ZTe=class i8e extends VR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(i8e,e,t)}static fromTypedArray(e,t){return new i8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};ZTe.ElementType="i8";let H7t=class r8e extends HR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(r8e,e,t)}static fromTypedArray(e,t){return new r8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};H7t.ElementType="i8";let W7t=class n8e extends WR{constructor(e,t=0,r,n){super(Int8Array,e,t,r,n),this.elementType="i8"}slice(e,t){return this.sliceBuffer(n8e,e,t)}static fromTypedArray(e,t){return new n8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};W7t.ElementType="i8";let q7t=class s8e extends zR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(s8e,e,t)}static fromTypedArray(e,t){return new s8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};q7t.ElementType="i16";let mle=class o8e extends VR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(o8e,e,t)}static fromTypedArray(e,t){return new o8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};mle.ElementType="i16";let Y7t=class a8e extends HR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(a8e,e,t)}static fromTypedArray(e,t){return new a8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Y7t.ElementType="i16";let X7t=class l8e extends WR{constructor(e,t=0,r,n){super(Int16Array,e,t,r,n),this.elementType="i16"}slice(e,t){return this.sliceBuffer(l8e,e,t)}static fromTypedArray(e,t){return new l8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};X7t.ElementType="i16";let J7t=class u8e extends zR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(u8e,e,t)}static fromTypedArray(e,t){return new u8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};J7t.ElementType="i32";let K7t=class c8e extends VR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(c8e,e,t)}static fromTypedArray(e,t){return new c8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};K7t.ElementType="i32";let Z7t=class h8e extends HR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(h8e,e,t)}static fromTypedArray(e,t){return new h8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Z7t.ElementType="i32";let Q7t=class d8e extends WR{constructor(e,t=0,r,n){super(Int32Array,e,t,r,n),this.elementType="i32"}slice(e,t){return this.sliceBuffer(d8e,e,t)}static fromTypedArray(e,t){return new d8e(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}};Q7t.ElementType="i32";function p8e(i){switch(i){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}let $Gr=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function Ch(i,e){if(!i){e=e||"Assertion";const t=new Error(e).stack;throw new $Gr(`${e} at ${t}`)}}function Opt(i,e,t,r){let n,s=(t[0]-i[0])/e[0],o=(r[0]-i[0])/e[0];s>o&&(n=s,s=o,o=n);let a=(t[1]-i[1])/e[1],l=(r[1]-i[1])/e[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),lc&&(n=u,u=c,c=n),!(s>c||u>o)&&(cthis._fields.set(t[0],{...t[1],constructor:UGr(t[1].constructor)})))}vec2f(e,t){return this._appendField(e,u7,t),this}vec2f64(e,t){return this._appendField(e,$Xe,t),this}vec3f(e,t){return this._appendField(e,Om,t),this}vec3f64(e,t){return this._appendField(e,zS,t),this}vec4f(e,t){return this._appendField(e,E3,t),this}vec4f64(e,t){return this._appendField(e,BXe,t),this}mat3f(e,t){return this._appendField(e,DXe,t),this}mat3f64(e,t){return this._appendField(e,FXe,t),this}mat4f(e,t){return this._appendField(e,kXe,t),this}mat4f64(e,t){return this._appendField(e,LXe,t),this}vec4u8(e,t){return this._appendField(e,K3,t),this}f32(e,t){return this._appendField(e,qTe,t),this}f64(e,t){return this._appendField(e,NXe,t),this}u8(e,t){return this._appendField(e,YTe,t),this}u16(e,t){return this._appendField(e,JTe,t),this}i8(e,t){return this._appendField(e,UXe,t),this}vec2i8(e,t){return this._appendField(e,ZTe,t),this}vec2i16(e,t){return this._appendField(e,mle,t),this}vec2u8(e,t){return this._appendField(e,XTe,t),this}vec4u16(e,t){return this._appendField(e,nX,t),this}u32(e,t){return this._appendField(e,KTe,t),this}_appendField(e,t,r){if(this._fields.has(e))return void Ch(!1,`${e} already added to vertex buffer layout`);const n=t.ElementCount*p8e(t.ElementType),s=this._stride;this._stride+=n,this._fields.set(e,{size:n,constructor:t,offset:s,optional:r})}createBuffer(e){return new Ppt(this,e)}createView(e){return new Ppt(this,e)}clone(){const e=new tjt;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(t=>e=Math.max(e,p8e(t.constructor.ElementType))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}};function c7(){return new BGr}let jGr=class{constructor(e){this.fields=new Array,e.fields.forEach((t,r)=>{const n={...t,constructor:ijt(t.constructor)};this.fields.push([r,n])}),this.stride=e.stride}};const GGr=[qTe,u7,Om,E3,DXe,kXe,NXe,$Xe,zS,BXe,FXe,LXe,YTe,XTe,bq,K3,JTe,jXe,fle,nX,KTe,GXe,z7t,V7t,UXe,ZTe,H7t,W7t,q7t,mle,Y7t,X7t,J7t,K7t,Z7t,Q7t];function ijt(i){return`${i.ElementType}_${i.ElementCount}`}function UGr(i){return rjt.get(i)}const rjt=new Map;GGr.forEach(i=>rjt.set(ijt(i),i));function abe(i,e){return e.push(i.buffer),{buffer:i.buffer,layout:new jGr(i.layout)}}var lb,Eo,bn,I3,Bs,W1,wq,Ti,Wl,il,Is,Ls,gp,ks,gs,lc,vf,oa,sx,Hy;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(lb||(lb={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(Eo||(Eo={})),function(i){i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(bn||(bn={})),function(i){i[i.ADD=32774]="ADD",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.SUBTRACT=32778]="SUBTRACT",i[i.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(I3||(I3={})),function(i){i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(Bs||(Bs={})),function(i){i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(W1||(W1={})),function(i){i[i.CW=2304]="CW",i[i.CCW=2305]="CCW"}(wq||(wq={})),function(i){i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT"}(Ti||(Ti={})),function(i){i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS"}(Wl||(Wl={})),function(i){i[i.ZERO=0]="ZERO",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP"}(il||(il={})),function(i){i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(Is||(Is={})),function(i){i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.REPEAT=10497]="REPEAT",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Ls||(Ls={})),function(i){i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(gp||(gp={})),function(i){i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.RED=6403]="RED",i[i.RG=33319]="RG",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER"}(ks||(ks={})),function(i){i[i.RGBA4=32854]="RGBA4",i[i.R16F=33325]="R16F",i[i.RG16F=33327]="RG16F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.R32F=33326]="R32F",i[i.RG32F=33328]="RG32F",i[i.RGBA32F=34836]="RGBA32F",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB5_A1=32855]="RGB5_A1",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.RGB16F=34843]="RGB16F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.RGB565=36194]="RGB565",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2=32857]="RGB10_A2",i[i.RGB10_A2UI=36975]="RGB10_A2UI"}(gs||(gs={})),function(i){i[i.FLOAT=5126]="FLOAT",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.INT=5124]="INT",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(lc||(lc={})),function(i){i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(vf||(vf={})),function(i){i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.STATIC_READ=35045]="STATIC_READ",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.STREAM_COPY=35042]="STREAM_COPY"}(oa||(oa={})),function(i){i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER"}(sx||(sx={})),function(i){i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(Hy||(Hy={}));const zOe=33984;var bd,pv,f8e;(function(i){i[i.Texture=0]="Texture",i[i.BufferObject=1]="BufferObject",i[i.VertexArrayObject=2]="VertexArrayObject",i[i.Shader=3]="Shader",i[i.Program=4]="Program",i[i.FramebufferObject=5]="FramebufferObject",i[i.Renderbuffer=6]="Renderbuffer",i[i.TransformFeedback=7]="TransformFeedback",i[i.Sync=8]="Sync",i[i.UNCOUNTED=9]="UNCOUNTED",i[i.LinesOfCode=9]="LinesOfCode",i[i.Uniform=10]="Uniform",i[i.COUNT=11]="COUNT"})(bd||(bd={})),function(i){i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(pv||(pv={})),function(i){i[i.NONE=0]="NONE",i[i.BACK=1029]="BACK"}(f8e||(f8e={}));const m8e=33306;var Vh,uv,Rpt,Dpt,lbe,g8e,Fpt;(function(i){i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(Vh||(Vh={})),function(i){i[i.FLOAT=5126]="FLOAT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT=5124]="INT",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(uv||(uv={})),function(i){i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS"}(Rpt||(Rpt={})),function(i){i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED"}(Dpt||(Dpt={})),function(i){i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED"}(lbe||(lbe={})),function(i){i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(g8e||(g8e={})),function(i){i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(Fpt||(Fpt={}));let Hl=class{constructor(e,t,r,n,s,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=n,this.stride=s,this.normalized=o,this.divisor=a}};function zXe(i,e=0){const t=i.stride;return Array.from(i.fields.keys()).map(r=>{const n=i.fields.get(r),s=n.constructor.ElementCount,o=zGr(n.constructor.ElementType),a=n.offset,l=!(!n.optional||!n.optional.glNormalized);return new Hl(r,s,o,a,t,l,e)})}function zGr(i){const e=VGr[i];if(e)return e;throw new Error("BufferType not supported in WebGL")}const VGr={u8:Ti.UNSIGNED_BYTE,u16:Ti.UNSIGNED_SHORT,u32:Ti.UNSIGNED_INT,i8:Ti.BYTE,i16:Ti.SHORT,i32:Ti.INT,f32:Ti.FLOAT};var tn;(function(i){i.POSITION="position",i.NORMAL="normal",i.NORMALCOMPRESSED="normalCompressed",i.UV0="uv0",i.COLOR="color",i.SYMBOLCOLOR="symbolColor",i.SIZE="size",i.TANGENT="tangent",i.OFFSET="offset",i.PERSPECTIVEDIVIDE="perspectiveDivide",i.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",i.LENGTH="length",i.PREVPOSITION="prevPosition",i.NEXTPOSITION="nextPosition",i.SUBDIVISIONFACTOR="subdivisionFactor",i.COLORFEATUREATTRIBUTE="colorFeatureAttribute",i.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",i.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",i.DISTANCETOSTART="distanceToStart",i.UVMAPSPACE="uvMapSpace",i.BOUNDINGRECT="boundingRect",i.UVREGION="uvRegion",i.PROFILERIGHT="profileRight",i.PROFILEUP="profileUp",i.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",i.FEATUREVALUE="featureValue",i.INSTANCEMODELORIGINHI="instanceModelOriginHi",i.INSTANCEMODELORIGINLO="instanceModelOriginLo",i.INSTANCEMODEL="instanceModel",i.INSTANCEMODELNORMAL="instanceModelNormal",i.INSTANCECOLOR="instanceColor",i.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",i.LOCALTRANSFORM="localTransform",i.GLOBALTRANSFORM="globalTransform",i.BOUNDINGSPHERE="boundingSphere",i.MODELORIGIN="modelOrigin",i.MODELSCALEFACTORS="modelScaleFactors",i.FEATUREATTRIBUTE="featureAttribute",i.STATE="state",i.LODLEVEL="lodLevel",i.POSITION0="position0",i.POSITION1="position1",i.NORMAL2COMPRESSED="normal2Compressed",i.COMPONENTINDEX="componentIndex",i.VARIANTOFFSET="variantOffset",i.VARIANTSTROKE="variantStroke",i.VARIANTEXTENSION="variantExtension",i.SIDENESS="sideness",i.START="start",i.END="end",i.UP="up",i.EXTRUDE="extrude",i.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",i.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"})(tn||(tn={}));const njt=c7().vec3f(tn.POSITION).u16(tn.COMPONENTINDEX),HGr=c7().vec2u8(tn.SIDENESS);zXe(HGr);const y8e=c7().vec3f(tn.POSITION0).vec3f(tn.POSITION1).vec2i16(tn.NORMALCOMPRESSED).u16(tn.COMPONENTINDEX).u8(tn.VARIANTOFFSET,{glNormalized:!0}).u8(tn.VARIANTSTROKE).u8(tn.VARIANTEXTENSION,{glNormalized:!0}),v8e=c7().vec3f(tn.POSITION0).vec3f(tn.POSITION1).vec2i16(tn.NORMALCOMPRESSED).vec2i16(tn.NORMAL2COMPRESSED).u16(tn.COMPONENTINDEX).u8(tn.VARIANTOFFSET,{glNormalized:!0}).u8(tn.VARIANTSTROKE).u8(tn.VARIANTEXTENSION,{glNormalized:!0});tn.POSITION0,tn.POSITION1,tn.COMPONENTINDEX,tn.VARIANTOFFSET,tn.VARIANTSTROKE,tn.VARIANTEXTENSION,tn.NORMALCOMPRESSED,tn.NORMAL2COMPRESSED,tn.SIDENESS;const g$=-1;var kpt;function _8e(i,e,t,r=KGr){const n=i.vertices.position,s=i.vertices.componentIndex,o=Rx(r.anglePlanar),a=Rx(r.angleSignificantEdge),l=Math.cos(a),u=Math.cos(o),c=b8e.edge,h=c.position0,p=c.position1,m=c.faceNormal0,v=c.faceNormal1,w=JGr(i),S=XGr(i),I=S.length/4,R=e.allocate(I);let L=0;const k=I,B=t.allocate(k);let $=0,V=0,Y=0;const K=oVi(0,I),Q=new Float32Array(I);Q.forEach((H,Z,ae)=>{n.getVec(S[4*Z],h),n.getVec(S[4*Z+1],p),ae[Z]=hR(h,p)}),K.sort((H,Z)=>Q[Z]-Q[H]);const re=new Array,ne=new Array;for(let H=0;He}function YGr(i,e){const t=Mze(i.cosAngle),r=b8e.fwd,n=b8e.ortho;return ZEt(r,i.position1,i.position0),t*(yE(qC(n,i.faceNormal0,i.faceNormal1),r)>0?-1:1)>e}function XGr(i){const e=i.faces.length/3,t=i.faces,r=i.neighbors;let n=0;for(let a=0;a(e=e&&r===0,t=t&&r===n,!e&&!t)),e?QGr(i.length):t?QTe(i.length):U9(i)||i.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?ZGr(i):i}function ZGr(i){let e=!0;for(const t of i){if(t>=65536)return U9(i)?new Uint32Array(i):i;t>=256&&(e=!1)}return e?new Uint8Array(i):new Uint16Array(i)}function sjt(i){return i<=a3?new Array(i):i<=65536?new Uint16Array(i):new Uint32Array(i)}let Dj=(()=>{const i=new Uint32Array(131072);for(let e=0;e{const i=new Uint16Array(65536);for(let e=0;eDj.length){const e=Math.max(2*Dj.length,i);Dj=new Uint32Array(e);for(let t=0;t_de.length){const e=Math.max(2*_de.length,i);_de=new Uint8Array(e)}return new Uint8Array(_de.buffer,0,i)}function w8e(i,e,t){const r=Array.isArray(i),n=r?i.length/e:i.byteLength/(4*e),s=r?i:new Uint32Array(i,0,n*e),o=t?.minReduction??0,a=t?.originalIndices||null,l=a?a.length:0,u=t?.componentOffsets||null;let c=0;if(u)for(let $=0;$c&&(c=V)}else c=n;const h=Math.floor(1.1*c)+1;(VE==null||VE.length<2*h)&&(VE=new Uint32Array(gXi(2*h)));for(let $=0;$<2*h;$++)VE[$]=0;let p=0;const m=!!u&&!!a,v=m?l:n;let w=sjt(n);const S=new Uint32Array(l),I=1.96;let R=o!==0?Math.ceil(4*I*I/(o*o)*o*(1-o)):v,L=1,k=u?u[1]:v;for(let $=0;$=h&&(Q-=h)}re===p&&(VE[2*Q]=K,VE[2*Q+1]=V+1,p++),w[V]=re}if(o!==0&&1-p/n>>2)|0;return r>>>0}let VE=null;function Lpt(i,e,t){const r=e/3,n=new Uint32Array(t+1),s=new Uint32Array(t+1),o=(I,R)=>{I{if(I{const L=2*I,k=R-I;for(let B=1;B=0&&u[L+2*Y]>$;Y--)u[L+2*Y+2]=u[L+2*Y],u[L+2*Y+3]=u[L+2*Y+1];u[L+2*Y+2]=$,u[L+2*Y+3]=V}};for(let I=0;II===i[3*R]?0:I===i[3*R+1]?1:I===i[3*R+2]?2:-1,w=(I,R)=>{const L=v(I,R);m[3*R+L]=-1},S=(I,R,L,k)=>{const B=v(I,R);m[3*R+B]=k;const $=v(L,k);m[3*k+$]=R};for(let I=0;I=0?1:-1)*(1-Math.abs(l)):a,c=n<=0?(l>=0?1:-1)*(1-Math.abs(a)):l,h=e*s;i[h]=Npt(u),i[h+1]=Npt(c)}function Npt(i){return uu(Math.round(32767*i),-32767,32767)}let ajt=class{updateSettings(e){this.settings=e,this._edgeHashFunction=e.reducedPrecision?nUr:rUr}write(e,t,r){const n=this._edgeHashFunction(r);wde.seed=n;const s=wde.getIntRange(0,255),o=wde.getIntRange(0,this.settings.variants-1),a=.7,l=wde.getFloat(),u=255*(.5*sUr(-(1-Math.min(l/a,1))+Math.max(0,l-a)/(1-a),1.2)+.5);e.position0.setVec(t,r.position0),e.position1.setVec(t,r.position1),e.componentIndex.set(t,r.componentIndex),e.variantOffset.set(t,s),e.variantStroke.set(t,o),e.variantExtension.set(t,u)}trim(e,t){return e.slice(0,t)}};const VXe=new Float32Array(6),ube=new Uint32Array(VXe.buffer),aF=new Uint32Array(1);function rUr(i){const e=VXe;e[0]=i.position0[0],e[1]=i.position0[1],e[2]=i.position0[2],e[3]=i.position1[0],e[4]=i.position1[1],e[5]=i.position1[2],aF[0]=5381;for(let t=0;tnull,write:()=>{},trim:()=>null},mUr=Object.freeze(Object.defineProperty({__proto__:null,default:uUr},Symbol.toStringTag,{value:"Module"}));let oee=class extends xs(Ci){constructor(e){super(e),this.type="georeferenced",this.origin=null}};x([Wr({georeferenced:"georeferenced"},{readOnly:!0})],oee.prototype,"type",void 0),x([D({type:[Number],nonNullable:!1,json:{write:!0}})],oee.prototype,"origin",void 0),oee=x([Qe("esri.geometry.support.MeshGeoreferencedVertexSpace")],oee);const UC=oee;let aee=class extends xs(Ci){constructor(e){super(e),this.type="local",this.origin=gr()}};x([Wr({local:"local"},{readOnly:!0})],aee.prototype,"type",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],aee.prototype,"origin",void 0),aee=x([Qe("esri.geometry.support.MeshLocalVertexSpace")],aee);const lH=aee,HXe=()=>di.getLogger("esri.views.3d.support.buffer.math");function ujt(i,e,t){Sk(i.typedBuffer,e.typedBuffer,t,i.typedBufferStride,e.typedBufferStride)}function Sk(i,e,t,r=3,n=r){if(i.length/r!==Math.ceil(e.length/n))return i;const s=i.length/r,o=t[0],a=t[1],l=t[2],u=t[4],c=t[5],h=t[6],p=t[8],m=t[9],v=t[10],w=t[12],S=t[13],I=t[14];let R=0,L=0;for(let k=0;k0){const p=1/Math.sqrt(h);i[o]=p*l,i[o+1]=p*u,i[o+2]=p*c}s+=r,o+=t}}function gUr(i,e,t){const r=Math.min(i.count,e.count),n=i.typedBuffer,s=i.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride;let l=0,u=0;for(let c=0;c>t,n[u+1]=o[l+1]>>t,n[u+2]=o[l+2]>>t,l+=a,u+=s}Object.freeze(Object.defineProperty({__proto__:null,normalize:gle,normalizeView:hjt,scale:cbe,scaleView:E8e,shiftRight:gUr,transformMat3:Z3,transformMat3View:cjt,transformMat4:Sk,transformMat4View:ujt,translate:WXe},Symbol.toStringTag,{value:"Module"}));function Upt(){return di.getLogger("esri.geometry.Mesh")}function yUr(i){const{vertexSpace:e}=i;if(e.origin!=null)return i.clone();const{anchor:t}=i,r=t.clone(),n=new UC({origin:[r.x,r.y,r.z]}),s=i.cloneWithVertexSpace(n),{position:o}=s.vertexAttributes;return s.vertexAttributes.position=WXe(new Float64Array(o.length),o,[-r.x,-r.y,-(r.z??0)]),s.vertexAttributesChanged(),s}function VS(i){return i.origin!=null}function djt(i){return VS(i.vertexSpace)}function hbe(i,e){if(!VS(i))return null;const[t,r,n]=i.origin;return new $i({x:t,y:r,z:n,spatialReference:e})}function vUr(i,e){const{x:t,y:r,z:n,spatialReference:s}=i,o=[t,r,n??0];if(e?.geographic!==void 0){if(UF(Upt(),"option: geographic",{replacement:"use vertexSpace option instead",version:"4.29",warnOnce:!0}),!e?.vertexSpace)return e?.geographic?new lH({origin:o}):new UC({origin:o});Upt().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")}if(!e?.vertexSpace)return s.isGeographic||s.isWebMercator?new lH({origin:o}):new UC({origin:o});switch(e.vertexSpace){case"local":return new lH({origin:o});case"georeferenced":return new UC({origin:o});case"georeferenced-absolute":return new UC}}function zpt(i){return i.isGeographic||i.isWebMercator?"local":"georeferenced"}function Vpt(i,e){return i==="local"?new lH({origin:e}):new UC({origin:e})}function Yd(){return[1,0,0,0,1,0,0,0,1]}function _Ur(i){return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]]}function uH(i,e,t,r,n,s,o,a,l){return[i,e,t,r,n,s,o,a,l]}function bUr(i,e){return new Float64Array(i,e,9)}const h7=Yd();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:h7,clone:_Ur,create:Yd,createView:bUr,fromValues:uH},Symbol.toStringTag,{value:"Module"}));function Pm(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Vse(i){return[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],i[9],i[10],i[11],i[12],i[13],i[14],i[15]]}function wUr(i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w){return[i,e,t,r,n,s,o,a,l,u,c,h,p,m,v,w]}function xUr(i,e){return new Float64Array(i,e,16)}const ZA=Pm();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:ZA,clone:Vse,create:Pm,createView:xUr,fromValues:wUr},Symbol.toStringTag,{value:"Module"}));const SUr=new Xi(bEt),lee=new Xi(a2e),uee=new Xi(l2e);new Xi(gie);function Bx(i){const e=Hpt.get(i);if(e)return e;let t=SUr;if(i)if(i===lee)t=lee;else if(i===uee)t=uee;else{const r=i.wkid,n=i.latestWkid;if(r!=null||n!=null)eW(r)||eW(n)?t=lee:(tW(r)||tW(n))&&(t=uee);else{const s=i.wkt2??i.wkt;if(s){const o=s.toUpperCase();o===TUr?t=lee:o===CUr&&(t=uee)}}}return Hpt.set(i,t),t}const Hpt=new Map,TUr=lee.wkt.toUpperCase(),CUr=uee.wkt.toUpperCase();function pjt(i,e,t){const r=Math.sin(i),n=Math.cos(i),s=Math.sin(e),o=Math.cos(e),a=t;return a[0]=-r,a[4]=-s*n,a[8]=o*n,a[12]=0,a[1]=n,a[5]=-s*r,a[9]=o*r,a[13]=0,a[2]=0,a[6]=o,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}function EUr(i,e,t){return pjt(i,e,t),BR(t,t),t}function MB(i,e,t,r){if(i==null||r==null)return!1;const n=Bne(i,RPt),s=Bne(r,tar);if(n===s&&!Wpt(s)&&(n!==Gi.UNKNOWN||Ya(i,r)))return vOt(t,e),!0;if(Wpt(s)){const o=Lz[n][Gi.LON_LAT],a=Lz[Gi.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,OD,0),a(OD,0,PD,0),pjt(xde*OD[0],xde*OD[1],t),t[12]=PD[0],t[13]=PD[1],t[14]=PD[2],!0)}if((s===Gi.WEB_MERCATOR||s===Gi.PLATE_CARREE||s===Gi.WGS84)&&(n===Gi.WGS84||n===Gi.CGCS2000&&s===Gi.PLATE_CARREE||n===Gi.SPHERICAL_ECEF||n===Gi.WEB_MERCATOR)){const o=Lz[n][Gi.LON_LAT],a=Lz[Gi.LON_LAT][s];return o!=null&&a!=null&&(o(e,0,OD,0),a(OD,0,PD,0),n===Gi.SPHERICAL_ECEF?EUr(xde*OD[0],xde*OD[1],t):Sae(t),t[12]=PD[0],t[13]=PD[1],t[14]=PD[2],!0)}return!1}function Wpt(i){return i===Gi.SPHERICAL_ECEF||i===Gi.SPHERICAL_MARS_PCPF||i===Gi.SPHERICAL_MOON_PCPF}const xde=Rx(1),OD=gr(),PD=gr();function dbe(i,e=!1){return i<=a3?e?new Array(i).fill(0):new Array(i):new Float64Array(i)}function IUr(i){return(U9(i)?i.length:i.byteLength/8)<=a3?Array.from(i):new Float64Array(i)}function AUr(i,e,t){return Array.isArray(i)?i.slice(e,e+t):i.subarray(e,e+t)}function MUr(i,e){for(let t=0;tc_()?(i[0]=e[0]/r,i[1]=e[1]/r,i[2]=e[2]/r):(i[0]=1,i[1]=0,i[2]=0),t}function vle(i,e,t){const r=e[0],n=e[1],s=e[2],o=e[3],a=t[0],l=t[1],u=t[2],c=t[3];return i[0]=r*c+o*a+n*u-s*l,i[1]=n*c+o*l+s*a-r*u,i[2]=s*c+o*u+r*l-n*a,i[3]=o*c-r*a-n*l-s*u,i}function FUr(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l+o*a,i[1]=n*l+s*a,i[2]=s*l-n*a,i[3]=o*l-r*a,i}function kUr(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l-s*a,i[1]=n*l+o*a,i[2]=s*l+r*a,i[3]=o*l-n*a,i}function LUr(i,e,t){t*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],a=Math.sin(t),l=Math.cos(t);return i[0]=r*l+n*a,i[1]=n*l-r*a,i[2]=s*l+o*a,i[3]=o*l-s*a,i}function NUr(i,e){const t=e[0],r=e[1],n=e[2];return i[0]=t,i[1]=r,i[2]=n,i[3]=Math.sqrt(Math.abs(1-t*t-r*r-n*n)),i}function Uge(i,e,t,r){const n=e[0],s=e[1],o=e[2],a=e[3];let l,u,c,h,p,m=t[0],v=t[1],w=t[2],S=t[3];return u=n*m+s*v+o*w+a*S,u<0&&(u=-u,m=-m,v=-v,w=-w,S=-S),1-u>c_()?(l=Math.acos(u),c=Math.sin(l),h=Math.sin((1-r)*l)/c,p=Math.sin(r*l)/c):(h=1-r,p=r),i[0]=h*n+p*m,i[1]=h*s+p*v,i[2]=h*o+p*w,i[3]=h*a+p*S,i}function $Ur(i){const e=sae,t=e(),r=e(),n=e(),s=Math.sqrt(1-t),o=Math.sqrt(t);return i[0]=s*Math.sin(2*Math.PI*r),i[1]=s*Math.cos(2*Math.PI*r),i[2]=o*Math.sin(2*Math.PI*n),i[3]=o*Math.cos(2*Math.PI*n),i}function BUr(i,e){const t=e[0],r=e[1],n=e[2],s=e[3],o=t*t+r*r+n*n+s*s,a=o?1/o:0;return i[0]=-t*a,i[1]=-r*a,i[2]=-n*a,i[3]=s*a,i}function PF(i,e){return i[0]=-e[0],i[1]=-e[1],i[2]=-e[2],i[3]=e[3],i}function mjt(i,e){const t=e[0]+e[4]+e[8];let r;if(t>0)r=Math.sqrt(t+1),i[3]=.5*r,r=.5/r,i[0]=(e[5]-e[7])*r,i[1]=(e[6]-e[2])*r,i[2]=(e[1]-e[3])*r;else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);const s=(n+1)%3,o=(n+2)%3;r=Math.sqrt(e[3*n+n]-e[3*s+s]-e[3*o+o]+1),i[n]=.5*r,r=.5/r,i[3]=(e[3*s+o]-e[3*o+s])*r,i[s]=(e[3*s+n]+e[3*n+s])*r,i[o]=(e[3*o+n]+e[3*n+o])*r}return i}function gjt(i,e,t,r){const n=.5*Math.PI/180;e*=n,t*=n,r*=n;const s=Math.sin(e),o=Math.cos(e),a=Math.sin(t),l=Math.cos(t),u=Math.sin(r),c=Math.cos(r);return i[0]=s*l*c-o*a*u,i[1]=o*a*c+s*l*u,i[2]=o*l*u-s*a*c,i[3]=o*l*c+s*a*u,i}function jUr(i){return"quat("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+")"}const GUr=Fne,yjt=k1,UUr=iMt,zUr=vle,VUr=oMt,HUr=cMt,WUr=dVe,vjt=cVe,qUr=vjt,_jt=hVe,YUr=_jt,qXe=uMt,bjt=dMt,XUr=$2e;function JUr(i,e,t){const r=yE(e,t);return r<-.999999?(qC(HE,KUr,e),eIt(HE)<1e-6&&qC(HE,ZUr,e),ly(HE,HE),ER(i,HE,Math.PI),i):r>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(qC(HE,e,t),i[0]=HE[0],i[1]=HE[1],i[2]=HE[2],i[3]=1+r,qXe(i,i))}const HE=gr(),KUr=Do(1,0,0),ZUr=Do(0,1,0);function QUr(i,e,t,r,n,s){return Uge(qpt,e,n,s),Uge(Ypt,t,r,s),Uge(i,qpt,Ypt,2*s*(1-s)),i}const qpt=Dm(),Ypt=Dm();function ezr(i,e,t,r){const n=tzr;return n[0]=t[0],n[3]=t[1],n[6]=t[2],n[1]=r[0],n[4]=r[1],n[7]=r[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],qXe(i,mjt(i,n))}const tzr=Yd();Object.freeze(Object.defineProperty({__proto__:null,add:UUr,calculateW:NUr,conjugate:PF,copy:GUr,dot:HUr,equals:XUr,exactEquals:bjt,fromEuler:gjt,fromMat3:mjt,getAxisAngle:eCe,identity:DUr,invert:BUr,len:qUr,length:vjt,lerp:WUr,mul:zUr,multiply:vle,normalize:qXe,random:$Ur,rotateX:FUr,rotateY:kUr,rotateZ:LUr,rotationTo:JUr,scale:VUr,set:yjt,setAxes:ezr,setAxisAngle:ER,slerp:Uge,sqlerp:QUr,sqrLen:YUr,squaredLength:_jt,str:jUr},Symbol.toStringTag,{value:"Module"}));function Q3(i=Sjt){return[i[0],i[1],i[2],i[3]]}function zge(i,e,t=Q3()){return Px(t,i),t[3]=e,t}function wjt(i,e=Q3()){const t=wOt(cee,i);return xjt(e,yb(eCe(e,t))),e}function Xpt(i,e,t=Q3()){return ER(cee,i,Hse(i)),ER(Jpt,e,Hse(e)),vle(cee,Jpt,cee),xjt(t,yb(eCe(t,cee)))}function izr(i,e,t,r=Q3()){return zge(XEt,i,Sde),zge(JEt,e,Kpt),zge(zve,t,Zpt),Xpt(Sde,Kpt,Sde),Xpt(Sde,Zpt,r),r}function rzr(i){return i[3]}function Hse(i){return Rx(i[3])}function xjt(i,e){return i[3]=e,i}const Sjt=[0,0,1,0],cee=Dm(),Jpt=Dm();Q3();const Sde=Q3(),Kpt=Q3(),Zpt=Q3();var I8e;let AI=I8e=class extends Ci{constructor(i){super(i),this.translation=gr(),this.rotationAxis=sW(Sjt),this.rotationAngle=0,this.scale=Do(1,1,1)}get rotation(){return zge(this.rotationAxis,this.rotationAngle)}set rotation(i){this.rotationAxis=Ef(i),this.rotationAngle=rzr(i)}get localMatrix(){const i=Pm();return ER(Qpt,this.rotation,Hse(this.rotation)),xOt(i,Qpt,this.translation,this.scale),i}get localMatrixInverse(){return AY(Pm(),this.localMatrix)}applyLocal(i,e){return c0(e,i,this.localMatrix)}applyLocalInverse(i,e){return c0(e,i,this.localMatrixInverse)}equals(i){return this===i||i!=null&&TOt(this.localMatrix,i.localMatrix)}clone(){const i={translation:Ef(this.translation),rotationAxis:Ef(this.rotationAxis),rotationAngle:this.rotationAngle,scale:Ef(this.scale)};return new I8e(i)}};x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"translation",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"rotationAxis",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],AI.prototype,"rotationAngle",void 0),x([D({type:[Number],nonNullable:!0,json:{write:!0}})],AI.prototype,"scale",void 0),x([D()],AI.prototype,"rotation",null),x([D()],AI.prototype,"localMatrix",null),x([D()],AI.prototype,"localMatrixInverse",null),AI=I8e=x([Qe("esri.geometry.support.MeshTransform")],AI);const Qpt=Dm(),Tk=AI;function Tjt(i,e){return i.isGeographic||i.isWebMercator&&(e??!0)}function Cjt(i,e){switch(i.type){case"georeferenced":return e.isGeographic;case"local":return e.isGeographic||e.isWebMercator}}function YXe(i,e,t,r){if(r!==void 0){UF(di.getLogger(i),"option: geographic",{replacement:"use mesh vertexSpace and spatial reference to control how operations are performed",version:"4.29",warnOnce:!0});const n=e.type==="local";if(!VS(e)||r===n)return t.isGeographic||t.isWebMercator&&r;di.getLogger(i).warnOnce(`Specifying the 'geographic' parameter (${r}) for a Mesh vertex space of type "${e.type}" is not supported. This parameter will be ignored.`)}return Cjt(e,t)}const tCe=()=>di.getLogger("esri.geometry.support.meshUtils.normalProjection");function XXe(i,e,t,r,n){return rCe(r)?(iCe(WP.TO_PCPF,Om.fromTypedArray(i),zS.fromTypedArray(e),zS.fromTypedArray(t),r,Om.fromTypedArray(n)),n):(tCe().error("Cannot convert spatial reference to PCPF"),n)}function JXe(i,e,t,r,n){return rCe(r)?(iCe(WP.FROM_PCPF,Om.fromTypedArray(i),zS.fromTypedArray(e),zS.fromTypedArray(t),r,Om.fromTypedArray(n)),n):(tCe().error("Cannot convert to spatial reference from PCPF"),n)}function KXe(i,e,t){return sy(i,e,0,t,Bx(e),0,i.length/3),t}function ZXe(i,e,t){return sy(i,Bx(t),0,e,t,0,i.length/3),e}function nzr(i,e,t){return y3(om,t),Z3(e,i,om),bWe(om)||gle(e,e),e}function szr(i,e,t){if(y3(om,t),Z3(e,i,om,4),bWe(om)||gle(e,e,4),i!==e)for(let r=3;rnew Uint32Array(n))):this._createIndexAllThread(r,t)}_createIndexAllThread(e,t){const r=new Array(t.length/9);let n=0;for(let s=0;s!r.faces)?{position:t}:{position:t,components:e.components.map(r=>r.faces)}}_createPooledRBush(){return new sbe(9,yi("esri-csp-restrictions")?e=>e:[".minX",".minY",".maxX",".maxY"])}};function eft(i,e,t,r){return{minX:Math.min(i[e],i[t],i[r]),maxX:Math.max(i[e],i[t],i[r]),minY:Math.min(i[e+1],i[t+1],i[r+1]),maxY:Math.max(i[e+1],i[t+1],i[r+1]),p0:[i[e],i[e+1],i[e+2]],p1:[i[t],i[t+1],i[t+2]],p2:[i[r],i[r+1],i[r+2]]}}const yzr=Object.freeze(Object.defineProperty({__proto__:null,default:gzr},Symbol.toStringTag,{value:"Module"}));function tft(i=!1,e){if(i){const{elevationInfo:t,alignPointsInFeatures:r}=e;return new bzr(t,r)}return new vzr}let vzr=class{async alignCandidates(e,t,r){return e}notifyElevationSourceChange(){}};const _zr=1024;let bzr=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new d3(_zr),this._cacheVersion=0}async alignCandidates(e,t,r){const n=this._elevationInfo;return n==null||n.mode!=="absolute-height"||n.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,r):(this._alignAbsoluteElevationCandidates(e,t,n),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,r){const{offset:n,unit:s}=r;if(n==null)return;const o=WF(t),a=n*(Tsr(s??"meters")/o);for(const l of e)switch(l.type){case"edge":l.start.z+=a,l.end.z+=a;continue;case"vertex":l.target.z+=a;continue}}async _alignComputedElevationCandidates(e,t,r){const n=new Map;for(const p of e)qh(n,p.objectId,xzr).push(p);const[s,o,a]=this._prepareQuery(n,t),l=await this._alignPointsInFeatures(s,r);if(hn(r),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,r);this._applyCacheAndResponse(s,l,o);const{drapedObjectIds:u,failedObjectIds:c}=l,h=[];for(const p of e){const{objectId:m}=p;u.has(m)&&p.type==="edge"&&(p.draped=!0),c.has(m)||h.push(p)}return h}_prepareQuery(e,t){const r=[],n=[];for(const[s,o]of e){const a=[];for(const l of o)this._addToQueriesOrCachedResult(s,l.target,a,n),l.type==="edge"&&(this._addToQueriesOrCachedResult(s,l.start,a,n),this._addToQueriesOrCachedResult(s,l.end,a,n));a.length!==0&&r.push({objectId:s,points:a})}return[{spatialReference:t.toJSON(),pointsInFeatures:r},n,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,r,n){const s=ift(e,t),o=this._alignmentsCache.get(s);o==null?r.push(t):n.push(new wzr(t,o))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:r,failedObjectIds:n},s){for(const l of s)l.apply();let o=0;const a=this._alignmentsCache;for(const{objectId:l,points:u}of e.pointsInFeatures){if(n.has(l)){o+=u.length;continue}const c=!r.has(l);for(const h of u){const p=ift(l,h),m=t[o++];h.z=m,c&&a.put(p,m,1)}}}},wzr=class{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}};function ift(i,{x:e,y:t,z:r,spatialReference:n}){return`${i}-${e}-${t}-${r??0}}-wkid:${n?.wkid}`}function xzr(){return[]}let Szr=class{filter(e,t){return t}notifyElevationSourceChange(){}},Tzr=class{filter(e,t){const{point:r,distance:n}=e,{z:s}=r;if(s==null||t.length===0)return t;const o=Mzr(n),a=this._updateCandidatesTo3D(t,r,o).filter(Czr);return a.sort(Ozr),a}_updateCandidatesTo3D(e,t,r){for(const n of e)switch(n.type){case"edge":Ezr(n,t,r);continue;case"vertex":Azr(n,t,r);continue}return e}};function Czr(i){return i.distance<=1}function rft(i=!1){return i?new Tzr:new Szr}function Ezr(i,e,{x:t,y:r,z:n}){const{start:s,end:o,target:a}=i;i.draped||Izr(a,e,s,o);const l=(e.x-a.x)/t,u=(e.y-a.y)/r,c=(e.z-a.z)/n;i.distance=Math.sqrt(l*l+u*u+c*c)}function Izr(i,e,t,r){const n=r.x-t.x,s=r.y-t.y,o=r.z-t.z,a=n*n+s*s+o*o,l=(e.x-t.x)*n+(e.y-t.y)*s+o*(e.z-t.z),u=Math.min(1,Math.max(0,l/a)),c=t.x+n*u,h=t.y+s*u,p=t.z+o*u;i.x=c,i.y=h,i.z=p}function Azr(i,e,{x:t,y:r,z:n}){const{target:s}=i,o=(e.x-s.x)/t,a=(e.y-s.y)/r,l=(e.z-s.z)/n,u=Math.sqrt(o*o+a*a+l*l);i.distance=u}function Mzr(i){return typeof i=="number"?{x:i,y:i,z:i}:i}function Ozr(i,e){return i.distance-e.distance}function nft(i=!1,e){return i?new Dzr(e):new Pzr}let Pzr=class{async fetch(){return[]}notifySymbologyChange(){}};const Rzr=1024;let Dzr=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new d3(Rzr),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const r=[],n=[],s=this._candidatesCache;for(const h of e){const p=sft(h),m=s.get(p);if(m)for(const v of m)n.push(li(v));else r.push(h),s.put(p,[],1)}if(r.length===0)return n;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(r,t);if(hn(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:c}=a;for(let h=0;he.callback(t)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};x([D()],Vge.prototype,"updating",void 0),Vge=x([Qe("esri.core.AsyncSequence")],Vge);let Fzr=class{constructor(e,t){this.data=e,this.resolution=t,this.state={type:vu.CREATED},this.alive=!0}process(e){switch(this.state.type){case vu.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case vu.FETCH_COUNT:break;case vu.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case vu.FETCH_FEATURES:break;case vu.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case vu.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case vu.CREATED:case vu.FETCH_COUNT:return 0;case vu.FETCHED_COUNT:return this.state.featureCount;case vu.FETCH_FEATURES:return this.state.previous.featureCount;case vu.FETCHED_FEATURES:return this.state.features.length;case vu.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case vu.CREATED:return"created";case vu.FETCH_COUNT:return"fetch-count";case vu.FETCHED_COUNT:return"fetched-count";case vu.FETCH_FEATURES:return"fetch-features";case vu.FETCHED_FEATURES:return"fetched-features";case vu.DONE:return"done"}}_gotoFetchCount(e,t){return{type:vu.FETCH_COUNT,previous:e,task:pE(async r=>{const n=await s5e(t.fetchCount(this,r));this.state.type===vu.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,n.ok?n.value:1/0))})}}_gotoFetchedCount(e,t){return{type:vu.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:vu.FETCH_FEATURES,previous:e,task:pE(async r=>{const n=await s5e(t.fetchFeatures(this,e.featureCount,r));this.state.type===vu.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,n.ok?n.value:[]))})}}_gotoFetchedFeatures(e,t){return{type:vu.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:vu.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:vu.CREATED},e.type){case vu.CREATED:case vu.FETCHED_COUNT:case vu.FETCHED_FEATURES:case vu.DONE:break;case vu.FETCH_COUNT:case vu.FETCH_FEATURES:e.task.abort()}}intersects(e){return e==null||!this.data.extent||(tB(e,oft),aae(this.data.extent,oft))}};var vu;(function(i){i[i.CREATED=0]="CREATED",i[i.FETCH_COUNT=1]="FETCH_COUNT",i[i.FETCHED_COUNT=2]="FETCHED_COUNT",i[i.FETCH_FEATURES=3]="FETCH_FEATURES",i[i.FETCHED_FEATURES=4]="FETCHED_FEATURES",i[i.DONE=5]="DONE"})(vu||(vu={}));const oft=Wo();let Rd=class extends un{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),r=bve(e,this._mandatoryOutFields);uHi(r,t)||(this._set("outFields",r),V4e(r,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),r=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(r)&&this._set("filter",r)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new Mb,this._pendingEdits=new Vge,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{UB(e,t,({id:r},{id:n})=>r===n)||this._process()},Kl),this.addHandles(v0(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}applyEdits(e){this._pendingEdits.push(e,async t=>{if(t.addedFeatures.length===0&&t.updatedFeatures.length===0&&t.deletedFeatures.length===0)return;for(const[,n]of this._pendingTiles)n.reset();const r={...t,deletedFeatures:t.deletedFeatures.map(({objectId:n,globalId:s})=>n&&n!==-1?n:this._lookupObjectIdByGlobalId(s))};await this._updatingHandles.addPromise(this.store.processEdits(r,(n,s)=>this._queryFeaturesById(n,s),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Fx(this.url))return;const e=pE(async t=>{try{const r=await hDt(this.url,new Kn({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=hr.fromJSON(r.data?.extent)}catch(r){_a(r),di.getLogger(this).warn("Failed to fetch data extent",r)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(wa(()=>e.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:r}of e.missingTiles){const n=this._pendingTiles.get(t.id);n?(n.resolution=r,n.alive=!0):this._createPendingTile(t,r)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const r=this.tilesOfInterest[t],n=this.store.process(r,(s,o)=>this._verifyTileComplexity(s,o),this.outFields);e==null?e=n:e.prepend(n)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,r)=>this._fetchCount(t,r),fetchFeatures:(t,r,n)=>this._fetchFeatures(t,r,n),finish:(t,r)=>this._finishPendingTile(t,r),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{e===s.attributes[t]&&(n=s.objectId??s.attributes[r])}),n==null)throw new Error(`Expected to find a feature with globalId ${e}`);return n}_queryFeaturesById(e,t){const r=this._createFeaturesQuery();return r.objectIds=e,this._queryFeatures(r,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:r}=this,{data:n}=await uDt(this.url,e,new yhr({sourceSpatialReference:r}),{query:this._configuration.customParameters,timeout:qOe,signal:t});return Gdr(n)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:r}=this,{data:n}=await OW(this.url,e,r,{query:this._configuration.customParameters,timeout:qOe,signal:t});return HHe(n,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),r=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,n=bve(mCt(this.outFields,r??new Set),this._mandatoryOutFields);return t.outFields=Array.from(n),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new Kn({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&e!=null?iB(e.data.extent,this.tileInfo.spatialReference):void 0}),r=this._configuration.filter;return r!=null&&(t.where=r.where,t.gdbVersion=r.gdbVersion,t.timeExtent=r.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,r){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:n,supportsCacheHint:s,tileMaxRecordCount:o,maxRecordCount:a,supportsResultType:l}=this.capabilities.query,u=n?Kn.MAX_MAX_RECORD_COUNT_FACTOR:1,c=u*((l||s)&&o?o:a||kzr);return e.start=t,n?(e.maxRecordCountFactor=Math.min(u,Math.ceil(r/c)),e.num=Math.min(r,e.maxRecordCountFactor*c)):e.num=Math.min(r,c),!0}};x([D({constructOnly:!0})],Rd.prototype,"url",void 0),x([D({constructOnly:!0})],Rd.prototype,"objectIdField",void 0),x([D({constructOnly:!0})],Rd.prototype,"globalIdField",void 0),x([D({constructOnly:!0})],Rd.prototype,"capabilities",void 0),x([D({constructOnly:!0})],Rd.prototype,"sourceSpatialReference",void 0),x([D({constructOnly:!0})],Rd.prototype,"spatialReference",void 0),x([D({constructOnly:!0})],Rd.prototype,"store",void 0),x([D({readOnly:!0})],Rd.prototype,"_minimumVerticesPerFeature",null),x([D()],Rd.prototype,"_mandatoryOutFields",null),x([D()],Rd.prototype,"outFields",null),x([D()],Rd.prototype,"suspended",void 0),x([D()],Rd.prototype,"filter",null),x([D()],Rd.prototype,"customParameters",null),x([D({readOnly:!0})],Rd.prototype,"_configuration",null),x([D()],Rd.prototype,"tileInfo",null),x([D()],Rd.prototype,"tileSize",null),x([D()],Rd.prototype,"tilesOfInterest",void 0),x([D({readOnly:!0})],Rd.prototype,"updating",null),x([D({readOnly:!0})],Rd.prototype,"updatingExcludingEdits",null),x([D({readOnly:!0})],Rd.prototype,"availability",void 0),x([D()],Rd.prototype,"hasZ",null),Rd=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],Rd);const kzr=2e3,qOe=6e5,Lzr=1e6,Nzr=25,$zr=1;let Bzr=class{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(t!=null&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[r,n]of this._store){if(this._byteSize<=e)break;this.delete(r),t(n)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}},y$=class extends un{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*RW.MEGABYTES,this._tileBounds=new CXe,this._tiles=new Bzr,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Wo()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const r=this.featureStore.upsertMany(t),n=r.map(s=>new Set(Object.keys(s.attributes))).reduce((s,o)=>z4e(s,o),new Set(Object.keys(r[0]?.attributes??[])));this._addTileStorage(e,new Set(r.map(s=>s.objectId)),jzr(r),n),this._tiles.applyByteSizeLimit(this.maximumByteSize,s=>this._removeTileStorage(s))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,r){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,r)}_addTileStorage(e,t,r,n){const s=e.id;this._tiles.set(s,new zzr(e,t,r,n)),this._tileBounds.set(s,e.extent),this._tileFeatureCounts.set(s,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const n of e.objectIds)this._unreferenceFeature(n)===G6.REMOVED&&t.push(n);this.featureStore.removeManyById(t);const r=e.data.id;this._tiles.delete(r),this._tileBounds.delete(r)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const r of e)t.objectIds.delete(r);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,r){const n=(await t(e,r)).features,{hasZ:s,hasM:o}=this.featureStore;for(const a of n){const l=O1e(this._tmpBoundingRect,a.geometry,s,o);l!=null&&this._tileBounds.forEachInBounds(l,u=>{const c=this._tiles.get(u);this.featureStore.add(a);const h=a.objectId;c.objectIds.has(h)||(c.objectIds.add(h),this._referenceFeature(h),this._tileFeatureCounts.set(c.data.id,c.objectIds.size))})}}process(e,t=()=>!0,r){if(this.tileInfo==null||!e.extent||this.extent!=null&&!aae(tB(this.extent,this._tmpBoundingRect),e.extent))return new M8e(e);const n=this.getAttributesForTile(e.id);if(V4e(r,n))return new M8e(e);const s=this._createTileTree(e,this.tileInfo);return this._simplify(s,t,null,0,1),this._collectMissingTiles(e,s,this.tileInfo,r)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,r,n){const s=this._tileFeatureCounts.get(e.id);if(s!=null)return s;const o=await PHe(t,r,n);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const r=new aft(e.level,e.row,e.col);return t.updateTileInfo(r,fu.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,n=>{const s=this._tiles.get(n)?.data;s&&this._tilesAreRelated(e,s)&&this._populateChildren(r,s,t,this._tileFeatureCounts.get(s.id)||0)}),r}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const r=e.level>s,a=t.col>>s,l=e.row<<1,u=a-(e.col<<1)+(o-l<<1),c=e.children[u];if(c!=null)this._populateChildren(c,t,r,n);else{const h=new aft(e.level+1,o,a);r.updateTileInfo(h,fu.ExtrapolateOptions.POWER_OF_TWO),e.children[u]=h,this._populateChildren(h,t,r,n)}}_simplify(e,t,r,n,s){const o=s*s;if(e.isLeaf)return t(this.getFeatureCount(e),s)?0:(this._remove(e),r!=null&&(r.children[n]=null),o);const a=s/2,l=a*a;let u=0;for(let c=0;c{const o=this._tiles.get(s.id);if(o){r=r?z4e(r,o.attributeKeys):new Set(o.attributeKeys),n+=o.byteSize;for(const a of o.objectIds)t.has(a)||(t.add(a),this._referenceFeature(a));this._remove(s)}}),this._addTileStorage(e,t,n,r??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const r of e.children)r!=null&&(r.isLeaf?t(r):this._forEachLeaf(r,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&l),a):this._collectMissingTilesRecurse(u,t,a,n)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?G6.ADDED:G6.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),G6.REMOVED):(t>0&&this._refCounts.set(e,t),G6.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(e=>`${e.data.id}:[${Array.from(e.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(e=>`${e}:${this._refCounts.get(e)}`)}}};function jzr(i){return i.reduce((e,t)=>e+Gzr(t),0)}function Gzr(i){return 32+Uzr(i.geometry)+uVi(i.attributes)}function Uzr(i){if(i==null)return 0;const e=R4e(i.lengths,4);return 32+R4e(i.coords,8)+e}x([D({constructOnly:!0})],y$.prototype,"featureStore",void 0),x([D()],y$.prototype,"tileInfo",void 0),x([D()],y$.prototype,"extent",void 0),x([D()],y$.prototype,"maximumByteSize",void 0),y$=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],y$);let zzr=class{constructor(e,t,r,n){this.data=e,this.objectIds=t,this.byteSize=r,this.attributeKeys=n}},aft=class{constructor(e,t,r){this.level=e,this.row=t,this.col=r,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}},M8e=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=pIt(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},Vzr=class{constructor(e,t,r){this._tileInfo=e,this._extent=null,this.info=new M8e(t),r!=null&&(this._extent=tB(r))}addMissing(e,t,r,n){const s=new jY(null,e,t,r);this._tileInfo.updateTileInfo(s,fu.ExtrapolateOptions.POWER_OF_TWO),s.extent==null||this._extent!=null&&!aae(this._extent,s.extent)||(this.info.missingTiles.push({data:s,resolution:n}),this.info.coveredArea-=pIt(s.extent))}};const Hzr=.18751;var G6;(function(i){i[i.ADDED=0]="ADDED",i[i.REMOVED=1]="REMOVED",i[i.UNCHANGED=2]="UNCHANGED"})(G6||(G6={}));let bU=class extends rd.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ac(),this._elevationAligner=tft(),this._elevationFilter=rft(),this._symbologyCandidatesFetcher=nft(),this._updatingHandles=new Mb,this._editsUpdatingHandles=new Mb,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const r={query:e},n=await this.remoteClient.invoke("alignElevation",r,{signal:t});return hn(t),n},this._getSymbologyCandidates=async(e,t)=>{const r={candidates:e,spatialReference:this._spatialReference.toJSON()},n=await this.remoteClient.invoke("getSymbologyCandidates",r,{signal:t});return hn(t),n}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:r,timeInfo:n,fieldsIndex:s}=e.serviceInfo,{hasZ:o}=e,a=Xi.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new rX({...e.serviceInfo,hasZ:o,hasM:!1}),this._queryEngine=new lL({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:s,hasZ:o,hasM:!1,objectIdField:r,timeInfo:n}),this._featureFetcher=new Rd({store:new y$({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:Xi.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l=e.configuration.viewType==="3d";return this._elevationAligner=tft(l,{elevationInfo:e.elevationInfo!=null?ZB.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=rft(l),this.addHandles([Ki(()=>this._featureFetcher.availability,u=>this.emit("notify-availability",{availability:u}),Kl),Ki(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),vT}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.suspended=e,vT}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.outFields=new Set(e??[]),vT}async fetchCandidates(e,t){await this._whenSetup.promise,hn(t);const r=qzr(e),n=t?.signal,s=await this._queryEngine.executeQueryForSnapping(r,n);hn(n);const o=await this._elevationAligner.alignCandidates(s.candidates,Xi.fromJSON(e.point.spatialReference)??Xi.WGS84,n);hn(n);const a=await this._symbologyCandidatesFetcher.fetch(o,n);hn(n);const l=a.length===0?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(r,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?fu.fromJSON(e.tileInfo):null,vT}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),this._featureFetcher.refresh(),vT}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),hn(t),await fR(()=>!this.updatingExcludingEdits,t),hn(t),vT}async getDebugInfo(e,t){return hn(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),hn(t);const r=ac();return this._pendingApplyEdits.set(e.id,r),this._featureFetcher.applyEdits(r.promise),this._editsUpdatingHandles.addPromise(r.promise),vT}async endApplyEdits(e,t){const r=this._pendingApplyEdits.get(e.id);return r&&r.resolve(e.edits),hn(t),vT}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),vT}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),vT}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=nft(e,this._getSymbologyCandidates),vT}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?Kn.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};x([D({readOnly:!0})],bU.prototype,"updating",null),x([D({readOnly:!0})],bU.prototype,"updatingExcludingEdits",null),x([D()],bU.prototype,"_isInitializing",void 0),bU=x([Qe("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],bU);const Wzr=bU;function qzr(i){if(!i.filter)return{...i,query:{where:"1=1"}};const{distance:e,units:t,spatialRel:r,where:n,timeExtent:s,objectIds:o}=i.filter,a={geometry:i.filter.geometry?Ro(i.filter.geometry):void 0,distance:e,units:t,spatialRel:r,timeExtent:s,objectIds:o,where:n??"1=1"};return{...i,query:a}}const vT={result:{}},Yzr=Object.freeze(Object.defineProperty({__proto__:null,default:Wzr},Symbol.toStringTag,{value:"Module"})),Xzr={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function pbe(i){return Xzr[i]}function*Rjt(i){switch(i.type){case"Feature":yield i;break;case"FeatureCollection":for(const e of i.features)e&&(yield e)}}function*Jzr(i){if(i)switch(i.type){case"Point":yield i.coordinates;break;case"LineString":case"MultiPoint":yield*i.coordinates;break;case"MultiLineString":case"Polygon":for(const e of i.coordinates)yield*e;break;case"MultiPolygon":for(const e of i.coordinates)for(const t of e)yield*t}}function*Kzr(i,e={}){const{geometryType:t,objectIdField:r}=e;for(const n of i){const{geometry:s,properties:o,id:a}=n;if(s&&pbe(s.type)!==t)continue;const l=o||{};let u;r&&(u=l[r],a==null||u||(l[r]=u=a)),yield new ry(s?tVr(new $o,s,e):null,l,null,u??void 0)}}function Zzr(i){for(const e of i)if(e.length>2)return!0;return!1}function Qzr(i){return!Djt(i)}function eVr(i){return Djt(i)}function Djt(i){let e=0;for(let t=0;t=0;r--)oJe(i,e[r],t);i.lengths.push(e.length)}function oJe(i,e,t){const[r,n,s]=e;i.coords.push(r,n),t.hasZ&&i.coords.push(s||0)}function lVr(i){switch(typeof i){case"string":return yjr(i)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function aJe(i,e=4326){if(!i)throw new qe("geojson-layer:empty","GeoJSON data is empty");if(i.type!=="Feature"&&i.type!=="FeatureCollection")throw new qe("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:i});const{crs:t}=i;if(!t)return;const r=typeof t=="string"?t:t.type==="name"?t.properties.name:t.type==="EPSG"?t.properties.code:null,n=fE({wkid:e})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${e})$`,"i");if(!r||!n.test(r))throw new qe("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function $jt(i,e={}){const t=[],r=new Set,n=new Set;let s,o=!1,a=null,l=!1,{geometryType:u=null}=e,c=!1;for(const p of Rjt(i)){const{geometry:m,properties:v,id:w}=p;if((!m||(u||(u=pbe(m.type)),pbe(m.type)===u))&&(o||(o=Zzr(Jzr(m))),l||(l=w!=null,l&&(s=typeof w,v&&(a=Object.keys(v).filter(S=>v[S]===w)))),v&&a&&l&&w!=null&&(a.length>1?a=a.filter(S=>v[S]===w):a.length===1&&(a=v[a[0]]===w?a:[])),!c&&v)){let S=!0;for(const I in v){if(r.has(I))continue;const R=v[I];if(R==null){S=!1,n.add(I);continue}const L=lVr(R);if(L==="unknown"){n.add(I);continue}n.delete(I),r.add(I);const k=fW(I);k&&t.push({name:k,alias:I,type:L})}c=S}}const h=fW(a?.length===1&&a[0]||null)??void 0;if(h){for(const p of t)if(p.name===h&&wY(p)){p.type="esriFieldTypeOID";break}}return{fields:t,geometryType:u,hasZ:o,objectIdFieldName:h,objectIdFieldType:s,unknownFields:Array.from(n)}}function lJe(i,e){return Array.from(Kzr(Rjt(i),e))}let uVr=class{constructor(){this.code=null,this.description=null}},cVr=class{constructor(e){this.error=new uVr,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}};function DC(i){return new cVr(i)}let hVr=class{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}};function cH(i){return new hVr(i)}const YOe=new Set;function RF(i,e,t,r=!1){YOe.clear();for(const n in t){const s=i.get(n);if(!s)continue;const o=dVr(s,t[n]);if(YOe.add(s.name),s&&(r||s.editable)){const a=qAt(s,o);if(a)return DC(cQi(a,s,o));e[s.name]=o}}for(const n of i?.requiredFields??[])if(!YOe.has(n.name))return DC(`missing required field "${n.name}"`);return null}function dVr(i,e){let t=e;return wY(i)&&typeof e=="string"?t=parseFloat(e):xie(i)&&e!=null&&typeof e!="string"?t=String(e):mW(i)&&typeof e=="string"&&(t=a7t(e)),rQi(t)}let vre;function fbe(i,e){if(!i||!Cm(e))return i;if("rings"in i||"paths"in i){if(vre==null)throw new TypeError("geometry engine not loaded");return vre.simplify(e,i)}return i}async function pVr(){return vre==null&&(vre=await Promise.resolve().then(()=>iX)),vre}async function Bjt(i,e){!Cm(i)||e!=="esriGeometryPolygon"&&e!=="esriGeometryPolyline"||await pVr()}const fVr={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};let mVr=class{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const r=[],[n]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),s=$jt(n,{geometryType:e.geometryType}),o=e.fields||s.fields||[],a=e.hasZ!=null?e.hasZ:s.hasZ,l=s.geometryType;let u=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const c=e.spatialReference||Yp;let h=e.timeInfo;o===s.fields&&s.unknownFields.length>0&&r.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});const p=new Cd(o);let m=p.get(u);m?(m.type!=="esriFieldTypeString"&&(m.type="esriFieldTypeOID"),m.editable=!1,m.nullable=!1,u=m.name):(m={alias:u,name:u,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(m));const v={};for(const V of o){if(V.name==null&&(V.name=V.alias),V.alias==null&&(V.alias=V.name),!V.name)throw new qe("geojson-layer:invalid-field-name","field name is missing",{field:V});if(!wW.jsonValues.includes(V.type))throw new qe("geojson-layer:invalid-field-type",`invalid type for field "${V.name}"`,{field:V});if(V.name!==m.name){const Y=w2e(V);Y!==void 0&&(v[V.name]=Y)}V.length==null&&(V.length=s8(V))}if(h){if(h.startTimeField){const V=p.get(h.startTimeField);V?(h.startTimeField=V.name,V.type="esriFieldTypeDate"):h.startTimeField=null}if(h.endTimeField){const V=p.get(h.endTimeField);V?(h.endTimeField=V.name,V.type="esriFieldTypeDate"):h.endTimeField=null}if(h.trackIdField){const V=p.get(h.trackIdField);V?h.trackIdField=V.name:(h.trackIdField=null,r.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:h}}))}h.startTimeField||h.endTimeField||(r.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:h}}),h=null)}const w=l?KA(l):void 0,S=p.dateFields.length?{timeZoneIANA:y0}:null,I={warnings:r,featureErrors:[],layerDefinition:{...fVr,drawingInfo:w??void 0,templates:G7t(v),extent:void 0,geometryType:l,objectIdField:u,fields:o,hasZ:!!a,timeInfo:h,dateFieldsTimeReference:S}};this._queryEngine=new lL({fieldsIndex:Cd.fromLayerJSON({fields:o,timeInfo:h,dateFieldsTimeReference:S}),geometryType:l,hasM:!1,hasZ:a,objectIdField:u,spatialReference:c,timeInfo:h,featureStore:new rX({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0});const R=this._queryEngine.fieldsIndex.requiredFields.indexOf(m);R>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(R,1),this._createDefaultAttributes=OXe(v,u);const L=await this._createFeatures(n);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,L);const k=this._normalizeFeatures(L,I.featureErrors);this._queryEngine.featureStore.addMany(k);const{fullExtent:B,timeExtent:$}=await this._queryEngine.fetchRecomputedExtents();if(I.layerDefinition.extent=B,$){const{start:V,end:Y}=$;I.layerDefinition.timeInfo.timeExtent=[V,Y]}return I}async applyEdits(e){const{spatialReference:t,geometryType:r}=this._queryEngine;return await Promise.all([Bjt(t,r),Gv(e.adds,t),Gv(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=pE(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,n);const s=this._normalizeFeatures(n);s&&this._queryEngine.featureStore.addMany(s)},n=>{this._queryEngine.featureStore.clear(),mo(n)||di.getLogger("esri.layers.GeoJSONLayer").error(new qe("geojson-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:r}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:r}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:r,objectIdField:n}=this._queryEngine,s=lJe(e,{geometryType:t,hasZ:r,objectIdField:n});if(!Ya(this._queryEngine.spatialReference,Yp))for(const o of s)o.geometry!=null&&(o.geometry=Z2(Sf(KC(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),Yp,this._queryEngine.spatialReference)));return s}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:r}=this._loadOptions,n=(await zi(t,{responseType:"json",query:{...r},signal:e})).data;return aJe(n),n}_normalizeFeatures(e,t){const{objectIdField:r,fieldsIndex:n}=this._queryEngine,s=[];for(const o of e){const a=this._createDefaultAttributes(),l=RF(n,a,o.attributes,!0);l?t?.push(l):(this._assignObjectId(a,o.attributes,!0),o.attributes=a,o.objectId=a[r],s.push(o))}return s}async _applyEdits(e){const{adds:t,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(s,t),r?.length&&this._applyUpdateEdits(s,r),n?.length){for(const l of n)s.deleteResults.push(cH(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:u,fieldsIndex:c}=this._queryEngine,h=[];for(const p of t){if(p.geometry&&n!==ah(p.geometry)){r.push(DC("Incorrect geometry type."));continue}const m=this._createDefaultAttributes(),v=RF(c,m,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(m,p.attributes),p.attributes=m,p.uid!=null){const w=p.attributes[a];e.uidToObjectId[p.uid]=w}if(p.geometry!=null){const w=p.geometry.spatialReference??l;p.geometry=Sf(fbe(p.geometry,w),w,l)}h.push(p),r.push(cH(p.attributes[a]))}}u.addMany(PW([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine;for(const c of t){const{attributes:h,geometry:p}=c,m=h?.[o];if(m==null){e.push(DC(`Identifier field ${o} missing`));continue}if(!l.has(m)){e.push(DC(`Feature with object id ${m} missing`));continue}const v=hSe(l.getFeature(m),r,s,n);if(p!=null){if(r!==ah(p)){e.push(DC("Incorrect geometry type."));continue}const w=p.spatialReference??a;v.geometry=Sf(fbe(p,w),w,a)}if(h){const w=RF(u,v.attributes,h);if(w){e.push(w);continue}}l.add(ODt(v,r,s,n,o)),e.push(cH(m))}}_createObjectIdGenerator(e,t){const r=e.fieldsIndex.get(e.objectIdField);if(r.type==="esriFieldTypeString")return()=>r.name+"-"+Date.now().toString(16);let n=Number.NEGATIVE_INFINITY;for(const s of t)s.objectId&&(n=Math.max(n,s.objectId));return n=Math.max(0,n)+1,()=>n++}_assignObjectId(e,t,r=!1){const n=this._queryEngine.objectIdField;e[n]=r&&n in t?t[n]:this._objectIdGenerator()}async _checkProjection(e){try{await Gv(Yp,e)}catch{throw new qe("geojson-layer","Projection not supported")}}};const gVr=Object.freeze(Object.defineProperty({__proto__:null,default:mVr},Symbol.toStringTag,{value:"Module"}));var Hge={};Hge.defaultNoDataValue=Rrt(-1/0),Hge.decode=function(i,e){var t=(e=e||{}).encodedMaskData||e.encodedMaskData===null,r=bVr(i,e.inputOffset||0,t),n=e.noDataValue!=null?Rrt(e.noDataValue):Hge.defaultNoDataValue,s=yVr(r,e.pixelType||Float32Array,e.encodedMaskData,n,e.returnMask),o={width:r.width,height:r.height,pixelData:s.resultPixels,minValue:r.pixels.minValue,maxValue:r.pixels.maxValue,noDataValue:n};return s.resultMask&&(o.maskData=s.resultMask),e.returnEncodedMask&&r.mask&&(o.encodedMaskData=r.mask.bitset?r.mask.bitset:null),e.returnFileInfo&&(o.fileInfo=vVr(r,n),e.computeUsedBitDepths&&(o.fileInfo.bitDepths=_Vr(r))),o};var yVr=function(i,e,t,r,n){var s,o,a=0,l=i.pixels.numBlocksX,u=i.pixels.numBlocksY,c=Math.floor(i.width/l),h=Math.floor(i.height/u),p=2*i.maxZError;t=t||(i.mask?i.mask.bitset:null),s=new e(i.width*i.height),n&&t&&(o=new Uint8Array(i.width*i.height));for(var m,v,w=new Float32Array(c*h),S=0;S<=u;S++){var I=S!==u?h:i.height%u;if(I!==0)for(var R=0;R<=l;R++){var L=R!==l?c:i.width%l;if(L!==0){var k,B,$,V,Y=S*i.width*h+R*c,K=i.width-L,Q=i.pixels.blocks[a];if(Q.encoding<2?(Q.encoding===0?k=Q.rawData:(wVr(Q.stuffedData,Q.bitsPerPixel,Q.numValidPixels,Q.offset,p,w,i.pixels.maxValue),k=w),B=0):$=Q.encoding===2?0:Q.offset,t)for(v=0;v>3],V<<=7&Y),m=0;m>3]),128&V?(o&&(o[Y]=1),s[Y++]=Q.encoding<2?k[B++]:$):(o&&(o[Y]=0),s[Y++]=r),V<<=1;Y+=K}else if(Q.encoding<2)for(v=0;v0){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),a=(s=new DataView(i,e,r.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(a>0)for(;a--;)o[u++]=s.getUint8(l++);else{var c=s.getUint8(l++);for(a=-a;a--;)o[u++]=c}a=s.getInt16(l,!0),l+=2}while(l0?1:0),v=p+(r.height%p>0?1:0);r.pixels.blocks=new Array(m*v);for(var w=1e9,S=0,I=0;I3)throw"Invalid block encoding ("+B.encoding+")";if(B.encoding!==2){if($!==0&&$!==2){if($>>=6,B.offsetType=$,$===2)B.offset=s.getInt8(1),L++;else if($===1)B.offset=s.getInt16(1,!0),L+=2;else{if($!==0)throw"Invalid block offset type";B.offset=s.getFloat32(1,!0),L+=4}if(w=Math.min(B.offset,w),B.encoding===1)if($=s.getUint8(L),L++,B.bitsPerPixel=63&$,$>>=6,B.numValidPixelsType=$,$===2)B.numValidPixels=s.getUint8(L),L++;else if($===1)B.numValidPixels=s.getUint16(L,!0),L+=2;else{if($!==0)throw"Invalid valid pixel count type";B.numValidPixels=s.getUint32(L,!0),L+=4}}var V;if(e+=L,B.encoding!=3){if(B.encoding===0){var Y=(r.pixels.numBytes-1)/4;if(Y!==Math.floor(Y))throw"uncompressed block has invalid length";V=new ArrayBuffer(4*Y),new Uint8Array(V).set(new Uint8Array(i,e,4*Y));for(var K=new Float32Array(V),Q=0;Q=e)l=u>>>p-e&c,p-=e;else{var w=e-p;l=(u&c)<>>(p=32-w)}s[a]=l{const c=u.type==="esriFieldTypeOID",h=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return l=u,c||h})&&(a=l.name)}return{geometryType:s,spatialReference:o,objectIdField:a,hasM:n,hasZ:r}}async _loadInitialFeatures(e,t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine,c=[];for(const m of t){if(m.uid!=null&&(e.assignedObjectIds[m.uid]=-1),m.geometry&&r!==ah(m.geometry)){e.featureErrors.push(DC("Incorrect geometry type."));continue}const v=this._createDefaultAttributes(),w=RF(u,v,m.attributes,!0);w?e.featureErrors.push(w):(this._assignObjectId(v,m.attributes,!0),m.attributes=v,m.uid!=null&&(e.assignedObjectIds[m.uid]=m.attributes[o]),m.geometry!=null&&(m.geometry=Sf(m.geometry,m.geometry.spatialReference,a)),c.push(m))}l.addMany(PW([],c,r,s,n,o));const{fullExtent:h,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=h,p){const{start:m,end:v}=p;e.layerDefinition.timeInfo.timeExtent=[m,v]}return e}async _applyEdits(e){const{adds:t,updates:r,deletes:n}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(s,t),r?.length&&this._applyUpdateEdits(s,r),n?.length){for(const l of n)s.deleteResults.push(cH(l));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:a,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:r}=e,{geometryType:n,hasM:s,hasZ:o,objectIdField:a,spatialReference:l,featureStore:u,fieldsIndex:c}=this._queryEngine,h=[];for(const p of t){if(p.geometry&&n!==ah(p.geometry)){r.push(DC("Incorrect geometry type."));continue}const m=this._createDefaultAttributes(),v=RF(c,m,p.attributes);if(v)r.push(v);else{if(this._assignObjectId(m,p.attributes),p.attributes=m,p.uid!=null){const w=p.attributes[a];e.uidToObjectId[p.uid]=w}if(p.geometry!=null){const w=p.geometry.spatialReference??l;p.geometry=Sf(fbe(p.geometry,w),w,l)}h.push(p),r.push(cH(p.attributes[a]))}}u.addMany(PW([],h,n,o,s,a))}_applyUpdateEdits({updateResults:e},t){const{geometryType:r,hasM:n,hasZ:s,objectIdField:o,spatialReference:a,featureStore:l,fieldsIndex:u}=this._queryEngine;for(const c of t){const{attributes:h,geometry:p}=c,m=h?.[o];if(m==null){e.push(DC(`Identifier field ${o} missing`));continue}if(!l.has(m)){e.push(DC(`Feature with object id ${m} missing`));continue}const v=hSe(l.getFeature(m),r,s,n);if(p!=null){if(r!==ah(p)){e.push(DC("Incorrect geometry type."));continue}const w=p.spatialReference??a;v.geometry=Sf(fbe(p,w),w,a)}if(h){const w=RF(u,v.attributes,h);if(w){e.push(w);continue}}l.add(ODt(v,r,s,n,o)),e.push(cH(m))}}_assignObjectId(e,t,r=!1){const n=this._queryEngine.objectIdField;r&&t&&isFinite(t[n])?e[n]=t[n]:e[n]=this._nextObjectId++}};const DVr=Object.freeze(Object.defineProperty({__proto__:null,default:RVr},Symbol.toStringTag,{value:"Module"}));let FVr=class{constructor(e,t,r){this.uid=e,this.geometry=t,this.attributes=r,this.visible=!0,this.objectId=null,this.centroid=null}},kVr=class{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}};function LVr(i,e,t,r){if(e?.size&&t!=null&&i)for(const n in i){if(!e.has(n))continue;const s=i[n];typeof s=="string"&&s.length>t&&(r(n),i[n]="")}}function NVr(i,e){return e}function uJe(i,e,t,r){switch(t){case 0:return Wse(i,e+r,0);case 1:return i.originPosition==="lowerLeft"?Wse(i,e+r,1):jVr(i,e+r,1)}}function Gjt(i,e,t,r){return t===2?Wse(i,e,2):uJe(i,e,t,r)}function $Vr(i,e,t,r){return t===2?Wse(i,e,3):uJe(i,e,t,r)}function BVr(i,e,t,r){return t===3?Wse(i,e,3):Gjt(i,e,t,r)}function Wse({translate:i,scale:e},t,r){return i[r]+t*e[r]}function jVr({translate:i,scale:e},t,r){return i[r]-t*e[r]}let GVr=class{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=NVr,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new kVr}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=IY(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(t!=null)for(const r of e.features)t(r.geometry)}createSpatialReference(){return new Xi}addField(e,t){e.fields.push(Fo.fromJSON(t));const r=e.fields.map(n=>n.name);this._attributesConstructor=function(){for(const n of r)this[n]=null}}addFeature(e,t){const r=this._options.maxStringAttributeLength,n=this._options.maxStringAttributeFields;LVr(t.attributes,n,r,s=>{const o=t.attributes[e.objectIdFieldName];o!=null&&this._missingAttributes.push({objectId:o,attribute:s})}),e.features.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:n}=t,s=cB(r.clone(),r,!1,!1,this._transform),o=KC(s,n,!1,!1);let a=null;switch(n){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}o.type=a,e.queryGeometryType=n,e.queryGeometry=o}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,r,n)=>this.addCoordinatePoint(t,r,n),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,r,n)=>this._addCoordinatePolygon(t,r,n),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,r,n)=>this._addCoordinatePolyline(t,r,n),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,r,n)=>this._addCoordinateMultipoint(t,r,n),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:e.geometryType}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new FVr(vF(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((t,r)=>t+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,t){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}createPointGeometry(e){const t={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return t.hasZ&&(t.z=0),t.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const n=this._transform?this._applyTransform(this._transform,t,r,0):t;if(n!=null)switch(r){case 0:e.x=n;break;case 1:e.y=n;break;case 2:e.hasZ?e.z=n:e.m=n;break;case 3:e.m=n}}_transformPathLikeValue(e,t){let r=0;return t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e),this._transform?this._applyTransform(this._transform,e,t,r):e}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const n=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(n)}_createPolygonGeometry(e){return{type:"polygon",rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{type:"polyline",paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{type:"multipoint",points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const n=this._transformPathLikeValue(t,r),s=e[e.length-1],o=this._coordinateBuffer;if(o){if(r===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;s.push(new Float64Array(o.buffer,a,this._vertexDimension))}o[this._coordinateBufferPtr++]=n}}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?BVr:t?Gjt:r?$Vr:uJe}},UVr=class{_parseFeatureQuery(e){const t=new GVr(e.options),r=lDt(e.buffer,t),n={...r,spatialReference:r.spatialReference?.toJSON(),fields:r.fields?r.fields.map(s=>s.toJSON()):void 0,missingAttributes:t.missingAttributes};return Promise.resolve(n)}};function zVr(){return new UVr}const VVr=Object.freeze(Object.defineProperty({__proto__:null,default:zVr},Symbol.toStringTag,{value:"Module"})),HVr=1e-30,xo=512,cJe=128,mbe=511,Ede=16777216,Ide=8,hJe=29,dJe=24,hee=4,WVr=0,lft=0,gbe=0,qVr=1,YVr=2,XVr=3,JVr=4,KVr=5,ZVr=6,QVr=12,aK=5,Ujt=6,uft=5,eHr=6;var Sv;(function(i){i[i.FilterFlags=0]="FilterFlags",i[i.Animation=1]="Animation",i[i.GPGPU=2]="GPGPU",i[i.VV=3]="VV",i[i.DD0=4]="DD0",i[i.DD1=5]="DD1",i[i.DD2=6]="DD2"})(Sv||(Sv={}));const tHr=3,pJe=1<=this._buffer.length){const t=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*pHr,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(t),n=new this._ctor(r);n.set(this._buffer,0),this._array=r,this._buffer=n,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,r){this._i16View[2*e]+=t,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.lengthu.name==="pos"||u.name==="position");if(!l)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:l},this._indices=new qge(Uint32Array,s),this._vertices=new qge(Uint32Array,o),this._metrics=new qge(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=a,this._instanceId=e}serialize(e){const t=this._indices.buffer(),r=this._vertices.buffer(),n=this._metrics.length?this._metrics.buffer():null;return e.push(t,r),{instanceId:this._instanceId,layout:this.layout,indices:t,vertices:r,metrics:n}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}},P8e=class{constructor(e,t=0){this._id=e,this._sizeHint=t,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new qge(Uint32Array,this._sizeHint*dH.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],r=this._entities.buffer();for(const n of this._instanceIdToVertexData.values())t.push(n.serialize(e));return{message:{data:t,entities:r},transferList:e}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,r,n){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e}metricEnd(){const e=this._current.writer;this._current.metric.bounds.length&&e.writeMetric(this._current.metric)}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}recordEnd(e=0){const t=this._current.vertexStart,r=this._current.writer.vertexCount-t;if(!r)return!1;const n=this._current.indexStart,s=this._current.writer.indexCount-n;return this._recordIndexStart=n,this._recordIndexCount=s,this._recordVertexStart=t,this._recordVertexCount=r,this._entities.incr(this._entityRecordCountOffset),qse.write(this._entities,this._current.instanceId,this._current.textureKey,n,s,t,r,e),!0}copyLast(e,t){const r=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),qse.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,r,this._recordVertexCount,0);const n=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,o=this._recordIndexStart+this._recordIndexCount,a=this._recordVertexCount;for(let S=this._recordIndexStart;S!==o;S++){const I=n.getValue(S);n.push(I+a)}const l=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,u=this._recordVertexStart*l,c=(this._recordVertexStart+this._recordVertexCount)*l;for(let S=u;S!==c;S++){const I=s.getValue(S);s.push(I)}const h=this._current.writer.layout.position,p=h.packPrecisionFactor??1,m=h.offset/Uint32Array.BYTES_PER_ELEMENT,v=e*p,w=t*p;for(let S=r*l;S<=s.length;S+=l)s.i1616Add(S+m,v,w);this.recordEnd()}copyLastFrom(e,t,r){const n=e._entities.getValue(e._entityIdIndex);if(n!==this._entities.getValue(this._entityIdIndex)){const I=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(n,I)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,o=this._current.vertexStart,a=e._current.vertexStart-o,l=this._current.writer.indexWriter,u=this._current.writer.vertexWriter,c=e._current.writer.indexWriter,h=e._current.writer.vertexWriter;for(let I=e._current.indexStart;I!==c.length;I++){const R=c.getValue(I);l.push(R-a)}for(let I=e._current.vertexStart*s;I!==h.length;I++){const R=h.getValue(I);u.push(R)}const p=this._current.writer.layout.position,m=p.packPrecisionFactor??1,v=p.offset/Uint32Array.BYTES_PER_ELEMENT,w=t*m,S=r*m;for(let I=o*s;I<=u.length;I+=s)u.i1616Add(I+v,w,S);this.recordEnd()}_getVertexWriter(e,t){const{stride:r}=t,n=this._instanceIdToVertexData;return n.has(e)||n.set(e,new gHr(e,t,r,this._sizeHint)),n.get(e)}};function Yjt(i,e,t,r){const n=i.clone(),s=1<=s?(n.col=o-s,n.world+=1):n.col=o,n.row=a,n}const sCe=1,mJe=2,oCe=4,gJe=8,yJe=16,aCe=32,vJe=64,lCe=128;function XOe(i){switch(i){case sCe:case gJe:case aCe:return-1;case mJe:case vJe:return 0;case oCe:case yJe:case lCe:return 1}}function JOe(i){switch(i){case sCe:case mJe:case oCe:return-1;case gJe:case yJe:return 0;case aCe:case vJe:case lCe:return 1}}const hft=sCe|gJe|aCe,dft=oCe|yJe|lCe,pft=sCe|mJe|oCe,fft=aCe|vJe|lCe;let yHr=class{constructor(e,t,r,n=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=n,this._meshes={self:new P8e(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0,this._copyBufferedDataIntoSelf=r&&this._bufferingEnabled&&e.level===0}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<{const o=n.serialize(),a=1<=xo-s?hft:dft|hft)|(t<0+o?fft:t>=xo-o?pft:fft|pft));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<>8^t)+r|0;while(--r!=0)}return(1+t/(1<<31))/2}function _Hr(i){return Math.floor(Xjt(i,bHr)*wHr)}const bHr=53290320,wHr=10;function wle(i){const e=i.map(({name:t,count:r,type:n})=>`${t}.${r}.${n}`).join(",");return Q1(e)}function dee(i,e,t,r,n,s,o){if(i.primitiveName===e){for(const a in i)if(a===t){let l=r?.readWithDefault(n,s,i[a]&&o);return i.type==="text"&&(l=l.toString()),void(i[a]=l)}}if("type"in i&&i.type!=null)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(i.symbolLayers)for(const a of i.symbolLayers)dee(a,e,t,r,n,s,o);break;case"CIMHatchFill":i.lineSymbol&&dee(i.lineSymbol,e,t,r,n,s,o);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(i.type==="CIMVectorMarker"&&i.markerGraphics)for(const a of i.markerGraphics)dee(a,e,t,r,n,s,o),dee(a.symbol,e,t,r,n,s,o)}}function Jjt(i){const e=i.width;return i.effects!=null?256:Math.max(1.25*e,8)}let xle=class{destroy(){}},Kjt=class extends xle{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,r){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}};const xHr=()=>di.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function Ade(i,e,t=!1){const{defaultValue:r,valueExpressionInfo:n,value:s}=e;if(n){const{expression:o}=n,a=await i.createComputedField({expression:o},t);return a?{...e,computed:a,defaultValue:r}:null}return{...e,computed:new Kjt(s),defaultValue:r}}async function mft(i,e){const{defaultValue:t,valueExpressionInfo:r}=e,{expression:n}=r,s=await i.createComputedField({expression:n});return s?{...e,computed:s,defaultValue:t}:null}const Zjt=i=>typeof i!="boolean"&&typeof i!="number"&&"valueExpressionInfo"in i,SHr=i=>i.some(e=>{for(const t in e){const r=e[t];if(Zjt(r))return!0}return!1});let THr=class Qjt{static async create(e,t,r){const n={},s=new Map,o=new Map,a=new Map,l=new Map,u=new Map;for(const c in r.params){const h=r.params[c];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${c}. Nested array params are not supported`);n[c]=h}else if("valueExpressionInfo"in h){if(h.value){n[c]=h.value;continue}const p=await mft(e,h);if(!p){n[c]=h.defaultValue;continue}s.set(c,p),n[c]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(p=>p.overrides.length)){o.set(c,{effects:await Promise.all(h.effectInfos.map(async p=>{const m=p.overrides.map(v=>Ade(e,v));return{effect:p.effect,compiledOverrides:(await Promise.all(m)).filter(Ga)}}))});break}n[c]=h.effectInfos.map(p=>p.effect);break;case"cim-marker-placement-info":h.overrides.length&&a.set(c,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(p=>Ade(e,p)))).filter(Ga)}),n[c]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const m=h.overrides.map(v=>Ade(e,v,h.useLegacyLabelEvaluationRules));l.set(c,{compiledOverrides:(await Promise.all(m)).filter(Ga),rasterizationParam:h,objectIdToResourceId:new Map});continue}const p={type:"cim-rasterization-info",resource:h.resource};n[c]=await t.fetchResourceImmediate(p)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const m=h.overrides.map(v=>Ade(e,v));l.set(c,{compiledOverrides:(await Promise.all(m)).filter(Ga),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){l.set(c,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const p={type:"cim-rasterization-info",resource:h.resource};n[c]=await t.fetchResourceImmediate(p)??null;break}case"cim-marker-transform-param":{const{params:p}=h;if(SHr(p)){const m={compiledMarkerInfos:[]};await Promise.all(p.map(async v=>{const w={props:{}};for(const S in v)if(Zjt(v[S])){const I=await mft(e,v[S]);w.compiledExpressionMap||(w.compiledExpressionMap=new Map);const R=w.compiledExpressionMap;I&&R.set(S,I)}else w.props[S]=v[S];m.compiledMarkerInfos.push(w)})),u.set(c,m)}else n[c]={type:"cim-marker-transform-info",infos:p};break}default:n[c]=h}else n[c]=h}return new Qjt(r,n,s,o,a,l,u)}constructor(e,t,r,n,s,o,a){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=r,this._dynamicEffectProperties=n,this._dynamicPlacementProperties=s,this._dynamicAsyncProperties=o,this._dynamicTransformProperties=a,this.evaluator=l=>l}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,r){for(const n of this._dynamicAsyncProperties.values()){const s=li(n.rasterizationParam.resource);n.rasterizationParam.resource.type==="animated"&&n.rasterizationParam.resource.randomizeStartTime&&(s.primitiveName="__RESERVED__PRIMITIVE__NAME__",s.startGroup=_Hr(t.getObjectId()||0));for(const{primitiveName:a,propertyName:l,computed:u,defaultValue:c,valueExpressionInfo:h}of n.compiledOverrides)try{const p=n.rasterizationParam.resource.type==="animated"?s.primitiveName:a;dee(s,p,l,u,t,r,c)}catch(p){xHr().errorOnce(new qe("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${h?.expression}' (primitive: '${a}', property: '${l}')`,p))}const o=e.enqueueRequest({type:"cim-rasterization-info",resource:s});n.objectIdToResourceId.set(t.getObjectId(),o)}}evaluateMeshParams(e,t,r){for(const[n,s]of this._dynamicProperties.entries())this._resolvedMeshParams[n]=s.computed.readWithDefault(t,r,s.defaultValue);for(const[n,s]of this._dynamicPlacementProperties.entries())for(const{computed:o,defaultValue:a,propertyName:l}of s.compiledOverrides){const u=o.readWithDefault(t,r,a);s.placementInfo.placement[l]=u,this._resolvedMeshParams[n]=s.placementInfo.placement}for(const[n,s]of this._dynamicEffectProperties.entries())for(const o of s.effects){for(const{computed:a,defaultValue:l,propertyName:u}of o.compiledOverrides){const c=a.readWithDefault(t,r,l);o.effect[u]=c}this._resolvedMeshParams[n]=s.effects.map(a=>a.effect)}for(const[n,s]of this._dynamicTransformProperties.entries()){const o={type:"cim-marker-transform-info",infos:[]};for(const a of s.compiledMarkerInfos){const l={...a.props};if(a.compiledExpressionMap)for(const[u,c]of a.compiledExpressionMap){const h=c.computed.readWithDefault(t,r,c.defaultValue);l[u]=typeof h=="number"||typeof h=="boolean"?h:c.defaultValue}o.infos.push(l)}this._resolvedMeshParams[n]=o}for(const[n,s]of this._dynamicAsyncProperties.entries()){const o=s.objectIdToResourceId.get(t.getObjectId());if(o==null)continue;const a=e.getResource(o);this._resolvedMeshParams[n]=a}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}};const CHr=128e3;let KOe=null,eGt=null;async function tGt(){return KOe||(KOe=EHr()),KOe}async function EHr(){eGt=await(yi("esri-csp-restrictions")?await Promise.resolve().then(()=>RBn).then(e=>e.l):await Promise.resolve().then(()=>kBn).then(e=>e.l)).default({locateFile:e=>Fl(`esri/core/libs/libtess/${e}`)})}function iGt(i,e){const t=Math.max(i.length,CHr);return eGt.triangulate(i,e,t)}var gft,yft,vft,rGt={exports:{}};gft=rGt,yft=function(){function i(ae,fe,be){be=be||2;var _e,Ie,Te,Be,Ve,$e,tt,yt=fe&&fe.length,Ct=yt?fe[0]*be:ae.length,ot=e(ae,0,Ct,be,!0),vt=[];if(!ot||ot.next===ot.prev)return vt;if(yt&&(ot=l(ae,fe,ot,be)),ae.length>80*be){_e=Te=ae[0],Ie=Be=ae[1];for(var At=be;AtTe&&(Te=Ve),$e>Be&&(Be=$e);tt=(tt=Math.max(Te-_e,Be-Ie))!==0?1/tt:0}return r(ot,vt,be,_e,Ie,tt),vt}function e(ae,fe,be,_e,Ie){var Te,Be;if(Ie===Z(ae,fe,be,_e)>0)for(Te=fe;Te=fe;Te-=_e)Be=de(Te,ae[Te],ae[Te+1],Be);if(Be&&B(Be,Be.next)){var Ve=Be.next;pe(Be),Be=Ve}return Be}function t(ae,fe){if(!ae)return ae;fe||(fe=ae);var be,_e=ae;do if(be=!1,_e.steiner||!B(_e,_e.next)&&k(_e.prev,_e,_e.next)!==0)_e=_e.next;else{var Ie=_e.prev;if(pe(_e),(_e=fe=Ie)===_e.next)break;be=!0}while(be||_e!==fe);return fe}function r(ae,fe,be,_e,Ie,Te,Be){if(ae){!Be&&Te&&v(ae,_e,Ie,Te);for(var Ve,$e,tt=ae;ae.prev!==ae.next;)if(Ve=ae.prev,$e=ae.next,Te?s(ae,_e,Ie,Te):n(ae))fe.push(Ve.i/be),fe.push(ae.i/be),fe.push($e.i/be),pe(ae),ae=$e.next,tt=$e.next;else if((ae=$e)===tt){Be?Be===1?r(ae=o(t(ae),fe,be),fe,be,_e,Ie,Te,2):Be===2&&a(ae,fe,be,_e,Ie,Te):r(t(ae),fe,be,_e,Ie,Te,1);break}}}function n(ae){var fe=ae.prev,be=ae,_e=ae.next;if(k(fe,be,_e)>=0)return!1;for(var Ie=ae.next.next;Ie!==ae.prev;){if(R(fe.x,fe.y,be.x,be.y,_e.x,_e.y,Ie.x,Ie.y)&&k(Ie.prev,Ie,Ie.next)>=0)return!1;Ie=Ie.next}return!0}function s(ae,fe,be,_e){var Ie=ae.prev,Te=ae,Be=ae.next;if(k(Ie,Te,Be)>=0)return!1;for(var Ve=Ie.xTe.x?Ie.x>Be.x?Ie.x:Be.x:Te.x>Be.x?Te.x:Be.x,yt=Ie.y>Te.y?Ie.y>Be.y?Ie.y:Be.y:Te.y>Be.y?Te.y:Be.y,Ct=S(Ve,$e,fe,be,_e),ot=S(tt,yt,fe,be,_e),vt=ae.prevZ,At=ae.nextZ;vt&&vt.z>=Ct&&At&&At.z<=ot;){if(vt!==ae.prev&&vt!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,vt.x,vt.y)&&k(vt.prev,vt,vt.next)>=0||(vt=vt.prevZ,At!==ae.prev&&At!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,At.x,At.y)&&k(At.prev,At,At.next)>=0))return!1;At=At.nextZ}for(;vt&&vt.z>=Ct;){if(vt!==ae.prev&&vt!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,vt.x,vt.y)&&k(vt.prev,vt,vt.next)>=0)return!1;vt=vt.prevZ}for(;At&&At.z<=ot;){if(At!==ae.prev&&At!==ae.next&&R(Ie.x,Ie.y,Te.x,Te.y,Be.x,Be.y,At.x,At.y)&&k(At.prev,At,At.next)>=0)return!1;At=At.nextZ}return!0}function o(ae,fe,be){var _e=ae;do{var Ie=_e.prev,Te=_e.next.next;!B(Ie,Te)&&$(Ie,_e,_e.next,Te)&&Q(Ie,Te)&&Q(Te,Ie)&&(fe.push(Ie.i/be),fe.push(_e.i/be),fe.push(Te.i/be),pe(_e),pe(_e.next),_e=ae=Te),_e=_e.next}while(_e!==ae);return t(_e)}function a(ae,fe,be,_e,Ie,Te){var Be=ae;do{for(var Ve=Be.next.next;Ve!==Be.prev;){if(Be.i!==Ve.i&&L(Be,Ve)){var $e=ne(Be,Ve);return Be=t(Be,Be.next),$e=t($e,$e.next),r(Be,fe,be,_e,Ie,Te),void r($e,fe,be,_e,Ie,Te)}Ve=Ve.next}Be=Be.next}while(Be!==ae)}function l(ae,fe,be,_e){var Ie,Te,Be,Ve=[];for(Ie=0,Te=fe.length;Ie=_e.next.y&&_e.next.y!==_e.y){var Ve=_e.x+(Te-_e.y)*(_e.next.x-_e.x)/(_e.next.y-_e.y);if(Ve<=Ie&&Ve>Be){if(Be=Ve,Ve===Ie){if(Te===_e.y)return _e;if(Te===_e.next.y)return _e.next}be=_e.x<_e.next.x?_e:_e.next}}_e=_e.next}while(_e!==fe);if(!be)return null;if(Ie===Be)return be;var $e,tt=be,yt=be.x,Ct=be.y,ot=1/0;_e=be;do Ie>=_e.x&&_e.x>=yt&&Ie!==_e.x&&R(Tebe.x||_e.x===be.x&&m(be,_e)))&&(be=_e,ot=$e)),_e=_e.next;while(_e!==tt);return be}function m(ae,fe){return k(ae.prev,ae,fe.prev)<0&&k(fe.next,ae,ae.next)<0}function v(ae,fe,be,_e){var Ie=ae;do Ie.z===null&&(Ie.z=S(Ie.x,Ie.y,fe,be,_e)),Ie.prevZ=Ie.prev,Ie.nextZ=Ie.next,Ie=Ie.next;while(Ie!==ae);Ie.prevZ.nextZ=null,Ie.prevZ=null,w(Ie)}function w(ae){var fe,be,_e,Ie,Te,Be,Ve,$e,tt=1;do{for(be=ae,ae=null,Te=null,Be=0;be;){for(Be++,_e=be,Ve=0,fe=0;fe0||$e>0&&_e;)Ve!==0&&($e===0||!_e||be.z<=_e.z)?(Ie=be,be=be.nextZ,Ve--):(Ie=_e,_e=_e.nextZ,$e--),Te?Te.nextZ=Ie:ae=Ie,Ie.prevZ=Te,Te=Ie;be=_e}Te.nextZ=null,tt*=2}while(Be>1);return ae}function S(ae,fe,be,_e,Ie){return(ae=1431655765&((ae=858993459&((ae=252645135&((ae=16711935&((ae=32767*(ae-be)*Ie)|ae<<8))|ae<<4))|ae<<2))|ae<<1))|(fe=1431655765&((fe=858993459&((fe=252645135&((fe=16711935&((fe=32767*(fe-_e)*Ie)|fe<<8))|fe<<4))|fe<<2))|fe<<1))<<1}function I(ae){var fe=ae,be=ae;do(fe.x=0&&(ae-Be)*(_e-Ve)-(be-Be)*(fe-Ve)>=0&&(be-Be)*(Te-Ve)-(Ie-Be)*(_e-Ve)>=0}function L(ae,fe){return ae.next.i!==fe.i&&ae.prev.i!==fe.i&&!K(ae,fe)&&(Q(ae,fe)&&Q(fe,ae)&&re(ae,fe)&&(k(ae.prev,ae,fe.prev)||k(ae,fe.prev,fe))||B(ae,fe)&&k(ae.prev,ae,ae.next)>0&&k(fe.prev,fe,fe.next)>0)}function k(ae,fe,be){return(fe.y-ae.y)*(be.x-fe.x)-(fe.x-ae.x)*(be.y-fe.y)}function B(ae,fe){return ae.x===fe.x&&ae.y===fe.y}function $(ae,fe,be,_e){var Ie=Y(k(ae,fe,be)),Te=Y(k(ae,fe,_e)),Be=Y(k(be,_e,ae)),Ve=Y(k(be,_e,fe));return Ie!==Te&&Be!==Ve||!(Ie!==0||!V(ae,be,fe))||!(Te!==0||!V(ae,_e,fe))||!(Be!==0||!V(be,ae,_e))||!(Ve!==0||!V(be,fe,_e))}function V(ae,fe,be){return fe.x<=Math.max(ae.x,be.x)&&fe.x>=Math.min(ae.x,be.x)&&fe.y<=Math.max(ae.y,be.y)&&fe.y>=Math.min(ae.y,be.y)}function Y(ae){return ae>0?1:ae<0?-1:0}function K(ae,fe){var be=ae;do{if(be.i!==ae.i&&be.next.i!==ae.i&&be.i!==fe.i&&be.next.i!==fe.i&&$(be,be.next,ae,fe))return!0;be=be.next}while(be!==ae);return!1}function Q(ae,fe){return k(ae.prev,ae,ae.next)<0?k(ae,fe,ae.next)>=0&&k(ae,ae.prev,fe)>=0:k(ae,fe,ae.prev)<0||k(ae,ae.next,fe)<0}function re(ae,fe){var be=ae,_e=!1,Ie=(ae.x+fe.x)/2,Te=(ae.y+fe.y)/2;do be.y>Te!=be.next.y>Te&&be.next.y!==be.y&&Ie<(be.next.x-be.x)*(Te-be.y)/(be.next.y-be.y)+be.x&&(_e=!_e),be=be.next;while(be!==ae);return _e}function ne(ae,fe){var be=new H(ae.i,ae.x,ae.y),_e=new H(fe.i,fe.x,fe.y),Ie=ae.next,Te=fe.prev;return ae.next=fe,fe.prev=ae,be.next=Ie,Ie.prev=be,_e.next=be,be.prev=_e,Te.next=_e,_e.prev=Te,_e}function de(ae,fe,be,_e){var Ie=new H(ae,fe,be);return _e?(Ie.next=_e.next,Ie.prev=_e,_e.next.prev=Ie,_e.next=Ie):(Ie.prev=Ie,Ie.next=Ie),Ie}function pe(ae){ae.next.prev=ae.prev,ae.prev.next=ae.next,ae.prevZ&&(ae.prevZ.nextZ=ae.nextZ),ae.nextZ&&(ae.nextZ.prevZ=ae.prevZ)}function H(ae,fe,be){this.i=ae,this.x=fe,this.y=be,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Z(ae,fe,be,_e){for(var Ie=0,Te=fe,Be=be-_e;Te0&&(_e+=ae[Ie-1].length,be.holes.push(_e))}return be},i},(vft=yft())!==void 0&&(gft.exports=vft);const ybe=Cg(rGt.exports),IHr=512;var Yy,Vg;(function(i){i[i.Unknown=0]="Unknown",i[i.Point=1]="Point",i[i.LineString=2]="LineString",i[i.Polygon=3]="Polygon"})(Yy||(Yy={}));let Po=class Yge{constructor(e,t){this.x=e,this.y=t}clone(){return new Yge(this.x,this.y)}equals(e,t){return e===this.x&&t===this.y}isEqual(e){return e.x===this.x&&e.y===this.y}setCoords(e,t){return this.x=e,this.y=t,this}normalize(){const e=this.x,t=this.y,r=Math.sqrt(e*e+t*t);return this.x/=r,this.y/=r,this}rightPerpendicular(){const e=this.x;return this.x=this.y,this.y=-e,this}leftPerpendicular(){const e=this.x;return this.x=-this.y,this.y=e,this}move(e,t){return this.x+=e,this.y+=t,this}assign(e){return this.x=e.x,this.y=e.y,this}assignAdd(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}assignSub(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}rotate(e,t){const r=this.x,n=this.y;return this.x=r*e-n*t,this.y=r*t+n*e,this}scale(e){return this.x*=e,this.y*=e,this}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}sub(e){return this.x-=e.x,this.y-=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}static distance(e,t){const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)}static add(e,t){return new Yge(e.x+t.x,e.y+t.y)}static sub(e,t){return new Yge(e.x-t.x,e.y-t.y)}},Mde=class{constructor(e,t,r){this.ratio=e,this.x=t,this.y=r}},uCe=class{constructor(e,t,r,n=8,s=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=n,this._pixelMargin=s,this._tileSize=IHr*n,this._dz=e,this._yPos=t,this._xPos=r}setPixelMargin(e){e!==this._pixelMargin&&(this._pixelMargin=e,this.setExtent(this._extent))}setExtent(e){this._extent=e,this._finalRatio=this._tileSize/e*(1<>this._dz;t>r&&(t=r),this._margin=t,this._xmin=r*this._xPos-t,this._ymin=r*this._yPos-t,this._xmax=this._xmin+r+2*t,this._ymax=this._ymin+r+2*t}reset(e){this._type=e,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(e,t){this._pushLine(),this._prevIsIn=this._isIn(e,t),this._moveTo(e,t,this._prevIsIn),this._prevPt=new Po(e,t),this._firstPt=new Po(e,t),this._dist=0}lineTo(e,t){const r=this._isIn(e,t),n=new Po(e,t),s=Po.distance(this._prevPt,n);let o,a,l,u,c,h,p,m;if(r)this._prevIsIn?this._lineTo(e,t,!0):(o=this._prevPt,a=n,l=this._intersect(a,o),this._start=this._dist+s*(1-this._r),this._lineTo(l.x,l.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,o=n,l=this._intersect(a,o),this._lineTo(l.x,l.y,!0),this._lineTo(o.x,o.y,!1);else{const v=this._prevPt,w=n;if(v.x<=this._xmin&&w.x<=this._xmin||v.x>=this._xmax&&w.x>=this._xmax||v.y<=this._ymin&&w.y<=this._ymin||v.y>=this._ymax&&w.y>=this._ymax)this._lineTo(w.x,w.y,!1);else{const S=[];if((v.xthis._xmin||v.x>this._xmin&&w.x=this._ymax?h=!0:S.push(new Mde(u,this._xmin,m))),(v.xthis._xmax||v.x>this._xmax&&w.x=this._ymax?h=!0:S.push(new Mde(u,this._xmax,m))),(v.ythis._ymin||v.y>this._ymin&&w.y=this._xmax?c=!0:S.push(new Mde(u,p,this._ymin))),(v.ythis._ymax||v.y>this._ymax&&w.y=this._xmax?c=!0:S.push(new Mde(u,p,this._ymax))),S.length===0)c?h?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):h?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(S.length>1&&S[0].ratio>S[1].ratio)this._start=this._dist+s*S[1].ratio,this._lineTo(S[1].x,S[1].y,!0),this._lineTo(S[0].x,S[0].y,!0);else{this._start=this._dist+s*S[0].ratio;for(let I=0;I2){const e=this._firstPt,t=this._prevPt;e.x===t.x&&e.y===t.y||this.lineTo(e.x,e.y);const r=this._line;let n=r.length;for(;n>=4&&(r[0].x===r[1].x&&r[0].x===r[n-2].x||r[0].y===r[1].y&&r[0].y===r[n-2].y);)r.pop(),r[0].x=r[n-2].x,r[0].y=r[n-2].y,--n}}result(e=!0){return this._pushLine(),this._lines.length===0?null:(this._type===Yy.Polygon&&e&&MHr.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==Yy.LineString)throw new Error("Only valid for lines");this._pushLine();const e=this._lines,t=e.length;if(t===0)return null;const r=[];for(let n=0;n=this._xmin&&e<=this._xmax&&t>=this._ymin&&t<=this._ymax}_intersect(e,t){let r,n,s;if(t.x>=this._xmin&&t.x<=this._xmax)n=t.y<=this._ymin?this._ymin:this._ymax,s=(n-e.y)/(t.y-e.y),r=e.x+s*(t.x-e.x);else if(t.y>=this._ymin&&t.y<=this._ymax)r=t.x<=this._xmin?this._xmin:this._xmax,s=(r-e.x)/(t.x-e.x),n=e.y+s*(t.y-e.y);else{n=t.y<=this._ymin?this._ymin:this._ymax,r=t.x<=this._xmin?this._xmin:this._xmax;const o=(r-e.x)/(t.x-e.x),a=(n-e.y)/(t.y-e.y);o0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Yy.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Yy.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(e,t,r){this._type!==Yy.Polygon?r&&(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Po(e,t))):(r||(ethis._xmax&&(e=this._xmax),tthis._ymax&&(t=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Po(e,t)),this._isH=!1,this._isV=!1)}_lineTo(e,t,r){let n,s;if(this._type!==Yy.Polygon)if(r){if(e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(n=this._line[this._line.length-1],n.equals(e,t)))return;this._line.push(new Po(e,t))}else this._line&&this._line.length>0&&this._pushLine();else if(r||(ethis._xmax&&(e=this._xmax),tthis._ymax&&(t=this._ymax)),e=Math.round((e-(this._xmin+this._margin))*this._finalRatio),t=Math.round((t-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){n=this._line[this._line.length-1];const o=n.x===e,a=n.y===t;if(o&&a)return;this._isH&&o||this._isV&&a?(n.x=e,n.y=t,s=this._line[this._line.length-2],s.x===e&&s.y===t?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(s=this._line[this._line.length-2],this._isH=s.x===e,this._isV=s.y===t)):(this._isH=s.x===e,this._isV=s.y===t)):(this._line.push(new Po(e,t)),this._isH=o,this._isV=a)}else this._line.push(new Po(e,t))}},AHr=class{setExtent(e){this._ratio=e===4096?1:4096/e}get validateTessellation(){return this._ratio<1}reset(e){this._lines=[],this._line=null}moveTo(e,t){this._line&&this._lines.push(this._line),this._line=[];const r=this._ratio;this._line.push(new Po(e*r,t*r))}lineTo(e,t){const r=this._ratio;this._line.push(new Po(e*r,t*r))}close(){const e=this._line;e&&!e[0].isEqual(e[e.length-1])&&e.push(e[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}};(function(i){i[i.sideLeft=0]="sideLeft",i[i.sideRight=1]="sideRight",i[i.sideTop=2]="sideTop",i[i.sideBottom=3]="sideBottom"})(Vg||(Vg={}));let MHr=class L4{static simplify(e,t,r){if(!r)return;const n=-t,s=e+t,o=-t,a=e+t,l=[],u=[],c=r.length;for(let p=0;pv.y?(l.push(p),l.push(I),l.push(Vg.sideLeft),l.push(-1)):(u.push(p),u.push(I),u.push(Vg.sideLeft),u.push(-1))),w.x>=s&&(w.y=a&&(w.x>v.x?(l.push(p),l.push(I),l.push(Vg.sideBottom),l.push(-1)):(u.push(p),u.push(I),u.push(Vg.sideBottom),u.push(-1)))),w=v}if(l.length===0||u.length===0)return;L4.fillParent(r,u,l),L4.fillParent(r,l,u);const h=[];L4.calcDeltas(h,u,l),L4.calcDeltas(h,l,u),L4.addDeltas(h,r)}static fillParent(e,t,r){const n=r.length,s=t.length;for(let o=0;o1&&n[o-2]===s?0:(n.push(s),L4.calcDelta(s,r,t,n)+1)}static addDeltas(e,t){const r=e.length;let n=0;for(let s=0;sn&&(n=o)}for(let s=0;si>=e&&i<=t||i>=t&&i<=e;function OHr(i,e,t,r,n,s,o){F8e=0;const a=(r-t)*s,l=n&&n.length,u=l?(n[0]-t)*s:a;let c,h,p,m,v,w=nGt(e,t,r,0,u,s,!0);if(w&&w.next!==w.prev){if(l&&(w=FHr(e,t,r,n,w,s)),a>80*s){c=p=e[0+t*s],h=m=e[1+t*s];for(let S=s;S0)for(let l=r;l=r;l-=s)a=_ft(l+e*s,i[l+e*s],i[l+1+e*s],a);return a&&S8(a,a.next)&&(Jse(a),a=a.next),a}function Yse(i,e=i){if(!i)return i;let t,r=i;do if(t=!1,r.steiner||!S8(r,r.next)&&r0(r.prev,r,r.next)!==0)r=r.next;else{if(Jse(r),r=e=r.prev,r===r.next)break;t=!0}while(t||r!==e);return e}function Xse(i,e,t,r,n,s,o,a){if(!i)return;!a&&s&&(i=sGt(i,r,n,s));let l=i;for(;i.prev!==i.next;){const u=i.prev,c=i.next;if(s?RHr(i,r,n,s):PHr(i))e.push(u.index/t+o),e.push(i.index/t+o),e.push(c.index/t+o),Jse(i),i=c.next,l=c.next;else if((i=c)===l){a?a===1?Xse(i=GHr(i,e,t,o),e,t,r,n,s,o,2):a===2&&UHr(i,e,t,r,n,s,o):Xse(Yse(i),e,t,r,n,s,o,1);break}}}function PHr(i){const e=i.prev,t=i,r=i.next;if(r0(e,t,r)>=0)return!1;let n=i.next.next;const s=n;let o=0;for(;n!==i.prev&&(o===0||n!==s);){if(o++,tV(e.x,e.y,t.x,t.y,r.x,r.y,n.x,n.y)&&r0(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function RHr(i,e,t,r){const n=i.prev,s=i,o=i.next;if(r0(n,s,o)>=0)return!1;const a=n.xs.x?n.x>o.x?n.x:o.x:s.x>o.x?s.x:o.x,c=n.y>s.y?n.y>o.y?n.y:o.y:s.y>o.y?s.y:o.y,h=R8e(a,l,e,t,r),p=R8e(u,c,e,t,r);let m=i.prevZ,v=i.nextZ;for(;m&&m.z>=h&&v&&v.z<=p;){if(m!==i.prev&&m!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&r0(m.prev,m,m.next)>=0||(m=m.prevZ,v!==i.prev&&v!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&r0(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;m&&m.z>=h;){if(m!==i.prev&&m!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,m.x,m.y)&&r0(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;v&&v.z<=p;){if(v!==i.prev&&v!==i.next&&tV(n.x,n.y,s.x,s.y,o.x,o.y,v.x,v.y)&&r0(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function _ft(i,e,t,r){const n=vbe.create(i,e,t);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Jse(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function DHr(i){let e=i,t=i;do(e.x=t.next.y&&t.next.y!==t.y){const p=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=r&&p>o){if(o=p,p===r){if(n===t.y)return t;if(n===t.next.y)return t.next}s=t.x=t.x&&t.x>=l&&r!==t.x&&tV(ns.x)&&Kse(t,i)&&(s=t,h=c)),t=t.next;return s}function sGt(i,e,t,r){let n;for(;n!==i;n=n.next){if(n=n||i,n.z===null&&(n.z=R8e(n.x,n.y,e,t,r)),n.prev.next!==n||n.next.prev!==n)return n.prev.next=n,n.next.prev=n,sGt(i,e,t,r);n.prevZ=n.prev,n.nextZ=n.next}return i.prevZ.nextZ=null,i.prevZ=null,NHr(i)}function NHr(i){let e,t=1;for(;;){let r,n=i;i=null,e=null;let s=0;for(;n;){s++,r=n;let o=0;for(;o0||a>0&&r;){let l;o===0?(l=r,r=r.nextZ,a--):a!==0&&r?n.z<=r.z?(l=n,n=n.nextZ,o--):(l=r,r=r.nextZ,a--):(l=n,n=n.nextZ,o--),e?e.nextZ=l:i=l,l.prevZ=e,e=l}n=r}if(e.nextZ=null,t*=2,s<2)return i}}function r0(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function oGt(i,e,t,r){return!!(S8(i,e)&&S8(t,r)||S8(i,r)&&S8(t,e))||r0(i,e,t)>0!=r0(i,e,r)>0&&r0(t,r,i)>0!=r0(t,r,e)>0}function $Hr(i,e){let t=i;do{if(t.index!==i.index&&t.next.index!==i.index&&t.index!==e.index&&t.next.index!==e.index&&oGt(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function BHr(i,e,t,r,n,s){let o=0;for(let a=r,l=n-s;a=0&&(i-o)*(r-a)-(t-o)*(e-a)>=0&&(t-o)*(s-a)-(n-o)*(r-a)>=0}function Kse(i,e){return r0(i.prev,i,i.next)<0?r0(i,e,i.next)>=0&&r0(i,i.prev,e)>=0:r0(i,e,i.prev)<0||r0(i,i.next,e)<0}function R8e(i,e,t,r,n){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-t)*n)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function S8(i,e){return i.x===e.x&&i.y===e.y}function jHr(i,e){return i.x-e.x}function GHr(i,e,t,r){let n=i;do{const s=n.prev,o=n.next.next;!S8(s,o)&&oGt(s,n,n.next,o)&&Kse(s,o)&&Kse(o,s)&&(e.push(s.index/t+r),e.push(n.index/t+r),e.push(o.index/t+r),Jse(n),Jse(n.next),n=i=o),n=n.next}while(n!==i);return n}function UHr(i,e,t,r,n,s,o){let a=i;do{let l=a.next.next;for(;l!==a.prev;){if(a.index!==l.index&&zHr(a,l)){let u=aGt(a,l);return a=Yse(a,a.next),u=Yse(u,u.next),Xse(a,e,t,r,n,s,o,0),void Xse(u,e,t,r,n,s,o,0)}l=l.next}a=a.next}while(a!==i)}function zHr(i,e){return i.next.index!==e.index&&i.prev.index!==e.index&&!$Hr(i,e)&&Kse(i,e)&&Kse(e,i)&&VHr(i,e)}function VHr(i,e){let t=i,r=!1;const n=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==i);return r}function aGt(i,e){const t=vbe.create(i.index,i.x,i.y),r=vbe.create(e.index,e.x,e.y),n=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=n,n.prev=t,r.next=t,t.prev=r,s.next=r,r.prev=s,r}let vbe=class lGt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(e,t,r){const n=F8e0))break;h+=I,p.push(a+c),c+=S}const m=o.length;OHr(o,t,a,a+c,p,2,s);const v=qHr(o,t,m,o.length,s),w=Math.abs(h);if(Math.abs((v-w)/Math.max(1e-7,w))>WHr)return o.length=0,!1;l=u,a+=c}return!0}function XHr(i){const{coords:e,lengths:t}=i,{buffer:r}=iGt(e,t);return r}function JHr(i,e,t){let r=0;for(let n=0;nt||lt)return!0}r+=s}return!1}function uGt(i,e){if(i==null)return null;if(!JHr(i,-128,xo+128))return i;v$.setPixelMargin(e),v$.reset(Yy.Polygon);let t=0;for(let o=0;on||cn){o=!0;continue}l.push({x:u,y:c})}let h=!1;for(;i.nextPoint();)if(u=i.x,c=i.y,o)t.lineTo(u,c);else{if(un||cn){h=!0;break}l.push({x:u,y:c})}if(h)o=!0;else{if(o){const p=t.resultWithStarts();if(p)for(const m of p)s.push(m)}else s.push({line:l,start:0});a=i.nextPath(),o=!1}}return s=s.filter(l=>l.line.length>1),s.length===0?null:s}v$.setExtent(xo),k8e.setExtent(xo);let Ec=class{static fromOptimized(e,t,r=!1,n=!1,s=1){return new L8e().initialize(e,t,r,n,s)}static fromJSON(e,t=!1,r=!1){const[n,s]=wft(e);return new N8e().initialize(n,s,t,r,1)}static fromOptimizedCIM(e,t,r=!1,n=!1,s=1){return new xft().initialize(e,t,r,n,s)}static fromJSONCIM(e,t=!1,r=!1,n=1){const[s,o]=wft(e);return new Sft().initialize(s,o,t,r,n)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),r=e.geometryType;return t&&r?this.fromOptimized(t,r):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),r=e.geometryType;return t&&r?this.fromOptimizedCIM(t,r):null}static createEmptyOptimized(e,t=!1,r=!1,n=1){return new L8e().initialize(new $o,e,t,r,n)}static createEmptyJSON(e,t=!1,r=!1){return new N8e().initialize([],e,t,r,1)}static createEmptyOptimizedCIM(e,t=!1,r=!1,n=1){return new xft().initialize(new $o,e,t,r,n)}static createEmptyJSONCIM(e,t=!1,r=!1,n=1){return new Sft().initialize([],e,t,r,n)}asJSON(){const e=oae(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,r=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const n=e,s=t;for(;this.nextPoint();)r+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return r+=(e-n)*(t+s),-.5*r}invertY(){this.yFactor*=-1}},L8e=class cGt extends Ec{constructor(){super(...arguments),this._end=-1}initialize(e,t,r,n,s){return this.hasZ=r,this.hasM=n,this.geometryType=t,this._stride=2+Number(r)+Number(n),this._geometry=e,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=s,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(e){if(e>=0&&ee)for(;this._pathIndex>e&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(e){const t=this._pathOffset+e*this._stride;return t>=0&&t=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}pathLength(){const e=this._end,t=this._stride,r=this._geometry.coords;let n=0;for(let s=this._pathOffset+t;se+t)}get pathSize(){const{lengths:e}=this._geometry;return this._pathIndex<0||this._pathIndex>e.length-1?0:this._geometry.isPoint?1:e[this._pathIndex]}get totalSize(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(e){this._geometry.coords[this._pointOffset]=e}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(e){this._geometry.coords[this._pointOffset+1]=this.yFactor*e}get z(){return this._geometry.coords[this._pointOffset+2]}set z(e){this._geometry.coords[this._pointOffset+2]=e}get m(){const e=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+e]}set m(e){this._geometry.coords[this._pointOffset+3]=e}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function ZHr(i){const e=[i.x,i.y];return i.z&&e.push(i.z),i.m&&e.push(i.m),e}function wft(i){return ed(i)?[i.rings,"esriGeometryPolygon"]:e0(i)?[i.paths,"esriGeometryPolyline"]:xF(i)?[[i.points],"esriGeometryMultipoint"]:zd(i)?[[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]],"esriGeometryEnvelope"]:dR(i)?[[[ZHr(i)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let N8e=class hGt extends Ec{initialize(e,t,r,n,s){return this._paths=e,this.geometryType=t,this.hasZ=r,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=s,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(e){return this._pathIndex=e,this._pointIndex=-1,e>=0&&e=0&&e=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const e=this._currentPath.length,t=this._currentPath;let r=0;for(let n=1;ne.length).reduce((e,t)=>e+t)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(e){this._currentPoint[0]=e}get y(){return this.yFactor*this._currentPoint[1]}set y(e){this._currentPoint[1]=this.yFactor*e}get z(){return this._currentPoint[2]}set z(e){this._currentPoint[2]=e}get m(){return this._currentPoint[this._mIndex]}set m(e){this._currentPoint[this._mIndex]=e}get pathIndex(){return this._pathIndex}};const Pde=4,Rde=1;let xft=class dGt extends L8e{initialize(e,t,r,n,s){return super.initialize(e,t,r,n,s),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const e=new dGt().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return e._controlPoints=this._controlPoints,e}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(e){this._controlPoints[this.pathIndex].add(e)}getControlPointAt(e){return this._controlPoints[this.pathIndex].has(e)}},Sft=class pGt extends N8e{initialize(e,t,r,n,s){return super.initialize(e,t,r,n,s)}clone(){return new pGt().initialize(li(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Pde]=Rde}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Pde]===Rde}setControlPointAt(e){this._paths[this.pathIndex][e][Pde]=Rde}getControlPointAt(e){return this._paths[this.pathIndex][e][Pde]===Rde}};const QHr=512;let MM,$8e=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function _Je(i,e){MM||(MM=new uCe(0,0,0,1));const t=i.geometryType==="esriGeometryPolygon",r=t?Yy.Polygon:Yy.LineString,n=t?3:2;let s,o;for(MM.reset(r),MM.setPixelMargin(e+1),MM.setExtent(QHr);i.nextPath();)if(!(i.pathSize1&&R>0&&u>0&&(a*S+l*I)/R/u<=this._maxCosAngle&&e.setControlPointAt(m-1),m===1&&(c=S,h=I,p=R),R>0&&(n=v,s=w,a=S,l=I,u=R)}this._isClosed&&u>0&&p>0&&(a*c+l*h)/p/u<=this._maxCosAngle&&e.setControlPointAt(0)}}},sX=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function ZOe(i,e){i[4]=e}let Sle=class{constructor(e,t=!0,r=!0,n=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!r&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.internalPlacement=new sX}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.pathIndex0?[o/l,a/l]:[1,0]}getSegAngleCS(e,t){const[[r,n],[s,o]]=e;return this.getAngleCS(r,n,s,o,t)}cut(e,t,r,n,s,o){return[s<=0?[e,t]:this.getCoord2D(e,t,r,n,s),o>=1?[r,n]:this.getCoord2D(e,t,r,n,o)]}getSubCurve(e,t,r){const n=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(n,e,t,r)?n:null}appendSubCurve(e,t,r,n){e.startPath(),t.seekPathStart();let s=0,o=!0;if(!t.nextPoint())return!1;let a=t.x,l=t.y;for(;t.nextPoint();){const u=this.getLength(a,l,t.x,t.y);if(u!==0){if(o){if(s+u>r){const c=(r-s)/u;let h=1,p=!1;s+u>=n&&(h=(n-s)/u,p=!0);const m=this.cut(a,l,t.x,t.y,c,h);if(m&&e.pushPoints(m),p)break;o=!1}}else{if(s+u>n){const c=this.cut(a,l,t.x,t.y,0,(n-s)/u);c&&e.pushPoint(c[1]);break}e.pushXY(t.x,t.y)}s+=u,a=t.x,l=t.y}else a=t.x,l=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let r,n,s,o,a=0;for(r=e.x,n=e.y;e.nextPoint();r=s,n=o){s=e.x,o=e.y;const l=this.getLength(r,n,s,o);if(l!==0){if(a+l>t){const u=(t-a)/l;return this.getCoord2D(r,n,s,o,u)}a+=l}}return null}offset(e,t,r,n,s){if(!e||e.length<2)return null;let o=0,a=e[o++],l=o;for(;o=0==t<=0){if(I<1){const R=[v[0]-w[0],v[1]-w[1]];this.normalize(R);const L=Math.sqrt((1+I)/2);if(L>1/n){const k=-Math.abs(t)/L;c.push([h[0]-R[0]*k,h[1]-R[1]*k])}}}else switch(r){case xP.Mitered:{const R=Math.sqrt((1+I)/2);if(R>0&&1/R0){const L=1/R;let k=L;for(let B=1;B0){const s=Ec.createEmptyOptimizedCIM(e.geometryType),o=oae(e)[0],a=this._curveHelper.offset(o,this._size,xP.Rounded,4,this._offsetFlattenError);if(a)return s.pushPath(a),s}else if(this._size<0){const s=e.asJSON();if(Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._size>0)return Ec.fromJSONCIM({xmin:s.xmin-this._size,xmax:s.xmax+this._size,ymin:s.ymin-this._size,ymax:s.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const r=this._tileKey?_Je(e,this._maxInflateSize):e;if(!r)continue;const n=t.buffer(Xi.WebMercator,r.asJSON(),this._size,1);return n?Ec.fromJSONCIM(n):null}return null}},yGt=class gee{static local(){return gee.instance===null&&(gee.instance=new gee),gee.instance}execute(e,t,r,n,s){return new sWr(e,t,r)}};yGt.instance=null;let sWr=class{constructor(e,t,r){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=r,this._rule=t.rule??Gl.FullGeometry,this._defaultSize=this._defaultPointSize*r}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(oae(e));if(t&&t.length)return Ec.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,r,n){return[e[0]*t+r[0]*n,e[1]*t+r[1]*n]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,r){return[e[0]+t,e[1]+r]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const r=t/this._norm(e);e[0]*=r,e[1]*=r}_leftPerpendicular(e){const t=-e[1],r=e[0];e[0]=t,e[1]=r}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],r=-e[0];e[0]=t,e[1]=r}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,r){const n=e[0]*t-e[1]*r,s=e[0]*r+e[1]*t;e[0]=n,e[1]=s}_makeCtrlPt(e){const t=[e[0],e[1]];return ZOe(t,1),t}_addAngledTicks(e,t,r,n){const s=this._sub(r,t);this._normalize(s);const o=this._crossProduct(s,this._sub(n,t));let a;a=o>0?this._rightPerp(s):this._leftPerp(s);const l=Math.abs(o)/2,u=[];u.push([t[0]+(a[0]-s[0])*l,t[1]+(a[1]-s[1])*l]),u.push(t),u.push(r),u.push([r[0]+(a[0]+s[0])*l,r[1]+(a[1]+s[1])*l]),e.push(u)}_addBezier2(e,t,r,n,s){if(s--==0)return void e.push(n);const o=this._mid(t,r),a=this._mid(r,n),l=this._mid(o,a);this._addBezier2(e,t,o,l,s),this._addBezier2(e,l,a,n,s)}_addBezier3(e,t,r,n,s,o){if(o--==0)return void e.push(s);const a=this._mid(t,r),l=this._mid(r,n),u=this._mid(n,s),c=this._mid(a,l),h=this._mid(l,u),p=this._mid(c,h);this._addBezier3(e,t,a,c,p,o),this._addBezier3(e,p,h,u,s,o)}_add90DegArc(e,t,r,n,s){const o=s??this._crossProduct(this._sub(r,t),this._sub(n,t))>0,a=this._mid(t,r),l=this._sub(a,t);o?this._leftPerpendicular(l):this._rightPerpendicular(l),a[0]+=l[0],a[1]+=l[1],this._addBezier3(e,t,this._mix(t,.33333,a,.66667),this._mix(r,.33333,a,.66667),r,4)}_addArrow(e,t,r){const n=t[0],s=t[1],o=t[t.length-1],a=this._sub(n,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s)),u=.5*l,c=this._leftPerp(a),h=[o[0]-c[0]*l,o[1]-c[1]*l],p=t.length-1,m=[];m.push(r?[-c[0],-c[1]]:c);let v=[-a[0],-a[1]];for(let w=1;w0;w--)e.push([t[w][0]+m[w][0]*u,t[w][1]+m[w][1]*u]);e.push([h[0]+m[0][0]*u,h[1]+m[0][1]*u]),e.push([h[0]+m[0][0]*l,h[1]+m[0][1]*l]),e.push(n),e.push([h[0]-m[0][0]*l,h[1]-m[0][1]*l]),e.push([h[0]-m[0][0]*u,h[1]-m[0][1]*u]);for(let w=1;w=2?e[1]:this._add2(e[0],t*this._defaultSize,r*this._defaultSize)}_cp3(e,t,r,n){if(e.length>=3)return e[2];const s=this._mix(e[0],1-r,t,r),o=this._sub(t,e[0]);return this._normalize(o),this._rightPerpendicular(o),[s[0]+o[0]*n*this._defaultSize,s[1]+o[1]*n*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],r=this._cp2(e,-4,0),n=this._sub(t,r);this._normalize(n);const s=this._rightPerp(n);return[t,r,[t[0]+(s[0]-n[0])*this._defaultSize,t[1]+(s[1]-n[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],r=this._cp2(e,-4,0);let n;if(e.length>=3)n=e[e.length-1];else{const s=this._sub(t,r);this._normalize(s);const o=this._rightPerp(s);n=[t[0]+(o[0]-s[0])*this._defaultSize,t[1]+(o[1]-s[1])*this._defaultSize]}return[r,n]}_processGeom(e){if(!e)return null;const t=[];for(const r of e){if(!r||r.length===0)continue;const n=r.length;let s=r[0];switch(this._rule){case Gl.PerpendicularFromFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=[];l.push(a),l.push(this._mid(s,o)),t.push(l);break}case Gl.ReversedFirstSegment:{const o=this._cp2(r,0,-1);t.push([o,s]);break}case Gl.PerpendicularToSecondSegment:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=[];l.push(this._mid(o,a)),l.push(s),t.push(l);break}case Gl.SecondSegmentWithTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);let u;u=this._crossProduct(l,this._sub(s,o))>0?this._rightPerp(u):this._leftPerp(l);const c=[];c.push([o[0]+(u[0]-l[0])/3,o[1]+(u[1]-l[1])/3]),c.push(o),c.push(a),c.push([a[0]+(u[0]+l[0])/3,a[1]+(u[1]+l[1])/3]),t.push(c);break}case Gl.DoublePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push(s),h.push([a[0]+u[0]*c,a[1]+u[1]*c]),t.push(h);const p=[];p.push([a[0]-u[0]*c,a[1]-u[1]*c]),p.push(o),t.push(p);break}case Gl.OppositeToFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,3),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push([a[0]+u[0]*c,a[1]+u[1]*c]),h.push([a[0]-u[0]*c,a[1]-u[1]*c]),t.push(h);break}case Gl.TriplePerpendicular:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o),u=this._sub(l,a);this._normalize(u);const c=this._crossProduct(u,this._sub(s,a));this._leftPerpendicular(u);const h=[];h.push([a[0]+u[0]*c*.8,a[1]+u[1]*c*.8]),h.push([l[0]+.8*(s[0]-l[0]),l[1]+.8*(s[1]-l[1])]),t.push(h),t.push([a,l]);const p=[];p.push([a[0]-u[0]*c*.8,a[1]-u[1]*c*.8]),p.push([l[0]+.8*(o[0]-l[0]),l[1]+.8*(o[1]-l[1])]),t.push(p);break}case Gl.HalfCircleFirstSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,4),l=this._mid(s,o);let u=this._sub(o,s);const c=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),m=Math.sqrt((1-c)/2),v=[];let w;this._crossProduct(u,this._sub(a,s))>0?(v.push(s),u=this._sub(s,l),w=o):(v.push(o),u=this._sub(o,l),w=s),this._rotateDirect(u,p,m),u[0]/=p,u[1]/=p;for(let S=1;S<=18;S++)v.push(this._add(l,u)),this._rotateDirect(u,c,h);v.push(w),t.push(v);break}case Gl.HalfCircleSecondSegment:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,1,-1);let l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o))/2;this._leftPerpendicular(l);const c=[o[0]+l[0]*u,o[1]+l[1]*u];l=this._sub(o,c);const h=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);u>0&&(p=-p);const m=[o];for(let v=1;v<=18;v++)this._rotateDirect(l,h,p),m.push(this._add(c,l));t.push(m);break}case Gl.HalfCircleExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-1);let l;if(n>=4)l=r[3];else{const v=this._sub(s,o);l=this._add(a,v)}const u=this._dist(o,a)/2/.75,c=this._sub(o,s);this._normalize(c,u);const h=this._sub(a,l);this._normalize(h,u);const p=[l,a];t.push(p);const m=[this._clone(a)];this._addBezier3(m,a,this._add(a,h),this._add(o,c),o,4),m.push(s),t.push(m);break}case Gl.OpenCircle:{const o=this._cp2(r,-2,0),a=this._sub(o,s),l=Math.cos(Math.PI/18),u=-Math.sin(Math.PI/18),c=[o];for(let h=1;h<=33;h++)this._rotateDirect(a,l,u),c.push(this._add(s,a));t.push(c);break}case Gl.CoverageEdgesWithTicks:{const o=this._cp2(r,0,-1);let a,l;if(n>=3)a=r[2];else{const p=this._sub(o,s),m=this._leftPerp(p);a=[s[0]+m[0]-.25*p[0],s[1]+m[1]-.25*p[1]]}if(n>=4)l=r[3];else{const p=this._mid(s,o),m=this._sub(s,o);this._normalize(m),this._leftPerpendicular(m);const v=this._crossProduct(m,this._sub(a,p));this._rightPerpendicular(m),l=[a[0]+m[0]*v*2,a[1]+m[1]*v*2]}const u=this._sub(o,s);let c,h;c=this._crossProduct(u,this._sub(a,s))>0?this._rightPerp(u):this._leftPerp(u),h=[],h.push(a),h.push(s),h.push([s[0]+(c[0]-u[0])/3,s[1]+(c[1]-u[1])/3]),t.push(h),c=this._crossProduct(u,this._sub(l,o))>0?this._rightPerp(c):this._leftPerp(u),h=[],h.push([o[0]+(c[0]+u[0])/3,o[1]+(c[1]+u[1])/3]),h.push(o),h.push(l),t.push(h);break}case Gl.GapExtentWithDoubleTicks:{const o=this._cp2(r,0,2),a=this._cp3(r,o,0,1);let l;if(n>=4)l=r[3];else{const u=this._sub(o,s);l=this._add(a,u)}this._addAngledTicks(t,s,o,this._mid(a,l)),this._addAngledTicks(t,a,l,this._mid(s,o));break}case Gl.GapExtentMidline:{const o=this._cp2(r,2,0),a=this._cp3(r,o,0,1);let l;if(n>=4)l=r[3];else{const c=this._sub(o,s);l=this._add(a,c)}const u=[];u.push(this._mid(s,a)),u.push(this._mid(o,l)),t.push(u);break}case Gl.Chevron:{const o=this._cp2(r,-1,-1);let a;if(n>=3)a=r[2];else{const l=this._sub(o,s);this._leftPerpendicular(l),a=this._add(s,l)}t.push([o,this._makeCtrlPt(s),a]);break}case Gl.PerpendicularWithArc:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,.5,-1);let l=this._sub(o,s);const u=this._norm(l);l[0]/=u,l[1]/=u;const c=this._crossProduct(l,this._sub(a,s));let h=this._dotProduct(l,this._sub(a,s));h<.05*u?h=.05*u:h>.95*u&&(h=.95*u);const p=[s[0]+l[0]*h,s[1]+l[1]*h];this._leftPerpendicular(l);let m=[];m.push([p[0]-l[0]*c,p[1]-l[1]*c]),m.push([p[0]+l[0]*c,p[1]+l[1]*c]),t.push(m);const v=[o[0]+l[0]*c,o[1]+l[1]*c];l=this._sub(o,v);const w=Math.cos(Math.PI/18);let S=Math.sin(Math.PI/18);c<0&&(S=-S),m=[s,o];for(let I=1;I<=9;I++)this._rotateDirect(l,w,S),m.push(this._add(v,l));t.push(m);break}case Gl.ClosedHalfCircle:{const o=this._cp2(r,2,0),a=this._mid(s,o),l=this._sub(o,a),u=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),h=[s,o];for(let p=1;p<=18;p++)this._rotateDirect(l,u,c),h.push(this._add(a,l));t.push(h);break}case Gl.TripleParallelExtended:{const o=this._cp2(r,0,-2),a=this._cp3(r,o,1,-2),l=this._mid(s,o),u=this._sub(a,o);this._normalize(u);const c=Math.abs(this._crossProduct(u,this._sub(l,o)))/2,h=this._dist(o,a),p=[o,s];p.push([s[0]+u[0]*h*.5,s[1]+u[1]*h*.5]),t.push(p);const m=[];m.push([l[0]-u[0]*c,l[1]-u[1]*c]),m.push([l[0]+u[0]*h*.375,l[1]+u[1]*h*.375]),ZOe(m[m.length-1],1),m.push([l[0]+u[0]*h*.75,l[1]+u[1]*h*.75]),t.push(m);const v=[o,a];t.push(v);break}case Gl.ParallelWithTicks:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(a,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l),this._addAngledTicks(t,s,o,a),this._addAngledTicks(t,this._mix(s,1,l,u),this._mix(o,1,l,u),this._mid(s,o));break}case Gl.Parallel:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._leftPerp(l),c=this._crossProduct(l,this._sub(a,s));let h=[s,o];t.push(h),h=[],h.push([s[0]+u[0]*c,s[1]+u[1]*c]),h.push([o[0]+u[0]*c,o[1]+u[1]*c]),t.push(h);break}case Gl.PerpendicularToFirstSegment:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._mid(s,o),u=this._sub(o,s);this._normalize(u);const c=this._crossProduct(u,this._sub(a,s));this._leftPerpendicular(u);const h=[];h.push([l[0]-u[0]*c*.25,l[1]-u[1]*c*.25]),h.push([l[0]+u[0]*c*1.25,l[1]+u[1]*c*1.25]),t.push(h);break}case Gl.ParallelOffset:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]-l[0]*u,s[1]-l[1]*u]),c.push([o[0]-l[0]*u,o[1]-l[1]*u]),t.push(c);const h=[];h.push([s[0]+l[0]*u,s[1]+l[1]*u]),h.push([o[0]+l[0]*u,o[1]+l[1]*u]),t.push(h);break}case Gl.OffsetOpposite:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]-l[0]*u,s[1]-l[1]*u]),c.push([o[0]-l[0]*u,o[1]-l[1]*u]),t.push(c);break}case Gl.OffsetSame:{const o=this._cp2(r,3,0),a=this._cp3(r,o,.5,-1),l=this._sub(o,s);this._normalize(l);const u=this._crossProduct(l,this._sub(a,s));this._leftPerpendicular(l);const c=[];c.push([s[0]+l[0]*u,s[1]+l[1]*u]),c.push([o[0]+l[0]*u,o[1]+l[1]*u]),t.push(c);break}case Gl.CircleWithArc:{let o=this._cp2(r,3,0);const a=this._cp3(r,o,.5,-1);let l,u;if(n>=4)l=r[3],u=this._crossProduct(this._sub(l,o),this._sub(a,o))>0;else{l=o,u=this._crossProduct(this._sub(l,s),this._sub(a,s))>0;const v=24*this._geomUnitsPerPoint,w=this._sub(l,s);this._normalize(w,v);const S=Math.sqrt(2)/2;this._rotateDirect(w,S,u?S:-S),o=this._add(s,w)}const c=this._sub(o,s),h=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),m=[o];for(let v=1;v<=36;v++)this._rotateDirect(c,h,p),m.push(this._add(s,c));this._add90DegArc(m,o,l,a,u),ZOe(m[m.length-8],1),t.push(m);break}case Gl.DoubleJog:{let o,a,l=this._cp2(r,-3,1);if(o=n>=3?r[2]:this._add(s,this._sub(s,l)),n>=4)a=r[3];else{const I=s;s=l,a=o;const R=this._dist(s,I),L=this._dist(a,I);let k=30*this._geomUnitsPerPoint;.5*R0?this._rotateDirect(w,v,-v):this._rotateDirect(w,v,v);let S=[];S.push(l),S.push(this._add(u,w)),S.push(this._sub(u,w)),S.push(s),t.push(S),w=this._sub(a,o),this._normalize(w,m),this._crossProduct(w,this._sub(s,o))<0?this._rotateDirect(w,v,v):this._rotateDirect(w,v,-v),S=[],S.push(o),S.push(this._add(c,w)),S.push(this._sub(c,w)),S.push(a),t.push(S);break}case Gl.PerpendicularOffset:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);this._crossProduct(l,this._sub(s,o))>0?this._rightPerpendicular(l):this._leftPerpendicular(l);const u=[l[0]/8,l[1]/8],c=this._sub(this._mid(o,a),u);t.push([c,s]);break}case Gl.LineExcludingLastSegment:{const o=this._arrowPath(r),a=[];let l=o.length-2;for(;l--;)a.push(o[l]);t.push(a);break}case Gl.MultivertexArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!1),t.push(a);break}case Gl.CrossedArrow:{const o=this._arrowPath(r),a=[];this._addArrow(a,o,!0),t.push(a);break}case Gl.ChevronArrow:{const[o,a]=this._arrowLastSeg(r),l=10*this._geomUnitsPerPoint,u=this._sub(s,o);this._normalize(u);const c=this._crossProduct(u,this._sub(a,o)),h=this._leftPerp(u),p=[a[0]-h[0]*c*2,a[1]-h[1]*c*2],m=[];m.push([a[0]+u[0]*l,a[1]+u[1]*l]),m.push(s),m.push([p[0]+u[0]*l,p[1]+u[1]*l]),t.push(m);break}case Gl.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const c=[a[0]-l[0]*u,a[1]-l[1]*u],h=[];h.push([c[0]+l[0]*u*.5,c[1]+l[1]*u*.5]),h.push(this._mid(c,s)),h.push([c[0]-l[0]*u*.5,c[1]-l[1]*u*.5]),t.push(h);break}case Gl.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(r),l=this._sub(s,o);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));this._leftPerpendicular(l);const c=[a[0]-l[0]*u,a[1]-l[1]*u];t.push([o,c]);break}case Gl.Arch:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=this._sub(s,o),u=this._mix(a,1,l,.55),c=this._mix(a,1,l,-.55),h=[s];this._addBezier2(h,s,u,a,4),this._addBezier2(h,a,c,o,4),t.push(h);break}case Gl.CurvedParallelTicks:{const o=this._cp2(r,-4,1),a=this._cp3(r,o,.882353,-1.94),l=this._sub(a,o);this._crossProduct(l,this._sub(s,o))>0?this._rightPerpendicular(l):this._leftPerpendicular(l);const u=[l[0]/8,l[1]/8],c=this._sub(this._mid(o,a),u),h=this._sub(this._mix(o,.75,a,.25),u),p=this._sub(this._mix(o,.25,a,.75),u),m=[o];this._addBezier2(m,o,h,c,3),this._addBezier2(m,c,p,a,3),t.push(m);for(let v=0;v<8;v++){const w=m[2*v+1],S=[this._clone(w)];S.push(this._add(w,[l[0]/4,l[1]/4])),t.push(S)}break}case Gl.Arc90Degrees:{const o=this._cp2(r,0,-1),a=this._cp3(r,o,.5,1),l=[o];this._add90DegArc(l,o,s,a),t.push(l);break}case Gl.FullGeometry:default:t.push(r)}}return t}},vGt=class yee{static local(){return yee.instance===null&&(yee.instance=new yee),yee.instance}execute(e,t,r,n,s){return new oWr(e,t,r)}};vGt.instance=null;let oWr=class extends cCe{constructor(e,t,r){super(e,!0,!0),this._curveHelper=new qR,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*r,this._endCut=(t.endCut!==void 0?t.endCut:1)*r,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*r,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:r,_middleCut:n}=this,s=e.pathLength(),o=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||r!==0||n!==0)if(t+r+n>=s)for(o.startPath();e.nextPoint();)o.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(o,e,0,t),this._curveHelper.appendSubCurve(o,e,.5*(s-n),.5*(s+n)),this._curveHelper.appendSubCurve(o,e,s-r,r)}else if(t===0&&r===0&&n===0)for(o.startPath();e.nextPoint();)o.pushXY(e.x,e.y);else t+r+n0&&(s/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(r){if(r.pathSize===0)if(s===0){const a=t.segment[0];r.pushXY(a[0],a[1])}else r.pushPoint(this.getSegCoord2D(t.segment,s));const o=t.segment[1];r.pushXY(o[0],o[1])}if(s=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==V5.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,n===V5.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,r){r.pathSize===0&&(s===0?r.pushPoint(t.segment[0]):r.pushPoint(this.getSegCoord2D(t.segment,s)));const o=t.abscissa/t.segmentLength;o===1?r.pushPoint(t.segment[1]):r.pushPoint(this.getSegCoord2D(t.segment,o))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(r=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(r),this._patternLength>0){const n=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,s=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let o=Math.round((this._partLength-(n+s))/this._patternLength);o<=0&&(o=n+s>0?0:1),this._partLengthRatio=this._partLength/(n+s+o*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)n-=t,t=this._pattern.nextValue(),o=!o;t-=n,o?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let r=this._walker.nextCurve(t);if(r)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)r.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(r.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,r=this._firstCurve,this._firstCurve=null;return r?.reset(),r}},bGt=class _ee{static local(){return _ee.instance===null&&(_ee.instance=new _ee),_ee.instance}execute(e,t,r,n,s,o){return new lWr(e,t,r,n,s,o)}};bGt.instance=null;let lWr=class{constructor(e,t,r,n,s,o){switch(this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._maxInflateSize=o*r,this._width=(t.width!==void 0?t.width:2)*r,t.method){case U6.Mitered:case U6.Bevelled:case U6.Rounded:case U6.TrueBuffer:case U6.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:Ec.fromJSONCIM({paths:[[[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const r=this._tileKey?_Je(e,this._maxInflateSize):e.clone();if(!r)continue;const n=t.buffer(Xi.WebMercator,r.asJSON(),-this._width,1);if(n){for(const s of n.rings)if(s){r.startPath();for(const o of s.reverse())r.pushXY(o[0],r.yFactor*o[1])}}return r}}return null}},wGt=class bee{static local(){return bee.instance===null&&(bee.instance=new bee),bee.instance}execute(e,t,r,n,s){return new uWr(e,t,r)}};wGt.instance=null;let uWr=class extends cCe{constructor(e,t,r){super(e,!1,!0),this._curveHelper=new qR,this._length=(t.length!==void 0?t.length:20)*r,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(e){const t=Ec.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const r=e.x,n=e.y;e.seekInPath(e.pathSize-1);const s=e.x,o=e.y,a=[s-r,o-n];this._curveHelper.normalize(a);const l=r+(s-r)*this._position/100,u=n+(o-n)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let h=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(h=-h),this._mirror=!this._mirror;const p=[l-this._length/2*c,u-this._length/2*h],m=[l+this._length/2*c,u+this._length/2*h];return t.pushPath([[r,n],p,m,[s,o]]),t}},xGt=class wee{static local(){return wee.instance===null&&(wee.instance=new wee),wee.instance}execute(e,t,r,n,s){return new cWr(e,t,r)}};xGt.instance=null;let cWr=class{constructor(e,t,r){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*r:0,this._offsetY=t.offsetY!==void 0?t.offsetY*r:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,r){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+r;return e.reset(),e}};const hWr=10;let SGt=class xee{static local(){return xee.instance===null&&(xee.instance=new xee),xee.instance}execute(e,t,r,n,s,o){return new dWr(e,t,r,n,s,o)}};SGt.instance=null;let dWr=class{constructor(e,t,r,n,s,o){this._inputGeometries=e,this._tileKey=n,this._geometryEngine=s,this._curveHelper=new qR,this._offset=(t.offset??1)*r,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(o*r),hWr),this._option=t.option,this._offsetFlattenError=Zse*r}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===xP.Rounded&&this._offset>0){const o=wF(e),a=this._curveHelper.offset(o,-this._offset,this._method,4,this._offsetFlattenError);if(a){const l=Ec.createEmptyOptimizedCIM(e.geometryType);return l.pushPath(a),l}return null}const s=e.asJSON();if(zd(s)&&Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._offset>0)return Ec.fromJSONCIM({xmin:s.xmin-this._offset,xmax:s.xmax+this._offset,ymin:s.ymin-this._offset,ymax:s.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const r=this._tileKey?_Je(e,this._maxInflateSize):e.clone();if(!r)continue;const n=t.offset(Xi.WebMercator,r.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return n?Ec.fromJSONCIM(n):null}return null}},TGt=class See{static local(){return See.instance===null&&(See.instance=new See),See.instance}execute(e,t,r,n,s){return new pWr(e,t,r)}};TGt.instance=null;let pWr=class{constructor(e,t,r){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return fWr(e.clone());e=this._inputGeometries.next()}return null}};function fWr(i){for(;i.nextPath();)for(let e=0;e0){const t=f2e(e),r=(t[2]+t[0])/2,n=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),r,n)}e=this._inputGeometries.next()}return null}_rotate(e,t,r){const n=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const o=e.x-t,a=e.y-r;e.x=t+o*n-a*s,e.y=r+o*s+a*n}return e.reset(),e}},EGt=class Cee{static local(){return Cee.instance===null&&(Cee.instance=new Cee),Cee.instance}execute(e,t,r,n,s){return new gWr(e,t,r)}};EGt.instance=null;let gWr=class{constructor(e,t,r){this._inputGeometries=e,this._xFactor=t.XScaleFactor!==void 0?t.XScaleFactor:1.15,this._yFactor=t.YScaleFactor!==void 0?t.YScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=f2e(e),r=(t[2]+t[0])/2,n=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),r,n)}}return null}_scaleCursor(e,t,r){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=r+(e.y-r)*this._yFactor;return e.reset(),e}},IGt=class Eee{static local(){return Eee.instance===null&&(Eee.instance=new Eee),Eee.instance}execute(e,t,r,n,s){return new yWr(e,t,r)}};IGt.instance=null;let yWr=class{constructor(e,t,r){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*r,this._period=(t.period!==void 0?t.period:3)*r,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new hCe,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new dCe,this._walker.updateTolerance(r)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=Ec.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const r=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case iV.Sinus:default:this._constructCurve(t,r,!1);break;case iV.Square:this._constructSquare(t,r);break;case iV.Triangle:this._constructTriangle(t,r);break;case iV.Random:this._constructCurve(t,r,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,r){let n=Math.round(t/this._period);n===0&&(n=1);const s=n*16+1,o=t/n,a=this._period/16,l=1/s,u=2*Math.PI*t/o,c=2*Math.PI*Math.random(),h=2*Math.PI*Math.random(),p=2*Math.PI*Math.random(),m=.75-Math.random()/2,v=.75-Math.random()/2,w=new qO;this._walker.curPointAndAngle(w),e.pushPoint(w.pt);let S=0;for(;;){if(!this._walker.nextPointAndAngle(a,w)){e.pushPoint(this._walker.getPathEnd());break}{const I=S;let R;if(S+=l,r){const L=this._height/2*(1+.3*Math.sin(m*u*I+c));R=L*Math.sin(u*I+h),R+=L*Math.sin(v*u*I+p),R/=2}else R=.5*this._height*Math.sin(.5*u*I);e.pushXY(w.pt[0]-R*w.sa,w.pt[1]+R*w.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let r=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new qO;this._walker.curPointAndAngle(s);const o=new qO;if(this._walker.nextPointAndAngle(this._period,o)){const a=new qO;this._walker.nextPointAndAngle(this._period,a)&&(r?(e.pushPoint(s.pt),r=!1):e.pushPoint(s.pt),e.pushXY(s.pt[0]-this._height/2*s.sa,s.pt[1]+this._height/2*s.ca),e.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),e.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca),n=!0)}}if(!n){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let r=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new qO;this._walker.curPointAndAngle(s);const o=new qO;if(this._walker.nextPointAndAngle(this._period/2,o)){const a=new qO;this._walker.nextPointAndAngle(this._period,a)&&(this._walker.nextPosition(this._period/2)&&(r?(e.pushPoint(s.pt),r=!1):e.pushPoint(s.pt),e.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),e.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca)),n=!0)}}if(!n){e.pushPoint(this._walker.getPathEnd());break}}}},AGt=class Iee{static local(){return Iee.instance===null&&(Iee.instance=new Iee),Iee.instance}execute(e,t,r,n,s){return new vWr(e,t,r)}};AGt.instance=null;let vWr=class extends Sle{constructor(e,t,r){super(e),this._geometryWalker=new dCe,this._geometryWalker.updateTolerance(r),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*r,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*r,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*r,this._pattern=new hCe,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(r),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===uC.WithFullGap&&this.isClosed?this._endings=uC.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,s=!0;switch(this._endings){case uC.NoConstraint:n=-this._position,n=this._adjustPosition(n),s=!1;break;case uC.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case uC.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case uC.WithMarkers:n=0;break;case uC.Custom:n=-this._position,n=this._adjustPosition(n),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,s))return null;this._pattern.reset();let o=0;for(;n>o;)n-=o,o=this._pattern.nextValue();o-=n,t=o,this.iteratePath=!0}const r=new qO;return this._geometryWalker.nextPointAndAngle(t,r)?this._endings===uC.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===uC.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(r.pt[0]-this._offset*r.sa,r.pt[1]+this._offset*r.ca),this._angleToLine&&this.internalPlacement.setRotateCS(r.ca,r.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},MGt=class Aee{static local(){return Aee.instance===null&&(Aee.instance=new Aee),Aee.instance}execute(e,t,r,n,s){return new _Wr(e,t,r)}};MGt.instance=null;let _Wr=class extends Sle{constructor(e,t,r){super(e,!1,!0),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*r:0,this._beginProcessed=!1}processPath(e){let t;switch(this._type){case Cb.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case Cb.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Cb.JustEnd:t=this._atExtremities(e,this._position,!1);case Cb.None:}return t}_atExtremities(e,t,r){if(r||e.seekPathEnd(),r?e.nextPoint():e.prevPoint()){let n=0,[s,o]=[0,0],[a,l]=[e.x,e.y];for(;r?e.nextPoint():e.prevPoint();){s=a,o=l,a=e.x,l=e.y;const u=this._curveHelper.getLength(s,o,a,l);if(n+u>t){const c=(t-n)/u,[h,p]=this._curveHelper.getAngleCS(s,o,a,l,c),m=this._curveHelper.getCoord2D(s,o,a,l,c);return this.internalPlacement.setTranslate(m[0]-this._offset*p,m[1]+this._offset*h),this._angleToLine&&this.internalPlacement.setRotateCS(-h,-p),this.internalPlacement}n+=u}}return null}},OGt=class Mee{static local(){return Mee.instance===null&&(Mee.instance=new Mee),Mee.instance}execute(e,t,r,n,s){return new bWr(e,t,r)}};OGt.instance=null;let bWr=class extends Sle{constructor(e,t,r){super(e),this._walker=new dCe,this._walker.updateTolerance(r),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*r:0,this._endGap=t.endPosition!==void 0?t.endPosition*r:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new hCe,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;t=l-this._prevPos,this._prevPos=l}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const a=this._pattern.nextValue()*this._subPathLen,l=this._beginGap+a;t=l-this._prevPos,this._prevPos=l,this.iteratePath=!0}const r=new qO;if(!this._walker.nextPointAndAngle(t,r,V5.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(r.pt[0]-this._offset*r.sa,r.pt[1]+this._offset*r.ca);const n=this._isFirst&&this._flipFirst;let s,o;return this._angleToLine?(s=r.ca,o=r.sa):(s=1,o=0),n&&(s=-s,o=-o),this.internalPlacement.setRotateCS(s,o),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const RD=512,wWr=10,qE=24,bbe=1e-6;let PGt=class Oee{static local(){return Oee.instance===null&&(Oee.instance=new Oee),Oee.instance}execute(e,t,r,n,s){return new xWr(e,t,r,n,s)}};PGt.instance=null;let xWr=class _${constructor(e,t,r,n,s){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(t.stepX??16)*r,this._stepY=Math.abs(t.stepY??16)*r,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=t.gridType??_re.Fixed,this._gridType===_re.Random){const o=t.seed??13,a=1;this._randomLCG=new VC(o*a),this._randomness=(t.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=t.gridAngle??0,this._shiftOddRows=t.shiftOddRows??!1,this._offsetX=(t.offsetX??0)*r,this._offsetY=(t.offsetY??0)*r,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,l,u]=n.split("/"),c=parseFloat(o),h=parseFloat(a),p=parseFloat(l),m=parseFloat(u);this._graphicOriginX=-(m*2**c+p)*RD,this._graphicOriginY=h*RD,this._testInsidePolygon=!0}this._internalPlacement=new sX,this._calculateMinMax(e),this._geometryCursor=e}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!_$._randValues){_$._randValues=[];for(let e=0;e=R,this._polygonMin=this._verticalSubdivision?p:v,this._testInsidePolygon){let L=0-this._graphicOriginX-this._offsetX-this._stepX,k=RD-this._graphicOriginX-this._offsetX+this._stepX,B=-RD-this._graphicOriginY-this._offsetY-this._stepY,$=0-this._graphicOriginY-this._offsetY+this._stepY;if(S){const V=[[L,B],[L,$],[k,B],[k,$]];L=B=Number.MAX_VALUE,k=$=-Number.MAX_VALUE;for(const Y of V){const K=this._cosAngle*Y[0]-this._sinAngle*Y[1],Q=this._sinAngle*Y[0]+this._cosAngle*Y[1];L=Math.min(L,K),k=Math.max(k,K),B=Math.min(B,Q),$=Math.max($,Q)}}l=l!==Number.MAX_VALUE?Math.max(l,L):L,u=u!==Number.MAX_VALUE?Math.max(u,B):B,c=c!==-Number.MAX_VALUE?Math.min(c,k):k,h=h!==-Number.MAX_VALUE?Math.min(h,$):$}this._xMin=Math.round(l/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(u/this._stepY),this._yMax=Math.round(h/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(e,v,w,p,m)}_buildAccelerationMap(e,t,r,n,s){e.reset();const o=new Map,a=this._verticalSubdivision,l=a?s-n:r-t;let u=Math.ceil(l/wWr);if(u<=1)return;const c=Math.floor(l/u);let h,p,m,v,w,S,I,R,L,k,B;for(u++,this._delta=c,a?(L=-RD-2*this._stepY,k=2*this._stepY,B=n):(L=-2*this._stepX,k=RD+2*this._stepX,B=t);e.nextPath();)if(!(e.pathSize<2)&&e.nextPoint())for(h=e.x,p=e.y;e.nextPoint();h=m,p=v){if(m=e.x,v=e.y,a){if(p===v||pk&&v>k)continue;w=Math.min(p,v),S=Math.max(p,v)}else{if(h===m||hk&&m>k)continue;w=Math.min(h,m),S=Math.max(h,m)}for(;wI&&omt(R,h,p,m,v,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);const t=this._currentY*this._stepY+this._offsetY;let r,n;if(this._currentX++,this._gridType===_re.Random){const s=(this._currentX%qE+qE)%qE,o=(this._currentY%qE+qE)%qE;r=this._graphicOriginX+e+this._stepX*this._randomness*(.5-_$._randValues[o*qE+s])*2/3,n=this._graphicOriginY+t+this._stepY*this._randomness*(.5-_$._randValues[o*qE+s+1])*2/3}else r=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,n=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t;if(!this._testInsidePolygon||this._isInsidePolygon(r,n,this._geometryCursor))return this._internalPlacement.setTranslate(r,n),this._internalPlacement}}_isInsidePolygon(e,t,r){if(this._accelerationMap==null)return SWr(e,t,r);e+=bbe,t+=bbe;const n=this._verticalSubdivision,s=n?t:e,o=Math.floor((s-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let l,u,c,h=0;for(const p of a){if(l=p[0],u=p[1],n){if(l[1]>t==u[1]>t)continue;c=(u[0]-l[0])*(t-l[1])-(u[1]-l[1])*(e-l[0])}else{if(l[0]>e==u[0]>e)continue;c=(u[1]-l[1])*(e-l[0])-(u[0]-l[0])*(t-l[1])}c>0?h++:h--}return h!==0}};function SWr(i,e,t){let r,n,s,o,a=0;for(i+=bbe,e+=bbe,t.reset();t.nextPath();)if(t.nextPoint())for(r=t.x,n=t.y;t.nextPoint();r=s,n=o)s=t.x,o=t.y,n>e!=o>e&&((s-r)*(e-n)-(o-n)*(i-r)>0?a++:a--);return a!==0}function omt(i,e,t,r,n,s){let o=s.get(i);o||(o=[],s.set(i,o)),o.push([[e,t],[r,n]])}const TWr=.001;let RGt=class Pee{static local(){return Pee.instance===null&&(Pee.instance=new Pee),Pee.instance}execute(e,t,r,n,s){return new CWr(e,t,r)}};RGt.instance=null;let CWr=class extends Sle{constructor(e,t,r){super(e),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*r:0,this._epsilon=TWr*r}processPath(e){const t=this._position;if(this._relativeTo===z6.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[n,s]=[e.x,e.y],[o,a]=[0,0];for(;e.nextPoint();){o=e.x,a=e.y;const l=this._curveHelper.getLength(n,s,o,a);if(ln){const p=(n-o)/h,[m,v]=this._curveHelper.getAngleCS(a,l,u,c,p),w=this._curveHelper.getCoord2D(a,l,u,c,p),S=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(w[0]-S*v,w[1]+S*m),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-m,-v):this.internalPlacement.setRotateCS(m,v)),this.internalPlacement}a=u,l=c,o+=h}}return null}};const EWr=1e-15;let DGt=class Ree{static local(){return Ree.instance===null&&(Ree.instance=new Ree),Ree.instance}execute(e,t,r,n,s){return new IWr(e,t,r)}};DGt.instance=null;let IWr=class extends Sle{constructor(e,t,r){super(e),this._curveHelper=new qR,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*r:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let r=t[0],n=t[1];if(this._offset!==0){const s=Math.cos(t[2]),o=Math.sin(t[2]);r-=this._offset*o,n+=this._offset*s}return this.internalPlacement.setTranslate(r,n),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let r=0,n=!1,s=0,o=0;if(e.seekPathStart(),e.nextPoint()){let a=e.x,l=e.y,u=e.getControlPoint(),c=!0,h=e.nextPoint();for(;h;){const p=e.x,m=e.y,v=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(s=this._curveHelper.getAngle(a,l,p,m,0)),c?(c=!1,t?(r=s,n=u):(this._endPoints||this._controlPoints&&u)&&this._tags.push([a,l,s])):u?this._controlPoints&&this._tags.push([a,l,Fde(o,s)]):this._regularVertices&&this._tags.push([a,l,Fde(o,s)]),(this._angleToLine||this._offset!==0)&&(o=this._curveHelper.getAngle(a,l,p,m,1)),h=e.nextPoint(),h||(t?v||n?this._controlPoints&&this._tags.push([p,m,Fde(o,r)]):this._regularVertices&&this._tags.push([p,m,Fde(o,r)]):(this._endPoints||this._controlPoints&&v)&&this._tags.push([p,m,o])),a=p,l=m,u=v}}this._tagIterator=0}};function Fde(i,e){const t=Math.PI;for(;Math.abs(e-i)>t+2*EWr;)e-i>t?e-=2*t:e+=2*t;return(i+e)/2}const AWr=100*222045e-21;function FGt(i){if(i.totalSize===0)return null;const e=f2e(i);if(!e)return null;const t=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*AWr;let r=0,n=0;i.reset();for(let K=0;i.nextPath();K++){const Q=i.getCurrentRingArea();Q>n&&(n=Q,r=K)}if(i.seekPath(r),i.pathSize===0)return null;i.seekPathStart();const s=wIt(i);if(Math.abs(n)<=2*t*t)return[(s[0]+s[2])/2,(s[1]+s[3])/2];i.seekPathStart();const o=IXi(i,Wo());if(o===null)return null;if(i.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],u=[NaN,NaN,NaN,NaN];let c=!1,h=lK(o,i,!0);h.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],h=lK(o,i,!1)),l[0]=h.distance,u[0]=0;const p=[NaN,NaN];let m=!1,v=.25,w=-1,S=NaN;do if(S=NaN,a[1]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[1][0])||isNaN(a[1][1])||(h=lK(a[1],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[1],i))m=!0,l[1]=S,u[1]=b$(a[1],o);else if(!isNaN(S)&&S>w&&(w=S,p[0]=a[1][0],p[1]=a[1][1]),v-=.01,v<.1){if(!(w>=0))break;m=!0,l[1]=w,a[1][0]=p[0],a[1][1]=p[1],u[1]=b$(a[1],o)}while(!m);m=!1,v=.5,w=-1;let I=.01,R=1;do if(S=NaN,a[2]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[2][0])||isNaN(a[2][1])||(h=lK(a[2],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[2],i))m=!0,l[2]=S,u[2]=b$(a[2],o);else if(!isNaN(S)&&S>w)w=S,p[0]=a[2][0],p[1]=a[2][1];else if(S>w&&(w=S,p[0]=a[2][0],p[1]=a[2][1]),v=.5+I*R,I+=.01,R*=-1,v<.3||v>.7){if(!(w>=0))break;m=!0,l[2]=w,a[2][0]=p[0],a[2][1]=p[1],u[2]=b$(a[2],o)}while(!m);m=!1,v=.75,w=-1;do if(S=NaN,a[3]=ePe(i,tPe(s[0],s[2],v),t,e),isNaN(a[3][0])||isNaN(a[3][1])||(h=lK(a[3],i,!1),S=h.distance),!isNaN(S)&&S>t&&Xge(a[3],i))m=!0,l[3]=S,u[3]=b$(a[3],o);else if(S>w&&(w=S,p[0]=a[3][0],p[1]=a[3][1]),v+=.01,v>.9){if(!(w>=0))break;m=!0,l[3]=w,a[3][0]=p[0],a[3][1]=p[1],u[3]=b$(a[3],o)}while(!m);const L=[0,1,2,3],k=c?0:1;let B;for(let K=k;K<4;K++)for(let Q=k;Q<3;Q++){const re=u[Q],ne=u[Q+1];PWr(re,ne)>0&&(B=L[Q],L[Q]=L[Q+1],L[Q+1]=B,u[Q]=ne,u[Q+1]=re)}let $=k,V=0,Y=0;for(let K=k;K<4;K++){switch(K){case 0:Y=2*l[L[K]];break;case 1:Y=1.66666666*l[L[K]];break;case 2:Y=1.33333333*l[L[K]];break;case 3:Y=l[L[K]]}Y>V&&(V=Y,$=L[K])}return a[$]}function Xge(i,e){let t,r,n,s,o=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(t=e.x,r=e.y;e.nextPoint();t=n,r=s)n=e.x,s=e.y,r>i[1]!=s>i[1]&&((n-t)*(i[1]-r)-(s-r)*(i[0]-t)>0?o++:o--);return o!==0}function lK(i,e,t){if(t&&Xge(i,e))return{coord:i,distance:0};let r=1/0,n=0,s=0,o=[0,0],a=[0,0];const l=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(o[0]=e.x,o[1]=e.y;e.nextPoint();o=a){a=[e.x,e.y],sIt(l,i,o,a);const u=b$(i,l);uo?wh)r&amt?(r&kde?(e[1]+=h*(s-e[0])/c,e[0]=s):(e[1]+=h*(a-e[0])/c,e[0]=a),r=YE(e,i)):n&amt?(n&kde?(t[1]+=h*(s-t[0])/c,t[0]=s):(t[1]+=h*(a-t[0])/c,t[0]=a),n=YE(t,i)):r?(r&Lde?(e[0]+=c*(o-e[1])/h,e[1]=o):(e[0]+=c*(l-e[1])/h,e[1]=l),r=YE(e,i)):(n&Lde?(t[0]+=c*(o-t[1])/h,t[1]=o):(t[0]+=c*(l-t[1])/h,t[1]=l),n=YE(t,i));else if(r&lmt?(r&Lde?(e[0]+=c*(o-e[1])/h,e[1]=o):(e[0]+=c*(l-e[1])/h,e[1]=l),r=YE(e,i)):n&lmt?(n&Lde?(t[0]+=c*(o-t[1])/h,t[1]=o):(t[0]+=c*(l-t[1])/h,t[1]=l),n=YE(t,i)):r?(r&kde?(e[1]+=h*(s-e[0])/c,e[0]=s):(e[1]+=h*(a-e[0])/c,e[0]=a),r=YE(e,i)):(n&kde?(t[1]+=h*(s-t[0])/c,t[0]=s):(t[1]+=h*(a-t[0])/c,t[0]=a),n=YE(t,i)),r&n)return 0}while(r|n);return u}function YE(i,e){return(i[0]e[2]?1:0)<<1|(i[1]e[3]?1:0)<<3}function tPe(i,e,t){return i+(e-i)*t}function b$(i,e){return(i[0]-e[0])*(i[0]-e[0])+(i[1]-e[1])*(i[1]-e[1])}function PWr(i,e){if(ie)return 1;if(i===e)return 0;const t=isNaN(i),r=isNaN(e);return tr?1:0}let kGt=class Dee{static local(){return Dee.instance===null&&(Dee.instance=new Dee),Dee.instance}execute(e,t,r,n,s){return new RWr(e,t,r)}};kGt.instance=null;let RWr=class{constructor(e,t,r){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*r:0,this._offsetY=t.offsetY!==void 0?t.offsetY*r:0,this._method=t.method!==void 0?t.method:rV.OnPolygon,this._internalPlacement=new sX}next(){const e=this._geometryCursor;return this._geometryCursor=null,e?this._polygonCenter(e):null}_polygonCenter(e){let t=!1;switch(this._method){case rV.CenterOfMass:{const r=RXi(e);r&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),t=!0)}break;case rV.BoundingBoxCenter:{const r=f2e(e);r&&(this._internalPlacement.setTranslate((r[2]+r[0])/2+this._offsetX,(r[3]+r[1])/2+this._offsetY),t=!0)}break;case rV.OnPolygon:default:{const r=FGt(e);r!==null&&(this._internalPlacement.setTranslate(r[0]+this._offsetX,r[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function W8e(i){if(!i)return null;switch(i.type){case"CIMGeometricEffectAddControlPoints":return fGt.local();case"CIMGeometricEffectArrow":return mGt.local();case"CIMGeometricEffectBuffer":return gGt.local();case"CIMGeometricEffectControlMeasureLine":return yGt.local();case"CIMGeometricEffectCut":return vGt.local();case"CIMGeometricEffectDashes":return _Gt.local();case"CIMGeometricEffectDonut":return bGt.local();case"CIMGeometricEffectJog":return wGt.local();case"CIMGeometricEffectMove":return xGt.local();case"CIMGeometricEffectOffset":return SGt.local();case"CIMGeometricEffectReverse":return TGt.local();case"CIMGeometricEffectRotate":return CGt.local();case"CIMGeometricEffectScale":return EGt.local();case"CIMGeometricEffectWave":return IGt.local()}return null}function LGt(i){if(!i)return null;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":return AGt.local();case"CIMMarkerPlacementAtExtremities":return MGt.local();case"CIMMarkerPlacementAtRatioPositions":return OGt.local();case"CIMMarkerPlacementInsidePolygon":return PGt.local();case"CIMMarkerPlacementOnLine":return RGt.local();case"CIMMarkerPlacementOnVertices":return DGt.local();case"CIMMarkerPlacementPolygonCenter":return kGt.local()}return null}const Nde=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],Sq=["آ","أ","إ","ا"],DWr=["ﻵ","ﻷ","ﻹ","ﻻ"],FWr=["ﻶ","ﻸ","ﻺ","ﻼ"],wbe=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],kWr=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],LWr=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],NWr=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],$Wr=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],umt=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],BWr=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],cmt=["ء","ف"],jWr=["غ","ي"],GWr=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],UWr=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],Vt=0,Dr=1,oo=2,Bp=3,bt=4,iA=5,Jge=6,Tt=7,Z0=8,r1=9,_T=10,jo=11,qi=12,zWr=13,VWr=14,HWr=15,WWr=16,qWr=17,Cs=18,YWr=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],XI=100,XWr=[XI+0,Vt,Vt,Vt,Vt,XI+1,XI+2,XI+3,Dr,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,XI+4,bt,bt,bt,Vt,bt,Vt,bt,Vt,bt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,bt,bt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,XI+5,Tt,Tt,XI+6,XI+7],JWr=[[Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Jge,iA,Jge,Z0,iA,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,iA,iA,iA,Jge,Z0,bt,bt,jo,jo,jo,bt,bt,bt,bt,bt,_T,r1,_T,r1,r1,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,r1,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,Cs,Cs,Cs,Cs,Cs,Cs,iA,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,Cs,r1,bt,jo,jo,jo,jo,bt,bt,bt,bt,Vt,bt,bt,Cs,bt,bt,jo,jo,oo,oo,bt,Vt,bt,bt,bt,oo,Vt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,Vt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Dr,qi,Dr,qi,qi,Dr,qi,qi,Dr,qi,bt,bt,bt,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt],[Bp,Bp,Bp,Bp,bt,bt,bt,bt,Tt,jo,jo,Tt,r1,Tt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Tt,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,Bp,jo,Bp,Bp,Tt,Tt,Tt,qi,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,Bp,bt,qi,qi,qi,qi,qi,qi,Tt,Tt,qi,qi,bt,qi,qi,qi,qi,Tt,Tt,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,Tt,Tt,Tt,Tt,Tt,Tt],[Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,Tt,Tt,qi,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,Tt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,qi,qi,qi,qi,qi,qi,qi,qi,qi,Dr,Dr,bt,bt,bt,bt,Dr,bt,bt,bt,bt,bt],[Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Z0,Cs,Cs,Cs,Vt,Dr,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Z0,iA,zWr,VWr,HWr,WWr,qWr,r1,jo,jo,jo,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,r1,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Z0,Cs,Cs,Cs,Cs,Cs,bt,bt,bt,bt,bt,Cs,Cs,Cs,Cs,Cs,Cs,oo,Vt,bt,bt,oo,oo,oo,oo,oo,oo,_T,_T,bt,bt,bt,Vt,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,_T,_T,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt],[Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,Dr,qi,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,_T,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,bt,Dr,Dr,Dr,Dr,Dr,bt,Dr,bt,Dr,Dr,bt,Dr,Dr,bt,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Dr,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt],[qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,qi,qi,qi,qi,qi,qi,qi,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,r1,bt,r1,bt,bt,r1,bt,bt,bt,bt,bt,bt,bt,bt,bt,jo,bt,bt,_T,_T,bt,bt,bt,bt,bt,jo,jo,bt,bt,bt,bt,bt,Tt,Tt,Tt,Tt,Tt,bt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,Tt,bt,bt,Cs],[bt,bt,bt,jo,jo,jo,bt,bt,bt,bt,bt,_T,r1,_T,r1,r1,oo,oo,oo,oo,oo,oo,oo,oo,oo,oo,r1,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,Vt,Vt,Vt,bt,bt,Vt,Vt,Vt,bt,bt,bt,jo,jo,bt,bt,bt,jo,jo,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt,bt]];let NGt=class{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(e,t,r){if(this.sourceToTarget=[],this.targetToSource=[],!e)return"";if(pqr(this.sourceToTarget,this.targetToSource,e.length),!this.checkParameters(t,r))return e;t=this.inputFormat,r=this.outputFormat;let n=e;const s=mqr,o=pmt(t.charAt(1)),a=pmt(r.charAt(1)),l=(t.charAt(0)==="I"?"L":t.charAt(0))+o,u=(r.charAt(0)==="I"?"L":r.charAt(0))+a,c=t.charAt(2)+r.charAt(2);s.defInFormat=l,s.defOutFormat=u,s.defSwap=c;const h=Fee(e,l,u,c,s);let p=!1;return r.charAt(1)==="R"?p=!0:r.charAt(1)!=="C"&&r.charAt(1)!=="D"||(p=this.checkContextual(h)==="rtl"),this.sourceToTarget=ux,this.targetToSource=fqr(this.sourceToTarget),Sbe=this.targetToSource,n=t.charAt(3)===r.charAt(3)?h:r.charAt(3)==="S"?ZWr(p,h):tqr(h,p,!0),this.sourceToTarget=ux,this.targetToSource=Sbe,this.levels=pCe,n}_inputFormatSetter(e){if(!fmt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=e}_outputFormatSetter(e){if(!fmt.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=e}checkParameters(e,t){return e?this._inputFormatSetter(e):e=this.inputFormat,t?this._outputFormatSetter(t):t=this.outputFormat,e!==t}checkContextual(e){let t=xbe(e);if(t!=="ltr"&&t!=="rtl"){try{t=document.dir.toLowerCase()}catch{}t!=="ltr"&&t!=="rtl"&&(t="ltr")}return t}hasBidiChar(e){return vqr.test(e)}};function Fee(i,e,t,r,n){const s=KWr(i,{inFormat:e,outFormat:t,swap:r},n);if(s.inFormat===s.outFormat)return i;e=s.inFormat,t=s.outFormat,r=s.swap;const o=e.substring(0,1),a=e.substring(1,4),l=t.substring(0,1),u=t.substring(1,4);if(n.inFormat=e,n.outFormat=t,n.swap=r,o==="L"&&t==="VLTR"){if(a==="LTR")return n.dir=Lj,DD(i,n);if(a==="RTL")return n.dir=kee,DD(i,n)}if(o==="V"&&l==="V")return n.dir=a==="RTL"?kee:Lj,iPe(i,n);if(o==="L"&&t==="VRTL")return a==="LTR"?(n.dir=Lj,i=DD(i,n)):(n.dir=kee,i=DD(i,n)),iPe(i);if(e==="VLTR"&&t==="LLTR")return n.dir=Lj,DD(i,n);if(o==="V"&&l==="L"&&a!==u)return i=iPe(i),a==="RTL"?Fee(i,"LLTR","VLTR",r,n):Fee(i,"LRTL","VRTL",r,n);if(e==="VRTL"&&t==="LRTL")return Fee(i,"LRTL","VRTL",r,n);if(o==="L"&&l==="L"){const c=n.swap;return n.swap=c.substr(0,1)+"N",a==="RTL"?(n.dir=kee,i=DD(i,n),n.swap="N"+c.substr(1,2),n.dir=Lj,i=DD(i,n)):(n.dir=Lj,i=DD(i,n),n.swap="N"+c.substr(1,2),i=Fee(i,"VLTR","LRTL",n.swap,n)),i}return i}function KWr(i,e,t){if(e.inFormat===void 0&&(e.inFormat=t.defInFormat),e.outFormat===void 0&&(e.outFormat=t.defOutFormat),e.swap===void 0&&(e.swap=t.defSwap),e.inFormat===e.outFormat)return e;const r=e.inFormat.substring(0,1),n=e.outFormat.substring(0,1);let s,o=e.inFormat.substring(1,4),a=e.outFormat.substring(1,4);return o.charAt(0)==="C"&&(s=xbe(i),o=s==="ltr"||s==="rtl"?s.toUpperCase():e.inFormat.charAt(2)==="L"?"LTR":"RTL",e.inFormat=r+o),a.charAt(0)==="C"&&(s=xbe(i),s==="rtl"?a="RTL":s==="ltr"?(s=eqr(i),a=s.toUpperCase()):a=e.outFormat.charAt(2)==="L"?"LTR":"RTL",e.outFormat=n+a),e}function ZWr(i,e,t){if(e.length===0)return"";i===void 0&&(i=!0);const r=(e=String(e)).split("");let n=0,s=1,o=r.length;i||(n=r.length-1,s=-1,o=1);const a=QWr(r,n,s,o);let l="";for(let u=0;u-1?(jGt(Sbe,u,!i,-1),ux.splice(u,1)):l+=r[u];return l}function QWr(i,e,t,r,n){let s=0;const o=[];let a=0;for(let l=e;l*t="ﹰ"&&n[s]<"\uFEFF"){const a=i.charCodeAt(s);n[s]>="ﻵ"&&n[s]<="ﻼ"?(e?(s>0&&t&&n[s-1]===" "?r=r.substring(0,r.length-1)+"ل":(r+="ل",o=!0),r+=Sq[(a-65269)/2]):(r+=Sq[(a-65269)/2],r+="ل",s+10)if(p===16){for(let v=o;v-1){for(let v=o;v=0&&i[s]===Z0;s--)e[s]=r.dir}}function rqr(i,e,t){if(t.hiLevel!==0&&t.swap.substr(0,1)!==t.swap.substr(1,2))for(let r=0;r>8];return t=cmt[e]&&i<=jWr[e])return!0;return!1}function hmt(i,e,t,r){for(;e*t=i){for(s=c+1;s=i;)s++;for(o=c,a=s-1;o(n.lastArabic=!1,Vt),UBAT_R:()=>(n.lastArabic=!1,Dr),UBAT_ON:()=>bt,UBAT_AN:()=>Bp,UBAT_EN:()=>n.lastArabic?Bp:oo,UBAT_AL:()=>(n.lastArabic=!0,n.hasUbatAl=!0,Dr),UBAT_WS:()=>bt,UBAT_CS:()=>{let o,a;return r<1||r+1>=e.length||(o=t[r-1])!==oo&&o!==Bp||(a=e[r+1])!==oo&&a!==Bp?bt:(n.lastArabic&&(a=Bp),a===o?a:bt)},UBAT_ES:()=>(r>0?t[r-1]:iA)===oo&&r+1{if(r>0&&t[r-1]===oo)return oo;if(n.lastArabic)return bt;let o=r+1;const a=e.length;for(;o{if(n.inFormat==="VLTR"){const o=e.length;let a=r+1;for(;a=1425&&l<=2303||l===64286,c=e[a];if(u&&(c===Dr||c===Tt))return Dr}}return r<1||e[r-1]===iA?bt:t[r-1]},UBAT_B:()=>(n.lastArabic=!0,n.hasUbatB=!0,n.dir),UBAT_S:()=>(n.hasUbatS=!0,bt),UBAT_LRE:()=>(n.lastArabic=!1,bt),UBAT_RLE:()=>(n.lastArabic=!1,bt),UBAT_LRO:()=>(n.lastArabic=!1,bt),UBAT_RLO:()=>(n.lastArabic=!1,bt),UBAT_PDF:()=>(n.lastArabic=!1,bt),UBAT_BN:()=>bt}[YWr[s]]()}function lqr(i){let e,t=0,r=Nde.length-1;for(;t<=r;)if(e=Math.floor((t+r)/2),iNde[e][0]))return Nde[e][1];t=e+1}return i}function uqr(i){for(let e=0;e="ً"&&i<="ٕ"}function pmt(i){return i==="L"?"LTR":i==="R"?"RTL":i==="C"?"CLR":i==="D"?"CRL":""}function hqr(i,e,t,r){for(;e*te||!t&&i[n]===e)&&(i[n]+=r)}let ux=[],Sbe=[],pCe=[];const mqr={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},gqr=5,yqr=6,Lj=0,kee=1,fmt=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,vqr=/[\u0591-\u06ff\ufb1d-\ufefc]/,nPe=new NGt;function GGt(i){if(i==null)return["",!1];if(!nPe.hasBidiChar(i))return[i,!1];let e;return e=nPe.checkContextual(i)==="rtl"?"IDNNN":"ICNNN",[nPe.bidiTransform(i,e,"VLYSN"),!0]}const UGt="arial-unicode-ms",mmt="woff2",gmt=new Map,_qr=new Set;let bqr=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function wqr(i){const e=VGt(i),t=gmt.get(e);if(t)return t.promise;const r=new FontFace(i.family,`url('${Ho.fontsUrl}/woff2/${e}.${mmt}') format('${mmt}')`,{style:i.style,weight:i.weight}),n=document.fonts;if(n.has(r)&&r.status==="loading")return r.loaded;const s=r.load().then(()=>(n.add(r),r));return gmt.set(e,new bqr(r,s)),_qr.add(r),s}function zGt(i){if(!i)return UGt;const e=i.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}function VGt(i){const e=xqr(i)+Sqr(i);return zGt(i.family)+(e.length>0?e:"-regular")}function xqr(i){if(!i.weight)return"";switch(i.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Sqr(i){if(!i.style)return"";switch(i.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let Tqr=class{applyColorSubstituition(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:r,height:n}=e,s=this._rasterizationCanvas,o=s.getContext("2d",{willReadFrequently:!0});e!==s&&(s.width=r,s.height=n,o.drawImage(e,0,0,r,n));const a=o.getImageData(0,0,r,n).data;if(t){for(const u of t)if(u&&u.oldColor&&u.oldColor.length===4&&u.newColor&&u.newColor.length===4){const[c,h,p,m]=u.oldColor,[v,w,S,I]=u.newColor;if(c===v&&h===w&&p===S&&m===I)continue;for(let R=0;R0;let L=this._lineThroughWidthOffset,k=0;if(a){n.save();const re=t.backgroundColor??[0,0,0,0],ne=t.borderLine?.color??[0,0,0,0],de=2*us(t.borderLine?.size??0);n.fillStyle=oPe(re),n.strokeStyle=oPe(ne),n.lineWidth=de,n.fillRect(0,0,r.width,r.height),n.strokeRect(0,0,r.width,r.height),n.restore()}R&&this._renderHalo(n,S,I,L,k,t),k+=I,L+=S;for(const re of this._textLines)R?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(re,L,k),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(re,L,k)):(n.fillStyle=this._fillStyle,n.fillText(re,L,k)),s&&s!=="none"&&this._renderDecoration(n,L,k,s,o),k+=m;n.restore();const B=this._renderedWidth+2*this._lineThroughWidthOffset,$=this._renderedHeight,V=n.getImageData(0,0,B,$),Y=new Uint8Array(V.data);if(t.premultiplyColors){let re;for(let ne=0;ne600)&&(r+=.3*e.measureText("w").width),r+=2*us(this._parameters.halo.size),Math.round(r)}_computeLineHeight(){let e=1.275*this._parameters.size;const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*us(this._parameters.halo.size))}_renderDecoration(e,t,r,n,s,o){const a=.9*this._lineHeight,l=s==="bold"?.06:s==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const u=e.textBaseline;if(n==="underline")switch(u){case"top":r+=a;break;case"middle":r+=a/2}else if(n==="line-through")switch(u){case"top":r+=a/1.5;break;case"middle":r+=a/3}const c=o?1.5*o:Math.ceil(a*l);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=c,e.moveTo(t-this._lineThroughWidthOffset,r),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,r),e.stroke(),e.restore()}};function Eqr(i,e){return i==="center"?.5*e:i==="right"?e:0}const Iqr=()=>di.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var pA,sS;function qGt(i){if(!i)return pA.Center;switch(i){case"Left":case"left":return pA.Left;case"Right":case"right":return pA.Right;case"Justify":return Iqr().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),pA.Center;case"Center":case"center":return pA.Center}}function YGt(i){if(!i)return sS.Center;switch(i){case"Top":case"top":return sS.Top;case"Center":case"middle":return sS.Center;case"Baseline":case"baseline":return sS.Baseline;case"Bottom":case"bottom":return sS.Bottom}}function Aqr(i){switch(i){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${i}`),["center","middle"]}}function Mqr(i){switch(i){case pA.Right:case"right":return-1;case pA.Center:case"center":return 0;case pA.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${i}`),0}}function Oqr(i){switch(i){case sS.Top:case"top":return 1;case sS.Center:case"middle":return 0;case sS.Bottom:case sS.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${i}`),0}}(function(i){i[i.Left=-1]="Left",i[i.Center=0]="Center",i[i.Right=1]="Right"})(pA||(pA={})),function(i){i[i.Top=1]="Top",i[i.Center=0]="Center",i[i.Bottom=-1]="Bottom",i[i.Baseline=2]="Baseline"}(sS||(sS={}));let _d=class{constructor(e=0,t=0,r=0,n=0){this.x=e,this.y=t,this.width=r,this.height=n}get isEmpty(){return this.width<=0||this.height<=0}union(e){this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.width=Math.max(this.width,e.width),this.height=Math.max(this.height,e.height)}},T8=class q8e{constructor(e,t,r,n){this.computedX=0,this.computedY=0,this.center=Xp(e,t),this.centerT=NW(),this.halfWidth=r/2,this.halfHeight=n/2,this.width=r,this.height=n}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(e){this.center[0]=e}set y(e){this.center[1]=e}clone(){return new q8e(this.x,this.y,this.width,this.height)}serialize(e){return e.writeF32(this.center[0]),e.writeF32(this.center[1]),e.push(this.width),e.push(this.height),e}findCollisionDelta(e,t=4){const r=Math.abs(e.centerT[0]-this.centerT[0]),n=Math.abs(e.centerT[1]-this.centerT[1]),s=(e.halfWidth+this.halfWidth+t)/r,o=(e.halfHeight+this.halfHeight+t)/n,a=Math.min(s,o);return Math.log2(a)}extend(e){const t=Math.min(this.xmin,e.xmin),r=Math.min(this.ymin,e.ymin),n=Math.max(this.xmax,e.xmax)-t,s=Math.max(this.ymax,e.ymax)-r,o=t+n/2,a=r+s/2;this.width=n,this.height=s,this.halfWidth=n/2,this.halfHeight=s/2,this.x=o,this.y=a}static deserialize(e){const t=e.readF32(),r=e.readF32(),n=e.readInt32(),s=e.readInt32();return new q8e(t,r,n,s)}};const wJe=22,XGt=4,Pqr=wJe+XGt,Rqr=wJe-6,ymt=3,Dqr=Math.PI/180,FD=8,Fqr=1.5;let JGt=class{constructor(e,t,r,n){this._rotationT=SS(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const s=r.rect,o=new Float32Array(8);e*=n,t*=n;const a=r.code?s.width*n:r.metrics.width,l=r.code?s.height*n:r.metrics.height;this.width=a,this.height=l,o[0]=e,o[1]=t,o[2]=e+a,o[3]=t,o[4]=e,o[5]=t+l,o[6]=e+a,o[7]=t+l,this._data=o,this._setTextureCoords(s),this._scale=n,this._mosaic=r,this.x=e,this.y=t,this.maxOffset=Math.max(e+a,t+l)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,Nae(this._rotationT,-e),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,r=t*this._scale,n=Math.abs(e)*this._scale,s=new Float32Array(8);s[0]=this.x,s[1]=this.y,s[2]=this.x+r,s[3]=this.y,s[4]=this.x,s[5]=this.y+n,s[6]=this.x+r,s[7]=this.y+n;const o=FW(SS(),this._rotationT,this._transform);d5t(s,s,o);let a=1/0,l=1/0,u=0,c=0;for(let w=0;w<4;w++){const S=s[2*w],I=s[2*w+1];a=Math.min(a,S),l=Math.min(l,I),u=Math.max(u,S),c=Math.max(c,I)}const h=u-a,p=c-l,m=a+h/2,v=l+p/2;this._bounds=new T8(m,v,h,p)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=FW(SS(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],yf(this._offsets.topLeft,this._offsets.topLeft,e),yf(this._offsets.topRight,this._offsets.topRight,e),yf(this._offsets.bottomLeft,this._offsets.bottomLeft,e),yf(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:r,height:n}){this._texcoords={topLeft:[e,t],topRight:[e+r,t],bottomLeft:[e,t+n],bottomRight:[e+r,t+n]}}};const kqr=(i,e)=>({code:0,page:0,sdf:!0,rect:new _d(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:i,left:0,top:0}});function uK(i,e){return i.forEach(t=>yf(t,t,e)),{topLeft:i[0],topRight:i[1],bottomLeft:i[2],bottomRight:i[3]}}let Lqr=class{constructor(e,t,r){this._rotation=0,this._decorate(e,t,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=r.angle!==0,this._transform=this._createGlyphTransform(this.bounds,r),this._borderLineSizePx=r.borderLineSizePx,(r.borderLineSizePx||r.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of e)n.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,r=Nae(SS(),e);FW(t,r,t);for(const n of this.glyphs)n.setTransform(this._transform)}_decorate(e,t,r){if(!r.decoration||r.decoration==="none"||!e.length)return;const n=r.scale,s=r.decoration==="underline"?Pqr:Rqr,o=e[0].textureBinding;for(const a of t){const l=a.startX*n,u=a.startY*n,c=(a.width+a.glyphWidthEnd)*n;e.push(new JGt(l,u+s*n,kqr(c,o),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,r=(Fqr+t)/2,n=this._borderLineSizePx?r:0,{xmin:s,ymin:o,xmax:a,ymax:l,x:u,y:c,width:h,height:p}=this.bounds,m=[s-FD,o-FD],v=[a+FD,o-FD],w=[s-FD,l+FD],S=[a+FD,l+FD],I=uK([[m[0]-r,m[1]-r],[v[0]+r,v[1]-r],[m[0]+n,m[1]+n],[v[0]-n,v[1]+n]],e),R=uK([[w[0]+n,w[1]-n],[S[0]-n,S[1]-n],[w[0]-r,w[1]+r],[S[0]+r,S[1]+r]],e),L=uK([[m[0]-r,m[1]-r],[m[0]+n,m[1]+n],[w[0]-r,w[1]+r],[w[0]+n,w[1]-n]],e),k=uK([[v[0]-n,v[1]+n],[v[0]+r,v[1]-r],[S[0]-n,S[1]-n],[S[0]+r,S[1]+r]],e),B={main:uK([m,v,w,S],e),top:I,bot:R,left:L,right:k};return[new T8(u,c,h+2*r,p+2*r),B]}get boundsT(){const e=this.bounds,t=dl(NW(),e.x,e.y);if(yf(t,t,this._transform),this._hasRotation){const r=Math.max(e.width,e.height);return new T8(t[0],t[1],r,r)}return new T8(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,r=1/0,n=0,s=0;for(const l of e)t=Math.min(t,l.xTopLeft),r=Math.min(r,l.yTopLeft),n=Math.max(n,l.xBottomRight),s=Math.max(s,l.yBottomRight);const o=n-t,a=s-r;return new T8(t+o/2,r+a/2,o,a)}_createGlyphTransform(e,t){const r=Dqr*t.angle,n=SS(),s=NW();return VA(n,n,dl(s,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?sk(n,n,r):(VA(n,n,dl(s,e.x,e.y)),sk(n,n,r),VA(n,n,dl(s,-e.x,-e.y))),n}},$de=class{constructor(e,t,r,n,s,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,r)),this.end=Math.max(0,Math.max(t,r)),this.endi===10,vmt=i=>i===32;function Nqr(i,e,t){const r=new Array,n=1/t.scale,s=t.maxLineWidth*n,o=e?i.length-1:0,a=e?-1:i.length,l=e?-1:1;let u=o,c=0,h=0,p=u,m=p,v=0,w=1/0,S=0;for(;u!==a;){const{code:R,metrics:L}=i[u],k=Math.abs(L.top);if(Y8e(R)||vmt(R)||(w=Math.min(w,k),S=Math.max(S,k+L.height)),Y8e(R))u!==o&&(r.push(new $de(i,p,u-l,c,w,S)),w=1/0,S=0),c=0,p=u+l,m=u+l,h=0;else if(vmt(R))m=u+l,h=0,v=L.advance,c+=L.advance;else if(c>s){if(m!==p){const B=m-2*l;c-=v,r.push(new $de(i,p,B,c-h,w,S)),w=1/0,S=0,p=m,c=h}else r.push(new $de(i,p,u-l,c,w,S)),w=1/0,S=0,p=u,m=u,c=0;c+=L.advance,h+=L.advance}else c+=L.advance,h+=L.advance;u+=l}const I=new $de(i,p,u-l,c,w,S);return I.start>=0&&I.enddi.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let w$=class MI{constructor(e){this._t=e}static createIdentity(){return new MI([1,0,0,0,1,0])}clone(){const e=this._t;return new MI(e.slice())}transform(e){const t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]}static createScale(e,t){return new MI([e,0,0,0,t,0])}scale(e,t){const r=this._t;return r[0]*=e,r[1]*=e,r[2]*=e,r[3]*=t,r[4]*=t,r[5]*=t,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(e,t){return new MI([0,0,e,0,0,t])}translate(e,t){const r=this._t;return r[2]+=e,r[5]+=t,this}static createRotate(e){const t=Math.cos(e),r=Math.sin(e);return new MI([t,-r,0,r,t,0])}rotate(e){return MI.multiply(this,MI.createRotate(e),this)}angle(){const e=this._t[0],t=this._t[3],r=Math.sqrt(e*e+t*t);return[e/r,t/r]}static multiply(e,t,r){const n=e._t,s=t._t,o=n[0]*s[0]+n[3]*s[1],a=n[1]*s[0]+n[4]*s[1],l=n[2]*s[0]+n[5]*s[1]+s[2],u=n[0]*s[3]+n[3]*s[4],c=n[1]*s[3]+n[4]*s[4],h=n[2]*s[3]+n[5]*s[4]+s[5],p=r._t;return p[0]=o,p[1]=a,p[2]=l,p[3]=u,p[4]=c,p[5]=h,r}invert(){const e=this._t;let t=e[0]*e[4]-e[1]*e[3];if(t===0)return new MI([0,0,0,0,0,0]);t=1/t;const r=(e[1]*e[5]-e[2]*e[4])*t,n=(e[2]*e[3]-e[0]*e[5])*t,s=e[4]*t,o=-e[1]*t,a=-e[3]*t,l=e[0]*t;return new MI([s,o,r,a,l,n])}},SJe=class{constructor(e,t){this._resourceManager=e,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new G3(sX,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(t||w$.createIdentity()),this._sizeTransfos.push(t?t.scaleRatio():1)}setTransform(e,t){this._transfos=[e||w$.createIdentity()],this._sizeTransfos=[t||(e?e.scaleRatio():1)]}setGeomUnitsPerPoint(e){this._geomUnitsPerPoint=e}transformPt(e){return this._transfos[this._transfos.length-1].transform(e)}transformSize(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(e){return this._transfos[this._transfos.length-1].invert().transform(e)}reverseTransformSize(e){return e/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(e){return e/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(e,t){const r=t?e.scaleRatio():1;w$.multiply(e,this.back(),e),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(e,t,r){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,t);break;case"CIMTextSymbol":this.drawTextSymbol(e,t,r)}}drawMultiLayerSymbol(e,t){if(!e||!t)return;const r=e.symbolLayers;if(!r)return;const n=e.effects;if(n&&n.length>0){const s=this.executeEffects(n,t);if(s){let o=s.next();for(;o;)this.drawSymbolLayers(r,o.asJSON()),o=s.next()}}else this.drawSymbolLayers(r,t)}executeEffects(e,t){const r=this._resourceManager.geometryEngine;let n=new $8e(Ec.fromJSONCIM(t));for(const s of e){const o=W8e(s);o&&(n=o.execute(n,s,this.geomUnitsPerPoint(),null,r))}return n}drawSymbolLayers(e,t){let r=e.length;for(;r--;){const n=e[r];if(!n||n.enable===!1)continue;const s=n.effects;if(s&&s.length>0){const o=this.executeEffects(s,t);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,t);if(this._earlyReturn)return}}drawSymbolLayer(e,t){switch(e.type){case"CIMSolidFill":this.drawSolidFill(t,e.color);break;case"CIMHatchFill":this.drawHatchFill(t,e);break;case"CIMPictureFill":this.drawPictureFill(t,e);break;case"CIMGradientFill":this.drawGradientFill(t,e);break;case"CIMSolidStroke":this.drawSolidStroke(t,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(t,e);break;case"CIMGradientStroke":this.drawGradientStroke(t,e);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(e,t)}}drawHatchFill(e,t){const r=this._buildHatchPolyline(t,e,this.geomUnitsPerPoint());r&&(this.pushClipPath(e),this.drawMultiLayerSymbol(t.lineSymbol,r),this.popClipPath())}drawPictureFill(e,t){}drawGradientFill(e,t){}drawPictureStroke(e,t){}drawGradientStroke(e,t){}drawMarkerLayer(e,t){const r=e.markerPlacement;if(r){const n=LGt(r);if(n){const s=r.type==="CIMMarkerPlacementInsidePolygon"||r.type==="CIMMarkerPlacementPolygonCenter"&&r.clipAtBoundary;s&&this.pushClipPath(t);const o=n.execute(Ec.fromJSONCIM(t),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(e,a),!this._earlyReturn););}s&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(dR(t))n.tx=t.x,n.ty=t.y,this.drawMarker(e,n);else if(ed(t)){const s=p2e(t);s&&([n.tx,n.ty]=s,this.drawMarker(e,n))}else for(const s of t.points)if(n.tx=s[0],n.ty=s[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,t){switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(e,t);break;case"CIMVectorMarker":this.drawVectorMarker(e,t)}}drawPictureMarker(e,t){if(!e)return;const r=this._resourceManager.getResource(e.url),n=rs(e.size,ph.CIMPictureMarker.size);if(r==null||n<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const a=s/o,l=rs(e.scaleX,1),u=w$.createIdentity(),c=e.anchorPoint;if(c){let S=c.x,I=c.y;e.anchorPointUnits!=="Absolute"&&(S*=n*a*l,I*=n),u.translate(-S,-I)}let h=rs(e.rotation);e.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&u.rotate(h*iN);let p=rs(e.offsetX),m=rs(e.offsetY);if(p||m){if(this._mapRotation){const S=iN*this._mapRotation,I=Math.cos(S),R=Math.sin(S),L=p*R+m*I;p=p*I-m*R,m=L}u.translate(p,m)}const v=this.geomUnitsPerPoint();v!==1&&u.scale(v,v);const w=t.getAngle();w&&u.rotate(w),u.translate(t.tx,t.ty),this.push(u,!1),this.drawImage(e,n),this.pop()}drawVectorMarker(e,t){if(!e)return;const r=e.markerGraphics;if(!r)return;const n=rs(e.size,ph.CIMVectorMarker.size),s=e.frame,o=s?s.ymax-s.ymin:0,a=n&&o?n/o:1,l=w$.createIdentity();s&&l.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const u=e.anchorPoint;if(u){let w=u.x,S=u.y;e.anchorPointUnits!=="Absolute"?s&&(w*=s.xmax-s.xmin,S*=s.ymax-s.ymin):(w/=a,S/=a),l.translate(-w,-S)}a!==1&&l.scale(a,a);let c=rs(e.rotation);e.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*iN);let h=rs(e.offsetX),p=rs(e.offsetY);if(h||p){if(this._mapRotation){const w=iN*this._mapRotation,S=Math.cos(w),I=Math.sin(w),R=h*I+p*S;h=h*S-p*I,p=R}l.translate(h,p)}const m=this.geomUnitsPerPoint();m!==1&&l.scale(m,m);const v=t.getAngle();v&&l.rotate(v),l.translate(t.tx,t.ty),this.push(l,e.scaleSymbolsProportionally);for(const w of r){w?.symbol&&w.geometry||Bqr().error("Invalid marker graphic",w);let S=w.textString;if(typeof S=="number"&&(S=S.toString()),this.drawSymbol(w.symbol,w.geometry,S),this._earlyReturn)break}this.pop()}drawTextSymbol(e,t,r){if(!e||!dR(t)||rs(e.height,ph.CIMTextSymbol.height)<=0)return;const n=w$.createIdentity();let s=rs(e.angle);s=-s,s&&n.rotate(s*iN);const o=rs(e.offsetX),a=rs(e.offsetY);(o||a)&&n.translate(o,a);const l=this.geomUnitsPerPoint();l!==1&&n.scale(l,l),n.translate(t.x,t.y),this.push(n,!1),this.drawText(e,r),this.pop()}_buildHatchPolyline(e,t,r){let n=rs(e.separation,ph.CIMHatchFill.separation)*r,s=rs(e.rotation);if(n===0)return null;n<0&&(n=-n);let o=0;const a=.5*n;for(;o>a;)o-=n;for(;o<-a;)o+=n;const l=Wo();gY(l,t),l[0]-=a,l[1]-=a,l[2]+=a,l[3]+=a;const u=[[l[0],l[1]],[l[0],l[3]],[l[2],l[3]],[l[2],l[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const c=Math.cos(s*iN),h=Math.sin(s*iN),p=-n*h,m=n*c;let v,w,S,I;o=rs(e.offsetX)*r*h-rs(e.offsetY)*r*c,v=S=Number.MAX_VALUE,w=I=-Number.MAX_VALUE;for(const Y of u){const K=Y[0],Q=Y[1],re=c*K+h*Q,ne=-h*K+c*Q;v=Math.min(v,re),S=Math.min(S,ne),w=Math.max(w,re),I=Math.max(I,ne)}S=Math.floor(S/n)*n;let R=c*v-h*S-p*o/n,L=h*v+c*S-m*o/n,k=c*w-h*S-p*o/n,B=h*w+c*S-m*o/n;const $=1+Math.round((I-S)/n),V=[];for(let Y=0;Y<$;Y++)R+=p,L+=m,k+=p,B+=m,V.push([[R,L],[k,B]]);return{paths:V}}},jqr=class extends SJe{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new bJe(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return cW(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(ed(e))this._processPath(e.rings,0);else if(e0(e))this._processPath(e.paths,0);else if(zd(e)){const t=V6(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,r){if(!e||this._clipCount>0||r==null||r<=0)return;const n=Math.max(.5*this.transformSize(rs(r,ph.CIMSolidStroke.width)),.5*KGt);if(ed(e))this._processPath(e.rings,n);else if(e0(e))this._processPath(e.paths,n);else if(zd(e)){const s=V6(e);s&&this._processPath(s.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){ed(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:r}=e,n=rs(e.scaleX,1);let s=n*t,o=t;const a=this._resourceManager.getResource(r);if(a!=null){const l=a.height/a.width;s=n*(t?l>1?t:t/l:a.width),o=t?l>1?t*l:t:a.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new WGt);const r=QGt(e);let[n,s]=this._textRasterizer.computeTextSize(t,r);n=uy(n),s=uy(s);let o=0;switch(e.horizontalAlignment){case"Left":o=n/2;break;case"Right":o=-n/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=s/2;break;case"Top":a=-s/2;break;case"Baseline":a=s/6}this._merge(this.transformPt([-n/2+o,-s/2+a]),0),this._merge(this.transformPt([-n/2+o,s/2+a]),0),this._merge(this.transformPt([n/2+o,-s/2+a]),0),this._merge(this.transformPt([n/2+o,s/2+a]),0)}_processPath(e,t){if(e)for(const r of e){const n=r?r.length:0;if(n>1){this._merge(this.transformPt(r[0]),t);for(let s=1;sthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Gqr=class extends SJe{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(e,t,r,n,s,o){const a=o*us(1);this.setTransform(),this.setGeomUnitsPerPoint(a),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/a,this._textInfo=n;const l=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=l?s:0,!yi("esri-mobile")){const u=uy(yi("hittest-2d-small-symbol-tolerance")*window.devicePixelRatio),c=uy(yi("hittest-2d-small-symbol-tolerance-threshold"));!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(Qtr))&&t?.type!=="CIMMeshSymbol"&&(PMt(t)??0)v.xTopLeft&&p-v.yBottomRight&&m<-v.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(zd(e)){const n=e;t=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(ed(e))t=e.rings;else{if(!e0(e))return;t=e.paths}const r=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(r,t)&&(this._earlyReturn=!0),!this._earlyReturn){const n=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(r,t,n)&&(this._earlyReturn=!0)}}_hitTestStroke(e,t){let r=null;if(zd(e)){const a=e;r=[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]}else if(ed(e))r=e.rings;else{if(!e0(e))return;r=e.paths}const n=this.reverseTransformPt(this._searchPoint),s=rs(t,ph.CIMSolidStroke.width)*this.geomUnitsPerPoint(),o=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(n,r,s/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(e,t){let r=0;for(const n of t){const s=n.length;for(let o=1;oe[1]!=l[1]>e[1]&&((l[0]-a[0])*(e[1]-a[1])-(l[1]-a[1])*(e[0]-a[0])>0?r++:r--)}}return r!==0}_nearLine(e,t,r){for(const n of t){const s=n.length;for(let o=1;o-r&&h1){let o=this.transformPt(n[0]);r.moveTo(o[0],o[1]);for(let a=1;ai?{spatialReference:i.spatialReference,rings:[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}:null,ZGt=(i,e,t)=>{switch(i){case"ExtraLeading":return 1+e/t;case"Multiple":return e;case"Exact":return e/t}};function QGt(i,e=1){const t=yVe(i),r=gVe(i.fontStyleName),n=i.fontFamilyName??UGt,{weight:s,style:o}=r,a=e*(i.height||5),l=EMt(i.horizontalAlignment),u=IMt(i.verticalAlignment),c=gP(i),h=gP(i.haloSymbol),p=h!=null?e*(i.haloSize??0):0,m=i.callout?.type==="CIMBackgroundCallout"?i.callout.backgroundSymbol:null,v=gP(m),w=kne(m),S=BV(m);return{color:c,size:a,horizontalAlignment:l,verticalAlignment:u,font:{family:n,style:iir(o),weight:rir(s),decoration:t},halo:{size:p||0,color:h,style:o},backgroundColor:v,borderLine:w!=null&&S!=null?{size:w,color:S}:null,pixelRatio:1,premultiplyColors:!0}}const Vqr=1e-4;function Hqr(i){let e,t,r,n,s,o=i[0],a=1;for(;a=0?i:i+e}function eUt(i){return Tbe(i*Wqr,256)}function Xqr(i){return Tbe(i*qqr,256)}function kD(i){return Math.log(i)*Yqr}function tg(i,e,t){return i*(1-t)+e*t}const Jqr=8,Kqr=14,Zqr=16;function tUt(i){return Jqr+Math.max((i-Kqr)*Zqr,0)}function Qqr(i,e,t){let r,n,s,o=0;for(const a of t){r=a.length;for(let l=1;le!=s.y>e&&((s.x-n.x)*(e-n.y)-(s.y-n.y)*(i-n.x)>0?o++:o--)}return o!==0}function iUt(i,e,t,r){let n,s,o,a;const l=r*r;for(const u of t){const c=u.length;if(!(c<2)){n=u[0].x,s=u[0].y;for(let h=1;hdi.getLogger("esri.symbols.cim.CIMSymbolHelper");function rYr(i){let e;switch(i.type){case"cim":return i.data;case"web-style":return i;case"simple-marker":{const t=ym.fromSimpleMarker(i);if(!t)throw new Error("InternalError: Cannot convert symbol to CIM");e=t;break}case"picture-marker":e=ym.fromPictureMarker(i);break;case"simple-line":e=ym.fromSimpleLineSymbol(i);break;case"simple-fill":e=ym.fromSimpleFillSymbol(i);break;case"picture-fill":e=ym.fromPictureFillSymbol(i);break;case"text":e=ym.fromTextSymbol(i)}return{type:"CIMSymbolReference",symbol:e}}function Kge(i,e,t){switch(e.type){case"CIMSymbolReference":return Kge(i,e.symbol,t);case"CIMPointSymbol":t==null&&(t={x:0,y:0}),i.drawSymbol(e,t);break;case"CIMLineSymbol":t==null&&(t={paths:[[[0,0],[10,0]]]}),i.drawSymbol(e,t);break;case"CIMPolygonSymbol":t==null&&(t={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),i.drawSymbol(e,t);break;case"CIMTextSymbol":{const r={x:0,y:0};i.drawSymbol(e,r);break}case"CIMVectorMarker":{const r=new sX;i.drawMarker(e,r);break}}return i.envelope()}function nYr(i){if(!i)return 0;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(i.offset);default:return 0}}function sYr(i){if(!i)return 0;switch(i.type){case"CIMGeometricEffectArrow":return Math.abs(.5*i.width);case"CIMGeometricEffectBuffer":return Math.abs(i.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(i.length);case"CIMGeometricEffectJog":return Math.abs(.5*i.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(rs(i.offsetX)),Math.abs(rs(i.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(i.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(i.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(i.fromWidth),Math.abs(i.toWidth));case"CIMGeometricEffectWave":return Math.abs(i.amplitude);case"CIMGeometricEffectDonut":return Math.abs(i.width)}}function Ebe(i){if(!i)return 0;let e=0;for(const t of i)e+=sYr(t);return e}let xmt=class{static getSymbolInflateSize(e,t,r,n,s){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,n,s):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,n){let s=!0;const o=Wo();if(t?.markerGraphics)for(const a of t.markerGraphics){const l=[0,0,0,0];a.geometry&&(gY(o,a.geometry),l[0]=0,l[1]=0,l[2]=0,l[3]=0,this.getSymbolInflateSize(l,a.symbol,r,0,n),o[0]+=l[0],o[1]+=l[1],o[2]+=l[2],o[3]+=l[3],s?(e[0]=o[0],e[1]=o[1],e[2]=o[2],e[3]=o[3],s=!1):(e[0]=Math.min(e[0],o[0]),e[1]=Math.min(e[1],o[1]),e[2]=Math.max(e[2],o[2]),e[3]=Math.max(e[3],o[3])))}return e}static _getInflateSize(e,t,r,n,s){if(hYr(t)){const o=this._getLayersInflateSize(e,t.symbolLayers,r,n,s),a=Ebe(t.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(e,t,s)}static _getLayersInflateSize(e,t,r,n,s){let o=!0;if(!t)return e;for(const a of t){if(!a)continue;let l=[0,0,0,0];switch(a.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=a;let h=c.width;h!=null&&(c.capStyle===Lv.Square||c.joinStyle===Eb.Miter?h/=1.4142135623730951:h/=2,l[0]=-h,l[1]=-h,l[2]=h,l[3]=h);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=a;if(a.type==="CIMVectorMarker"){const w=a;if(l=this._vectorMarkerBounds(l,w,r,s),w.frame){const S=(w.frame.xmin+w.frame.xmax)/2,I=(w.frame.ymin+w.frame.ymax)/2;if(l[0]-=S,l[1]-=I,l[2]-=S,l[3]-=I,w.size!=null){const R=w.size/(w.frame.ymax-w.frame.ymin);l[0]*=R,l[1]*=R,l[2]*=R,l[3]*=R}}}else if(a.type==="CIMPictureMarker"){const w=a,S=r.getResource(w.url);let I=1;if(S!=null&&S.height&&(I=S.width/S.height),c.size!=null){const R=c.size/2,L=c.size*I*w.scaleX/2;l=[-L,-R,L,R]}}else if(c.size!=null){const w=c.size/2;l=[-w,-w,w,w]}if(c.anchorPoint){let w,S;c.anchorPointUnits==="Absolute"?(w=c.anchorPoint.x,S=c.anchorPoint.y):(w=c.anchorPoint.x*(l[2]-l[0]),S=c.anchorPoint.y*(l[3]-l[1])),l[0]-=w,l[1]-=S,l[2]-=w,l[3]-=S}let h=rs(c.rotation);if(c.rotateClockwise&&(h=-h),n&&(h-=n),h){const w=bmt*h,S=Math.cos(w),I=Math.sin(w),R=Wo([fA,fA,-fA,-fA]);Bce(R,[l[0]*S-l[1]*I,l[0]*I+l[1]*S]),Bce(R,[l[0]*S-l[3]*I,l[0]*I+l[3]*S]),Bce(R,[l[2]*S-l[1]*I,l[2]*I+l[1]*S]),Bce(R,[l[2]*S-l[3]*I,l[2]*I+l[3]*S]),l=R}let p=rs(c.offsetX),m=rs(c.offsetY);if(n){const w=bmt*n,S=Math.cos(w),I=Math.sin(w),R=p*I+m*S;p=p*S-m*I,m=R}l[0]+=p,l[1]+=m,l[2]+=p,l[3]+=m;const v=nYr(c.markerPlacement);v>0&&(l[0]-=v,l[1]-=v,l[2]+=v,l[3]+=v);break}}const u=Ebe(a.effects);u>0&&(l[0]-=u,l[1]-=u,l[2]+=u,l[3]+=u),o?(e[0]=l[0],e[1]=l[1],e[2]=l[2],e[3]=l[3],o=!1):(e[0]=Math.min(e[0],l[0]),e[1]=Math.min(e[1],l[1]),e[2]=Math.max(e[2],l[2]),e[3]=Math.max(e[3],l[3]))}return e}static _getTextInflatedSize(e,t,r){const n=t.height??ph.CIMTextSymbol.height;if(e[0]=-n/2,e[1]=-n/2,e[2]=n/2,e[3]=n/2,!r)return e;const s=r.get(t);if(!s||!s.glyphMosaicItems.glyphs.length)return e;const{lineGapType:o,lineGap:a}=t,l=o?ZGt(o,a??0,n):0,u=t.callout?.type==="CIMBackgroundCallout",c=xJe(s.glyphMosaicItems,{scale:n/dJe,angle:rs(t.angle),xOffset:rs(t.offsetX),yOffset:rs(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:512,lineHeight:hJe*Math.max(.25,Math.min(l||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:u}).boundsT;return e[0]=c.x-c.halfWidth,e[1]=-c.y-c.halfHeight,e[2]=c.x+c.halfWidth,e[3]=-c.y+c.halfHeight,e}},ym=class Zge{static getEnvelope(e,t,r){if(!e)return null;const n=new jqr(r);if(Array.isArray(e)){let s;for(const o of e)s?s.union(Kge(n,o,t)):s=Kge(n,o,t);return s}return Kge(n,e,t)}static getTextureAnchor(e,t){const r=this.getEnvelope(e,null,t);if(!r)return[0,0,0];const n=(r.x+.5*r.width)*XE,s=(r.y+.5*r.height)*XE,o=r.width*XE+2,a=r.height*XE+2;return[-n/o,-s/a,a]}static rasterize(e,t,r,n,s=!0){const o=r||this.getEnvelope(t,null,n);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*XE,l=(o.y+.5*o.height)*XE;e.width=o.width*XE,e.height=o.height*XE,r||(e.width+=2,e.height+=2);const u=e.getContext("2d",{willReadFrequently:!0}),c=w$.createScale(XE,-XE);c.translate(.5*e.width-a,.5*e.height+l);const h=new Uqr(u,n,c);switch(t.type){case"CIMPointSymbol":{const v={type:"point",x:0,y:0};h.drawSymbol(t,v);break}case"CIMVectorMarker":{const v=new sX;h.drawMarker(t,v);break}}const p=u.getImageData(0,0,e.width,e.height),m=new Uint8Array(p.data);if(s){let v;for(let w=0;wh.width&&h.width>0?S*h.width:S),lineDashEnding:v,controlPointEnding:jy.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?Lv.Round:Lv.Butt,enable:!0,width:m,color:Ew(h.color),effects:w})}else!t||e.type!=="line-marker"||e.style!=="cross"&&e.style!=="x"?[a,l]=cK(n):([a,l]=cK(n),o.push({type:"CIMSolidStroke",enable:!0,width:t,color:Ew(s)}));o.push({type:"CIMSolidFill",enable:!0,color:Ew(s)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:rs(-e.angle),size:rs(u||6*t),offsetX:rs(e.xoffset),offsetY:rs(e.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:l,symbol:c}]}]}}static fromCIMHatchFill(e,t){const r=t*(e.separation??ph.CIMHatchFill.separation),n=r/2,s=li(e.lineSymbol);s.symbolLayers?.forEach(l=>{switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=t),l.effects?.forEach(u=>{if(u.type==="CIMGeometricEffectDashes"){const c=u.dashTemplate;u.dashTemplate=c.map(h=>h*t)}});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=t);const u=l.markerPlacement;u!=null&&"placementTemplate"in u&&(u.placementTemplate=u.placementTemplate.map(c=>c*t));break}}});let o=this._getLineSymbolPeriod(s)||wmt;for(;o{pYr(s,t,r),"url"in s&&s.url&&r.push(t.fetchResource(s.url,{signal:n}))}),r}static fetchFonts(e,t,r){if(e&&t){if("symbolLayers"in e&&e.symbolLayers){for(const n of e.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const s of n.markerGraphics)s?.symbol&&Zge.fetchFonts(s.symbol,t,r)}else if(e.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:s}=e;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=gVe(s),l=yVe(e),u=new mae({family:n,style:o,weight:a,decoration:l});r.push(t.loadFont(u).catch(()=>{Cbe().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers){for(const r of e.symbolLayers)if(r){const n=this._getEffectsRepeat(r.effects);if(n)return n;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const s=this._getPlacementRepeat(r.markerPlacement);if(s)return s}}}}}return 0}static _getEffectsRepeat(e){if(e){for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const r=t.dashTemplate;if(r&&r.length){let n=0;for(const s of r)n+=s;return 1&r.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return t.period;default:Cbe().error(`unsupported geometric effect type ${t.type}`)}}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let r=0;for(const n of t)r+=+n;return 1&t.length&&(r*=2),r}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const n=Math.abs(t.stepX),s=Math.abs(t.stepY),o=(t.randomness??100)/100;let a,l,u,c;if(t.gridType==="Random"){const h=uy(Hjt),p=Math.max(Math.floor(h/n),1),m=Math.max(Math.floor(h/s),1);a=p*n/2,l=m*s/2,u=2*l;const v=new VC(t.seed),w=o*n/1.5,S=o*s/1.5;c=[];for(let I=0;I({type:"CIMMarkerGraphic",geometry:h,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:u}}};function nUt(i,e){if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=i.symbolLayers;if(!t)return;for(const r of t)if(e(r),r.type==="CIMVectorMarker"){const n=r.markerGraphics;if(!n)continue;for(const s of n)if(s){const o=s.symbol;o&&nUt(o,e)}}break}}}const CJe=i=>{if(!i)return Lv.Butt;switch(i){case"butt":return Lv.Butt;case"square":return Lv.Square;case"round":return Lv.Round}},sUt=i=>{if(!i)return Eb.Miter;switch(i){case"miter":return Eb.Miter;case"round":return Eb.Round;case"bevel":return Eb.Bevel}},oYr=i=>{if(i==null)return"Center";switch(i){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},aYr=i=>{if(i==null)return"Center";switch(i){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Ew=i=>{if(!i)return[0,0,0,0];const{r:e,g:t,b:r,a:n}=i;return[e,t,r,255*n]},lYr=(i,e)=>{const t=uYr(e),r=cYr(i);return t&&r?`${t}-${r}`:`${t}${r}`},uYr=i=>{if(!i)return"";switch(i.toLowerCase()){case"bold":case"bolder":return"bold"}return""},cYr=i=>{if(!i)return"";switch(i.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Ibe=(i,e)=>{const t=yi("safari")?.001:0,r=e==="butt";switch(i){case"dash":case"esriSLSDash":return r?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return r?[4,3,1,3]:[3,4,t,4];case"dot":case"esriSLSDot":return r?[1,3]:[t,4];case"long-dash":case"esriSLSLongDash":return r?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return r?[8,3,1,3]:[7,4,t,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return r?[8,3,1,3,1,3]:[7,4,t,4,t,4];case"short-dash":case"esriSLSShortDash":return r?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return r?[4,1,1,1]:[3,2,t,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return r?[4,1,1,1,1,1]:[3,2,t,2,t,2];case"short-dot":case"esriSLSShortDot":return r?[1,1]:[t,2];case"solid":case"esriSLSSolid":case"none":return Cbe().error("Unexpected: style does not require rasterization"),[0,0];default:return Cbe().error(`Tried to rasterize SLS, but found an unexpected style: ${i}!`),[0,0]}};function hYr(i){return i.symbolLayers!==void 0}const cK=(i,e=100)=>{const t=e/2;let r,n;const s=i;if(s==="circle"||s==="esriSMSCircle"){let a=Math.acos(1-.25/t),l=Math.ceil(rUt/a/4);l===0&&(l=1),a=iYr/l,l*=4;const u=[];u.push([t,0]);for(let c=1;ci==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function pYr(i,e,t){if(!(!i.effects||e.geometryEngine!=null)){if(e.geometryEnginePromise)return void t.push(e.geometryEnginePromise);eir(i.effects)&&(e.geometryEnginePromise=tir(),t.push(e.geometryEnginePromise),e.geometryEnginePromise.then(r=>e.geometryEngine=r))}}function Smt(i){if(!i)return null;let e=null;const{cap:t,color:r,join:n,miterLimit:s,style:o,width:a}=i;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(e=[{type:"CIMGeometricEffectDashes",dashTemplate:Ibe(o,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Ew(r):[0,0,0,0],capStyle:CJe(t),joinStyle:sUt(n),miterLimit:s,width:a,effects:e}}const fYr=96/72;let J8e=class{static executeEffects(e,t,r,n){const s=fYr,o=Ebe(e);let a=new $8e(t);for(const l of e){const u=W8e(l);u&&(a=u.execute(a,l,s,r,n,o))}return a}static applyEffects(e,t,r){if(!e)return t;const n=Ebe(e);let s,o=new $8e(Ec.fromJSONCIM(t));for(const u of e){const c=W8e(u);c&&(o=c.execute(o,u,1,null,r,n))}const a=[];let l=null;for(;s=o.next();)a.push(...oae(s)),l=s.geometryType;return a.length===0||l===null?null:l==="esriGeometryPolygon"?{rings:a}:{paths:a}}},oUt=null;function EJe(){return oUt}async function mYr(){oUt=await Promise.resolve().then(()=>iX)}const gYr=new Float32Array(1);new Uint32Array(gYr.buffer);function cv(i,e){return 65535&i|e<<16}function aUt(i){switch(i){case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4}}function yYr(i){const e=[],t=[],r=[];for(const n of i){const s=aUt(n.type)*n.count;switch(s%2||s%4||4){case 4:e.push(n);continue;case 2:t.push(n);continue;case 1:r.push(n);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...t),e.push(...r),e}let vYr=class lUt{static fromVertexSpec({attributes:e},t){let r,n,s;const o=[];for(const m in e){const v=e[m];t?.[m]!==!1&&(v.pack==="position"?r={...v,name:m,offset:0}:v.pack==="id"?n={...v,name:m,offset:4}:m==="bitset"?s={...v,name:m,offset:7}:o.push({...v,name:m}))}const a=yYr(o),l=[];let u=8,c=1;for(const m of a)l.push({...m,offset:u}),u+=aUt(m.type)*m.count,m.packAlternating&&(c=Math.max(m.packAlternating.count,c));const h=Uint32Array.BYTES_PER_ELEMENT,p=u%h;return new lUt(r,n,s,l,u+(p?h-p:0),c)}constructor(e,t,r,n,s,o){this.position=e,this.id=t,this.bitset=r,this.standardAttributes=n,this.stride=s,this.packVertexCount=o,n.push(r),this._attributes=[e,t,r,...n]}get attributeLayout(){if(!this._attributeLayout){const e=wle(this._attributes),t=this._attributes.map(r=>({name:r.name,count:r.count,offset:r.offset,type:r.type,packPrecisionFactor:r.packPrecisionFactor,normalized:r.normalized??!1}));this._attributeLayout={attributes:t,hash:e,stride:this.stride}}return this._attributeLayout}};function _Yr(i,e,t,r){const n=t.packPrecisionFactor??1;switch(t.type){case Ti.BYTE:if(t.count===1)i.setInt8(r+t.offset,e*n);else for(let s=0;sthis.vertexSpec.createComputedParams(s)}get _vertexPack(){if(!this._cachedVertexPack){const e=bYr.fromVertexSpec(this.vertexSpec,this._optionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){wYr(this._evaluator.inputMeshParams.params.effects?.effectInfos)&&await mYr()}enqueueRequest(e,t,r){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,r)}write(e,t,r,n,s){this.ensurePacked(t,r,n);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(e,r,void 0,s);const a=r.readGeometryForDisplay()?.clone();if(!a)return;const l=Ec.fromOptimizedCIM(a,r.geometryType),u=EJe();l.invertY();const c=e.id||"",h=J8e.executeEffects(o,l,c,u);let p;for(;p=h.next();)p.invertY(),this._write(e,r,p,s)}ensurePacked(e,t,r){if(!this._evaluator.hasDynamicProperties)return;const n=this._evaluator.evaluateMeshParams(e,t,r);this._vertexPack.pack(n,this._viewParams)}_writeVertex(e,t,r,n,s){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,r,n,o,s)}};const xYr=100,SYr=yi("featurelayer-fast-triangulation-enabled");let hUt=class extends oX{async loadDependencies(){await Promise.all([super.loadDependencies(),tGt()])}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);s&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,s),e.recordEnd())}_clip(e){if(!e)return null;const t=this.hasEffects;return uGt(e,t?256:8)}_writeGeometry(e,t,r){const n=r.maxLength>xYr,s=[],o=this.createTesselationParams(t);if(!n&&SYr&&YHr(s,r))return void(s.length&&this._writeVertices(e,t,r.coords,o,s));const a=XHr(r);this._writeVertices(e,t,a,o)}_writeVertices(e,t,r,n,s){const o=t.getDisplayId(),a=e.vertexCount(),l=this.hasEffects;let u=0;if(s)for(const c of s){const h=r[2*c],p=r[2*c+1];l&&e.recordBounds(h,p,0,0),this._writeVertex(e,o,h,p,n),u++}else for(let c=0;ci,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:Ti.FLOAT,count:1,packTessellation:({inverseArea:i})=>i}}};let CYr=class extends hUt{constructor(){super(...arguments),this.vertexSpec=TYr}createTesselationParams(e){return{inverseArea:1/e.readGeometryArea()}}};const EYr=()=>di.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),IYr=0,AYr=100;function aX(i,e){return[!!i?.minScale&&e.scaleToZoom(i.minScale)||IYr,!!i?.maxScale&&e.scaleToZoom(i.maxScale)||AYr]}function hK(i){return 1<i,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)}}};let IJe=class extends hUt{constructor(){super(...arguments),this.vertexSpec=dUt}createTesselationParams(e){return null}};const fCe={createComputedParams:i=>i,attributes:{...dUt.attributes,tlbr:{count:4,type:Ti.UNSIGNED_SHORT,pack:({sprite:i})=>{const{rect:e,width:t,height:r}=i,n=e.x+Qg,s=e.y+Qg;return[n,s,n+t,s+r]}},inverseRasterizationScale:{count:1,type:Ti.BYTE,packPrecisionFactor:16,pack:({sprite:i})=>1/i.rasterizationScale}}};let pUt=class extends IJe{constructor(){super(...arguments),this.vertexSpec=fCe}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),e.recordEnd()}};var eoe;(function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"})(eoe||(eoe={}));const Cmt=3.14159265359/180,fUt=3.14159265359/128,PYr=1,RYr=1.1,DYr=1,Emt=24,FYr=8,kYr=1e-5,Imt=.05,mUt=1e-30,mCe=4,AJe=0,gUt=2,yUt=5,vUt=6,_Ut=2,bUt=3,wUt=0,xUt=3,LYr=16777216;function MJe(i){const{sprite:e,aspectRatio:t,scaleProportionally:r}=i,n=us(i.height),s=n>0?n:e.height;let o=n*t;return o<=0?o=e.width:r&&(o*=e.width/e.height),{width:o,height:s}}function SUt(i){const{applyRandomOffset:e,sampleAlphaOnly:t}=i,{width:r,height:n}=MJe(i);return Tle([[gUt,e],[mCe,t],[vUt,ri,attributes:{...fCe.attributes,bitset:{count:1,type:Ti.UNSIGNED_BYTE,pack:SUt},width:{count:1,type:Ti.UNSIGNED_SHORT,pack:TUt},height:{count:1,type:Ti.UNSIGNED_SHORT,pack:CUt},offset:{count:2,type:Ti.SHORT,pack:({offsetX:i,offsetY:e})=>[us(i),-us(e)]},scale:{count:2,type:Ti.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:i,scaleY:e})=>[i,e]},angle:{count:1,type:Ti.UNSIGNED_BYTE,pack:({angle:i})=>Xqr(i)}}};let NYr=class extends pUt{constructor(){super(...arguments),this.vertexSpec=EUt}};function IUt(i,e){return i.x===e.x&&i.y===e.y}function $Yr(i){if(!i)return;const e=i.length;if(e<=1)return;let t=0;for(let r=1;rr){s=!0;const L=(r-n)/v;v=r-n,c=(1-L)*o+L*c,h=(1-L)*a+L*h,--u}const w=this._writeVertex(o,a,0,0,p,m,m,-p,0,-1,n),S=this._writeVertex(o,a,0,0,p,m,-m,p,0,1,n);n+=v;const I=this._writeVertex(c,h,0,0,p,m,m,-p,0,-1,n),R=this._writeVertex(c,h,0,0,p,m,-m,p,0,1,n);this._writeTriangle(w,S,I),this._writeTriangle(S,I,R),o=c,a=h}}_tessellate(e,t){const r=e[0],n=e[e.length-1],s=IUt(r,n),o=s?3:2;if(e.length{const tt=Z(w,S,V,Y,Te,Be,_e,Ie,Ve,$e,H);return ne>=0&&de>=0&&tt>=0&&ae(ne,de,tt),ne=de,de=tt,tt};s&&(v=e[e.length-2],L.x=n.x-v.x,L.y=n.y-v.y,B=uPe(L),L.x/=B,L.y/=B);let be=!1;for(let _e=0;_epe&&(be=!0)),be){const yt=(pe-H)/k;k=pe-H,v={x:(1-yt)*v.x+yt*e[_e].x,y:(1-yt)*v.y+yt*e[_e].y},--_e}else v=e[_e];w=v.x,S=v.y;const Ie=_e<=0&&!be,Te=_e===e.length-1;if(Ie||(H+=k),I=Te?s?e[1]:null:e[_e+1],I?(L.x=I.x-w,L.y=I.y-S,B=uPe(L),L.x/=B,L.y/=B):(L.x=void 0,L.y=void 0),!s){if(Ie){d2($,L),V=$.x,Y=$.y,l===L1.SQUARE&&(fe(-L.y-L.x,L.x-L.y,L.x,L.y,0,-1),fe(L.y-L.x,-L.x-L.y,L.x,L.y,0,1)),l===L1.ROUND&&(fe(-L.y-L.x,L.x-L.y,L.x,L.y,-1,-1),fe(L.y-L.x,-L.x-L.y,L.x,L.y,-1,1)),l!==L1.ROUND&&l!==L1.BUTT||(fe(-L.y,L.x,L.x,L.y,0,-1),fe(L.y,-L.x,L.x,L.y,0,1));continue}if(Te){bT($,R),V=$.x,Y=$.y,l!==L1.ROUND&&l!==L1.BUTT||(fe(R.y,-R.x,-R.x,-R.y,0,-1),fe(-R.y,R.x,-R.x,-R.y,0,1)),l===L1.SQUARE&&(fe(R.y-R.x,-R.x-R.y,-R.x,-R.y,0,-1),fe(-R.y-R.x,R.x-R.y,-R.x,-R.y,0,1)),l===L1.ROUND&&(fe(R.y-R.x,-R.x-R.y,-R.x,-R.y,1,-1),fe(-R.y-R.x,R.x-R.y,-R.x,-R.y,1,1));continue}}let Be,Ve,$e=-BYr(R,L);if(Math.abs($e)<.01)Mmt(R,L)>0?($.x=R.x,$.y=R.y,$e=1,Be=Number.MAX_VALUE,Ve=!0):(d2($,L),$e=1,Be=1,Ve=!1);else{$.x=(R.x+L.x)/$e,$.y=(R.y+L.y)/$e,Be=uPe($);const yt=(Be-1)*p*a;Ve=Be>4||yt>k&&yt>B}V=$.x,Y=$.y;let tt=u;switch(u){case fv.BEVEL:Be<1.05&&(tt=fv.MITER);break;case fv.ROUND:Bec&&(tt=fv.BEVEL)}switch(tt){case fv.MITER:if(fe($.x,$.y,-R.x,-R.y,0,-1),fe(-$.x,-$.y,-R.x,-R.y,0,1),Te)break;if(m){const yt=be?0:H;ne=this._writeVertex(w,S,V,Y,L.x,L.y,$.x,$.y,0,-1,yt),de=this._writeVertex(w,S,V,Y,L.x,L.y,-$.x,-$.y,0,1,yt)}break;case fv.BEVEL:{const yt=$e<0;let Ct,ot,vt,At;if(yt){const ct=ne;ne=de,de=ct,Ct=K,ot=Q}else Ct=Q,ot=K;if(Ve)vt=yt?d2(this._innerPrev,R):bT(this._innerPrev,R),At=yt?bT(this._innerNext,L):d2(this._innerNext,L);else{const ct=yt?lPe(this._inner,$):Amt(this._inner,$);vt=ct,At=ct}const Je=yt?bT(this._bevelStart,R):d2(this._bevelStart,R);fe(vt.x,vt.y,-R.x,-R.y,Ct.x,Ct.y);const it=fe(Je.x,Je.y,-R.x,-R.y,ot.x,ot.y);if(Te)break;const Ue=yt?d2(this._bevelEnd,L):bT(this._bevelEnd,L);if(Ve){const ct=this._writeVertex(w,S,V,Y,-R.x,-R.y,0,0,0,0,H);ne=this._writeVertex(w,S,V,Y,L.x,L.y,At.x,At.y,Ct.x,Ct.y,H),de=this._writeVertex(w,S,V,Y,L.x,L.y,Ue.x,Ue.y,ot.x,ot.y,H),this._writeTriangle(it,ct,de)}else{if(m){const ct=this._bevelMiddle;ct.x=(Je.x+Ue.x)/2,ct.y=(Je.y+Ue.y)/2,Nj(re,ct,-R.x,-R.y),fe(ct.x,ct.y,-R.x,-R.y,re.x,re.y),Nj(re,ct,L.x,L.y),ne=this._writeVertex(w,S,V,Y,L.x,L.y,ct.x,ct.y,re.x,re.y,H),de=this._writeVertex(w,S,V,Y,L.x,L.y,At.x,At.y,Ct.x,Ct.y,H)}else{const ct=ne;ne=de,de=ct}fe(Ue.x,Ue.y,L.x,L.y,ot.x,ot.y)}if(yt){const ct=ne;ne=de,de=ct}break}case fv.ROUND:{const yt=$e<0;let Ct,ot;if(yt){const _t=ne;ne=de,de=_t,Ct=K,ot=Q}else Ct=Q,ot=K;const vt=yt?lPe(this._inner,$):Amt(this._inner,$);let At,Je;Ve?(At=yt?d2(this._innerPrev,R):bT(this._innerPrev,R),Je=yt?bT(this._innerNext,L):d2(this._innerNext,L)):(At=vt,Je=vt);const it=yt?bT(this._roundStart,R):d2(this._roundStart,R),Ue=yt?d2(this._roundEnd,L):bT(this._roundEnd,L),ct=fe(At.x,At.y,-R.x,-R.y,Ct.x,Ct.y),st=fe(it.x,it.y,-R.x,-R.y,ot.x,ot.y);if(Te)break;const Ze=this._writeVertex(w,S,V,Y,-R.x,-R.y,0,0,0,0,H);Ve||this._writeTriangle(ne,de,Ze);const ye=lPe(this._outer,vt),Ke=this._writeVertex(w,S,V,Y,L.x,L.y,Ue.x,Ue.y,ot.x,ot.y,H);let ke,me;const ie=Be>2;if(ie){let _t;Be!==Number.MAX_VALUE?(ye.x/=Be,ye.y/=Be,_t=Mmt(R,ye),_t=(Be*(_t*_t-1)+1)/_t):_t=-1,ke=yt?bT(this._startBreak,R):d2(this._startBreak,R),ke.x+=R.x*_t,ke.y+=R.y*_t,me=yt?d2(this._endBreak,L):bT(this._endBreak,L),me.x+=L.x*_t,me.y+=L.y*_t}Nj(re,ye,-R.x,-R.y);const ge=this._writeVertex(w,S,V,Y,-R.x,-R.y,ye.x,ye.y,re.x,re.y,H);Nj(re,ye,L.x,L.y);const je=m?this._writeVertex(w,S,V,Y,L.x,L.y,ye.x,ye.y,re.x,re.y,H):ge,rt=Ze,Me=m?this._writeVertex(w,S,V,Y,L.x,L.y,0,0,0,0,H):Ze;let ht=-1,Ht=-1;if(ie&&(Nj(re,ke,-R.x,-R.y),ht=this._writeVertex(w,S,V,Y,-R.x,-R.y,ke.x,ke.y,re.x,re.y,H),Nj(re,me,L.x,L.y),Ht=this._writeVertex(w,S,V,Y,L.x,L.y,me.x,me.y,re.x,re.y,H)),m?ie?(this._writeTriangle(rt,st,ht),this._writeTriangle(rt,ht,ge),this._writeTriangle(Me,je,Ht),this._writeTriangle(Me,Ht,Ke)):(this._writeTriangle(rt,st,ge),this._writeTriangle(Me,je,Ke)):ie?(this._writeTriangle(Ze,st,ht),this._writeTriangle(Ze,ht,Ht),this._writeTriangle(Ze,Ht,Ke)):(this._writeTriangle(Ze,st,ge),this._writeTriangle(Ze,je,Ke)),Ve?(ne=this._writeVertex(w,S,V,Y,L.x,L.y,Je.x,Je.y,Ct.x,Ct.y,H),de=Ke):(ne=m?this._writeVertex(w,S,V,Y,L.x,L.y,Je.x,Je.y,Ct.x,Ct.y,H):ct,this._writeTriangle(ne,Me,Ke),de=Ke),yt){const _t=ne;ne=de,de=_t}break}}}}},jYr=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const gCe={createComputedParams:i=>i,attributes:{id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:Ti.UNSIGNED_BYTE,count:1},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)},offset:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:e})=>[Bde(i,16),Bde(e,16)]},normal:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:i,normalY:e})=>[Bde(i,16),Bde(e,16)]},halfWidth:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:i})=>Tmt(us(.5*i),16)},referenceHalfWidth:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:i})=>Tmt(us(.5*i),16)}}};let GYr=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Omt=65535;let OJe=class extends oX{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=gCe,this._currentWrite=new GYr,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Omt,textured:!1},this._tessParams=new jYr,this._initializeTessellator()}writeLineVertices(e,t,r){const n=this._getLines(t);n!=null&&this._writeVertices(e,r,n)}_initializeTessellator(){this._lineTessellator=new AUt(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(e,t,r){const n=r??Ec.fromFeatureSetReaderCIM(t);n&&this._writeGeometry(e,t,n)}_writeGeometry(e,t,r,n){e.recordStart(this.instanceId,this.attributeLayout,n),this.writeLineVertices(e,r,t),e.recordEnd()}_getLines(e){return KHr(e,Jjt(this.evaluatedMeshParams))}_writeVertices(e,t,r){const{_currentWrite:n,_tessellationOptions:s,evaluatedMeshParams:o}=this,{width:a,capType:l,joinType:u,miterLimit:c,hasSizeVV:h}=o,p=us(.5*a);s.halfWidth=p,s.capType=MYr(l),s.joinType=OYr(u),s.miterLimit=c;const m=!h;n.out=e,n.id=t.getDisplayId(),n.vertexCount=0,n.indexCount=0,n.vertexFrom=e.vertexCount(),n.vertexBounds=m&&pi,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>0},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)}}},PJe={createComputedParams:i=>i,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>Tle([[AJe,!0]])},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>Xg(i)}}};let RJe=class extends OJe{constructor(){super(...arguments),this.vertexSpec=PJe}},DJe=class extends IJe{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=MUt,this._lineMeshWriter=this._createOutlineWriter(e,t,r,n)}_createOutlineWriter(e,t,r,n){return new RJe(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);s&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd())}_clip(e){return e?uGt(e,Jjt(this.evaluatedMeshParams)):null}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};var zl;(function(i){i[i.Pass=0]="Pass",i[i.Draw=1]="Draw"})(zl||(zl={}));const OUt=()=>di.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let PUt=class{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){OUt().error("Trying to include shader module multiple times with different sets of options.");const n=new Set;for(const s of Object.keys(r))r[s]!==e[s]&&n.add(s);for(const s of Object.keys(e))r[s]!==e[s]&&n.add(s);n.forEach(s=>console.error(` ${s}: current ${r[s]} new ${e[s]}`))}}else this._includedModules.set(e,t),e(this.builder,t)}},UYr=class extends PUt{constructor(){super(...arguments),this.vertex=new Pmt,this.fragment=new Pmt,this.attributes=new HYr,this.varyings=new WYr,this.extensions=new K8e,this.constants=new RUt}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const r=this.extensions.generateSource(e),n=this.attributes.generateSource(e),s=this.varyings.generateSource(e),o=e==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),l=o.code.generateSource(),u=e==="vertex"?YYr:qYr(t),c=this.constants.generateSource().concat(o.constants.generateSource());return`${t?"#version 300 es":""} ${r.join(` `)} ${u} @@ -425,7 +425,7 @@ ${n.join(` ${s.join(` `)} ${l.join(` -`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(s=>{const o=s.bind[zl.Pass];o&&t.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[zl.Pass];o&&t.set(s.name,o)});const r=Array.from(t.values()),n=r.length;return(s,o)=>{for(let a=0;a{const o=s.bind[zl.Draw];o&&t.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[zl.Draw];o&&t.set(s.name,o)});const r=Array.from(t.values()),n=r.length;return(s,o,a)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},qYr=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},Pmt=class extends PUt{constructor(){super(...arguments),this.uniforms=new WYr,this.code=new qYr,this.constants=new RUt}get builder(){return this}},YYr=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},XYr=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ch(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,n)=>t.push(e==="vertex"?`out ${r} ${n};`:`in ${r} ${n};`)),t}},K8e=class Z8e{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t=e==="vertex"?Z8e.ALLOWLIST_VERTEX:Z8e.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(r=>t.includes(r)).map(r=>`#extension ${r} : enable`)}};K8e.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],K8e.ALLOWLIST_VERTEX=[];let RUt=class Op{constructor(){this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=Op._numberToFloatStr(r);break;case"int":n=Op._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])}, ${Op._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])}, ${Op._numberToFloatStr(r[2])}, ${Op._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])}, ${Op._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])}, ${Op._numberToIntStr(r[2])}, ${Op._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,s=>Op._numberToFloatStr(s)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}};function JYr(i=!0){return`#ifdef GL_FRAGMENT_PRECISION_HIGH +`)}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(s=>{const o=s.bind[zl.Pass];o&&t.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[zl.Pass];o&&t.set(s.name,o)});const r=Array.from(t.values()),n=r.length;return(s,o)=>{for(let a=0;a{const o=s.bind[zl.Draw];o&&t.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[zl.Draw];o&&t.set(s.name,o)});const r=Array.from(t.values()),n=r.length;return(s,o,a)=>{for(let l=0;le.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},VYr=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},Pmt=class extends PUt{constructor(){super(...arguments),this.uniforms=new zYr,this.code=new VYr,this.constants=new RUt}get builder(){return this}},HYr=class{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return e==="fragment"?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}},WYr=class{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&Ch(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach((r,n)=>t.push(e==="vertex"?`out ${r} ${n};`:`in ${r} ${n};`)),t}},K8e=class Z8e{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t=e==="vertex"?Z8e.ALLOWLIST_VERTEX:Z8e.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(r=>t.includes(r)).map(r=>`#extension ${r} : enable`)}};K8e.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],K8e.ALLOWLIST_VERTEX=[];let RUt=class Op{constructor(){this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=Op._numberToFloatStr(r);break;case"int":n=Op._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])}, ${Op._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${Op._numberToFloatStr(r[0])}, ${Op._numberToFloatStr(r[1])}, ${Op._numberToFloatStr(r[2])}, ${Op._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])}, ${Op._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${Op._numberToIntStr(r[0])}, ${Op._numberToIntStr(r[1])}, ${Op._numberToIntStr(r[2])}, ${Op._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,s=>Op._numberToFloatStr(s)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}};function qYr(i=!0){return`#ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; precision highp sampler2D; #else @@ -433,8 +433,8 @@ ${l.join(` precision mediump sampler2D; #endif ${i?"out vec4 fragColor;":""} -`}const KYr=`precision highp float; -precision highp sampler2D;`;function ZYr(i){return i.split(" ").map((e,t)=>t>0?e.charAt(0).toUpperCase()+e.slice(1):e).join("")}function QYr(i,e){const t=[];for(t.push(e);t.length;){const r=t.pop();if(typeof r=="object"&&!i.has(r.uid)){i.add(r.uid);for(const n of r.children)t.push(n)}}}let d7=class Q8e{constructor(){this.uid=Q8e.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=ZYr(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof Q8e&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(e){e._debugName=this._debugName,e._isMutable=this._isMutable,e.isImplicit=this.isImplicit,e.uid=this.uid}};function os(i){return typeof i=="object"?i.clone():i}d7.NodeCount=0;let kf=class extends d7{constructor(){super(...arguments),this.shaderType="primitive-node"}},eXr=class DUt extends d7{constructor(e){super(),this.child=e,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const e=new DUt(os(this.child));return this.cloneInto(e),e}},tXr=class FUt extends d7{constructor(e,t,r){super(),this.property=e,this.target=t,this.returnType=r,this.shaderType="property-access-node"}get children(){const e=[this.target];return typeof this.property!="string"&&e.push(this.property),e}clone(){const e=new FUt(this.property,os(this.target),this.returnType);return this.cloneInto(e),e}},iXr=class kUt extends d7{constructor(e,t,r){super(),this.condition=e,this.ifTrue=t,this.ifFalse=r,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const e=os(this.ifTrue),t=this.ifFalse?os(this.ifFalse):null,r=new kUt(this.condition,e,t);return this.cloneInto(r),r}},rXr=class LUt extends d7{constructor(e,t,r,n){super(),this.captureList=e,this.returnType=t,this.generator=n,this.shaderType="block-node",r&&(this.subgraph=new eXr(r))}get children(){return Object.keys(this.captureList).map(e=>this.captureList[e]).concat(this.subgraph??[])}clone(){const e={};for(const r in this.captureList)e[r]=os(this.captureList[r]);const t=new LUt(e,this.returnType,this.subgraph?os(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(t),t}},C8=class NUt extends d7{constructor(e,t,r,n,s,o=!1){super(),this.token=e,this._children=t,this.isInfix=r,this.isPropertyAccess=n,this.returnType=s,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const e=new NUt(this.token,this._children.map(os),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(e),e}};var Lee,e9e,t9e,i9e,r9e,n9e,s9e,o9e,a9e,l9e,u9e,c9e,h9e,d9e;function nXr(i){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const t of e)if(t.includes(i))return t.map(r=>lXr[r]);throw new Error("Unable to find type family")}function $Ut(i){return new Proxy(i,{get(e,t){if(t==="constructor")return new Proxy(e.constructor,{construct:(r,n,s)=>$Ut(new r(...n))});if(t in e)return e[t];if(typeof t=="string"){const r=nXr(i.type);return px(i,t,r[t.length-1])}}})}function Jx(i){return new Proxy(i,{construct:(e,t,r)=>$Ut(new e(...t))})}function sXr(i){return new Proxy(i,{get(e,t){if(t in e)return e[t];if(typeof t=="string"){const r=parseInt(t,10);if(!isNaN(r))return px(i,`[${r}]`,i.elementType.constructor)}}})}function oXr(i){return new Proxy(i,{construct:(e,t,r)=>sXr(new e(...t))})}let p9e=class extends Error{},gf=Lee=class extends kf{constructor(i,e){super(),this.elementType=i,this.size=e,this.children=[],this.type="array"}clone(){const i=new Lee(this.elementType,this.size);return super.cloneInto(i),i}get(i){if(typeof i=="number"){const e=new rE(i);return e.isImplicit=!0,px(this,e,this.elementType.constructor)}return px(this,i,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(i,e,t){return hXr(this,i,e,t)}glslFindIndex(i,e,t){return dXr(this,i,e,t)}static ofType(i,e){const t={construct:(r,n)=>new Lee(new i,e)};return new Proxy(Lee,t)}};gf.type="array",gf=Lee=x([oXr],gf);let _f=class BUt extends kf{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const e=new BUt;return e.children=this.children.map(os),super.cloneInto(e),e}};_f.type="sampler2D";let Ni=class wU extends kf{constructor(e){super(),this.type="float",this.children=[e]}clone(){const e=new wU(os(this.children[0]));return super.cloneInto(e),e}multiply(e){return uL(this,typeof e=="number"?Im(e,wU):e)}divide(e){return Ele(this,typeof e=="number"?Im(e,wU):e)}add(e){return lX(this,typeof e=="number"?Im(e,wU):e)}subtract(e){return Ile(this,typeof e=="number"?Im(e,wU):e)}};Ni.type="float";let As=e9e=class extends kf{constructor(i,e){super(),this.type="vec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new e9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){throw new p9e}get 3(){throw new p9e}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};As.type="vec2",As=e9e=x([Jx],As);let Ul=t9e=class extends kf{constructor(i,e,t){super(),this.type="vec3",this.children=[i,e,t].filter(r=>r!=null)}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){return px(this,"[2]",Ni)}get 3(){throw new p9e}clone(){const i=new t9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};Ul.type="vec3",Ul=t9e=x([Jx],Ul);let qo=i9e=class extends kf{constructor(i,e,t,r){super(),this.type="vec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new i9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){return px(this,"[2]",Ni)}get 3(){return px(this,"[3]",Ni)}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};qo.type="vec4",qo=i9e=x([Jx],qo);let Qge=r9e=class extends kf{constructor(i){super(),this.type="uint",this.children=[i]}clone(){const i=new r9e(os(this.children[0]));return super.cloneInto(i),i}};Qge.type="uint",Qge=r9e=x([Jx],Qge);let eye=n9e=class extends kf{constructor(i,e){super(),this.type="uvec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new n9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};eye.type="uvec2",eye=n9e=x([Jx],eye);let tye=s9e=class extends kf{constructor(i,e,t){super(),this.type="uvec3",this.children=[i,e,t].filter(r=>r!=null)}clone(){const i=new s9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};tye.type="uvec3",tye=s9e=x([Jx],tye);let iye=o9e=class extends kf{constructor(i,e,t,r){super(),this.type="uvec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new o9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};iye.type="uvec4",iye=o9e=x([Jx],iye);let Kx=class jUt extends kf{constructor(e){super(),this.type="bool",this.children=[e]}and(e){return m9e(this,e)}or(e){return VUt(this,e)}clone(){const e=new jUt(os(this.children[0]));return super.cloneInto(e),e}};Kx.type="bool";let rye=a9e=class extends kf{constructor(i,e){super(),this.type="bvec2",this.children=[i,e].filter(t=>t!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new a9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};rye.type="bvec2",rye=a9e=x([Jx],rye);let nye=l9e=class extends kf{constructor(i,e,t){super(),this.type="bvec3",this.children=[i,e,t].filter(r=>r!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new l9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};function Im(i,e){return typeof i=="number"?new e(i):i}nye.type="bvec3",nye=l9e=x([Jx],nye);let sye=u9e=class extends kf{constructor(i,e,t,r){super(),this.type="bvec4",this.children=[i,e,t,r].filter(n=>n!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new u9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};sye.type="bvec4",sye=u9e=x([Jx],sye);let rE=class xU extends kf{constructor(e){super(),this.type="int",this.children=[e]}multiply(e){return uL(this,Im(e,xU))}add(e){return lX(this,Im(e,xU))}subtract(e){return Ile(this,Im(e,xU))}divide(e){return Ele(this,Im(e,xU))}clone(){const e=new xU(os(this.children[0]));return super.cloneInto(e),e}};rE.type="int";let oye=c9e=class extends kf{constructor(i,e){super(),this.type="ivec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new c9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};oye.type="ivec2",oye=c9e=x([Jx],oye);let aye=h9e=class extends kf{constructor(i,e,t){super(),this.type="ivec3",this.children=[i,e,t].filter(r=>r!=null)}clone(){const i=new h9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};aye.type="ivec3",aye=h9e=x([Jx],aye);let lye=d9e=class extends kf{constructor(i,e,t,r){super(),this.type="ivec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new d9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};lye.type="ivec4",lye=d9e=x([Jx],lye);let aXr=class GUt extends kf{constructor(e,t,r,n){super(),this.type="mat2",this.children=[e,t,r,n]}clone(){const e=new GUt(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(e),e}};aXr.type="mat2";let Tf=class uye extends kf{static identity(){return new uye(1,0,0,0,1,0,0,0,1)}static fromRotation(e){const t=ioe(e),r=Abe(e);return new uye(r,t,0,cA(t),r,0,0,0,1)}constructor(e,t,r,n,s,o,a,l,u){super(),this.type="mat3",this.children=[e,t,r,n,s,o,a,l,u]}add(e){return lX(this,e)}multiply(e){return uL(this,e)}clone(){const e=new uye(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]),os(this.children[4]),os(this.children[5]),os(this.children[6]),os(this.children[7]),os(this.children[8]));return super.cloneInto(e),e}};Tf.type="mat3";let toe=class cye extends kf{static identity(){return new cye(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S){super(),this.type="mat4",this.children=[e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S]}static fromColumns(e,t,r,n){return new cye(e.x,e.y,e.z,e.w,t.x,t.y,t.z,t.w,r.x,r.y,r.z,r.w,n.x,n.y,n.z,n.w)}multiply(e){return uL(this,e)}clone(){const e=new cye(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]),os(this.children[4]),os(this.children[5]),os(this.children[6]),os(this.children[7]),os(this.children[8]),os(this.children[9]),os(this.children[10]),os(this.children[11]),os(this.children[12]),os(this.children[13]),os(this.children[14]),os(this.children[15]));return super.cloneInto(e),e}};toe.type="mat4";const lXr={float:Ni,vec2:As,vec3:Ul,vec4:qo,int:rE,ivec2:oye,ivec3:aye,ivec4:lye,uint:Qge,uvec2:eye,uvec3:tye,uvec4:iye,bool:Kx,bvec2:rye,bvec3:nye,bvec4:sye},$j=(...i)=>new rE(...i),zp=(...i)=>new Ni(...i),f9e=(...i)=>new As(...i),uXr=(...i)=>new Ul(...i),cXr=(...i)=>new qo(...i),Rmt=(...i)=>new Tf(...i);function px(i,e,t){const r=new t(new tXr(e,i,t));return r.isImplicit=!0,r}function Zx(i,e,t,r=null){if(r){const s=new r,o=new r(new C8(i,[e,t],!0,!1,s));return o.isImplicit=!0,o}if(e.type==="float"||e.type==="int"){const s=new t.constructor(new C8(i,[e,t],!0,!1,t.constructor));return s.isImplicit=!0,s}if((e.type==="mat2"||e.type==="mat3"||e.type==="mat4")&&t.type!=="float"){const s=new t.constructor(new C8(i,[e,t],!0,!1,t.constructor));return s.isImplicit=!0,s}const n=new e.constructor(new C8(i,[e,t],!0,!1,e.constructor));return n.isImplicit=!0,n}function HS(i,e,t=e.constructor){const r=new t(new C8(i,[e],!1,!1,t));return r.isImplicit=!0,r}function p7(i,e,t,r=e.constructor){const n=new r(new C8(i,[e,t],!1,!1,r));return n.isImplicit=!0,n}function FJe(i,e,t,r,n=e.constructor){const s=new n(new C8(i,[e,t,r],!1,!1,n));return s.isImplicit=!0,s}function cA(i){return uL(i,zp(-1))}function UUt(i,e,t,r){return new e(new rXr(i,e,t,r))}function hXr(i,e,t=0,r=i.size){const n=new rE(t).setMutable().setDebugName("FindIndexIterator"),s=e(i.get(n)).setDebugName("FindIndexPredicate");return UUt({iter:n},rE,s,({out:a,iter:l,subgraph:u})=>` +`}const YYr=`precision highp float; +precision highp sampler2D;`;function XYr(i){return i.split(" ").map((e,t)=>t>0?e.charAt(0).toUpperCase()+e.slice(1):e).join("")}function JYr(i,e){const t=[];for(t.push(e);t.length;){const r=t.pop();if(typeof r=="object"&&!i.has(r.uid)){i.add(r.uid);for(const n of r.children)t.push(n)}}}let d7=class Q8e{constructor(){this.uid=Q8e.NodeCount++,this._debugName=null,this._isMutable=!1,this.isImplicit=!1}get isMutable(){return this._isMutable}setMutable(){return this._isMutable=!0,this}setDebugName(e){return e=XYr(e),this._debugName=e,this.isImplicit&&this.children[0]instanceof Q8e&&this.children[0].setDebugName(e),this}get debugInfo(){return{name:this._debugName??""}}cloneInto(e){e._debugName=this._debugName,e._isMutable=this._isMutable,e.isImplicit=this.isImplicit,e.uid=this.uid}};function os(i){return typeof i=="object"?i.clone():i}d7.NodeCount=0;let kf=class extends d7{constructor(){super(...arguments),this.shaderType="primitive-node"}},KYr=class DUt extends d7{constructor(e){super(),this.child=e,this.shaderType="scope-node"}get children(){return[this.child]}clone(){const e=new DUt(os(this.child));return this.cloneInto(e),e}},ZYr=class FUt extends d7{constructor(e,t,r){super(),this.property=e,this.target=t,this.returnType=r,this.shaderType="property-access-node"}get children(){const e=[this.target];return typeof this.property!="string"&&e.push(this.property),e}clone(){const e=new FUt(this.property,os(this.target),this.returnType);return this.cloneInto(e),e}},QYr=class kUt extends d7{constructor(e,t,r){super(),this.condition=e,this.ifTrue=t,this.ifFalse=r,this.shaderType="condition-node"}get children(){return[this.condition,this.ifTrue,this.ifFalse]}clone(){const e=os(this.ifTrue),t=this.ifFalse?os(this.ifFalse):null,r=new kUt(this.condition,e,t);return this.cloneInto(r),r}},eXr=class LUt extends d7{constructor(e,t,r,n){super(),this.captureList=e,this.returnType=t,this.generator=n,this.shaderType="block-node",r&&(this.subgraph=new KYr(r))}get children(){return Object.keys(this.captureList).map(e=>this.captureList[e]).concat(this.subgraph??[])}clone(){const e={};for(const r in this.captureList)e[r]=os(this.captureList[r]);const t=new LUt(e,this.returnType,this.subgraph?os(this.subgraph.child):this.subgraph,this.generator);return this.cloneInto(t),t}},C8=class NUt extends d7{constructor(e,t,r,n,s,o=!1){super(),this.token=e,this._children=t,this.isInfix=r,this.isPropertyAccess=n,this.returnType=s,this.isTernary=o,this.shaderType="function-node"}get children(){return this._children}clone(){const e=new NUt(this.token,this._children.map(os),this.isInfix,this.isPropertyAccess,this.returnType,this.isTernary);return this.cloneInto(e),e}};var Lee,e9e,t9e,i9e,r9e,n9e,s9e,o9e,a9e,l9e,u9e,c9e,h9e,d9e;function tXr(i){const e=[["float","vec2","vec3","vec4"],["int","ivec2","ivec3","ivec4"],["uint","uvec2","uvec3","uvec4"],["bool","bvec2","bvec3","bvec4"]];for(const t of e)if(t.includes(i))return t.map(r=>sXr[r]);throw new Error("Unable to find type family")}function $Ut(i){return new Proxy(i,{get(e,t){if(t==="constructor")return new Proxy(e.constructor,{construct:(r,n,s)=>$Ut(new r(...n))});if(t in e)return e[t];if(typeof t=="string"){const r=tXr(i.type);return px(i,t,r[t.length-1])}}})}function Jx(i){return new Proxy(i,{construct:(e,t,r)=>$Ut(new e(...t))})}function iXr(i){return new Proxy(i,{get(e,t){if(t in e)return e[t];if(typeof t=="string"){const r=parseInt(t,10);if(!isNaN(r))return px(i,`[${r}]`,i.elementType.constructor)}}})}function rXr(i){return new Proxy(i,{construct:(e,t,r)=>iXr(new e(...t))})}let p9e=class extends Error{},gf=Lee=class extends kf{constructor(i,e){super(),this.elementType=i,this.size=e,this.children=[],this.type="array"}clone(){const i=new Lee(this.elementType,this.size);return super.cloneInto(i),i}get(i){if(typeof i=="number"){const e=new rE(i);return e.isImplicit=!0,px(this,e,this.elementType.constructor)}return px(this,i,this.elementType.constructor)}last(){return this.get(this.size-1)}first(){return this.get(0)}findIndex(i,e,t){return lXr(this,i,e,t)}glslFindIndex(i,e,t){return uXr(this,i,e,t)}static ofType(i,e){const t={construct:(r,n)=>new Lee(new i,e)};return new Proxy(Lee,t)}};gf.type="array",gf=Lee=x([rXr],gf);let _f=class BUt extends kf{constructor(){super(...arguments),this.type="sampler2D",this.children=[]}clone(){const e=new BUt;return e.children=this.children.map(os),super.cloneInto(e),e}};_f.type="sampler2D";let Ni=class wU extends kf{constructor(e){super(),this.type="float",this.children=[e]}clone(){const e=new wU(os(this.children[0]));return super.cloneInto(e),e}multiply(e){return uL(this,typeof e=="number"?Im(e,wU):e)}divide(e){return Ele(this,typeof e=="number"?Im(e,wU):e)}add(e){return lX(this,typeof e=="number"?Im(e,wU):e)}subtract(e){return Ile(this,typeof e=="number"?Im(e,wU):e)}};Ni.type="float";let As=e9e=class extends kf{constructor(i,e){super(),this.type="vec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new e9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){throw new p9e}get 3(){throw new p9e}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};As.type="vec2",As=e9e=x([Jx],As);let Ul=t9e=class extends kf{constructor(i,e,t){super(),this.type="vec3",this.children=[i,e,t].filter(r=>r!=null)}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){return px(this,"[2]",Ni)}get 3(){throw new p9e}clone(){const i=new t9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};Ul.type="vec3",Ul=t9e=x([Jx],Ul);let qo=i9e=class extends kf{constructor(i,e,t,r){super(),this.type="vec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new i9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}get 0(){return px(this,"[0]",Ni)}get 1(){return px(this,"[1]",Ni)}get 2(){return px(this,"[2]",Ni)}get 3(){return px(this,"[3]",Ni)}multiply(i){return uL(this,typeof i=="number"?Im(i,Ni):i)}divide(i){return Ele(this,typeof i=="number"?Im(i,Ni):i)}add(i){return lX(this,typeof i=="number"?Im(i,Ni):i)}subtract(i){return Ile(this,typeof i=="number"?Im(i,Ni):i)}};qo.type="vec4",qo=i9e=x([Jx],qo);let Qge=r9e=class extends kf{constructor(i){super(),this.type="uint",this.children=[i]}clone(){const i=new r9e(os(this.children[0]));return super.cloneInto(i),i}};Qge.type="uint",Qge=r9e=x([Jx],Qge);let eye=n9e=class extends kf{constructor(i,e){super(),this.type="uvec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new n9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};eye.type="uvec2",eye=n9e=x([Jx],eye);let tye=s9e=class extends kf{constructor(i,e,t){super(),this.type="uvec3",this.children=[i,e,t].filter(r=>r!=null)}clone(){const i=new s9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};tye.type="uvec3",tye=s9e=x([Jx],tye);let iye=o9e=class extends kf{constructor(i,e,t,r){super(),this.type="uvec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new o9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};iye.type="uvec4",iye=o9e=x([Jx],iye);let Kx=class jUt extends kf{constructor(e){super(),this.type="bool",this.children=[e]}and(e){return m9e(this,e)}or(e){return VUt(this,e)}clone(){const e=new jUt(os(this.children[0]));return super.cloneInto(e),e}};Kx.type="bool";let rye=a9e=class extends kf{constructor(i,e){super(),this.type="bvec2",this.children=[i,e].filter(t=>t!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new a9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};rye.type="bvec2",rye=a9e=x([Jx],rye);let nye=l9e=class extends kf{constructor(i,e,t){super(),this.type="bvec3",this.children=[i,e,t].filter(r=>r!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new l9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};function Im(i,e){return typeof i=="number"?new e(i):i}nye.type="bvec3",nye=l9e=x([Jx],nye);let sye=u9e=class extends kf{constructor(i,e,t,r){super(),this.type="bvec4",this.children=[i,e,t,r].filter(n=>n!=null)}all(){return LJe(this)}any(){return NJe(this)}clone(){const i=new u9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};sye.type="bvec4",sye=u9e=x([Jx],sye);let rE=class xU extends kf{constructor(e){super(),this.type="int",this.children=[e]}multiply(e){return uL(this,Im(e,xU))}add(e){return lX(this,Im(e,xU))}subtract(e){return Ile(this,Im(e,xU))}divide(e){return Ele(this,Im(e,xU))}clone(){const e=new xU(os(this.children[0]));return super.cloneInto(e),e}};rE.type="int";let oye=c9e=class extends kf{constructor(i,e){super(),this.type="ivec2",this.children=[i,e].filter(t=>t!=null)}clone(){const i=new c9e(os(this.children[0]),os(this.children[1]));return super.cloneInto(i),i}};oye.type="ivec2",oye=c9e=x([Jx],oye);let aye=h9e=class extends kf{constructor(i,e,t){super(),this.type="ivec3",this.children=[i,e,t].filter(r=>r!=null)}clone(){const i=new h9e(os(this.children[0]),os(this.children[1]),os(this.children[2]));return super.cloneInto(i),i}};aye.type="ivec3",aye=h9e=x([Jx],aye);let lye=d9e=class extends kf{constructor(i,e,t,r){super(),this.type="ivec4",this.children=[i,e,t,r].filter(n=>n!=null)}clone(){const i=new d9e(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(i),i}};lye.type="ivec4",lye=d9e=x([Jx],lye);let nXr=class GUt extends kf{constructor(e,t,r,n){super(),this.type="mat2",this.children=[e,t,r,n]}clone(){const e=new GUt(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]));return super.cloneInto(e),e}};nXr.type="mat2";let Tf=class uye extends kf{static identity(){return new uye(1,0,0,0,1,0,0,0,1)}static fromRotation(e){const t=ioe(e),r=Abe(e);return new uye(r,t,0,cA(t),r,0,0,0,1)}constructor(e,t,r,n,s,o,a,l,u){super(),this.type="mat3",this.children=[e,t,r,n,s,o,a,l,u]}add(e){return lX(this,e)}multiply(e){return uL(this,e)}clone(){const e=new uye(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]),os(this.children[4]),os(this.children[5]),os(this.children[6]),os(this.children[7]),os(this.children[8]));return super.cloneInto(e),e}};Tf.type="mat3";let toe=class cye extends kf{static identity(){return new cye(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}constructor(e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S){super(),this.type="mat4",this.children=[e,t,r,n,s,o,a,l,u,c,h,p,m,v,w,S]}static fromColumns(e,t,r,n){return new cye(e.x,e.y,e.z,e.w,t.x,t.y,t.z,t.w,r.x,r.y,r.z,r.w,n.x,n.y,n.z,n.w)}multiply(e){return uL(this,e)}clone(){const e=new cye(os(this.children[0]),os(this.children[1]),os(this.children[2]),os(this.children[3]),os(this.children[4]),os(this.children[5]),os(this.children[6]),os(this.children[7]),os(this.children[8]),os(this.children[9]),os(this.children[10]),os(this.children[11]),os(this.children[12]),os(this.children[13]),os(this.children[14]),os(this.children[15]));return super.cloneInto(e),e}};toe.type="mat4";const sXr={float:Ni,vec2:As,vec3:Ul,vec4:qo,int:rE,ivec2:oye,ivec3:aye,ivec4:lye,uint:Qge,uvec2:eye,uvec3:tye,uvec4:iye,bool:Kx,bvec2:rye,bvec3:nye,bvec4:sye},$j=(...i)=>new rE(...i),zp=(...i)=>new Ni(...i),f9e=(...i)=>new As(...i),oXr=(...i)=>new Ul(...i),aXr=(...i)=>new qo(...i),Rmt=(...i)=>new Tf(...i);function px(i,e,t){const r=new t(new ZYr(e,i,t));return r.isImplicit=!0,r}function Zx(i,e,t,r=null){if(r){const s=new r,o=new r(new C8(i,[e,t],!0,!1,s));return o.isImplicit=!0,o}if(e.type==="float"||e.type==="int"){const s=new t.constructor(new C8(i,[e,t],!0,!1,t.constructor));return s.isImplicit=!0,s}if((e.type==="mat2"||e.type==="mat3"||e.type==="mat4")&&t.type!=="float"){const s=new t.constructor(new C8(i,[e,t],!0,!1,t.constructor));return s.isImplicit=!0,s}const n=new e.constructor(new C8(i,[e,t],!0,!1,e.constructor));return n.isImplicit=!0,n}function HS(i,e,t=e.constructor){const r=new t(new C8(i,[e],!1,!1,t));return r.isImplicit=!0,r}function p7(i,e,t,r=e.constructor){const n=new r(new C8(i,[e,t],!1,!1,r));return n.isImplicit=!0,n}function FJe(i,e,t,r,n=e.constructor){const s=new n(new C8(i,[e,t,r],!1,!1,n));return s.isImplicit=!0,s}function cA(i){return uL(i,zp(-1))}function UUt(i,e,t,r){return new e(new eXr(i,e,t,r))}function lXr(i,e,t=0,r=i.size){const n=new rE(t).setMutable().setDebugName("FindIndexIterator"),s=e(i.get(n)).setDebugName("FindIndexPredicate");return UUt({iter:n},rE,s,({out:a,iter:l,subgraph:u})=>` ${a} = -1; for (; ${l} < ${r}; ${l}++) { @@ -447,7 +447,7 @@ ${u.body} } } -`).setDebugName("FindIndexBlock")}function dXr(i,e,t=0,r=i.size){return UUt({array:i},rE,null,({out:s,array:o})=>` +`).setDebugName("FindIndexBlock")}function uXr(i,e,t=0,r=i.size){return UUt({array:i},rE,null,({out:s,array:o})=>` ${s} = -1; for (int i = ${t}; i < ${r}; i++) { bool condition; @@ -457,7 +457,7 @@ for (int i = ${t}; i < ${r}; i++) { break; } } -`).setDebugName("GlslFindIndexBlock")}function Rh(i,e,t){const r=typeof e=="function"?e():e,n=typeof t=="function"?t():t,s=new r.constructor(new iXr(i,r,n));return s.isImplicit=!0,s}function Cle(...i){const e=i.map(([a,l])=>typeof l=="function"?[a,l()]:[a,l]),t=e[0][1].constructor,r=e.findIndex(a=>a[0]===!0);if(r===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=e.slice(0,r),s=e[r][1],o=new t(n.reduceRight((a,l)=>Rh(l[0],l[1],a),s));return o.isImplicit=!0,o}function uL(i,e){return Zx("*",i,e)}function Ele(i,e){return Zx("/",i,e)}function lX(i,e){return Zx("+",i,e)}function Ile(i,e){return Zx("-",i,e)}function pXr(i,e){return Zx(">>",i,e)}function fXr(i,e){return Zx("&",i,e)}function Ale(i,e){return Zx("==",i,e,Kx)}function zUt(i,e){return Zx("<",i,e,Kx)}function yCe(i,e){return Zx("<=",i,e,Kx)}function Uv(i,e){return Zx(">",i,e,Kx)}function vCe(i,e){return Zx(">=",i,e,Kx)}function VUt(...i){return i.length<=1?i[0]:i.slice(1).reduce((e,t)=>mXr(e,t),i[0])}function mXr(i,e){return Zx("||",i,e,Kx)}function m9e(...i){return i.length<=1?i[0]:i.slice(1).reduce((e,t)=>gXr(e,t),i[0])}function gXr(i,e){return Zx("&&",i,e,Kx)}function kJe(i){return HS("abs",i)}function LJe(i){return HS("all",i,Kx)}function NJe(i){return HS("any",i,Kx)}function yXr(i){return HS("ceil",i)}function Tq(i,e,t){return FJe("clamp",i,e,t,i.constructor)}function Abe(i){return HS("cos",i)}function $Je(i,e){return p7("distance",i,e,Ni)}function Cq(i,e){return p7("dot",i,e,Ni)}function HUt(i){return HS("floor",i)}function Mbe(i){return HS("fract",i)}function _Ce(i){return HS("length",i,Ni)}function AS(i,e){return p7("max",i,e)}function Eq(i,e){return p7("min",i,e)}function A3(i,e,t){return FJe("mix",i,e,t)}function uX(i,e){return p7("mod",i,e)}function vXr(i){return HS("normalize",i)}function _Xr(i){return i.type==="bool"?HS("!",i):HS("not",i)}function ioe(i){return HS("sin",i)}function WUt(i,e,t){return FJe("smoothstep",i,e,t)}function vm(i,e){return p7("step",i,e,e.constructor)}function rg(i,e){return p7("texture2D",i,e,qo)}const dK=5;function Sy(i,e,t){const r=e.split(` +`).setDebugName("GlslFindIndexBlock")}function Rh(i,e,t){const r=typeof e=="function"?e():e,n=typeof t=="function"?t():t,s=new r.constructor(new QYr(i,r,n));return s.isImplicit=!0,s}function Cle(...i){const e=i.map(([a,l])=>typeof l=="function"?[a,l()]:[a,l]),t=e[0][1].constructor,r=e.findIndex(a=>a[0]===!0);if(r===-1)throw new Error("A cond must have a fallthrough case with `true`/; ");const n=e.slice(0,r),s=e[r][1],o=new t(n.reduceRight((a,l)=>Rh(l[0],l[1],a),s));return o.isImplicit=!0,o}function uL(i,e){return Zx("*",i,e)}function Ele(i,e){return Zx("/",i,e)}function lX(i,e){return Zx("+",i,e)}function Ile(i,e){return Zx("-",i,e)}function cXr(i,e){return Zx(">>",i,e)}function hXr(i,e){return Zx("&",i,e)}function Ale(i,e){return Zx("==",i,e,Kx)}function zUt(i,e){return Zx("<",i,e,Kx)}function yCe(i,e){return Zx("<=",i,e,Kx)}function Uv(i,e){return Zx(">",i,e,Kx)}function vCe(i,e){return Zx(">=",i,e,Kx)}function VUt(...i){return i.length<=1?i[0]:i.slice(1).reduce((e,t)=>dXr(e,t),i[0])}function dXr(i,e){return Zx("||",i,e,Kx)}function m9e(...i){return i.length<=1?i[0]:i.slice(1).reduce((e,t)=>pXr(e,t),i[0])}function pXr(i,e){return Zx("&&",i,e,Kx)}function kJe(i){return HS("abs",i)}function LJe(i){return HS("all",i,Kx)}function NJe(i){return HS("any",i,Kx)}function fXr(i){return HS("ceil",i)}function Tq(i,e,t){return FJe("clamp",i,e,t,i.constructor)}function Abe(i){return HS("cos",i)}function $Je(i,e){return p7("distance",i,e,Ni)}function Cq(i,e){return p7("dot",i,e,Ni)}function HUt(i){return HS("floor",i)}function Mbe(i){return HS("fract",i)}function _Ce(i){return HS("length",i,Ni)}function AS(i,e){return p7("max",i,e)}function Eq(i,e){return p7("min",i,e)}function A3(i,e,t){return FJe("mix",i,e,t)}function uX(i,e){return p7("mod",i,e)}function mXr(i){return HS("normalize",i)}function gXr(i){return i.type==="bool"?HS("!",i):HS("not",i)}function ioe(i){return HS("sin",i)}function WUt(i,e,t){return FJe("smoothstep",i,e,t)}function vm(i,e){return p7("step",i,e,e.constructor)}function rg(i,e){return p7("texture2D",i,e,qo)}const dK=5;function Sy(i,e,t){const r=e.split(` `);for(const n of r)if(n.trim().length){{let s="";t!=null&&(s+=`/*id:${t??"000"}*/ `),i.body+=s.padEnd(14)}i.body+=" ".repeat(i.indent)+n+` `}}let Dmt=class{write(e){for(const t of e.rootOutputNodes())e.shouldPruneOutputNode(t)||(t.variableName=this._write(e,t.node));return e}_createVarName(e,t){let r="";return typeof t!="boolean"&&typeof t!="number"&&t.debugInfo.name&&(r=`${t.debugInfo.name}_`),`${r}v${e.varCount++}`}_write(e,t,r=!1){if(typeof t=="number"||typeof t=="boolean")return t.toString();let n=e.getEmit(t);if(n)return n;switch(t.shaderType){case"scope-node":n=this._writeScopeNode(e,t);break;case"primitive-node":n=this._writePrimitveNode(e,t,r);break;case"function-node":n=this._writeFunctionNode(e,t);break;case"property-access-node":n=this._writePropertyAccessNode(e,t);break;case"text-node":n=t.text;break;case"block-node":n=this._writeBlockNode(e,t);break;case"condition-node":n=this._writeConditionNode(e,t)}return e.setEmit(t,n),n}_writeScopeNode(e,t){const r=new t.child.constructor;r.setDebugName(t.debugInfo.name);const n=this._write(e,r,!0);return Sy(e,`{ /*ScopeStart: ${t.uid} ${t.debugInfo.name}*/`),e.indent+=2,Sy(e,`${n} = ${this._write(e,t.child)};`),e.indent-=2,Sy(e,`} /*ScopeEnd: ${t.uid} ${t.debugInfo.name}*/`),n}_writeConditionNode(e,t){const r=new t.ifTrue.constructor,n=this._write(e,r,!0);Sy(e,`if (${this._write(e,t.condition)}) {`),e.indent+=2;const s=e.createSubgraphContext(),o=this._write(s,t.ifTrue);if(e.body+=s.body,o&&Sy(e,`${n} = ${o};`),e.indent-=2,Sy(e,"}"),t.ifFalse){Sy(e,"else {"),e.indent+=2;const a=e.createSubgraphContext(),l=this._write(a,t.ifFalse);e.body+=a.body,l&&Sy(e,`${n} = ${l};`),e.indent-=2,Sy(e,"}")}return n}_writeBlockNode(e,t){const{captureList:r,generator:n,returnType:s}=t,o={};for(const c in r){if(!r[c])continue;const h=this._write(e,r[c]);o[c]=h}const a=new s,l=this._write(e,a,!0);if(o.out=l,t.subgraph){const c=e.createSubgraphContext(),h=this._write(c,t.subgraph.child),p=c.body;o.subgraph={varName:h,body:p}}const u=n(o);return Sy(e,`{ `),e.indent+=2,Sy(e,u),e.indent-=2,Sy(e,`} @@ -465,35 +465,35 @@ for (int i = ${t}; i < ${r}; i++) { `).join(` `));for(const t of this.rootOutputNodes())this.shouldPruneOutputNode(t)||e.vertex.code.add(` ${t.outVariableName} = ${t.variableName};`);e.vertex.code.add("}")}insertFragmentShader(e){this._insertInputs(e,"fragment"),e.fragment.code.add(""),e.fragment.code.add("void main() {"),e.fragment.code.add(" "+this.body.split(` `).join(` - `));for(const t of this.rootOutputNodes())t.outVariableType==="discard"?(e.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),e.fragment.code.add(` if (${t.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" ")):e.fragment.code.add(` ${t.outVariableName} = ${t.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const r of this.inputs())r.isUsed&&r.variableInputType!=="builtin"&&(r.node.type==="array"?e[t].code.add(`${r.variableInputType.padEnd(10)} ${r.node.elementType.type.padEnd(9)} ${r.variableName}[${r.node.size}];`):e[t].code.add(`${r.variableInputType.padEnd(10)} ${r.node.type.padEnd(9)} ${r.variableName};`))}};const bXr=()=>di.getLogger("esri.views.webgl.checkWebGLError");function wXr(i,e){switch(e){case i.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case i.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case i.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case i.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case i.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case i.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const XUt=!!yi("enable-feature:webgl-debug");function yC(){return XUt}function g9e(){return XUt}function mA(i){if(yC()){const e=i.getError();if(e){const t=wXr(i,e),r=new Error().stack;bXr().error(new qe("webgl-error","WebGL error occurred",{message:t,stack:r}))}}}const LD=()=>di.getLogger("esri.views.webgl.BufferObject");let Aa=class x${static createIndex(e,t,r){return new x$(e,Bs.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new x$(e,Bs.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){return new x$(e,Bs.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=oa.STREAM_READ,r){const n=new x$(e,Bs.PIXEL_PACK_BUFFER,t);return r&&n.setSize(r),n}static createPixelUnpack(e,t=oa.STREAM_DRAW,r){return new x$(e,Bs.PIXEL_UNPACK_BUFFER,t,r)}static createTransformFeedback(e,t=oa.STATIC_DRAW,r){const n=new x$(e,Bs.TRANSFORM_FEEDBACK_BUFFER,t);return n.setSize(r),n}constructor(e,t,r,n){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(bd.BufferObject,this),this._glName=this._context.gl.createBuffer(),mA(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===Bs.ELEMENT_ARRAY_BUFFER?this._indexType===Ti.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===Bs.ELEMENT_ARRAY_BUFFER||this.bufferType===Bs.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(bd.BufferObject,this),this._context=null):this._glName&&LD().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&LD().error("Buffer size needs to be positive!"),this.bufferType===Bs.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case Ti.UNSIGNED_SHORT:e*=2;break;case Ti.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===Bs.ELEMENT_ARRAY_BUFFER&&(Jxe(e)&&(t/=2,this._indexType=Ti.UNSIGNED_SHORT),$Ue(e)&&(t/=4,this._indexType=Ti.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;t!=null?n.bufferData(this.bufferType,t,this.usage):n.bufferData(this.bufferType,e,this.usage),mA(n),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,n){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.usedMemory)&&LD().error("offset is out of range!"),r>=n&&LD().error("end must be bigger than start!"),(t+(n-r))*e.BYTES_PER_ELEMENT>this.usedMemory&&LD().error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,n-r),mA(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,t=0,r,n){if(r<0||n<0)return void LD().error("Problem getting subdata: offset and length were less than zero!");const s=xXr(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(n??0))>e.byteLength)return void LD().error("Problem getting subdata: offset and length exceeded destination size!");t+s*(n??0)>this.usedMemory&&LD().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this.bufferType===Bs.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,Bs.TRANSFORM_FEEDBACK_BUFFER),o.getBufferSubData(Bs.TRANSFORM_FEEDBACK_BUFFER,t,e,r,n),this._context.unbindBuffer(Bs.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,Bs.COPY_READ_BUFFER),o.getBufferSubData(Bs.COPY_READ_BUFFER,t,e,r,n),this._context.unbindBuffer(Bs.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,r,n){await this._context.clientWaitAsync(),this.getSubData(e,t,r,n)}};function xXr(i){return NTt(i)}var Ck;(function(i){i[i.Texture=0]="Texture",i[i.RenderBuffer=1]="RenderBuffer"})(Ck||(Ck={}));function JUt(i){switch(i){case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4}}function KUt(i){const e=i.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function SXr(i,e,t,r,n=0){const s=i.gl;i.bindBuffer(t);for(const o of r){const a=e.get(o.name);if(a===void 0){console.warn(`There is no location for vertex attribute '${o.name}' defined.`);continue}const l=n*o.stride;if(o.count<=4)s.vertexAttribPointer(a,o.count,o.type,o.normalized,o.stride,o.offset+l),s.enableVertexAttribArray(a),o.divisor>0&&i.gl.vertexAttribDivisor(a,o.divisor);else if(o.count===9)for(let u=0;u<3;u++)s.vertexAttribPointer(a+u,3,o.type,o.normalized,o.stride,o.offset+12*u+l),s.enableVertexAttribArray(a+u),o.divisor>0&&i.gl.vertexAttribDivisor(a+u,o.divisor);else if(o.count===16)for(let u=0;u<4;u++)s.vertexAttribPointer(a+u,4,o.type,o.normalized,o.stride,o.offset+16*u+l),s.enableVertexAttribArray(a+u),o.divisor>0&&i.gl?.vertexAttribDivisor(a+u,o.divisor);else console.error("Unsupported vertex attribute element count: "+o.count);if(yC()){const u=KUt(i),c=JUt(o.type),h=o.offset,p=Math.round(c/h)!==c/h?`. Offset not a multiple of stride. DataType requires ${c} bytes, but descriptor has an offset of ${h}`:"";u&&console.error(`Unable to bind vertex attribute "${o.name}" with baseInstanceOffset ${l}${p}:`,u,o)}}}function BJe(i){switch(i){case ks.ALPHA:case ks.LUMINANCE:case ks.RED:case ks.RED_INTEGER:case gs.R8:case gs.R8I:case gs.R8UI:case gs.R8_SNORM:case vf.STENCIL_INDEX8:return 1;case ks.LUMINANCE_ALPHA:case ks.RG:case ks.RG_INTEGER:case gs.RGBA4:case gs.R16F:case gs.R16I:case gs.R16UI:case gs.RG8:case gs.RG8I:case gs.RG8UI:case gs.RG8_SNORM:case gs.RGB565:case gs.RGB5_A1:case vf.DEPTH_COMPONENT16:return 2;case ks.DEPTH_COMPONENT:case ks.RGB:case ks.RGB_INTEGER:case gs.RGB8:case gs.RGB8I:case gs.RGB8UI:case gs.RGB8_SNORM:case gs.SRGB8:case vf.DEPTH_COMPONENT24:return 3;case ks.DEPTH_STENCIL:case ks.DEPTH24_STENCIL8:case ks.RGBA:case ks.RGBA_INTEGER:case gs.RGBA8:case gs.R32F:case gs.R11F_G11F_B10F:case gs.RG16F:case gs.R32I:case gs.R32UI:case gs.RG16I:case gs.RG16UI:case gs.RGBA8I:case gs.RGBA8UI:case gs.RGBA8_SNORM:case gs.SRGB8_ALPHA8:case gs.RGB9_E5:case gs.RGB10_A2UI:case gs.RGB10_A2:case vf.DEPTH_STENCIL:case vf.DEPTH_COMPONENT32F:case vf.DEPTH24_STENCIL8:return 4;case vf.DEPTH32F_STENCIL8:return 5;case gs.RGB16F:case gs.RGB16I:case gs.RGB16UI:return 6;case gs.RG32F:case gs.RG32I:case gs.RG32UI:case gs.RGBA16F:case gs.RGBA16I:case gs.RGBA16UI:return 8;case gs.RGB32F:case gs.RGB32I:case gs.RGB32UI:return 12;case gs.RGBA32F:case gs.RGBA32I:case gs.RGBA32UI:return 16;case Vh.COMPRESSED_RGB_S3TC_DXT1_EXT:case Vh.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case Vh.COMPRESSED_RGBA_S3TC_DXT3_EXT:case Vh.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case Vh.COMPRESSED_R11_EAC:case Vh.COMPRESSED_SIGNED_R11_EAC:case Vh.COMPRESSED_RGB8_ETC2:case Vh.COMPRESSED_SRGB8_ETC2:case Vh.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case Vh.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case Vh.COMPRESSED_RG11_EAC:case Vh.COMPRESSED_SIGNED_RG11_EAC:case Vh.COMPRESSED_RGBA8_ETC2_EAC:case Vh.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let Mle=class{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}};function TXr(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*BJe(i.internalFormat)}let bCe=class{constructor(e,t){this._context=e,this._descriptor=t,this.type=Ck.RenderBuffer,this._context.instanceCounter.increment(bd.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,n,s):r.renderbufferStorage(r.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return TXr(this._descriptor)}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const n=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):n.renderbufferStorage(n.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(bd.Renderbuffer,this),this._context=null)}},Ua=class{constructor(e=0,t=e){this.width=e,this.height=t,this.target=gp.TEXTURE_2D,this.pixelFormat=ks.RGBA,this.dataType=lc.UNSIGNED_BYTE,this.samplingMode=Is.LINEAR,this.wrapMode=Ls.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function CXr(i){return i.width<=0||i.height<=0?0:Math.round(i.width*i.height*(i.hasMipmap?4/3:1)*(i.internalFormat==null?4:BJe(i.internalFormat)))}let EXr=class ZUt extends Ua{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case gs.R16F:case gs.R16I:case gs.R16UI:case gs.R32F:case gs.R32I:case gs.R32UI:case gs.R8_SNORM:case gs.R8:case gs.R8I:case gs.R8UI:this.pixelFormat=ks.RED}}static validate(e,t){return new ZUt(e,t)}};const kmt=4;let fl=class R2{constructor(e,t=null,r=null){if(this.type=Ck.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const n=EXr.validate(e,t);if(!n)throw new qe("Texture descriptor invalid");this._descriptor=n}this._descriptor.target===gp.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return CXr(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(bd.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new qe("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===gp.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=gp.TEXTURE_CUBE_MAP_POSITIVE_X;t<=gp.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context?.gl)return;const r=this._descriptor.context.gl;mA(r),this._glName||(this._glName=r.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(bd.Texture,this)),e===void 0&&(e=null);const n=this._descriptor,s=t??n.target,o=fK(s);e===null&&(n.width=n.width||kmt,n.height=n.height||kmt,o&&(n.depth=n.depth??1));const a=this._descriptor.context.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),cPe(n),this._configurePixelStorage(),mA(r);const l=this._deriveInternalFormat();if($mt(e)){let u="width"in e?e.width:e.codedWidth,c="height"in e?e.height:e.codedHeight;const h=1;e instanceof HTMLVideoElement&&(u=e.videoWidth,c=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,u,c,h),this._texImage(s,0,l,u,c,h,e),mA(r),n.hasMipmap&&this.generateMipmap(),n.width||(n.width=u),n.height||(n.height=c),o&&!n.depth&&(n.depth=h)}else{const{width:u,height:c,depth:h}=n;if(u==null||c==null)throw new qe("Width and height must be specified!");if(o&&h==null)throw new qe("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,u,c,h),dye(e)){const p=e.levels,m=Bmt(s,u,c,h),v=Math.min(m-1,p.length-1);r.texParameteri(n.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,v);const w=l;if(!MXr(w))throw new qe("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((S,I,R,L)=>{const k=p[Math.min(S,p.length-1)];this._compressedTexImage(s,S,w,I,R,L,k)},v)}else this._texImage(s,0,l,u,c,h,e),mA(r),n.hasMipmap&&this.generateMipmap()}Lmt(r,this._descriptor),Nmt(r,this._descriptor),IXr(this._descriptor.context,this._descriptor),mA(r),this._descriptor.context.bindTexture(a,R2.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,n,s,o,a=0){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,u=this._deriveInternalFormat(),{context:c,pixelFormat:h,dataType:p,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new qe("Cannot update immutable texture before allocation!");const w=c.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||n>l.width||s>l.height||t+n>l.width||r+s>l.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:S}=c;a&&S.pixelStorei(S.UNPACK_SKIP_ROWS,a),$mt(o)?S.texSubImage2D(m,e,t,r,n,s,h,p,o):dye(o)?S.compressedTexSubImage2D(m,e,t,r,n,s,u,o.levels[e]):S.texSubImage2D(m,e,t,r,n,s,h,p,o),a&&S.pixelStorei(S.UNPACK_SKIP_ROWS,0),c.bindTexture(w,R2.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,s,o,a,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const u=this._descriptor,c=this._deriveInternalFormat(),{context:h,pixelFormat:p,dataType:m,isImmutable:v,target:w}=u;if(v&&!this._wasImmutablyAllocated)throw new qe("Cannot update immutable texture before allocation!");fK(w)||console.warn("Attempting to set 3D texture data on a non-3D texture");const S=h.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||s>u.width||o>u.height||a>u.depth||t+s>u.width||r+o>u.height||n+a>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:I}=h;if(dye(l))l=l.levels[e],I.compressedTexSubImage3D(w,e,t,r,n,s,o,a,c,l);else{const R=l;I.texSubImage3D(w,e,t,r,n,s,o,a,p,m,R)}h.bindTexture(S,R2.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new qe("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,cPe(e)}e.samplingMode===Is.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=Is.LINEAR_MIPMAP_NEAREST):e.samplingMode===Is.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=Is.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,R2.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,cPe(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(Lmt(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(Nmt(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===ks.DEPTH_STENCIL&&(this._descriptor.internalFormat=ks.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case lc.FLOAT:switch(this._descriptor.pixelFormat){case ks.RGBA:return this._descriptor.internalFormat=gs.RGBA32F;case ks.RGB:return this._descriptor.internalFormat=gs.RGB32F;default:throw new qe("Unable to derive format")}case lc.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case ks.RGBA:return this._descriptor.internalFormat=gs.RGBA8;case ks.RGB:return this._descriptor.internalFormat=gs.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===ks.DEPTH_STENCIL?ks.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,t,r,n,s,o){const{gl:a}=this._descriptor.context;if(!AXr(t))throw new qe("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?Bmt(e,n,s,o):1;if(fK(e)){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,t,n,s,o)}else a.texStorage2D(e,l,t,n,s);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,s,o,a){const l=this._descriptor.context.gl,u=fK(e),{isImmutable:c,pixelFormat:h,dataType:p}=this._descriptor;if(c){if(a!=null){const m=a;if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,s,o,h,p,m)}else l.texSubImage2D(e,t,0,0,n,s,h,p,m)}}else{const m=a;if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,s,o,0,h,p,m)}else l.texImage2D(e,t,r,n,s,0,h,p,m)}}_compressedTexImage(e,t,r,n,s,o,a){const l=this._descriptor.context.gl,u=fK(e);if(this._descriptor.isImmutable){if(a!=null)if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,s,o,r,a)}else l.compressedTexSubImage2D(e,t,0,0,n,s,r,a)}else if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,s,o,0,a)}else l.compressedTexImage2D(e,t,r,n,s,0,a)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const l=a===gp.TEXTURE_3D;if(r==null||n==null||l&&s==null)throw new qe("Missing texture dimensions for mipmap calculation");for(let u=0;e(u,r,n,s),o&&(r!==1||n!==1||l&&s!==1)&&!(u>=t);++u)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(s=Math.max(1,s>>1))}};function cPe(i){(i.width!=null&&i.width<0||i.height!=null&&i.height<0||i.depth!=null&&i.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function Lmt(i,e){let t=e.samplingMode,r=e.samplingMode;t===Is.LINEAR_MIPMAP_NEAREST||t===Is.LINEAR_MIPMAP_LINEAR?(t=Is.LINEAR,e.hasMipmap||(r=Is.LINEAR)):t!==Is.NEAREST_MIPMAP_NEAREST&&t!==Is.NEAREST_MIPMAP_LINEAR||(t=Is.NEAREST,e.hasMipmap||(r=Is.NEAREST)),i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,t),i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,r)}function Nmt(i,e){typeof e.wrapMode=="number"?(i.texParameteri(e.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,e.wrapMode)):(i.texParameteri(e.target,i.TEXTURE_WRAP_S,e.wrapMode.s),i.texParameteri(e.target,i.TEXTURE_WRAP_T,e.wrapMode.t))}function IXr(i,e){const t=i.capabilities.textureFilterAnisotropic;t&&i.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function AXr(i){return i in gs}function MXr(i){return i in Vh}function dye(i){return i!=null&&"type"in i&&i.type==="compressed"}function OXr(i){return i!=null&&"byteLength"in i}function $mt(i){return i!=null&&!dye(i)&&!OXr(i)}function fK(i){return i===gp.TEXTURE_3D||i===gp.TEXTURE_2D_ARRAY}function Bmt(i,e,t,r=1){let n=Math.max(e,t);return i===gp.TEXTURE_3D&&(n=Math.max(n,r)),Math.round(Math.log(n)/Math.LN2)+1}fl.TEXTURE_UNIT_FOR_UPDATES=0;const PXr=()=>di.getLogger("esri.views.webgl.FramebufferObject");let Wd=class Nee{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(bd.FramebufferObject,this);const n=pye(t)?t:new fl(this._context,t);if(this._colorAttachments.set(pv.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(pv.COLOR_ATTACHMENT0),r!=null)if(DXr(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=pye(r)?r:new fl(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=RXr(r)?r:new bCe(this._context,r);this._depthStencilBuffer=s,this._validateRenderBufferDescriptor(s.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((t,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(bd.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&pye(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=pv.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=pv.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(e),t}}setColorTextureTarget(e,t=pv.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case Ck.Texture:return this._attachDepthStencilTexture(e);case Ck.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(e==null)return;const t=e.descriptor;t.pixelFormat!==ks.DEPTH_STENCIL&&t.pixelFormat!==ks.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==lc.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m8e)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m8e)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(Hy.FRAMEBUFFER,n,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(Hy.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,n,s,o,a){(e<0||t<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const l=a.descriptor;a.descriptor.target!==gp.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(l?.width==null||l?.height==null||e+r>this.width||t+n>this.height||s+r>l.width||o+n>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,c=u.bindTexture(a,fl.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(fl.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(gp.TEXTURE_2D,0,s,o,e,t,r,n),u.bindTexture(c,fl.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,n,s,o,a){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,n,s,o,a)}async readPixelsAsync(e,t,r,n,s,o,a){const{gl:l}=this._context,u=Aa.createPixelPack(this._context,oa.STREAM_READ,a.byteLength);this._context.bindBuffer(u),this._context.bindFramebuffer(this),l.readPixels(e,t,r,n,s,o,0),this._context.unbindBuffer(Bs.PIXEL_PACK_BUFFER),await u.getSubDataAsync(a),u.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};jde(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(jde(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=Hy.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((n,s)=>this._framebufferTexture2D(n.glName,s,jmt(n),e)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,n,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,jmt(this._depthStencilTexture),e);yC()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=pv.COLOR_ATTACHMENT0,r=gp.TEXTURE_2D,n=Hy.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,t,r,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(Hy.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=ba(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=ba(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==gp.TEXTURE_2D&&e.target!==gp.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),jde(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){jde(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case vf.DEPTH_COMPONENT16:case vf.DEPTH_COMPONENT24:case vf.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case vf.DEPTH24_STENCIL8:case vf.DEPTH32F_STENCIL8:case vf.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case vf.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(Nee._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;Nee._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const t=e-pv.COLOR_ATTACHMENT0;t+1>Nee._MAX_COLOR_ATTACHMENTS&&di.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Nee._MAX_COLOR_ATTACHMENTS} color attachments`)}};function pye(i){return i!=null&&"type"in i&&i.type===Ck.Texture}function RXr(i){return i!=null&&"type"in i&&i.type===Ck.RenderBuffer}function DXr(i){return pye(i)||i!=null&&"pixelFormat"in i}function jde(i,e){const t=Math.max(i.width,i.height);if(t>e){PXr().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${e}`);const r=e/t;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function jmt(i){return i.descriptor.target===gp.TEXTURE_CUBE_MAP?gp.TEXTURE_CUBE_MAP_POSITIVE_X:gp.TEXTURE_2D}Wd._MAX_COLOR_ATTACHMENTS=-1;const FXr=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var Gmt,QUt={exports:{}};(Gmt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(QUt.exports=Gmt);const kXr=Cg(QUt.exports);var Umt,ezt={exports:{}};Umt=ezt,function(i){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(Umt.exports=e)}();const zmt=Cg(ezt.exports);var tzt={exports:{}};(function(i){(function(e){var t=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();t!==void 0&&(i.exports=t)})()})(tzt);const LXr=Cg(tzt.exports);var wT=999,Vmt=9999,hPe=0,dPe=1,Hmt=2,Wmt=3,qmt=4,Gde=5,NXr=6,$Xr=7,BXr=8,Ymt=9,jXr=10,Xmt=11,GXr=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function UXr(){var i,e,t,r=0,n=0,s=wT,o=[],a=[],l=1,u=0,c=0,h=!1,p=!1,m="";return function(ne){return a=[],ne!==null?w(ne.replace?ne.replace(/\r\n/g,` -`):ne):S()};function v(ne){ne.length&&a.push({type:GXr[s],data:ne,position:c,line:l,column:u})}function w(ne){var de;for(r=0,t=(m+=ne).length;i=m[r],r0)continue;pe=ne.slice(0,1).join("")}return v(pe),c+=pe.length,(o=o.slice(pe.length)).length}}function Y(){return/[^a-fA-F0-9]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function K(){return i==="."||/[eE]/.test(i)?(o.push(i),s=Gde,e=i,r+1):i==="x"&&o.length===1&&o[0]==="0"?(s=Xmt,o.push(i),e=i,r+1):/[^\d]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function Q(){return i==="f"&&(o.push(i),e=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(e)?(o.push(i),e=i,r+1):/[^\d]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function re(){if(/[^\d\w_]/.test(i)){var ne=o.join("");return s=kXr.indexOf(ne)>-1?BXr:LXr.indexOf(ne)>-1?$Xr:NXr,v(o.join("")),s=wT,r}return o.push(i),e=i,r+1}}function zXr(i){var e=UXr(),t=[];return t=(t=t.concat(e(i))).concat(e(null))}function VXr(i){return zXr(i)}function HXr(i){return i.map(e=>e.type!=="eof"?e.data:"").join("")}const pPe=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function WXr(i,e="100",t="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const s=r.exec(n.data);if(s){const o=s[1].replaceAll(/\s\s+/g," ");if(o===t)return o;if(o===e)return n.data="#version "+t,e;throw new Error("unknown glsl version: "+o)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+t},{type:"whitespace",data:` -`}),null}function qXr(i,e){for(let t=e-1;t>=0;t--){const r=i[t];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function $ee(i,e,t,r){r=r||t;for(const n of i)if(n.type==="ident"&&n.data===t)return r in e?e[r]++:e[r]=0,$ee(i,e,r+"_"+e[r],r);return t}function izt(i,e,t="afterVersion"){function r(l,u){for(let c=u;cl=0;--a){const l=t[a];if(l.type==="preprocessor"){const u=l.data.match(/\#extension\s+(.*)\:/);if(u&&u[1]&&pPe.has(u[1].trim())){const p=t[a+1];t.splice(a,p&&p.type==="whitespace"?2:1)}const c=l.data.match(/\#ifdef\s+(.*)/);c&&c[1]&&pPe.has(c[1].trim())&&(l.data="#if 1");const h=l.data.match(/\#ifndef\s+(.*)/);h&&h[1]&&pPe.has(h[1].trim())&&(l.data="#if 0")}}return KXr(i,HXr(t))}function KXr(i,e){return e}const ZXr=4294967295;let wCe=class{constructor(e,t,r,n,s=new Map,o=[]){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._transformFeedbackVaryings=o,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error("RenderingContext isn't initialized!"),t.length===0&&console.error("Shaders source should not be empty!"),t=Jmt(t,sx.VERTEX_SHADER),r=Jmt(r,sx.FRAGMENT_SHADER),this._vShader=Kmt(this._context,sx.VERTEX_SHADER,t),this._fShader=Kmt(this._context,sx.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(bd.Shader,this),g9e()&&(this.vertexShader=t,this.fragmentShader=r),this.usedMemory=t.length+r.length;const a=this._context.gl,l=a.createProgram();a.attachShader(l,this._vShader),a.attachShader(l,this._fShader),this._locations.forEach((u,c)=>a.bindAttribLocation(l,u,c)),this._transformFeedbackVaryings?.length&&a.transformFeedbackVaryings(l,this._transformFeedbackVaryings,a.SEPARATE_ATTRIBS),a.linkProgram(l),g9e()&&!a.getProgramParameter(l,a.LINK_STATUS)&&console.error(`Could not link shader -validated: ${a.getProgramParameter(l,a.VALIDATE_STATUS)}, gl error ${a.getError()}, vertex: ${a.getShaderParameter(this._vShader,a.COMPILE_STATUS)}, fragment: ${a.getShaderParameter(this._fShader,a.COMPILE_STATUS)}, info log: ${a.getProgramInfoLog(l)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[u,c]of this._uniformBlockBindings){const h=a.getUniformBlockIndex(l,u);h0)return;const e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&t.decrement(bd.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(bd.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(bd.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(bd.Program,this))}ref(){++this._refCount}_getUniformLocation(e){const t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,r),r&&this._context.instanceCounter.increment(bd.Uniform,r),r}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t){const r=this._nameToUniform1.get(e);r!==void 0&&t===r||(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t){JE(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t){JE(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t){JE(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t){JE(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t){const r=this._nameToUniform1.get(e);r!==void 0&&t===r||(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t){JE(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,r){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,r),this._nameToUniform2.set(e,[t,r])):t===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),t,r),n[0]=t,n[1]=r)}setUniform2fv(e,t){JE(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,r,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,r,n),this._nameToUniform3.set(e,[t,r,n])):t===s[0]&&r===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),t,r,n),s[0]=t,s[1]=r,s[2]=n)}setUniform3fv(e,t){const r=this._getUniformLocation(e);r!=null&&JE(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,r,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,r,n,s),this._nameToUniform4.set(e,[t,r,n,s])):o!==void 0&&t===o[0]&&r===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),t,r,n,s),o[0]=t,o[1]=r,o[2]=n,o[3]=s)}setUniform4fv(e,t){const r=this._getUniformLocation(e);r!=null&&JE(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,r=!1){const n=this._getUniformLocation(e);n!=null&&JE(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(n,r,t)}setUniformMatrix4fv(e,t,r=!1){const n=this._getUniformLocation(e);n!=null&&JE(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(n,r,t)}stop(){}};function Kmt(i,e,t){const r=i.gl,n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),g9e()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===sx.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(QXr(t))),n}function QXr(i){let e=2;return i.replaceAll(` + `));for(const t of this.rootOutputNodes())t.outVariableType==="discard"?(e.fragment.code.add(" // TODO: Should ensure codegen for discard appears first in fragment shader"),e.fragment.code.add(` if (${t.variableName}) {`),e.fragment.code.add(" discard;"),e.fragment.code.add(" }"),e.fragment.code.add(" ")):e.fragment.code.add(` ${t.outVariableName} = ${t.variableName};`);e.fragment.code.add("}")}_insertInputs(e,t){e[t].code.add("// INPUTS: "),e[t].code.add("// --------------------------------------------------------- ");for(const r of this.inputs())r.isUsed&&r.variableInputType!=="builtin"&&(r.node.type==="array"?e[t].code.add(`${r.variableInputType.padEnd(10)} ${r.node.elementType.type.padEnd(9)} ${r.variableName}[${r.node.size}];`):e[t].code.add(`${r.variableInputType.padEnd(10)} ${r.node.type.padEnd(9)} ${r.variableName};`))}};const yXr=()=>di.getLogger("esri.views.webgl.checkWebGLError");function vXr(i,e){switch(e){case i.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case i.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case i.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case i.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case i.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case i.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const XUt=!!yi("enable-feature:webgl-debug");function yC(){return XUt}function g9e(){return XUt}function mA(i){if(yC()){const e=i.getError();if(e){const t=vXr(i,e),r=new Error().stack;yXr().error(new qe("webgl-error","WebGL error occurred",{message:t,stack:r}))}}}const LD=()=>di.getLogger("esri.views.webgl.BufferObject");let Aa=class x${static createIndex(e,t,r){return new x$(e,Bs.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new x$(e,Bs.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){return new x$(e,Bs.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=oa.STREAM_READ,r){const n=new x$(e,Bs.PIXEL_PACK_BUFFER,t);return r&&n.setSize(r),n}static createPixelUnpack(e,t=oa.STREAM_DRAW,r){return new x$(e,Bs.PIXEL_UNPACK_BUFFER,t,r)}static createTransformFeedback(e,t=oa.STATIC_DRAW,r){const n=new x$(e,Bs.TRANSFORM_FEEDBACK_BUFFER,t);return n.setSize(r),n}constructor(e,t,r,n){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(bd.BufferObject,this),this._glName=this._context.gl.createBuffer(),mA(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===Bs.ELEMENT_ARRAY_BUFFER?this._indexType===Ti.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===Bs.ELEMENT_ARRAY_BUFFER||this.bufferType===Bs.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(bd.BufferObject,this),this._context=null):this._glName&&LD().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&LD().error("Buffer size needs to be positive!"),this.bufferType===Bs.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case Ti.UNSIGNED_SHORT:e*=2;break;case Ti.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===Bs.ELEMENT_ARRAY_BUFFER&&(Jxe(e)&&(t/=2,this._indexType=Ti.UNSIGNED_SHORT),$Ue(e)&&(t/=4,this._indexType=Ti.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;t!=null?n.bufferData(this.bufferType,t,this.usage):n.bufferData(this.bufferType,e,this.usage),mA(n),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,n){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.usedMemory)&&LD().error("offset is out of range!"),r>=n&&LD().error("end must be bigger than start!"),(t+(n-r))*e.BYTES_PER_ELEMENT>this.usedMemory&&LD().error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,n-r),mA(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,t=0,r,n){if(r<0||n<0)return void LD().error("Problem getting subdata: offset and length were less than zero!");const s=_Xr(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(n??0))>e.byteLength)return void LD().error("Problem getting subdata: offset and length exceeded destination size!");t+s*(n??0)>this.usedMemory&&LD().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this.bufferType===Bs.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,Bs.TRANSFORM_FEEDBACK_BUFFER),o.getBufferSubData(Bs.TRANSFORM_FEEDBACK_BUFFER,t,e,r,n),this._context.unbindBuffer(Bs.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,Bs.COPY_READ_BUFFER),o.getBufferSubData(Bs.COPY_READ_BUFFER,t,e,r,n),this._context.unbindBuffer(Bs.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,r,n){await this._context.clientWaitAsync(),this.getSubData(e,t,r,n)}};function _Xr(i){return NTt(i)}var Ck;(function(i){i[i.Texture=0]="Texture",i[i.RenderBuffer=1]="RenderBuffer"})(Ck||(Ck={}));function JUt(i){switch(i){case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4}}function KUt(i){const e=i.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function bXr(i,e,t,r,n=0){const s=i.gl;i.bindBuffer(t);for(const o of r){const a=e.get(o.name);if(a===void 0){console.warn(`There is no location for vertex attribute '${o.name}' defined.`);continue}const l=n*o.stride;if(o.count<=4)s.vertexAttribPointer(a,o.count,o.type,o.normalized,o.stride,o.offset+l),s.enableVertexAttribArray(a),o.divisor>0&&i.gl.vertexAttribDivisor(a,o.divisor);else if(o.count===9)for(let u=0;u<3;u++)s.vertexAttribPointer(a+u,3,o.type,o.normalized,o.stride,o.offset+12*u+l),s.enableVertexAttribArray(a+u),o.divisor>0&&i.gl.vertexAttribDivisor(a+u,o.divisor);else if(o.count===16)for(let u=0;u<4;u++)s.vertexAttribPointer(a+u,4,o.type,o.normalized,o.stride,o.offset+16*u+l),s.enableVertexAttribArray(a+u),o.divisor>0&&i.gl?.vertexAttribDivisor(a+u,o.divisor);else console.error("Unsupported vertex attribute element count: "+o.count);if(yC()){const u=KUt(i),c=JUt(o.type),h=o.offset,p=Math.round(c/h)!==c/h?`. Offset not a multiple of stride. DataType requires ${c} bytes, but descriptor has an offset of ${h}`:"";u&&console.error(`Unable to bind vertex attribute "${o.name}" with baseInstanceOffset ${l}${p}:`,u,o)}}}function BJe(i){switch(i){case ks.ALPHA:case ks.LUMINANCE:case ks.RED:case ks.RED_INTEGER:case gs.R8:case gs.R8I:case gs.R8UI:case gs.R8_SNORM:case vf.STENCIL_INDEX8:return 1;case ks.LUMINANCE_ALPHA:case ks.RG:case ks.RG_INTEGER:case gs.RGBA4:case gs.R16F:case gs.R16I:case gs.R16UI:case gs.RG8:case gs.RG8I:case gs.RG8UI:case gs.RG8_SNORM:case gs.RGB565:case gs.RGB5_A1:case vf.DEPTH_COMPONENT16:return 2;case ks.DEPTH_COMPONENT:case ks.RGB:case ks.RGB_INTEGER:case gs.RGB8:case gs.RGB8I:case gs.RGB8UI:case gs.RGB8_SNORM:case gs.SRGB8:case vf.DEPTH_COMPONENT24:return 3;case ks.DEPTH_STENCIL:case ks.DEPTH24_STENCIL8:case ks.RGBA:case ks.RGBA_INTEGER:case gs.RGBA8:case gs.R32F:case gs.R11F_G11F_B10F:case gs.RG16F:case gs.R32I:case gs.R32UI:case gs.RG16I:case gs.RG16UI:case gs.RGBA8I:case gs.RGBA8UI:case gs.RGBA8_SNORM:case gs.SRGB8_ALPHA8:case gs.RGB9_E5:case gs.RGB10_A2UI:case gs.RGB10_A2:case vf.DEPTH_STENCIL:case vf.DEPTH_COMPONENT32F:case vf.DEPTH24_STENCIL8:return 4;case vf.DEPTH32F_STENCIL8:return 5;case gs.RGB16F:case gs.RGB16I:case gs.RGB16UI:return 6;case gs.RG32F:case gs.RG32I:case gs.RG32UI:case gs.RGBA16F:case gs.RGBA16I:case gs.RGBA16UI:return 8;case gs.RGB32F:case gs.RGB32I:case gs.RGB32UI:return 12;case gs.RGBA32F:case gs.RGBA32I:case gs.RGBA32UI:return 16;case Vh.COMPRESSED_RGB_S3TC_DXT1_EXT:case Vh.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case Vh.COMPRESSED_RGBA_S3TC_DXT3_EXT:case Vh.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case Vh.COMPRESSED_R11_EAC:case Vh.COMPRESSED_SIGNED_R11_EAC:case Vh.COMPRESSED_RGB8_ETC2:case Vh.COMPRESSED_SRGB8_ETC2:case Vh.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case Vh.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case Vh.COMPRESSED_RG11_EAC:case Vh.COMPRESSED_SIGNED_RG11_EAC:case Vh.COMPRESSED_RGBA8_ETC2_EAC:case Vh.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let Mle=class{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}};function wXr(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*BJe(i.internalFormat)}let bCe=class{constructor(e,t){this._context=e,this._descriptor=t,this.type=Ck.RenderBuffer,this._context.instanceCounter.increment(bd.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:a}=t;a?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,n,s):r.renderbufferStorage(r.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return wXr(this._descriptor)}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const n=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):n.renderbufferStorage(n.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(bd.Renderbuffer,this),this._context=null)}},Ua=class{constructor(e=0,t=e){this.width=e,this.height=t,this.target=gp.TEXTURE_2D,this.pixelFormat=ks.RGBA,this.dataType=lc.UNSIGNED_BYTE,this.samplingMode=Is.LINEAR,this.wrapMode=Ls.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function xXr(i){return i.width<=0||i.height<=0?0:Math.round(i.width*i.height*(i.hasMipmap?4/3:1)*(i.internalFormat==null?4:BJe(i.internalFormat)))}let SXr=class ZUt extends Ua{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case gs.R16F:case gs.R16I:case gs.R16UI:case gs.R32F:case gs.R32I:case gs.R32UI:case gs.R8_SNORM:case gs.R8:case gs.R8I:case gs.R8UI:this.pixelFormat=ks.RED}}static validate(e,t){return new ZUt(e,t)}};const kmt=4;let fl=class R2{constructor(e,t=null,r=null){if(this.type=Ck.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const n=SXr.validate(e,t);if(!n)throw new qe("Texture descriptor invalid");this._descriptor=n}this._descriptor.target===gp.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return xXr(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(bd.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new qe("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===gp.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=gp.TEXTURE_CUBE_MAP_POSITIVE_X;t<=gp.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){if(!this._descriptor.context?.gl)return;const r=this._descriptor.context.gl;mA(r),this._glName||(this._glName=r.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(bd.Texture,this)),e===void 0&&(e=null);const n=this._descriptor,s=t??n.target,o=fK(s);e===null&&(n.width=n.width||kmt,n.height=n.height||kmt,o&&(n.depth=n.depth??1));const a=this._descriptor.context.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),cPe(n),this._configurePixelStorage(),mA(r);const l=this._deriveInternalFormat();if($mt(e)){let u="width"in e?e.width:e.codedWidth,c="height"in e?e.height:e.codedHeight;const h=1;e instanceof HTMLVideoElement&&(u=e.videoWidth,c=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,u,c,h),this._texImage(s,0,l,u,c,h,e),mA(r),n.hasMipmap&&this.generateMipmap(),n.width||(n.width=u),n.height||(n.height=c),o&&!n.depth&&(n.depth=h)}else{const{width:u,height:c,depth:h}=n;if(u==null||c==null)throw new qe("Width and height must be specified!");if(o&&h==null)throw new qe("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,l,n.hasMipmap,u,c,h),dye(e)){const p=e.levels,m=Bmt(s,u,c,h),v=Math.min(m-1,p.length-1);r.texParameteri(n.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,v);const w=l;if(!EXr(w))throw new qe("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((S,I,R,L)=>{const k=p[Math.min(S,p.length-1)];this._compressedTexImage(s,S,w,I,R,L,k)},v)}else this._texImage(s,0,l,u,c,h,e),mA(r),n.hasMipmap&&this.generateMipmap()}Lmt(r,this._descriptor),Nmt(r,this._descriptor),TXr(this._descriptor.context,this._descriptor),mA(r),this._descriptor.context.bindTexture(a,R2.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,r,n,s,o,a=0){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,u=this._deriveInternalFormat(),{context:c,pixelFormat:h,dataType:p,target:m,isImmutable:v}=l;if(v&&!this._wasImmutablyAllocated)throw new qe("Cannot update immutable texture before allocation!");const w=c.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||n>l.width||s>l.height||t+n>l.width||r+s>l.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:S}=c;a&&S.pixelStorei(S.UNPACK_SKIP_ROWS,a),$mt(o)?S.texSubImage2D(m,e,t,r,n,s,h,p,o):dye(o)?S.compressedTexSubImage2D(m,e,t,r,n,s,u,o.levels[e]):S.texSubImage2D(m,e,t,r,n,s,h,p,o),a&&S.pixelStorei(S.UNPACK_SKIP_ROWS,0),c.bindTexture(w,R2.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,s,o,a,l){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const u=this._descriptor,c=this._deriveInternalFormat(),{context:h,pixelFormat:p,dataType:m,isImmutable:v,target:w}=u;if(v&&!this._wasImmutablyAllocated)throw new qe("Cannot update immutable texture before allocation!");fK(w)||console.warn("Attempting to set 3D texture data on a non-3D texture");const S=h.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||s>u.width||o>u.height||a>u.depth||t+s>u.width||r+o>u.height||n+a>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:I}=h;if(dye(l))l=l.levels[e],I.compressedTexSubImage3D(w,e,t,r,n,s,o,a,c,l);else{const R=l;I.texSubImage3D(w,e,t,r,n,s,o,a,p,m,R)}h.bindTexture(S,R2.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new qe("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,cPe(e)}e.samplingMode===Is.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=Is.LINEAR_MIPMAP_NEAREST):e.samplingMode===Is.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=Is.NEAREST_MIPMAP_NEAREST);const t=this._descriptor.context.bindTexture(this,R2.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(R2.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,R2.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,cPe(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(Lmt(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(Nmt(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===ks.DEPTH_STENCIL&&(this._descriptor.internalFormat=ks.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case lc.FLOAT:switch(this._descriptor.pixelFormat){case ks.RGBA:return this._descriptor.internalFormat=gs.RGBA32F;case ks.RGB:return this._descriptor.internalFormat=gs.RGB32F;default:throw new qe("Unable to derive format")}case lc.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case ks.RGBA:return this._descriptor.internalFormat=gs.RGBA8;case ks.RGB:return this._descriptor.internalFormat=gs.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===ks.DEPTH_STENCIL?ks.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,t,r,n,s,o){const{gl:a}=this._descriptor.context;if(!CXr(t))throw new qe("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?Bmt(e,n,s,o):1;if(fK(e)){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,t,n,s,o)}else a.texStorage2D(e,l,t,n,s);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,s,o,a){const l=this._descriptor.context.gl,u=fK(e),{isImmutable:c,pixelFormat:h,dataType:p}=this._descriptor;if(c){if(a!=null){const m=a;if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,s,o,h,p,m)}else l.texSubImage2D(e,t,0,0,n,s,h,p,m)}}else{const m=a;if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,s,o,0,h,p,m)}else l.texImage2D(e,t,r,n,s,0,h,p,m)}}_compressedTexImage(e,t,r,n,s,o,a){const l=this._descriptor.context.gl,u=fK(e);if(this._descriptor.isImmutable){if(a!=null)if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,s,o,r,a)}else l.compressedTexSubImage2D(e,t,0,0,n,s,r,a)}else if(u){if(o==null)throw new qe("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,s,o,0,a)}else l.compressedTexImage2D(e,t,r,n,s,0,a)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const l=a===gp.TEXTURE_3D;if(r==null||n==null||l&&s==null)throw new qe("Missing texture dimensions for mipmap calculation");for(let u=0;e(u,r,n,s),o&&(r!==1||n!==1||l&&s!==1)&&!(u>=t);++u)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(s=Math.max(1,s>>1))}};function cPe(i){(i.width!=null&&i.width<0||i.height!=null&&i.height<0||i.depth!=null&&i.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function Lmt(i,e){let t=e.samplingMode,r=e.samplingMode;t===Is.LINEAR_MIPMAP_NEAREST||t===Is.LINEAR_MIPMAP_LINEAR?(t=Is.LINEAR,e.hasMipmap||(r=Is.LINEAR)):t!==Is.NEAREST_MIPMAP_NEAREST&&t!==Is.NEAREST_MIPMAP_LINEAR||(t=Is.NEAREST,e.hasMipmap||(r=Is.NEAREST)),i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,t),i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,r)}function Nmt(i,e){typeof e.wrapMode=="number"?(i.texParameteri(e.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,e.wrapMode)):(i.texParameteri(e.target,i.TEXTURE_WRAP_S,e.wrapMode.s),i.texParameteri(e.target,i.TEXTURE_WRAP_T,e.wrapMode.t))}function TXr(i,e){const t=i.capabilities.textureFilterAnisotropic;t&&i.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function CXr(i){return i in gs}function EXr(i){return i in Vh}function dye(i){return i!=null&&"type"in i&&i.type==="compressed"}function IXr(i){return i!=null&&"byteLength"in i}function $mt(i){return i!=null&&!dye(i)&&!IXr(i)}function fK(i){return i===gp.TEXTURE_3D||i===gp.TEXTURE_2D_ARRAY}function Bmt(i,e,t,r=1){let n=Math.max(e,t);return i===gp.TEXTURE_3D&&(n=Math.max(n,r)),Math.round(Math.log(n)/Math.LN2)+1}fl.TEXTURE_UNIT_FOR_UPDATES=0;const AXr=()=>di.getLogger("esri.views.webgl.FramebufferObject");let Wd=class Nee{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(bd.FramebufferObject,this);const n=pye(t)?t:new fl(this._context,t);if(this._colorAttachments.set(pv.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(pv.COLOR_ATTACHMENT0),r!=null)if(OXr(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=pye(r)?r:new fl(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=MXr(r)?r:new bCe(this._context,r);this._depthStencilBuffer=s,this._validateRenderBufferDescriptor(s.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((t,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(bd.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(pv.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&pye(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=pv.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=pv.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(e),t}}setColorTextureTarget(e,t=pv.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case Ck.Texture:return this._attachDepthStencilTexture(e);case Ck.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(e==null)return;const t=e.descriptor;t.pixelFormat!==ks.DEPTH_STENCIL&&t.pixelFormat!==ks.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==lc.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m8e)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m8e)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(Hy.FRAMEBUFFER,n,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(Hy.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,n,s,o,a){(e<0||t<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const l=a.descriptor;a.descriptor.target!==gp.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(l?.width==null||l?.height==null||e+r>this.width||t+n>this.height||s+r>l.width||o+n>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,c=u.bindTexture(a,fl.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(fl.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(gp.TEXTURE_2D,0,s,o,e,t,r,n),u.bindTexture(c,fl.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,n,s,o,a){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,n,s,o,a)}async readPixelsAsync(e,t,r,n,s,o,a){const{gl:l}=this._context,u=Aa.createPixelPack(this._context,oa.STREAM_READ,a.byteLength);this._context.bindBuffer(u),this._context.bindFramebuffer(this),l.readPixels(e,t,r,n,s,o,0),this._context.unbindBuffer(Bs.PIXEL_PACK_BUFFER),await u.getSubDataAsync(a),u.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};jde(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(jde(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=Hy.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((n,s)=>this._framebufferTexture2D(n.glName,s,jmt(n),e)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,n,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,jmt(this._depthStencilTexture),e);yC()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=pv.COLOR_ATTACHMENT0,r=gp.TEXTURE_2D,n=Hy.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,t,r,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(Hy.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=ba(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=ba(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==gp.TEXTURE_2D&&e.target!==gp.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),jde(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){jde(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case vf.DEPTH_COMPONENT16:case vf.DEPTH_COMPONENT24:case vf.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case vf.DEPTH24_STENCIL8:case vf.DEPTH32F_STENCIL8:case vf.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case vf.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(Nee._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;Nee._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const t=e-pv.COLOR_ATTACHMENT0;t+1>Nee._MAX_COLOR_ATTACHMENTS&&di.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Nee._MAX_COLOR_ATTACHMENTS} color attachments`)}};function pye(i){return i!=null&&"type"in i&&i.type===Ck.Texture}function MXr(i){return i!=null&&"type"in i&&i.type===Ck.RenderBuffer}function OXr(i){return pye(i)||i!=null&&"pixelFormat"in i}function jde(i,e){const t=Math.max(i.width,i.height);if(t>e){AXr().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${e}`);const r=e/t;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function jmt(i){return i.descriptor.target===gp.TEXTURE_CUBE_MAP?gp.TEXTURE_CUBE_MAP_POSITIVE_X:gp.TEXTURE_2D}Wd._MAX_COLOR_ATTACHMENTS=-1;const PXr=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var Gmt,QUt={exports:{}};(Gmt=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(QUt.exports=Gmt);const RXr=Cg(QUt.exports);var Umt,ezt={exports:{}};Umt=ezt,function(i){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(Umt.exports=e)}();const zmt=Cg(ezt.exports);var tzt={exports:{}};(function(i){(function(e){var t=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();t!==void 0&&(i.exports=t)})()})(tzt);const DXr=Cg(tzt.exports);var wT=999,Vmt=9999,hPe=0,dPe=1,Hmt=2,Wmt=3,qmt=4,Gde=5,FXr=6,kXr=7,LXr=8,Ymt=9,NXr=10,Xmt=11,$Xr=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function BXr(){var i,e,t,r=0,n=0,s=wT,o=[],a=[],l=1,u=0,c=0,h=!1,p=!1,m="";return function(ne){return a=[],ne!==null?w(ne.replace?ne.replace(/\r\n/g,` +`):ne):S()};function v(ne){ne.length&&a.push({type:$Xr[s],data:ne,position:c,line:l,column:u})}function w(ne){var de;for(r=0,t=(m+=ne).length;i=m[r],r0)continue;pe=ne.slice(0,1).join("")}return v(pe),c+=pe.length,(o=o.slice(pe.length)).length}}function Y(){return/[^a-fA-F0-9]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function K(){return i==="."||/[eE]/.test(i)?(o.push(i),s=Gde,e=i,r+1):i==="x"&&o.length===1&&o[0]==="0"?(s=Xmt,o.push(i),e=i,r+1):/[^\d]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function Q(){return i==="f"&&(o.push(i),e=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(e)?(o.push(i),e=i,r+1):/[^\d]/.test(i)?(v(o.join("")),s=wT,r):(o.push(i),e=i,r+1)}function re(){if(/[^\d\w_]/.test(i)){var ne=o.join("");return s=RXr.indexOf(ne)>-1?LXr:DXr.indexOf(ne)>-1?kXr:FXr,v(o.join("")),s=wT,r}return o.push(i),e=i,r+1}}function jXr(i){var e=BXr(),t=[];return t=(t=t.concat(e(i))).concat(e(null))}function GXr(i){return jXr(i)}function UXr(i){return i.map(e=>e.type!=="eof"?e.data:"").join("")}const pPe=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function zXr(i,e="100",t="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const s=r.exec(n.data);if(s){const o=s[1].replaceAll(/\s\s+/g," ");if(o===t)return o;if(o===e)return n.data="#version "+t,e;throw new Error("unknown glsl version: "+o)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+t},{type:"whitespace",data:` +`}),null}function VXr(i,e){for(let t=e-1;t>=0;t--){const r=i[t];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function $ee(i,e,t,r){r=r||t;for(const n of i)if(n.type==="ident"&&n.data===t)return r in e?e[r]++:e[r]=0,$ee(i,e,r+"_"+e[r],r);return t}function izt(i,e,t="afterVersion"){function r(l,u){for(let c=u;cl=0;--a){const l=t[a];if(l.type==="preprocessor"){const u=l.data.match(/\#extension\s+(.*)\:/);if(u&&u[1]&&pPe.has(u[1].trim())){const p=t[a+1];t.splice(a,p&&p.type==="whitespace"?2:1)}const c=l.data.match(/\#ifdef\s+(.*)/);c&&c[1]&&pPe.has(c[1].trim())&&(l.data="#if 1");const h=l.data.match(/\#ifndef\s+(.*)/);h&&h[1]&&pPe.has(h[1].trim())&&(l.data="#if 0")}}return YXr(i,UXr(t))}function YXr(i,e){return e}const XXr=4294967295;let wCe=class{constructor(e,t,r,n,s=new Map,o=[]){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._transformFeedbackVaryings=o,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error("RenderingContext isn't initialized!"),t.length===0&&console.error("Shaders source should not be empty!"),t=Jmt(t,sx.VERTEX_SHADER),r=Jmt(r,sx.FRAGMENT_SHADER),this._vShader=Kmt(this._context,sx.VERTEX_SHADER,t),this._fShader=Kmt(this._context,sx.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(bd.Shader,this),g9e()&&(this.vertexShader=t,this.fragmentShader=r),this.usedMemory=t.length+r.length;const a=this._context.gl,l=a.createProgram();a.attachShader(l,this._vShader),a.attachShader(l,this._fShader),this._locations.forEach((u,c)=>a.bindAttribLocation(l,u,c)),this._transformFeedbackVaryings?.length&&a.transformFeedbackVaryings(l,this._transformFeedbackVaryings,a.SEPARATE_ATTRIBS),a.linkProgram(l),g9e()&&!a.getProgramParameter(l,a.LINK_STATUS)&&console.error(`Could not link shader +validated: ${a.getProgramParameter(l,a.VALIDATE_STATUS)}, gl error ${a.getError()}, vertex: ${a.getShaderParameter(this._vShader,a.COMPILE_STATUS)}, fragment: ${a.getShaderParameter(this._fShader,a.COMPILE_STATUS)}, info log: ${a.getProgramInfoLog(l)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(const[u,c]of this._uniformBlockBindings){const h=a.getUniformBlockIndex(l,u);h0)return;const e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&t.decrement(bd.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(bd.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(bd.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(bd.Program,this))}ref(){++this._refCount}_getUniformLocation(e){const t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,r),r&&this._context.instanceCounter.increment(bd.Uniform,r),r}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t){const r=this._nameToUniform1.get(e);r!==void 0&&t===r||(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t){JE(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t){JE(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t){JE(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t){JE(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t){const r=this._nameToUniform1.get(e);r!==void 0&&t===r||(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t){JE(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,r){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,r),this._nameToUniform2.set(e,[t,r])):t===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),t,r),n[0]=t,n[1]=r)}setUniform2fv(e,t){JE(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,r,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,r,n),this._nameToUniform3.set(e,[t,r,n])):t===s[0]&&r===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),t,r,n),s[0]=t,s[1]=r,s[2]=n)}setUniform3fv(e,t){const r=this._getUniformLocation(e);r!=null&&JE(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,r,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,r,n,s),this._nameToUniform4.set(e,[t,r,n,s])):o!==void 0&&t===o[0]&&r===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),t,r,n,s),o[0]=t,o[1]=r,o[2]=n,o[3]=s)}setUniform4fv(e,t){const r=this._getUniformLocation(e);r!=null&&JE(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,r=!1){const n=this._getUniformLocation(e);n!=null&&JE(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(n,r,t)}setUniformMatrix4fv(e,t,r=!1){const n=this._getUniformLocation(e);n!=null&&JE(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(n,r,t)}stop(){}};function Kmt(i,e,t){const r=i.gl,n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),g9e()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===sx.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(JXr(t))),n}function JXr(i){let e=2;return i.replaceAll(` `,()=>` -`+eJr(e++)+":")}function eJr(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function JE(i,e,t){const r=i.get(e);if(!r)return i.set(e,Array.from(t)),!0;const n=t.length;if(r.length!==n)return i.set(e,Array.from(t)),!0;for(let s=0;sdi.getLogger("esri.views.2d.engine.webgl.Utils");function tJr(i){switch(i){case lc.UNSIGNED_BYTE:return 1;case lc.UNSIGNED_SHORT_4_4_4_4:return 2;case lc.FLOAT:return 4;default:return void rzt().error(new qe("webgl-utils",`Unable to handle type ${i}`))}}function Bee(i){switch(i){case lc.UNSIGNED_BYTE:return Uint8Array;case lc.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case lc.FLOAT:return Float32Array;default:return void rzt().error(new qe("webgl-utils",`Unable to handle type ${i}`))}}function iJr(i){const e={};for(const t in i){const r=i[t];let n=0;e[t]=r.map(s=>{const o=new Vl(s.name,s.count,s.type,n,0,s.normalized||!1);return n+=s.count*JUt(s.type),o}),e[t]?.forEach(s=>s.stride=n)}return e}const rJr=i=>{const e=new Map;for(const t in i)for(const r of i[t])e.set(r.name,r.location);return e},nJr=i=>{const e={};for(const t in i){const r=i[t];e[t]=r?.length?r[0].stride:0}return e},fPe=new Map,xCe=(i,e)=>{if(!fPe.has(i)){const t=iJr(e),r={strides:nJr(t),bufferLayouts:t,attributes:rJr(e)};fPe.set(i,r)}return fPe.get(i)},sJr=i=>i.includes("data:image/svg+xml");function oJr(i){const e=[];for(let t=0;tdi.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function mK(i,e,t){const r=e.length;if(r!==t){const n=new qe("Invalid Uniform",`Invalid length, expected ${t} but got ${r}`,{uniformName:i,values:e});lJr().errorOnce(n)}}let y9e=class{constructor(e,t,r,n,s,o){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=r,this._locationInfo=n,this._uniformBindings=s,this._transformFeedbackBindings=o}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const n=new Map;for(const[o,a]of this._locations)n.set(o,a);const s=[];for(const o of this._transformFeedbackBindings??[]){const{index:a,propertyKey:l}=o;s[a]=`v_${l}`}this._program=new wCe(e,this.vertexShader,this.fragmentShader,n,new Map,s)}const r=this._program;e.useProgram(r);for(const n of this._uniformBindings){const{shaderModulePath:s,uniformName:o,uniformType:a,uniformArrayLength:l}=n,u=uS(s,t);if(u==null){if(a==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${s}`)}switch(a==="array"?n.uniformArrayElementType:a){case"sampler2D":{const{unit:c,texture:h}=u;if(r.setUniform1i(o,c),"type"in h)e.bindTexture(h,c);else{const p=aJr(e,h.descriptor,h.data);e.bindTexture(p,c)}break}case"int":if(!l){r.setUniform1i(o,u);break}mK(n.uniformName,u,l),r.setUniform1iv(o,u);break;case"float":if(!l){r.setUniform1f(o,u);break}mK(n.uniformName,u,l),r.setUniform1fv(o,u);break;case"vec2":if(!l){r.setUniform2f(o,u[0],u[1]);break}mK(n.uniformName,u,l),r.setUniform2fv(o,u.flat());break;case"vec3":if(!l){r.setUniform3f(o,u[0],u[1],u[2]);break}mK(n.uniformName,u,l),r.setUniform3fv(o,u.flat());break;case"vec4":if(!l){r.setUniform4f(o,u[0],u[1],u[2],u[3]);break}mK(n.uniformName,u,l),r.setUniform4fv(o,u.flat());break;case"mat3":r.setUniformMatrix3fv(o,u.flat());break;case"mat4":r.setUniformMatrix4fv(o,u.flat());break;default:throw new Error(`Unable to set uniform for type ${a}`)}}}};function gK(i){return new i}function cX(i,e,t){const r=i.constructor[e]??[];i.constructor.hasOwnProperty(e)||Object.defineProperty(i.constructor,e,{value:r.slice()}),i.constructor[e].push(t)}function Ns(i,e){return(t,r)=>{cX(t,"locations",{typeCtor:e,propertyKey:r,parameterIndex:null,index:i})}}const uJr=i=>(e,t)=>{cX(e,"builtins",{builtin:i,propertyKey:t})},bu=i=>(e,t,r)=>{cX(e,"inputs",{inputCtor:i,propertyKey:t,parameterIndex:r})},zn=i=>(e,t)=>{cX(e,"uniforms",{typeCtor:i,propertyKey:t})},jc=i=>(e,t)=>{cX(e,"options",{typeCtor:i,propertyKey:t})},DF=(i,e)=>{cX(i,"defines",{propertyKey:e})},v9e=(i,e)=>(t,r)=>{t.constructor.builtins.push({builtin:i,propertyKey:r,typeCtor:e})};let roe=class{};roe.builtins=[],x([v9e("gl_VertexID",rE)],roe.prototype,"glVertexID",void 0);let jJe=class{},fH=class{};fH.builtins=[],x([v9e("gl_FragCoord",qo)],fH.prototype,"glFragCoord",void 0),x([v9e("gl_PointCoord",As)],fH.prototype,"glPointCoord",void 0);let Ole=class{};x([uJr("gl_FragColor")],Ole.prototype,"glFragColor",void 0);let Lf=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},GJe=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=zAe(this._shaderModuleClass.inputs,t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return zAe(this._shaderModuleClass.inputs,e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=zAe(this._shaderModuleClass.inputs,t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const r of this.locations)t.has(r.index)?di.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${r.propertyKey} to ${r.index}. Index already in use`,{locationsMap:e}):(e.set(r.propertyKey,r.index),t.add(r.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,s])=>`${n}.${s}`).join("."),r=Q1(t);this._locationInfo={hash:r,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,r,n){try{const{vertex:s,fragment:o,uniformBindings:a}=this._generateShaders(e,t,r,n);return new y9e(s,o,this.renamedLocationsMap,this.locationInfo,a,this.transformFeedbackBindings)}catch(s){return console.error("Failed to create program",{error:s}),new y9e("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(n=>n.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const r=this._uniforms.find(n=>n.propertyKey===e);if(!r)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:r.typeCtor}}getShaderKey(e,t,r,n){const s=Object.keys(r).map(l=>`${l}.${r[l]}`).join("."),o=Object.keys(n).map(l=>`${l}.${n[l]}`).join("."),a=Object.keys(t).filter(l=>this.optionPropertyKeys.has(l)&&t[l]).join(".");return`${this.constructor.name}.${e.hash}.${s}.${o}.${a}`}_generateShaders(e,t,r,n){const s=[];this._setDefines(r),this._setOptionalUniforms(s,t),this._setRequiredUniforms(s);const o=this._hydrateVertexInput(n),a=this._injectPackPrecisionFactor(o,e),l=this._hydrateComputeInput(),u=l&&this._injectPackPrecisionFactor(l,e),c=this.vertex(a,u),h=this._hydrateFragmentInput(c),p=this.fragment(h),m=new Set;for(const B in p){const $=p[B];QYr(m,$)}const v=this._getVertexInputBuiltins(),w=Fmt.createVertex({...o,...l},c,v,s,this.transformFeedbackBindings,m);new Dmt().write(w);const S=this._getFragmentInputBuiltins(p);S.set("glPointCoord","gl_PointCoord");const I=Fmt.createFragment(h,p,S,s,w,this.transformFeedbackBindings);new Dmt().write(I);const R=this._createShaderBuilder(w,I),L=R.generate("vertex",!1),k=R.generate("fragment",!1);return this.logShader&&(console.log(L),console.log(k)),{vertex:L,fragment:k,uniformBindings:s}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const r of this._options)t[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(e,r):this[r.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const r=new t.typeCtor;for(const n of r._uniforms??[]){const s=gK(n.typeCtor),o=`u_${t.propertyKey}_${n.propertyKey}`,a=s.type,l=[t.propertyKey,n.propertyKey].join(".");if("type"in n.typeCtor&&n.typeCtor.type==="array"){const u=s;e.push({shaderModulePath:l,uniformName:o,uniformType:a,uniformArrayLength:u.size,uniformArrayElementType:u.elementType.type,uniformHydrated:s})}else e.push({shaderModulePath:l,uniformName:o,uniformType:a,uniformHydrated:s});r[n.propertyKey]=s}return r}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,r=t.locations.reduce((n,s)=>e[s.propertyKey]===!1?n:{...n,[s.propertyKey]:gK(s.typeCtor)},{});for(const{propertyKey:n,typeCtor:s}of t.builtins){const o=gK(s);r[n]=o}return r}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:gK(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const r={};for(const n in e){const s=e[n],o=t.attributes.find(a=>a.name===n);if(o?.packPrecisionFactor){if(s.type!=="float"&&s.type!=="vec2"&&s.type!=="vec3"&&s.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new Ni(o.packPrecisionFactor))}else r[n]=s}return r}_hydrateFragmentInput(e){const t={};for(const r in e)t[r]=e[r];for(const{propertyKey:r,typeCtor:n}of fH.builtins){const s=gK(n);t[r]=s}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:r,propertyKey:n}of e.builtins)t.set(n,r);return t}_getFragmentInputBuiltins(e){const t=e.constructor,r=new Map;for(const n of t.builtins??[])r.set(n.propertyKey,n.builtin);return r}_createShaderBuilder(e,t){const r=new HYr;return this._insertDebugInfo(r),e.insertVertexShader(r),t.insertFragmentShader(r),r}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};const sV={selection:i=>new tse({color:new jr([i.color.r/2,i.color.g/2,i.color.b/2,i.color.a])}),highlight:i=>i,popup:i=>new tse({color:new jr([i.color.g,i.color.b,i.color.r,i.color.a])})};function SCe(i){if(!i)return 0;let e=1;for(const t in sV){if(t===i)break;e<<=1}return e}const g9=Object.keys(sV);function Zmt(i){const e=zp(12.9898),t=zp(78.233),r=zp(43758.5453),n=Cq(i,f9e(e,t)),s=uX(n,zp(3.14));return Mbe(ioe(s).multiply(r))}function IR(i){return Ale(i,zp(mUt))}function cJr(i,e){return i.x.multiply(e.y).subtract(e.x.multiply(i.y))}function hJr(i){return i.multiply(2).subtract(1)}function dg(i,e){const t=zp(2**e);return uX(HUt(i.divide(t)),zp(2))}function dJr(i,e){return Uv(dg(i,e),zp(.5))}function mPe(i,e){return dg(i,e+g9.length)}function pJr(i,e){return dg(i,e)}function fJr(i){const e=dg(i.z,7),t=zp(1).subtract(e),r=i.xyz.subtract(uXr(0,0,zp(128)));return t.multiply(i).add(e.multiply(r))}function UJe(i){const e=cXr(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return Cq(i,e)}function Qmt(i){return AS(AS(AS(i.x,i.y),i.z),i.w)}let pO=class extends Lf{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=rg(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=fJr(e),r=this.size,n=$j(t.x),s=$j(t.y).multiply($j(256)),o=$j(t.z).multiply($j(256)).multiply($j(256)),a=zp(n.add(s).add(o)),l=uX(a,r),u=a.subtract(l).divide(r);this._uv=new As(l,u).add(.5).divide(r)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return rg(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return rg(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return rg(this.gpgpu,t).setDebugName("storage4")}getFilterFlags(e){return yi("webgl-ignores-sampler-precision")?yXr(this.getFilterData(e).x.multiply(zp(255))):this.getFilterData(e).x.multiply(zp(255))}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};x([zn(_f)],pO.prototype,"filterFlags",void 0),x([zn(_f)],pO.prototype,"animation",void 0),x([zn(_f)],pO.prototype,"gpgpu",void 0),x([zn(_f)],pO.prototype,"visualVariableData",void 0),x([zn(_f)],pO.prototype,"dataDriven0",void 0),x([zn(_f)],pO.prototype,"dataDriven1",void 0),x([zn(_f)],pO.prototype,"dataDriven2",void 0),x([zn(Ni)],pO.prototype,"size",void 0);let _9e=class extends Lf{};x([zn(Ni)],_9e.prototype,"activeReasons",void 0),x([zn(Ni)],_9e.prototype,"highlightAll",void 0);let jee=class extends Lf{};x([zn(As)],jee.prototype,"position",void 0),x([zn(Ni)],jee.prototype,"distance",void 0),x([zn(Ni)],jee.prototype,"smallSymbolDistance",void 0),x([zn(Ni)],jee.prototype,"smallSymbolSizeThreshold",void 0);let E1=class extends Lf{};x([zn(Tf)],E1.prototype,"displayViewScreenMat3",void 0),x([zn(Tf)],E1.prototype,"displayViewMat3",void 0),x([zn(Tf)],E1.prototype,"displayMat3",void 0),x([zn(Tf)],E1.prototype,"viewMat3",void 0),x([zn(Tf)],E1.prototype,"tileMat3",void 0),x([zn(Ni)],E1.prototype,"displayZoomFactor",void 0),x([zn(Ni)],E1.prototype,"requiredZoomFactor",void 0),x([zn(As)],E1.prototype,"tileOffset",void 0),x([zn(Ni)],E1.prototype,"currentScale",void 0),x([zn(Ni)],E1.prototype,"currentZoom",void 0),x([zn(Ni)],E1.prototype,"metersPerSRUnit",void 0),x([zn(Ni)],E1.prototype,"rotation",void 0),x([zn(Ni)],E1.prototype,"pixelRatio",void 0);let nE=class extends roe{};x([Ns(0,Ul)],nE.prototype,"id",void 0),x([Ns(1,Ni)],nE.prototype,"bitset",void 0),x([Ns(2,As)],nE.prototype,"pos",void 0);let M3=class extends jJe{};x([Ns(14,As)],M3.prototype,"nextPos1",void 0),x([Ns(15,As)],M3.prototype,"nextPos2",void 0);let YR=class extends fH{},ox=class extends GJe{clip(e,t){let r=new Ni(0);const n=this.storage.getFilterFlags(e);if(r=r.add(zp(2).multiply(zp(1).subtract(mPe(n,0)))),this.inside?r=r.add(zp(2).multiply(zp(1).subtract(mPe(n,1)))):this.outside?r=r.add(zp(2).multiply(mPe(n,1))):this.highlight&&(r=r.add(zp(2).multiply(zp(1).subtract(this._checkHighlight(n))))),t!=null){const s=new Ni(1).subtract(vm(t.x,this.view.currentZoom)),o=vm(t.y,this.view.currentZoom);r=r.add(new Ni(2).multiply(s.add(o)))}return r}getFragmentOutput(e,t,r=new Ni(1/255)){const n=new Ole;return n.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,r)??e,n}_maybeHighlight(e,t){return this.highlight?new qo(e.rgb,vm(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let r=1;r{const l=bre(i,e,t),u=bre(i,t,r),c=bre(i,r,e);return Eq(Eq(l,u),c)}])}function TCe(i){return i.distance.add(1)}function zJe(i,e,t){const{viewMat3:r,tileMat3:n}=i.view,s=r.multiply(n),o=s.multiply(new Ul(e.pos,1)),a=s.multiply(new Ul(t.nextPos1,1)),l=s.multiply(new Ul(t.nextPos2,1));return szt(i.hittestRequest.position,o.xy,a.xy,l.xy)}function yJr(i,e,t){return $Je(i,t).subtract(e)}let OB=class extends Lf{getColor(e,t,r){return Cle([VUt(IR(e),r),t],[yCe(e,this.values.first()),this.colors.first()],[vCe(e,this.values.last()),this.colors.last()],[!0,()=>{const n=this.values.findIndex(u=>Uv(u,e)),s=this.values.get(n),o=n.subtract(1),a=this.values.get(o),l=e.subtract(a).divide(s.subtract(a));return A3(this.colors.get(o),this.colors.get(n),l)}])}};x([zn(gf.ofType(qo,8))],OB.prototype,"colors",void 0),x([zn(gf.ofType(Ni,8))],OB.prototype,"values",void 0);let PB=class extends Lf{getOpacity(e){return Cle([IR(e),new Ni(1)],[yCe(e,this.opacityValues.first()),this.opacities.first()],[vCe(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(a=>Uv(a,e)),r=this.opacityValues.get(t),n=t.subtract(1),s=this.opacityValues.get(n),o=e.subtract(s).divide(r.subtract(s));return A3(this.opacities.get(n),this.opacities.get(t),o)}])}};x([zn(gf.ofType(Ni,8))],PB.prototype,"opacities",void 0),x([zn(gf.ofType(Ni,8))],PB.prototype,"opacityValues",void 0);function ozt(i){return i.visualVariableSizeMinMaxValue!=null||i.visualVariableSizeScaleStops!=null||i.visualVariableSizeStops!=null||i.visualVariableSizeUnitValue!=null}function Obe(i,e,t){if(ozt(i)){const r=i.storage.getSizeValue(e);return i.visualVariableSizeMinMaxValue?.getSize(r,t)??i.visualVariableSizeScaleStops?.getSizeForViewScale(i.view.currentScale)??i.visualVariableSizeStops?.getSize(r,t)??i.visualVariableSizeUnitValue?.getSize(r,t)}return t}function CCe(i,e,t,r=new Kx(!1)){if(i.visualVariableColor==null)return t;const n=i.storage.getColorValue(e);return i.visualVariableColor.getColor(n,t,r)}function ECe(i,e){if(i.visualVariableOpacity==null)return new Ni(1);const t=i.storage.getOpacityValue(e);return i.visualVariableOpacity.getOpacity(t)}function azt(i,e){if(i.visualVariableRotation==null)return Tf.identity();const t=i.storage.getRotationValue(e);return i.visualVariableRotation.getVVRotationMat3(t)}let noe=class extends nE{};x([Ns(3,qo)],noe.prototype,"color",void 0),x([Ns(4,As)],noe.prototype,"zoomRange",void 0);let lF=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const r=ECe(this,e.id),n=CCe(this,e.id,e.color).multiply(r),s=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),o=this.clip(e.id,e.zoomRange);return{glPosition:new qo(s.xy,o,1),color:n,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new Ni(0))}hittest(e,t){return zJe(this,e,t)}};x([jc(OB)],lF.prototype,"visualVariableColor",void 0),x([jc(PB)],lF.prototype,"visualVariableOpacity",void 0),x([_u(0,bu(noe)),_u(1,bu(M3))],lF.prototype,"vertex",null),x([_u(0,bu(YR))],lF.prototype,"fragment",null);let Iq=class extends Lf{getPatternOffsetAtTileOrigin(e,t=new Ni(0),r=new Ni(1)){const n=new As(BYr).divide(e);let s=e.multiply(Mbe(this.maxIntsToLocalOrigin.multiply(n))).add(this.tileOffsetFromLocalOrigin).subtract(new Ni(.5).multiply(e));return s=new As(s.x.multiply(r).subtract(s.y.multiply(t)),s.x.multiply(t).add(s.y.multiply(r))),uX(s,e)}};x([zn(As)],Iq.prototype,"tileOffsetFromLocalOrigin",void 0),x([zn(As)],Iq.prototype,"maxIntsToLocalOrigin",void 0);let AR=class extends Lf{};x([zn(As)],AR.prototype,"size",void 0),x([zn(_f)],AR.prototype,"texture",void 0);let S$=class extends noe{};x([Ns(5,qo)],S$.prototype,"tlbr",void 0),x([Ns(6,Ni)],S$.prototype,"width",void 0),x([Ns(7,Ni)],S$.prototype,"height",void 0),x([Ns(8,As)],S$.prototype,"offset",void 0),x([Ns(9,As)],S$.prototype,"scale",void 0),x([Ns(10,Ni)],S$.prototype,"angle",void 0);let vJr=class extends YR{};function _Jr(i,e,t,r,n){const s=Ale(dg(n,gUt),zp(1)),o=UJe(new qo(i,0));return Rh(s,Rmt(r.divide(e.x),t.divide(e.y),0,cA(t.divide(e.x)),r.divide(e.y),0,Zmt(f9e(o,0)),Zmt(f9e(0,o)),1),Rmt(r.divide(e.x),t.divide(e.y),0,cA(t.divide(e.x)),r.divide(e.y),0,0,0,1))}function lzt(i,e){const t=A3(new As(1),new As(1/cJe),new As(dg(e.bitset,vUt),dg(e.bitset,yUt))),r=i.view.requiredZoomFactor,n=new As(e.width,e.height).multiply(t),s=n.multiply(e.scale).multiply(r),o=e.angle.multiply(fUt),a=ioe(o),l=Abe(o),u=_Jr(e.id,s,a,l,e.bitset),c=i.localTileOffset.getPatternOffsetAtTileOrigin(n,a,l),h=r.multiply(e.scale).multiply(e.offset.subtract(c)).divide(s),p=new Ul(e.pos,1),m=u.multiply(p).xy.subtract(h),v=e.tlbr.divide(i.mosaicInfo.size.xyxy);let w=dg(e.bitset,mCe);return i.visualVariableColor!=null&&(w=Rh(IR(i.storage.getColorValue(e.id)),new Ni(0),w)),{tileTextureCoord:m,tlbr:v,sampleAlphaOnly:w}}function uzt(i,e){const t=uX(e.tileTextureCoord,new Ni(1)),r=A3(e.tlbr.xy,e.tlbr.zw,t);let n=rg(i.mosaicInfo.texture,r);return n=Rh(Uv(e.sampleAlphaOnly,new Ni(.5)),n.aaaa,n),e.color.multiply(n)}let Gee=class extends lF{vertex(e,t){return{...super.vertex(e,t),...lzt(this,e)}}fragment(e){const t=uzt(this,e);return this.getFragmentOutput(t,e,new Ni(0))}};x([zn(AR)],Gee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Gee.prototype,"localTileOffset",void 0),x([_u(0,bu(S$)),_u(1,bu(M3))],Gee.prototype,"vertex",null),x([_u(0,bu(vJr))],Gee.prototype,"fragment",null);let Ple=class extends Lf{getSize(e,t){const r=this.minMaxValueAndSize.xy,n=this.minMaxValueAndSize.zw;return Rh(IR(e),t,()=>{const s=e.subtract(r.x).divide(r.y.subtract(r.x)),o=Tq(s,new Ni(0),new Ni(1));return n.x.add(o.multiply(n.y.subtract(n.x)))})}};x([zn(qo)],Ple.prototype,"minMaxValueAndSize",void 0);let Aq=class extends Lf{getSizeForViewScale(e){return Cle([yCe(e,this.values.first()),this.sizes.first()],[vCe(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(a=>Uv(a,e)),r=this.values.get(t),n=t.subtract(1),s=this.values.get(n),o=e.subtract(s).divide(r.subtract(s));return A3(this.sizes.get(n),this.sizes.get(t),o)}])}};x([zn(gf.ofType(Ni,8))],Aq.prototype,"sizes",void 0),x([zn(gf.ofType(Ni,8))],Aq.prototype,"values",void 0);let Mq=class extends Lf{getSize(e,t){const r=Cle([IR(e),t],[yCe(e,this.values.first()),this.sizes.first()],[vCe(e,this.values.last()),this.sizes.last()],[!0,()=>{const n=this.values.findIndex(u=>Uv(u,e)),s=this.values.get(n),o=n.subtract(1),a=this.values.get(o),l=e.subtract(a).divide(s.subtract(a));return A3(this.sizes.get(o),this.sizes.get(n),l)}]);return Rh(IR(r),t,r)}};x([zn(gf.ofType(Ni,8))],Mq.prototype,"sizes",void 0),x([zn(gf.ofType(Ni,8))],Mq.prototype,"values",void 0);let Rle=class extends Lf{getSize(e,t){return Rh(IR(e),t,e.multiply(this.unitValueToPixelsRatio))}};x([zn(Ni)],Rle.prototype,"unitValueToPixelsRatio",void 0);let x5=class extends nE{};x([Ns(3,qo)],x5.prototype,"color",void 0),x([Ns(4,As)],x5.prototype,"offset",void 0),x([Ns(5,As)],x5.prototype,"normal",void 0),x([Ns(6,Ni)],x5.prototype,"halfWidth",void 0),x([Ns(7,Ni)],x5.prototype,"referenceHalfWidth",void 0),x([Ns(8,As)],x5.prototype,"zoomRange",void 0);let czt=class extends YR{},Pbe=class extends Lf{};function hzt(i){return AS(new Ni(kYr).multiply(vm(i,new Ni(LYr))),new Ni(1))}function dzt(i,e){const{halfWidth:t,normal:r}=i,n=hzt(t),s=_Ce(r).multiply(t);return Tq(n.multiply(t.subtract(s)).divide(e.add(n).subtract(new Ni(1))),new Ni(0),new Ni(1))}function bJr(i,e){const{id:t,halfWidth:r,referenceHalfWidth:n}=e;if(ozt(i)){const s=new Ni(2).multiply(n),o=Obe(i,t,s);return new Ni(.5).multiply(r.divide(AS(n,new Ni($Yr)))).multiply(o)}return r}function VJe(i,e){const{id:t,offset:r,pos:n,normal:s,zoomRange:o}=e,{displayViewScreenMat3:a,displayViewMat3:l}=i.view,u=CCe(i,t,e.color),c=ECe(i,t),h=bJr(i,e),p=new Ni(.5).multiply(i.antialiasingControls.antialiasing),m=AS(h.add(p),new Ni(.45)).add(new Ni(.1).multiply(p)),v=hzt(m).multiply(m).multiply(r),w=l.multiply(new Ul(v,new Ni(0))),S=a.multiply(new Ul(n,new Ni(1))).add(w),I=new Ni(2).multiply(vm(h,new Ni(0))).add(i.clip(t,o)),R=new qo(S.xy,I,1);return{color:u,opacity:c,halfWidth:m,normal:s,scaledOffset:v,scaledHalfWidth:h,glPosition:new qo(R.xy,I,1)}}function ICe(i,e){const{opacity:t,color:r}=i,n=dzt(i,e);return t.multiply(r).multiply(n)}x([zn(Ni)],Pbe.prototype,"antialiasing",void 0),x([zn(Ni)],Pbe.prototype,"blur",void 0);let cC=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const r=VJe(this,e);return{...r,...this.maybeRunHittest(e,t,r.halfWidth)}}fragment(e){const t=ICe(e,this.antialiasingControls.blur);return this.getFragmentOutput(t,e)}hittest(e,t,r){const{viewMat3:n,tileMat3:s}=this.view,o=n.multiply(s),a=o.multiply(new Ul(e.pos,1)),l=o.multiply(new Ul(t.nextPos1,1)),u=o.multiply(new Ul(t.nextPos2,1)),{distance:c,smallSymbolDistance:h,smallSymbolSizeThreshold:p}=this.hittestRequest,m=vm(r,p.multiply(.5)).multiply(c.subtract(h)),v=this.hittestRequest.position;return Eq(bre(v,a.xy,l.xy),bre(v,a.xy,u.xy)).subtract(r).add(m)}};x([zn(Pbe)],cC.prototype,"antialiasingControls",void 0),x([jc(OB)],cC.prototype,"visualVariableColor",void 0),x([jc(PB)],cC.prototype,"visualVariableOpacity",void 0),x([jc(Ple)],cC.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],cC.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],cC.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],cC.prototype,"visualVariableSizeUnitValue",void 0),x([_u(0,bu(x5)),_u(1,bu(M3))],cC.prototype,"vertex",null),x([_u(0,bu(czt))],cC.prototype,"fragment",null);let S5=class extends nE{};x([Ns(3,As)],S5.prototype,"offset",void 0),x([Ns(4,qo)],S5.prototype,"color",void 0),x([Ns(5,As)],S5.prototype,"normal",void 0),x([Ns(6,Ni)],S5.prototype,"halfWidth",void 0),x([Ns(7,Ni)],S5.prototype,"referenceHalfWidth",void 0),x([Ns(8,As)],S5.prototype,"zoomRange",void 0);let pzt=class extends czt{};function HJe(i,e,t){const{id:r,bitset:n}=e,s=dg(n,AJe),o=Uv(s,new Ni(.5)),a=VJe(i,e),l=Rh(o,a.halfWidth,new Ni(0)),u=ECe(i,r),c=CCe(i,r,e.color),h=Rh(o,e.color,c.multiply(u)),p=i.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),m=i.clip(e.id),v=new qo(p.xy,m,1),w=Rh(o,a.glPosition,v),S=t&&i.maybeRunHittest(e,t,o);return{isOutline:s,color:h,opacity:new Ni(1),halfWidth:l,normal:a.normal,glPosition:w,...S}}let YO=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};x([zn(Pbe)],YO.prototype,"antialiasingControls",void 0),x([jc(OB)],YO.prototype,"visualVariableColor",void 0),x([jc(PB)],YO.prototype,"visualVariableOpacity",void 0),x([jc(Ple)],YO.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],YO.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],YO.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],YO.prototype,"visualVariableSizeUnitValue",void 0);let Rbe=class extends YO{vertex(e,t){return HJe(this,e,t)}fragment(e){const{color:t,isOutline:r}=e,n=Uv(r,new Ni(.5)),s=ICe(e,this.antialiasingControls.blur),o=Rh(n,s,t),a=Rh(n,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}hittest(e,t,r){return Rh(r,TCe(this.hittestRequest),zJe(this,e,t))}};x([_u(0,bu(S5)),_u(1,bu(M3))],Rbe.prototype,"vertex",null),x([_u(0,bu(pzt))],Rbe.prototype,"fragment",null);let b9e=class extends noe{};x([Ns(5,qo)],b9e.prototype,"tlbr",void 0),x([Ns(6,Ni)],b9e.prototype,"inverseRasterizationScale",void 0);let wJr=class extends YR{};function xJr(i){const e=new Ni(1),t=new Ni(0);return new Tf(e.divide(i.x),t.divide(i.y),0,cA(t.divide(i.x)),e.divide(i.y),0,0,0,1)}function fzt(i,e){const t=e.tlbr.xy,r=e.tlbr.zw,n=r.x.subtract(t.x),s=t.y.subtract(r.y),o=new As(n,s).multiply(e.inverseRasterizationScale),a=o.multiply(i.view.requiredZoomFactor),l=xJr(a),u=i.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new Ul(e.pos,1);return{tileTextureCoord:l.multiply(c).xy.subtract(u),tlbr:e.tlbr.divide(i.mosaicInfo.size.xyxy)}}function mzt(i,e){const t=uX(i.tileTextureCoord,new Ni(1)),r=A3(i.tlbr.xy,i.tlbr.zw,t),n=rg(e.texture,r);return i.color.multiply(n)}let Uee=class extends lF{vertex(e,t){return{...super.vertex(e,t),...fzt(this,e)}}fragment(e){const t=mzt(e,this.mosaicInfo);return this.getFragmentOutput(t,e,new Ni(0))}};x([zn(AR)],Uee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Uee.prototype,"localTileOffset",void 0),x([_u(0,bu(b9e)),_u(1,bu(M3))],Uee.prototype,"vertex",null),x([_u(0,bu(wJr))],Uee.prototype,"fragment",null);let w9e=class extends S5{};x([Ns(9,qo)],w9e.prototype,"tlbr",void 0),x([Ns(10,Ni)],w9e.prototype,"inverseRasterizationScale",void 0);let gzt=class extends pzt{},zee=class extends Rbe{vertex(e,t){return{...HJe(this,e,t),...fzt(this,e)}}fragment(e){const{isOutline:t}=e,r=Uv(t,new Ni(.5)),n=ICe(e,this.antialiasingControls.blur),s=mzt(e,this.mosaicInfo),o=Rh(r,n,s),a=Rh(r,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}};x([zn(AR)],zee.prototype,"mosaicInfo",void 0),x([zn(Iq)],zee.prototype,"localTileOffset",void 0),x([_u(0,bu(w9e)),_u(1,bu(M3))],zee.prototype,"vertex",null),x([_u(0,bu(gzt))],zee.prototype,"fragment",null);const rP=16,yK=1/rP,x9e=128;let fO=class extends nE{};x([Ns(3,qo)],fO.prototype,"color",void 0),x([Ns(4,qo)],fO.prototype,"tlbr",void 0),x([Ns(5,Ni)],fO.prototype,"angle",void 0),x([Ns(6,Ni)],fO.prototype,"aux1",void 0),x([Ns(7,Ni)],fO.prototype,"aux2",void 0),x([Ns(8,As)],fO.prototype,"aux3",void 0),x([Ns(9,As)],fO.prototype,"aux4",void 0),x([Ns(10,As)],fO.prototype,"zoomRange",void 0);let SJr=class extends gzt{},Vee=class extends YO{vertex(e,t){const{aux1:r,aux2:n,aux3:s,aux4:o}=e,a={...e,width:r,height:n,offset:s,scale:o.multiply(yK)},l={...e,halfWidth:r.multiply(yK),referenceHalfWidth:n.multiply(yK),offset:s.multiply(yK),normal:o.subtract(x9e).multiply(yK)},u=HJe(this,l),c=lzt(this,a),h=Uv(u.isOutline,new Ni(.5));return{...u,...c,...this.maybeRunHittest(e,t,h)}}fragment(e){const{isOutline:t}=e,r=Uv(t,new Ni(.5)),n=ICe(e,this.antialiasingControls.blur),s=uzt(this,e),o=Rh(r,n,s),a=Rh(r,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}hittest(e,t,r){return Rh(r,TCe(this.hittestRequest),zJe(this,e,t))}};x([zn(AR)],Vee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Vee.prototype,"localTileOffset",void 0),x([_u(0,bu(fO)),_u(1,bu(M3))],Vee.prototype,"vertex",null),x([_u(0,bu(SJr))],Vee.prototype,"fragment",null);const TC=EUt.attributes,TJr=PJe.attributes,CJr={createComputedParams:i=>i,attributes:{id:TC.id,pos:TC.pos,zoomRange:TC.zoomRange,tlbr:TC.tlbr,angle:TC.angle,color:TC.color,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>SUt(i)},aux1:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>TUt(i)},aux2:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>CUt(i)},aux3:{count:2,type:Ti.SHORT,pack:({offsetX:i,offsetY:e})=>[us(i),us(e)]},aux4:{count:2,type:Ti.UNSIGNED_BYTE,pack:({scaleX:i,scaleY:e})=>[i*rP,e*rP]}}},EJr={createComputedParams:i=>i,attributes:{id:TC.id,pos:TC.pos,zoomRange:TC.zoomRange,tlbr:TC.tlbr,angle:TC.angle,color:TJr.color,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>Tle([[AJe,!0]])},aux1:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>us(.5*i.width)*rP},aux2:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>us(.5*i.referenceWidth)*rP},aux3:{count:2,type:Ti.SHORT,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:e})=>[i*rP,e*rP]},aux4:{count:2,type:Ti.UNSIGNED_BYTE,packTessellation:({normalX:i,normalY:e})=>[i*rP+x9e,e*rP+x9e]}}};let IJr=class extends RJe{constructor(){super(...arguments),this.vertexSpec=EJr}},AJr=class extends DJe{constructor(){super(...arguments),this.vertexSpec=CJr}_createOutlineWriter(e,t,r,n){return new IJr(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd()}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const MJr={createComputedParams:i=>i,attributes:{...fCe.attributes,...MUt.attributes}},OJr={createComputedParams:i=>i,attributes:{...fCe.attributes,...PJe.attributes}};let PJr=class extends RJe{constructor(){super(...arguments),this.vertexSpec=OJr}},RJr=class extends DJe{constructor(){super(...arguments),this.vertexSpec=MJr}_createOutlineWriter(e,t,r,n){return new PJr(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd()}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const DJr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},offset:{type:Ti.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let FJr=class extends oX{constructor(){super(...arguments),this.vertexSpec=DJr}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=t.getDisplayId();if(t.geometryType==="esriGeometryPoint"){const n=t.readXForDisplay(),s=t.readYForDisplay();this._writeQuad(e,r,n,s)}else t.geometryType==="esriGeometryMultipoint"&&t.readGeometryForDisplay()?.forEachVertex((s,o)=>{s>=0&&s<=512&&o>=0&&o<=512&&this._writeQuad(e,r,s,o)});e.recordEnd()}_writeQuad(e,t,r,n){const s=e.vertexCount();this._writeVertex(e,t,r,n),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}};const Iy=8388607,kJr=8388608,vS=i=>i&Iy;function LJr(i,e){return((e?kJr:0)|i)>>>0}let Hee=class yzt{constructor(e,t,r,n,s,o,a,l,u=[]){this.entityTexel=e,this.anchorX=t,this.anchorY=r,this.directionX=n,this.directionY=s,this.maxScale=o,this.minScale=a,this.referenceBounds=l,this.bounds=u}serialize(e){e.push(this.entityTexel),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds===null?(e.writeF32(0),e.writeF32(0),e.writeF32(0)):(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)),Wjt(e,this.bounds)}static deserialize(e){const t=e.readInt32(),r=e.readF32(),n=e.readF32(),s=e.readF32(),o=e.readF32(),a=e.readF32(),l=e.readF32(),u=e.readF32(),c=e.readF32(),h=e.readF32(),p=hH(e,T8)??[];return new yzt(t,r,n,s,o,a,l,{size:u,offsetX:c,offsetY:h},p)}};const vzt=15.5,uF=1024;function egt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i}function _zt(i,e){return Math.sqrt(i*i+e*e)}function tgt(i){const e=_zt(i[0],i[1]);i[0]/=e,i[1]/=e}function NJr(i,e){return _zt(i[0]-e[0],i[1]-e[1])}function $Jr(i,e){return i[e+1]}function bzt(i){return i.length-1}function BJr(i){let e=0;for(let t=0;te._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let r=Math.acos(t);return e>0&&(r=2*Math.PI-r),r}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1e)return this._seekBackwards(e-n);n+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let r=this.remainingLength;for(;this.next();){if(r+this.length>e)return this.seek(e-r,t);r+=this.length}return this._distance=1,t?this:null}};function UJr(i,e,t,r=!0){const n=BJr(i),s=GJr.create(i),o=n/2;if(!r)return s.seek(o),void(Math.abs(s.x)=0&&!(n[w+1]n[h]+c);w++){const S=c-n[w-1]+n[h],I=n[w]-n[w-1],R=n[w]-n[h]1){const l=AMt(s,n,!1,t,r,a);this.fontSize=Math.min(l.size,igt),this.postAngle=l.rotation,this.offsetX=l.offsetX,this.offsetY=l.offsetY}o&&(this.fontSize*=o,this.offsetX*=o,this.offsetY*=o)}};const fye=28,Ek=[4,4],Ude=[16,4],WJr={topLeft:Ude,topRight:Ude,bottomLeft:Ude,bottomRight:Ude},Dbe=[4,2],WS=[4,6],rgt={topLeft:Dbe,topRight:Dbe,bottomLeft:WS,bottomRight:WS},ngt={topLeft:Dbe,topRight:WS,bottomLeft:Dbe,bottomRight:WS},qJr={topLeft:WS,topRight:WS,bottomLeft:Ek,bottomRight:Ek},YJr={topLeft:Ek,topRight:Ek,bottomLeft:WS,bottomRight:WS},XJr={topLeft:WS,topRight:Ek,bottomLeft:WS,bottomRight:Ek},JJr={topLeft:Ek,topRight:WS,bottomLeft:Ek,bottomRight:WS},KJr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:i,mapAligned:e})=>Tle([[wUt,i],[xUt,!!e]])},zoomRange:{type:Ti.UNSIGNED_SHORT,count:2,packPrecisionFactor:xq,packTessellation:({minZoom:i,maxZoom:e})=>[i||0,e||fye]},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:i})=>{const{bottomLeft:e,bottomRight:t,topLeft:r,topRight:n}=i;return[r,n,e,t]}}},textureUV:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:i})=>{const{bottomLeft:e,bottomRight:t,topLeft:r,topRight:n}=i;return[r,n,e,t]}}},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:i})=>i},fontSize:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:i})=>us(i)},referenceSize:{type:Ti.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:i},{referenceSize:e})=>us(e??i)},haloColor:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:i})=>Xg(i)},haloFontSize:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:i})=>us(i)},clipAngle:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:i})=>ZJr(i||0)},referenceSymbol:{type:Ti.BYTE,count:4,packPrecisionFactor:1,packTessellation:(i,e)=>{if(!i.referenceBounds)return[0,0,0,0];const t=Rqr(e.horizontalAlignment),r=Dqr(e.verticalAlignment),{offsetX:n,offsetY:s,size:o}=i.referenceBounds;return[us(n),-us(s),us(o),t+1<<2|r+1]}}}};let xzt=class extends oX{constructor(){super(...arguments),this.vertexSpec=KJr,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new HJr(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,t,r){const n=this._getShaping();if(!n)return;const s=t.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,t,n,r);if(r&&r.nextPath())return r.nextPoint(),this._writeGlyphs(e,s,r.x,r.y,n,0);if(t.geometryType==="esriGeometryPolygon"){const l=t.readCentroidForDisplay();if(!l)return;const[u,c]=l.coords;return this._writeGlyphs(e,s,u,c,n,0)}if(t.geometryType==="esriGeometryMultipoint")return void t.readGeometryForDisplay()?.forEachVertex((u,c)=>this._writeGlyphs(e,s,u,c,n,0));const o=t.readXForDisplay(),a=t.readYForDisplay();return this._writeGlyphs(e,s,o,a,n,0)}_writePlacedTextMarkers(e,t,r,n){const s=n??Ec.fromFeatureSetReaderCIM(t);if(!s)return;const o=-1,a=wzt.getPlacement(s,o,this.evaluatedMeshParams.placement,us(1),e.id,EJe());if(!a)return;const l=t.getDisplayId();let u=a.next();for(;u!=null;){const c=u.tx,h=-u.ty,p=-u.getAngle();this._writeGlyphs(e,l,c,h,r,p),u=a.next()}}_getShaping(){const e=this._textMeshTransformProps,t=this.evaluatedMeshParams;if(!t.glyphs?.glyphs.length)return null;const r=Math.round(us(e.fontSize)),n=us(e.offsetX),s=us(e.offsetY),o=uu(us(t.lineWidth),32,512),a=hJe*uu(t.lineHeightRatio,.25,4);return xJe(t.glyphs,{scale:r/dJe,angle:e.postAngle,xOffset:n,yOffset:s,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:o,lineHeight:a,decoration:t.decoration,borderLineSizePx:us(t.boxBorderLineSize),hasBackground:!!t.boxBackgroundColor,useCIMAngleBehavior:t.useCIMAngleBehavior})}_writeGlyphs(e,t,r,n,s,o,a,l){const u=this.evaluatedMeshParams,c=this._textMeshTransformProps,h=c.fontSize,p=us(c.offsetX),m=us(c.offsetY),[v,w]=aX(u.scaleInfo,this.getTileInfo());o!==0&&s.setRotation(o);const S=s.bounds,I=r+S.x+p,R=n+S.y-m,L=2*(u.minPixelBuffer?u.minPixelBuffer/h:1),k=Math.max(S.width,S.height)*L;s.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),e.recordBounds(I,R,k,k),this._writeTextBox(e,t,r,n,s.textBox,a,l),e.recordEnd());for(const B of s.glyphs){e.recordStart(this.instanceId,this.attributeLayout,B.textureBinding),e.recordBounds(I,R,k,k);const{texcoords:$,offsets:V}=B;this._writeQuad(e,t,r,n,{texcoords:$,offsets:V,fontSize:h,color:Xg(u.color),isBackground:!1,referenceBounds:a,minZoom:v,maxZoom:w,...l}),e.recordEnd()}o!==0&&s.setRotation(-o)}_writeTextBox(e,t,r,n,s,o,a){const l=this.evaluatedMeshParams,{fontSize:u}=this._textMeshTransformProps,{boxBackgroundColor:c,boxBorderLineColor:h}=l,p={isBackground:!0,fontSize:u,referenceBounds:o,...a};c&&(this._writeQuad(e,t,r,n,{texcoords:WJr,offsets:s.main,color:Xg(c),...p}),h||(this._writeQuad(e,t,r,n,{texcoords:qJr,offsets:s.top,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:YJr,offsets:s.bot,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:XJr,offsets:s.left,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:JJr,offsets:s.right,color:Xg(c),...p}))),h&&(this._writeQuad(e,t,r,n,{texcoords:rgt,offsets:s.top,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:rgt,offsets:s.bot,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:ngt,offsets:s.left,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:ngt,offsets:s.right,color:Xg(h),...p}))}_writeQuad(e,t,r,n,s){const o=e.vertexCount();this._writeVertex(e,t,r,n,s),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2)}};const ZJr=i=>Math.round(i*(254/360)),zde=1,jj=0,QJr=128,eKr=AHi(i=>{let e=0;if(i===0)return 1/0;for(;!(i%2);)e++,i/=2;return e});let tKr=class extends xzt{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,r,n){if(this._zoomLevel=n||0,r!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const s=t.readXForDisplay(),o=t.readYForDisplay();return this._writePoint(e,s,o,t)}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const s=t.readCentroidForDisplay();if(!s)return;const[o,a]=s.coords;return this._writePoint(e,o,a,t)}case"esriGeometryPolyline":{const s=t.readLegacyGeometryForDisplay();this._writeLines(e,t,s)}}}_writePoint(e,t,r,n){const s=this._getShaping();if(!s)return;let o=this._getPointReferenceBounds();o||(o={offsetX:0,offsetY:0,size:0});const a=s.boundsT,l=qGt(this.evaluatedMeshParams.horizontalAlignment),u=YGt(this.evaluatedMeshParams.verticalAlignment),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,p=vS(n.getDisplayId());e.metricStart(new Hee(p,t,r,l,u,c,h,o)),e.metricBoxWrite(a),this._writeGlyphs(e,n.getDisplayId(),t,r,s,0,o),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t,r){const{repeatLabel:n,scaleInfo:s}=this.evaluatedMeshParams,o=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping();if(!a)return;this._current={out:e,id:t.getDisplayId(),shaping:a,zoomRange:aX(s,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0}};const l=zJr(r.paths,a.bounds.width),u=this._placeSubdivGlyphs.bind(this),c=(a.bounds.width+o)/(1<0&&(l||u)){const S=Math.max(t,o[0],0),I=Math.min(fye,o[1]),R=Nae(SS(),-e.angle),[L,k]=s.shapeBackground(R),B={minZoom:S,maxZoom:I,clipAngle:h,mapAligned:!0,isLineLabel:!0};r.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,k,a,B),r.recordEnd(),B.clipAngle=p,r.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,k,a,B),r.recordEnd()}const m=vS(n),v=this.evaluatedMeshParams.scaleInfo?.maxScale??0,w=this.evaluatedMeshParams.scaleInfo?.minScale??0;r.metricStart(new Hee(m,e.x,e.y,0,0,v,w,null)),this._placeFirst(c,t,1,h,!0),this._placeFirst(c,t,0,p,!0),r.metricEnd()}_placeBack(e,t,r,n,s,o){const a=e.clone();let l=e.backwardLength+jj;for(;a.prev()&&!(l>=n);)this._placeOnSegment(a,t,l,r,-1,s,o),l+=a.length+jj}_placeForward(e,t,r,n,s,o){const a=e.clone();let l=e.remainingLength+jj;for(;a.next()&&!(l>=n);)this._placeOnSegment(a,t,l,r,1,s,o),l+=a.length+jj}_placeFirst(e,t,r,n,s=!1){const o=e,{out:a,id:l,shaping:u,zoomRange:c,referenceBounds:h}=this._current,p=u.glyphs;for(const m of p){const v=m.x>u.bounds.x?r:1-r,w=v*e.remainingLength+(1-v)*e.backwardLength,S=Math.abs(m.x+m.width/2-u.bounds.x),I=Math.max(0,this._zoomLevel+Math.log2(S/(w+jj))),R=Math.max(t,s?0:I);m.maxZoom=Math.min(c[1],fye),m.angle=e.angle+(1-r)*Math.PI,m.minZoom=Math.max(c[0],R),this._writeLineGlyph(a,l,o.x,o.y,u.bounds,m,n,h,!0),r&&this._isVisible(m.minZoom,m.maxZoom)&&a.metricBoxWrite(m.bounds)}}_placeOnSegment(e,t,r,n,s,o,a){const{out:l,id:u,shaping:c,referenceBounds:h}=this._current,p=c.glyphs,m=e.dx/e.length,v=e.dy/e.length,w={x:e.x+r*-s*m,y:e.y+r*-s*v};for(const S of p){const I=S.x>c.bounds.x?o:1-o;if(!(I&&s===1||!I&&s===-1))continue;const R=Math.abs(S.x+S.width/2-c.bounds.x),L=Math.max(0,this._zoomLevel+Math.log2(R/r)-.1),k=Math.max(n,this._zoomLevel+Math.log2(R/(r+e.length+jj)));if(L!==0&&(S.angle=e.angle+(1-o)*Math.PI,S.minZoom=k,S.maxZoom=L,this._writeLineGlyph(l,u,w.x,w.y,c.bounds,S,a,h,!0),o&&this._isVisible(S.minZoom,S.maxZoom))){const B=S.bounds,$=e.x-t.x,V=e.y-t.y,Y=new T8(B.center[0]+$,B.center[1]+V,B.width,B.height);l.metricBoxWrite(Y)}}}_writeLineGlyph(e,t,r,n,s,o,a,l,u){const c=r+s.x,h=n+s.y,p=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),m=Math.max(s.width,s.height)*p;e.recordStart(this.instanceId,this.attributeLayout,o.textureBinding),e.recordBounds(c,h,m,m);const{texcoords:v,offsets:w}=o,S=this._textMeshTransformProps.fontSize;this._writeQuad(e,t,r,n,{texcoords:v,offsets:w,fontSize:S,color:Xg(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:l,minZoom:Math.max(this._current.zoomRange[0],o.minZoom),maxZoom:Math.min(this._current.zoomRange[1],o.maxZoom),clipAngle:a,mapAligned:u,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const r=this._zoomLevel;return e<=r&&r<=t}};const iKr={createComputedParams:i=>i,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:i,shouldScaleDash:e,isSDF:t})=>Tle([[mCe,i],[_Ut,e],[bUt,t]])},tlbr:{type:Ti.UNSIGNED_SHORT,count:4,pack:({sprite:i})=>{const{rect:e,width:t,height:r}=i,n=e.x+Qg,s=e.y+Qg;return[n,s,n+t,s+r]}},accumulatedDistance:{type:Ti.UNSIGNED_SHORT,count:1,packTessellation:({distance:i})=>i},segmentDirection:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:i,directionY:e})=>[i,e]}}};let rKr=class extends OJe{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=iKr,this._tessellationOptions.textured=!0}_write(e,t,r){const n=r??Ec.fromFeatureSetReaderCIM(t);if(!n)return;const{sprite:s}=this.evaluatedMeshParams;this._writeGeometry(e,t,n,s?.textureBinding)}},nKr=class T9e{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const t=new T9e(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:r,width:n,height:s,angle:o,alignment:a,outlineSize:l,referenceSize:u,sprite:c,overrideOutlineColor:h}=e;t.rawWidth=us(n),t.rawHeight=us(s),t.angle=o,t.alignment=a,t.outlineSize=us(l),t.referenceSize=us(u),t.overrideOutlineColor=h,t.offsetX=us(e.offsetX),t.offsetY=us(e.offsetY),r!=="simple"||c.sdf||(t.rawWidth=c.width,t.rawHeight=c.height);const p=2;return t.sizeRatio=c.sdf?p:1,t._computeSize(e,!1),t}static fromComplexMeshParams(e){const t=new T9e(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:r,transforms:n,size:s,scaleX:o,anchorX:a,anchorY:l,angle:u,colorLocked:c,frameHeight:h,widthRatio:p,offsetX:m,offsetY:v,outlineSize:w,referenceSize:S,scaleFactor:I,sizeRatio:R,isAbsoluteAnchorPoint:L,rotateClockwise:k,scaleSymbolsProportionally:B,sprite:$}=e;if(n&&n.infos.length>0){const K=AMt(s,u,k,m,v,n);s=K.size,u=K.rotation,m=K.offsetX,v=K.offsetY,k=!1}I&&(s*=I,m*=I,v*=I);const V=o*($.width/$.height);t.alignment=r,t.rawHeight=us(s),t.rawWidth=t.rawHeight*V,t.referenceSize=us(S),t.sizeRatio=R,t.angle=u,t.rotateClockwise=k,t.anchorX=a,t.anchorY=l,t.offsetX=us(m),t.offsetY=us(v),L&&s&&($.sdf?t.anchorX=a/(s*p):t.anchorX=a/(s*V),t.anchorY=l/s);const Y=B&&h?s/h:1;return t.outlineSize=w===0||isNaN(w)?0:us(w)*Y,t.scaleSymbolsProportionally=B,t.colorLocked=c,t._computeSize(e,!0),t}constructor(e,t,r,n,s,o,a){this.sprite=e,this.color=t,this.outlineColor=r,this.minPixelBuffer=n,this.placement=s,this.scaleInfo=o,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.alignment=jb.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,t){const{sprite:r,hasSizeVV:n}=e,s=!!r.sdf,{rawWidth:o,rawHeight:a,sizeRatio:l,outlineSize:u}=this,c=o*l,h=a*l;if(s&&!n){const L=t&&o>a?c:o,k=a,B=u+2*1;this.computedWidth=Math.min(L+B,c),this.computedHeight=Math.min(k+B,h)}else this.computedWidth=c,this.computedHeight=h;const p=s?Wge/Math.max(c,h):1,m=.5*(c-this.computedWidth)*p,v=.5*(h-this.computedHeight)*p,w=r.rect.x+Qg+m,S=r.rect.y+Qg+v,I=w+r.width-2*m,R=S+r.height-2*v;this.texXmin=Math.floor(w),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(R),this.computedWidth*=(this.texXmax-this.texXmin)/(I-w),this.computedHeight*=(this.texYmax-this.texYmin)/(R-S),this.anchorX*=c/this.computedWidth,this.anchorY*=h/this.computedHeight}};const gA={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4}},sKr=3.14159265359/180,oKr=128/Math.PI;function aKr(i,e){return i%=e,Math.abs(i>=0?i:i+e)}function lKr(i){return aKr(i*oKr,256)}function uKr(i,e,t,r,n=!1){const s=SS(),o=n?1:-1;return sWe(s),(e||t)&&VA(s,s,[e,-t]),r&&sk(s,s,o*sKr*-r),s}const cKr={createComputedParams:i=>nKr.from(i),attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:({sprite:i,alignment:e,scaleSymbolsProportionally:t,overrideOutlineColor:r,colorLocked:n})=>{let s=0;return i.sdf&&(s|=hK(gA.bitset.isSDF)),e===jb.MAP&&(s|=hK(gA.bitset.isMapAligned)),t&&(s|=hK(gA.bitset.scaleSymbolsProportionally)),r&&(s|=hK(gA.bitset.overrideOutlineColor)),n&&(s|=hK(gA.bitset.colorLocked)),s}},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:i,computedWidth:e,computedHeight:t,anchorX:r,anchorY:n,offsetX:s,offsetY:o,rotateClockwise:a})=>{const l=uKr(0,s,o,-i,a),u=-(.5+r)*e,c=-(.5-n)*t,h=[u,c],p=[u+e,c],m=[u,c+t],v=[u+e,c+t];return yf(h,h,l),yf(p,p,l),yf(m,m,l),yf(v,v,l),[h,p,m,v]}}},textureUV:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:i,texXmin:e,texYmax:t,texYmin:r})=>[[e,r],[i,r],[e,t],[i,t]]}},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)},outlineColor:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>Xg(i)},sizing:{type:Ti.UNSIGNED_BYTE,count:4,pack:({rawWidth:i,rawHeight:e,outlineSize:t,referenceSize:r})=>{const n=Math.max(i,e);return[aPe(n,128),aPe(t,128),aPe(r,128),0]}},placementAngle:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:i})=>lKr(i)},sizeRatio:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sizeRatio:i})=>i}}};let hKr=class extends oX{constructor(){super(...arguments),this.vertexSpec=cKr}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,r){const n=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,n);const o=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,o),l=Math.max(this.evaluatedMeshParams.computedHeight,o),u=this.evaluatedMeshParams.offsetX,c=-this.evaluatedMeshParams.offsetY;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,t,r,a,l);else if(r&&r.nextPath()){r.nextPoint();const h=r.x,p=r.y;e.recordBounds(h+u,p+c,a,l),this._writeQuad(e,s,h,p)}else if(t.geometryType==="esriGeometryPolygon"){const h=t.readCentroidForDisplay();if(!h)return;const[p,m]=h.coords;e.recordBounds(p+u,m+c,a,l),this._writeQuad(e,s,p,m)}else if(t.geometryType==="esriGeometryPoint"){const h=t.readXForDisplay(),p=t.readYForDisplay();e.recordBounds(h+u,p+c,a,l),this._writeQuad(e,s,h,p)}else t.readGeometryForDisplay()?.forEachVertex((p,m)=>{e.recordBounds(p+u,m+c,a,l),Math.abs(p)>uF||Math.abs(m)>uF||this._writeQuad(e,s,p,m)});e.recordEnd()}_writePlacedMarkers(e,t,r,n,s){const o=r??Ec.fromFeatureSetReaderCIM(t)?.clone();if(!o)return;const a=-1,l=wzt.getPlacement(o,a,this.evaluatedMeshParams.placement,us(1),e.id,EJe());if(!l)return;const u=t.getDisplayId();let c=l.next();const h=this.evaluatedMeshParams.offsetX,p=-this.evaluatedMeshParams.offsetY;for(;c!=null;){const m=c.tx,v=-c.ty;if(Math.abs(m)>uF||Math.abs(v)>uF){c=l.next();continue}const w=-c.getAngle();e.recordBounds(m+h,v+p,n,s),this._writeQuad(e,u,m,v,w),c=l.next()}}_writeQuad(e,t,r,n,s){const o=e.vertexCount(),a=s==null?null:{placementAngle:s};this._writeVertex(e,t,r,n,a),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2)}};const dKr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>0},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:i})=>{const e=us(i),t=-e/2,r=-e/2;return[[t,r],[t+e,r],[t,r+e],[t+e,r+e]]}}},texCoords:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:Ti.UNSIGNED_BYTE,count:2,pack:({size:i})=>[i,i]},referenceSize:{type:Ti.UNSIGNED_BYTE,count:1,pack:({size:i})=>us(i)},zoomRange:{type:Ti.UNSIGNED_BYTE,count:2,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)}}};let pKr=class extends oX{constructor(){super(...arguments),this.vertexSpec=dKr}_write(e,t){const r=t.getDisplayId(),n=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(us(this.evaluatedMeshParams.size),n);let o,a;if(t.geometryType==="esriGeometryPoint")o=t.readXForDisplay(),a=t.readYForDisplay();else{const u=t.readCentroidForDisplay();if(!u)return;o=u?.coords[0],a=u?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(o,a,s,s);const l=e.vertexCount();this._writeVertex(e,r,o,a),e.indexWrite(l+0),e.indexWrite(l+1),e.indexWrite(l+2),e.indexWrite(l+1),e.indexWrite(l+3),e.indexWrite(l+2),e.recordEnd()}};const f_=fKr({FillMeshWriter:IJe,DotDensityMeshWriter:AYr,ComplexFillMeshWriter:jYr,PatternFillMeshWriter:pUt,OutlineFillMeshWriter:DJe,PatternOutlineFillMeshWriter:RJr,ComplexOutlineFillMeshWriter:AJr,MarkerMeshWriter:hKr,PieChartMeshWriter:pKr,TextMeshWriter:xzt,LineMeshWriter:OJe,TexturedLineMeshWriter:rKr,HeatmapMeshWriter:FJr,LabelMeshWriter:tKr});function fKr(i){const e={};for(const t in i){const r={name:t,constructor:i[t]};e[t]=r}return e}async function Szt(i,e,t,r,n,s,o){const a=f_[t],l=await IHr.create(i,e,n),u=new a.constructor(r,l,s,o);return await u.loadDependencies(),u}async function qP(i,e,t,r){return Promise.all(t.map(n=>Szt(i,e,n.meshWriterName,n.id,n.options,r,n.optionalAttributes)))}let f7=class Tzt{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t,r,n){const s=new Tzt;return s.setDefault(await qP(e,t,r.meshes,n)),s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}match(e,t){const r=this.doMatch(e,t)||this.getDefault();if(r&&r.length>0){const n=this.getBackgroundFill();if(n)return[...n,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},mKr=class Czt extends f7{static async fromDictionaryRenderer(e,t,r){return new Czt(e,t,r)}constructor(e,t,r){super(),this._storage=e,this._schema=t,this._viewParams=r,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),n=[];for(;r.next();)n.push(this._updateMeshWriterGroup(e,r));await Promise.all(n)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),n=t.getAttributeHash();if(this._hashToGroup.has(n))return;this._hashToGroup.set(n,null);const s=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!s)return;const o=await qP(this._storage,e,s.meshes,this._viewParams);this._hashToGroup.set(n,o)}},gKr=class Ezt extends f7{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t,r,n){const s=await e.createComputedField(r),o=new Ezt(s,r.isMaxInclusive);await Promise.all(r.intervals.map(async u=>{const c=await qP(e,t,u.meshes,n);o.add(u,c)}));const a=await qP(e,t,r.defaultSymbol,n);o.setDefault(a);const l=await qP(e,t,r.backgroundFill,n);return o.setBackgroundFill(l),o}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,n)=>r.interval.min-n.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let n=0;n=s.min,l=this._isMaxInclusive?r<=s.max:r{const l=await qP(e,t,a.meshes,n);return{minScale:a.minScale,maxScale:a.maxScale,meshes:l,expression:null,where:await e.createWhereClause(a.where)}}),o=await Promise.all(s);return new Izt(o)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),n=[];for(const s of r)s.where&&!s.where(e)||n.push(...s.meshes);return n}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,n=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=n)}},vKr=class Azt extends f7{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t,r,n){const s=r.expression?[e.createComputedField({expression:r.expression})]:[r.field?e.createComputedField({field:r.field}):null,r.field2?e.createComputedField({field:r.field2}):null,r.field3?e.createComputedField({field:r.field3}):null],o=(await Promise.all(s)).filter(c=>!!c),a=new Azt(o,r.fieldDelimiter),l=await qP(e,t,r.defaultSymbol,n);a.setDefault(l);const u=await qP(e,t,r.backgroundFill,n);return a.setBackgroundFill(u),await Promise.all(r.map.map(async(c,h)=>{const p=await qP(e,t,c.symbol,n);c.value===""?a.setNullResult(p):a.add(c.value,p,h+1)})),a}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const n=this._resultsMap.get(r.toString());return n?n.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const n=r.toString();return this._resultsMap.get(n)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const n of this._fields){const s=n.read(e,t);s==null||s===""?r.push(""):r.push(s)}return r.join(this._separator)}};async function soe(i,e,t,r){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return f7.from(i,e,t,r);case"interval":return gKr.fromIntervalSchema(i,e,t,r);case"dictionary":return mKr.fromDictionaryRenderer(i,t,r);case"label":return yKr.fromLabelSchema(i,e,t,r);case"map":return vKr.fromMatcherSchema(i,e,t,r);case"subtype":return _Kr.fromSubtypes(i,e,t,r);case"cluster":return bKr.fromClusterSchema(i,e,t,r);default:throw new Error("Impl")}}let _Kr=class Mzt extends f7{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t,r,n){const s=new Map,o=[];for(const a in r.renderers){const l=parseInt(a,10),u=soe(e,t,r.renderers[a],n).then(c=>s.set(l,c));o.push(u)}return await Promise.all(o),new Mzt(s,r.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),n=this._subMatchers.get(r);return n?n.match(e,t):null}},bKr=class Ozt extends f7{static async fromClusterSchema(e,t,r,n){const[s,o]=await Promise.all([soe(e,t,r.feature,n),soe(e,t,r.cluster,n)]);return new Ozt(s,o)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},wKr=class Pzt extends wHr{static async create(e,t,r,n){const s=await soe(e,t,r.symbology,n),o=r.labels?await soe(e,t,r.labels,n):null;return new Pzt(s,o)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const n=this._symbology.match(t,r);if(n){for(const s of n)s.enqueueRequest(e,t,r);if(this._labels){const s=this._labels.match(t,r);if(!s)return;for(const o of s)o.enqueueRequest(e,t,r)}}}write(e,t,r,n,s){const o=this._symbology.match(r,n);if(o){for(const a of o)a.write(e,t,r,n,s);if(e.entityRecordCount()>=1&&this._labels){const a=this._labels.match(r,n);if(!a)return;for(const l of a)l.setReferences(o),l.write(e,t,r,n,s)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},xKr=class{},Rzt=class extends xKr{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destory(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(e){const t=nzt(e.resource),r=Q1(JSON.stringify(t));return this._pendingIds.has(r)||(this._pendingIds.add(r),this._pendingRequests.push({...e,resourceId:r})),r}async fetchEnqueuedResources(){const e=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;re.process(t)})}async push(e){if(e.end)return await Promise.all(this._outstandingMessages),await this._queue.push(e),void(this._outstandingMessages=[]);const t=this._queue.push(e);return this._outstandingMessages.push(t),t}};const TKr=new Float64Array(2),CKr=new Float64Array(2),EKr="0123456789bcdefghjkmnpqrstuvwxyz",IKr=64;function AKr(i,e,t,r){const n=[i.xmin,i.ymin,i.xmax,i.ymax],s=$s.fromExtent(hr.fromBounds(n,r)),o=Sf(s,r,Xi.WGS84,{densificationStep:e*IKr});if(!o)return null;const a=uB(new $o,o,!1,!1),l=a.coords.filter((S,I)=>!(I%2)),u=a.coords.filter((S,I)=>I%2),c=Math.min(...l),h=Math.min(...u),p=Math.max(...l),m=Math.max(...u),v=C9e(c,h,t,Xi.WGS84),w=C9e(p,m,t,Xi.WGS84);return v&&w?{bounds:n,geohashBounds:{xLL:v[0],yLL:v[1],xTR:w[0],yTR:w[1]},level:t}:null}function C9e(i,e,t,r){if(r.isWebMercator){const o=yb(i/Td.radius),a=o-360*Math.floor((o+180)/360),l=[0,0];return ogt(l,0,yb(Math.PI/2-2*Math.atan(Math.exp(-e/Td.radius))),a,t),l}const n=Sf({x:i,y:e},r,Xi.WGS84);if(!n)return null;const s=[0,0];return ogt(s,0,n.y,n.x,t),s}function MKr(i){return EKr[i]}function Dzt(i){return(i[0]+i[1])/2}function sgt(i,e,t){return i[0]=e,i[1]=t,i}function OKr(i,e){const t=Dzt(i),r=e,n=!e;i[0]=n*i[0]+r*t,i[1]=n*t+r*i[1]}function KE(i,e){const t=e>Dzt(i);return OKr(i,t),t}function PKr(i,e){let t=-90,r=90,n=-180,s=180;for(let o=0;o>c,S=(v&i.geohashY)>>h;for(let I=p-1;I>=0;I--){const R=(n+s)/2,L=w&1<=0;I--){const R=(t+r)/2,L=S&1<m?1:0;s|=v<<29-(p+5*h),u=(1-v)*u+v*m,c=(1-v)*m+v*c}for(let p=0;p<5;p++){const m=(a+l)/2,v=t>m?1:0;o|=v<<29-(p+5*h),a=(1-v)*a+v*m,l=(1-v)*m+v*l}}i[2*e]=s,i[2*e+1]=o}function H6(i,e,t){let r="";const n=sgt(TKr,-90,90),s=sgt(CKr,-180,180);for(let o=0;ot,t=>t)}getDisplayAndObjectIds(e){return this.displayMap(e,t=>t,(t,r,n)=>[t,n])}afterUpdateChunks(){}},Lzt=class extends kzt{constructor(e,t,r,n){super(e,t),this.spatialReference=r,this.aggregateFields=n,this.events=new rd,this.featureAdapter=f7t}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new lL({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(e){}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const r=Dx();for(const n of e){const s=O1e(r,n.geometry,!1,!1);s&&t(s)}}},qJe=class{constructor(e,t,r,n,s){this.subscription=e,this.reader=t,this.clear=r,this.end=n,this.debugInfo=s,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,r){return{type:"append",clear:this.clear,id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:r}}},I9e=class{constructor(e,t,r,n,s){this.subscription=e,this.reader=t,this.remove=r,this.end=n,this.debugInfo=s,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,r){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:r}}},RKr=class extends xle{constructor(e){super(),this._field=e}resize(e){throw new Error("Method not implemented.")}read(e,t){return e.readAttribute(this._field)}readWithDefault(e,t){return e.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}};function agt(i,e,t){if(i==null)return null;const r=e.readArcadeFeature();e.contextTimeZone=t.$view?.timeZone;try{return i.evaluate({...t,$feature:r},i.services)}catch(n){return di.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",n),null}}function YJe(i){return i==null||i===1/0||i===-1/0||typeof i=="number"&&isNaN(i)}function lgt(i,e,t,r){if(i==null)return r??null;const n=e.readArcadeFeature();e.contextTimeZone=t.$view?.timeZone;const s=i.evaluate({...t,$feature:n},i.services);return YJe(s)?r??null:s}let DKr=class Nzt extends xle{static async create(e,t){const r=await $At(e,t.spatialReference,t.fields),n=Q1(e);return new Nzt(r,n)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?agt(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?lgt(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=agt(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const n=lgt(this._compiled,e,t,r);return e.setCachedValue(n),n}};function FKr(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const n=i;for(const s of t.codedValues)if(s.code===n)return s.name}else if(t.type==="range"){const{max:n,min:s}=NAt(e),o=+i;if(s!=null&&n!=null&&s<=o&&o<=n)return t.name}}let r=i;return mW(e)?r=vb(r,T6("short-date")):wY(e)&&(r=DS(+r)),r||""}let kKr=class $zt extends xle{static async create(e,t){const r=vPt(e);return new $zt(n=>r.replaceAll(/{[^}]*}/g,s=>{const o=s.slice(1,-1),a=n.metadata.fieldsIndex.get(o);if(a==null)return s;const l=n.readAttribute(o);return l==null?"":FKr(l,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const n=this._evaluator(e);return YJe(n)?r:n}referencesScale(){return!1}referencesGeometry(){return!1}},LKr=class extends xle{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:n,normalizationType:s}=this._normalizationInfo,o=e.readAttribute(r);switch(s??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return n?t/n*100:null}}},ACe=class mye{static fromBuffer(e,t){return new mye(e,t)}static create(e,t=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new mye(r,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,n++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}};const gPe=()=>di.getLogger("esri.views.2d.layers.features.support.whereUtils"),NKr={getAttribute:(i,e)=>i.readAttribute(e)};async function Bzt(i,e){try{const t=await Ine(i,e);if(!t.isStandardized){const r=new qe("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);gPe().error(r)}return r=>{const n=r.readArcadeFeature();try{return t.testFeature(n,NKr)}catch{return gPe().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return gPe().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),r=>!0}}const ugt=()=>di.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),Gj=4294967295;function Vde(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let MCe=class{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(ACe.create(this._allocatedSize,Iy)),e+1}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?kKr.create(e.expression,this.compilationOptions):await DKr.create(e.expression,this.compilationOptions)}catch(n){const s=new qe("featurelayer","Failed to compile arcade expression",{error:n,expression:e.expression});return ugt().error(s),null}if(e.normalizationType||e.normalizationField)return new LKr(e.field,e);if(e.field)return new RKr(e.field);const r=new qe("featurelayer","Unable to create computed field. No expression or field found",{info:e});return ugt().error(r),null}async createWhereClause(e){return e?Bzt(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&Iy,0)}setComputedNumeric(e,t,r){return this.setComputedNumericAtIndex(e&Iy,r,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&Iy,0)}setComputedString(e,t,r){return this.setComputedStringAtIndex(e&Iy,0,r)}getComputedNumericAtIndex(e,t){const r=e&Iy;return this._ensureNumeric(t,r),this._numerics[t][r]}setComputedNumericAtIndex(e,t,r){const n=e&Iy;this._ensureNumeric(t,n),this._numerics[t][n]=r}getPackedChunkId(e){const t=e&Iy;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const r=e&Iy;this._ensureInstanceId(r),this._instanceIds[r]=t}getComputedStringAtIndex(e,t){const r=e&Iy;return this._ensureString(t,r),this._strings[t][r]}setComputedStringAtIndex(e,t,r){const n=e&Iy;this._ensureString(t,n),this._strings[t][n]=r}getXMin(e){return this._bounds[4*(e&Iy)]}getYMin(e){return this._bounds[4*(e&Iy)+1]}getXMax(e){return this._bounds[4*(e&Iy)+2]}getYMax(e){return this._bounds[4*(e&Iy)+3]}setBounds(e,t,r=!1){const n=e&Iy;if(!r&&!this._dirtyBitset.has(e))return this._bounds[4*n]!==Gj;this._dirtyBitset.unset(e);const s=t.readGeometryWorldSpace();if(Vde(this._bounds,4*n+4,0),!s||!s.coords.length)return this._bounds[4*n]=Gj,this._bounds[4*n+1]=Gj,this._bounds[4*n+2]=Gj,this._bounds[4*n+3]=Gj,!1;let o=1/0,a=1/0,l=-1/0,u=-1/0;return s.forEachVertex((c,h)=>{o=Math.min(o,c),a=Math.min(a,h),l=Math.max(l,c),u=Math.max(u,h)}),this._bounds[4*n]=o,this._bounds[4*n+1]=a,this._bounds[4*n+2]=l,this._bounds[4*n+3]=u,!0}getBounds(e,t){const r=this.getXMin(t),n=this.getYMin(t),s=this.getXMax(t),o=this.getYMax(t);return a1e(e,r,n,s,o),r!==Gj}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),Vde(this._numerics[e],t,0)}_ensureInstanceId(e){Vde(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),Vde(this._strings[e],t,null)}},Fbe=class{getObjectId(e){return e.getObjectId()}getAttributes(e){return e.readAttributes()}getAttribute(e,t){return e.readAttribute(t)}getAttributeAsTimestamp(e,t){return e.readAttributeAsTimestamp(t)}cloneWithGeometry(e,t){return e}getGeometry(e){return e.readGeometryWorldSpace()}getCentroid(e,t){return e.readCentroidForDisplay()}};Fbe.Shared=new Fbe;const vK=1,$Kr=2;let XJe=class jzt{constructor(e){this._geometryBounds=Wo(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new jzt(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,vK)}setTrue(e){const t=[],r=[],n=new Set(e);return this._idToVisibility.forEach((s,o)=>{const a=!!(this._idToVisibility.get(o)&vK),l=n.has(o);!a&&l?t.push(o):a&&!l&&r.push(o),this._idToVisibility.set(o,l?vK|$Kr:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:n,objectIds:s}=this;return Kn.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:n,objectIds:s})}async update(e,t){this._hash=JSON.stringify(e);const r=await AXe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await Bzt(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",n=await _U(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);gY(this._geometryBounds,t),this._spatialQueryOperator=n,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=O7t(this._serviceInfo.timeInfo,e.timeExtent,Fbe.Shared);else{const t=new qe("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);di.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&vK||(this._idToVisibility.set(r,vK),e.push(r))}),e}},OCe=class{constructor(e){this._options=e,this._fieldsIndex="fieldsIndex"in e?Cd.fromJSON(e.fieldsIndex):new Cd(e.fields),e.spatialReference&&(this._spatialReference=Xi.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}},BKr=class Gzt extends OCe{static create(e){return new Gzt({fields:[],objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}},Uzt=class{constructor(e){this._valid=ACe.create(e),this._data=new Array(e)}has(e){return this._valid.has(e)}set(e,t){this._valid.set(e),this._data[e]=t}get(e){return this._data[e]}};const PCe=yi("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],jKr=PCe[0],GKr=PCe[1],UKr=PCe[2],zKr=PCe[3],JJe=yi("featurelayer-simplify-payload-size-factors")??[1,2,4],VKr=JJe[0],HKr=JJe[1],WKr=JJe[2],qKr=yi("featurelayer-simplify-mobile-factor")??2,YKr=yi("esri-mobile"),cgt=4294967295;function XKr(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let RCe=class{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const n=YKr?qKr:1;t>4e6?r=WKr*n:t>1e6?r=HKr*n:t>5e5?r=VKr*n:t>1e5&&(r=n);let s=0;return e>4e3?s=zKr*r:e>2e3?s=UKr*r:e>100?s=GKr:e>15&&(s=jKr),s}parseTimestampOffset(e){return e}getBounds(e){if(XKr(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===cgt)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(cgt),!1;let a=1/0,l=1/0,u=-1/0,c=-1/0;return o.forEachVertex((h,p)=>{a=Math.min(a,h),l=Math.min(l,p),u=Math.max(u,h),c=Math.max(c,p)}),this.setBoundsXMin(a),this.setBoundsYMin(l),this.setBoundsXMax(u),this.setBoundsYMax(c),a1e(e,a,l,u,c),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),n=this.getBoundsXMax(),s=this.getBoundsYMax();return a1e(e,t,r,n,s),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const n of this._joined){n.setIndex(this.getIndex());const s=n._readAttribute(e,t);if(s!==void 0)return s}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const n of Object.keys(r))e[n]=r[n]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,n=this.getCursor();for(;n.next();){const s=n.getObjectId();Of(s),r.set(s,n.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),n=new ry(e,t,r);return n.objectId=this.getObjectId(),n.displayId=this.getDisplayId(),n}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return KC(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&cB(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),n=this.getInTransform();return n!=null&&cB(r,r,this.hasZ,this.hasM,n),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new Uzt(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=KC(e,this.geometryType,this.hasZ,this.hasM),r=Ro(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?ao.unknownDateJSToArcadeDate(t):ao.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??RS):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===YF}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Lu.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Nu.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return ao.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Lu.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Nu.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return ao.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const n in r.attributes){const s=r.attributes[n];s instanceof Date&&(r.attributes[n]=s.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return p7t(new $o,e,this.hasM,this.hasZ);const t=Ec.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=FGt(t);return r?(r[1]*=-1,new $o([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return KC(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new $o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new $o([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=ACe.create(this.getSize())),this._deleted.set(e)}},Gb=class T$ extends RCe{static fromFeatures(e,t){const{objectIdField:r,geometryType:n}=t,s=PW([],e,n,!1,!1,r);for(let o=0;o!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new T$(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndexFzt.create(o,c))),u=e.featureFilter?await XJe.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await Gv(t,Xi.WGS84),new zzt({fields:l,geohashLevel:a,spatialReference:t,featureFilter:u,timeZone:s},e.fields,r,n)}constructor(e,t,r,n){super(r,n,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new OCe({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:r.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new JKr(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset(),yield new qJe(t.subscription,Gb.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const n=new Map(e.map(o=>[t(o),o])),s=[];for(const o of this._sendStates.values())for(const a of o.featuresWorldSpace()){const{objectId:l,displayId:u}=a,c=n.get(l);if(c!=null){const h=r(u,c,l);s.push(h),n.delete(l)}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[];for(const s of this._sendStates.values())for(const o of s.featuresWorldSpace())t.has(o.displayId)&&!r.has(o.objectId)&&(o.geometry&&n.push({...hSe(o,this._metadata.geometryType,!1,!1),displayId:o.displayId}),r.add(o.objectId));return{features:[],aggregates:n}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const r of t.featuresWorldSpace())e(r)}async*_update(e,t){const{handledChunks:r,subscription:n,bins:s}=e,{spatialReference:o,geohashLevel:a}=this._indexOptions,l=n.tile;if(e.done)return;for(const S of t.chunks()){if(r.has(S.chunkId))continue;r.add(S.chunkId);const I=S.queryInfo;if("tileId"in I){const k=new Tc(I.tileId);if(k.level!==l.level||k.world!==l.key.world)continue}const R=S.getGeohashIndex(this._indexOptions),L=e.getGeohashBounds(o,a);L!=null&&R.putBins(s,L)}const u=[],c=n.tile.transform,h=n.tile.key.level;for(const S of s.values()){if(S.cachedFeature)S.cachedFeature.attributes=S.getAttributes();else{const I=S.getGeometry(this.spatialReference,c),R=new ry(I,S.getAttributes(),null);I||(R.centroid=S.getGeometryCentroid(this.spatialReference,c)),R.objectId=S.id,R.displayId=this._attributeStore.createDisplayIdForObjectId(`${R.objectId}.${h}`),S.cachedFeature=R}u.push(S.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const p=Gb.fromOptimizedFeatures(u,this._metadata,c),m=p.getCursor(),v=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;m.next();)this._attributeStore.setAttributeData(m.getDisplayId(),m,v);yield new I9e(e.subscription,p,[],e.done,{})}};const hgt=Math.PI/180;let Vzt=class A9e{static create(e){return new A9e(e.map(t=>ZKr(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ZKr(i){switch(i.statisticType){case"min":return new QKr(i);case"max":return new eZr(i);case"avg":return new iZr(i);case"avg_angle":return new rZr(i);case"sum":case"count":return new tZr(i);case"mode":return new nZr(i)}}let hX=class{constructor(e){this.field=e}insert(e,t){if(!this.field.computed)return;const r=this.field.computed.read(e,t);YJe(r)||this._insertValue(r)}},QKr=class Hzt extends hX{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new Hzt(this.field);return e.value=this.value,e}},eZr=class Wzt extends hX{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Wzt(this.field);return e.value=this.value,e}},tZr=class qzt extends hX{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new qzt(this.field);return e.value=this.value,e}},iZr=class Yzt extends hX{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new Yzt(this.field);return e._total=this._total,e._count=this._count,e}},rZr=class Xzt extends hX{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*hgt),this._y=this._y+Math.sin(e*hgt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Xzt(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},nZr=class Jzt extends hX{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,n]of this._frequencies.entries())n>t&&(t=n,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const n=this._frequencies.get(t);n!=null?this._frequencies.set(t,n+r):this._frequencies.set(t,r)}}clone(){const e=new Jzt(this.field);return e._frequencies=new Map(this._frequencies),e}},M9e=class gye{static createId(e,t){return`${e}.${t}`}static create(e,t,r,n){return new gye(e,t,Vzt.create(r),n)}constructor(e,t,r,n){this.gridX=e,this.gridY=t,this._statistics=r,this._worldUnitsPerCell=n,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return gye.createId(this.gridX,this.gridY)}get count(){return this._count}get statistics(){return this._statistics}get objectIds(){return this._objectIds}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new gye(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,n){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=n,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:nge(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:sge(e,this.centroidYWorld)}getCentroid(e){const t=new $o([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new $o;return wx(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e){const t=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,r=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new $o([],[t,r]);if(e!=null){const s=new $o;return wx(s,n,!1,!1,"esriGeometryPoint",e)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const sZr=96;function O9e(i,e){return pu(i)*mze*sZr/e}let oZr=class{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=O9e(e.spatialReference,e.scale)}insert(e,t){const r=e.getCursor(),n={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,n,t)}putCellsInBounds(e,t){const[r,n,s,o]=t,a=Math.floor(r*this._pixelsPerMapUnit/this._options.cellSize),l=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),u=Math.ceil(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let h=l;h<=c;h++)for(let p=a;p<=u;p++){const m=`${p}.${h}`,v=this._cells.get(m);if(!v)continue;const w=e.get(v.id);w?v&&!e.has(v.id)&&w.merge(v):e.set(v.id,v.clone())}}putCells(e){for(const t of this._cells.values()){const r=e.get(t.id);r?r.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,r){const{featureFilter:n}=this._options;if(n!==null&&!n.check(e))return;let s=0,o=0;if(e.geometryType==="esriGeometryPoint")s=e.readXWorldSpace(),o=e.readYWorldSpace();else{if(r){const p=e.readCentroidForDisplay();if(p==null)return;const[m,v]=p.coords;if(m<0||m>xo||v<0||v>xo)return}const h=e.readCentroidWorldSpace();if(h==null)return;s=h.coords[0],o=h.coords[1]}const a=s*this._pixelsPerMapUnit,l=o*this._pixelsPerMapUnit,u=Math.floor(a/this._options.cellSize),c=Math.floor(l/this._options.cellSize);this._getCellOrCreate(u,c).insert(e,t,s,o)}_getCellOrCreate(e,t){const r=M9e.createId(e,t);let n=this._cells.get(r);if(!n){const s=1*this._options.cellSize/this._pixelsPerMapUnit;n=M9e.create(e,t,this._options.fields,s),this._cells.set(r,n)}return n}},aZr=class{constructor(e,t){this.inner=e,this.displayId=t}};const Hde=128;let lZr=class extends WJe{constructor(e){super(e),this.didSend=!1,this.done=!1}},uZr=class{constructor(e,t,r,n,s){this._level=e,this._scale=t,this._indexOptions=r,this._clusterRadius=n,this._store=s,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),r=new ry(t,e.inner.getAttributes(),null);r.objectId=e.inner.id,r.displayId=e.displayId,yield r}}clusters(){return this._clusters.values()}updateChunks(e,t){let r=!1;for(const a of e){const l=a.queryInfo;"tileId"in l&&new Tc(l.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),r=!0,a.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells))}const n={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},s=O9e(this._indexOptions.spatialReference,this._scale),o=this._indexOptions.cellSize;for(const{subscription:a}of t){const l=a.tile.bounds,u=Math.floor(l[0]*s/o),c=Math.floor(l[1]*s/o),h=Math.ceil(l[2]*s/o),p=Math.ceil(l[3]*s/o);n.xMin=Math.min(n.xMin,u),n.yMin=Math.min(n.yMin,c),n.xMax=Math.max(n.xMax,h),n.yMax=Math.max(n.yMax,p)}return this._lastCellBounds!=null&&n.xMin===this._lastCellBounds.xMin&&n.yMin===this._lastCellBounds.yMin&&n.yMin===this._lastCellBounds.yMin&&n.yMax===this._lastCellBounds.yMax||(r=!0,this._lastCellBounds=n),r&&this._clusterCells(n),r}async updateStatistics(e){let t=!1;for(const r of this._clusters.values())r.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,r.inner)||t);if(t){const r=Array.from(this._statistics.entries()).map(([n,s])=>({fieldName:n,minValue:s.minValue,maxValue:s.maxValue}));await e.container.updateStatistics(this._level,r)}}createAggregateFeatures(e,t){const r=e.subscription,n=[],s=r.tile.transform;for(const o of this._clusters.values()){let a=o.inner.getCentroidX(s);const l=o.inner.getCentroidY(s),u=r.tile.lod,c=u.wrap?u.worldSize[0]:null,h=o.inner.count===1?o.inner.firstObjectId:o.inner.id,p=o.displayId;if(c!=null)if(c===1){const m=new $o([],[a,l]),v=new ry(m,o.inner.getAttributes(),null);v.geometry.coords[0]-=xo,v.objectId=h,v.displayId=p,n.push(v);const w=new $o([],[a,l]),S=new ry(w,o.inner.getAttributes(),null);S.geometry.coords[0]+=xo,S.objectId=h,S.displayId=p,n.push(S)}else a>xo+xo/2?a-=c*xo:a<-xo/2&&(a+=c*xo);if(a=-Hde&&l=-Hde){const m=new $o([],[a,l]),v=new ry(m,o.inner.getAttributes(),null);v.objectId=h,v.displayId=p,n.push(v)}}return Gb.fromOptimizedFeatures(n,t,r.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((a,l)=>l.count-a.count);const r=[];for(const a of this._clusters.values())r.push(a.inner.id);this._clusters.clear();const n=this._clusterRadius*(1/O9e(this._indexOptions.spatialReference,this._scale)),s=1+this._clusterRadius/this._indexOptions.cellSize,o=new Set;for(const a of t){if(o.has(a.id)||a.gridXe.xMax||a.gridYe.yMax)continue;const l=this._store.createDisplayIdForObjectId(a.id),u=new aZr(a.clone(),l);o.add(a.id),this._clusters.set(a.id,u);const c=a.centroidXWorld,h=a.centroidYWorld;for(let p=a.gridY-s;p<=a.gridY+s;p++)for(let m=a.gridX-s;m<=a.gridX+s;m++){if(p===a.gridY&&m===a.gridX)continue;const v=this._cells.get(M9e.createId(m,p));if(!v||o.has(v.id))continue;const w=Math.abs(v.centroidXWorld-c),S=Math.abs(v.centroidYWorld-h);wFzt.create(a,u))),spatialReference:r,featureFilter:t.featureFilter?await XJe.create({geometryType:n.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:n.metadata.timeInfo,fieldsIndex:n.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:o};return new Kzt(e,t.clusterRadius,l,t.fields,n,s)}constructor(e,t,r,n,s,o){super(s,o,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=new OCe({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...n,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new lZr(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const n=new Map(e.map(a=>[t(a),a])),s=[],o=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of o.clusters()){const l=n.get(a.inner.id);if(l==null){if(a.inner.count===1){const u=n.get(a.inner.firstObjectId);if(u!=null){const c=r(a.displayId,u,a.inner.firstObjectId);s.push(c),n.delete(a.inner.firstObjectId)}}}else{const u=r(a.displayId,l,a.inner.id);s.push(u),n.delete(a.inner.id)}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[],s=[],o=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of o.aggregatesWorldSpace())if(t.has(a.displayId)&&!r.has(a.displayId)){const l=hSe(a,this._metadata.geometryType,!1,!1);if(r.add(a.displayId),l.attributes.cluster_count===1){n.push({...l,displayId:a.displayId});continue}s.push({...l,displayId:a.displayId})}return{features:n,aggregates:s}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(o=>o.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const o of r)o.subscription.tile.level===this._requiredLevel&&(o.didSend=!1,o.done=!1);const n=Array.from(this._sendStates.values()).filter(o=>o.done).map(o=>o.subscription.tile.key),s=new Set(n);for(const o of this._sendStates.values())this._source.updateTracking.updating&&(n.some(a=>a.containsChild(o.subscription.tile.key))||o.subscription.tile.key.getChildKeys().every(a=>s.has(a)))||o.didSend||o.subscription.tile.level!==this._requiredLevel||(o.didSend=!0,yield*this._update(o,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new uZr(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const n=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const s=n.getCursor(),o=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;s.next();)this._attributeStore.setAttributeData(s.getDisplayId(),s,o);yield new qJe(e.subscription,n,!0,e.done,{})}},hZr=class Zzt{static fromReader(e){const t=[],r=e.copy(),n=Dx();for(;r.next();)r.getBounds(n)&&t.push(r.getIndex());const s=$W(9,o=>(r.setIndex(o),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return s.load(t),new Zzt(s)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}},dgt=class P9e{static create(e,t,r,n){const s=Vzt.create(e),o=new Array(32);for(let a=0;a=o)return;const p=Math.ceil((u+1)/2),m=Math.floor((u+1)/2),v=1-u%2,w=30-(3*p+2*m),S=30-(2*p+3*m),I=(n&7*v+3*(1-v)<>w,R=(s&3*v+7*(1-v)<>S,L=I+R*(8*v+4*(1-v));c=c<<3*v+2*(1-v)|I,h=h<<2*v+3*(1-v)|R,l.children[L]==null&&(l.children[L]=dgt.create(this._fields,c,h,u+1)),u+=1,l=l.children[L]}}putBins(e,t){for(const r of this.getNodes(t)){const n=e.get(r.id);n?n.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:n}=e;let s=this._root;for(;s!==null;){const o=s.depth,a=s.xNode,l=s.yNode;if(o>=n){t.push(s),s=s.next;continue}const u=Math.ceil((o+1)/2),c=Math.floor((o+1)/2),h=1-o%2,p=30-(3*u+2*c),m=30-(2*u+3*c),v=~((1<>p,I=(r.yLL&w)>>m,R=(r.xTR&v)>>p,L=(r.yTR&w)>>m,k=a<<3*h+2*(1-h),B=l<<2*h+3*(1-h),$=k+8*h+4*(1-h),V=B+4*h+8*(1-h),Y=Math.max(k,S),K=Math.max(B,I),Q=Math.min($,R),re=Math.min(V,L);let ne=null,de=null;for(let pe=K;pe<=re;pe++)for(let H=Y;H<=Q;H++){const Z=H-k+(pe-B)*(8*h+4*(1-h)),ae=s.children[Z];ae&&(ne||(ne=ae,ne.next=s.next),de&&(de.next=ae),de=ae,ae.next=s.next)}s=ne||s.next}return t}},pZr=class{constructor(e){this._options=e,this._tree=new dZr(e.fields)}insert(e,t){const r=e.getCursor(),n={$view:{scale:0,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,n,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,t,r){const{featureFilter:n,geohashLevel:s,spatialReference:o}=this._options;if(n!==null&&!n.check(e))return;let a=0,l=0;if(e.geometryType==="esriGeometryPoint")a=e.readXWorldSpace(),l=e.readYWorldSpace();else{if(r){const h=e.readCentroidForDisplay();if(h==null)return;const[p,m]=h.coords;if(p<0||p>xo||m<0||m>xo)return}const c=e.readCentroidWorldSpace();if(c==null)return;a=c.coords[0],l=c.coords[1]}const u=C9e(a,l,s,o);u&&this._tree.insert(e,a,l,u[0],u[1],s,t)}},fZr=class R9e extends RCe{static from(e,t){return new R9e(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[h,p]=e.scale,[m,v]=e.translate;return this._displayTranslationX=-m/h,this._displayScaleX=1/h,this._displayTranslationY=v/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,n]=t.scale,[s,o]=t.translate,[a,l]=e.scale,[u,c]=e.translate;if(this._displayScaleX=r/a,this._displayTranslationX=(s-u)/a,this._displayScaleY=n/l,this._displayTranslationY=(-o+c)/l,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1[t(o),o])),s=[];for(const o of this._source.chunks()){const a=o.reader.getCursor();for(;a.next();){const l=a.getObjectId(),u=a.getDisplayId(),c=n.get(l);if(c!=null){const h=r(u,c,l);s.push(h),n.delete(l)}}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[];for(const s of this._source.chunks()){const o=s.reader.getCursor();for(;o.next();){const a=o.getObjectId(),l=o.getDisplayId();t.has(l)&&!r.has(a)&&(n.push({...o.readLegacyFeatureWorldSpace(),displayId:l}),r.add(a))}}return{features:n,aggregates:[]}}async*applyOverride(e){const t=[],r=e.reader.getCursor();for(;r.next();){const a=r.getObjectId();t.push(a);const l=this._attributeStore.createDisplayIdForObjectId(a);r.setDisplayId(l),this._attributeStore.setAttributeData(l,r,this._evalOptions)}const n=this.getDisplayIds(t),s=this.getDisplayIds(e.removed),o=new Qzt(this._source.metadata);o.applyOverrides(e),this.handledChunks.add(o.chunkId),this.handledChunksForAttributeData.add(o.chunkId),this.handledChunksForIdCreation.add(o.chunkId);for(const a of this._sendStates.values())a.handledChunks.add(o.chunkId),yield new I9e(a.subscription,null,n,!1,o.queryInfo);for(const a of this._sendStates.values()){const l=o.getTileReader(a.subscription.tile);yield new I9e(a.subscription,l,s,!1,o.queryInfo)}for(const a of e.removed)this._attributeStore.releaseDisplayIdForObjectId(a)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const r=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(r):this._attributeStore.releaseDisplayIdForObjectId(r)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:r}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const n=r.getCursor();for(;n.next();){const s=this._attributeStore.createDisplayIdForObjectId(n.getObjectId());n.setDisplayId(s)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const r=t.getDisplayId();this._attributeStore.setAttributeData(r,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:r}=e;for(const n of this._source.chunks()){const{chunkId:s}=n;if(r.has(s))continue;r.add(s);const o=n.getTileReader(t.tile);o&&(yield new qJe(e.subscription,o,!1,n.end,n.queryInfo))}}};const yZr=(i,e)=>()=>null,vZr=!1;let _Zr=class{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}},bZr=class{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new _Zr(LJr(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}};function wZr(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const KJe=()=>di.getLogger("esri.views.layers.2d.features.support.AttributeStore"),xZr=yZr(vZr,KJe());yi("esri-shared-array-buffer"),yi("esri-atomics");let SZr=class{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:n,layout:s,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=n,this.layout=s,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(n,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let n=0;nt)return null;this._resetRange();const n=!this.isLocal,s=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:n&&a.slice(e*r,(t+1)*r)||null,pixelType:s,layout:o}}_initData(e,t){const r=ArrayBuffer,n=Bee(e),s=new n(new r(t*t*4*n.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,n,s=0){const o=nB(this._schema,e);if(this.version=s,o&&(yi("esri-2d-update-debug")&&console.debug(`Version[${s}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?XJe.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:n??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const l=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(l?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(l?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const l=e.bindings[a];await Promise.all(l.map(async u=>{const c=await this._bind(t,u,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(c?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(c?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const h=c*o%a,p=Math.floor(c*o/a),m=this._getBlock(p+Sv.VV);let v=u.field?.read(t,r);u.valueRepresentation&&(v=wZr(v,u.valueRepresentation)),(v===null||isNaN(v)||v===1/0||v===-1/0)&&(v=mUt),m.setData(n,h,v)}))}get epoch(){return this._epoch}async sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();yi("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),await this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch},this._signal),this._epoch+=1,yi("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const n=await e.createComputedField(t),{valueRepresentation:s}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:n,valueRepresentation:s}),o.map.set(r,a)}else o.map.set(t.binding,{field:n,valueRepresentation:s});return n}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(Sv.Animation),this._getBlock(Sv.GPGPU),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new SZr(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._sizethis._connection.layerView.fetch(r,n),fetchDictionary:(r,n)=>this._connection.layerView.fetchDictionary(r,n)}),this._attributeStore=new eVt({isLocal:!1,update:r=>NP(this._connection.container.updateAttributeView(r))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}async update(e,t,r,n,s){const o=e.processor,a=nB(this._schema,o);if(!a&&!n)return;yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a,schema:o}),this._schema=o;const l=Xi.fromJSON(e.source.mutable.dataFilter.outSpatialReference),u=new MCe({fields:this._source.metadata.fieldsIndex,spatialReference:l});return await this._attributeStore.update(o.storage,u,this._source.metadata,l,t),this._strategy?.invalidateAttributeData(),n||Aie(a,"mesh")?(Aie(a,"mesh.strategy")&&await this._updateStrategy(o.mesh.strategy,l,s,o.mesh.timeZone),this._updateSortKey(u,"sortKey"in o.mesh?o.mesh.sortKey:null),(Aie(a,"mesh.factory")||o.mesh.factory.symbology.type==="dictionary")&&(this._factory=await wKr.create(u,this._proxy,o.mesh.factory,r)),this._invalidate(),this._version=t,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(e){if(!this._strategy)return;const t=this._strategy.applyOverride(e);for await(const r of t)try{await this._process(r)}catch{}this._source.applyOverride(e)}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map(({objectId:r,highlightFlags:n})=>({objectId:r,highlightFlags:n,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:r})=>r,(r,{highlightFlags:n},s)=>({objectId:s,displayId:r,highlightFlags:n}));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const n of e){let s=r.get(n.id);s==null&&(s=new SKr({concurrency:16,process:a=>this._process(a)}),r.set(n.id,s));const o=s.push(n).catch(a=>l3(a));t.push(o)}try{await Promise.all(t)}catch{}yi("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,r,n){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new gZr(this._source,this._attributeStore,n);break;case"binning":this._strategy=await KKr.create(e,t,this._source,this._attributeStore,n);break;case"cluster":this._strategy=await cZr.create(this._connection,e,t,this._source,this._attributeStore,n)}for(const s of r)this._strategy.onSubscribe(s)}async _updateSortKey(e,t){if(this._sortInfo=zo(this._sortInfo?.computed),t!=null){const r=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:r}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(yi("esri-2d-update-debug")){const l=t.tile;console.debug(`Version[${this._version}] Tile[${l.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),hn(t.signal);const r=await this._write(e,t.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone)),n=t.tile.tileInfoView.tileInfo.isWrappable,{message:s,transferList:o}=r.serialize(n),a=e.createMessage(s,this._version,this._attributeStore.epoch);if(hn(t.signal),this._connection.container.onMessage(a,{signal:t.signal,transferList:o}),this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")){const l=t.tile;console.debug(`Version[${this._version}] Tile[${l.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,r);await this._proxy.fetchEnqueuedResources()}async _write(e,t){const r=e.subscription.tile,n=e.reader?.getCursor(),s=n?.getSize()??0,o=r.tileInfoView.tileInfo.isWrappable,a=new bHr(r.key,this._strategy.enablePixelBuffering,o,s);if(!n)return a;const l=r.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;n.next();){const u=this._getSortKeyValue(n,t);a.entityStart(n.getDisplayId(),u),this._factory.write(a,this._proxy,n,l,r.level),a.entityEnd()}return a}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:r,order:n,byRenderer:s}=this._sortInfo,o=s?this._factory.getSortKey(e,t):r?.read(e,t);return o==null||isNaN(o)?0:o*(n==="asc"?-1:1)}},CZr=class tVt{static from(e){let t=0,r=0,n=0;return e.forEach(s=>{const o=s._readGeometry();o&&(r+=o.isPoint?1:o.lengths.reduce((a,l)=>a+l,0),n+=o.isPoint?1:o.lengths.length,t+=1)}),new tVt(t,r,n)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const yPe=4;function EZr(i,e){const{service:t}=i,r=t.orderByFields??e.objectIdField+" ASC",n=t.source,s={returnCentroid:!(n!==null&&typeof n=="object"&&"path"in n&&Fx(n.path))&&e.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:e.timeReferenceUnknownClient??void 0,outSpatialReference:Xi.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[r],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if(i.type==="feature"){const{gdbVersion:o,historicMoment:a,timeExtent:l}=i.mutable.dataFilter;return{...s,gdbVersion:o,historicMoment:a?new Date(a):null,timeExtent:l?Eg.fromJSON(l):null,outFields:i.mutable.availableFields}}return s}let IZr=class iVt{static fromSchema(e,t){return new iVt(EZr(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,n){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=n}get pageSize(){if(this._capabilities==null)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?yPe:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const n=new Set(this._queryParams.outFields),s=[];for(const o of n)t.hasField(o)||s.push(o);if(s.length===0)return null;r.outFields=s}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new Kn({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._capabilities==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),n=r.inner;return n.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),n.resultType="tile",n.geometry=e.extent,this._capabilities.query.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(n.maxAllowableOffset=e.resolution*yi("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(n.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(n.maxAllowableOffset*=yi("feature-polyline-generalization-factor"))),n.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,n.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(n.maxRecordCountFactor=yPe),r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:yPe})}};const AZr=2500;let yye=class extends un{constructor(e){super(),this._connection=e,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this.addHandles([Ki(()=>this._strategy?.connectionStatus??"disconnected",t=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:t})},{initial:!0}),Ki(()=>this._strategy?.errorString||null,t=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:t}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){this._strategy==null&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),e!=null&&this.addHandles([e.events.on("data-received",r=>this._onFeature(r)),e.events.on("message-received",r=>this._onWebSocketMessage(r)),e.events.on("features-updated",r=>this._onUpdate(r)),e.events.on("tick",()=>this._onTick())],t),this._strategy=e}updateCustomParameters(e){e!=null&&this._strategy?.updateCustomParameters(e)}sendMessageToSocket(e){this._strategy?.sendMessageToSocket(e)}sendMessageToClient(e){this._strategy?.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>AZr){const r=Math.round(this._updateInfo.client/(t/1e3)),n=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:r,websocket:n}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}};x([D()],yye.prototype,"_strategy",void 0),yye=x([Qe("esri.views.2d.layers.features.sources.StreamMessenger")],yye);let rVt=class{constructor(e){this._store=e,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}async queryOverride(e){throw new Error("InternalError: LoadStrategy does not support fetching")}};const vye=()=>di.getLogger("esri.layers.ogc.ogcFeatureUtils"),nVt="startindex",MZr=new Set([nVt,"offset"]),ZJe="http://www.opengis.net/def/crs/",pgt=`${ZJe}OGC/1.3/CRS84`;var pg;async function OZr(i,e,t={},r=5){const{links:n}=i,s=sE(n,"items",pg.geojson)||sE(n,"http://www.opengis.net/def/rel/ogc/1.0/items",pg.geojson);if(s==null)throw new qe("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:o,customParameters:a,signal:l}=t,u=xf(s.href,i.landingPage.url),c={limit:r,...a,token:o},h=gg(u,c),p={accept:pg.geojson},{data:m}=await zi(h,{signal:l,headers:p}),v=GZr(h,r,m.links)??nVt;aJe(m);const w=$jt(m,{geometryType:e.geometryType}),S=e.fields||w.fields||[],I=e.hasZ!=null?e.hasZ:w.hasZ,R=w.geometryType,L=e.objectIdField||w.objectIdFieldName||"OBJECTID";let k=e.timeInfo;const B=S.find(({name:$})=>$===L);if(B)B.editable=!1,B.nullable=!1;else{if(!w.objectIdFieldType)throw new qe("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");S.unshift({name:L,alias:L,type:w.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(L!==w.objectIdFieldName){const $=S.find(({name:V})=>V===w.objectIdFieldName);$&&($.type="esriFieldTypeInteger")}S===w.fields&&w.unknownFields.length>0&&vye().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:w.unknownFields}});for(const $ of S){if($.name==null&&($.name=$.alias),$.alias==null&&($.alias=$.name),$.type!=="esriFieldTypeOID"&&$.type!=="esriFieldTypeGlobalID"&&($.editable=$.editable==null||!!$.editable,$.nullable=$.nullable==null||!!$.nullable),!$.name)throw new qe("ogc-feature-layer:invalid-field-name","field name is missing",{field:$});if(!wW.jsonValues.includes($.type))throw new qe("ogc-feature-layer:invalid-field-type",`invalid type for field "${$.name}"`,{field:$})}if(k){const $=new Cd(S);if(k.startTimeField){const V=$.get(k.startTimeField);V?(k.startTimeField=V.name,V.type="esriFieldTypeDate"):k.startTimeField=null}if(k.endTimeField){const V=$.get(k.endTimeField);V?(k.endTimeField=V.name,V.type="esriFieldTypeDate"):k.endTimeField=null}if(k.trackIdField){const V=$.get(k.trackIdField);V?k.trackIdField=V.name:(k.trackIdField=null,vye().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:k}}))}k.timeReference||={timeZoneIANA:y0},k.startTimeField||k.endTimeField||(vye().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:k}}),k=null)}return{drawingInfo:R?KA(R):null,extent:jZr(i),geometryType:R,fields:S,hasZ:!!I,objectIdField:L,paginationParameter:v,timeInfo:k}}async function PZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"data",pg.json)||sE(t,"http://www.opengis.net/def/rel/ogc/1.0/data",pg.json);if(n==null)throw new qe("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.json},query:{...o,token:s}});for(const c of u.collections)c.landingPage=i;return u}async function RZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"conformance",pg.json)||sE(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance",pg.json);if(n==null)throw new qe("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.json},query:{...o,token:s}});return u}async function DZr(i,e={}){const{apiKey:t,customParameters:r,signal:n}=e,{data:s}=await zi(i,{signal:n,headers:{accept:pg.json},query:{...r,token:t}});return s.url=i,s}async function FZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"service-desc",pg.openapi);if(n==null)return vye().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.openapi},query:{...o,token:s}});return u}function fgt(i){const e=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(i),t=e?.groups;if(!t)return null;const{authority:r,code:n}=t;switch(r.toLowerCase()){case"ogc":switch(n.toLowerCase()){case"crs27":return Xi.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return Xi.WGS84.wkid;default:return null}case"esri":case"epsg":{const s=Number.parseInt(n,10);return Number.isNaN(s)?null:s}default:return null}}async function kZr(i,e,t){const r=await D9e(i,e,t);return zdr(r)}async function D9e(i,e,t){const{collection:{links:r,landingPage:{url:n}},layerDefinition:s,maxRecordCount:o,queryParameters:{apiKey:a,customParameters:l},spatialReference:u,supportedCrs:c}=i,h=sE(r,"items",pg.geojson)||sE(r,"http://www.opengis.net/def/rel/ogc/1.0/items",pg.geojson);if(h==null)throw new qe("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:p,num:m,start:v,timeExtent:w,where:S}=e;if(e.objectIds)throw new qe("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const I=Xi.fromJSON(u),R=e.outSpatialReference??I,L=R.isWGS84?null:sVt(R,c),k=BZr(p,c),B=NZr(w),$=$Zr(S),V=m??(v==null?o:10),Y=v===0?void 0:v,{fields:K,geometryType:Q,hasZ:re,objectIdField:ne,paginationParameter:de}=s,pe=xf(h.href,n),{data:H}=await zi(pe,{...t,query:{...l,...k,crs:L,datetime:B,query:$,limit:V,[de]:Y,token:a},headers:{accept:pg.geojson}}),Z=lJe(H,{geometryType:Q,hasZ:re,objectIdField:ne}),ae=Z.length===V&&!!sE(H.links??[],"next",pg.geojson),fe=new Cd(K);for(const Ie of Z){const Te={};RF(fe,Te,Ie.attributes),Te[ne]=Ie.attributes[ne],Ie.attributes=Te}if(!L&&R.isWebMercator){for(const Ie of Z)if(Ie.geometry!=null&&Q!=null){const Te=KC(Ie.geometry,Q,re,!1);Te.spatialReference=Xi.WGS84,Ie.geometry=Z2(HB(Te,R))}}for(const Ie of Z)Ie.objectId=Ie.attributes[ne];const be=L||!L&&R.isWebMercator?R.toJSON():Yp,_e=new OHe;return _e.exceededTransferLimit=ae,_e.features=Z,_e.fields=K,_e.geometryType=Q,_e.hasZ=re,_e.objectIdFieldName=ne,_e.spatialReference=be,_e}function LZr(i){return i!=null&&i.type==="extent"}function sVt(i,e){const{isWebMercator:t,wkid:r}=i;if(!r)return null;const n=t?e[3857]??e[102100]??e[102113]??e[900913]:e[i.wkid];return n?`${ZJe}${n}`:null}function vPe(i){if(i==null)return"";const{xmin:e,ymin:t,xmax:r,ymax:n}=i;return`${e},${t},${r},${n}`}function NZr(i){if(i==null)return null;const{start:e,end:t}=i;return`${e!=null?e.toISOString():".."}/${t!=null?t.toISOString():".."}`}function $Zr(i){return i!=null&&i&&i!=="1=1"?i:null}function BZr(i,e){if(!LZr(i))return null;const{spatialReference:t}=i;if(!t||t.isWGS84)return{bbox:vPe(i)};const r=sVt(t,e);return r!=null?{bbox:vPe(i),"bbox-crs":r}:t.isWebMercator?{bbox:vPe(HB(i,Xi.WGS84))}:null}function jZr(i){const e=i.extent?.spatial;if(!e)return null;const t=e.bbox[0],r=t.length===4,[n,s]=t,o=r?void 0:t[2];return{xmin:n,ymin:s,xmax:r?t[2]:t[3],ymax:r?t[3]:t[4],zmin:o,zmax:r?void 0:t[5],spatialReference:Xi.WGS84.toJSON()}}function sE(i,e,t){return i.find(({rel:r,type:n})=>r===e&&n===t)??i.find(({rel:r,type:n})=>r===e&&!n)}function GZr(i,e,t){if(!t)return;const r=sE(t,"next",pg.geojson),n=Yo(r?.href)?.query;if(!n)return;const s=Yo(i).query,o=Object.keys(s??{});return Object.entries(n).filter(([u])=>!o.includes(u)).find(([u,c])=>MZr.has(u.toLowerCase())&&Number.parseInt(c,10)===e)?.[0]}(function(i){i.json="application/json",i.geojson="application/geo+json",i.openapi="application/vnd.oai.openapi+json;version=3.0"})(pg||(pg={}));const _Pe=268435455;let UZr=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function zZr(i,e,t=!1){const u=i.asUnsafe(),c=u.pos(),h=new UZr;let p=0,m=0;const v=1,w=2,S=4,I=3;let R=null,L=null,k=null,B=!1;const $=[];for(;u.next();)switch(u.tag()){case 1:R=u.getString();break;case 3:L=u.getString();break;case 12:k=u.processMessage(aDt);break;case 9:if(h.exceededTransferLimit=u.getBool(),h.exceededTransferLimit){h.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),h.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let Y=0;Y0}let XZr=class F9e extends RCe{static fromBuffer(e,t,r=!1){const n=t.geometryType,s=HZr(e),o=zZr(s,n==="esriGeometryPoint",r);return new F9e(s,o,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new F9e(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexh.length)for(let S=0;S=S?(p+=-.5*(Q-k)*(re+B),R>1&&bPe(h[c-2],h[c-1],$,V)?(h[c-2]+=$,h[c-1]+=V):(h[c++]=$,h[c++]=V,R++),k=Q,B=re):(Y+=$,K+=V),$=Y,V=K,I++}R<3||L?c-=2*R:(p+=-.5*(k+$-k)*(B+V+B),bPe(h[c-2],h[c-1],$,V)?(h[c-2]+=$,h[c-1]+=V,l.push(R)):(h[c++]=$,h[c++]=V,l.push(++R)))}else{let S=0,I=n.getSInt32(),R=n.getSInt32();this.hasZ&&n.getSInt32(),this.hasM&&n.getSInt32(),h[c++]=I,h[c++]=R,S+=1;for(let L=1;L2&&bPe(h[c-2],h[c-1],k,B)?(h[c-2]+=k,h[c-1]+=B):(h[c++]=k,h[c++]=B,S+=1),I=$,R=V}l.push(S)}break}default:n.skip()}return this._cache.area=p,l.length?new $o(l,h):null}},DCe=class{constructor(e,t){this.service=e,this._metadata=t}destroy(){}};function JZr(i,e){switch(i.type){case"memory":return new ZZr(i,e);case"ogc":return new tQr(i,e);case"feature-service":return i.queryMetadata.capabilities.query.supportsFormatPBF&&yi("featurelayer-pbf")?new QZr(i,e):new eQr(i,e)}}async function KZr(i){const e=new oOt;return await e.open(i,{}),e}let ZZr=class extends DCe{constructor(e,t){super(e,t),this._portsOpen=KZr(e.source).then(r=>this.client=r)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),t);return Gb.fromFeatureSet(r,this._metadata)}},QZr=class extends DCe{async executeQuery(e,t){const{data:r}=await cDt(this.service.source,e,t),n=!e.quantizationParameters;return XZr.fromBuffer(r,this._metadata,n)}},eQr=class extends DCe{async executeQuery(e,t){const{source:r,queryMetadata:n}=this.service,s=n.capabilities;if(e.quantizationParameters!=null&&!s.query.supportsQuantization){const a=e.clone(),l=p1e(a.quantizationParameters);a.quantizationParameters=null;const{data:u}=await OW(r,a,this._metadata.spatialReference,t),c=HHe(u,this._metadata.objectIdField);return RDt(l,c),Gb.fromOptimizedFeatureSet(c,this._metadata)}const{data:o}=await OW(r,e,this._metadata.spatialReference,t);return this._metadata.geometryType==="esriGeometryPoint"&&(o.features=o.features?.filter(a=>{if(a.geometry!=null){const l=a.geometry;return Number.isFinite(l.x)&&Number.isFinite(l.y)}return!0})),Gb.fromFeatureSet(o,this._metadata)}},tQr=class extends DCe{async executeQuery(e,t){const{capabilities:r}=this.service.queryMetadata;if(e.quantizationParameters&&!r.query.supportsQuantization){const s=e.clone(),o=p1e(s.quantizationParameters);s.quantizationParameters=null;const a=await D9e(this.service.source,e,t);return RDt(o,a),Gb.fromOptimizedFeatureSet(a,this._metadata)}const n=await D9e(this.service.source,e,t);return Gb.fromOptimizedFeatureSet(n,this._metadata)}},oVt=class extends rVt{constructor(e,t,r,n,s){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=n,this._eventLog=s,this._queue=new UY({concurrency:16,process:async o=>{const a={signal:o.options?.signal,query:o.query.customParameters};return this._adapter.executeQuery(o.query.inner,a)}}),this._adapter=JZr(e,n)}async updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this._store.chunks()).map(async n=>{const s=Kn.fromJSON(n.queryInfo.queryJSON);if(s)try{return await this._tryUpdateFields(n.reader,s),null}catch(o){return o}}),r=(await Promise.all(t)).filter(n=>n);if(r.length)throw new qe("featurelayer-query","Encountered errors when downloading fields",{errors:r})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)o.objectId!=null&&o.objectId!==-1?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const n=e.addOrModified.map(({objectId:o})=>o);let s;if(n.length){const o=this._queryInfo.createQuery({objectIds:n});s=await this._fetch(o)}else s=Gb.empty(this._metadata);return{reader:s,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(r==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const n=[];return this._store.forEachUnsafe(s=>{const o=s.readAttribute(r);t.has(o)&&n.push(s.getObjectId())}),n}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e);if(!r)return;const n=await this._enqueue(r,this._options);e.joinAttributes(n)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._eventLog.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},aVt=class extends oVt{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const r=e.size();(r||e.first||e.end)&&(yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${r}]`),this._chunksById.get(t).push(e),this._store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const r of t)yi("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${r.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(r);this._chunksById.delete(e.key.id)}},_gt=class extends Dle{constructor(e,t,r,n,s,o){super(),this._reader=e,this._queryJSON=t,this._tile=r,this._sourceTile=n,this._sourceTileDepth=s,this._end=o,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}},iQr=class{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,Qh(e.options,()=>this._controller.abort()),Qh(t,()=>this._controller.abort())}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}},rQr=class extends aVt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new iQr(e,this._options));const t=this._loadStates.get(e.key.id);let r;try{for await(const s of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:o,reader:a,sourceTile:l,sourceTileDepth:u,tile:c}=s,h=new _gt(a,o,c,l,u,!1);hn(e.options),this._addChunk(h)}}catch(s){r=s}const n=new _gt(Gb.empty(this._metadata),null,e.tile,null,-1,!0);if(this._addChunk(n),r)throw r}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,r){let n=e.get(t.id);const s=!!n;if(n||(n=await this._fetchChunkInfo(e,t,r),e.set(t.id,n)),n.reader.exceededTransferLimit&&rthis._controller.abort()),Qh(t,()=>this._controller.abort())}resetAbortController(){this._controller=new AbortController}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}},sQr=class extends aVt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new nQr(e,this._options));const t=this._loadStates.get(e.key.id);let r;t.resetAbortController();try{await this._fetchPages(t)}catch(s){r=s}const n=new bgt(Gb.empty(this._metadata),null,e.tile,-1,!0);if(xg(t.options)||this._addChunk(n),r)throw r}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async _fetchPages(e){let n=0,s=e.pageStart,o=1;for(;n<20&&!e.done;){const a=[];for(let u=0;ul).sort((a,l)=>this._random.getInt()-this._random.getInt()),n=await Promise.all(r.map(a=>this._downloadPage(a))),s=new wgt(Gb.empty(this._metadata),null,-1,!0);this._store.insert(s);const o=n.filter(a=>a);if(o.length)throw new qe("featurelayer-query","Encountered errors when downloading data",{errors:o})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),n=new wgt(r,t.inner.toJSON(),e,!1);return hn(this._options),this._store.insert(n),null}catch(t){return t}}},k9e=class{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(this.size===0)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return this.size===0?null:this._buffer[this._start]}find(e){if(this.size===0)return null;for(const t of this._buffer)if(t!=null&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;t!=null;)e&&e(t),t=this.dequeue()}};const aQr="__esri_stream_id__",xgt="__esri_timestamp__",Sgt=1e3;let lQr=class{constructor(e,t,r,n,s=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=n,this.store=e,this.objectIdField=t,this.purgeInterval=s,this._useGeneratedIds=this.objectIdField===aQr}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const o=this._nextId();e.attributes[this.objectIdField]=o,e.objectId=o}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new k9e(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const o=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Sgt,a=uu(o,0,Sgt);this._trackIdToObservations.set(r,new k9e(a))}const n=this._trackIdToObservations.get(r),s=n?.enqueue(t);s!=null&&(this._addOrUpdated.has(s)?this._addOrUpdated.delete(s):this._removed.push(s))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const n=[];if(t!=null)for(const o of t){const a=this.store.removeById(o);a!=null&&n.push(a)}const s=[];if(e!=null){const o=new Set(t??[]);for(const a of e)o.has(a.objectId)||(a.attributes[xgt]=r,this.store.add(a),s.push(a))}return!(!s.length&&!n?.length)&&(this.store.update(s,n),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const n=r.dequeue();this._removed.push(n),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const n=this._trackIdLessObservations.dequeue();n!=null&&this._removed.push(n)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,n=this._maxAge-r;this.store.forEach(s=>{s.attributes[t]{n.attributes[xgt]{e.size===0&&this._trackIdToObservations.delete(t)})}},_ye=class extends rd.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new qe("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};x([D({readOnly:!0})],_ye.prototype,"connectionError",null),_ye=x([Qe("esri.layers.support.StreamConnection")],_ye);const lVt=_ye;var oV;(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.OPEN=1]="OPEN",i[i.CLOSING=2]="CLOSING",i[i.CLOSED=3]="CLOSED"})(oV||(oV={}));let aV=class extends lVt{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=IY(t,n,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case oV.CONNECTING:case oV.OPEN:return"connected";case oV.CLOSING:case oV.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const n=gg(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(n),this.notifyChange("connectionStatus")}catch(n){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(di.getLogger(this).error(new qe("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(di.getLogger(this).error(new qe("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await jk(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void di.getLogger(this).error(new qe("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const n=new WebSocket(e);n.onopen=()=>{if(n.onopen=null,this.destroyed)return n.onclose=null,void n.close();n.onclose=s=>this._onClose(s),n.onerror=s=>this._onError(s),this._setWebSocketJSONParseHandler(n),t(n)},n.onclose=s=>{n.onopen=n.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=ac(),n=t.onmessage,{filter:s,outFields:o,spatialReference:a}=this._config;return r.timeout(e),t.onmessage=l=>{let u=null;try{u=JSON.parse(l.data)}catch{}u&&typeof u=="object"||(di.getLogger(this).error(new qe("websocket-connection","Protocol violation. Handshake failed - malformed message",l.data)),r.reject(),this.destroy()),u.spatialReference?.wkid!==a?.wkid&&(di.getLogger(this).error(new qe("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,l.data)),r.reject(),this.destroy()),u.format!=="json"&&(di.getLogger(this).error(new qe("websocket-connection","Protocol violation. Handshake failed - format is not set",l.data)),r.reject(),this.destroy()),s&&u.filter!==s&&di.getLogger(this).error(new qe("websocket-connection","Tried to set filter, but server doesn't support it")),o&&u.outFields!==o&&di.getLogger(this).error(new qe("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=n;for(const c of this._outstandingMessages)t.send(JSON.stringify(c));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:o,format:"json",spatialReference:{wkid:a.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),di.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&di.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};x([D()],aV.prototype,"connectionStatus",null),x([D()],aV.prototype,"errorString",void 0),aV=x([Qe("esri.layers.graphics.sources.connections.WebSocketConnection")],aV);const uQr=1e4,cQr={maxQueryDepth:5,maxRecordCountFactor:3};let L9e=class extends aV{constructor(e){super({...cQr,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||di.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void di.getLogger(this).error(new qe("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=zi(e.path,{query:t,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return gg(`${o}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return di.getLogger(this).error(new qe("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const o=ac(),a=()=>{s||(this.destroyed||this._websocket!==r||di.getLogger(this).error(new qe("geoevent-connection","Server timed out when setting filter")),o.reject())},l=u=>{const c=JSON.parse(u.data);c.filter&&(c.error&&(di.getLogger(this).error(new qe("geoevent-connection","Failed to set service filter",c.error)),this._set("errorString",`Could not set service filter - ${c.error}`),o.reject(c.error)),this._setWebSocketJSONParseHandler(r),s=!0,o.resolve())};return r.onmessage=l,r.send(n),setTimeout(a,uQr),o.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const n=Ro(e.geometry);if(n.type!=="extent")throw new qe(`Expected extent but found type ${n.type}`);r.geometry=JSON.stringify(n.shiftCentralMeridian())}catch(n){di.getLogger(this).error(new qe("geoevent-connection","Encountered an error when setting connection geometryDefinition",n))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],n=this._relatedFeatures.get(r);if(!n)return di.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:o}=n;for(const a in s)e.attributes[a]=s[a];return o&&(e.geometry=o),e.geometry||e.centroid||di.getLogger(this).error(new qe("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(t);await r;const s=await n;if(!s)return;for(const o of s.features)this.onFeature(this._enrich(o))}catch(e){di.getLogger(this).error(new qe("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await Promise.resolve().then(()=>rHe)).default({url:e}),{capabilities:r}=await t.load(),n=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,u=n?l*a:l,c=new Kn;if(c.outFields=this._config.outFields??["*"],c.where=this._config.filter?.where??"1=1",c.returnGeometry=!0,c.returnExceededLimitFeatures=!0,c.outSpatialReference=Xi.fromJSON(this._config.spatialReference),o&&(c.returnCentroid=!0),n&&(c.maxRecordCountFactor=a),s)return c.num=u,t.destroy(),this._queryPages(e,c);const h=await OW(e,c,this._config.sourceSpatialReference);return t.destroy(),h.data}async _queryPages(e,t,r=[],n=0){t.start=t.num!=null?n*t.num:null;const{data:s}=await OW(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(o=>r.push(o)),this._queryPages(e,t,r,n+1)):(r.forEach(o=>s.features.push(o)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const o=s.attributes[n];t.set(o,s)}this._relatedFeatures=t}};L9e=x([Qe("esri.layers.graphics.sources.connections.GeoEventConnection")],L9e);const hQr=L9e;let Wee=class extends lVt{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=IY(t,n,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};x([D()],Wee.prototype,"connectionStatus",void 0),x([D()],Wee.prototype,"errorString",void 0),Wee=x([Qe("esri.layers.support.ClientSideConnection")],Wee);function dQr(i,e){if(i==null&&e==null)return null;const t={};return e!=null&&(t.geometry=e),i!=null&&(t.where=i),t}function uVt(i,e,t,r,n,s,o,a,l){const u={source:i,sourceSpatialReference:e,spatialReference:t,geometryType:r,filter:dQr(n,s),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:l};return i?i.path.startsWith("wss://")||i.path.startsWith("ws://")?new aV(u):new hQr(u):new Wee(u)}const pQr=Object.freeze(Object.defineProperty({__proto__:null,createConnection:uVt},Symbol.toStringTag,{value:"Module"}));let SU=class extends un{constructor(e){super(e)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};x([D()],SU.prototype,"connection",void 0),x([D()],SU.prototype,"connectionStatus",null),x([D()],SU.prototype,"errorString",null),SU=x([Qe("esri.views.2d.layers.features.sources.StreamConnectionState")],SU);let fQr=class{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return Gb.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate(e?.length??0)}},mQr=class extends Dle{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}},gQr=class extends rVt{constructor(e,t,r,n,s){super(r),this._service=e,this._dataFilter=t,this._streamOptions=n,this._metadata=s,this._connectionState=new SU,this._forceRefresh=!1,this.events=new rd;const{objectIdField:o,timeInfo:a}=this._metadata,{purgeOptions:l}=t;this._stagingStore=new fQr(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new lQr(this._stagingStore,o,a,l),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new mQr(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=zo(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:n,geometryDefinition:s,definitionExpression:o,customParameters:a}=this._dataFilter;this._connection=uVt(this._service.source,t,this._streamOptions.outSR,e,o,s,r,n,a),this._handlesGroup=j3([this._connection.on("data-received",l=>this._onFeature(l)),this._connection.on("message-received",l=>this._onWebSocketMessage(l))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}},yQr=class{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new rd,this.featureAdapter=new Fbe}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrideChunk!=null&&this._chunksToRemove.push(this._overrideChunk),this._overrideChunk=null}*chunks(){this._overrideChunk&&(yield this._overrideChunk),yield*this._chunks.values()}insert(e){yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrideChunk?.overridenIds.size&&e.reader.removeIds(this._overrideChunk.overridenIds),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyOverrides(e,t){this._overrideChunk==null&&(this._overrideChunk=new Qzt(t)),this._overrideChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._overrideChunk.overridenIds),r.invalidate()}forEach(e){const t=new Set;for(const r of this.chunks()){const n=r.reader.getCursor();for(;n.next();){const s=n.getObjectId();t.has(s)||(e(n.copy()),t.add(s))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const n=r.reader.getCursor();for(;n.next();){const s=n.getObjectId();t.has(s)||(e(n),t.add(s))}}}forEachInBounds(e,t){const r=new Set;for(const n of this.chunks()){const s=n.queryFeaturesInBounds(e);for(;s.next();){const o=s.getObjectId();r.has(o)||(t(s.copy()),r.add(o))}}}forEachBounds(e,t){const r=Dx();for(const n of e)n.getBounds(r)&&t(r)}},E8=class extends un{constructor(e){super(e),this.debugName="",this._updatingHandles=new Mb,this._idToUpdatingState=new WV}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(yi("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([r,n])=>`-> ${r}: ${n}`).join(` +`+KXr(e++)+":")}function KXr(i){return i>=1e3?i.toString():(" "+i).slice(-3)}function JE(i,e,t){const r=i.get(e);if(!r)return i.set(e,Array.from(t)),!0;const n=t.length;if(r.length!==n)return i.set(e,Array.from(t)),!0;for(let s=0;sdi.getLogger("esri.views.2d.engine.webgl.Utils");function ZXr(i){switch(i){case lc.UNSIGNED_BYTE:return 1;case lc.UNSIGNED_SHORT_4_4_4_4:return 2;case lc.FLOAT:return 4;default:return void rzt().error(new qe("webgl-utils",`Unable to handle type ${i}`))}}function Bee(i){switch(i){case lc.UNSIGNED_BYTE:return Uint8Array;case lc.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case lc.FLOAT:return Float32Array;default:return void rzt().error(new qe("webgl-utils",`Unable to handle type ${i}`))}}function QXr(i){const e={};for(const t in i){const r=i[t];let n=0;e[t]=r.map(s=>{const o=new Hl(s.name,s.count,s.type,n,0,s.normalized||!1);return n+=s.count*JUt(s.type),o}),e[t]?.forEach(s=>s.stride=n)}return e}const eJr=i=>{const e=new Map;for(const t in i)for(const r of i[t])e.set(r.name,r.location);return e},tJr=i=>{const e={};for(const t in i){const r=i[t];e[t]=r?.length?r[0].stride:0}return e},fPe=new Map,xCe=(i,e)=>{if(!fPe.has(i)){const t=QXr(e),r={strides:tJr(t),bufferLayouts:t,attributes:eJr(e)};fPe.set(i,r)}return fPe.get(i)},iJr=i=>i.includes("data:image/svg+xml");function rJr(i){const e=[];for(let t=0;tdi.getLogger("esri.views.2d.engine.webgl.shaderGraph.typed.TypedShaderProgram");function mK(i,e,t){const r=e.length;if(r!==t){const n=new qe("Invalid Uniform",`Invalid length, expected ${t} but got ${r}`,{uniformName:i,values:e});sJr().errorOnce(n)}}let y9e=class{constructor(e,t,r,n,s,o){this._program=null,this._vao=null,this._temporaryTextures=[],this.vertexShader=e,this.fragmentShader=t,this._locations=r,this._locationInfo=n,this._uniformBindings=s,this._transformFeedbackBindings=o}destroy(){this._program&&this._program.dispose(),this.cleanupTemporaryTextures()}get locations(){return this._locations}get locationInfo(){return this._locationInfo}setUniforms(e){this._uniforms=e}cleanupTemporaryTextures(){for(const e of this._temporaryTextures)e.dispose();this._temporaryTextures=[]}bind(e){const t=this._uniforms;if(!this._program){const n=new Map;for(const[o,a]of this._locations)n.set(o,a);const s=[];for(const o of this._transformFeedbackBindings??[]){const{index:a,propertyKey:l}=o;s[a]=`v_${l}`}this._program=new wCe(e,this.vertexShader,this.fragmentShader,n,new Map,s)}const r=this._program;e.useProgram(r);for(const n of this._uniformBindings){const{shaderModulePath:s,uniformName:o,uniformType:a,uniformArrayLength:l}=n,u=uS(s,t);if(u==null){if(a==="sampler2D")continue;throw new Error(`Failed to find uniform value for ${s}`)}switch(a==="array"?n.uniformArrayElementType:a){case"sampler2D":{const{unit:c,texture:h}=u;if(r.setUniform1i(o,c),"type"in h)e.bindTexture(h,c);else{const p=nJr(e,h.descriptor,h.data);e.bindTexture(p,c)}break}case"int":if(!l){r.setUniform1i(o,u);break}mK(n.uniformName,u,l),r.setUniform1iv(o,u);break;case"float":if(!l){r.setUniform1f(o,u);break}mK(n.uniformName,u,l),r.setUniform1fv(o,u);break;case"vec2":if(!l){r.setUniform2f(o,u[0],u[1]);break}mK(n.uniformName,u,l),r.setUniform2fv(o,u.flat());break;case"vec3":if(!l){r.setUniform3f(o,u[0],u[1],u[2]);break}mK(n.uniformName,u,l),r.setUniform3fv(o,u.flat());break;case"vec4":if(!l){r.setUniform4f(o,u[0],u[1],u[2],u[3]);break}mK(n.uniformName,u,l),r.setUniform4fv(o,u.flat());break;case"mat3":r.setUniformMatrix3fv(o,u.flat());break;case"mat4":r.setUniformMatrix4fv(o,u.flat());break;default:throw new Error(`Unable to set uniform for type ${a}`)}}}};function gK(i){return new i}function cX(i,e,t){const r=i.constructor[e]??[];i.constructor.hasOwnProperty(e)||Object.defineProperty(i.constructor,e,{value:r.slice()}),i.constructor[e].push(t)}function Ns(i,e){return(t,r)=>{cX(t,"locations",{typeCtor:e,propertyKey:r,parameterIndex:null,index:i})}}const oJr=i=>(e,t)=>{cX(e,"builtins",{builtin:i,propertyKey:t})},bu=i=>(e,t,r)=>{cX(e,"inputs",{inputCtor:i,propertyKey:t,parameterIndex:r})},zn=i=>(e,t)=>{cX(e,"uniforms",{typeCtor:i,propertyKey:t})},jc=i=>(e,t)=>{cX(e,"options",{typeCtor:i,propertyKey:t})},DF=(i,e)=>{cX(i,"defines",{propertyKey:e})},v9e=(i,e)=>(t,r)=>{t.constructor.builtins.push({builtin:i,propertyKey:r,typeCtor:e})};let roe=class{};roe.builtins=[],x([v9e("gl_VertexID",rE)],roe.prototype,"glVertexID",void 0);let jJe=class{},fH=class{};fH.builtins=[],x([v9e("gl_FragCoord",qo)],fH.prototype,"glFragCoord",void 0),x([v9e("gl_PointCoord",As)],fH.prototype,"glPointCoord",void 0);let Ole=class{};x([oJr("gl_FragColor")],Ole.prototype,"glFragColor",void 0);let Lf=class{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}},GJe=class{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const e=zAe(this._shaderModuleClass.inputs,t=>t.propertyKey==="vertex"&&t.parameterIndex===0);if(!e)throw new Error("Unable to find vertex input parameter");return e}get computeInput(){return zAe(this._shaderModuleClass.inputs,e=>e.propertyKey==="vertex"&&e.parameterIndex===1)}get fragmentInput(){const e=zAe(this._shaderModuleClass.inputs,t=>t.propertyKey==="fragment");if(!e)throw new Error("Unable to find fragment input parameter");return e}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const e=new Map,t=new Set;for(const r of this.locations)t.has(r.index)?di.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${r.propertyKey} to ${r.index}. Index already in use`,{locationsMap:e}):(e.set(r.propertyKey,r.index),t.add(r.index));return e}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,s])=>`${n}.${s}`).join("."),r=Q1(t);this._locationInfo={hash:r,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const t of this.locations)e.set("a_"+t.propertyKey,t.index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set;for(const t of this._options)e.add(t.propertyKey);this._optionPropertyKeys=e}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(e,t,r,n){try{const{vertex:s,fragment:o,uniformBindings:a}=this._generateShaders(e,t,r,n);return new y9e(s,o,this.renamedLocationsMap,this.locationInfo,a,this.transformFeedbackBindings)}catch(s){return console.error("Failed to create program",{error:s}),new y9e("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(e){const t=this._options.find(n=>n.propertyKey===e);if(t)return{type:"option",className:t.typeCtor};const r=this._uniforms.find(n=>n.propertyKey===e);if(!r)throw new Error(`Unable to find uniform class type for property: ${e}`);return{type:"required",className:r.typeCtor}}getShaderKey(e,t,r,n){const s=Object.keys(r).map(l=>`${l}.${r[l]}`).join("."),o=Object.keys(n).map(l=>`${l}.${n[l]}`).join("."),a=Object.keys(t).filter(l=>this.optionPropertyKeys.has(l)&&t[l]).join(".");return`${this.constructor.name}.${e.hash}.${s}.${o}.${a}`}_generateShaders(e,t,r,n){const s=[];this._setDefines(r),this._setOptionalUniforms(s,t),this._setRequiredUniforms(s);const o=this._hydrateVertexInput(n),a=this._injectPackPrecisionFactor(o,e),l=this._hydrateComputeInput(),u=l&&this._injectPackPrecisionFactor(l,e),c=this.vertex(a,u),h=this._hydrateFragmentInput(c),p=this.fragment(h),m=new Set;for(const B in p){const $=p[B];JYr(m,$)}const v=this._getVertexInputBuiltins(),w=Fmt.createVertex({...o,...l},c,v,s,this.transformFeedbackBindings,m);new Dmt().write(w);const S=this._getFragmentInputBuiltins(p);S.set("glPointCoord","gl_PointCoord");const I=Fmt.createFragment(h,p,S,s,w,this.transformFeedbackBindings);new Dmt().write(I);const R=this._createShaderBuilder(w,I),L=R.generate("vertex",!1),k=R.generate("fragment",!1);return this.logShader&&(console.log(L),console.log(k)),{vertex:L,fragment:k,uniformBindings:s}}_setDefines(e){for(const t in e)this[t]=e[t]}_setOptionalUniforms(e,t){for(const r of this._options)t[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(e,r):this[r.propertyKey]=null}_setRequiredUniforms(e){for(const t of this._uniforms)this[t.propertyKey]=this._hydrateUniformGroup(e,t)}_hydrateUniformGroup(e,t){const r=new t.typeCtor;for(const n of r._uniforms??[]){const s=gK(n.typeCtor),o=`u_${t.propertyKey}_${n.propertyKey}`,a=s.type,l=[t.propertyKey,n.propertyKey].join(".");if("type"in n.typeCtor&&n.typeCtor.type==="array"){const u=s;e.push({shaderModulePath:l,uniformName:o,uniformType:a,uniformArrayLength:u.size,uniformArrayElementType:u.elementType.type,uniformHydrated:s})}else e.push({shaderModulePath:l,uniformName:o,uniformType:a,uniformHydrated:s});r[n.propertyKey]=s}return r}_hydrateVertexInput(e){const t=this.vertexInput.inputCtor,r=t.locations.reduce((n,s)=>e[s.propertyKey]===!1?n:{...n,[s.propertyKey]:gK(s.typeCtor)},{});for(const{propertyKey:n,typeCtor:s}of t.builtins){const o=gK(s);r[n]=o}return r}_hydrateComputeInput(){return this.computeInput==null?null:this.computeInput.inputCtor.locations.reduce((e,t)=>({...e,[t.propertyKey]:gK(t.typeCtor)}),{})}_injectPackPrecisionFactor(e,t){const r={};for(const n in e){const s=e[n],o=t.attributes.find(a=>a.name===n);if(o?.packPrecisionFactor){if(s.type!=="float"&&s.type!=="vec2"&&s.type!=="vec3"&&s.type!=="vec4")throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[n]=s.divide(new Ni(o.packPrecisionFactor))}else r[n]=s}return r}_hydrateFragmentInput(e){const t={};for(const r in e)t[r]=e[r];for(const{propertyKey:r,typeCtor:n}of fH.builtins){const s=gK(n);t[r]=s}return t}_getVertexInputBuiltins(){const e=this.vertexInput.inputCtor,t=new Map;for(const{builtin:r,propertyKey:n}of e.builtins)t.set(n,r);return t}_getFragmentInputBuiltins(e){const t=e.constructor,r=new Map;for(const n of t.builtins??[])r.set(n.propertyKey,n.builtin);return r}_createShaderBuilder(e,t){const r=new UYr;return this._insertDebugInfo(r),e.insertVertexShader(r),t.insertFragmentShader(r),r}_insertDebugInfo(e){e.vertex.code.add("// DEFINES: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._defines)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`);e.vertex.code.add(""),e.vertex.code.add("// OPTIONS: "),e.vertex.code.add("// --------------------------------------------------------- ");for(const t of this._options)this[t.propertyKey]?e.vertex.code.add(`// ${t.propertyKey}: true`):e.vertex.code.add(`// ${t.propertyKey}: false`)}};const sV={selection:i=>new tse({color:new jr([i.color.r/2,i.color.g/2,i.color.b/2,i.color.a])}),highlight:i=>i,popup:i=>new tse({color:new jr([i.color.g,i.color.b,i.color.r,i.color.a])})};function SCe(i){if(!i)return 0;let e=1;for(const t in sV){if(t===i)break;e<<=1}return e}const g9=Object.keys(sV);function Zmt(i){const e=zp(12.9898),t=zp(78.233),r=zp(43758.5453),n=Cq(i,f9e(e,t)),s=uX(n,zp(3.14));return Mbe(ioe(s).multiply(r))}function IR(i){return Ale(i,zp(mUt))}function aJr(i,e){return i.x.multiply(e.y).subtract(e.x.multiply(i.y))}function lJr(i){return i.multiply(2).subtract(1)}function dg(i,e){const t=zp(2**e);return uX(HUt(i.divide(t)),zp(2))}function uJr(i,e){return Uv(dg(i,e),zp(.5))}function mPe(i,e){return dg(i,e+g9.length)}function cJr(i,e){return dg(i,e)}function hJr(i){const e=dg(i.z,7),t=zp(1).subtract(e),r=i.xyz.subtract(oXr(0,0,zp(128)));return t.multiply(i).add(e.multiply(r))}function UJe(i){const e=aXr(.99609375,.0038909912109375,1519918441772461e-20,59371814131736755e-24);return Cq(i,e)}function Qmt(i){return AS(AS(AS(i.x,i.y),i.z),i.w)}let pO=class extends Lf{getVisualVariableData(e){if(!this._vvData){const t=this.getAttributeDataCoords(e);this._vvData=rg(this.visualVariableData,t).setDebugName("storage2")}return this._vvData}getAttributeDataCoords(e){if(!this._uv){const t=hJr(e),r=this.size,n=$j(t.x),s=$j(t.y).multiply($j(256)),o=$j(t.z).multiply($j(256)).multiply($j(256)),a=zp(n.add(s).add(o)),l=uX(a,r),u=a.subtract(l).divide(r);this._uv=new As(l,u).add(.5).divide(r)}return this._uv}getFilterData(e){const t=this.getAttributeDataCoords(e);return rg(this.filterFlags,t).setDebugName("storage0")}getAnimationData(e){const t=this.getAttributeDataCoords(e);return rg(this.animation,t).setDebugName("storage1")}getVVData(e){return this.getVisualVariableData(e)}getDataDrivenData0(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven0,t).setDebugName("storage30")}getDataDrivenData1(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven1,t).setDebugName("storage31")}getDataDrivenData2(e){const t=this.getAttributeDataCoords(e);return rg(this.dataDriven2,t).setDebugName("storage32")}getGPGPUData(e){const t=this.getAttributeDataCoords(e);return rg(this.gpgpu,t).setDebugName("storage4")}getFilterFlags(e){return yi("webgl-ignores-sampler-precision")?fXr(this.getFilterData(e).x.multiply(zp(255))):this.getFilterData(e).x.multiply(zp(255))}getAnimationValue(e){return this.getAnimationData(e).x}getSizeValue(e){return this.getVisualVariableData(e).x}getColorValue(e){return this.getVisualVariableData(e).y}getOpacityValue(e){return this.getVisualVariableData(e).z}getRotationValue(e){return this.getVisualVariableData(e).w}};x([zn(_f)],pO.prototype,"filterFlags",void 0),x([zn(_f)],pO.prototype,"animation",void 0),x([zn(_f)],pO.prototype,"gpgpu",void 0),x([zn(_f)],pO.prototype,"visualVariableData",void 0),x([zn(_f)],pO.prototype,"dataDriven0",void 0),x([zn(_f)],pO.prototype,"dataDriven1",void 0),x([zn(_f)],pO.prototype,"dataDriven2",void 0),x([zn(Ni)],pO.prototype,"size",void 0);let _9e=class extends Lf{};x([zn(Ni)],_9e.prototype,"activeReasons",void 0),x([zn(Ni)],_9e.prototype,"highlightAll",void 0);let jee=class extends Lf{};x([zn(As)],jee.prototype,"position",void 0),x([zn(Ni)],jee.prototype,"distance",void 0),x([zn(Ni)],jee.prototype,"smallSymbolDistance",void 0),x([zn(Ni)],jee.prototype,"smallSymbolSizeThreshold",void 0);let E1=class extends Lf{};x([zn(Tf)],E1.prototype,"displayViewScreenMat3",void 0),x([zn(Tf)],E1.prototype,"displayViewMat3",void 0),x([zn(Tf)],E1.prototype,"displayMat3",void 0),x([zn(Tf)],E1.prototype,"viewMat3",void 0),x([zn(Tf)],E1.prototype,"tileMat3",void 0),x([zn(Ni)],E1.prototype,"displayZoomFactor",void 0),x([zn(Ni)],E1.prototype,"requiredZoomFactor",void 0),x([zn(As)],E1.prototype,"tileOffset",void 0),x([zn(Ni)],E1.prototype,"currentScale",void 0),x([zn(Ni)],E1.prototype,"currentZoom",void 0),x([zn(Ni)],E1.prototype,"metersPerSRUnit",void 0),x([zn(Ni)],E1.prototype,"rotation",void 0),x([zn(Ni)],E1.prototype,"pixelRatio",void 0);let nE=class extends roe{};x([Ns(0,Ul)],nE.prototype,"id",void 0),x([Ns(1,Ni)],nE.prototype,"bitset",void 0),x([Ns(2,As)],nE.prototype,"pos",void 0);let M3=class extends jJe{};x([Ns(14,As)],M3.prototype,"nextPos1",void 0),x([Ns(15,As)],M3.prototype,"nextPos2",void 0);let YR=class extends fH{},ox=class extends GJe{clip(e,t){let r=new Ni(0);const n=this.storage.getFilterFlags(e);if(r=r.add(zp(2).multiply(zp(1).subtract(mPe(n,0)))),this.inside?r=r.add(zp(2).multiply(zp(1).subtract(mPe(n,1)))):this.outside?r=r.add(zp(2).multiply(mPe(n,1))):this.highlight&&(r=r.add(zp(2).multiply(zp(1).subtract(this._checkHighlight(n))))),t!=null){const s=new Ni(1).subtract(vm(t.x,this.view.currentZoom)),o=vm(t.y,this.view.currentZoom);r=r.add(new Ni(2).multiply(s.add(o)))}return r}getFragmentOutput(e,t,r=new Ni(1/255)){const n=new Ole;return n.glFragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,r)??e,n}_maybeHighlight(e,t){return this.highlight?new qo(e.rgb,vm(t,e.a)):null}_checkHighlight(e){let t=this._checkHighlightBit(e,0);for(let r=1;r{const l=bre(i,e,t),u=bre(i,t,r),c=bre(i,r,e);return Eq(Eq(l,u),c)}])}function TCe(i){return i.distance.add(1)}function zJe(i,e,t){const{viewMat3:r,tileMat3:n}=i.view,s=r.multiply(n),o=s.multiply(new Ul(e.pos,1)),a=s.multiply(new Ul(t.nextPos1,1)),l=s.multiply(new Ul(t.nextPos2,1));return szt(i.hittestRequest.position,o.xy,a.xy,l.xy)}function fJr(i,e,t){return $Je(i,t).subtract(e)}let OB=class extends Lf{getColor(e,t,r){return Cle([VUt(IR(e),r),t],[yCe(e,this.values.first()),this.colors.first()],[vCe(e,this.values.last()),this.colors.last()],[!0,()=>{const n=this.values.findIndex(u=>Uv(u,e)),s=this.values.get(n),o=n.subtract(1),a=this.values.get(o),l=e.subtract(a).divide(s.subtract(a));return A3(this.colors.get(o),this.colors.get(n),l)}])}};x([zn(gf.ofType(qo,8))],OB.prototype,"colors",void 0),x([zn(gf.ofType(Ni,8))],OB.prototype,"values",void 0);let PB=class extends Lf{getOpacity(e){return Cle([IR(e),new Ni(1)],[yCe(e,this.opacityValues.first()),this.opacities.first()],[vCe(e,this.opacityValues.last()),this.opacities.last()],[!0,()=>{const t=this.opacityValues.findIndex(a=>Uv(a,e)),r=this.opacityValues.get(t),n=t.subtract(1),s=this.opacityValues.get(n),o=e.subtract(s).divide(r.subtract(s));return A3(this.opacities.get(n),this.opacities.get(t),o)}])}};x([zn(gf.ofType(Ni,8))],PB.prototype,"opacities",void 0),x([zn(gf.ofType(Ni,8))],PB.prototype,"opacityValues",void 0);function ozt(i){return i.visualVariableSizeMinMaxValue!=null||i.visualVariableSizeScaleStops!=null||i.visualVariableSizeStops!=null||i.visualVariableSizeUnitValue!=null}function Obe(i,e,t){if(ozt(i)){const r=i.storage.getSizeValue(e);return i.visualVariableSizeMinMaxValue?.getSize(r,t)??i.visualVariableSizeScaleStops?.getSizeForViewScale(i.view.currentScale)??i.visualVariableSizeStops?.getSize(r,t)??i.visualVariableSizeUnitValue?.getSize(r,t)}return t}function CCe(i,e,t,r=new Kx(!1)){if(i.visualVariableColor==null)return t;const n=i.storage.getColorValue(e);return i.visualVariableColor.getColor(n,t,r)}function ECe(i,e){if(i.visualVariableOpacity==null)return new Ni(1);const t=i.storage.getOpacityValue(e);return i.visualVariableOpacity.getOpacity(t)}function azt(i,e){if(i.visualVariableRotation==null)return Tf.identity();const t=i.storage.getRotationValue(e);return i.visualVariableRotation.getVVRotationMat3(t)}let noe=class extends nE{};x([Ns(3,qo)],noe.prototype,"color",void 0),x([Ns(4,As)],noe.prototype,"zoomRange",void 0);let lF=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const r=ECe(this,e.id),n=CCe(this,e.id,e.color).multiply(r),s=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),o=this.clip(e.id,e.zoomRange);return{glPosition:new qo(s.xy,o,1),color:n,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new Ni(0))}hittest(e,t){return zJe(this,e,t)}};x([jc(OB)],lF.prototype,"visualVariableColor",void 0),x([jc(PB)],lF.prototype,"visualVariableOpacity",void 0),x([_u(0,bu(noe)),_u(1,bu(M3))],lF.prototype,"vertex",null),x([_u(0,bu(YR))],lF.prototype,"fragment",null);let Iq=class extends Lf{getPatternOffsetAtTileOrigin(e,t=new Ni(0),r=new Ni(1)){const n=new As(LYr).divide(e);let s=e.multiply(Mbe(this.maxIntsToLocalOrigin.multiply(n))).add(this.tileOffsetFromLocalOrigin).subtract(new Ni(.5).multiply(e));return s=new As(s.x.multiply(r).subtract(s.y.multiply(t)),s.x.multiply(t).add(s.y.multiply(r))),uX(s,e)}};x([zn(As)],Iq.prototype,"tileOffsetFromLocalOrigin",void 0),x([zn(As)],Iq.prototype,"maxIntsToLocalOrigin",void 0);let AR=class extends Lf{};x([zn(As)],AR.prototype,"size",void 0),x([zn(_f)],AR.prototype,"texture",void 0);let S$=class extends noe{};x([Ns(5,qo)],S$.prototype,"tlbr",void 0),x([Ns(6,Ni)],S$.prototype,"width",void 0),x([Ns(7,Ni)],S$.prototype,"height",void 0),x([Ns(8,As)],S$.prototype,"offset",void 0),x([Ns(9,As)],S$.prototype,"scale",void 0),x([Ns(10,Ni)],S$.prototype,"angle",void 0);let mJr=class extends YR{};function gJr(i,e,t,r,n){const s=Ale(dg(n,gUt),zp(1)),o=UJe(new qo(i,0));return Rh(s,Rmt(r.divide(e.x),t.divide(e.y),0,cA(t.divide(e.x)),r.divide(e.y),0,Zmt(f9e(o,0)),Zmt(f9e(0,o)),1),Rmt(r.divide(e.x),t.divide(e.y),0,cA(t.divide(e.x)),r.divide(e.y),0,0,0,1))}function lzt(i,e){const t=A3(new As(1),new As(1/cJe),new As(dg(e.bitset,vUt),dg(e.bitset,yUt))),r=i.view.requiredZoomFactor,n=new As(e.width,e.height).multiply(t),s=n.multiply(e.scale).multiply(r),o=e.angle.multiply(fUt),a=ioe(o),l=Abe(o),u=gJr(e.id,s,a,l,e.bitset),c=i.localTileOffset.getPatternOffsetAtTileOrigin(n,a,l),h=r.multiply(e.scale).multiply(e.offset.subtract(c)).divide(s),p=new Ul(e.pos,1),m=u.multiply(p).xy.subtract(h),v=e.tlbr.divide(i.mosaicInfo.size.xyxy);let w=dg(e.bitset,mCe);return i.visualVariableColor!=null&&(w=Rh(IR(i.storage.getColorValue(e.id)),new Ni(0),w)),{tileTextureCoord:m,tlbr:v,sampleAlphaOnly:w}}function uzt(i,e){const t=uX(e.tileTextureCoord,new Ni(1)),r=A3(e.tlbr.xy,e.tlbr.zw,t);let n=rg(i.mosaicInfo.texture,r);return n=Rh(Uv(e.sampleAlphaOnly,new Ni(.5)),n.aaaa,n),e.color.multiply(n)}let Gee=class extends lF{vertex(e,t){return{...super.vertex(e,t),...lzt(this,e)}}fragment(e){const t=uzt(this,e);return this.getFragmentOutput(t,e,new Ni(0))}};x([zn(AR)],Gee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Gee.prototype,"localTileOffset",void 0),x([_u(0,bu(S$)),_u(1,bu(M3))],Gee.prototype,"vertex",null),x([_u(0,bu(mJr))],Gee.prototype,"fragment",null);let Ple=class extends Lf{getSize(e,t){const r=this.minMaxValueAndSize.xy,n=this.minMaxValueAndSize.zw;return Rh(IR(e),t,()=>{const s=e.subtract(r.x).divide(r.y.subtract(r.x)),o=Tq(s,new Ni(0),new Ni(1));return n.x.add(o.multiply(n.y.subtract(n.x)))})}};x([zn(qo)],Ple.prototype,"minMaxValueAndSize",void 0);let Aq=class extends Lf{getSizeForViewScale(e){return Cle([yCe(e,this.values.first()),this.sizes.first()],[vCe(e,this.values.last()),this.sizes.last()],[!0,()=>{const t=this.values.findIndex(a=>Uv(a,e)),r=this.values.get(t),n=t.subtract(1),s=this.values.get(n),o=e.subtract(s).divide(r.subtract(s));return A3(this.sizes.get(n),this.sizes.get(t),o)}])}};x([zn(gf.ofType(Ni,8))],Aq.prototype,"sizes",void 0),x([zn(gf.ofType(Ni,8))],Aq.prototype,"values",void 0);let Mq=class extends Lf{getSize(e,t){const r=Cle([IR(e),t],[yCe(e,this.values.first()),this.sizes.first()],[vCe(e,this.values.last()),this.sizes.last()],[!0,()=>{const n=this.values.findIndex(u=>Uv(u,e)),s=this.values.get(n),o=n.subtract(1),a=this.values.get(o),l=e.subtract(a).divide(s.subtract(a));return A3(this.sizes.get(o),this.sizes.get(n),l)}]);return Rh(IR(r),t,r)}};x([zn(gf.ofType(Ni,8))],Mq.prototype,"sizes",void 0),x([zn(gf.ofType(Ni,8))],Mq.prototype,"values",void 0);let Rle=class extends Lf{getSize(e,t){return Rh(IR(e),t,e.multiply(this.unitValueToPixelsRatio))}};x([zn(Ni)],Rle.prototype,"unitValueToPixelsRatio",void 0);let x5=class extends nE{};x([Ns(3,qo)],x5.prototype,"color",void 0),x([Ns(4,As)],x5.prototype,"offset",void 0),x([Ns(5,As)],x5.prototype,"normal",void 0),x([Ns(6,Ni)],x5.prototype,"halfWidth",void 0),x([Ns(7,Ni)],x5.prototype,"referenceHalfWidth",void 0),x([Ns(8,As)],x5.prototype,"zoomRange",void 0);let czt=class extends YR{},Pbe=class extends Lf{};function hzt(i){return AS(new Ni(RYr).multiply(vm(i,new Ni(DYr))),new Ni(1))}function dzt(i,e){const{halfWidth:t,normal:r}=i,n=hzt(t),s=_Ce(r).multiply(t);return Tq(n.multiply(t.subtract(s)).divide(e.add(n).subtract(new Ni(1))),new Ni(0),new Ni(1))}function yJr(i,e){const{id:t,halfWidth:r,referenceHalfWidth:n}=e;if(ozt(i)){const s=new Ni(2).multiply(n),o=Obe(i,t,s);return new Ni(.5).multiply(r.divide(AS(n,new Ni(kYr)))).multiply(o)}return r}function VJe(i,e){const{id:t,offset:r,pos:n,normal:s,zoomRange:o}=e,{displayViewScreenMat3:a,displayViewMat3:l}=i.view,u=CCe(i,t,e.color),c=ECe(i,t),h=yJr(i,e),p=new Ni(.5).multiply(i.antialiasingControls.antialiasing),m=AS(h.add(p),new Ni(.45)).add(new Ni(.1).multiply(p)),v=hzt(m).multiply(m).multiply(r),w=l.multiply(new Ul(v,new Ni(0))),S=a.multiply(new Ul(n,new Ni(1))).add(w),I=new Ni(2).multiply(vm(h,new Ni(0))).add(i.clip(t,o)),R=new qo(S.xy,I,1);return{color:u,opacity:c,halfWidth:m,normal:s,scaledOffset:v,scaledHalfWidth:h,glPosition:new qo(R.xy,I,1)}}function ICe(i,e){const{opacity:t,color:r}=i,n=dzt(i,e);return t.multiply(r).multiply(n)}x([zn(Ni)],Pbe.prototype,"antialiasing",void 0),x([zn(Ni)],Pbe.prototype,"blur",void 0);let cC=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(e,t){const r=VJe(this,e);return{...r,...this.maybeRunHittest(e,t,r.halfWidth)}}fragment(e){const t=ICe(e,this.antialiasingControls.blur);return this.getFragmentOutput(t,e)}hittest(e,t,r){const{viewMat3:n,tileMat3:s}=this.view,o=n.multiply(s),a=o.multiply(new Ul(e.pos,1)),l=o.multiply(new Ul(t.nextPos1,1)),u=o.multiply(new Ul(t.nextPos2,1)),{distance:c,smallSymbolDistance:h,smallSymbolSizeThreshold:p}=this.hittestRequest,m=vm(r,p.multiply(.5)).multiply(c.subtract(h)),v=this.hittestRequest.position;return Eq(bre(v,a.xy,l.xy),bre(v,a.xy,u.xy)).subtract(r).add(m)}};x([zn(Pbe)],cC.prototype,"antialiasingControls",void 0),x([jc(OB)],cC.prototype,"visualVariableColor",void 0),x([jc(PB)],cC.prototype,"visualVariableOpacity",void 0),x([jc(Ple)],cC.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],cC.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],cC.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],cC.prototype,"visualVariableSizeUnitValue",void 0),x([_u(0,bu(x5)),_u(1,bu(M3))],cC.prototype,"vertex",null),x([_u(0,bu(czt))],cC.prototype,"fragment",null);let S5=class extends nE{};x([Ns(3,As)],S5.prototype,"offset",void 0),x([Ns(4,qo)],S5.prototype,"color",void 0),x([Ns(5,As)],S5.prototype,"normal",void 0),x([Ns(6,Ni)],S5.prototype,"halfWidth",void 0),x([Ns(7,Ni)],S5.prototype,"referenceHalfWidth",void 0),x([Ns(8,As)],S5.prototype,"zoomRange",void 0);let pzt=class extends czt{};function HJe(i,e,t){const{id:r,bitset:n}=e,s=dg(n,AJe),o=Uv(s,new Ni(.5)),a=VJe(i,e),l=Rh(o,a.halfWidth,new Ni(0)),u=ECe(i,r),c=CCe(i,r,e.color),h=Rh(o,e.color,c.multiply(u)),p=i.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),m=i.clip(e.id),v=new qo(p.xy,m,1),w=Rh(o,a.glPosition,v),S=t&&i.maybeRunHittest(e,t,o);return{isOutline:s,color:h,opacity:new Ni(1),halfWidth:l,normal:a.normal,glPosition:w,...S}}let YO=class extends ox{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}};x([zn(Pbe)],YO.prototype,"antialiasingControls",void 0),x([jc(OB)],YO.prototype,"visualVariableColor",void 0),x([jc(PB)],YO.prototype,"visualVariableOpacity",void 0),x([jc(Ple)],YO.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],YO.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],YO.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],YO.prototype,"visualVariableSizeUnitValue",void 0);let Rbe=class extends YO{vertex(e,t){return HJe(this,e,t)}fragment(e){const{color:t,isOutline:r}=e,n=Uv(r,new Ni(.5)),s=ICe(e,this.antialiasingControls.blur),o=Rh(n,s,t),a=Rh(n,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}hittest(e,t,r){return Rh(r,TCe(this.hittestRequest),zJe(this,e,t))}};x([_u(0,bu(S5)),_u(1,bu(M3))],Rbe.prototype,"vertex",null),x([_u(0,bu(pzt))],Rbe.prototype,"fragment",null);let b9e=class extends noe{};x([Ns(5,qo)],b9e.prototype,"tlbr",void 0),x([Ns(6,Ni)],b9e.prototype,"inverseRasterizationScale",void 0);let vJr=class extends YR{};function _Jr(i){const e=new Ni(1),t=new Ni(0);return new Tf(e.divide(i.x),t.divide(i.y),0,cA(t.divide(i.x)),e.divide(i.y),0,0,0,1)}function fzt(i,e){const t=e.tlbr.xy,r=e.tlbr.zw,n=r.x.subtract(t.x),s=t.y.subtract(r.y),o=new As(n,s).multiply(e.inverseRasterizationScale),a=o.multiply(i.view.requiredZoomFactor),l=_Jr(a),u=i.localTileOffset.getPatternOffsetAtTileOrigin(o).divide(a),c=new Ul(e.pos,1);return{tileTextureCoord:l.multiply(c).xy.subtract(u),tlbr:e.tlbr.divide(i.mosaicInfo.size.xyxy)}}function mzt(i,e){const t=uX(i.tileTextureCoord,new Ni(1)),r=A3(i.tlbr.xy,i.tlbr.zw,t),n=rg(e.texture,r);return i.color.multiply(n)}let Uee=class extends lF{vertex(e,t){return{...super.vertex(e,t),...fzt(this,e)}}fragment(e){const t=mzt(e,this.mosaicInfo);return this.getFragmentOutput(t,e,new Ni(0))}};x([zn(AR)],Uee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Uee.prototype,"localTileOffset",void 0),x([_u(0,bu(b9e)),_u(1,bu(M3))],Uee.prototype,"vertex",null),x([_u(0,bu(vJr))],Uee.prototype,"fragment",null);let w9e=class extends S5{};x([Ns(9,qo)],w9e.prototype,"tlbr",void 0),x([Ns(10,Ni)],w9e.prototype,"inverseRasterizationScale",void 0);let gzt=class extends pzt{},zee=class extends Rbe{vertex(e,t){return{...HJe(this,e,t),...fzt(this,e)}}fragment(e){const{isOutline:t}=e,r=Uv(t,new Ni(.5)),n=ICe(e,this.antialiasingControls.blur),s=mzt(e,this.mosaicInfo),o=Rh(r,n,s),a=Rh(r,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}};x([zn(AR)],zee.prototype,"mosaicInfo",void 0),x([zn(Iq)],zee.prototype,"localTileOffset",void 0),x([_u(0,bu(w9e)),_u(1,bu(M3))],zee.prototype,"vertex",null),x([_u(0,bu(gzt))],zee.prototype,"fragment",null);const rP=16,yK=1/rP,x9e=128;let fO=class extends nE{};x([Ns(3,qo)],fO.prototype,"color",void 0),x([Ns(4,qo)],fO.prototype,"tlbr",void 0),x([Ns(5,Ni)],fO.prototype,"angle",void 0),x([Ns(6,Ni)],fO.prototype,"aux1",void 0),x([Ns(7,Ni)],fO.prototype,"aux2",void 0),x([Ns(8,As)],fO.prototype,"aux3",void 0),x([Ns(9,As)],fO.prototype,"aux4",void 0),x([Ns(10,As)],fO.prototype,"zoomRange",void 0);let bJr=class extends gzt{},Vee=class extends YO{vertex(e,t){const{aux1:r,aux2:n,aux3:s,aux4:o}=e,a={...e,width:r,height:n,offset:s,scale:o.multiply(yK)},l={...e,halfWidth:r.multiply(yK),referenceHalfWidth:n.multiply(yK),offset:s.multiply(yK),normal:o.subtract(x9e).multiply(yK)},u=HJe(this,l),c=lzt(this,a),h=Uv(u.isOutline,new Ni(.5));return{...u,...c,...this.maybeRunHittest(e,t,h)}}fragment(e){const{isOutline:t}=e,r=Uv(t,new Ni(.5)),n=ICe(e,this.antialiasingControls.blur),s=uzt(this,e),o=Rh(r,n,s),a=Rh(r,new Ni(1/255),new Ni(0));return this.getFragmentOutput(o,e,a)}hittest(e,t,r){return Rh(r,TCe(this.hittestRequest),zJe(this,e,t))}};x([zn(AR)],Vee.prototype,"mosaicInfo",void 0),x([zn(Iq)],Vee.prototype,"localTileOffset",void 0),x([_u(0,bu(fO)),_u(1,bu(M3))],Vee.prototype,"vertex",null),x([_u(0,bu(bJr))],Vee.prototype,"fragment",null);const TC=EUt.attributes,wJr=PJe.attributes,xJr={createComputedParams:i=>i,attributes:{id:TC.id,pos:TC.pos,zoomRange:TC.zoomRange,tlbr:TC.tlbr,angle:TC.angle,color:TC.color,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>SUt(i)},aux1:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>TUt(i)},aux2:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>CUt(i)},aux3:{count:2,type:Ti.SHORT,pack:({offsetX:i,offsetY:e})=>[us(i),us(e)]},aux4:{count:2,type:Ti.UNSIGNED_BYTE,pack:({scaleX:i,scaleY:e})=>[i*rP,e*rP]}}},SJr={createComputedParams:i=>i,attributes:{id:TC.id,pos:TC.pos,zoomRange:TC.zoomRange,tlbr:TC.tlbr,angle:TC.angle,color:wJr.color,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>Tle([[AJe,!0]])},aux1:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>us(.5*i.width)*rP},aux2:{count:1,type:Ti.UNSIGNED_SHORT,pack:i=>us(.5*i.referenceWidth)*rP},aux3:{count:2,type:Ti.SHORT,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:e})=>[i*rP,e*rP]},aux4:{count:2,type:Ti.UNSIGNED_BYTE,packTessellation:({normalX:i,normalY:e})=>[i*rP+x9e,e*rP+x9e]}}};let TJr=class extends RJe{constructor(){super(...arguments),this.vertexSpec=SJr}},CJr=class extends DJe{constructor(){super(...arguments),this.vertexSpec=xJr}_createOutlineWriter(e,t,r,n){return new TJr(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd()}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const EJr={createComputedParams:i=>i,attributes:{...fCe.attributes,...MUt.attributes}},IJr={createComputedParams:i=>i,attributes:{...fCe.attributes,...PJe.attributes}};let AJr=class extends RJe{constructor(){super(...arguments),this.vertexSpec=IJr}},MJr=class extends DJe{constructor(){super(...arguments),this.vertexSpec=EJr}_createOutlineWriter(e,t,r,n){return new AJr(e,t,r,n)}_write(e,t,r){const n=r?.asOptimized()??t.readGeometryForDisplay(),s=this._clip(n);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(e,t,s),this._lineMeshWriter.writeLineVertices(e,Ec.fromOptimizedCIM(s,"esriGeometryPolyline"),t),e.recordEnd()}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const OJr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1},offset:{type:Ti.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let PJr=class extends oX{constructor(){super(...arguments),this.vertexSpec=OJr}_write(e,t){e.recordStart(this.instanceId,this.attributeLayout);const r=t.getDisplayId();if(t.geometryType==="esriGeometryPoint"){const n=t.readXForDisplay(),s=t.readYForDisplay();this._writeQuad(e,r,n,s)}else t.geometryType==="esriGeometryMultipoint"&&t.readGeometryForDisplay()?.forEachVertex((s,o)=>{s>=0&&s<=512&&o>=0&&o<=512&&this._writeQuad(e,r,s,o)});e.recordEnd()}_writeQuad(e,t,r,n){const s=e.vertexCount();this._writeVertex(e,t,r,n),e.indexWrite(s+0),e.indexWrite(s+1),e.indexWrite(s+2),e.indexWrite(s+1),e.indexWrite(s+3),e.indexWrite(s+2)}};const Iy=8388607,RJr=8388608,vS=i=>i&Iy;function DJr(i,e){return((e?RJr:0)|i)>>>0}let Hee=class yzt{constructor(e,t,r,n,s,o,a,l,u=[]){this.entityTexel=e,this.anchorX=t,this.anchorY=r,this.directionX=n,this.directionY=s,this.maxScale=o,this.minScale=a,this.referenceBounds=l,this.bounds=u}serialize(e){e.push(this.entityTexel),e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds===null?(e.writeF32(0),e.writeF32(0),e.writeF32(0)):(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)),Wjt(e,this.bounds)}static deserialize(e){const t=e.readInt32(),r=e.readF32(),n=e.readF32(),s=e.readF32(),o=e.readF32(),a=e.readF32(),l=e.readF32(),u=e.readF32(),c=e.readF32(),h=e.readF32(),p=hH(e,T8)??[];return new yzt(t,r,n,s,o,a,l,{size:u,offsetX:c,offsetY:h},p)}};const vzt=15.5,uF=1024;function egt(i,e,t){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i}function _zt(i,e){return Math.sqrt(i*i+e*e)}function tgt(i){const e=_zt(i[0],i[1]);i[0]/=e,i[1]/=e}function FJr(i,e){return _zt(i[0]-e[0],i[1]-e[1])}function kJr(i,e){return i[e+1]}function bzt(i){return i.length-1}function LJr(i){let e=0;for(let t=0;te._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let r=Math.acos(t);return e>0&&(r=2*Math.PI-r),r}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1e)return this._seekBackwards(e-n);n+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let r=this.remainingLength;for(;this.next();){if(r+this.length>e)return this.seek(e-r,t);r+=this.length}return this._distance=1,t?this:null}};function BJr(i,e,t,r=!0){const n=LJr(i),s=$Jr.create(i),o=n/2;if(!r)return s.seek(o),void(Math.abs(s.x)=0&&!(n[w+1]n[h]+c);w++){const S=c-n[w-1]+n[h],I=n[w]-n[w-1],R=n[w]-n[h]1){const l=AMt(s,n,!1,t,r,a);this.fontSize=Math.min(l.size,igt),this.postAngle=l.rotation,this.offsetX=l.offsetX,this.offsetY=l.offsetY}o&&(this.fontSize*=o,this.offsetX*=o,this.offsetY*=o)}};const fye=28,Ek=[4,4],Ude=[16,4],zJr={topLeft:Ude,topRight:Ude,bottomLeft:Ude,bottomRight:Ude},Dbe=[4,2],WS=[4,6],rgt={topLeft:Dbe,topRight:Dbe,bottomLeft:WS,bottomRight:WS},ngt={topLeft:Dbe,topRight:WS,bottomLeft:Dbe,bottomRight:WS},VJr={topLeft:WS,topRight:WS,bottomLeft:Ek,bottomRight:Ek},HJr={topLeft:Ek,topRight:Ek,bottomLeft:WS,bottomRight:WS},WJr={topLeft:WS,topRight:Ek,bottomLeft:WS,bottomRight:Ek},qJr={topLeft:Ek,topRight:WS,bottomLeft:Ek,bottomRight:WS},YJr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:i,mapAligned:e})=>Tle([[wUt,i],[xUt,!!e]])},zoomRange:{type:Ti.UNSIGNED_SHORT,count:2,packPrecisionFactor:xq,packTessellation:({minZoom:i,maxZoom:e})=>[i||0,e||fye]},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:i})=>{const{bottomLeft:e,bottomRight:t,topLeft:r,topRight:n}=i;return[r,n,e,t]}}},textureUV:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:i})=>{const{bottomLeft:e,bottomRight:t,topLeft:r,topRight:n}=i;return[r,n,e,t]}}},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:i})=>i},fontSize:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:i})=>us(i)},referenceSize:{type:Ti.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:i},{referenceSize:e})=>us(e??i)},haloColor:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:i})=>Xg(i)},haloFontSize:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,pack:({haloFontSize:i})=>us(i)},clipAngle:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:i})=>XJr(i||0)},referenceSymbol:{type:Ti.BYTE,count:4,packPrecisionFactor:1,packTessellation:(i,e)=>{if(!i.referenceBounds)return[0,0,0,0];const t=Mqr(e.horizontalAlignment),r=Oqr(e.verticalAlignment),{offsetX:n,offsetY:s,size:o}=i.referenceBounds;return[us(n),-us(s),us(o),t+1<<2|r+1]}}}};let xzt=class extends oX{constructor(){super(...arguments),this.vertexSpec=YJr,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new UJr(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,t,r){const n=this._getShaping();if(!n)return;const s=t.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,t,n,r);if(r&&r.nextPath())return r.nextPoint(),this._writeGlyphs(e,s,r.x,r.y,n,0);if(t.geometryType==="esriGeometryPolygon"){const l=t.readCentroidForDisplay();if(!l)return;const[u,c]=l.coords;return this._writeGlyphs(e,s,u,c,n,0)}if(t.geometryType==="esriGeometryMultipoint")return void t.readGeometryForDisplay()?.forEachVertex((u,c)=>this._writeGlyphs(e,s,u,c,n,0));const o=t.readXForDisplay(),a=t.readYForDisplay();return this._writeGlyphs(e,s,o,a,n,0)}_writePlacedTextMarkers(e,t,r,n){const s=n??Ec.fromFeatureSetReaderCIM(t);if(!s)return;const o=-1,a=wzt.getPlacement(s,o,this.evaluatedMeshParams.placement,us(1),e.id,EJe());if(!a)return;const l=t.getDisplayId();let u=a.next();for(;u!=null;){const c=u.tx,h=-u.ty,p=-u.getAngle();this._writeGlyphs(e,l,c,h,r,p),u=a.next()}}_getShaping(){const e=this._textMeshTransformProps,t=this.evaluatedMeshParams;if(!t.glyphs?.glyphs.length)return null;const r=Math.round(us(e.fontSize)),n=us(e.offsetX),s=us(e.offsetY),o=uu(us(t.lineWidth),32,512),a=hJe*uu(t.lineHeightRatio,.25,4);return xJe(t.glyphs,{scale:r/dJe,angle:e.postAngle,xOffset:n,yOffset:s,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:o,lineHeight:a,decoration:t.decoration,borderLineSizePx:us(t.boxBorderLineSize),hasBackground:!!t.boxBackgroundColor,useCIMAngleBehavior:t.useCIMAngleBehavior})}_writeGlyphs(e,t,r,n,s,o,a,l){const u=this.evaluatedMeshParams,c=this._textMeshTransformProps,h=c.fontSize,p=us(c.offsetX),m=us(c.offsetY),[v,w]=aX(u.scaleInfo,this.getTileInfo());o!==0&&s.setRotation(o);const S=s.bounds,I=r+S.x+p,R=n+S.y-m,L=2*(u.minPixelBuffer?u.minPixelBuffer/h:1),k=Math.max(S.width,S.height)*L;s.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),e.recordBounds(I,R,k,k),this._writeTextBox(e,t,r,n,s.textBox,a,l),e.recordEnd());for(const B of s.glyphs){e.recordStart(this.instanceId,this.attributeLayout,B.textureBinding),e.recordBounds(I,R,k,k);const{texcoords:$,offsets:V}=B;this._writeQuad(e,t,r,n,{texcoords:$,offsets:V,fontSize:h,color:Xg(u.color),isBackground:!1,referenceBounds:a,minZoom:v,maxZoom:w,...l}),e.recordEnd()}o!==0&&s.setRotation(-o)}_writeTextBox(e,t,r,n,s,o,a){const l=this.evaluatedMeshParams,{fontSize:u}=this._textMeshTransformProps,{boxBackgroundColor:c,boxBorderLineColor:h}=l,p={isBackground:!0,fontSize:u,referenceBounds:o,...a};c&&(this._writeQuad(e,t,r,n,{texcoords:zJr,offsets:s.main,color:Xg(c),...p}),h||(this._writeQuad(e,t,r,n,{texcoords:VJr,offsets:s.top,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:HJr,offsets:s.bot,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:WJr,offsets:s.left,color:Xg(c),...p}),this._writeQuad(e,t,r,n,{texcoords:qJr,offsets:s.right,color:Xg(c),...p}))),h&&(this._writeQuad(e,t,r,n,{texcoords:rgt,offsets:s.top,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:rgt,offsets:s.bot,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:ngt,offsets:s.left,color:Xg(h),...p}),this._writeQuad(e,t,r,n,{texcoords:ngt,offsets:s.right,color:Xg(h),...p}))}_writeQuad(e,t,r,n,s){const o=e.vertexCount();this._writeVertex(e,t,r,n,s),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2)}};const XJr=i=>Math.round(i*(254/360)),zde=1,jj=0,JJr=128,KJr=CHi(i=>{let e=0;if(i===0)return 1/0;for(;!(i%2);)e++,i/=2;return e});let ZJr=class extends xzt{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,r,n){if(this._zoomLevel=n||0,r!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const s=t.readXForDisplay(),o=t.readYForDisplay();return this._writePoint(e,s,o,t)}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const s=t.readCentroidForDisplay();if(!s)return;const[o,a]=s.coords;return this._writePoint(e,o,a,t)}case"esriGeometryPolyline":{const s=t.readLegacyGeometryForDisplay();this._writeLines(e,t,s)}}}_writePoint(e,t,r,n){const s=this._getShaping();if(!s)return;let o=this._getPointReferenceBounds();o||(o={offsetX:0,offsetY:0,size:0});const a=s.boundsT,l=qGt(this.evaluatedMeshParams.horizontalAlignment),u=YGt(this.evaluatedMeshParams.verticalAlignment),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,p=vS(n.getDisplayId());e.metricStart(new Hee(p,t,r,l,u,c,h,o)),e.metricBoxWrite(a),this._writeGlyphs(e,n.getDisplayId(),t,r,s,0,o),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t,r){const{repeatLabel:n,scaleInfo:s}=this.evaluatedMeshParams,o=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping();if(!a)return;this._current={out:e,id:t.getDisplayId(),shaping:a,zoomRange:aX(s,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0}};const l=jJr(r.paths,a.bounds.width),u=this._placeSubdivGlyphs.bind(this),c=(a.bounds.width+o)/(1<0&&(l||u)){const S=Math.max(t,o[0],0),I=Math.min(fye,o[1]),R=Nae(SS(),-e.angle),[L,k]=s.shapeBackground(R),B={minZoom:S,maxZoom:I,clipAngle:h,mapAligned:!0,isLineLabel:!0};r.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,k,a,B),r.recordEnd(),B.clipAngle=p,r.recordStart(this.instanceId,this.attributeLayout,s.glyphs[0].textureBinding),this._writeTextBox(r,n,e.x,e.y,k,a,B),r.recordEnd()}const m=vS(n),v=this.evaluatedMeshParams.scaleInfo?.maxScale??0,w=this.evaluatedMeshParams.scaleInfo?.minScale??0;r.metricStart(new Hee(m,e.x,e.y,0,0,v,w,null)),this._placeFirst(c,t,1,h,!0),this._placeFirst(c,t,0,p,!0),r.metricEnd()}_placeBack(e,t,r,n,s,o){const a=e.clone();let l=e.backwardLength+jj;for(;a.prev()&&!(l>=n);)this._placeOnSegment(a,t,l,r,-1,s,o),l+=a.length+jj}_placeForward(e,t,r,n,s,o){const a=e.clone();let l=e.remainingLength+jj;for(;a.next()&&!(l>=n);)this._placeOnSegment(a,t,l,r,1,s,o),l+=a.length+jj}_placeFirst(e,t,r,n,s=!1){const o=e,{out:a,id:l,shaping:u,zoomRange:c,referenceBounds:h}=this._current,p=u.glyphs;for(const m of p){const v=m.x>u.bounds.x?r:1-r,w=v*e.remainingLength+(1-v)*e.backwardLength,S=Math.abs(m.x+m.width/2-u.bounds.x),I=Math.max(0,this._zoomLevel+Math.log2(S/(w+jj))),R=Math.max(t,s?0:I);m.maxZoom=Math.min(c[1],fye),m.angle=e.angle+(1-r)*Math.PI,m.minZoom=Math.max(c[0],R),this._writeLineGlyph(a,l,o.x,o.y,u.bounds,m,n,h,!0),r&&this._isVisible(m.minZoom,m.maxZoom)&&a.metricBoxWrite(m.bounds)}}_placeOnSegment(e,t,r,n,s,o,a){const{out:l,id:u,shaping:c,referenceBounds:h}=this._current,p=c.glyphs,m=e.dx/e.length,v=e.dy/e.length,w={x:e.x+r*-s*m,y:e.y+r*-s*v};for(const S of p){const I=S.x>c.bounds.x?o:1-o;if(!(I&&s===1||!I&&s===-1))continue;const R=Math.abs(S.x+S.width/2-c.bounds.x),L=Math.max(0,this._zoomLevel+Math.log2(R/r)-.1),k=Math.max(n,this._zoomLevel+Math.log2(R/(r+e.length+jj)));if(L!==0&&(S.angle=e.angle+(1-o)*Math.PI,S.minZoom=k,S.maxZoom=L,this._writeLineGlyph(l,u,w.x,w.y,c.bounds,S,a,h,!0),o&&this._isVisible(S.minZoom,S.maxZoom))){const B=S.bounds,$=e.x-t.x,V=e.y-t.y,Y=new T8(B.center[0]+$,B.center[1]+V,B.width,B.height);l.metricBoxWrite(Y)}}}_writeLineGlyph(e,t,r,n,s,o,a,l,u){const c=r+s.x,h=n+s.y,p=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),m=Math.max(s.width,s.height)*p;e.recordStart(this.instanceId,this.attributeLayout,o.textureBinding),e.recordBounds(c,h,m,m);const{texcoords:v,offsets:w}=o,S=this._textMeshTransformProps.fontSize;this._writeQuad(e,t,r,n,{texcoords:v,offsets:w,fontSize:S,color:Xg(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:l,minZoom:Math.max(this._current.zoomRange[0],o.minZoom),maxZoom:Math.min(this._current.zoomRange[1],o.maxZoom),clipAngle:a,mapAligned:u,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const r=this._zoomLevel;return e<=r&&r<=t}};const QJr={createComputedParams:i=>i,attributes:{...gCe.attributes,bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:i,shouldScaleDash:e,isSDF:t})=>Tle([[mCe,i],[_Ut,e],[bUt,t]])},tlbr:{type:Ti.UNSIGNED_SHORT,count:4,pack:({sprite:i})=>{const{rect:e,width:t,height:r}=i,n=e.x+Qg,s=e.y+Qg;return[n,s,n+t,s+r]}},accumulatedDistance:{type:Ti.UNSIGNED_SHORT,count:1,packTessellation:({distance:i})=>i},segmentDirection:{type:Ti.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:i,directionY:e})=>[i,e]}}};let eKr=class extends OJe{constructor(e,t,r,n){super(e,t,r,n),this.vertexSpec=QJr,this._tessellationOptions.textured=!0}_write(e,t,r){const n=r??Ec.fromFeatureSetReaderCIM(t);if(!n)return;const{sprite:s}=this.evaluatedMeshParams;this._writeGeometry(e,t,n,s?.textureBinding)}},tKr=class T9e{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const t=new T9e(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:r,width:n,height:s,angle:o,alignment:a,outlineSize:l,referenceSize:u,sprite:c,overrideOutlineColor:h}=e;t.rawWidth=us(n),t.rawHeight=us(s),t.angle=o,t.alignment=a,t.outlineSize=us(l),t.referenceSize=us(u),t.overrideOutlineColor=h,t.offsetX=us(e.offsetX),t.offsetY=us(e.offsetY),r!=="simple"||c.sdf||(t.rawWidth=c.width,t.rawHeight=c.height);const p=2;return t.sizeRatio=c.sdf?p:1,t._computeSize(e,!1),t}static fromComplexMeshParams(e){const t=new T9e(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:r,transforms:n,size:s,scaleX:o,anchorX:a,anchorY:l,angle:u,colorLocked:c,frameHeight:h,widthRatio:p,offsetX:m,offsetY:v,outlineSize:w,referenceSize:S,scaleFactor:I,sizeRatio:R,isAbsoluteAnchorPoint:L,rotateClockwise:k,scaleSymbolsProportionally:B,sprite:$}=e;if(n&&n.infos.length>0){const K=AMt(s,u,k,m,v,n);s=K.size,u=K.rotation,m=K.offsetX,v=K.offsetY,k=!1}I&&(s*=I,m*=I,v*=I);const V=o*($.width/$.height);t.alignment=r,t.rawHeight=us(s),t.rawWidth=t.rawHeight*V,t.referenceSize=us(S),t.sizeRatio=R,t.angle=u,t.rotateClockwise=k,t.anchorX=a,t.anchorY=l,t.offsetX=us(m),t.offsetY=us(v),L&&s&&($.sdf?t.anchorX=a/(s*p):t.anchorX=a/(s*V),t.anchorY=l/s);const Y=B&&h?s/h:1;return t.outlineSize=w===0||isNaN(w)?0:us(w)*Y,t.scaleSymbolsProportionally=B,t.colorLocked=c,t._computeSize(e,!0),t}constructor(e,t,r,n,s,o,a){this.sprite=e,this.color=t,this.outlineColor=r,this.minPixelBuffer=n,this.placement=s,this.scaleInfo=o,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.alignment=jb.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,t){const{sprite:r,hasSizeVV:n}=e,s=!!r.sdf,{rawWidth:o,rawHeight:a,sizeRatio:l,outlineSize:u}=this,c=o*l,h=a*l;if(s&&!n){const L=t&&o>a?c:o,k=a,B=u+2*1;this.computedWidth=Math.min(L+B,c),this.computedHeight=Math.min(k+B,h)}else this.computedWidth=c,this.computedHeight=h;const p=s?Wge/Math.max(c,h):1,m=.5*(c-this.computedWidth)*p,v=.5*(h-this.computedHeight)*p,w=r.rect.x+Qg+m,S=r.rect.y+Qg+v,I=w+r.width-2*m,R=S+r.height-2*v;this.texXmin=Math.floor(w),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(R),this.computedWidth*=(this.texXmax-this.texXmin)/(I-w),this.computedHeight*=(this.texYmax-this.texYmin)/(R-S),this.anchorX*=c/this.computedWidth,this.anchorY*=h/this.computedHeight}};const gA={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4}},iKr=3.14159265359/180,rKr=128/Math.PI;function nKr(i,e){return i%=e,Math.abs(i>=0?i:i+e)}function sKr(i){return nKr(i*rKr,256)}function oKr(i,e,t,r,n=!1){const s=SS(),o=n?1:-1;return sWe(s),(e||t)&&VA(s,s,[e,-t]),r&&sk(s,s,o*iKr*-r),s}const aKr={createComputedParams:i=>tKr.from(i),attributes:{pos:{type:Ti.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:({sprite:i,alignment:e,scaleSymbolsProportionally:t,overrideOutlineColor:r,colorLocked:n})=>{let s=0;return i.sdf&&(s|=hK(gA.bitset.isSDF)),e===jb.MAP&&(s|=hK(gA.bitset.isMapAligned)),t&&(s|=hK(gA.bitset.scaleSymbolsProportionally)),r&&(s|=hK(gA.bitset.overrideOutlineColor)),n&&(s|=hK(gA.bitset.colorLocked)),s}},zoomRange:{type:Ti.SHORT,count:2,packPrecisionFactor:xq,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:i,computedWidth:e,computedHeight:t,anchorX:r,anchorY:n,offsetX:s,offsetY:o,rotateClockwise:a})=>{const l=oKr(0,s,o,-i,a),u=-(.5+r)*e,c=-(.5-n)*t,h=[u,c],p=[u+e,c],m=[u,c+t],v=[u+e,c+t];return yf(h,h,l),yf(p,p,l),yf(m,m,l),yf(v,v,l),[h,p,m,v]}}},textureUV:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:i,texXmin:e,texYmax:t,texYmin:r})=>[[e,r],[i,r],[e,t],[i,t]]}},color:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>Xg(i)},outlineColor:{type:Ti.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>Xg(i)},sizing:{type:Ti.UNSIGNED_BYTE,count:4,pack:({rawWidth:i,rawHeight:e,outlineSize:t,referenceSize:r})=>{const n=Math.max(i,e);return[aPe(n,128),aPe(t,128),aPe(r,128),0]}},placementAngle:{type:Ti.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:i})=>sKr(i)},sizeRatio:{type:Ti.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sizeRatio:i})=>i}}};let lKr=class extends oX{constructor(){super(...arguments),this.vertexSpec=aKr}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,t,r){const n=this.evaluatedMeshParams.sprite?.textureBinding,s=t.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,n);const o=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,o),l=Math.max(this.evaluatedMeshParams.computedHeight,o),u=this.evaluatedMeshParams.offsetX,c=-this.evaluatedMeshParams.offsetY;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,t,r,a,l);else if(r&&r.nextPath()){r.nextPoint();const h=r.x,p=r.y;e.recordBounds(h+u,p+c,a,l),this._writeQuad(e,s,h,p)}else if(t.geometryType==="esriGeometryPolygon"){const h=t.readCentroidForDisplay();if(!h)return;const[p,m]=h.coords;e.recordBounds(p+u,m+c,a,l),this._writeQuad(e,s,p,m)}else if(t.geometryType==="esriGeometryPoint"){const h=t.readXForDisplay(),p=t.readYForDisplay();e.recordBounds(h+u,p+c,a,l),this._writeQuad(e,s,h,p)}else t.readGeometryForDisplay()?.forEachVertex((p,m)=>{e.recordBounds(p+u,m+c,a,l),Math.abs(p)>uF||Math.abs(m)>uF||this._writeQuad(e,s,p,m)});e.recordEnd()}_writePlacedMarkers(e,t,r,n,s){const o=r??Ec.fromFeatureSetReaderCIM(t)?.clone();if(!o)return;const a=-1,l=wzt.getPlacement(o,a,this.evaluatedMeshParams.placement,us(1),e.id,EJe());if(!l)return;const u=t.getDisplayId();let c=l.next();const h=this.evaluatedMeshParams.offsetX,p=-this.evaluatedMeshParams.offsetY;for(;c!=null;){const m=c.tx,v=-c.ty;if(Math.abs(m)>uF||Math.abs(v)>uF){c=l.next();continue}const w=-c.getAngle();e.recordBounds(m+h,v+p,n,s),this._writeQuad(e,u,m,v,w),c=l.next()}}_writeQuad(e,t,r,n,s){const o=e.vertexCount(),a=s==null?null:{placementAngle:s};this._writeVertex(e,t,r,n,a),e.indexWrite(o+0),e.indexWrite(o+1),e.indexWrite(o+2),e.indexWrite(o+1),e.indexWrite(o+3),e.indexWrite(o+2)}};const uKr={createComputedParams:i=>i,attributes:{pos:{type:Ti.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:Ti.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:Ti.UNSIGNED_BYTE,count:1,pack:i=>0},offset:{type:Ti.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:i})=>{const e=us(i),t=-e/2,r=-e/2;return[[t,r],[t+e,r],[t,r+e],[t+e,r+e]]}}},texCoords:{type:Ti.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:Ti.UNSIGNED_BYTE,count:2,pack:({size:i})=>[i,i]},referenceSize:{type:Ti.UNSIGNED_BYTE,count:1,pack:({size:i})=>us(i)},zoomRange:{type:Ti.UNSIGNED_BYTE,count:2,pack:({scaleInfo:i},{tileInfo:e})=>aX(i,e)}}};let cKr=class extends oX{constructor(){super(...arguments),this.vertexSpec=uKr}_write(e,t){const r=t.getDisplayId(),n=this.evaluatedMeshParams.minPixelBuffer,s=Math.max(us(this.evaluatedMeshParams.size),n);let o,a;if(t.geometryType==="esriGeometryPoint")o=t.readXForDisplay(),a=t.readYForDisplay();else{const u=t.readCentroidForDisplay();if(!u)return;o=u?.coords[0],a=u?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(o,a,s,s);const l=e.vertexCount();this._writeVertex(e,r,o,a),e.indexWrite(l+0),e.indexWrite(l+1),e.indexWrite(l+2),e.indexWrite(l+1),e.indexWrite(l+3),e.indexWrite(l+2),e.recordEnd()}};const f_=hKr({FillMeshWriter:IJe,DotDensityMeshWriter:CYr,ComplexFillMeshWriter:NYr,PatternFillMeshWriter:pUt,OutlineFillMeshWriter:DJe,PatternOutlineFillMeshWriter:MJr,ComplexOutlineFillMeshWriter:CJr,MarkerMeshWriter:lKr,PieChartMeshWriter:cKr,TextMeshWriter:xzt,LineMeshWriter:OJe,TexturedLineMeshWriter:eKr,HeatmapMeshWriter:PJr,LabelMeshWriter:ZJr});function hKr(i){const e={};for(const t in i){const r={name:t,constructor:i[t]};e[t]=r}return e}async function Szt(i,e,t,r,n,s,o){const a=f_[t],l=await THr.create(i,e,n),u=new a.constructor(r,l,s,o);return await u.loadDependencies(),u}async function qP(i,e,t,r){return Promise.all(t.map(n=>Szt(i,e,n.meshWriterName,n.id,n.options,r,n.optionalAttributes)))}let f7=class Tzt{constructor(){this._defaultResult=null,this._backgroundFillResult=null}static async from(e,t,r,n){const s=new Tzt;return s.setDefault(await qP(e,t,r.meshes,n)),s}size(){return 1}getDefault(){return this._defaultResult}setDefault(e){this._defaultResult=e}getBackgroundFill(){return this._backgroundFillResult}setBackgroundFill(e){this._backgroundFillResult=e}match(e,t){const r=this.doMatch(e,t)||this.getDefault();if(r&&r.length>0){const n=this.getBackgroundFill();if(n)return[...n,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},dKr=class Czt extends f7{static async fromDictionaryRenderer(e,t,r){return new Czt(e,t,r)}constructor(e,t,r){super(),this._storage=e,this._schema=t,this._viewParams=r,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),n=[];for(;r.next();)n.push(this._updateMeshWriterGroup(e,r));await Promise.all(n)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),n=t.getAttributeHash();if(this._hashToGroup.has(n))return;this._hashToGroup.set(n,null);const s=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!s)return;const o=await qP(this._storage,e,s.meshes,this._viewParams);this._hashToGroup.set(n,o)}},pKr=class Ezt extends f7{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t,r,n){const s=await e.createComputedField(r),o=new Ezt(s,r.isMaxInclusive);await Promise.all(r.intervals.map(async u=>{const c=await qP(e,t,u.meshes,n);o.add(u,c)}));const a=await qP(e,t,r.defaultSymbol,n);o.setDefault(a);const l=await qP(e,t,r.backgroundFill,n);return o.setBackgroundFill(l),o}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,n)=>r.interval.min-n.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let n=0;n=s.min,l=this._isMaxInclusive?r<=s.max:r{const l=await qP(e,t,a.meshes,n);return{minScale:a.minScale,maxScale:a.maxScale,meshes:l,expression:null,where:await e.createWhereClause(a.where)}}),o=await Promise.all(s);return new Izt(o)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),n=[];for(const s of r)s.where&&!s.where(e)||n.push(...s.meshes);return n}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,n=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=n)}},mKr=class Azt extends f7{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t,r,n){const s=r.expression?[e.createComputedField({expression:r.expression})]:[r.field?e.createComputedField({field:r.field}):null,r.field2?e.createComputedField({field:r.field2}):null,r.field3?e.createComputedField({field:r.field3}):null],o=(await Promise.all(s)).filter(c=>!!c),a=new Azt(o,r.fieldDelimiter),l=await qP(e,t,r.defaultSymbol,n);a.setDefault(l);const u=await qP(e,t,r.backgroundFill,n);return a.setBackgroundFill(u),await Promise.all(r.map.map(async(c,h)=>{const p=await qP(e,t,c.symbol,n);c.value===""?a.setNullResult(p):a.add(c.value,p,h+1)})),a}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const n=this._resultsMap.get(r.toString());return n?n.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const n=r.toString();return this._resultsMap.get(n)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const n of this._fields){const s=n.read(e,t);s==null||s===""?r.push(""):r.push(s)}return r.join(this._separator)}};async function soe(i,e,t,r){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return f7.from(i,e,t,r);case"interval":return pKr.fromIntervalSchema(i,e,t,r);case"dictionary":return dKr.fromDictionaryRenderer(i,t,r);case"label":return fKr.fromLabelSchema(i,e,t,r);case"map":return mKr.fromMatcherSchema(i,e,t,r);case"subtype":return gKr.fromSubtypes(i,e,t,r);case"cluster":return yKr.fromClusterSchema(i,e,t,r);default:throw new Error("Impl")}}let gKr=class Mzt extends f7{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t,r,n){const s=new Map,o=[];for(const a in r.renderers){const l=parseInt(a,10),u=soe(e,t,r.renderers[a],n).then(c=>s.set(l,c));o.push(u)}return await Promise.all(o),new Mzt(s,r.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),n=this._subMatchers.get(r);return n?n.match(e,t):null}},yKr=class Ozt extends f7{static async fromClusterSchema(e,t,r,n){const[s,o]=await Promise.all([soe(e,t,r.feature,n),soe(e,t,r.cluster,n)]);return new Ozt(s,o)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},vKr=class Pzt extends vHr{static async create(e,t,r,n){const s=await soe(e,t,r.symbology,n),o=r.labels?await soe(e,t,r.labels,n):null;return new Pzt(s,o)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const n=this._symbology.match(t,r);if(n){for(const s of n)s.enqueueRequest(e,t,r);if(this._labels){const s=this._labels.match(t,r);if(!s)return;for(const o of s)o.enqueueRequest(e,t,r)}}}write(e,t,r,n,s){const o=this._symbology.match(r,n);if(o){for(const a of o)a.write(e,t,r,n,s);if(e.entityRecordCount()>=1&&this._labels){const a=this._labels.match(r,n);if(!a)return;for(const l of a)l.setReferences(o),l.write(e,t,r,n,s)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},_Kr=class{},Rzt=class extends _Kr{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destory(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(e){const t=nzt(e.resource),r=Q1(JSON.stringify(t));return this._pendingIds.has(r)||(this._pendingIds.add(r),this._pendingRequests.push({...e,resourceId:r})),r}async fetchEnqueuedResources(){const e=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;re.process(t)})}async push(e){if(e.end)return await Promise.all(this._outstandingMessages),await this._queue.push(e),void(this._outstandingMessages=[]);const t=this._queue.push(e);return this._outstandingMessages.push(t),t}};const wKr=new Float64Array(2),xKr=new Float64Array(2),SKr="0123456789bcdefghjkmnpqrstuvwxyz",TKr=64;function CKr(i,e,t,r){const n=[i.xmin,i.ymin,i.xmax,i.ymax],s=$s.fromExtent(hr.fromBounds(n,r)),o=Sf(s,r,Xi.WGS84,{densificationStep:e*TKr});if(!o)return null;const a=uB(new $o,o,!1,!1),l=a.coords.filter((S,I)=>!(I%2)),u=a.coords.filter((S,I)=>I%2),c=Math.min(...l),h=Math.min(...u),p=Math.max(...l),m=Math.max(...u),v=C9e(c,h,t,Xi.WGS84),w=C9e(p,m,t,Xi.WGS84);return v&&w?{bounds:n,geohashBounds:{xLL:v[0],yLL:v[1],xTR:w[0],yTR:w[1]},level:t}:null}function C9e(i,e,t,r){if(r.isWebMercator){const o=yb(i/Td.radius),a=o-360*Math.floor((o+180)/360),l=[0,0];return ogt(l,0,yb(Math.PI/2-2*Math.atan(Math.exp(-e/Td.radius))),a,t),l}const n=Sf({x:i,y:e},r,Xi.WGS84);if(!n)return null;const s=[0,0];return ogt(s,0,n.y,n.x,t),s}function EKr(i){return SKr[i]}function Dzt(i){return(i[0]+i[1])/2}function sgt(i,e,t){return i[0]=e,i[1]=t,i}function IKr(i,e){const t=Dzt(i),r=e,n=!e;i[0]=n*i[0]+r*t,i[1]=n*t+r*i[1]}function KE(i,e){const t=e>Dzt(i);return IKr(i,t),t}function AKr(i,e){let t=-90,r=90,n=-180,s=180;for(let o=0;o>c,S=(v&i.geohashY)>>h;for(let I=p-1;I>=0;I--){const R=(n+s)/2,L=w&1<=0;I--){const R=(t+r)/2,L=S&1<m?1:0;s|=v<<29-(p+5*h),u=(1-v)*u+v*m,c=(1-v)*m+v*c}for(let p=0;p<5;p++){const m=(a+l)/2,v=t>m?1:0;o|=v<<29-(p+5*h),a=(1-v)*a+v*m,l=(1-v)*m+v*l}}i[2*e]=s,i[2*e+1]=o}function H6(i,e,t){let r="";const n=sgt(wKr,-90,90),s=sgt(xKr,-180,180);for(let o=0;ot,t=>t)}getDisplayAndObjectIds(e){return this.displayMap(e,t=>t,(t,r,n)=>[t,n])}afterUpdateChunks(){}},Lzt=class extends kzt{constructor(e,t,r,n){super(e,t),this.spatialReference=r,this.aggregateFields=n,this.events=new rd,this.featureAdapter=f7t}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new lL({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(e){}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const r=Dx();for(const n of e){const s=O1e(r,n.geometry,!1,!1);s&&t(s)}}},qJe=class{constructor(e,t,r,n,s){this.subscription=e,this.reader=t,this.clear=r,this.end=n,this.debugInfo=s,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,r){return{type:"append",clear:this.clear,id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:r}}},I9e=class{constructor(e,t,r,n,s){this.subscription=e,this.reader=t,this.remove=r,this.end=n,this.debugInfo=s,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,r){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:r}}},MKr=class extends xle{constructor(e){super(),this._field=e}resize(e){throw new Error("Method not implemented.")}read(e,t){return e.readAttribute(this._field)}readWithDefault(e,t){return e.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}};function agt(i,e,t){if(i==null)return null;const r=e.readArcadeFeature();e.contextTimeZone=t.$view?.timeZone;try{return i.evaluate({...t,$feature:r},i.services)}catch(n){return di.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",n),null}}function YJe(i){return i==null||i===1/0||i===-1/0||typeof i=="number"&&isNaN(i)}function lgt(i,e,t,r){if(i==null)return r??null;const n=e.readArcadeFeature();e.contextTimeZone=t.$view?.timeZone;const s=i.evaluate({...t,$feature:n},i.services);return YJe(s)?r??null:s}let OKr=class Nzt extends xle{static async create(e,t){const r=await $At(e,t.spatialReference,t.fields),n=Q1(e);return new Nzt(r,n)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?agt(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?lgt(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=agt(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const n=lgt(this._compiled,e,t,r);return e.setCachedValue(n),n}};function PKr(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const n=i;for(const s of t.codedValues)if(s.code===n)return s.name}else if(t.type==="range"){const{max:n,min:s}=NAt(e),o=+i;if(s!=null&&n!=null&&s<=o&&o<=n)return t.name}}let r=i;return mW(e)?r=vb(r,T6("short-date")):wY(e)&&(r=DS(+r)),r||""}let RKr=class $zt extends xle{static async create(e,t){const r=vPt(e);return new $zt(n=>r.replaceAll(/{[^}]*}/g,s=>{const o=s.slice(1,-1),a=n.metadata.fieldsIndex.get(o);if(a==null)return s;const l=n.readAttribute(o);return l==null?"":PKr(l,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const n=this._evaluator(e);return YJe(n)?r:n}referencesScale(){return!1}referencesGeometry(){return!1}},DKr=class extends xle{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:n,normalizationType:s}=this._normalizationInfo,o=e.readAttribute(r);switch(s??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return n?t/n*100:null}}},ACe=class mye{static fromBuffer(e,t){return new mye(e,t)}static create(e,t=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new mye(r,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,n++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}};const gPe=()=>di.getLogger("esri.views.2d.layers.features.support.whereUtils"),FKr={getAttribute:(i,e)=>i.readAttribute(e)};async function Bzt(i,e){try{const t=await Ine(i,e);if(!t.isStandardized){const r=new qe("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);gPe().error(r)}return r=>{const n=r.readArcadeFeature();try{return t.testFeature(n,FKr)}catch{return gPe().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return gPe().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),r=>!0}}const ugt=()=>di.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),Gj=4294967295;function Vde(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let MCe=class{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(ACe.create(this._allocatedSize,Iy)),e+1}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?RKr.create(e.expression,this.compilationOptions):await OKr.create(e.expression,this.compilationOptions)}catch(n){const s=new qe("featurelayer","Failed to compile arcade expression",{error:n,expression:e.expression});return ugt().error(s),null}if(e.normalizationType||e.normalizationField)return new DKr(e.field,e);if(e.field)return new MKr(e.field);const r=new qe("featurelayer","Unable to create computed field. No expression or field found",{info:e});return ugt().error(r),null}async createWhereClause(e){return e?Bzt(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&Iy,0)}setComputedNumeric(e,t,r){return this.setComputedNumericAtIndex(e&Iy,r,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&Iy,0)}setComputedString(e,t,r){return this.setComputedStringAtIndex(e&Iy,0,r)}getComputedNumericAtIndex(e,t){const r=e&Iy;return this._ensureNumeric(t,r),this._numerics[t][r]}setComputedNumericAtIndex(e,t,r){const n=e&Iy;this._ensureNumeric(t,n),this._numerics[t][n]=r}getPackedChunkId(e){const t=e&Iy;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const r=e&Iy;this._ensureInstanceId(r),this._instanceIds[r]=t}getComputedStringAtIndex(e,t){const r=e&Iy;return this._ensureString(t,r),this._strings[t][r]}setComputedStringAtIndex(e,t,r){const n=e&Iy;this._ensureString(t,n),this._strings[t][n]=r}getXMin(e){return this._bounds[4*(e&Iy)]}getYMin(e){return this._bounds[4*(e&Iy)+1]}getXMax(e){return this._bounds[4*(e&Iy)+2]}getYMax(e){return this._bounds[4*(e&Iy)+3]}setBounds(e,t,r=!1){const n=e&Iy;if(!r&&!this._dirtyBitset.has(e))return this._bounds[4*n]!==Gj;this._dirtyBitset.unset(e);const s=t.readGeometryWorldSpace();if(Vde(this._bounds,4*n+4,0),!s||!s.coords.length)return this._bounds[4*n]=Gj,this._bounds[4*n+1]=Gj,this._bounds[4*n+2]=Gj,this._bounds[4*n+3]=Gj,!1;let o=1/0,a=1/0,l=-1/0,u=-1/0;return s.forEachVertex((c,h)=>{o=Math.min(o,c),a=Math.min(a,h),l=Math.max(l,c),u=Math.max(u,h)}),this._bounds[4*n]=o,this._bounds[4*n+1]=a,this._bounds[4*n+2]=l,this._bounds[4*n+3]=u,!0}getBounds(e,t){const r=this.getXMin(t),n=this.getYMin(t),s=this.getXMax(t),o=this.getYMax(t);return a1e(e,r,n,s,o),r!==Gj}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),Vde(this._numerics[e],t,0)}_ensureInstanceId(e){Vde(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),Vde(this._strings[e],t,null)}},Fbe=class{getObjectId(e){return e.getObjectId()}getAttributes(e){return e.readAttributes()}getAttribute(e,t){return e.readAttribute(t)}getAttributeAsTimestamp(e,t){return e.readAttributeAsTimestamp(t)}cloneWithGeometry(e,t){return e}getGeometry(e){return e.readGeometryWorldSpace()}getCentroid(e,t){return e.readCentroidForDisplay()}};Fbe.Shared=new Fbe;const vK=1,kKr=2;let XJe=class jzt{constructor(e){this._geometryBounds=Wo(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new jzt(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,vK)}setTrue(e){const t=[],r=[],n=new Set(e);return this._idToVisibility.forEach((s,o)=>{const a=!!(this._idToVisibility.get(o)&vK),l=n.has(o);!a&&l?t.push(o):a&&!l&&r.push(o),this._idToVisibility.set(o,l?vK|kKr:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:n,objectIds:s}=this;return Kn.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:n,objectIds:s})}async update(e,t){this._hash=JSON.stringify(e);const r=await AXe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await Bzt(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",n=await _U(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);gY(this._geometryBounds,t),this._spatialQueryOperator=n,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=O7t(this._serviceInfo.timeInfo,e.timeExtent,Fbe.Shared);else{const t=new qe("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);di.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&vK||(this._idToVisibility.set(r,vK),e.push(r))}),e}},OCe=class{constructor(e){this._options=e,this._fieldsIndex="fieldsIndex"in e?Cd.fromJSON(e.fieldsIndex):new Cd(e.fields),e.spatialReference&&(this._spatialReference=Xi.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}},LKr=class Gzt extends OCe{static create(e){return new Gzt({fields:[],objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}},Uzt=class{constructor(e){this._valid=ACe.create(e),this._data=new Array(e)}has(e){return this._valid.has(e)}set(e,t){this._valid.set(e),this._data[e]=t}get(e){return this._data[e]}};const PCe=yi("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],NKr=PCe[0],$Kr=PCe[1],BKr=PCe[2],jKr=PCe[3],JJe=yi("featurelayer-simplify-payload-size-factors")??[1,2,4],GKr=JJe[0],UKr=JJe[1],zKr=JJe[2],VKr=yi("featurelayer-simplify-mobile-factor")??2,HKr=yi("esri-mobile"),cgt=4294967295;function WKr(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let RCe=class{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const n=HKr?VKr:1;t>4e6?r=zKr*n:t>1e6?r=UKr*n:t>5e5?r=GKr*n:t>1e5&&(r=n);let s=0;return e>4e3?s=jKr*r:e>2e3?s=BKr*r:e>100?s=$Kr:e>15&&(s=NKr),s}parseTimestampOffset(e){return e}getBounds(e){if(WKr(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===cgt)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(cgt),!1;let a=1/0,l=1/0,u=-1/0,c=-1/0;return o.forEachVertex((h,p)=>{a=Math.min(a,h),l=Math.min(l,p),u=Math.max(u,h),c=Math.max(c,p)}),this.setBoundsXMin(a),this.setBoundsYMin(l),this.setBoundsXMax(u),this.setBoundsYMax(c),a1e(e,a,l,u,c),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),n=this.getBoundsXMax(),s=this.getBoundsYMax();return a1e(e,t,r,n,s),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const n of this._joined){n.setIndex(this.getIndex());const s=n._readAttribute(e,t);if(s!==void 0)return s}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const n of Object.keys(r))e[n]=r[n]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,n=this.getCursor();for(;n.next();){const s=n.getObjectId();Of(s),r.set(s,n.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),n=new ry(e,t,r);return n.objectId=this.getObjectId(),n.displayId=this.getDisplayId(),n}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return KC(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&cB(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),n=this.getInTransform();return n!=null&&cB(r,r,this.hasZ,this.hasM,n),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new Uzt(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=KC(e,this.geometryType,this.hasZ,this.hasM),r=Ro(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?ao.unknownDateJSToArcadeDate(t):ao.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??RS):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===YF}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Lu.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Nu.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return ao.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Lu.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Nu.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return ao.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const n in r.attributes){const s=r.attributes[n];s instanceof Date&&(r.attributes[n]=s.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return p7t(new $o,e,this.hasM,this.hasZ);const t=Ec.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=FGt(t);return r?(r[1]*=-1,new $o([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return KC(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new $o([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new $o([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=ACe.create(this.getSize())),this._deleted.set(e)}},Gb=class T$ extends RCe{static fromFeatures(e,t){const{objectIdField:r,geometryType:n}=t,s=PW([],e,n,!1,!1,r);for(let o=0;o!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new T$(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndexFzt.create(o,c))),u=e.featureFilter?await XJe.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await Gv(t,Xi.WGS84),new zzt({fields:l,geohashLevel:a,spatialReference:t,featureFilter:u,timeZone:s},e.fields,r,n)}constructor(e,t,r,n){super(r,n,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new OCe({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:r.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new qKr(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset(),yield new qJe(t.subscription,Gb.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const n=new Map(e.map(o=>[t(o),o])),s=[];for(const o of this._sendStates.values())for(const a of o.featuresWorldSpace()){const{objectId:l,displayId:u}=a,c=n.get(l);if(c!=null){const h=r(u,c,l);s.push(h),n.delete(l)}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[];for(const s of this._sendStates.values())for(const o of s.featuresWorldSpace())t.has(o.displayId)&&!r.has(o.objectId)&&(o.geometry&&n.push({...hSe(o,this._metadata.geometryType,!1,!1),displayId:o.displayId}),r.add(o.objectId));return{features:[],aggregates:n}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const r of t.featuresWorldSpace())e(r)}async*_update(e,t){const{handledChunks:r,subscription:n,bins:s}=e,{spatialReference:o,geohashLevel:a}=this._indexOptions,l=n.tile;if(e.done)return;for(const S of t.chunks()){if(r.has(S.chunkId))continue;r.add(S.chunkId);const I=S.queryInfo;if("tileId"in I){const k=new Tc(I.tileId);if(k.level!==l.level||k.world!==l.key.world)continue}const R=S.getGeohashIndex(this._indexOptions),L=e.getGeohashBounds(o,a);L!=null&&R.putBins(s,L)}const u=[],c=n.tile.transform,h=n.tile.key.level;for(const S of s.values()){if(S.cachedFeature)S.cachedFeature.attributes=S.getAttributes();else{const I=S.getGeometry(this.spatialReference,c),R=new ry(I,S.getAttributes(),null);I||(R.centroid=S.getGeometryCentroid(this.spatialReference,c)),R.objectId=S.id,R.displayId=this._attributeStore.createDisplayIdForObjectId(`${R.objectId}.${h}`),S.cachedFeature=R}u.push(S.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const p=Gb.fromOptimizedFeatures(u,this._metadata,c),m=p.getCursor(),v=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;m.next();)this._attributeStore.setAttributeData(m.getDisplayId(),m,v);yield new I9e(e.subscription,p,[],e.done,{})}};const hgt=Math.PI/180;let Vzt=class A9e{static create(e){return new A9e(e.map(t=>XKr(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function XKr(i){switch(i.statisticType){case"min":return new JKr(i);case"max":return new KKr(i);case"avg":return new QKr(i);case"avg_angle":return new eZr(i);case"sum":case"count":return new ZKr(i);case"mode":return new tZr(i)}}let hX=class{constructor(e){this.field=e}insert(e,t){if(!this.field.computed)return;const r=this.field.computed.read(e,t);YJe(r)||this._insertValue(r)}},JKr=class Hzt extends hX{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new Hzt(this.field);return e.value=this.value,e}},KKr=class Wzt extends hX{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Wzt(this.field);return e.value=this.value,e}},ZKr=class qzt extends hX{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new qzt(this.field);return e.value=this.value,e}},QKr=class Yzt extends hX{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new Yzt(this.field);return e._total=this._total,e._count=this._count,e}},eZr=class Xzt extends hX{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*hgt),this._y=this._y+Math.sin(e*hgt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Xzt(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},tZr=class Jzt extends hX{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,n]of this._frequencies.entries())n>t&&(t=n,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const n=this._frequencies.get(t);n!=null?this._frequencies.set(t,n+r):this._frequencies.set(t,r)}}clone(){const e=new Jzt(this.field);return e._frequencies=new Map(this._frequencies),e}},M9e=class gye{static createId(e,t){return`${e}.${t}`}static create(e,t,r,n){return new gye(e,t,Vzt.create(r),n)}constructor(e,t,r,n){this.gridX=e,this.gridY=t,this._statistics=r,this._worldUnitsPerCell=n,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return gye.createId(this.gridX,this.gridY)}get count(){return this._count}get statistics(){return this._statistics}get objectIds(){return this._objectIds}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new gye(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,n){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=n,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:nge(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:sge(e,this.centroidYWorld)}getCentroid(e){const t=new $o([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new $o;return wx(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e){const t=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,r=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new $o([],[t,r]);if(e!=null){const s=new $o;return wx(s,n,!1,!1,"esriGeometryPoint",e)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const iZr=96;function O9e(i,e){return pu(i)*mze*iZr/e}let rZr=class{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=O9e(e.spatialReference,e.scale)}insert(e,t){const r=e.getCursor(),n={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,n,t)}putCellsInBounds(e,t){const[r,n,s,o]=t,a=Math.floor(r*this._pixelsPerMapUnit/this._options.cellSize),l=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),u=Math.ceil(s*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let h=l;h<=c;h++)for(let p=a;p<=u;p++){const m=`${p}.${h}`,v=this._cells.get(m);if(!v)continue;const w=e.get(v.id);w?v&&!e.has(v.id)&&w.merge(v):e.set(v.id,v.clone())}}putCells(e){for(const t of this._cells.values()){const r=e.get(t.id);r?r.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,r){const{featureFilter:n}=this._options;if(n!==null&&!n.check(e))return;let s=0,o=0;if(e.geometryType==="esriGeometryPoint")s=e.readXWorldSpace(),o=e.readYWorldSpace();else{if(r){const p=e.readCentroidForDisplay();if(p==null)return;const[m,v]=p.coords;if(m<0||m>xo||v<0||v>xo)return}const h=e.readCentroidWorldSpace();if(h==null)return;s=h.coords[0],o=h.coords[1]}const a=s*this._pixelsPerMapUnit,l=o*this._pixelsPerMapUnit,u=Math.floor(a/this._options.cellSize),c=Math.floor(l/this._options.cellSize);this._getCellOrCreate(u,c).insert(e,t,s,o)}_getCellOrCreate(e,t){const r=M9e.createId(e,t);let n=this._cells.get(r);if(!n){const s=1*this._options.cellSize/this._pixelsPerMapUnit;n=M9e.create(e,t,this._options.fields,s),this._cells.set(r,n)}return n}},nZr=class{constructor(e,t){this.inner=e,this.displayId=t}};const Hde=128;let sZr=class extends WJe{constructor(e){super(e),this.didSend=!1,this.done=!1}},oZr=class{constructor(e,t,r,n,s){this._level=e,this._scale=t,this._indexOptions=r,this._clusterRadius=n,this._store=s,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),r=new ry(t,e.inner.getAttributes(),null);r.objectId=e.inner.id,r.displayId=e.displayId,yield r}}clusters(){return this._clusters.values()}updateChunks(e,t){let r=!1;for(const a of e){const l=a.queryInfo;"tileId"in l&&new Tc(l.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),r=!0,a.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells))}const n={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},s=O9e(this._indexOptions.spatialReference,this._scale),o=this._indexOptions.cellSize;for(const{subscription:a}of t){const l=a.tile.bounds,u=Math.floor(l[0]*s/o),c=Math.floor(l[1]*s/o),h=Math.ceil(l[2]*s/o),p=Math.ceil(l[3]*s/o);n.xMin=Math.min(n.xMin,u),n.yMin=Math.min(n.yMin,c),n.xMax=Math.max(n.xMax,h),n.yMax=Math.max(n.yMax,p)}return this._lastCellBounds!=null&&n.xMin===this._lastCellBounds.xMin&&n.yMin===this._lastCellBounds.yMin&&n.yMin===this._lastCellBounds.yMin&&n.yMax===this._lastCellBounds.yMax||(r=!0,this._lastCellBounds=n),r&&this._clusterCells(n),r}async updateStatistics(e){let t=!1;for(const r of this._clusters.values())r.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,r.inner)||t);if(t){const r=Array.from(this._statistics.entries()).map(([n,s])=>({fieldName:n,minValue:s.minValue,maxValue:s.maxValue}));await e.container.updateStatistics(this._level,r)}}createAggregateFeatures(e,t){const r=e.subscription,n=[],s=r.tile.transform;for(const o of this._clusters.values()){let a=o.inner.getCentroidX(s);const l=o.inner.getCentroidY(s),u=r.tile.lod,c=u.wrap?u.worldSize[0]:null,h=o.inner.count===1?o.inner.firstObjectId:o.inner.id,p=o.displayId;if(c!=null)if(c===1){const m=new $o([],[a,l]),v=new ry(m,o.inner.getAttributes(),null);v.geometry.coords[0]-=xo,v.objectId=h,v.displayId=p,n.push(v);const w=new $o([],[a,l]),S=new ry(w,o.inner.getAttributes(),null);S.geometry.coords[0]+=xo,S.objectId=h,S.displayId=p,n.push(S)}else a>xo+xo/2?a-=c*xo:a<-xo/2&&(a+=c*xo);if(a=-Hde&&l=-Hde){const m=new $o([],[a,l]),v=new ry(m,o.inner.getAttributes(),null);v.objectId=h,v.displayId=p,n.push(v)}}return Gb.fromOptimizedFeatures(n,t,r.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((a,l)=>l.count-a.count);const r=[];for(const a of this._clusters.values())r.push(a.inner.id);this._clusters.clear();const n=this._clusterRadius*(1/O9e(this._indexOptions.spatialReference,this._scale)),s=1+this._clusterRadius/this._indexOptions.cellSize,o=new Set;for(const a of t){if(o.has(a.id)||a.gridXe.xMax||a.gridYe.yMax)continue;const l=this._store.createDisplayIdForObjectId(a.id),u=new nZr(a.clone(),l);o.add(a.id),this._clusters.set(a.id,u);const c=a.centroidXWorld,h=a.centroidYWorld;for(let p=a.gridY-s;p<=a.gridY+s;p++)for(let m=a.gridX-s;m<=a.gridX+s;m++){if(p===a.gridY&&m===a.gridX)continue;const v=this._cells.get(M9e.createId(m,p));if(!v||o.has(v.id))continue;const w=Math.abs(v.centroidXWorld-c),S=Math.abs(v.centroidYWorld-h);wFzt.create(a,u))),spatialReference:r,featureFilter:t.featureFilter?await XJe.create({geometryType:n.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:n.metadata.timeInfo,fieldsIndex:n.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:o};return new Kzt(e,t.clusterRadius,l,t.fields,n,s)}constructor(e,t,r,n,s,o){super(s,o,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=new OCe({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...n,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new sZr(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const n=new Map(e.map(a=>[t(a),a])),s=[],o=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of o.clusters()){const l=n.get(a.inner.id);if(l==null){if(a.inner.count===1){const u=n.get(a.inner.firstObjectId);if(u!=null){const c=r(a.displayId,u,a.inner.firstObjectId);s.push(c),n.delete(a.inner.firstObjectId)}}}else{const u=r(a.displayId,l,a.inner.id);s.push(u),n.delete(a.inner.id)}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[],s=[],o=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of o.aggregatesWorldSpace())if(t.has(a.displayId)&&!r.has(a.displayId)){const l=hSe(a,this._metadata.geometryType,!1,!1);if(r.add(a.displayId),l.attributes.cluster_count===1){n.push({...l,displayId:a.displayId});continue}s.push({...l,displayId:a.displayId})}return{features:n,aggregates:s}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(o=>o.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const o of r)o.subscription.tile.level===this._requiredLevel&&(o.didSend=!1,o.done=!1);const n=Array.from(this._sendStates.values()).filter(o=>o.done).map(o=>o.subscription.tile.key),s=new Set(n);for(const o of this._sendStates.values())this._source.updateTracking.updating&&(n.some(a=>a.containsChild(o.subscription.tile.key))||o.subscription.tile.key.getChildKeys().every(a=>s.has(a)))||o.didSend||o.subscription.tile.level!==this._requiredLevel||(o.didSend=!0,yield*this._update(o,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new oZr(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const n=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const s=n.getCursor(),o=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;s.next();)this._attributeStore.setAttributeData(s.getDisplayId(),s,o);yield new qJe(e.subscription,n,!0,e.done,{})}},lZr=class Zzt{static fromReader(e){const t=[],r=e.copy(),n=Dx();for(;r.next();)r.getBounds(n)&&t.push(r.getIndex());const s=$W(9,o=>(r.setIndex(o),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return s.load(t),new Zzt(s)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}},dgt=class P9e{static create(e,t,r,n){const s=Vzt.create(e),o=new Array(32);for(let a=0;a=o)return;const p=Math.ceil((u+1)/2),m=Math.floor((u+1)/2),v=1-u%2,w=30-(3*p+2*m),S=30-(2*p+3*m),I=(n&7*v+3*(1-v)<>w,R=(s&3*v+7*(1-v)<>S,L=I+R*(8*v+4*(1-v));c=c<<3*v+2*(1-v)|I,h=h<<2*v+3*(1-v)|R,l.children[L]==null&&(l.children[L]=dgt.create(this._fields,c,h,u+1)),u+=1,l=l.children[L]}}putBins(e,t){for(const r of this.getNodes(t)){const n=e.get(r.id);n?n.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:n}=e;let s=this._root;for(;s!==null;){const o=s.depth,a=s.xNode,l=s.yNode;if(o>=n){t.push(s),s=s.next;continue}const u=Math.ceil((o+1)/2),c=Math.floor((o+1)/2),h=1-o%2,p=30-(3*u+2*c),m=30-(2*u+3*c),v=~((1<>p,I=(r.yLL&w)>>m,R=(r.xTR&v)>>p,L=(r.yTR&w)>>m,k=a<<3*h+2*(1-h),B=l<<2*h+3*(1-h),$=k+8*h+4*(1-h),V=B+4*h+8*(1-h),Y=Math.max(k,S),K=Math.max(B,I),Q=Math.min($,R),re=Math.min(V,L);let ne=null,de=null;for(let pe=K;pe<=re;pe++)for(let H=Y;H<=Q;H++){const Z=H-k+(pe-B)*(8*h+4*(1-h)),ae=s.children[Z];ae&&(ne||(ne=ae,ne.next=s.next),de&&(de.next=ae),de=ae,ae.next=s.next)}s=ne||s.next}return t}},cZr=class{constructor(e){this._options=e,this._tree=new uZr(e.fields)}insert(e,t){const r=e.getCursor(),n={$view:{scale:0,timeZone:this._options.timeZone}};for(;r.next();)this._insertFeature(r,n,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,t,r){const{featureFilter:n,geohashLevel:s,spatialReference:o}=this._options;if(n!==null&&!n.check(e))return;let a=0,l=0;if(e.geometryType==="esriGeometryPoint")a=e.readXWorldSpace(),l=e.readYWorldSpace();else{if(r){const h=e.readCentroidForDisplay();if(h==null)return;const[p,m]=h.coords;if(p<0||p>xo||m<0||m>xo)return}const c=e.readCentroidWorldSpace();if(c==null)return;a=c.coords[0],l=c.coords[1]}const u=C9e(a,l,s,o);u&&this._tree.insert(e,a,l,u[0],u[1],s,t)}},hZr=class R9e extends RCe{static from(e,t){return new R9e(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[h,p]=e.scale,[m,v]=e.translate;return this._displayTranslationX=-m/h,this._displayScaleX=1/h,this._displayTranslationY=v/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,n]=t.scale,[s,o]=t.translate,[a,l]=e.scale,[u,c]=e.translate;if(this._displayScaleX=r/a,this._displayTranslationX=(s-u)/a,this._displayScaleY=n/l,this._displayTranslationY=(-o+c)/l,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1[t(o),o])),s=[];for(const o of this._source.chunks()){const a=o.reader.getCursor();for(;a.next();){const l=a.getObjectId(),u=a.getDisplayId(),c=n.get(l);if(c!=null){const h=r(u,c,l);s.push(h),n.delete(l)}}}return s}getDisplayFeatures(e){const t=new Set(e),r=new Set,n=[];for(const s of this._source.chunks()){const o=s.reader.getCursor();for(;o.next();){const a=o.getObjectId(),l=o.getDisplayId();t.has(l)&&!r.has(a)&&(n.push({...o.readLegacyFeatureWorldSpace(),displayId:l}),r.add(a))}}return{features:n,aggregates:[]}}async*applyOverride(e){const t=[],r=e.reader.getCursor();for(;r.next();){const a=r.getObjectId();t.push(a);const l=this._attributeStore.createDisplayIdForObjectId(a);r.setDisplayId(l),this._attributeStore.setAttributeData(l,r,this._evalOptions)}const n=this.getDisplayIds(t),s=this.getDisplayIds(e.removed),o=new Qzt(this._source.metadata);o.applyOverrides(e),this.handledChunks.add(o.chunkId),this.handledChunksForAttributeData.add(o.chunkId),this.handledChunksForIdCreation.add(o.chunkId);for(const a of this._sendStates.values())a.handledChunks.add(o.chunkId),yield new I9e(a.subscription,null,n,!1,o.queryInfo);for(const a of this._sendStates.values()){const l=o.getTileReader(a.subscription.tile);yield new I9e(a.subscription,l,s,!1,o.queryInfo)}for(const a of e.removed)this._attributeStore.releaseDisplayIdForObjectId(a)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const r=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(r):this._attributeStore.releaseDisplayIdForObjectId(r)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:r}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const n=r.getCursor();for(;n.next();){const s=this._attributeStore.createDisplayIdForObjectId(n.getObjectId());n.setDisplayId(s)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const r=t.getDisplayId();this._attributeStore.setAttributeData(r,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:r}=e;for(const n of this._source.chunks()){const{chunkId:s}=n;if(r.has(s))continue;r.add(s);const o=n.getTileReader(t.tile);o&&(yield new qJe(e.subscription,o,!1,n.end,n.queryInfo))}}};const fZr=(i,e)=>()=>null,mZr=!1;let gZr=class{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}},yZr=class{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new gZr(DJr(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}};function vZr(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const KJe=()=>di.getLogger("esri.views.layers.2d.features.support.AttributeStore"),_Zr=fZr(mZr,KJe());yi("esri-shared-array-buffer"),yi("esri-atomics");let bZr=class{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:n,layout:s,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=n,this.layout=s,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(n,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let n=0;nt)return null;this._resetRange();const n=!this.isLocal,s=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:n&&a.slice(e*r,(t+1)*r)||null,pixelType:s,layout:o}}_initData(e,t){const r=ArrayBuffer,n=Bee(e),s=new n(new r(t*t*4*n.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,n,s=0){const o=nB(this._schema,e);if(this.version=s,o&&(yi("esri-2d-update-debug")&&console.debug(`Version[${s}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?XJe.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:n??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const l=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(l?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(l?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const l=e.bindings[a];await Promise.all(l.map(async u=>{const c=await this._bind(t,u,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(c?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(c?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const h=c*o%a,p=Math.floor(c*o/a),m=this._getBlock(p+Sv.VV);let v=u.field?.read(t,r);u.valueRepresentation&&(v=vZr(v,u.valueRepresentation)),(v===null||isNaN(v)||v===1/0||v===-1/0)&&(v=mUt),m.setData(n,h,v)}))}get epoch(){return this._epoch}async sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();yi("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),await this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch},this._signal),this._epoch+=1,yi("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const n=await e.createComputedField(t),{valueRepresentation:s}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:n,valueRepresentation:s}),o.map.set(r,a)}else o.map.set(t.binding,{field:n,valueRepresentation:s});return n}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(Sv.Animation),this._getBlock(Sv.GPGPU),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new bZr(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._sizethis._connection.layerView.fetch(r,n),fetchDictionary:(r,n)=>this._connection.layerView.fetchDictionary(r,n)}),this._attributeStore=new eVt({isLocal:!1,update:r=>NP(this._connection.container.updateAttributeView(r))})}destroy(){this._proxy.destory(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}async update(e,t,r,n,s){const o=e.processor,a=nB(this._schema,o);if(!a&&!n)return;yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a,schema:o}),this._schema=o;const l=Xi.fromJSON(e.source.mutable.dataFilter.outSpatialReference),u=new MCe({fields:this._source.metadata.fieldsIndex,spatialReference:l});return await this._attributeStore.update(o.storage,u,this._source.metadata,l,t),this._strategy?.invalidateAttributeData(),n||Aie(a,"mesh")?(Aie(a,"mesh.strategy")&&await this._updateStrategy(o.mesh.strategy,l,s,o.mesh.timeZone),this._updateSortKey(u,"sortKey"in o.mesh?o.mesh.sortKey:null),(Aie(a,"mesh.factory")||o.mesh.factory.symbology.type==="dictionary")&&(this._factory=await vKr.create(u,this._proxy,o.mesh.factory,r)),this._invalidate(),this._version=t,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(e){if(!this._strategy)return;const t=this._strategy.applyOverride(e);for await(const r of t)try{await this._process(r)}catch{}this._source.applyOverride(e)}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map(({objectId:r,highlightFlags:n})=>({objectId:r,highlightFlags:n,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:r})=>r,(r,{highlightFlags:n},s)=>({objectId:s,displayId:r,highlightFlags:n}));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const n of e){let s=r.get(n.id);s==null&&(s=new bKr({concurrency:16,process:a=>this._process(a)}),r.set(n.id,s));const o=s.push(n).catch(a=>l3(a));t.push(o)}try{await Promise.all(t)}catch{}yi("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,r,n){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new pZr(this._source,this._attributeStore,n);break;case"binning":this._strategy=await YKr.create(e,t,this._source,this._attributeStore,n);break;case"cluster":this._strategy=await aZr.create(this._connection,e,t,this._source,this._attributeStore,n)}for(const s of r)this._strategy.onSubscribe(s)}async _updateSortKey(e,t){if(this._sortInfo=zo(this._sortInfo?.computed),t!=null){const r=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:r}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(yi("esri-2d-update-debug")){const l=t.tile;console.debug(`Version[${this._version}] Tile[${l.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),hn(t.signal);const r=await this._write(e,t.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone)),n=t.tile.tileInfoView.tileInfo.isWrappable,{message:s,transferList:o}=r.serialize(n),a=e.createMessage(s,this._version,this._attributeStore.epoch);if(hn(t.signal),this._connection.container.onMessage(a,{signal:t.signal,transferList:o}),this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")){const l=t.tile;console.debug(`Version[${this._version}] Tile[${l.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,r);await this._proxy.fetchEnqueuedResources()}async _write(e,t){const r=e.subscription.tile,n=e.reader?.getCursor(),s=n?.getSize()??0,o=r.tileInfoView.tileInfo.isWrappable,a=new yHr(r.key,this._strategy.enablePixelBuffering,o,s);if(!n)return a;const l=r.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;n.next();){const u=this._getSortKeyValue(n,t);a.entityStart(n.getDisplayId(),u),this._factory.write(a,this._proxy,n,l,r.level),a.entityEnd()}return a}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:r,order:n,byRenderer:s}=this._sortInfo,o=s?this._factory.getSortKey(e,t):r?.read(e,t);return o==null||isNaN(o)?0:o*(n==="asc"?-1:1)}},xZr=class tVt{static from(e){let t=0,r=0,n=0;return e.forEach(s=>{const o=s._readGeometry();o&&(r+=o.isPoint?1:o.lengths.reduce((a,l)=>a+l,0),n+=o.isPoint?1:o.lengths.length,t+=1)}),new tVt(t,r,n)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const yPe=4;function SZr(i,e){const{service:t}=i,r=t.orderByFields??e.objectIdField+" ASC",n=t.source,s={returnCentroid:!(n!==null&&typeof n=="object"&&"path"in n&&Fx(n.path))&&e.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:e.timeReferenceUnknownClient??void 0,outSpatialReference:Xi.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[r],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if(i.type==="feature"){const{gdbVersion:o,historicMoment:a,timeExtent:l}=i.mutable.dataFilter;return{...s,gdbVersion:o,historicMoment:a?new Date(a):null,timeExtent:l?Eg.fromJSON(l):null,outFields:i.mutable.availableFields}}return s}let TZr=class iVt{static fromSchema(e,t){return new iVt(SZr(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,n){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=n}get pageSize(){if(this._capabilities==null)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?yPe:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const n=new Set(this._queryParams.outFields),s=[];for(const o of n)t.hasField(o)||s.push(o);if(s.length===0)return null;r.outFields=s}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new Kn({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._capabilities==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),n=r.inner;return n.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),n.resultType="tile",n.geometry=e.extent,this._capabilities.query.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(n.maxAllowableOffset=e.resolution*yi("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(n.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(n.maxAllowableOffset*=yi("feature-polyline-generalization-factor"))),n.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,n.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(n.maxRecordCountFactor=yPe),r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:yPe})}};const CZr=2500;let yye=class extends un{constructor(e){super(),this._connection=e,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this.addHandles([Ki(()=>this._strategy?.connectionStatus??"disconnected",t=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:t})},{initial:!0}),Ki(()=>this._strategy?.errorString||null,t=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:t}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){this._strategy==null&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),e!=null&&this.addHandles([e.events.on("data-received",r=>this._onFeature(r)),e.events.on("message-received",r=>this._onWebSocketMessage(r)),e.events.on("features-updated",r=>this._onUpdate(r)),e.events.on("tick",()=>this._onTick())],t),this._strategy=e}updateCustomParameters(e){e!=null&&this._strategy?.updateCustomParameters(e)}sendMessageToSocket(e){this._strategy?.sendMessageToSocket(e)}sendMessageToClient(e){this._strategy?.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>CZr){const r=Math.round(this._updateInfo.client/(t/1e3)),n=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:r,websocket:n}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}};x([D()],yye.prototype,"_strategy",void 0),yye=x([Qe("esri.views.2d.layers.features.sources.StreamMessenger")],yye);let rVt=class{constructor(e){this._store=e,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}async queryOverride(e){throw new Error("InternalError: LoadStrategy does not support fetching")}};const vye=()=>di.getLogger("esri.layers.ogc.ogcFeatureUtils"),nVt="startindex",EZr=new Set([nVt,"offset"]),ZJe="http://www.opengis.net/def/crs/",pgt=`${ZJe}OGC/1.3/CRS84`;var pg;async function IZr(i,e,t={},r=5){const{links:n}=i,s=sE(n,"items",pg.geojson)||sE(n,"http://www.opengis.net/def/rel/ogc/1.0/items",pg.geojson);if(s==null)throw new qe("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:o,customParameters:a,signal:l}=t,u=xf(s.href,i.landingPage.url),c={limit:r,...a,token:o},h=gg(u,c),p={accept:pg.geojson},{data:m}=await zi(h,{signal:l,headers:p}),v=$Zr(h,r,m.links)??nVt;aJe(m);const w=$jt(m,{geometryType:e.geometryType}),S=e.fields||w.fields||[],I=e.hasZ!=null?e.hasZ:w.hasZ,R=w.geometryType,L=e.objectIdField||w.objectIdFieldName||"OBJECTID";let k=e.timeInfo;const B=S.find(({name:$})=>$===L);if(B)B.editable=!1,B.nullable=!1;else{if(!w.objectIdFieldType)throw new qe("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");S.unshift({name:L,alias:L,type:w.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(L!==w.objectIdFieldName){const $=S.find(({name:V})=>V===w.objectIdFieldName);$&&($.type="esriFieldTypeInteger")}S===w.fields&&w.unknownFields.length>0&&vye().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:w.unknownFields}});for(const $ of S){if($.name==null&&($.name=$.alias),$.alias==null&&($.alias=$.name),$.type!=="esriFieldTypeOID"&&$.type!=="esriFieldTypeGlobalID"&&($.editable=$.editable==null||!!$.editable,$.nullable=$.nullable==null||!!$.nullable),!$.name)throw new qe("ogc-feature-layer:invalid-field-name","field name is missing",{field:$});if(!wW.jsonValues.includes($.type))throw new qe("ogc-feature-layer:invalid-field-type",`invalid type for field "${$.name}"`,{field:$})}if(k){const $=new Cd(S);if(k.startTimeField){const V=$.get(k.startTimeField);V?(k.startTimeField=V.name,V.type="esriFieldTypeDate"):k.startTimeField=null}if(k.endTimeField){const V=$.get(k.endTimeField);V?(k.endTimeField=V.name,V.type="esriFieldTypeDate"):k.endTimeField=null}if(k.trackIdField){const V=$.get(k.trackIdField);V?k.trackIdField=V.name:(k.trackIdField=null,vye().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:k}}))}k.timeReference||={timeZoneIANA:y0},k.startTimeField||k.endTimeField||(vye().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:k}}),k=null)}return{drawingInfo:R?KA(R):null,extent:NZr(i),geometryType:R,fields:S,hasZ:!!I,objectIdField:L,paginationParameter:v,timeInfo:k}}async function AZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"data",pg.json)||sE(t,"http://www.opengis.net/def/rel/ogc/1.0/data",pg.json);if(n==null)throw new qe("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.json},query:{...o,token:s}});for(const c of u.collections)c.landingPage=i;return u}async function MZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"conformance",pg.json)||sE(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance",pg.json);if(n==null)throw new qe("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.json},query:{...o,token:s}});return u}async function OZr(i,e={}){const{apiKey:t,customParameters:r,signal:n}=e,{data:s}=await zi(i,{signal:n,headers:{accept:pg.json},query:{...r,token:t}});return s.url=i,s}async function PZr(i,e={}){const{links:t,url:r}=i,n=sE(t,"service-desc",pg.openapi);if(n==null)return vye().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:s,customParameters:o,signal:a}=e,l=xf(n.href,r),{data:u}=await zi(l,{signal:a,headers:{accept:pg.openapi},query:{...o,token:s}});return u}function fgt(i){const e=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(i),t=e?.groups;if(!t)return null;const{authority:r,code:n}=t;switch(r.toLowerCase()){case"ogc":switch(n.toLowerCase()){case"crs27":return Xi.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return Xi.WGS84.wkid;default:return null}case"esri":case"epsg":{const s=Number.parseInt(n,10);return Number.isNaN(s)?null:s}default:return null}}async function RZr(i,e,t){const r=await D9e(i,e,t);return jdr(r)}async function D9e(i,e,t){const{collection:{links:r,landingPage:{url:n}},layerDefinition:s,maxRecordCount:o,queryParameters:{apiKey:a,customParameters:l},spatialReference:u,supportedCrs:c}=i,h=sE(r,"items",pg.geojson)||sE(r,"http://www.opengis.net/def/rel/ogc/1.0/items",pg.geojson);if(h==null)throw new qe("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:p,num:m,start:v,timeExtent:w,where:S}=e;if(e.objectIds)throw new qe("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const I=Xi.fromJSON(u),R=e.outSpatialReference??I,L=R.isWGS84?null:sVt(R,c),k=LZr(p,c),B=FZr(w),$=kZr(S),V=m??(v==null?o:10),Y=v===0?void 0:v,{fields:K,geometryType:Q,hasZ:re,objectIdField:ne,paginationParameter:de}=s,pe=xf(h.href,n),{data:H}=await zi(pe,{...t,query:{...l,...k,crs:L,datetime:B,query:$,limit:V,[de]:Y,token:a},headers:{accept:pg.geojson}}),Z=lJe(H,{geometryType:Q,hasZ:re,objectIdField:ne}),ae=Z.length===V&&!!sE(H.links??[],"next",pg.geojson),fe=new Cd(K);for(const Ie of Z){const Te={};RF(fe,Te,Ie.attributes),Te[ne]=Ie.attributes[ne],Ie.attributes=Te}if(!L&&R.isWebMercator){for(const Ie of Z)if(Ie.geometry!=null&&Q!=null){const Te=KC(Ie.geometry,Q,re,!1);Te.spatialReference=Xi.WGS84,Ie.geometry=Z2(HB(Te,R))}}for(const Ie of Z)Ie.objectId=Ie.attributes[ne];const be=L||!L&&R.isWebMercator?R.toJSON():Yp,_e=new OHe;return _e.exceededTransferLimit=ae,_e.features=Z,_e.fields=K,_e.geometryType=Q,_e.hasZ=re,_e.objectIdFieldName=ne,_e.spatialReference=be,_e}function DZr(i){return i!=null&&i.type==="extent"}function sVt(i,e){const{isWebMercator:t,wkid:r}=i;if(!r)return null;const n=t?e[3857]??e[102100]??e[102113]??e[900913]:e[i.wkid];return n?`${ZJe}${n}`:null}function vPe(i){if(i==null)return"";const{xmin:e,ymin:t,xmax:r,ymax:n}=i;return`${e},${t},${r},${n}`}function FZr(i){if(i==null)return null;const{start:e,end:t}=i;return`${e!=null?e.toISOString():".."}/${t!=null?t.toISOString():".."}`}function kZr(i){return i!=null&&i&&i!=="1=1"?i:null}function LZr(i,e){if(!DZr(i))return null;const{spatialReference:t}=i;if(!t||t.isWGS84)return{bbox:vPe(i)};const r=sVt(t,e);return r!=null?{bbox:vPe(i),"bbox-crs":r}:t.isWebMercator?{bbox:vPe(HB(i,Xi.WGS84))}:null}function NZr(i){const e=i.extent?.spatial;if(!e)return null;const t=e.bbox[0],r=t.length===4,[n,s]=t,o=r?void 0:t[2];return{xmin:n,ymin:s,xmax:r?t[2]:t[3],ymax:r?t[3]:t[4],zmin:o,zmax:r?void 0:t[5],spatialReference:Xi.WGS84.toJSON()}}function sE(i,e,t){return i.find(({rel:r,type:n})=>r===e&&n===t)??i.find(({rel:r,type:n})=>r===e&&!n)}function $Zr(i,e,t){if(!t)return;const r=sE(t,"next",pg.geojson),n=Yo(r?.href)?.query;if(!n)return;const s=Yo(i).query,o=Object.keys(s??{});return Object.entries(n).filter(([u])=>!o.includes(u)).find(([u,c])=>EZr.has(u.toLowerCase())&&Number.parseInt(c,10)===e)?.[0]}(function(i){i.json="application/json",i.geojson="application/geo+json",i.openapi="application/vnd.oai.openapi+json;version=3.0"})(pg||(pg={}));const _Pe=268435455;let BZr=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function jZr(i,e,t=!1){const u=i.asUnsafe(),c=u.pos(),h=new BZr;let p=0,m=0;const v=1,w=2,S=4,I=3;let R=null,L=null,k=null,B=!1;const $=[];for(;u.next();)switch(u.tag()){case 1:R=u.getString();break;case 3:L=u.getString();break;case 12:k=u.processMessage(aDt);break;case 9:if(h.exceededTransferLimit=u.getBool(),h.exceededTransferLimit){h.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),h.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let Y=0;Y0}let WZr=class F9e extends RCe{static fromBuffer(e,t,r=!1){const n=t.geometryType,s=UZr(e),o=jZr(s,n==="esriGeometryPoint",r);return new F9e(s,o,t)}constructor(e,t,r){super(r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new F9e(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexh.length)for(let S=0;S=S?(p+=-.5*(Q-k)*(re+B),R>1&&bPe(h[c-2],h[c-1],$,V)?(h[c-2]+=$,h[c-1]+=V):(h[c++]=$,h[c++]=V,R++),k=Q,B=re):(Y+=$,K+=V),$=Y,V=K,I++}R<3||L?c-=2*R:(p+=-.5*(k+$-k)*(B+V+B),bPe(h[c-2],h[c-1],$,V)?(h[c-2]+=$,h[c-1]+=V,l.push(R)):(h[c++]=$,h[c++]=V,l.push(++R)))}else{let S=0,I=n.getSInt32(),R=n.getSInt32();this.hasZ&&n.getSInt32(),this.hasM&&n.getSInt32(),h[c++]=I,h[c++]=R,S+=1;for(let L=1;L2&&bPe(h[c-2],h[c-1],k,B)?(h[c-2]+=k,h[c-1]+=B):(h[c++]=k,h[c++]=B,S+=1),I=$,R=V}l.push(S)}break}default:n.skip()}return this._cache.area=p,l.length?new $o(l,h):null}},DCe=class{constructor(e,t){this.service=e,this._metadata=t}destroy(){}};function qZr(i,e){switch(i.type){case"memory":return new XZr(i,e);case"ogc":return new ZZr(i,e);case"feature-service":return i.queryMetadata.capabilities.query.supportsFormatPBF&&yi("featurelayer-pbf")?new JZr(i,e):new KZr(i,e)}}async function YZr(i){const e=new oOt;return await e.open(i,{}),e}let XZr=class extends DCe{constructor(e,t){super(e,t),this._portsOpen=YZr(e.source).then(r=>this.client=r)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const r=await this.client.invoke("queryFeatures",e.toJSON(),t);return Gb.fromFeatureSet(r,this._metadata)}},JZr=class extends DCe{async executeQuery(e,t){const{data:r}=await cDt(this.service.source,e,t),n=!e.quantizationParameters;return WZr.fromBuffer(r,this._metadata,n)}},KZr=class extends DCe{async executeQuery(e,t){const{source:r,queryMetadata:n}=this.service,s=n.capabilities;if(e.quantizationParameters!=null&&!s.query.supportsQuantization){const a=e.clone(),l=p1e(a.quantizationParameters);a.quantizationParameters=null;const{data:u}=await OW(r,a,this._metadata.spatialReference,t),c=HHe(u,this._metadata.objectIdField);return RDt(l,c),Gb.fromOptimizedFeatureSet(c,this._metadata)}const{data:o}=await OW(r,e,this._metadata.spatialReference,t);return this._metadata.geometryType==="esriGeometryPoint"&&(o.features=o.features?.filter(a=>{if(a.geometry!=null){const l=a.geometry;return Number.isFinite(l.x)&&Number.isFinite(l.y)}return!0})),Gb.fromFeatureSet(o,this._metadata)}},ZZr=class extends DCe{async executeQuery(e,t){const{capabilities:r}=this.service.queryMetadata;if(e.quantizationParameters&&!r.query.supportsQuantization){const s=e.clone(),o=p1e(s.quantizationParameters);s.quantizationParameters=null;const a=await D9e(this.service.source,e,t);return RDt(o,a),Gb.fromOptimizedFeatureSet(a,this._metadata)}const n=await D9e(this.service.source,e,t);return Gb.fromOptimizedFeatureSet(n,this._metadata)}},oVt=class extends rVt{constructor(e,t,r,n,s){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=n,this._eventLog=s,this._queue=new UY({concurrency:16,process:async o=>{const a={signal:o.options?.signal,query:o.query.customParameters};return this._adapter.executeQuery(o.query.inner,a)}}),this._adapter=qZr(e,n)}async updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this._store.chunks()).map(async n=>{const s=Kn.fromJSON(n.queryInfo.queryJSON);if(s)try{return await this._tryUpdateFields(n.reader,s),null}catch(o){return o}}),r=(await Promise.all(t)).filter(n=>n);if(r.length)throw new qe("featurelayer-query","Encountered errors when downloading fields",{errors:r})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)o.objectId!=null&&o.objectId!==-1?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const n=e.addOrModified.map(({objectId:o})=>o);let s;if(n.length){const o=this._queryInfo.createQuery({objectIds:n});s=await this._fetch(o)}else s=Gb.empty(this._metadata);return{reader:s,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(r==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const n=[];return this._store.forEachUnsafe(s=>{const o=s.readAttribute(r);t.has(o)&&n.push(s.getObjectId())}),n}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e);if(!r)return;const n=await this._enqueue(r,this._options);e.joinAttributes(n)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._eventLog.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},aVt=class extends oVt{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const r=e.size();(r||e.first||e.end)&&(yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${r}]`),this._chunksById.get(t).push(e),this._store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const r of t)yi("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${r.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(r);this._chunksById.delete(e.key.id)}},_gt=class extends Dle{constructor(e,t,r,n,s,o){super(),this._reader=e,this._queryJSON=t,this._tile=r,this._sourceTile=n,this._sourceTileDepth=s,this._end=o,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}},QZr=class{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,Qh(e.options,()=>this._controller.abort()),Qh(t,()=>this._controller.abort())}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}},eQr=class extends aVt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new QZr(e,this._options));const t=this._loadStates.get(e.key.id);let r;try{for await(const s of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:o,reader:a,sourceTile:l,sourceTileDepth:u,tile:c}=s,h=new _gt(a,o,c,l,u,!1);hn(e.options),this._addChunk(h)}}catch(s){r=s}const n=new _gt(Gb.empty(this._metadata),null,e.tile,null,-1,!0);if(this._addChunk(n),r)throw r}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,r){let n=e.get(t.id);const s=!!n;if(n||(n=await this._fetchChunkInfo(e,t,r),e.set(t.id,n)),n.reader.exceededTransferLimit&&rthis._controller.abort()),Qh(t,()=>this._controller.abort())}resetAbortController(){this._controller=new AbortController}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}},iQr=class extends aVt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new tQr(e,this._options));const t=this._loadStates.get(e.key.id);let r;t.resetAbortController();try{await this._fetchPages(t)}catch(s){r=s}const n=new bgt(Gb.empty(this._metadata),null,e.tile,-1,!0);if(xg(t.options)||this._addChunk(n),r)throw r}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async _fetchPages(e){let n=0,s=e.pageStart,o=1;for(;n<20&&!e.done;){const a=[];for(let u=0;ul).sort((a,l)=>this._random.getInt()-this._random.getInt()),n=await Promise.all(r.map(a=>this._downloadPage(a))),s=new wgt(Gb.empty(this._metadata),null,-1,!0);this._store.insert(s);const o=n.filter(a=>a);if(o.length)throw new qe("featurelayer-query","Encountered errors when downloading data",{errors:o})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),n=new wgt(r,t.inner.toJSON(),e,!1);return hn(this._options),this._store.insert(n),null}catch(t){return t}}},k9e=class{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(this.size===0)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return this.size===0?null:this._buffer[this._start]}find(e){if(this.size===0)return null;for(const t of this._buffer)if(t!=null&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;t!=null;)e&&e(t),t=this.dequeue()}};const nQr="__esri_stream_id__",xgt="__esri_timestamp__",Sgt=1e3;let sQr=class{constructor(e,t,r,n,s=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=n,this.store=e,this.objectIdField=t,this.purgeInterval=s,this._useGeneratedIds=this.objectIdField===nQr}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const o=this._nextId();e.attributes[this.objectIdField]=o,e.objectId=o}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new k9e(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const o=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Sgt,a=uu(o,0,Sgt);this._trackIdToObservations.set(r,new k9e(a))}const n=this._trackIdToObservations.get(r),s=n?.enqueue(t);s!=null&&(this._addOrUpdated.has(s)?this._addOrUpdated.delete(s):this._removed.push(s))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const n=[];if(t!=null)for(const o of t){const a=this.store.removeById(o);a!=null&&n.push(a)}const s=[];if(e!=null){const o=new Set(t??[]);for(const a of e)o.has(a.objectId)||(a.attributes[xgt]=r,this.store.add(a),s.push(a))}return!(!s.length&&!n?.length)&&(this.store.update(s,n),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const n=r.dequeue();this._removed.push(n),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const n=this._trackIdLessObservations.dequeue();n!=null&&this._removed.push(n)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,n=this._maxAge-r;this.store.forEach(s=>{s.attributes[t]{n.attributes[xgt]{e.size===0&&this._trackIdToObservations.delete(t)})}},_ye=class extends rd.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new qe("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};x([D({readOnly:!0})],_ye.prototype,"connectionError",null),_ye=x([Qe("esri.layers.support.StreamConnection")],_ye);const lVt=_ye;var oV;(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.OPEN=1]="OPEN",i[i.CLOSING=2]="CLOSING",i[i.CLOSED=3]="CLOSED"})(oV||(oV={}));let aV=class extends lVt{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=IY(t,n,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case oV.CONNECTING:case oV.OPEN:return"connected";case oV.CLOSING:case oV.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const n=gg(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(n),this.notifyChange("connectionStatus")}catch(n){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(di.getLogger(this).error(new qe("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(di.getLogger(this).error(new qe("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await jk(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void di.getLogger(this).error(new qe("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_createWebSocket(e){return new Promise((t,r)=>{const n=new WebSocket(e);n.onopen=()=>{if(n.onopen=null,this.destroyed)return n.onclose=null,void n.close();n.onclose=s=>this._onClose(s),n.onerror=s=>this._onError(s),this._setWebSocketJSONParseHandler(n),t(n)},n.onclose=s=>{n.onopen=n.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=ac(),n=t.onmessage,{filter:s,outFields:o,spatialReference:a}=this._config;return r.timeout(e),t.onmessage=l=>{let u=null;try{u=JSON.parse(l.data)}catch{}u&&typeof u=="object"||(di.getLogger(this).error(new qe("websocket-connection","Protocol violation. Handshake failed - malformed message",l.data)),r.reject(),this.destroy()),u.spatialReference?.wkid!==a?.wkid&&(di.getLogger(this).error(new qe("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,l.data)),r.reject(),this.destroy()),u.format!=="json"&&(di.getLogger(this).error(new qe("websocket-connection","Protocol violation. Handshake failed - format is not set",l.data)),r.reject(),this.destroy()),s&&u.filter!==s&&di.getLogger(this).error(new qe("websocket-connection","Tried to set filter, but server doesn't support it")),o&&u.outFields!==o&&di.getLogger(this).error(new qe("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=n;for(const c of this._outstandingMessages)t.send(JSON.stringify(c));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:o,format:"json",spatialReference:{wkid:a.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),di.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&di.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};x([D()],aV.prototype,"connectionStatus",null),x([D()],aV.prototype,"errorString",void 0),aV=x([Qe("esri.layers.graphics.sources.connections.WebSocketConnection")],aV);const oQr=1e4,aQr={maxQueryDepth:5,maxRecordCountFactor:3};let L9e=class extends aV{constructor(e){super({...aQr,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||di.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void di.getLogger(this).error(new qe("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=zi(e.path,{query:t,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return gg(`${o}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return di.getLogger(this).error(new qe("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const o=ac(),a=()=>{s||(this.destroyed||this._websocket!==r||di.getLogger(this).error(new qe("geoevent-connection","Server timed out when setting filter")),o.reject())},l=u=>{const c=JSON.parse(u.data);c.filter&&(c.error&&(di.getLogger(this).error(new qe("geoevent-connection","Failed to set service filter",c.error)),this._set("errorString",`Could not set service filter - ${c.error}`),o.reject(c.error)),this._setWebSocketJSONParseHandler(r),s=!0,o.resolve())};return r.onmessage=l,r.send(n),setTimeout(a,oQr),o.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const n=Ro(e.geometry);if(n.type!=="extent")throw new qe(`Expected extent but found type ${n.type}`);r.geometry=JSON.stringify(n.shiftCentralMeridian())}catch(n){di.getLogger(this).error(new qe("geoevent-connection","Encountered an error when setting connection geometryDefinition",n))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],n=this._relatedFeatures.get(r);if(!n)return di.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:o}=n;for(const a in s)e.attributes[a]=s[a];return o&&(e.geometry=o),e.geometry||e.centroid||di.getLogger(this).error(new qe("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(t);await r;const s=await n;if(!s)return;for(const o of s.features)this.onFeature(this._enrich(o))}catch(e){di.getLogger(this).error(new qe("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new(await Promise.resolve().then(()=>rHe)).default({url:e}),{capabilities:r}=await t.load(),n=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,u=n?l*a:l,c=new Kn;if(c.outFields=this._config.outFields??["*"],c.where=this._config.filter?.where??"1=1",c.returnGeometry=!0,c.returnExceededLimitFeatures=!0,c.outSpatialReference=Xi.fromJSON(this._config.spatialReference),o&&(c.returnCentroid=!0),n&&(c.maxRecordCountFactor=a),s)return c.num=u,t.destroy(),this._queryPages(e,c);const h=await OW(e,c,this._config.sourceSpatialReference);return t.destroy(),h.data}async _queryPages(e,t,r=[],n=0){t.start=t.num!=null?n*t.num:null;const{data:s}=await OW(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(o=>r.push(o)),this._queryPages(e,t,r,n+1)):(r.forEach(o=>s.features.push(o)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const o=s.attributes[n];t.set(o,s)}this._relatedFeatures=t}};L9e=x([Qe("esri.layers.graphics.sources.connections.GeoEventConnection")],L9e);const lQr=L9e;let Wee=class extends lVt{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=IY(t,n,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};x([D()],Wee.prototype,"connectionStatus",void 0),x([D()],Wee.prototype,"errorString",void 0),Wee=x([Qe("esri.layers.support.ClientSideConnection")],Wee);function uQr(i,e){if(i==null&&e==null)return null;const t={};return e!=null&&(t.geometry=e),i!=null&&(t.where=i),t}function uVt(i,e,t,r,n,s,o,a,l){const u={source:i,sourceSpatialReference:e,spatialReference:t,geometryType:r,filter:uQr(n,s),maxReconnectionAttempts:o,maxReconnectionInterval:a,customParameters:l};return i?i.path.startsWith("wss://")||i.path.startsWith("ws://")?new aV(u):new lQr(u):new Wee(u)}const cQr=Object.freeze(Object.defineProperty({__proto__:null,createConnection:uVt},Symbol.toStringTag,{value:"Module"}));let SU=class extends un{constructor(e){super(e)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};x([D()],SU.prototype,"connection",void 0),x([D()],SU.prototype,"connectionStatus",null),x([D()],SU.prototype,"errorString",null),SU=x([Qe("esri.views.2d.layers.features.sources.StreamConnectionState")],SU);let hQr=class{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return Gb.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate(e?.length??0)}},dQr=class extends Dle{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}},pQr=class extends rVt{constructor(e,t,r,n,s){super(r),this._service=e,this._dataFilter=t,this._streamOptions=n,this._metadata=s,this._connectionState=new SU,this._forceRefresh=!1,this.events=new rd;const{objectIdField:o,timeInfo:a}=this._metadata,{purgeOptions:l}=t;this._stagingStore=new hQr(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new sQr(this._stagingStore,o,a,l),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new dQr(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=zo(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:n,geometryDefinition:s,definitionExpression:o,customParameters:a}=this._dataFilter;this._connection=uVt(this._service.source,t,this._streamOptions.outSR,e,o,s,r,n,a),this._handlesGroup=j3([this._connection.on("data-received",l=>this._onFeature(l)),this._connection.on("message-received",l=>this._onWebSocketMessage(l))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}},fQr=class{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new rd,this.featureAdapter=new Fbe}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrideChunk!=null&&this._chunksToRemove.push(this._overrideChunk),this._overrideChunk=null}*chunks(){this._overrideChunk&&(yield this._overrideChunk),yield*this._chunks.values()}insert(e){yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._overrideChunk?.overridenIds.size&&e.reader.removeIds(this._overrideChunk.overridenIds),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){yi("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyOverrides(e,t){this._overrideChunk==null&&(this._overrideChunk=new Qzt(t)),this._overrideChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._overrideChunk.overridenIds),r.invalidate()}forEach(e){const t=new Set;for(const r of this.chunks()){const n=r.reader.getCursor();for(;n.next();){const s=n.getObjectId();t.has(s)||(e(n.copy()),t.add(s))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const n=r.reader.getCursor();for(;n.next();){const s=n.getObjectId();t.has(s)||(e(n),t.add(s))}}}forEachInBounds(e,t){const r=new Set;for(const n of this.chunks()){const s=n.queryFeaturesInBounds(e);for(;s.next();){const o=s.getObjectId();r.has(o)||(t(s.copy()),r.add(o))}}}forEachBounds(e,t){const r=Dx();for(const n of e)n.getBounds(r)&&t(r)}},E8=class extends un{constructor(e){super(e),this.debugName="",this._updatingHandles=new Mb,this._idToUpdatingState=new WV}get updating(){const e=this._updatingHandles.updating||Array.from(this._idToUpdatingState.values()).some(t=>t);if(yi("esri-2d-log-updating")){const t=Array.from(this._idToUpdatingState.entries()).map(([r,n])=>`-> ${r}: ${n}`).join(` `);console.log(`${this.debugName}: Updating: ${e} -> Handles: ${this._updatingHandles.updating} -${t}`)}return e}addUpdateTracking(e,t){const r=Ki(()=>t.updating,n=>this._idToUpdatingState.set(e,n),{sync:!0});this.addHandles(r)}addPromise(e){return this._updatingHandles.addPromise(e)}};x([D({constructOnly:!0})],E8.prototype,"debugName",void 0),x([D({readOnly:!0})],E8.prototype,"updating",null),E8=x([Qe("esri.view.2d.layers.support.UpdateTracking2D")],E8);let vQr=class{constructor(e,t,r,n){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=r,this._connection=n,this._updateTracking=new E8({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new yQr(this._onChange)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy()}get _eventLog(){return this._connection.eventLog}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return CZr.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new lL({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:e.outSpatialReference,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._eventLog.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(NP(this._strategy?.load(e)))}onUnsubscribe(e){this._eventLog.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getOverride(e){return this._updateTracking.addPromise(this._doGetOverride(e))}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverrides(e,this.metadata)}async update(e,t){const r=e.source,n=nB(this._schema?.mutable,r.mutable);if(!n)return!1;if(yi("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=r,this._metadata=new OCe(this._schema.service.metadata),this._queryEngine?.destroy(),this._queryEngine=null,this._schema.type==="feature"&&this._schema.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this._schema.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),Znt(n,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if(r.type==="feature"&&Znt(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._eventLog.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._eventLog.onEvent({type:"updateFieldsEnd"})}catch(s){this._eventLog.onEvent({type:"updateFieldsError",error:s})}}return!1}return!(!Knt(n,"dataFilter")&&!Knt(n,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new yye(this._connection))}async _doGetOverride(e){return this._strategy.queryOverride(e)}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this._schema.service.source,t={...e.query,f:"json"},r=(await zi(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e=this.service,t="isSourceHosted"in e&&e.isSourceHosted,r=Array.isArray(e.source),n=e.source&&"collection"in e.source,s=t||r||n;if(this._schema.type==="stream"){const l=new gQr(this._schema.service,this._schema.mutable.dataFilter,this._store,{outSR:this._schema.mutable.dataFilter.outSpatialReference},this.metadata);return this._streamMessenger.strategy=l,l}const o=IZr.fromSchema(this._schema,this._metadata),a=await this._supportSnapshotMode(this._schema,o);return a?new oQr(this._schema.service,o,this._store,a.featureCount,this.metadata,this._eventLog):s?new sQr(this._schema.service,o,this._store,this.metadata,this._eventLog):new rQr(this._schema.service,o,this._store,this.metadata,this._eventLog)}async _updateStrategy(e){const t=await this._createStrategy();this._eventLog.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const n=Array.from(this._subscriptions.values());if(!n.length)return void this._eventLog.onEvent({type:"updateStrategyEnd"});const s=Promise.all(n.map(o=>this._strategy.load(o).then(()=>this._eventLog.onEvent({type:"loaded",tile:o.tile.id})).catch(a=>this._eventLog.onEvent({type:"error",tile:o.tile.id,error:a}))));this._updateTracking.addPromise(s);try{r&&await s}catch(o){l3(o)}this._eventLog.onEvent({type:"updateStrategyEnd"}),yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e.service,n=r.snapshotInfo;if(!n||!n.supportsSnapshotMinThreshold||!n.snapshotCountThresholds)return null;const s=e.service.source,o=t.createQuery();o.inner.orderByFields=[],o.inner.returnGeometry=!1;const a=(await PHe(s,o.inner,{query:o.customParameters})).data.count,{min:l,max:u}=n.snapshotCountThresholds;return a<=l||n.supportsSnapshotMaxThreshold&&athis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._handles.remove(),this._editState=null,this._tileInfoView=null}onDetach(){this.destroy(),this._initialize(this._connection)}_initialize(e){this._source=new vQr(this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),e),this._processor=new TZr(e,this._source),this._handles=j3([Ki(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})})])}set remoteClient(e){this._connection=new mHr(e),this._initialize(this._connection)}get features(){const e=this._source.queryEngine;if(!e)throw new qe("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor.aggregateQueryEngine;if(!e)throw new qe("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}async updateSchema(e,t){return yi("esri-2d-update-debug")&&this._updateSchemaState&&console.error("InternalError: Schema already updating"),this._updateSchemaState=new wQr(e,t),this._requestUpdate(),this._updateSchemaState.resolver.promise}updateSubscriptions(e){this._updateSubscriptionRequests.push(e),this._requestUpdate()}updateHighlight(e){this._updateHighlightRequests.push(e),this._requestUpdate()}async onEdits(e){if(this._editState!=null)throw new qe("InternalError - Already processing an edit");this._editState=new bQr(e);const t=this._editState.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(us(e.radius));let r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;const s=typeof e.fieldOffset=="string",o=e.fieldOffset??0,a=Array.from(this._subscriptions.values()),l=this._source.chunks(),u=t**2,c=3/(Math.PI*u),h=2*t,p=Math.ceil(xo/h);for(const m of a){const v=m.tile,w=new Float64Array(p*p);for(const S of l){const I=S.getTileReader(v);if(!I)continue;const R=I.getCursor();for(;R.next();){let L=1;if(e.field!=null){const Q=R.readAttribute(e.field);L=s?-1*+Q:+Q+o}const k=R.readXForDisplay()/h,B=R.readYForDisplay()/h,$=Math.floor(k),V=Math.floor(B);if($<0||V<0||$>=p||V>=p)continue;const Y=((.5+$-k)*h)**2+((.5+V-B)*h)**2;if(Y>u)continue;const K=L*(c*(1-Y/u)**2);w[V+$*p]+=K}}for(let S=0;Sl+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const l=[];return this._source.store.forEachUnsafe(u=>l.push(u.readLegacyFeatureWorldSpace())),l}return null}const r=new Set,n=[],s=t.map(l=>l.reader.getCursor()),o=new VC,a=3*e.sampleSize;for(let l=0;l=e.sampleSize?n:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,z9(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=this._doUpdate().finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t)){const s=this._subscriptions.get(t);return void(s.paused&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.resume`),s.resume(),s.version=e.version,this._source.onResume(s)))}yi("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new zNe(this._tileInfoView,t),n=new _Qr(r,e.version);this._subscriptions.set(t,n),this._source.onSubscribe(n),this._processor.onSubscribe(n)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id),t.destroy())}_pauseSubscription(e){const t=this._subscriptions.get(e);t&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),t.pause())}async _doUpdate(){if(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const n=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const s of n)this._doUpdateSubscriptions(s)}const e=this._updateSchemaState;if(this._updateSchemaState=null,e!=null){const{schema:n,version:s}=e;await this._doUpdateSchema(n,s)}const t=this._editState;if(this._editState=null,t!=null){yi("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.edit);const n=await this._source.getOverride(t.edit);await this._processor.applyOverride(n),yi("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.edit)}if(this._updateHighlightRequests.length){const n=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const s of n)this._processor.updateHighlight(s)}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(yi("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),yi("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(n){l3(n)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){if(yi("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const n=fu.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new ak(n)}const r={tileInfo:this._tileInfoView?.tileInfo};try{const n=await this._source.update(e,t),s=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,n,s)}catch(n){console.error(n)}yi("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){if(yi("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const t=fu.fromJSON(e.tileInfoJSON);this._tileInfoView=new ak(t)}for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t);if(yi("featurelayer-query-pausing-enabled"))for(const t of e.pause)this._pauseSubscription(t)}};const SQr=Object.freeze(Object.defineProperty({__proto__:null,default:xQr},Symbol.toStringTag,{value:"Module"}));function kbe(){return new Float32Array(3)}function N9e(i){const e=new Float32Array(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e}function m7(i,e,t){const r=new Float32Array(3);return r[0]=i,r[1]=e,r[2]=t,r}function TQr(i,e){return new Float32Array(i,e,3)}function cVt(){return kbe()}function hVt(){return m7(1,1,1)}function dVt(){return m7(1,0,0)}function pVt(){return m7(0,1,0)}function fVt(){return m7(0,0,1)}const CQr=cVt(),EQr=hVt(),IQr=dVt(),AQr=pVt(),MQr=fVt();Object.freeze(Object.defineProperty({__proto__:null,ONES:EQr,UNIT_X:IQr,UNIT_Y:AQr,UNIT_Z:MQr,ZEROS:CQr,clone:N9e,create:kbe,createView:TQr,fromValues:m7,ones:hVt,unitX:dVt,unitY:pVt,unitZ:fVt,zeros:cVt},Symbol.toStringTag,{value:"Module"}));var $9e;let TU=$9e=class extends Ci{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new $9e({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};x([D({type:String,json:{write:!0}})],TU.prototype,"field",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],TU.prototype,"minValue",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],TU.prototype,"maxValue",void 0),TU=$9e=x([Qe("esri.renderers.support.pointCloud.ColorModulation")],TU);const OQr=TU,wPe=new Rs({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let bye=class extends Ci{};x([D({type:wPe.apiValues,readOnly:!0,nonNullable:!0,json:{type:wPe.jsonValues,read:!1,write:wPe.write}})],bye.prototype,"type",void 0),bye=x([Qe("esri.renderers.support.pointCloud.PointSizeAlgorithm")],bye);const QJe=bye;var B9e;let CU=B9e=class extends QJe{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new B9e({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};x([Wr({pointCloudFixedSizeAlgorithm:"fixed-size"})],CU.prototype,"type",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],CU.prototype,"size",void 0),x([D({type:Boolean,json:{write:!0}})],CU.prototype,"useRealWorldSymbolSizes",void 0),CU=B9e=x([Qe("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],CU);const PQr=CU;var j9e;let qee=j9e=class extends QJe{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new j9e({scaleFactor:this.scaleFactor})}};x([Wr({pointCloudSplatAlgorithm:"splat"})],qee.prototype,"type",void 0),x([D({type:Number,value:1,nonNullable:!0,json:{write:!0}})],qee.prototype,"scaleFactor",void 0),qee=j9e=x([Qe("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],qee);const RQr=qee,DQr={key:"type",base:QJe,typeMap:{"fixed-size":PQr,splat:RQr}},xPe=pa()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let mO=class extends Ci{constructor(e){super(e),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:li(this.pointSizeAlgorithm),colorModulation:li(this.colorModulation),pointsPerInch:li(this.pointsPerInch)}}};x([D({type:xPe.apiValues,readOnly:!0,nonNullable:!0,json:{type:xPe.jsonValues,read:!1,write:xPe.write}})],mO.prototype,"type",void 0),x([D({types:DQr,json:{write:!0}})],mO.prototype,"pointSizeAlgorithm",void 0),x([D({type:OQr,json:{write:!0}})],mO.prototype,"colorModulation",void 0),x([D({json:{write:!0},nonNullable:!0,type:Number})],mO.prototype,"pointsPerInch",void 0),mO=x([Qe("esri.renderers.PointCloudRenderer")],mO),function(i){i.fieldTransformTypeKebabDict=new Rs({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(mO||(mO={}));const a0=mO;var G9e;let N4=G9e=class extends Ci{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new G9e({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:li(this.color)})}};x([D({type:String,json:{write:!0}})],N4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],N4.prototype,"label",void 0),x([D({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],N4.prototype,"minValue",void 0),x([D({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],N4.prototype,"maxValue",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],N4.prototype,"color",void 0),N4=G9e=x([Qe("esri.renderers.support.pointCloud.ColorClassBreakInfo")],N4);const FQr=N4;var U9e;let $4=U9e=class extends a0{constructor(i){super(i),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new U9e({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:li(this.colorClassBreakInfos),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],$4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],$4.prototype,"field",void 0),x([D({type:UA,json:{write:!0}})],$4.prototype,"legendOptions",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],$4.prototype,"fieldTransformType",void 0),x([D({type:[FQr],json:{write:!0}})],$4.prototype,"colorClassBreakInfos",void 0),$4=U9e=x([Qe("esri.renderers.PointCloudClassBreaksRenderer")],$4);const mVt=$4;var z9e;let B4=z9e=class extends a0{constructor(i){super(i),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new z9e({...this.cloneProperties(),field:li(this.field),fieldTransformType:li(this.fieldTransformType),stops:li(this.stops),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudStretchRenderer:"point-cloud-stretch"})],B4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],B4.prototype,"field",void 0),x([D({type:UA,json:{write:!0}})],B4.prototype,"legendOptions",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],B4.prototype,"fieldTransformType",void 0),x([D({type:[U3t],json:{write:!0}})],B4.prototype,"stops",void 0),B4=z9e=x([Qe("esri.renderers.PointCloudStretchRenderer")],B4);const gVt=B4;var V9e;let C$=V9e=class extends Ci{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new V9e({description:this.description,label:this.label,values:li(this.values),color:li(this.color)})}};x([D({type:String,json:{write:!0}})],C$.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],C$.prototype,"label",void 0),x([D({type:[String],json:{write:!0}})],C$.prototype,"values",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],C$.prototype,"color",void 0),C$=V9e=x([Qe("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],C$);const kQr=C$;var H9e;let j4=H9e=class extends a0{constructor(i){super(i),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new H9e({...this.cloneProperties(),field:li(this.field),fieldTransformType:li(this.fieldTransformType),colorUniqueValueInfos:li(this.colorUniqueValueInfos),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],j4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],j4.prototype,"field",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],j4.prototype,"fieldTransformType",void 0),x([D({type:[kQr],json:{write:!0}})],j4.prototype,"colorUniqueValueInfos",void 0),x([D({type:UA,json:{write:!0}})],j4.prototype,"legendOptions",void 0),j4=H9e=x([Qe("esri.renderers.PointCloudUniqueValueRenderer")],j4);const yVt=j4,pd=!0,I8={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function eKe(i,e,t){return{identifier:String.fromCharCode.apply(null,new Uint8Array(i,t+I8.identifierOffset,I8.identifierLength)),version:e.getUint16(t+I8.versionOffset,pd),checksum:e.getUint32(t+I8.checksumOffset,pd)}}const G_={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function LQr(i,e){return{sizeLo:i.getUint32(e+G_.sizeLo,pd),sizeHi:i.getUint32(e+G_.sizeHi,pd),minX:i.getFloat64(e+G_.minX,pd),minY:i.getFloat64(e+G_.minY,pd),minZ:i.getFloat64(e+G_.minZ,pd),maxX:i.getFloat64(e+G_.maxX,pd),maxY:i.getFloat64(e+G_.maxY,pd),maxZ:i.getFloat64(e+G_.maxZ,pd),errorX:i.getFloat64(e+G_.errorX,pd),errorY:i.getFloat64(e+G_.errorY,pd),errorZ:i.getFloat64(e+G_.errorZ,pd),count:i.getUint32(e+G_.count,pd),reserved:i.getUint32(e+G_.reserved,pd)}}function NQr(i){const e=new DataView(i,0);let t=0;const{identifier:r,version:n}=eKe(i,e,t);if(t+=I8.byteCount,r!=="LEPCC ")throw new qe("lepcc-decode-error","Bad identifier");if(n>1)throw new qe("lepcc-decode-error","Unknown version");const s=LQr(e,t);if(t+=G_.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const o=new Float64Array(3*s.count),a=[],l=[],u=[],c=[];if(t=Wde(i,t,a),t=Wde(i,t,l),t=Wde(i,t,u),t=Wde(i,t,c),t!==i.byteLength)throw new qe("lepcc-decode-error","Bad length");let h=0,p=0;for(let m=0;m>6;let l=0;if(a===0)l=r.getUint32(1,pd),e+=5;else if(a===1)l=r.getUint16(1,pd),e+=3;else{if(a!==2)throw new qe("lepcc-decode-error","Bad count type");l=r.getUint8(1),e+=2}if(o)throw new qe("lepcc-decode-error","LUT not implemented");const u=Math.ceil(l*s/8),c=new Uint8Array(i,e,u);let h=0,p=0,m=0;const v=-1>>>32-s;for(let w=0;w>>=s,p-=s,p+s>32&&(h|=c[m-1]>>8-p)}return e+m}const E$={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function $Qr(i,e){return{sizeLo:i.getUint32(e+E$.sizeLo,pd),sizeHi:i.getUint32(e+E$.sizeHi,pd),count:i.getUint32(e+E$.count,pd),colorMapCount:i.getUint16(e+E$.colorMapCount,pd),lookupMethod:i.getUint8(e+E$.lookupMethod),compressionMethod:i.getUint8(e+E$.compressionMethod)}}function BQr(i){const e=new DataView(i,0);let t=0;const{identifier:r,version:n}=eKe(i,e,t);if(t+=I8.byteCount,r!=="ClusterRGB")throw new qe("lepcc-decode-error","Bad identifier");if(n>1)throw new qe("lepcc-decode-error","Unknown version");const s=$Qr(e,t);if(t+=E$.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");if((s.lookupMethod===2||s.lookupMethod===1)&&s.compressionMethod===0){if(3*s.colorMapCount+s.count+t!==i.byteLength||s.colorMapCount>256)throw new qe("lepcc-decode-error","Bad count");const o=new Uint8Array(i,t,3*s.colorMapCount),a=new Uint8Array(i,t+3*s.colorMapCount,s.count),l=new Uint8Array(3*s.count);for(let u=0;u1)throw new qe("lepcc-decode-error","Unknown version");const s=jQr(e,t);if(t+=I$.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const o=new Uint16Array(s.count);if(s.bitsPerPoint===8){if(s.count+t!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const a=new Uint8Array(i,t,s.count);for(let l=0;ldi.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function UQr(i,e,t){let r="",n=0;for(;n=192&&s<224){if(n+1>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const o=(31&s)<<6|63&i[e+n+1];r+=String.fromCharCode(o),n+=2}else if(s>=224&&s<240){if(n+2>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(15&s)<<12|(63&i[e+n+1])<<6|63&i[e+n+2];r+=String.fromCharCode(o),n+=3}else{if(!(s>=240&&s<248))throw new qe("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(n+3>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(7&s)<<18|(63&i[e+n+1])<<12|(63&i[e+n+2])<<6|63&i[e+n+3];if(o>=65536){const a=55296+(o-65536>>10),l=56320+(1023&o);r+=String.fromCharCode(a,l)}else r+=String.fromCharCode(o);n+=4}}}return r}function vVt(i,e){const t={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let n=0;n{const n=r?Date.parse(r):null;return n&&!Number.isNaN(n)?n:null})}function _Vt(i,e,t){const r=[];let n,s,o=0;for(s=0;s0){if(r.push(UQr(t,o,n-1)),t[o+n-1]!==0)throw new qe("string-array-error","Invalid string array: missing null termination.")}else r.push(null);o+=n}return r}function Y9e(i,e){return new FCe[e.valueType](i,e.byteOffset,e.count*e.valuesPerElement)}function VQr(i,e){return new Uint8Array(i,e.byteOffset,e.byteCount)}function HQr(i,e,t){const r=e.header!=null?vVt(i,e.header):{byteOffset:0,byteCount:0,fields:{count:t}},n={header:r,byteOffset:r.byteCount,byteCount:0,entries:Object.create(null)};let s=r.byteCount;for(let o=0;onew DataView(i,0).getFloat32(e,!0),Float64:(i,e)=>new DataView(i,0).getFloat64(e,!0),UInt8:(i,e)=>new DataView(i,0).getUint8(e),Int8:(i,e)=>new DataView(i,0).getInt8(e),UInt16:(i,e)=>new DataView(i,0).getUint16(e,!0),Int16:(i,e)=>new DataView(i,0).getInt16(e,!0),UInt32:(i,e)=>new DataView(i,0).getUint32(e,!0),Int32:(i,e)=>new DataView(i,0).getInt32(e,!0)};function xVt(i){return FCe.hasOwnProperty(i)}function wye(i){return xVt(i)?FCe[i].BYTES_PER_ELEMENT:0}function XQr(i,e,t,r){const{rendererJSON:n,isRGBRenderer:s}=i;let o=null,a=null;if(e&&s)o=e;else if(e&&n?.type==="pointCloudUniqueValueRenderer"){a=yVt.fromJSON(n);const l=a.colorUniqueValueInfos;o=new Uint8Array(3*r);const u=SPe(a.fieldTransformType);for(let c=0;c=l[p].value)o[3*c]=l[p].color.r,o[3*c+1]=l[p].color.g,o[3*c+2]=l[p].color.b;else for(let m=1;m=l[p].minValue&&h<=l[p].maxValue){o[3*c]=l[p].color.r,o[3*c+1]=l[p].color.g,o[3*c+2]=l[p].color.b;break}}}else o=new Uint8Array(3*r).fill(255);if(t&&a?.colorModulation){const l=a.colorModulation.minValue,u=a.colorModulation.maxValue,c=.3;for(let h=0;h=u?1:p<=l?c:c+(1-c)*(p-l)/(u-l);o[3*h]=m*o[3*h],o[3*h+1]=m*o[3*h+1],o[3*h+2]=m*o[3*h+2]}}return o}function JQr(i,e){if(i.encoding==null||i.encoding===""){const t=WQr(e,i);if(t.vertexAttributes.position==null)return;const r=Y9e(e,t.vertexAttributes.position),n=t.header.fields,s=[n.offsetX,n.offsetY,n.offsetZ],o=[n.scaleX,n.scaleY,n.scaleZ],a=r.length/3,l=new Float64Array(3*a);for(let u=0;u>>4&15,v=m>1,w=p===1,S=p===m;let I=!1;for(const R of c.includedReturns)if(R==="last"&&S||R==="firstOfMany"&&w&&v||R==="lastOfMany"&&S&&v||R==="single"&&!v){I=!0;break}I||(l=!1);break}}}l&&(t[o]=a,i[3*o]=i[3*a],i[3*o+1]=i[3*a+1],i[3*o+2]=i[3*a+2],e[3*o]=e[3*a],e[3*o+1]=e[3*a+1],e[3*o+2]=e[3*a+2],o++)}return o}function SPe(i){switch(i){default:case null:case"none":return e=>e;case"low-four-bit":return e=>15&e;case"high-four-bit":return e=>(240&e)>>4;case"absolute-value":return e=>Math.abs(e);case"modulo-ten":return e=>e%10}}function Tgt(i){let e=0;for(const t of i||[])e|=1<this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new A$(Ja)}static createVec3f64(){return new A$(gr)}static createVec4f64(){return new A$(EE)}static createMat3f64(){return new A$(Yd)}static createMat4f64(){return new A$(Pm)}static createQuatf64(){return new A$(Dm)}get test(){return{length:this._items.length}}};dX.createVec2f64();const O3=dX.createVec3f64();dX.createVec4f64();dX.createMat3f64();const een=dX.createMat4f64(),ten=dX.createQuatf64();function SVt(i=nen){return[i[0],i[1],i[2],i[3]]}function ien(i,e,t,r=SVt()){const n=t[0]-e[0],s=t[1]-e[1],o=t[2]-e[2],a=i[0]-e[0],l=i[1]-e[1],u=i[2]-e[2],c=s*u-o*l,h=o*a-n*u,p=n*l-s*a,m=c*c+h*h+p*p,v=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=c*v,r[1]=h*v,r[2]=p*v,r[3]=-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),r}function TVt(i,e,t,r=0,n=Math.floor(t*(1/3)),s=Math.floor(t*(2/3))){if(t<3)return!1;e(_K,r);let o=n,a=!1;for(;or&&(r=o,n=s)}fx(e,i.minVert[n]),fx(t,i.maxVert[n])}const g2=[0,0,0];function uen(i,e,t,r){const{data:n,size:s}=i;let o=Number.NEGATIVE_INFINITY,a=0;for(let l=0;lo&&(o=h,a=l)}return fx(r,n,a),o}const ff=Ja();function cen(i,e,t,r,n){den(i,e,ff,n,r);const s=AVt(t,e);ff[1]-Oq<=s&&(r[0]=void 0),ff[0]+Oq>=s&&(n[0]=void 0)}const Cgt=gr(),Egt=gr(),Igt=gr(),Vj=gr(),Hj=gr(),Kde=gr();function M$(i,e,t,r,n,s){if(IVt(e)t[1]&&(t[1]=l,fx(n,s,a))}}function Agt(i,e,t){t.center=i,t.halfSize=Gc(e,e,.5),t.quaternion=yle}const OM=gr(),Wj=gr(),TK=gr(),gH=gr(),yH=gr(),Mgt=gr();function pen(i,e,t){fx(OM,e),Math.abs(e[0])>Math.abs(e[1])&&Math.abs(e[0])>Math.abs(e[2])?OM[0]=0:Math.abs(e[1])>Math.abs(e[2])?OM[1]=0:OM[2]=0,IVt(OM)this.maxProj[0]&&(this.maxProj[0]=u,s[0]=l),u=o[l+1],uthis.maxProj[1]&&(this.maxProj[1]=u,s[1]=l),u=o[l+2],uthis.maxProj[2]&&(this.maxProj[2]=u,s[2]=l),u=o[l]+o[l+1]+o[l+2],uthis.maxProj[3]&&(this.maxProj[3]=u,s[3]=l),u=o[l]+o[l+1]-o[l+2],uthis.maxProj[4]&&(this.maxProj[4]=u,s[4]=l),u=o[l]-o[l+1]+o[l+2],uthis.maxProj[5]&&(this.maxProj[5]=u,s[5]=l),u=o[l]-o[l+1]-o[l+2],uthis.maxProj[6]&&(this.maxProj[6]=u,s[6]=l)}for(let l=0;l0){const r=1/Math.sqrt(t);i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r}}function IVt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function K9e(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2];return t*t+r*r+n*n}function AVt(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function yen(i,e){const t=e[0]+e[4]+e[8];if(t>0){let r=Math.sqrt(t+1);i[3]=.5*r,r=.5/r,i[0]=(e[5]-e[7])*r,i[1]=(e[6]-e[2])*r,i[2]=(e[1]-e[3])*r}else{let r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);const n=(r+1)%3,s=(r+2)%3;let o=Math.sqrt(e[3*r+r]-e[3*n+n]-e[3*s+s]+1);i[r]=.5*o,o=.5/o,i[3]=(e[3*n+s]-e[3*s+n])*o,i[n]=(e[3*n+r]+e[3*r+n])*o,i[s]=(e[3*s+r]+e[3*r+s])*o}return i}let kCe=class xye{constructor(e=Ox,t=Aen,r=yle){this._data=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3]]}clone(){const e=new xye;return e._data=this._data.slice(),e}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(e){const t=new xye;return t._data=e.slice(),t}static fromJSON(e){return new xye(e.center,e.halfSize,e.quaternion)}copy(e){this._data=e.data.slice()}get center(){return Zo(O3.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set center(e){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2]}setCenter(e,t,r){this._data[0]=e,this._data[1]=t,this._data[2]=r}get halfSize(){return Zo(O3.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(e){return e[0]=this._data[3],e[1]=this._data[4],e[2]=this._data[5],e}set halfSize(e){this._data[3]=e[0],this._data[4]=e[1],this._data[5]=e[2]}get quaternion(){return yjt(ten.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(e){return e[0]=this._data[6],e[1]=this._data[7],e[2]=this._data[8],e[3]=this._data[9],e}set quaternion(e){this._data[6]=e[0],this._data[7]=e[1],this._data[8]=e[2],this._data[9]=e[3]}get data(){return this._data}getCorners(e){const t=ih,r=this._data;t[0]=r[6],t[1]=r[7],t[2]=r[8],t[3]=r[9];for(let n=0;n<8;++n){const s=e[n];s[0]=(1&n?-1:1)*r[3],s[1]=(2&n?-1:1)*r[4],s[2]=(4&n?-1:1)*r[5],Cv(s,s,t),s[0]+=r[0],s[1]+=r[1],s[2]+=r[2]}}isVisible(e){return this.intersectPlane(e[0])<=0&&this.intersectPlane(e[1])<=0&&this.intersectPlane(e[2])<=0&&this.intersectPlane(e[3])<=0&&this.intersectPlane(e[4])<=0&&this.intersectPlane(e[5])<=0}get radius(){const e=this._data[3],t=this._data[4],r=this._data[5];return Math.sqrt(e*e+t*t+r*r)}intersectSphere(e){Oa[0]=this._data[0]-e[0],Oa[1]=this._data[1]-e[1],Oa[2]=this._data[2]-e[2];const t=this.getQuaternion(dP);return PF(ih,t),Cv(Oa,Oa,ih),oW(Oa,Oa),PM[0]=Math.min(Oa[0],this._data[3]),PM[1]=Math.min(Oa[1],this._data[4]),PM[2]=Math.min(Oa[2],this._data[5]),w5e(PM,Oa)s*s)&&(ih[0]=-r[6],ih[1]=-r[7],ih[2]=-r[8],ih[3]=r[9],Cv(Oa,Oa,ih),oW(Oa,Oa),PM[0]=Math.min(Oa[0],r[3]),PM[1]=Math.min(Oa[1],r[4]),PM[2]=Math.min(Oa[2],r[5]),w5e(PM,Oa)r?1:t<-r?-1:0}intersectRay(e,t,r=0){const n=this._data,s=ih;s[0]=-n[6],s[1]=-n[7],s[2]=-n[8],s[3]=n[9],Oa[0]=e[0]-n[0],Oa[1]=e[1]-n[1],Oa[2]=e[2]-n[2];const o=Cv(Oa,Oa,ih),a=Cv(PM,t,ih);let l=-1/0,u=1/0;const c=this.getHalfSize(vH);for(let h=0;h<3;h++){const p=o[h],m=a[h],v=c[h]+r;if(Math.abs(m)>1e-6){const w=(v-p)/m,S=(-v-p)/m;l=Math.max(l,Math.min(w,S)),u=Math.min(u,Math.max(w,S))}else if(p>v||p<-v)return!1}return l<=u}projectedArea(e,t,r,n){const s=this.getQuaternion(dP);PF(ih,s),Oa[0]=e[0]-this._data[0],Oa[1]=e[1]-this._data[1],Oa[2]=e[2]-this._data[2],Cv(Oa,Oa,ih);const o=this.getHalfSize(vH),a=Oa[0]<-o[0]?-1:Oa[0]>o[0]?1:0,l=Oa[1]<-o[1]?-1:Oa[1]>o[1]?1:0,u=Oa[2]<-o[2]?-1:Oa[2]>o[2]?1:0,c=Math.abs(a)+Math.abs(l)+Math.abs(u);if(c===0)return 1/0;const h=c===1?4:6,p=6*(a+3*l+9*u+13);$1e(IU,s),_R(IU,IU,o);const m=this.getCenter(FC);for(let S=0;S>1)-1),c3(Oa,Oa,IU),hl(nN,m,Oa),nN[3]=1,hMt(nN,nN,t);const R=1/Math.max(1e-6,nN[3]);xT[2*S]=nN[0]*R,xT[2*S+1]=nN[1]*R}const v=2*h-2;let w=xT[0]*(xT[3]-xT[v+1])+xT[v]*(xT[1]-xT[v-1]);for(let S=2;S{const i=new Int8Array(162);let e=0;const t=r=>{for(let n=0;n0?1+e/u:1,h=l>0?1+t/l:1,p=(h+c)/2,m=(h-c)/2;Gc(lw,vC,m),n.halfSize=gb(lw,lw,a,p),Gc(lw,vC,p),gb(lw,lw,a,m),KEt(bc,bc),h2e(bc,lw,bc);const v=i.getQuaternion(ven);n.center=Cv(bc,bc,v)}}else{n.center=gb(bc,o,zve,(t+e)/2);const l=Cv(bc,zve,ih);oW(l,l),n.halfSize=gb(vC,a,l,(t-e)/2)}return n}function xen(i,e,t,r,n){e.getCenter(FC),FC[2]+=n;const s=Bx(t);sy(FC,i,0,FC,s,0,1),MVt(s,e,FC,t,r)}function Sen(i,e,t,r,n){e.getCenter(FC),FC[2]+=n,MVt(i,e,FC,t,r)}function MVt(i,e,t,r,n){const s=e.getQuaternion(dP),o=$1e(IU,s),a=e.getHalfSize(vH);for(let l=0;l<8;++l){for(let u=0;u<3;++u)yA[u]=a[u]*(l&1<0&&e.filterAttributesData!=null){const c=e.filterAttributesData.filter(Ga).map(h=>{const p=qde(h,t,r),m={attributeInfo:h.attributeInfo,values:p};return s.push(m),m});n=new Uint32Array(r),r=ZQr(t,l,n,e.filterInfo,c)}for(const c of e.userAttributesData){const h=qde(c,t,r);s.push({attributeInfo:c.attributeInfo,values:h})}3*r=0;l--)t[l].isNoopProcess&&t.splice(l,1);let s=!1;for(let l=0;l1}const o=t.some(({name:l})=>Den.has(l.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:t,hasBranches:s,hasFocalFunction:o,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(e,t=!1,r=-1){this.id=r+1;const n=this._getRasterValues();let s=!0;for(let o=0;othis._readRasterValue(n,e));return this._processPixels({...e,pixelBlocks:r})}processInputBandIds(){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let t;if(e.length>1){const s=e.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=s,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,l)=>a!==l);const o=e.filter(a=>a.functionName==="ExtractBand");return o.length&&o.forEach((a,l)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[l,l,l]}),this.rawInputBandIds}const r=e[0];if(r){if(t=r.processInputBandIds(),r.isInputBandIdsSwizzled)return this.rawInputBandIds=t,t}else{t=[];const{bandCount:s}=this.sourceRasterInfos[0];for(let o=0;os!==o),this.rawInputBandIds=n,this.rawInputBandIds}getPrimaryRasters(){const e=[],t=[];return this._getPrimaryRasters(this,e,t),{rasters:e,rasterIds:t}}getWebGLProcessorDefinition(){const e=this._getWebGLParameters(),{raster:t,rasters:r}=this.functionArguments;return r&&Array.isArray(r)&&r.length?(e.rasters=r.map(n=>this._isRasterFunctionValue(n)?n.getWebGLProcessorDefinition():typeof n=="number"?{name:"Constant",parameters:{value:n},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:n},pixelType:"f32",id:-1,isNoopProcess:!1}),e.rasters.some(n=>n!=null)||(e.rasters=null)):this._isRasterFunctionValue(t)&&(e.raster=t.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const e=[];this.functionName==="Clip"&&e.push(this.functionArguments);const{raster:t,rasters:r}=this.functionArguments;if(r&&Array.isArray(r)&&r.length)r.forEach(n=>{if(this._isRasterFunctionValue(n)){const s=n.getClippingGeometries();e.push(...s)}});else if(this._isRasterFunctionValue(t)){const n=t.getClippingGeometries();e.push(...n)}return e}_getOutputPixelType(e){return this.outputPixelType==="unknown"?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_removeStatsHistColormapVAT(e){e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null}_getRasterValues(){const{rasterArgumentNames:e}=this;return e[0]==="rasters"?this.functionArguments.rasters??[]:e.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(e){const t=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(t.length===0)return r;const s=t.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&n.includes(a)?r[n.indexOf(a)]:typeof a!="number"?r[0]:void 0),o=s.find(a=>a)??r[0];return s.forEach((a,l)=>{a===void 0&&(s[l]=o)}),s}_getPrimaryRasterId(e){return e?.rasterId}_getPrimaryRasters(e,t=[],r=[]){for(let n=0;nt?n.slice(0,t):null),s&&s.length!==t&&(e.histograms=s.length>t?s.slice(0,t):null),r.BAND_COUNT&&Number(r.BAND_COUNT)!==t&&(e.keyProperties={...r,BAND_COUNT:typeof r.BAND_COUNT=="string"?String(t):t})}};x([D({json:{write:!0}})],Pp.prototype,"functionName",void 0),x([D({json:{write:!0}})],Pp.prototype,"functionArguments",void 0),x([D()],Pp.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}}),So(i=>i?.toLowerCase())],Pp.prototype,"outputPixelType",void 0),x([D({json:{write:!0}})],Pp.prototype,"mainPrimaryRasterId",void 0),x([D()],Pp.prototype,"sourceRasters",void 0),x([D({type:[W3],json:{write:!0}})],Pp.prototype,"sourceRasterInfos",void 0),x([D({json:{write:!0}})],Pp.prototype,"rasterInfo",void 0),x([D({json:{write:!0}})],Pp.prototype,"readingBufferSize",void 0),x([D({json:{write:!0}})],Pp.prototype,"id",void 0),x([D()],Pp.prototype,"isNoopProcess",void 0),x([D()],Pp.prototype,"supportsGPU",null),x([D()],Pp.prototype,"rawInputBandIds",void 0),x([D()],Pp.prototype,"rawSourceRasterInfos",void 0),x([D()],Pp.prototype,"isInputBandIdsSwizzled",void 0),x([D()],Pp.prototype,"swizzledBandSelection",void 0),x([D()],Pp.prototype,"isBranch",void 0),x([D({readOnly:!0})],Pp.prototype,"flatWebGLFunctionChain",null),x([D()],Pp.prototype,"_bindingResult",void 0),Pp=x([Qe("esri.layers.support.rasterFunctions.BaseRasterFunction")],Pp);const km=Pp,Qu={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},Fen={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},ib={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},kC={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},ken={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},OVt={setNull:50,conditional:78},Rgt={...Fen,...ib,...kC,...ken,...OVt},PVt=new Map([[kC.acos,{domain:[0,Math.PI],isInteger:!1}],[kC.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[kC.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[kC.cos,{domain:[-1,1],isInteger:!1}],[kC.sin,{domain:[-1,1],isInteger:!1}],[ib.booleanAnd,{domain:[0,1],isInteger:!0}],[ib.booleanNot,{domain:[0,1],isInteger:!0}],[ib.booleanOr,{domain:[0,1],isInteger:!0}],[ib.booleanXOr,{domain:[0,1],isInteger:!0}],[ib.equalTo,{domain:[0,1],isInteger:!0}],[ib.notEqual,{domain:[0,1],isInteger:!0}],[ib.greaterThan,{domain:[0,1],isInteger:!0}],[ib.greaterThanEqual,{domain:[0,1],isInteger:!0}],[ib.lessThan,{domain:[0,1],isInteger:!0}],[ib.lessThanEqual,{domain:[0,1],isInteger:!0}],[ib.isNull,{domain:[0,1],isInteger:!0}]]);function Dgt(i){return PVt.get(i)}const Fgt=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function Len(i,e=!1){const t=i.map(a=>a.mask),r=t.filter(a=>a!=null),n=i[0].pixels[0].length;if(r.length===0||e&&r.length!==t.length)return new Uint8Array(n).fill(255);const s=r[0],o=new Uint8Array(s);if(r.length===1)return o;if(!e){for(let a=1;a=1?e[l]=0:o[l]=Math.atanh(u)}return o}const a=r===kC.asin?Math.asin:Math.acos;for(let l=0;l1?e[l]=0:o[l]=a(u)}return o}function Wen(i,e,t,r){const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;a>n[a]);return o}function Qen(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;an[a]?1:0);return o}function dtn(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;a=n[a]?1:0);return o}function ptn(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;ac&&(l=c)}o[a]=l}return o}function $gt(i,e,t){const r=i.length;if(r<2)return i[0];const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;ah&&(l=h)}o[a]=u-l}return o}function Bgt(i,e,t){const r=i.length;if(r<2)return i[0];const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;ac&&(c=u,l=h);s[a]=l}return s}function Vgt(i,e,t){const r=i.length;if(r<=2)return DVt(i,e,t);const n=i[0].length,s=Br.createEmptyBand(t,n),o=new Map;for(let a=0;as?e[a]=0:r[a]=o?Math.round(l):l}}function FVt(i,e,t={}){btn();let r=Len(i,e>=66&&e<=75);const{outputPixelType:n="f32"}=t,s=!$d.has(e)||t.processAsMultiband,o=s?i[0].pixels.length:1,a=[];for(let u=0;um.pixels):i.map(m=>m.pixels[u]);let h,p=!0;if(e===OVt.setNull){const m=_tn(c,r,n);h=m.band,r=m.mask,p=!1}else nu.has(e)?h=nu.get(e)(c,r,"f64"):em.has(e)?h=e===kC.asin||e===kC.acos||e===kC.atanh?Hen(c,r,"f64",e):Wen(c,r,"f64",em.get(e)):Lbe.has(e)?h=qen(c,r,"f64",Lbe.get(e)):$d.has(e)?h=$d.get(e)(c,r,"f64"):(h=c[0],p=!1);if(p&&e!==ib.isNull&&!PVt.has(e)){const m=Br.createEmptyBand(n,h.length);r||(r=new Uint8Array(h.length).fill(255)),wtn(h,r,n,m),h=m}a.push(h)}const l=i[0];return new Br({width:l.width,height:l.height,pixelType:n,mask:e===ib.isNull?null:r,pixels:a})}function xtn(i,e,t){return FVt(i,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:t})}let MU=class extends km{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:e}=this.functionArguments;if(e<1||e>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:t.bandCount<=3}}_processPixels(e){const{pixelBlocks:t}=e;return t?.[0]==null||t?.[1]==null?null:xtn(t,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:e}=this.functionArguments,t=["","plus","minus","times","divide","power","mod"][e],r=this.outputPixelType??"f32";let[n,s]=Yx(r);const o=SF(r);return o&&(n-=1e-4,s+=1e-4),{imageCount:2,operationName:t,domainRange:[n,s],isOutputRounded:o}}};x([D({json:{write:!0,name:"rasterFunction"}})],MU.prototype,"functionName",void 0),x([D({type:Ren,json:{write:!0,name:"rasterFunctionArguments"}})],MU.prototype,"functionArguments",void 0),x([D()],MU.prototype,"rasterArgumentNames",void 0),MU=x([Qe("esri.layers.support.rasterFunctions.ArithmeticFunction")],MU);const Stn=MU;var Q9e;let eBe=Q9e=class extends Fm{clone(){return new Q9e({raster:this.raster})}};eBe=Q9e=x([Qe("esri.layers.support.rasterFunctions.AspectFunctionArguments")],eBe);const Ttn=eBe;let O$=class extends km{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const e=this.sourceRasterInfos[0];this.isGCS=e.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const t=e.clone();return t.pixelType=this.outputPixelType,t.statistics=[{min:-1,max:360,avg:180,stddev:30}],t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{extent:r,primaryPixelSizes:n}=e,s=n?.[0],o=s??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1});return Fcr(t,{resolution:o})}};x([D({json:{write:!0,name:"rasterFunction"}})],O$.prototype,"functionName",void 0),x([D({type:Ttn,json:{write:!0,name:"rasterFunctionArguments"}})],O$.prototype,"functionArguments",void 0),x([D()],O$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],O$.prototype,"isGCS",void 0),O$=x([Qe("esri.layers.support.rasterFunctions.AspectFunction")],O$);const Ctn=O$,Etn=new Set(["+","-","*","/","(",")"]);function Itn(i,e){(i=i.replaceAll(" ","")).startsWith("-")&&(i="0"+i),i.startsWith("+")&&(i=i.slice(1,i.length));const t=i.split(""),r=[],n=[];let s="";for(let o=0;o-1)t>0&&(n+=e+1);else{for(let o=0;o0&&(n+=e+1)}let s=0;for(let o=0;o0;){const{numIndex:o,opIndex:a}=Otn(n);if(r=Atn(i,n[a],s[o],s[o+1]),n.length===1)break;n=Mtn(n,a),s.splice(o,2,r)}return[r]}const Rtn=new Rs({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Dtn(i,e){if(!bh(i))return i;const{equation:t,method:r}=e,n=e.bandIndexes.map(c=>c-1),{pixels:s,mask:o}=i;let a;switch(r){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=qgt(o,s[n[0]],s[n[1]]);break;case"ndwi":a=qgt(o,s[n[1]],s[n[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=ktn(o,s[n[0]],s[n[1]]);break;case"ci-g":case"ci-re":a=Ltn(o,s[n[0]],s[n[1]]);break;case"savi":a=Ntn(o,s[n[0]],s[n[1]],n[2]+1);break;case"tsavi":a=$tn(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1,n[4]+1);break;case"msavi":a=Btn(o,s[n[0]],s[n[1]]);break;case"gemi":a=jtn(o,s[n[0]],s[n[1]]);break;case"pvi":a=Gtn(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1);break;case"gvitm":a=Utn(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"sultan":a=ztn(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]]]);break;case"vari":a=Vtn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"mtvi2":a=Htn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"rtvi-core":a=Wtn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"evi":a=qtn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"wndwi":a=Ytn(o,[s[n[0]],s[n[1]],s[n[2]]],n[3]?n[3]+1:.5);break;case"bai":a=Xtn(o,s[n[0]],s[n[1]]);break;case"custom":a=Ptn(o,s,t);break;default:return i}const l=o!=null?new Uint8Array(o.length):null;o!=null&&l!=null&&l.set(o);const u=new Br({width:i.width,height:i.height,pixelType:"f32",pixels:a,mask:l});return u.updateStatistics(),u}function Ftn(i,e,t,r){const{mask:n,pixels:s,width:o,height:a}=i,l=s[t],u=s[e],c=u.length,h=r?new Uint8Array(c):new Float32Array(c),p=r?100:1,m=r?100.5:0;for(let w=0;wparseFloat(o));return Dtn(t,{method:r,bandIndexes:s,equation:n})}_getWebGLParameters(){const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);e.length===2&&e.push(0);const t=this.isInputBandIdsSwizzled?[0,1,2]:e;let r,n;const s=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":r=Hg([t[0],t[1],0]),n="ndxi";break;case"ndwi":r=Hg([t[1],t[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=Hg([t[0],t[1],0]),n="sr";break;case"ci-g":case"ci-re":r=Hg([t[0],t[1],0]),n="ci";break;case"savi":r=Hg([t[0],t[1],0]),n="savi",s[0]=e[2]+1;break;case"tsavi":r=Hg([t[0],t[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":r=Hg([t[0],t[1],0]),n="msavi";break;case"gemi":r=Hg([t[0],t[1],0]),n="gemi";break;case"pvi":r=Hg([t[0],t[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":r=Hg([t[0],t[1],t[2]]),n="vari";break;case"mtvi2":r=Hg([t[0],t[1],t[2]]),n="mtvi";break;case"rtvi-core":r=Hg([t[0],t[1],t[2]]),n="rtvicore";break;case"evi":r=Hg([t[0],t[1],t[2]]),n="evi";break;case"wndwi":r=Hg([t[0],t[1],0]),n="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":r=Hg([t[1],t[0],0]),n="bai";break;default:r=Hg([0,1,2]),n="custom"}return{bandIndexMat3:r,indexType:n,adjustments:s}}_getInputBandIds(e){if(this.functionArguments.method==="custom")return e;const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),r=e.length,n=t.map(a=>a>=r?r-1:a),s=Ktn.has(this.functionArguments.method)?3:2,o=n.slice(0,s).map(a=>e[a]);return o.length===2&&o.push(0),o}};x([D({json:{write:!0,name:"rasterFunction"}})],OU.prototype,"functionName",void 0),x([D({type:Jtn,json:{write:!0,name:"rasterFunctionArguments"}})],OU.prototype,"functionArguments",void 0),x([D()],OU.prototype,"rasterArgumentNames",void 0),OU=x([Qe("esri.layers.support.rasterFunctions.BandArithmeticFunction")],OU);const Ztn=OU;var iBe;const Ygt=new Rs({1:"outside",2:"inside"},{useNumericKeys:!0});let Jee=iBe=class extends Fm{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new iBe({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};x([D({types:Ff,json:{read:Ro,write:!0}})],Jee.prototype,"clippingGeometry",void 0),x([D({json:{read:Ygt.read,write:Ygt.write}})],Jee.prototype,"clippingType",void 0),Jee=iBe=x([Qe("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Jee);const Qtn=Jee;let P$=class extends km{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:e,clippingType:t}=this.functionArguments;return{clippingGeometry:e.toJSON(),clippingType:t}}};x([D({json:{write:!0,name:"rasterFunction"}})],P$.prototype,"functionName",void 0),x([D({type:Qtn,json:{write:!0,name:"rasterFunctionArguments"}})],P$.prototype,"functionArguments",void 0),x([D()],P$.prototype,"rasterArgumentNames",void 0),x([D()],P$.prototype,"isNoopProcess",void 0),P$=x([Qe("esri.layers.support.rasterFunctions.ClipFunction")],P$);const ein=P$;var rBe;let RI=rBe=class extends Fm{castColormapName(i){if(!i)return null;const e=i.toLowerCase();return jar.includes(e)?e:null}readColorRamp(i){return F2e(i)}readColorRampName(i,e){if(!i)return null;const t=UV.jsonValues.find(r=>r.toLowerCase()===i.toLowerCase());return t?UV.fromJSON(t):null}clone(){return new rBe({colormap:li(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};x([D({type:[[Number]],json:{write:!0}})],RI.prototype,"colormap",void 0),x([D({type:String,json:{write:!0}})],RI.prototype,"colormapName",void 0),x([So("colormapName")],RI.prototype,"castColormapName",null),x([D({types:D2e,json:{write:!0}})],RI.prototype,"colorRamp",void 0),x([Mi("colorRamp")],RI.prototype,"readColorRamp",null),x([D({type:UV.apiValues,json:{type:UV.jsonValues,write:UV.write}})],RI.prototype,"colorRampName",void 0),x([Mi("colorRampName")],RI.prototype,"readColorRampName",null),RI=rBe=x([Qe("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],RI);const tin=RI,iin=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],rin=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function nKe(i,e){const t=[],r=[];for(let s=0;s[r,...t]),e):null}let G4=class extends km{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:t,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!t?.length)if(n)t=tk(n,{interpolateAlpha:!0});else if(s){const l=zar(s);l&&(t=tk(l))}else r&&(t=uin(r));if(!t?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(e.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const a=e.clone();return a.pixelType=this.outputPixelType,a.colormap=t,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return!t||SF(t.pixelType)||(t=t.clone(),t.clamp(this.outputPixelType)),t}};x([D({json:{write:!0,name:"rasterFunction"}})],G4.prototype,"functionName",void 0),x([D({type:tin,json:{write:!0,name:"rasterFunctionArguments"}})],G4.prototype,"functionArguments",void 0),x([D()],G4.prototype,"rasterArgumentNames",void 0),x([D()],G4.prototype,"isNoopProcess",void 0),x([D({json:{write:!0}})],G4.prototype,"indexedColormap",void 0),G4=x([Qe("esri.layers.support.rasterFunctions.ColormapFunction")],G4);const cin=G4;var nBe;let Kee=nBe=class extends Fm{constructor(){super(...arguments),this.rasters=[]}writeRasters(i,e){e.rasters=i.map(t=>typeof t=="number"||typeof t=="string"?t:t.toJSON())}clone(){return new nBe({rasters:li(this.rasters)})}};x([D({json:{write:!0}})],Kee.prototype,"rasters",void 0),x([ur("rasters")],Kee.prototype,"writeRasters",null),Kee=nBe=x([Qe("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Kee);const hin=Kee;let PU=class extends km{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);const r=t.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:s})=>s).reduce((s,o)=>s+o),e.every(({statistics:s})=>s!=null&&s.length)){const s=[];e.forEach(({statistics:o})=>o!=null&&s.push(...o)),r.statistics=s}if(e.every(({histograms:s})=>s!=null&&s.length)){const s=[];e.forEach(({histograms:o})=>o!=null&&s.push(...o)),r.histograms=s}r.bandCount>1&&(r.colormap=null,r.attributeTable=null);const n=e.every(s=>s.keyProperties.BandProperties?.length)?e.flatMap(s=>s.keyProperties.BandProperties):void 0;return r.keyProperties={...r.keyProperties,BandProperties:n},this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){const{pixelBlocks:t}=e;return t?t?.[0]==null?null:alr(t):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};x([D({json:{write:!0,name:"rasterFunction"}})],PU.prototype,"functionName",void 0),x([D({type:hin,json:{write:!0,name:"rasterFunctionArguments"}})],PU.prototype,"functionArguments",void 0),x([D()],PU.prototype,"rasterArgumentNames",void 0),PU=x([Qe("esri.layers.support.rasterFunctions.CompositeBandFunction")],PU);const din=PU;var sBe;let Zee=sBe=class extends Fm{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new sBe({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};x([D({json:{write:!0}})],Zee.prototype,"contrastOffset",void 0),x([D({json:{write:!0}})],Zee.prototype,"brightnessOffset",void 0),Zee=sBe=x([Qe("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Zee);const pin=Zee;let R$=class extends km{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0];if(t.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const r=t.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;const{contrastOffset:n,brightnessOffset:s}=this.functionArguments;return this.lookup=QRt(n,s),{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];return t==null?null:Vne(t,{lut:t.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:e,brightnessOffset:t}=this.functionArguments;return{contrastOffset:e,brightnessOffset:t}}};x([D({json:{write:!0,name:"rasterFunction"}})],R$.prototype,"functionName",void 0),x([D({type:pin,json:{write:!0,name:"rasterFunctionArguments"}})],R$.prototype,"functionArguments",void 0),x([D()],R$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],R$.prototype,"lookup",void 0),R$=x([Qe("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],R$);const fin=R$;function sKe(i,e,t,r,n){const s=Math.floor(r/2);for(let a=0;an+s);return t===-1||r===0||r===1?e:e.map(n=>n/r)}_bindSourceRasters(){const{convolutionType:e,rows:t,cols:r,kernel:n}=this.functionArguments;if(!Object.values(Qu).includes(e))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${e}`};if(e!==Qu.none&&t*r!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);const o=s.clone();o.pixelType=this.outputPixelType;const a=[Qu.none,Qu.sharpen,Qu.sharpen2,Qu.sharpening3x3,Qu.sharpening5x5];return(e===-1||this.outputPixelType!=="u8"&&!a.includes(e))&&(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:n.length<=Jgt}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null||this.functionArguments.convolutionType===Qu.none)return t;const{rows:r,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;return _in(t,{kernel:s,rows:r,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const e=new Float32Array(Jgt);return e.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:e,clampRange:Yx(this.outputPixelType)}}};x([D({json:{write:!0,name:"rasterFunction"}})],F$.prototype,"functionName",void 0),x([D({type:bin,json:{write:!0,name:"rasterFunctionArguments"}})],F$.prototype,"functionArguments",void 0),x([D()],F$.prototype,"rasterArgumentNames",void 0),x([D()],F$.prototype,"_normalizedKernel",null),F$=x([Qe("esri.layers.support.rasterFunctions.ConvolutionFunction")],F$);const win=F$;var aBe;const kVt=new Rs({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let RU=aBe=class extends Fm{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(i,e){return kVt.fromJSON(e.type??e.curvatureType??0)}clone(){return new aBe({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};x([D({json:{write:{target:"type"}}}),Wr(kVt)],RU.prototype,"curvatureType",void 0),x([Mi("curvatureType",["type","curvatureType"])],RU.prototype,"readCurvatureType",null),x([D({type:Number,json:{write:!0}})],RU.prototype,"zFactor",void 0),RU=aBe=x([Qe("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],RU);const xin=RU;let k$=class extends km{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{zFactor:r,curvatureType:n}=this.functionArguments,{extent:s,primaryPixelSizes:o}=e,a=o?.[0],l=a??(s?{x:s.width/t.width,y:s.height/t.height}:{x:1,y:1}),u=this.isGCS&&r>=1?r*yP:r;return kcr(t,{zFactor:u,curvatureType:n,resolution:l})}_getWebGLParameters(){const{zFactor:e,curvatureType:t}=this.functionArguments;return{curvatureType:t,zFactor:this.isGCS&&e>=1?e*yP:e}}};x([D({json:{write:!0,name:"rasterFunction"}})],k$.prototype,"functionName",void 0),x([D({type:xin,json:{write:!0,name:"rasterFunctionArguments"}})],k$.prototype,"functionArguments",void 0),x([D()],k$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],k$.prototype,"isGCS",void 0),k$=x([Qe("esri.layers.support.rasterFunctions.CurvatureFunction")],k$);const Sin=k$;var lBe;let gO=lBe=class extends Fm{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=x1e.bestMatch}clone(){return new lBe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};x([D({json:{write:!0}})],gO.prototype,"bandIds",void 0),x([D({json:{write:!0}})],gO.prototype,"bandNames",void 0),x([D({json:{write:!0}})],gO.prototype,"bandWavelengths",void 0),x([Wr({0:"name",1:"wavelength",2:"id"})],gO.prototype,"method",void 0),x([D({json:{write:!0}})],gO.prototype,"missingBandAction",void 0),x([D({json:{write:!0}})],gO.prototype,"wavelengthMatchTolerance",void 0),gO=lBe=x([Qe("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],gO);const Tin=gO;let DU=class extends km{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:e,sourceRasterInfos:t}=this,r=t[0],{method:n,bandNames:s,bandWavelengths:o,bandIds:a,missingBandAction:l}=e,u=s?.length&&(n==="name"||n!=="id"&&!a?.length),c=o?.length&&(n==="wavelength"||n!=="id"&&!a?.length),h=l===x1e.fail,p=u?this._matchBandNames(r,s):c?this._matchBandWavelengths(r,o,h):this._matchBandIds(r,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":c?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const m=r.clone();m.pixelType=this.outputPixelType,m.bandCount=p.length;const{statistics:v,histograms:w}=m;v!=null&&v.length&&(m.statistics=p.map(I=>v[I]||v[v.length-1])),w!=null&&w.length&&(m.histograms=p.map(I=>w[I]||w[w.length-1]));let S=m.keyProperties?.BandProperties;return S?.length&&(S=p.map(I=>I>=S.length?S[S.length-1]:S[I]),m.keyProperties={...m.keyProperties,BandProperties:S}),this.rasterInfo=m,{success:!0,supportsGPU:m.bandCount<=3}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const r=t.pixels.length,n=this.functionArguments.bandIds.map(s=>s>=r?r-1:s);return t.extractBands(n)}_getWebGLParameters(){let e;if(this.isInputBandIdsSwizzled)e=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{e=[...this.functionArguments.bandIds],e.length===0?e=[0,1,2]:e.length<3&&(e[1]=e[1]??e[0],e[2]=e[2]??e[1]);for(let t=0;t<3;t++)e[t]=Math.min(e[t],2)}return{bandIndexMat3:Hg(e)}}_getInputBandIds(e){const t=e.length;return this.functionArguments.bandIds.map(r=>r>=t?t-1:r).map(r=>e[r])}_matchBandNames(e,t){const r=e.bandInfos.map(({name:s})=>s.toLowerCase()),n=[];for(let s=0;sl.startsWith("nearinfrared_1")),a===-1&&(a=r.findIndex(l=>l.startsWith("nearinfrared")))),a===-1)return null;n.push(a)}return n}_matchBandIds(e,t,r){const{bandCount:n}=e;return!t?.length||r&&t.some(s=>s<0||s>=n)?null:t}_matchBandWavelengths(e,t,r){const{bandInfos:n}=e,s=[];for(let l=0;l=v.minWavelength&&u<=v.maxWavelength,S=Math.abs(u-(v.minWavelength+v.maxWavelength)/2);w?Sv?v:kr+n);return e.map(r=>r/t)}_bindSourceRasters(){const{conversionParameters:e}=this.functionArguments;if(!e?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType;const r=e.length===3||t.bandCount===3&&e.length>3;return t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:r}}_processPixels(e){const t=e.pixelBlocks?.[0];return t==null?null:Ein(t,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};x([D({json:{write:!0,name:"rasterFunction"}})],L$.prototype,"functionName",void 0),x([D({type:Iin,json:{write:!0,name:"rasterFunctionArguments"}})],L$.prototype,"functionArguments",void 0),x([D()],L$.prototype,"rasterArgumentNames",void 0),x([D()],L$.prototype,"_normalizedWeights",null),L$=x([Qe("esri.layers.support.rasterFunctions.GrayscaleFunction")],L$);const Ain=L$;var cBe;let N$=cBe=class extends Fm{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(i,e){e.rasters=i.map(t=>typeof t=="number"||typeof t=="string"?t:t.toJSON())}clone(){return new cBe({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:li(this.rasters)})}};x([D({json:{write:!0}})],N$.prototype,"operation",void 0),x([D({json:{write:!0}})],N$.prototype,"rasters",void 0),x([ur("rasters")],N$.prototype,"writeRasters",null),x([D({json:{write:!0}})],N$.prototype,"processAsMultiband",void 0),N$=cBe=x([Qe("esri.layers.support.rasterFunctions.LocalFunctionArguments")],N$);const Min=N$;let FU=class extends km{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0],{bandCount:r}=t,{processAsMultiband:n}=this.functionArguments;if(e.some(u=>u.bandCount!==r))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:s,rasters:o}=this.functionArguments,a=Fgt[s];if(!(a===999||o.length===a||o.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const l=t.clone();return l.bandCount=a!==999||n?r:1,this._removeStatsHistColormapVAT(l),this._updateStatistics(l),this._updatePixelType(l),this.rasterInfo=l,{success:!0,supportsGPU:l.bandCount===1&&a<=3&&(s<11||s>16)}}_processPixels(e){const{pixelBlocks:t}=e;return t==null||t.some(r=>r==null)?null:FVt(t,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:e}=this.functionArguments,t=Fgt[e],r=Object.keys(Rgt).find(l=>Rgt[l]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32";let[s,o]=Yx(n);const a=SF(n);return a&&(s-=1e-4,o+=1e-4),{imageCount:t,operationName:r,domainRange:[s,o],isOutputRounded:a}}_updateStatistics(e){const t=this.sourceRasterInfos[0],{operation:r}=this.functionArguments,n=Dgt(r)?.domain;if(n){e.statistics=[];for(let s=0;s({min:-s.max,max:-s.min,avg:s.avg!=null?-s.avg:void 0,stddev:s.stddev!=null?-s.stddev:void 0})))}_updatePixelType(e){const{statistics:t,pixelType:r}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:s,isInteger:o}=Dgt(n)??{domain:null,isInteger:!1};let a="f32";if(s&&o)a=Gme(s[0],s[1]);else if(n===30){const l=t?.[0];a=l?Gme(l.min,l.max):SF(r)?r:"s32"}else if(n===45&&SF(r)){const l=t?.map(({max:p})=>-p),u=t?.map(({min:p})=>-p),c=l?.length?Math.min(...l):null,h=u?.length?Math.min(...u):null;a=c!=null&&h!=null?Gme(c,h):r.startsWith("s")?r.replace("s","u"):r==="u1"||r==="u2"||r==="u4"?"s8":r==="u8"?"s16":"s32"}e.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};x([D({json:{write:!0,name:"rasterFunction"}})],FU.prototype,"functionName",void 0),x([D({type:Min,json:{write:!0,name:"rasterFunctionArguments"}})],FU.prototype,"functionArguments",void 0),x([D()],FU.prototype,"rasterArgumentNames",void 0),FU=x([Qe("esri.layers.support.rasterFunctions.LocalFunction")],FU);const Oin=FU;var hBe;let $$=hBe=class extends Fm{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=w1e.matchAny}get normalizedNoDataValues(){const{noDataValues:i}=this;if(!i?.length)return null;let e=!1;const t=i.map(r=>{if(typeof r=="number")return e=!0,[r];if(typeof r=="string"){const n=r.trim().split(" ").filter(s=>s.trim()!=="").map(s=>Number(s));return e=e||n.length>0,n.length===0?null:n}return null});return e?t:null}clone(){return new hBe({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};x([D({json:{write:!0}})],$$.prototype,"includedRanges",void 0),x([D({json:{write:!0}})],$$.prototype,"noDataValues",void 0),x([D()],$$.prototype,"normalizedNoDataValues",null),x([D({json:{write:!0}})],$$.prototype,"noDataInterpretation",void 0),$$=hBe=x([Qe("esri.layers.support.rasterFunctions.MaskFunctionArguments")],$$);const Pin=$$;let B$=class extends km{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,this.rasterInfo=e;const{includedRanges:r,normalizedNoDataValues:n}=this.functionArguments;if(!r?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let s=[];for(let a=0;aa?.length===n[0]?.length);return{success:!0,supportsGPU:(!r||r.length<=2*uP)&&(!n||o&&n[0].length<=uP)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:o,normalizedNoDataValues:a}=this.functionArguments,l=o===w1e.matchAll;return clr(t,{includedRanges:s,noDataValues:a,outputPixelType:r,matchAll:l,lookups:n})}_getWebGLParameters(){const{includedRanges:e,normalizedNoDataValues:t}=this.functionArguments,r=new Float32Array(uP);r.fill(bF),t?.[0]?.length&&r.set(t[0]);const n=new Float32Array(uP);for(let s=0;s=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const o=n.clone();o.pixelType=this.outputPixelType,o.colormap=null,o.histograms=null,o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[a,l,u,c]=e?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:a,max:l,avg:u,stddev:c}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{visibleBandID:r,infraredBandID:n,scientificOutput:s}=this.functionArguments;return Ftn(t,r,n,!s)}_getWebGLParameters(){const{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this.functionArguments,n=this.isInputBandIdsSwizzled?[0,1,2]:[t,e,0];return{bandIndexMat3:Hg(n),scaled:!r}}_getInputBandIds(e){const{visibleBandID:t,infraredBandID:r}=this.functionArguments;return[r,t,0].map(n=>e[n])}};x([D({json:{write:!0,name:"rasterFunction"}})],LU.prototype,"functionName",void 0),x([D({type:Din,json:{write:!0,name:"rasterFunctionArguments"}})],LU.prototype,"functionArguments",void 0),x([D()],LU.prototype,"rasterArgumentNames",void 0),LU=x([Qe("esri.layers.support.rasterFunctions.NDVIFunction")],LU);const Fin=LU;var pBe;let U4=pBe=class extends Fm{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new pBe({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};x([D({json:{write:!0}})],U4.prototype,"inputRanges",void 0),x([D({json:{write:!0}})],U4.prototype,"outputValues",void 0),x([D({json:{write:!0}})],U4.prototype,"noDataRanges",void 0),x([D({json:{write:!0}})],U4.prototype,"allowUnmatched",void 0),x([D({json:{write:!0}})],U4.prototype,"isLastInputRangeInclusive",void 0),U4=pBe=x([Qe("esri.layers.support.rasterFunctions.RemapFunctionArguments")],U4);const kin=U4;let j$=class extends km{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,e.colormap=null,e.histograms=null,e.bandCount=1,e.attributeTable=null;const{statistics:r}=e,{allowUnmatched:n,outputValues:s,inputRanges:o,noDataRanges:a,isLastInputRangeInclusive:l}=this.functionArguments;if(r!=null&&r.length&&s?.length)if(n){const u=Math.min.apply(null,[...s,r[0].min]),c=Math.max.apply(null,[...s,r[0].max]);e.statistics=[{...r[0],min:u,max:c}]}else{let u=s[0],c=u;for(let h=0;hs[h]?s[h]:u,c=c>s[h]?c:s[h];e.statistics=[{...r[0],min:u,max:c}]}return this.rasterInfo=e,this.lookup=n?null:hlr({srcPixelType:t,inputRanges:o,outputValues:s,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!s||s.length<=uP)&&(!a||a.length<=uP)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{lookup:r,outputPixelType:n}=this;if(r){const c=Vne(t,{lut:[r.lut],offset:r.offset,outputPixelType:n});return c!=null&&r.mask&&(c.mask=hHe(t.pixels[0],t.mask,r.mask,r.offset,"u8")),c}const{inputRanges:s,outputValues:o,noDataRanges:a,allowUnmatched:l,isLastInputRangeInclusive:u}=this.functionArguments;return ulr(t,{inputRanges:s,outputValues:o,noDataRanges:a,outputPixelType:n,allowUnmatched:l,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:e,noDataRanges:t,isLastInputRangeInclusive:r}=this.functionArguments,n=new Float32Array(3*uP),s=1e-5,o=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],l=a.length;for(let c=0;c0&&(n[3*c]-=s),(c=1?e*yP:e,slopeType:t,pixelSizeFactor:r??0,pixelSizePower:n??0}}};x([D({json:{write:!0,name:"rasterFunction"}})],G$.prototype,"functionName",void 0),x([D({type:$in,json:{write:!0,name:"rasterFunctionArguments"}})],G$.prototype,"functionArguments",void 0),x([D()],G$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],G$.prototype,"isGCS",void 0),G$=x([Qe("esri.layers.support.rasterFunctions.SlopeFunction")],G$);const Bin=G$,Kgt=new Rs({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function jin(i,e){const{fillNoDataOnly:t}=e,{band:r,width:n,height:s,mask:o,outBand:a}=i;if(t&&!o)return void a.set(r);const{statisticsType:l,kernelRows:u,kernelCols:c}=e,h=l==="stddev",p=n*s,m=new Float64Array(p),v=new Float64Array(p),w=new Uint32Array(p);for(let $=0;$R-L),o?(p[w+S]=I[Math.floor((I.length-1)/2)],m[w+S]=I.length):a[w+S]=I[Math.floor((I.length-1)/2)])}}if(o)for(let v=c;v$&&($=B,k=V);o?(v[I+R]=k,w[I+R]=L.size):a[I+R]=k}}if(o)for(let S=c;S1&&a?.length&&(R=Br.combineBandMasks(a));const L=new Br({pixelType:S,width:s,height:o,pixels:h,bandMasks:a&&I.length?I:null,mask:R});return L.updateStatistics(),L}var mBe;let U$=mBe=class extends Fm{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new mBe({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:li(this.raster)})}};x([D({json:{write:!0,read:{source:["kernelRows","rows"],reader:(i,e)=>Number(i??e?.kernelRows??3)}}})],U$.prototype,"rows",void 0),x([D({json:{write:!0,read:{source:["kernelCols","cols"],reader:(i,e)=>Number(i??e?.kernelCols??3)}}})],U$.prototype,"cols",void 0),x([D({json:{write:!0}})],U$.prototype,"fillNoDataOnly",void 0),x([D({json:{read:{source:["statisticsType","type"],reader:(i,e)=>Kgt.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),Wr(Kgt)],U$.prototype,"statisticsType",void 0),U$=mBe=x([Qe("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],U$);const Hin=U$;let NU=class extends km{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:e}=this.functionArguments.toJSON();if(e<1||e>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${e}`};const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);const r=t.clone();r.pixelType=this.outputPixelType;const{statisticsType:n}=this.functionArguments;return n==="stddev"&&this._removeStatsHistColormapVAT(r),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3&&e<5}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return t;const{statisticsType:r,rows:n,cols:s,fillNoDataOnly:o}=this.functionArguments;return Vin(t,{kernelRows:n,kernelCols:s,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:r,mirrorEdges:!0})}_getWebGLParameters(){const{rows:e,cols:t,statisticsType:r,fillNoDataOnly:n}=this.functionArguments;return{fillNoDataOnly:n,kernelRows:e,kernelCols:t,statisticsType:r,clampRange:Yx(this.outputPixelType)}}};x([D({json:{write:!0,name:"rasterFunction"}})],NU.prototype,"functionName",void 0),x([D({type:Hin,json:{write:!0,name:"rasterFunctionArguments"}})],NU.prototype,"functionArguments",void 0),x([D()],NU.prototype,"rasterArgumentNames",void 0),NU=x([Qe("esri.layers.support.rasterFunctions.StatisticsFunction")],NU);const Win=NU;var gBe;let z$=gBe=class extends Fm{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(i,e){if(!i?.length)return null;const t=[];return i.forEach(r=>{const n={min:r.min,max:r.max,avg:r.avg??r.mean,stddev:r.stddev??r.standardDeviation};t.push(n)}),t}writeStatistics(i,e,t){if(!i?.length)return;const r=[];i.forEach(n=>{const s={...n,mean:n.avg,standardDeviation:n.stddev};delete s.avg,delete s.stddev,r.push(s)}),e[t]=r}clone(){return new gBe({statistics:li(this.statistics),histograms:li(this.histograms)})}};x([D({json:{write:!0}})],z$.prototype,"statistics",void 0),x([Mi("statistics")],z$.prototype,"readStatistics",null),x([ur("statistics")],z$.prototype,"writeStatistics",null),x([D({json:{write:!0}})],z$.prototype,"histograms",void 0),z$=gBe=x([Qe("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],z$);const qin=z$;let V4=class extends km{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const t=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(t.histograms=n),r&&(t.statistics=r),this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};x([D({json:{write:!0,name:"rasterFunction"}})],V4.prototype,"functionName",void 0),x([D({type:qin,json:{write:!0,name:"rasterFunctionArguments"}})],V4.prototype,"functionArguments",void 0),x([D()],V4.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],V4.prototype,"indexedColormap",void 0),x([D()],V4.prototype,"isNoopProcess",void 0),V4=x([Qe("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],V4);const Yin=V4;var yBe;const Xin=new Rs({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let Ay=yBe=class extends Fm{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(i,e,t){i?.length&&(Array.isArray(i[0])||(i=i.map(r=>[r.min,r.max,r.avg,r.stddev])),e[t]=i)}clone(){return new yBe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:li(this.statistics),gamma:li(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:li(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};x([D({type:Boolean,json:{write:!0}})],Ay.prototype,"computeGamma",void 0),x([D({type:Boolean,json:{name:"dra",write:!0}})],Ay.prototype,"dynamicRangeAdjustment",void 0),x([D({type:[Number],json:{write:!0}})],Ay.prototype,"gamma",void 0),x([D()],Ay.prototype,"histograms",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"maxPercent",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"minPercent",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"numberOfStandardDeviations",void 0),x([D({type:Number,json:{name:"max",write:!0}})],Ay.prototype,"outputMax",void 0),x([D({type:Number,json:{name:"min",write:!0}})],Ay.prototype,"outputMin",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"sigmoidStrengthLevel",void 0),x([D({json:{type:[[Number]],write:!0}})],Ay.prototype,"statistics",void 0),x([ur("statistics")],Ay.prototype,"writeStatistics",null),x([Wr(Xin)],Ay.prototype,"stretchType",void 0),x([D({type:Boolean,json:{write:!0}})],Ay.prototype,"useGamma",void 0),Ay=yBe=x([Qe("esri.layers.support.rasterFunctions.StretchFunctionArguments")],Ay);const Jin=Ay;let H4=class extends km{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const e=this.sourceRasterInfos[0],{pixelType:t}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:o}=r;if(!n&&["u8","u16","s8","s16"].includes(t)){const l=$5(r.toJSON(),{rasterInfo:e}),u=SF(this.outputPixelType)?"round":"float";this.lookup=ZLe({pixelType:t,...l,gamma:o?s:null,rounding:u}),this.cutOffs=l}else n||(this.cutOffs=$5(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(t);const a=e.clone();return a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed"),this.rasterInfo=a,{success:!0,supportsGPU:!n}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return t;const{lookup:r}=this;if(r)return Vne(t,{...r,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:n}=this,s=this.cutOffs||$5(n.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:t}),o=n.useGamma?n.gamma:null;return Hme(t,{...s,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:e=0,outputMax:t=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,o=n&&r?.length?IHe(s,r):[1,1,1],{minCutOff:a,maxCutOff:l}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],l[1]=l[2]=l[0]);const u=new Float32Array(s);let c;for(c=0;c1||e.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:t}=this.functionArguments;if(!t)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(e.pixelType);const r=e.clone();return r.pixelType=this.outputPixelType,r.bandCount=1,r.dataType!=="thematic"&&(r.keyProperties=r.keyProperties?{...r.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=r,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};x([D({json:{write:!0,name:"rasterFunction"}})],V$.prototype,"functionName",void 0),x([D({type:Zin,json:{write:!0,name:"rasterFunctionArguments"}})],V$.prototype,"functionArguments",void 0),x([D()],V$.prototype,"rasterArgumentNames",void 0),x([D()],V$.prototype,"isNoopProcess",void 0),V$=x([Qe("esri.layers.support.rasterFunctions.TableFunction")],V$);const Qin=V$,Lp=new Map;function LVt(i,e){const{rasterFunctionArguments:t}=i;t&&(t.rasters||[t.raster]).forEach(r=>{r&&typeof r!="number"&&(typeof r=="string"?r.startsWith("http")&&(e.includes(r)||e.push(r)):"rasterFunctionArguments"in r&&LVt(r,e))})}function oKe(i,e){if(e=e??{},"function"in(i=li(i))&&"arguments"in i&&i.arguments){const t=BVt(i,new Map,e);if(wBe(t),!t.renderingRule)throw new qe("raster-function-helper","Unsupported raster function json.");i=t.renderingRule}if("rasterFunction"in i)return NVt(i=_Be(i),e);throw new qe("raster-function-helper","unsupported raster function json.")}function ern(i,e){return e[0]==="rasters"&&Array.isArray(i.rasters)?i.rasters:e.map(t=>i[t])}function Zgt(i){return!!(i&&typeof i=="object"&&i.rasterFunction&&i.rasterFunctionArguments)}function _Be(i){const{rasterFunction:e,rasterFunctionArguments:t}=i,r={};for(const n in t){let s=t[n];const o=n.toLowerCase();if(o==="rasters"&&Array.isArray(s))r.rasters=s.map(a=>Zgt(a)?_Be(a):a);else switch(Zgt(s)&&(s=_Be(s)),o){case"dra":r.dra=s;break;case"pspower":r.psPower=s;break;case"pszfactor":r.psZFactor=s;break;case"bandids":r.bandIds=s;break;default:r[n[0].toLowerCase()+n.slice(1)]=s}}return e!=="Local"||r.rasters?.length||(r.rasters=["$$"]),{...i,rasterFunctionArguments:r}}function NVt(i,e){const{rasterFunction:t,rasterFunctionArguments:r}=i,n=i.outputPixelType?.toLowerCase();if(t==null||!Lp.has(t))throw new qe("raster-function-helper",`unsupported raster function: ${t}`);const s=Lp.get(t),o=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...i,outputPixelType:n}),{rasterArgumentNames:a}=o,l=[],u=ern(r,a),c=a[0]==="rasters",h=[];for(let p=0;ptypeof n=="object"&&n.type==="RasterFunctionVariable"?bBe(n,e):n);if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(i.isDataset&&t.type!=="Scalar")return"$$";if(!("type"in t))return t;let r=t;switch(t.type){case"Scalar":r=t.value;break;case"AlgorithmicColorRamp":r=Qgt(t);break;case"MultiPartColorRamp":r={type:"multipart",colorRamps:t.ArrayOfColorRamp.map(Qgt)};break;case"ArgumentArray":if(t.elements?.length&&t.elements[0].type!=="RasterStatistics"){const n=[];for(let s=0;s{if(typeof a=="object")if(a._object_ref_id!=null){if(!t.has(a._object_ref_id))throw new qe("raster-function-helper",`unsupported raster function json. _object_ref_id: ${s} does not exist`);const u=t.get(o);u&&typeof u=="object"?Object.assign(a,u):s[l]=u}else wBe({renderingRule:a,templates:t})}));else{if(!t.has(o))throw new qe("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const a=t.get(o);n!=="_object_ref_id"?r[n]=a:a&&typeof a=="object"&&Object.assign(r,a)}}}function trn(i){i.Statistics?.length&&typeof i.Statistics=="object"&&(i.Statistics=i.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),i.NumberOfStandardDeviation!=null&&(i.NumberOfStandardDeviations=i.NumberOfStandardDeviation,delete i.NumberOfStandardDeviation)}function irn(i){i.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete i.ColorRamp,i.ColormapName="Random"),i.ColorSchemeType===0&&delete i.ColorRamp}function rrn(i){i.ConvolutionType!=null&&(i.Type=i.ConvolutionType,delete i.ConvolutionType)}function nrn(i){i.NoDataValues?.length&&typeof i.NoDataValues[0]=="string"&&(i.NoDataValues=i.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}Lp.set("Arithmetic",{desc:"Arithmetic Function",ctor:Stn,rasterArgumentNames:["rasters"]}),Lp.set("Aspect",{desc:"Aspect Function",ctor:Ctn,rasterArgumentNames:["raster"]}),Lp.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Ztn,rasterArgumentNames:["raster"]}),Lp.set("Colormap",{desc:"Colormap Function",ctor:cin,rasterArgumentNames:["raster"]}),Lp.set("CompositeBand",{desc:"CompositeBand Function",ctor:din,rasterArgumentNames:["rasters"]}),Lp.set("Convolution",{desc:"Convolution Function",ctor:win,rasterArgumentNames:["raster"]}),Lp.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:fin,rasterArgumentNames:["raster"]}),Lp.set("ExtractBand",{desc:"ExtractBand Function",ctor:Cin,rasterArgumentNames:["raster"]}),Lp.set("Curvature",{desc:"Curvature Function",ctor:Sin,rasterArgumentNames:["raster"]}),Lp.set("Grayscale",{desc:"Grayscale Function",ctor:Ain,rasterArgumentNames:["raster"]}),Lp.set("Clip",{desc:"Clip Function",ctor:ein,rasterArgumentNames:["raster"]}),Lp.set("Local",{desc:"Local Function",ctor:Oin,rasterArgumentNames:["rasters"]}),Lp.set("Mask",{desc:"Mask Function",ctor:Rin,rasterArgumentNames:["raster"]}),Lp.set("NDVI",{desc:"NDVI Function",ctor:Fin,rasterArgumentNames:["raster"]}),Lp.set("Remap",{desc:"Remap Function",ctor:Lin,rasterArgumentNames:["raster"]}),Lp.set("Slope",{desc:"Slope Function",ctor:Bin,rasterArgumentNames:["raster"]}),Lp.set("Statistics",{desc:"Focal Statistics Function",ctor:Win,rasterArgumentNames:["raster"]}),Lp.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Yin,rasterArgumentNames:["raster"]}),Lp.set("Stretch",{desc:"Stretch Function",ctor:Kin,rasterArgumentNames:["raster"]}),Lp.set("Table",{desc:"Attribute Table Function",ctor:Qin,rasterArgumentNames:["raster"]});var xBe;function aKe(i,e,t){return!_0(i,e,t)}function g7(i,e,t){const r=aKe(i,e,t);if(r&&!qx())throw new qe("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(i){i[i.None=0]="None",i[i.North=1]="North",i[i.South=2]="South",i[i.Both=3]="Both"})(xBe||(xBe={}));const eyt=(i,e,t,r=0)=>{if(t[0]===1)return[0,0];let n=1,s=-1,o=1,a=-1;for(let S=0;Si[S]?i[S]:n,s=s>i[S]?s:i[S],o=o>i[S+1]?i[S+1]:o,a=a>i[S+1]?a:i[S+1]);const{cols:l,rows:u}=e,c=(s-n)/l/t[0],h=(a-o)/u/t[1],p=2*r;let m=0,v=!1,w=[0,0];for(let S=0;Sm&&(m=B+$,w=[B,$]),p&&m>p){v=!0;break}}if(v)break}return w},srn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},Nbe=32,$be=4,TPe=$be,CPe=new Map,EPe=new Map,Bbe=500;async function jbe(){qx()||await FS()}function GVt(i,e,t){return g7(i.spatialReference,e),t?Une(e,i.spatialReference,i):Une(i.spatialReference,e,i)}function aoe(i,e,t,r=null){const n=i.spatialReference;if(n.equals(e))return i;g7(n,e,r);const s=t.center,o=new hr({xmin:s.x-i.x/2,xmax:s.x+i.x/2,ymin:s.y-i.y/2,ymax:s.y+i.y/2,spatialReference:n}),a=Wc(o,e,r),l=q1(e);let u;if(a==null||l!=null&&a.width>=l){const c=pu(n)/pu(e);u={x:i.x*c,y:i.y*c}}else u={x:a.width,y:a.height};return u}function mx(i,e=.01){return pu(i)?e/pu(i):0}function Gbe(i,e,t=null,r=!0){const n=i.spatialReference;if(n.equals(e))return i;g7(n,e,t);const s=Wc(i,e,t);return r&&s&&UVt([i],[s],n,e),s}function UVt(i,e,t,r){const n=Ube(t,!0),s=Ube(r,!0),o=mx(t,Bbe),a=mx(r,Bbe);if(o&&n!=null&&s!=null)for(let l=0;l=s[1]-a&&Math.abs(c-n[0])new $i(a[0],a[1],t)),o=Wc(s,r,n);return n&&UVt(s,o,t,r),o.map(a=>a?[a.x,a.y]:[NaN,NaN])}function tyt(i){const{inSR:e,outSR:t,datumTransformation:r}=i,n=RB(e),{points:s,mask:o}=lKe(i,n);if(!e.isGeographic){const l=e.wkid?tx.coordsys(e.wkid):tx.fromString(e.isGeographic?ku.PE_TYPE_GEOGCS:ku.PE_TYPE_PROJCS,e.wkt2||e.wkt);xne.projToGeog(l,s.length,s)}if(r!=null&&r.steps.length){let l;if(t.isGeographic&&(l=s.map(([c])=>c>179.9955?1:c<-179.9955?-1:0)),r.steps.forEach(c=>{const h=c.wkid?tx.geogtran(c.wkid):tx.fromString(ku.PE_TYPE_GEOGTRAN,c.wkt);Fve.geogToGeog(h,s.length,s,null,c.isInverse?ku.PE_TRANSFORM_2_TO_1:ku.PE_TRANSFORM_1_TO_2)}),l)for(let c=0;c179.9955?1:p<-179.9955?-1:0;h&&m&&h!==m&&(s[c][0]=h>0?p+360:p-360)}}if(!t.isGeographic){const l=RB(t,!0),u=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];urn(s,u);const c=t.wkid?tx.coordsys(t.wkid):tx.fromString(t.isGeographic?ku.PE_TYPE_GEOGCS:ku.PE_TYPE_PROJCS,t.wkt2||t.wkt);xne.geogToProj(c,s.length,s)}let a=s;if(o&&s.length!==o.length){a=[];for(let l=0,u=0;lS.getInclusive()===1&&S.getKind()===1);if(!o){if(o=n.find(S=>S.getInclusive()===1&&S.getKind()===0),!o)return null;s=!0}const a=t?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),u=o.getCoord();if(s)return{isEnvelope:s,isPannable:l,vertices:u,coef:null,bbox:[u[0][0]-e,u[0][1]-e,u[1][0]+e,u[1][1]+e],poleLocation:a};let c=0;const h=[];let[p,m]=u[0],[v,w]=u[0];for(let S=0,I=u.length;SR?v:R,w=w>L?w:L}return{isEnvelope:!1,isPannable:l,vertices:u,coef:h,bbox:[p,m,v,w],poleLocation:a}}function lKe(i,e){const t=[],{cols:r,rows:n,xres:s,yres:o,usePixelCenter:a}=i;let{xmin:l,ymax:u}=i;if(a&&(l+=s/2,u-=o/2),e==null){for(let m=0;m=m&&L<=w;for(let B=0;B=v&&$<=S&&(t.push([L,$]),c[R]=1)}}return{points:t,mask:c}}const h=e.coef,p=[];for(let m=0;m=B&&v<=$){const Y=L*v+k;w.push(Y),S.push(V)}}let I=w;if(w.length>2){let R=S[0]===2?0:S[0],L=w[0];I=[];for(let k=1;kk-B)}else w[0]>w[1]&&(I=[w[1],w[0]]);p.push(I)}for(let m=0,v=0;m=R[0]&&w<=R[1]&&(t.push([w,I]),c[v]=1);else if(R.length>2){let L=!1;for(let k=0;k=R[k]&&w<=R[k+1]){L=!0;break}L&&(t.push([w,I]),c[v]=1)}}}return{points:t,mask:c}}function urn(i,e){const[t,r]=e;for(let n=0;nr)&&(i[n]=[NaN,NaN])}}function zVt(i,e){const t=q1(i[0].spatialReference);if(i.length<2||t==null||(e=e??mx(i[0].spatialReference),(i=i.filter(a=>a.width>e)).length===1))return i[0];let{xmin:r,xmax:n,ymin:s,ymax:o}=i[0];for(let a=1;amx(n)){const{xmin:u,xmax:c}=i;for(let h=0;h<=s;h++){const p=h===0?u:-o/2,m=h===s?c-o*h:o/2;l[h]=new hr({xmin:p,xmax:m,ymin:i.ymin,ymax:i.ymax,spatialReference:n})}}return zVt(l.map(u=>ryt(u,e,t,r)).filter(Ga))}function SBe(i,e,t){if(i.type==="extent"){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=i;i=new $s({rings:[[[r,o],[s,o],[s,n],[r,n],[r,o]]],spatialReference:a})}return i.spatialReference.equals(e)?i:(g7(i.spatialReference,e,t),Wc(i,e,t))}function crn(i,e){const t=q1(e);if(t==null)return null;let{xmin:r,ymin:n,xmax:s,ymax:o}=i;const a=i.spatialReference,l=new $s({spatialReference:a,rings:[[[r,n],[s,n],[s,o],[r,o],[r,n]]]}),u=Wc(l,e);if(u.rings.length!==2||!u.rings[0].length||!u.rings[1].length)return null;const{rings:c}=u,h=mx(a),p=new hr({spatialReference:e});for(let m=0;m<2;m++){r=s=c[m][0][0],n=o=c[m][0][1];for(let v=0;vc[m][v][0]?c[m][v][0]:r,s=sc[m][v][1]?c[m][v][1]:n,o=o=o.ymax))return null;if(!r||!o)return o;const a=Ube(s,!0),l=Ube(e,!0);if(a==null||l==null)return o;const u=mx(s,.001),c=mx(s,Bbe),h=mx(e,.001);if(Math.abs(o.xmin-l[0])c){o.xmin=l[0];const v=[];v.push(new $i(i.xmax,i.ymin,s)),v.push(new $i(i.xmax,(i.ymin+i.ymax)/2,s)),v.push(new $i(i.xmax,i.ymax,s));const w=v.map(S=>Gbe(S,e,t)).filter(S=>!isNaN(S?.x)).map(S=>S.x);o.xmax=Math.max.apply(null,w)}if(mc){o.xmax=l[1];const v=[];v.push(new $i(i.xmin,i.ymin,s)),v.push(new $i(i.xmin,(i.ymin+i.ymax)/2,s)),v.push(new $i(i.xmin,i.ymax,s));const w=v.map(S=>Gbe(S,e,t)).filter(S=>!isNaN(S?.x)).map(S=>S.x);o.xmin=Math.min.apply(null,w)}}else{const p=mx(e,.001);Math.abs(o.xmin-l[0])0&&r.outofBoundPointCountTPe)&&(aKe(l,u,i.datumTransformation)&&(l.isGeographic||RB(l)),t=[$be,$be],r=IPe({...i,spacing:t}),n={cols:r.size[0]+1,rows:r.size[1]+1},o=eyt(r.offsets,n,t,TPe)),r.error=o,t[0]>1&&(r.coefficients=syt(r.offsets,n,s)),i.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(u.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:t};else{const c=RB(l);if(c!=null&&!c.isEnvelope){const h=drn(l),p=FF(i.projectedExtent,h),{offsets:m}=IPe({...i,srcBufferExtent:p,spacing:t}),v=syt(m,n,s);r.gcsGrid={offsets:m,coefficients:v,spacing:t}}}return r}function IPe(i){const{projectedExtent:e,srcBufferExtent:t,pixelSize:r,datumTransformation:n,rasterTransform:s}=i,o=e.spatialReference,a=t.spatialReference,l=g7(o,a),{xmin:u,ymin:c,xmax:h,ymax:p}=e,m=q1(a),v=m!=null&&(i.hasWrapAround||s?.type==="gcs-shift"),w=i.spacing||[Nbe,Nbe],S=w[0]*r.x,I=w[1]*r.y,R=w[0]===1,L=Math.ceil((h-u)/S-.1/w[0])+(R?0:1),k=Math.ceil((p-c)/I-.1/w[1])+(R?0:1),B=orn({cols:L,rows:k,xmin:u,ymax:p,xres:S,yres:I,inSR:o,outSR:a,datumTransformation:n,preferPE:w[0]<=$be,usePixelCenter:R}),$=[];let V,Y=0;const K=R?-1:NaN,{xmin:Q,xmax:re,ymax:ne,width:de,height:pe}=t,H=mx(a,Bbe),Z=m!=null&&Q>0&&re>m/2;let ae=!1;if(l){const fe=RB(o);ae=fe!=null&&fe.poleLocation>0}for(let fe=0;fere&&Ie[0]>m/2-H?Ie[0]-=m:v&&fe===0&&Ie[0]<0&&Z&&!s&&(Ie[0]+=m),!Ie||isNaN(Ie[0])||isNaN(Ie[1]))$.push(K),$.push(K),be.push(null),Y++;else{if(s){const Te=s.inverseTransform(new $i({x:Ie[0],y:Ie[1],spatialReference:a}));Ie=[Te.x,Te.y]}be.push(Ie),fe>0&&v&&V[_e]&&Ie[0]re&&Ie[0]>m&&(Ie[0]-=m)),$.push((Ie[0]-Q)/de),$.push((ne-Ie[1])/pe)}}V=be}return{offsets:$,error:null,coefficients:null,outofBoundPointCount:Y,spacing:w,size:R?[L,k]:[L-1,k-1]}}function syt(i,e,t){const{cols:r,rows:n}=e,s=new Float32Array((r-1)*(n-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;ln){const a=i.xmin-n;o=-Math.ceil(a/s)}return new hr({spatialReference:i.spatialReference,xmin:i.xmin+o*s,ymin:i.ymin,xmax:i.xmax+o*s,ymax:i.ymax})}function TBe(i,e,t){const{storageInfo:r,pixelSize:n}=e;let s=0,o=!1;const{pyramidResolutions:a}=r,l=r.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,r.tileInfo.dpi/96)):1,u=(i.x+i.y)/2/l;if(a!=null&&a.length){const v=a[a.length-1],w=(v.x+v.y)/2,S=(n.x+n.y)/2;if(u<=S)s=0;else if(u>=w)s=a.length,o=u/w>8;else{let R,L=S;for(let k=1;k<=a.length;k++){if(R=(a[k-1].x+a[k-1].y)/2,u<=R){u===R?s=k:t==="down"?(s=k-1,o=u/L>8):s=t==="up"||u-L>R-u||u/L>2?k:k-1;break}L=R}}const I=s===0?n:a[s-1];return o&&Math.min(I.x,I.y)*pu(e.spatialReference)>19567&&(o=!1),{pyramidLevel:s,pyramidResolution:new $i({x:I.x,y:I.y,spatialReference:e.spatialReference}),excessiveReading:o}}const c=Math.log(i.x/n.x)/Math.LN2,h=Math.log(i.y/n.y)/Math.LN2,p=e.storageInfo.maximumPyramidLevel||0;s=t==="down"?Math.floor(Math.min(c,h)):t==="up"?Math.ceil(Math.max(c,h)):Math.round((c+h)/2),s<0?s=0:s>p&&(o=s>p+3,s=p);const m=2**s;return{pyramidLevel:s,pyramidResolution:new $i({x:m*e.nativePixelSize.x,y:m*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}function CBe(i,e){const{pixelSize:t,extent:r}=i,n=GVt(r,e,!1);return FF(prn(r,(t.x+t.y)/16),e,n)}function mrn(i,e,t){const r=t?.tileSize,n=t?.alignGlobalDatasetWithAGOL,{extent:s,spatialReference:o,pixelSize:a}=i,l=aoe(new $i({x:a.x,y:a.y,spatialReference:o}),e,s);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const u=(l.x+l.y)/2,c=pu(e),h=u*c*96*39.37,p=e.isGeographic?256/r*2958287637958547e-7:256/r*591657527591555e-6;let m=i.dataType==="vector-magdir"||i.dataType==="vector-uv";const v=CBe(i,e),w=Math.min(Math.ceil(Math.log(Math.min(i.width,i.height)/32)/Math.LN2),Math.ceil(Math.log(p/2/h)/Math.LN2));if(!m&&n&&(e.isGeographic||e.isWebMercator)){const Y=q1(e);if(m=wre(v)>0||Y!=null&&v.width>Y/4,!m&&Y!=null){let K=-1;if(w<3)K=2**w*u*r;else if(i.storageInfo){const{maximumPyramidLevel:re=0,pyramidScalingFactor:ne=2}=i.storageInfo;K=ne**re*u*r}const Q=Math.ceil(Y/K);m=Q===1||Q===2&&Y/2-v.xmax=V;)I/=L,S.x/=L,S.y/=L,k.push(I),B.push({x:S.x,y:S.y});return{projectedPixelSize:l,scales:k,srcResolutions:B,isCustomTilingScheme:!m}}let Qee=class extends Ci{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};x([D()],Qee.prototype,"affectsPixelSize",null),x([D({json:{write:!0}})],Qee.prototype,"spatialReference",void 0),Qee=x([Qe("esri.layers.support.rasterTransforms.BaseRasterTransform")],Qee);const cKe=Qee;var EBe;let ete=EBe=class extends cKe{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(i){return(i=i.clone()).type==="point"?(i.x>180+this.tolerance&&(i.x-=360),i):(i.xmin>=180-this.tolerance?(i.xmax-=360,i.xmin-=360):i.xmax>180+this.tolerance&&(i.xmin=-180,i.xmax=180),i)}inverseTransform(i){return(i=i.clone()).type==="point"?(i.x<-this.tolerance&&(i.x+=360),i):(i.xmin<-this.tolerance&&(i.xmin+=360,i.xmax+=360),i)}clone(){return new EBe({tolerance:this.tolerance})}};x([Wr({GCSShiftXform:"gcs-shift"})],ete.prototype,"type",void 0),x([D()],ete.prototype,"tolerance",void 0),ete=EBe=x([Qe("esri.layers.support.rasterTransforms.GCSShiftTransform")],ete);const VVt=ete;var IBe;let Iye=IBe=class extends cKe{constructor(){super(...arguments),this.type="identity"}clone(){return new IBe}};x([Wr({IdentityXform:"identity"})],Iye.prototype,"type",void 0),Iye=IBe=x([Qe("esri.layers.support.rasterTransforms.IdentityTransform")],Iye);const grn=Iye;var ABe;function MBe(i,e,t){const{x:r,y:n}=e;if(t<2)return{x:i[0]+r*i[2]+n*i[4],y:i[1]+r*i[3]+n*i[5]};if(t===2){const p=r*r,m=n*n,v=r*n;return{x:i[0]+r*i[2]+n*i[4]+p*i[6]+v*i[8]+m*i[10],y:i[1]+r*i[3]+n*i[5]+p*i[7]+v*i[9]+m*i[11]}}const s=r*r,o=n*n,a=r*n,l=s*r,u=s*n,c=r*o,h=n*o;return{x:i[0]+r*i[2]+n*i[4]+s*i[6]+a*i[8]+o*i[10]+l*i[12]+u*i[14]+c*i[16]+h*i[18],y:i[1]+r*i[3]+n*i[5]+s*i[7]+a*i[9]+o*i[11]+l*i[13]+u*i[15]+c*i[17]+h*i[19]}}function oyt(i,e,t){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=e;let l=[];if(t<2)l.push({x:r,y:o}),l.push({x:s,y:o}),l.push({x:r,y:n}),l.push({x:s,y:n});else{let h=10;for(let p=0;pMBe(i,h,t));const u=l.map(h=>h.x),c=l.map(h=>h.y);return new hr({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}function yrn(i){const[e,t,r,n,s,o]=i,a=r*o-s*n,l=s*n-r*o;return[(s*t-e*o)/a,(r*t-e*n)/l,o/a,n/l,-s/a,-r/l]}let D2=ABe=class extends cKe{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(i,e){const{coeffX:t,coeffY:r}=e;if(!t?.length||!r?.length||t.length!==r.length)return null;const n=[];for(let s=0;s0}forwardTransform(i){if(i.type==="point"){const e=MBe(this.forwardCoefficients,i,this.polynomialOrder);return new $i({x:e.x,y:e.y,spatialReference:i.spatialReference})}return oyt(this.forwardCoefficients,i,this.polynomialOrder)}inverseTransform(i){if(i.type==="point"){const e=MBe(this.inverseCoefficients,i,this.polynomialOrder);return new $i({x:e.x,y:e.y,spatialReference:i.spatialReference})}return oyt(this.inverseCoefficients,i,this.polynomialOrder)}clone(){return new ABe({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};x([D({json:{write:!0}})],D2.prototype,"polynomialOrder",void 0),x([D()],D2.prototype,"forwardCoefficients",void 0),x([Mi("forwardCoefficients",["coeffX","coeffY"])],D2.prototype,"readForwardCoefficients",null),x([ur("forwardCoefficients")],D2.prototype,"writeForwardCoefficients",null),x([D({json:{write:!0}})],D2.prototype,"inverseCoefficients",null),x([Mi("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],D2.prototype,"readInverseCoefficients",null),x([ur("inverseCoefficients")],D2.prototype,"writeInverseCoefficients",null),x([D()],D2.prototype,"affectsPixelSize",null),x([Wr({PolynomialXform:"polynomial"})],D2.prototype,"type",void 0),D2=ABe=x([Qe("esri.layers.support.rasterTransforms.PolynomialTransform")],D2);const LCe=D2,HVt={GCSShiftXform:VVt,IdentityXform:grn,PolynomialXform:LCe},vrn=Object.keys(HVt);function _rn(i){const e=i?.type;return!i||vrn.includes(e)}function WVt(i){if(!i?.type)return null;const t=HVt[i?.type];if(t){const r=new t;return r.read(i),r}return null}let brn=class{convertVectorFieldData(e){const t=Br.fromJSON(e.pixelBlock),r=AW(t,e.type);return Promise.resolve(r!=null?r.toJSON():null)}computeStatisticsHistograms(e){const t=Br.fromJSON(e.pixelBlock),r=nSe(t);return Promise.resolve(r)}async decode(e){const t=await A1e(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=Br.fromJSON(e.pixelBlock),e.extent=e.extent?hr.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(e){this.symbolizer=AHe.fromJSON(e.symbolizerJSON),e.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=oKe(e.rasterFunctionJSON)}async process(e){const t=this.rasterFunction.process({extent:hr.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(r=>r!=null?Br.fromJSON(r):null),primaryPixelSizes:e.primaryPixelSizes?.map(r=>r!=null?$i.fromJSON(r):null),primaryRasterIds:e.primaryRasterIds});return t!=null?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(Br.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(e){const t=CHe(Br.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=aRt(Br.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,e.useBilinear===!1);return t&&t.forEach((r,n)=>{t.set(n,r?.toJSON())}),Promise.resolve(t)}clipTile(e){const t=Br.fromJSON(e.pixelBlock),r=lRt({...e,pixelBlock:t});return Promise.resolve(r?.toJSON())}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map(o=>o?new Br(o):null),r=Bie(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let n,s=r;return e.coefs&&(s=dHe(r,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(n=cRt(e.destDimension,e.gcsGrid),s=dRt(s,e.isUV?"vector-uv":"vector-magdir",n)),{pixelBlock:s?.toJSON(),localNorthDirections:n}}async createFlowMesh(e,t){const r={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:n,indexData:s}=await FHe(e.meshType,e.simulationSettings,r,t.signal);return{result:{vertexBuffer:n.buffer,indexBuffer:s.buffer},transferList:[n.buffer,s.buffer]}}async getProjectionOffsetGrid(e){const t=hr.fromJSON(e.projectedExtent),r=hr.fromJSON(e.srcBufferExtent);let n=null;e.datumTransformationSteps&&(n=new Gne({steps:e.datumTransformationSteps})),(e.includeGCSGrid||aKe(t.spatialReference,r.spatialReference,n))&&await jbe();const s=e.rasterTransform?WVt(e.rasterTransform):null;return uKe({...e,projectedExtent:t,srcBufferExtent:r,datumTransformation:n,rasterTransform:s})}};const wrn=Object.freeze(Object.defineProperty({__proto__:null,default:brn},Symbol.toStringTag,{value:"Module"}));let pX=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&z9(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*ayt);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;eNCe());function zbe(i){return i?lyt(Ef(i.origin),Ef(i.direction)):lyt(gr(),gr())}function lyt(i,e){return{origin:i,direction:e}}function uyt(i,e){const t=Irn.get();return t.origin=i,t.direction=e,t}function Crn(i,e,t=zbe()){return Px(t.origin,i),uh(t.direction,e,i),t}function Ern(i,e,t){const r=yE(i.direction,uh(t,e,i.origin));return hl(t,i.origin,Gc(t,i.direction,r)),t}const Irn=new pX(()=>zbe()),Arn=sT();function sT(){return EE()}const Mrn=$2e,Orn=$2e;function Pq(i,e){return Fne(e,i)}function Prn(i,e){return Vb(i[0],i[1],i[2],e)}function Rrn(i){return i}function Drn(i){i[0]=i[1]=i[2]=i[3]=0}function Frn(i,e){return i[0]=i[1]=i[2]=0,i[3]=e,i}function y9(i){return i[3]}function krn(i){return i}function Lrn(i,e,t,r){return Vb(i,e,t,r)}function Nrn(i,e,t){return i!==t&&(t[0]=i[0],t[1]=i[1],t[2]=i[2]),t[3]=i[3]+e,t}function $rn(i,e,t){return di.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),i!==t&&Pq(i,t),t}function $Ce(i,e,t){if(e==null||!qVt(i,e,Vbe))return!1;let{t0:r,t1:n}=Vbe;if((r<0||n0)&&(r=n),r<0)return!1;if(t){const{origin:s,direction:o}=e;t[0]=s[0]+o[0]*r,t[1]=s[1]+o[1]*r,t[2]=s[2]+o[2]*r}return!0}function Brn(i,e,t){const r=Crn(e,t);if(!qVt(i,r,Vbe))return[];const{origin:n,direction:s}=r,{t0:o,t1:a}=Vbe,l=u=>{const c=gr();return gb(c,n,s,u),hKe(i,c,c)};return Math.abs(o-a)ZVt());function Qde(i,e){for(let t=0;t=e[3])return!1}return!0}var cyt,Uh;(function(i){i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i[i.BOTTOM=2]="BOTTOM",i[i.TOP=3]="TOP",i[i.NEAR=4]="NEAR",i[i.FAR=5]="FAR"})(cyt||(cyt={})),function(i){i[i.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",i[i.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",i[i.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",i[i.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",i[i.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",i[i.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",i[i.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",i[i.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(Uh||(Uh={}));Uh.FAR_BOTTOM_RIGHT,Uh.NEAR_BOTTOM_RIGHT,Uh.NEAR_BOTTOM_LEFT,Uh.FAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_RIGHT,Uh.NEAR_TOP_RIGHT,Uh.NEAR_TOP_LEFT,Uh.FAR_BOTTOM_RIGHT,Uh.FAR_BOTTOM_LEFT,Uh.FAR_TOP_LEFT,Uh.FAR_TOP_RIGHT,Uh.NEAR_BOTTOM_RIGHT,Uh.FAR_BOTTOM_RIGHT,Uh.FAR_TOP_RIGHT,Uh.NEAR_TOP_RIGHT,Uh.FAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_LEFT,Uh.NEAR_TOP_LEFT,Uh.FAR_TOP_LEFT,Uh.FAR_TOP_LEFT,Uh.NEAR_TOP_LEFT,Uh.NEAR_TOP_RIGHT,Uh.FAR_TOP_RIGHT;const qrn=6;new pX(ZVt);let DBe=class Aye{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new tm,this._objectCount=0,t&&(t.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),t.maximumDepth!==void 0&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),tm.clearPool(),FBe[0]=null,sN.prune(),H$.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const r=tm.acquire();for(let n=0;n{if(!this._intersectsNode(n,s))return!1;const o=s.node;return o.terminals.forAll(a=>{this._intersectsObject(n,a)&&r(a)}),o.residents!==null&&o.residents.forAll(a=>{this._intersectsObject(n,a)&&r(a)}),!0})}forEachAlongRayWithVerticalOffset(e,t,r,n){const s=uyt(e,t);this._forEachNode(this._root,o=>{if(!this._intersectsNodeWithOffset(s,o,n))return!1;const a=o.node;return a.terminals.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&r(l)}),a.residents!==null&&a.residents.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&r(l)}),!0})}forEach(e){this._forEachNode(this._root,t=>{const r=t.node;return r.terminals.forAll(e),r.residents!==null&&r.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,r,n=()=>!0,s=1/0){let o=1/0,a=1/0,l=null;const u=MPe(e,t),c=h=>{if(--s,!n(h))return;const p=this.objectToBoundingSphere(h);if(!Qde(r,p))return;const m=T5(e,t,p),v=m-p[3],w=m+p[3];v{if(s<=0||!Qde(r,h.bounds)||(Gc(y2,u,h.halfSize),hl(y2,y2,h.bounds),T5(e,t,y2)>a))return!1;const p=h.node;return p.terminals.forAll(m=>c(m)),p.residents!==null&&p.residents.forAll(m=>c(m)),!0},e,t),l}forEachInDepthRange(e,t,r,n,s,o,a){let l=-1/0,u=1/0;const c={setRange:w=>{r===Aye.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,w.near),u=Math.min(u,w.far)):(l=Math.max(l,-w.far),u=Math.min(u,-w.near))}};c.setRange(n);const h=T5(t,r,e),p=MPe(t,r),m=MPe(t,-r),v=w=>{if(!a(w))return;const S=this.objectToBoundingSphere(w),I=S,R=T5(t,r,I)-h,L=R-S[3],k=R+S[3];L>u||k{if(!Qde(o,w.bounds)||(Gc(y2,p,w.halfSize),hl(y2,y2,w.bounds),T5(t,r,y2)-h>u)||(Gc(y2,m,w.halfSize),hl(y2,y2,w.bounds),T5(t,r,y2)-hv(I)),S.residents!==null&&S.residents.forAll(I=>v(I)),!0},t,r)}forEachNode(e){this._forEachNode(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachNeighbor(e,t){const r=y9(t),n=t,s=l=>{const u=this.objectToBoundingSphere(l),c=y9(u),h=r+c;return!(aW(u,n)-h*h<=0)||e(l)};let o=!0;const a=l=>{o&&(o=s(l))};this._forEachNode(this._root,l=>{const u=y9(l.bounds),c=r+u;if(aW(l.bounds,n)-c*c>0)return!1;const h=l.node;return h.terminals.forAll(a),o&&h.residents!==null&&h.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsNode(e,t){return epe(t.bounds,2*-t.halfSize,Xw),epe(t.bounds,2*t.halfSize,Jw),Opt(e.origin,e.direction,Xw,Jw)}_intersectsNodeWithOffset(e,t,r){return epe(t.bounds,2*-t.halfSize,Xw),epe(t.bounds,2*t.halfSize,Jw),r.applyToMinMax(Xw,Jw),Opt(e.origin,e.direction,Xw,Jw)}_intersectsObject(e,t){const r=this.objectToBoundingSphere(t);return!(r[3]>0)||OBe(r,e)}_intersectsObjectWithOffset(e,t,r){const n=this.objectToBoundingSphere(t);return!(n[3]>0)||OBe(r.applyToBoundingSphere(n),e)}_forEachNode(e,t){let r=tm.acquire().init(e);const n=[r];for(;n.length!==0;){if(r=n.pop(),t(r)&&!r.isLeaf())for(let s=0;s=0;--a){const l=pyt[a];s.node.children[l]&&o.push(tm.acquire().init(s).advance(l))}tm.release(s)}}_remove(e,t,r){sN.clear();const n=r.advanceTo(t,(s,o)=>{sN.push(s.node),sN.push(o)})?r.node.terminals:r.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=sN.length-2;s>=0;s-=2){const o=sN.data[s],a=sN.data[s+1];if(!this._purge(o,a))break}}_nodeIsEmpty(e){if(e.terminals.length!==0)return!1;if(e.residents!==null)return e.residents.length===0;for(let t=0;t=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new mg({shrink:!0})),!0)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depththis.objectToBoundingSphere(r),RM),tte(RM[3])&&!this._fitsInsideTree(RM)))if(this._nodeIsEmpty(this._root.node))Pq(RM,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const r=this._rootBoundsForRootAsSubNode(RM);this._placingRootViolatesMaxDepth(r)?this._rebuildTree(RM,r):this._growRootAsSubNode(r),tm.release(r)}}_rebuildTree(e,t){Px(PPe,t.bounds),PPe[3]=t.halfSize,hyt([e,PPe],2,n=>n,RPe);const r=tm.acquire().init(this._root);this._root.initFrom(null,RPe,RPe[3]),this._root.increaseHalfSize(1.25),this._forEachNode(r,n=>(this.add(n.node.terminals.data,n.node.terminals.length),n.node.residents!==null&&this.add(n.node.residents.data,n.node.residents.length),!0)),tm.release(r)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let r=0;return this._forEachNode(this._root,n=>(r=Math.max(r,n.depth),r+t<=this._maximumDepth)),r+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],r=e;let n=-1/0;const s=this._root.bounds,o=this._root.halfSize;for(let l=0;l<3;l++){const u=s[l]-o-(r[l]-t),c=r[l]+t-(s[l]+o),h=Math.max(0,Math.ceil(u/(2*o))),p=Math.max(0,Math.ceil(c/(2*o)))+1,m=2**Math.ceil(Math.log(h+p)*Math.LOG2E);n=Math.max(n,m),tpe[l].min=h,tpe[l].max=p}for(let l=0;l<3;l++){let u=tpe[l].min,c=tpe[l].max;const h=(n-(u+c))/2;u+=Math.ceil(h),c+=Math.floor(h);const p=s[l]-o-u*o*2;OPe[l]=p+(c+u)*o}const a=n*o;return OPe[3]=a*eHt,tm.acquire().initFrom(null,OPe,a,0)}_growRootAsSubNode(e){const t=this._root.node;Px(RM,this._root.bounds),RM[3]=this._root.halfSize,this._root.init(e),e.advanceTo(RM,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(e===-1)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let r=0,n=0;for(;n=t[0]-r&&e[0]<=t[0]+r&&e[1]>=t[1]-r&&e[1]<=t[1]+r&&e[2]>=t[2]-r&&e[2]<=t[2]+r}toJSON(){const{maximumDepth:e,maximumObjectsPerNode:t,_objectCount:r}=this,n=this._nodeToJSON(this._root.node);return{maximumDepth:e,maximumObjectsPerNode:t,objectCount:r,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:n}}}_nodeToJSON(e){const t=e.children.map(s=>s?this._nodeToJSON(s):null),r=e.residents?.map(s=>this.objectToBoundingSphere(s)),n=e.terminals?.map(s=>this.objectToBoundingSphere(s));return{children:t,residents:r,terminals:n}}static fromJSON(e){const t=new Aye(r=>r,{maximumDepth:e.maximumDepth,maximumObjectsPerNode:e.maximumObjectsPerNode});return t._objectCount=e.objectCount,t._root.initFrom(e.root.node,e.root.bounds,e.root.halfSize,e.root.depth),t}},tm=class $U{constructor(){this.bounds=sT(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,r,n=this.depth){return this.node=e??$U.createEmptyNode(),t&&Pq(t,this.bounds),this.halfSize=r,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*eHt}advance(e){let t=this.node.children[e];t||(t=$U.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const r=QVt[e];return this.bounds[0]+=r[0]*this.halfSize,this.bounds[1]+=r[1]*this.halfSize,this.bounds[2]+=r[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,r=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!r)return t&&t(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);t&&t(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]r.distance-n.distance);for(let r=0;r<8;++r)t[r]=H$.data[r].index}function MPe(i,e){let t,r=1/0;for(let n=0;n<8;++n){const s=T5(i,e,dyt[n]);s0}tm._pool=new G3(tm),function(i){var e;(e=i.DepthOrder||(i.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(DBe||(DBe={}));const QVt=[Do(-1,-1,-1),Do(1,-1,-1),Do(-1,1,-1),Do(1,1,-1),Do(-1,-1,1),Do(1,-1,1),Do(-1,1,1),Do(1,1,1)],dyt=[Do(-1,-1,-1),Do(-1,-1,1),Do(-1,1,-1),Do(-1,1,1),Do(1,-1,-1),Do(1,-1,1),Do(1,1,-1),Do(1,1,1)],eHt=Math.sqrt(3),FBe=[null];function Krn(i){return FBe[0]=i,FBe}const OPe=sT(),y2=gr(),Xw=gr(),Jw=gr(),sN=new mg,Zrn=sT(),RM=sT(),PPe=sT(),RPe=sT(),tpe=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H$=new mg,pyt=[0,0,0,0,0,0,0,0],fyt=DBe,Qrn=1e3;function enn(i,e,t){const r=sT(),n=r;return gb(n,n,i,.5),gb(n,n,e,.5),r[3]=hR(n,i),hl(n,n,t),r}let kBe=class{constructor(){this._idToComponent=new Map,this._components=new fyt(e=>e.bounds),this._edges=new fyt(e=>e.bounds),this._tmpLineSegment=NCe(),this._tmpP1=gr(),this._tmpP2=gr(),this._tmpP3=gr(),this.remoteClient=null}async fetchCandidates(e,t){await Promise.resolve(),hn(t),await this._ensureEdgeLocations(e,t);const r=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(e,n,r),r.length{if(o.info==null){const{id:a,uid:l}=o;r.push({id:a,uid:l})}return!0},e.bounds),!r.length)return;const n={components:r},s=await this.remoteClient.invoke("fetchAllEdgeLocations",n,t??{});for(const o of s.components)this._setFetchEdgeLocations(o)}async add(e){const t=new tHt(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const r=[];this._edges.forEachNeighbor(n=>(n.component===t&&r.push(n),!0),t.bounds),this._edges.remove(r),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(t==null||e.uid!==t.uid)return;const r=ljt.createView(e.locations),n=new Array(r.count),s=gr(),o=gr();for(let u=0;uPromise.resolve().then(()=>GBn).then(e=>e.i).then(({default:e})=>{const t=e({locateFile:snn,onRuntimeInitialized:()=>i(t)});delete t.then})).catch(i=>{throw i})),DPe}function snn(i){return Fl(`esri/libs/i3s/${i}`)}let DPe;function qS(i,e,t,r){if(_0(i.spatialReference,t)){ipe[0]=i.x,ipe[1]=i.y;const s=i.z;return ipe[2]=s??r??0,sy(ipe,i.spatialReference,0,e,t,0,1)}const n=CW(i,t);return!!n&&(e[0]=n?.x,e[1]=n?.y,e[2]=n?.z??r??0,!0)}const ipe=gr();function onn(i,e,t,r){return{x:i,y:e,z:t,hasZ:t!=null,hasM:!1,spatialReference:r,type:"point"}}onn(0,0,0,Xi.WGS84);var Wbe;(function(i){i[i.INVISIBLE=0]="INVISIBLE",i[i.TRANSPARENT=1]="TRANSPARENT",i[i.OPAQUE=2]="OPAQUE"})(Wbe||(Wbe={}));function ann(i){return{...lnn,...i,type:"solid"}}const lnn={color:Vb(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:Wbe.OPAQUE,hasSlicePlane:!1};Vb(0,0,0,.2),Wbe.OPAQUE;var LC;(function(i){i[i.Multiply=1]="Multiply",i[i.Ignore=2]="Ignore",i[i.Replace=3]="Replace",i[i.Tint=4]="Tint"})(LC||(LC={}));Wo();var gyt;async function rHt(i,e,t,r,n,s,o,a){const l=[];for(const h of e)if(h&&n.includes(h.name)){const p=`${i}/nodes/${t}/attributes/${h.key}/0`;l.push({url:p,storageInfo:h})}const u=await Promise.allSettled(l.map(h=>zi(h.url,{responseType:"array-buffer",query:{...o,token:s},signal:a?.signal}).then(p=>wVt(h.storageInfo,p.data)))),c=[];for(const h of r){const p={};for(let m=0;m0)throw new Error(`i3s.wasm: ${o.error}`);const a=o.featureIds?.length>0?o.featureIds.slice():null,l=o.positions.slice();return a&&e.push(a.buffer),e.push(l.buffer),{result:{positions:l,featureIds:a},transferList:e}}async function fnn(i){await fX(),oHt(i);const e={buffer:i.buffer};return{result:e,transferList:[e.buffer]}}async function mnn(i){await fX(),nHt(i)}async function gnn(i){oh=await fX(),oh.setLegacySchema(i.context,i.jsonSchema)}async function ynn(i){const{localMatrix:e,origin:t,positions:r,vertexSpace:n,localMode:s}=i,o=Xi.fromJSON(i.inSpatialReference),a=Xi.fromJSON(i.outSpatialReference);let l;if(n.type==="georeferenced"&&n.origin==null){const[{projectBuffer:m},{initializeProjection:v}]=await Promise.all([Promise.resolve().then(()=>sar),Promise.resolve().then(()=>gar)]);await v(o,a),l=new Float64Array(r.length),m(r,o,0,l,a,0,l.length/3)}else{const m=n.type==="georeferenced"?UC.fromJSON(n):lH.fromJSON(n),{project:v}=await Promise.resolve().then(()=>vzr);l=DUr(v({positions:r,transform:e?{localMatrix:e}:void 0,vertexSpace:m,inSpatialReference:o,outSpatialReference:a,localMode:s}))}const u=l.length,[c,h,p]=t;for(let m=0;mZ.some(ae=>ae.name==="color")),normal:e.needNormals&&e.layouts.some(Z=>Z.some(ae=>ae.name==="normalCompressed")),uv0:e.layouts.some(Z=>Z.some(ae=>ae.name==="uv0")),uvRegion:e.layouts.some(Z=>Z.some(ae=>ae.name==="uvRegion")),featureIndex:k.featureIndex},$=i.process(r,!!e.obbData,m,S.byteLength,k,B,w,l,h,p,e.normalReferenceFrame);if(i._free(w),i._free(m),$.error.length>0)throw new Error(`i3s.wasm: ${$.error}`);if($.discarded)return null;const V=$.componentOffsets.length>0?$.componentOffsets.slice():null,Y=$.featureIds.length>0?$.featureIds.slice():null,K=$.anchorIds.length>0?Array.from($.anchorIds):null,Q=$.anchors.length>0?Array.from($.anchors):null,re=$.interleavedVertedData.slice().buffer,ne=$.indicesType===Hbe.Int16?new Uint16Array($.indices.buffer,$.indices.byteOffset,$.indices.byteLength/2).slice():new Uint32Array($.indices.buffer,$.indices.byteOffset,$.indices.byteLength/4).slice(),de=$.positions.slice(),pe=$.positionIndicesType===Hbe.Int16?new Uint16Array($.positionIndices.buffer,$.positionIndices.byteOffset,$.positionIndices.byteLength/2).slice():new Uint32Array($.positionIndices.buffer,$.positionIndices.byteOffset,$.positionIndices.byteLength/4).slice(),H={layout:e.layouts[0],interleavedVertexData:re,indices:ne,hasColors:$.hasColors,hasModifications:$.hasModifications,positionData:{data:de,indices:pe}};return Y&&t.push(Y.buffer),V&&t.push(V.buffer),t.push(re),t.push(ne.buffer),t.push(de.buffer),t.push(pe.buffer),{componentOffsets:V,featureIds:Y,anchorIds:K,anchors:Q,transformedGeometry:H,obb:$.obb}}function bnn(i){return i===0?lV.Unmodified:i===1?lV.PotentiallyModified:i===2?lV.Culled:lV.Unknown}function oHt(i){if(!oh)return;const{context:e,buffer:t}=i,r=oh._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(oh.HEAPU8.buffer,r,n),o=new Float64Array(t);s.set(o),oh.filterOBBs(e,r,n),o.set(s),oh._free(r)}function aHt(i){oh&&oh.destroy(i)===0&&(oh=null)}function npe(i,e){for(let t=0;t(oh=i,rpe=null,oh))),rpe)}const xnn={transform:(i,e)=>oh&&sHt(oh,i,e),destroy:aHt},Snn=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:_nn,dracoDecompressPointCloudData:pnn,filterObbsForModifications:fnn,filterObbsForModificationsSync:oHt,initialize:wnn,interpretObbModificationResults:bnn,process:dnn,project:ynn,setLegacySchema:gnn,setModifications:mnn,setModificationsSync:nHt,test:xnn,transformNormals:vnn},Symbol.toStringTag,{value:"Module"}));function Ik(i,e){if(i&&e){for(const t of i.children)if(t.localName in e){const r=e[t.localName];if(typeof r=="function"){const n=r(t);n&&Ik(t,n)}else Ik(t,r)}}}function*_H(i,e){for(const t of i.children)if(t.localName in e){const r=e[t.localName];typeof r=="function"?yield r(t):yield*_H(t,r)}}const FPe="xlink:href",Rq="2.0.0",LBe="__esri_wfs_id__",Tnn="wfs-layer:getWFSLayerTypeInfo-error",Cnn="wfs-layer:empty-service",lHt="wfs-layer:feature-type-not-found",Enn="wfs-layer:geojson-not-supported",Inn="wfs-layer:kvp-encoding-not-supported",Ann="wfs-layer:malformed-json",uHt="wfs-layer:unknown-geometry-type",Mnn="wfs-layer:unknown-field-type",Onn="wfs-layer:unsupported-spatial-reference",Pnn="wfs-layer:unsupported-wfs-version";async function Rnn(i,e){const t=Dnn((await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:Rq,...e?.customParameters},signal:e?.signal})).data);return Lnn(i,t),t}function Dnn(i){const e=pHt(i);Ynn(e),fHt(e);const t=e.firstElementChild,r=TVi(Nnn(t));return{operations:knn(t),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}const Fnn=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function wyt(i){for(const e of Fnn){const t=i.findIndex(r=>r.toLowerCase()===e);if(t>=0)return i[t]}return null}function knn(i){let e=!1;const t={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},r=[],n=[];if(Ik(i,{OperationsMetadata:{Parameter:s=>{if(s.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:o})=>{o&&r.push(o)}}}},Operation:s=>{switch(s.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:o=>{t.GetCapabilities.url=o.getAttribute(FPe)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:o=>{t.DescribeFeatureType.url=o.getAttribute(FPe)}}}};case"GetFeature":return{DCP:{HTTP:{Get:o=>{t.GetFeature.url=o.getAttribute(FPe)}}},Parameter:o=>{if(o.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:a})=>{a&&n.push(a)}}}}}}},Constraint:s=>{switch(s.getAttribute("name")){case"KVPEncoding":return{DefaultValue:o=>{e=o.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:o=>{t.GetFeature.supportsPagination=o.textContent.toLowerCase()==="true"}}}}}}),t.GetFeature.outputFormat=wyt(n)??wyt(r),!e)throw new qe(Inn,"WFS service doesn't support key/value pair (KVP) encoding");if(t.GetFeature.outputFormat==null)throw new qe(Enn,"WFS service doesn't support GeoJSON output format");return t}function Lnn(i,e){eEt(i)&&(_v(i,e.operations.DescribeFeatureType.url,!0)&&(e.operations.DescribeFeatureType.url=wne(e.operations.DescribeFeatureType.url)),_v(i,e.operations.GetFeature.url,!0)&&(e.operations.GetFeature.url=wne(e.operations.GetFeature.url)))}function xyt(i){const e=parseInt(i.textContent?.match(/(?\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(e))return e}function Nnn(i){return _H(i,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},r=new Set;return Ik(e,{Name:n=>{const{name:s,prefix:o}=loe(n.textContent);t.typeName=`${o}:${s}`,t.name=s,t.namespacePrefix=o,t.namespaceUri=n.lookupNamespaceURI(o)},Abstract:n=>{t.description=n.textContent},Title:n=>{t.title=n.textContent},WGS84BoundingBox:n=>{t.extent=$nn(n)},DefaultCRS:n=>{const s=xyt(n);s&&(t.defaultSpatialReference=s,r.add(s))},OtherCRS:n=>{const s=xyt(n);s&&r.add(s)}}),t.title||(t.title=t.name),r.add(4326),t.supportedSpatialReferences.push(...r),t}}})}function $nn(i){let e,t,r,n;for(const s of i.children)switch(s.localName){case"LowerCorner":[e,t]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[r,n]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:Yp}}function cHt(i,e,t){return die(i,r=>t?r.name===e&&r.namespaceUri===t:r.typeName===e||r.name===e)}async function Bnn(i,e,t,r={}){const{featureType:n,extent:s}=await jnn(i,e,t,r),{spatialReference:o}=mHt(i.operations.GetFeature.url,n,r.spatialReference),{fields:a,geometryType:l,swapXY:u,objectIdField:c,geometryField:h}=await Gnn(i,n,o,r);return{url:i.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:a,geometryField:h,geometryType:l,objectIdField:c,spatialReference:r.spatialReference??new Xi({wkid:n.defaultSpatialReference}),extent:s,swapXY:u,wfsCapabilities:i,customParameters:r.customParameters}}async function jnn(i,e,t,r={}){const n=i.readFeatureTypes(),s=e?cHt(n,e,t):n.next().value,{spatialReference:o=new Xi({wkid:s?.defaultSpatialReference})}=r;if(s==null)throw e?new qe(lHt,`The type '${e}' could not be found in the service`):new qe(Cnn,"The service is empty");let a=new hr({...s.extent,spatialReference:Xi.WGS84});if(!Ya(a.spatialReference,o))try{await Lx(a.spatialReference,o,void 0,r),a=Wc(a,o)}catch{throw new qe(Onn,"Projection not supported")}return{extent:a,spatialReference:o,featureType:s}}async function Gnn(i,e,t,r={}){const{typeName:n}=e,[s,o]=await Promise.allSettled([znn(i.operations.DescribeFeatureType.url,n,r),Unn(i,n,t,r)]),a=p=>new qe(Tnn,`An error occurred while getting info about the feature type '${n}'`,{error:p});if(s.status==="rejected")throw a(s.reason);if(o.status==="rejected")throw a(o.reason);const{fields:l,errors:u}=s.value??{},c=s.value?.geometryType||o.value?.geometryType,h=o.value?.swapXY??!1;if(c==null)throw new qe(uHt,`The geometry type could not be determined for type '${n}`,{typeName:n,geometryType:c,fields:l,errors:u});return{...hHt(l??[]),geometryType:c,swapXY:h}}function hHt(i){const e=i.find(r=>r.type==="geometry");let t=i.find(r=>r.type==="oid");return i=i.filter(r=>r.type!=="geometry"),t||(t=new Fo({name:LBe,type:"oid",alias:LBe}),i.unshift(t)),{geometryField:e?.name??null,objectIdField:t.name,fields:i}}async function Unn(i,e,t,r={}){let n,s=!1;const[o,a]=await Promise.all([NBe(i.operations.GetFeature.url,e,t,i.operations.GetFeature.outputFormat,{...r,count:1}),zi(i.operations.GetFeature.url,{responseType:"text",query:dHt(e,t,void 0,{...r,count:1}),signal:r?.signal})]),l=o.type==="FeatureCollection"&&o.features[0]?.geometry;if(l){let u;switch(n=Vp.fromJSON(pbe(l.type)),l.type){case"Point":u=l.coordinates;break;case"LineString":case"MultiPoint":u=l.coordinates[0];break;case"MultiLineString":case"Polygon":u=l.coordinates[0][0];break;case"MultiPolygon":u=l.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(a.data);if(c){const h=u[0].toFixed(3),p=u[1].toFixed(3),m=parseFloat(c[1]).toFixed(3);h===parseFloat(c[2]).toFixed(3)&&p===m&&(s=!0)}}return{geometryType:n,swapXY:s}}async function znn(i,e,t){return Vnn(e,(await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:Rq,TYPENAME:e,TYPENAMES:e,...t?.customParameters},signal:t?.signal})).data)}function Vnn(i,e){const{name:t}=loe(i),r=pHt(e);fHt(r);const n=die(_H(r.firstElementChild,{element:s=>s}),s=>s.getAttribute("name")===t);if(n!=null){const s=n.getAttribute("type"),o=s?die(_H(r.firstElementChild,{complexType:a=>a}),a=>a.getAttribute("name")===loe(s).name):die(_H(n,{complexType:a=>a}),()=>!0);if(o)return Wnn(o)}throw new qe(lHt,`Type '${i}' not found in document`,{document:new XMLSerializer().serializeToString(r)})}const Hnn=new Set(["objectid","fid"]);function Wnn(i){const e=[],t=[];let r;const n=_H(i,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of n){const o=s.getAttribute("name");if(!o)continue;let a,l;if(s.hasAttribute("type")?a=loe(s.getAttribute("type")).name:Ik(s,{simpleType:{restriction:h=>(a=loe(h.getAttribute("base")).name,{maxLength:p=>{l=+p.getAttribute("value")}})}}),!a)continue;const u=s.getAttribute("nillable")==="true";let c=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":t.push(new Fo({name:o,alias:o,type:"integer",nullable:u,length:s8("integer")}));break;case"float":case"double":case"decimal":t.push(new Fo({name:o,alias:o,type:"double",nullable:u,length:s8("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":t.push(new Fo({name:o,alias:o,type:"string",nullable:u,length:l??s8("string")}));break;case"datetime":case"date":t.push(new Fo({name:o,alias:o,type:"date",nullable:u,length:l??s8("date")}));break;case"pointpropertytype":r="point",c=!0;break;case"multipointpropertytype":r="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,e.push(new qe(uHt,`geometry type '${a}' is not supported`,{type:new XMLSerializer().serializeToString(i)}));break;default:e.push(new qe(Mnn,`Unknown field type '${a}'`,{type:new XMLSerializer().serializeToString(i)}))}c&&t.push(new Fo({name:o,alias:o,type:"geometry",nullable:u}))}for(const s of t)if(s.type==="integer"&&!s.nullable&&Hnn.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:r,fields:t,errors:e}}async function NBe(i,e,t,r,n){let{data:s}=await zi(i,{responseType:"text",query:dHt(e,t,r,n),signal:n?.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(o){throw new qe(Ann,"Error while parsing the response",{response:s,error:o})}}function dHt(i,e,t,r){const n=typeof e=="number"?e:e.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:Rq,TYPENAMES:i,OUTPUTFORMAT:t,SRSNAME:"EPSG:"+n,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function qnn(i,e,t){const r=await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:Rq,TYPENAMES:e,RESULTTYPE:"hits",...t?.customParameters},signal:t?.signal}),n=/numberMatched=["'](?\d+)["']/gi.exec(r.data);if(n?.groups)return+n.groups.numberMatched}function pHt(i){return new DOMParser().parseFromString(i.trim(),"text/xml")}function loe(i){const[e,t]=i.split(":");return{prefix:t?e:"",name:t??e}}function Ynn(i){const e=i.firstElementChild?.getAttribute("version");if(e&&e!==Rq)throw new qe(Pnn,`Unsupported WFS version ${e}. Supported version: ${Rq}`)}function fHt(i){let e="",t="";if(Ik(i.firstElementChild,{Exception:r=>(e=r.getAttribute("exceptionCode"),{ExceptionText:n=>{t=n.textContent}})}),e)throw new qe(`wfs-layer:${e}`,t)}function mHt(i,e,t){const r={wkid:e.defaultSpatialReference},n=t?.wkid!=null?{wkid:t.wkid}:r;return{spatialReference:n,getFeatureSpatialReference:pOt(i)||n.wkid&&e.supportedSpatialReferences.includes(n.wkid)?{wkid:n.wkid}:{wkid:e.defaultSpatialReference}}}const Syt="esri.layers.WFSLayer";let Xnn=class{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:r,getFeatureOutputFormat:n,fields:s,geometryType:o,featureType:a,maxRecordCount:l,maxTotalRecordCount:u,maxPageCount:c,objectIdField:h,customParameters:p}=e,{spatialReference:m,getFeatureSpatialReference:v}=mHt(r,a,e.spatialReference);try{await Gv(v,m)}catch{throw new qe("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:m})}hn(t),this._customParameters=p,this._featureType=a,this._fieldsIndex=Cd.fromLayerJSON({fields:s,dateFieldsTimeReference:s.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:y0}:null}),this._geometryType=o,this._getFeatureUrl=r,this._getFeatureOutputFormat=n,this._getFeatureSpatialReference=v,this._maxRecordCount=l,this._maxTotalRecordCount=u,this._maxPageCount=c,this._objectIdField=h,this._spatialReference=m;let w=await this._snapshotFeatures(t);if(w.errors.length>0&&(this._supportsPagination=!1,w=await this._snapshotFeatures(t),w.errors.length>0))throw w.errors[0];return this._queryEngine=new lL({fieldsIndex:this._fieldsIndex,geometryType:o,hasM:!1,hasZ:!1,objectIdField:h,spatialReference:m,timeInfo:null,featureStore:new rX({geometryType:o,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(w.features),{warnings:Tyt(w),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new qe("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=pE(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const r of Tyt(t))di.getLogger(Syt).warn(new Rf("wfs-layer:refresh-warning",r.message,r.details));t.errors?.length&&di.getLogger(Syt).warn(new Rf("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,r=this._maxTotalRecordCount,n=this._maxPageCount,s=this._supportsPagination?await qnn(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let o=[];const a=[];if(s==null)try{o=await this._singleQuery(t)}catch(l){mo(l)||a.push(l)}else{const l=Math.min(s,r),u=Jnn(this,Math.max(1,Math.min(Math.ceil(l/this._maxRecordCount),n)),t);await Promise.allSettled(Array.from({length:10}).map(()=>Knn(u,o,a)))}return hn(t),{features:o,totalRecordCount:s,maxTotalRecordCount:r,maxPageCount:n,errors:a}}async _singleQuery(e){const t=await NBe(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const r=e*this._maxRecordCount,n=await NBe(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:r,count:this._maxRecordCount,signal:t});return this._processGeoJSON(n,{startIndex:r,signal:t})}_processGeoJSON(e,t){aJe(e,this._getFeatureSpatialReference.wkid);const{startIndex:r,signal:n}=t;hn(n);const s=lJe(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!Ya(this._spatialReference,this._getFeatureSpatialReference))for(const a of s)a.geometry!=null&&(a.geometry=Z2(Sf(KC(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let o=r??1;for(const a of s){const l={};RF(this._fieldsIndex,l,a.attributes,!0),a.attributes=l,l[this._objectIdField]==null&&(a.objectId=l[this._objectIdField]=o++)}return s}};function*Jnn(i,e,t){for(let r=0;ri.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${i.totalRecordCount} features exceeds the maximum allowed of ${i.maxTotalRecordCount}.`,details:{recordCount:i.features.length,totalRecordCount:i.totalRecordCount,maxTotalRecordCount:i.maxTotalRecordCount}})),e}const Znn=Object.freeze(Object.defineProperty({__proto__:null,default:Xnn},Symbol.toStringTag,{value:"Module"}));var ng,up,uf;(function(i){i[i.FILL=1]="FILL",i[i.LINE=2]="LINE",i[i.SYMBOL=3]="SYMBOL",i[i.CIRCLE=4]="CIRCLE"})(ng||(ng={})),function(i){i[i.BACKGROUND=0]="BACKGROUND",i[i.FILL=1]="FILL",i[i.OUTLINE=2]="OUTLINE",i[i.LINE=3]="LINE",i[i.ICON=4]="ICON",i[i.CIRCLE=5]="CIRCLE",i[i.TEXT=6]="TEXT",i[i.TILEINFO=7]="TILEINFO"}(up||(up={})),function(i){i[i.PAINTER_CHANGED=0]="PAINTER_CHANGED",i[i.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",i[i.LAYER_CHANGED=2]="LAYER_CHANGED",i[i.LAYER_REMOVED=3]="LAYER_REMOVED",i[i.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(uf||(uf={}));function Qnn(i){return i===746||i===747||!(i<4352)&&(i>=12704&&i<=12735||i>=12544&&i<=12591||i>=65072&&i<=65103&&!(i>=65097&&i<=65103)||i>=63744&&i<=64255||i>=13056&&i<=13311||i>=11904&&i<=12031||i>=12736&&i<=12783||i>=12288&&i<=12351&&!(i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=12800&&i<=13055||i>=12592&&i<=12687||i>=43360&&i<=43391||i>=55216&&i<=55295||i>=4352&&i<=4607||i>=44032&&i<=55215||i>=12352&&i<=12447||i>=12272&&i<=12287||i>=12688&&i<=12703||i>=12032&&i<=12255||i>=12784&&i<=12799||i>=12448&&i<=12543&&i!==12540||i>=65280&&i<=65519&&!(i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||i>=65104&&i<=65135&&!(i>=65112&&i<=65118||i>=65123&&i<=65126)||i>=5120&&i<=5759||i>=6320&&i<=6399||i>=65040&&i<=65055||i>=19904&&i<=19967||i>=40960&&i<=42127||i>=42128&&i<=42191)}function esn(i){return!(i<11904)&&(i>=12704&&i<=12735||i>=12544&&i<=12591||i>=65072&&i<=65103||i>=63744&&i<=64255||i>=13056&&i<=13311||i>=11904&&i<=12031||i>=12736&&i<=12783||i>=12288&&i<=12351||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=12800&&i<=13055||i>=65280&&i<=65519||i>=12352&&i<=12447||i>=12272&&i<=12287||i>=12032&&i<=12255||i>=12784&&i<=12799||i>=12448&&i<=12543||i>=65040&&i<=65055||i>=42128&&i<=42191||i>=40960&&i<=42127)}function tsn(i){switch(i){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Cyt(i){switch(i){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const vA=24,gHt=17;let yHt=class{constructor(e,t,r,n,s,o,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=r,this._letterSpacing=n,this._hAnchor=s,this._vAnchor=o,this._justify=a}getShaping(e,t,r){const n=this._letterSpacing,s=this._lineHeight,o=this._justify,a=this._maxWidth,l=[];let u=0,c=0;for(const L of e){const k=L.codePointAt(0);if(k==null)continue;const B=r&&Qnn(k);let $;for(const V of this._glyphItems)if($=V[k],$)break;l.push({codePoint:k,x:u,y:c,vertical:B,glyphMosaicItem:$}),$&&(u+=$.metrics.advance+n)}let h=u;a>0&&(h=u/Math.max(1,Math.ceil(u/a)));const p=e.includes("​"),m=[],v=l.length;for(let L=0;LB&&Cyt(l[$].codePoint);)l[$].glyphMosaicItem=null,--$;if(B<=$){const V=l[B].x;for(let K=B;K<=$;K++)l[K].x-=V,l[K].y=c;let Y=l[$].x;l[$].glyphMosaicItem&&(Y+=l[$].glyphMosaicItem.metrics.advance),S=Math.max(Y,S),o&&this._applyJustification(l,B,$)}R=k,c+=I}if(l.length>0){const L=w.length-1,k=(o-this._hAnchor)*S;let B=(-this._vAnchor*(L+1)+.5)*s;t&&L&&(B+=L*s);for(const $ of l)$.x+=k,$.y+=B}return l.filter(L=>L.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let r=1/0,n=1/0,s=0,o=0;for(const a of e){const l=a.glyphMosaicItem.metrics.advance,u=a.x,c=a.y-gHt,h=u+l,p=c+t;r=Math.min(r,u),s=Math.max(s,h),n=Math.min(n,c),o=Math.max(o,p)}return{x:r,y:n,width:s-r,height:o-n}}static getBox(e){if(!e.length)return null;let t=1/0,r=1/0,n=0,s=0;for(const o of e){const{height:a,left:l,top:u,width:c}=o.glyphMosaicItem.metrics,h=o.x,p=o.y-(a-Math.abs(u)),m=h+c+l,v=p+a;t=Math.min(t,h),n=Math.max(n,m),r=Math.min(r,p),s=Math.max(s,v)}return{x:t,y:r,width:n-t,height:s-r}}static addDecoration(e,t){const r=e.length;if(r===0)return;const n=3;let s=e[0].x+e[0].glyphMosaicItem.metrics.left,o=e[0].y;for(let l=1;l=0&&a,m=n.allowOverlap&&n.ignorePlacement?null:[],v=[],w=4,S=!p;let I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,L=I,k=R;const B=(p||a)&&l,$=n.size/vA;let V=!1;for(const ne of t)if(ne.vertical){V=!0;break}let Y,K=0,Q=0;if(!p&&V){const ne=yHt.getTextBox(t,n.lineHeight*vA);switch(n.anchor){case ec.LEFT:K=ne.height/2,Q=-ne.width/2;break;case ec.RIGHT:K=-ne.height/2,Q=ne.width/2;break;case ec.TOP:K=ne.height/2,Q=ne.width/2;break;case ec.BOTTOM:K=-ne.height/2,Q=-ne.width/2;break;case ec.TOP_LEFT:K=ne.height;break;case ec.BOTTOM_LEFT:Q=-ne.width;break;case ec.TOP_RIGHT:Q=ne.width;break;case ec.BOTTOM_RIGHT:K=-ne.height}}K+=n.offset[0]*vA,Q+=n.offset[1]*vA;for(const ne of t){const de=ne.glyphMosaicItem;if(!de||de.rect.isEmpty)continue;const pe=de.rect,H=de.metrics,Z=de.page;if(m&&S){if(Y!==void 0&&Y!==ne.y){let vt,At,Je,it;V?(vt=-k+K,At=I+Q,Je=k-L,it=R-I):(vt=I+K,At=L+Q,Je=R-I,it=k-L);const Ue={xTile:e.x,yTile:e.y,dxPixels:vt*$-u,dyPixels:At*$-u,hard:!n.optional,partIndex:1,width:Je*$+2*u,height:it*$+2*u,angle:o,minLod:W6,maxLod:fA};m.push(Ue),I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,L=I,k=R}Y=ne.y}const ae=[];if(p){const vt=.5*de.metrics.width,At=(ne.x+H.left-w+vt)*$*ite;if(c=this._placeGlyph(e,c,At,r,e.segment,1,ne.vertical,Z,ae),l&&(c=this._placeGlyph(e,c,At,r,e.segment,-1,ne.vertical,Z,ae)),c>=kPe)break}else ae.push(new ope(s,h,h,Z,!1)),a&&l&&ae.push(new ope(s,h+H5,h+H5,Z,!1));const fe=ne.x+H.left,be=ne.y-gHt-H.top,_e=fe+H.width,Ie=be+H.height;let Te,Be,Ve,$e,tt,yt,Ct,ot;if(!p&&V)if(ne.vertical){const vt=(fe+_e)/2-H.height/2,At=(be+Ie)/2+H.width/2;Te=new Po(-At-w+K,vt-w+Q),Be=new Po(Te.x+pe.width,Te.y+pe.height),Ve=new Po(Te.x,Be.y),$e=new Po(Be.x,Te.y)}else Te=new Po(-be+w+K,fe-w+Q),Be=new Po(Te.x-pe.height,Te.y+pe.width),Ve=new Po(Be.x,Te.y),$e=new Po(Te.x,Be.y);else Te=new Po(fe-w+K,be-w+Q),Be=new Po(Te.x+pe.width,Te.y+pe.height),Ve=new Po(Te.x,Be.y),$e=new Po(Be.x,Te.y);for(const vt of ae){let At,Je,it,Ue;if(vt.alternateVerticalGlyph){if(!tt){const ke=(be+Ie)/2+Q;tt=new Po((fe+_e)/2+K-H.height/2-w,ke+H.width/2+w),yt=new Po(tt.x+pe.height,tt.y-pe.width),Ct=new Po(yt.x,tt.y),ot=new Po(tt.x,yt.y)}At=tt,Je=Ct,it=ot,Ue=yt}else At=Te,Je=Ve,it=$e,Ue=Be;const ct=be,st=Ie,Ze=vt.glyphAngle+o;if(Ze!==0){const ke=Math.cos(Ze),me=Math.sin(Ze);At=At.clone(),Je=Je?.clone(),it=it?.clone(),Ue=Ue?.clone(),At.rotate(ke,me),Ue?.rotate(ke,me),Je?.rotate(ke,me),it?.rotate(ke,me)}let ye=0,Ke=256;if(p&&V?ne.vertical?vt.alternateVerticalGlyph?(ye=32,Ke=96):(ye=224,Ke=32):(ye=224,Ke=96):(ye=192,Ke=64),v.push(new Ayt(At,it,Je,Ue,pe,vt.labelAngle,ye,Ke,vt.anchor,vt.minzoom,vt.maxzoom,vt.page)),m&&(!B||this._legible(vt.labelAngle))){if(S)feR&&(R=_e),st>k&&(k=st);else if(vt.minzoom=kPe)return null;if(m&&S){let ne,de,pe,H;V?(ne=-k+K,de=I+Q,pe=k-L,H=R-I):(ne=I+K,de=L+Q,pe=R-I,H=k-L);const Z={xTile:e.x,yTile:e.y,dxPixels:ne*$-u,dyPixels:de*$-u,hard:!n.optional,partIndex:1,width:pe*$+2*u,height:H*$+2*u,angle:o,minLod:W6,maxLod:fA};m.push(Z)}const re=new Myt(v);return m&&m.length>0&&(re.textColliders=m),re}_legible(e){const t=eUt(e);return t<65||t>=193}_placeGlyph(e,t,r,n,s,o,a,l,u){let c=o;const h=c<0?Tbe(e.angle+H5,_mt):e.angle;let p=0;r<0&&(c*=-1,r*=-1,p=H5),c>0&&++s;let m=new Po(e.x,e.y),v=n[s],w=fA;if(n.length<=s)return w;for(;;){const S=v.x-m.x,I=v.y-m.y,R=Math.sqrt(S*S+I*I),L=Math.max(r/R,t),k=S/R,B=I/R,$=Tbe(Math.atan2(B,k)+p,_mt);if(u.push(new ope(m,h,$,l,!1,L,w)),a&&u.push(new ope(m,h,$,l,!0,L,w)),L<=t)return L;m=v.clone();do{if(s+=c,n.length<=s||s<0)return L;v=n[s]}while(m.isEqual(v));let V=v.x-m.x,Y=v.y-m.y;const K=Math.sqrt(V*V+Y*Y);V*=R/K,Y*=R/K,m.x-=V,m.y-=Y,w=L}}};var uV;(function(i){i[i.moveTo=1]="moveTo",i[i.lineTo=2]="lineTo",i[i.close=7]="close"})(uV||(uV={}));let $Be=class{constructor(e,t,r=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=r;const n=t.keys,s=t.values,o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:this.id=o.getUInt64();break;case 2:{const a=o.getMessage().asUnsafe(),l=this.values;for(;!a.empty();){const u=a.getUInt32(),c=a.getUInt32();l[n[u]]=s[c]}a.release();break}case 3:this.type=o.getUInt32();break;case 4:this._pbfGeometry=o.getMessage();break;default:o.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let r,n;this._pbfGeometry=null,e?e.reset(this.type):r=[];let s,o=uV.moveTo,a=0,l=0,u=0;for(;!t.empty();){if(a===0){const c=t.getUInt32();o=7&c,a=c>>3}switch(a--,o){case uV.moveTo:l+=t.getSInt32(),u+=t.getSInt32(),e?e.moveTo(l,u):r&&(n&&r.push(n),n=[],n.push(new Po(l,u)));break;case uV.lineTo:l+=t.getSInt32(),u+=t.getSInt32(),e?e.lineTo(l,u):n&&n.push(new Po(l,u));break;case uV.close:e?e.close():n&&!n[0].equals(l,u)&&n.push(n[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?s=e.result():r&&(n&&r.push(n),s=r),t.release(),this._geometry=s,s}},cg=class{constructor(e){this._array=[],e<=0&&console.error("strideInBytes must be positive!"),this._stride=e}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(e,t){return 65535&e|t<<16}static i8888to32(e,t,r,n){return 255&e|(255&t)<<8|(255&r)<<16|n<<24}static i8816to32(e,t,r){return 255&e|(255&t)<<8|r<<16}},qj=class extends cg{constructor(){super(12)}add(e,t,r){const n=this.array;n.push(e),n.push(t),n.push(r)}},BBe=class vHt{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(vHt._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}},ssn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a,l,u,c,h,p){const m=this.array;let v=cg.i1616to32(e,t);m.push(v);const w=31;v=cg.i8888to32(Math.round(w*r),Math.round(w*n),Math.round(w*s),Math.round(w*o)),m.push(v),v=cg.i8888to32(Math.round(w*a),Math.round(w*l),Math.round(w*u),Math.round(w*c)),m.push(v),v=cg.i1616to32(h,0),m.push(v),p&&m.push(...p)}},osn=class extends cg{constructor(e){super(e)}add(e,t,r){const n=this.array;n.push(cg.i1616to32(e,t)),r&&n.push(...r)}},asn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a){const l=this.array,u=this.index;let c=cg.i1616to32(e,t);l.push(c);const h=15;return c=cg.i8888to32(Math.round(h*r),Math.round(h*n),s,o),l.push(c),a&&l.push(...a),u}},Oyt=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a,l,u,c,h,p){const m=this.array;let v=cg.i1616to32(e,t);m.push(v),v=cg.i1616to32(Math.round(8*r),Math.round(8*n)),m.push(v),v=cg.i8888to32(s/4,o/4,l,u),m.push(v),v=cg.i8888to32(0,eUt(a),10*c,Math.min(10*h,255)),m.push(v),p&&m.push(...p)}},lsn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s){const o=this.array,a=cg.i1616to32(2*e+r,2*t+n);o.push(a),s&&o.push(...s)}},BCe=class{constructor(e,t,r){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=r,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,r){}},usn=class extends BCe{constructor(e,t,r,n,s){super(e,t,r),this.type=ng.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,r=this._circleIndexBuffer;this._circleIndexStart=3*r.index,this._circleIndexCount=0;const n=this.layer,s=this.zoom;e&&e.setExtent(this.layerExtent);for(const o of this._features){const a=o.getGeometry(e);if(!a)continue;const l=n.circleMaterial.encodeAttributes(o,s,n);for(const u of a)if(u)for(const c of u){const h=t.index;t.add(c.x,c.y,0,0,l),t.add(c.x,c.y,0,1,l),t.add(c.x,c.y,1,0,l),t.add(c.x,c.y,1,1,l),r.add(h,h+1,h+2),r.add(h+1,h+2,h+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let s=0;sk.page-B.page);for(const{ddFillAttributes:k,ddOutlineAttributes:B,page:$,geometry:V}of m)this._processFeature(V,c,t.outlineUsesFillColor,k,B,p,$)}}else for(const m of h){const v=o?n.encodeAttributes(m,r,t):null,w=c&&a?s.encodeAttributes(m,r,t):null,S=m.getGeometry(e);this._processFeature(S,c,t.outlineUsesFillColor,v,w,p)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,u]]of s)t[n++]=a,t[n++]=l,t[n++]=u;t[n++]=this._fillVertexBuffer.array.length;for(let a=0;ac?(h!==void 0&&this._processFill(e,h,n,o,a),h=[p]):m<-c&&h!==void 0&&h.push(p)}h!==void 0&&this._processFill(e,h,n,o,a)}_processOutline(e,t){const r=this._outlineVertexBuffer,n=this._outlineIndexBuffer,s=n.index;let o,a,l;const u=new Po(0,0),c=new Po(0,0),h=new Po(0,0);let p=-1,m=-1,v=-1,w=-1,S=-1,I=!1;const R=0;let L=e.length;if(L<2)return;const k=e[R];let B=e[L-1];for(;L&&B.isEqual(k);)--L,B=e[L-1];if(!(L-R<2)){for(let $=R;$8&&(Q=8),Y>=0?(v=r.add(a.x,a.y,u.x,u.y,0,1,t),w===-1&&(w=v),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,Q*-h.x,Q*-h.y,0,-1,t),S===-1&&(S=m),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=m,m=v,v=r.add(a.x,a.y,h.x,h.y,0,1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,c.x,c.y,0,1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v)):(v=r.add(a.x,a.y,Q*h.x,Q*h.y,0,1,t),w===-1&&(w=v),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,-u.x,-u.y,0,-1,t),S===-1&&(S=m),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=m,m=v,v=r.add(a.x,a.y,-h.x,-h.y,0,-1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=r.add(a.x,a.y,-c.x,-c.y,0,-1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v))}p>=0&&m>=0&&w>=0&&!I&&n.add(p,m,w),p>=0&&w>=0&&S>=0&&!I&&n.add(p,S,w),this._outlineIndexCount+=3*(n.index-s)}}_processFill(e,t,r,n,s){n=!0;let o;t.length>1&&(o=[]);let a=0;for(const h of t)a!==0&&o.push(a),a+=e[h].length;const l=2*a,u=Ky.acquire();for(const h of t){const p=e[h],m=p.length;for(let v=0;v0){const h=t.map(v=>e[v].length),{buffer:p,vertexCount:m}=iGt(u,h);if(m>0){const v=this._fillVertexBuffer.index;for(let w=0;w0){const p=this._fillVertexBuffer.index;let m=0;for(;m=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const r=e.length-1;for(let n=0;nne.page-de.page),s.textured=!0;for(const{ddAttributes:ne,page:de,cap:pe,join:H,miterLimit:Z,roundLimit:ae,halfWidth:fe,offset:be,geometry:_e}of re)s.capType=pe,s.joinType=H,s.miterLimit=Z,s.roundLimit=ae,s.halfWidth=fe,s.offset=be,this._processFeature(_e,ne,de)}else{if(l){const re=l.getValue(r);if(!this._spriteInfo[re]?.rect)return}s.textured=!(!l&&!u),s.capType=v,s.joinType=R,s.miterLimit=k,s.roundLimit=$,s.halfWidth=.5*Y,s.offset=Q;for(const re of n){const ne=o?a.encodeAttributes(re,r,t):null;m&&(s.capType=m.getValue(r,re)),I&&(s.joinType=I.getValue(r,re)),L&&(s.miterLimit=L.getValue(r,re)),B&&(s.roundLimit=B.getValue(r,re)),V&&(s.halfWidth=.5*V.getValue(r,re)),K&&(s.offset=K.getValue(r,re));const de=re.getGeometry(e);this._processFeature(de,ne)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,u]]of s)t[n++]=a,t[n++]=l,t[n++]=u;t[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,r,n,s,o,a,l,u,c,h)=>(i._lineVertexBuffer.add(e,t,a,l,r,n,s,o,u,c,h,i._ddValues),i._lineVertexBuffer.index-1),fsn=i=>(e,t,r)=>{i._lineIndexBuffer.add(e,t,r)};var qs,q6;(function(i){i[i.R8_SIGNED=0]="R8_SIGNED",i[i.R8_UNSIGNED=1]="R8_UNSIGNED",i[i.R16_SIGNED=2]="R16_SIGNED",i[i.R16_UNSIGNED=3]="R16_UNSIGNED",i[i.R8G8_SIGNED=4]="R8G8_SIGNED",i[i.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",i[i.R16G16_SIGNED=6]="R16G16_SIGNED",i[i.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",i[i.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",i[i.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",i[i.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",i[i.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",i[i.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(qs||(qs={})),function(i){i[i.UNIFORM=0]="UNIFORM",i[i.DATA_DRIVEN=1]="DATA_DRIVEN",i[i.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",i[i.UNUSED=3]="UNUSED"}(q6||(q6={}));let cL=class jBe{constructor(e){this._locations=new Map,this._key=e}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(e,t,r,n,s){const o=this.getUniforms();for(const a of o){const{name:l,type:u,getValue:c}=a,h=c(r,t,n,s);if(h!==null)switch(u){case"float":e.setUniform1f(l,h);break;case"vec2":e.setUniform2fv(l,h);break;case"vec4":e.setUniform4fv(l,h)}}}encodeAttributes(e,t,r,n){const s=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,u=0;for(const c of Object.keys(o)){const h=o[c],{type:p,precisionFactor:m,isLayout:v}=s[c],w=v?r.getLayoutProperty(c):r.getPaintProperty(c),S=w.interpolator?.getInterpolationRange(t);let I=0;for(const R of h){const{offset:L,bufferElementsToAdd:k}=R;if(k>0){for(let $=0;$4)n++,V={dataIndex:n,count:0,offset:0},L!==4&&(r[$]=V),e.push({location:-1,name:"a_data_"+n,count:L,type:I,normalized:k}),Y=Math.ceil(Math.max(B/4,1));else{const K=e[V.dataIndex];K.count+=L,Y=Math.ceil(Math.max(K.count*R/4,1))-Math.ceil(Math.max(V.offset/4,1))}v.push({dataIndex:V.dataIndex,offset:V.offset,bufferElementsToAdd:Y}),V.offset+=B,V.count+=L}}for(const h of e)switch(h.type){case Ti.BYTE:case Ti.UNSIGNED_BYTE:h.count=4;break;case Ti.SHORT:case Ti.UNSIGNED_SHORT:h.count+=h.count%2}this._buildVertexBufferLayout(e);let l=0;const u=this._layoutInfo.geometry;for(const h of u)this._locations.set(h.name,l++);const c=this._layoutInfo.opacity;if(c)for(const h of c)this._locations.set(h.name,l++);this._buildShaderInfo(e,t),this._propertyEncodingInfo=t}_buildVertexBufferLayout(e){const t={},r=this.geometryInfo();let n=r[0].stride;if(e.length===0)t.geometry=r;else{const s=[];let o=n;for(const a of e)n+=Pyt(a.type)*a.count;for(const a of r)s.push(new Vl(a.name,a.count,a.type,a.offset,n,a.normalized));for(const a of e)s.push(new Vl(a.name,a.count,a.type,o,n,a.normalized)),o+=Pyt(a.type)*a.count;t.geometry=s}this.opacityInfo()&&(t.opacity=this.opacityInfo()),this._layoutInfo=t,this._stride=n}_buildShaderInfo(e,t){let r=` +${t}`)}return e}addUpdateTracking(e,t){const r=Ki(()=>t.updating,n=>this._idToUpdatingState.set(e,n),{sync:!0});this.addHandles(r)}addPromise(e){return this._updatingHandles.addPromise(e)}};x([D({constructOnly:!0})],E8.prototype,"debugName",void 0),x([D({readOnly:!0})],E8.prototype,"updating",null),E8=x([Qe("esri.view.2d.layers.support.UpdateTracking2D")],E8);let mQr=class{constructor(e,t,r,n){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=r,this._connection=n,this._updateTracking=new E8({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new fQr(this._onChange)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy()}get _eventLog(){return this._connection.eventLog}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return xZr.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new lL({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:e.outSpatialReference,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._eventLog.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(NP(this._strategy?.load(e)))}onUnsubscribe(e){this._eventLog.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getOverride(e){return this._updateTracking.addPromise(this._doGetOverride(e))}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverrides(e,this.metadata)}async update(e,t){const r=e.source,n=nB(this._schema?.mutable,r.mutable);if(!n)return!1;if(yi("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=r,this._metadata=new OCe(this._schema.service.metadata),this._queryEngine?.destroy(),this._queryEngine=null,this._schema.type==="feature"&&this._schema.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this._schema.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),Znt(n,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if(r.type==="feature"&&Znt(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._eventLog.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._eventLog.onEvent({type:"updateFieldsEnd"})}catch(s){this._eventLog.onEvent({type:"updateFieldsError",error:s})}}return!1}return!(!Knt(n,"dataFilter")&&!Knt(n,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new yye(this._connection))}async _doGetOverride(e){return this._strategy.queryOverride(e)}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this._schema.service.source,t={...e.query,f:"json"},r=(await zi(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e=this.service,t="isSourceHosted"in e&&e.isSourceHosted,r=Array.isArray(e.source),n=e.source&&"collection"in e.source,s=t||r||n;if(this._schema.type==="stream"){const l=new pQr(this._schema.service,this._schema.mutable.dataFilter,this._store,{outSR:this._schema.mutable.dataFilter.outSpatialReference},this.metadata);return this._streamMessenger.strategy=l,l}const o=TZr.fromSchema(this._schema,this._metadata),a=await this._supportSnapshotMode(this._schema,o);return a?new rQr(this._schema.service,o,this._store,a.featureCount,this.metadata,this._eventLog):s?new iQr(this._schema.service,o,this._store,this.metadata,this._eventLog):new eQr(this._schema.service,o,this._store,this.metadata,this._eventLog)}async _updateStrategy(e){const t=await this._createStrategy();this._eventLog.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const n=Array.from(this._subscriptions.values());if(!n.length)return void this._eventLog.onEvent({type:"updateStrategyEnd"});const s=Promise.all(n.map(o=>this._strategy.load(o).then(()=>this._eventLog.onEvent({type:"loaded",tile:o.tile.id})).catch(a=>this._eventLog.onEvent({type:"error",tile:o.tile.id,error:a}))));this._updateTracking.addPromise(s);try{r&&await s}catch(o){l3(o)}this._eventLog.onEvent({type:"updateStrategyEnd"}),yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e.service,n=r.snapshotInfo;if(!n||!n.supportsSnapshotMinThreshold||!n.snapshotCountThresholds)return null;const s=e.service.source,o=t.createQuery();o.inner.orderByFields=[],o.inner.returnGeometry=!1;const a=(await PHe(s,o.inner,{query:o.customParameters})).data.count,{min:l,max:u}=n.snapshotCountThresholds;return a<=l||n.supportsSnapshotMaxThreshold&&athis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._handles.remove(),this._editState=null,this._tileInfoView=null}onDetach(){this.destroy(),this._initialize(this._connection)}_initialize(e){this._source=new mQr(this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),e),this._processor=new wZr(e,this._source),this._handles=j3([Ki(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})})])}set remoteClient(e){this._connection=new dHr(e),this._initialize(this._connection)}get features(){const e=this._source.queryEngine;if(!e)throw new qe("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor.aggregateQueryEngine;if(!e)throw new qe("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}async updateSchema(e,t){return yi("esri-2d-update-debug")&&this._updateSchemaState&&console.error("InternalError: Schema already updating"),this._updateSchemaState=new vQr(e,t),this._requestUpdate(),this._updateSchemaState.resolver.promise}updateSubscriptions(e){this._updateSubscriptionRequests.push(e),this._requestUpdate()}updateHighlight(e){this._updateHighlightRequests.push(e),this._requestUpdate()}async onEdits(e){if(this._editState!=null)throw new qe("InternalError - Already processing an edit");this._editState=new yQr(e);const t=this._editState.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(us(e.radius));let r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;const s=typeof e.fieldOffset=="string",o=e.fieldOffset??0,a=Array.from(this._subscriptions.values()),l=this._source.chunks(),u=t**2,c=3/(Math.PI*u),h=2*t,p=Math.ceil(xo/h);for(const m of a){const v=m.tile,w=new Float64Array(p*p);for(const S of l){const I=S.getTileReader(v);if(!I)continue;const R=I.getCursor();for(;R.next();){let L=1;if(e.field!=null){const Q=R.readAttribute(e.field);L=s?-1*+Q:+Q+o}const k=R.readXForDisplay()/h,B=R.readYForDisplay()/h,$=Math.floor(k),V=Math.floor(B);if($<0||V<0||$>=p||V>=p)continue;const Y=((.5+$-k)*h)**2+((.5+V-B)*h)**2;if(Y>u)continue;const K=L*(c*(1-Y/u)**2);w[V+$*p]+=K}}for(let S=0;Sl+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const l=[];return this._source.store.forEachUnsafe(u=>l.push(u.readLegacyFeatureWorldSpace())),l}return null}const r=new Set,n=[],s=t.map(l=>l.reader.getCursor()),o=new VC,a=3*e.sampleSize;for(let l=0;l=e.sampleSize?n:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,z9(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=this._doUpdate().finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t)){const s=this._subscriptions.get(t);return void(s.paused&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.resume`),s.resume(),s.version=e.version,this._source.onResume(s)))}yi("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new zNe(this._tileInfoView,t),n=new gQr(r,e.version);this._subscriptions.set(t,n),this._source.onSubscribe(n),this._processor.onSubscribe(n)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id),t.destroy())}_pauseSubscription(e){const t=this._subscriptions.get(e);t&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),t.pause())}async _doUpdate(){if(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const n=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const s of n)this._doUpdateSubscriptions(s)}const e=this._updateSchemaState;if(this._updateSchemaState=null,e!=null){const{schema:n,version:s}=e;await this._doUpdateSchema(n,s)}const t=this._editState;if(this._editState=null,t!=null){yi("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.edit);const n=await this._source.getOverride(t.edit);await this._processor.applyOverride(n),yi("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.edit)}if(this._updateHighlightRequests.length){const n=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const s of n)this._processor.updateHighlight(s)}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(yi("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),yi("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(n){l3(n)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(yi("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){if(yi("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const n=fu.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new ak(n)}const r={tileInfo:this._tileInfoView?.tileInfo};try{const n=await this._source.update(e,t),s=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,n,s)}catch(n){console.error(n)}yi("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){if(yi("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const t=fu.fromJSON(e.tileInfoJSON);this._tileInfoView=new ak(t)}for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t);if(yi("featurelayer-query-pausing-enabled"))for(const t of e.pause)this._pauseSubscription(t)}};const bQr=Object.freeze(Object.defineProperty({__proto__:null,default:_Qr},Symbol.toStringTag,{value:"Module"}));function kbe(){return new Float32Array(3)}function N9e(i){const e=new Float32Array(3);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e}function m7(i,e,t){const r=new Float32Array(3);return r[0]=i,r[1]=e,r[2]=t,r}function wQr(i,e){return new Float32Array(i,e,3)}function cVt(){return kbe()}function hVt(){return m7(1,1,1)}function dVt(){return m7(1,0,0)}function pVt(){return m7(0,1,0)}function fVt(){return m7(0,0,1)}const xQr=cVt(),SQr=hVt(),TQr=dVt(),CQr=pVt(),EQr=fVt();Object.freeze(Object.defineProperty({__proto__:null,ONES:SQr,UNIT_X:TQr,UNIT_Y:CQr,UNIT_Z:EQr,ZEROS:xQr,clone:N9e,create:kbe,createView:wQr,fromValues:m7,ones:hVt,unitX:dVt,unitY:pVt,unitZ:fVt,zeros:cVt},Symbol.toStringTag,{value:"Module"}));var $9e;let TU=$9e=class extends Ci{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new $9e({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};x([D({type:String,json:{write:!0}})],TU.prototype,"field",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],TU.prototype,"minValue",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],TU.prototype,"maxValue",void 0),TU=$9e=x([Qe("esri.renderers.support.pointCloud.ColorModulation")],TU);const IQr=TU,wPe=new Rs({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let bye=class extends Ci{};x([D({type:wPe.apiValues,readOnly:!0,nonNullable:!0,json:{type:wPe.jsonValues,read:!1,write:wPe.write}})],bye.prototype,"type",void 0),bye=x([Qe("esri.renderers.support.pointCloud.PointSizeAlgorithm")],bye);const QJe=bye;var B9e;let CU=B9e=class extends QJe{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new B9e({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};x([Wr({pointCloudFixedSizeAlgorithm:"fixed-size"})],CU.prototype,"type",void 0),x([D({type:Number,nonNullable:!0,json:{write:!0}})],CU.prototype,"size",void 0),x([D({type:Boolean,json:{write:!0}})],CU.prototype,"useRealWorldSymbolSizes",void 0),CU=B9e=x([Qe("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],CU);const AQr=CU;var j9e;let qee=j9e=class extends QJe{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new j9e({scaleFactor:this.scaleFactor})}};x([Wr({pointCloudSplatAlgorithm:"splat"})],qee.prototype,"type",void 0),x([D({type:Number,value:1,nonNullable:!0,json:{write:!0}})],qee.prototype,"scaleFactor",void 0),qee=j9e=x([Qe("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],qee);const MQr=qee,OQr={key:"type",base:QJe,typeMap:{"fixed-size":AQr,splat:MQr}},xPe=pa()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let mO=class extends Ci{constructor(e){super(e),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:li(this.pointSizeAlgorithm),colorModulation:li(this.colorModulation),pointsPerInch:li(this.pointsPerInch)}}};x([D({type:xPe.apiValues,readOnly:!0,nonNullable:!0,json:{type:xPe.jsonValues,read:!1,write:xPe.write}})],mO.prototype,"type",void 0),x([D({types:OQr,json:{write:!0}})],mO.prototype,"pointSizeAlgorithm",void 0),x([D({type:IQr,json:{write:!0}})],mO.prototype,"colorModulation",void 0),x([D({json:{write:!0},nonNullable:!0,type:Number})],mO.prototype,"pointsPerInch",void 0),mO=x([Qe("esri.renderers.PointCloudRenderer")],mO),function(i){i.fieldTransformTypeKebabDict=new Rs({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(mO||(mO={}));const a0=mO;var G9e;let N4=G9e=class extends Ci{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new G9e({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:li(this.color)})}};x([D({type:String,json:{write:!0}})],N4.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],N4.prototype,"label",void 0),x([D({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],N4.prototype,"minValue",void 0),x([D({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],N4.prototype,"maxValue",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],N4.prototype,"color",void 0),N4=G9e=x([Qe("esri.renderers.support.pointCloud.ColorClassBreakInfo")],N4);const PQr=N4;var U9e;let $4=U9e=class extends a0{constructor(i){super(i),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new U9e({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:li(this.colorClassBreakInfos),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],$4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],$4.prototype,"field",void 0),x([D({type:UA,json:{write:!0}})],$4.prototype,"legendOptions",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],$4.prototype,"fieldTransformType",void 0),x([D({type:[PQr],json:{write:!0}})],$4.prototype,"colorClassBreakInfos",void 0),$4=U9e=x([Qe("esri.renderers.PointCloudClassBreaksRenderer")],$4);const mVt=$4;var z9e;let B4=z9e=class extends a0{constructor(i){super(i),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new z9e({...this.cloneProperties(),field:li(this.field),fieldTransformType:li(this.fieldTransformType),stops:li(this.stops),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudStretchRenderer:"point-cloud-stretch"})],B4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],B4.prototype,"field",void 0),x([D({type:UA,json:{write:!0}})],B4.prototype,"legendOptions",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],B4.prototype,"fieldTransformType",void 0),x([D({type:[U3t],json:{write:!0}})],B4.prototype,"stops",void 0),B4=z9e=x([Qe("esri.renderers.PointCloudStretchRenderer")],B4);const gVt=B4;var V9e;let C$=V9e=class extends Ci{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new V9e({description:this.description,label:this.label,values:li(this.values),color:li(this.color)})}};x([D({type:String,json:{write:!0}})],C$.prototype,"description",void 0),x([D({type:String,json:{write:!0}})],C$.prototype,"label",void 0),x([D({type:[String],json:{write:!0}})],C$.prototype,"values",void 0),x([D({type:jr,json:{type:[ms],write:!0}})],C$.prototype,"color",void 0),C$=V9e=x([Qe("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],C$);const RQr=C$;var H9e;let j4=H9e=class extends a0{constructor(i){super(i),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new H9e({...this.cloneProperties(),field:li(this.field),fieldTransformType:li(this.fieldTransformType),colorUniqueValueInfos:li(this.colorUniqueValueInfos),legendOptions:li(this.legendOptions)})}};x([Wr({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],j4.prototype,"type",void 0),x([D({json:{write:!0},type:String})],j4.prototype,"field",void 0),x([D({type:a0.fieldTransformTypeKebabDict.apiValues,json:{type:a0.fieldTransformTypeKebabDict.jsonValues,read:a0.fieldTransformTypeKebabDict.read,write:a0.fieldTransformTypeKebabDict.write}})],j4.prototype,"fieldTransformType",void 0),x([D({type:[RQr],json:{write:!0}})],j4.prototype,"colorUniqueValueInfos",void 0),x([D({type:UA,json:{write:!0}})],j4.prototype,"legendOptions",void 0),j4=H9e=x([Qe("esri.renderers.PointCloudUniqueValueRenderer")],j4);const yVt=j4,pd=!0,I8={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function eKe(i,e,t){return{identifier:String.fromCharCode.apply(null,new Uint8Array(i,t+I8.identifierOffset,I8.identifierLength)),version:e.getUint16(t+I8.versionOffset,pd),checksum:e.getUint32(t+I8.checksumOffset,pd)}}const G_={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function DQr(i,e){return{sizeLo:i.getUint32(e+G_.sizeLo,pd),sizeHi:i.getUint32(e+G_.sizeHi,pd),minX:i.getFloat64(e+G_.minX,pd),minY:i.getFloat64(e+G_.minY,pd),minZ:i.getFloat64(e+G_.minZ,pd),maxX:i.getFloat64(e+G_.maxX,pd),maxY:i.getFloat64(e+G_.maxY,pd),maxZ:i.getFloat64(e+G_.maxZ,pd),errorX:i.getFloat64(e+G_.errorX,pd),errorY:i.getFloat64(e+G_.errorY,pd),errorZ:i.getFloat64(e+G_.errorZ,pd),count:i.getUint32(e+G_.count,pd),reserved:i.getUint32(e+G_.reserved,pd)}}function FQr(i){const e=new DataView(i,0);let t=0;const{identifier:r,version:n}=eKe(i,e,t);if(t+=I8.byteCount,r!=="LEPCC ")throw new qe("lepcc-decode-error","Bad identifier");if(n>1)throw new qe("lepcc-decode-error","Unknown version");const s=DQr(e,t);if(t+=G_.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const o=new Float64Array(3*s.count),a=[],l=[],u=[],c=[];if(t=Wde(i,t,a),t=Wde(i,t,l),t=Wde(i,t,u),t=Wde(i,t,c),t!==i.byteLength)throw new qe("lepcc-decode-error","Bad length");let h=0,p=0;for(let m=0;m>6;let l=0;if(a===0)l=r.getUint32(1,pd),e+=5;else if(a===1)l=r.getUint16(1,pd),e+=3;else{if(a!==2)throw new qe("lepcc-decode-error","Bad count type");l=r.getUint8(1),e+=2}if(o)throw new qe("lepcc-decode-error","LUT not implemented");const u=Math.ceil(l*s/8),c=new Uint8Array(i,e,u);let h=0,p=0,m=0;const v=-1>>>32-s;for(let w=0;w>>=s,p-=s,p+s>32&&(h|=c[m-1]>>8-p)}return e+m}const E$={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function kQr(i,e){return{sizeLo:i.getUint32(e+E$.sizeLo,pd),sizeHi:i.getUint32(e+E$.sizeHi,pd),count:i.getUint32(e+E$.count,pd),colorMapCount:i.getUint16(e+E$.colorMapCount,pd),lookupMethod:i.getUint8(e+E$.lookupMethod),compressionMethod:i.getUint8(e+E$.compressionMethod)}}function LQr(i){const e=new DataView(i,0);let t=0;const{identifier:r,version:n}=eKe(i,e,t);if(t+=I8.byteCount,r!=="ClusterRGB")throw new qe("lepcc-decode-error","Bad identifier");if(n>1)throw new qe("lepcc-decode-error","Unknown version");const s=kQr(e,t);if(t+=E$.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");if((s.lookupMethod===2||s.lookupMethod===1)&&s.compressionMethod===0){if(3*s.colorMapCount+s.count+t!==i.byteLength||s.colorMapCount>256)throw new qe("lepcc-decode-error","Bad count");const o=new Uint8Array(i,t,3*s.colorMapCount),a=new Uint8Array(i,t+3*s.colorMapCount,s.count),l=new Uint8Array(3*s.count);for(let u=0;u1)throw new qe("lepcc-decode-error","Unknown version");const s=NQr(e,t);if(t+=I$.byteCount,s.sizeHi*2**32+s.sizeLo!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const o=new Uint16Array(s.count);if(s.bitsPerPoint===8){if(s.count+t!==i.byteLength)throw new qe("lepcc-decode-error","Bad size");const a=new Uint8Array(i,t,s.count);for(let l=0;ldi.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function BQr(i,e,t){let r="",n=0;for(;n=192&&s<224){if(n+1>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const o=(31&s)<<6|63&i[e+n+1];r+=String.fromCharCode(o),n+=2}else if(s>=224&&s<240){if(n+2>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(15&s)<<12|(63&i[e+n+1])<<6|63&i[e+n+2];r+=String.fromCharCode(o),n+=3}else{if(!(s>=240&&s<248))throw new qe("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(n+3>=t)throw new qe("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(7&s)<<18|(63&i[e+n+1])<<12|(63&i[e+n+2])<<6|63&i[e+n+3];if(o>=65536){const a=55296+(o-65536>>10),l=56320+(1023&o);r+=String.fromCharCode(a,l)}else r+=String.fromCharCode(o);n+=4}}}return r}function vVt(i,e){const t={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let n=0;n{const n=r?Date.parse(r):null;return n&&!Number.isNaN(n)?n:null})}function _Vt(i,e,t){const r=[];let n,s,o=0;for(s=0;s0){if(r.push(BQr(t,o,n-1)),t[o+n-1]!==0)throw new qe("string-array-error","Invalid string array: missing null termination.")}else r.push(null);o+=n}return r}function Y9e(i,e){return new FCe[e.valueType](i,e.byteOffset,e.count*e.valuesPerElement)}function GQr(i,e){return new Uint8Array(i,e.byteOffset,e.byteCount)}function UQr(i,e,t){const r=e.header!=null?vVt(i,e.header):{byteOffset:0,byteCount:0,fields:{count:t}},n={header:r,byteOffset:r.byteCount,byteCount:0,entries:Object.create(null)};let s=r.byteCount;for(let o=0;onew DataView(i,0).getFloat32(e,!0),Float64:(i,e)=>new DataView(i,0).getFloat64(e,!0),UInt8:(i,e)=>new DataView(i,0).getUint8(e),Int8:(i,e)=>new DataView(i,0).getInt8(e),UInt16:(i,e)=>new DataView(i,0).getUint16(e,!0),Int16:(i,e)=>new DataView(i,0).getInt16(e,!0),UInt32:(i,e)=>new DataView(i,0).getUint32(e,!0),Int32:(i,e)=>new DataView(i,0).getInt32(e,!0)};function xVt(i){return FCe.hasOwnProperty(i)}function wye(i){return xVt(i)?FCe[i].BYTES_PER_ELEMENT:0}function WQr(i,e,t,r){const{rendererJSON:n,isRGBRenderer:s}=i;let o=null,a=null;if(e&&s)o=e;else if(e&&n?.type==="pointCloudUniqueValueRenderer"){a=yVt.fromJSON(n);const l=a.colorUniqueValueInfos;o=new Uint8Array(3*r);const u=SPe(a.fieldTransformType);for(let c=0;c=l[p].value)o[3*c]=l[p].color.r,o[3*c+1]=l[p].color.g,o[3*c+2]=l[p].color.b;else for(let m=1;m=l[p].minValue&&h<=l[p].maxValue){o[3*c]=l[p].color.r,o[3*c+1]=l[p].color.g,o[3*c+2]=l[p].color.b;break}}}else o=new Uint8Array(3*r).fill(255);if(t&&a?.colorModulation){const l=a.colorModulation.minValue,u=a.colorModulation.maxValue,c=.3;for(let h=0;h=u?1:p<=l?c:c+(1-c)*(p-l)/(u-l);o[3*h]=m*o[3*h],o[3*h+1]=m*o[3*h+1],o[3*h+2]=m*o[3*h+2]}}return o}function qQr(i,e){if(i.encoding==null||i.encoding===""){const t=zQr(e,i);if(t.vertexAttributes.position==null)return;const r=Y9e(e,t.vertexAttributes.position),n=t.header.fields,s=[n.offsetX,n.offsetY,n.offsetZ],o=[n.scaleX,n.scaleY,n.scaleZ],a=r.length/3,l=new Float64Array(3*a);for(let u=0;u>>4&15,v=m>1,w=p===1,S=p===m;let I=!1;for(const R of c.includedReturns)if(R==="last"&&S||R==="firstOfMany"&&w&&v||R==="lastOfMany"&&S&&v||R==="single"&&!v){I=!0;break}I||(l=!1);break}}}l&&(t[o]=a,i[3*o]=i[3*a],i[3*o+1]=i[3*a+1],i[3*o+2]=i[3*a+2],e[3*o]=e[3*a],e[3*o+1]=e[3*a+1],e[3*o+2]=e[3*a+2],o++)}return o}function SPe(i){switch(i){default:case null:case"none":return e=>e;case"low-four-bit":return e=>15&e;case"high-four-bit":return e=>(240&e)>>4;case"absolute-value":return e=>Math.abs(e);case"modulo-ten":return e=>e%10}}function Tgt(i){let e=0;for(const t of i||[])e|=1<this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new A$(Ja)}static createVec3f64(){return new A$(gr)}static createVec4f64(){return new A$(EE)}static createMat3f64(){return new A$(Yd)}static createMat4f64(){return new A$(Pm)}static createQuatf64(){return new A$(Dm)}get test(){return{length:this._items.length}}};dX.createVec2f64();const O3=dX.createVec3f64();dX.createVec4f64();dX.createMat3f64();const KQr=dX.createMat4f64(),ZQr=dX.createQuatf64();function SVt(i=ten){return[i[0],i[1],i[2],i[3]]}function QQr(i,e,t,r=SVt()){const n=t[0]-e[0],s=t[1]-e[1],o=t[2]-e[2],a=i[0]-e[0],l=i[1]-e[1],u=i[2]-e[2],c=s*u-o*l,h=o*a-n*u,p=n*l-s*a,m=c*c+h*h+p*p,v=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=c*v,r[1]=h*v,r[2]=p*v,r[3]=-(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),r}function TVt(i,e,t,r=0,n=Math.floor(t*(1/3)),s=Math.floor(t*(2/3))){if(t<3)return!1;e(_K,r);let o=n,a=!1;for(;or&&(r=o,n=s)}fx(e,i.minVert[n]),fx(t,i.maxVert[n])}const g2=[0,0,0];function oen(i,e,t,r){const{data:n,size:s}=i;let o=Number.NEGATIVE_INFINITY,a=0;for(let l=0;lo&&(o=h,a=l)}return fx(r,n,a),o}const ff=Ja();function aen(i,e,t,r,n){uen(i,e,ff,n,r);const s=AVt(t,e);ff[1]-Oq<=s&&(r[0]=void 0),ff[0]+Oq>=s&&(n[0]=void 0)}const Cgt=gr(),Egt=gr(),Igt=gr(),Vj=gr(),Hj=gr(),Kde=gr();function M$(i,e,t,r,n,s){if(IVt(e)t[1]&&(t[1]=l,fx(n,s,a))}}function Agt(i,e,t){t.center=i,t.halfSize=Gc(e,e,.5),t.quaternion=yle}const OM=gr(),Wj=gr(),TK=gr(),gH=gr(),yH=gr(),Mgt=gr();function cen(i,e,t){fx(OM,e),Math.abs(e[0])>Math.abs(e[1])&&Math.abs(e[0])>Math.abs(e[2])?OM[0]=0:Math.abs(e[1])>Math.abs(e[2])?OM[1]=0:OM[2]=0,IVt(OM)this.maxProj[0]&&(this.maxProj[0]=u,s[0]=l),u=o[l+1],uthis.maxProj[1]&&(this.maxProj[1]=u,s[1]=l),u=o[l+2],uthis.maxProj[2]&&(this.maxProj[2]=u,s[2]=l),u=o[l]+o[l+1]+o[l+2],uthis.maxProj[3]&&(this.maxProj[3]=u,s[3]=l),u=o[l]+o[l+1]-o[l+2],uthis.maxProj[4]&&(this.maxProj[4]=u,s[4]=l),u=o[l]-o[l+1]+o[l+2],uthis.maxProj[5]&&(this.maxProj[5]=u,s[5]=l),u=o[l]-o[l+1]-o[l+2],uthis.maxProj[6]&&(this.maxProj[6]=u,s[6]=l)}for(let l=0;l0){const r=1/Math.sqrt(t);i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r}}function IVt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function K9e(i,e){const t=e[0]-i[0],r=e[1]-i[1],n=e[2]-i[2];return t*t+r*r+n*n}function AVt(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function fen(i,e){const t=e[0]+e[4]+e[8];if(t>0){let r=Math.sqrt(t+1);i[3]=.5*r,r=.5/r,i[0]=(e[5]-e[7])*r,i[1]=(e[6]-e[2])*r,i[2]=(e[1]-e[3])*r}else{let r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);const n=(r+1)%3,s=(r+2)%3;let o=Math.sqrt(e[3*r+r]-e[3*n+n]-e[3*s+s]+1);i[r]=.5*o,o=.5/o,i[3]=(e[3*n+s]-e[3*s+n])*o,i[n]=(e[3*n+r]+e[3*r+n])*o,i[s]=(e[3*s+r]+e[3*r+s])*o}return i}let kCe=class xye{constructor(e=Ox,t=Cen,r=yle){this._data=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3]]}clone(){const e=new xye;return e._data=this._data.slice(),e}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(e){const t=new xye;return t._data=e.slice(),t}static fromJSON(e){return new xye(e.center,e.halfSize,e.quaternion)}copy(e){this._data=e.data.slice()}get center(){return Zo(O3.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set center(e){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2]}setCenter(e,t,r){this._data[0]=e,this._data[1]=t,this._data[2]=r}get halfSize(){return Zo(O3.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(e){return e[0]=this._data[3],e[1]=this._data[4],e[2]=this._data[5],e}set halfSize(e){this._data[3]=e[0],this._data[4]=e[1],this._data[5]=e[2]}get quaternion(){return yjt(ZQr.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(e){return e[0]=this._data[6],e[1]=this._data[7],e[2]=this._data[8],e[3]=this._data[9],e}set quaternion(e){this._data[6]=e[0],this._data[7]=e[1],this._data[8]=e[2],this._data[9]=e[3]}get data(){return this._data}getCorners(e){const t=ih,r=this._data;t[0]=r[6],t[1]=r[7],t[2]=r[8],t[3]=r[9];for(let n=0;n<8;++n){const s=e[n];s[0]=(1&n?-1:1)*r[3],s[1]=(2&n?-1:1)*r[4],s[2]=(4&n?-1:1)*r[5],Cv(s,s,t),s[0]+=r[0],s[1]+=r[1],s[2]+=r[2]}}isVisible(e){return this.intersectPlane(e[0])<=0&&this.intersectPlane(e[1])<=0&&this.intersectPlane(e[2])<=0&&this.intersectPlane(e[3])<=0&&this.intersectPlane(e[4])<=0&&this.intersectPlane(e[5])<=0}get radius(){const e=this._data[3],t=this._data[4],r=this._data[5];return Math.sqrt(e*e+t*t+r*r)}intersectSphere(e){Oa[0]=this._data[0]-e[0],Oa[1]=this._data[1]-e[1],Oa[2]=this._data[2]-e[2];const t=this.getQuaternion(dP);return PF(ih,t),Cv(Oa,Oa,ih),oW(Oa,Oa),PM[0]=Math.min(Oa[0],this._data[3]),PM[1]=Math.min(Oa[1],this._data[4]),PM[2]=Math.min(Oa[2],this._data[5]),w5e(PM,Oa)s*s)&&(ih[0]=-r[6],ih[1]=-r[7],ih[2]=-r[8],ih[3]=r[9],Cv(Oa,Oa,ih),oW(Oa,Oa),PM[0]=Math.min(Oa[0],r[3]),PM[1]=Math.min(Oa[1],r[4]),PM[2]=Math.min(Oa[2],r[5]),w5e(PM,Oa)r?1:t<-r?-1:0}intersectRay(e,t,r=0){const n=this._data,s=ih;s[0]=-n[6],s[1]=-n[7],s[2]=-n[8],s[3]=n[9],Oa[0]=e[0]-n[0],Oa[1]=e[1]-n[1],Oa[2]=e[2]-n[2];const o=Cv(Oa,Oa,ih),a=Cv(PM,t,ih);let l=-1/0,u=1/0;const c=this.getHalfSize(vH);for(let h=0;h<3;h++){const p=o[h],m=a[h],v=c[h]+r;if(Math.abs(m)>1e-6){const w=(v-p)/m,S=(-v-p)/m;l=Math.max(l,Math.min(w,S)),u=Math.min(u,Math.max(w,S))}else if(p>v||p<-v)return!1}return l<=u}projectedArea(e,t,r,n){const s=this.getQuaternion(dP);PF(ih,s),Oa[0]=e[0]-this._data[0],Oa[1]=e[1]-this._data[1],Oa[2]=e[2]-this._data[2],Cv(Oa,Oa,ih);const o=this.getHalfSize(vH),a=Oa[0]<-o[0]?-1:Oa[0]>o[0]?1:0,l=Oa[1]<-o[1]?-1:Oa[1]>o[1]?1:0,u=Oa[2]<-o[2]?-1:Oa[2]>o[2]?1:0,c=Math.abs(a)+Math.abs(l)+Math.abs(u);if(c===0)return 1/0;const h=c===1?4:6,p=6*(a+3*l+9*u+13);$1e(IU,s),_R(IU,IU,o);const m=this.getCenter(FC);for(let S=0;S>1)-1),c3(Oa,Oa,IU),hl(nN,m,Oa),nN[3]=1,hMt(nN,nN,t);const R=1/Math.max(1e-6,nN[3]);xT[2*S]=nN[0]*R,xT[2*S+1]=nN[1]*R}const v=2*h-2;let w=xT[0]*(xT[3]-xT[v+1])+xT[v]*(xT[1]-xT[v-1]);for(let S=2;S{const i=new Int8Array(162);let e=0;const t=r=>{for(let n=0;n0?1+e/u:1,h=l>0?1+t/l:1,p=(h+c)/2,m=(h-c)/2;Gc(lw,vC,m),n.halfSize=gb(lw,lw,a,p),Gc(lw,vC,p),gb(lw,lw,a,m),KEt(bc,bc),h2e(bc,lw,bc);const v=i.getQuaternion(men);n.center=Cv(bc,bc,v)}}else{n.center=gb(bc,o,zve,(t+e)/2);const l=Cv(bc,zve,ih);oW(l,l),n.halfSize=gb(vC,a,l,(t-e)/2)}return n}function _en(i,e,t,r,n){e.getCenter(FC),FC[2]+=n;const s=Bx(t);sy(FC,i,0,FC,s,0,1),MVt(s,e,FC,t,r)}function ben(i,e,t,r,n){e.getCenter(FC),FC[2]+=n,MVt(i,e,FC,t,r)}function MVt(i,e,t,r,n){const s=e.getQuaternion(dP),o=$1e(IU,s),a=e.getHalfSize(vH);for(let l=0;l<8;++l){for(let u=0;u<3;++u)yA[u]=a[u]*(l&1<0&&e.filterAttributesData!=null){const c=e.filterAttributesData.filter(Ga).map(h=>{const p=qde(h,t,r),m={attributeInfo:h.attributeInfo,values:p};return s.push(m),m});n=new Uint32Array(r),r=XQr(t,l,n,e.filterInfo,c)}for(const c of e.userAttributesData){const h=qde(c,t,r);s.push({attributeInfo:c.attributeInfo,values:h})}3*r=0;l--)t[l].isNoopProcess&&t.splice(l,1);let s=!1;for(let l=0;l1}const o=t.some(({name:l})=>Oen.has(l.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:t,hasBranches:s,hasFocalFunction:o,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(e,t=!1,r=-1){this.id=r+1;const n=this._getRasterValues();let s=!0;for(let o=0;othis._readRasterValue(n,e));return this._processPixels({...e,pixelBlocks:r})}processInputBandIds(){const e=this._getRasterValues().filter(this._isRasterFunctionValue);let t;if(e.length>1){const s=e.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=s,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,l)=>a!==l);const o=e.filter(a=>a.functionName==="ExtractBand");return o.length&&o.forEach((a,l)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[l,l,l]}),this.rawInputBandIds}const r=e[0];if(r){if(t=r.processInputBandIds(),r.isInputBandIdsSwizzled)return this.rawInputBandIds=t,t}else{t=[];const{bandCount:s}=this.sourceRasterInfos[0];for(let o=0;os!==o),this.rawInputBandIds=n,this.rawInputBandIds}getPrimaryRasters(){const e=[],t=[];return this._getPrimaryRasters(this,e,t),{rasters:e,rasterIds:t}}getWebGLProcessorDefinition(){const e=this._getWebGLParameters(),{raster:t,rasters:r}=this.functionArguments;return r&&Array.isArray(r)&&r.length?(e.rasters=r.map(n=>this._isRasterFunctionValue(n)?n.getWebGLProcessorDefinition():typeof n=="number"?{name:"Constant",parameters:{value:n},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:n},pixelType:"f32",id:-1,isNoopProcess:!1}),e.rasters.some(n=>n!=null)||(e.rasters=null)):this._isRasterFunctionValue(t)&&(e.raster=t.getWebGLProcessorDefinition()),{name:this.functionName,parameters:e,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const e=[];this.functionName==="Clip"&&e.push(this.functionArguments);const{raster:t,rasters:r}=this.functionArguments;if(r&&Array.isArray(r)&&r.length)r.forEach(n=>{if(this._isRasterFunctionValue(n)){const s=n.getClippingGeometries();e.push(...s)}});else if(this._isRasterFunctionValue(t)){const n=t.getClippingGeometries();e.push(...n)}return e}_getOutputPixelType(e){return this.outputPixelType==="unknown"?e:this.outputPixelType??e}_getWebGLParameters(){return{}}_getInputBandIds(e){return e}_removeStatsHistColormapVAT(e){e.statistics=null,e.histograms=null,e.colormap=null,e.attributeTable=null}_getRasterValues(){const{rasterArgumentNames:e}=this;return e[0]==="rasters"?this.functionArguments.rasters??[]:e.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(e){const t=this._getRasterValues(),{rasterInfos:r,rasterIds:n}=e;if(t.length===0)return r;const s=t.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&n.includes(a)?r[n.indexOf(a)]:typeof a!="number"?r[0]:void 0),o=s.find(a=>a)??r[0];return s.forEach((a,l)=>{a===void 0&&(s[l]=o)}),s}_getPrimaryRasterId(e){return e?.rasterId}_getPrimaryRasters(e,t=[],r=[]){for(let n=0;nt?n.slice(0,t):null),s&&s.length!==t&&(e.histograms=s.length>t?s.slice(0,t):null),r.BAND_COUNT&&Number(r.BAND_COUNT)!==t&&(e.keyProperties={...r,BAND_COUNT:typeof r.BAND_COUNT=="string"?String(t):t})}};x([D({json:{write:!0}})],Pp.prototype,"functionName",void 0),x([D({json:{write:!0}})],Pp.prototype,"functionArguments",void 0),x([D()],Pp.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}}),So(i=>i?.toLowerCase())],Pp.prototype,"outputPixelType",void 0),x([D({json:{write:!0}})],Pp.prototype,"mainPrimaryRasterId",void 0),x([D()],Pp.prototype,"sourceRasters",void 0),x([D({type:[W3],json:{write:!0}})],Pp.prototype,"sourceRasterInfos",void 0),x([D({json:{write:!0}})],Pp.prototype,"rasterInfo",void 0),x([D({json:{write:!0}})],Pp.prototype,"readingBufferSize",void 0),x([D({json:{write:!0}})],Pp.prototype,"id",void 0),x([D()],Pp.prototype,"isNoopProcess",void 0),x([D()],Pp.prototype,"supportsGPU",null),x([D()],Pp.prototype,"rawInputBandIds",void 0),x([D()],Pp.prototype,"rawSourceRasterInfos",void 0),x([D()],Pp.prototype,"isInputBandIdsSwizzled",void 0),x([D()],Pp.prototype,"swizzledBandSelection",void 0),x([D()],Pp.prototype,"isBranch",void 0),x([D({readOnly:!0})],Pp.prototype,"flatWebGLFunctionChain",null),x([D()],Pp.prototype,"_bindingResult",void 0),Pp=x([Qe("esri.layers.support.rasterFunctions.BaseRasterFunction")],Pp);const km=Pp,Qu={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},Pen={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},ib={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},kC={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},Ren={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},OVt={setNull:50,conditional:78},Rgt={...Pen,...ib,...kC,...Ren,...OVt},PVt=new Map([[kC.acos,{domain:[0,Math.PI],isInteger:!1}],[kC.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[kC.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[kC.cos,{domain:[-1,1],isInteger:!1}],[kC.sin,{domain:[-1,1],isInteger:!1}],[ib.booleanAnd,{domain:[0,1],isInteger:!0}],[ib.booleanNot,{domain:[0,1],isInteger:!0}],[ib.booleanOr,{domain:[0,1],isInteger:!0}],[ib.booleanXOr,{domain:[0,1],isInteger:!0}],[ib.equalTo,{domain:[0,1],isInteger:!0}],[ib.notEqual,{domain:[0,1],isInteger:!0}],[ib.greaterThan,{domain:[0,1],isInteger:!0}],[ib.greaterThanEqual,{domain:[0,1],isInteger:!0}],[ib.lessThan,{domain:[0,1],isInteger:!0}],[ib.lessThanEqual,{domain:[0,1],isInteger:!0}],[ib.isNull,{domain:[0,1],isInteger:!0}]]);function Dgt(i){return PVt.get(i)}const Fgt=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function Den(i,e=!1){const t=i.map(a=>a.mask),r=t.filter(a=>a!=null),n=i[0].pixels[0].length;if(r.length===0||e&&r.length!==t.length)return new Uint8Array(n).fill(255);const s=r[0],o=new Uint8Array(s);if(r.length===1)return o;if(!e){for(let a=1;a=1?e[l]=0:o[l]=Math.atanh(u)}return o}const a=r===kC.asin?Math.asin:Math.acos;for(let l=0;l1?e[l]=0:o[l]=a(u)}return o}function zen(i,e,t,r){const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;a>n[a]);return o}function Jen(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;an[a]?1:0);return o}function utn(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;a=n[a]?1:0);return o}function ctn(i,e,t){const[r,n]=i,s=r.length,o=Br.createEmptyBand(t,s);for(let a=0;ac&&(l=c)}o[a]=l}return o}function $gt(i,e,t){const r=i.length;if(r<2)return i[0];const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;ah&&(l=h)}o[a]=u-l}return o}function Bgt(i,e,t){const r=i.length;if(r<2)return i[0];const[n]=i,s=n.length,o=Br.createEmptyBand(t,s);for(let a=0;ac&&(c=u,l=h);s[a]=l}return s}function Vgt(i,e,t){const r=i.length;if(r<=2)return DVt(i,e,t);const n=i[0].length,s=Br.createEmptyBand(t,n),o=new Map;for(let a=0;as?e[a]=0:r[a]=o?Math.round(l):l}}function FVt(i,e,t={}){ytn();let r=Den(i,e>=66&&e<=75);const{outputPixelType:n="f32"}=t,s=!$d.has(e)||t.processAsMultiband,o=s?i[0].pixels.length:1,a=[];for(let u=0;um.pixels):i.map(m=>m.pixels[u]);let h,p=!0;if(e===OVt.setNull){const m=gtn(c,r,n);h=m.band,r=m.mask,p=!1}else nu.has(e)?h=nu.get(e)(c,r,"f64"):em.has(e)?h=e===kC.asin||e===kC.acos||e===kC.atanh?Uen(c,r,"f64",e):zen(c,r,"f64",em.get(e)):Lbe.has(e)?h=Ven(c,r,"f64",Lbe.get(e)):$d.has(e)?h=$d.get(e)(c,r,"f64"):(h=c[0],p=!1);if(p&&e!==ib.isNull&&!PVt.has(e)){const m=Br.createEmptyBand(n,h.length);r||(r=new Uint8Array(h.length).fill(255)),vtn(h,r,n,m),h=m}a.push(h)}const l=i[0];return new Br({width:l.width,height:l.height,pixelType:n,mask:e===ib.isNull?null:r,pixels:a})}function _tn(i,e,t){return FVt(i,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:t})}let MU=class extends km{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:e}=this.functionArguments;if(e<1||e>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:t.bandCount<=3}}_processPixels(e){const{pixelBlocks:t}=e;return t?.[0]==null||t?.[1]==null?null:_tn(t,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:e}=this.functionArguments,t=["","plus","minus","times","divide","power","mod"][e],r=this.outputPixelType??"f32";let[n,s]=Yx(r);const o=SF(r);return o&&(n-=1e-4,s+=1e-4),{imageCount:2,operationName:t,domainRange:[n,s],isOutputRounded:o}}};x([D({json:{write:!0,name:"rasterFunction"}})],MU.prototype,"functionName",void 0),x([D({type:Men,json:{write:!0,name:"rasterFunctionArguments"}})],MU.prototype,"functionArguments",void 0),x([D()],MU.prototype,"rasterArgumentNames",void 0),MU=x([Qe("esri.layers.support.rasterFunctions.ArithmeticFunction")],MU);const btn=MU;var Q9e;let eBe=Q9e=class extends Fm{clone(){return new Q9e({raster:this.raster})}};eBe=Q9e=x([Qe("esri.layers.support.rasterFunctions.AspectFunctionArguments")],eBe);const wtn=eBe;let O$=class extends km{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const e=this.sourceRasterInfos[0];this.isGCS=e.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const t=e.clone();return t.pixelType=this.outputPixelType,t.statistics=[{min:-1,max:360,avg:180,stddev:30}],t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{extent:r,primaryPixelSizes:n}=e,s=n?.[0],o=s??(r?{x:r.width/t.width,y:r.height/t.height}:{x:1,y:1});return Pcr(t,{resolution:o})}};x([D({json:{write:!0,name:"rasterFunction"}})],O$.prototype,"functionName",void 0),x([D({type:wtn,json:{write:!0,name:"rasterFunctionArguments"}})],O$.prototype,"functionArguments",void 0),x([D()],O$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],O$.prototype,"isGCS",void 0),O$=x([Qe("esri.layers.support.rasterFunctions.AspectFunction")],O$);const xtn=O$,Stn=new Set(["+","-","*","/","(",")"]);function Ttn(i,e){(i=i.replaceAll(" ","")).startsWith("-")&&(i="0"+i),i.startsWith("+")&&(i=i.slice(1,i.length));const t=i.split(""),r=[],n=[];let s="";for(let o=0;o-1)t>0&&(n+=e+1);else{for(let o=0;o0&&(n+=e+1)}let s=0;for(let o=0;o0;){const{numIndex:o,opIndex:a}=Itn(n);if(r=Ctn(i,n[a],s[o],s[o+1]),n.length===1)break;n=Etn(n,a),s.splice(o,2,r)}return[r]}const Mtn=new Rs({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Otn(i,e){if(!bh(i))return i;const{equation:t,method:r}=e,n=e.bandIndexes.map(c=>c-1),{pixels:s,mask:o}=i;let a;switch(r){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":a=qgt(o,s[n[0]],s[n[1]]);break;case"ndwi":a=qgt(o,s[n[1]],s[n[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":a=Rtn(o,s[n[0]],s[n[1]]);break;case"ci-g":case"ci-re":a=Dtn(o,s[n[0]],s[n[1]]);break;case"savi":a=Ftn(o,s[n[0]],s[n[1]],n[2]+1);break;case"tsavi":a=ktn(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1,n[4]+1);break;case"msavi":a=Ltn(o,s[n[0]],s[n[1]]);break;case"gemi":a=Ntn(o,s[n[0]],s[n[1]]);break;case"pvi":a=$tn(o,s[n[0]],s[n[1]],n[2]+1,n[3]+1);break;case"gvitm":a=Btn(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]],s[n[5]]]);break;case"sultan":a=jtn(o,[s[n[0]],s[n[1]],s[n[2]],s[n[3]],s[n[4]]]);break;case"vari":a=Gtn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"mtvi2":a=Utn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"rtvi-core":a=ztn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"evi":a=Vtn(o,[s[n[0]],s[n[1]],s[n[2]]]);break;case"wndwi":a=Htn(o,[s[n[0]],s[n[1]],s[n[2]]],n[3]?n[3]+1:.5);break;case"bai":a=Wtn(o,s[n[0]],s[n[1]]);break;case"custom":a=Atn(o,s,t);break;default:return i}const l=o!=null?new Uint8Array(o.length):null;o!=null&&l!=null&&l.set(o);const u=new Br({width:i.width,height:i.height,pixelType:"f32",pixels:a,mask:l});return u.updateStatistics(),u}function Ptn(i,e,t,r){const{mask:n,pixels:s,width:o,height:a}=i,l=s[t],u=s[e],c=u.length,h=r?new Uint8Array(c):new Float32Array(c),p=r?100:1,m=r?100.5:0;for(let w=0;wparseFloat(o));return Otn(t,{method:r,bandIndexes:s,equation:n})}_getWebGLParameters(){const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);e.length===2&&e.push(0);const t=this.isInputBandIdsSwizzled?[0,1,2]:e;let r,n;const s=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":r=Hg([t[0],t[1],0]),n="ndxi";break;case"ndwi":r=Hg([t[1],t[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":r=Hg([t[0],t[1],0]),n="sr";break;case"ci-g":case"ci-re":r=Hg([t[0],t[1],0]),n="ci";break;case"savi":r=Hg([t[0],t[1],0]),n="savi",s[0]=e[2]+1;break;case"tsavi":r=Hg([t[0],t[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1,s[2]=e[4]+1;break;case"msavi":r=Hg([t[0],t[1],0]),n="msavi";break;case"gemi":r=Hg([t[0],t[1],0]),n="gemi";break;case"pvi":r=Hg([t[0],t[1],0]),n="tsavi",s[0]=e[2]+1,s[1]=e[3]+1;break;case"vari":r=Hg([t[0],t[1],t[2]]),n="vari";break;case"mtvi2":r=Hg([t[0],t[1],t[2]]),n="mtvi";break;case"rtvi-core":r=Hg([t[0],t[1],t[2]]),n="rtvicore";break;case"evi":r=Hg([t[0],t[1],t[2]]),n="evi";break;case"wndwi":r=Hg([t[0],t[1],0]),n="wndwi",s[0]=e[3]?e[3]+1:.5;break;case"bai":r=Hg([t[1],t[0],0]),n="bai";break;default:r=Hg([0,1,2]),n="custom"}return{bandIndexMat3:r,indexType:n,adjustments:s}}_getInputBandIds(e){if(this.functionArguments.method==="custom")return e;const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),r=e.length,n=t.map(a=>a>=r?r-1:a),s=Ytn.has(this.functionArguments.method)?3:2,o=n.slice(0,s).map(a=>e[a]);return o.length===2&&o.push(0),o}};x([D({json:{write:!0,name:"rasterFunction"}})],OU.prototype,"functionName",void 0),x([D({type:qtn,json:{write:!0,name:"rasterFunctionArguments"}})],OU.prototype,"functionArguments",void 0),x([D()],OU.prototype,"rasterArgumentNames",void 0),OU=x([Qe("esri.layers.support.rasterFunctions.BandArithmeticFunction")],OU);const Xtn=OU;var iBe;const Ygt=new Rs({1:"outside",2:"inside"},{useNumericKeys:!0});let Jee=iBe=class extends Fm{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new iBe({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};x([D({types:Ff,json:{read:Ro,write:!0}})],Jee.prototype,"clippingGeometry",void 0),x([D({json:{read:Ygt.read,write:Ygt.write}})],Jee.prototype,"clippingType",void 0),Jee=iBe=x([Qe("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Jee);const Jtn=Jee;let P$=class extends km{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:e,clippingType:t}=this.functionArguments;return{clippingGeometry:e.toJSON(),clippingType:t}}};x([D({json:{write:!0,name:"rasterFunction"}})],P$.prototype,"functionName",void 0),x([D({type:Jtn,json:{write:!0,name:"rasterFunctionArguments"}})],P$.prototype,"functionArguments",void 0),x([D()],P$.prototype,"rasterArgumentNames",void 0),x([D()],P$.prototype,"isNoopProcess",void 0),P$=x([Qe("esri.layers.support.rasterFunctions.ClipFunction")],P$);const Ktn=P$;var rBe;let RI=rBe=class extends Fm{castColormapName(i){if(!i)return null;const e=i.toLowerCase();return Nar.includes(e)?e:null}readColorRamp(i){return F2e(i)}readColorRampName(i,e){if(!i)return null;const t=UV.jsonValues.find(r=>r.toLowerCase()===i.toLowerCase());return t?UV.fromJSON(t):null}clone(){return new rBe({colormap:li(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};x([D({type:[[Number]],json:{write:!0}})],RI.prototype,"colormap",void 0),x([D({type:String,json:{write:!0}})],RI.prototype,"colormapName",void 0),x([So("colormapName")],RI.prototype,"castColormapName",null),x([D({types:D2e,json:{write:!0}})],RI.prototype,"colorRamp",void 0),x([Mi("colorRamp")],RI.prototype,"readColorRamp",null),x([D({type:UV.apiValues,json:{type:UV.jsonValues,write:UV.write}})],RI.prototype,"colorRampName",void 0),x([Mi("colorRampName")],RI.prototype,"readColorRampName",null),RI=rBe=x([Qe("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],RI);const Ztn=RI,Qtn=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],ein=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function nKe(i,e){const t=[],r=[];for(let s=0;s[r,...t]),e):null}let G4=class extends km{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0];if(e.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:t,colormapName:r,colorRamp:n,colorRampName:s}=this.functionArguments;if(!t?.length)if(n)t=tk(n,{interpolateAlpha:!0});else if(s){const l=jar(s);l&&(t=tk(l))}else r&&(t=oin(r));if(!t?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const o=this._getOutputPixelType(e.pixelType);this.outputPixelType=o.startsWith("f")?"s32":o;const a=e.clone();return a.pixelType=this.outputPixelType,a.colormap=t,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(e){let t=e.pixelBlocks?.[0];return!t||SF(t.pixelType)||(t=t.clone(),t.clamp(this.outputPixelType)),t}};x([D({json:{write:!0,name:"rasterFunction"}})],G4.prototype,"functionName",void 0),x([D({type:Ztn,json:{write:!0,name:"rasterFunctionArguments"}})],G4.prototype,"functionArguments",void 0),x([D()],G4.prototype,"rasterArgumentNames",void 0),x([D()],G4.prototype,"isNoopProcess",void 0),x([D({json:{write:!0}})],G4.prototype,"indexedColormap",void 0),G4=x([Qe("esri.layers.support.rasterFunctions.ColormapFunction")],G4);const ain=G4;var nBe;let Kee=nBe=class extends Fm{constructor(){super(...arguments),this.rasters=[]}writeRasters(i,e){e.rasters=i.map(t=>typeof t=="number"||typeof t=="string"?t:t.toJSON())}clone(){return new nBe({rasters:li(this.rasters)})}};x([D({json:{write:!0}})],Kee.prototype,"rasters",void 0),x([ur("rasters")],Kee.prototype,"writeRasters",null),Kee=nBe=x([Qe("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Kee);const lin=Kee;let PU=class extends km{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);const r=t.clone();if(r.attributeTable=null,r.colormap=null,r.pixelType=this.outputPixelType,r.bandCount=e.map(({bandCount:s})=>s).reduce((s,o)=>s+o),e.every(({statistics:s})=>s!=null&&s.length)){const s=[];e.forEach(({statistics:o})=>o!=null&&s.push(...o)),r.statistics=s}if(e.every(({histograms:s})=>s!=null&&s.length)){const s=[];e.forEach(({histograms:o})=>o!=null&&s.push(...o)),r.histograms=s}r.bandCount>1&&(r.colormap=null,r.attributeTable=null);const n=e.every(s=>s.keyProperties.BandProperties?.length)?e.flatMap(s=>s.keyProperties.BandProperties):void 0;return r.keyProperties={...r.keyProperties,BandProperties:n},this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3}}_processPixels(e){const{pixelBlocks:t}=e;return t?t?.[0]==null?null:nlr(t):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};x([D({json:{write:!0,name:"rasterFunction"}})],PU.prototype,"functionName",void 0),x([D({type:lin,json:{write:!0,name:"rasterFunctionArguments"}})],PU.prototype,"functionArguments",void 0),x([D()],PU.prototype,"rasterArgumentNames",void 0),PU=x([Qe("esri.layers.support.rasterFunctions.CompositeBandFunction")],PU);const uin=PU;var sBe;let Zee=sBe=class extends Fm{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new sBe({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};x([D({json:{write:!0}})],Zee.prototype,"contrastOffset",void 0),x([D({json:{write:!0}})],Zee.prototype,"brightnessOffset",void 0),Zee=sBe=x([Qe("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Zee);const cin=Zee;let R$=class extends km{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0];if(t.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const r=t.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;const{contrastOffset:n,brightnessOffset:s}=this.functionArguments;return this.lookup=QRt(n,s),{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];return t==null?null:Vne(t,{lut:t.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:e,brightnessOffset:t}=this.functionArguments;return{contrastOffset:e,brightnessOffset:t}}};x([D({json:{write:!0,name:"rasterFunction"}})],R$.prototype,"functionName",void 0),x([D({type:cin,json:{write:!0,name:"rasterFunctionArguments"}})],R$.prototype,"functionArguments",void 0),x([D()],R$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],R$.prototype,"lookup",void 0),R$=x([Qe("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],R$);const hin=R$;function sKe(i,e,t,r,n){const s=Math.floor(r/2);for(let a=0;an+s);return t===-1||r===0||r===1?e:e.map(n=>n/r)}_bindSourceRasters(){const{convolutionType:e,rows:t,cols:r,kernel:n}=this.functionArguments;if(!Object.values(Qu).includes(e))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${e}`};if(e!==Qu.none&&t*r!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);const o=s.clone();o.pixelType=this.outputPixelType;const a=[Qu.none,Qu.sharpen,Qu.sharpen2,Qu.sharpening3x3,Qu.sharpening5x5];return(e===-1||this.outputPixelType!=="u8"&&!a.includes(e))&&(o.statistics=null,o.histograms=null),o.colormap=null,o.attributeTable=null,this.rasterInfo=o,{success:!0,supportsGPU:n.length<=Jgt}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null||this.functionArguments.convolutionType===Qu.none)return t;const{rows:r,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;return gin(t,{kernel:s,rows:r,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const e=new Float32Array(Jgt);return e.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:e,clampRange:Yx(this.outputPixelType)}}};x([D({json:{write:!0,name:"rasterFunction"}})],F$.prototype,"functionName",void 0),x([D({type:yin,json:{write:!0,name:"rasterFunctionArguments"}})],F$.prototype,"functionArguments",void 0),x([D()],F$.prototype,"rasterArgumentNames",void 0),x([D()],F$.prototype,"_normalizedKernel",null),F$=x([Qe("esri.layers.support.rasterFunctions.ConvolutionFunction")],F$);const vin=F$;var aBe;const kVt=new Rs({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let RU=aBe=class extends Fm{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(i,e){return kVt.fromJSON(e.type??e.curvatureType??0)}clone(){return new aBe({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};x([D({json:{write:{target:"type"}}}),Wr(kVt)],RU.prototype,"curvatureType",void 0),x([Mi("curvatureType",["type","curvatureType"])],RU.prototype,"readCurvatureType",null),x([D({type:Number,json:{write:!0}})],RU.prototype,"zFactor",void 0),RU=aBe=x([Qe("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],RU);const _in=RU;let k$=class extends km{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const e=this.sourceRasterInfos[0].clone();return e.pixelType=this.outputPixelType,e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{zFactor:r,curvatureType:n}=this.functionArguments,{extent:s,primaryPixelSizes:o}=e,a=o?.[0],l=a??(s?{x:s.width/t.width,y:s.height/t.height}:{x:1,y:1}),u=this.isGCS&&r>=1?r*yP:r;return Rcr(t,{zFactor:u,curvatureType:n,resolution:l})}_getWebGLParameters(){const{zFactor:e,curvatureType:t}=this.functionArguments;return{curvatureType:t,zFactor:this.isGCS&&e>=1?e*yP:e}}};x([D({json:{write:!0,name:"rasterFunction"}})],k$.prototype,"functionName",void 0),x([D({type:_in,json:{write:!0,name:"rasterFunctionArguments"}})],k$.prototype,"functionArguments",void 0),x([D()],k$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],k$.prototype,"isGCS",void 0),k$=x([Qe("esri.layers.support.rasterFunctions.CurvatureFunction")],k$);const bin=k$;var lBe;let gO=lBe=class extends Fm{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=x1e.bestMatch}clone(){return new lBe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};x([D({json:{write:!0}})],gO.prototype,"bandIds",void 0),x([D({json:{write:!0}})],gO.prototype,"bandNames",void 0),x([D({json:{write:!0}})],gO.prototype,"bandWavelengths",void 0),x([Wr({0:"name",1:"wavelength",2:"id"})],gO.prototype,"method",void 0),x([D({json:{write:!0}})],gO.prototype,"missingBandAction",void 0),x([D({json:{write:!0}})],gO.prototype,"wavelengthMatchTolerance",void 0),gO=lBe=x([Qe("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],gO);const win=gO;let DU=class extends km{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:e,sourceRasterInfos:t}=this,r=t[0],{method:n,bandNames:s,bandWavelengths:o,bandIds:a,missingBandAction:l}=e,u=s?.length&&(n==="name"||n!=="id"&&!a?.length),c=o?.length&&(n==="wavelength"||n!=="id"&&!a?.length),h=l===x1e.fail,p=u?this._matchBandNames(r,s):c?this._matchBandWavelengths(r,o,h):this._matchBandIds(r,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":c?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const m=r.clone();m.pixelType=this.outputPixelType,m.bandCount=p.length;const{statistics:v,histograms:w}=m;v!=null&&v.length&&(m.statistics=p.map(I=>v[I]||v[v.length-1])),w!=null&&w.length&&(m.histograms=p.map(I=>w[I]||w[w.length-1]));let S=m.keyProperties?.BandProperties;return S?.length&&(S=p.map(I=>I>=S.length?S[S.length-1]:S[I]),m.keyProperties={...m.keyProperties,BandProperties:S}),this.rasterInfo=m,{success:!0,supportsGPU:m.bandCount<=3}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const r=t.pixels.length,n=this.functionArguments.bandIds.map(s=>s>=r?r-1:s);return t.extractBands(n)}_getWebGLParameters(){let e;if(this.isInputBandIdsSwizzled)e=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{e=[...this.functionArguments.bandIds],e.length===0?e=[0,1,2]:e.length<3&&(e[1]=e[1]??e[0],e[2]=e[2]??e[1]);for(let t=0;t<3;t++)e[t]=Math.min(e[t],2)}return{bandIndexMat3:Hg(e)}}_getInputBandIds(e){const t=e.length;return this.functionArguments.bandIds.map(r=>r>=t?t-1:r).map(r=>e[r])}_matchBandNames(e,t){const r=e.bandInfos.map(({name:s})=>s.toLowerCase()),n=[];for(let s=0;sl.startsWith("nearinfrared_1")),a===-1&&(a=r.findIndex(l=>l.startsWith("nearinfrared")))),a===-1)return null;n.push(a)}return n}_matchBandIds(e,t,r){const{bandCount:n}=e;return!t?.length||r&&t.some(s=>s<0||s>=n)?null:t}_matchBandWavelengths(e,t,r){const{bandInfos:n}=e,s=[];for(let l=0;l=v.minWavelength&&u<=v.maxWavelength,S=Math.abs(u-(v.minWavelength+v.maxWavelength)/2);w?Sv?v:kr+n);return e.map(r=>r/t)}_bindSourceRasters(){const{conversionParameters:e}=this.functionArguments;if(!e?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType;const r=e.length===3||t.bandCount===3&&e.length>3;return t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:r}}_processPixels(e){const t=e.pixelBlocks?.[0];return t==null?null:Sin(t,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};x([D({json:{write:!0,name:"rasterFunction"}})],L$.prototype,"functionName",void 0),x([D({type:Tin,json:{write:!0,name:"rasterFunctionArguments"}})],L$.prototype,"functionArguments",void 0),x([D()],L$.prototype,"rasterArgumentNames",void 0),x([D()],L$.prototype,"_normalizedWeights",null),L$=x([Qe("esri.layers.support.rasterFunctions.GrayscaleFunction")],L$);const Cin=L$;var cBe;let N$=cBe=class extends Fm{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(i,e){e.rasters=i.map(t=>typeof t=="number"||typeof t=="string"?t:t.toJSON())}clone(){return new cBe({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:li(this.rasters)})}};x([D({json:{write:!0}})],N$.prototype,"operation",void 0),x([D({json:{write:!0}})],N$.prototype,"rasters",void 0),x([ur("rasters")],N$.prototype,"writeRasters",null),x([D({json:{write:!0}})],N$.prototype,"processAsMultiband",void 0),N$=cBe=x([Qe("esri.layers.support.rasterFunctions.LocalFunctionArguments")],N$);const Ein=N$;let FU=class extends km{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:e}=this,t=e[0],{bandCount:r}=t,{processAsMultiband:n}=this.functionArguments;if(e.some(u=>u.bandCount!==r))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:s,rasters:o}=this.functionArguments,a=Fgt[s];if(!(a===999||o.length===a||o.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const l=t.clone();return l.bandCount=a!==999||n?r:1,this._removeStatsHistColormapVAT(l),this._updateStatistics(l),this._updatePixelType(l),this.rasterInfo=l,{success:!0,supportsGPU:l.bandCount===1&&a<=3&&(s<11||s>16)}}_processPixels(e){const{pixelBlocks:t}=e;return t==null||t.some(r=>r==null)?null:FVt(t,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:e}=this.functionArguments,t=Fgt[e],r=Object.keys(Rgt).find(l=>Rgt[l]===e)?.toLowerCase()??"undefined",n=this.outputPixelType??"f32";let[s,o]=Yx(n);const a=SF(n);return a&&(s-=1e-4,o+=1e-4),{imageCount:t,operationName:r,domainRange:[s,o],isOutputRounded:a}}_updateStatistics(e){const t=this.sourceRasterInfos[0],{operation:r}=this.functionArguments,n=Dgt(r)?.domain;if(n){e.statistics=[];for(let s=0;s({min:-s.max,max:-s.min,avg:s.avg!=null?-s.avg:void 0,stddev:s.stddev!=null?-s.stddev:void 0})))}_updatePixelType(e){const{statistics:t,pixelType:r}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:s,isInteger:o}=Dgt(n)??{domain:null,isInteger:!1};let a="f32";if(s&&o)a=Gme(s[0],s[1]);else if(n===30){const l=t?.[0];a=l?Gme(l.min,l.max):SF(r)?r:"s32"}else if(n===45&&SF(r)){const l=t?.map(({max:p})=>-p),u=t?.map(({min:p})=>-p),c=l?.length?Math.min(...l):null,h=u?.length?Math.min(...u):null;a=c!=null&&h!=null?Gme(c,h):r.startsWith("s")?r.replace("s","u"):r==="u1"||r==="u2"||r==="u4"?"s8":r==="u8"?"s16":"s32"}e.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};x([D({json:{write:!0,name:"rasterFunction"}})],FU.prototype,"functionName",void 0),x([D({type:Ein,json:{write:!0,name:"rasterFunctionArguments"}})],FU.prototype,"functionArguments",void 0),x([D()],FU.prototype,"rasterArgumentNames",void 0),FU=x([Qe("esri.layers.support.rasterFunctions.LocalFunction")],FU);const Iin=FU;var hBe;let $$=hBe=class extends Fm{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=w1e.matchAny}get normalizedNoDataValues(){const{noDataValues:i}=this;if(!i?.length)return null;let e=!1;const t=i.map(r=>{if(typeof r=="number")return e=!0,[r];if(typeof r=="string"){const n=r.trim().split(" ").filter(s=>s.trim()!=="").map(s=>Number(s));return e=e||n.length>0,n.length===0?null:n}return null});return e?t:null}clone(){return new hBe({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};x([D({json:{write:!0}})],$$.prototype,"includedRanges",void 0),x([D({json:{write:!0}})],$$.prototype,"noDataValues",void 0),x([D()],$$.prototype,"normalizedNoDataValues",null),x([D({json:{write:!0}})],$$.prototype,"noDataInterpretation",void 0),$$=hBe=x([Qe("esri.layers.support.rasterFunctions.MaskFunctionArguments")],$$);const Ain=$$;let B$=class extends km{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,this.rasterInfo=e;const{includedRanges:r,normalizedNoDataValues:n}=this.functionArguments;if(!r?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let s=[];for(let a=0;aa?.length===n[0]?.length);return{success:!0,supportsGPU:(!r||r.length<=2*uP)&&(!n||o&&n[0].length<=uP)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{outputPixelType:r,lookups:n}=this,{includedRanges:s,noDataInterpretation:o,normalizedNoDataValues:a}=this.functionArguments,l=o===w1e.matchAll;return alr(t,{includedRanges:s,noDataValues:a,outputPixelType:r,matchAll:l,lookups:n})}_getWebGLParameters(){const{includedRanges:e,normalizedNoDataValues:t}=this.functionArguments,r=new Float32Array(uP);r.fill(bF),t?.[0]?.length&&r.set(t[0]);const n=new Float32Array(uP);for(let s=0;s=n.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const o=n.clone();o.pixelType=this.outputPixelType,o.colormap=null,o.histograms=null,o.bandCount=1,o.keyProperties={...o.keyProperties,BandProperties:void 0};const[a,l,u,c]=e?[-1,1,0,.1]:[0,200,100,10];return o.statistics=[{min:a,max:l,avg:u,stddev:c}],this.rasterInfo=o,{success:!0,supportsGPU:!0}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{visibleBandID:r,infraredBandID:n,scientificOutput:s}=this.functionArguments;return Ptn(t,r,n,!s)}_getWebGLParameters(){const{visibleBandID:e,infraredBandID:t,scientificOutput:r}=this.functionArguments,n=this.isInputBandIdsSwizzled?[0,1,2]:[t,e,0];return{bandIndexMat3:Hg(n),scaled:!r}}_getInputBandIds(e){const{visibleBandID:t,infraredBandID:r}=this.functionArguments;return[r,t,0].map(n=>e[n])}};x([D({json:{write:!0,name:"rasterFunction"}})],LU.prototype,"functionName",void 0),x([D({type:Oin,json:{write:!0,name:"rasterFunctionArguments"}})],LU.prototype,"functionArguments",void 0),x([D()],LU.prototype,"rasterArgumentNames",void 0),LU=x([Qe("esri.layers.support.rasterFunctions.NDVIFunction")],LU);const Pin=LU;var pBe;let U4=pBe=class extends Fm{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new pBe({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};x([D({json:{write:!0}})],U4.prototype,"inputRanges",void 0),x([D({json:{write:!0}})],U4.prototype,"outputValues",void 0),x([D({json:{write:!0}})],U4.prototype,"noDataRanges",void 0),x([D({json:{write:!0}})],U4.prototype,"allowUnmatched",void 0),x([D({json:{write:!0}})],U4.prototype,"isLastInputRangeInclusive",void 0),U4=pBe=x([Qe("esri.layers.support.rasterFunctions.RemapFunctionArguments")],U4);const Rin=U4;let j$=class extends km{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const e=this.sourceRasterInfos[0].clone(),{pixelType:t}=e;this.outputPixelType=this._getOutputPixelType(t),e.pixelType=this.outputPixelType,e.colormap=null,e.histograms=null,e.bandCount=1,e.attributeTable=null;const{statistics:r}=e,{allowUnmatched:n,outputValues:s,inputRanges:o,noDataRanges:a,isLastInputRangeInclusive:l}=this.functionArguments;if(r!=null&&r.length&&s?.length)if(n){const u=Math.min.apply(null,[...s,r[0].min]),c=Math.max.apply(null,[...s,r[0].max]);e.statistics=[{...r[0],min:u,max:c}]}else{let u=s[0],c=u;for(let h=0;hs[h]?s[h]:u,c=c>s[h]?c:s[h];e.statistics=[{...r[0],min:u,max:c}]}return this.rasterInfo=e,this.lookup=n?null:llr({srcPixelType:t,inputRanges:o,outputValues:s,noDataRanges:a,allowUnmatched:n,isLastInputRangeInclusive:l,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!s||s.length<=uP)&&(!a||a.length<=uP)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return null;const{lookup:r,outputPixelType:n}=this;if(r){const c=Vne(t,{lut:[r.lut],offset:r.offset,outputPixelType:n});return c!=null&&r.mask&&(c.mask=hHe(t.pixels[0],t.mask,r.mask,r.offset,"u8")),c}const{inputRanges:s,outputValues:o,noDataRanges:a,allowUnmatched:l,isLastInputRangeInclusive:u}=this.functionArguments;return olr(t,{inputRanges:s,outputValues:o,noDataRanges:a,outputPixelType:n,allowUnmatched:l,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:e,noDataRanges:t,isLastInputRangeInclusive:r}=this.functionArguments,n=new Float32Array(3*uP),s=1e-5,o=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],l=a.length;for(let c=0;c0&&(n[3*c]-=s),(c=1?e*yP:e,slopeType:t,pixelSizeFactor:r??0,pixelSizePower:n??0}}};x([D({json:{write:!0,name:"rasterFunction"}})],G$.prototype,"functionName",void 0),x([D({type:kin,json:{write:!0,name:"rasterFunctionArguments"}})],G$.prototype,"functionArguments",void 0),x([D()],G$.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],G$.prototype,"isGCS",void 0),G$=x([Qe("esri.layers.support.rasterFunctions.SlopeFunction")],G$);const Lin=G$,Kgt=new Rs({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Nin(i,e){const{fillNoDataOnly:t}=e,{band:r,width:n,height:s,mask:o,outBand:a}=i;if(t&&!o)return void a.set(r);const{statisticsType:l,kernelRows:u,kernelCols:c}=e,h=l==="stddev",p=n*s,m=new Float64Array(p),v=new Float64Array(p),w=new Uint32Array(p);for(let $=0;$R-L),o?(p[w+S]=I[Math.floor((I.length-1)/2)],m[w+S]=I.length):a[w+S]=I[Math.floor((I.length-1)/2)])}}if(o)for(let v=c;v$&&($=B,k=V);o?(v[I+R]=k,w[I+R]=L.size):a[I+R]=k}}if(o)for(let S=c;S1&&a?.length&&(R=Br.combineBandMasks(a));const L=new Br({pixelType:S,width:s,height:o,pixels:h,bandMasks:a&&I.length?I:null,mask:R});return L.updateStatistics(),L}var mBe;let U$=mBe=class extends Fm{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new mBe({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:li(this.raster)})}};x([D({json:{write:!0,read:{source:["kernelRows","rows"],reader:(i,e)=>Number(i??e?.kernelRows??3)}}})],U$.prototype,"rows",void 0),x([D({json:{write:!0,read:{source:["kernelCols","cols"],reader:(i,e)=>Number(i??e?.kernelCols??3)}}})],U$.prototype,"cols",void 0),x([D({json:{write:!0}})],U$.prototype,"fillNoDataOnly",void 0),x([D({json:{read:{source:["statisticsType","type"],reader:(i,e)=>Kgt.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),Wr(Kgt)],U$.prototype,"statisticsType",void 0),U$=mBe=x([Qe("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],U$);const Uin=U$;let NU=class extends km{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:e}=this.functionArguments.toJSON();if(e<1||e>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${e}`};const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(t.pixelType);const r=t.clone();r.pixelType=this.outputPixelType;const{statisticsType:n}=this.functionArguments;return n==="stddev"&&this._removeStatsHistColormapVAT(r),this.rasterInfo=r,{success:!0,supportsGPU:r.bandCount<=3&&e<5}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return t;const{statisticsType:r,rows:n,cols:s,fillNoDataOnly:o}=this.functionArguments;return Gin(t,{kernelRows:n,kernelCols:s,fillNoDataOnly:o,outputPixelType:this.outputPixelType,statisticsType:r,mirrorEdges:!0})}_getWebGLParameters(){const{rows:e,cols:t,statisticsType:r,fillNoDataOnly:n}=this.functionArguments;return{fillNoDataOnly:n,kernelRows:e,kernelCols:t,statisticsType:r,clampRange:Yx(this.outputPixelType)}}};x([D({json:{write:!0,name:"rasterFunction"}})],NU.prototype,"functionName",void 0),x([D({type:Uin,json:{write:!0,name:"rasterFunctionArguments"}})],NU.prototype,"functionArguments",void 0),x([D()],NU.prototype,"rasterArgumentNames",void 0),NU=x([Qe("esri.layers.support.rasterFunctions.StatisticsFunction")],NU);const zin=NU;var gBe;let z$=gBe=class extends Fm{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(i,e){if(!i?.length)return null;const t=[];return i.forEach(r=>{const n={min:r.min,max:r.max,avg:r.avg??r.mean,stddev:r.stddev??r.standardDeviation};t.push(n)}),t}writeStatistics(i,e,t){if(!i?.length)return;const r=[];i.forEach(n=>{const s={...n,mean:n.avg,standardDeviation:n.stddev};delete s.avg,delete s.stddev,r.push(s)}),e[t]=r}clone(){return new gBe({statistics:li(this.statistics),histograms:li(this.histograms)})}};x([D({json:{write:!0}})],z$.prototype,"statistics",void 0),x([Mi("statistics")],z$.prototype,"readStatistics",null),x([ur("statistics")],z$.prototype,"writeStatistics",null),x([D({json:{write:!0}})],z$.prototype,"histograms",void 0),z$=gBe=x([Qe("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],z$);const Vin=z$;let V4=class extends km{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const t=e.clone(),{statistics:r,histograms:n}=this.functionArguments;return n&&(t.histograms=n),r&&(t.statistics=r),this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};x([D({json:{write:!0,name:"rasterFunction"}})],V4.prototype,"functionName",void 0),x([D({type:Vin,json:{write:!0,name:"rasterFunctionArguments"}})],V4.prototype,"functionArguments",void 0),x([D()],V4.prototype,"rasterArgumentNames",void 0),x([D({json:{write:!0}})],V4.prototype,"indexedColormap",void 0),x([D()],V4.prototype,"isNoopProcess",void 0),V4=x([Qe("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],V4);const Hin=V4;var yBe;const Win=new Rs({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let Ay=yBe=class extends Fm{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(i,e,t){i?.length&&(Array.isArray(i[0])||(i=i.map(r=>[r.min,r.max,r.avg,r.stddev])),e[t]=i)}clone(){return new yBe({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:li(this.statistics),gamma:li(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:li(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};x([D({type:Boolean,json:{write:!0}})],Ay.prototype,"computeGamma",void 0),x([D({type:Boolean,json:{name:"dra",write:!0}})],Ay.prototype,"dynamicRangeAdjustment",void 0),x([D({type:[Number],json:{write:!0}})],Ay.prototype,"gamma",void 0),x([D()],Ay.prototype,"histograms",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"maxPercent",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"minPercent",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"numberOfStandardDeviations",void 0),x([D({type:Number,json:{name:"max",write:!0}})],Ay.prototype,"outputMax",void 0),x([D({type:Number,json:{name:"min",write:!0}})],Ay.prototype,"outputMin",void 0),x([D({type:Number,json:{write:!0}})],Ay.prototype,"sigmoidStrengthLevel",void 0),x([D({json:{type:[[Number]],write:!0}})],Ay.prototype,"statistics",void 0),x([ur("statistics")],Ay.prototype,"writeStatistics",null),x([Wr(Win)],Ay.prototype,"stretchType",void 0),x([D({type:Boolean,json:{write:!0}})],Ay.prototype,"useGamma",void 0),Ay=yBe=x([Qe("esri.layers.support.rasterFunctions.StretchFunctionArguments")],Ay);const qin=Ay;let H4=class extends km{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const e=this.sourceRasterInfos[0],{pixelType:t}=e,{functionArguments:r}=this,{dynamicRangeAdjustment:n,gamma:s,useGamma:o}=r;if(!n&&["u8","u16","s8","s16"].includes(t)){const l=$5(r.toJSON(),{rasterInfo:e}),u=SF(this.outputPixelType)?"round":"float";this.lookup=ZLe({pixelType:t,...l,gamma:o?s:null,rounding:u}),this.cutOffs=l}else n||(this.cutOffs=$5(r.toJSON(),{rasterInfo:e}));this.outputPixelType=this._getOutputPixelType(t);const a=e.clone();return a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed"),this.rasterInfo=a,{success:!0,supportsGPU:!n}}_processPixels(e){const t=e.pixelBlocks?.[0];if(t==null)return t;const{lookup:r}=this;if(r)return Vne(t,{...r,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:n}=this,s=this.cutOffs||$5(n.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:t}),o=n.useGamma?n.gamma:null;return Hme(t,{...s,gamma:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:e=0,outputMax:t=255,gamma:r,useGamma:n}=this.functionArguments,s=this.rasterInfo.bandCount>=2?3:1,o=n&&r?.length?IHe(s,r):[1,1,1],{minCutOff:a,maxCutOff:l}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],l[1]=l[2]=l[0]);const u=new Float32Array(s);let c;for(c=0;c1||e.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:t}=this.functionArguments;if(!t)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(e.pixelType);const r=e.clone();return r.pixelType=this.outputPixelType,r.bandCount=1,r.dataType!=="thematic"&&(r.keyProperties=r.keyProperties?{...r.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=r,{success:!0,supportsGPU:!0}}_processPixels(e){return e.pixelBlocks?.[0]}};x([D({json:{write:!0,name:"rasterFunction"}})],V$.prototype,"functionName",void 0),x([D({type:Xin,json:{write:!0,name:"rasterFunctionArguments"}})],V$.prototype,"functionArguments",void 0),x([D()],V$.prototype,"rasterArgumentNames",void 0),x([D()],V$.prototype,"isNoopProcess",void 0),V$=x([Qe("esri.layers.support.rasterFunctions.TableFunction")],V$);const Jin=V$,Lp=new Map;function LVt(i,e){const{rasterFunctionArguments:t}=i;t&&(t.rasters||[t.raster]).forEach(r=>{r&&typeof r!="number"&&(typeof r=="string"?r.startsWith("http")&&(e.includes(r)||e.push(r)):"rasterFunctionArguments"in r&&LVt(r,e))})}function oKe(i,e){if(e=e??{},"function"in(i=li(i))&&"arguments"in i&&i.arguments){const t=BVt(i,new Map,e);if(wBe(t),!t.renderingRule)throw new qe("raster-function-helper","Unsupported raster function json.");i=t.renderingRule}if("rasterFunction"in i)return NVt(i=_Be(i),e);throw new qe("raster-function-helper","unsupported raster function json.")}function Kin(i,e){return e[0]==="rasters"&&Array.isArray(i.rasters)?i.rasters:e.map(t=>i[t])}function Zgt(i){return!!(i&&typeof i=="object"&&i.rasterFunction&&i.rasterFunctionArguments)}function _Be(i){const{rasterFunction:e,rasterFunctionArguments:t}=i,r={};for(const n in t){let s=t[n];const o=n.toLowerCase();if(o==="rasters"&&Array.isArray(s))r.rasters=s.map(a=>Zgt(a)?_Be(a):a);else switch(Zgt(s)&&(s=_Be(s)),o){case"dra":r.dra=s;break;case"pspower":r.psPower=s;break;case"pszfactor":r.psZFactor=s;break;case"bandids":r.bandIds=s;break;default:r[n[0].toLowerCase()+n.slice(1)]=s}}return e!=="Local"||r.rasters?.length||(r.rasters=["$$"]),{...i,rasterFunctionArguments:r}}function NVt(i,e){const{rasterFunction:t,rasterFunctionArguments:r}=i,n=i.outputPixelType?.toLowerCase();if(t==null||!Lp.has(t))throw new qe("raster-function-helper",`unsupported raster function: ${t}`);const s=Lp.get(t),o=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...i,outputPixelType:n}),{rasterArgumentNames:a}=o,l=[],u=Kin(r,a),c=a[0]==="rasters",h=[];for(let p=0;ptypeof n=="object"&&n.type==="RasterFunctionVariable"?bBe(n,e):n);if("value"in t&&["number","string","boolean"].includes(typeof t.value))return t.value;if(i.isDataset&&t.type!=="Scalar")return"$$";if(!("type"in t))return t;let r=t;switch(t.type){case"Scalar":r=t.value;break;case"AlgorithmicColorRamp":r=Qgt(t);break;case"MultiPartColorRamp":r={type:"multipart",colorRamps:t.ArrayOfColorRamp.map(Qgt)};break;case"ArgumentArray":if(t.elements?.length&&t.elements[0].type!=="RasterStatistics"){const n=[];for(let s=0;s{if(typeof a=="object")if(a._object_ref_id!=null){if(!t.has(a._object_ref_id))throw new qe("raster-function-helper",`unsupported raster function json. _object_ref_id: ${s} does not exist`);const u=t.get(o);u&&typeof u=="object"?Object.assign(a,u):s[l]=u}else wBe({renderingRule:a,templates:t})}));else{if(!t.has(o))throw new qe("raster-function-helper",`unsupported raster function json. _object_ref_id: ${o} does not exist`);const a=t.get(o);n!=="_object_ref_id"?r[n]=a:a&&typeof a=="object"&&Object.assign(r,a)}}}function Zin(i){i.Statistics?.length&&typeof i.Statistics=="object"&&(i.Statistics=i.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),i.NumberOfStandardDeviation!=null&&(i.NumberOfStandardDeviations=i.NumberOfStandardDeviation,delete i.NumberOfStandardDeviation)}function Qin(i){i.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete i.ColorRamp,i.ColormapName="Random"),i.ColorSchemeType===0&&delete i.ColorRamp}function ern(i){i.ConvolutionType!=null&&(i.Type=i.ConvolutionType,delete i.ConvolutionType)}function trn(i){i.NoDataValues?.length&&typeof i.NoDataValues[0]=="string"&&(i.NoDataValues=i.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}Lp.set("Arithmetic",{desc:"Arithmetic Function",ctor:btn,rasterArgumentNames:["rasters"]}),Lp.set("Aspect",{desc:"Aspect Function",ctor:xtn,rasterArgumentNames:["raster"]}),Lp.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Xtn,rasterArgumentNames:["raster"]}),Lp.set("Colormap",{desc:"Colormap Function",ctor:ain,rasterArgumentNames:["raster"]}),Lp.set("CompositeBand",{desc:"CompositeBand Function",ctor:uin,rasterArgumentNames:["rasters"]}),Lp.set("Convolution",{desc:"Convolution Function",ctor:vin,rasterArgumentNames:["raster"]}),Lp.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:hin,rasterArgumentNames:["raster"]}),Lp.set("ExtractBand",{desc:"ExtractBand Function",ctor:xin,rasterArgumentNames:["raster"]}),Lp.set("Curvature",{desc:"Curvature Function",ctor:bin,rasterArgumentNames:["raster"]}),Lp.set("Grayscale",{desc:"Grayscale Function",ctor:Cin,rasterArgumentNames:["raster"]}),Lp.set("Clip",{desc:"Clip Function",ctor:Ktn,rasterArgumentNames:["raster"]}),Lp.set("Local",{desc:"Local Function",ctor:Iin,rasterArgumentNames:["rasters"]}),Lp.set("Mask",{desc:"Mask Function",ctor:Min,rasterArgumentNames:["raster"]}),Lp.set("NDVI",{desc:"NDVI Function",ctor:Pin,rasterArgumentNames:["raster"]}),Lp.set("Remap",{desc:"Remap Function",ctor:Din,rasterArgumentNames:["raster"]}),Lp.set("Slope",{desc:"Slope Function",ctor:Lin,rasterArgumentNames:["raster"]}),Lp.set("Statistics",{desc:"Focal Statistics Function",ctor:zin,rasterArgumentNames:["raster"]}),Lp.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Hin,rasterArgumentNames:["raster"]}),Lp.set("Stretch",{desc:"Stretch Function",ctor:Yin,rasterArgumentNames:["raster"]}),Lp.set("Table",{desc:"Attribute Table Function",ctor:Jin,rasterArgumentNames:["raster"]});var xBe;function aKe(i,e,t){return!_0(i,e,t)}function g7(i,e,t){const r=aKe(i,e,t);if(r&&!qx())throw new qe("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(i){i[i.None=0]="None",i[i.North=1]="North",i[i.South=2]="South",i[i.Both=3]="Both"})(xBe||(xBe={}));const eyt=(i,e,t,r=0)=>{if(t[0]===1)return[0,0];let n=1,s=-1,o=1,a=-1;for(let S=0;Si[S]?i[S]:n,s=s>i[S]?s:i[S],o=o>i[S+1]?i[S+1]:o,a=a>i[S+1]?a:i[S+1]);const{cols:l,rows:u}=e,c=(s-n)/l/t[0],h=(a-o)/u/t[1],p=2*r;let m=0,v=!1,w=[0,0];for(let S=0;Sm&&(m=B+$,w=[B,$]),p&&m>p){v=!0;break}}if(v)break}return w},irn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},Nbe=32,$be=4,TPe=$be,CPe=new Map,EPe=new Map,Bbe=500;async function jbe(){qx()||await FS()}function GVt(i,e,t){return g7(i.spatialReference,e),t?Une(e,i.spatialReference,i):Une(i.spatialReference,e,i)}function aoe(i,e,t,r=null){const n=i.spatialReference;if(n.equals(e))return i;g7(n,e,r);const s=t.center,o=new hr({xmin:s.x-i.x/2,xmax:s.x+i.x/2,ymin:s.y-i.y/2,ymax:s.y+i.y/2,spatialReference:n}),a=Wc(o,e,r),l=q1(e);let u;if(a==null||l!=null&&a.width>=l){const c=pu(n)/pu(e);u={x:i.x*c,y:i.y*c}}else u={x:a.width,y:a.height};return u}function mx(i,e=.01){return pu(i)?e/pu(i):0}function Gbe(i,e,t=null,r=!0){const n=i.spatialReference;if(n.equals(e))return i;g7(n,e,t);const s=Wc(i,e,t);return r&&s&&UVt([i],[s],n,e),s}function UVt(i,e,t,r){const n=Ube(t,!0),s=Ube(r,!0),o=mx(t,Bbe),a=mx(r,Bbe);if(o&&n!=null&&s!=null)for(let l=0;l=s[1]-a&&Math.abs(c-n[0])new $i(a[0],a[1],t)),o=Wc(s,r,n);return n&&UVt(s,o,t,r),o.map(a=>a?[a.x,a.y]:[NaN,NaN])}function tyt(i){const{inSR:e,outSR:t,datumTransformation:r}=i,n=RB(e),{points:s,mask:o}=lKe(i,n);if(!e.isGeographic){const l=e.wkid?tx.coordsys(e.wkid):tx.fromString(e.isGeographic?ku.PE_TYPE_GEOGCS:ku.PE_TYPE_PROJCS,e.wkt2||e.wkt);xne.projToGeog(l,s.length,s)}if(r!=null&&r.steps.length){let l;if(t.isGeographic&&(l=s.map(([c])=>c>179.9955?1:c<-179.9955?-1:0)),r.steps.forEach(c=>{const h=c.wkid?tx.geogtran(c.wkid):tx.fromString(ku.PE_TYPE_GEOGTRAN,c.wkt);Fve.geogToGeog(h,s.length,s,null,c.isInverse?ku.PE_TRANSFORM_2_TO_1:ku.PE_TRANSFORM_1_TO_2)}),l)for(let c=0;c179.9955?1:p<-179.9955?-1:0;h&&m&&h!==m&&(s[c][0]=h>0?p+360:p-360)}}if(!t.isGeographic){const l=RB(t,!0),u=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];orn(s,u);const c=t.wkid?tx.coordsys(t.wkid):tx.fromString(t.isGeographic?ku.PE_TYPE_GEOGCS:ku.PE_TYPE_PROJCS,t.wkt2||t.wkt);xne.geogToProj(c,s.length,s)}let a=s;if(o&&s.length!==o.length){a=[];for(let l=0,u=0;lS.getInclusive()===1&&S.getKind()===1);if(!o){if(o=n.find(S=>S.getInclusive()===1&&S.getKind()===0),!o)return null;s=!0}const a=t?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),u=o.getCoord();if(s)return{isEnvelope:s,isPannable:l,vertices:u,coef:null,bbox:[u[0][0]-e,u[0][1]-e,u[1][0]+e,u[1][1]+e],poleLocation:a};let c=0;const h=[];let[p,m]=u[0],[v,w]=u[0];for(let S=0,I=u.length;SR?v:R,w=w>L?w:L}return{isEnvelope:!1,isPannable:l,vertices:u,coef:h,bbox:[p,m,v,w],poleLocation:a}}function lKe(i,e){const t=[],{cols:r,rows:n,xres:s,yres:o,usePixelCenter:a}=i;let{xmin:l,ymax:u}=i;if(a&&(l+=s/2,u-=o/2),e==null){for(let m=0;m=m&&L<=w;for(let B=0;B=v&&$<=S&&(t.push([L,$]),c[R]=1)}}return{points:t,mask:c}}const h=e.coef,p=[];for(let m=0;m=B&&v<=$){const Y=L*v+k;w.push(Y),S.push(V)}}let I=w;if(w.length>2){let R=S[0]===2?0:S[0],L=w[0];I=[];for(let k=1;kk-B)}else w[0]>w[1]&&(I=[w[1],w[0]]);p.push(I)}for(let m=0,v=0;m=R[0]&&w<=R[1]&&(t.push([w,I]),c[v]=1);else if(R.length>2){let L=!1;for(let k=0;k=R[k]&&w<=R[k+1]){L=!0;break}L&&(t.push([w,I]),c[v]=1)}}}return{points:t,mask:c}}function orn(i,e){const[t,r]=e;for(let n=0;nr)&&(i[n]=[NaN,NaN])}}function zVt(i,e){const t=q1(i[0].spatialReference);if(i.length<2||t==null||(e=e??mx(i[0].spatialReference),(i=i.filter(a=>a.width>e)).length===1))return i[0];let{xmin:r,xmax:n,ymin:s,ymax:o}=i[0];for(let a=1;amx(n)){const{xmin:u,xmax:c}=i;for(let h=0;h<=s;h++){const p=h===0?u:-o/2,m=h===s?c-o*h:o/2;l[h]=new hr({xmin:p,xmax:m,ymin:i.ymin,ymax:i.ymax,spatialReference:n})}}return zVt(l.map(u=>ryt(u,e,t,r)).filter(Ga))}function SBe(i,e,t){if(i.type==="extent"){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=i;i=new $s({rings:[[[r,o],[s,o],[s,n],[r,n],[r,o]]],spatialReference:a})}return i.spatialReference.equals(e)?i:(g7(i.spatialReference,e,t),Wc(i,e,t))}function arn(i,e){const t=q1(e);if(t==null)return null;let{xmin:r,ymin:n,xmax:s,ymax:o}=i;const a=i.spatialReference,l=new $s({spatialReference:a,rings:[[[r,n],[s,n],[s,o],[r,o],[r,n]]]}),u=Wc(l,e);if(u.rings.length!==2||!u.rings[0].length||!u.rings[1].length)return null;const{rings:c}=u,h=mx(a),p=new hr({spatialReference:e});for(let m=0;m<2;m++){r=s=c[m][0][0],n=o=c[m][0][1];for(let v=0;vc[m][v][0]?c[m][v][0]:r,s=sc[m][v][1]?c[m][v][1]:n,o=o=o.ymax))return null;if(!r||!o)return o;const a=Ube(s,!0),l=Ube(e,!0);if(a==null||l==null)return o;const u=mx(s,.001),c=mx(s,Bbe),h=mx(e,.001);if(Math.abs(o.xmin-l[0])c){o.xmin=l[0];const v=[];v.push(new $i(i.xmax,i.ymin,s)),v.push(new $i(i.xmax,(i.ymin+i.ymax)/2,s)),v.push(new $i(i.xmax,i.ymax,s));const w=v.map(S=>Gbe(S,e,t)).filter(S=>!isNaN(S?.x)).map(S=>S.x);o.xmax=Math.max.apply(null,w)}if(mc){o.xmax=l[1];const v=[];v.push(new $i(i.xmin,i.ymin,s)),v.push(new $i(i.xmin,(i.ymin+i.ymax)/2,s)),v.push(new $i(i.xmin,i.ymax,s));const w=v.map(S=>Gbe(S,e,t)).filter(S=>!isNaN(S?.x)).map(S=>S.x);o.xmin=Math.min.apply(null,w)}}else{const p=mx(e,.001);Math.abs(o.xmin-l[0])0&&r.outofBoundPointCountTPe)&&(aKe(l,u,i.datumTransformation)&&(l.isGeographic||RB(l)),t=[$be,$be],r=IPe({...i,spacing:t}),n={cols:r.size[0]+1,rows:r.size[1]+1},o=eyt(r.offsets,n,t,TPe)),r.error=o,t[0]>1&&(r.coefficients=syt(r.offsets,n,s)),i.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(u.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:t};else{const c=RB(l);if(c!=null&&!c.isEnvelope){const h=urn(l),p=FF(i.projectedExtent,h),{offsets:m}=IPe({...i,srcBufferExtent:p,spacing:t}),v=syt(m,n,s);r.gcsGrid={offsets:m,coefficients:v,spacing:t}}}return r}function IPe(i){const{projectedExtent:e,srcBufferExtent:t,pixelSize:r,datumTransformation:n,rasterTransform:s}=i,o=e.spatialReference,a=t.spatialReference,l=g7(o,a),{xmin:u,ymin:c,xmax:h,ymax:p}=e,m=q1(a),v=m!=null&&(i.hasWrapAround||s?.type==="gcs-shift"),w=i.spacing||[Nbe,Nbe],S=w[0]*r.x,I=w[1]*r.y,R=w[0]===1,L=Math.ceil((h-u)/S-.1/w[0])+(R?0:1),k=Math.ceil((p-c)/I-.1/w[1])+(R?0:1),B=rrn({cols:L,rows:k,xmin:u,ymax:p,xres:S,yres:I,inSR:o,outSR:a,datumTransformation:n,preferPE:w[0]<=$be,usePixelCenter:R}),$=[];let V,Y=0;const K=R?-1:NaN,{xmin:Q,xmax:re,ymax:ne,width:de,height:pe}=t,H=mx(a,Bbe),Z=m!=null&&Q>0&&re>m/2;let ae=!1;if(l){const fe=RB(o);ae=fe!=null&&fe.poleLocation>0}for(let fe=0;fere&&Ie[0]>m/2-H?Ie[0]-=m:v&&fe===0&&Ie[0]<0&&Z&&!s&&(Ie[0]+=m),!Ie||isNaN(Ie[0])||isNaN(Ie[1]))$.push(K),$.push(K),be.push(null),Y++;else{if(s){const Te=s.inverseTransform(new $i({x:Ie[0],y:Ie[1],spatialReference:a}));Ie=[Te.x,Te.y]}be.push(Ie),fe>0&&v&&V[_e]&&Ie[0]re&&Ie[0]>m&&(Ie[0]-=m)),$.push((Ie[0]-Q)/de),$.push((ne-Ie[1])/pe)}}V=be}return{offsets:$,error:null,coefficients:null,outofBoundPointCount:Y,spacing:w,size:R?[L,k]:[L-1,k-1]}}function syt(i,e,t){const{cols:r,rows:n}=e,s=new Float32Array((r-1)*(n-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;ln){const a=i.xmin-n;o=-Math.ceil(a/s)}return new hr({spatialReference:i.spatialReference,xmin:i.xmin+o*s,ymin:i.ymin,xmax:i.xmax+o*s,ymax:i.ymax})}function TBe(i,e,t){const{storageInfo:r,pixelSize:n}=e;let s=0,o=!1;const{pyramidResolutions:a}=r,l=r.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,r.tileInfo.dpi/96)):1,u=(i.x+i.y)/2/l;if(a!=null&&a.length){const v=a[a.length-1],w=(v.x+v.y)/2,S=(n.x+n.y)/2;if(u<=S)s=0;else if(u>=w)s=a.length,o=u/w>8;else{let R,L=S;for(let k=1;k<=a.length;k++){if(R=(a[k-1].x+a[k-1].y)/2,u<=R){u===R?s=k:t==="down"?(s=k-1,o=u/L>8):s=t==="up"||u-L>R-u||u/L>2?k:k-1;break}L=R}}const I=s===0?n:a[s-1];return o&&Math.min(I.x,I.y)*pu(e.spatialReference)>19567&&(o=!1),{pyramidLevel:s,pyramidResolution:new $i({x:I.x,y:I.y,spatialReference:e.spatialReference}),excessiveReading:o}}const c=Math.log(i.x/n.x)/Math.LN2,h=Math.log(i.y/n.y)/Math.LN2,p=e.storageInfo.maximumPyramidLevel||0;s=t==="down"?Math.floor(Math.min(c,h)):t==="up"?Math.ceil(Math.max(c,h)):Math.round((c+h)/2),s<0?s=0:s>p&&(o=s>p+3,s=p);const m=2**s;return{pyramidLevel:s,pyramidResolution:new $i({x:m*e.nativePixelSize.x,y:m*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}function CBe(i,e){const{pixelSize:t,extent:r}=i,n=GVt(r,e,!1);return FF(crn(r,(t.x+t.y)/16),e,n)}function drn(i,e,t){const r=t?.tileSize,n=t?.alignGlobalDatasetWithAGOL,{extent:s,spatialReference:o,pixelSize:a}=i,l=aoe(new $i({x:a.x,y:a.y,spatialReference:o}),e,s);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const u=(l.x+l.y)/2,c=pu(e),h=u*c*96*39.37,p=e.isGeographic?256/r*2958287637958547e-7:256/r*591657527591555e-6;let m=i.dataType==="vector-magdir"||i.dataType==="vector-uv";const v=CBe(i,e),w=Math.min(Math.ceil(Math.log(Math.min(i.width,i.height)/32)/Math.LN2),Math.ceil(Math.log(p/2/h)/Math.LN2));if(!m&&n&&(e.isGeographic||e.isWebMercator)){const Y=q1(e);if(m=wre(v)>0||Y!=null&&v.width>Y/4,!m&&Y!=null){let K=-1;if(w<3)K=2**w*u*r;else if(i.storageInfo){const{maximumPyramidLevel:re=0,pyramidScalingFactor:ne=2}=i.storageInfo;K=ne**re*u*r}const Q=Math.ceil(Y/K);m=Q===1||Q===2&&Y/2-v.xmax=V;)I/=L,S.x/=L,S.y/=L,k.push(I),B.push({x:S.x,y:S.y});return{projectedPixelSize:l,scales:k,srcResolutions:B,isCustomTilingScheme:!m}}let Qee=class extends Ci{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};x([D()],Qee.prototype,"affectsPixelSize",null),x([D({json:{write:!0}})],Qee.prototype,"spatialReference",void 0),Qee=x([Qe("esri.layers.support.rasterTransforms.BaseRasterTransform")],Qee);const cKe=Qee;var EBe;let ete=EBe=class extends cKe{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(i){return(i=i.clone()).type==="point"?(i.x>180+this.tolerance&&(i.x-=360),i):(i.xmin>=180-this.tolerance?(i.xmax-=360,i.xmin-=360):i.xmax>180+this.tolerance&&(i.xmin=-180,i.xmax=180),i)}inverseTransform(i){return(i=i.clone()).type==="point"?(i.x<-this.tolerance&&(i.x+=360),i):(i.xmin<-this.tolerance&&(i.xmin+=360,i.xmax+=360),i)}clone(){return new EBe({tolerance:this.tolerance})}};x([Wr({GCSShiftXform:"gcs-shift"})],ete.prototype,"type",void 0),x([D()],ete.prototype,"tolerance",void 0),ete=EBe=x([Qe("esri.layers.support.rasterTransforms.GCSShiftTransform")],ete);const VVt=ete;var IBe;let Iye=IBe=class extends cKe{constructor(){super(...arguments),this.type="identity"}clone(){return new IBe}};x([Wr({IdentityXform:"identity"})],Iye.prototype,"type",void 0),Iye=IBe=x([Qe("esri.layers.support.rasterTransforms.IdentityTransform")],Iye);const prn=Iye;var ABe;function MBe(i,e,t){const{x:r,y:n}=e;if(t<2)return{x:i[0]+r*i[2]+n*i[4],y:i[1]+r*i[3]+n*i[5]};if(t===2){const p=r*r,m=n*n,v=r*n;return{x:i[0]+r*i[2]+n*i[4]+p*i[6]+v*i[8]+m*i[10],y:i[1]+r*i[3]+n*i[5]+p*i[7]+v*i[9]+m*i[11]}}const s=r*r,o=n*n,a=r*n,l=s*r,u=s*n,c=r*o,h=n*o;return{x:i[0]+r*i[2]+n*i[4]+s*i[6]+a*i[8]+o*i[10]+l*i[12]+u*i[14]+c*i[16]+h*i[18],y:i[1]+r*i[3]+n*i[5]+s*i[7]+a*i[9]+o*i[11]+l*i[13]+u*i[15]+c*i[17]+h*i[19]}}function oyt(i,e,t){const{xmin:r,ymin:n,xmax:s,ymax:o,spatialReference:a}=e;let l=[];if(t<2)l.push({x:r,y:o}),l.push({x:s,y:o}),l.push({x:r,y:n}),l.push({x:s,y:n});else{let h=10;for(let p=0;pMBe(i,h,t));const u=l.map(h=>h.x),c=l.map(h=>h.y);return new hr({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,c),ymax:Math.max.apply(null,c),spatialReference:a})}function frn(i){const[e,t,r,n,s,o]=i,a=r*o-s*n,l=s*n-r*o;return[(s*t-e*o)/a,(r*t-e*n)/l,o/a,n/l,-s/a,-r/l]}let D2=ABe=class extends cKe{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(i,e){const{coeffX:t,coeffY:r}=e;if(!t?.length||!r?.length||t.length!==r.length)return null;const n=[];for(let s=0;s0}forwardTransform(i){if(i.type==="point"){const e=MBe(this.forwardCoefficients,i,this.polynomialOrder);return new $i({x:e.x,y:e.y,spatialReference:i.spatialReference})}return oyt(this.forwardCoefficients,i,this.polynomialOrder)}inverseTransform(i){if(i.type==="point"){const e=MBe(this.inverseCoefficients,i,this.polynomialOrder);return new $i({x:e.x,y:e.y,spatialReference:i.spatialReference})}return oyt(this.inverseCoefficients,i,this.polynomialOrder)}clone(){return new ABe({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};x([D({json:{write:!0}})],D2.prototype,"polynomialOrder",void 0),x([D()],D2.prototype,"forwardCoefficients",void 0),x([Mi("forwardCoefficients",["coeffX","coeffY"])],D2.prototype,"readForwardCoefficients",null),x([ur("forwardCoefficients")],D2.prototype,"writeForwardCoefficients",null),x([D({json:{write:!0}})],D2.prototype,"inverseCoefficients",null),x([Mi("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],D2.prototype,"readInverseCoefficients",null),x([ur("inverseCoefficients")],D2.prototype,"writeInverseCoefficients",null),x([D()],D2.prototype,"affectsPixelSize",null),x([Wr({PolynomialXform:"polynomial"})],D2.prototype,"type",void 0),D2=ABe=x([Qe("esri.layers.support.rasterTransforms.PolynomialTransform")],D2);const LCe=D2,HVt={GCSShiftXform:VVt,IdentityXform:prn,PolynomialXform:LCe},mrn=Object.keys(HVt);function grn(i){const e=i?.type;return!i||mrn.includes(e)}function WVt(i){if(!i?.type)return null;const t=HVt[i?.type];if(t){const r=new t;return r.read(i),r}return null}let yrn=class{convertVectorFieldData(e){const t=Br.fromJSON(e.pixelBlock),r=AW(t,e.type);return Promise.resolve(r!=null?r.toJSON():null)}computeStatisticsHistograms(e){const t=Br.fromJSON(e.pixelBlock),r=nSe(t);return Promise.resolve(r)}async decode(e){const t=await A1e(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=Br.fromJSON(e.pixelBlock),e.extent=e.extent?hr.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(e){this.symbolizer=AHe.fromJSON(e.symbolizerJSON),e.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=oKe(e.rasterFunctionJSON)}async process(e){const t=this.rasterFunction.process({extent:hr.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(r=>r!=null?Br.fromJSON(r):null),primaryPixelSizes:e.primaryPixelSizes?.map(r=>r!=null?$i.fromJSON(r):null),primaryRasterIds:e.primaryRasterIds});return t!=null?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(Br.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(e){const t=CHe(Br.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=aRt(Br.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,e.useBilinear===!1);return t&&t.forEach((r,n)=>{t.set(n,r?.toJSON())}),Promise.resolve(t)}clipTile(e){const t=Br.fromJSON(e.pixelBlock),r=lRt({...e,pixelBlock:t});return Promise.resolve(r?.toJSON())}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map(o=>o?new Br(o):null),r=Bie(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let n,s=r;return e.coefs&&(s=dHe(r,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(n=cRt(e.destDimension,e.gcsGrid),s=dRt(s,e.isUV?"vector-uv":"vector-magdir",n)),{pixelBlock:s?.toJSON(),localNorthDirections:n}}async createFlowMesh(e,t){const r={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:n,indexData:s}=await FHe(e.meshType,e.simulationSettings,r,t.signal);return{result:{vertexBuffer:n.buffer,indexBuffer:s.buffer},transferList:[n.buffer,s.buffer]}}async getProjectionOffsetGrid(e){const t=hr.fromJSON(e.projectedExtent),r=hr.fromJSON(e.srcBufferExtent);let n=null;e.datumTransformationSteps&&(n=new Gne({steps:e.datumTransformationSteps})),(e.includeGCSGrid||aKe(t.spatialReference,r.spatialReference,n))&&await jbe();const s=e.rasterTransform?WVt(e.rasterTransform):null;return uKe({...e,projectedExtent:t,srcBufferExtent:r,datumTransformation:n,rasterTransform:s})}};const vrn=Object.freeze(Object.defineProperty({__proto__:null,default:yrn},Symbol.toStringTag,{value:"Module"}));let pX=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&z9(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*ayt);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;eNCe());function zbe(i){return i?lyt(Ef(i.origin),Ef(i.direction)):lyt(gr(),gr())}function lyt(i,e){return{origin:i,direction:e}}function uyt(i,e){const t=Trn.get();return t.origin=i,t.direction=e,t}function xrn(i,e,t=zbe()){return Px(t.origin,i),uh(t.direction,e,i),t}function Srn(i,e,t){const r=yE(i.direction,uh(t,e,i.origin));return hl(t,i.origin,Gc(t,i.direction,r)),t}const Trn=new pX(()=>zbe()),Crn=sT();function sT(){return EE()}const Ern=$2e,Irn=$2e;function Pq(i,e){return Fne(e,i)}function Arn(i,e){return Vb(i[0],i[1],i[2],e)}function Mrn(i){return i}function Orn(i){i[0]=i[1]=i[2]=i[3]=0}function Prn(i,e){return i[0]=i[1]=i[2]=0,i[3]=e,i}function y9(i){return i[3]}function Rrn(i){return i}function Drn(i,e,t,r){return Vb(i,e,t,r)}function Frn(i,e,t){return i!==t&&(t[0]=i[0],t[1]=i[1],t[2]=i[2]),t[3]=i[3]+e,t}function krn(i,e,t){return di.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),i!==t&&Pq(i,t),t}function $Ce(i,e,t){if(e==null||!qVt(i,e,Vbe))return!1;let{t0:r,t1:n}=Vbe;if((r<0||n0)&&(r=n),r<0)return!1;if(t){const{origin:s,direction:o}=e;t[0]=s[0]+o[0]*r,t[1]=s[1]+o[1]*r,t[2]=s[2]+o[2]*r}return!0}function Lrn(i,e,t){const r=xrn(e,t);if(!qVt(i,r,Vbe))return[];const{origin:n,direction:s}=r,{t0:o,t1:a}=Vbe,l=u=>{const c=gr();return gb(c,n,s,u),hKe(i,c,c)};return Math.abs(o-a)ZVt());function Qde(i,e){for(let t=0;t=e[3])return!1}return!0}var cyt,Uh;(function(i){i[i.LEFT=0]="LEFT",i[i.RIGHT=1]="RIGHT",i[i.BOTTOM=2]="BOTTOM",i[i.TOP=3]="TOP",i[i.NEAR=4]="NEAR",i[i.FAR=5]="FAR"})(cyt||(cyt={})),function(i){i[i.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",i[i.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",i[i.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",i[i.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",i[i.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",i[i.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",i[i.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",i[i.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(Uh||(Uh={}));Uh.FAR_BOTTOM_RIGHT,Uh.NEAR_BOTTOM_RIGHT,Uh.NEAR_BOTTOM_LEFT,Uh.FAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_RIGHT,Uh.NEAR_TOP_RIGHT,Uh.NEAR_TOP_LEFT,Uh.FAR_BOTTOM_RIGHT,Uh.FAR_BOTTOM_LEFT,Uh.FAR_TOP_LEFT,Uh.FAR_TOP_RIGHT,Uh.NEAR_BOTTOM_RIGHT,Uh.FAR_BOTTOM_RIGHT,Uh.FAR_TOP_RIGHT,Uh.NEAR_TOP_RIGHT,Uh.FAR_BOTTOM_LEFT,Uh.NEAR_BOTTOM_LEFT,Uh.NEAR_TOP_LEFT,Uh.FAR_TOP_LEFT,Uh.FAR_TOP_LEFT,Uh.NEAR_TOP_LEFT,Uh.NEAR_TOP_RIGHT,Uh.FAR_TOP_RIGHT;const Vrn=6;new pX(ZVt);let DBe=class Aye{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,t){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new tm,this._objectCount=0,t&&(t.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),t.maximumDepth!==void 0&&(this._maximumDepth=t.maximumDepth))}destroy(){this._degenerateObjects.clear(),tm.clearPool(),FBe[0]=null,sN.prune(),H$.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const r=tm.acquire();for(let n=0;n{if(!this._intersectsNode(n,s))return!1;const o=s.node;return o.terminals.forAll(a=>{this._intersectsObject(n,a)&&r(a)}),o.residents!==null&&o.residents.forAll(a=>{this._intersectsObject(n,a)&&r(a)}),!0})}forEachAlongRayWithVerticalOffset(e,t,r,n){const s=uyt(e,t);this._forEachNode(this._root,o=>{if(!this._intersectsNodeWithOffset(s,o,n))return!1;const a=o.node;return a.terminals.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&r(l)}),a.residents!==null&&a.residents.forAll(l=>{this._intersectsObjectWithOffset(s,l,n)&&r(l)}),!0})}forEach(e){this._forEachNode(this._root,t=>{const r=t.node;return r.terminals.forAll(e),r.residents!==null&&r.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,r,n=()=>!0,s=1/0){let o=1/0,a=1/0,l=null;const u=MPe(e,t),c=h=>{if(--s,!n(h))return;const p=this.objectToBoundingSphere(h);if(!Qde(r,p))return;const m=T5(e,t,p),v=m-p[3],w=m+p[3];v{if(s<=0||!Qde(r,h.bounds)||(Gc(y2,u,h.halfSize),hl(y2,y2,h.bounds),T5(e,t,y2)>a))return!1;const p=h.node;return p.terminals.forAll(m=>c(m)),p.residents!==null&&p.residents.forAll(m=>c(m)),!0},e,t),l}forEachInDepthRange(e,t,r,n,s,o,a){let l=-1/0,u=1/0;const c={setRange:w=>{r===Aye.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,w.near),u=Math.min(u,w.far)):(l=Math.max(l,-w.far),u=Math.min(u,-w.near))}};c.setRange(n);const h=T5(t,r,e),p=MPe(t,r),m=MPe(t,-r),v=w=>{if(!a(w))return;const S=this.objectToBoundingSphere(w),I=S,R=T5(t,r,I)-h,L=R-S[3],k=R+S[3];L>u||k{if(!Qde(o,w.bounds)||(Gc(y2,p,w.halfSize),hl(y2,y2,w.bounds),T5(t,r,y2)-h>u)||(Gc(y2,m,w.halfSize),hl(y2,y2,w.bounds),T5(t,r,y2)-hv(I)),S.residents!==null&&S.residents.forAll(I=>v(I)),!0},t,r)}forEachNode(e){this._forEachNode(this._root,t=>e(t.node,t.bounds,t.halfSize,t.depth))}forEachNeighbor(e,t){const r=y9(t),n=t,s=l=>{const u=this.objectToBoundingSphere(l),c=y9(u),h=r+c;return!(aW(u,n)-h*h<=0)||e(l)};let o=!0;const a=l=>{o&&(o=s(l))};this._forEachNode(this._root,l=>{const u=y9(l.bounds),c=r+u;if(aW(l.bounds,n)-c*c>0)return!1;const h=l.node;return h.terminals.forAll(a),o&&h.residents!==null&&h.residents.forAll(a),o}),o&&this.forEachDegenerateObject(a)}_intersectsNode(e,t){return epe(t.bounds,2*-t.halfSize,Xw),epe(t.bounds,2*t.halfSize,Jw),Opt(e.origin,e.direction,Xw,Jw)}_intersectsNodeWithOffset(e,t,r){return epe(t.bounds,2*-t.halfSize,Xw),epe(t.bounds,2*t.halfSize,Jw),r.applyToMinMax(Xw,Jw),Opt(e.origin,e.direction,Xw,Jw)}_intersectsObject(e,t){const r=this.objectToBoundingSphere(t);return!(r[3]>0)||OBe(r,e)}_intersectsObjectWithOffset(e,t,r){const n=this.objectToBoundingSphere(t);return!(n[3]>0)||OBe(r.applyToBoundingSphere(n),e)}_forEachNode(e,t){let r=tm.acquire().init(e);const n=[r];for(;n.length!==0;){if(r=n.pop(),t(r)&&!r.isLeaf())for(let s=0;s=0;--a){const l=pyt[a];s.node.children[l]&&o.push(tm.acquire().init(s).advance(l))}tm.release(s)}}_remove(e,t,r){sN.clear();const n=r.advanceTo(t,(s,o)=>{sN.push(s.node),sN.push(o)})?r.node.terminals:r.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=sN.length-2;s>=0;s-=2){const o=sN.data[s],a=sN.data[s+1];if(!this._purge(o,a))break}}_nodeIsEmpty(e){if(e.terminals.length!==0)return!1;if(e.residents!==null)return e.residents.length===0;for(let t=0;t=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new mg({shrink:!0})),!0)}_add(e,t){t.advanceTo(this.objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depththis.objectToBoundingSphere(r),RM),tte(RM[3])&&!this._fitsInsideTree(RM)))if(this._nodeIsEmpty(this._root.node))Pq(RM,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const r=this._rootBoundsForRootAsSubNode(RM);this._placingRootViolatesMaxDepth(r)?this._rebuildTree(RM,r):this._growRootAsSubNode(r),tm.release(r)}}_rebuildTree(e,t){Px(PPe,t.bounds),PPe[3]=t.halfSize,hyt([e,PPe],2,n=>n,RPe);const r=tm.acquire().init(this._root);this._root.initFrom(null,RPe,RPe[3]),this._root.increaseHalfSize(1.25),this._forEachNode(r,n=>(this.add(n.node.terminals.data,n.node.terminals.length),n.node.residents!==null&&this.add(n.node.residents.data,n.node.residents.length),!0)),tm.release(r)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let r=0;return this._forEachNode(this._root,n=>(r=Math.max(r,n.depth),r+t<=this._maximumDepth)),r+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],r=e;let n=-1/0;const s=this._root.bounds,o=this._root.halfSize;for(let l=0;l<3;l++){const u=s[l]-o-(r[l]-t),c=r[l]+t-(s[l]+o),h=Math.max(0,Math.ceil(u/(2*o))),p=Math.max(0,Math.ceil(c/(2*o)))+1,m=2**Math.ceil(Math.log(h+p)*Math.LOG2E);n=Math.max(n,m),tpe[l].min=h,tpe[l].max=p}for(let l=0;l<3;l++){let u=tpe[l].min,c=tpe[l].max;const h=(n-(u+c))/2;u+=Math.ceil(h),c+=Math.floor(h);const p=s[l]-o-u*o*2;OPe[l]=p+(c+u)*o}const a=n*o;return OPe[3]=a*eHt,tm.acquire().initFrom(null,OPe,a,0)}_growRootAsSubNode(e){const t=this._root.node;Px(RM,this._root.bounds),RM[3]=this._root.halfSize,this._root.init(e),e.advanceTo(RM,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(e===-1)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let r=0,n=0;for(;n=t[0]-r&&e[0]<=t[0]+r&&e[1]>=t[1]-r&&e[1]<=t[1]+r&&e[2]>=t[2]-r&&e[2]<=t[2]+r}toJSON(){const{maximumDepth:e,maximumObjectsPerNode:t,_objectCount:r}=this,n=this._nodeToJSON(this._root.node);return{maximumDepth:e,maximumObjectsPerNode:t,objectCount:r,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:n}}}_nodeToJSON(e){const t=e.children.map(s=>s?this._nodeToJSON(s):null),r=e.residents?.map(s=>this.objectToBoundingSphere(s)),n=e.terminals?.map(s=>this.objectToBoundingSphere(s));return{children:t,residents:r,terminals:n}}static fromJSON(e){const t=new Aye(r=>r,{maximumDepth:e.maximumDepth,maximumObjectsPerNode:e.maximumObjectsPerNode});return t._objectCount=e.objectCount,t._root.initFrom(e.root.node,e.root.bounds,e.root.halfSize,e.root.depth),t}},tm=class $U{constructor(){this.bounds=sT(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,t,r,n=this.depth){return this.node=e??$U.createEmptyNode(),t&&Pq(t,this.bounds),this.halfSize=r,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*eHt}advance(e){let t=this.node.children[e];t||(t=$U.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const r=QVt[e];return this.bounds[0]+=r[0]*this.halfSize,this.bounds[1]+=r[1]*this.halfSize,this.bounds[2]+=r[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,t,r=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!r)return t&&t(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);t&&t(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]r.distance-n.distance);for(let r=0;r<8;++r)t[r]=H$.data[r].index}function MPe(i,e){let t,r=1/0;for(let n=0;n<8;++n){const s=T5(i,e,dyt[n]);s0}tm._pool=new G3(tm),function(i){var e;(e=i.DepthOrder||(i.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(DBe||(DBe={}));const QVt=[Do(-1,-1,-1),Do(1,-1,-1),Do(-1,1,-1),Do(1,1,-1),Do(-1,-1,1),Do(1,-1,1),Do(-1,1,1),Do(1,1,1)],dyt=[Do(-1,-1,-1),Do(-1,-1,1),Do(-1,1,-1),Do(-1,1,1),Do(1,-1,-1),Do(1,-1,1),Do(1,1,-1),Do(1,1,1)],eHt=Math.sqrt(3),FBe=[null];function Yrn(i){return FBe[0]=i,FBe}const OPe=sT(),y2=gr(),Xw=gr(),Jw=gr(),sN=new mg,Xrn=sT(),RM=sT(),PPe=sT(),RPe=sT(),tpe=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H$=new mg,pyt=[0,0,0,0,0,0,0,0],fyt=DBe,Jrn=1e3;function Krn(i,e,t){const r=sT(),n=r;return gb(n,n,i,.5),gb(n,n,e,.5),r[3]=hR(n,i),hl(n,n,t),r}let kBe=class{constructor(){this._idToComponent=new Map,this._components=new fyt(e=>e.bounds),this._edges=new fyt(e=>e.bounds),this._tmpLineSegment=NCe(),this._tmpP1=gr(),this._tmpP2=gr(),this._tmpP3=gr(),this.remoteClient=null}async fetchCandidates(e,t){await Promise.resolve(),hn(t),await this._ensureEdgeLocations(e,t);const r=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(e,n,r),r.length{if(o.info==null){const{id:a,uid:l}=o;r.push({id:a,uid:l})}return!0},e.bounds),!r.length)return;const n={components:r},s=await this.remoteClient.invoke("fetchAllEdgeLocations",n,t??{});for(const o of s.components)this._setFetchEdgeLocations(o)}async add(e){const t=new tHt(e.id,e.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const r=[];this._edges.forEachNeighbor(n=>(n.component===t&&r.push(n),!0),t.bounds),this._edges.remove(r),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(t==null||e.uid!==t.uid)return;const r=ljt.createView(e.locations),n=new Array(r.count),s=gr(),o=gr();for(let u=0;uPromise.resolve().then(()=>$Bn).then(e=>e.i).then(({default:e})=>{const t=e({locateFile:inn,onRuntimeInitialized:()=>i(t)});delete t.then})).catch(i=>{throw i})),DPe}function inn(i){return Fl(`esri/libs/i3s/${i}`)}let DPe;function qS(i,e,t,r){if(_0(i.spatialReference,t)){ipe[0]=i.x,ipe[1]=i.y;const s=i.z;return ipe[2]=s??r??0,sy(ipe,i.spatialReference,0,e,t,0,1)}const n=CW(i,t);return!!n&&(e[0]=n?.x,e[1]=n?.y,e[2]=n?.z??r??0,!0)}const ipe=gr();function rnn(i,e,t,r){return{x:i,y:e,z:t,hasZ:t!=null,hasM:!1,spatialReference:r,type:"point"}}rnn(0,0,0,Xi.WGS84);var Wbe;(function(i){i[i.INVISIBLE=0]="INVISIBLE",i[i.TRANSPARENT=1]="TRANSPARENT",i[i.OPAQUE=2]="OPAQUE"})(Wbe||(Wbe={}));function nnn(i){return{...snn,...i,type:"solid"}}const snn={color:Vb(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:Wbe.OPAQUE,hasSlicePlane:!1};Vb(0,0,0,.2),Wbe.OPAQUE;var LC;(function(i){i[i.Multiply=1]="Multiply",i[i.Ignore=2]="Ignore",i[i.Replace=3]="Replace",i[i.Tint=4]="Tint"})(LC||(LC={}));Wo();var gyt;async function rHt(i,e,t,r,n,s,o,a){const l=[];for(const h of e)if(h&&n.includes(h.name)){const p=`${i}/nodes/${t}/attributes/${h.key}/0`;l.push({url:p,storageInfo:h})}const u=await Promise.allSettled(l.map(h=>zi(h.url,{responseType:"array-buffer",query:{...o,token:s},signal:a?.signal}).then(p=>wVt(h.storageInfo,p.data)))),c=[];for(const h of r){const p={};for(let m=0;m0)throw new Error(`i3s.wasm: ${o.error}`);const a=o.featureIds?.length>0?o.featureIds.slice():null,l=o.positions.slice();return a&&e.push(a.buffer),e.push(l.buffer),{result:{positions:l,featureIds:a},transferList:e}}async function hnn(i){await fX(),oHt(i);const e={buffer:i.buffer};return{result:e,transferList:[e.buffer]}}async function dnn(i){await fX(),nHt(i)}async function pnn(i){oh=await fX(),oh.setLegacySchema(i.context,i.jsonSchema)}async function fnn(i){const{localMatrix:e,origin:t,positions:r,vertexSpace:n,localMode:s}=i,o=Xi.fromJSON(i.inSpatialReference),a=Xi.fromJSON(i.outSpatialReference);let l;if(n.type==="georeferenced"&&n.origin==null){const[{projectBuffer:m},{initializeProjection:v}]=await Promise.all([Promise.resolve().then(()=>iar),Promise.resolve().then(()=>par)]);await v(o,a),l=new Float64Array(r.length),m(r,o,0,l,a,0,l.length/3)}else{const m=n.type==="georeferenced"?UC.fromJSON(n):lH.fromJSON(n),{project:v}=await Promise.resolve().then(()=>mzr);l=OUr(v({positions:r,transform:e?{localMatrix:e}:void 0,vertexSpace:m,inSpatialReference:o,outSpatialReference:a,localMode:s}))}const u=l.length,[c,h,p]=t;for(let m=0;mZ.some(ae=>ae.name==="color")),normal:e.needNormals&&e.layouts.some(Z=>Z.some(ae=>ae.name==="normalCompressed")),uv0:e.layouts.some(Z=>Z.some(ae=>ae.name==="uv0")),uvRegion:e.layouts.some(Z=>Z.some(ae=>ae.name==="uvRegion")),featureIndex:k.featureIndex},$=i.process(r,!!e.obbData,m,S.byteLength,k,B,w,l,h,p,e.normalReferenceFrame);if(i._free(w),i._free(m),$.error.length>0)throw new Error(`i3s.wasm: ${$.error}`);if($.discarded)return null;const V=$.componentOffsets.length>0?$.componentOffsets.slice():null,Y=$.featureIds.length>0?$.featureIds.slice():null,K=$.anchorIds.length>0?Array.from($.anchorIds):null,Q=$.anchors.length>0?Array.from($.anchors):null,re=$.interleavedVertedData.slice().buffer,ne=$.indicesType===Hbe.Int16?new Uint16Array($.indices.buffer,$.indices.byteOffset,$.indices.byteLength/2).slice():new Uint32Array($.indices.buffer,$.indices.byteOffset,$.indices.byteLength/4).slice(),de=$.positions.slice(),pe=$.positionIndicesType===Hbe.Int16?new Uint16Array($.positionIndices.buffer,$.positionIndices.byteOffset,$.positionIndices.byteLength/2).slice():new Uint32Array($.positionIndices.buffer,$.positionIndices.byteOffset,$.positionIndices.byteLength/4).slice(),H={layout:e.layouts[0],interleavedVertexData:re,indices:ne,hasColors:$.hasColors,hasModifications:$.hasModifications,positionData:{data:de,indices:pe}};return Y&&t.push(Y.buffer),V&&t.push(V.buffer),t.push(re),t.push(ne.buffer),t.push(de.buffer),t.push(pe.buffer),{componentOffsets:V,featureIds:Y,anchorIds:K,anchors:Q,transformedGeometry:H,obb:$.obb}}function ynn(i){return i===0?lV.Unmodified:i===1?lV.PotentiallyModified:i===2?lV.Culled:lV.Unknown}function oHt(i){if(!oh)return;const{context:e,buffer:t}=i,r=oh._malloc(t.byteLength),n=t.byteLength/Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(oh.HEAPU8.buffer,r,n),o=new Float64Array(t);s.set(o),oh.filterOBBs(e,r,n),o.set(s),oh._free(r)}function aHt(i){oh&&oh.destroy(i)===0&&(oh=null)}function npe(i,e){for(let t=0;t(oh=i,rpe=null,oh))),rpe)}const _nn={transform:(i,e)=>oh&&sHt(oh,i,e),destroy:aHt},bnn=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:gnn,dracoDecompressPointCloudData:cnn,filterObbsForModifications:hnn,filterObbsForModificationsSync:oHt,initialize:vnn,interpretObbModificationResults:ynn,process:unn,project:fnn,setLegacySchema:pnn,setModifications:dnn,setModificationsSync:nHt,test:_nn,transformNormals:mnn},Symbol.toStringTag,{value:"Module"}));function Ik(i,e){if(i&&e){for(const t of i.children)if(t.localName in e){const r=e[t.localName];if(typeof r=="function"){const n=r(t);n&&Ik(t,n)}else Ik(t,r)}}}function*_H(i,e){for(const t of i.children)if(t.localName in e){const r=e[t.localName];typeof r=="function"?yield r(t):yield*_H(t,r)}}const FPe="xlink:href",Rq="2.0.0",LBe="__esri_wfs_id__",wnn="wfs-layer:getWFSLayerTypeInfo-error",xnn="wfs-layer:empty-service",lHt="wfs-layer:feature-type-not-found",Snn="wfs-layer:geojson-not-supported",Tnn="wfs-layer:kvp-encoding-not-supported",Cnn="wfs-layer:malformed-json",uHt="wfs-layer:unknown-geometry-type",Enn="wfs-layer:unknown-field-type",Inn="wfs-layer:unsupported-spatial-reference",Ann="wfs-layer:unsupported-wfs-version";async function Mnn(i,e){const t=Onn((await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:Rq,...e?.customParameters},signal:e?.signal})).data);return Dnn(i,t),t}function Onn(i){const e=pHt(i);Hnn(e),fHt(e);const t=e.firstElementChild,r=wVi(Fnn(t));return{operations:Rnn(t),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}const Pnn=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function wyt(i){for(const e of Pnn){const t=i.findIndex(r=>r.toLowerCase()===e);if(t>=0)return i[t]}return null}function Rnn(i){let e=!1;const t={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},r=[],n=[];if(Ik(i,{OperationsMetadata:{Parameter:s=>{if(s.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:o})=>{o&&r.push(o)}}}},Operation:s=>{switch(s.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:o=>{t.GetCapabilities.url=o.getAttribute(FPe)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:o=>{t.DescribeFeatureType.url=o.getAttribute(FPe)}}}};case"GetFeature":return{DCP:{HTTP:{Get:o=>{t.GetFeature.url=o.getAttribute(FPe)}}},Parameter:o=>{if(o.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:a})=>{a&&n.push(a)}}}}}}},Constraint:s=>{switch(s.getAttribute("name")){case"KVPEncoding":return{DefaultValue:o=>{e=o.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:o=>{t.GetFeature.supportsPagination=o.textContent.toLowerCase()==="true"}}}}}}),t.GetFeature.outputFormat=wyt(n)??wyt(r),!e)throw new qe(Tnn,"WFS service doesn't support key/value pair (KVP) encoding");if(t.GetFeature.outputFormat==null)throw new qe(Snn,"WFS service doesn't support GeoJSON output format");return t}function Dnn(i,e){eEt(i)&&(_v(i,e.operations.DescribeFeatureType.url,!0)&&(e.operations.DescribeFeatureType.url=wne(e.operations.DescribeFeatureType.url)),_v(i,e.operations.GetFeature.url,!0)&&(e.operations.GetFeature.url=wne(e.operations.GetFeature.url)))}function xyt(i){const e=parseInt(i.textContent?.match(/(?\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(e))return e}function Fnn(i){return _H(i,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},r=new Set;return Ik(e,{Name:n=>{const{name:s,prefix:o}=loe(n.textContent);t.typeName=`${o}:${s}`,t.name=s,t.namespacePrefix=o,t.namespaceUri=n.lookupNamespaceURI(o)},Abstract:n=>{t.description=n.textContent},Title:n=>{t.title=n.textContent},WGS84BoundingBox:n=>{t.extent=knn(n)},DefaultCRS:n=>{const s=xyt(n);s&&(t.defaultSpatialReference=s,r.add(s))},OtherCRS:n=>{const s=xyt(n);s&&r.add(s)}}),t.title||(t.title=t.name),r.add(4326),t.supportedSpatialReferences.push(...r),t}}})}function knn(i){let e,t,r,n;for(const s of i.children)switch(s.localName){case"LowerCorner":[e,t]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[r,n]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:Yp}}function cHt(i,e,t){return die(i,r=>t?r.name===e&&r.namespaceUri===t:r.typeName===e||r.name===e)}async function Lnn(i,e,t,r={}){const{featureType:n,extent:s}=await Nnn(i,e,t,r),{spatialReference:o}=mHt(i.operations.GetFeature.url,n,r.spatialReference),{fields:a,geometryType:l,swapXY:u,objectIdField:c,geometryField:h}=await $nn(i,n,o,r);return{url:i.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:a,geometryField:h,geometryType:l,objectIdField:c,spatialReference:r.spatialReference??new Xi({wkid:n.defaultSpatialReference}),extent:s,swapXY:u,wfsCapabilities:i,customParameters:r.customParameters}}async function Nnn(i,e,t,r={}){const n=i.readFeatureTypes(),s=e?cHt(n,e,t):n.next().value,{spatialReference:o=new Xi({wkid:s?.defaultSpatialReference})}=r;if(s==null)throw e?new qe(lHt,`The type '${e}' could not be found in the service`):new qe(xnn,"The service is empty");let a=new hr({...s.extent,spatialReference:Xi.WGS84});if(!Ya(a.spatialReference,o))try{await Lx(a.spatialReference,o,void 0,r),a=Wc(a,o)}catch{throw new qe(Inn,"Projection not supported")}return{extent:a,spatialReference:o,featureType:s}}async function $nn(i,e,t,r={}){const{typeName:n}=e,[s,o]=await Promise.allSettled([jnn(i.operations.DescribeFeatureType.url,n,r),Bnn(i,n,t,r)]),a=p=>new qe(wnn,`An error occurred while getting info about the feature type '${n}'`,{error:p});if(s.status==="rejected")throw a(s.reason);if(o.status==="rejected")throw a(o.reason);const{fields:l,errors:u}=s.value??{},c=s.value?.geometryType||o.value?.geometryType,h=o.value?.swapXY??!1;if(c==null)throw new qe(uHt,`The geometry type could not be determined for type '${n}`,{typeName:n,geometryType:c,fields:l,errors:u});return{...hHt(l??[]),geometryType:c,swapXY:h}}function hHt(i){const e=i.find(r=>r.type==="geometry");let t=i.find(r=>r.type==="oid");return i=i.filter(r=>r.type!=="geometry"),t||(t=new Fo({name:LBe,type:"oid",alias:LBe}),i.unshift(t)),{geometryField:e?.name??null,objectIdField:t.name,fields:i}}async function Bnn(i,e,t,r={}){let n,s=!1;const[o,a]=await Promise.all([NBe(i.operations.GetFeature.url,e,t,i.operations.GetFeature.outputFormat,{...r,count:1}),zi(i.operations.GetFeature.url,{responseType:"text",query:dHt(e,t,void 0,{...r,count:1}),signal:r?.signal})]),l=o.type==="FeatureCollection"&&o.features[0]?.geometry;if(l){let u;switch(n=Vp.fromJSON(pbe(l.type)),l.type){case"Point":u=l.coordinates;break;case"LineString":case"MultiPoint":u=l.coordinates[0];break;case"MultiLineString":case"Polygon":u=l.coordinates[0][0];break;case"MultiPolygon":u=l.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(a.data);if(c){const h=u[0].toFixed(3),p=u[1].toFixed(3),m=parseFloat(c[1]).toFixed(3);h===parseFloat(c[2]).toFixed(3)&&p===m&&(s=!0)}}return{geometryType:n,swapXY:s}}async function jnn(i,e,t){return Gnn(e,(await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:Rq,TYPENAME:e,TYPENAMES:e,...t?.customParameters},signal:t?.signal})).data)}function Gnn(i,e){const{name:t}=loe(i),r=pHt(e);fHt(r);const n=die(_H(r.firstElementChild,{element:s=>s}),s=>s.getAttribute("name")===t);if(n!=null){const s=n.getAttribute("type"),o=s?die(_H(r.firstElementChild,{complexType:a=>a}),a=>a.getAttribute("name")===loe(s).name):die(_H(n,{complexType:a=>a}),()=>!0);if(o)return znn(o)}throw new qe(lHt,`Type '${i}' not found in document`,{document:new XMLSerializer().serializeToString(r)})}const Unn=new Set(["objectid","fid"]);function znn(i){const e=[],t=[];let r;const n=_H(i,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of n){const o=s.getAttribute("name");if(!o)continue;let a,l;if(s.hasAttribute("type")?a=loe(s.getAttribute("type")).name:Ik(s,{simpleType:{restriction:h=>(a=loe(h.getAttribute("base")).name,{maxLength:p=>{l=+p.getAttribute("value")}})}}),!a)continue;const u=s.getAttribute("nillable")==="true";let c=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":t.push(new Fo({name:o,alias:o,type:"integer",nullable:u,length:s8("integer")}));break;case"float":case"double":case"decimal":t.push(new Fo({name:o,alias:o,type:"double",nullable:u,length:s8("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":t.push(new Fo({name:o,alias:o,type:"string",nullable:u,length:l??s8("string")}));break;case"datetime":case"date":t.push(new Fo({name:o,alias:o,type:"date",nullable:u,length:l??s8("date")}));break;case"pointpropertytype":r="point",c=!0;break;case"multipointpropertytype":r="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,e.push(new qe(uHt,`geometry type '${a}' is not supported`,{type:new XMLSerializer().serializeToString(i)}));break;default:e.push(new qe(Enn,`Unknown field type '${a}'`,{type:new XMLSerializer().serializeToString(i)}))}c&&t.push(new Fo({name:o,alias:o,type:"geometry",nullable:u}))}for(const s of t)if(s.type==="integer"&&!s.nullable&&Unn.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:r,fields:t,errors:e}}async function NBe(i,e,t,r,n){let{data:s}=await zi(i,{responseType:"text",query:dHt(e,t,r,n),signal:n?.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(o){throw new qe(Cnn,"Error while parsing the response",{response:s,error:o})}}function dHt(i,e,t,r){const n=typeof e=="number"?e:e.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:Rq,TYPENAMES:i,OUTPUTFORMAT:t,SRSNAME:"EPSG:"+n,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function Vnn(i,e,t){const r=await zi(i,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:Rq,TYPENAMES:e,RESULTTYPE:"hits",...t?.customParameters},signal:t?.signal}),n=/numberMatched=["'](?\d+)["']/gi.exec(r.data);if(n?.groups)return+n.groups.numberMatched}function pHt(i){return new DOMParser().parseFromString(i.trim(),"text/xml")}function loe(i){const[e,t]=i.split(":");return{prefix:t?e:"",name:t??e}}function Hnn(i){const e=i.firstElementChild?.getAttribute("version");if(e&&e!==Rq)throw new qe(Ann,`Unsupported WFS version ${e}. Supported version: ${Rq}`)}function fHt(i){let e="",t="";if(Ik(i.firstElementChild,{Exception:r=>(e=r.getAttribute("exceptionCode"),{ExceptionText:n=>{t=n.textContent}})}),e)throw new qe(`wfs-layer:${e}`,t)}function mHt(i,e,t){const r={wkid:e.defaultSpatialReference},n=t?.wkid!=null?{wkid:t.wkid}:r;return{spatialReference:n,getFeatureSpatialReference:pOt(i)||n.wkid&&e.supportedSpatialReferences.includes(n.wkid)?{wkid:n.wkid}:{wkid:e.defaultSpatialReference}}}const Syt="esri.layers.WFSLayer";let Wnn=class{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:r,getFeatureOutputFormat:n,fields:s,geometryType:o,featureType:a,maxRecordCount:l,maxTotalRecordCount:u,maxPageCount:c,objectIdField:h,customParameters:p}=e,{spatialReference:m,getFeatureSpatialReference:v}=mHt(r,a,e.spatialReference);try{await Gv(v,m)}catch{throw new qe("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:m})}hn(t),this._customParameters=p,this._featureType=a,this._fieldsIndex=Cd.fromLayerJSON({fields:s,dateFieldsTimeReference:s.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:y0}:null}),this._geometryType=o,this._getFeatureUrl=r,this._getFeatureOutputFormat=n,this._getFeatureSpatialReference=v,this._maxRecordCount=l,this._maxTotalRecordCount=u,this._maxPageCount=c,this._objectIdField=h,this._spatialReference=m;let w=await this._snapshotFeatures(t);if(w.errors.length>0&&(this._supportsPagination=!1,w=await this._snapshotFeatures(t),w.errors.length>0))throw w.errors[0];return this._queryEngine=new lL({fieldsIndex:this._fieldsIndex,geometryType:o,hasM:!1,hasZ:!1,objectIdField:h,spatialReference:m,timeInfo:null,featureStore:new rX({geometryType:o,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(w.features),{warnings:Tyt(w),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new qe("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=pE(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const r of Tyt(t))di.getLogger(Syt).warn(new Rf("wfs-layer:refresh-warning",r.message,r.details));t.errors?.length&&di.getLogger(Syt).warn(new Rf("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,r=this._maxTotalRecordCount,n=this._maxPageCount,s=this._supportsPagination?await Vnn(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let o=[];const a=[];if(s==null)try{o=await this._singleQuery(t)}catch(l){mo(l)||a.push(l)}else{const l=Math.min(s,r),u=qnn(this,Math.max(1,Math.min(Math.ceil(l/this._maxRecordCount),n)),t);await Promise.allSettled(Array.from({length:10}).map(()=>Ynn(u,o,a)))}return hn(t),{features:o,totalRecordCount:s,maxTotalRecordCount:r,maxPageCount:n,errors:a}}async _singleQuery(e){const t=await NBe(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const r=e*this._maxRecordCount,n=await NBe(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:r,count:this._maxRecordCount,signal:t});return this._processGeoJSON(n,{startIndex:r,signal:t})}_processGeoJSON(e,t){aJe(e,this._getFeatureSpatialReference.wkid);const{startIndex:r,signal:n}=t;hn(n);const s=lJe(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!Ya(this._spatialReference,this._getFeatureSpatialReference))for(const a of s)a.geometry!=null&&(a.geometry=Z2(Sf(KC(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let o=r??1;for(const a of s){const l={};RF(this._fieldsIndex,l,a.attributes,!0),a.attributes=l,l[this._objectIdField]==null&&(a.objectId=l[this._objectIdField]=o++)}return s}};function*qnn(i,e,t){for(let r=0;ri.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${i.totalRecordCount} features exceeds the maximum allowed of ${i.maxTotalRecordCount}.`,details:{recordCount:i.features.length,totalRecordCount:i.totalRecordCount,maxTotalRecordCount:i.maxTotalRecordCount}})),e}const Xnn=Object.freeze(Object.defineProperty({__proto__:null,default:Wnn},Symbol.toStringTag,{value:"Module"}));var ng,up,uf;(function(i){i[i.FILL=1]="FILL",i[i.LINE=2]="LINE",i[i.SYMBOL=3]="SYMBOL",i[i.CIRCLE=4]="CIRCLE"})(ng||(ng={})),function(i){i[i.BACKGROUND=0]="BACKGROUND",i[i.FILL=1]="FILL",i[i.OUTLINE=2]="OUTLINE",i[i.LINE=3]="LINE",i[i.ICON=4]="ICON",i[i.CIRCLE=5]="CIRCLE",i[i.TEXT=6]="TEXT",i[i.TILEINFO=7]="TILEINFO"}(up||(up={})),function(i){i[i.PAINTER_CHANGED=0]="PAINTER_CHANGED",i[i.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",i[i.LAYER_CHANGED=2]="LAYER_CHANGED",i[i.LAYER_REMOVED=3]="LAYER_REMOVED",i[i.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(uf||(uf={}));function Jnn(i){return i===746||i===747||!(i<4352)&&(i>=12704&&i<=12735||i>=12544&&i<=12591||i>=65072&&i<=65103&&!(i>=65097&&i<=65103)||i>=63744&&i<=64255||i>=13056&&i<=13311||i>=11904&&i<=12031||i>=12736&&i<=12783||i>=12288&&i<=12351&&!(i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=12800&&i<=13055||i>=12592&&i<=12687||i>=43360&&i<=43391||i>=55216&&i<=55295||i>=4352&&i<=4607||i>=44032&&i<=55215||i>=12352&&i<=12447||i>=12272&&i<=12287||i>=12688&&i<=12703||i>=12032&&i<=12255||i>=12784&&i<=12799||i>=12448&&i<=12543&&i!==12540||i>=65280&&i<=65519&&!(i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||i>=65104&&i<=65135&&!(i>=65112&&i<=65118||i>=65123&&i<=65126)||i>=5120&&i<=5759||i>=6320&&i<=6399||i>=65040&&i<=65055||i>=19904&&i<=19967||i>=40960&&i<=42127||i>=42128&&i<=42191)}function Knn(i){return!(i<11904)&&(i>=12704&&i<=12735||i>=12544&&i<=12591||i>=65072&&i<=65103||i>=63744&&i<=64255||i>=13056&&i<=13311||i>=11904&&i<=12031||i>=12736&&i<=12783||i>=12288&&i<=12351||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=12800&&i<=13055||i>=65280&&i<=65519||i>=12352&&i<=12447||i>=12272&&i<=12287||i>=12032&&i<=12255||i>=12784&&i<=12799||i>=12448&&i<=12543||i>=65040&&i<=65055||i>=42128&&i<=42191||i>=40960&&i<=42127)}function Znn(i){switch(i){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Cyt(i){switch(i){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const vA=24,gHt=17;let yHt=class{constructor(e,t,r,n,s,o,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=r,this._letterSpacing=n,this._hAnchor=s,this._vAnchor=o,this._justify=a}getShaping(e,t,r){const n=this._letterSpacing,s=this._lineHeight,o=this._justify,a=this._maxWidth,l=[];let u=0,c=0;for(const L of e){const k=L.codePointAt(0);if(k==null)continue;const B=r&&Jnn(k);let $;for(const V of this._glyphItems)if($=V[k],$)break;l.push({codePoint:k,x:u,y:c,vertical:B,glyphMosaicItem:$}),$&&(u+=$.metrics.advance+n)}let h=u;a>0&&(h=u/Math.max(1,Math.ceil(u/a)));const p=e.includes("​"),m=[],v=l.length;for(let L=0;LB&&Cyt(l[$].codePoint);)l[$].glyphMosaicItem=null,--$;if(B<=$){const V=l[B].x;for(let K=B;K<=$;K++)l[K].x-=V,l[K].y=c;let Y=l[$].x;l[$].glyphMosaicItem&&(Y+=l[$].glyphMosaicItem.metrics.advance),S=Math.max(Y,S),o&&this._applyJustification(l,B,$)}R=k,c+=I}if(l.length>0){const L=w.length-1,k=(o-this._hAnchor)*S;let B=(-this._vAnchor*(L+1)+.5)*s;t&&L&&(B+=L*s);for(const $ of l)$.x+=k,$.y+=B}return l.filter(L=>L.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let r=1/0,n=1/0,s=0,o=0;for(const a of e){const l=a.glyphMosaicItem.metrics.advance,u=a.x,c=a.y-gHt,h=u+l,p=c+t;r=Math.min(r,u),s=Math.max(s,h),n=Math.min(n,c),o=Math.max(o,p)}return{x:r,y:n,width:s-r,height:o-n}}static getBox(e){if(!e.length)return null;let t=1/0,r=1/0,n=0,s=0;for(const o of e){const{height:a,left:l,top:u,width:c}=o.glyphMosaicItem.metrics,h=o.x,p=o.y-(a-Math.abs(u)),m=h+c+l,v=p+a;t=Math.min(t,h),n=Math.max(n,m),r=Math.min(r,p),s=Math.max(s,v)}return{x:t,y:r,width:n-t,height:s-r}}static addDecoration(e,t){const r=e.length;if(r===0)return;const n=3;let s=e[0].x+e[0].glyphMosaicItem.metrics.left,o=e[0].y;for(let l=1;l=0&&a,m=n.allowOverlap&&n.ignorePlacement?null:[],v=[],w=4,S=!p;let I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,L=I,k=R;const B=(p||a)&&l,$=n.size/vA;let V=!1;for(const ne of t)if(ne.vertical){V=!0;break}let Y,K=0,Q=0;if(!p&&V){const ne=yHt.getTextBox(t,n.lineHeight*vA);switch(n.anchor){case ec.LEFT:K=ne.height/2,Q=-ne.width/2;break;case ec.RIGHT:K=-ne.height/2,Q=ne.width/2;break;case ec.TOP:K=ne.height/2,Q=ne.width/2;break;case ec.BOTTOM:K=-ne.height/2,Q=-ne.width/2;break;case ec.TOP_LEFT:K=ne.height;break;case ec.BOTTOM_LEFT:Q=-ne.width;break;case ec.TOP_RIGHT:Q=ne.width;break;case ec.BOTTOM_RIGHT:K=-ne.height}}K+=n.offset[0]*vA,Q+=n.offset[1]*vA;for(const ne of t){const de=ne.glyphMosaicItem;if(!de||de.rect.isEmpty)continue;const pe=de.rect,H=de.metrics,Z=de.page;if(m&&S){if(Y!==void 0&&Y!==ne.y){let vt,At,Je,it;V?(vt=-k+K,At=I+Q,Je=k-L,it=R-I):(vt=I+K,At=L+Q,Je=R-I,it=k-L);const Ue={xTile:e.x,yTile:e.y,dxPixels:vt*$-u,dyPixels:At*$-u,hard:!n.optional,partIndex:1,width:Je*$+2*u,height:it*$+2*u,angle:o,minLod:W6,maxLod:fA};m.push(Ue),I=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,L=I,k=R}Y=ne.y}const ae=[];if(p){const vt=.5*de.metrics.width,At=(ne.x+H.left-w+vt)*$*ite;if(c=this._placeGlyph(e,c,At,r,e.segment,1,ne.vertical,Z,ae),l&&(c=this._placeGlyph(e,c,At,r,e.segment,-1,ne.vertical,Z,ae)),c>=kPe)break}else ae.push(new ope(s,h,h,Z,!1)),a&&l&&ae.push(new ope(s,h+H5,h+H5,Z,!1));const fe=ne.x+H.left,be=ne.y-gHt-H.top,_e=fe+H.width,Ie=be+H.height;let Te,Be,Ve,$e,tt,yt,Ct,ot;if(!p&&V)if(ne.vertical){const vt=(fe+_e)/2-H.height/2,At=(be+Ie)/2+H.width/2;Te=new Po(-At-w+K,vt-w+Q),Be=new Po(Te.x+pe.width,Te.y+pe.height),Ve=new Po(Te.x,Be.y),$e=new Po(Be.x,Te.y)}else Te=new Po(-be+w+K,fe-w+Q),Be=new Po(Te.x-pe.height,Te.y+pe.width),Ve=new Po(Be.x,Te.y),$e=new Po(Te.x,Be.y);else Te=new Po(fe-w+K,be-w+Q),Be=new Po(Te.x+pe.width,Te.y+pe.height),Ve=new Po(Te.x,Be.y),$e=new Po(Be.x,Te.y);for(const vt of ae){let At,Je,it,Ue;if(vt.alternateVerticalGlyph){if(!tt){const ke=(be+Ie)/2+Q;tt=new Po((fe+_e)/2+K-H.height/2-w,ke+H.width/2+w),yt=new Po(tt.x+pe.height,tt.y-pe.width),Ct=new Po(yt.x,tt.y),ot=new Po(tt.x,yt.y)}At=tt,Je=Ct,it=ot,Ue=yt}else At=Te,Je=Ve,it=$e,Ue=Be;const ct=be,st=Ie,Ze=vt.glyphAngle+o;if(Ze!==0){const ke=Math.cos(Ze),me=Math.sin(Ze);At=At.clone(),Je=Je?.clone(),it=it?.clone(),Ue=Ue?.clone(),At.rotate(ke,me),Ue?.rotate(ke,me),Je?.rotate(ke,me),it?.rotate(ke,me)}let ye=0,Ke=256;if(p&&V?ne.vertical?vt.alternateVerticalGlyph?(ye=32,Ke=96):(ye=224,Ke=32):(ye=224,Ke=96):(ye=192,Ke=64),v.push(new Ayt(At,it,Je,Ue,pe,vt.labelAngle,ye,Ke,vt.anchor,vt.minzoom,vt.maxzoom,vt.page)),m&&(!B||this._legible(vt.labelAngle))){if(S)feR&&(R=_e),st>k&&(k=st);else if(vt.minzoom=kPe)return null;if(m&&S){let ne,de,pe,H;V?(ne=-k+K,de=I+Q,pe=k-L,H=R-I):(ne=I+K,de=L+Q,pe=R-I,H=k-L);const Z={xTile:e.x,yTile:e.y,dxPixels:ne*$-u,dyPixels:de*$-u,hard:!n.optional,partIndex:1,width:pe*$+2*u,height:H*$+2*u,angle:o,minLod:W6,maxLod:fA};m.push(Z)}const re=new Myt(v);return m&&m.length>0&&(re.textColliders=m),re}_legible(e){const t=eUt(e);return t<65||t>=193}_placeGlyph(e,t,r,n,s,o,a,l,u){let c=o;const h=c<0?Tbe(e.angle+H5,_mt):e.angle;let p=0;r<0&&(c*=-1,r*=-1,p=H5),c>0&&++s;let m=new Po(e.x,e.y),v=n[s],w=fA;if(n.length<=s)return w;for(;;){const S=v.x-m.x,I=v.y-m.y,R=Math.sqrt(S*S+I*I),L=Math.max(r/R,t),k=S/R,B=I/R,$=Tbe(Math.atan2(B,k)+p,_mt);if(u.push(new ope(m,h,$,l,!1,L,w)),a&&u.push(new ope(m,h,$,l,!0,L,w)),L<=t)return L;m=v.clone();do{if(s+=c,n.length<=s||s<0)return L;v=n[s]}while(m.isEqual(v));let V=v.x-m.x,Y=v.y-m.y;const K=Math.sqrt(V*V+Y*Y);V*=R/K,Y*=R/K,m.x-=V,m.y-=Y,w=L}}};var uV;(function(i){i[i.moveTo=1]="moveTo",i[i.lineTo=2]="lineTo",i[i.close=7]="close"})(uV||(uV={}));let $Be=class{constructor(e,t,r=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=r;const n=t.keys,s=t.values,o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:this.id=o.getUInt64();break;case 2:{const a=o.getMessage().asUnsafe(),l=this.values;for(;!a.empty();){const u=a.getUInt32(),c=a.getUInt32();l[n[u]]=s[c]}a.release();break}case 3:this.type=o.getUInt32();break;case 4:this._pbfGeometry=o.getMessage();break;default:o.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let r,n;this._pbfGeometry=null,e?e.reset(this.type):r=[];let s,o=uV.moveTo,a=0,l=0,u=0;for(;!t.empty();){if(a===0){const c=t.getUInt32();o=7&c,a=c>>3}switch(a--,o){case uV.moveTo:l+=t.getSInt32(),u+=t.getSInt32(),e?e.moveTo(l,u):r&&(n&&r.push(n),n=[],n.push(new Po(l,u)));break;case uV.lineTo:l+=t.getSInt32(),u+=t.getSInt32(),e?e.lineTo(l,u):n&&n.push(new Po(l,u));break;case uV.close:e?e.close():n&&!n[0].equals(l,u)&&n.push(n[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?s=e.result():r&&(n&&r.push(n),s=r),t.release(),this._geometry=s,s}},cg=class{constructor(e){this._array=[],e<=0&&console.error("strideInBytes must be positive!"),this._stride=e}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(e,t){return 65535&e|t<<16}static i8888to32(e,t,r,n){return 255&e|(255&t)<<8|(255&r)<<16|n<<24}static i8816to32(e,t,r){return 255&e|(255&t)<<8|r<<16}},qj=class extends cg{constructor(){super(12)}add(e,t,r){const n=this.array;n.push(e),n.push(t),n.push(r)}},BBe=class vHt{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(vHt._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}},isn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a,l,u,c,h,p){const m=this.array;let v=cg.i1616to32(e,t);m.push(v);const w=31;v=cg.i8888to32(Math.round(w*r),Math.round(w*n),Math.round(w*s),Math.round(w*o)),m.push(v),v=cg.i8888to32(Math.round(w*a),Math.round(w*l),Math.round(w*u),Math.round(w*c)),m.push(v),v=cg.i1616to32(h,0),m.push(v),p&&m.push(...p)}},rsn=class extends cg{constructor(e){super(e)}add(e,t,r){const n=this.array;n.push(cg.i1616to32(e,t)),r&&n.push(...r)}},nsn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a){const l=this.array,u=this.index;let c=cg.i1616to32(e,t);l.push(c);const h=15;return c=cg.i8888to32(Math.round(h*r),Math.round(h*n),s,o),l.push(c),a&&l.push(...a),u}},Oyt=class extends cg{constructor(e){super(e)}add(e,t,r,n,s,o,a,l,u,c,h,p){const m=this.array;let v=cg.i1616to32(e,t);m.push(v),v=cg.i1616to32(Math.round(8*r),Math.round(8*n)),m.push(v),v=cg.i8888to32(s/4,o/4,l,u),m.push(v),v=cg.i8888to32(0,eUt(a),10*c,Math.min(10*h,255)),m.push(v),p&&m.push(...p)}},ssn=class extends cg{constructor(e){super(e)}add(e,t,r,n,s){const o=this.array,a=cg.i1616to32(2*e+r,2*t+n);o.push(a),s&&o.push(...s)}},BCe=class{constructor(e,t,r){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=r,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,r){}},osn=class extends BCe{constructor(e,t,r,n,s){super(e,t,r),this.type=ng.CIRCLE,this._circleVertexBuffer=n,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,r=this._circleIndexBuffer;this._circleIndexStart=3*r.index,this._circleIndexCount=0;const n=this.layer,s=this.zoom;e&&e.setExtent(this.layerExtent);for(const o of this._features){const a=o.getGeometry(e);if(!a)continue;const l=n.circleMaterial.encodeAttributes(o,s,n);for(const u of a)if(u)for(const c of u){const h=t.index;t.add(c.x,c.y,0,0,l),t.add(c.x,c.y,0,1,l),t.add(c.x,c.y,1,0,l),t.add(c.x,c.y,1,1,l),r.add(h,h+1,h+2),r.add(h+1,h+2,h+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let s=0;sk.page-B.page);for(const{ddFillAttributes:k,ddOutlineAttributes:B,page:$,geometry:V}of m)this._processFeature(V,c,t.outlineUsesFillColor,k,B,p,$)}}else for(const m of h){const v=o?n.encodeAttributes(m,r,t):null,w=c&&a?s.encodeAttributes(m,r,t):null,S=m.getGeometry(e);this._processFeature(S,c,t.outlineUsesFillColor,v,w,p)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,u]]of s)t[n++]=a,t[n++]=l,t[n++]=u;t[n++]=this._fillVertexBuffer.array.length;for(let a=0;ac?(h!==void 0&&this._processFill(e,h,n,o,a),h=[p]):m<-c&&h!==void 0&&h.push(p)}h!==void 0&&this._processFill(e,h,n,o,a)}_processOutline(e,t){const r=this._outlineVertexBuffer,n=this._outlineIndexBuffer,s=n.index;let o,a,l;const u=new Po(0,0),c=new Po(0,0),h=new Po(0,0);let p=-1,m=-1,v=-1,w=-1,S=-1,I=!1;const R=0;let L=e.length;if(L<2)return;const k=e[R];let B=e[L-1];for(;L&&B.isEqual(k);)--L,B=e[L-1];if(!(L-R<2)){for(let $=R;$8&&(Q=8),Y>=0?(v=r.add(a.x,a.y,u.x,u.y,0,1,t),w===-1&&(w=v),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,Q*-h.x,Q*-h.y,0,-1,t),S===-1&&(S=m),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=m,m=v,v=r.add(a.x,a.y,h.x,h.y,0,1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,c.x,c.y,0,1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v)):(v=r.add(a.x,a.y,Q*h.x,Q*h.y,0,1,t),w===-1&&(w=v),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),m=r.add(a.x,a.y,-u.x,-u.y,0,-1,t),S===-1&&(S=m),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=m,m=v,v=r.add(a.x,a.y,-h.x,-h.y,0,-1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v),p=r.add(a.x,a.y,-c.x,-c.y,0,-1,t),p>=0&&m>=0&&v>=0&&!V&&n.add(p,m,v))}p>=0&&m>=0&&w>=0&&!I&&n.add(p,m,w),p>=0&&w>=0&&S>=0&&!I&&n.add(p,S,w),this._outlineIndexCount+=3*(n.index-s)}}_processFill(e,t,r,n,s){n=!0;let o;t.length>1&&(o=[]);let a=0;for(const h of t)a!==0&&o.push(a),a+=e[h].length;const l=2*a,u=Ky.acquire();for(const h of t){const p=e[h],m=p.length;for(let v=0;v0){const h=t.map(v=>e[v].length),{buffer:p,vertexCount:m}=iGt(u,h);if(m>0){const v=this._fillVertexBuffer.index;for(let w=0;w0){const p=this._fillVertexBuffer.index;let m=0;for(;m=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const r=e.length-1;for(let n=0;nne.page-de.page),s.textured=!0;for(const{ddAttributes:ne,page:de,cap:pe,join:H,miterLimit:Z,roundLimit:ae,halfWidth:fe,offset:be,geometry:_e}of re)s.capType=pe,s.joinType=H,s.miterLimit=Z,s.roundLimit=ae,s.halfWidth=fe,s.offset=be,this._processFeature(_e,ne,de)}else{if(l){const re=l.getValue(r);if(!this._spriteInfo[re]?.rect)return}s.textured=!(!l&&!u),s.capType=v,s.joinType=R,s.miterLimit=k,s.roundLimit=$,s.halfWidth=.5*Y,s.offset=Q;for(const re of n){const ne=o?a.encodeAttributes(re,r,t):null;m&&(s.capType=m.getValue(r,re)),I&&(s.joinType=I.getValue(r,re)),L&&(s.miterLimit=L.getValue(r,re)),B&&(s.roundLimit=B.getValue(r,re)),V&&(s.halfWidth=.5*V.getValue(r,re)),K&&(s.offset=K.getValue(r,re));const de=re.getGeometry(e);this._processFeature(de,ne)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),r=new Int32Array(t.buffer);let n=0;t[n++]=this.type,t[n++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[l,u]]of s)t[n++]=a,t[n++]=l,t[n++]=u;t[n++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,r,n,s,o,a,l,u,c,h)=>(i._lineVertexBuffer.add(e,t,a,l,r,n,s,o,u,c,h,i._ddValues),i._lineVertexBuffer.index-1),hsn=i=>(e,t,r)=>{i._lineIndexBuffer.add(e,t,r)};var qs,q6;(function(i){i[i.R8_SIGNED=0]="R8_SIGNED",i[i.R8_UNSIGNED=1]="R8_UNSIGNED",i[i.R16_SIGNED=2]="R16_SIGNED",i[i.R16_UNSIGNED=3]="R16_UNSIGNED",i[i.R8G8_SIGNED=4]="R8G8_SIGNED",i[i.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",i[i.R16G16_SIGNED=6]="R16G16_SIGNED",i[i.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",i[i.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",i[i.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",i[i.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",i[i.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",i[i.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(qs||(qs={})),function(i){i[i.UNIFORM=0]="UNIFORM",i[i.DATA_DRIVEN=1]="DATA_DRIVEN",i[i.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",i[i.UNUSED=3]="UNUSED"}(q6||(q6={}));let cL=class jBe{constructor(e){this._locations=new Map,this._key=e}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(e,t,r,n,s){const o=this.getUniforms();for(const a of o){const{name:l,type:u,getValue:c}=a,h=c(r,t,n,s);if(h!==null)switch(u){case"float":e.setUniform1f(l,h);break;case"vec2":e.setUniform2fv(l,h);break;case"vec4":e.setUniform4fv(l,h)}}}encodeAttributes(e,t,r,n){const s=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,u=0;for(const c of Object.keys(o)){const h=o[c],{type:p,precisionFactor:m,isLayout:v}=s[c],w=v?r.getLayoutProperty(c):r.getPaintProperty(c),S=w.interpolator?.getInterpolationRange(t);let I=0;for(const R of h){const{offset:L,bufferElementsToAdd:k}=R;if(k>0){for(let $=0;$4)n++,V={dataIndex:n,count:0,offset:0},L!==4&&(r[$]=V),e.push({location:-1,name:"a_data_"+n,count:L,type:I,normalized:k}),Y=Math.ceil(Math.max(B/4,1));else{const K=e[V.dataIndex];K.count+=L,Y=Math.ceil(Math.max(K.count*R/4,1))-Math.ceil(Math.max(V.offset/4,1))}v.push({dataIndex:V.dataIndex,offset:V.offset,bufferElementsToAdd:Y}),V.offset+=B,V.count+=L}}for(const h of e)switch(h.type){case Ti.BYTE:case Ti.UNSIGNED_BYTE:h.count=4;break;case Ti.SHORT:case Ti.UNSIGNED_SHORT:h.count+=h.count%2}this._buildVertexBufferLayout(e);let l=0;const u=this._layoutInfo.geometry;for(const h of u)this._locations.set(h.name,l++);const c=this._layoutInfo.opacity;if(c)for(const h of c)this._locations.set(h.name,l++);this._buildShaderInfo(e,t),this._propertyEncodingInfo=t}_buildVertexBufferLayout(e){const t={},r=this.geometryInfo();let n=r[0].stride;if(e.length===0)t.geometry=r;else{const s=[];let o=n;for(const a of e)n+=Pyt(a.type)*a.count;for(const a of r)s.push(new Hl(a.name,a.count,a.type,a.offset,n,a.normalized));for(const a of e)s.push(new Hl(a.name,a.count,a.type,o,n,a.normalized)),o+=Pyt(a.type)*a.count;t.geometry=s}this.opacityInfo()&&(t.opacity=this.opacityInfo()),this._layoutInfo=t,this._stride=n}_buildShaderInfo(e,t){let r=` `,n=` `;const s=[];for(const u of e)r+=`attribute ${this._getType(u.count)} ${u.name}; -`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:c,type:h,precisionFactor:p,isLayout:m}=a[u],v=p&&p!==1?" * "+1/p:"",{bytesPerElement:w,count:S}=jBe._encodingInfo[h],I=R=>`a_data_${R.dataIndex}${msn(S,R.offset,w)}`;switch(this.getAtributeState(l)){case q6.UNIFORM:{const R=this._getType(S),L=`u_${c}`;s.push({name:L,type:R,getValue:(k,B,$,V)=>{const Y=m?k.getLayoutValue(u,B):k.getPaintValue(u,B);if(h===qs.R16G16B16A16_DASHARRAY){const K=k.getDashKey(Y,k.getLayoutValue("line-cap",B)),Q=V.getMosaicItemPosition(K,!1);if(Q==null)return null;const{tl:re,br:ne}=Q;return[re[0],ne[1],ne[0],re[1]]}if(h===qs.R16G16B16A16_PATTERN){const K=V.getMosaicItemPosition(Y,!u.includes("line-"));if(K==null)return null;const{tl:Q,br:re}=K;return[Q[0],re[1],re[0],Q[1]]}if(h===qs.R8G8B8A8_COLOR){const K=Y[3];return[K*Y[0],K*Y[1],K*Y[2],K]}return Y}}),r+=`uniform ${R} ${L}; +`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:c,type:h,precisionFactor:p,isLayout:m}=a[u],v=p&&p!==1?" * "+1/p:"",{bytesPerElement:w,count:S}=jBe._encodingInfo[h],I=R=>`a_data_${R.dataIndex}${dsn(S,R.offset,w)}`;switch(this.getAtributeState(l)){case q6.UNIFORM:{const R=this._getType(S),L=`u_${c}`;s.push({name:L,type:R,getValue:(k,B,$,V)=>{const Y=m?k.getLayoutValue(u,B):k.getPaintValue(u,B);if(h===qs.R16G16B16A16_DASHARRAY){const K=k.getDashKey(Y,k.getLayoutValue("line-cap",B)),Q=V.getMosaicItemPosition(K,!1);if(Q==null)return null;const{tl:re,br:ne}=Q;return[re[0],ne[1],ne[0],re[1]]}if(h===qs.R16G16B16A16_PATTERN){const K=V.getMosaicItemPosition(Y,!u.includes("line-"));if(K==null)return null;const{tl:Q,br:re}=K;return[Q[0],re[1],re[0],Q[1]]}if(h===qs.R8G8B8A8_COLOR){const K=Y[3];return[K*Y[0],K*Y[1],K*Y[2],K]}return Y}}),r+=`uniform ${R} ${L}; `,n+=`${R} ${c} = ${L}; `}break;case q6.DATA_DRIVEN:{const R=I(t[u][0]);n+=`${this._getType(S)} ${c} = ${R}${v}; `}break;case q6.INTERPOLATED_DATA_DRIVEN:{const R=`u_t_${c}`;s.push({name:R,type:"float",getValue:(B,$,V,Y)=>(m?B.getLayoutProperty(u):B.getPaintProperty(u)).interpolator.interpolationUniformValue(V,$)}),r+=`uniform float ${R}; `;const L=I(t[u][0]),k=I(t[u][1]);n+=`${this._getType(S)} ${c} = mix(${L}${v}, ${k}${v}, ${R}); -`}}}this._shaderHeader=r,this._shaderMain=n,this._uniforms=s}_bit(e){return(this._key&1<>e}_getType(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(e){const t=255*e[3];return cg.i8888to32(e[0]*t,e[1]*t,e[2]*t,t)}_encodePattern(e,t,r){if(!r?.rect)return;const n=2,s=r.rect,o=r.width,a=r.height;t[e]=this._encodeShort(s.x+n,0),t[e]|=this._encodeShort(s.y+n+a,16),t[e+1]=this._encodeShort(s.x+n+o,0),t[e+1]|=this._encodeShort(s.y+n,16)}_encodeByte(e,t){return(255&e)<{switch(i){case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1}},msn=(i,e,t)=>{const r=e/t;if(i===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(i===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(i===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let wH=class Mye extends cL{constructor(e){super(e)}geometryInfo(){return Mye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Mye.ATTRIBUTES}attributesInfo(){return Mye.ATTRIBUTES_INFO}};wH.ATTRIBUTES=[],wH.GEOMETRY_LAYOUT=[new Vl("a_pos",2,Ti.BYTE,0,2)],wH.ATTRIBUTES_INFO={};let xH=class Oye extends cL{constructor(e){super(e)}geometryInfo(){return Oye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Oye.ATTRIBUTES}attributesInfo(){return Oye.ATTRIBUTES_INFO}};xH.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],xH.GEOMETRY_LAYOUT=[new Vl("a_pos",2,Ti.SHORT,0,4)],xH.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:qs.R8_UNSIGNED},"circle-color":{name:"color",type:qs.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:qs.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:qs.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:qs.R8_UNSIGNED,precisionFactor:32}};let SH=class Pye extends cL{constructor(e){super(e)}geometryInfo(){return Pye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Pye.ATTRIBUTES}attributesInfo(){return Pye.ATTRIBUTES_INFO}};SH.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],SH.GEOMETRY_LAYOUT=[new Vl("a_pos",2,Ti.SHORT,0,4)],SH.ATTRIBUTES_INFO={"fill-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:qs.R16G16B16A16_PATTERN,isOptional:!0}};let bA=class BU extends cL{constructor(e,t){super(e),this._usefillColor=t}geometryInfo(){return BU.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?BU.ATTRIBUTES_FILL:BU.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?BU.ATTRIBUTES_INFO_FILL:BU.ATTRIBUTES_INFO_OUTLINE}};bA.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],bA.ATTRIBUTES_FILL=["fill-color","fill-opacity"],bA.GEOMETRY_LAYOUT=[new Vl("a_pos",2,Ti.SHORT,0,8),new Vl("a_offset",2,Ti.BYTE,4,8),new Vl("a_xnormal",2,Ti.BYTE,6,8)],bA.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100}},bA.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100}};let TH=class Rye extends cL{constructor(e){super(e)}geometryInfo(){return Rye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Rye.ATTRIBUTES}attributesInfo(){return Rye.ATTRIBUTES_INFO}};TH.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],TH.GEOMETRY_LAYOUT=[new Vl("a_pos",2,Ti.SHORT,0,16),new Vl("a_extrude_offset",4,Ti.BYTE,4,16),new Vl("a_dir_normal",4,Ti.BYTE,8,16),new Vl("a_accumulatedDistance",2,Ti.UNSIGNED_SHORT,12,16)],TH.ATTRIBUTES_INFO={"line-width":{name:"width",type:qs.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:qs.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:qs.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:qs.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:qs.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:qs.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:qs.R16G16B16A16_DASHARRAY,isOptional:!0}};const bHt=[new Vl("a_pos",2,Ti.SHORT,0,16),new Vl("a_vertexOffset",2,Ti.SHORT,4,16),new Vl("a_texAngleRange",4,Ti.UNSIGNED_BYTE,8,16),new Vl("a_levelInfo",4,Ti.UNSIGNED_BYTE,12,16)],wHt=[new Vl("a_opacityInfo",1,Ti.UNSIGNED_BYTE,0,1)];let xre=class GBe extends cL{constructor(e){super(e)}geometryInfo(){return bHt}opacityInfo(){return wHt}attributes(){return GBe.ATTRIBUTES}attributesInfo(){return GBe.ATTRIBUTES_INFO}};xre.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],xre.ATTRIBUTES_INFO={"icon-color":{name:"color",type:qs.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:qs.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:qs.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:qs.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:qs.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let Sre=class UBe extends cL{constructor(e){super(e)}geometryInfo(){return bHt}opacityInfo(){return wHt}attributes(){return UBe.ATTRIBUTES}attributesInfo(){return UBe.ATTRIBUTES_INFO}};Sre.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],Sre.ATTRIBUTES_INFO={"text-color":{name:"color",type:qs.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:qs.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:qs.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:qs.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:qs.R8_UNSIGNED,isLayout:!0}};const xHt={kind:"null"},vp={kind:"number"},jx={kind:"string"},x0={kind:"boolean"},MR={kind:"color"},jCe={kind:"object"},XP={kind:"value"};function Fle(i,e){return{kind:"array",itemType:i,n:e}}const gsn=[xHt,vp,jx,x0,MR,jCe,Fle(XP)];function Fq(i){if(i.kind==="array"){const e=Fq(i.itemType);return typeof i.n=="number"?`array<${e}, ${i.n}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}function GCe(i){if(i===null)return xHt;if(typeof i=="string")return jx;if(typeof i=="boolean")return x0;if(typeof i=="number")return vp;if(i instanceof jr)return MR;if(Array.isArray(i)){let e;for(const t of i){const r=GCe(t);if(e){if(e!==r){e=XP;break}}else e=r}return Fle(e||XP,i.length)}return typeof i=="object"?jCe:XP}function zBe(i,e){if(e.kind==="array")return i.kind==="array"&&(i.n===0&&i.itemType.kind==="value"||zBe(i.itemType,e.itemType))&&(typeof e.n!="number"||e.n===i.n);if(e.kind==="value"){for(const t of gsn)if(zBe(i,t))return!0}return e.kind===i.kind}function VBe(i){if(i===null)return"";const e=typeof i;return e==="string"?i:e==="number"||e==="boolean"?String(i):i instanceof jr?i.toString():JSON.stringify(i)}let ysn=class{constructor(e){this._parent=e,this._vars={}}add(e,t){this._vars[e]=t}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}},vsn=class SHt{constructor(){this.type=XP}static parse(e){if(e.length>1)throw new Error('"id" does not expect arguments');return new SHt}evaluate(e,t){return e?.id}},_sn=class THt{constructor(){this.type=jx}static parse(e){if(e.length>1)throw new Error('"geometry-type" does not expect arguments');return new THt}evaluate(e,t){if(!e)return null;switch(e.type){case Yy.Point:return"Point";case Yy.LineString:return"LineString";case Yy.Polygon:return"Polygon";default:return null}}},bsn=class CHt{constructor(){this.type=jCe}static parse(e){if(e.length>1)throw new Error('"properties" does not expect arguments');return new CHt}evaluate(e,t){return e?.values}},EHt=class IHt{constructor(){this.type=vp}static parse(e){if(e.length>1)throw new Error('"zoom" does not expect arguments');return new IHt}evaluate(e,t){return t}},YS=class AHt{constructor(e,t,r){this._lhs=e,this._rhs=t,this._compare=r,this.type=x0}static parse(e,t,r){if(e.length!==3&&e.length!==4)throw new Error(`"${e[0]}" expects 2 or 3 arguments`);if(e.length===4)throw new Error(`"${e[0]}" collator not supported`);return new AHt(xa(e[1],t),xa(e[2],t),r)}evaluate(e,t){return this._compare(this._lhs.evaluate(e,t),this._rhs.evaluate(e,t))}},wsn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r===n)}},xsn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r!==n)}},Ssn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>rr<=n)}},Csn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r>n)}},Esn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r>=n)}},Isn=class MHt{constructor(e){this._arg=e,this.type=x0}static parse(e,t){if(e.length!==2)throw new Error('"!" expects 1 argument');return new MHt(xa(e[1],t))}evaluate(e,t){return!this._arg.evaluate(e,t)}},Asn=class OHt{constructor(e){this._args=e,this.type=x0}static parse(e,t){const r=[];for(let n=1;n1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${e[0]}" unknown interpolation type "${s[0]}"`)}if(e.length%2!=1)throw new Error(`"${n}" expects an even number of arguments`);const o=xa(e[2],t,vp);let a;n==="interpolate-hcl"||n==="interpolate-lab"?a=MR:r&&r.kind!=="value"&&(a=r);const l=[];for(let u=3;u=c)throw new Error(`"${n}" requires strictly ascending stop inputs`);const h=xa(e[u+1],t,a);a||(a=h.type),l.push([c,h])}if(a&&a!==MR&&a!==vp&&(a.kind!=="array"||a.itemType!==vp))throw new Error(`"${n}" cannot interpolate type ${Fq(a)}`);return new W$(n,a,s,o,l)}evaluate(e,t){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,t);const n=this.input.evaluate(e,t);if(n<=r[0][0])return r[0][1].evaluate(e,t);if(n>=r[r.length-1][0])return r[r.length-1][1].evaluate(e,t);let s=0;for(;++stg(h,c[p],l));if(this.type.kind==="color"&&u instanceof jr&&c instanceof jr){const h=new jr(u),p=new jr(c);return new jr([tg(h.r,p.r,l),tg(h.g,p.g,l),tg(h.b,p.b,l),tg(h.a,p.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof c=="number")return tg(u,c,l);throw new Error(`"${this._operator}" cannot interpolate type ${Fq(this.type)}`)}if(this._operator==="interpolate-hcl"){const h=h1e(u),p=h1e(c),m=p.h-h.h,v=ZF({h:h.h+l*(m>180||m<-180?m-360*Math.round(m/360):m),c:tg(h.c,p.c,l),l:tg(h.l,p.l,l)});return new jr({a:tg(u.a,c.a,l),...v})}if(this._operator==="interpolate-lab"){const h=c1e(u),p=c1e(c),m=ZF({l:tg(h.l,p.l,l),a:tg(h.a,p.a,l),b:tg(h.b,p.b,l)});return new jr({a:tg(u.a,c.a,l),...m})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,t){const r=this._stops;if(r.length===1||e>=r[r.length-1][0])return 0;let n=0;for(;++n=r)return[r,r];let n=0;for(;++n1&&(s=1),s}static _exponentialInterpolationRatio(e,t,r,n){const s=n-r;if(s===0)return 0;const o=e-r;return t===1?o/s:(t**o-1)/(t**s-1)}},Fsn=class LHt{constructor(e,t,r){this.type=e,this._input=t,this._stops=r}static parse(e,t){if(e.length<5)throw new Error('"step" expects at least 4 arguments');if(e.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=xa(e[1],t,vp);let n;const s=[];s.push([-1/0,xa(e[2],t)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=xa(e[o+1],t);n||(n=l.type),s.push([a,l])}return new LHt(n,r,s)}evaluate(e,t){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,t);const n=this._input.evaluate(e,t);let s=0;for(;++s=n.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return n[r]}},$sn=class HBe{constructor(e,t){this._key=e,this._obj=t,this.type=XP}static parse(e,t){let r,n;switch(e.length){case 2:return r=xa(e[1],t),new HBe(r);case 3:return r=xa(e[1],t),n=xa(e[2],t),new HBe(r,n);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(e,t){const r=this._key.evaluate(e,t);return this._obj?this._obj.evaluate(e,t)[r]:e?.values[r]}},Bsn=class WBe{constructor(e,t){this._key=e,this._obj=t,this.type=x0}static parse(e,t){let r,n;switch(e.length){case 2:return r=xa(e[1],t),new WBe(r);case 3:return r=xa(e[1],t),n=xa(e[2],t),new WBe(r,n);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(e,t){const r=this._key.evaluate(e,t);return this._obj?r in this._obj.evaluate(e,t):!!e?.values[r]}},jsn=class jHt{constructor(e,t){this._key=e,this._vals=t,this.type=x0}static parse(e,t){if(e.length!==3)throw new Error('"in" expects 2 arguments');return new jHt(xa(e[1],t),xa(e[2],t))}evaluate(e,t){const r=this._key.evaluate(e,t);return this._vals.evaluate(e,t).includes(r)}},Gsn=class qBe{constructor(e,t,r){this._item=e,this._array=t,this._from=r,this.type=vp}static parse(e,t){if(e.length<3||e.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=xa(e[1],t),n=xa(e[2],t);if(e.length===4){const s=xa(e[3],t,vp);return new qBe(r,n,s)}return new qBe(r,n)}evaluate(e,t){const r=this._item.evaluate(e,t),n=this._array.evaluate(e,t);if(this._from){const s=this._from.evaluate(e,t);if(s!==Math.floor(s))throw new Error('"index-of" index must be an integer');return n.indexOf(r,s)}return n.indexOf(r)}},Usn=class GHt{constructor(e){this._arg=e,this.type=vp}static parse(e,t){if(e.length!==2)throw new Error('"length" expects 2 arguments');const r=xa(e[1],t);return new GHt(r)}evaluate(e,t){const r=this._arg.evaluate(e,t);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}},zsn=class YBe{constructor(e,t,r,n){this.type=e,this._array=t,this._from=r,this._to=n}static parse(e,t){if(e.length<3||e.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=xa(e[1],t),n=xa(e[2],t,vp);if(n.type!==vp)throw new Error('"slice" index must return a number');if(e.length===4){const s=xa(e[3],t,vp);if(s.type!==vp)throw new Error('"slice" index must return a number');return new YBe(r.type,r,n,s)}return new YBe(r.type,r,n)}evaluate(e,t){const r=this._array.evaluate(e,t);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const n=this._from.evaluate(e,t);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');if(this._to){const s=this._to.evaluate(e,t);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');return r.slice(n,s)}return r.slice(n)}},Vsn=class UHt{constructor(){this.type=x0}static parse(e){if(e.length!==1)throw new Error('"has-id" expects no arguments');return new UHt}evaluate(e,t){return e?.id!==void 0}},Sx=class zHt{constructor(e,t){this._args=e,this._calculate=t,this.type=vp}static parse(e,t,r){const n=e.slice(1).map(s=>xa(s,t));return new zHt(n,r)}evaluate(e,t){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,t))),this._calculate(r)}},Hsn=class extends Sx{static parse(e,t){switch(e.length){case 2:return Sx.parse(e,t,r=>-r[0]);case 3:return Sx.parse(e,t,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}},Wsn=class extends Sx{static parse(e,t){return Sx.parse(e,t,r=>{let n=1;for(const s of r)n*=s;return n})}},qsn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}},Ysn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}},Xsn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}},Jsn=class extends Sx{static parse(e,t){return Sx.parse(e,t,r=>{let n=0;for(const s of r)n+=s;return n})}},Xf=class XBe{constructor(e,t){this._args=e,this._calculate=t,this.type=vp}static parse(e,t){const r=e.slice(1).map(n=>xa(n,t));return new XBe(r,XBe.ops[e[0]])}evaluate(e,t){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,t))),this._calculate(r)}};Xf.ops={abs:i=>Math.abs(i[0]),acos:i=>Math.acos(i[0]),asin:i=>Math.asin(i[0]),atan:i=>Math.atan(i[0]),ceil:i=>Math.ceil(i[0]),cos:i=>Math.cos(i[0]),e:()=>Math.E,floor:i=>Math.floor(i[0]),ln:i=>Math.log(i[0]),ln2:()=>Math.LN2,log10:i=>Math.log(i[0])/Math.LN10,log2:i=>Math.log(i[0])/Math.LN2,max:i=>Math.max(...i),min:i=>Math.min(...i),pi:()=>Math.PI,round:i=>Math.round(i[0]),sin:i=>Math.sin(i[0]),sqrt:i=>Math.sqrt(i[0]),tan:i=>Math.tan(i[0])};let Ksn=class VHt{constructor(e){this._args=e,this.type=jx}static parse(e,t){return new VHt(e.slice(1).map(r=>xa(r,t)))}evaluate(e,t){return this._args.map(r=>r.evaluate(e,t)).join("")}},JBe=class KBe{constructor(e,t){this._arg=e,this._calculate=t,this.type=jx}static parse(e,t){if(e.length!==2)throw new Error(`${e[0]} expects 1 argument`);const r=xa(e[1],t);return new KBe(r,KBe.ops[e[0]])}evaluate(e,t){return this._calculate(this._arg.evaluate(e,t))}};JBe.ops={downcase:i=>i.toLowerCase(),upcase:i=>i.toUpperCase()};let Zsn=class HHt{constructor(e){this._args=e,this.type=MR}static parse(e,t){if(e.length!==4)throw new Error('"rgb" expects 3 arguments');const r=e.slice(1).map(n=>xa(n,t));return new HHt(r)}evaluate(e,t){const r=this._validate(this._args[0].evaluate(e,t)),n=this._validate(this._args[1].evaluate(e,t)),s=this._validate(this._args[2].evaluate(e,t));return new jr({r,g:n,b:s})}_validate(e){if(typeof e!="number"||e<0||e>255)throw new Error(`${e}: invalid color component`);return Math.round(e)}},Qsn=class WHt{constructor(e){this._args=e,this.type=MR}static parse(e,t){if(e.length!==5)throw new Error('"rgba" expects 4 arguments');const r=e.slice(1).map(n=>xa(n,t));return new WHt(r)}evaluate(e,t){const r=this._validate(this._args[0].evaluate(e,t)),n=this._validate(this._args[1].evaluate(e,t)),s=this._validate(this._args[2].evaluate(e,t)),o=this._validateAlpha(this._args[3].evaluate(e,t));return new jr({r,g:n,b:s,a:o})}_validate(e){if(typeof e!="number"||e<0||e>255)throw new Error(`${e}: invalid color component`);return Math.round(e)}_validateAlpha(e){if(typeof e!="number"||e<0||e>1)throw new Error(`${e}: invalid alpha color component`);return e}},eon=class qHt{constructor(e){this._color=e,this.type=Fle(vp,4)}static parse(e,t){if(e.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=xa(e[1],t);return new qHt(r)}evaluate(e,t){return new jr(this._color.evaluate(e,t)).toRgba()}},EK=class YHt{constructor(e,t){this.type=e,this._args=t}static parse(e,t){const r=e[0];if(e.length<2)throw new Error(`${r} expects at least one argument`);let n,s=1;if(r==="array"){if(e.length>2){switch(e[1]){case"string":n=jx;break;case"number":n=vp;break;case"boolean":n=x0;break;default:throw new Error('"array" type argument must be string, number or boolean')}s++}else n=XP;let a;if(e.length>3){if(a=e[2],a!==null&&(typeof a!="number"||a<0||a!==Math.floor(a)))throw new Error('"array" length argument must be a positive integer literal');s++}n=Fle(n,a)}else switch(r){case"string":n=jx;break;case"number":n=vp;break;case"boolean":n=x0;break;case"object":n=jCe}const o=[];for(;s":Csn,">=":Esn,all:Asn,any:Msn,case:Psn,coalesce:Rsn,match:Dsn,within:null,interpolate:Dye,"interpolate-hcl":Dye,"interpolate-lab":Dye,step:Fsn,let:ksn,var:Lsn,concat:Ksn,downcase:JBe,"is-supported-script":null,"resolved-locale":null,upcase:JBe,rgb:Zsn,rgba:Qsn,"to-rgba":eon,"-":Hsn,"*":Wsn,"/":qsn,"%":Ysn,"^":Xsn,"+":Jsn,abs:Xf,acos:Xf,asin:Xf,atan:Xf,ceil:Xf,cos:Xf,e:Xf,floor:Xf,ln:Xf,ln2:Xf,log10:Xf,log2:Xf,max:Xf,min:Xf,pi:Xf,round:Xf,sin:Xf,sqrt:Xf,tan:Xf,zoom:EHt,"heatmap-density":null,"has-id":Vsn,none:Osn};let ron=class Iw{constructor(e){this._expression=e}filter(e,t){if(!this._expression)return!0;try{return this._expression.evaluate(e,t)}catch(r){return console.log(r.message),!0}}static createFilter(e){if(!e)return null;this.isLegacyFilter(e)&&(e=this.convertLegacyFilter(e));try{const t=xa(e,null,x0);return new Iw(t)}catch(t){return console.log(t.message),null}}static isLegacyFilter(e){if(!Array.isArray(e)||e.length===0)return!0;switch(e[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return e.length===3&&typeof e[1]=="string"&&!Array.isArray(e[2]);case"in":return e.length>=3&&typeof e[1]=="string"&&!Array.isArray(e[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let t=1;t":case"<":case">=":case"<=":return Iw.convertComparison(t,e[1],e[2]);case"in":return Iw.convertIn(e[1],e.slice(2));case"!in":return Iw.negate(Iw.convertIn(e[1],e.slice(2)));case"any":case"all":case"none":return Iw.convertCombining(t,e.slice(1));case"has":return Iw.convertHas(e[1]);case"!has":return Iw.negate(Iw.convertHas(e[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(e,t,r){switch(t){case"$type":return[e,["geometry-type"],r];case"$id":return[e,["id"],r];default:return[e,["get",t],r]}}static convertIn(e,t){switch(e){case"$type":return["in",["geometry-type"],["literal",t]];case"$id":return["in",["id"],["literal",t]];default:return["in",["get",e],["literal",t]]}}static convertHas(e){switch(e){case"$type":return!0;case"$id":return["has-id"];default:return["has",e]}}static convertCombining(e,t){return[e].concat(t.map(this.convertLegacyFilter))}static negate(e){return["!",e]}},Ryt=class ZHt{constructor(e,t){let r;switch(this.isDataDriven=!1,this.interpolator=null,e.type){case"number":case"color":r=!0;break;case"array":r=e.value==="number";break;default:r=!1}if(t==null&&(t=e.default),Array.isArray(t)&&t.length>0&&KHt[t[0]]){const s={number:vp,color:MR,string:jx,boolean:x0,enum:jx};try{const o=e.type==="array"?Fle(s[e.value]||XP,e.length):s[e.type],a=xa(t,null,o);this.getValue=this._buildExpression(a,e),this.isDataDriven=!0,a instanceof Dye&&a.input instanceof EHt&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(e.default)}return}r&&t.type==="interval"&&(r=!1);const n=t?.stops&&t.stops.length>0;if(n)for(const s of t.stops)s[1]=this._validate(s[1],e);if(this.isDataDriven=!!t&&!!t.property,this.isDataDriven)if(t.default!==void 0&&(t.default=this._validate(t.default,e)),n)switch(t.type){case"identity":this.getValue=this._buildIdentity(t,e);break;case"categorical":this.getValue=this._buildCategorical(t,e);break;default:this.getValue=r?this._buildInterpolate(t,e):this._buildInterval(t,e)}else this.getValue=this._buildIdentity(t,e);else n?this.getValue=r?this._buildZoomInterpolate(t):this._buildZoomInterval(t):(t=this._validate(t,e),this.getValue=this._buildSimple(t))}_validate(e,t){if(t.type==="number"){if(t.minimum!=null&&et.maximum)return t.maximum}else t.type==="color"?e=ZHt._parseColor(e):t.type==="enum"?typeof e=="string"&&(e=t.values.indexOf(e)):t.type==="array"&&t.value==="enum"?e=e.map(r=>typeof r=="string"?t.values.indexOf(r):r):t.type==="string"&&(e=VBe(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,t){return(r,n)=>{try{const s=e.evaluate(n,r);return s===void 0?t.default:this._validate(s,t)}catch(s){return console.log(s.message),t.default}}}_buildIdentity(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s!==void 0&&(s=this._validate(s,t)),s??(e.default!==void 0?e.default:t.default)}}_buildCategorical(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s=this._categorical(s,e.stops),s!==void 0?s:e.default!==void 0?e.default:t.default}}_buildInterval(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),typeof s=="number"?this._interval(s,e.stops):e.default!==void 0?e.default:t.default}}_buildInterpolate(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),typeof s=="number"?this._interpolate(s,e.stops,e.base||1):e.default!==void 0?e.default:t.default}}_buildZoomInterpolate(e){return t=>this._interpolate(t,e.stops,e.base||1)}_buildZoomInterval(e){return t=>this._interval(t,e.stops)}_categorical(e,t){const r=t.length;for(let n=0;n0){u&&(v=u.getValue(s,w));for(const $ of v){let V=r[$];V||(V=r[$]=new Set);for(const Y of R){const K=Y.codePointAt(0);K!=null&&V.add(K)}}}}if(!I&&!R)continue;const k=n.getLayoutValue("symbol-sort-key",s,w),B={feature:w,sprite:I,label:R,rtl:L,geometry:S,hash:(R?Q1(R):0)^(I?Q1(I):0),priority:k,textFont:v};c.push(B)}this._symbolFeatures=c}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,r=this.zoom,n=t.getLayoutValue("symbol-placement",r),s=n!==YP.POINT,o=t.getLayoutValue("symbol-spacing",r)*ite,a=t.getLayoutProperty("icon-image"),l=t.getLayoutProperty("text-field"),u=a?new son(t,r,s):null,c=l?new oon(t,r,s):null,h=this._workerTileHandler;let p;a&&(p=h.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const m=[];let v=1;c&&c.size&&(v=c.size/vA);const w=c?c.maxAngle*X8e:0,S=c?c.size*ite:0;for(const I of this._symbolFeatures){let R;u&&p&&I.sprite&&(R=p[I.sprite],R&&R.sdf&&(this._isIconSDF=!0));let L;R&&u.update(r,I.feature);let k=0;const B=I.label;if(B){Of(c),c.update(r,I.feature);const $=s&&c.rotationAlignment===sc.MAP?c.keepUpright:c.writingMode&&c.writingMode.includes(qbe.VERTICAL);let V=.5;switch(c.anchor){case ec.TOP_LEFT:case ec.LEFT:case ec.BOTTOM_LEFT:V=0;break;case ec.TOP_RIGHT:case ec.RIGHT:case ec.BOTTOM_RIGHT:V=1}let Y=.5;switch(c.anchor){case ec.TOP_LEFT:case ec.TOP:case ec.TOP_RIGHT:Y=0;break;case ec.BOTTOM_LEFT:case ec.BOTTOM:case ec.BOTTOM_RIGHT:Y=1}let K=.5;switch(c.justify){case bH.AUTO:K=V;break;case bH.LEFT:K=0;break;case bH.RIGHT:K=1}const Q=c.letterSpacing*vA,re=s?0:c.maxWidth*vA,ne=c.lineHeight*vA,de=I.textFont.map(pe=>h.getGlyphItems(pe));if(L=new yHt(de,re,ne,Q,V,Y,K).getShaping(B,I.rtl,$),L&&L.length>0){let pe=1e30,H=-1e30;for(const Z of L)pe=Math.min(pe,Z.x),H=Math.max(H,Z.x);k=(H-pe+2*vA)*v*ite}}for(let $ of I.geometry){const V=[];if(n===YP.LINE){if(L?.length&&c?.size){const Y=c.size*ite*(2+Math.min(2,4*Math.abs(c.offset[1])));$=XT._smoothVertices($,Y)}XT._pushAnchors(V,$,o,k)}else n===YP.LINE_CENTER?XT._pushCenterAnchor(V,$):I.feature.type===Yy.Polygon?XT._pushCentroid(V,$):V.push(new spe($[0].x,$[0].y));for(const Y of V){if(Y.x<0||Y.x>Iyt||Y.y<0||Y.y>Iyt||s&&k>0&&c?.rotationAlignment===sc.MAP&&!XT._honorsTextMaxAngle($,Y,k,w,S))continue;const K={shaping:L,line:$,iconMosaicItem:R,anchor:Y,symbolFeature:I,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};m.push(K),this._processFeature(K,u,c)}}}m.sort(aon),this._addPlacedGlyphs(),this._symbolInstances=m}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=XT._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),r=new Int32Array(t.buffer),n=new Float32Array(t.buffer),[s,o,a]=this._sourceTileKey.split("/");let l=0;t[l++]=this.type,t[l++]=this.layerUIDs.length;for(let u=0;un in t?t[n]:"")}_processFeature(e,t,r){const{line:n,iconMosaicItem:s,shaping:o,anchor:a}=e,l=this.zoom,u=this.layer,c=!!s;let h=!0;c&&(h=t?.optional||!s);const p=o&&o.length>0,m=!p||r?.optional;let v,w;if(c&&(v=this._placementEngine.getIconPlacement(a,s,t)),(v||h)&&(p&&(w=this._placementEngine.getTextPlacement(a,o,n,r)),w||m)){if(v&&w||(m||h?m||w?h||v||(w=null):v=null:(v=null,w=null)),w){const S=u.hasDataDrivenText?u.textMaterial.encodeAttributes(e.symbolFeature.feature,l,u):null;if(this._storePlacedGlyphs(e,w.shapes,l,r.rotationAlignment,S),w.textColliders){e.textColliders=w.textColliders;for(const I of w.textColliders){I.minLod=Math.max(l+kD(I.minLod),0),I.maxLod=Math.min(l+kD(I.maxLod),25);const R=I.angle;if(R){const L=Math.cos(R),k=Math.sin(R),B=I.dxPixels*L-I.dyPixels*k,$=I.dxPixels*k+I.dyPixels*L,V=(I.dxPixels+I.width)*L-I.dyPixels*k,Y=(I.dxPixels+I.width)*k+I.dyPixels*L,K=I.dxPixels*L-(I.dyPixels+I.height)*k,Q=I.dxPixels*k+(I.dyPixels+I.height)*L,re=(I.dxPixels+I.width)*L-(I.dyPixels+I.height)*k,ne=(I.dxPixels+I.width)*k+(I.dyPixels+I.height)*L,de=Math.min(B,V,K,re),pe=Math.max(B,V,K,re),H=Math.min($,Y,Q,ne),Z=Math.max($,Y,Q,ne);I.dxPixels=de,I.dyPixels=H,I.width=pe-de,I.height=Z-H}}}}if(v){const S=u.hasDataDrivenIcon?u.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,u):null;if(this._addPlacedIcons(e,v.shapes,l,s.page,t.rotationAlignment===sc.VIEWPORT,S),v.iconColliders){e.iconColliders=v.iconColliders;for(const I of v.iconColliders){I.minLod=Math.max(l+kD(I.minLod),0),I.maxLod=Math.min(l+kD(I.maxLod),25);const R=I.angle;if(R){const L=Math.cos(R),k=Math.sin(R),B=I.dxPixels*L-I.dyPixels*k,$=I.dxPixels*k+I.dyPixels*L,V=(I.dxPixels+I.width)*L-I.dyPixels*k,Y=(I.dxPixels+I.width)*k+I.dyPixels*L,K=I.dxPixels*L-(I.dyPixels+I.height)*k,Q=I.dxPixels*k+(I.dyPixels+I.height)*L,re=(I.dxPixels+I.width)*L-(I.dyPixels+I.height)*k,ne=(I.dxPixels+I.width)*k+(I.dyPixels+I.height)*L,de=Math.min(B,V,K,re),pe=Math.max(B,V,K,re),H=Math.min($,Y,Q,ne),Z=Math.max($,Y,Q,ne);I.dxPixels=de,I.dyPixels=H,I.width=pe-de,I.height=Z-H}}}}}}_addPlacedIcons(e,t,r,n,s,o){const a=Math.max(r-1,0),l=this._iconVertexBuffer,u=this._iconIndexBuffer,c=this._markerMap;for(const h of t){const p=s?0:Math.max(r+kD(h.minzoom),a),m=s?25:Math.min(r+kD(h.maxzoom),25);if(m<=p)continue;const v=h.tl,w=h.tr,S=h.bl,I=h.br,R=h.mosaicRect,L=h.labelAngle,k=h.minAngle,B=h.maxAngle,$=h.anchor,V=l.index,Y=R.x,K=R.y,Q=Y+R.width,re=K+R.height,ne=l.index;l.add($.x,$.y,v.x,v.y,Y,K,L,k,B,p,m,o),l.add($.x,$.y,w.x,w.y,Q,K,L,k,B,p,m,o),l.add($.x,$.y,S.x,S.y,Y,re,L,k,B,p,m,o),l.add($.x,$.y,I.x,I.y,Q,re,L,k,B,p,m,o),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===ne?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([ne,4]),u.add(V,V+1,V+2),u.add(V+1,V+2,V+3),c.has(n)?c.get(n)[1]+=6:c.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,r=this._glyphMap;for(const[n,s]of this._glyphBufferDataStorage)for(const o of s){const a=e.index,l=o.symbolInstance,u=o.ddAttributes,c=e.index;e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===c?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([c,4]),t.add(a,a+1,a+2),t.add(a+1,a+2,a+3),r.has(n)?r.get(n)[1]+=6:r.set(n,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,r,n,s){const o=Math.max(r-1,0),a=n===sc.VIEWPORT;let l,u,c,h,p,m,v,w,S,I,R;for(const L of t)l=a?0:Math.max(r+kD(L.minzoom),o),u=a?25:Math.min(r+kD(L.maxzoom),25),!(u<=l)&&(c=L.tl,h=L.tr,p=L.bl,m=L.br,v=L.labelAngle,w=L.minAngle,S=L.maxAngle,I=L.anchor,R=L.mosaicRect,this._glyphBufferDataStorage.has(L.page)||this._glyphBufferDataStorage.set(L.page,[]),this._glyphBufferDataStorage.get(L.page).push({glyphAnchor:[I.x,I.y],tl:[c.x,c.y],tr:[h.x,h.y],bl:[p.x,p.y],br:[m.x,m.y],xmin:R.x,ymin:R.y,xmax:R.x+R.width,ymax:R.y+R.height,labelAngle:v,minAngle:w,maxAngle:S,minLod:l,maxLod:u,placementLod:o,symbolInstance:e,ddAttributes:s}))}static _pushAnchors(e,t,r,n){r+=n;let s=0;const o=t.length-1;for(let p=0;p-a;){if(--u,u<0)return!1;o-=Po.distance(e[u],l),l=e[u]}o+=Po.distance(e[u],e[u+1]);const c=[];let h=0;const p=e.length;for(;os;)h-=c.shift().deviation;if(Math.abs(h)>n)return!1;o+=Po.distance(v,S),u=w}return!0}static _smoothVertices(e,t){if(t<=0)return e;let r=e.length;if(r<3)return e;const n=[];let s=0,o=0;n.push(0);for(let w=1;w0&&(s+=S,n.push(s),o++,o!==w&&(e[o]=e[w]))}if(r=o+1,r<3)return e;t=Math.min(t,.2*s);const a=e[0].x,l=e[0].y,u=e[r-1].x,c=e[r-1].y,h=Po.sub(e[0],e[1]);h.normalize(),e[0].x+=t*h.x,e[0].y+=t*h.y,h.assignSub(e[r-1],e[r-2]),h.normalize(),e[r-1].x+=t*h.x,e[r-1].y+=t*h.y,n[0]-=t,n[r-1]+=t;const p=[];p.push(new Po(a,l));const m=1e-6,v=.5*t;for(let w=1;w=0;L--){const k=v+n[L+1]-n[w];if(k<0)break;const B=n[L+1]-n[L],$=n[w]-n[L]4096&&(h=4096),h<0&&(h=0),p>4096&&(p=4096),p<0&&(p=0);for(let m=1;m4096&&(v=4096),v<0&&(v=0),w>4096&&(w=4096),w<0&&(w=0),S>4096&&(S=4096),S<0&&(S=0),I>4096&&(I=4096),I<0&&(I=0);const R=(v-h)*(I-p)-(S-h)*(w-p);l+=R*(h+v+S),u+=R*(p+w+I),c+=R}l/=3*c,u/=3*c,isNaN(l)||isNaN(u)||e.push(new spe(l,u))}};QHt._bidiEngine=new NGt;var nP;(function(i){i[i.INITIALIZED=0]="INITIALIZED",i[i.NO_DATA=1]="NO_DATA",i[i.READY=2]="READY",i[i.MODIFIED=3]="MODIFIED",i[i.INVALID=4]="INVALID"})(nP||(nP={}));let lon=class{constructor(e,t,r,n,s,o){if(this._pbfTiles={},this._tileClippers={},this._client=r,this._tile=t,this._sourceDataMaxLOD=n,o){this._styleLayerUIDs=new Set;for(const h of o)this._styleLayerUIDs.add(h)}this._styleRepository=s,this._layers=this._styleRepository?.layers??[];const[a,l,u]=t.tileKey.split("/").map(parseFloat);this._level=a;const c=tUt(this._level);for(const h of Object.keys(e)){const p=e[h];if(this._pbfTiles[h]=new g3(new Uint8Array(p.protobuff),new DataView(p.protobuff)),p.refKey){const[m]=p.refKey.split("/").map(parseFloat),v=a-m;if(v>0){const w=(1<{o.has(c)||(s.push({name:c,repeat:h}),o.add(c))},l={};for(const c of n)c.getResources(c.tileClipper,a,l);if(this._tile.status===nP.INVALID)return[];const u=this._fetchResources(s,l,e);return Promise.all([...u,t]).then(()=>this._processFeatures(r.returnedBuckets))}_initialize(e){return{signal:e?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,zoom:r,layers:n,sourceNameToTileClipper:s,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:a,returnedBuckets:l,layerIdToBucket:u,referencerUIDToReferencedId:c}=e,h=this._sourceDataMaxLOD;for(let p=n.length-1;p>=0;p--){const m=n[p];if(r=m.maxzoom)continue}else if(m.maxzoom&&r>=m.maxzoom)continue;if(m.type===bl.BACKGROUND||!this._canParseStyleLayer(m.uid)||!t[m.source]||!s[m.source])continue;const v=t[m.source],w=s[m.source],S=m.sourceLayer,I=v[S];if(I){let R=a[m.source];if(R||(R=a[m.source]=new Set),R.add(m.sourceLayer),m.refLayerId)c.set(m.uid,m.refLayerId);else{const L=this._createBucket(m);if(L){L.layerUIDs=[m.uid],L.layerExtent=I.extent,L.tileClipper=w;let k=o[m.source];k||(k=o[m.source]={});let B=k[S];B||(B=k[S]=[]),B.push(L),l.push(L),u[m.id]=L}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:r}=e;r.forEach((n,s)=>{t[n]&&t[n].layerUIDs.push(s)})}_filterFeatures(e){const{signal:t,sourceNameToTileData:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:s}=e,o=10*this._level,a=10*(this._level+1),l=[],u=[];for(const c of Object.keys(s))s[c].forEach(h=>{l.push(h),u.push(c)});for(let c=0;c=a)continue;const B=L._maxzoom;if(B&&B<=o)continue}for(const k of v)k.pushFeature(R)}}}_fetchResources(e,t,r){const n=[],s=this._tile.getWorkerTileHandler();let o,a;e.length>0&&(o=s.fetchSprites(e,this._client,r),n.push(o));for(const l in t){const u=t[l];u.size>0&&(a=s.fetchGlyphs(this._tile.tileKey,l,u,this._client,r),n.push(a))}return n}_processFeatures(e){const t=e.filter(r=>r.hasFeatures()||this._canParseStyleLayer(r.layer.uid));for(const r of t)r.processFeatures(r.tileClipper);return t}_parseTileData(e){const t={};for(const r of Object.keys(e)){const n=e[r],s={};for(;n.next();)switch(n.tag()){case 3:{const o=n.getMessage(),a=new BBe(o);o.release(),s[a.name]=a;break}default:n.skip()}t[r]=s}return t}_createBucket(e){switch(e.type){case bl.BACKGROUND:return null;case bl.FILL:return this._createFillBucket(e);case bl.LINE:return this._createLineBucket(e);case bl.CIRCLE:return this._createCircleBucket(e);case bl.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new csn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new osn(e.fillMaterial.getStride()),new qj,new asn(e.outlineMaterial.getStride()),new qj)}_createLineBucket(e){return new dsn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new ssn(e.lineMaterial.getStride()),new qj)}_createCircleBucket(e){return new usn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new lsn(e.circleMaterial.getStride()),new qj)}_createSymbolBucket(e){const t=this._tile;return new QHt(t.tileKey,e,this._level,new Oyt(e.iconMaterial.getStride()),new qj,new Oyt(e.textMaterial.getStride()),new qj,t.placementEngine,t.getWorkerTileHandler())}},uon=class{constructor(e,t,r,n){this.status=nP.INITIALIZED,this.placementEngine=new nsn,this.tileKey=e,this.refKeys=t,this._workerTileHandler=r,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=nP.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const r=t?.signal;if(r!=null){const c=()=>{r.removeEventListener("abort",c),this.status=nP.INVALID};r.addEventListener("abort",c)}let n;const s={bucketsWithData:[],emptyBuckets:null};try{n=await this._parse(e,t)}catch(c){if(mo(c))throw c;return{result:s,transferList:[]}}this.status=nP.READY;const o=s.bucketsWithData,a=[];for(const c of n)if(c.hasFeatures()){const h=c.serialize();o.push(h)}else a.push(c.layer.uid);const l=[...o];let u=null;return a.length>0&&(u=Uint32Array.from(a),l.push(u.buffer)),s.emptyBuckets=u,{result:s,transferList:l}}setObsolete(){this.status=nP.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const r=e.sourceName2DataAndRefKey;return Object.keys(r).length===0?[]:(this.status=nP.MODIFIED,new lon(r,this,t.client,e.sourceDataMaxLOD,this._styleRepository,e.styleLayerUIDs).parse(t))}},Ybe=class rte{constructor(e){if(this._style=e,this.backgroundBucketIds=[],this._uidToLayer=new Map,this._layerByName={},this._runningId=0,e.layers||(e.layers=[]),this.version=parseFloat(e.version),this.layers=e.layers.map((t,r,n)=>this._create(t,r,n)).filter(t=>!!t),this.layers)for(let t=0;t=this.layers.length?null:this.layers[e].id}getStyleLayerByUID(e){return this._uidToLayer.get(e)??null}getStyleLayerIndex(e){const t=this._layerByName[e];return t?this.layers.indexOf(t):-1}setStyleLayer(e,t){if(!e?.id)return;const r=this._style;t!=null&&t>=this.layers.length&&(t=this.layers.length-1);let n,s=!0;const o=this._layerByName[e.id];if(o){const a=this.layers.indexOf(o);t||(t=a),t===a?(s=!1,n=rte._recreateLayer(e,o),this.layers[t]=n,r.layers[t]=e):(this.layers.splice(a,1),r.layers.splice(a,1),n=this._create(e,t,this.layers),this.layers.splice(t,0,n),r.layers.splice(t,0,e))}else n=this._create(e,t,this.layers),!t||t>=this.layers.length?(this.layers.push(n),r.layers.push(e)):(this.layers.splice(t,0,n),r.layers.splice(t,0,e));this._layerByName[e.id]=n,this._uidToLayer.set(n.uid,n),s&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(e){const t=this._layerByName[e];return t?{type:t.typeName,id:t.id,source:t.source,"source-layer":t.sourceLayer,minzoom:t.minzoom,maxzoom:t.maxzoom,filter:t.filter,layout:t.layout,paint:t.paint}:null}deleteStyleLayer(e){const t=this._layerByName[e];if(t){delete this._layerByName[e],this._uidToLayer.delete(t.uid);const r=this.layers.indexOf(t);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(e){return this._layerByName[e]}getLayoutProperties(e){const t=this._layerByName[e];return t?t.layout:null}getPaintProperties(e){const t=this._layerByName[e];return t?t.paint:null}setPaintProperties(e,t){const r=this._layerByName[e];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:t},s=rte._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].paint=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setLayoutProperties(e,t){const r=this._layerByName[e];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:t,paint:r.paint},s=rte._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].layout=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setStyleLayerVisibility(e,t){const r=this._layerByName[e];if(!r)return;const n=r.layout||{};n.visibility=t;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:n,paint:r.paint},o=rte._recreateLayer(s,r),a=this.layers.indexOf(r);this.layers[a]=o,this._style.layers[a].layout=n,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(e){const t=this._layerByName[e];return t?t.layout?.visibility??"visible":"none"}_recomputeZValues(){const e=this.layers,t=1/(e.length+1);for(let r=0;rs.keyo.key?1:0);const n=e.length;for(let s=0;s{for(const a in o){const l=o[a];s[a]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,r,n,s){const o=[];let a=this._glyphInfo[t];return a?r.forEach(l=>{a[l]||o.push(l)}):(a=this._glyphInfo[t]=[],r.forEach(l=>o.push(l))),o.length===0?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:t,codePoints:o},s).then(l=>{for(let u=0;uPromise.resolve().then(()=>VBn).then(e=>e.l).then(({default:e})=>{const t=e({locateFile:fon,onRuntimeInitialized:()=>i(t)})})).catch(i=>{throw i})}function fon(i){return Fl(`esri/libs/lyr3d/${i}`)}let ape,kA;async function mon(i){if(await eWt(),i.inputs.length<1)return{result:{status:Cre.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const e={ptrs:[],sizes:[]};for(const o of i.inputs){const a=kA._malloc(o.byteLength);new Uint8Array(kA.HEAPU8.buffer,a,o.byteLength).set(new Uint8Array(o)),e.ptrs.push(a),e.sizes.push(o.byteLength)}const t=kA.process(i.jobDescJson,e,i.isMissingResourceCase),r=t.status===Cre.Succeeded&&t.data,n=t.status===Cre.MissingInputs&&t.missingInputUrls.length>0;if(r){const o=t.data.slice();t.data=o}else n&&(t.jobDescJson=t.jobDescJson.slice(0),t.originalInputs=i.inputs);for(let o=0;o{kA=i,kA.initialize_lyr3d_worker_wasm(),ape=null})),ape)}const yon=Object.freeze(Object.defineProperty({__proto__:null,destroyWasm:gon,initialize:eWt,process:mon},Symbol.toStringTag,{value:"Module"}));async function von(i,e,t,r){if(!e)throw new qe("post:missing-guid","guid for version is missing");const n=gu(i),s=t.toJSON(),o=_p(n.query,{query:Ig({...s,f:"json"}),...r,method:"post"});e.startsWith("{")&&(e=e.slice(1,-1));const a=`${n.path}/versions/${e}/deleteForwardEdits`,{data:l}=await zi(a,o);return l.success}const _on=Object.freeze(Object.defineProperty({__proto__:null,deleteForwardEdits:von},Symbol.toStringTag,{value:"Module"}));var ZBe;let nte=ZBe=class extends Ci{static from(i){return Cu(ZBe,i)}constructor(i){super(i),this.sessionId=void 0,this.moment=null}};x([D({type:String,json:{write:!0}})],nte.prototype,"sessionId",void 0),x([D({type:Date,json:{type:Number,write:{writer:(i,e)=>{e.moment=i?i.getTime():null}}}})],nte.prototype,"moment",void 0),nte=ZBe=x([Qe("esri.rest.versionManagement.gdbVersion.support.PostParameters")],nte);const bon=nte,won=Object.freeze(Object.defineProperty({__proto__:null,default:bon},Symbol.toStringTag,{value:"Module"}));function tWt(i){return i?.applyEdits!=null}function iWt(i){return typeof i=="object"&&i!=null&&"objectId"in i&&!!i.objectId}function rWt(i){return i.every(iWt)}function nWt(i){return typeof i=="object"&&i!=null&&"globalId"in i&&!!i.globalId}function sWt(i){return i.every(nWt)}async function xon(i,e,t,r={}){let n;const s="gdbVersion"in i?i.gdbVersion:null,o=r.gdbVersion??s;if(ysr(i)&&i.url)n=gsr(i.url,i.layerId,o,r.returnServiceEditsOption==="original-and-current-features");else{n=ac(),n.promise.then(l=>{(l.addedFeatures.length||l.updatedFeatures.length||l.deletedFeatures.length||l.addedAttachments.length||l.updatedAttachments.length||l.deletedAttachments.length)&&i.emit("edits",l)});const a={result:n.promise};i.emit("apply-edits",a)}try{const{results:a,edits:l}=await Son(i,e,t,r),u=h=>h.filter(p=>!p.error).map(li),c={edits:l,addedFeatures:u(a.addFeatureResults),updatedFeatures:u(a.updateFeatureResults),deletedFeatures:u(a.deleteFeatureResults),addedAttachments:u(a.addAttachmentResults),updatedAttachments:u(a.updateAttachmentResults),deletedAttachments:u(a.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:a.editMoment?new Date(a.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return a.editedFeatureResults?.length&&(c.editedFeatures=a.editedFeatureResults),n.resolve(c),a}catch(a){throw n.reject(a),a}}async function Son(i,e,t,r){if(await i.load(),!tWt(e))throw new qe(`${i.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:i});if(!GEt(i))throw new qe(`${i.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:i});const{edits:n,options:s}=await Ton(i,t,r);return n.addFeatures?.length||n.updateFeatures?.length||n.deleteFeatures?.length||n.addAttachments?.length||n.updateAttachments?.length||n.deleteAttachments?.length?{edits:n,results:await e.applyEdits(n,s)}:{edits:n,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function Ton(i,e,t){const r=tT(i),n=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),s=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments),o=i.infoFor3D!=null;if(cWt(e,r,t,!!n,!!s,`${i.type}-layer`),!r.data.isVersioned&&t?.gdbVersion)throw new qe(`${i.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&t?.rollbackOnFailureEnabled)throw new qe(`${i.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const a={...t};if(a.rollbackOnFailureEnabled!=null||r.editing.supportsRollbackOnFailure||(a.rollbackOnFailureEnabled=!0),a.rollbackOnFailureEnabled||a.returnServiceEditsOption!=="original-and-current-features"||(a.rollbackOnFailureEnabled===!1&&di.getLogger("esri.layers.graphics.editingSupport").warn(`${i.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),a.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&a.returnServiceEditsInSourceSR)throw new qe(`${i.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(a.returnServiceEditsInSourceSR&&a.returnServiceEditsOption!=="original-and-current-features")throw new qe(`${i.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const l=uWt(e,r,`${i.type}-layer`),u=t?.globalIdUsed||o,c=i.fields.filter(h=>h.type==="big-integer"||h.type==="oid"&&(h.length||0)>=8);if(u){const{globalIdField:h}=i;if(h==null)throw new qe(`${i.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");l.addFeatures.forEach(p=>Aon(p,h))}return l.addFeatures.forEach(h=>Con(h,i,u,c)),l.updateFeatures.forEach(h=>Ion(h,i,u,c)),l.deleteFeatures.forEach(h=>Eon(h,i,u,c)),l.addAttachments.forEach(h=>Qyt(h,i)),l.updateAttachments.forEach(h=>Qyt(h,i)),o&&await Mon(l,i),{edits:await aWt(l),options:a}}function pKe(i,e,t,r){if(t){if("attributes"in i&&!i.attributes[e.globalIdField])throw new qe(`${e.type}-layer:invalid-parameter`,`Feature should have '${e.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in i)&&!i.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in i)for(const n of r){const s=i.attributes[n.name];if(s!==void 0&&!sQi(n,s))throw new qe(`${e.type}-layer:invalid-parameter`,`Big-integer field '${n.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:i})}if("geometry"in i&&i.geometry!=null){if(i.geometry.hasZ&&e.capabilities?.data.supportsZ===!1)throw new qe(`${e.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(i.geometry.hasM&&e.capabilities?.data.supportsM===!1)throw new qe(`${e.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function oWt(i,e){if("geometry"in i&&i.geometry?.type==="mesh"&&e.infoFor3D!=null&&e.spatialReference!=null){const{geometry:t}=i,{spatialReference:r,vertexSpace:n}=t,s=e.spatialReference,o=n.type==="local",a=iae(s),l=Ya(s,r),u=l||fE(s)&&(fE(r)||Nb(r));if(!(o&&a&&u||!o&&!a&&l))throw new qe(`${e.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${n.type} vertex space and a spatial reference wkid:${r.wkid} to a layer with a spatial reference wkid:${s.wkid} is not supported.`)}}function Con(i,e,t,r){pKe(i,e,t,r),oWt(i,e)}function Eon(i,e,t,r){pKe(i,e,t,r)}function Ion(i,e,t,r){pKe(i,e,t,r),oWt(i,e);const n=tT(e);if("geometry"in i&&i.geometry!=null&&!n?.editing.supportsGeometryUpdate)throw new qe(`${e.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function Qyt(i,e){const{feature:t,attachment:r}=i;if(!t||"attributes"in t&&!t.attributes[e.globalIdField])throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in t)&&!t.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new qe(`${e.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!e.capabilities?.editing.supportsUploadWithItemId&&r.uploadId)throw new qe(`${e.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=lR(r.data);if(n&&!n.isBase64)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function Aon(i,e){const{attributes:t}=i;t[e]==null&&(t[e]=NVe())}async function aWt(i){const e=i.addFeatures??[],t=i.updateFeatures??[],r=e.concat(t).map(a=>a.geometry),n=await cy(r),s=e.length,o=t.length;return n.slice(0,s).forEach((a,l)=>e[l].geometry=a),n.slice(s,s+o).forEach((a,l)=>t[l].geometry=a),i}function lWt(i){return{addFeatures:Array.from(i?.addFeatures??[]),updateFeatures:Array.from(i?.updateFeatures??[]),deleteFeatures:i&&dr.isCollection(i.deleteFeatures)?i.deleteFeatures.toArray():i.deleteFeatures||[],addAttachments:i.addAttachments||[],updateAttachments:i.updateAttachments||[],deleteAttachments:i.deleteAttachments||[]}}function uWt(i,e,t){const r=lWt(i);if(r.addFeatures?.length&&!e.operations.supportsAdd)throw new qe(`${t}:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures?.length&&!e.operations.supportsUpdate)throw new qe(`${t}:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures?.length&&!e.operations.supportsDelete)throw new qe(`${t}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(QBe),r.updateFeatures=r.updateFeatures.map(QBe),r.addAssetFeatures=[],r}function cWt(i,e,t,r,n,s){if(!i||!r&&!n)throw new qe(`${s}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!e.editing.supportsGlobalId&&t?.globalIdUsed)throw new qe(`${s}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!e.editing.supportsGlobalId&&n)throw new qe(`${s}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!t?.globalIdUsed&&n)throw new qe(`${s}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function QBe(i){const e=new Us;return i.attributes||(i.attributes={}),e.geometry=i.geometry,e.attributes=i.attributes,e}async function Mon(i,e){if(e.infoFor3D==null)return;const{infoFor3D:t}=e,r=yR("model/gltf-binary",t.supportedFormats)??rk("glb",t.supportedFormats);if(!(r&&t.editFormats.includes(r)))throw new qe(`${e.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");i.addAssetFeatures??=[];const{addAssetFeatures:n}=i;for(const s of i.addFeatures??[])e0t(s)&&n.push(s);for(const s of i.updateFeatures??[])e0t(s)&&n.push(s)}function e0t(i){return i?.geometry?.type==="mesh"}function Oon(i,e,t,r){if(!tWt(e))throw new qe(`${i.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:i});if(!e.uploadAssets)throw new qe(`${i.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:i});return e.uploadAssets(t,r)}const UCe=Object.freeze(Object.defineProperty({__proto__:null,applyEdits:xon,checkEditingCapabilities:cWt,isFeatureIdentifierArrayWithGlobalId:sWt,isFeatureIdentifierArrayWithObjectId:rWt,isFeatureIdentifierWithGlobalId:nWt,isFeatureIdentifierWithObjectId:iWt,normalizeCollections:lWt,normalizeEdits:uWt,normalizeGeometries:aWt,shallowCloneFeature:QBe,uploadAssets:Oon},Symbol.toStringTag,{value:"Module"})),Xu={convertToGEGeometry:Pon,exportPoint:Ron,exportPolygon:Don,exportPolyline:Fon,exportMultipoint:kon,exportExtent:Lon};function Pon(i,e){if(e==null)return null;let t="cache"in e?e.cache._geVersion:void 0;return t==null&&(t=i.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=t)),t}function Ron(i,e,t){const r=i.hasZ(e),n=i.hasM(e),s=new $i({x:i.getPointX(e),y:i.getPointY(e),spatialReference:t});return r&&(s.z=i.getPointZ(e)),n&&(s.m=i.getPointM(e)),s.cache._geVersion=e,s}function Don(i,e,t){const r=new $s({rings:i.exportPaths(e),hasZ:i.hasZ(e),hasM:i.hasM(e),spatialReference:t});return r.cache._geVersion=e,r}function Fon(i,e,t){const r=new lo({paths:i.exportPaths(e),hasZ:i.hasZ(e),hasM:i.hasM(e),spatialReference:t});return r.cache._geVersion=e,r}function kon(i,e,t){const r=new Oh({hasZ:i.hasZ(e),hasM:i.hasM(e),points:i.exportPoints(e),spatialReference:t});return r.cache._geVersion=e,r}function Lon(i,e,t){const r=i.hasZ(e),n=i.hasM(e),s=new hr({xmin:i.getXMin(e),ymin:i.getYMin(e),xmax:i.getXMax(e),ymax:i.getYMax(e),spatialReference:t});if(r){const o=i.getZExtent(e);s.zmin=o.vmin,s.zmax=o.vmax}if(n){const o=i.getMExtent(e);s.mmin=o.vmin,s.mmax=o.vmax}return s.cache._geVersion=e,s}const Non=Object.freeze(Object.defineProperty({__proto__:null,hydratedAdapter:Xu},Symbol.toStringTag,{value:"Module"}));function fKe(i,e){return{...hWt(i,e),readResourcePaths:[]}}function coe(i,e,t){const r=Yo(i.itemUrl);return{...hWt(i,e),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,resources:t?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function hWt(i,e){return{origin:e,url:Yo(i.itemUrl),portal:i.portal||Bu.getDefault(),portalItem:i}}async function $on(i,e){const t=i.instance.portalItem;if(t?.id)return await t.load(e),Bon(i),i.validateItem&&i.validateItem(t),jon(i,e)}function Bon(i){const e=i.instance.portalItem;if(!e?.type||!i.supportedTypes.includes(e.type))throw new qe("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:e?.type,expectedType:i.supportedTypes.join(", ")})}async function jon(i,e){const t=i.instance,r=t.portalItem;if(!r)return;const{url:n,title:s}=r,o=fKe(r,"portal-item");if(t.type==="group")return Gon(t,o,i);n&&t.type!=="media"&&t.read({url:n},o);const a=new ITe,l=await dWt(i,a,e);return l&&t.read(l,o),t.resourceReferences={portalItem:r,paths:o.readResourcePaths??[]},t.type!=="subtype-group"&&t.read({title:s},o),Oae(t,o)}async function Gon(i,e,t){const r=i.portalItem;if(!i.sourceIsPortalItem)return;const{title:n,type:s}=r;if(s==="Group Layer"){if(!Q8(r,"Map"))throw new qe("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return Uon(i)}return i.read({title:n},e),zon(i,t)}async function Uon(i){const e=i.portalItem,t=await e.fetchData("json");if(!t)return;const r=fKe(e,"web-map");i.read(t,r),await GYe(i,t,{context:r}),i.resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}async function zon(i,e){let t;const{portalItem:r}=i;if(!r)return;const n=r.type,s=e.layerModuleTypeMap;switch(n){case"Feature Service":case"Feature Collection":t=s.FeatureLayer;break;case"Stream Service":t=s.StreamLayer;break;case"Scene Service":t=s.SceneLayer;break;default:throw new qe("portal:unsupported-item-type-as-group",`The item type '${n}' is not supported as a 'IGroupLayer'`)}const o=new ITe;let[a,l]=await Promise.all([t(),dWt(e,o)]),u=()=>a;if(n==="Feature Service"){const c=TB(l)?.customParameters;l=r.url?await d8t(l,r.url,o):{};const h=$Ye(l),p=f8t(l),m=m8t(l),v=[];if(h.length||p?.length){h.length&&v.push("SubtypeGroupLayer"),p?.length&&v.push("OrientedImageryLayer"),m?.length&&v.push("CatalogLayer");const S=[];for(const L of v){const k=s[L];S.push(k())}const I=await Promise.all(S),R=new Map;v.forEach((L,k)=>{R.set(L,I[k])}),u=L=>L.layerType?R.get(L.layerType)??a:a}const w=await Xon(r.url,{customParameters:c,loadContext:o});return await e7e(i,u,l,w)}return n==="Scene Service"&&r.url&&(l=await g8t(r,l,o)),ule(l)>0?await e7e(i,u,l):await Von(i,u)}async function Von(i,e){const{portalItem:t}=i;if(!t?.url)return;const r=await IS(t.url);r&&e7e(i,e,{layers:r.layers?.map(d9),tables:r.tables?.map(d9)})}async function e7e(i,e,t,r){let n=t.layers||[];const s=t.tables||[];if(i.portalItem?.type==="Feature Collection"?(n.forEach((o,a)=>{o.id=a,o?.layerDefinition?.type==="Table"&&s.push(o)}),n=n.filter(o=>o?.layerDefinition?.type!=="Table")):(n.reverse(),s.reverse()),n.forEach(o=>{const a=r?.(o);if(a||!r){const l=t0t(i,e(o),t,o,a);i.add(l)}}),s.length){const o=await xv.FeatureLayer();s.forEach(a=>{const l=r?.(a);if(l||!r){const u=t0t(i,o,t,a,l);i.tables.add(u)}})}}function t0t(i,e,t,r,n){const s=i.portalItem,o={portalItem:s.clone(),layerId:r.id};r.url!=null&&(o.url=r.url);const a=new e(o);if("sourceJSON"in a&&(a.sourceJSON=n),a.type!=="subtype-group"&&a.type!=="catalog"&&(a.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const l={origin:"portal-item",portal:s.portal||Bu.getDefault()};a.read(r,l);const u=t.showLegend;u!=null&&a.read({showLegend:u},l)}return a}async function dWt(i,e,t){if(i.supportsData===!1)return;const r=i.instance,n=r.portalItem;if(!n)return;let s=null;try{s=await n.fetchData("json",t)}catch{}if(qon(r)){let o=null;const a=await Hon(n,s,e);if((s?.layers||s?.tables)&&a>0){if(r.layerId==null){const l=$Ye(s);r.layerId=r.type==="subtype-group"?l?.[0]:p8t(s)}o=Won(s,r),o&&s.showLegend!=null&&(o.showLegend=s.showLegend)}return a>1&&"sublayerTitleMode"in r&&r.sublayerTitleMode!=="service-name"&&(r.sublayerTitleMode="item-title-and-service-name"),o}return s}async function Hon(i,e,t){if(e?.layers&&e?.tables)return ule(e);const r=r_(i.url);if(!r)return 1;const n=await t.fetchServiceMetadata(r.url.path,{customParameters:TB(e)?.customParameters}).catch(()=>null);return(e?.layers?.length??n?.layers?.length??0)+(e?.tables?.length??n?.tables?.length??0)}function Won(i,e){const{layerId:t}=e,r=i.layers?.find(n=>n.id===t)||i.tables?.find(n=>n.id===t);return r&&Yon(r,e)?r:null}function qon(i){return i.type!=="stream"&&"layerId"in i}function Yon(i,e){return!(e.type==="feature"&&"layerType"in i&&i.layerType==="SubtypeGroupLayer"||e.type==="subtype-group"&&!("layerType"in i))}async function Xon(i,e){const{layersJSON:t}=await bXe(i,e);if(!t)return null;const r=[...t.layers,...t.tables];return n=>r.find(s=>s.id===n.id)}const Jon=Object.freeze(Object.defineProperty({__proto__:null,load:$on},Symbol.toStringTag,{value:"Module"}));function pWt(i){return i&&"getAtOrigin"in i&&"originOf"in i}function hoe(i){i?.writtenProperties&&i.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{pWt(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}function t7e(i){if(Ho.apiKey&&oze(i.portal.url))throw new qe("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${i.portal.url} when using an api key`)}async function Kon(i){const e=[];for(const t of i.allLayers)if("beforeSave"in t&&typeof t.beforeSave=="function"){const r=t.beforeSave();r&&e.push(r)}await Promise.allSettled(e)}const Zon=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function fWt(i,e,t){let r=(i.messages??[]).filter(({type:n})=>n==="error").map(({name:n,message:s,details:o})=>new qe(n,s,o));if(i.blockedRelativeUrls&&(r=r.concat(i.blockedRelativeUrls.map(n=>new qe("url:unsupported",`Relative url '${n}' is not supported`)))),t){const{ignoreUnsupported:n,supplementalUnsupportedErrors:s=[],requiredPropertyChecksDisabled:o}=t;n&&(r=r.filter(({name:a})=>!(Zon.has(a)||s.includes(a)))),o&&(r=r.filter(a=>a.name!=="web-document-write:property-required"))}if(r.length>0)throw new qe(e.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}function Qon(i,e,t){const r=t(i);if(!r.isValid)throw new qe(`${e}:invalid-parameters`,r.errorMessage,{layer:i})}async function mWt(i){const{layer:e,errorNamePrefix:t,validateLayer:r}=i;await e.load(),Qon(e,t,r)}function i0t(i,e){return`Layer (title: ${i.title}, id: ${i.id}) of type '${i.declaredClass}' ${e}`}function gWt(i){const{item:e,errorNamePrefix:t,layer:r,validateItem:n}=i;if(t7e(e),ean(i),n){const s=n(e);if(!s.isValid)throw new qe(`${t}:invalid-parameters`,s.errorMessage,{layer:r})}}function ean(i){const{item:e,itemType:t,additionalItemType:r,errorNamePrefix:n,layer:s}=i,o=[t];if(r&&o.push(r),!o.includes(e.type)){const a=o.map(l=>`'${l}'`).join(", ");throw new qe(`${n}:portal-item-wrong-type`,`Portal item type should be one of: "${a}"`,{item:e,layer:s})}}function tan(i){const{layer:e,errorNamePrefix:t}=i,{portalItem:r}=e;if(!r)throw new qe(`${t}:portal-item-not-set`,i0t(e,"requires the portalItem property to be set"));if(!r.loaded)throw new qe(`${t}:portal-item-not-loaded`,i0t(e,"cannot be saved to a portal item that does not exist or is inaccessible"));gWt({...i,item:r})}function ian(i){const{newItem:e,itemType:t}=i;let r=yg.from(e);return r.id&&(r=r.clone(),r.id=null),r.type??=t,r.portal??=Bu.getDefault(),gWt({...i,item:r}),r}function yWt(i){return coe(i,"portal-item")}async function vWt(i,e,t){"beforeSave"in i&&typeof i.beforeSave=="function"&&await i.beforeSave();const r=i.write({},e);return await Promise.all(e.resources?.pendingOperations??[]),fWt(e,{errorName:"layer-write:unsupported"},t),r}function _Wt(i){EW(i,_b.JSAPI),i.typeKeywords&&(i.typeKeywords=i.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function ran(i,e,t){const r=i.portal;await r.signIn(),await r.user?.addItem({item:i,data:e,folder:t?.folder})}async function Lle(i,e){const{layer:t,createItemData:r,createJSONContext:n,saveResources:s,supplementalUnsupportedErrors:o}=i;await mWt(i),tan(i);const a=t.portalItem,l=n?n(a):yWt(a),u=await vWt(t,l,{...e,supplementalUnsupportedErrors:o}),c=await r({layer:t,layerJSON:u},a);return _Wt(a),await a.update({data:c}),hoe(l),await s?.(a,l),a}async function Nle(i,e){const{layer:t,createItemData:r,createJSONContext:n,setItemProperties:s,saveResources:o,supplementalUnsupportedErrors:a}=i;await mWt(i);const l=ian(i),u=n?n(l):yWt(l),c=await vWt(t,u,{...e,supplementalUnsupportedErrors:a}),h=await r({layer:t,layerJSON:c},l);return await s(t,l),_Wt(l),await ran(l,h,e),t.portalItem=l,hoe(u),await o?.(l,u),l}const bWt="Feature Service",wWt="feature-layer-utils",nan=`${wWt}-save`,san=`${wWt}-save-as`;function xWt(i){return{isValid:NYi(i)&&(i.type!=="feature"||!i.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function SWt(i){const e=[],t=[];for(const{layer:r,layerJSON:n}of i)r.isTable?t.push(n):e.push(n);return{layers:e,tables:t}}function TWt(i){return SWt([i])}async function oan(i,e){return/\/\d+\/?$/.test(i.url)?TWt(e[0]):aan(e,i)}async function aan(i,e){if(i.reverse(),!e)return SWt(i);const t=await lan(e,i);for(const r of i)CWt(r.layer,r.layerJSON,t);return han(t,i),t}async function lan(i,e){let t=await i.fetchData("json");if(uan(t))return t;t||={},can(t);const{layer:{url:r,customParameters:n,apiKey:s}}=e[0];return await dan(t,{url:r??"",customParameters:n,apiKey:s},e.map(o=>o.layer.layerId)),t}function uan(i){return!!(i&&Array.isArray(i.layers)&&Array.isArray(i.tables))}function can(i){i.layers||=[],i.tables||=[]}function han(i,e){const t=[],r=[];for(const{layer:n}of e){const{isTable:s,layerId:o}=n;s?r.push(o):t.push(o)}r0t(i.layers,t),r0t(i.tables,r)}function r0t(i,e){if(i.length<2)return;const t=[];for(const{id:r}of i)t.push(r);UB(t.sort(n0t),e.slice().sort(n0t))&&i.sort((r,n)=>{const s=e.indexOf(r.id),o=e.indexOf(n.id);return so?1:0})}function n0t(i,e){return ie?1:0}async function dan(i,e,t){const{url:r,customParameters:n,apiKey:s}=e,{serviceJSON:o,layersJSON:a}=await bXe(r,{customParameters:n,apiKey:s}),l=s0t(i.layers,o.layers,t),u=s0t(i.tables,o.tables,t);i.layers=l.itemResources,i.tables=u.itemResources;const c=[...l.added,...u.added],h=a?[...a.layers,...a.tables]:[];await pan(i,c,r,h)}function s0t(i,e,t){const r=P4e(i,e,(s,o)=>s.id===o.id);i=i.filter(s=>!r.removed.some(o=>o.id===s.id));const n=r.added;return n.forEach(({id:s})=>{i.push({id:s})}),{itemResources:i,added:n.filter(({id:s})=>!t.includes(s))}}async function pan(i,e,t,r){const n=await fan(e),s=e.map(({id:o,type:a})=>new(n.get(a))({url:t,layerId:o,sourceJSON:r.find(({id:l})=>l===o)}));await Promise.allSettled(s.map(o=>o.load())),s.forEach(o=>{const{layerId:a,loaded:l,defaultPopupTemplate:u}=o;if(!l||u==null)return;const c={id:a,popupInfo:u.toJSON()};o.operationalLayerType!=="ArcGISFeatureLayer"&&(c.layerType=o.operationalLayerType),CWt(o,c,i)})}async function fan(i){const e=[];i.forEach(({type:n})=>{const s=man(n),o=xv[s];e.push(o())});const t=await Promise.all(e),r=new Map;return i.forEach(({type:n},s)=>{r.set(n,t[s])}),r}function man(i){let e;switch(i){case"Feature Layer":case"Table":e="FeatureLayer";break;case"Oriented Imagery Layer":e="OrientedImageryLayer";break;case"Catalog Layer":e="CatalogLayer"}return e}function CWt(i,e,t){i.isTable?o0t(t.tables,e):o0t(t.layers,e)}function o0t(i,e){const t=i.findIndex(({id:r})=>r===e.id);t===-1?i.push(e):i[t]=e}async function gan(i,e){const{url:t,layerId:r,title:n,fullExtent:s,isTable:o}=i,a=r_(t);e.url=a?.serverType==="FeatureServer"?t:`${t}/${r}`,e.title||=n,e.extent=null,o||s==null||(e.extent=await J2e(s)),IW(e,_b.METADATA),IW(e,_b.MULTI_LAYER),EW(e,_b.SINGLE_LAYER),o&&EW(e,_b.TABLE)}async function yan(i,e){return Lle({layer:i,itemType:bWt,validateLayer:xWt,createItemData:(t,r)=>oan(r,[t]),errorNamePrefix:nan},e)}async function van(i,e,t){return Nle({layer:i,itemType:bWt,validateLayer:xWt,createItemData:(r,n)=>Promise.resolve(TWt(r)),errorNamePrefix:san,newItem:e,setItemProperties:gan},t)}const EWt=Object.freeze(Object.defineProperty({__proto__:null,save:yan,saveAs:van},Symbol.toStringTag,{value:"Module"}));let $le=class{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&UB(this.parts,e.parts,(t,r)=>t.equals(r))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(t.length===1)return t[0].toBlob(e);const r=await Promise.all(t.map(n=>n.toBlob(e)));return hn(e),new Blob(r)}},mKe=class{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await zi(this.partUrl,{responseType:"blob"});return hn(e),t}};function a0t(i){return _an(i?.source)}function l0t(i){return Array.isArray(i)?i.every(e=>e instanceof $le):!1}const u0t=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c0t=/\.(gltf|glb)/i;function _an(i){return i?Array.isArray(i)?i.some(h0t):h0t(i):!1}function h0t(i){if(i instanceof File){const{type:e,name:t}=i;return u0t.test(e)||c0t.test(t)}return u0t.test(i.assetMimeType)||c0t.test(i.assetName)}function IWt(i,e){if(!i)return!1;const{source:t}=i;return wan(t,e)}function ban(i,e){if(i===e)return!0;const{source:t}=i,{source:r}=e;if(t===r)return!0;if(l0t(t)&&l0t(r)){if(t.length!==r.length)return!1;const n=(a,l)=>a.assetNamel.assetName?1:0,s=[...t].sort(n),o=[...r].sort(n);for(let a=0;a0&&t.every(r=>d0t(r,e))}return d0t(i,e)}function d0t(i,e){return i instanceof $le&&i.isOnService(e)}function xan(i,e){return i instanceof File?wDt(i,e):yR(i.assetMimeType,e)??rk(i.assetName,e)}function San(i){return Array.isArray(i)?i:[i]}function Tan(i){return!!i.original}async function p0t(i,e,t){const{geometry:r}=e,n={...e.attributes};if(t!=null&&r?.type==="mesh"){const{transformFieldRoles:s}=t,{origin:o,spatialReference:a,transform:l,vertexSpace:u}=r,c=u.type==="local",h=i.spatialReference,p=h.isGeographic,m=Ya(h,a),v=m||fE(h)&&(fE(a)||Nb(a));if(!(c&&p&&v||!c&&!p&&m))return null;const w=Fie(o,a,h);if(w==null)return null;if(n[s.originX]=w.x,n[s.originY]=w.y,n[s.originZ]=w.z??0,l!=null){const{translation:S,scale:I,rotation:R}=l,L=c?1:Bve(a)/Bve(h);n[s.translationX]=S[0]*L,n[s.translationY]=S[2]*L,n[s.translationZ]=-S[1]*L,n[s.scaleX]=I[0],n[s.scaleY]=I[2],n[s.scaleZ]=I[1],n[s.rotationX]=R[0],n[s.rotationY]=R[2],n[s.rotationZ]=-R[1],n[s.rotationDeg]=R[3]}return{attributes:n}}return r==null?{attributes:n}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:n}}async function Can(i,e){const t=await Promise.all((e.addAttachments??[]).map(s=>f0t(i,s))),r=await Promise.all((e.updateAttachments??[]).map(s=>f0t(i,s))),n=e.deleteAttachments??[];return t.length||r.length||n.length?{adds:t,updates:r,deletes:[...n]}:null}async function f0t(i,e){const{feature:t,attachment:r}=e,{globalId:n,name:s,contentType:o,data:a,uploadId:l}=r,u={globalId:n};if(t&&("attributes"in t?u.parentGlobalId=t.attributes?.[i.globalIdField]:t.globalId&&(u.parentGlobalId=t.globalId)),l)u.uploadId=l;else if(a){const c=await rEt(a);c&&(u.contentType=c.mediaType,u.data=c.data),a instanceof File&&(u.name=a.name)}return s&&(u.name=s),o&&(u.contentType=o),u}function Ean(i,e,t){if(!e||e.length===0)return[];if(t&&sWt(e))return e.map(n=>n.globalId);if(rWt(e))return e.map(n=>n.objectId);const r=t?i.globalIdField:i.objectIdField;return r?e.map(n=>n.getAttribute(r)):[]}function Ian(i){const e=i?.assetMaps;if(e){for(const n of e.addResults)n.success||di.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`);for(const n of e.updateResults)n.success||di.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`)}const t=i?.attachments,r={addFeatureResults:i?.addResults?.map(sP)??[],updateFeatureResults:i?.updateResults?.map(sP)??[],deleteFeatureResults:i?.deleteResults?.map(sP)??[],addAttachmentResults:t?.addResults?t.addResults.map(sP):[],updateAttachmentResults:t?.updateResults?t.updateResults.map(sP):[],deleteAttachmentResults:t?.deleteResults?t.deleteResults.map(sP):[]};return i?.editMoment&&(r.editMoment=i.editMoment),r}function sP(i){const e=i.success===!0?null:i.error||{code:void 0,description:void 0};return{objectId:i.objectId,globalId:i.globalId,error:e?new qe("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function lpe(i,e){return new Us({attributes:i.attributes,geometry:Ro({...i.geometry,spatialReference:e})})}function Aan(i,e){return{adds:i?.adds?.map(t=>lpe(t,e))||[],updates:i?.updates?.map(t=>({original:lpe(t[0],e),current:lpe(t[1],e)}))||[],deletes:i?.deletes?.map(t=>lpe(t,e))||[],spatialReference:e}}function Man(i){const e=i.details.raw,t=+e.code,r=+e.extendedCode;return t===500&&(r===-2147217144||r===-2147467261)}const Oan=new Rs({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Pan=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),Ran=new Rs({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let jU=class extends ef{constructor(){super(...arguments),this.type="feature-layer",this.refresh=xd(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:r,infoFor3D:n,gdbVersion:s,spatialReference:o,fieldsIndex:a}=this.layer,l=yi("featurelayer-pbf")&&e?.query.supportsFormatPBF&&n==null,u=e?.operations?.supportsQueryAttachments??!1;return new LDt({url:t.path,pbfSupported:l,fieldsIndex:a,infoFor3D:n,dynamicDataSource:r,gdbVersion:s,sourceSpatialReference:o,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+n+"/addAttachment",o=this._getLayerRequestOptions(),a=this._getFormDataForAttachment(t,o.query);try{const l=await zi(s,{body:a});return sP(l.data.addAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(n,l)}}async updateAttachment(e,t,r){await this.load();const{layer:n}=this;await u8(n,"editing");const s=e.attributes[n.objectIdField],o=n.parsedUrl.path+"/"+s+"/updateAttachment",a=this._getLayerRequestOptions({query:{attachmentId:t}}),l=this._getFormDataForAttachment(r,a.query);try{const u=await zi(o,{body:l});return sP(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=r.infoFor3D,s=n!=null,o=s||(t?.globalIdUsed??!1),a=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,l=e.addFeatures?.map(B=>p0t(this.layer,B,n))??[],u=(await Promise.all(l)).filter(Ga),c=e.updateFeatures?.map(B=>p0t(this.layer,B,n))??[],h=(await Promise.all(c)).filter(Ga),p=Ean(this.layer,e.deleteFeatures,o);uOt(u,h,r.spatialReference);const m=await Can(this.layer,e),v=r.capabilities.editing.supportsAsyncApplyEdits&&s,w=t?.gdbVersion||r.gdbVersion,S={gdbVersion:w,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:o,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:v};await psr(this.layer.url,w,!0);const I=VOt(this.layer.url,w||null);if(await dsr(r.url,w,r.historicMoment))throw new qe("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:r.layerId,adds:u,updates:h,deletes:p,attachments:m,assetMaps:a}]),S.returnServiceEditsOption=Oan.toJSON(t?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(S.adds=u.length?JSON.stringify(u):null,S.updates=h.length?JSON.stringify(h):null,S.deletes=p.length?o?JSON.stringify(p):p.join(","):null,S.attachments=m&&JSON.stringify(m),S.assetMaps=a!=null?JSON.stringify(a):void 0);const R=this._getLayerRequestOptions({method:"post",query:S});I&&(R.authMode="immediate",R.query.returnEditMoment=!0,R.query.sessionId=GOt);const L=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;let k;try{k=v?await this._asyncApplyEdits(L+"/applyEdits",R):await zi(L+"/applyEdits",R)}catch(B){if(!Man(B))throw B;R.authMode="immediate",k=v?await this._asyncApplyEdits(L+"/applyEdits",R):await zi(L+"/applyEdits",R)}return!r.capabilities.operations?.supportsEditing&&r.effectiveCapabilities?.operations?.supportsEditing&&await no?.findCredential(r.url)?.refreshToken(),this._createEditsResult(k)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+n+"/deleteAttachments";try{return(await zi(s,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(sP)}catch(o){throw this._createAttachmentErrorResult(n,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const r=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:n,url:s}=this.layer,{data:o}=await zi(`${s}/${n}`,r),{id:a,extent:l,fullExtent:u,timeExtent:c}=o,h=l||u;return{id:a,fullExtent:h&&hr.fromJSON(h),timeExtent:c&&Eg.fromJSON({start:c[0],end:c[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&r.features.length&&r.features.forEach(n=>{const s=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:o})=>{if(o){const a=o.toLowerCase();a&&a in s&&o!==a&&(s[o]=s[a],delete s[a])}})}),r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!Fx(this.layer.url))return"unavailable";const e=Iu(this.layer.url,"status"),t=await zi(e,{query:{f:"json"}});return Ran.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await Promise.resolve().then(()=>S7n);return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await zi(e,t)).data.statusUrl;for(;;){const n=(await zi(r,{query:{f:"json"},responseType:"json"})).data;switch(n.status){case"Completed":return zi(n.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new qe("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new qe("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await jk(Dan)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const n={};yi("featurelayer-advanced-symbols")&&(n.returnAdvancedSymbols=!0),t?.cacheBust&&(n._ts=Date.now());const{data:s}=await zi(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:n,signal:t?.signal}));e=s}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!Pan.has(r))throw new qe("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!=="Table"&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const r=KA(e.geometryType).renderer;Qp("drawingInfo.renderer",r,e)}if(e.geometryType==="esriGeometryMultiPatch"&&e.infoFor3D&&(e.geometryType="mesh"),e.extent==null)try{const{data:r}=await zi(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(r){_a(r)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const r=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const n=new Array,s=new Map;for(const o of r){const{geometry:a}=o,{vertexSpace:l}=a;if(VS(l))n.push(a);else{const u=bUr(a);s.set(u,a),o.geometry=u,n.push(u)}}await this.uploadAssets(n);for(const[o,a]of s)a.addExternalSources(o.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,n=this.layer.parsedUrl;for(const s of e){const o=s.geometry,{metadata:a}=o,l=a.getExternalSourcesOnService(n),u=s.getAttribute(r);if(l.length===0){di.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:c}=l.find(Tan)??l[0];for(const h of c)h.parts.length===1?t.push({globalId:NVe(),parentGlobalId:u,assetName:h.assetName,assetHash:h.parts[0].partHash,flags:[]}):di.getLogger(this).error(`Skipping asset ${h.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,n=[];let s=null;if(Array.isArray(t))for(const a of t)n.push({id:a.id,editedFeatures:a.editedFeatures}),a.id===r&&(s={addResults:a.addResults??[],updateResults:a.updateResults??[],deleteResults:a.deleteResults??[],attachments:a.attachments,editMoment:a.editMoment});else s=t;const o=Ian(s);if(n.length>0){o.editedFeatureResults=[];for(const a of n){const{editedFeatures:l}=a,u=l?.spatialReference?new Xi(l.spatialReference):null;o.editedFeatureResults.push({layerId:a.id,editedFeatures:Aan(l,u)})}}return o}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,n=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new qe("feature-layer-source:attachment-failure",r,{code:n})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const n in t){const s=t[n];s!=null&&(r.set?r.set(n,s):r.append(n,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:n}=this.layer;return{...e,query:{gdbVersion:r,layer:n?JSON.stringify({source:n}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:n,parsedUrl:s}=t;if(n==null||r==null)return e;const o=Edr(n);if(o==null)return e;const a=Iu(s.path,`../${o.id}`),l=new Array,u=new Array;for(const S of e)S.geometry.metadata.getExternalSourcesOnService(s).length>0?u.push(S):l.push(S);const c=u.map(S=>S.getAttribute(r)).filter(Ga);if(c.length===0)return e;const{assetMapFieldRoles:{parentGlobalId:h,assetHash:p}}=n,m=new Kn;m.where=`${h} IN (${c.map(S=>`'${S}'`)})`,m.outFields=[p,h],m.returnGeometry=!1;const v=await t9(a,m),{features:w}=v;return w.length===0?e:[...l,...u.filter(S=>{const I=S.getAttribute(r);if(!I)return!0;const{metadata:R}=S.geometry,L=w.filter(B=>B.getAttribute(h)===I);if(L.length===0)return!0;const k=L.map(B=>B.getAttribute(p));return R.getExternalSourcesOnService(s).flatMap(({source:B})=>B.flatMap($=>$.parts.map(V=>V.partHash))).some(B=>k.every($=>B!==$))})]}};x([D()],jU.prototype,"type",void 0),x([D({constructOnly:!0})],jU.prototype,"layer",void 0),x([D({readOnly:!0})],jU.prototype,"queryTask",null),jU=x([Qe("esri.layers.graphics.sources.FeatureLayerSource")],jU);const Dan=1e3,AWt=jU,MWt=Object.freeze(Object.defineProperty({__proto__:null,default:AWt},Symbol.toStringTag,{value:"Module"}));let m0t=Fan();function Fan(){return new d3(50)}async function kan(i,e=null){if(!i.isPrimitive){const r=i.resource.href;if(!r)throw new qe("symbol:invalid-resource","The symbol does not have a valid resource");const n=m0t.get(r);if(n!==void 0)return n;const{fetch:s}=await Promise.resolve().then(()=>ZUn),o=await s(r,{disableTextures:!0}),a=Int(o.referenceBoundingBox,gr());return m0t.put(r,a),a}if(!i.resource?.primitive)throw new qe("symbol:invalid-resource","The symbol does not have a valid resource");const t=Dx(QQi(i.resource.primitive));if(e!=null)for(let r=0;r{a||(o=require("fs"),a=require("path"))},r=function(A,ue){return l(),A=a.normalize(A),o.readFileSync(A,ue?void 0:"utf8")},s=A=>{var ue=r(A,!0);return ue.buffer||(ue=new Uint8Array(ue)),ue},n=(A,ue,G)=>{l(),A=a.normalize(A),o.readFile(A,function(E,_){E?G(E):ue(_.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(A){if(!(A instanceof Fe))throw A}),process.on("unhandledRejection",function(A){throw A}),i.inspect=function(){return"[Emscripten Module object]"}):(c||h)&&(h?m=self.location.href:typeof document<"u"&&document.currentScript&&(m=document.currentScript.src),IK&&(m=IK),m=m.indexOf("blob:")!==0?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=A=>{var ue=new XMLHttpRequest;return ue.open("GET",A,!1),ue.send(null),ue.responseText},h&&(s=A=>{var ue=new XMLHttpRequest;return ue.open("GET",A,!1),ue.responseType="arraybuffer",ue.send(null),new Uint8Array(ue.response)}),n=(A,ue,G)=>{var E=new XMLHttpRequest;E.open("GET",A,!0),E.responseType="arraybuffer",E.onload=()=>{E.status==200||E.status==0&&E.response?ue(E.response):G()},E.onerror=G,E.send(null)}),i.print||console.log.bind(console);var w,S,I=i.printErr||console.warn.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(w=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&tt("no native wasm support detected");var R,L,k,B,$,V,Y=!1,K=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Q(A,ue,G){for(var E=ue+G,_=ue;A[_]&&!(_>=E);)++_;if(_-ue>16&&A.buffer&&K)return K.decode(A.subarray(ue,_));for(var g="";ue<_;){var b=A[ue++];if(128&b){var C=63&A[ue++];if((224&b)!=192){var O=63&A[ue++];if((b=(240&b)==224?(15&b)<<12|C<<6|O:(7&b)<<18|C<<12|O<<6|63&A[ue++])<65536)g+=String.fromCharCode(b);else{var F=b-65536;g+=String.fromCharCode(55296|F>>10,56320|1023&F)}}else g+=String.fromCharCode((31&b)<<6|C)}else g+=String.fromCharCode(b)}return g}function re(A,ue){return A?Q(k,A,ue):""}function ne(A){R=A,i.HEAP8=L=new Int8Array(A),i.HEAP16=new Int16Array(A),i.HEAP32=B=new Int32Array(A),i.HEAPU8=k=new Uint8Array(A),i.HEAPU16=new Uint16Array(A),i.HEAPU32=$=new Uint32Array(A),i.HEAPF32=new Float32Array(A),i.HEAPF64=new Float64Array(A)}i.INITIAL_MEMORY;var de=[],pe=[],H=[];function Z(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)be(i.preRun.shift());Ue(de)}function ae(){Ue(pe)}function fe(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Ie(i.postRun.shift());Ue(H)}function be(A){de.unshift(A)}function _e(A){pe.unshift(A)}function Ie(A){H.unshift(A)}var Te=0,Be=null;function Ve(A){Te++,i.monitorRunDependencies&&i.monitorRunDependencies(Te)}function $e(A){if(Te--,i.monitorRunDependencies&&i.monitorRunDependencies(Te),Te==0&&Be){var ue=Be;Be=null,ue()}}function tt(A){i.onAbort&&i.onAbort(A),I(A="Aborted("+A+")"),Y=!0,A+=". Build with -sASSERTIONS for more info.";var ue=new WebAssembly.RuntimeError(A);throw t(ue),ue}var yt,Ct="data:application/octet-stream;base64,";function ot(A){return A.startsWith(Ct)}function vt(A){return A.startsWith("file://")}function At(A){try{if(A==yt&&w)return new Uint8Array(w);if(s)return s(A);throw"both async and sync fetching of the wasm failed"}catch(ue){tt(ue)}}function Je(){if(!w&&(c||h)){if(typeof fetch=="function"&&!vt(yt))return fetch(yt,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+yt+"'";return A.arrayBuffer()}).catch(function(){return At(yt)});if(n)return new Promise(function(A,ue){n(yt,function(G){A(new Uint8Array(G))},ue)})}return Promise.resolve().then(function(){return At(yt)})}function it(){var A={a:Me};function ue(g,b){var C=g.exports;i.asm=C,ne((S=i.asm.g).buffer),V=i.asm.m,_e(i.asm.h),$e()}function G(g){ue(g.instance)}function E(g){return Je().then(function(b){return WebAssembly.instantiate(b,A)}).then(function(b){return b}).then(g,function(b){I("failed to asynchronously prepare wasm: "+b),tt(b)})}function _(){return w||typeof WebAssembly.instantiateStreaming!="function"||ot(yt)||vt(yt)||p||typeof fetch!="function"?E(G):fetch(yt,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,A).then(G,function(b){return I("wasm streaming compile failed: "+b),I("falling back to ArrayBuffer instantiation"),E(G)})})}if(Ve(),i.instantiateWasm)try{return i.instantiateWasm(A,ue)}catch(g){return I("Module.instantiateWasm callback failed with error: "+g),!1}return _().catch(t),{}}function Ue(A){for(;A.length>0;){var ue=A.shift();if(typeof ue!="function"){var G=ue.func;typeof G=="number"?ue.arg===void 0?st(G)():st(G)(ue.arg):G(ue.arg===void 0?null:ue.arg)}else ue(i)}}ot(yt="lerc-wasm.wasm")||(yt=v(yt));var ct=[];function st(A){var ue=ct[A];return ue||(A>=ct.length&&(ct.length=A+1),ct[A]=ue=V.get(A)),ue}function Ze(A,ue,G,E){tt("Assertion failed: "+re(A)+", at: "+[ue?re(ue):"unknown filename",G,E?re(E):"unknown function"])}function ye(A){return ht(A+24)+24}function Ke(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(ue){$[this.ptr+4>>2]=ue},this.get_type=function(){return $[this.ptr+4>>2]},this.set_destructor=function(ue){$[this.ptr+8>>2]=ue},this.get_destructor=function(){return $[this.ptr+8>>2]},this.set_refcount=function(ue){B[this.ptr>>2]=ue},this.set_caught=function(ue){ue=ue?1:0,L[this.ptr+12>>0]=ue},this.get_caught=function(){return L[this.ptr+12>>0]!=0},this.set_rethrown=function(ue){ue=ue?1:0,L[this.ptr+13>>0]=ue},this.get_rethrown=function(){return L[this.ptr+13>>0]!=0},this.init=function(ue,G){this.set_adjusted_ptr(0),this.set_type(ue),this.set_destructor(G),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var ue=B[this.ptr>>2];B[this.ptr>>2]=ue+1},this.release_ref=function(){var ue=B[this.ptr>>2];return B[this.ptr>>2]=ue-1,ue===1},this.set_adjusted_ptr=function(ue){$[this.ptr+16>>2]=ue},this.get_adjusted_ptr=function(){return $[this.ptr+16>>2]},this.get_exception_ptr=function(){if(_t(this.get_type()))return $[this.excPtr>>2];var ue=this.get_adjusted_ptr();return ue!==0?ue:this.excPtr}}function ke(A,ue,G){throw new Ke(A).init(ue,G),A}function me(){tt("")}function ie(A,ue,G){k.copyWithin(A,ue,ue+G)}function ge(){return 2147483648}function je(A){try{return S.grow(A-R.byteLength+65535>>>16),ne(S.buffer),1}catch{}}function rt(A){var ue=k.length;A>>>=0;var G=ge();if(A>G)return!1;let E=(b,C)=>b+(C-b%C)%C;for(var _=1;_<=4;_*=2){var g=ue*(1+.2/_);if(g=Math.min(g,A+100663296),je(Math.min(G,E(Math.max(A,g),65536))))return!0}return!1}var Me={a:Ze,c:ye,b:ke,d:me,f:ie,e:rt};it(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.h).apply(null,arguments)},i._lerc_getBlobInfo=function(){return(i._lerc_getBlobInfo=i.asm.i).apply(null,arguments)},i._lerc_getDataRanges=function(){return(i._lerc_getDataRanges=i.asm.j).apply(null,arguments)},i._lerc_decode=function(){return(i._lerc_decode=i.asm.k).apply(null,arguments)},i._lerc_decode_4D=function(){return(i._lerc_decode_4D=i.asm.l).apply(null,arguments)};var ht=i._malloc=function(){return(ht=i._malloc=i.asm.n).apply(null,arguments)};i._free=function(){return(i._free=i.asm.o).apply(null,arguments)};var Ht,_t=i.___cxa_is_pointer_type=function(){return(_t=i.___cxa_is_pointer_type=i.asm.p).apply(null,arguments)};function Fe(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function Yt(A){function ue(){Ht||(Ht=!0,i.calledRun=!0,Y||(ae(),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),fe()))}Te>0||(Z(),Te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),ue()},1)):ue()))}if(Be=function A(){Ht||Yt(),Ht||(Be=A)},i.run=Yt,i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Yt(),i.ready},g0t.exports=y0t;const Nan=Cg(OWt.exports),$an=Object.freeze(Object.defineProperty({__proto__:null,default:Nan},Symbol.toStringTag,{value:"Module"})),Ban=Object.freeze(Object.defineProperty({__proto__:null,l:$an},Symbol.toStringTag,{value:"Module"})),PWt="Image Service",jan="imagery-layer-save",Gan="imagery-layer-save-as",Uan="imagery-tile-layer-save",zan="imagery-tile-layer-save-as";function RWt(i){if(i.type==="imagery")return{isValid:!0};const{raster:e}=i,t=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:t?.datasetFormat==="RasterTileServer"&&(t.tileType==="Raster"||t.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function DWt(i){const e=i.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function Van(i,e){const{parsedUrl:t,title:r,fullExtent:n}=i;e.url=t.path,e.title||=r;try{e.extent=await J2e(n)}catch{e.extent=void 0}IW(e,_b.METADATA),i.type==="imagery-tile"&&EW(e,_b.TILED_IMAGERY)}async function Han(i,e){const t=i.type==="imagery"?jan:Uan;return Lle({layer:i,itemType:PWt,validateLayer:RWt,createItemData:DWt,errorNamePrefix:t},e)}async function Wan(i,e,t){const r=i.type==="imagery"?Gan:zan;return Nle({layer:i,itemType:PWt,validateLayer:RWt,createItemData:DWt,errorNamePrefix:r,newItem:e,setItemProperties:Van},t)}const FWt=Object.freeze(Object.defineProperty({__proto__:null,save:Han,saveAs:Wan},Symbol.toStringTag,{value:"Module"}));var GU;const LPe=new WeakMap;let qan=0,DI=GU=class extends Ci{constructor(i){super(i),this.wrap="repeat"}get url(){return this._get("url")||null}set url(i){this._set("url",i),i&&this._set("data",null)}get data(){return this._get("data")||null}set data(i){this._set("data",i),i&&this._set("url",null)}writeData(i,e,t,r){if(i instanceof HTMLImageElement){const n={type:"image-element",src:gE(i.src,r),crossOrigin:i.crossOrigin};e[t]=n}else if(i instanceof HTMLCanvasElement){const n=i.getContext("2d").getImageData(0,0,i.width,i.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[t]=s}else if(i instanceof HTMLVideoElement){const n={type:"video-element",src:gE(i.src,r),autoplay:i.autoplay,loop:i.loop,muted:i.muted,crossOrigin:i.crossOrigin,preload:i.preload};e[t]=n}else if(i instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(i)};e[t]=n}}readData(i){switch(i.type){case"image-element":{const e=new Image;return e.src=i.src,e.crossOrigin=i.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(i.imageData),t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}case"image-data":return this._decodeImageData(i.imageData);case"video-element":{const e=document.createElement("video");return e.src=i.src,e.crossOrigin=i.crossOrigin,e.autoplay=i.autoplay,e.loop=i.loop,e.muted=i.muted,e.preload=i.preload,e}default:return}}get transparent(){const i=this.data,e=this.url;if(i instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(i.getContext("2d").getImageData(0,0,i.width,i.height));if(i instanceof ImageData)return this._imageDataContainsTransparent(i);if(e){const t=e.substr(e.length-4,4).toLowerCase(),r=e.substr(0,15).toLocaleLowerCase();if(t===".png"||r==="data:image/png;")return!0}return!1}set transparent(i){this._overrideIfSome("transparent",i)}get contentHash(){const i=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(t="")=>`d:${t},t:${this.transparent},w:${i}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(LPe.has(this.data)||LPe.set(this.data,++qan),e(LPe.get(this.data))):e()}get memoryUsage(){let i=0;if(i+=this.url!=null?this.url.length:0,this.data!=null){const e=this.data;"data"in e?i+=e.data.byteLength:e instanceof HTMLImageElement?i+=e.naturalWidth*e.naturalHeight*3:e instanceof HTMLCanvasElement&&(i+=e.width*e.height*3)}return i}clone(){const i={url:this.url,data:this.data,wrap:this._cloneWrap()};return new GU(i)}cloneWithDeduplication(i){const e=i.get(this);if(e)return e;const t=this.clone();return i.set(this,t),t}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(i){let e="";for(let t=0;t=1),Ch(r.size===3||r.size===4);const{data:n,size:s,indices:o}=r;Ch(o.length%this._numIndexPerPrimitive==0),Ch(o.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let l=s*o[this._numIndexPerPrimitive*e[0]];oN.clear(),oN.push(l);const u=Do(n[l],n[l+1],n[l+2]),c=Ef(u);for(let m=0;m0&&++l;if(l<2)return;const u=new Array(8);for(let c=0;c<8;++c)u[c]=n[c]>0?new Uint32Array(n[c]):void 0;for(let c=0;c<8;++c)n[c]=0;for(let c=0;celn());const $Pe=gr(),b0t=gr();function iln(i,e){if(!i)return!1;const{size:t,data:r,indices:n}=i;Zo(e,0,0,0),Zo(X2,0,0,0);let s=0,o=0;for(let a=0;a1&&Gc(e,e,1/o),o>0}function nln(i,e,t){if(!i)return!1;Zo(t,0,0,0),Zo(X2,0,0,0);let r=0,n=0;const{size:s,data:o,indices:a}=i,l=a.length-1,u=l+(e?2:0);for(let c=0;c0?(hl(t,t,Gc(lm,lm,v)),r+=v):r===0&&(hl(X2,X2,lm),n++)}return r!==0?(Gc(t,t,1/r),!0):n!==0&&(Gc(t,X2,1/n),!0)}const lm=gr(),pP=gr(),upe=gr(),X2=gr();let sln=class{constructor(e){this.channel=e,this.id=vF()}};function w0t(i,e,t){for(let r=0;rr!==e);return t.length===0?null:t}let LWt=class NWt extends vKe{constructor(e,t,r=null,n=SP.Mesh,s=null,o=-1){super(),this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=s,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,l]of t)this._attributes.set(a,{...l,indices:zse(l.indices)}),a===tn.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new NWt(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,n)=>{r.exclusive=!1,t._attributes.set(n,r)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:Zan(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===SP.Mesh?this._computeAttachmentOriginTriangles(e):this.type===SP.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&c0(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.attributes.get(tn.POSITION);return iln(t,e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(tn.POSITION);return nln(t,cln(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){const t=this.attributes.get(tn.POSITION);return rln(t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(tn.POSITION);if(!e||e.indices.length===0)return null;const t=this.type===SP.Mesh?3:1;Ch(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=QTe(e.indices.length/t);return new Qan(r,t,e)}get transformation(){return this._transformation??ZA}set transformation(e){this._transformation=e&&e!==ZA?Vse(e):null}addHighlight(){const e=new sln(n7e.Highlight);return this.highlights=lln(this.highlights,e),e}removeHighlight(e){this.highlights=uln(this.highlights,e)}};function cln(i,e){return!(!("isClosed"in i)||!i.isClosed)&&e.indices.length>2}function hln(i,e,t,r){const n=(o=>!Array.isArray(o[0]))(e)?(o,a)=>e[3*o+a]:(o,a)=>e[o][a],s=r?pu(r)/WF(r):1;return TVt(i,(o,a)=>Zo(o,n(a,0)*s,n(a,1)*s,n(a,2)),t)}function dln(i,e,t){const r=hln(x0t,i,e,t)?x0t:[0,0,1];return Math.abs(r[2])>Math.cos(Rx(80))?ig.Z:Math.abs(r[1])>Math.abs(r[0])?ig.Y:ig.X}const x0t=SVt();function pln(i){const e=mln(i.rings,i.hasZ,Xbe.CCW_IS_HOLE,i.spatialReference),t=new Array;let r=0,n=0;for(const a of e.polygons){const l=a.count,u=a.index,c=PUr(e.position,3*u,3*l),h=a.holeIndices.map(m=>m-u),p=zse(ybe(c,h,3));t.push({position:c,faces:p}),r+=c.length,n+=p.length}const s=fln(t,r,n),o=Array.isArray(s.position)?w8e(s.position,3,{originalIndices:s.faces}):w8e(s.position.buffer,6,{originalIndices:s.faces});return s.position=OUr(new Float64Array(o.buffer)),s.faces=o.indices,s}function fln(i,e,t){if(i.length===1)return i[0];const r=dbe(e),n=new Array(t);let s=0,o=0,a=0;for(const l of i){for(let u=0;u=0;v--){const w=i[v],S=t===Xbe.CCW_IS_HOLE&&gln(w,e,r);if(S&&n!==1)s[l++]=w;else{let I=w.length;for(let L=0;L0&&(a[c++]={index:m,count:w.length}),m=S?cpe(w,w.length-1,-1,p,m,w.length,e):cpe(w,0,1,p,m,w.length,e);for(let L=0;L0&&(a[c++]={index:m,count:k.length}),m=cpe(k,0,1,p,m,k.length,e)}l=0,R.count>0&&(o[u++]=R)}}for(let v=0;v0&&(a[c++]={index:m,count:w.length}),m=cpe(w,0,1,p,m,w.length,e)}return o.length=u,a.length=c,{position:p,polygons:o,outlines:a}}function cpe(i,e,t,r,n,s,o){n*=3;for(let a=0;aEti),t),s=await Eln(r,t);hn(t);const o=n(new $i({x:0,y:0,z:0,spatialReference:i.spatialReference}),s.url,{resolveFile:Cln(s),signal:t?.signal,expectedType:s.type});o.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:l}=await o;i.vertexAttributes=a,i.components=l}function Cln(i){const e=eae(i.url);return t=>{const r=s2e(t,e,e),n=r?r.replace(/^ *\.\//,""):null;return(n?i.files.get(n):null)??t}}async function Eln(i,e){if(Array.isArray(i)){if(!i.length)throw new qe("mesh-load-external:missing-assets","There must be at least one file to load");return i[0]instanceof File?Aln(i):Mln(i,e)}return UWt(i)}async function Iln(i,e){const{parts:t,assetMimeType:r,assetName:n}=i;if(t.length===1)return new Jbe(t[0].partUrl);const s=await i.toBlob(e);return hn(e),Jbe.fromBlob(s,qWt(n,r))}function UWt(i){return Jbe.fromBlob(i,qWt(i.name,i.type))}function Aln(i){return HWt(i.map(e=>({name:e.name,mimeType:e.type,source:UWt(e)})))}async function Mln(i,e){const t=await yve(i.map(async r=>{const n=await Iln(r);return hn(e),{name:r.assetName,mimeType:r.assetMimeType,source:n}}));if(xg(e))throw t.forEach(r=>r.source.dispose()),Oc();return HWt(t)}const zWt=/^model\/gltf\+json$/,VWt=/^model\/gltf-binary$/,o7e=/\.gltf$/i,Oln=/\.glb$/i;function HWt(i){const e=new Map;let t,r=null;for(const{name:n,mimeType:s,source:o}of i)r===null&&(zWt.test(s)||o7e.test(n)?(r=o.url,t="gltf"):(VWt.test(s)||Oln.test(n))&&(r=o.url,t="glb")),e.set(n,o.url),o.files.forEach((a,l)=>e.set(l,a));if(r==null)throw new qe("mesh-load-external:missing-files","Missing files to load external mesh source");return new Jbe(r,()=>i.forEach(({source:n})=>n.dispose()),e,t)}let Jbe=class WWt{constructor(e,t=()=>{},r=new Map,n){this.url=e,this.dispose=t,this.files=r,this.type=n}static fromBlob(e,t){const r=URL.createObjectURL(e);return new WWt(r,()=>URL.revokeObjectURL(r),void 0,t)}};function qWt(i,e){return zWt.test(e)||o7e.test(i)?"gltf":VWt.test(e)||o7e.test(i)?"glb":void 0}let C5=class extends qF{constructor(){super(),this.externalSources=new dr,this._explicitDisplaySource=null,this.addHandles(ju(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!a0t(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!ban(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>IWt(t,e))}get _implicitDisplaySource(){return this.externalSources.find(a0t)}};x([D()],C5.prototype,"externalSources",void 0),x([D()],C5.prototype,"displaySource",null),x([D()],C5.prototype,"_implicitDisplaySource",null),x([D()],C5.prototype,"_explicitDisplaySource",void 0),C5=x([Qe("esri.geometry.support.meshUtils.Metadata")],C5);function Pln(){const{faceDescriptions:i,faceVertexOffsets:e,uvScales:t}=jln,r=4*i.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*i.length*3);let l=0,u=0,c=0,h=0;for(let p=0;p=s&&c=4,S=m===2||m===4,I=v?t-1:t;for(let R=0;R<=I;R++){const L=R/I*2*Math.PI,k=v?0:.5;um[0]=k*Math.sin(L),um[1]=k*-Math.cos(L),um[2]=m<=2?.5:-.5;for(let B=0;B<3;B++)n[l++]=um[B],s[u++]=w?B===2?m<=1?1:-1:0:B===2?0:um[B]/k;o[c++]=(R+(v?.5:0))/t,o[c++]=m<=1?1*m/3:m<=3?1*(m-2)/3+1/3:1*(m-4)/3+2/3,S||m===0||R===t||(m!==5&&(a[h++]=p,a[h++]=p+1,a[h++]=p-t),m!==1&&(a[h++]=p,a[h++]=p-t,a[h++]=p-t-1)),p++}}return{position:n,normal:s,uv:o,faces:a}}function kln(i,e){const t=typeof e=="number"?e:e!=null?e.width:1,r=typeof e=="number"?e:e!=null?e.height:1;switch(i){case"up":case"down":return{width:t,depth:r};case"north":case"south":return{width:t,height:r};case"east":case"west":return{depth:t,height:r}}}function Lln(i){const e=MK.facingAxisOrderSwap[i],t=MK.position,r=MK.normal,n=new Float64Array(t.length),s=new Float32Array(r.length);let o=0;for(let a=0;a<4;a++){const l=o;for(let u=0;u<3;u++){const c=e[u],h=Math.abs(c)-1,p=c>=0?1:-1;n[o]=t[l+h]*p,s[o]=r[l+h]*p,o++}}return{position:n,normal:s,uv:new Float32Array(MK.uv),faces:new Uint32Array(MK.faces),isPlane:!0}}const Yj=1,Xj=2,Jj=3,MK={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[Jj,Yj,Xj],west:[-Jj,-Yj,Xj],north:[-Yj,Jj,Xj],south:[Yj,-Jj,Xj],up:[Yj,Xj,Jj],down:[Yj,-Xj,-Jj]}};function hpe(i,e,t){i.isPlane||Nln(i),Bln(i,$ln(t?.size,t?.unit,e.spatialReference));const{vertexAttributes:r,vertexSpace:n,transform:s}=nJe(i,e,{vertexSpace:t?.vertexSpace,geographic:t?.geographic});return{vertexAttributes:new Gy({...r,uv:i.uv}),vertexSpace:n,transform:s,components:[new DB({faces:i.faces,material:t?.material||null})],spatialReference:e.spatialReference}}function Nln(i){for(let e=0;e{this.addHandles(Ki(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(i=>i.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{components:i,spatialReference:e,vertexAttributes:t,vertexSpace:r}=this,n=t.position;if(n.length===0||i&&i.length===0)return new hr({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e});if(VS(r)){const{_untransformedBounds:s,transform:o}=this;return yln(s,o,r,e)}return BWt(n,e)}get _untransformedBounds(){return $Wt(this.vertexAttributes.position)}get anchor(){const i=hbe(this.vertexSpace,this.spatialReference);if(i!=null)return i;const{center:e,zmin:t}=this._transformedExtent;return new $i({x:e.x,y:e.y,z:t,spatialReference:this.spatialReference})}get origin(){const i=hbe(this.vertexSpace,this.spatialReference);return i??this._transformedExtent.center}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(i){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(DB.from(i)),this.notifyChange("components"))}removeComponent(i){if(this._checkIfLoaded("removeComponent()")){if(this.components){const e=this.components.indexOf(i);if(e!==-1)return this.components.splice(e,1),void this.notifyChange("components")}QE().error("removeComponent()",Jan)}}rotate(i,e,t,r){return szr(i,e,t,O0t),Uln(this,O0t,r),this}offset(i,e,t){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if(VS(r)){const[o,a,l]=r.origin;r.origin=Do(o+i,a+e,l+t)}else{for(let o=0;os.cloneWithDeduplication(r,n))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:i,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new k2(t)}cloneShallow(){return new k2({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(i){const e=Promise.resolve().then(()=>Azn),t=this.load(),r=await Promise.all([e,t]),{toBinaryGLTF:n}=r[0];return n(this,i)}get memoryUsage(){let i=0;if(i+=this.vertexAttributes.memoryUsage,this.components!=null)for(const e of this.components)i+=e.memoryUsage;return i}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(i){return!!this.loaded||(QE().error(i,Xan),!1)}static createBox(i,e){if(!(i instanceof $i))return QE().error(".createBox()",ote),null;const t=new k2(hpe(Pln(),i,e));return e?.imageFace&&e.imageFace!=="all"?Rln(t,e.imageFace):t}static createSphere(i,e){return i instanceof $i?new k2(hpe(Dln(e?.densificationFactor||0),i,e)):(QE().error(".createSphere()",ote),null)}static createCylinder(i,e){return i instanceof $i?new k2(hpe(Fln(e?.densificationFactor||0),i,e)):(QE().error(".createCylinder()",ote),null)}static createPlane(i,e){if(!(i instanceof $i))return QE().error(".createPlane()",ote),null;const t=e?.facing??"up",r=kln(t,e?.size);return new k2(hpe(Lln(t),i,{...e,size:r}))}static createFromPolygon(i,e){if(!(i instanceof $s))return QE().error(".createFromPolygon()",Kan),null;const t=pln(i);return new k2({vertexAttributes:new Gy({position:t.position}),components:[new DB({faces:t.faces,shading:"flat",material:e?.material??null})],spatialReference:i.spatialReference,vertexSpace:new UC})}static async createFromGLTF(i,e,t){if(!(i instanceof $i)){const n=new v0t;throw QE().error(".createfromGLTF()",n.message),n}const{loadGLTFMesh:r}=await Jg(Promise.resolve().then(()=>Eti),t);return new k2(await r(i,e,t))}static async createFromFiles(i,e,t){zUe(QE(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=n=>QE().error(".createFromFiles()",n.message);if(!(i instanceof $i)){const n=new v0t;throw r(n),n}if(!t?.layer)throw new qe("invalid:no-layer","SceneLayer required for file to mesh conversion.");return t.layer.convertMesh(e,{location:i,...t})}static createWithExternalSource(i,e,t){const r=t?.extent??null,{x:n,y:s,z:o,spatialReference:a}=i,l=t?.transform?.clone()??new Tk,u=Do(n,s,o??0),c=Vpt(t?.vertexSpace??zpt(a),u),h={source:e,extent:r},p=new C5;return p.externalSources.push(h),new k2({metadata:p,transform:l,vertexSpace:c,spatialReference:a})}static createIncomplete(i,e){const{x:t,y:r,z:n,spatialReference:s}=i,o=e?.transform?.clone()??new Tk,a=Do(t,r,n??0),l=Vpt(e?.vertexSpace??zpt(s),a),u=new k2({transform:o,vertexSpace:l,spatialReference:s});return u.addResolvingPromise(Promise.reject(new qe("mesh-incomplete","Mesh resources are not complete"))),u}};x([D({type:[DB],json:{write:!0}})],Q0.prototype,"components",void 0),x([D({nonNullable:!0,types:Kln,constructOnly:!0,json:{write:!0}})],Q0.prototype,"vertexSpace",void 0),x([D({type:Tk,json:{write:!0}})],Q0.prototype,"transform",void 0),x([D({constructOnly:!0})],Q0.prototype,"metadata",void 0),x([D()],Q0.prototype,"hasExtent",null),x([D()],Q0.prototype,"_transformedExtent",null),x([D()],Q0.prototype,"_untransformedBounds",null),x([D()],Q0.prototype,"anchor",null),x([D()],Q0.prototype,"origin",null),x([D({readOnly:!0,json:{read:!1}})],Q0.prototype,"extent",null),x([D({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Q0.prototype,"hasZ",void 0),x([D({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Q0.prototype,"hasM",void 0),x([D({type:Gy,nonNullable:!0,json:{write:!0}})],Q0.prototype,"vertexAttributes",void 0),Q0=k2=x([Qe(ZWt)],Q0);const O0t=Q3(),a7e=Q0,l7e=()=>di.getLogger("esri.rest.support.meshFeatureSet");function Zln(i,e,t){const r=t.features;t.features=[],delete t.geometryType;const n=du.fromJSON(t);if(n.geometryType="mesh",!t.assetMaps)return n;const s=eqt(e,t.assetMaps),o=i.sourceSpatialReference??Xi.WGS84,a=t.globalIdFieldName,{outFields:l}=i,u=l!=null&&l.length>0?Qln(l.includes("*")?null:new Set(l)):()=>({});for(const c of r){const h=QWt(c,a,o,e,s);h!=null&&n.features.push(new Us({geometry:h,attributes:u(c)}))}return n}function Qln(i){return({attributes:e})=>{if(!e)return{};if(!i)return e;for(const t in e)i.has(t)||delete e[t];return e}}function QWt(i,e,t,r,n){const s=i.attributes[e],o=n.get(s);if(o==null)return l7e().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",i),null;if(!i.geometry)return l7e().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",i),null;const a=eun(i,t,r),l=hr.fromJSON(i.geometry);l.spatialReference=t;const u=tun(i.attributes,r),c=t.isGeographic?"local":"georeferenced",h=iun(o);return h?a7e.createWithExternalSource(a,h,{extent:l,transform:u,vertexSpace:c}):a7e.createIncomplete(a,{extent:l,transform:u,vertexSpace:c})}function eun({attributes:i},e,{transformFieldRoles:t}){const r=i[t.originX],n=i[t.originY],s=i[t.originZ];return new $i({x:r,y:n,z:s,spatialReference:e})}function tun(i,{transformFieldRoles:e}){return new Tk({translation:[i[e.translationX],-i[e.translationZ],i[e.translationY]],rotationAxis:[i[e.rotationX],-i[e.rotationZ],i[e.rotationY]],rotationAngle:i[e.rotationDeg],scale:[i[e.scaleX],i[e.scaleZ],i[e.scaleY]]})}var AH;function eqt(i,e){const t=new Map;for(const r of e){const n=r.parentGlobalId;if(n==null)continue;const s=r.assetName,o=r.assetType,a=r.assetHash,l=r.assetURL,u=r.conversionStatus,c=r.seqNo,h=bDt(o,i.supportedFormats);if(!h){l7e().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${o}, but it does not list it as a supported type`);continue}const p=qh(t,n,()=>({files:new Map}));qh(p.files,s,()=>({name:s,type:o,mimeType:h,status:run(u),parts:[]})).parts[c]={hash:a,url:l}}return t}function iun(i){const e=Array.from(i.files.values()),t=new Array;for(const r of e){if(r.status!==AH.COMPLETED)return null;const n=new Array;for(const s of r.parts){if(!s)return null;n.push(new mKe(s.url,s.hash))}t.push(new $le(r.name,r.mimeType,n))}return t}function run(i){switch(i){case"COMPLETED":case"SUBMITTED":return AH.COMPLETED;case"INPROGRESS":return AH.PENDING;default:return AH.FAILED}}(function(i){i[i.FAILED=0]="FAILED",i[i.PENDING=1]="PENDING",i[i.COMPLETED=2]="COMPLETED"})(AH||(AH={}));const tqt=Object.freeze(Object.defineProperty({__proto__:null,assetMapFromAssetMapsJSON:eqt,extractMesh:QWt,meshFeatureSetFromJSON:Zln},Symbol.toStringTag,{value:"Module"})),wKe=()=>di.getLogger("esri.layers.support.ElevationSampler");let iqt=class{queryElevation(e){return sun(e.clone(),this)}on(){return wa()}projectIfRequired(e,t){return rqt(e,t)}},nun=class extends iqt{get spatialReference(){return this.extent.spatialReference}constructor(e,t,r){super(),this.tile=e,this.noDataValue=r;const n=e.tile.extent;this.extent=iB(n,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=pu(t.spatialReference),o=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return $Xi(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const r=this.extent,n=`${r.xmin}, ${r.ymin}, ${r.xmax}, ${r.ymax}`;return wKe().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}},P0t=class extends iqt{get spatialReference(){return this.extent.spatialReference}constructor(e,t,r){let n;super(),typeof t=="number"?(this.noDataValue=t,n=null):(n=t,this.noDataValue=r),this.samplers=n?e.map(o=>new nun(o,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:o,max:a}=s.demResolution;this.demResolution={min:o,max:a};for(let l=1;lt?t:i}let cun=class{async queryAll(e,t,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(u=>u.visible):e.slice()).length)throw new qe("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=ate.fromGeometry(t);let s=!1;r&&r.returnSampleInfo||(s=!0);const o={...dpe,...r,returnSampleInfo:!0},a=await this.query(e[e.length-1],n,o),l=await this._queryAllContinue(e,a,o);return l.geometry=l.geometry.export(),s&&delete l.sampleInfo,l}async query(e,t,r){if(!e)throw new qe("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof ate)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new qe("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...dpe,...r},s=new hun(e,t.spatialReference,n),o=n.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(s,t,o),await this._selectTiles(s,o),await this._populateElevationTiles(s,o),this._sampleGeometryWithElevation(s),this._createQueryResult(s,o)}async createSampler(e,t,r){if(!e)throw new qe("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new qe("elevation-query:invalid-extent","Invalid or undefined extent");const n={...dpe,...r};return this._createSampler(e,t,n)}async createSamplerAll(e,t,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new qe("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new qe("elevation-query:invalid-extent","Invalid or undefined extent");const n={...dpe,...r,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,n);return this._createSamplerAllContinue(e,t,s,n)}async _createSampler(e,t,r,n){const s=r.signal;await e.load({signal:s});const o=t.spatialReference,a=e.tileInfo.spatialReference;o.equals(a)||(await Lx([{source:o,dest:a}],{signal:s}),t=Wc(t,a));const l=new dun(e,t,r,n);return await this._selectTiles(l,s),await this._populateElevationTiles(l,s),new P0t(l.elevationTiles,l.layer.tileInfo,l.options.noDataValue)}async _createSamplerAllContinue(e,t,r,n){if(e.pop(),!e.length)return r;const s=r.samplers.filter(u=>!u.tile.hasNoDataValues).map(u=>tB(u.extent)),o=await this._createSampler(e[e.length-1],t,n,s);if(o.samplers.length===0)return r;const a=r.samplers.concat(o.samplers),l=new P0t(a,n.noDataValue);return this._createSamplerAllContinue(e,t,l,n)}async _queryAllContinue(e,t,r){const n=e.pop(),s=t.geometry.coordinates,o=t.sampleInfo;Of(o);const a=[],l=[];for(let p=0;p=0?m.source||(m.source=n):e.length&&(a.push(s[p]),l.push(p))}if(!e.length||a.length===0)return t;const u=t.geometry.clone(a),c=await this.query(e[e.length-1],u,r),h=c.sampleInfo;if(!h)throw new Error("no sampleInfo");return l.forEach((p,m)=>{s[p].z=c.geometry.coordinates[m].z,o[p].demResolution=h[m].demResolution}),this._queryAllContinue(e,t,r)}async _createQueryResult(e,t){const r=await e.geometry.project(e.outSpatialReference,t);Of(r);const n={geometry:r.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,t,r){let n;const s=e.layer.tileInfo.spatialReference;if(t instanceof ate?n=await t.project(s,r):(await Lx([{source:t.spatialReference,dest:s}],{signal:r}),n=Wc(t,s)),!n)throw new qe("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=ate.fromGeometry(n)}async _selectTiles(e,t){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const r=e.options.demResolution;if(typeof r=="number")this._selectTilesClosestResolution(e,r);else if(r==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(r!=="auto")throw new qe("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${r}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const t=new R0t(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const r=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,o=n.y;(sr.xmax||or.ymax)&&(n.elevationTile=t)})}_selectTilesClosestResolution(e,t){const r=this._findNearestDemResolutionLODIndex(e,t);e.selectTilesAtLOD(r)}_findNearestDemResolutionLODIndex(e,t){const{tileInfo:r,tilemapCache:n}=e.layer,s=t/pu(r.spatialReference),o=foe(r,n);let a=o[0],l=0;for(let u=1;us.fetchAvailability(a.level,a.row,a.col,{signal:r}))),r);else if(await this._populateElevationTiles(e,r),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new qe("elevation-query:has-unavailable-tiles")}catch(a){_a(a),await this._selectTilesFinestContiguousAt(e,t-1,r)}}async _populateElevationTiles(e,t){const r=e.getTilesToFetch(),n={},s=e.options.cache,o=e.options.noDataValue,a=r.map(async l=>{if(l.id==null)return;const u=`${e.layer.uid}:${l.id}:${o}`,c=s!=null?s.get(u):null,h=c??await e.layer.fetchTile(l.level,l.row,l.col,{noDataValue:o,signal:t});s?.put(u,h),n[l.id]=new R0t(l,h)});await Jg(Promise.allSettled(a),t),e.populateElevationTiles(n)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const r=e.layer.tilemapCache;if(!r||c7e(r))return this._selectTilesAutoPrefetchUpsample(e,t);const n=e.getTilesToFetch(),s={},o=n.map(async a=>{const l=new jY(null,0,0,0,Wo()),u=await Uk(r.fetchAvailabilityUpsample(a.level,a.row,a.col,l,{signal:t}));u.ok!==!1?a.id!=null&&(s[a.id]=l):_a(u.error)});await Jg(Promise.all(o),t),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let r=0;const n={},s=l=>{l.id!=null&&(l.id in n?n[l.id]++:(n[l.id]=1,r++))},o=l=>{if(l.id==null)return;const u=n[l.id];u===1?(delete n[l.id],r--):n[l.id]=u-1};e.forEachTileToFetch(s,o);let a=!0;for(;a&&(a=!1,e.forEachTileToFetch(l=>{r<=e.options.maximumAutoTileRequests||(o(l),t.upsampleTile(l)&&(a=!0),s(l))},o),a););}_selectTilesAutoFinest(e){const{tileInfo:t,tilemapCache:r}=e.layer,n=u7e(t,r,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const r=e.layer.tileInfo;await this._populateElevationTiles(e,t);let n=!1;e.forEachTileToFetch((s,o)=>{r.upsampleTile(s)?n=!0:o()}),n&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const r=t.elevationTile;let n=e.options.noDataValue;if(r){const s=r.sample(t.x,t.y);s!=null?n=s:t.elevationTile=null}t.z=n})}_extractSampleInfo(e){const t=e.layer.tileInfo,r=pu(t.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=t.lodAt(n.elevationTile.tile.level).resolution*r),{demResolution:s}})}},ate=class Lye{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new Lye;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(r=>r.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await Lx([{source:this.spatialReference,dest:e}],{signal:t});const r=new Oh({spatialReference:this.spatialReference,points:this.coordinates.map(a=>[a.x,a.y])}),n=Wc(r,e);if(!n)return null;const s=this.coordinates.map((a,l)=>{const u=a.clone(),c=n.points[l];return u.x=c[0],u.y=c[1],u}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const t=new Lye;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof Lye)t.coordinates=e.coordinates.map(r=>r.clone()),t._exporter=(r,n)=>{const s=e.clone(r);return s.spatialReference=n,s};else switch(e.type){case"point":{const r=e,{hasZ:n,hasM:s}=r;t.coordinates=n&&s?[new v2(r.x,r.y,r.z,r.m)]:n?[new v2(r.x,r.y,r.z)]:s?[new v2(r.x,r.y,null,r.m)]:[new v2(r.x,r.y)],t._exporter=(o,a)=>e.hasM?new $i(o[0].x,o[0].y,o[0].z,o[0].m,a):new $i(o[0].x,o[0].y,o[0].z,a);break}case"multipoint":{const r=e,{hasZ:n,hasM:s}=r;t.coordinates=n&&s?r.points.map(o=>new v2(o[0],o[1],o[2],o[3])):n?r.points.map(o=>new v2(o[0],o[1],o[2])):s?r.points.map(o=>new v2(o[0],o[1],null,o[2])):r.points.map(o=>new v2(o[0],o[1])),t._exporter=(o,a)=>e.hasM?new Oh({points:o.map(l=>[l.x,l.y,l.z,l.m]),hasZ:!0,hasM:!0,spatialReference:a}):new Oh(o.map(l=>[l.x,l.y,l.z]),a);break}case"polyline":{const r=e,n=[],s=[],{hasZ:o,hasM:a}=e;let l=0;for(const u of r.paths)if(s.push([l,l+u.length]),l+=u.length,o&&a)for(const c of u)n.push(new v2(c[0],c[1],c[2],c[3]));else if(o)for(const c of u)n.push(new v2(c[0],c[1],c[2]));else if(a)for(const c of u)n.push(new v2(c[0],c[1],null,c[2]));else for(const c of u)n.push(new v2(c[0],c[1]));t.coordinates=n,t._exporter=(u,c)=>{const h=e.hasM?u.map(m=>[m.x,m.y,m.z,m.m]):u.map(m=>[m.x,m.y,m.z]),p=s.map(m=>h.slice(m[0],m[1]));return new lo({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:c})};break}}return t}},v2=class nqt{constructor(e,t,r=null,n=null,s=null,o=null){this.x=e,this.y=t,this.z=r,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new nqt(this.x,this.y,this.z,this.m)}},sqt=class{constructor(e,t){this.layer=e,this.options=t}},hun=class extends sqt{constructor(e,t,r){super(e,r),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:r}=this.layer,n=foe(t,r)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const r=t.tile?.id;t.tile=r?e[r]:null}}getTilesToFetch(){const e={},t=[];for(const r of this.geometry.coordinates){const n=r.tile;if(!n)continue;const s=r.tile?.id;r.elevationTile||!s||e[s]||(e[s]=n,t.push(n))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}},dun=class extends sqt{constructor(e,t,r,n){super(e,r),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,t){const r=this._maximumLodForRequests(t),n=Math.min(r,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:r}=this.layer,n=foe(t,r);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let o=n.length-1;o>=0;o--){const a=n[o],l=a.resolution*t.size[0],u=a.resolution*t.size[1];if(Math.ceil(s.width/l)*Math.ceil(s.height/u)<=e)return o}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const r=t.id&&e[t.id];r&&(this._fetchedCandidates.add(t),this.elevationTiles.push(r))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const r=this._candidateTiles;this._candidateTiles=[],r.forEach(n=>{if(this._fetchedCandidates.has(n))return void(t&&t(n));let s=!1;e(n,()=>s=!0),s?t&&t(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const r={},n=[];for(const o of e){const a=o.id;a&&!r[a]?(r[a]=o,n.push(o)):t&&t(o)}const s=n.sort((o,a)=>o.level-a.level);return s.filter((o,a)=>{for(let l=0;le.extent&&C5e(t,e.extent))}};function u7e(i,e,t=0){const r=foe(i,e);let n=r.length-1;if(t>0){const s=t/pu(i.spatialReference),o=r.findIndex(a=>a.resolution0&&(n=o-1)}return n}const dpe={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function foe(i,e){const t=i.lods;if(c7e(e)){const{effectiveMinLOD:r,effectiveMaxLOD:n}=e;return t.filter(s=>s.level>=r&&s.level<=n)}return t}function c7e(i){return i?.tileInfo!=null}const Zbe=Object.freeze(Object.defineProperty({__proto__:null,ElevationQuery:cun,GeometryDescriptor:ate,getFinestLodIndex:u7e},Symbol.toStringTag,{value:"Module"}));function Qbe(i,e,t,r){let n=null,s=1e3;typeof e=="number"?(s=e,r=t):(n=e??null,s=t);let o,a=0;const l=()=>{a=0,i.apply(r,o)},u=(...c)=>{n&&n.apply(r,c),o=c,s?a||(a=setTimeout(l,s)):l()};return u.remove=()=>{a&&(clearTimeout(a),a=0)},u.forceUpdate=()=>{a&&(clearTimeout(a),l())},u.hasPendingUpdates=()=>!!a,u}function h7e(i){switch(i?.type){case"point":return i;case"extent":return i.center;case"polygon":return i.centroid;case"multipoint":case"polyline":return i.extent?.center;default:return null}}function pun(i){return i?{backgroundImage:`url(${i})`}:{}}function fun({action:i,feature:e}){const t=e?.attributes,r="image"in i?i.image:void 0;return r&&t?xC(r,t):r??""}function mun(i,e){return{type:iW(e),value:i,unit:e}}function gun(i,e){return{type:iW(e),value:i,unit:e}}function xKe(i,e,t="arithmetic"){return{type:iW(e),value:i,unit:e,rotationType:t}}mun(0,"meters");gun(0,"square-meters");xKe(0,"radians");xKe(0,"degrees");xKe(0,"degrees","geographic");const F0t=["B","kB","MB","GB","TB"];function yun(i,e){let t=(e=Math.round(e))===0?0:Math.floor(Math.log(e)/Math.log(RW.KILOBYTES));t=uu(t,0,F0t.length-1);const r=DS(e/RW.KILOBYTES**t,{maximumFractionDigits:2});return m0(i.units.bytes[F0t[t]],{fileSize:r})}const vun="esri.widgets.Feature.support.featureUtils",k0t=()=>di.getLogger(vun),_un=/href=(""|'')/gi,bun=/(\{([^\{\r\n]+)\})/g,wun=/\'/g,oqt=/^\s*expression\//i,xun=/(\n)/gi,Sun=/[\u00A0-\u9999<>\&]/gim,Tun=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,Cun=/^(?:mailto:|tel:)/,aqt="relationships/",L0t=T6("short-date-short-time");function lqt(i){if(i!=null)return(i.sourceLayer||i.layer)??void 0}async function ewe(i,e){return typeof i=="function"?i(e):i}function uqt(i=""){if(i)return!Cun.test(i.trim().toLowerCase())}function SKe(i){return!!i&&oqt.test(i)}function Eun(i,e){if(!SKe(e)||!i)return;const t=e.replace(oqt,"").toLowerCase();return i.find(({name:r})=>r.toLowerCase()===t)}function cqt(i,e){const t=Eun(e,i?.fieldName);return t?t.title||null:i?i.label||i.fieldName:null}function Iun(i,e){return`{${e.get(i.toLowerCase())?.fieldName||i}}`}function Aun(i){return i.replaceAll(_un,"")}function moe(i,e){const t=TKe(e,i);return t?t.name:i}function Mun(i,e){return i&&i.map(t=>moe(t,e))}function TKe(i,e){return i&&typeof i.getField=="function"&&e?i.getField(e)??null:null}function hqt(i){return`${i}`.trim()}function A8({attributes:i,globalAttributes:e,layer:t,text:r,expressionAttributes:n,fieldInfoMap:s}){return r?d7e({formattedAttributes:e,template:Dun(r,{...e,...n,...i},t),fieldInfoMap:s}):""}function d7e({formattedAttributes:i,template:e,fieldInfoMap:t}){return hqt(Aun(m0(m0(e,r=>Iun(r,t)),i)))}function Oun(i,e,t=!1){const r=e[i];if(typeof r=="string"){const n="%27",s=(t?encodeURIComponent(r):r).replaceAll(wun,n);e[i]=s}}function Pun(i,e=!1){const t={...i};return Object.keys(t).forEach(r=>Oun(r,t,e)),t}function Run(i,e,t){const r=(e=hqt(e))&&e[0]!=="{";return m0(i,Pun(t,r||!1))}function p7e(i,e){return i.replaceAll(bun,(t,r,n)=>{const s=TKe(e,n);return s?`{${s.name}}`:r})}function Dun(i,e,t){const r=p7e(i,t);return r&&r.replaceAll(Tun,(n,s,o)=>Run(n,s||o,e))}function Fun(i,e){if(typeof i=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const t=Number(i);if(!isNaN(t))return t}return i}function kun(i){return i!=null&&typeof i=="object"&&"fieldsIndex"in i&&"geometryType"in i&&"getField"in i&&"load"in i&&"loaded"in i&&"objectIdField"in i&&"spatialReference"in i&&"type"in i&&(i.type==="feature"||i.type==="scene")&&"when"in i}function Lun(i){return i!=null&&typeof i=="object"&&"createQuery"in i&&"queryFeatureCount"in i&&"queryObjectIds"in i&&"queryRelatedFeatures"in i&&"queryRelatedFeaturesCount"in i&&"relationships"in i}function dqt(i){return kun(i)&&Lun(i)}function Nun(i,e){const{fieldInfos:t,fieldName:r,preventPlacesFormatting:n,layer:s,timeZone:o}=e,a=pqt(t,r),l=TKe(s,r);if(a&&!L5e(r)){const c=l?.type,h=a.format?.dateFormat;if(c==="date"||c==="date-only"||c==="time-only"||c==="timestamp-offset"||h)return QBt(i,{format:h,fieldType:c,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const u=a?.format;return typeof i=="string"&&L5e(r)&&u?$un(i,u):typeof(i=Fun(i,u))=="string"||i==null||u==null?Ble(i):DS(i,n?{...Qve(u),minimumFractionDigits:0,maximumFractionDigits:20}:Qve(u))}function $un(i,e){return i=i.trim(),/\d{2}-\d{2}/.test(i)?i:i.includes(",")?BPe(i,",",", ",e):i.includes(";")?BPe(i,";","; ",e):i.includes(" ")?BPe(i," "," ",e):DS(Number(i),Qve(e))}function BPe(i,e,t,r){return i.trim().split(e).map(n=>DS(Number(n),Qve(r))).join(t)}function pqt(i,e){if(i?.length&&e)return i.find(t=>t.fieldName?.toLowerCase()===e.toLowerCase())}function Bun({fieldName:i,graphic:e,layer:t}){if(TP(i)||!t||typeof t.getFeatureType!="function")return null;const{typeIdField:r}=t;if(!r||i!==r)return null;const n=t.getFeatureType(e);return n?n.name:null}function jun({fieldName:i,value:e,graphic:t,layer:r}){if(TP(i)||!r||typeof r.getFieldDomain!="function")return null;const n=t&&r.getFieldDomain(i,{feature:t});return n&&n.type==="coded-value"?n.getName(e):null}function Gun(i,e,t,r){const{creatorField:n,creationDateField:s,editorField:o,editDateField:a}=i;if(!e)return;const l=IAt(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone,t,L0t,"date"),u={...L0t,...l},c=e[a];if(typeof c=="number"){const p=e[o];return{type:"edit",date:vb(c,u),user:p}}const h=e[s];if(typeof h=="number"){const p=e[n];return{type:"create",date:vb(h,u),user:p}}return null}function Uun(i,e){const t=new Map;return i&&i.forEach(r=>{const n=moe(r.fieldName,e);r.fieldName=n,t.set(n.toLowerCase(),r)}),t}function N0t(i){const e=[];if(!i)return e;const{fieldInfos:t,content:r}=i;return t&&e.push(...t),r&&Array.isArray(r)&&r.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&e.push(...s)}}),e}function CKe(i){return i.replaceAll(Sun,e=>`&#${e.charCodeAt(0)};`)}function Ble(i){return typeof i=="string"?i.replaceAll(xun,'
'):i}function fqt(i){const{value:e,fieldName:t,fieldInfos:r,fieldInfoMap:n,layer:s,graphic:o,timeZone:a}=i;if(e==null)return"";const l=jun({fieldName:t,value:e,graphic:o,layer:s});if(l)return l;const u=Bun({fieldName:t,graphic:o,layer:s});if(u)return u;if(n.get(t.toLowerCase()))return Nun(e,{fieldInfos:r||Array.from(n.values()),fieldName:t,layer:s,timeZone:a});const c=s?.fieldsIndex?.get(t);return c&&(ZBt(c)||hae(c))?QBt(e,{fieldType:c.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:a,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):Ble(e)}function jPe({fieldInfos:i,attributes:e,layer:t,graphic:r,fieldInfoMap:n,relatedInfos:s,timeZone:o}){const a={};return s?.forEach(l=>Wun({attributes:a,relatedInfo:l,fieldInfoMap:n,fieldInfos:i,layer:t,timeZone:o})),e&&Object.keys(e).forEach(l=>{const u=e[l];a[l]=fqt({fieldName:l,fieldInfos:i,fieldInfoMap:n,layer:t,value:u,graphic:r,timeZone:o})}),a}async function mqt(i,e){const{layer:t,graphic:r,outFields:n,objectIds:s,returnGeometry:o,spatialReference:a}=i,l=s[0];if(typeof l!="number"&&typeof l!="string"){const c="Could not query required fields for the specified feature. The feature's ID is invalid.",h={layer:t,graphic:r,objectId:l,requiredFields:n};return k0t().warn(c,h),null}if(!tT(t)?.operations?.supportsQuery){const c="The specified layer cannot be queried. The following fields will not be available.",h={layer:t,graphic:r,requiredFields:n,returnGeometry:o};return k0t().warn(c,h),null}const u=t.createQuery();return u.objectIds=s,u.outFields=n?.length?n:[t.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=a,(await t.queryFeatures(u,e)).features[0]}async function zun(i){if(!i.expressionInfos?.length)return!1;const e=await e_(),{arcadeUtils:{hasGeometryFunctions:t}}=e;return t(i)}async function Vun({graphic:i,popupTemplate:e,layer:t,spatialReference:r},n){if(!t||!e||(typeof t.load=="function"&&await t.load(n),!i.attributes))return;const s=i.attributes[t.objectIdField];if(s==null)return;const o=[s],a=await e.getRequiredFields(t.fieldsIndex),l=XAt(a,i),u=l?[]:a,c=e.returnGeometry||await zun(e);if(l&&!c)return;const h=await mqt({layer:t,graphic:i,outFields:u,objectIds:o,returnGeometry:c,spatialReference:r},n);h&&(h.geometry&&(i.geometry=h.geometry),h.attributes&&(i.attributes={...i.attributes,...h.attributes}))}function TP(i=""){return!!i&&i.includes(aqt)}function Hun(i){return i?`${aqt}${i.layerId}/${i.fieldName}`:""}function $0t({attributes:i,graphic:e,relatedInfo:t,fieldInfos:r,fieldInfoMap:n,layer:s,timeZone:o}){i&&e&&t&&Object.keys(e.attributes).forEach(a=>{const l=Hun({layerId:t.relation.id.toString(),fieldName:a}),u=e.attributes[a];i[l]=fqt({fieldName:l,fieldInfos:r,fieldInfoMap:n,layer:s,value:u,graphic:e,timeZone:o})})}function Wun({attributes:i,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s}){i&&e&&(e.relatedFeatures?.forEach(o=>$0t({attributes:i,graphic:o,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s})),e.relatedStatsFeatures?.forEach(o=>$0t({attributes:i,graphic:o,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s})))}const B0t=i=>{if(!i)return!1;const e=i.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},gqt=({layer:i,method:e,query:t,definitionExpression:r})=>{if(!i.capabilities?.query?.supportsCacheHint||e==="attachments")return;const n=t.where!=null?t.where:null,s=t.geometry!=null?t.geometry:null;B0t(r)||B0t(n)||s?.type==="extent"||t.resultType==="tile"||(t.cacheHint=!0)},qun=({query:i,layer:e,method:t})=>{gqt({layer:e,method:t,query:i,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},Yun=({queryPayload:i,layer:e,method:t})=>{gqt({layer:e,method:t,query:i,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Xun(i,e,t){return i&&e&&t?j0t(i.allLayers,e,t)||j0t(i.allTables,e,t):null}function j0t(i,e,{relatedTableId:t}){const r=e.type==="scene"&&e.associatedLayer?e.associatedLayer.url:e.url;return i.filter(dqt).find(n=>n!==e&&n.url===r&&n.layerId===t)}const G0t={editing:!1,operations:{add:!0,update:!0,delete:!0}},yqt=dr.ofType(dDt);let U_=class extends un{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...G0t},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new yqt,this.fileInfos=new dr,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(Ki(()=>this.graphic,()=>this._graphicChanged(),js))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...G0t,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new qe("invalid-layer","getAttachments(): A valid layer is required.");const r=this._getObjectId(),n=new _1e({objectIds:[r],returnMetadata:!0}),s=[],o=e.queryAttachments(n).then(l=>l[r]||s).catch(()=>s);this._getAttachmentsPromise=o,this.notifyChange("state");const a=await o;return t.removeAll(),a.length&&t.addMany(a),this._getAttachmentsPromise=null,this.notifyChange("state"),a}async addAttachment(e,t=this.graphic){const{_attachmentLayer:r,attachmentInfos:n,capabilities:s}=this;if(!t)throw new qe("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new qe("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!s.operations?.add)throw new qe("invalid-capabilities","addAttachment(): add capabilities are required.");if(!r||typeof r.addAttachment!="function")throw new qe("invalid-layer","addAttachment(): A valid layer is required.");const o=r.addAttachment(t,e).then(l=>this._queryAttachment(l.objectId,t)),a=await o;return n.add(a),a}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:r,graphic:n,capabilities:s}=this;if(!e)throw new qe("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!s.operations?.delete)throw new qe("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new qe("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new qe("invalid-graphic","deleteAttachment(): A graphic is required.");const o=t.deleteAttachments(n,[e.id]).then(()=>e),a=await o;return r.remove(a),a}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:r,attachmentInfos:n,graphic:s,capabilities:o}=this;if(!e)throw new qe("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new qe("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!o.operations?.update)throw new qe("invalid-capabilities","updateAttachment(): Update capabilities are required.");const a=n.indexOf(t);if(!r||typeof r.updateAttachment!="function")throw new qe("invalid-layer","updateAttachment(): A valid layer is required.");if(!s)throw new qe("invalid-graphic","updateAttachment(): A graphic is required.");const l=r.updateAttachment(s,t.id,e).then(c=>this._queryAttachment(c.objectId)),u=await l;return n.splice(a,1,u),u}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const r={file:e,form:t};return this.fileInfos.add(r),r}updateFile(e,t,r=this.activeFileInfo){if(!e||!t||!r)return null;const n=this.fileInfos.indexOf(r);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:t}),this.fileInfos.items[n]}deleteFile(e){const t=this.fileInfos.find(r=>r.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:r}=this;if(!e||!r?.queryAttachments)throw new qe("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(t),s=new _1e({objectIds:[n],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return r.queryAttachments(s).then(o=>o[n][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=lqt(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};x([D()],U_.prototype,"capabilities",void 0),x([So("capabilities")],U_.prototype,"castCapabilities",null),x([D()],U_.prototype,"activeAttachmentInfo",void 0),x([D()],U_.prototype,"activeFileInfo",void 0),x([D({readOnly:!0,type:yqt})],U_.prototype,"attachmentInfos",void 0),x([D()],U_.prototype,"fileInfos",void 0),x([D({type:Us})],U_.prototype,"graphic",void 0),x([D()],U_.prototype,"mode",void 0),x([D({readOnly:!0})],U_.prototype,"state",null),x([D()],U_.prototype,"filesEnabled",void 0),x([D({readOnly:!0})],U_.prototype,"supportsResizeAttachments",null),U_=x([Qe("esri.widgets.Attachments.AttachmentsViewModel")],U_);const EKe=U_;function U0t(i){const e=i.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function Jun(i){const e=Fl("esri/themes/base/images/files/");return i?i==="text/plain"?`${e}text-32.svg`:i==="application/pdf"?`${e}pdf-32.svg`:i==="text/csv"?`${e}csv-32.svg`:i==="application/gpx+xml"?`${e}gpx-32.svg`:i==="application/x-dwf"?`${e}cad-32.svg`:i==="application/postscript"||i==="application/json"||i==="text/xml"||i==="model/vrml"?`${e}code-32.svg`:i==="application/x-zip-compressed"||i==="application/x-7z-compressed"||i==="application/x-gzip"||i==="application/x-tar"||i==="application/x-gtar"||i==="application/x-bzip2"||i==="application/gzip"||i==="application/x-compress"||i==="application/x-apple-diskimage"||i==="application/x-rar-compressed"||i==="application/zip"?`${e}zip-32.svg`:i.includes("image/")?`${e}image-32.svg`:i.includes("audio/")?`${e}sound-32.svg`:i.includes("video/")?`${e}video-32.svg`:i.includes("msexcel")||i.includes("ms-excel")||i.includes("spreadsheetml")?`${e}excel-32.svg`:i.includes("msword")||i.includes("ms-word")||i.includes("wordprocessingml")?`${e}word-32.svg`:i.includes("powerpoint")||i.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const z0t={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},Ru="esri-attachments",Ta={base:Ru,loaderContainer:`${Ru}__loader-container`,loader:`${Ru}__loader`,fadeIn:`${Ru}--fade-in`,container:`${Ru}__container`,containerList:`${Ru}__container--list`,containerPreview:`${Ru}__container--preview`,actions:`${Ru}__actions`,deleteButton:`${Ru}__delete-button`,addAttachmentButton:`${Ru}__add-attachment-button`,errorMessage:`${Ru}__error-message`,items:`${Ru}__items`,item:`${Ru}__item`,itemButton:`${Ru}__item-button`,itemMask:`${Ru}__item-mask`,itemMaskIcon:`${Ru}__item-mask--icon`,itemImage:`${Ru}__image`,itemImageResizable:`${Ru}__image--resizable`,itemLabel:`${Ru}__label`,itemFilename:`${Ru}__filename`,itemChevronIcon:`${Ru}__item-chevron-icon`,itemLink:`${Ru}__item-link`,itemLinkOverlay:`${Ru}__item-link-overlay`,itemLinkOverlayIcon:`${Ru}__item-link-overlay-icon`,itemEditIcon:`${Ru}__item-edit-icon`,itemAddIcon:`${Ru}__item-add-icon`,itemAddButton:`${Ru}__item-add-button`,formNode:`${Ru}__form-node`,fileFieldset:`${Ru}__file-fieldset`,fileLabel:`${Ru}__file-label`,fileName:`${Ru}__file-name`,fileInput:`${Ru}__file-input`,metadata:`${Ru}__metadata`,metadataFieldset:`${Ru}__metadata-fieldset`,progressBar:`${Ru}__progress-bar`},GPe=window.CSS;let ev=class extends my{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...z0t},this._supportsImageOrientation=GPe&&GPe.supports&&GPe.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new EKe,...e}),e}initialize(){this.addHandles([ju(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),ju(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),Ki(()=>this.viewModel?.mode,()=>this._modeChanged(),js)])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...z0t,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),t.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:add-attachment",this.messages.addErrorMessage,r)),r})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),t.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:delete-attachment",this.messages.deleteErrorMessage,r)),r})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(r=>(this._set("submitting",!1),this._set("error",null),e.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:update-attachment",this.messages.updateErrorMessage,r)),r})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:r}=t;return er("div",{class:this.classes(Ta.base,Xo.widget)},e?this._renderProgressBar():null,r==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?er("div",{class:Ta.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:r}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(r||e):this._renderAttachmentContainer()}_renderLoading(){return er("div",{class:Ta.loaderContainer,key:"loader"},er("div",{class:Ta.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?er("div",{class:Ta.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,r=e||!t,n=this.visibleElements.cancelAddButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonTertiary,Xo.buttonSmall,Xo.buttonHalf,e&&Xo.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,s=this.visibleElements.addSubmitButton?er("button",{class:this.classes(Xo.button,Xo.buttonSecondary,Xo.buttonSmall,Xo.buttonHalf,{[Xo.buttonDisabled]:r}),disabled:r,type:"submit"},this.messages.add):null,o=t?er("span",{class:Ta.fileName,key:"file-name"},t.name):null,a=er("form",{afterCreate:jat,afterRemoved:Bat,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},er("fieldset",{class:Ta.fileFieldset},o,er("label",{class:this.classes(Ta.fileLabel,Xo.button,Xo.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,er("input",{bind:this,class:Ta.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),s,n);return er("div",{class:Ta.formNode,key:"add-form-container"},a)}_renderDetailsForm(e){const{visibleElements:t,viewModel:r,selectedFile:n,submitting:s}=this,{capabilities:o}=r,a=s||!n;let l,u,c,h;n?(l=n.type,u=n.name,c=n.size):e&&"file"in e?(l=e.file.type,u=e.file.name,c=e.file.size):e&&"contentType"in e&&(l=e.contentType,u=e.name,c=e.size,h=e.url);const p=o.editing&&o.operations?.delete&&t.deleteButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonTertiary,Ta.deleteButton,{[Xo.buttonDisabled]:s}),disabled:s,key:"delete-button",onclick:k=>this._submitDeleteAttachment(k,e),type:"button"},this.messages.delete):void 0,m=o.editing&&o.operations?.update&&t.updateButton?er("button",{class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonThird,{[Xo.buttonDisabled]:a}),disabled:a,key:"update-button",type:"submit"},this.messages.update):void 0,v=this.visibleElements.cancelUpdateButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonTertiary,Xo.buttonThird,{[Xo.buttonDisabled]:s}),disabled:s,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,w=o.editing&&o.operations?.update?er("fieldset",{class:Ta.fileFieldset,key:"file"},er("span",{class:Ta.fileName,key:"file-name"},u),er("label",{class:this.classes(Ta.fileLabel,Xo.button,Xo.buttonSecondary)},this.messages.changeFile,er("input",{bind:this,class:Ta.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,S=er("fieldset",{class:Ta.metadataFieldset,key:"size"},er("label",null,yun(this.messagesUnits,c??0))),I=er("fieldset",{class:Ta.metadataFieldset,key:"content-type"},er("label",null,l)),R=h!=null?er("a",{class:Ta.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),er("div",{class:Ta.itemLinkOverlay},er("span",{class:Ta.itemLinkOverlayIcon},er("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),L=er("form",{afterCreate:jat,afterRemoved:Bat,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:k=>this._submitUpdateAttachment(k,e)},er("div",{class:Ta.metadata},S,I),w,er("div",{class:Ta.actions},p,v,m));return er("div",{class:Ta.formNode,key:"edit-form-container"},R,L)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:r}=this.viewModel,n=Jun(t),s={[Ta.itemImageResizable]:r};return er("div",{class:this.classes(Ta.itemMaskIcon,Ta.itemMask),key:n},er("img",{alt:e,class:this.classes(s,Ta.itemImage),src:n,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:r}=this.viewModel;if(!e)return null;const{contentType:n,name:s,url:o}=e;if(!r||!U0t(n))return this._renderGenericImageMask(s,n);const a=this._getCSSTransform(e),l=a?{transform:a,"image-orientation":"none"}:{},u=`${o}${o?.includes("?")?"&":"?"}w=${t}`,c={[Ta.itemImageResizable]:r};return er("div",{class:this.classes(Ta.itemMask),key:u},er("img",{alt:s,class:this.classes(c,Ta.itemImage),src:u,styles:l,title:s}))}_renderFile(e){const{file:t}=e;return er("li",{class:Ta.item,key:t},er("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:Ta.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),er("label",{class:Ta.itemLabel},er("span",{class:Ta.itemFilename},t.name||this.messages.noTitle),er("span",{"aria-hidden":"true",class:this.classes(Ta.itemChevronIcon,nk(this.container)?i0.left:i0.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:r,effectiveDisplayType:n}=this,{capabilities:s,supportsResizeAttachments:o}=r,{contentType:a,name:l,url:u}=e,c=this._renderImageMask(e,t==="list"?48:400),h=s.editing?er("span",{"aria-hidden":"true",class:this.classes(Ta.itemChevronIcon,nk(this.container)?i0.left:i0.right)}):null,p=[c,n==="preview"&&o&&U0t(a)?null:er("label",{class:Ta.itemLabel},er("span",{class:Ta.itemFilename},l||this.messages.noTitle),h)],m=s.editing?er("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:Ta.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},p):er("a",{class:Ta.itemButton,href:u??void 0,key:"details-link",target:"_blank"},p);return er("li",{class:Ta.item,key:e},m)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:r}=this,{attachmentInfos:n,capabilities:s,fileInfos:o}=t,a=!!n?.length,l=!!o?.length,u={[Ta.containerList]:e!=="preview",[Ta.containerPreview]:e==="preview"},c=s.editing&&s.operations?.add&&r.addButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonTertiary,Ta.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},er("span",{"aria-hidden":"true",class:this.classes(Ta.itemAddIcon,i0.plus)}),this.messages.add):void 0,h=a?er("ul",{class:Ta.items,key:"attachments-list"},n.toArray().map(v=>this._renderAttachmentInfo({attachmentInfo:v,displayType:e}))):void 0,p=l?er("ul",{class:Ta.items,key:"file-list"},o.toArray().map(v=>this._renderFile(v))):void 0,m=l||a?void 0:er("div",{class:Xo.empty},this.messages.noAttachments);return er("div",{class:this.classes(Ta.container,u),key:"attachments-container"},h,p,m,c)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,r=t.files?.item(0);this._set("selectedFile",r)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};x([D()],ev.prototype,"capabilities",null),x([D()],ev.prototype,"displayType",void 0),x([D({readOnly:!0})],ev.prototype,"effectiveDisplayType",null),x([D()],ev.prototype,"graphic",null),x([D()],ev.prototype,"label",null),x([D(),Sg("esri/widgets/Attachments/t9n/Attachments")],ev.prototype,"messages",void 0),x([D(),Sg("esri/core/t9n/Units")],ev.prototype,"messagesUnits",void 0),x([D({readOnly:!0})],ev.prototype,"selectedFile",void 0),x([D({readOnly:!0})],ev.prototype,"submitting",void 0),x([D({readOnly:!0})],ev.prototype,"error",void 0),x([D({type:EKe})],ev.prototype,"viewModel",void 0),x([D()],ev.prototype,"visibleElements",void 0),x([So("visibleElements")],ev.prototype,"castVisibleElements",null),ev=x([Qe("esri.widgets.Attachments")],ev);const Kun=ev;let lte=class extends EKe{constructor(e){super(e),this.description=null,this.title=null}};x([D()],lte.prototype,"description",void 0),x([D()],lte.prototype,"title",void 0),lte=x([Qe("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],lte);const IKe=lte;function AKe({level:i,class:e,...t},r){const n=Zun(i);return er(`h${n}`,{...t,"aria-level":String(n),class:v4t(Xo.heading,e),role:"heading"},r)}function Zun(i){return uu(Math.ceil(i),1,6)}const UPe="esri-feature-element-info",zPe={base:UPe,title:`${UPe}__title`,description:`${UPe}__description`};let VU=class extends my{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return er("div",{class:zPe.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?er(AKe,{class:zPe.title,level:this.headingLevel},e):null}_renderDescription(){const{description:e}=this;return e?er("div",{class:zPe.description,key:"description"},e):null}};x([D()],VU.prototype,"description",void 0),x([D()],VU.prototype,"headingLevel",void 0),x([D()],VU.prototype,"title",void 0),VU=x([Qe("esri.widgets.Feature.support.FeatureElementInfo")],VU);const zCe=VU,Qun={base:"esri-feature-attachments"};let kI=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Kun,this.headingLevel=2,this.viewModel=new IKe}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),js),Ki(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,js)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return er("div",{class:Qun.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:r}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:r})}};x([D({readOnly:!0})],kI.prototype,"attachmentsWidget",void 0),x([D()],kI.prototype,"description",null),x([D()],kI.prototype,"displayType",null),x([D()],kI.prototype,"graphic",null),x([D()],kI.prototype,"headingLevel",void 0),x([D()],kI.prototype,"title",null),x([D({type:IKe})],kI.prototype,"viewModel",void 0),kI=x([Qe("esri.widgets.Feature.FeatureAttachments")],kI);const ecn=kI;let W4=class extends un{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(Ki(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},js))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:r}=this;e&&t&&(ewe(r,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const r=ewe(e,{graphic:t}).catch(()=>null);this._loadingPromise=r,this.notifyChange("state");const n=await r;r===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",n))}};x([D({readOnly:!0})],W4.prototype,"created",void 0),x([D()],W4.prototype,"creator",void 0),x([D()],W4.prototype,"destroyer",void 0),x([D({type:Us})],W4.prototype,"graphic",void 0),x([D({readOnly:!0})],W4.prototype,"state",null),W4=x([Qe("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],W4);const twe=W4;function vqt(i){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const t=e._delegatedEventNames,r=Array.isArray(i)?i:tcn(i);t.push(...r)}}function tcn(i){return i.split(",").map(e=>e.trim())}function _qt(i){return i&&typeof i.render=="function"}function icn(i){return i&&typeof i.postMixInProperties=="function"&&typeof i.buildRendering=="function"&&typeof i.postCreate=="function"&&typeof i.startup=="function"}const VPe="esri-feature-content",HPe={base:VPe,loaderContainer:`${VPe}__loader-container`,loader:`${VPe}__loader`};let HU=class extends my{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=r=>{Array.from(r.querySelectorAll("a")).forEach(n=>{uqt(n.href)&&!n.hasAttribute("target")&&n.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return er("div",{class:HPe.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return er("div",{class:HPe.loaderContainer,key:"loader"},er("div",{class:HPe.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?er("div",{afterCreate:this._attachToNode,bind:e,key:e}):_qt(e)?er("div",{key:e},!e.destroyed&&e.render()):er("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};x([D()],HU.prototype,"creator",null),x([D()],HU.prototype,"graphic",null),x([D({type:twe})],HU.prototype,"viewModel",void 0),HU=x([Qe("esri.widgets.Feature.FeatureContent")],HU);const Nye=HU;let yO=class extends un{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,r=[];return t?.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const s=n.clone();s.label=cqt(s,e),r.push(s)}),r}};x([D()],yO.prototype,"attributes",void 0),x([D({type:[o1e]})],yO.prototype,"expressionInfos",void 0),x([D()],yO.prototype,"description",void 0),x([D({type:[dae]})],yO.prototype,"fieldInfos",void 0),x([D({readOnly:!0})],yO.prototype,"formattedFieldInfos",null),x([D()],yO.prototype,"title",void 0),yO=x([Qe("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],yO);const VCe=yO,rcn=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function ncn(i,e){if(typeof e!="string"||!e)return e;const t=rcn.find(l=>l.pattern.test(e));if(!t)return e;const r=e.match(t.pattern),n=r&&r[2],s=m0(m0(t.label,{messages:i,hierPart:n}),{appName:t.appName}),o=t.target?` target="${t.target}"`:"",a=t.target==="_blank"?' rel="noreferrer"':"";return e.replace(t.pattern,`${s}`)}const ppe="esri-feature-fields",fpe={base:ppe,fieldHeader:`${ppe}__field-header`,fieldData:`${ppe}__field-data`,fieldDataDate:`${ppe}__field-data--date`};let KT=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new VCe,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new zCe,this.addHandles(Ki(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),js))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return er("div",{class:fpe.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:r}=this.viewModel,n=e.fieldName,s=e.label||n,o=r?r[n]==null?"":r[n]:"",a=!(!e.format||!e.format.dateFormat),l=typeof o=="number"&&!a?this._forceLTR(o):ncn(this.messagesURIUtils,o),u={[fpe.fieldDataDate]:a};return er("tr",{key:`fields-element-info-row-${n}-${t}`},er("th",{class:fpe.fieldHeader,innerHTML:s,key:`fields-element-info-row-header-${n}-${t}`}),er("td",{class:this.classes(fpe.fieldData,u),innerHTML:l,key:`fields-element-info-row-data-${n}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?er("table",{class:Xo.table,summary:this.messages.fieldsSummary},er("tbody",null,e.map((t,r)=>this._renderFieldInfo(t,r)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};x([D()],KT.prototype,"attributes",null),x([D()],KT.prototype,"description",null),x([D()],KT.prototype,"expressionInfos",null),x([D()],KT.prototype,"fieldInfos",null),x([D()],KT.prototype,"title",null),x([D({type:VCe,nonNullable:!0})],KT.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],KT.prototype,"messages",void 0),x([D(),Sg("esri/widgets/support/t9n/uriUtils")],KT.prototype,"messagesURIUtils",void 0),KT=x([Qe("esri.widgets.Feature.FeatureFields")],KT);const bqt=KT,scn=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ocn={maximumFractionDigits:20};function acn(i){return DS(i,ocn)}const lcn="<",ucn=">";function ccn(i,e,t,r){let n="";return e===0?n=`${lcn} `:e===t&&(n=`${ucn} `),n+acn(i)}const hcn=new jr([64,64,64]);function dcn(i,e){const t=[],r=i.length-1;return i.length===5?t.push(0,2,4):t.push(0,r),i.map((n,s)=>t.includes(s)?ccn(n,s,r):null)}async function pcn(i,e,t){let r=!1,n=[],s=[];if(i.stops){const u=i.stops;n=u.map(c=>c.value),r=u.some(c=>!!c.label),r&&(s=u.map(c=>c.label))}const o=n[0],a=n[n.length-1];if(o==null&&a==null)return null;const l=r?null:dcn(n);return(await Promise.all(n.map(async(u,c)=>({value:u,color:i.type==="opacity"?await fcn(u,i):(await Promise.resolve().then(()=>L2e)).getColor(i,u),label:r?s[c]:l?.[c]??""})))).reverse()}async function fcn(i,e,t){const r=new jr(hcn),n=(await Promise.resolve().then(()=>L2e)).getOpacity(e,i);return n!=null&&(r.a=n),r}function mcn(i){if(!i.colorStops)return[];const e=[...i.colorStops].filter(r=>r.color?.a>0);let t=e.length-1;if(e&&e[0]){const r=e[t];r&&r.ratio!==1&&(e.push(new Eie({ratio:1,color:r.color})),t++)}return e.map((r,n)=>{let s="";return n===0?s=i.legendOptions?.minLabel||"low":n===t&&(s=i.legendOptions?.maxLabel||"high"),{color:r.color,label:s,ratio:r.ratio}}).reverse()}async function uw(i,e,t){qh(i,e,()=>[]).push(...t)}async function gcn(i){const e=new Map;if(!i)return e;if("visualVariables"in i&&i.visualVariables){const t=i.visualVariables.filter(r=>r.type==="color");for(const r of t){const n=(await pcn(r)??[]).map(s=>s.color);await uw(e,r.field||r.valueExpression,n)}}if(i.type==="heatmap"){const t=mcn(i).map(r=>r.color);await uw(e,i.field||i.valueExpression,t)}else if(i.type==="pie-chart"){for(const t of i.attributes)await uw(e,t.field||t.valueExpression,[t.color]);await uw(e,"default",[i?.othersCategory?.color,hj(i.backgroundFillSymbol,null)])}else if(i.type==="dot-density"){for(const t of i.attributes)await uw(e,t.field||t.valueExpression,[t.color]);await uw(e,"default",[i.backgroundColor])}else if(i.type==="unique-value")if(i.authoringInfo?.type==="predominance")for(const t of i.uniqueValueInfos??[])await uw(e,t.value.toString(),[hj(t.symbol,null)]);else{const t=(i.uniqueValueInfos??[]).map(a=>hj(a.symbol,null)),{field:r,field2:n,field3:s,valueExpression:o}=i;(r||o)&&await uw(e,r||o,t),n&&await uw(e,n,t),s&&await uw(e,s,t)}else if(i.type==="class-breaks"){const t=i.classBreakInfos.map(s=>hj(s.symbol,null)),{field:r,valueExpression:n}=i;await uw(e,r??n,t)}else i.type==="simple"&&await uw(e,"default",[hj(i.symbol,null)]);return"defaultSymbol"in i&&i.defaultSymbol&&await uw(e,"default",[hj(i.defaultSymbol,null)]),e.forEach((t,r)=>{const n=DUe(t.filter(Boolean),(s,o)=>JSON.stringify(s)===JSON.stringify(o));e.set(r,n)}),e}const ycn="esri.widgets.Feature.support.relatedFeatureUtils",V0t=()=>di.getLogger(ycn),H0t=new Map;function $ye(i){if(!TP(i))return null;const[e,t]=i.split("/").slice(1);return{layerId:e,fieldName:t}}function vcn(i,e){if(!e.relationships)return null;let t=null;const{relationships:r}=e;return r.some(n=>n.id===parseInt(i,10)&&(t=n,!0)),t}function _cn({originRelationship:i,relationships:e,layerId:t}){return e.find(({relatedTableId:r,id:n})=>`${r}`===t&&n===i?.id)??null}function bcn(i,e){const t=e.toLowerCase();for(const r in i)if(r.toLowerCase()===t)return i[r];return null}function wcn(i,e){const t=vcn(i,e);if(t)return{url:`${e.url}/${t.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:t,relatedFields:[],outStatistics:[]}}function xcn(i,e){if(!e||!i)return;const{features:t,statsFeatures:r}=i,n=t?.value;e.relatedFeatures=n?n.features:[];const s=r?.value;e.relatedStatsFeatures=s?s.features:[]}function Scn(i,e,t,r){const n=new p3;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[i.attributes[t.objectIdField]],t.queryRelatedFeatures?.(n,r)??Promise.resolve({})}function Tcn(i,e,t){let r=0;const n=[];for(;rJSON.stringify(e.toJSON())===JSON.stringify(t.toJSON())):void 0}async function Icn(i,e,t,r){const n=t.layerId.toString(),{layerInfo:s,relation:o,relatedFields:a,outStatistics:l,url:u,sourceSpatialReference:c}=e,h=Ccn(a),p=Ecn(l);if(!s||!o)return null;const m=_cn({originRelationship:o,relationships:s.relationships,layerId:n});if(m?.relationshipTableId&&m.keyFieldInRelationshipTable){const w=(await Scn(i,m,t,r))[i.attributes[t.objectIdField]];if(!w)return null;const S=w.features.map(I=>I.attributes[s.objectIdField]);if(p?.length&&s.supportsStatistics){const I=new Kn;I.where=Tcn(s.objectIdField,S,1e3),I.outFields=h,I.outStatistics=p,I.sourceSpatialReference=c;const R={features:Promise.resolve(w),statsFeatures:t9(u,I)};return g0(R)}}const v=m?.keyField;if(v){const w=wY(Rcn(s.fields,v)),S=bcn(i.attributes,o.keyField),I=w?`${v}=${S}`:`${v}='${S}'`,R=t9(u,new Kn({where:I,outFields:h,sourceSpatialReference:c}),r),L=p?.length&&s.supportsStatistics?t9(u,new Kn({where:I,outFields:h,outStatistics:p,sourceSpatialReference:c}),r):null,k={features:R};return L&&(k.statsFeatures=L),g0(k)}return null}function Acn(i,e){return zi(i,{query:{f:"json"},signal:e?.signal})}function Mcn({relatedInfos:i,layer:e},t){const r={};return i.forEach((n,s)=>{const{relation:o}=n;if(!o){const h=new qe("relation-required","A relation is required on a layer to retrieve related records.");throw V0t().error(h),h}const{relatedTableId:a}=o;if(typeof a!="number"){const h=new qe("A related table ID is required on a layer to retrieve related records.");throw V0t().error(h),h}const l=`${e.url}/${a}`,u=H0t.get(l),c=u??Acn(l);u||H0t.set(l,c),r[s]=c}),Jg(g0(r),t)}function Ocn({graphic:i,relatedInfos:e,layer:t},r){const n={};return e.forEach((s,o)=>{s.layerInfo&&(n[o]=Icn(i,s,t,r))}),g0(n)}function Pcn({relatedInfo:i,fieldName:e,fieldInfo:t}){if(i.relatedFields?.push(e),t.statisticType){const r=new y1e({statisticType:t.statisticType,onStatisticField:e,outStatisticFieldName:e});i.outStatistics?.push(r)}}function Rcn(i,e){if(i!=null){e=e.toLowerCase();for(const t of i)if(t&&t.name.toLowerCase()===e)return t}return null}const W0t={chartAnimation:!0};let Jf=class extends un{constructor(e){super(e),this.abilities={...W0t},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...W0t,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,r=(e+t)%t;this.activeMediaInfoIndex=r}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,r=t+e;this._setContentElementMedia(r)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,r=this.attributes??{},n=this.formattedAttributes??{},s=this.expressionAttributes??{},o=this.fieldInfoMap??new Map;return e?.map(a=>{const l=a?.clone();if(!l)return null;if(l.title=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.title}),l.caption=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.caption}),l.altText=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.altText}),l.type==="image"){const{value:u}=l;return this._setImageValue({value:u,formattedAttributes:n,layer:t}),l.value.sourceURL?l:void 0}if(l.type==="pie-chart"||l.type==="line-chart"||l.type==="column-chart"||l.type==="bar-chart"){const{value:u}=l;return this._setChartValue({value:u,chartType:l.type,attributes:r,formattedAttributes:n,layer:t,expressionAttributes:s}),l}return null}).filter(Ga)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:r,formattedAttributes:n,layer:s}=e,{linkURL:o,sourceURL:a}=r;if(a){const l=p7e(a,s);r.sourceURL=d7e({formattedAttributes:n,template:l,fieldInfoMap:t})}if(o){const l=p7e(o,s);r.linkURL=d7e({formattedAttributes:n,template:l,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:r,formattedAttributes:n,chartType:s,layer:o,expressionAttributes:a}=e,{popupTemplate:l,relatedInfos:u}=this,{fields:c,normalizeField:h}=t,p=o;if(t.fields=Mun(c,p),h&&(t.normalizeField=moe(h,p)),!c.some(v=>!!(n[v]!=null||TP(v)&&u?.size)))return;const m=l?.fieldInfos??[];c.forEach((v,w)=>{const S=t.colors?.[w];if(TP(v))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:m,fieldName:v,formattedAttributes:n,chartType:s,value:t,color:S})]);const I=this._getChartOption({value:t,attributes:r,chartType:s,formattedAttributes:n,expressionAttributes:a,fieldName:v,fieldInfos:m,color:S});t.series.push(I)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:r,formattedAttributes:n,chartType:s,value:o,color:a}=e,l=[],u=$ye(r),c=u&&this.relatedInfos?.get(u.layerId.toString());if(!c)return l;const{relatedFeatures:h,relation:p}=c;if(!p||!h)return l;const{cardinality:m}=p;return h.forEach(v=>{const{attributes:w}=v;w&&Object.keys(w).forEach(S=>{S===u.fieldName&&l.push(this._getChartOption({value:o,attributes:w,formattedAttributes:n,fieldName:r,chartType:s,relatedFieldName:S,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:a}))})}),m==="one-to-many"||m==="many-to-many"?l:[l[0]]}_getTooltip({label:e,value:t,chartType:r}){return r==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:r,formattedAttributes:n,expressionAttributes:s,fieldName:o,relatedFieldName:a,fieldInfos:l,chartType:u,hasMultipleRelatedFeatures:c,color:h}=e,p=this.layer,m=this.fieldInfoMap??new Map,{normalizeField:v,tooltipField:w}=t,S=v?TP(v)?r[$ye(v).fieldName]:r[v]:null,I=SKe(o)&&s&&s[o]!==void 0?s[o]:a&&r[a]!==void 0?r[a]:r[o]!==void 0?r[o]:n[o],R=new KAt({fieldName:o,color:h,value:I===void 0?null:I&&S?I/S:I});if(TP(o)){const V=m.get(o.toLowerCase()),Y=w&&m.get(w.toLowerCase()),K=V?.fieldName??o,Q=c&&w?$ye(w).fieldName:Y?.fieldName??w,re=c&&Q?r[Q]:n[Q]??V?.label??V?.fieldName??a,ne=c&&a?r[a]:n[K];return R.tooltip=this._getTooltip({label:re,value:ne,chartType:u}),R}const L=pqt(l,o),k=moe(o,p),B=w&&n[w]!==void 0?n[w]:cqt(L||new dae({fieldName:k}),this.popupTemplate?.expressionInfos),$=n[k];return R.tooltip=this._getTooltip({label:B,value:$,chartType:u}),R}};x([D()],Jf.prototype,"abilities",void 0),x([So("abilities")],Jf.prototype,"castAbilities",null),x([D()],Jf.prototype,"activeMediaInfoIndex",void 0),x([D({readOnly:!0})],Jf.prototype,"activeMediaInfo",null),x([D()],Jf.prototype,"attributes",void 0),x([D()],Jf.prototype,"description",void 0),x([D()],Jf.prototype,"fieldInfoMap",void 0),x([D()],Jf.prototype,"formattedAttributes",void 0),x([D()],Jf.prototype,"expressionAttributes",void 0),x([D({readOnly:!0})],Jf.prototype,"formattedMediaInfos",null),x([D()],Jf.prototype,"isAggregate",void 0),x([D()],Jf.prototype,"layer",void 0),x([D({readOnly:!0})],Jf.prototype,"formattedMediaInfoCount",null),x([D()],Jf.prototype,"mediaInfos",void 0),x([D()],Jf.prototype,"popupTemplate",void 0),x([D()],Jf.prototype,"relatedInfos",void 0),x([D()],Jf.prototype,"title",void 0),Jf=x([Qe("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],Jf);const M8=Jf,jf="esri-feature-media",n1={base:jf,mediaContainer:`${jf}__container`,mediaItemContainer:`${jf}__item-container`,mediaItem:`${jf}__item`,mediaItemText:`${jf}__item-text`,mediaItemTitle:`${jf}__item-title`,mediaItemCaption:`${jf}__item-caption`,mediaNavigation:`${jf}__item-navigation`,mediaPagination:`${jf}__pagination`,mediaPaginationText:`${jf}__pagination-text`,mediaPrevious:`${jf}__previous`,mediaPreviousIconLTR:`${jf}__previous-icon`,mediaPreviousIconRTL:`${jf}__previous-icon--rtl`,mediaNext:`${jf}__next`,mediaNextIconLTR:`${jf}__next-icon`,mediaNextIconRTL:`${jf}__next-icon--rtl`,mediaChart:`${jf}__chart`,mediaPaginationButton:`${jf}__pagination-button`,mediaPaginationIcon:`${jf}__pagination-icon`,mediaChartRendered:`${jf}__chart--rendered`},WPe=15,GD="category",OK="value",Dcn="rgba(50, 50, 50, 1)",Fcn=250,kcn=500,Lcn=200;let f1=class extends my{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new M8,this.messages=null,this._disposeChart=r=>{this._chartRootMap.get(r)?.dispose(),this._chartRootMap.delete(r)},this._createChart=async r=>{const{destroyed:n,viewModel:s}=this;if(n||!s||!r)return;const{createRoot:o}=await Promise.resolve().then(()=>yHn),a=await o(r);this._chartRootMap.set(r,a),this._renderChart({mediaInfo:s.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),js),Ki(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),js)])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return er("div",{bind:this,class:n1.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,r=this._renderMediaText();return e?er("div",{class:n1.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),er("div",{class:n1.mediaNavigation},r,e>1?er("div",{class:n1.mediaPagination},this._renderMediaPageButton("previous"),er("span",{class:n1.mediaPaginationText},xC(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?er("div",{class:n1.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,r=e&&e.caption?er("div",{class:n1.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||r?er("div",{class:n1.mediaItemText,key:"media-text"},t,r):null}_renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:r,formattedMediaInfoCount:n}=this.viewModel,{value:s,refreshInterval:o,altText:a,title:l,type:u}=e,{sourceURL:c,linkURL:h}=s,p=uqt(h??void 0)?"_blank":"_self",m=p==="_blank"?"noreferrer":"",v=o?t:null,w=v?v.timestamp:0,S=v?v.sourceURL:c,I=er("img",{alt:a||l,key:`media-${u}-${r}-${n}-${w}`,src:S??void 0});return(h?er("a",{href:h,rel:m,target:p,title:l},I):null)??I}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:r}=this.viewModel;return er("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:n1.mediaChart,key:`media-${e.type}-${t}-${r}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?er("div",{class:n1.mediaItemContainer,key:"media-container"},er("div",{class:n1.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",r=t?this.messages.previous:this.messages.next,n=t?"chevron-left":"chevron-right",s=t?"media-previous":"media-next",o=t?this._previous:this._next;return er("button",{"aria-label":r,bind:this,class:n1.mediaPaginationButton,key:s,onclick:o,tabIndex:0,title:r,type:"button"},er("calcite-icon",{class:n1.mediaPaginationIcon,icon:n,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await Promise.resolve().then(()=>WD),r=new Map;return e.forEach(n=>{n.color&&r.set(n,t(n.color.toCss(!0)))}),r}async _getRendererColors(){const{colorAm5:e}=await Promise.resolve().then(()=>WD),t=new Map,r=this._getRenderer(),n="default";if(!r)return t;const s=await gcn(r);return s.delete(n),Array.from(s.values()).every(o=>o?.length===1)&&Array.from(s.keys()).forEach(o=>{const a=s.get(o)?.[0]?.toCss(!0);a&&t.set(o,e(a))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!scn()}_getChartAnimationMS(){return this._canAnimateChart()?Fcn:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?kcn:0}async _renderChart(e){const{root:t,mediaInfo:r}=e,{value:n,type:s}=r,{ResponsiveThemeAm5:o,DarkThemeAm5:a,AnimatedThemeAm5:l,ColorSetAm5:u,ThemeAm5:c,esriChartColorSet:h}=await Promise.resolve().then(()=>WD),p=c.new(t);p.rule("ColorSet").set("colors",h),p.rule("ColorSet").set("reuse",!0);const m=[o.new(t),p];L5t()&&m.push(a.new(t)),this._canAnimateChart()&&m.push(l.new(t)),t.setThemes(m);const v=await this._getRendererColors(),w=await this._getSeriesColors(n.series),S=u.new(t,{}),I=w.get(n.series[0]),R=I?{lineSettings:{stroke:I}}:void 0,L=n.series.map((k,B)=>{const $=w.get(k)||v.get(k.fieldName)||S.getIndex(B);return{[GD]:k.tooltip,[OK]:k.value,columnSettings:{fill:$,stroke:$},...R}}).filter(k=>s!=="pie-chart"||k.value!=null&&k.value>0);s==="pie-chart"?this._createPieChart(e,L):this._createXYChart(e,L)}_getDirection(){return nk(this.container)?"rtl":"ltr"}_isInversed(){return!!nk(this.container)}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:r}=await Promise.resolve().then(()=>WD);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:r(Dcn)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:Lcn})}async _createPieChart(e,t){const{TooltipAm5:r}=await Promise.resolve().then(()=>WD),{PieChartAm5:n,PieSeriesAm5:s}=await Promise.resolve().then(()=>BHn),{mediaInfo:o,root:a}=e,{title:l}=o,u=5,c=o?.altText||o?.title||"",h=a.container.children.push(n.new(a,{ariaLabel:c,focusable:!0,paddingBottom:u,paddingTop:u,paddingLeft:u,paddingRight:u})),p=`{category}: {valuePercentTotal.formatNumber('0.00')}% - ({value})`,m=r.new(a,{labelText:p}),v=h.series.push(s.new(a,{name:l,valueField:OK,categoryField:GD,tooltip:m}));v.ticks.template.set("forceHidden",!0),v.labels.template.set("forceHidden",!0),v.slices.template.states.create("active",{shiftRadius:u}),this._customizeChartTooltip(m),v.slices.template.setAll({ariaLabel:p,focusable:!0,templateField:"columnSettings"}),v.data.setAll(t),v.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(n1.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(r=>t=Math.min(r.value,t)),t}async _createColumnChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,ColumnSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{mediaInfo:h,root:p}=t,{value:m,title:v}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(o.new(p,{renderer:a.new(p,{inversed:this._isInversed()}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.yAxes.push(l.new(p,{renderer:u.new(p,{inside:!1}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryX}",R=n.new(p,{labelText:I}),L=e.series.push(c.new(p,{name:v,xAxis:w,yAxis:S,valueYField:OK,categoryXField:GD,tooltip:R}));this._customizeChartTooltip(R),L.columns.template.setAll({ariaLabel:I,focusable:!0,templateField:"columnSettings"}),m.series.length>WPe&&e.set("scrollbarX",s.new(p,{orientation:"horizontal"})),w.data.setAll(r),L.data.setAll(r),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,ColumnSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{mediaInfo:h,root:p}=t,{value:m,title:v}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const w=e.yAxes.push(o.new(p,{renderer:u.new(p,{inversed:!0}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.xAxes.push(l.new(p,{renderer:a.new(p,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryY}",R=n.new(p,{labelText:I}),L=e.series.push(c.new(p,{name:v,xAxis:S,yAxis:w,valueXField:OK,categoryYField:GD,tooltip:R}));this._customizeChartTooltip(R,"vertical"),L.columns.template.setAll({ariaLabel:I,focusable:!0,templateField:"columnSettings"}),m.series.length>WPe&&e.set("scrollbarY",s.new(p,{orientation:"vertical"})),w.data.setAll(r),L.data.setAll(r),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,LineSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{root:h,mediaInfo:p}=t,{value:m,title:v}=p;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(o.new(h,{renderer:a.new(h,{inversed:this._isInversed()}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.yAxes.push(l.new(h,{renderer:u.new(h,{inside:!1}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryX}",R=r[0]?.lineSettings?.stroke,L=n.new(h,{getFillFromSprite:!R,labelText:I});R&&L.get("background")?.setAll({fill:R});const k=e.series.push(c.new(h,{name:v,xAxis:w,yAxis:S,valueYField:OK,categoryXField:GD,tooltip:L}));k.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(L,"vertical"),m.series.length>WPe&&e.set("scrollbarX",s.new(h,{orientation:"horizontal"})),w.data.setAll(r),k.data.setAll(r),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:r,XYCursorAm5:n}=await Promise.resolve().then(()=>_fe),{root:s,mediaInfo:o}=e,{type:a}=o,l=o?.altText||o?.title||"",u=s.container.children.push(r.new(s,{ariaLabel:l,focusable:!0,panX:!0,panY:!0}));u.set("cursor",n.new(s,{})),a==="column-chart"&&await this._createColumnChart(u,e,t),a==="bar-chart"&&await this._createBarChart(u,e,t),a==="line-chart"&&await this._createLineChart(u,e,t),u.root.dom.classList.toggle(n1.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:r}=e;if(!t)return;const n=6e4*t;this._updateMediaInfoTimestamp(r.sourceURL);const s=setInterval(()=>{this._updateMediaInfoTimestamp(r.sourceURL)},n);this._refreshTimer=s}_getImageSource(e,t){const r=e.includes("?")?"&":"?",[n,s=""]=e.split("#");return`${n}${r}timestamp=${t}${s?"#":""}${s}`}};x([D()],f1.prototype,"_refreshIntervalInfo",void 0),x([D()],f1.prototype,"attributes",null),x([D()],f1.prototype,"activeMediaInfoIndex",null),x([D()],f1.prototype,"description",null),x([D()],f1.prototype,"fieldInfoMap",null),x([D()],f1.prototype,"layer",null),x([D()],f1.prototype,"mediaInfos",null),x([D()],f1.prototype,"popupTemplate",null),x([D()],f1.prototype,"relatedInfos",null),x([D()],f1.prototype,"title",null),x([D({type:M8})],f1.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],f1.prototype,"messages",void 0),f1=x([Qe("esri.widgets.Feature.FeatureMedia")],f1);const wqt=f1,Ncn="esri.widgets.Feature.support.arcadeFeatureUtils",q0t=()=>di.getLogger(Ncn);function $cn(i){return typeof i=="string"?Ble(CKe(i)):Array.isArray(i)?Bcn(i):i?.declaredClass==="esri.arcade.Dictionary"?jcn(i):i}function Bcn(i){return`
    ${i.map(e=>`
  • ${typeof e=="string"?Ble(CKe(e)):e}
  • `).join("")}
`}function jcn(i){const e=i.keys().map(t=>{const r=i.field(t);return`${t}${typeof r=="string"?Ble(CKe(r)):r}`}).join("");return`${e}
`}function xqt(){return Promise.resolve().then(()=>JHn)}function Gcn(i){return"createQuery"in i&&"queryFeatures"in i}async function Ucn({graphic:i,view:e,options:t}){const{isAggregate:r,layer:n}=i;if(!r||!n||e?.type!=="2d")return[];const s=await e.whenLayerView(n);if(!Gcn(s))return[];const o=s.createQuery(),a=i.getObjectId();o.aggregateIds=a!=null?[a]:[];const{features:l}=await s.queryFeatures(o,t);return l}function zcn({layer:i,aggregatedFeatures:e,interceptor:t}){const{fields:r,objectIdField:n,geometryType:s,spatialReference:o,displayField:a}=i;return new yh({fields:r,objectIdField:n,geometryType:s,spatialReference:o,displayField:a,interceptor:t,...i.type==="feature"?{templates:i.templates,typeIdField:i.typeIdField,types:i.types}:null,source:e})}async function Sqt({expressionInfo:i,arcade:e,interceptor:t,spatialReference:r,map:n,graphic:s,location:o,view:a,options:l}){if(!i?.expression)return null;const{isAggregate:u}=s,c=(s.sourceLayer||s.layer)??void 0,h=u?"feature-reduction-popup":"popup",p=e.createArcadeProfile(h),m=e.createArcadeExecutor(i.expression,p).catch(L=>q0t().error("arcade-executor-error",{error:L,expressionInfo:i})),[v,w]=await Promise.all([Ucn({graphic:s,view:a,options:l}),m]);if(!w)return null;const S=h==="feature-reduction-popup"?zcn({layer:c,aggregatedFeatures:v,interceptor:t}):void 0,I={...h==="feature-reduction-popup"?{$aggregatedFeatures:S}:{$datastore:c?.url,$layer:c?.type==="feature"||c?.type==="subtype-sublayer"?c:c?.type==="scene"&&c.associatedLayer!=null?c.associatedLayer:void 0,$map:n,$userInput:o,$graph:c?.type==="knowledge-graph-sublayer"?c?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},R={abortSignal:l?.signal??void 0,interceptor:t??void 0,rawOutput:!0,spatialReference:r??void 0,timeZone:a?.timeZone};return await w.executeAsync(I,R).catch(L=>q0t().error("arcade-execution-error",{error:L,graphic:s,expressionInfo:i})).finally(()=>S?.destroy())}async function Vcn({expressionInfos:i,spatialReference:e,graphic:t,interceptor:r,map:n,view:s,location:o,options:a}){if(!i?.length)return{};const l=await xqt(),u={};for(const p of i)u[`expression/${p.name}`]=Sqt({expressionInfo:p,arcade:l,interceptor:r,spatialReference:e,map:n,graphic:t,location:o,view:s,options:a});const c=await g0(u),h={};for(const p in c)h[p]=$cn(c[p].value);return h}const Hcn=1;let z_=class extends un{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const r=t==="fields"?new VCe:t==="media"?new M8:t==="text"?new twe:null;this._set("contentElementViewModel",r)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Qbe(this._compile,Hcn,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:r,interceptor:n,spatialReference:s,map:o,location:a,view:l,_abortController:u}=this;if(!t||!r)return void this._set("contentElement",null);const c=await xqt();if(u!==this._abortController)return;const h=await Sqt({arcade:c,expressionInfo:t,graphic:r,location:a,interceptor:n,map:o,spatialReference:s,view:l});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const p=await h.castAsJsonAsync(u?.signal),m=p?.type,v=m==="media"?One.fromJSON(p):m==="text"?yW.fromJSON(p):m==="fields"?gW.fromJSON(p):null;this._set("contentElement",v)},this.addHandles([Ki(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),js),Ki(()=>[this.contentElement],()=>this._createVM(),js)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:r}=this;return e?"loading":t||r?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};x([D()],z_.prototype,"_abortController",void 0),x([D({type:JAt})],z_.prototype,"expressionInfo",void 0),x([D({type:Us})],z_.prototype,"graphic",void 0),x([D({readOnly:!0})],z_.prototype,"contentElement",void 0),x([D({readOnly:!0})],z_.prototype,"contentElementViewModel",void 0),x([D()],z_.prototype,"interceptor",void 0),x([D({type:$i})],z_.prototype,"location",void 0),x([D()],z_.prototype,"spatialReference",null),x([D({readOnly:!0})],z_.prototype,"state",null),x([D()],z_.prototype,"map",null),x([D()],z_.prototype,"view",void 0),z_=x([Qe("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],z_);const MKe=z_,qPe="esri-feature",YPe={base:`${qPe}-expression`,loadingSpinnerContainer:`${qPe}__loading-container`,spinner:`${qPe}__loading-spinner`};let Bye=class extends my{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new MKe}initialize(){this.addHandles(Ki(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),js))}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return er("div",{class:YPe.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return er("div",{class:YPe.loadingSpinnerContainer,key:"loading-container"},er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,YPe.spinner)}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,r=t?.type;this._destroyContentWidget();const n=e?r==="fields"?new bqt({viewModel:e}):r==="media"?new wqt({viewModel:e}):r==="text"?new Nye({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};x([D({type:MKe})],Bye.prototype,"viewModel",void 0),Bye=x([Qe("esri.widgets.Feature.FeatureExpression")],Bye);const Wcn=Bye;var Y0t;(function(i){i.TOO_SHORT="length-validation-error::too-short"})(Y0t||(Y0t={}));const qcn=i=>{const e=[];if(i.formTemplate){const{description:t,title:r}=i.formTemplate;i.fields?.forEach(n=>{const s=r&&Git(r,n.name),o=t&&Git(t,n.name);(s||o)&&e.push(n.name)})}return e},XPe=100;let Ac=class extends xs(iT(un)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await NP(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await NP(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await NP(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=xd(this._queryController,XPe),this._queryFeatureCountDebounced=xd(this._queryFeatureCountController,XPe),this._queryPageDebounced=xd(this._queryPageController,XPe),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:r}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,r.removeAll(),this.destroyed||r.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([Ki(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),js),Ki(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),Ki(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,n=1,s=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,n),s))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{const n=r.clone();return n.field=moe(r.field,t),n}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new dr}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;return e?.loaded&&t&&r?Xun(t,e,r)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return typeof e=="number"?t?.relationships?.find(({id:r})=>r===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new dr}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:n,_loaded:s,canLoad:o}=this;return t||o&&!s?"loading":e||r?"querying":n?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach(e=>!e.destroyed&&e.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:r,objectId:n,_queryFeatureCountAbortController:s,canQuery:o,supportsCacheHint:a}=this;if(await e?.load(),await t?.load(),!o||!e||!t)return void this._set("featureCount",0);const l=t.createQuery(),u=new p3({cacheHint:a,relationshipId:r,returnGeometry:!1,objectIds:[n],where:l.where??void 0}),c=await e.queryRelatedFeaturesCount(u,{signal:s?.signal});this._set("featureCount",c[n]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:n,featureCount:s}=this;!r||t<2||!s||e.addMany(await this._queryRelatedFeatures({signal:n?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:r,featuresPerPage:n,displayCount:s,layer:o,relationshipId:a,featurePage:l,featureCount:u,relatedLayer:c,supportsCacheHint:h}=this,{canQuery:p,objectId:m}=this;if(!p||!o||!c)return[];const v=r?((l-1)*n+u)%u:0,w=r?n:s,S=c.objectIdField,I=[...t.map(V=>V.field),...qcn(c),S].filter(Ga),R=t.map(V=>`${V.field} ${V.order}`),L=c.createQuery(),k=new p3({orderByFields:R,start:v,num:w,outFields:I,cacheHint:h,relationshipId:a,returnGeometry:!1,objectIds:[m],where:L.where??void 0}),B=await o.queryRelatedFeatures(k,{signal:e?.signal}),$=B[m]?.features||[];return $.forEach(V=>{V.sourceLayer=c,V.layer=c}),$}};x([D()],Ac.prototype,"_loaded",void 0),x([D()],Ac.prototype,"_queryAbortController",void 0),x([D()],Ac.prototype,"_queryPageAbortController",void 0),x([D()],Ac.prototype,"_queryFeatureCountAbortController",void 0),x([D({value:1})],Ac.prototype,"featurePage",null),x([D()],Ac.prototype,"featuresPerPage",void 0),x([D({readOnly:!0})],Ac.prototype,"orderByFieldsFixedCasing",null),x([D({readOnly:!0})],Ac.prototype,"supportsCacheHint",null),x([D({readOnly:!0})],Ac.prototype,"canLoad",null),x([D({readOnly:!0})],Ac.prototype,"canQuery",null),x([D()],Ac.prototype,"description",void 0),x([D({readOnly:!0})],Ac.prototype,"itemDescriptionFieldName",null),x([D({value:3})],Ac.prototype,"displayCount",null),x([D({type:Us})],Ac.prototype,"graphic",void 0),x([D()],Ac.prototype,"layer",void 0),x([D()],Ac.prototype,"map",void 0),x([D({readOnly:!0})],Ac.prototype,"objectId",null),x([D({readOnly:!0})],Ac.prototype,"objectIdField",null),x([D()],Ac.prototype,"orderByFields",void 0),x([D({readOnly:!0})],Ac.prototype,"relatedFeatures",null),x([D({readOnly:!0})],Ac.prototype,"relatedLayer",null),x([D({readOnly:!0})],Ac.prototype,"relationship",null),x([D()],Ac.prototype,"featureCount",void 0),x([D({readOnly:!0})],Ac.prototype,"relatedFeatureViewModels",null),x([D()],Ac.prototype,"relationshipId",void 0),x([D()],Ac.prototype,"showAllEnabled",void 0),x([D()],Ac.prototype,"state",null),x([D()],Ac.prototype,"title",void 0),Ac=x([Qe("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Ac);const OKe=Ac,ute="esri-feature",PK=`${ute}-relationship`,DM={base:PK,listContainer:`${PK}__list`,listItem:`${PK}__list-item`,listItemHidden:`${PK}__list-item--hidden`,listContainerQuerying:`${PK}__list--querying`,featureObserver:`${ute}__feature-observer`,stickySpinnerContainer:`${ute}__sticky-loading-container`,loadingSpinnerContainer:`${ute}__loading-container`,spinner:`${ute}__loading-spinner`},X0t={title:!0,description:!0};let m1=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([r])=>{r?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new OKe,this.messages=null,this.messagesCommon=null,this.visibleElements={...X0t},this._increaseFeaturePage=()=>{const{state:r,showAllEnabled:n,relatedFeatures:s,featuresPerPage:o,featurePage:a}=this.viewModel;r==="ready"&&n&&s.length>=o*a&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),js),Ki(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),ju(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe),list:()=>Promise.resolve().then(()=>Lii),"list-item":()=>Promise.resolve().then(()=>Gii),notice:()=>Promise.resolve().then(()=>wZe)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=zo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:r,state:n}=this.viewModel;return!e&&!!t&&n==="ready"&&(t>r||r===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return xC(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...X0t,...e}}render(){const{state:e}=this.viewModel;return er("div",{class:this.classes(DM.base,Xo.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_renderStickyLoading(){return this.viewModel.state==="querying"?er("div",{class:DM.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,DM.spinner)})}_renderLoading(){return er("div",{class:DM.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return er("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=nk(this.container)?"chevron-left":"chevron-right";return er("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,r=e.title;e.description=t&&e.formattedAttributes?.global[t];const n=e.state==="loading";return er("calcite-list-item",{class:this.classes(DM.listItem,{[DM.listItemHidden]:n}),description:e.description??"",key:e.uid,label:r,onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?er("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return er("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},er("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return er("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:DM.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return er("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return er("div",{class:this.classes(DM.listContainer,{[DM.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return er("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},er("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(r=>{this.addHandles(Ki(()=>[r.title,r.state],()=>this.scheduleRender(),js),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,r=t.description&&this.description,n=t.title&&this.title;this._featureElementInfo?.set({description:r,title:n,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await jk(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};x([D()],m1.prototype,"_relatedFeatureIntersectionObserverNode",void 0),x([D({readOnly:!0})],m1.prototype,"displayShowAllButton",null),x([D({readOnly:!0})],m1.prototype,"displayListItems",null),x([D()],m1.prototype,"description",null),x([D({readOnly:!0})],m1.prototype,"featureCountDescription",null),x([D()],m1.prototype,"headingLevel",void 0),x([D()],m1.prototype,"title",null),x([D({type:OKe})],m1.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],m1.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],m1.prototype,"messagesCommon",void 0),x([D()],m1.prototype,"visibleElements",void 0),x([So("visibleElements")],m1.prototype,"castVisibleElements",null),m1=x([Qe("esri.widgets.Feature.FeatureRelationship")],m1);const J0t=m1;let Ycn=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=r=>{}),this.preRequestCallback||(this.preLayerQueryCallback=r=>{})}};var cte;const Xcn=1,K0t="content-view-models",Z0t="relationship-view-models",Q0t={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let dh=cte=class extends iT(un){constructor(i){super(i),this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Qbe(this._graphicChanged,Xcn,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...Q0t},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:t}=this;return e.type==="attachments"&&!!t.attachmentsContent||e.type==="custom"&&!!t.customContent||e.type==="fields"&&!!t.fieldsContent||e.type==="media"&&!!t.mediaContent||e.type==="text"&&!!t.textContent||e.type==="expression"&&!!t.expressionContent||e.type==="relationship"&&!!t.relationshipContent},this.addHandles(Ki(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),js))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return Uun(N0t(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return lqt(this.graphic)}castAbilities(i){return{...Q0t,...i}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(i){this._set("graphic",i?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(i){this._override("spatialReference",i)}get timeZone(){return this.view?.timeZone??RS}set timeZone(i){this._overrideIfSome("timeZone",i)}get map(){return this.view?.map||null}set map(i){this._override("map",i)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(i,e){const t=this.contentViewModels[i];t instanceof M8&&t.setActiveMedia(e)}nextMedia(i){const e=this.contentViewModels[i];e instanceof M8&&e.next()}previousMedia(i){const e=this.contentViewModels[i];e instanceof M8&&e.previous()}async updateGeometry(){const{graphic:i,spatialReference:e,_sourceLayer:t}=this;await t?.load();const r=t?.objectIdField;if(!r||!i||!t)return;const n=i?.attributes?.[r];if(n==null)return;const s=[n];if(!i.geometry){const o=await mqt({layer:t,graphic:i,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:e}),a=o?.geometry;a&&(i.geometry=a)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:i}=this;if(!i)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(t){mo(t)||(this._error=t,di.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:t,graphic:i,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:i}=this;i&&i.abort(),this._featureAbortController=null}_compileContentElement(i,e){return i.type==="attachments"?this._compileAttachments(i,e):i.type==="custom"?this._compileCustom(i,e):i.type==="fields"?this._compileFields(i,e):i.type==="media"?this._compileMedia(i,e):i.type==="text"?this._compileText(i,e):i.type==="expression"?this._compileExpression(i,e):i.type==="relationship"?this._compileRelationship(i,e):void 0}_compileContent(i){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(i)?i.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(Ga):typeof i=="string"?this._compileText(new yW({text:i}),0).text:i}_destroyContentViewModels(){this.removeHandles(Z0t),this.removeHandles(K0t),this.contentViewModels.forEach(i=>i&&!i.destroyed&&i.destroy()),this._set("contentViewModels",[])}_matchesFeature(i,e){const t=i?.graphic?.getObjectId(),r=e?.getObjectId();return t!=null&&r!=null&&t===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:i,relatedFeatures:e,map:t}){const{view:r,spatialReference:n}=this;e?.filter(Boolean).forEach(s=>{i.some(o=>this._matchesFeature(o,s))||i.add(new cte({abilities:{relationshipContent:!1},map:t,view:r,spatialReference:n,graphic:s}))}),i.forEach(s=>{e?.find(a=>this._matchesFeature(s,a))||i.remove(s)})}_setExpressionContentVM(i,e){const t=this.formattedAttributes,{contentElement:r,contentElementViewModel:n}=i,s=r?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:t}),n.set(this._createFieldsVMParams(r,e))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:t}),n.set(this._createMediaVMParams(r,e))),s==="text"&&n.set(this._createTextVMParams(r)))}_compileRelationship(i,e){const{displayCount:t,orderByFields:r,relationshipId:n,title:s,description:o}=i,{_sourceLayer:a,graphic:l,map:u}=this;if(!dqt(a))return;const c=new OKe({displayCount:t,graphic:l,orderByFields:r,relationshipId:n,layer:a,map:u,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[e]=c,this.addHandles(ju(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),Z0t),i}_compileExpression(i,e){const{expressionInfo:t}=i,{graphic:r,map:n,spatialReference:s,view:o,location:a}=this,l=new MKe({expressionInfo:t,graphic:r,interceptor:cte.interceptor,map:n,spatialReference:s,view:o,location:a});return this.contentViewModels[e]=l,this.addHandles(Ki(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,e),js),K0t),i}_compileAttachments(i,e){const{graphic:t}=this,{description:r,title:n}=i;return this.contentViewModels[e]=new IKe({graphic:t,...this._compileTitleAndDesc({title:n,description:r})}),i}_compileCustom(i,e){const{graphic:t}=this,{creator:r,destroyer:n}=i;return this.contentViewModels[e]=new twe({graphic:t,creator:r,destroyer:n}),i}_compileTitleAndDesc({title:i,description:e}){const{_fieldInfoMap:t,_sourceLayer:r,graphic:n,formattedAttributes:s}=this,o=n?.attributes,a=this._expressionAttributes,l=s.global;return{title:A8({attributes:o,fieldInfoMap:t,globalAttributes:l,expressionAttributes:a,layer:r,text:i}),description:A8({attributes:o,fieldInfoMap:t,globalAttributes:l,expressionAttributes:a,layer:r,text:e})}}_createFieldsVMParams(i,e){const t=this._effectivePopupTemplate,r=this.formattedAttributes,n={...r?.global,...r?.content[e]},s=i?.fieldInfos||t?.fieldInfos,o=s?.filter(({fieldName:c})=>SKe(c)||TP(c)||n.hasOwnProperty(c)),a=t?.expressionInfos,{description:l,title:u}=i;return{attributes:n,expressionInfos:a,fieldInfos:o,...this._compileTitleAndDesc({title:u,description:l})}}_compileFields(i,e){const t=i.clone(),r=new VCe(this._createFieldsVMParams(i,e));return this.contentViewModels[e]=r,t.fieldInfos=r.formattedFieldInfos.slice(0),t}_createMediaVMParams(i,e){const{abilities:t,graphic:r,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:o,_sourceLayer:a,_expressionAttributes:l}=this,u=this.formattedAttributes,c=r?.attributes??{},{description:h,mediaInfos:p,title:m}=i;return{abilities:{chartAnimation:t.chartAnimation},activeMediaInfoIndex:i.activeMediaInfoIndex||0,attributes:c,isAggregate:r?.isAggregate,layer:a,fieldInfoMap:n,formattedAttributes:{...u?.global,...u?.content[e]},expressionAttributes:l,mediaInfos:p,popupTemplate:s,relatedInfos:o,...this._compileTitleAndDesc({title:m,description:h})}}_compileMedia(i,e){const t=i.clone(),r=new M8(this._createMediaVMParams(i,e));return t.mediaInfos=r.formattedMediaInfos.slice(0),this.contentViewModels[e]=r,t}_createTextVMParams(i){const{graphic:e,_fieldInfoMap:t,_sourceLayer:r,_expressionAttributes:n}=this;if(i&&i.text){const s=e?.attributes??{},o=this.formattedAttributes?.global??{};i.text=A8({attributes:s,fieldInfoMap:t,globalAttributes:o,expressionAttributes:n,layer:r,text:i.text})}return{graphic:e,creator:i.text}}_compileText(i,e){const t=i.clone();return this.contentViewModels[e]=new twe(this._createTextVMParams(t)),t}_compileLastEditInfo(){const{_effectivePopupTemplate:i,_sourceLayer:e,graphic:t,timeZone:r}=this;if(!i)return;const{lastEditInfoEnabled:n}=i,s=e?.editFieldsInfo;return n&&s?Gun(s,t?.attributes,r,e):void 0}_compileTitle(i){const{_fieldInfoMap:e,_sourceLayer:t,graphic:r,_expressionAttributes:n}=this,s=r?.attributes??{},o=this.formattedAttributes?.global??{};return A8({attributes:s,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:t,text:i})}async _getTitle(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i?.title;return ewe(t,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i?.content;return ewe(t,{graphic:e})}async _queryFeature(i){const{_featureAbortController:e,_sourceLayer:t,graphic:r,_effectivePopupTemplate:n}=this,s=this.map,o=this.view,a=this.spatialReference,l=this.location;if(e!==this._featureAbortController||!r)return;await Vun({graphic:r,popupTemplate:n,layer:t,spatialReference:a},i);const{content:{value:u},title:{value:c}}=await g0({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:h}}=await g0({checkForRelatedFeatures:this._checkForRelatedFeatures(i),expressionAttributes:Vcn({expressionInfos:n?.expressionInfos,spatialReference:a,graphic:r,map:s,interceptor:cte.interceptor,view:o,options:i,location:l})});e===this._featureAbortController&&r&&(this._expressionAttributes=h,this._graphicExpressionAttributes={...r.attributes,...h},this._set("formattedAttributes",this._createFormattedAttributes(u)),this._set("title",this._compileTitle(c)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(u)||null))}_createMediaFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){const{_effectivePopupTemplate:r,graphic:n,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l,timeZone:u}=this;t.content[e]=jPe({fieldInfos:r?.fieldInfos,graphic:n,attributes:{...l,...i.attributes},layer:o,fieldInfoMap:a,relatedInfos:s,timeZone:u})}_createFieldsFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){if(i.fieldInfos){const{graphic:r,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:l}=this;t.content[e]=jPe({fieldInfos:i.fieldInfos,graphic:r,attributes:{...a,...i.attributes},layer:s,fieldInfoMap:o,relatedInfos:n,timeZone:l})}}_createFormattedAttributes(i){const{_effectivePopupTemplate:e,graphic:t,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:o,timeZone:a}=this,l=e?.fieldInfos,u={global:jPe({fieldInfos:l,graphic:t,attributes:o,layer:n,fieldInfoMap:s,relatedInfos:r,timeZone:a}),content:[]};return Array.isArray(i)&&i.forEach((c,h)=>{c.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:u}),c.type==="media"&&this._createMediaFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:u})}),u}_checkForRelatedFeatures(i){const{graphic:e,_effectivePopupTemplate:t}=this;return this._queryRelatedInfos(e,N0t(t),i)}async _queryRelatedInfos(i,e,t){const{relatedInfos:r,_sourceLayer:n}=this;r.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(t):n;if(!s||!i||!e.filter(u=>u&&TP(u.fieldName))?.length)return;e.forEach(u=>this._configureRelatedInfo(u,s));const a=await Mcn({relatedInfos:r,layer:s},t);Object.keys(a).forEach(u=>{const c=r.get(u.toString()),h=a[u]?.value;c&&h&&(c.layerInfo=h.data)});const l=await Ocn({graphic:i,relatedInfos:r,layer:s},t);Object.keys(l).forEach(u=>{xcn(l[u]?.value,r.get(u.toString()))})}_configureRelatedInfo(i,e){const{relatedInfos:t}=this,r=$ye(i.fieldName);if(!r)return;const{layerId:n,fieldName:s}=r;if(!n)return;const o=t.get(n.toString())||wcn(n,e);o&&(Pcn({relatedInfo:o,fieldName:s,fieldInfo:i}),this.relatedInfos.set(n,o))}};dh.interceptor=new Ycn(qun,Yun),x([D()],dh.prototype,"_error",void 0),x([D()],dh.prototype,"_featureAbortController",void 0),x([D({readOnly:!0})],dh.prototype,"_effectivePopupTemplate",null),x([D({readOnly:!0})],dh.prototype,"_fieldInfoMap",null),x([D({readOnly:!0})],dh.prototype,"_sourceLayer",null),x([D()],dh.prototype,"abilities",void 0),x([So("abilities")],dh.prototype,"castAbilities",null),x([D({readOnly:!0})],dh.prototype,"content",void 0),x([D({readOnly:!0})],dh.prototype,"contentViewModels",void 0),x([D()],dh.prototype,"description",void 0),x([D({type:Boolean})],dh.prototype,"defaultPopupTemplateEnabled",void 0),x([D({readOnly:!0})],dh.prototype,"isTable",null),x([D({readOnly:!0})],dh.prototype,"state",null),x([D({readOnly:!0})],dh.prototype,"formattedAttributes",void 0),x([D({type:Us,value:null})],dh.prototype,"graphic",null),x([D({readOnly:!0})],dh.prototype,"lastEditInfo",void 0),x([D({type:$i})],dh.prototype,"location",void 0),x([D({readOnly:!0})],dh.prototype,"relatedInfos",void 0),x([D()],dh.prototype,"spatialReference",null),x([D()],dh.prototype,"timeZone",null),x([D({readOnly:!0})],dh.prototype,"title",void 0),x([D()],dh.prototype,"map",null),x([D({readOnly:!0})],dh.prototype,"waitingForContent",null),x([D()],dh.prototype,"view",void 0),dh=cte=x([Qe("esri.widgets.Feature.FeatureViewModel")],dh);const PKe=dh,Bg="esri-feature",op={base:Bg,container:`${Bg}__size-container`,title:`${Bg}__title`,main:`${Bg}__main-container`,btn:`${Bg}__button`,icon:`${Bg}__icon`,content:`${Bg}__content`,contentNode:`${Bg}__content-node`,contentNodeText:`${Bg}__content-node--text`,contentElement:`${Bg}__content-element`,text:`${Bg}__text`,lastEditedInfo:`${Bg}__last-edited-info`,fields:`${Bg}__fields`,fieldHeader:`${Bg}__field-header`,fieldData:`${Bg}__field-data`,fieldDataDate:`${Bg}__field-data--date`,loadingSpinnerContainer:`${Bg}__loading-container`,spinner:`${Bg}__loading-spinner`},Tqt=i=>{let e=class extends i{constructor(){super(...arguments),this.renderNodeContent=t=>_qt(t)&&!t.destroyed?er("div",{class:op.contentNode,key:t},t.render()):t instanceof HTMLElement?er("div",{afterCreate:this._attachToNode,bind:t,class:op.contentNode,key:t}):icn(t)?er("div",{afterCreate:this._attachToNode,bind:t.domNode,class:op.contentNode,key:t}):null}_attachToNode(t){const r=this;t.appendChild(r)}};return e=x([Qe("esri.widgets.Feature.ContentMixin")],e),e};var f7e;const evt={title:!0,content:!0,lastEditedInfo:!0},tvt="relationship-handles";let Hm=f7e=class extends Tqt(my){constructor(i,e){super(i,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...evt},this.viewModel=new PKe}initialize(){this.addHandles(Ki(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),js))}loadDependencies(){return Y3({notice:()=>Promise.resolve().then(()=>wZe)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(i){this.viewModel.graphic=i}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(i){this.viewModel.defaultPopupTemplateEnabled=i}get isTable(){return this.viewModel.isTable}get label(){return this.messages?.widgetLabel??""}set label(i){this._overrideIfSome("label",i)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(i){this.viewModel.spatialReference=i}get timeZone(){return this.viewModel.timeZone}set timeZone(i){this.viewModel.timeZone=i}get title(){return this.viewModel.title}castVisibleElements(i){return{...evt,...i}}get map(){return this.viewModel.map}set map(i){this.viewModel.map=i}get view(){return this.viewModel.view}set view(i){this.viewModel.view=i}setActiveMedia(i,e){return this.viewModel.setActiveMedia(i,e)}nextMedia(i){return this.viewModel.nextMedia(i)}previousMedia(i){return this.viewModel.previousMedia(i)}render(){const{state:i}=this.viewModel,e=er("div",{class:op.container,key:"container"},this._renderTitle(),i==="error"?this._renderError():i==="loading"?this._renderLoading():this._renderContentContainer());return er("div",{class:this.classes(op.base,Xo.widget)},e)}_renderError(){const{messagesCommon:i,messages:e,visibleElements:t}=this;return er("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},t.title?er("div",{key:"error-title",slot:"title"},i.errorMessage):null,er("div",{key:"error-message",slot:"message"},e.loadingError))}_renderLoading(){return er("div",{class:op.loadingSpinnerContainer,key:"loading-container"},er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,op.spinner)}))}_renderContentContainer(){const{visibleElements:i}=this;return i.content?er("div",{class:op.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:i,title:e}=this;return i.title?er(AKe,{class:op.title,innerHTML:e,level:this.headingLevel}):null}_renderContent(){const i=this.viewModel.content,e="content";if(!i)return null;if(Array.isArray(i))return i.length?er("div",{class:op.contentNode,key:`${e}-content-elements`},i.map(this._renderContentElement,this)):null;if(typeof i=="string"){const t=this._contentWidgets[0];return!t||t.destroyed?null:er("div",{class:this.classes(op.contentNode,op.contentNodeText),key:`${e}-content`},t.render())}return this.renderNodeContent(i)}_renderContentElement(i,e){const{visibleElements:t}=this;if(typeof t.content!="boolean"&&!t.content?.[i.type])return null;switch(i.type){case"attachments":return this._renderAttachments(e);case"custom":return this._renderCustom(i,e);case"fields":return this._renderFields(e);case"media":return this._renderMedia(e);case"text":return this._renderText(i,e);case"expression":return this._renderExpression(e);case"relationship":return this._renderRelationship(e);default:return null}}_renderAttachments(i){const e=this._contentWidgets[i];if(!e||e.destroyed)return null;const{state:t,attachmentInfos:r}=e.viewModel;return t==="loading"||r.length>0?er("div",{class:this.classes(op.contentElement),key:this._buildKey("attachments-element",i)},e.render()):null}_renderRelationship(i){const e=this._contentWidgets[i];return e&&!e.destroyed&&this.flowItems?er("div",{class:op.contentElement,key:this._buildKey("relationship-element",i)},e.render()):null}_renderExpression(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("expression-element",i)},e.render())}_renderCustom(i,e){const{creator:t}=i,r=this._contentWidgets[e];return!r||r.destroyed?null:t?er("div",{class:op.contentElement,key:this._buildKey("custom-element",e)},r.render()):null}_renderFields(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("fields-element",i)},e.render())}_renderMedia(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("media-element",i)},e.render())}_renderLastEditInfo(){const{visibleElements:i,messages:e}=this,{lastEditInfo:t}=this.viewModel;if(!t||!i.lastEditedInfo)return null;const{date:r,user:n}=t,s=t.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=xC(s,{date:r,user:n});return er("div",{class:this.classes(op.lastEditedInfo,op.contentElement),key:"edit-info-element"},o)}_renderText(i,e){const t=i.text,r=this._contentWidgets[e];return!r||r.destroyed?null:t?er("div",{class:this.classes(op.contentElement,op.text),key:this._buildKey("text-element",e)},r.render()):null}_buildKey(i,...e){return`${i}__${this.viewModel?.graphic?.uid||"0"}-${e.join("-")}`}_destroyContentWidget(i){i&&(i.viewModel=null,!i.destroyed&&i.destroy())}_destroyContentWidgets(){this.removeHandles(tvt),this._contentWidgets.forEach(i=>this._destroyContentWidget(i)),this._contentWidgets=[]}_addFeatureRelationshipHandles(i){const{flowItems:e,visibleElements:t}=this;this.addHandles([ju(()=>i,"select-record",({featureViewModel:r})=>{e&&(r.abilities={relationshipContent:!0},e.push(new f7e({flowItems:e,viewModel:r,visibleElements:t})))}),ju(()=>i,"show-all-records",()=>{if(!e)return;const{viewModel:r}=i;r.showAllEnabled=!0;const n=new J0t({visibleElements:{title:!1,description:!1},viewModel:r});this._addFeatureRelationshipHandles(n),e.push(n)})],tvt)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:i,visibleElements:e}=this,t=this.viewModel?.content,{contentViewModels:r}=this.viewModel;if(Array.isArray(t))t.forEach((n,s)=>{if(n.type==="attachments"&&(this._contentWidgets[s]=new ecn({displayType:n.displayType,headingLevel:e.title?i+1:i,viewModel:r[s]})),n.type==="fields"&&(this._contentWidgets[s]=new bqt({viewModel:r[s]})),n.type==="media"&&(this._contentWidgets[s]=new wqt({viewModel:r[s]})),n.type==="text"&&(this._contentWidgets[s]=new Nye({viewModel:r[s]})),n.type==="custom"&&(this._contentWidgets[s]=new Nye({viewModel:r[s]})),n.type==="expression"&&(this._contentWidgets[s]=new Wcn({viewModel:r[s]})),n.type==="relationship"){const o=new J0t({viewModel:r[s]});this._addFeatureRelationshipHandles(o),this._contentWidgets[s]=o}},this);else{const n=r[0];n&&!n.destroyed&&(this._contentWidgets[0]=new Nye({viewModel:n}))}this.scheduleRender()}};x([D()],Hm.prototype,"graphic",null),x([D()],Hm.prototype,"defaultPopupTemplateEnabled",null),x([D()],Hm.prototype,"flowItems",void 0),x([D()],Hm.prototype,"headingLevel",void 0),x([D({readOnly:!0})],Hm.prototype,"isTable",null),x([D()],Hm.prototype,"label",null),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],Hm.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],Hm.prototype,"messagesCommon",void 0),x([D()],Hm.prototype,"spatialReference",null),x([D()],Hm.prototype,"timeZone",null),x([D({readOnly:!0})],Hm.prototype,"title",null),x([D()],Hm.prototype,"visibleElements",void 0),x([So("visibleElements")],Hm.prototype,"castVisibleElements",null),x([D()],Hm.prototype,"map",null),x([D()],Hm.prototype,"view",null),x([D({type:PKe})],Hm.prototype,"viewModel",void 0),Hm=f7e=x([Qe("esri.widgets.Feature")],Hm);const Jcn=Hm;let q$=class extends rd.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([v0(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),Ki(()=>this.screenLocation,(t,r)=>{t!=null&&r!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:r}=this,n=t?.spatialReference,s=n?kx(e,n).geometry:null;return r&&s&&t?.ready?t.toScreen(s):null}};x([D()],q$.prototype,"location",void 0),x([D()],q$.prototype,"screenLocation",null),x([D()],q$.prototype,"screenLocationEnabled",void 0),x([D()],q$.prototype,"view",void 0),q$=x([Qe("esri.widgets.support.AnchorElementViewModel")],q$);const Cqt=q$,Kcn="esri.widgets.CompassViewModel";let jye=class extends Cqt{constructor(e){super(e),this.visible=!1}};x([D()],jye.prototype,"visible",void 0),jye=x([Qe(Kcn)],jye);const Eqt=jye,JPe="esri-spinner",KPe={base:JPe,spinnerStart:`${JPe}--start`,spinnerFinish:`${JPe}--finish`};let Y$=class extends my{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Eqt}initialize(){this.addHandles(Ki(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:r}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const n=()=>this.hide();r&&r.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,r=!!t,n=e&&r,s=!e&&r,o={[KPe.spinnerStart]:n,[KPe.spinnerFinish]:s},a=this._getPositionStyles();return er("div",{class:this.classes(KPe.base,o),styles:a})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=jk(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:r}=t;return{left:e.x-r.left+"px",top:e.y-r.top+"px"}}};x([D()],Y$.prototype,"location",null),x([D()],Y$.prototype,"view",null),x([D({type:Eqt})],Y$.prototype,"viewModel",void 0),x([D()],Y$.prototype,"visible",null),Y$=x([Qe("esri.widgets.Spinner")],Y$);const Zcn=Y$,N0="esri-features",Wg={icon:`${N0}__icon`,actionImage:`${N0}__action-image`,base:N0,container:`${N0}__container`,contentContainer:`${N0}__content-container`,contentFeature:`${N0}__content-feature`,flowItemCollapsed:`${N0}__flow-item--collapsed`,header:`${N0}__header`,footer:`${N0}__footer`,featureMenuObserver:`${N0}__feature-menu-observer`,actionExit:`${N0}__action--exit`,loader:`${N0}__loader`,featuresHeading:`${N0}__heading`,paginationActionBar:`${N0}__pagination-action-bar`,paginationPrevious:`${N0}__pagination-previous`,paginationNext:`${N0}__pagination-next`};let X$=class extends my{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenRelatedFeature=r=>{this.emit("open-related-feature",{feature:r})}}loadDependencies(){return Y3({action:()=>Promise.resolve().then(()=>Uii),"flow-item":()=>Promise.resolve().then(()=>ari)})}render(){const{flowItems:e}=this,t=e?.toArray();return er(V1r,null,t?.map(r=>this._renderRelatedRecordsFlowItem(r)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleRelatedRecordsBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_renderRelatedRecordsFlowItem(e){const{messages:t,closable:r,closed:n}=this,s="graphic"in e&&!e.isTable;return er("calcite-flow-item",{bind:this,closable:r,closed:n,description:this._getRelatedRecordsFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:o=>{o.preventDefault(),this._handleRelatedRecordsBackClick()},onCalciteFlowItemClose:this._handleCloseClick},er("calcite-action",{appearance:"transparent",bind:this,class:Wg.actionExit,icon:"move-up",key:"exit-related-records-action",label:t.exitRelatedRecords,onclick:this._handleExitClick,scale:"m",slot:"header-actions-start",text:t.exitRelatedRecords,title:t.exitRelatedRecords}),s?er("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-related-feature-action",label:t.selectFeature,onclick:()=>this._handleOpenRelatedFeature(e),scale:"m",slot:"header-actions-end",text:t.selectFeature,title:t.selectFeature}):null,er("div",{class:Wg.container},e.render()))}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}};x([D()],X$.prototype,"flowItems",void 0),x([D(),Sg("esri/widgets/Features/t9n/Features")],X$.prototype,"messages",void 0),x([D()],X$.prototype,"closed",void 0),x([D()],X$.prototype,"closable",void 0),X$=x([Qe("esri.widgets.Features.FeaturesRelatedRecords")],X$);const Qcn=X$;let ehn=class{constructor(e){this._observable=new pY,this._set=new Set(e)}get size(){return Ws(this._observable),this._set.size}add(e){const t=this._set.size;return this._set.add(e),this._set.size!==t&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(e){const t=this._set.delete(e);return t&&this._observable.notify(),t}entries(){return Ws(this._observable),this._set.entries()}forEach(e,t){Ws(this._observable),this._set.forEach((r,n)=>e.call(t,r,n,this),t)}has(e){return Ws(this._observable),this._set.has(e)}keys(){return Ws(this._observable),this._set.keys()}values(){return Ws(this._observable),this._set.values()}[Symbol.iterator](){return Ws(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}};const ivt="OBJECTID";var kB;(function(i){i[i.size=22]="size",i[i.lineWidth=50]="lineWidth",i[i.maxSize=120]="maxSize",i[i.maxOutlineSize=80]="maxOutlineSize",i[i.tallSymbolWidth=20]="tallSymbolWidth"})(kB||(kB={}));const rvt=yi("android");yi("chrome")||rvt&&rvt>=4;ANe();kB.size;kB.maxSize;kB.maxOutlineSize;kB.lineWidth;kB.tallSymbolWidth;function Iqt(i){return i&&"opacity"in i?i.opacity*Iqt(i.parent):1}async function nvt(i,e){if(!i)return;const t=i.sourceLayer,r=(e!=null&&e.useSourceLayer?t:i.layer)??t,n=Iqt(r);if(i.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const L=i.symbol.type==="web-style"?await Ulr(i.symbol,{...e,cache:e!=null?e.webStyleCache:null}):i.symbol.clone();return q3e(L,null,n),L}const s=e?.renderer??thn(r);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(i,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):o.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return q3e(o,null,n),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&e?.arcade==null){const L={...e};L.arcade=await e_(),e=L}const{getColor:a,getOpacity:l,getAllSizes:u,getRotationAngle:c}=await Promise.resolve().then(()=>L2e),h=[],p=[],m=[],v=[];for(const L of s.visualVariables)switch(L.type){case"color":h.push(L);break;case"opacity":p.push(L);break;case"rotation":v.push(L);break;case"size":L.target||m.push(L)}const w=!!h.length&&h[h.length-1],S=w?a(w,i,e):null,I=!!p.length&&p[p.length-1];let R=I?l(I,i,e):null;if(n!=null&&(R=R!=null?R*n:n),q3e(o,S,R),m.length){const L=u(m,i,e);await gRt(o,L)}for(const L of v)yRt(o,c(L,i,e),L.axis);return o}function thn(i){if(i)return"renderer"in i?i.renderer:void 0}function svt(i){return i&&typeof i.highlight=="function"}const v9=dr.ofType({key:"type",defaultKeyValue:"button",base:C2e,typeMap:{button:xY,toggle:Xze}}),O8=new xY({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:i0.zoomInMagnifyingGlass}),ovt=new xY({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:i0.trash}),pV=new xY({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:i0.zoomInMagnifyingGlass}),W5=new Xze({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:i0.table,value:!1}),ihn="esri.widgets.Popup.PopupViewModel",iwe=()=>di.getLogger(ihn),rhn=i=>{const{event:e,view:t,viewModel:r}=i,{action:n}=e;if(!n)return Promise.reject(new qe("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:o}=n;if(!o)return Promise.reject(new qe("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new qe("trigger-action:invalid-action","Action is disabled"));if(o===O8.id)return shn(r).catch(l3);if(o===pV.id)return ohn(r);if(o===W5.id)return r.browseClusterEnabled=!r.browseClusterEnabled,r.featureMenuOpen=r.browseClusterEnabled,Promise.resolve();if(o===ovt.id){r.visible=!1;const{selectedFeature:a}=r;if(!a)return Promise.reject(new qe(`trigger-action:${ovt.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):t?.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function Aqt(i){const{selectedFeature:e,location:t,view:r}=i;return r?e??t??null:null}function Y6(i){return!!i&&i.isAggregate&&i.sourceLayer?.featureReduction?.type==="cluster"}async function nhn(i,e){if(e?.type!=="3d"||!i||i.declaredClass!=="esri.Graphic")return!0;const t=e.getViewForGraphic(i);if(t&&"whenGraphicBounds"in t){let r=null;try{r=await t.whenGraphicBounds(i,{useViewElevation:!0})}catch{}return!r||!r.boundingBox||r.boundingBox[0]===r.boundingBox[3]&&r.boundingBox[1]===r.boundingBox[4]&&r.boundingBox[2]===r.boundingBox[5]}return!0}async function shn(i){const{location:e,selectedFeature:t,view:r,zoomFactor:n}=i,s=Aqt(i);if(!r||!s){const c=new qe("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:r});throw iwe().error(c),c}const o=r.scale/n,a=i.selectedFeature?.geometry,l=a??e,u=l!=null&&l.type==="point"&&await nhn(t,r);O8.active=!0,O8.disabled=!0;try{await i.zoomTo({target:{target:s,scale:u?o:void 0}})}catch{const h=new qe("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});iwe().error(h)}finally{O8.active=!1,O8.disabled=!1,i.zoomToLocation=null,u&&(i.location=l)}}async function ohn(i){const{selectedFeature:e,view:t}=i;if(t?.type!=="2d"){const o=new qe("zoomToCluster:invalid-view","View must be 2d MapView.",{view:t});throw iwe().error(o),o}if(!e||!Y6(e)){const o=new qe("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw iwe().error(o),o}const[r,n]=await RKe(t,e);pV.active=!0,pV.disabled=!0;const{extent:s}=await r.queryExtent(n);s&&await i.zoomTo({target:s}),pV.active=!1,pV.disabled=!1}async function ahn(i){const{view:e,selectedFeature:t}=i;if(!e||!t)return;const[r,n]=await RKe(e,t),{extent:s}=await r.queryExtent(n);i.selectedClusterBoundaryFeature.geometry=s,e.graphics.add(i.selectedClusterBoundaryFeature)}async function lhn(i){const{selectedFeature:e,view:t}=i;if(!t||!e)return;const[r,n]=await RKe(t,e);W5.active=!0,W5.disabled=!0;const{features:s}=await r.queryFeatures(n);W5.active=!1,W5.disabled=!1,W5.value=!0,i?.open({features:[e].concat(s),featureMenuOpen:!0})}async function RKe(i,e){const t=await i.whenLayerView(e.sourceLayer),r=t.createQuery(),n=e.getObjectId();return r.aggregateIds=n!=null?[n]:[],[t,r]}function uhn(i){W5.value=!1;const e=i.features.filter(t=>Y6(t));e.length&&(i.features=e)}const chn=()=>[O8.clone()],hhn=()=>[pV.clone(),W5.clone()];let mpe=null;function dhn(i,e){return i==="building-scene"||e==="2d"&&(i==="map-image"||i==="tile"||i==="imagery"||i==="imagery-tile")}let Pl=class extends dFt(Cqt){constructor(e){super(e),this._pendingPromises=new ehn,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this._locationScaleHandle=null,this.actions=new v9,this.activeFeature=null,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new Us({symbol:new Hx({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=xd(async t=>{const{view:r}=this,n=this.selectedFeature?.geometry?.type,s=this.location??t;if(n!=="mesh"&&r&&s&&this.selectedFeature)if(n!=="point")try{const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:s}),a=(await Promise.all(o)).flat().filter(Boolean);if(!a.length)return;if(a.length!==this.features.length){const h=this._getHighlightLayer(this.selectedFeature),p=h?.type==="imagery"?void 0:h&&"objectIdField"in h?h.objectIdField||ivt:null;if(p){const m=this.selectedFeature.getObjectId(),v=a.findIndex(w=>this._getHighlightLayer(w)?.uid===h?.uid&&w.attributes[p]===m);this.features=a,this.selectedFeatureIndex=v}}const l=a[this.selectedFeatureIndex]?.geometry,u=(l?.type!=="mesh"?l:null)??this.selectedFeature.geometry,c=u?Wc(u,r.spatialReference):null;if(!c)return;mpe||(mpe=await Promise.resolve().then(()=>I8n)),await mpe.intersects(c,s)||(this.location=(await mpe.nearestCoordinate(c,s)).coordinate??s)}catch(o){mo(o)||di.getLogger(this).error(o)}else this.location=h7e(this.selectedFeature.geometry)??s})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),Ki(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),Ki(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),Ki(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),Ki(()=>this.location,e=>this._locationChange(e)),Ki(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),Ki(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),Ki(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),Ki(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>rhn({event:e,viewModel:this,view:this.view})),v0(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Kl),Ki(()=>[this.features,this.view?.map,this.view?.spatialReference,this.view?.timeZone],()=>this._updateFeatureVMs()),Ki(()=>this.view?.scale,()=>this._viewScaleChange()),v0(()=>!this.visible,()=>this.browseClusterEnabled=!1),Ki(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this._locationScaleHandle?.remove(),this._locationScaleHandle=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new v9;e.removeAll();const{actions:t,defaultActions:r,defaultPopupTemplateEnabled:n,includeDefaultActions:s,selectedFeature:o}=this,a=s?r.concat(t):t,l=o&&(typeof o.getEffectivePopupTemplate=="function"&&o.getEffectivePopupTemplate(n)||o.popupTemplate),u=l?.actions;return(l?.overwriteActions?u:u?.concat(a)??a)?.filter(Boolean).forEach(h=>e.add(h)),e}get defaultActions(){const e=this._get("defaultActions")||new v9;return e.removeAll(),e.addMany(Y6(this.selectedFeature)?hhn():chn()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:r,promiseCount:n,selectedFeatureIndex:s}=this,o=n&&t.length;o&&r&&s===-1?this.selectedFeatureIndex=0:o&&s!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const r=this.view?.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&r&&(t=WC(e)),this._set("location",t)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice(0)).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,r)=>t.finally(()=>r.then(n=>{this._pendingPromises.has(r)&&this._updateFeatures(n)}).finally(()=>this._pendingPromises.delete(r)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.view?.ready?"ready":"disabled"}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Aqt(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new qe("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new qe("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:r}=t;delete t.fetchFeatures,r&&this._setFetchFeaturesPromises(t.location);const n=["actionsMenuOpen","collapsed"];for(const s of n)delete t[s];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){uhn(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Y6(t)?(await ahn(this),await lhn(this)):di.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):di.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(O8.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Ga);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Y6(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:r}=this;r&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:r,featuresPerPage:n,featureViewModels:s}=this;if(r===null)return;const o=((r-1)*n+t)%t,a=o+n;s.slice(o,a).forEach((l,u)=>{l&&(l.graphic??=e[o+u])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:r,view:n}=this;if(e&&n){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Y6(e)?void 0:(e.symbol=await nvt(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature));if(e.symbol=await nvt(e),!r&&t||!e.geometry){if(r&&!e.geometry){await this.centerAtLocation();const s=n.center?.clone();s&&(this.location=s)}}else this.location=h7e(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:r,view:n}=this;if(Y6(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const s=r.slice(0),o=[];t.forEach((a,l)=>{if(!a)return;let u=null;if(s.some((c,h)=>(c&&c.graphic===a&&(u=c,s.splice(h,1)),!!u)),u)o[l]=u;else{const c=new PKe({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n?.spatialReference,graphic:a===e?a:null,location:this.location,map:n?.map,view:n});o[l]=c}}),s.forEach(a=>a&&!a.destroyed&&a.destroy()),this._set("featureViewModels",o)}async _getScreenPoint(e,t){const{view:r}=this;await r?.when();const n=e?.spatialReference,s=r?.spatialReference;return n&&s?(await Lx(n,s,null,t),r.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:r,signal:n}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:n}),{signal:n,event:r})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:r}){this._cancelFetchingFeatures();const n=new AbortController,{signal:s}=n;this._fetchFeaturesController=n;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:r});return o.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:r}=e,{view:n}=this;this._locationScaleHandle?.remove(),this._locationScaleHandle=Ki(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(o=>{mo(o)||di.getLogger(this).error(o)}));const{pendingFeatures:s}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:r,event:e});n?.popup&&"open"in n.popup&&n.popup.open({location:t??void 0,promises:s})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:r}=e;return r&&"layer"in r&&r.layer?r.layer:r?.type==="map-notes"||r?.type==="subtype-group"?r:t}_getHighlightTarget(e,t,r){if(dhn(t.type,r))return e;const n=e.getObjectId();if(n!=null)return n;const s=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||ivt:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.view?.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:r,activeFeature:n,visible:s}=this;if(!(n&&r&&t&&s))return;const o=this._getHighlightLayer(n);if(!(o&&o instanceof Il&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(r,o);this._highlightActiveFeaturePromise=a;const l=await a;if(!(l&&svt(l)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(n,o,r.type));this.addHandles(u,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:r,view:n,visible:s}=this;if(!(t&&n&&r&&s))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof Il&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(n,o);this._highlightSelectedFeaturePromise=a;const l=await a;if(!(l&&svt(l)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const u=l.highlight(this._getHighlightTarget(t,o,n.type));this.addHandles(u,e)}_updateFeatures(e){const{features:t}=this,r=e.filter(n=>!t.includes(n));r?.length&&(this.features=t.concat(r))}};x([D()],Pl.prototype,"_fetchFeaturesController",void 0),x([D({type:v9})],Pl.prototype,"actions",void 0),x([D({readOnly:!0})],Pl.prototype,"active",null),x([D()],Pl.prototype,"activeFeature",void 0),x([D({readOnly:!0})],Pl.prototype,"allActions",null),x([D()],Pl.prototype,"autoCloseEnabled",void 0),x([D()],Pl.prototype,"autoOpenEnabled",void 0),x([D()],Pl.prototype,"browseClusterEnabled",void 0),x([D()],Pl.prototype,"content",void 0),x([D({type:v9,readOnly:!0})],Pl.prototype,"defaultActions",null),x([D({type:Boolean})],Pl.prototype,"defaultPopupTemplateEnabled",void 0),x([D({readOnly:!0})],Pl.prototype,"featureCount",null),x([D()],Pl.prototype,"featurePage",void 0),x([D({value:[]})],Pl.prototype,"features",null),x([D()],Pl.prototype,"featuresPerPage",void 0),x([D()],Pl.prototype,"featureMenuOpen",void 0),x([D()],Pl.prototype,"featureViewModelAbilities",void 0),x([D({readOnly:!0})],Pl.prototype,"featureViewModels",void 0),x([D()],Pl.prototype,"highlightEnabled",void 0),x([D()],Pl.prototype,"includeDefaultActions",void 0),x([D({type:$i})],Pl.prototype,"location",null),x([D({readOnly:!0})],Pl.prototype,"pendingPromisesCount",null),x([D({readOnly:!0})],Pl.prototype,"promiseCount",null),x([D()],Pl.prototype,"promises",null),x([D({readOnly:!0})],Pl.prototype,"selectedClusterBoundaryFeature",void 0),x([D({value:null,readOnly:!0})],Pl.prototype,"selectedFeature",null),x([D({value:-1})],Pl.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],Pl.prototype,"selectedFeatureViewModel",null),x([D({readOnly:!0})],Pl.prototype,"state",null),x([D()],Pl.prototype,"title",void 0),x([D()],Pl.prototype,"updateLocationEnabled",void 0),x([D()],Pl.prototype,"view",void 0),x([D()],Pl.prototype,"visible",void 0),x([D({readOnly:!0})],Pl.prototype,"waitingForContents",null),x([D({readOnly:!0})],Pl.prototype,"waitingForResult",null),x([D()],Pl.prototype,"zoomFactor",void 0),x([D()],Pl.prototype,"zoomToLocation",void 0),x([D()],Pl.prototype,"centerAtLocation",null),Pl=x([Qe("esri.widgets.Features.FeaturesViewModel")],Pl);const DKe=Pl;let LI=class extends un{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};x([D({type:Boolean,nonNullable:!0})],LI.prototype,"actionBar",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"closeButton",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"collapseButton",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"featureNavigation",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"flow",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"heading",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"spinner",void 0),LI=x([Qe("esri.widgets.Features.FeaturesVisibleElements")],LI);const Mqt=LI,avt="selected-index",phn=0,lvt="features-spinner",fhn=50;let mc=class extends Tqt(my){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([r])=>{r?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusOn=null,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new dr,this._relatedRecordsWidget=new Qcn({flowItems:this._relatedRecordsFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.icon=null,this.featureNavigationTop=!1,this.headerActions=new v9,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new DKe,this.visibleElements=new Mqt,this._renderAction=(r,n)=>{const s=this._getActionTitle(r),{type:o,active:a,uid:l,disabled:u,indicator:c}=r;return r.visible?er("calcite-action",{active:o==="toggle"&&r.value,appearance:"solid",bind:this,"data-action-uid":l,disabled:u,icon:this._getActionIcon(r),indicator:c,key:`action-${n}`,loading:a,onclick:this._triggerAction,scale:"s",text:s,title:this._hideActionText?s:void 0},this._getFallbackIcon(r)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusOn="menu-flow-item"},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusOn="root-flow-item",this.featureMenuOpen=!1)},this._focusFlowItemNode=r=>{this._focusOn===r&&requestAnimationFrame(async()=>{switch(r){case"menu-flow-item":await this._featureMenuViewportNode?.setFocus();break;case"root-flow-item":await this._rootFlowItemNode?.setFocus()}this._focusOn=null})},this._focusFlowItemNodeThrottled=Qbe(this._focusFlowItemNode,fhn),this._displaySpinnerThrottled=Qbe(()=>this._displaySpinner(),phn),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,this._focusFlowItemNodeThrottled,Ki(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),Ki(()=>this.viewModel?.active,r=>this._relatedRecordsWidget.closed=!r),Ki(()=>this.visibleElements?.closeButton,r=>this._relatedRecordsWidget.closable=r),Ki(()=>this.visibleElements?.spinner,r=>this._spinnerEnabledChange(r)),Ki(()=>this.viewModel?.view,(r,n)=>this._viewChange(r,n)),Ki(()=>this.viewModel?.view?.ready,(r,n)=>this._viewReadyChange(r??!1,n??!1)),Ki(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),Ki(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),Ki(()=>this.selectedFeatureWidget,()=>this._destroyRelatedRecordsFlowItemWidgets()),Ki(()=>{const r=this.selectedFeatureWidget?.viewModel;return[r?.title,r?.state]},()=>this._setTitleFromFeatureWidget()),Ki(()=>{const r=this.selectedFeatureWidget?.viewModel;return[r?.content,r?.state]},()=>this._setContentFromFeatureWidget()),Ki(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._relatedRecordsWidget.on("close",()=>this.close()),this._relatedRecordsWidget.on("exit",()=>this._destroyRelatedRecordsFlowItemWidgets()),this._relatedRecordsWidget.on("open-related-feature",({feature:r})=>this._openRelatedFeature(r))])}loadDependencies(){return Y3({action:()=>Promise.resolve().then(()=>Uii),"action-bar":()=>Promise.resolve().then(()=>nJn),"action-group":()=>Promise.resolve().then(()=>aJn),button:()=>Promise.resolve().then(()=>Xle),flow:()=>Promise.resolve().then(()=>hJn),"flow-item":()=>Promise.resolve().then(()=>ari),list:()=>Promise.resolve().then(()=>Lii),"list-item":()=>Promise.resolve().then(()=>Gii),"list-item-group":()=>Promise.resolve().then(()=>mJn),loader:()=>Promise.resolve().then(()=>vJn)})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._relatedRecordsWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:r}=this,{selectedFeatureViewModel:n}=this.viewModel,s={title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new Jcn({flowItems:r,headingLevel:t+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():di.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._setFocusOn():di.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(avt);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(v0(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return er("div",{bind:this,class:this.classes(Wg.base,Xo.widget,Xo.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?er("div",{class:Wg.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:er("div",{class:Wg.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:r,selectedFeatureIndex:n,pendingPromisesCount:s}=t;return er("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:xC(e.pageText,{index:DS(n+1),total:DS(r)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return er("calcite-action-bar",{class:Wg.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},er("calcite-action-group",{scale:"s"},er("calcite-action",{appearance:"solid",class:Wg.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),er("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:r}=this.viewModel,n=e===t,s=r.indexOf(e);return er("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:n,onCalciteListItemSelect:this._selectFeature},er("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(r=>{const n=r?.graphic;if(!n)return;const s=n.sourceLayer??n.layer,o=t.get(s)??[];t.set(s,[...o,r])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?er("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys()).map(r=>er("calcite-list-item-group",{heading:r?.title??this.messagesCommon.untitled,key:r?.uid||"untitled"},t.get(r)?.map(n=>this._renderFeatureMenuItem(n))))):null}_renderHeaderAction(e,t){return e.visible?er("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon||"",indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,scale:"m",slot:"header-actions-end",text:e.title||"",title:e.title||""}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:r,_collapseEnabled:n,featureNavigationTop:s}=this,{title:o,active:a}=this.viewModel,l=t.heading&&o?o:"";return er("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,class:this.classes({[Wg.contentFeature]:!0,[Wg.flowItemCollapsed]:r}),closable:t.closeButton,closed:!a,collapsed:r,collapseDirection:s?"down":"up",collapsible:n,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},l?er(AKe,{class:this.classes(Wg.featuresHeading,Xo.heading),innerHTML:l,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),r?null:er("div",{class:this.classes(Wg.container,Wg.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:r,messagesCommon:n}=this,{active:s,featureViewModels:o,pendingPromisesCount:a}=e;return t?er("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!s,description:xC(r.total,{total:o.length}),heading:r.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:l=>{l.preventDefault(),this._handleFeatureMenuBack()}},a>0?er("calcite-loader",{class:Wg.loader,inline:!0,key:"feature-menu-loader",label:n.loading,scale:"m",slot:"header-actions-end"}):null,er("div",{class:Wg.container},this._renderFeatureMenu()),er("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Wg.featureMenuObserver}),er("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},n.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._relatedRecordsWidget.render()];return this.visibleElements.flow?er("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:r}=e;if(r)return null;const n=fun({action:e,feature:this.selectedFeature}),s={[Wg.icon]:!!t,[Wg.actionImage]:!!n};return t&&(s[t]=!0),n||t?er("span",{"aria-hidden":"true",class:this.classes(Wg.icon,s),key:"icon",styles:pun(n)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?er("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},er("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?er("div",{class:op.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_setFocusOn(){this.renderNow(),requestAnimationFrame(()=>{this._focusOn=this.featureMenuOpen?"menu-flow-item":"root-flow-item"})}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,r=t?.geometry;if(r==null||t==null)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:r});const n=h7e(r);this.open({features:[t],location:n??void 0})}_focusRootFlowItemNode(){this._focusFlowItemNodeThrottled("root-flow-item")}_focusFeatureMenuFlowItemNode(){this._focusFlowItemNodeThrottled("menu-flow-item")}_storeRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusFlowItemNodeThrottled("root-flow-item")}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFlowItemNodeThrottled("menu-flow-item")}_setActiveFeature(e){const{viewModel:t}=this,r=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[r]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:r,messagesCommon:n}=this,{id:s}=e,o=r?.attributes,a=e.title??"",l=s==="zoom-to-feature"?xC(a,{messages:t}):s==="remove-selected-feature"?xC(a,{messages:n}):s==="zoom-to-clustered-features"||s==="browse-clustered-features"?xC(a,{messages:t}):e.title;return l&&o?xC(l,o):l??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,r=e?.viewModel;e&&(this.viewModel.title=r?.state==="error"?t?.errorMessage:r?.title||"")}_addSelectedFeatureIndexHandle(){const e=Ki(()=>this.viewModel?.selectedFeatureIndex,(t,r)=>this._selectedFeatureIndexUpdated(t,r));this.addHandles(e,avt)}_selectedFeatureIndexUpdated(e,t){const{featureCount:r}=this.viewModel;r&&e!==t&&e!==-1&&(this._destroyRelatedRecordsFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const r=t.dataset.actionUid,n=this.headerActions.find(({uid:s})=>s===r);n&&!n.disabled&&(n?.type==="toggle"&&(n.value=!n.value),this.emit("trigger-header-action",{action:n}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const r=t.dataset.actionUid,{allActions:n}=this.viewModel,s=n.findIndex(a=>a.uid===r),o=n.at(s);o&&o.type==="toggle"&&(o.value=!o.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new Zcn({view:e}),e.ui.add(this._spinner,{key:lvt,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:r}=this.viewModel;r&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,lvt),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};x([D()],mc.prototype,"_focusOn",void 0),x([D()],mc.prototype,"_relatedRecordsFlowItems",void 0),x([D()],mc.prototype,"_hideActionText",null),x([D()],mc.prototype,"_featureNavigationVisible",null),x([D()],mc.prototype,"_isCollapsed",null),x([D()],mc.prototype,"_collapseEnabled",null),x([D()],mc.prototype,"collapsed",void 0),x([D()],mc.prototype,"content",null),x([D()],mc.prototype,"icon",void 0),x([D()],mc.prototype,"featureMenuOpen",null),x([D()],mc.prototype,"featureNavigationTop",void 0),x([D()],mc.prototype,"features",null),x([D({type:v9})],mc.prototype,"headerActions",void 0),x([D()],mc.prototype,"headingLevel",void 0),x([D()],mc.prototype,"location",null),x([D()],mc.prototype,"label",null),x([D(),Sg("esri/widgets/Features/t9n/Features")],mc.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],mc.prototype,"messagesCommon",void 0),x([D()],mc.prototype,"promises",null),x([D()],mc.prototype,"responsiveActionsEnabled",void 0),x([D({readOnly:!0})],mc.prototype,"selectedFeature",null),x([D()],mc.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],mc.prototype,"selectedFeatureWidget",null),x([D()],mc.prototype,"title",null),x([D()],mc.prototype,"updateLocationEnabled",null),x([D()],mc.prototype,"view",null),x([D({type:DKe}),vqt(["triggerAction","trigger-action"])],mc.prototype,"viewModel",void 0),x([D({type:Mqt,nonNullable:!0})],mc.prototype,"visibleElements",void 0),x([D()],mc.prototype,"visible",null),mc=x([Qe("esri.widgets.Features")],mc);const mhn=mc,L2="esri-popup",aN=`${L2}--is-docked`,Gf={base:L2,main:`${L2}__main-container`,shadow:`${L2}--shadow`,isDocked:aN,isDockedTopLeft:`${aN}-top-left`,isDockedTopCenter:`${aN}-top-center`,isDockedTopRight:`${aN}-top-right`,isDockedBottomLeft:`${aN}-bottom-left`,isDockedBottomCenter:`${aN}-bottom-center`,isDockedBottomRight:`${aN}-bottom-right`,alignTopCenter:`${L2}--aligned-top-center`,alignBottomCenter:`${L2}--aligned-bottom-center`,alignTopLeft:`${L2}--aligned-top-left`,alignBottomLeft:`${L2}--aligned-bottom-left`,alignTopRight:`${L2}--aligned-top-right`,alignBottomRight:`${L2}--aligned-bottom-right`,pointer:`${L2}__pointer`,pointerDirection:`${L2}__pointer-direction`};let m7e=class extends DKe{constructor(e){super(e)}};m7e=x([Qe("esri.widgets.Popup.PopupViewModel")],m7e);const Oqt=m7e;let vO=class extends un{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}};x([D({type:Boolean,nonNullable:!0})],vO.prototype,"actionBar",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"closeButton",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"collapseButton",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"featureNavigation",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"heading",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"spinner",void 0),vO=x([Qe("esri.widgets.Features.PopupVisibleElements")],vO);const g7e=vO,uvt={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let Su=class extends my{constructor(e,t){super(e,t),this._dockAction=new xY({id:"popup-dock-action"}),this._featuresWidget=new mhn({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this.alignment="auto",this.collapsed=!1,this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new Oqt,this.visibleElements=new g7e}initialize(){this.addHandles([Ki(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),js),Ki(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),js),Ki(()=>this.dockOptions,e=>{const{_dockAction:t}=this,r=this._featuresWidget.headerActions;r.remove(t),e.buttonEnabled&&r.add(t)},js),Ki(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),Ki(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),Ki(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),Ki(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),Ki(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),Ki(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),Ki(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,js),Ki(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,js),Ki(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,js),Ki(()=>this.collapsed,e=>this._featuresWidget.collapsed=e,js),Ki(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,js),Ki(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,js),Ki(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,js),Ki(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,js),Ki(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,js),Ki(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,js),ju(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new g7e(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return ty(di.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){ty(di.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapseEnabled(){return ty(di.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){ty(di.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||uvt}set dockOptions(e){const t={...uvt},r=this.viewModel?.view?.breakpoints,n={};r&&(n.width=r.xsmall,n.height=r.xsmall);const s={...t,...e},o={...t.breakpoint,...n},{breakpoint:a}=s;typeof a=="object"?s.breakpoint={...o,...a}:a&&(s.breakpoint=o),this._set("dockOptions",s),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return ty(di.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){ty(di.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||di.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||di.getLogger(this).warn("Popup can only be focused when currently active."),this.reposition(),requestAnimationFrame(()=>{this._featuresWidget.focus()})}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,r={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(r),this.viewModel.open(e),this._shouldFocus(e)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:r}=this,{active:n}=this.viewModel,s=n&&e,o=n&&!e,a=this.selectedFeature?.layer?.title,l=this.selectedFeature?.layer?.id,u={[Gf.alignTopCenter]:t==="top-center",[Gf.alignBottomCenter]:t==="bottom-center",[Gf.alignTopLeft]:t==="top-left",[Gf.alignBottomLeft]:t==="bottom-left",[Gf.alignTopRight]:t==="top-right",[Gf.alignBottomRight]:t==="bottom-right",[Gf.isDocked]:s,[Gf.shadow]:o,[Gf.isDockedTopLeft]:r==="top-left",[Gf.isDockedTopCenter]:r==="top-center",[Gf.isDockedTopRight]:r==="top-right",[Gf.isDockedBottomLeft]:r==="bottom-left",[Gf.isDockedBottomCenter]:r==="bottom-center",[Gf.isDockedBottomRight]:r==="bottom-right"};return er("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(Gf.base,u),"data-layer-id":l,"data-layer-title":a,role:"presentation"},n?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:er("div",{class:Gf.pointer,key:"popup-pointer",role:"presentation"},er("div",{class:this.classes(Gf.pointerDirection,Gf.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[Gf.shadow]:e};return er("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(Gf.main,Xo.widget,t)},this._featuresWidget.render())}async _shouldFocus(e){e?.shouldFocus&&(await fR(()=>this.viewModel?.active===!0),this.focus())}_isOutsideView(e){const{popupHeight:t,popupWidth:r,screenLocation:n,side:s,view:o}=e;if(isNaN(r)||isNaN(t)||!o||!n)return!1;const a=o.padding;return s==="right"&&n.x+r/2>o.width-a.right||s==="left"&&n.x-r/2o.height-a.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:r,_mainContainerNode:n,viewModel:s}=this,{screenLocation:o,view:a}=s;if(o==null||!a||!r)return"top-center";function l(k){return parseInt(k.replaceAll(/[^-\d\.]/g,""),10)}const u=n?window.getComputedStyle(n,null):null,c=u?l(u.getPropertyValue("max-height")):0,h=u?l(u.getPropertyValue("height")):0,{height:p,width:m}=r.getBoundingClientRect(),v=m+t,w=Math.max(p,c,h)+t,S=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"right",view:a}),I=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"left",view:a}),R=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"top",view:a}),L=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"bottom",view:a});return I?R?"bottom-right":"top-right":S?R?"bottom-left":"top-left":R?L?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return nk(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,r=nk(this.container)?"top-left":"top-right";if(!t)return r;const n=t.padding||{left:0,right:0,top:0,bottom:0},s=t.width-n.left-n.right,{breakpoints:o}=t;return o&&s<=o.xsmall?"bottom-center":r}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:r}=this._containerNode.getBoundingClientRect(),n=this._calculatePositionStyle(t,r);n&&Object.assign(this._containerNode.style,n)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:r}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+r:e}_calculateAlignmentPosition(e,t,r,n){const{currentAlignment:s,_pointerOffsetInPx:o}=this;if(!r)return;const{padding:a}=r,l=n/2,u=r.height-t,c=r.width-e;return s==="bottom-center"?{top:t+o-a.top,left:e-l-a.left}:s==="top-left"?{bottom:u+o-a.bottom,right:c+o-a.right}:s==="bottom-left"?{top:t+o-a.top,right:c+o-a.right}:s==="top-right"?{bottom:u+o-a.bottom,left:e+o-a.left}:s==="bottom-right"?{top:t+o-a.top,left:e+o-a.left}:s==="top-center"?{bottom:u+o-a.bottom,left:e-l-a.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:r,view:n}=this;if(!n)return;if(r)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const s=this._calculateFullWidth(t),o=this._calculateAlignmentPosition(e.x,e.y,n,s);return o?{top:o.top!==void 0?`${o.top}px`:"auto",left:o.left!==void 0?`${o.left}px`:"auto",bottom:o.bottom!==void 0?`${o.bottom}px`:"auto",right:o.right!==void 0?`${o.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,r){const[n,s]=e,[o,a]=t,{width:l=0,height:u=0}=r??{};return n<=l&&o>l||n>l&&o<=l||s<=u&&a>u||s>u&&a<=u}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const r=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},n=r.left+r.right,s=r.top+r.bottom,o=[],a=[];o[0]=e[0]-n,o[1]=e[1]-s,a[0]=t[0]-n,a[1]=t[1]-s;const{dockOptions:l}=this,u=l.breakpoint;this._dockingThresholdCrossed(o,a,u)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const r=t.active&&!e;t.screenLocationEnabled=r}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,r=this.viewModel?.view?.ui;if(!r)return!1;const{width:n,height:s}=r;if(isNaN(n)||isNaN(s)||!t)return!1;const o=t.hasOwnProperty("width")&&n<=(t.width??0),a=t.hasOwnProperty("height")&&s<=(t.height??0);return o||a}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};x([D({readOnly:!0})],Su.prototype,"_featureNavigationTop",null),x([D()],Su.prototype,"actions",null),x([D()],Su.prototype,"alignment",void 0),x([D()],Su.prototype,"autoCloseEnabled",null),x([D()],Su.prototype,"autoOpenEnabled",null),x([D()],Su.prototype,"defaultPopupTemplateEnabled",null),x([D()],Su.prototype,"content",null),x([D()],Su.prototype,"collapsed",void 0),x([D()],Su.prototype,"collapseEnabled",null),x([D({readOnly:!0})],Su.prototype,"currentAlignment",null),x([D({readOnly:!0})],Su.prototype,"currentDockPosition",null),x([D()],Su.prototype,"dockOptions",null),x([D()],Su.prototype,"dockEnabled",void 0),x([D({readOnly:!0})],Su.prototype,"featureCount",null),x([D()],Su.prototype,"featureMenuOpen",null),x([D()],Su.prototype,"features",null),x([D()],Su.prototype,"goToOverride",null),x([D()],Su.prototype,"headingLevel",void 0),x([D()],Su.prototype,"highlightEnabled",null),x([D()],Su.prototype,"location",null),x([D()],Su.prototype,"label",null),x([D(),Sg("esri/widgets/Popup/t9n/Popup")],Su.prototype,"messages",void 0),x([D()],Su.prototype,"promises",null),x([D({readOnly:!0})],Su.prototype,"selectedFeature",null),x([D()],Su.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],Su.prototype,"selectedFeatureWidget",null),x([D()],Su.prototype,"spinnerEnabled",null),x([D()],Su.prototype,"title",null),x([D()],Su.prototype,"updateLocationEnabled",null),x([D()],Su.prototype,"view",null),x([D({type:Oqt}),vqt(["triggerAction","trigger-action"])],Su.prototype,"viewModel",void 0),x([D()],Su.prototype,"visible",null),x([D({type:g7e,nonNullable:!0})],Su.prototype,"visibleElements",void 0),Su=x([Qe("esri.widgets.Popup")],Su);const ghn=Su,cvt=Object.freeze(Object.defineProperty({__proto__:null,default:ghn},Symbol.toStringTag,{value:"Module"}));let J$=class extends Ci{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),t=this.geometries[0],r={};return r.outSR=Hv(this.outSpatialReference),r.inSR=Hv(t.spatialReference),r.geometries=JSON.stringify({geometryType:ah(t),geometries:e}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};x([D()],J$.prototype,"geometries",void 0),x([D({json:{read:{source:"outSR"}}})],J$.prototype,"outSpatialReference",void 0),x([D()],J$.prototype,"transformation",void 0),x([D()],J$.prototype,"transformForward",void 0),J$=x([Qe("esri.rest.support.ProjectParameters")],J$);const FKe=J$,yhn=Sd(FKe);async function Pqt(i,e,t){e=yhn(e);const r=gu(i),n={...r.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=ah(e.geometries[0]),a=_p(n,t);return zi(r.path+"/project",a).then(({data:{geometries:l}})=>tRt(l,o,s))}async function Rqt(i=null,e){if(Ho.geometryServiceUrl)return Ho.geometryServiceUrl;if(!i)throw new qe("internal:geometry-service-url-not-configured");let t;t="portal"in i?i.portal||Bu.getDefault():i,await t.load({signal:e});const r=t.helperServices?.geometry?.url;if(!r)throw new qe("internal:geometry-service-url-not-configured");return r}async function vhn(i,e,t=null,r){const n=await Rqt(t,r),s=new FKe;s.geometries=[i],s.outSpatialReference=e;const o=await Pqt(n,s,{signal:r});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new qe("internal:geometry-service-projection-failed")}const _hn=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:Rqt,projectGeometry:vhn},Symbol.toStringTag,{value:"Module"}));let Dqt=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const n=this._outer.get(e);n?n.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),r.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((t,r)=>e(t,r))}},Fqt=class{constructor(e){this._rctx=e,this._store=new Dqt}dispose(){this._store.forEach(e=>e.forEach(t=>t.dispose())),this._store.clear()}acquire(e,t,r,n){const s=this._store.get(e,t);if(s!=null)return s.ref(),s;const o=new wCe(this._rctx,e,t,r,n);return o.ref(),this._store.set(e,t,o),o}get test(){let e=0;return this._store.forEach(t=>t.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLProgramObjects:e}}},kKe=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,t=new Map){if(t.has(e))return t.get(e);const r=this._read(e);if(!r)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(r);const o=[];for(;s!=null;)o.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(r);let a=0,l="";return o.forEach(u=>{l+=r.slice(a,u.start),l+=t.has(u.path)?"":this._resolve(u.path,t),a=u.start+u.length}),l+=r.slice(a),t.set(e,l),l}_read(e){return this._readFile(e)}};const gpe=()=>di.getLogger("esri.views.webgl.VertexArrayObject");let wh=class{constructor(e,t,r,n,s=null){this._context=e,this._locations=t,this._layout=r,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((e,t)=>e+this._buffers[t].usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*VTt}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=ba(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&gpe().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(bd.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:e}=this._context,t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t,this._context.instanceCounter.increment(bd.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||gpe().error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||gpe().error("Vertex buffer is uninitialized!");const a=t[s];a||gpe().error("Vertex element descriptor is empty!"),SXr(this._context,this._locations,o,a)}r!=null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};function bhn(i){const{options:e,value:t}=i;return typeof e[t]=="number"}function mX(i){let e="";for(const t in i){const r=i[t];if(typeof r=="boolean")r&&(e+=`#define ${t} +`}}}this._shaderHeader=r,this._shaderMain=n,this._uniforms=s}_bit(e){return(this._key&1<>e}_getType(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(e){const t=255*e[3];return cg.i8888to32(e[0]*t,e[1]*t,e[2]*t,t)}_encodePattern(e,t,r){if(!r?.rect)return;const n=2,s=r.rect,o=r.width,a=r.height;t[e]=this._encodeShort(s.x+n,0),t[e]|=this._encodeShort(s.y+n+a,16),t[e+1]=this._encodeShort(s.x+n+o,0),t[e+1]|=this._encodeShort(s.y+n,16)}_encodeByte(e,t){return(255&e)<{switch(i){case Ti.FLOAT:case Ti.INT:case Ti.UNSIGNED_INT:return 4;case Ti.SHORT:case Ti.UNSIGNED_SHORT:return 2;case Ti.BYTE:case Ti.UNSIGNED_BYTE:return 1}},dsn=(i,e,t)=>{const r=e/t;if(i===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(i===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(i===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let wH=class Mye extends cL{constructor(e){super(e)}geometryInfo(){return Mye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Mye.ATTRIBUTES}attributesInfo(){return Mye.ATTRIBUTES_INFO}};wH.ATTRIBUTES=[],wH.GEOMETRY_LAYOUT=[new Hl("a_pos",2,Ti.BYTE,0,2)],wH.ATTRIBUTES_INFO={};let xH=class Oye extends cL{constructor(e){super(e)}geometryInfo(){return Oye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Oye.ATTRIBUTES}attributesInfo(){return Oye.ATTRIBUTES_INFO}};xH.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],xH.GEOMETRY_LAYOUT=[new Hl("a_pos",2,Ti.SHORT,0,4)],xH.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:qs.R8_UNSIGNED},"circle-color":{name:"color",type:qs.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:qs.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:qs.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:qs.R8_UNSIGNED,precisionFactor:32}};let SH=class Pye extends cL{constructor(e){super(e)}geometryInfo(){return Pye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Pye.ATTRIBUTES}attributesInfo(){return Pye.ATTRIBUTES_INFO}};SH.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],SH.GEOMETRY_LAYOUT=[new Hl("a_pos",2,Ti.SHORT,0,4)],SH.ATTRIBUTES_INFO={"fill-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:qs.R16G16B16A16_PATTERN,isOptional:!0}};let bA=class BU extends cL{constructor(e,t){super(e),this._usefillColor=t}geometryInfo(){return BU.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?BU.ATTRIBUTES_FILL:BU.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?BU.ATTRIBUTES_INFO_FILL:BU.ATTRIBUTES_INFO_OUTLINE}};bA.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],bA.ATTRIBUTES_FILL=["fill-color","fill-opacity"],bA.GEOMETRY_LAYOUT=[new Hl("a_pos",2,Ti.SHORT,0,8),new Hl("a_offset",2,Ti.BYTE,4,8),new Hl("a_xnormal",2,Ti.BYTE,6,8)],bA.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100}},bA.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:qs.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100}};let TH=class Rye extends cL{constructor(e){super(e)}geometryInfo(){return Rye.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return Rye.ATTRIBUTES}attributesInfo(){return Rye.ATTRIBUTES_INFO}};TH.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],TH.GEOMETRY_LAYOUT=[new Hl("a_pos",2,Ti.SHORT,0,16),new Hl("a_extrude_offset",4,Ti.BYTE,4,16),new Hl("a_dir_normal",4,Ti.BYTE,8,16),new Hl("a_accumulatedDistance",2,Ti.UNSIGNED_SHORT,12,16)],TH.ATTRIBUTES_INFO={"line-width":{name:"width",type:qs.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:qs.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:qs.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:qs.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:qs.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:qs.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:qs.R16G16B16A16_DASHARRAY,isOptional:!0}};const bHt=[new Hl("a_pos",2,Ti.SHORT,0,16),new Hl("a_vertexOffset",2,Ti.SHORT,4,16),new Hl("a_texAngleRange",4,Ti.UNSIGNED_BYTE,8,16),new Hl("a_levelInfo",4,Ti.UNSIGNED_BYTE,12,16)],wHt=[new Hl("a_opacityInfo",1,Ti.UNSIGNED_BYTE,0,1)];let xre=class GBe extends cL{constructor(e){super(e)}geometryInfo(){return bHt}opacityInfo(){return wHt}attributes(){return GBe.ATTRIBUTES}attributesInfo(){return GBe.ATTRIBUTES_INFO}};xre.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],xre.ATTRIBUTES_INFO={"icon-color":{name:"color",type:qs.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:qs.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:qs.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:qs.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:qs.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let Sre=class UBe extends cL{constructor(e){super(e)}geometryInfo(){return bHt}opacityInfo(){return wHt}attributes(){return UBe.ATTRIBUTES}attributesInfo(){return UBe.ATTRIBUTES_INFO}};Sre.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],Sre.ATTRIBUTES_INFO={"text-color":{name:"color",type:qs.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:qs.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:qs.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:qs.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:qs.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:qs.R8_UNSIGNED,isLayout:!0}};const xHt={kind:"null"},vp={kind:"number"},jx={kind:"string"},x0={kind:"boolean"},MR={kind:"color"},jCe={kind:"object"},XP={kind:"value"};function Fle(i,e){return{kind:"array",itemType:i,n:e}}const psn=[xHt,vp,jx,x0,MR,jCe,Fle(XP)];function Fq(i){if(i.kind==="array"){const e=Fq(i.itemType);return typeof i.n=="number"?`array<${e}, ${i.n}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}function GCe(i){if(i===null)return xHt;if(typeof i=="string")return jx;if(typeof i=="boolean")return x0;if(typeof i=="number")return vp;if(i instanceof jr)return MR;if(Array.isArray(i)){let e;for(const t of i){const r=GCe(t);if(e){if(e!==r){e=XP;break}}else e=r}return Fle(e||XP,i.length)}return typeof i=="object"?jCe:XP}function zBe(i,e){if(e.kind==="array")return i.kind==="array"&&(i.n===0&&i.itemType.kind==="value"||zBe(i.itemType,e.itemType))&&(typeof e.n!="number"||e.n===i.n);if(e.kind==="value"){for(const t of psn)if(zBe(i,t))return!0}return e.kind===i.kind}function VBe(i){if(i===null)return"";const e=typeof i;return e==="string"?i:e==="number"||e==="boolean"?String(i):i instanceof jr?i.toString():JSON.stringify(i)}let fsn=class{constructor(e){this._parent=e,this._vars={}}add(e,t){this._vars[e]=t}get(e){return this._vars[e]?this._vars[e]:this._parent?this._parent.get(e):null}},msn=class SHt{constructor(){this.type=XP}static parse(e){if(e.length>1)throw new Error('"id" does not expect arguments');return new SHt}evaluate(e,t){return e?.id}},gsn=class THt{constructor(){this.type=jx}static parse(e){if(e.length>1)throw new Error('"geometry-type" does not expect arguments');return new THt}evaluate(e,t){if(!e)return null;switch(e.type){case Yy.Point:return"Point";case Yy.LineString:return"LineString";case Yy.Polygon:return"Polygon";default:return null}}},ysn=class CHt{constructor(){this.type=jCe}static parse(e){if(e.length>1)throw new Error('"properties" does not expect arguments');return new CHt}evaluate(e,t){return e?.values}},EHt=class IHt{constructor(){this.type=vp}static parse(e){if(e.length>1)throw new Error('"zoom" does not expect arguments');return new IHt}evaluate(e,t){return t}},YS=class AHt{constructor(e,t,r){this._lhs=e,this._rhs=t,this._compare=r,this.type=x0}static parse(e,t,r){if(e.length!==3&&e.length!==4)throw new Error(`"${e[0]}" expects 2 or 3 arguments`);if(e.length===4)throw new Error(`"${e[0]}" collator not supported`);return new AHt(xa(e[1],t),xa(e[2],t),r)}evaluate(e,t){return this._compare(this._lhs.evaluate(e,t),this._rhs.evaluate(e,t))}},vsn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r===n)}},_sn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r!==n)}},bsn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>rr<=n)}},xsn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r>n)}},Ssn=class extends YS{static parse(e,t){return YS.parse(e,t,(r,n)=>r>=n)}},Tsn=class MHt{constructor(e){this._arg=e,this.type=x0}static parse(e,t){if(e.length!==2)throw new Error('"!" expects 1 argument');return new MHt(xa(e[1],t))}evaluate(e,t){return!this._arg.evaluate(e,t)}},Csn=class OHt{constructor(e){this._args=e,this.type=x0}static parse(e,t){const r=[];for(let n=1;n1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${e[0]}" unknown interpolation type "${s[0]}"`)}if(e.length%2!=1)throw new Error(`"${n}" expects an even number of arguments`);const o=xa(e[2],t,vp);let a;n==="interpolate-hcl"||n==="interpolate-lab"?a=MR:r&&r.kind!=="value"&&(a=r);const l=[];for(let u=3;u=c)throw new Error(`"${n}" requires strictly ascending stop inputs`);const h=xa(e[u+1],t,a);a||(a=h.type),l.push([c,h])}if(a&&a!==MR&&a!==vp&&(a.kind!=="array"||a.itemType!==vp))throw new Error(`"${n}" cannot interpolate type ${Fq(a)}`);return new W$(n,a,s,o,l)}evaluate(e,t){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,t);const n=this.input.evaluate(e,t);if(n<=r[0][0])return r[0][1].evaluate(e,t);if(n>=r[r.length-1][0])return r[r.length-1][1].evaluate(e,t);let s=0;for(;++stg(h,c[p],l));if(this.type.kind==="color"&&u instanceof jr&&c instanceof jr){const h=new jr(u),p=new jr(c);return new jr([tg(h.r,p.r,l),tg(h.g,p.g,l),tg(h.b,p.b,l),tg(h.a,p.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof c=="number")return tg(u,c,l);throw new Error(`"${this._operator}" cannot interpolate type ${Fq(this.type)}`)}if(this._operator==="interpolate-hcl"){const h=h1e(u),p=h1e(c),m=p.h-h.h,v=ZF({h:h.h+l*(m>180||m<-180?m-360*Math.round(m/360):m),c:tg(h.c,p.c,l),l:tg(h.l,p.l,l)});return new jr({a:tg(u.a,c.a,l),...v})}if(this._operator==="interpolate-lab"){const h=c1e(u),p=c1e(c),m=ZF({l:tg(h.l,p.l,l),a:tg(h.a,p.a,l),b:tg(h.b,p.b,l)});return new jr({a:tg(u.a,c.a,l),...m})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(e,t){const r=this._stops;if(r.length===1||e>=r[r.length-1][0])return 0;let n=0;for(;++n=r)return[r,r];let n=0;for(;++n1&&(s=1),s}static _exponentialInterpolationRatio(e,t,r,n){const s=n-r;if(s===0)return 0;const o=e-r;return t===1?o/s:(t**o-1)/(t**s-1)}},Psn=class LHt{constructor(e,t,r){this.type=e,this._input=t,this._stops=r}static parse(e,t){if(e.length<5)throw new Error('"step" expects at least 4 arguments');if(e.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=xa(e[1],t,vp);let n;const s=[];s.push([-1/0,xa(e[2],t)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=xa(e[o+1],t);n||(n=l.type),s.push([a,l])}return new LHt(n,r,s)}evaluate(e,t){const r=this._stops;if(r.length===1)return r[0][1].evaluate(e,t);const n=this._input.evaluate(e,t);let s=0;for(;++s=n.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return n[r]}},ksn=class HBe{constructor(e,t){this._key=e,this._obj=t,this.type=XP}static parse(e,t){let r,n;switch(e.length){case 2:return r=xa(e[1],t),new HBe(r);case 3:return r=xa(e[1],t),n=xa(e[2],t),new HBe(r,n);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(e,t){const r=this._key.evaluate(e,t);return this._obj?this._obj.evaluate(e,t)[r]:e?.values[r]}},Lsn=class WBe{constructor(e,t){this._key=e,this._obj=t,this.type=x0}static parse(e,t){let r,n;switch(e.length){case 2:return r=xa(e[1],t),new WBe(r);case 3:return r=xa(e[1],t),n=xa(e[2],t),new WBe(r,n);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(e,t){const r=this._key.evaluate(e,t);return this._obj?r in this._obj.evaluate(e,t):!!e?.values[r]}},Nsn=class jHt{constructor(e,t){this._key=e,this._vals=t,this.type=x0}static parse(e,t){if(e.length!==3)throw new Error('"in" expects 2 arguments');return new jHt(xa(e[1],t),xa(e[2],t))}evaluate(e,t){const r=this._key.evaluate(e,t);return this._vals.evaluate(e,t).includes(r)}},$sn=class qBe{constructor(e,t,r){this._item=e,this._array=t,this._from=r,this.type=vp}static parse(e,t){if(e.length<3||e.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=xa(e[1],t),n=xa(e[2],t);if(e.length===4){const s=xa(e[3],t,vp);return new qBe(r,n,s)}return new qBe(r,n)}evaluate(e,t){const r=this._item.evaluate(e,t),n=this._array.evaluate(e,t);if(this._from){const s=this._from.evaluate(e,t);if(s!==Math.floor(s))throw new Error('"index-of" index must be an integer');return n.indexOf(r,s)}return n.indexOf(r)}},Bsn=class GHt{constructor(e){this._arg=e,this.type=vp}static parse(e,t){if(e.length!==2)throw new Error('"length" expects 2 arguments');const r=xa(e[1],t);return new GHt(r)}evaluate(e,t){const r=this._arg.evaluate(e,t);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}},jsn=class YBe{constructor(e,t,r,n){this.type=e,this._array=t,this._from=r,this._to=n}static parse(e,t){if(e.length<3||e.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=xa(e[1],t),n=xa(e[2],t,vp);if(n.type!==vp)throw new Error('"slice" index must return a number');if(e.length===4){const s=xa(e[3],t,vp);if(s.type!==vp)throw new Error('"slice" index must return a number');return new YBe(r.type,r,n,s)}return new YBe(r.type,r,n)}evaluate(e,t){const r=this._array.evaluate(e,t);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const n=this._from.evaluate(e,t);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');if(this._to){const s=this._to.evaluate(e,t);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');return r.slice(n,s)}return r.slice(n)}},Gsn=class UHt{constructor(){this.type=x0}static parse(e){if(e.length!==1)throw new Error('"has-id" expects no arguments');return new UHt}evaluate(e,t){return e?.id!==void 0}},Sx=class zHt{constructor(e,t){this._args=e,this._calculate=t,this.type=vp}static parse(e,t,r){const n=e.slice(1).map(s=>xa(s,t));return new zHt(n,r)}evaluate(e,t){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,t))),this._calculate(r)}},Usn=class extends Sx{static parse(e,t){switch(e.length){case 2:return Sx.parse(e,t,r=>-r[0]);case 3:return Sx.parse(e,t,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}},zsn=class extends Sx{static parse(e,t){return Sx.parse(e,t,r=>{let n=1;for(const s of r)n*=s;return n})}},Vsn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}},Hsn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}},Wsn=class extends Sx{static parse(e,t){if(e.length===3)return Sx.parse(e,t,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}},qsn=class extends Sx{static parse(e,t){return Sx.parse(e,t,r=>{let n=0;for(const s of r)n+=s;return n})}},Xf=class XBe{constructor(e,t){this._args=e,this._calculate=t,this.type=vp}static parse(e,t){const r=e.slice(1).map(n=>xa(n,t));return new XBe(r,XBe.ops[e[0]])}evaluate(e,t){let r;return this._args&&(r=this._args.map(n=>n.evaluate(e,t))),this._calculate(r)}};Xf.ops={abs:i=>Math.abs(i[0]),acos:i=>Math.acos(i[0]),asin:i=>Math.asin(i[0]),atan:i=>Math.atan(i[0]),ceil:i=>Math.ceil(i[0]),cos:i=>Math.cos(i[0]),e:()=>Math.E,floor:i=>Math.floor(i[0]),ln:i=>Math.log(i[0]),ln2:()=>Math.LN2,log10:i=>Math.log(i[0])/Math.LN10,log2:i=>Math.log(i[0])/Math.LN2,max:i=>Math.max(...i),min:i=>Math.min(...i),pi:()=>Math.PI,round:i=>Math.round(i[0]),sin:i=>Math.sin(i[0]),sqrt:i=>Math.sqrt(i[0]),tan:i=>Math.tan(i[0])};let Ysn=class VHt{constructor(e){this._args=e,this.type=jx}static parse(e,t){return new VHt(e.slice(1).map(r=>xa(r,t)))}evaluate(e,t){return this._args.map(r=>r.evaluate(e,t)).join("")}},JBe=class KBe{constructor(e,t){this._arg=e,this._calculate=t,this.type=jx}static parse(e,t){if(e.length!==2)throw new Error(`${e[0]} expects 1 argument`);const r=xa(e[1],t);return new KBe(r,KBe.ops[e[0]])}evaluate(e,t){return this._calculate(this._arg.evaluate(e,t))}};JBe.ops={downcase:i=>i.toLowerCase(),upcase:i=>i.toUpperCase()};let Xsn=class HHt{constructor(e){this._args=e,this.type=MR}static parse(e,t){if(e.length!==4)throw new Error('"rgb" expects 3 arguments');const r=e.slice(1).map(n=>xa(n,t));return new HHt(r)}evaluate(e,t){const r=this._validate(this._args[0].evaluate(e,t)),n=this._validate(this._args[1].evaluate(e,t)),s=this._validate(this._args[2].evaluate(e,t));return new jr({r,g:n,b:s})}_validate(e){if(typeof e!="number"||e<0||e>255)throw new Error(`${e}: invalid color component`);return Math.round(e)}},Jsn=class WHt{constructor(e){this._args=e,this.type=MR}static parse(e,t){if(e.length!==5)throw new Error('"rgba" expects 4 arguments');const r=e.slice(1).map(n=>xa(n,t));return new WHt(r)}evaluate(e,t){const r=this._validate(this._args[0].evaluate(e,t)),n=this._validate(this._args[1].evaluate(e,t)),s=this._validate(this._args[2].evaluate(e,t)),o=this._validateAlpha(this._args[3].evaluate(e,t));return new jr({r,g:n,b:s,a:o})}_validate(e){if(typeof e!="number"||e<0||e>255)throw new Error(`${e}: invalid color component`);return Math.round(e)}_validateAlpha(e){if(typeof e!="number"||e<0||e>1)throw new Error(`${e}: invalid alpha color component`);return e}},Ksn=class qHt{constructor(e){this._color=e,this.type=Fle(vp,4)}static parse(e,t){if(e.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=xa(e[1],t);return new qHt(r)}evaluate(e,t){return new jr(this._color.evaluate(e,t)).toRgba()}},EK=class YHt{constructor(e,t){this.type=e,this._args=t}static parse(e,t){const r=e[0];if(e.length<2)throw new Error(`${r} expects at least one argument`);let n,s=1;if(r==="array"){if(e.length>2){switch(e[1]){case"string":n=jx;break;case"number":n=vp;break;case"boolean":n=x0;break;default:throw new Error('"array" type argument must be string, number or boolean')}s++}else n=XP;let a;if(e.length>3){if(a=e[2],a!==null&&(typeof a!="number"||a<0||a!==Math.floor(a)))throw new Error('"array" length argument must be a positive integer literal');s++}n=Fle(n,a)}else switch(r){case"string":n=jx;break;case"number":n=vp;break;case"boolean":n=x0;break;case"object":n=jCe}const o=[];for(;s":xsn,">=":Ssn,all:Csn,any:Esn,case:Asn,coalesce:Msn,match:Osn,within:null,interpolate:Dye,"interpolate-hcl":Dye,"interpolate-lab":Dye,step:Psn,let:Rsn,var:Dsn,concat:Ysn,downcase:JBe,"is-supported-script":null,"resolved-locale":null,upcase:JBe,rgb:Xsn,rgba:Jsn,"to-rgba":Ksn,"-":Usn,"*":zsn,"/":Vsn,"%":Hsn,"^":Wsn,"+":qsn,abs:Xf,acos:Xf,asin:Xf,atan:Xf,ceil:Xf,cos:Xf,e:Xf,floor:Xf,ln:Xf,ln2:Xf,log10:Xf,log2:Xf,max:Xf,min:Xf,pi:Xf,round:Xf,sin:Xf,sqrt:Xf,tan:Xf,zoom:EHt,"heatmap-density":null,"has-id":Gsn,none:Isn};let eon=class Iw{constructor(e){this._expression=e}filter(e,t){if(!this._expression)return!0;try{return this._expression.evaluate(e,t)}catch(r){return console.log(r.message),!0}}static createFilter(e){if(!e)return null;this.isLegacyFilter(e)&&(e=this.convertLegacyFilter(e));try{const t=xa(e,null,x0);return new Iw(t)}catch(t){return console.log(t.message),null}}static isLegacyFilter(e){if(!Array.isArray(e)||e.length===0)return!0;switch(e[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return e.length===3&&typeof e[1]=="string"&&!Array.isArray(e[2]);case"in":return e.length>=3&&typeof e[1]=="string"&&!Array.isArray(e[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let t=1;t":case"<":case">=":case"<=":return Iw.convertComparison(t,e[1],e[2]);case"in":return Iw.convertIn(e[1],e.slice(2));case"!in":return Iw.negate(Iw.convertIn(e[1],e.slice(2)));case"any":case"all":case"none":return Iw.convertCombining(t,e.slice(1));case"has":return Iw.convertHas(e[1]);case"!has":return Iw.negate(Iw.convertHas(e[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(e,t,r){switch(t){case"$type":return[e,["geometry-type"],r];case"$id":return[e,["id"],r];default:return[e,["get",t],r]}}static convertIn(e,t){switch(e){case"$type":return["in",["geometry-type"],["literal",t]];case"$id":return["in",["id"],["literal",t]];default:return["in",["get",e],["literal",t]]}}static convertHas(e){switch(e){case"$type":return!0;case"$id":return["has-id"];default:return["has",e]}}static convertCombining(e,t){return[e].concat(t.map(this.convertLegacyFilter))}static negate(e){return["!",e]}},Ryt=class ZHt{constructor(e,t){let r;switch(this.isDataDriven=!1,this.interpolator=null,e.type){case"number":case"color":r=!0;break;case"array":r=e.value==="number";break;default:r=!1}if(t==null&&(t=e.default),Array.isArray(t)&&t.length>0&&KHt[t[0]]){const s={number:vp,color:MR,string:jx,boolean:x0,enum:jx};try{const o=e.type==="array"?Fle(s[e.value]||XP,e.length):s[e.type],a=xa(t,null,o);this.getValue=this._buildExpression(a,e),this.isDataDriven=!0,a instanceof Dye&&a.input instanceof EHt&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(e.default)}return}r&&t.type==="interval"&&(r=!1);const n=t?.stops&&t.stops.length>0;if(n)for(const s of t.stops)s[1]=this._validate(s[1],e);if(this.isDataDriven=!!t&&!!t.property,this.isDataDriven)if(t.default!==void 0&&(t.default=this._validate(t.default,e)),n)switch(t.type){case"identity":this.getValue=this._buildIdentity(t,e);break;case"categorical":this.getValue=this._buildCategorical(t,e);break;default:this.getValue=r?this._buildInterpolate(t,e):this._buildInterval(t,e)}else this.getValue=this._buildIdentity(t,e);else n?this.getValue=r?this._buildZoomInterpolate(t):this._buildZoomInterval(t):(t=this._validate(t,e),this.getValue=this._buildSimple(t))}_validate(e,t){if(t.type==="number"){if(t.minimum!=null&&et.maximum)return t.maximum}else t.type==="color"?e=ZHt._parseColor(e):t.type==="enum"?typeof e=="string"&&(e=t.values.indexOf(e)):t.type==="array"&&t.value==="enum"?e=e.map(r=>typeof r=="string"?t.values.indexOf(r):r):t.type==="string"&&(e=VBe(e));return e}_buildSimple(e){return()=>e}_buildExpression(e,t){return(r,n)=>{try{const s=e.evaluate(n,r);return s===void 0?t.default:this._validate(s,t)}catch(s){return console.log(s.message),t.default}}}_buildIdentity(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s!==void 0&&(s=this._validate(s,t)),s??(e.default!==void 0?e.default:t.default)}}_buildCategorical(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),s=this._categorical(s,e.stops),s!==void 0?s:e.default!==void 0?e.default:t.default}}_buildInterval(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),typeof s=="number"?this._interval(s,e.stops):e.default!==void 0?e.default:t.default}}_buildInterpolate(e,t){return(r,n)=>{let s;return n&&(s=n.values[e.property]),typeof s=="number"?this._interpolate(s,e.stops,e.base||1):e.default!==void 0?e.default:t.default}}_buildZoomInterpolate(e){return t=>this._interpolate(t,e.stops,e.base||1)}_buildZoomInterval(e){return t=>this._interval(t,e.stops)}_categorical(e,t){const r=t.length;for(let n=0;n0){u&&(v=u.getValue(s,w));for(const $ of v){let V=r[$];V||(V=r[$]=new Set);for(const Y of R){const K=Y.codePointAt(0);K!=null&&V.add(K)}}}}if(!I&&!R)continue;const k=n.getLayoutValue("symbol-sort-key",s,w),B={feature:w,sprite:I,label:R,rtl:L,geometry:S,hash:(R?Q1(R):0)^(I?Q1(I):0),priority:k,textFont:v};c.push(B)}this._symbolFeatures=c}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,r=this.zoom,n=t.getLayoutValue("symbol-placement",r),s=n!==YP.POINT,o=t.getLayoutValue("symbol-spacing",r)*ite,a=t.getLayoutProperty("icon-image"),l=t.getLayoutProperty("text-field"),u=a?new ion(t,r,s):null,c=l?new ron(t,r,s):null,h=this._workerTileHandler;let p;a&&(p=h.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const m=[];let v=1;c&&c.size&&(v=c.size/vA);const w=c?c.maxAngle*X8e:0,S=c?c.size*ite:0;for(const I of this._symbolFeatures){let R;u&&p&&I.sprite&&(R=p[I.sprite],R&&R.sdf&&(this._isIconSDF=!0));let L;R&&u.update(r,I.feature);let k=0;const B=I.label;if(B){Of(c),c.update(r,I.feature);const $=s&&c.rotationAlignment===sc.MAP?c.keepUpright:c.writingMode&&c.writingMode.includes(qbe.VERTICAL);let V=.5;switch(c.anchor){case ec.TOP_LEFT:case ec.LEFT:case ec.BOTTOM_LEFT:V=0;break;case ec.TOP_RIGHT:case ec.RIGHT:case ec.BOTTOM_RIGHT:V=1}let Y=.5;switch(c.anchor){case ec.TOP_LEFT:case ec.TOP:case ec.TOP_RIGHT:Y=0;break;case ec.BOTTOM_LEFT:case ec.BOTTOM:case ec.BOTTOM_RIGHT:Y=1}let K=.5;switch(c.justify){case bH.AUTO:K=V;break;case bH.LEFT:K=0;break;case bH.RIGHT:K=1}const Q=c.letterSpacing*vA,re=s?0:c.maxWidth*vA,ne=c.lineHeight*vA,de=I.textFont.map(pe=>h.getGlyphItems(pe));if(L=new yHt(de,re,ne,Q,V,Y,K).getShaping(B,I.rtl,$),L&&L.length>0){let pe=1e30,H=-1e30;for(const Z of L)pe=Math.min(pe,Z.x),H=Math.max(H,Z.x);k=(H-pe+2*vA)*v*ite}}for(let $ of I.geometry){const V=[];if(n===YP.LINE){if(L?.length&&c?.size){const Y=c.size*ite*(2+Math.min(2,4*Math.abs(c.offset[1])));$=XT._smoothVertices($,Y)}XT._pushAnchors(V,$,o,k)}else n===YP.LINE_CENTER?XT._pushCenterAnchor(V,$):I.feature.type===Yy.Polygon?XT._pushCentroid(V,$):V.push(new spe($[0].x,$[0].y));for(const Y of V){if(Y.x<0||Y.x>Iyt||Y.y<0||Y.y>Iyt||s&&k>0&&c?.rotationAlignment===sc.MAP&&!XT._honorsTextMaxAngle($,Y,k,w,S))continue;const K={shaping:L,line:$,iconMosaicItem:R,anchor:Y,symbolFeature:I,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};m.push(K),this._processFeature(K,u,c)}}}m.sort(non),this._addPlacedGlyphs(),this._symbolInstances=m}serialize(){let e=14;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=XT._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),r=new Int32Array(t.buffer),n=new Float32Array(t.buffer),[s,o,a]=this._sourceTileKey.split("/");let l=0;t[l++]=this.type,t[l++]=this.layerUIDs.length;for(let u=0;un in t?t[n]:"")}_processFeature(e,t,r){const{line:n,iconMosaicItem:s,shaping:o,anchor:a}=e,l=this.zoom,u=this.layer,c=!!s;let h=!0;c&&(h=t?.optional||!s);const p=o&&o.length>0,m=!p||r?.optional;let v,w;if(c&&(v=this._placementEngine.getIconPlacement(a,s,t)),(v||h)&&(p&&(w=this._placementEngine.getTextPlacement(a,o,n,r)),w||m)){if(v&&w||(m||h?m||w?h||v||(w=null):v=null:(v=null,w=null)),w){const S=u.hasDataDrivenText?u.textMaterial.encodeAttributes(e.symbolFeature.feature,l,u):null;if(this._storePlacedGlyphs(e,w.shapes,l,r.rotationAlignment,S),w.textColliders){e.textColliders=w.textColliders;for(const I of w.textColliders){I.minLod=Math.max(l+kD(I.minLod),0),I.maxLod=Math.min(l+kD(I.maxLod),25);const R=I.angle;if(R){const L=Math.cos(R),k=Math.sin(R),B=I.dxPixels*L-I.dyPixels*k,$=I.dxPixels*k+I.dyPixels*L,V=(I.dxPixels+I.width)*L-I.dyPixels*k,Y=(I.dxPixels+I.width)*k+I.dyPixels*L,K=I.dxPixels*L-(I.dyPixels+I.height)*k,Q=I.dxPixels*k+(I.dyPixels+I.height)*L,re=(I.dxPixels+I.width)*L-(I.dyPixels+I.height)*k,ne=(I.dxPixels+I.width)*k+(I.dyPixels+I.height)*L,de=Math.min(B,V,K,re),pe=Math.max(B,V,K,re),H=Math.min($,Y,Q,ne),Z=Math.max($,Y,Q,ne);I.dxPixels=de,I.dyPixels=H,I.width=pe-de,I.height=Z-H}}}}if(v){const S=u.hasDataDrivenIcon?u.iconMaterial.encodeAttributes(e.symbolFeature.feature,l,u):null;if(this._addPlacedIcons(e,v.shapes,l,s.page,t.rotationAlignment===sc.VIEWPORT,S),v.iconColliders){e.iconColliders=v.iconColliders;for(const I of v.iconColliders){I.minLod=Math.max(l+kD(I.minLod),0),I.maxLod=Math.min(l+kD(I.maxLod),25);const R=I.angle;if(R){const L=Math.cos(R),k=Math.sin(R),B=I.dxPixels*L-I.dyPixels*k,$=I.dxPixels*k+I.dyPixels*L,V=(I.dxPixels+I.width)*L-I.dyPixels*k,Y=(I.dxPixels+I.width)*k+I.dyPixels*L,K=I.dxPixels*L-(I.dyPixels+I.height)*k,Q=I.dxPixels*k+(I.dyPixels+I.height)*L,re=(I.dxPixels+I.width)*L-(I.dyPixels+I.height)*k,ne=(I.dxPixels+I.width)*k+(I.dyPixels+I.height)*L,de=Math.min(B,V,K,re),pe=Math.max(B,V,K,re),H=Math.min($,Y,Q,ne),Z=Math.max($,Y,Q,ne);I.dxPixels=de,I.dyPixels=H,I.width=pe-de,I.height=Z-H}}}}}}_addPlacedIcons(e,t,r,n,s,o){const a=Math.max(r-1,0),l=this._iconVertexBuffer,u=this._iconIndexBuffer,c=this._markerMap;for(const h of t){const p=s?0:Math.max(r+kD(h.minzoom),a),m=s?25:Math.min(r+kD(h.maxzoom),25);if(m<=p)continue;const v=h.tl,w=h.tr,S=h.bl,I=h.br,R=h.mosaicRect,L=h.labelAngle,k=h.minAngle,B=h.maxAngle,$=h.anchor,V=l.index,Y=R.x,K=R.y,Q=Y+R.width,re=K+R.height,ne=l.index;l.add($.x,$.y,v.x,v.y,Y,K,L,k,B,p,m,o),l.add($.x,$.y,w.x,w.y,Q,K,L,k,B,p,m,o),l.add($.x,$.y,S.x,S.y,Y,re,L,k,B,p,m,o),l.add($.x,$.y,I.x,I.y,Q,re,L,k,B,p,m,o),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===ne?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([ne,4]),u.add(V,V+1,V+2),u.add(V+1,V+2,V+3),c.has(n)?c.get(n)[1]+=6:c.set(n,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,r=this._glyphMap;for(const[n,s]of this._glyphBufferDataStorage)for(const o of s){const a=e.index,l=o.symbolInstance,u=o.ddAttributes,c=e.index;e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),e.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,u),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===c?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([c,4]),t.add(a,a+1,a+2),t.add(a+1,a+2,a+3),r.has(n)?r.get(n)[1]+=6:r.set(n,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,r,n,s){const o=Math.max(r-1,0),a=n===sc.VIEWPORT;let l,u,c,h,p,m,v,w,S,I,R;for(const L of t)l=a?0:Math.max(r+kD(L.minzoom),o),u=a?25:Math.min(r+kD(L.maxzoom),25),!(u<=l)&&(c=L.tl,h=L.tr,p=L.bl,m=L.br,v=L.labelAngle,w=L.minAngle,S=L.maxAngle,I=L.anchor,R=L.mosaicRect,this._glyphBufferDataStorage.has(L.page)||this._glyphBufferDataStorage.set(L.page,[]),this._glyphBufferDataStorage.get(L.page).push({glyphAnchor:[I.x,I.y],tl:[c.x,c.y],tr:[h.x,h.y],bl:[p.x,p.y],br:[m.x,m.y],xmin:R.x,ymin:R.y,xmax:R.x+R.width,ymax:R.y+R.height,labelAngle:v,minAngle:w,maxAngle:S,minLod:l,maxLod:u,placementLod:o,symbolInstance:e,ddAttributes:s}))}static _pushAnchors(e,t,r,n){r+=n;let s=0;const o=t.length-1;for(let p=0;p-a;){if(--u,u<0)return!1;o-=Po.distance(e[u],l),l=e[u]}o+=Po.distance(e[u],e[u+1]);const c=[];let h=0;const p=e.length;for(;os;)h-=c.shift().deviation;if(Math.abs(h)>n)return!1;o+=Po.distance(v,S),u=w}return!0}static _smoothVertices(e,t){if(t<=0)return e;let r=e.length;if(r<3)return e;const n=[];let s=0,o=0;n.push(0);for(let w=1;w0&&(s+=S,n.push(s),o++,o!==w&&(e[o]=e[w]))}if(r=o+1,r<3)return e;t=Math.min(t,.2*s);const a=e[0].x,l=e[0].y,u=e[r-1].x,c=e[r-1].y,h=Po.sub(e[0],e[1]);h.normalize(),e[0].x+=t*h.x,e[0].y+=t*h.y,h.assignSub(e[r-1],e[r-2]),h.normalize(),e[r-1].x+=t*h.x,e[r-1].y+=t*h.y,n[0]-=t,n[r-1]+=t;const p=[];p.push(new Po(a,l));const m=1e-6,v=.5*t;for(let w=1;w=0;L--){const k=v+n[L+1]-n[w];if(k<0)break;const B=n[L+1]-n[L],$=n[w]-n[L]4096&&(h=4096),h<0&&(h=0),p>4096&&(p=4096),p<0&&(p=0);for(let m=1;m4096&&(v=4096),v<0&&(v=0),w>4096&&(w=4096),w<0&&(w=0),S>4096&&(S=4096),S<0&&(S=0),I>4096&&(I=4096),I<0&&(I=0);const R=(v-h)*(I-p)-(S-h)*(w-p);l+=R*(h+v+S),u+=R*(p+w+I),c+=R}l/=3*c,u/=3*c,isNaN(l)||isNaN(u)||e.push(new spe(l,u))}};QHt._bidiEngine=new NGt;var nP;(function(i){i[i.INITIALIZED=0]="INITIALIZED",i[i.NO_DATA=1]="NO_DATA",i[i.READY=2]="READY",i[i.MODIFIED=3]="MODIFIED",i[i.INVALID=4]="INVALID"})(nP||(nP={}));let son=class{constructor(e,t,r,n,s,o){if(this._pbfTiles={},this._tileClippers={},this._client=r,this._tile=t,this._sourceDataMaxLOD=n,o){this._styleLayerUIDs=new Set;for(const h of o)this._styleLayerUIDs.add(h)}this._styleRepository=s,this._layers=this._styleRepository?.layers??[];const[a,l,u]=t.tileKey.split("/").map(parseFloat);this._level=a;const c=tUt(this._level);for(const h of Object.keys(e)){const p=e[h];if(this._pbfTiles[h]=new g3(new Uint8Array(p.protobuff),new DataView(p.protobuff)),p.refKey){const[m]=p.refKey.split("/").map(parseFloat),v=a-m;if(v>0){const w=(1<{o.has(c)||(s.push({name:c,repeat:h}),o.add(c))},l={};for(const c of n)c.getResources(c.tileClipper,a,l);if(this._tile.status===nP.INVALID)return[];const u=this._fetchResources(s,l,e);return Promise.all([...u,t]).then(()=>this._processFeatures(r.returnedBuckets))}_initialize(e){return{signal:e?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,zoom:r,layers:n,sourceNameToTileClipper:s,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:a,returnedBuckets:l,layerIdToBucket:u,referencerUIDToReferencedId:c}=e,h=this._sourceDataMaxLOD;for(let p=n.length-1;p>=0;p--){const m=n[p];if(r=m.maxzoom)continue}else if(m.maxzoom&&r>=m.maxzoom)continue;if(m.type===bl.BACKGROUND||!this._canParseStyleLayer(m.uid)||!t[m.source]||!s[m.source])continue;const v=t[m.source],w=s[m.source],S=m.sourceLayer,I=v[S];if(I){let R=a[m.source];if(R||(R=a[m.source]=new Set),R.add(m.sourceLayer),m.refLayerId)c.set(m.uid,m.refLayerId);else{const L=this._createBucket(m);if(L){L.layerUIDs=[m.uid],L.layerExtent=I.extent,L.tileClipper=w;let k=o[m.source];k||(k=o[m.source]={});let B=k[S];B||(B=k[S]=[]),B.push(L),l.push(L),u[m.id]=L}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:r}=e;r.forEach((n,s)=>{t[n]&&t[n].layerUIDs.push(s)})}_filterFeatures(e){const{signal:t,sourceNameToTileData:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:s}=e,o=10*this._level,a=10*(this._level+1),l=[],u=[];for(const c of Object.keys(s))s[c].forEach(h=>{l.push(h),u.push(c)});for(let c=0;c=a)continue;const B=L._maxzoom;if(B&&B<=o)continue}for(const k of v)k.pushFeature(R)}}}_fetchResources(e,t,r){const n=[],s=this._tile.getWorkerTileHandler();let o,a;e.length>0&&(o=s.fetchSprites(e,this._client,r),n.push(o));for(const l in t){const u=t[l];u.size>0&&(a=s.fetchGlyphs(this._tile.tileKey,l,u,this._client,r),n.push(a))}return n}_processFeatures(e){const t=e.filter(r=>r.hasFeatures()||this._canParseStyleLayer(r.layer.uid));for(const r of t)r.processFeatures(r.tileClipper);return t}_parseTileData(e){const t={};for(const r of Object.keys(e)){const n=e[r],s={};for(;n.next();)switch(n.tag()){case 3:{const o=n.getMessage(),a=new BBe(o);o.release(),s[a.name]=a;break}default:n.skip()}t[r]=s}return t}_createBucket(e){switch(e.type){case bl.BACKGROUND:return null;case bl.FILL:return this._createFillBucket(e);case bl.LINE:return this._createLineBucket(e);case bl.CIRCLE:return this._createCircleBucket(e);case bl.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new asn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new rsn(e.fillMaterial.getStride()),new qj,new nsn(e.outlineMaterial.getStride()),new qj)}_createLineBucket(e){return new usn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new isn(e.lineMaterial.getStride()),new qj)}_createCircleBucket(e){return new osn(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new ssn(e.circleMaterial.getStride()),new qj)}_createSymbolBucket(e){const t=this._tile;return new QHt(t.tileKey,e,this._level,new Oyt(e.iconMaterial.getStride()),new qj,new Oyt(e.textMaterial.getStride()),new qj,t.placementEngine,t.getWorkerTileHandler())}},oon=class{constructor(e,t,r,n){this.status=nP.INITIALIZED,this.placementEngine=new tsn,this.tileKey=e,this.refKeys=t,this._workerTileHandler=r,this._styleRepository=n}release(){this.tileKey="",this.refKeys=null,this.status=nP.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const r=t?.signal;if(r!=null){const c=()=>{r.removeEventListener("abort",c),this.status=nP.INVALID};r.addEventListener("abort",c)}let n;const s={bucketsWithData:[],emptyBuckets:null};try{n=await this._parse(e,t)}catch(c){if(mo(c))throw c;return{result:s,transferList:[]}}this.status=nP.READY;const o=s.bucketsWithData,a=[];for(const c of n)if(c.hasFeatures()){const h=c.serialize();o.push(h)}else a.push(c.layer.uid);const l=[...o];let u=null;return a.length>0&&(u=Uint32Array.from(a),l.push(u.buffer)),s.emptyBuckets=u,{result:s,transferList:l}}setObsolete(){this.status=nP.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const r=e.sourceName2DataAndRefKey;return Object.keys(r).length===0?[]:(this.status=nP.MODIFIED,new son(r,this,t.client,e.sourceDataMaxLOD,this._styleRepository,e.styleLayerUIDs).parse(t))}},Ybe=class rte{constructor(e){if(this._style=e,this.backgroundBucketIds=[],this._uidToLayer=new Map,this._layerByName={},this._runningId=0,e.layers||(e.layers=[]),this.version=parseFloat(e.version),this.layers=e.layers.map((t,r,n)=>this._create(t,r,n)).filter(t=>!!t),this.layers)for(let t=0;t=this.layers.length?null:this.layers[e].id}getStyleLayerByUID(e){return this._uidToLayer.get(e)??null}getStyleLayerIndex(e){const t=this._layerByName[e];return t?this.layers.indexOf(t):-1}setStyleLayer(e,t){if(!e?.id)return;const r=this._style;t!=null&&t>=this.layers.length&&(t=this.layers.length-1);let n,s=!0;const o=this._layerByName[e.id];if(o){const a=this.layers.indexOf(o);t||(t=a),t===a?(s=!1,n=rte._recreateLayer(e,o),this.layers[t]=n,r.layers[t]=e):(this.layers.splice(a,1),r.layers.splice(a,1),n=this._create(e,t,this.layers),this.layers.splice(t,0,n),r.layers.splice(t,0,e))}else n=this._create(e,t,this.layers),!t||t>=this.layers.length?(this.layers.push(n),r.layers.push(e)):(this.layers.splice(t,0,n),r.layers.splice(t,0,e));this._layerByName[e.id]=n,this._uidToLayer.set(n.uid,n),s&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(e){const t=this._layerByName[e];return t?{type:t.typeName,id:t.id,source:t.source,"source-layer":t.sourceLayer,minzoom:t.minzoom,maxzoom:t.maxzoom,filter:t.filter,layout:t.layout,paint:t.paint}:null}deleteStyleLayer(e){const t=this._layerByName[e];if(t){delete this._layerByName[e],this._uidToLayer.delete(t.uid);const r=this.layers.indexOf(t);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(e){return this._layerByName[e]}getLayoutProperties(e){const t=this._layerByName[e];return t?t.layout:null}getPaintProperties(e){const t=this._layerByName[e];return t?t.paint:null}setPaintProperties(e,t){const r=this._layerByName[e];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:t},s=rte._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].paint=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setLayoutProperties(e,t){const r=this._layerByName[e];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:t,paint:r.paint},s=rte._recreateLayer(n,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].layout=t,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}setStyleLayerVisibility(e,t){const r=this._layerByName[e];if(!r)return;const n=r.layout||{};n.visibility=t;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:n,paint:r.paint},o=rte._recreateLayer(s,r),a=this.layers.indexOf(r);this.layers[a]=o,this._style.layers[a].layout=n,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(e){const t=this._layerByName[e];return t?t.layout?.visibility??"visible":"none"}_recomputeZValues(){const e=this.layers,t=1/(e.length+1);for(let r=0;rs.keyo.key?1:0);const n=e.length;for(let s=0;s{for(const a in o){const l=o[a];s[a]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,r,n,s){const o=[];let a=this._glyphInfo[t];return a?r.forEach(l=>{a[l]||o.push(l)}):(a=this._glyphInfo[t]=[],r.forEach(l=>o.push(l))),o.length===0?Promise.resolve():n.invoke("getGlyphs",{tileID:e,font:t,codePoints:o},s).then(l=>{for(let u=0;uPromise.resolve().then(()=>GBn).then(e=>e.l).then(({default:e})=>{const t=e({locateFile:hon,onRuntimeInitialized:()=>i(t)})})).catch(i=>{throw i})}function hon(i){return Fl(`esri/libs/lyr3d/${i}`)}let ape,kA;async function don(i){if(await eWt(),i.inputs.length<1)return{result:{status:Cre.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const e={ptrs:[],sizes:[]};for(const o of i.inputs){const a=kA._malloc(o.byteLength);new Uint8Array(kA.HEAPU8.buffer,a,o.byteLength).set(new Uint8Array(o)),e.ptrs.push(a),e.sizes.push(o.byteLength)}const t=kA.process(i.jobDescJson,e,i.isMissingResourceCase),r=t.status===Cre.Succeeded&&t.data,n=t.status===Cre.MissingInputs&&t.missingInputUrls.length>0;if(r){const o=t.data.slice();t.data=o}else n&&(t.jobDescJson=t.jobDescJson.slice(0),t.originalInputs=i.inputs);for(let o=0;o{kA=i,kA.initialize_lyr3d_worker_wasm(),ape=null})),ape)}const fon=Object.freeze(Object.defineProperty({__proto__:null,destroyWasm:pon,initialize:eWt,process:don},Symbol.toStringTag,{value:"Module"}));async function mon(i,e,t,r){if(!e)throw new qe("post:missing-guid","guid for version is missing");const n=gu(i),s=t.toJSON(),o=_p(n.query,{query:Ig({...s,f:"json"}),...r,method:"post"});e.startsWith("{")&&(e=e.slice(1,-1));const a=`${n.path}/versions/${e}/deleteForwardEdits`,{data:l}=await zi(a,o);return l.success}const gon=Object.freeze(Object.defineProperty({__proto__:null,deleteForwardEdits:mon},Symbol.toStringTag,{value:"Module"}));var ZBe;let nte=ZBe=class extends Ci{static from(i){return Cu(ZBe,i)}constructor(i){super(i),this.sessionId=void 0,this.moment=null}};x([D({type:String,json:{write:!0}})],nte.prototype,"sessionId",void 0),x([D({type:Date,json:{type:Number,write:{writer:(i,e)=>{e.moment=i?i.getTime():null}}}})],nte.prototype,"moment",void 0),nte=ZBe=x([Qe("esri.rest.versionManagement.gdbVersion.support.PostParameters")],nte);const yon=nte,von=Object.freeze(Object.defineProperty({__proto__:null,default:yon},Symbol.toStringTag,{value:"Module"}));function tWt(i){return i?.applyEdits!=null}function iWt(i){return typeof i=="object"&&i!=null&&"objectId"in i&&!!i.objectId}function rWt(i){return i.every(iWt)}function nWt(i){return typeof i=="object"&&i!=null&&"globalId"in i&&!!i.globalId}function sWt(i){return i.every(nWt)}async function _on(i,e,t,r={}){let n;const s="gdbVersion"in i?i.gdbVersion:null,o=r.gdbVersion??s;if(fsr(i)&&i.url)n=psr(i.url,i.layerId,o,r.returnServiceEditsOption==="original-and-current-features");else{n=ac(),n.promise.then(l=>{(l.addedFeatures.length||l.updatedFeatures.length||l.deletedFeatures.length||l.addedAttachments.length||l.updatedAttachments.length||l.deletedAttachments.length)&&i.emit("edits",l)});const a={result:n.promise};i.emit("apply-edits",a)}try{const{results:a,edits:l}=await bon(i,e,t,r),u=h=>h.filter(p=>!p.error).map(li),c={edits:l,addedFeatures:u(a.addFeatureResults),updatedFeatures:u(a.updateFeatureResults),deletedFeatures:u(a.deleteFeatureResults),addedAttachments:u(a.addAttachmentResults),updatedAttachments:u(a.updateAttachmentResults),deletedAttachments:u(a.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:a.editMoment?new Date(a.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return a.editedFeatureResults?.length&&(c.editedFeatures=a.editedFeatureResults),n.resolve(c),a}catch(a){throw n.reject(a),a}}async function bon(i,e,t,r){if(await i.load(),!tWt(e))throw new qe(`${i.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:i});if(!GEt(i))throw new qe(`${i.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:i});const{edits:n,options:s}=await won(i,t,r);return n.addFeatures?.length||n.updateFeatures?.length||n.deleteFeatures?.length||n.addAttachments?.length||n.updateAttachments?.length||n.deleteAttachments?.length?{edits:n,results:await e.applyEdits(n,s)}:{edits:n,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function won(i,e,t){const r=tT(i),n=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),s=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments),o=i.infoFor3D!=null;if(cWt(e,r,t,!!n,!!s,`${i.type}-layer`),!r.data.isVersioned&&t?.gdbVersion)throw new qe(`${i.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&t?.rollbackOnFailureEnabled)throw new qe(`${i.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const a={...t};if(a.rollbackOnFailureEnabled!=null||r.editing.supportsRollbackOnFailure||(a.rollbackOnFailureEnabled=!0),a.rollbackOnFailureEnabled||a.returnServiceEditsOption!=="original-and-current-features"||(a.rollbackOnFailureEnabled===!1&&di.getLogger("esri.layers.graphics.editingSupport").warn(`${i.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),a.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&a.returnServiceEditsInSourceSR)throw new qe(`${i.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(a.returnServiceEditsInSourceSR&&a.returnServiceEditsOption!=="original-and-current-features")throw new qe(`${i.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const l=uWt(e,r,`${i.type}-layer`),u=t?.globalIdUsed||o,c=i.fields.filter(h=>h.type==="big-integer"||h.type==="oid"&&(h.length||0)>=8);if(u){const{globalIdField:h}=i;if(h==null)throw new qe(`${i.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");l.addFeatures.forEach(p=>Con(p,h))}return l.addFeatures.forEach(h=>xon(h,i,u,c)),l.updateFeatures.forEach(h=>Ton(h,i,u,c)),l.deleteFeatures.forEach(h=>Son(h,i,u,c)),l.addAttachments.forEach(h=>Qyt(h,i)),l.updateAttachments.forEach(h=>Qyt(h,i)),o&&await Eon(l,i),{edits:await aWt(l),options:a}}function pKe(i,e,t,r){if(t){if("attributes"in i&&!i.attributes[e.globalIdField])throw new qe(`${e.type}-layer:invalid-parameter`,`Feature should have '${e.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in i)&&!i.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in i)for(const n of r){const s=i.attributes[n.name];if(s!==void 0&&!iQi(n,s))throw new qe(`${e.type}-layer:invalid-parameter`,`Big-integer field '${n.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:i})}if("geometry"in i&&i.geometry!=null){if(i.geometry.hasZ&&e.capabilities?.data.supportsZ===!1)throw new qe(`${e.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(i.geometry.hasM&&e.capabilities?.data.supportsM===!1)throw new qe(`${e.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function oWt(i,e){if("geometry"in i&&i.geometry?.type==="mesh"&&e.infoFor3D!=null&&e.spatialReference!=null){const{geometry:t}=i,{spatialReference:r,vertexSpace:n}=t,s=e.spatialReference,o=n.type==="local",a=iae(s),l=Ya(s,r),u=l||fE(s)&&(fE(r)||Nb(r));if(!(o&&a&&u||!o&&!a&&l))throw new qe(`${e.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${n.type} vertex space and a spatial reference wkid:${r.wkid} to a layer with a spatial reference wkid:${s.wkid} is not supported.`)}}function xon(i,e,t,r){pKe(i,e,t,r),oWt(i,e)}function Son(i,e,t,r){pKe(i,e,t,r)}function Ton(i,e,t,r){pKe(i,e,t,r),oWt(i,e);const n=tT(e);if("geometry"in i&&i.geometry!=null&&!n?.editing.supportsGeometryUpdate)throw new qe(`${e.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function Qyt(i,e){const{feature:t,attachment:r}=i;if(!t||"attributes"in t&&!t.attributes[e.globalIdField])throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in t)&&!t.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new qe(`${e.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!e.capabilities?.editing.supportsUploadWithItemId&&r.uploadId)throw new qe(`${e.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=lR(r.data);if(n&&!n.isBase64)throw new qe(`${e.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function Con(i,e){const{attributes:t}=i;t[e]==null&&(t[e]=NVe())}async function aWt(i){const e=i.addFeatures??[],t=i.updateFeatures??[],r=e.concat(t).map(a=>a.geometry),n=await cy(r),s=e.length,o=t.length;return n.slice(0,s).forEach((a,l)=>e[l].geometry=a),n.slice(s,s+o).forEach((a,l)=>t[l].geometry=a),i}function lWt(i){return{addFeatures:Array.from(i?.addFeatures??[]),updateFeatures:Array.from(i?.updateFeatures??[]),deleteFeatures:i&&dr.isCollection(i.deleteFeatures)?i.deleteFeatures.toArray():i.deleteFeatures||[],addAttachments:i.addAttachments||[],updateAttachments:i.updateAttachments||[],deleteAttachments:i.deleteAttachments||[]}}function uWt(i,e,t){const r=lWt(i);if(r.addFeatures?.length&&!e.operations.supportsAdd)throw new qe(`${t}:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures?.length&&!e.operations.supportsUpdate)throw new qe(`${t}:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures?.length&&!e.operations.supportsDelete)throw new qe(`${t}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(QBe),r.updateFeatures=r.updateFeatures.map(QBe),r.addAssetFeatures=[],r}function cWt(i,e,t,r,n,s){if(!i||!r&&!n)throw new qe(`${s}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!e.editing.supportsGlobalId&&t?.globalIdUsed)throw new qe(`${s}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!e.editing.supportsGlobalId&&n)throw new qe(`${s}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!t?.globalIdUsed&&n)throw new qe(`${s}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function QBe(i){const e=new Us;return i.attributes||(i.attributes={}),e.geometry=i.geometry,e.attributes=i.attributes,e}async function Eon(i,e){if(e.infoFor3D==null)return;const{infoFor3D:t}=e,r=yR("model/gltf-binary",t.supportedFormats)??rk("glb",t.supportedFormats);if(!(r&&t.editFormats.includes(r)))throw new qe(`${e.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");i.addAssetFeatures??=[];const{addAssetFeatures:n}=i;for(const s of i.addFeatures??[])e0t(s)&&n.push(s);for(const s of i.updateFeatures??[])e0t(s)&&n.push(s)}function e0t(i){return i?.geometry?.type==="mesh"}function Ion(i,e,t,r){if(!tWt(e))throw new qe(`${i.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:i});if(!e.uploadAssets)throw new qe(`${i.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:i});return e.uploadAssets(t,r)}const UCe=Object.freeze(Object.defineProperty({__proto__:null,applyEdits:_on,checkEditingCapabilities:cWt,isFeatureIdentifierArrayWithGlobalId:sWt,isFeatureIdentifierArrayWithObjectId:rWt,isFeatureIdentifierWithGlobalId:nWt,isFeatureIdentifierWithObjectId:iWt,normalizeCollections:lWt,normalizeEdits:uWt,normalizeGeometries:aWt,shallowCloneFeature:QBe,uploadAssets:Ion},Symbol.toStringTag,{value:"Module"})),Xu={convertToGEGeometry:Aon,exportPoint:Mon,exportPolygon:Oon,exportPolyline:Pon,exportMultipoint:Ron,exportExtent:Don};function Aon(i,e){if(e==null)return null;let t="cache"in e?e.cache._geVersion:void 0;return t==null&&(t=i.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=t)),t}function Mon(i,e,t){const r=i.hasZ(e),n=i.hasM(e),s=new $i({x:i.getPointX(e),y:i.getPointY(e),spatialReference:t});return r&&(s.z=i.getPointZ(e)),n&&(s.m=i.getPointM(e)),s.cache._geVersion=e,s}function Oon(i,e,t){const r=new $s({rings:i.exportPaths(e),hasZ:i.hasZ(e),hasM:i.hasM(e),spatialReference:t});return r.cache._geVersion=e,r}function Pon(i,e,t){const r=new lo({paths:i.exportPaths(e),hasZ:i.hasZ(e),hasM:i.hasM(e),spatialReference:t});return r.cache._geVersion=e,r}function Ron(i,e,t){const r=new Oh({hasZ:i.hasZ(e),hasM:i.hasM(e),points:i.exportPoints(e),spatialReference:t});return r.cache._geVersion=e,r}function Don(i,e,t){const r=i.hasZ(e),n=i.hasM(e),s=new hr({xmin:i.getXMin(e),ymin:i.getYMin(e),xmax:i.getXMax(e),ymax:i.getYMax(e),spatialReference:t});if(r){const o=i.getZExtent(e);s.zmin=o.vmin,s.zmax=o.vmax}if(n){const o=i.getMExtent(e);s.mmin=o.vmin,s.mmax=o.vmax}return s.cache._geVersion=e,s}const Fon=Object.freeze(Object.defineProperty({__proto__:null,hydratedAdapter:Xu},Symbol.toStringTag,{value:"Module"}));function fKe(i,e){return{...hWt(i,e),readResourcePaths:[]}}function coe(i,e,t){const r=Yo(i.itemUrl);return{...hWt(i,e),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,resources:t?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function hWt(i,e){return{origin:e,url:Yo(i.itemUrl),portal:i.portal||Bu.getDefault(),portalItem:i}}async function kon(i,e){const t=i.instance.portalItem;if(t?.id)return await t.load(e),Lon(i),i.validateItem&&i.validateItem(t),Non(i,e)}function Lon(i){const e=i.instance.portalItem;if(!e?.type||!i.supportedTypes.includes(e.type))throw new qe("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:e?.type,expectedType:i.supportedTypes.join(", ")})}async function Non(i,e){const t=i.instance,r=t.portalItem;if(!r)return;const{url:n,title:s}=r,o=fKe(r,"portal-item");if(t.type==="group")return $on(t,o,i);n&&t.type!=="media"&&t.read({url:n},o);const a=new ITe,l=await dWt(i,a,e);return l&&t.read(l,o),t.resourceReferences={portalItem:r,paths:o.readResourcePaths??[]},t.type!=="subtype-group"&&t.read({title:s},o),Oae(t,o)}async function $on(i,e,t){const r=i.portalItem;if(!i.sourceIsPortalItem)return;const{title:n,type:s}=r;if(s==="Group Layer"){if(!Q8(r,"Map"))throw new qe("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return Bon(i)}return i.read({title:n},e),jon(i,t)}async function Bon(i){const e=i.portalItem,t=await e.fetchData("json");if(!t)return;const r=fKe(e,"web-map");i.read(t,r),await GYe(i,t,{context:r}),i.resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}async function jon(i,e){let t;const{portalItem:r}=i;if(!r)return;const n=r.type,s=e.layerModuleTypeMap;switch(n){case"Feature Service":case"Feature Collection":t=s.FeatureLayer;break;case"Stream Service":t=s.StreamLayer;break;case"Scene Service":t=s.SceneLayer;break;default:throw new qe("portal:unsupported-item-type-as-group",`The item type '${n}' is not supported as a 'IGroupLayer'`)}const o=new ITe;let[a,l]=await Promise.all([t(),dWt(e,o)]),u=()=>a;if(n==="Feature Service"){const c=TB(l)?.customParameters;l=r.url?await d8t(l,r.url,o):{};const h=$Ye(l),p=f8t(l),m=m8t(l),v=[];if(h.length||p?.length){h.length&&v.push("SubtypeGroupLayer"),p?.length&&v.push("OrientedImageryLayer"),m?.length&&v.push("CatalogLayer");const S=[];for(const L of v){const k=s[L];S.push(k())}const I=await Promise.all(S),R=new Map;v.forEach((L,k)=>{R.set(L,I[k])}),u=L=>L.layerType?R.get(L.layerType)??a:a}const w=await Won(r.url,{customParameters:c,loadContext:o});return await e7e(i,u,l,w)}return n==="Scene Service"&&r.url&&(l=await g8t(r,l,o)),ule(l)>0?await e7e(i,u,l):await Gon(i,u)}async function Gon(i,e){const{portalItem:t}=i;if(!t?.url)return;const r=await IS(t.url);r&&e7e(i,e,{layers:r.layers?.map(d9),tables:r.tables?.map(d9)})}async function e7e(i,e,t,r){let n=t.layers||[];const s=t.tables||[];if(i.portalItem?.type==="Feature Collection"?(n.forEach((o,a)=>{o.id=a,o?.layerDefinition?.type==="Table"&&s.push(o)}),n=n.filter(o=>o?.layerDefinition?.type!=="Table")):(n.reverse(),s.reverse()),n.forEach(o=>{const a=r?.(o);if(a||!r){const l=t0t(i,e(o),t,o,a);i.add(l)}}),s.length){const o=await xv.FeatureLayer();s.forEach(a=>{const l=r?.(a);if(l||!r){const u=t0t(i,o,t,a,l);i.tables.add(u)}})}}function t0t(i,e,t,r,n){const s=i.portalItem,o={portalItem:s.clone(),layerId:r.id};r.url!=null&&(o.url=r.url);const a=new e(o);if("sourceJSON"in a&&(a.sourceJSON=n),a.type!=="subtype-group"&&a.type!=="catalog"&&(a.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const l={origin:"portal-item",portal:s.portal||Bu.getDefault()};a.read(r,l);const u=t.showLegend;u!=null&&a.read({showLegend:u},l)}return a}async function dWt(i,e,t){if(i.supportsData===!1)return;const r=i.instance,n=r.portalItem;if(!n)return;let s=null;try{s=await n.fetchData("json",t)}catch{}if(Von(r)){let o=null;const a=await Uon(n,s,e);if((s?.layers||s?.tables)&&a>0){if(r.layerId==null){const l=$Ye(s);r.layerId=r.type==="subtype-group"?l?.[0]:p8t(s)}o=zon(s,r),o&&s.showLegend!=null&&(o.showLegend=s.showLegend)}return a>1&&"sublayerTitleMode"in r&&r.sublayerTitleMode!=="service-name"&&(r.sublayerTitleMode="item-title-and-service-name"),o}return s}async function Uon(i,e,t){if(e?.layers&&e?.tables)return ule(e);const r=r_(i.url);if(!r)return 1;const n=await t.fetchServiceMetadata(r.url.path,{customParameters:TB(e)?.customParameters}).catch(()=>null);return(e?.layers?.length??n?.layers?.length??0)+(e?.tables?.length??n?.tables?.length??0)}function zon(i,e){const{layerId:t}=e,r=i.layers?.find(n=>n.id===t)||i.tables?.find(n=>n.id===t);return r&&Hon(r,e)?r:null}function Von(i){return i.type!=="stream"&&"layerId"in i}function Hon(i,e){return!(e.type==="feature"&&"layerType"in i&&i.layerType==="SubtypeGroupLayer"||e.type==="subtype-group"&&!("layerType"in i))}async function Won(i,e){const{layersJSON:t}=await bXe(i,e);if(!t)return null;const r=[...t.layers,...t.tables];return n=>r.find(s=>s.id===n.id)}const qon=Object.freeze(Object.defineProperty({__proto__:null,load:kon},Symbol.toStringTag,{value:"Module"}));function pWt(i){return i&&"getAtOrigin"in i&&"originOf"in i}function hoe(i){i?.writtenProperties&&i.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{pWt(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}function t7e(i){if(Ho.apiKey&&oze(i.portal.url))throw new qe("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${i.portal.url} when using an api key`)}async function Yon(i){const e=[];for(const t of i.allLayers)if("beforeSave"in t&&typeof t.beforeSave=="function"){const r=t.beforeSave();r&&e.push(r)}await Promise.allSettled(e)}const Xon=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function fWt(i,e,t){let r=(i.messages??[]).filter(({type:n})=>n==="error").map(({name:n,message:s,details:o})=>new qe(n,s,o));if(i.blockedRelativeUrls&&(r=r.concat(i.blockedRelativeUrls.map(n=>new qe("url:unsupported",`Relative url '${n}' is not supported`)))),t){const{ignoreUnsupported:n,supplementalUnsupportedErrors:s=[],requiredPropertyChecksDisabled:o}=t;n&&(r=r.filter(({name:a})=>!(Xon.has(a)||s.includes(a)))),o&&(r=r.filter(a=>a.name!=="web-document-write:property-required"))}if(r.length>0)throw new qe(e.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}function Jon(i,e,t){const r=t(i);if(!r.isValid)throw new qe(`${e}:invalid-parameters`,r.errorMessage,{layer:i})}async function mWt(i){const{layer:e,errorNamePrefix:t,validateLayer:r}=i;await e.load(),Jon(e,t,r)}function i0t(i,e){return`Layer (title: ${i.title}, id: ${i.id}) of type '${i.declaredClass}' ${e}`}function gWt(i){const{item:e,errorNamePrefix:t,layer:r,validateItem:n}=i;if(t7e(e),Kon(i),n){const s=n(e);if(!s.isValid)throw new qe(`${t}:invalid-parameters`,s.errorMessage,{layer:r})}}function Kon(i){const{item:e,itemType:t,additionalItemType:r,errorNamePrefix:n,layer:s}=i,o=[t];if(r&&o.push(r),!o.includes(e.type)){const a=o.map(l=>`'${l}'`).join(", ");throw new qe(`${n}:portal-item-wrong-type`,`Portal item type should be one of: "${a}"`,{item:e,layer:s})}}function Zon(i){const{layer:e,errorNamePrefix:t}=i,{portalItem:r}=e;if(!r)throw new qe(`${t}:portal-item-not-set`,i0t(e,"requires the portalItem property to be set"));if(!r.loaded)throw new qe(`${t}:portal-item-not-loaded`,i0t(e,"cannot be saved to a portal item that does not exist or is inaccessible"));gWt({...i,item:r})}function Qon(i){const{newItem:e,itemType:t}=i;let r=yg.from(e);return r.id&&(r=r.clone(),r.id=null),r.type??=t,r.portal??=Bu.getDefault(),gWt({...i,item:r}),r}function yWt(i){return coe(i,"portal-item")}async function vWt(i,e,t){"beforeSave"in i&&typeof i.beforeSave=="function"&&await i.beforeSave();const r=i.write({},e);return await Promise.all(e.resources?.pendingOperations??[]),fWt(e,{errorName:"layer-write:unsupported"},t),r}function _Wt(i){EW(i,_b.JSAPI),i.typeKeywords&&(i.typeKeywords=i.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function ean(i,e,t){const r=i.portal;await r.signIn(),await r.user?.addItem({item:i,data:e,folder:t?.folder})}async function Lle(i,e){const{layer:t,createItemData:r,createJSONContext:n,saveResources:s,supplementalUnsupportedErrors:o}=i;await mWt(i),Zon(i);const a=t.portalItem,l=n?n(a):yWt(a),u=await vWt(t,l,{...e,supplementalUnsupportedErrors:o}),c=await r({layer:t,layerJSON:u},a);return _Wt(a),await a.update({data:c}),hoe(l),await s?.(a,l),a}async function Nle(i,e){const{layer:t,createItemData:r,createJSONContext:n,setItemProperties:s,saveResources:o,supplementalUnsupportedErrors:a}=i;await mWt(i);const l=Qon(i),u=n?n(l):yWt(l),c=await vWt(t,u,{...e,supplementalUnsupportedErrors:a}),h=await r({layer:t,layerJSON:c},l);return await s(t,l),_Wt(l),await ean(l,h,e),t.portalItem=l,hoe(u),await o?.(l,u),l}const bWt="Feature Service",wWt="feature-layer-utils",tan=`${wWt}-save`,ian=`${wWt}-save-as`;function xWt(i){return{isValid:FYi(i)&&(i.type!=="feature"||!i.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function SWt(i){const e=[],t=[];for(const{layer:r,layerJSON:n}of i)r.isTable?t.push(n):e.push(n);return{layers:e,tables:t}}function TWt(i){return SWt([i])}async function ran(i,e){return/\/\d+\/?$/.test(i.url)?TWt(e[0]):nan(e,i)}async function nan(i,e){if(i.reverse(),!e)return SWt(i);const t=await san(e,i);for(const r of i)CWt(r.layer,r.layerJSON,t);return lan(t,i),t}async function san(i,e){let t=await i.fetchData("json");if(oan(t))return t;t||={},aan(t);const{layer:{url:r,customParameters:n,apiKey:s}}=e[0];return await uan(t,{url:r??"",customParameters:n,apiKey:s},e.map(o=>o.layer.layerId)),t}function oan(i){return!!(i&&Array.isArray(i.layers)&&Array.isArray(i.tables))}function aan(i){i.layers||=[],i.tables||=[]}function lan(i,e){const t=[],r=[];for(const{layer:n}of e){const{isTable:s,layerId:o}=n;s?r.push(o):t.push(o)}r0t(i.layers,t),r0t(i.tables,r)}function r0t(i,e){if(i.length<2)return;const t=[];for(const{id:r}of i)t.push(r);UB(t.sort(n0t),e.slice().sort(n0t))&&i.sort((r,n)=>{const s=e.indexOf(r.id),o=e.indexOf(n.id);return so?1:0})}function n0t(i,e){return ie?1:0}async function uan(i,e,t){const{url:r,customParameters:n,apiKey:s}=e,{serviceJSON:o,layersJSON:a}=await bXe(r,{customParameters:n,apiKey:s}),l=s0t(i.layers,o.layers,t),u=s0t(i.tables,o.tables,t);i.layers=l.itemResources,i.tables=u.itemResources;const c=[...l.added,...u.added],h=a?[...a.layers,...a.tables]:[];await can(i,c,r,h)}function s0t(i,e,t){const r=P4e(i,e,(s,o)=>s.id===o.id);i=i.filter(s=>!r.removed.some(o=>o.id===s.id));const n=r.added;return n.forEach(({id:s})=>{i.push({id:s})}),{itemResources:i,added:n.filter(({id:s})=>!t.includes(s))}}async function can(i,e,t,r){const n=await han(e),s=e.map(({id:o,type:a})=>new(n.get(a))({url:t,layerId:o,sourceJSON:r.find(({id:l})=>l===o)}));await Promise.allSettled(s.map(o=>o.load())),s.forEach(o=>{const{layerId:a,loaded:l,defaultPopupTemplate:u}=o;if(!l||u==null)return;const c={id:a,popupInfo:u.toJSON()};o.operationalLayerType!=="ArcGISFeatureLayer"&&(c.layerType=o.operationalLayerType),CWt(o,c,i)})}async function han(i){const e=[];i.forEach(({type:n})=>{const s=dan(n),o=xv[s];e.push(o())});const t=await Promise.all(e),r=new Map;return i.forEach(({type:n},s)=>{r.set(n,t[s])}),r}function dan(i){let e;switch(i){case"Feature Layer":case"Table":e="FeatureLayer";break;case"Oriented Imagery Layer":e="OrientedImageryLayer";break;case"Catalog Layer":e="CatalogLayer"}return e}function CWt(i,e,t){i.isTable?o0t(t.tables,e):o0t(t.layers,e)}function o0t(i,e){const t=i.findIndex(({id:r})=>r===e.id);t===-1?i.push(e):i[t]=e}async function pan(i,e){const{url:t,layerId:r,title:n,fullExtent:s,isTable:o}=i,a=r_(t);e.url=a?.serverType==="FeatureServer"?t:`${t}/${r}`,e.title||=n,e.extent=null,o||s==null||(e.extent=await J2e(s)),IW(e,_b.METADATA),IW(e,_b.MULTI_LAYER),EW(e,_b.SINGLE_LAYER),o&&EW(e,_b.TABLE)}async function fan(i,e){return Lle({layer:i,itemType:bWt,validateLayer:xWt,createItemData:(t,r)=>ran(r,[t]),errorNamePrefix:tan},e)}async function man(i,e,t){return Nle({layer:i,itemType:bWt,validateLayer:xWt,createItemData:(r,n)=>Promise.resolve(TWt(r)),errorNamePrefix:ian,newItem:e,setItemProperties:pan},t)}const EWt=Object.freeze(Object.defineProperty({__proto__:null,save:fan,saveAs:man},Symbol.toStringTag,{value:"Module"}));let $le=class{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&UB(this.parts,e.parts,(t,r)=>t.equals(r))}isOnService(e){return this.parts.every(t=>t.isOnService(e))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(t.length===1)return t[0].toBlob(e);const r=await Promise.all(t.map(n=>n.toBlob(e)));return hn(e),new Blob(r)}},mKe=class{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await zi(this.partUrl,{responseType:"blob"});return hn(e),t}};function a0t(i){return gan(i?.source)}function l0t(i){return Array.isArray(i)?i.every(e=>e instanceof $le):!1}const u0t=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c0t=/\.(gltf|glb)/i;function gan(i){return i?Array.isArray(i)?i.some(h0t):h0t(i):!1}function h0t(i){if(i instanceof File){const{type:e,name:t}=i;return u0t.test(e)||c0t.test(t)}return u0t.test(i.assetMimeType)||c0t.test(i.assetName)}function IWt(i,e){if(!i)return!1;const{source:t}=i;return van(t,e)}function yan(i,e){if(i===e)return!0;const{source:t}=i,{source:r}=e;if(t===r)return!0;if(l0t(t)&&l0t(r)){if(t.length!==r.length)return!1;const n=(a,l)=>a.assetNamel.assetName?1:0,s=[...t].sort(n),o=[...r].sort(n);for(let a=0;a0&&t.every(r=>d0t(r,e))}return d0t(i,e)}function d0t(i,e){return i instanceof $le&&i.isOnService(e)}function _an(i,e){return i instanceof File?wDt(i,e):yR(i.assetMimeType,e)??rk(i.assetName,e)}function ban(i){return Array.isArray(i)?i:[i]}function wan(i){return!!i.original}async function p0t(i,e,t){const{geometry:r}=e,n={...e.attributes};if(t!=null&&r?.type==="mesh"){const{transformFieldRoles:s}=t,{origin:o,spatialReference:a,transform:l,vertexSpace:u}=r,c=u.type==="local",h=i.spatialReference,p=h.isGeographic,m=Ya(h,a),v=m||fE(h)&&(fE(a)||Nb(a));if(!(c&&p&&v||!c&&!p&&m))return null;const w=Fie(o,a,h);if(w==null)return null;if(n[s.originX]=w.x,n[s.originY]=w.y,n[s.originZ]=w.z??0,l!=null){const{translation:S,scale:I,rotation:R}=l,L=c?1:Bve(a)/Bve(h);n[s.translationX]=S[0]*L,n[s.translationY]=S[2]*L,n[s.translationZ]=-S[1]*L,n[s.scaleX]=I[0],n[s.scaleY]=I[2],n[s.scaleZ]=I[1],n[s.rotationX]=R[0],n[s.rotationY]=R[2],n[s.rotationZ]=-R[1],n[s.rotationDeg]=R[3]}return{attributes:n}}return r==null?{attributes:n}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:n}}async function xan(i,e){const t=await Promise.all((e.addAttachments??[]).map(s=>f0t(i,s))),r=await Promise.all((e.updateAttachments??[]).map(s=>f0t(i,s))),n=e.deleteAttachments??[];return t.length||r.length||n.length?{adds:t,updates:r,deletes:[...n]}:null}async function f0t(i,e){const{feature:t,attachment:r}=e,{globalId:n,name:s,contentType:o,data:a,uploadId:l}=r,u={globalId:n};if(t&&("attributes"in t?u.parentGlobalId=t.attributes?.[i.globalIdField]:t.globalId&&(u.parentGlobalId=t.globalId)),l)u.uploadId=l;else if(a){const c=await rEt(a);c&&(u.contentType=c.mediaType,u.data=c.data),a instanceof File&&(u.name=a.name)}return s&&(u.name=s),o&&(u.contentType=o),u}function San(i,e,t){if(!e||e.length===0)return[];if(t&&sWt(e))return e.map(n=>n.globalId);if(rWt(e))return e.map(n=>n.objectId);const r=t?i.globalIdField:i.objectIdField;return r?e.map(n=>n.getAttribute(r)):[]}function Tan(i){const e=i?.assetMaps;if(e){for(const n of e.addResults)n.success||di.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`);for(const n of e.updateResults)n.success||di.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`)}const t=i?.attachments,r={addFeatureResults:i?.addResults?.map(sP)??[],updateFeatureResults:i?.updateResults?.map(sP)??[],deleteFeatureResults:i?.deleteResults?.map(sP)??[],addAttachmentResults:t?.addResults?t.addResults.map(sP):[],updateAttachmentResults:t?.updateResults?t.updateResults.map(sP):[],deleteAttachmentResults:t?.deleteResults?t.deleteResults.map(sP):[]};return i?.editMoment&&(r.editMoment=i.editMoment),r}function sP(i){const e=i.success===!0?null:i.error||{code:void 0,description:void 0};return{objectId:i.objectId,globalId:i.globalId,error:e?new qe("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function lpe(i,e){return new Us({attributes:i.attributes,geometry:Ro({...i.geometry,spatialReference:e})})}function Can(i,e){return{adds:i?.adds?.map(t=>lpe(t,e))||[],updates:i?.updates?.map(t=>({original:lpe(t[0],e),current:lpe(t[1],e)}))||[],deletes:i?.deletes?.map(t=>lpe(t,e))||[],spatialReference:e}}function Ean(i){const e=i.details.raw,t=+e.code,r=+e.extendedCode;return t===500&&(r===-2147217144||r===-2147467261)}const Ian=new Rs({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Aan=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),Man=new Rs({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let jU=class extends ef{constructor(){super(...arguments),this.type="feature-layer",this.refresh=xd(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:r,infoFor3D:n,gdbVersion:s,spatialReference:o,fieldsIndex:a}=this.layer,l=yi("featurelayer-pbf")&&e?.query.supportsFormatPBF&&n==null,u=e?.operations?.supportsQueryAttachments??!1;return new LDt({url:t.path,pbfSupported:l,fieldsIndex:a,infoFor3D:n,dynamicDataSource:r,gdbVersion:s,sourceSpatialReference:o,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+n+"/addAttachment",o=this._getLayerRequestOptions(),a=this._getFormDataForAttachment(t,o.query);try{const l=await zi(s,{body:a});return sP(l.data.addAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(n,l)}}async updateAttachment(e,t,r){await this.load();const{layer:n}=this;await u8(n,"editing");const s=e.attributes[n.objectIdField],o=n.parsedUrl.path+"/"+s+"/updateAttachment",a=this._getLayerRequestOptions({query:{attachmentId:t}}),l=this._getFormDataForAttachment(r,a.query);try{const u=await zi(o,{body:l});return sP(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=r.infoFor3D,s=n!=null,o=s||(t?.globalIdUsed??!1),a=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,l=e.addFeatures?.map(B=>p0t(this.layer,B,n))??[],u=(await Promise.all(l)).filter(Ga),c=e.updateFeatures?.map(B=>p0t(this.layer,B,n))??[],h=(await Promise.all(c)).filter(Ga),p=San(this.layer,e.deleteFeatures,o);uOt(u,h,r.spatialReference);const m=await xan(this.layer,e),v=r.capabilities.editing.supportsAsyncApplyEdits&&s,w=t?.gdbVersion||r.gdbVersion,S={gdbVersion:w,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:o,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:v};await csr(this.layer.url,w,!0);const I=VOt(this.layer.url,w||null);if(await usr(r.url,w,r.historicMoment))throw new qe("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:r.layerId,adds:u,updates:h,deletes:p,attachments:m,assetMaps:a}]),S.returnServiceEditsOption=Ian.toJSON(t?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(S.adds=u.length?JSON.stringify(u):null,S.updates=h.length?JSON.stringify(h):null,S.deletes=p.length?o?JSON.stringify(p):p.join(","):null,S.attachments=m&&JSON.stringify(m),S.assetMaps=a!=null?JSON.stringify(a):void 0);const R=this._getLayerRequestOptions({method:"post",query:S});I&&(R.authMode="immediate",R.query.returnEditMoment=!0,R.query.sessionId=GOt);const L=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;let k;try{k=v?await this._asyncApplyEdits(L+"/applyEdits",R):await zi(L+"/applyEdits",R)}catch(B){if(!Ean(B))throw B;R.authMode="immediate",k=v?await this._asyncApplyEdits(L+"/applyEdits",R):await zi(L+"/applyEdits",R)}return!r.capabilities.operations?.supportsEditing&&r.effectiveCapabilities?.operations?.supportsEditing&&await no?.findCredential(r.url)?.refreshToken(),this._createEditsResult(k)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await u8(r,"editing");const n=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+n+"/deleteAttachments";try{return(await zi(s,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(sP)}catch(o){throw this._createAttachmentErrorResult(n,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const r=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:n,url:s}=this.layer,{data:o}=await zi(`${s}/${n}`,r),{id:a,extent:l,fullExtent:u,timeExtent:c}=o,h=l||u;return{id:a,fullExtent:h&&hr.fromJSON(h),timeExtent:c&&Eg.fromJSON({start:c[0],end:c[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&r.features.length&&r.features.forEach(n=>{const s=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:o})=>{if(o){const a=o.toLowerCase();a&&a in s&&o!==a&&(s[o]=s[a],delete s[a])}})}),r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!Fx(this.layer.url))return"unavailable";const e=Iu(this.layer.url,"status"),t=await zi(e,{query:{f:"json"}});return Man.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await Promise.resolve().then(()=>b7n);return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await zi(e,t)).data.statusUrl;for(;;){const n=(await zi(r,{query:{f:"json"},responseType:"json"})).data;switch(n.status){case"Completed":return zi(n.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new qe("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new qe("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await jk(Oan)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const n={};yi("featurelayer-advanced-symbols")&&(n.returnAdvancedSymbols=!0),t?.cacheBust&&(n._ts=Date.now());const{data:s}=await zi(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:n,signal:t?.signal}));e=s}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!Aan.has(r))throw new qe("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!=="Table"&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const r=KA(e.geometryType).renderer;Qp("drawingInfo.renderer",r,e)}if(e.geometryType==="esriGeometryMultiPatch"&&e.infoFor3D&&(e.geometryType="mesh"),e.extent==null)try{const{data:r}=await zi(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(r){_a(r)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const r=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const n=new Array,s=new Map;for(const o of r){const{geometry:a}=o,{vertexSpace:l}=a;if(VS(l))n.push(a);else{const u=yUr(a);s.set(u,a),o.geometry=u,n.push(u)}}await this.uploadAssets(n);for(const[o,a]of s)a.addExternalSources(o.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,n=this.layer.parsedUrl;for(const s of e){const o=s.geometry,{metadata:a}=o,l=a.getExternalSourcesOnService(n),u=s.getAttribute(r);if(l.length===0){di.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:c}=l.find(wan)??l[0];for(const h of c)h.parts.length===1?t.push({globalId:NVe(),parentGlobalId:u,assetName:h.assetName,assetHash:h.parts[0].partHash,flags:[]}):di.getLogger(this).error(`Skipping asset ${h.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,n=[];let s=null;if(Array.isArray(t))for(const a of t)n.push({id:a.id,editedFeatures:a.editedFeatures}),a.id===r&&(s={addResults:a.addResults??[],updateResults:a.updateResults??[],deleteResults:a.deleteResults??[],attachments:a.attachments,editMoment:a.editMoment});else s=t;const o=Tan(s);if(n.length>0){o.editedFeatureResults=[];for(const a of n){const{editedFeatures:l}=a,u=l?.spatialReference?new Xi(l.spatialReference):null;o.editedFeatureResults.push({layerId:a.id,editedFeatures:Can(l,u)})}}return o}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,n=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new qe("feature-layer-source:attachment-failure",r,{code:n})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const n in t){const s=t[n];s!=null&&(r.set?r.set(n,s):r.append(n,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:n}=this.layer;return{...e,query:{gdbVersion:r,layer:n?JSON.stringify({source:n}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:n,parsedUrl:s}=t;if(n==null||r==null)return e;const o=Sdr(n);if(o==null)return e;const a=Iu(s.path,`../${o.id}`),l=new Array,u=new Array;for(const S of e)S.geometry.metadata.getExternalSourcesOnService(s).length>0?u.push(S):l.push(S);const c=u.map(S=>S.getAttribute(r)).filter(Ga);if(c.length===0)return e;const{assetMapFieldRoles:{parentGlobalId:h,assetHash:p}}=n,m=new Kn;m.where=`${h} IN (${c.map(S=>`'${S}'`)})`,m.outFields=[p,h],m.returnGeometry=!1;const v=await t9(a,m),{features:w}=v;return w.length===0?e:[...l,...u.filter(S=>{const I=S.getAttribute(r);if(!I)return!0;const{metadata:R}=S.geometry,L=w.filter(B=>B.getAttribute(h)===I);if(L.length===0)return!0;const k=L.map(B=>B.getAttribute(p));return R.getExternalSourcesOnService(s).flatMap(({source:B})=>B.flatMap($=>$.parts.map(V=>V.partHash))).some(B=>k.every($=>B!==$))})]}};x([D()],jU.prototype,"type",void 0),x([D({constructOnly:!0})],jU.prototype,"layer",void 0),x([D({readOnly:!0})],jU.prototype,"queryTask",null),jU=x([Qe("esri.layers.graphics.sources.FeatureLayerSource")],jU);const Oan=1e3,AWt=jU,MWt=Object.freeze(Object.defineProperty({__proto__:null,default:AWt},Symbol.toStringTag,{value:"Module"}));let m0t=Pan();function Pan(){return new d3(50)}async function Ran(i,e=null){if(!i.isPrimitive){const r=i.resource.href;if(!r)throw new qe("symbol:invalid-resource","The symbol does not have a valid resource");const n=m0t.get(r);if(n!==void 0)return n;const{fetch:s}=await Promise.resolve().then(()=>XUn),o=await s(r,{disableTextures:!0}),a=Int(o.referenceBoundingBox,gr());return m0t.put(r,a),a}if(!i.resource?.primitive)throw new qe("symbol:invalid-resource","The symbol does not have a valid resource");const t=Dx(JQi(i.resource.primitive));if(e!=null)for(let r=0;r{a||(o=require("fs"),a=require("path"))},r=function(A,ue){return l(),A=a.normalize(A),o.readFileSync(A,ue?void 0:"utf8")},s=A=>{var ue=r(A,!0);return ue.buffer||(ue=new Uint8Array(ue)),ue},n=(A,ue,G)=>{l(),A=a.normalize(A),o.readFile(A,function(E,_){E?G(E):ue(_.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(A){if(!(A instanceof Fe))throw A}),process.on("unhandledRejection",function(A){throw A}),i.inspect=function(){return"[Emscripten Module object]"}):(c||h)&&(h?m=self.location.href:typeof document<"u"&&document.currentScript&&(m=document.currentScript.src),IK&&(m=IK),m=m.indexOf("blob:")!==0?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=A=>{var ue=new XMLHttpRequest;return ue.open("GET",A,!1),ue.send(null),ue.responseText},h&&(s=A=>{var ue=new XMLHttpRequest;return ue.open("GET",A,!1),ue.responseType="arraybuffer",ue.send(null),new Uint8Array(ue.response)}),n=(A,ue,G)=>{var E=new XMLHttpRequest;E.open("GET",A,!0),E.responseType="arraybuffer",E.onload=()=>{E.status==200||E.status==0&&E.response?ue(E.response):G()},E.onerror=G,E.send(null)}),i.print||console.log.bind(console);var w,S,I=i.printErr||console.warn.bind(console);Object.assign(i,u),u=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(w=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&tt("no native wasm support detected");var R,L,k,B,$,V,Y=!1,K=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Q(A,ue,G){for(var E=ue+G,_=ue;A[_]&&!(_>=E);)++_;if(_-ue>16&&A.buffer&&K)return K.decode(A.subarray(ue,_));for(var g="";ue<_;){var b=A[ue++];if(128&b){var C=63&A[ue++];if((224&b)!=192){var O=63&A[ue++];if((b=(240&b)==224?(15&b)<<12|C<<6|O:(7&b)<<18|C<<12|O<<6|63&A[ue++])<65536)g+=String.fromCharCode(b);else{var F=b-65536;g+=String.fromCharCode(55296|F>>10,56320|1023&F)}}else g+=String.fromCharCode((31&b)<<6|C)}else g+=String.fromCharCode(b)}return g}function re(A,ue){return A?Q(k,A,ue):""}function ne(A){R=A,i.HEAP8=L=new Int8Array(A),i.HEAP16=new Int16Array(A),i.HEAP32=B=new Int32Array(A),i.HEAPU8=k=new Uint8Array(A),i.HEAPU16=new Uint16Array(A),i.HEAPU32=$=new Uint32Array(A),i.HEAPF32=new Float32Array(A),i.HEAPF64=new Float64Array(A)}i.INITIAL_MEMORY;var de=[],pe=[],H=[];function Z(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)be(i.preRun.shift());Ue(de)}function ae(){Ue(pe)}function fe(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Ie(i.postRun.shift());Ue(H)}function be(A){de.unshift(A)}function _e(A){pe.unshift(A)}function Ie(A){H.unshift(A)}var Te=0,Be=null;function Ve(A){Te++,i.monitorRunDependencies&&i.monitorRunDependencies(Te)}function $e(A){if(Te--,i.monitorRunDependencies&&i.monitorRunDependencies(Te),Te==0&&Be){var ue=Be;Be=null,ue()}}function tt(A){i.onAbort&&i.onAbort(A),I(A="Aborted("+A+")"),Y=!0,A+=". Build with -sASSERTIONS for more info.";var ue=new WebAssembly.RuntimeError(A);throw t(ue),ue}var yt,Ct="data:application/octet-stream;base64,";function ot(A){return A.startsWith(Ct)}function vt(A){return A.startsWith("file://")}function At(A){try{if(A==yt&&w)return new Uint8Array(w);if(s)return s(A);throw"both async and sync fetching of the wasm failed"}catch(ue){tt(ue)}}function Je(){if(!w&&(c||h)){if(typeof fetch=="function"&&!vt(yt))return fetch(yt,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+yt+"'";return A.arrayBuffer()}).catch(function(){return At(yt)});if(n)return new Promise(function(A,ue){n(yt,function(G){A(new Uint8Array(G))},ue)})}return Promise.resolve().then(function(){return At(yt)})}function it(){var A={a:Me};function ue(g,b){var C=g.exports;i.asm=C,ne((S=i.asm.g).buffer),V=i.asm.m,_e(i.asm.h),$e()}function G(g){ue(g.instance)}function E(g){return Je().then(function(b){return WebAssembly.instantiate(b,A)}).then(function(b){return b}).then(g,function(b){I("failed to asynchronously prepare wasm: "+b),tt(b)})}function _(){return w||typeof WebAssembly.instantiateStreaming!="function"||ot(yt)||vt(yt)||p||typeof fetch!="function"?E(G):fetch(yt,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,A).then(G,function(b){return I("wasm streaming compile failed: "+b),I("falling back to ArrayBuffer instantiation"),E(G)})})}if(Ve(),i.instantiateWasm)try{return i.instantiateWasm(A,ue)}catch(g){return I("Module.instantiateWasm callback failed with error: "+g),!1}return _().catch(t),{}}function Ue(A){for(;A.length>0;){var ue=A.shift();if(typeof ue!="function"){var G=ue.func;typeof G=="number"?ue.arg===void 0?st(G)():st(G)(ue.arg):G(ue.arg===void 0?null:ue.arg)}else ue(i)}}ot(yt="lerc-wasm.wasm")||(yt=v(yt));var ct=[];function st(A){var ue=ct[A];return ue||(A>=ct.length&&(ct.length=A+1),ct[A]=ue=V.get(A)),ue}function Ze(A,ue,G,E){tt("Assertion failed: "+re(A)+", at: "+[ue?re(ue):"unknown filename",G,E?re(E):"unknown function"])}function ye(A){return ht(A+24)+24}function Ke(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(ue){$[this.ptr+4>>2]=ue},this.get_type=function(){return $[this.ptr+4>>2]},this.set_destructor=function(ue){$[this.ptr+8>>2]=ue},this.get_destructor=function(){return $[this.ptr+8>>2]},this.set_refcount=function(ue){B[this.ptr>>2]=ue},this.set_caught=function(ue){ue=ue?1:0,L[this.ptr+12>>0]=ue},this.get_caught=function(){return L[this.ptr+12>>0]!=0},this.set_rethrown=function(ue){ue=ue?1:0,L[this.ptr+13>>0]=ue},this.get_rethrown=function(){return L[this.ptr+13>>0]!=0},this.init=function(ue,G){this.set_adjusted_ptr(0),this.set_type(ue),this.set_destructor(G),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var ue=B[this.ptr>>2];B[this.ptr>>2]=ue+1},this.release_ref=function(){var ue=B[this.ptr>>2];return B[this.ptr>>2]=ue-1,ue===1},this.set_adjusted_ptr=function(ue){$[this.ptr+16>>2]=ue},this.get_adjusted_ptr=function(){return $[this.ptr+16>>2]},this.get_exception_ptr=function(){if(_t(this.get_type()))return $[this.excPtr>>2];var ue=this.get_adjusted_ptr();return ue!==0?ue:this.excPtr}}function ke(A,ue,G){throw new Ke(A).init(ue,G),A}function me(){tt("")}function ie(A,ue,G){k.copyWithin(A,ue,ue+G)}function ge(){return 2147483648}function je(A){try{return S.grow(A-R.byteLength+65535>>>16),ne(S.buffer),1}catch{}}function rt(A){var ue=k.length;A>>>=0;var G=ge();if(A>G)return!1;let E=(b,C)=>b+(C-b%C)%C;for(var _=1;_<=4;_*=2){var g=ue*(1+.2/_);if(g=Math.min(g,A+100663296),je(Math.min(G,E(Math.max(A,g),65536))))return!0}return!1}var Me={a:Ze,c:ye,b:ke,d:me,f:ie,e:rt};it(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.h).apply(null,arguments)},i._lerc_getBlobInfo=function(){return(i._lerc_getBlobInfo=i.asm.i).apply(null,arguments)},i._lerc_getDataRanges=function(){return(i._lerc_getDataRanges=i.asm.j).apply(null,arguments)},i._lerc_decode=function(){return(i._lerc_decode=i.asm.k).apply(null,arguments)},i._lerc_decode_4D=function(){return(i._lerc_decode_4D=i.asm.l).apply(null,arguments)};var ht=i._malloc=function(){return(ht=i._malloc=i.asm.n).apply(null,arguments)};i._free=function(){return(i._free=i.asm.o).apply(null,arguments)};var Ht,_t=i.___cxa_is_pointer_type=function(){return(_t=i.___cxa_is_pointer_type=i.asm.p).apply(null,arguments)};function Fe(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function Yt(A){function ue(){Ht||(Ht=!0,i.calledRun=!0,Y||(ae(),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),fe()))}Te>0||(Z(),Te>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),ue()},1)):ue()))}if(Be=function A(){Ht||Yt(),Ht||(Be=A)},i.run=Yt,i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Yt(),i.ready},g0t.exports=y0t;const Fan=Cg(OWt.exports),kan=Object.freeze(Object.defineProperty({__proto__:null,default:Fan},Symbol.toStringTag,{value:"Module"})),Lan=Object.freeze(Object.defineProperty({__proto__:null,l:kan},Symbol.toStringTag,{value:"Module"})),PWt="Image Service",Nan="imagery-layer-save",$an="imagery-layer-save-as",Ban="imagery-tile-layer-save",jan="imagery-tile-layer-save-as";function RWt(i){if(i.type==="imagery")return{isValid:!0};const{raster:e}=i,t=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:t?.datasetFormat==="RasterTileServer"&&(t.tileType==="Raster"||t.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function DWt(i){const e=i.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function Gan(i,e){const{parsedUrl:t,title:r,fullExtent:n}=i;e.url=t.path,e.title||=r;try{e.extent=await J2e(n)}catch{e.extent=void 0}IW(e,_b.METADATA),i.type==="imagery-tile"&&EW(e,_b.TILED_IMAGERY)}async function Uan(i,e){const t=i.type==="imagery"?Nan:Ban;return Lle({layer:i,itemType:PWt,validateLayer:RWt,createItemData:DWt,errorNamePrefix:t},e)}async function zan(i,e,t){const r=i.type==="imagery"?$an:jan;return Nle({layer:i,itemType:PWt,validateLayer:RWt,createItemData:DWt,errorNamePrefix:r,newItem:e,setItemProperties:Gan},t)}const FWt=Object.freeze(Object.defineProperty({__proto__:null,save:Uan,saveAs:zan},Symbol.toStringTag,{value:"Module"}));var GU;const LPe=new WeakMap;let Van=0,DI=GU=class extends Ci{constructor(i){super(i),this.wrap="repeat"}get url(){return this._get("url")||null}set url(i){this._set("url",i),i&&this._set("data",null)}get data(){return this._get("data")||null}set data(i){this._set("data",i),i&&this._set("url",null)}writeData(i,e,t,r){if(i instanceof HTMLImageElement){const n={type:"image-element",src:gE(i.src,r),crossOrigin:i.crossOrigin};e[t]=n}else if(i instanceof HTMLCanvasElement){const n=i.getContext("2d").getImageData(0,0,i.width,i.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[t]=s}else if(i instanceof HTMLVideoElement){const n={type:"video-element",src:gE(i.src,r),autoplay:i.autoplay,loop:i.loop,muted:i.muted,crossOrigin:i.crossOrigin,preload:i.preload};e[t]=n}else if(i instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(i)};e[t]=n}}readData(i){switch(i.type){case"image-element":{const e=new Image;return e.src=i.src,e.crossOrigin=i.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(i.imageData),t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t.getContext("2d").putImageData(e,0,0),t}case"image-data":return this._decodeImageData(i.imageData);case"video-element":{const e=document.createElement("video");return e.src=i.src,e.crossOrigin=i.crossOrigin,e.autoplay=i.autoplay,e.loop=i.loop,e.muted=i.muted,e.preload=i.preload,e}default:return}}get transparent(){const i=this.data,e=this.url;if(i instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(i.getContext("2d").getImageData(0,0,i.width,i.height));if(i instanceof ImageData)return this._imageDataContainsTransparent(i);if(e){const t=e.substr(e.length-4,4).toLowerCase(),r=e.substr(0,15).toLocaleLowerCase();if(t===".png"||r==="data:image/png;")return!0}return!1}set transparent(i){this._overrideIfSome("transparent",i)}get contentHash(){const i=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(t="")=>`d:${t},t:${this.transparent},w:${i}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(LPe.has(this.data)||LPe.set(this.data,++Van),e(LPe.get(this.data))):e()}get memoryUsage(){let i=0;if(i+=this.url!=null?this.url.length:0,this.data!=null){const e=this.data;"data"in e?i+=e.data.byteLength:e instanceof HTMLImageElement?i+=e.naturalWidth*e.naturalHeight*3:e instanceof HTMLCanvasElement&&(i+=e.width*e.height*3)}return i}clone(){const i={url:this.url,data:this.data,wrap:this._cloneWrap()};return new GU(i)}cloneWithDeduplication(i){const e=i.get(this);if(e)return e;const t=this.clone();return i.set(this,t),t}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(i){let e="";for(let t=0;t=1),Ch(r.size===3||r.size===4);const{data:n,size:s,indices:o}=r;Ch(o.length%this._numIndexPerPrimitive==0),Ch(o.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let l=s*o[this._numIndexPerPrimitive*e[0]];oN.clear(),oN.push(l);const u=Do(n[l],n[l+1],n[l+2]),c=Ef(u);for(let m=0;m0&&++l;if(l<2)return;const u=new Array(8);for(let c=0;c<8;++c)u[c]=n[c]>0?new Uint32Array(n[c]):void 0;for(let c=0;c<8;++c)n[c]=0;for(let c=0;cKan());const $Pe=gr(),b0t=gr();function Qan(i,e){if(!i)return!1;const{size:t,data:r,indices:n}=i;Zo(e,0,0,0),Zo(X2,0,0,0);let s=0,o=0;for(let a=0;a1&&Gc(e,e,1/o),o>0}function tln(i,e,t){if(!i)return!1;Zo(t,0,0,0),Zo(X2,0,0,0);let r=0,n=0;const{size:s,data:o,indices:a}=i,l=a.length-1,u=l+(e?2:0);for(let c=0;c0?(hl(t,t,Gc(lm,lm,v)),r+=v):r===0&&(hl(X2,X2,lm),n++)}return r!==0?(Gc(t,t,1/r),!0):n!==0&&(Gc(t,X2,1/n),!0)}const lm=gr(),pP=gr(),upe=gr(),X2=gr();let iln=class{constructor(e){this.channel=e,this.id=vF()}};function w0t(i,e,t){for(let r=0;rr!==e);return t.length===0?null:t}let LWt=class NWt extends vKe{constructor(e,t,r=null,n=SP.Mesh,s=null,o=-1){super(),this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=s,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,l]of t)this._attributes.set(a,{...l,indices:zse(l.indices)}),a===tn.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new NWt(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,n)=>{r.exclusive=!1,t._attributes.set(n,r)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:Xan(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===SP.Mesh?this._computeAttachmentOriginTriangles(e):this.type===SP.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&c0(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.attributes.get(tn.POSITION);return Qan(t,e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(tn.POSITION);return tln(t,aln(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){const t=this.attributes.get(tn.POSITION);return eln(t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(tn.POSITION);if(!e||e.indices.length===0)return null;const t=this.type===SP.Mesh?3:1;Ch(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=QTe(e.indices.length/t);return new Jan(r,t,e)}get transformation(){return this._transformation??ZA}set transformation(e){this._transformation=e&&e!==ZA?Vse(e):null}addHighlight(){const e=new iln(n7e.Highlight);return this.highlights=sln(this.highlights,e),e}removeHighlight(e){this.highlights=oln(this.highlights,e)}};function aln(i,e){return!(!("isClosed"in i)||!i.isClosed)&&e.indices.length>2}function lln(i,e,t,r){const n=(o=>!Array.isArray(o[0]))(e)?(o,a)=>e[3*o+a]:(o,a)=>e[o][a],s=r?pu(r)/WF(r):1;return TVt(i,(o,a)=>Zo(o,n(a,0)*s,n(a,1)*s,n(a,2)),t)}function uln(i,e,t){const r=lln(x0t,i,e,t)?x0t:[0,0,1];return Math.abs(r[2])>Math.cos(Rx(80))?ig.Z:Math.abs(r[1])>Math.abs(r[0])?ig.Y:ig.X}const x0t=SVt();function cln(i){const e=dln(i.rings,i.hasZ,Xbe.CCW_IS_HOLE,i.spatialReference),t=new Array;let r=0,n=0;for(const a of e.polygons){const l=a.count,u=a.index,c=AUr(e.position,3*u,3*l),h=a.holeIndices.map(m=>m-u),p=zse(ybe(c,h,3));t.push({position:c,faces:p}),r+=c.length,n+=p.length}const s=hln(t,r,n),o=Array.isArray(s.position)?w8e(s.position,3,{originalIndices:s.faces}):w8e(s.position.buffer,6,{originalIndices:s.faces});return s.position=IUr(new Float64Array(o.buffer)),s.faces=o.indices,s}function hln(i,e,t){if(i.length===1)return i[0];const r=dbe(e),n=new Array(t);let s=0,o=0,a=0;for(const l of i){for(let u=0;u=0;v--){const w=i[v],S=t===Xbe.CCW_IS_HOLE&&pln(w,e,r);if(S&&n!==1)s[l++]=w;else{let I=w.length;for(let L=0;L0&&(a[c++]={index:m,count:w.length}),m=S?cpe(w,w.length-1,-1,p,m,w.length,e):cpe(w,0,1,p,m,w.length,e);for(let L=0;L0&&(a[c++]={index:m,count:k.length}),m=cpe(k,0,1,p,m,k.length,e)}l=0,R.count>0&&(o[u++]=R)}}for(let v=0;v0&&(a[c++]={index:m,count:w.length}),m=cpe(w,0,1,p,m,w.length,e)}return o.length=u,a.length=c,{position:p,polygons:o,outlines:a}}function cpe(i,e,t,r,n,s,o){n*=3;for(let a=0;aEti),t),s=await Sln(r,t);hn(t);const o=n(new $i({x:0,y:0,z:0,spatialReference:i.spatialReference}),s.url,{resolveFile:xln(s),signal:t?.signal,expectedType:s.type});o.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:l}=await o;i.vertexAttributes=a,i.components=l}function xln(i){const e=eae(i.url);return t=>{const r=s2e(t,e,e),n=r?r.replace(/^ *\.\//,""):null;return(n?i.files.get(n):null)??t}}async function Sln(i,e){if(Array.isArray(i)){if(!i.length)throw new qe("mesh-load-external:missing-assets","There must be at least one file to load");return i[0]instanceof File?Cln(i):Eln(i,e)}return UWt(i)}async function Tln(i,e){const{parts:t,assetMimeType:r,assetName:n}=i;if(t.length===1)return new Jbe(t[0].partUrl);const s=await i.toBlob(e);return hn(e),Jbe.fromBlob(s,qWt(n,r))}function UWt(i){return Jbe.fromBlob(i,qWt(i.name,i.type))}function Cln(i){return HWt(i.map(e=>({name:e.name,mimeType:e.type,source:UWt(e)})))}async function Eln(i,e){const t=await yve(i.map(async r=>{const n=await Tln(r);return hn(e),{name:r.assetName,mimeType:r.assetMimeType,source:n}}));if(xg(e))throw t.forEach(r=>r.source.dispose()),Oc();return HWt(t)}const zWt=/^model\/gltf\+json$/,VWt=/^model\/gltf-binary$/,o7e=/\.gltf$/i,Iln=/\.glb$/i;function HWt(i){const e=new Map;let t,r=null;for(const{name:n,mimeType:s,source:o}of i)r===null&&(zWt.test(s)||o7e.test(n)?(r=o.url,t="gltf"):(VWt.test(s)||Iln.test(n))&&(r=o.url,t="glb")),e.set(n,o.url),o.files.forEach((a,l)=>e.set(l,a));if(r==null)throw new qe("mesh-load-external:missing-files","Missing files to load external mesh source");return new Jbe(r,()=>i.forEach(({source:n})=>n.dispose()),e,t)}let Jbe=class WWt{constructor(e,t=()=>{},r=new Map,n){this.url=e,this.dispose=t,this.files=r,this.type=n}static fromBlob(e,t){const r=URL.createObjectURL(e);return new WWt(r,()=>URL.revokeObjectURL(r),void 0,t)}};function qWt(i,e){return zWt.test(e)||o7e.test(i)?"gltf":VWt.test(e)||o7e.test(i)?"glb":void 0}let C5=class extends qF{constructor(){super(),this.externalSources=new dr,this._explicitDisplaySource=null,this.addHandles(ju(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!a0t(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!yan(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>IWt(t,e))}get _implicitDisplaySource(){return this.externalSources.find(a0t)}};x([D()],C5.prototype,"externalSources",void 0),x([D()],C5.prototype,"displaySource",null),x([D()],C5.prototype,"_implicitDisplaySource",null),x([D()],C5.prototype,"_explicitDisplaySource",void 0),C5=x([Qe("esri.geometry.support.meshUtils.Metadata")],C5);function Aln(){const{faceDescriptions:i,faceVertexOffsets:e,uvScales:t}=Nln,r=4*i.length,n=new Float64Array(3*r),s=new Float32Array(3*r),o=new Float32Array(2*r),a=new Uint32Array(2*i.length*3);let l=0,u=0,c=0,h=0;for(let p=0;p=s&&c=4,S=m===2||m===4,I=v?t-1:t;for(let R=0;R<=I;R++){const L=R/I*2*Math.PI,k=v?0:.5;um[0]=k*Math.sin(L),um[1]=k*-Math.cos(L),um[2]=m<=2?.5:-.5;for(let B=0;B<3;B++)n[l++]=um[B],s[u++]=w?B===2?m<=1?1:-1:0:B===2?0:um[B]/k;o[c++]=(R+(v?.5:0))/t,o[c++]=m<=1?1*m/3:m<=3?1*(m-2)/3+1/3:1*(m-4)/3+2/3,S||m===0||R===t||(m!==5&&(a[h++]=p,a[h++]=p+1,a[h++]=p-t),m!==1&&(a[h++]=p,a[h++]=p-t,a[h++]=p-t-1)),p++}}return{position:n,normal:s,uv:o,faces:a}}function Rln(i,e){const t=typeof e=="number"?e:e!=null?e.width:1,r=typeof e=="number"?e:e!=null?e.height:1;switch(i){case"up":case"down":return{width:t,depth:r};case"north":case"south":return{width:t,height:r};case"east":case"west":return{depth:t,height:r}}}function Dln(i){const e=MK.facingAxisOrderSwap[i],t=MK.position,r=MK.normal,n=new Float64Array(t.length),s=new Float32Array(r.length);let o=0;for(let a=0;a<4;a++){const l=o;for(let u=0;u<3;u++){const c=e[u],h=Math.abs(c)-1,p=c>=0?1:-1;n[o]=t[l+h]*p,s[o]=r[l+h]*p,o++}}return{position:n,normal:s,uv:new Float32Array(MK.uv),faces:new Uint32Array(MK.faces),isPlane:!0}}const Yj=1,Xj=2,Jj=3,MK={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[Jj,Yj,Xj],west:[-Jj,-Yj,Xj],north:[-Yj,Jj,Xj],south:[Yj,-Jj,Xj],up:[Yj,Xj,Jj],down:[Yj,-Xj,-Jj]}};function hpe(i,e,t){i.isPlane||Fln(i),Lln(i,kln(t?.size,t?.unit,e.spatialReference));const{vertexAttributes:r,vertexSpace:n,transform:s}=nJe(i,e,{vertexSpace:t?.vertexSpace,geographic:t?.geographic});return{vertexAttributes:new Gy({...r,uv:i.uv}),vertexSpace:n,transform:s,components:[new DB({faces:i.faces,material:t?.material||null})],spatialReference:e.spatialReference}}function Fln(i){for(let e=0;e{this.addHandles(Ki(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(i=>i.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{components:i,spatialReference:e,vertexAttributes:t,vertexSpace:r}=this,n=t.position;if(n.length===0||i&&i.length===0)return new hr({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:e});if(VS(r)){const{_untransformedBounds:s,transform:o}=this;return fln(s,o,r,e)}return BWt(n,e)}get _untransformedBounds(){return $Wt(this.vertexAttributes.position)}get anchor(){const i=hbe(this.vertexSpace,this.spatialReference);if(i!=null)return i;const{center:e,zmin:t}=this._transformedExtent;return new $i({x:e.x,y:e.y,z:t,spatialReference:this.spatialReference})}get origin(){const i=hbe(this.vertexSpace,this.spatialReference);return i??this._transformedExtent.center}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(i){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(DB.from(i)),this.notifyChange("components"))}removeComponent(i){if(this._checkIfLoaded("removeComponent()")){if(this.components){const e=this.components.indexOf(i);if(e!==-1)return this.components.splice(e,1),void this.notifyChange("components")}QE().error("removeComponent()",qan)}}rotate(i,e,t,r){return izr(i,e,t,O0t),Bln(this,O0t,r),this}offset(i,e,t){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:n}=this,s=n?.position;if(!s)return this;if(VS(r)){const[o,a,l]=r.origin;r.origin=Do(o+i,a+e,l+t)}else{for(let o=0;os.cloneWithDeduplication(r,n))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:i,transform:this.transform?.clone()??null,metadata:this.metadata.clone()};return new k2(t)}cloneShallow(){return new k2({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(i){const e=Promise.resolve().then(()=>Czn),t=this.load(),r=await Promise.all([e,t]),{toBinaryGLTF:n}=r[0];return n(this,i)}get memoryUsage(){let i=0;if(i+=this.vertexAttributes.memoryUsage,this.components!=null)for(const e of this.components)i+=e.memoryUsage;return i}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(i){return!!this.loaded||(QE().error(i,Wan),!1)}static createBox(i,e){if(!(i instanceof $i))return QE().error(".createBox()",ote),null;const t=new k2(hpe(Aln(),i,e));return e?.imageFace&&e.imageFace!=="all"?Mln(t,e.imageFace):t}static createSphere(i,e){return i instanceof $i?new k2(hpe(Oln(e?.densificationFactor||0),i,e)):(QE().error(".createSphere()",ote),null)}static createCylinder(i,e){return i instanceof $i?new k2(hpe(Pln(e?.densificationFactor||0),i,e)):(QE().error(".createCylinder()",ote),null)}static createPlane(i,e){if(!(i instanceof $i))return QE().error(".createPlane()",ote),null;const t=e?.facing??"up",r=Rln(t,e?.size);return new k2(hpe(Dln(t),i,{...e,size:r}))}static createFromPolygon(i,e){if(!(i instanceof $s))return QE().error(".createFromPolygon()",Yan),null;const t=cln(i);return new k2({vertexAttributes:new Gy({position:t.position}),components:[new DB({faces:t.faces,shading:"flat",material:e?.material??null})],spatialReference:i.spatialReference,vertexSpace:new UC})}static async createFromGLTF(i,e,t){if(!(i instanceof $i)){const n=new v0t;throw QE().error(".createfromGLTF()",n.message),n}const{loadGLTFMesh:r}=await Jg(Promise.resolve().then(()=>Eti),t);return new k2(await r(i,e,t))}static async createFromFiles(i,e,t){zUe(QE(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=n=>QE().error(".createFromFiles()",n.message);if(!(i instanceof $i)){const n=new v0t;throw r(n),n}if(!t?.layer)throw new qe("invalid:no-layer","SceneLayer required for file to mesh conversion.");return t.layer.convertMesh(e,{location:i,...t})}static createWithExternalSource(i,e,t){const r=t?.extent??null,{x:n,y:s,z:o,spatialReference:a}=i,l=t?.transform?.clone()??new Tk,u=Do(n,s,o??0),c=Vpt(t?.vertexSpace??zpt(a),u),h={source:e,extent:r},p=new C5;return p.externalSources.push(h),new k2({metadata:p,transform:l,vertexSpace:c,spatialReference:a})}static createIncomplete(i,e){const{x:t,y:r,z:n,spatialReference:s}=i,o=e?.transform?.clone()??new Tk,a=Do(t,r,n??0),l=Vpt(e?.vertexSpace??zpt(s),a),u=new k2({transform:o,vertexSpace:l,spatialReference:s});return u.addResolvingPromise(Promise.reject(new qe("mesh-incomplete","Mesh resources are not complete"))),u}};x([D({type:[DB],json:{write:!0}})],Q0.prototype,"components",void 0),x([D({nonNullable:!0,types:Yln,constructOnly:!0,json:{write:!0}})],Q0.prototype,"vertexSpace",void 0),x([D({type:Tk,json:{write:!0}})],Q0.prototype,"transform",void 0),x([D({constructOnly:!0})],Q0.prototype,"metadata",void 0),x([D()],Q0.prototype,"hasExtent",null),x([D()],Q0.prototype,"_transformedExtent",null),x([D()],Q0.prototype,"_untransformedBounds",null),x([D()],Q0.prototype,"anchor",null),x([D()],Q0.prototype,"origin",null),x([D({readOnly:!0,json:{read:!1}})],Q0.prototype,"extent",null),x([D({readOnly:!0,json:{read:!1,write:!0,default:!0}})],Q0.prototype,"hasZ",void 0),x([D({readOnly:!0,json:{read:!1,write:!0,default:!1}})],Q0.prototype,"hasM",void 0),x([D({type:Gy,nonNullable:!0,json:{write:!0}})],Q0.prototype,"vertexAttributes",void 0),Q0=k2=x([Qe(ZWt)],Q0);const O0t=Q3(),a7e=Q0,l7e=()=>di.getLogger("esri.rest.support.meshFeatureSet");function Xln(i,e,t){const r=t.features;t.features=[],delete t.geometryType;const n=du.fromJSON(t);if(n.geometryType="mesh",!t.assetMaps)return n;const s=eqt(e,t.assetMaps),o=i.sourceSpatialReference??Xi.WGS84,a=t.globalIdFieldName,{outFields:l}=i,u=l!=null&&l.length>0?Jln(l.includes("*")?null:new Set(l)):()=>({});for(const c of r){const h=QWt(c,a,o,e,s);h!=null&&n.features.push(new Us({geometry:h,attributes:u(c)}))}return n}function Jln(i){return({attributes:e})=>{if(!e)return{};if(!i)return e;for(const t in e)i.has(t)||delete e[t];return e}}function QWt(i,e,t,r,n){const s=i.attributes[e],o=n.get(s);if(o==null)return l7e().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",i),null;if(!i.geometry)return l7e().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",i),null;const a=Kln(i,t,r),l=hr.fromJSON(i.geometry);l.spatialReference=t;const u=Zln(i.attributes,r),c=t.isGeographic?"local":"georeferenced",h=Qln(o);return h?a7e.createWithExternalSource(a,h,{extent:l,transform:u,vertexSpace:c}):a7e.createIncomplete(a,{extent:l,transform:u,vertexSpace:c})}function Kln({attributes:i},e,{transformFieldRoles:t}){const r=i[t.originX],n=i[t.originY],s=i[t.originZ];return new $i({x:r,y:n,z:s,spatialReference:e})}function Zln(i,{transformFieldRoles:e}){return new Tk({translation:[i[e.translationX],-i[e.translationZ],i[e.translationY]],rotationAxis:[i[e.rotationX],-i[e.rotationZ],i[e.rotationY]],rotationAngle:i[e.rotationDeg],scale:[i[e.scaleX],i[e.scaleZ],i[e.scaleY]]})}var AH;function eqt(i,e){const t=new Map;for(const r of e){const n=r.parentGlobalId;if(n==null)continue;const s=r.assetName,o=r.assetType,a=r.assetHash,l=r.assetURL,u=r.conversionStatus,c=r.seqNo,h=bDt(o,i.supportedFormats);if(!h){l7e().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${o}, but it does not list it as a supported type`);continue}const p=qh(t,n,()=>({files:new Map}));qh(p.files,s,()=>({name:s,type:o,mimeType:h,status:eun(u),parts:[]})).parts[c]={hash:a,url:l}}return t}function Qln(i){const e=Array.from(i.files.values()),t=new Array;for(const r of e){if(r.status!==AH.COMPLETED)return null;const n=new Array;for(const s of r.parts){if(!s)return null;n.push(new mKe(s.url,s.hash))}t.push(new $le(r.name,r.mimeType,n))}return t}function eun(i){switch(i){case"COMPLETED":case"SUBMITTED":return AH.COMPLETED;case"INPROGRESS":return AH.PENDING;default:return AH.FAILED}}(function(i){i[i.FAILED=0]="FAILED",i[i.PENDING=1]="PENDING",i[i.COMPLETED=2]="COMPLETED"})(AH||(AH={}));const tqt=Object.freeze(Object.defineProperty({__proto__:null,assetMapFromAssetMapsJSON:eqt,extractMesh:QWt,meshFeatureSetFromJSON:Xln},Symbol.toStringTag,{value:"Module"})),wKe=()=>di.getLogger("esri.layers.support.ElevationSampler");let iqt=class{queryElevation(e){return iun(e.clone(),this)}on(){return wa()}projectIfRequired(e,t){return rqt(e,t)}},tun=class extends iqt{get spatialReference(){return this.extent.spatialReference}constructor(e,t,r){super(),this.tile=e,this.noDataValue=r;const n=e.tile.extent;this.extent=iB(n,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=pu(t.spatialReference),o=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return kXi(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const r=this.extent,n=`${r.xmin}, ${r.ymin}, ${r.xmax}, ${r.ymax}`;return wKe().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}},P0t=class extends iqt{get spatialReference(){return this.extent.spatialReference}constructor(e,t,r){let n;super(),typeof t=="number"?(this.noDataValue=t,n=null):(n=t,this.noDataValue=r),this.samplers=n?e.map(o=>new tun(o,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:o,max:a}=s.demResolution;this.demResolution={min:o,max:a};for(let l=1;lt?t:i}let aun=class{async queryAll(e,t,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(u=>u.visible):e.slice()).length)throw new qe("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=ate.fromGeometry(t);let s=!1;r&&r.returnSampleInfo||(s=!0);const o={...dpe,...r,returnSampleInfo:!0},a=await this.query(e[e.length-1],n,o),l=await this._queryAllContinue(e,a,o);return l.geometry=l.geometry.export(),s&&delete l.sampleInfo,l}async query(e,t,r){if(!e)throw new qe("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof ate)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new qe("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...dpe,...r},s=new lun(e,t.spatialReference,n),o=n.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(s,t,o),await this._selectTiles(s,o),await this._populateElevationTiles(s,o),this._sampleGeometryWithElevation(s),this._createQueryResult(s,o)}async createSampler(e,t,r){if(!e)throw new qe("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new qe("elevation-query:invalid-extent","Invalid or undefined extent");const n={...dpe,...r};return this._createSampler(e,t,n)}async createSamplerAll(e,t,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new qe("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new qe("elevation-query:invalid-extent","Invalid or undefined extent");const n={...dpe,...r,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,n);return this._createSamplerAllContinue(e,t,s,n)}async _createSampler(e,t,r,n){const s=r.signal;await e.load({signal:s});const o=t.spatialReference,a=e.tileInfo.spatialReference;o.equals(a)||(await Lx([{source:o,dest:a}],{signal:s}),t=Wc(t,a));const l=new uun(e,t,r,n);return await this._selectTiles(l,s),await this._populateElevationTiles(l,s),new P0t(l.elevationTiles,l.layer.tileInfo,l.options.noDataValue)}async _createSamplerAllContinue(e,t,r,n){if(e.pop(),!e.length)return r;const s=r.samplers.filter(u=>!u.tile.hasNoDataValues).map(u=>tB(u.extent)),o=await this._createSampler(e[e.length-1],t,n,s);if(o.samplers.length===0)return r;const a=r.samplers.concat(o.samplers),l=new P0t(a,n.noDataValue);return this._createSamplerAllContinue(e,t,l,n)}async _queryAllContinue(e,t,r){const n=e.pop(),s=t.geometry.coordinates,o=t.sampleInfo;Of(o);const a=[],l=[];for(let p=0;p=0?m.source||(m.source=n):e.length&&(a.push(s[p]),l.push(p))}if(!e.length||a.length===0)return t;const u=t.geometry.clone(a),c=await this.query(e[e.length-1],u,r),h=c.sampleInfo;if(!h)throw new Error("no sampleInfo");return l.forEach((p,m)=>{s[p].z=c.geometry.coordinates[m].z,o[p].demResolution=h[m].demResolution}),this._queryAllContinue(e,t,r)}async _createQueryResult(e,t){const r=await e.geometry.project(e.outSpatialReference,t);Of(r);const n={geometry:r.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,t,r){let n;const s=e.layer.tileInfo.spatialReference;if(t instanceof ate?n=await t.project(s,r):(await Lx([{source:t.spatialReference,dest:s}],{signal:r}),n=Wc(t,s)),!n)throw new qe("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=ate.fromGeometry(n)}async _selectTiles(e,t){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const r=e.options.demResolution;if(typeof r=="number")this._selectTilesClosestResolution(e,r);else if(r==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(r!=="auto")throw new qe("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${r}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const t=new R0t(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const r=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,o=n.y;(sr.xmax||or.ymax)&&(n.elevationTile=t)})}_selectTilesClosestResolution(e,t){const r=this._findNearestDemResolutionLODIndex(e,t);e.selectTilesAtLOD(r)}_findNearestDemResolutionLODIndex(e,t){const{tileInfo:r,tilemapCache:n}=e.layer,s=t/pu(r.spatialReference),o=foe(r,n);let a=o[0],l=0;for(let u=1;us.fetchAvailability(a.level,a.row,a.col,{signal:r}))),r);else if(await this._populateElevationTiles(e,r),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new qe("elevation-query:has-unavailable-tiles")}catch(a){_a(a),await this._selectTilesFinestContiguousAt(e,t-1,r)}}async _populateElevationTiles(e,t){const r=e.getTilesToFetch(),n={},s=e.options.cache,o=e.options.noDataValue,a=r.map(async l=>{if(l.id==null)return;const u=`${e.layer.uid}:${l.id}:${o}`,c=s!=null?s.get(u):null,h=c??await e.layer.fetchTile(l.level,l.row,l.col,{noDataValue:o,signal:t});s?.put(u,h),n[l.id]=new R0t(l,h)});await Jg(Promise.allSettled(a),t),e.populateElevationTiles(n)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const r=e.layer.tilemapCache;if(!r||c7e(r))return this._selectTilesAutoPrefetchUpsample(e,t);const n=e.getTilesToFetch(),s={},o=n.map(async a=>{const l=new jY(null,0,0,0,Wo()),u=await Uk(r.fetchAvailabilityUpsample(a.level,a.row,a.col,l,{signal:t}));u.ok!==!1?a.id!=null&&(s[a.id]=l):_a(u.error)});await Jg(Promise.all(o),t),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let r=0;const n={},s=l=>{l.id!=null&&(l.id in n?n[l.id]++:(n[l.id]=1,r++))},o=l=>{if(l.id==null)return;const u=n[l.id];u===1?(delete n[l.id],r--):n[l.id]=u-1};e.forEachTileToFetch(s,o);let a=!0;for(;a&&(a=!1,e.forEachTileToFetch(l=>{r<=e.options.maximumAutoTileRequests||(o(l),t.upsampleTile(l)&&(a=!0),s(l))},o),a););}_selectTilesAutoFinest(e){const{tileInfo:t,tilemapCache:r}=e.layer,n=u7e(t,r,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const r=e.layer.tileInfo;await this._populateElevationTiles(e,t);let n=!1;e.forEachTileToFetch((s,o)=>{r.upsampleTile(s)?n=!0:o()}),n&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const r=t.elevationTile;let n=e.options.noDataValue;if(r){const s=r.sample(t.x,t.y);s!=null?n=s:t.elevationTile=null}t.z=n})}_extractSampleInfo(e){const t=e.layer.tileInfo,r=pu(t.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=t.lodAt(n.elevationTile.tile.level).resolution*r),{demResolution:s}})}},ate=class Lye{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new Lye;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(r=>r.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await Lx([{source:this.spatialReference,dest:e}],{signal:t});const r=new Oh({spatialReference:this.spatialReference,points:this.coordinates.map(a=>[a.x,a.y])}),n=Wc(r,e);if(!n)return null;const s=this.coordinates.map((a,l)=>{const u=a.clone(),c=n.points[l];return u.x=c[0],u.y=c[1],u}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const t=new Lye;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof Lye)t.coordinates=e.coordinates.map(r=>r.clone()),t._exporter=(r,n)=>{const s=e.clone(r);return s.spatialReference=n,s};else switch(e.type){case"point":{const r=e,{hasZ:n,hasM:s}=r;t.coordinates=n&&s?[new v2(r.x,r.y,r.z,r.m)]:n?[new v2(r.x,r.y,r.z)]:s?[new v2(r.x,r.y,null,r.m)]:[new v2(r.x,r.y)],t._exporter=(o,a)=>e.hasM?new $i(o[0].x,o[0].y,o[0].z,o[0].m,a):new $i(o[0].x,o[0].y,o[0].z,a);break}case"multipoint":{const r=e,{hasZ:n,hasM:s}=r;t.coordinates=n&&s?r.points.map(o=>new v2(o[0],o[1],o[2],o[3])):n?r.points.map(o=>new v2(o[0],o[1],o[2])):s?r.points.map(o=>new v2(o[0],o[1],null,o[2])):r.points.map(o=>new v2(o[0],o[1])),t._exporter=(o,a)=>e.hasM?new Oh({points:o.map(l=>[l.x,l.y,l.z,l.m]),hasZ:!0,hasM:!0,spatialReference:a}):new Oh(o.map(l=>[l.x,l.y,l.z]),a);break}case"polyline":{const r=e,n=[],s=[],{hasZ:o,hasM:a}=e;let l=0;for(const u of r.paths)if(s.push([l,l+u.length]),l+=u.length,o&&a)for(const c of u)n.push(new v2(c[0],c[1],c[2],c[3]));else if(o)for(const c of u)n.push(new v2(c[0],c[1],c[2]));else if(a)for(const c of u)n.push(new v2(c[0],c[1],null,c[2]));else for(const c of u)n.push(new v2(c[0],c[1]));t.coordinates=n,t._exporter=(u,c)=>{const h=e.hasM?u.map(m=>[m.x,m.y,m.z,m.m]):u.map(m=>[m.x,m.y,m.z]),p=s.map(m=>h.slice(m[0],m[1]));return new lo({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:c})};break}}return t}},v2=class nqt{constructor(e,t,r=null,n=null,s=null,o=null){this.x=e,this.y=t,this.z=r,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new nqt(this.x,this.y,this.z,this.m)}},sqt=class{constructor(e,t){this.layer=e,this.options=t}},lun=class extends sqt{constructor(e,t,r){super(e,r),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:r}=this.layer,n=foe(t,r)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const r=t.tile?.id;t.tile=r?e[r]:null}}getTilesToFetch(){const e={},t=[];for(const r of this.geometry.coordinates){const n=r.tile;if(!n)continue;const s=r.tile?.id;r.elevationTile||!s||e[s]||(e[s]=n,t.push(n))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}},uun=class extends sqt{constructor(e,t,r,n){super(e,r),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,t){const r=this._maximumLodForRequests(t),n=Math.min(r,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:r}=this.layer,n=foe(t,r);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let o=n.length-1;o>=0;o--){const a=n[o],l=a.resolution*t.size[0],u=a.resolution*t.size[1];if(Math.ceil(s.width/l)*Math.ceil(s.height/u)<=e)return o}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const r=t.id&&e[t.id];r&&(this._fetchedCandidates.add(t),this.elevationTiles.push(r))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const r=this._candidateTiles;this._candidateTiles=[],r.forEach(n=>{if(this._fetchedCandidates.has(n))return void(t&&t(n));let s=!1;e(n,()=>s=!0),s?t&&t(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const r={},n=[];for(const o of e){const a=o.id;a&&!r[a]?(r[a]=o,n.push(o)):t&&t(o)}const s=n.sort((o,a)=>o.level-a.level);return s.filter((o,a)=>{for(let l=0;le.extent&&C5e(t,e.extent))}};function u7e(i,e,t=0){const r=foe(i,e);let n=r.length-1;if(t>0){const s=t/pu(i.spatialReference),o=r.findIndex(a=>a.resolution0&&(n=o-1)}return n}const dpe={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function foe(i,e){const t=i.lods;if(c7e(e)){const{effectiveMinLOD:r,effectiveMaxLOD:n}=e;return t.filter(s=>s.level>=r&&s.level<=n)}return t}function c7e(i){return i?.tileInfo!=null}const Zbe=Object.freeze(Object.defineProperty({__proto__:null,ElevationQuery:aun,GeometryDescriptor:ate,getFinestLodIndex:u7e},Symbol.toStringTag,{value:"Module"}));function Qbe(i,e,t,r){let n=null,s=1e3;typeof e=="number"?(s=e,r=t):(n=e??null,s=t);let o,a=0;const l=()=>{a=0,i.apply(r,o)},u=(...c)=>{n&&n.apply(r,c),o=c,s?a||(a=setTimeout(l,s)):l()};return u.remove=()=>{a&&(clearTimeout(a),a=0)},u.forceUpdate=()=>{a&&(clearTimeout(a),l())},u.hasPendingUpdates=()=>!!a,u}function h7e(i){switch(i?.type){case"point":return i;case"extent":return i.center;case"polygon":return i.centroid;case"multipoint":case"polyline":return i.extent?.center;default:return null}}function cun(i){return i?{backgroundImage:`url(${i})`}:{}}function hun({action:i,feature:e}){const t=e?.attributes,r="image"in i?i.image:void 0;return r&&t?xC(r,t):r??""}function dun(i,e){return{type:iW(e),value:i,unit:e}}function pun(i,e){return{type:iW(e),value:i,unit:e}}function xKe(i,e,t="arithmetic"){return{type:iW(e),value:i,unit:e,rotationType:t}}dun(0,"meters");pun(0,"square-meters");xKe(0,"radians");xKe(0,"degrees");xKe(0,"degrees","geographic");const F0t=["B","kB","MB","GB","TB"];function fun(i,e){let t=(e=Math.round(e))===0?0:Math.floor(Math.log(e)/Math.log(RW.KILOBYTES));t=uu(t,0,F0t.length-1);const r=DS(e/RW.KILOBYTES**t,{maximumFractionDigits:2});return m0(i.units.bytes[F0t[t]],{fileSize:r})}const mun="esri.widgets.Feature.support.featureUtils",k0t=()=>di.getLogger(mun),gun=/href=(""|'')/gi,yun=/(\{([^\{\r\n]+)\})/g,vun=/\'/g,oqt=/^\s*expression\//i,_un=/(\n)/gi,bun=/[\u00A0-\u9999<>\&]/gim,wun=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,xun=/^(?:mailto:|tel:)/,aqt="relationships/",L0t=T6("short-date-short-time");function lqt(i){if(i!=null)return(i.sourceLayer||i.layer)??void 0}async function ewe(i,e){return typeof i=="function"?i(e):i}function uqt(i=""){if(i)return!xun.test(i.trim().toLowerCase())}function SKe(i){return!!i&&oqt.test(i)}function Sun(i,e){if(!SKe(e)||!i)return;const t=e.replace(oqt,"").toLowerCase();return i.find(({name:r})=>r.toLowerCase()===t)}function cqt(i,e){const t=Sun(e,i?.fieldName);return t?t.title||null:i?i.label||i.fieldName:null}function Tun(i,e){return`{${e.get(i.toLowerCase())?.fieldName||i}}`}function Cun(i){return i.replaceAll(gun,"")}function moe(i,e){const t=TKe(e,i);return t?t.name:i}function Eun(i,e){return i&&i.map(t=>moe(t,e))}function TKe(i,e){return i&&typeof i.getField=="function"&&e?i.getField(e)??null:null}function hqt(i){return`${i}`.trim()}function A8({attributes:i,globalAttributes:e,layer:t,text:r,expressionAttributes:n,fieldInfoMap:s}){return r?d7e({formattedAttributes:e,template:Oun(r,{...e,...n,...i},t),fieldInfoMap:s}):""}function d7e({formattedAttributes:i,template:e,fieldInfoMap:t}){return hqt(Cun(m0(m0(e,r=>Tun(r,t)),i)))}function Iun(i,e,t=!1){const r=e[i];if(typeof r=="string"){const n="%27",s=(t?encodeURIComponent(r):r).replaceAll(vun,n);e[i]=s}}function Aun(i,e=!1){const t={...i};return Object.keys(t).forEach(r=>Iun(r,t,e)),t}function Mun(i,e,t){const r=(e=hqt(e))&&e[0]!=="{";return m0(i,Aun(t,r||!1))}function p7e(i,e){return i.replaceAll(yun,(t,r,n)=>{const s=TKe(e,n);return s?`{${s.name}}`:r})}function Oun(i,e,t){const r=p7e(i,t);return r&&r.replaceAll(wun,(n,s,o)=>Mun(n,s||o,e))}function Pun(i,e){if(typeof i=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const t=Number(i);if(!isNaN(t))return t}return i}function Run(i){return i!=null&&typeof i=="object"&&"fieldsIndex"in i&&"geometryType"in i&&"getField"in i&&"load"in i&&"loaded"in i&&"objectIdField"in i&&"spatialReference"in i&&"type"in i&&(i.type==="feature"||i.type==="scene")&&"when"in i}function Dun(i){return i!=null&&typeof i=="object"&&"createQuery"in i&&"queryFeatureCount"in i&&"queryObjectIds"in i&&"queryRelatedFeatures"in i&&"queryRelatedFeaturesCount"in i&&"relationships"in i}function dqt(i){return Run(i)&&Dun(i)}function Fun(i,e){const{fieldInfos:t,fieldName:r,preventPlacesFormatting:n,layer:s,timeZone:o}=e,a=pqt(t,r),l=TKe(s,r);if(a&&!L5e(r)){const c=l?.type,h=a.format?.dateFormat;if(c==="date"||c==="date-only"||c==="time-only"||c==="timestamp-offset"||h)return QBt(i,{format:h,fieldType:c,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const u=a?.format;return typeof i=="string"&&L5e(r)&&u?kun(i,u):typeof(i=Pun(i,u))=="string"||i==null||u==null?Ble(i):DS(i,n?{...Qve(u),minimumFractionDigits:0,maximumFractionDigits:20}:Qve(u))}function kun(i,e){return i=i.trim(),/\d{2}-\d{2}/.test(i)?i:i.includes(",")?BPe(i,",",", ",e):i.includes(";")?BPe(i,";","; ",e):i.includes(" ")?BPe(i," "," ",e):DS(Number(i),Qve(e))}function BPe(i,e,t,r){return i.trim().split(e).map(n=>DS(Number(n),Qve(r))).join(t)}function pqt(i,e){if(i?.length&&e)return i.find(t=>t.fieldName?.toLowerCase()===e.toLowerCase())}function Lun({fieldName:i,graphic:e,layer:t}){if(TP(i)||!t||typeof t.getFeatureType!="function")return null;const{typeIdField:r}=t;if(!r||i!==r)return null;const n=t.getFeatureType(e);return n?n.name:null}function Nun({fieldName:i,value:e,graphic:t,layer:r}){if(TP(i)||!r||typeof r.getFieldDomain!="function")return null;const n=t&&r.getFieldDomain(i,{feature:t});return n&&n.type==="coded-value"?n.getName(e):null}function $un(i,e,t,r){const{creatorField:n,creationDateField:s,editorField:o,editDateField:a}=i;if(!e)return;const l=IAt(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone,t,L0t,"date"),u={...L0t,...l},c=e[a];if(typeof c=="number"){const p=e[o];return{type:"edit",date:vb(c,u),user:p}}const h=e[s];if(typeof h=="number"){const p=e[n];return{type:"create",date:vb(h,u),user:p}}return null}function Bun(i,e){const t=new Map;return i&&i.forEach(r=>{const n=moe(r.fieldName,e);r.fieldName=n,t.set(n.toLowerCase(),r)}),t}function N0t(i){const e=[];if(!i)return e;const{fieldInfos:t,content:r}=i;return t&&e.push(...t),r&&Array.isArray(r)&&r.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&e.push(...s)}}),e}function CKe(i){return i.replaceAll(bun,e=>`&#${e.charCodeAt(0)};`)}function Ble(i){return typeof i=="string"?i.replaceAll(_un,'
'):i}function fqt(i){const{value:e,fieldName:t,fieldInfos:r,fieldInfoMap:n,layer:s,graphic:o,timeZone:a}=i;if(e==null)return"";const l=Nun({fieldName:t,value:e,graphic:o,layer:s});if(l)return l;const u=Lun({fieldName:t,graphic:o,layer:s});if(u)return u;if(n.get(t.toLowerCase()))return Fun(e,{fieldInfos:r||Array.from(n.values()),fieldName:t,layer:s,timeZone:a});const c=s?.fieldsIndex?.get(t);return c&&(ZBt(c)||hae(c))?QBt(e,{fieldType:c.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:a,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):Ble(e)}function jPe({fieldInfos:i,attributes:e,layer:t,graphic:r,fieldInfoMap:n,relatedInfos:s,timeZone:o}){const a={};return s?.forEach(l=>zun({attributes:a,relatedInfo:l,fieldInfoMap:n,fieldInfos:i,layer:t,timeZone:o})),e&&Object.keys(e).forEach(l=>{const u=e[l];a[l]=fqt({fieldName:l,fieldInfos:i,fieldInfoMap:n,layer:t,value:u,graphic:r,timeZone:o})}),a}async function mqt(i,e){const{layer:t,graphic:r,outFields:n,objectIds:s,returnGeometry:o,spatialReference:a}=i,l=s[0];if(typeof l!="number"&&typeof l!="string"){const c="Could not query required fields for the specified feature. The feature's ID is invalid.",h={layer:t,graphic:r,objectId:l,requiredFields:n};return k0t().warn(c,h),null}if(!tT(t)?.operations?.supportsQuery){const c="The specified layer cannot be queried. The following fields will not be available.",h={layer:t,graphic:r,requiredFields:n,returnGeometry:o};return k0t().warn(c,h),null}const u=t.createQuery();return u.objectIds=s,u.outFields=n?.length?n:[t.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=a,(await t.queryFeatures(u,e)).features[0]}async function jun(i){if(!i.expressionInfos?.length)return!1;const e=await e_(),{arcadeUtils:{hasGeometryFunctions:t}}=e;return t(i)}async function Gun({graphic:i,popupTemplate:e,layer:t,spatialReference:r},n){if(!t||!e||(typeof t.load=="function"&&await t.load(n),!i.attributes))return;const s=i.attributes[t.objectIdField];if(s==null)return;const o=[s],a=await e.getRequiredFields(t.fieldsIndex),l=XAt(a,i),u=l?[]:a,c=e.returnGeometry||await jun(e);if(l&&!c)return;const h=await mqt({layer:t,graphic:i,outFields:u,objectIds:o,returnGeometry:c,spatialReference:r},n);h&&(h.geometry&&(i.geometry=h.geometry),h.attributes&&(i.attributes={...i.attributes,...h.attributes}))}function TP(i=""){return!!i&&i.includes(aqt)}function Uun(i){return i?`${aqt}${i.layerId}/${i.fieldName}`:""}function $0t({attributes:i,graphic:e,relatedInfo:t,fieldInfos:r,fieldInfoMap:n,layer:s,timeZone:o}){i&&e&&t&&Object.keys(e.attributes).forEach(a=>{const l=Uun({layerId:t.relation.id.toString(),fieldName:a}),u=e.attributes[a];i[l]=fqt({fieldName:l,fieldInfos:r,fieldInfoMap:n,layer:s,value:u,graphic:e,timeZone:o})})}function zun({attributes:i,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s}){i&&e&&(e.relatedFeatures?.forEach(o=>$0t({attributes:i,graphic:o,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s})),e.relatedStatsFeatures?.forEach(o=>$0t({attributes:i,graphic:o,relatedInfo:e,fieldInfoMap:t,fieldInfos:r,layer:n,timeZone:s})))}const B0t=i=>{if(!i)return!1;const e=i.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},gqt=({layer:i,method:e,query:t,definitionExpression:r})=>{if(!i.capabilities?.query?.supportsCacheHint||e==="attachments")return;const n=t.where!=null?t.where:null,s=t.geometry!=null?t.geometry:null;B0t(r)||B0t(n)||s?.type==="extent"||t.resultType==="tile"||(t.cacheHint=!0)},Vun=({query:i,layer:e,method:t})=>{gqt({layer:e,method:t,query:i,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},Hun=({queryPayload:i,layer:e,method:t})=>{gqt({layer:e,method:t,query:i,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Wun(i,e,t){return i&&e&&t?j0t(i.allLayers,e,t)||j0t(i.allTables,e,t):null}function j0t(i,e,{relatedTableId:t}){const r=e.type==="scene"&&e.associatedLayer?e.associatedLayer.url:e.url;return i.filter(dqt).find(n=>n!==e&&n.url===r&&n.layerId===t)}const G0t={editing:!1,operations:{add:!0,update:!0,delete:!0}},yqt=dr.ofType(dDt);let U_=class extends un{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...G0t},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new yqt,this.fileInfos=new dr,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(Ki(()=>this.graphic,()=>this._graphicChanged(),js))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...G0t,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return t?.loaded&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new qe("invalid-layer","getAttachments(): A valid layer is required.");const r=this._getObjectId(),n=new _1e({objectIds:[r],returnMetadata:!0}),s=[],o=e.queryAttachments(n).then(l=>l[r]||s).catch(()=>s);this._getAttachmentsPromise=o,this.notifyChange("state");const a=await o;return t.removeAll(),a.length&&t.addMany(a),this._getAttachmentsPromise=null,this.notifyChange("state"),a}async addAttachment(e,t=this.graphic){const{_attachmentLayer:r,attachmentInfos:n,capabilities:s}=this;if(!t)throw new qe("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new qe("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!s.operations?.add)throw new qe("invalid-capabilities","addAttachment(): add capabilities are required.");if(!r||typeof r.addAttachment!="function")throw new qe("invalid-layer","addAttachment(): A valid layer is required.");const o=r.addAttachment(t,e).then(l=>this._queryAttachment(l.objectId,t)),a=await o;return n.add(a),a}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:r,graphic:n,capabilities:s}=this;if(!e)throw new qe("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!s.operations?.delete)throw new qe("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new qe("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new qe("invalid-graphic","deleteAttachment(): A graphic is required.");const o=t.deleteAttachments(n,[e.id]).then(()=>e),a=await o;return r.remove(a),a}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:r,attachmentInfos:n,graphic:s,capabilities:o}=this;if(!e)throw new qe("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new qe("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!o.operations?.update)throw new qe("invalid-capabilities","updateAttachment(): Update capabilities are required.");const a=n.indexOf(t);if(!r||typeof r.updateAttachment!="function")throw new qe("invalid-layer","updateAttachment(): A valid layer is required.");if(!s)throw new qe("invalid-graphic","updateAttachment(): A graphic is required.");const l=r.updateAttachment(s,t.id,e).then(c=>this._queryAttachment(c.objectId)),u=await l;return n.splice(a,1,u),u}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const r={file:e,form:t};return this.fileInfos.add(r),r}updateFile(e,t,r=this.activeFileInfo){if(!e||!t||!r)return null;const n=this.fileInfos.indexOf(r);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:t}),this.fileInfos.items[n]}deleteFile(e){const t=this.fileInfos.find(r=>r.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:r}=this;if(!e||!r?.queryAttachments)throw new qe("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(t),s=new _1e({objectIds:[n],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return r.queryAttachments(s).then(o=>o[n][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=lqt(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};x([D()],U_.prototype,"capabilities",void 0),x([So("capabilities")],U_.prototype,"castCapabilities",null),x([D()],U_.prototype,"activeAttachmentInfo",void 0),x([D()],U_.prototype,"activeFileInfo",void 0),x([D({readOnly:!0,type:yqt})],U_.prototype,"attachmentInfos",void 0),x([D()],U_.prototype,"fileInfos",void 0),x([D({type:Us})],U_.prototype,"graphic",void 0),x([D()],U_.prototype,"mode",void 0),x([D({readOnly:!0})],U_.prototype,"state",null),x([D()],U_.prototype,"filesEnabled",void 0),x([D({readOnly:!0})],U_.prototype,"supportsResizeAttachments",null),U_=x([Qe("esri.widgets.Attachments.AttachmentsViewModel")],U_);const EKe=U_;function U0t(i){const e=i.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function qun(i){const e=Fl("esri/themes/base/images/files/");return i?i==="text/plain"?`${e}text-32.svg`:i==="application/pdf"?`${e}pdf-32.svg`:i==="text/csv"?`${e}csv-32.svg`:i==="application/gpx+xml"?`${e}gpx-32.svg`:i==="application/x-dwf"?`${e}cad-32.svg`:i==="application/postscript"||i==="application/json"||i==="text/xml"||i==="model/vrml"?`${e}code-32.svg`:i==="application/x-zip-compressed"||i==="application/x-7z-compressed"||i==="application/x-gzip"||i==="application/x-tar"||i==="application/x-gtar"||i==="application/x-bzip2"||i==="application/gzip"||i==="application/x-compress"||i==="application/x-apple-diskimage"||i==="application/x-rar-compressed"||i==="application/zip"?`${e}zip-32.svg`:i.includes("image/")?`${e}image-32.svg`:i.includes("audio/")?`${e}sound-32.svg`:i.includes("video/")?`${e}video-32.svg`:i.includes("msexcel")||i.includes("ms-excel")||i.includes("spreadsheetml")?`${e}excel-32.svg`:i.includes("msword")||i.includes("ms-word")||i.includes("wordprocessingml")?`${e}word-32.svg`:i.includes("powerpoint")||i.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const z0t={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},Ru="esri-attachments",Ta={base:Ru,loaderContainer:`${Ru}__loader-container`,loader:`${Ru}__loader`,fadeIn:`${Ru}--fade-in`,container:`${Ru}__container`,containerList:`${Ru}__container--list`,containerPreview:`${Ru}__container--preview`,actions:`${Ru}__actions`,deleteButton:`${Ru}__delete-button`,addAttachmentButton:`${Ru}__add-attachment-button`,errorMessage:`${Ru}__error-message`,items:`${Ru}__items`,item:`${Ru}__item`,itemButton:`${Ru}__item-button`,itemMask:`${Ru}__item-mask`,itemMaskIcon:`${Ru}__item-mask--icon`,itemImage:`${Ru}__image`,itemImageResizable:`${Ru}__image--resizable`,itemLabel:`${Ru}__label`,itemFilename:`${Ru}__filename`,itemChevronIcon:`${Ru}__item-chevron-icon`,itemLink:`${Ru}__item-link`,itemLinkOverlay:`${Ru}__item-link-overlay`,itemLinkOverlayIcon:`${Ru}__item-link-overlay-icon`,itemEditIcon:`${Ru}__item-edit-icon`,itemAddIcon:`${Ru}__item-add-icon`,itemAddButton:`${Ru}__item-add-button`,formNode:`${Ru}__form-node`,fileFieldset:`${Ru}__file-fieldset`,fileLabel:`${Ru}__file-label`,fileName:`${Ru}__file-name`,fileInput:`${Ru}__file-input`,metadata:`${Ru}__metadata`,metadataFieldset:`${Ru}__metadata-fieldset`,progressBar:`${Ru}__progress-bar`},GPe=window.CSS;let ev=class extends my{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...z0t},this._supportsImageOrientation=GPe&&GPe.supports&&GPe.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new EKe,...e}),e}initialize(){this.addHandles([ju(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),ju(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),Ki(()=>this.viewModel?.mode,()=>this._modeChanged(),js)])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...z0t,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),t.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:add-attachment",this.messages.addErrorMessage,r)),r})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(r=>(this._set("submitting",!1),this._set("error",null),t.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:delete-attachment",this.messages.deleteErrorMessage,r)),r})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(r=>(this._set("submitting",!1),this._set("error",null),e.mode="view",r)).catch(r=>{throw this._set("submitting",!1),this._set("error",new qe("attachments:update-attachment",this.messages.updateErrorMessage,r)),r})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo?.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:r}=t;return er("div",{class:this.classes(Ta.base,Xo.widget)},e?this._renderProgressBar():null,r==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?er("div",{class:Ta.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:r}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(r||e):this._renderAttachmentContainer()}_renderLoading(){return er("div",{class:Ta.loaderContainer,key:"loader"},er("div",{class:Ta.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?er("div",{class:Ta.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,r=e||!t,n=this.visibleElements.cancelAddButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonTertiary,Xo.buttonSmall,Xo.buttonHalf,e&&Xo.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,s=this.visibleElements.addSubmitButton?er("button",{class:this.classes(Xo.button,Xo.buttonSecondary,Xo.buttonSmall,Xo.buttonHalf,{[Xo.buttonDisabled]:r}),disabled:r,type:"submit"},this.messages.add):null,o=t?er("span",{class:Ta.fileName,key:"file-name"},t.name):null,a=er("form",{afterCreate:jat,afterRemoved:Bat,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},er("fieldset",{class:Ta.fileFieldset},o,er("label",{class:this.classes(Ta.fileLabel,Xo.button,Xo.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,er("input",{bind:this,class:Ta.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),s,n);return er("div",{class:Ta.formNode,key:"add-form-container"},a)}_renderDetailsForm(e){const{visibleElements:t,viewModel:r,selectedFile:n,submitting:s}=this,{capabilities:o}=r,a=s||!n;let l,u,c,h;n?(l=n.type,u=n.name,c=n.size):e&&"file"in e?(l=e.file.type,u=e.file.name,c=e.file.size):e&&"contentType"in e&&(l=e.contentType,u=e.name,c=e.size,h=e.url);const p=o.editing&&o.operations?.delete&&t.deleteButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonTertiary,Ta.deleteButton,{[Xo.buttonDisabled]:s}),disabled:s,key:"delete-button",onclick:k=>this._submitDeleteAttachment(k,e),type:"button"},this.messages.delete):void 0,m=o.editing&&o.operations?.update&&t.updateButton?er("button",{class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonThird,{[Xo.buttonDisabled]:a}),disabled:a,key:"update-button",type:"submit"},this.messages.update):void 0,v=this.visibleElements.cancelUpdateButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonSmall,Xo.buttonTertiary,Xo.buttonThird,{[Xo.buttonDisabled]:s}),disabled:s,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,w=o.editing&&o.operations?.update?er("fieldset",{class:Ta.fileFieldset,key:"file"},er("span",{class:Ta.fileName,key:"file-name"},u),er("label",{class:this.classes(Ta.fileLabel,Xo.button,Xo.buttonSecondary)},this.messages.changeFile,er("input",{bind:this,class:Ta.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,S=er("fieldset",{class:Ta.metadataFieldset,key:"size"},er("label",null,fun(this.messagesUnits,c??0))),I=er("fieldset",{class:Ta.metadataFieldset,key:"content-type"},er("label",null,l)),R=h!=null?er("a",{class:Ta.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),er("div",{class:Ta.itemLinkOverlay},er("span",{class:Ta.itemLinkOverlayIcon},er("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),L=er("form",{afterCreate:jat,afterRemoved:Bat,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:k=>this._submitUpdateAttachment(k,e)},er("div",{class:Ta.metadata},S,I),w,er("div",{class:Ta.actions},p,v,m));return er("div",{class:Ta.formNode,key:"edit-form-container"},R,L)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:r}=this.viewModel,n=qun(t),s={[Ta.itemImageResizable]:r};return er("div",{class:this.classes(Ta.itemMaskIcon,Ta.itemMask),key:n},er("img",{alt:e,class:this.classes(s,Ta.itemImage),src:n,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:r}=this.viewModel;if(!e)return null;const{contentType:n,name:s,url:o}=e;if(!r||!U0t(n))return this._renderGenericImageMask(s,n);const a=this._getCSSTransform(e),l=a?{transform:a,"image-orientation":"none"}:{},u=`${o}${o?.includes("?")?"&":"?"}w=${t}`,c={[Ta.itemImageResizable]:r};return er("div",{class:this.classes(Ta.itemMask),key:u},er("img",{alt:s,class:this.classes(c,Ta.itemImage),src:u,styles:l,title:s}))}_renderFile(e){const{file:t}=e;return er("li",{class:Ta.item,key:t},er("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:Ta.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),er("label",{class:Ta.itemLabel},er("span",{class:Ta.itemFilename},t.name||this.messages.noTitle),er("span",{"aria-hidden":"true",class:this.classes(Ta.itemChevronIcon,nk(this.container)?i0.left:i0.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:r,effectiveDisplayType:n}=this,{capabilities:s,supportsResizeAttachments:o}=r,{contentType:a,name:l,url:u}=e,c=this._renderImageMask(e,t==="list"?48:400),h=s.editing?er("span",{"aria-hidden":"true",class:this.classes(Ta.itemChevronIcon,nk(this.container)?i0.left:i0.right)}):null,p=[c,n==="preview"&&o&&U0t(a)?null:er("label",{class:Ta.itemLabel},er("span",{class:Ta.itemFilename},l||this.messages.noTitle),h)],m=s.editing?er("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:Ta.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},p):er("a",{class:Ta.itemButton,href:u??void 0,key:"details-link",target:"_blank"},p);return er("li",{class:Ta.item,key:e},m)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:r}=this,{attachmentInfos:n,capabilities:s,fileInfos:o}=t,a=!!n?.length,l=!!o?.length,u={[Ta.containerList]:e!=="preview",[Ta.containerPreview]:e==="preview"},c=s.editing&&s.operations?.add&&r.addButton?er("button",{bind:this,class:this.classes(Xo.button,Xo.buttonTertiary,Ta.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},er("span",{"aria-hidden":"true",class:this.classes(Ta.itemAddIcon,i0.plus)}),this.messages.add):void 0,h=a?er("ul",{class:Ta.items,key:"attachments-list"},n.toArray().map(v=>this._renderAttachmentInfo({attachmentInfo:v,displayType:e}))):void 0,p=l?er("ul",{class:Ta.items,key:"file-list"},o.toArray().map(v=>this._renderFile(v))):void 0,m=l||a?void 0:er("div",{class:Xo.empty},this.messages.noAttachments);return er("div",{class:this.classes(Ta.container,u),key:"attachments-container"},h,p,m,c)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,r=t.files?.item(0);this._set("selectedFile",r)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};x([D()],ev.prototype,"capabilities",null),x([D()],ev.prototype,"displayType",void 0),x([D({readOnly:!0})],ev.prototype,"effectiveDisplayType",null),x([D()],ev.prototype,"graphic",null),x([D()],ev.prototype,"label",null),x([D(),Sg("esri/widgets/Attachments/t9n/Attachments")],ev.prototype,"messages",void 0),x([D(),Sg("esri/core/t9n/Units")],ev.prototype,"messagesUnits",void 0),x([D({readOnly:!0})],ev.prototype,"selectedFile",void 0),x([D({readOnly:!0})],ev.prototype,"submitting",void 0),x([D({readOnly:!0})],ev.prototype,"error",void 0),x([D({type:EKe})],ev.prototype,"viewModel",void 0),x([D()],ev.prototype,"visibleElements",void 0),x([So("visibleElements")],ev.prototype,"castVisibleElements",null),ev=x([Qe("esri.widgets.Attachments")],ev);const Yun=ev;let lte=class extends EKe{constructor(e){super(e),this.description=null,this.title=null}};x([D()],lte.prototype,"description",void 0),x([D()],lte.prototype,"title",void 0),lte=x([Qe("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],lte);const IKe=lte;function AKe({level:i,class:e,...t},r){const n=Xun(i);return er(`h${n}`,{...t,"aria-level":String(n),class:v4t(Xo.heading,e),role:"heading"},r)}function Xun(i){return uu(Math.ceil(i),1,6)}const UPe="esri-feature-element-info",zPe={base:UPe,title:`${UPe}__title`,description:`${UPe}__description`};let VU=class extends my{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return er("div",{class:zPe.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?er(AKe,{class:zPe.title,level:this.headingLevel},e):null}_renderDescription(){const{description:e}=this;return e?er("div",{class:zPe.description,key:"description"},e):null}};x([D()],VU.prototype,"description",void 0),x([D()],VU.prototype,"headingLevel",void 0),x([D()],VU.prototype,"title",void 0),VU=x([Qe("esri.widgets.Feature.support.FeatureElementInfo")],VU);const zCe=VU,Jun={base:"esri-feature-attachments"};let kI=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Yun,this.headingLevel=2,this.viewModel=new IKe}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),js),Ki(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,js)])}destroy(){this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),this._featureElementInfo?.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{attachmentsWidget:e}=this;return er("div",{class:Jun.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:r}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:r})}};x([D({readOnly:!0})],kI.prototype,"attachmentsWidget",void 0),x([D()],kI.prototype,"description",null),x([D()],kI.prototype,"displayType",null),x([D()],kI.prototype,"graphic",null),x([D()],kI.prototype,"headingLevel",void 0),x([D()],kI.prototype,"title",null),x([D({type:IKe})],kI.prototype,"viewModel",void 0),kI=x([Qe("esri.widgets.Feature.FeatureAttachments")],kI);const Kun=kI;let W4=class extends un{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(Ki(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},js))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:r}=this;e&&t&&(ewe(r,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const r=ewe(e,{graphic:t}).catch(()=>null);this._loadingPromise=r,this.notifyChange("state");const n=await r;r===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",n))}};x([D({readOnly:!0})],W4.prototype,"created",void 0),x([D()],W4.prototype,"creator",void 0),x([D()],W4.prototype,"destroyer",void 0),x([D({type:Us})],W4.prototype,"graphic",void 0),x([D({readOnly:!0})],W4.prototype,"state",null),W4=x([Qe("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],W4);const twe=W4;function vqt(i){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const t=e._delegatedEventNames,r=Array.isArray(i)?i:Zun(i);t.push(...r)}}function Zun(i){return i.split(",").map(e=>e.trim())}function _qt(i){return i&&typeof i.render=="function"}function Qun(i){return i&&typeof i.postMixInProperties=="function"&&typeof i.buildRendering=="function"&&typeof i.postCreate=="function"&&typeof i.startup=="function"}const VPe="esri-feature-content",HPe={base:VPe,loaderContainer:`${VPe}__loader-container`,loader:`${VPe}__loader`};let HU=class extends my{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=r=>{Array.from(r.querySelectorAll("a")).forEach(n=>{uqt(n.href)&&!n.hasAttribute("target")&&n.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return er("div",{class:HPe.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return er("div",{class:HPe.loaderContainer,key:"loader"},er("div",{class:HPe.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?er("div",{afterCreate:this._attachToNode,bind:e,key:e}):_qt(e)?er("div",{key:e},!e.destroyed&&e.render()):er("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};x([D()],HU.prototype,"creator",null),x([D()],HU.prototype,"graphic",null),x([D({type:twe})],HU.prototype,"viewModel",void 0),HU=x([Qe("esri.widgets.Feature.FeatureContent")],HU);const Nye=HU;let yO=class extends un{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,r=[];return t?.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const s=n.clone();s.label=cqt(s,e),r.push(s)}),r}};x([D()],yO.prototype,"attributes",void 0),x([D({type:[o1e]})],yO.prototype,"expressionInfos",void 0),x([D()],yO.prototype,"description",void 0),x([D({type:[dae]})],yO.prototype,"fieldInfos",void 0),x([D({readOnly:!0})],yO.prototype,"formattedFieldInfos",null),x([D()],yO.prototype,"title",void 0),yO=x([Qe("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],yO);const VCe=yO,ecn=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function tcn(i,e){if(typeof e!="string"||!e)return e;const t=ecn.find(l=>l.pattern.test(e));if(!t)return e;const r=e.match(t.pattern),n=r&&r[2],s=m0(m0(t.label,{messages:i,hierPart:n}),{appName:t.appName}),o=t.target?` target="${t.target}"`:"",a=t.target==="_blank"?' rel="noreferrer"':"";return e.replace(t.pattern,`${s}`)}const ppe="esri-feature-fields",fpe={base:ppe,fieldHeader:`${ppe}__field-header`,fieldData:`${ppe}__field-data`,fieldDataDate:`${ppe}__field-data--date`};let KT=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new VCe,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new zCe,this.addHandles(Ki(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),js))}destroy(){this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return er("div",{class:fpe.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:r}=this.viewModel,n=e.fieldName,s=e.label||n,o=r?r[n]==null?"":r[n]:"",a=!(!e.format||!e.format.dateFormat),l=typeof o=="number"&&!a?this._forceLTR(o):tcn(this.messagesURIUtils,o),u={[fpe.fieldDataDate]:a};return er("tr",{key:`fields-element-info-row-${n}-${t}`},er("th",{class:fpe.fieldHeader,innerHTML:s,key:`fields-element-info-row-header-${n}-${t}`}),er("td",{class:this.classes(fpe.fieldData,u),innerHTML:l,key:`fields-element-info-row-data-${n}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?er("table",{class:Xo.table,summary:this.messages.fieldsSummary},er("tbody",null,e.map((t,r)=>this._renderFieldInfo(t,r)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};x([D()],KT.prototype,"attributes",null),x([D()],KT.prototype,"description",null),x([D()],KT.prototype,"expressionInfos",null),x([D()],KT.prototype,"fieldInfos",null),x([D()],KT.prototype,"title",null),x([D({type:VCe,nonNullable:!0})],KT.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],KT.prototype,"messages",void 0),x([D(),Sg("esri/widgets/support/t9n/uriUtils")],KT.prototype,"messagesURIUtils",void 0),KT=x([Qe("esri.widgets.Feature.FeatureFields")],KT);const bqt=KT,icn=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,rcn={maximumFractionDigits:20};function ncn(i){return DS(i,rcn)}const scn="<",ocn=">";function acn(i,e,t,r){let n="";return e===0?n=`${scn} `:e===t&&(n=`${ocn} `),n+ncn(i)}const lcn=new jr([64,64,64]);function ucn(i,e){const t=[],r=i.length-1;return i.length===5?t.push(0,2,4):t.push(0,r),i.map((n,s)=>t.includes(s)?acn(n,s,r):null)}async function ccn(i,e,t){let r=!1,n=[],s=[];if(i.stops){const u=i.stops;n=u.map(c=>c.value),r=u.some(c=>!!c.label),r&&(s=u.map(c=>c.label))}const o=n[0],a=n[n.length-1];if(o==null&&a==null)return null;const l=r?null:ucn(n);return(await Promise.all(n.map(async(u,c)=>({value:u,color:i.type==="opacity"?await hcn(u,i):(await Promise.resolve().then(()=>L2e)).getColor(i,u),label:r?s[c]:l?.[c]??""})))).reverse()}async function hcn(i,e,t){const r=new jr(lcn),n=(await Promise.resolve().then(()=>L2e)).getOpacity(e,i);return n!=null&&(r.a=n),r}function dcn(i){if(!i.colorStops)return[];const e=[...i.colorStops].filter(r=>r.color?.a>0);let t=e.length-1;if(e&&e[0]){const r=e[t];r&&r.ratio!==1&&(e.push(new Eie({ratio:1,color:r.color})),t++)}return e.map((r,n)=>{let s="";return n===0?s=i.legendOptions?.minLabel||"low":n===t&&(s=i.legendOptions?.maxLabel||"high"),{color:r.color,label:s,ratio:r.ratio}}).reverse()}async function uw(i,e,t){qh(i,e,()=>[]).push(...t)}async function pcn(i){const e=new Map;if(!i)return e;if("visualVariables"in i&&i.visualVariables){const t=i.visualVariables.filter(r=>r.type==="color");for(const r of t){const n=(await ccn(r)??[]).map(s=>s.color);await uw(e,r.field||r.valueExpression,n)}}if(i.type==="heatmap"){const t=dcn(i).map(r=>r.color);await uw(e,i.field||i.valueExpression,t)}else if(i.type==="pie-chart"){for(const t of i.attributes)await uw(e,t.field||t.valueExpression,[t.color]);await uw(e,"default",[i?.othersCategory?.color,hj(i.backgroundFillSymbol,null)])}else if(i.type==="dot-density"){for(const t of i.attributes)await uw(e,t.field||t.valueExpression,[t.color]);await uw(e,"default",[i.backgroundColor])}else if(i.type==="unique-value")if(i.authoringInfo?.type==="predominance")for(const t of i.uniqueValueInfos??[])await uw(e,t.value.toString(),[hj(t.symbol,null)]);else{const t=(i.uniqueValueInfos??[]).map(a=>hj(a.symbol,null)),{field:r,field2:n,field3:s,valueExpression:o}=i;(r||o)&&await uw(e,r||o,t),n&&await uw(e,n,t),s&&await uw(e,s,t)}else if(i.type==="class-breaks"){const t=i.classBreakInfos.map(s=>hj(s.symbol,null)),{field:r,valueExpression:n}=i;await uw(e,r??n,t)}else i.type==="simple"&&await uw(e,"default",[hj(i.symbol,null)]);return"defaultSymbol"in i&&i.defaultSymbol&&await uw(e,"default",[hj(i.defaultSymbol,null)]),e.forEach((t,r)=>{const n=DUe(t.filter(Boolean),(s,o)=>JSON.stringify(s)===JSON.stringify(o));e.set(r,n)}),e}const fcn="esri.widgets.Feature.support.relatedFeatureUtils",V0t=()=>di.getLogger(fcn),H0t=new Map;function $ye(i){if(!TP(i))return null;const[e,t]=i.split("/").slice(1);return{layerId:e,fieldName:t}}function mcn(i,e){if(!e.relationships)return null;let t=null;const{relationships:r}=e;return r.some(n=>n.id===parseInt(i,10)&&(t=n,!0)),t}function gcn({originRelationship:i,relationships:e,layerId:t}){return e.find(({relatedTableId:r,id:n})=>`${r}`===t&&n===i?.id)??null}function ycn(i,e){const t=e.toLowerCase();for(const r in i)if(r.toLowerCase()===t)return i[r];return null}function vcn(i,e){const t=mcn(i,e);if(t)return{url:`${e.url}/${t.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:t,relatedFields:[],outStatistics:[]}}function _cn(i,e){if(!e||!i)return;const{features:t,statsFeatures:r}=i,n=t?.value;e.relatedFeatures=n?n.features:[];const s=r?.value;e.relatedStatsFeatures=s?s.features:[]}function bcn(i,e,t,r){const n=new p3;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[i.attributes[t.objectIdField]],t.queryRelatedFeatures?.(n,r)??Promise.resolve({})}function wcn(i,e,t){let r=0;const n=[];for(;rJSON.stringify(e.toJSON())===JSON.stringify(t.toJSON())):void 0}async function Tcn(i,e,t,r){const n=t.layerId.toString(),{layerInfo:s,relation:o,relatedFields:a,outStatistics:l,url:u,sourceSpatialReference:c}=e,h=xcn(a),p=Scn(l);if(!s||!o)return null;const m=gcn({originRelationship:o,relationships:s.relationships,layerId:n});if(m?.relationshipTableId&&m.keyFieldInRelationshipTable){const w=(await bcn(i,m,t,r))[i.attributes[t.objectIdField]];if(!w)return null;const S=w.features.map(I=>I.attributes[s.objectIdField]);if(p?.length&&s.supportsStatistics){const I=new Kn;I.where=wcn(s.objectIdField,S,1e3),I.outFields=h,I.outStatistics=p,I.sourceSpatialReference=c;const R={features:Promise.resolve(w),statsFeatures:t9(u,I)};return g0(R)}}const v=m?.keyField;if(v){const w=wY(Mcn(s.fields,v)),S=ycn(i.attributes,o.keyField),I=w?`${v}=${S}`:`${v}='${S}'`,R=t9(u,new Kn({where:I,outFields:h,sourceSpatialReference:c}),r),L=p?.length&&s.supportsStatistics?t9(u,new Kn({where:I,outFields:h,outStatistics:p,sourceSpatialReference:c}),r):null,k={features:R};return L&&(k.statsFeatures=L),g0(k)}return null}function Ccn(i,e){return zi(i,{query:{f:"json"},signal:e?.signal})}function Ecn({relatedInfos:i,layer:e},t){const r={};return i.forEach((n,s)=>{const{relation:o}=n;if(!o){const h=new qe("relation-required","A relation is required on a layer to retrieve related records.");throw V0t().error(h),h}const{relatedTableId:a}=o;if(typeof a!="number"){const h=new qe("A related table ID is required on a layer to retrieve related records.");throw V0t().error(h),h}const l=`${e.url}/${a}`,u=H0t.get(l),c=u??Ccn(l);u||H0t.set(l,c),r[s]=c}),Jg(g0(r),t)}function Icn({graphic:i,relatedInfos:e,layer:t},r){const n={};return e.forEach((s,o)=>{s.layerInfo&&(n[o]=Tcn(i,s,t,r))}),g0(n)}function Acn({relatedInfo:i,fieldName:e,fieldInfo:t}){if(i.relatedFields?.push(e),t.statisticType){const r=new y1e({statisticType:t.statisticType,onStatisticField:e,outStatisticFieldName:e});i.outStatistics?.push(r)}}function Mcn(i,e){if(i!=null){e=e.toLowerCase();for(const t of i)if(t&&t.name.toLowerCase()===e)return t}return null}const W0t={chartAnimation:!0};let Jf=class extends un{constructor(e){super(e),this.abilities={...W0t},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...W0t,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,r=(e+t)%t;this.activeMediaInfoIndex=r}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,r=t+e;this._setContentElementMedia(r)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,r=this.attributes??{},n=this.formattedAttributes??{},s=this.expressionAttributes??{},o=this.fieldInfoMap??new Map;return e?.map(a=>{const l=a?.clone();if(!l)return null;if(l.title=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.title}),l.caption=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.caption}),l.altText=A8({attributes:r,fieldInfoMap:o,globalAttributes:n,expressionAttributes:s,layer:t,text:l.altText}),l.type==="image"){const{value:u}=l;return this._setImageValue({value:u,formattedAttributes:n,layer:t}),l.value.sourceURL?l:void 0}if(l.type==="pie-chart"||l.type==="line-chart"||l.type==="column-chart"||l.type==="bar-chart"){const{value:u}=l;return this._setChartValue({value:u,chartType:l.type,attributes:r,formattedAttributes:n,layer:t,expressionAttributes:s}),l}return null}).filter(Ga)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:r,formattedAttributes:n,layer:s}=e,{linkURL:o,sourceURL:a}=r;if(a){const l=p7e(a,s);r.sourceURL=d7e({formattedAttributes:n,template:l,fieldInfoMap:t})}if(o){const l=p7e(o,s);r.linkURL=d7e({formattedAttributes:n,template:l,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:r,formattedAttributes:n,chartType:s,layer:o,expressionAttributes:a}=e,{popupTemplate:l,relatedInfos:u}=this,{fields:c,normalizeField:h}=t,p=o;if(t.fields=Eun(c,p),h&&(t.normalizeField=moe(h,p)),!c.some(v=>!!(n[v]!=null||TP(v)&&u?.size)))return;const m=l?.fieldInfos??[];c.forEach((v,w)=>{const S=t.colors?.[w];if(TP(v))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:m,fieldName:v,formattedAttributes:n,chartType:s,value:t,color:S})]);const I=this._getChartOption({value:t,attributes:r,chartType:s,formattedAttributes:n,expressionAttributes:a,fieldName:v,fieldInfos:m,color:S});t.series.push(I)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:r,formattedAttributes:n,chartType:s,value:o,color:a}=e,l=[],u=$ye(r),c=u&&this.relatedInfos?.get(u.layerId.toString());if(!c)return l;const{relatedFeatures:h,relation:p}=c;if(!p||!h)return l;const{cardinality:m}=p;return h.forEach(v=>{const{attributes:w}=v;w&&Object.keys(w).forEach(S=>{S===u.fieldName&&l.push(this._getChartOption({value:o,attributes:w,formattedAttributes:n,fieldName:r,chartType:s,relatedFieldName:S,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:a}))})}),m==="one-to-many"||m==="many-to-many"?l:[l[0]]}_getTooltip({label:e,value:t,chartType:r}){return r==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:r,formattedAttributes:n,expressionAttributes:s,fieldName:o,relatedFieldName:a,fieldInfos:l,chartType:u,hasMultipleRelatedFeatures:c,color:h}=e,p=this.layer,m=this.fieldInfoMap??new Map,{normalizeField:v,tooltipField:w}=t,S=v?TP(v)?r[$ye(v).fieldName]:r[v]:null,I=SKe(o)&&s&&s[o]!==void 0?s[o]:a&&r[a]!==void 0?r[a]:r[o]!==void 0?r[o]:n[o],R=new KAt({fieldName:o,color:h,value:I===void 0?null:I&&S?I/S:I});if(TP(o)){const V=m.get(o.toLowerCase()),Y=w&&m.get(w.toLowerCase()),K=V?.fieldName??o,Q=c&&w?$ye(w).fieldName:Y?.fieldName??w,re=c&&Q?r[Q]:n[Q]??V?.label??V?.fieldName??a,ne=c&&a?r[a]:n[K];return R.tooltip=this._getTooltip({label:re,value:ne,chartType:u}),R}const L=pqt(l,o),k=moe(o,p),B=w&&n[w]!==void 0?n[w]:cqt(L||new dae({fieldName:k}),this.popupTemplate?.expressionInfos),$=n[k];return R.tooltip=this._getTooltip({label:B,value:$,chartType:u}),R}};x([D()],Jf.prototype,"abilities",void 0),x([So("abilities")],Jf.prototype,"castAbilities",null),x([D()],Jf.prototype,"activeMediaInfoIndex",void 0),x([D({readOnly:!0})],Jf.prototype,"activeMediaInfo",null),x([D()],Jf.prototype,"attributes",void 0),x([D()],Jf.prototype,"description",void 0),x([D()],Jf.prototype,"fieldInfoMap",void 0),x([D()],Jf.prototype,"formattedAttributes",void 0),x([D()],Jf.prototype,"expressionAttributes",void 0),x([D({readOnly:!0})],Jf.prototype,"formattedMediaInfos",null),x([D()],Jf.prototype,"isAggregate",void 0),x([D()],Jf.prototype,"layer",void 0),x([D({readOnly:!0})],Jf.prototype,"formattedMediaInfoCount",null),x([D()],Jf.prototype,"mediaInfos",void 0),x([D()],Jf.prototype,"popupTemplate",void 0),x([D()],Jf.prototype,"relatedInfos",void 0),x([D()],Jf.prototype,"title",void 0),Jf=x([Qe("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],Jf);const M8=Jf,jf="esri-feature-media",n1={base:jf,mediaContainer:`${jf}__container`,mediaItemContainer:`${jf}__item-container`,mediaItem:`${jf}__item`,mediaItemText:`${jf}__item-text`,mediaItemTitle:`${jf}__item-title`,mediaItemCaption:`${jf}__item-caption`,mediaNavigation:`${jf}__item-navigation`,mediaPagination:`${jf}__pagination`,mediaPaginationText:`${jf}__pagination-text`,mediaPrevious:`${jf}__previous`,mediaPreviousIconLTR:`${jf}__previous-icon`,mediaPreviousIconRTL:`${jf}__previous-icon--rtl`,mediaNext:`${jf}__next`,mediaNextIconLTR:`${jf}__next-icon`,mediaNextIconRTL:`${jf}__next-icon--rtl`,mediaChart:`${jf}__chart`,mediaPaginationButton:`${jf}__pagination-button`,mediaPaginationIcon:`${jf}__pagination-icon`,mediaChartRendered:`${jf}__chart--rendered`},WPe=15,GD="category",OK="value",Ocn="rgba(50, 50, 50, 1)",Pcn=250,Rcn=500,Dcn=200;let f1=class extends my{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new M8,this.messages=null,this._disposeChart=r=>{this._chartRootMap.get(r)?.dispose(),this._chartRootMap.delete(r)},this._createChart=async r=>{const{destroyed:n,viewModel:s}=this;if(n||!s||!r)return;const{createRoot:o}=await Promise.resolve().then(()=>fHn),a=await o(r);this._chartRootMap.set(r,a),this._renderChart({mediaInfo:s.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),js),Ki(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),js)])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe)})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return er("div",{bind:this,class:n1.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,r=this._renderMediaText();return e?er("div",{class:n1.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),er("div",{class:n1.mediaNavigation},r,e>1?er("div",{class:n1.mediaPagination},this._renderMediaPageButton("previous"),er("span",{class:n1.mediaPaginationText},xC(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?er("div",{class:n1.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,r=e&&e.caption?er("div",{class:n1.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||r?er("div",{class:n1.mediaItemText,key:"media-text"},t,r):null}_renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:r,formattedMediaInfoCount:n}=this.viewModel,{value:s,refreshInterval:o,altText:a,title:l,type:u}=e,{sourceURL:c,linkURL:h}=s,p=uqt(h??void 0)?"_blank":"_self",m=p==="_blank"?"noreferrer":"",v=o?t:null,w=v?v.timestamp:0,S=v?v.sourceURL:c,I=er("img",{alt:a||l,key:`media-${u}-${r}-${n}-${w}`,src:S??void 0});return(h?er("a",{href:h,rel:m,target:p,title:l},I):null)??I}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:r}=this.viewModel;return er("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:n1.mediaChart,key:`media-${e.type}-${t}-${r}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?er("div",{class:n1.mediaItemContainer,key:"media-container"},er("div",{class:n1.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",r=t?this.messages.previous:this.messages.next,n=t?"chevron-left":"chevron-right",s=t?"media-previous":"media-next",o=t?this._previous:this._next;return er("button",{"aria-label":r,bind:this,class:n1.mediaPaginationButton,key:s,onclick:o,tabIndex:0,title:r,type:"button"},er("calcite-icon",{class:n1.mediaPaginationIcon,icon:n,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await Promise.resolve().then(()=>WD),r=new Map;return e.forEach(n=>{n.color&&r.set(n,t(n.color.toCss(!0)))}),r}async _getRendererColors(){const{colorAm5:e}=await Promise.resolve().then(()=>WD),t=new Map,r=this._getRenderer(),n="default";if(!r)return t;const s=await pcn(r);return s.delete(n),Array.from(s.values()).every(o=>o?.length===1)&&Array.from(s.keys()).forEach(o=>{const a=s.get(o)?.[0]?.toCss(!0);a&&t.set(o,e(a))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!icn()}_getChartAnimationMS(){return this._canAnimateChart()?Pcn:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?Rcn:0}async _renderChart(e){const{root:t,mediaInfo:r}=e,{value:n,type:s}=r,{ResponsiveThemeAm5:o,DarkThemeAm5:a,AnimatedThemeAm5:l,ColorSetAm5:u,ThemeAm5:c,esriChartColorSet:h}=await Promise.resolve().then(()=>WD),p=c.new(t);p.rule("ColorSet").set("colors",h),p.rule("ColorSet").set("reuse",!0);const m=[o.new(t),p];L5t()&&m.push(a.new(t)),this._canAnimateChart()&&m.push(l.new(t)),t.setThemes(m);const v=await this._getRendererColors(),w=await this._getSeriesColors(n.series),S=u.new(t,{}),I=w.get(n.series[0]),R=I?{lineSettings:{stroke:I}}:void 0,L=n.series.map((k,B)=>{const $=w.get(k)||v.get(k.fieldName)||S.getIndex(B);return{[GD]:k.tooltip,[OK]:k.value,columnSettings:{fill:$,stroke:$},...R}}).filter(k=>s!=="pie-chart"||k.value!=null&&k.value>0);s==="pie-chart"?this._createPieChart(e,L):this._createXYChart(e,L)}_getDirection(){return nk(this.container)?"rtl":"ltr"}_isInversed(){return!!nk(this.container)}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:r}=await Promise.resolve().then(()=>WD);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:r(Ocn)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:Dcn})}async _createPieChart(e,t){const{TooltipAm5:r}=await Promise.resolve().then(()=>WD),{PieChartAm5:n,PieSeriesAm5:s}=await Promise.resolve().then(()=>LHn),{mediaInfo:o,root:a}=e,{title:l}=o,u=5,c=o?.altText||o?.title||"",h=a.container.children.push(n.new(a,{ariaLabel:c,focusable:!0,paddingBottom:u,paddingTop:u,paddingLeft:u,paddingRight:u})),p=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,m=r.new(a,{labelText:p}),v=h.series.push(s.new(a,{name:l,valueField:OK,categoryField:GD,tooltip:m}));v.ticks.template.set("forceHidden",!0),v.labels.template.set("forceHidden",!0),v.slices.template.states.create("active",{shiftRadius:u}),this._customizeChartTooltip(m),v.slices.template.setAll({ariaLabel:p,focusable:!0,templateField:"columnSettings"}),v.data.setAll(t),v.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(n1.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(r=>t=Math.min(r.value,t)),t}async _createColumnChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,ColumnSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{mediaInfo:h,root:p}=t,{value:m,title:v}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(o.new(p,{renderer:a.new(p,{inversed:this._isInversed()}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.yAxes.push(l.new(p,{renderer:u.new(p,{inside:!1}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryX}",R=n.new(p,{labelText:I}),L=e.series.push(c.new(p,{name:v,xAxis:w,yAxis:S,valueYField:OK,categoryXField:GD,tooltip:R}));this._customizeChartTooltip(R),L.columns.template.setAll({ariaLabel:I,focusable:!0,templateField:"columnSettings"}),m.series.length>WPe&&e.set("scrollbarX",s.new(p,{orientation:"horizontal"})),w.data.setAll(r),L.data.setAll(r),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,ColumnSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{mediaInfo:h,root:p}=t,{value:m,title:v}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const w=e.yAxes.push(o.new(p,{renderer:u.new(p,{inversed:!0}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.xAxes.push(l.new(p,{renderer:a.new(p,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryY}",R=n.new(p,{labelText:I}),L=e.series.push(c.new(p,{name:v,xAxis:S,yAxis:w,valueXField:OK,categoryYField:GD,tooltip:R}));this._customizeChartTooltip(R,"vertical"),L.columns.template.setAll({ariaLabel:I,focusable:!0,templateField:"columnSettings"}),m.series.length>WPe&&e.set("scrollbarY",s.new(p,{orientation:"vertical"})),w.data.setAll(r),L.data.setAll(r),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,r){const{TooltipAm5:n,ScrollbarAm5:s}=await Promise.resolve().then(()=>WD),{CategoryAxisAm5:o,AxisRendererXAm5:a,ValueAxisAm5:l,AxisRendererYAm5:u,LineSeriesAm5:c}=await Promise.resolve().then(()=>_fe),{root:h,mediaInfo:p}=t,{value:m,title:v}=p;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(o.new(h,{renderer:a.new(h,{inversed:this._isInversed()}),categoryField:GD}));w.get("renderer").labels.template.setAll({forceHidden:!0});const S=e.yAxes.push(l.new(h,{renderer:u.new(h,{inside:!1}),min:this._getMinSeriesValue(m.series)}));S.get("renderer").labels.template.setAll({direction:this._getDirection()});const I="{categoryX}",R=r[0]?.lineSettings?.stroke,L=n.new(h,{getFillFromSprite:!R,labelText:I});R&&L.get("background")?.setAll({fill:R});const k=e.series.push(c.new(h,{name:v,xAxis:w,yAxis:S,valueYField:OK,categoryXField:GD,tooltip:L}));k.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(L,"vertical"),m.series.length>WPe&&e.set("scrollbarX",s.new(h,{orientation:"horizontal"})),w.data.setAll(r),k.data.setAll(r),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:r,XYCursorAm5:n}=await Promise.resolve().then(()=>_fe),{root:s,mediaInfo:o}=e,{type:a}=o,l=o?.altText||o?.title||"",u=s.container.children.push(r.new(s,{ariaLabel:l,focusable:!0,panX:!0,panY:!0}));u.set("cursor",n.new(s,{})),a==="column-chart"&&await this._createColumnChart(u,e,t),a==="bar-chart"&&await this._createBarChart(u,e,t),a==="line-chart"&&await this._createLineChart(u,e,t),u.root.dom.classList.toggle(n1.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:r}=e;if(!t)return;const n=6e4*t;this._updateMediaInfoTimestamp(r.sourceURL);const s=setInterval(()=>{this._updateMediaInfoTimestamp(r.sourceURL)},n);this._refreshTimer=s}_getImageSource(e,t){const r=e.includes("?")?"&":"?",[n,s=""]=e.split("#");return`${n}${r}timestamp=${t}${s?"#":""}${s}`}};x([D()],f1.prototype,"_refreshIntervalInfo",void 0),x([D()],f1.prototype,"attributes",null),x([D()],f1.prototype,"activeMediaInfoIndex",null),x([D()],f1.prototype,"description",null),x([D()],f1.prototype,"fieldInfoMap",null),x([D()],f1.prototype,"layer",null),x([D()],f1.prototype,"mediaInfos",null),x([D()],f1.prototype,"popupTemplate",null),x([D()],f1.prototype,"relatedInfos",null),x([D()],f1.prototype,"title",null),x([D({type:M8})],f1.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],f1.prototype,"messages",void 0),f1=x([Qe("esri.widgets.Feature.FeatureMedia")],f1);const wqt=f1,Fcn="esri.widgets.Feature.support.arcadeFeatureUtils",q0t=()=>di.getLogger(Fcn);function kcn(i){return typeof i=="string"?Ble(CKe(i)):Array.isArray(i)?Lcn(i):i?.declaredClass==="esri.arcade.Dictionary"?Ncn(i):i}function Lcn(i){return`
    ${i.map(e=>`
  • ${typeof e=="string"?Ble(CKe(e)):e}
  • `).join("")}
`}function Ncn(i){const e=i.keys().map(t=>{const r=i.field(t);return`${t}${typeof r=="string"?Ble(CKe(r)):r}`}).join("");return`${e}
`}function xqt(){return Promise.resolve().then(()=>qHn)}function $cn(i){return"createQuery"in i&&"queryFeatures"in i}async function Bcn({graphic:i,view:e,options:t}){const{isAggregate:r,layer:n}=i;if(!r||!n||e?.type!=="2d")return[];const s=await e.whenLayerView(n);if(!$cn(s))return[];const o=s.createQuery(),a=i.getObjectId();o.aggregateIds=a!=null?[a]:[];const{features:l}=await s.queryFeatures(o,t);return l}function jcn({layer:i,aggregatedFeatures:e,interceptor:t}){const{fields:r,objectIdField:n,geometryType:s,spatialReference:o,displayField:a}=i;return new yh({fields:r,objectIdField:n,geometryType:s,spatialReference:o,displayField:a,interceptor:t,...i.type==="feature"?{templates:i.templates,typeIdField:i.typeIdField,types:i.types}:null,source:e})}async function Sqt({expressionInfo:i,arcade:e,interceptor:t,spatialReference:r,map:n,graphic:s,location:o,view:a,options:l}){if(!i?.expression)return null;const{isAggregate:u}=s,c=(s.sourceLayer||s.layer)??void 0,h=u?"feature-reduction-popup":"popup",p=e.createArcadeProfile(h),m=e.createArcadeExecutor(i.expression,p).catch(L=>q0t().error("arcade-executor-error",{error:L,expressionInfo:i})),[v,w]=await Promise.all([Bcn({graphic:s,view:a,options:l}),m]);if(!w)return null;const S=h==="feature-reduction-popup"?jcn({layer:c,aggregatedFeatures:v,interceptor:t}):void 0,I={...h==="feature-reduction-popup"?{$aggregatedFeatures:S}:{$datastore:c?.url,$layer:c?.type==="feature"||c?.type==="subtype-sublayer"?c:c?.type==="scene"&&c.associatedLayer!=null?c.associatedLayer:void 0,$map:n,$userInput:o,$graph:c?.type==="knowledge-graph-sublayer"?c?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},R={abortSignal:l?.signal??void 0,interceptor:t??void 0,rawOutput:!0,spatialReference:r??void 0,timeZone:a?.timeZone};return await w.executeAsync(I,R).catch(L=>q0t().error("arcade-execution-error",{error:L,graphic:s,expressionInfo:i})).finally(()=>S?.destroy())}async function Gcn({expressionInfos:i,spatialReference:e,graphic:t,interceptor:r,map:n,view:s,location:o,options:a}){if(!i?.length)return{};const l=await xqt(),u={};for(const p of i)u[`expression/${p.name}`]=Sqt({expressionInfo:p,arcade:l,interceptor:r,spatialReference:e,map:n,graphic:t,location:o,view:s,options:a});const c=await g0(u),h={};for(const p in c)h[p]=kcn(c[p].value);return h}const Ucn=1;let z_=class extends un{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const r=t==="fields"?new VCe:t==="media"?new M8:t==="text"?new twe:null;this._set("contentElementViewModel",r)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Qbe(this._compile,Ucn,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:r,interceptor:n,spatialReference:s,map:o,location:a,view:l,_abortController:u}=this;if(!t||!r)return void this._set("contentElement",null);const c=await xqt();if(u!==this._abortController)return;const h=await Sqt({arcade:c,expressionInfo:t,graphic:r,location:a,interceptor:n,map:o,spatialReference:s,view:l});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const p=await h.castAsJsonAsync(u?.signal),m=p?.type,v=m==="media"?One.fromJSON(p):m==="text"?yW.fromJSON(p):m==="fields"?gW.fromJSON(p):null;this._set("contentElement",v)},this.addHandles([Ki(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),js),Ki(()=>[this.contentElement],()=>this._createVM(),js)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:r}=this;return e?"loading":t||r?"ready":"disabled"}get map(){return this.view?.map??null}set map(e){this._override("map",e)}};x([D()],z_.prototype,"_abortController",void 0),x([D({type:JAt})],z_.prototype,"expressionInfo",void 0),x([D({type:Us})],z_.prototype,"graphic",void 0),x([D({readOnly:!0})],z_.prototype,"contentElement",void 0),x([D({readOnly:!0})],z_.prototype,"contentElementViewModel",void 0),x([D()],z_.prototype,"interceptor",void 0),x([D({type:$i})],z_.prototype,"location",void 0),x([D()],z_.prototype,"spatialReference",null),x([D({readOnly:!0})],z_.prototype,"state",null),x([D()],z_.prototype,"map",null),x([D()],z_.prototype,"view",void 0),z_=x([Qe("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],z_);const MKe=z_,qPe="esri-feature",YPe={base:`${qPe}-expression`,loadingSpinnerContainer:`${qPe}__loading-container`,spinner:`${qPe}__loading-spinner`};let Bye=class extends my{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new MKe}initialize(){this.addHandles(Ki(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),js))}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return er("div",{class:YPe.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return er("div",{class:YPe.loadingSpinnerContainer,key:"loading-container"},er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,YPe.spinner)}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,r=t?.type;this._destroyContentWidget();const n=e?r==="fields"?new bqt({viewModel:e}):r==="media"?new wqt({viewModel:e}):r==="text"?new Nye({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};x([D({type:MKe})],Bye.prototype,"viewModel",void 0),Bye=x([Qe("esri.widgets.Feature.FeatureExpression")],Bye);const zcn=Bye;var Y0t;(function(i){i.TOO_SHORT="length-validation-error::too-short"})(Y0t||(Y0t={}));const Vcn=i=>{const e=[];if(i.formTemplate){const{description:t,title:r}=i.formTemplate;i.fields?.forEach(n=>{const s=r&&Git(r,n.name),o=t&&Git(t,n.name);(s||o)&&e.push(n.name)})}return e},XPe=100;let Ac=class extends xs(iT(un)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await NP(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await NP(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await NP(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=xd(this._queryController,XPe),this._queryFeatureCountDebounced=xd(this._queryFeatureCountController,XPe),this._queryPageDebounced=xd(this._queryPageController,XPe),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:r}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,r.removeAll(),this.destroyed||r.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([Ki(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),js),Ki(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),Ki(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:r}=this,n=1,s=Math.ceil(r/t)||1;this._set("featurePage",Math.min(Math.max(e,n),s))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(r=>{const n=r.clone();return n.field=moe(r.field,t),n}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new dr}get relatedLayer(){const{layer:e,map:t,relationship:r}=this;return e?.loaded&&t&&r?Wun(t,e,r)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return typeof e=="number"?t?.relationships?.find(({id:r})=>r===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new dr}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:r,canQuery:n,_loaded:s,canLoad:o}=this;return t||o&&!s?"loading":e||r?"querying":n?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.forEach(e=>!e.destroyed&&e.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:r,objectId:n,_queryFeatureCountAbortController:s,canQuery:o,supportsCacheHint:a}=this;if(await e?.load(),await t?.load(),!o||!e||!t)return void this._set("featureCount",0);const l=t.createQuery(),u=new p3({cacheHint:a,relationshipId:r,returnGeometry:!1,objectIds:[n],where:l.where??void 0}),c=await e.queryRelatedFeaturesCount(u,{signal:s?.signal});this._set("featureCount",c[n]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:r}=this;return t?e:r?e.slice(0,r):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:r,_queryPageAbortController:n,featureCount:s}=this;!r||t<2||!s||e.addMany(await this._queryRelatedFeatures({signal:n?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:r,featuresPerPage:n,displayCount:s,layer:o,relationshipId:a,featurePage:l,featureCount:u,relatedLayer:c,supportsCacheHint:h}=this,{canQuery:p,objectId:m}=this;if(!p||!o||!c)return[];const v=r?((l-1)*n+u)%u:0,w=r?n:s,S=c.objectIdField,I=[...t.map(V=>V.field),...Vcn(c),S].filter(Ga),R=t.map(V=>`${V.field} ${V.order}`),L=c.createQuery(),k=new p3({orderByFields:R,start:v,num:w,outFields:I,cacheHint:h,relationshipId:a,returnGeometry:!1,objectIds:[m],where:L.where??void 0}),B=await o.queryRelatedFeatures(k,{signal:e?.signal}),$=B[m]?.features||[];return $.forEach(V=>{V.sourceLayer=c,V.layer=c}),$}};x([D()],Ac.prototype,"_loaded",void 0),x([D()],Ac.prototype,"_queryAbortController",void 0),x([D()],Ac.prototype,"_queryPageAbortController",void 0),x([D()],Ac.prototype,"_queryFeatureCountAbortController",void 0),x([D({value:1})],Ac.prototype,"featurePage",null),x([D()],Ac.prototype,"featuresPerPage",void 0),x([D({readOnly:!0})],Ac.prototype,"orderByFieldsFixedCasing",null),x([D({readOnly:!0})],Ac.prototype,"supportsCacheHint",null),x([D({readOnly:!0})],Ac.prototype,"canLoad",null),x([D({readOnly:!0})],Ac.prototype,"canQuery",null),x([D()],Ac.prototype,"description",void 0),x([D({readOnly:!0})],Ac.prototype,"itemDescriptionFieldName",null),x([D({value:3})],Ac.prototype,"displayCount",null),x([D({type:Us})],Ac.prototype,"graphic",void 0),x([D()],Ac.prototype,"layer",void 0),x([D()],Ac.prototype,"map",void 0),x([D({readOnly:!0})],Ac.prototype,"objectId",null),x([D({readOnly:!0})],Ac.prototype,"objectIdField",null),x([D()],Ac.prototype,"orderByFields",void 0),x([D({readOnly:!0})],Ac.prototype,"relatedFeatures",null),x([D({readOnly:!0})],Ac.prototype,"relatedLayer",null),x([D({readOnly:!0})],Ac.prototype,"relationship",null),x([D()],Ac.prototype,"featureCount",void 0),x([D({readOnly:!0})],Ac.prototype,"relatedFeatureViewModels",null),x([D()],Ac.prototype,"relationshipId",void 0),x([D()],Ac.prototype,"showAllEnabled",void 0),x([D()],Ac.prototype,"state",null),x([D()],Ac.prototype,"title",void 0),Ac=x([Qe("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Ac);const OKe=Ac,ute="esri-feature",PK=`${ute}-relationship`,DM={base:PK,listContainer:`${PK}__list`,listItem:`${PK}__list-item`,listItemHidden:`${PK}__list-item--hidden`,listContainerQuerying:`${PK}__list--querying`,featureObserver:`${ute}__feature-observer`,stickySpinnerContainer:`${ute}__sticky-loading-container`,loadingSpinnerContainer:`${ute}__loading-container`,spinner:`${ute}__loading-spinner`},X0t={title:!0,description:!0};let m1=class extends my{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([r])=>{r?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new OKe,this.messages=null,this.messagesCommon=null,this.visibleElements={...X0t},this._increaseFeaturePage=()=>{const{state:r,showAllEnabled:n,relatedFeatures:s,featuresPerPage:o,featurePage:a}=this.viewModel;r==="ready"&&n&&s.length>=o*a&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new zCe,this.addHandles([Ki(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),js),Ki(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),ju(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Y3({icon:()=>Promise.resolve().then(()=>sEe),list:()=>Promise.resolve().then(()=>Lii),"list-item":()=>Promise.resolve().then(()=>Gii),notice:()=>Promise.resolve().then(()=>wZe)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=zo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:r,state:n}=this.viewModel;return!e&&!!t&&n==="ready"&&(t>r||r===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return xC(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...X0t,...e}}render(){const{state:e}=this.viewModel;return er("div",{class:this.classes(DM.base,Xo.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_renderStickyLoading(){return this.viewModel.state==="querying"?er("div",{class:DM.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,DM.spinner)})}_renderLoading(){return er("div",{class:DM.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return er("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=nk(this.container)?"chevron-left":"chevron-right";return er("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,r=e.title;e.description=t&&e.formattedAttributes?.global[t];const n=e.state==="loading";return er("calcite-list-item",{class:this.classes(DM.listItem,{[DM.listItemHidden]:n}),description:e.description??"",key:e.uid,label:r,onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?er("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return er("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},er("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return er("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:DM.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return er("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return er("div",{class:this.classes(DM.listContainer,{[DM.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return er("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},er("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(r=>{this.addHandles(Ki(()=>[r.title,r.state],()=>this.scheduleRender(),js),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,r=t.description&&this.description,n=t.title&&this.title;this._featureElementInfo?.set({description:r,title:n,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await jk(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};x([D()],m1.prototype,"_relatedFeatureIntersectionObserverNode",void 0),x([D({readOnly:!0})],m1.prototype,"displayShowAllButton",null),x([D({readOnly:!0})],m1.prototype,"displayListItems",null),x([D()],m1.prototype,"description",null),x([D({readOnly:!0})],m1.prototype,"featureCountDescription",null),x([D()],m1.prototype,"headingLevel",void 0),x([D()],m1.prototype,"title",null),x([D({type:OKe})],m1.prototype,"viewModel",void 0),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],m1.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],m1.prototype,"messagesCommon",void 0),x([D()],m1.prototype,"visibleElements",void 0),x([So("visibleElements")],m1.prototype,"castVisibleElements",null),m1=x([Qe("esri.widgets.Feature.FeatureRelationship")],m1);const J0t=m1;let Hcn=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=r=>{}),this.preRequestCallback||(this.preLayerQueryCallback=r=>{})}};var cte;const Wcn=1,K0t="content-view-models",Z0t="relationship-view-models",Q0t={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let dh=cte=class extends iT(un){constructor(i){super(i),this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Qbe(this._graphicChanged,Wcn,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...Q0t},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:t}=this;return e.type==="attachments"&&!!t.attachmentsContent||e.type==="custom"&&!!t.customContent||e.type==="fields"&&!!t.fieldsContent||e.type==="media"&&!!t.mediaContent||e.type==="text"&&!!t.textContent||e.type==="expression"&&!!t.expressionContent||e.type==="relationship"&&!!t.relationshipContent},this.addHandles(Ki(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),js))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return Bun(N0t(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return lqt(this.graphic)}castAbilities(i){return{...Q0t,...i}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(i){this._set("graphic",i?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(i){this._override("spatialReference",i)}get timeZone(){return this.view?.timeZone??RS}set timeZone(i){this._overrideIfSome("timeZone",i)}get map(){return this.view?.map||null}set map(i){this._override("map",i)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(i,e){const t=this.contentViewModels[i];t instanceof M8&&t.setActiveMedia(e)}nextMedia(i){const e=this.contentViewModels[i];e instanceof M8&&e.next()}previousMedia(i){const e=this.contentViewModels[i];e instanceof M8&&e.previous()}async updateGeometry(){const{graphic:i,spatialReference:e,_sourceLayer:t}=this;await t?.load();const r=t?.objectIdField;if(!r||!i||!t)return;const n=i?.attributes?.[r];if(n==null)return;const s=[n];if(!i.geometry){const o=await mqt({layer:t,graphic:i,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:e}),a=o?.geometry;a&&(i.geometry=a)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:i}=this;if(!i)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(t){mo(t)||(this._error=t,di.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:t,graphic:i,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:i}=this;i&&i.abort(),this._featureAbortController=null}_compileContentElement(i,e){return i.type==="attachments"?this._compileAttachments(i,e):i.type==="custom"?this._compileCustom(i,e):i.type==="fields"?this._compileFields(i,e):i.type==="media"?this._compileMedia(i,e):i.type==="text"?this._compileText(i,e):i.type==="expression"?this._compileExpression(i,e):i.type==="relationship"?this._compileRelationship(i,e):void 0}_compileContent(i){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(i)?i.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(Ga):typeof i=="string"?this._compileText(new yW({text:i}),0).text:i}_destroyContentViewModels(){this.removeHandles(Z0t),this.removeHandles(K0t),this.contentViewModels.forEach(i=>i&&!i.destroyed&&i.destroy()),this._set("contentViewModels",[])}_matchesFeature(i,e){const t=i?.graphic?.getObjectId(),r=e?.getObjectId();return t!=null&&r!=null&&t===r}_setRelatedFeaturesViewModels({relatedFeatureViewModels:i,relatedFeatures:e,map:t}){const{view:r,spatialReference:n}=this;e?.filter(Boolean).forEach(s=>{i.some(o=>this._matchesFeature(o,s))||i.add(new cte({abilities:{relationshipContent:!1},map:t,view:r,spatialReference:n,graphic:s}))}),i.forEach(s=>{e?.find(a=>this._matchesFeature(s,a))||i.remove(s)})}_setExpressionContentVM(i,e){const t=this.formattedAttributes,{contentElement:r,contentElementViewModel:n}=i,s=r?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:t}),n.set(this._createFieldsVMParams(r,e))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:r,contentElementIndex:e,formattedAttributes:t}),n.set(this._createMediaVMParams(r,e))),s==="text"&&n.set(this._createTextVMParams(r)))}_compileRelationship(i,e){const{displayCount:t,orderByFields:r,relationshipId:n,title:s,description:o}=i,{_sourceLayer:a,graphic:l,map:u}=this;if(!dqt(a))return;const c=new OKe({displayCount:t,graphic:l,orderByFields:r,relationshipId:n,layer:a,map:u,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[e]=c,this.addHandles(ju(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),Z0t),i}_compileExpression(i,e){const{expressionInfo:t}=i,{graphic:r,map:n,spatialReference:s,view:o,location:a}=this,l=new MKe({expressionInfo:t,graphic:r,interceptor:cte.interceptor,map:n,spatialReference:s,view:o,location:a});return this.contentViewModels[e]=l,this.addHandles(Ki(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,e),js),K0t),i}_compileAttachments(i,e){const{graphic:t}=this,{description:r,title:n}=i;return this.contentViewModels[e]=new IKe({graphic:t,...this._compileTitleAndDesc({title:n,description:r})}),i}_compileCustom(i,e){const{graphic:t}=this,{creator:r,destroyer:n}=i;return this.contentViewModels[e]=new twe({graphic:t,creator:r,destroyer:n}),i}_compileTitleAndDesc({title:i,description:e}){const{_fieldInfoMap:t,_sourceLayer:r,graphic:n,formattedAttributes:s}=this,o=n?.attributes,a=this._expressionAttributes,l=s.global;return{title:A8({attributes:o,fieldInfoMap:t,globalAttributes:l,expressionAttributes:a,layer:r,text:i}),description:A8({attributes:o,fieldInfoMap:t,globalAttributes:l,expressionAttributes:a,layer:r,text:e})}}_createFieldsVMParams(i,e){const t=this._effectivePopupTemplate,r=this.formattedAttributes,n={...r?.global,...r?.content[e]},s=i?.fieldInfos||t?.fieldInfos,o=s?.filter(({fieldName:c})=>SKe(c)||TP(c)||n.hasOwnProperty(c)),a=t?.expressionInfos,{description:l,title:u}=i;return{attributes:n,expressionInfos:a,fieldInfos:o,...this._compileTitleAndDesc({title:u,description:l})}}_compileFields(i,e){const t=i.clone(),r=new VCe(this._createFieldsVMParams(i,e));return this.contentViewModels[e]=r,t.fieldInfos=r.formattedFieldInfos.slice(0),t}_createMediaVMParams(i,e){const{abilities:t,graphic:r,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:o,_sourceLayer:a,_expressionAttributes:l}=this,u=this.formattedAttributes,c=r?.attributes??{},{description:h,mediaInfos:p,title:m}=i;return{abilities:{chartAnimation:t.chartAnimation},activeMediaInfoIndex:i.activeMediaInfoIndex||0,attributes:c,isAggregate:r?.isAggregate,layer:a,fieldInfoMap:n,formattedAttributes:{...u?.global,...u?.content[e]},expressionAttributes:l,mediaInfos:p,popupTemplate:s,relatedInfos:o,...this._compileTitleAndDesc({title:m,description:h})}}_compileMedia(i,e){const t=i.clone(),r=new M8(this._createMediaVMParams(i,e));return t.mediaInfos=r.formattedMediaInfos.slice(0),this.contentViewModels[e]=r,t}_createTextVMParams(i){const{graphic:e,_fieldInfoMap:t,_sourceLayer:r,_expressionAttributes:n}=this;if(i&&i.text){const s=e?.attributes??{},o=this.formattedAttributes?.global??{};i.text=A8({attributes:s,fieldInfoMap:t,globalAttributes:o,expressionAttributes:n,layer:r,text:i.text})}return{graphic:e,creator:i.text}}_compileText(i,e){const t=i.clone();return this.contentViewModels[e]=new twe(this._createTextVMParams(t)),t}_compileLastEditInfo(){const{_effectivePopupTemplate:i,_sourceLayer:e,graphic:t,timeZone:r}=this;if(!i)return;const{lastEditInfoEnabled:n}=i,s=e?.editFieldsInfo;return n&&s?$un(s,t?.attributes,r,e):void 0}_compileTitle(i){const{_fieldInfoMap:e,_sourceLayer:t,graphic:r,_expressionAttributes:n}=this,s=r?.attributes??{},o=this.formattedAttributes?.global??{};return A8({attributes:s,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:t,text:i})}async _getTitle(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i?.title;return ewe(t,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i?.content;return ewe(t,{graphic:e})}async _queryFeature(i){const{_featureAbortController:e,_sourceLayer:t,graphic:r,_effectivePopupTemplate:n}=this,s=this.map,o=this.view,a=this.spatialReference,l=this.location;if(e!==this._featureAbortController||!r)return;await Gun({graphic:r,popupTemplate:n,layer:t,spatialReference:a},i);const{content:{value:u},title:{value:c}}=await g0({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:h}}=await g0({checkForRelatedFeatures:this._checkForRelatedFeatures(i),expressionAttributes:Gcn({expressionInfos:n?.expressionInfos,spatialReference:a,graphic:r,map:s,interceptor:cte.interceptor,view:o,options:i,location:l})});e===this._featureAbortController&&r&&(this._expressionAttributes=h,this._graphicExpressionAttributes={...r.attributes,...h},this._set("formattedAttributes",this._createFormattedAttributes(u)),this._set("title",this._compileTitle(c)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(u)||null))}_createMediaFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){const{_effectivePopupTemplate:r,graphic:n,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l,timeZone:u}=this;t.content[e]=jPe({fieldInfos:r?.fieldInfos,graphic:n,attributes:{...l,...i.attributes},layer:o,fieldInfoMap:a,relatedInfos:s,timeZone:u})}_createFieldsFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){if(i.fieldInfos){const{graphic:r,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:l}=this;t.content[e]=jPe({fieldInfos:i.fieldInfos,graphic:r,attributes:{...a,...i.attributes},layer:s,fieldInfoMap:o,relatedInfos:n,timeZone:l})}}_createFormattedAttributes(i){const{_effectivePopupTemplate:e,graphic:t,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:o,timeZone:a}=this,l=e?.fieldInfos,u={global:jPe({fieldInfos:l,graphic:t,attributes:o,layer:n,fieldInfoMap:s,relatedInfos:r,timeZone:a}),content:[]};return Array.isArray(i)&&i.forEach((c,h)=>{c.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:u}),c.type==="media"&&this._createMediaFormattedAttributes({contentElement:c,contentElementIndex:h,formattedAttributes:u})}),u}_checkForRelatedFeatures(i){const{graphic:e,_effectivePopupTemplate:t}=this;return this._queryRelatedInfos(e,N0t(t),i)}async _queryRelatedInfos(i,e,t){const{relatedInfos:r,_sourceLayer:n}=this;r.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(t):n;if(!s||!i||!e.filter(u=>u&&TP(u.fieldName))?.length)return;e.forEach(u=>this._configureRelatedInfo(u,s));const a=await Ecn({relatedInfos:r,layer:s},t);Object.keys(a).forEach(u=>{const c=r.get(u.toString()),h=a[u]?.value;c&&h&&(c.layerInfo=h.data)});const l=await Icn({graphic:i,relatedInfos:r,layer:s},t);Object.keys(l).forEach(u=>{_cn(l[u]?.value,r.get(u.toString()))})}_configureRelatedInfo(i,e){const{relatedInfos:t}=this,r=$ye(i.fieldName);if(!r)return;const{layerId:n,fieldName:s}=r;if(!n)return;const o=t.get(n.toString())||vcn(n,e);o&&(Acn({relatedInfo:o,fieldName:s,fieldInfo:i}),this.relatedInfos.set(n,o))}};dh.interceptor=new Hcn(Vun,Hun),x([D()],dh.prototype,"_error",void 0),x([D()],dh.prototype,"_featureAbortController",void 0),x([D({readOnly:!0})],dh.prototype,"_effectivePopupTemplate",null),x([D({readOnly:!0})],dh.prototype,"_fieldInfoMap",null),x([D({readOnly:!0})],dh.prototype,"_sourceLayer",null),x([D()],dh.prototype,"abilities",void 0),x([So("abilities")],dh.prototype,"castAbilities",null),x([D({readOnly:!0})],dh.prototype,"content",void 0),x([D({readOnly:!0})],dh.prototype,"contentViewModels",void 0),x([D()],dh.prototype,"description",void 0),x([D({type:Boolean})],dh.prototype,"defaultPopupTemplateEnabled",void 0),x([D({readOnly:!0})],dh.prototype,"isTable",null),x([D({readOnly:!0})],dh.prototype,"state",null),x([D({readOnly:!0})],dh.prototype,"formattedAttributes",void 0),x([D({type:Us,value:null})],dh.prototype,"graphic",null),x([D({readOnly:!0})],dh.prototype,"lastEditInfo",void 0),x([D({type:$i})],dh.prototype,"location",void 0),x([D({readOnly:!0})],dh.prototype,"relatedInfos",void 0),x([D()],dh.prototype,"spatialReference",null),x([D()],dh.prototype,"timeZone",null),x([D({readOnly:!0})],dh.prototype,"title",void 0),x([D()],dh.prototype,"map",null),x([D({readOnly:!0})],dh.prototype,"waitingForContent",null),x([D()],dh.prototype,"view",void 0),dh=cte=x([Qe("esri.widgets.Feature.FeatureViewModel")],dh);const PKe=dh,Bg="esri-feature",op={base:Bg,container:`${Bg}__size-container`,title:`${Bg}__title`,main:`${Bg}__main-container`,btn:`${Bg}__button`,icon:`${Bg}__icon`,content:`${Bg}__content`,contentNode:`${Bg}__content-node`,contentNodeText:`${Bg}__content-node--text`,contentElement:`${Bg}__content-element`,text:`${Bg}__text`,lastEditedInfo:`${Bg}__last-edited-info`,fields:`${Bg}__fields`,fieldHeader:`${Bg}__field-header`,fieldData:`${Bg}__field-data`,fieldDataDate:`${Bg}__field-data--date`,loadingSpinnerContainer:`${Bg}__loading-container`,spinner:`${Bg}__loading-spinner`},Tqt=i=>{let e=class extends i{constructor(){super(...arguments),this.renderNodeContent=t=>_qt(t)&&!t.destroyed?er("div",{class:op.contentNode,key:t},t.render()):t instanceof HTMLElement?er("div",{afterCreate:this._attachToNode,bind:t,class:op.contentNode,key:t}):Qun(t)?er("div",{afterCreate:this._attachToNode,bind:t.domNode,class:op.contentNode,key:t}):null}_attachToNode(t){const r=this;t.appendChild(r)}};return e=x([Qe("esri.widgets.Feature.ContentMixin")],e),e};var f7e;const evt={title:!0,content:!0,lastEditedInfo:!0},tvt="relationship-handles";let Hm=f7e=class extends Tqt(my){constructor(i,e){super(i,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...evt},this.viewModel=new PKe}initialize(){this.addHandles(Ki(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),js))}loadDependencies(){return Y3({notice:()=>Promise.resolve().then(()=>wZe)})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(i){this.viewModel.graphic=i}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(i){this.viewModel.defaultPopupTemplateEnabled=i}get isTable(){return this.viewModel.isTable}get label(){return this.messages?.widgetLabel??""}set label(i){this._overrideIfSome("label",i)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(i){this.viewModel.spatialReference=i}get timeZone(){return this.viewModel.timeZone}set timeZone(i){this.viewModel.timeZone=i}get title(){return this.viewModel.title}castVisibleElements(i){return{...evt,...i}}get map(){return this.viewModel.map}set map(i){this.viewModel.map=i}get view(){return this.viewModel.view}set view(i){this.viewModel.view=i}setActiveMedia(i,e){return this.viewModel.setActiveMedia(i,e)}nextMedia(i){return this.viewModel.nextMedia(i)}previousMedia(i){return this.viewModel.previousMedia(i)}render(){const{state:i}=this.viewModel,e=er("div",{class:op.container,key:"container"},this._renderTitle(),i==="error"?this._renderError():i==="loading"?this._renderLoading():this._renderContentContainer());return er("div",{class:this.classes(op.base,Xo.widget)},e)}_renderError(){const{messagesCommon:i,messages:e,visibleElements:t}=this;return er("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},t.title?er("div",{key:"error-title",slot:"title"},i.errorMessage):null,er("div",{key:"error-message",slot:"message"},e.loadingError))}_renderLoading(){return er("div",{class:op.loadingSpinnerContainer,key:"loading-container"},er("span",{class:this.classes(i0.loadingIndicator,Xo.rotating,op.spinner)}))}_renderContentContainer(){const{visibleElements:i}=this;return i.content?er("div",{class:op.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:i,title:e}=this;return i.title?er(AKe,{class:op.title,innerHTML:e,level:this.headingLevel}):null}_renderContent(){const i=this.viewModel.content,e="content";if(!i)return null;if(Array.isArray(i))return i.length?er("div",{class:op.contentNode,key:`${e}-content-elements`},i.map(this._renderContentElement,this)):null;if(typeof i=="string"){const t=this._contentWidgets[0];return!t||t.destroyed?null:er("div",{class:this.classes(op.contentNode,op.contentNodeText),key:`${e}-content`},t.render())}return this.renderNodeContent(i)}_renderContentElement(i,e){const{visibleElements:t}=this;if(typeof t.content!="boolean"&&!t.content?.[i.type])return null;switch(i.type){case"attachments":return this._renderAttachments(e);case"custom":return this._renderCustom(i,e);case"fields":return this._renderFields(e);case"media":return this._renderMedia(e);case"text":return this._renderText(i,e);case"expression":return this._renderExpression(e);case"relationship":return this._renderRelationship(e);default:return null}}_renderAttachments(i){const e=this._contentWidgets[i];if(!e||e.destroyed)return null;const{state:t,attachmentInfos:r}=e.viewModel;return t==="loading"||r.length>0?er("div",{class:this.classes(op.contentElement),key:this._buildKey("attachments-element",i)},e.render()):null}_renderRelationship(i){const e=this._contentWidgets[i];return e&&!e.destroyed&&this.flowItems?er("div",{class:op.contentElement,key:this._buildKey("relationship-element",i)},e.render()):null}_renderExpression(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("expression-element",i)},e.render())}_renderCustom(i,e){const{creator:t}=i,r=this._contentWidgets[e];return!r||r.destroyed?null:t?er("div",{class:op.contentElement,key:this._buildKey("custom-element",e)},r.render()):null}_renderFields(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("fields-element",i)},e.render())}_renderMedia(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:er("div",{class:op.contentElement,key:this._buildKey("media-element",i)},e.render())}_renderLastEditInfo(){const{visibleElements:i,messages:e}=this,{lastEditInfo:t}=this.viewModel;if(!t||!i.lastEditedInfo)return null;const{date:r,user:n}=t,s=t.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=xC(s,{date:r,user:n});return er("div",{class:this.classes(op.lastEditedInfo,op.contentElement),key:"edit-info-element"},o)}_renderText(i,e){const t=i.text,r=this._contentWidgets[e];return!r||r.destroyed?null:t?er("div",{class:this.classes(op.contentElement,op.text),key:this._buildKey("text-element",e)},r.render()):null}_buildKey(i,...e){return`${i}__${this.viewModel?.graphic?.uid||"0"}-${e.join("-")}`}_destroyContentWidget(i){i&&(i.viewModel=null,!i.destroyed&&i.destroy())}_destroyContentWidgets(){this.removeHandles(tvt),this._contentWidgets.forEach(i=>this._destroyContentWidget(i)),this._contentWidgets=[]}_addFeatureRelationshipHandles(i){const{flowItems:e,visibleElements:t}=this;this.addHandles([ju(()=>i,"select-record",({featureViewModel:r})=>{e&&(r.abilities={relationshipContent:!0},e.push(new f7e({flowItems:e,viewModel:r,visibleElements:t})))}),ju(()=>i,"show-all-records",()=>{if(!e)return;const{viewModel:r}=i;r.showAllEnabled=!0;const n=new J0t({visibleElements:{title:!1,description:!1},viewModel:r});this._addFeatureRelationshipHandles(n),e.push(n)})],tvt)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:i,visibleElements:e}=this,t=this.viewModel?.content,{contentViewModels:r}=this.viewModel;if(Array.isArray(t))t.forEach((n,s)=>{if(n.type==="attachments"&&(this._contentWidgets[s]=new Kun({displayType:n.displayType,headingLevel:e.title?i+1:i,viewModel:r[s]})),n.type==="fields"&&(this._contentWidgets[s]=new bqt({viewModel:r[s]})),n.type==="media"&&(this._contentWidgets[s]=new wqt({viewModel:r[s]})),n.type==="text"&&(this._contentWidgets[s]=new Nye({viewModel:r[s]})),n.type==="custom"&&(this._contentWidgets[s]=new Nye({viewModel:r[s]})),n.type==="expression"&&(this._contentWidgets[s]=new zcn({viewModel:r[s]})),n.type==="relationship"){const o=new J0t({viewModel:r[s]});this._addFeatureRelationshipHandles(o),this._contentWidgets[s]=o}},this);else{const n=r[0];n&&!n.destroyed&&(this._contentWidgets[0]=new Nye({viewModel:n}))}this.scheduleRender()}};x([D()],Hm.prototype,"graphic",null),x([D()],Hm.prototype,"defaultPopupTemplateEnabled",null),x([D()],Hm.prototype,"flowItems",void 0),x([D()],Hm.prototype,"headingLevel",void 0),x([D({readOnly:!0})],Hm.prototype,"isTable",null),x([D()],Hm.prototype,"label",null),x([D(),Sg("esri/widgets/Feature/t9n/Feature")],Hm.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],Hm.prototype,"messagesCommon",void 0),x([D()],Hm.prototype,"spatialReference",null),x([D()],Hm.prototype,"timeZone",null),x([D({readOnly:!0})],Hm.prototype,"title",null),x([D()],Hm.prototype,"visibleElements",void 0),x([So("visibleElements")],Hm.prototype,"castVisibleElements",null),x([D()],Hm.prototype,"map",null),x([D()],Hm.prototype,"view",null),x([D({type:PKe})],Hm.prototype,"viewModel",void 0),Hm=f7e=x([Qe("esri.widgets.Feature")],Hm);const qcn=Hm;let q$=class extends rd.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([v0(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),Ki(()=>this.screenLocation,(t,r)=>{t!=null&&r!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:r}=this,n=t?.spatialReference,s=n?kx(e,n).geometry:null;return r&&s&&t?.ready?t.toScreen(s):null}};x([D()],q$.prototype,"location",void 0),x([D()],q$.prototype,"screenLocation",null),x([D()],q$.prototype,"screenLocationEnabled",void 0),x([D()],q$.prototype,"view",void 0),q$=x([Qe("esri.widgets.support.AnchorElementViewModel")],q$);const Cqt=q$,Ycn="esri.widgets.CompassViewModel";let jye=class extends Cqt{constructor(e){super(e),this.visible=!1}};x([D()],jye.prototype,"visible",void 0),jye=x([Qe(Ycn)],jye);const Eqt=jye,JPe="esri-spinner",KPe={base:JPe,spinnerStart:`${JPe}--start`,spinnerFinish:`${JPe}--finish`};let Y$=class extends my{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Eqt}initialize(){this.addHandles(Ki(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:r}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const n=()=>this.hide();r&&r.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,r=!!t,n=e&&r,s=!e&&r,o={[KPe.spinnerStart]:n,[KPe.spinnerFinish]:s},a=this._getPositionStyles();return er("div",{class:this.classes(KPe.base,o),styles:a})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=jk(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:r}=t;return{left:e.x-r.left+"px",top:e.y-r.top+"px"}}};x([D()],Y$.prototype,"location",null),x([D()],Y$.prototype,"view",null),x([D({type:Eqt})],Y$.prototype,"viewModel",void 0),x([D()],Y$.prototype,"visible",null),Y$=x([Qe("esri.widgets.Spinner")],Y$);const Xcn=Y$,N0="esri-features",Wg={icon:`${N0}__icon`,actionImage:`${N0}__action-image`,base:N0,container:`${N0}__container`,contentContainer:`${N0}__content-container`,contentFeature:`${N0}__content-feature`,flowItemCollapsed:`${N0}__flow-item--collapsed`,header:`${N0}__header`,footer:`${N0}__footer`,featureMenuObserver:`${N0}__feature-menu-observer`,actionExit:`${N0}__action--exit`,loader:`${N0}__loader`,featuresHeading:`${N0}__heading`,paginationActionBar:`${N0}__pagination-action-bar`,paginationPrevious:`${N0}__pagination-previous`,paginationNext:`${N0}__pagination-next`};let X$=class extends my{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenRelatedFeature=r=>{this.emit("open-related-feature",{feature:r})}}loadDependencies(){return Y3({action:()=>Promise.resolve().then(()=>Uii),"flow-item":()=>Promise.resolve().then(()=>ari)})}render(){const{flowItems:e}=this,t=e?.toArray();return er(G1r,null,t?.map(r=>this._renderRelatedRecordsFlowItem(r)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleRelatedRecordsBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_renderRelatedRecordsFlowItem(e){const{messages:t,closable:r,closed:n}=this,s="graphic"in e&&!e.isTable;return er("calcite-flow-item",{bind:this,closable:r,closed:n,description:this._getRelatedRecordsFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:o=>{o.preventDefault(),this._handleRelatedRecordsBackClick()},onCalciteFlowItemClose:this._handleCloseClick},er("calcite-action",{appearance:"transparent",bind:this,class:Wg.actionExit,icon:"move-up",key:"exit-related-records-action",label:t.exitRelatedRecords,onclick:this._handleExitClick,scale:"m",slot:"header-actions-start",text:t.exitRelatedRecords,title:t.exitRelatedRecords}),s?er("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-related-feature-action",label:t.selectFeature,onclick:()=>this._handleOpenRelatedFeature(e),scale:"m",slot:"header-actions-end",text:t.selectFeature,title:t.selectFeature}):null,er("div",{class:Wg.container},e.render()))}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}};x([D()],X$.prototype,"flowItems",void 0),x([D(),Sg("esri/widgets/Features/t9n/Features")],X$.prototype,"messages",void 0),x([D()],X$.prototype,"closed",void 0),x([D()],X$.prototype,"closable",void 0),X$=x([Qe("esri.widgets.Features.FeaturesRelatedRecords")],X$);const Jcn=X$;let Kcn=class{constructor(e){this._observable=new pY,this._set=new Set(e)}get size(){return Ws(this._observable),this._set.size}add(e){const t=this._set.size;return this._set.add(e),this._set.size!==t&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(e){const t=this._set.delete(e);return t&&this._observable.notify(),t}entries(){return Ws(this._observable),this._set.entries()}forEach(e,t){Ws(this._observable),this._set.forEach((r,n)=>e.call(t,r,n,this),t)}has(e){return Ws(this._observable),this._set.has(e)}keys(){return Ws(this._observable),this._set.keys()}values(){return Ws(this._observable),this._set.values()}[Symbol.iterator](){return Ws(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}};const ivt="OBJECTID";var kB;(function(i){i[i.size=22]="size",i[i.lineWidth=50]="lineWidth",i[i.maxSize=120]="maxSize",i[i.maxOutlineSize=80]="maxOutlineSize",i[i.tallSymbolWidth=20]="tallSymbolWidth"})(kB||(kB={}));const rvt=yi("android");yi("chrome")||rvt&&rvt>=4;ANe();kB.size;kB.maxSize;kB.maxOutlineSize;kB.lineWidth;kB.tallSymbolWidth;function Iqt(i){return i&&"opacity"in i?i.opacity*Iqt(i.parent):1}async function nvt(i,e){if(!i)return;const t=i.sourceLayer,r=(e!=null&&e.useSourceLayer?t:i.layer)??t,n=Iqt(r);if(i.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const L=i.symbol.type==="web-style"?await Blr(i.symbol,{...e,cache:e!=null?e.webStyleCache:null}):i.symbol.clone();return q3e(L,null,n),L}const s=e?.renderer??Zcn(r);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(i,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):o.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return q3e(o,null,n),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&e?.arcade==null){const L={...e};L.arcade=await e_(),e=L}const{getColor:a,getOpacity:l,getAllSizes:u,getRotationAngle:c}=await Promise.resolve().then(()=>L2e),h=[],p=[],m=[],v=[];for(const L of s.visualVariables)switch(L.type){case"color":h.push(L);break;case"opacity":p.push(L);break;case"rotation":v.push(L);break;case"size":L.target||m.push(L)}const w=!!h.length&&h[h.length-1],S=w?a(w,i,e):null,I=!!p.length&&p[p.length-1];let R=I?l(I,i,e):null;if(n!=null&&(R=R!=null?R*n:n),q3e(o,S,R),m.length){const L=u(m,i,e);await gRt(o,L)}for(const L of v)yRt(o,c(L,i,e),L.axis);return o}function Zcn(i){if(i)return"renderer"in i?i.renderer:void 0}function svt(i){return i&&typeof i.highlight=="function"}const v9=dr.ofType({key:"type",defaultKeyValue:"button",base:C2e,typeMap:{button:xY,toggle:Xze}}),O8=new xY({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:i0.zoomInMagnifyingGlass}),ovt=new xY({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:i0.trash}),pV=new xY({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:i0.zoomInMagnifyingGlass}),W5=new Xze({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:i0.table,value:!1}),Qcn="esri.widgets.Popup.PopupViewModel",iwe=()=>di.getLogger(Qcn),ehn=i=>{const{event:e,view:t,viewModel:r}=i,{action:n}=e;if(!n)return Promise.reject(new qe("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:o}=n;if(!o)return Promise.reject(new qe("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new qe("trigger-action:invalid-action","Action is disabled"));if(o===O8.id)return ihn(r).catch(l3);if(o===pV.id)return rhn(r);if(o===W5.id)return r.browseClusterEnabled=!r.browseClusterEnabled,r.featureMenuOpen=r.browseClusterEnabled,Promise.resolve();if(o===ovt.id){r.visible=!1;const{selectedFeature:a}=r;if(!a)return Promise.reject(new qe(`trigger-action:${ovt.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):t?.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function Aqt(i){const{selectedFeature:e,location:t,view:r}=i;return r?e??t??null:null}function Y6(i){return!!i&&i.isAggregate&&i.sourceLayer?.featureReduction?.type==="cluster"}async function thn(i,e){if(e?.type!=="3d"||!i||i.declaredClass!=="esri.Graphic")return!0;const t=e.getViewForGraphic(i);if(t&&"whenGraphicBounds"in t){let r=null;try{r=await t.whenGraphicBounds(i,{useViewElevation:!0})}catch{}return!r||!r.boundingBox||r.boundingBox[0]===r.boundingBox[3]&&r.boundingBox[1]===r.boundingBox[4]&&r.boundingBox[2]===r.boundingBox[5]}return!0}async function ihn(i){const{location:e,selectedFeature:t,view:r,zoomFactor:n}=i,s=Aqt(i);if(!r||!s){const c=new qe("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:r});throw iwe().error(c),c}const o=r.scale/n,a=i.selectedFeature?.geometry,l=a??e,u=l!=null&&l.type==="point"&&await thn(t,r);O8.active=!0,O8.disabled=!0;try{await i.zoomTo({target:{target:s,scale:u?o:void 0}})}catch{const h=new qe("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});iwe().error(h)}finally{O8.active=!1,O8.disabled=!1,i.zoomToLocation=null,u&&(i.location=l)}}async function rhn(i){const{selectedFeature:e,view:t}=i;if(t?.type!=="2d"){const o=new qe("zoomToCluster:invalid-view","View must be 2d MapView.",{view:t});throw iwe().error(o),o}if(!e||!Y6(e)){const o=new qe("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw iwe().error(o),o}const[r,n]=await RKe(t,e);pV.active=!0,pV.disabled=!0;const{extent:s}=await r.queryExtent(n);s&&await i.zoomTo({target:s}),pV.active=!1,pV.disabled=!1}async function nhn(i){const{view:e,selectedFeature:t}=i;if(!e||!t)return;const[r,n]=await RKe(e,t),{extent:s}=await r.queryExtent(n);i.selectedClusterBoundaryFeature.geometry=s,e.graphics.add(i.selectedClusterBoundaryFeature)}async function shn(i){const{selectedFeature:e,view:t}=i;if(!t||!e)return;const[r,n]=await RKe(t,e);W5.active=!0,W5.disabled=!0;const{features:s}=await r.queryFeatures(n);W5.active=!1,W5.disabled=!1,W5.value=!0,i?.open({features:[e].concat(s),featureMenuOpen:!0})}async function RKe(i,e){const t=await i.whenLayerView(e.sourceLayer),r=t.createQuery(),n=e.getObjectId();return r.aggregateIds=n!=null?[n]:[],[t,r]}function ohn(i){W5.value=!1;const e=i.features.filter(t=>Y6(t));e.length&&(i.features=e)}const ahn=()=>[O8.clone()],lhn=()=>[pV.clone(),W5.clone()];let mpe=null;function uhn(i,e){return i==="building-scene"||e==="2d"&&(i==="map-image"||i==="tile"||i==="imagery"||i==="imagery-tile")}let Pl=class extends dFt(Cqt){constructor(e){super(e),this._pendingPromises=new Kcn,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this._locationScaleHandle=null,this.actions=new v9,this.activeFeature=null,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new Us({symbol:new Hx({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=xd(async t=>{const{view:r}=this,n=this.selectedFeature?.geometry?.type,s=this.location??t;if(n!=="mesh"&&r&&s&&this.selectedFeature)if(n!=="point")try{const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:s}),a=(await Promise.all(o)).flat().filter(Boolean);if(!a.length)return;if(a.length!==this.features.length){const h=this._getHighlightLayer(this.selectedFeature),p=h?.type==="imagery"?void 0:h&&"objectIdField"in h?h.objectIdField||ivt:null;if(p){const m=this.selectedFeature.getObjectId(),v=a.findIndex(w=>this._getHighlightLayer(w)?.uid===h?.uid&&w.attributes[p]===m);this.features=a,this.selectedFeatureIndex=v}}const l=a[this.selectedFeatureIndex]?.geometry,u=(l?.type!=="mesh"?l:null)??this.selectedFeature.geometry,c=u?Wc(u,r.spatialReference):null;if(!c)return;mpe||(mpe=await Promise.resolve().then(()=>T8n)),await mpe.intersects(c,s)||(this.location=(await mpe.nearestCoordinate(c,s)).coordinate??s)}catch(o){mo(o)||di.getLogger(this).error(o)}else this.location=h7e(this.selectedFeature.geometry)??s})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),Ki(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),Ki(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),Ki(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),Ki(()=>this.location,e=>this._locationChange(e)),Ki(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),Ki(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),Ki(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),Ki(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>ehn({event:e,viewModel:this,view:this.view})),v0(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Kl),Ki(()=>[this.features,this.view?.map,this.view?.spatialReference,this.view?.timeZone],()=>this._updateFeatureVMs()),Ki(()=>this.view?.scale,()=>this._viewScaleChange()),v0(()=>!this.visible,()=>this.browseClusterEnabled=!1),Ki(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this._locationScaleHandle?.remove(),this._locationScaleHandle=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new v9;e.removeAll();const{actions:t,defaultActions:r,defaultPopupTemplateEnabled:n,includeDefaultActions:s,selectedFeature:o}=this,a=s?r.concat(t):t,l=o&&(typeof o.getEffectivePopupTemplate=="function"&&o.getEffectivePopupTemplate(n)||o.popupTemplate),u=l?.actions;return(l?.overwriteActions?u:u?.concat(a)??a)?.filter(Boolean).forEach(h=>e.add(h)),e}get defaultActions(){const e=this._get("defaultActions")||new v9;return e.removeAll(),e.addMany(Y6(this.selectedFeature)?lhn():ahn()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:r,promiseCount:n,selectedFeatureIndex:s}=this,o=n&&t.length;o&&r&&s===-1?this.selectedFeatureIndex=0:o&&s!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const r=this.view?.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&r&&(t=WC(e)),this._set("location",t)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice(0)).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,r)=>t.finally(()=>r.then(n=>{this._pendingPromises.has(r)&&this._updateFeatures(n)}).finally(()=>this._pendingPromises.delete(r)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.view?.ready?"ready":"disabled"}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Aqt(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new qe("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:r}=this;if(!r||!e)throw new qe("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:r});return r.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:r}=t;delete t.fetchFeatures,r&&this._setFetchFeaturesPromises(t.location);const n=["actionsMenuOpen","collapsed"];for(const s of n)delete t[s];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){ohn(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Y6(t)?(await nhn(this),await shn(this)):di.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):di.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(O8.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Ga);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Y6(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:r}=this;r&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:r,featuresPerPage:n,featureViewModels:s}=this;if(r===null)return;const o=((r-1)*n+t)%t,a=o+n;s.slice(o,a).forEach((l,u)=>{l&&(l.graphic??=e[o+u])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:r,view:n}=this;if(e&&n){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Y6(e)?void 0:(e.symbol=await nvt(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature));if(e.symbol=await nvt(e),!r&&t||!e.geometry){if(r&&!e.geometry){await this.centerAtLocation();const s=n.center?.clone();s&&(this.location=s)}}else this.location=h7e(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:r,view:n}=this;if(Y6(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const s=r.slice(0),o=[];t.forEach((a,l)=>{if(!a)return;let u=null;if(s.some((c,h)=>(c&&c.graphic===a&&(u=c,s.splice(h,1)),!!u)),u)o[l]=u;else{const c=new PKe({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n?.spatialReference,graphic:a===e?a:null,location:this.location,map:n?.map,view:n});o[l]=c}}),s.forEach(a=>a&&!a.destroyed&&a.destroy()),this._set("featureViewModels",o)}async _getScreenPoint(e,t){const{view:r}=this;await r?.when();const n=e?.spatialReference,s=r?.spatialReference;return n&&s?(await Lx(n,s,null,t),r.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:r,signal:n}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:n}),{signal:n,event:r})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:r}){this._cancelFetchingFeatures();const n=new AbortController,{signal:s}=n;this._fetchFeaturesController=n;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:s,event:r});return o.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:r}=e,{view:n}=this;this._locationScaleHandle?.remove(),this._locationScaleHandle=Ki(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(o=>{mo(o)||di.getLogger(this).error(o)}));const{pendingFeatures:s}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:r,event:e});n?.popup&&"open"in n.popup&&n.popup.open({location:t??void 0,promises:s})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:r}=e;return r&&"layer"in r&&r.layer?r.layer:r?.type==="map-notes"||r?.type==="subtype-group"?r:t}_getHighlightTarget(e,t,r){if(uhn(t.type,r))return e;const n=e.getObjectId();if(n!=null)return n;const s=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||ivt:null,o=e.attributes;return o&&s&&o[s]||e}_mapIncludesLayer(e){return!!this.view?.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:r,activeFeature:n,visible:s}=this;if(!(n&&r&&t&&s))return;const o=this._getHighlightLayer(n);if(!(o&&o instanceof Il&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(r,o);this._highlightActiveFeaturePromise=a;const l=await a;if(!(l&&svt(l)&&this._highlightActiveFeaturePromise===a&&this.activeFeature&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(n,o,r.type));this.addHandles(u,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:r,view:n,visible:s}=this;if(!(t&&n&&r&&s))return;const o=this._getHighlightLayer(t);if(!(o&&o instanceof Il&&this._mapIncludesLayer(o)))return;const a=this._getLayerView(n,o);this._highlightSelectedFeaturePromise=a;const l=await a;if(!(l&&svt(l)&&this._highlightSelectedFeaturePromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const u=l.highlight(this._getHighlightTarget(t,o,n.type));this.addHandles(u,e)}_updateFeatures(e){const{features:t}=this,r=e.filter(n=>!t.includes(n));r?.length&&(this.features=t.concat(r))}};x([D()],Pl.prototype,"_fetchFeaturesController",void 0),x([D({type:v9})],Pl.prototype,"actions",void 0),x([D({readOnly:!0})],Pl.prototype,"active",null),x([D()],Pl.prototype,"activeFeature",void 0),x([D({readOnly:!0})],Pl.prototype,"allActions",null),x([D()],Pl.prototype,"autoCloseEnabled",void 0),x([D()],Pl.prototype,"autoOpenEnabled",void 0),x([D()],Pl.prototype,"browseClusterEnabled",void 0),x([D()],Pl.prototype,"content",void 0),x([D({type:v9,readOnly:!0})],Pl.prototype,"defaultActions",null),x([D({type:Boolean})],Pl.prototype,"defaultPopupTemplateEnabled",void 0),x([D({readOnly:!0})],Pl.prototype,"featureCount",null),x([D()],Pl.prototype,"featurePage",void 0),x([D({value:[]})],Pl.prototype,"features",null),x([D()],Pl.prototype,"featuresPerPage",void 0),x([D()],Pl.prototype,"featureMenuOpen",void 0),x([D()],Pl.prototype,"featureViewModelAbilities",void 0),x([D({readOnly:!0})],Pl.prototype,"featureViewModels",void 0),x([D()],Pl.prototype,"highlightEnabled",void 0),x([D()],Pl.prototype,"includeDefaultActions",void 0),x([D({type:$i})],Pl.prototype,"location",null),x([D({readOnly:!0})],Pl.prototype,"pendingPromisesCount",null),x([D({readOnly:!0})],Pl.prototype,"promiseCount",null),x([D()],Pl.prototype,"promises",null),x([D({readOnly:!0})],Pl.prototype,"selectedClusterBoundaryFeature",void 0),x([D({value:null,readOnly:!0})],Pl.prototype,"selectedFeature",null),x([D({value:-1})],Pl.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],Pl.prototype,"selectedFeatureViewModel",null),x([D({readOnly:!0})],Pl.prototype,"state",null),x([D()],Pl.prototype,"title",void 0),x([D()],Pl.prototype,"updateLocationEnabled",void 0),x([D()],Pl.prototype,"view",void 0),x([D()],Pl.prototype,"visible",void 0),x([D({readOnly:!0})],Pl.prototype,"waitingForContents",null),x([D({readOnly:!0})],Pl.prototype,"waitingForResult",null),x([D()],Pl.prototype,"zoomFactor",void 0),x([D()],Pl.prototype,"zoomToLocation",void 0),x([D()],Pl.prototype,"centerAtLocation",null),Pl=x([Qe("esri.widgets.Features.FeaturesViewModel")],Pl);const DKe=Pl;let LI=class extends un{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};x([D({type:Boolean,nonNullable:!0})],LI.prototype,"actionBar",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"closeButton",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"collapseButton",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"featureNavigation",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"flow",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"heading",void 0),x([D({type:Boolean,nonNullable:!0})],LI.prototype,"spinner",void 0),LI=x([Qe("esri.widgets.Features.FeaturesVisibleElements")],LI);const Mqt=LI,avt="selected-index",chn=0,lvt="features-spinner",hhn=50;let mc=class extends Tqt(my){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([r])=>{r?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusOn=null,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new dr,this._relatedRecordsWidget=new Jcn({flowItems:this._relatedRecordsFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.icon=null,this.featureNavigationTop=!1,this.headerActions=new v9,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new DKe,this.visibleElements=new Mqt,this._renderAction=(r,n)=>{const s=this._getActionTitle(r),{type:o,active:a,uid:l,disabled:u,indicator:c}=r;return r.visible?er("calcite-action",{active:o==="toggle"&&r.value,appearance:"solid",bind:this,"data-action-uid":l,disabled:u,icon:this._getActionIcon(r),indicator:c,key:`action-${n}`,loading:a,onclick:this._triggerAction,scale:"s",text:s,title:this._hideActionText?s:void 0},this._getFallbackIcon(r)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusOn="menu-flow-item"},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusOn="root-flow-item",this.featureMenuOpen=!1)},this._focusFlowItemNode=r=>{this._focusOn===r&&requestAnimationFrame(async()=>{switch(r){case"menu-flow-item":await this._featureMenuViewportNode?.setFocus();break;case"root-flow-item":await this._rootFlowItemNode?.setFocus()}this._focusOn=null})},this._focusFlowItemNodeThrottled=Qbe(this._focusFlowItemNode,hhn),this._displaySpinnerThrottled=Qbe(()=>this._displaySpinner(),chn),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,this._focusFlowItemNodeThrottled,Ki(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),Ki(()=>this.viewModel?.active,r=>this._relatedRecordsWidget.closed=!r),Ki(()=>this.visibleElements?.closeButton,r=>this._relatedRecordsWidget.closable=r),Ki(()=>this.visibleElements?.spinner,r=>this._spinnerEnabledChange(r)),Ki(()=>this.viewModel?.view,(r,n)=>this._viewChange(r,n)),Ki(()=>this.viewModel?.view?.ready,(r,n)=>this._viewReadyChange(r??!1,n??!1)),Ki(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),Ki(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),Ki(()=>this.selectedFeatureWidget,()=>this._destroyRelatedRecordsFlowItemWidgets()),Ki(()=>{const r=this.selectedFeatureWidget?.viewModel;return[r?.title,r?.state]},()=>this._setTitleFromFeatureWidget()),Ki(()=>{const r=this.selectedFeatureWidget?.viewModel;return[r?.content,r?.state]},()=>this._setContentFromFeatureWidget()),Ki(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._relatedRecordsWidget.on("close",()=>this.close()),this._relatedRecordsWidget.on("exit",()=>this._destroyRelatedRecordsFlowItemWidgets()),this._relatedRecordsWidget.on("open-related-feature",({feature:r})=>this._openRelatedFeature(r))])}loadDependencies(){return Y3({action:()=>Promise.resolve().then(()=>Uii),"action-bar":()=>Promise.resolve().then(()=>tJn),"action-group":()=>Promise.resolve().then(()=>nJn),button:()=>Promise.resolve().then(()=>Xle),flow:()=>Promise.resolve().then(()=>lJn),"flow-item":()=>Promise.resolve().then(()=>ari),list:()=>Promise.resolve().then(()=>Lii),"list-item":()=>Promise.resolve().then(()=>Gii),"list-item-group":()=>Promise.resolve().then(()=>dJn),loader:()=>Promise.resolve().then(()=>mJn)})}destroy(){this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._relatedRecordsWidget?.destroy()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_relatedRecordsFlowItems:r}=this,{selectedFeatureViewModel:n}=this.viewModel,s={title:!1};return n?(e?(e.viewModel=n,e.visibleElements=s):this._feature=new qcn({flowItems:r,headingLevel:t+1,viewModel:n,visibleElements:s}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():di.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._setFocusOn():di.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(avt);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(v0(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return er("div",{bind:this,class:this.classes(Wg.base,Xo.widget,Xo.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?er("div",{class:Wg.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:er("div",{class:Wg.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:r,selectedFeatureIndex:n,pendingPromisesCount:s}=t;return er("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:s>0,onclick:this._openFeatureMenu,scale:"s",text:xC(e.pageText,{index:DS(n+1),total:DS(r)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return er("calcite-action-bar",{class:Wg.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},er("calcite-action-group",{scale:"s"},er("calcite-action",{appearance:"solid",class:Wg.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),er("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:r}=this.viewModel,n=e===t,s=r.indexOf(e);return er("calcite-list-item",{bind:this,"data-feature-index":s,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:n,onCalciteListItemSelect:this._selectFeature},er("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(r=>{const n=r?.graphic;if(!n)return;const s=n.sourceLayer??n.layer,o=t.get(s)??[];t.set(s,[...o,r])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?er("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys()).map(r=>er("calcite-list-item-group",{heading:r?.title??this.messagesCommon.untitled,key:r?.uid||"untitled"},t.get(r)?.map(n=>this._renderFeatureMenuItem(n))))):null}_renderHeaderAction(e,t){return e.visible?er("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon||"",indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,scale:"m",slot:"header-actions-end",text:e.title||"",title:e.title||""}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:r,_collapseEnabled:n,featureNavigationTop:s}=this,{title:o,active:a}=this.viewModel,l=t.heading&&o?o:"";return er("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,class:this.classes({[Wg.contentFeature]:!0,[Wg.flowItemCollapsed]:r}),closable:t.closeButton,closed:!a,collapsed:r,collapseDirection:s?"down":"up",collapsible:n,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},l?er(AKe,{class:this.classes(Wg.featuresHeading,Xo.heading),innerHTML:l,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),r?null:er("div",{class:this.classes(Wg.container,Wg.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:r,messagesCommon:n}=this,{active:s,featureViewModels:o,pendingPromisesCount:a}=e;return t?er("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!s,description:xC(r.total,{total:o.length}),heading:r.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:l=>{l.preventDefault(),this._handleFeatureMenuBack()}},a>0?er("calcite-loader",{class:Wg.loader,inline:!0,key:"feature-menu-loader",label:n.loading,scale:"m",slot:"header-actions-end"}):null,er("div",{class:Wg.container},this._renderFeatureMenu()),er("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Wg.featureMenuObserver}),er("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},n.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._relatedRecordsWidget.render()];return this.visibleElements.flow?er("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:r}=e;if(r)return null;const n=hun({action:e,feature:this.selectedFeature}),s={[Wg.icon]:!!t,[Wg.actionImage]:!!n};return t&&(s[t]=!0),n||t?er("span",{"aria-hidden":"true",class:this.classes(Wg.icon,s),key:"icon",styles:cun(n)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?er("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},er("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?er("div",{class:op.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_setFocusOn(){this.renderNow(),requestAnimationFrame(()=>{this._focusOn=this.featureMenuOpen?"menu-flow-item":"root-flow-item"})}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,r=t?.geometry;if(r==null||t==null)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:r});const n=h7e(r);this.open({features:[t],location:n??void 0})}_focusRootFlowItemNode(){this._focusFlowItemNodeThrottled("root-flow-item")}_focusFeatureMenuFlowItemNode(){this._focusFlowItemNodeThrottled("menu-flow-item")}_storeRootFlowItemNode(e){this._rootFlowItemNode=e,this._focusFlowItemNodeThrottled("root-flow-item")}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e,this._focusFlowItemNodeThrottled("menu-flow-item")}_setActiveFeature(e){const{viewModel:t}=this,r=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[r]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:r,messagesCommon:n}=this,{id:s}=e,o=r?.attributes,a=e.title??"",l=s==="zoom-to-feature"?xC(a,{messages:t}):s==="remove-selected-feature"?xC(a,{messages:n}):s==="zoom-to-clustered-features"||s==="browse-clustered-features"?xC(a,{messages:t}):e.title;return l&&o?xC(l,o):l??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,r=e?.viewModel;e&&(this.viewModel.title=r?.state==="error"?t?.errorMessage:r?.title||"")}_addSelectedFeatureIndexHandle(){const e=Ki(()=>this.viewModel?.selectedFeatureIndex,(t,r)=>this._selectedFeatureIndexUpdated(t,r));this.addHandles(e,avt)}_selectedFeatureIndexUpdated(e,t){const{featureCount:r}=this.viewModel;r&&e!==t&&e!==-1&&(this._destroyRelatedRecordsFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const r=t.dataset.actionUid,n=this.headerActions.find(({uid:s})=>s===r);n&&!n.disabled&&(n?.type==="toggle"&&(n.value=!n.value),this.emit("trigger-header-action",{action:n}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const r=t.dataset.actionUid,{allActions:n}=this.viewModel,s=n.findIndex(a=>a.uid===r),o=n.at(s);o&&o.type==="toggle"&&(o.value=!o.value),this.viewModel.triggerAction(s)}_createSpinner(e){e&&(this._spinner=new Xcn({view:e}),e.ui.add(this._spinner,{key:lvt,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:r}=this.viewModel;r&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,lvt),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};x([D()],mc.prototype,"_focusOn",void 0),x([D()],mc.prototype,"_relatedRecordsFlowItems",void 0),x([D()],mc.prototype,"_hideActionText",null),x([D()],mc.prototype,"_featureNavigationVisible",null),x([D()],mc.prototype,"_isCollapsed",null),x([D()],mc.prototype,"_collapseEnabled",null),x([D()],mc.prototype,"collapsed",void 0),x([D()],mc.prototype,"content",null),x([D()],mc.prototype,"icon",void 0),x([D()],mc.prototype,"featureMenuOpen",null),x([D()],mc.prototype,"featureNavigationTop",void 0),x([D()],mc.prototype,"features",null),x([D({type:v9})],mc.prototype,"headerActions",void 0),x([D()],mc.prototype,"headingLevel",void 0),x([D()],mc.prototype,"location",null),x([D()],mc.prototype,"label",null),x([D(),Sg("esri/widgets/Features/t9n/Features")],mc.prototype,"messages",void 0),x([D(),Sg("esri/t9n/common")],mc.prototype,"messagesCommon",void 0),x([D()],mc.prototype,"promises",null),x([D()],mc.prototype,"responsiveActionsEnabled",void 0),x([D({readOnly:!0})],mc.prototype,"selectedFeature",null),x([D()],mc.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],mc.prototype,"selectedFeatureWidget",null),x([D()],mc.prototype,"title",null),x([D()],mc.prototype,"updateLocationEnabled",null),x([D()],mc.prototype,"view",null),x([D({type:DKe}),vqt(["triggerAction","trigger-action"])],mc.prototype,"viewModel",void 0),x([D({type:Mqt,nonNullable:!0})],mc.prototype,"visibleElements",void 0),x([D()],mc.prototype,"visible",null),mc=x([Qe("esri.widgets.Features")],mc);const dhn=mc,L2="esri-popup",aN=`${L2}--is-docked`,Gf={base:L2,main:`${L2}__main-container`,shadow:`${L2}--shadow`,isDocked:aN,isDockedTopLeft:`${aN}-top-left`,isDockedTopCenter:`${aN}-top-center`,isDockedTopRight:`${aN}-top-right`,isDockedBottomLeft:`${aN}-bottom-left`,isDockedBottomCenter:`${aN}-bottom-center`,isDockedBottomRight:`${aN}-bottom-right`,alignTopCenter:`${L2}--aligned-top-center`,alignBottomCenter:`${L2}--aligned-bottom-center`,alignTopLeft:`${L2}--aligned-top-left`,alignBottomLeft:`${L2}--aligned-bottom-left`,alignTopRight:`${L2}--aligned-top-right`,alignBottomRight:`${L2}--aligned-bottom-right`,pointer:`${L2}__pointer`,pointerDirection:`${L2}__pointer-direction`};let m7e=class extends DKe{constructor(e){super(e)}};m7e=x([Qe("esri.widgets.Popup.PopupViewModel")],m7e);const Oqt=m7e;let vO=class extends un{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}};x([D({type:Boolean,nonNullable:!0})],vO.prototype,"actionBar",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"closeButton",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"collapseButton",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"featureNavigation",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"heading",void 0),x([D({type:Boolean,nonNullable:!0})],vO.prototype,"spinner",void 0),vO=x([Qe("esri.widgets.Features.PopupVisibleElements")],vO);const g7e=vO,uvt={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let Su=class extends my{constructor(e,t){super(e,t),this._dockAction=new xY({id:"popup-dock-action"}),this._featuresWidget=new dhn({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this.alignment="auto",this.collapsed=!1,this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new Oqt,this.visibleElements=new g7e}initialize(){this.addHandles([Ki(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),js),Ki(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),js),Ki(()=>this.dockOptions,e=>{const{_dockAction:t}=this,r=this._featuresWidget.headerActions;r.remove(t),e.buttonEnabled&&r.add(t)},js),Ki(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),Ki(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),Ki(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),Ki(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),Ki(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),Ki(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),Ki(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,js),Ki(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,js),Ki(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,js),Ki(()=>this.collapsed,e=>this._featuresWidget.collapsed=e,js),Ki(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,js),Ki(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,js),Ki(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,js),Ki(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,js),Ki(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,js),Ki(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,js),ju(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new g7e(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return ty(di.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){ty(di.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get collapseEnabled(){return ty(di.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){ty(di.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||uvt}set dockOptions(e){const t={...uvt},r=this.viewModel?.view?.breakpoints,n={};r&&(n.width=r.xsmall,n.height=r.xsmall);const s={...t,...e},o={...t.breakpoint,...n},{breakpoint:a}=s;typeof a=="object"?s.breakpoint={...o,...a}:a&&(s.breakpoint=o),this._set("dockOptions",s),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return ty(di.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){ty(di.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}blur(){const{active:e}=this.viewModel;e||di.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||di.getLogger(this).warn("Popup can only be focused when currently active."),this.reposition(),requestAnimationFrame(()=>{this._featuresWidget.focus()})}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,r={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(r),this.viewModel.open(e),this._shouldFocus(e)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:r}=this,{active:n}=this.viewModel,s=n&&e,o=n&&!e,a=this.selectedFeature?.layer?.title,l=this.selectedFeature?.layer?.id,u={[Gf.alignTopCenter]:t==="top-center",[Gf.alignBottomCenter]:t==="bottom-center",[Gf.alignTopLeft]:t==="top-left",[Gf.alignBottomLeft]:t==="bottom-left",[Gf.alignTopRight]:t==="top-right",[Gf.alignBottomRight]:t==="bottom-right",[Gf.isDocked]:s,[Gf.shadow]:o,[Gf.isDockedTopLeft]:r==="top-left",[Gf.isDockedTopCenter]:r==="top-center",[Gf.isDockedTopRight]:r==="top-right",[Gf.isDockedBottomLeft]:r==="bottom-left",[Gf.isDockedBottomCenter]:r==="bottom-center",[Gf.isDockedBottomRight]:r==="bottom-right"};return er("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(Gf.base,u),"data-layer-id":l,"data-layer-title":a,role:"presentation"},n?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:er("div",{class:Gf.pointer,key:"popup-pointer",role:"presentation"},er("div",{class:this.classes(Gf.pointerDirection,Gf.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[Gf.shadow]:e};return er("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(Gf.main,Xo.widget,t)},this._featuresWidget.render())}async _shouldFocus(e){e?.shouldFocus&&(await fR(()=>this.viewModel?.active===!0),this.focus())}_isOutsideView(e){const{popupHeight:t,popupWidth:r,screenLocation:n,side:s,view:o}=e;if(isNaN(r)||isNaN(t)||!o||!n)return!1;const a=o.padding;return s==="right"&&n.x+r/2>o.width-a.right||s==="left"&&n.x-r/2o.height-a.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:r,_mainContainerNode:n,viewModel:s}=this,{screenLocation:o,view:a}=s;if(o==null||!a||!r)return"top-center";function l(k){return parseInt(k.replaceAll(/[^-\d\.]/g,""),10)}const u=n?window.getComputedStyle(n,null):null,c=u?l(u.getPropertyValue("max-height")):0,h=u?l(u.getPropertyValue("height")):0,{height:p,width:m}=r.getBoundingClientRect(),v=m+t,w=Math.max(p,c,h)+t,S=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"right",view:a}),I=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"left",view:a}),R=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"top",view:a}),L=this._isOutsideView({popupHeight:w,popupWidth:v,screenLocation:o,side:"bottom",view:a});return I?R?"bottom-right":"top-right":S?R?"bottom-left":"top-left":R?L?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return nk(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,r=nk(this.container)?"top-left":"top-right";if(!t)return r;const n=t.padding||{left:0,right:0,top:0,bottom:0},s=t.width-n.left-n.right,{breakpoints:o}=t;return o&&s<=o.xsmall?"bottom-center":r}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:r}=this._containerNode.getBoundingClientRect(),n=this._calculatePositionStyle(t,r);n&&Object.assign(this._containerNode.style,n)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:r}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+r:e}_calculateAlignmentPosition(e,t,r,n){const{currentAlignment:s,_pointerOffsetInPx:o}=this;if(!r)return;const{padding:a}=r,l=n/2,u=r.height-t,c=r.width-e;return s==="bottom-center"?{top:t+o-a.top,left:e-l-a.left}:s==="top-left"?{bottom:u+o-a.bottom,right:c+o-a.right}:s==="bottom-left"?{top:t+o-a.top,right:c+o-a.right}:s==="top-right"?{bottom:u+o-a.bottom,left:e+o-a.left}:s==="bottom-right"?{top:t+o-a.top,left:e+o-a.left}:s==="top-center"?{bottom:u+o-a.bottom,left:e-l-a.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:r,view:n}=this;if(!n)return;if(r)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const s=this._calculateFullWidth(t),o=this._calculateAlignmentPosition(e.x,e.y,n,s);return o?{top:o.top!==void 0?`${o.top}px`:"auto",left:o.left!==void 0?`${o.left}px`:"auto",bottom:o.bottom!==void 0?`${o.bottom}px`:"auto",right:o.right!==void 0?`${o.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,r){const[n,s]=e,[o,a]=t,{width:l=0,height:u=0}=r??{};return n<=l&&o>l||n>l&&o<=l||s<=u&&a>u||s>u&&a<=u}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const r=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},n=r.left+r.right,s=r.top+r.bottom,o=[],a=[];o[0]=e[0]-n,o[1]=e[1]-s,a[0]=t[0]-n,a[1]=t[1]-s;const{dockOptions:l}=this,u=l.breakpoint;this._dockingThresholdCrossed(o,a,u)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const r=t.active&&!e;t.screenLocationEnabled=r}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,r=this.viewModel?.view?.ui;if(!r)return!1;const{width:n,height:s}=r;if(isNaN(n)||isNaN(s)||!t)return!1;const o=t.hasOwnProperty("width")&&n<=(t.width??0),a=t.hasOwnProperty("height")&&s<=(t.height??0);return o||a}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};x([D({readOnly:!0})],Su.prototype,"_featureNavigationTop",null),x([D()],Su.prototype,"actions",null),x([D()],Su.prototype,"alignment",void 0),x([D()],Su.prototype,"autoCloseEnabled",null),x([D()],Su.prototype,"autoOpenEnabled",null),x([D()],Su.prototype,"defaultPopupTemplateEnabled",null),x([D()],Su.prototype,"content",null),x([D()],Su.prototype,"collapsed",void 0),x([D()],Su.prototype,"collapseEnabled",null),x([D({readOnly:!0})],Su.prototype,"currentAlignment",null),x([D({readOnly:!0})],Su.prototype,"currentDockPosition",null),x([D()],Su.prototype,"dockOptions",null),x([D()],Su.prototype,"dockEnabled",void 0),x([D({readOnly:!0})],Su.prototype,"featureCount",null),x([D()],Su.prototype,"featureMenuOpen",null),x([D()],Su.prototype,"features",null),x([D()],Su.prototype,"goToOverride",null),x([D()],Su.prototype,"headingLevel",void 0),x([D()],Su.prototype,"highlightEnabled",null),x([D()],Su.prototype,"location",null),x([D()],Su.prototype,"label",null),x([D(),Sg("esri/widgets/Popup/t9n/Popup")],Su.prototype,"messages",void 0),x([D()],Su.prototype,"promises",null),x([D({readOnly:!0})],Su.prototype,"selectedFeature",null),x([D()],Su.prototype,"selectedFeatureIndex",null),x([D({readOnly:!0})],Su.prototype,"selectedFeatureWidget",null),x([D()],Su.prototype,"spinnerEnabled",null),x([D()],Su.prototype,"title",null),x([D()],Su.prototype,"updateLocationEnabled",null),x([D()],Su.prototype,"view",null),x([D({type:Oqt}),vqt(["triggerAction","trigger-action"])],Su.prototype,"viewModel",void 0),x([D()],Su.prototype,"visible",null),x([D({type:g7e,nonNullable:!0})],Su.prototype,"visibleElements",void 0),Su=x([Qe("esri.widgets.Popup")],Su);const phn=Su,cvt=Object.freeze(Object.defineProperty({__proto__:null,default:phn},Symbol.toStringTag,{value:"Module"}));let J$=class extends Ci{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),t=this.geometries[0],r={};return r.outSR=Hv(this.outSpatialReference),r.inSR=Hv(t.spatialReference),r.geometries=JSON.stringify({geometryType:ah(t),geometries:e}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};x([D()],J$.prototype,"geometries",void 0),x([D({json:{read:{source:"outSR"}}})],J$.prototype,"outSpatialReference",void 0),x([D()],J$.prototype,"transformation",void 0),x([D()],J$.prototype,"transformForward",void 0),J$=x([Qe("esri.rest.support.ProjectParameters")],J$);const FKe=J$,fhn=Sd(FKe);async function Pqt(i,e,t){e=fhn(e);const r=gu(i),n={...r.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=ah(e.geometries[0]),a=_p(n,t);return zi(r.path+"/project",a).then(({data:{geometries:l}})=>tRt(l,o,s))}async function Rqt(i=null,e){if(Ho.geometryServiceUrl)return Ho.geometryServiceUrl;if(!i)throw new qe("internal:geometry-service-url-not-configured");let t;t="portal"in i?i.portal||Bu.getDefault():i,await t.load({signal:e});const r=t.helperServices?.geometry?.url;if(!r)throw new qe("internal:geometry-service-url-not-configured");return r}async function mhn(i,e,t=null,r){const n=await Rqt(t,r),s=new FKe;s.geometries=[i],s.outSpatialReference=e;const o=await Pqt(n,s,{signal:r});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new qe("internal:geometry-service-projection-failed")}const ghn=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:Rqt,projectGeometry:mhn},Symbol.toStringTag,{value:"Module"}));let Dqt=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const n=this._outer.get(e);n?n.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),r.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((t,r)=>e(t,r))}},Fqt=class{constructor(e){this._rctx=e,this._store=new Dqt}dispose(){this._store.forEach(e=>e.forEach(t=>t.dispose())),this._store.clear()}acquire(e,t,r,n){const s=this._store.get(e,t);if(s!=null)return s.ref(),s;const o=new wCe(this._rctx,e,t,r,n);return o.ref(),this._store.set(e,t,o),o}get test(){let e=0;return this._store.forEach(t=>t.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLProgramObjects:e}}},kKe=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,t=new Map){if(t.has(e))return t.get(e);const r=this._read(e);if(!r)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(r);const o=[];for(;s!=null;)o.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(r);let a=0,l="";return o.forEach(u=>{l+=r.slice(a,u.start),l+=t.has(u.path)?"":this._resolve(u.path,t),a=u.start+u.length}),l+=r.slice(a),t.set(e,l),l}_read(e){return this._readFile(e)}};const gpe=()=>di.getLogger("esri.views.webgl.VertexArrayObject");let wh=class{constructor(e,t,r,n,s=null){this._context=e,this._locations=t,this._layout=r,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((e,t)=>e+this._buffers[t].usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*VTt}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const e in this._buffers)this._buffers[e]?.dispose(),delete this._buffers[e];this._indexBuffer=ba(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&gpe().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(bd.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:e}=this._context,t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t,this._context.instanceCounter.increment(bd.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||gpe().error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||gpe().error("Vertex buffer is uninitialized!");const a=t[s];a||gpe().error("Vertex element descriptor is empty!"),bXr(this._context,this._locations,o,a)}r!=null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};function yhn(i){const{options:e,value:t}=i;return typeof e[t]=="number"}function mX(i){let e="";for(const t in i){const r=i[t];if(typeof r=="boolean")r&&(e+=`#define ${t} `);else if(typeof r=="number")e+=`#define ${t} ${r.toFixed()} -`;else if(typeof r=="object")if(bhn(r)){const{value:n,options:s,namespace:o}=r,a=o?`${o}_`:"";for(const l in s)e+=`#define ${a}${l} ${s[l].toFixed()} +`;else if(typeof r=="object")if(yhn(r)){const{value:n,options:s,namespace:o}=r,a=o?`${o}_`:"";for(const l in s)e+=`#define ${a}${l} ${s[l].toFixed()} `;e+=`#define ${t} ${a}${n} `}else{const n=r.options;let s=0;for(const o in n)e+=`#define ${n[o]} ${(s++).toFixed()} `;e+=`#define ${t} ${n[r.value]} -`}}return e}function R3(i,e,t=""){return new wCe(i,t+e.shaders.vertexShader,t+e.shaders.fragmentShader,e.attributes)}const kqt=Object.freeze(Object.defineProperty({__proto__:null,BufferObject:Aa,FramebufferObject:Wd,Program:wCe,ProgramCache:Fqt,Renderbuffer:bCe,ShaderCompiler:kKe,Texture:fl,VertexArrayObject:wh,createContext:BW,createProgram:R3,glslifyDefineMap:mX},Symbol.toStringTag,{value:"Module"}));function LKe(i,e,t=0){const r=uu(i,0,Shn);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*Thn(r*whn[n]))}function Lqt(i,e=0){let t=0;for(let r=0;r<4;r++)t+=i[e+r]*xhn[r];return t}const whn=[1,256,65536,16777216],xhn=[1/256,1/65536,1/16777216,1/4294967296],Shn=Lqt(new Uint8ClampedArray([255,255,255,255]));function Thn(i){return i-Math.floor(i)}function NKe(i){switch(i.type){case"CIMPointSymbol":{const e=i.symbolLayers;if(!e||e.length!==1)return null;const t=e[0];return t.type!=="CIMVectorMarker"?null:NKe(t)}case"CIMVectorMarker":{const e=i.markerGraphics;if(!e||e.length!==1)return null;const t=e[0];if(!t)return null;const r=t.geometry;if(!r)return null;const n=t.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||n.symbolLayers?.some(s=>!!s.effects)?null:{type:"sdf",geom:r,asFill:n.type==="CIMPolygonSymbol"}}}}function Chn(i){return i?i.rings?i.rings:i.paths?i.paths:i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0?[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]:null:null}function Ehn(i){let e=1/0,t=-1/0,r=1/0,n=-1/0;for(const s of i)for(const o of s)o[0]t&&(t=o[0]),o[1]n&&(n=o[1]);return new bJe(e,r,t-e,n-r)}function hvt(i){let e=1/0,t=-1/0,r=1/0,n=-1/0;for(const s of i)for(const o of s)o[0]t&&(t=o[0]),o[1]n&&(n=o[1]);return[e,r,t,n]}function dvt(i){return i?i.rings?hvt(i.rings):i.paths?hvt(i.paths):zd(i)?[i.xmin,i.ymin,i.xmax,i.ymax]:null:null}function pvt(i,e,t,r,n){const[s,o,a,l]=i;if(a0&&(k=(e.xmax-e.xmin)/(e.ymax-e.ymin),R=r.x/(t*k),L=r.y/t):(R=r.x,L=r.y)),e&&(R=.5*(e.xmax+e.xmin)+R*(e.xmax-e.xmin),L=.5*(e.ymax+e.ymin)+L*(e.ymax-e.ymin)),R-=s,L-=o,R*=v,L*=v,R+=m,L+=m;let B=R/w-.5,$=L/S-.5;return n&&t&&(B*=t*k,$*=t),[I,B,$,k]}function Ihn(i){const e=Chn(i.geom),t=Ehn(e),r=128,n=Qg,s=Math.floor(.5*(.5*r-n)),o=(r-2*(s+n))/Math.max(t.width,t.height),a=Math.round(t.width*o)+2*s,l=Math.round(t.height*o)+2*s,u=[];for(const h of e)if(h&&h.length>1){const p=[];for(const m of h){let[v,w]=m;v-=t.x,w-=t.y,v*=o,w*=o,v+=s-.5,w+=s-.5,i.asFill?p.push([v,w]):p.push([Math.round(v),Math.round(w)])}if(i.asFill){const m=p.length-1;p[0][0]===p[m][0]&&p[0][1]===p[m][1]||p.push(p[0])}u.push(p)}const c=Ahn(u,a,l,s);return i.asFill&&Mhn(u,a,l,s,c),[Ohn(c,s),a,l]}function Ahn(i,e,t,r){const n=e*t,s=new Array(n),o=r*r+1;for(let a=0;ae&&(I=e),R<0&&(R=0),L>t&&(L=t);const k=h[0]-c[0],B=h[1]-c[1],$=k*k+B*B;for(let V=S;V$?(K=h[0],Q=h[1]):(re/=$,K=c[0]+re*k,Q=c[1]+re*B);const ne=(V-K)*(V-K)+(Y-Q)*(Y-Q),de=(t-Y-1)*e+V;nee-r&&(w=e-r),St-r&&(I=t-r);for(let R=S;RR==u[1]>R)continue;const L=(t-R-1)*e;for(let k=v;kdi.getLogger("esri.symbols.cim.cimAnalyzer");function Rhn(i){const e=i.markerPlacement;return e&&e.angleToLine?jb.MAP:jb.SCREEN}let Dhn=class{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,r){if(this._cimLayers=r??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const n of this._primitiveOverrides){const s=n.valueExpressionInfo;if(s)this._setPoMap(n.primitiveName,n.propertyName,s);else if(n.value!=null){let o=n.value;n.propertyName.includes("Color")&&(pVe(o)&&(o=qtr(o)),o=Ly(o)),this._setPoMap(n.primitiveName,n.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;const n=e.effects;let s=jb.SCREEN;const o=PMt(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(s=jb.MAP);const a=e.type==="CIMPolygonSymbol";let l=r.length;for(;l--;){const u=r[l];if(!u||u.enable===!1)continue;let c;n?.length&&(c=[...n]);const h=u.effects;h?.length&&(n?c.push(...h):c=[...h]);let p=null;if(c){p=[];for(const v of c){const w=N5.findEffectOverrides(v,this._primitiveOverrides);w&&p.push(w)}}const m=[];switch(N5.findApplicableOverrides(u,this._primitiveOverrides,m),u.type){case"CIMSolidFill":this._analyzeSolidFill(u,p);break;case"CIMPictureFill":this._analyzePictureFill(u,p);break;case"CIMHatchFill":this._analyzeHatchFill(u,p);break;case"CIMGradientFill":this._analyzeGradientFill(u,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(u,p,a,o);break;case"CIMPictureStroke":this._analyzePictureStroke(u,p,a,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(u,p,a,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(s=Rhn(u));const v=[],w=u.primitiveName;w&&v.push(w);const S=a&&mVe(u.markerPlacement);this._analyzeMarker(u,p,null,v,s,o,t,[],!1,S);break}default:Phn().error("Cannot analyze CIM layer",u.type)}}}_analyzeSolidFill(e,t){const{primitiveName:r,type:n}=e,s=Ly(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(n,r,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:r,type:n}=e,s=Qce(e),o=rs(e.height,ph.CIMPictureFill.height);let a=rs(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const u=e.width;let c=1;const h=this._resourceManager.getResource(e.url);h!=null&&(c=h.width/h.height),a/=c*(o/u)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(r,n)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(n,r,"TintColor",s),height:this._getValueOrOverrideExpression(n,r,"Height",o),scaleX:this._getValueOrOverrideExpression(n,r,"ScaleX",a),angle:this._getValueOrOverrideExpression(n,r,"Rotation",rs(e.rotation)),offsetX:this._getValueOrOverrideExpression(n,r,"OffsetX",rs(e.offsetX)),offsetY:this._getValueOrOverrideExpression(n,r,"OffsetY",rs(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:r,type:n}=e,s=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),o=this._normalizePrimitiveOverrideProps(s);let a=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const h=c.primitiveName??r;l||!h||c.colorLocked||this._poMap[h]?.Color==null&&this._poMap[h]?.StrokeColor==null||(a=Ly(c.color),a=this._maybeGetValueOrOverrideExpression(h,"StrokeColor")??this._getValueOrOverrideExpression(n,h,"Color",a),l=!0);const p=this._maybeGetValueOrOverrideExpression(h,"StrokeWidth");if(p){let m=null,v=null;typeof p=="number"?m=p:v=p.valueExpressionInfo;let w=o.find(S=>S.propertyName==="strokeWidth");w?w.propertyName="width":(w={type:"CIMPrimitiveOverride",primitiveName:h,propertyName:"width",valueExpressionInfo:v,value:m,defaultValue:w3e(n,"width")},o.push(w))}}const u={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:!!e.colorLocked,effects:t,color:a,height:this._getValueOrOverrideExpression(n,r,"Separation",rs(e.separation,ph.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(n,r,"Rotation",rs(e.rotation)),offsetX:this._getValueOrOverrideExpression(n,r,"OffsetX",rs(e.offsetX)),offsetY:this._getValueOrOverrideExpression(n,r,"OffsetY",rs(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=Ly(e.color),l=rs(e.width,ph.CIMSolidStroke.width),u=uj(e.capStyle,ph.CIMSolidStroke.capstyle),c=uj(e.joinStyle,ph.CIMSolidStroke.joinstyle),h=e.miterLimit;let p,m,v=[];if(this._analyzePrimitiveOverrides(s,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(s,o)),t&&t instanceof Array&&t.length>0){const S=t[t.length-1].effect;S&&S.type==="CIMGeometricEffectDashes"&&S.lineDashEnding==="NoConstraint"&&S.offsetAlongLine===null&&(p=S.dashTemplate,m=S.scaleDash,(t=[...t]).pop())}const w=p!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:p,capStyle:u},overrides:v}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:w,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,s,"Color",a),width:this._getValueOrOverrideExpression(o,s,"Width",l),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",u),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",c),miterLimit:h&&this._getValueOrOverrideExpression(o,s,"MiterLimit",h),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:p,scaleDash:m,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=Qce(e),l=rs(e.width,ph.CIMPictureStroke.width),u=uj(e.capStyle,ph.CIMPictureStroke.capstyle),c=uj(e.joinStyle,ph.CIMPictureStroke.joinstyle),h=e.miterLimit,p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:p,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,s,"TintColor",a),width:this._getValueOrOverrideExpression(o,s,"Width",l),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",u),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",c),miterLimit:h&&this._getValueOrOverrideExpression(o,s,"MiterLimit",h),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=rs(e.width,ph.CIMSolidStroke.width),l=uj(e.capStyle,ph.CIMGradientStroke.capstyle),u=uj(e.joinStyle,ph.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,s,"Width",a),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",l),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",u),miterLimit:c&&this._getValueOrOverrideExpression(o,s,"MiterLimit",c),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,r,n,s,o,a,l,u=!1,c=!1){if(u||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,u))return;const h=rs(e.size,ph.CIMVectorMarker.size),p=rs(e.rotation),m=rs(e.offsetX),v=rs(e.offsetY),{primitiveName:w,type:S}=e,I=this._getValueOrOverrideExpression(S,w,"Size",h),R=this._getValueOrOverrideExpression(S,w,"Rotation",p),L=this._getValueOrOverrideExpression(S,w,"OffsetX",m),k=this._getValueOrOverrideExpression(S,w,"OffsetY",v);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,n,s,o,I,R,L,k,l,u,c);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,n,s,o,I,R,L,k,l,a,u,c)}}_analyzeMarkerInsidePolygon(e,t,r){const{markerPlacement:n,type:s}=e;if(!n||n.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(s==="CIMVectorMarker"||s==="CIMPictureMarker"){const p=e.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;const m=n.primitiveName;if(m&&this._analyzePrimitiveOverrides([m],t,null,null))return!1;if(s==="CIMVectorMarker"){const{markerGraphics:v}=e;if(v)for(const w of v){const{symbol:S}=w;if(S?.type==="CIMPolygonSymbol"&&S.symbolLayers){const{symbolLayers:I}=S;for(const R of I)if(R.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:v}=e;if(v)return!1}}const o=Math.abs(n.stepX),a=Math.abs(n.stepY);if(o===0||a===0)return!0;let l,u;if(n.gridType==="Random"){const p=uy(Hjt),m=Math.max(Math.floor(p/o),1);l=a*Math.max(Math.floor(p/a),1),u=m*o/l}else n.shiftOddRows?(l=2*a,u=o/a*.5):(l=a,u=o/a);const c=Qce(e),h=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:r,effects:t,color:c,height:l,scaleX:u,angle:n.gridAngle,offsetX:rs(n.offsetX),offsetY:rs(n.offsetY),applyRandomOffset:n.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,r,n,s,o,a,l,u,c,h,p,m){const{primitiveName:v,type:w}=e;let S=rs(e.scaleX,1);const I=Qce(e);r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const R=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),L=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const V=e.width;let Y=1;const K=this._resourceManager.getResource(e.url);K!=null&&(Y=K.width/K.height),S/=Y*(rs(e.size)/V)}const k=[...n];let B;e.primitiveName&&k.push(e.primitiveName),e.animatedSymbolProperties||R?B={type:"animated",url:e.url,urlHash:"H"+Q1(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(B=li(e),B.markerPlacement=null);const $={type:"sprite-rasterization-param",resource:B,overrides:this._getMaterialOverrides(k,w)};R&&$.overrides.push(...R.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:$,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:s,size:a,scaleX:this._getValueOrOverrideExpression(w,v,"ScaleX",S),rotation:l,offsetX:u,offsetY:c,transform:{type:"cim-marker-transform-param",params:h},color:this._getValueOrOverrideExpression(w,v,"TintColor",I),anchorPoint:{x:L.x,y:L.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:m,markerPlacement:r,animatedSymbolProperties:R})}_analyzeVectorMarker(e,t,r,n,s,o,a,l,u,c,h,p,m,v){const w=e.markerGraphics;if(!w)return;const S=e.frame;let I=0;if(I=S?S.ymax-S.ymin:o,I){const R={offsetX:u,offsetY:c,rotation:l,size:a,frameHeight:I,rotateClockWise:!!e.rotateClockwise};h=[...h,R]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const R of w)if(R){const L=R.symbol;if(!L)continue;const k=R.primitiveName;let B;if(k&&n.push(k),(L.type==="CIMPointSymbol"||L.type==="CIMTextSymbol")&&S){let $=0,V=0;const Y=R.geometry;"x"in Y&&"y"in Y&&($+=Y.x-.5*(S.xmin+S.xmax),V+=Y.y-.5*(S.ymin+S.ymax));const K=e.anchorPoint;K&&(e.anchorPointUnits==="Absolute"?($-=K.x,V-=K.y):S&&($-=(S.xmax-S.xmin)*K.x,V-=(S.ymax-S.ymin)*K.y));const Q={offsetX:$,offsetY:V,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};B=[...h,Q]}switch(L.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||khn(L)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,null,R,n,s,o,B??h,I,m,v):this._analyzeMultiLayerGraphic(e,t,r,null,R,n,s,o,B??h,I,m,v);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,R,n,s,o,B??h,m)}k&&n.pop()}}_analyzeMultiLayerGraphic(e,t,r,n,s,o,a,l,u,c,h,p){const m=s.symbol,v=m.symbolLayers;if(!v)return;let w=v.length;if(Fhn(v))return void this._analyzeCompositeMarkerGraphic(e,t,r,n,s,v,a,l,u,c,h,p);const S=this._resourceManager.geometryEngine,I=J8e.applyEffects(m.effects,s.geometry,S);if(I)for(;w--;){const R=v[w];if(!R||R.enable===!1)continue;const L=R.primitiveName;switch(L&&o.push(L),R.type){case"CIMSolidFill":case"CIMSolidStroke":{const k=J8e.applyEffects(R.effects,I,S),B=dvt(k);if(!B)continue;const $=e.anchorPointUnits!=="Relative",[V,Y,K,Q]=pvt(B,e.frame,e.size,e.anchorPoint,$),re=R.type==="CIMSolidFill",ne={type:"sdf",geom:k,asFill:re},{path:de}=R,pe=re?Ly(gP(R)):de==null?Ly(BV(R)):[0,0,0,0],H=re?[0,0,0,0]:Ly(BV(R)),Z=kne(R)??0;if(!re&&!Z)break;const ae=s.primitiveName;let fe=null;re&&!R.colorLocked&&(fe=this._maybeGetValueOrOverrideExpression(ae,"FillColor"));let be=null;re||R.colorLocked||(be=this._maybeGetValueOrOverrideExpression(ae,"StrokeColor"));const _e=fe??this._getValueOrOverrideExpression(R.type,L,"Color",pe),Ie=be??this._getValueOrOverrideExpression(R.type,L,"Color",H),Te=this._maybeGetValueOrOverrideExpression(ae,"StrokeWidth")??this._getValueOrOverrideExpression(R.type,L,"Width",Z),Be=de?{type:"sprite-rasterization-param",resource:{type:"path",path:de,asFill:re},overrides:[]}:{type:"sprite-rasterization-param",resource:ne,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Be,colorLocked:!!R.colorLocked||!!h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:Y,y:K},isAbsoluteAnchorPoint:$,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:u},frameHeight:c,widthRatio:Q,rotateClockwise:!1,referenceSize:l,sizeRatio:V,color:_e,outlineColor:Ie,outlineWidth:Te,isOutline:p,markerPlacement:r,animatedSymbolProperties:n});break}case"CIMPictureMarker":case"CIMVectorMarker":R.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,!!R.colorLocked||!!h,p):this._analyzeMarker(R,t,r,o,a,l,!1,u,h,p);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,!!R.colorLocked||!!h,p)}L&&o.pop()}}_analyzeTextGraphic(e,t,r,n,s,o,a,l){const u=[];N5.findApplicableOverrides(r,this._primitiveOverrides,u);const c=r.geometry;if(!("x"in c)||!("y"in c))return;const h=r.symbol,p=yVe(h),m=gVe(h.fontStyleName),v=zGt(h.fontFamilyName);h.font={family:v,decoration:p,...m};const w=rs(h.height,ph.CIMTextSymbol.height),S=rs(h.angle),I=rs(h.offsetX),R=rs(h.offsetY),L=Ly(gP(h));let k=Ly(BV(h)),B=kne(h)??0;B||(k=Ly(gP(h.haloSymbol)),B=rs(h.haloSize));let $=!1;if(h.symbol?.symbolLayers)for(const Ie of h.symbol.symbolLayers)Ly(gP(Ie))!=null&&($=!!Ie.colorLocked);const V=r.primitiveName;let Y=null;$||(Y=this._maybeGetValueOrOverrideExpression(V,"FillColor"));const K=this._maybeGetValueOrOverrideExpression(V,"TextSize"),Q=this._maybeGetValueOrOverrideExpression(V,"TextAngle"),re=this._maybeGetValueOrOverrideExpression(V,"TextOffsetX"),ne=this._maybeGetValueOrOverrideExpression(V,"TextOffsetY");let de=null,pe=null,H=0;if(h.callout&&h.callout.type==="CIMBackgroundCallout"){const Ie=h.callout;if(Ie.backgroundSymbol){const Te=Ie.backgroundSymbol.symbolLayers;if(Te)for(const Be of Te)Be.type==="CIMSolidFill"?de=Ly(Be.color):Be.type==="CIMSolidStroke"&&(pe=Ly(Be.color),H=rs(Be.width,ph.CIMSolidStroke.width))}}const Z=this._getValueOrOverrideExpression(h.type,r.primitiveName,"TextString",r.textString??"");if(Z==null)return;const{fontStyleName:ae}=h,fe=v+(ae?"-"+ae.toLowerCase():"-regular"),be=this._getMaterialOverrides(n,h.type);be.push(...this._getPrimitiveMaterialOverrides(r.primitiveName,h.type));const _e={type:"text-rasterization-param",resource:{type:"text",textString:r.textString??"",font:h.font,symbol:h,primitiveName:r.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:_e,colorLocked:!!l||!!$,effects:e,alignment:s,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:fe,decoration:p,weight:m.weight,style:m.style,size:K??w,angle:Q??S,offsetX:re??I,offsetY:ne??R,transform:{type:"cim-marker-transform-param",params:a},horizontalAlignment:EMt(h.horizontalAlignment),verticalAlignment:IMt(h.verticalAlignment),text:Z,color:Y??this._getValueOrOverrideExpression(h.type,r.primitiveName,"Color",L),outlineColor:k,outlineSize:B,backgroundColor:de,borderLineColor:pe,borderLineWidth:H,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,h,p){const m=this._buildSimpleMarker(e,s),v=e.primitiveName,w=this._analyzeMaterialOverrides(v,["Rotation","OffsetX","OffsetY"]),S=this._normalizePrimitiveOverrideProps(w),[I,R,L]=ym.getTextureAnchor(m,this._resourceManager),k=this._getMaterialOverrides(o,e.type);k.push(...S);const B={type:"sprite-rasterization-param",resource:{...m,avoidSDFRasterization:!0},overrides:k};this._cimLayers.push({type:"marker",spriteRasterizationParam:B,colorLocked:h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:I,y:R},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:u},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:L/us(e.size),isOutline:p,markerPlacement:r,animatedSymbolProperties:n})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return N5.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-info",placement:e,overrides:fvt(t)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return N5.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-animation-info",animation:e,overrides:fvt(t)}}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,r,n,s,o,a,l,u,c,h,p){const m=s.geometry,v=o[0],w=o[1],S=dvt(m);if(!S)return;const I=e.anchorPointUnits!=="Relative",[R,L,k,B]=pvt(S,e.frame,e.size,e.anchorPoint,I),{path:$}=w,V=w.primitiveName,Y=v.primitiveName,K=s.primitiveName;let Q=null;w.colorLocked||h||(Q=this._maybeGetValueOrOverrideExpression(K,"FillColor"));const re=Q??this._getValueOrOverrideExpression(w.type,V,"Color",Ly(w.color));let ne=null;v.colorLocked||h||(ne=this._maybeGetValueOrOverrideExpression(K,"StrokeColor"));const de=ne??this._getValueOrOverrideExpression(v.type,Y,"Color",Ly(v.color)),pe=this._maybeGetValueOrOverrideExpression(K,"StrokeWidth")??this._getValueOrOverrideExpression(v.type,Y,"Width",rs(v.width,ph.CIMSolidStroke.width)),H={type:"sprite-rasterization-param",resource:$?{type:"path",path:$,asFill:!0}:{type:"sdf",geom:m,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:H,colorLocked:h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:L,y:k},isAbsoluteAnchorPoint:I,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:u},frameHeight:c,widthRatio:B,rotateClockwise:!1,referenceSize:l,sizeRatio:R,color:re,outlineColor:de,outlineWidth:pe,isOutline:p,markerPlacement:r,animatedSymbolProperties:n})}_setPoMap(e,t,r){let n;this._poMap[e]?n=this._poMap[e]:(n={},this._poMap[e]=n),n[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,n,s=!0){if(s&&!MMt(n)&&(n=w3e(e,r.toLowerCase())),t==null)return n;const o=this._poMap[t];if(o==null)return n;const a=o[r];return typeof a=="string"||typeof a=="number"||Array.isArray(a)?a:a?{valueExpressionInfo:a,defaultValue:n}:n}_analyzePrimitiveOverrides(e,t,r,n){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const s of this._primitiveOverrides)if(e.includes(s.primitiveName)&&s.valueExpressionInfo)return!0;if(t!=null){for(const s of t)if(s?.overrides.length>0)return!0}if(r!=null){for(const s of r)if(s?.overrides.length>0)return!0}if(n!=null){for(const s of n)if(s?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const n of e)r.push(...this._getPrimitiveMaterialOverrides(n,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter(n=>n.primitiveName===e));return r.forEach(n=>n.defaultValue=w3e(t,n.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}_normalizePrimitiveOverrideProps(e){return e.map(t=>({...t,propertyName:d1e(t.propertyName)}))}};function ZPe(i){if(i&&i.indexOf("Level_")===0){const e=parseInt(i.substr(6),10);if(!isNaN(e))return e}return 0}const Fhn=i=>i&&i.length===2&&i[0].enable&&i[1].enable&&i[0].type==="CIMSolidStroke"&&i[1].type==="CIMSolidFill"&&i[0].path==null&&i[1].path==null&&!i[0].effects&&!i[1].effects;function khn(i){const e=i.symbolLayers;if(!e||e.length!==2)return!1;const t=e.find(n=>n.effects?.find(s=>s.type==="CIMGeometricEffectDashes"&&s.dashTemplate!=null)),r=e.find(n=>n.effects?.find(s=>s.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!r}function fvt(i){return li(i).map(e=>({...e,propertyName:d1e(e.propertyName)}))}const goe=-1;let W2=class extends un{constructor(e){super(e),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=yi("mapview-transitions-duration"),this.effects=[]}set effect(e){if(this._get("effect")!==(e=e||"")){this._set("effect",e);try{this._transitionTo(mvt(e))}catch(t){this._transitionTo([]),di.getLogger(this).warn("Invalid Effect",{effect:e,error:t})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(e){this._updateForScale(e)}get transitioning(){return this._to!==null}canTransitionTo(e){try{return this.scale>0&&gvt(this._current,mvt(e),this.scale)}catch{return!1}}transitionStep(e,t){this._applyTimeTransition(e),this._updateForScale(t)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(e){this.scale>0&&gvt(this._current,e,this.scale)?(this._final=e,this._to=li(e),Lhn(this._current,this._to,this.scale),this._from=li(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=e),this._set("effects",this._current[0]?li(this._current[0].effects):[])}_applyTimeTransition(e){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=e;const t=Math.min(1,this._time/this.duration);for(let r=0;r=t[0].scale)s=n=t[0].effects;else if(e<=t[r].scale)s=n=t[r].effects;else for(let a=0;a=e&&u.scale<=e){o=(e-l.scale)/(u.scale-l.scale),n=l.effects,s=u.effects;break}}for(let a=0;a1||e.length>1)&&t<=0)&&NOt(i[0].effects,e[0].effects)}function Lhn(i,e,t){const r=i.length>e.length?i:e,n=i.length>e.length?e:i,s=n[n.length-1],o=s?.scale??t,a=s?.effects??[];for(let l=n.length;lr?Math.max(r,n-s):Math.min(r,n+s),this.computedVisible=this.computedOpacity>0;const o=r===this.computedOpacity;this.inFadeTransition=!o,o||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}};const y7e=1,Bhn=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],jhn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],RK=256,hF={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},QPe=()=>di.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function Ghn(i,e){e.fillColor[0]=i.color.r/255,e.fillColor[1]=i.color.g/255,e.fillColor[2]=i.color.b/255,e.fillColor[3]=i.color.a,i.haloColor?(e.outlineColor[0]=i.haloColor.r/255,e.outlineColor[1]=i.haloColor.g/255,e.outlineColor[2]=i.haloColor.b/255,e.outlineColor[3]=i.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=i.fillOpacity,e.outlineColor[3]*=i.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=hF.outlineWidth,e.outerHaloWidth=hF.outerHaloWidth,e.innerHaloWidth=hF.innerHaloWidth,e.outlinePosition=hF.outlinePosition}const Uhn=[0,0,0,0];let Nqt=class{constructor(){this.type="single",this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:hF.outlinePosition,outlineWidth:hF.outlineWidth,innerHaloWidth:hF.innerHaloWidth,outerHaloWidth:hF.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*RK),this._minMaxDistance=[0,0]}setHighlightOptions(e){const t=this._convertedHighlightOptions;Ghn(e,t);const r=t.outlinePosition-t.outlineWidth/2-t.outerHaloWidth,n=t.outlinePosition-t.outlineWidth/2,s=t.outlinePosition+t.outlineWidth/2,o=t.outlinePosition+t.outlineWidth/2+t.innerHaloWidth,a=Math.sqrt(Math.PI/2)*y7e,l=Math.abs(r)>a?Math.round(10*(Math.abs(r)-a))/10:0,u=Math.abs(o)>a?Math.round(10*(Math.abs(o)-a))/10:0;let c;l&&!u?QPe().error("The outer rim of the highlight is "+l+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!l&&u?QPe().error("The inner rim of the highlight is "+u+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):l&&u&&QPe().error("The highlight is "+Math.max(l,u)+"px away from the edge of the feature; consider reducing some width values.");const h=[void 0,void 0,void 0,void 0];function p(v,w,S){h[0]=(1-S)*v[0]+S*w[0],h[1]=(1-S)*v[1]+S*w[1],h[2]=(1-S)*v[2]+S*w[2],h[3]=(1-S)*v[3]+S*w[3]}const{_texelData:m}=this;for(let v=0;vi.stencilRef,compare:Hl.EQUAL,mask:255,op:{fail:il.KEEP,zFail:il.KEEP,zPass:il.REPLACE}}}},Vhn={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Hhn={...$qt,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Bqt({pixelRatio:i,state:e,displayLevel:t,requiredLevel:r},n){const s=1/2**(t-n.key.level),o=1/2**(r-n.key.level);return{displayMat3:Array.from(e.displayMat3),displayViewMat3:Array.from(e.displayViewMat3),displayViewScreenMat3:Array.from(n.transforms.displayViewScreenMat3),viewMat3:Array.from(e.viewMat3),tileMat3:Array.from(n.transforms.tileMat3),displayZoomFactor:s,requiredZoomFactor:o,tileOffset:[n.x,n.y],currentScale:e.scale,currentZoom:t,metersPerSRUnit:pu(e.spatialReference),rotation:e.rotation,pixelRatio:i}}function yoe(i){return i.passOptions?.type==="highlight"}function fg(i){return i.passOptions?.type==="hittest"}function Whn(i){if(!fg(i))return null;const{position:e}=i.passOptions,t=i.pixelRatio,r=yi("esri-mobile");return{position:e,distance:yi(r?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance")*t,smallSymbolDistance:yi(r?"hittest-2d-mobile-tolerance":"hittest-2d-small-symbol-tolerance")*t,smallSymbolSizeThreshold:yi("hittest-2d-small-symbol-tolerance-threshold")}}function qhn(i){if(!yoe(i))return null;const{activeReasons:e,highlightAll:t}=i.passOptions;return{activeReasons:e,highlightAll:t?1:0}}function oT(i,e,t){const r={};for(const n in t)t[n]instanceof Function?r[n]=t[n](i,e):r[n]=t[n];return r}function l_(i,e){const{attributeView:t,context:r}=i;return{storage:t.getUniforms(r),view:Bqt(i,e),hittestRequest:Whn(i),highlight:qhn(i)}}function zv(i){return{inside:i.selection===ax.InsideEffect,outside:i.selection===ax.OutsideEffect}}function u_(i){return fg(i)?Vhn:yoe(i)&&i.passOptions.stepType==="clear"?Hhn:$qt}function HCe(i){const{row:e,col:t}=i.key,r=t*xo,n=e*xo;return{tileOffsetFromLocalOrigin:[r%Ede,n%Ede],maxIntsToLocalOrigin:[Math.floor(r/Ede),Math.floor(n/Ede)]}}new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function jqt(i){const{bandCount:e,attributeTable:t,colormap:r,pixelType:n}=i.raster.rasterInfo;return e===1&&(t!=null||r!=null||n==="u8"||n==="s8")}function Yhn(i,e){return i?.type==="single"&&e.multiHighlightEnabled&&(i.destroy(),i=null),i?.type!=="multi"||e.multiHighlightEnabled||(i.destroy(),i=null),i||(i=e.multiHighlightEnabled?new zhn:new Nqt),i.setHighlightOptions(e),i}function $Ke(i,e,t){const{painter:r,highlightGradient:n}=i,{highlight:s}=r.effects;if(!n)return;const o=i.passOptions,a=n.getReasonsWithGradients();for(let l=0;lt.clips=e)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(e){(this._effectView||e)&&(this._effectView||(this._effectView=new W2),this._effectView.effect=e,this.requestRender())}get highlightOptions(){return this._highlightOptions}set highlightOptions(e){if(!e)return this._highlightOptions=null,void(this._highlightGradient&&(this._highlightGradient.destroy(),this._highlightGradient=null,this.requestRender()));this._highlightOptions&&this._highlightOptions.equals(e)||(this._highlightOptions=e,this._highlightGradient=Yhn(this._highlightGradient,e),this.requestRender())}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(e=>e.hasHighlight)}get hasLabels(){return this.children.some(e=>e.hasLabels)}get requiresDedicatedFBO(){return this.children.some(e=>"blendMode"in e&&e.blendMode&&e.blendMode!=="normal")}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._effectView&&(this._effectView.transitionStep(e,t),this._effectView.transitioning&&this.requestRender())}doRender(e){const t=this.createRenderParams(e),{painter:r}=t;r.beforeRenderLayer(t,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(t),r.afterRenderLayer(t,this.computedOpacity)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,t=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const r=e.parent;return r&&r!==this&&r.removeChild(e),t>=this.children.length?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e),e.parent=this,e.stage=this.stage,this!==this.stage&&(e.clips=this.clips),this.requestRender(),e}contains(e){return this._childrenSet.has(e)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const e of this.children)this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null;this.children.length=0}removeChild(e){return this.contains(e)?this.removeChildAt(this.children.indexOf(e)):e}removeChildAt(e){if(e<0||e>=this.children.length)return null;this._needsSort=!0;const t=this.children.splice(e,1)[0];return this._childrenSet.delete(t),this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null,t}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const t of this.children)t.beforeRender(e)}afterRender(e){super.afterRender(e);for(const t of this.children)t.afterRender(e)}_createTransforms(){return{displayViewScreenMat3:Cc()}}onAttach(){super.onAttach();const e=this.stage;for(const t of this.children)t.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const t of this.children)t.processRender(e)}createRenderParams(e){return{...e,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||e.highlightGradient}}},Xhn=class{constructor(e){this.events=new rd,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const t={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0};e.appendChild(this._canvas);let r=BW(this._canvas,t);r||(r=BW(this._canvas,{...t,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=r,this._handles=j3([BA(this._canvas,"webglcontextlost",n=>this.events.emit("webgl-context-lost",n))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||yi("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=yi("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[r,n,s,o,a,l]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${r}, ${n}, ${s}, ${o}, ${a}, ${l})`}}else t()}resize(e){const t=this._canvas,r=t.style,{state:{size:n},pixelRatio:s}=e,o=n[0],a=n[1],l=Math.round(o*s),u=Math.round(a*s);t.width===l&&t.height===u||(t.width=l,t.height=u),r.width=o+"px",r.height=a+"px"}_computeViewTransform(e,t){const[r,n]=e.center,[s,o]=t.center,[a,l]=e.toScreen([0,0],s,o),[u,c]=e.toScreen([0,0],r,n),h=u-a,p=c-l,m=e.scale/t.scale,v=t.rotation-e.rotation,w=HA();return sWe(w),gSe(w,w,[m,m]),sk(w,w,Rx(v)),VA(w,w,[h,p]),w}},JS=class{constructor(e,t){this._rctx=e,this._attributes=[{name:"position",offset:0,type:Ti.SHORT,count:2}],this.layout={hash:wle(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=Aa.createVertex(e,oa.STATIC_DRAW,new Uint16Array(t)),this._vao=new wh(e,new Map([["a_position",0]]),{geometry:[new Vl("a_position",2,Ti.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(Eo.TRIANGLE_STRIP,0,this._count)}},Qx=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,r){}drawMany(e,t,r){for(const n of t)n.visible&&this.draw(e,n,r)}};const eRe={nearest:{defines:[],samplingMode:Is.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:Is.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:Is.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:Is.LINEAR_MIPMAP_LINEAR,mips:!0}},Jhn=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:r}=i,n=e.resolution/e.pixelRatio/r.resolution,s=Math.round(i.pixelRatio)!==i.pixelRatio,o=n>1.05||n<.95;return r.rotation||o||s||e.isSourceScaled||e.rotation?eRe.bilinear:eRe.nearest}return eRe[t.samplingMode]};let Khn=class extends Qx{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:r,renderingOptions:n,painter:s,requestRender:o,allowDelayedRender:a}=e;if(!t.source||!t.isReady)return;const l=Jhn(e,t,n),u=s.materialManager.getProgram(this._desc,l.defines);if(a&&o!=null&&!u.compiled)return void o();e.timeline.begin(this.name),t.blendFunction==="additive"?r.setBlendFunctionSeparate(bn.ONE,bn.ONE,bn.ONE,bn.ONE):r.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),r.setStencilFunction(Hl.EQUAL,t.stencilRef,255),this._quad||(this._quad=new JS(r,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:h,transforms:p}=t;t.setSamplingProfile(l),t.bind(e.context,gbe),r.useProgram(u),u.setUniformMatrix3fv("u_dvsMat3",p.displayViewScreenMat3),u.setUniform1i("u_texture",gbe),u.setUniform2fv("u_coordScale",c),u.setUniform1f("u_opacity",h),this._quad.draw(),e.timeline.end(this.name)}};function Gqt(){return new Float32Array(4)}function Zhn(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function tM(i,e,t,r){const n=new Float32Array(4);return n[0]=i,n[1]=e,n[2]=t,n[3]=r,n}function Qhn(i,e){return new Float32Array(i,e,4)}function Uqt(){return Gqt()}function zqt(){return tM(1,1,1,1)}function Vqt(){return tM(1,0,0,0)}function Hqt(){return tM(0,1,0,0)}function Wqt(){return tM(0,0,1,0)}function qqt(){return tM(0,0,0,1)}const edn=Uqt(),tdn=zqt(),idn=Vqt(),rdn=Hqt(),ndn=Wqt(),sdn=qqt();Object.freeze(Object.defineProperty({__proto__:null,ONES:tdn,UNIT_W:sdn,UNIT_X:idn,UNIT_Y:rdn,UNIT_Z:ndn,ZEROS:edn,clone:Zhn,create:Gqt,createView:Qhn,fromValues:tM,ones:zqt,unitW:qqt,unitX:Vqt,unitY:Hqt,unitZ:Wqt,zeros:Uqt},Symbol.toStringTag,{value:"Module"}));const odn={background:{"background.frag":`uniform lowp vec4 u_color; +`}}return e}function R3(i,e,t=""){return new wCe(i,t+e.shaders.vertexShader,t+e.shaders.fragmentShader,e.attributes)}const kqt=Object.freeze(Object.defineProperty({__proto__:null,BufferObject:Aa,FramebufferObject:Wd,Program:wCe,ProgramCache:Fqt,Renderbuffer:bCe,ShaderCompiler:kKe,Texture:fl,VertexArrayObject:wh,createContext:BW,createProgram:R3,glslifyDefineMap:mX},Symbol.toStringTag,{value:"Module"}));function LKe(i,e,t=0){const r=uu(i,0,bhn);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*whn(r*vhn[n]))}function Lqt(i,e=0){let t=0;for(let r=0;r<4;r++)t+=i[e+r]*_hn[r];return t}const vhn=[1,256,65536,16777216],_hn=[1/256,1/65536,1/16777216,1/4294967296],bhn=Lqt(new Uint8ClampedArray([255,255,255,255]));function whn(i){return i-Math.floor(i)}function NKe(i){switch(i.type){case"CIMPointSymbol":{const e=i.symbolLayers;if(!e||e.length!==1)return null;const t=e[0];return t.type!=="CIMVectorMarker"?null:NKe(t)}case"CIMVectorMarker":{const e=i.markerGraphics;if(!e||e.length!==1)return null;const t=e[0];if(!t)return null;const r=t.geometry;if(!r)return null;const n=t.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||n.symbolLayers?.some(s=>!!s.effects)?null:{type:"sdf",geom:r,asFill:n.type==="CIMPolygonSymbol"}}}}function xhn(i){return i?i.rings?i.rings:i.paths?i.paths:i.xmin!==void 0&&i.ymin!==void 0&&i.xmax!==void 0&&i.ymax!==void 0?[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]:null:null}function Shn(i){let e=1/0,t=-1/0,r=1/0,n=-1/0;for(const s of i)for(const o of s)o[0]t&&(t=o[0]),o[1]n&&(n=o[1]);return new bJe(e,r,t-e,n-r)}function hvt(i){let e=1/0,t=-1/0,r=1/0,n=-1/0;for(const s of i)for(const o of s)o[0]t&&(t=o[0]),o[1]n&&(n=o[1]);return[e,r,t,n]}function dvt(i){return i?i.rings?hvt(i.rings):i.paths?hvt(i.paths):zd(i)?[i.xmin,i.ymin,i.xmax,i.ymax]:null:null}function pvt(i,e,t,r,n){const[s,o,a,l]=i;if(a0&&(k=(e.xmax-e.xmin)/(e.ymax-e.ymin),R=r.x/(t*k),L=r.y/t):(R=r.x,L=r.y)),e&&(R=.5*(e.xmax+e.xmin)+R*(e.xmax-e.xmin),L=.5*(e.ymax+e.ymin)+L*(e.ymax-e.ymin)),R-=s,L-=o,R*=v,L*=v,R+=m,L+=m;let B=R/w-.5,$=L/S-.5;return n&&t&&(B*=t*k,$*=t),[I,B,$,k]}function Thn(i){const e=xhn(i.geom),t=Shn(e),r=128,n=Qg,s=Math.floor(.5*(.5*r-n)),o=(r-2*(s+n))/Math.max(t.width,t.height),a=Math.round(t.width*o)+2*s,l=Math.round(t.height*o)+2*s,u=[];for(const h of e)if(h&&h.length>1){const p=[];for(const m of h){let[v,w]=m;v-=t.x,w-=t.y,v*=o,w*=o,v+=s-.5,w+=s-.5,i.asFill?p.push([v,w]):p.push([Math.round(v),Math.round(w)])}if(i.asFill){const m=p.length-1;p[0][0]===p[m][0]&&p[0][1]===p[m][1]||p.push(p[0])}u.push(p)}const c=Chn(u,a,l,s);return i.asFill&&Ehn(u,a,l,s,c),[Ihn(c,s),a,l]}function Chn(i,e,t,r){const n=e*t,s=new Array(n),o=r*r+1;for(let a=0;ae&&(I=e),R<0&&(R=0),L>t&&(L=t);const k=h[0]-c[0],B=h[1]-c[1],$=k*k+B*B;for(let V=S;V$?(K=h[0],Q=h[1]):(re/=$,K=c[0]+re*k,Q=c[1]+re*B);const ne=(V-K)*(V-K)+(Y-Q)*(Y-Q),de=(t-Y-1)*e+V;nee-r&&(w=e-r),St-r&&(I=t-r);for(let R=S;RR==u[1]>R)continue;const L=(t-R-1)*e;for(let k=v;kdi.getLogger("esri.symbols.cim.cimAnalyzer");function Mhn(i){const e=i.markerPlacement;return e&&e.angleToLine?jb.MAP:jb.SCREEN}let Ohn=class{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,r){if(this._cimLayers=r??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const n of this._primitiveOverrides){const s=n.valueExpressionInfo;if(s)this._setPoMap(n.primitiveName,n.propertyName,s);else if(n.value!=null){let o=n.value;n.propertyName.includes("Color")&&(pVe(o)&&(o=Vtr(o)),o=Ly(o)),this._setPoMap(n.primitiveName,n.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const r=e?.symbolLayers;if(!r)return;const n=e.effects;let s=jb.SCREEN;const o=PMt(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(s=jb.MAP);const a=e.type==="CIMPolygonSymbol";let l=r.length;for(;l--;){const u=r[l];if(!u||u.enable===!1)continue;let c;n?.length&&(c=[...n]);const h=u.effects;h?.length&&(n?c.push(...h):c=[...h]);let p=null;if(c){p=[];for(const v of c){const w=N5.findEffectOverrides(v,this._primitiveOverrides);w&&p.push(w)}}const m=[];switch(N5.findApplicableOverrides(u,this._primitiveOverrides,m),u.type){case"CIMSolidFill":this._analyzeSolidFill(u,p);break;case"CIMPictureFill":this._analyzePictureFill(u,p);break;case"CIMHatchFill":this._analyzeHatchFill(u,p);break;case"CIMGradientFill":this._analyzeGradientFill(u,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(u,p,a,o);break;case"CIMPictureStroke":this._analyzePictureStroke(u,p,a,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(u,p,a,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(s=Mhn(u));const v=[],w=u.primitiveName;w&&v.push(w);const S=a&&mVe(u.markerPlacement);this._analyzeMarker(u,p,null,v,s,o,t,[],!1,S);break}default:Ahn().error("Cannot analyze CIM layer",u.type)}}}_analyzeSolidFill(e,t){const{primitiveName:r,type:n}=e,s=Ly(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(n,r,"Color",s),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:r,type:n}=e,s=Qce(e),o=rs(e.height,ph.CIMPictureFill.height);let a=rs(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const u=e.width;let c=1;const h=this._resourceManager.getResource(e.url);h!=null&&(c=h.width/h.height),a/=c*(o/u)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(r,n)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(n,r,"TintColor",s),height:this._getValueOrOverrideExpression(n,r,"Height",o),scaleX:this._getValueOrOverrideExpression(n,r,"ScaleX",a),angle:this._getValueOrOverrideExpression(n,r,"Rotation",rs(e.rotation)),offsetX:this._getValueOrOverrideExpression(n,r,"OffsetX",rs(e.offsetX)),offsetY:this._getValueOrOverrideExpression(n,r,"OffsetY",rs(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:r,type:n}=e,s=this._analyzeMaterialOverrides(r,["Rotation","OffsetX","OffsetY"]),o=this._normalizePrimitiveOverrideProps(s);let a=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const h=c.primitiveName??r;l||!h||c.colorLocked||this._poMap[h]?.Color==null&&this._poMap[h]?.StrokeColor==null||(a=Ly(c.color),a=this._maybeGetValueOrOverrideExpression(h,"StrokeColor")??this._getValueOrOverrideExpression(n,h,"Color",a),l=!0);const p=this._maybeGetValueOrOverrideExpression(h,"StrokeWidth");if(p){let m=null,v=null;typeof p=="number"?m=p:v=p.valueExpressionInfo;let w=o.find(S=>S.propertyName==="strokeWidth");w?w.propertyName="width":(w={type:"CIMPrimitiveOverride",primitiveName:h,propertyName:"width",valueExpressionInfo:v,value:m,defaultValue:w3e(n,"width")},o.push(w))}}const u={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:!!e.colorLocked,effects:t,color:a,height:this._getValueOrOverrideExpression(n,r,"Separation",rs(e.separation,ph.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(n,r,"Rotation",rs(e.rotation)),offsetX:this._getValueOrOverrideExpression(n,r,"OffsetX",rs(e.offsetX)),offsetY:this._getValueOrOverrideExpression(n,r,"OffsetY",rs(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=Ly(e.color),l=rs(e.width,ph.CIMSolidStroke.width),u=uj(e.capStyle,ph.CIMSolidStroke.capstyle),c=uj(e.joinStyle,ph.CIMSolidStroke.joinstyle),h=e.miterLimit;let p,m,v=[];if(this._analyzePrimitiveOverrides(s,t,null,null)&&(v=this._getPrimitiveMaterialOverrides(s,o)),t&&t instanceof Array&&t.length>0){const S=t[t.length-1].effect;S&&S.type==="CIMGeometricEffectDashes"&&S.lineDashEnding==="NoConstraint"&&S.offsetAlongLine===null&&(p=S.dashTemplate,m=S.scaleDash,(t=[...t]).pop())}const w=p!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:p,capStyle:u},overrides:v}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:w,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,s,"Color",a),width:this._getValueOrOverrideExpression(o,s,"Width",l),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",u),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",c),miterLimit:h&&this._getValueOrOverrideExpression(o,s,"MiterLimit",h),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:p,scaleDash:m,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=Qce(e),l=rs(e.width,ph.CIMPictureStroke.width),u=uj(e.capStyle,ph.CIMPictureStroke.capstyle),c=uj(e.joinStyle,ph.CIMPictureStroke.joinstyle),h=e.miterLimit,p={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:p,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,s,"TintColor",a),width:this._getValueOrOverrideExpression(o,s,"Width",l),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",u),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",c),miterLimit:h&&this._getValueOrOverrideExpression(o,s,"MiterLimit",h),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,r,n){const{primitiveName:s,type:o}=e,a=rs(e.width,ph.CIMSolidStroke.width),l=uj(e.capStyle,ph.CIMGradientStroke.capstyle),u=uj(e.joinStyle,ph.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:r,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,s,"Width",a),cap:this._getValueOrOverrideExpression(o,s,"CapStyle",l),join:this._getValueOrOverrideExpression(o,s,"JoinStyle",u),miterLimit:c&&this._getValueOrOverrideExpression(o,s,"MiterLimit",c),referenceWidth:n,zOrder:ZPe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,r,n,s,o,a,l,u=!1,c=!1){if(u||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,u))return;const h=rs(e.size,ph.CIMVectorMarker.size),p=rs(e.rotation),m=rs(e.offsetX),v=rs(e.offsetY),{primitiveName:w,type:S}=e,I=this._getValueOrOverrideExpression(S,w,"Size",h),R=this._getValueOrOverrideExpression(S,w,"Rotation",p),L=this._getValueOrOverrideExpression(S,w,"OffsetX",m),k=this._getValueOrOverrideExpression(S,w,"OffsetY",v);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,r,n,s,o,I,R,L,k,l,u,c);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,r,n,s,o,I,R,L,k,l,a,u,c)}}_analyzeMarkerInsidePolygon(e,t,r){const{markerPlacement:n,type:s}=e;if(!n||n.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(s==="CIMVectorMarker"||s==="CIMPictureMarker"){const p=e.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;const m=n.primitiveName;if(m&&this._analyzePrimitiveOverrides([m],t,null,null))return!1;if(s==="CIMVectorMarker"){const{markerGraphics:v}=e;if(v)for(const w of v){const{symbol:S}=w;if(S?.type==="CIMPolygonSymbol"&&S.symbolLayers){const{symbolLayers:I}=S;for(const R of I)if(R.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:v}=e;if(v)return!1}}const o=Math.abs(n.stepX),a=Math.abs(n.stepY);if(o===0||a===0)return!0;let l,u;if(n.gridType==="Random"){const p=uy(Hjt),m=Math.max(Math.floor(p/o),1);l=a*Math.max(Math.floor(p/a),1),u=m*o/l}else n.shiftOddRows?(l=2*a,u=o/a*.5):(l=a,u=o/a);const c=Qce(e),h=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:r,effects:t,color:c,height:l,scaleX:u,angle:n.gridAngle,offsetX:rs(n.offsetX),offsetY:rs(n.offsetY),applyRandomOffset:n.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,r,n,s,o,a,l,u,c,h,p,m){const{primitiveName:v,type:w}=e;let S=rs(e.scaleX,1);const I=Qce(e);r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const R=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),L=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const V=e.width;let Y=1;const K=this._resourceManager.getResource(e.url);K!=null&&(Y=K.width/K.height),S/=Y*(rs(e.size)/V)}const k=[...n];let B;e.primitiveName&&k.push(e.primitiveName),e.animatedSymbolProperties||R?B={type:"animated",url:e.url,urlHash:"H"+Q1(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(B=li(e),B.markerPlacement=null);const $={type:"sprite-rasterization-param",resource:B,overrides:this._getMaterialOverrides(k,w)};R&&$.overrides.push(...R.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:$,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:s,size:a,scaleX:this._getValueOrOverrideExpression(w,v,"ScaleX",S),rotation:l,offsetX:u,offsetY:c,transform:{type:"cim-marker-transform-param",params:h},color:this._getValueOrOverrideExpression(w,v,"TintColor",I),anchorPoint:{x:L.x,y:L.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:m,markerPlacement:r,animatedSymbolProperties:R})}_analyzeVectorMarker(e,t,r,n,s,o,a,l,u,c,h,p,m,v){const w=e.markerGraphics;if(!w)return;const S=e.frame;let I=0;if(I=S?S.ymax-S.ymin:o,I){const R={offsetX:u,offsetY:c,rotation:l,size:a,frameHeight:I,rotateClockWise:!!e.rotateClockwise};h=[...h,R]}r||(r=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const R of w)if(R){const L=R.symbol;if(!L)continue;const k=R.primitiveName;let B;if(k&&n.push(k),(L.type==="CIMPointSymbol"||L.type==="CIMTextSymbol")&&S){let $=0,V=0;const Y=R.geometry;"x"in Y&&"y"in Y&&($+=Y.x-.5*(S.xmin+S.xmax),V+=Y.y-.5*(S.ymin+S.ymax));const K=e.anchorPoint;K&&(e.anchorPointUnits==="Absolute"?($-=K.x,V-=K.y):S&&($-=(S.xmax-S.xmin)*K.x,V-=(S.ymax-S.ymin)*K.y));const Q={offsetX:$,offsetY:V,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};B=[...h,Q]}switch(L.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||Rhn(L)?this._analyzeMultiLayerGraphicNonSDF(e,t,r,null,R,n,s,o,B??h,I,m,v):this._analyzeMultiLayerGraphic(e,t,r,null,R,n,s,o,B??h,I,m,v);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,r,R,n,s,o,B??h,m)}k&&n.pop()}}_analyzeMultiLayerGraphic(e,t,r,n,s,o,a,l,u,c,h,p){const m=s.symbol,v=m.symbolLayers;if(!v)return;let w=v.length;if(Phn(v))return void this._analyzeCompositeMarkerGraphic(e,t,r,n,s,v,a,l,u,c,h,p);const S=this._resourceManager.geometryEngine,I=J8e.applyEffects(m.effects,s.geometry,S);if(I)for(;w--;){const R=v[w];if(!R||R.enable===!1)continue;const L=R.primitiveName;switch(L&&o.push(L),R.type){case"CIMSolidFill":case"CIMSolidStroke":{const k=J8e.applyEffects(R.effects,I,S),B=dvt(k);if(!B)continue;const $=e.anchorPointUnits!=="Relative",[V,Y,K,Q]=pvt(B,e.frame,e.size,e.anchorPoint,$),re=R.type==="CIMSolidFill",ne={type:"sdf",geom:k,asFill:re},{path:de}=R,pe=re?Ly(gP(R)):de==null?Ly(BV(R)):[0,0,0,0],H=re?[0,0,0,0]:Ly(BV(R)),Z=kne(R)??0;if(!re&&!Z)break;const ae=s.primitiveName;let fe=null;re&&!R.colorLocked&&(fe=this._maybeGetValueOrOverrideExpression(ae,"FillColor"));let be=null;re||R.colorLocked||(be=this._maybeGetValueOrOverrideExpression(ae,"StrokeColor"));const _e=fe??this._getValueOrOverrideExpression(R.type,L,"Color",pe),Ie=be??this._getValueOrOverrideExpression(R.type,L,"Color",H),Te=this._maybeGetValueOrOverrideExpression(ae,"StrokeWidth")??this._getValueOrOverrideExpression(R.type,L,"Width",Z),Be=de?{type:"sprite-rasterization-param",resource:{type:"path",path:de,asFill:re},overrides:[]}:{type:"sprite-rasterization-param",resource:ne,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Be,colorLocked:!!R.colorLocked||!!h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:Y,y:K},isAbsoluteAnchorPoint:$,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:u},frameHeight:c,widthRatio:Q,rotateClockwise:!1,referenceSize:l,sizeRatio:V,color:_e,outlineColor:Ie,outlineWidth:Te,isOutline:p,markerPlacement:r,animatedSymbolProperties:n});break}case"CIMPictureMarker":case"CIMVectorMarker":R.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,!!R.colorLocked||!!h,p):this._analyzeMarker(R,t,r,o,a,l,!1,u,h,p);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,!!R.colorLocked||!!h,p)}L&&o.pop()}}_analyzeTextGraphic(e,t,r,n,s,o,a,l){const u=[];N5.findApplicableOverrides(r,this._primitiveOverrides,u);const c=r.geometry;if(!("x"in c)||!("y"in c))return;const h=r.symbol,p=yVe(h),m=gVe(h.fontStyleName),v=zGt(h.fontFamilyName);h.font={family:v,decoration:p,...m};const w=rs(h.height,ph.CIMTextSymbol.height),S=rs(h.angle),I=rs(h.offsetX),R=rs(h.offsetY),L=Ly(gP(h));let k=Ly(BV(h)),B=kne(h)??0;B||(k=Ly(gP(h.haloSymbol)),B=rs(h.haloSize));let $=!1;if(h.symbol?.symbolLayers)for(const Ie of h.symbol.symbolLayers)Ly(gP(Ie))!=null&&($=!!Ie.colorLocked);const V=r.primitiveName;let Y=null;$||(Y=this._maybeGetValueOrOverrideExpression(V,"FillColor"));const K=this._maybeGetValueOrOverrideExpression(V,"TextSize"),Q=this._maybeGetValueOrOverrideExpression(V,"TextAngle"),re=this._maybeGetValueOrOverrideExpression(V,"TextOffsetX"),ne=this._maybeGetValueOrOverrideExpression(V,"TextOffsetY");let de=null,pe=null,H=0;if(h.callout&&h.callout.type==="CIMBackgroundCallout"){const Ie=h.callout;if(Ie.backgroundSymbol){const Te=Ie.backgroundSymbol.symbolLayers;if(Te)for(const Be of Te)Be.type==="CIMSolidFill"?de=Ly(Be.color):Be.type==="CIMSolidStroke"&&(pe=Ly(Be.color),H=rs(Be.width,ph.CIMSolidStroke.width))}}const Z=this._getValueOrOverrideExpression(h.type,r.primitiveName,"TextString",r.textString??"");if(Z==null)return;const{fontStyleName:ae}=h,fe=v+(ae?"-"+ae.toLowerCase():"-regular"),be=this._getMaterialOverrides(n,h.type);be.push(...this._getPrimitiveMaterialOverrides(r.primitiveName,h.type));const _e={type:"text-rasterization-param",resource:{type:"text",textString:r.textString??"",font:h.font,symbol:h,primitiveName:r.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:_e,colorLocked:!!l||!!$,effects:e,alignment:s,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:fe,decoration:p,weight:m.weight,style:m.style,size:K??w,angle:Q??S,offsetX:re??I,offsetY:ne??R,transform:{type:"cim-marker-transform-param",params:a},horizontalAlignment:EMt(h.horizontalAlignment),verticalAlignment:IMt(h.verticalAlignment),text:Z,color:Y??this._getValueOrOverrideExpression(h.type,r.primitiveName,"Color",L),outlineColor:k,outlineSize:B,backgroundColor:de,borderLineColor:pe,borderLineWidth:H,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,r,n,s,o,a,l,u,c,h,p){const m=this._buildSimpleMarker(e,s),v=e.primitiveName,w=this._analyzeMaterialOverrides(v,["Rotation","OffsetX","OffsetY"]),S=this._normalizePrimitiveOverrideProps(w),[I,R,L]=ym.getTextureAnchor(m,this._resourceManager),k=this._getMaterialOverrides(o,e.type);k.push(...S);const B={type:"sprite-rasterization-param",resource:{...m,avoidSDFRasterization:!0},overrides:k};this._cimLayers.push({type:"marker",spriteRasterizationParam:B,colorLocked:h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:I,y:R},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:u},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:l,sizeRatio:L/us(e.size),isOutline:p,markerPlacement:r,animatedSymbolProperties:n})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return N5.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-info",placement:e,overrides:fvt(t)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return N5.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-animation-info",animation:e,overrides:fvt(t)}}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,r,n,s,o,a,l,u,c,h,p){const m=s.geometry,v=o[0],w=o[1],S=dvt(m);if(!S)return;const I=e.anchorPointUnits!=="Relative",[R,L,k,B]=pvt(S,e.frame,e.size,e.anchorPoint,I),{path:$}=w,V=w.primitiveName,Y=v.primitiveName,K=s.primitiveName;let Q=null;w.colorLocked||h||(Q=this._maybeGetValueOrOverrideExpression(K,"FillColor"));const re=Q??this._getValueOrOverrideExpression(w.type,V,"Color",Ly(w.color));let ne=null;v.colorLocked||h||(ne=this._maybeGetValueOrOverrideExpression(K,"StrokeColor"));const de=ne??this._getValueOrOverrideExpression(v.type,Y,"Color",Ly(v.color)),pe=this._maybeGetValueOrOverrideExpression(K,"StrokeWidth")??this._getValueOrOverrideExpression(v.type,Y,"Width",rs(v.width,ph.CIMSolidStroke.width)),H={type:"sprite-rasterization-param",resource:$?{type:"path",path:$,asFill:!0}:{type:"sdf",geom:m,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:H,colorLocked:h,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:L,y:k},isAbsoluteAnchorPoint:I,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:u},frameHeight:c,widthRatio:B,rotateClockwise:!1,referenceSize:l,sizeRatio:R,color:re,outlineColor:de,outlineWidth:pe,isOutline:p,markerPlacement:r,animatedSymbolProperties:n})}_setPoMap(e,t,r){let n;this._poMap[e]?n=this._poMap[e]:(n={},this._poMap[e]=n),n[t]=r}_maybeGetValueOrOverrideExpression(e,t,r){return this._getValueOrOverrideExpression("",e,t,r,!1)}_getValueOrOverrideExpression(e,t,r,n,s=!0){if(s&&!MMt(n)&&(n=w3e(e,r.toLowerCase())),t==null)return n;const o=this._poMap[t];if(o==null)return n;const a=o[r];return typeof a=="string"||typeof a=="number"||Array.isArray(a)?a:a?{valueExpressionInfo:a,defaultValue:n}:n}_analyzePrimitiveOverrides(e,t,r,n){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const s of this._primitiveOverrides)if(e.includes(s.primitiveName)&&s.valueExpressionInfo)return!0;if(t!=null){for(const s of t)if(s?.overrides.length>0)return!0}if(r!=null){for(const s of r)if(s?.overrides.length>0)return!0}if(n!=null){for(const s of n)if(s?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const r=[];for(const n of e)r.push(...this._getPrimitiveMaterialOverrides(n,t));return r}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const r=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter(n=>n.primitiveName===e));return r.forEach(n=>n.defaultValue=w3e(t,n.propertyName.toLowerCase())),r}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(r=>r.primitiveName!==e||!t.includes(r.propertyName))}_normalizePrimitiveOverrideProps(e){return e.map(t=>({...t,propertyName:d1e(t.propertyName)}))}};function ZPe(i){if(i&&i.indexOf("Level_")===0){const e=parseInt(i.substr(6),10);if(!isNaN(e))return e}return 0}const Phn=i=>i&&i.length===2&&i[0].enable&&i[1].enable&&i[0].type==="CIMSolidStroke"&&i[1].type==="CIMSolidFill"&&i[0].path==null&&i[1].path==null&&!i[0].effects&&!i[1].effects;function Rhn(i){const e=i.symbolLayers;if(!e||e.length!==2)return!1;const t=e.find(n=>n.effects?.find(s=>s.type==="CIMGeometricEffectDashes"&&s.dashTemplate!=null)),r=e.find(n=>n.effects?.find(s=>s.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!r}function fvt(i){return li(i).map(e=>({...e,propertyName:d1e(e.propertyName)}))}const goe=-1;let W2=class extends un{constructor(e){super(e),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=yi("mapview-transitions-duration"),this.effects=[]}set effect(e){if(this._get("effect")!==(e=e||"")){this._set("effect",e);try{this._transitionTo(mvt(e))}catch(t){this._transitionTo([]),di.getLogger(this).warn("Invalid Effect",{effect:e,error:t})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(e){this._updateForScale(e)}get transitioning(){return this._to!==null}canTransitionTo(e){try{return this.scale>0&&gvt(this._current,mvt(e),this.scale)}catch{return!1}}transitionStep(e,t){this._applyTimeTransition(e),this._updateForScale(t)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(e){this.scale>0&&gvt(this._current,e,this.scale)?(this._final=e,this._to=li(e),Dhn(this._current,this._to,this.scale),this._from=li(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=e),this._set("effects",this._current[0]?li(this._current[0].effects):[])}_applyTimeTransition(e){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=e;const t=Math.min(1,this._time/this.duration);for(let r=0;r=t[0].scale)s=n=t[0].effects;else if(e<=t[r].scale)s=n=t[r].effects;else for(let a=0;a=e&&u.scale<=e){o=(e-l.scale)/(u.scale-l.scale),n=l.effects,s=u.effects;break}}for(let a=0;a1||e.length>1)&&t<=0)&&NOt(i[0].effects,e[0].effects)}function Dhn(i,e,t){const r=i.length>e.length?i:e,n=i.length>e.length?e:i,s=n[n.length-1],o=s?.scale??t,a=s?.effects??[];for(let l=n.length;lr?Math.max(r,n-s):Math.min(r,n+s),this.computedVisible=this.computedOpacity>0;const o=r===this.computedOpacity;this.inFadeTransition=!o,o||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}};const y7e=1,Lhn=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],Nhn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],RK=256,hF={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},QPe=()=>di.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function $hn(i,e){e.fillColor[0]=i.color.r/255,e.fillColor[1]=i.color.g/255,e.fillColor[2]=i.color.b/255,e.fillColor[3]=i.color.a,i.haloColor?(e.outlineColor[0]=i.haloColor.r/255,e.outlineColor[1]=i.haloColor.g/255,e.outlineColor[2]=i.haloColor.b/255,e.outlineColor[3]=i.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=i.fillOpacity,e.outlineColor[3]*=i.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=hF.outlineWidth,e.outerHaloWidth=hF.outerHaloWidth,e.innerHaloWidth=hF.innerHaloWidth,e.outlinePosition=hF.outlinePosition}const Bhn=[0,0,0,0];let Nqt=class{constructor(){this.type="single",this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:hF.outlinePosition,outlineWidth:hF.outlineWidth,innerHaloWidth:hF.innerHaloWidth,outerHaloWidth:hF.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*RK),this._minMaxDistance=[0,0]}setHighlightOptions(e){const t=this._convertedHighlightOptions;$hn(e,t);const r=t.outlinePosition-t.outlineWidth/2-t.outerHaloWidth,n=t.outlinePosition-t.outlineWidth/2,s=t.outlinePosition+t.outlineWidth/2,o=t.outlinePosition+t.outlineWidth/2+t.innerHaloWidth,a=Math.sqrt(Math.PI/2)*y7e,l=Math.abs(r)>a?Math.round(10*(Math.abs(r)-a))/10:0,u=Math.abs(o)>a?Math.round(10*(Math.abs(o)-a))/10:0;let c;l&&!u?QPe().error("The outer rim of the highlight is "+l+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!l&&u?QPe().error("The inner rim of the highlight is "+u+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):l&&u&&QPe().error("The highlight is "+Math.max(l,u)+"px away from the edge of the feature; consider reducing some width values.");const h=[void 0,void 0,void 0,void 0];function p(v,w,S){h[0]=(1-S)*v[0]+S*w[0],h[1]=(1-S)*v[1]+S*w[1],h[2]=(1-S)*v[2]+S*w[2],h[3]=(1-S)*v[3]+S*w[3]}const{_texelData:m}=this;for(let v=0;vi.stencilRef,compare:Wl.EQUAL,mask:255,op:{fail:il.KEEP,zFail:il.KEEP,zPass:il.REPLACE}}}},Ghn={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Uhn={...$qt,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Bqt({pixelRatio:i,state:e,displayLevel:t,requiredLevel:r},n){const s=1/2**(t-n.key.level),o=1/2**(r-n.key.level);return{displayMat3:Array.from(e.displayMat3),displayViewMat3:Array.from(e.displayViewMat3),displayViewScreenMat3:Array.from(n.transforms.displayViewScreenMat3),viewMat3:Array.from(e.viewMat3),tileMat3:Array.from(n.transforms.tileMat3),displayZoomFactor:s,requiredZoomFactor:o,tileOffset:[n.x,n.y],currentScale:e.scale,currentZoom:t,metersPerSRUnit:pu(e.spatialReference),rotation:e.rotation,pixelRatio:i}}function yoe(i){return i.passOptions?.type==="highlight"}function fg(i){return i.passOptions?.type==="hittest"}function zhn(i){if(!fg(i))return null;const{position:e}=i.passOptions,t=i.pixelRatio,r=yi("esri-mobile");return{position:e,distance:yi(r?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance")*t,smallSymbolDistance:yi(r?"hittest-2d-mobile-tolerance":"hittest-2d-small-symbol-tolerance")*t,smallSymbolSizeThreshold:yi("hittest-2d-small-symbol-tolerance-threshold")}}function Vhn(i){if(!yoe(i))return null;const{activeReasons:e,highlightAll:t}=i.passOptions;return{activeReasons:e,highlightAll:t?1:0}}function oT(i,e,t){const r={};for(const n in t)t[n]instanceof Function?r[n]=t[n](i,e):r[n]=t[n];return r}function l_(i,e){const{attributeView:t,context:r}=i;return{storage:t.getUniforms(r),view:Bqt(i,e),hittestRequest:zhn(i),highlight:Vhn(i)}}function zv(i){return{inside:i.selection===ax.InsideEffect,outside:i.selection===ax.OutsideEffect}}function u_(i){return fg(i)?Ghn:yoe(i)&&i.passOptions.stepType==="clear"?Uhn:$qt}function HCe(i){const{row:e,col:t}=i.key,r=t*xo,n=e*xo;return{tileOffsetFromLocalOrigin:[r%Ede,n%Ede],maxIntsToLocalOrigin:[Math.floor(r/Ede),Math.floor(n/Ede)]}}new Rs({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function jqt(i){const{bandCount:e,attributeTable:t,colormap:r,pixelType:n}=i.raster.rasterInfo;return e===1&&(t!=null||r!=null||n==="u8"||n==="s8")}function Hhn(i,e){return i?.type==="single"&&e.multiHighlightEnabled&&(i.destroy(),i=null),i?.type!=="multi"||e.multiHighlightEnabled||(i.destroy(),i=null),i||(i=e.multiHighlightEnabled?new jhn:new Nqt),i.setHighlightOptions(e),i}function $Ke(i,e,t){const{painter:r,highlightGradient:n}=i,{highlight:s}=r.effects;if(!n)return;const o=i.passOptions,a=n.getReasonsWithGradients();for(let l=0;lt.clips=e)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(e){(this._effectView||e)&&(this._effectView||(this._effectView=new W2),this._effectView.effect=e,this.requestRender())}get highlightOptions(){return this._highlightOptions}set highlightOptions(e){if(!e)return this._highlightOptions=null,void(this._highlightGradient&&(this._highlightGradient.destroy(),this._highlightGradient=null,this.requestRender()));this._highlightOptions&&this._highlightOptions.equals(e)||(this._highlightOptions=e,this._highlightGradient=Hhn(this._highlightGradient,e),this.requestRender())}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(e=>e.hasHighlight)}get hasLabels(){return this.children.some(e=>e.hasLabels)}get requiresDedicatedFBO(){return this.children.some(e=>"blendMode"in e&&e.blendMode&&e.blendMode!=="normal")}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._effectView&&(this._effectView.transitionStep(e,t),this._effectView.transitioning&&this.requestRender())}doRender(e){const t=this.createRenderParams(e),{painter:r}=t;r.beforeRenderLayer(t,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(t),r.afterRenderLayer(t,this.computedOpacity)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,t=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const r=e.parent;return r&&r!==this&&r.removeChild(e),t>=this.children.length?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e),e.parent=this,e.stage=this.stage,this!==this.stage&&(e.clips=this.clips),this.requestRender(),e}contains(e){return this._childrenSet.has(e)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const e of this.children)this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null;this.children.length=0}removeChild(e){return this.contains(e)?this.removeChildAt(this.children.indexOf(e)):e}removeChildAt(e){if(e<0||e>=this.children.length)return null;this._needsSort=!0;const t=this.children.splice(e,1)[0];return this._childrenSet.delete(t),this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null,t}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const t of this.children)t.beforeRender(e)}afterRender(e){super.afterRender(e);for(const t of this.children)t.afterRender(e)}_createTransforms(){return{displayViewScreenMat3:Cc()}}onAttach(){super.onAttach();const e=this.stage;for(const t of this.children)t.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const t of this.children)t.processRender(e)}createRenderParams(e){return{...e,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||e.highlightGradient}}},Whn=class{constructor(e){this.events=new rd,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const t={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0};e.appendChild(this._canvas);let r=BW(this._canvas,t);r||(r=BW(this._canvas,{...t,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=r,this._handles=j3([BA(this._canvas,"webglcontextlost",n=>this.events.emit("webgl-context-lost",n))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||yi("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=yi("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[r,n,s,o,a,l]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${r}, ${n}, ${s}, ${o}, ${a}, ${l})`}}else t()}resize(e){const t=this._canvas,r=t.style,{state:{size:n},pixelRatio:s}=e,o=n[0],a=n[1],l=Math.round(o*s),u=Math.round(a*s);t.width===l&&t.height===u||(t.width=l,t.height=u),r.width=o+"px",r.height=a+"px"}_computeViewTransform(e,t){const[r,n]=e.center,[s,o]=t.center,[a,l]=e.toScreen([0,0],s,o),[u,c]=e.toScreen([0,0],r,n),h=u-a,p=c-l,m=e.scale/t.scale,v=t.rotation-e.rotation,w=HA();return sWe(w),gSe(w,w,[m,m]),sk(w,w,Rx(v)),VA(w,w,[h,p]),w}},JS=class{constructor(e,t){this._rctx=e,this._attributes=[{name:"position",offset:0,type:Ti.SHORT,count:2}],this.layout={hash:wle(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=Aa.createVertex(e,oa.STATIC_DRAW,new Uint16Array(t)),this._vao=new wh(e,new Map([["a_position",0]]),{geometry:[new Hl("a_position",2,Ti.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(Eo.TRIANGLE_STRIP,0,this._count)}},Qx=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,r){}drawMany(e,t,r){for(const n of t)n.visible&&this.draw(e,n,r)}};const eRe={nearest:{defines:[],samplingMode:Is.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:Is.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:Is.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:Is.LINEAR_MIPMAP_LINEAR,mips:!0}},qhn=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:r}=i,n=e.resolution/e.pixelRatio/r.resolution,s=Math.round(i.pixelRatio)!==i.pixelRatio,o=n>1.05||n<.95;return r.rotation||o||s||e.isSourceScaled||e.rotation?eRe.bilinear:eRe.nearest}return eRe[t.samplingMode]};let Yhn=class extends Qx{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:r,renderingOptions:n,painter:s,requestRender:o,allowDelayedRender:a}=e;if(!t.source||!t.isReady)return;const l=qhn(e,t,n),u=s.materialManager.getProgram(this._desc,l.defines);if(a&&o!=null&&!u.compiled)return void o();e.timeline.begin(this.name),t.blendFunction==="additive"?r.setBlendFunctionSeparate(bn.ONE,bn.ONE,bn.ONE,bn.ONE):r.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),r.setStencilFunction(Wl.EQUAL,t.stencilRef,255),this._quad||(this._quad=new JS(r,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:h,transforms:p}=t;t.setSamplingProfile(l),t.bind(e.context,gbe),r.useProgram(u),u.setUniformMatrix3fv("u_dvsMat3",p.displayViewScreenMat3),u.setUniform1i("u_texture",gbe),u.setUniform2fv("u_coordScale",c),u.setUniform1f("u_opacity",h),this._quad.draw(),e.timeline.end(this.name)}};function Gqt(){return new Float32Array(4)}function Xhn(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function tM(i,e,t,r){const n=new Float32Array(4);return n[0]=i,n[1]=e,n[2]=t,n[3]=r,n}function Jhn(i,e){return new Float32Array(i,e,4)}function Uqt(){return Gqt()}function zqt(){return tM(1,1,1,1)}function Vqt(){return tM(1,0,0,0)}function Hqt(){return tM(0,1,0,0)}function Wqt(){return tM(0,0,1,0)}function qqt(){return tM(0,0,0,1)}const Khn=Uqt(),Zhn=zqt(),Qhn=Vqt(),edn=Hqt(),tdn=Wqt(),idn=qqt();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zhn,UNIT_W:idn,UNIT_X:Qhn,UNIT_Y:edn,UNIT_Z:tdn,ZEROS:Khn,clone:Xhn,create:Gqt,createView:Jhn,fromValues:tM,ones:zqt,unitW:qqt,unitX:Vqt,unitY:Hqt,unitZ:Wqt,zeros:Uqt},Symbol.toStringTag,{value:"Module"}));const rdn={background:{"background.frag":`uniform lowp vec4 u_color; void main() { gl_FragColor = u_color; }`,"background.vert":`attribute vec2 a_pos; @@ -4374,7 +4374,7 @@ return t3; ); float rgba2float(vec4 rgba) { return dot(rgba, rgba2float_factors); -}`}};function adn(i){return function(e){let t=i;return e.split("/").forEach(r=>{t&&(t=t[r])}),t}}const ldn=new kKe(adn(odn));function Rm(i){return ldn.resolveIncludes(i)}const voe={shaders:{vertexShader:Rm("background/background.vert"),fragmentShader:Rm("background/background.frag")},attributes:new Map([["a_pos",0]])},udn=()=>xCe("clip",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.SHORT}]});let cdn=class extends Qx{constructor(){super(...arguments),this._color=tM(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:e}){e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setFaceCullingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(Hl.ALWAYS,0,255)}draw(e,t){const{context:r,state:n,requestRender:s,allowDelayedRender:o}=e,a=udn(),l=t.getVAO(r,n,a.attributes,a.bufferLayouts);l.indexBuffer!=null&&(this._program||(this._program=R3(r,voe)),!o||s==null||this._program.compiled?(r.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",n.displayMat3),r.bindVAO(l),r.drawElements(Eo.TRIANGLES,l.indexBuffer.size,Ti.UNSIGNED_INT,0),r.bindVAO()):s())}};const hdn=()=>xCe("overlay",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.FLOAT}],tex:[{location:1,name:"a_uv",count:2,type:Ti.UNSIGNED_SHORT}]});let ddn=class extends Qx{constructor(){super(...arguments),this._desc={vsPath:"overlay/overlay",fsPath:"overlay/overlay",attributes:new Map([["a_pos",0],["a_uv",1]])}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(Hl.GREATER,255,255)}draw(e,t){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;if(!t.isReady)return;const{computedOpacity:a,dvsMat3:l,isWrapAround:u,perspectiveTransform:c,texture:h}=t;e.timeline.begin(this.name);const p=n.materialManager.getProgram(this._desc);if(o&&s!=null&&!p.compiled)return void s();const m=hdn(),v=t.getVAO(r,m.bufferLayouts,m.attributes);if(!v)return;r.bindVAO(v),r.useProgram(p),r.bindTexture(h,gbe),p.setUniformMatrix3fv("u_dvsMat3",l),p.setUniform1i("u_texture",gbe),p.setUniform1f("u_opacity",a),p.setUniform2fv("u_perspective",c);const w=u?10:4;r.drawArrays(Eo.TRIANGLE_STRIP,0,w),r.bindVAO(),e.timeline.end(this.name)}};const v7e={geometry:[new Vl("a_pos",2,Ti.BYTE,0,2)]},pdn={geometry:[new Vl("a_pos",2,Ti.BYTE,0,4),new Vl("a_tex",2,Ti.BYTE,2,4)]},Yqt={geometry:[new Vl("a_pos",2,Ti.UNSIGNED_SHORT,0,4)]};let Xqt=class extends Qx{constructor(){super(...arguments),this._color=tM(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:e}){e.setDepthWriteEnabled(!1),e.setDepthTestEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),e.setStencilWriteMask(255)}draw(e,t){const{context:r,requestRender:n,allowDelayedRender:s}=e;this._initialized||this._initialize(r),!s||n==null||this._solidProgram.compiled?(r.setStencilFunctionSeparate(W1.FRONT_AND_BACK,Hl.GREATER,t.stencilRef,255),r.bindVAO(this._solidVertexArrayObject),r.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[t.rangeX,t.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),r.drawArrays(Eo.TRIANGLE_STRIP,0,4),r.bindVAO()):n()}_initialize(e){if(this._initialized)return!0;const t=R3(e,voe);if(!t)return!1;const r=new Int8Array([0,0,1,0,0,1,1,1]),n=Aa.createVertex(e,oa.STATIC_DRAW,r),s=new wh(e,voe.attributes,v7e,{geometry:n});return this._solidProgram=t,this._solidVertexArrayObject=s,this._initialized=!0,!0}},gX=class extends eM{constructor(e,t,r,n,s,o,a=s,l=o){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Tc(e),this.resolution=t,this.x=r,this.y=n,this.width=s,this.height=o,this.rangeX=a,this.rangeY=l}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let e=this;for(;e.parent!==this._stage;){if(!e.parent)return 0;e=e.parent}return this._stage.children.indexOf(e)}setTransform(e){const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*t,a=this.height/this.rangeY*t;pB(r,o,0,0,0,a,0,n,s,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}get destroyed(){return this._destroyed}},fdn=class extends gX{constructor(e,t,r,n){super(e,t,r,n,xo,xo)}destroy(){super.destroy()}setTransform(e){const t=this.resolution/e.resolution,r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*t,a=this.height/this.rangeY*t;pB(r,o,0,0,0,a,0,n,s,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r);const l=this.transforms.labelMat2d,u=window.devicePixelRatio,c=B4t(SS(),o*u,0,0,a*u,n*u,s*u);FW(l,e.viewMat2d,c)}_createTransforms(){return{labelMat2d:SS(),tileMat3:Cc(),displayViewScreenMat3:Cc()}}},xA=class Jqt{constructor(e){if(this.next=null,!Array.isArray(e))return void(this.data=e);this.data=e[0];let t=this;for(let r=1;re(t.data)?this:t;return this.next?this.next.max(e,r):r}remove(e,t=null){return this===e?t?(t.next=this.next,t):this.next:this.next?.remove(e,this)??null}get last(){return this.next?this.next.last:this}},Kqt=class{constructor(e){this._head=null,e!=null&&(this._head=new xA(e))}get head(){return this._head}maxAvailableSpace(){if(this._head==null)return 0;const e=this._head.max(t=>t.end-t.start);return e.data.end-e.data.start}firstFit(e){if(this._head==null)return null;let t=null,r=this._head;for(;r;){const n=r.data.end-r.data.start;if(n===e)return t?t.next=r.next:this._head=r.next,r.data.start;if(n>e){const s=r.data.start;return r.data.start+=e,s}t=r,r=r.next}return null}free(e,t){const r=e+t;if(this._head==null){const a=new xA({start:e,end:r});return void(this._head=a)}if(r<=this._head.data.start){if(r===this._head.data.start)return void(this._head.data.start-=t);const a=new xA({start:e,end:r});return a.next=this._head,void(this._head=a)}let n=this._head,s=n.next;for(;s;){if(s.data.start>=r){if(n.data.end===e){if(n.data.end+=t,n.data.end===s.data.start){const l=s.data.end-s.data.start;return n.data.end+=l,void(n.next=s.next)}return}if(s.data.start===r)return void(s.data.start-=t);const a=new xA({start:e,end:r});return a.next=n.next,void(n.next=a)}n=s,s=s.next}if(e===n.data.end)return void(n.data.end+=t);const o=new xA({start:e,end:r});n.next=o}clear(){this._head=null}};function mdn(i,e){return i<<16|255&e}function gdn(i){return 255&i}let DK=class{constructor(e,t,r,n,s){this.instance=e,this.materialKey=t,this.target=r,this.start=n,this.count=s}get textureKey(){return gdn(this.materialKey)}get indexEnd(){return this.start+this.count}extend(e){this.count+=e}render(e){this.instance.techniqueRef.render(e,this)}},ydn=class Zqt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,r,n){const s=new Zqt;for(const o of e.values())for(const a of o.records){const l=r.getInstance(a.instanceId),u=mdn(l.instanceId,a.textureKey);s.addRecord(l,u,a.indexStart,a.indexCount,a.vertexStart,a.vertexCount,t,n)}return s}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e){const{drawPhase:t}=e;for(const r of this.infos())r.instance.techniqueRef.drawPhase&t&&r.render(e)}addRecord(e,t,r,n,s,o,a,l){let u=r,c=n;if(c||(u=s,c=o),!c)return;if(this._head==null){const w=new DK(e,t,a,u,c);return this._head=new xA(w),this._tail=this._head,this._length++,void this._minOrderedLength++}if(l===OR.STRICT_ORDER)return this._insert(e,t,a,u,c,this._tail,null);let h=null,p=this._head;const m=e.instanceId,v=e.techniqueRef.symbologyPlane;if(l===OR.STRICT_MARKERS_AND_TEXT&&(v===TE.MARKER||v===TE.TEXT))return this._insert(e,t,a,u,c,this._tail,null);for(;p;){const w=p.data.instance,S=w.instanceId,I=w.techniqueRef.symbologyPlane,R=h?.data.instance.instanceId;if(v=1){const n=this.index.operations[this.index.operations.length-1];n.srcFrom+n.count===e.indexStart&&(n.count+=e.indexCount,r=!0)}r||this.index.operations.push({srcFrom:e.indexStart,dstFrom:this.index.count,count:e.indexCount,mutate:t}),e.indexStart=this.index.count,this.index.count+=e.indexCount}};const wvt=yi("esri-2d-log-allocations");let xvt=class Qqt{static create(e,t){const r=t.acquireUint32Array(e);return new Qqt(r,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},tRe=class eYt{constructor(){this._data=new ArrayBuffer(eYt.BYTE_LENGTH),this._freeList=new Kqt({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}},_dn=class{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*tRe.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,wvt&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=tRe.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const r of this._pages){const n=r.acquireUint32Array(e);if(n!=null)return n}const t=this._addPage().acquireUint32Array(e);return Of(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,wvt&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new tRe;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}};const bdn=1.25,Svt=32767,wdn=Svt<<16|Svt;let Tvt=class{constructor(e,t,r,n){this._pool=n;const s=xvt.create(t*r*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=t,this.strideInt=r,this.bufferType=e,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:t*r*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=s,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new Kqt({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(e){if(!(this.maxAvailableSpace()>=e)&&e*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const t=this._cpu.length/this.strideInt,r=Math.round((t+e)*bdn),n=r*this.strideInt;this._cpu.expand(n*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(t,r-t),this.memoryStats.bytesReserved+=(r-t)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(e,t){this._cpu.array[e]!==t&&(this._cpu.array[e]=t,this.dirty.start=Math.min(e,this.dirty.start),this.dirty.end=Math.max(e+1,this.dirty.end))}getGPUBuffer(e,t=!1){if(!this.bufferSize)return null;if(t){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(e)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(e)),this._gpu}getView(e,t){return this._cpu.getUint32View(e,t/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(e,t,r,n){const s=r*this.strideInt;if(!s)return 0;const o=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(e,o,s),l=this.freeList.firstFit(r);Of(l,"First fit region must be defined");const u=l*this.strideInt,c=s;if(this._cpu.array.set(a,u),n!==0)for(let h=0;hn,o=this._cpu,a=xvt.create(n,this._pool);s||a.array.set(this._cpu.getUint32View(0,this.intSize));for(const l of t)if(s||l.srcFrom!==l.dstFrom||l.mutate!==0){this.dirty.start=Math.min(this.dirty.start,l.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(l.dstFrom+l.count)*this.strideInt);for(let u=0;ut.locations.has(u.name));if(!r)return{attributes:s,hash:this._layout.hash,stride:this._layout.stride};const o=Object.values(n).flat().join("-");if(this._computeLayouts.has(o))return this._computeLayouts.get(o);const a=this._layout.stride;for(const{name:u,count:c,type:h,normalized:p,offset:m,packPrecisionFactor:v}of this._layout.attributes){const w=n[u];w!=null&&w.length===2&&(s.push({name:w[0],count:c,type:h,normalized:p,offset:m+a,packPrecisionFactor:v}),s.push({name:w[1],count:c,type:h,normalized:p,offset:m+2*a,packPrecisionFactor:v}))}const l={attributes:s,stride:a,hash:wle(s)};return this._computeLayouts.set(o,l),l}getDrawArgs(e,t,r,n){return n?{primitive:Eo.POINTS,count:t/3,offset:r/3}:{primitive:e,count:t,offset:r}}getDebugVertexInfo(e){if(!this._vertexBuffer)return null;const t=this.getLayout(e);if(t==null)return null;const r=t.stride,n=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),s=new DataView(n.slice().buffer);let o=n.byteLength/r;e.useComputeBuffer&&(o=this._indexBuffer.fillPointer/3);const a=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let l=0;const u=[];for(let c=0;cs.name==="pos"||s.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute");this._indexBuffer=new Tvt("index",Math.max(t,Cvt),1,this._bufferPool),this._vertexBuffer=new Tvt("vertex",Math.max(r,Cvt),n,this._bufferPool)}}append(e){const t=e.layout.stride,r=e.indices.byteLength/Uint32Array.BYTES_PER_ELEMENT,n=e.vertices.byteLength/t;this._ensure(e.layout,r,n);const{vertices:s,indices:o}=e,a=this._vertexBuffer.insert(s,0,s.byteLength/t,0);return{vertexFrom:a,indexFrom:this._indexBuffer.insert(o,0,o.byteLength/4,a)}}copyRecordFrom(e,t,r,n){const{indexStart:s,indexCount:o,vertexStart:a,vertexCount:l}=t;this._ensure(e._layout,o,l);const u=e._position,c=r*(u.packPrecisionFactor??1),h=n*(u.packPrecisionFactor??1),p=u.offset,m=cv(c,h),v=this._vertexBuffer.copyFrom(e._vertexBuffer,a,l,m,p),w=this._indexBuffer.copyFrom(e._indexBuffer,s,o,v-a,0),S=t.clone();return S.vertexStart=v,S.indexStart=w,S.overlaps=0,S}remove(e,t,r,n){this._indexBuffer.free(e,t),this._vertexBuffer.free(r,n)}upload(){this._invalidated=!0}getVAO(e,t,r){if(!this._vertexBuffer||!this._indexBuffer||!this._vertexBuffer.bufferSize)return null;const n=r?.useComputeBuffer?Sdn:xdn;let s=this._vaos.get(n);if(this._invalidated||r?.useComputeBuffer){(this._vertexBuffer.invalidated||this._indexBuffer.invalidated||r?.useComputeBuffer&&this._indexBuffer.invalidatedComputeBuffer)&&(this._vertexBuffer.invalidate(),this._indexBuffer.invalidate(),s?.disposeVAOOnly(),s=null),this._vertexBuffer.upload(),this._indexBuffer.upload();const o=this._indexBuffer.getGPUBuffer(e,n===1),a=this._vertexBuffer.getGPUBuffer(e);s||(s=new wh(e,t.locations,this._getVertexAttributeLayout(this.getLayout(r)),{geometry:a},o),this._vaos.set(n,s)),this._invalidated=!1}return s}get memoryStats(){return{bytesUsed:this._vertexBuffer.memoryStats.bytesUsed+this._indexBuffer.memoryStats.bytesUsed,bytesReserved:this._vertexBuffer.memoryStats.bytesReserved+this._indexBuffer.memoryStats.bytesReserved,vertex:this._vertexBuffer.memoryStats,index:this._indexBuffer.memoryStats}}reshuffle(e){this._vertexBuffer&&this._vertexBuffer.reshuffle(e.vertex.count,e.vertex.operations),this._indexBuffer&&this._indexBuffer.reshuffle(e.index.count,e.index.operations)}},Gye=class{constructor(e){this._pos=0,this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer)}readInt32(){return this._i32View[this._pos++]}readF32(){return this._f32View[this._pos++]}};function Evt(i){return i?{entities:hH(new Gye(i.entities),dH),vertexData:i.data.map(Cdn)}:null}function Cdn(i){const e=i.layout.stride,t=new DataView(i.vertices),r=[],n=i.vertices.byteLength/e;let s=0;for(let o=0;odi.getLogger("esri.views.2d.engine.webgl.FeatureTile");let Idn=0,BKe=class extends fdn{constructor(e,t,r,n,s=!1){super(e,t,r,n),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=Idn++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.visible=!0,this.transforms.labelMat2d=SS(),this.enableDeferredUploads=s}destroy(){super.destroy(),this.clear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this._isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t,r=OR.BATCHING){if(this._uploadAllowed&&this._invalidated){this._entities.sort((n,s)=>{const o=s.sortKey,a=n.sortKey;return a===o?n.id-s.id:a-o}),r===OR.BATCHING&&this.reshuffle(!0),this._displayList=ydn.fromDisplayEntities(this._entities,this,t,r);for(const n of this._meshes.values())n.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:r,sortKey:n}of this._entities)if(e.has(r)&&t.set(r,n),t.size===e.size)break;return t}onMessage(e){switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(e){if(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Evt(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=hH(new Gye(e.append.entities),dH);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:Evt(e.modify),remove:e.remove});const t=hH(new Gye(e.modify.entities),dH),r=t.map(o=>o.id),n=e.isPixelBuffer??!1,s=[...e.remove,...r];n?this._removeByIdsFromBuffer(s):this._removeByIds(s),this._insert(t,e.modify.data,n)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const r of this._entities)for(const n of r.records){const s=this._meshes.get(n.instanceId);let o=t.get(s);o||(o=new vdn(e),t.set(s,o)),o.copyRecord(n)}for(const[r,n]of t)r.reshuffle(n);this._invalidated=!0,this._aggregateMemoryStats(),yi("esri-2d-update-debug")&&Edn().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,r,n){const s=r*xo,o=n*xo;for(const a of e._entities){let l=null;for(const u of a.records)if(u.overlaps&t){const c=this._ensureMesh(u.instanceId),h=e.getMesh(u.instanceId),p=c.copyRecordFrom(h,u,s,o);l||(l=new dH(a.id,a.sortKey),this._entityIdsFromBuffer.add(a.id),this._entities.push(l)),l.records.push(p)}}this._invalidated=!0}_ensureMesh(e){return this._meshes.has(e)||this._meshes.set(e,new Tdn(this._stage.bufferPool)),this._meshes.get(e)}_insert(e,t,r){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const n=this._insertVertexData(t);for(const s of e){for(const o of s.records)o.updateBaseOffsets(n.get(o.instanceId));r?this._tryInsertBufferedEntity(s):this._insertEntity(s)}this._invalidated=!0}_insertVertexData(e){const t=new Map;for(const r of e){const{instanceId:n}=r,s=this._ensureMesh(n).append(r);if(r.metrics){const o=hH(new Gye(r.metrics),Hee)??[];this._metrics.push(...o)}t.set(n,s)}return t}_insertEntity(e){yi("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const r of e)this._entityIdsFromBuffer.has(r.id)&&t.push(r.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter(t=>this._entityIdsFromBuffer.has(t)))}_removeByIds(e){if(e.length===0)return;const t=new Set(e),r=[];for(const n of this._entities)t.has(n.id)?this._remove(n):r.push(n);this._entities=r,this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:r,indexStart:n,indexCount:s,vertexStart:o,vertexCount:a}=t;this._meshes.get(r)?.remove(n,s,o,a)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const[e,t]of this._meshes)this.debugInfo.memory.bytesUsed+=t.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=t.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,r=e/t,{minOrderedLength:n,length:s}=this.debugInfo.display;return t>cHr&&rdHr&&n/s0){const v=`Length: ${l}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(u){const v=`Min ordered length: ${u}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(c){const v=`Min unordered length: ${c}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(h>0){h>1e5&&(r.fillStyle="red",r.strokeStyle="white");const v=`Triangle count: ${h}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}const{bytesUsed:p,bytesReserved:m}=a.memory;if(r.fillStyle="white",r.strokeStyle="black",p>0||m>0){const v=`Memory usage: ${p} of ${m} bytes`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}}return t.tileDebugInfoTexture.setData(r.canvas),t.tileDebugInfoTexture}},Mdn=class extends Qx{constructor(){super(...arguments),this._color=tM(1,0,0,1),this._patternMatrix=Cc(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,t){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;this._loadWGLResources(e);const a=e.displayLevel,l=e.styleLayer,u=l.backgroundMaterial,c=n.vectorTilesMaterialManager,h=l.getPaintValue("background-color",a),p=l.getPaintValue("background-opacity",a),m=l.getPaintValue("background-pattern",a),v=m!==void 0,w=1|window.devicePixelRatio,S=e.spriteMosaic;let I,R;const L=w>Vjt?2:1,k=this._programOptions;k.pattern=v;const B=c.getMaterialProgram(r,u,k);if(!o||s==null||B.compiled){if(r.bindVAO(this._vao),r.useProgram(B),v){const $=S.getMosaicItemPosition(m,!0);if($!=null){const{tl:V,br:Y,page:K}=$;I=Y[0]-V[0],R=Y[1]-V[1];const Q=S.getPageSize(K);Q!=null&&(S.bind(r,Is.LINEAR,K,yS),B.setUniform4f("u_tlbr",V[0],V[1],Y[0],Y[1]),B.setUniform2fv("u_mosaicSize",Q),B.setUniform1i("u_texture",yS))}B.setUniform1f("u_opacity",p)}else{const $=h[3]*p;this._color[0]=$*h[0],this._color[1]=$*h[1],this._color[2]=$*h[2],this._color[3]=$,B.setUniform4fv("u_color",this._color)}B.setUniform1f("u_depth",l.z||0);for(const $ of t){if(B.setUniform1f("u_coord_range",$.rangeX),B.setUniformMatrix3fv("u_dvsMat3",$.transforms.displayViewScreenMat3),v){const V=Math.max(2**(Math.round(a)-$.key.level),1),Y=L*$.width*V,K=Y/x5e(I),Q=Y/x5e(R);this._patternMatrix[0]=K,this._patternMatrix[4]=Q,B.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}r.setStencilFunction(Hl.EQUAL,0,255),r.drawArrays(Eo.TRIANGLE_STRIP,0,4)}}else s()}_loadWGLResources(e){if(this._vao)return;const{context:t,styleLayer:r}=e,n=r.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),o=Aa.createVertex(t,oa.STATIC_DRAW,s),a=new wh(t,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:o});this._vao=a}},Odn=class extends Qx{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,t){const{context:r,displayLevel:n,requiredLevel:s,state:o,painter:a,spriteMosaic:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e;if(!t.some(B=>B.layerData.get(u)?.circleIndexCount??!1))return;const p=e.styleLayer,m=p.circleMaterial,v=a.vectorTilesMaterialManager,w=1.2,S=p.getPaintValue("circle-translate",n),I=p.getPaintValue("circle-translate-anchor",n),R=this._programOptions,L=v.getMaterialProgram(r,m,R);if(h&&c!=null&&!L.compiled)return void c();r.useProgram(L),L.setUniformMatrix3fv("u_displayMat3",I===mb.VIEWPORT?o.displayMat3:o.displayViewMat3),L.setUniform2fv("u_circleTranslation",S),L.setUniform1f("u_depth",p.z),L.setUniform1f("u_antialiasingWidth",w);let k=-1;for(const B of t){if(!B.layerData.has(u))continue;B.key.level!==k&&(k=B.key.level,m.setDataUniforms(L,n,p,k,l));const $=B.layerData.get(u);if(!$.circleIndexCount)continue;$.prepareForRendering(r);const V=$.vao;V!=null&&(r.bindVAO(V),L.setUniformMatrix3fv("u_dvsMat3",B.transforms.displayViewScreenMat3),s!==B.key.level?r.setStencilFunction(Hl.EQUAL,B.stencilRef,255):r.setStencilFunction(Hl.GREATER,255,255),r.drawElements(Eo.TRIANGLES,$.circleIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*$.circleIndexStart),B.triangleCount+=$.circleIndexCount/3)}}};const Mvt=1/65536;let Pdn=class extends Qx{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:r,renderPass:n,spriteMosaic:s,styleLayerUID:o}=e;let a=!1;for(const L of t)if(L.layerData.has(o)){const k=L.layerData.get(o);if(k.fillIndexCount>0||k.outlineIndexCount>0){a=!0;break}}if(!a)return;const l=e.styleLayer,u=l.getPaintProperty("fill-pattern"),c=u!==void 0,h=c&&u.isDataDriven;let p;if(c&&!h){const L=u.getValue(r);p=s.getMosaicItemPosition(L,!0)}const m=!c&&l.getPaintValue("fill-antialias",r);let v=!0,w=1;if(!c){const L=l.getPaintProperty("fill-color"),k=l.getPaintProperty("fill-opacity");if(!L?.isDataDriven&&!k?.isDataDriven){const B=l.getPaintValue("fill-color",r);w=l.getPaintValue("fill-opacity",r)*B[3],w>=1&&(v=!1)}}if(v&&n==="opaque")return;const S=l.getPaintValue("fill-translate",r),I=l.getPaintValue("fill-translate-anchor",r);(v||n!=="translucent")&&this._drawFill(e,o,l,t,S,I,c,p,h);const R=!l.hasDataDrivenOutlineColor&&l.outlineUsesFillColor&&w<1;m&&n!=="opaque"&&!R&&this._drawOutline(e,o,l,t,S,I)}_drawFill(e,t,r,n,s,o,a,l,u){if(a&&!u&&l==null)return;const{context:c,displayLevel:h,state:p,painter:m,pixelRatio:v,spriteMosaic:w,requestRender:S,allowDelayedRender:I}=e,R=r.fillMaterial,L=m.vectorTilesMaterialManager,k=v>Vjt?2:1,B=this._fillProgramOptions;B.pattern=a;const $=L.getMaterialProgram(c,R,B);if(I&&S!=null&&!$.compiled)return void S();if(c.useProgram($),l!=null){const{page:Y}=l,K=w.getPageSize(Y);K!=null&&(w.bind(c,Is.LINEAR,Y,yS),$.setUniform2fv("u_mosaicSize",K),$.setUniform1i("u_texture",yS))}$.setUniformMatrix3fv("u_displayMat3",o===mb.VIEWPORT?p.displayMat3:p.displayViewMat3),$.setUniform2fv("u_fillTranslation",s),$.setUniform1f("u_depth",r.z+Mvt);let V=-1;for(const Y of n){if(!Y.layerData.has(t))continue;Y.key.level!==V&&(V=Y.key.level,R.setDataUniforms($,h,r,V,w));const K=Y.layerData.get(t);if(!K.fillIndexCount)continue;K.prepareForRendering(c);const Q=K.fillVAO;if(Q!=null){if(c.bindVAO(Q),$.setUniformMatrix3fv("u_dvsMat3",Y.transforms.displayViewScreenMat3),c.setStencilFunction(Hl.EQUAL,Y.stencilRef,255),a){const re=Math.max(2**(Math.round(h)-Y.key.level),1),ne=Y.rangeX/(k*Y.width*re);$.setUniform1f("u_patternFactor",ne)}if(u){const re=K.patternMap;if(!re)continue;for(const[ne,de]of re){const pe=w.getPageSize(ne);pe!=null&&(w.bind(c,Is.LINEAR,ne,yS),$.setUniform2fv("u_mosaicSize",pe),$.setUniform1i("u_texture",yS),c.drawElements(Eo.TRIANGLES,de[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*de[0]))}}else c.drawElements(Eo.TRIANGLES,K.fillIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*K.fillIndexStart);Y.triangleCount+=K.fillIndexCount/3}}}_drawOutline(e,t,r,n,s,o){const{context:a,displayLevel:l,state:u,painter:c,pixelRatio:h,spriteMosaic:p,requestRender:m,allowDelayedRender:v}=e,w=r.outlineMaterial,S=c.vectorTilesMaterialManager,I=.75/h,R=this._outlineProgramOptions,L=S.getMaterialProgram(a,w,R);if(v&&m!=null&&!L.compiled)return void m();a.useProgram(L),L.setUniformMatrix3fv("u_displayMat3",o===mb.VIEWPORT?u.displayMat3:u.displayViewMat3),L.setUniform2fv("u_fillTranslation",s),L.setUniform1f("u_depth",r.z+Mvt),L.setUniform1f("u_outline_width",I);let k=-1;for(const B of n){if(!B.layerData.has(t))continue;B.key.level!==k&&(k=B.key.level,w.setDataUniforms(L,l,r,k,p));const $=B.layerData.get(t);if($.prepareForRendering(a),!$.outlineIndexCount)continue;const V=$.outlineVAO;V!=null&&(a.bindVAO(V),L.setUniformMatrix3fv("u_dvsMat3",B.transforms.displayViewScreenMat3),a.setStencilFunction(Hl.EQUAL,B.stencilRef,255),a.drawElements(Eo.TRIANGLES,$.outlineIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*$.outlineIndexStart),B.triangleCount+=$.outlineIndexCount/3)}}},Rdn=class extends Qx{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:r,displayLevel:n,state:s,painter:o,pixelRatio:a,spriteMosaic:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e;if(!t.some(re=>re.layerData.get(u)?.lineIndexCount??!1))return;const p=e.styleLayer,m=p.lineMaterial,v=o.vectorTilesMaterialManager,w=p.getPaintValue("line-translate",n),S=p.getPaintValue("line-translate-anchor",n),I=p.getPaintProperty("line-pattern"),R=I!==void 0,L=R&&I.isDataDriven;let k,B;if(R&&!L){const re=I.getValue(n);k=l.getMosaicItemPosition(re)}let $=!1;if(!R){const re=p.getPaintProperty("line-dasharray");if(B=re!==void 0,$=B&&re.isDataDriven,B&&!$){const ne=re.getValue(n),de=p.getDashKey(ne,p.getLayoutValue("line-cap",n));k=l.getMosaicItemPosition(de)}}const V=1/a,Y=this._programOptions;Y.pattern=R,Y.sdf=B;const K=v.getMaterialProgram(r,m,Y);if(h&&c!=null&&!K.compiled)return void c();if(r.useProgram(K),K.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),K.setUniformMatrix3fv("u_displayMat3",S===mb.VIEWPORT?s.displayMat3:s.displayViewMat3),K.setUniform2fv("u_lineTranslation",w),K.setUniform1f("u_depth",p.z),K.setUniform1f("u_antialiasing",V),k&&k!=null){const{page:re}=k,ne=l.getPageSize(re);ne!=null&&(l.bind(r,Is.LINEAR,re,yS),K.setUniform2fv("u_mosaicSize",ne),K.setUniform1i("u_texture",yS))}let Q=-1;for(const re of t){if(!re.layerData.has(u))continue;re.key.level!==Q&&(Q=re.key.level,m.setDataUniforms(K,n,p,Q,l));const ne=2**(n-Q)/a;K.setUniform1f("u_zoomFactor",ne);const de=re.layerData.get(u);if(!de.lineIndexCount)continue;de.prepareForRendering(r);const pe=de.vao;if(pe!=null){if(r.bindVAO(pe),K.setUniformMatrix3fv("u_dvsMat3",re.transforms.displayViewScreenMat3),r.setStencilFunction(Hl.EQUAL,re.stencilRef,255),L||$){const H=de.patternMap;if(!H)continue;for(const[Z,ae]of H){const fe=l.getPageSize(Z);fe!=null&&(l.bind(r,Is.LINEAR,Z,yS),K.setUniform2fv("u_mosaicSize",fe),K.setUniform1i("u_texture",yS),r.drawElements(Eo.TRIANGLES,ae[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*ae[0]))}}else r.drawElements(Eo.TRIANGLES,de.lineIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*de.lineIndexStart);re.triangleCount+=de.lineIndexCount/3}}}};const Ddn=256/360,Fdn=1/Math.LN2;function kdn(i,e){return(i%=e)>=0?i:i+e}function Ovt(i){return kdn(i*Ddn,256)}function Pvt(i){return Math.log(i)*Fdn}const Ldn=1/65536;let Ndn=class extends Qx{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=NW()}dispose(){}drawMany(e,t){const r=e.styleLayer;this._drawIcons(e,r,t),this._drawText(e,r,t)}_drawIcons(e,t,r){const{context:n,displayLevel:s,painter:o,spriteMosaic:a,state:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e,p=t.iconMaterial,m=o.vectorTilesMaterialManager;let v,w=!1;for(const K of r)if(K.layerData.has(u)&&(v=K.layerData.get(u),v.iconPerPageElementsMap.size>0)){w=!0;break}if(!w)return;const S=t.getPaintValue("icon-translate",s),I=t.getPaintValue("icon-translate-anchor",s);let R=t.getLayoutValue("icon-rotation-alignment",s);R===sc.AUTO&&(R=t.getLayoutValue("symbol-placement",s)===YP.POINT?sc.VIEWPORT:sc.MAP);const L=R===sc.MAP,k=t.getLayoutValue("icon-keep-upright",s)&&L,B=v.isIconSDF,$=this._iconProgramOptions;$.sdf=B;const V=m.getMaterialProgram(n,p,$);if(h&&c!=null&&!V.compiled)return void c();n.useProgram(V),V.setUniformMatrix3fv("u_displayViewMat3",R===sc.MAP?l.displayViewMat3:l.displayMat3),V.setUniformMatrix3fv("u_displayMat3",I===mb.VIEWPORT?l.displayMat3:l.displayViewMat3),V.setUniform2fv("u_iconTranslation",S),V.setUniform1f("u_depth",t.z),V.setUniform1f("u_mapRotation",Ovt(l.rotation)),V.setUniform1f("u_keepUpright",k?1:0),V.setUniform1f("u_level",10*s),V.setUniform1i("u_texture",yS),V.setUniform1f("u_fadeDuration",Dq/1e3);let Y=-1;for(const K of r){if(!K.layerData.has(u)||(K.key.level!==Y&&(Y=K.key.level,p.setDataUniforms(V,s,t,Y,a)),v=K.layerData.get(u),v.iconPerPageElementsMap.size===0))continue;v.prepareForRendering(n),v.updateOpacityInfo();const Q=v.iconVAO;if(Q!=null){n.bindVAO(Q),V.setUniformMatrix3fv("u_dvsMat3",K.transforms.displayViewScreenMat3),V.setUniform1f("u_time",(performance.now()-v.lastOpacityUpdate)/1e3);for(const[re,ne]of v.iconPerPageElementsMap)this._renderIconRange(e,V,ne,re,K)}}}_renderIconRange(e,t,r,n,s){const{context:o,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(o,Is.LINEAR,n,yS),this._setStencilState(e,s),o.drawElements(Eo.TRIANGLES,r[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]),s.triangleCount+=r[1]/3}_drawText(e,t,r){const{context:n,displayLevel:s,glyphMosaic:o,painter:a,pixelRatio:l,spriteMosaic:u,state:c,styleLayerUID:h,requestRender:p,allowDelayedRender:m}=e,v=t.textMaterial,w=a.vectorTilesMaterialManager;let S,I=!1;for(const fe of r)if(fe.layerData.has(h)&&(S=fe.layerData.get(h),S.glyphPerPageElementsMap.size>0)){I=!0;break}if(!I)return;const R=t.getPaintProperty("text-opacity");if(R&&!R.isDataDriven&&R.getValue(s)===0)return;const L=t.getPaintProperty("text-color"),k=!L||L.isDataDriven||L.getValue(s)[3]>0,B=t.getPaintProperty("text-halo-width"),$=t.getPaintProperty("text-halo-color"),V=(!B||B.isDataDriven||B.getValue(s)>0)&&(!$||$.isDataDriven||$.getValue(s)[3]>0);if(!k&&!V)return;const Y=24/8;let K=t.getLayoutValue("text-rotation-alignment",s);K===sc.AUTO&&(K=t.getLayoutValue("symbol-placement",s)===YP.POINT?sc.VIEWPORT:sc.MAP);const Q=K===sc.MAP,re=t.getLayoutValue("text-keep-upright",s)&&Q,ne=.8*Y/l;this._glyphTextureSize||(this._glyphTextureSize=Xp(o.width/4,o.height/4));const de=t.getPaintValue("text-translate",s),pe=t.getPaintValue("text-translate-anchor",s),H=this._sdfProgramOptions,Z=w.getMaterialProgram(n,v,H);if(m&&p!=null&&!Z.compiled)return void p();n.useProgram(Z),Z.setUniformMatrix3fv("u_displayViewMat3",K===sc.MAP?c.displayViewMat3:c.displayMat3),Z.setUniformMatrix3fv("u_displayMat3",pe===mb.VIEWPORT?c.displayMat3:c.displayViewMat3),Z.setUniform2fv("u_textTranslation",de),Z.setUniform1f("u_depth",t.z+Ldn),Z.setUniform2fv("u_mosaicSize",this._glyphTextureSize),Z.setUniform1f("u_mapRotation",Ovt(c.rotation)),Z.setUniform1f("u_keepUpright",re?1:0),Z.setUniform1f("u_level",10*s),Z.setUniform1i("u_texture",cft),Z.setUniform1f("u_antialiasingWidth",ne),Z.setUniform1f("u_fadeDuration",Dq/1e3);let ae=-1;for(const fe of r){if(!fe.layerData.has(h)||(fe.key.level!==ae&&(ae=fe.key.level,v.setDataUniforms(Z,s,t,ae,u)),S=fe.layerData.get(h),S.glyphPerPageElementsMap.size===0))continue;S.prepareForRendering(n),S.updateOpacityInfo();const be=S.textVAO;if(be==null)continue;n.bindVAO(be),Z.setUniformMatrix3fv("u_dvsMat3",fe.transforms.displayViewScreenMat3),this._setStencilState(e,fe);const _e=(performance.now()-S.lastOpacityUpdate)/1e3;Z.setUniform1f("u_time",_e),S.glyphPerPageElementsMap.forEach((Ie,Te)=>{this._renderGlyphRange(n,Ie,Te,o,Z,V,k,fe)})}}_renderGlyphRange(e,t,r,n,s,o,a,l){n.bind(e,Is.LINEAR,r,cft),o&&(s.setUniform1f("u_halo",1),e.drawElements(Eo.TRIANGLES,t[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3),a&&(s.setUniform1f("u_halo",0),e.drawElements(Eo.TRIANGLES,t[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:r,is3D:n,stencilSymbols:s}=e;if(r.setStencilTestEnabled(!0),s)return r.setStencilWriteMask(255),void r.setStencilFunction(Hl.ALWAYS,t.stencilRef,255);r.setStencilWriteMask(0),n?r.setStencilFunction(Hl.EQUAL,t.stencilRef,255):r.setStencilFunction(Hl.GREATER,255,255)}};const Lq={clip:cdn,stencil:Xqt,bitmap:Khn,overlay:ddn,tileDebugInfo:tYt,vtlBackground:Mdn,vtlFill:Pdn,vtlLine:Rdn,vtlCircle:Odn,vtlSymbol:Ndn},$dn={background:{"background.frag":`#ifdef PATTERN +}`}};function ndn(i){return function(e){let t=i;return e.split("/").forEach(r=>{t&&(t=t[r])}),t}}const sdn=new kKe(ndn(rdn));function Rm(i){return sdn.resolveIncludes(i)}const voe={shaders:{vertexShader:Rm("background/background.vert"),fragmentShader:Rm("background/background.frag")},attributes:new Map([["a_pos",0]])},odn=()=>xCe("clip",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.SHORT}]});let adn=class extends Qx{constructor(){super(...arguments),this._color=tM(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:e}){e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setFaceCullingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(Wl.ALWAYS,0,255)}draw(e,t){const{context:r,state:n,requestRender:s,allowDelayedRender:o}=e,a=odn(),l=t.getVAO(r,n,a.attributes,a.bufferLayouts);l.indexBuffer!=null&&(this._program||(this._program=R3(r,voe)),!o||s==null||this._program.compiled?(r.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",n.displayMat3),r.bindVAO(l),r.drawElements(Eo.TRIANGLES,l.indexBuffer.size,Ti.UNSIGNED_INT,0),r.bindVAO()):s())}};const ldn=()=>xCe("overlay",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.FLOAT}],tex:[{location:1,name:"a_uv",count:2,type:Ti.UNSIGNED_SHORT}]});let udn=class extends Qx{constructor(){super(...arguments),this._desc={vsPath:"overlay/overlay",fsPath:"overlay/overlay",attributes:new Map([["a_pos",0],["a_uv",1]])}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(Wl.GREATER,255,255)}draw(e,t){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;if(!t.isReady)return;const{computedOpacity:a,dvsMat3:l,isWrapAround:u,perspectiveTransform:c,texture:h}=t;e.timeline.begin(this.name);const p=n.materialManager.getProgram(this._desc);if(o&&s!=null&&!p.compiled)return void s();const m=ldn(),v=t.getVAO(r,m.bufferLayouts,m.attributes);if(!v)return;r.bindVAO(v),r.useProgram(p),r.bindTexture(h,gbe),p.setUniformMatrix3fv("u_dvsMat3",l),p.setUniform1i("u_texture",gbe),p.setUniform1f("u_opacity",a),p.setUniform2fv("u_perspective",c);const w=u?10:4;r.drawArrays(Eo.TRIANGLE_STRIP,0,w),r.bindVAO(),e.timeline.end(this.name)}};const v7e={geometry:[new Hl("a_pos",2,Ti.BYTE,0,2)]},cdn={geometry:[new Hl("a_pos",2,Ti.BYTE,0,4),new Hl("a_tex",2,Ti.BYTE,2,4)]},Yqt={geometry:[new Hl("a_pos",2,Ti.UNSIGNED_SHORT,0,4)]};let Xqt=class extends Qx{constructor(){super(...arguments),this._color=tM(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:e}){e.setDepthWriteEnabled(!1),e.setDepthTestEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),e.setStencilWriteMask(255)}draw(e,t){const{context:r,requestRender:n,allowDelayedRender:s}=e;this._initialized||this._initialize(r),!s||n==null||this._solidProgram.compiled?(r.setStencilFunctionSeparate(W1.FRONT_AND_BACK,Wl.GREATER,t.stencilRef,255),r.bindVAO(this._solidVertexArrayObject),r.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3),this._solidProgram.setUniform2fv("u_coord_range",[t.rangeX,t.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),r.drawArrays(Eo.TRIANGLE_STRIP,0,4),r.bindVAO()):n()}_initialize(e){if(this._initialized)return!0;const t=R3(e,voe);if(!t)return!1;const r=new Int8Array([0,0,1,0,0,1,1,1]),n=Aa.createVertex(e,oa.STATIC_DRAW,r),s=new wh(e,voe.attributes,v7e,{geometry:n});return this._solidProgram=t,this._solidVertexArrayObject=s,this._initialized=!0,!0}},gX=class extends eM{constructor(e,t,r,n,s,o,a=s,l=o){super(),this.tileDebugInfoTexture=null,this.debugInfo={display:{length:0,minOrderedLength:0,minUnorderedLength:0,triangleCount:0},memory:{bytesUsed:0,bytesReserved:0}},this._destroyed=!1,this.key=new Tc(e),this.resolution=t,this.x=r,this.y=n,this.width=s,this.height=o,this.rangeX=a,this.rangeY=l}destroy(){this.tileDebugInfoTexture&&(this.tileDebugInfoTexture.dispose(),this.tileDebugInfoTexture=null),this._destroyed=!0}get debugSlot(){let e=this;for(;e.parent!==this._stage;){if(!e.parent)return 0;e=e.parent}return this._stage.children.indexOf(e)}setTransform(e){const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*t,a=this.height/this.rangeY*t;pB(r,o,0,0,0,a,0,n,s,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}get destroyed(){return this._destroyed}},hdn=class extends gX{constructor(e,t,r,n){super(e,t,r,n,xo,xo)}destroy(){super.destroy()}setTransform(e){const t=this.resolution/e.resolution,r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*t,a=this.height/this.rangeY*t;pB(r,o,0,0,0,a,0,n,s,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r);const l=this.transforms.labelMat2d,u=window.devicePixelRatio,c=B4t(SS(),o*u,0,0,a*u,n*u,s*u);FW(l,e.viewMat2d,c)}_createTransforms(){return{labelMat2d:SS(),tileMat3:Cc(),displayViewScreenMat3:Cc()}}},xA=class Jqt{constructor(e){if(this.next=null,!Array.isArray(e))return void(this.data=e);this.data=e[0];let t=this;for(let r=1;re(t.data)?this:t;return this.next?this.next.max(e,r):r}remove(e,t=null){return this===e?t?(t.next=this.next,t):this.next:this.next?.remove(e,this)??null}get last(){return this.next?this.next.last:this}},Kqt=class{constructor(e){this._head=null,e!=null&&(this._head=new xA(e))}get head(){return this._head}maxAvailableSpace(){if(this._head==null)return 0;const e=this._head.max(t=>t.end-t.start);return e.data.end-e.data.start}firstFit(e){if(this._head==null)return null;let t=null,r=this._head;for(;r;){const n=r.data.end-r.data.start;if(n===e)return t?t.next=r.next:this._head=r.next,r.data.start;if(n>e){const s=r.data.start;return r.data.start+=e,s}t=r,r=r.next}return null}free(e,t){const r=e+t;if(this._head==null){const a=new xA({start:e,end:r});return void(this._head=a)}if(r<=this._head.data.start){if(r===this._head.data.start)return void(this._head.data.start-=t);const a=new xA({start:e,end:r});return a.next=this._head,void(this._head=a)}let n=this._head,s=n.next;for(;s;){if(s.data.start>=r){if(n.data.end===e){if(n.data.end+=t,n.data.end===s.data.start){const l=s.data.end-s.data.start;return n.data.end+=l,void(n.next=s.next)}return}if(s.data.start===r)return void(s.data.start-=t);const a=new xA({start:e,end:r});return a.next=n.next,void(n.next=a)}n=s,s=s.next}if(e===n.data.end)return void(n.data.end+=t);const o=new xA({start:e,end:r});n.next=o}clear(){this._head=null}};function ddn(i,e){return i<<16|255&e}function pdn(i){return 255&i}let DK=class{constructor(e,t,r,n,s){this.instance=e,this.materialKey=t,this.target=r,this.start=n,this.count=s}get textureKey(){return pdn(this.materialKey)}get indexEnd(){return this.start+this.count}extend(e){this.count+=e}render(e){this.instance.techniqueRef.render(e,this)}},fdn=class Zqt{constructor(){this._length=0,this._minOrderedLength=0,this._materialKeys=new Set}static fromDisplayEntities(e,t,r,n){const s=new Zqt;for(const o of e.values())for(const a of o.records){const l=r.getInstance(a.instanceId),u=ddn(l.instanceId,a.textureKey);s.addRecord(l,u,a.indexStart,a.indexCount,a.vertexStart,a.vertexCount,t,n)}return s}get length(){return this._length}get minOrderedLength(){return this._minOrderedLength}get minUnorderedLength(){return this._materialKeys.size}render(e){const{drawPhase:t}=e;for(const r of this.infos())r.instance.techniqueRef.drawPhase&t&&r.render(e)}addRecord(e,t,r,n,s,o,a,l){let u=r,c=n;if(c||(u=s,c=o),!c)return;if(this._head==null){const w=new DK(e,t,a,u,c);return this._head=new xA(w),this._tail=this._head,this._length++,void this._minOrderedLength++}if(l===OR.STRICT_ORDER)return this._insert(e,t,a,u,c,this._tail,null);let h=null,p=this._head;const m=e.instanceId,v=e.techniqueRef.symbologyPlane;if(l===OR.STRICT_MARKERS_AND_TEXT&&(v===TE.MARKER||v===TE.TEXT))return this._insert(e,t,a,u,c,this._tail,null);for(;p;){const w=p.data.instance,S=w.instanceId,I=w.techniqueRef.symbologyPlane,R=h?.data.instance.instanceId;if(v=1){const n=this.index.operations[this.index.operations.length-1];n.srcFrom+n.count===e.indexStart&&(n.count+=e.indexCount,r=!0)}r||this.index.operations.push({srcFrom:e.indexStart,dstFrom:this.index.count,count:e.indexCount,mutate:t}),e.indexStart=this.index.count,this.index.count+=e.indexCount}};const wvt=yi("esri-2d-log-allocations");let xvt=class Qqt{static create(e,t){const r=t.acquireUint32Array(e);return new Qqt(r,t)}constructor(e,t){this._array=e,this._pool=t}get array(){return this._array}get length(){return this._array.length}getUint32View(e,t){return new Uint32Array(this._array.buffer,e+this._array.byteOffset,t)}expand(e){if(e<=this._array.byteLength)return;const t=this._pool.acquireUint32Array(e);t.set(this._array),this._pool.releaseUint32Array(this._array),this._array=t}destroy(){this._pool.releaseUint32Array(this._array)}},tRe=class eYt{constructor(){this._data=new ArrayBuffer(eYt.BYTE_LENGTH),this._freeList=new Kqt({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 16e6}get buffer(){return this._data}acquireUint32Array(e){const t=this._freeList.firstFit(e);return t==null?null:new Uint32Array(this._data,t,e/Uint32Array.BYTES_PER_ELEMENT)}releaseUint32Array(e){this._freeList.free(e.byteOffset,e.byteLength)}},gdn=class{constructor(){this._pages=[],this._pagesByBuffer=new Map,this._bytesAllocated=0}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*tRe.BYTE_LENGTH}acquireUint32Array(e){if(this._bytesAllocated+=e,wvt&&console.log(`Allocating ${e}, (${this._bytesAllocated} / ${this._bytesTotal})`),e>=tRe.BYTE_LENGTH)return new Uint32Array(e/Uint32Array.BYTES_PER_ELEMENT);for(const r of this._pages){const n=r.acquireUint32Array(e);if(n!=null)return n}const t=this._addPage().acquireUint32Array(e);return Of(t,"Expected to allocate page"),t}releaseUint32Array(e){this._bytesAllocated-=e.byteLength,wvt&&console.log(`Freeing ${e.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const t=this._pagesByBuffer.get(e.buffer);t&&t.releaseUint32Array(e)}_addPage(){const e=new tRe;return this._pages.push(e),this._pagesByBuffer.set(e.buffer,e),e}};const ydn=1.25,Svt=32767,vdn=Svt<<16|Svt;let Tvt=class{constructor(e,t,r,n){this._pool=n;const s=xvt.create(t*r*Uint32Array.BYTES_PER_ELEMENT,this._pool);this.size=t,this.strideInt=r,this.bufferType=e,this.dirty={start:1/0,end:0},this.memoryStats={bytesUsed:0,bytesReserved:t*r*Uint32Array.BYTES_PER_ELEMENT},this._gpu=null,this._cpu=s,this.clear()}get elementSize(){return this._cpu.length/this.strideInt}get intSize(){return this.fillPointer*this.strideInt}get byteSize(){return this.intSize*Uint32Array.BYTES_PER_ELEMENT}get invalidated(){return this.bufferSize>0&&!this._gpu}get invalidatedComputeBuffer(){return this.bufferSize>0&&!this._gpuComputeTriangles}invalidate(){this._invalidateTriangleBuffer(),this._gpu?.dispose(),this._gpu=null}_invalidateTriangleBuffer(){this._gpuComputeTriangles?.dispose(),this._gpuComputeTriangles=null}destroy(){this._gpu?.dispose(),this._gpuComputeTriangles?.dispose(),this._cpu?.destroy()}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new Kqt({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(e){if(!(this.maxAvailableSpace()>=e)&&e*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const t=this._cpu.length/this.strideInt,r=Math.round((t+e)*ydn),n=r*this.strideInt;this._cpu.expand(n*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(t,r-t),this.memoryStats.bytesReserved+=(r-t)*this.strideInt*Uint32Array.BYTES_PER_ELEMENT}}set(e,t){this._cpu.array[e]!==t&&(this._cpu.array[e]=t,this.dirty.start=Math.min(e,this.dirty.start),this.dirty.end=Math.max(e+1,this.dirty.end))}getGPUBuffer(e,t=!1){if(!this.bufferSize)return null;if(t){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return this._gpuComputeTriangles==null&&(this._gpuComputeTriangles=this._createComputeBuffer(e)),this._gpuComputeTriangles}return this._gpu==null&&(this._gpu=this._createBuffer(e)),this._gpu}getView(e,t){return this._cpu.getUint32View(e,t/Uint32Array.BYTES_PER_ELEMENT)}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(e,t,r,n){const s=r*this.strideInt;if(!s)return 0;const o=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(e,o,s),l=this.freeList.firstFit(r);Of(l,"First fit region must be defined");const u=l*this.strideInt,c=s;if(this._cpu.array.set(a,u),n!==0)for(let h=0;hn,o=this._cpu,a=xvt.create(n,this._pool);s||a.array.set(this._cpu.getUint32View(0,this.intSize));for(const l of t)if(s||l.srcFrom!==l.dstFrom||l.mutate!==0){this.dirty.start=Math.min(this.dirty.start,l.dstFrom*this.strideInt),this.dirty.end=Math.max(this.dirty.end,(l.dstFrom+l.count)*this.strideInt);for(let u=0;ut.locations.has(u.name));if(!r)return{attributes:s,hash:this._layout.hash,stride:this._layout.stride};const o=Object.values(n).flat().join("-");if(this._computeLayouts.has(o))return this._computeLayouts.get(o);const a=this._layout.stride;for(const{name:u,count:c,type:h,normalized:p,offset:m,packPrecisionFactor:v}of this._layout.attributes){const w=n[u];w!=null&&w.length===2&&(s.push({name:w[0],count:c,type:h,normalized:p,offset:m+a,packPrecisionFactor:v}),s.push({name:w[1],count:c,type:h,normalized:p,offset:m+2*a,packPrecisionFactor:v}))}const l={attributes:s,stride:a,hash:wle(s)};return this._computeLayouts.set(o,l),l}getDrawArgs(e,t,r,n){return n?{primitive:Eo.POINTS,count:t/3,offset:r/3}:{primitive:e,count:t,offset:r}}getDebugVertexInfo(e){if(!this._vertexBuffer)return null;const t=this.getLayout(e);if(t==null)return null;const r=t.stride,n=this._vertexBuffer.getView(0,this._vertexBuffer.byteSize),s=new DataView(n.slice().buffer);let o=n.byteLength/r;e.useComputeBuffer&&(o=this._indexBuffer.fillPointer/3);const a=this._indexBuffer.getView(0,this._indexBuffer.byteSize);let l=0;const u=[];for(let c=0;cs.name==="pos"||s.name==="position"),!this._position)throw new Error("InternalError: Unable to find position attribute");this._indexBuffer=new Tvt("index",Math.max(t,Cvt),1,this._bufferPool),this._vertexBuffer=new Tvt("vertex",Math.max(r,Cvt),n,this._bufferPool)}}append(e){const t=e.layout.stride,r=e.indices.byteLength/Uint32Array.BYTES_PER_ELEMENT,n=e.vertices.byteLength/t;this._ensure(e.layout,r,n);const{vertices:s,indices:o}=e,a=this._vertexBuffer.insert(s,0,s.byteLength/t,0);return{vertexFrom:a,indexFrom:this._indexBuffer.insert(o,0,o.byteLength/4,a)}}copyRecordFrom(e,t,r,n){const{indexStart:s,indexCount:o,vertexStart:a,vertexCount:l}=t;this._ensure(e._layout,o,l);const u=e._position,c=r*(u.packPrecisionFactor??1),h=n*(u.packPrecisionFactor??1),p=u.offset,m=cv(c,h),v=this._vertexBuffer.copyFrom(e._vertexBuffer,a,l,m,p),w=this._indexBuffer.copyFrom(e._indexBuffer,s,o,v-a,0),S=t.clone();return S.vertexStart=v,S.indexStart=w,S.overlaps=0,S}remove(e,t,r,n){this._indexBuffer.free(e,t),this._vertexBuffer.free(r,n)}upload(){this._invalidated=!0}getVAO(e,t,r){if(!this._vertexBuffer||!this._indexBuffer||!this._vertexBuffer.bufferSize)return null;const n=r?.useComputeBuffer?bdn:_dn;let s=this._vaos.get(n);if(this._invalidated||r?.useComputeBuffer){(this._vertexBuffer.invalidated||this._indexBuffer.invalidated||r?.useComputeBuffer&&this._indexBuffer.invalidatedComputeBuffer)&&(this._vertexBuffer.invalidate(),this._indexBuffer.invalidate(),s?.disposeVAOOnly(),s=null),this._vertexBuffer.upload(),this._indexBuffer.upload();const o=this._indexBuffer.getGPUBuffer(e,n===1),a=this._vertexBuffer.getGPUBuffer(e);s||(s=new wh(e,t.locations,this._getVertexAttributeLayout(this.getLayout(r)),{geometry:a},o),this._vaos.set(n,s)),this._invalidated=!1}return s}get memoryStats(){return{bytesUsed:this._vertexBuffer.memoryStats.bytesUsed+this._indexBuffer.memoryStats.bytesUsed,bytesReserved:this._vertexBuffer.memoryStats.bytesReserved+this._indexBuffer.memoryStats.bytesReserved,vertex:this._vertexBuffer.memoryStats,index:this._indexBuffer.memoryStats}}reshuffle(e){this._vertexBuffer&&this._vertexBuffer.reshuffle(e.vertex.count,e.vertex.operations),this._indexBuffer&&this._indexBuffer.reshuffle(e.index.count,e.index.operations)}},Gye=class{constructor(e){this._pos=0,this._buffer=e,this._i32View=new Int32Array(this._buffer),this._f32View=new Float32Array(this._buffer)}readInt32(){return this._i32View[this._pos++]}readF32(){return this._f32View[this._pos++]}};function Evt(i){return i?{entities:hH(new Gye(i.entities),dH),vertexData:i.data.map(xdn)}:null}function xdn(i){const e=i.layout.stride,t=new DataView(i.vertices),r=[],n=i.vertices.byteLength/e;let s=0;for(let o=0;odi.getLogger("esri.views.2d.engine.webgl.FeatureTile");let Tdn=0,BKe=class extends hdn{constructor(e,t,r,n,s=!1){super(e,t,r,n),this._meshes=new Map,this._entities=[],this._invalidated=!1,this._nextUploadAllowed=!1,this.tileAge=Tdn++,this._metrics=[],this._entityIds=new Set,this._entityIdsFromBuffer=new Set,this._attributeEpoch=0,this._encounteredEnd=!1,this.visible=!0,this.transforms.labelMat2d=SS(),this.enableDeferredUploads=s}destroy(){super.destroy(),this.clear()}clear(){for(const e of this._meshes.values())e.destroy();this._meshes.clear(),this._entities=[],this._metrics=[],this._displayList=null,this._invalidated=!0,this._entityIds.clear(),this._nextUploadAllowed=!0}beforeRender(e){super.beforeRender(e),this._needsReshuffle&&e.reshuffleManager.schedule(this)}tryReady(e){const t=this._invalidated&&!this._uploadAllowed;return!(this._isReady||t||!this._encounteredEnd||!(e>=this._attributeEpoch))&&(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.ready [epoch=${e}]`),this.ready(),this.requestRender(),!0)}get labelMetrics(){return this._metrics}get hasData(){return!!this._meshes.size}get needsUpload(){return this._invalidated}get _uploadAllowed(){return!this.enableDeferredUploads||this._nextUploadAllowed}upload(){this._nextUploadAllowed=!0}getDisplayList(e,t,r=OR.BATCHING){if(this._uploadAllowed&&this._invalidated){this._entities.sort((n,s)=>{const o=s.sortKey,a=n.sortKey;return a===o?n.id-s.id:a-o}),r===OR.BATCHING&&this.reshuffle(!0),this._displayList=fdn.fromDisplayEntities(this._entities,this,t,r);for(const n of this._meshes.values())n.upload();this.debugInfo.display.length=this._displayList.length,this.debugInfo.display.minOrderedLength=this._displayList.minOrderedLength,this.debugInfo.display.minUnorderedLength=this._displayList.minUnorderedLength,this.requestRender(),this._invalidated=!1,this._nextUploadAllowed=!1}return this._displayList}getMesh(e){if(!this._meshes.has(e))throw new Error(`InternalError: Unable to find VAO for instance: ${e}`);return this._meshes.get(e)}getSortKeys(e){const t=new Map;for(const{id:r,sortKey:n}of this._entities)if(e.has(r)&&t.set(r,n),t.size===e.size)break;return t}onMessage(e){switch(e.type){case"append":this._onAppendMessage(e);break;case"update":this._onUpdateMessage(e)}if(this._aggregateMemoryStats(),this.requestRender(),e.end){if(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.end [epoch=${e.attributeEpoch}]`),!e.attributeEpoch)throw new Error("InternalError: Attribute epoch not defined.");this._attributeEpoch=e.attributeEpoch,this._encounteredEnd=!0}}_onAppendMessage(e){if(yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.append`,{append:Evt(e?.append)}),e.clear&&this.clear(),!e.append)return;const t=hH(new Gye(e.append.entities),dH);this._insert(t,e.append.data,!1)}_onUpdateMessage(e){yi("esri-2d-update-debug")&&console.debug(`Tile[${this.key.id}] FeatureTile.update`,{isPixelBuffer:e.isPixelBuffer,modify:Evt(e.modify),remove:e.remove});const t=hH(new Gye(e.modify.entities),dH),r=t.map(o=>o.id),n=e.isPixelBuffer??!1,s=[...e.remove,...r];n?this._removeByIdsFromBuffer(s):this._removeByIds(s),this._insert(t,e.modify.data,n)}reshuffle(e=!1){if(this.destroyed)return;const t=new Map;for(const r of this._entities)for(const n of r.records){const s=this._meshes.get(n.instanceId);let o=t.get(s);o||(o=new mdn(e),t.set(s,o)),o.copyRecord(n)}for(const[r,n]of t)r.reshuffle(n);this._invalidated=!0,this._aggregateMemoryStats(),yi("esri-2d-update-debug")&&Sdn().info(`Tile ${this.key.id} was reshuffled.`)}copyPixelBufferedEntitesFrom(e,t,r,n){const s=r*xo,o=n*xo;for(const a of e._entities){let l=null;for(const u of a.records)if(u.overlaps&t){const c=this._ensureMesh(u.instanceId),h=e.getMesh(u.instanceId),p=c.copyRecordFrom(h,u,s,o);l||(l=new dH(a.id,a.sortKey),this._entityIdsFromBuffer.add(a.id),this._entities.push(l)),l.records.push(p)}}this._invalidated=!0}_ensureMesh(e){return this._meshes.has(e)||this._meshes.set(e,new wdn(this._stage.bufferPool)),this._meshes.get(e)}_insert(e,t,r){if(!e.length)return;this._removeDuplicatedBufferedEntites(e);const n=this._insertVertexData(t);for(const s of e){for(const o of s.records)o.updateBaseOffsets(n.get(o.instanceId));r?this._tryInsertBufferedEntity(s):this._insertEntity(s)}this._invalidated=!0}_insertVertexData(e){const t=new Map;for(const r of e){const{instanceId:n}=r,s=this._ensureMesh(n).append(r);if(r.metrics){const o=hH(new Gye(r.metrics),Hee)??[];this._metrics.push(...o)}t.set(n,s)}return t}_insertEntity(e){yi("esri-2d-update-debug")&&this._entityIds.has(e.id)&&console.error(`Tile ${this.key.id} insertEnitty: Already have entityId ${e.id}`),this._entityIds.add(e.id),this._entities.push(e)}_tryInsertBufferedEntity(e){this._entityIds.has(e.id)?this._removeRecordsFromMesh(e.records):(this._entityIdsFromBuffer.add(e.id),this._entities.push(e))}_removeDuplicatedBufferedEntites(e){if(!this._entityIdsFromBuffer.size)return;const t=[];for(const r of e)this._entityIdsFromBuffer.has(r.id)&&t.push(r.id);this._removeByIds(t)}_removeByIdsFromBuffer(e){this._removeByIds(e.filter(t=>this._entityIdsFromBuffer.has(t)))}_removeByIds(e){if(e.length===0)return;const t=new Set(e),r=[];for(const n of this._entities)t.has(n.id)?this._remove(n):r.push(n);this._entities=r,this._invalidated=!0}_remove(e){this._removeRecordsFromMesh(e.records),this._entityIds.delete(e.id),this._entityIdsFromBuffer.delete(e.id)}_removeRecordsFromMesh(e){for(const t of e){const{instanceId:r,indexStart:n,indexCount:s,vertexStart:o,vertexCount:a}=t;this._meshes.get(r)?.remove(n,s,o,a)}}_aggregateMemoryStats(){this.debugInfo.memory.bytesUsed=0,this.debugInfo.memory.bytesReserved=0;for(const[e,t]of this._meshes)this.debugInfo.memory.bytesUsed+=t.memoryStats.bytesUsed,this.debugInfo.memory.bytesReserved+=t.memoryStats.bytesReserved}get _needsReshuffle(){if(this.destroyed)return!1;const{bytesUsed:e,bytesReserved:t}=this.debugInfo.memory,r=e/t,{minOrderedLength:n,length:s}=this.debugInfo.display;return t>aHr&&ruHr&&n/s0){const v=`Length: ${l}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(u){const v=`Min ordered length: ${u}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(c){const v=`Min unordered length: ${c}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}if(h>0){h>1e5&&(r.fillStyle="red",r.strokeStyle="white");const v=`Triangle count: ${h}`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}const{bytesUsed:p,bytesReserved:m}=a.memory;if(r.fillStyle="white",r.strokeStyle="black",p>0||m>0){const v=`Memory usage: ${p} of ${m} bytes`;r.strokeText(v,V_,s),r.fillText(v,V_,s),s+=lN}}return t.tileDebugInfoTexture.setData(r.canvas),t.tileDebugInfoTexture}},Edn=class extends Qx{constructor(){super(...arguments),this._color=tM(1,0,0,1),this._patternMatrix=Cc(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,t){const{context:r,painter:n,requestRender:s,allowDelayedRender:o}=e;this._loadWGLResources(e);const a=e.displayLevel,l=e.styleLayer,u=l.backgroundMaterial,c=n.vectorTilesMaterialManager,h=l.getPaintValue("background-color",a),p=l.getPaintValue("background-opacity",a),m=l.getPaintValue("background-pattern",a),v=m!==void 0,w=1|window.devicePixelRatio,S=e.spriteMosaic;let I,R;const L=w>Vjt?2:1,k=this._programOptions;k.pattern=v;const B=c.getMaterialProgram(r,u,k);if(!o||s==null||B.compiled){if(r.bindVAO(this._vao),r.useProgram(B),v){const $=S.getMosaicItemPosition(m,!0);if($!=null){const{tl:V,br:Y,page:K}=$;I=Y[0]-V[0],R=Y[1]-V[1];const Q=S.getPageSize(K);Q!=null&&(S.bind(r,Is.LINEAR,K,yS),B.setUniform4f("u_tlbr",V[0],V[1],Y[0],Y[1]),B.setUniform2fv("u_mosaicSize",Q),B.setUniform1i("u_texture",yS))}B.setUniform1f("u_opacity",p)}else{const $=h[3]*p;this._color[0]=$*h[0],this._color[1]=$*h[1],this._color[2]=$*h[2],this._color[3]=$,B.setUniform4fv("u_color",this._color)}B.setUniform1f("u_depth",l.z||0);for(const $ of t){if(B.setUniform1f("u_coord_range",$.rangeX),B.setUniformMatrix3fv("u_dvsMat3",$.transforms.displayViewScreenMat3),v){const V=Math.max(2**(Math.round(a)-$.key.level),1),Y=L*$.width*V,K=Y/x5e(I),Q=Y/x5e(R);this._patternMatrix[0]=K,this._patternMatrix[4]=Q,B.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}r.setStencilFunction(Wl.EQUAL,0,255),r.drawArrays(Eo.TRIANGLE_STRIP,0,4)}}else s()}_loadWGLResources(e){if(this._vao)return;const{context:t,styleLayer:r}=e,n=r.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),o=Aa.createVertex(t,oa.STATIC_DRAW,s),a=new wh(t,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:o});this._vao=a}},Idn=class extends Qx{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,t){const{context:r,displayLevel:n,requiredLevel:s,state:o,painter:a,spriteMosaic:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e;if(!t.some(B=>B.layerData.get(u)?.circleIndexCount??!1))return;const p=e.styleLayer,m=p.circleMaterial,v=a.vectorTilesMaterialManager,w=1.2,S=p.getPaintValue("circle-translate",n),I=p.getPaintValue("circle-translate-anchor",n),R=this._programOptions,L=v.getMaterialProgram(r,m,R);if(h&&c!=null&&!L.compiled)return void c();r.useProgram(L),L.setUniformMatrix3fv("u_displayMat3",I===mb.VIEWPORT?o.displayMat3:o.displayViewMat3),L.setUniform2fv("u_circleTranslation",S),L.setUniform1f("u_depth",p.z),L.setUniform1f("u_antialiasingWidth",w);let k=-1;for(const B of t){if(!B.layerData.has(u))continue;B.key.level!==k&&(k=B.key.level,m.setDataUniforms(L,n,p,k,l));const $=B.layerData.get(u);if(!$.circleIndexCount)continue;$.prepareForRendering(r);const V=$.vao;V!=null&&(r.bindVAO(V),L.setUniformMatrix3fv("u_dvsMat3",B.transforms.displayViewScreenMat3),s!==B.key.level?r.setStencilFunction(Wl.EQUAL,B.stencilRef,255):r.setStencilFunction(Wl.GREATER,255,255),r.drawElements(Eo.TRIANGLES,$.circleIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*$.circleIndexStart),B.triangleCount+=$.circleIndexCount/3)}}};const Mvt=1/65536;let Adn=class extends Qx{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,t){const{displayLevel:r,renderPass:n,spriteMosaic:s,styleLayerUID:o}=e;let a=!1;for(const L of t)if(L.layerData.has(o)){const k=L.layerData.get(o);if(k.fillIndexCount>0||k.outlineIndexCount>0){a=!0;break}}if(!a)return;const l=e.styleLayer,u=l.getPaintProperty("fill-pattern"),c=u!==void 0,h=c&&u.isDataDriven;let p;if(c&&!h){const L=u.getValue(r);p=s.getMosaicItemPosition(L,!0)}const m=!c&&l.getPaintValue("fill-antialias",r);let v=!0,w=1;if(!c){const L=l.getPaintProperty("fill-color"),k=l.getPaintProperty("fill-opacity");if(!L?.isDataDriven&&!k?.isDataDriven){const B=l.getPaintValue("fill-color",r);w=l.getPaintValue("fill-opacity",r)*B[3],w>=1&&(v=!1)}}if(v&&n==="opaque")return;const S=l.getPaintValue("fill-translate",r),I=l.getPaintValue("fill-translate-anchor",r);(v||n!=="translucent")&&this._drawFill(e,o,l,t,S,I,c,p,h);const R=!l.hasDataDrivenOutlineColor&&l.outlineUsesFillColor&&w<1;m&&n!=="opaque"&&!R&&this._drawOutline(e,o,l,t,S,I)}_drawFill(e,t,r,n,s,o,a,l,u){if(a&&!u&&l==null)return;const{context:c,displayLevel:h,state:p,painter:m,pixelRatio:v,spriteMosaic:w,requestRender:S,allowDelayedRender:I}=e,R=r.fillMaterial,L=m.vectorTilesMaterialManager,k=v>Vjt?2:1,B=this._fillProgramOptions;B.pattern=a;const $=L.getMaterialProgram(c,R,B);if(I&&S!=null&&!$.compiled)return void S();if(c.useProgram($),l!=null){const{page:Y}=l,K=w.getPageSize(Y);K!=null&&(w.bind(c,Is.LINEAR,Y,yS),$.setUniform2fv("u_mosaicSize",K),$.setUniform1i("u_texture",yS))}$.setUniformMatrix3fv("u_displayMat3",o===mb.VIEWPORT?p.displayMat3:p.displayViewMat3),$.setUniform2fv("u_fillTranslation",s),$.setUniform1f("u_depth",r.z+Mvt);let V=-1;for(const Y of n){if(!Y.layerData.has(t))continue;Y.key.level!==V&&(V=Y.key.level,R.setDataUniforms($,h,r,V,w));const K=Y.layerData.get(t);if(!K.fillIndexCount)continue;K.prepareForRendering(c);const Q=K.fillVAO;if(Q!=null){if(c.bindVAO(Q),$.setUniformMatrix3fv("u_dvsMat3",Y.transforms.displayViewScreenMat3),c.setStencilFunction(Wl.EQUAL,Y.stencilRef,255),a){const re=Math.max(2**(Math.round(h)-Y.key.level),1),ne=Y.rangeX/(k*Y.width*re);$.setUniform1f("u_patternFactor",ne)}if(u){const re=K.patternMap;if(!re)continue;for(const[ne,de]of re){const pe=w.getPageSize(ne);pe!=null&&(w.bind(c,Is.LINEAR,ne,yS),$.setUniform2fv("u_mosaicSize",pe),$.setUniform1i("u_texture",yS),c.drawElements(Eo.TRIANGLES,de[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*de[0]))}}else c.drawElements(Eo.TRIANGLES,K.fillIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*K.fillIndexStart);Y.triangleCount+=K.fillIndexCount/3}}}_drawOutline(e,t,r,n,s,o){const{context:a,displayLevel:l,state:u,painter:c,pixelRatio:h,spriteMosaic:p,requestRender:m,allowDelayedRender:v}=e,w=r.outlineMaterial,S=c.vectorTilesMaterialManager,I=.75/h,R=this._outlineProgramOptions,L=S.getMaterialProgram(a,w,R);if(v&&m!=null&&!L.compiled)return void m();a.useProgram(L),L.setUniformMatrix3fv("u_displayMat3",o===mb.VIEWPORT?u.displayMat3:u.displayViewMat3),L.setUniform2fv("u_fillTranslation",s),L.setUniform1f("u_depth",r.z+Mvt),L.setUniform1f("u_outline_width",I);let k=-1;for(const B of n){if(!B.layerData.has(t))continue;B.key.level!==k&&(k=B.key.level,w.setDataUniforms(L,l,r,k,p));const $=B.layerData.get(t);if($.prepareForRendering(a),!$.outlineIndexCount)continue;const V=$.outlineVAO;V!=null&&(a.bindVAO(V),L.setUniformMatrix3fv("u_dvsMat3",B.transforms.displayViewScreenMat3),a.setStencilFunction(Wl.EQUAL,B.stencilRef,255),a.drawElements(Eo.TRIANGLES,$.outlineIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*$.outlineIndexStart),B.triangleCount+=$.outlineIndexCount/3)}}},Mdn=class extends Qx{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,t){const{context:r,displayLevel:n,state:s,painter:o,pixelRatio:a,spriteMosaic:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e;if(!t.some(re=>re.layerData.get(u)?.lineIndexCount??!1))return;const p=e.styleLayer,m=p.lineMaterial,v=o.vectorTilesMaterialManager,w=p.getPaintValue("line-translate",n),S=p.getPaintValue("line-translate-anchor",n),I=p.getPaintProperty("line-pattern"),R=I!==void 0,L=R&&I.isDataDriven;let k,B;if(R&&!L){const re=I.getValue(n);k=l.getMosaicItemPosition(re)}let $=!1;if(!R){const re=p.getPaintProperty("line-dasharray");if(B=re!==void 0,$=B&&re.isDataDriven,B&&!$){const ne=re.getValue(n),de=p.getDashKey(ne,p.getLayoutValue("line-cap",n));k=l.getMosaicItemPosition(de)}}const V=1/a,Y=this._programOptions;Y.pattern=R,Y.sdf=B;const K=v.getMaterialProgram(r,m,Y);if(h&&c!=null&&!K.compiled)return void c();if(r.useProgram(K),K.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),K.setUniformMatrix3fv("u_displayMat3",S===mb.VIEWPORT?s.displayMat3:s.displayViewMat3),K.setUniform2fv("u_lineTranslation",w),K.setUniform1f("u_depth",p.z),K.setUniform1f("u_antialiasing",V),k&&k!=null){const{page:re}=k,ne=l.getPageSize(re);ne!=null&&(l.bind(r,Is.LINEAR,re,yS),K.setUniform2fv("u_mosaicSize",ne),K.setUniform1i("u_texture",yS))}let Q=-1;for(const re of t){if(!re.layerData.has(u))continue;re.key.level!==Q&&(Q=re.key.level,m.setDataUniforms(K,n,p,Q,l));const ne=2**(n-Q)/a;K.setUniform1f("u_zoomFactor",ne);const de=re.layerData.get(u);if(!de.lineIndexCount)continue;de.prepareForRendering(r);const pe=de.vao;if(pe!=null){if(r.bindVAO(pe),K.setUniformMatrix3fv("u_dvsMat3",re.transforms.displayViewScreenMat3),r.setStencilFunction(Wl.EQUAL,re.stencilRef,255),L||$){const H=de.patternMap;if(!H)continue;for(const[Z,ae]of H){const fe=l.getPageSize(Z);fe!=null&&(l.bind(r,Is.LINEAR,Z,yS),K.setUniform2fv("u_mosaicSize",fe),K.setUniform1i("u_texture",yS),r.drawElements(Eo.TRIANGLES,ae[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*ae[0]))}}else r.drawElements(Eo.TRIANGLES,de.lineIndexCount,Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*de.lineIndexStart);re.triangleCount+=de.lineIndexCount/3}}}};const Odn=256/360,Pdn=1/Math.LN2;function Rdn(i,e){return(i%=e)>=0?i:i+e}function Ovt(i){return Rdn(i*Odn,256)}function Pvt(i){return Math.log(i)*Pdn}const Ddn=1/65536;let Fdn=class extends Qx{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=NW()}dispose(){}drawMany(e,t){const r=e.styleLayer;this._drawIcons(e,r,t),this._drawText(e,r,t)}_drawIcons(e,t,r){const{context:n,displayLevel:s,painter:o,spriteMosaic:a,state:l,styleLayerUID:u,requestRender:c,allowDelayedRender:h}=e,p=t.iconMaterial,m=o.vectorTilesMaterialManager;let v,w=!1;for(const K of r)if(K.layerData.has(u)&&(v=K.layerData.get(u),v.iconPerPageElementsMap.size>0)){w=!0;break}if(!w)return;const S=t.getPaintValue("icon-translate",s),I=t.getPaintValue("icon-translate-anchor",s);let R=t.getLayoutValue("icon-rotation-alignment",s);R===sc.AUTO&&(R=t.getLayoutValue("symbol-placement",s)===YP.POINT?sc.VIEWPORT:sc.MAP);const L=R===sc.MAP,k=t.getLayoutValue("icon-keep-upright",s)&&L,B=v.isIconSDF,$=this._iconProgramOptions;$.sdf=B;const V=m.getMaterialProgram(n,p,$);if(h&&c!=null&&!V.compiled)return void c();n.useProgram(V),V.setUniformMatrix3fv("u_displayViewMat3",R===sc.MAP?l.displayViewMat3:l.displayMat3),V.setUniformMatrix3fv("u_displayMat3",I===mb.VIEWPORT?l.displayMat3:l.displayViewMat3),V.setUniform2fv("u_iconTranslation",S),V.setUniform1f("u_depth",t.z),V.setUniform1f("u_mapRotation",Ovt(l.rotation)),V.setUniform1f("u_keepUpright",k?1:0),V.setUniform1f("u_level",10*s),V.setUniform1i("u_texture",yS),V.setUniform1f("u_fadeDuration",Dq/1e3);let Y=-1;for(const K of r){if(!K.layerData.has(u)||(K.key.level!==Y&&(Y=K.key.level,p.setDataUniforms(V,s,t,Y,a)),v=K.layerData.get(u),v.iconPerPageElementsMap.size===0))continue;v.prepareForRendering(n),v.updateOpacityInfo();const Q=v.iconVAO;if(Q!=null){n.bindVAO(Q),V.setUniformMatrix3fv("u_dvsMat3",K.transforms.displayViewScreenMat3),V.setUniform1f("u_time",(performance.now()-v.lastOpacityUpdate)/1e3);for(const[re,ne]of v.iconPerPageElementsMap)this._renderIconRange(e,V,ne,re,K)}}}_renderIconRange(e,t,r,n,s){const{context:o,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(o,Is.LINEAR,n,yS),this._setStencilState(e,s),o.drawElements(Eo.TRIANGLES,r[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]),s.triangleCount+=r[1]/3}_drawText(e,t,r){const{context:n,displayLevel:s,glyphMosaic:o,painter:a,pixelRatio:l,spriteMosaic:u,state:c,styleLayerUID:h,requestRender:p,allowDelayedRender:m}=e,v=t.textMaterial,w=a.vectorTilesMaterialManager;let S,I=!1;for(const fe of r)if(fe.layerData.has(h)&&(S=fe.layerData.get(h),S.glyphPerPageElementsMap.size>0)){I=!0;break}if(!I)return;const R=t.getPaintProperty("text-opacity");if(R&&!R.isDataDriven&&R.getValue(s)===0)return;const L=t.getPaintProperty("text-color"),k=!L||L.isDataDriven||L.getValue(s)[3]>0,B=t.getPaintProperty("text-halo-width"),$=t.getPaintProperty("text-halo-color"),V=(!B||B.isDataDriven||B.getValue(s)>0)&&(!$||$.isDataDriven||$.getValue(s)[3]>0);if(!k&&!V)return;const Y=24/8;let K=t.getLayoutValue("text-rotation-alignment",s);K===sc.AUTO&&(K=t.getLayoutValue("symbol-placement",s)===YP.POINT?sc.VIEWPORT:sc.MAP);const Q=K===sc.MAP,re=t.getLayoutValue("text-keep-upright",s)&&Q,ne=.8*Y/l;this._glyphTextureSize||(this._glyphTextureSize=Xp(o.width/4,o.height/4));const de=t.getPaintValue("text-translate",s),pe=t.getPaintValue("text-translate-anchor",s),H=this._sdfProgramOptions,Z=w.getMaterialProgram(n,v,H);if(m&&p!=null&&!Z.compiled)return void p();n.useProgram(Z),Z.setUniformMatrix3fv("u_displayViewMat3",K===sc.MAP?c.displayViewMat3:c.displayMat3),Z.setUniformMatrix3fv("u_displayMat3",pe===mb.VIEWPORT?c.displayMat3:c.displayViewMat3),Z.setUniform2fv("u_textTranslation",de),Z.setUniform1f("u_depth",t.z+Ddn),Z.setUniform2fv("u_mosaicSize",this._glyphTextureSize),Z.setUniform1f("u_mapRotation",Ovt(c.rotation)),Z.setUniform1f("u_keepUpright",re?1:0),Z.setUniform1f("u_level",10*s),Z.setUniform1i("u_texture",cft),Z.setUniform1f("u_antialiasingWidth",ne),Z.setUniform1f("u_fadeDuration",Dq/1e3);let ae=-1;for(const fe of r){if(!fe.layerData.has(h)||(fe.key.level!==ae&&(ae=fe.key.level,v.setDataUniforms(Z,s,t,ae,u)),S=fe.layerData.get(h),S.glyphPerPageElementsMap.size===0))continue;S.prepareForRendering(n),S.updateOpacityInfo();const be=S.textVAO;if(be==null)continue;n.bindVAO(be),Z.setUniformMatrix3fv("u_dvsMat3",fe.transforms.displayViewScreenMat3),this._setStencilState(e,fe);const _e=(performance.now()-S.lastOpacityUpdate)/1e3;Z.setUniform1f("u_time",_e),S.glyphPerPageElementsMap.forEach((Ie,Te)=>{this._renderGlyphRange(n,Ie,Te,o,Z,V,k,fe)})}}_renderGlyphRange(e,t,r,n,s,o,a,l){n.bind(e,Is.LINEAR,r,cft),o&&(s.setUniform1f("u_halo",1),e.drawElements(Eo.TRIANGLES,t[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3),a&&(s.setUniform1f("u_halo",0),e.drawElements(Eo.TRIANGLES,t[1],Ti.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),l.triangleCount+=t[1]/3)}_setStencilState(e,t){const{context:r,is3D:n,stencilSymbols:s}=e;if(r.setStencilTestEnabled(!0),s)return r.setStencilWriteMask(255),void r.setStencilFunction(Wl.ALWAYS,t.stencilRef,255);r.setStencilWriteMask(0),n?r.setStencilFunction(Wl.EQUAL,t.stencilRef,255):r.setStencilFunction(Wl.GREATER,255,255)}};const Lq={clip:adn,stencil:Xqt,bitmap:Yhn,overlay:udn,tileDebugInfo:tYt,vtlBackground:Edn,vtlFill:Adn,vtlLine:Mdn,vtlCircle:Idn,vtlSymbol:Fdn},kdn={background:{"background.frag":`#ifdef PATTERN uniform lowp float u_opacity; uniform lowp sampler2D u_texture; varying mediump vec4 v_tlbr; @@ -4810,13 +4810,13 @@ float rgba2float(vec4 rgba) { return dot(rgba, rgba2float_factors); }`,"util.glsl":`float nextPOT(in float x) { return pow(2.0, ceil(log2(abs(x)))); -}`}};function Bdn(i){let e=$dn;return i.split("/").forEach(t=>{e&&(e=e[t])}),e}const jdn=new kKe(Bdn);function Ub(i){return jdn.resolveIncludes(i)}const Rvt=i=>mX({PATTERN:i.pattern}),Gdn={shaders:i=>({vertexShader:Rvt(i)+Ub("background/background.vert"),fragmentShader:Rvt(i)+Ub("background/background.frag")})},Udn={shaders:i=>({vertexShader:Ub("circle/circle.vert"),fragmentShader:Ub("circle/circle.frag")})},Dvt=i=>mX({PATTERN:i.pattern}),zdn={shaders:i=>({vertexShader:Dvt(i)+Ub("fill/fill.vert"),fragmentShader:Dvt(i)+Ub("fill/fill.frag")})},Vdn={shaders:i=>({vertexShader:Ub("outline/outline.vert"),fragmentShader:Ub("outline/outline.frag")})},Fvt=i=>mX({SDF:i.sdf}),Hdn={shaders:i=>({vertexShader:Fvt(i)+Ub("icon/icon.vert"),fragmentShader:Fvt(i)+Ub("icon/icon.frag")})},kvt=i=>mX({PATTERN:i.pattern,SDF:i.sdf}),Wdn={shaders:i=>({vertexShader:kvt(i)+Ub("line/line.vert"),fragmentShader:kvt(i)+Ub("line/line.frag")})},qdn={shaders:i=>({vertexShader:Ub("text/text.vert"),fragmentShader:Ub("text/text.frag")})};let Ydn=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,t,r){const n=t.key<<3|this._getMaterialOptionsValue(t.type,r);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(t.type),{shaders:o}=s,{vertexShader:a,fragmentShader:l}=o(r),u=t.getShaderHeader(),c=t.getShaderMain(),h=a.replace("#pragma header",u).replace("#pragma main",c),p=e.programCache.acquire(h,l,t.getAttributeLocations());return this._programByKey.set(n,p),p}_getMaterialOptionsValue(e,t){switch(e){case up.BACKGROUND:return(t.pattern?1:0)<<1;case up.FILL:return(t.pattern?1:0)<<1;case up.OUTLINE:return 0;case up.LINE:{const r=t;return(r.sdf?1:0)<<2|(r.pattern?1:0)<<1}case up.ICON:return(t.sdf?1:0)<<1;case up.CIRCLE:case up.TEXT:default:return 0}}_getProgramTemplate(e){switch(e){case up.BACKGROUND:return Gdn;case up.CIRCLE:return Udn;case up.FILL:return zdn;case up.ICON:return Hdn;case up.LINE:return Wdn;case up.OUTLINE:return Vdn;case up.TEXT:return qdn;default:return null}}};const Lvt={shaders:{vertexShader:Rm("bitBlit/bitBlit.vert"),fragmentShader:Rm("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};let iYt=class{constructor(){this._initialized=!1}dispose(){this._program=ba(this._program),this._vertexArrayObject=ba(this._vertexArrayObject)}render(e,t,r,n){e&&(this._initialized||this._initialize(e),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.bindVAO(this._vertexArrayObject),e.useProgram(this._program),t.setSamplingMode(r),e.bindTexture(t,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",n),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindTexture(null,0),e.bindVAO())}_initialize(e){if(this._initialized)return!0;const t=R3(e,Lvt);if(!t)return!1;const r=new Int8Array(16);r[0]=-1,r[1]=-1,r[2]=0,r[3]=0,r[4]=1,r[5]=-1,r[6]=1,r[7]=0,r[8]=-1,r[9]=1,r[10]=0,r[11]=1,r[12]=1,r[13]=1,r[14]=1,r[15]=1;const n=Lvt.attributes,s=new wh(e,n,pdn,{geometry:Aa.createVertex(e,oa.STATIC_DRAW,r)});return this._program=t,this._vertexArrayObject=s,this._initialized=!0,!0}};const Xdn=i=>{let e="";e+=i[0].toUpperCase();for(let t=1;t{const e={};for(const t in i)e[Xdn(t)]=i[t];return mX(e)},rYt=(i,e,t,r)=>{const n=i+i.substring(i.lastIndexOf("/")),s=e+e.substring(e.lastIndexOf("/")),o=Jdn(r);return{attributes:t,shaders:{vertexShader:o+Rm(`${n}.vert`),fragmentShader:o+Rm(`${s}.frag`)}}};let Kdn=class{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const r=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(r))return this._programByKey.get(r);const n={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,h)=>({...c,[h.name]:h.value}),{})},{vsPath:s,fsPath:o,attributes:a}=e,l=rYt(s,o,a,n),u=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!u)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(r,u),u}},Zdn=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(e){return this._resourceMap.get(e)??null}async fetchResource(e,t){const r=this._resourceMap.get(e);if(r)return{width:r.width,height:r.height};let n=this._inFlightResourceMap.get(e);return n?n.then(s=>({width:s.width,height:s.height})):(n=O5t(e,t),this._inFlightResourceMap.set(e,n),n.then(s=>(this._inFlightResourceMap.delete(e),this._resourceMap.set(e,s),{width:s.width,height:s.height}),()=>({width:0,height:0})))}deleteResource(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}loadFont(e){return Tqr(e)}};const Qdn=i=>i==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function epn(i,e,t){const r=e.style,n=x5e(Math.ceil(t)),s=Qdn(r)?8*n:16*n,o=2*n;i.width=s,i.height=s;const a=i.getContext("2d");a.strokeStyle="#FFFFFF",a.lineWidth=n,a.beginPath(),r!=="vertical"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSVertical"||(a.moveTo(s/2,-o),a.lineTo(s/2,s+o)),r!=="horizontal"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSHorizontal"||(a.moveTo(-o,s/2),a.lineTo(s+o,s/2)),r!=="backward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSDiagonalCross"&&r!=="esriSFSBackwardDiagonal"||(a.moveTo(-o,-o),a.lineTo(s+o,s+o),a.moveTo(s-o,-o),a.lineTo(s+o,o),a.moveTo(-o,s-o),a.lineTo(o,s+o)),r!=="forward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSForwardDiagonal"&&r!=="esriSFSDiagonalCross"||(a.moveTo(s+o,-o),a.lineTo(-o,s+o),a.moveTo(o,-o),a.lineTo(-o,o),a.moveTo(s+o,s-o),a.lineTo(s-o,s+o)),a.stroke();const l=a.getImageData(0,0,i.width,i.height),u=new Uint8Array(l.data);let c;for(let h=0;h=p||h>=p){const m=c/h;m>1?(c=p,h=Math.round(p/m)):(h=p,c=Math.round(p*m)),u=new Uint8Array(4*c*h);const v=new Uint8ClampedArray(u.buffer);Ztr(a,e,t,v,c,h,!1)}return{size:[c,h],image:new Uint32Array(u.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}},rwe=class{constructor(e,t){this._width=0,this._height=0,this._free=[],this._width=e,this._height=t,this._free.push(new _d(0,0,e,t))}get width(){return this._width}get height(){return this._height}allocate(e,t){if(e>this._width||t>this._height)return new _d;let r=null,n=-1;for(let s=0;se&&this._free.push(new _d(r.x+e,r.y,r.width-e,t)),r.height>t&&this._free.push(new _d(r.x,r.y+t,r.width,r.height-t))):(r.width>e&&this._free.push(new _d(r.x+e,r.y,r.width-e,r.height)),r.height>t&&this._free.push(new _d(r.x,r.y+t,e,r.height-t))),new _d(r.x,r.y,e,t))}release(e){for(let t=0;tMath.floor(i/256);function spn(i){const e=new Set;for(const t of i)e.add(npn(t));return e}function opn(i,e,t){return i.has(e)||i.set(e,t().then(()=>{i.delete(e)}).catch(r=>{i.delete(e),l3(r)})),i.get(e)}const apn=i=>({rect:new _d(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:i,sdf:!0});let lpn=class{constructor(e,t,r){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=e,this.height=t,this._glyphSource=r,this._binPack=new rwe(e-4,t-4),this._glyphData.push(new Uint8Array(e*t)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const e of this._textures)e&&e.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const e=[117,149,181,207,207,181,149,117],t=[],r=[];for(let o=0;o=3&&o<5&&l>=3&&l<8?255:0;t.push(a),r.push(u)}}const n={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(r)};this._recordGlyph(n),this._recordGlyph(s)}getTexture(e,t){if(!this._textures[t]){const r=new Ua;r.pixelFormat=ks.ALPHA,r.wrapMode=Ls.CLAMP_TO_EDGE,r.width=this.width,r.height=this.height,this._textures[t]=new fl(e,r,new Uint8Array(this.width*this.height))}return this._dirties[t]&&(this._textures[t].setData(this._glyphData[t]),this._dirties[t]=!1),this._textures[t]}async getGlyphItems(e,t,r){const n=this._getGlyphCache(e);return await this._fetchRanges(e,t,r),t.map(s=>this._getMosaicItem(n,e,s))}bind(e,t,r,n){const s=this.getTexture(e,r);s.setSamplingMode(t),e.bindTexture(s,n)}preloadASCIIGlyphCache(e){const t=this._preloadCache[e];if(t!=null)return t;const r=this._glyphSource.preloadASCIIRange(e).then(()=>{const n=this._getGlyphCache(e);for(let s=0;s<256;s++)this._getMosaicItem(n,e,s)});return this._preloadCache[e]=r,r}_getGlyphCache(e){return this._glyphCache[e]||(this._glyphCache[e]={}),this._glyphCache[e]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(e,t,r){const n=spn(t),s=[];n.forEach(o=>{s.push(this._fetchRange(e,o,r))}),await Promise.all(s)}async _fetchRange(e,t,r){if(t>rpn)return;const n=e+t;return opn(this._rangePromises,n,()=>this._glyphSource.getRange(e,t,r))}_getMosaicItem(e,t,r){if(!e[r]){const n=this._glyphSource.getGlyph(t,r);if(!n?.metrics)return apn(r);const s=this._recordGlyph(n),o=this._currentPage,a=n.metrics;e[r]={rect:s,page:o,metrics:a,code:r,sdf:!0},this._invalidate()}return e[r]}_recordGlyph(e){const t=e.metrics;let r;if(t.width===0)r=new _d(0,0,0,0);else{const s=t.width+6,o=t.height+2*3;r=this._binPack.allocate(s,o),r.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new rwe(this.width-4,this.height-4),r=this._binPack.allocate(s,o));const a=this._glyphData[this._currentPage],l=e.bitmap;let u,c;if(l)for(let h=0;h{n.addRange(t,new Nvt(new g3(new Uint8Array(l.data),new DataView(l.data))))})}async preloadASCIIRange(e){const t=this._getFontStack(e),r=0,n=255,s=this._baseURL.replace("{fontstack}",e).replace("{range}",r+"-"+n),o=await zi(s,{responseType:"array-buffer"}),a=new Nvt(new g3(new Uint8Array(o.data),new DataView(o.data)));for(let l=r;l<=n;l++)t.getRange(l)||t.addRange(l,a)}getGlyph(e,t){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(t/256),s=r.getRange(n);return s?{metrics:s.getMetrics(t),bitmap:s.getBitmap(t)}:void 0}_getFontStack(e){let t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new upn),t}};const FK=1e20;let hpn=class{constructor(e){this._svg=null,this.size=e;const t=document.createElement("canvas");t.width=t.height=e,this._context=t.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(e*e),this._gridInner=new Float64Array(e*e),this._f=new Float64Array(e),this._d=new Float64Array(e),this._z=new Float64Array(e+1),this._v=new Int16Array(e)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg&&(document.body.removeChild(this._svg),this._svg=null)}draw(e,t,r,n=31){this._initSVG();const s=this.createSVGString(e,t);return new Promise((o,a)=>{const l=new Image;l.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(s),l.onload=()=>{l.onload=null,this._context.clearRect(0,0,this.size,this.size),this._context.drawImage(l,0,0,this.size,this.size);const c=this._context.getImageData(0,0,this.size,this.size),h=new Uint8Array(this.size*this.size*4);for(let p=0;pa(Oc()))})}_initSVG(){if(!this._svg){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),this._svg=e}return this._svg}createSVGString(e,t){const r=this._initSVG(),n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e),r.appendChild(n);const s=n.getBBox(),o=s.width/s.height,a=this.size/2;let l,u,c;if(o>1){l=a/s.width;const v=a*(1/o);u=this.size/4,c=a-v/2}else l=a/s.height,u=a-a*o/2,c=this.size/4;const h=-s.x*l+u,p=-s.y*l+c;n.setAttribute("style",`transform: matrix(${l}, 0, 0, ${l}, ${h}, ${p})`),n.setAttribute("stroke-width",""+.5/l);const m=`${r.innerHTML}`;return r.removeChild(n),m}_edt(e,t,r){const n=this._f,s=this._d,o=this._v,a=this._z;for(let l=0;l0&&(this._maxItemSize=r),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new rwe(this._pageWidth,this._pageHeight);const n=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(n*s)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],r=t.mosaicsData;if(!UD(t.mosaicsData))throw new qe("mapview-invalid-resource","unsuitable data type!");const n=e.spriteData,s=r.data;s&&n||console.error("Source or target images are uninitialized!"),sYt._copyBits(n,e.spriteSize[0],0,0,s,e.pageSize[0],e.rect.x+Qg,e.rect.y+Qg,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Qg,t+=2*Qg;const r=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizee.toBlob(n,t));if(!r)throw new qe("imageToArrayBuffer","Failed to encode image");return{data:await r.arrayBuffer(),type:t}}async function mpn(i){if(!(i instanceof HTMLImageElement))return"image/png";const e=i.src;if(Vx(e)){const t=lR(e);return t?.mediaType==="image/jpeg"?t.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function oYt(i){if(i instanceof HTMLCanvasElement)return i;if(i instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const t=e.getContext("2d");return i instanceof HTMLImageElement?t.drawImage(i,0,0,i.width,i.height):i instanceof ImageData&&t.putImageData(i,0,0),e}function gpn(i){const e=[],t=new Uint8Array(i);for(let r=0;re+t,0)}function _pn(i){const{width:e,height:t}=i,r=i.frameDurations.reverse(),n=s=>{const o=i.frameDurations.length-1-s;return i.getFrame(o)};return{frameCount:i.frameCount,duration:i.duration,frameDurations:r,getFrame:n,width:e,height:t}}function bpn(i,e){const{width:t,height:r,getFrame:n}=i,s=e/i.duration,o=i.frameDurations.map(a=>a*s);return{frameCount:i.frameCount,duration:i.duration,frameDurations:o,getFrame:n,width:t,height:r}}function wpn(i,e){const{width:t,height:r,getFrame:n}=i,s=i.frameDurations.slice(),o=s.shift();return s.unshift(o+e),{frameCount:i.frameCount,duration:i.duration+e,frameDurations:s,getFrame:n,width:t,height:r}}function jvt(i,e){const{width:t,height:r,getFrame:n}=i,s=i.frameDurations.slice(),o=s.pop();return s.push(o+e),{frameCount:i.frameCount,duration:i.duration+e,frameDurations:s,getFrame:n,width:t,height:r}}let xpn=class{constructor(e,t,r,n){this._animation=e,this._repeatType=r,this._onFrameData=n,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let s=0;for(;t>s;)s+=this.timeToFrame,this.nextFrame();const o=this._animation.getFrame(this._currentFrame);this._onFrameData(o)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case pb.None:this._currentFrame-=this._direction;break;case pb.Loop:this._currentFrame=0;break;case pb.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case pb.None:this._currentFrame-=this._direction;break;case pb.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case pb.Oscillate:this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const e=this._animation.getFrame(this._currentFrame);this._onFrameData(e)}};function Spn(i,e,t,r){let n,{repeatType:s}=e;if(s==null&&(s=pb.Loop),e.reverseAnimation===!0&&(i=_pn(i)),e.duration!=null&&(i=bpn(i,1e3*e.duration)),e.repeatDelay!=null){const o=1e3*e.repeatDelay;s===pb.Loop?i=jvt(i,o):s===pb.Oscillate&&(i=wpn(jvt(i,o/2),o/2))}if(e.startTimeOffset!=null)n=1e3*e.startTimeOffset;else if(e.randomizeStartTime!=null){const a=e.randomizeStartSeed!=null?e.randomizeStartSeed:82749913,l=Xjt(t,a);n=l*vpn(i)}else n=0;return new xpn(i,n,s,r)}function aYt(i,e,t,r){const n=e.playAnimation==null||e.playAnimation,s=Spn(i,e,t,r);let o,a=s.timeToFrame;function l(){o=n?setTimeout(()=>{s.nextFrame(),a=s.timeToFrame,l()},a):void 0}return l(),wa(()=>n&&clearTimeout(o))}let Tpn=class{constructor(e,t,r,n){this._animation=e,this._frameData=null;const s=o=>{this._frameData=o,t.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=aYt(this._animation,r,n,s)}destroy(){this._playHandle.remove()}loadFrame(e){const t=this._frameData;if(t==null)return;const r="width"in t?t.width:t.codedWidth,n="height"in t?t.height:t.codedHeight;e.updateData(0,Qg,Qg,r,n,t),this._frameData=null}};const Gvt="arial-unicode-ms-regular",Cpn=()=>di.getLogger("esri.views.2d.engine.webgl.TextureManager"),uN=(i,e,t)=>Cpn().error(new qe(i,e,t));function Epn(i){switch(i.type){case"fill-style":case"CIMHatchFill":return oHr}return 1}let Ipn=class lYt{static fromMosaic(e,t){return new lYt(e,t.page,t.sdf)}constructor(e,t,r){this.mosaicType=e,this.page=t,this.sdf=r}},Apn=class{constructor(e){this._requestRender=e,this._resourceManager=new Zdn,this._invalidFontsMap=new Map,this._sdfConverter=new hpn(Wge),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new UY({concurrency:10,process:async(t,r)=>{hn(r);try{return await zi(t,{responseType:"image",signal:r})}catch(n){throw mo(n)?n:new qe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,n)}}}),this._spriteMosaic=new dpn(2048,2048,500),this._glyphSource=new cpn(`${Ho.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new lpn(1024,1024,this._glyphSource),this._rasterizer=new ipn(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return uN("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type!=="cim-rasterization-info")return uN("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:r}=e;if(r.type==="text"){const s=await this._rasterizeText(r,t);for(const o of s.glyphs)this._setTextureBinding(mV.GLYPH,o);return s}const n=await this._rasterizeSprite(r,t);return n&&this._setTextureBinding(mV.SPRITE,n),n}getMosaicInfo(e,t,r=!1){const n=this._getTextureBindingInfo(e,t,r);return n?{size:n.size,texture:{texture:n.texture,unit:n.type==="sprite"?XVr:lft}}:(uN("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,r){const n=this._bindingInfos[t-1],s=n.page,o=r?Is.LINEAR_MIPMAP_LINEAR:Is.LINEAR;switch(n.mosaicType){case mV.SPRITE:{const a=[this.sprites.getWidth(s),this.sprites.getHeight(s)],l=this._spriteMosaic.getTexture(e,s);return l.setSamplingMode(o),{type:"sprite",texture:l,size:a}}case mV.GLYPH:{const a=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,s);return this._glyphMosaic.bind(e,o,s,lft),l.setSamplingMode(o),{type:"glyph",texture:l,size:a}}default:return uN("mapview-texture-manager",`Cannot handle unknown type ${n.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const r=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(r)){const n=Ipn.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(r,s),this._bindingInfos.push(n)}t.textureBinding=this._hashToBindingIndex.get(r)}async _rasterizeText(e,t){const{font:r,textString:n}=e,s=VGt(r),o=this._invalidFontsMap.has(s),[a,l]=GGt(n),u=oJr(a);try{const c=o?Gvt:s;return yi("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,u,t),isRightToLeft:l}}catch{return uN("mapview-invalid-resource",`Couldn't find font ${s}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(s,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Gvt,u,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${e.dashTemplate.join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(nzt(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const r=Q1(this._hashSpriteResource(e));if(this._spriteMosaic.has(r))return this._spriteMosaic.getSpriteItem(r);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const n=[];ym.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,n),n.length>0&&await Promise.all(n)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(r,e):this._handleAsyncResource(r,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(r,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(r,e)}}_rasterizeJSONResource(e,t){const r=this._rasterizer.rasterizeJSONResource(t,Epn(t));if(r){const{size:n,image:s,sdf:o,simplePattern:a,rasterizationScale:l}=r;return this._addItemToMosaic(e,n,{type:"static",data:s},ype(t),o,a,l)}return null}async _handleAsyncResource(e,t,r){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let n;return n=t.type==="path"?this._handleSVG(t,e,r):this._handleImage(t,e,r),this._ongoingRasterizations.set(e,n),n.finally(()=>this._ongoingRasterizations.delete(e)),n}async _handleSVG(e,t,r){const n=[Wge,Wge],{asFill:s}=e,o=await this._sdfConverter.draw(e.path,s,r);return this._addItemToMosaic(t,n,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,r){const n=e.url,s=this.resourceManager.getResource(n);if(s==null)return null;const{width:o,height:a}=s;if(s instanceof HTMLImageElement){if(e.type==="animated")return uN("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const p="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:m,sdf:v,image:w}=this._rasterizer.rasterizeImageResource(o,a,s,p);return this._addItemToMosaic(t,m,{type:"static",data:w},ype(e),v,!1)}let l,u,c;e.type==="animated"?(l=!1,u={playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=ype(e),u={},c=0);const h=new Tpn(s,this._requestRender,u,c);return this._addItemToMosaic(t,[h.width,h.height],{type:"animated",data:h},l,!1,!1)}async _handleImage(e,t,r){const n=e.url;if(Opn(n)||Rpn(n))return this._handleGIFOrPNG(e,t,r);if(e.type==="animated")return uN("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let s;const o=this.resourceManager.getResource(n);if(o!=null&&o instanceof HTMLImageElement)s=o;else{const{data:m}=await this._imageRequestQueue.push(n,{...r});s=m}if(sJr(n)){if("width"in e&&"height"in e)s.width=us(e.width),s.height=us(e.height);else if("cim"in e){const m=e;s.width=us(m.width??m.scaleX*m.size),s.height=us(m.size)}}if(!s.width||!s.height)return null;const a=s.width,l=s.height,u="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:h,image:p}=this._rasterizer.rasterizeImageResource(a,l,s,u);return this._addItemToMosaic(t,c,{type:"static",data:p},ype(e),h,!1)}catch(s){throw mo(s)?s:new qe("mapview-invalid-resource",`Could not fetch requested resource at ${n}. ${s.message}`)}}_addItemToMosaic(e,t,r,n,s,o,a){return this._spriteMosaic.addSpriteItem(e,t,r,n,s,o,a)}};function ype(i){switch(i.type){case"CIMVectorMarker":case"CIMPictureMarker":return Dpn(i);default:return!0}}const Mpn=i=>i!=null&&i.startsWith("data:image/gif"),Opn=i=>i&&(i.includes(".gif")||Mpn(i)),Ppn=i=>i!=null&&i.startsWith("data:image/png"),Rpn=i=>i&&(i.includes(".png")||Ppn(i)),Dpn=i=>i&&"markerPlacement"in i&&i.markerPlacement&&i.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Fpn=class{constructor(e){this._queue=[],this._refreshable=e}destroy(){this._queue=[]}enqueueTextureUpdate(e,t){const r=ac(),n=e,s=aHr,o=Math.ceil(n.height/s);hn(t);for(let a=0;ar.reject(a)),r.promise}upload(){let e=0;for(;this._queue.length;){const t=performance.now(),r=this._queue.shift();if(r){if(r.options.signal!=null&&r.options.signal.aborted)continue;switch(r.type){case"chunk":this._uploadChunk(r);break;case"no-chunk":this._uploadNoChunk(r)}const n=performance.now()-t;if(e+=n,e+n>=lHr)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:t,resolver:r,chunkOffset:n,chunkIsLast:s,destHeight:o}=e,{data:a,texture:l,width:u}=t;a!=null&&(l.updateData(0,0,n,u,o,a,n),s&&r.resolve())}_uploadNoChunk(e){const{request:t,resolver:r}=e,{data:n,texture:s}=t;s.setData(n),r.resolve()}};const kpn={shaders:{vertexShader:Rm("stencil/stencil.vert"),fragmentShader:Rm("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},Lpn=MA(-.5,-.5);let Npn=class{constructor(){this._centerNdc=gr(),this._pxToNdc=gr(),this._worldDimensionsPx=gr(),this._mat3=Cc(),this._initialized=!1}dispose(){this._program=ba(this._program),this._quad=ba(this._quad)}render(e,t,r){const{context:n}=e,s=this._updateGeometry(e,r);if(t!=null){const{r:o,g:a,b:l,a:u}=t;n.setClearColor(u*o/255,u*a/255,u*l/255,u)}else n.setClearColor(0,0,0,0);if(n.setStencilFunction(Hl.ALWAYS,0,255),n.setStencilWriteMask(255),!s)return n.setClearStencil(1),void n.clear(n.gl.STENCIL_BUFFER_BIT|n.gl.COLOR_BUFFER_BIT);n.setClearStencil(0),n.clear(n.gl.STENCIL_BUFFER_BIT|n.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(n),n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setColorMask(!1,!1,!1,!1),n.setBlendingEnabled(!1),n.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),n.setStencilFunction(Hl.ALWAYS,1,255),n.setStencilTestEnabled(!0),n.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=R3(e,kpn);t&&(this._program=t,this._quad=new JS(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:r,pixelRatio:n}=e,{size:s,rotation:o}=r,a=Math.round(s[0]*n),l=Math.round(s[1]*n);if(!r.spatialReference.isWrappable)return!1;const u=eB(o),c=Math.abs(Math.cos(u)),h=Math.abs(Math.sin(u)),p=Math.round(a*c+l*h),m=Math.round(r.worldScreenWidth);if(p<=m)return!1;const v=a*h+l*c,w=m*n,S=(t.left-t.right)*n/a,I=(t.bottom-t.top)*n/l;Zo(this._worldDimensionsPx,w,v,1),Zo(this._pxToNdc,2/a,-2/l,1),Zo(this._centerNdc,S,I,1);const R=this._mat3;return _We(R,this._centerNdc),_R(R,R,this._pxToNdc),o!==0&&q3(R,R,u),_R(R,R,this._worldDimensionsPx),h0(R,R,Lpn),!0}},jle=class{constructor(){this.name=this.constructor.name}createOptions(e,t){return null}},$pn=class extends jle{constructor(){super(...arguments),this.defines=[],this._desc={vsPath:"fx/integrate",fsPath:"fx/integrate",attributes:new Map([["a_position",0]])}}dispose(){this._quad&&this._quad.dispose()}bind(){}unbind(){}draw(e,t){if(!t?.size)return;const{context:r,renderingOptions:n}=e;this._quad||(this._quad=new JS(r,[0,0,1,0,0,1,1,1]));const s=r.getBoundFramebufferObject(),{x:o,y:a,width:l,height:u}=r.getViewport(),c=t.getBlock(Sv.Animation);if(c==null)return;const h=t.getUniforms(r);r.setViewport(0,0,t.size,t.size);const p=h.filterFlags,m=h.animation,v=yi("featurelayer-animation-enabled")?n.labelsAnimationTime:1,w=c.getFBO(r,1);r.unbindTexture(w.colorTexture),this._computeDelta(e,w,m,p,v);const S=c.getFBO(r);r.unbindTexture(S.colorTexture),this._updateAnimationState(e,w,S),r.bindFramebuffer(s),r.setViewport(o,a,l,u)}_computeDelta(e,t,r,n,s){const{context:o,painter:a,displayLevel:l}=e,u=a.materialManager.getProgram(this._desc,["delta"]);if(o.bindFramebuffer(t),o.setColorMask(!0,!0,!0,!0),o.setClearColor(0,0,0,0),o.clear(o.gl.COLOR_BUFFER_BIT),o.useProgram(u),!("type"in n.texture)||!("type"in r.texture))throw new Error("InternalError: Expected to find texture");o.bindTexture(n.texture,n.unit),o.bindTexture(r.texture,r.unit),u.setUniform1i("u_maskTexture",n.unit),u.setUniform1i("u_sourceTexture",r.unit),u.setUniform1f("u_timeDelta",e.deltaTime),u.setUniform1f("u_animationTime",s),u.setUniform1f("u_zoomLevel",Math.round(10*l)),this._quad.draw()}_updateAnimationState(e,t,r){const{context:n,painter:s}=e,o=s.materialManager.getProgram(this._desc,["update"]);n.bindTexture(t.colorTexture,1),n.useProgram(o),o.setUniform1i("u_sourceTexture",1),n.bindFramebuffer(r),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),this._quad.draw()}};const Bpn=i=>i.replace("-","_").toUpperCase(),Uvt=i=>`#define ${Bpn(i)} -`;function zvt(i){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:Uvt(i)+Rm("blend/blend.vert"),fragmentShader:Uvt(i)+Rm("blend/blend.frag")}}}const Vvt=()=>di.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");let jpn=class{constructor(){this._size=[0,0]}dispose(e){this._backBufferTexture=ba(this._backBufferTexture),this._quad=ba(this._quad)}draw(e,t,r,n,s){const{context:o,drawPhase:a}=e;if(this._setupShader(o),n&&n!=="normal"&&a!==aa.LABEL)return void this._drawBlended(e,t,r,n,s);const l=zvt("normal"),u=o.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!u)return void Vvt().error(new qe("mapview-BlendEffect",'Error creating shader program for blend mode "normal"'));o.useProgram(u),t.setSamplingMode(r),o.bindTexture(t,0),u.setUniform1i("u_layerTexture",0),u.setUniform1f("u_opacity",s),o.setBlendingEnabled(!0),o.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA);const c=this._quad;c.draw(),c.unbind(),u.dispose()}_drawBlended(e,t,r,n,s){const{context:o,state:a,pixelRatio:l,inFadeTransition:u}=e,{size:c}=a,h=o.getBoundFramebufferObject();let p,m;h!=null?(p=h.width,m=h.height):(p=Math.round(l*c[0]),m=Math.round(l*c[1])),this._createOrResizeTexture(e,p,m);const v=this._backBufferTexture;h.copyToTexture(0,0,p,m,0,0,v),o.setStencilTestEnabled(!1),o.setStencilWriteMask(0),o.setBlendingEnabled(!0),o.setDepthTestEnabled(!1),o.setDepthWriteEnabled(!1);const w=zvt(n),S=o.programCache.acquire(w.shaders.vertexShader,w.shaders.fragmentShader,w.attributes);if(!S)return void Vvt().error(new qe("mapview-BlendEffect",`Error creating shader program for blend mode ${n}`));o.useProgram(S),v.setSamplingMode(r),o.bindTexture(v,0),S.setUniform1i("u_backbufferTexture",0),t.setSamplingMode(r),o.bindTexture(t,1),S.setUniform1i("u_layerTexture",1),S.setUniform1f("u_opacity",s),S.setUniform1f("u_inFadeOpacity",u?1:0),o.setBlendFunction(bn.ONE,bn.ZERO);const I=this._quad;I.draw(),I.unbind(),S.dispose(),o.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA)}_setupShader(e){this._quad||(this._quad=new JS(e,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(e,t,r){const{context:n}=e;if(this._backBufferTexture===null||t!==this._size[0]||r!==this._size[1]){if(this._backBufferTexture)this._backBufferTexture.resize(t,r);else{const s=new Ua;s.internalFormat=ks.RGBA,s.wrapMode=Ls.CLAMP_TO_EDGE,s.width=t,s.height=r,this._backBufferTexture=new fl(n,s)}this._size[0]=t,this._size[1]=r}}},Hvt=class extends jle{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:t}){this._prev=e.getBoundFramebufferObject();const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}draw(e,t){const{context:r,painter:n}=e,s=n.getPostProcessingEffects(t),o=r.getBoundFramebufferObject();for(const{postProcessingEffect:a,effect:l}of s)a.draw(e,o,l);r.bindFramebuffer(this._prev),r.setStencilTestEnabled(!1),n.blitTexture(r,o.colorTexture,Is.NEAREST),r.setStencilTestEnabled(!0)}};const Gpn={shaders:{vertexShader:Rm("highlight/textured.vert"),fragmentShader:Rm("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Upn={shaders:{vertexShader:Rm("highlight/textured.vert"),fragmentShader:Rm("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])};let zpn=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(e,t){e.bindTexture(t,aK),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Bhn),e.bindVAO(this._resources.quadVAO),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}finalBlur(e,t){e.bindTexture(t,aK),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",jhn),e.bindVAO(this._resources.quadVAO),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}renderHighlight(e,t,r){e.bindTexture(t,aK),e.useProgram(this._resources.highlightProgram),r.applyHighlightOptions(e,this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.setBlendingEnabled(!0),e.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}_initialize(e,t,r){this._width=t,this._height=r;const n=Aa.createVertex(e,oa.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),s=new wh(e,new Map([["a_position",0],["a_texcoord",1]]),{geometry:[new Vl("a_position",2,Ti.BYTE,0,4),new Vl("a_texcoord",2,Ti.UNSIGNED_BYTE,2,4)]},{geometry:n}),o=R3(e,Gpn),a=R3(e,Upn);e.useProgram(o),o.setUniform1i("u_texture",aK),o.setUniform1i("u_shade",Ujt),o.setUniform1f("u_sigma",y7e),e.useProgram(a),a.setUniform1i("u_texture",aK),a.setUniform1f("u_sigma",y7e),this._resources={quadGeometry:n,quadVAO:s,highlightProgram:o,blurProgram:a}}setup(e,t,r){this._resources?(this._width=t,this._height=r):this._initialize(e,t,r)}};function Wvt(i,e,t){const r=new Ua(e,t);return r.wrapMode=Ls.CLAMP_TO_EDGE,new Wd(i,r,new Mle(vf.STENCIL_INDEX8,e,t))}let Vpn=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(e,t,r){this._width=t,this._height=r;const n=Wvt(e,t,r),s=Wvt(e,t,r);this._resources={sharedBlur1Fbo:n,sharedBlur2Fbo:s}}setup(e,t,r){!this._resources||this._width===t&&this._height===r||this.dispose(),this._resources||this._initialize(e,t,r)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const K$=4,vpe=4/K$;let Hpn=class extends jle{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new zpn,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Vpn,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new iYt}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(e){const{context:t,painter:r}=e,{width:n,height:s}=t.getViewport(),o=r.getFbos().effect0;this.setup(e,n,s),t.bindFramebuffer(o),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(t.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:e},t,r){this._width=t,this._height=r;const n=t%K$,s=r%K$;t+=nu.resolve([]));const o=s.getFBO(r),a=new Uint8Array(o.width*o.height*4);try{await o.readPixelsAsync(0,0,o.width,o.height,ks.RGBA,lc.UNSIGNED_BYTE,a)}catch{return void t.forEach(c=>c.resolve([]))}const l=[];for(let u=0;uu.resolve(l))}},qpn=class extends jle{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["id"],this._lastSize=0,this._boundFBO=null}dispose(){this._fbo!=null&&this._fbo.dispose()}bind({context:e,painter:t}){this._boundFBO=e.getBoundFramebufferObject();const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind({context:e}){e.bindFramebuffer(this._boundFBO),this._boundFBO=null}draw(e,t,r=2*zjt){this._resolve(e,t,r)}async _resolve({context:e,state:t,pixelRatio:r},n,s){const o=e.getBoundFramebufferObject(),a=t.size[1]*r,l=Math.round(s*r),u=l/2,c=l/2;this._ensureBuffer(l),n.forEach(async(h,p)=>{const m=new Map,v=Math.floor(p.x*r-l/2),w=Math.floor(a-p.y*r-l/2);await o.readPixelsAsync(v,w,l,l,ks.RGBA,lc.UNSIGNED_BYTE,this._buf);for(let I=0;II[1]-R[1]).map(I=>I[0]);h.resolve(S),n.delete(p)})}_ensureBuffer(e){this._lastSize!==e&&(this._lastSize=e,this._buf=new Uint8Array(4*e*e),this._buf32=new Uint32Array(this._buf.buffer))}};const iRe=5,Ypn=[1,0],Xpn=[0,1],Jpn=[1,.8,.6,.4,.2],Kpn=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Zpn=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(iRe),this._nMips=iRe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=ba(this._quad),this._intensityFBO=ba(this._intensityFBO),this._compositeFBO=ba(this._compositeFBO),this._mipsFBOs){for(let e=0;enew ifn,blur:()=>new tfn,bloom:()=>new Zpn,opacity:()=>new ofn,"drop-shadow":()=>new sfn};let ufn=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(e=>e.dispose()),this._effectMap.clear()}getPostProcessingEffects(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const n=afn(r.type);let s=this._effectMap.get(n);s||(s=lfn[n](),this._effectMap.set(n,s)),t.push({postProcessingEffect:s,effect:r})}return t}},cfn=class{constructor(e,t){this.brushes=e,this.name=t.name,this.drawPhase=t.drawPhase||aa.MAP,this._targetFn=t.target,this.effects=t.effects||[],this.enableDefaultDraw=t.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!t.forceDrawByDisplayOrder}render(e){const{context:t,profiler:r}=e,n=this._targetFn(),s=this.drawPhase&e.drawPhase;if(r.recordPassStart(this.name),s){this.enableDefaultDraw()&&this._doRender(e,n),r.recordPassEnd();for(const o of this.effects){if(!o.enable())continue;const a=o.apply,l=o.args?.(),u=t.getViewport(),c=t.getBoundFramebufferObject(),h=e.passOptions;this._bindEffect(e,a,l),this._doRender(e,n,a.defines),this._drawAndUnbindEffect(e,a,u,c,h,l)}}}_doRender(e,t,r){if(t==null)return;const{profiler:n,context:s}=e;for(const o of this.brushes){if(n.recordBrushStart(o.name),o.brushEffect!=null){const a=s.getViewport(),l=s.getBoundFramebufferObject(),u=e.passOptions;this._bindEffect(e,o.brushEffect),this._drawWithBrush(o,e,t,r),this._drawAndUnbindEffect(e,o.brushEffect,a,l,u)}else this._drawWithBrush(o,e,t,r);n.recordBrushEnd()}}_drawWithBrush(e,t,r,n){NTt(r)?(e.prepareState(t,n),e.drawMany(t,r,n)):r.visible&&(e.prepareState(t,n),e.draw(t,r,n))}_bindEffect(e,t,r){const{profiler:n}=e;n.recordPassStart(this.name+"."+t.name),t.bind(e,r);const s=t.createOptions(e,r);e.passOptions=s}_drawAndUnbindEffect(e,t,r,n,s,o){const{profiler:a,context:l}=e;e.passOptions=s,a.recordBrushStart(t.name),t.draw(e,o),t.unbind(e,o),l.bindFramebuffer(n);const{x:u,y:c,width:h,height:p}=r;l.setViewport(u,c,h,p),a.recordBrushEnd(),a.recordPassEnd()}},qvt=class{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,r,n,s){const o=e.getShaderKey(t,r,n,s);let a=this._programCache.get(o);return a||(a=e.getProgram(t,r,n,s),this._programCache.set(o,a)),a}},hfn=class{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new iYt,this._worldExtentRenderer=new Npn,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Ydn,this._blendEffect=new jpn,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new Hpn,hittest:new Wpn,hittestVTL:new qpn,integrate:new $pn,insideEffect:new Hvt("inside"),outsideEffect:new Hvt("outside")},this._programCache=new qvt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Kdn(e),this.textureManager=new Apn(t),this.textureUploadManager=new Fpn(t),this._effectsManager=new ufn,this._quadMesh=new JS(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=ba(this._blitRenderer),this._worldExtentRenderer=ba(this._worldExtentRenderer),this._quadMesh.dispose(),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=ba(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new qvt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let r;if(this._fboPool.length>0)r=this._fboPool.pop();else{const n=new Ua(e,t);n.samplingMode=Is.NEAREST,n.wrapMode=Ls.CLAMP_TO_EDGE,r=new Wd(this.context,n,this._stencilBuf)}return r.width===e&&r.height===t||r.resize(e,t),r}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,r){const{context:n}=e;this._worldExtentRenderer.render(e,t,r);const{width:s,height:o}=n.getViewport();if(this.updateFBOs(s,o),this._prevFBO=n.getBoundFramebufferObject(),n.bindFramebuffer(this.getFbos().output),n.setColorMask(!0,!0,!0,!0),t!=null){const{r:a,g:l,b:u,a:c}=t;n.setClearColor(c*a/255,c*l/255,c*u/255,c)}else n.setClearColor(0,0,0,0);n.setDepthWriteEnabled(!0),n.setClearDepth(1),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.DEPTH_BUFFER_BIT),n.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(Hl.EQUAL,1,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,Is.NEAREST)}beforeRenderLayer(e,t,r){const{context:n,blendMode:s,effects:o,drawPhase:a,requireFBO:l}=e;if(l||Yvt(a,s,o,r)){const u=n.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(u);const{width:c,height:h}=n.getViewport(),p=this.acquireFbo(c,h);n.bindFramebuffer(p),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.setDepthWriteEnabled(!0),n.setClearDepth(1),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.DEPTH_BUFFER_BIT),n.setDepthWriteEnabled(!1)}n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!0),n.setClearStencil(t),n.setStencilWriteMask(255),n.clear(n.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:r,blendMode:n,effects:s,requireFBO:o,drawPhase:a}=e;if(o||Yvt(a,n,s,t)){const l=r.getBoundFramebufferObject();s!=null&&s.length>0&&a===aa.MAP&&(r.setColorMask(!0,!0,!0,!0),this._applyEffects(e,s,l)),r.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0);const u=n==null||a===aa.HIGHLIGHT?"normal":n;this._blendEffect.draw(e,l.colorTexture,Is.NEAREST,u,t),this.releaseFbo(l)}}renderObject(e,t,r,n){const s=Lq[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.prepareState(e),o.draw(e,t,n)}renderObjects(e,t,r,n){const s=Lq[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.drawMany(e,t,n)}registerRenderPass(e){const t=e.brushes.map(r=>(this._brushCache.has(r)||this._brushCache.set(r,new r),this._brushCache.get(r)));return new cfn(t,e)}blitTexture(e,t,r,n=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,r,n),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const r=new Ua(e,t);r.samplingMode=Is.NEAREST,r.wrapMode=Ls.CLAMP_TO_EDGE;const n=new Mle(vf.DEPTH_STENCIL,e,t);this._stencilBuf=new bCe(this.context,n),this._fbos={output:new Wd(this.context,r,this._stencilBuf),effect0:new Wd(this.context,r,this._stencilBuf)}}}_applyEffects(e,t,r){const{context:n}=e,s=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:o,effect:a}of s)n.bindFramebuffer(r),o.draw(e,r,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{instance:r}=t,n=r.instanceId,{shader:s,uniforms:o,defines:a,optionalAttributes:l,useComputeBuffer:u}=this._shaderState,c=t.target.getMesh(n),h={useComputeBuffer:u,locationInfo:s.locationInfo,computeAttributeMap:s.computeAttributes},p=c.getLayout(h);if(p==null)return null;const{primitive:m,count:v,offset:w}=c.getDrawArgs(Eo.TRIANGLES,t.count,t.start*Uint32Array.BYTES_PER_ELEMENT,u),S=this._programCache.getProgram(s,p,o,a??{},l??{});S.setUniforms(o),S.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,t.target);const I=c.getVAO(e,s.locationInfo,h);return e.bindVAO(I),e.drawElements(m,v,Ti.UNSIGNED_INT,w),e.bindVAO(null),S.cleanupTemporaryTextures(),{vertexShader:S.vertexShader,fragmentShader:S.fragmentShader}}submitDrawQuad(e){const{shader:t,uniforms:r,defines:n,optionalAttributes:s}=this._shaderState,o=this._programCache.getProgram(t,this._quadMesh.layout,r,n??{},s??{});o.setUniforms(r),o.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,null),this._quadMesh.draw(),e.bindVAO(null),o.cleanupTemporaryTextures()}submitDrawMesh(e,t,r){const{shader:n,uniforms:s,defines:o,optionalAttributes:a}=this._shaderState,l=this._programCache.getProgram(n,t.layout,s,o??{},a??{});if(l.setUniforms(s),l.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,null),r)for(const u of r)t.bind(e,u),t.draw(e);else for(let u=0;u0)}let Xvt=class{constructor(e,t,r,n,s,o,a,l,u){this.createQuery=e,this.deleteQuery=t,this.resultAvailable=r,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=a,this.createTimestamp=l,this.timestampBits=u}},zD=!1;function uYt(i,e){if(e.disjointTimerQuery)return null;let t=i.getExtension("EXT_disjoint_timer_query_webgl2");return t?new Xvt(()=>i.createQuery(),r=>{i.deleteQuery(r),zD=!1},r=>i.getQueryParameter(r,i.QUERY_RESULT_AVAILABLE),r=>i.getQueryParameter(r,i.QUERY_RESULT),()=>i.getParameter(t.GPU_DISJOINT_EXT),r=>{zD||(zD=!0,i.beginQuery(t.TIME_ELAPSED_EXT,r))},()=>{i.endQuery(t.TIME_ELAPSED_EXT),zD=!1},r=>t.queryCounterEXT(r,t.TIMESTAMP_EXT),()=>i.getQuery(t.TIMESTAMP_EXT,t.QUERY_COUNTER_BITS_EXT)):(t=i.getExtension("EXT_disjoint_timer_query"),t?new Xvt(()=>t.createQueryEXT(),r=>{t.deleteQueryEXT(r),zD=!1},r=>t.getQueryObjectEXT(r,t.QUERY_RESULT_AVAILABLE_EXT),r=>t.getQueryObjectEXT(r,t.QUERY_RESULT_EXT),()=>i.getParameter(t.GPU_DISJOINT_EXT),r=>{zD||(zD=!0,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r))},()=>{t.endQueryEXT(t.TIME_ELAPSED_EXT),zD=!1},r=>t.queryCounterEXT(r,t.TIMESTAMP_EXT),()=>t.getQueryEXT(t.TIMESTAMP_EXT,t.QUERY_COUNTER_BITS_EXT)):null)}const ST=yi("esri-2d-profiler");let dfn=class{constructor(e,t){if(this._events=new rd,this._entries=new Map,this._timings=new k9e(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!ST)return;this._ext=uYt(e.gl,{}),this._debugOutput=t;const r=e.gl;if(!this.enableCommandLogging)return;let n;for(n in r)if(typeof r[n]=="function"){const s=r[n],o=n.includes("draw");r[n]=(...a)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:n,args:a,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),s.apply(r,a))}}get enableCommandLogging(){return!(typeof ST=="object"&&ST.disableCommands)}recordContainerStart(e){ST&&(this._currentContainer=e)}recordContainerEnd(){ST&&(this._currentContainer=null)}recordPassStart(e){ST&&(this._currentPass=e,this._initSummary())}recordPassEnd(){ST&&(this._currentPass=null,this._emitSummary())}recordBrushStart(e){ST&&(this._currentBrush=e)}recordBrushEnd(){ST&&(this._currentBrush=null)}recordStart(e){if(ST&&this._ext!=null){if(this._entries.has(e)){const r=this._entries.get(e),n=this._ext.resultAvailable(r.query),s=this._ext.disjoint();if(n&&!s){const o=this._ext.getResult(r.query)/1e6;let a=0;if(this._timings.enqueue(o)!=null){const c=this._timings.entries,h=c.length;let p=0;for(const m of c)p+=m;a=p/h}const l=o.toFixed(2),u=a?a.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${e}, ${l} ms (${u} last 10 avg) -${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(r.summaries),console.log("Commands: ",r.commands),console.groupEnd()):console.log(`Frame report for ${e}, ${l} ms (${u} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${u})`}for(const o of r.handles)o.remove();this._ext.deleteQuery(r.query),this._entries.delete(e)}const t={name:e,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(t.handles.push(this._events.on("command",r=>{t.commandsLen++,t.commands.push(r),r.isDrawCommand&&t.drawCommands++})),t.handles.push(this._events.on("summary",r=>{t.summaries.push(r)}))),this._ext.beginTimeElapsed(t.query),this._entries.set(e,t)}}recordEnd(e){ST&&this._ext!=null&&this._entries.has(e)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}},pfn=class{constructor(){this._candidateTiles=[]}schedule(e){this._candidateTiles.includes(e)||this._candidateTiles.push(e)}reshuffle(e){const t=[];for(const r of this._candidateTiles)e>0?(r.reshuffle(),e--):t.push(r);this._candidateTiles=t}},Yb=class{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=aa.MAP|aa.HITTEST|aa.HIGHLIGHT|aa.DEBUG,this.symbologyPlane=TE.FILL}startup(){}shutdown(e){}postProcess(e,t){}},cYt=class extends roe{};x([Ns(0,As)],cYt.prototype,"pos",void 0);let ffn=class extends YR{},hYt=class extends Lf{};x([zn(Ni)],hYt.prototype,"dotSize",void 0);let Uye=class extends Lf{};x([zn(_f)],Uye.prototype,"locations",void 0),x([zn(Ni)],Uye.prototype,"pixelRatio",void 0),x([zn(Ni)],Uye.prototype,"tileZoomFactor",void 0);const mfn=1e-6;let WU=class extends GJe{vertex(e){const t=new Tf(1,0,0,0,-1,0,0,1,1).multiply(new Ul(e.pos.xy.divide(xo),1)),r=rg(this.draw.locations,t.xy),n=AS(this.instance.dotSize.divide(2),new Ni(1));let s=new Ni(0);s=s.add(vm(r.a,new Ni(mfn)).multiply(2));let o=n.add(this.instance.dotSize);const a=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.add(.5),1)),l=new qo(a.xy,s,1),u=this.instance.dotSize.divide(o),c=new Ni(-1).divide(n.divide(o));return o=o.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:l,glPointSize:o,color:r,ratio:u,invEdgeRatio:c}}fragment(e){const t=_Ce(e.glPointCoord.subtract(.5)).multiply(2),r=WUt(new Ni(0),new Ni(1),e.invEdgeRatio.multiply(t.subtract(e.ratio)).add(1)),n=new Ole;return n.glFragColor=e.color.multiply(r),n}};x([zn(hYt)],WU.prototype,"instance",void 0),x([zn(Uye)],WU.prototype,"draw",void 0),x([zn(E1)],WU.prototype,"view",void 0),x([_u(0,bu(cYt))],WU.prototype,"vertex",null),x([_u(0,bu(ffn))],WU.prototype,"fragment",null);let dYt=class extends nE{};x([Ns(3,Ni)],dYt.prototype,"inverseArea",void 0);let zye=class extends Lf{};x([zn(gf.ofType(qo,2))],zye.prototype,"isActive",void 0),x([zn(gf.ofType(qo,8))],zye.prototype,"colors",void 0),x([zn(Ni)],zye.prototype,"dotValue",void 0);let qU=class extends Lf{};x([zn(_f)],qU.prototype,"dotTexture0",void 0),x([zn(_f)],qU.prototype,"dotTexture1",void 0),x([zn(Ni)],qU.prototype,"tileZoomFactor",void 0),x([zn(Ni)],qU.prototype,"pixelRatio",void 0),x([zn(Ni)],qU.prototype,"tileDotsOverArea",void 0);let YU=class extends ox{_dotThreshold(e,t,r){return e.divide(t).divide(r)}vertex(e){const t=new Tf(2/xo,0,0,0,-2/xo,0,-1,1,1).multiply(new Ul(e.pos,1)),r=this.clip(e.id),n=new qo(t.xy,r,1),s=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),o=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),a=this.draw.tileZoomFactor.multiply(xo).divide(this.draw.pixelRatio),l=this._dotThreshold(s,this.instance.dotValue,this.draw.tileDotsOverArea),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=e.pos.add(.5).divide(a);return{glPosition:n,color:new qo(0,0,0,0),textureCoords:c,thresholds0:l,thresholds1:u}}fragment(e){const t=new Ole,r=rg(this.draw.dotTexture0,e.textureCoords),n=rg(this.draw.dotTexture1,e.textureCoords),s=e.thresholds0.subtract(r),o=e.thresholds1.subtract(n);let a;const l=toe.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),u=toe.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const c=vm(new Ni(0),s),h=vm(new Ni(0),o),p=Cq(c,s).add(Cq(h,o)),m=vm(p,new Ni(0)),v=new Ni(1).subtract(m),w=p.add(m),S=s.multiply(c).divide(w),I=o.multiply(h).divide(w),R=l.multiply(S).add(u.multiply(I));a=v.multiply(R)}else{const c=AS(Qmt(s),Qmt(o)),h=vm(c,new Ni(0)),p=new Ni(1).subtract(h),m=vm(c,s),v=vm(c,o),w=l.multiply(m).add(u.multiply(v));a=p.multiply(w)}return t.glFragColor=a,t}hittest(e){return TCe(this.hittestRequest)}};x([DF],YU.prototype,"blending",void 0),x([zn(zye)],YU.prototype,"instance",void 0),x([zn(qU)],YU.prototype,"draw",void 0),x([_u(0,bu(dYt))],YU.prototype,"vertex",null),x([_u(0,bu(YR))],YU.prototype,"fragment",null);const b7e={[Ti.BYTE]:1,[Ti.UNSIGNED_BYTE]:1,[Ti.SHORT]:2,[Ti.UNSIGNED_SHORT]:2,[Ti.INT]:4,[Ti.UNSIGNED_INT]:4,[Ti.FLOAT]:4};let gfn=class{constructor(e,t){this._boundPart=null;const r=[];for(const s of t.vertex){const o=Aa.createVertex(e,oa.STATIC_DRAW,s);r.push(o)}const n=[];for(const s of t.index||[]){const o=Aa.createIndex(e,oa.STATIC_DRAW,s);n.push(o)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index)throw new Error("No index data.");const{BYTES_PER_ELEMENT:p}=t.index[s.index];p===2?o=Ti.UNSIGNED_SHORT:p===4&&(o=Ti.UNSIGNED_INT)}const a=s.index!=null?n[s.index]:null,l=new Map,u={},c={};for(const p of s.attributes){const{name:m,count:v,type:w,offset:S,normalized:I,divisor:R,stride:L,vertex:k,location:B}=p,$=`vertex-buffer-${k}`;let V=u[$];V||(V=u[$]=[]);const Y=new Vl(m,v,w,S,L,I,R);V.push(Y),l.set(m,B),c[$]=r[k]}const h=new wh(e,l,u,c,a);this.groups.push({...s,vertexArray:h,locations:l,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:r}=this.parts[this._boundPart],{vertexArray:n}=this.groups[r];e.bindVAO(n)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:r}=this.parts[this._boundPart],{group:n}=this.parts[this._boundPart],{indexing:s,primitive:o}=this.groups[n];s?e.drawElements(o,r,s,t*b7e[s]):e.drawArrays(o,t,r)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}},yfn=class pYt extends gfn{static create(e,t){const r=[];let{stride:n,hash:s}=t.layout;if(n==null){n=0;for(const{count:p,type:m,offset:v}of t.layout.attributes){if(v!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");n+=p*b7e[m]}}let o=0,a=0;for(const{count:p,name:m,offset:v,type:w,normalized:S}of t.layout.attributes){v!=null&&(a=v);const I={name:m,location:o,vertex:0,count:p,type:w,offset:a,stride:n,divisor:0,normalized:S!=null&&S};r.push(I),o++,a+=p*b7e[w]}const l={attributes:r,primitive:t.primitive};t.index!=null&&(l.index=0);let{count:u}=t;if(u==null&&(u=t.index?t.index.length:t.vertex.byteLength/n,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${n}.`);const c={start:0,count:u,group:0,primitive:t.primitive},h={vertex:[t.vertex],parts:[c],groups:[l]};return t.index!=null&&(h.index=[t.index]),s==null&&(s=wle(r)),new pYt(e,h,{hash:s,attributes:r,stride:n})}constructor(e,t,r){super(e,t),this.layout=r}bind(e,t=0){super.bind(e,t)}},vfn=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=xo,r=xo,n=new Ua(t,r);n.samplingMode=Is.NEAREST,n.wrapMode=Ls.CLAMP_TO_EDGE;const s=new bCe(e,new Mle(vf.DEPTH_STENCIL,t,r));this._dotFBO=new Wd(e,n,s)}return this._dotFBO}getDotDensityMesh(e){if(this._dotMesh==null){const t=xo,r=t*t,n=2,s=new Int16Array(r*n);for(let l=0;ldi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let Afn=class{destroy(){this._accumulateFramebuffer=ba(this._accumulateFramebuffer),this._resolveGradientTexture=ba(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=Efn(e,Ifn());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==lc.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,r){if(this._accumulateFramebuffer==null){const{dataType:n,samplingMode:s,pixelFormat:o,internalFormat:a}=this.loadQualityProfile(e),l=new Ua(t,r);l.pixelFormat=o,l.internalFormat=a,l.dataType=n,l.samplingMode=s,l.wrapMode=Ls.CLAMP_TO_EDGE;const u=new Mle(vf.DEPTH_STENCIL,t,r);this._accumulateFramebuffer=new Wd(e,l,u)}else{const{width:n,height:s}=this._accumulateFramebuffer;n===t&&s===r||this._accumulateFramebuffer.resize(t,r)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,r){if(this._resolveGradientTexture==null){const n=new Ua;n.wrapMode=Ls.CLAMP_TO_EDGE,this._resolveGradientTexture=new fl(e,n)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(r.length/4,1),this._resolveGradientTexture.setData(r),this._prevGradientHash=t);return this._resolveGradientTexture}};function fYt(i){return i?.25:1}let mYt=class extends nE{};x([Ns(5,As)],mYt.prototype,"offset",void 0);let Mfn=class extends YR{},w7e=class extends Lf{};x([zn(Ni)],w7e.prototype,"radius",void 0),x([zn(Ni)],w7e.prototype,"isFieldActive",void 0);let hte=class extends ox{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){const{radius:t,isFieldActive:r}=this.kernelControls,n=e.offset,s=r.multiply(this.storage.getVVData(e.id).x).add(new Ni(1).subtract(r)),o=this.view.displayViewScreenMat3.multiply(new Ul(e.pos,1)).add(this.view.displayViewMat3.multiply(new Ul(n,0)).multiply(t)),a=this.clip(e.id);return{glPosition:new qo(o.xy,a,1),offset:n,fieldValue:s,color:new qo(0),...this.maybeRunHittest(e,{},null)}}fragment(e){const{offset:t,fieldValue:r}=e,n=_Ce(t),s=vm(n,new Ni(1)),o=new Ni(1).subtract(n.multiply(n)),a=o.multiply(o),l=s.multiply(a).multiply(r).multiply(new Ni(fYt(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new qo(l),e)}hittest(e){const{viewMat3:t,tileMat3:r}=this.view,n=t.multiply(r).multiply(new Ul(e.pos,1));return yJr(n.xy,this.kernelControls.radius,this.hittestRequest.position)}};x([DF],hte.prototype,"usesHalfFloatPrecision",void 0),x([zn(w7e)],hte.prototype,"kernelControls",void 0),x([_u(0,bu(mYt))],hte.prototype,"vertex",null),x([_u(0,bu(Mfn))],hte.prototype,"fragment",null);let gYt=class extends roe{};x([Ns(0,As)],gYt.prototype,"pos",void 0);let Ofn=class extends fH{},Vye=class extends Lf{};x([zn(_f)],Vye.prototype,"texture",void 0),x([zn(As)],Vye.prototype,"minAndInvRange",void 0),x([zn(Ni)],Vye.prototype,"normalization",void 0);let yYt=class extends Lf{};x([zn(_f)],yYt.prototype,"texture",void 0);let XU=class extends GJe{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new qo(e.pos.multiply(2).subtract(1),1,1),uv:e.pos}}fragment(e){const{accumulatedDensity:t,gradient:r}=this;let n=rg(t.texture,e.uv).r.multiply(new Ni(fYt(this.usesHalfFloatPrecision)));n=n.multiply(t.normalization),n=n.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const s=rg(r.texture,new As(n,.5)),o=new Ole;return o.glFragColor=new qo(s.rgb.multiply(s.a),s.a),o}};x([DF],XU.prototype,"usesHalfFloatPrecision",void 0),x([zn(Vye)],XU.prototype,"accumulatedDensity",void 0),x([zn(yYt)],XU.prototype,"gradient",void 0),x([_u(0,bu(gYt))],XU.prototype,"vertex",null),x([_u(0,bu(Ofn))],XU.prototype,"fragment",null);let Pfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.HeatmapMeshWriter,this.shaders={accumulate:new hte,resolve:new XU},this.postProcessingEnabled=!0,this._isBound=!1,this._resources=new Map,this.overrideStencilRef=vYt}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:r,painter:n,state:s}=e,o=t.instance.getInput(),{isFieldActive:a}=o,l=this._getOrCreateResourcesRecord(r),u=l.loadQualityProfile(r);if(yoe(e))return;fg(e)||this._bind(e,l,o),n.setShader({shader:this.shaders.accumulate,uniforms:{...l_(e,t.target),kernelControls:{radius:Kvt(o,s),isFieldActive:a?1:0}},defines:{...zv(e),...u.defines},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)});const c=fg(e)?Dfn:_Yt;n.setPipelineState(c),n.submitDraw(r,t)}postProcess(e,t){if(fg(e)||yoe(e))return;const{context:r,painter:n}=e,s=this._resources.get(r);if(this._prevFBO==null||this._prevViewport==null||!s?.initialized)return;const{defines:o}=s.loadQualityProfile(r),{minDensity:a,maxDensity:l,radius:u}=t.getInput(),c=8,h=9,p=s.accumulateFramebuffer,m=s.resolveGradientTexture;n.setShader({shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:c,texture:p.colorTexture},minAndInvRange:[a,1/(l-a)],normalization:3/(u*u*Math.PI)},gradient:{texture:{unit:h,texture:m}}},defines:o,optionalAttributes:{},useComputeBuffer:!1}),r.bindFramebuffer(this._prevFBO),r.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),r.bindTexture(p.colorTexture,c),r.bindTexture(m,h),n.setPipelineState(Ffn),n.submitDrawQuad(r),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new Afn,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,r){if(this._isBound)return;const{context:n,state:s,pixelRatio:o}=e,a=n.getBoundFramebufferObject(),l=n.getViewport();this._prevFBO=a,this._prevViewport=l;const{gradient:u,gradientHash:c}=r;t.ensureResolveGradientTexture(n,c,u);const{width:h,height:p}=l,m=Rfn(Kvt(r,s),o),v=h*m,w=p*m,S=t.ensureAccumulateFBO(n,v,w);n.blitFramebuffer(a,S,0,0,a.width,a.height,0,0,S.width,S.height,lb.STENCIL_BUFFER_BIT,Is.NEAREST),n.bindFramebuffer(S),n.setViewport(0,0,S.width,S.height),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.clear(lb.COLOR_BUFFER_BIT),this._isBound=!0}};function Rfn(i,e){const t=e>1.5?.25:.5;return i<1/(2*t)?1:t}function vYt(i){return i.key.level+1}const _Yt={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:vYt,compare:Hl.GEQUAL,mask:255,op:{fail:il.KEEP,zFail:il.KEEP,zPass:il.REPLACE}}}},Dfn={..._Yt,stencil:!1},Ffn={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function Kvt(i,e){const{referenceScale:t,radius:r}=i;return r*(t!==0?t/e.scale:1)}let jKe=class extends Lf{getVVRotationMat4(e){return Rh(IR(e),toe.identity(),()=>{const t=this._getNormalizedAngle(e).multiply(Cmt),r=ioe(t),n=Abe(t);return new toe(n,r,0,0,r.multiply(new Ni(-1)),n,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Rh(IR(e),Tf.identity(),()=>{const t=this._getNormalizedAngle(e).multiply(Cmt),r=ioe(t),n=Abe(t);return new Tf(n,r,0,r.multiply(new Ni(-1)),n,0,0,0,1)})}_getNormalizedAngle(e){const t=Ale(this.rotationType,new Ni(eoe.Arithmatic));return Rh(t,new Ni(90).subtract(e),e)}};x([zn(Ni)],jKe.prototype,"rotationType",void 0);const kfn=360/254;let ZT=class extends nE{};x([Ns(3,qo)],ZT.prototype,"color",void 0),x([Ns(4,As)],ZT.prototype,"offset",void 0),x([Ns(5,As)],ZT.prototype,"textureUV",void 0),x([Ns(6,Ni)],ZT.prototype,"fontSize",void 0),x([Ns(7,Ni)],ZT.prototype,"referenceSize",void 0),x([Ns(8,Ni)],ZT.prototype,"haloFontSize",void 0),x([Ns(9,qo)],ZT.prototype,"haloColor",void 0),x([Ns(10,As)],ZT.prototype,"zoomRange",void 0),x([Ns(11,Ni)],ZT.prototype,"clipAngle",void 0),x([Ns(12,qo)],ZT.prototype,"referenceSymbol",void 0);let x7e=class extends jJe{};x([Ns(13,As)],x7e.prototype,"offsetNextVertex1",void 0),x([Ns(14,As)],x7e.prototype,"offsetNextVertex2",void 0);let Lfn=class extends YR{},I1=class extends ox{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,r){const n=t.multiply(kfn),s=kJe(this.view.rotation.subtract(n)),o=Eq(new Ni(360).subtract(s),s);let a=new Ni(0);const l=HUt(this.view.currentZoom.multiply(xq)).divide(xq),u=e.x,c=e.y,h=new Ni(1).subtract(vm(u,l)).multiply(2),p=vm(new Ni(90),o).multiply(2),m=new Ni(2).multiply(new Ni(1).subtract(vm(l,c)));return a=a.add(r.multiply(h)),a=a.add(r.multiply(p)),a=a.add(m),a}vertex(e,t){const r=dg(e.bitset,wUt),n=new Ni(1).subtract(r);let s=e.fontSize,o=s.divide(Emt);const a=this.isHaloPass?e.haloColor:this._getVertexColor(e),l=this.isLabel?a.multiply(this.storage.getAnimationValue(e.id)):a,u=this.view.displayViewScreenMat3.multiply(new Ul(e.pos,1));let c=e.offset,h=new Ni(1),p=Tf.identity();if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const L=e.referenceSymbol,k=L.xy,B=L.z,$=this._unpackDirection(L.w),V=Obe(this,e.id,B).divide(2),Y=$.multiply(V.add(hee));c=c.add(k).add(Y)}else h=Obe(this,e.id,e.referenceSize).divide(e.referenceSize),s=s.multiply(h),o=o.multiply(h),c=c.multiply(h),p=azt(this,e.id),c=p.multiply(new Ul(c,0)).xy;const m=dg(e.bitset,xUt),v=this._getViewRotationMatrix(m).multiply(new Ul(c,0));let w=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,m):this.clip(e.id,e.zoomRange);w=this.isBackgroundPass?w.add(n.multiply(2)):w.add(r.multiply(2));const S=new qo(u.xy.add(v.xy),w,1),I=e.textureUV.divide(this.mosaicInfo.size);let R=new Ni(0);return this.isHaloPass&&(R=e.haloFontSize.divide(o).divide(NYr)),{glPosition:S,color:l,size:o,textureUV:I,antialiasingWidth:new Ni(.105*Emt).divide(s).divide(this.view.pixelRatio),haloDistanceOffset:R,...this.maybeRunHittest(e,t,{vvSizeAdjustment:h,vvRotation:p})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,r=this.view.displayMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}fragment(e){const t=new Ni(.25),r=new Ni(1).subtract(t),n=rg(this.mosaicInfo.texture,e.textureUV).a;let s=r.subtract(e.haloDistanceOffset);this.highlight&&(s=s.divide(2));const o=e.antialiasingWidth,a=WUt(s.subtract(o),s.add(o),n);return this.getFragmentOutput(e.color.multiply(a),e)}hittest(e,t,{vvSizeAdjustment:r,vvRotation:n}){const s=n.multiply(new Ul(e.offset.multiply(r),0)),o=n.multiply(new Ul(t.offsetNextVertex1.multiply(r),0)),a=n.multiply(new Ul(t.offsetNextVertex2.multiply(r),0)),{viewMat3:l,tileMat3:u}=this.view,c=l.multiply(u).multiply(new Ul(e.pos,1)),h=c.add(u.multiply(s)).xy,p=c.add(u.multiply(o)).xy,m=c.add(u.multiply(a)).xy;return szt(this.hittestRequest.position,h.xy,p.xy,m.xy)}_unpackDirection(e){const t=new rE(e),r=pXr(t,new rE(2)),n=fXr(t,new rE(3));return new As(new Ni(r).subtract(1),new Ni(n).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const r=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(r,e.color,new Kx(!1))}if(this.visualVariableOpacity){const r=this.storage.getOpacityValue(e.id),n=this.visualVariableOpacity.getOpacity(r);t=t.multiply(n)}return t}};x([jc(OB)],I1.prototype,"visualVariableColor",void 0),x([jc(PB)],I1.prototype,"visualVariableOpacity",void 0),x([jc(jKe)],I1.prototype,"visualVariableRotation",void 0),x([jc(Ple)],I1.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],I1.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],I1.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],I1.prototype,"visualVariableSizeUnitValue",void 0),x([zn(AR)],I1.prototype,"mosaicInfo",void 0),x([DF],I1.prototype,"isHaloPass",void 0),x([DF],I1.prototype,"isBackgroundPass",void 0),x([DF],I1.prototype,"isLabel",void 0),x([_u(0,bu(ZT)),_u(1,bu(x7e))],I1.prototype,"vertex",null),x([_u(0,bu(Lfn))],I1.prototype,"fragment",null);let Nfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.LabelMeshWriter,this.shaders={geometry:new I1},this.drawPhase=aa.LABEL|aa.LABEL_ALPHA,this.symbologyPlane=TE.TEXT}render(e,t){const{context:r,painter:n}=e,s=zv(e),o={...u_(e)},a={shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...s,isHaloPass:!1,isBackgroundPass:!0,isLabel:!0},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:!1};n.setShader(a),n.setPipelineState(o),n.submitDraw(r,t),n.setShader({...a,defines:{...s,isHaloPass:!0,isBackgroundPass:!1,isLabel:!0}}),n.setPipelineState(o),n.submitDraw(r,t),n.setShader({...a,defines:{...s,isHaloPass:!1,isBackgroundPass:!1,isLabel:!0}}),n.setPipelineState(o),n.submitDraw(r,t)}},$fn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.LineMeshWriter,this.shaders={geometry:new cC},this.symbologyPlane=TE.LINE}render(e,t){const{context:r,painter:n,pixelRatio:s}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),antialiasingControls:Gle(s)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Hye=class extends x5{};x([Ns(9,Ni)],Hye.prototype,"accumulatedDistance",void 0),x([Ns(10,As)],Hye.prototype,"segmentDirection",void 0),x([Ns(11,qo)],Hye.prototype,"tlbr",void 0);let S7e=class extends cC{_getLineWidthRatio(e,t){const r=new Ni(vzt),n=dg(e.bitset,_Ut);return n.multiply(AS(t,new Ni(.25))).add(new Ni(1).subtract(n)).divide(r)}_getSDFAlpha(e){const{halfWidth:t,normal:r,tlbr:n,patternSize:s,accumulatedDistance:o,lineWidthRatio:a}=e,l=s.x.multiply(new Ni(2)).multiply(a),u=Mbe(o.divide(l)),c=new Ni(.25).multiply(r.y).add(new Ni(.5)),h=A3(n.xy,n.zw,new As(u,c)),p=UJe(rg(this.mosaicInfo.texture,h)).subtract(new Ni(.5)).multiply(t),m=Tq(new Ni(.5).subtract(p),new Ni(0),new Ni(1));return new qo(m)}_getPatternColor(e){const{halfWidth:t,normal:r,color:n,accumulatedDistance:s,patternSize:o,sampleAlphaOnly:a,tlbr:l}=e,u=o.y.multiply(new Ni(2).multiply(t).divide(o.x)),c=Mbe(s.divide(u)),h=new Ni(.5).multiply(r.y).add(new Ni(.5)),p=A3(l.xy,l.zw,new As(h,c));let m=rg(this.mosaicInfo.texture,p);return this.visualVariableColor!=null&&(m=Rh(Uv(a,new Ni(.5)),new qo(n.a),n)),m}vertex(e,t){const{segmentDirection:r,tlbr:n,bitset:s}=e,o=VJe(this,e),a=e.accumulatedDistance.divide(this.view.displayZoomFactor).add(Cq(r,o.scaledOffset)),l=new As(n.z.subtract(n.x),n.w.subtract(n.y)),u=n.divide(this.mosaicInfo.size.xyxy),c=dg(s,bUt),h=dg(s,mCe),p=Rh(Uv(c,new Ni(.5)),this._getLineWidthRatio(e,o.scaledHalfWidth),new Ni(1));return{...o,tlbr:u,patternSize:l,accumulatedDistance:a,isSDF:c,sampleAlphaOnly:h,lineWidthRatio:p,...this.maybeRunHittest(e,t,o.halfWidth)}}fragment(e){const{color:t,opacity:r,isSDF:n}=e,s=dzt(e,this.antialiasingControls.blur),o=Rh(Uv(n,new Ni(.5)),this._getSDFAlpha(e),this._getPatternColor(e)),a=t.multiply(r).multiply(s).multiply(o);return this.getFragmentOutput(a,e)}};x([zn(AR)],S7e.prototype,"mosaicInfo",void 0),x([_u(0,bu(Hye)),_u(1,bu(M3))],S7e.prototype,"vertex",null);let Bfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.TexturedLineMeshWriter,this.shaders={geometry:new S7e},this.symbologyPlane=TE.LINE}render(e,t){const{context:r,painter:n,pixelRatio:s}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),antialiasingControls:Gle(s),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},_O=class extends nE{};x([Ns(3,qo)],_O.prototype,"color",void 0),x([Ns(4,qo)],_O.prototype,"outlineColor",void 0),x([Ns(5,As)],_O.prototype,"offset",void 0),x([Ns(6,As)],_O.prototype,"textureUV",void 0),x([Ns(7,qo)],_O.prototype,"sizing",void 0),x([Ns(8,Ni)],_O.prototype,"placementAngle",void 0),x([Ns(9,Ni)],_O.prototype,"sizeRatio",void 0),x([Ns(10,As)],_O.prototype,"zoomRange",void 0);let dte=class extends jJe{};x([Ns(12,As)],dte.prototype,"offsetNextVertex1",void 0),x([Ns(13,As)],dte.prototype,"offsetNextVertex2",void 0),x([Ns(14,As)],dte.prototype,"textureUVNextVertex1",void 0),x([Ns(15,As)],dte.prototype,"textureUVNextVertex2",void 0);let jfn=class extends YR{};function FM(i,e,t,r){return e.multiply(i.x).add(t.multiply(i.y)).add(r.multiply(i.z))}function rRe(i){return i.multiply(i).divide(128)}let QT=class extends ox{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(e,t){const r=rRe(e.sizing.x),n=rRe(e.sizing.y),s=rRe(e.sizing.z),o=e.placementAngle,a=dg(e.bitset,gA.bitset.isSDF),l=dg(e.bitset,gA.bitset.isMapAligned),u=dg(e.bitset,gA.bitset.scaleSymbolsProportionally),c=dJr(e.bitset,gA.bitset.colorLocked),h=ECe(this,e.id),p=CCe(this,e.id,e.color,c).multiply(h),m=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),v=Obe(this,e.id,s).divide(s),w=r.multiply(v),S=e.offset.xy.multiply(v);let I=n.multiply(u.multiply(v.subtract(1)).add(1));I=Eq(I,AS(w.subtract(.99),new Ni(0)));const R=AS(I,new Ni(1)),L=Eq(I,new Ni(1)),k=Tf.fromRotation(o.multiply(fUt)),B=azt(this,e.id),$=this._getViewRotationMatrix(l).multiply(B).multiply(k).multiply(new Ul(S.xy,0)),V=this.clip(e.id,e.zoomRange),Y=new qo(m.xy.add($.xy),V,1),K=e.textureUV.divide(this.mosaicInfo.size),Q=e.outlineColor.multiply(L),re=dg(e.bitset,gA.bitset.overrideOutlineColor),ne=e.sizeRatio.multiply(w).multiply(.5);return{glPosition:Y,color:p,textureUV:K,outlineColor:Q,outlineSize:R,distanceToPx:ne,isSDF:a,overrideOutlineColor:re,...this.maybeRunHittest(e,t,{pos:e.pos,size:w,sizeCorrection:v,isMapAligned:l,outlineSize:R,distanceToPx:ne,isSDF:a})}}fragment(e){const t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,r){return Rh(zUt(r.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,r),this._hittestMarker(e,t,r))}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,r=this.view.displayMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}_getViewScreenMatrix(e){const t=this.view.viewMat3.multiply(this.view.tileMat3),r=this.view.tileMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}_getColor(e,t){return Rh(Ale(t.isSDF,new Ni(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return rg(this.mosaicInfo.texture,e).multiply(t.color)}_getSDFColor(e,t){const r=rg(this.mosaicInfo.texture,e),n=new Ni(.5).subtract(UJe(r)).multiply(t.distanceToPx).multiply(FYr),s=Tq(new Ni(.5).subtract(n),new Ni(0),new Ni(1)),o=t.color.multiply(s);let a=t.outlineSize;this.highlight&&(a=AS(a,t.overrideOutlineColor.multiply(4)));const l=a.multiply(.5),u=kJe(n).subtract(l),c=Tq(new Ni(.5).subtract(u),new Ni(0),new Ni(1)),h=A3(t.outlineColor,t.color,t.overrideOutlineColor).multiply(c);return new Ni(1).subtract(h.a).multiply(o).add(h)}_hittestSmallMarker(e,t,r){const{position:n,distance:s,smallSymbolDistance:o}=this.hittestRequest,a=s.subtract(o),{viewMat3:l,tileMat3:u}=this.view,c=l.multiply(u).multiply(new Ul(r.pos,1)).xy,h=r.size.multiply(.5);return $Je(c,n).subtract(h).add(a)}_hittestMarker(e,t,r){const{pos:n,size:s,sizeCorrection:o,isMapAligned:a,outlineSize:l,isSDF:u,distanceToPx:c}=r,h=new Ul(e.offset.multiply(o),0),p=new Ul(t.offsetNextVertex1.multiply(o),0),m=new Ul(t.offsetNextVertex2.multiply(o),0),{viewMat3:v,tileMat3:w}=this.view,S=v.multiply(w).multiply(new Ul(n,1)),I=this._getViewScreenMatrix(a),R=S.add(I.multiply(h)).xy,L=S.add(I.multiply(p)).xy,k=S.add(I.multiply(m)).xy,B=this.hittestRequest.position,$=this.hittestRequest.distance,V=PI(B.add(new As(cA($),cA($))),R,L,k),Y=PI(B.add(new As(0,cA($))),R,L,k),K=PI(B.add(new As($,cA($))),R,L,k),Q=PI(B.add(new As(cA($),0)),R,L,k),re=PI(B,R,L,k),ne=PI(B.add(new As($,0)),R,L,k),de=PI(B.add(new As(cA($),$)),R,L,k),pe=PI(B.add(new As(0,$)),R,L,k),H=PI(B.add(new As($,$)),R,L,k),Z=e.textureUV.divide(this.mosaicInfo.size),ae=t.textureUVNextVertex1.divide(this.mosaicInfo.size),fe=t.textureUVNextVertex2.divide(this.mosaicInfo.size),be={color:new qo(1),outlineColor:new qo(1),overrideOutlineColor:new Ni(1),outlineSize:l,distanceToPx:c,isSDF:u};let _e=new Ni(0);return _e=_e.add(OI(V).multiply(this._getColor(FM(V,Z,ae,fe),be).a)),_e=_e.add(OI(Y).multiply(this._getColor(FM(Y,Z,ae,fe),be).a)),_e=_e.add(OI(K).multiply(this._getColor(FM(K,Z,ae,fe),be).a)),_e=_e.add(OI(Q).multiply(this._getColor(FM(Q,Z,ae,fe),be).a)),_e=_e.add(OI(re).multiply(this._getColor(FM(re,Z,ae,fe),be).a)),_e=_e.add(OI(ne).multiply(this._getColor(FM(ne,Z,ae,fe),be).a)),_e=_e.add(OI(de).multiply(this._getColor(FM(de,Z,ae,fe),be).a)),_e=_e.add(OI(pe).multiply(this._getColor(FM(pe,Z,ae,fe),be).a)),_e=_e.add(OI(H).multiply(this._getColor(FM(H,Z,ae,fe),be).a)),vm(_e,new Ni(.05)).multiply(TCe(this.hittestRequest))}};x([jc(OB)],QT.prototype,"visualVariableColor",void 0),x([jc(PB)],QT.prototype,"visualVariableOpacity",void 0),x([jc(jKe)],QT.prototype,"visualVariableRotation",void 0),x([jc(Ple)],QT.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],QT.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],QT.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],QT.prototype,"visualVariableSizeUnitValue",void 0),x([zn(AR)],QT.prototype,"mosaicInfo",void 0),x([_u(0,bu(_O)),_u(1,bu(dte))],QT.prototype,"vertex",null),x([_u(0,bu(jfn))],QT.prototype,"fragment",null);let Gfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.MarkerMeshWriter,this.shaders={geometry:new QT},this.symbologyPlane=TE.MARKER}render(e,t){const{context:r,painter:n}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey,!0)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Ufn=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,s])=>`${n}.${s}`).join("."),r=Q1(t);this._locationInfo={hash:r,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,r]of this.locationsMap.entries())e.set("a_"+t,r);return e}getShaderKey(e,t,r){const n=Object.keys(r).filter(o=>r[o]).map(o=>`${o}_${r[o].toString()}`).join("."),s=Object.keys(t).filter(o=>this.optionPropertyKeys.has(o)).join(".");return`${e.hash}.${n}.${s}`}getProgram(e,t,r,n){let s="",o="";for(const a in r)if(r[a]){const l=typeof r[a]=="boolean"?`#define ${a} +}`}};function Ldn(i){let e=kdn;return i.split("/").forEach(t=>{e&&(e=e[t])}),e}const Ndn=new kKe(Ldn);function Ub(i){return Ndn.resolveIncludes(i)}const Rvt=i=>mX({PATTERN:i.pattern}),$dn={shaders:i=>({vertexShader:Rvt(i)+Ub("background/background.vert"),fragmentShader:Rvt(i)+Ub("background/background.frag")})},Bdn={shaders:i=>({vertexShader:Ub("circle/circle.vert"),fragmentShader:Ub("circle/circle.frag")})},Dvt=i=>mX({PATTERN:i.pattern}),jdn={shaders:i=>({vertexShader:Dvt(i)+Ub("fill/fill.vert"),fragmentShader:Dvt(i)+Ub("fill/fill.frag")})},Gdn={shaders:i=>({vertexShader:Ub("outline/outline.vert"),fragmentShader:Ub("outline/outline.frag")})},Fvt=i=>mX({SDF:i.sdf}),Udn={shaders:i=>({vertexShader:Fvt(i)+Ub("icon/icon.vert"),fragmentShader:Fvt(i)+Ub("icon/icon.frag")})},kvt=i=>mX({PATTERN:i.pattern,SDF:i.sdf}),zdn={shaders:i=>({vertexShader:kvt(i)+Ub("line/line.vert"),fragmentShader:kvt(i)+Ub("line/line.frag")})},Vdn={shaders:i=>({vertexShader:Ub("text/text.vert"),fragmentShader:Ub("text/text.frag")})};let Hdn=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,t,r){const n=t.key<<3|this._getMaterialOptionsValue(t.type,r);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(t.type),{shaders:o}=s,{vertexShader:a,fragmentShader:l}=o(r),u=t.getShaderHeader(),c=t.getShaderMain(),h=a.replace("#pragma header",u).replace("#pragma main",c),p=e.programCache.acquire(h,l,t.getAttributeLocations());return this._programByKey.set(n,p),p}_getMaterialOptionsValue(e,t){switch(e){case up.BACKGROUND:return(t.pattern?1:0)<<1;case up.FILL:return(t.pattern?1:0)<<1;case up.OUTLINE:return 0;case up.LINE:{const r=t;return(r.sdf?1:0)<<2|(r.pattern?1:0)<<1}case up.ICON:return(t.sdf?1:0)<<1;case up.CIRCLE:case up.TEXT:default:return 0}}_getProgramTemplate(e){switch(e){case up.BACKGROUND:return $dn;case up.CIRCLE:return Bdn;case up.FILL:return jdn;case up.ICON:return Udn;case up.LINE:return zdn;case up.OUTLINE:return Gdn;case up.TEXT:return Vdn;default:return null}}};const Lvt={shaders:{vertexShader:Rm("bitBlit/bitBlit.vert"),fragmentShader:Rm("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])};let iYt=class{constructor(){this._initialized=!1}dispose(){this._program=ba(this._program),this._vertexArrayObject=ba(this._vertexArrayObject)}render(e,t,r,n){e&&(this._initialized||this._initialize(e),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.bindVAO(this._vertexArrayObject),e.useProgram(this._program),t.setSamplingMode(r),e.bindTexture(t,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",n),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindTexture(null,0),e.bindVAO())}_initialize(e){if(this._initialized)return!0;const t=R3(e,Lvt);if(!t)return!1;const r=new Int8Array(16);r[0]=-1,r[1]=-1,r[2]=0,r[3]=0,r[4]=1,r[5]=-1,r[6]=1,r[7]=0,r[8]=-1,r[9]=1,r[10]=0,r[11]=1,r[12]=1,r[13]=1,r[14]=1,r[15]=1;const n=Lvt.attributes,s=new wh(e,n,cdn,{geometry:Aa.createVertex(e,oa.STATIC_DRAW,r)});return this._program=t,this._vertexArrayObject=s,this._initialized=!0,!0}};const Wdn=i=>{let e="";e+=i[0].toUpperCase();for(let t=1;t{const e={};for(const t in i)e[Wdn(t)]=i[t];return mX(e)},rYt=(i,e,t,r)=>{const n=i+i.substring(i.lastIndexOf("/")),s=e+e.substring(e.lastIndexOf("/")),o=qdn(r);return{attributes:t,shaders:{vertexShader:o+Rm(`${n}.vert`),fragmentShader:o+Rm(`${s}.frag`)}}};let Ydn=class{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const r=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(r))return this._programByKey.get(r);const n={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,h)=>({...c,[h.name]:h.value}),{})},{vsPath:s,fsPath:o,attributes:a}=e,l=rYt(s,o,a,n),u=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!u)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(r,u),u}},Xdn=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(e){return this._resourceMap.get(e)??null}async fetchResource(e,t){const r=this._resourceMap.get(e);if(r)return{width:r.width,height:r.height};let n=this._inFlightResourceMap.get(e);return n?n.then(s=>({width:s.width,height:s.height})):(n=O5t(e,t),this._inFlightResourceMap.set(e,n),n.then(s=>(this._inFlightResourceMap.delete(e),this._resourceMap.set(e,s),{width:s.width,height:s.height}),()=>({width:0,height:0})))}deleteResource(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}loadFont(e){return wqr(e)}};const Jdn=i=>i==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function Kdn(i,e,t){const r=e.style,n=x5e(Math.ceil(t)),s=Jdn(r)?8*n:16*n,o=2*n;i.width=s,i.height=s;const a=i.getContext("2d");a.strokeStyle="#FFFFFF",a.lineWidth=n,a.beginPath(),r!=="vertical"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSVertical"||(a.moveTo(s/2,-o),a.lineTo(s/2,s+o)),r!=="horizontal"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSHorizontal"||(a.moveTo(-o,s/2),a.lineTo(s+o,s/2)),r!=="backward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSDiagonalCross"&&r!=="esriSFSBackwardDiagonal"||(a.moveTo(-o,-o),a.lineTo(s+o,s+o),a.moveTo(s-o,-o),a.lineTo(s+o,o),a.moveTo(-o,s-o),a.lineTo(o,s+o)),r!=="forward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSForwardDiagonal"&&r!=="esriSFSDiagonalCross"||(a.moveTo(s+o,-o),a.lineTo(-o,s+o),a.moveTo(o,-o),a.lineTo(-o,o),a.moveTo(s+o,s-o),a.lineTo(s-o,s+o)),a.stroke();const l=a.getImageData(0,0,i.width,i.height),u=new Uint8Array(l.data);let c;for(let h=0;h=p||h>=p){const m=c/h;m>1?(c=p,h=Math.round(p/m)):(h=p,c=Math.round(p*m)),u=new Uint8Array(4*c*h);const v=new Uint8ClampedArray(u.buffer);Xtr(a,e,t,v,c,h,!1)}return{size:[c,h],image:new Uint32Array(u.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}},rwe=class{constructor(e,t){this._width=0,this._height=0,this._free=[],this._width=e,this._height=t,this._free.push(new _d(0,0,e,t))}get width(){return this._width}get height(){return this._height}allocate(e,t){if(e>this._width||t>this._height)return new _d;let r=null,n=-1;for(let s=0;se&&this._free.push(new _d(r.x+e,r.y,r.width-e,t)),r.height>t&&this._free.push(new _d(r.x,r.y+t,r.width,r.height-t))):(r.width>e&&this._free.push(new _d(r.x+e,r.y,r.width-e,r.height)),r.height>t&&this._free.push(new _d(r.x,r.y+t,e,r.height-t))),new _d(r.x,r.y,e,t))}release(e){for(let t=0;tMath.floor(i/256);function ipn(i){const e=new Set;for(const t of i)e.add(tpn(t));return e}function rpn(i,e,t){return i.has(e)||i.set(e,t().then(()=>{i.delete(e)}).catch(r=>{i.delete(e),l3(r)})),i.get(e)}const npn=i=>({rect:new _d(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:i,sdf:!0});let spn=class{constructor(e,t,r){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=e,this.height=t,this._glyphSource=r,this._binPack=new rwe(e-4,t-4),this._glyphData.push(new Uint8Array(e*t)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const e of this._textures)e&&e.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const e=[117,149,181,207,207,181,149,117],t=[],r=[];for(let o=0;o=3&&o<5&&l>=3&&l<8?255:0;t.push(a),r.push(u)}}const n={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)},s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(r)};this._recordGlyph(n),this._recordGlyph(s)}getTexture(e,t){if(!this._textures[t]){const r=new Ua;r.pixelFormat=ks.ALPHA,r.wrapMode=Ls.CLAMP_TO_EDGE,r.width=this.width,r.height=this.height,this._textures[t]=new fl(e,r,new Uint8Array(this.width*this.height))}return this._dirties[t]&&(this._textures[t].setData(this._glyphData[t]),this._dirties[t]=!1),this._textures[t]}async getGlyphItems(e,t,r){const n=this._getGlyphCache(e);return await this._fetchRanges(e,t,r),t.map(s=>this._getMosaicItem(n,e,s))}bind(e,t,r,n){const s=this.getTexture(e,r);s.setSamplingMode(t),e.bindTexture(s,n)}preloadASCIIGlyphCache(e){const t=this._preloadCache[e];if(t!=null)return t;const r=this._glyphSource.preloadASCIIRange(e).then(()=>{const n=this._getGlyphCache(e);for(let s=0;s<256;s++)this._getMosaicItem(n,e,s)});return this._preloadCache[e]=r,r}_getGlyphCache(e){return this._glyphCache[e]||(this._glyphCache[e]={}),this._glyphCache[e]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(e,t,r){const n=ipn(t),s=[];n.forEach(o=>{s.push(this._fetchRange(e,o,r))}),await Promise.all(s)}async _fetchRange(e,t,r){if(t>epn)return;const n=e+t;return rpn(this._rangePromises,n,()=>this._glyphSource.getRange(e,t,r))}_getMosaicItem(e,t,r){if(!e[r]){const n=this._glyphSource.getGlyph(t,r);if(!n?.metrics)return npn(r);const s=this._recordGlyph(n),o=this._currentPage,a=n.metrics;e[r]={rect:s,page:o,metrics:a,code:r,sdf:!0},this._invalidate()}return e[r]}_recordGlyph(e){const t=e.metrics;let r;if(t.width===0)r=new _d(0,0,0,0);else{const s=t.width+6,o=t.height+2*3;r=this._binPack.allocate(s,o),r.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new rwe(this.width-4,this.height-4),r=this._binPack.allocate(s,o));const a=this._glyphData[this._currentPage],l=e.bitmap;let u,c;if(l)for(let h=0;h{n.addRange(t,new Nvt(new g3(new Uint8Array(l.data),new DataView(l.data))))})}async preloadASCIIRange(e){const t=this._getFontStack(e),r=0,n=255,s=this._baseURL.replace("{fontstack}",e).replace("{range}",r+"-"+n),o=await zi(s,{responseType:"array-buffer"}),a=new Nvt(new g3(new Uint8Array(o.data),new DataView(o.data)));for(let l=r;l<=n;l++)t.getRange(l)||t.addRange(l,a)}getGlyph(e,t){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(t/256),s=r.getRange(n);return s?{metrics:s.getMetrics(t),bitmap:s.getBitmap(t)}:void 0}_getFontStack(e){let t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new opn),t}};const FK=1e20;let lpn=class{constructor(e){this._svg=null,this.size=e;const t=document.createElement("canvas");t.width=t.height=e,this._context=t.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(e*e),this._gridInner=new Float64Array(e*e),this._f=new Float64Array(e),this._d=new Float64Array(e),this._z=new Float64Array(e+1),this._v=new Int16Array(e)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg&&(document.body.removeChild(this._svg),this._svg=null)}draw(e,t,r,n=31){this._initSVG();const s=this.createSVGString(e,t);return new Promise((o,a)=>{const l=new Image;l.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(s),l.onload=()=>{l.onload=null,this._context.clearRect(0,0,this.size,this.size),this._context.drawImage(l,0,0,this.size,this.size);const c=this._context.getImageData(0,0,this.size,this.size),h=new Uint8Array(this.size*this.size*4);for(let p=0;pa(Oc()))})}_initSVG(){if(!this._svg){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),this._svg=e}return this._svg}createSVGString(e,t){const r=this._initSVG(),n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",e),r.appendChild(n);const s=n.getBBox(),o=s.width/s.height,a=this.size/2;let l,u,c;if(o>1){l=a/s.width;const v=a*(1/o);u=this.size/4,c=a-v/2}else l=a/s.height,u=a-a*o/2,c=this.size/4;const h=-s.x*l+u,p=-s.y*l+c;n.setAttribute("style",`transform: matrix(${l}, 0, 0, ${l}, ${h}, ${p})`),n.setAttribute("stroke-width",""+.5/l);const m=`${r.innerHTML}`;return r.removeChild(n),m}_edt(e,t,r){const n=this._f,s=this._d,o=this._v,a=this._z;for(let l=0;l0&&(this._maxItemSize=r),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new rwe(this._pageWidth,this._pageHeight);const n=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(n*s)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],r=t.mosaicsData;if(!UD(t.mosaicsData))throw new qe("mapview-invalid-resource","unsuitable data type!");const n=e.spriteData,s=r.data;s&&n||console.error("Source or target images are uninitialized!"),sYt._copyBits(n,e.spriteSize[0],0,0,s,e.pageSize[0],e.rect.x+Qg,e.rect.y+Qg,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Qg,t+=2*Qg;const r=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizee.toBlob(n,t));if(!r)throw new qe("imageToArrayBuffer","Failed to encode image");return{data:await r.arrayBuffer(),type:t}}async function dpn(i){if(!(i instanceof HTMLImageElement))return"image/png";const e=i.src;if(Vx(e)){const t=lR(e);return t?.mediaType==="image/jpeg"?t.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function oYt(i){if(i instanceof HTMLCanvasElement)return i;if(i instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const t=e.getContext("2d");return i instanceof HTMLImageElement?t.drawImage(i,0,0,i.width,i.height):i instanceof ImageData&&t.putImageData(i,0,0),e}function ppn(i){const e=[],t=new Uint8Array(i);for(let r=0;re+t,0)}function gpn(i){const{width:e,height:t}=i,r=i.frameDurations.reverse(),n=s=>{const o=i.frameDurations.length-1-s;return i.getFrame(o)};return{frameCount:i.frameCount,duration:i.duration,frameDurations:r,getFrame:n,width:e,height:t}}function ypn(i,e){const{width:t,height:r,getFrame:n}=i,s=e/i.duration,o=i.frameDurations.map(a=>a*s);return{frameCount:i.frameCount,duration:i.duration,frameDurations:o,getFrame:n,width:t,height:r}}function vpn(i,e){const{width:t,height:r,getFrame:n}=i,s=i.frameDurations.slice(),o=s.shift();return s.unshift(o+e),{frameCount:i.frameCount,duration:i.duration+e,frameDurations:s,getFrame:n,width:t,height:r}}function jvt(i,e){const{width:t,height:r,getFrame:n}=i,s=i.frameDurations.slice(),o=s.pop();return s.push(o+e),{frameCount:i.frameCount,duration:i.duration+e,frameDurations:s,getFrame:n,width:t,height:r}}let _pn=class{constructor(e,t,r,n){this._animation=e,this._repeatType=r,this._onFrameData=n,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let s=0;for(;t>s;)s+=this.timeToFrame,this.nextFrame();const o=this._animation.getFrame(this._currentFrame);this._onFrameData(o)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case pb.None:this._currentFrame-=this._direction;break;case pb.Loop:this._currentFrame=0;break;case pb.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case pb.None:this._currentFrame-=this._direction;break;case pb.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case pb.Oscillate:this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const e=this._animation.getFrame(this._currentFrame);this._onFrameData(e)}};function bpn(i,e,t,r){let n,{repeatType:s}=e;if(s==null&&(s=pb.Loop),e.reverseAnimation===!0&&(i=gpn(i)),e.duration!=null&&(i=ypn(i,1e3*e.duration)),e.repeatDelay!=null){const o=1e3*e.repeatDelay;s===pb.Loop?i=jvt(i,o):s===pb.Oscillate&&(i=vpn(jvt(i,o/2),o/2))}if(e.startTimeOffset!=null)n=1e3*e.startTimeOffset;else if(e.randomizeStartTime!=null){const a=e.randomizeStartSeed!=null?e.randomizeStartSeed:82749913,l=Xjt(t,a);n=l*mpn(i)}else n=0;return new _pn(i,n,s,r)}function aYt(i,e,t,r){const n=e.playAnimation==null||e.playAnimation,s=bpn(i,e,t,r);let o,a=s.timeToFrame;function l(){o=n?setTimeout(()=>{s.nextFrame(),a=s.timeToFrame,l()},a):void 0}return l(),wa(()=>n&&clearTimeout(o))}let wpn=class{constructor(e,t,r,n){this._animation=e,this._frameData=null;const s=o=>{this._frameData=o,t.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=aYt(this._animation,r,n,s)}destroy(){this._playHandle.remove()}loadFrame(e){const t=this._frameData;if(t==null)return;const r="width"in t?t.width:t.codedWidth,n="height"in t?t.height:t.codedHeight;e.updateData(0,Qg,Qg,r,n,t),this._frameData=null}};const Gvt="arial-unicode-ms-regular",xpn=()=>di.getLogger("esri.views.2d.engine.webgl.TextureManager"),uN=(i,e,t)=>xpn().error(new qe(i,e,t));function Spn(i){switch(i.type){case"fill-style":case"CIMHatchFill":return rHr}return 1}let Tpn=class lYt{static fromMosaic(e,t){return new lYt(e,t.page,t.sdf)}constructor(e,t,r){this.mosaicType=e,this.page=t,this.sdf=r}},Cpn=class{constructor(e){this._requestRender=e,this._resourceManager=new Xdn,this._invalidFontsMap=new Map,this._sdfConverter=new lpn(Wge),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new UY({concurrency:10,process:async(t,r)=>{hn(r);try{return await zi(t,{responseType:"image",signal:r})}catch(n){throw mo(n)?n:new qe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,n)}}}),this._spriteMosaic=new upn(2048,2048,500),this._glyphSource=new apn(`${Ho.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new spn(1024,1024,this._glyphSource),this._rasterizer=new Qdn(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return uN("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type!=="cim-rasterization-info")return uN("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:r}=e;if(r.type==="text"){const s=await this._rasterizeText(r,t);for(const o of s.glyphs)this._setTextureBinding(mV.GLYPH,o);return s}const n=await this._rasterizeSprite(r,t);return n&&this._setTextureBinding(mV.SPRITE,n),n}getMosaicInfo(e,t,r=!1){const n=this._getTextureBindingInfo(e,t,r);return n?{size:n.size,texture:{texture:n.texture,unit:n.type==="sprite"?WVr:lft}}:(uN("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,r){const n=this._bindingInfos[t-1],s=n.page,o=r?Is.LINEAR_MIPMAP_LINEAR:Is.LINEAR;switch(n.mosaicType){case mV.SPRITE:{const a=[this.sprites.getWidth(s),this.sprites.getHeight(s)],l=this._spriteMosaic.getTexture(e,s);return l.setSamplingMode(o),{type:"sprite",texture:l,size:a}}case mV.GLYPH:{const a=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,s);return this._glyphMosaic.bind(e,o,s,lft),l.setSamplingMode(o),{type:"glyph",texture:l,size:a}}default:return uN("mapview-texture-manager",`Cannot handle unknown type ${n.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const r=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(r)){const n=Tpn.fromMosaic(e,t),s=this._bindingInfos.length+1;this._hashToBindingIndex.set(r,s),this._bindingInfos.push(n)}t.textureBinding=this._hashToBindingIndex.get(r)}async _rasterizeText(e,t){const{font:r,textString:n}=e,s=VGt(r),o=this._invalidFontsMap.has(s),[a,l]=GGt(n),u=rJr(a);try{const c=o?Gvt:s;return yi("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,u,t),isRightToLeft:l}}catch{return uN("mapview-invalid-resource",`Couldn't find font ${s}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(s,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Gvt,u,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${e.dashTemplate.join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(nzt(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const r=Q1(this._hashSpriteResource(e));if(this._spriteMosaic.has(r))return this._spriteMosaic.getSpriteItem(r);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const n=[];ym.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,n),n.length>0&&await Promise.all(n)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(r,e):this._handleAsyncResource(r,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(r,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(r,e)}}_rasterizeJSONResource(e,t){const r=this._rasterizer.rasterizeJSONResource(t,Spn(t));if(r){const{size:n,image:s,sdf:o,simplePattern:a,rasterizationScale:l}=r;return this._addItemToMosaic(e,n,{type:"static",data:s},ype(t),o,a,l)}return null}async _handleAsyncResource(e,t,r){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let n;return n=t.type==="path"?this._handleSVG(t,e,r):this._handleImage(t,e,r),this._ongoingRasterizations.set(e,n),n.finally(()=>this._ongoingRasterizations.delete(e)),n}async _handleSVG(e,t,r){const n=[Wge,Wge],{asFill:s}=e,o=await this._sdfConverter.draw(e.path,s,r);return this._addItemToMosaic(t,n,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,r){const n=e.url,s=this.resourceManager.getResource(n);if(s==null)return null;const{width:o,height:a}=s;if(s instanceof HTMLImageElement){if(e.type==="animated")return uN("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const p="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:m,sdf:v,image:w}=this._rasterizer.rasterizeImageResource(o,a,s,p);return this._addItemToMosaic(t,m,{type:"static",data:w},ype(e),v,!1)}let l,u,c;e.type==="animated"?(l=!1,u={playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=ype(e),u={},c=0);const h=new wpn(s,this._requestRender,u,c);return this._addItemToMosaic(t,[h.width,h.height],{type:"animated",data:h},l,!1,!1)}async _handleImage(e,t,r){const n=e.url;if(Ipn(n)||Mpn(n))return this._handleGIFOrPNG(e,t,r);if(e.type==="animated")return uN("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let s;const o=this.resourceManager.getResource(n);if(o!=null&&o instanceof HTMLImageElement)s=o;else{const{data:m}=await this._imageRequestQueue.push(n,{...r});s=m}if(iJr(n)){if("width"in e&&"height"in e)s.width=us(e.width),s.height=us(e.height);else if("cim"in e){const m=e;s.width=us(m.width??m.scaleX*m.size),s.height=us(m.size)}}if(!s.width||!s.height)return null;const a=s.width,l=s.height,u="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:h,image:p}=this._rasterizer.rasterizeImageResource(a,l,s,u);return this._addItemToMosaic(t,c,{type:"static",data:p},ype(e),h,!1)}catch(s){throw mo(s)?s:new qe("mapview-invalid-resource",`Could not fetch requested resource at ${n}. ${s.message}`)}}_addItemToMosaic(e,t,r,n,s,o,a){return this._spriteMosaic.addSpriteItem(e,t,r,n,s,o,a)}};function ype(i){switch(i.type){case"CIMVectorMarker":case"CIMPictureMarker":return Opn(i);default:return!0}}const Epn=i=>i!=null&&i.startsWith("data:image/gif"),Ipn=i=>i&&(i.includes(".gif")||Epn(i)),Apn=i=>i!=null&&i.startsWith("data:image/png"),Mpn=i=>i&&(i.includes(".png")||Apn(i)),Opn=i=>i&&"markerPlacement"in i&&i.markerPlacement&&i.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Ppn=class{constructor(e){this._queue=[],this._refreshable=e}destroy(){this._queue=[]}enqueueTextureUpdate(e,t){const r=ac(),n=e,s=nHr,o=Math.ceil(n.height/s);hn(t);for(let a=0;ar.reject(a)),r.promise}upload(){let e=0;for(;this._queue.length;){const t=performance.now(),r=this._queue.shift();if(r){if(r.options.signal!=null&&r.options.signal.aborted)continue;switch(r.type){case"chunk":this._uploadChunk(r);break;case"no-chunk":this._uploadNoChunk(r)}const n=performance.now()-t;if(e+=n,e+n>=sHr)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:t,resolver:r,chunkOffset:n,chunkIsLast:s,destHeight:o}=e,{data:a,texture:l,width:u}=t;a!=null&&(l.updateData(0,0,n,u,o,a,n),s&&r.resolve())}_uploadNoChunk(e){const{request:t,resolver:r}=e,{data:n,texture:s}=t;s.setData(n),r.resolve()}};const Rpn={shaders:{vertexShader:Rm("stencil/stencil.vert"),fragmentShader:Rm("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},Dpn=MA(-.5,-.5);let Fpn=class{constructor(){this._centerNdc=gr(),this._pxToNdc=gr(),this._worldDimensionsPx=gr(),this._mat3=Cc(),this._initialized=!1}dispose(){this._program=ba(this._program),this._quad=ba(this._quad)}render(e,t,r){const{context:n}=e,s=this._updateGeometry(e,r);if(t!=null){const{r:o,g:a,b:l,a:u}=t;n.setClearColor(u*o/255,u*a/255,u*l/255,u)}else n.setClearColor(0,0,0,0);if(n.setStencilFunction(Wl.ALWAYS,0,255),n.setStencilWriteMask(255),!s)return n.setClearStencil(1),void n.clear(n.gl.STENCIL_BUFFER_BIT|n.gl.COLOR_BUFFER_BIT);n.setClearStencil(0),n.clear(n.gl.STENCIL_BUFFER_BIT|n.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(n),n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setColorMask(!1,!1,!1,!1),n.setBlendingEnabled(!1),n.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),n.setStencilFunction(Wl.ALWAYS,1,255),n.setStencilTestEnabled(!0),n.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=R3(e,Rpn);t&&(this._program=t,this._quad=new JS(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:r,pixelRatio:n}=e,{size:s,rotation:o}=r,a=Math.round(s[0]*n),l=Math.round(s[1]*n);if(!r.spatialReference.isWrappable)return!1;const u=eB(o),c=Math.abs(Math.cos(u)),h=Math.abs(Math.sin(u)),p=Math.round(a*c+l*h),m=Math.round(r.worldScreenWidth);if(p<=m)return!1;const v=a*h+l*c,w=m*n,S=(t.left-t.right)*n/a,I=(t.bottom-t.top)*n/l;Zo(this._worldDimensionsPx,w,v,1),Zo(this._pxToNdc,2/a,-2/l,1),Zo(this._centerNdc,S,I,1);const R=this._mat3;return _We(R,this._centerNdc),_R(R,R,this._pxToNdc),o!==0&&q3(R,R,u),_R(R,R,this._worldDimensionsPx),h0(R,R,Dpn),!0}},jle=class{constructor(){this.name=this.constructor.name}createOptions(e,t){return null}},kpn=class extends jle{constructor(){super(...arguments),this.defines=[],this._desc={vsPath:"fx/integrate",fsPath:"fx/integrate",attributes:new Map([["a_position",0]])}}dispose(){this._quad&&this._quad.dispose()}bind(){}unbind(){}draw(e,t){if(!t?.size)return;const{context:r,renderingOptions:n}=e;this._quad||(this._quad=new JS(r,[0,0,1,0,0,1,1,1]));const s=r.getBoundFramebufferObject(),{x:o,y:a,width:l,height:u}=r.getViewport(),c=t.getBlock(Sv.Animation);if(c==null)return;const h=t.getUniforms(r);r.setViewport(0,0,t.size,t.size);const p=h.filterFlags,m=h.animation,v=yi("featurelayer-animation-enabled")?n.labelsAnimationTime:1,w=c.getFBO(r,1);r.unbindTexture(w.colorTexture),this._computeDelta(e,w,m,p,v);const S=c.getFBO(r);r.unbindTexture(S.colorTexture),this._updateAnimationState(e,w,S),r.bindFramebuffer(s),r.setViewport(o,a,l,u)}_computeDelta(e,t,r,n,s){const{context:o,painter:a,displayLevel:l}=e,u=a.materialManager.getProgram(this._desc,["delta"]);if(o.bindFramebuffer(t),o.setColorMask(!0,!0,!0,!0),o.setClearColor(0,0,0,0),o.clear(o.gl.COLOR_BUFFER_BIT),o.useProgram(u),!("type"in n.texture)||!("type"in r.texture))throw new Error("InternalError: Expected to find texture");o.bindTexture(n.texture,n.unit),o.bindTexture(r.texture,r.unit),u.setUniform1i("u_maskTexture",n.unit),u.setUniform1i("u_sourceTexture",r.unit),u.setUniform1f("u_timeDelta",e.deltaTime),u.setUniform1f("u_animationTime",s),u.setUniform1f("u_zoomLevel",Math.round(10*l)),this._quad.draw()}_updateAnimationState(e,t,r){const{context:n,painter:s}=e,o=s.materialManager.getProgram(this._desc,["update"]);n.bindTexture(t.colorTexture,1),n.useProgram(o),o.setUniform1i("u_sourceTexture",1),n.bindFramebuffer(r),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.clear(n.gl.COLOR_BUFFER_BIT),this._quad.draw()}};const Lpn=i=>i.replace("-","_").toUpperCase(),Uvt=i=>`#define ${Lpn(i)} +`;function zvt(i){return{attributes:new Map([["a_pos",0],["a_tex",1]]),shaders:{vertexShader:Uvt(i)+Rm("blend/blend.vert"),fragmentShader:Uvt(i)+Rm("blend/blend.frag")}}}const Vvt=()=>di.getLogger("esri.views.2d.engine.webgl.effects.blendEffects.BlendEffect");let Npn=class{constructor(){this._size=[0,0]}dispose(e){this._backBufferTexture=ba(this._backBufferTexture),this._quad=ba(this._quad)}draw(e,t,r,n,s){const{context:o,drawPhase:a}=e;if(this._setupShader(o),n&&n!=="normal"&&a!==aa.LABEL)return void this._drawBlended(e,t,r,n,s);const l=zvt("normal"),u=o.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!u)return void Vvt().error(new qe("mapview-BlendEffect",'Error creating shader program for blend mode "normal"'));o.useProgram(u),t.setSamplingMode(r),o.bindTexture(t,0),u.setUniform1i("u_layerTexture",0),u.setUniform1f("u_opacity",s),o.setBlendingEnabled(!0),o.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA);const c=this._quad;c.draw(),c.unbind(),u.dispose()}_drawBlended(e,t,r,n,s){const{context:o,state:a,pixelRatio:l,inFadeTransition:u}=e,{size:c}=a,h=o.getBoundFramebufferObject();let p,m;h!=null?(p=h.width,m=h.height):(p=Math.round(l*c[0]),m=Math.round(l*c[1])),this._createOrResizeTexture(e,p,m);const v=this._backBufferTexture;h.copyToTexture(0,0,p,m,0,0,v),o.setStencilTestEnabled(!1),o.setStencilWriteMask(0),o.setBlendingEnabled(!0),o.setDepthTestEnabled(!1),o.setDepthWriteEnabled(!1);const w=zvt(n),S=o.programCache.acquire(w.shaders.vertexShader,w.shaders.fragmentShader,w.attributes);if(!S)return void Vvt().error(new qe("mapview-BlendEffect",`Error creating shader program for blend mode ${n}`));o.useProgram(S),v.setSamplingMode(r),o.bindTexture(v,0),S.setUniform1i("u_backbufferTexture",0),t.setSamplingMode(r),o.bindTexture(t,1),S.setUniform1i("u_layerTexture",1),S.setUniform1f("u_opacity",s),S.setUniform1f("u_inFadeOpacity",u?1:0),o.setBlendFunction(bn.ONE,bn.ZERO);const I=this._quad;I.draw(),I.unbind(),S.dispose(),o.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA)}_setupShader(e){this._quad||(this._quad=new JS(e,[-1,-1,1,-1,-1,1,1,1]))}_createOrResizeTexture(e,t,r){const{context:n}=e;if(this._backBufferTexture===null||t!==this._size[0]||r!==this._size[1]){if(this._backBufferTexture)this._backBufferTexture.resize(t,r);else{const s=new Ua;s.internalFormat=ks.RGBA,s.wrapMode=Ls.CLAMP_TO_EDGE,s.width=t,s.height=r,this._backBufferTexture=new fl(n,s)}this._size[0]=t,this._size[1]=r}}},Hvt=class extends jle{constructor(e){super(),this.name=this.constructor.name,this.defines=[e]}dispose(){}bind({context:e,painter:t}){this._prev=e.getBoundFramebufferObject();const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}draw(e,t){const{context:r,painter:n}=e,s=n.getPostProcessingEffects(t),o=r.getBoundFramebufferObject();for(const{postProcessingEffect:a,effect:l}of s)a.draw(e,o,l);r.bindFramebuffer(this._prev),r.setStencilTestEnabled(!1),n.blitTexture(r,o.colorTexture,Is.NEAREST),r.setStencilTestEnabled(!0)}};const $pn={shaders:{vertexShader:Rm("highlight/textured.vert"),fragmentShader:Rm("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Bpn={shaders:{vertexShader:Rm("highlight/textured.vert"),fragmentShader:Rm("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])};let jpn=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(e,t){e.bindTexture(t,aK),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Lhn),e.bindVAO(this._resources.quadVAO),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}finalBlur(e,t){e.bindTexture(t,aK),e.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Nhn),e.bindVAO(this._resources.quadVAO),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}renderHighlight(e,t,r){e.bindTexture(t,aK),e.useProgram(this._resources.highlightProgram),r.applyHighlightOptions(e,this._resources.highlightProgram),e.bindVAO(this._resources.quadVAO),e.setBlendingEnabled(!0),e.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.drawArrays(Eo.TRIANGLE_STRIP,0,4),e.bindVAO()}_initialize(e,t,r){this._width=t,this._height=r;const n=Aa.createVertex(e,oa.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),s=new wh(e,new Map([["a_position",0],["a_texcoord",1]]),{geometry:[new Hl("a_position",2,Ti.BYTE,0,4),new Hl("a_texcoord",2,Ti.UNSIGNED_BYTE,2,4)]},{geometry:n}),o=R3(e,$pn),a=R3(e,Bpn);e.useProgram(o),o.setUniform1i("u_texture",aK),o.setUniform1i("u_shade",Ujt),o.setUniform1f("u_sigma",y7e),e.useProgram(a),a.setUniform1i("u_texture",aK),a.setUniform1f("u_sigma",y7e),this._resources={quadGeometry:n,quadVAO:s,highlightProgram:o,blurProgram:a}}setup(e,t,r){this._resources?(this._width=t,this._height=r):this._initialize(e,t,r)}};function Wvt(i,e,t){const r=new Ua(e,t);return r.wrapMode=Ls.CLAMP_TO_EDGE,new Wd(i,r,new Mle(vf.STENCIL_INDEX8,e,t))}let Gpn=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(e,t,r){this._width=t,this._height=r;const n=Wvt(e,t,r),s=Wvt(e,t,r);this._resources={sharedBlur1Fbo:n,sharedBlur2Fbo:s}}setup(e,t,r){!this._resources||this._width===t&&this._height===r||this.dispose(),this._resources||this._initialize(e,t,r)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const K$=4,vpe=4/K$;let Upn=class extends jle{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new jpn,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Gpn,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new iYt}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(e){const{context:t,painter:r}=e,{width:n,height:s}=t.getViewport(),o=r.getFbos().effect0;this.setup(e,n,s),t.bindFramebuffer(o),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(t.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:e},t,r){this._width=t,this._height=r;const n=t%K$,s=r%K$;t+=nu.resolve([]));const o=s.getFBO(r),a=new Uint8Array(o.width*o.height*4);try{await o.readPixelsAsync(0,0,o.width,o.height,ks.RGBA,lc.UNSIGNED_BYTE,a)}catch{return void t.forEach(c=>c.resolve([]))}const l=[];for(let u=0;uu.resolve(l))}},Vpn=class extends jle{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["id"],this._lastSize=0,this._boundFBO=null}dispose(){this._fbo!=null&&this._fbo.dispose()}bind({context:e,painter:t}){this._boundFBO=e.getBoundFramebufferObject();const r=t.getFbos().effect0;e.bindFramebuffer(r),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind({context:e}){e.bindFramebuffer(this._boundFBO),this._boundFBO=null}draw(e,t,r=2*zjt){this._resolve(e,t,r)}async _resolve({context:e,state:t,pixelRatio:r},n,s){const o=e.getBoundFramebufferObject(),a=t.size[1]*r,l=Math.round(s*r),u=l/2,c=l/2;this._ensureBuffer(l),n.forEach(async(h,p)=>{const m=new Map,v=Math.floor(p.x*r-l/2),w=Math.floor(a-p.y*r-l/2);await o.readPixelsAsync(v,w,l,l,ks.RGBA,lc.UNSIGNED_BYTE,this._buf);for(let I=0;II[1]-R[1]).map(I=>I[0]);h.resolve(S),n.delete(p)})}_ensureBuffer(e){this._lastSize!==e&&(this._lastSize=e,this._buf=new Uint8Array(4*e*e),this._buf32=new Uint32Array(this._buf.buffer))}};const iRe=5,Hpn=[1,0],Wpn=[0,1],qpn=[1,.8,.6,.4,.2],Ypn=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Xpn=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(iRe),this._nMips=iRe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=ba(this._quad),this._intensityFBO=ba(this._intensityFBO),this._compositeFBO=ba(this._compositeFBO),this._mipsFBOs){for(let e=0;enew Qpn,blur:()=>new Zpn,bloom:()=>new Xpn,opacity:()=>new rfn,"drop-shadow":()=>new ifn};let ofn=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(e=>e.dispose()),this._effectMap.clear()}getPostProcessingEffects(e){if(!e||e.length===0)return[];const t=[];for(const r of e){const n=nfn(r.type);let s=this._effectMap.get(n);s||(s=sfn[n](),this._effectMap.set(n,s)),t.push({postProcessingEffect:s,effect:r})}return t}},afn=class{constructor(e,t){this.brushes=e,this.name=t.name,this.drawPhase=t.drawPhase||aa.MAP,this._targetFn=t.target,this.effects=t.effects||[],this.enableDefaultDraw=t.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!t.forceDrawByDisplayOrder}render(e){const{context:t,profiler:r}=e,n=this._targetFn(),s=this.drawPhase&e.drawPhase;if(r.recordPassStart(this.name),s){this.enableDefaultDraw()&&this._doRender(e,n),r.recordPassEnd();for(const o of this.effects){if(!o.enable())continue;const a=o.apply,l=o.args?.(),u=t.getViewport(),c=t.getBoundFramebufferObject(),h=e.passOptions;this._bindEffect(e,a,l),this._doRender(e,n,a.defines),this._drawAndUnbindEffect(e,a,u,c,h,l)}}}_doRender(e,t,r){if(t==null)return;const{profiler:n,context:s}=e;for(const o of this.brushes){if(n.recordBrushStart(o.name),o.brushEffect!=null){const a=s.getViewport(),l=s.getBoundFramebufferObject(),u=e.passOptions;this._bindEffect(e,o.brushEffect),this._drawWithBrush(o,e,t,r),this._drawAndUnbindEffect(e,o.brushEffect,a,l,u)}else this._drawWithBrush(o,e,t,r);n.recordBrushEnd()}}_drawWithBrush(e,t,r,n){NTt(r)?(e.prepareState(t,n),e.drawMany(t,r,n)):r.visible&&(e.prepareState(t,n),e.draw(t,r,n))}_bindEffect(e,t,r){const{profiler:n}=e;n.recordPassStart(this.name+"."+t.name),t.bind(e,r);const s=t.createOptions(e,r);e.passOptions=s}_drawAndUnbindEffect(e,t,r,n,s,o){const{profiler:a,context:l}=e;e.passOptions=s,a.recordBrushStart(t.name),t.draw(e,o),t.unbind(e,o),l.bindFramebuffer(n);const{x:u,y:c,width:h,height:p}=r;l.setViewport(u,c,h,p),a.recordBrushEnd(),a.recordPassEnd()}},qvt=class{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,r,n,s){const o=e.getShaderKey(t,r,n,s);let a=this._programCache.get(o);return a||(a=e.getProgram(t,r,n,s),this._programCache.set(o,a)),a}},lfn=class{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new iYt,this._worldExtentRenderer=new Fpn,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Hdn,this._blendEffect=new Npn,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new Upn,hittest:new zpn,hittestVTL:new Vpn,integrate:new kpn,insideEffect:new Hvt("inside"),outsideEffect:new Hvt("outside")},this._programCache=new qvt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Ydn(e),this.textureManager=new Cpn(t),this.textureUploadManager=new Ppn(t),this._effectsManager=new ofn,this._quadMesh=new JS(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=ba(this._blitRenderer),this._worldExtentRenderer=ba(this._worldExtentRenderer),this._quadMesh.dispose(),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=ba(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new qvt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let r;if(this._fboPool.length>0)r=this._fboPool.pop();else{const n=new Ua(e,t);n.samplingMode=Is.NEAREST,n.wrapMode=Ls.CLAMP_TO_EDGE,r=new Wd(this.context,n,this._stencilBuf)}return r.width===e&&r.height===t||r.resize(e,t),r}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,r){const{context:n}=e;this._worldExtentRenderer.render(e,t,r);const{width:s,height:o}=n.getViewport();if(this.updateFBOs(s,o),this._prevFBO=n.getBoundFramebufferObject(),n.bindFramebuffer(this.getFbos().output),n.setColorMask(!0,!0,!0,!0),t!=null){const{r:a,g:l,b:u,a:c}=t;n.setClearColor(c*a/255,c*l/255,c*u/255,c)}else n.setClearColor(0,0,0,0);n.setDepthWriteEnabled(!0),n.setClearDepth(1),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.DEPTH_BUFFER_BIT),n.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(Wl.EQUAL,1,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,Is.NEAREST)}beforeRenderLayer(e,t,r){const{context:n,blendMode:s,effects:o,drawPhase:a,requireFBO:l}=e;if(l||Yvt(a,s,o,r)){const u=n.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(u);const{width:c,height:h}=n.getViewport(),p=this.acquireFbo(c,h);n.bindFramebuffer(p),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.setDepthWriteEnabled(!0),n.setClearDepth(1),n.clear(n.gl.COLOR_BUFFER_BIT|n.gl.DEPTH_BUFFER_BIT),n.setDepthWriteEnabled(!1)}n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!0),n.setClearStencil(t),n.setStencilWriteMask(255),n.clear(n.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:r,blendMode:n,effects:s,requireFBO:o,drawPhase:a}=e;if(o||Yvt(a,n,s,t)){const l=r.getBoundFramebufferObject();s!=null&&s.length>0&&a===aa.MAP&&(r.setColorMask(!0,!0,!0,!0),this._applyEffects(e,s,l)),r.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),r.setStencilTestEnabled(!1),r.setStencilWriteMask(0),r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0);const u=n==null||a===aa.HIGHLIGHT?"normal":n;this._blendEffect.draw(e,l.colorTexture,Is.NEAREST,u,t),this.releaseFbo(l)}}renderObject(e,t,r,n){const s=Lq[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.prepareState(e),o.draw(e,t,n)}renderObjects(e,t,r,n){const s=Lq[r];if(!s)return;let o=this._brushCache.get(s);o===void 0&&(o=new s,this._brushCache.set(s,o)),o.drawMany(e,t,n)}registerRenderPass(e){const t=e.brushes.map(r=>(this._brushCache.has(r)||this._brushCache.set(r,new r),this._brushCache.get(r)));return new afn(t,e)}blitTexture(e,t,r,n=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,r,n),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const r=new Ua(e,t);r.samplingMode=Is.NEAREST,r.wrapMode=Ls.CLAMP_TO_EDGE;const n=new Mle(vf.DEPTH_STENCIL,e,t);this._stencilBuf=new bCe(this.context,n),this._fbos={output:new Wd(this.context,r,this._stencilBuf),effect0:new Wd(this.context,r,this._stencilBuf)}}}_applyEffects(e,t,r){const{context:n}=e,s=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:o,effect:a}of s)n.bindFramebuffer(r),o.draw(e,r,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{instance:r}=t,n=r.instanceId,{shader:s,uniforms:o,defines:a,optionalAttributes:l,useComputeBuffer:u}=this._shaderState,c=t.target.getMesh(n),h={useComputeBuffer:u,locationInfo:s.locationInfo,computeAttributeMap:s.computeAttributes},p=c.getLayout(h);if(p==null)return null;const{primitive:m,count:v,offset:w}=c.getDrawArgs(Eo.TRIANGLES,t.count,t.start*Uint32Array.BYTES_PER_ELEMENT,u),S=this._programCache.getProgram(s,p,o,a??{},l??{});S.setUniforms(o),S.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,t.target);const I=c.getVAO(e,s.locationInfo,h);return e.bindVAO(I),e.drawElements(m,v,Ti.UNSIGNED_INT,w),e.bindVAO(null),S.cleanupTemporaryTextures(),{vertexShader:S.vertexShader,fragmentShader:S.fragmentShader}}submitDrawQuad(e){const{shader:t,uniforms:r,defines:n,optionalAttributes:s}=this._shaderState,o=this._programCache.getProgram(t,this._quadMesh.layout,r,n??{},s??{});o.setUniforms(r),o.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,null),this._quadMesh.draw(),e.bindVAO(null),o.cleanupTemporaryTextures()}submitDrawMesh(e,t,r){const{shader:n,uniforms:s,defines:o,optionalAttributes:a}=this._shaderState,l=this._programCache.getProgram(n,t.layout,s,o??{},a??{});if(l.setUniforms(s),l.bind(e),this.updatePipelineState(e),this._updateStencilRef(e,null),r)for(const u of r)t.bind(e,u),t.draw(e);else for(let u=0;u0)}let Xvt=class{constructor(e,t,r,n,s,o,a,l,u){this.createQuery=e,this.deleteQuery=t,this.resultAvailable=r,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=a,this.createTimestamp=l,this.timestampBits=u}},zD=!1;function uYt(i,e){if(e.disjointTimerQuery)return null;let t=i.getExtension("EXT_disjoint_timer_query_webgl2");return t?new Xvt(()=>i.createQuery(),r=>{i.deleteQuery(r),zD=!1},r=>i.getQueryParameter(r,i.QUERY_RESULT_AVAILABLE),r=>i.getQueryParameter(r,i.QUERY_RESULT),()=>i.getParameter(t.GPU_DISJOINT_EXT),r=>{zD||(zD=!0,i.beginQuery(t.TIME_ELAPSED_EXT,r))},()=>{i.endQuery(t.TIME_ELAPSED_EXT),zD=!1},r=>t.queryCounterEXT(r,t.TIMESTAMP_EXT),()=>i.getQuery(t.TIMESTAMP_EXT,t.QUERY_COUNTER_BITS_EXT)):(t=i.getExtension("EXT_disjoint_timer_query"),t?new Xvt(()=>t.createQueryEXT(),r=>{t.deleteQueryEXT(r),zD=!1},r=>t.getQueryObjectEXT(r,t.QUERY_RESULT_AVAILABLE_EXT),r=>t.getQueryObjectEXT(r,t.QUERY_RESULT_EXT),()=>i.getParameter(t.GPU_DISJOINT_EXT),r=>{zD||(zD=!0,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r))},()=>{t.endQueryEXT(t.TIME_ELAPSED_EXT),zD=!1},r=>t.queryCounterEXT(r,t.TIMESTAMP_EXT),()=>t.getQueryEXT(t.TIMESTAMP_EXT,t.QUERY_COUNTER_BITS_EXT)):null)}const ST=yi("esri-2d-profiler");let ufn=class{constructor(e,t){if(this._events=new rd,this._entries=new Map,this._timings=new k9e(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!ST)return;this._ext=uYt(e.gl,{}),this._debugOutput=t;const r=e.gl;if(!this.enableCommandLogging)return;let n;for(n in r)if(typeof r[n]=="function"){const s=r[n],o=n.includes("draw");r[n]=(...a)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:n,args:a,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),s.apply(r,a))}}get enableCommandLogging(){return!(typeof ST=="object"&&ST.disableCommands)}recordContainerStart(e){ST&&(this._currentContainer=e)}recordContainerEnd(){ST&&(this._currentContainer=null)}recordPassStart(e){ST&&(this._currentPass=e,this._initSummary())}recordPassEnd(){ST&&(this._currentPass=null,this._emitSummary())}recordBrushStart(e){ST&&(this._currentBrush=e)}recordBrushEnd(){ST&&(this._currentBrush=null)}recordStart(e){if(ST&&this._ext!=null){if(this._entries.has(e)){const r=this._entries.get(e),n=this._ext.resultAvailable(r.query),s=this._ext.disjoint();if(n&&!s){const o=this._ext.getResult(r.query)/1e6;let a=0;if(this._timings.enqueue(o)!=null){const c=this._timings.entries,h=c.length;let p=0;for(const m of c)p+=m;a=p/h}const l=o.toFixed(2),u=a?a.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${e}, ${l} ms (${u} last 10 avg) +${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(r.summaries),console.log("Commands: ",r.commands),console.groupEnd()):console.log(`Frame report for ${e}, ${l} ms (${u} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${u})`}for(const o of r.handles)o.remove();this._ext.deleteQuery(r.query),this._entries.delete(e)}const t={name:e,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(t.handles.push(this._events.on("command",r=>{t.commandsLen++,t.commands.push(r),r.isDrawCommand&&t.drawCommands++})),t.handles.push(this._events.on("summary",r=>{t.summaries.push(r)}))),this._ext.beginTimeElapsed(t.query),this._entries.set(e,t)}}recordEnd(e){ST&&this._ext!=null&&this._entries.has(e)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}},cfn=class{constructor(){this._candidateTiles=[]}schedule(e){this._candidateTiles.includes(e)||this._candidateTiles.push(e)}reshuffle(e){const t=[];for(const r of this._candidateTiles)e>0?(r.reshuffle(),e--):t.push(r);this._candidateTiles=t}},Yb=class{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=aa.MAP|aa.HITTEST|aa.HIGHLIGHT|aa.DEBUG,this.symbologyPlane=TE.FILL}startup(){}shutdown(e){}postProcess(e,t){}},cYt=class extends roe{};x([Ns(0,As)],cYt.prototype,"pos",void 0);let hfn=class extends YR{},hYt=class extends Lf{};x([zn(Ni)],hYt.prototype,"dotSize",void 0);let Uye=class extends Lf{};x([zn(_f)],Uye.prototype,"locations",void 0),x([zn(Ni)],Uye.prototype,"pixelRatio",void 0),x([zn(Ni)],Uye.prototype,"tileZoomFactor",void 0);const dfn=1e-6;let WU=class extends GJe{vertex(e){const t=new Tf(1,0,0,0,-1,0,0,1,1).multiply(new Ul(e.pos.xy.divide(xo),1)),r=rg(this.draw.locations,t.xy),n=AS(this.instance.dotSize.divide(2),new Ni(1));let s=new Ni(0);s=s.add(vm(r.a,new Ni(dfn)).multiply(2));let o=n.add(this.instance.dotSize);const a=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.add(.5),1)),l=new qo(a.xy,s,1),u=this.instance.dotSize.divide(o),c=new Ni(-1).divide(n.divide(o));return o=o.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:l,glPointSize:o,color:r,ratio:u,invEdgeRatio:c}}fragment(e){const t=_Ce(e.glPointCoord.subtract(.5)).multiply(2),r=WUt(new Ni(0),new Ni(1),e.invEdgeRatio.multiply(t.subtract(e.ratio)).add(1)),n=new Ole;return n.glFragColor=e.color.multiply(r),n}};x([zn(hYt)],WU.prototype,"instance",void 0),x([zn(Uye)],WU.prototype,"draw",void 0),x([zn(E1)],WU.prototype,"view",void 0),x([_u(0,bu(cYt))],WU.prototype,"vertex",null),x([_u(0,bu(hfn))],WU.prototype,"fragment",null);let dYt=class extends nE{};x([Ns(3,Ni)],dYt.prototype,"inverseArea",void 0);let zye=class extends Lf{};x([zn(gf.ofType(qo,2))],zye.prototype,"isActive",void 0),x([zn(gf.ofType(qo,8))],zye.prototype,"colors",void 0),x([zn(Ni)],zye.prototype,"dotValue",void 0);let qU=class extends Lf{};x([zn(_f)],qU.prototype,"dotTexture0",void 0),x([zn(_f)],qU.prototype,"dotTexture1",void 0),x([zn(Ni)],qU.prototype,"tileZoomFactor",void 0),x([zn(Ni)],qU.prototype,"pixelRatio",void 0),x([zn(Ni)],qU.prototype,"tileDotsOverArea",void 0);let YU=class extends ox{_dotThreshold(e,t,r){return e.divide(t).divide(r)}vertex(e){const t=new Tf(2/xo,0,0,0,-2/xo,0,-1,1,1).multiply(new Ul(e.pos,1)),r=this.clip(e.id),n=new qo(t.xy,r,1),s=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),o=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),a=this.draw.tileZoomFactor.multiply(xo).divide(this.draw.pixelRatio),l=this._dotThreshold(s,this.instance.dotValue,this.draw.tileDotsOverArea),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=e.pos.add(.5).divide(a);return{glPosition:n,color:new qo(0,0,0,0),textureCoords:c,thresholds0:l,thresholds1:u}}fragment(e){const t=new Ole,r=rg(this.draw.dotTexture0,e.textureCoords),n=rg(this.draw.dotTexture1,e.textureCoords),s=e.thresholds0.subtract(r),o=e.thresholds1.subtract(n);let a;const l=toe.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),u=toe.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const c=vm(new Ni(0),s),h=vm(new Ni(0),o),p=Cq(c,s).add(Cq(h,o)),m=vm(p,new Ni(0)),v=new Ni(1).subtract(m),w=p.add(m),S=s.multiply(c).divide(w),I=o.multiply(h).divide(w),R=l.multiply(S).add(u.multiply(I));a=v.multiply(R)}else{const c=AS(Qmt(s),Qmt(o)),h=vm(c,new Ni(0)),p=new Ni(1).subtract(h),m=vm(c,s),v=vm(c,o),w=l.multiply(m).add(u.multiply(v));a=p.multiply(w)}return t.glFragColor=a,t}hittest(e){return TCe(this.hittestRequest)}};x([DF],YU.prototype,"blending",void 0),x([zn(zye)],YU.prototype,"instance",void 0),x([zn(qU)],YU.prototype,"draw",void 0),x([_u(0,bu(dYt))],YU.prototype,"vertex",null),x([_u(0,bu(YR))],YU.prototype,"fragment",null);const b7e={[Ti.BYTE]:1,[Ti.UNSIGNED_BYTE]:1,[Ti.SHORT]:2,[Ti.UNSIGNED_SHORT]:2,[Ti.INT]:4,[Ti.UNSIGNED_INT]:4,[Ti.FLOAT]:4};let pfn=class{constructor(e,t){this._boundPart=null;const r=[];for(const s of t.vertex){const o=Aa.createVertex(e,oa.STATIC_DRAW,s);r.push(o)}const n=[];for(const s of t.index||[]){const o=Aa.createIndex(e,oa.STATIC_DRAW,s);n.push(o)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index)throw new Error("No index data.");const{BYTES_PER_ELEMENT:p}=t.index[s.index];p===2?o=Ti.UNSIGNED_SHORT:p===4&&(o=Ti.UNSIGNED_INT)}const a=s.index!=null?n[s.index]:null,l=new Map,u={},c={};for(const p of s.attributes){const{name:m,count:v,type:w,offset:S,normalized:I,divisor:R,stride:L,vertex:k,location:B}=p,$=`vertex-buffer-${k}`;let V=u[$];V||(V=u[$]=[]);const Y=new Hl(m,v,w,S,L,I,R);V.push(Y),l.set(m,B),c[$]=r[k]}const h=new wh(e,l,u,c,a);this.groups.push({...s,vertexArray:h,locations:l,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:r}=this.parts[this._boundPart],{vertexArray:n}=this.groups[r];e.bindVAO(n)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:r}=this.parts[this._boundPart],{group:n}=this.parts[this._boundPart],{indexing:s,primitive:o}=this.groups[n];s?e.drawElements(o,r,s,t*b7e[s]):e.drawArrays(o,t,r)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}},ffn=class pYt extends pfn{static create(e,t){const r=[];let{stride:n,hash:s}=t.layout;if(n==null){n=0;for(const{count:p,type:m,offset:v}of t.layout.attributes){if(v!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");n+=p*b7e[m]}}let o=0,a=0;for(const{count:p,name:m,offset:v,type:w,normalized:S}of t.layout.attributes){v!=null&&(a=v);const I={name:m,location:o,vertex:0,count:p,type:w,offset:a,stride:n,divisor:0,normalized:S!=null&&S};r.push(I),o++,a+=p*b7e[w]}const l={attributes:r,primitive:t.primitive};t.index!=null&&(l.index=0);let{count:u}=t;if(u==null&&(u=t.index?t.index.length:t.vertex.byteLength/n,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${n}.`);const c={start:0,count:u,group:0,primitive:t.primitive},h={vertex:[t.vertex],parts:[c],groups:[l]};return t.index!=null&&(h.index=[t.index]),s==null&&(s=wle(r)),new pYt(e,h,{hash:s,attributes:r,stride:n})}constructor(e,t,r){super(e,t),this.layout=r}bind(e,t=0){super.bind(e,t)}},mfn=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=xo,r=xo,n=new Ua(t,r);n.samplingMode=Is.NEAREST,n.wrapMode=Ls.CLAMP_TO_EDGE;const s=new bCe(e,new Mle(vf.DEPTH_STENCIL,t,r));this._dotFBO=new Wd(e,n,s)}return this._dotFBO}getDotDensityMesh(e){if(this._dotMesh==null){const t=xo,r=t*t,n=2,s=new Int16Array(r*n);for(let l=0;ldi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let Cfn=class{destroy(){this._accumulateFramebuffer=ba(this._accumulateFramebuffer),this._resolveGradientTexture=ba(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=Sfn(e,Tfn());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==lc.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,r){if(this._accumulateFramebuffer==null){const{dataType:n,samplingMode:s,pixelFormat:o,internalFormat:a}=this.loadQualityProfile(e),l=new Ua(t,r);l.pixelFormat=o,l.internalFormat=a,l.dataType=n,l.samplingMode=s,l.wrapMode=Ls.CLAMP_TO_EDGE;const u=new Mle(vf.DEPTH_STENCIL,t,r);this._accumulateFramebuffer=new Wd(e,l,u)}else{const{width:n,height:s}=this._accumulateFramebuffer;n===t&&s===r||this._accumulateFramebuffer.resize(t,r)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,r){if(this._resolveGradientTexture==null){const n=new Ua;n.wrapMode=Ls.CLAMP_TO_EDGE,this._resolveGradientTexture=new fl(e,n)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(r.length/4,1),this._resolveGradientTexture.setData(r),this._prevGradientHash=t);return this._resolveGradientTexture}};function fYt(i){return i?.25:1}let mYt=class extends nE{};x([Ns(5,As)],mYt.prototype,"offset",void 0);let Efn=class extends YR{},w7e=class extends Lf{};x([zn(Ni)],w7e.prototype,"radius",void 0),x([zn(Ni)],w7e.prototype,"isFieldActive",void 0);let hte=class extends ox{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){const{radius:t,isFieldActive:r}=this.kernelControls,n=e.offset,s=r.multiply(this.storage.getVVData(e.id).x).add(new Ni(1).subtract(r)),o=this.view.displayViewScreenMat3.multiply(new Ul(e.pos,1)).add(this.view.displayViewMat3.multiply(new Ul(n,0)).multiply(t)),a=this.clip(e.id);return{glPosition:new qo(o.xy,a,1),offset:n,fieldValue:s,color:new qo(0),...this.maybeRunHittest(e,{},null)}}fragment(e){const{offset:t,fieldValue:r}=e,n=_Ce(t),s=vm(n,new Ni(1)),o=new Ni(1).subtract(n.multiply(n)),a=o.multiply(o),l=s.multiply(a).multiply(r).multiply(new Ni(fYt(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new qo(l),e)}hittest(e){const{viewMat3:t,tileMat3:r}=this.view,n=t.multiply(r).multiply(new Ul(e.pos,1));return fJr(n.xy,this.kernelControls.radius,this.hittestRequest.position)}};x([DF],hte.prototype,"usesHalfFloatPrecision",void 0),x([zn(w7e)],hte.prototype,"kernelControls",void 0),x([_u(0,bu(mYt))],hte.prototype,"vertex",null),x([_u(0,bu(Efn))],hte.prototype,"fragment",null);let gYt=class extends roe{};x([Ns(0,As)],gYt.prototype,"pos",void 0);let Ifn=class extends fH{},Vye=class extends Lf{};x([zn(_f)],Vye.prototype,"texture",void 0),x([zn(As)],Vye.prototype,"minAndInvRange",void 0),x([zn(Ni)],Vye.prototype,"normalization",void 0);let yYt=class extends Lf{};x([zn(_f)],yYt.prototype,"texture",void 0);let XU=class extends GJe{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new qo(e.pos.multiply(2).subtract(1),1,1),uv:e.pos}}fragment(e){const{accumulatedDensity:t,gradient:r}=this;let n=rg(t.texture,e.uv).r.multiply(new Ni(fYt(this.usesHalfFloatPrecision)));n=n.multiply(t.normalization),n=n.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const s=rg(r.texture,new As(n,.5)),o=new Ole;return o.glFragColor=new qo(s.rgb.multiply(s.a),s.a),o}};x([DF],XU.prototype,"usesHalfFloatPrecision",void 0),x([zn(Vye)],XU.prototype,"accumulatedDensity",void 0),x([zn(yYt)],XU.prototype,"gradient",void 0),x([_u(0,bu(gYt))],XU.prototype,"vertex",null),x([_u(0,bu(Ifn))],XU.prototype,"fragment",null);let Afn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.HeatmapMeshWriter,this.shaders={accumulate:new hte,resolve:new XU},this.postProcessingEnabled=!0,this._isBound=!1,this._resources=new Map,this.overrideStencilRef=vYt}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:r,painter:n,state:s}=e,o=t.instance.getInput(),{isFieldActive:a}=o,l=this._getOrCreateResourcesRecord(r),u=l.loadQualityProfile(r);if(yoe(e))return;fg(e)||this._bind(e,l,o),n.setShader({shader:this.shaders.accumulate,uniforms:{...l_(e,t.target),kernelControls:{radius:Kvt(o,s),isFieldActive:a?1:0}},defines:{...zv(e),...u.defines},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)});const c=fg(e)?Ofn:_Yt;n.setPipelineState(c),n.submitDraw(r,t)}postProcess(e,t){if(fg(e)||yoe(e))return;const{context:r,painter:n}=e,s=this._resources.get(r);if(this._prevFBO==null||this._prevViewport==null||!s?.initialized)return;const{defines:o}=s.loadQualityProfile(r),{minDensity:a,maxDensity:l,radius:u}=t.getInput(),c=8,h=9,p=s.accumulateFramebuffer,m=s.resolveGradientTexture;n.setShader({shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:c,texture:p.colorTexture},minAndInvRange:[a,1/(l-a)],normalization:3/(u*u*Math.PI)},gradient:{texture:{unit:h,texture:m}}},defines:o,optionalAttributes:{},useComputeBuffer:!1}),r.bindFramebuffer(this._prevFBO),r.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),r.bindTexture(p.colorTexture,c),r.bindTexture(m,h),n.setPipelineState(Pfn),n.submitDrawQuad(r),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new Cfn,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,r){if(this._isBound)return;const{context:n,state:s,pixelRatio:o}=e,a=n.getBoundFramebufferObject(),l=n.getViewport();this._prevFBO=a,this._prevViewport=l;const{gradient:u,gradientHash:c}=r;t.ensureResolveGradientTexture(n,c,u);const{width:h,height:p}=l,m=Mfn(Kvt(r,s),o),v=h*m,w=p*m,S=t.ensureAccumulateFBO(n,v,w);n.blitFramebuffer(a,S,0,0,a.width,a.height,0,0,S.width,S.height,lb.STENCIL_BUFFER_BIT,Is.NEAREST),n.bindFramebuffer(S),n.setViewport(0,0,S.width,S.height),n.setColorMask(!0,!0,!0,!0),n.setClearColor(0,0,0,0),n.clear(lb.COLOR_BUFFER_BIT),this._isBound=!0}};function Mfn(i,e){const t=e>1.5?.25:.5;return i<1/(2*t)?1:t}function vYt(i){return i.key.level+1}const _Yt={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:vYt,compare:Wl.GEQUAL,mask:255,op:{fail:il.KEEP,zFail:il.KEEP,zPass:il.REPLACE}}}},Ofn={..._Yt,stencil:!1},Pfn={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function Kvt(i,e){const{referenceScale:t,radius:r}=i;return r*(t!==0?t/e.scale:1)}let jKe=class extends Lf{getVVRotationMat4(e){return Rh(IR(e),toe.identity(),()=>{const t=this._getNormalizedAngle(e).multiply(Cmt),r=ioe(t),n=Abe(t);return new toe(n,r,0,0,r.multiply(new Ni(-1)),n,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Rh(IR(e),Tf.identity(),()=>{const t=this._getNormalizedAngle(e).multiply(Cmt),r=ioe(t),n=Abe(t);return new Tf(n,r,0,r.multiply(new Ni(-1)),n,0,0,0,1)})}_getNormalizedAngle(e){const t=Ale(this.rotationType,new Ni(eoe.Arithmatic));return Rh(t,new Ni(90).subtract(e),e)}};x([zn(Ni)],jKe.prototype,"rotationType",void 0);const Rfn=360/254;let ZT=class extends nE{};x([Ns(3,qo)],ZT.prototype,"color",void 0),x([Ns(4,As)],ZT.prototype,"offset",void 0),x([Ns(5,As)],ZT.prototype,"textureUV",void 0),x([Ns(6,Ni)],ZT.prototype,"fontSize",void 0),x([Ns(7,Ni)],ZT.prototype,"referenceSize",void 0),x([Ns(8,Ni)],ZT.prototype,"haloFontSize",void 0),x([Ns(9,qo)],ZT.prototype,"haloColor",void 0),x([Ns(10,As)],ZT.prototype,"zoomRange",void 0),x([Ns(11,Ni)],ZT.prototype,"clipAngle",void 0),x([Ns(12,qo)],ZT.prototype,"referenceSymbol",void 0);let x7e=class extends jJe{};x([Ns(13,As)],x7e.prototype,"offsetNextVertex1",void 0),x([Ns(14,As)],x7e.prototype,"offsetNextVertex2",void 0);let Dfn=class extends YR{},I1=class extends ox{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,r){const n=t.multiply(Rfn),s=kJe(this.view.rotation.subtract(n)),o=Eq(new Ni(360).subtract(s),s);let a=new Ni(0);const l=HUt(this.view.currentZoom.multiply(xq)).divide(xq),u=e.x,c=e.y,h=new Ni(1).subtract(vm(u,l)).multiply(2),p=vm(new Ni(90),o).multiply(2),m=new Ni(2).multiply(new Ni(1).subtract(vm(l,c)));return a=a.add(r.multiply(h)),a=a.add(r.multiply(p)),a=a.add(m),a}vertex(e,t){const r=dg(e.bitset,wUt),n=new Ni(1).subtract(r);let s=e.fontSize,o=s.divide(Emt);const a=this.isHaloPass?e.haloColor:this._getVertexColor(e),l=this.isLabel?a.multiply(this.storage.getAnimationValue(e.id)):a,u=this.view.displayViewScreenMat3.multiply(new Ul(e.pos,1));let c=e.offset,h=new Ni(1),p=Tf.identity();if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const L=e.referenceSymbol,k=L.xy,B=L.z,$=this._unpackDirection(L.w),V=Obe(this,e.id,B).divide(2),Y=$.multiply(V.add(hee));c=c.add(k).add(Y)}else h=Obe(this,e.id,e.referenceSize).divide(e.referenceSize),s=s.multiply(h),o=o.multiply(h),c=c.multiply(h),p=azt(this,e.id),c=p.multiply(new Ul(c,0)).xy;const m=dg(e.bitset,xUt),v=this._getViewRotationMatrix(m).multiply(new Ul(c,0));let w=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,m):this.clip(e.id,e.zoomRange);w=this.isBackgroundPass?w.add(n.multiply(2)):w.add(r.multiply(2));const S=new qo(u.xy.add(v.xy),w,1),I=e.textureUV.divide(this.mosaicInfo.size);let R=new Ni(0);return this.isHaloPass&&(R=e.haloFontSize.divide(o).divide(FYr)),{glPosition:S,color:l,size:o,textureUV:I,antialiasingWidth:new Ni(.105*Emt).divide(s).divide(this.view.pixelRatio),haloDistanceOffset:R,...this.maybeRunHittest(e,t,{vvSizeAdjustment:h,vvRotation:p})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,r=this.view.displayMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}fragment(e){const t=new Ni(.25),r=new Ni(1).subtract(t),n=rg(this.mosaicInfo.texture,e.textureUV).a;let s=r.subtract(e.haloDistanceOffset);this.highlight&&(s=s.divide(2));const o=e.antialiasingWidth,a=WUt(s.subtract(o),s.add(o),n);return this.getFragmentOutput(e.color.multiply(a),e)}hittest(e,t,{vvSizeAdjustment:r,vvRotation:n}){const s=n.multiply(new Ul(e.offset.multiply(r),0)),o=n.multiply(new Ul(t.offsetNextVertex1.multiply(r),0)),a=n.multiply(new Ul(t.offsetNextVertex2.multiply(r),0)),{viewMat3:l,tileMat3:u}=this.view,c=l.multiply(u).multiply(new Ul(e.pos,1)),h=c.add(u.multiply(s)).xy,p=c.add(u.multiply(o)).xy,m=c.add(u.multiply(a)).xy;return szt(this.hittestRequest.position,h.xy,p.xy,m.xy)}_unpackDirection(e){const t=new rE(e),r=cXr(t,new rE(2)),n=hXr(t,new rE(3));return new As(new Ni(r).subtract(1),new Ni(n).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const r=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(r,e.color,new Kx(!1))}if(this.visualVariableOpacity){const r=this.storage.getOpacityValue(e.id),n=this.visualVariableOpacity.getOpacity(r);t=t.multiply(n)}return t}};x([jc(OB)],I1.prototype,"visualVariableColor",void 0),x([jc(PB)],I1.prototype,"visualVariableOpacity",void 0),x([jc(jKe)],I1.prototype,"visualVariableRotation",void 0),x([jc(Ple)],I1.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],I1.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],I1.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],I1.prototype,"visualVariableSizeUnitValue",void 0),x([zn(AR)],I1.prototype,"mosaicInfo",void 0),x([DF],I1.prototype,"isHaloPass",void 0),x([DF],I1.prototype,"isBackgroundPass",void 0),x([DF],I1.prototype,"isLabel",void 0),x([_u(0,bu(ZT)),_u(1,bu(x7e))],I1.prototype,"vertex",null),x([_u(0,bu(Dfn))],I1.prototype,"fragment",null);let Ffn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.LabelMeshWriter,this.shaders={geometry:new I1},this.drawPhase=aa.LABEL|aa.LABEL_ALPHA,this.symbologyPlane=TE.TEXT}render(e,t){const{context:r,painter:n}=e,s=zv(e),o={...u_(e)},a={shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...s,isHaloPass:!1,isBackgroundPass:!0,isLabel:!0},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:!1};n.setShader(a),n.setPipelineState(o),n.submitDraw(r,t),n.setShader({...a,defines:{...s,isHaloPass:!0,isBackgroundPass:!1,isLabel:!0}}),n.setPipelineState(o),n.submitDraw(r,t),n.setShader({...a,defines:{...s,isHaloPass:!1,isBackgroundPass:!1,isLabel:!0}}),n.setPipelineState(o),n.submitDraw(r,t)}},kfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.LineMeshWriter,this.shaders={geometry:new cC},this.symbologyPlane=TE.LINE}render(e,t){const{context:r,painter:n,pixelRatio:s}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),antialiasingControls:Gle(s)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Hye=class extends x5{};x([Ns(9,Ni)],Hye.prototype,"accumulatedDistance",void 0),x([Ns(10,As)],Hye.prototype,"segmentDirection",void 0),x([Ns(11,qo)],Hye.prototype,"tlbr",void 0);let S7e=class extends cC{_getLineWidthRatio(e,t){const r=new Ni(vzt),n=dg(e.bitset,_Ut);return n.multiply(AS(t,new Ni(.25))).add(new Ni(1).subtract(n)).divide(r)}_getSDFAlpha(e){const{halfWidth:t,normal:r,tlbr:n,patternSize:s,accumulatedDistance:o,lineWidthRatio:a}=e,l=s.x.multiply(new Ni(2)).multiply(a),u=Mbe(o.divide(l)),c=new Ni(.25).multiply(r.y).add(new Ni(.5)),h=A3(n.xy,n.zw,new As(u,c)),p=UJe(rg(this.mosaicInfo.texture,h)).subtract(new Ni(.5)).multiply(t),m=Tq(new Ni(.5).subtract(p),new Ni(0),new Ni(1));return new qo(m)}_getPatternColor(e){const{halfWidth:t,normal:r,color:n,accumulatedDistance:s,patternSize:o,sampleAlphaOnly:a,tlbr:l}=e,u=o.y.multiply(new Ni(2).multiply(t).divide(o.x)),c=Mbe(s.divide(u)),h=new Ni(.5).multiply(r.y).add(new Ni(.5)),p=A3(l.xy,l.zw,new As(h,c));let m=rg(this.mosaicInfo.texture,p);return this.visualVariableColor!=null&&(m=Rh(Uv(a,new Ni(.5)),new qo(n.a),n)),m}vertex(e,t){const{segmentDirection:r,tlbr:n,bitset:s}=e,o=VJe(this,e),a=e.accumulatedDistance.divide(this.view.displayZoomFactor).add(Cq(r,o.scaledOffset)),l=new As(n.z.subtract(n.x),n.w.subtract(n.y)),u=n.divide(this.mosaicInfo.size.xyxy),c=dg(s,bUt),h=dg(s,mCe),p=Rh(Uv(c,new Ni(.5)),this._getLineWidthRatio(e,o.scaledHalfWidth),new Ni(1));return{...o,tlbr:u,patternSize:l,accumulatedDistance:a,isSDF:c,sampleAlphaOnly:h,lineWidthRatio:p,...this.maybeRunHittest(e,t,o.halfWidth)}}fragment(e){const{color:t,opacity:r,isSDF:n}=e,s=dzt(e,this.antialiasingControls.blur),o=Rh(Uv(n,new Ni(.5)),this._getSDFAlpha(e),this._getPatternColor(e)),a=t.multiply(r).multiply(s).multiply(o);return this.getFragmentOutput(a,e)}};x([zn(AR)],S7e.prototype,"mosaicInfo",void 0),x([_u(0,bu(Hye)),_u(1,bu(M3))],S7e.prototype,"vertex",null);let Lfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.TexturedLineMeshWriter,this.shaders={geometry:new S7e},this.symbologyPlane=TE.LINE}render(e,t){const{context:r,painter:n,pixelRatio:s}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),antialiasingControls:Gle(s),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},_O=class extends nE{};x([Ns(3,qo)],_O.prototype,"color",void 0),x([Ns(4,qo)],_O.prototype,"outlineColor",void 0),x([Ns(5,As)],_O.prototype,"offset",void 0),x([Ns(6,As)],_O.prototype,"textureUV",void 0),x([Ns(7,qo)],_O.prototype,"sizing",void 0),x([Ns(8,Ni)],_O.prototype,"placementAngle",void 0),x([Ns(9,Ni)],_O.prototype,"sizeRatio",void 0),x([Ns(10,As)],_O.prototype,"zoomRange",void 0);let dte=class extends jJe{};x([Ns(12,As)],dte.prototype,"offsetNextVertex1",void 0),x([Ns(13,As)],dte.prototype,"offsetNextVertex2",void 0),x([Ns(14,As)],dte.prototype,"textureUVNextVertex1",void 0),x([Ns(15,As)],dte.prototype,"textureUVNextVertex2",void 0);let Nfn=class extends YR{};function FM(i,e,t,r){return e.multiply(i.x).add(t.multiply(i.y)).add(r.multiply(i.z))}function rRe(i){return i.multiply(i).divide(128)}let QT=class extends ox{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(e,t){const r=rRe(e.sizing.x),n=rRe(e.sizing.y),s=rRe(e.sizing.z),o=e.placementAngle,a=dg(e.bitset,gA.bitset.isSDF),l=dg(e.bitset,gA.bitset.isMapAligned),u=dg(e.bitset,gA.bitset.scaleSymbolsProportionally),c=uJr(e.bitset,gA.bitset.colorLocked),h=ECe(this,e.id),p=CCe(this,e.id,e.color,c).multiply(h),m=this.view.displayViewScreenMat3.multiply(new Ul(e.pos.xy,1)),v=Obe(this,e.id,s).divide(s),w=r.multiply(v),S=e.offset.xy.multiply(v);let I=n.multiply(u.multiply(v.subtract(1)).add(1));I=Eq(I,AS(w.subtract(.99),new Ni(0)));const R=AS(I,new Ni(1)),L=Eq(I,new Ni(1)),k=Tf.fromRotation(o.multiply(fUt)),B=azt(this,e.id),$=this._getViewRotationMatrix(l).multiply(B).multiply(k).multiply(new Ul(S.xy,0)),V=this.clip(e.id,e.zoomRange),Y=new qo(m.xy.add($.xy),V,1),K=e.textureUV.divide(this.mosaicInfo.size),Q=e.outlineColor.multiply(L),re=dg(e.bitset,gA.bitset.overrideOutlineColor),ne=e.sizeRatio.multiply(w).multiply(.5);return{glPosition:Y,color:p,textureUV:K,outlineColor:Q,outlineSize:R,distanceToPx:ne,isSDF:a,overrideOutlineColor:re,...this.maybeRunHittest(e,t,{pos:e.pos,size:w,sizeCorrection:v,isMapAligned:l,outlineSize:R,distanceToPx:ne,isSDF:a})}}fragment(e){const t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,r){return Rh(zUt(r.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,r),this._hittestMarker(e,t,r))}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,r=this.view.displayMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}_getViewScreenMatrix(e){const t=this.view.viewMat3.multiply(this.view.tileMat3),r=this.view.tileMat3,n=new Ni(1).subtract(e);return t.multiply(e).add(r.multiply(n))}_getColor(e,t){return Rh(Ale(t.isSDF,new Ni(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return rg(this.mosaicInfo.texture,e).multiply(t.color)}_getSDFColor(e,t){const r=rg(this.mosaicInfo.texture,e),n=new Ni(.5).subtract(UJe(r)).multiply(t.distanceToPx).multiply(PYr),s=Tq(new Ni(.5).subtract(n),new Ni(0),new Ni(1)),o=t.color.multiply(s);let a=t.outlineSize;this.highlight&&(a=AS(a,t.overrideOutlineColor.multiply(4)));const l=a.multiply(.5),u=kJe(n).subtract(l),c=Tq(new Ni(.5).subtract(u),new Ni(0),new Ni(1)),h=A3(t.outlineColor,t.color,t.overrideOutlineColor).multiply(c);return new Ni(1).subtract(h.a).multiply(o).add(h)}_hittestSmallMarker(e,t,r){const{position:n,distance:s,smallSymbolDistance:o}=this.hittestRequest,a=s.subtract(o),{viewMat3:l,tileMat3:u}=this.view,c=l.multiply(u).multiply(new Ul(r.pos,1)).xy,h=r.size.multiply(.5);return $Je(c,n).subtract(h).add(a)}_hittestMarker(e,t,r){const{pos:n,size:s,sizeCorrection:o,isMapAligned:a,outlineSize:l,isSDF:u,distanceToPx:c}=r,h=new Ul(e.offset.multiply(o),0),p=new Ul(t.offsetNextVertex1.multiply(o),0),m=new Ul(t.offsetNextVertex2.multiply(o),0),{viewMat3:v,tileMat3:w}=this.view,S=v.multiply(w).multiply(new Ul(n,1)),I=this._getViewScreenMatrix(a),R=S.add(I.multiply(h)).xy,L=S.add(I.multiply(p)).xy,k=S.add(I.multiply(m)).xy,B=this.hittestRequest.position,$=this.hittestRequest.distance,V=PI(B.add(new As(cA($),cA($))),R,L,k),Y=PI(B.add(new As(0,cA($))),R,L,k),K=PI(B.add(new As($,cA($))),R,L,k),Q=PI(B.add(new As(cA($),0)),R,L,k),re=PI(B,R,L,k),ne=PI(B.add(new As($,0)),R,L,k),de=PI(B.add(new As(cA($),$)),R,L,k),pe=PI(B.add(new As(0,$)),R,L,k),H=PI(B.add(new As($,$)),R,L,k),Z=e.textureUV.divide(this.mosaicInfo.size),ae=t.textureUVNextVertex1.divide(this.mosaicInfo.size),fe=t.textureUVNextVertex2.divide(this.mosaicInfo.size),be={color:new qo(1),outlineColor:new qo(1),overrideOutlineColor:new Ni(1),outlineSize:l,distanceToPx:c,isSDF:u};let _e=new Ni(0);return _e=_e.add(OI(V).multiply(this._getColor(FM(V,Z,ae,fe),be).a)),_e=_e.add(OI(Y).multiply(this._getColor(FM(Y,Z,ae,fe),be).a)),_e=_e.add(OI(K).multiply(this._getColor(FM(K,Z,ae,fe),be).a)),_e=_e.add(OI(Q).multiply(this._getColor(FM(Q,Z,ae,fe),be).a)),_e=_e.add(OI(re).multiply(this._getColor(FM(re,Z,ae,fe),be).a)),_e=_e.add(OI(ne).multiply(this._getColor(FM(ne,Z,ae,fe),be).a)),_e=_e.add(OI(de).multiply(this._getColor(FM(de,Z,ae,fe),be).a)),_e=_e.add(OI(pe).multiply(this._getColor(FM(pe,Z,ae,fe),be).a)),_e=_e.add(OI(H).multiply(this._getColor(FM(H,Z,ae,fe),be).a)),vm(_e,new Ni(.05)).multiply(TCe(this.hittestRequest))}};x([jc(OB)],QT.prototype,"visualVariableColor",void 0),x([jc(PB)],QT.prototype,"visualVariableOpacity",void 0),x([jc(jKe)],QT.prototype,"visualVariableRotation",void 0),x([jc(Ple)],QT.prototype,"visualVariableSizeMinMaxValue",void 0),x([jc(Aq)],QT.prototype,"visualVariableSizeScaleStops",void 0),x([jc(Mq)],QT.prototype,"visualVariableSizeStops",void 0),x([jc(Rle)],QT.prototype,"visualVariableSizeUnitValue",void 0),x([zn(AR)],QT.prototype,"mosaicInfo",void 0),x([_u(0,bu(_O)),_u(1,bu(dte))],QT.prototype,"vertex",null),x([_u(0,bu(Nfn))],QT.prototype,"fragment",null);let $fn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.MarkerMeshWriter,this.shaders={geometry:new QT},this.symbologyPlane=TE.MARKER}render(e,t){const{context:r,painter:n}=e;n.setShader({shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey,!0)},defines:{...zv(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Bfn=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([n,s])=>`${n}.${s}`).join("."),r=Q1(t);this._locationInfo={hash:r,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,r]of this.locationsMap.entries())e.set("a_"+t,r);return e}getShaderKey(e,t,r){const n=Object.keys(r).filter(o=>r[o]).map(o=>`${o}_${r[o].toString()}`).join("."),s=Object.keys(t).filter(o=>this.optionPropertyKeys.has(o)).join(".");return`${e.hash}.${n}.${s}`}getProgram(e,t,r,n){let s="",o="";for(const a in r)if(r[a]){const l=typeof r[a]=="boolean"?`#define ${a} `:`#define ${a} ${r[a]} -`;s+=l,o+=l}return s+=this.vertexShader,o+=this.fragmentShader,new y9e(s,o,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const r in this.required){const n=this.required[r];t.push({uniformHydrated:null,shaderModulePath:r,uniformName:r,uniformType:n.type,uniformArrayElementType:Zvt(n),uniformArrayLength:Qvt(n)})}for(const r in e){const n=this.options[r];if(e[r])for(const s in n){const o=n[s];t.push({uniformHydrated:null,shaderModulePath:`${r}.${s}`,uniformName:s,uniformType:o.type,uniformArrayElementType:Zvt(o),uniformArrayLength:Qvt(o)})}}return t}};const Zvt=i=>i.type==="array"?i.elementType?.type:void 0,Qvt=i=>i.type==="array"?i.size:void 0,zfn={hittestDist:Ni,hittestPos:As},Vfn={filterFlags:_f,animation:_f,visualVariableData:_f,dataDriven0:_f,dataDriven1:_f,dataDriven2:_f,gpgpu:_f,size:Ni},Hfn={displayViewScreenMat3:Tf,displayViewMat3:Tf,displayMat3:Tf,viewMat3:Tf,tileMat3:Tf,displayZoomFactor:Ni,requiredZoomFactor:Ni,tileOffset:As,currentScale:Ni,currentZoom:Ni,metersPerSRUnit:Ni};let Wfn=class extends Ufn{constructor(){super(...arguments),this.vertexShader=Rm("materials/pie/pie.vert"),this.fragmentShader=Rm("materials/pie/pie.frag"),this.required={...Vfn,...Hfn,outlineWidth:Ni,colors:gf,defaultColor:qo,othersColor:qo,outlineColor:qo,donutRatio:Ni,sectorThreshold:Ni},this.options={hittestUniforms:zfn,visualVariableSizeMinMaxValue:{minMaxValueAndSize:qo},visualVariableSizeScaleStops:{sizes:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},values:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}},visualVariableSizeStops:{sizes:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},values:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:Ni},visualVariableOpacity:{opacities:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},opacityValues:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}}},this.locations={pos:{index:0,type:As},id:{index:1,type:Ul},bitset:{index:2,type:Ni},offset:{index:3,type:As},texCoords:{index:4,type:As},size:{index:5,type:As},referenceSize:{index:6,type:Ni},zoomRange:{index:7,type:As}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...gf.ofType(qo,e),type:"array",elementType:qo,size:e}}},qfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.PieChartMeshWriter,this.shaders={geometry:new Wfn},this.symbologyPlane=TE.MARKER}render(e,t){const{context:r,painter:n}=e,{instance:s,target:o}=t,a=this.shaders.geometry,l=s.getInput(),u=l.numberOfFields,c=fg(e),h=l_(e,o),p=zv(e);a.setNumberOfFields(u),n.setShader({shader:a,uniforms:{...oT(e,t.target,l.geometry),...h.storage,...h.view,hittestUniforms:h.hittestRequest?{hittestDist:h.hittestRequest?.distance,hittestPos:h.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!l.geometry.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!l.geometry.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!l.geometry.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!l.geometry.visualVariableSizeUnitValue,VV_OPACITY:!!l.geometry.visualVariableOpacity,HITTEST:c,highlight:h.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Yfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.TextMeshWriter,this.shaders={geometry:new I1},this.symbologyPlane=TE.TEXT}render(e,t){const{context:r,painter:n}=e,s=zv(e),o={shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...s,isHaloPass:!1,isBackgroundPass:!0,isLabel:!1},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)};n.setShader(o),n.setPipelineState(u_(e)),n.submitDraw(r,t),n.setShader({...o,defines:{...s,isHaloPass:!0,isBackgroundPass:!1,isLabel:!1}}),n.submitDraw(r,t),n.setShader({...o,defines:{...s,isHaloPass:!1,isBackgroundPass:!1,isLabel:!1}}),n.submitDraw(r,t)}};const Sc={fill:new xfn("fill"),patternFill:new Tfn("patternFill"),complexFill:new bfn("complexFill"),outlineFill:new Sfn("outlineFill"),patternOutlineFill:new Cfn("patternOutlineFill"),complexOutlineFill:new wfn("complexOutlineFill"),marker:new Gfn("marker"),pieChart:new qfn("pieChart"),line:new $fn("line"),texturedLine:new Bfn("texturedLine"),text:new Yfn("text"),label:new Nfn("label"),heatmap:new Pfn("heatmap"),dotDensity:new _fn("dotDensity")};function Xfn(){for(const i in Sc)Sc[i].startup()}function Jfn(i){for(const e in Sc)Sc[e].shutdown(i)}let e1t=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:bn.ONE,dstRGB:bn.ZERO,srcAlpha:bn.ONE,dstAlpha:bn.ZERO},this.blendEquation={mode:I3.ADD,modeAlpha:I3.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=W1.BACK,this.frontFace=wq.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=Hl.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:W1.FRONT_AND_BACK,func:Hl.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:W1.FRONT_AND_BACK,fail:il.KEEP,zFail:il.KEEP,zPass:il.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},Kfn=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(r0){e+=`Live objects: +`;s+=l,o+=l}return s+=this.vertexShader,o+=this.fragmentShader,new y9e(s,o,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const r in this.required){const n=this.required[r];t.push({uniformHydrated:null,shaderModulePath:r,uniformName:r,uniformType:n.type,uniformArrayElementType:Zvt(n),uniformArrayLength:Qvt(n)})}for(const r in e){const n=this.options[r];if(e[r])for(const s in n){const o=n[s];t.push({uniformHydrated:null,shaderModulePath:`${r}.${s}`,uniformName:s,uniformType:o.type,uniformArrayElementType:Zvt(o),uniformArrayLength:Qvt(o)})}}return t}};const Zvt=i=>i.type==="array"?i.elementType?.type:void 0,Qvt=i=>i.type==="array"?i.size:void 0,jfn={hittestDist:Ni,hittestPos:As},Gfn={filterFlags:_f,animation:_f,visualVariableData:_f,dataDriven0:_f,dataDriven1:_f,dataDriven2:_f,gpgpu:_f,size:Ni},Ufn={displayViewScreenMat3:Tf,displayViewMat3:Tf,displayMat3:Tf,viewMat3:Tf,tileMat3:Tf,displayZoomFactor:Ni,requiredZoomFactor:Ni,tileOffset:As,currentScale:Ni,currentZoom:Ni,metersPerSRUnit:Ni};let zfn=class extends Bfn{constructor(){super(...arguments),this.vertexShader=Rm("materials/pie/pie.vert"),this.fragmentShader=Rm("materials/pie/pie.frag"),this.required={...Gfn,...Ufn,outlineWidth:Ni,colors:gf,defaultColor:qo,othersColor:qo,outlineColor:qo,donutRatio:Ni,sectorThreshold:Ni},this.options={hittestUniforms:jfn,visualVariableSizeMinMaxValue:{minMaxValueAndSize:qo},visualVariableSizeScaleStops:{sizes:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},values:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}},visualVariableSizeStops:{sizes:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},values:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:Ni},visualVariableOpacity:{opacities:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8},opacityValues:{...gf.ofType(Ni,8),type:"array",elementType:Ni,size:8}}},this.locations={pos:{index:0,type:As},id:{index:1,type:Ul},bitset:{index:2,type:Ni},offset:{index:3,type:As},texCoords:{index:4,type:As},size:{index:5,type:As},referenceSize:{index:6,type:Ni},zoomRange:{index:7,type:As}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...gf.ofType(qo,e),type:"array",elementType:qo,size:e}}},Vfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.PieChartMeshWriter,this.shaders={geometry:new zfn},this.symbologyPlane=TE.MARKER}render(e,t){const{context:r,painter:n}=e,{instance:s,target:o}=t,a=this.shaders.geometry,l=s.getInput(),u=l.numberOfFields,c=fg(e),h=l_(e,o),p=zv(e);a.setNumberOfFields(u),n.setShader({shader:a,uniforms:{...oT(e,t.target,l.geometry),...h.storage,...h.view,hittestUniforms:h.hittestRequest?{hittestDist:h.hittestRequest?.distance,hittestPos:h.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!l.geometry.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!l.geometry.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!l.geometry.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!l.geometry.visualVariableSizeUnitValue,VV_OPACITY:!!l.geometry.visualVariableOpacity,HITTEST:c,highlight:h.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),n.setPipelineState(u_(e)),n.submitDraw(r,t)}},Hfn=class extends Yb{constructor(){super(...arguments),this.meshWriter=f_.TextMeshWriter,this.shaders={geometry:new I1},this.symbologyPlane=TE.TEXT}render(e,t){const{context:r,painter:n}=e,s=zv(e),o={shader:this.shaders.geometry,uniforms:{...oT(e,t.target,t.instance.getInput().geometry),...l_(e,t.target),mosaicInfo:n.textureManager.getMosaicInfo(r,t.textureKey)},defines:{...s,isHaloPass:!1,isBackgroundPass:!0,isLabel:!1},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:fg(e)};n.setShader(o),n.setPipelineState(u_(e)),n.submitDraw(r,t),n.setShader({...o,defines:{...s,isHaloPass:!0,isBackgroundPass:!1,isLabel:!1}}),n.submitDraw(r,t),n.setShader({...o,defines:{...s,isHaloPass:!1,isBackgroundPass:!1,isLabel:!1}}),n.submitDraw(r,t)}};const Sc={fill:new _fn("fill"),patternFill:new wfn("patternFill"),complexFill:new yfn("complexFill"),outlineFill:new bfn("outlineFill"),patternOutlineFill:new xfn("patternOutlineFill"),complexOutlineFill:new vfn("complexOutlineFill"),marker:new $fn("marker"),pieChart:new Vfn("pieChart"),line:new kfn("line"),texturedLine:new Lfn("texturedLine"),text:new Hfn("text"),label:new Ffn("label"),heatmap:new Afn("heatmap"),dotDensity:new gfn("dotDensity")};function Wfn(){for(const i in Sc)Sc[i].startup()}function qfn(i){for(const e in Sc)Sc[e].shutdown(i)}let e1t=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:bn.ONE,dstRGB:bn.ZERO,srcAlpha:bn.ONE,dstAlpha:bn.ZERO},this.blendEquation={mode:I3.ADD,modeAlpha:I3.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=W1.BACK,this.frontFace=wq.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=Wl.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:W1.FRONT_AND_BACK,func:Wl.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:W1.FRONT_AND_BACK,fail:il.KEEP,zFail:il.KEEP,zPass:il.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},Yfn=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(r0){e+=`Live objects: `;for(let t=0;t0&&(e+=`${bd[t]}: ${r} -`)}}return e+=this._allocations?.resetLog(),e}},Zfn=class{constructor(e,t,r){const n=t.textureFilterAnisotropic,s=r.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=n?Math.min(e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY),s):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES)}};function bYt(i,e,t=I3.ADD,r=[0,0,0,0]){return{srcRgb:i,srcAlpha:i,dstRgb:e,dstAlpha:e,opRgb:t,opAlpha:t,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function Qfn(i,e,t,r,n=I3.ADD,s=I3.ADD,o=[0,0,0,0]){return{srcRgb:i,srcAlpha:e,dstRgb:t,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}const emn={face:W1.BACK,mode:wq.CCW},tmn={face:W1.FRONT,mode:wq.CCW},imn=i=>i===XS.Back?emn:i===XS.Front?tmn:null,rmn={zNear:0,zFar:1},GKe={r:!0,g:!0,b:!0,a:!0};function nmn(i){return pmn.intern(i)}function smn(i){return fmn.intern(i)}function omn(i){return mmn.intern(i)}function amn(i){return gmn.intern(i)}function lmn(i){return ymn.intern(i)}function umn(i){return vmn.intern(i)}function cmn(i){return _mn.intern(i)}function hmn(i){return bmn.intern(i)}function dmn(i){return wmn.intern(i)}function qCe(i){return xmn.intern(i)}let iM=class{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}};function rM(i){return"["+i.join(",")+"]"}const pmn=new iM(wYt,i=>({__tag:"Blending",...i}));function wYt(i){return i?rM([i.srcRgb,i.srcAlpha,i.dstRgb,i.dstAlpha,i.opRgb,i.opAlpha,i.color.r,i.color.g,i.color.b,i.color.a]):null}const fmn=new iM(xYt,i=>({__tag:"Culling",...i}));function xYt(i){return i?rM([i.face,i.mode]):null}const mmn=new iM(SYt,i=>({__tag:"PolygonOffset",...i}));function SYt(i){return i?rM([i.factor,i.units]):null}const gmn=new iM(TYt,i=>({__tag:"DepthTest",...i}));function TYt(i){return i?rM([i.func]):null}const ymn=new iM(CYt,i=>({__tag:"StencilTest",...i}));function CYt(i){return i?rM([i.function.func,i.function.ref,i.function.mask,i.operation.fail,i.operation.zFail,i.operation.zPass]):null}const vmn=new iM(EYt,i=>({__tag:"DepthWrite",...i}));function EYt(i){return i?rM([i.zNear,i.zFar]):null}const _mn=new iM(IYt,i=>({__tag:"ColorWrite",...i}));function IYt(i){return i?rM([i.r,i.g,i.b,i.a]):null}const bmn=new iM(AYt,i=>({__tag:"StencilWrite",...i}));function AYt(i){return i?rM([i.mask]):null}const wmn=new iM(MYt,i=>({__tag:"DrawBuffers",...i}));function MYt(i){return i?rM(i.buffers):null}const xmn=new iM(Smn,i=>({blending:nmn(i.blending),culling:smn(i.culling),polygonOffset:omn(i.polygonOffset),depthTest:amn(i.depthTest),stencilTest:lmn(i.stencilTest),depthWrite:umn(i.depthWrite),colorWrite:cmn(i.colorWrite),stencilWrite:hmn(i.stencilWrite),drawBuffers:dmn(i.drawBuffers)}));function Smn(i){return i?rM([wYt(i.blending),xYt(i.culling),SYt(i.polygonOffset),TYt(i.depthTest),CYt(i.stencilTest),EYt(i.depthWrite),IYt(i.colorWrite),AYt(i.stencilWrite),MYt(i.drawBuffers)]):null}let Tmn=class{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._setDrawBuffers(e.drawBuffers),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(e){this._drawBuffers=this._setSubState(e,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(e,t,r,n){return(r||e!==t)&&(n(e),this._pipelineInvalid=!0),e}},Cmn=class{};const Ule=Cmn;function Ei(i,...e){let t="";for(let r=0;ri===XS.Back?Kfn:i===XS.Front?Zfn:null,emn={zNear:0,zFar:1},GKe={r:!0,g:!0,b:!0,a:!0};function tmn(i){return cmn.intern(i)}function imn(i){return hmn.intern(i)}function rmn(i){return dmn.intern(i)}function nmn(i){return pmn.intern(i)}function smn(i){return fmn.intern(i)}function omn(i){return mmn.intern(i)}function amn(i){return gmn.intern(i)}function lmn(i){return ymn.intern(i)}function umn(i){return vmn.intern(i)}function qCe(i){return _mn.intern(i)}let iM=class{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}};function rM(i){return"["+i.join(",")+"]"}const cmn=new iM(wYt,i=>({__tag:"Blending",...i}));function wYt(i){return i?rM([i.srcRgb,i.srcAlpha,i.dstRgb,i.dstAlpha,i.opRgb,i.opAlpha,i.color.r,i.color.g,i.color.b,i.color.a]):null}const hmn=new iM(xYt,i=>({__tag:"Culling",...i}));function xYt(i){return i?rM([i.face,i.mode]):null}const dmn=new iM(SYt,i=>({__tag:"PolygonOffset",...i}));function SYt(i){return i?rM([i.factor,i.units]):null}const pmn=new iM(TYt,i=>({__tag:"DepthTest",...i}));function TYt(i){return i?rM([i.func]):null}const fmn=new iM(CYt,i=>({__tag:"StencilTest",...i}));function CYt(i){return i?rM([i.function.func,i.function.ref,i.function.mask,i.operation.fail,i.operation.zFail,i.operation.zPass]):null}const mmn=new iM(EYt,i=>({__tag:"DepthWrite",...i}));function EYt(i){return i?rM([i.zNear,i.zFar]):null}const gmn=new iM(IYt,i=>({__tag:"ColorWrite",...i}));function IYt(i){return i?rM([i.r,i.g,i.b,i.a]):null}const ymn=new iM(AYt,i=>({__tag:"StencilWrite",...i}));function AYt(i){return i?rM([i.mask]):null}const vmn=new iM(MYt,i=>({__tag:"DrawBuffers",...i}));function MYt(i){return i?rM(i.buffers):null}const _mn=new iM(bmn,i=>({blending:tmn(i.blending),culling:imn(i.culling),polygonOffset:rmn(i.polygonOffset),depthTest:nmn(i.depthTest),stencilTest:smn(i.stencilTest),depthWrite:omn(i.depthWrite),colorWrite:amn(i.colorWrite),stencilWrite:lmn(i.stencilWrite),drawBuffers:umn(i.drawBuffers)}));function bmn(i){return i?rM([wYt(i.blending),xYt(i.culling),SYt(i.polygonOffset),TYt(i.depthTest),CYt(i.stencilTest),EYt(i.depthWrite),IYt(i.colorWrite),AYt(i.stencilWrite),MYt(i.drawBuffers)]):null}let wmn=class{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._setDrawBuffers(e.drawBuffers),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(e){this._drawBuffers=this._setSubState(e,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(e,t,r,n){return(r||e!==t)&&(n(e),this._pipelineInvalid=!0),e}},xmn=class{};const Ule=xmn;function Ei(i,...e){let t="";for(let r=0;r5)}_runProgram(e){const t=this._rctx;t.resetState();const r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["position",0]]),{geometry:[new Vl("position",2,Ti.UNSIGNED_SHORT,0,4)]},{geometry:s}),a=Do(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),l=Do(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),u=new Float32Array(6);w0t(a,u,3);const c=new Float32Array(6);w0t(l,c,3),t.useProgram(e),e.setUniform3f("u_highA",u[0],u[2],u[4]),e.setUniform3f("u_lowA",u[1],u[3],u[5]),e.setUniform3f("u_highB",c[0],c[2],c[4]),e.setUniform3f("u_lowB",c[1],c[3],c[5]),t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const h=new Uint8Array(4);n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,h),o.dispose(),n.dispose();const p=(a[2]-l[2])/25,m=Lqt(h);return Math.abs(p-m)}};function t1t(i,e){const t=` + `;return this._rctx.programCache.acquire(t,r,new Map([]))}_prepareHelperProgram(){const e=Smn.getShaderSources();return this._rctx.programCache.acquire(e.vertex,e.fragment,new Map([]))}},Cmn=class extends zle{constructor(e){super(),this._rctx=e,this._program=t1t(this._rctx,!1),this._obfuscated=t1t(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=ba(this._obfuscated)}_test(e){if(yi("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const t=this._rctx,r=t.getBoundFramebufferObject(),{x:n,y:s,width:o,height:a}=t.getViewport(),l=this._runProgram(e),u=this._runProgram(this._obfuscated);return t.setViewport(n,s,o,a),t.bindFramebuffer(r),l!==0&&(u===0||l/u>5)}_runProgram(e){const t=this._rctx;t.resetState();const r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["position",0]]),{geometry:[new Hl("position",2,Ti.UNSIGNED_SHORT,0,4)]},{geometry:s}),a=Do(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),l=Do(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),u=new Float32Array(6);w0t(a,u,3);const c=new Float32Array(6);w0t(l,c,3),t.useProgram(e),e.setUniform3f("u_highA",u[0],u[2],u[4]),e.setUniform3f("u_lowA",u[1],u[3],u[5]),e.setUniform3f("u_highB",c[0],c[2],c[4]),e.setUniform3f("u_lowB",c[1],c[3],c[5]),t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const h=new Uint8Array(4);n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,h),o.dispose(),n.dispose();const p=(a[2]-l[2])/25,m=Lqt(h);return Math.abs(p-m)}};function t1t(i,e){const t=` precision highp float; @@ -4937,7 +4937,7 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre void main() { gl_FragColor = v_color; } - `,new Map([["position",0]]))}var KS;(function(i){i[i.Color=0]="Color",i[i.Alpha=1]="Alpha",i[i.FrontFace=2]="FrontFace",i[i.NONE=3]="NONE",i[i.COUNT=4]="COUNT"})(KS||(KS={}));const Mmn=Qfn(bn.SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE_MINUS_SRC_ALPHA),Omn=bYt(bn.ONE,bn.ONE),PYt=bYt(bn.ZERO,bn.ONE_MINUS_SRC_ALPHA);function Pmn(i){return i===KS.FrontFace?null:i===KS.Alpha?PYt:Omn}const Rmn=5e5,Dmn={factor:-1,units:-2};function Fmn(i){return i?Dmn:null}function kmn(i,e=Hl.LESS){return i===KS.NONE||i===KS.FrontFace?e:Hl.LEQUAL}let Lmn=class extends zle{constructor(e){if(super(),this._rctx=e,!e.gl||!(e.capabilities.colorBufferFloat?.textureFloat&&e.capabilities.colorBufferFloat?.floatBlend))return;const t=` + `,new Map([["position",0]]))}var KS;(function(i){i[i.Color=0]="Color",i[i.Alpha=1]="Alpha",i[i.FrontFace=2]="FrontFace",i[i.NONE=3]="NONE",i[i.COUNT=4]="COUNT"})(KS||(KS={}));const Emn=Jfn(bn.SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE_MINUS_SRC_ALPHA),Imn=bYt(bn.ONE,bn.ONE),PYt=bYt(bn.ZERO,bn.ONE_MINUS_SRC_ALPHA);function Amn(i){return i===KS.FrontFace?null:i===KS.Alpha?PYt:Imn}const Mmn=5e5,Omn={factor:-1,units:-2};function Pmn(i){return i?Omn:null}function Rmn(i,e=Wl.LESS){return i===KS.NONE||i===KS.FrontFace?e:Wl.LEQUAL}let Dmn=class extends zle{constructor(e){if(super(),this._rctx=e,!e.gl||!(e.capabilities.colorBufferFloat?.textureFloat&&e.capabilities.colorBufferFloat?.floatBlend))return;const t=` precision highp float; attribute vec2 a_pos; @@ -4950,7 +4950,7 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre void main() { gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); } - `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}_test(e){const t=this._rctx,r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.dataType=lc.FLOAT,r.internalFormat=gs.RGBA32F,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["a_pos",0]]),{geometry:[new Vl("a_pos",2,Ti.UNSIGNED_SHORT,0,4)]},{geometry:s});t.useProgram(e);const a=t.getBoundFramebufferObject(),{x:l,y:u,width:c,height:h}=t.getViewport();t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const p=qCe({blending:PYt});t.setPipelineState(p),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const m=t.gl.getError();return t.setViewport(l,u,c,h),t.bindFramebuffer(a),o.dispose(),n.dispose(),m!==1282||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}},Nmn=class extends zle{constructor(e){super(),this._rctx=e;const t=` + `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}_test(e){const t=this._rctx,r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.dataType=lc.FLOAT,r.internalFormat=gs.RGBA32F,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["a_pos",0]]),{geometry:[new Hl("a_pos",2,Ti.UNSIGNED_SHORT,0,4)]},{geometry:s});t.useProgram(e);const a=t.getBoundFramebufferObject(),{x:l,y:u,width:c,height:h}=t.getViewport();t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const p=qCe({blending:PYt});t.setPipelineState(p),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const m=t.gl.getError();return t.setViewport(l,u,c,h),t.bindFramebuffer(a),o.dispose(),n.dispose(),m!==1282||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}},Fmn=class extends zle{constructor(e){super(),this._rctx=e;const t=` precision highp float; attribute vec2 a_pos; uniform highp sampler2D u_texture; @@ -4975,7 +4975,7 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre void main() { gl_FragColor = v_color; } - `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}_test(e){const t=this._rctx,r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=new Uint8Array(4),o=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),a=new wh(t,new Map([["a_position",0]]),{geometry:[new Vl("a_position",2,Ti.SHORT,0,4)]},{geometry:o});t.useProgram(e);const l=new fl(t,r,new Uint8Array([2,255,0,0]));e.setUniform1i("u_texture",0),t.bindTexture(l,0);const u=t.getBoundFramebufferObject();t.bindFramebuffer(n),t.useProgram(e);const{x:c,y:h,width:p,height:m}=t.getViewport();t.setViewport(0,0,1,1),t.bindVAO(a),t.drawArrays(Eo.TRIANGLE_STRIP,0,4),t.setViewport(c,h,p,m),n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,s),a.dispose(),n.dispose();const v=s[0]!==255||s[1]!==255||s[2]!==255||s[3]!==255;return v&&di.getLogger("esri.views.webgl.testSamplerPrecision").warn(`A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [${s[0]}.${s[1]}.${s[2]}.${s[3]}]`),t.bindFramebuffer(u),v}},$mn=class extends zle{constructor(e){super(),this._rctx=e;const t=` + `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}_test(e){const t=this._rctx,r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=new Uint8Array(4),o=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),a=new wh(t,new Map([["a_position",0]]),{geometry:[new Hl("a_position",2,Ti.SHORT,0,4)]},{geometry:o});t.useProgram(e);const l=new fl(t,r,new Uint8Array([2,255,0,0]));e.setUniform1i("u_texture",0),t.bindTexture(l,0);const u=t.getBoundFramebufferObject();t.bindFramebuffer(n),t.useProgram(e);const{x:c,y:h,width:p,height:m}=t.getViewport();t.setViewport(0,0,1,1),t.bindVAO(a),t.drawArrays(Eo.TRIANGLE_STRIP,0,4),t.setViewport(c,h,p,m),n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,s),a.dispose(),n.dispose();const v=s[0]!==255||s[1]!==255||s[2]!==255||s[3]!==255;return v&&di.getLogger("esri.views.webgl.testSamplerPrecision").warn(`A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [${s[0]}.${s[1]}.${s[2]}.${s[3]}]`),t.bindFramebuffer(u),v}},kmn=class extends zle{constructor(e){super(),this._rctx=e;const t=` precision highp float; attribute vec2 a_pos; @@ -4995,10 +4995,10 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre void main() { gl_FragColor = texture2D(u_texture, v_uv); } - `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}dispose(){super.dispose()}_test(e){const t=this._rctx;if(!t.gl)return e.dispose(),!0;const r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["a_pos",0]]),Yqt,{geometry:s}),a=new Ua;a.samplingMode=Is.LINEAR,a.wrapMode=Ls.CLAMP_TO_EDGE;const l=new fl(t,a,pte);t.useProgram(e),t.bindTexture(l,0),e.setUniform1i("u_texture",0);const u=t.getBoundFramebufferObject(),{x:c,y:h,width:p,height:m}=t.getViewport();t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.setClearColor(0,0,0,0),t.setBlendingEnabled(!1),t.clearSafe(lb.COLOR_BUFFER_BIT),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const v=new Uint8Array(4);return n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,v),o.dispose(),n.dispose(),l.dispose(),t.setViewport(c,h,p,m),t.bindFramebuffer(u),v[0]!==255}};const pte=new Image;pte.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",pte.width=5,pte.height=5,pte.decode();let Bmn=class{constructor(e){this.rctx=e,this.floatBufferBlend=new Lmn(e),this.svgPremultipliesAlpha=new $mn(e),this.doublePrecisionRequiresObfuscation=new Amn(e),this.ignoresSamplerPrecision=new Nmn(e),this.drawArraysRequiresIndicesTypeReset=new Imn(e)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}};function jmn(i,e){if(e.compressedTextureETC)return null;const t=i.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function Gmn(i,e){if(e.compressedTextureS3TC)return null;const t=i.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function Umn(i,e){if(e.textureFilterAnisotropic)return null;const t=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function zmn(i,e){const t=!e.colorBufferHalfFloat&&i.getExtension("EXT_color_buffer_half_float")||!e.colorBufferFloat&&i.getExtension("EXT_color_buffer_float"),r=!e.colorBufferFloat&&i.getExtension("EXT_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&i.getExtension("EXT_float_blend");return t||r||n?{textureFloat:!!r,textureHalfFloat:!!t,floatBlend:!!n,R16F:i.R16F,RG16F:i.RG16F,RGBA16F:i.RGBA16F,R32F:i.R32F,RG32F:i.RG32F,RGBA32F:i.RGBA32F,R11F_G11F_B10F:i.R11F_G11F_B10F,RGB16F:i.RGB16F}:null}function i1t(i,e,t,r,n){if(r)return!0;if(e[t])return!1;for(const s of n)if(i.getExtension(s))return!0;return!1}function Vmn(i,e){if(e.textureNorm16)return null;const t=i.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Hmn(i,e){const t=e.loseContext&&i.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}let Wmn=class{constructor(e,t){this._gl=e,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._depthTexture=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=jmn(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=Gmn(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=Umn(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=uYt(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){if(!this._textureFloat){const{textureFloatLinear:e}=this._disabledExtensions;this._textureFloat={textureFloatLinear:!e&&!!this._gl.getExtension("OES_texture_float_linear")}}return this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=zmn(this._gl,this._disabledExtensions)),this._colorBufferFloat}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=i1t(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get loseContext(){return this._loseContext||(this._loseContext=Hmn(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=Vmn(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=i1t(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},RYt=class{constructor(e,t){this.gl=e,this.instanceCounter=new Kfn,this.programCache=new Fqt(this),this._transformFeedbackRequestInfo=null,this._state=new e1t,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(t)}configure(e){this._capabilities=new Wmn(this.gl,e),this._parameters=new Zfn(this.gl,this._capabilities,e),fl.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const t=this.gl.getParameter(this.gl.VIEWPORT);this._state=new e1t,this._state.viewport={x:t[0],y:t[1],width:t[2],height:t[3]},this._stateTracker=new Tmn({setBlending:r=>{if(r){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(r.opRgb,r.opAlpha),this.setBlendFunctionSeparate(r.srcRgb,r.dstRgb,r.srcAlpha,r.dstAlpha);const n=r.color;this.setBlendColor(n.r,n.g,n.b,n.a)}else this.setBlendingEnabled(!1)},setCulling:r=>{r?(this.setFaceCullingEnabled(!0),this.setCullFace(r.face),this.setFrontFace(r.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:r=>{r?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(r.factor,r.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:r=>{r?(this.setDepthTestEnabled(!0),this.setDepthFunction(r.func)):this.setDepthTestEnabled(!1)},setStencilTest:r=>{if(r){this.setStencilTestEnabled(!0);const n=r.function;this.setStencilFunction(n.func,n.ref,n.mask);const s=r.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:r=>{r?(this.setDepthWriteEnabled(!0),this.setDepthRange(r.zNear,r.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:r=>{r?this.setColorMask(r.r,r.g,r.b,r.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:r=>{r?this.setStencilWriteMask(r.mask):this.setStencilWriteMask(0)},setDrawBuffers:r=>{const{gl:n}=this;if(r)n.drawBuffers(r.buffers);else{const{drawFramebuffer:s}=this._state;s===null||s.colorAttachments.length===0?n.drawBuffers([f8e.BACK]):n.drawBuffers([pv.COLOR_ATTACHMENT0])}}}),this.enforceState(),ba(this._driverTest),this._driverTest=new Bmn(this)}dispose(){ba(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(Bs.ARRAY_BUFFER),this.unbindBuffer(Bs.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(Bs.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(Bs.PIXEL_PACK_BUFFER),this.unbindBuffer(Bs.PIXEL_UNPACK_BUFFER),this.unbindBuffer(Bs.COPY_READ_BUFFER),this.unbindBuffer(Bs.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,yC()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,t){for(let r=0;r=0&&(this._state.activeTexture=t)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,t,r,n){e===this._state.blendColor.r&&t===this._state.blendColor.g&&r===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,t,r,n),this._state.blendColor.r=e,this._state.blendColor.g=t,this._state.blendColor.b=r,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,t){e===this._state.blendFunction.srcRGB&&t===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,t),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=t,this._state.blendFunction.dstAlpha=t,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,t,r,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===r&&this._state.blendFunction.dstRGB===t&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,t,r,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=r,this._state.blendFunction.dstRGB=t,this._state.blendFunction.dstAlpha=n,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,t){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===t||(this.gl.blendEquationSeparate(e,t),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setColorMask(e,t,r,n){this._state.colorMask.r===e&&this._state.colorMask.g===t&&this._state.colorMask.b===r&&this._state.colorMask.a===n||(this.gl.colorMask(e,t,r,n),this._state.colorMask.r=e,this._state.colorMask.g=t,this._state.colorMask.b=r,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,t,r,n){this._state.clearColor.r===e&&this._state.clearColor.g===t&&this._state.clearColor.b===r&&this._state.clearColor.a===n||(this.gl.clearColor(e,t,r,n),this._state.clearColor.r=e,this._state.clearColor.g=t,this._state.clearColor.b=r,this._state.clearColor.a=n)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,t){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===t||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=t,this.gl.polygonOffset(e,t),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,t,r,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===t&&this._state.scissorRect.width===r&&this._state.scissorRect.height===n||(this.gl.scissor(e,t,r,n),this._state.scissorRect.x=e,this._state.scissorRect.y=t,this._state.scissorRect.width=r,this._state.scissorRect.height=n)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,t){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===t||(this.gl.depthRange(e,t),this._state.depthRange.zNear=e,this._state.depthRange.zFar=t,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,t,r){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===r||(this.gl.stencilFunc(e,t,r),this._state.stencilFunction.face=W1.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=r,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,t,r,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,t,r,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=r,this._state.stencilFunction.mask=n,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,t,r){this._state.stencilOperation.face===W1.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===r||(this.gl.stencilOp(e,t,r),this._state.stencilOperation.face=W1.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=r,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,t,r,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,t,r,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,t=!1){const r=this._state.activeTexture;return e>=0&&(t||e!==this._state.activeTexture)&&(this.gl.activeTexture(zOe+e),this._state.activeTexture=e),r}clear(e){e&&this.gl.clear(e)}clearSafe(e,t=255){e&&(e&lb.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&lb.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&lb.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(t),this.gl.clear(e))}clearFramebuffer(e,t=!1,r=!1){let n=0;if(e){const o=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],o),n|=lb.COLOR_BUFFER_BIT}t&&(n|=lb.DEPTH_BUFFER_BIT),r===!1?r=0:(r===!0&&(r=255),n|=lb.STENCIL_BUFFER_BIT),n&&this.clearSafe(n,r)}drawArrays(e,t,r){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(yC()){this._numOfDrawCalls++,this._numOfTriangles+=r1t(e,r);const n=this._state.textureUnitMap;for(let s=0;s=this.parameters.maxTextureImageUnits||t<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[t];return e?.glName==null?(n!=null&&(this.setActiveTexture(t,r),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[t]=null,n):r||n!==e?(this.setActiveTexture(t,r),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[t]=e,n):(e.isDirty&&(this.setActiveTexture(t,r),e.applyChanges()),n)}unbindTexture(e){if(e!=null)for(let t=0;t=this.parameters.maxUniformBufferBindings||t<0)return console.error("Uniform buffer binding point is out of range!"),null;const r=e===Bs.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let n=r[t];return n==null&&(n={buffer:null,offset:0,size:0},r[t]=n),n}bindBufferBase(e,t,r){const n=this._getBufferBinding(e,t);n!=null&&(n.buffer===r&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,t,r?r.glName:null),n.buffer=r,n.offset=0,n.size=0))}bindBufferRange(e,t,r,n,s){const o=this._getBufferBinding(e,t);o!=null&&(o.buffer===r&&o.offset===n&&o.size===s||(n%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,t,r.glName,n,s),o.buffer=r,o.offset=n,o.size=s):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,t,r,n){t!=null?(yC()&&(n??t.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),t.initialize(),r!==void 0&&n!==void 0?this.bindBufferRange(Bs.UNIFORM_BUFFER,e,t.buffer,r,n):this.bindBufferBase(Bs.UNIFORM_BUFFER,e,t.buffer)):this.bindBufferBase(Bs.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let t=0,r=this._state.uniformBufferBindingPoints.length;tthis._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new xWe,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new dfn(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return r()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=H9({render:n=>this.renderFrame(n)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",n=>this.emit("webgl-error",{error:new qe("webgl-context-lost",n.statusMessage)})),this._bufferPool=new _dn,Xfn()}destroy(){Jfn(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=Hc(this._taskHandle),this._lostWebGLContextHandle=Hc(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=qmn,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Cc()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(uHr),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=aa.MAP;for(const n of e)n.processRender(t);if(this.children.some(n=>n.hasHighlight)){t.drawPhase=aa.HIGHLIGHT;for(const n of e)n.processRender(t)}if(this.children.some(n=>n.hasLabels)){t.drawPhase=aa.LABEL;for(const n of e)n.processRender(t)}if(yi("esri-tiles-debug")){t.drawPhase=aa.DEBUG;for(const n of e)n.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:n}=e;this._canvas.resize(e),t.setViewport(0,0,n*r.size[0],n*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,n){const s=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,l=this.context,u=this._state.clone();if(n!=null){const R=u.viewpoint;u.viewpoint.rotation=n,u.viewpoint=R}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:u,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},h=new Ua(s,o);h.wrapMode=Ls.CLAMP_TO_EDGE,h.internalFormat=gs.RGBA8,h.isImmutable=!0;const p=new Wd(l,h,new Mle(vf.DEPTH_STENCIL,s,o)),m=l.getBoundFramebufferObject(),v=l.getViewport();l.bindFramebuffer(p),l.setViewport(0,0,s,o),this._renderChildren(t??this.children,c);const w=this._readbackScreenshot(p,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(m),l.setViewport(v.x,v.y,v.width,v.height),this.requestRender();const S=await w;let I;return e.outputScale===1?I=S:(I=new ImageData(Math.round(S.width*e.outputScale),Math.round(S.height*e.outputScale)),evr(S,I)),p.dispose(),I}async _readbackScreenshot(e,t){const r=z0r(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,ks.RGBA,lc.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}};const eI=1,nwe=0,Ere=1,Ire=2;let Xmn=class{constructor(e,t,r){this._debugMap=new Map,this._width=e*r,this._height=t*r,this._pixelRatio=r;const n=Math.ceil(this._width/eI),s=Math.ceil(this._height/eI);this._cols=n,this._rows=s,this._cells=ACe.create(n*s)}insertMetrics(e){this._markMetrics(e)}hasCollision(e){let t=0;for(const{computedX:r,computedY:n,width:s,height:o}of e.bounds){const a=(s+hee)*this._pixelRatio,l=(o+hee)*this._pixelRatio;switch(this._collide(r,n,a,l)){case Ire:return Ire;case Ere:t++}}return t===e.bounds.length?Ere:nwe}getCellId(e,t){return e+t*this._cols}has(e){return this._cells.has(e)}hasRange(e,t){return this._cells.hasRange(e,t)}set(e){this._cells.set(e)}setRange(e,t){this._cells.setRange(e,t)}_collide(e,t,r,n){const s=e-r/2,o=t-n/2,a=s+r,l=o+n;if(a<0||l<0||s>this._width||o>this._height)return Ere;const u=uu(Math.floor(s/eI),0,this._cols),c=uu(Math.floor(o/eI),0,this._rows),h=uu(Math.ceil(a/eI),0,this._cols),p=uu(Math.ceil(l/eI),0,this._rows);for(let m=c;m<=p;m++)for(let v=u;v<=h;v++){const w=this.getCellId(v,m);if(this.has(w))return Ire}return nwe}_mark(e,t,r,n,s){const o=e-r/2,a=t-n/2,l=o+r,u=a+n,c=uu(Math.floor(o/eI),0,this._cols),h=uu(Math.floor(a/eI),0,this._rows),p=uu(Math.ceil(l/eI),0,this._cols),m=uu(Math.ceil(u/eI),0,this._rows);for(let v=h;v<=m;v++)for(let w=c;w<=p;w++){const S=this.getCellId(w,v);this._debugMap.set(S,s),this.set(S)}return!1}_markMetrics(e){for(const{computedX:t,computedY:r,width:n,height:s}of e.bounds){const o=(n+hee)*this._pixelRatio,a=(s+hee)*this._pixelRatio;this._mark(t,r,o,a,e.entityTexel)}}};const kK=254,_pe=255,LK=0;function Kj(i,e){const t=i.children.slice();t.sort((r,n)=>r.tileAge-n.tileAge),t.forEach(r=>{r.labelMetrics!=null&&r.isReady&&e(r,r.labelMetrics)})}function n1t(i,e){return(!i.minScale||i.minScale>=e)&&(!i.maxScale||i.maxScale<=e)}let Jmn=class{run(e,t,r,n){const s=[];for(let o=e.length-1;o>=0;o--){const a=e[o];a.labelingCollisionInfos?.length&&s.push(...a.labelingCollisionInfos)}yi("esri-2d-update-debug")&&s.length&&console.debug("CollisionEngine.run"),this._transformMetrics(s),this._runCollision(s,t,r,n);for(const o of s)o.container.requestRender()}_runCollision(e,t,r,n){const[s,o]=t.state.size,a=new Xmn(s,o,t.pixelRatio);for(const{container:l,deconflictionEnabled:u,visible:c}of e){const h=l.attributeView;u?c?(this._prepare(l),this._collideVisible(a,l,r,n),this._collideInvisible(a,l)):Kj(l,(p,m)=>{for(const v of m)h.setLabelMinZoom(v.entityTexel,_pe)}):Kj(l,(p,m)=>{for(const v of m)n1t(v,r)?(h.setLabelMinZoom(v.entityTexel,LK),c&&a.insertMetrics(v)):h.setLabelMinZoom(v.entityTexel,kK)})}}_isFiltered(e,t,r){const n=t.getFilterFlags(e),s=!r.hasFilter||!!(n&pJe),o=r.featureEffect==null||r.featureEffect.excludedLabelsVisible||!!(n&sHr);return!(s&&o)}_prepare(e){const t=e.attributeView,r=new Set;Kj(e,(n,s)=>{for(const o of s){const a=o.entityTexel;if(!r.has(a)){if(r.add(a),this._isFiltered(a,t,e.layerView)){t.setLabelMinZoom(a,kK);continue}t.getLabelMinZoom(a)!==LK?t.setLabelMinZoom(a,_pe):t.setLabelMinZoom(a,LK)}}})}_collideVisible(e,t,r,n){const s=t.attributeView,o=new Set;Kj(t,(a,l)=>{for(let u=0;u{for(let a=0;a{const a=t.attributeView,l=s.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const u=r==="polyline";for(const c of o){const{entityTexel:h,anchorX:p,anchorY:m}=c;let v=c.referenceBounds?.size??0;const w=n[0];if(w!=null){const R=w(a.getVVSize(h));v=isNaN(R)||R==null||R===1/0?v:R}const S=c.directionX*(v/2),I=c.directionY*(v/2);for(const R of c.bounds){let L=p,k=m;if(u){let B=L+R.x+S,$=k+R.y+I;B=l[0]*B+l[2]*$+l[4],$=l[1]*B+l[3]*$+l[5],R.computedX=Math.floor(B),R.computedY=Math.floor($)}else{L=l[0]*p+l[2]*m+l[4],k=l[1]*p+l[3]*m+l[5];const B=L+R.x+S,$=k+R.y+I;R.computedX=B,R.computedY=$}}}})}};const Kmn=32;let JU=class extends un{constructor(e){super(e),this._lastUpdate=0,this.collisionEngine=new Jmn,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return yi("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: --> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){const t=performance.now();t-this._lastUpdate>=Kmn?(this._lastUpdate=t,this.doUpdate(e)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}doUpdate(e){const t=this.view;if(t)try{const r=e.state.scale,n=t.featuresTilingScheme.getClosestInfoForScale(r).level;this.collisionEngine.run(t.allLayerViews.items,e,r,n)}catch{}}};x([D()],JU.prototype,"updateRequested",void 0),x([D()],JU.prototype,"updating",null),x([D()],JU.prototype,"view",void 0),JU=x([Qe("esri.views.2d.LabelManager")],JU);function swe(i,e){const t=i.slice(0,e),r=e-t.length;for(let n=0;ndi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function kYt(i){return i.map(e=>Zmn(e)?Qmn(e.clone()):e)}function Zmn(i){return(i.type==="size"||i.type==="color"||i.type==="opacity")&&i.stops!=null}function Qmn(i){return i.stops=ign(i.type,i.stops??[]),i}function Zj(i,e,t){return(1-t)*i+t*e}function egn(i,e){const[t,...r]=e,n=r.pop(),s=r[0].value,o=r[r.length-1].value,a=(o-s)/DYt,l=[];for(let u=s;u=r[c].value;)c++;const h=r[c],p=e[c-1],m=u-p.value,v=h.value===p.value?1:m/(h.value-p.value);if(i==="color"){const w=r[c],S=e[c-1],I=w.color.clone();I.r=Zj(S.color.r,I.r,v),I.g=Zj(S.color.g,I.g,v),I.b=Zj(S.color.b,I.b,v),I.a=Zj(S.color.a,I.a,v),l.push({value:u,color:I,label:w.label})}else if(i==="size"){const w=r[c],S=e[c-1],I=Cl(w.size),R=Zj(Cl(S.size),I,v);l.push({value:u,size:R,label:w.label})}else{const w=r[c],S=Zj(e[c-1].opacity,w.opacity,v);l.push({value:u,opacity:S,label:w.label})}}return[t,...l,n]}function tgn(i){const[e,...t]=i,r=t.pop();for(;t.length>DYt;){let n=0,s=0;for(let o=1;os&&(s=u,n=o)}t.splice(n,1)}return[e,...t,r]}function ign(i,e){return e.length<=Wye?e:(FYt().warn(`Found ${e.length} Visual Variable stops, but MapView only supports ${Wye}. Displayed stops will be simplified.`),e.length>2*Wye?egn(i,e):tgn(e))}function rgn(){const{supportsColorBufferFloat:i,supportsColorBufferFloatBlend:e,supportsColorBufferHalfFloat:t}=lk();return i&&e||t}function y7(i){if(!i)return!0;switch(i.type){case"dot-density":break;case"heatmap":if(!rgn()){const e=lk(),t=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(r=>!e[r]).join(", ");return FYt().errorOnce(new qe("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${t}`)),!1}}return!0}const ngn=1.25,bpe=128,sgn=128;function ogn(i){if(!i.stops?.length)return null;const e=i.stops.sort((s,o)=>s.value-o.value),t=swe(e,8),r=t.map(({value:s})=>s),n=t.map(({color:s})=>fte(s));return{values:r,colors:n}}function agn(i){if(!i.stops?.length)return null;const e=i.stops.sort((r,n)=>r.value-n.value),t=swe(e,8);return{opacityValues:t.map(({value:r})=>r),opacities:t.map(({opacity:r})=>r)}}function lgn(i){return{rotationType:i.rotationType==="geographic"?eoe.Geographic:eoe.Arithmatic}}function nRe(i){if(!i.stops?.length)return null;if(i.stops.some(r=>r.useMaxValue||r.useMinValue))return(r,n)=>{const s=r.statisticsByLevel.get(n.key.level),o=i.stops.map(l=>({value:l.useMaxValue?s?.get(i.field)?.maxValue??0:l.useMinValue?s?.get(i.field)?.minValue??0:l.value,size:l.size?us(l.size):YVr})).sort((l,u)=>l.value-u.value),a=swe(o,8);return{values:a.map(({value:l})=>l),sizes:a.map(({size:l})=>l)}};const e=i.stops.sort((r,n)=>r.value-n.value),t=swe(e,8);return{values:t.map(({value:r})=>r),sizes:t.map(({size:r})=>us(r))}}function ugn(i){return e=>{const{state:t}=e;return{unitValueToPixelsRatio:pu(t.spatialReference)/bae[i.valueUnit]/t.resolution}}}function s1t(i,e){const t=e.length;if(i{const a=s.state.scale,l=us(s1t(a,r.stops)),u=us(s1t(a,n.stops));return{minMaxValueAndSize:[e,t,l,u]}};if(typeof r=="object"||typeof n=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[e,t,us(r),us(n)]}}const PR={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function RR(i,e=sgn,t=ngn){if(i.visualVariableSizeMinMaxValue)return i.visualVariableSizeMinMaxValue instanceof Function?bpe:Math.max(i.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*t,e);if(i.visualVariableSizeScaleStops){if(i.visualVariableSizeScaleStops instanceof Function)return bpe;const r=i.visualVariableSizeScaleStops.sizes;return Math.max(r[r.length-1]*t,e)}if(i.visualVariableSizeStops){if(i.visualVariableSizeStops instanceof Function)return bpe;const r=i.visualVariableSizeStops.sizes;return Math.max(r[r.length-1]*t,e)}return i.visualVariableSizeUnitValue?2*bpe:0}function nM(i){const e={...PR};if(!i||!("visualVariables"in i)||!i.visualVariables)return e;for(const t of kYt(i.visualVariables))switch(t.type){case"color":e.visualVariableColor=ogn(t);break;case"opacity":e.visualVariableOpacity=agn(t);break;case"rotation":e.visualVariableRotation=lgn(t);break;case"size":switch(hgn(t)){case"field-stops":e.visualVariableSizeStops=nRe(t);break;case"scale-stops":t.target==="outline"?e.visualVariableSizeOutlineScaleStops=nRe(t):e.visualVariableSizeScaleStops=nRe(t);break;case"min-max":e.visualVariableSizeMinMaxValue=cgn(t);break;case"unit-value":e.visualVariableSizeUnitValue=ugn(t)}break;default:console.error("Unable to handle VV type")}return e}function hgn(i){if(typeof i.minDataValue=="number"&&typeof i.maxDataValue=="number"&&i.minSize!=null&&i.maxSize!=null)return"min-max";if((i.expression&&i.expression==="view.scale"||i.valueExpression&&i.valueExpression==="$view.scale")&&Array.isArray(i.stops))return"scale-stops";if((i.field!=null||i.expression&&i.expression!=="view.scale"||i.valueExpression&&i.valueExpression!=="$view.scale")&&(Array.isArray(i.stops)||"levels"in i&&i.levels))return"field-stops";if((i.field!=null||i.expression&&i.expression!=="view.scale"||i.valueExpression&&i.valueExpression!=="$view.scale")&&i.valueUnit!=null)return"unit-value";throw new Error("InternalError: Found unknown sizeVV type")}function Nq(i){return!!(i.visualVariableSizeMinMaxValue||i.visualVariableSizeScaleStops||i.visualVariableSizeStops||i.visualVariableSizeUnitValue||i.visualVariableSizeOutlineScaleStops)}function UKe(i){return!!i.visualVariableRotation}function LYt(i){return i.minScale||i.maxScale?{minScale:i.minScale??0,maxScale:i.maxScale??0}:null}function LA(i){if(i==null)return null;if(Array.isArray(i)){const[e,t,r,n]=i;return[e,t,r,255*n]}return typeof i=="string"?i:{...i,defaultValue:LA(i?.defaultValue)}}async function owe(i,e){const{cimResourceManager:t,cimAnalyzer:r,scaleExpression:n}=e.schemaOptions;await Promise.all(ym.fetchResources(i.symbol,t,[]));const s=r.analyzeSymbolReference(i,!1),o={scaleInfo:LYt(i),scaleExpression:n},a=[];for(const l of s)switch(l.type){case"marker":a.push(...dgn(l,e,o));break;case"fill":a.push(...fgn(l,e,o));break;case"line":a.push(...mgn(l,e,o));break;case"text":a.push(...ggn(l,e,o))}return a}function dgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=i.isOutline?{...PR,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};return NYt(s.ensureInstance(Sc.marker,{geometry:o},{zoomRange:!!t.scaleInfo}),i,r,t)}function NYt(i,e,t,{scaleInfo:r,scaleExpression:n}){const s=Nq(t);return[i.createMeshInfo({params:{size:e.size,scaleX:e.scaleX,anchorX:e.anchorPoint.x,anchorY:e.anchorPoint.y,angle:e.rotation,color:LA(e.color)??[0,0,0,0],colorLocked:e.colorLocked,frameHeight:e.frameHeight,widthRatio:e.widthRatio,scaleInfo:r,offsetX:e.offsetX,offsetY:e.offsetY,outlineColor:LA(e.outlineColor)??[0,0,0,0],outlineSize:e.outlineWidth,referenceSize:e.referenceSize||ph.CIMVectorMarker.size,rotateClockwise:e.rotateClockwise,scaleFactor:n??1,sizeRatio:e.sizeRatio,alignment:e.alignment,isAbsoluteAnchorPoint:e.isAbsoluteAnchorPoint,scaleSymbolsProportionally:e.scaleSymbolsProportionally,sprite:e.spriteRasterizationParam,hasSizeVV:s,placement:e.markerPlacement,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,transforms:e.transform,minPixelBuffer:RR(t)}})]}function pgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return $Yt(s.ensureInstance(Sc.fill,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),i,t)}function $Yt(i,e,{scaleInfo:t}){return[i.createMeshInfo({params:{color:LA(e.color)??[0,0,0,0],scaleInfo:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function fgn(i,e,t){if(!i.spriteRasterizationParam)return pgn(i,e,t);const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return BYt(s.ensureInstance(Sc.complexFill,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),i,r.visualVariableColor!=null,t)}function BYt(i,e,t,{scaleInfo:r}){if(!e.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=!!e.hasUnresolvedReplacementColor&&(!t||e.colorLocked),s=e.sampleAlphaOnly&&!n,o=e.spriteRasterizationParam;return[i.createMeshInfo({params:{color:LA(e.color)??[0,0,0,0],height:e.height,aspectRatio:e.scaleX,offsetX:e.offsetX,offsetY:e.offsetY,scaleX:1,scaleY:1,angle:e.angle,applyRandomOffset:e.applyRandomOffset,sampleAlphaOnly:s,scaleProportionally:o.resource.type==="CIMHatchFill",sprite:o,scaleInfo:r,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function mgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=i.isOutline?{...PR,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},a={geometry:o},l=!!(o.visualVariableSizeMinMaxValue||o.visualVariableSizeScaleStops||o.visualVariableSizeStops||o.visualVariableSizeUnitValue);return i.spriteRasterizationParam?UYt(s.ensureInstance(Sc.texturedLine,a,{zoomRange:!!t.scaleInfo}),i,l,t):GYt(s.ensureInstance(Sc.line,a,{zoomRange:!!t.scaleInfo}),i,l,t)}function jYt(i,e,{scaleInfo:t}){return{params:{color:LA(i.color)??[0,0,0,0],width:i.width,referenceWidth:i.referenceWidth,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,scaleInfo:t,hasSizeVV:e,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null}}}function GYt(i,e,t,r){if(e.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");return[i.createMeshInfo({params:jYt(e,t,r).params})]}function UYt(i,e,t,r){const{spriteRasterizationParam:n,scaleDash:s,sampleAlphaOnly:o}=e;if(!n)throw new Error("InternalError: Sprite should be defined");return[i.createMeshInfo({params:{...jYt(e,t,r).params,shouldScaleDash:s??!1,shouldSampleAlphaOnly:o,isSDF:n.resource.type!=="CIMPictureStroke",sprite:n}})]}function ggn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return zYt(s.ensureInstance(Sc.text,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!!t.scaleInfo,referenceSymbol:!1,clipAngle:!1}),i,r,t)}function zYt(i,e,t,{scaleInfo:r,scaleExpression:n}){return[i.createMeshInfo({params:{boxBackgroundColor:LA(e.backgroundColor),boxBorderLineColor:LA(e.borderLineColor),boxBorderLineSize:e.borderLineWidth??0,color:LA(e.color)??[0,0,0,0],offsetX:e.offsetX,offsetY:e.offsetY,postAngle:e.angle,fontSize:e.size,referenceSize:e.referenceSize,decoration:e.decoration,haloColor:LA(e.outlineColor)??[0,0,0,0],haloFontSize:e.outlineSize,lineWidth:e.lineWidth||512,lineHeightRatio:1,horizontalAlignment:e.horizontalAlignment??"center",verticalAlignment:e.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:e.textRasterizationParam,scaleInfo:r,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,placement:e.markerPlacement,transforms:e.transform,scaleFactor:n??1,minPixelBuffer:RR(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}async function ygn(i,e,t){const r=[],n={scaleInfo:LYt(i),scaleExpression:null};for(const s of e)switch(s.type){case"marker":r.push(...NYt(t.instances.marker,s,PR,n));break;case"fill":s.spriteRasterizationParam==null?r.push(...$Yt(t.instances.fill,s,n)):r.push(...BYt(t.instances.complexFill,s,!1,n));break;case"line":s.spriteRasterizationParam?r.push(...UYt(t.instances.texturedLine,s,!1,n)):r.push(...GYt(t.instances.line,s,!1,n));break;case"text":r.push(...zYt(t.instances.text,s,PR,n))}return r}function YCe(i,e){return{type:"simple",filters:e,capabilities:{maxTextureSize:lk().maxTextureSize},bindings:vgn(i)}}function XCe(i){switch(i){case"opacity":return fV.OPACITY;case"color":return fV.COLOR;case"rotation":return fV.ROTATION;case"size":return fV.SIZE;default:return null}}function vgn(i){if(!i)return[];switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return zKe(i);case"dot-density":return _gn(i);case"pie-chart":return bgn(i);case"heatmap":return wgn(i)}}function _gn(i){const e=[];for(const t of i.attributes)e.push({binding:e.length,expression:t.valueExpression,field:t.field});return e}function bgn(i){const e=zKe(i);let t=4;for(const r of i.attributes)e.push({binding:t++,expression:r.valueExpression,field:r.field});return e}function wgn({valueExpression:i,field:e}){return i||e?[{binding:0,expression:i,field:e}]:[]}function zKe(i){return!("visualVariables"in i)||!i.visualVariables?.length?[]:kYt(i.visualVariables).map(e=>Egn(e)).filter(Ga)}function xgn(i){return i.valueExpression==="$view.scale"?null:{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression,valueRepresentation:i.valueRepresentation}}function Sgn(i){return{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression}}function Tgn(i){return{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression}}function Cgn(i){return{binding:XCe(i.type),expression:i.valueExpression,field:i.field}}function Egn(i){switch(i.type){case"size":return xgn(i);case"color":return Sgn(i);case"opacity":return Tgn(i);case"rotation":return Cgn(i)}}let Ign=class T7e extends RCe{static from(e,t,r){return new T7e(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const n=t.lod;n.wrap&&(this._wrappingInfo={worldSizeX:n.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=ah(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new T7e(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1xo*(n-1)&&(e[s]=o-xo*n)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=p2e(this._current.projectedGeometry),t=new $o([],e);return wx(new $o,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=lIt(e.paths,this.hasZ),r=new $o([],t);return wx(new $o,r,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(r!==void 0)return r;const n=e.toLowerCase();for(const s in this._current.attributes)if(s.toLowerCase()===n)return this._current.attributes[s]}_readAttributes(){return this._current.attributes}};function Agn(i){return VYt(i,!0)}function Mgn(i){return VYt(i,!1)}function VYt(i,e){if(i==null)return null;const t=i.spatialReference,r=Zp(t),n=W9(i)?i.toJSON():i;if(!r)return n;const s=Nb(t)?102100:4326,o=$z[s].maxX,a=$z[s].minX;if(dR(n))return o1t(n,o,a);if(xF(n))return n.points=n.points.map(l=>o1t(l,o,a)),n;if(zd(n))return Ogn(n,r);if(ed(n)||e0(n)){const l=gY(Rgn,n),u={xmin:l[0],ymin:l[1],xmax:l[2],ymax:l[3]},c=pS(u.xmin,a)*(2*o),h=c===0?n:uHe(n,c);return u.xmin+=c,u.xmax+=c,u.xmax>o?l1t(h,o,e):u.xminr.extent);return t.length<2?t[0]||i:t.length>2?(i.xmin=e.valid[0],i.xmax=e.valid[1],i):{rings:t.map(r=>[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]])}}function o1t(i,e,t){if(Array.isArray(i)){const r=i[0];if(r>e){const n=pS(r,e);i[0]=r+n*(-2*e)}else if(re){const n=pS(r,e);i.x+=n*(-2*e)}else if(r0;if(a>2*u){const w={xmin:sp||v?t.push(new cN({xmin:c,ymin:r,xmax:u,ymax:n},[h]),new cN({xmin:l,ymin:r,xmax:p,ymax:n},[m])):t.push(new cN({xmin:c,ymin:r,xmax:p,ymax:n},[h]));return t}function a1t(i,e){const[t,r]=e.valid,n=2*r;let s,o=0;return i>r?(s=Math.ceil(Math.abs(i-r)/n),i-=s*n,o=s):i=i.xmin&&e<=i.xmax&&t>=i.ymin&&t<=i.ymax}function l1t(i,e,t=!0){const r=!e0(i);if(r&&aIt(i),t)return new Dgn().cut(i,e);const n=r?i.rings:i.paths,s=r?4:2,o=n.length,a=-2*e;for(let l=0;l=s){const c=[];for(const h of u)c.push([h[0]+a,h[1]]);n.push(c)}}return r?i.rings=n:i.paths=n,i}let cN=class{constructor(e,t){this.extent=e,this.frameIds=t}};const Rgn=Wo();let Dgn=class{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let r;if(this._xCut=t,e.rings)this._closed=!0,r=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,r=e.paths,this._minPts=2}for(const s of r){if(!s||s.length=this._minPts&&r.push(s);const n=-2*this._xCut;for(const s of this._linesOut)if(s&&s.length>=this._minPts){for(const o of s)o[0]+=n;r.push(s)}return this._closed?e.rings=r:e.paths=r,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide==-1){const r=this._intersect(this._prevPt,e);this._lineTo(this._xCut,r,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,r){this._closed?(this._lineIn.push([r<=0?e:this._xCut,t]),this._lineOut.push([r>=0?e:this._xCut,t])):(r<=0&&this._lineIn.push([e,t]),r>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,r){this._closed?(this._addPolyVertex(this._lineIn,r<=0?e:this._xCut,t),this._addPolyVertex(this._lineOut,r>=0?e:this._xCut,t)):r<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([e,t])):r>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_addPolyVertex(e,t,r){const n=e.length;n>1&&e[n-1][0]===t&&e[n-2][0]===t?e[n-1][1]=r:e.push([t,r])}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return ethis._xCut?1:0}_intersect(e,t){const r=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+r*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}};const sRe=50;function u1t(i){if(!i)return null;const{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:s}=i;return new $s({rings:[[[e,t],[e,n],[r,n],[r,t],[e,t]]],spatialReference:s})}let Fgn=class HYt{static fromGraphic(e,t,r,n){return new HYt(e.geometry,t,e.attributes,e.visible,e.uid,r,n)}constructor(e,t,r,n,s,o,a){this.geometry=e,this.symbol=t,this.attributes=r,this.visible=n,this.objectId=s,this.zOrder=o,this.displayId=a,this.bounds=Wo(),this.prevBounds=Wo(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}update(e,t,r){return(this.geometry!==e.geometry||this.attributes!==e.attributes||this.symbol!==t||this.zOrder!==r||this.visible!==e.visible)&&(this.prevBounds=this.bounds,this.bounds=Wo(),this.zOrder=r,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=u1t(t)),await Gv(t.spatialReference,e);const r=Mgn(t);if(!r)return;const n=Sf(r,t.spatialReference,e);n&&AXi(n),this.projectedGeometry=zd(n)?u1t(n):n}},kgn=class{constructor(e,t,r){this.added=e,this.updated=t,this.removed=r}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}};const c1t=1e-5;function Lgn(i,e){return e.zOrder-i.zOrder}let Ngn=class{constructor(e,t,r,n,s){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new Vqr(t),this._tileInfoView=r,this._store=s;const o=r.getClosestInfoForScale(n);this._resolution=this._tileInfoView.getTileResolution(o.level)}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,r){const n=[],s=[],o=[],a=new Set,l=[];let u=0;for(const c of e.items){u++;const h=c.uid,p=this._items.get(h),m=t(c);if(a.add(h),p){p.update(c,m,u)&&(s.push(p),l.push(this._updateItem(p,r)));continue}const v=this._store.createDisplayIdForObjectId(h),w=Fgn.fromGraphic(c,m,u,v);l.push(this._updateItem(w,r)),this._items.set(w.objectId,w),n.push(w)}for(const[c,h]of this._items.entries())a.has(c)||(this._store.releaseDisplayIdForObjectId(c),this._items.delete(c),o.push(h));return await Promise.all(l),this._index=null,new kgn(n,s,o)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,r,n,s){const o=yi("esri-mobile"),a=yi(o?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance"),l=a+(o?0:yi("hittest-2d-small-symbol-tolerance"));e=cHe(e,this._tileInfoView.spatialReference);const u=n*window.devicePixelRatio*l,c=Wo();c[0]=e-u,c[1]=t-u,c[2]=e+u,c[3]=t+u;const h=n*window.devicePixelRatio*a,p=Wo();p[0]=e-h,p[1]=t-h,p[2]=e+h,p[3]=t+h;const m=.5*n*(l+sRe),v=this._searchIndex(e-m,t-m,e+m,t+m);if(!v||v.length===0)return[];const w=[],S=Wo(),I=Wo();for(const k of v){if(!k.visible)continue;const{projectedGeometry:B,symbolResource:$}=k;this._getSymbolBounds(S,$,B,I,s),I[3]=I[2]=I[1]=I[0]=0,aae(S,c)&&w.push(k)}if(w.length===0)return[];const R=this._hittestDrawHelper,L=[];for(const k of w){const{projectedGeometry:B,symbolResource:$}=k;if(!$)continue;const{textInfo:V,symbolInfo:Y}=$,K=Y.cimSymbol;R.hitTest(p,K.symbol,B,V,s,n)&&L.push(k)}return L.sort(Lgn),L.map(k=>k.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:r}=e;r[0]=r[1]=r[2]=r[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,r,n){return this._boundsDirty&&(this._items.forEach(s=>this._getSymbolBounds(s.bounds,s.symbolResource,s.projectedGeometry,s.size,0)),this._boundsDirty=!1),this._index||(this._index=$W(9,s=>({minX:s.bounds[0],minY:s.bounds[1],maxX:s.bounds[2],maxY:s.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:r,maxY:n})}_searchForItems(e){const t=this._tileInfoView.spatialReference,r=e.bounds,n=Zp(t);if(n&&t.isWrappable){const[s,o]=n.valid,a=Math.abs(r[2]-o)e.globalId)}function NK(i){return i.filter(e=>!e.error).map(e=>e.objectId??e.globalId).filter(e=>e!=null)}function h1t(i,e){const t=new Set(i);for(const r of e.values())t.add(r);return t}function d1t(i,e){const t=new Set(i);for(const r of e.values())t.delete(r);return t}let WYt=class{constructor(e){this.updateTracking=new E8({debugName:"FeatureCommandQueue"}),this._hasGlobalIds=!1,this._queueProcessor=new UY({concurrency:1,process:e.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(e){return this.updateTracking.addPromise(this._doPush(e))}async _doPush(e){const t=this._queueProcessor,r=t.last(),n=[];switch(e.type){case"update":if(r?.type===e.type)return;n.push(t.push(e));break;case"edit":{const s=r?.type==="processed-edit"?r:null;s&&t.popLast();const o=this._mergeEdits(s,e);for(const a of o)a&&n.push(t.push(a));break}}await Promise.all(n)}_mergeEdits(e,t){const{addedFeatures:r,deletedFeatures:n,updatedFeatures:s}=t.edits;if(this._hasGlobalIds=this._hasGlobalIds||oRe(r)||oRe(s)||oRe(n),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...r,...s],removed:n}}];const o=new Set(NK(e?.edits.addOrModified??[])),a=new Set(NK(e?.edits.removed??[])),l=new Set([...NK(r),...NK(s)]),u=new Set(NK(n));return[{type:"processed-edit",edits:{addOrModified:Array.from(h1t(d1t(o,u),l)).map(c=>({objectId:c})),removed:Array.from(h1t(d1t(a,l),u)).map(c=>({objectId:c}))}}]}},$K=class C7e{static getOrCreate(e,t,r){let n=t.get(e.id);return n||(n=new C7e(e,r),t.set(e.id,n)),n}static fromItems(e,t,r){const n=new C7e(e,r);return n.addedOrModified.push(...t),n}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[]}get reader(){return this._reader||(this._reader=Ign.from(this.addedOrModified,this.tile,this.metadata)),this._reader}},H_=class extends iT(un){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new E8({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new WYt({process:t=>{switch(t.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new MCe({spatialReference:this.view.spatialReference,fields:new Cd}),this._attributeStore=new eVt({isLocal:!0,update:async t=>{yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:t});const r=this.container.attributeView.requestUpdate(t);this.container.requestRender(),await r,yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:t})}});const e=YCe(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=BKr.create(this.view.spatialReference),this._resourceProxy=new Rzt({fetch:t=>Promise.all(t.map(r=>this.view.stage.textureManager.rasterizeItem(r))),fetchDictionary:t=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([Ki(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore=new Ngn(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return yi("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e} + `;this._program=e.programCache.acquire(t,r,new Map([["a_pos",0]]))}dispose(){super.dispose()}_test(e){const t=this._rctx;if(!t.gl)return e.dispose(),!0;const r=new Ua(1);r.wrapMode=Ls.CLAMP_TO_EDGE,r.samplingMode=Is.NEAREST;const n=new Wd(t,r),s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new wh(t,new Map([["a_pos",0]]),Yqt,{geometry:s}),a=new Ua;a.samplingMode=Is.LINEAR,a.wrapMode=Ls.CLAMP_TO_EDGE;const l=new fl(t,a,pte);t.useProgram(e),t.bindTexture(l,0),e.setUniform1i("u_texture",0);const u=t.getBoundFramebufferObject(),{x:c,y:h,width:p,height:m}=t.getViewport();t.bindFramebuffer(n),t.setViewport(0,0,1,1),t.setClearColor(0,0,0,0),t.setBlendingEnabled(!1),t.clearSafe(lb.COLOR_BUFFER_BIT),t.bindVAO(o),t.drawArrays(Eo.TRIANGLE_STRIP,0,4);const v=new Uint8Array(4);return n.readPixels(0,0,1,1,ks.RGBA,lc.UNSIGNED_BYTE,v),o.dispose(),n.dispose(),l.dispose(),t.setViewport(c,h,p,m),t.bindFramebuffer(u),v[0]!==255}};const pte=new Image;pte.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",pte.width=5,pte.height=5,pte.decode();let Lmn=class{constructor(e){this.rctx=e,this.floatBufferBlend=new Dmn(e),this.svgPremultipliesAlpha=new kmn(e),this.doublePrecisionRequiresObfuscation=new Cmn(e),this.ignoresSamplerPrecision=new Fmn(e),this.drawArraysRequiresIndicesTypeReset=new Tmn(e)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}};function Nmn(i,e){if(e.compressedTextureETC)return null;const t=i.getExtension("WEBGL_compressed_texture_etc");return t?{COMPRESSED_R11_EAC:t.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:t.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:t.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:t.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:t.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:t.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:t.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function $mn(i,e){if(e.compressedTextureS3TC)return null;const t=i.getExtension("WEBGL_compressed_texture_s3tc");return t?{COMPRESSED_RGB_S3TC_DXT1:t.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:t.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:t.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:t.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function Bmn(i,e){if(e.textureFilterAnisotropic)return null;const t=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return t?{MAX_TEXTURE_MAX_ANISOTROPY:t.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:t.TEXTURE_MAX_ANISOTROPY_EXT}:null}function jmn(i,e){const t=!e.colorBufferHalfFloat&&i.getExtension("EXT_color_buffer_half_float")||!e.colorBufferFloat&&i.getExtension("EXT_color_buffer_float"),r=!e.colorBufferFloat&&i.getExtension("EXT_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&i.getExtension("EXT_float_blend");return t||r||n?{textureFloat:!!r,textureHalfFloat:!!t,floatBlend:!!n,R16F:i.R16F,RG16F:i.RG16F,RGBA16F:i.RGBA16F,R32F:i.R32F,RG32F:i.RG32F,RGBA32F:i.RGBA32F,R11F_G11F_B10F:i.R11F_G11F_B10F,RGB16F:i.RGB16F}:null}function i1t(i,e,t,r,n){if(r)return!0;if(e[t])return!1;for(const s of n)if(i.getExtension(s))return!0;return!1}function Gmn(i,e){if(e.textureNorm16)return null;const t=i.getExtension("EXT_texture_norm16");return t?{R16:t.R16_EXT,RG16:t.RG16_EXT,RGB16:t.RGB16_EXT,RGBA16:t.RGBA16_EXT,R16_SNORM:t.R16_SNORM_EXT,RG16_SNORM:t.RG16_SNORM_EXT,RGB16_SNORM:t.RGB16_SNORM_EXT,RGBA16_SNORM:t.RGBA16_SNORM_EXT}:null}function Umn(i,e){const t=e.loseContext&&i.getExtension("WEBGL_lose_context");return t?{loseRenderingContext:()=>t.loseContext()}:null}let zmn=class{constructor(e,t){this._gl=e,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._loseContext=null,this._textureNorm16=null,this._depthTexture=null,this._textureFloatLinear=null,this._disabledExtensions=t.disabledExtensions||{},this._debugWebGLExtensions=t.debugWebGLExtensions||{}}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=Nmn(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=$mn(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=Bmn(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=uYt(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){if(!this._textureFloat){const{textureFloatLinear:e}=this._disabledExtensions;this._textureFloat={textureFloatLinear:!e&&!!this._gl.getExtension("OES_texture_float_linear")}}return this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=jmn(this._gl,this._disabledExtensions)),this._colorBufferFloat}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=i1t(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get loseContext(){return this._loseContext||(this._loseContext=Umn(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=Gmn(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=i1t(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},RYt=class{constructor(e,t){this.gl=e,this.instanceCounter=new Yfn,this.programCache=new Fqt(this),this._transformFeedbackRequestInfo=null,this._state=new e1t,this._numOfDrawCalls=0,this._numOfTriangles=0,this._loadExtensions(),this.configure(t)}configure(e){this._capabilities=new zmn(this.gl,e),this._parameters=new Xfn(this.gl,this._capabilities,e),fl.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const t=this.gl.getParameter(this.gl.VIEWPORT);this._state=new e1t,this._state.viewport={x:t[0],y:t[1],width:t[2],height:t[3]},this._stateTracker=new wmn({setBlending:r=>{if(r){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(r.opRgb,r.opAlpha),this.setBlendFunctionSeparate(r.srcRgb,r.dstRgb,r.srcAlpha,r.dstAlpha);const n=r.color;this.setBlendColor(n.r,n.g,n.b,n.a)}else this.setBlendingEnabled(!1)},setCulling:r=>{r?(this.setFaceCullingEnabled(!0),this.setCullFace(r.face),this.setFrontFace(r.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:r=>{r?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(r.factor,r.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:r=>{r?(this.setDepthTestEnabled(!0),this.setDepthFunction(r.func)):this.setDepthTestEnabled(!1)},setStencilTest:r=>{if(r){this.setStencilTestEnabled(!0);const n=r.function;this.setStencilFunction(n.func,n.ref,n.mask);const s=r.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:r=>{r?(this.setDepthWriteEnabled(!0),this.setDepthRange(r.zNear,r.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:r=>{r?this.setColorMask(r.r,r.g,r.b,r.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:r=>{r?this.setStencilWriteMask(r.mask):this.setStencilWriteMask(0)},setDrawBuffers:r=>{const{gl:n}=this;if(r)n.drawBuffers(r.buffers);else{const{drawFramebuffer:s}=this._state;s===null||s.colorAttachments.length===0?n.drawBuffers([f8e.BACK]):n.drawBuffers([pv.COLOR_ATTACHMENT0])}}}),this.enforceState(),ba(this._driverTest),this._driverTest=new Lmn(this)}dispose(){ba(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(Bs.ARRAY_BUFFER),this.unbindBuffer(Bs.ELEMENT_ARRAY_BUFFER),this.unbindBuffer(Bs.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(Bs.PIXEL_PACK_BUFFER),this.unbindBuffer(Bs.PIXEL_UNPACK_BUFFER),this.unbindBuffer(Bs.COPY_READ_BUFFER),this.unbindBuffer(Bs.COPY_WRITE_BUFFER),this._state.textureUnitMap.length=0,yC()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(e,t){for(let r=0;r=0&&(this._state.activeTexture=t)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,t,r,n){e===this._state.blendColor.r&&t===this._state.blendColor.g&&r===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,t,r,n),this._state.blendColor.r=e,this._state.blendColor.g=t,this._state.blendColor.b=r,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,t){e===this._state.blendFunction.srcRGB&&t===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,t),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=t,this._state.blendFunction.dstAlpha=t,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,t,r,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===r&&this._state.blendFunction.dstRGB===t&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,t,r,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=r,this._state.blendFunction.dstRGB=t,this._state.blendFunction.dstAlpha=n,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,t){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===t||(this.gl.blendEquationSeparate(e,t),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setColorMask(e,t,r,n){this._state.colorMask.r===e&&this._state.colorMask.g===t&&this._state.colorMask.b===r&&this._state.colorMask.a===n||(this.gl.colorMask(e,t,r,n),this._state.colorMask.r=e,this._state.colorMask.g=t,this._state.colorMask.b=r,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,t,r,n){this._state.clearColor.r===e&&this._state.clearColor.g===t&&this._state.clearColor.b===r&&this._state.clearColor.a===n||(this.gl.clearColor(e,t,r,n),this._state.clearColor.r=e,this._state.clearColor.g=t,this._state.clearColor.b=r,this._state.clearColor.a=n)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,t){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===t||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=t,this.gl.polygonOffset(e,t),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,t,r,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===t&&this._state.scissorRect.width===r&&this._state.scissorRect.height===n||(this.gl.scissor(e,t,r,n),this._state.scissorRect.x=e,this._state.scissorRect.y=t,this._state.scissorRect.width=r,this._state.scissorRect.height=n)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,t){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===t||(this.gl.depthRange(e,t),this._state.depthRange.zNear=e,this._state.depthRange.zFar=t,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,t,r){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===t&&this._state.stencilFunction.mask===r||(this.gl.stencilFunc(e,t,r),this._state.stencilFunction.face=W1.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=t,this._state.stencilFunction.mask=r,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,t,r,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,t,r,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=r,this._state.stencilFunction.mask=n,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,t,r){this._state.stencilOperation.face===W1.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===t&&this._state.stencilOperation.zPass===r||(this.gl.stencilOp(e,t,r),this._state.stencilOperation.face=W1.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=t,this._state.stencilOperation.zPass=r,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,t,r,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,t,r,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,t=!1){const r=this._state.activeTexture;return e>=0&&(t||e!==this._state.activeTexture)&&(this.gl.activeTexture(zOe+e),this._state.activeTexture=e),r}clear(e){e&&this.gl.clear(e)}clearSafe(e,t=255){e&&(e&lb.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&lb.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&lb.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(t),this.gl.clear(e))}clearFramebuffer(e,t=!1,r=!1){let n=0;if(e){const o=Math.max(1e-13,e[3]);this.setClearColor(e[0],e[1],e[2],o),n|=lb.COLOR_BUFFER_BIT}t&&(n|=lb.DEPTH_BUFFER_BIT),r===!1?r=0:(r===!0&&(r=255),n|=lb.STENCIL_BUFFER_BIT),n&&this.clearSafe(n,r)}drawArrays(e,t,r){if(this._transformFeedbackRequestInfo){if(e!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(this._state.program?.hasTransformFeedbackVaryings==null)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(yC()){this._numOfDrawCalls++,this._numOfTriangles+=r1t(e,r);const n=this._state.textureUnitMap;for(let s=0;s=this.parameters.maxTextureImageUnits||t<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[t];return e?.glName==null?(n!=null&&(this.setActiveTexture(t,r),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[t]=null,n):r||n!==e?(this.setActiveTexture(t,r),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[t]=e,n):(e.isDirty&&(this.setActiveTexture(t,r),e.applyChanges()),n)}unbindTexture(e){if(e!=null)for(let t=0;t=this.parameters.maxUniformBufferBindings||t<0)return console.error("Uniform buffer binding point is out of range!"),null;const r=e===Bs.UNIFORM_BUFFER?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let n=r[t];return n==null&&(n={buffer:null,offset:0,size:0},r[t]=n),n}bindBufferBase(e,t,r){const n=this._getBufferBinding(e,t);n!=null&&(n.buffer===r&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,t,r?r.glName:null),n.buffer=r,n.offset=0,n.size=0))}bindBufferRange(e,t,r,n,s){const o=this._getBufferBinding(e,t);o!=null&&(o.buffer===r&&o.offset===n&&o.size===s||(n%this._parameters.uniformBufferOffsetAlignment==0?(this.gl.bindBufferRange(e,t,r.glName,n,s),o.buffer=r,o.offset=n,o.size=s):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(e,t,r,n){t!=null?(yC()&&(n??t.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),t.initialize(),r!==void 0&&n!==void 0?this.bindBufferRange(Bs.UNIFORM_BUFFER,e,t.buffer,r,n):this.bindBufferBase(Bs.UNIFORM_BUFFER,e,t.buffer)):this.bindBufferBase(Bs.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let t=0,r=this._state.uniformBufferBindingPoints.length;tthis._highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new xWe,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new ufn(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return r()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=H9({render:n=>this.renderFrame(n)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",n=>this.emit("webgl-error",{error:new qe("webgl-context-lost",n.statusMessage)})),this._bufferPool=new gdn,Wfn()}destroy(){qfn(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=Hc(this._taskHandle),this._lostWebGLContextHandle=Hc(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=Vmn,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Cc()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(oHr),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=aa.MAP;for(const n of e)n.processRender(t);if(this.children.some(n=>n.hasHighlight)){t.drawPhase=aa.HIGHLIGHT;for(const n of e)n.processRender(t)}if(this.children.some(n=>n.hasLabels)){t.drawPhase=aa.LABEL;for(const n of e)n.processRender(t)}if(yi("esri-tiles-debug")){t.drawPhase=aa.DEBUG;for(const n of e)n.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:n}=e;this._canvas.resize(e),t.setViewport(0,0,n*r.size[0],n*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,n){const s=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,l=this.context,u=this._state.clone();if(n!=null){const R=u.viewpoint;u.viewpoint.rotation=n,u.viewpoint=R}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:u,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},h=new Ua(s,o);h.wrapMode=Ls.CLAMP_TO_EDGE,h.internalFormat=gs.RGBA8,h.isImmutable=!0;const p=new Wd(l,h,new Mle(vf.DEPTH_STENCIL,s,o)),m=l.getBoundFramebufferObject(),v=l.getViewport();l.bindFramebuffer(p),l.setViewport(0,0,s,o),this._renderChildren(t??this.children,c);const w=this._readbackScreenshot(p,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(m),l.setViewport(v.x,v.y,v.width,v.height),this.requestRender();const S=await w;let I;return e.outputScale===1?I=S:(I=new ImageData(Math.round(S.width*e.outputScale),Math.round(S.height*e.outputScale)),K0r(S,I)),p.dispose(),I}async _readbackScreenshot(e,t){const r=j0r(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,ks.RGBA,lc.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}};const eI=1,nwe=0,Ere=1,Ire=2;let Wmn=class{constructor(e,t,r){this._debugMap=new Map,this._width=e*r,this._height=t*r,this._pixelRatio=r;const n=Math.ceil(this._width/eI),s=Math.ceil(this._height/eI);this._cols=n,this._rows=s,this._cells=ACe.create(n*s)}insertMetrics(e){this._markMetrics(e)}hasCollision(e){let t=0;for(const{computedX:r,computedY:n,width:s,height:o}of e.bounds){const a=(s+hee)*this._pixelRatio,l=(o+hee)*this._pixelRatio;switch(this._collide(r,n,a,l)){case Ire:return Ire;case Ere:t++}}return t===e.bounds.length?Ere:nwe}getCellId(e,t){return e+t*this._cols}has(e){return this._cells.has(e)}hasRange(e,t){return this._cells.hasRange(e,t)}set(e){this._cells.set(e)}setRange(e,t){this._cells.setRange(e,t)}_collide(e,t,r,n){const s=e-r/2,o=t-n/2,a=s+r,l=o+n;if(a<0||l<0||s>this._width||o>this._height)return Ere;const u=uu(Math.floor(s/eI),0,this._cols),c=uu(Math.floor(o/eI),0,this._rows),h=uu(Math.ceil(a/eI),0,this._cols),p=uu(Math.ceil(l/eI),0,this._rows);for(let m=c;m<=p;m++)for(let v=u;v<=h;v++){const w=this.getCellId(v,m);if(this.has(w))return Ire}return nwe}_mark(e,t,r,n,s){const o=e-r/2,a=t-n/2,l=o+r,u=a+n,c=uu(Math.floor(o/eI),0,this._cols),h=uu(Math.floor(a/eI),0,this._rows),p=uu(Math.ceil(l/eI),0,this._cols),m=uu(Math.ceil(u/eI),0,this._rows);for(let v=h;v<=m;v++)for(let w=c;w<=p;w++){const S=this.getCellId(w,v);this._debugMap.set(S,s),this.set(S)}return!1}_markMetrics(e){for(const{computedX:t,computedY:r,width:n,height:s}of e.bounds){const o=(n+hee)*this._pixelRatio,a=(s+hee)*this._pixelRatio;this._mark(t,r,o,a,e.entityTexel)}}};const kK=254,_pe=255,LK=0;function Kj(i,e){const t=i.children.slice();t.sort((r,n)=>r.tileAge-n.tileAge),t.forEach(r=>{r.labelMetrics!=null&&r.isReady&&e(r,r.labelMetrics)})}function n1t(i,e){return(!i.minScale||i.minScale>=e)&&(!i.maxScale||i.maxScale<=e)}let qmn=class{run(e,t,r,n){const s=[];for(let o=e.length-1;o>=0;o--){const a=e[o];a.labelingCollisionInfos?.length&&s.push(...a.labelingCollisionInfos)}yi("esri-2d-update-debug")&&s.length&&console.debug("CollisionEngine.run"),this._transformMetrics(s),this._runCollision(s,t,r,n);for(const o of s)o.container.requestRender()}_runCollision(e,t,r,n){const[s,o]=t.state.size,a=new Wmn(s,o,t.pixelRatio);for(const{container:l,deconflictionEnabled:u,visible:c}of e){const h=l.attributeView;u?c?(this._prepare(l),this._collideVisible(a,l,r,n),this._collideInvisible(a,l)):Kj(l,(p,m)=>{for(const v of m)h.setLabelMinZoom(v.entityTexel,_pe)}):Kj(l,(p,m)=>{for(const v of m)n1t(v,r)?(h.setLabelMinZoom(v.entityTexel,LK),c&&a.insertMetrics(v)):h.setLabelMinZoom(v.entityTexel,kK)})}}_isFiltered(e,t,r){const n=t.getFilterFlags(e),s=!r.hasFilter||!!(n&pJe),o=r.featureEffect==null||r.featureEffect.excludedLabelsVisible||!!(n&iHr);return!(s&&o)}_prepare(e){const t=e.attributeView,r=new Set;Kj(e,(n,s)=>{for(const o of s){const a=o.entityTexel;if(!r.has(a)){if(r.add(a),this._isFiltered(a,t,e.layerView)){t.setLabelMinZoom(a,kK);continue}t.getLabelMinZoom(a)!==LK?t.setLabelMinZoom(a,_pe):t.setLabelMinZoom(a,LK)}}})}_collideVisible(e,t,r,n){const s=t.attributeView,o=new Set;Kj(t,(a,l)=>{for(let u=0;u{for(let a=0;a{const a=t.attributeView,l=s.transforms.labelMat2d;l[4]=Math.round(l[4]),l[5]=Math.round(l[5]);const u=r==="polyline";for(const c of o){const{entityTexel:h,anchorX:p,anchorY:m}=c;let v=c.referenceBounds?.size??0;const w=n[0];if(w!=null){const R=w(a.getVVSize(h));v=isNaN(R)||R==null||R===1/0?v:R}const S=c.directionX*(v/2),I=c.directionY*(v/2);for(const R of c.bounds){let L=p,k=m;if(u){let B=L+R.x+S,$=k+R.y+I;B=l[0]*B+l[2]*$+l[4],$=l[1]*B+l[3]*$+l[5],R.computedX=Math.floor(B),R.computedY=Math.floor($)}else{L=l[0]*p+l[2]*m+l[4],k=l[1]*p+l[3]*m+l[5];const B=L+R.x+S,$=k+R.y+I;R.computedX=B,R.computedY=$}}}})}};const Ymn=32;let JU=class extends un{constructor(e){super(e),this._lastUpdate=0,this.collisionEngine=new qmn,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return yi("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: +-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){const t=performance.now();t-this._lastUpdate>=Ymn?(this._lastUpdate=t,this.doUpdate(e)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}doUpdate(e){const t=this.view;if(t)try{const r=e.state.scale,n=t.featuresTilingScheme.getClosestInfoForScale(r).level;this.collisionEngine.run(t.allLayerViews.items,e,r,n)}catch{}}};x([D()],JU.prototype,"updateRequested",void 0),x([D()],JU.prototype,"updating",null),x([D()],JU.prototype,"view",void 0),JU=x([Qe("esri.views.2d.LabelManager")],JU);function swe(i,e){const t=i.slice(0,e),r=e-t.length;for(let n=0;ndi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function kYt(i){return i.map(e=>Xmn(e)?Jmn(e.clone()):e)}function Xmn(i){return(i.type==="size"||i.type==="color"||i.type==="opacity")&&i.stops!=null}function Jmn(i){return i.stops=Qmn(i.type,i.stops??[]),i}function Zj(i,e,t){return(1-t)*i+t*e}function Kmn(i,e){const[t,...r]=e,n=r.pop(),s=r[0].value,o=r[r.length-1].value,a=(o-s)/DYt,l=[];for(let u=s;u=r[c].value;)c++;const h=r[c],p=e[c-1],m=u-p.value,v=h.value===p.value?1:m/(h.value-p.value);if(i==="color"){const w=r[c],S=e[c-1],I=w.color.clone();I.r=Zj(S.color.r,I.r,v),I.g=Zj(S.color.g,I.g,v),I.b=Zj(S.color.b,I.b,v),I.a=Zj(S.color.a,I.a,v),l.push({value:u,color:I,label:w.label})}else if(i==="size"){const w=r[c],S=e[c-1],I=Cl(w.size),R=Zj(Cl(S.size),I,v);l.push({value:u,size:R,label:w.label})}else{const w=r[c],S=Zj(e[c-1].opacity,w.opacity,v);l.push({value:u,opacity:S,label:w.label})}}return[t,...l,n]}function Zmn(i){const[e,...t]=i,r=t.pop();for(;t.length>DYt;){let n=0,s=0;for(let o=1;os&&(s=u,n=o)}t.splice(n,1)}return[e,...t,r]}function Qmn(i,e){return e.length<=Wye?e:(FYt().warn(`Found ${e.length} Visual Variable stops, but MapView only supports ${Wye}. Displayed stops will be simplified.`),e.length>2*Wye?Kmn(i,e):Zmn(e))}function egn(){const{supportsColorBufferFloat:i,supportsColorBufferFloatBlend:e,supportsColorBufferHalfFloat:t}=lk();return i&&e||t}function y7(i){if(!i)return!0;switch(i.type){case"dot-density":break;case"heatmap":if(!egn()){const e=lk(),t=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(r=>!e[r]).join(", ");return FYt().errorOnce(new qe("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${t}`)),!1}}return!0}const tgn=1.25,bpe=128,ign=128;function rgn(i){if(!i.stops?.length)return null;const e=i.stops.sort((s,o)=>s.value-o.value),t=swe(e,8),r=t.map(({value:s})=>s),n=t.map(({color:s})=>fte(s));return{values:r,colors:n}}function ngn(i){if(!i.stops?.length)return null;const e=i.stops.sort((r,n)=>r.value-n.value),t=swe(e,8);return{opacityValues:t.map(({value:r})=>r),opacities:t.map(({opacity:r})=>r)}}function sgn(i){return{rotationType:i.rotationType==="geographic"?eoe.Geographic:eoe.Arithmatic}}function nRe(i){if(!i.stops?.length)return null;if(i.stops.some(r=>r.useMaxValue||r.useMinValue))return(r,n)=>{const s=r.statisticsByLevel.get(n.key.level),o=i.stops.map(l=>({value:l.useMaxValue?s?.get(i.field)?.maxValue??0:l.useMinValue?s?.get(i.field)?.minValue??0:l.value,size:l.size?us(l.size):HVr})).sort((l,u)=>l.value-u.value),a=swe(o,8);return{values:a.map(({value:l})=>l),sizes:a.map(({size:l})=>l)}};const e=i.stops.sort((r,n)=>r.value-n.value),t=swe(e,8);return{values:t.map(({value:r})=>r),sizes:t.map(({size:r})=>us(r))}}function ogn(i){return e=>{const{state:t}=e;return{unitValueToPixelsRatio:pu(t.spatialReference)/bae[i.valueUnit]/t.resolution}}}function s1t(i,e){const t=e.length;if(i{const a=s.state.scale,l=us(s1t(a,r.stops)),u=us(s1t(a,n.stops));return{minMaxValueAndSize:[e,t,l,u]}};if(typeof r=="object"||typeof n=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[e,t,us(r),us(n)]}}const PR={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function RR(i,e=ign,t=tgn){if(i.visualVariableSizeMinMaxValue)return i.visualVariableSizeMinMaxValue instanceof Function?bpe:Math.max(i.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*t,e);if(i.visualVariableSizeScaleStops){if(i.visualVariableSizeScaleStops instanceof Function)return bpe;const r=i.visualVariableSizeScaleStops.sizes;return Math.max(r[r.length-1]*t,e)}if(i.visualVariableSizeStops){if(i.visualVariableSizeStops instanceof Function)return bpe;const r=i.visualVariableSizeStops.sizes;return Math.max(r[r.length-1]*t,e)}return i.visualVariableSizeUnitValue?2*bpe:0}function nM(i){const e={...PR};if(!i||!("visualVariables"in i)||!i.visualVariables)return e;for(const t of kYt(i.visualVariables))switch(t.type){case"color":e.visualVariableColor=rgn(t);break;case"opacity":e.visualVariableOpacity=ngn(t);break;case"rotation":e.visualVariableRotation=sgn(t);break;case"size":switch(lgn(t)){case"field-stops":e.visualVariableSizeStops=nRe(t);break;case"scale-stops":t.target==="outline"?e.visualVariableSizeOutlineScaleStops=nRe(t):e.visualVariableSizeScaleStops=nRe(t);break;case"min-max":e.visualVariableSizeMinMaxValue=agn(t);break;case"unit-value":e.visualVariableSizeUnitValue=ogn(t)}break;default:console.error("Unable to handle VV type")}return e}function lgn(i){if(typeof i.minDataValue=="number"&&typeof i.maxDataValue=="number"&&i.minSize!=null&&i.maxSize!=null)return"min-max";if((i.expression&&i.expression==="view.scale"||i.valueExpression&&i.valueExpression==="$view.scale")&&Array.isArray(i.stops))return"scale-stops";if((i.field!=null||i.expression&&i.expression!=="view.scale"||i.valueExpression&&i.valueExpression!=="$view.scale")&&(Array.isArray(i.stops)||"levels"in i&&i.levels))return"field-stops";if((i.field!=null||i.expression&&i.expression!=="view.scale"||i.valueExpression&&i.valueExpression!=="$view.scale")&&i.valueUnit!=null)return"unit-value";throw new Error("InternalError: Found unknown sizeVV type")}function Nq(i){return!!(i.visualVariableSizeMinMaxValue||i.visualVariableSizeScaleStops||i.visualVariableSizeStops||i.visualVariableSizeUnitValue||i.visualVariableSizeOutlineScaleStops)}function UKe(i){return!!i.visualVariableRotation}function LYt(i){return i.minScale||i.maxScale?{minScale:i.minScale??0,maxScale:i.maxScale??0}:null}function LA(i){if(i==null)return null;if(Array.isArray(i)){const[e,t,r,n]=i;return[e,t,r,255*n]}return typeof i=="string"?i:{...i,defaultValue:LA(i?.defaultValue)}}async function owe(i,e){const{cimResourceManager:t,cimAnalyzer:r,scaleExpression:n}=e.schemaOptions;await Promise.all(ym.fetchResources(i.symbol,t,[]));const s=r.analyzeSymbolReference(i,!1),o={scaleInfo:LYt(i),scaleExpression:n},a=[];for(const l of s)switch(l.type){case"marker":a.push(...ugn(l,e,o));break;case"fill":a.push(...hgn(l,e,o));break;case"line":a.push(...dgn(l,e,o));break;case"text":a.push(...pgn(l,e,o))}return a}function ugn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=i.isOutline?{...PR,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation};return NYt(s.ensureInstance(Sc.marker,{geometry:o},{zoomRange:!!t.scaleInfo}),i,r,t)}function NYt(i,e,t,{scaleInfo:r,scaleExpression:n}){const s=Nq(t);return[i.createMeshInfo({params:{size:e.size,scaleX:e.scaleX,anchorX:e.anchorPoint.x,anchorY:e.anchorPoint.y,angle:e.rotation,color:LA(e.color)??[0,0,0,0],colorLocked:e.colorLocked,frameHeight:e.frameHeight,widthRatio:e.widthRatio,scaleInfo:r,offsetX:e.offsetX,offsetY:e.offsetY,outlineColor:LA(e.outlineColor)??[0,0,0,0],outlineSize:e.outlineWidth,referenceSize:e.referenceSize||ph.CIMVectorMarker.size,rotateClockwise:e.rotateClockwise,scaleFactor:n??1,sizeRatio:e.sizeRatio,alignment:e.alignment,isAbsoluteAnchorPoint:e.isAbsoluteAnchorPoint,scaleSymbolsProportionally:e.scaleSymbolsProportionally,sprite:e.spriteRasterizationParam,hasSizeVV:s,placement:e.markerPlacement,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,transforms:e.transform,minPixelBuffer:RR(t)}})]}function cgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return $Yt(s.ensureInstance(Sc.fill,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),i,t)}function $Yt(i,e,{scaleInfo:t}){return[i.createMeshInfo({params:{color:LA(e.color)??[0,0,0,0],scaleInfo:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function hgn(i,e,t){if(!i.spriteRasterizationParam)return cgn(i,e,t);const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return BYt(s.ensureInstance(Sc.complexFill,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),i,r.visualVariableColor!=null,t)}function BYt(i,e,t,{scaleInfo:r}){if(!e.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const n=!!e.hasUnresolvedReplacementColor&&(!t||e.colorLocked),s=e.sampleAlphaOnly&&!n,o=e.spriteRasterizationParam;return[i.createMeshInfo({params:{color:LA(e.color)??[0,0,0,0],height:e.height,aspectRatio:e.scaleX,offsetX:e.offsetX,offsetY:e.offsetY,scaleX:1,scaleY:1,angle:e.angle,applyRandomOffset:e.applyRandomOffset,sampleAlphaOnly:s,scaleProportionally:o.resource.type==="CIMHatchFill",sprite:o,scaleInfo:r,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function dgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=i.isOutline?{...PR,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops}:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},a={geometry:o},l=!!(o.visualVariableSizeMinMaxValue||o.visualVariableSizeScaleStops||o.visualVariableSizeStops||o.visualVariableSizeUnitValue);return i.spriteRasterizationParam?UYt(s.ensureInstance(Sc.texturedLine,a,{zoomRange:!!t.scaleInfo}),i,l,t):GYt(s.ensureInstance(Sc.line,a,{zoomRange:!!t.scaleInfo}),i,l,t)}function jYt(i,e,{scaleInfo:t}){return{params:{color:LA(i.color)??[0,0,0,0],width:i.width,referenceWidth:i.referenceWidth,capType:i.cap,joinType:i.join,miterLimit:i.miterLimit,scaleInfo:t,hasSizeVV:e,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null}}}function GYt(i,e,t,r){if(e.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");return[i.createMeshInfo({params:jYt(e,t,r).params})]}function UYt(i,e,t,r){const{spriteRasterizationParam:n,scaleDash:s,sampleAlphaOnly:o}=e;if(!n)throw new Error("InternalError: Sprite should be defined");return[i.createMeshInfo({params:{...jYt(e,t,r).params,shouldScaleDash:s??!1,shouldSampleAlphaOnly:o,isSDF:n.resource.type!=="CIMPictureStroke",sprite:n}})]}function pgn(i,e,t){const{uniforms:r,schemaOptions:n}=e,{store:s}=n;return zYt(s.ensureInstance(Sc.text,{geometry:{visualVariableColor:i.colorLocked?null:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!!t.scaleInfo,referenceSymbol:!1,clipAngle:!1}),i,r,t)}function zYt(i,e,t,{scaleInfo:r,scaleExpression:n}){return[i.createMeshInfo({params:{boxBackgroundColor:LA(e.backgroundColor),boxBorderLineColor:LA(e.borderLineColor),boxBorderLineSize:e.borderLineWidth??0,color:LA(e.color)??[0,0,0,0],offsetX:e.offsetX,offsetY:e.offsetY,postAngle:e.angle,fontSize:e.size,referenceSize:e.referenceSize,decoration:e.decoration,haloColor:LA(e.outlineColor)??[0,0,0,0],haloFontSize:e.outlineSize,lineWidth:e.lineWidth||512,lineHeightRatio:1,horizontalAlignment:e.horizontalAlignment??"center",verticalAlignment:e.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:e.textRasterizationParam,scaleInfo:r,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,placement:e.markerPlacement,transforms:e.transform,scaleFactor:n??1,minPixelBuffer:RR(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}async function fgn(i,e,t){const r=[],n={scaleInfo:LYt(i),scaleExpression:null};for(const s of e)switch(s.type){case"marker":r.push(...NYt(t.instances.marker,s,PR,n));break;case"fill":s.spriteRasterizationParam==null?r.push(...$Yt(t.instances.fill,s,n)):r.push(...BYt(t.instances.complexFill,s,!1,n));break;case"line":s.spriteRasterizationParam?r.push(...UYt(t.instances.texturedLine,s,!1,n)):r.push(...GYt(t.instances.line,s,!1,n));break;case"text":r.push(...zYt(t.instances.text,s,PR,n))}return r}function YCe(i,e){return{type:"simple",filters:e,capabilities:{maxTextureSize:lk().maxTextureSize},bindings:mgn(i)}}function XCe(i){switch(i){case"opacity":return fV.OPACITY;case"color":return fV.COLOR;case"rotation":return fV.ROTATION;case"size":return fV.SIZE;default:return null}}function mgn(i){if(!i)return[];switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return zKe(i);case"dot-density":return ggn(i);case"pie-chart":return ygn(i);case"heatmap":return vgn(i)}}function ggn(i){const e=[];for(const t of i.attributes)e.push({binding:e.length,expression:t.valueExpression,field:t.field});return e}function ygn(i){const e=zKe(i);let t=4;for(const r of i.attributes)e.push({binding:t++,expression:r.valueExpression,field:r.field});return e}function vgn({valueExpression:i,field:e}){return i||e?[{binding:0,expression:i,field:e}]:[]}function zKe(i){return!("visualVariables"in i)||!i.visualVariables?.length?[]:kYt(i.visualVariables).map(e=>Sgn(e)).filter(Ga)}function _gn(i){return i.valueExpression==="$view.scale"?null:{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression,valueRepresentation:i.valueRepresentation}}function bgn(i){return{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression}}function wgn(i){return{binding:XCe(i.type),field:i.field,normalizationField:i.normalizationField,expression:i.valueExpression}}function xgn(i){return{binding:XCe(i.type),expression:i.valueExpression,field:i.field}}function Sgn(i){switch(i.type){case"size":return _gn(i);case"color":return bgn(i);case"opacity":return wgn(i);case"rotation":return xgn(i)}}let Tgn=class T7e extends RCe{static from(e,t,r){return new T7e(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const n=t.lod;n.wrap&&(this._wrappingInfo={worldSizeX:n.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=ah(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new T7e(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1xo*(n-1)&&(e[s]=o-xo*n)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=p2e(this._current.projectedGeometry),t=new $o([],e);return wx(new $o,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=lIt(e.paths,this.hasZ),r=new $o([],t);return wx(new $o,r,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(r!==void 0)return r;const n=e.toLowerCase();for(const s in this._current.attributes)if(s.toLowerCase()===n)return this._current.attributes[s]}_readAttributes(){return this._current.attributes}};function Cgn(i){return VYt(i,!0)}function Egn(i){return VYt(i,!1)}function VYt(i,e){if(i==null)return null;const t=i.spatialReference,r=Zp(t),n=W9(i)?i.toJSON():i;if(!r)return n;const s=Nb(t)?102100:4326,o=$z[s].maxX,a=$z[s].minX;if(dR(n))return o1t(n,o,a);if(xF(n))return n.points=n.points.map(l=>o1t(l,o,a)),n;if(zd(n))return Ign(n,r);if(ed(n)||e0(n)){const l=gY(Mgn,n),u={xmin:l[0],ymin:l[1],xmax:l[2],ymax:l[3]},c=pS(u.xmin,a)*(2*o),h=c===0?n:uHe(n,c);return u.xmin+=c,u.xmax+=c,u.xmax>o?l1t(h,o,e):u.xminr.extent);return t.length<2?t[0]||i:t.length>2?(i.xmin=e.valid[0],i.xmax=e.valid[1],i):{rings:t.map(r=>[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]])}}function o1t(i,e,t){if(Array.isArray(i)){const r=i[0];if(r>e){const n=pS(r,e);i[0]=r+n*(-2*e)}else if(re){const n=pS(r,e);i.x+=n*(-2*e)}else if(r0;if(a>2*u){const w={xmin:sp||v?t.push(new cN({xmin:c,ymin:r,xmax:u,ymax:n},[h]),new cN({xmin:l,ymin:r,xmax:p,ymax:n},[m])):t.push(new cN({xmin:c,ymin:r,xmax:p,ymax:n},[h]));return t}function a1t(i,e){const[t,r]=e.valid,n=2*r;let s,o=0;return i>r?(s=Math.ceil(Math.abs(i-r)/n),i-=s*n,o=s):i=i.xmin&&e<=i.xmax&&t>=i.ymin&&t<=i.ymax}function l1t(i,e,t=!0){const r=!e0(i);if(r&&aIt(i),t)return new Ogn().cut(i,e);const n=r?i.rings:i.paths,s=r?4:2,o=n.length,a=-2*e;for(let l=0;l=s){const c=[];for(const h of u)c.push([h[0]+a,h[1]]);n.push(c)}}return r?i.rings=n:i.paths=n,i}let cN=class{constructor(e,t){this.extent=e,this.frameIds=t}};const Mgn=Wo();let Ogn=class{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let r;if(this._xCut=t,e.rings)this._closed=!0,r=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,r=e.paths,this._minPts=2}for(const s of r){if(!s||s.length=this._minPts&&r.push(s);const n=-2*this._xCut;for(const s of this._linesOut)if(s&&s.length>=this._minPts){for(const o of s)o[0]+=n;r.push(s)}return this._closed?e.rings=r:e.paths=r,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide==-1){const r=this._intersect(this._prevPt,e);this._lineTo(this._xCut,r,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,r){this._closed?(this._lineIn.push([r<=0?e:this._xCut,t]),this._lineOut.push([r>=0?e:this._xCut,t])):(r<=0&&this._lineIn.push([e,t]),r>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,r){this._closed?(this._addPolyVertex(this._lineIn,r<=0?e:this._xCut,t),this._addPolyVertex(this._lineOut,r>=0?e:this._xCut,t)):r<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([e,t])):r>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_addPolyVertex(e,t,r){const n=e.length;n>1&&e[n-1][0]===t&&e[n-2][0]===t?e[n-1][1]=r:e.push([t,r])}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return ethis._xCut?1:0}_intersect(e,t){const r=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+r*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}};const sRe=50;function u1t(i){if(!i)return null;const{xmin:e,ymin:t,xmax:r,ymax:n,spatialReference:s}=i;return new $s({rings:[[[e,t],[e,n],[r,n],[r,t],[e,t]]],spatialReference:s})}let Pgn=class HYt{static fromGraphic(e,t,r,n){return new HYt(e.geometry,t,e.attributes,e.visible,e.uid,r,n)}constructor(e,t,r,n,s,o,a){this.geometry=e,this.symbol=t,this.attributes=r,this.visible=n,this.objectId=s,this.zOrder=o,this.displayId=a,this.bounds=Wo(),this.prevBounds=Wo(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}update(e,t,r){return(this.geometry!==e.geometry||this.attributes!==e.attributes||this.symbol!==t||this.zOrder!==r||this.visible!==e.visible)&&(this.prevBounds=this.bounds,this.bounds=Wo(),this.zOrder=r,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=u1t(t)),await Gv(t.spatialReference,e);const r=Egn(t);if(!r)return;const n=Sf(r,t.spatialReference,e);n&&CXi(n),this.projectedGeometry=zd(n)?u1t(n):n}},Rgn=class{constructor(e,t,r){this.added=e,this.updated=t,this.removed=r}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}};const c1t=1e-5;function Dgn(i,e){return e.zOrder-i.zOrder}let Fgn=class{constructor(e,t,r,n,s){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new Gqr(t),this._tileInfoView=r,this._store=s;const o=r.getClosestInfoForScale(n);this._resolution=this._tileInfoView.getTileResolution(o.level)}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,r){const n=[],s=[],o=[],a=new Set,l=[];let u=0;for(const c of e.items){u++;const h=c.uid,p=this._items.get(h),m=t(c);if(a.add(h),p){p.update(c,m,u)&&(s.push(p),l.push(this._updateItem(p,r)));continue}const v=this._store.createDisplayIdForObjectId(h),w=Pgn.fromGraphic(c,m,u,v);l.push(this._updateItem(w,r)),this._items.set(w.objectId,w),n.push(w)}for(const[c,h]of this._items.entries())a.has(c)||(this._store.releaseDisplayIdForObjectId(c),this._items.delete(c),o.push(h));return await Promise.all(l),this._index=null,new Rgn(n,s,o)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,r,n,s){const o=yi("esri-mobile"),a=yi(o?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance"),l=a+(o?0:yi("hittest-2d-small-symbol-tolerance"));e=cHe(e,this._tileInfoView.spatialReference);const u=n*window.devicePixelRatio*l,c=Wo();c[0]=e-u,c[1]=t-u,c[2]=e+u,c[3]=t+u;const h=n*window.devicePixelRatio*a,p=Wo();p[0]=e-h,p[1]=t-h,p[2]=e+h,p[3]=t+h;const m=.5*n*(l+sRe),v=this._searchIndex(e-m,t-m,e+m,t+m);if(!v||v.length===0)return[];const w=[],S=Wo(),I=Wo();for(const k of v){if(!k.visible)continue;const{projectedGeometry:B,symbolResource:$}=k;this._getSymbolBounds(S,$,B,I,s),I[3]=I[2]=I[1]=I[0]=0,aae(S,c)&&w.push(k)}if(w.length===0)return[];const R=this._hittestDrawHelper,L=[];for(const k of w){const{projectedGeometry:B,symbolResource:$}=k;if(!$)continue;const{textInfo:V,symbolInfo:Y}=$,K=Y.cimSymbol;R.hitTest(p,K.symbol,B,V,s,n)&&L.push(k)}return L.sort(Dgn),L.map(k=>k.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:r}=e;r[0]=r[1]=r[2]=r[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,r,n){return this._boundsDirty&&(this._items.forEach(s=>this._getSymbolBounds(s.bounds,s.symbolResource,s.projectedGeometry,s.size,0)),this._boundsDirty=!1),this._index||(this._index=$W(9,s=>({minX:s.bounds[0],minY:s.bounds[1],maxX:s.bounds[2],maxY:s.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:r,maxY:n})}_searchForItems(e){const t=this._tileInfoView.spatialReference,r=e.bounds,n=Zp(t);if(n&&t.isWrappable){const[s,o]=n.valid,a=Math.abs(r[2]-o)e.globalId)}function NK(i){return i.filter(e=>!e.error).map(e=>e.objectId??e.globalId).filter(e=>e!=null)}function h1t(i,e){const t=new Set(i);for(const r of e.values())t.add(r);return t}function d1t(i,e){const t=new Set(i);for(const r of e.values())t.delete(r);return t}let WYt=class{constructor(e){this.updateTracking=new E8({debugName:"FeatureCommandQueue"}),this._hasGlobalIds=!1,this._queueProcessor=new UY({concurrency:1,process:e.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(e){return this.updateTracking.addPromise(this._doPush(e))}async _doPush(e){const t=this._queueProcessor,r=t.last(),n=[];switch(e.type){case"update":if(r?.type===e.type)return;n.push(t.push(e));break;case"edit":{const s=r?.type==="processed-edit"?r:null;s&&t.popLast();const o=this._mergeEdits(s,e);for(const a of o)a&&n.push(t.push(a));break}}await Promise.all(n)}_mergeEdits(e,t){const{addedFeatures:r,deletedFeatures:n,updatedFeatures:s}=t.edits;if(this._hasGlobalIds=this._hasGlobalIds||oRe(r)||oRe(s)||oRe(n),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...r,...s],removed:n}}];const o=new Set(NK(e?.edits.addOrModified??[])),a=new Set(NK(e?.edits.removed??[])),l=new Set([...NK(r),...NK(s)]),u=new Set(NK(n));return[{type:"processed-edit",edits:{addOrModified:Array.from(h1t(d1t(o,u),l)).map(c=>({objectId:c})),removed:Array.from(h1t(d1t(a,l),u)).map(c=>({objectId:c}))}}]}},$K=class C7e{static getOrCreate(e,t,r){let n=t.get(e.id);return n||(n=new C7e(e,r),t.set(e.id,n)),n}static fromItems(e,t,r){const n=new C7e(e,r);return n.addedOrModified.push(...t),n}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[]}get reader(){return this._reader||(this._reader=Tgn.from(this.addedOrModified,this.tile,this.metadata)),this._reader}},H_=class extends iT(un){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new E8({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new WYt({process:t=>{switch(t.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new MCe({spatialReference:this.view.spatialReference,fields:new Cd}),this._attributeStore=new eVt({isLocal:!0,update:async t=>{yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:t});const r=this.container.attributeView.requestUpdate(t);this.container.requestRender(),await r,yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:t})}});const e=YCe(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=LKr.create(this.view.spatialReference),this._resourceProxy=new Rzt({fetch:t=>Promise.all(t.map(r=>this.view.stage.textureManager.rasterizeItem(r))),fetchDictionary:t=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([Ki(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore=new Fgn(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return yi("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e} -> attaching ${!this._attached} - -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,n=this._graphicStore.hitTest(e.x,e.y,2,t,r),s=new Set(n),o=this.graphics.items.reduce((a,l)=>(s.has(l.uid)&&a.set(l.uid,l),a),new Map);return n.map(a=>o.get(a)).filter(Ga)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:r,highlightFlags:n}of e){const s=this._graphicStore.getItem(r)?.displayId;t.push({objectId:r,highlightFlags:n,displayId:s})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)}_pushUpdate(){NP(this._commandQueue.push({type:"update"}))}async _update(){try{yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,r=>this._getSymbolForGraphic(r),r=>this._ensureSymbolResource(r));if(!e.hasAnyUpdate())return void await this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._fetchResources(t),this._write(t);for(const r of e.added)this._setFilterState(r);for(const r of e.updated)this._setFilterState(r);yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),await this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const r of e.added){const n=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of n)$K.getOrCreate(s,t,this._metadata).addedOrModified.push(r)}for(const r of e.updated){const n=this.view.graphicsTileStore.getIntersectingTiles(r.prevBounds),s=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const o of n)$K.getOrCreate(o,t,this._metadata).removed.push(r.displayId);for(const o of s)$K.getOrCreate(o,t,this._metadata).addedOrModified.push(r)}for(const r of e.removed){const n=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of n)$K.getOrCreate(s,t,this._metadata).removed.push(r.displayId)}return Array.from(t.values())}async _fetchResources(e){for(const{tile:t,reader:r}of e){yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.id}] GraphicsView fetchResources`,e);const n=r.getCursor();for(;n.next();)for(const s of n.getMeshWriters())s.enqueueRequest(this._resourceProxy,n,t.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const r=this._writeMeshes(t);let n=this._tiles.get(t.tile.key);n||(n=this._createFeatureTile(t.tile.key)),yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:"update",modify:r,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch}),this.container.requestRender()}}_writeMeshes(e){const t=new P8e(e.tile.id),r=e.reader.getCursor();for(;r.next();){t.entityStart(r.getDisplayId(),r.getZOrder());for(const n of r.getMeshWriters())n.write(t,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(this.view.timeZone),e.tile.level);t.entityEnd()}return{...t.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,r=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,r|(e.visible?pJe:0))}_getSymbolForGraphic(e){return e.symbol!=null?e.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const r=t.linearCIM.filter(n=>n.type==="text");if(r.length>0){const n=await this._getTextResources(e,r);e.symbolResource={symbolInfo:t,textInfo:n}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(r=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const r=await this._convertToCIMSymbol(t),n=await this._createLinearCIM(r);if(t.type==="text")for(const s of n)s.type==="text"&&(s.lineWidth=t.lineWidth);return{hash:e,cimSymbol:r,linearCIM:n,meshWriters:await this._createMeshWriters(r,n)}}async _convertToCIMSymbol(e){const t=oYr(e);return t.type==="web-style"?(await t.fetchCIMSymbol()).data:t}async _createLinearCIM(e){return await Promise.all(ym.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){hn(this._controller.signal);const r=this.container.instanceStore,n=await ygn(e,t,r);return Promise.all(n.map(s=>Szt(this._storage,this._resourceProxy,s.meshWriterName,s.id,s.options,{tileInfo:this.view.featuresTilingScheme.tileInfo},s.optionalAttributes)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(Wo(),e),r=this.view.featuresTilingScheme.getTileResolution(e.level),n=new BKe(e,r,t[0],t[3]);return this._tiles.set(e,n),this.container.addChild(n),n}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const r=this._createFeatureTile(e.key),n=$K.fromItems(e,t,this._metadata);await this._fetchResources([n]);const s=this._writeMeshes(n);r.onMessage({type:"append",append:s,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return e0(t)?bor:ed(t)||zd(t)?wor:this.defaultPointSymbolEnabled?_or:null}async _getTextResources(e,t){const r=new Array,n=new Array;for(let l=0;l0){const p=N5.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:c.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:c.symbol,textString:c.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,ah(e.projectedGeometry),null,null);p.then(m=>{const v=m.symbolLayers[0],{textString:w}=v.markerGraphics[0];n.push({type:"cim-rasterization-info",resource:{type:"text",textString:w||"",font:c.font}}),u.text=c.textString=w||""}),r.push(p)}else n.push({type:"cim-rasterization-info",resource:c})}r.length>0&&await Promise.all(r);const s=n.map(l=>this.view.stage.textureManager.rasterizeItem(l)),o=await Promise.all(s);Of(o);const a=new Map;for(let l=0;ldi.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");let p1t=class{constructor(e,t,r){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:n,pixelType:s,textureOnly:o}=e,a=Bee(s);this.blockIndex=r,this.pixelType=s,this.size=t,this.textureOnly=o,o||(this.data=new a(n)),this._resetRange()}destroy(){this._texture?.dispose();for(const e in this._fbos){const t=this._fbos[e];t&&(e==="0"&&t.detachColorTexture(),t.dispose()),this._fbos[e]=null}this._texture=null}get _textureDesc(){const e=new Ua;return e.wrapMode=Ls.CLAMP_TO_EDGE,e.samplingMode=Is.NEAREST,e.dataType=this.pixelType,e.width=this.size,e.height=this.size,e}setData(e,t,r){const n=vS(e),s=this.data,o=n*this.texelSize+t;!s||o>=s.length||(s[o]=r,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n))}getData(e,t){if(this.data==null)return null;const r=vS(e)*this.texelSize+t;return!this.data||r>=this.data.length?null:this.data[r]}getTexture(e){return this._texture??this._initTexture(e)}getFBO(e,t=0){if(!this._fbos[t]){const r=t===0?this.getTexture(e):this._textureDesc;this._fbos[t]=new Wd(e,r)}return this._fbos[t]}get hasDirty(){const e=this.dirtyStart;return this.dirtyEnd>=e}updateTexture(e,t){try{const r=this.dirtyStart,n=this.dirtyEnd;if(!this.hasDirty)return;yi("esri-2d-update-debug")&&console.debug(`Version[${t}] AttributeStoreView.updateTexture`,{start:r,end:n,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const s=this.data.buffer,o=this.getTexture(e),a=4,l=(r-r%this.size)/this.size,u=(n-n%this.size)/this.size,c=l,h=this.size,p=u,m=l*this.size*a,v=(h+p*this.size)*a-m,w=Bee(this.pixelType),S=new w(s,m*w.BYTES_PER_ELEMENT,v),I=this.size,R=p-c+1;if(R>this.size)return void $gn().error(new qe("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,c,I,R,S)}catch{}}update(e){const{data:t,start:r,end:n}=e;if(t!=null&&this.data!=null){const s=this.data,o=r*this.texelSize;for(let a=0;ar!=null?new p1t(r,this.size,n):null);else for(let r=0;r{yi("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",r)}),this._version=e.version,this._pendingAttributeUpdates.push({inner:e,resolver:t}),yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:e})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const e=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:t,resolver:r}of e){const{blockData:n,initArgs:s,sendUpdateEpoch:o,version:a}=t;yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${o}] AttributeStoreView.applyUpdate`),this._version=a,this._epoch=o,s!=null&&this._initialize(s);const l=this._data;for(let u=0;u{switch(i.BYTES_PER_ELEMENT){case 1:return Ti.UNSIGNED_BYTE;case 2:return Ti.UNSIGNED_SHORT;case 4:return Ti.UNSIGNED_INT;default:throw new qe("Cannot get DataType of array")}},Ggn=(i,e,t,r)=>{let n=0;for(let s=1;s0:n<0},f1t=({coords:i,lengths:e},t)=>{const r=[];for(let n=0,s=0;n({...r,[n]:Aa.createVertex(e,t,this.vertices[n])}),{})),this._cache.vertexBuffers}};const Tpe=i=>parseFloat(i)/100;let Ugn=class qYt extends eM{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=Ki(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new qYt(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,r,n){const[s,o]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===s&&this._lastHeight===o||(this._lastWidth=s,this._lastHeight=o,this._destroyGL()),this._cache.vao==null){const a=this._createMesh(t,this._clip),l=a.getIndexBuffer(e),u=a.getVertexBuffers(e);this._cache.mesh=a,this._cache.vao=new wh(e,r,n,u,l)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:Cc()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[r,n]=e.size,s=typeof t.left=="string"?Tpe(t.left)*r:t.left,o=typeof t.right=="string"?Tpe(t.right)*r:t.right,a=typeof t.top=="string"?Tpe(t.top)*n:t.top,l=typeof t.bottom=="string"?Tpe(t.bottom)*n:t.bottom,u=s,c=a;return{x:u,y:c,width:Math.max(r-o-u,0),height:Math.max(n-l-c,0)}}_createMesh(e,t){switch(t.type){case"rect":return Spe.fromRect(this._createScreenRect(e,t));case"path":return Spe.fromPath(t);case"geometry":return Spe.fromGeometry(e,t);default:return di.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new qe("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),Spe.fromRect({x:0,y:0,width:1,height:1})}}},Vle=class extends WCe{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Lq.clip],target:()=>this._clippingInfos,drawPhase:aa.MAP|aa.LABEL|aa.LABEL_ALPHA|aa.DEBUG|aa.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>Ugn.fromClipArea(this.stage,t))),this.requestRender()}};const zgn=(i,e)=>i.key.level-e.key.level!=0?i.key.level-e.key.level:i.key.row-e.key.row!=0?i.key.row-e.key.row:i.key.col-e.key.col;let Hle=class extends Vle{constructor(e){super(),this._tileInfoView=e}renderChildren(e){this.sortChildren(zgn),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,r=super.createRenderParams(e);return r.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,r.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),r}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[Xqt],drawPhase:aa.DEBUG|aa.MAP|aa.HIGHLIGHT|aa.LABEL,target:()=>this.getStencilTarget()})),yi("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[tYt],drawPhase:aa.DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}setStencilReference(e){let t=1;for(const r of this.children)r.stencilRef=t++}},YYt=class extends Hle{constructor(e){super(e),this._statisticsByLevel=new Map,this.attributeView=new Bgn}destroy(){this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloat"),super.doRender(e)}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}},E7e=class{constructor(e,t,r,n,s){this._instanceId=e,this.techniqueRef=t,this._meshWriterName=r,this._input=n,this.optionalAttributes=s}get instanceId(){return this._instanceId}createMeshInfo(e){return{id:this._instanceId,meshWriterName:this._meshWriterName,options:e,optionalAttributes:this.optionalAttributes}}getInput(){return this._input}setInput(e){this._input=e}},Vgn=0;function Qj(i,e,t){return new E7e(Vgn++,i,i.meshWriter.name,e,t)}const eG={geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null}};let Hgn=class{constructor(){this.instances={fill:Qj(Sc.fill,eG,{zoomRange:!0}),marker:Qj(Sc.marker,eG,{zoomRange:!0}),line:Qj(Sc.line,eG,{zoomRange:!0}),text:Qj(Sc.text,eG,{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}),complexFill:Qj(Sc.complexFill,eG,{zoomRange:!0}),texturedLine:Qj(Sc.texturedLine,eG,{zoomRange:!0})},this._instancesById=Object.values(this.instances).reduce((e,t)=>(e.set(t.instanceId,t),e),new Map)}getInstance(e){return this._instancesById.get(e)}};const Wgn=Math.PI/180,qgn=4;let Ygn=class extends eM{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=Cc(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=ba(this._program)}doRender(e){const{context:t}=e,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,r),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const n=this._program;t.bindVAO(this._vao),t.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(Eo.LINES,8*r.length,Ti.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{displayViewScreenMat3:Cc()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; + -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,n=this._graphicStore.hitTest(e.x,e.y,2,t,r),s=new Set(n),o=this.graphics.items.reduce((a,l)=>(s.has(l.uid)&&a.set(l.uid,l),a),new Map);return n.map(a=>o.get(a)).filter(Ga)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:r,highlightFlags:n}of e){const s=this._graphicStore.getItem(r)?.displayId;t.push({objectId:r,highlightFlags:n,displayId:s})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)}_pushUpdate(){NP(this._commandQueue.push({type:"update"}))}async _update(){try{yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const e=await this._graphicStore.update(this.graphics,r=>this._getSymbolForGraphic(r),r=>this._ensureSymbolResource(r));if(!e.hasAnyUpdate())return void await this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._fetchResources(t),this._write(t);for(const r of e.added)this._setFilterState(r);for(const r of e.updated)this._setFilterState(r);yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),await this._attributeStore.sendUpdates(),yi("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch{}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const r of e.added){const n=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of n)$K.getOrCreate(s,t,this._metadata).addedOrModified.push(r)}for(const r of e.updated){const n=this.view.graphicsTileStore.getIntersectingTiles(r.prevBounds),s=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const o of n)$K.getOrCreate(o,t,this._metadata).removed.push(r.displayId);for(const o of s)$K.getOrCreate(o,t,this._metadata).addedOrModified.push(r)}for(const r of e.removed){const n=this.view.graphicsTileStore.getIntersectingTiles(r.bounds);for(const s of n)$K.getOrCreate(s,t,this._metadata).removed.push(r.displayId)}return Array.from(t.values())}async _fetchResources(e){for(const{tile:t,reader:r}of e){yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.id}] GraphicsView fetchResources`,e);const n=r.getCursor();for(;n.next();)for(const s of n.getMeshWriters())s.enqueueRequest(this._resourceProxy,n,t.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const r=this._writeMeshes(t);let n=this._tiles.get(t.tile.key);n||(n=this._createFeatureTile(t.tile.key)),yi("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(n,{type:"update",modify:r,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch}),this.container.requestRender()}}_writeMeshes(e){const t=new P8e(e.tile.id),r=e.reader.getCursor();for(;r.next();){t.entityStart(r.getDisplayId(),r.getZOrder());for(const n of r.getMeshWriters())n.write(t,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(this.view.timeZone),e.tile.level);t.entityEnd()}return{...t.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,r=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,r|(e.visible?pJe:0))}_getSymbolForGraphic(e){return e.symbol!=null?e.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const r=t.linearCIM.filter(n=>n.type==="text");if(r.length>0){const n=await this._getTextResources(e,r);e.symbolResource={symbolInfo:t,textInfo:n}}else e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(r=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const r=await this._convertToCIMSymbol(t),n=await this._createLinearCIM(r);if(t.type==="text")for(const s of n)s.type==="text"&&(s.lineWidth=t.lineWidth);return{hash:e,cimSymbol:r,linearCIM:n,meshWriters:await this._createMeshWriters(r,n)}}async _convertToCIMSymbol(e){const t=rYr(e);return t.type==="web-style"?(await t.fetchCIMSymbol()).data:t}async _createLinearCIM(e){return await Promise.all(ym.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){hn(this._controller.signal);const r=this.container.instanceStore,n=await fgn(e,t,r);return Promise.all(n.map(s=>Szt(this._storage,this._resourceProxy,s.meshWriterName,s.id,s.options,{tileInfo:this.view.featuresTilingScheme.tileInfo},s.optionalAttributes)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(Wo(),e),r=this.view.featuresTilingScheme.getTileResolution(e.level),n=new BKe(e,r,t[0],t[3]);return this._tiles.set(e,n),this.container.addChild(n),n}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const r=this._createFeatureTile(e.key),n=$K.fromItems(e,t,this._metadata);await this._fetchResources([n]);const s=this._writeMeshes(n);r.onMessage({type:"append",append:s,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return e0(t)?yor:ed(t)||zd(t)?vor:this.defaultPointSymbolEnabled?gor:null}async _getTextResources(e,t){const r=new Array,n=new Array;for(let l=0;l0){const p=N5.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:c.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:c.symbol,textString:c.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,ah(e.projectedGeometry),null,null);p.then(m=>{const v=m.symbolLayers[0],{textString:w}=v.markerGraphics[0];n.push({type:"cim-rasterization-info",resource:{type:"text",textString:w||"",font:c.font}}),u.text=c.textString=w||""}),r.push(p)}else n.push({type:"cim-rasterization-info",resource:c})}r.length>0&&await Promise.all(r);const s=n.map(l=>this.view.stage.textureManager.rasterizeItem(l)),o=await Promise.all(s);Of(o);const a=new Map;for(let l=0;ldi.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");let p1t=class{constructor(e,t,r){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:n,pixelType:s,textureOnly:o}=e,a=Bee(s);this.blockIndex=r,this.pixelType=s,this.size=t,this.textureOnly=o,o||(this.data=new a(n)),this._resetRange()}destroy(){this._texture?.dispose();for(const e in this._fbos){const t=this._fbos[e];t&&(e==="0"&&t.detachColorTexture(),t.dispose()),this._fbos[e]=null}this._texture=null}get _textureDesc(){const e=new Ua;return e.wrapMode=Ls.CLAMP_TO_EDGE,e.samplingMode=Is.NEAREST,e.dataType=this.pixelType,e.width=this.size,e.height=this.size,e}setData(e,t,r){const n=vS(e),s=this.data,o=n*this.texelSize+t;!s||o>=s.length||(s[o]=r,this.dirtyStart=Math.min(this.dirtyStart,n),this.dirtyEnd=Math.max(this.dirtyEnd,n))}getData(e,t){if(this.data==null)return null;const r=vS(e)*this.texelSize+t;return!this.data||r>=this.data.length?null:this.data[r]}getTexture(e){return this._texture??this._initTexture(e)}getFBO(e,t=0){if(!this._fbos[t]){const r=t===0?this.getTexture(e):this._textureDesc;this._fbos[t]=new Wd(e,r)}return this._fbos[t]}get hasDirty(){const e=this.dirtyStart;return this.dirtyEnd>=e}updateTexture(e,t){try{const r=this.dirtyStart,n=this.dirtyEnd;if(!this.hasDirty)return;yi("esri-2d-update-debug")&&console.debug(`Version[${t}] AttributeStoreView.updateTexture`,{start:r,end:n,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const s=this.data.buffer,o=this.getTexture(e),a=4,l=(r-r%this.size)/this.size,u=(n-n%this.size)/this.size,c=l,h=this.size,p=u,m=l*this.size*a,v=(h+p*this.size)*a-m,w=Bee(this.pixelType),S=new w(s,m*w.BYTES_PER_ELEMENT,v),I=this.size,R=p-c+1;if(R>this.size)return void kgn().error(new qe("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,c,I,R,S)}catch{}}update(e){const{data:t,start:r,end:n}=e;if(t!=null&&this.data!=null){const s=this.data,o=r*this.texelSize;for(let a=0;ar!=null?new p1t(r,this.size,n):null);else for(let r=0;r{yi("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",r)}),this._version=e.version,this._pendingAttributeUpdates.push({inner:e,resolver:t}),yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:e})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const e=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:t,resolver:r}of e){const{blockData:n,initArgs:s,sendUpdateEpoch:o,version:a}=t;yi("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${o}] AttributeStoreView.applyUpdate`),this._version=a,this._epoch=o,s!=null&&this._initialize(s);const l=this._data;for(let u=0;u{switch(i.BYTES_PER_ELEMENT){case 1:return Ti.UNSIGNED_BYTE;case 2:return Ti.UNSIGNED_SHORT;case 4:return Ti.UNSIGNED_INT;default:throw new qe("Cannot get DataType of array")}},$gn=(i,e,t,r)=>{let n=0;for(let s=1;s0:n<0},f1t=({coords:i,lengths:e},t)=>{const r=[];for(let n=0,s=0;n({...r,[n]:Aa.createVertex(e,t,this.vertices[n])}),{})),this._cache.vertexBuffers}};const Tpe=i=>parseFloat(i)/100;let Bgn=class qYt extends eM{constructor(e,t){super(),this._clip=t,this._cache={},this.stage=e,this._handle=Ki(()=>t.version,()=>this._invalidate()),this.ready()}static fromClipArea(e,t){return new qYt(e,t)}_destroyGL(){this._cache.mesh!=null&&(this._cache.mesh.destroy(),this._cache.mesh=null),this._cache.vao!=null&&(this._cache.vao.dispose(),this._cache.vao=null)}destroy(){this._destroyGL(),this._handle.remove()}getVAO(e,t,r,n){const[s,o]=t.size;if(this._clip.type!=="geometry"&&this._lastWidth===s&&this._lastHeight===o||(this._lastWidth=s,this._lastHeight=o,this._destroyGL()),this._cache.vao==null){const a=this._createMesh(t,this._clip),l=a.getIndexBuffer(e),u=a.getVertexBuffers(e);this._cache.mesh=a,this._cache.vao=new wh(e,r,n,u,l)}return this._cache.vao}_createTransforms(){return{displayViewScreenMat3:Cc()}}_invalidate(){this._destroyGL(),this.requestRender()}_createScreenRect(e,t){const[r,n]=e.size,s=typeof t.left=="string"?Tpe(t.left)*r:t.left,o=typeof t.right=="string"?Tpe(t.right)*r:t.right,a=typeof t.top=="string"?Tpe(t.top)*n:t.top,l=typeof t.bottom=="string"?Tpe(t.bottom)*n:t.bottom,u=s,c=a;return{x:u,y:c,width:Math.max(r-o-u,0),height:Math.max(n-l-c,0)}}_createMesh(e,t){switch(t.type){case"rect":return Spe.fromRect(this._createScreenRect(e,t));case"path":return Spe.fromPath(t);case"geometry":return Spe.fromGeometry(e,t);default:return di.getLogger("esri.views.2d.engine.webgl.ClippingInfo").error(new qe("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),Spe.fromRect({x:0,y:0,width:1,height:1})}}},Vle=class extends WCe{set clips(e){super.clips=e,this._updateClippingInfo(e)}renderChildren(e){e.painter.setPipelineState(null),this._renderPasses==null&&(this._renderPasses=this.prepareRenderPasses(e.painter));for(const t of this._renderPasses)try{t.render(e)}catch{}}prepareRenderPasses(e){return[e.registerRenderPass({name:"clip",brushes:[Lq.clip],target:()=>this._clippingInfos,drawPhase:aa.MAP|aa.LABEL|aa.LABEL_ALPHA|aa.DEBUG|aa.HIGHLIGHT})]}_updateClippingInfo(e){this._clippingInfos!=null&&(this._clippingInfos.forEach(t=>t.destroy()),this._clippingInfos=null),e!=null&&e.length&&(this._clippingInfos=e.items.map(t=>Bgn.fromClipArea(this.stage,t))),this.requestRender()}};const jgn=(i,e)=>i.key.level-e.key.level!=0?i.key.level-e.key.level:i.key.row-e.key.row!=0?i.key.row-e.key.row:i.key.col-e.key.col;let Hle=class extends Vle{constructor(e){super(),this._tileInfoView=e}renderChildren(e){this.sortChildren(jgn),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,r=super.createRenderParams(e);return r.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,r.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),r}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[Xqt],drawPhase:aa.DEBUG|aa.MAP|aa.HIGHLIGHT|aa.LABEL,target:()=>this.getStencilTarget()})),yi("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[tYt],drawPhase:aa.DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}setStencilReference(e){let t=1;for(const r of this.children)r.stencilRef=t++}},YYt=class extends Hle{constructor(e){super(e),this._statisticsByLevel=new Map,this.attributeView=new Lgn}destroy(){this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloat"),super.doRender(e)}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}},E7e=class{constructor(e,t,r,n,s){this._instanceId=e,this.techniqueRef=t,this._meshWriterName=r,this._input=n,this.optionalAttributes=s}get instanceId(){return this._instanceId}createMeshInfo(e){return{id:this._instanceId,meshWriterName:this._meshWriterName,options:e,optionalAttributes:this.optionalAttributes}}getInput(){return this._input}setInput(e){this._input=e}},Ggn=0;function Qj(i,e,t){return new E7e(Ggn++,i,i.meshWriter.name,e,t)}const eG={geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null}};let Ugn=class{constructor(){this.instances={fill:Qj(Sc.fill,eG,{zoomRange:!0}),marker:Qj(Sc.marker,eG,{zoomRange:!0}),line:Qj(Sc.line,eG,{zoomRange:!0}),text:Qj(Sc.text,eG,{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}),complexFill:Qj(Sc.complexFill,eG,{zoomRange:!0}),texturedLine:Qj(Sc.texturedLine,eG,{zoomRange:!0})},this._instancesById=Object.values(this.instances).reduce((e,t)=>(e.set(t.instanceId,t),e),new Map)}getInstance(e){return this._instancesById.get(e)}};const zgn=Math.PI/180,Vgn=4;let Hgn=class extends eM{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=Cc(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=ba(this._program)}doRender(e){const{context:t}=e,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,r),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const n=this._program;t.bindVAO(this._vao),t.useProgram(n),n.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(Eo.LINES,8*r.length,Ti.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{displayViewScreenMat3:Cc()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; uniform mat3 u_dvsMat3; attribute vec2 a_position; @@ -5009,55 +5009,55 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre }`,r=`precision mediump float; void main() { gl_FragColor = vec4(0.75, 0.0, 0.0, 0.75); - }`;this._program=e.programCache.acquire(t,r,m1t().attributes)}_updateMatricesAndLocalOrigin(e){const{state:t}=e,{displayMat3:r,size:n,resolution:s,pixelRatio:o,rotation:a,viewpoint:l}=t,u=Wgn*a,{x:c,y:h}=l.targetGeometry,p=cHe(c,t.spatialReference);this._localOrigin.x=p,this._localOrigin.y=h;const m=o*n[0],v=o*n[1],w=s*m,S=s*v,I=Jk(this._dvsMat3);n_(I,I,r),h0(I,I,Xp(m/2,v/2)),_R(I,I,m7(n[0]/w,-v/S,1)),q3(I,I,-u)}_updateBufferData(e,t){const{x:r,y:n}=this._localOrigin,s=2*qgn*t.length,o=new Float32Array(s),a=new Uint32Array(8*t.length);let l=0,u=0;for(const c of t)c&&(o[2*l]=c[0]-r,o[2*l+1]=c[1]-n,o[2*l+2]=c[0]-r,o[2*l+3]=c[3]-n,o[2*l+4]=c[2]-r,o[2*l+5]=c[3]-n,o[2*l+6]=c[2]-r,o[2*l+7]=c[1]-n,a[u]=l+0,a[u+1]=l+3,a[u+2]=l+3,a[u+3]=l+2,a[u+4]=l+2,a[u+5]=l+1,a[u+6]=l+1,a[u+7]=l+0,l+=4,u+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=Aa.createVertex(e,oa.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=Aa.createIndex(e,oa.DYNAMIC_DRAW,a),!this._vao){const c=m1t();this._vao=new wh(e,c.attributes,c.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}};const m1t=()=>xCe("bounds",{geometry:[{location:0,name:"a_position",count:2,type:Ti.FLOAT}]});let XYt=class extends YYt{constructor(e){super(e),this._instanceStore=new Hgn,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=zo(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new Ygn(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.onMessage(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children){if(!r.visible)continue;r.getDisplayList(e.drawPhase,this._instanceStore,OR.STRICT_ORDER)?.render(e)}}},QA=class extends XYt{renderChildren(e){for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.attributeView.update(),this.children.some(t=>t.hasData)){switch(e.drawPhase){case aa.MAP:this._renderChildren(e,ax.All);break;case aa.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){$Ke(e,!1,t=>{this._renderChildren(t,ax.Highlight)})}};const Cpe="esri-zoom-box",Epe={container:`${Cpe}__container`,overlay:`${Cpe}__overlay`,background:`${Cpe}__overlay-background`,box:`${Cpe}__outline`},aRe={zoom:"Shift",counter:"Ctrl"};let mte=class extends un{constructor(e){super(e),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(e){this.removeAllHandles(),this._destroyOverlay(),this._set("view",e),e&&this.addHandles([e.on("drag",[aRe.zoom],t=>this._handleDrag(t,1),zA.INTERNAL),e.on("drag",[aRe.zoom,aRe.counter],t=>this._handleDrag(t,-1),zA.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(e,t,r,n){this._box.x=e,this._box.y=t,this._box.width=r,this._box.height=n,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(e,t,r,n,s){const o=this.view,a=o.toMap(Vd(e+.5*r,t+.5*n));let l=Math.max(r/o.width,n/o.height);s===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:a,scale:o.scale*l})}_updateBox(e,t,r,n){const s=this._boxShape;s.setAttributeNS(null,"x",""+e),s.setAttributeNS(null,"y",""+t),s.setAttributeNS(null,"width",""+r),s.setAttributeNS(null,"height",""+n),s.setAttributeNS(null,"class",Epe.box)}_updateBackground(e,t,r,n){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(e,t,r,n,this.view.width,this.view.height))}_createContainer(){const e=document.createElement("div");e.className=Epe.container,this.view.root.appendChild(e),this._container=e}_createOverlay(){const e=this.view.width,t=this.view.height,r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M 0 0 L "+e+" 0 L "+e+" "+t+" L 0 "+t+" Z"),r.setAttributeNS(null,"class",Epe.background);const n=document.createElementNS("http://www.w3.org/2000/svg","rect"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),s.setAttributeNS(null,"class",Epe.overlay),s.appendChild(r),s.appendChild(n),this._container.appendChild(s),this._backgroundShape=r,this._boxShape=n,this._overlay=s}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(e,t,r,n,s,o){const a=e+r,l=t+n;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+e+" "+t+" L "+e+" "+l+" L "+a+" "+l+" L "+a+" "+t+" Z"}_handleDrag(e,t){const r=e.x,n=e.y,s=e.origin.x,o=e.origin.y;let a,l,u,c;switch(r>s?(a=s,u=r-s):(a=r,u=s-r),n>o?(l=o,c=n-o):(l=n,c=o-n),e.action){case"start":this._start();break;case"update":this._update(a,l,u,c);break;case"end":this._end(a,l,u,c,t)}e.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:e,y:t,width:r,height:n}=this._box;this._updateBox(e,t,r,n),this._updateBackground(e,t,r,n),this._rafId=requestAnimationFrame(this._redraw)}};x([D()],mte.prototype,"navigation",void 0),x([D()],mte.prototype,"view",null),mte=x([Qe("esri.views.2d.navigation.ZoomBox")],mte);const Xgn=mte;let E5=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const t=this.computeDelta(e);this._updateDelta(t)}this.lastValue=e}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(e){return this.lastValue===void 0?NaN:e-this.lastValue}_updateDelta(e){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*e:this.filteredDelta=e}},VKe=class{constructor(e,t,r){this._initialVelocity=e,this._stopVelocity=t,this._friction=r,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,t){const r=this.value(e);return this.value(e+t)-r}valueFromInitialVelocity(e,t){t=Math.min(t,this.duration);const r=1-this.friction;return e*(r**t-1)/Math.log(r)}},Jgn=class extends VKe{constructor(e,t,r,n,s){super(e,t,r),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},Kgn=class{constructor(e=300,t=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=r,this.enabled=!0,this._time=new E5(.6),this._screen=[new E5(.4),new E5(.4)],this._scene=[new E5(.6),new E5(.6),new E5(.6)],this._tmpDirection=gr()}add(e,t,r){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(r)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(t[0]),this._scene[1].update(t[1]),this._scene[2].update(t[2]),this._time.update(r)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,t=this._screen[1].filteredDelta,r=e==null||t==null?0:Math.sqrt(e*e+t*t),n=this._time.filteredDelta,s=n==null||r==null?0:r/n;return Math.abs(s)0&&Gc(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new Jgn(e,t,r,s==null?0:n/s,this._tmpDirection)}},KU=class extends un{constructor(e){super(e),this.animationTime=0,this.momentumEstimator=new Kgn(500,6,.92),this.momentum=null,this.tmpMomentum=gr(),this.momentumFinished=!1,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this._previousDrag=null,v0(()=>this.momentumFinished,()=>this.navigation.stop())}begin(e,t){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(t),this._previousDrag=t}update(e,t){this.addToEstimator(t);let r=t.center.x,n=t.center.y;const s=this._previousDrag;r=s?s.center.x-r:-r,n=s?n-s.center.y:n,e.viewpoint=ok(this.viewpoint,e.viewpoint,[r||0,n||0]),this._previousDrag=t}end(e,t){this.addToEstimator(t);const r=e.navigation.momentumEnabled;this.momentum=r?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(e),this._previousDrag=null,this.navigation.end()}addToEstimator(e){const t=e.center.x,r=e.center.y,n=IQi(-t,r),s=Do(-t,r,0);this.momentumEstimator.add(n,s,.001*e.timestamp)}onAnimationUpdate(e){this.navigation.animationManager?.animateContinous(e.viewpoint,(t,r)=>{const{momentum:n,animationTime:s,tmpMomentum:o}=this,a=.001*r;if(!(this.momentumFinished=!n||n.isFinished(s))){const l=n.valueDelta(s,a);Gc(o,n.direction,l),ok(t,t,o),e.constraints.constrainByGeometry(t)}this.animationTime+=a})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};x([D()],KU.prototype,"momentumFinished",void 0),x([D()],KU.prototype,"viewpoint",void 0),x([D()],KU.prototype,"navigation",void 0),KU=x([Qe("esri.views.2d.navigation.actions.Pan")],KU);const Zgn=KU;let JYt=class{constructor(e=2.5,t=.01,r=.95,n=12){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=r,this._maxVelocity=n,this.enabled=!0,this.value=new E5(.8),this.time=new E5(.3)}add(e,t){if(this.enabled&&t!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(t)<.01)return;if(this.value.hasFilteredDelta()){const r=this.value.computeDelta(e);this.value.filteredDelta*r<0&&this.value.reset()}}this.time.update(t),this.value.update(e)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let e=this.value.filteredDelta/this.time.filteredDelta;return e=uu(e,-this._maxVelocity,this._maxVelocity),Math.abs(e)Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;e=r+n}super.add(e,t)}},eyn=class extends VKe{constructor(e,t,r){super(e,t,r)}value(e){const t=super.value(e);return Math.exp(t)}valueDelta(e,t){const r=super.value(e),n=super.value(e+t)-r;return Math.exp(n)}},tyn=class extends JYt{constructor(e=2.5,t=.01,r=.95,n=12){super(e,t,r,n)}add(e,t){super.add(Math.log(e),t)}createMomentum(e,t,r){return new eyn(e,t,r)}},ZU=class extends un{constructor(e){super(e),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new Qgn(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new tyn,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this.addHandles(v0(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(e,t){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=t.angle,this._previousRadius=this._startRadius=t.radius,this._previousCenter=t.center,this._updateTimestamp=null,e.constraints.rotationEnabled&&this.addToRotateEstimator(0,t.timestamp),this.addToZoomEstimator(t,1)}update(e,t){this._updateTimestamp===null&&(this._updateTimestamp=t.timestamp);const r=t.angle,n=t.radius,s=t.center,o=Math.abs(180*(r-this._startAngle)/Math.PI),a=Math.abs(n-this._startRadius),l=this._startRadius/n;if(this._previousRadius&&this._previousCenter){const u=n/this._previousRadius;let c=180*(r-this._previousAngle)/Math.PI;this._rotationDirection=c>=0?1:-1,this._zoomDirection=u>=1?1:-1,e.constraints.rotationEnabled?(this._zoomOnly===null&&t.timestamp-this._updateTimestamp>200&&(this._zoomOnly=a-o>0),this._zoomOnly===null||this._zoomOnly?c=0:this.addToRotateEstimator(r-this._startAngle,t.timestamp)):c=0,this.addToZoomEstimator(t,l),this.navigation.setViewpoint([s.x,s.y],1/u,c,[this._previousCenter.x-s.x,s.y-this._previousCenter.y])}this._previousAngle=r,this._previousRadius=n,this._previousCenter=s}end(e){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(e),this.navigation.end()}addToRotateEstimator(e,t){this._rotationMomentumEstimator.add(e,.001*t)}addToZoomEstimator(e,t){this._zoomMomentumEstimator.add(t,.001*e.timestamp)}canZoomIn(e){const t=e.scale,r=e.constraints.effectiveMaxScale;return r===0||t>r}canZoomOut(e){const t=e.scale,r=e.constraints.effectiveMinScale;return r===0||t{const n=!this.canZoomIn(e)&&this._zoomDirection>1||!this.canZoomOut(e)&&this._zoomDirection<1,s=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=n||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),a=.001*r;if(this._momentumFinished=s&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,a))*this._rotationDirection*180/Math.PI:0;let u=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,a)):1;const c=Ja(),h=Ja();if(this._previousCenter){dl(c,this._previousCenter.x,this._previousCenter.y),dWe(h,e.size,e.padding),lWe(c,c,h);const{constraints:p,scale:m}=e,v=m*u;u<1&&!p.canZoomInTo(v)?(u=m/p.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):u>1&&!p.canZoomOutTo(v)&&(u=m/p.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),yWe(t,e.viewpoint,u,l,c,e.size),e.constraints.constrainByGeometry(t)}}this._animationTime+=a})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};x([D()],ZU.prototype,"_momentumFinished",void 0),x([D()],ZU.prototype,"viewpoint",void 0),x([D()],ZU.prototype,"navigation",void 0),ZU=x([Qe("esri.views.2d.navigation.actions.Pinch")],ZU);const iyn=ZU,lRe=Ja(),g1t=Ja();let gte=class extends un{constructor(e){super(e),this._previousCenter=Ja(),this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0})}begin(e,t){this.navigation.begin(),dl(this._previousCenter,t.center.x,t.center.y)}update(e,t){const{state:{size:r,padding:n}}=e;dl(lRe,t.center.x,t.center.y),i5t(g1t,r,n),e.viewpoint=LNe(this.viewpoint,e.state.paddedViewState.viewpoint,r5t(g1t,this._previousCenter,lRe)),kW(this._previousCenter,lRe)}end(){this.navigation.end()}};x([D()],gte.prototype,"viewpoint",void 0),x([D()],gte.prototype,"navigation",void 0),gte=x([Qe("esri.views.2d.actions.Rotate")],gte);const ryn=gte,tG=10,y1t=1,uRe=new Ab({targetGeometry:new $i}),cRe=[0,0],v1t=250;let NI=class extends un{constructor(e){super(e),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new Zgn({navigation:this}),this.rotate=new ryn({navigation:this}),this.pinch=new iyn({navigation:this}),this.zoomBox=new Xgn({view:this.view,navigation:this})}destroy(){this.pan=zo(this.pan),this.rotate=zo(this.rotate),this.pinch=zo(this.pinch),this.zoomBox=zo(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(v1t)}async zoom(e,t=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return e<1?this.zoomIn(t):this.zoomOut(t);this.setViewpoint(t,e,0,[0,0])}async zoomIn(e){const t=this.view,r=t.constraints.snapToNextScale(t.scale);return this._zoomToScale(r,e)}async zoomOut(e){const t=this.view,r=t.constraints.snapToPreviousScale(t.scale);return this._zoomToScale(r,e)}setViewpoint(e,t,r,n){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,e,t,r,n),this.end()}setViewpointImmediate(e,t=0,r=[0,0],n=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,e,t,r)}continousRotateClockwise(){const e=this.view.viewpoint;this.animationManager?.animateContinous(e,t=>{LNe(t,t,-y1t)})}continousRotateCounterclockwise(){const e=this.view.viewpoint;this.animationManager?.animateContinous(e,t=>{LNe(t,t,y1t)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continousPanLeft(){this._continuousPan([-tG,0])}continousPanRight(){this._continuousPan([tG,0])}continousPanUp(){this._continuousPan([0,tG])}continousPanDown(){this._continuousPan([0,-tG])}continuousPanVector({x:e,y:t}){this._continuousPan([e*tG,t*tG])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(e){const t=this.view.viewpoint;this.animationManager?.animateContinous(t,r=>{ok(r,r,e),this.view.constraints.constrainByGeometry(r)})}_startTimer(e){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const t=performance.now()-(this._lastEventTimestamp??0);ts&&!c))return olt(uRe,o,e/s,0,t,a,l),n.constrainByGeometry(uRe),r.goTo(uRe,{animate:!0,pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(e,t,r,n,s){const{view:o}=this,{size:a,padding:l,constraints:u,scale:c,viewpoint:h}=o,p=c*r,m=u.canZoomInTo(p),v=u.canZoomOutTo(p);return(r<1&&!m||r>1&&!v)&&(r=1),ok(h,h,s),olt(e,h,r,n,t,a,l),u.constrainByGeometry(e)}};x([D()],NI.prototype,"animationManager",void 0),x([D({type:Boolean,readOnly:!0})],NI.prototype,"interacting",void 0),x([D()],NI.prototype,"pan",void 0),x([D()],NI.prototype,"pinch",void 0),x([D()],NI.prototype,"rotate",void 0),x([D()],NI.prototype,"view",void 0),x([D()],NI.prototype,"zoomBox",void 0),NI=x([Qe("esri.views.2d.navigation.MapViewNavigation")],NI);const nyn=NI,KYt={shaders:{vertexShader:Rm("magnifier/magnifier.vert"),fragmentShader:Rm("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function syn(i){return R3(i,KYt)}async function awe(i,e){const{data:t}=await zi(i,{responseType:"image",...e});return t}async function oyn(i){const e=Promise.resolve().then(()=>bJn),t=Promise.resolve().then(()=>xJn),r=awe((await e).default,{signal:i}),n=awe((await t).default,{signal:i}),s={mask:await r,overlay:await n};return hn(i),s}let ayn=class extends eM{constructor(){super(),this._handles=new cY,this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles=zo(this._handles),this._disposeRenderResources(),this._resourcesTask=zF(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([Ki(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},js),Ki(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),Ki(()=>e.size,()=>{this._disposeRenderResources(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Cc()}}doRender(e){const t=e.context;if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==aa.MAP||!this._canRender())return;this._updateResources(e);const r=this._magnifier;if(r.position==null)return;const n=e.pixelRatio,s=r.size*n,o=1/r.factor,a=Math.ceil(o*s);this._readbackTexture.resize(a,a);const{size:l}=e.state,u=n*l[0],c=n*l[1],h=.5*a,p=.5*a,m=uu(n*r.position.x,h,u-h-1),v=uu(c-n*r.position.y,p,c-p-1);t.setBlendingEnabled(!0);const w=m-h,S=v-p,I=this._readbackTexture;t.bindTexture(I,0),t.gl.copyTexImage2D(I.descriptor.target,0,I.descriptor.pixelFormat,w,S,a,a,0);const R=this.backgroundColor,L=R?[R.a*R.r/255,R.a*R.g/255,R.a*R.b/255,R.a]:[1,1,1,1],k=(m+r.offset.x*n)/u*2-1,B=(v-r.offset.y*n)/c*2-1,$=s/u*2,V=s/c*2,Y=this._program;t.bindVAO(this._vertexArrayObject),t.bindTexture(this._overlayTexture,6),t.bindTexture(this._maskTexture,7),t.useProgram(Y),Y.setUniform4fv("u_background",L),Y.setUniform1i("u_readbackTexture",0),Y.setUniform1i("u_overlayTexture",6),Y.setUniform1i("u_maskTexture",7),Y.setUniform4f("u_drawPos",k,B,$,V),Y.setUniform1i("u_maskEnabled",r.maskEnabled?1:0),Y.setUniform1i("u_overlayEnabled",r.overlayEnabled?1:0),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawArrays(Eo.TRIANGLE_STRIP,0,4),t.bindVAO()}_canRender(){return this.mask&&this.overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=pE(async r=>{const n=e==null||t==null?oyn(r):null,s=e!=null?zi(e,{responseType:"image",signal:r}).then(u=>u.data):n.then(u=>u.mask),o=t!=null?zi(t,{responseType:"image",signal:r}).then(u=>u.data):n.then(u=>u.overlay),[a,l]=await Promise.all([s,o]);this.mask=a,this.overlay=l,this._disposeRenderResources(),this.requestRender()})}_disposeRenderResources(){this._readbackTexture=ba(this._readbackTexture),this._overlayTexture=ba(this._overlayTexture),this._maskTexture=ba(this._maskTexture),this._vertexArrayObject=ba(this._vertexArrayObject),this._program=ba(this._program)}_updateResources(e){if(e.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources(),this._readbackTexture)return;const t=e.context;this._resourcePixelRatio=e.pixelRatio;const r=Math.ceil(this._magnifier.size*e.pixelRatio);this._program=syn(t);const n=new Uint16Array([0,1,0,0,1,1,1,0]),s=KYt.attributes;this._vertexArrayObject=new wh(t,s,Yqt,{geometry:Aa.createVertex(t,oa.STATIC_DRAW,n)}),this.overlay.width=r,this.overlay.height=r;const o=new Ua;o.internalFormat=ks.RGBA,o.wrapMode=Ls.CLAMP_TO_EDGE,o.samplingMode=Is.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!zWi(this.overlay.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new fl(t,o,this.overlay),this.mask.width=r,this.mask.height=r,o.pixelFormat=o.internalFormat=ks.ALPHA,this._maskTexture=new fl(t,o,this.mask);const a=1/this._magnifier.factor;o.pixelFormat=o.internalFormat=ks.RGBA,o.width=o.height=Math.ceil(a*r),o.samplingMode=Is.LINEAR,o.flipped=!1,this._readbackTexture=new fl(t,o)}};const ZYt=Object.freeze(Object.defineProperty({__proto__:null,GraphicContainer:QA,GraphicsView2D:Tx,get LabelManager(){return JU},MagnifierView2D:ayn,MapViewNavigation:nyn,Stage:Ymn},Symbol.toStringTag,{value:"Module"}));let QYt=class{constructor(e,t,r){this.pixelBlock=e,this.extent=t,this.originalPixelBlock=r}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(e){const t=this.pixelBlock;if(t==null)return;const r=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??t});if(r.pixelBlock==null)return;r.pixelBlock.maskIsAlpha&&(r.pixelBlock.premultiplyAlpha=!0);const n=r.pixelBlock.getAsRGBA(),s=e.createImageData(r.pixelBlock.width,r.pixelBlock.height);s.data.set(n),e.putImageData(s,0,0)}getRenderedRasterPixels(){const e=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return e.pixelBlock==null?null:(e.pixelBlock.maskIsAlpha&&(e.pixelBlock.premultiplyAlpha=!0),{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)})}};function eXt(i){return i&&"render"in i}function tXt(i){const e=document.createElement("canvas");return e.width=i.width,e.height=i.height,i.render(e.getContext("2d")),e}function lyn(i){return eXt(i)?i instanceof QYt?i.getRenderedRasterPixels()?.renderedRasterPixels:tXt(i):i}let HKe=class extends eM{constructor(e=null,t=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=t,this.source=e,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(e){this._height=e}get source(){return this._source}set source(e){e==null&&this._source==null||(this._source=e,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(e){this._width=e}beforeRender(e){super.beforeRender(e),this.updateTexture(e)}async setSourceAsync(e,t){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const r=new AbortController,n=ac();return ZH(t,()=>r.abort()),ZH(r,s=>n.reject(s)),this._uploadStatus={controller:r,resolver:n},this.source=e,n.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(e,t){e>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(e,t)}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,t){this._texture&&e.bindTexture(this._texture,t)}async updateTexture({context:e,painter:t}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(e)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const r=lyn(this.source);try{if(this._uploadStatus!=null){const{controller:n,resolver:s}=this._uploadStatus,o={signal:n.signal},{width:a,height:l}=this,u=this._texture;await t.textureUploadManager.enqueueTextureUpdate({data:r,texture:u,width:a,height:l},o),s.resolve(),this._uploadStatus=null}else this._texture.setData(r);this.ready()}catch(n){l3(n)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:Cc()}}_createTexture(e){const t=this.immutable,r=new Ua;return r.internalFormat=t?gs.RGBA8:ks.RGBA,r.wrapMode=Ls.CLAMP_TO_EDGE,r.isImmutable=t,r.width=this._sourceWidth,r.height=this._sourceHeight,new fl(e,r)}},uyn=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.bitmap=new HKe(a),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},cyn=class extends Hle{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),r=this._tileInfoView.getTileResolution(e.level),[n,s]=this._tileInfoView.tileInfo.size;return new uyn(e,r,t[0],t[3],n,s)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[Lq.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&super.doRender(e)}};const iXt=i=>{let e=class extends i{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new cyn(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return e=x([Qe("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};let qye=class extends Ci{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};x([D({readOnly:!0})],qye.prototype,"version",null),qye=x([Qe("esri.views.layers.support.ClipArea")],qye);const WKe=qye;var I7e;let Z$=I7e=class extends WKe{constructor(i){super(i),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new I7e({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"left",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"right",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"top",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"bottom",void 0),Z$=I7e=x([Qe("esri.views.layers.support.ClipRect")],Z$);const hyn=Z$;var A7e;const dyn={base:Nr,key:"type",typeMap:{extent:hr,polygon:$s}};let Yye=A7e=class extends WKe{constructor(i){super(i),this.type="geometry",this.geometry=null}clone(){return new A7e({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};x([D({types:dyn,json:{read:Ro,write:!0}})],Yye.prototype,"geometry",void 0),Yye=A7e=x([Qe("esri.views.layers.support.Geometry")],Yye);const rXt=Yye;let Xye=class extends WKe{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};x([D({type:[[[Number]]],json:{write:!0}})],Xye.prototype,"path",void 0),Xye=x([Qe("esri.views.layers.support.Path")],Xye);const pyn=Xye,hRe=dr.ofType({key:"type",base:null,typeMap:{rect:hyn,path:pyn,geometry:rXt}}),Lm=i=>{let e=class extends i{constructor(){super(...arguments),this.attached=!1,this.clips=new hRe,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){const t=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new qe("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new WCe),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([Ki(()=>this.suspended,n=>{this.container&&(this.container.visible=!n)},Ah),Ki(()=>this.updateSuspended,n=>{this.view&&!n&&this.updateRequested&&this.view.requestUpdate()},Ah),Ki(()=>this.layer?.opacity??1,n=>{this.container&&(this.container.opacity=n)},Ah),Ki(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",n=>{this.container&&(this.container.blendMode=n)},Ah),Ki(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,n=>{this.container&&(this.container.effect=n)},Ah),Ki(()=>this.highlightOptions,n=>this.container.highlightOptions=n,Ah),ju(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},Ah),Ki(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:n})=>{const s=n!=null&&this.isVisibleAtScale(n);s!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",s)},Ah)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(n=>{n===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){const t=this.view?.spatialReference;return t==null||this.supportsSpatialReference(t)}get updateSuspended(){return this.suspended}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}isVisibleAtScale(t){const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!r)return!0;const{minScale:n,maxScale:s}=r;return vDt(t,n,s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,r){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),r=!this.spatialReferenceSupported,n=this.visibleAtCurrentScale;return r&&(t.spatialReferenceNotSupported=r),n&&(t.outsideScaleRange=n),t}addAttachHandles(t){this.addHandles(t,"attach")}};return x([D()],e.prototype,"attached",void 0),x([D({type:hRe,set(t){const r=ay(t,this._get("clips"),hRe);this._set("clips",r)}})],e.prototype,"clips",void 0),x([D()],e.prototype,"container",void 0),x([D()],e.prototype,"moving",void 0),x([D({readOnly:!0})],e.prototype,"spatialReferenceSupported",null),x([D({readOnly:!0})],e.prototype,"updateParameters",void 0),x([D()],e.prototype,"updateRequested",void 0),x([D()],e.prototype,"updateSuspended",null),x([D()],e.prototype,"updating",null),x([D()],e.prototype,"view",void 0),x([D({readOnly:!0})],e.prototype,"visibleAtCurrentScale",void 0),x([D({type:tse})],e.prototype,"highlightOptions",void 0),e=x([Qe("esri.views.2d.layers.LayerView2D")],e),e};let M7e=class extends XYt{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===aa.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),$Ke(e,!0,t=>{this._renderChildren(t,ax.All)}))}};M7e=x([Qe("esri.views.2d.layers.support.HighlightGraphicContainer")],M7e);const qKe=M7e;function fyn(i){return i instanceof HTMLImageElement?i.naturalWidth:i.width}function myn(i){return i instanceof HTMLImageElement?i.naturalHeight:i.height}function lwe(i,e,t,r){if(t.level===r.level)return e;const n=i.tileInfo.size,s=i.getTileResolution(t.level),o=i.getTileResolution(r.level);let a=i.getLODInfoAt(r.level);const l=a.getXForColumn(r.col),u=a.getYForRow(r.row);a=i.getLODInfoAt(t.level);const c=a.getXForColumn(t.col),h=a.getYForRow(t.row),p=fyn(e)/n[0],m=myn(e)/n[1],v=Math.round(p*((l-c)/s)),w=Math.round(m*(-(u-h)/s)),S=Math.round(p*n[0]*(o/s)),I=Math.round(m*n[1]*(o/s)),R=O7e(n);return R.getContext("2d").drawImage(e,v,w,S,I,0,0,n[0],n[1]),R}function O7e(i){const e=document.createElement("canvas");return[e.width,e.height]=i,e}let Aw=class extends iT(U3(rd.EventedMixin(un))){constructor(e){super(e),this._updatingHandles=new Mb,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const t=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";di.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=zo(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready||!1}getSuspendInfo(){const e=this.parent?.suspended?this.parent.suspendInfo:{};return this.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};x([D()],Aw.prototype,"fullOpacity",null),x([D()],Aw.prototype,"layer",void 0),x([D()],Aw.prototype,"parent",void 0),x([D({readOnly:!0})],Aw.prototype,"suspended",null),x([D({readOnly:!0})],Aw.prototype,"suspendInfo",null),x([D({readOnly:!0})],Aw.prototype,"legendEnabled",null),x([D({type:Boolean,readOnly:!0})],Aw.prototype,"updating",null),x([D({readOnly:!0})],Aw.prototype,"updatingProgress",null),x([D()],Aw.prototype,"visible",null),x([D()],Aw.prototype,"view",void 0),Aw=x([Qe("esri.views.layers.LayerView")],Aw);const Nm=Aw,hL=i=>{let e=class extends i{initialize(){this.addHandles(ju(()=>this.layer,"refresh",t=>{this.doRefresh(t.dataChanged).catch(r=>{mo(r)||di.getLogger(this).error(r)})}),"RefreshableLayerView")}};return e=x([Qe("esri.layers.mixins.RefreshableLayerView")],e),e};function dRe(i,e){return e?"xoffset"in e&&e.xoffset?Math.max(i,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(i,Math.abs(e.yoffset||0)):i:i}function gyn(i){let e=0,t=0;for(let r=0;ro.type==="size").map(o=>{const{maxSize:a,minSize:l}=o;return(_1t(a,i)+_1t(l,i))/2});let r=0;const n=t.length;if(n===0)return i;for(let o=0;o{s=dRe(s,o.symbol)}),s}if(e.type==="class-breaks"){let s=n;return e.classBreakInfos.forEach(o=>{s=dRe(s,o.symbol)}),s}return e.type==="dot-density"||e.type,n}function vyn(i,e){const{dpi:t,gdbVersion:r,geometry:n,geometryPrecision:s,height:o,historicMoment:a,layerOption:l,mapExtent:u,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:m,returnZ:v,spatialReference:w,timeExtent:S,tolerance:I,width:R}=i.toJSON(),{dynamicLayers:L,layerDefs:k,layerIds:B}=_yn(i),$=e?.geometry!=null?e.geometry:null,V={historicMoment:a,geometryPrecision:s,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:m,returnZ:v,tolerance:I},Y=$&&$.toJSON()||n;V.imageDisplay=`${R},${o},${t}`,r&&(V.gdbVersion=r),Y&&(delete Y.spatialReference,V.geometry=JSON.stringify(Y),V.geometryType=ah(Y));const K=w??Y?.spatialReference??u?.spatialReference;if(K&&(V.sr=Hv(K)),V.time=S?[S.start,S.end].join(","):null,u){const{xmin:Q,ymin:re,xmax:ne,ymax:de}=u;V.mapExtent=`${Q},${re},${ne},${de}`}return k&&(V.layerDefs=k),L&&!k&&(V.dynamicLayers=L),V.layers=l==="popup"?"visible":l,B&&!L&&(V.layers+=`:${B.join(",")}`),V}function _yn(i){const{mapExtent:e,floors:t,width:r,sublayers:n,layerIds:s,layerOption:o,gdbVersion:a}=i,l=n?.find(v=>v.layer!=null)?.layer?.serviceSublayers,u=o==="popup",c={},h=M1e({extent:e,width:r,spatialReference:e?.spatialReference}),p=[],m=v=>{const w=h===0,S=v.minScale===0||h<=v.minScale,I=v.maxScale===0||h>=v.maxScale;if(v.visible&&(w||S&&I))if(v.sublayers)v.sublayers.forEach(m);else{if(s?.includes(v.id)===!1||u&&(!v.popupTemplate||!v.popupEnabled))return;p.unshift(v)}};if(n?.forEach(m),n&&!p.length)c.layerIds=[];else{const v=NDt(p,l,a),w=p.map(S=>{const I=Yne(t,S);return S.toExportImageJSON(I)});if(v)c.dynamicLayers=JSON.stringify(w);else{if(n){let I=p.map(({id:R})=>R);s&&(I=I.filter(R=>s.includes(R))),c.layerIds=I}else s?.length&&(c.layerIds=s);const S=byn(t,p);if(S!=null&&S.length){const I={};for(const R of S)R.definitionExpression&&(I[R.id]=R.definitionExpression);Object.keys(I).length&&(c.layerDefs=JSON.stringify(I))}}}return c}function byn(i,e){const t=!!i?.length,r=e.filter(n=>n.definitionExpression!=null||t&&n.floorInfo!=null);return r.length?r.map(n=>{const s=Yne(i,n),o=PS(s,n.definitionExpression);return{id:n.id,definitionExpression:o??void 0}}):null}var P7e;let ld=P7e=class extends Ci{static from(i){return Cu(P7e,i)}constructor(i){super(i),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}};x([D({type:Number,json:{write:!0}})],ld.prototype,"dpi",void 0),x([D()],ld.prototype,"floors",void 0),x([D({type:String,json:{write:!0}})],ld.prototype,"gdbVersion",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],ld.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"geometryPrecision",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"height",void 0),x([D({type:Date})],ld.prototype,"historicMoment",void 0),x([ur("historicMoment")],ld.prototype,"writeHistoricMoment",null),x([D({type:[Number],json:{write:!0}})],ld.prototype,"layerIds",void 0),x([D({type:["top","visible","all","popup"],json:{write:!0}})],ld.prototype,"layerOption",void 0),x([D({type:hr,json:{write:!0}})],ld.prototype,"mapExtent",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"maxAllowableOffset",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnFieldName",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnUnformattedValues",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnZ",void 0),x([D({type:Xi,json:{write:!0}})],ld.prototype,"spatialReference",void 0),x([D()],ld.prototype,"sublayers",void 0),x([D({type:Eg,json:{write:!0}})],ld.prototype,"timeExtent",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"tolerance",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"width",void 0),ld=P7e=x([Qe("esri.rest.support.IdentifyParameters")],ld);const nXt=ld;let wO=class extends Ci{constructor(e){super(e),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(e,t){return Us.fromJSON({attributes:{...t.attributes},geometry:{...t.geometry}})}writeFeature(e,t){if(!e)return;const{attributes:r,geometry:n}=e;r&&(t.attributes={...r}),n!=null&&(t.geometry=n.toJSON(),t.geometryType=Yve.toJSON(n.type))}};x([D({type:String,json:{write:!0}})],wO.prototype,"displayFieldName",void 0),x([D({type:Us})],wO.prototype,"feature",void 0),x([Mi("feature",["attributes","geometry"])],wO.prototype,"readFeature",null),x([ur("feature")],wO.prototype,"writeFeature",null),x([D({type:Number,json:{write:!0}})],wO.prototype,"layerId",void 0),x([D({type:String,json:{write:!0}})],wO.prototype,"layerName",void 0),wO=x([Qe("esri.rest.support.IdentifyResult")],wO);const wyn=wO;async function xyn(i,e,t){const r=(e=Tyn(e)).geometry?[e.geometry]:[],n=gu(i);return n.path+="/identify",cy(r).then(s=>{const o=vyn(e,{geometry:s?.[0]}),a=Ig({...n.query,f:"json",...o}),l=_p(a,t);return zi(n.path,l).then(Syn).then(u=>Cyn(u,e.sublayers))})}function Syn(i){const e=i.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(t=>wyn.fromJSON(t)),e}function Tyn(i){return i=nXt.from(i)}function Cyn(i,e){if(!e?.length)return i;const t=new Map;function r(n){t.set(n.id,n),n.sublayers&&n.sublayers.forEach(r)}e.forEach(r);for(const n of i.results)n.feature.sourceLayer=t.get(n.layerId);return i}async function JCe(i,e=i.popupTemplate){if(e==null)return[];const t=await e.getRequiredFields(i.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:n,typeIdField:s,globalIdField:o,relationships:a}=i;if(t.includes("*"))return["*"];const l=r?BZi(i):[],u=rB(i.fieldsIndex,[...t,...l]);return s&&u.push(s),u&&n&&i.fieldsIndex?.has(n)&&!u.includes(n)&&u.push(n),u&&o&&i.fieldsIndex?.has(o)&&!u.includes(o)&&u.push(o),a&&a.forEach(c=>{const{keyField:h}=c;u&&h&&i.fieldsIndex?.has(h)&&!u.includes(h)&&u.push(h)}),u}function kF(i,e){return i.popupTemplate?i.popupTemplate:e!=null&&e.defaultPopupTemplateEnabled&&i.defaultPopupTemplate!=null?i.defaultPopupTemplate:null}let pRe=null;function Eyn(i,e){return e.type==="tile"||e.type==="map-image"}let XO=class extends un{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=xd(async t=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(t).catch(()=>{}))})}initialize(){const e=t=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(t).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ju(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:n}}}=this;if(!e)throw new qe("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const s=Iyn(r.sublayers,n,t);if(!s.length)return[];const o=await Myn(r,s);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!o)throw new qe("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return o?this._fetchPopupFeaturesUsingQueries(e,s,t):this._fetchPopupFeaturesUsingIdentify(e,s,t)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(e){const t=this.highlightGraphics;if(!t)return wa();let r=null;if(e instanceof Us?r=[e]:dr.isCollection(e)&&e.length>0?r=e.toArray():Array.isArray(e)&&e.length>0&&(r=e),r=r?.filter(Ga),!r?.length)return wa();for(const n of r){const s=n.sourceLayer;s!=null&&"geometryType"in s&&s.geometryType==="point"&&(n.visible=!1)}return t.addMany(r),wa(()=>t.removeMany(r??[]))}async _updateHighlightedFeaturesSymbols(e){const{layerView:{view:t},highlightGraphics:r,highlightGraphicUpdated:n}=this;if(r&&n)for(const s of e){const o=s.sourceLayer&&"renderer"in s.sourceLayer&&s.sourceLayer.renderer;s.sourceLayer&&"geometryType"in s.sourceLayer&&s.sourceLayer.geometryType==="point"&&o&&"getSymbolAsync"in o&&o.getSymbolAsync(s).then(async a=>{a||=new Jh;let l=null;const u="visualVariables"in o?o.visualVariables?.find(c=>c.type==="size"):void 0;u&&(pRe||(pRe=(await Promise.resolve().then(()=>L2e)).getSize),l=pRe(u,s,{view:t.type,scale:t.scale,shape:a.type==="simple-marker"?a.style:null})),l||="width"in a&&"height"in a&&a.width!=null&&a.height!=null?Math.max(a.width,a.height):"size"in a?a.size:16,r.includes(s)&&(s.symbol=new Jh({style:"square",size:l,xoffset:"xoffset"in a?a.xoffset:0,yoffset:"yoffset"in a?a.yoffset:0}),n(s,"symbol"),s.visible=!0)})}}async _updateHighlightedFeaturesGeometries(e){const{layerView:{layer:t,view:r},highlightGraphics:n,highlightGraphicUpdated:s}=this;if(this._highlightGeometriesResolution=e,!s||!n?.length||!t.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(e),a=new Map;for(const c of n)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>o){const h=c.sourceLayer;qh(a,h,()=>new Map).set(c.getObjectId(),c)}const l=Array.from(a,([c,h])=>{const p=c.createQuery();return p.objectIds=[...h.keys()],p.outFields=[c.objectIdField],p.returnGeometry=!0,p.maxAllowableOffset=o,p.outSpatialReference=r.spatialReference,c.queryFeatures(p)}),u=await Promise.all(l);if(!this.destroyed)for(const{features:c}of u)for(const h of c){const p=h.sourceLayer,m=a.get(p).get(h.getObjectId());m&&n.includes(m)&&(m.geometry=h.geometry,s(m,"geometry"),this._featuresResolutions.set(m,o))}}_getTargetResolution(e){const t=e*pu(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const n=await this._createIdentifyParameters(e,t,r);if(n==null)return[];const{results:s}=await xyn(this.layerView.layer.parsedUrl,n,r);return s.map(o=>o.feature)}async _createIdentifyParameters(e,t,r){const{floors:n,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;await Promise.all(t.map(({sublayer:v})=>v.load(r).catch(()=>{})));const u=Math.min(yi("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((v,w)=>w.renderer?b1t({renderer:w.renderer,pointerType:r?.pointerType}):v,2)),c=this.createFetchPopupFeaturesQueryGeometry(e,u),h=ydr(l,a),p=Math.round(c.width/h),m=new hr({xmin:c.center.x-h*p,ymin:c.center.y-h*p,xmax:c.center.x+h*p,ymax:c.center.y+h*p,spatialReference:c.spatialReference});return new nXt({floors:n,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:p,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:u,width:p})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:n,timeExtent:s}}=this,o=t.map(async({sublayer:a,popupTemplate:l})=>{if(await a.load(r).catch(()=>{}),a.capabilities&&!a.capabilities.operations.supportsQuery)return[];const u=a.createQuery(),c=b1t({renderer:a.renderer,pointerType:r?.pointerType}),h=this.createFetchPopupFeaturesQueryGeometry(e,c),p=new Set,[m]=await Promise.all([JCe(a,l),a.renderer?.collectRequiredFields(p,a.fieldsIndex)]);hn(r),IA(p,a.fieldsIndex,m);const v=Array.from(p).sort();if(u.geometry=h,u.outFields=v,u.timeExtent=s,n){const k=n.clone(),B=Yne(k,a);B!=null&&(u.where=u.where?`(${u.where}) AND (${B})`:B)}const w=this._getTargetResolution(h.width/c),S=await Ayn(l);hn(r);const I=a.geometryType==="point"||S&&S.arcadeUtils.hasGeometryOperations(l);I||(u.maxAllowableOffset=w);let{features:R}=await a.queryFeatures(u,r);const L=I?0:w;R=await Oyn(a,R,r);for(const k of R)this._featuresResolutions.set(k,L);return R});return(await Promise.allSettled(o)).reduce((a,l)=>l.status==="fulfilled"?[...a,...l.value]:a,[]).filter(Ga)}};function Iyn(i,e,t){const r=[];if(!i)return r;const n=s=>{const o=s.minScale===0||e<=s.minScale,a=s.maxScale===0||e>=s.maxScale;if(s.visible&&o&&a){if(s.sublayers)s.sublayers.forEach(n);else if(s.popupEnabled){const l=kF(s,{...t,defaultPopupTemplateEnabled:!1});l!=null&&r.unshift({sublayer:s,popupTemplate:l})}}};return i.map(n),r}function Ayn(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(e=>e.type==="expression")?e_():Promise.resolve()}async function Myn(i,e){if(i.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:t})=>t.load().then(()=>t.capabilities.operations.supportsQuery)))}catch{return!1}}async function Oyn(i,e,t){const r=i.renderer;return r&&"defaultSymbol"in r&&!r.defaultSymbol&&(e=r.valueExpression?await Promise.all(e.map(n=>r.getSymbolAsync(n,t).then(s=>s?n:null))).then(n=>n.filter(s=>s!=null)):e.filter(n=>r.getSymbol(n)!=null)),e}x([D({constructOnly:!0})],XO.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),x([D({constructOnly:!0})],XO.prototype,"layerView",void 0),x([D({constructOnly:!0})],XO.prototype,"highlightGraphics",void 0),x([D({constructOnly:!0})],XO.prototype,"highlightGraphicUpdated",void 0),x([D({constructOnly:!0})],XO.prototype,"updatingHandles",void 0),XO=x([Qe("esri.views.layers.support.MapService")],XO);function sXt(i,e,t,r=new hr){let n=0;if(t.type==="2d")n=e*(t.resolution??0);else if(t.type==="3d"){const c=t.overlayPixelSizeInMapUnits(i),h=t.basemapSpatialReference;n=h==null||h.equals(t.spatialReference)?e*c:pu(h)/pu(t.spatialReference)}const s=i.x-n,o=i.y-n,a=i.x+n,l=i.y+n,{spatialReference:u}=t;return r.xmin=Math.min(s,a),r.ymin=Math.min(o,l),r.xmax=Math.max(s,a),r.ymax=Math.max(o,l),r.spatialReference=u,r}new hr;const Pyn=[0,0];let yte=class extends hL(iXt(Lm(Nm))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new bx,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new ak(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(r,n)=>this.fetchTile(r,n)}),this._tileStrategy=new Qne({cachePolicy:"keep",resampling:this.resampling,acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView}),Eyn(this,this.layer)){const r=this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new XO({createFetchPopupFeaturesQueryGeometry:(n,s)=>sXt(n,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(n,s)=>{r.graphicUpdateHandler({graphic:n,property:s})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):wa()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Ya(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),r=t.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(Pyn,t.key),r.resolution=this._tileInfoView.getTileResolution(t.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const r=this.tilemapCache,{signal:n,resamplingLevel:s=0}=t;if(!r)try{return await this._fetchImage(e,n)}catch(l){if(!mo(l)&&!this.resampling)return O7e(this._tileInfoView.tileInfo.size);if(s<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const c=new Tc(u),h=await this.fetchTile(c,{...t,resamplingLevel:s+1});return lwe(this._tileInfoView,h,c,e)}}throw l}const o=new Tc(0,0,0,0);let a;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:n}),o.level!==e.level&&!this.resampling)return O7e(this._tileInfoView.tileInfo.size);a=await this._fetchImage(o,n)}catch(l){if(mo(l))throw l;a=await this._fetchImage(e,n)}return this.resampling?lwe(this._tileInfoView,a,o,e):a}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){mo(t)||di.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};x([D()],yte.prototype,"resampling",null),x([D()],yte.prototype,"tilemapCache",null),yte=x([Qe("esri.views.2d.layers.TileLayerView2D")],yte);const Ryn=yte,Dyn=Object.freeze(Object.defineProperty({__proto__:null,default:Ryn},Symbol.toStringTag,{value:"Module"}));let Jye=class extends Us{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};x([D({type:Boolean})],Jye.prototype,"isAggregate",void 0),Jye=x([Qe("esri.AggregateGraphic")],Jye);const YKe=Jye;let W_=class extends un{constructor(e){super(e),this._filter=null,this.duration=yi("mapview-transitions-duration"),this._excludedEffectView=new W2(e),this._includedEffectView=new W2(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),r=e,n=r?.includedEffect,s=r?.excludedEffect,o=this._includedEffectView.canTransitionTo(n)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=n,this._excludedEffectView.effect=s,this._set("featureEffect",r),this._filter=r?.filter||t?.filter||null,o||this.endTransitions()}};x([D()],W_.prototype,"_filter",void 0),x([D()],W_.prototype,"_excludedEffectView",void 0),x([D()],W_.prototype,"_includedEffectView",void 0),x([D()],W_.prototype,"duration",void 0),x([D()],W_.prototype,"excludedEffects",null),x([D()],W_.prototype,"featureEffect",null),x([D()],W_.prototype,"filter",null),x([D()],W_.prototype,"hasEffects",null),x([D()],W_.prototype,"includedEffects",null),x([D({value:0})],W_.prototype,"scale",null),x([D()],W_.prototype,"transitioning",null),W_=x([Qe("esri.layers.effects.FeatureEffectView")],W_);const Fyn=W_;let vte=class extends du{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const r=Xi.fromJSON(t.spatialReference),n=[];for(let s=0;s";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${s}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if(e.type==="update"){const[s,...o]=e.modify;t.onMessage({type:"update",modify:s,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const a of o){const l=this._tiles.get(a.tileId);l&&l.onMessage({type:"update",modify:a,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(e.append==null)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[r,...n]=e.append;t.onMessage({type:"append",clear:e.clear,append:r,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const s of n){const o=this._tiles.get(s.tileId);o&&o.onMessage({type:"update",modify:s,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){yi("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Tc(e),r=this._tileInfoView.getTileBounds(Wo(),t),n=this._tileInfoView.getTileResolution(t.level),s=new BKe(t,n,r[0],r[3],!0);if(s.stage=this.getStage(),!s.stage){const o=new qe("featurelayerview:webgl","Cannot create tile with empty stage");di.getLogger("esri.views.2d.layers.features.RenderState").error(o)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;for(let r=-1;r<=1;r++)for(let n=-1;n<=1;n++){if(r===0&&n===0)continue;const s=this._tileInfoView.tileInfo.isWrappable,o=Yjt(e.key,n,r,s).id,a=this._tiles.get(o);if(a!=null){const l=1<r.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const r of this._renderState.tiles())r.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e),e.drawPhase){case aa.MAP:return this._renderMapPhase(e);case aa.HIGHLIGHT:return this._renderHighlightPhase(e);case aa.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(this._instanceStore==null)return null;let t=0,r=null;for(const n of this._instanceStore.values())n.techniqueRef.drawPhase&e&&(t++,n.techniqueRef.postProcessingEnabled&&(r=n));return t>1?null:r}_getOverrideStencilRef({drawPhase:e}){if(this._instanceStore==null)return null;let t=null;for(const r of this._instanceStore.values()){if(!(r.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:n}=r.techniqueRef;if(t==null)t=n;else if(t!==n){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=r;else{const n=new $yn(t,r);this._subscriptions.set(t,n),this.updatingHandles.addPromise(n.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new Nyn(()=>this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const n of t)r.set(n.fieldName,{minValue:n.minValue,maxValue:n.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(yi("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){if(hn(t),!this._subscriptions.has(e.id))return;const r=this._subscriptions.get(e.id);if(r.version!==e.subscriptionVesrion){if(yi("esri-2d-update-debug")){const s=`${e.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${s}] Tile[${e.id}] FeatureContainer - Dropping message, outdated version]`,e)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==e.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${e.version}]`),n.updateTile(e),e.end&&this._subscriptions.get(e.id).end(),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:n,y:s})=>n===e.x&&s===e.y);const r=ac();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const n of this.children)if(n.getSortKeys(t).forEach((s,o)=>r.set(o,s)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:r}=this._layer.effectiveScaleRange,n=e.state.scale;n<=(t||1/0)&&n>=r&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(t==null)super.setStencilReference(e);else for(const r of this.children)r.stencilRef=t(r)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,ax.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&$Ke(e,!1,t=>{this._renderFeatures(t,ax.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,ax.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,ax.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,ax.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,r=e.painter.effects.hittest,n=t.getBoundFramebufferObject(),s=t.getViewport(),o=e.passOptions;r.bind(e),e.passOptions=r.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,ax.All),r.draw(e),r.unbind(),t.bindFramebuffer(n),t.restoreViewport(s),e.passOptions=o}_renderFeatures(e,t){for(const n of this.children){if(!n.visible)continue;const s=yi("featurelayer-force-marker-text-draw-order")?OR.STRICT_MARKERS_AND_TEXT:OR.BATCHING,o=n.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,o?.render(e)}const r=this._getExclusivePostprocessingInstance(e);r?.techniqueRef.postProcess(e,r)}};async function jyn(i){const e=await $R("FeaturePipelineWorker",{client:i,strategy:"dedicated"});return new Gyn(e)}let Gyn=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const Uyn="esri.views.2d.layers.features.FeatureSourceEventLog";let xO=class extends un{constructor(){super(...arguments),this.events=new rd,this._updatingStrategy=!0,this._tileToEvent=new WV,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e[e.length-1].type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":this._tileToEvent.set(e.tile,[e]);break;case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};x([D({readOnly:!0})],xO.prototype,"hasAllFeatures",null),x([D({readOnly:!0})],xO.prototype,"hasAllFeaturesInView",null),x([D({readOnly:!0})],xO.prototype,"hasFullGeometries",null),x([D()],xO.prototype,"_updatingStrategy",void 0),x([D()],xO.prototype,"_strategyInfo",void 0),x([D()],xO.prototype,"_tileToEvent",void 0),xO=x([Qe(Uyn)],xO);function XR(i){switch(i.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return null}}function Gx(i,e){const t=i.featureReduction;return t&&t.type!=="selection"&&(!("maxScale"in t)||!t.maxScale||t.maxScale=r?o:s+n*(o-s)}function qyn(i,e){const t=i/e.minDataValue,r=oE(e.minSize,i),n=oE(e.maxSize,i);let s=null;return s=t*r,uu(s,r,n)}function Yyn(i,e){const[t,r,n]=Jyn(i,e.cache.ipData);if(t===r)return oE(e.stops[t].size,i);{const s=oE(e.stops[t].size,i);return s+(oE(e.stops[r].size,i)-s)*n}}function Xyn(i,e){const t=bae[e.valueUnit],r=oE(e.minSize,i),n=oE(e.maxSize,i),{valueRepresentation:s}=e;let o=null;return o=s==="area"?2*Math.sqrt(i/zyn)/t:s==="radius"||s==="distance"?2*i/t:i/t,uu(o,r,n)}function Jyn(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((n,s)=>ie.deconflictionStrategy!=="none"))??!1}function yX(i,e){const t=Gx(i,e);if(t?.labelsVisible&&t.labelingInfo?.length)return t.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Kyn(i){return e=>us(oXt(e,i))}function v7(i){const e=i!=null&&"visualVariables"in i&&i.visualVariables;if(!e)return null;for(const t of e)if(t.type==="size")return Kyn(t);return null}function _7(i,e,t,r,n){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,o=PS(e.definitionExpression,s),a=e.customParameters??{};return n&&(a.token=n),{type:"feature",mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{definitionExpression:o,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outSpatialReference:t.outSpatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:a}},service:i,tileInfoJSON:t.tileInfoJSON}}function Zyn(i,e,t=0){if(e==null)return i[t]=0,i[t+1]=0,i[t+2]=0,void(i[t+3]=0);const{r,g:n,b:s,a:o}=e;i[t]=r*o/255,i[t+1]=n*o/255,i[t+2]=s*o/255,i[t+3]=o}async function KP(i,e){if(!i)return[];switch(i.type){case"simple-fill":return lXt(i,e);case"picture-fill":return u0n(i,e);case"simple-marker":return i0n(i,e);case"picture-marker":return r0n(i,e);case"simple-line":return Wle(i,e,!1);case"text":return s0n(i,e);case"label":return o0n(i,e);case"cim":return owe(i.data,e);case"web-style":{const t=await i.fetchCIMSymbol();return owe(t.data,e)}default:throw new Error(`symbol not supported ${i.type}`)}}async function Qyn(i,e){const{schemaOptions:t}=e,{store:r}=t,n=new Array(Ide),s=new Array(Ide/4);for(let u=0;ufte(o.color)),visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:i.attributes.length},{}).createMeshInfo({params:{size:i.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:RR(n)}});return[...i.backgroundFillSymbol?lXt(i.backgroundFillSymbol,{schemaOptions:e,path:"",uniforms:PR}):[],s]}function aXt(i){if(i.style==="path"){if(i.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:i.path,asFill:!0}}}const e=ym.fromSimpleMarker(i);if("outline"in i&&i.outline&&i.outline.style!=="none"&&i.outline.style!=="solid"){if(!e||!e.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:e.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:NKe(e),overrides:[]}}async function i0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r;if(i.style==="path"||i.outline&&i.outline.style!=="solid"&&i.outline.style!=="none"){const p=ym.fromSimpleMarker(i);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(t.visualVariableRotation&&(p.angleAlignment="Map"),i.style!=="path"){const m=p.symbolLayers[0];if(Nq(e.uniforms)){const v=RR(e.uniforms,0,1);if(v>m.size){const w=v/m.size;m.size=v;const S=m.markerGraphics?.[0].symbol;(S.symbolLayers&&S.symbolLayers[0]).width*=w}}}return owe({type:"CIMSymbolReference",symbol:p},e)}const s=n.ensureInstance(Sc.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),o=aXt(i);let a=i.color?.toArray()??[0,0,0,0];o.resource.type==="CIMVectorMarker"&&(a=[255,255,255,255]);const l=i.style==="triangle"?124/116:1,u=i.size,c=u*l,h=t.visualVariableColor!=null&&(i.style==="cross"||i.style==="x");return[s.createMeshInfo({params:{type:"simple",color:a,height:u,width:c,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:UKe(t)?jb.MAP:jb.SCREEN,outlineColor:i.outline?.color?.toArray()??[0,0,0,0],outlineSize:i.outline?.width??1,referenceSize:u,sprite:o,overrideOutlineColor:h,hasSizeVV:Nq(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:RR(t)}})]}function r0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=n.ensureInstance(Sc.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),o=ym.createPictureMarkerRasterizationParam(i);return o?[s.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:i.height,width:i.width,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:UKe(t)?jb.MAP:jb.SCREEN,outlineColor:null,outlineSize:0,referenceSize:i.height,sprite:o,overrideOutlineColor:!1,hasSizeVV:Nq(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:RR(t)}})]:[]}function n0n(i,e,t){const{uniforms:r,schemaOptions:n}=t,{store:s}=n,o=s.ensureInstance(Sc.marker,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation}},{zoomRange:!1}),a=aXt(i),l=6,u=l*e.width,c=u,h=i.color?.toArray()??e.color?.toArray()??[0,0,0,0],p=i.style==="cross"||i.style==="x";let m;switch(i.placement){case"begin-end":m=Cb.Both;break;case"begin":m=Cb.JustBegin;break;case"end":m=Cb.JustEnd;break;default:m=Cb.None}const v={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({params:{type:"simple",color:h,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:UKe(r)?jb.MAP:jb.SCREEN,outlineColor:h,outlineSize:p?e.width:0,referenceSize:c/l,sprite:a,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:Nq(r),placement:v,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:RR(r)}})]}function s0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r;return[n.ensureInstance(Sc.text,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:i.backgroundColor?.toArray(),boxBorderLineColor:i.borderLineColor?.toArray(),boxBorderLineSize:i.borderLineSize??0,color:i.color?.toArray()??[0,0,0,0],offsetX:i.xoffset,offsetY:i.yoffset,postAngle:i.angle,fontSize:i.font.size,decoration:i.font.decoration,haloColor:i.haloColor?.toArray()??[0,0,0,0],haloFontSize:i.haloSize??0,lineWidth:i.lineWidth,lineHeightRatio:i.lineHeight,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:i.font.toJSON(),textString:i.text,symbol:ym.createCIMTextSymbolfromTextSymbol(i)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:RR(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function o0n(i,e){const{schemaOptions:t,uniforms:r}=e,{store:n}=t,s=i.symbol,{allowOverrun:o,repeatLabel:a,repeatLabelDistance:l}=i,u={maxScale:i.maxScale??0,minScale:i.minScale??0},c=n.ensureInstance(Sc.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),h=i.labelPlacement,[p,m]=Pqr(h);return[c.createMeshInfo({params:{boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloFontSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:p,verticalAlignment:m,repeatLabel:a,repeatLabelDistance:us(l),allowOverrun:o,labelPosition:i.labelPosition,scaleInfo:u,minPixelBuffer:RR(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:ym.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override"},useLegacyLabelEvaluationRules:i.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.labelExpressionInfo?.expression??i.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function XKe(i,e){const t=i.width;return{outlineColor:i.color?.toArray()||[0,0,0,1],width:t,referenceWidth:t,capType:i.cap??"round",joinType:i.join??"round",miterLimit:i.miterLimit,hasSizeVV:e}}function a0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=i.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:i.style},overrides:[]};if(i.outline?.style==="solid")return[n.ensureInstance(Sc.patternOutlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:s,...XKe(i.outline,!!t.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})];const a=[],l=n.ensureInstance(Sc.patternFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:i.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return a.push(l),i.outline&&a.push(...Wle(i.outline,e,!0)),a}function l0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=i.color?.toArray()??[0,0,0,0];if(i.style!=="none"&&i.outline?.style==="solid")return[n.ensureInstance(Sc.outlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:s,...XKe(i.outline,!!t.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})];const o=[];if(i.style!=="none"){const a=n.ensureInstance(Sc.fill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:s,scaleInfo:null,effects:null}});o.push(a)}return i.outline&&o.push(...Wle(i.outline,e,!0)),o}function lXt(i,e){const{style:t}=i;return t&&t!=="none"&&t!=="solid"?a0n(i,e):l0n(i,e)}function u0n(i,e){const{outline:t}=i,{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=[],a=ym.createPictureFillRasterizationParam(i);if(!a)return[];const{width:l,height:u,xoffset:c,yoffset:h,xscale:p,yscale:m}=i,v={color:[255,255,255,255],sprite:a,height:u,aspectRatio:l/u,offsetX:c,offsetY:h,scaleX:p,scaleY:m,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(t?.style==="solid")return[s.ensureInstance(Sc.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...v,...XKe(t,!!r.visualVariableSizeOutlineScaleStops)}})];const w=s.ensureInstance(Sc.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return o.push(w.createMeshInfo({params:v})),t&&o.push(...Wle(t,e,!0)),o}function Wle(i,e,t){const{color:r,style:n,width:s,cap:o,join:a}=i,{schemaOptions:l}=e,{store:u}=l,c=[],h=t?{...PR,visualVariableSizeScaleStops:e.uniforms.visualVariableSizeOutlineScaleStops}:e.uniforms,p={geometry:{visualVariableColor:h.visualVariableColor,visualVariableOpacity:h.visualVariableOpacity,visualVariableSizeMinMaxValue:h.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:h.visualVariableSizeScaleStops,visualVariableSizeStops:h.visualVariableSizeStops,visualVariableSizeUnitValue:h.visualVariableSizeUnitValue}},m={color:r?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:o,joinType:a,miterLimit:i.miterLimit,hasSizeVV:Nq(h),effects:null,scaleInfo:null};if(n==null||n==="solid"){const v=u.ensureInstance(Sc.line,p,{zoomRange:!1}).createMeshInfo({params:m});c.push(v)}else if(n!=="none"){const v=u.ensureInstance(Sc.texturedLine,p,{zoomRange:!1}).createMeshInfo({params:{...m,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Ibe(n,o),capStyle:CJe(o)},overrides:[]}}});c.push(v)}return i.marker!=null&&c.push(...n0n(i.marker,i,e)),c}async function _oe(i,e,t){const r=e.labelsVisible&&e.labelingInfo||[],n=XR(e),s=WPt(r,n);return{type:"label",classes:await Promise.all(s.map((o,a)=>c0n(i,o,a,t)))}}async function c0n(i,e,t,r){const n=await KP(e,{path:`${t}`,schemaOptions:i,uniforms:r});return{maxScale:e.maxScale,minScale:e.minScale,expression:e.labelExpressionInfo?.expression??e.labelExpression,where:e.where,meshes:n}}async function boe(i,e){if(!e)return{type:"simple",meshes:[]};switch(e.type){case"simple":return h0n(i,e);case"dot-density":return d0n(i,e);case"class-breaks":return p0n(i,e);case"unique-value":return f0n(i,e);case"dictionary":return m0n(e);case"heatmap":return g0n(i,e);case"pie-chart":return y0n(i,e)}}async function h0n(i,e){const t=e.getSymbols(),r=t.length?t[0]:null,n=nM(e);return{type:"simple",meshes:await KP(r,{schemaOptions:i,uniforms:n,path:"renderer.symbol"})}}async function d0n(i,e){const t=nM(e);return{type:"dot-density",meshes:await Qyn(e,{schemaOptions:i,uniforms:t,path:"renderer.symbol"})}}async function p0n(i,e){const t=nM(e),r=e.backgroundFillSymbol,n=e.normalizationType,s=n==="log"?"esriNormalizeByLog":n==="percent-of-total"?"esriNormalizeByPercentOfTotal":n==="field"?"esriNormalizeByField":null,o=e.classBreakInfos.map(async c=>({meshes:await KP(c.symbol,{path:`renderer-stop-${c.minValue}-${c.maxValue}`,schemaOptions:i,uniforms:t}),min:c.minValue,max:c.maxValue})),a=(await Promise.all(o)).sort((c,h)=>c.min-h.min),l=await KP(r,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...PR,visualVariableSizeOutlineScaleStops:t.visualVariableSizeOutlineScaleStops}}),u=await KP(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:t});return{type:"interval",field:e.field,expression:e.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:a,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:s,isMaxInclusive:e.isMaxInclusive}}async function f0n(i,e){const t=[],r=nM(e),n=await KP(e.backgroundFillSymbol,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...PR,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),s=await KP(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:r});for(const o of e.uniqueValueInfos??[]){const a=await KP(o.symbol,{path:`renderer-unique-value-${o.value}`,schemaOptions:i,uniforms:r});t.push({value:""+o.value,symbol:a})}return{type:"map",field:e.field,expression:e.valueExpression,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,backgroundFill:n,defaultSymbol:s,map:t}}function m0n(i){const e=nM(i),t=i.scaleExpression,r=t!=null&&t!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:i.fieldMap,scaleExpression:r,visualVariableUniforms:e}}async function g0n(i,e){return{type:"heatmap",meshes:await e0n(e,i)}}async function y0n(i,e){return{type:"pie-chart",meshes:t0n(e,i)}}async function v0n(i,e){const t=e.renderer,r=nM(t);return{symbology:await boe(i,t),labels:await _oe(i,e,r)}}async function b7(i,e,t,r){const n=t.featureReduction;if(n)switch(n.type){case"binning":return b0n(n,i,e,t,r);case"cluster":return w0n(n,i,e,t,r)}const s=x0n(t.orderBy,t.renderer,t.objectIdField);return{storage:YCe(t.renderer,e.filters),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:await v0n(i,t),sortKey:s,timeZone:e.timeZone}}}function uXt(i,e){return i.fields.map(t=>({...t.toJSON(),type:_0n(t,e)}))}function _0n(i,e){const{onStatisticExpression:t,onStatisticField:r,statisticType:n}=i;switch(n){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:o}=t;return o?o==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const s=e.find(o=>o.name===r);return s?s.type:"esriFieldTypeString"}}}async function b0n(i,e,t,r,n){const s=uXt(i,r.fields),o=i.renderer,a=await boe(e,o),l=YCe(o,[null,null]),u=nM(o),c=await _oe(e,{geometryType:"polygon",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},u);return{storage:l,mesh:{displayRefreshVersion:n,strategy:{type:"binning",fields:s,fixedBinLevel:i.fixedBinLevel,featureFilter:t.filters[0]},factory:{labels:c,symbology:a},sortKey:null,timeZone:t.timeZone}}}async function w0n(i,e,t,r,n){const s=uXt(i,r.fields),o={type:"cluster",feature:await boe(e,i.effectiveFeatureRenderer),cluster:await boe(e,i.effectiveClusterRenderer)},a=nM(i.effectiveFeatureRenderer),l={type:"cluster",feature:await _oe(e,r,a),cluster:await _oe(e,{geometryType:"point",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},a)};return{storage:YCe(i.effectiveFeatureRenderer,[null,null]),mesh:{displayRefreshVersion:n,strategy:{type:"cluster",fields:s,featureFilter:t.filters[0],clusterRadius:us(i.clusterRadius/2)},factory:{labels:l,symbology:o},sortKey:null,timeZone:t.timeZone}}}function x0n(i,e,t){const r=e!=null&&e.type==="unique-value"&&e.orderByClassesEnabled;if(i!=="default"||r||(i=[new W2e({field:t,order:"descending"})]),i!=="default"&&i.length){i.length;const n=i[0],s=n.order==="ascending"?"asc":"desc";return n.field?{field:n.field,order:s}:n.valueExpression?{expression:n.valueExpression,order:s}:null}return r?{byRenderer:!0,order:"asc"}:null}let S0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=t.parent,n=tT(r),{capabilities:s,editingInfo:o,objectIdField:a,globalIdField:l,datesInUnknownTimezone:u,orderBy:c,subtypeField:h,parsedUrl:p}=r,m=r.fieldsIndex.toJSON(),v=XR(t),w=r.timeInfo?.toJSON(),S=t.spatialReference.toJSON(),I=li(p);let R=a;if(c?.length){const L=!c[0].valueExpression&&c[0].field;L&&(R=L)}return{type:"feature-service",source:I,isSourceHosted:Fx(I.path),orderByFields:R,metadata:{timeReferenceUnknownClient:u,subtypeField:h,globalIdField:l,fieldsIndex:m,geometryType:v,objectIdField:a,timeInfo:w,spatialReference:S,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:n,lastEditDate:o?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,timeExtent:o,apiKey:a}=this.layer.parent;return _7(e,{definitionExpression:n,customParameters:s,timeExtent:o},t,r,a)}createProcessorSchema(e,t,r){const{parent:{fields:n,geometryType:s,orderBy:o,objectIdField:a},renderer:l,labelingInfo:u,labelsVisible:c}=this.layer,h={featureReduction:null,fields:n.map(p=>p.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:c,objectIdField:a,orderBy:o??"default",renderer:l?.clone()};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{parent:r,parent:{definitionExpression:n,apiKey:s},renderer:o}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(r.customParameters),definitionExpression:n,labelingInfo:a,orderBy:JSON.stringify(r.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function JKe(i,e){const t=i.extent,r=e?.clone().intersection(t),n=r!=null?r.width*r.height:0,s=e?e.width*e.height:0,o=s===0?0:n/s,a=yi("featurelayer-snapshot-point-coverage");return!isNaN(o)&&o>=a}function $q(i,e){return i.floorInfo!=null&&(i.floorInfo.viewAllLevelIds.length>0||e.floors.length>0)}function KKe(i,e,t){const r=T0n(i,e?.where,t);return r&&(e??=new QF,e.where=r),e}function T0n(i,e,t){if(i.floorInfo==null||!t.floors?.length)return e;let r=t.floors;const{floorField:n,viewAllLevelIds:s}=i.floorInfo;s.length&&(r=s);const o=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(o.push("''"),e?.includes(n)){let l=new RegExp("AND \\("+n+".*NULL\\)","g");e=e.replace(l,""),l=new RegExp("\\("+n+".*NULL\\)","g"),e=(e=e.replace(l,"")).replaceAll(/\s+/g," ").trim()}let a="("+n+" IN ({ids}) OR "+n+" IS NULL)";return a=a.replace("{ids}",o.join(", ")),PS(e,a)}let C0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,editingInfo:s,objectIdField:o,typeIdField:a,globalIdField:l,datesInUnknownTimezone:u,orderBy:c,subtypeField:h,refreshInterval:p}=t,m=t.fieldsIndex.toJSON(),v=m.fields,w=XR(t),S=t.timeInfo?.toJSON(),I=t.spatialReference.toJSON(),R=t.types?.map(Y=>Y.toJSON()),L=li(this.layer.parsedUrl);this.layer.dynamicDataSource&&(L.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let k=this.layer.objectIdField;if(c?.length){const Y=!c[0].valueExpression&&c[0].field;Y&&(k=Y)}const B=s?.lastEditDate==null&&p>0,$=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!B,V=$&&JKe(e,t.fullExtent);return{type:"feature-service",source:L,isSourceHosted:Fx(L.path),orderByFields:k,metadata:{typeIdField:a??void 0,types:R,timeReferenceUnknownClient:u,subtypeField:h,globalIdField:l,fields:v,fieldsIndex:m,geometryType:w,objectIdField:o,timeInfo:S,spatialReference:I,subtypes:this.layer.subtypes?.map(Y=>Y.toJSON())},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:s?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:$,supportsSnapshotMaxThreshold:V,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:u,timeExtent:c,apiKey:h}=this.layer;return _7(e,{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:u,timeExtent:c},t,r,h)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}hasFilters(e){return $q(this.layer,e)}addFilters(e,t){return KKe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n,gdbVersion:s,apiKey:o,subtypeCode:a}=t,l=this.layer.labelsVisible?this.layer.labelingInfo:null,u=t.historicMoment?.getTime()??void 0,c=JSON.stringify(t.customParameters),h=Gx(t,e)?.toJSON(),p=JSON.stringify(t.orderBy);return{apiKey:o,customParameters:c,definitionExpression:r,featureReduction:h,floors:$q(this.layer,e)?e.floors:null,gdbVersion:s,historicMoment:u,labelingInfo:l,orderBy:p,renderer:n,subtypeCode:a}}};function E0n(i){if(!("openPorts"in i))throw new qe("source-not-supported")}let w1t=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.timeInfo?.toJSON(),u=t.spatialReference.toJSON();return E0n(t.source),{type:"memory",source:await t.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,timeInfo:l,spatialReference:u,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,timeExtent:s}=this.layer;return _7(e,{definitionExpression:n,timeExtent:s,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=Gx(t,e)?.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:o}}},I0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.spatialReference.toJSON();return{type:"memory",source:await t.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,spatialReference:l,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n}=this.layer;return _7(e,{definitionExpression:n,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u}=this.layer,c={fields:n.map(h=>h.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u,orderBy:"default"};return b7(e,t,c,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=Gx(t,e)?.toJSON();return{definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:o}}},A0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.timeInfo?.toJSON(),u=t.spatialReference.toJSON(),c=t.source.getSource(),h=this.layer.objectIdField,p=li(n);return p.query.maxRecordCount=c.maxRecordCount,{type:"ogc",source:c,orderByFields:h,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,timeInfo:l,spatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:p,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{customParameters:n,timeExtent:s,apiKey:o}=this.layer;return _7(e,{customParameters:n,timeExtent:s},t,r,o)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{renderer:r,apiKey:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{apiKey:n,customParameters:o,featureReduction:a,labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:r}}},M0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s,globalIdField:o,orderBy:a,refreshInterval:l}=t,u=t.fieldsIndex.toJSON(),c=u.fields,h=XR(t),p=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),v=li(this.layer.parsedUrl);let w=this.layer.objectIdField;if(a?.length){const L=!a[0].valueExpression&&a[0].field;L&&(w=L)}const S=l>0,I=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!S,R=I&&JKe(e,t.fullExtent);return{type:"feature-service",source:v,isSourceHosted:Fx(v.path),orderByFields:w,metadata:{globalIdField:o,fields:c,fieldsIndex:u,geometryType:h,objectIdField:s,timeInfo:p,spatialReference:m,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:I,supportsSnapshotMaxThreshold:R,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,timeExtent:o}=this.layer;return _7(e,{definitionExpression:n,customParameters:s,timeExtent:o},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}hasFilters(e){return $q(this.layer,e)}addFilters(e,t){return KKe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:a,customParameters:o,floors:$q(this.layer,e)?e.floors:null}}},O0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,{objectIdField:r}=t,n=XR(t),s=t.timeInfo?.toJSON()||null,o=t.spatialReference?t.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:r,timeInfo:s,timeReferenceUnknownClient:null,spatialReference:o,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,geometryDefinition:s,customParameters:o}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:n,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:o??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u}=this.layer,c={fields:n.map(h=>h.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u,orderBy:"default"};return b7(e,t,c,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:a,customParameters:o,streamFilter:`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`}}};async function P0n(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(({renderer:n})=>boe(i,n)));return{type:"subtype",subtypeField:e,renderers:t.reduce((n,{subtypeCode:s},o)=>({...n,[s]:r[o]}),{})}}function R0n(i,e){const t=lk();return{type:"subtype",filters:i.filters,capabilities:{maxTextureSize:t.maxTextureSize},subtypeField:e.subtypeField,target:"feature",bindings:e.sublayers.reduce((r,{renderer:n,subtypeCode:s})=>({...r,[s]:zKe(n)}),{})}}async function D0n(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(n=>{const s=nM(n.renderer),o={...n,geometryType:n.geometryType??null};return _oe(i,o,s)}));return{type:"subtype",subtypeField:e,renderers:t.reduce((n,{subtypeCode:s},o)=>({...n,[s]:r[o]}),{})}}async function F0n(i,e,t,r){return{storage:R0n(e,t),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:{symbology:await P0n(i,t),labels:await D0n(i,t)},sortKey:null,timeZone:e.timeZone}}}let k0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(t=>dL(t))}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,datesInUnknownTimezone:s,editingInfo:o,globalIdField:a,objectIdField:l,refreshInterval:u,subtypeField:c}=t,h=t.fieldsIndex.toJSON(),p=XR(t),m=t.timeInfo?.toJSON(),v=t.spatialReference.toJSON(),w=li(this.layer.parsedUrl),S=l,I=o?.lastEditDate==null&&u>0,R=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!I,L=R&&JKe(e,t.fullExtent);return{type:"feature-service",source:w,isSourceHosted:Fx(w.path),orderByFields:S,metadata:{timeReferenceUnknownClient:s,subtypeField:c,globalIdField:a,fieldsIndex:h,geometryType:p,objectIdField:l,timeInfo:m,spatialReference:v,subtypes:this.layer.subtypes?.map(k=>k.toJSON()),typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:o?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:R,supportsSnapshotMaxThreshold:L,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeField:l,timeExtent:u,apiKey:c}=this.layer,h=this.layer.sublayers.map(v=>v.subtypeCode).join(","),p=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${h})`:"1=2",m={definitionExpression:PS(n,p),customParameters:s,gdbVersion:o,historicMoment:a,subtypeField:l,timeExtent:u};return _7(e,m,t,r,c)}createProcessorSchema(e,t,r){const n={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,s=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:s.labelingInfo,labelsVisible:s.labelsVisible,renderer:s.renderer,subtypeCode:s.subtypeCode,orderBy:null}))};return F0n(e,t,n,r)}hasFilters(e){return $q(this.layer,e)||L0n(this.layer,e)}addFilters(e,t){e=KKe(this.layer,e,t);const r=this.layer.sublayers.filter(s=>!cXt(s,t)).map(s=>s.subtypeCode);if(!r.length)return e;e??=new QF;const n=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return e.where=PS(e.where,n),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:n,apiKey:s}=t,o=t.historicMoment?.getTime()??void 0,a=JSON.stringify(t.customParameters),l=$q(this.layer,e)?e.floors:null;return{gdbVersion:n,definitionExpression:r,historicMoment:o,customParameters:a,apiKey:s,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce((u,c)=>u+`${c.visible?1:0}.${JSON.stringify(c.renderer)}.${c.labelsVisible} -.${JSON.stringify(c.labelingInfo)}`,""),floors:l}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],n=this.layer.sublayers.find(s=>s.subtypeCode===r);e.layer=e.sourceLayer=n}};function L0n(i,e){return i.sublayers.some(t=>!cXt(t,e))}function cXt(i,e){return i.visible&&(i.minScale===0||W8(e.scale,i.minScale)||e.scalei.maxScale)}async function Wm(i,e){try{return await i}catch(t){if(t.name!=="no-queryEngine")throw t;return e}}let hXt=class{constructor(){this._idToCounters=new Map}get empty(){return this._idToCounters.size===0}addReason(e,t){for(const r of e){let n=this._idToCounters.get(r);n||(n=new Map,this._idToCounters.set(r,n)),n.set(t,(n.get(t)||0)+1)}}deleteReason(e,t){for(const r of e){const n=this._idToCounters.get(r);if(!n)continue;let s=n.get(t);if(s==null)return;s--,s>0?n.set(t,s):n.delete(t),n.size===0&&this._idToCounters.delete(r)}}getHighestReason(e){const t=this._idToCounters.get(e);if(!t)return null;let r=null;for(const n of g9)t.get(n)&&(r=n);return r||null}ids(){return this._idToCounters.keys()}};function iG(i,e){const t=new Set;for(const r of i instanceof Set?i.values():i.keys())e.has(r)||t.add(r);return t}let N0n=class{constructor(e){this.version=e}},$0n=class{constructor(e){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=e}destroy(){}get _coverageSet(){const e=this._coverage?Array.from(this._coverage.keys()).map(t=>t.id):[];return new Set(e)}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(e){return this._version=this._version+1%Number.MAX_SAFE_INTEGER,this._updateCoverage(e),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(e){this._coverage=this._config.tileInfoView.getTileCoverage(e.state,0,!0,"closest")}_updateSubscriptions(){const e=this._coverageSet,t=this._updateVisibility(),r=iG(t,e),n=iG(this._subscriptions,t),s=iG(e,this._subscriptions),o=iG(n,e),a=iG(r,o),l=iG(a,this._paused);this._visible=t;for(const u of s.values())this._subscriptions.set(u,new N0n(this._version));for(const u of l.values())this._paused.add(u);for(const u of o.values())this._subscriptions.delete(u),this._paused.delete(u);(s.size||o.size||l.size)&&this._sendUpdateSubscriptions(s,o,l)}_sendUpdateSubscriptions(e,t,r){const n=Array.from(e.values()).map(s=>({tileId:s,version:this._subscriptions.get(s).version}));this._config.updateSubscriptions({subscribe:n,unsubscribe:Array.from(t.values()),pause:Array.from(r.values()),tileInfoJSON:this._config.tileInfoView.tileInfo.toJSON()})}_updateVisibility(){const e=new Set;if(!this._coverage)return e;for(const t of this._coverage.keys()){if(this._config.isDone(t)){e.add(t.id);continue}this._addVisibleParent(e,t)||this._addVisibleChildren(e,t)||e.add(t.id)}return e}_addVisibleParent(e,t){let r=!1;for(const n of this._visible.values())new Tc(n).containsChild(t)&&(e.add(n),r=!0);return r}_addVisibleChildren(e,t){let r=!1;for(const n of this._visible.values()){const s=new Tc(n);t.containsChild(s)&&(e.add(n),r=!0)}return r}};const B0n=i=>{let e=class extends i{constructor(...t){super(...t),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([Ki(()=>{const t=this.layer;return[t&&"elevationInfo"in t?t.elevationInfo?.featureExpressionInfo:null,t&&"displayField"in t?t.displayField:null,t&&"timeInfo"in t&&t.timeInfo,t&&"renderer"in t&&t.renderer,t&&"labelingInfo"in t&&t.labelingInfo,t&&"floorInfo"in t&&t.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),Ah),ju(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),ju(()=>{const t=this.layer;return t&&"sublayers"in t?t.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:t,layer:{fieldsIndex:r},requiredFields:n}=this;return"outFields"in t&&t.outFields?rB(r,[...e1e(r,t.outFields),...n]):rB(r,n)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(t){this._override("featureEffect",t)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(t){di.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(t){throw new Error("missing implementation")}createQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(t):new Kn(t);if("floorInfo"in this.layer&&this.layer.floorInfo){const n=dat(this);n!=null&&(r.where=r.where?`(${r.where}) AND (${n})`:n)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new Kn(t)}queryFeatures(t,r){throw new Error("missing implementation")}queryObjectIds(t,r){throw new Error("missing implementation")}queryFeatureCount(t,r){throw new Error("missing implementation")}queryExtent(t,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(t,r){return this._validateFetchPopupFeatures(t,r),this._fetchPopupFeatures(t,r)}_loadArcadeModules(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(r=>r.type==="expression")?e_():Promise.resolve()}_handleRequiredFieldsChange(){const t=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",t),t.then(()=>{this._updatingRequiredFieldsPromise===t&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const t=this.view.type==="3d",{layer:r,layer:{fieldsIndex:n,objectIdField:s}}=this,o="renderer"in r&&r.renderer,a="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,c=await Promise.allSettled([o?o.collectRequiredFields(u,n):null,wnt(u,r),t&&"elevationInfo"in r?DZi(u,r):null,this.filter!=null?bnt(u,r,this.filter):null,t||this.featureEffect==null?null:bnt(u,r,this.featureEffect.filter),!t&&l?kZi(u,r,l):null,!t&&a?NZi(u,r,a):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&IA(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&IA(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&t&&r.infoFor3D!=null&&(r.globalIdField==null&&di.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),IA(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){$v(u,n,r.subtypeField);const p=r.sublayers.map(m=>Promise.all([m.renderer?.collectRequiredFields(u,n),wnt(u,m)]));await Promise.allSettled(p)}r.type==="catalog-footprint"&&IA(u,n,[r.parent.itemSourceField,r.parent.itemTypeField]);for(const p of c)p.status==="rejected"&&di.getLogger(this).error(p.reason);$v(u,n,s),t&&"displayField"in r&&r.displayField&&$v(u,n,r.displayField);const h=Array.from(u).sort();this._set("requiredFields",h)}_validateFetchPopupFeatures(t,r){if(r!=null)for(const n of t){const s=n.origin&&"layer"in n.origin?n.origin.layer:n.layer;if("popupEnabled"in s&&!s.popupEnabled)throw new qe("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s});if(n.isAggregate){const o="featureReduction"in s?s.featureReduction:null;if(!(o&&"popupTemplate"in o&&o.popupEnabled&&o.popupTemplate))throw new qe("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s})}else if("popupTemplate"in s&&!kF(s,r))throw new qe("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:s})}}_popupFeatureHasRequiredFields(t,r){return XAt(r,t)}async _fetchPopupFeatures(t,r){const n=new Array(t.length),s=new Map,o=await this._createPopupQuery(t.map(a=>a.origin?.layer??a.layer),r);for(let a=0;athis._createPopupQuery(void 0,t)}}get test(){return this.getTest()}};return x([D()],e.prototype,"_updatingRequiredFieldsPromise",void 0),x([D({readOnly:!0})],e.prototype,"availableFields",null),x([D({readOnly:!0})],e.prototype,"dataUpdating",void 0),x([D({type:JOt})],e.prototype,"featureEffect",null),x([D({type:QF})],e.prototype,"filter",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"layer",void 0),x([D({type:Number})],e.prototype,"maximumNumberOfFeatures",null),x([D({readOnly:!0,type:Boolean})],e.prototype,"maximumNumberOfFeaturesExceeded",null),x([D({readOnly:!0})],e.prototype,"requiredFields",void 0),x([D()],e.prototype,"suspended",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.views.layers.FeatureLayerView")],e),e};function j0n(i,e){const t=new Set;return i&&i.forEach(r=>t.add(r)),e&&e.forEach(r=>t.add(r)),t.has("*")?["*"]:Array.from(t)}const G0n="esri.views.2d.layers.FeatureLayerView2D",x1t=4294967294;let tv=class extends B0n(hL(Lm(Nm))){constructor(){super(...arguments),this._commandsQueue=new WYt({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new hXt,this._updateHighlight=xd(async()=>{const e=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighestReason(t),n=SCe(r);e.push({objectId:t,highlightFlags:n})}this._worker.pipeline.updateHighlight({highlights:e})}),this._lastAvailableFields=[],this.eventLog=new xO,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new Fyn}destroy(){this._worker?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new qe("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new qe("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&tT(e)?.operations.supportsQuery===!1)throw new qe("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._worker&&this._worker.destroy();const t=this._createClientOptions();this._worker=await jyn(t)}get hasAllFeatures(){return this.layer.visible&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:n,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:n,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new w1t(this.layer):new C0n(this.layer);case"geojson":case"csv":case"wfs":return new w1t(this.layer);case"subtype-group":return new k0n(this.layer);case"ogc-feature":return new A0n(this.layer);case"stream":return new O0n(this.layer);case"oriented-imagery":return new M0n(this.layer);case"knowledge-graph-sublayer":return new I0n(this.layer);case"catalog-footprint":return new S0n(this.layer);default:this.layer}return null}get updateHash(){if(!this.layerAdapter)return null;const{availableFields:e,_displayRefreshVersion:t,timeExtent:r,clips:n,filter:s,featureEffect:o,_sourceRefreshVersion:a,view:{timeZone:l}}=this,u=JSON.stringify(n),c=o?.toJSON(),h=s?.toJSON();return JSON.stringify({availableFields:e,clipsHash:u,displayRefreshVersion:t,effectHash:c,filterHash:h,sourceRefreshVersion:a,timeExtent:r,timeZone:l,...this.layerAdapter.getUpdateHashProperties(this.view)})}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return this._worker.pipeline.queryHeatmapStatistics(e)}highlight(e,t="highlight"){let r;e instanceof Us?r=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?r=[e]:dr.isCollection(e)&&e.length>0?r=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(r=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const n=r?.filter(Ga);return n?.length?(this._addHighlight(n,t),wa(()=>this._removeHighlight(n,t))):wa()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const r=await this.featureContainer.hitTest(t);if(r.length===0)return null;const{features:n,aggregates:s}=await this._worker.pipeline.getDisplayFeatures(r),o=this.featureContainer.getSortKeys(r),a=({displayId:l},{displayId:u})=>o.has(l)&&o.has(u)?o.get(l)-o.get(u):l-u;return n.sort(a).reverse(),s.sort(a).reverse(),[...s.map(l=>this._createGraphicHit(e,YKe.fromJSON(l))),...n.map(l=>this._createGraphicHit(e,Us.fromJSON(l)))]}queryStatistics(){return Wm(this._worker.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}querySummaryStatistics(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),n,r);return Wm(s,{})}async queryAggregateSummaryStatistics(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{})}async queryUniqueValues(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForUniqueValues(this._cleanUpQuery(e),n,r);return Wm(s,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForClassBreaks(this._cleanUpQuery(e),n,r);return Wm(s,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{classBreakInfos:[]})}async queryHistogram(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForHistogram(this._cleanUpQuery(e),n,r);return Wm(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(r=>{const n=du.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}async queryVisibleFeatures(e,t){const r=this._worker.pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),n=await Wm(r,{features:[]}),s=du.fromJSON(n);return s.features.forEach(o=>this._setLayersForFeature(o)),s}async queryAggregates(e,t){const r=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),n=await Wm(r,{features:[]}),s=kyn.fromJSON(n);return s.features.forEach(o=>this._setLayersForFeature(o)),s}queryAggregateIds(e,t){const r=this._worker.aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Wm(r,[])}queryAggregateCount(e,t){const r=this._worker.aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Wm(r,0)}queryAggregateJSON(e,t){const r=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Wm(r,{features:[]})}async queryFeaturesJSON(e,t){const r=this._worker.features.executeQuery(this._cleanUpQuery(e),t);return Wm(r,{features:[]})}queryObjectIds(e,t){const r=this._worker.features.executeQueryForIds(this._cleanUpQuery(e),t);return Wm(r,[])}queryFeatureCount(e,t){const r=this._worker.features.executeQueryForCount(this._cleanUpQuery(e),t);return Wm(r,0)}async queryExtent(e,t){const r=this._worker.features.executeQueryForExtent(this._cleanUpQuery(e),t),n=await Wm(r,{count:0,extent:null});return{count:n.count,extent:hr.fromJSON(n.extent)}}async getSampleFeatures(e){return this._worker.pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;const t=this._subscriptionManager.update(e);this.featureContainer.setVisibleTiles(t)}attach(){yi("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),this.featureContainer=new Byn(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new $0n({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),this._worker.pipeline.updateSubscriptions(e)},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([Ki(()=>this.updateHash,()=>this._update(),js),Ki(()=>this.updateSuspended,e=>{e||this._subscriptionManager.resume()})]),this.layer.type!=="stream"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){yi("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._fields=null,this.featureContainer.destroy(),this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=zo(this._subscriptionManager),this._worker.pipeline.onDetach()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,r=this._updatingRequiredFieldsPromise!=null,n=this.featureContainer.updatingHandles.updating,s=e&&(t||r)||n||this._pipelineUpdating||this.dataUpdating;if(yi("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} + }`;this._program=e.programCache.acquire(t,r,m1t().attributes)}_updateMatricesAndLocalOrigin(e){const{state:t}=e,{displayMat3:r,size:n,resolution:s,pixelRatio:o,rotation:a,viewpoint:l}=t,u=zgn*a,{x:c,y:h}=l.targetGeometry,p=cHe(c,t.spatialReference);this._localOrigin.x=p,this._localOrigin.y=h;const m=o*n[0],v=o*n[1],w=s*m,S=s*v,I=Jk(this._dvsMat3);n_(I,I,r),h0(I,I,Xp(m/2,v/2)),_R(I,I,m7(n[0]/w,-v/S,1)),q3(I,I,-u)}_updateBufferData(e,t){const{x:r,y:n}=this._localOrigin,s=2*Vgn*t.length,o=new Float32Array(s),a=new Uint32Array(8*t.length);let l=0,u=0;for(const c of t)c&&(o[2*l]=c[0]-r,o[2*l+1]=c[1]-n,o[2*l+2]=c[0]-r,o[2*l+3]=c[3]-n,o[2*l+4]=c[2]-r,o[2*l+5]=c[3]-n,o[2*l+6]=c[2]-r,o[2*l+7]=c[1]-n,a[u]=l+0,a[u+1]=l+3,a[u+2]=l+3,a[u+3]=l+2,a[u+4]=l+2,a[u+5]=l+1,a[u+6]=l+1,a[u+7]=l+0,l+=4,u+=8);if(this._vertexBuffer?this._vertexBuffer.setData(o.buffer):this._vertexBuffer=Aa.createVertex(e,oa.DYNAMIC_DRAW,o.buffer),this._indexBuffer?this._indexBuffer.setData(a):this._indexBuffer=Aa.createIndex(e,oa.DYNAMIC_DRAW,a),!this._vao){const c=m1t();this._vao=new wh(e,c.attributes,c.bufferLayouts,{geometry:this._vertexBuffer},this._indexBuffer)}}};const m1t=()=>xCe("bounds",{geometry:[{location:0,name:"a_position",count:2,type:Ti.FLOAT}]});let XYt=class extends YYt{constructor(e){super(e),this._instanceStore=new Ugn,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=zo(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new Hgn(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.onMessage(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children){if(!r.visible)continue;r.getDisplayList(e.drawPhase,this._instanceStore,OR.STRICT_ORDER)?.render(e)}}},QA=class extends XYt{renderChildren(e){for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.attributeView.update(),this.children.some(t=>t.hasData)){switch(e.drawPhase){case aa.MAP:this._renderChildren(e,ax.All);break;case aa.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){$Ke(e,!1,t=>{this._renderChildren(t,ax.Highlight)})}};const Cpe="esri-zoom-box",Epe={container:`${Cpe}__container`,overlay:`${Cpe}__overlay`,background:`${Cpe}__overlay-background`,box:`${Cpe}__outline`},aRe={zoom:"Shift",counter:"Ctrl"};let mte=class extends un{constructor(e){super(e),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(e){this.removeAllHandles(),this._destroyOverlay(),this._set("view",e),e&&this.addHandles([e.on("drag",[aRe.zoom],t=>this._handleDrag(t,1),zA.INTERNAL),e.on("drag",[aRe.zoom,aRe.counter],t=>this._handleDrag(t,-1),zA.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(e,t,r,n){this._box.x=e,this._box.y=t,this._box.width=r,this._box.height=n,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(e,t,r,n,s){const o=this.view,a=o.toMap(Vd(e+.5*r,t+.5*n));let l=Math.max(r/o.width,n/o.height);s===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:a,scale:o.scale*l})}_updateBox(e,t,r,n){const s=this._boxShape;s.setAttributeNS(null,"x",""+e),s.setAttributeNS(null,"y",""+t),s.setAttributeNS(null,"width",""+r),s.setAttributeNS(null,"height",""+n),s.setAttributeNS(null,"class",Epe.box)}_updateBackground(e,t,r,n){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(e,t,r,n,this.view.width,this.view.height))}_createContainer(){const e=document.createElement("div");e.className=Epe.container,this.view.root.appendChild(e),this._container=e}_createOverlay(){const e=this.view.width,t=this.view.height,r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"d","M 0 0 L "+e+" 0 L "+e+" "+t+" L 0 "+t+" Z"),r.setAttributeNS(null,"class",Epe.background);const n=document.createElementNS("http://www.w3.org/2000/svg","rect"),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),s.setAttributeNS(null,"class",Epe.overlay),s.appendChild(r),s.appendChild(n),this._container.appendChild(s),this._backgroundShape=r,this._boxShape=n,this._overlay=s}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(e,t,r,n,s,o){const a=e+r,l=t+n;return"M 0 0 L "+s+" 0 L "+s+" "+o+" L 0 "+o+" ZM "+e+" "+t+" L "+e+" "+l+" L "+a+" "+l+" L "+a+" "+t+" Z"}_handleDrag(e,t){const r=e.x,n=e.y,s=e.origin.x,o=e.origin.y;let a,l,u,c;switch(r>s?(a=s,u=r-s):(a=r,u=s-r),n>o?(l=o,c=n-o):(l=n,c=o-n),e.action){case"start":this._start();break;case"update":this._update(a,l,u,c);break;case"end":this._end(a,l,u,c,t)}e.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:e,y:t,width:r,height:n}=this._box;this._updateBox(e,t,r,n),this._updateBackground(e,t,r,n),this._rafId=requestAnimationFrame(this._redraw)}};x([D()],mte.prototype,"navigation",void 0),x([D()],mte.prototype,"view",null),mte=x([Qe("esri.views.2d.navigation.ZoomBox")],mte);const Wgn=mte;let E5=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const t=this.computeDelta(e);this._updateDelta(t)}this.lastValue=e}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(e){return this.lastValue===void 0?NaN:e-this.lastValue}_updateDelta(e){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*e:this.filteredDelta=e}},VKe=class{constructor(e,t,r){this._initialVelocity=e,this._stopVelocity=t,this._friction=r,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,t){const r=this.value(e);return this.value(e+t)-r}valueFromInitialVelocity(e,t){t=Math.min(t,this.duration);const r=1-this.friction;return e*(r**t-1)/Math.log(r)}},qgn=class extends VKe{constructor(e,t,r,n,s){super(e,t,r),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},Ygn=class{constructor(e=300,t=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=r,this.enabled=!0,this._time=new E5(.6),this._screen=[new E5(.4),new E5(.4)],this._scene=[new E5(.6),new E5(.6),new E5(.6)],this._tmpDirection=gr()}add(e,t,r){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(r)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(t[0]),this._scene[1].update(t[1]),this._scene[2].update(t[2]),this._time.update(r)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,t=this._screen[1].filteredDelta,r=e==null||t==null?0:Math.sqrt(e*e+t*t),n=this._time.filteredDelta,s=n==null||r==null?0:r/n;return Math.abs(s)0&&Gc(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new qgn(e,t,r,s==null?0:n/s,this._tmpDirection)}},KU=class extends un{constructor(e){super(e),this.animationTime=0,this.momentumEstimator=new Ygn(500,6,.92),this.momentum=null,this.tmpMomentum=gr(),this.momentumFinished=!1,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this._previousDrag=null,v0(()=>this.momentumFinished,()=>this.navigation.stop())}begin(e,t){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(t),this._previousDrag=t}update(e,t){this.addToEstimator(t);let r=t.center.x,n=t.center.y;const s=this._previousDrag;r=s?s.center.x-r:-r,n=s?n-s.center.y:n,e.viewpoint=ok(this.viewpoint,e.viewpoint,[r||0,n||0]),this._previousDrag=t}end(e,t){this.addToEstimator(t);const r=e.navigation.momentumEnabled;this.momentum=r?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(e),this._previousDrag=null,this.navigation.end()}addToEstimator(e){const t=e.center.x,r=e.center.y,n=TQi(-t,r),s=Do(-t,r,0);this.momentumEstimator.add(n,s,.001*e.timestamp)}onAnimationUpdate(e){this.navigation.animationManager?.animateContinous(e.viewpoint,(t,r)=>{const{momentum:n,animationTime:s,tmpMomentum:o}=this,a=.001*r;if(!(this.momentumFinished=!n||n.isFinished(s))){const l=n.valueDelta(s,a);Gc(o,n.direction,l),ok(t,t,o),e.constraints.constrainByGeometry(t)}this.animationTime+=a})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};x([D()],KU.prototype,"momentumFinished",void 0),x([D()],KU.prototype,"viewpoint",void 0),x([D()],KU.prototype,"navigation",void 0),KU=x([Qe("esri.views.2d.navigation.actions.Pan")],KU);const Xgn=KU;let JYt=class{constructor(e=2.5,t=.01,r=.95,n=12){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=r,this._maxVelocity=n,this.enabled=!0,this.value=new E5(.8),this.time=new E5(.3)}add(e,t){if(this.enabled&&t!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(t)<.01)return;if(this.value.hasFilteredDelta()){const r=this.value.computeDelta(e);this.value.filteredDelta*r<0&&this.value.reset()}}this.time.update(t),this.value.update(e)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let e=this.value.filteredDelta/this.time.filteredDelta;return e=uu(e,-this._maxVelocity,this._maxVelocity),Math.abs(e)Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;e=r+n}super.add(e,t)}},Kgn=class extends VKe{constructor(e,t,r){super(e,t,r)}value(e){const t=super.value(e);return Math.exp(t)}valueDelta(e,t){const r=super.value(e),n=super.value(e+t)-r;return Math.exp(n)}},Zgn=class extends JYt{constructor(e=2.5,t=.01,r=.95,n=12){super(e,t,r,n)}add(e,t){super.add(Math.log(e),t)}createMomentum(e,t,r){return new Kgn(e,t,r)}},ZU=class extends un{constructor(e){super(e),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new Jgn(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new Zgn,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0}),this.addHandles(v0(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(e,t){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=t.angle,this._previousRadius=this._startRadius=t.radius,this._previousCenter=t.center,this._updateTimestamp=null,e.constraints.rotationEnabled&&this.addToRotateEstimator(0,t.timestamp),this.addToZoomEstimator(t,1)}update(e,t){this._updateTimestamp===null&&(this._updateTimestamp=t.timestamp);const r=t.angle,n=t.radius,s=t.center,o=Math.abs(180*(r-this._startAngle)/Math.PI),a=Math.abs(n-this._startRadius),l=this._startRadius/n;if(this._previousRadius&&this._previousCenter){const u=n/this._previousRadius;let c=180*(r-this._previousAngle)/Math.PI;this._rotationDirection=c>=0?1:-1,this._zoomDirection=u>=1?1:-1,e.constraints.rotationEnabled?(this._zoomOnly===null&&t.timestamp-this._updateTimestamp>200&&(this._zoomOnly=a-o>0),this._zoomOnly===null||this._zoomOnly?c=0:this.addToRotateEstimator(r-this._startAngle,t.timestamp)):c=0,this.addToZoomEstimator(t,l),this.navigation.setViewpoint([s.x,s.y],1/u,c,[this._previousCenter.x-s.x,s.y-this._previousCenter.y])}this._previousAngle=r,this._previousRadius=n,this._previousCenter=s}end(e){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(e),this.navigation.end()}addToRotateEstimator(e,t){this._rotationMomentumEstimator.add(e,.001*t)}addToZoomEstimator(e,t){this._zoomMomentumEstimator.add(t,.001*e.timestamp)}canZoomIn(e){const t=e.scale,r=e.constraints.effectiveMaxScale;return r===0||t>r}canZoomOut(e){const t=e.scale,r=e.constraints.effectiveMinScale;return r===0||t{const n=!this.canZoomIn(e)&&this._zoomDirection>1||!this.canZoomOut(e)&&this._zoomDirection<1,s=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=n||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),a=.001*r;if(this._momentumFinished=s&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,a))*this._rotationDirection*180/Math.PI:0;let u=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,a)):1;const c=Ja(),h=Ja();if(this._previousCenter){dl(c,this._previousCenter.x,this._previousCenter.y),dWe(h,e.size,e.padding),lWe(c,c,h);const{constraints:p,scale:m}=e,v=m*u;u<1&&!p.canZoomInTo(v)?(u=m/p.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):u>1&&!p.canZoomOutTo(v)&&(u=m/p.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),yWe(t,e.viewpoint,u,l,c,e.size),e.constraints.constrainByGeometry(t)}}this._animationTime+=a})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};x([D()],ZU.prototype,"_momentumFinished",void 0),x([D()],ZU.prototype,"viewpoint",void 0),x([D()],ZU.prototype,"navigation",void 0),ZU=x([Qe("esri.views.2d.navigation.actions.Pinch")],ZU);const Qgn=ZU,lRe=Ja(),g1t=Ja();let gte=class extends un{constructor(e){super(e),this._previousCenter=Ja(),this.viewpoint=new Ab({targetGeometry:new $i,scale:0,rotation:0})}begin(e,t){this.navigation.begin(),dl(this._previousCenter,t.center.x,t.center.y)}update(e,t){const{state:{size:r,padding:n}}=e;dl(lRe,t.center.x,t.center.y),i5t(g1t,r,n),e.viewpoint=LNe(this.viewpoint,e.state.paddedViewState.viewpoint,r5t(g1t,this._previousCenter,lRe)),kW(this._previousCenter,lRe)}end(){this.navigation.end()}};x([D()],gte.prototype,"viewpoint",void 0),x([D()],gte.prototype,"navigation",void 0),gte=x([Qe("esri.views.2d.actions.Rotate")],gte);const eyn=gte,tG=10,y1t=1,uRe=new Ab({targetGeometry:new $i}),cRe=[0,0],v1t=250;let NI=class extends un{constructor(e){super(e),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new Xgn({navigation:this}),this.rotate=new eyn({navigation:this}),this.pinch=new Qgn({navigation:this}),this.zoomBox=new Wgn({view:this.view,navigation:this})}destroy(){this.pan=zo(this.pan),this.rotate=zo(this.rotate),this.pinch=zo(this.pinch),this.zoomBox=zo(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(v1t)}async zoom(e,t=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return e<1?this.zoomIn(t):this.zoomOut(t);this.setViewpoint(t,e,0,[0,0])}async zoomIn(e){const t=this.view,r=t.constraints.snapToNextScale(t.scale);return this._zoomToScale(r,e)}async zoomOut(e){const t=this.view,r=t.constraints.snapToPreviousScale(t.scale);return this._zoomToScale(r,e)}setViewpoint(e,t,r,n){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,e,t,r,n),this.end()}setViewpointImmediate(e,t=0,r=[0,0],n=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,n,e,t,r)}continousRotateClockwise(){const e=this.view.viewpoint;this.animationManager?.animateContinous(e,t=>{LNe(t,t,-y1t)})}continousRotateCounterclockwise(){const e=this.view.viewpoint;this.animationManager?.animateContinous(e,t=>{LNe(t,t,y1t)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continousPanLeft(){this._continuousPan([-tG,0])}continousPanRight(){this._continuousPan([tG,0])}continousPanUp(){this._continuousPan([0,tG])}continousPanDown(){this._continuousPan([0,-tG])}continuousPanVector({x:e,y:t}){this._continuousPan([e*tG,t*tG])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(e){const t=this.view.viewpoint;this.animationManager?.animateContinous(t,r=>{ok(r,r,e),this.view.constraints.constrainByGeometry(r)})}_startTimer(e){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const t=performance.now()-(this._lastEventTimestamp??0);ts&&!c))return olt(uRe,o,e/s,0,t,a,l),n.constrainByGeometry(uRe),r.goTo(uRe,{animate:!0,pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(e,t,r,n,s){const{view:o}=this,{size:a,padding:l,constraints:u,scale:c,viewpoint:h}=o,p=c*r,m=u.canZoomInTo(p),v=u.canZoomOutTo(p);return(r<1&&!m||r>1&&!v)&&(r=1),ok(h,h,s),olt(e,h,r,n,t,a,l),u.constrainByGeometry(e)}};x([D()],NI.prototype,"animationManager",void 0),x([D({type:Boolean,readOnly:!0})],NI.prototype,"interacting",void 0),x([D()],NI.prototype,"pan",void 0),x([D()],NI.prototype,"pinch",void 0),x([D()],NI.prototype,"rotate",void 0),x([D()],NI.prototype,"view",void 0),x([D()],NI.prototype,"zoomBox",void 0),NI=x([Qe("esri.views.2d.navigation.MapViewNavigation")],NI);const tyn=NI,KYt={shaders:{vertexShader:Rm("magnifier/magnifier.vert"),fragmentShader:Rm("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function iyn(i){return R3(i,KYt)}async function awe(i,e){const{data:t}=await zi(i,{responseType:"image",...e});return t}async function ryn(i){const e=Promise.resolve().then(()=>yJn),t=Promise.resolve().then(()=>_Jn),r=awe((await e).default,{signal:i}),n=awe((await t).default,{signal:i}),s={mask:await r,overlay:await n};return hn(i),s}let nyn=class extends eM{constructor(){super(),this._handles=new cY,this._resourcePixelRatio=1,this.visible=!1}destroy(){this._handles=zo(this._handles),this._disposeRenderResources(),this._resourcesTask=zF(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([Ki(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},js),Ki(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),Ki(()=>e.size,()=>{this._disposeRenderResources(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Cc()}}doRender(e){const t=e.context;if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==aa.MAP||!this._canRender())return;this._updateResources(e);const r=this._magnifier;if(r.position==null)return;const n=e.pixelRatio,s=r.size*n,o=1/r.factor,a=Math.ceil(o*s);this._readbackTexture.resize(a,a);const{size:l}=e.state,u=n*l[0],c=n*l[1],h=.5*a,p=.5*a,m=uu(n*r.position.x,h,u-h-1),v=uu(c-n*r.position.y,p,c-p-1);t.setBlendingEnabled(!0);const w=m-h,S=v-p,I=this._readbackTexture;t.bindTexture(I,0),t.gl.copyTexImage2D(I.descriptor.target,0,I.descriptor.pixelFormat,w,S,a,a,0);const R=this.backgroundColor,L=R?[R.a*R.r/255,R.a*R.g/255,R.a*R.b/255,R.a]:[1,1,1,1],k=(m+r.offset.x*n)/u*2-1,B=(v-r.offset.y*n)/c*2-1,$=s/u*2,V=s/c*2,Y=this._program;t.bindVAO(this._vertexArrayObject),t.bindTexture(this._overlayTexture,6),t.bindTexture(this._maskTexture,7),t.useProgram(Y),Y.setUniform4fv("u_background",L),Y.setUniform1i("u_readbackTexture",0),Y.setUniform1i("u_overlayTexture",6),Y.setUniform1i("u_maskTexture",7),Y.setUniform4f("u_drawPos",k,B,$,V),Y.setUniform1i("u_maskEnabled",r.maskEnabled?1:0),Y.setUniform1i("u_overlayEnabled",r.overlayEnabled?1:0),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawArrays(Eo.TRIANGLE_STRIP,0,4),t.bindVAO()}_canRender(){return this.mask&&this.overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=pE(async r=>{const n=e==null||t==null?ryn(r):null,s=e!=null?zi(e,{responseType:"image",signal:r}).then(u=>u.data):n.then(u=>u.mask),o=t!=null?zi(t,{responseType:"image",signal:r}).then(u=>u.data):n.then(u=>u.overlay),[a,l]=await Promise.all([s,o]);this.mask=a,this.overlay=l,this._disposeRenderResources(),this.requestRender()})}_disposeRenderResources(){this._readbackTexture=ba(this._readbackTexture),this._overlayTexture=ba(this._overlayTexture),this._maskTexture=ba(this._maskTexture),this._vertexArrayObject=ba(this._vertexArrayObject),this._program=ba(this._program)}_updateResources(e){if(e.pixelRatio!==this._resourcePixelRatio&&this._disposeRenderResources(),this._readbackTexture)return;const t=e.context;this._resourcePixelRatio=e.pixelRatio;const r=Math.ceil(this._magnifier.size*e.pixelRatio);this._program=iyn(t);const n=new Uint16Array([0,1,0,0,1,1,1,0]),s=KYt.attributes;this._vertexArrayObject=new wh(t,s,Yqt,{geometry:Aa.createVertex(t,oa.STATIC_DRAW,n)}),this.overlay.width=r,this.overlay.height=r;const o=new Ua;o.internalFormat=ks.RGBA,o.wrapMode=Ls.CLAMP_TO_EDGE,o.samplingMode=Is.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!jWi(this.overlay.src)||!e.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new fl(t,o,this.overlay),this.mask.width=r,this.mask.height=r,o.pixelFormat=o.internalFormat=ks.ALPHA,this._maskTexture=new fl(t,o,this.mask);const a=1/this._magnifier.factor;o.pixelFormat=o.internalFormat=ks.RGBA,o.width=o.height=Math.ceil(a*r),o.samplingMode=Is.LINEAR,o.flipped=!1,this._readbackTexture=new fl(t,o)}};const ZYt=Object.freeze(Object.defineProperty({__proto__:null,GraphicContainer:QA,GraphicsView2D:Tx,get LabelManager(){return JU},MagnifierView2D:nyn,MapViewNavigation:tyn,Stage:Hmn},Symbol.toStringTag,{value:"Module"}));let QYt=class{constructor(e,t,r){this.pixelBlock=e,this.extent=t,this.originalPixelBlock=r}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(e){const t=this.pixelBlock;if(t==null)return;const r=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??t});if(r.pixelBlock==null)return;r.pixelBlock.maskIsAlpha&&(r.pixelBlock.premultiplyAlpha=!0);const n=r.pixelBlock.getAsRGBA(),s=e.createImageData(r.pixelBlock.width,r.pixelBlock.height);s.data.set(n),e.putImageData(s,0,0)}getRenderedRasterPixels(){const e=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return e.pixelBlock==null?null:(e.pixelBlock.maskIsAlpha&&(e.pixelBlock.premultiplyAlpha=!0),{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)})}};function eXt(i){return i&&"render"in i}function tXt(i){const e=document.createElement("canvas");return e.width=i.width,e.height=i.height,i.render(e.getContext("2d")),e}function syn(i){return eXt(i)?i instanceof QYt?i.getRenderedRasterPixels()?.renderedRasterPixels:tXt(i):i}let HKe=class extends eM{constructor(e=null,t=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=t,this.source=e,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(e){this._height=e}get source(){return this._source}set source(e){e==null&&this._source==null||(this._source=e,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(e){this._width=e}beforeRender(e){super.beforeRender(e),this.updateTexture(e)}async setSourceAsync(e,t){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const r=new AbortController,n=ac();return ZH(t,()=>r.abort()),ZH(r,s=>n.reject(s)),this._uploadStatus={controller:r,resolver:n},this.source=e,n.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(e,t){e>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(e,t)}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}setSamplingProfile(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}bind(e,t){this._texture&&e.bindTexture(this._texture,t)}async updateTexture({context:e,painter:t}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(e)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const r=syn(this.source);try{if(this._uploadStatus!=null){const{controller:n,resolver:s}=this._uploadStatus,o={signal:n.signal},{width:a,height:l}=this,u=this._texture;await t.textureUploadManager.enqueueTextureUpdate({data:r,texture:u,width:a,height:l},o),s.resolve(),this._uploadStatus=null}else this._texture.setData(r);this.ready()}catch(n){l3(n)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:Cc()}}_createTexture(e){const t=this.immutable,r=new Ua;return r.internalFormat=t?gs.RGBA8:ks.RGBA,r.wrapMode=Ls.CLAMP_TO_EDGE,r.isImmutable=t,r.width=this._sourceWidth,r.height=this._sourceHeight,new fl(e,r)}},oyn=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.bitmap=new HKe(a),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},ayn=class extends Hle{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),r=this._tileInfoView.getTileResolution(e.level),[n,s]=this._tileInfoView.tileInfo.size;return new oyn(e,r,t[0],t[3],n,s)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[Lq.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&super.doRender(e)}};const iXt=i=>{let e=class extends i{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new ayn(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return e=x([Qe("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};let qye=class extends Ci{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};x([D({readOnly:!0})],qye.prototype,"version",null),qye=x([Qe("esri.views.layers.support.ClipArea")],qye);const WKe=qye;var I7e;let Z$=I7e=class extends WKe{constructor(i){super(i),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new I7e({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"left",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"right",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"top",void 0),x([D({type:[Number,String],json:{write:!0}})],Z$.prototype,"bottom",void 0),Z$=I7e=x([Qe("esri.views.layers.support.ClipRect")],Z$);const lyn=Z$;var A7e;const uyn={base:Nr,key:"type",typeMap:{extent:hr,polygon:$s}};let Yye=A7e=class extends WKe{constructor(i){super(i),this.type="geometry",this.geometry=null}clone(){return new A7e({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};x([D({types:uyn,json:{read:Ro,write:!0}})],Yye.prototype,"geometry",void 0),Yye=A7e=x([Qe("esri.views.layers.support.Geometry")],Yye);const rXt=Yye;let Xye=class extends WKe{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};x([D({type:[[[Number]]],json:{write:!0}})],Xye.prototype,"path",void 0),Xye=x([Qe("esri.views.layers.support.Path")],Xye);const cyn=Xye,hRe=dr.ofType({key:"type",base:null,typeMap:{rect:lyn,path:cyn,geometry:rXt}}),Lm=i=>{let e=class extends i{constructor(){super(...arguments),this.attached=!1,this.clips=new hRe,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){const t=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new qe("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new WCe),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([Ki(()=>this.suspended,n=>{this.container&&(this.container.visible=!n)},Ah),Ki(()=>this.updateSuspended,n=>{this.view&&!n&&this.updateRequested&&this.view.requestUpdate()},Ah),Ki(()=>this.layer?.opacity??1,n=>{this.container&&(this.container.opacity=n)},Ah),Ki(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",n=>{this.container&&(this.container.blendMode=n)},Ah),Ki(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,n=>{this.container&&(this.container.effect=n)},Ah),Ki(()=>this.highlightOptions,n=>this.container.highlightOptions=n,Ah),ju(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},Ah),Ki(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:n})=>{const s=n!=null&&this.isVisibleAtScale(n);s!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",s)},Ah)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(n=>{n===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){const t=this.view?.spatialReference;return t==null||this.supportsSpatialReference(t)}get updateSuspended(){return this.suspended}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating)}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}isVisibleAtScale(t){const r=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!r)return!0;const{minScale:n,maxScale:s}=r;return vDt(t,n,s)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,r){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),r=!this.spatialReferenceSupported,n=this.visibleAtCurrentScale;return r&&(t.spatialReferenceNotSupported=r),n&&(t.outsideScaleRange=n),t}addAttachHandles(t){this.addHandles(t,"attach")}};return x([D()],e.prototype,"attached",void 0),x([D({type:hRe,set(t){const r=ay(t,this._get("clips"),hRe);this._set("clips",r)}})],e.prototype,"clips",void 0),x([D()],e.prototype,"container",void 0),x([D()],e.prototype,"moving",void 0),x([D({readOnly:!0})],e.prototype,"spatialReferenceSupported",null),x([D({readOnly:!0})],e.prototype,"updateParameters",void 0),x([D()],e.prototype,"updateRequested",void 0),x([D()],e.prototype,"updateSuspended",null),x([D()],e.prototype,"updating",null),x([D()],e.prototype,"view",void 0),x([D({readOnly:!0})],e.prototype,"visibleAtCurrentScale",void 0),x([D({type:tse})],e.prototype,"highlightOptions",void 0),e=x([Qe("esri.views.2d.layers.LayerView2D")],e),e};let M7e=class extends XYt{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===aa.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),$Ke(e,!0,t=>{this._renderChildren(t,ax.All)}))}};M7e=x([Qe("esri.views.2d.layers.support.HighlightGraphicContainer")],M7e);const qKe=M7e;function hyn(i){return i instanceof HTMLImageElement?i.naturalWidth:i.width}function dyn(i){return i instanceof HTMLImageElement?i.naturalHeight:i.height}function lwe(i,e,t,r){if(t.level===r.level)return e;const n=i.tileInfo.size,s=i.getTileResolution(t.level),o=i.getTileResolution(r.level);let a=i.getLODInfoAt(r.level);const l=a.getXForColumn(r.col),u=a.getYForRow(r.row);a=i.getLODInfoAt(t.level);const c=a.getXForColumn(t.col),h=a.getYForRow(t.row),p=hyn(e)/n[0],m=dyn(e)/n[1],v=Math.round(p*((l-c)/s)),w=Math.round(m*(-(u-h)/s)),S=Math.round(p*n[0]*(o/s)),I=Math.round(m*n[1]*(o/s)),R=O7e(n);return R.getContext("2d").drawImage(e,v,w,S,I,0,0,n[0],n[1]),R}function O7e(i){const e=document.createElement("canvas");return[e.width,e.height]=i,e}let Aw=class extends iT(U3(rd.EventedMixin(un))){constructor(e){super(e),this._updatingHandles=new Mb,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const t=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";di.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=zo(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){return this.layer?.visible===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready||!1}getSuspendInfo(){const e=this.parent?.suspended?this.parent.suspendInfo:{};return this.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};x([D()],Aw.prototype,"fullOpacity",null),x([D()],Aw.prototype,"layer",void 0),x([D()],Aw.prototype,"parent",void 0),x([D({readOnly:!0})],Aw.prototype,"suspended",null),x([D({readOnly:!0})],Aw.prototype,"suspendInfo",null),x([D({readOnly:!0})],Aw.prototype,"legendEnabled",null),x([D({type:Boolean,readOnly:!0})],Aw.prototype,"updating",null),x([D({readOnly:!0})],Aw.prototype,"updatingProgress",null),x([D()],Aw.prototype,"visible",null),x([D()],Aw.prototype,"view",void 0),Aw=x([Qe("esri.views.layers.LayerView")],Aw);const Nm=Aw,hL=i=>{let e=class extends i{initialize(){this.addHandles(ju(()=>this.layer,"refresh",t=>{this.doRefresh(t.dataChanged).catch(r=>{mo(r)||di.getLogger(this).error(r)})}),"RefreshableLayerView")}};return e=x([Qe("esri.layers.mixins.RefreshableLayerView")],e),e};function dRe(i,e){return e?"xoffset"in e&&e.xoffset?Math.max(i,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(i,Math.abs(e.yoffset||0)):i:i}function pyn(i){let e=0,t=0;for(let r=0;ro.type==="size").map(o=>{const{maxSize:a,minSize:l}=o;return(_1t(a,i)+_1t(l,i))/2});let r=0;const n=t.length;if(n===0)return i;for(let o=0;o{s=dRe(s,o.symbol)}),s}if(e.type==="class-breaks"){let s=n;return e.classBreakInfos.forEach(o=>{s=dRe(s,o.symbol)}),s}return e.type==="dot-density"||e.type,n}function myn(i,e){const{dpi:t,gdbVersion:r,geometry:n,geometryPrecision:s,height:o,historicMoment:a,layerOption:l,mapExtent:u,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:m,returnZ:v,spatialReference:w,timeExtent:S,tolerance:I,width:R}=i.toJSON(),{dynamicLayers:L,layerDefs:k,layerIds:B}=gyn(i),$=e?.geometry!=null?e.geometry:null,V={historicMoment:a,geometryPrecision:s,maxAllowableOffset:c,returnFieldName:h,returnGeometry:p,returnUnformattedValues:m,returnZ:v,tolerance:I},Y=$&&$.toJSON()||n;V.imageDisplay=`${R},${o},${t}`,r&&(V.gdbVersion=r),Y&&(delete Y.spatialReference,V.geometry=JSON.stringify(Y),V.geometryType=ah(Y));const K=w??Y?.spatialReference??u?.spatialReference;if(K&&(V.sr=Hv(K)),V.time=S?[S.start,S.end].join(","):null,u){const{xmin:Q,ymin:re,xmax:ne,ymax:de}=u;V.mapExtent=`${Q},${re},${ne},${de}`}return k&&(V.layerDefs=k),L&&!k&&(V.dynamicLayers=L),V.layers=l==="popup"?"visible":l,B&&!L&&(V.layers+=`:${B.join(",")}`),V}function gyn(i){const{mapExtent:e,floors:t,width:r,sublayers:n,layerIds:s,layerOption:o,gdbVersion:a}=i,l=n?.find(v=>v.layer!=null)?.layer?.serviceSublayers,u=o==="popup",c={},h=M1e({extent:e,width:r,spatialReference:e?.spatialReference}),p=[],m=v=>{const w=h===0,S=v.minScale===0||h<=v.minScale,I=v.maxScale===0||h>=v.maxScale;if(v.visible&&(w||S&&I))if(v.sublayers)v.sublayers.forEach(m);else{if(s?.includes(v.id)===!1||u&&(!v.popupTemplate||!v.popupEnabled))return;p.unshift(v)}};if(n?.forEach(m),n&&!p.length)c.layerIds=[];else{const v=NDt(p,l,a),w=p.map(S=>{const I=Yne(t,S);return S.toExportImageJSON(I)});if(v)c.dynamicLayers=JSON.stringify(w);else{if(n){let I=p.map(({id:R})=>R);s&&(I=I.filter(R=>s.includes(R))),c.layerIds=I}else s?.length&&(c.layerIds=s);const S=yyn(t,p);if(S!=null&&S.length){const I={};for(const R of S)R.definitionExpression&&(I[R.id]=R.definitionExpression);Object.keys(I).length&&(c.layerDefs=JSON.stringify(I))}}}return c}function yyn(i,e){const t=!!i?.length,r=e.filter(n=>n.definitionExpression!=null||t&&n.floorInfo!=null);return r.length?r.map(n=>{const s=Yne(i,n),o=PS(s,n.definitionExpression);return{id:n.id,definitionExpression:o??void 0}}):null}var P7e;let ld=P7e=class extends Ci{static from(i){return Cu(P7e,i)}constructor(i){super(i),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(i,e){e.historicMoment=i&&i.getTime()}};x([D({type:Number,json:{write:!0}})],ld.prototype,"dpi",void 0),x([D()],ld.prototype,"floors",void 0),x([D({type:String,json:{write:!0}})],ld.prototype,"gdbVersion",void 0),x([D({types:Ff,json:{read:Ro,write:!0}})],ld.prototype,"geometry",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"geometryPrecision",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"height",void 0),x([D({type:Date})],ld.prototype,"historicMoment",void 0),x([ur("historicMoment")],ld.prototype,"writeHistoricMoment",null),x([D({type:[Number],json:{write:!0}})],ld.prototype,"layerIds",void 0),x([D({type:["top","visible","all","popup"],json:{write:!0}})],ld.prototype,"layerOption",void 0),x([D({type:hr,json:{write:!0}})],ld.prototype,"mapExtent",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"maxAllowableOffset",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnFieldName",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnGeometry",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnM",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnUnformattedValues",void 0),x([D({type:Boolean,json:{write:!0}})],ld.prototype,"returnZ",void 0),x([D({type:Xi,json:{write:!0}})],ld.prototype,"spatialReference",void 0),x([D()],ld.prototype,"sublayers",void 0),x([D({type:Eg,json:{write:!0}})],ld.prototype,"timeExtent",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"tolerance",void 0),x([D({type:Number,json:{write:!0}})],ld.prototype,"width",void 0),ld=P7e=x([Qe("esri.rest.support.IdentifyParameters")],ld);const nXt=ld;let wO=class extends Ci{constructor(e){super(e),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(e,t){return Us.fromJSON({attributes:{...t.attributes},geometry:{...t.geometry}})}writeFeature(e,t){if(!e)return;const{attributes:r,geometry:n}=e;r&&(t.attributes={...r}),n!=null&&(t.geometry=n.toJSON(),t.geometryType=Yve.toJSON(n.type))}};x([D({type:String,json:{write:!0}})],wO.prototype,"displayFieldName",void 0),x([D({type:Us})],wO.prototype,"feature",void 0),x([Mi("feature",["attributes","geometry"])],wO.prototype,"readFeature",null),x([ur("feature")],wO.prototype,"writeFeature",null),x([D({type:Number,json:{write:!0}})],wO.prototype,"layerId",void 0),x([D({type:String,json:{write:!0}})],wO.prototype,"layerName",void 0),wO=x([Qe("esri.rest.support.IdentifyResult")],wO);const vyn=wO;async function _yn(i,e,t){const r=(e=wyn(e)).geometry?[e.geometry]:[],n=gu(i);return n.path+="/identify",cy(r).then(s=>{const o=myn(e,{geometry:s?.[0]}),a=Ig({...n.query,f:"json",...o}),l=_p(a,t);return zi(n.path,l).then(byn).then(u=>xyn(u,e.sublayers))})}function byn(i){const e=i.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(t=>vyn.fromJSON(t)),e}function wyn(i){return i=nXt.from(i)}function xyn(i,e){if(!e?.length)return i;const t=new Map;function r(n){t.set(n.id,n),n.sublayers&&n.sublayers.forEach(r)}e.forEach(r);for(const n of i.results)n.feature.sourceLayer=t.get(n.layerId);return i}async function JCe(i,e=i.popupTemplate){if(e==null)return[];const t=await e.getRequiredFields(i.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:n,typeIdField:s,globalIdField:o,relationships:a}=i;if(t.includes("*"))return["*"];const l=r?LZi(i):[],u=rB(i.fieldsIndex,[...t,...l]);return s&&u.push(s),u&&n&&i.fieldsIndex?.has(n)&&!u.includes(n)&&u.push(n),u&&o&&i.fieldsIndex?.has(o)&&!u.includes(o)&&u.push(o),a&&a.forEach(c=>{const{keyField:h}=c;u&&h&&i.fieldsIndex?.has(h)&&!u.includes(h)&&u.push(h)}),u}function kF(i,e){return i.popupTemplate?i.popupTemplate:e!=null&&e.defaultPopupTemplateEnabled&&i.defaultPopupTemplate!=null?i.defaultPopupTemplate:null}let pRe=null;function Syn(i,e){return e.type==="tile"||e.type==="map-image"}let XO=class extends un{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=xd(async t=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(t).catch(()=>{}))})}initialize(){const e=t=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(t).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ju(()=>this.highlightGraphics,"change",t=>e(t.added),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:n}}}=this;if(!e)throw new qe("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const s=Tyn(r.sublayers,n,t);if(!s.length)return[];const o=await Eyn(r,s);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!o)throw new qe("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return o?this._fetchPopupFeaturesUsingQueries(e,s,t):this._fetchPopupFeaturesUsingIdentify(e,s,t)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(e){const t=this.highlightGraphics;if(!t)return wa();let r=null;if(e instanceof Us?r=[e]:dr.isCollection(e)&&e.length>0?r=e.toArray():Array.isArray(e)&&e.length>0&&(r=e),r=r?.filter(Ga),!r?.length)return wa();for(const n of r){const s=n.sourceLayer;s!=null&&"geometryType"in s&&s.geometryType==="point"&&(n.visible=!1)}return t.addMany(r),wa(()=>t.removeMany(r??[]))}async _updateHighlightedFeaturesSymbols(e){const{layerView:{view:t},highlightGraphics:r,highlightGraphicUpdated:n}=this;if(r&&n)for(const s of e){const o=s.sourceLayer&&"renderer"in s.sourceLayer&&s.sourceLayer.renderer;s.sourceLayer&&"geometryType"in s.sourceLayer&&s.sourceLayer.geometryType==="point"&&o&&"getSymbolAsync"in o&&o.getSymbolAsync(s).then(async a=>{a||=new Jh;let l=null;const u="visualVariables"in o?o.visualVariables?.find(c=>c.type==="size"):void 0;u&&(pRe||(pRe=(await Promise.resolve().then(()=>L2e)).getSize),l=pRe(u,s,{view:t.type,scale:t.scale,shape:a.type==="simple-marker"?a.style:null})),l||="width"in a&&"height"in a&&a.width!=null&&a.height!=null?Math.max(a.width,a.height):"size"in a?a.size:16,r.includes(s)&&(s.symbol=new Jh({style:"square",size:l,xoffset:"xoffset"in a?a.xoffset:0,yoffset:"yoffset"in a?a.yoffset:0}),n(s,"symbol"),s.visible=!0)})}}async _updateHighlightedFeaturesGeometries(e){const{layerView:{layer:t,view:r},highlightGraphics:n,highlightGraphicUpdated:s}=this;if(this._highlightGeometriesResolution=e,!s||!n?.length||!t.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(e),a=new Map;for(const c of n)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>o){const h=c.sourceLayer;qh(a,h,()=>new Map).set(c.getObjectId(),c)}const l=Array.from(a,([c,h])=>{const p=c.createQuery();return p.objectIds=[...h.keys()],p.outFields=[c.objectIdField],p.returnGeometry=!0,p.maxAllowableOffset=o,p.outSpatialReference=r.spatialReference,c.queryFeatures(p)}),u=await Promise.all(l);if(!this.destroyed)for(const{features:c}of u)for(const h of c){const p=h.sourceLayer,m=a.get(p).get(h.getObjectId());m&&n.includes(m)&&(m.geometry=h.geometry,s(m,"geometry"),this._featuresResolutions.set(m,o))}}_getTargetResolution(e){const t=e*pu(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const n=await this._createIdentifyParameters(e,t,r);if(n==null)return[];const{results:s}=await _yn(this.layerView.layer.parsedUrl,n,r);return s.map(o=>o.feature)}async _createIdentifyParameters(e,t,r){const{floors:n,layer:s,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;await Promise.all(t.map(({sublayer:v})=>v.load(r).catch(()=>{})));const u=Math.min(yi("mapservice-popup-identify-max-tolerance"),s.allSublayers.reduce((v,w)=>w.renderer?b1t({renderer:w.renderer,pointerType:r?.pointerType}):v,2)),c=this.createFetchPopupFeaturesQueryGeometry(e,u),h=fdr(l,a),p=Math.round(c.width/h),m=new hr({xmin:c.center.x-h*p,ymin:c.center.y-h*p,xmax:c.center.x+h*p,ymax:c.center.y+h*p,spatialReference:c.spatialReference});return new nXt({floors:n,gdbVersion:"gdbVersion"in s?s.gdbVersion:void 0,geometry:e,height:p,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:a,sublayers:s.sublayers,timeExtent:o,tolerance:u,width:p})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:n,timeExtent:s}}=this,o=t.map(async({sublayer:a,popupTemplate:l})=>{if(await a.load(r).catch(()=>{}),a.capabilities&&!a.capabilities.operations.supportsQuery)return[];const u=a.createQuery(),c=b1t({renderer:a.renderer,pointerType:r?.pointerType}),h=this.createFetchPopupFeaturesQueryGeometry(e,c),p=new Set,[m]=await Promise.all([JCe(a,l),a.renderer?.collectRequiredFields(p,a.fieldsIndex)]);hn(r),IA(p,a.fieldsIndex,m);const v=Array.from(p).sort();if(u.geometry=h,u.outFields=v,u.timeExtent=s,n){const k=n.clone(),B=Yne(k,a);B!=null&&(u.where=u.where?`(${u.where}) AND (${B})`:B)}const w=this._getTargetResolution(h.width/c),S=await Cyn(l);hn(r);const I=a.geometryType==="point"||S&&S.arcadeUtils.hasGeometryOperations(l);I||(u.maxAllowableOffset=w);let{features:R}=await a.queryFeatures(u,r);const L=I?0:w;R=await Iyn(a,R,r);for(const k of R)this._featuresResolutions.set(k,L);return R});return(await Promise.allSettled(o)).reduce((a,l)=>l.status==="fulfilled"?[...a,...l.value]:a,[]).filter(Ga)}};function Tyn(i,e,t){const r=[];if(!i)return r;const n=s=>{const o=s.minScale===0||e<=s.minScale,a=s.maxScale===0||e>=s.maxScale;if(s.visible&&o&&a){if(s.sublayers)s.sublayers.forEach(n);else if(s.popupEnabled){const l=kF(s,{...t,defaultPopupTemplateEnabled:!1});l!=null&&r.unshift({sublayer:s,popupTemplate:l})}}};return i.map(n),r}function Cyn(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(e=>e.type==="expression")?e_():Promise.resolve()}async function Eyn(i,e){if(i.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:t})=>t.load().then(()=>t.capabilities.operations.supportsQuery)))}catch{return!1}}async function Iyn(i,e,t){const r=i.renderer;return r&&"defaultSymbol"in r&&!r.defaultSymbol&&(e=r.valueExpression?await Promise.all(e.map(n=>r.getSymbolAsync(n,t).then(s=>s?n:null))).then(n=>n.filter(s=>s!=null)):e.filter(n=>r.getSymbol(n)!=null)),e}x([D({constructOnly:!0})],XO.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),x([D({constructOnly:!0})],XO.prototype,"layerView",void 0),x([D({constructOnly:!0})],XO.prototype,"highlightGraphics",void 0),x([D({constructOnly:!0})],XO.prototype,"highlightGraphicUpdated",void 0),x([D({constructOnly:!0})],XO.prototype,"updatingHandles",void 0),XO=x([Qe("esri.views.layers.support.MapService")],XO);function sXt(i,e,t,r=new hr){let n=0;if(t.type==="2d")n=e*(t.resolution??0);else if(t.type==="3d"){const c=t.overlayPixelSizeInMapUnits(i),h=t.basemapSpatialReference;n=h==null||h.equals(t.spatialReference)?e*c:pu(h)/pu(t.spatialReference)}const s=i.x-n,o=i.y-n,a=i.x+n,l=i.y+n,{spatialReference:u}=t;return r.xmin=Math.min(s,a),r.ymin=Math.min(o,l),r.xmax=Math.max(s,a),r.ymax=Math.max(o,l),r.spatialReference=u,r}new hr;const Ayn=[0,0];let yte=class extends hL(iXt(Lm(Nm))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new bx,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new ak(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(r,n)=>this.fetchTile(r,n)}),this._tileStrategy=new Qne({cachePolicy:"keep",resampling:this.resampling,acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView}),Syn(this,this.layer)){const r=this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new XO({createFetchPopupFeaturesQueryGeometry:(n,s)=>sXt(n,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(n,s)=>{r.graphicUpdateHandler({graphic:n,property:s})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t):[]}highlight(e){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(e):wa()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Ya(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),r=t.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(Ayn,t.key),r.resolution=this._tileInfoView.getTileResolution(t.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const r=this.tilemapCache,{signal:n,resamplingLevel:s=0}=t;if(!r)try{return await this._fetchImage(e,n)}catch(l){if(!mo(l)&&!this.resampling)return O7e(this._tileInfoView.tileInfo.size);if(s<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const c=new Tc(u),h=await this.fetchTile(c,{...t,resamplingLevel:s+1});return lwe(this._tileInfoView,h,c,e)}}throw l}const o=new Tc(0,0,0,0);let a;try{if(await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:n}),o.level!==e.level&&!this.resampling)return O7e(this._tileInfoView.tileInfo.size);a=await this._fetchImage(o,n)}catch(l){if(mo(l))throw l;a=await this._fetchImage(e,n)}return this.resampling?lwe(this._tileInfoView,a,o,e):a}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){mo(t)||di.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};x([D()],yte.prototype,"resampling",null),x([D()],yte.prototype,"tilemapCache",null),yte=x([Qe("esri.views.2d.layers.TileLayerView2D")],yte);const Myn=yte,Oyn=Object.freeze(Object.defineProperty({__proto__:null,default:Myn},Symbol.toStringTag,{value:"Module"}));let Jye=class extends Us{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};x([D({type:Boolean})],Jye.prototype,"isAggregate",void 0),Jye=x([Qe("esri.AggregateGraphic")],Jye);const YKe=Jye;let W_=class extends un{constructor(e){super(e),this._filter=null,this.duration=yi("mapview-transitions-duration"),this._excludedEffectView=new W2(e),this._includedEffectView=new W2(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.filter||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),r=e,n=r?.includedEffect,s=r?.excludedEffect,o=this._includedEffectView.canTransitionTo(n)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=n,this._excludedEffectView.effect=s,this._set("featureEffect",r),this._filter=r?.filter||t?.filter||null,o||this.endTransitions()}};x([D()],W_.prototype,"_filter",void 0),x([D()],W_.prototype,"_excludedEffectView",void 0),x([D()],W_.prototype,"_includedEffectView",void 0),x([D()],W_.prototype,"duration",void 0),x([D()],W_.prototype,"excludedEffects",null),x([D()],W_.prototype,"featureEffect",null),x([D()],W_.prototype,"filter",null),x([D()],W_.prototype,"hasEffects",null),x([D()],W_.prototype,"includedEffects",null),x([D({value:0})],W_.prototype,"scale",null),x([D()],W_.prototype,"transitioning",null),W_=x([Qe("esri.layers.effects.FeatureEffectView")],W_);const Pyn=W_;let vte=class extends du{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const r=Xi.fromJSON(t.spatialReference),n=[];for(let s=0;s";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${s}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if(e.type==="update"){const[s,...o]=e.modify;t.onMessage({type:"update",modify:s,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const a of o){const l=this._tiles.get(a.tileId);l&&l.onMessage({type:"update",modify:a,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(e.append==null)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[r,...n]=e.append;t.onMessage({type:"append",clear:e.clear,append:r,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const s of n){const o=this._tiles.get(s.tileId);o&&o.onMessage({type:"update",modify:s,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);yi("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){yi("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Tc(e),r=this._tileInfoView.getTileBounds(Wo(),t),n=this._tileInfoView.getTileResolution(t.level),s=new BKe(t,n,r[0],r[3],!0);if(s.stage=this.getStage(),!s.stage){const o=new qe("featurelayerview:webgl","Cannot create tile with empty stage");di.getLogger("esri.views.2d.layers.features.RenderState").error(o)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;for(let r=-1;r<=1;r++)for(let n=-1;n<=1;n++){if(r===0&&n===0)continue;const s=this._tileInfoView.tileInfo.isWrappable,o=Yjt(e.key,n,r,s).id,a=this._tiles.get(o);if(a!=null){const l=1<r.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const r of this._renderState.tiles())r.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e),e.drawPhase){case aa.MAP:return this._renderMapPhase(e);case aa.HIGHLIGHT:return this._renderHighlightPhase(e);case aa.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(this._instanceStore==null)return null;let t=0,r=null;for(const n of this._instanceStore.values())n.techniqueRef.drawPhase&e&&(t++,n.techniqueRef.postProcessingEnabled&&(r=n));return t>1?null:r}_getOverrideStencilRef({drawPhase:e}){if(this._instanceStore==null)return null;let t=null;for(const r of this._instanceStore.values()){if(!(r.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:n}=r.techniqueRef;if(t==null)t=n;else if(t!==n){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=r;else{const n=new kyn(t,r);this._subscriptions.set(t,n),this.updatingHandles.addPromise(n.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){yi("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new Fyn(()=>this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const n of t)r.set(n.fieldName,{minValue:n.minValue,maxValue:n.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(yi("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){if(hn(t),!this._subscriptions.has(e.id))return;const r=this._subscriptions.get(e.id);if(r.version!==e.subscriptionVesrion){if(yi("esri-2d-update-debug")){const s=`${e.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${s}] Tile[${e.id}] FeatureContainer - Dropping message, outdated version]`,e)}return}const n=this._renderStateNext??this._renderState;if(!n)throw new Error("InternalError: No renderState defined");n.version!==e.version&&console.error(`InternalError: Version mismatch. [renderState: ${n.version}, message: ${e.version}]`),n.updateTile(e),e.end&&this._subscriptions.get(e.id).end(),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:n,y:s})=>n===e.x&&s===e.y);const r=ac();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const n of this.children)if(n.getSortKeys(t).forEach((s,o)=>r.set(o,s)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:r}=this._layer.effectiveScaleRange,n=e.state.scale;n<=(t||1/0)&&n>=r&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(t==null)super.setStencilReference(e);else for(const r of this.children)r.stencilRef=t(r)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,ax.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&$Ke(e,!1,t=>{this._renderFeatures(t,ax.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,ax.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,ax.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,ax.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,r=e.painter.effects.hittest,n=t.getBoundFramebufferObject(),s=t.getViewport(),o=e.passOptions;r.bind(e),e.passOptions=r.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,ax.All),r.draw(e),r.unbind(),t.bindFramebuffer(n),t.restoreViewport(s),e.passOptions=o}_renderFeatures(e,t){for(const n of this.children){if(!n.visible)continue;const s=yi("featurelayer-force-marker-text-draw-order")?OR.STRICT_MARKERS_AND_TEXT:OR.BATCHING,o=n.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,o?.render(e)}const r=this._getExclusivePostprocessingInstance(e);r?.techniqueRef.postProcess(e,r)}};async function Nyn(i){const e=await $R("FeaturePipelineWorker",{client:i,strategy:"dedicated"});return new $yn(e)}let $yn=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const Byn="esri.views.2d.layers.features.FeatureSourceEventLog";let xO=class extends un{constructor(){super(...arguments),this.events=new rd,this._updatingStrategy=!0,this._tileToEvent=new WV,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e[e.length-1].type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":this._tileToEvent.set(e.tile,[e]);break;case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};x([D({readOnly:!0})],xO.prototype,"hasAllFeatures",null),x([D({readOnly:!0})],xO.prototype,"hasAllFeaturesInView",null),x([D({readOnly:!0})],xO.prototype,"hasFullGeometries",null),x([D()],xO.prototype,"_updatingStrategy",void 0),x([D()],xO.prototype,"_strategyInfo",void 0),x([D()],xO.prototype,"_tileToEvent",void 0),xO=x([Qe(Byn)],xO);function XR(i){switch(i.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return null}}function Gx(i,e){const t=i.featureReduction;return t&&t.type!=="selection"&&(!("maxScale"in t)||!t.maxScale||t.maxScale=r?o:s+n*(o-s)}function Vyn(i,e){const t=i/e.minDataValue,r=oE(e.minSize,i),n=oE(e.maxSize,i);let s=null;return s=t*r,uu(s,r,n)}function Hyn(i,e){const[t,r,n]=qyn(i,e.cache.ipData);if(t===r)return oE(e.stops[t].size,i);{const s=oE(e.stops[t].size,i);return s+(oE(e.stops[r].size,i)-s)*n}}function Wyn(i,e){const t=bae[e.valueUnit],r=oE(e.minSize,i),n=oE(e.maxSize,i),{valueRepresentation:s}=e;let o=null;return o=s==="area"?2*Math.sqrt(i/jyn)/t:s==="radius"||s==="distance"?2*i/t:i/t,uu(o,r,n)}function qyn(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((n,s)=>ie.deconflictionStrategy!=="none"))??!1}function yX(i,e){const t=Gx(i,e);if(t?.labelsVisible&&t.labelingInfo?.length)return t.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Yyn(i){return e=>us(oXt(e,i))}function v7(i){const e=i!=null&&"visualVariables"in i&&i.visualVariables;if(!e)return null;for(const t of e)if(t.type==="size")return Yyn(t);return null}function _7(i,e,t,r,n){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,o=PS(e.definitionExpression,s),a=e.customParameters??{};return n&&(a.token=n),{type:"feature",mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{definitionExpression:o,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),outSpatialReference:t.outSpatialReference.toJSON(),timeExtent:e.timeExtent?.toJSON(),customParameters:a}},service:i,tileInfoJSON:t.tileInfoJSON}}function Xyn(i,e,t=0){if(e==null)return i[t]=0,i[t+1]=0,i[t+2]=0,void(i[t+3]=0);const{r,g:n,b:s,a:o}=e;i[t]=r*o/255,i[t+1]=n*o/255,i[t+2]=s*o/255,i[t+3]=o}async function KP(i,e){if(!i)return[];switch(i.type){case"simple-fill":return lXt(i,e);case"picture-fill":return o0n(i,e);case"simple-marker":return Qyn(i,e);case"picture-marker":return e0n(i,e);case"simple-line":return Wle(i,e,!1);case"text":return i0n(i,e);case"label":return r0n(i,e);case"cim":return owe(i.data,e);case"web-style":{const t=await i.fetchCIMSymbol();return owe(t.data,e)}default:throw new Error(`symbol not supported ${i.type}`)}}async function Jyn(i,e){const{schemaOptions:t}=e,{store:r}=t,n=new Array(Ide),s=new Array(Ide/4);for(let u=0;ufte(o.color)),visualVariableOpacity:n.visualVariableOpacity,visualVariableSizeMinMaxValue:n.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:n.visualVariableSizeScaleStops,visualVariableSizeStops:n.visualVariableSizeStops,visualVariableSizeUnitValue:n.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:i.attributes.length},{}).createMeshInfo({params:{size:i.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:RR(n)}});return[...i.backgroundFillSymbol?lXt(i.backgroundFillSymbol,{schemaOptions:e,path:"",uniforms:PR}):[],s]}function aXt(i){if(i.style==="path"){if(i.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:i.path,asFill:!0}}}const e=ym.fromSimpleMarker(i);if("outline"in i&&i.outline&&i.outline.style!=="none"&&i.outline.style!=="solid"){if(!e||!e.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:e.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:NKe(e),overrides:[]}}async function Qyn(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r;if(i.style==="path"||i.outline&&i.outline.style!=="solid"&&i.outline.style!=="none"){const p=ym.fromSimpleMarker(i);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(t.visualVariableRotation&&(p.angleAlignment="Map"),i.style!=="path"){const m=p.symbolLayers[0];if(Nq(e.uniforms)){const v=RR(e.uniforms,0,1);if(v>m.size){const w=v/m.size;m.size=v;const S=m.markerGraphics?.[0].symbol;(S.symbolLayers&&S.symbolLayers[0]).width*=w}}}return owe({type:"CIMSymbolReference",symbol:p},e)}const s=n.ensureInstance(Sc.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),o=aXt(i);let a=i.color?.toArray()??[0,0,0,0];o.resource.type==="CIMVectorMarker"&&(a=[255,255,255,255]);const l=i.style==="triangle"?124/116:1,u=i.size,c=u*l,h=t.visualVariableColor!=null&&(i.style==="cross"||i.style==="x");return[s.createMeshInfo({params:{type:"simple",color:a,height:u,width:c,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:UKe(t)?jb.MAP:jb.SCREEN,outlineColor:i.outline?.color?.toArray()??[0,0,0,0],outlineSize:i.outline?.width??1,referenceSize:u,sprite:o,overrideOutlineColor:h,hasSizeVV:Nq(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:RR(t)}})]}function e0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=n.ensureInstance(Sc.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),o=ym.createPictureMarkerRasterizationParam(i);return o?[s.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:i.height,width:i.width,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:UKe(t)?jb.MAP:jb.SCREEN,outlineColor:null,outlineSize:0,referenceSize:i.height,sprite:o,overrideOutlineColor:!1,hasSizeVV:Nq(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:RR(t)}})]:[]}function t0n(i,e,t){const{uniforms:r,schemaOptions:n}=t,{store:s}=n,o=s.ensureInstance(Sc.marker,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation}},{zoomRange:!1}),a=aXt(i),l=6,u=l*e.width,c=u,h=i.color?.toArray()??e.color?.toArray()??[0,0,0,0],p=i.style==="cross"||i.style==="x";let m;switch(i.placement){case"begin-end":m=Cb.Both;break;case"begin":m=Cb.JustBegin;break;case"end":m=Cb.JustEnd;break;default:m=Cb.None}const v={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:m,offsetAlongLine:0},overrides:[]};return[o.createMeshInfo({params:{type:"simple",color:h,height:c,width:u,offsetX:0,offsetY:0,angle:0,alignment:UKe(r)?jb.MAP:jb.SCREEN,outlineColor:h,outlineSize:p?e.width:0,referenceSize:c/l,sprite:a,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:Nq(r),placement:v,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:RR(r)}})]}function i0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r;return[n.ensureInstance(Sc.text,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:i.backgroundColor?.toArray(),boxBorderLineColor:i.borderLineColor?.toArray(),boxBorderLineSize:i.borderLineSize??0,color:i.color?.toArray()??[0,0,0,0],offsetX:i.xoffset,offsetY:i.yoffset,postAngle:i.angle,fontSize:i.font.size,decoration:i.font.decoration,haloColor:i.haloColor?.toArray()??[0,0,0,0],haloFontSize:i.haloSize??0,lineWidth:i.lineWidth,lineHeightRatio:i.lineHeight,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:i.font.toJSON(),textString:i.text,symbol:ym.createCIMTextSymbolfromTextSymbol(i)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:RR(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function r0n(i,e){const{schemaOptions:t,uniforms:r}=e,{store:n}=t,s=i.symbol,{allowOverrun:o,repeatLabel:a,repeatLabelDistance:l}=i,u={maxScale:i.maxScale??0,minScale:i.minScale??0},c=n.ensureInstance(Sc.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),h=i.labelPlacement,[p,m]=Aqr(h);return[c.createMeshInfo({params:{boxBackgroundColor:s.backgroundColor?.toArray(),boxBorderLineColor:s.borderLineColor?.toArray(),boxBorderLineSize:s.borderLineSize??0,color:s.color?.toArray()??[0,0,0,0],offsetX:s.xoffset,offsetY:s.yoffset,postAngle:s.angle,fontSize:s.font.size,decoration:s.font.decoration,haloColor:s.haloColor?.toArray()??[0,0,0,0],haloFontSize:s.haloSize??0,lineWidth:s.lineWidth,lineHeightRatio:s.lineHeight,horizontalAlignment:p,verticalAlignment:m,repeatLabel:a,repeatLabelDistance:us(l),allowOverrun:o,labelPosition:i.labelPosition,scaleInfo:u,minPixelBuffer:RR(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:s.font.toJSON(),textString:s.text,symbol:ym.createCIMTextSymbolfromTextSymbol(s),primitiveName:"label-override"},useLegacyLabelEvaluationRules:i.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.labelExpressionInfo?.expression??i.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function XKe(i,e){const t=i.width;return{outlineColor:i.color?.toArray()||[0,0,0,1],width:t,referenceWidth:t,capType:i.cap??"round",joinType:i.join??"round",miterLimit:i.miterLimit,hasSizeVV:e}}function n0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=i.color?.toArray()??[0,0,0,0],o={type:"sprite-rasterization-param",resource:{type:"fill-style",style:i.style},overrides:[]};if(i.outline?.style==="solid")return[n.ensureInstance(Sc.patternOutlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:s,...XKe(i.outline,!!t.visualVariableSizeOutlineScaleStops),sprite:o,scaleInfo:null,effects:null}})];const a=[],l=n.ensureInstance(Sc.patternFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:i.color?.toArray()??[0,0,0,0],sprite:o,scaleInfo:null,effects:null}});return a.push(l),i.outline&&a.push(...Wle(i.outline,e,!0)),a}function s0n(i,e){const{uniforms:t,schemaOptions:r}=e,{store:n}=r,s=i.color?.toArray()??[0,0,0,0];if(i.style!=="none"&&i.outline?.style==="solid")return[n.ensureInstance(Sc.outlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:s,...XKe(i.outline,!!t.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})];const o=[];if(i.style!=="none"){const a=n.ensureInstance(Sc.fill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:s,scaleInfo:null,effects:null}});o.push(a)}return i.outline&&o.push(...Wle(i.outline,e,!0)),o}function lXt(i,e){const{style:t}=i;return t&&t!=="none"&&t!=="solid"?n0n(i,e):s0n(i,e)}function o0n(i,e){const{outline:t}=i,{uniforms:r,schemaOptions:n}=e,{store:s}=n,o=[],a=ym.createPictureFillRasterizationParam(i);if(!a)return[];const{width:l,height:u,xoffset:c,yoffset:h,xscale:p,yscale:m}=i,v={color:[255,255,255,255],sprite:a,height:u,aspectRatio:l/u,offsetX:c,offsetY:h,scaleX:p,scaleY:m,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(t?.style==="solid")return[s.ensureInstance(Sc.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...v,...XKe(t,!!r.visualVariableSizeOutlineScaleStops)}})];const w=s.ensureInstance(Sc.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return o.push(w.createMeshInfo({params:v})),t&&o.push(...Wle(t,e,!0)),o}function Wle(i,e,t){const{color:r,style:n,width:s,cap:o,join:a}=i,{schemaOptions:l}=e,{store:u}=l,c=[],h=t?{...PR,visualVariableSizeScaleStops:e.uniforms.visualVariableSizeOutlineScaleStops}:e.uniforms,p={geometry:{visualVariableColor:h.visualVariableColor,visualVariableOpacity:h.visualVariableOpacity,visualVariableSizeMinMaxValue:h.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:h.visualVariableSizeScaleStops,visualVariableSizeStops:h.visualVariableSizeStops,visualVariableSizeUnitValue:h.visualVariableSizeUnitValue}},m={color:r?.toArray()??[0,0,0,0],width:s,referenceWidth:s,capType:o,joinType:a,miterLimit:i.miterLimit,hasSizeVV:Nq(h),effects:null,scaleInfo:null};if(n==null||n==="solid"){const v=u.ensureInstance(Sc.line,p,{zoomRange:!1}).createMeshInfo({params:m});c.push(v)}else if(n!=="none"){const v=u.ensureInstance(Sc.texturedLine,p,{zoomRange:!1}).createMeshInfo({params:{...m,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Ibe(n,o),capStyle:CJe(o)},overrides:[]}}});c.push(v)}return i.marker!=null&&c.push(...t0n(i.marker,i,e)),c}async function _oe(i,e,t){const r=e.labelsVisible&&e.labelingInfo||[],n=XR(e),s=WPt(r,n);return{type:"label",classes:await Promise.all(s.map((o,a)=>a0n(i,o,a,t)))}}async function a0n(i,e,t,r){const n=await KP(e,{path:`${t}`,schemaOptions:i,uniforms:r});return{maxScale:e.maxScale,minScale:e.minScale,expression:e.labelExpressionInfo?.expression??e.labelExpression,where:e.where,meshes:n}}async function boe(i,e){if(!e)return{type:"simple",meshes:[]};switch(e.type){case"simple":return l0n(i,e);case"dot-density":return u0n(i,e);case"class-breaks":return c0n(i,e);case"unique-value":return h0n(i,e);case"dictionary":return d0n(e);case"heatmap":return p0n(i,e);case"pie-chart":return f0n(i,e)}}async function l0n(i,e){const t=e.getSymbols(),r=t.length?t[0]:null,n=nM(e);return{type:"simple",meshes:await KP(r,{schemaOptions:i,uniforms:n,path:"renderer.symbol"})}}async function u0n(i,e){const t=nM(e);return{type:"dot-density",meshes:await Jyn(e,{schemaOptions:i,uniforms:t,path:"renderer.symbol"})}}async function c0n(i,e){const t=nM(e),r=e.backgroundFillSymbol,n=e.normalizationType,s=n==="log"?"esriNormalizeByLog":n==="percent-of-total"?"esriNormalizeByPercentOfTotal":n==="field"?"esriNormalizeByField":null,o=e.classBreakInfos.map(async c=>({meshes:await KP(c.symbol,{path:`renderer-stop-${c.minValue}-${c.maxValue}`,schemaOptions:i,uniforms:t}),min:c.minValue,max:c.maxValue})),a=(await Promise.all(o)).sort((c,h)=>c.min-h.min),l=await KP(r,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...PR,visualVariableSizeOutlineScaleStops:t.visualVariableSizeOutlineScaleStops}}),u=await KP(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:t});return{type:"interval",field:e.field,expression:e.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:a,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:s,isMaxInclusive:e.isMaxInclusive}}async function h0n(i,e){const t=[],r=nM(e),n=await KP(e.backgroundFillSymbol,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...PR,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),s=await KP(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:r});for(const o of e.uniqueValueInfos??[]){const a=await KP(o.symbol,{path:`renderer-unique-value-${o.value}`,schemaOptions:i,uniforms:r});t.push({value:""+o.value,symbol:a})}return{type:"map",field:e.field,expression:e.valueExpression,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,backgroundFill:n,defaultSymbol:s,map:t}}function d0n(i){const e=nM(i),t=i.scaleExpression,r=t!=null&&t!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:i.fieldMap,scaleExpression:r,visualVariableUniforms:e}}async function p0n(i,e){return{type:"heatmap",meshes:await Kyn(e,i)}}async function f0n(i,e){return{type:"pie-chart",meshes:Zyn(e,i)}}async function m0n(i,e){const t=e.renderer,r=nM(t);return{symbology:await boe(i,t),labels:await _oe(i,e,r)}}async function b7(i,e,t,r){const n=t.featureReduction;if(n)switch(n.type){case"binning":return y0n(n,i,e,t,r);case"cluster":return v0n(n,i,e,t,r)}const s=_0n(t.orderBy,t.renderer,t.objectIdField);return{storage:YCe(t.renderer,e.filters),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:await m0n(i,t),sortKey:s,timeZone:e.timeZone}}}function uXt(i,e){return i.fields.map(t=>({...t.toJSON(),type:g0n(t,e)}))}function g0n(i,e){const{onStatisticExpression:t,onStatisticField:r,statisticType:n}=i;switch(n){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:o}=t;return o?o==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const s=e.find(o=>o.name===r);return s?s.type:"esriFieldTypeString"}}}async function y0n(i,e,t,r,n){const s=uXt(i,r.fields),o=i.renderer,a=await boe(e,o),l=YCe(o,[null,null]),u=nM(o),c=await _oe(e,{geometryType:"polygon",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},u);return{storage:l,mesh:{displayRefreshVersion:n,strategy:{type:"binning",fields:s,fixedBinLevel:i.fixedBinLevel,featureFilter:t.filters[0]},factory:{labels:c,symbology:a},sortKey:null,timeZone:t.timeZone}}}async function v0n(i,e,t,r,n){const s=uXt(i,r.fields),o={type:"cluster",feature:await boe(e,i.effectiveFeatureRenderer),cluster:await boe(e,i.effectiveClusterRenderer)},a=nM(i.effectiveFeatureRenderer),l={type:"cluster",feature:await _oe(e,r,a),cluster:await _oe(e,{geometryType:"point",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},a)};return{storage:YCe(i.effectiveFeatureRenderer,[null,null]),mesh:{displayRefreshVersion:n,strategy:{type:"cluster",fields:s,featureFilter:t.filters[0],clusterRadius:us(i.clusterRadius/2)},factory:{labels:l,symbology:o},sortKey:null,timeZone:t.timeZone}}}function _0n(i,e,t){const r=e!=null&&e.type==="unique-value"&&e.orderByClassesEnabled;if(i!=="default"||r||(i=[new W2e({field:t,order:"descending"})]),i!=="default"&&i.length){i.length;const n=i[0],s=n.order==="ascending"?"asc":"desc";return n.field?{field:n.field,order:s}:n.valueExpression?{expression:n.valueExpression,order:s}:null}return r?{byRenderer:!0,order:"asc"}:null}let b0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=t.parent,n=tT(r),{capabilities:s,editingInfo:o,objectIdField:a,globalIdField:l,datesInUnknownTimezone:u,orderBy:c,subtypeField:h,parsedUrl:p}=r,m=r.fieldsIndex.toJSON(),v=XR(t),w=r.timeInfo?.toJSON(),S=t.spatialReference.toJSON(),I=li(p);let R=a;if(c?.length){const L=!c[0].valueExpression&&c[0].field;L&&(R=L)}return{type:"feature-service",source:I,isSourceHosted:Fx(I.path),orderByFields:R,metadata:{timeReferenceUnknownClient:u,subtypeField:h,globalIdField:l,fieldsIndex:m,geometryType:v,objectIdField:a,timeInfo:w,spatialReference:S,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:n,lastEditDate:o?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,timeExtent:o,apiKey:a}=this.layer.parent;return _7(e,{definitionExpression:n,customParameters:s,timeExtent:o},t,r,a)}createProcessorSchema(e,t,r){const{parent:{fields:n,geometryType:s,orderBy:o,objectIdField:a},renderer:l,labelingInfo:u,labelsVisible:c}=this.layer,h={featureReduction:null,fields:n.map(p=>p.toJSON()),geometryType:s,labelingInfo:u,labelsVisible:c,objectIdField:a,orderBy:o??"default",renderer:l?.clone()};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{parent:r,parent:{definitionExpression:n,apiKey:s},renderer:o}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:s,customParameters:JSON.stringify(r.customParameters),definitionExpression:n,labelingInfo:a,orderBy:JSON.stringify(r.orderBy),renderer:o}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function JKe(i,e){const t=i.extent,r=e?.clone().intersection(t),n=r!=null?r.width*r.height:0,s=e?e.width*e.height:0,o=s===0?0:n/s,a=yi("featurelayer-snapshot-point-coverage");return!isNaN(o)&&o>=a}function $q(i,e){return i.floorInfo!=null&&(i.floorInfo.viewAllLevelIds.length>0||e.floors.length>0)}function KKe(i,e,t){const r=w0n(i,e?.where,t);return r&&(e??=new QF,e.where=r),e}function w0n(i,e,t){if(i.floorInfo==null||!t.floors?.length)return e;let r=t.floors;const{floorField:n,viewAllLevelIds:s}=i.floorInfo;s.length&&(r=s);const o=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(o.push("''"),e?.includes(n)){let l=new RegExp("AND \\("+n+".*NULL\\)","g");e=e.replace(l,""),l=new RegExp("\\("+n+".*NULL\\)","g"),e=(e=e.replace(l,"")).replaceAll(/\s+/g," ").trim()}let a="("+n+" IN ({ids}) OR "+n+" IS NULL)";return a=a.replace("{ids}",o.join(", ")),PS(e,a)}let x0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,editingInfo:s,objectIdField:o,typeIdField:a,globalIdField:l,datesInUnknownTimezone:u,orderBy:c,subtypeField:h,refreshInterval:p}=t,m=t.fieldsIndex.toJSON(),v=m.fields,w=XR(t),S=t.timeInfo?.toJSON(),I=t.spatialReference.toJSON(),R=t.types?.map(Y=>Y.toJSON()),L=li(this.layer.parsedUrl);this.layer.dynamicDataSource&&(L.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let k=this.layer.objectIdField;if(c?.length){const Y=!c[0].valueExpression&&c[0].field;Y&&(k=Y)}const B=s?.lastEditDate==null&&p>0,$=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!B,V=$&&JKe(e,t.fullExtent);return{type:"feature-service",source:L,isSourceHosted:Fx(L.path),orderByFields:k,metadata:{typeIdField:a??void 0,types:R,timeReferenceUnknownClient:u,subtypeField:h,globalIdField:l,fields:v,fieldsIndex:m,geometryType:w,objectIdField:o,timeInfo:S,spatialReference:I,subtypes:this.layer.subtypes?.map(Y=>Y.toJSON())},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:s?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:$,supportsSnapshotMaxThreshold:V,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:u,timeExtent:c,apiKey:h}=this.layer;return _7(e,{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeCode:l,subtypeField:u,timeExtent:c},t,r,h)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}hasFilters(e){return $q(this.layer,e)}addFilters(e,t){return KKe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n,gdbVersion:s,apiKey:o,subtypeCode:a}=t,l=this.layer.labelsVisible?this.layer.labelingInfo:null,u=t.historicMoment?.getTime()??void 0,c=JSON.stringify(t.customParameters),h=Gx(t,e)?.toJSON(),p=JSON.stringify(t.orderBy);return{apiKey:o,customParameters:c,definitionExpression:r,featureReduction:h,floors:$q(this.layer,e)?e.floors:null,gdbVersion:s,historicMoment:u,labelingInfo:l,orderBy:p,renderer:n,subtypeCode:a}}};function S0n(i){if(!("openPorts"in i))throw new qe("source-not-supported")}let w1t=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.timeInfo?.toJSON(),u=t.spatialReference.toJSON();return S0n(t.source),{type:"memory",source:await t.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,timeInfo:l,spatialReference:u,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,timeExtent:s}=this.layer;return _7(e,{definitionExpression:n,timeExtent:s,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=Gx(t,e)?.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:o}}},T0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.spatialReference.toJSON();return{type:"memory",source:await t.source.openPorts(),orderByFields:s,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,spatialReference:l,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:n}=this.layer;return _7(e,{definitionExpression:n,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u}=this.layer,c={fields:n.map(h=>h.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u,orderBy:"default"};return b7(e,t,c,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=Gx(t,e)?.toJSON();return{definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:o}}},C0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s}=t,o=t.fieldsIndex.toJSON(),a=XR(t),l=t.timeInfo?.toJSON(),u=t.spatialReference.toJSON(),c=t.source.getSource(),h=this.layer.objectIdField,p=li(n);return p.query.maxRecordCount=c.maxRecordCount,{type:"ogc",source:c,orderByFields:h,metadata:{fieldsIndex:o,geometryType:a,objectIdField:s,timeInfo:l,spatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:p,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{customParameters:n,timeExtent:s,apiKey:o}=this.layer;return _7(e,{customParameters:n,timeExtent:s},t,r,o)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{renderer:r,apiKey:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{apiKey:n,customParameters:o,featureReduction:a,labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:r}}},E0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,objectIdField:s,globalIdField:o,orderBy:a,refreshInterval:l}=t,u=t.fieldsIndex.toJSON(),c=u.fields,h=XR(t),p=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),v=li(this.layer.parsedUrl);let w=this.layer.objectIdField;if(a?.length){const L=!a[0].valueExpression&&a[0].field;L&&(w=L)}const S=l>0,I=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!S,R=I&&JKe(e,t.fullExtent);return{type:"feature-service",source:v,isSourceHosted:Fx(v.path),orderByFields:w,metadata:{globalIdField:o,fields:c,fieldsIndex:u,geometryType:h,objectIdField:s,timeInfo:p,spatialReference:m,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:I,supportsSnapshotMaxThreshold:R,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,timeExtent:o}=this.layer;return _7(e,{definitionExpression:n,customParameters:s,timeExtent:o},t,r,null)}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,orderBy:u,objectIdField:c}=this.layer,h={fields:n.map(p=>p.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:c,orderBy:u??"default"};return b7(e,t,h,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}hasFilters(e){return $q(this.layer,e)}addFilters(e,t){return KKe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:a,customParameters:o,floors:$q(this.layer,e)?e.floors:null}}},I0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=yX(t,e)??dL(t);return[{vvEvaluators:{0:v7(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,{objectIdField:r}=t,n=XR(t),s=t.timeInfo?.toJSON()||null,o=t.spatialReference?t.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:n,objectIdField:r,timeInfo:s,timeReferenceUnknownClient:null,spatialReference:o,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:n,geometryDefinition:s,customParameters:o}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:n,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:o??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(e,t,r){const{fields:n,renderer:s,geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u}=this.layer,c={fields:n.map(h=>h.toJSON()),renderer:s?.clone(),featureReduction:Gx(this.layer,t),geometryType:o,labelingInfo:a,labelsVisible:l,objectIdField:u,orderBy:"default"};return b7(e,t,c,r)}get hasRequiredSupport(){return y7(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,renderer:n}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null,o=JSON.stringify(t.customParameters),a=Gx(t,e)?.toJSON();return{definitionExpression:r,renderer:n,labelingInfo:s,featureReduction:a,customParameters:o,streamFilter:`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`}}};async function A0n(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(({renderer:n})=>boe(i,n)));return{type:"subtype",subtypeField:e,renderers:t.reduce((n,{subtypeCode:s},o)=>({...n,[s]:r[o]}),{})}}function M0n(i,e){const t=lk();return{type:"subtype",filters:i.filters,capabilities:{maxTextureSize:t.maxTextureSize},subtypeField:e.subtypeField,target:"feature",bindings:e.sublayers.reduce((r,{renderer:n,subtypeCode:s})=>({...r,[s]:zKe(n)}),{})}}async function O0n(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(n=>{const s=nM(n.renderer),o={...n,geometryType:n.geometryType??null};return _oe(i,o,s)}));return{type:"subtype",subtypeField:e,renderers:t.reduce((n,{subtypeCode:s},o)=>({...n,[s]:r[o]}),{})}}async function P0n(i,e,t,r){return{storage:M0n(e,t),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:{symbology:await A0n(i,t),labels:await O0n(i,t)},sortKey:null,timeZone:e.timeZone}}}let R0n=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(t=>dL(t))}]}async createServiceOptions(e){const t=this.layer,r=tT(t),{capabilities:n,datesInUnknownTimezone:s,editingInfo:o,globalIdField:a,objectIdField:l,refreshInterval:u,subtypeField:c}=t,h=t.fieldsIndex.toJSON(),p=XR(t),m=t.timeInfo?.toJSON(),v=t.spatialReference.toJSON(),w=li(this.layer.parsedUrl),S=l,I=o?.lastEditDate==null&&u>0,R=yi("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&n?.query.supportsPagination&&!n?.operations.supportsEditing&&!I,L=R&&JKe(e,t.fullExtent);return{type:"feature-service",source:w,isSourceHosted:Fx(w.path),orderByFields:S,metadata:{timeReferenceUnknownClient:s,subtypeField:c,globalIdField:a,fieldsIndex:h,geometryType:p,objectIdField:l,timeInfo:m,spatialReference:v,subtypes:this.layer.subtypes?.map(k=>k.toJSON()),typeIdField:null,types:null},queryMetadata:{capabilities:n,effectiveCapabilities:r,lastEditDate:o?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:R,supportsSnapshotMaxThreshold:L,snapshotCountThresholds:{min:yi("featurelayer-snapshot-point-min-threshold"),max:yi("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:n,customParameters:s,gdbVersion:o,historicMoment:a,subtypeField:l,timeExtent:u,apiKey:c}=this.layer,h=this.layer.sublayers.map(v=>v.subtypeCode).join(","),p=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${h})`:"1=2",m={definitionExpression:PS(n,p),customParameters:s,gdbVersion:o,historicMoment:a,subtypeField:l,timeExtent:u};return _7(e,m,t,r,c)}createProcessorSchema(e,t,r){const n={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,s=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:s.labelingInfo,labelsVisible:s.labelsVisible,renderer:s.renderer,subtypeCode:s.subtypeCode,orderBy:null}))};return P0n(e,t,n,r)}hasFilters(e){return $q(this.layer,e)||D0n(this.layer,e)}addFilters(e,t){e=KKe(this.layer,e,t);const r=this.layer.sublayers.filter(s=>!cXt(s,t)).map(s=>s.subtypeCode);if(!r.length)return e;e??=new QF;const n=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return e.where=PS(e.where,n),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:r,gdbVersion:n,apiKey:s}=t,o=t.historicMoment?.getTime()??void 0,a=JSON.stringify(t.customParameters),l=$q(this.layer,e)?e.floors:null;return{gdbVersion:n,definitionExpression:r,historicMoment:o,customParameters:a,apiKey:s,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce((u,c)=>u+`${c.visible?1:0}.${JSON.stringify(c.renderer)}.${c.labelsVisible} +.${JSON.stringify(c.labelingInfo)}`,""),floors:l}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],n=this.layer.sublayers.find(s=>s.subtypeCode===r);e.layer=e.sourceLayer=n}};function D0n(i,e){return i.sublayers.some(t=>!cXt(t,e))}function cXt(i,e){return i.visible&&(i.minScale===0||W8(e.scale,i.minScale)||e.scalei.maxScale)}async function Wm(i,e){try{return await i}catch(t){if(t.name!=="no-queryEngine")throw t;return e}}let hXt=class{constructor(){this._idToCounters=new Map}get empty(){return this._idToCounters.size===0}addReason(e,t){for(const r of e){let n=this._idToCounters.get(r);n||(n=new Map,this._idToCounters.set(r,n)),n.set(t,(n.get(t)||0)+1)}}deleteReason(e,t){for(const r of e){const n=this._idToCounters.get(r);if(!n)continue;let s=n.get(t);if(s==null)return;s--,s>0?n.set(t,s):n.delete(t),n.size===0&&this._idToCounters.delete(r)}}getHighestReason(e){const t=this._idToCounters.get(e);if(!t)return null;let r=null;for(const n of g9)t.get(n)&&(r=n);return r||null}ids(){return this._idToCounters.keys()}};function iG(i,e){const t=new Set;for(const r of i instanceof Set?i.values():i.keys())e.has(r)||t.add(r);return t}let F0n=class{constructor(e){this.version=e}},k0n=class{constructor(e){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=e}destroy(){}get _coverageSet(){const e=this._coverage?Array.from(this._coverage.keys()).map(t=>t.id):[];return new Set(e)}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(e){return this._version=this._version+1%Number.MAX_SAFE_INTEGER,this._updateCoverage(e),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(e){this._coverage=this._config.tileInfoView.getTileCoverage(e.state,0,!0,"closest")}_updateSubscriptions(){const e=this._coverageSet,t=this._updateVisibility(),r=iG(t,e),n=iG(this._subscriptions,t),s=iG(e,this._subscriptions),o=iG(n,e),a=iG(r,o),l=iG(a,this._paused);this._visible=t;for(const u of s.values())this._subscriptions.set(u,new F0n(this._version));for(const u of l.values())this._paused.add(u);for(const u of o.values())this._subscriptions.delete(u),this._paused.delete(u);(s.size||o.size||l.size)&&this._sendUpdateSubscriptions(s,o,l)}_sendUpdateSubscriptions(e,t,r){const n=Array.from(e.values()).map(s=>({tileId:s,version:this._subscriptions.get(s).version}));this._config.updateSubscriptions({subscribe:n,unsubscribe:Array.from(t.values()),pause:Array.from(r.values()),tileInfoJSON:this._config.tileInfoView.tileInfo.toJSON()})}_updateVisibility(){const e=new Set;if(!this._coverage)return e;for(const t of this._coverage.keys()){if(this._config.isDone(t)){e.add(t.id);continue}this._addVisibleParent(e,t)||this._addVisibleChildren(e,t)||e.add(t.id)}return e}_addVisibleParent(e,t){let r=!1;for(const n of this._visible.values())new Tc(n).containsChild(t)&&(e.add(n),r=!0);return r}_addVisibleChildren(e,t){let r=!1;for(const n of this._visible.values()){const s=new Tc(n);t.containsChild(s)&&(e.add(n),r=!0)}return r}};const L0n=i=>{let e=class extends i{constructor(...t){super(...t),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([Ki(()=>{const t=this.layer;return[t&&"elevationInfo"in t?t.elevationInfo?.featureExpressionInfo:null,t&&"displayField"in t?t.displayField:null,t&&"timeInfo"in t&&t.timeInfo,t&&"renderer"in t&&t.renderer,t&&"labelingInfo"in t&&t.labelingInfo,t&&"floorInfo"in t&&t.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),Ah),ju(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),ju(()=>{const t=this.layer;return t&&"sublayers"in t?t.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:t,layer:{fieldsIndex:r},requiredFields:n}=this;return"outFields"in t&&t.outFields?rB(r,[...e1e(r,t.outFields),...n]):rB(r,n)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(t){this._override("featureEffect",t)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(t){di.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(t){throw new Error("missing implementation")}createQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(t):new Kn(t);if("floorInfo"in this.layer&&this.layer.floorInfo){const n=dat(this);n!=null&&(r.where=r.where?`(${r.where}) AND (${n})`:n)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new Kn(t)}queryFeatures(t,r){throw new Error("missing implementation")}queryObjectIds(t,r){throw new Error("missing implementation")}queryFeatureCount(t,r){throw new Error("missing implementation")}queryExtent(t,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(t,r){return this._validateFetchPopupFeatures(t,r),this._fetchPopupFeatures(t,r)}_loadArcadeModules(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(r=>r.type==="expression")?e_():Promise.resolve()}_handleRequiredFieldsChange(){const t=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",t),t.then(()=>{this._updatingRequiredFieldsPromise===t&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const t=this.view.type==="3d",{layer:r,layer:{fieldsIndex:n,objectIdField:s}}=this,o="renderer"in r&&r.renderer,a="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,c=await Promise.allSettled([o?o.collectRequiredFields(u,n):null,wnt(u,r),t&&"elevationInfo"in r?OZi(u,r):null,this.filter!=null?bnt(u,r,this.filter):null,t||this.featureEffect==null?null:bnt(u,r,this.featureEffect.filter),!t&&l?RZi(u,r,l):null,!t&&a?FZi(u,r,a):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&IA(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&IA(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&t&&r.infoFor3D!=null&&(r.globalIdField==null&&di.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),IA(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){$v(u,n,r.subtypeField);const p=r.sublayers.map(m=>Promise.all([m.renderer?.collectRequiredFields(u,n),wnt(u,m)]));await Promise.allSettled(p)}r.type==="catalog-footprint"&&IA(u,n,[r.parent.itemSourceField,r.parent.itemTypeField]);for(const p of c)p.status==="rejected"&&di.getLogger(this).error(p.reason);$v(u,n,s),t&&"displayField"in r&&r.displayField&&$v(u,n,r.displayField);const h=Array.from(u).sort();this._set("requiredFields",h)}_validateFetchPopupFeatures(t,r){if(r!=null)for(const n of t){const s=n.origin&&"layer"in n.origin?n.origin.layer:n.layer;if("popupEnabled"in s&&!s.popupEnabled)throw new qe("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s});if(n.isAggregate){const o="featureReduction"in s?s.featureReduction:null;if(!(o&&"popupTemplate"in o&&o.popupEnabled&&o.popupTemplate))throw new qe("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s})}else if("popupTemplate"in s&&!kF(s,r))throw new qe("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:s})}}_popupFeatureHasRequiredFields(t,r){return XAt(r,t)}async _fetchPopupFeatures(t,r){const n=new Array(t.length),s=new Map,o=await this._createPopupQuery(t.map(a=>a.origin?.layer??a.layer),r);for(let a=0;athis._createPopupQuery(void 0,t)}}get test(){return this.getTest()}};return x([D()],e.prototype,"_updatingRequiredFieldsPromise",void 0),x([D({readOnly:!0})],e.prototype,"availableFields",null),x([D({readOnly:!0})],e.prototype,"dataUpdating",void 0),x([D({type:JOt})],e.prototype,"featureEffect",null),x([D({type:QF})],e.prototype,"filter",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"layer",void 0),x([D({type:Number})],e.prototype,"maximumNumberOfFeatures",null),x([D({readOnly:!0,type:Boolean})],e.prototype,"maximumNumberOfFeaturesExceeded",null),x([D({readOnly:!0})],e.prototype,"requiredFields",void 0),x([D()],e.prototype,"suspended",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.views.layers.FeatureLayerView")],e),e};function N0n(i,e){const t=new Set;return i&&i.forEach(r=>t.add(r)),e&&e.forEach(r=>t.add(r)),t.has("*")?["*"]:Array.from(t)}const $0n="esri.views.2d.layers.FeatureLayerView2D",x1t=4294967294;let tv=class extends L0n(hL(Lm(Nm))){constructor(){super(...arguments),this._commandsQueue=new WYt({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new hXt,this._updateHighlight=xd(async()=>{const e=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighestReason(t),n=SCe(r);e.push({objectId:t,highlightFlags:n})}this._worker.pipeline.updateHighlight({highlights:e})}),this._lastAvailableFields=[],this.eventLog=new xO,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new Pyn}destroy(){this._worker?.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new qe("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new qe("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&tT(e)?.operations.supportsQuery===!1)throw new qe("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._worker&&this._worker.destroy();const t=this._createClientOptions();this._worker=await Nyn(t)}get hasAllFeatures(){return this.layer.visible&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:n,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:n,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new w1t(this.layer):new x0n(this.layer);case"geojson":case"csv":case"wfs":return new w1t(this.layer);case"subtype-group":return new R0n(this.layer);case"ogc-feature":return new C0n(this.layer);case"stream":return new I0n(this.layer);case"oriented-imagery":return new E0n(this.layer);case"knowledge-graph-sublayer":return new T0n(this.layer);case"catalog-footprint":return new b0n(this.layer);default:this.layer}return null}get updateHash(){if(!this.layerAdapter)return null;const{availableFields:e,_displayRefreshVersion:t,timeExtent:r,clips:n,filter:s,featureEffect:o,_sourceRefreshVersion:a,view:{timeZone:l}}=this,u=JSON.stringify(n),c=o?.toJSON(),h=s?.toJSON();return JSON.stringify({availableFields:e,clipsHash:u,displayRefreshVersion:t,effectHash:c,filterHash:h,sourceRefreshVersion:a,timeExtent:r,timeZone:l,...this.layerAdapter.getUpdateHashProperties(this.view)})}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return this._worker.pipeline.queryHeatmapStatistics(e)}highlight(e,t="highlight"){let r;e instanceof Us?r=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?r=[e]:dr.isCollection(e)&&e.length>0?r=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(r=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const n=r?.filter(Ga);return n?.length?(this._addHighlight(n,t),wa(()=>this._removeHighlight(n,t))):wa()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const r=await this.featureContainer.hitTest(t);if(r.length===0)return null;const{features:n,aggregates:s}=await this._worker.pipeline.getDisplayFeatures(r),o=this.featureContainer.getSortKeys(r),a=({displayId:l},{displayId:u})=>o.has(l)&&o.has(u)?o.get(l)-o.get(u):l-u;return n.sort(a).reverse(),s.sort(a).reverse(),[...s.map(l=>this._createGraphicHit(e,YKe.fromJSON(l))),...n.map(l=>this._createGraphicHit(e,Us.fromJSON(l)))]}queryStatistics(){return Wm(this._worker.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}querySummaryStatistics(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),n,r);return Wm(s,{})}async queryAggregateSummaryStatistics(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{})}async queryUniqueValues(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForUniqueValues(this._cleanUpQuery(e),n,r);return Wm(s,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForClassBreaks(this._cleanUpQuery(e),n,r);return Wm(s,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{classBreakInfos:[]})}async queryHistogram(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.features.executeQueryForHistogram(this._cleanUpQuery(e),n,r);return Wm(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const n={...t,scale:this.view.scale},s=this._worker.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),n,r);return Wm(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(r=>{const n=du.fromJSON(r);return n.features.forEach(s=>this._setLayersForFeature(s)),n})}async queryVisibleFeatures(e,t){const r=this._worker.pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),n=await Wm(r,{features:[]}),s=du.fromJSON(n);return s.features.forEach(o=>this._setLayersForFeature(o)),s}async queryAggregates(e,t){const r=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),n=await Wm(r,{features:[]}),s=Ryn.fromJSON(n);return s.features.forEach(o=>this._setLayersForFeature(o)),s}queryAggregateIds(e,t){const r=this._worker.aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Wm(r,[])}queryAggregateCount(e,t){const r=this._worker.aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Wm(r,0)}queryAggregateJSON(e,t){const r=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Wm(r,{features:[]})}async queryFeaturesJSON(e,t){const r=this._worker.features.executeQuery(this._cleanUpQuery(e),t);return Wm(r,{features:[]})}queryObjectIds(e,t){const r=this._worker.features.executeQueryForIds(this._cleanUpQuery(e),t);return Wm(r,[])}queryFeatureCount(e,t){const r=this._worker.features.executeQueryForCount(this._cleanUpQuery(e),t);return Wm(r,0)}async queryExtent(e,t){const r=this._worker.features.executeQueryForExtent(this._cleanUpQuery(e),t),n=await Wm(r,{count:0,extent:null});return{count:n.count,extent:hr.fromJSON(n.extent)}}async getSampleFeatures(e){return this._worker.pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;const t=this._subscriptionManager.update(e);this.featureContainer.setVisibleTiles(t)}attach(){yi("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),this.featureContainer=new Lyn(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new k0n({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),this._worker.pipeline.updateSubscriptions(e)},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([Ki(()=>this.updateHash,()=>this._update(),js),Ki(()=>this.updateSuspended,e=>{e||this._subscriptionManager.resume()})]),this.layer.type!=="stream"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){yi("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._fields=null,this.featureContainer.destroy(),this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=zo(this._subscriptionManager),this._worker.pipeline.onDetach()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,r=this._updatingRequiredFieldsPromise!=null,n=this.featureContainer.updatingHandles.updating,s=e&&(t||r)||n||this._pipelineUpdating||this.dataUpdating;if(yi("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} -> hasRenderer ${e} -> updatingRequiredFields ${r} -> hasPendingCommand ${t} -> dataUpdating ${this.dataUpdating} -> processing ${this._pipelineUpdating} -> updatingContainer ${n} -`);for(const o of this.featureContainer.subscriptions())console.log(` -> Tile[${o.id}] Done: ${o.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(r=>e.view.stage.painter.textureManager.rasterizeItem(r))),fetchDictionary:t=>Promise.all(t.map(r=>this._fetchDictionaryRequest(r)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if(r.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(a=>a.toJSON()));const s=r.visualVariableUniforms,o=await t.getSymbolAsync(e.feature,{fields:this._fields});return!o||!o.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await owe(o.data,{uniforms:s,path:"renderer",schemaOptions:n})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Kn.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Kn.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const n of t.aggregateIds??[])r.push(n);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){return this.updateSuspended?void this._subscriptionManager.suspend():this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}).catch(l3):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%x1t+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%x1t+1}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some(s=>s.objectId===-1||!s.objectId),n=t&&this.availableFields.includes(t);return r&&!n?(di.getLogger(this).error(new qe("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},n=await this.layerAdapter.createServiceOptions(this.view),s=this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(n,s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)},a=!!nB(this._lastSchema?.source.mutable,o.source.mutable)||!!nB(this._lastSchema?.processor,o.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());yi("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:a});let u=[];Array.isArray(n.source)&&(u=n.source),await this._worker.pipeline.updateSchema(o,l,{transferList:u}),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransitions(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),yi("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){yi("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){try{this.featureContainer.editStart(),await this._worker.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(t){mo(t)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=j0n(this._lastAvailableFields,e);return this._lastAvailableFields=t,OZi(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[U0n(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,outSpatialReference:this.view.spatialReference,tileInfoJSON:this.view.featuresTilingScheme.tileInfo.toJSON(),scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlight(e,t){this._highlightCounter.addReason(e,t),this._updateHighlight().catch(r=>{mo(r)||di.getLogger(this).error(r)})}_removeHighlight(e,t){this._highlightCounter.deleteReason(e,t),this._updateHighlight().catch(r=>{mo(r)||di.getLogger(this).error(r)})}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function U0n(i,e,t,r,n){n&&(n=n.clone());const s=n!=null?n.timeExtent:null,o=t!=null&&s!=null?t.intersection(s):t||s;o&&(n??=new QF,n.timeExtent=o),n=e.addFilters?.(n,i)??n;let a=n?.toJSON()??null;return r.size&&(a??=new QF().toJSON(),a.hiddenIds=Array.from(r)),a}x([D()],tv.prototype,"_worker",void 0),x([D()],tv.prototype,"_commandsQueue",void 0),x([D()],tv.prototype,"_sourceRefreshVersion",void 0),x([D()],tv.prototype,"_displayRefreshVersion",void 0),x([D({readOnly:!0})],tv.prototype,"_pipelineUpdating",void 0),x([D({readOnly:!0})],tv.prototype,"hasAllFeatures",null),x([D({readOnly:!0})],tv.prototype,"hasAllFeaturesInView",null),x([D({readOnly:!0})],tv.prototype,"hasFullGeometries",null),x([D()],tv.prototype,"featureEffectView",void 0),x([D()],tv.prototype,"labelingCollisionInfos",null),x([D()],tv.prototype,"layerAdapter",null),x([D()],tv.prototype,"updateHash",null),x([D()],tv.prototype,"updating",void 0),tv=x([Qe(G0n)],tv);const qle=tv,z0n=Object.freeze(Object.defineProperty({__proto__:null,default:qle},Symbol.toStringTag,{value:"Module"}));let Bq=class extends Vle{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap",brushes:[Lq.bitmap],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}_manageFade(){this.children.reduce((e,t)=>e+(t.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};const V0n=Math.PI/180;function H0n(i){return i*V0n}function W0n(i,e){const t=H0n(e.rotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),[s,o]=e.size;return i[0]=Math.round(o*n+s*r),i[1]=Math.round(o*r+s*n),i}function q0n(i,e,t,r){const[n,s]=e,[o,a]=r,l=.5*t;return i[0]=n-l*o,i[1]=s-l*a,i[2]=n+l*o,i[3]=s+l*a,i}const hN=Wo(),VD=[0,0],Ipe=new Tc(0,0,0,0),BK={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let q_=class extends un{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=BK.hidpi,this.imageMaxWidth=BK.imageMaxWidth,this.imageMaxHeight=BK.imageMaxHeight,this.imageRotationSupported=BK.imageRotationSupported,this.imageNormalizationSupported=BK.imageNormalizationSupported,this.update=xd(async(t,r)=>{if(hn(r),!t.stationary||this.destroyed)return;const n=t.state,s=Zp(n.spatialReference),o=this.hidpi?t.pixelRatio:1,a=this.imageNormalizationSupported&&n.worldScreenWidth&&n.worldScreenWidthl||Math.floor(VD[1]*o)>u,h=s&&(n.extent.xmins.valid[1]),p=!this.imageNormalizationSupported&&h,m=!c&&!p,v=this.imageRotationSupported?n.rotation:0,w=this.container.children.slice();if(m){const S=a?n.paddedViewState.center:n.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(n,VD,S,n.resolution,v,o,r)}else{let S=Math.min(l,u);p&&(S=Math.min(n.worldScreenWidth,S)),this._imagePromise=this._tiledExport(n,S,o,r)}try{const S=await this._imagePromise??[];hn(r);const I=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=S;for(const R of w)S.includes(R)||I.push(R.fadeOut().then(()=>{R.remove(),R.destroy()}));for(const R of S)I.push(R.fadeIn());await Promise.all(I)}catch(S){this._imagePromise=null,_a(S)}},5e3),this.updateExports=xd(async t=>{const r=[];for(const n of this.container.children){if(!n.visible||!n.stage)return;r.push(t(n).then(()=>{n.invalidateTexture(),n.requestRender()}))}this._imagePromise=g0(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,t,r,n,s,o){const a=await this.fetchSource(e,Math.floor(t*s),Math.floor(r*s),{rotation:n,pixelRatio:s,signal:o});hn(o);const l=new HKe(null,!0);return l.x=e.xmin,l.y=e.ymax,l.resolution=e.width/t,l.rotation=n,l.pixelRatio=s,l.opacity=0,this.container.addChild(l),await l.setSourceAsync(a,o),hn(o),l}async _singleExport(e,t,r,n,s,o,a){q0n(hN,r,n,t);const l=iB(hN,e.spatialReference);return[await this._export(l,t[0],t[1],s,o,a)]}_tiledExport(e,t,r,n){const s=fu.create({size:t,spatialReference:e.spatialReference,scales:[e.scale]}),o=new ak(s),a=o.getTileCoverage(e);if(!a)return null;const l=[];return a.forEach((u,c,h,p)=>{Ipe.set(u,c,h,0),o.getTileBounds(hN,Ipe);const m=iB(hN,e.spatialReference);l.push(this._export(m,t,t,0,r,n).then(v=>(p!==0&&(Ipe.set(u,c,h,p),o.getTileBounds(hN,Ipe),v.x=hN[0],v.y=hN[3]),v)))}),Promise.all(l)}};x([D()],q_.prototype,"_imagePromise",void 0),x([D()],q_.prototype,"bitmaps",void 0),x([D()],q_.prototype,"container",void 0),x([D()],q_.prototype,"fetchSource",void 0),x([D()],q_.prototype,"hidpi",void 0),x([D()],q_.prototype,"imageMaxWidth",void 0),x([D()],q_.prototype,"imageMaxHeight",void 0),x([D()],q_.prototype,"imageRotationSupported",void 0),x([D()],q_.prototype,"imageNormalizationSupported",void 0),x([D()],q_.prototype,"requestUpdate",void 0),x([D()],q_.prototype,"updating",null),q_=x([Qe("esri.views.2d.layers.support.ExportStrategy")],q_);const KCe=q_;let _te=class extends hL(Lm(Nm)){update(e){this._strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new Bq,this.container.addChild(this._bitmapContainer),this._strategy=new KCe({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,t,r){return this.layer.fetchImageBitmap(e,t,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};x([D()],_te.prototype,"_strategy",void 0),x([D()],_te.prototype,"updating",void 0),_te=x([Qe("esri.views.2d.layers.BaseDynamicLayerView2D")],_te);const Y0n=_te,X0n=Object.freeze(Object.defineProperty({__proto__:null,default:Y0n},Symbol.toStringTag,{value:"Module"}));let QU=class extends Lm(Nm){constructor(){super(...arguments),this.layerViews=new dr}get dynamicGroupLayerView(){return this.layerViews.find(e=>e.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(e=>e.layer===this.layer?.footprintLayer)}update(e){}moveStart(){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};x([D()],QU.prototype,"dynamicGroupLayerView",null),x([D()],QU.prototype,"footprintLayerView",null),x([D()],QU.prototype,"layerViews",void 0),QU=x([Qe("esri.views.2d.layers.CatalogLayerView2D")],QU);const J0n=QU,K0n=Object.freeze(Object.defineProperty({__proto__:null,default:J0n},Symbol.toStringTag,{value:"Module"})),Ape=Symbol();let R7e=class extends Lm(Nm){constructor(){super(...arguments),this.layerViews=new dr,this._debouncedUpdate=xd(async()=>{const{layer:e,parent:{footprintLayerView:t}}=this;let r=[];if(t){const n=this._createQuery(),{features:s}=await t.queryFeatures(n);this.suspended||(r=s.map(o=>e.acquireLayer(o)))}this.removeHandles(Ape),this.addHandles(r,Ape)})}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0}),v0(()=>this.parent.footprintLayerView?.dataUpdating===!1,()=>this._updateLayers()),Ki(()=>[this.layer.maximumVisibleSublayers,this.suspended,this.parent.footprintLayerView?.filter],()=>this._updateLayers())])}detach(){this.container.removeAllChildren(),this.removeHandles(Ape)}update(e){}moveStart(){}viewChange(){}moveEnd(){}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}_updateLayers(){this.suspended?this.removeHandles(Ape):this._updatingHandles.addPromise(this._debouncedUpdate().catch(e=>{di.getLogger(this).error(e)}))}_createQuery(){const{parent:{footprintLayerView:e},layer:{maximumVisibleSublayers:t,parent:{itemTypeField:r,itemSourceField:n,objectIdField:s,orderBy:o}}}=this,a=`${r} <> 'Scene Service'`,l=e.createQuery();l.returnGeometry=!1,l.num=t,l.outFields=[s,n],l.where=PS(l.where,a);const u=o?.find(c=>c.field&&!c.valueExpression);return u?.field&&(l.orderByFields=[`${u.field} ${u.order==="descending"?"DESC":"ASC"}`]),l}};R7e=x([Qe("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],R7e);const Z0n=R7e,Q0n=Object.freeze(Object.defineProperty({__proto__:null,default:Z0n},Symbol.toStringTag,{value:"Module"}));let Kye=class extends qle{get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||e.suspended===!0)}};x([D()],Kye.prototype,"updateSuspended",null),Kye=x([Qe("esri.views.2d.layers.CatalogFootprintLayerView2D")],Kye);const evn=Kye,tvn=Object.freeze(Object.defineProperty({__proto__:null,default:evn},Symbol.toStringTag,{value:"Module"}));let D7e=class extends Lm(Nm){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,t){if(!this.graphicsViews.length)return null;const r=this.layer;return this.graphicsViews.reverse().flatMap(n=>{const s=this._popupTemplates.get(n),o=n.hitTest(e);for(const a of o)a.layer=r,a.sourceLayer=r,a.popupTemplate=s;return o}).map(n=>({type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){if(this.graphicsViews)for(const t of this.graphicsViews)t.processUpdate(e)}attach(){this.addAttachHandles([Ki(()=>this.layer?.featureCollections,e=>{this._clear();for(const{popupInfo:t,featureSet:r,layerDefinition:n}of e){const s=du.fromJSON(r),o=new dr(s.features),a=n.drawingInfo,l=t?qc.fromJSON(t):null,u=YC(a.renderer),c=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:o,renderer:u,container:new QA(this.view.featuresTilingScheme)});this._graphicsViewMap[s.geometryType]=c,this._popupTemplates.set(c,l),s.geometryType!=="polygon"||this.layer.polygonSymbol?s.geometryType!=="polyline"||this.layer.lineSymbol?s.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=u.symbol):this.layer.lineSymbol=u.symbol:this.layer.polygonSymbol=u.symbol,this.graphicsViews.push(c),this.container.addChild(c.container)}},js),Ki(()=>this.layer?.polygonSymbol,e=>{this._graphicsViewMap.polygon.renderer=new _x({symbol:e})},js),Ki(()=>this.layer?.lineSymbol,e=>{this._graphicsViewMap.polyline.renderer=new _x({symbol:e})},js),Ki(()=>this.layer?.pointSymbol,e=>{this._graphicsViewMap.point.renderer=new _x({symbol:e})},js)])}detach(){this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews)e.viewChange()}_clear(){this.container.removeAllChildren();for(const e of this.graphicsViews)e.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};D7e=x([Qe("esri.views.2d.layers.GeoRSSLayerView2D")],D7e);const ivn=D7e,rvn=Object.freeze(Object.defineProperty({__proto__:null,default:ivn},Symbol.toStringTag,{value:"Module"}));let Zye=class extends Lm(Nm){constructor(){super(...arguments),this._highlightCounter=new hXt}attach(){this.graphicsView=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new QA(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this._updateHighlight()}detach(){this.container.removeAllChildren(),this.graphicsView=zo(this.graphicsView)}async hitTest(e){return this.graphicsView?this.graphicsView.hitTest(e).map(t=>({type:"graphic",graphic:t,mapPoint:e,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(e){this.graphicsView.processUpdate(e)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(e,t="highlight"){let r;typeof e=="number"?r=[e]:e instanceof Us?r=[e.uid]:Array.isArray(e)&&e.length>0?r=typeof e[0]=="number"?e:e.map(s=>s&&s.uid):dr.isCollection(e)&&e.length>0&&(r=e.map(s=>s&&s.uid).toArray());const n=r?.filter(Ga);return n?.length?(this._addHighlight(n,t),wa(()=>this._removeHighlight(n,t))):wa()}_addHighlight(e,t){this._highlightCounter.addReason(e,t),this._updateHighlight()}_removeHighlight(e,t){this._highlightCounter.deleteReason(e,t),this._updateHighlight()}_updateHighlight(){const e=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighestReason(t),n=SCe(r);e.push({objectId:t,highlightFlags:n})}this.graphicsView?.setHighlight(e)}};x([D()],Zye.prototype,"graphicsView",void 0),Zye=x([Qe("esri.views.2d.layers.GraphicsLayerView2D")],Zye);const nvn=Zye,svn=Object.freeze(Object.defineProperty({__proto__:null,default:nvn},Symbol.toStringTag,{value:"Module"}));let ez=class extends Nm{constructor(e){super(e),this.type="group",this.layerViews=new dr}destroy(){this.layerViews.length=0}_allLayerViewVisibility(e){this.layerViews.forEach(t=>{t.visible=e})}initialize(){this.addHandles([this.layerViews.on("change",e=>this._layerViewsChangeHandler(e)),Ki(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},Kl),Ki(()=>this.visible,e=>{this._applyVisibility(()=>this._allLayerViewVisibility(e),()=>{})},Kl)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(e){this._set("layerViews",ay(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,t)=>e+t.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(e=>e.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(e=>e._isOverridden("visible"))}_findLayerViewForLayer(e){return e&&this.layerViews.find(t=>t.layer===e)}_firstVisibleOnLayerOrder(){const e=this.layer.layers.find(t=>!!this._findLayerViewForLayer(t)?.visible);return e&&this._findLayerViewForLayer(e)}_applyExclusiveVisibility(e){e==null&&(e=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(e=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(t=>{t.visible=t===e})}_layerViewsChangeHandler(e){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(r=>Ki(()=>r.visible,n=>this._applyVisibility(()=>{n!==this.visible&&(r.visible=this.visible)},()=>this._applyExclusiveVisibility(n?r:null)),Kl)).toArray(),"grouplayerview:visible");const t=e.added[e.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(t?.visible?t:null))}_applyVisibility(e,t){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?e():this.layer?.visibilityMode==="exclusive"&&t())}};x([D({cast:fY})],ez.prototype,"layerViews",null),x([D({readOnly:!0})],ez.prototype,"updatingProgress",null),x([D()],ez.prototype,"view",void 0),ez=x([Qe("esri.views.layers.GroupLayerView")],ez);const ovn=ez;let F7e=class extends Lm(ovn){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};F7e=x([Qe("esri.views.2d.layers.GroupLayerView2D")],F7e);const avn=F7e,lvn=Object.freeze(Object.defineProperty({__proto__:null,default:avn},Symbol.toStringTag,{value:"Module"}));function uvn(i){const e=dXt(k7e(i)),t=e,r=!0,n=Math.max(e/2,5),s=Math.round(us(i.maxPathLength)/n)+1,o=10,{density:a}=i;return{smoothing:us(i.smoothing),interpolate:!0,velocityScale:i.flowRepresentation==="flow-from"?1:-1,verticesPerLine:s,minSpeedThreshold:.001,segmentLength:n,maxTurnAngle:1,collisions:r,lineCollisionWidth:t,lineSpacing:o,density:a}}function dXt(i){return i.kind==="constant"?i.value[0]:i.values[i.values.length-1]}function S1t(i){const e=i.toRgba();return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function cvn(i){return{kind:"constant",value:[.1,.1,.1,1]}}function k7e(i){if(!i.hasVisualVariables("size"))return{kind:"constant",value:[us(i.trailWidth)]};const e=i.getVisualVariablesForType("size")[0],t=[],r=[];let n;if(e.stops){for(const s of e.stops)t.push(s.value),r.push(us(s.size));n=e.stops.length}else t.push(e.minDataValue,e.maxDataValue),r.push(us(e.minSize),us(e.maxSize)),n=2;return{kind:"ramp",stops:t,values:r,count:n}}function hvn(i){if(!i.hasVisualVariables("color"))return{kind:"constant",value:S1t(i.color)};const e=i.getVisualVariablesForType("color")[0],t=[],r=[];for(const n of e.stops)t.push(n.value),Array.prototype.push.apply(r,S1t(n.color));return{kind:"ramp",stops:t,values:r,count:e.stops.length}}function dvn(i){if(!i.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const e=i.getVisualVariablesForType("opacity")[0],t=[],r=[];for(const n of e.stops)t.push(n.value),r.push(n.opacity);return{kind:"ramp",stops:t,values:r,count:e.stops.length}}function fRe(i,e,t,r){switch(e){case"int":i.setUniform1iv(t,r);break;case"float":i.setUniform1fv(t,r);break;case"vec2":i.setUniform2fv(t,r);break;case"vec3":i.setUniform3fv(t,r);break;case"vec4":i.setUniform4fv(t,r)}}function LF(i,e,t,r){r.kind==="constant"?fRe(i,t,`u_${e}`,r.value):(fRe(i,"float",`u_${e}_stops`,r.stops),fRe(i,t,`u_${e}_values`,r.values),i.setUniform1i(`u_${e}_count`,r.count))}function pvn(i,e){let t=!0;return t=t&&i.collisions===e.collisions,t=t&&i.density===e.density,t=t&&i.interpolate===e.interpolate,t=t&&i.lineCollisionWidth===e.lineCollisionWidth,t=t&&i.lineSpacing===e.lineSpacing,t=t&&i.maxTurnAngle===e.maxTurnAngle,t=t&&i.minSpeedThreshold===e.minSpeedThreshold,t=t&&i.segmentLength===e.segmentLength,t=t&&i.smoothing===e.smoothing,t=t&&i.velocityScale===e.velocityScale,t=t&&i.verticesPerLine===e.verticesPerLine,t}function pXt(i,e){return i===e||i!=null&&e!=null&&i.equals(e)}function fXt(i,e){if(!pvn(i.simulationSettings,e.simulationSettings)||!pXt(i.timeExtent,e.timeExtent))return!1;let t=!0;return t=t&&i.loadImagery===e.loadImagery,t=t&&i.createFlowMesh===e.createFlowMesh,t=t&&i.color.kind===e.color.kind,t=t&&i.opacity.kind===e.opacity.kind,t=t&&i.size.kind===e.size.kind,t}let fvn=class mXt{constructor(e){this._params=e,this.animated=!1}isCompatible(e){if(!(e instanceof mXt)||!pXt(this._params.timeExtent,e._params.timeExtent))return!1;let t=!0;return t=t&&this._params.loadImagery===e._params.loadImagery,t=t&&this._params.color.kind===e._params.color.kind,t=t&&this._params.opacity.kind===e._params.opacity.kind,t}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t);return new yvn(s,{color:this._params.color,opacity:this._params.opacity})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),n.bindTexture(r.texture,0),s.setUniform1i("u_texture",0),s.setUniform1f("u_Min",r.min),s.setUniform1f("u_Max",r.max),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),n.bindVAO(r.vertexArray),n.drawArrays(Eo.TRIANGLE_STRIP,0,4)}};const uwe=new Map;uwe.set("a_position",0),uwe.set("a_texcoord",1);const mvn={geometry:[new Vl("a_position",2,Ti.UNSIGNED_SHORT,0,8),new Vl("a_texcoord",2,Ti.UNSIGNED_SHORT,4,8)]},gvn={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:uwe};let yvn=class{constructor(e,t){this._flowData=e,this._values=t}attach(e){const{context:t}=e,{width:r,height:n}=this._flowData,s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,0,1,r,0,1,1,0,n,0,0,r,n,1,0])),o=new wh(t,uwe,mvn,{geometry:s}),a=[];this._values.color.kind==="ramp"&&a.push("vvColor"),this._values.opacity.kind==="ramp"&&a.push("vvOpacity");const l=e.painter.materialManager.getProgram(gvn,a);let u=1e6,c=-1e6;for(let v=0;v0}isCompatible(e){return e instanceof gXt&&fXt(this._params,e._params)}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,s,t);return new wvn(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",t.time),s.setUniform1f("u_trailLength",this._params.trailLength),s.setUniform1f("u_flowSpeed",this._params.flowSpeed),s.setUniform1f("u_featheringSize",this._params.featheringSize),s.setUniform1f("u_featheringOffset",this._params.featheringOffset),s.setUniform1f("u_introFade",this._params.introFade?1:0),s.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),s.setUniform1f("u_decayRate",this._params.decayRate),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",t.displayViewMat3),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),LF(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(Eo.TRIANGLES,r.indexCount,Ti.UNSIGNED_INT,0)}};const gV=new Map;gV.set("a_xyts0",0),gV.set("a_xyts1",1),gV.set("a_typeIdDurationSeed",2),gV.set("a_extrudeInfo",3);const _vn={geometry:[new Vl("a_xyts0",4,Ti.FLOAT,0,64),new Vl("a_xyts1",4,Ti.FLOAT,16,64),new Vl("a_typeIdDurationSeed",4,Ti.FLOAT,32,64),new Vl("a_extrudeInfo",4,Ti.FLOAT,48,64)]},bvn={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:gV};let wvn=class{constructor(e,t,r){this._vertexData=e,this._indexData=t,this._values=r}attach(e){const{context:t}=e,r=Aa.createVertex(t,oa.STATIC_DRAW,this._vertexData),n=Aa.createIndex(t,oa.STATIC_DRAW,this._indexData),s=new wh(t,gV,_vn,{geometry:r},n),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const a=e.painter.materialManager.getProgram(bvn,o);this.vertexArray=s,this.program=a,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},xvn=class yXt{constructor(e){this._styles=e}get animated(){return this._styles.reduce((e,t)=>e||t.animated,!1)}isCompatible(e){if(!(e instanceof yXt)||this._styles.length!==e._styles.length)return!1;const t=this._styles.length;for(let r=0;rn.load(e,t)));return new Svn(r)}render(e,t,r){for(let n=0;ne&&t.ready,!0)}},Tvn=class vXt{constructor(e){this._params=e}get animated(){return this._params.flowSpeed>0}isCompatible(e){return e instanceof vXt&&fXt(this._params,e._params)}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,s,t);return new Ivn(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",t.time),s.setUniform1f("u_trailLength",this._params.trailLength),s.setUniform1f("u_flowSpeed",this._params.flowSpeed),s.setUniform1f("u_featheringSize",this._params.featheringSize),s.setUniform1f("u_featheringOffset",this._params.featheringOffset),s.setUniform1f("u_introFade",this._params.introFade?1:0),s.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),s.setUniform1f("u_decayRate",this._params.decayRate),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",t.displayViewMat3),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),LF(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(Eo.TRIANGLES,r.indexCount,Ti.UNSIGNED_INT,0)}};const yV=new Map;yV.set("a_positionAndSide",0),yV.set("a_timeInfo",1),yV.set("a_extrude",2),yV.set("a_speed",3);const Cvn={geometry:[new Vl("a_positionAndSide",3,Ti.FLOAT,0,36),new Vl("a_timeInfo",3,Ti.FLOAT,12,36),new Vl("a_extrude",2,Ti.FLOAT,24,36),new Vl("a_speed",1,Ti.FLOAT,32,36)]},Evn={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:yV};let Ivn=class{constructor(e,t,r){this._vertexData=e,this._indexData=t,this._values=r}attach(e){const{context:t}=e,r=Aa.createVertex(t,oa.STATIC_DRAW,this._vertexData),n=Aa.createIndex(t,oa.STATIC_DRAW,this._indexData),s=new wh(t,yV,Cvn,{geometry:r},n),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const a=e.painter.materialManager.getProgram(Evn,o);this.vertexArray=s,this.program=a,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const Avn=4,Mvn=1,Ovn=.5,Pvn=!0,Rvn=!0,Dvn=2.3;function Fvn(i,e){const{flowSpeed:t,trailLength:r}=i,n=uvn(i);let s=null;const o={opacity:dvn(i),size:k7e(i)};let a=hvn(i);if(i.background==="none")o.color=a;else{a.kind==="constant"&&(a={kind:"ramp",stops:[0,1],values:[0,0,0,1,a.value[0],a.value[1],a.value[2],a.value[3]],count:2});const c={loadImagery:e.loadImagery,timeExtent:e.timeExtent,color:a,opacity:{kind:"constant",value:[1]}};s=new fvn(c),o.color=cvn()}const l={loadImagery:e.loadImagery,createFlowMesh:e.createFlowMesh,simulationSettings:n,timeExtent:e.timeExtent,trailLength:r,flowSpeed:t,featheringSize:Mvn,featheringOffset:Ovn,introFade:Pvn,fadeToZero:Rvn,decayRate:Dvn,color:o.color,opacity:o.opacity,size:o.size},u=i.trailCap==="butt"||dXt(k7e(i))<=Avn?new Tvn(l):new vvn(l);return s!=null?new xvn([s,u]):u}let kvn=class extends Qx{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:Cc(),displayViewMat3:Cc()}}dispose(){}prepareState(e){const{context:t}=e;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(Hl.EQUAL,0,255)}draw(e,t){const{requestRender:r,allowDelayedRender:n}=e,{displayData:s}=t;if(s==null||(s.state.name==="loaded"&&s.attach(e),s.state.name!=="attached"))return;const o=s.state.resources;!n||o.ready||r==null?(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=t.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=e.state.displayViewMat3,s.flowStyle.render(e,this._visualState,o),s.flowStyle.animated&&r!=null&&r()):r()}},Lvn=class extends Vle{constructor(){super(...arguments),this.flowStyle=null}doRender(e){super.doRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"flow",brushes:[kvn],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}},Nvn=class{constructor(e,t,r,n){this.state={name:"created"},this.flowStyle=e,this.extent=t,this.size=r,this.pixelRatio=n}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const t={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},r=await this.flowStyle.load(t,e.signal);this.state={name:"loaded",resources:r}}attach(e){if(this.state.name!=="loaded")return void di.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const t=this.state.resources;t.attach(e),this.state={name:"attached",resources:t}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(e){return this.flowStyle.isCompatible(e.flowStyle)?!(!this.extent.equals(e.extent)||this.size[0]!==e.size[0]||this.size[1]!==e.size[1]||this.pixelRatio!==e.pixelRatio)&&(this.flowStyle=e.flowStyle,!0):!1}},$vn=class extends eM{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:t}=this;if(t==null)return;const r=t.extent.xmin,n=t.extent.ymax,s=[0,0];e.toScreen(s,[r,n]);const o=(t.extent.xmax-t.extent.xmin)/t.size[0]/e.resolution,a=Rx(e.rotation),{displayViewScreenMat3:l}=this.transforms;_We(l,[-1,1,0]),_R(l,l,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),h0(l,l,[s[0],s[1],0]),q3(l,l,a),_R(l,l,[o*e.pixelRatio,o*e.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:Cc()}}};const Bvn=1.15;let tz=class extends un{constructor(e){super(e),this._flowDisplayObject=new $vn,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(e){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:r,rotation:n,resolution:s,pixelRatio:o}=e.state,a=Gvn(r,n);a.expand(Bvn);const l=[Math.round((a.xmax-a.xmin)/s),Math.round((a.ymax-a.ymin)/s)],u=new Nvn(t,a,l,o);if(this._loading!=null){if(this._loading.update(u))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(u)||(u.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},c=>{mo(c)||(di.getLogger(this).error("A resource failed to load.",c),this._loading=null)}),this._loading=u)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};x([D()],tz.prototype,"_loading",void 0),x([D()],tz.prototype,"flowContainer",void 0),x([D()],tz.prototype,"updating",null),tz=x([Qe("esri.views.2d.engine.flow.FlowStrategy")],tz);const jvn=tz;function Gvn(i,e){const t=new $i({x:(i.xmax+i.xmin)/2,y:(i.ymax+i.ymin)/2,spatialReference:i.spatialReference}),r=i.xmax-i.xmin,n=i.ymax-i.ymin,s=Math.abs(Math.cos(Rx(e))),o=Math.abs(Math.sin(Rx(e))),a=s*r+o*n,l=o*r+s*n,u=new hr({xmin:t.x-a/2,ymin:t.y-l/2,xmax:t.x+a/2,ymax:t.y+l/2,spatialReference:i.spatialReference});return u.centerAt(t),u}let eC=class extends un{constructor(){super(...arguments),this._loadImagery=(e,t,r,n,s)=>lat(this.layer,e,t,r,n,s),this._createFlowMesh=(e,t,r,n)=>this.layer.createFlowMesh({meshType:e,flowData:r,simulationSettings:t},{signal:n}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:e}=this,t=()=>{this._loadImagery=(r,n,s,o,a)=>lat(e,r,n,s,o,a),this._updateVisualization()};"multidimensionalDefinition"in e?this.addHandles(Ki(()=>e.multidimensionalDefinition,t)):this.addHandles([Ki(()=>e.mosaicRule,t),Ki(()=>e.rasterFunction,t),Ki(()=>e.definitionExpression,t)]),this.container=new Lvn,this._strategy=new jvn({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(e){e.stationary?this._strategy.update(e):this.layerView.requestUpdate()}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const e=this.layer.renderer;if(e==null||e.type!=="flow")return;const t=Fvn(e,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};x([D()],eC.prototype,"_strategy",void 0),x([D()],eC.prototype,"attached",void 0),x([D()],eC.prototype,"container",void 0),x([D()],eC.prototype,"layer",void 0),x([D()],eC.prototype,"layerView",void 0),x([D()],eC.prototype,"type",void 0),x([D()],eC.prototype,"updating",null),x([D()],eC.prototype,"timeExtent",void 0),eC=x([Qe("esri.views.2d.engine.flow.FlowView2D")],eC);const _Xt=eC;let N2=class extends un{constructor(){super(...arguments),this.attached=!1,this.container=new WCe,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Bq}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)})}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new KCe({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{const{source:t}=e;if(!t||t instanceof ImageBitmap)return;const r=await this.layer.applyRenderer({extent:t.extent,pixelBlock:t.originalPixelBlock??t.pixelBlock});t.filter=n=>this.layer.pixelFilter?this.layer.applyFilter(n):{...r,extent:t.extent}}).catch(e=>{mo(e)||di.getLogger(this).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),n=flr(r,t);return n!=null?{extent:n.extent,pixelBlock:n.pixelBlock}:null}return null}async _fetchImage(e,t,r,n){(n=n||{}).timeExtent=this.timeExtent,n.requestAsImageElement=!0,n.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,t,r,n);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer(s.pixelData,{signal:n.signal}),a=new QYt(o.pixelBlock,o.extent?.clone(),s.pixelData.pixelBlock);return a.filter=l=>this.layer.applyFilter(l),a}};x([D()],N2.prototype,"attached",void 0),x([D()],N2.prototype,"container",void 0),x([D()],N2.prototype,"layer",void 0),x([D()],N2.prototype,"strategy",void 0),x([D()],N2.prototype,"timeExtent",void 0),x([D()],N2.prototype,"view",void 0),x([D()],N2.prototype,"updateRequested",void 0),x([D()],N2.prototype,"updating",null),x([D()],N2.prototype,"type",void 0),N2=x([Qe("esri.views.2d.layers.imagery.ImageryView2D")],N2);const Uvn=N2,Mpe=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),T1t=new Float32Array([0,92/255,230/255,1]),zvn={beaufort_ft:Mpe,beaufort_m:Mpe,beaufort_km:Mpe,beaufort_mi:Mpe,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:T1t,single_arrow:T1t,wind_speed:new Float32Array([0,0,0,1])},C1t=[0,20];let bXt=class extends Qx{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE)}draw(e,t){if(t.source==null||t.source.validPixelCount===0)return;const{context:r,timeline:n}=e;if(n.begin(this.name),r.setStencilFunction(Hl.EQUAL,t.stencilRef,255),t.updateVectorFieldVAO(e),e.renderPass==="scalar"){const s=t.vaoData.scalar;s&&this._drawScalars(e,t,s.vao,s.elementCount)}else{const s=t.vaoData.magdir;s&&this._drawTriangles(e,t,s.vao,s.elementCount)}n.end(this.name)}_drawTriangles(e,t,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:u}=t,c=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&c.push("rotationGeographic");const h=o.materialManager.getProgram(this._desc.magdir,c);if(l&&a!=null&&!h.compiled)return void a();s.useProgram(h);const{coordScale:p,opacity:m,transforms:v}=t;h.setUniform2fv("u_coordScale",p),h.setUniform1f("u_opacity",m),h.setUniformMatrix3fv("u_dvsMat3",v.displayViewScreenMat3);const{style:w,dataRange:S,rotation:I,symbolPercentRange:R}=u;h.setUniform4fv("u_colors",zvn[w]),h.setUniform2fv("u_dataRange",S||C1t),h.setUniform1f("u_rotation",I),h.setUniform2fv("u_symbolPercentRange",R);const L=this._getSymbolSize(e,t);h.setUniform2fv("u_symbolSize",L),s.bindVAO(r),s.drawElements(Eo.TRIANGLES,n,Ti.UNSIGNED_INT,0)}_drawScalars(e,t,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:u}=t,c=[];u.style==="wind_speed"?c.push("innerCircle"):u.dataRange&&c.push("dataRange"),u.rotationType==="geographic"&&c.push("rotationGeographic");const h=o.materialManager.getProgram(this._desc.scalar,c);if(l&&a!=null&&!h.compiled)return void a();s.useProgram(h);const{coordScale:p,opacity:m,transforms:v}=t;h.setUniform2fv("u_coordScale",p),h.setUniform1f("u_opacity",m),h.setUniformMatrix3fv("u_dvsMat3",v.displayViewScreenMat3);const{dataRange:w,symbolPercentRange:S}=u;h.setUniform2fv("u_dataRange",w||C1t),h.setUniform2fv("u_symbolPercentRange",S);const I=this._getSymbolSize(e,t);h.setUniform2fv("u_symbolSize",I),s.bindVAO(r),s.drawElements(Eo.TRIANGLES,n,Ti.UNSIGNED_INT,0)}_getSymbolSize(e,t){const r=t.key?2**(e.displayLevel-t.key.level):t.resolution/e.state.resolution,{symbolTileSize:n}=t.symbolizerParameters;return[n/(Math.round((t.width-t.offset[0])/n)*n)/r,n/(Math.round((t.height-t.offset[1])/n)*n)/r]}},Vvn=class extends Vle{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf)",brushes:[bXt],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}},wXt=class extends eM{constructor(e=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=e}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(e){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(e)&&(this._symbolizerParameters=e,this.invalidateVAO())}get source(){return this._source}set source(e){this._source=e,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(e){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:t}=this.symbolizerParameters;switch(t){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const r=Iot(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={magdir:n}}break;case"simple_scalar":{const r=ALe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={scalar:n}}break;case"wind_speed":{const r=Iot(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r),s=ALe(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(e.context,s);this.vaoData={magdir:n,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:Cc()}}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,t){const{vertexData:r,indexData:n}=t,s=Aa.createVertex(e,oa.STATIC_DRAW,new Float32Array(r)),o=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n)),a=xCe("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:Ti.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:Ti.FLOAT,normalized:!1}]});return{vao:new wh(e,a.attributes,a.bufferLayouts,{geometry:s},o),elementCount:n.length}}},Q$=class extends un{constructor(e){super(e),this._loading=null,this.update=xd((t,r)=>this._update(t,r).catch(n=>{mo(n)||di.getLogger(this).error(n)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,r){if(!e.stationary)return;const{extent:n,spatialReference:s}=e.state,o=new hr({xmin:n.xmin,ymin:n.ymin,xmax:n.xmax,ymax:n.ymax,spatialReference:s}),[a,l]=e.state.size;this._loading=this.fetchPixels(o,a,l,r);const u=await this._loading;this._addToDisplay(u,t,e.state),this._loading=null}_addToDisplay(e,t,r){if(e.pixelBlock==null)return this.container.children.forEach(a=>a.destroy()),void this.container.removeAllChildren();const{extent:n,pixelBlock:s}=e,o=new wXt(s);o.offset=[0,0],o.symbolizerParameters=t,o.rawPixelData=e,o.invalidateVAO(),o.x=n.xmin,o.y=n.ymax,o.pixelRatio=r.pixelRatio,o.rotation=r.rotation,o.resolution=r.resolution,o.width=s.width*t.symbolTileSize,o.height=s.height*t.symbolTileSize,this.container.children.forEach(a=>a.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(o)}};x([D()],Q$.prototype,"fetchPixels",void 0),x([D()],Q$.prototype,"container",void 0),x([D()],Q$.prototype,"_loading",void 0),x([D()],Q$.prototype,"updating",null),Q$=x([Qe("esri.views.2d.layers.imagery.ImageryVFStrategy")],Q$);const Hvn=Q$;let $I=class extends un{constructor(){super(...arguments),this.attached=!1,this.container=new Vvn,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,r,n)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:o}=this.layer.renderer,{extent:a,width:l,height:u}=blr(e,t,r,o,s);if(s!=null&&!s.intersects(e))return{extent:a,pixelBlock:null};const c={bbox:`${a.xmin}, ${a.ymin}, ${a.xmax}, ${a.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:o,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(c)){const m=this.getPixelData();if(m!=null&&`${m.extent.xmin}, ${m.extent.ymin}, ${m.extent.xmax}, ${m.extent.ymax}`===c.bbox)return m}const{pixelData:h}=await this.layer.fetchImage(a,l,u,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:n});this._dataParameters=c;const p=h?.pixelBlock;return p==null?{extent:a,pixelBlock:null}:{extent:a,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?AW(p,"vector-uv"):p}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new Hvn({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(Ki(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),Ah),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const e=this.container.children[0]?.rawPixelData;if(this.updating||!e)return null;const{extent:t,pixelBlock:r}=e;return{extent:t,pixelBlock:r}}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams).catch(t=>{mo(t)||di.getLogger(this).error(t)})}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,n=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&r&&n&&s}async _getProjectedFullExtent(e){try{return FF(this.layer.fullExtent,e)}catch{try{const r=(await zi(this.layer.url,{query:{option:"footprints",outSR:Hv(e),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return r?hr.fromJSON(r):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};x([D()],$I.prototype,"attached",void 0),x([D()],$I.prototype,"container",void 0),x([D()],$I.prototype,"layer",void 0),x([D()],$I.prototype,"timeExtent",void 0),x([D()],$I.prototype,"type",void 0),x([D()],$I.prototype,"view",void 0),x([D()],$I.prototype,"updating",null),$I=x([Qe("esri.views.2d.layers.imagery.VectorFieldView2D")],$I);const Wvn=$I,qvn=i=>{let e=class extends i{constructor(){super(...arguments),this.view=null}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=kF(n,r);if(!s||o==null)throw new qe("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=await o.getRequiredFields();hn(r);const l=new Kn;l.timeExtent=this.timeExtent,l.geometry=t,l.outFields=a,l.outSpatialReference=t.spatialReference;const{resolution:u,spatialReference:c}=this.view,h=this.view.type==="2d"?new $i(u,u,c):new $i(.5*u,.5*u,c),{returnTopmostRaster:p,showNoDataRecords:m}=o.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},v={returnDomainValues:!0,returnTopmostRaster:p,pixelSize:h,showNoDataRecords:m,signal:r?.signal};return n.queryVisibleRasters(l,v).then(w=>w)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return x([D()],e.prototype,"layer",void 0),x([D()],e.prototype,"suspended",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.views.layers.ImageryLayerView")],e),e};let bte=class extends qvn(hL(Lm(Nm))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new bx,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:e}=this;return this.updating||!e?null:"getPixelData"in e?e.getPixelData():null}update(e){this.subview?.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([Ki(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},Kl),Ki(()=>this.timeExtent,e=>{const{subview:t}=this;t&&(t.timeExtent=e,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},Kl),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),Ki(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:dr.isCollection(e)?e.at(0):e)instanceof Us))return wa();let r=[];return Array.isArray(e)||dr.isCollection(e)?r=e.map(n=>n.clone()):e instanceof Us&&(r=[e.clone()]),this._highlightGraphics.addMany(r),wa(()=>this._highlightGraphics.removeMany(r))}async doRefresh(){this.requestUpdate()}isUpdating(){const e=!this.subview||this.subview.updating||!!this._highlightView?.updating;return yi("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${e} +`);for(const o of this.featureContainer.subscriptions())console.log(` -> Tile[${o.id}] Done: ${o.done}`)}return s}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:t=>{this._set("_pipelineUpdating",t.pipeline),this._set("dataUpdating",t.data)},emitEvent:t=>{this.emit(t.name,t.event)},get eventLog(){return e.eventLog},fetch:t=>Promise.all(t.map(r=>e.view.stage.painter.textureManager.rasterizeItem(r))),fetchDictionary:t=>Promise.all(t.map(r=>this._fetchDictionaryRequest(r)))}}async _fetchDictionaryRequest(e){try{if(this.layer.type==="subtype-group")throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||t.type!=="dictionary")throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if(r.type!=="dictionary")throw new Error("InternalError: Expected schema to be of type 'dictionary'");const n={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(a=>a.toJSON()));const s=r.visualVariableUniforms,o=await t.getSymbolAsync(e.feature,{fields:this._fields});return!o||!o.data?{type:"dictionary-response",meshes:[]}:{type:"dictionary-response",meshes:await owe(o.data,{uniforms:s,path:"renderer",schemaOptions:n})}}catch{return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Kn.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Kn.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const n of t.aggregateIds??[])r.push(n);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}async _edit(e){return this.updateSuspended?void this._subscriptionManager.suspend():this._validateEdit(e)?this._commandsQueue.push({type:"edit",edits:e}).catch(l3):void 0}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%x1t+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%x1t+1}_validateEdit(e){const t="globalIdField"in this.layer&&this.layer.globalIdField,r=e.deletedFeatures.some(s=>s.objectId===-1||!s.objectId),n=t&&this.availableFields.includes(t);return r&&!n?(di.getLogger(this).error(new qe("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected on the map`)),null):e}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await this._updateRequiredFields(),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this._subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads(),e.updateStart();const t=this.featureEffect,r={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},n=await this.layerAdapter.createServiceOptions(this.view),s=this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(n,s,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(r,s,this._displayRefreshVersion)},a=!!nB(this._lastSchema?.source.mutable,o.source.mutable)||!!nB(this._lastSchema?.processor,o.processor);if(!a)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(),void(this.featureEffectView.featureEffect=t);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());yi("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:a});let u=[];Array.isArray(n.source)&&(u=n.source),await this._worker.pipeline.updateSchema(o,l,{transferList:u}),e.updateEnd(),this.featureEffectView.featureEffect=t,this.featureEffectView.endTransitions(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.swapRenderState(),this.featureContainer.requestRender(),yi("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){yi("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doEdit(e){try{this.featureContainer.editStart(),await this._worker.pipeline.onEdits(e),this.featureContainer.editEnd()}catch(t){mo(t)}}get hasFilter(){const e=this.layerAdapter.hasFilters?.(this.view)??!1;return this.filter!=null||this.timeExtent!=null||this._visibilityOverrides.size>0||e}_getEffectiveAvailableFields(e){const t=N0n(this._lastAvailableFields,e);return this._lastAvailableFields=t,IZi(this.layer.fieldsIndex,t)}_createViewSchemaConfig(){const e=[B0n(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),filters:e,outSpatialReference:this.view.spatialReference,tileInfoJSON:this.view.featuresTilingScheme.tileInfo.toJSON(),scale:this.view.scale,timeZone:this.view.timeZone}}_addHighlight(e,t){this._highlightCounter.addReason(e,t),this._updateHighlight().catch(r=>{mo(r)||di.getLogger(this).error(r)})}_removeHighlight(e,t){this._highlightCounter.deleteReason(e,t),this._updateHighlight().catch(r=>{mo(r)||di.getLogger(this).error(r)})}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),t.geometry!=null&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function B0n(i,e,t,r,n){n&&(n=n.clone());const s=n!=null?n.timeExtent:null,o=t!=null&&s!=null?t.intersection(s):t||s;o&&(n??=new QF,n.timeExtent=o),n=e.addFilters?.(n,i)??n;let a=n?.toJSON()??null;return r.size&&(a??=new QF().toJSON(),a.hiddenIds=Array.from(r)),a}x([D()],tv.prototype,"_worker",void 0),x([D()],tv.prototype,"_commandsQueue",void 0),x([D()],tv.prototype,"_sourceRefreshVersion",void 0),x([D()],tv.prototype,"_displayRefreshVersion",void 0),x([D({readOnly:!0})],tv.prototype,"_pipelineUpdating",void 0),x([D({readOnly:!0})],tv.prototype,"hasAllFeatures",null),x([D({readOnly:!0})],tv.prototype,"hasAllFeaturesInView",null),x([D({readOnly:!0})],tv.prototype,"hasFullGeometries",null),x([D()],tv.prototype,"featureEffectView",void 0),x([D()],tv.prototype,"labelingCollisionInfos",null),x([D()],tv.prototype,"layerAdapter",null),x([D()],tv.prototype,"updateHash",null),x([D()],tv.prototype,"updating",void 0),tv=x([Qe($0n)],tv);const qle=tv,j0n=Object.freeze(Object.defineProperty({__proto__:null,default:qle},Symbol.toStringTag,{value:"Module"}));let Bq=class extends Vle{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap",brushes:[Lq.bitmap],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}_manageFade(){this.children.reduce((e,t)=>e+(t.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}};const G0n=Math.PI/180;function U0n(i){return i*G0n}function z0n(i,e){const t=U0n(e.rotation),r=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),[s,o]=e.size;return i[0]=Math.round(o*n+s*r),i[1]=Math.round(o*r+s*n),i}function V0n(i,e,t,r){const[n,s]=e,[o,a]=r,l=.5*t;return i[0]=n-l*o,i[1]=s-l*a,i[2]=n+l*o,i[3]=s+l*a,i}const hN=Wo(),VD=[0,0],Ipe=new Tc(0,0,0,0),BK={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let q_=class extends un{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=BK.hidpi,this.imageMaxWidth=BK.imageMaxWidth,this.imageMaxHeight=BK.imageMaxHeight,this.imageRotationSupported=BK.imageRotationSupported,this.imageNormalizationSupported=BK.imageNormalizationSupported,this.update=xd(async(t,r)=>{if(hn(r),!t.stationary||this.destroyed)return;const n=t.state,s=Zp(n.spatialReference),o=this.hidpi?t.pixelRatio:1,a=this.imageNormalizationSupported&&n.worldScreenWidth&&n.worldScreenWidthl||Math.floor(VD[1]*o)>u,h=s&&(n.extent.xmins.valid[1]),p=!this.imageNormalizationSupported&&h,m=!c&&!p,v=this.imageRotationSupported?n.rotation:0,w=this.container.children.slice();if(m){const S=a?n.paddedViewState.center:n.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(n,VD,S,n.resolution,v,o,r)}else{let S=Math.min(l,u);p&&(S=Math.min(n.worldScreenWidth,S)),this._imagePromise=this._tiledExport(n,S,o,r)}try{const S=await this._imagePromise??[];hn(r);const I=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=S;for(const R of w)S.includes(R)||I.push(R.fadeOut().then(()=>{R.remove(),R.destroy()}));for(const R of S)I.push(R.fadeIn());await Promise.all(I)}catch(S){this._imagePromise=null,_a(S)}},5e3),this.updateExports=xd(async t=>{const r=[];for(const n of this.container.children){if(!n.visible||!n.stage)return;r.push(t(n).then(()=>{n.invalidateTexture(),n.requestRender()}))}this._imagePromise=g0(r).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,t,r,n,s,o){const a=await this.fetchSource(e,Math.floor(t*s),Math.floor(r*s),{rotation:n,pixelRatio:s,signal:o});hn(o);const l=new HKe(null,!0);return l.x=e.xmin,l.y=e.ymax,l.resolution=e.width/t,l.rotation=n,l.pixelRatio=s,l.opacity=0,this.container.addChild(l),await l.setSourceAsync(a,o),hn(o),l}async _singleExport(e,t,r,n,s,o,a){V0n(hN,r,n,t);const l=iB(hN,e.spatialReference);return[await this._export(l,t[0],t[1],s,o,a)]}_tiledExport(e,t,r,n){const s=fu.create({size:t,spatialReference:e.spatialReference,scales:[e.scale]}),o=new ak(s),a=o.getTileCoverage(e);if(!a)return null;const l=[];return a.forEach((u,c,h,p)=>{Ipe.set(u,c,h,0),o.getTileBounds(hN,Ipe);const m=iB(hN,e.spatialReference);l.push(this._export(m,t,t,0,r,n).then(v=>(p!==0&&(Ipe.set(u,c,h,p),o.getTileBounds(hN,Ipe),v.x=hN[0],v.y=hN[3]),v)))}),Promise.all(l)}};x([D()],q_.prototype,"_imagePromise",void 0),x([D()],q_.prototype,"bitmaps",void 0),x([D()],q_.prototype,"container",void 0),x([D()],q_.prototype,"fetchSource",void 0),x([D()],q_.prototype,"hidpi",void 0),x([D()],q_.prototype,"imageMaxWidth",void 0),x([D()],q_.prototype,"imageMaxHeight",void 0),x([D()],q_.prototype,"imageRotationSupported",void 0),x([D()],q_.prototype,"imageNormalizationSupported",void 0),x([D()],q_.prototype,"requestUpdate",void 0),x([D()],q_.prototype,"updating",null),q_=x([Qe("esri.views.2d.layers.support.ExportStrategy")],q_);const KCe=q_;let _te=class extends hL(Lm(Nm)){update(e){this._strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new Bq,this.container.addChild(this._bitmapContainer),this._strategy=new KCe({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,t,r){return this.layer.fetchImageBitmap(e,t,r)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};x([D()],_te.prototype,"_strategy",void 0),x([D()],_te.prototype,"updating",void 0),_te=x([Qe("esri.views.2d.layers.BaseDynamicLayerView2D")],_te);const H0n=_te,W0n=Object.freeze(Object.defineProperty({__proto__:null,default:H0n},Symbol.toStringTag,{value:"Module"}));let QU=class extends Lm(Nm){constructor(){super(...arguments),this.layerViews=new dr}get dynamicGroupLayerView(){return this.layerViews.find(e=>e.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(e=>e.layer===this.layer?.footprintLayer)}update(e){}moveStart(){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};x([D()],QU.prototype,"dynamicGroupLayerView",null),x([D()],QU.prototype,"footprintLayerView",null),x([D()],QU.prototype,"layerViews",void 0),QU=x([Qe("esri.views.2d.layers.CatalogLayerView2D")],QU);const q0n=QU,Y0n=Object.freeze(Object.defineProperty({__proto__:null,default:q0n},Symbol.toStringTag,{value:"Module"})),Ape=Symbol();let R7e=class extends Lm(Nm){constructor(){super(...arguments),this.layerViews=new dr,this._debouncedUpdate=xd(async()=>{const{layer:e,parent:{footprintLayerView:t}}=this;let r=[];if(t){const n=this._createQuery(),{features:s}=await t.queryFeatures(n);this.suspended||(r=s.map(o=>e.acquireLayer(o)))}this.removeHandles(Ape),this.addHandles(r,Ape)})}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0}),v0(()=>this.parent.footprintLayerView?.dataUpdating===!1,()=>this._updateLayers()),Ki(()=>[this.layer.maximumVisibleSublayers,this.suspended,this.parent.footprintLayerView?.filter],()=>this._updateLayers())])}detach(){this.container.removeAllChildren(),this.removeHandles(Ape)}update(e){}moveStart(){}viewChange(){}moveEnd(){}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}_updateLayers(){this.suspended?this.removeHandles(Ape):this._updatingHandles.addPromise(this._debouncedUpdate().catch(e=>{di.getLogger(this).error(e)}))}_createQuery(){const{parent:{footprintLayerView:e},layer:{maximumVisibleSublayers:t,parent:{itemTypeField:r,itemSourceField:n,objectIdField:s,orderBy:o}}}=this,a=`${r} <> 'Scene Service'`,l=e.createQuery();l.returnGeometry=!1,l.num=t,l.outFields=[s,n],l.where=PS(l.where,a);const u=o?.find(c=>c.field&&!c.valueExpression);return u?.field&&(l.orderByFields=[`${u.field} ${u.order==="descending"?"DESC":"ASC"}`]),l}};R7e=x([Qe("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],R7e);const X0n=R7e,J0n=Object.freeze(Object.defineProperty({__proto__:null,default:X0n},Symbol.toStringTag,{value:"Module"}));let Kye=class extends qle{get updateSuspended(){const e=this.parent?.dynamicGroupLayerView;return this.suspended&&(!e||e.suspended===!0)}};x([D()],Kye.prototype,"updateSuspended",null),Kye=x([Qe("esri.views.2d.layers.CatalogFootprintLayerView2D")],Kye);const K0n=Kye,Z0n=Object.freeze(Object.defineProperty({__proto__:null,default:K0n},Symbol.toStringTag,{value:"Module"}));let D7e=class extends Lm(Nm){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,t){if(!this.graphicsViews.length)return null;const r=this.layer;return this.graphicsViews.reverse().flatMap(n=>{const s=this._popupTemplates.get(n),o=n.hitTest(e);for(const a of o)a.layer=r,a.sourceLayer=r,a.popupTemplate=s;return o}).map(n=>({type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){if(this.graphicsViews)for(const t of this.graphicsViews)t.processUpdate(e)}attach(){this.addAttachHandles([Ki(()=>this.layer?.featureCollections,e=>{this._clear();for(const{popupInfo:t,featureSet:r,layerDefinition:n}of e){const s=du.fromJSON(r),o=new dr(s.features),a=n.drawingInfo,l=t?qc.fromJSON(t):null,u=YC(a.renderer),c=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:o,renderer:u,container:new QA(this.view.featuresTilingScheme)});this._graphicsViewMap[s.geometryType]=c,this._popupTemplates.set(c,l),s.geometryType!=="polygon"||this.layer.polygonSymbol?s.geometryType!=="polyline"||this.layer.lineSymbol?s.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=u.symbol):this.layer.lineSymbol=u.symbol:this.layer.polygonSymbol=u.symbol,this.graphicsViews.push(c),this.container.addChild(c.container)}},js),Ki(()=>this.layer?.polygonSymbol,e=>{this._graphicsViewMap.polygon.renderer=new _x({symbol:e})},js),Ki(()=>this.layer?.lineSymbol,e=>{this._graphicsViewMap.polyline.renderer=new _x({symbol:e})},js),Ki(()=>this.layer?.pointSymbol,e=>{this._graphicsViewMap.point.renderer=new _x({symbol:e})},js)])}detach(){this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews)e.viewChange()}_clear(){this.container.removeAllChildren();for(const e of this.graphicsViews)e.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};D7e=x([Qe("esri.views.2d.layers.GeoRSSLayerView2D")],D7e);const Q0n=D7e,evn=Object.freeze(Object.defineProperty({__proto__:null,default:Q0n},Symbol.toStringTag,{value:"Module"}));let Zye=class extends Lm(Nm){constructor(){super(...arguments),this._highlightCounter=new hXt}attach(){this.graphicsView=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new QA(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this._updateHighlight()}detach(){this.container.removeAllChildren(),this.graphicsView=zo(this.graphicsView)}async hitTest(e){return this.graphicsView?this.graphicsView.hitTest(e).map(t=>({type:"graphic",graphic:t,mapPoint:e,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(e){this.graphicsView.processUpdate(e)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(e,t="highlight"){let r;typeof e=="number"?r=[e]:e instanceof Us?r=[e.uid]:Array.isArray(e)&&e.length>0?r=typeof e[0]=="number"?e:e.map(s=>s&&s.uid):dr.isCollection(e)&&e.length>0&&(r=e.map(s=>s&&s.uid).toArray());const n=r?.filter(Ga);return n?.length?(this._addHighlight(n,t),wa(()=>this._removeHighlight(n,t))):wa()}_addHighlight(e,t){this._highlightCounter.addReason(e,t),this._updateHighlight()}_removeHighlight(e,t){this._highlightCounter.deleteReason(e,t),this._updateHighlight()}_updateHighlight(){const e=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighestReason(t),n=SCe(r);e.push({objectId:t,highlightFlags:n})}this.graphicsView?.setHighlight(e)}};x([D()],Zye.prototype,"graphicsView",void 0),Zye=x([Qe("esri.views.2d.layers.GraphicsLayerView2D")],Zye);const tvn=Zye,ivn=Object.freeze(Object.defineProperty({__proto__:null,default:tvn},Symbol.toStringTag,{value:"Module"}));let ez=class extends Nm{constructor(e){super(e),this.type="group",this.layerViews=new dr}destroy(){this.layerViews.length=0}_allLayerViewVisibility(e){this.layerViews.forEach(t=>{t.visible=e})}initialize(){this.addHandles([this.layerViews.on("change",e=>this._layerViewsChangeHandler(e)),Ki(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},Kl),Ki(()=>this.visible,e=>{this._applyVisibility(()=>this._allLayerViewVisibility(e),()=>{})},Kl)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(e){this._set("layerViews",ay(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,t)=>e+t.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(e=>e.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(e=>e._isOverridden("visible"))}_findLayerViewForLayer(e){return e&&this.layerViews.find(t=>t.layer===e)}_firstVisibleOnLayerOrder(){const e=this.layer.layers.find(t=>!!this._findLayerViewForLayer(t)?.visible);return e&&this._findLayerViewForLayer(e)}_applyExclusiveVisibility(e){e==null&&(e=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(e=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(t=>{t.visible=t===e})}_layerViewsChangeHandler(e){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(r=>Ki(()=>r.visible,n=>this._applyVisibility(()=>{n!==this.visible&&(r.visible=this.visible)},()=>this._applyExclusiveVisibility(n?r:null)),Kl)).toArray(),"grouplayerview:visible");const t=e.added[e.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(t?.visible?t:null))}_applyVisibility(e,t){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?e():this.layer?.visibilityMode==="exclusive"&&t())}};x([D({cast:fY})],ez.prototype,"layerViews",null),x([D({readOnly:!0})],ez.prototype,"updatingProgress",null),x([D()],ez.prototype,"view",void 0),ez=x([Qe("esri.views.layers.GroupLayerView")],ez);const rvn=ez;let F7e=class extends Lm(rvn){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};F7e=x([Qe("esri.views.2d.layers.GroupLayerView2D")],F7e);const nvn=F7e,svn=Object.freeze(Object.defineProperty({__proto__:null,default:nvn},Symbol.toStringTag,{value:"Module"}));function ovn(i){const e=dXt(k7e(i)),t=e,r=!0,n=Math.max(e/2,5),s=Math.round(us(i.maxPathLength)/n)+1,o=10,{density:a}=i;return{smoothing:us(i.smoothing),interpolate:!0,velocityScale:i.flowRepresentation==="flow-from"?1:-1,verticesPerLine:s,minSpeedThreshold:.001,segmentLength:n,maxTurnAngle:1,collisions:r,lineCollisionWidth:t,lineSpacing:o,density:a}}function dXt(i){return i.kind==="constant"?i.value[0]:i.values[i.values.length-1]}function S1t(i){const e=i.toRgba();return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function avn(i){return{kind:"constant",value:[.1,.1,.1,1]}}function k7e(i){if(!i.hasVisualVariables("size"))return{kind:"constant",value:[us(i.trailWidth)]};const e=i.getVisualVariablesForType("size")[0],t=[],r=[];let n;if(e.stops){for(const s of e.stops)t.push(s.value),r.push(us(s.size));n=e.stops.length}else t.push(e.minDataValue,e.maxDataValue),r.push(us(e.minSize),us(e.maxSize)),n=2;return{kind:"ramp",stops:t,values:r,count:n}}function lvn(i){if(!i.hasVisualVariables("color"))return{kind:"constant",value:S1t(i.color)};const e=i.getVisualVariablesForType("color")[0],t=[],r=[];for(const n of e.stops)t.push(n.value),Array.prototype.push.apply(r,S1t(n.color));return{kind:"ramp",stops:t,values:r,count:e.stops.length}}function uvn(i){if(!i.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const e=i.getVisualVariablesForType("opacity")[0],t=[],r=[];for(const n of e.stops)t.push(n.value),r.push(n.opacity);return{kind:"ramp",stops:t,values:r,count:e.stops.length}}function fRe(i,e,t,r){switch(e){case"int":i.setUniform1iv(t,r);break;case"float":i.setUniform1fv(t,r);break;case"vec2":i.setUniform2fv(t,r);break;case"vec3":i.setUniform3fv(t,r);break;case"vec4":i.setUniform4fv(t,r)}}function LF(i,e,t,r){r.kind==="constant"?fRe(i,t,`u_${e}`,r.value):(fRe(i,"float",`u_${e}_stops`,r.stops),fRe(i,t,`u_${e}_values`,r.values),i.setUniform1i(`u_${e}_count`,r.count))}function cvn(i,e){let t=!0;return t=t&&i.collisions===e.collisions,t=t&&i.density===e.density,t=t&&i.interpolate===e.interpolate,t=t&&i.lineCollisionWidth===e.lineCollisionWidth,t=t&&i.lineSpacing===e.lineSpacing,t=t&&i.maxTurnAngle===e.maxTurnAngle,t=t&&i.minSpeedThreshold===e.minSpeedThreshold,t=t&&i.segmentLength===e.segmentLength,t=t&&i.smoothing===e.smoothing,t=t&&i.velocityScale===e.velocityScale,t=t&&i.verticesPerLine===e.verticesPerLine,t}function pXt(i,e){return i===e||i!=null&&e!=null&&i.equals(e)}function fXt(i,e){if(!cvn(i.simulationSettings,e.simulationSettings)||!pXt(i.timeExtent,e.timeExtent))return!1;let t=!0;return t=t&&i.loadImagery===e.loadImagery,t=t&&i.createFlowMesh===e.createFlowMesh,t=t&&i.color.kind===e.color.kind,t=t&&i.opacity.kind===e.opacity.kind,t=t&&i.size.kind===e.size.kind,t}let hvn=class mXt{constructor(e){this._params=e,this.animated=!1}isCompatible(e){if(!(e instanceof mXt)||!pXt(this._params.timeExtent,e._params.timeExtent))return!1;let t=!0;return t=t&&this._params.loadImagery===e._params.loadImagery,t=t&&this._params.color.kind===e._params.color.kind,t=t&&this._params.opacity.kind===e._params.opacity.kind,t}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t);return new fvn(s,{color:this._params.color,opacity:this._params.opacity})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),n.bindTexture(r.texture,0),s.setUniform1i("u_texture",0),s.setUniform1f("u_Min",r.min),s.setUniform1f("u_Max",r.max),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),n.bindVAO(r.vertexArray),n.drawArrays(Eo.TRIANGLE_STRIP,0,4)}};const uwe=new Map;uwe.set("a_position",0),uwe.set("a_texcoord",1);const dvn={geometry:[new Hl("a_position",2,Ti.UNSIGNED_SHORT,0,8),new Hl("a_texcoord",2,Ti.UNSIGNED_SHORT,4,8)]},pvn={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:uwe};let fvn=class{constructor(e,t){this._flowData=e,this._values=t}attach(e){const{context:t}=e,{width:r,height:n}=this._flowData,s=Aa.createVertex(t,oa.STATIC_DRAW,new Uint16Array([0,0,0,1,r,0,1,1,0,n,0,0,r,n,1,0])),o=new wh(t,uwe,dvn,{geometry:s}),a=[];this._values.color.kind==="ramp"&&a.push("vvColor"),this._values.opacity.kind==="ramp"&&a.push("vvOpacity");const l=e.painter.materialManager.getProgram(pvn,a);let u=1e6,c=-1e6;for(let v=0;v0}isCompatible(e){return e instanceof gXt&&fXt(this._params,e._params)}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,s,t);return new vvn(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",t.time),s.setUniform1f("u_trailLength",this._params.trailLength),s.setUniform1f("u_flowSpeed",this._params.flowSpeed),s.setUniform1f("u_featheringSize",this._params.featheringSize),s.setUniform1f("u_featheringOffset",this._params.featheringOffset),s.setUniform1f("u_introFade",this._params.introFade?1:0),s.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),s.setUniform1f("u_decayRate",this._params.decayRate),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",t.displayViewMat3),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),LF(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(Eo.TRIANGLES,r.indexCount,Ti.UNSIGNED_INT,0)}};const gV=new Map;gV.set("a_xyts0",0),gV.set("a_xyts1",1),gV.set("a_typeIdDurationSeed",2),gV.set("a_extrudeInfo",3);const gvn={geometry:[new Hl("a_xyts0",4,Ti.FLOAT,0,64),new Hl("a_xyts1",4,Ti.FLOAT,16,64),new Hl("a_typeIdDurationSeed",4,Ti.FLOAT,32,64),new Hl("a_extrudeInfo",4,Ti.FLOAT,48,64)]},yvn={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:gV};let vvn=class{constructor(e,t,r){this._vertexData=e,this._indexData=t,this._values=r}attach(e){const{context:t}=e,r=Aa.createVertex(t,oa.STATIC_DRAW,this._vertexData),n=Aa.createIndex(t,oa.STATIC_DRAW,this._indexData),s=new wh(t,gV,gvn,{geometry:r},n),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const a=e.painter.materialManager.getProgram(yvn,o);this.vertexArray=s,this.program=a,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},_vn=class yXt{constructor(e){this._styles=e}get animated(){return this._styles.reduce((e,t)=>e||t.animated,!1)}isCompatible(e){if(!(e instanceof yXt)||this._styles.length!==e._styles.length)return!1;const t=this._styles.length;for(let r=0;rn.load(e,t)));return new bvn(r)}render(e,t,r){for(let n=0;ne&&t.ready,!0)}},wvn=class vXt{constructor(e){this._params=e}get animated(){return this._params.flowSpeed>0}isCompatible(e){return e instanceof vXt&&fXt(this._params,e._params)}async load(e,t){const{extent:r,size:n}=e;hn(t);const s=await this._params.loadImagery(r,n[0],n[1],this._params.timeExtent,t),{vertexData:o,indexData:a}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,s,t);return new Tvn(o,a,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(e,t,r){const{context:n}=e,{program:s}=r;n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunction(bn.ONE,bn.ONE_MINUS_SRC_ALPHA),n.useProgram(s),s.setUniform1f("u_time",t.time),s.setUniform1f("u_trailLength",this._params.trailLength),s.setUniform1f("u_flowSpeed",this._params.flowSpeed),s.setUniform1f("u_featheringSize",this._params.featheringSize),s.setUniform1f("u_featheringOffset",this._params.featheringOffset),s.setUniform1f("u_introFade",this._params.introFade?1:0),s.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),s.setUniform1f("u_decayRate",this._params.decayRate),s.setUniformMatrix3fv("u_dvsMat3",t.dvsMat3),s.setUniformMatrix3fv("u_displayViewMat3",t.displayViewMat3),LF(s,"color","vec4",this._params.color),LF(s,"opacity","float",this._params.opacity),LF(s,"size","float",this._params.size),n.bindVAO(r.vertexArray),n.drawElements(Eo.TRIANGLES,r.indexCount,Ti.UNSIGNED_INT,0)}};const yV=new Map;yV.set("a_positionAndSide",0),yV.set("a_timeInfo",1),yV.set("a_extrude",2),yV.set("a_speed",3);const xvn={geometry:[new Hl("a_positionAndSide",3,Ti.FLOAT,0,36),new Hl("a_timeInfo",3,Ti.FLOAT,12,36),new Hl("a_extrude",2,Ti.FLOAT,24,36),new Hl("a_speed",1,Ti.FLOAT,32,36)]},Svn={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:yV};let Tvn=class{constructor(e,t,r){this._vertexData=e,this._indexData=t,this._values=r}attach(e){const{context:t}=e,r=Aa.createVertex(t,oa.STATIC_DRAW,this._vertexData),n=Aa.createIndex(t,oa.STATIC_DRAW,this._indexData),s=new wh(t,yV,xvn,{geometry:r},n),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const a=e.painter.materialManager.getProgram(Svn,o);this.vertexArray=s,this.program=a,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const Cvn=4,Evn=1,Ivn=.5,Avn=!0,Mvn=!0,Ovn=2.3;function Pvn(i,e){const{flowSpeed:t,trailLength:r}=i,n=ovn(i);let s=null;const o={opacity:uvn(i),size:k7e(i)};let a=lvn(i);if(i.background==="none")o.color=a;else{a.kind==="constant"&&(a={kind:"ramp",stops:[0,1],values:[0,0,0,1,a.value[0],a.value[1],a.value[2],a.value[3]],count:2});const c={loadImagery:e.loadImagery,timeExtent:e.timeExtent,color:a,opacity:{kind:"constant",value:[1]}};s=new hvn(c),o.color=avn()}const l={loadImagery:e.loadImagery,createFlowMesh:e.createFlowMesh,simulationSettings:n,timeExtent:e.timeExtent,trailLength:r,flowSpeed:t,featheringSize:Evn,featheringOffset:Ivn,introFade:Avn,fadeToZero:Mvn,decayRate:Ovn,color:o.color,opacity:o.opacity,size:o.size},u=i.trailCap==="butt"||dXt(k7e(i))<=Cvn?new wvn(l):new mvn(l);return s!=null?new _vn([s,u]):u}let Rvn=class extends Qx{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:Cc(),displayViewMat3:Cc()}}dispose(){}prepareState(e){const{context:t}=e;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(Wl.EQUAL,0,255)}draw(e,t){const{requestRender:r,allowDelayedRender:n}=e,{displayData:s}=t;if(s==null||(s.state.name==="loaded"&&s.attach(e),s.state.name!=="attached"))return;const o=s.state.resources;!n||o.ready||r==null?(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=t.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=e.state.displayViewMat3,s.flowStyle.render(e,this._visualState,o),s.flowStyle.animated&&r!=null&&r()):r()}},Dvn=class extends Vle{constructor(){super(...arguments),this.flowStyle=null}doRender(e){super.doRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"flow",brushes:[Rvn],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}},Fvn=class{constructor(e,t,r,n){this.state={name:"created"},this.flowStyle=e,this.extent=t,this.size=r,this.pixelRatio=n}async load(){const e=new AbortController;this.state={name:"loading",abortController:e};const t={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},r=await this.flowStyle.load(t,e.signal);this.state={name:"loaded",resources:r}}attach(e){if(this.state.name!=="loaded")return void di.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const t=this.state.resources;t.attach(e),this.state={name:"attached",resources:t}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(e){return this.flowStyle.isCompatible(e.flowStyle)?!(!this.extent.equals(e.extent)||this.size[0]!==e.size[0]||this.size[1]!==e.size[1]||this.pixelRatio!==e.pixelRatio)&&(this.flowStyle=e.flowStyle,!0):!1}},kvn=class extends eM{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(e){this._displayData=e,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(e){const{displayData:t}=this;if(t==null)return;const r=t.extent.xmin,n=t.extent.ymax,s=[0,0];e.toScreen(s,[r,n]);const o=(t.extent.xmax-t.extent.xmin)/t.size[0]/e.resolution,a=Rx(e.rotation),{displayViewScreenMat3:l}=this.transforms;_We(l,[-1,1,0]),_R(l,l,[2/(e.size[0]*e.pixelRatio),-2/(e.size[1]*e.pixelRatio),1]),h0(l,l,[s[0],s[1],0]),q3(l,l,a),_R(l,l,[o*e.pixelRatio,o*e.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:Cc()}}};const Lvn=1.15;let tz=class extends un{constructor(e){super(e),this._flowDisplayObject=new kvn,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(e){const{flowStyle:t}=this.flowContainer;if(t==null)return void this._clear();const{extent:r,rotation:n,resolution:s,pixelRatio:o}=e.state,a=$vn(r,n);a.expand(Lvn);const l=[Math.round((a.xmax-a.xmin)/s),Math.round((a.ymax-a.ymin)/s)],u=new Fvn(t,a,l,o);if(this._loading!=null){if(this._loading.update(u))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(u)||(u.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},c=>{mo(c)||(di.getLogger(this).error("A resource failed to load.",c),this._loading=null)}),this._loading=u)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};x([D()],tz.prototype,"_loading",void 0),x([D()],tz.prototype,"flowContainer",void 0),x([D()],tz.prototype,"updating",null),tz=x([Qe("esri.views.2d.engine.flow.FlowStrategy")],tz);const Nvn=tz;function $vn(i,e){const t=new $i({x:(i.xmax+i.xmin)/2,y:(i.ymax+i.ymin)/2,spatialReference:i.spatialReference}),r=i.xmax-i.xmin,n=i.ymax-i.ymin,s=Math.abs(Math.cos(Rx(e))),o=Math.abs(Math.sin(Rx(e))),a=s*r+o*n,l=o*r+s*n,u=new hr({xmin:t.x-a/2,ymin:t.y-l/2,xmax:t.x+a/2,ymax:t.y+l/2,spatialReference:i.spatialReference});return u.centerAt(t),u}let eC=class extends un{constructor(){super(...arguments),this._loadImagery=(e,t,r,n,s)=>lat(this.layer,e,t,r,n,s),this._createFlowMesh=(e,t,r,n)=>this.layer.createFlowMesh({meshType:e,flowData:r,simulationSettings:t},{signal:n}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:e}=this,t=()=>{this._loadImagery=(r,n,s,o,a)=>lat(e,r,n,s,o,a),this._updateVisualization()};"multidimensionalDefinition"in e?this.addHandles(Ki(()=>e.multidimensionalDefinition,t)):this.addHandles([Ki(()=>e.mosaicRule,t),Ki(()=>e.rasterFunction,t),Ki(()=>e.definitionExpression,t)]),this.container=new Dvn,this._strategy=new Nvn({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(e){e.stationary?this._strategy.update(e):this.layerView.requestUpdate()}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const e=this.layer.renderer;if(e==null||e.type!=="flow")return;const t=Pvn(e,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};x([D()],eC.prototype,"_strategy",void 0),x([D()],eC.prototype,"attached",void 0),x([D()],eC.prototype,"container",void 0),x([D()],eC.prototype,"layer",void 0),x([D()],eC.prototype,"layerView",void 0),x([D()],eC.prototype,"type",void 0),x([D()],eC.prototype,"updating",null),x([D()],eC.prototype,"timeExtent",void 0),eC=x([Qe("esri.views.2d.engine.flow.FlowView2D")],eC);const _Xt=eC;let N2=class extends un{constructor(){super(...arguments),this.attached=!1,this.container=new WCe,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Bq}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)})}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,r=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new KCe({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:r,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{const{source:t}=e;if(!t||t instanceof ImageBitmap)return;const r=await this.layer.applyRenderer({extent:t.extent,pixelBlock:t.originalPixelBlock??t.pixelBlock});t.filter=n=>this.layer.pixelFilter?this.layer.applyFilter(n):{...r,extent:t.extent}}).catch(e=>{mo(e)||di.getLogger(this).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,r=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),n=hlr(r,t);return n!=null?{extent:n.extent,pixelBlock:n.pixelBlock}:null}return null}async _fetchImage(e,t,r,n){(n=n||{}).timeExtent=this.timeExtent,n.requestAsImageElement=!0,n.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,t,r,n);if(s.imageBitmap)return s.imageBitmap;const o=await this.layer.applyRenderer(s.pixelData,{signal:n.signal}),a=new QYt(o.pixelBlock,o.extent?.clone(),s.pixelData.pixelBlock);return a.filter=l=>this.layer.applyFilter(l),a}};x([D()],N2.prototype,"attached",void 0),x([D()],N2.prototype,"container",void 0),x([D()],N2.prototype,"layer",void 0),x([D()],N2.prototype,"strategy",void 0),x([D()],N2.prototype,"timeExtent",void 0),x([D()],N2.prototype,"view",void 0),x([D()],N2.prototype,"updateRequested",void 0),x([D()],N2.prototype,"updating",null),x([D()],N2.prototype,"type",void 0),N2=x([Qe("esri.views.2d.layers.imagery.ImageryView2D")],N2);const Bvn=N2,Mpe=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),T1t=new Float32Array([0,92/255,230/255,1]),jvn={beaufort_ft:Mpe,beaufort_m:Mpe,beaufort_km:Mpe,beaufort_mi:Mpe,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:T1t,single_arrow:T1t,wind_speed:new Float32Array([0,0,0,1])},C1t=[0,20];let bXt=class extends Qx{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(il.KEEP,il.KEEP,il.REPLACE)}draw(e,t){if(t.source==null||t.source.validPixelCount===0)return;const{context:r,timeline:n}=e;if(n.begin(this.name),r.setStencilFunction(Wl.EQUAL,t.stencilRef,255),t.updateVectorFieldVAO(e),e.renderPass==="scalar"){const s=t.vaoData.scalar;s&&this._drawScalars(e,t,s.vao,s.elementCount)}else{const s=t.vaoData.magdir;s&&this._drawTriangles(e,t,s.vao,s.elementCount)}n.end(this.name)}_drawTriangles(e,t,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:u}=t,c=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&c.push("rotationGeographic");const h=o.materialManager.getProgram(this._desc.magdir,c);if(l&&a!=null&&!h.compiled)return void a();s.useProgram(h);const{coordScale:p,opacity:m,transforms:v}=t;h.setUniform2fv("u_coordScale",p),h.setUniform1f("u_opacity",m),h.setUniformMatrix3fv("u_dvsMat3",v.displayViewScreenMat3);const{style:w,dataRange:S,rotation:I,symbolPercentRange:R}=u;h.setUniform4fv("u_colors",jvn[w]),h.setUniform2fv("u_dataRange",S||C1t),h.setUniform1f("u_rotation",I),h.setUniform2fv("u_symbolPercentRange",R);const L=this._getSymbolSize(e,t);h.setUniform2fv("u_symbolSize",L),s.bindVAO(r),s.drawElements(Eo.TRIANGLES,n,Ti.UNSIGNED_INT,0)}_drawScalars(e,t,r,n){const{context:s,painter:o,requestRender:a,allowDelayedRender:l}=e,{symbolizerParameters:u}=t,c=[];u.style==="wind_speed"?c.push("innerCircle"):u.dataRange&&c.push("dataRange"),u.rotationType==="geographic"&&c.push("rotationGeographic");const h=o.materialManager.getProgram(this._desc.scalar,c);if(l&&a!=null&&!h.compiled)return void a();s.useProgram(h);const{coordScale:p,opacity:m,transforms:v}=t;h.setUniform2fv("u_coordScale",p),h.setUniform1f("u_opacity",m),h.setUniformMatrix3fv("u_dvsMat3",v.displayViewScreenMat3);const{dataRange:w,symbolPercentRange:S}=u;h.setUniform2fv("u_dataRange",w||C1t),h.setUniform2fv("u_symbolPercentRange",S);const I=this._getSymbolSize(e,t);h.setUniform2fv("u_symbolSize",I),s.bindVAO(r),s.drawElements(Eo.TRIANGLES,n,Ti.UNSIGNED_INT,0)}_getSymbolSize(e,t){const r=t.key?2**(e.displayLevel-t.key.level):t.resolution/e.state.resolution,{symbolTileSize:n}=t.symbolizerParameters;return[n/(Math.round((t.width-t.offset[0])/n)*n)/r,n/(Math.round((t.height-t.offset[1])/n)*n)/r]}},Gvn=class extends Vle{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf)",brushes:[bXt],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}},wXt=class extends eM{constructor(e=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=e}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(e){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(e)&&(this._symbolizerParameters=e,this.invalidateVAO())}get source(){return this._source}set source(e){this._source=e,this.invalidateVAO()}invalidateVAO(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(e){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:t}=this.symbolizerParameters;switch(t){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const r=Iot(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={magdir:n}}break;case"simple_scalar":{const r=ALe(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r);this.vaoData={scalar:n}}break;case"wind_speed":{const r=Iot(this.source,this.symbolizerParameters),n=this._createVectorFieldVAO(e.context,r),s=ALe(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(e.context,s);this.vaoData={magdir:n,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:Cc()}}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(e,t){const{vertexData:r,indexData:n}=t,s=Aa.createVertex(e,oa.STATIC_DRAW,new Float32Array(r)),o=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n)),a=xCe("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:Ti.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:Ti.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:Ti.FLOAT,normalized:!1}]});return{vao:new wh(e,a.attributes,a.bufferLayouts,{geometry:s},o),elementCount:n.length}}},Q$=class extends un{constructor(e){super(e),this._loading=null,this.update=xd((t,r)=>this._update(t,r).catch(n=>{mo(n)||di.getLogger(this).error(n)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,r){if(!e.stationary)return;const{extent:n,spatialReference:s}=e.state,o=new hr({xmin:n.xmin,ymin:n.ymin,xmax:n.xmax,ymax:n.ymax,spatialReference:s}),[a,l]=e.state.size;this._loading=this.fetchPixels(o,a,l,r);const u=await this._loading;this._addToDisplay(u,t,e.state),this._loading=null}_addToDisplay(e,t,r){if(e.pixelBlock==null)return this.container.children.forEach(a=>a.destroy()),void this.container.removeAllChildren();const{extent:n,pixelBlock:s}=e,o=new wXt(s);o.offset=[0,0],o.symbolizerParameters=t,o.rawPixelData=e,o.invalidateVAO(),o.x=n.xmin,o.y=n.ymax,o.pixelRatio=r.pixelRatio,o.rotation=r.rotation,o.resolution=r.resolution,o.width=s.width*t.symbolTileSize,o.height=s.height*t.symbolTileSize,this.container.children.forEach(a=>a.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(o)}};x([D()],Q$.prototype,"fetchPixels",void 0),x([D()],Q$.prototype,"container",void 0),x([D()],Q$.prototype,"_loading",void 0),x([D()],Q$.prototype,"updating",null),Q$=x([Qe("esri.views.2d.layers.imagery.ImageryVFStrategy")],Q$);const Uvn=Q$;let $I=class extends un{constructor(){super(...arguments),this.attached=!1,this.container=new Gvn,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,r,n)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:o}=this.layer.renderer,{extent:a,width:l,height:u}=ylr(e,t,r,o,s);if(s!=null&&!s.intersects(e))return{extent:a,pixelBlock:null};const c={bbox:`${a.xmin}, ${a.ymin}, ${a.xmax}, ${a.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:o,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(c)){const m=this.getPixelData();if(m!=null&&`${m.extent.xmin}, ${m.extent.ymin}, ${m.extent.xmax}, ${m.extent.ymax}`===c.bbox)return m}const{pixelData:h}=await this.layer.fetchImage(a,l,u,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:n});this._dataParameters=c;const p=h?.pixelBlock;return p==null?{extent:a,pixelBlock:null}:{extent:a,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?AW(p,"vector-uv"):p}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new Uvn({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(Ki(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),Ah),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const e=this.container.children[0]?.rawPixelData;if(this.updating||!e)return null;const{extent:t,pixelBlock:r}=e;return{extent:t,pixelBlock:r}}hitTest(e){return new Us({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams).catch(t=>{mo(t)||di.getLogger(this).error(t)})}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,r=this._dataParameters.time===e.time,n=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&r&&n&&s}async _getProjectedFullExtent(e){try{return FF(this.layer.fullExtent,e)}catch{try{const r=(await zi(this.layer.url,{query:{option:"footprints",outSR:Hv(e),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return r?hr.fromJSON(r):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};x([D()],$I.prototype,"attached",void 0),x([D()],$I.prototype,"container",void 0),x([D()],$I.prototype,"layer",void 0),x([D()],$I.prototype,"timeExtent",void 0),x([D()],$I.prototype,"type",void 0),x([D()],$I.prototype,"view",void 0),x([D()],$I.prototype,"updating",null),$I=x([Qe("esri.views.2d.layers.imagery.VectorFieldView2D")],$I);const zvn=$I,Vvn=i=>{let e=class extends i{constructor(){super(...arguments),this.view=null}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=kF(n,r);if(!s||o==null)throw new qe("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=await o.getRequiredFields();hn(r);const l=new Kn;l.timeExtent=this.timeExtent,l.geometry=t,l.outFields=a,l.outSpatialReference=t.spatialReference;const{resolution:u,spatialReference:c}=this.view,h=this.view.type==="2d"?new $i(u,u,c):new $i(.5*u,.5*u,c),{returnTopmostRaster:p,showNoDataRecords:m}=o.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},v={returnDomainValues:!0,returnTopmostRaster:p,pixelSize:h,showNoDataRecords:m,signal:r?.signal};return n.queryVisibleRasters(l,v).then(w=>w)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return x([D()],e.prototype,"layer",void 0),x([D()],e.prototype,"suspended",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"view",void 0),e=x([Qe("esri.views.layers.ImageryLayerView")],e),e};let bte=class extends Vvn(hL(Lm(Nm))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new bx,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:e}=this;return this.updating||!e?null:"getPixelData"in e?e.getPixelData():null}update(e){this.subview?.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([Ki(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},Kl),Ki(()=>this.timeExtent,e=>{const{subview:t}=this;t&&(t.timeExtent=e,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},Kl),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),Ki(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:dr.isCollection(e)?e.at(0):e)instanceof Us))return wa();let r=[];return Array.isArray(e)||dr.isCollection(e)?r=e.map(n=>n.clone()):e instanceof Us&&(r=[e.clone()]),this._highlightGraphics.addMany(r),wa(()=>this._highlightGraphics.removeMany(r))}async doRefresh(){this.requestUpdate()}isUpdating(){const e=!this.subview||this.subview.updating||!!this._highlightView?.updating;return yi("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${e} -> subview ${!this.subview||this.subview.updating} -> higlightView ${this._highlightView?.updating} -`),e}_setSubView(){if(!this.view)return;const e=this.layer.renderer?.type;let t="imagery";if(e==="vector-field"?t="imageryVF":e==="flow"&&(t="flow"),this.subview){const{type:r}=this.subview;if(r===t)return this._attachSubview(this.subview),void(r==="flow"?this.subview.redrawOrRefetch():r==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=t==="imagery"?new Uvn({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):t==="imageryVF"?new Wvn({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new _Xt({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};x([D()],bte.prototype,"pixelData",null),x([D()],bte.prototype,"subview",void 0),bte=x([Qe("esri.views.2d.layers.ImageryLayerView2D")],bte);const Yvn=bte,Xvn=Object.freeze(Object.defineProperty({__proto__:null,default:Yvn},Symbol.toStringTag,{value:"Module"}));function Jvn(i,e,t="nearest",r=!1){const n=!(r&&e.pixelType==="u8"),s=n?lc.FLOAT:lc.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),a=i.capabilities.textureFloat?.textureFloatLinear,l=new Ua;return l.width=e.width,l.height=e.height,l.internalFormat=n?gs.RGBA32F:ks.RGBA,l.samplingMode=!a||t!=="bilinear"&&t!=="cubic"?Is.NEAREST:Is.LINEAR,l.dataType=s,l.wrapMode=Ls.CLAMP_TO_EDGE,new fl(i,l,o)}function xXt(i,e){const{spacing:t,offsets:r,coefficients:n,size:[s,o]}=e,a=t[0]>1,l=new Ua;l.width=a?4*s:s,l.height=o,l.internalFormat=gs.RGBA32F,l.dataType=lc.FLOAT,l.samplingMode=Is.NEAREST,l.wrapMode=Ls.CLAMP_TO_EDGE;const u=new Float32Array(a?s*o*16:2*r.length);if(a&&n!=null)for(let c=0,h=0;c{const n=e.get(r)||e.get(r+"[0]");n&&i1n(i,r,t[r],n)})}function vX(i,e,t,r){t.length===r.length&&(r.some(n=>n==null)||t.some(n=>n==null)||t.forEach((n,s)=>{e.setUniform1i(n,s),i.bindTexture(r[s],s)}))}function i1n(i,e,t,r){if(r===null||t==null)return!1;const{info:n}=r;switch(n.type){case uv.FLOAT:n.size>1?i.setUniform1fv(e,t):i.setUniform1f(e,t);break;case uv.FLOAT_VEC2:i.setUniform2fv(e,t);break;case uv.FLOAT_VEC3:i.setUniform3fv(e,t);break;case uv.FLOAT_VEC4:i.setUniform4fv(e,t);break;case uv.FLOAT_MAT3:i.setUniformMatrix3fv(e,t);break;case uv.FLOAT_MAT4:i.setUniformMatrix4fv(e,t);break;case uv.INT:n.size>1?i.setUniform1iv(e,t):i.setUniform1i(e,t);break;case uv.BOOL:i.setUniform1i(e,t?1:0);break;case uv.INT_VEC2:case uv.BOOL_VEC2:i.setUniform2iv(e,t);break;case uv.INT_VEC3:case uv.BOOL_VEC3:i.setUniform3iv(e,t);break;case uv.INT_VEC4:case uv.BOOL_VEC4:i.setUniform4iv(e,t);break;default:return!1}return!0}const r1n={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};let n1n=class extends eM{constructor(e=null,t=null,r=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=r}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(ba(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||r1n}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?Is.LINEAR:Is.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=ba(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const t=e||this.projected;return[t?this.width:this.source?.width||this.width,t?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:t,resolution:r}=this;return e&&!t?[e.x,e.y]:[r,r]}_createTransforms(){return{displayViewScreenMat3:Cc()}}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const r=t?this._processedTexture??this._rasterTexture:this._rasterTexture,n=[],s=[];return r?(this._transformGridTexture&&!this.projected&&(s.push(this._transformGridTexture),n.push("u_transformGrid")),t?(s.push(r),n.push("u_image"),this._colormapTexture&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s}):(s.push(r),n.push("u_image"),this._colormapTexture&&!e&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s})):{names:n,textures:s}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=xXt(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(t=>t?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const t=this.source?.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloat?.textureFloatLinear;const n=this._getTextureSamplingMethod(this.interpolation),s=this.isRendereredSource;this._rasterTexture=Jvn(e,t,n,s),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:t}=this.symbolizerParameters,r=t==="lut"||t==="hillshade"||t==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||r||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,r=this.symbolizerParameters.colormap;return r?t?r.length!==t.length||r.some((n,s)=>n!==t[s])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=E1t(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=E1t(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}};function s1n(i){return i.source!=null}function QKe(i){const e=[];return i&&(e.push("applyProjection"),i.spacing[0]===1&&e.push("lookupProjection")),e}function SXt(i,e,t){const r=!t.capabilities.textureFloat?.textureFloatLinear,n=[];return i==="cubic"?n.push("bicubic"):i==="bilinear"&&(e?(n.push("bilinear"),n.push("nnedge")):r&&n.push("bilinear")),n}const o1n={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function a1n(i,e,t){const r=t?[]:QKe(e.transformGrid);return{defines:r,program:i.painter.materialManager.getProgram(o1n,r)}}function l1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const{colormap:a,colormapOffset:l}=t.symbolizerParameters,u=ZKe(a,l);NF(e,r,u)}const u1n={createProgram:a1n,bindTextureAndUniforms:l1n},c1n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function h1n(i,e,t){const{colormap:r}=e.symbolizerParameters,n=[...t?[]:QKe(e.transformGrid),...SXt(e.interpolation,!0,i.context)];return r!=null&&n.push("applyColormap"),{defines:n,program:i.painter.materialManager.getProgram(c1n,n)}}function d1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const a=t.symbolizerParameters,{colormap:l,colormapOffset:u}=a;if(l!=null){const h=ZKe(l,u);NF(e,r,h)}const c=e1n(a);NF(e,r,c)}const p1n={createProgram:h1n,bindTextureAndUniforms:d1n},f1n={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m1n(i,e,t){const{colormap:r,bandCount:n}=e.symbolizerParameters,s=[...t?[]:QKe(e.transformGrid),...SXt(e.interpolation,n===1,i.context)];return e.isRendereredSource&&!t?s.push("noop"):r!=null&&s.push("applyColormap"),{defines:s,program:i.painter.materialManager.getProgram(f1n,s)}}function g1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const a=t.symbolizerParameters,{colormap:l,colormapOffset:u}=a;if(l!=null){const h=ZKe(l,u);NF(e,r,h)}const c=Qvn(a);NF(e,r,c)}const y1n={createProgram:m1n,bindTextureAndUniforms:g1n},Qye=new Map;function v1n(i){return Qye.get(i)}Qye.set("lut",u1n),Qye.set("hillshade",p1n),Qye.set("stretch",y1n);const _1n=[1,1],b1n=[2,0,0,0,2,0,-1,-1,0];function Xb(i,e,t){const{context:r,rasterFunction:n,hasBranches:s}=i,{raster:o}=n.parameters,a=s?o?.id??-1:0,l=t.functionTextures[a]??t.rasterTexture;vX(r,e,["u_image"],[l])}function TXt(i,e,t){const{rasters:r}=i.rasterFunction.parameters;if(!r)return;if(r.length<2)return Xb(i,e,t);const n=r.filter(s=>s.name!=="Constant").map(s=>s.id!=null&&s.name!=="Identity"?t.functionTextures[s.id]:t.rasterTexture);if(vX(i.context,e,["u_image","u_image1","u_image2"].slice(0,n.length),n),n.length!==r.length){if(r.length===2){const s=r.findIndex(l=>l.name==="Constant"),o=s===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:a}=r[s].parameters;e.setUniform1f("u_image1Const",a),e.setUniformMatrix3fv("u_imageSwap",o)}else if(r.length===3){const s=[];if(r.forEach((o,a)=>o.name==="Constant"&&s.push(a)),s.length===1){const{value:o}=r[s[0]].parameters;e.setUniform1f("u_image1Const",o);const a=s[0]===0?[0,1,0,0,0,1,1,0,0]:s[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",a)}else if(s.length===2){const{value:o}=r[s[0]].parameters;e.setUniform1f("u_image1Const",o);const{value:a}=r[s[1]].parameters;e.setUniform1f("u_image2Const",a);const l=r.findIndex(c=>c.name!=="Constant"),u=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",u)}}}}function m_(i){i.setUniform2fv("u_coordScale",_1n),i.setUniformMatrix3fv("u_dvsMat3",b1n)}const w1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function x1n(i,e){return i.painter.materialManager.getProgram(w1n,[])}function S1n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const n=t.getRasterCellSize();e.setUniform2fv("u_cellSize",n)}const T1n={createProgram:x1n,bindTextureAndUniforms:S1n},C1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function E1n(i,e){const{painter:t,rasterFunction:r}=i,{indexType:n}=r.parameters;return t.materialManager.getProgram(C1n,[n])}function I1n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const A1n={createProgram:E1n,bindTextureAndUniforms:I1n},M1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function O1n(i,e){const t=i.rasterFunction.parameters.rasters.filter(n=>n.name==="Constant"),r=[];return t.length&&(r.push("oneConstant"),t.length===2&&r.push("twoConstant")),i.painter.materialManager.getProgram(M1n,r)}function P1n(i,e,t){TXt(i,e,t),m_(e)}const R1n={createProgram:O1n,bindTextureAndUniforms:P1n},D1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function F1n(i,e){return i.painter.materialManager.getProgram(D1n,[])}function k1n(i,e,t){Xb(i,e,t),m_(e);const{contrastOffset:r,brightnessOffset:n}=i.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",r),e.setUniform1f("u_brightnessOffset",n)}const L1n={createProgram:F1n,bindTextureAndUniforms:k1n},N1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function $1n(i,e){const{painter:t,rasterFunction:r}=i,{kernelRows:n,kernelCols:s}=r.parameters,o=[{name:"rows",value:n},{name:"cols",value:s}];return t.materialManager.getProgram(N1n,o)}function B1n(i,e,t){Xb(i,e,t),m_(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{kernel:r,clampRange:n}=i.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",n)}const j1n={createProgram:$1n,bindTextureAndUniforms:B1n},G1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function U1n(i,e){const{painter:t,rasterFunction:r}=i,{curvatureType:n}=r.parameters,s=[n];return t.materialManager.getProgram(G1n,s)}function z1n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const{zFactor:n}=i.rasterFunction.parameters,s=t.getRasterCellSize();e.setUniform1f("u_zlFactor",200*n/s[0]/s[1])}const V1n={createProgram:U1n,bindTextureAndUniforms:z1n},H1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function W1n(i,e){return i.painter.materialManager.getProgram(H1n,[])}function q1n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Y1n={createProgram:W1n,bindTextureAndUniforms:q1n},X1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function J1n(i,e){const{painter:t,rasterFunction:r}=i,{kernelRows:n,kernelCols:s,fillNoDataOnly:o,statisticsType:a}=r.parameters,l=[{name:"rows",value:n},{name:"cols",value:s},a];return o&&l.push("fill"),t.materialManager.getProgram(X1n,l)}function K1n(i,e,t){Xb(i,e,t),m_(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{clampRange:r}=i.rasterFunction.parameters;e.setUniform2fv("u_clampRange",r)}const Z1n={createProgram:J1n,bindTextureAndUniforms:K1n},Q1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function e_n(i,e){return i.painter.materialManager.getProgram(Q1n,[])}function t_n(i,e,t){Xb(i,e,t),m_(e);const{weights:r}=i.rasterFunction.parameters;e.setUniform3fv("u_weights",r)}const i_n={createProgram:e_n,bindTextureAndUniforms:t_n},r_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function n_n(i){const{painter:e,rasterFunction:t}=i,{imageCount:r,operationName:n,rasters:s,isOutputRounded:o}=t.parameters,a=[n.toLowerCase()];r===2&&a.push("twoImages");const l=s.filter(u=>u.name==="Constant");return l.length&&(a.push("oneConstant"),l.length===2&&a.push("twoConstant")),o&&a.push("roundOutput"),e.materialManager.getProgram(r_n,a)}function s_n(i,e,t){TXt(i,e,t),m_(e);const{domainRange:r}=i.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const I1t={createProgram:n_n,bindTextureAndUniforms:s_n},o_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function a_n(i,e){const{painter:t,rasterFunction:r}=i,n=r.parameters.bandCount>1?["multiBand"]:[];return t.materialManager.getProgram(o_n,n)}function l_n(i,e,t){Xb(i,e,t),m_(e);const{includedRanges:r,noDataValues:n}=i.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",n)}const u_n={createProgram:a_n,bindTextureAndUniforms:l_n},c_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function h_n(i,e){const{painter:t,rasterFunction:r}=i,n=r.parameters.scaled?["scaled"]:[];return t.materialManager.getProgram(c_n,n)}function d_n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const p_n={createProgram:h_n,bindTextureAndUniforms:d_n},f_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function m_n(i,e){return i.painter.materialManager.getProgram(f_n,[])}function g_n(i,e,t){Xb(i,e,t),m_(e);const{noDataRanges:r,rangeMaps:n,allowUnmatched:s,clampRange:o}=i.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",r),e.setUniform1fv("u_rangeMaps",n),e.setUniform1f("u_unmatchMask",s?1:0),e.setUniform2fv("u_clampRange",o)}const y_n={createProgram:m_n,bindTextureAndUniforms:g_n},v_n={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function __n(i,e){const{painter:t}=i,r=[],{interpolation:n,transformGrid:s}=e,o=i.rasterFunction?.parameters;return n==="cubic"?r.push("bicubic"):n==="bilinear"&&(r.push("bilinear"),o?.requireNNEdge&&r.push("nnedge")),s&&(r.push("applyProjection"),s.spacing[0]===1&&r.push("lookupProjection")),t.materialManager.getProgram(v_n,r)}function b_n(i,e,t){const{names:r,textures:n}=t.getTextures({forProcessing:!0});vX(i.context,e,r,n),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:s,height:o,source:a,transformGrid:l}=t;e.setUniform2fv("u_srcImageSize",[a.width,a.height]),e.setUniform2fv("u_targetImageSize",[s,o]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Zne),e.setUniform2fv("u_transformGridSize",l?l.size:Zne)}const w_n={createProgram:__n,bindTextureAndUniforms:b_n},x_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function S_n(i,e){const{painter:t,rasterFunction:r}=i,{slopeType:n}=r.parameters,s=n==="percent-rise"?["percentRise"]:[];return t.materialManager.getProgram(x_n,s)}function T_n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const n=t.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{zFactor:s,slopeType:o,pixelSizePower:a,pixelSizeFactor:l}=i.rasterFunction.parameters;e.setUniform1f("u_zFactor",s),e.setUniform1f("u_pixelSizePower",o==="adjusted"?a:0),e.setUniform1f("u_pixelSizeFactor",o==="adjusted"?l:0)}const C_n={createProgram:S_n,bindTextureAndUniforms:T_n},E_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function I_n(i,e){const{useGamma:t,bandCount:r,isOutputRounded:n}=i.rasterFunction.parameters,s=[];return t&&s.push("useGamma"),r>1&&s.push("multiBand"),n&&s.push("roundOutput"),i.painter.materialManager.getProgram(E_n,s)}function A_n(i,e,t){Xb(i,e,t),m_(e);const{width:r,height:n}=t,s=i.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform1f("u_minOutput",s.outMin),e.setUniform1f("u_maxOutput",s.outMax),e.setUniform1fv("u_factor",s.factor),e.setUniform1fv("u_minCutOff",s.minCutOff),e.setUniform1fv("u_maxCutOff",s.maxCutOff),e.setUniform1fv("u_gamma",s.gamma),e.setUniform1fv("u_gammaCorrection",s.gammaCorrection)}const M_n={createProgram:I_n,bindTextureAndUniforms:A_n},My=new Map;function CXt(i,e){const t=new Ua;return t.width=i,t.height=e,t.internalFormat=gs.RGBA32F,t.samplingMode=Is.NEAREST,t.dataType=lc.FLOAT,t.isImmutable=!0,t.wrapMode=Ls.CLAMP_TO_EDGE,t}function O_n(i,e,t,r){const{context:n,requestRender:s,allowDelayedRender:o}=i,a=r.createProgram(i,t);return o&&s!=null&&!a.compiled?(s(),null):(n.bindFramebuffer(e),n.setViewport(0,0,e.width,e.height),n.useProgram(a),a)}function P_n(i){return My.get(i.toLowerCase())}function R_n(i,e,t,r){const n=i.rasterFunction.name.toLowerCase(),s=n==="reproject"?w_n:P_n(n);if(s==null)return;const o=O_n(i,t,r,s);if(!o)return;s.bindTextureAndUniforms(i,o,r);const{interpolation:a}=r;n==="reproject"&&(r.interpolation="nearest"),e.draw();const[l,u]=r.getRasterTextureSize(n==="reproject"),c=CXt(l,u),h=new fl(i.context,c);if(t.copyToTexture(0,0,l,u,0,0,h),n==="reproject")r.rasterTexture=h,r.projected=!0,r.interpolation=a;else{const p=i.hasBranches?i.rasterFunction.id:0;r.functionTextures[p]=h}}My.set("arithmetic",I1t),My.set("aspect",T1n),My.set("bandarithmetic",A1n),My.set("compositeband",R1n),My.set("convolution",j1n),My.set("contrastbrightness",L1n),My.set("curvature",V1n),My.set("extractband",Y1n),My.set("statistics",Z1n),My.set("grayscale",i_n),My.set("local",I1t),My.set("mask",u_n),My.set("ndvi",p_n),My.set("remap",y_n),My.set("slope",C_n),My.set("stretch",M_n);let D_n=class extends Qx{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){ba(this._quad),ba(this._fbo)}prepareState(e){const{context:t,renderPass:r}=e,n=r==="raster";t.setBlendingEnabled(!n),t.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!n)}draw(e,t){if(!s1n(t)||t.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,t):void this._drawBitmap(e,t,!0);this._drawBitmap(e,t)}_process(e,t){const{rasterFunction:r}=e,n=r.name==="Reproject";if(!(n?!(t.rasterTexture&&t.projected):!t.processed))return;const{timeline:s,context:o}=e;s.begin(this.name);const a=o.getBoundFramebufferObject(),l=o.getViewport();n||(t.processedTexture=ba(t.processedTexture)),o.setStencilFunction(Hl.EQUAL,t.stencilRef,255),t.updateTexture(e),this._initQuad(o);const[u,c]=t.getRasterTextureSize(n),{isStandardRasterTileSize:h,fbo:p}=this._getRasterFBO(o,u,c);R_n(e,this._quad,p,t),h||p.dispose(),o.bindFramebuffer(a),o.setViewport(l.x,l.y,l.width,l.height),s.end(this.name)}_drawBitmap(e,t,r=!1){const{timeline:n,context:s}=e;if(n.begin(this.name),s.setStencilFunction(Hl.EQUAL,t.stencilRef,255),t.updateTexture(e),r&&!t.processedTexture){if(t.updateProcessedTexture(),!t.processedTexture)return void n.end(this.name);t.processed=!0}this._initBitmapCommonUniforms(t);const o=t.symbolizerParameters.type,a=v1n(o),{requestRender:l,allowDelayedRender:u}=e,{defines:c,program:h}=a.createProgram(e,t,t.projected&&r);if(u&&l!=null&&!h.compiled)return void l();s.useProgram(h);const p=this._getUniformInfos(o,s,h,c);this._quad||(this._quad=new JS(s,[0,0,1,0,0,1,1,1])),a.bindTextureAndUniforms(e,h,t,p,r),this._quad.draw(),n.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const t=Zvn(1,[0,0]),{transformGrid:r,width:n,height:s}=e,o=Kvn(r,[n,s],[e.source.width,e.source.height],1,!1);e.commonUniforms={...t,...o,u_coordScale:e.coordScale}}}_getRasterFBO(e,t,r){const n=t===xo&&r===xo;return n?(this._fbo||(this._fbo=this._createNewFBO(e,t,r)),{isStandardRasterTileSize:n,fbo:this._fbo}):{isStandardRasterTileSize:n,fbo:this._createNewFBO(e,t,r)}}_createNewFBO(e,t,r){const n=CXt(t,r);return new Wd(e,n)}_initQuad(e){this._quad||(this._quad=new JS(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,t,r,n){const s=n.length>0?e+"-"+n.join("-"):e;if(this._rendererUniformInfos.has(s))return this._rendererUniformInfos.get(s);const o=t1n(t,r);return this._rendererUniformInfos.set(s,o),o}},F_n=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.bitmap=null,this.bitmap=new n1n(a,null,null),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}},k_n=class extends Hle{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const t=this._getTileBounds(e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new F_n(e,s,t[0],t[3],r,n)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (tile)",brushes:[D_n],target:()=>this.children.map(r=>r.bitmap),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){if(!this.visible||e.drawPhase!==aa.MAP)return;const{rasterFunctionChain:t}=this;if(!t)return e.renderPass="raster-bitmap",void super.doRender(e);if(!t.hasFocalFunction){const[r,n]=this._tileInfoView.tileInfo.size;e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,n],requireNNEdge:t.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e)}if(t?.functions.length){const{functions:r,hasBranches:n}=t;for(let s=0;s{const t=Array.from(e),r=Date.now();for(let n=0;n=e.size)return;const t=Array.from(e);for(let r=0;rr!=null)||DR.delete(i))}function $_n(i,e,t){const r=DR.get(i);if(!r)return e==null?Ak.decreaseRefCount(i,t):0;if(e==null||r[e]==null)return Ak.decreaseRefCount(i,t);const n=r[e]?.cache,s=n?.get(t);if(n&&s){if(s.refCount--,s.refCount===0){n.delete(t);for(let o=0;oo.isResolved=!0).catch(()=>o.isRejected=!0),s[e]?.cache.set(t,o)}function B_n(i,e,t){const r=DR.get(i);r?e!=null&&r[e]!=null?r[e]?.cache.delete(t):Ak.deleteBlock(i,t):e==null&&Ak.deleteBlock(i,t)}function j_n(i,e){const t=DR.get(i);return t?t[e]??null:null}function P1t(i,e,t,r,n,s,o=null){const a=j_n(i,e);if(!a)return;const l=a.extent,{cache:u,rasterInfo:c}=a;if(l&&l.xmin===t.xmin&&l.xmax===t.xmax&&l.ymin===t.ymin&&l.ymax===t.ymax)return;r=r??0;const h=t.clone().normalize(),{spatialReference:p,transform:m}=c,v=new Set;for(let w=0;w0?$.pyramidBlockWidth:$.blockWidth,ne=L>0?$.pyramidBlockHeight:$.blockHeight,de=1,pe=Math.max(0,Math.floor(Y.x/re)-de),H=Math.max(0,Math.floor(Y.y/ne)-de),Z=Math.floor((Y.x+K-1)/re)+de,ae=Math.floor((Y.y+Q-1)/ne)+de;for(let fe=H;fe<=ae;fe++)for(let be=pe;be<=Z;be++)v.add(`${L}/${fe}/${be}`)}u.forEach((w,S)=>{if(!v.has(S)){const I=u.get(S);(I==null||I.isResolved||I.isRejected)&&u.delete(S)}}),a.extent={xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax}}const G_n=[0,0];let eb=class extends un{constructor(){super(...arguments),this._updatingHandles=new Mb,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=xd(async(e={})=>{const t=this._rasterFunctionState;if(e.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:n}=this;return e.refetch||n!=="raster"&&e.reprocess||r==="cpu"||t==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new Qne({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:r,scale:n}=e.state,s=this._tileInfoView.getClosestInfoForScale(n);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const o=this._srcResolutions[s.level],a=t.toJSON?t:hr.fromJSON(t);P1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId,a,r,o,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==s.level&&(this.previousLOD=s,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=lk();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new ak(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:t,process:(n,s)=>this._fetchTile(n,s)});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new Qne({cachePolicy:"purge",acquireTile:n=>this.acquireTile(n),releaseTile:n=>this.releaseTile(n),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,A1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[r,n]=e,s=new Br({width:r,height:n,pixels:[new Uint8Array(r*n)],mask:new Uint8Array(r*n),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=s),s}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,r="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&r?.length&&t.rasterInfo.bandCount!==1?e.map(n=>r[Math.min(n,r.length-1)]):e||r}updateRasterFunctionParameters(){}_fetchTile(e,t){const r=t!=null?t.signal:null,n=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:o}=s,a=!o.isWrappable&&q1(s.view.spatialReference)!=null,l=n&&this.layer.raster.hasUniqueSourceStorageInfo,u={allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:n?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:r,srcResolution:this._srcResolutions[e.level],timeExtent:s.timeExtent,tileInfo:o,disableWrapAround:a};return this.fetchTile(e,u)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:h}=this.layer.tileInfo,p=h.map(({scale:v})=>v),m=fu.create({spatialReference:t,size:xo,scales:p,origin:c});return e.set("tileInfo",m),void(this._srcResolutions=h.map(({resolution:v})=>({x:v,y:v})))}const{scales:r,srcResolutions:n,isCustomTilingScheme:s}=mrn(this.layer.serviceRasterInfo,t,{tileSize:xo,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=fu.create({spatialReference:t,size:xo,scales:r}),a=o.origin.x===0,{xmin:l,ymax:u}=e.fullExtent;(a||s&&o.origin.x>l)&&(o.origin=new $i({x:l,y:u,spatialReference:t})),this._isCustomTilingScheme=s,e.set("tileInfo",o),this._srcResolutions=n??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if(e.raster.tileType!=="Map")return!1;const{lods:r}=e.tileInfo,n=t.view.constraints?.effectiveLODs;return n?.length===r.length&&n.every(({scale:s},o)=>Math.abs(s-r[o].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const r=await this._fetchQueue.push(e.key),n=this._getBandIds();let s=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){s=!1;try{await this._redrawImage(this._abortController?.signal)}catch(l){mo(l)&&di.getLogger(this).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const o=this._tileInfoView.getTileCoords(G_n,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:s,bandIds:n,coords:o,resolution:a}),e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e)}catch(r){mo(r)||di.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(e){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!r?.pixelBlock)return;const{resolution:n}=this.previousLOD,s=this._getBandIds(),o=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(s),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:n,y:n},bandIds:s});!this.canUseWebGLForProcessing()&&o&&o.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(o.factor=o.factor.map(a=>255*a),o.outMin=Math.round(255*o.outMin),o.outMax=Math.round(255*o.outMax)),this._globalSymbolizerParams=o}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:r}=this,{raster:n}=t,{multidimensionalDefinition:s}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:r.timeExtent}),o=n.rasterInfo.multidimensionalInfo?n.getSliceIndex(s):null,a=L7e(n.rasterId,o);if(a!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&A1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=N_n(a,n.rasterInfo),e){const{view:l}=r,u=this._tileInfoView.getClosestInfoForScale(l.scale),c=this._srcResolutions[u.level];P1t(a,this._blockCacheRegistryId,l.extent,l.resolution,c,n.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};x([D()],eb.prototype,"_globalUpdateRequested",void 0),x([D()],eb.prototype,"attached",void 0),x([D()],eb.prototype,"container",void 0),x([D()],eb.prototype,"layer",void 0),x([D()],eb.prototype,"layerView",void 0),x([D()],eb.prototype,"type",void 0),x([D()],eb.prototype,"useWebGLForProcessing",null),x([D()],eb.prototype,"useProgressiveUpdate",null),x([D()],eb.prototype,"timeExtent",void 0),x([D()],eb.prototype,"updating",null),eb=x([Qe("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],eb);let iz=class extends eb{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new k_n(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:e}=this.layer,t=e.lookup?.colormapLut?.indexedColormap,r=t&&t.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&e.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&jqt(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{clips:e,view:t}=this.layerView;this._geometry!=null&&e.remove(this._geometry);const{raster:r,type:n}=this.layer;if(r.datasetFormat==="Function"){const v=r.getClippingGeometry(t.spatialReference);if(v){const w=new rXt({geometry:v});e.add(w),this._geometry=w}}const{container:s}=this;if(r.datasetFormat!=="Function"||n==="wcs")return s.rasterFunctionChain=null,s.children.forEach(v=>{const{bitmap:w}=v;w&&(w.suspended=!0,w.processed=!1,w.projected&&(w.invalidateTexture(),w.rasterTexture=null))}),void(this._rasterFunctionState="na");const o=this._rasterFunctionState,{rasterFunction:a,primaryRasters:l}=r,u=a.supportsGPU&&(!l||l.rasters.length<=1),c=u?a.flatWebGLFunctionChain:null,{renderer:h}=this.layer,p=!u||!c?.functions.length||h?.type==="raster-stretch"&&h.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();s.rasterFunctionChain=p?null:c;const m=a==null?"na":s.rasterFunctionChain?"gpu":"cpu";s.children.forEach(v=>{const{bitmap:w}=v;w&&(w.suspended=o!==m,w.processed=!1,w.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(e,t){const r=this._getBandIds(),n=this._getLayerInterpolation(),s=this.canUseWebGLForProcessing(),{source:o,globalSymbolizerParams:a,suspended:l,coords:u,resolution:c}=t,h=this.layerView.hasTilingEffects?a:t.symbolizerParams,{bitmap:p}=e;if([p.x,p.y]=u,p.resolution=c,o?.pixelBlock!=null){const m={extent:o.extent,pixelBlock:o.pixelBlock,srcPixelSize:o.srcTilePixelSize};if(p.rawPixelData=m,s)p.source=o.pixelBlock,p.isRendereredSource=!1;else{const v=await this.layer.applyRenderer(m,a?.type==="stretch"?a:void 0);p.source=v,p.isRendereredSource=!0}p.symbolizerParameters=s?h:null,p.transformGrid=s?o.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();p.source=m,p.symbolizerParameters=s?h:null,p.transformGrid=null}p.bandIds=s?r:null,p.width=this._tileInfoView.tileInfo.size[0],p.height=this._tileInfoView.tileInfo.size[1],p.interpolation=n,p.suspended=l,p.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:n}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:u}=l;a||u==null?(l.isRendereredSource&&u!=null&&(l.source=u.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(u,n?.type==="stretch"?n:void 0),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?n:r:null,l.bandIds=a?s:null,l.interpolation=o,l.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return r==="raster-colormap"||r==="unique-value"||r==="class-breaks"?"nearest":t.type==="raster-stretch"&&t.colorRamp!=null?e==="bilinear"||e==="cubic"?"bilinear":"nearest":e}};x([D()],iz.prototype,"container",void 0),x([D()],iz.prototype,"layer",void 0),x([D()],iz.prototype,"type",void 0),iz=x([Qe("esri.views.2d.layers.imagery.ImageryTileView2D")],iz);const U_n=iz;let z_n=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.tileData=new wXt(a),this.tileData.coordScale=[s,o],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[n,s]=this.tileData.offset,o=[this.x+n*this.resolution,this.y-s*this.resolution],[a,l]=e.toScreenNoRotation([0,0],o),{symbolTileSize:u}=this.tileData.symbolizerParameters,c=Math.round((this.width-this.tileData.offset[0])/u)*u,h=Math.round((this.height-this.tileData.offset[1])/u)*u,p=c/this.rangeX*t,m=h/this.rangeY*t;pB(r,p,0,0,0,m,0,a,l,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}},V_n=class extends Hle{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new z_n(e,s,t[0],t[3],r,n)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf tile)",brushes:[bXt],target:()=>this.children.map(r=>r.tileData),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}},rz=class extends eb{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(e.level,e.row,e.col,t);return this.layer.serviceRasterInfo.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,t)),r}updateTileSource(e,t){const r=t.symbolizerParams,{tileData:n}=e;n.key=e.key,n.width=this._tileInfoView.tileInfo.size[0],n.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:s}=r,{source:o}=t;if(n.offset=this._getTileSymbolOffset(n.key,s),o?.pixelBlock!=null){const a={extent:o.extent,pixelBlock:o.pixelBlock};n.rawPixelData=a,n.symbolizerParameters=r,n.source=this._sampleVectorFieldData(o.pixelBlock,r,n.offset)}else{const a=[Math.round((this._tileInfoView.tileInfo.size[0]-n.offset[0])/s),Math.round((this._tileInfoView.tileInfo.size[1]-n.offset[1])/s)],l=this.createEmptyTilePixelBlock(a);n.source=l,n.symbolizerParameters=r}return n.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(e,t){const r=t.local,{symbolTileSize:n}=r,{tileData:s}=e;s.offset=this._getTileSymbolOffset(s.key,n);const o=s.symbolizerParameters.symbolTileSize;s.symbolizerParameters=r;const a=s.rawPixelData?.pixelBlock;return a!=null&&o!==n&&(s.source=this._sampleVectorFieldData(a,s.symbolizerParameters,s.offset)),Promise.resolve()}attach(){super.attach(),this.container=new V_n(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=Ki(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(e,t){const r=e.col*this._tileInfoView.tileInfo.size[0]%t,n=e.row*this._tileInfoView.tileInfo.size[1]%t;return[r>t/2?t-r:-r,n>t/2?t-n:-n]}_sampleVectorFieldData(e,t,r){const{symbolTileSize:n}=t;return Alr(e,"vector-uv",n,r)}_updateSymbolType(e){e.type==="vector-field"&&(this.container.symbolTypes=e.style==="wind-barb"?["scalar","triangle"]:e.style==="simple-scalar"?["scalar"]:["triangle"])}};x([D()],rz.prototype,"container",void 0),x([D()],rz.prototype,"layer",void 0),x([D()],rz.prototype,"type",void 0),rz=x([Qe("esri.views.2d.layers.imagery.VectorFieldTileView2D")],rz);const H_n=rz,W_n=i=>{let e=class extends i{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return CBe(this.layer.serviceRasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return GVt(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!CBe(this.layer.serviceRasterInfo,t)}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=kF(n,r);if(!s||o==null)throw new qe("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=[],{value:l,magdirValue:u,processedValue:c}=await n.identify(t,{timeExtent:this.timeExtent,signal:r?.signal});let h="";if(l&&l.length){h=n.type==="imagery-tile"&&n.hasStandardTime()&&l[0]!=null?l.map(I=>n.getStandardTimeValue(I)).join(", "):l.join(", ");const p={ObjectId:0},m="Raster.ServicePixelValue";p[m]=n.type==="imagery-tile"&&n.raster.datasetFormat==="Function"?c?.join(", "):h,p[m+".Raw"]=h;const v=n.serviceRasterInfo.attributeTable;if(v!=null){const{fields:I,features:R}=v,L=I.find(({name:B})=>B.toLowerCase()==="value"),k=L?R.find(B=>String(B.attributes[L.name])===h):null;if(k)for(const B in k.attributes)k.attributes.hasOwnProperty(B)&&(p[this._rasterFieldPrefix+B]=k.attributes[B])}const w=n.serviceRasterInfo.dataType;w!=="vector-magdir"&&w!=="vector-uv"||(p["Raster.Magnitude"]=u?.[0],p["Raster.Direction"]=u?.[1]);const S=new Us(this.fullExtent.clone(),null,p);S.layer=n,S.sourceLayer=S.layer,a.push(S)}return a}};return x([D()],e.prototype,"layer",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"view",void 0),x([D()],e.prototype,"fullExtent",null),x([D()],e.prototype,"tileInfo",void 0),x([D({readOnly:!0})],e.prototype,"hasTilingEffects",null),x([D()],e.prototype,"datumTransformation",null),e=x([Qe("esri.views.layers.ImageryTileLayerView")],e),e};let e6=class extends W_n(hL(Lm(Nm))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,t=this._get("displayParameters");return e.renderer?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}:t}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([Ki(()=>this.displayParameters,(e,t)=>{const r=e.interpolation!==t?.interpolation&&(e.interpolation==="majority"||t?.interpolation==="majority")&&jqt(this.layer),n=e.renderer!==t?.renderer&&this._getSubviewType(t?.renderer)!==this._getSubviewType(e.renderer);n&&this._updateSubview();const s=e.multidimensionalDefinition!==t?.multidimensionalDefinition,o=e.rasterFunction!==t?.rasterFunction,a=o&&!this._useWebGLForProcessing,l=s||r||n||a;this.subview.redrawOrRefetch({refetch:l,reprocess:o}).catch(u=>{mo(u)||di.getLogger(this).error(u)}),this.notifyChange("updating")}),Ki(()=>this.layer.multidimensionalSubset??null,(e,t)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Wne(r,e)!==Wne(r,t)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(n=>{mo(n)||di.getLogger(this).error(n)}),this.notifyChange("updating"))},Kl),Ki(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{mo(e)||di.getLogger(this).error(e)})},js)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const t=this._getSubviewType(e);if(this.subview){if(this.subview.type===t)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let n;if(n=t==="rasterVF"?new H_n({layer:r,layerView:this}):t==="flow"?new _Xt({layer:r,layerView:this}):new U_n({layer:r,layerView:this}),"useWebGLForProcessing"in n&&(n.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in n&&(n.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in n){const{subview:s}=this;n.previousLOD=s&&"previousLOD"in s?s.previousLOD:null}this._attachSubview(n),this.subview=n,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const t=e?.type;return t==="vector-field"?"rasterVF":t==="flow"?"flow":"raster"}};x([D()],e6.prototype,"subview",void 0),x([D()],e6.prototype,"useWebGLForProcessing",null),x([D()],e6.prototype,"useProgressiveUpdate",null),x([D({readOnly:!0})],e6.prototype,"displayParameters",null),e6=x([Qe("esri.views.2d.layers.ImageryTileLayerView2D")],e6);const q_n=e6,R1t=Object.freeze(Object.defineProperty({__proto__:null,default:q_n},Symbol.toStringTag,{value:"Module"})),Y_n={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function eZe(i){const e=i.folders||[],t=e.slice(),r=new Map,n=new Map,s=new Map,o=new Map,a=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:s,esriGeometryPolygon:o};(i.featureCollection?.layers||[]).forEach(c=>{const h=li(c);h.featureSet.features=[];const p=c.featureSet.geometryType;r.set(p,h);const m=c.layerDefinition.objectIdField;p==="esriGeometryPoint"?mRe(n,m,c.featureSet.features):p==="esriGeometryPolyline"?mRe(s,m,c.featureSet.features):p==="esriGeometryPolygon"&&mRe(o,m,c.featureSet.features)}),i.groundOverlays&&i.groundOverlays.forEach(c=>{a.set(c.id,c)}),e.forEach(c=>{c.networkLinkIds.forEach(h=>{const p=J_n(h,c.id,i.networkLinks);p&&t.push(p)})}),t.forEach(c=>{if(c.featureInfos){c.points=li(r.get("esriGeometryPoint")),c.polylines=li(r.get("esriGeometryPolyline")),c.polygons=li(r.get("esriGeometryPolygon")),c.mapImages=[];for(const h of c.featureInfos)switch(h.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const p=l[h.type].get(h.id);p&&c[Y_n[h.type]]?.featureSet.features.push(p);break}case"GroundOverlay":{const p=a.get(h.id);p&&c.mapImages.push(p);break}}c.fullExtent=N7e([c])}});const u=N7e(t);return{folders:e,sublayers:t,extent:u}}function tZe(i,e,t,r){const n=no?.findCredential(i);i=gg(i,{token:n?.token});const s=Ho.kmlServiceUrl;return zi(s,{query:{url:i,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(e)},responseType:"json",signal:r})}function EXt(i,e,t=null,r=[]){const n=[],s={},o=e.sublayers,a=new Set(e.folders.map(l=>l.id));return o.forEach(l=>{const u=new i;if(t?u.read(l,t):u.read(l),r.length&&a.has(u.id)&&(u.visible=r.includes(u.id)),s[l.id]=u,l.parentFolderId!=null&&l.parentFolderId!==-1){const c=s[l.parentFolderId];c.sublayers||(c.sublayers=[]),c.sublayers?.unshift(u)}else n.unshift(u)}),n}function mRe(i,e,t){t.forEach(r=>{i.set(r.attributes[e],r)})}function X_n(i,e){let t;return e.some(r=>r.id===i&&(t=r,!0)),t}function J_n(i,e,t){const r=X_n(i,t);return r&&(r.parentFolderId=e,r.networkLink=r),r}async function gRe(i){const e=du.fromJSON(i.featureSet).features,t=i.layerDefinition,r=YC(t.drawingInfo.renderer),n=qc.fromJSON(i.popupInfo),s=[];for(const o of e){const a=await r.getSymbolAsync(o);o.symbol=a,o.popupTemplate=n,o.visible=!0,s.push(o)}return s}function N7e(i){const e=Dx($V),t=Dx($V);for(const r of i){if(r.polygons?.featureSet?.features)for(const n of r.polygons.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.polylines?.featureSet?.features)for(const n of r.polylines.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.points?.featureSet?.features)for(const n of r.points.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.mapImages)for(const n of r.mapImages)jce(e,n.extent),sQ(t,e)}return XQi(t,$V)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:Xi.WGS84}}let IXt=class SO{constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(SO._instance)return SO._instanceRefCount++,SO._instance;SO._instanceRefCount=1,SO._instance=this,this._ownsRctx=!0;const n=document.createElement("canvas"),s=BW(n);s.getExtension("OES_texture_float"),this._rctx=new RYt(s,{})}const t={applyProjection:!0,bilinear:!1,bicubic:!1},r=rYt("raster/reproject","raster/reproject",new Map([["a_position",0]]),t);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new JS(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,t,r=!1){const n=Wc(e.extent,t),s=new $i({x:(e.extent.xmax-e.extent.xmin)/e.texture.descriptor.width,y:(e.extent.ymax-e.extent.ymin)/e.texture.descriptor.height,spatialReference:e.extent.spatialReference}),{x:o,y:a}=aoe(s,t,e.extent);let l=(o+a)/2;const u=Math.round((n.xmax-n.xmin)/l),c=Math.round((n.ymax-n.ymin)/l);l=(n.width/u+n.height/c)/2;const h=new $i({x:l,y:l,spatialReference:n.spatialReference}),p=uKe({projectedExtent:n,srcBufferExtent:e.extent,pixelSize:h,hasWrapAround:!0,spacing:[16,16]}),m=xXt(this._rctx,p),v=new Ua(u,c);v.wrapMode=Ls.CLAMP_TO_EDGE;const w=new Wd(this._rctx,v);this._rctx.bindFramebuffer(w),this._rctx.setViewport(0,0,u,c),this._rctx.useProgram(this._program),this._rctx.bindTexture(e.texture,0),this._rctx.bindTexture(m,1),this._quad.bind();const{width:S=0,height:I=0}=e.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",S,I),this._program.setUniform2fv("u_transformSpacing",p.spacing),this._program.setUniform2fv("u_transformGridSize",p.size),this._program.setUniform2f("u_targetImageSize",u,c),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),m.dispose(),r){const{width:L,height:k}=w,B=new ImageData(L??0,k??0);w.readPixels(0,0,L??0,k??0,ks.RGBA,lc.UNSIGNED_BYTE,B.data);const $=w.detachColorTexture(pv.COLOR_ATTACHMENT0);return w.dispose(),{texture:$,extent:n,imageData:B}}const R=w.detachColorTexture(pv.COLOR_ATTACHMENT0);return w.dispose(),{texture:R,extent:n}}reprojectBitmapData(e,t){const r=eXt(e.bitmapData)?tXt(e.bitmapData):e.bitmapData,n=new Ua;n.wrapMode=Ls.CLAMP_TO_EDGE,n.width=e.bitmapData.width,n.height=e.bitmapData.height;const s=new fl(this._rctx,n,r),o=this.reprojectTexture({texture:s,extent:e.extent},t,!0);o.texture.dispose();const a=document.createElement("canvas"),l=o.imageData;return a.width=l.width,a.height=l.height,a.getContext("2d").putImageData(l,0,0),{bitmapData:a,extent:o.extent}}async loadAndReprojectBitmapData(e,t,r){const n=(await zi(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=n.width,s.height=n.height;const o=s.getContext("2d");o.drawImage(n,0,0);const a=o.getImageData(0,0,s.width,s.height);if(t.spatialReference.equals(r))return{bitmapData:a,extent:t};const l=this.reprojectBitmapData({bitmapData:a,extent:t},r);return{bitmapData:l.bitmapData,extent:l.extent}}destroy(){this._ownsRctx?(SO._instanceRefCount--,SO._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),SO._instance=null)):(this._quad.dispose(),this._program.dispose())}};IXt._instanceRefCount=0;let D1t=class{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}},t6=class extends Lm(Nm){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new Bq,this._kmlVisualData=new D1t,this._fetchController=null,this.allVisiblePoints=new bx,this.allVisiblePolylines=new bx,this.allVisiblePolygons=new bx,this.allVisibleMapImages=new dr}async hitTest(e,t){const r=this.layer;return[this._pointsView?.hitTest(e),this._polylinesView?.hitTest(e),this._polygonsView?.hitTest(e)].flat().filter(Boolean).map(n=>(n.layer=r,n.sourceLayer=r,{type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new Tx({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new Tx({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new Tx({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),Ki(()=>this.layer.visibleSublayers,e=>{for(const[t,r]of this._kmlVisualData.allSublayers)r.visibility=0;for(const t of e){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new IXt}detach(){this._fetchController=zF(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=zo(this._polygonsView),this._polylinesView=zo(this._polylinesView),this._pointsView=zo(this._pointsView),this._imageReprojector=zo(this._imageReprojector)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,hr.fromJSON(e.extent),this.view.spatialReference).then(t=>{const r=new HKe(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=e.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(e,r)})}async _getViewDependentUrl(e,t){const{viewFormat:r,viewBoundScale:n,httpQuery:s}=e;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let o;if(await FS(),n!=null&&n!==1){const k=new hr(t.extent);k.expand(n),o=k}else o=t.extent;o=Wc(o,Xi.WGS84);const a=Wc(o,Xi.WebMercator),l=o.xmin,u=o.xmax,c=o.ymin,h=o.ymax,p=t.size[0]*t.pixelRatio,m=t.size[1]*t.pixelRatio,v=Math.max(a.width,a.height),w={"[bboxWest]":l.toString(),"[bboxEast]":u.toString(),"[bboxSouth]":c.toString(),"[bboxNorth]":h.toString(),"[lookatLon]":o.center.x.toString(),"[lookatLat]":o.center.y.toString(),"[lookatRange]":v.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":o.center.x.toString(),"[lookatTerrainLat]":o.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":o.center.x.toString(),"[cameraLat]":o.center.y.toString(),"[cameraAlt]":v.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":p.toString(),"[vertPixels]":m.toString(),"[terrainEnabled]":"0","[clientVersion]":tae,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},S=k=>{for(const B in k){let $;for($ in w)k[B]=k[B].replace($,w[$])}},I=mP(r);S(I);let R={};s!=null&&(R=mP(s),S(R));const L=gu(e.href);return L.query={...L.query,...I,...R},`${L.path}?${Lb(I)}`}return e.href}async _fetchService(e){const t=new D1t;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,r){return this._fetchParsedKML(e,r).then(async n=>{for(const s of n.sublayers){t.allSublayers.set(s.id,s);const o=s.points?await gRe(s.points):[],a=s.polylines?await gRe(s.polylines):[],l=s.polygons?await gRe(s.polygons):[],u=s.mapImages||[];if(t.allPoints.push(...o.map(c=>({item:c,sublayerId:s.id}))),t.allPolylines.push(...a.map(c=>({item:c,sublayerId:s.id}))),t.allPolygons.push(...l.map(c=>({item:c,sublayerId:s.id}))),t.allMapImages.push(...u.map(c=>({item:c,sublayerId:s.id}))),s.networkLink){const c=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(c,t,r)}}})}_fetchParsedKML(e,t){return tZe(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>eZe(r.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};x([D()],t6.prototype,"_pointsView",void 0),x([D()],t6.prototype,"_polylinesView",void 0),x([D()],t6.prototype,"_polygonsView",void 0),x([D()],t6.prototype,"updating",void 0),t6=x([Qe("esri.views.2d.layers.KMLLayerView2D")],t6);const K_n=t6,Z_n=Object.freeze(Object.defineProperty({__proto__:null,default:K_n},Symbol.toStringTag,{value:"Module"}));let wte=class extends Lm(Nm){constructor(e){super(e),this.layerViews=new dr}set layerViews(e){this._set("layerViews",ay(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,t)=>e+t.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};x([D({cast:fY})],wte.prototype,"layerViews",null),x([D({readOnly:!0})],wte.prototype,"updatingProgress",null),wte=x([Qe("esri.views.2d.layers.KnowledgeGraphLayerView2D")],wte);const Q_n=wte,F1t=Object.freeze(Object.defineProperty({__proto__:null,default:Q_n},Symbol.toStringTag,{value:"Module"})),ebn=i=>{let e=class extends i{initialize(){this.exportImageParameters=new Z_({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return x([D()],e.prototype,"exportImageParameters",void 0),x([D({readOnly:!0})],e.prototype,"floors",null),x([D({readOnly:!0})],e.prototype,"exportImageVersion",null),x([D()],e.prototype,"layer",void 0),x([D()],e.prototype,"suspended",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),e=x([Qe("esri.views.layers.MapImageLayerView")],e),e};let xte=class extends ebn(hL(Lm(Nm))){constructor(){super(...arguments),this._highlightGraphics=new bx,this._updateHash=""}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}update(e){const t=`${this.exportImageVersion}/${e.state.id}/${e.pixelRatio}/${e.stationary}`;this._updateHash!==t&&(this._updateHash=t,this.strategy.update(e).catch(r=>{mo(r)||di.getLogger(this).error(r)}),e.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(e.state.resolution)),this._highlightView.processUpdate(e)}attach(){const{imageMaxWidth:e,imageMaxHeight:t,version:r}=this.layer,n=r>=10.3,s=r>=10;this._bitmapContainer=new Bq,this.container.addChild(this._bitmapContainer),this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new XO({createFetchPopupFeaturesQueryGeometry:(o,a)=>sXt(o,a,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(o,a)=>{this._highlightView.graphicUpdateHandler({graphic:o,property:a})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new KCe({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:e,imageMaxHeight:t,imageRotationSupported:n,imageNormalizationSupported:s,hidpi:!0}),this.addAttachHandles(Ki(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,n){return this.layer.fetchImage(e,t,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}fetchImageBitmap(e,t,r,n){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}highlight(e){return this._popupHighlightHelper.highlight(e)}};x([D()],xte.prototype,"strategy",void 0),x([D()],xte.prototype,"updating",void 0),xte=x([Qe("esri.views.2d.layers.MapImageLayerView2D")],xte);const tbn=xte,ibn=Object.freeze(Object.defineProperty({__proto__:null,default:tbn},Symbol.toStringTag,{value:"Module"})),k1t="sublayers",yRe="layerView";let $7e=class extends Lm(Nm){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(e,t){return Array.from(this.graphicsViews(),r=>{const n=r.hitTest(e);if(this._graphicsViewsFeatureCollectionMap!=null){const s=this._graphicsViewsFeatureCollectionMap.get(r);for(const o of n)!o.popupTemplate&&s.popupTemplate&&(o.popupTemplate=s.popupTemplate),o.sourceLayer=o.layer=this.layer}return n}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:e}))}highlight(e){let t;typeof e=="number"?t=[e]:e instanceof Us?t=[e.uid]:Array.isArray(e)&&e.length>0?t=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):dr.isCollection(e)&&(t=e.map(n=>n&&n.uid).toArray());const r=t?.filter(Ga);return r?.length?(this._addHighlight(r),wa(()=>this._removeHighlight(r))):wa()}update(e){for(const t of this.graphicsViews())t.processUpdate(e)}attach(){const e=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const n of r){const s=new QA(this.view.featuresTilingScheme),o=new Tx({view:e,graphics:n.source,renderer:n.renderer,requestUpdateCallback:t,container:s});this._graphicsViewsFeatureCollectionMap.set(o,n),this.container.addChild(o.container),this.addHandles([Ki(()=>n.visible,a=>o.container.visible=a,js),Ki(()=>o.updating,()=>this.notifyChange("updating"),js)],yRe)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(ju(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),k1t)}detach(){this._destroyGraphicsViews(),this.removeHandles(k1t)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(yRe);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const e=[],t=this.view,r=()=>this.requestUpdate();for(const n of this.layer.sublayers){const s=new QA(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const o=new Tx({view:t,graphics:n.graphics,requestUpdateCallback:r,container:s});this.addHandles([n.on("graphic-update",o.graphicUpdateHandler),Ki(()=>n.visible,a=>o.container.visible=a,js),Ki(()=>o.updating,()=>this.notifyChange("updating"),js)],yRe),this.container.addChild(o.container),e.push(o)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys()),t=SCe("highlight");for(const r of this.graphicsViews())r.setHighlight(e.map(n=>({objectId:n,highlightFlags:t})))}};$7e=x([Qe("esri.views.2d.layers.MapNotesLayerView2D")],$7e);const rbn=$7e,nbn=Object.freeze(Object.defineProperty({__proto__:null,default:rbn},Symbol.toStringTag,{value:"Module"}));let pC=class extends un{constructor(e){super(e)}get bounds(){const e=this.coords;return e?.extent==null?null:tB(e.extent)}get coords(){const e=this.element.georeference?.coords;return kx(e,this.spatialReference).geometry}get normalizedCoords(){return $s.fromJSON(Agn(this.coords))}get normalizedBounds(){const e=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return e!=null?tB(e):null}};x([D()],pC.prototype,"spatialReference",void 0),x([D()],pC.prototype,"element",void 0),x([D()],pC.prototype,"bounds",null),x([D()],pC.prototype,"coords",null),x([D()],pC.prototype,"normalizedCoords",null),x([D()],pC.prototype,"normalizedBounds",null),pC=x([Qe("esri.layers.support.MediaElementView")],pC);const Uw=gr(),nz=Yd(),vRe=Yd(),L1t=Yd();function CP(i,e,t){return Zo(Uw,e[0],e[1],1),c3(Uw,Uw,ese(nz,t)),Uw[2]===0?dl(i,Uw[0],Uw[1]):dl(i,Uw[0]/Uw[2],Uw[1]/Uw[2])}function iZe(i,e,t){return N1t(vRe,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),N1t(L1t,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),n_(i,vWe(vRe,vRe),L1t),i[8]!==0&&(i[0]/=i[8],i[1]/=i[8],i[2]/=i[8],i[3]/=i[8],i[4]/=i[8],i[5]/=i[8],i[6]/=i[8],i[7]/=i[8],i[8]/=i[8]),i}function N1t(i,e,t,r,n,s,o,a,l){pB(i,e,r,s,t,n,o,1,1,1),Zo(Uw,a,l,1),vWe(nz,i);const[u,c,h]=c3(Uw,Uw,ese(nz,nz));return pB(nz,u,0,0,0,c,0,0,0,h),n_(i,nz,i)}const jK=Yd(),sbn={none:pb.None,loop:pb.Loop,oscillate:pb.Oscillate};function obn(i){return i?{...i,playAnimation:i.playing,repeatType:i.repeatType?sbn[i.repeatType]:void 0}:{}}let abn=class extends eM{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=Ja(),this._playHandle=null,this._vertices=new Float32Array(20),this._handles=[],this._handles.push(Ki(()=>this.elementView.element.opacity,t=>this.opacity=t,js),Ki(()=>[this.elementView.coords],()=>{this.requestRender()},js),Ki(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._playHandle?.remove(),this.texture=ba(this.texture),this.requestRender()},js),v0(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&this._handles.push(BA(t.content,"play",()=>this.requestRender()))},js)),e.element.load().catch(t=>{di.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new qe("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._playHandle?.remove(),this._handles.forEach(e=>e.remove()),this.texture=ba(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(r!=null){const n=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,o=n?r.naturalWidth:s?r.videoWidth:r.width,a=n?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(o,a),this.texture)s&&!r.paused&&(this.texture.setData(r),this.requestRender(),this.texture.generateMipmap());else{const l=new Ua;if(l.wrapMode=Ls.CLAMP_TO_EDGE,l.preMultiplyAlpha=!0,l.width=o,l.height=a,"getFrame"in r){const u=c=>{this.texture?this.texture.setData(c):this.texture=new fl(t,l,c),this.requestRender()};"animationOptions"in this.elementView.element&&(this._playHandle=aYt(r,obn(this.elementView.element.animationOptions),null,u))}else this.texture=new fl(t,l,r);this.texture.generateMipmap(),s&&!r.paused&&this.requestRender()}}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(r==null)return;const[n,s,o,a]=r.rings[0],l=this._vertices,{x:u,y:c}=e,h=t!==0;h?l.set([s[0]-u,s[1]-c,n[0]-u,n[1]-c,o[0]-u,o[1]-c,a[0]-u,a[1]-c,a[0]-u,a[1]-c,s[0]+t-u,s[1]-c,s[0]+t-u,s[1]-c,n[0]+t-u,n[1]-c,o[0]+t-u,o[1]-c,a[0]+t-u,a[1]-c]):l.set([s[0]-u,s[1]-c,n[0]-u,n[1]-c,o[0]-u,o[1]-c,a[0]-u,a[1]-c]),this.isWrapAround=h}getVAO(e,t,r){if(this.elementView.coords==null)return null;const n=this._vertices;if(this._vao)this._geometryVbo.setData(n);else{this._geometryVbo=Aa.createVertex(e,oa.DYNAMIC_DRAW,n);const s=Aa.createVertex(e,oa.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new wh(e,r,t,{geometry:this._geometryVbo,tex:s})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;iZe(jK,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),dl(this.perspectiveTransform,jK[6]/jK[8]*e,jK[7]/jK[8]*t)}},lbn=class extends Vle{constructor(){super(...arguments),this._localOrigin=Vd(0,0),this._viewStateId=-1,this._dvsMat3=Cc()}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Lq.overlay],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:r,size:n,pixelRatio:s,resolution:o,rotation:a,viewpoint:l,displayMat3:u}=t;if(this._viewStateId===r)return;const c=Math.PI/180*a,h=s*n[0],p=s*n[1],{x:m,y:v}=l.targetGeometry,w=cHe(m,t.spatialReference);this._localOrigin.x=w,this._localOrigin.y=v;const S=o*h,I=o*p,R=Jk(this._dvsMat3);n_(R,R,u),h0(R,R,Xp(h/2,p/2)),_R(R,R,m7(h/S,-p/I,1)),q3(R,R,-c),this._viewStateId=r}_updateOverlays(e,t){const{state:r}=e,{rotation:n,spatialReference:s,worldScreenWidth:o,size:a,viewpoint:l}=r,u=this._localOrigin;let c=0;const h=Zp(s);if(h&&s.isWrappable){const p=a[0],m=a[1],v=180/Math.PI*n,w=Math.abs(Math.cos(v)),S=Math.abs(Math.sin(v)),I=Math.round(p*w+m*S),[R,L]=h.valid,k=gWe(s),{x:B,y:$}=l.targetGeometry,V=[B,$],Y=[0,0];r.toScreen(Y,V);const K=[0,0];let Q;Q=I>o?.5*o:.5*I;const re=Math.floor((B+.5*k)/k),ne=R+re*k,de=L+re*k,pe=[Y[0]+Q,0];r.toMap(K,pe),K[0]>de&&(c=k),pe[0]=Y[0]-Q,r.toMap(K,pe),K[0]R?H.updateDrawCoords(u,k):fe>L&&aethis.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),ju(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new lbn,this.container.addChild(this._overlayContainer),this._fetchQueue=new LW({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new Qne({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],n=e.normalize(),s=[n.x,n.y];for(const{projectedElement:{normalizedCoords:o,element:a}}of this._elementReferences.values())o!=null&&yze(o.rings,s)&&r.push({type:"media",element:a,layer:this.layer,mapPoint:e,sourcePoint:a.toSource(e)});return r.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new ubn(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[r,n]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,n),this.requestUpdate()},t=>{mo(t)||di.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(r==null)return[];this.view.featuresTilingScheme.getTileBounds(SA,e,!0);const n=new hr({xmin:SA[0],ymin:SA[1],xmax:SA[2],ymax:SA[3],spatialReference:this.view.spatialReference});return r.queryElements(n,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){qh(this._elementReferences,t.uid,()=>{const r=new pC({element:t,spatialReference:this.view.spatialReference}),n=new abn(r);return this._overlayContainer.addChild(n),this.elements.add(t),{tiles:new Set,projectedElement:r,overlay:n,debugGraphic:null}}).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const n=t.projectedElement.normalizedCoords;if(n==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],o=[];for(const a of this._tileStrategy.tiles){const l=$1t(this.view.featuresTilingScheme,a,n);t.tiles.has(a)?l||o.push(a):l&&s.push(a)}for(const a of s)this._referenceElement(a,e);for(const a of o)this._dereferenceElement(a,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new pC({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(r!=null)for(const n of this._tileStrategy.tiles)$1t(this.view.featuresTilingScheme,n,r)&&this._referenceElement(n,e)}};x([D()],Ste.prototype,"layer",void 0),x([D({readOnly:!0})],Ste.prototype,"elements",void 0),Ste=x([Qe("esri.views.2d.layers.MediaLayerView2D")],Ste);const SA=Wo(),GK={xmin:0,ymin:0,xmax:0,ymax:0};function $1t(i,e,t){return i.getTileBounds(SA,e.key,!0),GK.xmin=SA[0],GK.ymin=SA[1],GK.xmax=SA[2],GK.ymax=SA[3],vze(GK,t)}let ubn=class{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const n of e)r.has(n)?r.delete(n):t.push(n);return this.isReady=!0,[t,Array.from(r)]}destroy(){}};const cbn=Ste,hbn=Object.freeze(Object.defineProperty({__proto__:null,default:cbn},Symbol.toStringTag,{value:"Module"})),dbn=i=>{let e=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(t=>t.name)}};return x([D()],e.prototype,"layer",void 0),x([D({readOnly:!0})],e.prototype,"availableFields",null),e=x([Qe("esri.views.layers.OGCFeatureLayerView")],e),e};let B7e=class extends dbn(qle){supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}};B7e=x([Qe("esri.views.2d.layers.OGCFeatureLayerView2D")],B7e);const pbn=B7e,fbn=Object.freeze(Object.defineProperty({__proto__:null,default:pbn},Symbol.toStringTag,{value:"Module"})),AXt=pa()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),MXt=pa()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"});pa()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const mbn=pa()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),gbn=pa()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),ybn=pa()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});pa()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const OXt=pa()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});pa()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"});pa()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const vbn=pa()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),Xy=pa()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),Are=pa()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),Mk=pa()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),cwe=pa()({1:"right",2:"left"},{useNumericKeys:!0}),kb=pa()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),Mre=pa()({0:"permit",1:"restrict"},{useNumericKeys:!0}),hwe=pa()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),dwe=pa()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),_bn=pa()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),bbn=pa()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),ZCe=pa()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),zb=pa()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),pwe=pa()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),wbn=pa()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),xbn=pa()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),Sbn=pa()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),Tbn=pa()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var j7e;let iv=j7e=class extends xs(Ci){constructor(i){super(i),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(i){return new j7e({directionLineType:dwe.fromJSON(i.attributes.DirectionLineType),directionPointId:i.attributes.DirectionPointID,distance:i.attributes.Meters,duration:i.attributes.Minutes,fromLevel:i.attributes.FromLevel??null,geometry:i.geometry,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,symbol:i.symbol,toLevel:i.attributes.ToLevel??null})}toGraphic(){const i={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?dwe.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(i.FromLevel=this.fromLevel),this.toLevel!=null&&(i.ToLevel=this.toLevel),new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};iv.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],iv.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:dwe.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:dwe.read}}})],iv.prototype,"directionLineType",void 0),x([D({json:{read:{source:"attributes.DirectionPointID"}}})],iv.prototype,"directionPointId",void 0),x([D({json:{read:{source:"attributes.Meters"}}})],iv.prototype,"distance",void 0),x([D({json:{read:{source:"attributes.Minutes"}}})],iv.prototype,"duration",void 0),x([D({json:{read:{source:"attributes.FromLevel"}}})],iv.prototype,"fromLevel",void 0),x([D({type:lo})],iv.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],iv.prototype,"objectId",void 0),x([D({type:qc})],iv.prototype,"popupTemplate",void 0),x([D({types:Kh})],iv.prototype,"symbol",void 0),x([D({json:{read:{source:"attributes.ToLevel"}}})],iv.prototype,"toLevel",void 0),x([D({readOnly:!0,json:{read:!1}})],iv.prototype,"type",void 0),iv=j7e=x([Qe("esri.rest.support.DirectionLine")],iv);const vV=iv;var G7e;let Th=G7e=class extends xs(Ci){constructor(i){super(i),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(i,e){return e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null}static fromGraphic(i){return new G7e({alternateName:i.attributes.AlternateName??null,arrivalTime:i.attributes.ArrivalTime!=null?new Date(i.attributes.ArrivalTime):null,arrivalTimeOffset:i.attributes.ArrivalUTCOffset??null,azimuth:i.attributes.Azimuth??null,branchName:i.attributes.BranchName??null,directionPointType:hwe.fromJSON(i.attributes.DirectionPointType),displayText:i.attributes.DisplayText??null,exitName:i.attributes.ExitName??null,geometry:i.geometry,intersectingName:i.attributes.IntersectingName??null,level:i.attributes.Level??null,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,sequence:i.attributes.Sequence,shortVoiceInstruction:i.attributes.ShortVoiceInstruction??null,stopId:i.attributes.StopID??null,symbol:i.symbol,towardName:i.attributes.TowardName??null,voiceInstruction:i.attributes.VoiceInstruction??null})}toGraphic(){const i={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?hwe.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(i.AlternateName=this.alternateName),this.arrivalTime!=null&&(i.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(i.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(i.Azimuth=this.azimuth),this.branchName!=null&&(i.BranchName=this.branchName),this.displayText!=null&&(i.DisplayText=this.displayText),this.exitName!=null&&(i.ExitName=this.exitName),this.intersectingName!=null&&(i.IntersectingName=this.intersectingName),this.level!=null&&(i.Level=this.level),this.name!=null&&(i.Name=this.name),this.shortVoiceInstruction!=null&&(i.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(i.TowardName=this.towardName),this.voiceInstruction!=null&&(i.VoiceInstruction=this.voiceInstruction),new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Th.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],Th.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({json:{read:{source:"attributes.AlternateName"}}})],Th.prototype,"alternateName",void 0),x([D()],Th.prototype,"arrivalTime",void 0),x([Mi("arrivalTime",["attributes.ArrivalTime"])],Th.prototype,"readArrivalTime",null),x([D({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],Th.prototype,"arrivalTimeOffset",void 0),x([D({json:{read:{source:"attributes.Azimuth"}}})],Th.prototype,"azimuth",void 0),x([D({json:{read:{source:"attributes.BranchName"}}})],Th.prototype,"branchName",void 0),x([D({type:hwe.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:hwe.read}}})],Th.prototype,"directionPointType",void 0),x([D({json:{read:{source:"attributes.DisplayText"}}})],Th.prototype,"displayText",void 0),x([D({json:{read:{source:"attributes.ExitName"}}})],Th.prototype,"exitName",void 0),x([D({type:$i})],Th.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.IntersectingName"}}})],Th.prototype,"intersectingName",void 0),x([D()],Th.prototype,"level",void 0),x([D({json:{read:{source:"attributes.Name"}}})],Th.prototype,"name",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],Th.prototype,"objectId",void 0),x([D({type:qc})],Th.prototype,"popupTemplate",void 0),x([D({json:{read:{source:"attributes.Sequence"}}})],Th.prototype,"sequence",void 0),x([D({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],Th.prototype,"shortVoiceInstruction",void 0),x([D({json:{read:{source:"attributes.StopID"}}})],Th.prototype,"stopId",void 0),x([D({types:Kh})],Th.prototype,"symbol",void 0),x([D({json:{read:{source:"attributes.TowardName"}}})],Th.prototype,"towardName",void 0),x([D({readOnly:!0,json:{read:!1}})],Th.prototype,"type",void 0),x([D({json:{read:{source:"attributes.VoiceInstruction"}}})],Th.prototype,"voiceInstruction",void 0),Th=G7e=x([Qe("esri.rest.support.DirectionPoint")],Th);const _V=Th;function NA(i,e){if(i==null)return null;const t={},r=new RegExp(`^${e}`,"i");for(const n of Object.keys(i))if(r.test(n)){const s=n.substring(e.length);t[zb.fromJSON(s)]=i[n]}return t}function rZe(i,e,t){if(i!=null){e.attributes||(e.attributes={});for(const r in i){const n=zb.toJSON(r);e.attributes[`${t}${n}`]=i[r]}}}function jq(i){const e={};for(const t of Object.keys(i)){const r=t;e[zb.fromJSON(r)]=i[t]}return e}function Gq(i){const e={};for(const t of Object.keys(i)){const r=t;e[zb.toJSON(r)]=i[t]}return e}function woe(i,e){return i==null||e==null?null:Math.round((i-e)/6e4)}function Cbn(i){const e=i.toJSON(),t=e;return t.accumulateAttributeNames&&=e.accumulateAttributeNames?.join(),t.attributeParameterValues&&=JSON.stringify(e.attributeParameterValues),t.barriers&&=JSON.stringify(e.barriers),t.outSR&&=e.outSR?.wkid,t.overrides&&=JSON.stringify(e.overrides),t.polygonBarriers&&=JSON.stringify(e.polygonBarriers),t.polylineBarriers&&=JSON.stringify(e.polylineBarriers),t.restrictionAttributeNames&&=e.restrictionAttributeNames?.join(),t.stops&&=JSON.stringify(e.stops),t.travelMode&&=JSON.stringify(e.travelMode),t}var U7e;let Rp=U7e=class extends xs(Ci){constructor(i){super(i),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}writeCosts(i,e){rZe(i,e,"Attr_")}static fromGraphic(i){return new U7e({addedCost:i.attributes.AddedCost??null,barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,curbApproach:i.attributes.CurbApproach!=null?Xy.fromJSON(i.attributes.CurbApproach):null,fullEdge:i.attributes.FullEdge!=null?Mre.fromJSON(i.attributes.FullEdge):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,status:i.attributes.Status!=null?Mk.fromJSON(i.attributes.Status):null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,CurbApproach:this.curbApproach!=null?Xy.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?Mre.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?Mk.toJSON(this.status):null};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Rp.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],Rp.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D()],Rp.prototype,"addedCost",void 0),x([D({type:kb.apiValues,json:{name:"attributes.BarrierType",read:{reader:kb.read},write:{writer:kb.write}}})],Rp.prototype,"barrierType",void 0),x([D()],Rp.prototype,"costs",void 0),x([Mi("costs",["attributes"])],Rp.prototype,"readCosts",null),x([ur("costs")],Rp.prototype,"writeCosts",null),x([D({constructOnly:!0,type:Xy.apiValues,json:{read:{source:"attributes.CurbApproach",reader:Xy.read}}})],Rp.prototype,"curbApproach",void 0),x([D({type:Mre.apiValues,json:{name:"attributes.FullEdge",read:{reader:Mre.read},write:{writer:Mre.write}}})],Rp.prototype,"fullEdge",void 0),x([D({type:$i,json:{write:!0}})],Rp.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],Rp.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],Rp.prototype,"objectId",void 0),x([D({type:qc})],Rp.prototype,"popupTemplate",void 0),x([D({type:cwe.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:cwe.read}}})],Rp.prototype,"sideOfEdge",void 0),x([D({json:{read:{source:"attributes.SourceID"}}})],Rp.prototype,"sourceId",void 0),x([D({json:{read:{source:"attributes.SourceOID"}}})],Rp.prototype,"sourceOid",void 0),x([D({type:Mk.apiValues,json:{read:{source:"attributes.Status",reader:Mk.read}}})],Rp.prototype,"status",void 0),x([D({types:Kh})],Rp.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],Rp.prototype,"type",void 0),Rp=U7e=x([Qe("esri.rest.support.PointBarrier")],Rp);const P8=Rp;var z7e;let rv=z7e=class extends xs(Ci){constructor(i){super(i),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}writeCosts(i,e){rZe(i,e,"Attr_")}static fromGraphic(i){return new z7e({barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,scaleFactor:i.attributes.ScaleFactor??null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};rv.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],rv.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:kb.apiValues,json:{name:"attributes.BarrierType",read:{reader:kb.read},write:{writer:kb.write}}})],rv.prototype,"barrierType",void 0),x([D()],rv.prototype,"costs",void 0),x([Mi("costs",["attributes"])],rv.prototype,"readCosts",null),x([ur("costs")],rv.prototype,"writeCosts",null),x([D({type:$s,json:{write:!0}})],rv.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],rv.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],rv.prototype,"objectId",void 0),x([D({type:qc})],rv.prototype,"popupTemplate",void 0),x([D()],rv.prototype,"scaleFactor",void 0),x([D({types:Kh})],rv.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],rv.prototype,"type",void 0),rv=z7e=x([Qe("esri.rest.support.PolygonBarrier")],rv);const R8=rv;var V7e;let g1=V7e=class extends xs(Ci){constructor(i){super(i),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}static fromGraphic(i){return new V7e({barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,scaleFactor:i.attributes.ScaleFactor??null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};g1.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],g1.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:kb.apiValues,json:{read:{source:"attributes.BarrierType",reader:kb.read}}})],g1.prototype,"barrierType",void 0),x([D()],g1.prototype,"costs",void 0),x([Mi("costs",["attributes"])],g1.prototype,"readCosts",null),x([D({type:lo,json:{write:!0}})],g1.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],g1.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],g1.prototype,"objectId",void 0),x([D({type:qc})],g1.prototype,"popupTemplate",void 0),x([D()],g1.prototype,"scaleFactor",void 0),x([D({types:Kh})],g1.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],g1.prototype,"type",void 0),g1=V7e=x([Qe("esri.rest.support.PolylineBarrier")],g1);const D8=g1;let qm=class extends xs(Ci){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,t){return t.id??t.itemId??null}readRestrictionAttributes(e,t){const{restrictionAttributeNames:r}=t;return r==null?null:r.map(n=>pwe.fromJSON(n))}writeRestrictionAttributes(e,t,r){e!=null&&(t[r]=e.map(n=>pwe.toJSON(n)))}};x([D({type:[Object],json:{write:!0}})],qm.prototype,"attributeParameterValues",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"description",void 0),x([Wr(bbn,{ignoreUnknown:!1})],qm.prototype,"distanceAttributeName",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"id",void 0),x([Mi("id",["id","itemId"])],qm.prototype,"readId",null),x([Wr(zb,{ignoreUnknown:!1})],qm.prototype,"impedanceAttributeName",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"name",void 0),x([D({type:[String],json:{write:!0}})],qm.prototype,"restrictionAttributeNames",void 0),x([Mi("restrictionAttributeNames")],qm.prototype,"readRestrictionAttributes",null),x([ur("restrictionAttributeNames")],qm.prototype,"writeRestrictionAttributes",null),x([D({type:Number,json:{write:{allowNull:!0}}})],qm.prototype,"simplificationTolerance",void 0),x([Wr(AXt)],qm.prototype,"simplificationToleranceUnits",void 0),x([Wr(ZCe,{ignoreUnknown:!1})],qm.prototype,"timeAttributeName",void 0),x([Wr(vbn)],qm.prototype,"type",void 0),x([D({type:Boolean,json:{write:!0}})],qm.prototype,"useHierarchy",void 0),x([Wr(OXt)],qm.prototype,"uturnAtJunctions",void 0),qm=x([Qe("esri.rest.support.TravelMode")],qm);const QCe=qm;let Mw=class extends Ci{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(t=>zb.fromJSON(t))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(n=>zb.toJSON(n)))}};x([D({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Mw.prototype,"accumulateAttributes",void 0),x([Mi("accumulateAttributes")],Mw.prototype,"readAccumulateAttributes",null),x([ur("accumulateAttributes")],Mw.prototype,"writeAccumulateAttributes",null),x([D({type:String,json:{write:!0}})],Mw.prototype,"directionsLanguage",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"findBestSequence",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"preserveFirstStop",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"preserveLastStop",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"startTimeIsUTC",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"timeWindowsAreUTC",void 0),x([D({type:QCe,json:{write:!0}})],Mw.prototype,"travelMode",void 0),Mw=x([Qe("esri.layers.support.RouteSettings")],Mw);const PXt=Mw;var H7e;let Du=H7e=class extends xs(Ci){constructor(i){super(i),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(i,e){return e.attributes.EndTimeUTC!=null?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(i,e){return woe(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(i,e){return e.attributes.StartTimeUTC!=null?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(i,e){return woe(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(i,e){return NA(e.attributes,"Total_")}readTotalViolations(i,e){return NA(e.attributes,"TotalViolation_")}readTotalWait(i,e){return NA(e.attributes,"TotalWait_")}static fromGraphic(i){return new H7e({analysisSettings:i.attributes.AnalysisSettings!=null?PXt.fromJSON(JSON.parse(i.attributes.AnalysisSettings)):null,endTime:i.attributes.EndTime!=null?new Date(i.attributes.EndTime):null,endTimeOffset:i.attributes.EndUTCOffset??null,geometry:i.geometry,messages:i.attributes.Messages!=null?JSON.parse(i.attributes.Messages):null,name:i.attributes.RouteName,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,startTime:i.attributes.StartTime!=null?new Date(i.attributes.StartTime):null,startTimeOffset:i.attributes.StartUTCOffset??null,symbol:i.symbol,totalCosts:i.attributes.TotalCosts!=null?jq(JSON.parse(i.attributes.TotalCosts)):null,totalDistance:i.attributes.TotalMeters??null,totalDuration:i.attributes.TotalMinutes??null,totalLateDuration:i.attributes.TotalLateMinutes??null,totalWaitDuration:i.attributes.TotalWaitMinutes??null,version:i.attributes.Version})}toGraphic(){const i={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(Gq(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Du.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],Du.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D()],Du.prototype,"analysisSettings",void 0),x([D()],Du.prototype,"endTime",void 0),x([Mi("endTime",["attributes.EndTimeUTC"])],Du.prototype,"readEndTime",null),x([D()],Du.prototype,"endTimeOffset",void 0),x([Mi("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],Du.prototype,"readEndTimeOffset",null),x([D({json:{read:{source:"attributes.FirstStopID"}}})],Du.prototype,"firstStopId",void 0),x([D({type:lo})],Du.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.LastStopID"}}})],Du.prototype,"lastStopId",void 0),x([D()],Du.prototype,"messages",void 0),x([D({json:{read:{source:"attributes.Name"}}})],Du.prototype,"name",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],Du.prototype,"objectId",void 0),x([D({type:qc})],Du.prototype,"popupTemplate",void 0),x([D()],Du.prototype,"startTime",void 0),x([Mi("startTime",["attributes.StartTimeUTC"])],Du.prototype,"readStartTime",null),x([D()],Du.prototype,"startTimeOffset",void 0),x([Mi("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],Du.prototype,"readStartTimeOffset",null),x([D({json:{read:{source:"attributes.StopCount"}}})],Du.prototype,"stopCount",void 0),x([D({types:Kh})],Du.prototype,"symbol",void 0),x([D()],Du.prototype,"totalCosts",void 0),x([Mi("totalCosts",["attributes"])],Du.prototype,"readTotalCosts",null),x([D()],Du.prototype,"totalDistance",void 0),x([D()],Du.prototype,"totalDuration",void 0),x([D()],Du.prototype,"totalLateDuration",void 0),x([D()],Du.prototype,"totalViolations",void 0),x([Mi("totalViolations",["attributes"])],Du.prototype,"readTotalViolations",null),x([D()],Du.prototype,"totalWait",void 0),x([Mi("totalWait",["attributes"])],Du.prototype,"readTotalWait",null),x([D()],Du.prototype,"totalWaitDuration",void 0),x([D({readOnly:!0,json:{read:!1}})],Du.prototype,"type",void 0),x([D()],Du.prototype,"version",void 0),Du=H7e=x([Qe("esri.rest.support.RouteInfo")],Du);const Tte=Du;var W7e;let Ao=W7e=class extends xs(Ci){constructor(i){super(i),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(i,e){return woe(e.attributes.ArriveTime,e.attributes.ArriveTimeUTC)}readCumulativeCosts(i,e){return NA(e.attributes,"Cumul_")}readDepartTimeOffset(i,e){return woe(e.attributes.DepartTime,e.attributes.DepartTimeUTC)}readServiceCosts(i,e){return NA(e.attributes,"Attr_")}writeServiceCosts(i,e){rZe(i,e,"Attr_")}writeTimeWindowEnd(i,e){i!=null&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowEnd=i.getTime())}writeTimeWindowStart(i,e){i!=null&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowStart=i.getTime())}readViolations(i,e){return NA(e.attributes,"Violation_")}readWait(i,e){return NA(e.attributes,"Wait_")}static fromGraphic(i){return new W7e({arriveCurbApproach:i.attributes.ArrivalCurbApproach!=null?Xy.fromJSON(i.attributes.ArrivalCurbApproach):null,arriveTime:i.attributes.ArrivalTime!=null?new Date(i.attributes.ArrivalTime):null,arriveTimeOffset:i.attributes.ArrivalUTCOffset,cumulativeCosts:i.attributes.CumulativeCosts!=null?jq(JSON.parse(i.attributes.CumulativeCosts)):null,cumulativeDistance:i.attributes.CumulativeMeters??null,cumulativeDuration:i.attributes.CumulativeMinutes??null,curbApproach:i.attributes.CurbApproach!=null?Xy.fromJSON(i.attributes.CurbApproach):null,departCurbApproach:i.attributes.DepartureCurbApproach!=null?Xy.fromJSON(i.attributes.DepartureCurbApproach):null,departTime:i.attributes.DepartureTime!=null?new Date(i.attributes.DepartureTime):null,departTimeOffset:i.attributes.DepartureUTCOffset??null,geometry:i.geometry,lateDuration:i.attributes.LateMinutes??null,locationType:i.attributes.LocationType!=null?Are.fromJSON(i.attributes.LocationType):null,name:i.attributes.Name,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,routeName:i.attributes.RouteName,sequence:i.attributes.Sequence??null,serviceCosts:i.attributes.ServiceCosts!=null?jq(JSON.parse(i.attributes.ServiceCosts)):null,serviceDistance:i.attributes.ServiceMeters??null,serviceDuration:i.attributes.ServiceMinutes??null,status:i.attributes.Status!=null?Mk.fromJSON(i.attributes.Status):null,symbol:i.symbol,timeWindowEnd:i.attributes.TimeWindowEnd!=null?new Date(i.attributes.TimeWindowEnd):null,timeWindowEndOffset:i.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:i.attributes.TimeWindowStart!=null?new Date(i.attributes.TimeWindowStart):null,timeWindowStartOffset:i.attributes.TimeWindowStartUTCOffset??null,waitDuration:i.attributes.WaitMinutes??null})}toGraphic(){const i={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?Xy.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(Gq(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?Xy.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?Xy.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?Are.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(Gq(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?Mk.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Ao.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],Ao.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:Xy.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:Xy.read}}})],Ao.prototype,"arriveCurbApproach",void 0),x([D({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],Ao.prototype,"arriveTime",void 0),x([D()],Ao.prototype,"arriveTimeOffset",void 0),x([Mi("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],Ao.prototype,"readArriveTimeOffset",null),x([D({json:{name:"attributes.Bearing",read:!1,write:!0}})],Ao.prototype,"bearing",void 0),x([D({json:{name:"attributes.BearingTol",read:!1,write:!0}})],Ao.prototype,"bearingTol",void 0),x([D()],Ao.prototype,"cumulativeCosts",void 0),x([Mi("cumulativeCosts",["attributes"])],Ao.prototype,"readCumulativeCosts",null),x([D()],Ao.prototype,"cumulativeDistance",void 0),x([D()],Ao.prototype,"cumulativeDuration",void 0),x([D({type:Xy.apiValues,json:{name:"attributes.CurbApproach",read:{reader:Xy.read},write:{writer:Xy.write}}})],Ao.prototype,"curbApproach",void 0),x([D({type:Xy.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:Xy.read}}})],Ao.prototype,"departCurbApproach",void 0),x([D({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],Ao.prototype,"departTime",void 0),x([D()],Ao.prototype,"departTimeOffset",void 0),x([Mi("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],Ao.prototype,"readDepartTimeOffset",null),x([D({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],Ao.prototype,"distanceToNetworkInMeters",void 0),x([D({type:$i,json:{write:!0}})],Ao.prototype,"geometry",void 0),x([D()],Ao.prototype,"lateDuration",void 0),x([D({type:Are.apiValues,json:{name:"attributes.LocationType",read:{reader:Are.read},write:{writer:Are.write}}})],Ao.prototype,"locationType",void 0),x([D({json:{name:"attributes.Name"}})],Ao.prototype,"name",void 0),x([D({json:{name:"attributes.NavLatency",read:!1,write:!0}})],Ao.prototype,"navLatency",void 0),x([D({json:{name:"attributes.ObjectID"}})],Ao.prototype,"objectId",void 0),x([D({type:qc})],Ao.prototype,"popupTemplate",void 0),x([D({json:{read:{source:"attributes.PosAlong"}}})],Ao.prototype,"posAlong",void 0),x([D({json:{name:"attributes.RouteName"}})],Ao.prototype,"routeName",void 0),x([D()],Ao.prototype,"serviceCosts",void 0),x([Mi("serviceCosts",["attributes"])],Ao.prototype,"readServiceCosts",null),x([ur("serviceCosts")],Ao.prototype,"writeServiceCosts",null),x([D()],Ao.prototype,"serviceDistance",void 0),x([D()],Ao.prototype,"serviceDuration",void 0),x([D({json:{name:"attributes.Sequence"}})],Ao.prototype,"sequence",void 0),x([D({type:cwe.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:cwe.read}}})],Ao.prototype,"sideOfEdge",void 0),x([D({json:{read:{source:"attributes.SnapX"}}})],Ao.prototype,"snapX",void 0),x([D({json:{read:{source:"attributes.SnapY"}}})],Ao.prototype,"snapY",void 0),x([D({json:{read:{source:"attributes.SnapZ"}}})],Ao.prototype,"snapZ",void 0),x([D({json:{read:{source:"attributes.SourceID"}}})],Ao.prototype,"sourceId",void 0),x([D({json:{read:{source:"attributes.SourceOID"}}})],Ao.prototype,"sourceOid",void 0),x([D({type:Mk.apiValues,json:{read:{source:"attributes.Status",reader:Mk.read}}})],Ao.prototype,"status",void 0),x([D({types:Kh})],Ao.prototype,"symbol",void 0),x([D({type:Date,json:{name:"attributes.TimeWindowEnd"}})],Ao.prototype,"timeWindowEnd",void 0),x([ur("timeWindowEnd")],Ao.prototype,"writeTimeWindowEnd",null),x([D()],Ao.prototype,"timeWindowEndOffset",void 0),x([D({type:Date,json:{name:"attributes.TimeWindowStart"}})],Ao.prototype,"timeWindowStart",void 0),x([ur("timeWindowStart")],Ao.prototype,"writeTimeWindowStart",null),x([D()],Ao.prototype,"timeWindowStartOffset",void 0),x([D({readOnly:!0,json:{read:!1}})],Ao.prototype,"type",void 0),x([D()],Ao.prototype,"violations",void 0),x([Mi("violations",["attributes"])],Ao.prototype,"readViolations",null),x([D()],Ao.prototype,"waitDuration",void 0),x([D()],Ao.prototype,"wait",void 0),x([Mi("wait",["attributes"])],Ao.prototype,"readWait",null),Ao=W7e=x([Qe("esri.rest.support.Stop")],Ao);const F8=Ao,Ebn=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],UK={graphic:null,property:null,oldValue:null,newValue:null};function nZe(i){return i instanceof vV||i instanceof _V||i instanceof P8||i instanceof R8||i instanceof D8||i instanceof Tte||i instanceof F8}function Ibn(i){return dr.isCollection(i)&&i.length&&nZe(i.at(0))}function Abn(i){return Array.isArray(i)&&i.length>0&&nZe(i[0])}let Cte=class extends Lm(Nm){constructor(){super(...arguments),this._graphics=new dr,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new _E({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new dr([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,e=>this._routeItemsChanged(e),js)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(e,t){return this._graphicsView.hitTest(e).filter(({popupTemplate:r})=>!!r)}highlight(e){let t;t=nZe(e)?[this._getNetworkFeatureUid(e)]:Abn(e)?e.map(n=>this._getNetworkFeatureUid(n)):Ibn(e)?e.map(n=>this._getNetworkFeatureUid(n)).toArray():[e.uid];const r=t.filter(Ga);return r.length?(this._addHighlight(r),wa(()=>this._removeHighlight(r))):wa()}async hitTest(e,t){if(this.suspended)return null;const r=this._graphicsView.hitTest(e).filter(Ga).map(s=>this._networkGraphicMap.get(s));if(!r.length)return null;const{layer:n}=this;return r.reverse().map(s=>({type:"route",layer:n,mapPoint:e,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(e){this._graphicsView.processUpdate(e)}viewChange(){this._graphicsView.viewChange()}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_createGraphic(e){const t=e.toGraphic();return t.layer=this.layer,t.sourceLayer=this.layer,t}_createGraphicsView(){const e=this.view,t=()=>this.requestUpdate(),r=new QA(e.featuresTilingScheme);this._graphicsView=new Tx({container:r,graphics:this._graphics,requestUpdateCallback:t,view:e}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(e){const t=this._networkGraphicMap.get(e);return Ebn.indexOf(t.type)}_getNetworkFeatureUid(e){return this._networkFeatureMap.has(e)?this._networkFeatureMap.get(e).uid:null}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_routeItemsChanged(e){if(e.removed.length){this._graphics.removeMany(e.removed.map(t=>{const r=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(r),r}));for(const t of e.removed)this.removeHandles(t)}if(e.added.length){this._graphics.addMany(e.added.map(t=>{const r=this._createGraphic(t);return r.symbol==null?null:(this._networkFeatureMap.set(t,r),this._networkGraphicMap.set(r,t),r)}).filter(Ga));for(const t of e.added)this.addHandles([Ki(()=>t.geometry,(r,n)=>{this._updateGraphic(t,"geometry",r,n)}),Ki(()=>t.symbol,(r,n)=>{this._updateGraphic(t,"symbol",r,n)})],t);this._graphics.sort((t,r)=>this._getDrawOrder(t)-this._getDrawOrder(r))}}_updateGraphic(e,t,r,n){if(!this._networkFeatureMap.has(e)){const o=this._createGraphic(e);return this._networkFeatureMap.set(e,o),this._networkGraphicMap.set(o,e),void this._graphics.add(o)}const s=this._networkFeatureMap.get(e);s[t]=r,UK.graphic=s,UK.property=t,UK.oldValue=n,UK.newValue=r,this._graphicsView.graphicUpdateHandler(UK)}_updateHighlight(){const e=Array.from(this._highlightIds.keys()),t=SCe("highlight");this._graphicsView.setHighlight(e.map(r=>({objectId:r,highlightFlags:t})))}};x([D()],Cte.prototype,"_graphics",void 0),x([D()],Cte.prototype,"_routeItems",null),Cte=x([Qe("esri.views.2d.layers.RouteLayerView2D")],Cte);const Mbn=Cte,Obn=Object.freeze(Object.defineProperty({__proto__:null,default:Mbn},Symbol.toStringTag,{value:"Module"})),Pbn=i=>{let e=class extends i{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...t){super(...t),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(t){t?this._doPause():this._isUserPaused||this._doResume()}};return x([D()],e.prototype,"_isUserPaused",void 0),x([D({readOnly:!0})],e.prototype,"connectionStatus",null),x([D({type:QF})],e.prototype,"filter",void 0),e=x([Qe("esri.layers.mixins.StreamLayerView")],e),e};let i6=class extends Pbn(qle){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([Ki(()=>this.layer.customParameters,e=>this._worker.streamMessenger.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._worker.streamMessenger.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&e.type==="clear"&&this.incrementSourceRefreshVersion()}),Ki(()=>this.layer.purgeOptions,()=>this._update()),Ki(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new qe("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return j3(e.map(o=>this.on(o,t)));const r=["data-received","message-received"].includes(e);r&&this._worker.streamMessenger.enableEvent(e,!0);const n=super.on(e,t),s=this;return wa(()=>{n.remove(),r&&(s._worker.closed||s.hasEventListener(e)||s._worker.streamMessenger.enableEvent(e,!1))})}queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new qe("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return Wm(this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(r=>{const n=du.fromJSON(r);return n.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),n}),new du({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this.resume()}_doClear(){this._worker.streamMessenger.clear(),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};x([D()],i6.prototype,"pipelineConnectionStatus",void 0),x([D()],i6.prototype,"pipelineErrorString",void 0),x([D({readOnly:!0})],i6.prototype,"connectionError",null),x([D({readOnly:!0})],i6.prototype,"_streamConnectionStatus",null),i6=x([Qe("esri.views.2d.layers.StreamLayerView2D")],i6);const Rbn=i6,Dbn=Object.freeze(Object.defineProperty({__proto__:null,default:Rbn},Symbol.toStringTag,{value:"Module"}));let q7e=class extends qle{initialize(){this.addHandles([Ki(()=>this.view.scale,()=>this._update(),js)],"constructor")}isUpdating(){const e=this.layer.sublayers.some(a=>a.renderer!=null),t=this._commandsQueue.updateTracking.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._worker,s=this.dataUpdating,o=e&&(t||r||n||s);return yi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${o} +`),e}_setSubView(){if(!this.view)return;const e=this.layer.renderer?.type;let t="imagery";if(e==="vector-field"?t="imageryVF":e==="flow"&&(t="flow"),this.subview){const{type:r}=this.subview;if(r===t)return this._attachSubview(this.subview),void(r==="flow"?this.subview.redrawOrRefetch():r==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=t==="imagery"?new Bvn({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):t==="imageryVF"?new zvn({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new _Xt({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};x([D()],bte.prototype,"pixelData",null),x([D()],bte.prototype,"subview",void 0),bte=x([Qe("esri.views.2d.layers.ImageryLayerView2D")],bte);const Hvn=bte,Wvn=Object.freeze(Object.defineProperty({__proto__:null,default:Hvn},Symbol.toStringTag,{value:"Module"}));function qvn(i,e,t="nearest",r=!1){const n=!(r&&e.pixelType==="u8"),s=n?lc.FLOAT:lc.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),a=i.capabilities.textureFloat?.textureFloatLinear,l=new Ua;return l.width=e.width,l.height=e.height,l.internalFormat=n?gs.RGBA32F:ks.RGBA,l.samplingMode=!a||t!=="bilinear"&&t!=="cubic"?Is.NEAREST:Is.LINEAR,l.dataType=s,l.wrapMode=Ls.CLAMP_TO_EDGE,new fl(i,l,o)}function xXt(i,e){const{spacing:t,offsets:r,coefficients:n,size:[s,o]}=e,a=t[0]>1,l=new Ua;l.width=a?4*s:s,l.height=o,l.internalFormat=gs.RGBA32F,l.dataType=lc.FLOAT,l.samplingMode=Is.NEAREST,l.wrapMode=Ls.CLAMP_TO_EDGE;const u=new Float32Array(a?s*o*16:2*r.length);if(a&&n!=null)for(let c=0,h=0;c{const n=e.get(r)||e.get(r+"[0]");n&&Qvn(i,r,t[r],n)})}function vX(i,e,t,r){t.length===r.length&&(r.some(n=>n==null)||t.some(n=>n==null)||t.forEach((n,s)=>{e.setUniform1i(n,s),i.bindTexture(r[s],s)}))}function Qvn(i,e,t,r){if(r===null||t==null)return!1;const{info:n}=r;switch(n.type){case uv.FLOAT:n.size>1?i.setUniform1fv(e,t):i.setUniform1f(e,t);break;case uv.FLOAT_VEC2:i.setUniform2fv(e,t);break;case uv.FLOAT_VEC3:i.setUniform3fv(e,t);break;case uv.FLOAT_VEC4:i.setUniform4fv(e,t);break;case uv.FLOAT_MAT3:i.setUniformMatrix3fv(e,t);break;case uv.FLOAT_MAT4:i.setUniformMatrix4fv(e,t);break;case uv.INT:n.size>1?i.setUniform1iv(e,t):i.setUniform1i(e,t);break;case uv.BOOL:i.setUniform1i(e,t?1:0);break;case uv.INT_VEC2:case uv.BOOL_VEC2:i.setUniform2iv(e,t);break;case uv.INT_VEC3:case uv.BOOL_VEC3:i.setUniform3iv(e,t);break;case uv.INT_VEC4:case uv.BOOL_VEC4:i.setUniform4iv(e,t);break;default:return!1}return!0}const e1n={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};let t1n=class extends eM{constructor(e=null,t=null,r=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=r}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(ba(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||e1n}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?Is.LINEAR:Is.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=ba(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const t=e||this.projected;return[t?this.width:this.source?.width||this.width,t?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:t,resolution:r}=this;return e&&!t?[e.x,e.y]:[r,r]}_createTransforms(){return{displayViewScreenMat3:Cc()}}setTransform(e){const t=Jk(this.transforms.displayViewScreenMat3),[r,n]=e.toScreenNoRotation([0,0],[this.x,this.y]),s=this.resolution/this.pixelRatio/e.resolution,o=s*this.width,a=s*this.height,l=Math.PI*this.rotation/180;h0(t,t,Xp(r,n)),h0(t,t,Xp(o/2,a/2)),q3(t,t,-l),h0(t,t,Xp(-o/2,-a/2)),vSe(t,t,Xp(o,a)),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const r=t?this._processedTexture??this._rasterTexture:this._rasterTexture,n=[],s=[];return r?(this._transformGridTexture&&!this.projected&&(s.push(this._transformGridTexture),n.push("u_transformGrid")),t?(s.push(r),n.push("u_image"),this._colormapTexture&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s}):(s.push(r),n.push("u_image"),this._colormapTexture&&!e&&(s.push(this._colormapTexture),n.push("u_colormap")),{names:n,textures:s})):{names:n,textures:s}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=xXt(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(t=>t?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const t=this.source?.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloat?.textureFloatLinear;const n=this._getTextureSamplingMethod(this.interpolation),s=this.isRendereredSource;this._rasterTexture=qvn(e,t,n,s),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:t}=this.symbolizerParameters,r=t==="lut"||t==="hillshade"||t==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||r||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,r=this.symbolizerParameters.colormap;return r?t?r.length!==t.length||r.some((n,s)=>n!==t[s])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=E1t(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=E1t(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}};function i1n(i){return i.source!=null}function QKe(i){const e=[];return i&&(e.push("applyProjection"),i.spacing[0]===1&&e.push("lookupProjection")),e}function SXt(i,e,t){const r=!t.capabilities.textureFloat?.textureFloatLinear,n=[];return i==="cubic"?n.push("bicubic"):i==="bilinear"&&(e?(n.push("bilinear"),n.push("nnedge")):r&&n.push("bilinear")),n}const r1n={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function n1n(i,e,t){const r=t?[]:QKe(e.transformGrid);return{defines:r,program:i.painter.materialManager.getProgram(r1n,r)}}function s1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const{colormap:a,colormapOffset:l}=t.symbolizerParameters,u=ZKe(a,l);NF(e,r,u)}const o1n={createProgram:n1n,bindTextureAndUniforms:s1n},a1n={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function l1n(i,e,t){const{colormap:r}=e.symbolizerParameters,n=[...t?[]:QKe(e.transformGrid),...SXt(e.interpolation,!0,i.context)];return r!=null&&n.push("applyColormap"),{defines:n,program:i.painter.materialManager.getProgram(a1n,n)}}function u1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const a=t.symbolizerParameters,{colormap:l,colormapOffset:u}=a;if(l!=null){const h=ZKe(l,u);NF(e,r,h)}const c=Kvn(a);NF(e,r,c)}const c1n={createProgram:l1n,bindTextureAndUniforms:u1n},h1n={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function d1n(i,e,t){const{colormap:r,bandCount:n}=e.symbolizerParameters,s=[...t?[]:QKe(e.transformGrid),...SXt(e.interpolation,n===1,i.context)];return e.isRendereredSource&&!t?s.push("noop"):r!=null&&s.push("applyColormap"),{defines:s,program:i.painter.materialManager.getProgram(h1n,s)}}function p1n(i,e,t,r,n=!1){const{names:s,textures:o}=t.getTextures({useProcessedTexture:n});vX(i.context,e,s,o),NF(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const a=t.symbolizerParameters,{colormap:l,colormapOffset:u}=a;if(l!=null){const h=ZKe(l,u);NF(e,r,h)}const c=Jvn(a);NF(e,r,c)}const f1n={createProgram:d1n,bindTextureAndUniforms:p1n},Qye=new Map;function m1n(i){return Qye.get(i)}Qye.set("lut",o1n),Qye.set("hillshade",c1n),Qye.set("stretch",f1n);const g1n=[1,1],y1n=[2,0,0,0,2,0,-1,-1,0];function Xb(i,e,t){const{context:r,rasterFunction:n,hasBranches:s}=i,{raster:o}=n.parameters,a=s?o?.id??-1:0,l=t.functionTextures[a]??t.rasterTexture;vX(r,e,["u_image"],[l])}function TXt(i,e,t){const{rasters:r}=i.rasterFunction.parameters;if(!r)return;if(r.length<2)return Xb(i,e,t);const n=r.filter(s=>s.name!=="Constant").map(s=>s.id!=null&&s.name!=="Identity"?t.functionTextures[s.id]:t.rasterTexture);if(vX(i.context,e,["u_image","u_image1","u_image2"].slice(0,n.length),n),n.length!==r.length){if(r.length===2){const s=r.findIndex(l=>l.name==="Constant"),o=s===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:a}=r[s].parameters;e.setUniform1f("u_image1Const",a),e.setUniformMatrix3fv("u_imageSwap",o)}else if(r.length===3){const s=[];if(r.forEach((o,a)=>o.name==="Constant"&&s.push(a)),s.length===1){const{value:o}=r[s[0]].parameters;e.setUniform1f("u_image1Const",o);const a=s[0]===0?[0,1,0,0,0,1,1,0,0]:s[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",a)}else if(s.length===2){const{value:o}=r[s[0]].parameters;e.setUniform1f("u_image1Const",o);const{value:a}=r[s[1]].parameters;e.setUniform1f("u_image2Const",a);const l=r.findIndex(c=>c.name!=="Constant"),u=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",u)}}}}function m_(i){i.setUniform2fv("u_coordScale",g1n),i.setUniformMatrix3fv("u_dvsMat3",y1n)}const v1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _1n(i,e){return i.painter.materialManager.getProgram(v1n,[])}function b1n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const n=t.getRasterCellSize();e.setUniform2fv("u_cellSize",n)}const w1n={createProgram:_1n,bindTextureAndUniforms:b1n},x1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function S1n(i,e){const{painter:t,rasterFunction:r}=i,{indexType:n}=r.parameters;return t.materialManager.getProgram(x1n,[n])}function T1n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const C1n={createProgram:S1n,bindTextureAndUniforms:T1n},E1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function I1n(i,e){const t=i.rasterFunction.parameters.rasters.filter(n=>n.name==="Constant"),r=[];return t.length&&(r.push("oneConstant"),t.length===2&&r.push("twoConstant")),i.painter.materialManager.getProgram(E1n,r)}function A1n(i,e,t){TXt(i,e,t),m_(e)}const M1n={createProgram:I1n,bindTextureAndUniforms:A1n},O1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function P1n(i,e){return i.painter.materialManager.getProgram(O1n,[])}function R1n(i,e,t){Xb(i,e,t),m_(e);const{contrastOffset:r,brightnessOffset:n}=i.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",r),e.setUniform1f("u_brightnessOffset",n)}const D1n={createProgram:P1n,bindTextureAndUniforms:R1n},F1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function k1n(i,e){const{painter:t,rasterFunction:r}=i,{kernelRows:n,kernelCols:s}=r.parameters,o=[{name:"rows",value:n},{name:"cols",value:s}];return t.materialManager.getProgram(F1n,o)}function L1n(i,e,t){Xb(i,e,t),m_(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{kernel:r,clampRange:n}=i.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",n)}const N1n={createProgram:k1n,bindTextureAndUniforms:L1n},$1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function B1n(i,e){const{painter:t,rasterFunction:r}=i,{curvatureType:n}=r.parameters,s=[n];return t.materialManager.getProgram($1n,s)}function j1n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const{zFactor:n}=i.rasterFunction.parameters,s=t.getRasterCellSize();e.setUniform1f("u_zlFactor",200*n/s[0]/s[1])}const G1n={createProgram:B1n,bindTextureAndUniforms:j1n},U1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function z1n(i,e){return i.painter.materialManager.getProgram(U1n,[])}function V1n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const H1n={createProgram:z1n,bindTextureAndUniforms:V1n},W1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function q1n(i,e){const{painter:t,rasterFunction:r}=i,{kernelRows:n,kernelCols:s,fillNoDataOnly:o,statisticsType:a}=r.parameters,l=[{name:"rows",value:n},{name:"cols",value:s},a];return o&&l.push("fill"),t.materialManager.getProgram(W1n,l)}function Y1n(i,e,t){Xb(i,e,t),m_(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{clampRange:r}=i.rasterFunction.parameters;e.setUniform2fv("u_clampRange",r)}const X1n={createProgram:q1n,bindTextureAndUniforms:Y1n},J1n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function K1n(i,e){return i.painter.materialManager.getProgram(J1n,[])}function Z1n(i,e,t){Xb(i,e,t),m_(e);const{weights:r}=i.rasterFunction.parameters;e.setUniform3fv("u_weights",r)}const Q1n={createProgram:K1n,bindTextureAndUniforms:Z1n},e_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function t_n(i){const{painter:e,rasterFunction:t}=i,{imageCount:r,operationName:n,rasters:s,isOutputRounded:o}=t.parameters,a=[n.toLowerCase()];r===2&&a.push("twoImages");const l=s.filter(u=>u.name==="Constant");return l.length&&(a.push("oneConstant"),l.length===2&&a.push("twoConstant")),o&&a.push("roundOutput"),e.materialManager.getProgram(e_n,a)}function i_n(i,e,t){TXt(i,e,t),m_(e);const{domainRange:r}=i.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const I1t={createProgram:t_n,bindTextureAndUniforms:i_n},r_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function n_n(i,e){const{painter:t,rasterFunction:r}=i,n=r.parameters.bandCount>1?["multiBand"]:[];return t.materialManager.getProgram(r_n,n)}function s_n(i,e,t){Xb(i,e,t),m_(e);const{includedRanges:r,noDataValues:n}=i.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",n)}const o_n={createProgram:n_n,bindTextureAndUniforms:s_n},a_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function l_n(i,e){const{painter:t,rasterFunction:r}=i,n=r.parameters.scaled?["scaled"]:[];return t.materialManager.getProgram(a_n,n)}function u_n(i,e,t){Xb(i,e,t),m_(e);const{bandIndexMat3:r}=i.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const c_n={createProgram:l_n,bindTextureAndUniforms:u_n},h_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function d_n(i,e){return i.painter.materialManager.getProgram(h_n,[])}function p_n(i,e,t){Xb(i,e,t),m_(e);const{noDataRanges:r,rangeMaps:n,allowUnmatched:s,clampRange:o}=i.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",r),e.setUniform1fv("u_rangeMaps",n),e.setUniform1f("u_unmatchMask",s?1:0),e.setUniform2fv("u_clampRange",o)}const f_n={createProgram:d_n,bindTextureAndUniforms:p_n},m_n={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function g_n(i,e){const{painter:t}=i,r=[],{interpolation:n,transformGrid:s}=e,o=i.rasterFunction?.parameters;return n==="cubic"?r.push("bicubic"):n==="bilinear"&&(r.push("bilinear"),o?.requireNNEdge&&r.push("nnedge")),s&&(r.push("applyProjection"),s.spacing[0]===1&&r.push("lookupProjection")),t.materialManager.getProgram(m_n,r)}function y_n(i,e,t){const{names:r,textures:n}=t.getTextures({forProcessing:!0});vX(i.context,e,r,n),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:s,height:o,source:a,transformGrid:l}=t;e.setUniform2fv("u_srcImageSize",[a.width,a.height]),e.setUniform2fv("u_targetImageSize",[s,o]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Zne),e.setUniform2fv("u_transformGridSize",l?l.size:Zne)}const v_n={createProgram:g_n,bindTextureAndUniforms:y_n},__n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function b_n(i,e){const{painter:t,rasterFunction:r}=i,{slopeType:n}=r.parameters,s=n==="percent-rise"?["percentRise"]:[];return t.materialManager.getProgram(__n,s)}function w_n(i,e,t){Xb(i,e,t),m_(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const n=t.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{zFactor:s,slopeType:o,pixelSizePower:a,pixelSizeFactor:l}=i.rasterFunction.parameters;e.setUniform1f("u_zFactor",s),e.setUniform1f("u_pixelSizePower",o==="adjusted"?a:0),e.setUniform1f("u_pixelSizeFactor",o==="adjusted"?l:0)}const x_n={createProgram:b_n,bindTextureAndUniforms:w_n},S_n={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function T_n(i,e){const{useGamma:t,bandCount:r,isOutputRounded:n}=i.rasterFunction.parameters,s=[];return t&&s.push("useGamma"),r>1&&s.push("multiBand"),n&&s.push("roundOutput"),i.painter.materialManager.getProgram(S_n,s)}function C_n(i,e,t){Xb(i,e,t),m_(e);const{width:r,height:n}=t,s=i.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,n]),e.setUniform1f("u_minOutput",s.outMin),e.setUniform1f("u_maxOutput",s.outMax),e.setUniform1fv("u_factor",s.factor),e.setUniform1fv("u_minCutOff",s.minCutOff),e.setUniform1fv("u_maxCutOff",s.maxCutOff),e.setUniform1fv("u_gamma",s.gamma),e.setUniform1fv("u_gammaCorrection",s.gammaCorrection)}const E_n={createProgram:T_n,bindTextureAndUniforms:C_n},My=new Map;function CXt(i,e){const t=new Ua;return t.width=i,t.height=e,t.internalFormat=gs.RGBA32F,t.samplingMode=Is.NEAREST,t.dataType=lc.FLOAT,t.isImmutable=!0,t.wrapMode=Ls.CLAMP_TO_EDGE,t}function I_n(i,e,t,r){const{context:n,requestRender:s,allowDelayedRender:o}=i,a=r.createProgram(i,t);return o&&s!=null&&!a.compiled?(s(),null):(n.bindFramebuffer(e),n.setViewport(0,0,e.width,e.height),n.useProgram(a),a)}function A_n(i){return My.get(i.toLowerCase())}function M_n(i,e,t,r){const n=i.rasterFunction.name.toLowerCase(),s=n==="reproject"?v_n:A_n(n);if(s==null)return;const o=I_n(i,t,r,s);if(!o)return;s.bindTextureAndUniforms(i,o,r);const{interpolation:a}=r;n==="reproject"&&(r.interpolation="nearest"),e.draw();const[l,u]=r.getRasterTextureSize(n==="reproject"),c=CXt(l,u),h=new fl(i.context,c);if(t.copyToTexture(0,0,l,u,0,0,h),n==="reproject")r.rasterTexture=h,r.projected=!0,r.interpolation=a;else{const p=i.hasBranches?i.rasterFunction.id:0;r.functionTextures[p]=h}}My.set("arithmetic",I1t),My.set("aspect",w1n),My.set("bandarithmetic",C1n),My.set("compositeband",M1n),My.set("convolution",N1n),My.set("contrastbrightness",D1n),My.set("curvature",G1n),My.set("extractband",H1n),My.set("statistics",X1n),My.set("grayscale",Q1n),My.set("local",I1t),My.set("mask",o_n),My.set("ndvi",c_n),My.set("remap",f_n),My.set("slope",x_n),My.set("stretch",E_n);let O_n=class extends Qx{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){ba(this._quad),ba(this._fbo)}prepareState(e){const{context:t,renderPass:r}=e,n=r==="raster";t.setBlendingEnabled(!n),t.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!n)}draw(e,t){if(!i1n(t)||t.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,t):void this._drawBitmap(e,t,!0);this._drawBitmap(e,t)}_process(e,t){const{rasterFunction:r}=e,n=r.name==="Reproject";if(!(n?!(t.rasterTexture&&t.projected):!t.processed))return;const{timeline:s,context:o}=e;s.begin(this.name);const a=o.getBoundFramebufferObject(),l=o.getViewport();n||(t.processedTexture=ba(t.processedTexture)),o.setStencilFunction(Wl.EQUAL,t.stencilRef,255),t.updateTexture(e),this._initQuad(o);const[u,c]=t.getRasterTextureSize(n),{isStandardRasterTileSize:h,fbo:p}=this._getRasterFBO(o,u,c);M_n(e,this._quad,p,t),h||p.dispose(),o.bindFramebuffer(a),o.setViewport(l.x,l.y,l.width,l.height),s.end(this.name)}_drawBitmap(e,t,r=!1){const{timeline:n,context:s}=e;if(n.begin(this.name),s.setStencilFunction(Wl.EQUAL,t.stencilRef,255),t.updateTexture(e),r&&!t.processedTexture){if(t.updateProcessedTexture(),!t.processedTexture)return void n.end(this.name);t.processed=!0}this._initBitmapCommonUniforms(t);const o=t.symbolizerParameters.type,a=m1n(o),{requestRender:l,allowDelayedRender:u}=e,{defines:c,program:h}=a.createProgram(e,t,t.projected&&r);if(u&&l!=null&&!h.compiled)return void l();s.useProgram(h);const p=this._getUniformInfos(o,s,h,c);this._quad||(this._quad=new JS(s,[0,0,1,0,0,1,1,1])),a.bindTextureAndUniforms(e,h,t,p,r),this._quad.draw(),n.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const t=Xvn(1,[0,0]),{transformGrid:r,width:n,height:s}=e,o=Yvn(r,[n,s],[e.source.width,e.source.height],1,!1);e.commonUniforms={...t,...o,u_coordScale:e.coordScale}}}_getRasterFBO(e,t,r){const n=t===xo&&r===xo;return n?(this._fbo||(this._fbo=this._createNewFBO(e,t,r)),{isStandardRasterTileSize:n,fbo:this._fbo}):{isStandardRasterTileSize:n,fbo:this._createNewFBO(e,t,r)}}_createNewFBO(e,t,r){const n=CXt(t,r);return new Wd(e,n)}_initQuad(e){this._quad||(this._quad=new JS(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,t,r,n){const s=n.length>0?e+"-"+n.join("-"):e;if(this._rendererUniformInfos.has(s))return this._rendererUniformInfos.get(s);const o=Zvn(t,r);return this._rendererUniformInfos.set(s,o),o}},P_n=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.bitmap=null,this.bitmap=new t1n(a,null,null),this.bitmap.coordScale=[s,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}},R_n=class extends Hle{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const t=this._getTileBounds(e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new P_n(e,s,t[0],t[3],r,n)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (tile)",brushes:[O_n],target:()=>this.children.map(r=>r.bitmap),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){if(!this.visible||e.drawPhase!==aa.MAP)return;const{rasterFunctionChain:t}=this;if(!t)return e.renderPass="raster-bitmap",void super.doRender(e);if(!t.hasFocalFunction){const[r,n]=this._tileInfoView.tileInfo.size;e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,n],requireNNEdge:t.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e)}if(t?.functions.length){const{functions:r,hasBranches:n}=t;for(let s=0;s{const t=Array.from(e),r=Date.now();for(let n=0;n=e.size)return;const t=Array.from(e);for(let r=0;rr!=null)||DR.delete(i))}function k_n(i,e,t){const r=DR.get(i);if(!r)return e==null?Ak.decreaseRefCount(i,t):0;if(e==null||r[e]==null)return Ak.decreaseRefCount(i,t);const n=r[e]?.cache,s=n?.get(t);if(n&&s){if(s.refCount--,s.refCount===0){n.delete(t);for(let o=0;oo.isResolved=!0).catch(()=>o.isRejected=!0),s[e]?.cache.set(t,o)}function L_n(i,e,t){const r=DR.get(i);r?e!=null&&r[e]!=null?r[e]?.cache.delete(t):Ak.deleteBlock(i,t):e==null&&Ak.deleteBlock(i,t)}function N_n(i,e){const t=DR.get(i);return t?t[e]??null:null}function P1t(i,e,t,r,n,s,o=null){const a=N_n(i,e);if(!a)return;const l=a.extent,{cache:u,rasterInfo:c}=a;if(l&&l.xmin===t.xmin&&l.xmax===t.xmax&&l.ymin===t.ymin&&l.ymax===t.ymax)return;r=r??0;const h=t.clone().normalize(),{spatialReference:p,transform:m}=c,v=new Set;for(let w=0;w0?$.pyramidBlockWidth:$.blockWidth,ne=L>0?$.pyramidBlockHeight:$.blockHeight,de=1,pe=Math.max(0,Math.floor(Y.x/re)-de),H=Math.max(0,Math.floor(Y.y/ne)-de),Z=Math.floor((Y.x+K-1)/re)+de,ae=Math.floor((Y.y+Q-1)/ne)+de;for(let fe=H;fe<=ae;fe++)for(let be=pe;be<=Z;be++)v.add(`${L}/${fe}/${be}`)}u.forEach((w,S)=>{if(!v.has(S)){const I=u.get(S);(I==null||I.isResolved||I.isRejected)&&u.delete(S)}}),a.extent={xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax}}const $_n=[0,0];let eb=class extends un{constructor(){super(...arguments),this._updatingHandles=new Mb,this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=[],this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._maxIndexedColormapSize=0,this._rasterFunctionState="na",this._globalUpdateRequested=!1,this.attached=!1,this.timeExtent=null,this.redrawOrRefetch=xd(async(e={})=>{const t=this._rasterFunctionState;if(e.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:n}=this;return e.refetch||n!=="raster"&&e.reprocess||r==="cpu"||t==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(e.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new Qne({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:r,scale:n}=e.state,s=this._tileInfoView.getClosestInfoForScale(n);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const o=this._srcResolutions[s.level],a=t.toJSON?t:hr.fromJSON(t);P1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId,a,r,o,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==s.level&&(this.previousLOD=s,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const e=lk();this._maxIndexedColormapSize=4*(e.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new ak(this.layerView.tileInfo,this.layerView.fullExtent);const t=this._computeFetchConcurrency();this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:t,process:(n,s)=>this._fetchTile(n,s)});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new Qne({cachePolicy:"purge",acquireTile:n=>this.acquireTile(n),releaseTile:n=>this.releaseTile(n),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,A1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[r,n]=e,s=new Br({width:r,height:n,pixels:[new Uint8Array(r*n)],mask:new Uint8Array(r*n),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=s),s}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:e,raster:t}=this.layer,r="rasterFunction"in t?t.rasterFunction.rawInputBandIds:null;return e?.length&&r?.length&&t.rasterInfo.bandCount!==1?e.map(n=>r[Math.min(n,r.length-1)]):e||r}updateRasterFunctionParameters(){}_fetchTile(e,t){const r=t!=null?t.signal:null,n=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:o}=s,a=!o.isWrappable&&q1(s.view.spatialReference)!=null,l=n&&this.layer.raster.hasUniqueSourceStorageInfo,u={allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:n?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:l,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:r,srcResolution:this._srcResolutions[e.level],timeExtent:s.timeExtent,tileInfo:o,disableWrapAround:a};return this.fetchTile(e,u)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const{layerView:e}=this,t=e.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:h}=this.layer.tileInfo,p=h.map(({scale:v})=>v),m=fu.create({spatialReference:t,size:xo,scales:p,origin:c});return e.set("tileInfo",m),void(this._srcResolutions=h.map(({resolution:v})=>({x:v,y:v})))}const{scales:r,srcResolutions:n,isCustomTilingScheme:s}=drn(this.layer.serviceRasterInfo,t,{tileSize:xo,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),o=fu.create({spatialReference:t,size:xo,scales:r}),a=o.origin.x===0,{xmin:l,ymax:u}=e.fullExtent;(a||s&&o.origin.x>l)&&(o.origin=new $i({x:l,y:u,spatialReference:t})),this._isCustomTilingScheme=s,e.set("tileInfo",o),this._srcResolutions=n??[]}_canUseLayerLODs(){const{layer:e,layerView:t}=this;if(e.raster.tileType!=="Map")return!1;const{lods:r}=e.tileInfo,n=t.view.constraints?.effectiveLODs;return n?.length===r.length&&n.every(({scale:s},o)=>Math.abs(s-r[o].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.serviceRasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){if(!this._fetchQueue.has(e.key.id)){try{const r=await this._fetchQueue.push(e.key),n=this._getBandIds();let s=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){s=!1;try{await this._redrawImage(this._abortController?.signal)}catch(l){mo(l)&&di.getLogger(this).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const o=this._tileInfoView.getTileCoords($_n,e.key),a=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:s,bandIds:n,coords:o,resolution:a}),e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e)}catch(r){mo(r)||di.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(e){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!r?.pixelBlock)return;const{resolution:n}=this.previousLOD,s=this._getBandIds(),o=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(s),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:n,y:n},bandIds:s});!this.canUseWebGLForProcessing()&&o&&o.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(o.factor=o.factor.map(a=>255*a),o.outMin=Math.round(255*o.outMin),o.outMax=Math.round(255*o.outMax)),this._globalSymbolizerParams=o}_updateSymbolizerParams(){const{resolution:e}=this.previousLOD,t=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:t})}_updateBlockCacheRegistry(e=!1){const{layer:t,layerView:r}=this,{raster:n}=t,{multidimensionalDefinition:s}=t.normalizeRasterFetchOptions({multidimensionalDefinition:t.multidimensionalDefinition,timeExtent:r.timeExtent}),o=n.rasterInfo.multidimensionalInfo?n.getSliceIndex(s):null,a=L7e(n.rasterId,o);if(a!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&A1t(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=F_n(a,n.rasterInfo),e){const{view:l}=r,u=this._tileInfoView.getClosestInfoForScale(l.scale),c=this._srcResolutions[u.level];P1t(a,this._blockCacheRegistryId,l.extent,l.resolution,c,n.ioConfig.sampling)}this._blockCacheRegistryUrl=a}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(t=>e.push(this._enqueueTileFetch(t))),await this._updatingHandles.addPromise(Promise.allSettled(e))}};x([D()],eb.prototype,"_globalUpdateRequested",void 0),x([D()],eb.prototype,"attached",void 0),x([D()],eb.prototype,"container",void 0),x([D()],eb.prototype,"layer",void 0),x([D()],eb.prototype,"layerView",void 0),x([D()],eb.prototype,"type",void 0),x([D()],eb.prototype,"useWebGLForProcessing",null),x([D()],eb.prototype,"useProgressiveUpdate",null),x([D()],eb.prototype,"timeExtent",void 0),x([D()],eb.prototype,"updating",null),eb=x([Qe("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],eb);let iz=class extends eb{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new R_n(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:e}=this.layer,t=e.lookup?.colormapLut?.indexedColormap,r=t&&t.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&e.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&jqt(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{clips:e,view:t}=this.layerView;this._geometry!=null&&e.remove(this._geometry);const{raster:r,type:n}=this.layer;if(r.datasetFormat==="Function"){const v=r.getClippingGeometry(t.spatialReference);if(v){const w=new rXt({geometry:v});e.add(w),this._geometry=w}}const{container:s}=this;if(r.datasetFormat!=="Function"||n==="wcs")return s.rasterFunctionChain=null,s.children.forEach(v=>{const{bitmap:w}=v;w&&(w.suspended=!0,w.processed=!1,w.projected&&(w.invalidateTexture(),w.rasterTexture=null))}),void(this._rasterFunctionState="na");const o=this._rasterFunctionState,{rasterFunction:a,primaryRasters:l}=r,u=a.supportsGPU&&(!l||l.rasters.length<=1),c=u?a.flatWebGLFunctionChain:null,{renderer:h}=this.layer,p=!u||!c?.functions.length||h?.type==="raster-stretch"&&h.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();s.rasterFunctionChain=p?null:c;const m=a==null?"na":s.rasterFunctionChain?"gpu":"cpu";s.children.forEach(v=>{const{bitmap:w}=v;w&&(w.suspended=o!==m,w.processed=!1,w.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(e,t){const r=this._getBandIds(),n=this._getLayerInterpolation(),s=this.canUseWebGLForProcessing(),{source:o,globalSymbolizerParams:a,suspended:l,coords:u,resolution:c}=t,h=this.layerView.hasTilingEffects?a:t.symbolizerParams,{bitmap:p}=e;if([p.x,p.y]=u,p.resolution=c,o?.pixelBlock!=null){const m={extent:o.extent,pixelBlock:o.pixelBlock,srcPixelSize:o.srcTilePixelSize};if(p.rawPixelData=m,s)p.source=o.pixelBlock,p.isRendereredSource=!1;else{const v=await this.layer.applyRenderer(m,a?.type==="stretch"?a:void 0);p.source=v,p.isRendereredSource=!0}p.symbolizerParameters=s?h:null,p.transformGrid=s?o.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();p.source=m,p.symbolizerParameters=s?h:null,p.transformGrid=null}p.bandIds=s?r:null,p.width=this._tileInfoView.tileInfo.size[0],p.height=this._tileInfoView.tileInfo.size[1],p.interpolation=n,p.suspended=l,p.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:n}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:u}=l;a||u==null?(l.isRendereredSource&&u!=null&&(l.source=u.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(u,n?.type==="stretch"?n:void 0),l.isRendereredSource=!0),l.symbolizerParameters=a?this.layerView.hasTilingEffects?n:r:null,l.bandIds=a?s:null,l.interpolation=o,l.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return r==="raster-colormap"||r==="unique-value"||r==="class-breaks"?"nearest":t.type==="raster-stretch"&&t.colorRamp!=null?e==="bilinear"||e==="cubic"?"bilinear":"nearest":e}};x([D()],iz.prototype,"container",void 0),x([D()],iz.prototype,"layer",void 0),x([D()],iz.prototype,"type",void 0),iz=x([Qe("esri.views.2d.layers.imagery.ImageryTileView2D")],iz);const B_n=iz;let j_n=class extends gX{constructor(e,t,r,n,s,o,a=null){super(e,t,r,n,s,o),this.tileData=new wXt(a),this.tileData.coordScale=[s,o],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[n,s]=this.tileData.offset,o=[this.x+n*this.resolution,this.y-s*this.resolution],[a,l]=e.toScreenNoRotation([0,0],o),{symbolTileSize:u}=this.tileData.symbolizerParameters,c=Math.round((this.width-this.tileData.offset[0])/u)*u,h=Math.round((this.height-this.tileData.offset[1])/u)*u,p=c/this.rangeX*t,m=h/this.rangeY*t;pB(r,p,0,0,0,m,0,a,l,1),n_(this.transforms.displayViewScreenMat3,e.displayViewMat3,r),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}},G_n=class extends Hle{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),[r,n]=this._tileInfoView.tileInfo.size,s=this._tileInfoView.getTileResolution(e.level);return new j_n(e,s,t[0],t[3],r,n)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf tile)",brushes:[bXt],target:()=>this.children.map(r=>r.tileData),drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===aa.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}},rz=class extends eb{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(e.level,e.row,e.col,t);return this.layer.serviceRasterInfo.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,t)),r}updateTileSource(e,t){const r=t.symbolizerParams,{tileData:n}=e;n.key=e.key,n.width=this._tileInfoView.tileInfo.size[0],n.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:s}=r,{source:o}=t;if(n.offset=this._getTileSymbolOffset(n.key,s),o?.pixelBlock!=null){const a={extent:o.extent,pixelBlock:o.pixelBlock};n.rawPixelData=a,n.symbolizerParameters=r,n.source=this._sampleVectorFieldData(o.pixelBlock,r,n.offset)}else{const a=[Math.round((this._tileInfoView.tileInfo.size[0]-n.offset[0])/s),Math.round((this._tileInfoView.tileInfo.size[1]-n.offset[1])/s)],l=this.createEmptyTilePixelBlock(a);n.source=l,n.symbolizerParameters=r}return n.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(e,t){const r=t.local,{symbolTileSize:n}=r,{tileData:s}=e;s.offset=this._getTileSymbolOffset(s.key,n);const o=s.symbolizerParameters.symbolTileSize;s.symbolizerParameters=r;const a=s.rawPixelData?.pixelBlock;return a!=null&&o!==n&&(s.source=this._sampleVectorFieldData(a,s.symbolizerParameters,s.offset)),Promise.resolve()}attach(){super.attach(),this.container=new G_n(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=Ki(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(e,t){const r=e.col*this._tileInfoView.tileInfo.size[0]%t,n=e.row*this._tileInfoView.tileInfo.size[1]%t;return[r>t/2?t-r:-r,n>t/2?t-n:-n]}_sampleVectorFieldData(e,t,r){const{symbolTileSize:n}=t;return Clr(e,"vector-uv",n,r)}_updateSymbolType(e){e.type==="vector-field"&&(this.container.symbolTypes=e.style==="wind-barb"?["scalar","triangle"]:e.style==="simple-scalar"?["scalar"]:["triangle"])}};x([D()],rz.prototype,"container",void 0),x([D()],rz.prototype,"layer",void 0),x([D()],rz.prototype,"type",void 0),rz=x([Qe("esri.views.2d.layers.imagery.VectorFieldTileView2D")],rz);const U_n=rz,z_n=i=>{let e=class extends i{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return CBe(this.layer.serviceRasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return GVt(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!CBe(this.layer.serviceRasterInfo,t)}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n,o=kF(n,r);if(!s||o==null)throw new qe("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:s,popupTemplate:o});const a=[],{value:l,magdirValue:u,processedValue:c}=await n.identify(t,{timeExtent:this.timeExtent,signal:r?.signal});let h="";if(l&&l.length){h=n.type==="imagery-tile"&&n.hasStandardTime()&&l[0]!=null?l.map(I=>n.getStandardTimeValue(I)).join(", "):l.join(", ");const p={ObjectId:0},m="Raster.ServicePixelValue";p[m]=n.type==="imagery-tile"&&n.raster.datasetFormat==="Function"?c?.join(", "):h,p[m+".Raw"]=h;const v=n.serviceRasterInfo.attributeTable;if(v!=null){const{fields:I,features:R}=v,L=I.find(({name:B})=>B.toLowerCase()==="value"),k=L?R.find(B=>String(B.attributes[L.name])===h):null;if(k)for(const B in k.attributes)k.attributes.hasOwnProperty(B)&&(p[this._rasterFieldPrefix+B]=k.attributes[B])}const w=n.serviceRasterInfo.dataType;w!=="vector-magdir"&&w!=="vector-uv"||(p["Raster.Magnitude"]=u?.[0],p["Raster.Direction"]=u?.[1]);const S=new Us(this.fullExtent.clone(),null,p);S.layer=n,S.sourceLayer=S.layer,a.push(S)}return a}};return x([D()],e.prototype,"layer",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),x([D()],e.prototype,"view",void 0),x([D()],e.prototype,"fullExtent",null),x([D()],e.prototype,"tileInfo",void 0),x([D({readOnly:!0})],e.prototype,"hasTilingEffects",null),x([D()],e.prototype,"datumTransformation",null),e=x([Qe("esri.views.layers.ImageryTileLayerView")],e),e};let e6=class extends z_n(hL(Lm(Nm))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,t=this._get("displayParameters");return e.renderer?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}:t}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([Ki(()=>this.displayParameters,(e,t)=>{const r=e.interpolation!==t?.interpolation&&(e.interpolation==="majority"||t?.interpolation==="majority")&&jqt(this.layer),n=e.renderer!==t?.renderer&&this._getSubviewType(t?.renderer)!==this._getSubviewType(e.renderer);n&&this._updateSubview();const s=e.multidimensionalDefinition!==t?.multidimensionalDefinition,o=e.rasterFunction!==t?.rasterFunction,a=o&&!this._useWebGLForProcessing,l=s||r||n||a;this.subview.redrawOrRefetch({refetch:l,reprocess:o}).catch(u=>{mo(u)||di.getLogger(this).error(u)}),this.notifyChange("updating")}),Ki(()=>this.layer.multidimensionalSubset??null,(e,t)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Wne(r,e)!==Wne(r,t)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(n=>{mo(n)||di.getLogger(this).error(n)}),this.notifyChange("updating"))},Kl),Ki(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{mo(e)||di.getLogger(this).error(e)})},js)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const t=this._getSubviewType(e);if(this.subview){if(this.subview.type===t)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let n;if(n=t==="rasterVF"?new U_n({layer:r,layerView:this}):t==="flow"?new _Xt({layer:r,layerView:this}):new B_n({layer:r,layerView:this}),"useWebGLForProcessing"in n&&(n.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in n&&(n.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in n){const{subview:s}=this;n.previousLOD=s&&"previousLOD"in s?s.previousLOD:null}this._attachSubview(n),this.subview=n,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const t=e?.type;return t==="vector-field"?"rasterVF":t==="flow"?"flow":"raster"}};x([D()],e6.prototype,"subview",void 0),x([D()],e6.prototype,"useWebGLForProcessing",null),x([D()],e6.prototype,"useProgressiveUpdate",null),x([D({readOnly:!0})],e6.prototype,"displayParameters",null),e6=x([Qe("esri.views.2d.layers.ImageryTileLayerView2D")],e6);const V_n=e6,R1t=Object.freeze(Object.defineProperty({__proto__:null,default:V_n},Symbol.toStringTag,{value:"Module"})),H_n={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function eZe(i){const e=i.folders||[],t=e.slice(),r=new Map,n=new Map,s=new Map,o=new Map,a=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:s,esriGeometryPolygon:o};(i.featureCollection?.layers||[]).forEach(c=>{const h=li(c);h.featureSet.features=[];const p=c.featureSet.geometryType;r.set(p,h);const m=c.layerDefinition.objectIdField;p==="esriGeometryPoint"?mRe(n,m,c.featureSet.features):p==="esriGeometryPolyline"?mRe(s,m,c.featureSet.features):p==="esriGeometryPolygon"&&mRe(o,m,c.featureSet.features)}),i.groundOverlays&&i.groundOverlays.forEach(c=>{a.set(c.id,c)}),e.forEach(c=>{c.networkLinkIds.forEach(h=>{const p=q_n(h,c.id,i.networkLinks);p&&t.push(p)})}),t.forEach(c=>{if(c.featureInfos){c.points=li(r.get("esriGeometryPoint")),c.polylines=li(r.get("esriGeometryPolyline")),c.polygons=li(r.get("esriGeometryPolygon")),c.mapImages=[];for(const h of c.featureInfos)switch(h.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const p=l[h.type].get(h.id);p&&c[H_n[h.type]]?.featureSet.features.push(p);break}case"GroundOverlay":{const p=a.get(h.id);p&&c.mapImages.push(p);break}}c.fullExtent=N7e([c])}});const u=N7e(t);return{folders:e,sublayers:t,extent:u}}function tZe(i,e,t,r){const n=no?.findCredential(i);i=gg(i,{token:n?.token});const s=Ho.kmlServiceUrl;return zi(s,{query:{url:i,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(e)},responseType:"json",signal:r})}function EXt(i,e,t=null,r=[]){const n=[],s={},o=e.sublayers,a=new Set(e.folders.map(l=>l.id));return o.forEach(l=>{const u=new i;if(t?u.read(l,t):u.read(l),r.length&&a.has(u.id)&&(u.visible=r.includes(u.id)),s[l.id]=u,l.parentFolderId!=null&&l.parentFolderId!==-1){const c=s[l.parentFolderId];c.sublayers||(c.sublayers=[]),c.sublayers?.unshift(u)}else n.unshift(u)}),n}function mRe(i,e,t){t.forEach(r=>{i.set(r.attributes[e],r)})}function W_n(i,e){let t;return e.some(r=>r.id===i&&(t=r,!0)),t}function q_n(i,e,t){const r=W_n(i,t);return r&&(r.parentFolderId=e,r.networkLink=r),r}async function gRe(i){const e=du.fromJSON(i.featureSet).features,t=i.layerDefinition,r=YC(t.drawingInfo.renderer),n=qc.fromJSON(i.popupInfo),s=[];for(const o of e){const a=await r.getSymbolAsync(o);o.symbol=a,o.popupTemplate=n,o.visible=!0,s.push(o)}return s}function N7e(i){const e=Dx($V),t=Dx($V);for(const r of i){if(r.polygons?.featureSet?.features)for(const n of r.polygons.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.polylines?.featureSet?.features)for(const n of r.polylines.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.points?.featureSet?.features)for(const n of r.points.featureSet.features)jce(e,n.geometry),sQ(t,e);if(r.mapImages)for(const n of r.mapImages)jce(e,n.extent),sQ(t,e)}return WQi(t,$V)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:Xi.WGS84}}let IXt=class SO{constructor(e){if(this._ownsRctx=!1,e)this._ownsRctx=!1,this._rctx=e;else{if(SO._instance)return SO._instanceRefCount++,SO._instance;SO._instanceRefCount=1,SO._instance=this,this._ownsRctx=!0;const n=document.createElement("canvas"),s=BW(n);s.getExtension("OES_texture_float"),this._rctx=new RYt(s,{})}const t={applyProjection:!0,bilinear:!1,bicubic:!1},r=rYt("raster/reproject","raster/reproject",new Map([["a_position",0]]),t);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new JS(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(e,t,r=!1){const n=Wc(e.extent,t),s=new $i({x:(e.extent.xmax-e.extent.xmin)/e.texture.descriptor.width,y:(e.extent.ymax-e.extent.ymin)/e.texture.descriptor.height,spatialReference:e.extent.spatialReference}),{x:o,y:a}=aoe(s,t,e.extent);let l=(o+a)/2;const u=Math.round((n.xmax-n.xmin)/l),c=Math.round((n.ymax-n.ymin)/l);l=(n.width/u+n.height/c)/2;const h=new $i({x:l,y:l,spatialReference:n.spatialReference}),p=uKe({projectedExtent:n,srcBufferExtent:e.extent,pixelSize:h,hasWrapAround:!0,spacing:[16,16]}),m=xXt(this._rctx,p),v=new Ua(u,c);v.wrapMode=Ls.CLAMP_TO_EDGE;const w=new Wd(this._rctx,v);this._rctx.bindFramebuffer(w),this._rctx.setViewport(0,0,u,c),this._rctx.useProgram(this._program),this._rctx.bindTexture(e.texture,0),this._rctx.bindTexture(m,1),this._quad.bind();const{width:S=0,height:I=0}=e.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",S,I),this._program.setUniform2fv("u_transformSpacing",p.spacing),this._program.setUniform2fv("u_transformGridSize",p.size),this._program.setUniform2f("u_targetImageSize",u,c),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),m.dispose(),r){const{width:L,height:k}=w,B=new ImageData(L??0,k??0);w.readPixels(0,0,L??0,k??0,ks.RGBA,lc.UNSIGNED_BYTE,B.data);const $=w.detachColorTexture(pv.COLOR_ATTACHMENT0);return w.dispose(),{texture:$,extent:n,imageData:B}}const R=w.detachColorTexture(pv.COLOR_ATTACHMENT0);return w.dispose(),{texture:R,extent:n}}reprojectBitmapData(e,t){const r=eXt(e.bitmapData)?tXt(e.bitmapData):e.bitmapData,n=new Ua;n.wrapMode=Ls.CLAMP_TO_EDGE,n.width=e.bitmapData.width,n.height=e.bitmapData.height;const s=new fl(this._rctx,n,r),o=this.reprojectTexture({texture:s,extent:e.extent},t,!0);o.texture.dispose();const a=document.createElement("canvas"),l=o.imageData;return a.width=l.width,a.height=l.height,a.getContext("2d").putImageData(l,0,0),{bitmapData:a,extent:o.extent}}async loadAndReprojectBitmapData(e,t,r){const n=(await zi(e,{responseType:"image"})).data,s=document.createElement("canvas");s.width=n.width,s.height=n.height;const o=s.getContext("2d");o.drawImage(n,0,0);const a=o.getImageData(0,0,s.width,s.height);if(t.spatialReference.equals(r))return{bitmapData:a,extent:t};const l=this.reprojectBitmapData({bitmapData:a,extent:t},r);return{bitmapData:l.bitmapData,extent:l.extent}}destroy(){this._ownsRctx?(SO._instanceRefCount--,SO._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),SO._instance=null)):(this._quad.dispose(),this._program.dispose())}};IXt._instanceRefCount=0;let D1t=class{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}},t6=class extends Lm(Nm){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new Bq,this._kmlVisualData=new D1t,this._fetchController=null,this.allVisiblePoints=new bx,this.allVisiblePolylines=new bx,this.allVisiblePolygons=new bx,this.allVisibleMapImages=new dr}async hitTest(e,t){const r=this.layer;return[this._pointsView?.hitTest(e),this._polylinesView?.hitTest(e),this._polygonsView?.hitTest(e)].flat().filter(Boolean).map(n=>(n.layer=r,n.sourceLayer=r,{type:"graphic",graphic:n,layer:r,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new Tx({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new Tx({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new Tx({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),Ki(()=>this.layer.visibleSublayers,e=>{for(const[t,r]of this._kmlVisualData.allSublayers)r.visibility=0;for(const t of e){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new IXt}detach(){this._fetchController=zF(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=zo(this._polygonsView),this._polylinesView=zo(this._polylinesView),this._pointsView=zo(this._pointsView),this._imageReprojector=zo(this._imageReprojector)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,hr.fromJSON(e.extent),this.view.spatialReference).then(t=>{const r=new HKe(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=e.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(e,r)})}async _getViewDependentUrl(e,t){const{viewFormat:r,viewBoundScale:n,httpQuery:s}=e;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let o;if(await FS(),n!=null&&n!==1){const k=new hr(t.extent);k.expand(n),o=k}else o=t.extent;o=Wc(o,Xi.WGS84);const a=Wc(o,Xi.WebMercator),l=o.xmin,u=o.xmax,c=o.ymin,h=o.ymax,p=t.size[0]*t.pixelRatio,m=t.size[1]*t.pixelRatio,v=Math.max(a.width,a.height),w={"[bboxWest]":l.toString(),"[bboxEast]":u.toString(),"[bboxSouth]":c.toString(),"[bboxNorth]":h.toString(),"[lookatLon]":o.center.x.toString(),"[lookatLat]":o.center.y.toString(),"[lookatRange]":v.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":o.center.x.toString(),"[lookatTerrainLat]":o.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":o.center.x.toString(),"[cameraLat]":o.center.y.toString(),"[cameraAlt]":v.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":p.toString(),"[vertPixels]":m.toString(),"[terrainEnabled]":"0","[clientVersion]":tae,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},S=k=>{for(const B in k){let $;for($ in w)k[B]=k[B].replace($,w[$])}},I=mP(r);S(I);let R={};s!=null&&(R=mP(s),S(R));const L=gu(e.href);return L.query={...L.query,...I,...R},`${L.path}?${Lb(I)}`}return e.href}async _fetchService(e){const t=new D1t;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,r){return this._fetchParsedKML(e,r).then(async n=>{for(const s of n.sublayers){t.allSublayers.set(s.id,s);const o=s.points?await gRe(s.points):[],a=s.polylines?await gRe(s.polylines):[],l=s.polygons?await gRe(s.polygons):[],u=s.mapImages||[];if(t.allPoints.push(...o.map(c=>({item:c,sublayerId:s.id}))),t.allPolylines.push(...a.map(c=>({item:c,sublayerId:s.id}))),t.allPolygons.push(...l.map(c=>({item:c,sublayerId:s.id}))),t.allMapImages.push(...u.map(c=>({item:c,sublayerId:s.id}))),s.networkLink){const c=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(c,t,r)}}})}_fetchParsedKML(e,t){return tZe(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>eZe(r.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};x([D()],t6.prototype,"_pointsView",void 0),x([D()],t6.prototype,"_polylinesView",void 0),x([D()],t6.prototype,"_polygonsView",void 0),x([D()],t6.prototype,"updating",void 0),t6=x([Qe("esri.views.2d.layers.KMLLayerView2D")],t6);const Y_n=t6,X_n=Object.freeze(Object.defineProperty({__proto__:null,default:Y_n},Symbol.toStringTag,{value:"Module"}));let wte=class extends Lm(Nm){constructor(e){super(e),this.layerViews=new dr}set layerViews(e){this._set("layerViews",ay(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,t)=>e+t.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};x([D({cast:fY})],wte.prototype,"layerViews",null),x([D({readOnly:!0})],wte.prototype,"updatingProgress",null),wte=x([Qe("esri.views.2d.layers.KnowledgeGraphLayerView2D")],wte);const J_n=wte,F1t=Object.freeze(Object.defineProperty({__proto__:null,default:J_n},Symbol.toStringTag,{value:"Module"})),K_n=i=>{let e=class extends i{initialize(){this.exportImageParameters=new Z_({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return x([D()],e.prototype,"exportImageParameters",void 0),x([D({readOnly:!0})],e.prototype,"floors",null),x([D({readOnly:!0})],e.prototype,"exportImageVersion",null),x([D()],e.prototype,"layer",void 0),x([D()],e.prototype,"suspended",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),e=x([Qe("esri.views.layers.MapImageLayerView")],e),e};let xte=class extends K_n(hL(Lm(Nm))){constructor(){super(...arguments),this._highlightGraphics=new bx,this._updateHash=""}fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,t)}update(e){const t=`${this.exportImageVersion}/${e.state.id}/${e.pixelRatio}/${e.stationary}`;this._updateHash!==t&&(this._updateHash=t,this.strategy.update(e).catch(r=>{mo(r)||di.getLogger(this).error(r)}),e.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(e.state.resolution)),this._highlightView.processUpdate(e)}attach(){const{imageMaxWidth:e,imageMaxHeight:t,version:r}=this.layer,n=r>=10.3,s=r>=10;this._bitmapContainer=new Bq,this.container.addChild(this._bitmapContainer),this._highlightView=new Tx({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new qKe(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new XO({createFetchPopupFeaturesQueryGeometry:(o,a)=>sXt(o,a,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(o,a)=>{this._highlightView.graphicUpdateHandler({graphic:o,property:a})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new KCe({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:e,imageMaxHeight:t,imageRotationSupported:n,imageNormalizationSupported:s,hidpi:!0}),this.addAttachHandles(Ki(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,n){return this.layer.fetchImage(e,t,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}fetchImageBitmap(e,t,r,n){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,floors:this.floors,...n})}highlight(e){return this._popupHighlightHelper.highlight(e)}};x([D()],xte.prototype,"strategy",void 0),x([D()],xte.prototype,"updating",void 0),xte=x([Qe("esri.views.2d.layers.MapImageLayerView2D")],xte);const Z_n=xte,Q_n=Object.freeze(Object.defineProperty({__proto__:null,default:Z_n},Symbol.toStringTag,{value:"Module"})),k1t="sublayers",yRe="layerView";let $7e=class extends Lm(Nm){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(e,t){return Array.from(this.graphicsViews(),r=>{const n=r.hitTest(e);if(this._graphicsViewsFeatureCollectionMap!=null){const s=this._graphicsViewsFeatureCollectionMap.get(r);for(const o of n)!o.popupTemplate&&s.popupTemplate&&(o.popupTemplate=s.popupTemplate),o.sourceLayer=o.layer=this.layer}return n}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:e}))}highlight(e){let t;typeof e=="number"?t=[e]:e instanceof Us?t=[e.uid]:Array.isArray(e)&&e.length>0?t=typeof e[0]=="number"?e:e.map(n=>n&&n.uid):dr.isCollection(e)&&(t=e.map(n=>n&&n.uid).toArray());const r=t?.filter(Ga);return r?.length?(this._addHighlight(r),wa(()=>this._removeHighlight(r))):wa()}update(e){for(const t of this.graphicsViews())t.processUpdate(e)}attach(){const e=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const n of r){const s=new QA(this.view.featuresTilingScheme),o=new Tx({view:e,graphics:n.source,renderer:n.renderer,requestUpdateCallback:t,container:s});this._graphicsViewsFeatureCollectionMap.set(o,n),this.container.addChild(o.container),this.addHandles([Ki(()=>n.visible,a=>o.container.visible=a,js),Ki(()=>o.updating,()=>this.notifyChange("updating"),js)],yRe)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(ju(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),k1t)}detach(){this._destroyGraphicsViews(),this.removeHandles(k1t)}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews())e.viewChange()}isUpdating(){for(const e of this.graphicsViews())if(e.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(yRe);for(const e of this.graphicsViews())e.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const e=[],t=this.view,r=()=>this.requestUpdate();for(const n of this.layer.sublayers){const s=new QA(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const o=new Tx({view:t,graphics:n.graphics,requestUpdateCallback:r,container:s});this.addHandles([n.on("graphic-update",o.graphicUpdateHandler),Ki(()=>n.visible,a=>o.container.visible=a,js),Ki(()=>o.updating,()=>this.notifyChange("updating"),js)],yRe),this.container.addChild(o.container),e.push(o)}this._graphicsViews=e,this._updateHighlight()}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const e=Array.from(this._highlightIds.keys()),t=SCe("highlight");for(const r of this.graphicsViews())r.setHighlight(e.map(n=>({objectId:n,highlightFlags:t})))}};$7e=x([Qe("esri.views.2d.layers.MapNotesLayerView2D")],$7e);const ebn=$7e,tbn=Object.freeze(Object.defineProperty({__proto__:null,default:ebn},Symbol.toStringTag,{value:"Module"}));let pC=class extends un{constructor(e){super(e)}get bounds(){const e=this.coords;return e?.extent==null?null:tB(e.extent)}get coords(){const e=this.element.georeference?.coords;return kx(e,this.spatialReference).geometry}get normalizedCoords(){return $s.fromJSON(Cgn(this.coords))}get normalizedBounds(){const e=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return e!=null?tB(e):null}};x([D()],pC.prototype,"spatialReference",void 0),x([D()],pC.prototype,"element",void 0),x([D()],pC.prototype,"bounds",null),x([D()],pC.prototype,"coords",null),x([D()],pC.prototype,"normalizedCoords",null),x([D()],pC.prototype,"normalizedBounds",null),pC=x([Qe("esri.layers.support.MediaElementView")],pC);const Uw=gr(),nz=Yd(),vRe=Yd(),L1t=Yd();function CP(i,e,t){return Zo(Uw,e[0],e[1],1),c3(Uw,Uw,ese(nz,t)),Uw[2]===0?dl(i,Uw[0],Uw[1]):dl(i,Uw[0]/Uw[2],Uw[1]/Uw[2])}function iZe(i,e,t){return N1t(vRe,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),N1t(L1t,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),n_(i,vWe(vRe,vRe),L1t),i[8]!==0&&(i[0]/=i[8],i[1]/=i[8],i[2]/=i[8],i[3]/=i[8],i[4]/=i[8],i[5]/=i[8],i[6]/=i[8],i[7]/=i[8],i[8]/=i[8]),i}function N1t(i,e,t,r,n,s,o,a,l){pB(i,e,r,s,t,n,o,1,1,1),Zo(Uw,a,l,1),vWe(nz,i);const[u,c,h]=c3(Uw,Uw,ese(nz,nz));return pB(nz,u,0,0,0,c,0,0,0,h),n_(i,nz,i)}const jK=Yd(),ibn={none:pb.None,loop:pb.Loop,oscillate:pb.Oscillate};function rbn(i){return i?{...i,playAnimation:i.playing,repeatType:i.repeatType?ibn[i.repeatType]:void 0}:{}}let nbn=class extends eM{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=Ja(),this._playHandle=null,this._vertices=new Float32Array(20),this._handles=[],this._handles.push(Ki(()=>this.elementView.element.opacity,t=>this.opacity=t,js),Ki(()=>[this.elementView.coords],()=>{this.requestRender()},js),Ki(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._playHandle?.remove(),this.texture=ba(this.texture),this.requestRender()},js),v0(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&this._handles.push(BA(t.content,"play",()=>this.requestRender()))},js)),e.element.load().catch(t=>{di.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new qe("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._playHandle?.remove(),this._handles.forEach(e=>e.remove()),this.texture=ba(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(r!=null){const n=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,o=n?r.naturalWidth:s?r.videoWidth:r.width,a=n?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(o,a),this.texture)s&&!r.paused&&(this.texture.setData(r),this.requestRender(),this.texture.generateMipmap());else{const l=new Ua;if(l.wrapMode=Ls.CLAMP_TO_EDGE,l.preMultiplyAlpha=!0,l.width=o,l.height=a,"getFrame"in r){const u=c=>{this.texture?this.texture.setData(c):this.texture=new fl(t,l,c),this.requestRender()};"animationOptions"in this.elementView.element&&(this._playHandle=aYt(r,rbn(this.elementView.element.animationOptions),null,u))}else this.texture=new fl(t,l,r);this.texture.generateMipmap(),s&&!r.paused&&this.requestRender()}}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(r==null)return;const[n,s,o,a]=r.rings[0],l=this._vertices,{x:u,y:c}=e,h=t!==0;h?l.set([s[0]-u,s[1]-c,n[0]-u,n[1]-c,o[0]-u,o[1]-c,a[0]-u,a[1]-c,a[0]-u,a[1]-c,s[0]+t-u,s[1]-c,s[0]+t-u,s[1]-c,n[0]+t-u,n[1]-c,o[0]+t-u,o[1]-c,a[0]+t-u,a[1]-c]):l.set([s[0]-u,s[1]-c,n[0]-u,n[1]-c,o[0]-u,o[1]-c,a[0]-u,a[1]-c]),this.isWrapAround=h}getVAO(e,t,r){if(this.elementView.coords==null)return null;const n=this._vertices;if(this._vao)this._geometryVbo.setData(n);else{this._geometryVbo=Aa.createVertex(e,oa.DYNAMIC_DRAW,n);const s=Aa.createVertex(e,oa.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new wh(e,r,t,{geometry:this._geometryVbo,tex:s})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;iZe(jK,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),dl(this.perspectiveTransform,jK[6]/jK[8]*e,jK[7]/jK[8]*t)}},sbn=class extends Vle{constructor(){super(...arguments),this._localOrigin=Vd(0,0),this._viewStateId=-1,this._dvsMat3=Cc()}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Lq.overlay],target:()=>this.children,drawPhase:aa.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:r,size:n,pixelRatio:s,resolution:o,rotation:a,viewpoint:l,displayMat3:u}=t;if(this._viewStateId===r)return;const c=Math.PI/180*a,h=s*n[0],p=s*n[1],{x:m,y:v}=l.targetGeometry,w=cHe(m,t.spatialReference);this._localOrigin.x=w,this._localOrigin.y=v;const S=o*h,I=o*p,R=Jk(this._dvsMat3);n_(R,R,u),h0(R,R,Xp(h/2,p/2)),_R(R,R,m7(h/S,-p/I,1)),q3(R,R,-c),this._viewStateId=r}_updateOverlays(e,t){const{state:r}=e,{rotation:n,spatialReference:s,worldScreenWidth:o,size:a,viewpoint:l}=r,u=this._localOrigin;let c=0;const h=Zp(s);if(h&&s.isWrappable){const p=a[0],m=a[1],v=180/Math.PI*n,w=Math.abs(Math.cos(v)),S=Math.abs(Math.sin(v)),I=Math.round(p*w+m*S),[R,L]=h.valid,k=gWe(s),{x:B,y:$}=l.targetGeometry,V=[B,$],Y=[0,0];r.toScreen(Y,V);const K=[0,0];let Q;Q=I>o?.5*o:.5*I;const re=Math.floor((B+.5*k)/k),ne=R+re*k,de=L+re*k,pe=[Y[0]+Q,0];r.toMap(K,pe),K[0]>de&&(c=k),pe[0]=Y[0]-Q,r.toMap(K,pe),K[0]R?H.updateDrawCoords(u,k):fe>L&&aethis.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),ju(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new sbn,this.container.addChild(this._overlayContainer),this._fetchQueue=new LW({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t)}),this._tileStrategy=new Qne({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const r=[],n=e.normalize(),s=[n.x,n.y];for(const{projectedElement:{normalizedCoords:o,element:a}}of this._elementReferences.values())o!=null&&yze(o.rings,s)&&r.push({type:"media",element:a,layer:this.layer,mapPoint:e,sourcePoint:a.toSource(e)});return r.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new obn(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[r,n]=e.setElements(t);this._referenceElements(e,r),this._dereferenceElements(e,n),this.requestUpdate()},t=>{mo(t)||di.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const r=this.layer.effectiveSource;if(r==null)return[];this.view.featuresTilingScheme.getTileBounds(SA,e,!0);const n=new hr({xmin:SA[0],ymin:SA[1],xmax:SA[2],ymax:SA[3],spatialReference:this.view.spatialReference});return r.queryElements(n,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const r of t)this._referenceElement(e,r)}_referenceElement(e,t){qh(this._elementReferences,t.uid,()=>{const r=new pC({element:t,spatialReference:this.view.spatialReference}),n=new nbn(r);return this._overlayContainer.addChild(n),this.elements.add(t),{tiles:new Set,projectedElement:r,overlay:n,debugGraphic:null}}).tiles.add(e)}_dereferenceElements(e,t){for(const r of t)this._dereferenceElement(e,r)}_dereferenceElement(e,t){const r=this._elementReferences.get(t.uid);r.tiles.delete(e),r.tiles.size||(this._overlayContainer.removeChild(r.overlay),r.overlay.destroy(),r.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(r.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const n=t.projectedElement.normalizedCoords;if(n==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],o=[];for(const a of this._tileStrategy.tiles){const l=$1t(this.view.featuresTilingScheme,a,n);t.tiles.has(a)?l||o.push(a):l&&s.push(a)}for(const a of s)this._referenceElement(a,e);for(const a of o)this._dereferenceElement(a,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const r=new pC({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(r!=null)for(const n of this._tileStrategy.tiles)$1t(this.view.featuresTilingScheme,n,r)&&this._referenceElement(n,e)}};x([D()],Ste.prototype,"layer",void 0),x([D({readOnly:!0})],Ste.prototype,"elements",void 0),Ste=x([Qe("esri.views.2d.layers.MediaLayerView2D")],Ste);const SA=Wo(),GK={xmin:0,ymin:0,xmax:0,ymax:0};function $1t(i,e,t){return i.getTileBounds(SA,e.key,!0),GK.xmin=SA[0],GK.ymin=SA[1],GK.xmax=SA[2],GK.ymax=SA[3],vze(GK,t)}let obn=class{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const n of e)r.has(n)?r.delete(n):t.push(n);return this.isReady=!0,[t,Array.from(r)]}destroy(){}};const abn=Ste,lbn=Object.freeze(Object.defineProperty({__proto__:null,default:abn},Symbol.toStringTag,{value:"Module"})),ubn=i=>{let e=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(t=>t.name)}};return x([D()],e.prototype,"layer",void 0),x([D({readOnly:!0})],e.prototype,"availableFields",null),e=x([Qe("esri.views.layers.OGCFeatureLayerView")],e),e};let B7e=class extends ubn(qle){supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}};B7e=x([Qe("esri.views.2d.layers.OGCFeatureLayerView2D")],B7e);const cbn=B7e,hbn=Object.freeze(Object.defineProperty({__proto__:null,default:cbn},Symbol.toStringTag,{value:"Module"})),AXt=pa()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),MXt=pa()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"});pa()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const dbn=pa()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),pbn=pa()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),fbn=pa()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});pa()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const OXt=pa()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});pa()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"});pa()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const mbn=pa()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),Xy=pa()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),Are=pa()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),Mk=pa()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),cwe=pa()({1:"right",2:"left"},{useNumericKeys:!0}),kb=pa()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),Mre=pa()({0:"permit",1:"restrict"},{useNumericKeys:!0}),hwe=pa()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),dwe=pa()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),gbn=pa()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),ybn=pa()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),ZCe=pa()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),zb=pa()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),pwe=pa()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),vbn=pa()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),_bn=pa()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),bbn=pa()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),wbn=pa()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var j7e;let iv=j7e=class extends xs(Ci){constructor(i){super(i),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(i){return new j7e({directionLineType:dwe.fromJSON(i.attributes.DirectionLineType),directionPointId:i.attributes.DirectionPointID,distance:i.attributes.Meters,duration:i.attributes.Minutes,fromLevel:i.attributes.FromLevel??null,geometry:i.geometry,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,symbol:i.symbol,toLevel:i.attributes.ToLevel??null})}toGraphic(){const i={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?dwe.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(i.FromLevel=this.fromLevel),this.toLevel!=null&&(i.ToLevel=this.toLevel),new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};iv.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],iv.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:dwe.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:dwe.read}}})],iv.prototype,"directionLineType",void 0),x([D({json:{read:{source:"attributes.DirectionPointID"}}})],iv.prototype,"directionPointId",void 0),x([D({json:{read:{source:"attributes.Meters"}}})],iv.prototype,"distance",void 0),x([D({json:{read:{source:"attributes.Minutes"}}})],iv.prototype,"duration",void 0),x([D({json:{read:{source:"attributes.FromLevel"}}})],iv.prototype,"fromLevel",void 0),x([D({type:lo})],iv.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],iv.prototype,"objectId",void 0),x([D({type:qc})],iv.prototype,"popupTemplate",void 0),x([D({types:Kh})],iv.prototype,"symbol",void 0),x([D({json:{read:{source:"attributes.ToLevel"}}})],iv.prototype,"toLevel",void 0),x([D({readOnly:!0,json:{read:!1}})],iv.prototype,"type",void 0),iv=j7e=x([Qe("esri.rest.support.DirectionLine")],iv);const vV=iv;var G7e;let Th=G7e=class extends xs(Ci){constructor(i){super(i),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(i,e){return e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null}static fromGraphic(i){return new G7e({alternateName:i.attributes.AlternateName??null,arrivalTime:i.attributes.ArrivalTime!=null?new Date(i.attributes.ArrivalTime):null,arrivalTimeOffset:i.attributes.ArrivalUTCOffset??null,azimuth:i.attributes.Azimuth??null,branchName:i.attributes.BranchName??null,directionPointType:hwe.fromJSON(i.attributes.DirectionPointType),displayText:i.attributes.DisplayText??null,exitName:i.attributes.ExitName??null,geometry:i.geometry,intersectingName:i.attributes.IntersectingName??null,level:i.attributes.Level??null,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,sequence:i.attributes.Sequence,shortVoiceInstruction:i.attributes.ShortVoiceInstruction??null,stopId:i.attributes.StopID??null,symbol:i.symbol,towardName:i.attributes.TowardName??null,voiceInstruction:i.attributes.VoiceInstruction??null})}toGraphic(){const i={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?hwe.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(i.AlternateName=this.alternateName),this.arrivalTime!=null&&(i.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(i.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(i.Azimuth=this.azimuth),this.branchName!=null&&(i.BranchName=this.branchName),this.displayText!=null&&(i.DisplayText=this.displayText),this.exitName!=null&&(i.ExitName=this.exitName),this.intersectingName!=null&&(i.IntersectingName=this.intersectingName),this.level!=null&&(i.Level=this.level),this.name!=null&&(i.Name=this.name),this.shortVoiceInstruction!=null&&(i.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(i.TowardName=this.towardName),this.voiceInstruction!=null&&(i.VoiceInstruction=this.voiceInstruction),new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Th.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],Th.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({json:{read:{source:"attributes.AlternateName"}}})],Th.prototype,"alternateName",void 0),x([D()],Th.prototype,"arrivalTime",void 0),x([Mi("arrivalTime",["attributes.ArrivalTime"])],Th.prototype,"readArrivalTime",null),x([D({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],Th.prototype,"arrivalTimeOffset",void 0),x([D({json:{read:{source:"attributes.Azimuth"}}})],Th.prototype,"azimuth",void 0),x([D({json:{read:{source:"attributes.BranchName"}}})],Th.prototype,"branchName",void 0),x([D({type:hwe.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:hwe.read}}})],Th.prototype,"directionPointType",void 0),x([D({json:{read:{source:"attributes.DisplayText"}}})],Th.prototype,"displayText",void 0),x([D({json:{read:{source:"attributes.ExitName"}}})],Th.prototype,"exitName",void 0),x([D({type:$i})],Th.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.IntersectingName"}}})],Th.prototype,"intersectingName",void 0),x([D()],Th.prototype,"level",void 0),x([D({json:{read:{source:"attributes.Name"}}})],Th.prototype,"name",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],Th.prototype,"objectId",void 0),x([D({type:qc})],Th.prototype,"popupTemplate",void 0),x([D({json:{read:{source:"attributes.Sequence"}}})],Th.prototype,"sequence",void 0),x([D({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],Th.prototype,"shortVoiceInstruction",void 0),x([D({json:{read:{source:"attributes.StopID"}}})],Th.prototype,"stopId",void 0),x([D({types:Kh})],Th.prototype,"symbol",void 0),x([D({json:{read:{source:"attributes.TowardName"}}})],Th.prototype,"towardName",void 0),x([D({readOnly:!0,json:{read:!1}})],Th.prototype,"type",void 0),x([D({json:{read:{source:"attributes.VoiceInstruction"}}})],Th.prototype,"voiceInstruction",void 0),Th=G7e=x([Qe("esri.rest.support.DirectionPoint")],Th);const _V=Th;function NA(i,e){if(i==null)return null;const t={},r=new RegExp(`^${e}`,"i");for(const n of Object.keys(i))if(r.test(n)){const s=n.substring(e.length);t[zb.fromJSON(s)]=i[n]}return t}function rZe(i,e,t){if(i!=null){e.attributes||(e.attributes={});for(const r in i){const n=zb.toJSON(r);e.attributes[`${t}${n}`]=i[r]}}}function jq(i){const e={};for(const t of Object.keys(i)){const r=t;e[zb.fromJSON(r)]=i[t]}return e}function Gq(i){const e={};for(const t of Object.keys(i)){const r=t;e[zb.toJSON(r)]=i[t]}return e}function woe(i,e){return i==null||e==null?null:Math.round((i-e)/6e4)}function xbn(i){const e=i.toJSON(),t=e;return t.accumulateAttributeNames&&=e.accumulateAttributeNames?.join(),t.attributeParameterValues&&=JSON.stringify(e.attributeParameterValues),t.barriers&&=JSON.stringify(e.barriers),t.outSR&&=e.outSR?.wkid,t.overrides&&=JSON.stringify(e.overrides),t.polygonBarriers&&=JSON.stringify(e.polygonBarriers),t.polylineBarriers&&=JSON.stringify(e.polylineBarriers),t.restrictionAttributeNames&&=e.restrictionAttributeNames?.join(),t.stops&&=JSON.stringify(e.stops),t.travelMode&&=JSON.stringify(e.travelMode),t}var U7e;let Rp=U7e=class extends xs(Ci){constructor(i){super(i),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}writeCosts(i,e){rZe(i,e,"Attr_")}static fromGraphic(i){return new U7e({addedCost:i.attributes.AddedCost??null,barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,curbApproach:i.attributes.CurbApproach!=null?Xy.fromJSON(i.attributes.CurbApproach):null,fullEdge:i.attributes.FullEdge!=null?Mre.fromJSON(i.attributes.FullEdge):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,status:i.attributes.Status!=null?Mk.fromJSON(i.attributes.Status):null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,CurbApproach:this.curbApproach!=null?Xy.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?Mre.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?Mk.toJSON(this.status):null};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Rp.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],Rp.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D()],Rp.prototype,"addedCost",void 0),x([D({type:kb.apiValues,json:{name:"attributes.BarrierType",read:{reader:kb.read},write:{writer:kb.write}}})],Rp.prototype,"barrierType",void 0),x([D()],Rp.prototype,"costs",void 0),x([Mi("costs",["attributes"])],Rp.prototype,"readCosts",null),x([ur("costs")],Rp.prototype,"writeCosts",null),x([D({constructOnly:!0,type:Xy.apiValues,json:{read:{source:"attributes.CurbApproach",reader:Xy.read}}})],Rp.prototype,"curbApproach",void 0),x([D({type:Mre.apiValues,json:{name:"attributes.FullEdge",read:{reader:Mre.read},write:{writer:Mre.write}}})],Rp.prototype,"fullEdge",void 0),x([D({type:$i,json:{write:!0}})],Rp.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],Rp.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],Rp.prototype,"objectId",void 0),x([D({type:qc})],Rp.prototype,"popupTemplate",void 0),x([D({type:cwe.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:cwe.read}}})],Rp.prototype,"sideOfEdge",void 0),x([D({json:{read:{source:"attributes.SourceID"}}})],Rp.prototype,"sourceId",void 0),x([D({json:{read:{source:"attributes.SourceOID"}}})],Rp.prototype,"sourceOid",void 0),x([D({type:Mk.apiValues,json:{read:{source:"attributes.Status",reader:Mk.read}}})],Rp.prototype,"status",void 0),x([D({types:Kh})],Rp.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],Rp.prototype,"type",void 0),Rp=U7e=x([Qe("esri.rest.support.PointBarrier")],Rp);const P8=Rp;var z7e;let rv=z7e=class extends xs(Ci){constructor(i){super(i),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}writeCosts(i,e){rZe(i,e,"Attr_")}static fromGraphic(i){return new z7e({barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,scaleFactor:i.attributes.ScaleFactor??null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};rv.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],rv.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:kb.apiValues,json:{name:"attributes.BarrierType",read:{reader:kb.read},write:{writer:kb.write}}})],rv.prototype,"barrierType",void 0),x([D()],rv.prototype,"costs",void 0),x([Mi("costs",["attributes"])],rv.prototype,"readCosts",null),x([ur("costs")],rv.prototype,"writeCosts",null),x([D({type:$s,json:{write:!0}})],rv.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],rv.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],rv.prototype,"objectId",void 0),x([D({type:qc})],rv.prototype,"popupTemplate",void 0),x([D()],rv.prototype,"scaleFactor",void 0),x([D({types:Kh})],rv.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],rv.prototype,"type",void 0),rv=z7e=x([Qe("esri.rest.support.PolygonBarrier")],rv);const R8=rv;var V7e;let g1=V7e=class extends xs(Ci){constructor(i){super(i),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(i,e){return NA(e.attributes,"Attr_")}static fromGraphic(i){return new V7e({barrierType:i.attributes.BarrierType!=null?kb.fromJSON(i.attributes.BarrierType):null,costs:i.attributes.Costs!=null?jq(JSON.parse(i.attributes.Costs)):null,geometry:i.geometry,name:i.attributes.Name??null,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,scaleFactor:i.attributes.ScaleFactor??null,symbol:i.symbol})}toGraphic(){const i={ObjectID:this.objectId,BarrierType:this.barrierType!=null?kb.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(Gq(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};g1.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],g1.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:kb.apiValues,json:{read:{source:"attributes.BarrierType",reader:kb.read}}})],g1.prototype,"barrierType",void 0),x([D()],g1.prototype,"costs",void 0),x([Mi("costs",["attributes"])],g1.prototype,"readCosts",null),x([D({type:lo,json:{write:!0}})],g1.prototype,"geometry",void 0),x([D({json:{name:"attributes.Name"}})],g1.prototype,"name",void 0),x([D({json:{name:"attributes.ObjectID"}})],g1.prototype,"objectId",void 0),x([D({type:qc})],g1.prototype,"popupTemplate",void 0),x([D()],g1.prototype,"scaleFactor",void 0),x([D({types:Kh})],g1.prototype,"symbol",void 0),x([D({readOnly:!0,json:{read:!1}})],g1.prototype,"type",void 0),g1=V7e=x([Qe("esri.rest.support.PolylineBarrier")],g1);const D8=g1;let qm=class extends xs(Ci){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,t){return t.id??t.itemId??null}readRestrictionAttributes(e,t){const{restrictionAttributeNames:r}=t;return r==null?null:r.map(n=>pwe.fromJSON(n))}writeRestrictionAttributes(e,t,r){e!=null&&(t[r]=e.map(n=>pwe.toJSON(n)))}};x([D({type:[Object],json:{write:!0}})],qm.prototype,"attributeParameterValues",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"description",void 0),x([Wr(ybn,{ignoreUnknown:!1})],qm.prototype,"distanceAttributeName",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"id",void 0),x([Mi("id",["id","itemId"])],qm.prototype,"readId",null),x([Wr(zb,{ignoreUnknown:!1})],qm.prototype,"impedanceAttributeName",void 0),x([D({type:String,json:{write:!0}})],qm.prototype,"name",void 0),x([D({type:[String],json:{write:!0}})],qm.prototype,"restrictionAttributeNames",void 0),x([Mi("restrictionAttributeNames")],qm.prototype,"readRestrictionAttributes",null),x([ur("restrictionAttributeNames")],qm.prototype,"writeRestrictionAttributes",null),x([D({type:Number,json:{write:{allowNull:!0}}})],qm.prototype,"simplificationTolerance",void 0),x([Wr(AXt)],qm.prototype,"simplificationToleranceUnits",void 0),x([Wr(ZCe,{ignoreUnknown:!1})],qm.prototype,"timeAttributeName",void 0),x([Wr(mbn)],qm.prototype,"type",void 0),x([D({type:Boolean,json:{write:!0}})],qm.prototype,"useHierarchy",void 0),x([Wr(OXt)],qm.prototype,"uturnAtJunctions",void 0),qm=x([Qe("esri.rest.support.TravelMode")],qm);const QCe=qm;let Mw=class extends Ci{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(t=>zb.fromJSON(t))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(n=>zb.toJSON(n)))}};x([D({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Mw.prototype,"accumulateAttributes",void 0),x([Mi("accumulateAttributes")],Mw.prototype,"readAccumulateAttributes",null),x([ur("accumulateAttributes")],Mw.prototype,"writeAccumulateAttributes",null),x([D({type:String,json:{write:!0}})],Mw.prototype,"directionsLanguage",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"findBestSequence",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"preserveFirstStop",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"preserveLastStop",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"startTimeIsUTC",void 0),x([D({type:Boolean,json:{write:!0}})],Mw.prototype,"timeWindowsAreUTC",void 0),x([D({type:QCe,json:{write:!0}})],Mw.prototype,"travelMode",void 0),Mw=x([Qe("esri.layers.support.RouteSettings")],Mw);const PXt=Mw;var H7e;let Du=H7e=class extends xs(Ci){constructor(i){super(i),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(i,e){return e.attributes.EndTimeUTC!=null?new Date(e.attributes.EndTimeUTC):null}readEndTimeOffset(i,e){return woe(e.attributes.EndTime,e.attributes.EndTimeUTC)}readStartTime(i,e){return e.attributes.StartTimeUTC!=null?new Date(e.attributes.StartTimeUTC):null}readStartTimeOffset(i,e){return woe(e.attributes.StartTime,e.attributes.StartTimeUTC)}readTotalCosts(i,e){return NA(e.attributes,"Total_")}readTotalViolations(i,e){return NA(e.attributes,"TotalViolation_")}readTotalWait(i,e){return NA(e.attributes,"TotalWait_")}static fromGraphic(i){return new H7e({analysisSettings:i.attributes.AnalysisSettings!=null?PXt.fromJSON(JSON.parse(i.attributes.AnalysisSettings)):null,endTime:i.attributes.EndTime!=null?new Date(i.attributes.EndTime):null,endTimeOffset:i.attributes.EndUTCOffset??null,geometry:i.geometry,messages:i.attributes.Messages!=null?JSON.parse(i.attributes.Messages):null,name:i.attributes.RouteName,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,startTime:i.attributes.StartTime!=null?new Date(i.attributes.StartTime):null,startTimeOffset:i.attributes.StartUTCOffset??null,symbol:i.symbol,totalCosts:i.attributes.TotalCosts!=null?jq(JSON.parse(i.attributes.TotalCosts)):null,totalDistance:i.attributes.TotalMeters??null,totalDuration:i.attributes.TotalMinutes??null,totalLateDuration:i.attributes.TotalLateMinutes??null,totalWaitDuration:i.attributes.TotalWaitMinutes??null,version:i.attributes.Version})}toGraphic(){const i={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(Gq(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Du.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],Du.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D()],Du.prototype,"analysisSettings",void 0),x([D()],Du.prototype,"endTime",void 0),x([Mi("endTime",["attributes.EndTimeUTC"])],Du.prototype,"readEndTime",null),x([D()],Du.prototype,"endTimeOffset",void 0),x([Mi("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],Du.prototype,"readEndTimeOffset",null),x([D({json:{read:{source:"attributes.FirstStopID"}}})],Du.prototype,"firstStopId",void 0),x([D({type:lo})],Du.prototype,"geometry",void 0),x([D({json:{read:{source:"attributes.LastStopID"}}})],Du.prototype,"lastStopId",void 0),x([D()],Du.prototype,"messages",void 0),x([D({json:{read:{source:"attributes.Name"}}})],Du.prototype,"name",void 0),x([D({json:{read:{source:"attributes.ObjectID"}}})],Du.prototype,"objectId",void 0),x([D({type:qc})],Du.prototype,"popupTemplate",void 0),x([D()],Du.prototype,"startTime",void 0),x([Mi("startTime",["attributes.StartTimeUTC"])],Du.prototype,"readStartTime",null),x([D()],Du.prototype,"startTimeOffset",void 0),x([Mi("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],Du.prototype,"readStartTimeOffset",null),x([D({json:{read:{source:"attributes.StopCount"}}})],Du.prototype,"stopCount",void 0),x([D({types:Kh})],Du.prototype,"symbol",void 0),x([D()],Du.prototype,"totalCosts",void 0),x([Mi("totalCosts",["attributes"])],Du.prototype,"readTotalCosts",null),x([D()],Du.prototype,"totalDistance",void 0),x([D()],Du.prototype,"totalDuration",void 0),x([D()],Du.prototype,"totalLateDuration",void 0),x([D()],Du.prototype,"totalViolations",void 0),x([Mi("totalViolations",["attributes"])],Du.prototype,"readTotalViolations",null),x([D()],Du.prototype,"totalWait",void 0),x([Mi("totalWait",["attributes"])],Du.prototype,"readTotalWait",null),x([D()],Du.prototype,"totalWaitDuration",void 0),x([D({readOnly:!0,json:{read:!1}})],Du.prototype,"type",void 0),x([D()],Du.prototype,"version",void 0),Du=H7e=x([Qe("esri.rest.support.RouteInfo")],Du);const Tte=Du;var W7e;let Ao=W7e=class extends xs(Ci){constructor(i){super(i),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(i,e){return woe(e.attributes.ArriveTime,e.attributes.ArriveTimeUTC)}readCumulativeCosts(i,e){return NA(e.attributes,"Cumul_")}readDepartTimeOffset(i,e){return woe(e.attributes.DepartTime,e.attributes.DepartTimeUTC)}readServiceCosts(i,e){return NA(e.attributes,"Attr_")}writeServiceCosts(i,e){rZe(i,e,"Attr_")}writeTimeWindowEnd(i,e){i!=null&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowEnd=i.getTime())}writeTimeWindowStart(i,e){i!=null&&(e.attributes||(e.attributes={}),e.attributes.TimeWindowStart=i.getTime())}readViolations(i,e){return NA(e.attributes,"Violation_")}readWait(i,e){return NA(e.attributes,"Wait_")}static fromGraphic(i){return new W7e({arriveCurbApproach:i.attributes.ArrivalCurbApproach!=null?Xy.fromJSON(i.attributes.ArrivalCurbApproach):null,arriveTime:i.attributes.ArrivalTime!=null?new Date(i.attributes.ArrivalTime):null,arriveTimeOffset:i.attributes.ArrivalUTCOffset,cumulativeCosts:i.attributes.CumulativeCosts!=null?jq(JSON.parse(i.attributes.CumulativeCosts)):null,cumulativeDistance:i.attributes.CumulativeMeters??null,cumulativeDuration:i.attributes.CumulativeMinutes??null,curbApproach:i.attributes.CurbApproach!=null?Xy.fromJSON(i.attributes.CurbApproach):null,departCurbApproach:i.attributes.DepartureCurbApproach!=null?Xy.fromJSON(i.attributes.DepartureCurbApproach):null,departTime:i.attributes.DepartureTime!=null?new Date(i.attributes.DepartureTime):null,departTimeOffset:i.attributes.DepartureUTCOffset??null,geometry:i.geometry,lateDuration:i.attributes.LateMinutes??null,locationType:i.attributes.LocationType!=null?Are.fromJSON(i.attributes.LocationType):null,name:i.attributes.Name,objectId:i.attributes.ObjectID??i.attributes.__OBJECTID,popupTemplate:i.popupTemplate,routeName:i.attributes.RouteName,sequence:i.attributes.Sequence??null,serviceCosts:i.attributes.ServiceCosts!=null?jq(JSON.parse(i.attributes.ServiceCosts)):null,serviceDistance:i.attributes.ServiceMeters??null,serviceDuration:i.attributes.ServiceMinutes??null,status:i.attributes.Status!=null?Mk.fromJSON(i.attributes.Status):null,symbol:i.symbol,timeWindowEnd:i.attributes.TimeWindowEnd!=null?new Date(i.attributes.TimeWindowEnd):null,timeWindowEndOffset:i.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:i.attributes.TimeWindowStart!=null?new Date(i.attributes.TimeWindowStart):null,timeWindowStartOffset:i.attributes.TimeWindowStartUTCOffset??null,waitDuration:i.attributes.WaitMinutes??null})}toGraphic(){const i={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?Xy.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(Gq(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?Xy.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?Xy.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?Are.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(Gq(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?Mk.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new Us({geometry:this.geometry,attributes:i,symbol:this.symbol,popupTemplate:this.popupTemplate})}};Ao.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],Ao.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},x([D({type:Xy.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:Xy.read}}})],Ao.prototype,"arriveCurbApproach",void 0),x([D({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],Ao.prototype,"arriveTime",void 0),x([D()],Ao.prototype,"arriveTimeOffset",void 0),x([Mi("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],Ao.prototype,"readArriveTimeOffset",null),x([D({json:{name:"attributes.Bearing",read:!1,write:!0}})],Ao.prototype,"bearing",void 0),x([D({json:{name:"attributes.BearingTol",read:!1,write:!0}})],Ao.prototype,"bearingTol",void 0),x([D()],Ao.prototype,"cumulativeCosts",void 0),x([Mi("cumulativeCosts",["attributes"])],Ao.prototype,"readCumulativeCosts",null),x([D()],Ao.prototype,"cumulativeDistance",void 0),x([D()],Ao.prototype,"cumulativeDuration",void 0),x([D({type:Xy.apiValues,json:{name:"attributes.CurbApproach",read:{reader:Xy.read},write:{writer:Xy.write}}})],Ao.prototype,"curbApproach",void 0),x([D({type:Xy.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:Xy.read}}})],Ao.prototype,"departCurbApproach",void 0),x([D({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],Ao.prototype,"departTime",void 0),x([D()],Ao.prototype,"departTimeOffset",void 0),x([Mi("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],Ao.prototype,"readDepartTimeOffset",null),x([D({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],Ao.prototype,"distanceToNetworkInMeters",void 0),x([D({type:$i,json:{write:!0}})],Ao.prototype,"geometry",void 0),x([D()],Ao.prototype,"lateDuration",void 0),x([D({type:Are.apiValues,json:{name:"attributes.LocationType",read:{reader:Are.read},write:{writer:Are.write}}})],Ao.prototype,"locationType",void 0),x([D({json:{name:"attributes.Name"}})],Ao.prototype,"name",void 0),x([D({json:{name:"attributes.NavLatency",read:!1,write:!0}})],Ao.prototype,"navLatency",void 0),x([D({json:{name:"attributes.ObjectID"}})],Ao.prototype,"objectId",void 0),x([D({type:qc})],Ao.prototype,"popupTemplate",void 0),x([D({json:{read:{source:"attributes.PosAlong"}}})],Ao.prototype,"posAlong",void 0),x([D({json:{name:"attributes.RouteName"}})],Ao.prototype,"routeName",void 0),x([D()],Ao.prototype,"serviceCosts",void 0),x([Mi("serviceCosts",["attributes"])],Ao.prototype,"readServiceCosts",null),x([ur("serviceCosts")],Ao.prototype,"writeServiceCosts",null),x([D()],Ao.prototype,"serviceDistance",void 0),x([D()],Ao.prototype,"serviceDuration",void 0),x([D({json:{name:"attributes.Sequence"}})],Ao.prototype,"sequence",void 0),x([D({type:cwe.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:cwe.read}}})],Ao.prototype,"sideOfEdge",void 0),x([D({json:{read:{source:"attributes.SnapX"}}})],Ao.prototype,"snapX",void 0),x([D({json:{read:{source:"attributes.SnapY"}}})],Ao.prototype,"snapY",void 0),x([D({json:{read:{source:"attributes.SnapZ"}}})],Ao.prototype,"snapZ",void 0),x([D({json:{read:{source:"attributes.SourceID"}}})],Ao.prototype,"sourceId",void 0),x([D({json:{read:{source:"attributes.SourceOID"}}})],Ao.prototype,"sourceOid",void 0),x([D({type:Mk.apiValues,json:{read:{source:"attributes.Status",reader:Mk.read}}})],Ao.prototype,"status",void 0),x([D({types:Kh})],Ao.prototype,"symbol",void 0),x([D({type:Date,json:{name:"attributes.TimeWindowEnd"}})],Ao.prototype,"timeWindowEnd",void 0),x([ur("timeWindowEnd")],Ao.prototype,"writeTimeWindowEnd",null),x([D()],Ao.prototype,"timeWindowEndOffset",void 0),x([D({type:Date,json:{name:"attributes.TimeWindowStart"}})],Ao.prototype,"timeWindowStart",void 0),x([ur("timeWindowStart")],Ao.prototype,"writeTimeWindowStart",null),x([D()],Ao.prototype,"timeWindowStartOffset",void 0),x([D({readOnly:!0,json:{read:!1}})],Ao.prototype,"type",void 0),x([D()],Ao.prototype,"violations",void 0),x([Mi("violations",["attributes"])],Ao.prototype,"readViolations",null),x([D()],Ao.prototype,"waitDuration",void 0),x([D()],Ao.prototype,"wait",void 0),x([Mi("wait",["attributes"])],Ao.prototype,"readWait",null),Ao=W7e=x([Qe("esri.rest.support.Stop")],Ao);const F8=Ao,Sbn=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],UK={graphic:null,property:null,oldValue:null,newValue:null};function nZe(i){return i instanceof vV||i instanceof _V||i instanceof P8||i instanceof R8||i instanceof D8||i instanceof Tte||i instanceof F8}function Tbn(i){return dr.isCollection(i)&&i.length&&nZe(i.at(0))}function Cbn(i){return Array.isArray(i)&&i.length>0&&nZe(i[0])}let Cte=class extends Lm(Nm){constructor(){super(...arguments),this._graphics=new dr,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new _E({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new dr([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,e=>this._routeItemsChanged(e),js)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(e,t){return this._graphicsView.hitTest(e).filter(({popupTemplate:r})=>!!r)}highlight(e){let t;t=nZe(e)?[this._getNetworkFeatureUid(e)]:Cbn(e)?e.map(n=>this._getNetworkFeatureUid(n)):Tbn(e)?e.map(n=>this._getNetworkFeatureUid(n)).toArray():[e.uid];const r=t.filter(Ga);return r.length?(this._addHighlight(r),wa(()=>this._removeHighlight(r))):wa()}async hitTest(e,t){if(this.suspended)return null;const r=this._graphicsView.hitTest(e).filter(Ga).map(s=>this._networkGraphicMap.get(s));if(!r.length)return null;const{layer:n}=this;return r.reverse().map(s=>({type:"route",layer:n,mapPoint:e,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(e){this._graphicsView.processUpdate(e)}viewChange(){this._graphicsView.viewChange()}_addHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_createGraphic(e){const t=e.toGraphic();return t.layer=this.layer,t.sourceLayer=this.layer,t}_createGraphicsView(){const e=this.view,t=()=>this.requestUpdate(),r=new QA(e.featuresTilingScheme);this._graphicsView=new Tx({container:r,graphics:this._graphics,requestUpdateCallback:t,view:e}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(e){const t=this._networkGraphicMap.get(e);return Sbn.indexOf(t.type)}_getNetworkFeatureUid(e){return this._networkFeatureMap.has(e)?this._networkFeatureMap.get(e).uid:null}_removeHighlight(e){for(const t of e)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_routeItemsChanged(e){if(e.removed.length){this._graphics.removeMany(e.removed.map(t=>{const r=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(r),r}));for(const t of e.removed)this.removeHandles(t)}if(e.added.length){this._graphics.addMany(e.added.map(t=>{const r=this._createGraphic(t);return r.symbol==null?null:(this._networkFeatureMap.set(t,r),this._networkGraphicMap.set(r,t),r)}).filter(Ga));for(const t of e.added)this.addHandles([Ki(()=>t.geometry,(r,n)=>{this._updateGraphic(t,"geometry",r,n)}),Ki(()=>t.symbol,(r,n)=>{this._updateGraphic(t,"symbol",r,n)})],t);this._graphics.sort((t,r)=>this._getDrawOrder(t)-this._getDrawOrder(r))}}_updateGraphic(e,t,r,n){if(!this._networkFeatureMap.has(e)){const o=this._createGraphic(e);return this._networkFeatureMap.set(e,o),this._networkGraphicMap.set(o,e),void this._graphics.add(o)}const s=this._networkFeatureMap.get(e);s[t]=r,UK.graphic=s,UK.property=t,UK.oldValue=n,UK.newValue=r,this._graphicsView.graphicUpdateHandler(UK)}_updateHighlight(){const e=Array.from(this._highlightIds.keys()),t=SCe("highlight");this._graphicsView.setHighlight(e.map(r=>({objectId:r,highlightFlags:t})))}};x([D()],Cte.prototype,"_graphics",void 0),x([D()],Cte.prototype,"_routeItems",null),Cte=x([Qe("esri.views.2d.layers.RouteLayerView2D")],Cte);const Ebn=Cte,Ibn=Object.freeze(Object.defineProperty({__proto__:null,default:Ebn},Symbol.toStringTag,{value:"Module"})),Abn=i=>{let e=class extends i{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...t){super(...t),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(t){t?this._doPause():this._isUserPaused||this._doResume()}};return x([D()],e.prototype,"_isUserPaused",void 0),x([D({readOnly:!0})],e.prototype,"connectionStatus",null),x([D({type:QF})],e.prototype,"filter",void 0),e=x([Qe("esri.layers.mixins.StreamLayerView")],e),e};let i6=class extends Abn(qle){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([Ki(()=>this.layer.customParameters,e=>this._worker.streamMessenger.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._worker.streamMessenger.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&e.type==="clear"&&this.incrementSourceRefreshVersion()}),Ki(()=>this.layer.purgeOptions,()=>this._update()),Ki(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new qe("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return j3(e.map(o=>this.on(o,t)));const r=["data-received","message-received"].includes(e);r&&this._worker.streamMessenger.enableEvent(e,!0);const n=super.on(e,t),s=this;return wa(()=>{n.remove(),r&&(s._worker.closed||s.hasEventListener(e)||s._worker.streamMessenger.enableEvent(e,!1))})}queryLatestObservations(e,t){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new qe("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return Wm(this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(r=>{const n=du.fromJSON(r);return n.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),n}),new du({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this.resume()}_doClear(){this._worker.streamMessenger.clear(),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};x([D()],i6.prototype,"pipelineConnectionStatus",void 0),x([D()],i6.prototype,"pipelineErrorString",void 0),x([D({readOnly:!0})],i6.prototype,"connectionError",null),x([D({readOnly:!0})],i6.prototype,"_streamConnectionStatus",null),i6=x([Qe("esri.views.2d.layers.StreamLayerView2D")],i6);const Mbn=i6,Obn=Object.freeze(Object.defineProperty({__proto__:null,default:Mbn},Symbol.toStringTag,{value:"Module"}));let q7e=class extends qle{initialize(){this.addHandles([Ki(()=>this.view.scale,()=>this._update(),js)],"constructor")}isUpdating(){const e=this.layer.sublayers.some(a=>a.renderer!=null),t=this._commandsQueue.updateTracking.updating,r=this._updatingRequiredFieldsPromise!=null,n=!this._worker,s=this.dataUpdating,o=e&&(t||r||n||s);return yi("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${o} -> hasRenderer ${e} -> hasPendingCommand ${t} -> updatingRequiredFields ${r} -> updatingProxy ${n} -> updatingPipeline ${s} -`),o}};q7e=x([Qe("esri.views.2d.layers.SubtypeGroupLayerView2D")],q7e);const Fbn=q7e,kbn=Object.freeze(Object.defineProperty({__proto__:null,default:Fbn},Symbol.toStringTag,{value:"Module"}));let Ore=class{constructor(e,t){this._width=0,this._height=0,this._free=[],this._width=e,this._height=t,this._free.push(new _d(0,0,e,t))}get width(){return this._width}get height(){return this._height}allocate(e,t){if(e>this._width||t>this._height)return new _d;let r=null,n=-1;for(let s=0;se&&this._free.push(new _d(r.x+e,r.y,r.width-e,t)),r.height>t&&this._free.push(new _d(r.x,r.y+t,r.width,r.height-t))):(r.width>e&&this._free.push(new _d(r.x+e,r.y,r.width-e,r.height)),r.height>t&&this._free.push(new _d(r.x,r.y+t,e,r.height-t))),new _d(r.x,r.y,e,t))}release(e){for(let t=0;t{const u=e+l;if(this._rangePromises.has(u))a.push(this._rangePromises.get(u));else{const c=n.getRange(e,l).then(()=>{this._rangePromises.delete(u)},()=>{this._rangePromises.delete(u)});this._rangePromises.set(u,c),a.push(c)}}),Promise.all(a).then(()=>{let l=this._glyphIndex[e];l||(l={},this._glyphIndex[e]=l);for(const u of t){const c=l[u];if(c){r[u]={sdf:!0,rect:c.rect,metrics:c.metrics,page:c.page,code:u};continue}const h=n.getGlyph(e,u);if(!h?.metrics)continue;const p=h.metrics;let m;if(p.width===0)m=new _d(0,0,0,0);else{const w=p.width+6,S=p.height+2*3;let I=w%4?4-w%4:4,R=S%4?4-S%4:4;I===1&&(I=5),R===1&&(R=5),m=this._binPack.allocate(w+I,S+R),m.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new Ore(this.width-4,this.height-4),m=this._binPack.allocate(w+I,S+R));const L=this._glyphData[this._currentPage],k=h.bitmap;let B,$;if(k)for(let V=0;V{r.addRange(t,new _Re(new g3(new Uint8Array(a.data),new DataView(a.data))))}).catch(()=>{r.addRange(t,new _Re)})}return r.addRange(t,new _Re),Promise.resolve()}getGlyph(e,t){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(t/256),s=r.getRange(n);return s?{metrics:s.getMetrics(t),bitmap:s.getBitmap(t)}:void 0}_getFontStack(e){let t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new Lbn),t}},Nbn=class{constructor(e,t,r){this._array=e,this._start=t,this.length=r}at(e){return 0<=e&&e0&&(this._maxItemSize=r),this._binPack=new Ore(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new Ore(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight),n=new Uint32Array(t*r);this._mosaicsData[0]=n,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let r,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith($bn)?([r,n]=this._rasterizeDash(e),t=!0):r=this._sprites.getSpriteInfo(e),!r?.width||!r.height||r.width<0||r.height<0))return null;const o=r.width,a=r.height,[l,u,c]=this._allocateImage(o,a);return l.width<=0?null:(this._copy(l,r,u,c,t,n),s={type:"sprite",rect:l,width:o,height:a,sdf:r.sdf,simplePattern:!1,rasterizationScale:r.pixelRatio,page:u},this._mosaicRects[e]=s,s)}getSpriteItems(e){const t={};for(const r of e)t[r.name]=this.getSpriteItem(r.name,r.repeat);return t}getMosaicItemPosition(e,t){const r=this.getSpriteItem(e,t),n=r&&r.rect;if(!n)return null;n.width=r.width,n.height=r.height;const s=r.width,o=r.height,a=2;return{tl:[n.x+a,n.y+a],br:[n.x+a+s,n.y+a+o],page:r.page}}bind(e,t,r=0,n=0){if(r>=this._size.length||r>=this._mosaicsData.length)return;if(!this._textures[r]){const o=new Ua;o.wrapMode=Ls.CLAMP_TO_EDGE,o.width=this._size[r][0],o.height=this._size[r][1],this._textures[r]=new fl(e,o,new Uint8Array(this._mosaicsData[r].buffer))}const s=this._textures[r];s.setSamplingMode(t),this._dirties[r]&&s.setData(new Uint8Array(this._mosaicsData[r].buffer)),e.bindTexture(s,n),this._dirties[r]=!1}static _copyBits(e,t,r,n,s,o,a,l,u,c,h){let p=n*t+r,m=l*o+a;if(h){m-=o;for(let v=-1;v<=c;v++,p=((v+c)%c+n)*t+r,m+=o)for(let w=-1;w<=u;w++)s[m+w]=e[p+(w+u)%u]}else for(let v=0;v=this._mosaicsData.length)return;const a=new Uint32Array(o?o.buffer:this._sprites.image.buffer),l=this._mosaicsData[r];l&&a||console.error("Source or target images are uninitialized!");const u=2,c=o?t.width:this._sprites.width;RXt._copyBits(a,c,t.x,t.y,l,n[0],e.x+u,e.y+u,t.width,t.height,s),this._dirties[r]=!0}_allocateImage(e,t){e+=2,t+=2;const r=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const t=this._layer.currentStyleInfo.glyphsUrl,r=new j1t(t?gg(t,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new B1t(1024,1024,r),this._broadcastPromise=$R("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{if(this._layer&&(this._connection?.close(),this._connection=n,this._layer&&!this._connection.closed)){const s=n.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},e);Promise.all(s).catch(o=>l3(o))}})}_requestSprite(e){this._spriteSourceAbortController?.abort();const t=new AbortController;this._spriteSourceAbortController=t;const r=e?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,r&&(this._inputSignalEventListener=jbn(t),r.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:n}=t,s={...e,signal:n};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,s),this._spriteSourcePromise.then(o=>{_a(n),this._spriteMosaic=new G1t(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const t=new G1t(1024,1024,250);return t.setSpriteSource(e),this._spriteMosaic=t,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,t}async setStyle(e,t,r){await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=r,this._requestSprite();const n=new j1t(this._layer.currentStyleInfo.glyphsUrl?gg(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new B1t(1024,1024,n),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:t,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,t){const r=await this._getRefKeys(e,t);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),r,t)}async fetchTilePBFs(e){const t=Object.keys(this._layer.sourceNameToSource),r={},n=await this._getRefKeys(e,r),s=[],o=[];for(let a=0;a{s.push({...c,key:l})}),o.push(u)}return Promise.all(o).then(()=>s)}async parseTileData(e,t){const r=e&&e.data;if(!r)return null;const{sourceName2DataAndRefKey:n,transferList:s}=r;return Object.keys(n).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...t,transferList:s}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,t,r){const n=Tc.pool.acquire(e.id),s=this._layer.sourceNameToSource[t],{level:o,row:a,col:l}=n;Tc.pool.release(n);try{return{protobuff:await s.requestTile(o,a,l,r),sourceName:t}}catch(u){if(mo(u))throw u;return{protobuff:null,sourceName:t}}}async _getRefKeys(e,t){const r=this._layer.sourceNameToSource,n=new Array;for(const s in r){const o=r[s].getRefKey(e,t);n.push(o)}return g0(n)}_getSourcesData(e,t,r){const n=[];for(let s=0;s{const o={},a=[];for(let l=0;l0){const c=t[l].value.id;o[u.sourceName]={refKey:c,protobuff:u.protobuff},a.push(u.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:a}})}};function jbn(i){return()=>i.abort()}const U1t=512,Gbn=1e-6,Ubn=(i,e)=>i+1/(1<<2*e);let z1t=class{constructor(e,t){this._tiles=new Map,this._tileCache=new d3(40,r=>r.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=t}destroy(){for(const[e,t]of this._tiles)t.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const t=this.tileInfoView,r=t.getTileCoverage(e.state,0,!0,"smallest");if(!r)return!0;const{spans:n,lodInfo:s}=r,{level:o}=s,a=this._tiles,l=new Set,u=new Set;for(const{row:h,colFrom:p,colTo:m}of n)for(let v=p;v<=m;v++){const w=Tc.getId(o,h,s.normalizeCol(v),s.getWorldForColumn(v)),S=this._getOrAcquireTile(w);l.add(w),S.processed()?this._addToContainer(S):u.add(new Tc(w))}for(const[h,p]of a)p.isCoverage=l.has(h);for(const h of u)this._findPlaceholdersForMissingTiles(h,l);let c=!1;for(const[h,p]of a)p.neededForCoverage=l.has(h),p.neededForCoverage||p.isHoldingForFade&&t.intersects(r,p.key)&&l.add(h),p.isFading&&(c=!0);for(const[h,p]of this._tiles)l.has(h)||this._releaseTile(h);return dB.pool.release(r),!c}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,t,r,n,s){const o=[0,0],a=[0,0];n.toMap(o,e-r,t+r),n.toMap(a,e+r,t-r);const l=Math.min(o[0],a[0]),u=Math.min(o[1],a[1]),c=Math.max(o[0],a[0]),h=Math.max(o[1],a[1]),p=cW(l,u,c,h),m=Wo(),v=[];for(const[w,S]of this._visibleTiles)this.tileInfoView.getTileBounds(m,S.key),aae(p,m)&&v.push(S);if(s!=null&&s.length>0){const w=new Set(v.map(I=>I.id)),S=s.filter(I=>!w.has(I.tileKey.id)).map(I=>this._visibleTiles.get(I.tileKey.id)).filter(I=>I!==void 0);v.push(...S)}return v}_findPlaceholdersForMissingTiles(e,t){const r=[];for(const[s,o]of this._tiles)this._addPlaceholderChild(r,o,e,t);const n=r.reduce(Ubn,0);Math.abs(1-n)0;){if(n--,s>>=1,o>>=1,r.level===n&&r.row===s&&r.col===o&&r.world===a)return!0;if(l.has(`${n}/${s}/${o}/${a}`))return!1}return!1}_updateCacheSize(e){const t=e.state.size;if(t[0]===this._viewSize[0]&&t[1]===this._viewSize[1])return;const r=Math.ceil(t[0]/U1t)+1,n=Math.ceil(t[1]/U1t)+1;this._viewSize[0]=t[0],this._viewSize[1]=t[1],this._tileCache.maxSize=5*r*n}};function zbn(i){const[e,t,r,n]=i.split("/"),s=parseInt(e,10);return s===0?null:`${s-1}/${parseInt(t,10)>>1}/${parseInt(r,10)>>1}/${parseInt(n,10)}`}function Vbn(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Hbn=class{constructor(e,t){this.sourceTile=t,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},Wbn=class{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}};function V1t(i,e,t,r,n,s){const o=t-n;if(o>=0)return(e>>o)+(r-(s<>o);const a=-o;return e-(s-(r<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=ba(this.vao)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=this.layer.lineMaterial;this.vao=new wh(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:a},u)}},Zbn=class extends eEe{constructor(e,t){super(e,t),this.type=ng.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.fillIndexStart=r[n++],this.fillIndexCount=r[n++],this.outlineIndexStart=r[n++],this.outlineIndexCount=r[n++];const s=r[n++];if(s>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=ba(this.fillVAO),this.outlineVAO=ba(this.outlineVAO)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=n[r++],h=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const p=n[r++],m=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,p));r+=p;const v=this.layer,w=v.fillMaterial,S=v.outlineMaterial;this.fillVAO=new wh(e,w.getAttributeLocations(),w.getLayoutInfo(),{geometry:a},u),this.outlineVAO=new wh(e,S.getAttributeLocations(),S.getLayoutInfo(),{geometry:h},m)}},Qbn=class extends eEe{constructor(e,t,r){super(e,t),this.type=ng.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const n=new Uint32Array(e),s=new Int32Array(e),o=new Float32Array(e);let a=this.bufferDataOffset;this.isIconSDF=!!n[a++];const l=n[a++],u=n[a++],c=n[a++],h=new Tc(l,u,c,0),p=n[a++];for(let S=0;S0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[t,r]of this.iconPerPageElementsMap)e+=r[1];for(const[t,r]of this.glyphPerPageElementsMap)e+=r[1];return e/3}doDestroy(){this.iconVAO=ba(this.iconVAO),this.textVAO=ba(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,t=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===t.usedMemory&&t.setSubData(e,0,0,e.length);const r=this.textOpacity,n=this.textVAO.vertexBuffers.opacity;r.length>0&&r.byteLength===n.usedMemory&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=n[r++],h=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const p=n[r++],m=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,p));r+=p;const v=Aa.createVertex(e,oa.STATIC_DRAW,this.iconOpacity.buffer),w=Aa.createVertex(e,oa.STATIC_DRAW,this.textOpacity.buffer),S=this.layer,I=S.iconMaterial,R=S.textMaterial;this.iconVAO=new wh(e,I.getAttributeLocations(),I.getLayoutInfo(),{geometry:a,opacity:v},u),this.textVAO=new wh(e,R.getAttributeLocations(),R.getLayoutInfo(),{geometry:h,opacity:w},m)}},ewn=class extends eEe{constructor(e,t){super(e,t),this.type=ng.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.circleIndexStart=r[n++],this.circleIndexCount=r[n++],this.bufferDataOffset=n}get memoryUsed(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=ba(this.vao)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=this.layer.circleMaterial;this.vao=new wh(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:a},u)}},twn=class FXt extends gX{constructor(e,t,r,n,s,o,a,l=null){super(e,t,r,n,s,o,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(this.featureIndex=null,iwn.delete(this),FXt._destroyRenderBuckets(this.layerData),this.layerData.clear(),this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get usedMemory(){return this._memoryUsedByLayerData+256}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:r,emptyBuckets:n}=e,s=this._createRenderBuckets(r);if(n&&n.byteLength>0){const o=new Uint32Array(n);for(const a of o)this._deleteLayerData(a)}for(const[o,a]of s)this._deleteLayerData(o),a.type===ng.SYMBOL&&(this.symbols.set(o,a.symbols),t=!0),this._memoryUsedByLayerData+=a.memoryUsed,this.layerData.set(o,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const[r,n]of this.layerData)n.type===ng.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*t,n=this.height/this.rangeY*t,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;Jk(o),h0(o,o,s),q3(o,o,Math.PI*e.rotation/180),_R(o,o,[r,n,1])}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc(),tileUnitsToPixels:Cc()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const r of e.values())t.has(r)||(r.destroy(),t.add(r));e.clear()}_createRenderBuckets(e){const t=new Map,r=new Map;for(const n of e){const s=this._deserializeBucket(n,r);for(const o of s.layerUIDs)t.set(o,s)}return t}_deserializeBucket(e,t){let r=t.get(e);if(r)return r;switch(new Uint32Array(e)[0]){case ng.FILL:r=new Zbn(e,this.styleRepository);break;case ng.LINE:r=new Kbn(e,this.styleRepository);break;case ng.SYMBOL:r=new Qbn(e,this.styleRepository,this);break;case ng.CIRCLE:r=new ewn(e,this.styleRepository)}return t.set(e,r),r}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.destroy(),this.layerData.delete(e)}};const iwn=new Map;function rwn(i,e,t,r,n,s){const{iconRotationAlignment:o,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:u,textTranslate:c,textTranslateAnchor:h}=r;let p=0;for(const m of i.colliders){const[v,w]=m.partIndex===0?l:c,S=m.partIndex===0?u:h,I=m.minLod<=s&&s<=m.maxLod;p+=I?0:1,m.enabled=I,m.xScreen=m.xTile*n[0]+m.yTile*n[3]+n[6],m.yScreen=m.xTile*n[1]+m.yTile*n[4]+n[7],S===mb.MAP?(m.xScreen+=t*v-e*w,m.yScreen+=e*v+t*w):(m.xScreen+=v,m.yScreen+=w),sc.VIEWPORT===(m.partIndex===0?o:a)?(m.dxScreen=m.dxPixels,m.dyScreen=m.dyPixels):(m.dxScreen=t*(m.dxPixels+m.width/2)-e*(m.dyPixels+m.height/2)-m.width/2,m.dyScreen=e*(m.dxPixels+m.width/2)+t*(m.dyPixels+m.height/2)-m.height/2)}i.colliders.length>0&&p===i.colliders.length&&(i.unique.show=!1)}let nwn=class{constructor(e,t,r,n,s,o){this._symbols=e,this._styleRepository=n,this._zoom=s,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new DXt(t,r,isn),this._si=Math.sin(Math.PI*o/180),this._co=Math.cos(Math.PI*o/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,m5t(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function r(s){const o=s.xScreen+s.dxScreen,a=s.yScreen+s.dyScreen,l=o+s.width,u=a+s.height,[c,h,p,m]=t.getCellSpan(o,a,l,u);for(let v=h;v<=m;v++)for(let w=c;w<=p;w++){const S=t.cells[v][w];for(const I of S){const R=I.xScreen+I.dxScreen,L=I.yScreen+I.dyScreen,k=R+I.width,B=L+I.height;if(!(lk||uB))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const a=s.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;rwn(a,this._si,this._co,o,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:u,iconIgnorePlacement:c,textAllowOverlap:h,textIgnorePlacement:p}=o;for(const m of a.colliders){if(!m.enabled)continue;const v=l.parts[m.partIndex];v.show&&!(m.partIndex?h:u)&&r(m)&&(m.hard?l.show=!1:v.show=!1)}if(l.show)for(const m of a.colliders){if(!m.enabled||(m.partIndex?p:c)||!l.parts[m.partIndex].show)continue;const v=m.xScreen+m.dxScreen,w=m.yScreen+m.dyScreen,S=v+m.width,I=w+m.height,[R,L,k,B]=this._gridIndex.getCellSpan(v,w,S,I);for(let $=L;$<=B;$++)for(let V=R;V<=k;V++)this._gridIndex.cells[$][V].push(m)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const r=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",r)!==YP.POINT;let o=n.getLayoutValue("icon-rotation-alignment",r);o===sc.AUTO&&(o=s?sc.MAP:sc.VIEWPORT);let a=n.getLayoutValue("text-rotation-alignment",r);a===sc.AUTO&&(a=s?sc.MAP:sc.VIEWPORT);const l=n.getPaintValue("icon-translate",r),u=n.getPaintValue("icon-translate-anchor",r),c=n.getPaintValue("text-translate",r),h=n.getPaintValue("text-translate-anchor",r),p={iconAllowOverlap:n.getLayoutValue("icon-allow-overlap",r),iconIgnorePlacement:n.getLayoutValue("icon-ignore-placement",r),textAllowOverlap:n.getLayoutValue("text-allow-overlap",r),textIgnorePlacement:n.getLayoutValue("text-ignore-placement",r),iconRotationAlignment:o,textRotationAlignment:a,iconTranslateAnchor:u,iconTranslate:l,textTranslateAnchor:h,textTranslate:c};return this._styleProps.set(e,p),p}};function swn(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,r=e.tile.key;return t.world-r.world?t.world-r.world:t.level-r.level?t.level-r.level:t.row-r.row?t.row-r.row:t.col-r.col?t.col-r.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let own=class{get running(){return this._running}constructor(e,t,r,n,s,o){this._visibleTiles=e,this._symbolRepository=t,this._createCollisionJob=r,this._assignTileSymbolsOpacity=n,this._symbolLayerSorter=s,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let l=0;ll)return!1;let v=null,w=!1,S=!1;for(const I of u.tileSymbols)if(!S||!w){const R=I.tile;(!v||R.isCoverage||R.neededForCoverage&&!w)&&(v=I,(R.neededForCoverage||R.isCoverage)&&(S=!0),R.isCoverage&&(w=!0))}if(v.selectedForRendering=!0,S){m.symbols.push(v),u.show=!0;for(const I of u.parts)I.show=!0}else u.show=!1}}for(const h of t)h.symbols.sort(swn);return!0}const a=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return t.sort(a)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,t=this._visibleTiles;let r=0;function n(s,o){const a=s.symbols;for(const[l,u]of a)awn(u,o);e(s,o);for(const l of s.childrenTiles)n(l,o)}return{work(s){const o=performance.now();for(;rs)return!1;const a=t[r];a.parentTile==null&&n(a,performance.now())}return!0}}}};function awn(i,e){for(const t of i){const r=t.unique;for(const n of r.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/Dq),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=r.show&&n.show?1:0}}}const lwn=32,uwn=8,cwn=64;let hwn=class{constructor(e,t,r){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=r,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let r=this._tiles.get(e.id);r||(r={symbols:new Map},this._tiles.set(e.id,r));const n=new Map;if(t)for(const a of t)r.symbols.has(a)&&(n.set(a,r.symbols.get(a)),r.symbols.delete(a));else for(const[a,l]of e.layerData)r.symbols.has(a)&&(n.set(a,r.symbols.get(a)),r.symbols.delete(a));this._removeSymbols(n);const s=e.symbols,o=new Map;for(const[a,l]of s){let u=l.length;if(u>=lwn){let c=this.tileCoordRange;do c/=2,u/=4;while(u>uwn&&c>cwn);const h=new DXt(this.tileCoordRange,this.tileCoordRange,c);o.set(a,{flat:l,index:h}),r.symbols.set(a,{flat:l,index:h});for(const p of l)h.getCell(p.xTile,p.yTile).push(p)}else o.set(a,{flat:l}),r.symbols.set(a,{flat:l})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,r]of this._tiles){const n=new Map;for(const s of e)r.symbols.has(s)&&(n.set(s,r.symbols.get(s)),r.symbols.delete(s));this._removeSymbols(n),r.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const r=new Map;for(const[n,s]of e.symbols)t.symbols.has(n)&&(r.set(n,t.symbols.get(n)),t.symbols.delete(n));this._removeSymbols(r),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,r,n){const s=[],o=this.uniqueSymbols;for(const a of o){const l=a.styleLayerUID,u=a.uniqueSymbols;for(const c of u){const h=c.tileSymbols.find(p=>p.selectedForRendering);h&&Jbn(h,e,t*(window.devicePixelRatio||1),r)&&s.push({vtlSymbol:h,styleLayerUID:l,tileKey:h.tile.key})}}return s}_removeSymbols(e){for(const[t,{flat:r}]of e)for(const n of r){const s=n.unique,o=s.tileSymbols,a=o.length-1;for(let l=0;lt.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}if(t.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,t,r);return}const n=new Map;for(const[s,o]of r){const a=[];for(const h of o){const p=V1t(this.tileCoordRange,h.xTile,t.level,t.col,e.key.level,e.key.col),m=V1t(this.tileCoordRange,h.yTile,t.level,t.row,e.key.level,e.key.row);p>=0&&p=0&&m0&&n.set(s,l)}for(const s of e.childrenTiles)this._matchSymbols(s,t,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let r,n=0;for(const[s,o]of e){const a=new Array(o.size);r=0;for(const l of o)a[r++]=l;t[n]={styleLayerUID:s,uniqueSymbols:a},n++}return t}};const dwn=.5,H1t=1e-6;let pwn=class{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=hB(!1),this._symbolRepository=new hwn(4096,t,()=>new Wbn),this._symbolDeclutterer=new own(t,this._symbolRepository,(r,n,s)=>this._createCollisionJob(r,n,s),(r,n)=>{r.allSymbolsFadingOut=!0,r.lastOpacityUpdate=n,Ybn(r,n,!0),r.decluttered=!0,r.requestRender()},(r,n)=>this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(n.styleLayerUID).z,r=>{const n=this.styleRepository.getStyleLayerByUID(r);if(this._zoom+H1t=n.maxzoom)return!1;const s=n.getLayoutProperty("visibility");return!s||s.getValue()!==_A.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,r){return this.updateDecluttererViewState(),new nwn(e,t,r,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const r=[0,0];t.toScreen(r,t.center);const n=[0,0];return t.toScreen(n,this._declutterViewState.center),this._offsetFromScreenCenter[0]=r[0]-n[0],this._offsetFromScreenCenter[1]=r[1]-n[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(rsn),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+dwn)*Dq)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}},fwn=class extends gX{_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}};const fwe=1e-6;function W1t(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==_A.NONE&&(i.minzoom===void 0||i.minzoom=e-fwe))return!0}return!1}let mwn=class extends Hle{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,n){this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this._tileInfoView=n,this._computeDisplayInfoView(n),this._symbolFader==null&&(this._symbolFader=new pwn(this._styleRepository,this.children)),this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==aa.MAP&&e.drawPhase!==aa.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader!=null?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;t!==aa.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,state:r}=e,n=this._styleRepository;if(!n)return;const s=n.layers,o=this._displayInfo.scaleToZoom(r.scale);n.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,n.backgroundBucketIds,o)),super.renderChildren(e),e.drawPhase===aa.MAP&&this._fade(o,r);const a=this.children.filter(l=>l.visible&&l.hasData());if(!a||a.length===0)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);for(const l of a)l.triangleCount=0;t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(Hl.LEQUAL),t.setClearDepth(1),t.clear(t.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let l=s.length-1;l>=0;l--)this._renderStyleLayer(s[l],e,a);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let l=0;lc.decluttered):r.filter(c=>c.neededForCoverage),l!=="vtlSymbol"&&(r.length===0||e.minzoom!==void 0&&e.minzoom>=n+fwe||e.maxzoom!==void 0&&e.maxzoom{const t=i.vtlSymbol.sourceTile,r=e.vtlSymbol.sourceTile;return t.level!==r.level?t.level-r.level:t.row!==r.row?t.row-r.row:t.col!==r.col?t.col-r.col:i.styleLayerUID-e.styleLayerUID};let _wn=class kXt{constructor(e,t,r,n,s){this.tileKey=e,this._index=null,this._styleRepository=null,this._tileHandler=null,this._tileKeyToPBF=new Map,this._tileLayerData=t,this._styleRepository=r,this._tileHandler=n,this._parentLayer=s}static create(e,t,r,n,s){return new kXt(e,t,r,n,s)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,r,n,s){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new sbe(100,bwn),await this._indexLayers());const o=[];return this._queryIndex(o,e,t,r,this.tileKey.level,n),s&&s?.length>0&&await this._getSymbolsAttributes(o,s),o}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,r=await this._getTilePayload(e);for(const[n,s]of this._tileLayerData){const o=t[n],a=r.find(c=>c.sourceName===o.source);if(!a)continue;const{protobuff:l,key:u}=a;if(s.type!==ng.SYMBOL){const c=1<=10*c||de&&de<=10*u)continue;const pe=e.getFeatureInflatedBounds(Q,u,v.extent,B);pe==null||pe[0]>L||pe[1]>k||pe[2]h.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(u.from,u.to).map(h=>h.vtlSymbol),n,l)}return e}_addSymbolsAttributes(e,t,r,n){const s=this._styleRepository.layers,o=n.key,a=this.tileKey,l=1<{const{attributes:p,tilePoint:m}=h;e.push({layerId:s[r].id,layerIndex:r,graphic:new Us({attributes:p,origin:{type:"vector-tile",layerId:s[r].id,layerIndex:r,layer:this._parentLayer}}),tilePoint:m})})}_getSymbolAttributes(e,t,r,n,s,o){const a=[],l=this._styleRepository.layers;let u=0;t.sort((h,p)=>h.featureIndex-p.featureIndex);const c=new g3(new Uint8Array(e),new DataView(e));for(;c.next();)switch(c.tag()){case 3:{const h=c.getMessage(),p=new BBe(h);if(h.release(),p.name!==l[r].sourceLayer)continue;const m=p.getData(),v=p.extent/n,w=q1t/v,S=v*o,I=v*s;let R=0;for(;m.nextTag(2);){const L=m.getMessage();if(R++===t[u].featureIndex){const k=new $Be(L,p),B=k.values,$=k.getGeometry(),V=$!=null?[w*($[0][0].x-S),w*($[0][0].y-I)]:null;a.push({attributes:B,tilePoint:V}),u++}if(L.release(),u===t.length)return a}break}default:c.skip()}return a}_queryIndex(e,t,r,n,s,o){const a=gwn*n*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:r-a,maxX:t+a,maxY:r+a},l=>{const{layer:u,feature:c}=l;u.isIntersectingFeature(t,r,n,c,s,o,l)&&e.push({layerId:u.id,layerIndex:u.uid,tilePoint:null,graphic:new Us({attributes:c.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return qh(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}};const bwn=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});let Y1t=class extends ak{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=Tc.pool.acquire(e),r=t.level===0?null:Tc.getId(t.level-1,t.row>>1,t.col>>1,t.world);return Tc.pool.release(t),r}getTileCoverage(e,t,r=!0,n){const s=super.getTileCoverage(e,t,r,n);if(!s)return s;const o=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let r,n;for(let s=0;sn.scale)return r=t[s],r.level+(r.scale-e)/(r.scale-n.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}));else{const r=this.tileInfo.size[0],n=this.tileInfo.spatialReference;t=fu.create({size:r,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let r=0;rp.tileKey.id===h.id)));return await Promise.all(u),c}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new Ybe(e),this._tileInfoView=new Y1t(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new mwn(this._tileInfoView),this._tileHandler=new Bbn(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",t=>{if(t.isDataDriven)this._styleChanges.push({type:uf.PAINTER_CHANGED,data:t}),this.requestUpdate();else{const r=this._styleRepository,n=r.getLayerById(t.layer);if(!n)return;const s=n.type===bl.SYMBOL;r.setPaintProperties(t.layer,t.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",t=>{const r=this._styleRepository,n=r.getLayerById(t.layer);if(!n)return;const s=nB(n.layout,t.layout);if(s!=null){if(Aie(s,"visibility")&&wwn(s)===1)return r.setLayoutProperties(t.layer,t.layout),n.type===bl.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:uf.LAYOUT_CHANGED,data:t}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",t=>{const r=this._styleRepository,n=r.getLayerById(t.layer);n&&(r.setStyleLayerVisibility(t.layer,t.visibility),n.type===bl.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",t=>{this._styleChanges.push({type:uf.LAYER_CHANGED,data:t}),this.requestUpdate()}),this.layer.on("delete-style-layer",t=>{this._styleChanges.push({type:uf.LAYER_REMOVED,data:t}),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",t=>{this._styleChanges.push({type:uf.SPRITES_CHANGED,data:t});const r=this._styleRepository.layers;for(const n of r)switch(n.type){case bl.SYMBOL:n.getLayoutProperty("icon-image")&&this._styleChanges.push({type:uf.LAYOUT_CHANGED,data:{layer:n.id,layout:n.layout}});break;case bl.LINE:n.getPaintProperty("line-pattern")&&this._styleChanges.push({type:uf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}});break;case bl.FILL:n.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:uf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=zo(this._vectorTileContainer),this._tileHandler=zo(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Ya(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const r=this.view.scale,{minScale:n,maxScale:s}=t.layerDefinition;t?.layerDefinition&&(n&&nr&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>{t.once("attach",()=>this.requestUpdate()),t.setData(r),this.requestUpdate()}).catch(r=>{mo(r)||di.getLogger(this).error(r)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new z1t({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new LW({tileInfoView:this._tileInfoView,process:(r,n)=>this._getTileData(r,n),concurrency:15}),this._parseQueue=new LW({tileInfoView:this._tileInfoView,process:(r,n)=>this._parseTileData(r,n),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(r=>{this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=zo(this._fetchQueue),this._parseQueue=zo(this._parseQueue),this._tileManager=zo(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(o){di.getLogger(this).error("error applying vector-tiles style update",o.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,r=new Set;e.forEach(o=>{if(o.type!==uf.LAYER_REMOVED)return;const a=o.data,l=t.getLayerById(a.layer);l&&r.add(l.uid)});const n=new Set;e.forEach(o=>{let a;switch(o.type){case uf.PAINTER_CHANGED:t.setPaintProperties(o.data.layer,o.data.paint),a=o.data.layer;break;case uf.LAYOUT_CHANGED:t.setLayoutProperties(o.data.layer,o.data.layout),a=o.data.layer;break;case uf.LAYER_REMOVED:return void t.deleteStyleLayer(o.data.layer);case uf.LAYER_CHANGED:t.setStyleLayer(o.data.layer,o.data.index),a=o.data.layer.id;break;case uf.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(a){const l=t.getLayerById(a);l&&n.add(l.uid)}});const s=this._vectorTileContainer.children;if(r.size>0){const o=Array.from(r);this._vectorTileContainer.deleteStyleLayers(o);for(const a of s)a.deleteLayerData(o)}if(this._fetchQueue.resume(),this._parseQueue.resume(),n.size>0){const o=Array.from(n),a=[];for(const l of s){const u=this._updatingHandles.addPromise(this._fetchQueue.push(l.key).then(c=>this._parseQueue.push({key:l.key,data:c,styleLayerUIDs:o})).then(c=>l.setData(c)));a.push(u)}await Promise.all(a)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=li(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._styleRepository=new Ybe(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!mo(o))throw o}if(r.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,void this.requestUpdate();const n=await this._tileHandler.spriteMosaic,s=this._vectorTileContainer;this._tileInfoView=new Y1t(this.layer.tileInfo,this.layer.fullExtent),s.setStyleResources(n,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new z1t({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),r=this._tileInfoView.getTileResolution(e.level);return new twn(e,r,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,r,n,s,o){if(s.layerData.size===0)return;const a=this._ensureTileIndex(s),l=this._tileInfoView.getTileBounds(Wo(),s.key,!0),u=X1t*J1t*((t.x-l[0])/(l[2]-l[0])),c=X1t*J1t*(1-(t.y-l[1])/(l[3]-l[1])),h=await a.queryAttributes(u,c,r,n,o);for(const p of h)p.graphic.geometry=this._tileToMapPoint(p.tilePoint,s.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:p.graphic,mapPoint:t.clone()});e.sort((p,m)=>m.graphic.origin.layerIndex-p.graphic.origin.layerIndex)}_tileToMapPoint(e,t){if(!e)return null;const r=e[0]*t[0]+e[1]*t[3]+t[6],n=e[0]*t[1]+e[1]*t[4]+t[7],s=this.view.state,o=[0,0];return s.toMap(o,[r,n]),new $i({x:o[0],y:o[1],spatialReference:s.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=_wn.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}};function wwn(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}x([D()],e0e.prototype,"_isTileHandlerReady",void 0),e0e=x([Qe("esri.views.2d.layers.VectorTileLayerView2D")],e0e);const xwn=e0e,Swn=Object.freeze(Object.defineProperty({__proto__:null,default:xwn},Symbol.toStringTag,{value:"Module"}));let q4=class extends xs(Ci){constructor(e){super(e),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};x([D({type:Boolean})],q4.prototype,"frameCenter",void 0),x([D({type:Boolean})],q4.prototype,"frameOutline",void 0),x([D({type:Boolean})],q4.prototype,"lineOfSight",void 0),x([D({type:Boolean})],q4.prototype,"sensorLocation",void 0),x([D({type:Boolean})],q4.prototype,"sensorTrail",void 0),q4=x([Qe("esri.layers.support.TelemetryDisplay")],q4);const LXt=q4,rG=new jr([255,127,0]);let r6=class extends Lm(Nm){constructor(){super(...arguments),this._graphicsLayer=new nHe,this._frameOutlineGraphic=new Us({symbol:{type:"simple-fill",outline:{type:"simple-line",color:rG}}}),this._sensorTrailGraphic=new Us({symbol:{type:"simple-line",color:rG}}),this._lineOfSightGraphic=new Us({symbol:{type:"simple-line",color:rG}}),this._sensorLocationGraphic=new Us({symbol:{type:"simple-marker",color:rG}}),this._frameCenterGraphic=new Us({symbol:{type:"simple-marker",color:rG}}),this.layer=null,this.symbolColor=rG,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=zo(this._graphicsLayer)}initialize(){this.addHandles(Ki(()=>this.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},js)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new LXt({frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this.graphicsView=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([Ki(()=>[this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),js),Ki(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),js)])}detach(){this.container.removeAllChildren(),this.graphicsView=zo(this.graphicsView)}supportsSpatialReference(e){return!0}moveStart(){}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}};x([D()],r6.prototype,"graphicsView",void 0),x([D()],r6.prototype,"layer",void 0),x([D()],r6.prototype,"symbolColor",void 0),x([D({type:LXt})],r6.prototype,"visibleTelemetryElements",void 0),r6=x([Qe("esri.views.2d.layers.VideoLayerView2D")],r6);const Twn=r6,Cwn=Object.freeze(Object.defineProperty({__proto__:null,default:Twn},Symbol.toStringTag,{value:"Module"})),Ewn=i=>{let e=class extends i{initialize(){this.exportImageParameters=new QI({layer:this.layer})}destroy(){this.exportImageParameters=zo(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n;if(!s)throw new qe("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:s});const o=this.createFetchPopupFeaturesQuery(t);if(!o)return[];const{extent:a,width:l,height:u,x:c,y:h}=o;if(!(a&&l&&u))throw new qe("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:a,width:l,height:u});const p=await n.fetchFeatureInfo(a,l,u,c,h);return hn(r),p}};return x([D()],e.prototype,"exportImageParameters",void 0),x([D({readOnly:!0})],e.prototype,"exportImageVersion",null),x([D()],e.prototype,"layer",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),e=x([Qe("esri.layers.mixins.WMSLayerView")],e),e};let Ete=class extends Ewn(hL(Lm(Nm))){constructor(){super(...arguments),this.bitmapContainer=new Bq}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this.bitmapContainer=new Bq,this.container.addChild(this.bitmapContainer),this.strategy=new KCe({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(Ki(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=zo(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:r}=this,{x:n,y:s}=e,{spatialReference:o}=t;let a,l=0,u=0;if(r.children.some(m=>{const{width:v,height:w,resolution:S,x:I,y:R}=m,L=I+S*v,k=R-S*w;return n>=I&&n<=L&&s<=R&&s>=k&&(a=new hr({xmin:I,ymin:k,xmax:L,ymax:R,spatialReference:o}),l=v,u=w,!0)}),!a)return null;const c=a.width/l,h=Math.round((n-a.xmin)/c),p=Math.round((a.ymax-s)/c);return{extent:a,width:l,height:u,x:h,y:p}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,n){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,...n})}};x([D()],Ete.prototype,"strategy",void 0),x([D()],Ete.prototype,"updating",void 0),Ete=x([Qe("esri.views.2d.layers.WMSLayerView2D")],Ete);const Iwn=Ete,Awn=Object.freeze(Object.defineProperty({__proto__:null,default:Iwn},Symbol.toStringTag,{value:"Module"})),Mwn=new Set([102113,102100,3857,3785,900913]),Own=[0,0];let t0e=class extends hL(iXt(Lm(Nm))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new ak(e),this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:16,process:(t,r)=>this.fetchTile(t,r)}),this._tileStrategy=new Qne({cachePolicy:"keep",resampling:!0,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>Ya(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),r=t.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(Own,t.key),r.resolution=this._tileInfoView.getTileResolution(t.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=t;if(!r)return this._fetchImage(e,n);const o=new Tc(0,0,0,0);let a;try{await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:n}),a=await this._fetchImage(o,n)}catch(l){if(mo(l))throw l;if(s<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const c=new Tc(u),h=await this.fetchTile(c,{...t,resamplingLevel:s+1});return lwe(this._tileInfoView,h,c,e)}}throw l}return lwe(this._tileInfoView,a,o,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){mo(t)||di.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let r=e.tileMatrixSets.find(n=>Ya(n.tileInfo?.spatialReference,t));return!r&&t.isWebMercator&&(r=e.tileMatrixSets.find(n=>Mwn.has(n.tileInfo?.spatialReference.wkid??-1))),r}};x([D({readOnly:!0})],t0e.prototype,"tileMatrixSet",null),t0e=x([Qe("esri.views.2d.layers.WMTSLayerView2D")],t0e);const Pwn=t0e,Rwn=Object.freeze(Object.defineProperty({__proto__:null,default:Pwn},Symbol.toStringTag,{value:"Module"}));var _9={},NXt={},EP={};Object.defineProperty(EP,"__esModule",{value:!0}),EP.loop=EP.conditional=EP.parse=void 0;var Dwn=function i(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(t))t.forEach(function(o){return i(e,o,r,n)});else if(typeof t=="function")t(e,r,n,i);else{var s=Object.keys(t)[0];Array.isArray(t[s])?(n[s]={},i(e,t[s],r,n[s])):n[s]=t[s](e,r,n,i)}return r};EP.parse=Dwn;var Fwn=function(i,e){return function(t,r,n,s){e(t,r,n)&&s(t,i,r,n)}};EP.conditional=Fwn;var kwn=function(i,e){return function(t,r,n,s){for(var o=[],a=t.pos;e(t,r,n);){var l={};if(s(t,i,r,l),t.pos===a)break;a=t.pos,o.push(l)}return o}};EP.loop=kwn;var pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.readBits=pf.readArray=pf.readUnsigned=pf.readString=pf.peekBytes=pf.readBytes=pf.peekByte=pf.readByte=pf.buildStream=void 0;var Lwn=function(i){return{data:i,pos:0}};pf.buildStream=Lwn;var $Xt=function(){return function(i){return i.data[i.pos++]}};pf.readByte=$Xt;var Nwn=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+i]}};pf.peekByte=Nwn;var tEe=function(i){return function(e){return e.data.subarray(e.pos,e.pos+=i)}};pf.readBytes=tEe;var $wn=function(i){return function(e){return e.data.subarray(e.pos,e.pos+i)}};pf.peekBytes=$wn;var Bwn=function(i){return function(e){return Array.from(tEe(i)(e)).map(function(t){return String.fromCharCode(t)}).join("")}};pf.readString=Bwn;var jwn=function(i){return function(e){var t=tEe(2)(e);return i?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};pf.readUnsigned=jwn;var Gwn=function(i,e){return function(t,r,n){for(var s=typeof e=="function"?e(t,r,n):e,o=tEe(i),a=new Array(s),l=0;l=m){var S=m-c.pos;p.push((0,t.readBytes)(S)(c)),v+=S;break}p.push((0,t.readBytes)(w)(c)),v+=w}for(var I=new Uint8Array(v),R=0,L=0;L>=o,v-=o,c>r||c==a)break;if(c==n){s=(1<<(o=p+1))-1,r=n+2,u=k;continue}if(u==k){K[S++]=Y[c],u=c,w=c;continue}for(l=c,c==r&&(K[S++]=w,c=u);c>n;)K[S++]=Y[c],c=V[c];w=255&Y[c],K[S++]=w,ra[c],width:n,height:s}}function rxn(i){return zK??=document.createElement("canvas"),K1t??=zK.getContext("2d",{willReadFrequently:!0}),zK.width=i.width,zK.height=i.height,K1t.putImageData(i,0,0),zK}BXt=_9.decompressFrames=exn;const nxn=[71,73,70];function UXt(i){const e=new Uint8Array(i);return!nxn.some((t,r)=>t!==e[r])}function sxn(i){if(!UXt(i))return!1;const e=new DataView(i),t=e.getUint8(10);let r=13+(128&t?3*2**(1+(7&t)):0),n=0,s=!1;for(;!s;){switch(e.getUint8(r++)){case 33:if(!o())return!1;break;case 44:a();break;case 59:s=!0;break;default:return!1}if(n>1)return!0}function o(){switch(e.getUint8(r++)){case 249:l();break;case 1:u();break;case 254:c();break;case 255:h();break;default:return!1}return!0}function a(){n++,r+=8;const m=e.getUint8(r++);r+=128&m?3*2**(1+(7&m)):0,r++,p()}function l(){r++,r+=4,p()}function u(){n++,r++,r+=12,p()}function c(){p()}function h(){r++,r+=8,r+=3,p()}function p(){let m;for(;m=e.getUint8(r++);)r+=m}return!1}const oxn=Object.freeze(Object.defineProperty({__proto__:null,isAnimatedGIF:sxn,isGIF:UXt,parseGif:ixn},Symbol.toStringTag,{value:"Module"}));var Z1t,zXt={exports:{}};Z1t=function(){return function(i){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={exports:{},id:r,loaded:!1};return i[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}return t.m=i,t.c=e,t.p="",t(0)}([function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=l,e.isNotAPNG=u,e.default=h;var r=s(t(1)),n=t(2);function s(R){return R&&R.__esModule?R:{default:R}}var o=new Error("Not a PNG"),a=new Error("Not an animated PNG");function l(R){return R===o}function u(R){return R===a}var c=new Uint8Array([137,80,78,71,13,10,26,10]);function h(R){var L=new Uint8Array(R);if(Array.prototype.some.call(c,function(de,pe){return de!==L[pe]}))return o;var k=!1;if(p(L,function(de){return!(k=de==="acTL")}),!k)return a;var B=[],$=[],V=null,Y=null,K=0,Q=new n.APNG;if(p(L,function(de,pe,H,Z){var ae=new DataView(pe.buffer);switch(de){case"IHDR":V=pe.subarray(H+8,H+8+Z),Q.width=ae.getUint32(H+8),Q.height=ae.getUint32(H+12);break;case"acTL":Q.numPlays=ae.getUint32(H+8+4);break;case"fcTL":Y&&(Q.frames.push(Y),K++),(Y=new n.Frame).width=ae.getUint32(H+8+4),Y.height=ae.getUint32(H+8+8),Y.left=ae.getUint32(H+8+12),Y.top=ae.getUint32(H+8+16);var fe=ae.getUint16(H+8+20),be=ae.getUint16(H+8+22);be===0&&(be=100),Y.delay=1e3*fe/be,Y.delay<=10&&(Y.delay=100),Q.playTime+=Y.delay,Y.disposeOp=ae.getUint8(H+8+24),Y.blendOp=ae.getUint8(H+8+25),Y.dataParts=[],K===0&&Y.disposeOp===2&&(Y.disposeOp=1);break;case"fdAT":Y&&Y.dataParts.push(pe.subarray(H+8+4,H+8+Z));break;case"IDAT":Y&&Y.dataParts.push(pe.subarray(H+8,H+8+Z));break;case"IEND":$.push(w(pe,H,12+Z));break;default:B.push(w(pe,H,12+Z))}}),Y&&Q.frames.push(Y),Q.frames.length==0)return a;var re=new Blob(B),ne=new Blob($);return Q.frames.forEach(function(de){var pe=[];pe.push(c),V.set(I(de.width),0),V.set(I(de.height),4),pe.push(S("IHDR",V)),pe.push(re),de.dataParts.forEach(function(H){return pe.push(S("IDAT",H))}),pe.push(ne),de.imageData=new Blob(pe,{type:"image/png"}),delete de.dataParts,pe=null}),Q}function p(R,L){var k=new DataView(R.buffer),B=8,$=void 0,V=void 0,Y=void 0;do V=k.getUint32(B),Y=L($=m(R,B+4,4),R,B,V),B+=12+V;while(Y!==!1&&$!="IEND"&&B>>24&255,R>>>16&255,R>>>8&255,255&R])}},function(i,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=-1,u=a,c=a+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.length-a);u>>8^t[255&(l^o[u])];return-1^l};for(var t=new Uint32Array(256),r=0;r<256;r++){for(var n=r,s=0;s<8;s++)n=1&n?3988292384^n>>>1:n>>>1;t[r]=n}},function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(){function a(l,u){for(var c=0;c1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new n.default(u,l,c)})}}]),a}(),e.Frame=function(){function a(){o(this,a),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return r(a,[{key:"createImage",value:function(){var l=this;return this.imageElement?Promise.resolve():new Promise(function(u,c){var h=URL.createObjectURL(l.imageData);l.imageElement=document.createElement("img"),l.imageElement.onload=function(){URL.revokeObjectURL(h),u()},l.imageElement.onerror=function(){URL.revokeObjectURL(h),l.imageElement=null,c(new Error("Image creation error"))},l.imageElement.src=h})}}]),a}()},function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function u(c,h){for(var p=0;p=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var h=this.currentFrame;this._prevFrame=h,this._prevFrameData=null,h.disposeOp==2&&(this._prevFrameData=this.context.getImageData(h.left,h.top,h.width,h.height)),h.blendOp==0&&this.context.clearRect(h.left,h.top,h.width,h.height),this.context.drawImage(h.imageElement,h.left,h.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var h=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var p=performance.now()+this.currentFrame.delay/this.playbackRate,m=function v(w){if(!h._ended&&!h._paused){if(w>=p){for(;w-p>=h._apng.playTime/h.playbackRate;)p+=h._apng.playTime/h.playbackRate,h._numPlays++;do h.renderNextFrame(),p+=h.currentFrame.delay/h.playbackRate;while(!h._ended&&w>p)}requestAnimationFrame(v)}};requestAnimationFrame(m)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),c}(n(t(4)).default);e.default=l},function(i,e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(a){return typeof a=="function"}function n(a){return typeof a=="number"}function s(a){return typeof a=="object"&&a!==null}function o(a){return a===void 0}i.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(a){if(!n(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},t.prototype.emit=function(a){var l,u,c,h,p,m;if(this._events||(this._events={}),a==="error"&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((l=arguments[1])instanceof Error)throw l;var v=new Error('Uncaught, unspecified "error" event. ('+l+")");throw v.context=l,v}if(o(u=this._events[a]))return!1;if(r(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),u.apply(this,h)}else if(s(u))for(h=Array.prototype.slice.call(arguments,1),c=(m=u.slice()).length,p=0;p0&&this._events[a].length>u&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(a,l){if(!r(l))throw TypeError("listener must be a function");var u=!1;function c(){this.removeListener(a,c),u||(u=!0,l.apply(this,arguments))}return c.listener=l,this.on(a,c),this},t.prototype.removeListener=function(a,l){var u,c,h,p;if(!r(l))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(h=(u=this._events[a]).length,c=-1,u===l||r(u.listener)&&u.listener===l)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,l);else if(s(u)){for(p=h;p-- >0;)if(u[p]===l||u[p].listener&&u[p].listener===l){c=p;break}if(c<0)return this;u.length===1?(u.length=0,delete this._events[a]):u.splice(c,1),this._events.removeListener&&this.emit("removeListener",a,l)}return this},t.prototype.removeAllListeners=function(a){var l,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(l in this._events)l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events={},this}if(r(u=this._events[a]))this.removeListener(a,u);else if(u)for(;u.length;)this.removeListener(a,u[u.length-1]);return delete this._events[a],this},t.prototype.listeners=function(a){return this._events&&this._events[a]?r(this._events[a])?[this._events[a]]:this._events[a].slice():[]},t.prototype.listenerCount=function(a){if(this._events){var l=this._events[a];if(r(l))return 1;if(l)return l.length}return 0},t.listenerCount=function(a,l){return a.listenerCount(l)}}])},zXt.exports=Z1t();const axn=Cg(zXt.exports);async function lxn(i,e){const t=axn(i);if(t instanceof Error)throw t;await t.createImages(),hn(e);const{frames:r,width:n,height:s}=t,o=document.createElement("canvas");o.width=n,o.height=s;const a=o.getContext("2d",{willReadFrequently:!0}),l=[],u=[];let c=0;for(const h of r){const p=h.delay||100;u.push(p),c+=p;const m=h.imageElement;h.blendOp===0?a.globalCompositeOperation="copy":a.globalCompositeOperation="source-over";const v=h.disposeOp===2?a.getImageData(h.left,h.top,h.width,h.height):void 0;a.drawImage(m,h.left,h.top);const w=a.getImageData(0,0,n,s);l.push(w),h.disposeOp===0||(h.disposeOp===1?a.clearRect(h.left,h.top,h.width,h.height):h.disposeOp===2&&a.putImageData(v,h.left,h.top))}return{frameCount:r.length,duration:c,frameDurations:u,getFrame:h=>l[h],width:n,height:s}}const uxn=[137,80,78,71,13,10,26,10];function VXt(i){const e=new Uint8Array(i);return!uxn.some((t,r)=>t!==e[r])}function cxn(i){if(!VXt(i))return!1;const e=new DataView(i),t=new Uint8Array(i);let r,n=8;do{const s=e.getUint32(n);if(r=String.fromCharCode.apply(String,Array.prototype.slice.call(t.subarray(n+4,n+8))),r==="acTL")return!0;n+=12+s}while(r!=="IEND"&&nthis._width||t>this._height)return new _d;let r=null,n=-1;for(let s=0;se&&this._free.push(new _d(r.x+e,r.y,r.width-e,t)),r.height>t&&this._free.push(new _d(r.x,r.y+t,r.width,r.height-t))):(r.width>e&&this._free.push(new _d(r.x+e,r.y,r.width-e,r.height)),r.height>t&&this._free.push(new _d(r.x,r.y+t,e,r.height-t))),new _d(r.x,r.y,e,t))}release(e){for(let t=0;t{const u=e+l;if(this._rangePromises.has(u))a.push(this._rangePromises.get(u));else{const c=n.getRange(e,l).then(()=>{this._rangePromises.delete(u)},()=>{this._rangePromises.delete(u)});this._rangePromises.set(u,c),a.push(c)}}),Promise.all(a).then(()=>{let l=this._glyphIndex[e];l||(l={},this._glyphIndex[e]=l);for(const u of t){const c=l[u];if(c){r[u]={sdf:!0,rect:c.rect,metrics:c.metrics,page:c.page,code:u};continue}const h=n.getGlyph(e,u);if(!h?.metrics)continue;const p=h.metrics;let m;if(p.width===0)m=new _d(0,0,0,0);else{const w=p.width+6,S=p.height+2*3;let I=w%4?4-w%4:4,R=S%4?4-S%4:4;I===1&&(I=5),R===1&&(R=5),m=this._binPack.allocate(w+I,S+R),m.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new Ore(this.width-4,this.height-4),m=this._binPack.allocate(w+I,S+R));const L=this._glyphData[this._currentPage],k=h.bitmap;let B,$;if(k)for(let V=0;V{r.addRange(t,new _Re(new g3(new Uint8Array(a.data),new DataView(a.data))))}).catch(()=>{r.addRange(t,new _Re)})}return r.addRange(t,new _Re),Promise.resolve()}getGlyph(e,t){const r=this._getFontStack(e);if(!r)return;const n=Math.floor(t/256),s=r.getRange(n);return s?{metrics:s.getMetrics(t),bitmap:s.getBitmap(t)}:void 0}_getFontStack(e){let t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new Dbn),t}},Fbn=class{constructor(e,t,r){this._array=e,this._start=t,this.length=r}at(e){return 0<=e&&e0&&(this._maxItemSize=r),this._binPack=new Ore(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new Ore(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),r=Math.floor(this._pageHeight),n=new Uint32Array(t*r);this._mosaicsData[0]=n,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let r,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(kbn)?([r,n]=this._rasterizeDash(e),t=!0):r=this._sprites.getSpriteInfo(e),!r?.width||!r.height||r.width<0||r.height<0))return null;const o=r.width,a=r.height,[l,u,c]=this._allocateImage(o,a);return l.width<=0?null:(this._copy(l,r,u,c,t,n),s={type:"sprite",rect:l,width:o,height:a,sdf:r.sdf,simplePattern:!1,rasterizationScale:r.pixelRatio,page:u},this._mosaicRects[e]=s,s)}getSpriteItems(e){const t={};for(const r of e)t[r.name]=this.getSpriteItem(r.name,r.repeat);return t}getMosaicItemPosition(e,t){const r=this.getSpriteItem(e,t),n=r&&r.rect;if(!n)return null;n.width=r.width,n.height=r.height;const s=r.width,o=r.height,a=2;return{tl:[n.x+a,n.y+a],br:[n.x+a+s,n.y+a+o],page:r.page}}bind(e,t,r=0,n=0){if(r>=this._size.length||r>=this._mosaicsData.length)return;if(!this._textures[r]){const o=new Ua;o.wrapMode=Ls.CLAMP_TO_EDGE,o.width=this._size[r][0],o.height=this._size[r][1],this._textures[r]=new fl(e,o,new Uint8Array(this._mosaicsData[r].buffer))}const s=this._textures[r];s.setSamplingMode(t),this._dirties[r]&&s.setData(new Uint8Array(this._mosaicsData[r].buffer)),e.bindTexture(s,n),this._dirties[r]=!1}static _copyBits(e,t,r,n,s,o,a,l,u,c,h){let p=n*t+r,m=l*o+a;if(h){m-=o;for(let v=-1;v<=c;v++,p=((v+c)%c+n)*t+r,m+=o)for(let w=-1;w<=u;w++)s[m+w]=e[p+(w+u)%u]}else for(let v=0;v=this._mosaicsData.length)return;const a=new Uint32Array(o?o.buffer:this._sprites.image.buffer),l=this._mosaicsData[r];l&&a||console.error("Source or target images are uninitialized!");const u=2,c=o?t.width:this._sprites.width;RXt._copyBits(a,c,t.x,t.y,l,n[0],e.x+u,e.y+u,t.width,t.height,s),this._dirties[r]=!0}_allocateImage(e,t){e+=2,t+=2;const r=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const t=this._layer.currentStyleInfo.glyphsUrl,r=new j1t(t?gg(t,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new B1t(1024,1024,r),this._broadcastPromise=$R("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{if(this._layer&&(this._connection?.close(),this._connection=n,this._layer&&!this._connection.closed)){const s=n.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},e);Promise.all(s).catch(o=>l3(o))}})}_requestSprite(e){this._spriteSourceAbortController?.abort();const t=new AbortController;this._spriteSourceAbortController=t;const r=e?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,r&&(this._inputSignalEventListener=Nbn(t),r.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:n}=t,s={...e,signal:n};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,s),this._spriteSourcePromise.then(o=>{_a(n),this._spriteMosaic=new G1t(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const t=new G1t(1024,1024,250);return t.setSpriteSource(e),this._spriteMosaic=t,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,t}async setStyle(e,t,r){await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=r,this._requestSprite();const n=new j1t(this._layer.currentStyleInfo.glyphsUrl?gg(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new B1t(1024,1024,n),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:t,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,t){const r=await this._getRefKeys(e,t);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),r,t)}async fetchTilePBFs(e){const t=Object.keys(this._layer.sourceNameToSource),r={},n=await this._getRefKeys(e,r),s=[],o=[];for(let a=0;a{s.push({...c,key:l})}),o.push(u)}return Promise.all(o).then(()=>s)}async parseTileData(e,t){const r=e&&e.data;if(!r)return null;const{sourceName2DataAndRefKey:n,transferList:s}=r;return Object.keys(n).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...t,transferList:s}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,t,r){const n=Tc.pool.acquire(e.id),s=this._layer.sourceNameToSource[t],{level:o,row:a,col:l}=n;Tc.pool.release(n);try{return{protobuff:await s.requestTile(o,a,l,r),sourceName:t}}catch(u){if(mo(u))throw u;return{protobuff:null,sourceName:t}}}async _getRefKeys(e,t){const r=this._layer.sourceNameToSource,n=new Array;for(const s in r){const o=r[s].getRefKey(e,t);n.push(o)}return g0(n)}_getSourcesData(e,t,r){const n=[];for(let s=0;s{const o={},a=[];for(let l=0;l0){const c=t[l].value.id;o[u.sourceName]={refKey:c,protobuff:u.protobuff},a.push(u.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:a}})}};function Nbn(i){return()=>i.abort()}const U1t=512,$bn=1e-6,Bbn=(i,e)=>i+1/(1<<2*e);let z1t=class{constructor(e,t){this._tiles=new Map,this._tileCache=new d3(40,r=>r.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=t}destroy(){for(const[e,t]of this._tiles)t.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const t=this.tileInfoView,r=t.getTileCoverage(e.state,0,!0,"smallest");if(!r)return!0;const{spans:n,lodInfo:s}=r,{level:o}=s,a=this._tiles,l=new Set,u=new Set;for(const{row:h,colFrom:p,colTo:m}of n)for(let v=p;v<=m;v++){const w=Tc.getId(o,h,s.normalizeCol(v),s.getWorldForColumn(v)),S=this._getOrAcquireTile(w);l.add(w),S.processed()?this._addToContainer(S):u.add(new Tc(w))}for(const[h,p]of a)p.isCoverage=l.has(h);for(const h of u)this._findPlaceholdersForMissingTiles(h,l);let c=!1;for(const[h,p]of a)p.neededForCoverage=l.has(h),p.neededForCoverage||p.isHoldingForFade&&t.intersects(r,p.key)&&l.add(h),p.isFading&&(c=!0);for(const[h,p]of this._tiles)l.has(h)||this._releaseTile(h);return dB.pool.release(r),!c}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,t,r,n,s){const o=[0,0],a=[0,0];n.toMap(o,e-r,t+r),n.toMap(a,e+r,t-r);const l=Math.min(o[0],a[0]),u=Math.min(o[1],a[1]),c=Math.max(o[0],a[0]),h=Math.max(o[1],a[1]),p=cW(l,u,c,h),m=Wo(),v=[];for(const[w,S]of this._visibleTiles)this.tileInfoView.getTileBounds(m,S.key),aae(p,m)&&v.push(S);if(s!=null&&s.length>0){const w=new Set(v.map(I=>I.id)),S=s.filter(I=>!w.has(I.tileKey.id)).map(I=>this._visibleTiles.get(I.tileKey.id)).filter(I=>I!==void 0);v.push(...S)}return v}_findPlaceholdersForMissingTiles(e,t){const r=[];for(const[s,o]of this._tiles)this._addPlaceholderChild(r,o,e,t);const n=r.reduce(Bbn,0);Math.abs(1-n)<$bn||this._addPlaceholderParent(e.id,t)}_addPlaceholderChild(e,t,r,n){t.key.level<=r.level||!t.hasData()||Gbn(r,t.key)&&(this._addToContainer(t),n.add(t.id),e.push(t.key.level-r.level))}_addPlaceholderParent(e,t){const r=this._tiles;let n=e;for(;;){if(n=jbn(n),!n||t.has(n))return;const s=r.get(n);if(s&&s.hasData())return this._addToContainer(s),void t.add(s.id)}}_getOrAcquireTile(e){let t=this._tiles.get(e);return t||(t=this._tileCache.pop(e),t||(t=this.acquireTile(new Tc(e))),this._tiles.set(e,t),t)}_releaseTile(e){const t=this._tiles.get(e);this.releaseTile(t),this._removeFromContainer(t),this._tiles.delete(e),t.hasData()?this._tileCache.put(e,t,1):t.dispose()}_addToContainer(e){let t;const r=[],n=this._container;if(n.contains(e))return;const s=this._visibleTiles;for(const[o,a]of s)this._canConnectDirectly(e,a)&&r.push(a),t==null&&this._canConnectDirectly(a,e)&&(t=a);if(t!=null){for(const o of r)t.childrenTiles.delete(o),e.childrenTiles.add(o),o.parentTile=e;t.childrenTiles.add(e),e.parentTile=t}else for(const o of r)e.childrenTiles.add(o),o.parentTile=e;s.set(e.id,e),n.addChild(e)}_removeFromContainer(e){if(this._visibleTiles.delete(e.id),this._container.removeChild(e),e.parentTile!=null){e.parentTile.childrenTiles.delete(e);for(const t of e.childrenTiles)e.parentTile!=null&&e.parentTile.childrenTiles.add(t)}for(const t of e.childrenTiles)t.parentTile=e.parentTile;e.parentTile=null,e.childrenTiles.clear()}_canConnectDirectly(e,t){const r=e.key;let{level:n,row:s,col:o,world:a}=t.key;const l=this._visibleTiles;for(;n>0;){if(n--,s>>=1,o>>=1,r.level===n&&r.row===s&&r.col===o&&r.world===a)return!0;if(l.has(`${n}/${s}/${o}/${a}`))return!1}return!1}_updateCacheSize(e){const t=e.state.size;if(t[0]===this._viewSize[0]&&t[1]===this._viewSize[1])return;const r=Math.ceil(t[0]/U1t)+1,n=Math.ceil(t[1]/U1t)+1;this._viewSize[0]=t[0],this._viewSize[1]=t[1],this._tileCache.maxSize=5*r*n}};function jbn(i){const[e,t,r,n]=i.split("/"),s=parseInt(e,10);return s===0?null:`${s-1}/${parseInt(t,10)>>1}/${parseInt(r,10)>>1}/${parseInt(n,10)}`}function Gbn(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Ubn=class{constructor(e,t){this.sourceTile=t,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},zbn=class{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}};function V1t(i,e,t,r,n,s){const o=t-n;if(o>=0)return(e>>o)+(r-(s<>o);const a=-o;return e-(s-(r<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=ba(this.vao)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=this.layer.lineMaterial;this.vao=new wh(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:a},u)}},Xbn=class extends eEe{constructor(e,t){super(e,t),this.type=ng.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.fillIndexStart=r[n++],this.fillIndexCount=r[n++],this.outlineIndexStart=r[n++],this.outlineIndexCount=r[n++];const s=r[n++];if(s>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=ba(this.fillVAO),this.outlineVAO=ba(this.outlineVAO)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=n[r++],h=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const p=n[r++],m=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,p));r+=p;const v=this.layer,w=v.fillMaterial,S=v.outlineMaterial;this.fillVAO=new wh(e,w.getAttributeLocations(),w.getLayoutInfo(),{geometry:a},u),this.outlineVAO=new wh(e,S.getAttributeLocations(),S.getLayoutInfo(),{geometry:h},m)}},Jbn=class extends eEe{constructor(e,t,r){super(e,t),this.type=ng.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const n=new Uint32Array(e),s=new Int32Array(e),o=new Float32Array(e);let a=this.bufferDataOffset;this.isIconSDF=!!n[a++];const l=n[a++],u=n[a++],c=n[a++],h=new Tc(l,u,c,0),p=n[a++];for(let S=0;S0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[t,r]of this.iconPerPageElementsMap)e+=r[1];for(const[t,r]of this.glyphPerPageElementsMap)e+=r[1];return e/3}doDestroy(){this.iconVAO=ba(this.iconVAO),this.textVAO=ba(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,t=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===t.usedMemory&&t.setSubData(e,0,0,e.length);const r=this.textOpacity,n=this.textVAO.vertexBuffers.opacity;r.length>0&&r.byteLength===n.usedMemory&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=n[r++],h=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,c));r+=c;const p=n[r++],m=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,p));r+=p;const v=Aa.createVertex(e,oa.STATIC_DRAW,this.iconOpacity.buffer),w=Aa.createVertex(e,oa.STATIC_DRAW,this.textOpacity.buffer),S=this.layer,I=S.iconMaterial,R=S.textMaterial;this.iconVAO=new wh(e,I.getAttributeLocations(),I.getLayoutInfo(),{geometry:a,opacity:v},u),this.textVAO=new wh(e,R.getAttributeLocations(),R.getLayoutInfo(),{geometry:h,opacity:w},m)}},Kbn=class extends eEe{constructor(e,t){super(e,t),this.type=ng.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.circleIndexStart=r[n++],this.circleIndexCount=r[n++],this.bufferDataOffset=n}get memoryUsed(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=ba(this.vao)}doPrepareForRendering(e,t,r){const n=new Uint32Array(t),s=new Int32Array(n.buffer),o=n[r++],a=Aa.createVertex(e,oa.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const l=n[r++],u=Aa.createIndex(e,oa.STATIC_DRAW,new Uint32Array(n.buffer,4*r,l));r+=l;const c=this.layer.circleMaterial;this.vao=new wh(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:a},u)}},Zbn=class FXt extends gX{constructor(e,t,r,n,s,o,a,l=null){super(e,t,r,n,s,o,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(this.featureIndex=null,Qbn.delete(this),FXt._destroyRenderBuckets(this.layerData),this.layerData.clear(),this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get usedMemory(){return this._memoryUsedByLayerData+256}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:r,emptyBuckets:n}=e,s=this._createRenderBuckets(r);if(n&&n.byteLength>0){const o=new Uint32Array(n);for(const a of o)this._deleteLayerData(a)}for(const[o,a]of s)this._deleteLayerData(o),a.type===ng.SYMBOL&&(this.symbols.set(o,a.symbols),t=!0),this._memoryUsedByLayerData+=a.memoryUsed,this.layerData.set(o,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const[r,n]of this.layerData)n.type===ng.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*t,n=this.height/this.rangeY*t,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;Jk(o),h0(o,o,s),q3(o,o,Math.PI*e.rotation/180),_R(o,o,[r,n,1])}_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc(),tileUnitsToPixels:Cc()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const r of e.values())t.has(r)||(r.destroy(),t.add(r));e.clear()}_createRenderBuckets(e){const t=new Map,r=new Map;for(const n of e){const s=this._deserializeBucket(n,r);for(const o of s.layerUIDs)t.set(o,s)}return t}_deserializeBucket(e,t){let r=t.get(e);if(r)return r;switch(new Uint32Array(e)[0]){case ng.FILL:r=new Xbn(e,this.styleRepository);break;case ng.LINE:r=new Ybn(e,this.styleRepository);break;case ng.SYMBOL:r=new Jbn(e,this.styleRepository,this);break;case ng.CIRCLE:r=new Kbn(e,this.styleRepository)}return t.set(e,r),r}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._memoryUsedByLayerData-=t.memoryUsed,t.destroy(),this.layerData.delete(e)}};const Qbn=new Map;function ewn(i,e,t,r,n,s){const{iconRotationAlignment:o,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:u,textTranslate:c,textTranslateAnchor:h}=r;let p=0;for(const m of i.colliders){const[v,w]=m.partIndex===0?l:c,S=m.partIndex===0?u:h,I=m.minLod<=s&&s<=m.maxLod;p+=I?0:1,m.enabled=I,m.xScreen=m.xTile*n[0]+m.yTile*n[3]+n[6],m.yScreen=m.xTile*n[1]+m.yTile*n[4]+n[7],S===mb.MAP?(m.xScreen+=t*v-e*w,m.yScreen+=e*v+t*w):(m.xScreen+=v,m.yScreen+=w),sc.VIEWPORT===(m.partIndex===0?o:a)?(m.dxScreen=m.dxPixels,m.dyScreen=m.dyPixels):(m.dxScreen=t*(m.dxPixels+m.width/2)-e*(m.dyPixels+m.height/2)-m.width/2,m.dyScreen=e*(m.dxPixels+m.width/2)+t*(m.dyPixels+m.height/2)-m.height/2)}i.colliders.length>0&&p===i.colliders.length&&(i.unique.show=!1)}let twn=class{constructor(e,t,r,n,s,o){this._symbols=e,this._styleRepository=n,this._zoom=s,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new DXt(t,r,Qnn),this._si=Math.sin(Math.PI*o/180),this._co=Math.cos(Math.PI*o/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,m5t(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function r(s){const o=s.xScreen+s.dxScreen,a=s.yScreen+s.dyScreen,l=o+s.width,u=a+s.height,[c,h,p,m]=t.getCellSpan(o,a,l,u);for(let v=h;v<=m;v++)for(let w=c;w<=p;w++){const S=t.cells[v][w];for(const I of S){const R=I.xScreen+I.dxScreen,L=I.yScreen+I.dyScreen,k=R+I.width,B=L+I.height;if(!(lk||uB))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const a=s.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;ewn(a,this._si,this._co,o,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:u,iconIgnorePlacement:c,textAllowOverlap:h,textIgnorePlacement:p}=o;for(const m of a.colliders){if(!m.enabled)continue;const v=l.parts[m.partIndex];v.show&&!(m.partIndex?h:u)&&r(m)&&(m.hard?l.show=!1:v.show=!1)}if(l.show)for(const m of a.colliders){if(!m.enabled||(m.partIndex?p:c)||!l.parts[m.partIndex].show)continue;const v=m.xScreen+m.dxScreen,w=m.yScreen+m.dyScreen,S=v+m.width,I=w+m.height,[R,L,k,B]=this._gridIndex.getCellSpan(v,w,S,I);for(let $=L;$<=B;$++)for(let V=R;V<=k;V++)this._gridIndex.cells[$][V].push(m)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const r=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",r)!==YP.POINT;let o=n.getLayoutValue("icon-rotation-alignment",r);o===sc.AUTO&&(o=s?sc.MAP:sc.VIEWPORT);let a=n.getLayoutValue("text-rotation-alignment",r);a===sc.AUTO&&(a=s?sc.MAP:sc.VIEWPORT);const l=n.getPaintValue("icon-translate",r),u=n.getPaintValue("icon-translate-anchor",r),c=n.getPaintValue("text-translate",r),h=n.getPaintValue("text-translate-anchor",r),p={iconAllowOverlap:n.getLayoutValue("icon-allow-overlap",r),iconIgnorePlacement:n.getLayoutValue("icon-ignore-placement",r),textAllowOverlap:n.getLayoutValue("text-allow-overlap",r),textIgnorePlacement:n.getLayoutValue("text-ignore-placement",r),iconRotationAlignment:o,textRotationAlignment:a,iconTranslateAnchor:u,iconTranslate:l,textTranslateAnchor:h,textTranslate:c};return this._styleProps.set(e,p),p}};function iwn(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,r=e.tile.key;return t.world-r.world?t.world-r.world:t.level-r.level?t.level-r.level:t.row-r.row?t.row-r.row:t.col-r.col?t.col-r.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let rwn=class{get running(){return this._running}constructor(e,t,r,n,s,o){this._visibleTiles=e,this._symbolRepository=t,this._createCollisionJob=r,this._assignTileSymbolsOpacity=n,this._symbolLayerSorter=s,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const t=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const t=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const t=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-t)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let l=0;ll)return!1;let v=null,w=!1,S=!1;for(const I of u.tileSymbols)if(!S||!w){const R=I.tile;(!v||R.isCoverage||R.neededForCoverage&&!w)&&(v=I,(R.neededForCoverage||R.isCoverage)&&(S=!0),R.isCoverage&&(w=!0))}if(v.selectedForRendering=!0,S){m.symbols.push(v),u.show=!0;for(const I of u.parts)I.show=!0}else u.show=!1}}for(const h of t)h.symbols.sort(iwn);return!0}const a=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return t.sort(a)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,t=this._visibleTiles;let r=0;function n(s,o){const a=s.symbols;for(const[l,u]of a)nwn(u,o);e(s,o);for(const l of s.childrenTiles)n(l,o)}return{work(s){const o=performance.now();for(;rs)return!1;const a=t[r];a.parentTile==null&&n(a,performance.now())}return!0}}}};function nwn(i,e){for(const t of i){const r=t.unique;for(const n of r.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/Dq),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=r.show&&n.show?1:0}}}const swn=32,own=8,awn=64;let lwn=class{constructor(e,t,r){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=r,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let r=this._tiles.get(e.id);r||(r={symbols:new Map},this._tiles.set(e.id,r));const n=new Map;if(t)for(const a of t)r.symbols.has(a)&&(n.set(a,r.symbols.get(a)),r.symbols.delete(a));else for(const[a,l]of e.layerData)r.symbols.has(a)&&(n.set(a,r.symbols.get(a)),r.symbols.delete(a));this._removeSymbols(n);const s=e.symbols,o=new Map;for(const[a,l]of s){let u=l.length;if(u>=swn){let c=this.tileCoordRange;do c/=2,u/=4;while(u>own&&c>awn);const h=new DXt(this.tileCoordRange,this.tileCoordRange,c);o.set(a,{flat:l,index:h}),r.symbols.set(a,{flat:l,index:h});for(const p of l)h.getCell(p.xTile,p.yTile).push(p)}else o.set(a,{flat:l}),r.symbols.set(a,{flat:l})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,r]of this._tiles){const n=new Map;for(const s of e)r.symbols.has(s)&&(n.set(s,r.symbols.get(s)),r.symbols.delete(s));this._removeSymbols(n),r.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const r=new Map;for(const[n,s]of e.symbols)t.symbols.has(n)&&(r.set(n,t.symbols.get(n)),t.symbols.delete(n));this._removeSymbols(r),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,r,n){const s=[],o=this.uniqueSymbols;for(const a of o){const l=a.styleLayerUID,u=a.uniqueSymbols;for(const c of u){const h=c.tileSymbols.find(p=>p.selectedForRendering);h&&qbn(h,e,t*(window.devicePixelRatio||1),r)&&s.push({vtlSymbol:h,styleLayerUID:l,tileKey:h.tile.key})}}return s}_removeSymbols(e){for(const[t,{flat:r}]of e)for(const n of r){const s=n.unique,o=s.tileSymbols,a=o.length-1;for(let l=0;lt.level){const s=e.key.level-t.level;if(e.key.row>>s!==t.row||e.key.col>>s!==t.col)return}if(t.level>e.key.level){const s=t.level-e.key.level;if(t.row>>s!==e.key.row||t.col>>s!==e.key.col)return}if(t.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,t,r);return}const n=new Map;for(const[s,o]of r){const a=[];for(const h of o){const p=V1t(this.tileCoordRange,h.xTile,t.level,t.col,e.key.level,e.key.col),m=V1t(this.tileCoordRange,h.yTile,t.level,t.row,e.key.level,e.key.row);p>=0&&p=0&&m0&&n.set(s,l)}for(const s of e.childrenTiles)this._matchSymbols(s,t,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let r,n=0;for(const[s,o]of e){const a=new Array(o.size);r=0;for(const l of o)a[r++]=l;t[n]={styleLayerUID:s,uniqueSymbols:a},n++}return t}};const uwn=.5,H1t=1e-6;let cwn=class{constructor(e,t){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=hB(!1),this._symbolRepository=new lwn(4096,t,()=>new zbn),this._symbolDeclutterer=new rwn(t,this._symbolRepository,(r,n,s)=>this._createCollisionJob(r,n,s),(r,n)=>{r.allSymbolsFadingOut=!0,r.lastOpacityUpdate=n,Hbn(r,n,!0),r.decluttered=!0,r.requestRender()},(r,n)=>this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(n.styleLayerUID).z,r=>{const n=this.styleRepository.getStyleLayerByUID(r);if(this._zoom+H1t=n.maxzoom)return!1;const s=n.getLayoutProperty("visibility");return!s||s.getValue()!==_A.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,r){return this.updateDecluttererViewState(),new twn(e,t,r,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const r=[0,0];t.toScreen(r,t.center);const n=[0,0];return t.toScreen(n,this._declutterViewState.center),this._offsetFromScreenCenter[0]=r[0]-n[0],this._offsetFromScreenCenter[1]=r[1]-n[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(esn),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+uwn)*Dq)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}},hwn=class extends gX{_createTransforms(){return{displayViewScreenMat3:Cc(),tileMat3:Cc()}}};const fwe=1e-6;function W1t(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==_A.NONE&&(i.minzoom===void 0||i.minzoom=e-fwe))return!0}return!1}let dwn=class extends Hle{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,n){this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this._tileInfoView=n,this._computeDisplayInfoView(n),this._symbolFader==null&&(this._symbolFader=new cwn(this._styleRepository,this.children)),this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==aa.MAP&&e.drawPhase!==aa.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader!=null?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;t!==aa.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,state:r}=e,n=this._styleRepository;if(!n)return;const s=n.layers,o=this._displayInfo.scaleToZoom(r.scale);n.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,n.backgroundBucketIds,o)),super.renderChildren(e),e.drawPhase===aa.MAP&&this._fade(o,r);const a=this.children.filter(l=>l.visible&&l.hasData());if(!a||a.length===0)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);for(const l of a)l.triangleCount=0;t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(il.KEEP,il.KEEP,il.REPLACE),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(Wl.LEQUAL),t.setClearDepth(1),t.clear(t.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let l=s.length-1;l>=0;l--)this._renderStyleLayer(s[l],e,a);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(bn.ONE,bn.ONE_MINUS_SRC_ALPHA,bn.ONE,bn.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let l=0;lc.decluttered):r.filter(c=>c.neededForCoverage),l!=="vtlSymbol"&&(r.length===0||e.minzoom!==void 0&&e.minzoom>=n+fwe||e.maxzoom!==void 0&&e.maxzoom{const t=i.vtlSymbol.sourceTile,r=e.vtlSymbol.sourceTile;return t.level!==r.level?t.level-r.level:t.row!==r.row?t.row-r.row:t.col!==r.col?t.col-r.col:i.styleLayerUID-e.styleLayerUID};let gwn=class kXt{constructor(e,t,r,n,s){this.tileKey=e,this._index=null,this._styleRepository=null,this._tileHandler=null,this._tileKeyToPBF=new Map,this._tileLayerData=t,this._styleRepository=r,this._tileHandler=n,this._parentLayer=s}static create(e,t,r,n,s){return new kXt(e,t,r,n,s)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,r,n,s){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new sbe(100,ywn),await this._indexLayers());const o=[];return this._queryIndex(o,e,t,r,this.tileKey.level,n),s&&s?.length>0&&await this._getSymbolsAttributes(o,s),o}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,r=await this._getTilePayload(e);for(const[n,s]of this._tileLayerData){const o=t[n],a=r.find(c=>c.sourceName===o.source);if(!a)continue;const{protobuff:l,key:u}=a;if(s.type!==ng.SYMBOL){const c=1<=10*c||de&&de<=10*u)continue;const pe=e.getFeatureInflatedBounds(Q,u,v.extent,B);pe==null||pe[0]>L||pe[1]>k||pe[2]h.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(u.from,u.to).map(h=>h.vtlSymbol),n,l)}return e}_addSymbolsAttributes(e,t,r,n){const s=this._styleRepository.layers,o=n.key,a=this.tileKey,l=1<{const{attributes:p,tilePoint:m}=h;e.push({layerId:s[r].id,layerIndex:r,graphic:new Us({attributes:p,origin:{type:"vector-tile",layerId:s[r].id,layerIndex:r,layer:this._parentLayer}}),tilePoint:m})})}_getSymbolAttributes(e,t,r,n,s,o){const a=[],l=this._styleRepository.layers;let u=0;t.sort((h,p)=>h.featureIndex-p.featureIndex);const c=new g3(new Uint8Array(e),new DataView(e));for(;c.next();)switch(c.tag()){case 3:{const h=c.getMessage(),p=new BBe(h);if(h.release(),p.name!==l[r].sourceLayer)continue;const m=p.getData(),v=p.extent/n,w=q1t/v,S=v*o,I=v*s;let R=0;for(;m.nextTag(2);){const L=m.getMessage();if(R++===t[u].featureIndex){const k=new $Be(L,p),B=k.values,$=k.getGeometry(),V=$!=null?[w*($[0][0].x-S),w*($[0][0].y-I)]:null;a.push({attributes:B,tilePoint:V}),u++}if(L.release(),u===t.length)return a}break}default:c.skip()}return a}_queryIndex(e,t,r,n,s,o){const a=pwn*n*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:r-a,maxX:t+a,maxY:r+a},l=>{const{layer:u,feature:c}=l;u.isIntersectingFeature(t,r,n,c,s,o,l)&&e.push({layerId:u.id,layerIndex:u.uid,tilePoint:null,graphic:new Us({attributes:c.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return qh(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}};const ywn=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});let Y1t=class extends ak{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=Tc.pool.acquire(e),r=t.level===0?null:Tc.getId(t.level-1,t.row>>1,t.col>>1,t.world);return Tc.pool.release(t),r}getTileCoverage(e,t,r=!0,n){const s=super.getTileCoverage(e,t,r,n);if(!s)return s;const o=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let r,n;for(let s=0;sn.scale)return r=t[s],r.level+(r.scale-e)/(r.scale-n.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}));else{const r=this.tileInfo.size[0],n=this.tileInfo.spatialReference;t=fu.create({size:r,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let r=0;rp.tileKey.id===h.id)));return await Promise.all(u),c}update(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:e}=this.layer.currentStyleInfo;this._styleRepository=new Ybe(e),this._tileInfoView=new Y1t(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new dwn(this._tileInfoView),this._tileHandler=new Lbn(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",t=>{if(t.isDataDriven)this._styleChanges.push({type:uf.PAINTER_CHANGED,data:t}),this.requestUpdate();else{const r=this._styleRepository,n=r.getLayerById(t.layer);if(!n)return;const s=n.type===bl.SYMBOL;r.setPaintProperties(t.layer,t.paint),s&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",t=>{const r=this._styleRepository,n=r.getLayerById(t.layer);if(!n)return;const s=nB(n.layout,t.layout);if(s!=null){if(Aie(s,"visibility")&&vwn(s)===1)return r.setLayoutProperties(t.layer,t.layout),n.type===bl.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:uf.LAYOUT_CHANGED,data:t}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",t=>{const r=this._styleRepository,n=r.getLayerById(t.layer);n&&(r.setStyleLayerVisibility(t.layer,t.visibility),n.type===bl.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",t=>{this._styleChanges.push({type:uf.LAYER_CHANGED,data:t}),this.requestUpdate()}),this.layer.on("delete-style-layer",t=>{this._styleChanges.push({type:uf.LAYER_REMOVED,data:t}),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",t=>{this._styleChanges.push({type:uf.SPRITES_CHANGED,data:t});const r=this._styleRepository.layers;for(const n of r)switch(n.type){case bl.SYMBOL:n.getLayoutProperty("icon-image")&&this._styleChanges.push({type:uf.LAYOUT_CHANGED,data:{layer:n.id,layout:n.layout}});break;case bl.LINE:n.getPaintProperty("line-pattern")&&this._styleChanges.push({type:uf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}});break;case bl.FILL:n.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:uf.PAINTER_CHANGED,data:{layer:n.id,paint:n.paint,isDataDriven:n.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=zo(this._vectorTileContainer),this._tileHandler=zo(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return Ya(this.layer.tileInfo?.spatialReference,e)}canResume(){let e=super.canResume();const{currentStyleInfo:t}=this.layer;if(e&&t?.layerDefinition){const r=this.view.scale,{minScale:n,maxScale:s}=t.layerDefinition;t?.layerDefinition&&(n&&nr&&(e=!1))}return e}isUpdating(){return this.fading}acquireTile(e){const t=this._createVectorTile(e);return this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>{t.once("attach",()=>this.requestUpdate()),t.setData(r),this.requestUpdate()}).catch(r=>{mo(r)||di.getLogger(this).error(r)})),t}releaseTile(e){const t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new z1t({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const e=new AbortController,t=this._tileHandler.start({signal:e.signal}).then(()=>{this._fetchQueue=new LW({tileInfoView:this._tileInfoView,process:(r,n)=>this._getTileData(r,n),concurrency:15}),this._parseQueue=new LW({tileInfoView:this._tileInfoView,process:(r,n)=>this._parseTileData(r,n),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(r=>{this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=e,this._tileHandlerPromise=t}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=zo(this._fetchQueue),this._parseQueue=zo(this._parseQueue),this._tileManager=zo(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(e,t){return this._tileHandler.fetchTileData(e,t)}async _parseTileData(e,t){return this._tileHandler.parseTileData(e,t)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const e=this._styleChanges;try{await this._tileHandler.updateStyle(e)}catch(o){di.getLogger(this).error("error applying vector-tiles style update",o.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const t=this._styleRepository,r=new Set;e.forEach(o=>{if(o.type!==uf.LAYER_REMOVED)return;const a=o.data,l=t.getLayerById(a.layer);l&&r.add(l.uid)});const n=new Set;e.forEach(o=>{let a;switch(o.type){case uf.PAINTER_CHANGED:t.setPaintProperties(o.data.layer,o.data.paint),a=o.data.layer;break;case uf.LAYOUT_CHANGED:t.setLayoutProperties(o.data.layer,o.data.layout),a=o.data.layer;break;case uf.LAYER_REMOVED:return void t.deleteStyleLayer(o.data.layer);case uf.LAYER_CHANGED:t.setStyleLayer(o.data.layer,o.data.index),a=o.data.layer.id;break;case uf.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(a){const l=t.getLayerById(a);l&&n.add(l.uid)}});const s=this._vectorTileContainer.children;if(r.size>0){const o=Array.from(r);this._vectorTileContainer.deleteStyleLayers(o);for(const a of s)a.deleteLayerData(o)}if(this._fetchQueue.resume(),this._parseQueue.resume(),n.size>0){const o=Array.from(n),a=[];for(const l of s){const u=this._updatingHandles.addPromise(this._fetchQueue.push(l.key).then(c=>this._parseQueue.push({key:l.key,data:c,styleLayerUIDs:o})).then(c=>l.setData(c)));a.push(u)}await Promise.all(a)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:e}=this.layer.currentStyleInfo,t=li(e);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._styleRepository=new Ybe(t),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:r}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,t,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!mo(o))throw o}if(r.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,void this.requestUpdate();const n=await this._tileHandler.spriteMosaic,s=this._vectorTileContainer;this._tileInfoView=new Y1t(this.layer.tileInfo,this.layer.fullExtent),s.setStyleResources(n,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new z1t({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.requestUpdate()}_createVectorTile(e){const t=this._tileInfoView.getTileBounds(Wo(),e),r=this._tileInfoView.getTileResolution(e.level);return new Zbn(e,r,t[0],t[3],512,512,this._styleRepository)}async _queryTile(e,t,r,n,s,o){if(s.layerData.size===0)return;const a=this._ensureTileIndex(s),l=this._tileInfoView.getTileBounds(Wo(),s.key,!0),u=X1t*J1t*((t.x-l[0])/(l[2]-l[0])),c=X1t*J1t*(1-(t.y-l[1])/(l[3]-l[1])),h=await a.queryAttributes(u,c,r,n,o);for(const p of h)p.graphic.geometry=this._tileToMapPoint(p.tilePoint,s.transforms.tileUnitsToPixels),e.push({type:"graphic",layer:this.layer,graphic:p.graphic,mapPoint:t.clone()});e.sort((p,m)=>m.graphic.origin.layerIndex-p.graphic.origin.layerIndex)}_tileToMapPoint(e,t){if(!e)return null;const r=e[0]*t[0]+e[1]*t[3]+t[6],n=e[0]*t[1]+e[1]*t[4]+t[7],s=this.view.state,o=[0,0];return s.toMap(o,[r,n]),new $i({x:o[0],y:o[1],spatialReference:s.spatialReference})}_ensureTileIndex(e){let t=e.featureIndex;return t||(t=gwn.create(e.key,e.layerData,this._styleRepository,this._tileHandler,this.layer),e.featureIndex=t),t}};function vwn(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}x([D()],e0e.prototype,"_isTileHandlerReady",void 0),e0e=x([Qe("esri.views.2d.layers.VectorTileLayerView2D")],e0e);const _wn=e0e,bwn=Object.freeze(Object.defineProperty({__proto__:null,default:_wn},Symbol.toStringTag,{value:"Module"}));let q4=class extends xs(Ci){constructor(e){super(e),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};x([D({type:Boolean})],q4.prototype,"frameCenter",void 0),x([D({type:Boolean})],q4.prototype,"frameOutline",void 0),x([D({type:Boolean})],q4.prototype,"lineOfSight",void 0),x([D({type:Boolean})],q4.prototype,"sensorLocation",void 0),x([D({type:Boolean})],q4.prototype,"sensorTrail",void 0),q4=x([Qe("esri.layers.support.TelemetryDisplay")],q4);const LXt=q4,rG=new jr([255,127,0]);let r6=class extends Lm(Nm){constructor(){super(...arguments),this._graphicsLayer=new nHe,this._frameOutlineGraphic=new Us({symbol:{type:"simple-fill",outline:{type:"simple-line",color:rG}}}),this._sensorTrailGraphic=new Us({symbol:{type:"simple-line",color:rG}}),this._lineOfSightGraphic=new Us({symbol:{type:"simple-line",color:rG}}),this._sensorLocationGraphic=new Us({symbol:{type:"simple-marker",color:rG}}),this._frameCenterGraphic=new Us({symbol:{type:"simple-marker",color:rG}}),this.layer=null,this.symbolColor=rG,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=zo(this._graphicsLayer)}initialize(){this.addHandles(Ki(()=>this.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},js)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new LXt({frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this.graphicsView=new Tx({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new QA(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([Ki(()=>[this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),js),Ki(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),js)])}detach(){this.container.removeAllChildren(),this.graphicsView=zo(this.graphicsView)}supportsSpatialReference(e){return!0}moveStart(){}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:t}=this;e&&t&&(t.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}};x([D()],r6.prototype,"graphicsView",void 0),x([D()],r6.prototype,"layer",void 0),x([D()],r6.prototype,"symbolColor",void 0),x([D({type:LXt})],r6.prototype,"visibleTelemetryElements",void 0),r6=x([Qe("esri.views.2d.layers.VideoLayerView2D")],r6);const wwn=r6,xwn=Object.freeze(Object.defineProperty({__proto__:null,default:wwn},Symbol.toStringTag,{value:"Module"})),Swn=i=>{let e=class extends i{initialize(){this.exportImageParameters=new QI({layer:this.layer})}destroy(){this.exportImageParameters=zo(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeaturesAtLocation(t,r){const{layer:n}=this;if(!t)throw new qe("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:s}=n;if(!s)throw new qe("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:s});const o=this.createFetchPopupFeaturesQuery(t);if(!o)return[];const{extent:a,width:l,height:u,x:c,y:h}=o;if(!(a&&l&&u))throw new qe("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:a,width:l,height:u});const p=await n.fetchFeatureInfo(a,l,u,c,h);return hn(r),p}};return x([D()],e.prototype,"exportImageParameters",void 0),x([D({readOnly:!0})],e.prototype,"exportImageVersion",null),x([D()],e.prototype,"layer",void 0),x([D(kY)],e.prototype,"timeExtent",void 0),e=x([Qe("esri.layers.mixins.WMSLayerView")],e),e};let Ete=class extends Swn(hL(Lm(Nm))){constructor(){super(...arguments),this.bitmapContainer=new Bq}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{mo(t)||di.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this.bitmapContainer=new Bq,this.container.addChild(this.bitmapContainer),this.strategy=new KCe({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(Ki(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=zo(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:r}=this,{x:n,y:s}=e,{spatialReference:o}=t;let a,l=0,u=0;if(r.children.some(m=>{const{width:v,height:w,resolution:S,x:I,y:R}=m,L=I+S*v,k=R-S*w;return n>=I&&n<=L&&s<=R&&s>=k&&(a=new hr({xmin:I,ymin:k,xmax:L,ymax:R,spatialReference:o}),l=v,u=w,!0)}),!a)return null;const c=a.width/l,h=Math.round((n-a.xmin)/c),p=Math.round((a.ymax-s)/c);return{extent:a,width:l,height:u,x:h,y:p}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,n){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,...n})}};x([D()],Ete.prototype,"strategy",void 0),x([D()],Ete.prototype,"updating",void 0),Ete=x([Qe("esri.views.2d.layers.WMSLayerView2D")],Ete);const Twn=Ete,Cwn=Object.freeze(Object.defineProperty({__proto__:null,default:Twn},Symbol.toStringTag,{value:"Module"})),Ewn=new Set([102113,102100,3857,3785,900913]),Iwn=[0,0];let t0e=class extends hL(iXt(Lm(Nm))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e=this.tileMatrixSet?.tileInfo;e&&(this._tileInfoView=new ak(e),this._fetchQueue=new LW({tileInfoView:this._tileInfoView,concurrency:16,process:(t,r)=>this.fetchTile(t,r)}),this._tileStrategy=new Qne({cachePolicy:"keep",resampling:!0,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets?.some(t=>Ya(t.tileInfo?.spatialReference,e))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),r=t.bitmap;return[r.x,r.y]=this._tileInfoView.getTileCoords(Iwn,t.key),r.resolution=this._tileInfoView.getTileResolution(t.key),[r.width,r.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const r="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:n,resamplingLevel:s=0}=t;if(!r)return this._fetchImage(e,n);const o=new Tc(0,0,0,0);let a;try{await r.fetchAvailabilityUpsample(e.level,e.row,e.col,o,{signal:n}),a=await this._fetchImage(o,n)}catch(l){if(mo(l))throw l;if(s<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const c=new Tc(u),h=await this.fetchTile(c,{...t,resamplingLevel:s+1});return lwe(this._tileInfoView,h,c,e)}}throw l}return lwe(this._tileInfoView,a,o,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){mo(t)||di.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let r=e.tileMatrixSets.find(n=>Ya(n.tileInfo?.spatialReference,t));return!r&&t.isWebMercator&&(r=e.tileMatrixSets.find(n=>Ewn.has(n.tileInfo?.spatialReference.wkid??-1))),r}};x([D({readOnly:!0})],t0e.prototype,"tileMatrixSet",null),t0e=x([Qe("esri.views.2d.layers.WMTSLayerView2D")],t0e);const Awn=t0e,Mwn=Object.freeze(Object.defineProperty({__proto__:null,default:Awn},Symbol.toStringTag,{value:"Module"}));var _9={},NXt={},EP={};Object.defineProperty(EP,"__esModule",{value:!0}),EP.loop=EP.conditional=EP.parse=void 0;var Own=function i(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:r;if(Array.isArray(t))t.forEach(function(o){return i(e,o,r,n)});else if(typeof t=="function")t(e,r,n,i);else{var s=Object.keys(t)[0];Array.isArray(t[s])?(n[s]={},i(e,t[s],r,n[s])):n[s]=t[s](e,r,n,i)}return r};EP.parse=Own;var Pwn=function(i,e){return function(t,r,n,s){e(t,r,n)&&s(t,i,r,n)}};EP.conditional=Pwn;var Rwn=function(i,e){return function(t,r,n,s){for(var o=[],a=t.pos;e(t,r,n);){var l={};if(s(t,i,r,l),t.pos===a)break;a=t.pos,o.push(l)}return o}};EP.loop=Rwn;var pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.readBits=pf.readArray=pf.readUnsigned=pf.readString=pf.peekBytes=pf.readBytes=pf.peekByte=pf.readByte=pf.buildStream=void 0;var Dwn=function(i){return{data:i,pos:0}};pf.buildStream=Dwn;var $Xt=function(){return function(i){return i.data[i.pos++]}};pf.readByte=$Xt;var Fwn=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+i]}};pf.peekByte=Fwn;var tEe=function(i){return function(e){return e.data.subarray(e.pos,e.pos+=i)}};pf.readBytes=tEe;var kwn=function(i){return function(e){return e.data.subarray(e.pos,e.pos+i)}};pf.peekBytes=kwn;var Lwn=function(i){return function(e){return Array.from(tEe(i)(e)).map(function(t){return String.fromCharCode(t)}).join("")}};pf.readString=Lwn;var Nwn=function(i){return function(e){var t=tEe(2)(e);return i?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};pf.readUnsigned=Nwn;var $wn=function(i,e){return function(t,r,n){for(var s=typeof e=="function"?e(t,r,n):e,o=tEe(i),a=new Array(s),l=0;l=m){var S=m-c.pos;p.push((0,t.readBytes)(S)(c)),v+=S;break}p.push((0,t.readBytes)(w)(c)),v+=w}for(var I=new Uint8Array(v),R=0,L=0;L>=o,v-=o,c>r||c==a)break;if(c==n){s=(1<<(o=p+1))-1,r=n+2,u=k;continue}if(u==k){K[S++]=Y[c],u=c,w=c;continue}for(l=c,c==r&&(K[S++]=w,c=u);c>n;)K[S++]=Y[c],c=V[c];w=255&Y[c],K[S++]=w,ra[c],width:n,height:s}}function exn(i){return zK??=document.createElement("canvas"),K1t??=zK.getContext("2d",{willReadFrequently:!0}),zK.width=i.width,zK.height=i.height,K1t.putImageData(i,0,0),zK}BXt=_9.decompressFrames=Kwn;const txn=[71,73,70];function UXt(i){const e=new Uint8Array(i);return!txn.some((t,r)=>t!==e[r])}function ixn(i){if(!UXt(i))return!1;const e=new DataView(i),t=e.getUint8(10);let r=13+(128&t?3*2**(1+(7&t)):0),n=0,s=!1;for(;!s;){switch(e.getUint8(r++)){case 33:if(!o())return!1;break;case 44:a();break;case 59:s=!0;break;default:return!1}if(n>1)return!0}function o(){switch(e.getUint8(r++)){case 249:l();break;case 1:u();break;case 254:c();break;case 255:h();break;default:return!1}return!0}function a(){n++,r+=8;const m=e.getUint8(r++);r+=128&m?3*2**(1+(7&m)):0,r++,p()}function l(){r++,r+=4,p()}function u(){n++,r++,r+=12,p()}function c(){p()}function h(){r++,r+=8,r+=3,p()}function p(){let m;for(;m=e.getUint8(r++);)r+=m}return!1}const rxn=Object.freeze(Object.defineProperty({__proto__:null,isAnimatedGIF:ixn,isGIF:UXt,parseGif:Qwn},Symbol.toStringTag,{value:"Module"}));var Z1t,zXt={exports:{}};Z1t=function(){return function(i){var e={};function t(r){if(e[r])return e[r].exports;var n=e[r]={exports:{},id:r,loaded:!1};return i[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}return t.m=i,t.c=e,t.p="",t(0)}([function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=l,e.isNotAPNG=u,e.default=h;var r=s(t(1)),n=t(2);function s(R){return R&&R.__esModule?R:{default:R}}var o=new Error("Not a PNG"),a=new Error("Not an animated PNG");function l(R){return R===o}function u(R){return R===a}var c=new Uint8Array([137,80,78,71,13,10,26,10]);function h(R){var L=new Uint8Array(R);if(Array.prototype.some.call(c,function(de,pe){return de!==L[pe]}))return o;var k=!1;if(p(L,function(de){return!(k=de==="acTL")}),!k)return a;var B=[],$=[],V=null,Y=null,K=0,Q=new n.APNG;if(p(L,function(de,pe,H,Z){var ae=new DataView(pe.buffer);switch(de){case"IHDR":V=pe.subarray(H+8,H+8+Z),Q.width=ae.getUint32(H+8),Q.height=ae.getUint32(H+12);break;case"acTL":Q.numPlays=ae.getUint32(H+8+4);break;case"fcTL":Y&&(Q.frames.push(Y),K++),(Y=new n.Frame).width=ae.getUint32(H+8+4),Y.height=ae.getUint32(H+8+8),Y.left=ae.getUint32(H+8+12),Y.top=ae.getUint32(H+8+16);var fe=ae.getUint16(H+8+20),be=ae.getUint16(H+8+22);be===0&&(be=100),Y.delay=1e3*fe/be,Y.delay<=10&&(Y.delay=100),Q.playTime+=Y.delay,Y.disposeOp=ae.getUint8(H+8+24),Y.blendOp=ae.getUint8(H+8+25),Y.dataParts=[],K===0&&Y.disposeOp===2&&(Y.disposeOp=1);break;case"fdAT":Y&&Y.dataParts.push(pe.subarray(H+8+4,H+8+Z));break;case"IDAT":Y&&Y.dataParts.push(pe.subarray(H+8,H+8+Z));break;case"IEND":$.push(w(pe,H,12+Z));break;default:B.push(w(pe,H,12+Z))}}),Y&&Q.frames.push(Y),Q.frames.length==0)return a;var re=new Blob(B),ne=new Blob($);return Q.frames.forEach(function(de){var pe=[];pe.push(c),V.set(I(de.width),0),V.set(I(de.height),4),pe.push(S("IHDR",V)),pe.push(re),de.dataParts.forEach(function(H){return pe.push(S("IDAT",H))}),pe.push(ne),de.imageData=new Blob(pe,{type:"image/png"}),delete de.dataParts,pe=null}),Q}function p(R,L){var k=new DataView(R.buffer),B=8,$=void 0,V=void 0,Y=void 0;do V=k.getUint32(B),Y=L($=m(R,B+4,4),R,B,V),B+=12+V;while(Y!==!1&&$!="IEND"&&B>>24&255,R>>>16&255,R>>>8&255,255&R])}},function(i,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=-1,u=a,c=a+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:o.length-a);u>>8^t[255&(l^o[u])];return-1^l};for(var t=new Uint32Array(256),r=0;r<256;r++){for(var n=r,s=0;s<8;s++)n=1&n?3988292384^n>>>1:n>>>1;t[r]=n}},function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(){function a(l,u){for(var c=0;c1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new n.default(u,l,c)})}}]),a}(),e.Frame=function(){function a(){o(this,a),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return r(a,[{key:"createImage",value:function(){var l=this;return this.imageElement?Promise.resolve():new Promise(function(u,c){var h=URL.createObjectURL(l.imageData);l.imageElement=document.createElement("img"),l.imageElement.onload=function(){URL.revokeObjectURL(h),u()},l.imageElement.onerror=function(){URL.revokeObjectURL(h),l.imageElement=null,c(new Error("Image creation error"))},l.imageElement.src=h})}}]),a}()},function(i,e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function u(c,h){for(var p=0;p=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var h=this.currentFrame;this._prevFrame=h,this._prevFrameData=null,h.disposeOp==2&&(this._prevFrameData=this.context.getImageData(h.left,h.top,h.width,h.height)),h.blendOp==0&&this.context.clearRect(h.left,h.top,h.width,h.height),this.context.drawImage(h.imageElement,h.left,h.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var h=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var p=performance.now()+this.currentFrame.delay/this.playbackRate,m=function v(w){if(!h._ended&&!h._paused){if(w>=p){for(;w-p>=h._apng.playTime/h.playbackRate;)p+=h._apng.playTime/h.playbackRate,h._numPlays++;do h.renderNextFrame(),p+=h.currentFrame.delay/h.playbackRate;while(!h._ended&&w>p)}requestAnimationFrame(v)}};requestAnimationFrame(m)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),c}(n(t(4)).default);e.default=l},function(i,e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(a){return typeof a=="function"}function n(a){return typeof a=="number"}function s(a){return typeof a=="object"&&a!==null}function o(a){return a===void 0}i.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(a){if(!n(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},t.prototype.emit=function(a){var l,u,c,h,p,m;if(this._events||(this._events={}),a==="error"&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((l=arguments[1])instanceof Error)throw l;var v=new Error('Uncaught, unspecified "error" event. ('+l+")");throw v.context=l,v}if(o(u=this._events[a]))return!1;if(r(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),u.apply(this,h)}else if(s(u))for(h=Array.prototype.slice.call(arguments,1),c=(m=u.slice()).length,p=0;p0&&this._events[a].length>u&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(a,l){if(!r(l))throw TypeError("listener must be a function");var u=!1;function c(){this.removeListener(a,c),u||(u=!0,l.apply(this,arguments))}return c.listener=l,this.on(a,c),this},t.prototype.removeListener=function(a,l){var u,c,h,p;if(!r(l))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(h=(u=this._events[a]).length,c=-1,u===l||r(u.listener)&&u.listener===l)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,l);else if(s(u)){for(p=h;p-- >0;)if(u[p]===l||u[p].listener&&u[p].listener===l){c=p;break}if(c<0)return this;u.length===1?(u.length=0,delete this._events[a]):u.splice(c,1),this._events.removeListener&&this.emit("removeListener",a,l)}return this},t.prototype.removeAllListeners=function(a){var l,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(l in this._events)l!=="removeListener"&&this.removeAllListeners(l);return this.removeAllListeners("removeListener"),this._events={},this}if(r(u=this._events[a]))this.removeListener(a,u);else if(u)for(;u.length;)this.removeListener(a,u[u.length-1]);return delete this._events[a],this},t.prototype.listeners=function(a){return this._events&&this._events[a]?r(this._events[a])?[this._events[a]]:this._events[a].slice():[]},t.prototype.listenerCount=function(a){if(this._events){var l=this._events[a];if(r(l))return 1;if(l)return l.length}return 0},t.listenerCount=function(a,l){return a.listenerCount(l)}}])},zXt.exports=Z1t();const nxn=Cg(zXt.exports);async function sxn(i,e){const t=nxn(i);if(t instanceof Error)throw t;await t.createImages(),hn(e);const{frames:r,width:n,height:s}=t,o=document.createElement("canvas");o.width=n,o.height=s;const a=o.getContext("2d",{willReadFrequently:!0}),l=[],u=[];let c=0;for(const h of r){const p=h.delay||100;u.push(p),c+=p;const m=h.imageElement;h.blendOp===0?a.globalCompositeOperation="copy":a.globalCompositeOperation="source-over";const v=h.disposeOp===2?a.getImageData(h.left,h.top,h.width,h.height):void 0;a.drawImage(m,h.left,h.top);const w=a.getImageData(0,0,n,s);l.push(w),h.disposeOp===0||(h.disposeOp===1?a.clearRect(h.left,h.top,h.width,h.height):h.disposeOp===2&&a.putImageData(v,h.left,h.top))}return{frameCount:r.length,duration:c,frameDurations:u,getFrame:h=>l[h],width:n,height:s}}const oxn=[137,80,78,71,13,10,26,10];function VXt(i){const e=new Uint8Array(i);return!oxn.some((t,r)=>t!==e[r])}function axn(i){if(!VXt(i))return!1;const e=new DataView(i),t=new Uint8Array(i);let r,n=8;do{const s=e.getUint32(n);if(r=String.fromCharCode.apply(String,Array.prototype.slice.call(t.subarray(n+4,n+8))),r==="acTL")return!0;n+=12+s}while(r!=="IEND"&&n{let t="";for(let r=0;rdxn([2,1,1,1,3]);/*! + */function uxn(i){return i.map(e=>{let t="";for(let r=0;ruxn([2,1,1,1,3]);/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 *//*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE -*/var HXt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ywe=HXt.join(","),WXt=typeof Element>"u",LB=WXt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vwe=!WXt&&Element.prototype.getRootNode?function(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}:function(i){return i?.ownerDocument},_we=function i(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=n===""||n==="true",o=s||t&&e&&i(e.parentNode);return o},pxn=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},qXt=function(e,t,r){if(_we(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(ywe));return t&&LB.call(e,ywe)&&n.unshift(e),n=n.filter(r),n},YXt=function i(e,t,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!_we(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=i(l,!0,r);r.flatten?n.push.apply(n,u):n.push({scopeParent:o,candidates:u})}else{var c=LB.call(o,ywe);c&&r.filter(o)&&(t||!e.includes(o))&&n.push(o);var h=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),p=!_we(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(h&&p){var m=i(h===!0?o.children:h.children,!0,r);r.flatten?n.push.apply(n,m):n.push({scopeParent:o,candidates:m})}else s.unshift.apply(s,o.children)}}return n},XXt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},X6=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||pxn(e))&&!XXt(e)?0:e.tabIndex},fxn=function(e,t){var r=X6(e);return r<0&&t&&!XXt(e)?0:r},mxn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},JXt=function(e){return e.tagName==="INPUT"},gxn=function(e){return JXt(e)&&e.type==="hidden"},yxn=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},vxn=function(e,t){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(LB.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var a=e;e;){var l=e.parentElement,u=vwe(e);if(l&&!l.shadowRoot&&n(l)===!0)return Q1t(e);e.assignedSlot?e=e.assignedSlot:!l&&u!==e.ownerDocument?e=u.host:e=l}e=a}if(xxn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Q1t(e);return!1},Txn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},Exn=function i(e){var t=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=fxn(a,o),u=o?i(n.candidates):a;l===0?o?t.push.apply(t,u):t.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:u})}),r.sort(mxn).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(t)},KXt=function(e,t){t=t||{};var r;return t.getShadowRoot?r=YXt([e],t.includeContainer,{filter:Y7e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Cxn}):r=qXt(e,t.includeContainer,Y7e.bind(null,t)),Exn(r)},Ixn=function(e,t){t=t||{};var r;return t.getShadowRoot?r=YXt([e],t.includeContainer,{filter:bwe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=qXt(e,t.includeContainer,bwe.bind(null,t)),r},nG=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return LB.call(e,ywe)===!1?!1:Y7e(t,e)},Axn=HXt.concat("iframe").join(","),wRe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return LB.call(e,Axn)===!1?!1:bwe(t,e)};const ZXt={getShadowRoot:!0};function e_t(i){return i?i.id=i.id||`${i.tagName.toLowerCase()}-${Yle()}`:""}function w7(i){const e="dir",t=`[${e}]`,r=_X(i,t);return r?r.getAttribute(e):"ltr"}function QXt(i){return i.getRootNode()}function eJt(i){return i.host||null}function sZe(i,{selector:e,id:t}){function r(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=QXt(n),o=t?"getElementById"in s?s.getElementById(t):null:e?s.querySelector(e):null,a=eJt(s);return o||(a?r(a):null)}return r(i)}function _X(i,e){function t(r){return r?r.closest(e)||t(eJt(QXt(r))):null}return t(i)}function Mxn(i,e){return tJt(i,e)}function tJt(i,e){if(!i)return;const t=e(i);if(t!==void 0)return t;const{parentNode:r}=i;return tJt(r instanceof ShadowRoot?r.host:r,e)}function Oxn(i,e){return!!Mxn(e,t=>t===i?!0:void 0)}function Pxn(i){return typeof i?.setFocus=="function"}async function iJt(i){if(i)return Pxn(i)?i.setFocus():i.focus()}function X7e(i){if(i)return KXt(i,ZXt)[0]??i}function iEe(i){X7e(i)?.focus()}const xoe=":not([slot])";function MH(i,e,t){e&&!Array.isArray(e)&&typeof e!="string"&&(t=e,e=null);const r=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:xoe;return t?.all?Rxn(i,r,t):Dxn(i,r,t)}function rJt(i,e){return i?Array.from(i.children||[]).filter(t=>t?.matches(e)):[]}function Rxn(i,e,t){let r=e===xoe?rJt(i,xoe):Array.from(i.querySelectorAll(e));r=t&&t.direct===!1?r:r.filter(s=>s.parentElement===i),r=t?.matches?r.filter(s=>s?.matches(t.matches)):r;const n=t?.selector;return n?r.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):r}function Dxn(i,e,t){let r=e===xoe?rJt(i,xoe)[0]||null:i.querySelector(e);r=t&&t.direct===!1||r?.parentElement===i?r:null,r=t?.matches?r?.matches(t.matches)?r:null:r;const n=t?.selector;return n?r?.querySelector(n):r}function Uq(i,e,t){if(typeof e=="string"&&e!=="")return e;if(e==="")return i[t]}function Z1(i){return(!!i).toString()}function Fxn(i){return Xh(i)||Lxn(i)}function kxn(i){return Nxn(i).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function Lxn(i){return!!kxn(i)}function Nxn(i){return i.target.assignedNodes({flatten:!0})}function Xh(i){return!!wwe(i).length}function wwe(i){return i.target.assignedElements({flatten:!0})}function oZe(i){return!!(i.isPrimary&&i.button===0)}function $xn(i,e){if(i.parentNode!==e.parentNode)return!1;const t=Array.from(i.parentNode.children);return t.indexOf(i)summary:first-of-type:not([inert])","details:not([inert])"],ywe=HXt.join(","),WXt=typeof Element>"u",LB=WXt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vwe=!WXt&&Element.prototype.getRootNode?function(i){var e;return i==null||(e=i.getRootNode)===null||e===void 0?void 0:e.call(i)}:function(i){return i?.ownerDocument},_we=function i(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=n===""||n==="true",o=s||t&&e&&i(e.parentNode);return o},cxn=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},qXt=function(e,t,r){if(_we(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(ywe));return t&&LB.call(e,ywe)&&n.unshift(e),n=n.filter(r),n},YXt=function i(e,t,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!_we(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,u=i(l,!0,r);r.flatten?n.push.apply(n,u):n.push({scopeParent:o,candidates:u})}else{var c=LB.call(o,ywe);c&&r.filter(o)&&(t||!e.includes(o))&&n.push(o);var h=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),p=!_we(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(h&&p){var m=i(h===!0?o.children:h.children,!0,r);r.flatten?n.push.apply(n,m):n.push({scopeParent:o,candidates:m})}else s.unshift.apply(s,o.children)}}return n},XXt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},X6=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||cxn(e))&&!XXt(e)?0:e.tabIndex},hxn=function(e,t){var r=X6(e);return r<0&&t&&!XXt(e)?0:r},dxn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},JXt=function(e){return e.tagName==="INPUT"},pxn=function(e){return JXt(e)&&e.type==="hidden"},fxn=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},mxn=function(e,t){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(LB.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var a=e;e;){var l=e.parentElement,u=vwe(e);if(l&&!l.shadowRoot&&n(l)===!0)return Q1t(e);e.assignedSlot?e=e.assignedSlot:!l&&u!==e.ownerDocument?e=u.host:e=l}e=a}if(_xn(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Q1t(e);return!1},wxn=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},Sxn=function i(e){var t=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,a=o?n.scopeParent:n,l=hxn(a,o),u=o?i(n.candidates):a;l===0?o?t.push.apply(t,u):t.push(a):r.push({documentOrder:s,tabIndex:l,item:n,isScope:o,content:u})}),r.sort(dxn).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(t)},KXt=function(e,t){t=t||{};var r;return t.getShadowRoot?r=YXt([e],t.includeContainer,{filter:Y7e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xxn}):r=qXt(e,t.includeContainer,Y7e.bind(null,t)),Sxn(r)},Txn=function(e,t){t=t||{};var r;return t.getShadowRoot?r=YXt([e],t.includeContainer,{filter:bwe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=qXt(e,t.includeContainer,bwe.bind(null,t)),r},nG=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return LB.call(e,ywe)===!1?!1:Y7e(t,e)},Cxn=HXt.concat("iframe").join(","),wRe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return LB.call(e,Cxn)===!1?!1:bwe(t,e)};const ZXt={getShadowRoot:!0};function e_t(i){return i?i.id=i.id||`${i.tagName.toLowerCase()}-${Yle()}`:""}function w7(i){const e="dir",t=`[${e}]`,r=_X(i,t);return r?r.getAttribute(e):"ltr"}function QXt(i){return i.getRootNode()}function eJt(i){return i.host||null}function sZe(i,{selector:e,id:t}){function r(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=QXt(n),o=t?"getElementById"in s?s.getElementById(t):null:e?s.querySelector(e):null,a=eJt(s);return o||(a?r(a):null)}return r(i)}function _X(i,e){function t(r){return r?r.closest(e)||t(eJt(QXt(r))):null}return t(i)}function Exn(i,e){return tJt(i,e)}function tJt(i,e){if(!i)return;const t=e(i);if(t!==void 0)return t;const{parentNode:r}=i;return tJt(r instanceof ShadowRoot?r.host:r,e)}function Ixn(i,e){return!!Exn(e,t=>t===i?!0:void 0)}function Axn(i){return typeof i?.setFocus=="function"}async function iJt(i){if(i)return Axn(i)?i.setFocus():i.focus()}function X7e(i){if(i)return KXt(i,ZXt)[0]??i}function iEe(i){X7e(i)?.focus()}const xoe=":not([slot])";function MH(i,e,t){e&&!Array.isArray(e)&&typeof e!="string"&&(t=e,e=null);const r=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:xoe;return t?.all?Mxn(i,r,t):Oxn(i,r,t)}function rJt(i,e){return i?Array.from(i.children||[]).filter(t=>t?.matches(e)):[]}function Mxn(i,e,t){let r=e===xoe?rJt(i,xoe):Array.from(i.querySelectorAll(e));r=t&&t.direct===!1?r:r.filter(s=>s.parentElement===i),r=t?.matches?r.filter(s=>s?.matches(t.matches)):r;const n=t?.selector;return n?r.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):r}function Oxn(i,e,t){let r=e===xoe?rJt(i,xoe)[0]||null:i.querySelector(e);r=t&&t.direct===!1||r?.parentElement===i?r:null,r=t?.matches?r?.matches(t.matches)?r:null:r;const n=t?.selector;return n?r?.querySelector(n):r}function Uq(i,e,t){if(typeof e=="string"&&e!=="")return e;if(e==="")return i[t]}function Z1(i){return(!!i).toString()}function Pxn(i){return Xh(i)||Dxn(i)}function Rxn(i){return Fxn(i).filter(e=>e.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function Dxn(i){return!!Rxn(i)}function Fxn(i){return i.target.assignedNodes({flatten:!0})}function Xh(i){return!!wwe(i).length}function wwe(i){return i.target.assignedElements({flatten:!0})}function oZe(i){return!!(i.isPrimary&&i.button===0)}function kxn(i,e){if(i.parentNode!==e.parentNode)return!1;const t=Array.from(i.parentNode.children);return t.indexOf(i)n===0?r:`${r[0].toUpperCase()}${r.slice(1)}`).join("")}${Bxn.includes(i)?"Input":"Change"}`}const J7e="hidden-form-input";function aZe(i){return"checked"in i}const K7e=new WeakMap,lZe=new WeakSet;function Gxn(i,e){if(_X(e.parentElement,"[form]"))return!0;const r="calciteInternalFormComponentRegister";let n=!1;return i.addEventListener(r,s=>{n=s.composedPath().some(o=>lZe.has(o)),s.stopPropagation()},{once:!0}),e.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0})),n}function nJt(i){"status"in i&&(i.status="idle"),"validationIcon"in i&&(i.validationIcon=!1),"validationMessage"in i&&(i.validationMessage="")}function Uxn(i,e){"status"in i&&(i.status="invalid"),"validationIcon"in i&&!i.validationIcon&&(i.validationIcon=!0),"validationMessage"in i&&!i.validationMessage&&(i.validationMessage=e)}function t_t(i){const e=i?.target,t=e?.parentElement,r=t?.nodeName?.toLowerCase(),n=r?.split("-");if(n.length<2||n[0]!=="calcite"||(i?.preventDefault(),Uxn(t,e?.validationMessage),t?.validationMessage!==e?.validationMessage))return;const s=jxn(r);t.addEventListener(s,()=>nJt(t),{once:!0})}function sJt(i){const{formEl:e}=i;return e?(e.addEventListener("invalid",t_t,!0),e.requestSubmit(),e.removeEventListener("invalid",t_t,!0),requestAnimationFrame(()=>{const t=e.querySelectorAll("[status=invalid]");for(const r of t)if(r?.validationMessage){r?.setFocus();break}}),!0):!1}function zxn(i){i.formEl?.reset()}function Vxn(i){const{el:e,value:t}=i,r=oJt(i);if(!r||Gxn(r,e))return;i.formEl=r,i.defaultValue=t,aZe(i)&&(i.defaultChecked=i.checked);const n=(i.onFormReset||Hxn).bind(i);r.addEventListener("reset",n),K7e.set(i.el,n),lZe.add(e)}function oJt(i){const{el:e,form:t}=i;return t?sZe(e,{id:t}):_X(e,"form")}function Hxn(){if(nJt(this),aZe(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function Wxn(i){const{el:e,formEl:t}=i;if(!t)return;const r=K7e.get(e);t.removeEventListener("reset",r),K7e.delete(e),i.formEl=null,lZe.delete(e)}const Z7e="calciteInternalHiddenInputInput",aJt=i=>{i.target.dispatchEvent(new CustomEvent(Z7e,{bubbles:!0}))},i_t=i=>i.removeEventListener("input",aJt);function qxn(i){const{el:e,formEl:t,name:r,value:n}=i,{ownerDocument:s}=e,o=e.querySelectorAll(`input[slot="${J7e}"]`);if(!t||!r){o.forEach(h=>{i_t(h),h.remove()});return}const a=Array.isArray(n)?n:[n],l=[],u=new Set;o.forEach(h=>{const p=a.find(m=>m==h.value);p!=null?(u.add(p),r_t(i,h,p)):l.push(h)});let c;a.forEach(h=>{if(u.has(h))return;let p=l.pop();p||(p=s.createElement("input"),p.slot=J7e),c||(c=s.createDocumentFragment()),c.append(p),p.addEventListener("input",aJt),r_t(i,p,h)}),c&&e.append(c),l.forEach(h=>{i_t(h),h.remove()})}function r_t(i,e,t){const{defaultValue:r,disabled:n,form:s,name:o,required:a}=i;e.defaultValue=r,e.disabled=n,e.name=o,e.required=a,e.tabIndex=-1,s?e.setAttribute("form",s):e.removeAttribute("form"),aZe(i)?(e.checked=i.checked,e.defaultChecked=i.defaultChecked,e.value=i.checked?t||"on":""):e.value=t||"",i.syncHiddenFormInput?.(e)}const Yxn=({component:i})=>(qxn(i),Ii("slot",{name:J7e}));/*! + */const Lxn=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function Nxn(i){return`${i.split("-").map((r,n)=>n===0?r:`${r[0].toUpperCase()}${r.slice(1)}`).join("")}${Lxn.includes(i)?"Input":"Change"}`}const J7e="hidden-form-input";function aZe(i){return"checked"in i}const K7e=new WeakMap,lZe=new WeakSet;function $xn(i,e){if(_X(e.parentElement,"[form]"))return!0;const r="calciteInternalFormComponentRegister";let n=!1;return i.addEventListener(r,s=>{n=s.composedPath().some(o=>lZe.has(o)),s.stopPropagation()},{once:!0}),e.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0})),n}function nJt(i){"status"in i&&(i.status="idle"),"validationIcon"in i&&(i.validationIcon=!1),"validationMessage"in i&&(i.validationMessage="")}function Bxn(i,e){"status"in i&&(i.status="invalid"),"validationIcon"in i&&!i.validationIcon&&(i.validationIcon=!0),"validationMessage"in i&&!i.validationMessage&&(i.validationMessage=e)}function t_t(i){const e=i?.target,t=e?.parentElement,r=t?.nodeName?.toLowerCase(),n=r?.split("-");if(n.length<2||n[0]!=="calcite"||(i?.preventDefault(),Bxn(t,e?.validationMessage),t?.validationMessage!==e?.validationMessage))return;const s=Nxn(r);t.addEventListener(s,()=>nJt(t),{once:!0})}function sJt(i){const{formEl:e}=i;return e?(e.addEventListener("invalid",t_t,!0),e.requestSubmit(),e.removeEventListener("invalid",t_t,!0),requestAnimationFrame(()=>{const t=e.querySelectorAll("[status=invalid]");for(const r of t)if(r?.validationMessage){r?.setFocus();break}}),!0):!1}function jxn(i){i.formEl?.reset()}function Gxn(i){const{el:e,value:t}=i,r=oJt(i);if(!r||$xn(r,e))return;i.formEl=r,i.defaultValue=t,aZe(i)&&(i.defaultChecked=i.checked);const n=(i.onFormReset||Uxn).bind(i);r.addEventListener("reset",n),K7e.set(i.el,n),lZe.add(e)}function oJt(i){const{el:e,form:t}=i;return t?sZe(e,{id:t}):_X(e,"form")}function Uxn(){if(nJt(this),aZe(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function zxn(i){const{el:e,formEl:t}=i;if(!t)return;const r=K7e.get(e);t.removeEventListener("reset",r),K7e.delete(e),i.formEl=null,lZe.delete(e)}const Z7e="calciteInternalHiddenInputInput",aJt=i=>{i.target.dispatchEvent(new CustomEvent(Z7e,{bubbles:!0}))},i_t=i=>i.removeEventListener("input",aJt);function Vxn(i){const{el:e,formEl:t,name:r,value:n}=i,{ownerDocument:s}=e,o=e.querySelectorAll(`input[slot="${J7e}"]`);if(!t||!r){o.forEach(h=>{i_t(h),h.remove()});return}const a=Array.isArray(n)?n:[n],l=[],u=new Set;o.forEach(h=>{const p=a.find(m=>m==h.value);p!=null?(u.add(p),r_t(i,h,p)):l.push(h)});let c;a.forEach(h=>{if(u.has(h))return;let p=l.pop();p||(p=s.createElement("input"),p.slot=J7e),c||(c=s.createDocumentFragment()),c.append(p),p.addEventListener("input",aJt),r_t(i,p,h)}),c&&e.append(c),l.forEach(h=>{i_t(h),h.remove()})}function r_t(i,e,t){const{defaultValue:r,disabled:n,form:s,name:o,required:a}=i;e.defaultValue=r,e.disabled=n,e.name=o,e.required=a,e.tabIndex=-1,s?e.setAttribute("form",s):e.removeAttribute("form"),aZe(i)?(e.checked=i.checked,e.defaultChecked=i.defaultChecked,e.value=i.checked?t||"on":""):e.value=t||"",i.syncHiddenFormInput?.(e)}const Hxn=({component:i})=>(Vxn(i),Ii("slot",{name:J7e}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */function Xxn(){return navigator.userAgentData}function Jxn(){const i=Xxn();return i?.brands?i.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}const x7=/firefox/i.test(Jxn()),b9=x7?new WeakMap:null;function Kxn(){const{disabled:i}=this;i||HTMLElement.prototype.click.call(this)}function lJt(i){const e=i.target;if(x7&&!b9.get(e))return;const{disabled:t}=e;t&&i.preventDefault()}const uJt=["mousedown","mouseup","click"];function cJt(i){const e=i.target;x7&&!b9.get(e)||e.disabled&&(i.stopImmediatePropagation(),i.preventDefault())}const xwe={capture:!0};function sM(i){if(i.disabled){i.el.setAttribute("aria-disabled","true"),i.el.contains(document.activeElement)&&document.activeElement.blur(),hJt(i);return}dJt(i),i.el.removeAttribute("aria-disabled")}function hJt(i){if(i.el.click=Kxn,x7){const e=Zxn(i),t=b9.get(i.el);t!==e&&(Q7e(t),b9.set(i.el,e)),n_t(b9.get(i.el));return}n_t(i.el)}function n_t(i){i&&(i.addEventListener("pointerdown",lJt,xwe),uJt.forEach(e=>i.addEventListener(e,cJt,xwe)))}function Zxn(i){return i.el.parentElement||i.el}function dJt(i){if(delete i.el.click,x7){Q7e(b9.get(i.el)),b9.delete(i.el);return}Q7e(i.el)}function Q7e(i){i&&(i.removeEventListener("pointerdown",lJt,xwe),uJt.forEach(e=>i.removeEventListener(e,cJt,xwe)))}function oM(i){!i.disabled||!x7||hJt(i)}function aM(i){x7&&dJt(i)}const Qxn={container:"interaction-container"};function JR({disabled:i},e){return Ii("div",{class:Qxn.container,inert:i},...e)}/*! + */function Wxn(){return navigator.userAgentData}function qxn(){const i=Wxn();return i?.brands?i.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}const x7=/firefox/i.test(qxn()),b9=x7?new WeakMap:null;function Yxn(){const{disabled:i}=this;i||HTMLElement.prototype.click.call(this)}function lJt(i){const e=i.target;if(x7&&!b9.get(e))return;const{disabled:t}=e;t&&i.preventDefault()}const uJt=["mousedown","mouseup","click"];function cJt(i){const e=i.target;x7&&!b9.get(e)||e.disabled&&(i.stopImmediatePropagation(),i.preventDefault())}const xwe={capture:!0};function sM(i){if(i.disabled){i.el.setAttribute("aria-disabled","true"),i.el.contains(document.activeElement)&&document.activeElement.blur(),hJt(i);return}dJt(i),i.el.removeAttribute("aria-disabled")}function hJt(i){if(i.el.click=Yxn,x7){const e=Xxn(i),t=b9.get(i.el);t!==e&&(Q7e(t),b9.set(i.el,e)),n_t(b9.get(i.el));return}n_t(i.el)}function n_t(i){i&&(i.addEventListener("pointerdown",lJt,xwe),uJt.forEach(e=>i.addEventListener(e,cJt,xwe)))}function Xxn(i){return i.el.parentElement||i.el}function dJt(i){if(delete i.el.click,x7){Q7e(b9.get(i.el)),b9.delete(i.el);return}Q7e(i.el)}function Q7e(i){i&&(i.removeEventListener("pointerdown",lJt,xwe),uJt.forEach(e=>i.removeEventListener(e,cJt,xwe)))}function oM(i){!i.disabled||!x7||hJt(i)}function aM(i){x7&&dJt(i)}const Jxn={container:"interaction-container"};function JR({disabled:i},e){return Ii("div",{class:Jxn.container,inert:i},...e)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */function oS(i){return i==="l"?"m":"s"}async function pJt(i){await(e2n(i)?i.componentOnReady():new Promise(e=>requestAnimationFrame(()=>e())))}function e2n(i){return typeof i.componentOnReady=="function"}/*! + */function oS(i){return i==="l"?"m":"s"}async function pJt(i){await(Kxn(i)?i.componentOnReady():new Promise(e=>requestAnimationFrame(()=>e())))}function Kxn(i){return typeof i.componentOnReady=="function"}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const fJt="calciteInternalLabelClick",rEe="calciteInternalLabelConnected",Swe="calciteInternalLabelDisconnected",s_t="calcite-label",zq=new WeakMap,Pre=new WeakMap,Soe=new WeakMap,Twe=new WeakMap,w9=new Set,t2n=i=>{const{id:e}=i,t=e&&sZe(i,{selector:`${s_t}[for="${e}"]`});if(t)return t;const r=_X(i,s_t);return!r||i2n(r,i)?null:r};function i2n(i,e){let t;const r="custom-element-ancestor-check",n=o=>{o.stopImmediatePropagation();const a=o.composedPath();t=a.slice(a.indexOf(e),a.indexOf(i))};return i.addEventListener(r,n,{once:!0}),e.dispatchEvent(new CustomEvent(r,{composed:!0,bubbles:!0})),i.removeEventListener(r,n),t.filter(o=>o!==e&&o!==i).filter(o=>o.tagName?.includes("-")).length>0}function nEe(i){if(!i)return;const e=t2n(i.el);if(Pre.has(e)&&e===i.labelEl||!e&&w9.has(i))return;const t=n2n.bind(i);if(e){i.labelEl=e;const r=zq.get(e)||[];r.push(i),zq.set(e,r.sort(gJt)),Pre.has(i.labelEl)||(Pre.set(i.labelEl,o_t),i.labelEl.addEventListener(fJt,o_t)),w9.delete(i),document.removeEventListener(rEe,Soe.get(i)),Twe.set(i,t),document.addEventListener(Swe,t)}else w9.has(i)||(t(),document.removeEventListener(Swe,Twe.get(i)))}function mJt(i){if(!i||(w9.delete(i),document.removeEventListener(rEe,Soe.get(i)),document.removeEventListener(Swe,Twe.get(i)),Soe.delete(i),Twe.delete(i),!i.labelEl))return;const e=zq.get(i.labelEl);e.length===1&&(i.labelEl.removeEventListener(fJt,Pre.get(i.labelEl)),Pre.delete(i.labelEl)),zq.set(i.labelEl,e.filter(t=>t!==i).sort(gJt)),i.labelEl=null}function gJt(i,e){return $xn(i.el,e.el)?-1:1}function eje(i){return i.label||i.labelEl?.textContent?.trim()||""}function o_t(i){const e=i.detail.sourceEvent.target,t=zq.get(this),r=t.find(o=>o.el===e);if(t.includes(r))return;const s=t[0];s.disabled||s.onLabelClick(i)}function r2n(){w9.has(this)&&nEe(this)}function n2n(){w9.add(this);const i=Soe.get(this)||r2n.bind(this);Soe.set(this,i),document.addEventListener(rEe,i)}async function s2n(i){if(await pJt(i),zq.has(i))return;const t=i.ownerDocument?.getElementById(i.for);t&&requestAnimationFrame(()=>{for(const r of w9)if(r.el===t){nEe(r);break}})}/*! + */const fJt="calciteInternalLabelClick",rEe="calciteInternalLabelConnected",Swe="calciteInternalLabelDisconnected",s_t="calcite-label",zq=new WeakMap,Pre=new WeakMap,Soe=new WeakMap,Twe=new WeakMap,w9=new Set,Zxn=i=>{const{id:e}=i,t=e&&sZe(i,{selector:`${s_t}[for="${e}"]`});if(t)return t;const r=_X(i,s_t);return!r||Qxn(r,i)?null:r};function Qxn(i,e){let t;const r="custom-element-ancestor-check",n=o=>{o.stopImmediatePropagation();const a=o.composedPath();t=a.slice(a.indexOf(e),a.indexOf(i))};return i.addEventListener(r,n,{once:!0}),e.dispatchEvent(new CustomEvent(r,{composed:!0,bubbles:!0})),i.removeEventListener(r,n),t.filter(o=>o!==e&&o!==i).filter(o=>o.tagName?.includes("-")).length>0}function nEe(i){if(!i)return;const e=Zxn(i.el);if(Pre.has(e)&&e===i.labelEl||!e&&w9.has(i))return;const t=t2n.bind(i);if(e){i.labelEl=e;const r=zq.get(e)||[];r.push(i),zq.set(e,r.sort(gJt)),Pre.has(i.labelEl)||(Pre.set(i.labelEl,o_t),i.labelEl.addEventListener(fJt,o_t)),w9.delete(i),document.removeEventListener(rEe,Soe.get(i)),Twe.set(i,t),document.addEventListener(Swe,t)}else w9.has(i)||(t(),document.removeEventListener(Swe,Twe.get(i)))}function mJt(i){if(!i||(w9.delete(i),document.removeEventListener(rEe,Soe.get(i)),document.removeEventListener(Swe,Twe.get(i)),Soe.delete(i),Twe.delete(i),!i.labelEl))return;const e=zq.get(i.labelEl);e.length===1&&(i.labelEl.removeEventListener(fJt,Pre.get(i.labelEl)),Pre.delete(i.labelEl)),zq.set(i.labelEl,e.filter(t=>t!==i).sort(gJt)),i.labelEl=null}function gJt(i,e){return kxn(i.el,e.el)?-1:1}function eje(i){return i.label||i.labelEl?.textContent?.trim()||""}function o_t(i){const e=i.detail.sourceEvent.target,t=zq.get(this),r=t.find(o=>o.el===e);if(t.includes(r))return;const s=t[0];s.disabled||s.onLabelClick(i)}function e2n(){w9.has(this)&&nEe(this)}function t2n(){w9.add(this);const i=Soe.get(this)||e2n.bind(this);Soe.set(this,i),document.addEventListener(rEe,i)}async function i2n(i){if(await pJt(i),zq.has(i))return;const t=i.ownerDocument?.getElementById(i.for);t&&requestAnimationFrame(()=>{for(const r of w9)if(r.el===t){nEe(r);break}})}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const yJt=new WeakMap,vJt=new WeakMap;function Jv(i){vJt.set(i,new Promise(e=>yJt.set(i,e)))}function Kv(i){yJt.get(i)()}function o2n(i){return vJt.get(i)}async function Zv(i){return await o2n(i),zY(i),new Promise(e=>requestAnimationFrame(()=>e()))}/*! + */const yJt=new WeakMap,vJt=new WeakMap;function Jv(i){vJt.set(i,new Promise(e=>yJt.set(i,e)))}function Kv(i){yJt.get(i)()}function r2n(i){return vJt.get(i)}async function Zv(i){return await r2n(i),zY(i),new Promise(e=>requestAnimationFrame(()=>e()))}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 @@ -5065,27 +5065,27 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */function qv(i,e,t){const r=a2n(i);return new r(e,t)}function a2n(i){class e extends window.MutationObserver{constructor(r){super(r),this.observedEntry=[],this.callback=r}observe(r,n){return this.observedEntry.push({target:r,options:n}),super.observe(r,n)}unobserve(r){const n=this.observedEntry.filter(s=>s.target!==r);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),n.forEach(s=>this.observe(s.target,s.options))}}return function(){return i==="intersection"?window.IntersectionObserver:i==="mutation"?e:window.ResizeObserver}()}/*! + */function qv(i,e,t){const r=n2n(i);return new r(e,t)}function n2n(i){class e extends window.MutationObserver{constructor(r){super(r),this.observedEntry=[],this.callback=r}observe(r,n){return this.observedEntry.push({target:r,options:n}),super.observe(r,n)}unobserve(r){const n=this.observedEntry.filter(s=>s.target!==r);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),n.forEach(s=>this.observe(s.target,s.options))}}return function(){return i==="intersection"?window.IntersectionObserver:i==="mutation"?e:window.ResizeObserver}()}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const l2n=new RegExp("\\.(0+)?$"),u2n=new RegExp("0+$");class vc{constructor(e){if(e instanceof vc)return e;const[t,r]=y2n(e).split(".").concat("");this.value=BigInt(t+r.padEnd(vc.DECIMALS,"0").slice(0,vc.DECIMALS))+BigInt(vc.ROUNDED&&r[vc.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(vc.DECIMALS+1,"0"),t=e.slice(0,-vc.DECIMALS),r=e.slice(-vc.DECIMALS).replace(u2n,"");return{integers:t,decimals:r}}toString(){const{integers:e,decimals:t}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${t.length?"."+t:""}`}formatToParts(e){const{integers:t,decimals:r}=this.getIntegersAndDecimals(),n=e.numberFormatter.formatToParts(BigInt(t));return this.isNegative&&n.unshift({type:"minusSign",value:e.minusSign}),r.length&&(n.push({type:"decimal",value:e.decimal}),r.split("").forEach(s=>n.push({type:"fraction",value:s}))),n}format(e){const{integers:t,decimals:r}=this.getIntegersAndDecimals(),n=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(t))}`,s=r.length?`${e.decimal}${r.split("").map(o=>e.numberFormatter.format(Number(o))).join("")}`:"";return`${n}${s}`}add(e){return vc.fromBigInt(this.value+new vc(e).value)}subtract(e){return vc.fromBigInt(this.value-new vc(e).value)}multiply(e){return vc._divRound(this.value*new vc(e).value,vc.SHIFT)}divide(e){return vc._divRound(this.value*vc.SHIFT,new vc(e).value)}}vc.DECIMALS=100;vc.ROUNDED=!0;vc.SHIFT=BigInt("1"+"0".repeat(vc.DECIMALS));vc._divRound=(i,e)=>vc.fromBigInt(i/e+(vc.ROUNDED?i*BigInt(2)/e%BigInt(2):BigInt(0)));vc.fromBigInt=i=>Object.assign(Object.create(vc.prototype),{value:i,isNegative:i{let t=!1;const r=e.split("").filter((n,s)=>n.match(/\./g)&&!t?(t=!0,!0):n.match(/\-/g)&&s===0?!0:uZe.includes(n)).join("");return rA(r)?new vc(r).toString():""})}const bJt=/^([-0])0+(?=\d)/,h2n=/(?!^\.)\.$/,d2n=/(?!^-)-/g,p2n=/^-\b0\b\.?0*$/,f2n=/0*$/,m2n=i=>Cwe(i,e=>{const t=e.replace(d2n,"").replace(h2n,"").replace(bJt,"$1");return rA(t)?p2n.test(t)?t:g2n(t):e});function g2n(i){const e=i.split(".")[1],t=new vc(i).toString(),[r,n]=t.split(".");return e&&n!==e?`${r}.${e}`:t}function Cwe(i,e){if(!i)return i;const t=i.toLowerCase().indexOf("e")+1;return t?i.replace(/[eE]*$/g,"").substring(0,t).concat(i.slice(t).replace(/[eE]/g,"")).split(/[eE]/).map((r,n)=>e(n===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(i)}function y2n(i){const e=i.split(/[eE]/);if(e.length===1)return i;const t=+i;if(Number.isSafeInteger(t))return`${t}`;const r=i.charAt(0)==="-",n=+e[1],s=e[0].split("."),o=(r?s[0].substring(1):s[0])||"",a=s[1]||"",l=(h,p)=>{const m=Math.abs(p)-h.length,v=m>0?`${"0".repeat(m)}${h}`:h;return`${v.slice(0,p)}.${v.slice(p)}`},u=(h,p)=>{const m=p>h.length?`${h}${"0".repeat(p-h.length)}`:h;return`${m.slice(0,p)}.${m.slice(p)}`},c=n>0?`${o}${u(a,n)}`:`${l(o,n)}${a}`;return`${r?"-":""}${c.charAt(0)==="."?"0":""}${c.replace(l2n,"").replace(bJt,"")}`}function v2n(i){return uZe.some(e=>i.includes(e))}function _2n(i,e,t){const r=e.split(".")[1];if(r){const n=r.match(f2n)[0];if(n&&t.delocalize(i).length!==e.length&&r.indexOf("e")===-1){const s=t.decimal;return i=i.includes(s)?i:`${i}${s}`,i.padEnd(i.length+n.length,t.localize("0"))}}return i}const Ok="en",b2n=["ar","bg","bs","ca","cs","da","de","el",Ok,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],w2n=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",Ok,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],x2n=["arab","arabext","latn"],wJt=i=>x2n.includes(i),xRe=new Intl.NumberFormat().resolvedOptions().numberingSystem,xJt=xRe==="arab"||!wJt(xRe)?"latn":xRe,S2n=i=>wJt(i)?i:xJt;function SJt(i,e="cldr"){const t=e==="cldr"?w2n:b2n;return i?t.includes(i)?i:(i=i.toLowerCase(),i==="nb"?"no":e==="t9n"&&i==="pt"?"pt-BR":(i.includes("-")&&(i=i.replace(/(\w+)-(\w+)/,(r,n,s)=>`${n}-${s.toUpperCase()}`),t.includes(i)||(i=i.split("-")[0])),i==="zh"?"zh-CN":t.includes(i)?i:(console.warn(`Translations for the "${i}" locale are not available and will fall back to the default, English (en).`),Ok))):Ok}const Toe=new Set;function Jb(i){T2n(i),Toe.size===0&&TJt?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),Toe.add(i)}function T2n(i){i.effectiveLocale=C2n(i)}function Kb(i){Toe.delete(i),Toe.size===0&&TJt.disconnect()}const TJt=qv("mutation",i=>{i.forEach(e=>{const t=e.target;Toe.forEach(r=>{if(!Oxn(t,r.el))return;const s=_X(r.el,"[lang]");if(!s){r.effectiveLocale=Ok;return}const o=s.lang;r.effectiveLocale=s.hasAttribute("lang")&&o===""?Ok:o})})});function C2n(i){return i.el.lang||_X(i.el,"[lang]")?.lang||document.documentElement.lang||Ok}class E2n{constructor(){this.delocalize=e=>this._numberFormatOptions?Cwe(e,t=>t.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?Cwe(e,t=>rA(t.trim())?new vc(t.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):t):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=SJt(e?.locale),e.numberingSystem=S2n(e?.numberingSystem),!this._numberFormatOptions&&e.locale===Ok&&e.numberingSystem===xJt&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const t=new Map(this._digits.map((n,s)=>[n,s])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(n=>n.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(n=>n.type==="decimal").value,this._minusSign=r.find(n=>n.type==="minusSign").value,this._getDigitIndex=n=>t.get(n)}}const V2=new E2n;/*! + */const s2n=new RegExp("\\.(0+)?$"),o2n=new RegExp("0+$");class vc{constructor(e){if(e instanceof vc)return e;const[t,r]=f2n(e).split(".").concat("");this.value=BigInt(t+r.padEnd(vc.DECIMALS,"0").slice(0,vc.DECIMALS))+BigInt(vc.ROUNDED&&r[vc.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(vc.DECIMALS+1,"0"),t=e.slice(0,-vc.DECIMALS),r=e.slice(-vc.DECIMALS).replace(o2n,"");return{integers:t,decimals:r}}toString(){const{integers:e,decimals:t}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${t.length?"."+t:""}`}formatToParts(e){const{integers:t,decimals:r}=this.getIntegersAndDecimals(),n=e.numberFormatter.formatToParts(BigInt(t));return this.isNegative&&n.unshift({type:"minusSign",value:e.minusSign}),r.length&&(n.push({type:"decimal",value:e.decimal}),r.split("").forEach(s=>n.push({type:"fraction",value:s}))),n}format(e){const{integers:t,decimals:r}=this.getIntegersAndDecimals(),n=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(t))}`,s=r.length?`${e.decimal}${r.split("").map(o=>e.numberFormatter.format(Number(o))).join("")}`:"";return`${n}${s}`}add(e){return vc.fromBigInt(this.value+new vc(e).value)}subtract(e){return vc.fromBigInt(this.value-new vc(e).value)}multiply(e){return vc._divRound(this.value*new vc(e).value,vc.SHIFT)}divide(e){return vc._divRound(this.value*vc.SHIFT,new vc(e).value)}}vc.DECIMALS=100;vc.ROUNDED=!0;vc.SHIFT=BigInt("1"+"0".repeat(vc.DECIMALS));vc._divRound=(i,e)=>vc.fromBigInt(i/e+(vc.ROUNDED?i*BigInt(2)/e%BigInt(2):BigInt(0)));vc.fromBigInt=i=>Object.assign(Object.create(vc.prototype),{value:i,isNegative:i{let t=!1;const r=e.split("").filter((n,s)=>n.match(/\./g)&&!t?(t=!0,!0):n.match(/\-/g)&&s===0?!0:uZe.includes(n)).join("");return rA(r)?new vc(r).toString():""})}const bJt=/^([-0])0+(?=\d)/,l2n=/(?!^\.)\.$/,u2n=/(?!^-)-/g,c2n=/^-\b0\b\.?0*$/,h2n=/0*$/,d2n=i=>Cwe(i,e=>{const t=e.replace(u2n,"").replace(l2n,"").replace(bJt,"$1");return rA(t)?c2n.test(t)?t:p2n(t):e});function p2n(i){const e=i.split(".")[1],t=new vc(i).toString(),[r,n]=t.split(".");return e&&n!==e?`${r}.${e}`:t}function Cwe(i,e){if(!i)return i;const t=i.toLowerCase().indexOf("e")+1;return t?i.replace(/[eE]*$/g,"").substring(0,t).concat(i.slice(t).replace(/[eE]/g,"")).split(/[eE]/).map((r,n)=>e(n===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(i)}function f2n(i){const e=i.split(/[eE]/);if(e.length===1)return i;const t=+i;if(Number.isSafeInteger(t))return`${t}`;const r=i.charAt(0)==="-",n=+e[1],s=e[0].split("."),o=(r?s[0].substring(1):s[0])||"",a=s[1]||"",l=(h,p)=>{const m=Math.abs(p)-h.length,v=m>0?`${"0".repeat(m)}${h}`:h;return`${v.slice(0,p)}.${v.slice(p)}`},u=(h,p)=>{const m=p>h.length?`${h}${"0".repeat(p-h.length)}`:h;return`${m.slice(0,p)}.${m.slice(p)}`},c=n>0?`${o}${u(a,n)}`:`${l(o,n)}${a}`;return`${r?"-":""}${c.charAt(0)==="."?"0":""}${c.replace(s2n,"").replace(bJt,"")}`}function m2n(i){return uZe.some(e=>i.includes(e))}function g2n(i,e,t){const r=e.split(".")[1];if(r){const n=r.match(h2n)[0];if(n&&t.delocalize(i).length!==e.length&&r.indexOf("e")===-1){const s=t.decimal;return i=i.includes(s)?i:`${i}${s}`,i.padEnd(i.length+n.length,t.localize("0"))}}return i}const Ok="en",y2n=["ar","bg","bs","ca","cs","da","de","el",Ok,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],v2n=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",Ok,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],_2n=["arab","arabext","latn"],wJt=i=>_2n.includes(i),xRe=new Intl.NumberFormat().resolvedOptions().numberingSystem,xJt=xRe==="arab"||!wJt(xRe)?"latn":xRe,b2n=i=>wJt(i)?i:xJt;function SJt(i,e="cldr"){const t=e==="cldr"?v2n:y2n;return i?t.includes(i)?i:(i=i.toLowerCase(),i==="nb"?"no":e==="t9n"&&i==="pt"?"pt-BR":(i.includes("-")&&(i=i.replace(/(\w+)-(\w+)/,(r,n,s)=>`${n}-${s.toUpperCase()}`),t.includes(i)||(i=i.split("-")[0])),i==="zh"?"zh-CN":t.includes(i)?i:(console.warn(`Translations for the "${i}" locale are not available and will fall back to the default, English (en).`),Ok))):Ok}const Toe=new Set;function Jb(i){w2n(i),Toe.size===0&&TJt?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),Toe.add(i)}function w2n(i){i.effectiveLocale=x2n(i)}function Kb(i){Toe.delete(i),Toe.size===0&&TJt.disconnect()}const TJt=qv("mutation",i=>{i.forEach(e=>{const t=e.target;Toe.forEach(r=>{if(!Ixn(t,r.el))return;const s=_X(r.el,"[lang]");if(!s){r.effectiveLocale=Ok;return}const o=s.lang;r.effectiveLocale=s.hasAttribute("lang")&&o===""?Ok:o})})});function x2n(i){return i.el.lang||_X(i.el,"[lang]")?.lang||document.documentElement.lang||Ok}class S2n{constructor(){this.delocalize=e=>this._numberFormatOptions?Cwe(e,t=>t.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?Cwe(e,t=>rA(t.trim())?new vc(t.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):t):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=SJt(e?.locale),e.numberingSystem=b2n(e?.numberingSystem),!this._numberFormatOptions&&e.locale===Ok&&e.numberingSystem===xJt&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const t=new Map(this._digits.map((n,s)=>[n,s])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(n=>n.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(n=>n.type==="decimal").value,this._minusSign=r.find(n=>n.type==="minusSign").value,this._getDigitIndex=n=>t.get(n)}}const V2=new S2n;/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const Ppe={};async function I2n(i,e){const t=`${e}_${i}`;return Ppe[t]||(Ppe[t]=fetch(TWe(`./assets/${e}/t9n/messages_${i}.json`)).then(r=>(r.ok||a_t(),r.json())).catch(()=>a_t())),Ppe[t]}function a_t(){throw new Error("could not fetch component message bundle")}function cZe(i){i.messages={...i.defaultMessages,...i.messageOverrides}}async function g_(i){i.defaultMessages=await CJt(i,i.effectiveLocale),cZe(i)}async function CJt(i,e){const{el:t}=i,n=t.tagName.toLowerCase().replace("calcite-","");return I2n(SJt(e,"t9n"),n)}async function y_(i,e){i.defaultMessages=await CJt(i,e),cZe(i)}function v_(i){i.onMessagesChange=A2n}function __(i){i.onMessagesChange=void 0}function A2n(){cZe(this)}/*! + */const Ppe={};async function T2n(i,e){const t=`${e}_${i}`;return Ppe[t]||(Ppe[t]=fetch(TWe(`./assets/${e}/t9n/messages_${i}.json`)).then(r=>(r.ok||a_t(),r.json())).catch(()=>a_t())),Ppe[t]}function a_t(){throw new Error("could not fetch component message bundle")}function cZe(i){i.messages={...i.defaultMessages,...i.messageOverrides}}async function g_(i){i.defaultMessages=await CJt(i,i.effectiveLocale),cZe(i)}async function CJt(i,e){const{el:t}=i,n=t.tagName.toLowerCase().replace("calcite-","");return T2n(SJt(e,"t9n"),n)}async function y_(i,e){i.defaultMessages=await CJt(i,e),cZe(i)}function v_(i){i.onMessagesChange=C2n}function __(i){i.onMessagesChange=void 0}function C2n(){cZe(this)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const M2n={icon:"icon",flipRtl:"flip-rtl"},SRe={},TRe={},EJt={s:16,m:24,l:32};async function O2n({icon:i,scale:e}){const t=EJt[e],r=P2n(i),n=r.charAt(r.length-1)==="F",o=`${n?r.substring(0,r.length-1):r}${t}${n?"F":""}`;if(SRe[o])return SRe[o];TRe[o]||(TRe[o]=fetch(TWe(`./assets/icon/${o}.json`)).then(l=>l.json()).catch(()=>(console.error(`"${o}" is not a valid calcite-ui-icon name`),"")));const a=await TRe[o];return SRe[o]=a,a}function P2n(i){const e=!isNaN(Number(i.charAt(0))),t=i.split("-");if(t.length>0){const n=/[a-z]/i;i=t.map((s,o)=>s.replace(n,function(l,u){return o===0&&u===0?l:l.toUpperCase()})).join("")}return e?`i${i}`:i}const R2n=":host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",IJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}async componentWillLoad(){this.loadIconPathData()}render(){const{el:e,flipRtl:t,pathData:r,scale:n,textLabel:s}=this,o=w7(e),a=EJt[n],l=!!s,u=[].concat(r||"");return Ii(Hb,{"aria-hidden":Z1(!l),"aria-label":l?s:null,role:l?"img":null},Ii("svg",{"aria-hidden":"true",class:{[M2n.flipRtl]:o==="rtl"&&t,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${a} ${a}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},u.map(c=>typeof c=="string"?Ii("path",{d:c}):Ii("path",{d:c.d,opacity:"opacity"in c?c.opacity:1}))))}async loadIconPathData(){const{icon:e,scale:t,visible:r}=this;if(!e||!r)return;const n=await O2n({icon:e,scale:t});e===this.icon&&(this.pathData=n)}waitUntilVisible(e){if(this.intersectionObserver=qv("intersection",t=>{t.forEach(r=>{r.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,e())})},{rootMargin:"50px"}),!this.intersectionObserver){e();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return R2n}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function yy(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,IJt);break}})}yy();/*! + */const E2n={icon:"icon",flipRtl:"flip-rtl"},SRe={},TRe={},EJt={s:16,m:24,l:32};async function I2n({icon:i,scale:e}){const t=EJt[e],r=A2n(i),n=r.charAt(r.length-1)==="F",o=`${n?r.substring(0,r.length-1):r}${t}${n?"F":""}`;if(SRe[o])return SRe[o];TRe[o]||(TRe[o]=fetch(TWe(`./assets/icon/${o}.json`)).then(l=>l.json()).catch(()=>(console.error(`"${o}" is not a valid calcite-ui-icon name`),"")));const a=await TRe[o];return SRe[o]=a,a}function A2n(i){const e=!isNaN(Number(i.charAt(0))),t=i.split("-");if(t.length>0){const n=/[a-z]/i;i=t.map((s,o)=>s.replace(n,function(l,u){return o===0&&u===0?l:l.toUpperCase()})).join("")}return e?`i${i}`:i}const M2n=":host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",IJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}async componentWillLoad(){this.loadIconPathData()}render(){const{el:e,flipRtl:t,pathData:r,scale:n,textLabel:s}=this,o=w7(e),a=EJt[n],l=!!s,u=[].concat(r||"");return Ii(Hb,{"aria-hidden":Z1(!l),"aria-label":l?s:null,role:l?"img":null},Ii("svg",{"aria-hidden":"true",class:{[E2n.flipRtl]:o==="rtl"&&t,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${a} ${a}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},u.map(c=>typeof c=="string"?Ii("path",{d:c}):Ii("path",{d:c.d,opacity:"opacity"in c?c.opacity:1}))))}async loadIconPathData(){const{icon:e,scale:t,visible:r}=this;if(!e||!r)return;const n=await I2n({icon:e,scale:t});e===this.icon&&(this.pathData=n)}waitUntilVisible(e){if(this.intersectionObserver=qv("intersection",t=>{t.forEach(r=>{r.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,e())})},{rootMargin:"50px"}),!this.intersectionObserver){e();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return M2n}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function yy(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,IJt);break}})}yy();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const D2n='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',AJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.inline=!1,this.label=void 0,this.scale="m",this.type=void 0,this.value=0,this.text=""}render(){const{el:e,inline:t,label:r,scale:n,text:s,type:o,value:a}=this,l=e.id||Yle(),u=.45,c=t?this.getInlineSize(n):this.getSize(n),h=c*u,p=`0 0 ${c} ${c}`,m=o==="determinate",v=2*h*Math.PI,w=a/100*v,S=v-w,I=Math.floor(a),R={"aria-valuenow":I,"aria-valuemin":0,"aria-valuemax":100,complete:I===100},L={r:h,cx:c/2,cy:c/2},k={"stroke-dasharray":`${w} ${S}`};return Ii(Hb,{"aria-label":r,id:l,role:"progressbar",...m?R:{}},Ii("div",{class:"loader__svgs"},Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:p},Ii("circle",{...L})),Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:p},Ii("circle",{...L})),Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:p,...m?{style:k}:{}},Ii("circle",{...L}))),s&&Ii("div",{class:"loader__text"},s),m&&Ii("div",{class:"loader__percentage"},a))}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}get el(){return this}static get style(){return D2n}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function Zb(){if(typeof customElements>"u")return;["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,AJt);break}})}Zb();/*! + */const O2n='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',AJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.inline=!1,this.label=void 0,this.scale="m",this.type=void 0,this.value=0,this.text=""}render(){const{el:e,inline:t,label:r,scale:n,text:s,type:o,value:a}=this,l=e.id||Yle(),u=.45,c=t?this.getInlineSize(n):this.getSize(n),h=c*u,p=`0 0 ${c} ${c}`,m=o==="determinate",v=2*h*Math.PI,w=a/100*v,S=v-w,I=Math.floor(a),R={"aria-valuenow":I,"aria-valuemin":0,"aria-valuemax":100,complete:I===100},L={r:h,cx:c/2,cy:c/2},k={"stroke-dasharray":`${w} ${S}`};return Ii(Hb,{"aria-label":r,id:l,role:"progressbar",...m?R:{}},Ii("div",{class:"loader__svgs"},Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:p},Ii("circle",{...L})),Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:p},Ii("circle",{...L})),Ii("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:p,...m?{style:k}:{}},Ii("circle",{...L}))),s&&Ii("div",{class:"loader__text"},s),m&&Ii("div",{class:"loader__percentage"},a))}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}get el(){return this}static get style(){return O2n}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function Zb(){if(typeof customElements>"u")return;["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,AJt);break}})}Zb();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const cw={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},F2n=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand-hover, var(--calcite-color-brand)));outline-offset:calc( + */const cw={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},P2n=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand-hover, var(--calcite-color-brand)));outline-offset:calc( 2px * calc( 1 - @@ -5095,15 +5095,15 @@ ${r.commandsLen} Commands (${r.drawCommands} draw)`),console.log("RenderPass bre 1 ) ) - )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px;transition:inline-size var(--calcite-internal-animation-timing-slow) ease-in-out, opacity var(--calcite-internal-animation-timing-slow) ease-in-out, transform var(--calcite-internal-animation-timing-slow) ease-in-out}.calcite-button--loader calcite-loader.loading-in{animation-name:loader-in;animation-duration:var(--calcite-internal-animation-timing-slow)}.calcite-button--loader calcite-loader.loading-out{animation-name:loader-out;animation-duration:var(--calcite-internal-animation-timing-slow)}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,MJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=qv("mutation",()=>this.updateHasContent()),this.resizeObserver=qv("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:e}=this;this.href||(e==="submit"?sJt(this):e==="reset"&&zxn(this))},this.setTooltipText=()=>{const{contentEl:e}=this;e&&(this.tooltipText=e.offsetWidth{this.childEl=e,e&&this.resizeObserver?.observe(e)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.hasLoader=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){zY(this)}loadingChanged(e,t){e&&!t&&(this.hasLoader=!0),!e&&t&&window.setTimeout(()=>{this.hasLoader=!1},300)}onMessagesChange(){}async connectedCallback(){oM(this),Jb(this),v_(this),this.hasLoader=this.loading,this.setupTextContentObserver(),nEe(this),this.formEl=oJt(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),aM(this),mJt(this),Kb(this),__(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){Jv(this),this.updateHasContent(),await g_(this)}componentDidLoad(){Kv(this),this.setTooltipText()}componentDidRender(){sM(this)}render(){const e=this.href?"a":"button",t=e,r=this.hasLoader?Ii("div",{class:cw.buttonLoader},Ii("calcite-loader",{class:this.loading?cw.loadingIn:cw.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,s=Ii("calcite-icon",{class:{[cw.icon]:!0,[cw.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:oS(this.scale)}),o=Ii("calcite-icon",{class:{[cw.icon]:!0,[cw.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:oS(this.scale)}),a=Ii("span",{class:cw.content,ref:l=>this.contentEl=l},Ii("slot",null));return Ii(JR,{disabled:this.disabled},Ii(t,{"aria-disabled":e==="a"?Z1(this.disabled||this.loading):null,"aria-expanded":this.el.getAttribute("aria-expanded"),"aria-label":this.loading?this.messages.loading:eje(this),"aria-live":"polite",class:{[cw.buttonPadding]:n,[cw.buttonPaddingShrunk]:!n,[cw.contentSlotted]:this.hasContent,[cw.iconStartEmpty]:!this.iconStart,[cw.iconEndEmpty]:!this.iconEnd},disabled:e==="button"?this.disabled||this.loading:null,href:e==="a"&&this.href,name:e==="button"&&this.name,onClick:this.handleClick,rel:e==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:e==="a"&&this.target,title:this.tooltipText,type:e==="button"&&this.type,ref:this.setChildEl},r,this.iconStart?s:null,this.hasContent?a:null,this.iconEnd?o:null))}async setFocus(){await Zv(this),this.childEl?.focus()}effectiveLocaleChange(){y_(this,this.effectiveLocale)}updateHasContent(){const e=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:e}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],loading:["loadingChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return F2n}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],hasLoader:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],loading:["loadingChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function OJt(){if(typeof customElements>"u")return;["calcite-button","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-button":customElements.get(e)||customElements.define(e,MJt);break;case"calcite-icon":customElements.get(e)||yy();break;case"calcite-loader":customElements.get(e)||Zb();break}})}OJt();/*! + )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px;transition:inline-size var(--calcite-internal-animation-timing-slow) ease-in-out, opacity var(--calcite-internal-animation-timing-slow) ease-in-out, transform var(--calcite-internal-animation-timing-slow) ease-in-out}.calcite-button--loader calcite-loader.loading-in{animation-name:loader-in;animation-duration:var(--calcite-internal-animation-timing-slow)}.calcite-button--loader calcite-loader.loading-out{animation-name:loader-out;animation-duration:var(--calcite-internal-animation-timing-slow)}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-color-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-color-status-danger);color:var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-color-status-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-color-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-color-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-color-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-color-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-color-brand);background-color:transparent;color:var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-color-brand-hover);color:var(--calcite-color-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-brand);box-shadow:inset 0 0 0 2px var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-color-brand-press);color:var(--calcite-color-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-color-status-danger);background-color:transparent;color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-color-status-danger-hover);color:var(--calcite-color-status-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-color-status-danger);color:var(--calcite-color-status-danger);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-color-status-danger-press);color:var(--calcite-color-status-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-color-text-1);border-color:var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-color-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-color-inverse);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-color-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-color-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-color-text-3);border-block-start-color:var(--calcite-color-border-input);border-block-end-color:var(--calcite-color-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,MJt=Xd(class extends Jd{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=qv("mutation",()=>this.updateHasContent()),this.resizeObserver=qv("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:e}=this;this.href||(e==="submit"?sJt(this):e==="reset"&&jxn(this))},this.setTooltipText=()=>{const{contentEl:e}=this;e&&(this.tooltipText=e.offsetWidth{this.childEl=e,e&&this.resizeObserver?.observe(e)},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.hasLoader=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0}handleGlobalAttributesChanged(){zY(this)}loadingChanged(e,t){e&&!t&&(this.hasLoader=!0),!e&&t&&window.setTimeout(()=>{this.hasLoader=!1},300)}onMessagesChange(){}async connectedCallback(){oM(this),Jb(this),v_(this),this.hasLoader=this.loading,this.setupTextContentObserver(),nEe(this),this.formEl=oJt(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),aM(this),mJt(this),Kb(this),__(this),this.resizeObserver?.disconnect(),this.formEl=null}async componentWillLoad(){Jv(this),this.updateHasContent(),await g_(this)}componentDidLoad(){Kv(this),this.setTooltipText()}componentDidRender(){sM(this)}render(){const e=this.href?"a":"button",t=e,r=this.hasLoader?Ii("div",{class:cw.buttonLoader},Ii("calcite-loader",{class:this.loading?cw.loadingIn:cw.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,n=!this.iconStart&&!this.iconEnd,s=Ii("calcite-icon",{class:{[cw.icon]:!0,[cw.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:oS(this.scale)}),o=Ii("calcite-icon",{class:{[cw.icon]:!0,[cw.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:oS(this.scale)}),a=Ii("span",{class:cw.content,ref:l=>this.contentEl=l},Ii("slot",null));return Ii(JR,{disabled:this.disabled},Ii(t,{"aria-disabled":e==="a"?Z1(this.disabled||this.loading):null,"aria-expanded":this.el.getAttribute("aria-expanded"),"aria-label":this.loading?this.messages.loading:eje(this),"aria-live":"polite",class:{[cw.buttonPadding]:n,[cw.buttonPaddingShrunk]:!n,[cw.contentSlotted]:this.hasContent,[cw.iconStartEmpty]:!this.iconStart,[cw.iconEndEmpty]:!this.iconEnd},disabled:e==="button"?this.disabled||this.loading:null,href:e==="a"&&this.href,name:e==="button"&&this.name,onClick:this.handleClick,rel:e==="a"&&this.rel,tabIndex:this.disabled?-1:null,target:e==="a"&&this.target,title:this.tooltipText,type:e==="button"&&this.type,ref:this.setChildEl},r,this.iconStart?s:null,this.hasContent?a:null,this.iconEnd?o:null))}async setFocus(){await Zv(this),this.childEl?.focus()}effectiveLocaleChange(){y_(this,this.effectiveLocale)}updateHasContent(){const e=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&this.el.childNodes[0]?.nodeName==="#text"?this.el.textContent?.trim().length>0:e}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{"aria-expanded":["handleGlobalAttributesChanged"],loading:["loadingChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return P2n}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],hasLoader:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],setFocus:[64]},void 0,{"aria-expanded":["handleGlobalAttributesChanged"],loading:["loadingChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function OJt(){if(typeof customElements>"u")return;["calcite-button","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-button":customElements.get(e)||customElements.define(e,MJt);break;case"calcite-icon":customElements.get(e)||yy();break;case"calcite-loader":customElements.get(e)||Zb();break}})}OJt();/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const k2n=MJt,L2n=OJt,Xle=Object.freeze(Object.defineProperty({__proto__:null,CalciteButton:k2n,defineCustomElement:L2n},Symbol.toStringTag,{value:"Module"}));/*! + */const R2n=MJt,D2n=OJt,Xle=Object.freeze(Object.defineProperty({__proto__:null,CalciteButton:R2n,defineCustomElement:D2n},Symbol.toStringTag,{value:"Module"}));/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.6.0 - */const N2n=IJt,$2n=yy,sEe=Object.freeze(Object.defineProperty({__proto__:null,CalciteIcon:N2n,defineCustomElement:$2n},Symbol.toStringTag,{value:"Module"})),B2n=["innerHTML"],Rpe=Xr({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=Hr(()=>r?.panel.get(e.panelId)?.button),s=()=>{e.minimize?r?.panel.toggleMinimize(e.panelId):r?.panel.toggle(e.panelId)};return(o,a)=>{const l=Ko("appbar-button");return n.value?(qt(),Dn(l,{key:0,onClickFunction:s,tooltip:ri(t)(n.value.tooltip),id:i.panelId},{default:Rn(()=>[Ot("div",{class:Wn(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":i.overflow}]),innerHTML:n.value.icon},null,10,B2n)]),_:1},8,["tooltip","id"])):Yr("",!0)}}}),j2n={},G2n={class:"border-b p-0 self-center w-2/3"};function U2n(i,e){return qt(),si("span",G2n)}const l_t=ml(j2n,[["render",U2n],["__scopeId","data-v-5d32b715"]]);var z2n={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(e){var t=e.state,r=e.name,n=e.options,s=xB(t,n),o=t.modifiersData.preventOverflow||{x:0,y:0},a=o.x,l=o.y,u=t.rects.popper,c=u.width,h=u.height,p=t.placement.split("-"),m=p[0],v=m==="left"?"left":"right",w=m==="top"?"top":"bottom";t.modifiersData[r]={width:c-s[v]-a,height:h-s[w]-l}}};const V2n=i=>(Dc("data-v-6346dfbd"),i=i(),Fc(),i),H2n=["content","aria-label"],W2n=V2n(()=>Ot("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)),q2n=[W2n],Y2n=Xr({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=vi(!1),s=vi(),o=vi(),a=vi(),l=()=>{n.value=!n.value;const u={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:h}){const{width:p,height:m}=h.modifiersData.maxSize;h.styles.popper={...h.styles.popper,maxWidth:`${p}px`,maxHeight:`${Math.max(80,m)-38}px`},h.styles.popper.overflowY="auto",h.styles.popper.overflowX="hidden"}},c=r.$vApp.$el.querySelector(".inner-shell");o.value&&a.value&&G$t(o.value,a.value,{placement:e.position||"right-end",modifiers:[{...z2n,options:{boundary:c}},u,{name:"offset",options:{offset:[0,5]}}],...e.popperOptions})};return Fa(()=>{window.addEventListener("click",u=>{u.target instanceof HTMLElement&&!s.value?.contains(u.target)&&(n.value=!1)},{capture:!0})}),Ka(()=>{window.removeEventListener("click",u=>{u.target instanceof HTMLElement&&!s.value?.contains(u.target)&&(n.value=!1)},{capture:!0})}),(u,c)=>{const h=Nn("focus-item"),p=Nn("tippy");return qt(),si("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:s},[Ur((qt(),si("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:c[0]||(c[0]=m=>l()),content:ri(t)("appbar.more"),"aria-label":ri(t)("appbar.more"),ref_key:"dropdownTrigger",ref:o},q2n,8,H2n)),[[h],[p,{placement:"right-end"}]]),Ur(Ot("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:a},[Em(u.$slots,"default",{},void 0,!0)],512),[[bf,n.value]])],512)}}}),X2n=ml(Y2n,[["__scopeId","data-v-6346dfbd"]]),J2n=i=>(Dc("data-v-f2294fce"),i=i(),Fc(),i),K2n=J2n(()=>Ot("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),Z2n={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},Q2n=Xr({__name:"appbar-button",setup(i){const e=w3(),{t}=Qn(),r=eo("iApi"),n=Hr(()=>e.notificationNumber),s=()=>{r.panel.toggle("notifications")};return(o,a)=>{const l=Ko("appbar-button",!0);return qt(),Dn(l,{onClickFunction:s,tooltip:ri(t)("notifications.title"),class:"notification-button",id:""},{default:Rn(()=>[K2n,n.value&&n.value>0?(qt(),si("span",Z2n,br(n.value),1)):Yr("",!0)]),_:1},8,["tooltip"])}}}),eSn=ml(Q2n,[["__scopeId","data-v-f2294fce"]]),tSn=["content"],iSn=Xr({__name:"appbar",setup(i){const e=w0(),t=dy(),r=Hr(()=>t.visible),n=Hr(()=>t.temporary),{t:s}=Qn(),o=vi(!1),a=vi({}),l=vi(),u=()=>{l.value._tippy.hide()},c=h=>{h.key==="Tab"&&l.value?.matches(":focus")&&l.value._tippy.show()};return Fa(()=>{l.value?.addEventListener("blur",u),l.value?.addEventListener("keyup",c)}),E0(()=>{const h=Df();window.addEventListener("resize",()=>h?.proxy?.$forceUpdate())}),Ka(()=>{const h=Df();window.removeEventListener("resize",()=>h?.proxy?.$forceUpdate()),l.value?.removeEventListener("blur",u),l.value?.removeEventListener("keyup",c)}),n7(()=>{Bv(()=>{const h=l.value;let p,m=[...h.children],v=m[m.length-2].getBoundingClientRect().top;e.mobileView||(v=h.getBoundingClientRect().bottom-38);let w=h.querySelector("#dropdown");for(let R=m.length-4;R>=0;R--){let L=m[R].getBoundingClientRect().bottom;if(v&&w&&(L>v||o.value&&L+56>v))m[R].classList.forEach(k=>{k.includes("identifier")&&(p=k.slice(11))}),p&&(a.value[p]=!0),o.value||(o.value=!0);else if(L!==0)break}let S=h.querySelector("#more"),I=S.getBoundingClientRect().bottom;if(p=void 0,o.value&&v&&S&&w&&I!==0&&(I<=v-56||w.childElementCount==1&&I<=v)){let R=w.childElementCount,L=0;for(;I<=v-56||R==1;){let k=w.children[L];if(k&&(k.classList.forEach(B=>{B.includes("identifier")&&(p=B.slice(11))}),p&&(a.value[p]=!1),I+=48,R-=1,L+=1),R===0){o.value=!1;break}}}Object.keys(a.value).forEach(R=>{h.querySelector(`.identifier-${R}`)||delete a.value[R]})})}),(h,p)=>{const m=Nn("focus-list"),v=Nn("tippy");return Ur((qt(),si("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:ri(s)("panels.controls.items"),ref_key:"el",ref:l},[(qt(!0),si(Ks,null,hu(r.value,(w,S)=>(qt(),si(Ks,null,[(qt(!0),si(Ks,null,hu(w,(I,R)=>(qt(),si(Ks,null,[typeof I=="string"&&a.value[`${I}-${R}`]!==!0?(qt(),Dn(Rpe,{key:`${I}-${R}-default`,panelId:I,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`])},null,8,["panelId","class"])):a.value[`${I}-${R}`]!==!0?(qt(),Dn(xR(I.componentId),{key:`${I}-${R}-custom`,options:I.options,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`]),id:I.id},null,8,["options","id","class"])):Yr("",!0)],64))),256)),a.value[`divider-${S}`]!==!0?(qt(),Dn(l_t,{class:Wn(["appbar-item",`identifier-divider-${S}`]),key:`${w}-${S}-default`},null,8,["class"])):Yr("",!0)],64))),256)),(qt(!0),si(Ks,null,hu(n.value?.filter(w=>a.value[`${w}-temp`]!==!0),w=>(qt(),Dn(Rpe,{panelId:w,minimize:!0,key:`${w}-temp`,class:Wn([`identifier-${w}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),Ur(Vn(X2n,{id:"more"},{default:Rn(()=>[(qt(!0),si(Ks,null,hu(r.value,(w,S)=>(qt(),si(Ks,{key:S},[(qt(!0),si(Ks,null,hu(w,(I,R)=>(qt(),si(Ks,null,[typeof I=="string"&&a.value[`${I}-${R}`]?(qt(),Dn(Rpe,{key:`${I}-${R}-default`,panelId:I,class:Wn(["text-black hover:bg-gray my-4 h-36",`identifier-${I}-${R}`]),overflow:""},null,8,["panelId","class"])):a.value[`${I}-${R}`]?(qt(),Dn(xR(I.componentId),{key:`${I}-${R}-custom`,options:I.options,id:I.id,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`])},null,8,["options","id","class"])):Yr("",!0)],64))),256)),a.value[`divider-${S}`]?(qt(),Dn(l_t,{key:0,class:Wn(["border-black my-4",`identifier-divider-${S}`])},null,8,["class"])):Yr("",!0)],64))),128)),(qt(!0),si(Ks,null,hu(n.value?.filter(w=>a.value[`${w}-temp`]),w=>(qt(),Dn(Rpe,{panelId:w,minimize:!0,key:`${w}-temp`,class:Wn([`identifier-${w}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},512),[[bf,o.value]]),Vn(eSn,{class:"appbar-item bottom-48 h-48 sm:display-none"}),Vn(W$t,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,tSn)),[[m],[v,{trigger:"manual",placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class rSn extends Yu{get config(){return super.config}_parseConfig(e){if(!e)return;const t=dy(this.$vApp.$pinia);let r;Array.isArray(e.items[0])?r=e.items:r=[e.items];const n=[];r.forEach(s=>{n.push(s.map(o=>typeof o=="string"?o:new BMe(o)))}),t.items=n.flat().reduce((s,o)=>(s[o instanceof BMe?o.id:o]=o,s),{}),t.order=n.map(s=>s.map(o=>o instanceof BMe?o.id:o)),this._validateItems()}_validateItems(){const e=dy(this.$vApp.$pinia);e.order.flat().forEach(t=>{typeof e.items[t]!="string"&&[t].some(r=>{this.$iApi.fixture.exists(r)&&!e.items[t]&&(e.items[t].componentId=`${r}-appbar-button`)})})}}const nSn={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class sSn extends rSn{initialized(){}async added(){Object.entries(nSn).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:e,el:t}=this.mount(iSn,{app:this.$element}),r=this.$vApp.$el.getElementsByClassName("inner-shell")[0];r.insertBefore(t.childNodes[0],r.querySelector(".panel-stack")),this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=[];s.push(this.$iApi.event.on(ln.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const o=dy(this.$vApp.$pinia);n(),s.forEach(u=>this.$iApi.event.off(u));const a={...o.items},l=[...o.temporary];Object.keys(a).forEach(u=>o.removeButton(u)),l.forEach(u=>o.removeButton(u)),e(),o.$reset()}}}const oSn=Object.freeze(Object.defineProperty({__proto__:null,default:sSn},Symbol.toStringTag,{value:"Module"})),aSn=i=>(Dc("data-v-74cdad7d"),i=i(),Fc(),i),lSn={class:"mt-10"},uSn=["aria-label"],cSn=["alt","src"],hSn=["alt"],dSn={class:"absolute flex w-full bg-black opacity-75 text-white h-30 bottom-6 items-center"},pSn={class:"pl-5"},fSn={class:"ml-auto pr-5"},mSn=["content"],gSn=aSn(()=>Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})],-1)),ySn=[gSn],vSn=Xr({__name:"item",props:{area:{type:Object,required:!0},showThumbnail:{type:Boolean}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=n=>{if(!n.extent){console.error("selected area of interest doesn't have an extent specified.");return}t?.geo.map.zoomMapTo(Yh.fromConfig("area-of-interest-extent",n.extent))};return(n,s)=>{const o=Nn("truncate"),a=Nn("tippy"),l=Nn("focus-item");return qt(),si("div",lSn,[Ur((qt(),si("button",{type:"button",class:Wn(["area-of-interest-item-button bg-gray-300 w-full",{"border border-gray-300":i.showThumbnail}]),"aria-label":ri(e)("areas-of-interest.select"),onClick:s[2]||(s[2]=u=>r(i.area))},[Ot("div",null,[Ot("div",{class:Wn(["flex hover:opacity-50 area-of-interest-item-image",i.showThumbnail?"h-180":"h-30"])},[i.area.thumbnail?(qt(),si("img",{key:0,class:"w-full bg-white object-contain",alt:i.area.altText||i.area.title,src:i.area.thumbnail},null,8,cSn)):i.showThumbnail?(qt(),si("img",{key:1,class:"w-full bg-white object-contain py-30",alt:i.area.altText||i.area.title,src:"https://openclipart.org/image/800px/160615"},null,8,hSn)):Yr("",!0)],2)]),Ot("div",dSn,[Ur((qt(),si("div",pSn,[Ot("span",null,br(i.area.title),1)])),[[o]]),Ur(Ot("div",fSn,[Ur((qt(),si("a",{onClick:s[0]||(s[0]=ia(()=>{},["stop"])),onKeydown:s[1]||(s[1]=Ph(ia(()=>{},["prevent"]),["enter","space"])),content:i.area.description},ySn,40,mSn)),[[a,{placement:"bottom",trigger:"click focus"}]])],512),[[bf,i.area.description]])])],10,uSn)),[[l]])])}}}),_Sn=ml(vSn,[["__scopeId","data-v-74cdad7d"]]),bSn={class:"h-600 overflow-y-auto"},wSn={class:"mx-5"},xSn={key:0},PJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=yTe(),r=Hr(()=>t.areas);let n=vi(!1);return Fa(()=>{n.value=!!r.value?.some(s=>s.thumbnail)}),(s,o)=>{const a=Ko("panel-screen"),l=Nn("focus-list");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("areas-of-interest.title")),1)]),content:Rn(()=>[Ot("div",bSn,[Ot("div",wSn,[r.value.length>0?Ur((qt(),si("ul",xSn,[(qt(!0),si(Ks,null,hu(r.value,(u,c)=>(qt(),si("li",{key:c},[Vn(_Sn,{area:u,"show-thumbnail":ri(n),class:"block relative overflow-hidden"},null,8,["area","show-thumbnail"])]))),128))])),[[l]]):Yr("",!0)])])]),_:1},8,["panel"])}}}),SSn=Object.freeze(Object.defineProperty({__proto__:null,default:PJt},Symbol.toStringTag,{value:"Module"})),TSn={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class CSn extends Yu{get config(){return super.config}_parseConfig(e){if(!e)return;const t=yTe(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class ESn extends CSn{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":Da(PJt)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:TSn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),yTe(this.$vApp.$pinia).$reset()}}}const ISn=Object.freeze(Object.defineProperty({__proto__:null,default:ESn},Symbol.toStringTag,{value:"Module"})),RJt=i=>(Dc("data-v-dbfed424"),i=i(),Fc(),i),ASn={class:"mb-10"},MSn=["aria-label"],OSn={key:0,class:"w-full h-30"},PSn=["alt","src"],RSn=["alt","src"],DSn=["alt"],FSn={class:"pl-5"},kSn={class:"ml-auto pr-5"},LSn=["content"],NSn=RJt(()=>Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})],-1)),$Sn=[NSn],BSn={key:0,class:"rv-basemap-check absolute top-0 right-0"},jSn=RJt(()=>Ot("svg",{class:"fill-current w-25 h-25 relative",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),GSn=[jSn],USn=Xr({__name:"item",props:{basemap:{type:Object,required:!0},tileSchema:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=bm(),n=Hr(()=>r.activeBasemapConfig),s=o=>{o.id!==n.value.id&&t?.geo.map.setBasemap(o.id)};return(o,a)=>{const l=Nn("truncate"),u=Nn("tippy"),c=Nn("focus-item");return qt(),si("div",ASn,[Ur((qt(),si("button",{class:"basemap-item-button bg-gray-300 w-full h-full",type:"button","aria-label":ri(e)("basemap.select"),onClick:a[2]||(a[2]=h=>s(i.basemap))},[Ot("div",null,[Ot("div",{class:Wn(["flex hover:opacity-50 basemap-item-image basemap-item-container",i.basemap.hideThumbnail?"h-30":"h-180"])},[i.basemap.hideThumbnail?(qt(),si("img",OSn)):i.basemap.thumbnailUrl?(qt(),si("img",{key:1,class:"w-full h-180",alt:i.basemap.altText,src:i.basemap.thumbnailUrl},null,8,PSn)):i.tileSchema.thumbnailTileUrls&&i.tileSchema.thumbnailTileUrls.length>0&&i.basemap.layers.every(h=>h.layerType==="esri-tile")?(qt(!0),si(Ks,{key:2},hu(i.basemap.layers,h=>(qt(),si("div",{key:h.id,class:"flex basemap-item-inner h-180"},[(qt(!0),si(Ks,null,hu(i.tileSchema.thumbnailTileUrls,(p,m)=>(qt(),si("img",{class:"w-full",alt:i.basemap.altText,src:h.url+p,key:m},null,8,RSn))),128))]))),128)):(qt(),si("img",{key:3,class:"w-full bg-white h-180",alt:i.basemap.altText,src:"https://openclipart.org/image/800px/275366"},null,8,DSn))],2)]),Ot("div",{class:Wn(["absolute flex w-full bg-black text-white h-30 bottom-6 items-center",i.basemap.hideThumbnail&&i.basemap.id===n.value.id?"opacity-85":"opacity-75"])},[Ur((qt(),si("div",FSn,[Ot("span",null,br(i.basemap.name),1)])),[[l]]),Ot("div",kSn,[Ur((qt(),si("a",{onClick:a[0]||(a[0]=ia(()=>{},["stop"])),onKeydown:a[1]||(a[1]=Ph(ia(()=>{},["prevent"]),["enter","space"])),content:i.basemap.description},$Sn,40,LSn)),[[u,{placement:"bottom",trigger:"click focus"}]])])],2),i.basemap.id===n.value.id&&!i.basemap.hideThumbnail?(qt(),si("div",BSn,GSn)):Yr("",!0)],8,MSn)),[[c]])])}}}),zSn=ml(USn,[["__scopeId","data-v-dbfed424"]]),VSn={class:"h-600 overflow-y-auto"},HSn={class:"font-bold text-xl"},WSn={key:0,class:"border-t border-b border-gray-600"},DJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=bm(),r=vi([]),n=vi([]);Fa(()=>{const o=t.config.map;r.value=o.tileSchemas,n.value=o.basemaps});const s=o=>n.value.filter(a=>a.tileSchemaId===o);return(o,a)=>{const l=Ko("panel-screen"),u=Nn("truncate"),c=Nn("focus-list");return qt(),Dn(l,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("basemap.title")),1)]),content:Rn(()=>[Ot("div",VSn,[(qt(!0),si(Ks,null,hu(r.value,(h,p)=>(qt(),si("div",{class:"mx-5",key:h.id},[Ot("div",{class:Wn((p===0?"mt-5":"mt-36")+" flex mb-5")},[Ur((qt(),si("h3",HSn,[Xs(br(h.name),1)])),[[u]])],2),n.value.length>0?Ur((qt(),si("ul",WSn,[(qt(!0),si(Ks,null,hu(s(h.id),m=>(qt(),si("li",{key:m.id},[Vn(zSn,{basemap:m,tileSchema:h,class:"block relative overflow-hidden"},null,8,["basemap","tileSchema"])]))),128))])),[[c]]):Yr("",!0)]))),128))])]),_:1},8,["panel"])}}}),qSn=Object.freeze(Object.defineProperty({__proto__:null,default:DJt},Symbol.toStringTag,{value:"Module"})),YSn=Ot("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1),XSn=Xr({__name:"nav-button",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>t?.panel.toggle("basemap");return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("basemap.title")},{default:Rn(()=>[YSn]),_:1},8,["tooltip"])}}}),JSn={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class KSn extends Yu{added(){this.$iApi.component("basemap-nav-button",XSn),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":Da(DJt)},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:JSn}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}const ZSn=Object.freeze(Object.defineProperty({__proto__:null,default:KSn},Symbol.toStringTag,{value:"Module"})),QSn=i=>(Dc("data-v-495353cf"),i=i(),Fc(),i),eTn=QSn(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[Ot("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[Ot("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),Ot("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),Ot("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),Ot("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),Ot("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)),tTn=[eTn],iTn=Xr({__name:"crosshairs",setup(i){const e=eo("iApi"),t=vi(!1),r=vi([]);return Fa(()=>{r.value.push(e.event.on(ln.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(t.value=!0)})),r.value.push(e.event.on(ln.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(t.value=!0)})),r.value.push(e.event.on(ln.MAP_MOUSEDOWN,()=>{t.value=!1})),r.value.push(e.event.on(ln.MAP_BLUR,()=>{t.value=!1}))}),Ka(()=>{r.value.forEach(n=>e.event.off(n))}),(n,s)=>(qt(),si("div",{class:Wn(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!t.value}])},tTn,2))}}),rTn=ml(iTn,[["__scopeId","data-v-495353cf"]]);class nTn extends Yu{added(){const{destroy:e,el:t}=this.mount(rTn,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{e()}}}const sTn=Object.freeze(Object.defineProperty({__proto__:null,default:nTn},Symbol.toStringTag,{value:"Module"})),Coe="Ramp-Hilight",CRe="Ramp-Hilight-Fog-Basemap",oTn={mode:"glow",options:{haloColor:[0,255,0],haloOpacity:.8}};var k8=(i=>(i.NONE="none",i.GLOW="glow",i.LIFT="lift",i.FOG="fog",i))(k8||{});const ERe="details";class aTn extends Yu{detailsStore=tL(this.$vApp.$pinia);get config(){return super.config}openDetails(e){this.detailsStore.payload=e;const t=this.$iApi.panel.get("details-panel");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",e.forEach(n=>{const s=this.$iApi.useStore("layer").getLayerByUid(n.uid);this._loadDetailsConfig(s)}),this.$iApi.panel.get("details-panel").isOpen||this.$iApi.panel.open({id:"details-panel"})}toggleFeature(e,t){const r=this.$iApi.panel.get("details-panel");if(t===!1){r.close(),this.detailsStore.currentFeatureId=void 0;return}const n=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${n?.supportsFeatures?e.data[n?.oidField??""]:JSON.stringify(e.data)}`;if(r.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){r.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",r.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(n);const o={items:[fq.makeRawItem(e.format,e.data)],uid:e.uid,loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[o],r.isOpen||r.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details-panel"]),this.handlePanelTeleports(["details-panel"]);const t=this.getLayerFixtureConfigs(),r=[];Object.keys(t).forEach(s=>{r.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields})});const n=r.map(s=>new EIr(s));this.detailsStore.properties=n.reduce((s,o)=>(s[o.id]=o,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const r=this.getLayerFixtureConfigs();r[e.id]!==void 0&&this.detailsStore.addConfigProperty({id:e.id,name:r[e.id].name,template:r[e.id].template,fields:r[e.id].fields})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await n.getGraphicsByKey(ERe);await n.removeHilight(s);const o=Date.now();this.detailsStore.lastHilight=o;const a=await this.getHilightGraphics(r,t);this.detailsStore.lastHilight===o&&(await n.addHilight(a),this.detailsStore.lastHilight!==o&&n.removeHilight(a))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(ERe);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await this.getHilightGraphics(r,t);n.reloadHilight(s)}}async getHilightGraphics(e,t){const r=this.$iApi.geo.layer.getLayer(t),n=this.$iApi.fixture.get("hilight"),s=[];return r&&await Promise.all(e.map(async o=>{await o.loading;const a=o.data[r.oidField],l=await r.getGraphic(a,{getGeom:!0,getAttribs:!0,getStyle:!0});l.id=n.constructGraphicKey(ERe,t,a),s.push(l)})),s}onHilightToggle(e,t,r){this.detailsStore.hilightToggle=e,e&&t&&r?this.hilightDetailsItems(t,r):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==k8.NONE}}const lTn=i=>(Dc("data-v-256f0518"),i=i(),Fc(),i),uTn={key:0,class:"relative"},cTn={key:0,class:"relative"},hTn=["innerHTML"],dTn=["src"],pTn={key:1,class:"w-32 h-32"},fTn={class:"symbologyIcon"},mTn=["innerHTML"],gTn=["src"],yTn={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},vTn={key:0,class:"px-5"},_Tn={key:1,class:"inline-flex justify-center items-center relative"},bTn=lTn(()=>Ot("div",{class:"symbologyIcon h-32 w-32"},[Ot("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)),wTn=[bTn],xTn=Xr({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(i){const e=i,t=vi([]);return Fa(()=>{t.value=e.layer.legend}),(r,n)=>i.result.loaded?(qt(),si("div",uTn,[Ot("div",{class:Wn(i.result.items.length===0?"opacity-50":"")},[t.value.length>1?(qt(),si("div",cTn,[(qt(!0),si(Ks,null,hu(t.value.slice(0,3).reverse(),(s,o)=>(qt(),si("div",{class:Wn(["absolute",[o==0?"symbol-0":o==1?"left-3":"left-6"]]),style:s_({"z-index":3-o}),key:o},[t.value[o].svgcode?(qt(),si("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:t.value[o].svgcode},null,8,hTn)):t.value[o].imgUrl?(qt(),si("img",{key:1,class:"symbologyIcon w-28 h-28",src:t.value[o].imgUrl},null,8,dTn)):Yr("",!0)],6))),128))])):t.value.length>0?(qt(),si("div",pTn,[Ot("div",fTn,[t.value[0].svgcode?(qt(),si("span",{key:0,innerHTML:t.value[0].svgcode},null,8,mTn)):t.value[0].imgUrl?(qt(),si("img",{key:1,class:"symbologyIcon w-full h-full",src:t.value[0].imgUrl},null,8,gTn)):Yr("",!0)])])):Yr("",!0)],2),Ot("div",yTn,[i.result.loaded?(qt(),si("div",vTn,br(i.result.items.length),1)):Yr("",!0)])])):(qt(),si("div",_Tn,wTn))}}),STn=ml(xTn,[["__scopeId","data-v-256f0518"]]),TTn=["content"],CTn={class:"symbologyLayerName truncate"},ETn=Xr({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(i){const e=i,t=tL(),r=Hr(()=>t.properties),n=()=>{const s=e.layer;return s&&r.value[s.id]&&r.value[s.id].name?r.value[s.id].name:s?.name??""};return(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{class:Wn(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",i.selected?"detailsButtonSelected":"px-11"]),onClick:o[0]||(o[0]=ia(()=>{},["stop"])),content:n()},[Vn(STn,{class:"symbStack w-32 h-32 mr-10",layer:i.layer,result:i.result},null,8,["layer","result"]),Ot("div",CTn,br(n()),1)],10,TTn)),[[a,{placement:"right",sticky:!0}]])}}}),ITn=["onBlur"],ATn=Xr({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(i,{emit:e}){const t=i,r=H1(),n=vi(""),s=vi([]),o=vi(!1),a=vi(!1),l=v=>r.getLayerByUid(v),u=v=>{n.value=v,e("selection-changed",v),o.value=!1},c=()=>{a.value||setTimeout(()=>{o.value=a.value},500),a.value=!0},h=()=>{o.value=a.value=!1},p=()=>{a.value||(o.value=!0),a.value=!0},m=()=>{o.value=a.value=!1};return E0(()=>{s.value.push(rl(t,()=>{n.value=t.selected}))}),Ka(()=>{s.value.forEach(v=>v())}),(v,w)=>{const S=Nn("focus-item"),I=Nn("focus-list");return Ur((qt(),si("div",{class:Wn(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":o.value}]),onMouseover:c,onMouseleave:h,onFocus:p,onBlur:ia(m,["self"])},[(qt(!0),si(Ks,null,hu(t.results,(R,L)=>(qt(),si("div",{class:"flex justify-start relative",key:L},[Ur((qt(),Dn(ETn,{key:R.uid,layer:l(R.uid),result:R,selected:R.uid===n.value,onClick:k=>u(R.uid)},null,8,["layer","result","selected","onClick"])),[[S]])]))),128))],42,ITn)),[[I]])}}}),MTn={class:"inline font-bold"},OTn=Ot("span",{class:"flex-auto"},null,-1),PTn=["innerHTML"],RTn=Xr({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=(u,c,h,p)=>{const m=u.find(v=>v[c].toLowerCase()===h.toLowerCase());m&&delete p[m.name]},s=()=>{const u=Object.assign({},e.identifyData.data);n(e.fields,"type","geometry",u),r?.ui.exposeOids||n(e.fields,"type","oid",u),r?.ui.exposeMeasurements||(n(e.fields,"name","shape_length",u),n(e.fields,"name","shape_area",u));const c={};e.fields.forEach(p=>{const m=e.fixtureFields?.find(v=>p.name===v.field);c[p.name]={name:m?.alias||p.alias||p.name,type:p.type,visible:m?.visible??!0}});const h={};Object.keys(u).forEach(p=>{const m=c[p];if(m&&m.visible){const v=u[p];h[p]={value:typeof v=="number"?r?.ui.formatNumber(v):v,alias:m.name,type:m.type}}});for(const[p]of Object.entries(h))r.ui.isPlainText(h[p].value)&&(h[p].value=r.ui.escapeHtml(h[p].value));return h},o=(u,c,h)=>{switch(h){case"date":return l(u);default:return a(u,c)}},a=(u,c)=>{if(!u)return u;if(u.trim().match(/\.(jpeg|jpg|gif|png)$/)||u.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${t(`;const h="underline text-blue-600 break-all",p=document.createElement("div");return p.innerHTML=u.trim(),p.firstElementChild?.tagName=="A"?(p.firstElementChild.className=h,p.innerHTML):gTe(u,{className:h,target:"_blank",validate:{url:v=>/^https?:\/\//.test(v)}})},l=u=>{const c=parseInt(u);return isNaN(c)?u:new Date(c).toISOString().split("T")[0]};return(u,c)=>(qt(),si("div",null,[(qt(!0),si(Ks,null,hu(s(),(h,p,m)=>(qt(),si("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:m},[Ot("span",MTn,br(h.alias),1),OTn,Ot("span",{class:"inline",innerHTML:o(h.value,h.alias,h.type)},null,8,PTn)]))),128))]))}}),DTn=["innerHTML"],FTn={key:1},kTn=Xr({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>i.identifyData?(qt(),si("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:i.identifyData.data.data??i.identifyData.data},null,8,DTn)):(qt(),si("div",FTn,br(ri(e)("details.layers.results.empty")),1))}}),LTn={class:"relative flex flex-grow truncate"},NTn={key:0,class:"flex flex-grow items-center truncate"},$Tn={class:"flex p-8 items-center"},BTn=["innerHTML"],jTn={key:1,class:"symbologyIcon p-6"},GTn=Ot("div",{class:"animate-spin spinner h-20 w-20"},null,-1),UTn=[GTn],zTn=["content","innerHTML"],VTn={class:"zoomButton text-center p-3"},HTn=["content","aria-label"],WTn={key:0,class:"m-auto animate-spin spinner h-20 w-20"},qTn={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},YTn=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1),XTn=[YTn],JTn={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},KTn=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),ZTn=[KTn],QTn=["innerHTML"],u_t=Xr({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1}},setup(i){const e=i,t=H1(),r=eo("iApi"),n=vi([]),s=tL(),{t:o}=Qn(),a=vi(""),l=vi("none"),u=vi(),c=()=>t.getLayerByUid(e.uid),h=Hr(()=>s.properties),p=Hr(()=>s.defaultTemplates),m=Hr(()=>c()?.supportsFeatures??!1),v=Hr(()=>c()?.mapLayer??!1),w=Hr(()=>{const Y=c()?.nameField;let K=Y&&e.data.loaded?e.data.data[Y]:r.$i18n.t("details.items.title");return r.ui.isPlainText(K)&&(K=r.ui.escapeHtml(K)),K}),S=Y=>{if(typeof Y=="string"){const K="underline text-blue-600 break-all",Q=document.createElement("div");return Q.innerHTML=Y.trim(),Q.firstElementChild?.tagName=="A"?(Q.firstElementChild.className=K,Q.innerHTML):gTe(Y,{className:K,target:"_blank",validate:{url:ne=>/^https?:\/\//.test(ne)}})}return Y},I=()=>{$("none"),e.data.loaded?R():e.data.load().then(()=>{R()})},R=()=>{if(a.value="",!(e.data&&e.data.loaded))return;const Y=c();if(Y===void 0){console.warn(`could not find layer for uid ${e.uid} during icon lookup`);return}if(Y.supportsFeatures){const K=Y.oidField;Y.getIcon(e.data.data[K]).then(Q=>{a.value=Q})}},L=Hr(()=>{const Y=c();return Y&&h.value[Y.id]&&h.value[Y.id].template?h.value[Y.id].template:p.value&&p.value[e.data.format]?p.value[e.data.format]:m.value?RTn:kTn}),k=Hr(()=>m.value?c()?.fields||[]:[]),B=Hr(()=>{const Y=c();if(Y&&h.value[Y.id]&&h.value[Y.id].fields)return h.value[Y.id].fields}),$=Y=>{Y==="zoomed"||Y==="error"?setTimeout(()=>{l.value=Y,u.value?._tippy.show(),setTimeout(()=>{u.value?._tippy.hide(),l.value="none"},3e3)},300):l.value=Y},V=()=>{if(l.value!=="none")return;$("zooming");const Y=c();if(Y===void 0||!Y.isLoaded){console.warn(`Could not find layer for uid ${e.uid} during zoom geometry lookup`),$("error");return}if(!e.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),$("error");return}const K=e.data.data[Y.oidField],Q=()=>{const re={getGeom:!0};Y.getGraphic(K,re).then(ne=>{ne.geometry.invalid()?(console.error(`Could not find graphic for objectid ${K}`),$("error")):(r.geo.map.zoomMapTo(ne.geometry),$("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom")))}).catch(()=>{$("error")})};Y.layerType===pn.FEATURE&&Y.geomType!==cl.POINT?Y.getGraphicExtent(K).then(re=>{r.geo.map.zoomMapTo(re),$("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom"))}).catch(()=>{Q()}):Q()};return E0(()=>{n.value.push(rl(e,()=>{I()},{deep:!1,immediate:!0}))}),Ka(()=>{n.value.forEach(Y=>Y())}),(Y,K)=>{const Q=Nn("tippy");return qt(),si(Ks,null,[Ot("div",LTn,[i.data.loaded&&m.value?(qt(),si("div",NTn,[Ot("div",$Tn,[a.value?(qt(),si("span",{key:0,class:"flex-none symbologyIcon",innerHTML:a.value},null,8,BTn)):(qt(),si("div",jTn,UTn))]),Ur(Ot("span",{class:"itemName pl-3 text-left flex-grow truncate",content:w.value,innerHTML:S(w.value)},null,8,zTn),[[Q,{placement:"right"}]]),Ot("span",VTn,[v.value?Ur((qt(),si("button",{key:0,type:"button",content:ri(o)(`details.item.zoom${l.value==="none"?"":`.${l.value}`}`),"aria-label":ri(o)(`grid.cells.zoom${l.value==="none"?"":`.${l.value}`}`),ref_key:"zoomButton",ref:u,onClick:K[0]||(K[0]=re=>{re.stopPropagation(),V()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[l.value==="zooming"?(qt(),si("div",WTn)):l.value==="zoomed"?(qt(),si("svg",qTn,XTn)):l.value==="error"?(qt(),si("svg",JTn,ZTn)):(qt(),si("span",{key:3,innerHTML:ri(r).ui.getZoomIcon()},null,8,QTn))],8,HTn)),[[Q,{placement:"bottom"}]]):Yr("",!0)])])):Yr("",!0)]),i.open?(qt(),Dn(xR(L.value),{key:0,identifyData:i.data,fields:k.value,fixtureFields:B.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):Yr("",!0)],64)}}});var tje={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(i){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},modelValue:{validator:function(i){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(i,e){const t=function(o,a,l){const{value:u,modelValue:c,falseValue:h,trueValue:p,disabled:m}=g8(o),v=c&&c.value!==void 0?c:u,w=Hr(()=>v.value===p.value),S=L=>{a.emit("input",L),a.emit("update:modelValue",L),a.emit("change",L)},I=()=>{S(p.value)},R=()=>{S(h.value)};return[null,void 0,!1,0,"0","off"].indexOf(v.value)!==-1&&[h.value,p.value].indexOf(v.value)===-1&&R(),[!0,1,"1","on"].indexOf(v.value)!==-1&&[h.value,p.value].indexOf(v.value)===-1&&I(),{externalValue:v,checked:w,update:S,check:I,uncheck:R,handleInput:L=>{S(L.target.checked?p.value:h.value)},handleClick:()=>{m.value||(w.value?R():I())}}}(i,e),r=function(o,a,l){const{trueValue:u,falseValue:c,onLabel:h,offLabel:p}=g8(o),m=l.checked,v=l.update;return{label:Hr(()=>{let w=m.value?h.value:p.value;return w||(w=" "),w}),toggle:()=>{v(m.value?c.value:u.value)},on:()=>{v(u.value)},off:()=>{v(c.value)}}}(i,0,{checked:t.checked,update:t.update}),n=function(o,a,l){const u=g8(o),c=u.disabled,h=l.checked,p=Hr(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...u.classes.value}));return{classList:Hr(()=>({container:p.value.container,toggle:[p.value.toggle,c.value?h.value?p.value.toggleOnDisabled:p.value.toggleOffDisabled:h.value?p.value.toggleOn:p.value.toggleOff],handle:[p.value.handle,c.value?h.value?p.value.handleOnDisabled:p.value.handleOffDisabled:h.value?p.value.handleOn:p.value.handleOff],label:p.value.label}))}}(i,0,{checked:t.checked}),s=function(o,a,l){const{disabled:u}=g8(o),c=l.check,h=l.uncheck,p=l.checked;return{handleSpace:()=>{u.value||(p.value?h():c())}}}(i,0,{check:t.check,uncheck:t.uncheck,checked:t.checked});return{...t,...n,...r,...s}}};const eCn=["tabindex","aria-checked","aria-describedby","aria-labelledby"],tCn=["id","name","value","checked","disabled"],iCn=["innerHTML"],rCn=["checked"];tje.render=function(i,e,t,r,n,s){return qt(),si("div",Kae({class:i.classList.container,tabindex:t.disabled?void 0:0,"aria-checked":i.checked,"aria-describedby":t.describedby,"aria-labelledby":t.labelledby,role:"switch"},t.aria,{onKeypress:e[1]||(e[1]=Ph(ia((...o)=>i.handleSpace&&i.handleSpace(...o),["prevent"]),["space"]))}),[Ur(Ot("input",{type:"checkbox",id:t.id,name:t.name,value:t.trueValue,checked:i.checked,disabled:t.disabled},null,8,tCn),[[bf,!1]]),Ot("div",{class:Wn(i.classList.toggle),onClick:e[0]||(e[0]=(...o)=>i.handleClick&&i.handleClick(...o))},[Ot("span",{class:Wn(i.classList.handle)},null,2),Em(i.$slots,"label",{checked:i.checked,classList:i.classList},()=>[Ot("span",{class:Wn(i.classList.label),innerHTML:i.label},null,10,iCn)]),t.required?(qt(),si("input",{key:0,type:"checkbox",style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},checked:i.checked,"aria-hidden":"true",tabindex:"-1",required:""},null,8,rCn)):Yr("v-if",!0)],2)],16,eCn)},tje.__file="src/Toggle.vue";const nCn=i=>(Dc("data-v-9717afbc"),i=i(),Fc(),i),sCn={class:"flex flex-row rv-label"},oCn={class:"flex items-center"},aCn=["innerHTML"],lCn=nCn(()=>Ot("div",{class:"flex-1"},null,-1)),uCn=Xr({__name:"toggle-switch-control",props:{config:{type:Object,required:!0},name:String,icon:String,ariaLabel:String},emits:["toggled"],setup(i,{emit:e}){const t=i,r=vi(t.config.value),n=vi(!!t.config.disabled),s=vi(0),o=Zl([]),a=vi(null);o.push(rl(LSe(t,"config"),(c,h)=>{r.value=c.value,n.value=!!c.disabled,s.value+=n.value!==h.disabled?1:0},{deep:!0}),rl(a,c=>{c&&u()}));const l=()=>{n.value||(r.value=!r.value,e("toggled",r.value))},u=()=>{if(a.value){const c=a.value.querySelector('input[type="checkbox"]');c&&t.ariaLabel&&c.setAttribute("aria-label",t.ariaLabel)}};return Ka(()=>{o.forEach(c=>c())}),(c,h)=>(qt(),si("div",sCn,[Ot("div",oCn,[Ot("div",{innerHTML:i.icon,class:"p-8 pl-0"},null,8,aCn),Xs(" "+br(i.name),1)]),lCn,Ot("div",{ref_key:"toggleWrapper",ref:a},[(qt(),Dn(ri(tje),{onChange:h[0]||(h[0]=p=>e("toggled",p)),onKeyupCapture:[Ph(ia(l,["stop"]),["enter"]),Ph(ia(l,["stop"]),["space"])],disabled:n.value,key:s.value,modelValue:r.value,"onUpdate:modelValue":h[1]||(h[1]=p=>r.value=p),classes:{container:"inline-block rounded-full outline-none focus:ring focus:ring-blue-500 focus:ring-opacity-30",toggle:"flex w-40 h-15 rounded-full relative cursor-pointer transition items-center box-content border-2 text-xs leading-none",toggleOn:"bg-blue-500 border-blue-500 justify-start text-white",toggleOff:"bg-gray-200 border-gray-200 justify-end text-gray-700",toggleOnDisabled:"bg-gray-300 border-gray-300 justify-start text-gray-400 cursor-not-allowed",toggleOffDisabled:"bg-gray-200 border-gray-200 justify-end text-gray-400 cursor-not-allowed",handle:"inline-block bg-white w-15 h-15 top-0 rounded-full absolute transition-all",handleOn:"left-full transform -translate-x-full",handleOff:"left-0",handleOnDisabled:"bg-gray-100 left-full transform -translate-x-full",handleOffDisabled:"bg-gray-100 left-0",label:"text-center w-8 border-box whitespace-nowrap select-none"}},null,8,["onKeyupCapture","disabled","modelValue"]))],512)]))}}),FJt=ml(uCn,[["__scopeId","data-v-9717afbc"]]),hZe=i=>(Dc("data-v-04b12e3e"),i=i(),Fc(),i),cCn={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},hCn={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},dCn={for:"toggle"},pCn={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},fCn={class:"flex justify-between"},mCn=["aria-label"],gCn={class:"flex bg-gray-200 py-8 items-center"},yCn=["content","aria-label","disabled"],vCn=hZe(()=>Ot("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Ot("g",null,[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)),_Cn=[vCn],bCn={class:"px-8"},wCn=["content","aria-label","disabled"],xCn=hZe(()=>Ot("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Ot("g",null,[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)),SCn=[xCn],TCn={key:3},CCn={key:0},ECn={key:0,class:"flex flex-col"},ICn=["onClick"],ACn={key:1,class:"text-center"},MCn={key:4,class:"p-5"},OCn=hZe(()=>Ot("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),PCn=Xr({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(i){const e=i,t=eo("iApi"),r=tL(),n=H1(),{t:s}=Qn(),o=vi(!1),a=vi(t.fixture.get("details")),l=vi(!0),u=vi(!1),c=vi(0),h=vi([]),p=vi([]),m=Hr(()=>r.activeGreedy),v=Hr(()=>r.properties),w=()=>n.getLayerByUid(e.uid),S=Hr(()=>e.results.find(H=>H.uid===e.uid)?.loaded??!1),I=Hr(()=>e.results.find(H=>H.uid===e.uid)?.requestTime),R=Hr(()=>{const pe=w();return pe&&v.value[pe.id]&&v.value[pe.id].name?v.value[pe.id].name:pe?.name??""}),L=()=>{const pe=e.results.find(H=>H.uid===e.uid);return pe?pe.items:[]},k=Hr(()=>L()[c.value]),B=Hr(()=>{if(a.value.hasHilighter()){const pe=w();if(pe)return pe.mapLayer&&pe.supportsFeatures}return!1}),$=pe=>{l.value=pe,r.hilightToggle=pe,K()},V=()=>{const pe=w();c.value=c.value??0,l.value=r.hilightToggle??l.value,u.value=!1,o.value=!!pe,K()},Y=pe=>{c.value+=pe},K=()=>{const pe=L();if(l.value&&S&&pe.length>0&&B.value)if(u.value)a.value.hilightDetailsItems(pe,e.uid);else{const H=pe[c.value];H&&a.value.hilightDetailsItems([H],e.uid)}else a.value.removeDetailsHilight()},Q=()=>{u.value=!0,K()},re=()=>{a.value.removeDetailsHilight()},ne=()=>{a.value.removeDetailsHilight()},de=pe=>{c.value=pe,u.value=!1};return Fa(()=>{h.value.push(t.event.on(ln.LAYER_REMOVE,pe=>{const H=t.panel.get("details-panel");e.uid===pe.uid&&H&&H.close()})),h.value.push(t.event.on(ln.PANEL_CLOSED,pe=>{pe.id=="details-panel"&&re()})),h.value.push(t.event.on(ln.PANEL_MINIMIZED,pe=>{pe.id=="details-panel"&&ne()})),h.value.push(t.event.on(ln.MAP_BASEMAPCHANGE,()=>{l.value&&K()}))}),E0(()=>{p.value.push(rl(k,()=>{V(),k.value===void 0&&a.value.removeDetailsHilight()},{deep:!1,immediate:!0})),p.value.push(rl(I,()=>{c.value=0})),p.value.push(rl(()=>e.uid,()=>{c.value=0}))}),Ka(()=>{p.value.forEach(pe=>pe()),h.value.forEach(pe=>t.event.off(pe))}),(pe,H)=>{const Z=Nn("truncate"),ae=Nn("tippy"),fe=Nn("focus-item"),be=Nn("focus-list");return S.value&&m.value===0?(qt(),si("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:s_(i.results.length>1?{"margin-left":"42px"}:"")},[o.value?Ur((qt(),si("h1",cCn,[Xs(br(R.value),1)])),[[Z,{options:{placement:"top-start"}}]]):Yr("",!0),B.value?(qt(),si("div",hCn,[Ot("label",dCn,br(ri(s)("details.togglehilight.title")),1),Vn(FJt,{config:{value:l.value,disabled:!1},onToggled:$},null,8,["config"])])):Yr("",!0),o.value&&L().length>1&&!u.value?(qt(),si("div",pCn,[Ot("div",fCn,[Ot("button",{type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":ri(s)("details.item.see.list"),onClick:H[0]||(H[0]=_e=>Q())},br(ri(s)("details.item.see.list")),9,mCn),Ot("div",gCn,[Ur((qt(),si("button",{type:"button",content:ri(s)("details.item.previous.item"),onClick:H[1]||(H[1]=_e=>Y(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":ri(s)("details.item.previous.item"),disabled:c.value===0},_Cn,8,yCn)),[[ae,{placement:"top"}]]),Ot("span",bCn,br(ri(s)("details.item.count",[c.value+1,L().length])),1),Ur((qt(),si("button",{type:"button",content:ri(s)("details.item.next.item"),onClick:H[2]||(H[2]=_e=>Y(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":ri(s)("details.item.next.item"),disabled:c.value===L().length-1},SCn,8,wCn)),[[ae,{placement:"top"}]])])])])):Yr("",!0),o.value?(qt(),si("div",TCn,[L().length>0?(qt(),si("div",CCn,[u.value?Ur((qt(),si("div",ECn,[(qt(!0),si(Ks,null,hu(L(),(_e,Ie)=>Ur((qt(),si("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:Ie,onClick:Te=>de(Ie)},[Vn(u_t,{data:_e,uid:i.uid,open:!1},null,8,["data","uid"])],8,ICn)),[[fe]])),128))])),[[be]]):(qt(),Dn(u_t,{key:1,data:k.value,uid:i.uid,open:!0},null,8,["data","uid"]))])):(qt(),si("div",ACn,br(ri(s)("details.layers.results.empty.currentLayer")),1))])):(qt(),si("div",MCn,br(ri(s)("details.item.no.data")),1))],4)):(qt(),si("div",{key:1,class:Wn(["flex justify-center py-10 items-center",i.results.length>1?"ml-42":""])},[OCn,Xs(" "+br(ri(s)("details.item.loading")),1)],2))}}}),RCn=ml(PCn,[["__scopeId","data-v-04b12e3e"]]),DCn={class:"relative h-full"},FCn={class:"detailsContentSection overflow-y-auto h-full"},kCn=Xr({__name:"details-screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=tL(),n=vi([]),s=vi([]),o=vi([]),a=vi(!1),l=vi(""),u=vi(!1),c=Hr(()=>r.activeGreedy),h=Hr(()=>r.payload),p=Hr(()=>r.properties),m=I=>{l.value=I,u.value=!0},v=I=>{if(I===void 0)return;const R=I.length===0?0:I[0].requestTime;r.activeGreedy=R,r.slowLoadingFlag=!1,o.value=I,w(I)},w=I=>{if(u.value){const R=o.value.findIndex(L=>L.uid===l.value);if(R!==-1){const L=o.value[R];L.loading.then(()=>{L.requestTime===c.value&&(L.items.length>0?(r.activeGreedy=0,u.value=!1,a.value=!1):S(I))})}else S(I)}else S(I);setTimeout(()=>{c.value!==0&&I[0].requestTime===c.value&&(r.slowLoadingFlag=!0)},500)},S=I=>{const R=I.map(k=>k.loading.then(()=>k.items.length>0?Promise.resolve(k):Promise.reject())),L=I.length===0?0:I[0].requestTime;Promise.any(R).then(k=>{if(k.requestTime!==c.value)return;const B=o.value.find($=>$.uid===k.uid);r.activeGreedy=0,B!==void 0&&(l.value=B.uid,a.value=!1)}).catch(()=>{L===c.value&&(r.activeGreedy=0,a.value=!0)})};return E0(()=>{s.value.push(rl(h,I=>{v(I)},{deep:!1,immediate:!0})),s.value.push(rl(c,I=>{I===0&&(r.slowLoadingFlag=!1)}))}),Ka(()=>{n.value.forEach(I=>t.event.off(I)),s.value.forEach(I=>I())}),(I,R)=>{const L=Ko("panel-screen");return qt(),Dn(L,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(r).origin==="toggleEvent"?ri(e)("details.layers.title.gridOrigin"):ri(e)("details.layers.title.identifyOrigin")),1)]),content:Rn(()=>[Ot("div",DCn,[o.value.length>1?(qt(),Dn(ATn,{key:0,results:o.value,detailsProperties:p.value,selected:l.value,onSelectionChanged:m},null,8,["results","detailsProperties","selected"])):Yr("",!0),Ot("div",FCn,[a.value?(qt(),si("div",{key:1,class:Wn(["text-center",{"ml-42":o.value.length>1}])},br(o.value.length>=1?ri(e)("details.layers.results.empty"):ri(e)("details.layers.results.empty.noLayers")),3)):(qt(),Dn(RCn,{key:0,uid:l.value,results:o.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),LCn=ml(kCn,[["__scopeId","data-v-251e74c1"]]),NCn={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.result.default.name":"Identify Item {0}","details.items.title":"Details","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.result.default.name":"Désigner l'élément {0}","details.items.title":"Détails","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class $Cn extends aTn{async added(){this.$iApi.panel.register({"details-panel":{screens:{"details-screen":Da(LCn)},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:NCn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details-panel"),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("details-panel"),tL(this.$vApp.$pinia).$reset()}}}const BCn=Object.freeze(Object.defineProperty({__proto__:null,default:$Cn},Symbol.toStringTag,{value:"Module"}));var fh={};const jCn={},GCn=Object.freeze(Object.defineProperty({__proto__:null,default:jCn},Symbol.toStringTag,{value:"Module"})),IRe=wSe(GCn);(function(i){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var e=e||{version:"5.3.0"};if(i.fabric=e,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?e.document=document:e.document=document.implementation.createHTMLDocument(""),e.window=window;else{var t=IRe,r=new t.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;e.document=r.document,e.jsdomImplForWrapper=IRe.implForWrapper,e.nodeCanvas=IRe.Canvas,e.window=r,DOMParser=e.window.DOMParser}e.isTouchSupported="ontouchstart"in e.window||"ontouchstart"in e.document||e.window&&e.window.navigator&&e.window.navigator.maxTouchPoints>0,e.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",e.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],e.DPI=96,e.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",e.commaWsp="(?:\\s+,?\\s*|,\\s*)",e.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,e.reNonWord=/[ \n\.,;!\?\-]/,e.fontPaths={},e.iMatrix=[1,0,0,1,0,0],e.svgNS="http://www.w3.org/2000/svg",e.perfLimitSizeTotal=2097152,e.maxCacheSideLimit=4096,e.minCacheSideLimit=256,e.charWidthsCache={},e.textureSize=2048,e.disableStyleCopyPaste=!1,e.enableGLFiltering=!0,e.devicePixelRatio=e.window.devicePixelRatio||e.window.webkitDevicePixelRatio||e.window.mozDevicePixelRatio||1,e.browserShadowBlurConstant=1,e.arcToSegmentsCache={},e.boundsOfCurveCache={},e.cachesBoundsOfCurve=!0,e.forceGLPutImageData=!1,e.initFilterBackend=function(){if(e.enableGLFiltering&&e.isWebglSupported&&e.isWebglSupported(e.textureSize))return console.log("max texture size: "+e.maxTextureSize),new e.WebglFilterBackend({tileSize:e.textureSize});if(e.Canvas2dFilterBackend)return new e.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=e),function(){function a(m,v){if(this.__eventListeners[m]){var w=this.__eventListeners[m];v?w[w.indexOf(v)]=!1:e.util.array.fill(w,!1)}}function l(m,v){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var w in m)this.on(w,m[w]);else this.__eventListeners[m]||(this.__eventListeners[m]=[]),this.__eventListeners[m].push(v);return this}function u(m,v){var w=function(){v.apply(this,arguments),this.off(m,w)}.bind(this);this.on(m,w)}function c(m,v){if(arguments.length===1)for(var w in m)u.call(this,w,m[w]);else u.call(this,m,v);return this}function h(m,v){if(!this.__eventListeners)return this;if(arguments.length===0)for(m in this.__eventListeners)a.call(this,m);else if(arguments.length===1&&typeof arguments[0]=="object")for(var w in m)a.call(this,w,m[w]);else a.call(this,m,v);return this}function p(m,v){if(!this.__eventListeners)return this;var w=this.__eventListeners[m];if(!w)return this;for(var S=0,I=w.length;S"u"?this._objects.concat():this._objects.filter(function(l){return l.type===a})},item:function(a){return this._objects[a]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(a,l){return this._objects.indexOf(a)>-1?!0:l?this._objects.some(function(u){return typeof u.contains=="function"&&u.contains(a,!0)}):!1},complexity:function(){return this._objects.reduce(function(a,l){return a+=l.complexity?l.complexity():0,a},0)}},e.CommonMethods={_setOptions:function(a){for(var l in a)this.set(l,a[l])},_initGradient:function(a,l){a&&a.colorStops&&!(a instanceof e.Gradient)&&this.set(l,new e.Gradient(a))},_initPattern:function(a,l,u){a&&a.source&&!(a instanceof e.Pattern)?this.set(l,new e.Pattern(a,u)):u&&u()},_setObject:function(a){for(var l in a)this._set(l,a[l])},set:function(a,l){return typeof a=="object"?this._setObject(a):this._set(a,l),this},_set:function(a,l){this[a]=l},toggle:function(a){var l=this.get(a);return typeof l=="boolean"&&this.set(a,!l),this},get:function(a){return this[a]}},function(a){var l=Math.sqrt,u=Math.atan2,c=Math.pow,h=Math.PI/180,p=Math.PI/2;e.util={cos:function(m){if(m===0)return 1;m<0&&(m=-m);var v=m/p;switch(v){case 1:case 3:return 0;case 2:return-1}return Math.cos(m)},sin:function(m){if(m===0)return 0;var v=m/p,w=1;switch(m<0&&(w=-1),v){case 1:return w;case 2:return 0;case 3:return-w}return Math.sin(m)},removeFromArray:function(m,v){var w=m.indexOf(v);return w!==-1&&m.splice(w,1),m},getRandomInt:function(m,v){return Math.floor(Math.random()*(v-m+1))+m},degreesToRadians:function(m){return m*h},radiansToDegrees:function(m){return m/h},rotatePoint:function(m,v,w){var S=new e.Point(m.x-v.x,m.y-v.y),I=e.util.rotateVector(S,w);return new e.Point(I.x,I.y).addEquals(v)},rotateVector:function(m,v){var w=e.util.sin(v),S=e.util.cos(v),I=m.x*S-m.y*w,R=m.x*w+m.y*S;return{x:I,y:R}},createVector:function(m,v){return new e.Point(v.x-m.x,v.y-m.y)},calcAngleBetweenVectors:function(m,v){return Math.acos((m.x*v.x+m.y*v.y)/(Math.hypot(m.x,m.y)*Math.hypot(v.x,v.y)))},getHatVector:function(m){return new e.Point(m.x,m.y).multiply(1/Math.hypot(m.x,m.y))},getBisector:function(m,v,w){var S=e.util.createVector(m,v),I=e.util.createVector(m,w),R=e.util.calcAngleBetweenVectors(S,I),L=e.util.calcAngleBetweenVectors(e.util.rotateVector(S,R),I),k=R*(L===0?1:-1)/2;return{vector:e.util.getHatVector(e.util.rotateVector(S,k)),angle:R}},projectStrokeOnPoints:function(m,v,w){var S=[],I=v.strokeWidth/2,R=v.strokeUniform?new e.Point(1/v.scaleX,1/v.scaleY):new e.Point(1,1),L=function(k){var B=I/Math.hypot(k.x,k.y);return new e.Point(k.x*B*R.x,k.y*B*R.y)};return m.length<=1||m.forEach(function(k,B){var $=new e.Point(k.x,k.y),V,Y;B===0?(Y=m[B+1],V=w?L(e.util.createVector(Y,$)).addEquals($):m[m.length-1]):B===m.length-1?(V=m[B-1],Y=w?L(e.util.createVector(V,$)).addEquals($):m[0]):(V=m[B-1],Y=m[B+1]);var K=e.util.getBisector($,V,Y),Q=K.vector,re=K.angle,ne,de;if(v.strokeLineJoin==="miter"&&(ne=-I/Math.sin(re/2),de=new e.Point(Q.x*ne*R.x,Q.y*ne*R.y),Math.hypot(de.x,de.y)/I<=v.strokeMiterLimit)){S.push($.add(de)),S.push($.subtract(de));return}ne=-I*Math.SQRT2,de=new e.Point(Q.x*ne*R.x,Q.y*ne*R.y),S.push($.add(de)),S.push($.subtract(de))}),S},transformPoint:function(m,v,w){return w?new e.Point(v[0]*m.x+v[2]*m.y,v[1]*m.x+v[3]*m.y):new e.Point(v[0]*m.x+v[2]*m.y+v[4],v[1]*m.x+v[3]*m.y+v[5])},makeBoundingBoxFromPoints:function(m,v){if(v)for(var w=0;w"u"?1:m.scaleX,w=typeof m.scaleY>"u"?1:m.scaleY,S=[m.flipX?-v:v,0,0,m.flipY?-w:w,0,0],I=e.util.multiplyTransformMatrices,R=e.util.degreesToRadians;return m.skewX&&(S=I(S,[1,0,Math.tan(R(m.skewX)),1],!0)),m.skewY&&(S=I(S,[1,Math.tan(R(m.skewY)),0,1],!0)),S},composeMatrix:function(m){var v=[1,0,0,1,m.translateX||0,m.translateY||0],w=e.util.multiplyTransformMatrices;return m.angle&&(v=w(v,e.util.calcRotateMatrix(m))),(m.scaleX!==1||m.scaleY!==1||m.skewX||m.skewY||m.flipX||m.flipY)&&(v=w(v,e.util.calcDimensionsMatrix(m))),v},resetObjectTransform:function(m){m.scaleX=1,m.scaleY=1,m.skewX=0,m.skewY=0,m.flipX=!1,m.flipY=!1,m.rotate(0)},saveObjectTransform:function(m){return{scaleX:m.scaleX,scaleY:m.scaleY,skewX:m.skewX,skewY:m.skewY,angle:m.angle,left:m.left,flipX:m.flipX,flipY:m.flipY,top:m.top}},isTransparent:function(m,v,w,S){S>0&&(v>S?v-=S:v=0,w>S?w-=S:w=0);var I=!0,R,L,k=m.getImageData(v,w,S*2||1,S*2||1),B=k.data.length;for(R=3;Rr?.panel.get(e.panelId)?.button),s=()=>{e.minimize?r?.panel.toggleMinimize(e.panelId):r?.panel.toggle(e.panelId)};return(o,a)=>{const l=Ko("appbar-button");return n.value?(qt(),Dn(l,{key:0,onClickFunction:s,tooltip:ri(t)(n.value.tooltip),id:i.panelId},{default:Rn(()=>[Ot("div",{class:Wn(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":i.overflow}]),innerHTML:n.value.icon},null,10,L2n)]),_:1},8,["tooltip","id"])):Yr("",!0)}}}),N2n={},$2n={class:"border-b p-0 self-center w-2/3"};function B2n(i,e){return qt(),si("span",$2n)}const l_t=ml(N2n,[["render",B2n],["__scopeId","data-v-5d32b715"]]);var j2n={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(e){var t=e.state,r=e.name,n=e.options,s=xB(t,n),o=t.modifiersData.preventOverflow||{x:0,y:0},a=o.x,l=o.y,u=t.rects.popper,c=u.width,h=u.height,p=t.placement.split("-"),m=p[0],v=m==="left"?"left":"right",w=m==="top"?"top":"bottom";t.modifiersData[r]={width:c-s[v]-a,height:h-s[w]-l}}};const G2n=i=>(Dc("data-v-6346dfbd"),i=i(),Fc(),i),U2n=["content","aria-label"],z2n=G2n(()=>Ot("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)),V2n=[z2n],H2n=Xr({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=vi(!1),s=vi(),o=vi(),a=vi(),l=()=>{n.value=!n.value;const u={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:h}){const{width:p,height:m}=h.modifiersData.maxSize;h.styles.popper={...h.styles.popper,maxWidth:`${p}px`,maxHeight:`${Math.max(80,m)-38}px`},h.styles.popper.overflowY="auto",h.styles.popper.overflowX="hidden"}},c=r.$vApp.$el.querySelector(".inner-shell");o.value&&a.value&&G$t(o.value,a.value,{placement:e.position||"right-end",modifiers:[{...j2n,options:{boundary:c}},u,{name:"offset",options:{offset:[0,5]}}],...e.popperOptions})};return Fa(()=>{window.addEventListener("click",u=>{u.target instanceof HTMLElement&&!s.value?.contains(u.target)&&(n.value=!1)},{capture:!0})}),Ka(()=>{window.removeEventListener("click",u=>{u.target instanceof HTMLElement&&!s.value?.contains(u.target)&&(n.value=!1)},{capture:!0})}),(u,c)=>{const h=Nn("focus-item"),p=Nn("tippy");return qt(),si("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:s},[Ur((qt(),si("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:c[0]||(c[0]=m=>l()),content:ri(t)("appbar.more"),"aria-label":ri(t)("appbar.more"),ref_key:"dropdownTrigger",ref:o},V2n,8,U2n)),[[h],[p,{placement:"right-end"}]]),Ur(Ot("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:a},[Em(u.$slots,"default",{},void 0,!0)],512),[[bf,n.value]])],512)}}}),W2n=ml(H2n,[["__scopeId","data-v-6346dfbd"]]),q2n=i=>(Dc("data-v-f2294fce"),i=i(),Fc(),i),Y2n=q2n(()=>Ot("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),X2n={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},J2n=Xr({__name:"appbar-button",setup(i){const e=w3(),{t}=Qn(),r=eo("iApi"),n=Hr(()=>e.notificationNumber),s=()=>{r.panel.toggle("notifications")};return(o,a)=>{const l=Ko("appbar-button",!0);return qt(),Dn(l,{onClickFunction:s,tooltip:ri(t)("notifications.title"),class:"notification-button",id:""},{default:Rn(()=>[Y2n,n.value&&n.value>0?(qt(),si("span",X2n,br(n.value),1)):Yr("",!0)]),_:1},8,["tooltip"])}}}),K2n=ml(J2n,[["__scopeId","data-v-f2294fce"]]),Z2n=["content"],Q2n=Xr({__name:"appbar",setup(i){const e=w0(),t=dy(),r=Hr(()=>t.visible),n=Hr(()=>t.temporary),{t:s}=Qn(),o=vi(!1),a=vi({}),l=vi(),u=()=>{l.value._tippy.hide()},c=h=>{h.key==="Tab"&&l.value?.matches(":focus")&&l.value._tippy.show()};return Fa(()=>{l.value?.addEventListener("blur",u),l.value?.addEventListener("keyup",c)}),E0(()=>{const h=Df();window.addEventListener("resize",()=>h?.proxy?.$forceUpdate())}),Ka(()=>{const h=Df();window.removeEventListener("resize",()=>h?.proxy?.$forceUpdate()),l.value?.removeEventListener("blur",u),l.value?.removeEventListener("keyup",c)}),n7(()=>{Bv(()=>{const h=l.value;let p,m=[...h.children],v=m[m.length-2].getBoundingClientRect().top;e.mobileView||(v=h.getBoundingClientRect().bottom-38);let w=h.querySelector("#dropdown");for(let R=m.length-4;R>=0;R--){let L=m[R].getBoundingClientRect().bottom;if(v&&w&&(L>v||o.value&&L+56>v))m[R].classList.forEach(k=>{k.includes("identifier")&&(p=k.slice(11))}),p&&(a.value[p]=!0),o.value||(o.value=!0);else if(L!==0)break}let S=h.querySelector("#more"),I=S.getBoundingClientRect().bottom;if(p=void 0,o.value&&v&&S&&w&&I!==0&&(I<=v-56||w.childElementCount==1&&I<=v)){let R=w.childElementCount,L=0;for(;I<=v-56||R==1;){let k=w.children[L];if(k&&(k.classList.forEach(B=>{B.includes("identifier")&&(p=B.slice(11))}),p&&(a.value[p]=!1),I+=48,R-=1,L+=1),R===0){o.value=!1;break}}}Object.keys(a.value).forEach(R=>{h.querySelector(`.identifier-${R}`)||delete a.value[R]})})}),(h,p)=>{const m=Nn("focus-list"),v=Nn("tippy");return Ur((qt(),si("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:ri(s)("panels.controls.items"),ref_key:"el",ref:l},[(qt(!0),si(Ks,null,hu(r.value,(w,S)=>(qt(),si(Ks,null,[(qt(!0),si(Ks,null,hu(w,(I,R)=>(qt(),si(Ks,null,[typeof I=="string"&&a.value[`${I}-${R}`]!==!0?(qt(),Dn(Rpe,{key:`${I}-${R}-default`,panelId:I,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`])},null,8,["panelId","class"])):a.value[`${I}-${R}`]!==!0?(qt(),Dn(xR(I.componentId),{key:`${I}-${R}-custom`,options:I.options,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`]),id:I.id},null,8,["options","id","class"])):Yr("",!0)],64))),256)),a.value[`divider-${S}`]!==!0?(qt(),Dn(l_t,{class:Wn(["appbar-item",`identifier-divider-${S}`]),key:`${w}-${S}-default`},null,8,["class"])):Yr("",!0)],64))),256)),(qt(!0),si(Ks,null,hu(n.value?.filter(w=>a.value[`${w}-temp`]!==!0),w=>(qt(),Dn(Rpe,{panelId:w,minimize:!0,key:`${w}-temp`,class:Wn([`identifier-${w}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),Ur(Vn(W2n,{id:"more"},{default:Rn(()=>[(qt(!0),si(Ks,null,hu(r.value,(w,S)=>(qt(),si(Ks,{key:S},[(qt(!0),si(Ks,null,hu(w,(I,R)=>(qt(),si(Ks,null,[typeof I=="string"&&a.value[`${I}-${R}`]?(qt(),Dn(Rpe,{key:`${I}-${R}-default`,panelId:I,class:Wn(["text-black hover:bg-gray my-4 h-36",`identifier-${I}-${R}`]),overflow:""},null,8,["panelId","class"])):a.value[`${I}-${R}`]?(qt(),Dn(xR(I.componentId),{key:`${I}-${R}-custom`,options:I.options,id:I.id,class:Wn(["appbar-item h-48",`identifier-${I}-${R}`])},null,8,["options","id","class"])):Yr("",!0)],64))),256)),a.value[`divider-${S}`]?(qt(),Dn(l_t,{key:0,class:Wn(["border-black my-4",`identifier-divider-${S}`])},null,8,["class"])):Yr("",!0)],64))),128)),(qt(!0),si(Ks,null,hu(n.value?.filter(w=>a.value[`${w}-temp`]),w=>(qt(),Dn(Rpe,{panelId:w,minimize:!0,key:`${w}-temp`,class:Wn([`identifier-${w}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},512),[[bf,o.value]]),Vn(K2n,{class:"appbar-item bottom-48 h-48 sm:display-none"}),Vn(W$t,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Z2n)),[[m],[v,{trigger:"manual",placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class eSn extends Yu{get config(){return super.config}_parseConfig(e){if(!e)return;const t=dy(this.$vApp.$pinia);let r;Array.isArray(e.items[0])?r=e.items:r=[e.items];const n=[];r.forEach(s=>{n.push(s.map(o=>typeof o=="string"?o:new BMe(o)))}),t.items=n.flat().reduce((s,o)=>(s[o instanceof BMe?o.id:o]=o,s),{}),t.order=n.map(s=>s.map(o=>o instanceof BMe?o.id:o)),this._validateItems()}_validateItems(){const e=dy(this.$vApp.$pinia);e.order.flat().forEach(t=>{typeof e.items[t]!="string"&&[t].some(r=>{this.$iApi.fixture.exists(r)&&!e.items[t]&&(e.items[t].componentId=`${r}-appbar-button`)})})}}const tSn={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class iSn extends eSn{initialized(){}async added(){Object.entries(tSn).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:e,el:t}=this.mount(Q2n,{app:this.$element}),r=this.$vApp.$el.getElementsByClassName("inner-shell")[0];r.insertBefore(t.childNodes[0],r.querySelector(".panel-stack")),this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=[];s.push(this.$iApi.event.on(ln.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const o=dy(this.$vApp.$pinia);n(),s.forEach(u=>this.$iApi.event.off(u));const a={...o.items},l=[...o.temporary];Object.keys(a).forEach(u=>o.removeButton(u)),l.forEach(u=>o.removeButton(u)),e(),o.$reset()}}}const rSn=Object.freeze(Object.defineProperty({__proto__:null,default:iSn},Symbol.toStringTag,{value:"Module"})),nSn=i=>(Dc("data-v-74cdad7d"),i=i(),Fc(),i),sSn={class:"mt-10"},oSn=["aria-label"],aSn=["alt","src"],lSn=["alt"],uSn={class:"absolute flex w-full bg-black opacity-75 text-white h-30 bottom-6 items-center"},cSn={class:"pl-5"},hSn={class:"ml-auto pr-5"},dSn=["content"],pSn=nSn(()=>Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})],-1)),fSn=[pSn],mSn=Xr({__name:"item",props:{area:{type:Object,required:!0},showThumbnail:{type:Boolean}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=n=>{if(!n.extent){console.error("selected area of interest doesn't have an extent specified.");return}t?.geo.map.zoomMapTo(Yh.fromConfig("area-of-interest-extent",n.extent))};return(n,s)=>{const o=Nn("truncate"),a=Nn("tippy"),l=Nn("focus-item");return qt(),si("div",sSn,[Ur((qt(),si("button",{type:"button",class:Wn(["area-of-interest-item-button bg-gray-300 w-full",{"border border-gray-300":i.showThumbnail}]),"aria-label":ri(e)("areas-of-interest.select"),onClick:s[2]||(s[2]=u=>r(i.area))},[Ot("div",null,[Ot("div",{class:Wn(["flex hover:opacity-50 area-of-interest-item-image",i.showThumbnail?"h-180":"h-30"])},[i.area.thumbnail?(qt(),si("img",{key:0,class:"w-full bg-white object-contain",alt:i.area.altText||i.area.title,src:i.area.thumbnail},null,8,aSn)):i.showThumbnail?(qt(),si("img",{key:1,class:"w-full bg-white object-contain py-30",alt:i.area.altText||i.area.title,src:"https://openclipart.org/image/800px/160615"},null,8,lSn)):Yr("",!0)],2)]),Ot("div",uSn,[Ur((qt(),si("div",cSn,[Ot("span",null,br(i.area.title),1)])),[[o]]),Ur(Ot("div",hSn,[Ur((qt(),si("a",{onClick:s[0]||(s[0]=ia(()=>{},["stop"])),onKeydown:s[1]||(s[1]=Ph(ia(()=>{},["prevent"]),["enter","space"])),content:i.area.description},fSn,40,dSn)),[[a,{placement:"bottom",trigger:"click focus"}]])],512),[[bf,i.area.description]])])],10,oSn)),[[l]])])}}}),gSn=ml(mSn,[["__scopeId","data-v-74cdad7d"]]),ySn={class:"h-600 overflow-y-auto"},vSn={class:"mx-5"},_Sn={key:0},PJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=yTe(),r=Hr(()=>t.areas);let n=vi(!1);return Fa(()=>{n.value=!!r.value?.some(s=>s.thumbnail)}),(s,o)=>{const a=Ko("panel-screen"),l=Nn("focus-list");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("areas-of-interest.title")),1)]),content:Rn(()=>[Ot("div",ySn,[Ot("div",vSn,[r.value.length>0?Ur((qt(),si("ul",_Sn,[(qt(!0),si(Ks,null,hu(r.value,(u,c)=>(qt(),si("li",{key:c},[Vn(gSn,{area:u,"show-thumbnail":ri(n),class:"block relative overflow-hidden"},null,8,["area","show-thumbnail"])]))),128))])),[[l]]):Yr("",!0)])])]),_:1},8,["panel"])}}}),bSn=Object.freeze(Object.defineProperty({__proto__:null,default:PJt},Symbol.toStringTag,{value:"Module"})),wSn={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class xSn extends Yu{get config(){return super.config}_parseConfig(e){if(!e)return;const t=yTe(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class SSn extends xSn{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":Da(PJt)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:wSn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),yTe(this.$vApp.$pinia).$reset()}}}const TSn=Object.freeze(Object.defineProperty({__proto__:null,default:SSn},Symbol.toStringTag,{value:"Module"})),RJt=i=>(Dc("data-v-dbfed424"),i=i(),Fc(),i),CSn={class:"mb-10"},ESn=["aria-label"],ISn={key:0,class:"w-full h-30"},ASn=["alt","src"],MSn=["alt","src"],OSn=["alt"],PSn={class:"pl-5"},RSn={class:"ml-auto pr-5"},DSn=["content"],FSn=RJt(()=>Ot("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})],-1)),kSn=[FSn],LSn={key:0,class:"rv-basemap-check absolute top-0 right-0"},NSn=RJt(()=>Ot("svg",{class:"fill-current w-25 h-25 relative",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),$Sn=[NSn],BSn=Xr({__name:"item",props:{basemap:{type:Object,required:!0},tileSchema:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=bm(),n=Hr(()=>r.activeBasemapConfig),s=o=>{o.id!==n.value.id&&t?.geo.map.setBasemap(o.id)};return(o,a)=>{const l=Nn("truncate"),u=Nn("tippy"),c=Nn("focus-item");return qt(),si("div",CSn,[Ur((qt(),si("button",{class:"basemap-item-button bg-gray-300 w-full h-full",type:"button","aria-label":ri(e)("basemap.select"),onClick:a[2]||(a[2]=h=>s(i.basemap))},[Ot("div",null,[Ot("div",{class:Wn(["flex hover:opacity-50 basemap-item-image basemap-item-container",i.basemap.hideThumbnail?"h-30":"h-180"])},[i.basemap.hideThumbnail?(qt(),si("img",ISn)):i.basemap.thumbnailUrl?(qt(),si("img",{key:1,class:"w-full h-180",alt:i.basemap.altText,src:i.basemap.thumbnailUrl},null,8,ASn)):i.tileSchema.thumbnailTileUrls&&i.tileSchema.thumbnailTileUrls.length>0&&i.basemap.layers.every(h=>h.layerType==="esri-tile")?(qt(!0),si(Ks,{key:2},hu(i.basemap.layers,h=>(qt(),si("div",{key:h.id,class:"flex basemap-item-inner h-180"},[(qt(!0),si(Ks,null,hu(i.tileSchema.thumbnailTileUrls,(p,m)=>(qt(),si("img",{class:"w-full",alt:i.basemap.altText,src:h.url+p,key:m},null,8,MSn))),128))]))),128)):(qt(),si("img",{key:3,class:"w-full bg-white h-180",alt:i.basemap.altText,src:"https://openclipart.org/image/800px/275366"},null,8,OSn))],2)]),Ot("div",{class:Wn(["absolute flex w-full bg-black text-white h-30 bottom-6 items-center",i.basemap.hideThumbnail&&i.basemap.id===n.value.id?"opacity-85":"opacity-75"])},[Ur((qt(),si("div",PSn,[Ot("span",null,br(i.basemap.name),1)])),[[l]]),Ot("div",RSn,[Ur((qt(),si("a",{onClick:a[0]||(a[0]=ia(()=>{},["stop"])),onKeydown:a[1]||(a[1]=Ph(ia(()=>{},["prevent"]),["enter","space"])),content:i.basemap.description},kSn,40,DSn)),[[u,{placement:"bottom",trigger:"click focus"}]])])],2),i.basemap.id===n.value.id&&!i.basemap.hideThumbnail?(qt(),si("div",LSn,$Sn)):Yr("",!0)],8,ESn)),[[c]])])}}}),jSn=ml(BSn,[["__scopeId","data-v-dbfed424"]]),GSn={class:"h-600 overflow-y-auto"},USn={class:"font-bold text-xl"},zSn={key:0,class:"border-t border-b border-gray-600"},DJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=bm(),r=vi([]),n=vi([]);Fa(()=>{const o=t.config.map;r.value=o.tileSchemas,n.value=o.basemaps});const s=o=>n.value.filter(a=>a.tileSchemaId===o);return(o,a)=>{const l=Ko("panel-screen"),u=Nn("truncate"),c=Nn("focus-list");return qt(),Dn(l,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("basemap.title")),1)]),content:Rn(()=>[Ot("div",GSn,[(qt(!0),si(Ks,null,hu(r.value,(h,p)=>(qt(),si("div",{class:"mx-5",key:h.id},[Ot("div",{class:Wn((p===0?"mt-5":"mt-36")+" flex mb-5")},[Ur((qt(),si("h3",USn,[Xs(br(h.name),1)])),[[u]])],2),n.value.length>0?Ur((qt(),si("ul",zSn,[(qt(!0),si(Ks,null,hu(s(h.id),m=>(qt(),si("li",{key:m.id},[Vn(jSn,{basemap:m,tileSchema:h,class:"block relative overflow-hidden"},null,8,["basemap","tileSchema"])]))),128))])),[[c]]):Yr("",!0)]))),128))])]),_:1},8,["panel"])}}}),VSn=Object.freeze(Object.defineProperty({__proto__:null,default:DJt},Symbol.toStringTag,{value:"Module"})),HSn=Ot("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1),WSn=Xr({__name:"nav-button",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>t?.panel.toggle("basemap");return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("basemap.title")},{default:Rn(()=>[HSn]),_:1},8,["tooltip"])}}}),qSn={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class YSn extends Yu{added(){this.$iApi.component("basemap-nav-button",WSn),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":Da(DJt)},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:qSn}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}const XSn=Object.freeze(Object.defineProperty({__proto__:null,default:YSn},Symbol.toStringTag,{value:"Module"})),JSn=i=>(Dc("data-v-495353cf"),i=i(),Fc(),i),KSn=JSn(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[Ot("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[Ot("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),Ot("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),Ot("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),Ot("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),Ot("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)),ZSn=[KSn],QSn=Xr({__name:"crosshairs",setup(i){const e=eo("iApi"),t=vi(!1),r=vi([]);return Fa(()=>{r.value.push(e.event.on(ln.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(t.value=!0)})),r.value.push(e.event.on(ln.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(t.value=!0)})),r.value.push(e.event.on(ln.MAP_MOUSEDOWN,()=>{t.value=!1})),r.value.push(e.event.on(ln.MAP_BLUR,()=>{t.value=!1}))}),Ka(()=>{r.value.forEach(n=>e.event.off(n))}),(n,s)=>(qt(),si("div",{class:Wn(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!t.value}])},ZSn,2))}}),eTn=ml(QSn,[["__scopeId","data-v-495353cf"]]);class tTn extends Yu{added(){const{destroy:e,el:t}=this.mount(eTn,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{e()}}}const iTn=Object.freeze(Object.defineProperty({__proto__:null,default:tTn},Symbol.toStringTag,{value:"Module"})),Coe="Ramp-Hilight",CRe="Ramp-Hilight-Fog-Basemap",rTn={mode:"glow",options:{haloColor:[0,255,0],haloOpacity:.8}};var k8=(i=>(i.NONE="none",i.GLOW="glow",i.LIFT="lift",i.FOG="fog",i))(k8||{});const ERe="details";class nTn extends Yu{detailsStore=tL(this.$vApp.$pinia);get config(){return super.config}openDetails(e){this.detailsStore.payload=e;const t=this.$iApi.panel.get("details-panel");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",e.forEach(n=>{const s=this.$iApi.useStore("layer").getLayerByUid(n.uid);this._loadDetailsConfig(s)}),this.$iApi.panel.get("details-panel").isOpen||this.$iApi.panel.open({id:"details-panel"})}toggleFeature(e,t){const r=this.$iApi.panel.get("details-panel");if(t===!1){r.close(),this.detailsStore.currentFeatureId=void 0;return}const n=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${n?.supportsFeatures?e.data[n?.oidField??""]:JSON.stringify(e.data)}`;if(r.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){r.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",r.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(n);const o={items:[fq.makeRawItem(e.format,e.data)],uid:e.uid,loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[o],r.isOpen||r.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details-panel"]),this.handlePanelTeleports(["details-panel"]);const t=this.getLayerFixtureConfigs(),r=[];Object.keys(t).forEach(s=>{r.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields})});const n=r.map(s=>new SIr(s));this.detailsStore.properties=n.reduce((s,o)=>(s[o.id]=o,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const r=this.getLayerFixtureConfigs();r[e.id]!==void 0&&this.detailsStore.addConfigProperty({id:e.id,name:r[e.id].name,template:r[e.id].template,fields:r[e.id].fields})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await n.getGraphicsByKey(ERe);await n.removeHilight(s);const o=Date.now();this.detailsStore.lastHilight=o;const a=await this.getHilightGraphics(r,t);this.detailsStore.lastHilight===o&&(await n.addHilight(a),this.detailsStore.lastHilight!==o&&n.removeHilight(a))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(ERe);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const r=e instanceof Array?e:[e],n=this.$iApi.fixture.get("hilight");if(n){const s=await this.getHilightGraphics(r,t);n.reloadHilight(s)}}async getHilightGraphics(e,t){const r=this.$iApi.geo.layer.getLayer(t),n=this.$iApi.fixture.get("hilight"),s=[];return r&&await Promise.all(e.map(async o=>{await o.loading;const a=o.data[r.oidField],l=await r.getGraphic(a,{getGeom:!0,getAttribs:!0,getStyle:!0});l.id=n.constructGraphicKey(ERe,t,a),s.push(l)})),s}onHilightToggle(e,t,r){this.detailsStore.hilightToggle=e,e&&t&&r?this.hilightDetailsItems(t,r):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==k8.NONE}}const sTn=i=>(Dc("data-v-256f0518"),i=i(),Fc(),i),oTn={key:0,class:"relative"},aTn={key:0,class:"relative"},lTn=["innerHTML"],uTn=["src"],cTn={key:1,class:"w-32 h-32"},hTn={class:"symbologyIcon"},dTn=["innerHTML"],pTn=["src"],fTn={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},mTn={key:0,class:"px-5"},gTn={key:1,class:"inline-flex justify-center items-center relative"},yTn=sTn(()=>Ot("div",{class:"symbologyIcon h-32 w-32"},[Ot("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)),vTn=[yTn],_Tn=Xr({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(i){const e=i,t=vi([]);return Fa(()=>{t.value=e.layer.legend}),(r,n)=>i.result.loaded?(qt(),si("div",oTn,[Ot("div",{class:Wn(i.result.items.length===0?"opacity-50":"")},[t.value.length>1?(qt(),si("div",aTn,[(qt(!0),si(Ks,null,hu(t.value.slice(0,3).reverse(),(s,o)=>(qt(),si("div",{class:Wn(["absolute",[o==0?"symbol-0":o==1?"left-3":"left-6"]]),style:s_({"z-index":3-o}),key:o},[t.value[o].svgcode?(qt(),si("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:t.value[o].svgcode},null,8,lTn)):t.value[o].imgUrl?(qt(),si("img",{key:1,class:"symbologyIcon w-28 h-28",src:t.value[o].imgUrl},null,8,uTn)):Yr("",!0)],6))),128))])):t.value.length>0?(qt(),si("div",cTn,[Ot("div",hTn,[t.value[0].svgcode?(qt(),si("span",{key:0,innerHTML:t.value[0].svgcode},null,8,dTn)):t.value[0].imgUrl?(qt(),si("img",{key:1,class:"symbologyIcon w-full h-full",src:t.value[0].imgUrl},null,8,pTn)):Yr("",!0)])])):Yr("",!0)],2),Ot("div",fTn,[i.result.loaded?(qt(),si("div",mTn,br(i.result.items.length),1)):Yr("",!0)])])):(qt(),si("div",gTn,vTn))}}),bTn=ml(_Tn,[["__scopeId","data-v-256f0518"]]),wTn=["content"],xTn={class:"symbologyLayerName truncate"},STn=Xr({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(i){const e=i,t=tL(),r=Hr(()=>t.properties),n=()=>{const s=e.layer;return s&&r.value[s.id]&&r.value[s.id].name?r.value[s.id].name:s?.name??""};return(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{class:Wn(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",i.selected?"detailsButtonSelected":"px-11"]),onClick:o[0]||(o[0]=ia(()=>{},["stop"])),content:n()},[Vn(bTn,{class:"symbStack w-32 h-32 mr-10",layer:i.layer,result:i.result},null,8,["layer","result"]),Ot("div",xTn,br(n()),1)],10,wTn)),[[a,{placement:"right",sticky:!0}]])}}}),TTn=["onBlur"],CTn=Xr({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(i,{emit:e}){const t=i,r=H1(),n=vi(""),s=vi([]),o=vi(!1),a=vi(!1),l=v=>r.getLayerByUid(v),u=v=>{n.value=v,e("selection-changed",v),o.value=!1},c=()=>{a.value||setTimeout(()=>{o.value=a.value},500),a.value=!0},h=()=>{o.value=a.value=!1},p=()=>{a.value||(o.value=!0),a.value=!0},m=()=>{o.value=a.value=!1};return E0(()=>{s.value.push(rl(t,()=>{n.value=t.selected}))}),Ka(()=>{s.value.forEach(v=>v())}),(v,w)=>{const S=Nn("focus-item"),I=Nn("focus-list");return Ur((qt(),si("div",{class:Wn(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":o.value}]),onMouseover:c,onMouseleave:h,onFocus:p,onBlur:ia(m,["self"])},[(qt(!0),si(Ks,null,hu(t.results,(R,L)=>(qt(),si("div",{class:"flex justify-start relative",key:L},[Ur((qt(),Dn(STn,{key:R.uid,layer:l(R.uid),result:R,selected:R.uid===n.value,onClick:k=>u(R.uid)},null,8,["layer","result","selected","onClick"])),[[S]])]))),128))],42,TTn)),[[I]])}}}),ETn={class:"inline font-bold"},ITn=Ot("span",{class:"flex-auto"},null,-1),ATn=["innerHTML"],MTn=Xr({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=(u,c,h,p)=>{const m=u.find(v=>v[c].toLowerCase()===h.toLowerCase());m&&delete p[m.name]},s=()=>{const u=Object.assign({},e.identifyData.data);n(e.fields,"type","geometry",u),r?.ui.exposeOids||n(e.fields,"type","oid",u),r?.ui.exposeMeasurements||(n(e.fields,"name","shape_length",u),n(e.fields,"name","shape_area",u));const c={};e.fields.forEach(p=>{const m=e.fixtureFields?.find(v=>p.name===v.field);c[p.name]={name:m?.alias||p.alias||p.name,type:p.type,visible:m?.visible??!0}});const h={};Object.keys(u).forEach(p=>{const m=c[p];if(m&&m.visible){const v=u[p];h[p]={value:typeof v=="number"?r?.ui.formatNumber(v):v,alias:m.name,type:m.type}}});for(const[p]of Object.entries(h))r.ui.isPlainText(h[p].value)&&(h[p].value=r.ui.escapeHtml(h[p].value));return h},o=(u,c,h)=>{switch(h){case"date":return l(u);default:return a(u,c)}},a=(u,c)=>{if(!u)return u;if(u.trim().match(/\.(jpeg|jpg|gif|png)$/)||u.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${t(`;const h="underline text-blue-600 break-all",p=document.createElement("div");return p.innerHTML=u.trim(),p.firstElementChild?.tagName=="A"?(p.firstElementChild.className=h,p.innerHTML):gTe(u,{className:h,target:"_blank",validate:{url:v=>/^https?:\/\//.test(v)}})},l=u=>{const c=parseInt(u);return isNaN(c)?u:new Date(c).toISOString().split("T")[0]};return(u,c)=>(qt(),si("div",null,[(qt(!0),si(Ks,null,hu(s(),(h,p,m)=>(qt(),si("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:m},[Ot("span",ETn,br(h.alias),1),ITn,Ot("span",{class:"inline",innerHTML:o(h.value,h.alias,h.type)},null,8,ATn)]))),128))]))}}),OTn=["innerHTML"],PTn={key:1},RTn=Xr({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>i.identifyData?(qt(),si("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:i.identifyData.data.data??i.identifyData.data},null,8,OTn)):(qt(),si("div",PTn,br(ri(e)("details.layers.results.empty")),1))}}),DTn={class:"relative flex flex-grow truncate"},FTn={key:0,class:"flex flex-grow items-center truncate"},kTn={class:"flex p-8 items-center"},LTn=["innerHTML"],NTn={key:1,class:"symbologyIcon p-6"},$Tn=Ot("div",{class:"animate-spin spinner h-20 w-20"},null,-1),BTn=[$Tn],jTn=["content","innerHTML"],GTn={class:"zoomButton text-center p-3"},UTn=["content","aria-label"],zTn={key:0,class:"m-auto animate-spin spinner h-20 w-20"},VTn={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},HTn=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1),WTn=[HTn],qTn={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},YTn=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),XTn=[YTn],JTn=["innerHTML"],u_t=Xr({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1}},setup(i){const e=i,t=H1(),r=eo("iApi"),n=vi([]),s=tL(),{t:o}=Qn(),a=vi(""),l=vi("none"),u=vi(),c=()=>t.getLayerByUid(e.uid),h=Hr(()=>s.properties),p=Hr(()=>s.defaultTemplates),m=Hr(()=>c()?.supportsFeatures??!1),v=Hr(()=>c()?.mapLayer??!1),w=Hr(()=>{const Y=c()?.nameField;let K=Y&&e.data.loaded?e.data.data[Y]:r.$i18n.t("details.items.title");return r.ui.isPlainText(K)&&(K=r.ui.escapeHtml(K)),K}),S=Y=>{if(typeof Y=="string"){const K="underline text-blue-600 break-all",Q=document.createElement("div");return Q.innerHTML=Y.trim(),Q.firstElementChild?.tagName=="A"?(Q.firstElementChild.className=K,Q.innerHTML):gTe(Y,{className:K,target:"_blank",validate:{url:ne=>/^https?:\/\//.test(ne)}})}return Y},I=()=>{$("none"),e.data.loaded?R():e.data.load().then(()=>{R()})},R=()=>{if(a.value="",!(e.data&&e.data.loaded))return;const Y=c();if(Y===void 0){console.warn(`could not find layer for uid ${e.uid} during icon lookup`);return}if(Y.supportsFeatures){const K=Y.oidField;Y.getIcon(e.data.data[K]).then(Q=>{a.value=Q})}},L=Hr(()=>{const Y=c();return Y&&h.value[Y.id]&&h.value[Y.id].template?h.value[Y.id].template:p.value&&p.value[e.data.format]?p.value[e.data.format]:m.value?MTn:RTn}),k=Hr(()=>m.value?c()?.fields||[]:[]),B=Hr(()=>{const Y=c();if(Y&&h.value[Y.id]&&h.value[Y.id].fields)return h.value[Y.id].fields}),$=Y=>{Y==="zoomed"||Y==="error"?setTimeout(()=>{l.value=Y,u.value?._tippy.show(),setTimeout(()=>{u.value?._tippy.hide(),l.value="none"},3e3)},300):l.value=Y},V=()=>{if(l.value!=="none")return;$("zooming");const Y=c();if(Y===void 0||!Y.isLoaded){console.warn(`Could not find layer for uid ${e.uid} during zoom geometry lookup`),$("error");return}if(!e.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),$("error");return}const K=e.data.data[Y.oidField],Q=()=>{const re={getGeom:!0};Y.getGraphic(K,re).then(ne=>{ne.geometry.invalid()?(console.error(`Could not find graphic for objectid ${K}`),$("error")):(r.geo.map.zoomMapTo(ne.geometry),$("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom")))}).catch(()=>{$("error")})};Y.layerType===pn.FEATURE&&Y.geomType!==cl.POINT?Y.getGraphicExtent(K).then(re=>{r.geo.map.zoomMapTo(re),$("zoomed"),r.updateAlert(r.$i18n.t("details.item.alert.zoom"))}).catch(()=>{Q()}):Q()};return E0(()=>{n.value.push(rl(e,()=>{I()},{deep:!1,immediate:!0}))}),Ka(()=>{n.value.forEach(Y=>Y())}),(Y,K)=>{const Q=Nn("tippy");return qt(),si(Ks,null,[Ot("div",DTn,[i.data.loaded&&m.value?(qt(),si("div",FTn,[Ot("div",kTn,[a.value?(qt(),si("span",{key:0,class:"flex-none symbologyIcon",innerHTML:a.value},null,8,LTn)):(qt(),si("div",NTn,BTn))]),Ur(Ot("span",{class:"itemName pl-3 text-left flex-grow truncate",content:w.value,innerHTML:S(w.value)},null,8,jTn),[[Q,{placement:"right"}]]),Ot("span",GTn,[v.value?Ur((qt(),si("button",{key:0,type:"button",content:ri(o)(`details.item.zoom${l.value==="none"?"":`.${l.value}`}`),"aria-label":ri(o)(`grid.cells.zoom${l.value==="none"?"":`.${l.value}`}`),ref_key:"zoomButton",ref:u,onClick:K[0]||(K[0]=re=>{re.stopPropagation(),V()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[l.value==="zooming"?(qt(),si("div",zTn)):l.value==="zoomed"?(qt(),si("svg",VTn,WTn)):l.value==="error"?(qt(),si("svg",qTn,XTn)):(qt(),si("span",{key:3,innerHTML:ri(r).ui.getZoomIcon()},null,8,JTn))],8,UTn)),[[Q,{placement:"bottom"}]]):Yr("",!0)])])):Yr("",!0)]),i.open?(qt(),Dn(xR(L.value),{key:0,identifyData:i.data,fields:k.value,fixtureFields:B.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):Yr("",!0)],64)}}});var tje={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(i){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},modelValue:{validator:function(i){return e=>["number","string","boolean"].indexOf(typeof e)!==-1||e==null},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(i,e){const t=function(o,a,l){const{value:u,modelValue:c,falseValue:h,trueValue:p,disabled:m}=g8(o),v=c&&c.value!==void 0?c:u,w=Hr(()=>v.value===p.value),S=L=>{a.emit("input",L),a.emit("update:modelValue",L),a.emit("change",L)},I=()=>{S(p.value)},R=()=>{S(h.value)};return[null,void 0,!1,0,"0","off"].indexOf(v.value)!==-1&&[h.value,p.value].indexOf(v.value)===-1&&R(),[!0,1,"1","on"].indexOf(v.value)!==-1&&[h.value,p.value].indexOf(v.value)===-1&&I(),{externalValue:v,checked:w,update:S,check:I,uncheck:R,handleInput:L=>{S(L.target.checked?p.value:h.value)},handleClick:()=>{m.value||(w.value?R():I())}}}(i,e),r=function(o,a,l){const{trueValue:u,falseValue:c,onLabel:h,offLabel:p}=g8(o),m=l.checked,v=l.update;return{label:Hr(()=>{let w=m.value?h.value:p.value;return w||(w=" "),w}),toggle:()=>{v(m.value?c.value:u.value)},on:()=>{v(u.value)},off:()=>{v(c.value)}}}(i,0,{checked:t.checked,update:t.update}),n=function(o,a,l){const u=g8(o),c=u.disabled,h=l.checked,p=Hr(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...u.classes.value}));return{classList:Hr(()=>({container:p.value.container,toggle:[p.value.toggle,c.value?h.value?p.value.toggleOnDisabled:p.value.toggleOffDisabled:h.value?p.value.toggleOn:p.value.toggleOff],handle:[p.value.handle,c.value?h.value?p.value.handleOnDisabled:p.value.handleOffDisabled:h.value?p.value.handleOn:p.value.handleOff],label:p.value.label}))}}(i,0,{checked:t.checked}),s=function(o,a,l){const{disabled:u}=g8(o),c=l.check,h=l.uncheck,p=l.checked;return{handleSpace:()=>{u.value||(p.value?h():c())}}}(i,0,{check:t.check,uncheck:t.uncheck,checked:t.checked});return{...t,...n,...r,...s}}};const KTn=["tabindex","aria-checked","aria-describedby","aria-labelledby"],ZTn=["id","name","value","checked","disabled"],QTn=["innerHTML"],eCn=["checked"];tje.render=function(i,e,t,r,n,s){return qt(),si("div",Kae({class:i.classList.container,tabindex:t.disabled?void 0:0,"aria-checked":i.checked,"aria-describedby":t.describedby,"aria-labelledby":t.labelledby,role:"switch"},t.aria,{onKeypress:e[1]||(e[1]=Ph(ia((...o)=>i.handleSpace&&i.handleSpace(...o),["prevent"]),["space"]))}),[Ur(Ot("input",{type:"checkbox",id:t.id,name:t.name,value:t.trueValue,checked:i.checked,disabled:t.disabled},null,8,ZTn),[[bf,!1]]),Ot("div",{class:Wn(i.classList.toggle),onClick:e[0]||(e[0]=(...o)=>i.handleClick&&i.handleClick(...o))},[Ot("span",{class:Wn(i.classList.handle)},null,2),Em(i.$slots,"label",{checked:i.checked,classList:i.classList},()=>[Ot("span",{class:Wn(i.classList.label),innerHTML:i.label},null,10,QTn)]),t.required?(qt(),si("input",{key:0,type:"checkbox",style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},checked:i.checked,"aria-hidden":"true",tabindex:"-1",required:""},null,8,eCn)):Yr("v-if",!0)],2)],16,KTn)},tje.__file="src/Toggle.vue";const tCn=i=>(Dc("data-v-9717afbc"),i=i(),Fc(),i),iCn={class:"flex flex-row rv-label"},rCn={class:"flex items-center"},nCn=["innerHTML"],sCn=tCn(()=>Ot("div",{class:"flex-1"},null,-1)),oCn=Xr({__name:"toggle-switch-control",props:{config:{type:Object,required:!0},name:String,icon:String,ariaLabel:String},emits:["toggled"],setup(i,{emit:e}){const t=i,r=vi(t.config.value),n=vi(!!t.config.disabled),s=vi(0),o=Zl([]),a=vi(null);o.push(rl(LSe(t,"config"),(c,h)=>{r.value=c.value,n.value=!!c.disabled,s.value+=n.value!==h.disabled?1:0},{deep:!0}),rl(a,c=>{c&&u()}));const l=()=>{n.value||(r.value=!r.value,e("toggled",r.value))},u=()=>{if(a.value){const c=a.value.querySelector('input[type="checkbox"]');c&&t.ariaLabel&&c.setAttribute("aria-label",t.ariaLabel)}};return Ka(()=>{o.forEach(c=>c())}),(c,h)=>(qt(),si("div",iCn,[Ot("div",rCn,[Ot("div",{innerHTML:i.icon,class:"p-8 pl-0"},null,8,nCn),Xs(" "+br(i.name),1)]),sCn,Ot("div",{ref_key:"toggleWrapper",ref:a},[(qt(),Dn(ri(tje),{onChange:h[0]||(h[0]=p=>e("toggled",p)),onKeyupCapture:[Ph(ia(l,["stop"]),["enter"]),Ph(ia(l,["stop"]),["space"])],disabled:n.value,key:s.value,modelValue:r.value,"onUpdate:modelValue":h[1]||(h[1]=p=>r.value=p),classes:{container:"inline-block rounded-full outline-none focus:ring focus:ring-blue-500 focus:ring-opacity-30",toggle:"flex w-40 h-15 rounded-full relative cursor-pointer transition items-center box-content border-2 text-xs leading-none",toggleOn:"bg-blue-500 border-blue-500 justify-start text-white",toggleOff:"bg-gray-200 border-gray-200 justify-end text-gray-700",toggleOnDisabled:"bg-gray-300 border-gray-300 justify-start text-gray-400 cursor-not-allowed",toggleOffDisabled:"bg-gray-200 border-gray-200 justify-end text-gray-400 cursor-not-allowed",handle:"inline-block bg-white w-15 h-15 top-0 rounded-full absolute transition-all",handleOn:"left-full transform -translate-x-full",handleOff:"left-0",handleOnDisabled:"bg-gray-100 left-full transform -translate-x-full",handleOffDisabled:"bg-gray-100 left-0",label:"text-center w-8 border-box whitespace-nowrap select-none"}},null,8,["onKeyupCapture","disabled","modelValue"]))],512)]))}}),FJt=ml(oCn,[["__scopeId","data-v-9717afbc"]]),hZe=i=>(Dc("data-v-04b12e3e"),i=i(),Fc(),i),aCn={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},lCn={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},uCn={for:"toggle"},cCn={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},hCn={class:"flex justify-between"},dCn=["aria-label"],pCn={class:"flex bg-gray-200 py-8 items-center"},fCn=["content","aria-label","disabled"],mCn=hZe(()=>Ot("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Ot("g",null,[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)),gCn=[mCn],yCn={class:"px-8"},vCn=["content","aria-label","disabled"],_Cn=hZe(()=>Ot("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[Ot("g",null,[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)),bCn=[_Cn],wCn={key:3},xCn={key:0},SCn={key:0,class:"flex flex-col"},TCn=["onClick"],CCn={key:1,class:"text-center"},ECn={key:4,class:"p-5"},ICn=hZe(()=>Ot("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ACn=Xr({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(i){const e=i,t=eo("iApi"),r=tL(),n=H1(),{t:s}=Qn(),o=vi(!1),a=vi(t.fixture.get("details")),l=vi(!0),u=vi(!1),c=vi(0),h=vi([]),p=vi([]),m=Hr(()=>r.activeGreedy),v=Hr(()=>r.properties),w=()=>n.getLayerByUid(e.uid),S=Hr(()=>e.results.find(H=>H.uid===e.uid)?.loaded??!1),I=Hr(()=>e.results.find(H=>H.uid===e.uid)?.requestTime),R=Hr(()=>{const pe=w();return pe&&v.value[pe.id]&&v.value[pe.id].name?v.value[pe.id].name:pe?.name??""}),L=()=>{const pe=e.results.find(H=>H.uid===e.uid);return pe?pe.items:[]},k=Hr(()=>L()[c.value]),B=Hr(()=>{if(a.value.hasHilighter()){const pe=w();if(pe)return pe.mapLayer&&pe.supportsFeatures}return!1}),$=pe=>{l.value=pe,r.hilightToggle=pe,K()},V=()=>{const pe=w();c.value=c.value??0,l.value=r.hilightToggle??l.value,u.value=!1,o.value=!!pe,K()},Y=pe=>{c.value+=pe},K=()=>{const pe=L();if(l.value&&S&&pe.length>0&&B.value)if(u.value)a.value.hilightDetailsItems(pe,e.uid);else{const H=pe[c.value];H&&a.value.hilightDetailsItems([H],e.uid)}else a.value.removeDetailsHilight()},Q=()=>{u.value=!0,K()},re=()=>{a.value.removeDetailsHilight()},ne=()=>{a.value.removeDetailsHilight()},de=pe=>{c.value=pe,u.value=!1};return Fa(()=>{h.value.push(t.event.on(ln.LAYER_REMOVE,pe=>{const H=t.panel.get("details-panel");e.uid===pe.uid&&H&&H.close()})),h.value.push(t.event.on(ln.PANEL_CLOSED,pe=>{pe.id=="details-panel"&&re()})),h.value.push(t.event.on(ln.PANEL_MINIMIZED,pe=>{pe.id=="details-panel"&&ne()})),h.value.push(t.event.on(ln.MAP_BASEMAPCHANGE,()=>{l.value&&K()}))}),E0(()=>{p.value.push(rl(k,()=>{V(),k.value===void 0&&a.value.removeDetailsHilight()},{deep:!1,immediate:!0})),p.value.push(rl(I,()=>{c.value=0})),p.value.push(rl(()=>e.uid,()=>{c.value=0}))}),Ka(()=>{p.value.forEach(pe=>pe()),h.value.forEach(pe=>t.event.off(pe))}),(pe,H)=>{const Z=Nn("truncate"),ae=Nn("tippy"),fe=Nn("focus-item"),be=Nn("focus-list");return S.value&&m.value===0?(qt(),si("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:s_(i.results.length>1?{"margin-left":"42px"}:"")},[o.value?Ur((qt(),si("h1",aCn,[Xs(br(R.value),1)])),[[Z,{options:{placement:"top-start"}}]]):Yr("",!0),B.value?(qt(),si("div",lCn,[Ot("label",uCn,br(ri(s)("details.togglehilight.title")),1),Vn(FJt,{config:{value:l.value,disabled:!1},onToggled:$},null,8,["config"])])):Yr("",!0),o.value&&L().length>1&&!u.value?(qt(),si("div",cCn,[Ot("div",hCn,[Ot("button",{type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":ri(s)("details.item.see.list"),onClick:H[0]||(H[0]=_e=>Q())},br(ri(s)("details.item.see.list")),9,dCn),Ot("div",pCn,[Ur((qt(),si("button",{type:"button",content:ri(s)("details.item.previous.item"),onClick:H[1]||(H[1]=_e=>Y(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":ri(s)("details.item.previous.item"),disabled:c.value===0},gCn,8,fCn)),[[ae,{placement:"top"}]]),Ot("span",yCn,br(ri(s)("details.item.count",[c.value+1,L().length])),1),Ur((qt(),si("button",{type:"button",content:ri(s)("details.item.next.item"),onClick:H[2]||(H[2]=_e=>Y(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":ri(s)("details.item.next.item"),disabled:c.value===L().length-1},bCn,8,vCn)),[[ae,{placement:"top"}]])])])])):Yr("",!0),o.value?(qt(),si("div",wCn,[L().length>0?(qt(),si("div",xCn,[u.value?Ur((qt(),si("div",SCn,[(qt(!0),si(Ks,null,hu(L(),(_e,Ie)=>Ur((qt(),si("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:Ie,onClick:Te=>de(Ie)},[Vn(u_t,{data:_e,uid:i.uid,open:!1},null,8,["data","uid"])],8,TCn)),[[fe]])),128))])),[[be]]):(qt(),Dn(u_t,{key:1,data:k.value,uid:i.uid,open:!0},null,8,["data","uid"]))])):(qt(),si("div",CCn,br(ri(s)("details.layers.results.empty.currentLayer")),1))])):(qt(),si("div",ECn,br(ri(s)("details.item.no.data")),1))],4)):(qt(),si("div",{key:1,class:Wn(["flex justify-center py-10 items-center",i.results.length>1?"ml-42":""])},[ICn,Xs(" "+br(ri(s)("details.item.loading")),1)],2))}}}),MCn=ml(ACn,[["__scopeId","data-v-04b12e3e"]]),OCn={class:"relative h-full"},PCn={class:"detailsContentSection overflow-y-auto h-full"},RCn=Xr({__name:"details-screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=tL(),n=vi([]),s=vi([]),o=vi([]),a=vi(!1),l=vi(""),u=vi(!1),c=Hr(()=>r.activeGreedy),h=Hr(()=>r.payload),p=Hr(()=>r.properties),m=I=>{l.value=I,u.value=!0},v=I=>{if(I===void 0)return;const R=I.length===0?0:I[0].requestTime;r.activeGreedy=R,r.slowLoadingFlag=!1,o.value=I,w(I)},w=I=>{if(u.value){const R=o.value.findIndex(L=>L.uid===l.value);if(R!==-1){const L=o.value[R];L.loading.then(()=>{L.requestTime===c.value&&(L.items.length>0?(r.activeGreedy=0,u.value=!1,a.value=!1):S(I))})}else S(I)}else S(I);setTimeout(()=>{c.value!==0&&I[0].requestTime===c.value&&(r.slowLoadingFlag=!0)},500)},S=I=>{const R=I.map(k=>k.loading.then(()=>k.items.length>0?Promise.resolve(k):Promise.reject())),L=I.length===0?0:I[0].requestTime;Promise.any(R).then(k=>{if(k.requestTime!==c.value)return;const B=o.value.find($=>$.uid===k.uid);r.activeGreedy=0,B!==void 0&&(l.value=B.uid,a.value=!1)}).catch(()=>{L===c.value&&(r.activeGreedy=0,a.value=!0)})};return E0(()=>{s.value.push(rl(h,I=>{v(I)},{deep:!1,immediate:!0})),s.value.push(rl(c,I=>{I===0&&(r.slowLoadingFlag=!1)}))}),Ka(()=>{n.value.forEach(I=>t.event.off(I)),s.value.forEach(I=>I())}),(I,R)=>{const L=Ko("panel-screen");return qt(),Dn(L,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(r).origin==="toggleEvent"?ri(e)("details.layers.title.gridOrigin"):ri(e)("details.layers.title.identifyOrigin")),1)]),content:Rn(()=>[Ot("div",OCn,[o.value.length>1?(qt(),Dn(CTn,{key:0,results:o.value,detailsProperties:p.value,selected:l.value,onSelectionChanged:m},null,8,["results","detailsProperties","selected"])):Yr("",!0),Ot("div",PCn,[a.value?(qt(),si("div",{key:1,class:Wn(["text-center",{"ml-42":o.value.length>1}])},br(o.value.length>=1?ri(e)("details.layers.results.empty"):ri(e)("details.layers.results.empty.noLayers")),3)):(qt(),Dn(MCn,{key:0,uid:l.value,results:o.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),DCn=ml(RCn,[["__scopeId","data-v-251e74c1"]]),FCn={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.result.default.name":"Identify Item {0}","details.items.title":"Details","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.result.default.name":"Désigner l'élément {0}","details.items.title":"Détails","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class kCn extends nTn{async added(){this.$iApi.panel.register({"details-panel":{screens:{"details-screen":Da(DCn)},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:FCn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details-panel"),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("details-panel"),tL(this.$vApp.$pinia).$reset()}}}const LCn=Object.freeze(Object.defineProperty({__proto__:null,default:kCn},Symbol.toStringTag,{value:"Module"}));var fh={};const NCn={},$Cn=Object.freeze(Object.defineProperty({__proto__:null,default:NCn},Symbol.toStringTag,{value:"Module"})),IRe=wSe($Cn);(function(i){/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */var e=e||{version:"5.3.0"};if(i.fabric=e,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?e.document=document:e.document=document.implementation.createHTMLDocument(""),e.window=window;else{var t=IRe,r=new t.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;e.document=r.document,e.jsdomImplForWrapper=IRe.implForWrapper,e.nodeCanvas=IRe.Canvas,e.window=r,DOMParser=e.window.DOMParser}e.isTouchSupported="ontouchstart"in e.window||"ontouchstart"in e.document||e.window&&e.window.navigator&&e.window.navigator.maxTouchPoints>0,e.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",e.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],e.DPI=96,e.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",e.commaWsp="(?:\\s+,?\\s*|,\\s*)",e.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,e.reNonWord=/[ \n\.,;!\?\-]/,e.fontPaths={},e.iMatrix=[1,0,0,1,0,0],e.svgNS="http://www.w3.org/2000/svg",e.perfLimitSizeTotal=2097152,e.maxCacheSideLimit=4096,e.minCacheSideLimit=256,e.charWidthsCache={},e.textureSize=2048,e.disableStyleCopyPaste=!1,e.enableGLFiltering=!0,e.devicePixelRatio=e.window.devicePixelRatio||e.window.webkitDevicePixelRatio||e.window.mozDevicePixelRatio||1,e.browserShadowBlurConstant=1,e.arcToSegmentsCache={},e.boundsOfCurveCache={},e.cachesBoundsOfCurve=!0,e.forceGLPutImageData=!1,e.initFilterBackend=function(){if(e.enableGLFiltering&&e.isWebglSupported&&e.isWebglSupported(e.textureSize))return console.log("max texture size: "+e.maxTextureSize),new e.WebglFilterBackend({tileSize:e.textureSize});if(e.Canvas2dFilterBackend)return new e.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=e),function(){function a(m,v){if(this.__eventListeners[m]){var w=this.__eventListeners[m];v?w[w.indexOf(v)]=!1:e.util.array.fill(w,!1)}}function l(m,v){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var w in m)this.on(w,m[w]);else this.__eventListeners[m]||(this.__eventListeners[m]=[]),this.__eventListeners[m].push(v);return this}function u(m,v){var w=function(){v.apply(this,arguments),this.off(m,w)}.bind(this);this.on(m,w)}function c(m,v){if(arguments.length===1)for(var w in m)u.call(this,w,m[w]);else u.call(this,m,v);return this}function h(m,v){if(!this.__eventListeners)return this;if(arguments.length===0)for(m in this.__eventListeners)a.call(this,m);else if(arguments.length===1&&typeof arguments[0]=="object")for(var w in m)a.call(this,w,m[w]);else a.call(this,m,v);return this}function p(m,v){if(!this.__eventListeners)return this;var w=this.__eventListeners[m];if(!w)return this;for(var S=0,I=w.length;S"u"?this._objects.concat():this._objects.filter(function(l){return l.type===a})},item:function(a){return this._objects[a]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(a,l){return this._objects.indexOf(a)>-1?!0:l?this._objects.some(function(u){return typeof u.contains=="function"&&u.contains(a,!0)}):!1},complexity:function(){return this._objects.reduce(function(a,l){return a+=l.complexity?l.complexity():0,a},0)}},e.CommonMethods={_setOptions:function(a){for(var l in a)this.set(l,a[l])},_initGradient:function(a,l){a&&a.colorStops&&!(a instanceof e.Gradient)&&this.set(l,new e.Gradient(a))},_initPattern:function(a,l,u){a&&a.source&&!(a instanceof e.Pattern)?this.set(l,new e.Pattern(a,u)):u&&u()},_setObject:function(a){for(var l in a)this._set(l,a[l])},set:function(a,l){return typeof a=="object"?this._setObject(a):this._set(a,l),this},_set:function(a,l){this[a]=l},toggle:function(a){var l=this.get(a);return typeof l=="boolean"&&this.set(a,!l),this},get:function(a){return this[a]}},function(a){var l=Math.sqrt,u=Math.atan2,c=Math.pow,h=Math.PI/180,p=Math.PI/2;e.util={cos:function(m){if(m===0)return 1;m<0&&(m=-m);var v=m/p;switch(v){case 1:case 3:return 0;case 2:return-1}return Math.cos(m)},sin:function(m){if(m===0)return 0;var v=m/p,w=1;switch(m<0&&(w=-1),v){case 1:return w;case 2:return 0;case 3:return-w}return Math.sin(m)},removeFromArray:function(m,v){var w=m.indexOf(v);return w!==-1&&m.splice(w,1),m},getRandomInt:function(m,v){return Math.floor(Math.random()*(v-m+1))+m},degreesToRadians:function(m){return m*h},radiansToDegrees:function(m){return m/h},rotatePoint:function(m,v,w){var S=new e.Point(m.x-v.x,m.y-v.y),I=e.util.rotateVector(S,w);return new e.Point(I.x,I.y).addEquals(v)},rotateVector:function(m,v){var w=e.util.sin(v),S=e.util.cos(v),I=m.x*S-m.y*w,R=m.x*w+m.y*S;return{x:I,y:R}},createVector:function(m,v){return new e.Point(v.x-m.x,v.y-m.y)},calcAngleBetweenVectors:function(m,v){return Math.acos((m.x*v.x+m.y*v.y)/(Math.hypot(m.x,m.y)*Math.hypot(v.x,v.y)))},getHatVector:function(m){return new e.Point(m.x,m.y).multiply(1/Math.hypot(m.x,m.y))},getBisector:function(m,v,w){var S=e.util.createVector(m,v),I=e.util.createVector(m,w),R=e.util.calcAngleBetweenVectors(S,I),L=e.util.calcAngleBetweenVectors(e.util.rotateVector(S,R),I),k=R*(L===0?1:-1)/2;return{vector:e.util.getHatVector(e.util.rotateVector(S,k)),angle:R}},projectStrokeOnPoints:function(m,v,w){var S=[],I=v.strokeWidth/2,R=v.strokeUniform?new e.Point(1/v.scaleX,1/v.scaleY):new e.Point(1,1),L=function(k){var B=I/Math.hypot(k.x,k.y);return new e.Point(k.x*B*R.x,k.y*B*R.y)};return m.length<=1||m.forEach(function(k,B){var $=new e.Point(k.x,k.y),V,Y;B===0?(Y=m[B+1],V=w?L(e.util.createVector(Y,$)).addEquals($):m[m.length-1]):B===m.length-1?(V=m[B-1],Y=w?L(e.util.createVector(V,$)).addEquals($):m[0]):(V=m[B-1],Y=m[B+1]);var K=e.util.getBisector($,V,Y),Q=K.vector,re=K.angle,ne,de;if(v.strokeLineJoin==="miter"&&(ne=-I/Math.sin(re/2),de=new e.Point(Q.x*ne*R.x,Q.y*ne*R.y),Math.hypot(de.x,de.y)/I<=v.strokeMiterLimit)){S.push($.add(de)),S.push($.subtract(de));return}ne=-I*Math.SQRT2,de=new e.Point(Q.x*ne*R.x,Q.y*ne*R.y),S.push($.add(de)),S.push($.subtract(de))}),S},transformPoint:function(m,v,w){return w?new e.Point(v[0]*m.x+v[2]*m.y,v[1]*m.x+v[3]*m.y):new e.Point(v[0]*m.x+v[2]*m.y+v[4],v[1]*m.x+v[3]*m.y+v[5])},makeBoundingBoxFromPoints:function(m,v){if(v)for(var w=0;w"u"?1:m.scaleX,w=typeof m.scaleY>"u"?1:m.scaleY,S=[m.flipX?-v:v,0,0,m.flipY?-w:w,0,0],I=e.util.multiplyTransformMatrices,R=e.util.degreesToRadians;return m.skewX&&(S=I(S,[1,0,Math.tan(R(m.skewX)),1],!0)),m.skewY&&(S=I(S,[1,Math.tan(R(m.skewY)),0,1],!0)),S},composeMatrix:function(m){var v=[1,0,0,1,m.translateX||0,m.translateY||0],w=e.util.multiplyTransformMatrices;return m.angle&&(v=w(v,e.util.calcRotateMatrix(m))),(m.scaleX!==1||m.scaleY!==1||m.skewX||m.skewY||m.flipX||m.flipY)&&(v=w(v,e.util.calcDimensionsMatrix(m))),v},resetObjectTransform:function(m){m.scaleX=1,m.scaleY=1,m.skewX=0,m.skewY=0,m.flipX=!1,m.flipY=!1,m.rotate(0)},saveObjectTransform:function(m){return{scaleX:m.scaleX,scaleY:m.scaleY,skewX:m.skewX,skewY:m.skewY,angle:m.angle,left:m.left,flipX:m.flipX,flipY:m.flipY,top:m.top}},isTransparent:function(m,v,w,S){S>0&&(v>S?v-=S:v=0,w>S?w-=S:w=0);var I=!0,R,L,k=m.getImageData(v,w,S*2||1,S*2||1),B=k.data.length;for(R=3;R0){var V=e.util.hasStyleChanged(R,$,!0);V?L.push({start:I,end:I+1,style:$}):L[L.length-1].end++}R=$||{}}}return L},stylesFromArray:function(m,v){if(!Array.isArray(m))return m;for(var w=v.split(` `),S=-1,I=0,R={},L=0;L0?Me-=2*tt:Ve===1&&Me<0&&(Me+=2*tt);for(var ht=Math.ceil(Math.abs(Me/tt*2)),Ht=[],_t=Me/ht,Fe=8/3*Math.sin(_t/4)*Math.sin(_t/4)/Math.sin(_t/2),Yt=rt+_t,A=0;A=Be?Ve-Be:2*Math.PI-(Be-Ve)}function m(be,_e,Ie,Te,Be,Ve,$e,tt){var yt;if(e.cachesBoundsOfCurve&&(yt=a.call(arguments),e.boundsOfCurveCache[yt]))return e.boundsOfCurveCache[yt];var Ct=Math.sqrt,ot=Math.min,vt=Math.max,At=Math.abs,Je=[],it=[[],[]],Ue,ct,st,Ze,ye,Ke,ke,me;ct=6*be-12*Ie+6*Be,Ue=-3*be+9*Ie-9*Be+3*$e,st=3*Ie-3*be;for(var ie=0;ie<2;++ie){if(ie>0&&(ct=6*_e-12*Te+6*Ve,Ue=-3*_e+9*Te-9*Ve+3*tt,st=3*Te-3*_e),At(Ue)<1e-12){if(At(ct)<1e-12)continue;Ze=-st/ct,01e-4;)$e=Be(Ie),ot=Ie,tt=S(Ve.x,Ve.y,$e.x,$e.y),tt+Te>_e?(Ie-=yt,yt/=2):(Ve=$e,Ie+=yt,Te+=tt);return $e.angle=Ct(ot),$e}function pe(be){for(var _e=0,Ie=be.length,Te,Be=0,Ve=0,$e=0,tt=0,yt=[],Ct,ot,vt,At=0;At0&&Teke)for(var ie=1,ge=Ue.length;ie2;for(_e=_e||0,Ct&&(tt=be[2].xbe[Te-2].x?1:Be.x===be[Te-2].x?0:-1,yt=Be.y>be[Te-2].y?1:Be.y===be[Te-2].y?0:-1),Ie.push(["L",Be.x+tt*_e,Be.y+yt*_e]),Ie}function fe(be,_e,Ie){return Ie&&(_e=e.util.multiplyTransformMatrices(_e,[1,0,0,1,-Ie.x,-Ie.y])),be.map(function(Te){for(var Be=Te.slice(0),Ve={},$e=1;$e=S})}function c(m,v){return p(m,v,function(w,S){return w/g,">")}function c(p){var m=0,v,w=[];for(m=0,v;m57343)return p.charAt(m);if(55296<=v&&v<=56319){if(p.length<=m+1)throw"High surrogate without following low surrogate";var w=p.charCodeAt(m+1);if(56320>w||w>57343)throw"High surrogate without following low surrogate";return p.charAt(m)+p.charAt(m+1)}if(m===0)throw"Low surrogate without preceding high surrogate";var S=p.charCodeAt(m-1);if(55296>S||S>56319)throw"Low surrogate without preceding high surrogate";return!1}e.util.string={camelize:a,capitalize:l,escapeXml:u,graphemeSplit:c}}(),function(){var a=Array.prototype.slice,l=function(){},u=function(){for(var v in{toString:1})if(v==="toString")return!1;return!0}(),c=function(v,w,S){for(var I in w)I in v.prototype&&typeof v.prototype[I]=="function"&&(w[I]+"").indexOf("callSuper")>-1?v.prototype[I]=function(R){return function(){var L=this.constructor.superclass;this.constructor.superclass=S;var k=w[R].apply(this,arguments);if(this.constructor.superclass=L,R!=="initialize")return k}}(I):v.prototype[I]=w[I],u&&(w.toString!==Object.prototype.toString&&(v.prototype.toString=w.toString),w.valueOf!==Object.prototype.valueOf&&(v.prototype.valueOf=w.valueOf))};function h(){}function p(v){for(var w=null,S=this;S.constructor.superclass;){var I=S.constructor.superclass.prototype[v];if(S[v]!==I){w=I;break}S=S.constructor.superclass.prototype}return w?arguments.length>1?w.apply(this,a.call(arguments,1)):w.call(this):console.log("tried to callSuper "+v+", method not found in prototype chain",this)}function m(){var v=null,w=a.call(arguments,0);typeof w[0]=="function"&&(v=w.shift());function S(){this.initialize.apply(this,arguments)}S.superclass=v,S.subclasses=[],v&&(h.prototype=v.prototype,S.prototype=new h,v.subclasses.push(S));for(var I=0,R=w.length;I-1||c.pointerType==="touch"}}(),function(){function a(m,v){var w=m.style;if(!w)return m;if(typeof v=="string")return m.style.cssText+=";"+v,v.indexOf("opacity")>-1?p(m,v.match(/opacity:\s*(\d?\.?\d*)/)[1]):m;for(var S in v)if(S==="opacity")p(m,v[S]);else{var I=S==="float"||S==="cssFloat"?typeof w.styleFloat>"u"?"cssFloat":"styleFloat":S;w.setProperty(I,v[S])}return m}var l=e.document.createElement("div"),u=typeof l.style.opacity=="string",c=typeof l.style.filter=="string",h=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,p=function(m){return m};u?p=function(m,v){return m.style.opacity=v,m}:c&&(p=function(m,v){var w=m.style;return m.currentStyle&&!m.currentStyle.hasLayout&&(w.zoom=1),h.test(w.filter)?(v=v>=.9999?"":"alpha(opacity="+v*100+")",w.filter=w.filter.replace(h,v)):w.filter+=" alpha(opacity="+v*100+")",m}),e.util.setStyle=a}(),function(){var a=Array.prototype.slice;function l(k){return typeof k=="string"?e.document.getElementById(k):k}var u,c=function(k){return a.call(k,0)};try{u=c(e.document.childNodes)instanceof Array}catch{}u||(c=function(k){for(var B=new Array(k.length),$=k.length;$--;)B[$]=k[$];return B});function h(k,B){var $=e.document.createElement(k);for(var V in B)V==="class"?$.className=B[V]:V==="for"?$.htmlFor=B[V]:$.setAttribute(V,B[V]);return $}function p(k,B){k&&(" "+k.className+" ").indexOf(" "+B+" ")===-1&&(k.className+=(k.className?" ":"")+B)}function m(k,B,$){return typeof B=="string"&&(B=h(B,$)),k.parentNode&&k.parentNode.replaceChild(B,k),B.appendChild(k),B}function v(k){for(var B=0,$=0,V=e.document.documentElement,Y=e.document.body||{scrollLeft:0,scrollTop:0};k&&(k.parentNode||k.host)&&(k=k.parentNode||k.host,k===e.document?(B=Y.scrollLeft||V.scrollLeft||0,$=Y.scrollTop||V.scrollTop||0):(B+=k.scrollLeft||0,$+=k.scrollTop||0),!(k.nodeType===1&&k.style.position==="fixed")););return{left:B,top:$}}function w(k){var B,$=k&&k.ownerDocument,V={left:0,top:0},Y={left:0,top:0},K,Q={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!$)return Y;for(var re in Q)Y[Q[re]]+=parseInt(S(k,re),10)||0;return B=$.documentElement,typeof k.getBoundingClientRect<"u"&&(V=k.getBoundingClientRect()),K=v(k),{left:V.left+K.left-(B.clientLeft||0)+Y.left,top:V.top+K.top-(B.clientTop||0)+Y.top}}var S;e.document.defaultView&&e.document.defaultView.getComputedStyle?S=function(k,B){var $=e.document.defaultView.getComputedStyle(k,null);return $?$[B]:void 0}:S=function(k,B){var $=k.style[B];return!$&&k.currentStyle&&($=k.currentStyle[B]),$},function(){var k=e.document.documentElement.style,B="userSelect"in k?"userSelect":"MozUserSelect"in k?"MozUserSelect":"WebkitUserSelect"in k?"WebkitUserSelect":"KhtmlUserSelect"in k?"KhtmlUserSelect":"";function $(Y){return typeof Y.onselectstart<"u"&&(Y.onselectstart=e.util.falseFunction),B?Y.style[B]="none":typeof Y.unselectable=="string"&&(Y.unselectable="on"),Y}function V(Y){return typeof Y.onselectstart<"u"&&(Y.onselectstart=null),B?Y.style[B]="":typeof Y.unselectable=="string"&&(Y.unselectable=""),Y}e.util.makeElementUnselectable=$,e.util.makeElementSelectable=V}();function I(k){var B=e.jsdomImplForWrapper(k);return B._canvas||B._image}function R(k){if(e.isLikelyNode){var B=e.jsdomImplForWrapper(k);B&&(B._image=null,B._canvas=null,B._currentSrc=null,B._attributes=null,B._classList=null)}}function L(k,B){k.imageSmoothingEnabled=k.imageSmoothingEnabled||k.webkitImageSmoothingEnabled||k.mozImageSmoothingEnabled||k.msImageSmoothingEnabled||k.oImageSmoothingEnabled,k.imageSmoothingEnabled=B}e.util.setImageSmoothing=L,e.util.getById=l,e.util.toArray=c,e.util.addClass=p,e.util.makeElement=h,e.util.wrapElement=m,e.util.getScrollLeftTop=v,e.util.getElementOffset=w,e.util.getNodeCanvas=I,e.util.cleanUpJsdomNode=R}(),function(){function a(c,h){return c+(/\?/.test(c)?"&":"?")+h}function l(){}function u(c,h){h||(h={});var p=h.method?h.method.toUpperCase():"GET",m=h.onComplete||function(){},v=new e.window.XMLHttpRequest,w=h.body||h.parameters;return v.onreadystatechange=function(){v.readyState===4&&(m(v),v.onreadystatechange=l)},p==="GET"&&(w=null,typeof h.parameters=="string"&&(c=a(c,h.parameters))),v.open(p,c,!0),(p==="POST"||p==="PUT")&&v.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),v.send(w),v}e.util.request=u}(),e.log=console.log,e.warn=console.warn,function(){var a=e.util.object.extend,l=e.util.object.clone,u=[];e.util.object.extend(u,{cancelAll:function(){var I=this.splice(0);return I.forEach(function(R){R.cancel()}),I},cancelByCanvas:function(I){if(!I)return[];var R=this.filter(function(L){return typeof L.target=="object"&&L.target.canvas===I});return R.forEach(function(L){L.cancel()}),R},cancelByTarget:function(I){var R=this.findAnimationsByTarget(I);return R.forEach(function(L){L.cancel()}),R},findAnimationIndex:function(I){return this.indexOf(this.findAnimation(I))},findAnimation:function(I){return this.find(function(R){return R.cancel===I})},findAnimationsByTarget:function(I){return I?this.filter(function(R){return R.target===I}):[]}});function c(){return!1}function h(I,R,L,k){return-L*Math.cos(I/k*(Math.PI/2))+L+R}function p(I){I||(I={});var R=!1,L,k=function(){var B=e.runningAnimations.indexOf(L);return B>-1&&e.runningAnimations.splice(B,1)[0]};return L=a(l(I),{cancel:function(){return R=!0,k()},currentValue:"startValue"in I?I.startValue:0,completionRate:0,durationRate:0}),e.runningAnimations.push(L),w(function(B){var $=B||+new Date,V=I.duration||500,Y=$+V,K,Q=I.onChange||c,re=I.abort||c,ne=I.onComplete||c,de=I.easing||h,pe="startValue"in I?I.startValue.length>0:!1,H="startValue"in I?I.startValue:0,Z="endValue"in I?I.endValue:100,ae=I.byValue||(pe?H.map(function(fe,be){return Z[be]-H[be]}):Z-H);I.onStart&&I.onStart(),function fe(be){K=be||+new Date;var _e=K>Y?V:K-$,Ie=_e/V,Te=pe?H.map(function(Ve,$e){return de(_e,H[$e],ae[$e],V)}):de(_e,H,ae,V),Be=Math.abs(pe?(Te[0]-H[0])/ae[0]:(Te-H)/ae);if(L.currentValue=pe?Te.slice():Te,L.completionRate=Be,L.durationRate=Ie,!R){if(re(Te,Be,Ie)){k();return}if(K>Y){L.currentValue=pe?Z.slice():Z,L.completionRate=1,L.durationRate=1,Q(pe?Z.slice():Z,1,1),ne(Z,1,1),k();return}else Q(Te,Be,Ie),w(fe)}}($)}),L.cancel}var m=e.window.requestAnimationFrame||e.window.webkitRequestAnimationFrame||e.window.mozRequestAnimationFrame||e.window.oRequestAnimationFrame||e.window.msRequestAnimationFrame||function(I){return e.window.setTimeout(I,1e3/60)},v=e.window.cancelAnimationFrame||e.window.clearTimeout;function w(){return m.apply(e.window,arguments)}function S(){return v.apply(e.window,arguments)}e.util.animate=p,e.util.requestAnimFrame=w,e.util.cancelAnimFrame=S,e.runningAnimations=u}(),function(){function a(u,c,h){var p="rgba("+parseInt(u[0]+h*(c[0]-u[0]),10)+","+parseInt(u[1]+h*(c[1]-u[1]),10)+","+parseInt(u[2]+h*(c[2]-u[2]),10);return p+=","+(u&&c?parseFloat(u[3]+h*(c[3]-u[3])):1),p+=")",p}function l(u,c,h,p){var m=new e.Color(u).getSource(),v=new e.Color(c).getSource(),w=p.onComplete,S=p.onChange;return p=p||{},e.util.animate(e.util.object.extend(p,{duration:h||500,startValue:m,endValue:v,byValue:v,easing:function(I,R,L,k){var B=p.colorEasing?p.colorEasing(I,k):1-Math.cos(I/k*(Math.PI/2));return a(R,L,B)},onComplete:function(I,R,L){if(w)return w(a(v,v,0),R,L)},onChange:function(I,R,L){if(S){if(Array.isArray(I))return S(a(I,I,0),R,L);S(I,R,L)}}}))}e.util.animateColor=l}(),function(){function a(be,_e,Ie,Te){return be-1&&At>-1&&At-1)&&($e="stroke")}else{if(Ve==="href"||Ve==="xlink:href"||Ve==="font")return $e;if(Ve==="imageSmoothing")return $e==="optimizeQuality";ot=Ct?$e.map(p):p($e,yt)}}return!Ct&&isNaN(ot)?$e:ot}function Y(Ve){return new RegExp("^("+Ve.join("|")+")\\b","i")}function K(Ve){for(var $e in L)if(!(typeof Ve[L[$e]]>"u"||Ve[$e]==="")){if(typeof Ve[$e]>"u"){if(!l.Object.prototype[$e])continue;Ve[$e]=l.Object.prototype[$e]}if(Ve[$e].indexOf("url(")!==0){var tt=new l.Color(Ve[$e]);Ve[$e]=tt.setAlpha(h(tt.getAlpha()*Ve[L[$e]],2)).toRgba()}}return Ve}function Q(Ve,$e){var tt,yt=[],Ct,ot,vt;for(ot=0,vt=$e.length;ot1;)je.shift(),rt=l.util.multiplyTransformMatrices(rt,je[0]);return rt}}();function re(Ve,$e){var tt,yt;Ve.replace(/;\s*$/,"").split(";").forEach(function(Ct){var ot=Ct.split(":");tt=ot[0].trim().toLowerCase(),yt=ot[1].trim(),$e[tt]=yt})}function ne(Ve,$e){var tt,yt;for(var Ct in Ve)typeof Ve[Ct]>"u"||(tt=Ct.toLowerCase(),yt=Ve[Ct],$e[tt]=yt)}function de(Ve,$e){var tt={};for(var yt in l.cssRules[$e])if(pe(Ve,yt.split(" ")))for(var Ct in l.cssRules[$e][yt])tt[Ct]=l.cssRules[$e][yt][Ct];return tt}function pe(Ve,$e){var tt,yt=!0;return tt=Z(Ve,$e.pop()),tt&&$e.length&&(yt=H(Ve,$e)),tt&&yt&&$e.length===0}function H(Ve,$e){for(var tt,yt=!0;Ve.parentNode&&Ve.parentNode.nodeType===1&&$e.length;)yt&&(tt=$e.pop()),Ve=Ve.parentNode,yt=Z(Ve,tt);return $e.length===0}function Z(Ve,$e){var tt=Ve.nodeName,yt=Ve.getAttribute("class"),Ct=Ve.getAttribute("id"),ot,vt;if(ot=new RegExp("^"+tt,"i"),$e=$e.replace(ot,""),Ct&&$e.length&&(ot=new RegExp("#"+Ct+"(?![a-zA-Z\\-]+)","i"),$e=$e.replace(ot,"")),yt&&$e.length)for(yt=yt.split(" "),vt=yt.length;vt--;)ot=new RegExp("\\."+yt[vt]+"(?![a-zA-Z\\-]+)","i"),$e=$e.replace(ot,"");return $e.length===0}function ae(Ve,$e){var tt;if(Ve.getElementById&&(tt=Ve.getElementById($e)),tt)return tt;var yt,Ct,ot,vt=Ve.getElementsByTagName("*");for(Ct=0,ot=vt.length;Ctyt?yt:tt),ye.meetOrSlice==="slice"&&(yt=tt=tt>yt?tt:yt),je=ie.width-vt*tt,rt=ie.height-At*tt,ye.alignX==="Mid"&&(je/=2),ye.alignY==="Mid"&&(rt/=2),ye.alignX==="Min"&&(je=0),ye.alignY==="Min"&&(rt=0)),tt===1&&yt===1&&Ct===0&&ot===0&&st===0&&Ze===0)return ie;if((st||Ze)&&Ve.parentNode.nodeName!=="#document"&&(ge=" translate("+p(st)+" "+p(Ze)+") "),Je=ge+" matrix("+tt+" 0 0 "+yt+" "+(Ct*tt+je)+" "+(ot*yt+rt)+") ",Ve.nodeName==="svg"){for(it=Ve.ownerDocument.createElementNS(l.svgNS,"g");Ve.firstChild;)it.appendChild(Ve.firstChild);Ve.appendChild(it)}else it=Ve,it.removeAttribute("x"),it.removeAttribute("y"),Je=it.getAttribute("transform")+Je;return it.setAttribute("transform",Je),ie}function Ie(Ve,$e){for(;Ve&&(Ve=Ve.parentNode);)if(Ve.nodeName&&$e.test(Ve.nodeName.replace("svg:",""))&&!Ve.getAttribute("instantiated_by_use"))return!0;return!1}l.parseSVGDocument=function(Ve,$e,tt,yt){if(Ve){fe(Ve);var Ct=l.Object.__uid++,ot,vt,At=_e(Ve),Je=l.util.toArray(Ve.getElementsByTagName("*"));if(At.crossOrigin=yt&&yt.crossOrigin,At.svgUid=Ct,Je.length===0&&l.isLikelyNode){Je=Ve.selectNodes('//*[name(.)!="svg"]');var it=[];for(ot=0,vt=Je.length;ot"u"&&(tt=Ve.getAttribute("svgUid")),Ve.parentNode&&l.svgValidParentsRegEx.test(Ve.parentNode.nodeName)&&(Ct=l.parseAttributes(Ve.parentNode,$e,tt));var At=$e.reduce(function(ye,Ke){return yt=Ve.getAttribute(Ke),yt&&(ye[Ke]=yt),ye},{}),Je=u(de(Ve,tt),l.parseStyleAttribute(Ve));At=u(At,Je),Je[B]&&Ve.setAttribute(B,Je[B]),ot=vt=Ct.fontSize||l.Text.DEFAULT_SVG_FONT_SIZE,At[k]&&(At[k]=ot=p(At[k],vt));var it,Ue,ct={};for(var st in At)it=$(st),Ue=V(it,At[st],Ct,ot),ct[it]=Ue;ct&&ct.font&&l.parseFontDeclaration(ct.font,ct);var Ze=u(Ct,ct);return l.svgValidParentsRegEx.test(Ve.nodeName)?Ze:K(Ze)}},parseElements:function(Ve,$e,tt,yt,Ct){new l.ElementsParser(Ve,$e,tt,yt,Ct).parse()},parseStyleAttribute:function(Ve){var $e={},tt=Ve.getAttribute("style");return tt&&(typeof tt=="string"?re(tt,$e):ne(tt,$e)),$e},parsePointsAttribute:function(Ve){if(!Ve)return null;Ve=Ve.replace(/,/g," ").trim(),Ve=Ve.split(/\s+/);var $e=[],tt,yt;for(tt=0,yt=Ve.length;ttc.x&&this.y>c.y},gte:function(c){return this.x>=c.x&&this.y>=c.y},lerp:function(c,h){return typeof h>"u"&&(h=.5),h=Math.max(Math.min(1,h),0),new u(this.x+(c.x-this.x)*h,this.y+(c.y-this.y)*h)},distanceFrom:function(c){var h=this.x-c.x,p=this.y-c.y;return Math.sqrt(h*h+p*p)},midPointFrom:function(c){return this.lerp(c)},min:function(c){return new u(Math.min(this.x,c.x),Math.min(this.y,c.y))},max:function(c){return new u(Math.max(this.x,c.x),Math.max(this.y,c.y))},toString:function(){return this.x+","+this.y},setXY:function(c,h){return this.x=c,this.y=h,this},setX:function(c){return this.x=c,this},setY:function(c){return this.y=c,this},setFromPoint:function(c){return this.x=c.x,this.y=c.y,this},swap:function(c){var h=this.x,p=this.y;this.x=c.x,this.y=c.y,c.x=h,c.y=p},clone:function(){return new u(this.x,this.y)}}}(i),function(a){var l=a.fabric||(a.fabric={});if(l.Intersection){l.warn("fabric.Intersection is already defined");return}function u(c){this.status=c,this.points=[]}l.Intersection=u,l.Intersection.prototype={constructor:u,appendPoint:function(c){return this.points.push(c),this},appendPoints:function(c){return this.points=this.points.concat(c),this}},l.Intersection.intersectLineLine=function(c,h,p,m){var v,w=(m.x-p.x)*(c.y-p.y)-(m.y-p.y)*(c.x-p.x),S=(h.x-c.x)*(c.y-p.y)-(h.y-c.y)*(c.x-p.x),I=(m.y-p.y)*(h.x-c.x)-(m.x-p.x)*(h.y-c.y);if(I!==0){var R=w/I,L=S/I;0<=R&&R<=1&&0<=L&&L<=1?(v=new u("Intersection"),v.appendPoint(new l.Point(c.x+R*(h.x-c.x),c.y+R*(h.y-c.y)))):v=new u}else w===0||S===0?v=new u("Coincident"):v=new u("Parallel");return v},l.Intersection.intersectLinePolygon=function(c,h,p){var m=new u,v=p.length,w,S,I,R;for(R=0;R0&&(m.status="Intersection"),m},l.Intersection.intersectPolygonPolygon=function(c,h){var p=new u,m=c.length,v;for(v=0;v0&&(p.status="Intersection"),p},l.Intersection.intersectPolygonRectangle=function(c,h,p){var m=h.min(p),v=h.max(p),w=new l.Point(v.x,m.y),S=new l.Point(m.x,v.y),I=u.intersectLinePolygon(m,w,c),R=u.intersectLinePolygon(w,v,c),L=u.intersectLinePolygon(v,S,c),k=u.intersectLinePolygon(S,m,c),B=new u;return B.appendPoints(I.points),B.appendPoints(R.points),B.appendPoints(L.points),B.appendPoints(k.points),B.points.length>0&&(B.status="Intersection"),B}}(i),function(a){var l=a.fabric||(a.fabric={});if(l.Color){l.warn("fabric.Color is already defined.");return}function u(h){h?this._tryParsingColor(h):this.setSource([0,0,0,1])}l.Color=u,l.Color.prototype={_tryParsingColor:function(h){var p;h in u.colorNameMap&&(h=u.colorNameMap[h]),h==="transparent"&&(p=[255,255,255,0]),p||(p=u.sourceFromHex(h)),p||(p=u.sourceFromRgb(h)),p||(p=u.sourceFromHsl(h)),p||(p=[0,0,0,1]),p&&this.setSource(p)},_rgbToHsl:function(h,p,m){h/=255,p/=255,m/=255;var v,w,S,I=l.util.array.max([h,p,m]),R=l.util.array.min([h,p,m]);if(S=(I+R)/2,I===R)v=w=0;else{var L=I-R;switch(w=S>.5?L/(2-I-R):L/(I+R),I){case h:v=(p-m)/L+(p1&&(m-=1),m<1/6?h+(p-h)*6*m:m<1/2?p:m<2/3?h+(p-h)*(2/3-m)*6:h}l.Color.fromRgb=function(h){return u.fromSource(u.sourceFromRgb(h))},l.Color.sourceFromRgb=function(h){var p=h.match(u.reRGBa);if(p){var m=parseInt(p[1],10)/(/%$/.test(p[1])?100:1)*(/%$/.test(p[1])?255:1),v=parseInt(p[2],10)/(/%$/.test(p[2])?100:1)*(/%$/.test(p[2])?255:1),w=parseInt(p[3],10)/(/%$/.test(p[3])?100:1)*(/%$/.test(p[3])?255:1);return[parseInt(m,10),parseInt(v,10),parseInt(w,10),p[4]?parseFloat(p[4]):1]}},l.Color.fromRgba=u.fromRgb,l.Color.fromHsl=function(h){return u.fromSource(u.sourceFromHsl(h))},l.Color.sourceFromHsl=function(h){var p=h.match(u.reHSLa);if(p){var m=(parseFloat(p[1])%360+360)%360/360,v=parseFloat(p[2])/(/%$/.test(p[2])?100:1),w=parseFloat(p[3])/(/%$/.test(p[3])?100:1),S,I,R;if(v===0)S=I=R=w;else{var L=w<=.5?w*(v+1):w+v-w*v,k=w*2-L;S=c(k,L,m+1/3),I=c(k,L,m),R=c(k,L,m-1/3)}return[Math.round(S*255),Math.round(I*255),Math.round(R*255),p[4]?parseFloat(p[4]):1]}},l.Color.fromHsla=u.fromHsl,l.Color.fromHex=function(h){return u.fromSource(u.sourceFromHex(h))},l.Color.sourceFromHex=function(h){if(h.match(u.reHex)){var p=h.slice(h.indexOf("#")+1),m=p.length===3||p.length===4,v=p.length===8||p.length===4,w=m?p.charAt(0)+p.charAt(0):p.substring(0,2),S=m?p.charAt(1)+p.charAt(1):p.substring(2,4),I=m?p.charAt(2)+p.charAt(2):p.substring(4,6),R=v?m?p.charAt(3)+p.charAt(3):p.substring(6,8):"FF";return[parseInt(w,16),parseInt(S,16),parseInt(I,16),parseFloat((parseInt(R,16)/255).toFixed(2))]}},l.Color.fromSource=function(h){var p=new u;return p.setSource(h),p}}(i),function(a){var l=a.fabric||(a.fabric={}),u=["e","se","s","sw","w","nw","n","ne","e"],c=["ns","nesw","ew","nwse"],h={},p="left",m="top",v="right",w="bottom",S="center",I={top:w,bottom:m,left:v,right:p,center:S},R=l.util.radiansToDegrees,L=Math.sign||function(it){return(it>0)-(it<0)||+it};function k(it,Ue){var ct=it.angle+R(Math.atan2(Ue.y,Ue.x))+360;return Math.round(ct%360/45)}function B(it,Ue){var ct=Ue.transform.target,st=ct.canvas,Ze=l.util.object.clone(Ue);Ze.target=ct,st&&st.fire("object:"+it,Ze),ct.fire(it,Ue)}function $(it,Ue){var ct=Ue.canvas,st=ct.uniScaleKey,Ze=it[st];return ct.uniformScaling&&!Ze||!ct.uniformScaling&&Ze}function V(it){return it.originX===S&&it.originY===S}function Y(it,Ue,ct){var st=it.lockScalingX,Ze=it.lockScalingY;return!!(st&&Ze||!Ue&&(st||Ze)&&ct||st&&Ue==="x"||Ze&&Ue==="y")}function K(it,Ue,ct){var st="not-allowed",Ze=$(it,ct),ye="";if(Ue.x!==0&&Ue.y===0?ye="x":Ue.x===0&&Ue.y!==0&&(ye="y"),Y(ct,ye,Ze))return st;var Ke=k(ct,Ue);return u[Ke]+"-resize"}function Q(it,Ue,ct){var st="not-allowed";if(Ue.x!==0&&ct.lockSkewingY||Ue.y!==0&&ct.lockSkewingX)return st;var Ze=k(ct,Ue)%4;return c[Ze]+"-resize"}function re(it,Ue,ct){return it[ct.canvas.altActionKey]?h.skewCursorStyleHandler(it,Ue,ct):h.scaleCursorStyleHandler(it,Ue,ct)}function ne(it,Ue,ct){var st=it[ct.canvas.altActionKey];if(Ue.x===0)return st?"skewX":"scaleY";if(Ue.y===0)return st?"skewY":"scaleX"}function de(it,Ue,ct){return ct.lockRotation?"not-allowed":Ue.cursorStyle}function pe(it,Ue,ct,st){return{e:it,transform:Ue,pointer:{x:ct,y:st}}}function H(it){return function(Ue,ct,st,Ze){var ye=ct.target,Ke=ye.getCenterPoint(),ke=ye.translateToOriginPoint(Ke,ct.originX,ct.originY),me=it(Ue,ct,st,Ze);return ye.setPositionByOrigin(ke,ct.originX,ct.originY),me}}function Z(it,Ue){return function(ct,st,Ze,ye){var Ke=Ue(ct,st,Ze,ye);return Ke&&B(it,pe(ct,st,Ze,ye)),Ke}}function ae(it,Ue,ct,st,Ze){var ye=it.target,Ke=ye.controls[it.corner],ke=ye.canvas.getZoom(),me=ye.padding/ke,ie=ye.toLocalPoint(new l.Point(st,Ze),Ue,ct);return ie.x>=me&&(ie.x-=me),ie.x<=-me&&(ie.x+=me),ie.y>=me&&(ie.y-=me),ie.y<=me&&(ie.y+=me),ie.x-=Ke.offsetX,ie.y-=Ke.offsetY,ie}function fe(it){return it.flipX!==it.flipY}function be(it,Ue,ct,st,Ze){if(it[Ue]!==0){var ye=it._getTransformedDimensions()[st],Ke=Ze/ye*it[ct];it.set(ct,Ke)}}function _e(it,Ue,ct,st){var Ze=Ue.target,ye=Ze._getTransformedDimensions(0,Ze.skewY),Ke=ae(Ue,Ue.originX,Ue.originY,ct,st),ke=Math.abs(Ke.x*2)-ye.x,me=Ze.skewX,ie;ke<2?ie=0:(ie=R(Math.atan2(ke/Ze.scaleX,ye.y/Ze.scaleY)),Ue.originX===p&&Ue.originY===w&&(ie=-ie),Ue.originX===v&&Ue.originY===m&&(ie=-ie),fe(Ze)&&(ie=-ie));var ge=me!==ie;if(ge){var je=Ze._getTransformedDimensions().y;Ze.set("skewX",ie),be(Ze,"skewY","scaleY","y",je)}return ge}function Ie(it,Ue,ct,st){var Ze=Ue.target,ye=Ze._getTransformedDimensions(Ze.skewX,0),Ke=ae(Ue,Ue.originX,Ue.originY,ct,st),ke=Math.abs(Ke.y*2)-ye.y,me=Ze.skewY,ie;ke<2?ie=0:(ie=R(Math.atan2(ke/Ze.scaleY,ye.x/Ze.scaleX)),Ue.originX===p&&Ue.originY===w&&(ie=-ie),Ue.originX===v&&Ue.originY===m&&(ie=-ie),fe(Ze)&&(ie=-ie));var ge=me!==ie;if(ge){var je=Ze._getTransformedDimensions().x;Ze.set("skewY",ie),be(Ze,"skewX","scaleX","x",je)}return ge}function Te(it,Ue,ct,st){var Ze=Ue.target,ye=Ze.skewX,Ke,ke=Ue.originY;if(Ze.lockSkewingX)return!1;if(ye===0){var me=ae(Ue,S,S,ct,st);me.x>0?Ke=p:Ke=v}else ye>0&&(Ke=ke===m?p:v),ye<0&&(Ke=ke===m?v:p),fe(Ze)&&(Ke=Ke===p?v:p);Ue.originX=Ke;var ie=Z("skewing",H(_e));return ie(it,Ue,ct,st)}function Be(it,Ue,ct,st){var Ze=Ue.target,ye=Ze.skewY,Ke,ke=Ue.originX;if(Ze.lockSkewingY)return!1;if(ye===0){var me=ae(Ue,S,S,ct,st);me.y>0?Ke=m:Ke=w}else ye>0&&(Ke=ke===p?m:w),ye<0&&(Ke=ke===p?w:m),fe(Ze)&&(Ke=Ke===m?w:m);Ue.originY=Ke;var ie=Z("skewing",H(Ie));return ie(it,Ue,ct,st)}function Ve(it,Ue,ct,st){var Ze=Ue,ye=Ze.target,Ke=ye.translateToOriginPoint(ye.getCenterPoint(),Ze.originX,Ze.originY);if(ye.lockRotation)return!1;var ke=Math.atan2(Ze.ey-Ke.y,Ze.ex-Ke.x),me=Math.atan2(st-Ke.y,ct-Ke.x),ie=R(me-ke+Ze.theta),ge=!0;if(ye.snapAngle>0){var je=ye.snapAngle,rt=ye.snapThreshold||je,Me=Math.ceil(ie/je)*je,ht=Math.floor(ie/je)*je;Math.abs(ie-ht)L?(K=R,m.scale(1,L/R),Y=w*R/L):L>R?(K=L,m.scale(R/L,1),V=v*L/R):K=R,m.lineWidth=1,m.beginPath(),m.arc(V,Y,K/2,0,2*Math.PI,!1),m[B](),$&&m.stroke(),m.restore()}function p(m,v,w,S,I){S=S||{};var R=this.sizeX||S.cornerSize||I.cornerSize,L=this.sizeY||S.cornerSize||I.cornerSize,k=typeof S.transparentCorners<"u"?S.transparentCorners:I.transparentCorners,B=k?"stroke":"fill",$=!k&&(S.cornerStrokeColor||I.cornerStrokeColor),V=R/2,Y=L/2;m.save(),m.fillStyle=S.cornerColor||I.cornerColor,m.strokeStyle=S.cornerStrokeColor||I.cornerStrokeColor,m.lineWidth=1,m.translate(v,w),m.rotate(u(I.angle)),m[B+"Rect"](-V,-Y,R,L),$&&m.strokeRect(-V,-Y,R,L),m.restore()}c.renderCircleControl=h,c.renderSquareControl=p}(i),function(a){var l=a.fabric||(a.fabric={});function u(c){for(var h in c)this[h]=c[h]}l.Control=u,l.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(c,h){return h.cursorStyle},getActionName:function(c,h){return h.actionName},getVisibility:function(c,h){var p=c._controlsVisibility;return p&&typeof p[h]<"u"?p[h]:this.visible},setVisibility:function(c){this.visible=c},positionHandler:function(c,h){var p=l.util.transformPoint({x:this.x*c.x+this.offsetX,y:this.y*c.y+this.offsetY},h);return p},calcCornerCoords:function(c,h,p,m,v){var w,S,I,R,L=v?this.touchSizeX:this.sizeX,k=v?this.touchSizeY:this.sizeY;if(L&&k&&L!==k){var B=Math.atan2(k,L),$=Math.sqrt(L*L+k*k)/2,V=B-l.util.degreesToRadians(c),Y=Math.PI/2-B-l.util.degreesToRadians(c);w=$*l.util.cos(V),S=$*l.util.sin(V),I=$*l.util.cos(Y),R=$*l.util.sin(Y)}else{var K=L&&k?L:h;$=K*.7071067812;var V=l.util.degreesToRadians(45-c);w=I=$*l.util.cos(V),S=R=$*l.util.sin(V)}return{tl:{x:p-R,y:m-I},tr:{x:p+w,y:m-S},bl:{x:p-w,y:m+S},br:{x:p+R,y:m+I}}},render:function(c,h,p,m,v){switch(m=m||{},m.cornerStyle||v.cornerStyle){case"circle":l.controlsUtils.renderCircleControl.call(this,c,h,p,m,v);break;default:l.controlsUtils.renderSquareControl.call(this,c,h,p,m,v)}}}}(i),function(){function a(p,m){var v=p.getAttribute("style"),w=p.getAttribute("offset")||0,S,I,R,L;if(w=parseFloat(w)/(/%$/.test(w)?100:1),w=w<0?0:w>1?1:w,v){var k=v.split(/\s*;\s*/);for(k[k.length-1]===""&&k.pop(),L=k.length;L--;){var B=k[L].split(/\s*:\s*/),$=B[0].trim(),V=B[1].trim();$==="stop-color"?S=V:$==="stop-opacity"&&(R=V)}}return S||(S=p.getAttribute("stop-color")||"rgb(0,0,0)"),R||(R=p.getAttribute("stop-opacity")),S=new e.Color(S),I=S.getAlpha(),R=isNaN(parseFloat(R))?1:parseFloat(R),R*=I*m,{offset:w,color:S.toRgb(),opacity:R}}function l(p){return{x1:p.getAttribute("x1")||0,y1:p.getAttribute("y1")||0,x2:p.getAttribute("x2")||"100%",y2:p.getAttribute("y2")||0}}function u(p){return{x1:p.getAttribute("fx")||p.getAttribute("cx")||"50%",y1:p.getAttribute("fy")||p.getAttribute("cy")||"50%",r1:0,x2:p.getAttribute("cx")||"50%",y2:p.getAttribute("cy")||"50%",r2:p.getAttribute("r")||"50%"}}var c=e.util.object.clone;e.Gradient=e.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(p){p||(p={}),p.coords||(p.coords={});var m,v=this;Object.keys(p).forEach(function(w){v[w]=p[w]}),this.id?this.id+="_"+e.Object.__uid++:this.id=e.Object.__uid++,m={x1:p.coords.x1||0,y1:p.coords.y1||0,x2:p.coords.x2||0,y2:p.coords.y2||0},this.type==="radial"&&(m.r1=p.coords.r1||0,m.r2=p.coords.r2||0),this.coords=m,this.colorStops=p.colorStops.slice()},addColorStop:function(p){for(var m in p){var v=new e.Color(p[m]);this.colorStops.push({offset:parseFloat(m),color:v.toRgb(),opacity:v.getAlpha()})}return this},toObject:function(p){var m={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return e.util.populateWithProperties(this,m,p),m},toSVG:function(p,I){var v=c(this.coords,!0),w,S,I=I||{},R,L,k=c(this.colorStops,!0),B=v.r1>v.r2,$=this.gradientTransform?this.gradientTransform.concat():e.iMatrix.concat(),V=-this.offsetX,Y=-this.offsetY,K=!!I.additionalTransform,Q=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(k.sort(function(H,Z){return H.offset-Z.offset}),Q==="objectBoundingBox"?(V/=p.width,Y/=p.height):(V+=p.width/2,Y+=p.height/2),p.type==="path"&&this.gradientUnits!=="percentage"&&(V-=p.pathOffset.x,Y-=p.pathOffset.y),$[4]-=V,$[5]-=Y,L='id="SVGID_'+this.id+'" gradientUnits="'+Q+'"',L+=' gradientTransform="'+(K?I.additionalTransform+" ":"")+e.util.matrixToSVG($)+'" ',this.type==="linear"?R=[" `]:this.type==="radial"&&(R=[" @@ -5539,8 +5539,8 @@ gl_FragColor.rgb *= color.a; `?(m++,p[m]=0):p[m]++;p[0]>0&&(this.insertCharStyleObject(h.lineIndex,h.charIndex,p[0],c),c=c&&c.slice(p[0]+1)),m&&this.insertNewlineStyleObject(h.lineIndex,h.charIndex+p[0],m);for(var v=1;v0?this.insertCharStyleObject(h.lineIndex+v,0,p[v],c):c&&this.styles[h.lineIndex+v]&&c[0]&&(this.styles[h.lineIndex+v][0]=c[0]),c=c&&c.slice(p[v]+1);p[v]>0&&this.insertCharStyleObject(h.lineIndex+v,0,p[v],c)},setSelectionStartEndWithShift:function(l,u,c){c<=l?(u===l?this._selectionDirection="left":this._selectionDirection==="right"&&(this._selectionDirection="left",this.selectionEnd=l),this.selectionStart=c):c>l&&cl?this.selectionStart=l:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>l?this.selectionEnd=l:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),e.util.object.extend(e.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(a){if(this.canvas){this.__newClickTime=+new Date;var l=a.pointer;this.isTripleClick(l)&&(this.fire("tripleclick",a),this._stopEvent(a.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=l,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(a){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===a.x&&this.__lastPointer.y===a.y},_stopEvent:function(a){a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(a){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(a.e))},tripleClickHandler:function(a){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(a.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(a){!this.canvas||!this.editable||a.e.button&&a.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(a.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(a){!this.canvas||!this.editable||a.e.button&&a.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(a){if(this.__isMousedown=!1,!(!this.editable||this.group||a.transform&&a.transform.actionPerformed||a.e.button&&a.e.button!==1)){if(this.canvas){var l=this.canvas._activeObject;if(l&&l!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(a.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(a){var l=this.getSelectionStartFromPointer(a),u=this.selectionStart,c=this.selectionEnd;a.shiftKey?this.setSelectionStartEndWithShift(u,c,l):(this.selectionStart=l,this.selectionEnd=l),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(a){for(var l=this.getLocalPointer(a),u=0,c=0,h=0,p=0,m=0,v,w,S=0,I=this._textLines.length;S0&&(p+=this._textLines[S-1].length+this.missingNewlineOffset(S-1));v=this._getLineLeftOffset(m),c=v*this.scaleX,w=this._textLines[m],this.direction==="rtl"&&(l.x=this.width*this.scaleX-l.x+c);for(var R=0,L=w.length;Rp||m<0?0:1,w=c+v;return this.flipX&&(w=h-w),w>this._text.length&&(w=this._text.length),w}}),e.util.object.extend(e.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=e.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var a=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+a.top+"; left: "+a.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+a.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):e.document.body.appendChild(this.hiddenTextarea),e.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),e.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),e.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),e.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),e.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),e.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),e.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),e.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),e.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(e.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(a){if(this.isEditing){var l=this.direction==="rtl"?this.keysMapRtl:this.keysMap;if(a.keyCode in l)this[l[a.keyCode]](a);else if(a.keyCode in this.ctrlKeysMapDown&&(a.ctrlKey||a.metaKey))this[this.ctrlKeysMapDown[a.keyCode]](a);else return;a.stopImmediatePropagation(),a.preventDefault(),a.keyCode>=33&&a.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(a){if(!this.isEditing||this._copyDone||this.inCompositionMode){this._copyDone=!1;return}if(a.keyCode in this.ctrlKeysMapUp&&(a.ctrlKey||a.metaKey))this[this.ctrlKeysMapUp[a.keyCode]](a);else return;a.stopImmediatePropagation(),a.preventDefault(),this.canvas&&this.canvas.requestRenderAll()},onInput:function(a){var l=this.fromPaste;if(this.fromPaste=!1,a&&a.stopPropagation(),!!this.isEditing){var u=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,h=u.length,p,m,v=h-c,w=this.selectionStart,S=this.selectionEnd,I=w!==S,R,L,k;if(this.hiddenTextarea.value===""){this.styles={},this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll());return}var B=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),$=w>B.selectionStart;I?(p=this._text.slice(w,S),v+=S-w):h0&&(c=this.__charBounds[a][l-1],u+=c.left+c.width),u},getDownCursorOffset:function(a,l){var u=this._getSelectionForOffset(a,l),c=this.get2DCursorLocation(u),h=c.lineIndex;if(h===this._textLines.length-1||a.metaKey||a.keyCode===34)return this._text.length-u;var p=c.charIndex,m=this._getWidthBeforeCursor(h,p),v=this._getIndexOnLine(h+1,m),w=this._textLines[h].slice(p);return w.length+v+1+this.missingNewlineOffset(h)},_getSelectionForOffset:function(a,l){return a.shiftKey&&this.selectionStart!==this.selectionEnd&&l?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(a,l){var u=this._getSelectionForOffset(a,l),c=this.get2DCursorLocation(u),h=c.lineIndex;if(h===0||a.metaKey||a.keyCode===33)return-u;var p=c.charIndex,m=this._getWidthBeforeCursor(h,p),v=this._getIndexOnLine(h-1,m),w=this._textLines[h].slice(0,p),S=this.missingNewlineOffset(h-1);return-this._textLines[h-1].length+v-w.length+(1-S)},_getIndexOnLine:function(a,l){for(var u=this._textLines[a],c=this._getLineLeftOffset(a),h=c,p=0,m,v,w=0,S=u.length;wl){v=!0;var I=h-m,R=h,L=Math.abs(I-l),k=Math.abs(R-l);p=k=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",a)},moveCursorUp:function(a){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown("Up",a)},_moveCursorUpOrDown:function(a,l){var u="get"+a+"CursorOffset",c=this[u](l,this._selectionDirection==="right");l.shiftKey?this.moveCursorWithShift(c):this.moveCursorWithoutShift(c),c!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(a){var l=this._selectionDirection==="left"?this.selectionStart+a:this.selectionEnd+a;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,l),a!==0},moveCursorWithoutShift:function(a){return a<0?(this.selectionStart+=a,this.selectionEnd=this.selectionStart):(this.selectionEnd+=a,this.selectionStart=this.selectionEnd),a!==0},moveCursorLeft:function(a){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight("Left",a)},_move:function(a,l,u){var c;if(a.altKey)c=this["findWordBoundary"+u](this[l]);else if(a.metaKey||a.keyCode===35||a.keyCode===36)c=this["findLineBoundary"+u](this[l]);else return this[l]+=u==="Left"?-1:1,!0;if(typeof c<"u"&&this[l]!==c)return this[l]=c,!0},_moveLeft:function(a,l){return this._move(a,l,"Left")},_moveRight:function(a,l){return this._move(a,l,"Right")},moveCursorLeftWithoutShift:function(a){var l=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(l=this._moveLeft(a,"selectionStart")),this.selectionEnd=this.selectionStart,l},moveCursorLeftWithShift:function(a){if(this._selectionDirection==="right"&&this.selectionStart!==this.selectionEnd)return this._moveLeft(a,"selectionEnd");if(this.selectionStart!==0)return this._selectionDirection="left",this._moveLeft(a,"selectionStart")},moveCursorRight:function(a){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",a)},_moveCursorLeftOrRight:function(a,l){var u="moveCursor"+a+"With";this._currentCursorOpacity=1,l.shiftKey?u+="Shift":u+="outShift",this[u](l)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(a){if(this._selectionDirection==="left"&&this.selectionStart!==this.selectionEnd)return this._moveRight(a,"selectionStart");if(this.selectionEnd!==this._text.length)return this._selectionDirection="right",this._moveRight(a,"selectionEnd")},moveCursorRightWithoutShift:function(a){var l=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(l=this._moveRight(a,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,l},removeChars:function(a,l){typeof l>"u"&&(l=a+1),this.removeStyleFromTo(a,l),this._text.splice(a,l-a),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(a,l,u,c){typeof c>"u"&&(c=u),c>u&&this.removeStyleFromTo(u,c);var h=e.util.string.graphemeSplit(a);this.insertNewStyleBlock(h,u,l),this._text=[].concat(this._text.slice(0,u),h,this._text.slice(c)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var a=e.util.toFixed,l=/ +/g;e.util.object.extend(e.Text.prototype,{_toSVG:function(){var u=this._getSVGLeftTopOffsets(),c=this._getSVGTextAndBg(u.textTop,u.textLeft);return this._wrapSVGTextAndBg(c)},toSVG:function(u){return this._createBaseSVGMarkup(this._toSVG(),{reviver:u,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(u){var c=!0,h=this.getSvgTextDecoration(this);return[u.textBgRects.join(""),' ",u.textSpans.join(""),` `]},_getSVGTextAndBg:function(u,c){var h=[],p=[],m=u,v;this._setSVGBg(p);for(var w=0,S=this._textLines.length;w",e.util.string.escapeXml(u),""].join("")},_setSVGTextLineText:function(u,c,h,p){var m=this.getHeightOfLine(c),v=this.textAlign.indexOf("justify")!==-1,w,S,I="",R,L,k=0,B=this._textLines[c],$;p+=m*(1-this._fontSizeFraction)/this.lineHeight;for(var V=0,Y=B.length-1;V<=Y;V++)$=V===Y||this.charSpacing,I+=B[V],R=this.__charBounds[c][V],k===0?(h+=R.kernedWidth-R.width,k+=R.width):k+=R.kernedWidth,v&&!$&&this._reSpaceAndTab.test(B[V])&&($=!0),$||(w=w||this.getCompleteStyleDeclaration(c,V),S=this.getCompleteStyleDeclaration(c,V+1),$=e.util.hasStyleChanged(w,S,!0)),$&&(L=this._getStyleDeclaration(c,V)||{},u.push(this._createTextCharSpan(I,L,h,p)),I="",w=S,h+=k,k=0)},_pushTextBgRect:function(u,c,h,p,m,v){var w=e.Object.NUM_FRACTION_DIGITS;u.push(" `)},_setSVGTextLineBg:function(u,c,h,p){for(var m=this._textLines[c],v=this.getHeightOfLine(c)/this.lineHeight,w=0,S=0,I,R,L=this.getValueOfPropertyAt(c,0,"textBackgroundColor"),k=0,B=m.length;kthis.width&&this._set("width",this.dynamicMinWidth),this.textAlign.indexOf("justify")!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(u){for(var c=0,h=0,p=0,m={},v=0;v0?(h=0,p++,c++):!this.splitByGrapheme&&this._reSpaceAndTab.test(u.graphemeText[p])&&v>0&&(h++,p++),m[v]={line:c,offset:h},p+=u.graphemeLines[v].length,h+=u.graphemeLines[v].length;return m},styleHas:function(u,c){if(this._styleMap&&!this.isWrapping){var h=this._styleMap[c];h&&(c=h.line)}return l.Text.prototype.styleHas.call(this,u,c)},isEmptyStyles:function(u){if(!this.styles)return!0;var c=0,h=u+1,p,m,v=!1,w=this._styleMap[u],S=this._styleMap[u+1];w&&(u=w.line,c=w.offset),S&&(h=S.line,v=h===u,p=S.offset),m=typeof u>"u"?this.styles:{line:this.styles[u]};for(var I in m)for(var R in m[I])if(R>=c&&(!v||Rh&&!Y?(w.push(S),S=[],m=B,Y=!0):m+=K,!Y&&!v&&S.push(k),S=S.concat(R),$=v?0:this._measureWord([k],c,L),L++,Y=!1,B>V&&(V=B);return re&&w.push(S),V+Q>this.dynamicMinWidth&&(this.dynamicMinWidth=V-K+Q),w},isEndOfWrapping:function(u){return!this._styleMap[u+1]||this._styleMap[u+1].line!==this._styleMap[u].line},missingNewlineOffset:function(u){return this.splitByGrapheme?this.isEndOfWrapping(u)?1:0:1},_splitTextIntoLines:function(u){for(var c=l.Text.prototype._splitTextIntoLines.call(this,u),h=this._wrapText(c.lines,this.width),p=new Array(h.length),m=0;m!u.isCosmetic);if(t.length===0)return new fh.fabric.Group([],{originX:"left"});const r=Math.min(t.length,Math.floor(e.width/(XCn+ARe))||1),n=(e.width-(r-1)*ARe)/r;let s=0;const a=(await Promise.all(this._makeSegments(t,n))).map(({title:u,items:c},h)=>{h>0&&(s+=VCn),u.top=s,s+=u.height+HCn;const p=c.map(({title:m,items:v},w)=>{const S=[];return m&&!(c.length===1&&m.text===u.text)&&(w>0&&(s+=WCn),m.top=s,s+=m.height+qCn,S.push(m)),v.forEach(I=>{I.top=s,s+=I.height+YCn}),[...S,...v].filter(I=>I)});return new fh.fabric.Group([u,...p.flat()])}).flat(),l=this._makeColumns(a,n,r);return Promise.resolve(l)}_makeColumns(e,t,r){let n=0,s=0,o=0;const a=e[e.length-1].aCoords.bl.y/r;return e.forEach((l,u)=>{const c=u!==e.length-1?e[u+1].top-l.top:l.height,h=o>a*(n+1),p=s!==0&&c>a,m=r-n>e.length-u;(h||p||m)&&n{const n=new fh.fabric.Textbox(r.name,{fontSize:24,fontFamily:VK,width:t}),s=this._getLayerTreeIds(r);let o=[];return o=r.supportsSublayers?await Promise.all(this._makeSegmentChunks(s,r,t)):await Promise.all(this._makeSegmentChunks([-1],r,t)),{title:n,items:o}})}_makeSegmentChunks(e,t,r){const n=t;return e.map(async s=>{const o=s===-1?n:n.getSublayer(s);if(!o)return{title:new fh.fabric.Textbox("ERROR",{fontSize:20,fontFamily:VK,width:r}),items:[]};await Promise.all(o.legend.map(c=>c.drawPromise));const a=o.legend,l=new fh.fabric.Textbox(o.name,{fontSize:20,fontFamily:VK,width:r}),u=await Promise.all(this._makeChunkItems(a,r));return{title:l,items:u}})}_makeChunkItems(e,t){return e.map(async r=>{const n=(await KCn(fh.fabric.loadSVGFromString)(r.svgcode))[0];if(r.esriStandard){n.originY="center",n.top=sG/2;const s=new fh.fabric.Textbox(r.label,{fontSize:12,fontFamily:VK,originY:"center",left:c_t+20,top:sG/2,width:t-c_t-20});return new fh.fabric.Group([n,s],{height:sG})}else{const s=new fh.fabric.Textbox(r.label,{fontSize:12,fontFamily:VK,originY:"center",left:0,top:sG/2,width:t}),o=Number(r.imgWidth),a=Number(r.imgHeight),l=Math.min(1,t/o);return n&&(n.originY="center",n.top=a*l/2+sG,n.scaleToHeight(a*l),n.scaleToWidth(o*l)),new fh.fabric.Group([s,n].filter(Boolean),{height:a*l+sG})}})}_getLayerTreeIds(e){const t=[],r=[...e.sublayers];for(;r.length>0;){const n=r.shift();n&&(n.visibility&&t.push(n.layerIdx),r.push(...n.sublayers))}return t}}const KCn=i=>e=>new Promise(t=>{i(e,r=>{t(r)})}),ZCn=Object.freeze(Object.defineProperty({__proto__:null,default:JCn},Symbol.toStringTag,{value:"Module"}));class QCn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.map}async make(e){const t=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),r=new Image;r.src=t.dataUrl;const n=await new Promise(s=>r.onload=()=>s(r));return new fh.fabric.Image(n,e)}}const eEn=Object.freeze(Object.defineProperty({__proto__:null,default:QCn},Symbol.toStringTag,{value:"Module"}));class tEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(e){let t=h=>0,r=0;const n='N',s=document.querySelector(".inner-shell"),o=this.$iApi.geo.map.getSR();let a=0;if(o.isWebMercator())a=0;else{const p=new s0("pole",{x:-96,y:90}),m=await this.$iApi.geo.proj.projectGeometry(o,p),v=this.$iApi.geo.map.mapPointToScreenPoint(m),w={screenX:s.clientWidth/2,screenY:s.clientHeight};a=Math.atan((v.screenX-w.screenX)/(w.screenY-v.screenY))*180/Math.PI;const S=s.clientWidth/2+s.clientHeight*Math.tan(a*Math.PI/180)-50/2,I=Math.round(S/s.clientWidth*100);r=Math.min(Math.max(I,0),100),t=R=>{if(R<0||R>100)throw new Error("Normalized position must be between 0 and 100");const L=s.clientWidth*R/100;return Math.atan((v.screenX-L)/(50/2-v.screenY))*(180/Math.PI)}}const l={top:0,left:0,originX:"center",originY:"center",angle:a},u=[];let c=new fh.fabric.Group;return fh.fabric.loadSVGFromString(n,()=>{c=new fh.fabric.Group(u),c.positionX=r,c.getAngleFromPosition=t},(h,p)=>{u.push(p)}),c.set(HY(l,e||{})),Promise.resolve(c)}}const iEn=Object.freeze(Object.defineProperty({__proto__:null,default:tEn},Symbol.toStringTag,{value:"Module"}));class rEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(e){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let n=0;n<2;n++){const s=new fh.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[n].distance,"number")}${t[n].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:n*50,left:0,originX:"left",originY:"top"}),o=new fh.fabric.Line([0,n===0?30:40,t[n].pixels,n===0?30:40],{stroke:"black",strokeWidth:3});r.push(new fh.fabric.Group([o,s]))}return Promise.resolve(new fh.fabric.Group(r,e))}}const nEn=Object.freeze(Object.defineProperty({__proto__:null,default:rEn},Symbol.toStringTag,{value:"Module"}));class sEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(e){const t=this.config,r={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(r.text=t.value);const n=HY(r,e||{}),s=new fh.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const oEn=Object.freeze(Object.defineProperty({__proto__:null,default:sEn},Symbol.toStringTag,{value:"Module"}));class aEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.title}make(e){const t=this.config,r={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(r.text=t.value);const n=HY(r,e||{}),s=new fh.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const lEn=Object.freeze(Object.defineProperty({__proto__:null,default:aEn},Symbol.toStringTag,{value:"Module"}));var kJt={exports:{}};(function(i,e){(function(t,r){r()})(Hh,function(){function t(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,h){var p=new XMLHttpRequest;p.open("GET",u),p.responseType="blob",p.onload=function(){l(p.response,c,h)},p.onerror=function(){console.error("could not download file")},p.send()}function n(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function s(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Hh=="object"&&Hh.global===Hh?Hh:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(u,c,h){var p=o.URL||o.webkitURL,m=document.createElement("a");c=c||u.name||"download",m.download=c,m.rel="noopener",typeof u=="string"?(m.href=u,m.origin===location.origin?s(m):n(m.href)?r(u,c,h):s(m,m.target="_blank")):(m.href=p.createObjectURL(u),setTimeout(function(){p.revokeObjectURL(m.href)},4e4),setTimeout(function(){s(m)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,h){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(t(u,h),c);else if(n(u))r(u,c,h);else{var p=document.createElement("a");p.href=u,p.target="_blank",setTimeout(function(){s(p)})}}:function(u,c,h,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,h);var m=u.type==="application/octet-stream",v=/constructor/i.test(o.HTMLElement)||o.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||m&&v||a)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var L=S.result;L=w?L:L.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=L:location=L,p=null},S.readAsDataURL(u)}else{var I=o.URL||o.webkitURL,R=I.createObjectURL(u);p?p.location=R:location.href=R,p=null,setTimeout(function(){I.revokeObjectURL(R)},4e4)}});o.saveAs=l.saveAs=l,i.exports=l})})(kJt);var uEn=kJt.exports;const cEn=X3(uEn);fh.fabric.Object.prototype.objectCaching=!1;const HK=1200,hw={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class hEn extends Yu{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(e){this.customRendererFunc=e}get config(){return super.config}_parseConfig(e){if(!e)return;const t=pq(this.$vApp.$pinia);t.componentSelectedState={title:e.title?.selected??!0,map:e.map?.selected??!0,mapElements:e.mapElements?.selected??!0,legend:e.legend?.selected??!0,footnote:e.footnote?.selected??!0,timestamp:e.timestamp?.selected??!0},t.fileName=e.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(e){return this.$iApi.fixture.get(e)}async make(e,t){const r=pq(this.$vApp.$pinia),n={};this.fcFabric=new fh.fabric.StaticCanvas(e,{backgroundColor:"#fff"}),this.fcFabricDownload=new fh.fabric.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const s=r.componentSelectedState,o=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),l=this.getSubFixture("export-scalebar"),u=this.getSubFixture("export-northarrow"),c=this.getSubFixture("export-legend"),h=this.getSubFixture("export-footnote"),p=this.getSubFixture("export-timestamp");let m,v,w,S,I,R,L;if(s.title&&o&&(m=await o.make({top:this.options.runningHeight,left:0,originX:"left",width:t,textAlign:"center"}),this.options.runningHeight+=m.height+40,n.title=m),s.map&&a&&(v=await a.make({top:this.options.runningHeight}),m&&(m.left=v.width/2,m.originX="center"),this.options.runningHeight+=v.height+40,n.map=v),!v&&m&&(m.width=HK),this.options.scale=t/((v?.width??HK)+hw.LEFT+hw.RIGHT),s.mapElements&&l&&(w=await l.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=w.height+40,n.scaleBar=w,u&&(S=await u.make({top:w.top,left:t/this.options.scale}),S.top+=S.height/2-20,S.left+=-S.width*2,n.northArrow=S)),s.legend&&c&&(I=await c.make({width:c.config?.columnWidth??v?.width??HK}),I.top=this.options.runningHeight,this.options.runningHeight+=I.height,n.legend=I),s.timestamp&&p&&(L=await p.make({top:this.options.runningHeight+40,width:t}),this.options.runningHeight+=!s.footnote||!h?L.height+40:L.height+20,n.timestamp=L),s.footnote&&h&&(R=await h.make({top:this.options.runningHeight-2.5,left:t/this.options.scale+40}),s.timestamp&&p?t-n.timestamp.getMinWidth()<=R.getMinWidth()+30?(R.top+=30,R.left=0,R.originX="left",this.options.runningHeight+=20):R.left+=-R.width*2:(R.top+=20,R.left+=-R.width*2,this.options.runningHeight+=20),this.options.runningHeight+=R.height,n.footnote=R),this.customRendererFunc){this.fcFabric.setWidth(t);const k={panelWidth:t,margin:hw,defaultWidth:HK,fabric:fh.fabric};await this.customRendererFunc(this.fcFabric,n,k),this.fcFabric.renderAll(),this.fcFabric.clone(B=>{this.fcFabricDownload=B,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const k=new fh.fabric.Group(Object.values(n),{top:hw.TOP*this.options.scale,left:hw.LEFT*this.options.scale}),B=await new Promise($=>{k.clone(V=>{$(V)})});B.top=hw.TOP,B.left=hw.LEFT,this.fcFabricDownload.add(B),k.scale(this.options.scale),this.fcFabric.add(k),this.fcFabric.setDimensions({width:t,height:(this.options.runningHeight+hw.TOP+hw.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(v?.width??HK)+hw.LEFT+hw.RIGHT,height:this.options.runningHeight+hw.TOP+hw.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const e=new Date,t=this.config?.fileName||`map-carte - ${e.getFullYear()}-${e.getMonth()}-${e.getDay()}, ${e.getHours()}_${e.getMinutes()}`;cEn.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${t}.png`)}}const dEn=Ot("div",{class:"flex items-center text-gray-400 w-full h-full hover:text-black p-4 sm:p-8"},[Ot("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("g",null,[Ot("path",{d:"M0,0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"})])])],-1),pEn=["onClick","aria-label"],fEn={class:"md-icon-small inline"},mEn=Ot("g",null,[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1),gEn=[mEn],yEn=Xr({__name:"settings-button",props:{componentSelectedState:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=w0(),r=pq(),n=Hr(()=>t.mobileView?"top-end":"left-end"),s=o=>{o.selectable&&r.toggleSelected({name:o.name})};return(o,a)=>{const l=Ko("dropdown-menu"),u=Nn("focus-item");return Ur((qt(),Dn(l,{position:n.value,tooltip:ri(e)("export.menu"),"tooltip-placement":"top"},{header:Rn(()=>[dEn]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(i.componentSelectedState,c=>(qt(),si("a",{key:c.name,onClick:h=>s(c),href:"javascript:;",class:Wn(`text-left text-sm sm:text-base ${c.selectable?"cursor-pointer":"cursor-default"}`),"aria-label":c.name},[Ot("div",fEn,[(qt(),si("svg",{height:"20",width:"20",viewBox:"0 0 24 24",class:Wn(`inline mx-8 ${c.selected?"":"invisible"}`)},gEn,2)),Ot("span",{class:Wn(`inline ${c.selectable?"":"text-gray-300"} - `)},br(ri(e)(`export.menu.component.${c.name}`)),3)])],10,pEn))),128))]),_:1},8,["position","tooltip"])),[[u]])}}}),vEn=Ot("div",{class:"overflow-hidden border border-gray-200"},[Ot("canvas",{class:"export-canvas !w-[100%]"})],-1),_En={class:"flex"},bEn=["aria-label"],wEn=["aria-label"],LJt=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=pq(),n=vi(),s=vi(void 0),o=vi([]),a=Hr(()=>Df()?.proxy?.$el),l=Hr(()=>r.componentSelectedState),u=Hr(()=>{let p={};return n.value&&Object.keys(l.value).forEach(m=>{p[m]={name:m,selected:l.value[m]??!1,selectable:(n.value?.config)[m]?.selectable??!0}}),p}),c=Hr(()=>!!n.value?.customRendererFunc),h=xE(300,()=>{if(!n.value)return;const p=a.value.querySelector(".export-canvas");n.value.make(p,a.value.clientWidth)});return E0(()=>{o.value.push(rl(u,()=>{h()}))}),Fa(()=>{n.value=t.fixture.get("export"),s.value=new ResizeObserver(()=>{h()}),s.value.observe(a.value)}),Ka(()=>{s.value.disconnect(),o.value.forEach(p=>p())}),(p,m)=>{const v=Ko("panel-screen");return qt(),Dn(v,{panel:i.panel,footer:!0},{header:Rn(()=>[Xs(br(ri(e)("export.title")),1)]),content:Rn(()=>[vEn]),footer:Rn(()=>[Ot("div",_En,[Ot("button",{type:"button",onClick:m[0]||(m[0]=w=>n.value?.export()),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-8 sm:px-16 mr-8 sm:mr-16","aria-label":ri(e)("export.download")},br(ri(e)("export.download")),9,bEn),Ot("button",{type:"button",onClick:m[1]||(m[1]=w=>ri(h)()),class:"py-8 px-4 sm:px-16","aria-label":ri(e)("export.refresh")},br(ri(e)("export.refresh")),9,wEn),c.value?Yr("",!0):(qt(),Dn(yEn,{key:0,componentSelectedState:u.value,class:"ml-auto flex px-4 sm:px-8"},null,8,["componentSelectedState"]))])]),_:1},8,["panel"])}}}),xEn=Object.freeze(Object.defineProperty({__proto__:null,default:LJt},Symbol.toStringTag,{value:"Module"})),SEn={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class TEn extends hEn{initialized(){this.$iApi.fixture.add("export-title"),this.$iApi.fixture.add("export-map"),this.$iApi.fixture.add("export-legend"),this.$iApi.fixture.add("export-northarrow"),this.$iApi.fixture.add("export-scalebar"),this.$iApi.fixture.add("export-timestamp"),this.$iApi.fixture.add("export-footnote")}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":Da(LJt)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:SEn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("export"),pq(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}const CEn=Object.freeze(Object.defineProperty({__proto__:null,default:TEn},Symbol.toStringTag,{value:"Module"}));class EEn extends Yu{_parseConfig(e){if(e){const t=ure(this.$vApp.$pinia);e.alwaysOn&&t.setAlwaysOn(!0);const r=e.extentSetIds;r&&Array.isArray(r)&&r.length>0&&t.setExtentSetIds(r)}}get config(){return super.config}}function h_t(i,e,t,r){const n=i-e,s=e+n/2,o=Math.min(n,t-r);return s>t?{min:t-o,max:t,changed:!0}:sthis.config,t=>this._parseConfig(t));this.removed=()=>{e(),ure(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(ln.MAP_BASEMAPCHANGE,t=>{t.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(ln.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const e=ure(this.$vApp.$pinia);e.alwaysOn||e.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?e.active||(e.setActive(!0),this.extentEH=this.$iApi.event.on(ln.MAP_EXTENTCHANGE,t=>{e.enforcing||this.enforceBoundary(t,!1)})):e.active&&(e.setActive(!1),this.evtOff("extentEH"))}evtOff(e){this[e]&&(this.$iApi.event.off(this[e]),this[e]="")}enforceBoundary(e,t){const r=this.$iApi.geo.map.getExtentSet().maximumExtent,n=h_t(e.xmax,e.xmin,r.xmax,r.xmin),s=h_t(e.ymax,e.ymin,r.ymax,r.ymin);if(s.changed||n.changed){t&&(this.$iApi.geo.map.esriView.extent=r.toESRI());const o=Yh.fromParams("extguard",n.min,s.min,n.max,s.max,e.sr),a=ure(this.$vApp.$pinia);a.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(o,void 0,!0,400,"ease-in-out").then(()=>{a.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}const AEn=Object.freeze(Object.defineProperty({__proto__:null,default:IEn},Symbol.toStringTag,{value:"Module"})),MEn=Xr({__name:"appbar-button",props:{options:{type:Object}},setup(i){const e=eo("iApi"),t=()=>{e.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(r,n)=>{const s=Ko("appbar-button",!0);return qt(),Dn(s,{onClickFunction:t,tooltip:"Gazebo"},{default:Rn(()=>[Ot("span",{style:s_({color:i.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),OEn=Ot("a",{href:"javascript:;"},"Option 1",-1),PEn=Ot("a",{href:"javascript:;"},"Option 2",-1),REn=Ot("a",{href:"javascript:;"},"Option 3",-1),DEn={class:"flex flex-col items-center"},FEn=Ot("br",null,null,-1),kEn=Ot("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1),LEn=Xr({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(i){return(e,t)=>{const r=Ko("panel-screen");return qt(),Dn(r,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 1/Screen A ")]),controls:Rn(()=>[OEn,PEn,REn]),content:Rn(()=>[Ot("div",DEn,[Ot("button",{type:"button",onClick:t[0]||(t[0]=n=>i.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),FEn,kEn])]),_:1},8,["panel"])}}}),NEn={class:"flex flex-col items-center"},$En=Ot("br",null,null,-1),BEn=Ot("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1),jEn=Xr({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(i){return(e,t)=>{const r=Ko("panel-screen");return qt(),Dn(r,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 1/Screen B ")]),content:Rn(()=>[Ot("div",NEn,[Ot("button",{type:"button",onClick:t[0]||(t[0]=n=>i.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),$En,BEn])]),_:1},8,["panel"])}}}),GEn={class:"flex flex-row justify-center items-center mt-16"},UEn={class:"mt-16"},zEn=Xr({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=()=>{e.panel.show("p-2-screen-3"),r.event.emit("gazebo/beholdMyText","I am a cat")};return(s,o)=>{const a=Ko("panel-screen");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 2/Screen B ")]),content:Rn(()=>[Xs(br(ri(t)("gz.hello2"))+" ",1),Ot("div",GEn,[Ot("button",{type:"button",onClick:o[0]||(o[0]=l=>i.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),Ot("button",{type:"button",onClick:o[1]||(o[1]=l=>n()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),Ot("p",UEn,br(i.greeting),1)]),_:1},8,["panel"])}}}),VEn={class:"flex flex-col items-center mt-16"},HEn=Ot("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1),WEn=Ot("p",null,"Locale merging:",-1),qEn=Ot("dt",null,"global locale:",-1),YEn={class:"ml-32 font-bold"},XEn=Ot("dt",null,"fixture locale:",-1),JEn={class:"ml-32 font-bold"},KEn=Ot("dt",null,"common panels locale:",-1),ZEn={class:"ml-32 font-bold"},QEn=Xr({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(i){const{t:e}=Qn({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,r)=>{const n=Ko("panel-screen");return qt(),Dn(n,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 2/Screen C ")]),content:Rn(()=>[Ot("div",VEn,[Ot("button",{type:"button",onClick:r[0]||(r[0]=s=>i.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),HEn,WEn,Ot("dl",null,[qEn,Ot("dd",YEn,br(ri(e)("lang_native")),1),XEn,Ot("dd",JEn,br(ri(e)("gz.hello")),1),KEn,Ot("dd",ZEn,br(ri(e)("who")),1)])])]),_:1},8,["panel"])}}}),d_t={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},eIn="gazebo/beholdMyText";class tIn extends Yu{added(){this.$iApi.event.registerEventName(eIn),this.$iApi.component("gazebo-appbar-button",MEn),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":Da(LEn),"p-1-screen-2":Da(jEn)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:d_t}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(e=>setTimeout(()=>Promise.resolve().then(()=>EJn).then(t=>{e(t)}),2e3)),"p-2-screen-2":Da(zEn),"p-2-screen-3":()=>new Promise(e=>e(Da(QEn)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:d_t}}),this.handlePanelTeleports(["p1","p2"])}}const iIn=Object.freeze(Object.defineProperty({__proto__:null,default:tIn},Symbol.toStringTag,{value:"Module"})),rIn={class:"rv-geosearch-bar relative h-26 mx-8 mb-8"},nIn=["placeholder","value","aria-label"],sIn={class:"absolute inset-y-0 right-8 grid w-10 place-content-center"},oIn=["aria-label","content"],aIn=Xr({__name:"search-bar",setup(i){const{t:e}=Qn(),t=SB(),r=w0(),n=Hr(()=>t.searchVal),s=Hr(()=>['"',"$","!","*","+","?","^","{","}","(",")","|","[","]"].filter(l=>t.searchVal.includes(l)).join("")),o=l=>{t.setSearchTerm(l),t.setSearchRegex(l)},a=xE(500,l=>{o(l)});return(l,u)=>{const c=Nn("tippy");return qt(),si("div",rIn,[Ot("input",{type:"text",class:Wn(["border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",{"border-yellow-500":s.value}]),placeholder:ri(e)("geosearch.searchText"),value:n.value,onInput:u[0]||(u[0]=h=>ri(a)(h.target.value)),onKeyup:u[1]||(u[1]=Ph(h=>{ri(r).mobileView&&h.target.blur()},["enter"])),"aria-label":ri(e)("geosearch.searchText"),onKeypress:u[2]||(u[2]=Ph(ia(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,42,nIn),Ot("span",sIn,[s.value?Ur((qt(),si("button",{key:0,class:"cursor-default","aria-label":ri(e)("geosearch.badChars",{chars:s.value}),content:ri(e)("geosearch.badChars",{chars:s.value})},[Xs(" ⚠ ")],8,oIn)),[[c]]):Yr("",!0)])])}}}),lIn={class:"rv-geosearch-top-filters sm:flex items-center w-full ml-8 mb-14"},uIn={class:"w-fit inline-block sm:w-1/2 h-26 mb-8 sm:mb-0 pr-16 sm:pr-0"},cIn=["value","aria-label"],hIn={value:"",disabled:"",hidden:""},dIn={class:"sm:w-1/2 h-26 sm:mx-16 flex"},pIn=["value","aria-label"],fIn={value:"",disabled:"",hidden:""},mIn=["disabled","content","aria-label"],gIn=Ot("div",{class:"rv-geosearch-icon"},[Ot("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 23 21"},[Ot("path",{d:"M 14.7574,20.8284L 17.6036,17.9822L 14.7574,15.1716L 16.1716,13.7574L 19.0178,16.568L 21.8284,13.7574L 23.2426,15.1716L 20.432,17.9822L 23.2426,20.8284L 21.8284,22.2426L 19.0178,19.3964L 16.1716,22.2426L 14.7574,20.8284 Z M 2,2L 19.9888,2.00001L 20,2.00001L 20,2.01122L 20,3.99999L 19.9207,3.99999L 13,10.9207L 13,22.909L 8.99999,18.909L 8.99999,10.906L 2.09405,3.99999L 2,3.99999L 2,2 Z "})])],-1),yIn=[gIn],vIn=Xr({__name:"top-filters",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=vi([]),s=vi([]),o=vi([]),a=Hr(()=>r.queryParams),l=Hr(()=>t.language),u=m=>r.setProvince(m),c=m=>r.setType(m),h=()=>{u({}),c({})},p=()=>{r.initService(t.language,t.fixture.get("geosearch").config);const m=n.value.find(w=>a.value.province===w.name)?.code,v=s.value.find(w=>a.value.type===w.name)?.code;r.getProvinces.then(w=>{n.value=w,u({province:w.find(S=>S.code===m)?.name,forceReRun:!0})}),r.getTypes.then(w=>{s.value=w,c({type:w.find(S=>S.code===v)?.name,forceReRun:!0})})};return E0(()=>{p(),o.value.push(rl(l,p))}),Ka(()=>{o.value.forEach(m=>m())}),(m,v)=>{const w=Nn("truncate"),S=Nn("tippy");return qt(),si("div",lIn,[Ot("div",uIn,[Ur((qt(),si("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer",value:a.value.province,"aria-label":ri(e)("geosearch.filters.province"),onChange:v[0]||(v[0]=I=>u({province:I.target.value}))},[Ur((qt(),si("option",hIn,[Xs(br(ri(e)("geosearch.filters.province")),1)])),[[w]]),(qt(!0),si(Ks,null,hu(n.value,I=>Ur((qt(),si("option",{key:I.code},[Xs(br(I.name),1)])),[[w]])),128))],40,cIn)),[[w]])]),Ot("div",dIn,[Ur((qt(),si("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer max-w-150",value:a.value.type,"aria-label":ri(e)("geosearch.filters.type"),onChange:v[1]||(v[1]=I=>c({type:I.target.value}))},[Ot("option",fIn,br(ri(e)("geosearch.filters.type")),1),(qt(!0),si(Ks,null,hu(s.value,I=>(qt(),si("option",{key:I.code},br(I.name),1))),128))],40,pIn)),[[w]]),Ur((qt(),si("button",{type:"button",class:"text-gray-500 w-1/8 h-24 pl-8 pr-16 sm:pr-8 hover:text-black disabled:cursor-default disabled:text-gray-400",disabled:!a.value.type&&!a.value.province,onClick:h,content:ri(e)("geosearch.filters.clear"),"aria-label":ri(e)("geosearch.filters.clear")},yIn,8,mIn)),[[S,{placement:"bottom"}]])])])}}}),_In={class:"rv-geosearch-bottom-filters"},bIn={class:"bg-white"},wIn={class:"ml-8 cursor-pointer font-normal"},xIn=["checked"],SIn=Xr({__name:"bottom-filters",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=Hr(()=>r.resultsVisible),s=xE(300,u=>{a(u).then(c=>{o({extent:c,visible:n.value})})}),o=u=>{r.setMapExtent(u)},a=async u=>u.sr.wkid===4326?u:await t.geo.proj.projectGeometry(4326,u),l=u=>{a(t.geo.map.getExtent()).then(c=>{o({extent:c,visible:u})})};return Fa(()=>{t.event.on(ln.MAP_EXTENTCHANGE,s,"geosearch_map_extent")}),Ka(()=>{t.event.off("geosearch_map_extent")}),(u,c)=>(qt(),si("div",_In,[Ot("div",bIn,[Ot("label",wIn,[Ot("input",{type:"checkbox",class:"border-2 mx-8 border-gray-600 cursor-pointer",checked:n.value,onChange:c[0]||(c[0]=h=>l(h.target.checked)),onKeypress:c[1]||(c[1]=Ph(ia(()=>{},["prevent"]),["enter"]))},null,40,xIn),Xs(br(ri(e)("geosearch.visible")),1)])])]))}}),TIn={},CIn={class:"w-full h-6 relative overflow-hidden rounded-full indeterminate mb-14"},EIn={class:"h-full progressbar bg-blue-800 rounded-full top-0","aria-valuemin":"0","aria-valuemax":"100"},IIn={class:"flex items-center h-full"};function AIn(i,e){return qt(),si("div",CIn,[Ot("div",EIn,[Ot("span",IIn,[Em(i.$slots,"default",{},void 0,!0)])])])}const MIn=ml(TIn,[["render",AIn],["__scopeId","data-v-343c5c69"]]),OIn={class:"flex flex-col h-full"},PIn={key:1,class:"text-red-900 text-xs px-8 mb-10"},RIn={key:2,class:"px-8 mb-10 py-8 flex-grow text-wrap border-y border-gray-600 overflow-y-auto"},DIn={class:"relative h-48"},FIn={class:"font-bold text-blue-600"},kIn={key:3,class:"rv-results-list flex-grow mb-5 border-t border-b border-gray-600 overflow-y-auto"},LIn=["onClick"],NIn={class:"rv-result-description px-8"},$In={class:"flex-1 text-left truncate font-bold leading-tight"},BIn=["innerHTML"],jIn={key:0,class:"text-gray-600 text-sm"},GIn={key:1,class:"hidden"},UIn={key:2,class:"text-sm font-normal"},zIn=Ot("br",null,null,-1),NJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=Hr(()=>r.searchVal.replace(/["!*$+?^{}()|[\]\\]/g,"").trim()),s=Hr(()=>r.searchResults),o=Hr(()=>r.loadingResults),a=Hr(()=>r.failedServices),l=c=>{let h=new Zy("zoomies",[[[c.bbox[0],c.bbox[1]],[c.bbox[0],c.bbox[3]],[c.bbox[2],c.bbox[3]],[c.bbox[2],c.bbox[1]],[c.bbox[0],c.bbox[1]]]],xl.latLongSR(),!0);t.geo.map.zoomMapTo(h)},u=(c,h)=>{const p=c.replace(new RegExp(`${r.searchRegex}`,"gi"),m=>''+m+"");return h?p+",":p};return(c,h)=>{const p=Ko("panel-screen"),m=Nn("truncate"),v=Nn("focus-item"),w=Nn("focus-list");return qt(),Dn(p,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("geosearch.title")),1)]),content:Rn(()=>[Ot("div",OIn,[Vn(aIn),Vn(vIn),o.value?(qt(),Dn(MIn,{key:0,class:"flex-none"})):Yr("",!0),a.value.length>0&&!o.value?(qt(),si("div",PIn,br(ri(e)("geosearch.serviceError",{services:a.value.join(", ")})),1)):Yr("",!0),n.value&&s.value.length===0&&!o.value?(qt(),si("div",RIn,[Ot("span",DIn,[Xs(br(ri(e)("geosearch.noResults")),1),Ot("span",FIn,'"'+br(n.value)+'"',1)])])):Yr("",!0),s.value.length>0?Ur((qt(),si("ul",kIn,[(qt(!0),si(Ks,null,hu(s.value,(S,I)=>(qt(),si("li",{class:"relative h-56",key:I},[Ur((qt(),si("button",{type:"button",class:"absolute inset-0 h-full w-full hover:bg-gray-300 default-focus-style",onClick:R=>l(S),style:{"border-bottom":"1px solid lightgray"},"truncate-trigger":""},[Ot("div",NIn,[Ur((qt(),si("div",$In,[Ot("span",{innerHTML:u(S.name,S.location.province)},null,8,BIn),S.location.province?(qt(),si("span",jIn,br(S.location.city?" "+S.location.city+", "+S.location.province.abbr:" "+S.location.province.abbr),1)):Yr("",!0),S.type?(qt(),si("span",GIn,"; ")):Yr("",!0),S.type?(qt(),si("span",UIn,[zIn,Xs(br(S.type),1)])):Yr("",!0)])),[[m,{externalTrigger:!0,options:{placement:"top-start"}}]])])],8,LIn)),[[v,"show-truncate"]])]))),128))])),[[w]]):Yr("",!0),Vn(SIn,{class:"mt-auto"})])]),_:1},8,["panel"])}}}),VIn=Object.freeze(Object.defineProperty({__proto__:null,default:NJt},Symbol.toStringTag,{value:"Module"}));class HIn extends Yu{}const WIn=Ot("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),Ot("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),qIn=Xr({__name:"nav-button",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{t?.panel.toggle("geosearch")};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("geosearch.title")},{default:Rn(()=>[WIn]),_:1},8,["tooltip"])}}}),YIn={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class XIn extends HIn{async added(){SB(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",qIn),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":Da(NJt)},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:YIn}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("geosearch"),SB(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}const JIn=Object.freeze(Object.defineProperty({__proto__:null,default:XIn},Symbol.toStringTag,{value:"Module"}));class $Jt{constructor(e){this.columnConfig=e,this._field=e?.field,this._title=e?.title,this._visible=e.visible??!0,this._width=e?.width,this._sort=e.sort??"none",this._searchable=e.searchable??!0,this._filter={type:e?.filter?.type??"string",value:e?.filter?.value??"",min:e?.filter?.min??null,max:e?.filter?.max??null,static:e?.filter?.static??!1},this._template=e.template??""}get field(){return this._field}get title(){return this._title}set title(e){this._title=e}get visible(){return this._visible}set visible(e){this._visible=e}get width(){return this._width}set width(e){this._width=e}get sort(){return this._sort}set sort(e){this._sort=e}get searchable(){return this._searchable}set searchable(e){this._searchable=e}get filter(){return this._filter}set filter(e){this._filter=e}set template(e){this._template=e}get template(){return this._template}}class i0e{constructor(e){this.state=e??{},this._title=e?.title??"",this._showFilter=e?.showFilter??!0,this._filterByExtent=e?.filterByExtent??!1,this._columns={},this._open=!0,this._filtered=!0,this._search=e?.search??!0,this._searchFilter=e?.searchFilter??"",this._applyToMap=e?.applyToMap??!1,this._controls=e?.controls??["zoom","details"],this.parsecolumns()}parsecolumns(){this.state.columns&&this.state.columns.forEach(e=>{this._columns[e.field]=new $Jt(e)})}getColumnFilterValue(e,t){const r=this._columns[e].filter;return t==="min"?r.min:t==="max"?r.max:r.value}setColumnFilterValue(e,t,r){let n=t;if(t&&typeof t=="string"){const s=/[(!"#$%&'+,.\\/:;<=>?@[\]^`{|}~)]/g;n=t.replace(s,"\\$&")}r==="min"?this._columns[e].filter.min=n:r==="max"?this._columns[e].filter.max=n:this._columns[e].filter.value=n,this._columns[e].filter.value!==""?this._filtered=!0:this._checkFilters()}clearFilters(){Object.entries(this._columns).forEach(([,e])=>{e.filter.static||(e.filter.min=null,e.filter.max=null,e.filter.value="")}),this._filterByExtent=!1,this._filtered=!1,this._searchFilter=""}_checkFilters(){this._filtered=Object.values(this._columns).some(e=>e.filter.value!==""||e.filter.min||e.filter.max)}get filtered(){return this._filtered}get title(){return this._title}set title(e){this._title=e}get colFilter(){return this._showFilter}set colFilter(e){this._showFilter=e}get filterByExtent(){return this._filterByExtent}set filterByExtent(e){this._filterByExtent=e}get open(){return this._open}set open(e){this._open=e}get search(){return this._search}set search(e){this._search=e}get searchFilter(){return this._searchFilter}set searchFilter(e){this._searchFilter=e}get applyToMap(){return this._applyToMap}set applyToMap(e){this._applyToMap=e}get columns(){return this._columns}set columns(e){this._columns=e}get controls(){return this._controls}}class KIn extends Yu{gridStore=bB(this.$vApp.$pinia);toggleGrid(e,t){const r=this.gridStore.getGridId(e);if(!r){const o=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new i0e(o[e]),fieldMap:{}})}const n=this.gridStore.currentId;this.gridStore.currentId=r??e;const s=this.$iApi.panel.get("grid");if(t===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):n!==e||t===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const t=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(r=>{const n=[],{gridId:s,layers:o,fieldMap:a,options:l}=r;o.forEach(h=>{h.sublayers?h.sublayers?.forEach(p=>{n.push(`${h.layerId}-${p}`),delete t[`${h.layerId}-${p}`]}):(n.push(h.layerId),delete t[h.layerId])});const u={};a?.forEach(h=>{h.sources.forEach(p=>{u[p]=h.field})});const c={id:s,layerIds:n,state:new i0e(l),fieldMap:u};this.gridStore.addGrid(c)}),Object.keys(t).forEach(r=>{const n={id:r,layerIds:[r],state:new i0e(t[r]),fieldMap:{}};this.gridStore.addGrid(n)})}}var aE={};/** +`&&v>0?(h=0,p++,c++):!this.splitByGrapheme&&this._reSpaceAndTab.test(u.graphemeText[p])&&v>0&&(h++,p++),m[v]={line:c,offset:h},p+=u.graphemeLines[v].length,h+=u.graphemeLines[v].length;return m},styleHas:function(u,c){if(this._styleMap&&!this.isWrapping){var h=this._styleMap[c];h&&(c=h.line)}return l.Text.prototype.styleHas.call(this,u,c)},isEmptyStyles:function(u){if(!this.styles)return!0;var c=0,h=u+1,p,m,v=!1,w=this._styleMap[u],S=this._styleMap[u+1];w&&(u=w.line,c=w.offset),S&&(h=S.line,v=h===u,p=S.offset),m=typeof u>"u"?this.styles:{line:this.styles[u]};for(var I in m)for(var R in m[I])if(R>=c&&(!v||Rh&&!Y?(w.push(S),S=[],m=B,Y=!0):m+=K,!Y&&!v&&S.push(k),S=S.concat(R),$=v?0:this._measureWord([k],c,L),L++,Y=!1,B>V&&(V=B);return re&&w.push(S),V+Q>this.dynamicMinWidth&&(this.dynamicMinWidth=V-K+Q),w},isEndOfWrapping:function(u){return!this._styleMap[u+1]||this._styleMap[u+1].line!==this._styleMap[u].line},missingNewlineOffset:function(u){return this.splitByGrapheme?this.isEndOfWrapping(u)?1:0:1},_splitTextIntoLines:function(u){for(var c=l.Text.prototype._splitTextIntoLines.call(this,u),h=this._wrapText(c.lines,this.width),p=new Array(h.length),m=0;m!u.isCosmetic);if(t.length===0)return new fh.fabric.Group([],{originX:"left"});const r=Math.min(t.length,Math.floor(e.width/(WCn+ARe))||1),n=(e.width-(r-1)*ARe)/r;let s=0;const a=(await Promise.all(this._makeSegments(t,n))).map(({title:u,items:c},h)=>{h>0&&(s+=GCn),u.top=s,s+=u.height+UCn;const p=c.map(({title:m,items:v},w)=>{const S=[];return m&&!(c.length===1&&m.text===u.text)&&(w>0&&(s+=zCn),m.top=s,s+=m.height+VCn,S.push(m)),v.forEach(I=>{I.top=s,s+=I.height+HCn}),[...S,...v].filter(I=>I)});return new fh.fabric.Group([u,...p.flat()])}).flat(),l=this._makeColumns(a,n,r);return Promise.resolve(l)}_makeColumns(e,t,r){let n=0,s=0,o=0;const a=e[e.length-1].aCoords.bl.y/r;return e.forEach((l,u)=>{const c=u!==e.length-1?e[u+1].top-l.top:l.height,h=o>a*(n+1),p=s!==0&&c>a,m=r-n>e.length-u;(h||p||m)&&n{const n=new fh.fabric.Textbox(r.name,{fontSize:24,fontFamily:VK,width:t}),s=this._getLayerTreeIds(r);let o=[];return o=r.supportsSublayers?await Promise.all(this._makeSegmentChunks(s,r,t)):await Promise.all(this._makeSegmentChunks([-1],r,t)),{title:n,items:o}})}_makeSegmentChunks(e,t,r){const n=t;return e.map(async s=>{const o=s===-1?n:n.getSublayer(s);if(!o)return{title:new fh.fabric.Textbox("ERROR",{fontSize:20,fontFamily:VK,width:r}),items:[]};await Promise.all(o.legend.map(c=>c.drawPromise));const a=o.legend,l=new fh.fabric.Textbox(o.name,{fontSize:20,fontFamily:VK,width:r}),u=await Promise.all(this._makeChunkItems(a,r));return{title:l,items:u}})}_makeChunkItems(e,t){return e.map(async r=>{const n=(await YCn(fh.fabric.loadSVGFromString)(r.svgcode))[0];if(r.esriStandard){n.originY="center",n.top=sG/2;const s=new fh.fabric.Textbox(r.label,{fontSize:12,fontFamily:VK,originY:"center",left:c_t+20,top:sG/2,width:t-c_t-20});return new fh.fabric.Group([n,s],{height:sG})}else{const s=new fh.fabric.Textbox(r.label,{fontSize:12,fontFamily:VK,originY:"center",left:0,top:sG/2,width:t}),o=Number(r.imgWidth),a=Number(r.imgHeight),l=Math.min(1,t/o);return n&&(n.originY="center",n.top=a*l/2+sG,n.scaleToHeight(a*l),n.scaleToWidth(o*l)),new fh.fabric.Group([s,n].filter(Boolean),{height:a*l+sG})}})}_getLayerTreeIds(e){const t=[],r=[...e.sublayers];for(;r.length>0;){const n=r.shift();n&&(n.visibility&&t.push(n.layerIdx),r.push(...n.sublayers))}return t}}const YCn=i=>e=>new Promise(t=>{i(e,r=>{t(r)})}),XCn=Object.freeze(Object.defineProperty({__proto__:null,default:qCn},Symbol.toStringTag,{value:"Module"}));class JCn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.map}async make(e){const t=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),r=new Image;r.src=t.dataUrl;const n=await new Promise(s=>r.onload=()=>s(r));return new fh.fabric.Image(n,e)}}const KCn=Object.freeze(Object.defineProperty({__proto__:null,default:JCn},Symbol.toStringTag,{value:"Module"}));class ZCn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(e){let t=h=>0,r=0;const n='N',s=document.querySelector(".inner-shell"),o=this.$iApi.geo.map.getSR();let a=0;if(o.isWebMercator())a=0;else{const p=new s0("pole",{x:-96,y:90}),m=await this.$iApi.geo.proj.projectGeometry(o,p),v=this.$iApi.geo.map.mapPointToScreenPoint(m),w={screenX:s.clientWidth/2,screenY:s.clientHeight};a=Math.atan((v.screenX-w.screenX)/(w.screenY-v.screenY))*180/Math.PI;const S=s.clientWidth/2+s.clientHeight*Math.tan(a*Math.PI/180)-50/2,I=Math.round(S/s.clientWidth*100);r=Math.min(Math.max(I,0),100),t=R=>{if(R<0||R>100)throw new Error("Normalized position must be between 0 and 100");const L=s.clientWidth*R/100;return Math.atan((v.screenX-L)/(50/2-v.screenY))*(180/Math.PI)}}const l={top:0,left:0,originX:"center",originY:"center",angle:a},u=[];let c=new fh.fabric.Group;return fh.fabric.loadSVGFromString(n,()=>{c=new fh.fabric.Group(u),c.positionX=r,c.getAngleFromPosition=t},(h,p)=>{u.push(p)}),c.set(HY(l,e||{})),Promise.resolve(c)}}const QCn=Object.freeze(Object.defineProperty({__proto__:null,default:ZCn},Symbol.toStringTag,{value:"Module"}));class eEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(e){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let n=0;n<2;n++){const s=new fh.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[n].distance,"number")}${t[n].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:n*50,left:0,originX:"left",originY:"top"}),o=new fh.fabric.Line([0,n===0?30:40,t[n].pixels,n===0?30:40],{stroke:"black",strokeWidth:3});r.push(new fh.fabric.Group([o,s]))}return Promise.resolve(new fh.fabric.Group(r,e))}}const tEn=Object.freeze(Object.defineProperty({__proto__:null,default:eEn},Symbol.toStringTag,{value:"Module"}));class iEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(e){const t=this.config,r={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(r.text=t.value);const n=HY(r,e||{}),s=new fh.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const rEn=Object.freeze(Object.defineProperty({__proto__:null,default:iEn},Symbol.toStringTag,{value:"Module"}));class nEn extends Yu{get config(){return this.$iApi.fixture.get("export").config?.title}make(e){const t=this.config,r={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(r.text=t.value);const n=HY(r,e||{}),s=new fh.fabric.Textbox(n.text,n);return Promise.resolve(s)}}const sEn=Object.freeze(Object.defineProperty({__proto__:null,default:nEn},Symbol.toStringTag,{value:"Module"}));var kJt={exports:{}};(function(i,e){(function(t,r){r()})(Hh,function(){function t(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,h){var p=new XMLHttpRequest;p.open("GET",u),p.responseType="blob",p.onload=function(){l(p.response,c,h)},p.onerror=function(){console.error("could not download file")},p.send()}function n(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function s(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Hh=="object"&&Hh.global===Hh?Hh:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(u,c,h){var p=o.URL||o.webkitURL,m=document.createElement("a");c=c||u.name||"download",m.download=c,m.rel="noopener",typeof u=="string"?(m.href=u,m.origin===location.origin?s(m):n(m.href)?r(u,c,h):s(m,m.target="_blank")):(m.href=p.createObjectURL(u),setTimeout(function(){p.revokeObjectURL(m.href)},4e4),setTimeout(function(){s(m)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,h){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(t(u,h),c);else if(n(u))r(u,c,h);else{var p=document.createElement("a");p.href=u,p.target="_blank",setTimeout(function(){s(p)})}}:function(u,c,h,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,h);var m=u.type==="application/octet-stream",v=/constructor/i.test(o.HTMLElement)||o.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||m&&v||a)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var L=S.result;L=w?L:L.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=L:location=L,p=null},S.readAsDataURL(u)}else{var I=o.URL||o.webkitURL,R=I.createObjectURL(u);p?p.location=R:location.href=R,p=null,setTimeout(function(){I.revokeObjectURL(R)},4e4)}});o.saveAs=l.saveAs=l,i.exports=l})})(kJt);var oEn=kJt.exports;const aEn=X3(oEn);fh.fabric.Object.prototype.objectCaching=!1;const HK=1200,hw={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class lEn extends Yu{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(e){this.customRendererFunc=e}get config(){return super.config}_parseConfig(e){if(!e)return;const t=pq(this.$vApp.$pinia);t.componentSelectedState={title:e.title?.selected??!0,map:e.map?.selected??!0,mapElements:e.mapElements?.selected??!0,legend:e.legend?.selected??!0,footnote:e.footnote?.selected??!0,timestamp:e.timestamp?.selected??!0},t.fileName=e.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(e){return this.$iApi.fixture.get(e)}async make(e,t){const r=pq(this.$vApp.$pinia),n={};this.fcFabric=new fh.fabric.StaticCanvas(e,{backgroundColor:"#fff"}),this.fcFabricDownload=new fh.fabric.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const s=r.componentSelectedState,o=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),l=this.getSubFixture("export-scalebar"),u=this.getSubFixture("export-northarrow"),c=this.getSubFixture("export-legend"),h=this.getSubFixture("export-footnote"),p=this.getSubFixture("export-timestamp");let m,v,w,S,I,R,L;if(s.title&&o&&(m=await o.make({top:this.options.runningHeight,left:0,originX:"left",width:t,textAlign:"center"}),this.options.runningHeight+=m.height+40,n.title=m),s.map&&a&&(v=await a.make({top:this.options.runningHeight}),m&&(m.left=v.width/2,m.originX="center"),this.options.runningHeight+=v.height+40,n.map=v),!v&&m&&(m.width=HK),this.options.scale=t/((v?.width??HK)+hw.LEFT+hw.RIGHT),s.mapElements&&l&&(w=await l.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=w.height+40,n.scaleBar=w,u&&(S=await u.make({top:w.top,left:t/this.options.scale}),S.top+=S.height/2-20,S.left+=-S.width*2,n.northArrow=S)),s.legend&&c&&(I=await c.make({width:c.config?.columnWidth??v?.width??HK}),I.top=this.options.runningHeight,this.options.runningHeight+=I.height,n.legend=I),s.timestamp&&p&&(L=await p.make({top:this.options.runningHeight+40,width:t}),this.options.runningHeight+=!s.footnote||!h?L.height+40:L.height+20,n.timestamp=L),s.footnote&&h&&(R=await h.make({top:this.options.runningHeight-2.5,left:t/this.options.scale+40}),s.timestamp&&p?t-n.timestamp.getMinWidth()<=R.getMinWidth()+30?(R.top+=30,R.left=0,R.originX="left",this.options.runningHeight+=20):R.left+=-R.width*2:(R.top+=20,R.left+=-R.width*2,this.options.runningHeight+=20),this.options.runningHeight+=R.height,n.footnote=R),this.customRendererFunc){this.fcFabric.setWidth(t);const k={panelWidth:t,margin:hw,defaultWidth:HK,fabric:fh.fabric};await this.customRendererFunc(this.fcFabric,n,k),this.fcFabric.renderAll(),this.fcFabric.clone(B=>{this.fcFabricDownload=B,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const k=new fh.fabric.Group(Object.values(n),{top:hw.TOP*this.options.scale,left:hw.LEFT*this.options.scale}),B=await new Promise($=>{k.clone(V=>{$(V)})});B.top=hw.TOP,B.left=hw.LEFT,this.fcFabricDownload.add(B),k.scale(this.options.scale),this.fcFabric.add(k),this.fcFabric.setDimensions({width:t,height:(this.options.runningHeight+hw.TOP+hw.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(v?.width??HK)+hw.LEFT+hw.RIGHT,height:this.options.runningHeight+hw.TOP+hw.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const e=new Date,t=this.config?.fileName||`map-carte - ${e.getFullYear()}-${e.getMonth()}-${e.getDay()}, ${e.getHours()}_${e.getMinutes()}`;aEn.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${t}.png`)}}const uEn=Ot("div",{class:"flex items-center text-gray-400 w-full h-full hover:text-black p-4 sm:p-8"},[Ot("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("g",null,[Ot("path",{d:"M0,0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"})])])],-1),cEn=["onClick","aria-label"],hEn={class:"md-icon-small inline"},dEn=Ot("g",null,[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1),pEn=[dEn],fEn=Xr({__name:"settings-button",props:{componentSelectedState:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=w0(),r=pq(),n=Hr(()=>t.mobileView?"top-end":"left-end"),s=o=>{o.selectable&&r.toggleSelected({name:o.name})};return(o,a)=>{const l=Ko("dropdown-menu"),u=Nn("focus-item");return Ur((qt(),Dn(l,{position:n.value,tooltip:ri(e)("export.menu"),"tooltip-placement":"top"},{header:Rn(()=>[uEn]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(i.componentSelectedState,c=>(qt(),si("a",{key:c.name,onClick:h=>s(c),href:"javascript:;",class:Wn(`text-left text-sm sm:text-base ${c.selectable?"cursor-pointer":"cursor-default"}`),"aria-label":c.name},[Ot("div",hEn,[(qt(),si("svg",{height:"20",width:"20",viewBox:"0 0 24 24",class:Wn(`inline mx-8 ${c.selected?"":"invisible"}`)},pEn,2)),Ot("span",{class:Wn(`inline ${c.selectable?"":"text-gray-300"} + `)},br(ri(e)(`export.menu.component.${c.name}`)),3)])],10,cEn))),128))]),_:1},8,["position","tooltip"])),[[u]])}}}),mEn=Ot("div",{class:"overflow-hidden border border-gray-200"},[Ot("canvas",{class:"export-canvas !w-[100%]"})],-1),gEn={class:"flex"},yEn=["aria-label"],vEn=["aria-label"],LJt=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=pq(),n=vi(),s=vi(void 0),o=vi([]),a=Hr(()=>Df()?.proxy?.$el),l=Hr(()=>r.componentSelectedState),u=Hr(()=>{let p={};return n.value&&Object.keys(l.value).forEach(m=>{p[m]={name:m,selected:l.value[m]??!1,selectable:(n.value?.config)[m]?.selectable??!0}}),p}),c=Hr(()=>!!n.value?.customRendererFunc),h=xE(300,()=>{if(!n.value)return;const p=a.value.querySelector(".export-canvas");n.value.make(p,a.value.clientWidth)});return E0(()=>{o.value.push(rl(u,()=>{h()}))}),Fa(()=>{n.value=t.fixture.get("export"),s.value=new ResizeObserver(()=>{h()}),s.value.observe(a.value)}),Ka(()=>{s.value.disconnect(),o.value.forEach(p=>p())}),(p,m)=>{const v=Ko("panel-screen");return qt(),Dn(v,{panel:i.panel,footer:!0},{header:Rn(()=>[Xs(br(ri(e)("export.title")),1)]),content:Rn(()=>[mEn]),footer:Rn(()=>[Ot("div",gEn,[Ot("button",{type:"button",onClick:m[0]||(m[0]=w=>n.value?.export()),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-8 sm:px-16 mr-8 sm:mr-16","aria-label":ri(e)("export.download")},br(ri(e)("export.download")),9,yEn),Ot("button",{type:"button",onClick:m[1]||(m[1]=w=>ri(h)()),class:"py-8 px-4 sm:px-16","aria-label":ri(e)("export.refresh")},br(ri(e)("export.refresh")),9,vEn),c.value?Yr("",!0):(qt(),Dn(fEn,{key:0,componentSelectedState:u.value,class:"ml-auto flex px-4 sm:px-8"},null,8,["componentSelectedState"]))])]),_:1},8,["panel"])}}}),_En=Object.freeze(Object.defineProperty({__proto__:null,default:LJt},Symbol.toStringTag,{value:"Module"})),bEn={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class wEn extends lEn{initialized(){this.$iApi.fixture.add("export-title"),this.$iApi.fixture.add("export-map"),this.$iApi.fixture.add("export-legend"),this.$iApi.fixture.add("export-northarrow"),this.$iApi.fixture.add("export-scalebar"),this.$iApi.fixture.add("export-timestamp"),this.$iApi.fixture.add("export-footnote")}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":Da(LJt)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:bEn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("export"),pq(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}const xEn=Object.freeze(Object.defineProperty({__proto__:null,default:wEn},Symbol.toStringTag,{value:"Module"}));class SEn extends Yu{_parseConfig(e){if(e){const t=ure(this.$vApp.$pinia);e.alwaysOn&&t.setAlwaysOn(!0);const r=e.extentSetIds;r&&Array.isArray(r)&&r.length>0&&t.setExtentSetIds(r)}}get config(){return super.config}}function h_t(i,e,t,r){const n=i-e,s=e+n/2,o=Math.min(n,t-r);return s>t?{min:t-o,max:t,changed:!0}:sthis.config,t=>this._parseConfig(t));this.removed=()=>{e(),ure(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(ln.MAP_BASEMAPCHANGE,t=>{t.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(ln.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const e=ure(this.$vApp.$pinia);e.alwaysOn||e.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?e.active||(e.setActive(!0),this.extentEH=this.$iApi.event.on(ln.MAP_EXTENTCHANGE,t=>{e.enforcing||this.enforceBoundary(t,!1)})):e.active&&(e.setActive(!1),this.evtOff("extentEH"))}evtOff(e){this[e]&&(this.$iApi.event.off(this[e]),this[e]="")}enforceBoundary(e,t){const r=this.$iApi.geo.map.getExtentSet().maximumExtent,n=h_t(e.xmax,e.xmin,r.xmax,r.xmin),s=h_t(e.ymax,e.ymin,r.ymax,r.ymin);if(s.changed||n.changed){t&&(this.$iApi.geo.map.esriView.extent=r.toESRI());const o=Yh.fromParams("extguard",n.min,s.min,n.max,s.max,e.sr),a=ure(this.$vApp.$pinia);a.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(o,void 0,!0,400,"ease-in-out").then(()=>{a.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}const CEn=Object.freeze(Object.defineProperty({__proto__:null,default:TEn},Symbol.toStringTag,{value:"Module"})),EEn=Xr({__name:"appbar-button",props:{options:{type:Object}},setup(i){const e=eo("iApi"),t=()=>{e.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(r,n)=>{const s=Ko("appbar-button",!0);return qt(),Dn(s,{onClickFunction:t,tooltip:"Gazebo"},{default:Rn(()=>[Ot("span",{style:s_({color:i.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),IEn=Ot("a",{href:"javascript:;"},"Option 1",-1),AEn=Ot("a",{href:"javascript:;"},"Option 2",-1),MEn=Ot("a",{href:"javascript:;"},"Option 3",-1),OEn={class:"flex flex-col items-center"},PEn=Ot("br",null,null,-1),REn=Ot("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1),DEn=Xr({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(i){return(e,t)=>{const r=Ko("panel-screen");return qt(),Dn(r,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 1/Screen A ")]),controls:Rn(()=>[IEn,AEn,MEn]),content:Rn(()=>[Ot("div",OEn,[Ot("button",{type:"button",onClick:t[0]||(t[0]=n=>i.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),PEn,REn])]),_:1},8,["panel"])}}}),FEn={class:"flex flex-col items-center"},kEn=Ot("br",null,null,-1),LEn=Ot("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1),NEn=Xr({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(i){return(e,t)=>{const r=Ko("panel-screen");return qt(),Dn(r,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 1/Screen B ")]),content:Rn(()=>[Ot("div",FEn,[Ot("button",{type:"button",onClick:t[0]||(t[0]=n=>i.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),kEn,LEn])]),_:1},8,["panel"])}}}),$En={class:"flex flex-row justify-center items-center mt-16"},BEn={class:"mt-16"},jEn=Xr({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=()=>{e.panel.show("p-2-screen-3"),r.event.emit("gazebo/beholdMyText","I am a cat")};return(s,o)=>{const a=Ko("panel-screen");return qt(),Dn(a,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 2/Screen B ")]),content:Rn(()=>[Xs(br(ri(t)("gz.hello2"))+" ",1),Ot("div",$En,[Ot("button",{type:"button",onClick:o[0]||(o[0]=l=>i.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),Ot("button",{type:"button",onClick:o[1]||(o[1]=l=>n()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),Ot("p",BEn,br(i.greeting),1)]),_:1},8,["panel"])}}}),GEn={class:"flex flex-col items-center mt-16"},UEn=Ot("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1),zEn=Ot("p",null,"Locale merging:",-1),VEn=Ot("dt",null,"global locale:",-1),HEn={class:"ml-32 font-bold"},WEn=Ot("dt",null,"fixture locale:",-1),qEn={class:"ml-32 font-bold"},YEn=Ot("dt",null,"common panels locale:",-1),XEn={class:"ml-32 font-bold"},JEn=Xr({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(i){const{t:e}=Qn({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,r)=>{const n=Ko("panel-screen");return qt(),Dn(n,{panel:i.panel},{header:Rn(()=>[Xs(" Gazebo/Panel 2/Screen C ")]),content:Rn(()=>[Ot("div",GEn,[Ot("button",{type:"button",onClick:r[0]||(r[0]=s=>i.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),UEn,zEn,Ot("dl",null,[VEn,Ot("dd",HEn,br(ri(e)("lang_native")),1),WEn,Ot("dd",qEn,br(ri(e)("gz.hello")),1),YEn,Ot("dd",XEn,br(ri(e)("who")),1)])])]),_:1},8,["panel"])}}}),d_t={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},KEn="gazebo/beholdMyText";class ZEn extends Yu{added(){this.$iApi.event.registerEventName(KEn),this.$iApi.component("gazebo-appbar-button",EEn),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":Da(DEn),"p-1-screen-2":Da(NEn)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:d_t}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(e=>setTimeout(()=>Promise.resolve().then(()=>SJn).then(t=>{e(t)}),2e3)),"p-2-screen-2":Da(jEn),"p-2-screen-3":()=>new Promise(e=>e(Da(JEn)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:d_t}}),this.handlePanelTeleports(["p1","p2"])}}const QEn=Object.freeze(Object.defineProperty({__proto__:null,default:ZEn},Symbol.toStringTag,{value:"Module"})),eIn={class:"rv-geosearch-bar relative h-26 mx-8 mb-8"},tIn=["placeholder","value","aria-label"],iIn={class:"absolute inset-y-0 right-8 grid w-10 place-content-center"},rIn=["aria-label","content"],nIn=Xr({__name:"search-bar",setup(i){const{t:e}=Qn(),t=SB(),r=w0(),n=Hr(()=>t.searchVal),s=Hr(()=>['"',"$","!","*","+","?","^","{","}","(",")","|","[","]"].filter(l=>t.searchVal.includes(l)).join("")),o=l=>{t.setSearchTerm(l),t.setSearchRegex(l)},a=xE(500,l=>{o(l)});return(l,u)=>{const c=Nn("tippy");return qt(),si("div",eIn,[Ot("input",{type:"text",class:Wn(["border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",{"border-yellow-500":s.value}]),placeholder:ri(e)("geosearch.searchText"),value:n.value,onInput:u[0]||(u[0]=h=>ri(a)(h.target.value)),onKeyup:u[1]||(u[1]=Ph(h=>{ri(r).mobileView&&h.target.blur()},["enter"])),"aria-label":ri(e)("geosearch.searchText"),onKeypress:u[2]||(u[2]=Ph(ia(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,42,tIn),Ot("span",iIn,[s.value?Ur((qt(),si("button",{key:0,class:"cursor-default","aria-label":ri(e)("geosearch.badChars",{chars:s.value}),content:ri(e)("geosearch.badChars",{chars:s.value})},[Xs(" ⚠ ")],8,rIn)),[[c]]):Yr("",!0)])])}}}),sIn={class:"rv-geosearch-top-filters sm:flex items-center w-full ml-8 mb-14"},oIn={class:"w-fit inline-block sm:w-1/2 h-26 mb-8 sm:mb-0 pr-16 sm:pr-0"},aIn=["value","aria-label"],lIn={value:"",disabled:"",hidden:""},uIn={class:"sm:w-1/2 h-26 sm:mx-16 flex"},cIn=["value","aria-label"],hIn={value:"",disabled:"",hidden:""},dIn=["disabled","content","aria-label"],pIn=Ot("div",{class:"rv-geosearch-icon"},[Ot("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 23 21"},[Ot("path",{d:"M 14.7574,20.8284L 17.6036,17.9822L 14.7574,15.1716L 16.1716,13.7574L 19.0178,16.568L 21.8284,13.7574L 23.2426,15.1716L 20.432,17.9822L 23.2426,20.8284L 21.8284,22.2426L 19.0178,19.3964L 16.1716,22.2426L 14.7574,20.8284 Z M 2,2L 19.9888,2.00001L 20,2.00001L 20,2.01122L 20,3.99999L 19.9207,3.99999L 13,10.9207L 13,22.909L 8.99999,18.909L 8.99999,10.906L 2.09405,3.99999L 2,3.99999L 2,2 Z "})])],-1),fIn=[pIn],mIn=Xr({__name:"top-filters",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=vi([]),s=vi([]),o=vi([]),a=Hr(()=>r.queryParams),l=Hr(()=>t.language),u=m=>r.setProvince(m),c=m=>r.setType(m),h=()=>{u({}),c({})},p=()=>{r.initService(t.language,t.fixture.get("geosearch").config);const m=n.value.find(w=>a.value.province===w.name)?.code,v=s.value.find(w=>a.value.type===w.name)?.code;r.getProvinces.then(w=>{n.value=w,u({province:w.find(S=>S.code===m)?.name,forceReRun:!0})}),r.getTypes.then(w=>{s.value=w,c({type:w.find(S=>S.code===v)?.name,forceReRun:!0})})};return E0(()=>{p(),o.value.push(rl(l,p))}),Ka(()=>{o.value.forEach(m=>m())}),(m,v)=>{const w=Nn("truncate"),S=Nn("tippy");return qt(),si("div",sIn,[Ot("div",oIn,[Ur((qt(),si("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer",value:a.value.province,"aria-label":ri(e)("geosearch.filters.province"),onChange:v[0]||(v[0]=I=>u({province:I.target.value}))},[Ur((qt(),si("option",lIn,[Xs(br(ri(e)("geosearch.filters.province")),1)])),[[w]]),(qt(!0),si(Ks,null,hu(n.value,I=>Ur((qt(),si("option",{key:I.code},[Xs(br(I.name),1)])),[[w]])),128))],40,aIn)),[[w]])]),Ot("div",uIn,[Ur((qt(),si("select",{class:"border-b border-b-gray-600 w-full h-full py-0 cursor-pointer max-w-150",value:a.value.type,"aria-label":ri(e)("geosearch.filters.type"),onChange:v[1]||(v[1]=I=>c({type:I.target.value}))},[Ot("option",hIn,br(ri(e)("geosearch.filters.type")),1),(qt(!0),si(Ks,null,hu(s.value,I=>(qt(),si("option",{key:I.code},br(I.name),1))),128))],40,cIn)),[[w]]),Ur((qt(),si("button",{type:"button",class:"text-gray-500 w-1/8 h-24 pl-8 pr-16 sm:pr-8 hover:text-black disabled:cursor-default disabled:text-gray-400",disabled:!a.value.type&&!a.value.province,onClick:h,content:ri(e)("geosearch.filters.clear"),"aria-label":ri(e)("geosearch.filters.clear")},fIn,8,dIn)),[[S,{placement:"bottom"}]])])])}}}),gIn={class:"rv-geosearch-bottom-filters"},yIn={class:"bg-white"},vIn={class:"ml-8 cursor-pointer font-normal"},_In=["checked"],bIn=Xr({__name:"bottom-filters",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=Hr(()=>r.resultsVisible),s=xE(300,u=>{a(u).then(c=>{o({extent:c,visible:n.value})})}),o=u=>{r.setMapExtent(u)},a=async u=>u.sr.wkid===4326?u:await t.geo.proj.projectGeometry(4326,u),l=u=>{a(t.geo.map.getExtent()).then(c=>{o({extent:c,visible:u})})};return Fa(()=>{t.event.on(ln.MAP_EXTENTCHANGE,s,"geosearch_map_extent")}),Ka(()=>{t.event.off("geosearch_map_extent")}),(u,c)=>(qt(),si("div",gIn,[Ot("div",yIn,[Ot("label",vIn,[Ot("input",{type:"checkbox",class:"border-2 mx-8 border-gray-600 cursor-pointer",checked:n.value,onChange:c[0]||(c[0]=h=>l(h.target.checked)),onKeypress:c[1]||(c[1]=Ph(ia(()=>{},["prevent"]),["enter"]))},null,40,_In),Xs(br(ri(e)("geosearch.visible")),1)])])]))}}),wIn={},xIn={class:"w-full h-6 relative overflow-hidden rounded-full indeterminate mb-14"},SIn={class:"h-full progressbar bg-blue-800 rounded-full top-0","aria-valuemin":"0","aria-valuemax":"100"},TIn={class:"flex items-center h-full"};function CIn(i,e){return qt(),si("div",xIn,[Ot("div",SIn,[Ot("span",TIn,[Em(i.$slots,"default",{},void 0,!0)])])])}const EIn=ml(wIn,[["render",CIn],["__scopeId","data-v-343c5c69"]]),IIn={class:"flex flex-col h-full"},AIn={key:1,class:"text-red-900 text-xs px-8 mb-10"},MIn={key:2,class:"px-8 mb-10 py-8 flex-grow text-wrap border-y border-gray-600 overflow-y-auto"},OIn={class:"relative h-48"},PIn={class:"font-bold text-blue-600"},RIn={key:3,class:"rv-results-list flex-grow mb-5 border-t border-b border-gray-600 overflow-y-auto"},DIn=["onClick"],FIn={class:"rv-result-description px-8"},kIn={class:"flex-1 text-left truncate font-bold leading-tight"},LIn=["innerHTML"],NIn={key:0,class:"text-gray-600 text-sm"},$In={key:1,class:"hidden"},BIn={key:2,class:"text-sm font-normal"},jIn=Ot("br",null,null,-1),NJt=Xr({__name:"screen",props:{panel:{type:Object}},setup(i){const{t:e}=Qn(),t=eo("iApi"),r=SB(),n=Hr(()=>r.searchVal.replace(/["!*$+?^{}()|[\]\\]/g,"").trim()),s=Hr(()=>r.searchResults),o=Hr(()=>r.loadingResults),a=Hr(()=>r.failedServices),l=c=>{let h=new Zy("zoomies",[[[c.bbox[0],c.bbox[1]],[c.bbox[0],c.bbox[3]],[c.bbox[2],c.bbox[3]],[c.bbox[2],c.bbox[1]],[c.bbox[0],c.bbox[1]]]],xl.latLongSR(),!0);t.geo.map.zoomMapTo(h)},u=(c,h)=>{const p=c.replace(new RegExp(`${r.searchRegex}`,"gi"),m=>''+m+"");return h?p+",":p};return(c,h)=>{const p=Ko("panel-screen"),m=Nn("truncate"),v=Nn("focus-item"),w=Nn("focus-list");return qt(),Dn(p,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(e)("geosearch.title")),1)]),content:Rn(()=>[Ot("div",IIn,[Vn(nIn),Vn(mIn),o.value?(qt(),Dn(EIn,{key:0,class:"flex-none"})):Yr("",!0),a.value.length>0&&!o.value?(qt(),si("div",AIn,br(ri(e)("geosearch.serviceError",{services:a.value.join(", ")})),1)):Yr("",!0),n.value&&s.value.length===0&&!o.value?(qt(),si("div",MIn,[Ot("span",OIn,[Xs(br(ri(e)("geosearch.noResults")),1),Ot("span",PIn,'"'+br(n.value)+'"',1)])])):Yr("",!0),s.value.length>0?Ur((qt(),si("ul",RIn,[(qt(!0),si(Ks,null,hu(s.value,(S,I)=>(qt(),si("li",{class:"relative h-56",key:I},[Ur((qt(),si("button",{type:"button",class:"absolute inset-0 h-full w-full hover:bg-gray-300 default-focus-style",onClick:R=>l(S),style:{"border-bottom":"1px solid lightgray"},"truncate-trigger":""},[Ot("div",FIn,[Ur((qt(),si("div",kIn,[Ot("span",{innerHTML:u(S.name,S.location.province)},null,8,LIn),S.location.province?(qt(),si("span",NIn,br(S.location.city?" "+S.location.city+", "+S.location.province.abbr:" "+S.location.province.abbr),1)):Yr("",!0),S.type?(qt(),si("span",$In,"; ")):Yr("",!0),S.type?(qt(),si("span",BIn,[jIn,Xs(br(S.type),1)])):Yr("",!0)])),[[m,{externalTrigger:!0,options:{placement:"top-start"}}]])])],8,DIn)),[[v,"show-truncate"]])]))),128))])),[[w]]):Yr("",!0),Vn(bIn,{class:"mt-auto"})])]),_:1},8,["panel"])}}}),GIn=Object.freeze(Object.defineProperty({__proto__:null,default:NJt},Symbol.toStringTag,{value:"Module"}));class UIn extends Yu{}const zIn=Ot("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[Ot("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),Ot("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),VIn=Xr({__name:"nav-button",setup(i){const{t:e}=Qn(),t=eo("iApi"),r=()=>{t?.panel.toggle("geosearch")};return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(e)("geosearch.title")},{default:Rn(()=>[zIn]),_:1},8,["tooltip"])}}}),HIn={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class WIn extends UIn{async added(){SB(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",VIn),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":Da(NJt)},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:HIn}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("geosearch"),SB(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}const qIn=Object.freeze(Object.defineProperty({__proto__:null,default:WIn},Symbol.toStringTag,{value:"Module"}));class $Jt{constructor(e){this.columnConfig=e,this._field=e?.field,this._title=e?.title,this._visible=e.visible??!0,this._width=e?.width,this._sort=e.sort??"none",this._searchable=e.searchable??!0,this._filter={type:e?.filter?.type??"string",value:e?.filter?.value??"",min:e?.filter?.min??null,max:e?.filter?.max??null,static:e?.filter?.static??!1},this._template=e.template??""}get field(){return this._field}get title(){return this._title}set title(e){this._title=e}get visible(){return this._visible}set visible(e){this._visible=e}get width(){return this._width}set width(e){this._width=e}get sort(){return this._sort}set sort(e){this._sort=e}get searchable(){return this._searchable}set searchable(e){this._searchable=e}get filter(){return this._filter}set filter(e){this._filter=e}set template(e){this._template=e}get template(){return this._template}}class i0e{constructor(e){this.state=e??{},this._title=e?.title??"",this._showFilter=e?.showFilter??!0,this._filterByExtent=e?.filterByExtent??!1,this._columns={},this._open=!0,this._filtered=!0,this._search=e?.search??!0,this._searchFilter=e?.searchFilter??"",this._applyToMap=e?.applyToMap??!1,this._controls=e?.controls??["zoom","details"],this.parsecolumns()}parsecolumns(){this.state.columns&&this.state.columns.forEach(e=>{this._columns[e.field]=new $Jt(e)})}getColumnFilterValue(e,t){const r=this._columns[e].filter;return t==="min"?r.min:t==="max"?r.max:r.value}setColumnFilterValue(e,t,r){let n=t;if(t&&typeof t=="string"){const s=/[(!"#$%&'+,.\\/:;<=>?@[\]^`{|}~)]/g;n=t.replace(s,"\\$&")}r==="min"?this._columns[e].filter.min=n:r==="max"?this._columns[e].filter.max=n:this._columns[e].filter.value=n,this._columns[e].filter.value!==""?this._filtered=!0:this._checkFilters()}clearFilters(){Object.entries(this._columns).forEach(([,e])=>{e.filter.static||(e.filter.min=null,e.filter.max=null,e.filter.value="")}),this._filterByExtent=!1,this._filtered=!1,this._searchFilter=""}_checkFilters(){this._filtered=Object.values(this._columns).some(e=>e.filter.value!==""||e.filter.min||e.filter.max)}get filtered(){return this._filtered}get title(){return this._title}set title(e){this._title=e}get colFilter(){return this._showFilter}set colFilter(e){this._showFilter=e}get filterByExtent(){return this._filterByExtent}set filterByExtent(e){this._filterByExtent=e}get open(){return this._open}set open(e){this._open=e}get search(){return this._search}set search(e){this._search=e}get searchFilter(){return this._searchFilter}set searchFilter(e){this._searchFilter=e}get applyToMap(){return this._applyToMap}set applyToMap(e){this._applyToMap=e}get columns(){return this._columns}set columns(e){this._columns=e}get controls(){return this._controls}}class YIn extends Yu{gridStore=bB(this.$vApp.$pinia);toggleGrid(e,t){const r=this.gridStore.getGridId(e);if(!r){const o=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new i0e(o[e]),fieldMap:{}})}const n=this.gridStore.currentId;this.gridStore.currentId=r??e;const s=this.$iApi.panel.get("grid");if(t===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):n!==e||t===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const t=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(r=>{const n=[],{gridId:s,layers:o,fieldMap:a,options:l}=r;o.forEach(h=>{h.sublayers?h.sublayers?.forEach(p=>{n.push(`${h.layerId}-${p}`),delete t[`${h.layerId}-${p}`]}):(n.push(h.layerId),delete t[h.layerId])});const u={};a?.forEach(h=>{h.sources.forEach(p=>{u[p]=h.field})});const c={id:s,layerIds:n,state:new i0e(l),fieldMap:u};this.gridStore.addGrid(c)}),Object.keys(t).forEach(r=>{const n={id:r,layerIds:[r],state:new i0e(t[r]),fieldMap:{}};this.gridStore.addGrid(n)})}}var aE={};/** * ag-grid-community - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ ' * @license MIT @@ -5632,7 +5632,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Tn=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),bs=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},qn=function(P,f){return function(d,y){f(d,y,P)}},ko=function(P){Tn(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.setBeans=function(d){this.logger=d.create("ColumnFactory")},f.prototype.createColumnTree=function(d,y,T){var M=new v,U=this.extractExistingTreeData(T),X=U.existingCols,Se=U.existingGroups,Pe=U.existingColKeys;M.addExistingKeys(Pe);var at=this.recursivelyCreateColumns(d,0,y,X,M,Se),Lt=this.findMaxDept(at,0);this.logger.log("Number of levels for grouped columns is "+Lt);var Kt=this.balanceColumnTree(at,0,Lt,M),_i=function(Si,Ji){Si instanceof Xt&&Si.setupExpandable(),Si.setOriginalParent(Ji)};return this.columnUtils.depthFirstOriginalTreeSearch(null,Kt,_i),{columnTree:Kt,treeDept:Lt}},f.prototype.extractExistingTreeData=function(d){var y=[],T=[],M=[];return d&&this.columnUtils.depthFirstOriginalTreeSearch(null,d,function(U){if(U instanceof Xt){var X=U;T.push(X)}else{var Se=U;M.push(Se.getId()),y.push(Se)}}),{existingCols:y,existingGroups:T,existingColKeys:M}},f.prototype.createForAutoGroups=function(d,y){var T=this;return d.map(function(M){return T.createAutoGroupTreeItem(y,M)})},f.prototype.createAutoGroupTreeItem=function(d,y){for(var T=this.findDepth(d),M=y,U=T-1;U>=0;U--){var X=new Xt(null,"FAKE_PATH_"+y.getId()+"}_"+U,!0,U);this.context.createBean(X),X.setChildren([M]),M.setOriginalParent(X),M=X}return M},f.prototype.findDepth=function(d){for(var y=0,T=d;T&&T[0]&&T[0]instanceof Xt;)y++,T=T[0].getChildren();return y},f.prototype.balanceColumnTree=function(d,y,T,M){for(var U=[],X=0;X=y;_i--){var Si=M.getUniqueKey(null,null),Ji=this.createMergedColGroupDef(null),cr=new Xt(Ji,Si,!0,y);this.context.createBean(cr),Kt&&Kt.setChildren([cr]),Kt=cr,Lt||(Lt=Kt)}if(Lt&&Kt){U.push(Lt);var kr=d.some(function(Er){return Er instanceof Xt});if(kr){Kt.setChildren([Se]);continue}else{Kt.setChildren(d);break}}U.push(Se)}}return U},f.prototype.findMaxDept=function(d,y){for(var T=y,M=0;M=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},qn=function(P,f){return function(d,y){f(d,y,P)}},ko=function(P){Cn(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.setBeans=function(d){this.logger=d.create("ColumnFactory")},f.prototype.createColumnTree=function(d,y,T){var M=new v,U=this.extractExistingTreeData(T),X=U.existingCols,Se=U.existingGroups,Pe=U.existingColKeys;M.addExistingKeys(Pe);var at=this.recursivelyCreateColumns(d,0,y,X,M,Se),Lt=this.findMaxDept(at,0);this.logger.log("Number of levels for grouped columns is "+Lt);var Kt=this.balanceColumnTree(at,0,Lt,M),_i=function(Si,Ji){Si instanceof Xt&&Si.setupExpandable(),Si.setOriginalParent(Ji)};return this.columnUtils.depthFirstOriginalTreeSearch(null,Kt,_i),{columnTree:Kt,treeDept:Lt}},f.prototype.extractExistingTreeData=function(d){var y=[],T=[],M=[];return d&&this.columnUtils.depthFirstOriginalTreeSearch(null,d,function(U){if(U instanceof Xt){var X=U;T.push(X)}else{var Se=U;M.push(Se.getId()),y.push(Se)}}),{existingCols:y,existingGroups:T,existingColKeys:M}},f.prototype.createForAutoGroups=function(d,y){var T=this;return d.map(function(M){return T.createAutoGroupTreeItem(y,M)})},f.prototype.createAutoGroupTreeItem=function(d,y){for(var T=this.findDepth(d),M=y,U=T-1;U>=0;U--){var X=new Xt(null,"FAKE_PATH_"+y.getId()+"}_"+U,!0,U);this.context.createBean(X),X.setChildren([M]),M.setOriginalParent(X),M=X}return M},f.prototype.findDepth=function(d){for(var y=0,T=d;T&&T[0]&&T[0]instanceof Xt;)y++,T=T[0].getChildren();return y},f.prototype.balanceColumnTree=function(d,y,T,M){for(var U=[],X=0;X=y;_i--){var Si=M.getUniqueKey(null,null),Ji=this.createMergedColGroupDef(null),cr=new Xt(Ji,Si,!0,y);this.context.createBean(cr),Kt&&Kt.setChildren([cr]),Kt=cr,Lt||(Lt=Kt)}if(Lt&&Kt){U.push(Lt);var kr=d.some(function(Er){return Er instanceof Xt});if(kr){Kt.setChildren([Se]);continue}else{Kt.setChildren(d);break}}U.push(Se)}}return U},f.prototype.findMaxDept=function(d,y){for(var T=y,M=0;M=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},LX=function(P){D7(f,P);function f(d){return P.call(this,d,"ag-select","smallDown","listbox")||this}return f.prototype.init=function(){var d=this;this.listComponent=this.createBean(new Mue("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,Mue.EVENT_ITEM_SELECTED,function(){d.hideList&&d.hideList()}),this.listComponent.addManagedListener(this.listComponent,bo.EVENT_CHANGED,function(){d.setValue(d.listComponent.getValue(),!1,!0),d.hideList&&d.hideList()})},f.prototype.showPicker=function(){var d=this,y=this.listComponent.getGui(),T=this.gridOptionsWrapper.getDocument(),M=this.addManagedListener(T.body,"wheel",function(Pe){!y.contains(Pe.target)&&d.hideList&&d.hideList()}),U=this.addManagedListener(y,"focusout",function(Pe){!y.contains(Pe.relatedTarget)&&d.hideList&&d.hideList()}),X=this.gridOptionsWrapper.getLocaleTextFunc(),Se=this.popupService.addPopup({modal:!0,eChild:y,closeOnEsc:!0,closedCallback:function(){d.hideList=null,d.isPickerDisplayed=!1,U(),M(),d.isAlive()&&(xr(d.eWrapper,!1),d.getFocusableElement().focus())},ariaLabel:X("ariaLabelSelectField","Select Field")});return Se&&(this.hideList=Se.hideFunc),this.isPickerDisplayed=!0,Ge(y,Nf(this.eWrapper)),xr(this.eWrapper,!0),y.style.maxHeight=Bm(this.popupService.getPopupParent())+"px",y.style.position="absolute",this.popupService.positionPopupUnderComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:y,keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent},f.prototype.addOptions=function(d){var y=this;return d.forEach(function(T){return y.addOption(T)}),this},f.prototype.addOption=function(d){return this.listComponent.addOption(d),this},f.prototype.setValue=function(d,y,T){if(this.value===d)return this;T||this.listComponent.setValue(d,!0);var M=this.listComponent.getValue();return M===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),P.prototype.setValue.call(this,d,y))},f.prototype.destroy=function(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),P.prototype.destroy.call(this)},F7([ie("popupService")],f.prototype,"popupService",void 0),F7([Ke],f.prototype,"init",null),f}(Iue);/** + */var D7=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),F7=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},LX=function(P){D7(f,P);function f(d){return P.call(this,d,"ag-select","smallDown","listbox")||this}return f.prototype.init=function(){var d=this;this.listComponent=this.createBean(new Mue("select")),this.listComponent.setParentComponent(this),this.eWrapper.tabIndex=0,this.listComponent.addManagedListener(this.listComponent,Mue.EVENT_ITEM_SELECTED,function(){d.hideList&&d.hideList()}),this.listComponent.addManagedListener(this.listComponent,bo.EVENT_CHANGED,function(){d.setValue(d.listComponent.getValue(),!1,!0),d.hideList&&d.hideList()})},f.prototype.showPicker=function(){var d=this,y=this.listComponent.getGui(),T=this.gridOptionsWrapper.getDocument(),M=this.addManagedListener(T.body,"wheel",function(Pe){!y.contains(Pe.target)&&d.hideList&&d.hideList()}),U=this.addManagedListener(y,"focusout",function(Pe){!y.contains(Pe.relatedTarget)&&d.hideList&&d.hideList()}),X=this.gridOptionsWrapper.getLocaleTextFunc(),Se=this.popupService.addPopup({modal:!0,eChild:y,closeOnEsc:!0,closedCallback:function(){d.hideList=null,d.isPickerDisplayed=!1,U(),M(),d.isAlive()&&(wr(d.eWrapper,!1),d.getFocusableElement().focus())},ariaLabel:X("ariaLabelSelectField","Select Field")});return Se&&(this.hideList=Se.hideFunc),this.isPickerDisplayed=!0,Ge(y,Nf(this.eWrapper)),wr(this.eWrapper,!0),y.style.maxHeight=Bm(this.popupService.getPopupParent())+"px",y.style.position="absolute",this.popupService.positionPopupUnderComponent({type:"ag-list",eventSource:this.eWrapper,ePopup:y,keepWithinBounds:!0}),this.listComponent.refreshHighlighted(),this.listComponent},f.prototype.addOptions=function(d){var y=this;return d.forEach(function(T){return y.addOption(T)}),this},f.prototype.addOption=function(d){return this.listComponent.addOption(d),this},f.prototype.setValue=function(d,y,T){if(this.value===d)return this;T||this.listComponent.setValue(d,!0);var M=this.listComponent.getValue();return M===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),P.prototype.setValue.call(this,d,y))},f.prototype.destroy=function(){this.hideList&&this.hideList(),this.destroyBean(this.listComponent),P.prototype.destroy.call(this)},F7([ie("popupService")],f.prototype,"popupService",void 0),F7([Ke],f.prototype,"init",null),f}(Iue);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6082,7 +6082,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Uue=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),G7=function(){return G7=Object.assign||function(P){for(var f,d=1,y=arguments.length;d=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Bf=function(P){Uue(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.init=function(d,y,T,M,U,X,Se){this.params=Se,this.eGui=y,this.eCheckbox=T,this.eExpanded=M,this.eContracted=U,this.comp=d,this.compClass=X;var Pe=this.isTopLevelFooter(),at=this.isEmbeddedRowMismatch(),Lt=Se.value==null,Kt=!1;if(this.gridOptionsWrapper.isGroupIncludeFooter()&&this.gridOptionsWrapper.isGroupHideOpenParents()){var _i=Se.node;if(_i.footer){var Si=Se.colDef&&Se.colDef.showRowGroup,Ji=_i.rowGroupColumn&&_i.rowGroupColumn.getColId();Kt=Si!==Ji}}this.cellIsBlank=Pe?!1:at||Lt||Kt,!this.cellIsBlank&&(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded())},f.prototype.destroy=function(){P.prototype.destroy.call(this),this.expandListener=null},f.prototype.refreshAriaExpanded=function(){var d=this.params,y=d.node,T=d.eParentOfValue;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){Ar(T);return}var M=function(){xr(T,!!y.expanded)};this.expandListener=this.addManagedListener(y,Va.EVENT_EXPANDED_CHANGED,M)||null,M()},f.prototype.isTopLevelFooter=function(){if(!this.gridOptionsWrapper.isGroupIncludeTotalFooter()||this.params.value!=null||this.params.node.level!=-1)return!1;var d=this.params.colDef,y=d==null;if(y||d.showRowGroup===!0)return!0;var T=this.columnModel.getRowGroupColumns();if(!T||T.length===0)return!0;var M=T[0];return M.getId()===d.showRowGroup},f.prototype.isEmbeddedRowMismatch=function(){if(!this.params.fullWidth||!this.gridOptionsWrapper.isEmbedFullWidthRows())return!1;var d=this.params.pinned===Fe.PINNED_LEFT,y=this.params.pinned===Fe.PINNED_RIGHT,T=!d&&!y;return this.gridOptionsWrapper.isEnableRtl()?this.columnModel.isPinningLeft()?!y:!T:this.columnModel.isPinningLeft()?!d:!T},f.prototype.findDisplayedGroupNode=function(){var d=this.params.column,y=this.params.node;if(this.showingValueForOpenedParent)for(var T=y.parent;T!=null;){if(T.rowGroupColumn&&d.isRowGroupDisplayed(T.rowGroupColumn.getId())){this.displayedGroupNode=T;break}T=T.parent}r(this.displayedGroupNode)&&(this.displayedGroupNode=y)},f.prototype.setupShowingValueForOpenedParent=function(){var d=this.params.node,y=this.params.column;if(!this.gridOptionsWrapper.isGroupHideOpenParents()){this.showingValueForOpenedParent=!1;return}if(!d.groupData){this.showingValueForOpenedParent=!1;return}var T=d.rowGroupColumn!=null;if(T){var M=d.rowGroupColumn.getId(),U=y.isRowGroupDisplayed(M);if(U){this.showingValueForOpenedParent=!1;return}}var X=d.groupData[y.getId()]!=null;this.showingValueForOpenedParent=X},f.prototype.addValueElement=function(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())},f.prototype.addGroupValue=function(){var d=this.adjustParamsWithDetailsFromRelatedColumn(),y=this.getInnerCompDetails(d),T=d.valueFormatted,M=d.value,U=T??M;this.comp.setInnerRenderer(y,U)},f.prototype.adjustParamsWithDetailsFromRelatedColumn=function(){var d=this.displayedGroupNode.rowGroupColumn,y=this.params.column;if(!d)return this.params;var T=y!=null;if(T){var M=y.isRowGroupDisplayed(d.getId());if(!M)return this.params}var U=this.params,X=this.params,Se=X.value,Pe=X.node,at=this.valueFormatterService.formatValue(d,Pe,Se),Lt=G7(G7({},U),{valueFormatted:at});return Lt},f.prototype.addFooterValue=function(){var d=this.params.footerValueGetter,y="";if(d){var T=S(this.params);T.value=this.params.value,typeof d=="function"?y=d(T):typeof d=="string"?y=this.expressionService.evaluate(d,T):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else y="Total "+(this.params.value!=null?this.params.value:"");var M=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(M,y)},f.prototype.getInnerCompDetails=function(d){var y=this;if(d.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptions.groupRowRendererParams,d);var T=this.userComponentFactory.getInnerRendererDetails(d,d),M=function(at){return at&&at.componentClass==y.compClass};if(T&&!M(T))return T;var U=this.displayedGroupNode.rowGroupColumn,X=U?U.getColDef():void 0;if(X){var Se=this.userComponentFactory.getCellRendererDetails(X,d);if(Se&&!M(Se))return Se;if(M(Se)&&X.cellRendererParams&&X.cellRendererParams.innerRenderer){var Pe=this.userComponentFactory.getInnerRendererDetails(X.cellRendererParams,d);return Pe}}},f.prototype.addChildCount=function(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Va.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())},f.prototype.updateChildCount=function(){var d=this.displayedGroupNode.allChildrenCount,y=this.isShowRowGroupForThisRow(),T=y&&d!=null&&d>=0,M=T?"("+d+")":"";this.comp.setChildCount(M)},f.prototype.isShowRowGroupForThisRow=function(){if(this.gridOptionsWrapper.isTreeData())return!0;var d=this.displayedGroupNode.rowGroupColumn;if(!d)return!1;var y=this.params.column,T=y==null||y.isRowGroupDisplayed(d.getId());return T},f.prototype.addExpandAndContract=function(){var d=this.params,y=Tp("groupExpanded",this.gridOptionsWrapper,null),T=Tp("groupContracted",this.gridOptionsWrapper,null);y&&this.eExpanded.appendChild(y),T&&this.eContracted.appendChild(T);var M=d.eGridCell;!this.gridOptionsWrapper.isEnableGroupEdit()&&this.isExpandable()&&!d.suppressDoubleClickExpand&&this.addManagedListener(M,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(M,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(d.node,Va.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();var U=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Va.EVENT_ALL_CHILDREN_COUNT_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_MASTER_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_GROUP_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_HAS_CHILDREN_CHANGED,U)},f.prototype.onExpandClicked=function(d){mi(d)||(Bi(d),this.onExpandOrContract(d))},f.prototype.onExpandOrContract=function(d){var y=this.displayedGroupNode,T=!y.expanded;y.setExpanded(T,d)},f.prototype.isExpandable=function(){if(this.showingValueForOpenedParent)return!0;var d=this.displayedGroupNode,y=this.columnModel.isPivotMode()&&d.leafGroup,T=d.isExpandable()&&!d.footer&&!y;if(!T)return!1;var M=this.params.column,U=M!=null&&typeof M.getColDef().showRowGroup=="string";if(U){var X=this.isShowRowGroupForThisRow();return X}return!0},f.prototype.showExpandAndContractIcons=function(){var d=this,y=d.params,T=d.displayedGroupNode,M=d.columnModel,U=y.node,X=this.isExpandable();if(X){var Se=this.showingValueForOpenedParent?!0:U.expanded;this.comp.setExpandedDisplayed(Se),this.comp.setContractedDisplayed(!Se)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);var Pe=M.isPivotMode(),at=Pe&&T.leafGroup,Lt=X&&!at,Kt=U.footer&&U.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",Lt),this.comp.addOrRemoveCssClass("ag-row-group",Lt),Pe?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",at):Kt||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!Lt)},f.prototype.onRowNodeIsExpandableChanged=function(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()},f.prototype.setupIndent=function(){var d=this.params.node,y=this.params.suppressPadding;y||(this.addManagedListener(d,Va.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())},f.prototype.setIndent=function(){if(!this.gridOptionsWrapper.isGroupHideOpenParents()){var d=this.params,y=d.node,T=!!d.colDef,M=this.gridOptionsWrapper.isTreeData(),U=!T||M||d.colDef.showRowGroup===!0,X=U?y.uiLevel:0,Se=d.padding>=0;Se&&Ie(function(){return console.warn("AG Grid: cellRendererParams.padding no longer works, it was deprecated in since v14.2 and removed in v26, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the AG Grid documentation page for Themes, in particular the property $row-group-indent-size.")},"groupCellRenderer->doDeprecatedWay"),this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+X,this.comp.addOrRemoveCssClass(this.indentClass,!0)}},f.prototype.addFullWidthRowDraggerIfNeeded=function(){var d=this;if(!(!this.params.fullWidth||!this.params.rowDrag)){var y=new i2(function(){return d.params.value},this.params.node);this.createManagedBean(y,this.context),this.eGui.insertAdjacentElement("afterbegin",y.getGui())}},f.prototype.isUserWantsSelected=function(){var d=this.params.checkbox;return typeof d=="function"?d(this.params):d===!0},f.prototype.addCheckboxIfNeeded=function(){var d=this,y=this.displayedGroupNode,T=this.isUserWantsSelected()&&!y.footer&&!y.rowPinned&&!y.detail;if(T){var M=new B7;this.getContext().createBean(M),M.init({rowNode:y,column:this.params.column}),this.eCheckbox.appendChild(M.getGui()),this.addDestroyFunc(function(){return d.getContext().destroyBean(M)})}this.comp.setCheckboxVisible(T)},f.prototype.onKeyDown=function(d){var y=d.key===sn.ENTER;if(!(!y||this.params.suppressEnterExpand)){var T=this.params.column&&this.params.column.isCellEditable(this.params.node);T||this.onExpandOrContract(d)}},f.prototype.onCellDblClicked=function(d){if(!mi(d)){var y=Fr(this.eExpanded,d)||Fr(this.eContracted,d);y||this.onExpandOrContract(d)}},DE([ie("expressionService")],f.prototype,"expressionService",void 0),DE([ie("valueFormatterService")],f.prototype,"valueFormatterService",void 0),DE([ie("columnModel")],f.prototype,"columnModel",void 0),DE([ie("userComponentFactory")],f.prototype,"userComponentFactory",void 0),DE([ie("gridOptions")],f.prototype,"gridOptions",void 0),f}(Qi);/** + */var Uue=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),G7=function(){return G7=Object.assign||function(P){for(var f,d=1,y=arguments.length;d=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Bf=function(P){Uue(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.init=function(d,y,T,M,U,X,Se){this.params=Se,this.eGui=y,this.eCheckbox=T,this.eExpanded=M,this.eContracted=U,this.comp=d,this.compClass=X;var Pe=this.isTopLevelFooter(),at=this.isEmbeddedRowMismatch(),Lt=Se.value==null,Kt=!1;if(this.gridOptionsWrapper.isGroupIncludeFooter()&&this.gridOptionsWrapper.isGroupHideOpenParents()){var _i=Se.node;if(_i.footer){var Si=Se.colDef&&Se.colDef.showRowGroup,Ji=_i.rowGroupColumn&&_i.rowGroupColumn.getColId();Kt=Si!==Ji}}this.cellIsBlank=Pe?!1:at||Lt||Kt,!this.cellIsBlank&&(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded())},f.prototype.destroy=function(){P.prototype.destroy.call(this),this.expandListener=null},f.prototype.refreshAriaExpanded=function(){var d=this.params,y=d.node,T=d.eParentOfValue;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){Ar(T);return}var M=function(){wr(T,!!y.expanded)};this.expandListener=this.addManagedListener(y,Va.EVENT_EXPANDED_CHANGED,M)||null,M()},f.prototype.isTopLevelFooter=function(){if(!this.gridOptionsWrapper.isGroupIncludeTotalFooter()||this.params.value!=null||this.params.node.level!=-1)return!1;var d=this.params.colDef,y=d==null;if(y||d.showRowGroup===!0)return!0;var T=this.columnModel.getRowGroupColumns();if(!T||T.length===0)return!0;var M=T[0];return M.getId()===d.showRowGroup},f.prototype.isEmbeddedRowMismatch=function(){if(!this.params.fullWidth||!this.gridOptionsWrapper.isEmbedFullWidthRows())return!1;var d=this.params.pinned===Fe.PINNED_LEFT,y=this.params.pinned===Fe.PINNED_RIGHT,T=!d&&!y;return this.gridOptionsWrapper.isEnableRtl()?this.columnModel.isPinningLeft()?!y:!T:this.columnModel.isPinningLeft()?!d:!T},f.prototype.findDisplayedGroupNode=function(){var d=this.params.column,y=this.params.node;if(this.showingValueForOpenedParent)for(var T=y.parent;T!=null;){if(T.rowGroupColumn&&d.isRowGroupDisplayed(T.rowGroupColumn.getId())){this.displayedGroupNode=T;break}T=T.parent}r(this.displayedGroupNode)&&(this.displayedGroupNode=y)},f.prototype.setupShowingValueForOpenedParent=function(){var d=this.params.node,y=this.params.column;if(!this.gridOptionsWrapper.isGroupHideOpenParents()){this.showingValueForOpenedParent=!1;return}if(!d.groupData){this.showingValueForOpenedParent=!1;return}var T=d.rowGroupColumn!=null;if(T){var M=d.rowGroupColumn.getId(),U=y.isRowGroupDisplayed(M);if(U){this.showingValueForOpenedParent=!1;return}}var X=d.groupData[y.getId()]!=null;this.showingValueForOpenedParent=X},f.prototype.addValueElement=function(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())},f.prototype.addGroupValue=function(){var d=this.adjustParamsWithDetailsFromRelatedColumn(),y=this.getInnerCompDetails(d),T=d.valueFormatted,M=d.value,U=T??M;this.comp.setInnerRenderer(y,U)},f.prototype.adjustParamsWithDetailsFromRelatedColumn=function(){var d=this.displayedGroupNode.rowGroupColumn,y=this.params.column;if(!d)return this.params;var T=y!=null;if(T){var M=y.isRowGroupDisplayed(d.getId());if(!M)return this.params}var U=this.params,X=this.params,Se=X.value,Pe=X.node,at=this.valueFormatterService.formatValue(d,Pe,Se),Lt=G7(G7({},U),{valueFormatted:at});return Lt},f.prototype.addFooterValue=function(){var d=this.params.footerValueGetter,y="";if(d){var T=S(this.params);T.value=this.params.value,typeof d=="function"?y=d(T):typeof d=="string"?y=this.expressionService.evaluate(d,T):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else y="Total "+(this.params.value!=null?this.params.value:"");var M=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(M,y)},f.prototype.getInnerCompDetails=function(d){var y=this;if(d.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptions.groupRowRendererParams,d);var T=this.userComponentFactory.getInnerRendererDetails(d,d),M=function(at){return at&&at.componentClass==y.compClass};if(T&&!M(T))return T;var U=this.displayedGroupNode.rowGroupColumn,X=U?U.getColDef():void 0;if(X){var Se=this.userComponentFactory.getCellRendererDetails(X,d);if(Se&&!M(Se))return Se;if(M(Se)&&X.cellRendererParams&&X.cellRendererParams.innerRenderer){var Pe=this.userComponentFactory.getInnerRendererDetails(X.cellRendererParams,d);return Pe}}},f.prototype.addChildCount=function(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,Va.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())},f.prototype.updateChildCount=function(){var d=this.displayedGroupNode.allChildrenCount,y=this.isShowRowGroupForThisRow(),T=y&&d!=null&&d>=0,M=T?"("+d+")":"";this.comp.setChildCount(M)},f.prototype.isShowRowGroupForThisRow=function(){if(this.gridOptionsWrapper.isTreeData())return!0;var d=this.displayedGroupNode.rowGroupColumn;if(!d)return!1;var y=this.params.column,T=y==null||y.isRowGroupDisplayed(d.getId());return T},f.prototype.addExpandAndContract=function(){var d=this.params,y=Tp("groupExpanded",this.gridOptionsWrapper,null),T=Tp("groupContracted",this.gridOptionsWrapper,null);y&&this.eExpanded.appendChild(y),T&&this.eContracted.appendChild(T);var M=d.eGridCell;!this.gridOptionsWrapper.isEnableGroupEdit()&&this.isExpandable()&&!d.suppressDoubleClickExpand&&this.addManagedListener(M,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(M,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(d.node,Va.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();var U=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,Va.EVENT_ALL_CHILDREN_COUNT_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_MASTER_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_GROUP_CHANGED,U),this.addManagedListener(this.displayedGroupNode,Va.EVENT_HAS_CHILDREN_CHANGED,U)},f.prototype.onExpandClicked=function(d){mi(d)||(Bi(d),this.onExpandOrContract(d))},f.prototype.onExpandOrContract=function(d){var y=this.displayedGroupNode,T=!y.expanded;y.setExpanded(T,d)},f.prototype.isExpandable=function(){if(this.showingValueForOpenedParent)return!0;var d=this.displayedGroupNode,y=this.columnModel.isPivotMode()&&d.leafGroup,T=d.isExpandable()&&!d.footer&&!y;if(!T)return!1;var M=this.params.column,U=M!=null&&typeof M.getColDef().showRowGroup=="string";if(U){var X=this.isShowRowGroupForThisRow();return X}return!0},f.prototype.showExpandAndContractIcons=function(){var d=this,y=d.params,T=d.displayedGroupNode,M=d.columnModel,U=y.node,X=this.isExpandable();if(X){var Se=this.showingValueForOpenedParent?!0:U.expanded;this.comp.setExpandedDisplayed(Se),this.comp.setContractedDisplayed(!Se)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);var Pe=M.isPivotMode(),at=Pe&&T.leafGroup,Lt=X&&!at,Kt=U.footer&&U.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",Lt),this.comp.addOrRemoveCssClass("ag-row-group",Lt),Pe?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",at):Kt||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!Lt)},f.prototype.onRowNodeIsExpandableChanged=function(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()},f.prototype.setupIndent=function(){var d=this.params.node,y=this.params.suppressPadding;y||(this.addManagedListener(d,Va.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())},f.prototype.setIndent=function(){if(!this.gridOptionsWrapper.isGroupHideOpenParents()){var d=this.params,y=d.node,T=!!d.colDef,M=this.gridOptionsWrapper.isTreeData(),U=!T||M||d.colDef.showRowGroup===!0,X=U?y.uiLevel:0,Se=d.padding>=0;Se&&Ie(function(){return console.warn("AG Grid: cellRendererParams.padding no longer works, it was deprecated in since v14.2 and removed in v26, configuring padding for groupCellRenderer should be done with Sass variables and themes. Please see the AG Grid documentation page for Themes, in particular the property $row-group-indent-size.")},"groupCellRenderer->doDeprecatedWay"),this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+X,this.comp.addOrRemoveCssClass(this.indentClass,!0)}},f.prototype.addFullWidthRowDraggerIfNeeded=function(){var d=this;if(!(!this.params.fullWidth||!this.params.rowDrag)){var y=new i2(function(){return d.params.value},this.params.node);this.createManagedBean(y,this.context),this.eGui.insertAdjacentElement("afterbegin",y.getGui())}},f.prototype.isUserWantsSelected=function(){var d=this.params.checkbox;return typeof d=="function"?d(this.params):d===!0},f.prototype.addCheckboxIfNeeded=function(){var d=this,y=this.displayedGroupNode,T=this.isUserWantsSelected()&&!y.footer&&!y.rowPinned&&!y.detail;if(T){var M=new B7;this.getContext().createBean(M),M.init({rowNode:y,column:this.params.column}),this.eCheckbox.appendChild(M.getGui()),this.addDestroyFunc(function(){return d.getContext().destroyBean(M)})}this.comp.setCheckboxVisible(T)},f.prototype.onKeyDown=function(d){var y=d.key===sn.ENTER;if(!(!y||this.params.suppressEnterExpand)){var T=this.params.column&&this.params.column.isCellEditable(this.params.node);T||this.onExpandOrContract(d)}},f.prototype.onCellDblClicked=function(d){if(!mi(d)){var y=Fr(this.eExpanded,d)||Fr(this.eContracted,d);y||this.onExpandOrContract(d)}},DE([ie("expressionService")],f.prototype,"expressionService",void 0),DE([ie("valueFormatterService")],f.prototype,"valueFormatterService",void 0),DE([ie("columnModel")],f.prototype,"columnModel",void 0),DE([ie("userComponentFactory")],f.prototype,"userComponentFactory",void 0),DE([ie("gridOptions")],f.prototype,"gridOptions",void 0),f}(Qi);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6126,7 +6126,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var ci={propertyName:"dateComponent",cellRenderer:!1},es={propertyName:"headerComponent",cellRenderer:!1},Wl={propertyName:"headerGroupComponent",cellRenderer:!1},Pu={propertyName:"cellRenderer",cellRenderer:!0},Nh={propertyName:"cellEditor",cellRenderer:!1},BQe={propertyName:"innerRenderer",cellRenderer:!0},jni={propertyName:"loadingOverlayComponent",cellRenderer:!1},Gni={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Uni={propertyName:"tooltipComponent",cellRenderer:!1},zIe={propertyName:"filter",cellRenderer:!1},zni={propertyName:"floatingFilterComponent",cellRenderer:!1},Vni={propertyName:"toolPanel",cellRenderer:!1},Hni={propertyName:"statusPanel",cellRenderer:!1},Wni={propertyName:"fullWidthCellRenderer",cellRenderer:!0},qni={propertyName:"loadingCellRenderer",cellRenderer:!0},Yni={propertyName:"groupRowRenderer",cellRenderer:!0},Xni={propertyName:"detailCellRenderer",cellRenderer:!0};/** + */var ci={propertyName:"dateComponent",cellRenderer:!1},es={propertyName:"headerComponent",cellRenderer:!1},ql={propertyName:"headerGroupComponent",cellRenderer:!1},Pu={propertyName:"cellRenderer",cellRenderer:!0},Nh={propertyName:"cellEditor",cellRenderer:!1},BQe={propertyName:"innerRenderer",cellRenderer:!0},jni={propertyName:"loadingOverlayComponent",cellRenderer:!1},Gni={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Uni={propertyName:"tooltipComponent",cellRenderer:!1},zIe={propertyName:"filter",cellRenderer:!1},zni={propertyName:"floatingFilterComponent",cellRenderer:!1},Vni={propertyName:"toolPanel",cellRenderer:!1},Hni={propertyName:"statusPanel",cellRenderer:!1},Wni={propertyName:"fullWidthCellRenderer",cellRenderer:!0},qni={propertyName:"loadingCellRenderer",cellRenderer:!0},Yni={propertyName:"groupRowRenderer",cellRenderer:!0},Xni={propertyName:"detailCellRenderer",cellRenderer:!0};/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6136,7 +6136,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Jni=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),z7=function(P,f,d,y){var T=arguments.length,M=T<3?f:y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},GQe=function(P){Jni(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.getHeaderCompDetails=function(d,y){return this.getCompDetails(d,es,"agColumnHeader",y)},f.prototype.getHeaderGroupCompDetails=function(d){var y=d.columnGroup.getColGroupDef();return this.getCompDetails(y,Wl,"agColumnGroupHeader",d)},f.prototype.getFullWidthCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Wni,null,d,!0)},f.prototype.getFullWidthLoadingCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,qni,"agLoadingCellRenderer",d,!0)},f.prototype.getFullWidthGroupCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Yni,"agGroupRowRenderer",d,!0)},f.prototype.getFullWidthDetailCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Xni,"agDetailCellRenderer",d,!0)},f.prototype.getInnerRendererDetails=function(d,y){return this.getCompDetails(d,BQe,null,y)},f.prototype.getFullWidthGroupRowInnerCellRenderer=function(d,y){return this.getCompDetails(d,BQe,null,y)},f.prototype.getCellRendererDetails=function(d,y){return this.getCompDetails(d,Pu,null,y)},f.prototype.getCellEditorDetails=function(d,y){return this.getCompDetails(d,Nh,"agCellEditor",y,!0)},f.prototype.getFilterDetails=function(d,y,T){return this.getCompDetails(d,zIe,T,y,!0)},f.prototype.getDateCompDetails=function(d){return this.getCompDetails(this.gridOptions,ci,"agDateInput",d,!0)},f.prototype.getLoadingOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,jni,"agLoadingOverlay",d,!0)},f.prototype.getNoRowsOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,Gni,"agNoRowsOverlay",d,!0)},f.prototype.getTooltipCompDetails=function(d){return this.getCompDetails(d.colDef,Uni,"agTooltipComponent",d,!0)},f.prototype.getSetFilterCellRendererDetails=function(d,y){return this.getCompDetails(d,Pu,null,y)},f.prototype.getFloatingFilterCompDetails=function(d,y,T){return this.getCompDetails(d,zni,T,y)},f.prototype.getToolPanelCompDetails=function(d,y){return this.getCompDetails(d,Vni,null,y,!0)},f.prototype.getStatusPanelCompDetails=function(d,y){return this.getCompDetails(d,Hni,null,y,!0)},f.prototype.getCompDetails=function(d,y,T,M,U){var X=this;U===void 0&&(U=!1);var Se=y.propertyName,Pe=y.cellRenderer,at=this.getCompKeys(d,y,M),Lt=at.compName,Kt=at.jsComp,_i=at.fwComp,Si=at.paramsFromSelector,Ji=at.popupFromSelector,cr=at.popupPositionFromSelector,kr=function(to){var ol=X.userComponentRegistry.retrieve(to);ol&&(Kt=ol.componentFromFramework?void 0:ol.component,_i=ol.componentFromFramework?ol.component:void 0)};if(Lt!=null&&kr(Lt),Kt==null&&_i==null&&T!=null&&kr(T),Kt&&Pe&&!this.agComponentUtils.doesImplementIComponent(Kt)&&(Kt=this.agComponentUtils.adaptFunction(Se,Kt)),!Kt&&!_i){U&&console.error("Could not find component "+Lt+", did you forget to configure this component?");return}var Er=this.mergeParamsWithApplicationProvidedParams(d,y,M,Si),Vr=Kt==null,kn=Kt||_i;return{componentFromFramework:Vr,componentClass:kn,params:Er,type:y,popupFromSelector:Ji,popupPositionFromSelector:cr,newAgStackInstance:function(){return X.newAgStackInstance(kn,Vr,Er,y)}}},f.prototype.getCompKeys=function(d,y,T){var M=this,U=y.propertyName,X,Se,Pe,at,Lt,Kt;if(d){var _i=d,Si=_i[U+"Selector"],Ji=Si?Si(T):null,cr=function(Er,Vr){var kn=function(){var ol="AG Grid: As of v27, the property "+U+"Framework is deprecated. The property "+U+" can now be used for JavaScript AND Framework Components.";Ie(function(){return console.warn(ol)},"UserComponentFactory."+U+"FrameworkDeprecated")};if(typeof Er=="string")X=Er;else if(typeof Vr=="string")kn(),X=Vr;else if(Er!=null&&Er!==!0){var to=M.getFrameworkOverrides().isFrameworkComponent(Er);to?Pe=Er:Se=Er}else Vr!=null&&(kn(),Pe=Vr)};if(Ji){if(Ji.frameworkComponent!=null){var kr="AG Grid: As of v27, the return for "+U+"Selector has attributes [component, params] only. The attribute frameworkComponent is deprecated. You should now return back Framework Components using the 'component' attribute and the grid works out if it's a framework component or not.";Ie(function(){return console.warn(kr)},"UserComponentFactory."+U+"FrameworkSelectorDeprecated"),cr(Ji.frameworkComponent,void 0)}else cr(Ji.component,void 0);at=Ji.params,Lt=Ji.popup,Kt=Ji.popupPosition}else cr(_i[U],_i[U+"Framework"])}return{compName:X,jsComp:Se,fwComp:Pe,paramsFromSelector:at,popupFromSelector:Lt,popupPositionFromSelector:Kt}},f.prototype.newAgStackInstance=function(d,y,T,M){var U=M.propertyName,X=!y,Se;if(X)Se=new d;else{var Pe=this.componentMetadataProvider.retrieve(U);Se=this.frameworkComponentWrapper.wrap(d,Pe.mandatoryMethodList,Pe.optionalMethodList,M)}var at=this.initComponent(Se,T);return at==null?Dg.resolve(Se):at.then(function(){return Se})},f.prototype.mergeParamsWithApplicationProvidedParams=function(d,y,T,M){M===void 0&&(M=null);var U={context:this.gridOptionsWrapper.getContext(),columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};K(U,T);var X=d,Se=X&&X[y.propertyName+"Params"];if(typeof Se=="function"){var Pe=Se(T);K(U,Pe)}else typeof Se=="object"&&K(U,Se);return K(U,M),U},f.prototype.initComponent=function(d,y){if(this.context.createBean(d),d.init!=null)return d.init(y)},f.prototype.getDefaultFloatingFilterType=function(d){if(d==null)return null;var y=null,T=this.getCompKeys(d,zIe),M=T.compName,U=T.jsComp,X=T.fwComp;if(M)y=jQe.getFloatingFilterType(M);else{var Se=U==null&&X==null&&d.filter===!0;if(Se){var Pe=Yt.isRegistered(i.ModuleNames.SetFilterModule);y=Pe?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}}return y},z7([ie("gridOptions")],f.prototype,"gridOptions",void 0),z7([ie("agComponentUtils")],f.prototype,"agComponentUtils",void 0),z7([ie("componentMetadataProvider")],f.prototype,"componentMetadataProvider",void 0),z7([ie("userComponentRegistry")],f.prototype,"userComponentRegistry",void 0),z7([ge("frameworkComponentWrapper")],f.prototype,"frameworkComponentWrapper",void 0),f=z7([me("userComponentFactory")],f),f}(Qi);/** + */var Jni=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),z7=function(P,f,d,y){var T=arguments.length,M=T<3?f:y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},GQe=function(P){Jni(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.getHeaderCompDetails=function(d,y){return this.getCompDetails(d,es,"agColumnHeader",y)},f.prototype.getHeaderGroupCompDetails=function(d){var y=d.columnGroup.getColGroupDef();return this.getCompDetails(y,ql,"agColumnGroupHeader",d)},f.prototype.getFullWidthCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Wni,null,d,!0)},f.prototype.getFullWidthLoadingCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,qni,"agLoadingCellRenderer",d,!0)},f.prototype.getFullWidthGroupCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Yni,"agGroupRowRenderer",d,!0)},f.prototype.getFullWidthDetailCellRendererDetails=function(d){return this.getCompDetails(this.gridOptions,Xni,"agDetailCellRenderer",d,!0)},f.prototype.getInnerRendererDetails=function(d,y){return this.getCompDetails(d,BQe,null,y)},f.prototype.getFullWidthGroupRowInnerCellRenderer=function(d,y){return this.getCompDetails(d,BQe,null,y)},f.prototype.getCellRendererDetails=function(d,y){return this.getCompDetails(d,Pu,null,y)},f.prototype.getCellEditorDetails=function(d,y){return this.getCompDetails(d,Nh,"agCellEditor",y,!0)},f.prototype.getFilterDetails=function(d,y,T){return this.getCompDetails(d,zIe,T,y,!0)},f.prototype.getDateCompDetails=function(d){return this.getCompDetails(this.gridOptions,ci,"agDateInput",d,!0)},f.prototype.getLoadingOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,jni,"agLoadingOverlay",d,!0)},f.prototype.getNoRowsOverlayCompDetails=function(d){return this.getCompDetails(this.gridOptions,Gni,"agNoRowsOverlay",d,!0)},f.prototype.getTooltipCompDetails=function(d){return this.getCompDetails(d.colDef,Uni,"agTooltipComponent",d,!0)},f.prototype.getSetFilterCellRendererDetails=function(d,y){return this.getCompDetails(d,Pu,null,y)},f.prototype.getFloatingFilterCompDetails=function(d,y,T){return this.getCompDetails(d,zni,T,y)},f.prototype.getToolPanelCompDetails=function(d,y){return this.getCompDetails(d,Vni,null,y,!0)},f.prototype.getStatusPanelCompDetails=function(d,y){return this.getCompDetails(d,Hni,null,y,!0)},f.prototype.getCompDetails=function(d,y,T,M,U){var X=this;U===void 0&&(U=!1);var Se=y.propertyName,Pe=y.cellRenderer,at=this.getCompKeys(d,y,M),Lt=at.compName,Kt=at.jsComp,_i=at.fwComp,Si=at.paramsFromSelector,Ji=at.popupFromSelector,cr=at.popupPositionFromSelector,kr=function(to){var ol=X.userComponentRegistry.retrieve(to);ol&&(Kt=ol.componentFromFramework?void 0:ol.component,_i=ol.componentFromFramework?ol.component:void 0)};if(Lt!=null&&kr(Lt),Kt==null&&_i==null&&T!=null&&kr(T),Kt&&Pe&&!this.agComponentUtils.doesImplementIComponent(Kt)&&(Kt=this.agComponentUtils.adaptFunction(Se,Kt)),!Kt&&!_i){U&&console.error("Could not find component "+Lt+", did you forget to configure this component?");return}var Er=this.mergeParamsWithApplicationProvidedParams(d,y,M,Si),Vr=Kt==null,kn=Kt||_i;return{componentFromFramework:Vr,componentClass:kn,params:Er,type:y,popupFromSelector:Ji,popupPositionFromSelector:cr,newAgStackInstance:function(){return X.newAgStackInstance(kn,Vr,Er,y)}}},f.prototype.getCompKeys=function(d,y,T){var M=this,U=y.propertyName,X,Se,Pe,at,Lt,Kt;if(d){var _i=d,Si=_i[U+"Selector"],Ji=Si?Si(T):null,cr=function(Er,Vr){var kn=function(){var ol="AG Grid: As of v27, the property "+U+"Framework is deprecated. The property "+U+" can now be used for JavaScript AND Framework Components.";Ie(function(){return console.warn(ol)},"UserComponentFactory."+U+"FrameworkDeprecated")};if(typeof Er=="string")X=Er;else if(typeof Vr=="string")kn(),X=Vr;else if(Er!=null&&Er!==!0){var to=M.getFrameworkOverrides().isFrameworkComponent(Er);to?Pe=Er:Se=Er}else Vr!=null&&(kn(),Pe=Vr)};if(Ji){if(Ji.frameworkComponent!=null){var kr="AG Grid: As of v27, the return for "+U+"Selector has attributes [component, params] only. The attribute frameworkComponent is deprecated. You should now return back Framework Components using the 'component' attribute and the grid works out if it's a framework component or not.";Ie(function(){return console.warn(kr)},"UserComponentFactory."+U+"FrameworkSelectorDeprecated"),cr(Ji.frameworkComponent,void 0)}else cr(Ji.component,void 0);at=Ji.params,Lt=Ji.popup,Kt=Ji.popupPosition}else cr(_i[U],_i[U+"Framework"])}return{compName:X,jsComp:Se,fwComp:Pe,paramsFromSelector:at,popupFromSelector:Lt,popupPositionFromSelector:Kt}},f.prototype.newAgStackInstance=function(d,y,T,M){var U=M.propertyName,X=!y,Se;if(X)Se=new d;else{var Pe=this.componentMetadataProvider.retrieve(U);Se=this.frameworkComponentWrapper.wrap(d,Pe.mandatoryMethodList,Pe.optionalMethodList,M)}var at=this.initComponent(Se,T);return at==null?Dg.resolve(Se):at.then(function(){return Se})},f.prototype.mergeParamsWithApplicationProvidedParams=function(d,y,T,M){M===void 0&&(M=null);var U={context:this.gridOptionsWrapper.getContext(),columnApi:this.gridOptionsWrapper.getColumnApi(),api:this.gridOptionsWrapper.getApi()};K(U,T);var X=d,Se=X&&X[y.propertyName+"Params"];if(typeof Se=="function"){var Pe=Se(T);K(U,Pe)}else typeof Se=="object"&&K(U,Se);return K(U,M),U},f.prototype.initComponent=function(d,y){if(this.context.createBean(d),d.init!=null)return d.init(y)},f.prototype.getDefaultFloatingFilterType=function(d){if(d==null)return null;var y=null,T=this.getCompKeys(d,zIe),M=T.compName,U=T.jsComp,X=T.fwComp;if(M)y=jQe.getFloatingFilterType(M);else{var Se=U==null&&X==null&&d.filter===!0;if(Se){var Pe=Yt.isRegistered(i.ModuleNames.SetFilterModule);y=Pe?"agSetColumnFloatingFilter":"agTextColumnFloatingFilter"}}return y},z7([ie("gridOptions")],f.prototype,"gridOptions",void 0),z7([ie("agComponentUtils")],f.prototype,"agComponentUtils",void 0),z7([ie("componentMetadataProvider")],f.prototype,"componentMetadataProvider",void 0),z7([ie("userComponentRegistry")],f.prototype,"userComponentRegistry",void 0),z7([ge("frameworkComponentWrapper")],f.prototype,"frameworkComponentWrapper",void 0),f=z7([me("userComponentFactory")],f),f}(Qi);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6258,7 +6258,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Xsi=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),Jsi=function(P,f){var d=typeof Symbol=="function"&&P[Symbol.iterator];if(!d)return P;var y=d.call(P),T,M=[],U;try{for(;(f===void 0||f-- >0)&&!(T=y.next()).done;)M.push(T.value)}catch(X){U={error:X}}finally{try{T&&!T.done&&(d=y.return)&&d.call(y)}finally{if(U)throw U.error}}return M},Ksi=function(){for(var P=[],f=0;f=0;return Kt?M:T}return T},f.prototype.setAnimateFlags=function(d){if(d){var y=t(this.rowNode.oldRowTop);this.slideRowIn=y,this.fadeRowIn=!y}else this.slideRowIn=!1,this.fadeRowIn=!1},f.prototype.isEditing=function(){return this.editingRow},f.prototype.stopRowEditing=function(d){this.stopEditing(d)},f.prototype.isFullWidth=function(){return this.rowType!==C_.Normal},f.prototype.getRowType=function(){return this.rowType},f.prototype.refreshFullWidth=function(){var d=this,y=function(Pe,at){if(!Pe)return!0;var Lt=Pe.rowComp.getFullWidthCellRenderer();if(!Lt||!Lt.refresh)return!1;var Kt=d.createFullWidthParams(Pe.element,at),_i=Lt.refresh(Kt);return _i},T=y(this.fullWidthGui,null),M=y(this.centerGui,null),U=y(this.leftGui,Fe.PINNED_LEFT),X=y(this.rightGui,Fe.PINNED_RIGHT),Se=T&&M&&U&&X;return Se},f.prototype.addListeners=function(){this.addManagedListener(this.rowNode,Va.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_ROW_SELECTED,this.onRowSelected.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));var d=this.beans.eventService;this.addManagedListener(d,ai.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(d,ai.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(d,ai.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(d,ai.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(d,ai.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(d,ai.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(d,ai.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(d,ai.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()},f.prototype.onColumnMoved=function(){this.updateColumnLists()},f.prototype.addListenersForCellComps=function(){var d=this;this.addManagedListener(this.rowNode,Va.EVENT_ROW_INDEX_CHANGED,function(){d.getAllCellCtrls().forEach(function(y){return y.onRowIndexChanged()})}),this.addManagedListener(this.rowNode,Va.EVENT_CELL_CHANGED,function(y){d.getAllCellCtrls().forEach(function(T){return T.onCellChanged(y)})})},f.prototype.onRowNodeDataChanged=function(d){this.getAllCellCtrls().forEach(function(y){return y.refreshCell({suppressFlash:!d.update,newData:!d.update})}),this.onRowSelected(),this.postProcessCss()},f.prototype.onRowNodeCellChanged=function(){this.postProcessCss()},f.prototype.postProcessCss=function(){this.setStylesFromGridOptions(),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()},f.prototype.onRowNodeHighlightChanged=function(){var d=this.rowNode.highlighted;this.allRowGuis.forEach(function(y){var T=d===i.RowHighlightPosition.Above,M=d===i.RowHighlightPosition.Below;y.rowComp.addOrRemoveCssClass("ag-row-highlight-above",T),y.rowComp.addOrRemoveCssClass("ag-row-highlight-below",M)})},f.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()},f.prototype.postProcessRowDragging=function(){var d=this.rowNode.dragging;this.allRowGuis.forEach(function(y){return y.rowComp.addOrRemoveCssClass("ag-row-dragging",d)})},f.prototype.updateExpandedCss=function(){var d=this.rowNode.isExpandable(),y=this.rowNode.expanded==!0;this.allRowGuis.forEach(function(T){T.rowComp.addOrRemoveCssClass("ag-row-group",d),T.rowComp.addOrRemoveCssClass("ag-row-group-expanded",d&&y),T.rowComp.addOrRemoveCssClass("ag-row-group-contracted",d&&!y),xr(T.element,d&&y)})},f.prototype.onDisplayedColumnsChanged=function(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()},f.prototype.onVirtualColumnsChanged=function(){this.updateColumnLists()},f.prototype.getRowPosition=function(){return{rowPinned:e(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}},f.prototype.onKeyboardNavigate=function(d){var y=this.allRowGuis.find(function(Pe){return Pe.element.contains(d.target)}),T=y?y.element:null,M=T===d.target;if(M){var U=this.rowNode,X=this.beans.focusService.getFocusedCell(),Se={rowIndex:U.rowIndex,rowPinned:U.rowPinned,column:X&&X.column};this.beans.navigationService.navigateToNextCell(d,d.key,Se,!0),d.preventDefault()}},f.prototype.onTabKeyDown=function(d){if(!(d.defaultPrevented||mi(d))){var y=this.allRowGuis.find(function(X){return X.element.contains(d.target)}),T=y?y.element:null,M=T===d.target,U=null;M||(U=this.beans.focusService.findNextFocusableElement(T,!1,d.shiftKey)),(this.isFullWidth()&&M||!U)&&this.beans.navigationService.onTabKeyDown(this,d)}},f.prototype.onFullWidthRowFocused=function(d){var y,T=this.rowNode,M=this.isFullWidth()&&d.rowIndex===T.rowIndex&&d.rowPinned==T.rowPinned,U=this.fullWidthGui?this.fullWidthGui.element:(y=this.centerGui)===null||y===void 0?void 0:y.element;U&&(U.classList.toggle("ag-full-width-focus",M),M&&U.focus({preventScroll:!0}))},f.prototype.refreshCell=function(d){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,d),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,d),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,d),this.updateColumnLists()},f.prototype.removeCellCtrl=function(d,y){var T={list:[],map:{}};return d.list.forEach(function(M){M!==y&&(T.list.push(M),T.map[M.getInstanceId()]=M)}),T},f.prototype.onMouseEvent=function(d,y){switch(d){case"dblclick":this.onRowDblClick(y);break;case"click":this.onRowClick(y);break;case"touchstart":case"mousedown":this.onRowMouseDown(y);break}},f.prototype.createRowEvent=function(d,y){return{type:d,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),event:y}},f.prototype.createRowEventWithSource=function(d,y){var T=this.createRowEvent(d,y);return T.source=this,T},f.prototype.onRowDblClick=function(d){if(!mi(d)){var y=this.createRowEventWithSource(ai.EVENT_ROW_DOUBLE_CLICKED,d);this.beans.eventService.dispatchEvent(y)}},f.prototype.onRowMouseDown=function(d){if(this.lastMouseDownOnDragger=Og(d.target,"ag-row-drag",3),!!this.isFullWidth()){var y=this.rowNode,T=this.beans.columnModel;this.beans.focusService.setFocusedCell(y.rowIndex,T.getAllDisplayedColumns()[0],y.rowPinned,!0)}},f.prototype.onRowClick=function(d){var y=mi(d)||this.lastMouseDownOnDragger;if(!y){var T=this.createRowEventWithSource(ai.EVENT_ROW_CLICKED,d);this.beans.eventService.dispatchEvent(T);var M=d.ctrlKey||d.metaKey,U=d.shiftKey,X=this.beans.gridOptionsWrapper.isGroupSelectsChildren();if(!(X&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.beans.gridOptionsWrapper.isRowSelection()||this.beans.gridOptionsWrapper.isSuppressRowClickSelection())){var Se=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick(),Pe=!this.beans.gridOptionsWrapper.isSuppressRowDeselection();if(this.rowNode.isSelected())Se?this.rowNode.setSelectedParams({newValue:!1}):M?Pe&&this.rowNode.setSelectedParams({newValue:!1}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!U,rangeSelect:U});else{var at=Se?!1:!M;this.rowNode.setSelectedParams({newValue:!0,clearSelection:at,rangeSelect:U})}}}},f.prototype.setupDetailRowAutoHeight=function(d){var y=this;if(this.rowType===C_.FullWidthDetail&&this.beans.gridOptionsWrapper.isDetailRowAutoHeight()){var T=function(){var U=d.clientHeight;if(U!=null&&U>0){var X=function(){y.rowNode.setRowHeight(U),y.beans.clientSideRowModel?y.beans.clientSideRowModel.onRowHeightChanged():y.beans.serverSideRowModel&&y.beans.serverSideRowModel.onRowHeightChanged()};y.beans.frameworkOverrides.setTimeout(X,0)}},M=this.beans.resizeObserverService.observeResize(d,T);this.addDestroyFunc(M),T()}},f.prototype.createFullWidthParams=function(d,y){var T=this,M={fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),eGridCell:d,eParentOfValue:d,pinned:y,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:function(U,X,Se,Pe){return T.addFullWidthRowDragging(U,X,Se,Pe)}};return M},f.prototype.addFullWidthRowDragging=function(d,y,T,M){if(T===void 0&&(T=""),!!this.isFullWidth()){var U=new i2(function(){return T},this.rowNode,void 0,d,y,M);this.createManagedBean(U,this.beans.context)}},f.prototype.onUiLevelChanged=function(){var d=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=d){var y="ag-row-level-"+d,T="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(function(M){M.rowComp.addOrRemoveCssClass(y,!0),M.rowComp.addOrRemoveCssClass(T,!1)})}this.rowLevel=d},f.prototype.isFirstRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()},f.prototype.isLastRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()},f.prototype.onModelUpdated=function(){this.refreshFirstAndLastRowStyles()},f.prototype.refreshFirstAndLastRowStyles=function(){var d=this.isFirstRowOnPage(),y=this.isLastRowOnPage();this.firstRowOnPage!==d&&(this.firstRowOnPage=d,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-first",d)})),this.lastRowOnPage!==y&&(this.lastRowOnPage=y,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-last",y)}))},f.prototype.stopEditing=function(d){d===void 0&&(d=!1);var y=this.getAllCellCtrls().map(function(M){return M.stopEditing(d)});if(this.editingRow){if(!d&&y.some(function(M){return M})){var T=this.createRowEvent(ai.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(T)}this.setEditingRow(!1)}},f.prototype.setInlineEditingCss=function(d){this.allRowGuis.forEach(function(y){y.rowComp.addOrRemoveCssClass("ag-row-inline-editing",d),y.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!d)})},f.prototype.setEditingRow=function(d){this.editingRow=d,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-editing",d)});var y=d?this.createRowEvent(ai.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ai.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(y)},f.prototype.startRowEditing=function(d,y,T,M){d===void 0&&(d=null),y===void 0&&(y=null),T===void 0&&(T=null),M===void 0&&(M=null),!this.editingRow&&(this.getAllCellCtrls().forEach(function(U){var X=U===T;X?U.startEditing(d,y,X,M):U.startEditing(null,null,X,M)}),this.setEditingRow(!0))},f.prototype.getAllCellCtrls=function(){var d=Ksi(this.centerCellCtrls.list,this.leftCellCtrls.list,this.rightCellCtrls.list);return d},f.prototype.postProcessClassesFromGridOptions=function(){var d=this,y=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!y||!y.length||y.forEach(function(T){d.allRowGuis.forEach(function(M){return M.rowComp.addOrRemoveCssClass(T,!0)})})},f.prototype.postProcessRowClassRules=function(){var d=this;this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,function(y){d.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass(y,!0)})},function(y){d.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass(y,!1)})})},f.prototype.setStylesFromGridOptions=function(){var d=this.processStylesFromGridOptions();this.allRowGuis.forEach(function(y){return y.rowComp.setUserStyles(d)})},f.prototype.getRowBusinessKey=function(){var d=this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();if(typeof d=="function")return d(this.rowNode)},f.prototype.getPinnedForContainer=function(d){var y=d===i.RowContainerType.LEFT?Fe.PINNED_LEFT:d===i.RowContainerType.RIGHT?Fe.PINNED_RIGHT:null;return y},f.prototype.getInitialRowClasses=function(d){var y=this.getPinnedForContainer(d),T={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeRowIn,rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:y};return this.beans.rowCssClassCalculator.getInitialRowClasses(T)},f.prototype.processStylesFromGridOptions=function(){var d=this.beans.gridOptionsWrapper.getRowStyle();if(d&&typeof d=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}var y=this.beans.gridOptionsWrapper.getRowStyleFunc(),T;if(y){var M={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};T=y(M)}return Object.assign({},d,T)},f.prototype.onRowSelected=function(){var d=this,y=!!this.rowNode.isSelected();this.allRowGuis.forEach(function(T){T.rowComp.addOrRemoveCssClass("ag-row-selected",y),Zi(T.element,y?!0:void 0);var M=d.createAriaLabel();mt(T.element,M??"")})},f.prototype.createAriaLabel=function(){var d=this.rowNode.isSelected();if(!(d&&this.beans.gridOptionsWrapper.isSuppressRowDeselection())){var y=this.beans.gridOptionsWrapper.getLocaleTextFunc(),T=y(d?"ariaRowDeselect":"ariaRowSelect","Press SPACE to "+(d?"deselect":"select")+" this row.");return T}},f.prototype.isUseAnimationFrameForCreate=function(){return this.useAnimationFrameForCreate},f.prototype.addHoverFunctionality=function(d){var y=this;this.active&&(this.addManagedListener(d,"mouseenter",function(){return y.rowNode.onMouseEnter()}),this.addManagedListener(d,"mouseleave",function(){return y.rowNode.onMouseLeave()}),this.addManagedListener(this.rowNode,Va.EVENT_MOUSE_ENTER,function(){y.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()||d.classList.add("ag-row-hover")}),this.addManagedListener(this.rowNode,Va.EVENT_MOUSE_LEAVE,function(){d.classList.remove("ag-row-hover")}))},f.prototype.roundRowTopToBounds=function(d){var y=this.beans.ctrlsService.getGridBodyCtrl(),T=y.getScrollFeature().getVScrollPosition(),M=this.applyPaginationOffset(T.top,!0)-100,U=this.applyPaginationOffset(T.bottom,!0)+100;return Math.min(Math.max(M,d),U)},f.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},f.prototype.onRowHeightChanged=function(){if(this.rowNode.rowHeight!=null){var d=this.rowNode.rowHeight,y=this.beans.gridOptionsWrapper.getDefaultRowHeight(),T=this.beans.gridOptionsWrapper.isGetRowHeightFunction(),M=T?this.beans.gridOptionsWrapper.getRowHeightForNode(this.rowNode).height:void 0,U=M?Math.min(y,M)-2+"px":void 0;this.allRowGuis.forEach(function(X){X.element.style.height=d+"px",U&&X.element.style.setProperty("--ag-line-height",U)})}},f.prototype.addEventListener=function(d,y){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ai.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved is now called "+ai.EVENT_VIRTUAL_ROW_REMOVED)),P.prototype.addEventListener.call(this,d,y)},f.prototype.removeEventListener=function(d,y){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ai.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+ai.EVENT_VIRTUAL_ROW_REMOVED)),P.prototype.removeEventListener.call(this,d,y)},f.prototype.destroyFirstPass=function(){this.active=!1,this.setupRemoveAnimation();var d=this.createRowEvent(ai.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(d),this.beans.eventService.dispatchEvent(d),P.prototype.destroy.call(this)},f.prototype.setupRemoveAnimation=function(){var d=this.rowNode.rowTop!=null;if(d){var y=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(y)}else this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)})},f.prototype.destroySecondPass=function(){this.allRowGuis.length=0;var d=function(y){return y.list.forEach(function(T){return T.destroy()}),{list:[],map:{}}};this.centerCellCtrls=d(this.centerCellCtrls),this.leftCellCtrls=d(this.leftCellCtrls),this.rightCellCtrls=d(this.rightCellCtrls)},f.prototype.setFocusedClasses=function(){var d=this;this.allRowGuis.forEach(function(y){y.rowComp.addOrRemoveCssClass("ag-row-focus",d.rowFocused),y.rowComp.addOrRemoveCssClass("ag-row-no-focus",!d.rowFocused)})},f.prototype.onCellFocusChanged=function(){var d=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);d!==this.rowFocused&&(this.rowFocused=d,this.setFocusedClasses()),!d&&this.editingRow&&this.stopEditing(!1)},f.prototype.onPaginationChanged=function(){var d=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==d&&(this.paginationPage=d,this.onTopChanged()),this.refreshFirstAndLastRowStyles()},f.prototype.onTopChanged=function(){this.setRowTop(this.rowNode.rowTop)},f.prototype.onPaginationPixelOffsetChanged=function(){this.onTopChanged()},f.prototype.applyPaginationOffset=function(d,y){if(y===void 0&&(y=!1),this.rowNode.isRowPinned())return d;var T=this.beans.paginationProxy.getPixelOffset(),M=y?1:-1;return d+T*M},f.prototype.setRowTop=function(d){if(!this.printLayout&&t(d)){var y=this.applyPaginationOffset(d),T=this.rowNode.isRowPinned()?y:this.beans.rowContainerHeightService.getRealPixelPosition(y),M=T+"px";this.setRowTopStyle(M)}},f.prototype.getInitialRowTop=function(){return this.initialTop},f.prototype.getInitialTransform=function(){return this.initialTransform},f.prototype.setInitialRowTop=function(){if(this.printLayout)return"";var d=this.slideRowIn?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,y=this.applyPaginationOffset(d),T=this.rowNode.isRowPinned()?y:this.beans.rowContainerHeightService.getRealPixelPosition(y),M=T+"px",U=this.beans.gridOptionsWrapper.isSuppressRowTransform();U?this.initialTop=M:this.initialTransform="translateY("+M+")"},f.prototype.setRowTopStyle=function(d){var y=this.beans.gridOptionsWrapper.isSuppressRowTransform();this.allRowGuis.forEach(function(T){return y?T.rowComp.setTop(d):T.rowComp.setTransform("translateY("+d+")")})},f.prototype.getRowNode=function(){return this.rowNode},f.prototype.getCellCtrl=function(d){var y=null;return this.getAllCellCtrls().forEach(function(T){T.getColumn()==d&&(y=T)}),y!=null||this.getAllCellCtrls().forEach(function(T){T.getColSpanningList().indexOf(d)>=0&&(y=T)}),y},f.prototype.onRowIndexChanged=function(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())},f.prototype.updateRowIndexes=function(){var d=this.rowNode.getRowIndexString(),y=this.beans.headerNavigationService.getHeaderRowCount(),T=this.rowNode.rowIndex%2===0,M=y+this.rowNode.rowIndex+1;this.allRowGuis.forEach(function(U){U.rowComp.setRowIndex(d),U.rowComp.addOrRemoveCssClass("ag-row-even",T),U.rowComp.addOrRemoveCssClass("ag-row-odd",!T),Zs(U.element,M)})},f.prototype.getPinnedLeftRowElement=function(){return this.leftGui?this.leftGui.element:void 0},f.prototype.getPinnedRightRowElement=function(){return this.rightGui?this.rightGui.element:void 0},f.prototype.getBodyRowElement=function(){return this.centerGui?this.centerGui.element:void 0},f.prototype.getFullWidthRowElement=function(){return this.fullWidthGui?this.fullWidthGui.element:void 0},f.DOM_DATA_KEY_ROW_CTRL="renderedRow",f}(Qi);/** + */var Xsi=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),Jsi=function(P,f){var d=typeof Symbol=="function"&&P[Symbol.iterator];if(!d)return P;var y=d.call(P),T,M=[],U;try{for(;(f===void 0||f-- >0)&&!(T=y.next()).done;)M.push(T.value)}catch(X){U={error:X}}finally{try{T&&!T.done&&(d=y.return)&&d.call(y)}finally{if(U)throw U.error}}return M},Ksi=function(){for(var P=[],f=0;f=0;return Kt?M:T}return T},f.prototype.setAnimateFlags=function(d){if(d){var y=t(this.rowNode.oldRowTop);this.slideRowIn=y,this.fadeRowIn=!y}else this.slideRowIn=!1,this.fadeRowIn=!1},f.prototype.isEditing=function(){return this.editingRow},f.prototype.stopRowEditing=function(d){this.stopEditing(d)},f.prototype.isFullWidth=function(){return this.rowType!==C_.Normal},f.prototype.getRowType=function(){return this.rowType},f.prototype.refreshFullWidth=function(){var d=this,y=function(Pe,at){if(!Pe)return!0;var Lt=Pe.rowComp.getFullWidthCellRenderer();if(!Lt||!Lt.refresh)return!1;var Kt=d.createFullWidthParams(Pe.element,at),_i=Lt.refresh(Kt);return _i},T=y(this.fullWidthGui,null),M=y(this.centerGui,null),U=y(this.leftGui,Fe.PINNED_LEFT),X=y(this.rightGui,Fe.PINNED_RIGHT),Se=T&&M&&U&&X;return Se},f.prototype.addListeners=function(){this.addManagedListener(this.rowNode,Va.EVENT_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_ROW_SELECTED,this.onRowSelected.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,Va.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));var d=this.beans.eventService;this.addManagedListener(d,ai.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(d,ai.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(d,ai.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(d,ai.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(d,ai.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(d,ai.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(d,ai.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(d,ai.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()},f.prototype.onColumnMoved=function(){this.updateColumnLists()},f.prototype.addListenersForCellComps=function(){var d=this;this.addManagedListener(this.rowNode,Va.EVENT_ROW_INDEX_CHANGED,function(){d.getAllCellCtrls().forEach(function(y){return y.onRowIndexChanged()})}),this.addManagedListener(this.rowNode,Va.EVENT_CELL_CHANGED,function(y){d.getAllCellCtrls().forEach(function(T){return T.onCellChanged(y)})})},f.prototype.onRowNodeDataChanged=function(d){this.getAllCellCtrls().forEach(function(y){return y.refreshCell({suppressFlash:!d.update,newData:!d.update})}),this.onRowSelected(),this.postProcessCss()},f.prototype.onRowNodeCellChanged=function(){this.postProcessCss()},f.prototype.postProcessCss=function(){this.setStylesFromGridOptions(),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()},f.prototype.onRowNodeHighlightChanged=function(){var d=this.rowNode.highlighted;this.allRowGuis.forEach(function(y){var T=d===i.RowHighlightPosition.Above,M=d===i.RowHighlightPosition.Below;y.rowComp.addOrRemoveCssClass("ag-row-highlight-above",T),y.rowComp.addOrRemoveCssClass("ag-row-highlight-below",M)})},f.prototype.onRowNodeDraggingChanged=function(){this.postProcessRowDragging()},f.prototype.postProcessRowDragging=function(){var d=this.rowNode.dragging;this.allRowGuis.forEach(function(y){return y.rowComp.addOrRemoveCssClass("ag-row-dragging",d)})},f.prototype.updateExpandedCss=function(){var d=this.rowNode.isExpandable(),y=this.rowNode.expanded==!0;this.allRowGuis.forEach(function(T){T.rowComp.addOrRemoveCssClass("ag-row-group",d),T.rowComp.addOrRemoveCssClass("ag-row-group-expanded",d&&y),T.rowComp.addOrRemoveCssClass("ag-row-group-contracted",d&&!y),wr(T.element,d&&y)})},f.prototype.onDisplayedColumnsChanged=function(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()},f.prototype.onVirtualColumnsChanged=function(){this.updateColumnLists()},f.prototype.getRowPosition=function(){return{rowPinned:e(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}},f.prototype.onKeyboardNavigate=function(d){var y=this.allRowGuis.find(function(Pe){return Pe.element.contains(d.target)}),T=y?y.element:null,M=T===d.target;if(M){var U=this.rowNode,X=this.beans.focusService.getFocusedCell(),Se={rowIndex:U.rowIndex,rowPinned:U.rowPinned,column:X&&X.column};this.beans.navigationService.navigateToNextCell(d,d.key,Se,!0),d.preventDefault()}},f.prototype.onTabKeyDown=function(d){if(!(d.defaultPrevented||mi(d))){var y=this.allRowGuis.find(function(X){return X.element.contains(d.target)}),T=y?y.element:null,M=T===d.target,U=null;M||(U=this.beans.focusService.findNextFocusableElement(T,!1,d.shiftKey)),(this.isFullWidth()&&M||!U)&&this.beans.navigationService.onTabKeyDown(this,d)}},f.prototype.onFullWidthRowFocused=function(d){var y,T=this.rowNode,M=this.isFullWidth()&&d.rowIndex===T.rowIndex&&d.rowPinned==T.rowPinned,U=this.fullWidthGui?this.fullWidthGui.element:(y=this.centerGui)===null||y===void 0?void 0:y.element;U&&(U.classList.toggle("ag-full-width-focus",M),M&&U.focus({preventScroll:!0}))},f.prototype.refreshCell=function(d){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,d),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,d),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,d),this.updateColumnLists()},f.prototype.removeCellCtrl=function(d,y){var T={list:[],map:{}};return d.list.forEach(function(M){M!==y&&(T.list.push(M),T.map[M.getInstanceId()]=M)}),T},f.prototype.onMouseEvent=function(d,y){switch(d){case"dblclick":this.onRowDblClick(y);break;case"click":this.onRowClick(y);break;case"touchstart":case"mousedown":this.onRowMouseDown(y);break}},f.prototype.createRowEvent=function(d,y){return{type:d,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.beans.gridOptionsWrapper.getContext(),api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),event:y}},f.prototype.createRowEventWithSource=function(d,y){var T=this.createRowEvent(d,y);return T.source=this,T},f.prototype.onRowDblClick=function(d){if(!mi(d)){var y=this.createRowEventWithSource(ai.EVENT_ROW_DOUBLE_CLICKED,d);this.beans.eventService.dispatchEvent(y)}},f.prototype.onRowMouseDown=function(d){if(this.lastMouseDownOnDragger=Og(d.target,"ag-row-drag",3),!!this.isFullWidth()){var y=this.rowNode,T=this.beans.columnModel;this.beans.focusService.setFocusedCell(y.rowIndex,T.getAllDisplayedColumns()[0],y.rowPinned,!0)}},f.prototype.onRowClick=function(d){var y=mi(d)||this.lastMouseDownOnDragger;if(!y){var T=this.createRowEventWithSource(ai.EVENT_ROW_CLICKED,d);this.beans.eventService.dispatchEvent(T);var M=d.ctrlKey||d.metaKey,U=d.shiftKey,X=this.beans.gridOptionsWrapper.isGroupSelectsChildren();if(!(X&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.beans.gridOptionsWrapper.isRowSelection()||this.beans.gridOptionsWrapper.isSuppressRowClickSelection())){var Se=this.beans.gridOptionsWrapper.isRowMultiSelectWithClick(),Pe=!this.beans.gridOptionsWrapper.isSuppressRowDeselection();if(this.rowNode.isSelected())Se?this.rowNode.setSelectedParams({newValue:!1}):M?Pe&&this.rowNode.setSelectedParams({newValue:!1}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!U,rangeSelect:U});else{var at=Se?!1:!M;this.rowNode.setSelectedParams({newValue:!0,clearSelection:at,rangeSelect:U})}}}},f.prototype.setupDetailRowAutoHeight=function(d){var y=this;if(this.rowType===C_.FullWidthDetail&&this.beans.gridOptionsWrapper.isDetailRowAutoHeight()){var T=function(){var U=d.clientHeight;if(U!=null&&U>0){var X=function(){y.rowNode.setRowHeight(U),y.beans.clientSideRowModel?y.beans.clientSideRowModel.onRowHeightChanged():y.beans.serverSideRowModel&&y.beans.serverSideRowModel.onRowHeightChanged()};y.beans.frameworkOverrides.setTimeout(X,0)}},M=this.beans.resizeObserverService.observeResize(d,T);this.addDestroyFunc(M),T()}},f.prototype.createFullWidthParams=function(d,y){var T=this,M={fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsWrapper.getApi(),columnApi:this.beans.gridOptionsWrapper.getColumnApi(),context:this.beans.gridOptionsWrapper.getContext(),eGridCell:d,eParentOfValue:d,pinned:y,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:function(U,X,Se,Pe){return T.addFullWidthRowDragging(U,X,Se,Pe)}};return M},f.prototype.addFullWidthRowDragging=function(d,y,T,M){if(T===void 0&&(T=""),!!this.isFullWidth()){var U=new i2(function(){return T},this.rowNode,void 0,d,y,M);this.createManagedBean(U,this.beans.context)}},f.prototype.onUiLevelChanged=function(){var d=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=d){var y="ag-row-level-"+d,T="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(function(M){M.rowComp.addOrRemoveCssClass(y,!0),M.rowComp.addOrRemoveCssClass(T,!1)})}this.rowLevel=d},f.prototype.isFirstRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()},f.prototype.isLastRowOnPage=function(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()},f.prototype.onModelUpdated=function(){this.refreshFirstAndLastRowStyles()},f.prototype.refreshFirstAndLastRowStyles=function(){var d=this.isFirstRowOnPage(),y=this.isLastRowOnPage();this.firstRowOnPage!==d&&(this.firstRowOnPage=d,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-first",d)})),this.lastRowOnPage!==y&&(this.lastRowOnPage=y,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-last",y)}))},f.prototype.stopEditing=function(d){d===void 0&&(d=!1);var y=this.getAllCellCtrls().map(function(M){return M.stopEditing(d)});if(this.editingRow){if(!d&&y.some(function(M){return M})){var T=this.createRowEvent(ai.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(T)}this.setEditingRow(!1)}},f.prototype.setInlineEditingCss=function(d){this.allRowGuis.forEach(function(y){y.rowComp.addOrRemoveCssClass("ag-row-inline-editing",d),y.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!d)})},f.prototype.setEditingRow=function(d){this.editingRow=d,this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-row-editing",d)});var y=d?this.createRowEvent(ai.EVENT_ROW_EDITING_STARTED):this.createRowEvent(ai.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(y)},f.prototype.startRowEditing=function(d,y,T,M){d===void 0&&(d=null),y===void 0&&(y=null),T===void 0&&(T=null),M===void 0&&(M=null),!this.editingRow&&(this.getAllCellCtrls().forEach(function(U){var X=U===T;X?U.startEditing(d,y,X,M):U.startEditing(null,null,X,M)}),this.setEditingRow(!0))},f.prototype.getAllCellCtrls=function(){var d=Ksi(this.centerCellCtrls.list,this.leftCellCtrls.list,this.rightCellCtrls.list);return d},f.prototype.postProcessClassesFromGridOptions=function(){var d=this,y=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!y||!y.length||y.forEach(function(T){d.allRowGuis.forEach(function(M){return M.rowComp.addOrRemoveCssClass(T,!0)})})},f.prototype.postProcessRowClassRules=function(){var d=this;this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,function(y){d.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass(y,!0)})},function(y){d.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass(y,!1)})})},f.prototype.setStylesFromGridOptions=function(){var d=this.processStylesFromGridOptions();this.allRowGuis.forEach(function(y){return y.rowComp.setUserStyles(d)})},f.prototype.getRowBusinessKey=function(){var d=this.beans.gridOptionsWrapper.getBusinessKeyForNodeFunc();if(typeof d=="function")return d(this.rowNode)},f.prototype.getPinnedForContainer=function(d){var y=d===i.RowContainerType.LEFT?Fe.PINNED_LEFT:d===i.RowContainerType.RIGHT?Fe.PINNED_RIGHT:null;return y},f.prototype.getInitialRowClasses=function(d){var y=this.getPinnedForContainer(d),T={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeRowIn,rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:y};return this.beans.rowCssClassCalculator.getInitialRowClasses(T)},f.prototype.processStylesFromGridOptions=function(){var d=this.beans.gridOptionsWrapper.getRowStyle();if(d&&typeof d=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}var y=this.beans.gridOptionsWrapper.getRowStyleFunc(),T;if(y){var M={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};T=y(M)}return Object.assign({},d,T)},f.prototype.onRowSelected=function(){var d=this,y=!!this.rowNode.isSelected();this.allRowGuis.forEach(function(T){T.rowComp.addOrRemoveCssClass("ag-row-selected",y),Zi(T.element,y?!0:void 0);var M=d.createAriaLabel();mt(T.element,M??"")})},f.prototype.createAriaLabel=function(){var d=this.rowNode.isSelected();if(!(d&&this.beans.gridOptionsWrapper.isSuppressRowDeselection())){var y=this.beans.gridOptionsWrapper.getLocaleTextFunc(),T=y(d?"ariaRowDeselect":"ariaRowSelect","Press SPACE to "+(d?"deselect":"select")+" this row.");return T}},f.prototype.isUseAnimationFrameForCreate=function(){return this.useAnimationFrameForCreate},f.prototype.addHoverFunctionality=function(d){var y=this;this.active&&(this.addManagedListener(d,"mouseenter",function(){return y.rowNode.onMouseEnter()}),this.addManagedListener(d,"mouseleave",function(){return y.rowNode.onMouseLeave()}),this.addManagedListener(this.rowNode,Va.EVENT_MOUSE_ENTER,function(){y.beans.gridOptionsWrapper.isSuppressRowHoverHighlight()||d.classList.add("ag-row-hover")}),this.addManagedListener(this.rowNode,Va.EVENT_MOUSE_LEAVE,function(){d.classList.remove("ag-row-hover")}))},f.prototype.roundRowTopToBounds=function(d){var y=this.beans.ctrlsService.getGridBodyCtrl(),T=y.getScrollFeature().getVScrollPosition(),M=this.applyPaginationOffset(T.top,!0)-100,U=this.applyPaginationOffset(T.bottom,!0)+100;return Math.min(Math.max(M,d),U)},f.prototype.getFrameworkOverrides=function(){return this.beans.frameworkOverrides},f.prototype.onRowHeightChanged=function(){if(this.rowNode.rowHeight!=null){var d=this.rowNode.rowHeight,y=this.beans.gridOptionsWrapper.getDefaultRowHeight(),T=this.beans.gridOptionsWrapper.isGetRowHeightFunction(),M=T?this.beans.gridOptionsWrapper.getRowHeightForNode(this.rowNode).height:void 0,U=M?Math.min(y,M)-2+"px":void 0;this.allRowGuis.forEach(function(X){X.element.style.height=d+"px",U&&X.element.style.setProperty("--ag-line-height",U)})}},f.prototype.addEventListener=function(d,y){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ai.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved is now called "+ai.EVENT_VIRTUAL_ROW_REMOVED)),P.prototype.addEventListener.call(this,d,y)},f.prototype.removeEventListener=function(d,y){(d==="renderedRowRemoved"||d==="rowRemoved")&&(d=ai.EVENT_VIRTUAL_ROW_REMOVED,console.warn("AG Grid: Since version 11, event renderedRowRemoved and rowRemoved is now called "+ai.EVENT_VIRTUAL_ROW_REMOVED)),P.prototype.removeEventListener.call(this,d,y)},f.prototype.destroyFirstPass=function(){this.active=!1,this.setupRemoveAnimation();var d=this.createRowEvent(ai.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(d),this.beans.eventService.dispatchEvent(d),P.prototype.destroy.call(this)},f.prototype.setupRemoveAnimation=function(){var d=this.rowNode.rowTop!=null;if(d){var y=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(y)}else this.allRowGuis.forEach(function(T){return T.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)})},f.prototype.destroySecondPass=function(){this.allRowGuis.length=0;var d=function(y){return y.list.forEach(function(T){return T.destroy()}),{list:[],map:{}}};this.centerCellCtrls=d(this.centerCellCtrls),this.leftCellCtrls=d(this.leftCellCtrls),this.rightCellCtrls=d(this.rightCellCtrls)},f.prototype.setFocusedClasses=function(){var d=this;this.allRowGuis.forEach(function(y){y.rowComp.addOrRemoveCssClass("ag-row-focus",d.rowFocused),y.rowComp.addOrRemoveCssClass("ag-row-no-focus",!d.rowFocused)})},f.prototype.onCellFocusChanged=function(){var d=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);d!==this.rowFocused&&(this.rowFocused=d,this.setFocusedClasses()),!d&&this.editingRow&&this.stopEditing(!1)},f.prototype.onPaginationChanged=function(){var d=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==d&&(this.paginationPage=d,this.onTopChanged()),this.refreshFirstAndLastRowStyles()},f.prototype.onTopChanged=function(){this.setRowTop(this.rowNode.rowTop)},f.prototype.onPaginationPixelOffsetChanged=function(){this.onTopChanged()},f.prototype.applyPaginationOffset=function(d,y){if(y===void 0&&(y=!1),this.rowNode.isRowPinned())return d;var T=this.beans.paginationProxy.getPixelOffset(),M=y?1:-1;return d+T*M},f.prototype.setRowTop=function(d){if(!this.printLayout&&t(d)){var y=this.applyPaginationOffset(d),T=this.rowNode.isRowPinned()?y:this.beans.rowContainerHeightService.getRealPixelPosition(y),M=T+"px";this.setRowTopStyle(M)}},f.prototype.getInitialRowTop=function(){return this.initialTop},f.prototype.getInitialTransform=function(){return this.initialTransform},f.prototype.setInitialRowTop=function(){if(this.printLayout)return"";var d=this.slideRowIn?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,y=this.applyPaginationOffset(d),T=this.rowNode.isRowPinned()?y:this.beans.rowContainerHeightService.getRealPixelPosition(y),M=T+"px",U=this.beans.gridOptionsWrapper.isSuppressRowTransform();U?this.initialTop=M:this.initialTransform="translateY("+M+")"},f.prototype.setRowTopStyle=function(d){var y=this.beans.gridOptionsWrapper.isSuppressRowTransform();this.allRowGuis.forEach(function(T){return y?T.rowComp.setTop(d):T.rowComp.setTransform("translateY("+d+")")})},f.prototype.getRowNode=function(){return this.rowNode},f.prototype.getCellCtrl=function(d){var y=null;return this.getAllCellCtrls().forEach(function(T){T.getColumn()==d&&(y=T)}),y!=null||this.getAllCellCtrls().forEach(function(T){T.getColSpanningList().indexOf(d)>=0&&(y=T)}),y},f.prototype.onRowIndexChanged=function(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())},f.prototype.updateRowIndexes=function(){var d=this.rowNode.getRowIndexString(),y=this.beans.headerNavigationService.getHeaderRowCount(),T=this.rowNode.rowIndex%2===0,M=y+this.rowNode.rowIndex+1;this.allRowGuis.forEach(function(U){U.rowComp.setRowIndex(d),U.rowComp.addOrRemoveCssClass("ag-row-even",T),U.rowComp.addOrRemoveCssClass("ag-row-odd",!T),Zs(U.element,M)})},f.prototype.getPinnedLeftRowElement=function(){return this.leftGui?this.leftGui.element:void 0},f.prototype.getPinnedRightRowElement=function(){return this.rightGui?this.rightGui.element:void 0},f.prototype.getBodyRowElement=function(){return this.centerGui?this.centerGui.element:void 0},f.prototype.getFullWidthRowElement=function(){return this.fullWidthGui?this.fullWidthGui.element:void 0},f.DOM_DATA_KEY_ROW_CTRL="renderedRow",f}(Qi);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6703,7 +6703,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var Xai=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),itt=function(P){Xai(f,P);function f(d){var y=P.call(this,d,"ag-color-picker","colorPicker")||this;return d&&d.color&&(y.value=d.color),y}return f.prototype.postConstruct=function(){P.prototype.postConstruct.call(this),this.value&&this.setValue(this.value)},f.prototype.showPicker=function(){var d=this,y=this.getGui().getBoundingClientRect(),T=this.createBean(new dAe({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:y.right-190,y:y.top-250}));this.isPickerDisplayed=!0,T.addCssClass("ag-color-dialog"),xr(this.eWrapper,!0);var M=this.createBean(new Hai({picker:this}));return M.addDestroyFunc(function(){T.isAlive()&&d.destroyBean(T)}),T.setParentComponent(this),T.setBodyComponent(M),M.setValue(this.getValue()),T.addDestroyFunc(function(){d.isDestroyingPicker?d.isDestroyingPicker=!1:(d.isDestroyingPicker=!0,M.isAlive()&&d.destroyBean(M)),d.isAlive()&&(xr(d.eWrapper,!1),d.getFocusableElement().focus()),d.isPickerDisplayed=!1}),T},f.prototype.setValue=function(d){return this.value===d?this:(this.eDisplayField.style.backgroundColor=d,P.prototype.setValue.call(this,d))},f.prototype.getValue=function(){return this.value},f}(Iue);/** + */var Xai=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),itt=function(P){Xai(f,P);function f(d){var y=P.call(this,d,"ag-color-picker","colorPicker")||this;return d&&d.color&&(y.value=d.color),y}return f.prototype.postConstruct=function(){P.prototype.postConstruct.call(this),this.value&&this.setValue(this.value)},f.prototype.showPicker=function(){var d=this,y=this.getGui().getBoundingClientRect(),T=this.createBean(new dAe({closable:!1,modal:!0,hideTitleBar:!0,minWidth:190,width:190,height:250,x:y.right-190,y:y.top-250}));this.isPickerDisplayed=!0,T.addCssClass("ag-color-dialog"),wr(this.eWrapper,!0);var M=this.createBean(new Hai({picker:this}));return M.addDestroyFunc(function(){T.isAlive()&&d.destroyBean(T)}),T.setParentComponent(this),T.setBodyComponent(M),M.setValue(this.getValue()),T.addDestroyFunc(function(){d.isDestroyingPicker?d.isDestroyingPicker=!1:(d.isDestroyingPicker=!0,M.isAlive()&&d.destroyBean(M)),d.isAlive()&&(wr(d.eWrapper,!1),d.getFocusableElement().focus()),d.isPickerDisplayed=!1}),T},f.prototype.setValue=function(d){return this.value===d?this:(this.eDisplayField.style.backgroundColor=d,P.prototype.setValue.call(this,d))},f.prototype.getValue=function(){return this.value},f}(Iue);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6718,7 +6718,7 @@ gl_FragColor.rgb *= color.a;
-
`},f.prototype.postConstruct=function(){if(this.items.length){var d=this.items;this.items=[],this.addItems(d)}var y=this.gridOptionsWrapper.getLocaleTextFunc();this.cbGroupEnabled.setLabel(y("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshAriaStatus(),this.refreshChildDisplay()},f.prototype.setupExpandContract=function(){var d=this;this.eGroupClosedIcon.appendChild(x_("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(x_("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eTitleBar,"click",function(){return d.toggleGroupExpand()}),this.addManagedListener(this.eTitleBar,"keydown",function(y){switch(y.key){case sn.ENTER:case sn.SPACE:y.preventDefault(),d.toggleGroupExpand();break;case sn.RIGHT:case sn.LEFT:y.preventDefault(),d.toggleGroupExpand(y.key===sn.RIGHT);break}})},f.prototype.refreshAriaStatus=function(){this.suppressOpenCloseIcons||xr(this.eTitleBar,this.expanded)},f.prototype.refreshChildDisplay=function(){var d=!this.suppressOpenCloseIcons;Nl(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),Nl(this.eGroupOpenedIcon,d&&this.expanded),Nl(this.eGroupClosedIcon,d&&!this.expanded)},f.prototype.isExpanded=function(){return this.expanded},f.prototype.setAlignItems=function(d){this.alignItems!==d&&this.removeCssClass("ag-group-item-alignment-"+this.alignItems),this.alignItems=d;var y="ag-group-item-alignment-"+this.alignItems;return this.addCssClass(y),this},f.prototype.toggleGroupExpand=function(d){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),Nl(this.eContainer,!0),this):(d=d??!this.expanded,this.expanded===d?this:(this.expanded=d,this.refreshAriaStatus(),this.refreshChildDisplay(),Nl(this.eContainer,d),this.dispatchEvent({type:this.expanded?f.EVENT_EXPANDED:f.EVENT_COLLAPSED}),this))},f.prototype.addItems=function(d){var y=this;d.forEach(function(T){return y.addItem(T)})},f.prototype.addItem=function(d){var y=this.eContainer,T=d instanceof ka?d.getGui():d;T.classList.add("ag-group-item","ag-"+this.cssIdentifier+"-group-item"),y.appendChild(T),this.items.push(T)},f.prototype.hideItem=function(d,y){var T=this.items[y];T.classList.toggle("ag-hidden",d)},f.prototype.setTitle=function(d){return this.eTitle.innerText=d,this},f.prototype.addCssClassToTitleBar=function(d){this.eTitleBar.classList.add(d)},f.prototype.setEnabled=function(d,y){return this.enabled=d,this.refreshDisabledStyles(),this.toggleGroupExpand(d),y||this.cbGroupEnabled.setValue(d),this},f.prototype.isEnabled=function(){return this.enabled},f.prototype.onEnableChange=function(d){var y=this;return this.cbGroupEnabled.onValueChange(function(T){y.setEnabled(T,!0),d(T)}),this},f.prototype.hideEnabledCheckbox=function(d){return this.suppressEnabledCheckbox=d,this.refreshChildDisplay(),this.refreshDisabledStyles(),this},f.prototype.hideOpenCloseIcons=function(d){return this.suppressOpenCloseIcons=d,d&&this.toggleGroupExpand(!0),this},f.prototype.refreshDisabledStyles=function(){this.addOrRemoveCssClass("ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(this.eTitleBar.classList.add("ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(this.eTitleBar.classList.remove("ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),this.eContainer.classList.toggle("ag-disabled-group-container",!this.enabled)},f.EVENT_EXPANDED="expanded",f.EVENT_COLLAPSED="collapsed",lD([Mr("eTitleBar")],f.prototype,"eTitleBar",void 0),lD([Mr("eGroupOpenedIcon")],f.prototype,"eGroupOpenedIcon",void 0),lD([Mr("eGroupClosedIcon")],f.prototype,"eGroupClosedIcon",void 0),lD([Mr("eToolbar")],f.prototype,"eToolbar",void 0),lD([Mr("cbGroupEnabled")],f.prototype,"cbGroupEnabled",void 0),lD([Mr("eTitle")],f.prototype,"eTitle",void 0),lD([Mr("eContainer")],f.prototype,"eContainer",void 0),lD([Ke],f.prototype,"postConstruct",null),f}(ka);/** + `},f.prototype.postConstruct=function(){if(this.items.length){var d=this.items;this.items=[],this.addItems(d)}var y=this.gridOptionsWrapper.getLocaleTextFunc();this.cbGroupEnabled.setLabel(y("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshAriaStatus(),this.refreshChildDisplay()},f.prototype.setupExpandContract=function(){var d=this;this.eGroupClosedIcon.appendChild(x_("columnSelectClosed",this.gridOptionsWrapper,null)),this.eGroupOpenedIcon.appendChild(x_("columnSelectOpen",this.gridOptionsWrapper,null)),this.addManagedListener(this.eTitleBar,"click",function(){return d.toggleGroupExpand()}),this.addManagedListener(this.eTitleBar,"keydown",function(y){switch(y.key){case sn.ENTER:case sn.SPACE:y.preventDefault(),d.toggleGroupExpand();break;case sn.RIGHT:case sn.LEFT:y.preventDefault(),d.toggleGroupExpand(y.key===sn.RIGHT);break}})},f.prototype.refreshAriaStatus=function(){this.suppressOpenCloseIcons||wr(this.eTitleBar,this.expanded)},f.prototype.refreshChildDisplay=function(){var d=!this.suppressOpenCloseIcons;Nl(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),Nl(this.eGroupOpenedIcon,d&&this.expanded),Nl(this.eGroupClosedIcon,d&&!this.expanded)},f.prototype.isExpanded=function(){return this.expanded},f.prototype.setAlignItems=function(d){this.alignItems!==d&&this.removeCssClass("ag-group-item-alignment-"+this.alignItems),this.alignItems=d;var y="ag-group-item-alignment-"+this.alignItems;return this.addCssClass(y),this},f.prototype.toggleGroupExpand=function(d){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),Nl(this.eContainer,!0),this):(d=d??!this.expanded,this.expanded===d?this:(this.expanded=d,this.refreshAriaStatus(),this.refreshChildDisplay(),Nl(this.eContainer,d),this.dispatchEvent({type:this.expanded?f.EVENT_EXPANDED:f.EVENT_COLLAPSED}),this))},f.prototype.addItems=function(d){var y=this;d.forEach(function(T){return y.addItem(T)})},f.prototype.addItem=function(d){var y=this.eContainer,T=d instanceof ka?d.getGui():d;T.classList.add("ag-group-item","ag-"+this.cssIdentifier+"-group-item"),y.appendChild(T),this.items.push(T)},f.prototype.hideItem=function(d,y){var T=this.items[y];T.classList.toggle("ag-hidden",d)},f.prototype.setTitle=function(d){return this.eTitle.innerText=d,this},f.prototype.addCssClassToTitleBar=function(d){this.eTitleBar.classList.add(d)},f.prototype.setEnabled=function(d,y){return this.enabled=d,this.refreshDisabledStyles(),this.toggleGroupExpand(d),y||this.cbGroupEnabled.setValue(d),this},f.prototype.isEnabled=function(){return this.enabled},f.prototype.onEnableChange=function(d){var y=this;return this.cbGroupEnabled.onValueChange(function(T){y.setEnabled(T,!0),d(T)}),this},f.prototype.hideEnabledCheckbox=function(d){return this.suppressEnabledCheckbox=d,this.refreshChildDisplay(),this.refreshDisabledStyles(),this},f.prototype.hideOpenCloseIcons=function(d){return this.suppressOpenCloseIcons=d,d&&this.toggleGroupExpand(!0),this},f.prototype.refreshDisabledStyles=function(){this.addOrRemoveCssClass("ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(this.eTitleBar.classList.add("ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(this.eTitleBar.classList.remove("ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),this.eContainer.classList.toggle("ag-disabled-group-container",!this.enabled)},f.EVENT_EXPANDED="expanded",f.EVENT_COLLAPSED="collapsed",lD([Mr("eTitleBar")],f.prototype,"eTitleBar",void 0),lD([Mr("eGroupOpenedIcon")],f.prototype,"eGroupOpenedIcon",void 0),lD([Mr("eGroupClosedIcon")],f.prototype,"eGroupClosedIcon",void 0),lD([Mr("eToolbar")],f.prototype,"eToolbar",void 0),lD([Mr("cbGroupEnabled")],f.prototype,"cbGroupEnabled",void 0),lD([Mr("eTitle")],f.prototype,"eTitle",void 0),lD([Mr("eContainer")],f.prototype,"eContainer",void 0),lD([Ke],f.prototype,"postConstruct",null),f}(ka);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -6749,7 +6749,7 @@ gl_FragColor.rgb *= color.a; * @version v27.3.0 * @link https://www.ag-grid.com/ * @license MIT - */var nli=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),utt=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},J7=function(P){nli(f,P);function f(d){var y=P.call(this)||this;return y.params=d,y.isActive=!1,y.subMenuIsOpen=!1,y.setTemplate('
'),y}return f.prototype.init=function(){var d=this;this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu(),this.addTooltip();var y=this.getGui();this.params.disabled?(this.addCssClass(this.getClassName("disabled")),Yi(y,!0)):(this.addGuiEventListener("click",function(T){return d.onItemSelected(T)}),this.addGuiEventListener("keydown",function(T){(T.key===sn.ENTER||T.key===sn.SPACE)&&(T.preventDefault(),d.onItemSelected(T))}),this.addGuiEventListener("mousedown",function(T){T.stopPropagation(),T.preventDefault()}),this.addGuiEventListener("mouseenter",function(){return d.onMouseEnter()}),this.addGuiEventListener("mouseleave",function(){return d.onMouseLeave()})),this.params.cssClasses&&this.params.cssClasses.forEach(function(T){return d.addCssClass(T)})},f.prototype.isDisabled=function(){return!!this.params.disabled},f.prototype.openSubMenu=function(d){var y=this;if(d===void 0&&(d=!1),this.closeSubMenu(),!!this.params.subMenu){var T=fc(''),M;if(this.params.subMenu instanceof Array){var U=or(this.getGui()),X=isNaN(U)?1:U+1,Se=this.createBean(new att(X));Se.setParentComponent(this),Se.addMenuItems(this.params.subMenu),T.appendChild(Se.getGui()),this.addManagedListener(Se,f.EVENT_MENU_ITEM_SELECTED,function(Er){return y.dispatchEvent(Er)}),Se.addGuiEventListener("mouseenter",function(){return y.cancelDeactivate()}),M=function(){return y.destroyBean(Se)},d&&setTimeout(function(){return Se.activateFirstItem()},0)}else{var Pe=this.params.subMenu,at=this.createBean(new ltt(Pe));at.setParentComponent(this);var Lt=at.getGui(),Kt="mouseenter",_i=function(){return y.cancelDeactivate()};Lt.addEventListener(Kt,_i),M=function(){return Lt.removeEventListener(Kt,_i)},T.appendChild(Lt),Pe.afterGuiAttached&&setTimeout(function(){return Pe.afterGuiAttached()},0)}var Si=this.getGui(),Ji=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:Si,ePopup:T}),cr=this.gridOptionsWrapper.getLocaleTextFunc(),kr=this.popupService.addPopup({modal:!0,eChild:T,positionCallback:Ji,anchorToElement:Si,ariaLabel:cr("ariaLabelSubMenu","SubMenu")});this.subMenuIsOpen=!0,xr(Si,!0),this.hideSubMenu=function(){kr&&kr.hideFunc(),y.subMenuIsOpen=!1,xr(Si,!1),M()}}},f.prototype.closeSubMenu=function(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,xr(this.getGui(),!1))},f.prototype.isSubMenuOpen=function(){return this.subMenuIsOpen},f.prototype.activate=function(d){var y=this;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.addCssClass(this.getClassName("active")),this.getGui().focus(),d&&this.params.subMenu&&window.setTimeout(function(){y.isAlive()&&y.isActive&&y.openSubMenu()},300),this.onItemActivated())},f.prototype.deactivate=function(){this.cancelDeactivate(),this.removeCssClass(this.getClassName("active")),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()},f.prototype.addIcon=function(){if(!(!this.params.checked&&!this.params.icon&&this.params.isCompact)){var d=fc('');this.params.checked?d.appendChild(Tp("check",this.gridOptionsWrapper)):this.params.icon&&(lt(this.params.icon)?d.appendChild(this.params.icon):typeof this.params.icon=="string"?d.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(d)}},f.prototype.addName=function(){if(!(!this.params.name&&this.params.isCompact)){var d=fc(''+(this.params.name||"")+"");this.getGui().appendChild(d)}},f.prototype.addTooltip=function(){this.params.tooltip&&(this.tooltip=this.params.tooltip,this.gridOptionsWrapper.isEnableBrowserTooltips()?this.getGui().setAttribute("title",this.tooltip):this.createManagedBean(new _L(this)))},f.prototype.getTooltipParams=function(){return{location:"menu",value:this.tooltip}},f.prototype.addShortcut=function(){if(!(!this.params.shortcut&&this.params.isCompact)){var d=fc(''+(this.params.shortcut||"")+"");this.getGui().appendChild(d)}},f.prototype.addSubMenu=function(){if(!(!this.params.subMenu&&this.params.isCompact)){var d=fc(''),y=this.getGui();if(this.params.subMenu){var T=this.gridOptionsWrapper.isEnableRtl()?"smallLeft":"smallRight";xr(y,!1),d.appendChild(Tp(T,this.gridOptionsWrapper))}y.appendChild(d)}},f.prototype.onItemSelected=function(d){if(this.params.action?this.params.action():this.openSubMenu(d&&d.type==="keydown"),!(this.params.subMenu&&!this.params.action)){var y={type:f.EVENT_MENU_ITEM_SELECTED,action:this.params.action,checked:this.params.checked,cssClasses:this.params.cssClasses,disabled:this.params.disabled,icon:this.params.icon,name:this.params.name,shortcut:this.params.shortcut,subMenu:this.params.subMenu,tooltip:this.params.tooltip,event:d};this.dispatchEvent(y)}},f.prototype.onItemActivated=function(){var d={type:f.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(d)},f.prototype.cancelActivate=function(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)},f.prototype.cancelDeactivate=function(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)},f.prototype.onMouseEnter=function(){var d=this;this.cancelDeactivate(),this.params.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(function(){return d.activate(!0)},f.ACTIVATION_DELAY):this.activate(!0)},f.prototype.onMouseLeave=function(){var d=this;this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(function(){return d.deactivate()},f.ACTIVATION_DELAY):this.deactivate()},f.prototype.getClassName=function(d){var y=this.params.isCompact?"ag-compact-menu-option":"ag-menu-option";return d?y+"-"+d:y},f.EVENT_MENU_ITEM_SELECTED="menuItemSelected",f.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",f.ACTIVATION_DELAY=80,utt([ie("popupService")],f.prototype,"popupService",void 0),utt([Ke],f.prototype,"init",null),f}(ka);/** + */var nli=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),utt=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},J7=function(P){nli(f,P);function f(d){var y=P.call(this)||this;return y.params=d,y.isActive=!1,y.subMenuIsOpen=!1,y.setTemplate('
'),y}return f.prototype.init=function(){var d=this;this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu(),this.addTooltip();var y=this.getGui();this.params.disabled?(this.addCssClass(this.getClassName("disabled")),Yi(y,!0)):(this.addGuiEventListener("click",function(T){return d.onItemSelected(T)}),this.addGuiEventListener("keydown",function(T){(T.key===sn.ENTER||T.key===sn.SPACE)&&(T.preventDefault(),d.onItemSelected(T))}),this.addGuiEventListener("mousedown",function(T){T.stopPropagation(),T.preventDefault()}),this.addGuiEventListener("mouseenter",function(){return d.onMouseEnter()}),this.addGuiEventListener("mouseleave",function(){return d.onMouseLeave()})),this.params.cssClasses&&this.params.cssClasses.forEach(function(T){return d.addCssClass(T)})},f.prototype.isDisabled=function(){return!!this.params.disabled},f.prototype.openSubMenu=function(d){var y=this;if(d===void 0&&(d=!1),this.closeSubMenu(),!!this.params.subMenu){var T=fc(''),M;if(this.params.subMenu instanceof Array){var U=or(this.getGui()),X=isNaN(U)?1:U+1,Se=this.createBean(new att(X));Se.setParentComponent(this),Se.addMenuItems(this.params.subMenu),T.appendChild(Se.getGui()),this.addManagedListener(Se,f.EVENT_MENU_ITEM_SELECTED,function(Er){return y.dispatchEvent(Er)}),Se.addGuiEventListener("mouseenter",function(){return y.cancelDeactivate()}),M=function(){return y.destroyBean(Se)},d&&setTimeout(function(){return Se.activateFirstItem()},0)}else{var Pe=this.params.subMenu,at=this.createBean(new ltt(Pe));at.setParentComponent(this);var Lt=at.getGui(),Kt="mouseenter",_i=function(){return y.cancelDeactivate()};Lt.addEventListener(Kt,_i),M=function(){return Lt.removeEventListener(Kt,_i)},T.appendChild(Lt),Pe.afterGuiAttached&&setTimeout(function(){return Pe.afterGuiAttached()},0)}var Si=this.getGui(),Ji=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:Si,ePopup:T}),cr=this.gridOptionsWrapper.getLocaleTextFunc(),kr=this.popupService.addPopup({modal:!0,eChild:T,positionCallback:Ji,anchorToElement:Si,ariaLabel:cr("ariaLabelSubMenu","SubMenu")});this.subMenuIsOpen=!0,wr(Si,!0),this.hideSubMenu=function(){kr&&kr.hideFunc(),y.subMenuIsOpen=!1,wr(Si,!1),M()}}},f.prototype.closeSubMenu=function(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,wr(this.getGui(),!1))},f.prototype.isSubMenuOpen=function(){return this.subMenuIsOpen},f.prototype.activate=function(d){var y=this;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.addCssClass(this.getClassName("active")),this.getGui().focus(),d&&this.params.subMenu&&window.setTimeout(function(){y.isAlive()&&y.isActive&&y.openSubMenu()},300),this.onItemActivated())},f.prototype.deactivate=function(){this.cancelDeactivate(),this.removeCssClass(this.getClassName("active")),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()},f.prototype.addIcon=function(){if(!(!this.params.checked&&!this.params.icon&&this.params.isCompact)){var d=fc('');this.params.checked?d.appendChild(Tp("check",this.gridOptionsWrapper)):this.params.icon&&(lt(this.params.icon)?d.appendChild(this.params.icon):typeof this.params.icon=="string"?d.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(d)}},f.prototype.addName=function(){if(!(!this.params.name&&this.params.isCompact)){var d=fc(''+(this.params.name||"")+"");this.getGui().appendChild(d)}},f.prototype.addTooltip=function(){this.params.tooltip&&(this.tooltip=this.params.tooltip,this.gridOptionsWrapper.isEnableBrowserTooltips()?this.getGui().setAttribute("title",this.tooltip):this.createManagedBean(new _L(this)))},f.prototype.getTooltipParams=function(){return{location:"menu",value:this.tooltip}},f.prototype.addShortcut=function(){if(!(!this.params.shortcut&&this.params.isCompact)){var d=fc(''+(this.params.shortcut||"")+"");this.getGui().appendChild(d)}},f.prototype.addSubMenu=function(){if(!(!this.params.subMenu&&this.params.isCompact)){var d=fc(''),y=this.getGui();if(this.params.subMenu){var T=this.gridOptionsWrapper.isEnableRtl()?"smallLeft":"smallRight";wr(y,!1),d.appendChild(Tp(T,this.gridOptionsWrapper))}y.appendChild(d)}},f.prototype.onItemSelected=function(d){if(this.params.action?this.params.action():this.openSubMenu(d&&d.type==="keydown"),!(this.params.subMenu&&!this.params.action)){var y={type:f.EVENT_MENU_ITEM_SELECTED,action:this.params.action,checked:this.params.checked,cssClasses:this.params.cssClasses,disabled:this.params.disabled,icon:this.params.icon,name:this.params.name,shortcut:this.params.shortcut,subMenu:this.params.subMenu,tooltip:this.params.tooltip,event:d};this.dispatchEvent(y)}},f.prototype.onItemActivated=function(){var d={type:f.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(d)},f.prototype.cancelActivate=function(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)},f.prototype.cancelDeactivate=function(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)},f.prototype.onMouseEnter=function(){var d=this;this.cancelDeactivate(),this.params.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(function(){return d.activate(!0)},f.ACTIVATION_DELAY):this.activate(!0)},f.prototype.onMouseLeave=function(){var d=this;this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(function(){return d.deactivate()},f.ACTIVATION_DELAY):this.deactivate()},f.prototype.getClassName=function(d){var y=this.params.isCompact?"ag-compact-menu-option":"ag-menu-option";return d?y+"-"+d:y},f.EVENT_MENU_ITEM_SELECTED="menuItemSelected",f.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",f.ACTIVATION_DELAY=80,utt([ie("popupService")],f.prototype,"popupService",void 0),utt([Ke],f.prototype,"init",null),f}(ka);/** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.3.0 * @link https://www.ag-grid.com/ @@ -7030,10 +7030,10 @@ gl_FragColor.rgb *= color.a; */var tj=typeof Hh>"u"?{}:Hh;tj.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,tj.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,tj.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,tj.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,tj.Node=typeof Node>"u"?{}:Node,tj.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var Aui=function(P,f){var d=typeof Symbol=="function"&&P[Symbol.iterator];if(!d)return P;var y=d.call(P),T,M=[],U;try{for(;(f===void 0||f-- >0)&&!(T=y.next()).done;)M.push(T.value)}catch(X){U={error:X}}finally{try{T&&!T.done&&(d=y.return)&&d.call(y)}finally{if(U)throw U.error}}return M},Mui=function(){for(var P=[],f=0;f0;if(d&&f.forEach(function(T){T.setSelected(!1,!1,!0)}),this.selectionService.updateGroupsFromChildrenSelections(),d){var y={type:ai.EVENT_SELECTION_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(y)}},P.prototype.executeAdd=function(f,d){var y=this,T=f.add,M=f.addIndex;if(!_o.missingOrEmpty(T)){var U=T.map(function(Kt){return y.createNode(Kt,y.rootNode,P.TOP_LEVEL)}),X=typeof M=="number"&&M>=0,Se,Pe;if(X){var at=this.rootNode.allLeafChildren,Lt=M===0?0:at.reduce(function(Kt,_i,Si){var Ji,cr=_i.rowIndex,kr=(Ji=at[Kt])===null||Ji===void 0?void 0:Ji.rowIndex,Er=cr!=null&&kr!=null&&crkr;return Er?Si:Kt},0)+1;Se=at.slice(0,Lt),Pe=at.slice(Lt,at.length)}else Se=this.rootNode.allLeafChildren,Pe=[];this.rootNode.allLeafChildren=Mui(Se,U,Pe),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),d.add=U}},P.prototype.executeRemove=function(f,d,y){var T=this,M=f.remove;if(!_o.missingOrEmpty(M)){var U={};M.forEach(function(X){var Se=T.lookupRowNode(X);Se&&(Se.isSelected()&&y.push(Se),Se.clearRowTopAndRowIndex(),U[Se.id]=!0,delete T.allNodesMap[Se.id],d.remove.push(Se))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(function(X){return!U[X.id]}),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}},P.prototype.executeUpdate=function(f,d,y){var T=this,M=f.update;_o.missingOrEmpty(M)||M.forEach(function(U){var X=T.lookupRowNode(U);X&&(X.updateData(U),!X.selectable&&X.isSelected()&&y.push(X),T.setMasterForRow(X,U,P.TOP_LEVEL,!1),d.update.push(X))})},P.prototype.lookupRowNode=function(f){var d=this.gridOptionsWrapper.getRowIdFunc(),y;if(d){var T=d({data:f,level:0});if(y=this.allNodesMap[T],!y)return console.error("AG Grid: could not find row id="+T+", data item was not found for this id"),null}else if(y=this.rootNode.allLeafChildren.find(function(M){return M.data===f}),!y)return console.error("AG Grid: could not find data item as object was not found",f),console.error("Consider using getRowId to help the Grid find matching row data"),null;return y||null},P.prototype.createNode=function(f,d,y){var T=new Va(this.beans);return T.group=!1,this.setMasterForRow(T,f,y,!0),d&&!this.suppressParentsInRowNodes&&(T.parent=d),T.level=y,T.setDataAndId(f,this.nextId.toString()),this.allNodesMap[T.id]&&console.warn("AG Grid: duplicate node id '"+T.id+"' detected from getRowId callback, this could cause issues in your grid."),this.allNodesMap[T.id]=T,this.nextId++,T},P.prototype.setMasterForRow=function(f,d,y,T){if(this.doingTreeData)f.setMaster(!1),T&&(f.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?f.setMaster(this.isRowMasterFunc(d)):f.setMaster(!0):f.setMaster(!1),T){var M=this.columnModel.getRowGroupColumns(),U=M?M.length:0,X=y+U;f.expanded=f.master?this.isExpanded(X):!1}},P.prototype.isExpanded=function(f){var d=this.gridOptionsWrapper.getGroupDefaultExpanded();return d===-1?!0:f=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},NE;(function(P){P[P.Normal=0]="Normal",P[P.AfterFilter=1]="AfterFilter",P[P.AfterFilterAndSort=2]="AfterFilterAndSort",P[P.PivotNodes=3]="PivotNodes"})(NE||(NE={}));var Rui=function(P){Pui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.init=function(){var d=this.refreshModel.bind(this,{step:i.ClientSideRowModelSteps.EVERYTHING}),y=!this.gridOptionsWrapper.isSuppressAnimationFrame(),T=this.refreshModel.bind(this,{step:i.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:y});this.addManagedListener(this.eventService,ai.EVENT_NEW_COLUMNS_LOADED,T),this.addManagedListener(this.eventService,ai.EVENT_COLUMN_ROW_GROUP_CHANGED,d),this.addManagedListener(this.eventService,ai.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:i.ClientSideRowModelSteps.PIVOT})),this.addManagedListener(this.eventService,ai.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_COLUMN_PIVOT_MODE_CHANGED,d);var M=this.refreshModel.bind(this,{step:i.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:y});this.addManagedListener(this.gridOptionsWrapper,as.PROP_GROUP_REMOVE_SINGLE_CHILDREN,M),this.addManagedListener(this.gridOptionsWrapper,as.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN,M),this.rootNode=new Va(this.beans),this.nodeManager=new Oui(this.rootNode,this.gridOptionsWrapper,this.eventService,this.columnModel,this.gridApi,this.columnApi,this.selectionService,this.beans)},f.prototype.start=function(){var d=this.gridOptionsWrapper.getRowData();d&&this.setRowData(d)},f.prototype.ensureRowHeightsValid=function(d,y,T,M){var U,X=!1;do{U=!1;for(var Se=this.getRowIndexAtPixel(d),Pe=this.getRowIndexAtPixel(y),at=Math.max(Se,T),Lt=Math.min(Pe,M),Kt=at;Kt<=Lt;Kt++){var _i=this.getRow(Kt);if(_i.rowHeightEstimated){var Si=this.gridOptionsWrapper.getRowHeightForNode(_i);_i.setRowHeight(Si.height),U=!0,X=!0}}U&&this.setRowTopAndRowIndex()}while(U);return X},f.prototype.setRowTopAndRowIndex=function(){for(var d=this.gridOptionsWrapper.getDefaultRowHeight(),y=0,T=new Set,M=this.gridOptionsWrapper.getDomLayout()===Fe.DOM_LAYOUT_NORMAL,U=0;U0;)T=T.childrenAfterSort[0];return T.rowIndex},f.prototype.getRowBounds=function(d){if(_o.missing(this.rowsToDisplay))return null;var y=this.rowsToDisplay[d];return y?{rowTop:y.rowTop,rowHeight:y.rowHeight}:null},f.prototype.onRowGroupOpened=function(){var d=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:i.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:d})},f.prototype.onFilterChanged=function(d){if(!d.afterDataChange){var y=this.gridOptionsWrapper.isAnimateRows(),T=d.columns.length===0||d.columns.some(function(U){return U.isPrimary()}),M=T?i.ClientSideRowModelSteps.FILTER:i.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:M,keepRenderedRows:!0,animate:y})}},f.prototype.onSortChanged=function(){var d=this.gridOptionsWrapper.isAnimateRows();this.refreshModel({step:i.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:d,keepEditingRows:!0})},f.prototype.getType=function(){return Fe.ROW_MODEL_TYPE_CLIENT_SIDE},f.prototype.onValueChanged=function(){this.columnModel.isPivotActive()?this.refreshModel({step:i.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:i.ClientSideRowModelSteps.AGGREGATE})},f.prototype.createChangePath=function(d){var y=_o.missingOrEmpty(d),T=new nce(!1,this.rootNode);return(y||this.gridOptionsWrapper.isTreeData())&&T.setInactive(),T},f.prototype.isSuppressModelUpdateAfterUpdateTransaction=function(d){if(!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction()||d.rowNodeTransactions==null)return!1;var y=d.rowNodeTransactions.filter(function(M){return M.add!=null&&M.add.length>0||M.remove!=null&&M.remove.length>0}),T=y==null||y.length==0;return T},f.prototype.refreshModel=function(d){if(!this.isSuppressModelUpdateAfterUpdateTransaction(d)){var y=this.createChangePath(d.rowNodeTransactions);switch(d.step){case i.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(d.groupState,d.rowNodeTransactions,d.rowNodeOrder,y,!!d.afterColumnsChanged);case i.ClientSideRowModelSteps.FILTER:this.doFilter(y);case i.ClientSideRowModelSteps.PIVOT:this.doPivot(y);case i.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(y);case i.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(y);case i.ClientSideRowModelSteps.SORT:this.doSort(d.rowNodeTransactions,y);case i.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}var T=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(y,T);var M={type:ai.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:d.animate,keepRenderedRows:d.keepRenderedRows,newData:d.newData,newPage:!1};this.eventService.dispatchEvent(M)}},f.prototype.isEmpty=function(){var d=_o.missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return _o.missing(this.rootNode)||d||!this.columnModel.isReady()},f.prototype.isRowsToRender=function(){return _o.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0},f.prototype.getNodesInRangeForSelection=function(d,y){var T=!y,M=!1,U,X=[],Se=this.gridOptionsWrapper.isGroupSelectsChildren();return this.forEachNodeAfterFilterAndSort(function(Pe){var at=T&&!M;T||(Pe===y||Pe===d)&&(T=!0);var Lt=Pe.group&&Se;if(!Lt){var Kt=T&&!M,_i=Pe.isParentOfNode(U);(Kt||_i)&&X.push(Pe)}at&&(Pe===y||Pe===d)&&(M=!0,Pe===y?U=y:U=d)}),X},f.prototype.setDatasource=function(d){console.error("AG Grid: should never call setDatasource on clientSideRowController")},f.prototype.getTopLevelNodes=function(){return this.rootNode?this.rootNode.childrenAfterGroup:null},f.prototype.getRootNode=function(){return this.rootNode},f.prototype.getRow=function(d){return this.rowsToDisplay[d]},f.prototype.isRowPresent=function(d){return this.rowsToDisplay.indexOf(d)>=0},f.prototype.getRowIndexAtPixel=function(d){if(this.isEmpty())return-1;var y=0,T=this.rowsToDisplay.length-1;if(d<=0)return 0;var M=_o.last(this.rowsToDisplay);if(M.rowTop<=d)return this.rowsToDisplay.length-1;for(;;){var U=Math.floor((y+T)/2),X=this.rowsToDisplay[U];if(this.isRowInPixel(X,d))return U;X.rowTopd&&(T=U-1)}},f.prototype.isRowInPixel=function(d,y){var T=d.rowTop,M=d.rowTop+d.rowHeight,U=T<=y&&M>y;return U},f.prototype.forEachLeafNode=function(d){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach(function(y,T){return d(y,T)})},f.prototype.forEachNode=function(d){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup,d,NE.Normal,0)},f.prototype.forEachNodeAfterFilter=function(d){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter,d,NE.AfterFilter,0)},f.prototype.forEachNodeAfterFilterAndSort=function(d){this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort,d,NE.AfterFilterAndSort,0)},f.prototype.forEachPivotNode=function(d){this.recursivelyWalkNodesAndCallback([this.rootNode],d,NE.PivotNodes,0)},f.prototype.recursivelyWalkNodesAndCallback=function(d,y,T,M){if(!d)return M;for(var U=0;U0&&window.setTimeout(function(){y.forEach(function(X){return X()})},0),T.length>0){var U={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:ai.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:T};this.eventService.dispatchEvent(U)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0},f.prototype.updateRowData=function(d,y){this.valueCache.onDataChanged();var T=this.nodeManager.updateRowData(d,y),M=typeof d.addIndex=="number";return this.commonUpdateRowData([T],y,M),T},f.prototype.createRowNodeOrder=function(){var d=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();if(!d){var y={};if(this.rootNode&&this.rootNode.allLeafChildren)for(var T=0;T=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Fui=function(P){Dui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.execute=function(d){var y=d.changedPath;this.filterService.filter(y)},Gtt([ie("filterService")],f.prototype,"filterService",void 0),f=Gtt([me("filterStage")],f),f}(Qi),kui=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),_ce=function(P,f,d,y){var T=arguments.length,M=T<3?f:y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Lui=function(P){kui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.execute=function(d){var y=this.sortController.getSortOptions(),T=_o.exists(y)&&y.length>0,M=T&&_o.exists(d.rowNodeTransactions)&&this.gridOptionsWrapper.isDeltaSort(),U=y.some(function(X){return!!X.column.getColDef().showRowGroup});this.sortService.sort(y,T,M,d.rowNodeTransactions,d.changedPath,U)},_ce([ie("sortService")],f.prototype,"sortService",void 0),_ce([ie("sortController")],f.prototype,"sortController",void 0),_ce([ie("columnModel")],f.prototype,"columnModel",void 0),f=_ce([me("sortStage")],f),f}(Qi),Nui=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),EAe=function(P,f,d,y){var T=arguments.length,M=T<3?f:y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},$ui=function(P){Nui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.execute=function(d){var y=d.rowNode,T=[],M={value:0},U=this.columnModel.isPivotMode(),X=U&&y.leafGroup,Se=X?[y]:y.childrenAfterSort;this.recursivelyAddToRowsToDisplay(Se,T,M,U,0);var Pe=T.length>0,at=!X&&Pe&&this.gridOptionsWrapper.isGroupIncludeTotalFooter();return at&&(this.ensureFooterNodeExists(y),this.addRowNodeToRowsToDisplay(y.sibling,T,M,0)),T},f.prototype.recursivelyAddToRowsToDisplay=function(d,y,T,M,U){if(!_o.missingOrEmpty(d))for(var X=this.gridOptionsWrapper.isGroupHideOpenParents(),Se=this.gridOptionsWrapper.isGroupRemoveSingleChildren(),Pe=!Se&&this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren(),at=0;at=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},jui=function(P){Bui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.init=function(){this.postSortFunc=this.gridOptionsWrapper.getPostSortFunc()},f.prototype.sort=function(d,y,T,M,U,X){var Se=this,Pe=this.gridOptionsWrapper.isGroupMaintainOrder(),at=this.columnModel.getAllGridColumns().some(function(Si){return Si.isRowGroupActive()}),Lt={};T&&M&&(Lt=this.calculateDirtyNodes(M));var Kt=this.columnModel.isPivotMode(),_i=function(Si){Se.pullDownGroupDataForHideOpenParents(Si.childrenAfterAggFilter,!0);var Ji=Kt&&Si.leafGroup,cr=Pe&&at&&!Si.leafGroup&&!X;if(!y||cr||Ji){var kr=Si.childrenAfterAggFilter.slice(0);if(Pe&&Si.childrenAfterSort){var Er=Si.childrenAfterSort.reduce(function(kn,to,ol){return kn[to.id]=ol,kn},{});kr.sort(function(kn,to){return(Er[kn.id]||0)-(Er[to.id]||0)})}Si.childrenAfterSort=kr}else T?Si.childrenAfterSort=Se.doDeltaSort(Si,Lt,U,d):Si.childrenAfterSort=Se.rowNodeSorter.doFullSort(Si.childrenAfterAggFilter,d);if(Si.sibling&&(Si.sibling.childrenAfterSort=Si.childrenAfterSort),Se.updateChildIndexes(Si),Se.postSortFunc){var Vr={nodes:Si.childrenAfterSort};Se.postSortFunc(Vr)}};U&&U.forEachChangedNodeDepthFirst(_i),this.updateGroupDataForHideOpenParents(U)},f.prototype.calculateDirtyNodes=function(d){var y={},T=function(M){M&&M.forEach(function(U){return y[U.id]=!0})};return d&&d.forEach(function(M){T(M.add),T(M.update),T(M.remove)}),y},f.prototype.doDeltaSort=function(d,y,T,M){var U=this,X=d.childrenAfterAggFilter,Se=d.childrenAfterSort;if(!Se)return this.rowNodeSorter.doFullSort(X,M);var Pe={},at=[];X.forEach(function(Si){y[Si.id]||!T.canSkip(Si)?at.push(Si):Pe[Si.id]=!0});var Lt=Se.filter(function(Si){return Pe[Si.id]}),Kt=function(Si,Ji){return{currentPos:Ji,rowNode:Si}},_i=at.map(Kt).sort(function(Si,Ji){return U.rowNodeSorter.compareRowNodes(M,Si,Ji)});return this.mergeSortedArrays(M,_i,Lt.map(Kt)).map(function(Si){var Ji=Si.rowNode;return Ji})},f.prototype.mergeSortedArrays=function(d,y,T){for(var M=[],U=0,X=0;U=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Uui=function(P){Gui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.filter=function(d){var y=this.filterManager.isColumnFilterPresent()||this.filterManager.isQuickFilterPresent()||this.gridOptionsWrapper.isExternalFilterPresent();this.filterNodes(y,d)},f.prototype.filterNodes=function(d,y){var T=this,M=function(Pe,at){Pe.hasChildren()&&d&&!at?Pe.childrenAfterFilter=Pe.childrenAfterGroup.filter(function(Lt){var Kt=Lt.childrenAfterFilter&&Lt.childrenAfterFilter.length>0,_i=Lt.data&&T.filterManager.doesRowPassFilter({rowNode:Lt});return Kt||_i}):Pe.childrenAfterFilter=Pe.childrenAfterGroup,Pe.sibling&&(Pe.sibling.childrenAfterFilter=Pe.childrenAfterFilter)};if(this.doingTreeDataFiltering()){var U=function(Pe,at){if(Pe.childrenAfterGroup)for(var Lt=0;Lt=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Vui=function(P,f){var d=typeof Symbol=="function"&&P[Symbol.iterator];if(!d)return P;var y=d.call(P),T,M=[],U;try{for(;(f===void 0||f-- >0)&&!(T=y.next()).done;)M.push(T.value)}catch(X){U={error:X}}finally{try{T&&!T.done&&(d=y.return)&&d.call(y)}finally{if(U)throw U.error}}return M},Hui=function(P){zui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.rowModel.getType()===Fe.ROW_MODEL_TYPE_CLIENT_SIDE&&(this.clientSideRowModel=this.rowModel)},f.prototype.isActive=function(){return this.gridOptionsWrapper.isImmutableData()},f.prototype.setRowData=function(d){var y=this.createTransactionForRowData(d);if(y){var T=Vui(y,2),M=T[0],U=T[1],X=this.clientSideRowModel.updateRowData(M,U);X&&this.rowRenderer.refreshFullWidthRows(X.update);var Se={type:ai.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(Se)}},f.prototype.createTransactionForRowData=function(d){if(_o.missing(this.clientSideRowModel)){console.error("AG Grid: ImmutableService only works with ClientSideRowModel");return}var y=this.gridOptionsWrapper.getRowIdFunc();if(y==null){console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}var T={remove:[],update:[],add:[]},M=this.clientSideRowModel.getCopyOfNodesMap(),U=this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder(),X=U?void 0:{};return _o.exists(d)&&d.forEach(function(Se,Pe){var at=y({data:Se,level:0}),Lt=M[at];if(X&&(X[at]=Pe),Lt){var Kt=Lt.data!==Se;Kt&&T.update.push(Se),M[at]=void 0}else T.add.push(Se)}),_o.iterateObject(M,function(Se,Pe){Pe&&T.remove.push(Pe.data)}),[T,X]},ij([ie("rowModel")],f.prototype,"rowModel",void 0),ij([ie("rowRenderer")],f.prototype,"rowRenderer",void 0),ij([ie("columnApi")],f.prototype,"columnApi",void 0),ij([ie("gridApi")],f.prototype,"gridApi",void 0),ij([Ke],f.prototype,"postConstruct",null),f=ij([me("immutableService")],f),f}(Qi),Wui={moduleName:i.ModuleNames.ClientSideRowModelModule,beans:[Fui,Lui,$ui,jui,Uui,Hui],rowModels:{clientSide:Rui}},qui=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),IAe=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},ztt=function(P){qui(f,P);function f(d,y,T){var M=P.call(this,d)||this;return M.parentCache=y,M.params=T,M.startRow=d*T.blockSize,M.endRow=M.startRow+T.blockSize,M}return f.prototype.postConstruct=function(){this.createRowNodes()},f.prototype.getBlockStateJson=function(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}},f.prototype.setDataAndId=function(d,y,T){!d.id&&d.alreadyRendered&&(d.alreadyRendered=!1),_o.exists(y)?d.setDataAndId(y,T.toString()):d.setDataAndId(void 0,void 0)},f.prototype.loadFromDatasource=function(){var d=this,y=this.createLoadParams();if(_o.missing(this.params.datasource.getRows)){console.warn("AG Grid: datasource is missing getRows method");return}window.setTimeout(function(){d.params.datasource.getRows(y)},0)},f.prototype.processServerFail=function(){},f.prototype.createLoadParams=function(){var d={startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gridOptionsWrapper.getContext()};return d},f.prototype.forEachNode=function(d,y,T){var M=this;this.rowNodes.forEach(function(U,X){var Se=M.startRow+X;Se=0?d.rowCount:void 0;this.parentCache.pageLoaded(this,T)},f.prototype.destroyRowNodes=function(){this.rowNodes.forEach(function(d){d.clearRowTopAndRowIndex()})},IAe([ie("beans")],f.prototype,"beans",void 0),IAe([Ke],f.prototype,"postConstruct",null),IAe([ke],f.prototype,"destroyRowNodes",null),f}(sce),Yui=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),wce=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Xui=function(P,f){return function(d,y){f(d,y,P)}},Jui=function(P){Yui(f,P);function f(d){var y=P.call(this)||this;return y.lastRowIndexKnown=!1,y.blocks={},y.blockCount=0,y.rowCount=d.initialRowCount,y.params=d,y}return f.prototype.setBeans=function(d){this.logger=d.create("InfiniteCache")},f.prototype.getRow=function(d,y){y===void 0&&(y=!1);var T=Math.floor(d/this.params.blockSize),M=this.blocks[T];if(!M){if(y)return;M=this.createBlock(T)}return M.getRow(d)},f.prototype.createBlock=function(d){var y=this.createBean(new ztt(d,this,this.params));return this.blocks[y.getId()]=y,this.blockCount++,this.purgeBlocksIfNeeded(y),this.params.rowNodeBlockLoader.addBlock(y),y},f.prototype.refreshCache=function(){var d=this.blockCount==0;if(d){this.purgeCache();return}this.getBlocksInOrder().forEach(function(y){return y.setStateWaitingToLoad()}),this.params.rowNodeBlockLoader.checkBlockToLoad()},f.prototype.destroyAllBlocks=function(){var d=this;this.getBlocksInOrder().forEach(function(y){return d.destroyBlock(y)})},f.prototype.getRowCount=function(){return this.rowCount},f.prototype.isLastRowIndexKnown=function(){return this.lastRowIndexKnown},f.prototype.pageLoaded=function(d,y){this.isAlive()&&(this.logger.log("onPageLoaded: page = "+d.getId()+", lastRow = "+y),this.checkRowCount(d,y),this.onCacheUpdated())},f.prototype.purgeBlocksIfNeeded=function(d){var y=this,T=this.getBlocksInOrder().filter(function(Pe){return Pe!=d}),M=function(Pe,at){return at.getLastAccessed()-Pe.getLastAccessed()};T.sort(M);var U=this.params.maxBlocksInCache>0,X=U?this.params.maxBlocksInCache-1:null,Se=f.MAX_EMPTY_BLOCKS_TO_KEEP-1;T.forEach(function(Pe,at){var Lt=Pe.getState()===ztt.STATE_WAITING_TO_LOAD&&at>=Se,Kt=U?at>=X:!1;if(Lt||Kt){if(y.isBlockCurrentlyDisplayed(Pe)||y.isBlockFocused(Pe))return;y.removeBlockFromCache(Pe)}})},f.prototype.isBlockFocused=function(d){var y=this.focusService.getFocusCellToUseAfterRefresh();if(!y||y.rowPinned!=null)return!1;var T=d.getStartRow(),M=d.getEndRow(),U=y.rowIndex>=T&&y.rowIndex=0)this.rowCount=y,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){var T=(d.getId()+1)*this.params.blockSize,M=T+this.params.overflowSize;this.rowCount=d.rowCount&&y.push(T)}),y.length>0&&y.forEach(function(T){return d.destroyBlock(T)})},f.prototype.purgeCache=function(){var d=this;this.getBlocksInOrder().forEach(function(y){return d.removeBlockFromCache(y)}),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()},f.prototype.getRowNodesInRange=function(d,y){var T=this,M=[],U=-1,X=!1,Se=new Rg;_o.missing(d)&&(X=!0);var Pe=!1;this.getBlocksInOrder().forEach(function(Lt){if(!Pe){if(X&&U+1!==Lt.getId()){Pe=!0;return}U=Lt.getId(),Lt.forEachNode(function(Kt){var _i=Kt===d||Kt===y;(X||_i)&&M.push(Kt),_i&&(X=!X)},Se,T.rowCount)}});var at=Pe||X;return at?[]:M},f.MAX_EMPTY_BLOCKS_TO_KEEP=2,wce([ie("rowRenderer")],f.prototype,"rowRenderer",void 0),wce([ie("focusService")],f.prototype,"focusService",void 0),wce([Xui(0,rt("loggerFactory"))],f.prototype,"setBeans",null),wce([ke],f.prototype,"destroyAllBlocks",null),f}(Qi),Kui=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),$E=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Zui=function(P){Kui(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.getRowBounds=function(d){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*d}},f.prototype.ensureRowHeightsValid=function(d,y,T,M){return!1},f.prototype.init=function(){var d=this;this.gridOptionsWrapper.isRowModelInfinite()&&(this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(function(){return d.destroyCache()}),this.verifyProps())},f.prototype.verifyProps=function(){if(this.gridOptionsWrapper.getInitialGroupOrderComparator()!=null){var d="AG Grid: initialGroupOrderComparator cannot be used with Infinite Row Model. If using Infinite Row Model, then sorting is done on the server side, nothing to do with the client.";_o.doOnce(function(){return console.warn(d)},"IRM.InitialGroupOrderComparator")}},f.prototype.start=function(){this.setDatasource(this.gridOptionsWrapper.getDatasource())},f.prototype.destroyDatasource=function(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)},f.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,ai.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,ai.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this))},f.prototype.onFilterChanged=function(){this.reset()},f.prototype.onSortChanged=function(){this.reset()},f.prototype.onColumnEverything=function(){var d;this.cacheParams?d=this.isSortModelDifferent():d=!0,d&&this.reset()},f.prototype.isSortModelDifferent=function(){return!_o.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())},f.prototype.getType=function(){return Fe.ROW_MODEL_TYPE_INFINITE},f.prototype.setDatasource=function(d){this.destroyDatasource(),this.datasource=d,d&&this.reset()},f.prototype.isEmpty=function(){return!this.infiniteCache},f.prototype.isRowsToRender=function(){return!!this.infiniteCache},f.prototype.getNodesInRangeForSelection=function(d,y){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(d,y):[]},f.prototype.reset=function(){if(this.datasource){var d=this.gridOptionsWrapper.getRowIdFunc(),y=d!=null;y||this.selectionService.reset(),this.resetCache();var T=this.createModelUpdatedEvent();this.eventService.dispatchEvent(T)}},f.prototype.createModelUpdatedEvent=function(){return{type:ai.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,newPage:!1,newData:!1,keepRenderedRows:!0,animate:!1}},f.prototype.resetCache=function(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.defaultIfInvalid(this.gridOptionsWrapper.getInfiniteInitialRowCount(),1),maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache(),rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber(),overflowSize:this.defaultIfInvalid(this.gridOptionsWrapper.getCacheOverflowSize(),1),blockSize:this.defaultIfInvalid(this.gridOptionsWrapper.getCacheBlockSize(),100),lastAccessedSequence:new Rg},this.infiniteCache=this.createBean(new Jui(this.cacheParams))},f.prototype.defaultIfInvalid=function(d,y){return d>0?d:y},f.prototype.destroyCache=function(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))},f.prototype.onCacheUpdated=function(){var d=this.createModelUpdatedEvent();this.eventService.dispatchEvent(d)},f.prototype.getRow=function(d){if(this.infiniteCache&&!(d>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(d)},f.prototype.getRowNode=function(d){var y;return this.forEachNode(function(T){T.id===d&&(y=T)}),y},f.prototype.forEachNode=function(d){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(d)},f.prototype.getTopLevelRowCount=function(){return this.getRowCount()},f.prototype.getTopLevelRowDisplayedIndex=function(d){return d},f.prototype.getRowIndexAtPixel=function(d){if(this.rowHeight!==0){var y=Math.floor(d/this.rowHeight),T=this.getRowCount()-1;return y>T?T:y}return 0},f.prototype.getRowCount=function(){return this.infiniteCache?this.infiniteCache.getRowCount():0},f.prototype.isRowPresent=function(d){var y=this.getRowNode(d.id);return!!y},f.prototype.refreshCache=function(){this.infiniteCache&&this.infiniteCache.refreshCache()},f.prototype.purgeCache=function(){this.infiniteCache&&this.infiniteCache.purgeCache()},f.prototype.isLastRowIndexKnown=function(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1},f.prototype.setRowCount=function(d,y){this.infiniteCache&&this.infiniteCache.setRowCount(d,y)},$E([ie("filterManager")],f.prototype,"filterManager",void 0),$E([ie("sortController")],f.prototype,"sortController",void 0),$E([ie("selectionService")],f.prototype,"selectionService",void 0),$E([ie("gridApi")],f.prototype,"gridApi",void 0),$E([ie("columnApi")],f.prototype,"columnApi",void 0),$E([ie("rowRenderer")],f.prototype,"rowRenderer",void 0),$E([ie("rowNodeBlockLoader")],f.prototype,"rowNodeBlockLoader",void 0),$E([Ke],f.prototype,"init",null),$E([ke],f.prototype,"destroyDatasource",null),f=$E([me("rowModel")],f),f}(Qi),Qui={moduleName:i.ModuleNames.InfiniteRowModelModule,rowModels:{infinite:Zui}},Vtt=function(){function P(){}return P.prototype.setBeans=function(f){this.beans=f},P.prototype.getFileName=function(f){var d=this.getDefaultFileExtension();return(f==null||!f.length)&&(f=this.getDefaultFileName()),f.indexOf(".")===-1?f+"."+d:f},P.prototype.getData=function(f){var d=this.createSerializingSession(f),y=this.beans.gridSerializer.serialize(d,f);return y},P}(),Htt=function(){function P(f){this.groupColumns=[];var d=f.columnModel,y=f.valueService,T=f.gridOptionsWrapper,M=f.processCellCallback,U=f.processHeaderCallback,X=f.processGroupHeaderCallback,Se=f.processRowGroupCallback;this.columnModel=d,this.valueService=y,this.gridOptionsWrapper=T,this.processCellCallback=M,this.processHeaderCallback=U,this.processGroupHeaderCallback=X,this.processRowGroupCallback=Se}return P.prototype.prepare=function(f){this.groupColumns=f.filter(function(d){return!!d.getColDef().showRowGroup})},P.prototype.extractHeaderValue=function(f){var d=this.getHeaderName(this.processHeaderCallback,f);return d??""},P.prototype.extractRowCellValue=function(f,d,y,T,M){var U=this.gridOptionsWrapper.isGroupMultiAutoColumn()?M.rowGroupIndex:0,X=M&&M.group&&(d===U&&this.groupColumns.indexOf(f)!==-1||d===0&&this.gridOptionsWrapper.isGroupUseEntireRow(this.columnModel.isPivotMode())),Se;X?Se=this.createValueForGroupNode(M):Se=this.valueService.getValue(f,M);var Pe=this.processCell(y,M,f,Se,this.processCellCallback,T);return Pe??""},P.prototype.getHeaderName=function(f,d){return f?f({column:d,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}):this.columnModel.getDisplayNameForColumn(d,"csv",!0)},P.prototype.createValueForGroupNode=function(f){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:f,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()});var d=[f.key];if(!this.gridOptionsWrapper.isGroupMultiAutoColumn())for(;f.parent;)f=f.parent,d.push(f.key);return d.reverse().join(" -> ")},P.prototype.processCell=function(f,d,y,T,M,U){return M?M({accumulatedRowIndex:f,column:y,node:d,value:T,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:U}):T??""},P}(),Wtt=function(){function P(){}return P.download=function(f,d){var y=document.defaultView||window;if(!y){console.warn("AG Grid: There is no `window` associated with the current `document`");return}var T=document.createElement("a"),M=y.URL.createObjectURL(d);T.setAttribute("href",M),T.setAttribute("download",f),T.style.display="none",document.body.appendChild(T),T.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:y})),document.body.removeChild(T),y.setTimeout(function(){y.URL.revokeObjectURL(M)},0)},P}(),eci=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),qtt=`\r `,tci=function(P){eci(f,P);function f(d){var y=P.call(this,d)||this;y.isFirstLine=!0,y.result="";var T=d.suppressQuotes,M=d.columnSeparator;return y.suppressQuotes=T,y.columnSeparator=M,y}return f.prototype.addCustomContent=function(d){var y=this;d&&(typeof d=="string"?(/^\s*\n/.test(d)||this.beginNewLine(),d=d.replace(/\r?\n/g,qtt),this.result+=d):d.forEach(function(T){y.beginNewLine(),T.forEach(function(M,U){U!==0&&(y.result+=y.columnSeparator),y.result+=y.putInQuotes(M.data.value||""),M.mergeAcross&&y.appendEmptyCells(M.mergeAcross)})}))},f.prototype.onNewHeaderGroupingRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}},f.prototype.onNewHeaderGroupingRowColumn=function(d,y,T){y!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(d),this.appendEmptyCells(T)},f.prototype.appendEmptyCells=function(d){for(var y=1;y<=d;y++)this.result+=this.columnSeparator+this.putInQuotes("")},f.prototype.onNewHeaderRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}},f.prototype.onNewHeaderRowColumn=function(d,y){y!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(d))},f.prototype.onNewBodyRow=function(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}},f.prototype.onNewBodyRowColumn=function(d,y,T){y!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractRowCellValue(d,y,y,Fe.EXPORT_TYPE_CSV,T))},f.prototype.putInQuotes=function(d){if(this.suppressQuotes)return d;if(d==null)return'""';var y;typeof d=="string"?y=d:typeof d.toString=="function"?y=d.toString():(console.warn("AG Grid: unknown value type during csv conversion"),y="");var T=y.replace(/"/g,'""');return'"'+T+'"'},f.prototype.parse=function(){return this.result},f.prototype.beginNewLine=function(){this.isFirstLine||(this.result+=qtt),this.isFirstLine=!1},f}(Htt),ici=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),rj=function(P,f,d,y){var T=arguments.length,M=T<3?f:y===null?y=Object.getOwnPropertyDescriptor(f,d):y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M},Ytt=function(P){ici(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.postConstruct=function(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})},f.prototype.getMergedParams=function(d){var y=this.gridOptionsWrapper.getDefaultExportParams("csv");return Object.assign({},y,d)},f.prototype.export=function(d){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";var y=this.getMergedParams(d),T=this.getData(y),M=new Blob(["\uFEFF",T],{type:"text/plain"});return Wtt.download(this.getFileName(y.fileName),M),T},f.prototype.exportDataAsCsv=function(d){return this.export(d)},f.prototype.getDataAsCsv=function(d){var y=this.getMergedParams(d);return this.getData(y)},f.prototype.getDefaultFileName=function(){return"export.csv"},f.prototype.getDefaultFileExtension=function(){return"csv"},f.prototype.createSerializingSession=function(d){var y=this,T=y.columnModel,M=y.valueService,U=y.gridOptionsWrapper,X=d,Se=X.processCellCallback,Pe=X.processHeaderCallback,at=X.processGroupHeaderCallback,Lt=X.processRowGroupCallback,Kt=X.suppressQuotes,_i=X.columnSeparator;return new tci({columnModel:T,valueService:M,gridOptionsWrapper:U,processCellCallback:Se||void 0,processHeaderCallback:Pe||void 0,processGroupHeaderCallback:at||void 0,processRowGroupCallback:Lt||void 0,suppressQuotes:Kt||!1,columnSeparator:_i||","})},f.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()},rj([ie("columnModel")],f.prototype,"columnModel",void 0),rj([ie("valueService")],f.prototype,"valueService",void 0),rj([ie("gridSerializer")],f.prototype,"gridSerializer",void 0),rj([ie("gridOptionsWrapper")],f.prototype,"gridOptionsWrapper",void 0),rj([Ke],f.prototype,"postConstruct",null),f=rj([me("csvCreator")],f),f}(Vtt),rci=function(){var P=function(f,d){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,T){y.__proto__=T}||function(y,T){for(var M in T)T.hasOwnProperty(M)&&(y[M]=T[M])},P(f,d)};return function(f,d){P(f,d);function y(){this.constructor=f}f.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}}(),FL=function(P,f,d,y){var T=arguments.length,M=T<3?f:y,U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(P,f,d,y);else for(var X=P.length-1;X>=0;X--)(U=P[X])&&(M=(T<3?U(M):T>3?U(f,d,M):U(f,d))||M);return T>3&&M&&Object.defineProperty(f,d,M),M};(function(P){P[P.HEADER_GROUPING=0]="HEADER_GROUPING",P[P.HEADER=1]="HEADER",P[P.BODY=2]="BODY"})(i.RowType||(i.RowType={}));var Xtt=function(P){rci(f,P);function f(){return P!==null&&P.apply(this,arguments)||this}return f.prototype.serialize=function(d,y){y===void 0&&(y={});var T=this.getColumnsToExport(y.allColumns,y.columnKeys),M=_o.compose(this.prepareSession(T),this.prependContent(y),this.exportColumnGroups(y,T),this.exportHeaders(y,T),this.processPinnedTopRows(y,T),this.processRows(y,T),this.processPinnedBottomRows(y,T),this.appendContent(y));return M(d).parse()},f.prototype.processRow=function(d,y,T,M){var U=this,X=y.shouldRowBeSkipped||function(){return!1},Se=this.gridOptionsWrapper,Pe=Se.getContext(),at=Se.getApi(),Lt=Se.getColumnApi(),Kt=Se.isGroupRemoveSingleChildren(),_i=Se.isGroupHideOpenParents(),Si=Se.isGroupRemoveLowestSingleChildren(),Ji=this.columnModel.isPivotMode()?M.leafGroup:!M.group,cr=y.skipGroups||y.skipRowGroups,kr=Si&&M.leafGroup,Er=M.allChildrenCount===1&&(Kt||kr);cr&&y.skipGroups&&_o.doOnce(function(){return console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.")},"gridSerializer-skipGroups");var Vr={rowIndex:M.rowIndex,rowPinned:M.rowPinned};if(!(!Ji&&(y.skipRowGroups||Er||_i)||y.onlySelected&&!M.isSelected()||y.rowNodes&&!y.rowNodes.some(function(ho){return U.rowPositionUtils.sameRow(ho,Vr)})||y.skipPinnedTop&&M.rowPinned==="top"||y.skipPinnedBottom&&M.rowPinned==="bottom")){var kn=M.level===-1;if(!(kn&&!M.leafGroup)){var to=X({node:M,api:at,columnApi:Lt,context:Pe});if(!to){var ol=d.onNewBodyRow();if(T.forEach(function(ho,Bl){ol.onColumn(ho,Bl,M)}),y.getCustomContentBelowRow){var al=y.getCustomContentBelowRow({node:M,api:at,columnApi:Lt,context:Pe});al&&d.addCustomContent(al)}}}}},f.prototype.appendContent=function(d){return function(y){var T=d.customFooter||d.appendContent;return T&&(d.customFooter&&_o.doOnce(function(){return console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.")},"gridSerializer-customFooter"),y.addCustomContent(T)),y}},f.prototype.prependContent=function(d){return function(y){var T=d.customHeader||d.prependContent;return T&&(d.customHeader&&_o.doOnce(function(){return console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.")},"gridSerializer-customHeader"),y.addCustomContent(T)),y}},f.prototype.prepareSession=function(d){return function(y){return y.prepare(d),y}},f.prototype.exportColumnGroups=function(d,y){var T=this;return function(M){if(d.skipColumnGroupHeaders)d.columnGroups&&_o.doOnce(function(){return console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.")},"gridSerializer-columnGroups");else{var U=new Al,X=T.displayedGroupCreator.createDisplayedGroups(y,T.columnModel.getGridBalancedTree(),U,null);T.recursivelyAddHeaderGroups(X,M,d.processGroupHeaderCallback)}return M}},f.prototype.exportHeaders=function(d,y){return function(T){if(!d.skipHeader&&!d.skipColumnHeaders){var M=T.onNewHeaderRow();y.forEach(function(U,X){M.onColumn(U,X,void 0)})}else d.skipHeader&&_o.doOnce(function(){return console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.")},"gridSerializer-skipHeader");return T}},f.prototype.processPinnedTopRows=function(d,y){var T=this;return function(M){var U=T.processRow.bind(T,M,d,y);return T.pinnedRowModel.forEachPinnedTopRow(U),M}},f.prototype.processRows=function(d,y){var T=this;return function(M){var U=T.rowModel,X=U.getType(),Se=X===Fe.ROW_MODEL_TYPE_CLIENT_SIDE,Pe=X===Fe.ROW_MODEL_TYPE_SERVER_SIDE,at=!Se&&d.onlySelected,Lt=T.processRow.bind(T,M,d,y);if(T.columnModel.isPivotMode())Se?U.forEachPivotNode(Lt):U.forEachNode(Lt);else if(d.onlySelectedAllPages||at){var Kt=T.selectionService.getSelectedNodes();Kt.forEach(Lt)}else Se||Pe?U.forEachNodeAfterFilterAndSort(Lt):U.forEachNode(Lt);return M}},f.prototype.processPinnedBottomRows=function(d,y){var T=this;return function(M){var U=T.processRow.bind(T,M,d,y);return T.pinnedRowModel.forEachPinnedBottomRow(U),M}},f.prototype.getColumnsToExport=function(d,y){d===void 0&&(d=!1);var T=this.columnModel.isPivotMode();if(y&&y.length)return this.columnModel.getGridColumns(y);if(d&&!T){var M=this.gridOptionsWrapper.isTreeData()?this.columnModel.getGridColumns([Fe.GROUP_AUTO_COLUMN_ID]):[];return M.concat(this.columnModel.getAllPrimaryColumns()||[])}return this.columnModel.getAllDisplayedColumns()},f.prototype.recursivelyAddHeaderGroups=function(d,y,T){var M=[];d.forEach(function(U){var X=U;X.getChildren&&X.getChildren().forEach(function(Se){return M.push(Se)})}),d.length>0&&d[0]instanceof ei&&this.doAddHeaderHeader(y,d,T),M&&M.length>0&&this.recursivelyAddHeaderGroups(M,y,T)},f.prototype.doAddHeaderHeader=function(d,y,T){var M=this,U=d.onNewHeaderGroupingRow(),X=0;y.forEach(function(Se){var Pe=Se,at;T?at=T({columnGroup:Pe,api:M.gridOptionsWrapper.getApi(),columnApi:M.gridOptionsWrapper.getColumnApi(),context:M.gridOptionsWrapper.getContext()}):at=M.columnModel.getDisplayNameForColumnGroup(Pe,"header");var Lt=Pe.getLeafColumns().reduce(function(Kt,_i,Si,Ji){var cr=_o.last(Kt),kr=_i.getColumnGroupShow()==="open";return kr?(!cr||cr[1]!=null)&&(cr=[Si],Kt.push(cr)):cr&&cr[1]==null&&(cr[1]=Si-1),Si===Ji.length-1&&cr&&cr[1]==null&&(cr[1]=Si),Kt},[]);U.onColumn(at||"",X++,Pe.getLeafColumns().length-1,Lt)})},FL([ie("displayedGroupCreator")],f.prototype,"displayedGroupCreator",void 0),FL([ie("columnModel")],f.prototype,"columnModel",void 0),FL([ie("rowModel")],f.prototype,"rowModel",void 0),FL([ie("pinnedRowModel")],f.prototype,"pinnedRowModel",void 0),FL([ie("selectionService")],f.prototype,"selectionService",void 0),FL([ie("rowPositionUtils")],f.prototype,"rowPositionUtils",void 0),f=FL([me("gridSerializer")],f),f}(Qi),Jtt={moduleName:i.ModuleNames.CsvExportModule,beans:[Ytt,Xtt]},xce=`\r `,nci=function(){function P(){}return P.createHeader=function(f){f===void 0&&(f={});var d="",T=["version"];f.version||(f.version="1.0"),f.encoding&&T.push("encoding"),f.standalone&&T.push("standalone");var M=T.map(function(U){return U+'="'+f[U]+'"'}).join(" ");return d+"xml "+M+" "+y},P.createXml=function(f,d){var y=this,T="";f.properties&&(f.properties.prefixedAttributes&&f.properties.prefixedAttributes.forEach(function(U){Object.keys(U.map).forEach(function(X){T+=y.returnAttributeIfPopulated(U.prefix+X,U.map[X],d)})}),f.properties.rawMap&&Object.keys(f.properties.rawMap).forEach(function(U){T+=y.returnAttributeIfPopulated(U,f.properties.rawMap[U],d)}));var M="<"+f.name+T;return!f.children&&f.textNode==null?M+"/>"+xce:f.textNode!=null?M+">"+f.textNode+""+xce:(M+=">"+xce,f.children&&f.children.forEach(function(U){M+=y.createXml(U,d)}),M+""+xce)},P.returnAttributeIfPopulated=function(f,d,y){if(!d&&d!==""&&d!==0)return"";var T=d;return typeof d=="boolean"&&y&&(T=y(d))," "+f+'="'+T+'"'},P}(),sci=function(P){var f=typeof Symbol=="function"&&Symbol.iterator,d=f&&P[f],y=0;if(d)return d.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&y>=P.length&&(P=void 0),{value:P&&P[y++],done:!P}}};throw new TypeError(f?"Object is not iterable.":"Symbol.iterator is not defined.")},oci=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),aci=function(){function P(){}return P.addFolders=function(f){f.forEach(this.addFolder.bind(this))},P.addFolder=function(f){this.folders.push({path:f,created:new Date,isBase64:!1})},P.addFile=function(f,d,y){y===void 0&&(y=!1),this.files.push({path:f,created:new Date,content:d,isBase64:y})},P.getContent=function(f){f===void 0&&(f="application/zip");var d=this.buildFileStream(),y=this.buildUint8Array(d);return this.clearStream(),new Blob([y],{type:f})},P.clearStream=function(){this.folders=[],this.files=[]},P.buildFileStream=function(f){var d,y;f===void 0&&(f="");var T=this.folders.concat(this.files),M=T.length,U="",X=0,Se=0;try{for(var Pe=sci(T),at=Pe.next();!at.done;at=Pe.next()){var Lt=at.value,Kt=this.getHeader(Lt,X),_i=Kt.fileHeader,Si=Kt.folderHeader,Ji=Kt.content;X+=_i.length+Ji.length,Se+=Si.length,f+=_i+Ji,U+=Si}}catch(kr){d={error:kr}}finally{try{at&&!at.done&&(y=Pe.return)&&y.call(Pe)}finally{if(d)throw d.error}}var cr=this.buildFolderEnd(M,Se,X);return f+U+cr},P.getHeader=function(f,d){var y=f.content,T=f.path,M=f.created,U=f.isBase64,X=_o.utf8_encode,Se=_o.decToHex,Pe=X(T),at=Pe!==T,Lt=this.convertTime(M),Kt=this.convertDate(M),_i="";if(at){var Si=Se(1,1)+Se(this.getFromCrc32Table(Pe),4)+Pe;_i="up"+Se(Si.length,2)+Si}var Ji=y?this.getConvertedContent(y,U):{size:0,content:""},cr=Ji.size,kr=Ji.content,Er=` -\0`+(at?"\0\b":"\0\0")+"\0\0"+Se(Lt,2)+Se(Kt,2)+Se(cr?this.getFromCrc32Table(kr):0,4)+Se(cr,4)+Se(cr,4)+Se(Pe.length,2)+Se(_i.length,2),Vr="PK"+Er+Pe+_i,kn="PK\0"+Er+"\0\0\0\0\0\0"+(y?"\0\0\0\0":"\0\0\0")+Se(d,4)+Pe+_i;return{fileHeader:Vr,folderHeader:kn,content:kr||""}},P.getConvertedContent=function(f,d){return d===void 0&&(d=!1),d&&(f=f.split(";base64,")[1]),f=d?atob(f):f,{size:f.length,content:f}},P.buildFolderEnd=function(f,d,y){var T=_o.decToHex;return"PK\0\0\0\0"+T(f,2)+T(f,2)+T(d,4)+T(y,4)+"\0\0"},P.buildUint8Array=function(f){for(var d=new Uint8Array(f.length),y=0;y>>8^Se;return M^-1},P.convertTime=function(f){var d=f.getHours();return d<<=6,d=d|f.getMinutes(),d<<=5,d=d|f.getSeconds()/2,d},P.convertDate=function(f){var d=f.getFullYear()-1980;return d<<=4,d=d|f.getMonth()+1,d<<=5,d=d|f.getDate(),d},P.folders=[],P.files=[],P}();Yt.register(Wui,!1),Yt.register(Qui,!1),Yt.register(Jtt,!1),i.AbstractHeaderCellCtrl=iJ,i.AgAbstractField=bo,i.AgAngleSelect=ttt,i.AgCheckbox=q7,i.AgColorPicker=itt,i.AgDialog=dAe,i.AgGroupComponent=rtt,i.AgInputNumberField=Zet,i.AgInputRange=Qet,i.AgInputTextArea=Ket,i.AgInputTextField=cAe,i.AgMenuItemComponent=J7,i.AgMenuList=att,i.AgMenuPanel=ltt,i.AgPanel=hAe,i.AgPromise=Dg,i.AgRadioButton=Xet,i.AgSelect=LX,i.AgSlider=ett,i.AgStackComponentsRegistry=Gr,i.AgToggleButton=Jet,i.AlignedGridsService=ptt,i.AnimateShowChangeCellRenderer=Bue,i.AnimateSlideCellRenderer=jue,i.AnimationFrameService=ket,i.AutoScrollService=XQe,i.AutoWidthCalculator=Bet,i.Autowired=ie,i.BaseComponentWrapper=Iui,i.BaseCreator=Vtt,i.BaseGridSerializingSession=Htt,i.Bean=me,i.BeanStub=Qi,i.Beans=JIe,i.BodyDropPivotTarget=get,i.BodyDropTarget=vet,i.CellComp=pet,i.CellCtrl=oD,i.CellNavigationService=dtt,i.CellPositionUtils=Ftt,i.ChangedPath=nce,i.CheckboxSelectionComponent=B7,i.ColDefUtil=co,i.Color=Hs,i.Column=G,i.ColumnApi=mtt,i.ColumnFactory=ko,i.ColumnGroup=ei,i.ColumnKeyCreator=v,i.ColumnModel=dt,i.ColumnUtils=oi,i.Component=ka,i.ComponentUtil=Fi,i.Constants=Fe,i.Context=st,i.CssClassApplier=eAe,i.CssClassManager=bue,i.CsvCreator=Ytt,i.CsvExportModule=Jtt,i.CtrlsService=$tt,i.CustomTooltipFeature=_L,i.DateFilter=jX,i.DisplayedGroupCreator=kt,i.Downloader=Wtt,i.DragAndDropService=kg,i.DragService=UQe,i.Environment=Ott,i.EventService=_t,i.Events=ai,i.ExpressionService=vtt,i.FilterManager=zQe,i.FloatingFilterMapper=jQe,i.FocusService=K7,i.Grid=Cui,i.GridApi=wet,i.GridBodyComp=oet,i.GridBodyCtrl=QQe,i.GridComp=Stt,i.GridCoreCreator=jtt,i.GridCtrl=xtt,i.GridHeaderComp=Oet,i.GridHeaderCtrl=Met,i.GridOptionsWrapper=as,i.GridSerializer=Xtt,i.GroupCellRenderer=U7,i.GroupCellRendererCtrl=Bf,i.GroupInstanceIdCreator=Al,i.HeaderCellCtrl=Cet,i.HeaderFilterCellComp=VQe,i.HeaderFilterCellCtrl=Tet,i.HeaderGroupCellCtrl=Eet,i.HeaderNavigationService=Aet,i.HeaderPositionUtils=Ltt,i.HeaderRowComp=bet,i.HeaderRowContainerComp=tce,i.HeaderRowContainerCtrl=Iet,i.HeaderRowCtrl=ece,i.HorizontalResizeService=Pet,i.KeyCode=sn,i.LargeTextCellEditor=WX,i.Logger=cce,i.LoggerFactory=wtt,i.ManagedFocusFeature=iw,i.ModuleRegistry=Yt,i.MouseEventService=cet,i.MoveColumnFeature=yet,i.NavigationService=het,i.NumberFilter=UX,i.NumberSequence=Rg,i.Optional=ge,i.PaginationProxy=Wet,i.PinnedRowModel=Vet,i.PopupComponent=t2,i.PopupEditorWrapper=det,i.PopupSelectCellEditor=XX,i.PopupService=ctt,i.PopupTextCellEditor=$ue,i.PositionableFeature=$et,i.PostConstruct=Ke,i.PreConstruct=ye,i.PreDestroy=ke,i.PropertyKeys=xt,i.ProvidedColumnGroup=Xt,i.ProvidedFilter=wL,i.Qualifier=rt,i.QuerySelector=wue,i.RefSelector=Mr,i.ResizeObserverService=Fet,i.RowContainerComp=fet,i.RowContainerCtrl=Xue,i.RowCtrl=aD,i.RowNode=Va,i.RowNodeBlock=sce,i.RowNodeBlockLoader=Het,i.RowNodeSorter=Ntt,i.RowPositionUtils=Dtt,i.RowRenderer=Get,i.ScalarFilter=rf,i.ScrollVisibleService=aet,i.SelectCellEditor=YX,i.SelectableService=Rtt,i.SelectionService=ftt,i.SetLeftFeature=Kue,i.SimpleFilter=Id,i.SortController=Ttt,i.StandardMenuFactory=Ret,i.StylingService=Yet,i.TabGuardComp=cJ,i.TabGuardCtrl=stt,i.TabbedLayout=yai,i.TemplateService=_tt,i.TextCellEditor=CL,i.TextFilter=SL,i.TextFloatingFilter=VX,i.Timer=rr,i.TouchListener=S_,i.UserComponentFactory=GQe,i.UserComponentRegistry=$t,i.ValueCache=Ett,i.ValueFormatterService=zet,i.ValueService=gtt,i.VanillaFrameworkOverrides=htt,i.VirtualList=hli,i.XmlFactory=nci,i.ZipContainer=aci,i._=_o,i.defaultGroupComparator=Eui,i.getRowContainerTypeForName=set,i.simpleHttpRequest=vai,i.stringToArray=Ll})(aE);var Rre=globalThis&&globalThis.__assign||function(){return Rre=Object.assign||function(i){for(var e,t=1,r=arguments.length;t0},i.mapChildColumnDefs=function(e){return e.default.map(function(t){return i.toColDef(t)})},i.toColDef=function(e){var t=i.createColDefFromGridColumn(e);return e.children&&e.children.length>0&&(t.children=i.getChildColDefs(e.children)),t},i.getChildColDefs=function(e){return e.map(function(t){return i.createColDefFromGridColumn(t)})},i.createColDefFromGridColumn=function(e){var t={};return Object.assign(t,e.data.attrs),delete t.children,aE.ColDefUtil.BOOLEAN_PROPERTIES.forEach(function(r){var n=t;n[r]===""&&(n[r]=!0)}),t},i}(),nAn=globalThis&&globalThis.__extends||function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},i(e,t)};return function(e,t){i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),sAn=function(i){nAn(e,i);function e(t){var r=i.call(this)||this;return r.parent=t,r}return e.prototype.frameworkComponent=function(t){return BJt.searchForComponentInstance(this.parent,t,10,!0)?t:null},e.prototype.isFrameworkComponent=function(t){return typeof t=="object"},e}(aE.VanillaFrameworkOverrides),Ewe=globalThis&&globalThis.__assign||function(){return Ewe=Object.assign||function(i){for(var e,t=1,r=arguments.length;t{const s=Ko("dropdown-menu");return qt(),Dn(s,{class:"relative",position:"bottom-end",tooltip:ri(t)("grid.label.columns"),"tooltip-placement":"bottom",centered:!1},{header:Rn(()=>[hAn]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(i.columnDefs.filter(o=>o.headerName&&o.headerName.length>0&&!(!ri(e).ui.exposeOids&&i.systemCols?.has(o.headerName))&&!(!ri(e).ui.exposeMeasurements&&(i.systemCols?.has(o.headerName)||i.systemCols?.has(o.field)))),o=>(qt(),si("a",{key:o.headerName,onClick:a=>{i.columnApi?.setColumnVisible(o.field,o.hide),o.hide=!o.hide,r.$emit("refreshHeaders")},href:"javascript:;",class:"flex leading-snug items-center w-256"},[Ot("div",pAn,[Xs(br(o.headerName)+" ",1),o.hide?Yr("",!0):(qt(),si("svg",fAn,gAn))])],8,dAn))),128))]),_:1},8,["tooltip"])}}}),vAn=".ag-root",_An=".ag-header-viewport .ag-header-row";class g_t{element;agGrid;headerRows;agGridApi;agColumnApi;mousedown=!1;static onCellKeyPress({event:e}){function t(r){r.forEach(n=>{n.href&&window.open(n.href),n.childNodes.length>0&&t(n.childNodes)})}e.key=="Enter"&&t(e.target.childNodes)}constructor(e,t,r){this.element=e,this.agGridApi=t,this.agColumnApi=r,this.agGrid=this.element.querySelector(vAn),this.headerRows=Array.prototype.slice.call(this.element.querySelectorAll(_An)),this.element.querySelector(".ag-body-horizontal-scroll-viewport")?.setAttribute("tabindex","-1"),this.initAccessibilityListeners(),this.initScrollListeners()}initAccessibilityListeners(){Array.prototype.slice.call(this.headerRows[0].querySelectorAll(".ag-header-cell")).forEach((t,r)=>{if(r<3)return;const n=Array.prototype.slice.call(t.querySelectorAll("button"));t.addEventListener("keydown",s=>{this.cellKeydownHandler(s,t,n)}),t.addEventListener("blur",s=>{this.cellBlurHandler(s,t,n)}),n[n.length-1].addEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!1)}),n[0].addEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!0)})})}removeAccessibilityListeners(){Array.prototype.slice.call(this.headerRows[0].querySelectorAll(".ag-header-cell")).forEach((t,r)=>{if(r<3)return;const n=Array.prototype.slice.call(t.querySelectorAll("button"));t.removeEventListener("keydown",s=>{this.cellKeydownHandler(s,t,n)}),t.removeEventListener("blur",s=>{this.cellBlurHandler(s,t,n)}),n[n.length-1].removeEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!1)}),n[0].removeEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!0)})})}cellKeydownHandler(e,t,r){e.key==="Enter"&&e.target===t&&(e.preventDefault(),r.forEach(n=>{n.setAttribute("tabindex","0")}),r[0].focus())}cellBlurHandler(e,t,r){e.target===t&&!r.includes(e.relatedTarget)&&r.forEach(n=>{n.setAttribute("tabindex","-1")})}cellButtonTabHandler(e,t,r,n){e.key==="Tab"&&(n&&e.shiftKey||!n&&!e.shiftKey)&&(e.preventDefault(),t.focus(),r.forEach(s=>{s.setAttribute("tabindex","-1")}))}initScrollListeners(){this.agGrid.style.cursor="grab",this.agGrid.addEventListener("mousedown",e=>{this.scrollMouseDownHandler(e)})}removeScrollListeners(){this.agGrid.style.cursor="default",this.agGrid.removeEventListener("mousedown",e=>{this.scrollMouseDownHandler(e)})}scrollMouseDownHandler(e){const t=this.element.querySelector(".ag-body-horizontal-scroll-viewport"),r=t.scrollLeft,n=e.clientX;this.agGrid.style.cursor="grabbing";const s=a=>{const l=a.clientX-n;t.scrollLeft=r-l},o=()=>{this.agGrid.style.cursor="grab",this.agGrid.removeEventListener("mousemove",s),this.agGrid.removeEventListener("mouseup",o),this.agGrid.removeEventListener("mouseleave",o)};this.agGrid.addEventListener("mousemove",s),this.agGrid.addEventListener("mouseup",o),this.agGrid.addEventListener("mouseleave",o)}}function bAn(i){const e=i.previousHeaderPosition.column,t=i.previousHeaderPosition.headerRowIndex;let r=i.backwards?t-1:t+1;return r===-1?null:(r===i.headerRowCount&&(r=-1),{headerRowIndex:r,column:e})}function wAn(i){return i.backwards?{column:i.previousCellPosition.column,rowIndex:-1}:null}const xAn=i=>(Dc("data-v-81f67cc1"),i=i(),Fc(),i),SAn={class:"h-full flex items-center justify-center"},TAn=["placeholder","aria-label","disabled"],CAn=xAn(()=>Ot("span",{class:"w-12"},null,-1)),EAn=["placeholder","aria-label","disabled"],IAn={methods:{onParentModelChanged(){}}},AAn=Xr({...IAn,__name:"custom-number-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(""),o=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),a=()=>{n.value=n.value!==""&&!isNaN(n.value)?n.value:null,e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value,"min")})},l=()=>{s.value=s.value!==""&&!isNaN(s.value)?s.value:null,e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,s.value,"max")})},u=c=>{(isNaN(n.value)||n.value===null)&&(n.value=""),(isNaN(s.value)||s.value===null)&&(s.value=""),s.value!==""&&n.value!==""?c.setModel({filterType:"number",type:"inRange",filter:n.value,filterTo:s.value}):n.value===""?c.setModel({filterType:"number",type:"lessThanOrEqual",filter:s.value}):s.value===""?c.setModel({filterType:"number",type:"greaterThanOrEqual",filter:n.value}):c.setModel(null),e.params.api.onFilterChanged()};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"min"),s.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"max"),a(),l()}),(c,h)=>(qt(),si("div",SAn,[Ur(Ot("input",{class:Wn(["rv-min rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),style:{width:"45%"},type:"number","onUpdate:modelValue":h[0]||(h[0]=p=>n.value=p),onInput:h[1]||(h[1]=p=>a()),onMousedown:h[2]||(h[2]=ia(()=>{},["stop"])),onKeypress:h[3]||(h[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[4]||(h[4]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.number.min"),"aria-label":ri(r)("grid.filters.number.min"),disabled:o.value},null,42,TAn),[[LS,n.value]]),CAn,Ur(Ot("input",{class:Wn(["rv-max rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),style:{width:"45%"},type:"number","onUpdate:modelValue":h[5]||(h[5]=p=>s.value=p),onInput:h[6]||(h[6]=p=>l()),onMousedown:h[7]||(h[7]=ia(()=>{},["stop"])),onKeypress:h[8]||(h[8]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[9]||(h[9]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.number.max"),"aria-label":ri(r)("grid.filters.number.max"),disabled:o.value},null,42,EAn),[[LS,s.value]])]))}}),MAn=ml(AAn,[["__scopeId","data-v-81f67cc1"]]),OAn={class:"h-full flex items-center justify-center"},PAn=["placeholder","aria-label","disabled"],RAn={methods:{onParentModelChanged(){}}},DAn=Xr({...RAn,__name:"custom-text-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),o=()=>{e.params.parentFilterInstance(a=>{n.value=n.value?n.value:"",a.setModel({filterType:"text",type:"contains",filter:n.value}),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value),e.params.api.onFilterChanged()})};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field),o()}),(a,l)=>(qt(),si("div",OAn,[Ur(Ot("input",{class:Wn(["rv-input w-full bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":s.value}]),type:"text",onInput:l[0]||(l[0]=u=>o()),"onUpdate:modelValue":l[1]||(l[1]=u=>n.value=u),onMousedown:l[2]||(l[2]=ia(()=>{},["stop"])),onKeypress:l[3]||(l[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:l[4]||(l[4]=Ph(u=>{ri(t).mobileView&&u.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.column.label.text",[i.params.column.colDef.headerName]),"aria-label":ri(r)("grid.filters.column.label.text",[i.params.column.colDef.headerName]),disabled:s.value},null,42,PAn),[[LS,n.value]])]))}}),FAn={class:"h-full flex items-center justify-center"},kAn=["aria-label","disabled"],LAn=["value"],NAn={methods:{onParentModelChanged(){}}},$An=Xr({...NAn,__name:"custom-selector-filter",props:["params"],setup(i){const e=i,t=vi(""),r=vi([]),n=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),s=()=>{t.value=t.value?t.value:"",e.params.parentFilterInstance(o=>{t.value==="..."?(o.setModel(null),t.value=""):o.setModel({filterType:"text",type:"contains",filter:t.value}),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,t.value),e.params.api.onFilterChanged()})};return E0(()=>{t.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field);let o=e.params.rowData;o=o.map(a=>a[e.params.column.colId]),r.value=o.filter((a,l)=>o.indexOf(a)===l),r.value.unshift("..."),s()}),(o,a)=>(qt(),si("div",FAn,[Ur(Ot("select",{class:Wn(["rv-input w-full bg-white text-black-75 h-24 py-0 px-8 border-2 rounded",{"cursor-not-allowed":n.value}]),"onUpdate:modelValue":a[0]||(a[0]=l=>t.value=l),onChange:a[1]||(a[1]=l=>s()),onMousedown:a[2]||(a[2]=ia(()=>{},["stop"])),"aria-label":t.value,disabled:n.value},[(qt(!0),si(Ks,null,hu(r.value,l=>(qt(),si("option",{value:l,key:l},br(l),9,LAn))),128))],42,kAn),[[ZSe,t.value]])]))}}),BAn=ml($An,[["__scopeId","data-v-401a2b3c"]]),jAn=i=>(Dc("data-v-df09f5c8"),i=i(),Fc(),i),GAn={class:"h-full flex items-center justify-center w-full"},UAn=["placeholder","aria-label","disabled"],zAn=jAn(()=>Ot("span",{class:"w-12"},null,-1)),VAn=["placeholder","aria-label","disabled"],HAn={methods:{onParentModelChanged(){}}},WAn=Xr({...HAn,__name:"custom-date-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(""),o=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),a=()=>{e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value,"min")})},l=()=>{e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,s.value,"max")})},u=c=>{s.value===""&&n.value===""?c.setModel(null):s.value!==""&&n.value!==""?c.setModel({filterType:"date",type:"inRange",dateFrom:n.value,dateTo:s.value}):n.value===""?c.setModel({filterType:"date",type:"lessThan",dateFrom:s.value}):s.value===""&&c.setModel({filterType:"date",type:"greaterThan",dateFrom:n.value}),e.params.api.onFilterChanged()};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"min")||"",s.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"max")||"",a(),l()}),(c,h)=>(qt(),si("div",GAn,[Ur(Ot("input",{class:Wn(["m-0 py-1 w-1/2 rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),type:"date",placeholder:ri(r)("grid.filters.date.min"),"aria-label":ri(r)("grid.filters.date.min"),"onUpdate:modelValue":h[0]||(h[0]=p=>n.value=p),onInput:h[1]||(h[1]=p=>a()),onMousedown:h[2]||(h[2]=ia(()=>{},["stop"])),onKeypress:h[3]||(h[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[4]||(h[4]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",disabled:o.value},null,42,UAn),[[LS,n.value]]),zAn,Ur(Ot("input",{class:Wn(["m-0 py-1 w-1/2 rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),type:"date",placeholder:ri(r)("grid.filters.date.max"),"aria-label":ri(r)("grid.filters.date.max"),"onUpdate:modelValue":h[5]||(h[5]=p=>s.value=p),onInput:h[6]||(h[6]=p=>l()),onMousedown:h[7]||(h[7]=ia(()=>{},["stop"])),onKeypress:h[8]||(h[8]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[9]||(h[9]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",disabled:o.value},null,42,VAn),[[LS,s.value]])]))}}),qAn=ml(WAn,[["__scopeId","data-v-df09f5c8"]]),YAn=["content","disabled"],XAn=Ot("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",class:"h-24 w-24 fill-current",viewBox:"0 0 24 24"},[Ot("g",null,[Ot("rect",{fill:"none",height:"24",width:"24"})]),Ot("g",null,[Ot("g",null,[Ot("path",{d:"M19.79,5.61C20.3,4.95,19.83,4,19,4H6.83l7.97,7.97L19.79,5.61z"}),Ot("path",{d:"M2.81,2.81L1.39,4.22L10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-2.17l5.78,5.78l1.41-1.41L2.81,2.81z"})])])],-1),JAn=[XAn],KAn=Xr({__name:"clear-filter",props:["params"],setup(i){const e=i,{t}=Qn(),r=vi(),n=()=>e.params.clearFilters();return Fa(async()=>{await Bv();const s=r.value?.closest(".ag-header-cell"),o=s.closest(".ag-pinned-left-header");s.addEventListener("keydown",async a=>{a.key==="Enter"&&(a.stopPropagation(),n(),await Bv(),o.querySelector(".ag-header-cell.ag-floating-filter").focus())}),s.addEventListener("focus",()=>{r.value._tippy.show()}),s.addEventListener("blur",()=>{r.value._tippy.hide()})}),Ka(()=>{const s=r.value?.closest(".ag-header-cell"),o=s.closest(".ag-pinned-left-header");s.removeEventListener("keydown",async a=>{a.key==="Enter"&&(a.stopPropagation(),n(),await Bv(),o.querySelector(".ag-header-cell.ag-floating-filter").focus())}),s.removeEventListener("focus",()=>{r.value._tippy.show()}),s.removeEventListener("blur",()=>{r.value._tippy.hide()})}),(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{type:"button",class:"clearFilterButton flex items-center justify-center w-full h-full disabled:opacity-30 disabled:cursor-default text-gray-500 hover:text-black",onClick:n,content:ri(t)("grid.filters.clear"),disabled:!i.params.stateManager.filtered,tabindex:"-1",ref_key:"el",ref:r},JAn,8,YAn)),[[a,{placement:"bottom"}]])}}}),ZAn={key:0,class:"flex flex-1 items-center min-w-0","truncate-trigger":""},QAn=["content","aria-label"],e3n={key:1,class:"customHeaderLabel",role:"columnheader"},t3n={key:2,class:"flex"},i3n={key:0,class:"w-24 inline-block"},r3n={key:1,class:"customSortDownLabel"},n3n=Ot("div",{class:"md-icon-small"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"arrow_upward"},[Ot("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})])])],-1),s3n=[n3n],o3n={key:2,class:"customSortUpLabel"},a3n=Ot("div",{class:"md-icon-small"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"arrow_downward"},[Ot("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})])])],-1),l3n=[a3n],u3n=["content","aria-label","disabled"],c3n=Ot("div",{class:"inline-block"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"keyboard_arrow_left"},[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])])],-1),h3n=[c3n],d3n=["content","aria-label","disabled"],p3n=Ot("div",{class:"inline-block"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"keyboard_arrow_right"},[Ot("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"})])])],-1),f3n=[p3n],m3n=Xr({__name:"custom-header",props:["params"],setup(i){const e=i,{t}=Qn(),r=vi(),n=vi(0),s=vi(!1),o=vi(!1),a=vi(!1),l=vi(null),u=()=>{const m=l.value.getAllDisplayedColumns(),v=m.indexOf(e.params.column);o.value=v>3&&!m[v-1].colDef.isStatic,a.value=v{const m=l.value.getAllDisplayedColumns(),v=l.value.getAllGridColumns(),w=v.indexOf(m[m.indexOf(e.params.column)-1]);o.value&&(l.value.moveColumn(e.params.column,w),e.params.api.ensureColumnVisible(v[w]),r.value?.closest(".ag-header-row")?.querySelector(`[col-id="${e.params.column.colId}"]`)?.querySelector(".move-left")?.focus())},h=()=>{const m=l.value.getAllDisplayedColumns(),v=l.value.getAllGridColumns(),w=v.indexOf(m[m.indexOf(e.params.column)+1]);a.value&&(l.value.moveColumn(e.params.column,w),e.params.api.ensureColumnVisible(v[w]))},p=m=>{n.value=(n.value+1)%3,n.value===1?e.params.setSort("asc",m.shiftKey):n.value===2?e.params.setSort("desc",m.shiftKey):e.params.setSort("none",m.shiftKey)};return Fa(()=>{s.value=e.params.column.colDef.sortable,l.value=e.params.columnApi,e.params.sort==="asc"?(n.value=1,e.params.setSort("asc")):e.params.sort==="desc"&&(n.value=2,e.params.setSort("desc")),u(),e.params.column.addEventListener("leftChanged",()=>{u()})}),Ka(()=>{e.params.column.removeEventListener("leftChanged",()=>{u()})}),(m,v)=>{const w=Nn("truncate"),S=Nn("tippy");return qt(),si("div",{class:"ag-custom-header flex flex-1 items-center h-full w-full",ref_key:"el",ref:r},[s.value?(qt(),si("div",ZAn,[Ur((qt(),si("button",{type:"button",onClick:v[0]||(v[0]=I=>p(I)),content:ri(t)(`grid.header.sort.${n.value}`),"aria-label":ri(t)(`grid.header.sort.${n.value}`),class:"customHeaderLabel hover:bg-gray-300 font-bold p-8 max-w-full",role:"columnheader",tabindex:"-1"},[Ur((qt(),si("div",null,[Xs(br(i.params.displayName),1)])),[[w,{externalTrigger:!0}]])],8,QAn)),[[S,{placement:"top",hideOnClick:!1}]])])):Ur((qt(),si("span",e3n,[Xs(br(i.params.displayName),1)])),[[w]]),s.value?(qt(),si("div",t3n,[i.params.enableSorting&&n.value===0?(qt(),si("span",i3n)):Yr("",!0),i.params.enableSorting&&n.value===1?(qt(),si("span",r3n,s3n)):Yr("",!0),i.params.enableSorting&&n.value===2?(qt(),si("span",o3n,l3n)):Yr("",!0),Ur((qt(),si("button",{type:"button",content:ri(t)("grid.header.reorder.left"),"aria-label":ri(t)("grid.header.reorder.left"),onClick:v[1]||(v[1]=I=>c()),class:"move-left opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default flex justify-center items-center",tabindex:"-1",disabled:!o.value},h3n,8,u3n)),[[S,{placement:"top"}]]),Ur((qt(),si("button",{type:"button",content:ri(t)("grid.header.reorder.right"),"aria-label":ri(t)("grid.header.reorder.right"),onClick:v[2]||(v[2]=I=>h()),class:"move-right opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default flex justify-center items-center",tabindex:"-1",disabled:!a.value},f3n,8,d3n)),[[S,{placement:"top"}]])])):Yr("",!0)],512)}}}),g3n=["content"],y3n=Ot("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"16",viewBox:"0 0 24 24",width:"16"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{style:{fill:"#979797"},d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1),v3n=[y3n],_3n=Xr({__name:"details-button-renderer",props:["params"],setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=vi(),s=async()=>{const o=e.params.data,a=o.rvUid,l=r.geo.layer.getLayer(a),u=l.oidField,h=e.params.layerCols[l.id].find(m=>m.origAttr===u)?.mappedAttr||u,p=await l.getGraphic(o[h],{getAttribs:!0});r.event.emit(ln.DETAILS_TOGGLE,{data:p.attributes,uid:a,format:z8.ESRI},!0),e.params.isTeleport&&r.scrollToInstance()};return Fa(()=>{e.params.eGridCell.addEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.addEventListener("focus",()=>{n.value._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{n.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.removeEventListener("focus",()=>{n.value._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{n.value._tippy.hide()})}),(o,a)=>{const l=Nn("tippy");return Ur((qt(),si("button",{type:"button",class:"flex items-center justify-center w-40 h-36",content:ri(t)("grid.cells.details"),onClick:s,tabindex:"-1",ref_key:"el",ref:n},v3n,8,g3n)),[[l,{placement:"top"}]])}}}),b3n=["content"],w3n={key:0,class:"m-auto animate-spin spinner h-20 w-20"},x3n={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"w-20 h-20"},S3n=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1),T3n=[S3n],C3n={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"w-20 h-20"},E3n=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),I3n=[E3n],A3n=["innerHTML"],M3n=Xr({__name:"zoom-button-renderer",props:["params"],setup(i){const e=i,t=vi("none"),r=eo("iApi"),n=H1(),s=vi(),{t:o}=Qn(),a=Hr(()=>{const c=n.getLayerByUid(e.params.data.rvUid);return!!c&&c.mapLayer}),l=()=>{if(t.value!=="none")return;t.value="zooming";const c=n.getLayerByUid(e.params.data.rvUid);if(c===void 0||!c.isLoaded){u("error");return}const h=e.params.layerCols[c.id].find(v=>v.origAttr===c.oidField),p=e.params.data[h.mappedAttr??h.origAttr],m=()=>{const v={getGeom:!0};c.getGraphic(p,v).then(w=>{w.geometry.invalid()?(console.error(`Could not find graphic for objectid ${p}`),u("error")):(r.geo.map.zoomMapTo(w.geometry),u("zoomed"),r.updateAlert(r.$i18n.t("grid.cells.alert.zoom")),e.params.isTeleport&&r.scrollToInstance())}).catch(()=>{u("error")})};c.layerType===pn.FEATURE&&c.geomType!==cl.POINT?c.getGraphicExtent(p).then(v=>{r.geo.map.zoomMapTo(v),u("zoomed"),r.updateAlert(r.$i18n.t("grid.cells.alert.zoom")),e.params.isTeleport&&r.scrollToInstance()}).catch(()=>{m()}):m()},u=c=>{c==="zoomed"||c==="error"?setTimeout(()=>{t.value=c,s.value?._tippy.show(),setTimeout(()=>{s.value?._tippy.hide(),t.value="none"},3e3)},300):t.value=c};return Fa(()=>{a.value&&(e.params.eGridCell.addEventListener("keydown",c=>{c.key==="Enter"&&t.value==="none"&&l()}),e.params.eGridCell.addEventListener("focus",()=>{s.value?._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{s.value?._tippy.hide()}))}),Ka(()=>{a.value&&(e.params.eGridCell.removeEventListener("keydown",c=>{c.key==="Enter"&&l()}),e.params.eGridCell.removeEventListener("focus",()=>{s.value?._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{s.value?._tippy.hide()}))}),(c,h)=>{const p=Nn("tippy");return a.value?Ur((qt(),si("button",{key:0,type:"button",class:"flex items-center justify-center w-40 h-36",content:ri(o)(`grid.cells.zoom${t.value==="none"?"":`.${t.value}`}`),onClick:l,tabindex:"-1",ref_key:"button",ref:s},[t.value==="zooming"?(qt(),si("div",w3n)):t.value==="zoomed"?(qt(),si("svg",x3n,T3n)):t.value==="error"?(qt(),si("svg",C3n,I3n)):(qt(),si("span",{key:3,innerHTML:ri(r).ui.getZoomIcon()},null,8,A3n))],8,b3n)),[[p,{placement:"top"}]]):Yr("",!0)}}}),O3n=["content"],P3n=["innerHTML"],R3n=Xr({__name:"custom-button-renderer",props:["params"],setup(i){const e=i,t=eo("iApi"),r=vi(),n=Hr(()=>{let o=Object.assign({},e.params.data);const a=t.geo.layer.getLayer(o.rvUid),l=e.params.config.displayOn;return!(!a||l==="geo"&&!a.mapLayer||l==="data"&&a.mapLayer)}),s=()=>{let o=Object.assign({},e.params.data);const a=t.geo.layer.getLayer(o.rvUid),l=e.params.layerCols[a.id].find(c=>c.origAttr===a.oidField),u=l.mappedAttr?o[l.mappedAttr]:o[l.origAttr];a.getGraphic(u,{getAttribs:!0}).then(c=>{t.event.emit(e.params.config.actionEvent,{data:c.attributes,layer:a,uid:e.params.data.rvUid,oid:u})})};return Fa(()=>{e.params.eGridCell.addEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.addEventListener("focus",()=>{r.value._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{r.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.removeEventListener("focus",()=>{r.value._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{r.value._tippy.hide()})}),(o,a)=>{const l=Nn("tippy");return n.value?Ur((qt(),si("button",{key:0,type:"button",class:"flex items-center justify-center w-42 h-38",content:e.params.config.tooltip,onClick:s,tabindex:"-1",ref_key:"el",ref:r},[Ot("span",{innerHTML:e.params.config.icon},null,8,P3n)],8,O3n)),[[l,{placement:"top"}]]):Yr("",!0)}}}),D3n=["name","content","innerHTML"],F3n=["content"],MRe=Xr({__name:"cell-renderer",props:["params"],setup(i){const e=i,t=w0(),r=eo("iApi"),{t:n}=Qn(),s=vi(),o=vi(),a=vi(!1),l=Hr(()=>t.mobileView),u=()=>{o.value?.textContent&&(a.value=!0,s.value?._tippy.show(),navigator.clipboard.writeText(o.value?.textContent),setTimeout(()=>{a.value=!1},2e3))},c=Hr(()=>e.params.type==="number"?e.params.value==null?"":r.ui.formatNumber(e.params.value):e.params.type==="date"?e.params.value==null?"":new Date(e.params.value).toISOString().slice(0,10):e.params.type==="string"?!e.params.value||/]*>[^<]+<\/a>/g.test(e.params.value)?e.params.value:gTe(e.params.value,{target:"_blank",validate:{url:p=>/^https?:\/\//.test(p)}}):""),h=Hr(()=>/]*>[^<]+<\/a>/g.test(e.params.value)||/(http(s)?:\/\/.*)/g.test(e.params.value));return Fa(()=>{e.params.eGridCell.addEventListener("dblclick",()=>{u()}),e.params.eGridCell.addEventListener("keydown",p=>{p.ctrlKey&&p.code==="KeyC"&&u()}),e.params.eGridCell.addEventListener("blur",()=>{o.value._tippy.hide(),s.value?._tippy.hide()}),e.params.eGridCell.addEventListener("focus",()=>{o.value?._tippy.show(),setTimeout(()=>{document.activeElement===e.params.eGridCell&&s.value?._tippy.show()},1e3),o.value._tippy.reference.clientWidth>=o.value._tippy.reference.scrollWidth&&o.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("dblclick",()=>{u()}),e.params.eGridCell.removeEventListener("keydown",p=>{p.ctrlKey&&p.code==="KeyC"&&u()}),e.params.eGridCell.removeEventListener("blur",()=>{o.value._tippy.hide(),s.value?._tippy.hide()}),e.params.eGridCell.removeEventListener("focus",()=>{o.value._tippy.show(),s.value?._tippy.show()})}),(p,m)=>{const v=Nn("truncate"),w=Nn("tippy");return qt(),si("div",null,[Ur(Ot("div",{name:c.value,content:c.value,tabindex:"-1",innerHTML:c.value,ref_key:"el",ref:o},null,8,D3n),[[v,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",maxWidth:l.value?300:700,animation:"scale",interactive:h.value}}]]),o.value?.textContent?Ur((qt(),si("div",{key:0,ref_key:"copyTooltip",ref:s,content:ri(n)(`grid.label.${a.value?"copied":"copy"}`)},null,8,F3n)),[[w,{triggerTarget:o.value,placement:"bottom",theme:"ramp4",hideOnClick:!1,delay:[1e3,0]}]]):Yr("",!0)])}}});var k3n={selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",searchOoo:"Search...",blanks:"(Blanks)",noMatches:"No matches",filterOoo:"Filter...",equals:"Equals",notEqual:"Does not equal",blank:"Blank",notBlank:"Not blank",empty:"Choose one",lessThan:"Less than",greaterThan:"Greater than",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",dateFormatOoo:"yyyy-mm-dd",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",applyFilter:"Apply",resetFilter:"Reset",clearFilter:"Clear",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",groupFilterSelect:"Select field:",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:"Expression has an error. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Expression has an error. ${variable} at end of expression.",advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value.",columns:"Columns",filters:"Filters",pivotMode:"Pivot Mode",groups:"Row Groups",rowGroupColumnsEmptyMessage:"Drag here to set row groups",values:"Values",valueColumnsEmptyMessage:"Drag here to aggregate",pivots:"Column Labels",pivotColumnsEmptyMessage:"Drag here to set column labels",group:"Group",rowDragRow:"row",rowDragRows:"rows",loadingOoo:"Loading...",loadingError:"ERR",noRowsToShow:"No Rows To Show",enabled:"Enabled",pinColumn:"Pin Column",pinLeft:"Pin Left",pinRight:"Pin Right",noPin:"No Pin",valueAggregation:"Value Aggregation",noAggregation:"None",autosizeThisColumn:"Autosize This Column",autosizeAllColumns:"Autosize All Columns",groupBy:"Group by",ungroupBy:"Un-Group by",ungroupAll:"Un-Group All",addToValues:"Add ${variable} to values",removeFromValues:"Remove ${variable} from values",addToLabels:"Add ${variable} to labels",removeFromLabels:"Remove ${variable} from labels",resetColumns:"Reset Columns",expandAll:"Expand All Row Groups",collapseAll:"Close All Row Groups",copy:"Copy",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copy With Headers",copyWithGroupHeaders:"Copy with Group Headers",cut:"Cut",paste:"Paste",ctrlV:"Ctrl+V",export:"Export",csvExport:"CSV Export",excelExport:"Excel Export",columnFilter:"Column Filter",columnChooser:"Choose Columns",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",sortUnSort:"Clear Sort",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",none:"None",count:"Count",avg:"Average",filteredRows:"Filtered",selectedRows:"Selected",totalRows:"Total Rows",totalAndFilteredRows:"Rows",more:"More",to:"to",of:"of",page:"Page",pageLastRowUnknown:"?",nextPage:"Next Page",lastPage:"Last Page",firstPage:"First Page",previousPage:"Previous Page",pageSizeSelectorLabel:"Page Size:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Pivot Chart & Pivot Mode",pivotChart:"Pivot Chart",chartRange:"Chart Range",columnChart:"Column",groupedColumn:"Grouped",stackedColumn:"Stacked",normalizedColumn:"100% Stacked",barChart:"Bar",groupedBar:"Grouped",stackedBar:"Stacked",normalizedBar:"100% Stacked",pieChart:"Pie",pie:"Pie",donut:"Donut",line:"Line",xyChart:"X Y (Scatter)",scatter:"Scatter",bubble:"Bubble",areaChart:"Area",area:"Area",stackedArea:"Stacked",normalizedArea:"100% Stacked",histogramChart:"Histogram",polarChart:"Polar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",statisticalChart:"Statistical",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",hierarchicalChart:"Hierarchical",treemap:"Treemap",sunburst:"Sunburst",specializedChart:"Specialized",waterfall:"Waterfall",heatmap:"Heatmap",combinationChart:"Combination",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",invalidColor:"Color value is invalid",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",customCombo:"Custom Combination",ariaAdvancedFilterBuilderItem:"${variable}. Level ${variable}. Press ENTER to edit",ariaAdvancedFilterBuilderItemValidation:"${variable}. Level ${variable}. ${variable} Press ENTER to edit",ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaChecked:"checked",ariaColumn:"Column",ariaColumnGroup:"Column Group",ariaColumnFiltered:"Column Filtered",ariaColumnSelectAll:"Toggle Select All Columns",ariaDateFilterInput:"Date Filter Input",ariaDefaultListName:"List",ariaFilterColumnsInput:"Filter Columns Input",ariaFilterFromValue:"Filter from value",ariaFilterInput:"Filter Input",ariaFilterList:"Filter List",ariaFilterToValue:"Filter to value",ariaFilterValue:"Filter Value",ariaFilterMenuOpen:"Open Filter Menu",ariaFilteringOperator:"Filtering Operator",ariaHidden:"hidden",ariaIndeterminate:"indeterminate",ariaInputEditor:"Input Editor",ariaMenuColumn:"Press ALT DOWN to open column menu",ariaFilterColumn:"Press CTRL ENTER to open filter",ariaRowDeselect:"Press SPACE to deselect this row",ariaRowSelectAll:"Press Space to toggle all rows selection",ariaRowToggleSelection:"Press Space to toggle row selection",ariaRowSelect:"Press SPACE to select this row",ariaRowSelectionDisabled:"Row Selection is disabled for this row",ariaSearch:"Search",ariaSortableColumn:"Press ENTER to sort",ariaToggleVisibility:"Press SPACE to toggle visibility",ariaToggleCellValue:"Press SPACE to toggle cell value",ariaUnchecked:"unchecked",ariaVisible:"visible",ariaSearchFilterValues:"Search filter values",ariaPageSizeSelectorLabel:"Page Size",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",ariaSkeletonCellLoadingFailed:"Row failed to load",ariaSkeletonCellLoading:"Row data is loading",ariaRowGroupDropZonePanelLabel:"Row Groups",ariaValuesDropZonePanelLabel:"Values",ariaPivotDropZonePanelLabel:"Column Labels",ariaDropZoneColumnComponentDescription:"Press DELETE to remove",ariaDropZoneColumnValueItemDescription:"Press ENTER to change the aggregation type",ariaDropZoneColumnGroupItemDescription:"Press ENTER to sort",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"ascending",ariaDropZoneColumnComponentSortDescending:"descending",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Column Menu",ariaLabelColumnFilter:"Column Filter",ariaLabelCellEditor:"Cell Editor",ariaLabelSelectField:"Select Field",ariaLabelRichSelectField:"Rich Select Field",ariaLabelRichSelectToggleSelection:"Press SPACE to toggle selection",ariaLabelRichSelectDeselectAllItems:"Press DELETE to deselect all items",ariaLabelRichSelectDeleteSelection:"Press DELETE to deselect item",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Context Menu",ariaLabelSubMenu:"SubMenu",ariaLabelAggregationFunction:"Aggregation Function",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Advanced Filter Builder Add Field",ariaLabelAdvancedFilterBuilderColumnSelectField:"Advanced Filter Builder Column Select Field",ariaLabelAdvancedFilterBuilderOptionSelectField:"Advanced Filter Builder Option Select Field",ariaLabelAdvancedFilterBuilderJoinSelectField:"Advanced Filter Builder Join Operator Select Field",ariaColumnPanelList:"Column List",ariaFilterPanelList:"Filter List",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"Invalid Date",invalidNumber:"Invalid Number",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},L3n={selectAll:"(Sélectionner tout)",selectAllSearchResults:"(Sélectionner tous les résultats de recherche)",addCurrentSelectionToFilter:"Ajouter la sélection actuelle au filtre",searchOoo:"Chercher...",blanks:"(Vides)",noMatches:"Aucune correspondance",filterOoo:"Filtrer...",equals:"Égal à",notEqual:"N'est pas égal à",blank:"Vide",notBlank:"Non vide",empty:"Choisissez-en un",lessThan:"Moins de",greaterThan:"Plus de",lessThanOrEqual:"Moins de ou égal à",greaterThanOrEqual:"Plus de ou égal à",inRange:"Entre",inRangeStart:"De",inRangeEnd:"À",contains:"Contient",notContains:"Ne contient pas",startsWith:"Commence par",endsWith:"Se termine par",dateFormatOoo:"yyyy-mm-dd",before:"Avant",after:"Après",andCondition:"ET",orCondition:"OU",applyFilter:"Appliquer",resetFilter:"Réinitialiser",clearFilter:"Effacer",cancelFilter:"Annuler",textFilter:"Filtre de texte",numberFilter:"Filtre numérique",dateFilter:"Filtre de date",setFilter:"Filtre de jeu",groupFilterSelect:"Sélectionner le champ :",advancedFilterContains:"contient",advancedFilterNotContains:"ne contient pas",advancedFilterTextEquals:"égal",advancedFilterTextNotEqual:"n'est pas égal",advancedFilterStartsWith:"commence par",advancedFilterEndsWith:"se termine par",advancedFilterBlank:"est vide",advancedFilterNotBlank:"n'est pas vide",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"est vrai",advancedFilterFalse:"est faux",advancedFilterAnd:"ET",advancedFilterOr:"OU",advancedFilterApply:"Appliquer",advancedFilterBuilder:"Constructeur",advancedFilterValidationMissingColumn:"La colonne est manquante",advancedFilterValidationMissingOption:"L'option est manquante",advancedFilterValidationMissingValue:"La valeur est manquante",advancedFilterValidationInvalidColumn:"Colonne non trouvée",advancedFilterValidationInvalidOption:"Option non trouvée",advancedFilterValidationMissingQuote:"Il manque une guillemet de fin à la valeur",advancedFilterValidationNotANumber:"La valeur n'est pas un nombre",advancedFilterValidationInvalidDate:"La valeur n'est pas une date valide",advancedFilterValidationMissingCondition:"La condition est manquante",advancedFilterValidationJoinOperatorMismatch:"Les opérateurs de jonction au sein d'une condition doivent être identiques",advancedFilterValidationInvalidJoinOperator:"Opérateur de jonction non trouvé",advancedFilterValidationMissingEndBracket:"Guillemet de fin manquante",advancedFilterValidationExtraEndBracket:"Trop de crochets de fin",advancedFilterValidationMessage:"L'expression contient une erreur. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"L'expression contient une erreur. ${variable} à la fin de l'expression.",advancedFilterBuilderTitle:"Filtre Avancé",advancedFilterBuilderApply:"Appliquer",advancedFilterBuilderCancel:"Annuler",advancedFilterBuilderAddButtonTooltip:"Ajouter un filtre ou un groupe",advancedFilterBuilderRemoveButtonTooltip:"Supprimer",advancedFilterBuilderMoveUpButtonTooltip:"Monter",advancedFilterBuilderMoveDownButtonTooltip:"Descendre",advancedFilterBuilderAddJoin:"Ajouter un groupe",advancedFilterBuilderAddCondition:"Ajouter un filtre",advancedFilterBuilderSelectColumn:"Sélectionner une colonne",advancedFilterBuilderSelectOption:"Sélectionner une option",advancedFilterBuilderEnterValue:"Entrer une valeur...",advancedFilterBuilderValidationAlreadyApplied:"Le filtre actuel est déjà appliqué.",advancedFilterBuilderValidationIncomplete:"Toutes les conditions ne sont pas remplies.",advancedFilterBuilderValidationSelectColumn:"Vous devez sélectionner une colonne.",advancedFilterBuilderValidationSelectOption:"Vous devez sélectionner une option.",advancedFilterBuilderValidationEnterValue:"Vous devez entrer une valeur.",columns:"Colonnes",filters:"Filtres",pivotMode:"Mode pivot",groups:"Groupes de lignes",rowGroupColumnsEmptyMessage:"Faites glisser ici pour définir les groupes de lignes",values:"Valeurs",valueColumnsEmptyMessage:"Faites glisser ici pour agréger",pivots:"Étiquettes de colonnes",pivotColumnsEmptyMessage:"Faites glisser ici pour définir les étiquettes de colonnes",group:"Groupe",rowDragRow:"rang",rowDragRows:"rangs",loadingOoo:"Chargement...",loadingError:"ERR",noRowsToShow:"Aucune ligne à afficher",enabled:"Activé",pinColumn:"Épingler la colonne",pinLeft:"Épingler à gauche",pinRight:"Épingler à droite",noPin:"Pas d'épingle",valueAggregation:"Agrégation de valeur",noAggregation:"Aucun",autosizeThisColumn:"Ajuster automatiquement cette colonne",autosizeAllColumns:"Ajuster automatiquement toutes les colonnes",groupBy:"Grouper par",ungroupBy:"Dégrouper par",ungroupAll:"Dégrouper tout",addToValues:"Ajouter ${variable} aux valeurs",removeFromValues:"Retirer ${variable} des valeurs",addToLabels:"Ajouter ${variable} aux étiquettes",removeFromLabels:"Retirer ${variable} des étiquettes",resetColumns:"Réinitialiser les colonnes",expandAll:"Développer tous les groupes de lignes",collapseAll:"Fermer tous les groupes de lignes",copy:"Copier",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copier avec en-têtes",copyWithGroupHeaders:"Copier avec en-têtes de groupe",cut:"Couper",paste:"Coller",ctrlV:"Ctrl+V",export:"Exporter",csvExport:"Export CSV",excelExport:"Export Excel",columnFilter:"Filtre de colonne",columnChooser:"Choisir les colonnes",sortAscending:"Trier par ordre croissant",sortDescending:"Trier par ordre décroissant",sortUnSort:"Effacer le tri",sum:"Somme",first:"Premier",last:"Dernier",min:"Min",max:"Max",none:"Aucun",count:"Nombre",avg:"Moyenne",filteredRows:"Filtré",selectedRows:"Sélectionné",totalRows:"Total des Lignes",totalAndFilteredRows:"Lignes",more:"Plus",to:"à",of:"de",page:"Page",pageLastRowUnknown:"?",nextPage:"Page Suivante",lastPage:"Dernière Page",firstPage:"Première Page",previousPage:"Page Précédente",pageSizeSelectorLabel:"Taille de la Page :",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Graphique pivot et mode pivot",pivotChart:"Graphique pivot",chartRange:"Plage de graphique",columnChart:"Colonne",groupedColumn:"Groupé",stackedColumn:"Empilé",normalizedColumn:"100% empilé",barChart:"Barre",groupedBar:"Groupé",stackedBar:"Empilé",normalizedBar:"100% empilé",pieChart:"Camembert",pie:"Camembert",donut:"Donut",line:"Ligne",xyChart:"X Y (Nuage de points)",scatter:"Nuage de points",bubble:"Bulle",areaChart:"Aire",area:"Aire",stackedArea:"Empilé",normalizedArea:"100% empilé",histogramChart:"Histogramme",polarChart:"Polaire",radarLine:"Ligne radar",radarArea:"Aire radar",nightingale:"Nightingale",radialColumn:"Colonne radiale",radialBar:"Barre radiale",statisticalChart:"Statistique",boxPlot:"Boîte à moustaches",rangeBar:"Barre de plage",rangeArea:"Aire de plage",hierarchicalChart:"Hiérarchique",treemap:"Arborescence",sunburst:"Rayonnement",specializedChart:"Spécialisé",waterfall:"Cascade",heatmap:"Carte thermique",combinationChart:"Combinaison",columnLineCombo:"Colonne et ligne",AreaColumnCombo:"Aire et colonne",pivotChartTitle:"Graphique croisé dynamique",rangeChartTitle:"Graphique en plage",settings:"Graphique",data:"Configurer",format:"Personnaliser",categories:"Catégories",defaultCategory:"(Aucun)",series:"Séries",switchCategorySeries:"Changer Catégorie / Séries",categoryValues:"Valeurs de catégorie",seriesLabels:"Étiquettes de séries",aggregate:"Agrégat",xyValues:"Valeurs X Y",paired:"Mode apparié",axis:"Axe",xAxis:"Axe horizontal",yAxis:"Axe vertical",polarAxis:"Axe polaire",radiusAxis:"Axe de rayon",navigator:"Navigateur",zoom:"Zoom",animation:"Animation",crosshair:"Réticule",color:"Couleur",thickness:"Épaisseur",preferredLength:"Longueur préférée",xType:"Type X",axisType:"Type d'axe",automatic:"Automatique",category:"Catégorie",number:"Nombre",time:"Temps",timeFormat:"Format de temps",autoRotate:"Rotation auto",labelRotation:"Rotation",circle:"Cercle",polygon:"Polygone",square:"Carré",cross:"Croix",diamond:"Diamant",plus:"Plus",triangle:"Triangle",heart:"Cœur",orientation:"Orientation",fixed:"Fixé",parallel:"Parallèle",perpendicular:"Perpendiculaire",radiusAxisPosition:"Position",ticks:"Graduations",gridLines:"Lignes de grille",width:"Largeur",height:"Hauteur",length:"Longueur",padding:"Rembourrage",spacing:"Espacement",chartStyle:"Style de graphique",title:"Titre",chartTitles:"Titres",chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre",horizontalAxisTitle:"Titre de l'axe horizontal",verticalAxisTitle:"Titre de l'axe vertical",polarAxisTitle:"Titre de l'axe polaire",titlePlaceholder:"Titre du graphique",background:"Arrière-plan",font:"Police",weight:"Poids",top:"Haut",right:"Droite",bottom:"Bas",left:"Gauche",labels:"Étiquettes",calloutLabels:"Étiquettes d'appel",sectorLabels:"Étiquettes de secteur",positionRatio:"Ratio de position",size:"Taille",shape:"Forme",minSize:"Taille minimum",maxSize:"Taille maximum",legend:"Légende",position:"Position",markerSize:"Taille du marqueur",markerStroke:"Contour du marqueur",markerPadding:"Rembourrage du marqueur",itemSpacing:"Espacement des éléments",itemPaddingX:"Rembourrage d'élément X",itemPaddingY:"Rembourrage d'élément Y",layoutHorizontalSpacing:"Espacement horizontal",layoutVerticalSpacing:"Espacement vertical",strokeWidth:"Épaisseur du trait",offset:"Décalage",offsets:"Décalages",tooltips:"Info-bulles",callout:"Appel",markers:"Marqueurs",shadow:"Ombre",blur:"Flou",xOffset:"Décalage X",yOffset:"Décalage Y",lineWidth:"Épaisseur de la ligne",lineDash:"Tirets de la ligne",lineDashOffset:"Décalage des tirets",scrollingZoom:"Défilement",scrollingStep:"Étape de défilement",selectingZoom:"Sélection",durationMillis:"Durée (ms)",crosshairLabel:"Étiquette",crosshairSnap:"Accrocher au nœud",normal:"Normal",bold:"Gras",italic:"Italique",boldItalic:"Gras Italique",predefined:"Prédéfini",fillOpacity:"Opacité de remplissage",strokeColor:"Couleur du trait",strokeOpacity:"Opacité du trait",miniChart:"Mini-Graphique",histogramBinCount:"Nombre de bins",connectorLine:"Ligne de connexion",seriesItems:"Éléments de série",seriesItemType:"Type d'élément",seriesItemPositive:"Positif",seriesItemNegative:"Négatif",seriesItemLabels:"Étiquettes d'éléments",columnGroup:"Colonne",barGroup:"Barre",pieGroup:"Camembert",lineGroup:"Ligne",scatterGroup:"X Y (Nuage de points)",areaGroup:"Zone",polarGroup:"Polaire",statisticalGroup:"Statistique",hierarchicalGroup:"Hiérarchique",specializedGroup:"Spécialisé",combinationGroup:"Combinaison",groupedColumnTooltip:"Groupe",stackedColumnTooltip:"Empilé",normalizedColumnTooltip:"100% Empilé",groupedBarTooltip:"Groupe",stackedBarTooltip:"Empilé",normalizedBarTooltip:"100% Empilé",pieTooltip:"Camembert",donutTooltip:"Donut",lineTooltip:"Ligne",groupedAreaTooltip:"Zone",stackedAreaTooltip:"Empilé",normalizedAreaTooltip:"100% Empilé",scatterTooltip:"Nuage de points",bubbleTooltip:"Bulle",histogramTooltip:"Histogramme",radialColumnTooltip:"Colonne radiale",radialBarTooltip:"Barre radiale",radarLineTooltip:"Ligne radar",radarAreaTooltip:"Zone radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barre de plage",rangeAreaTooltip:"Zone de plage",boxPlotTooltip:"Boîte à moustaches",treemapTooltip:"Treemap",sunburstTooltip:"Rayon de soleil",waterfallTooltip:"Chute d'eau",heatmapTooltip:"Carte thermique",columnLineComboTooltip:"Colonne & Ligne",areaColumnComboTooltip:"Zone & Colonne",customComboTooltip:"Combinaison Personnalisée",innerRadius:"Rayon intérieur",startAngle:"Angle de départ",endAngle:"Angle de fin",reverseDirection:"Inverser la direction",groupPadding:"Rembourrage de groupe",seriesPadding:"Rembourrage de séries",tile:"Tuile",whisker:"Moustache",cap:"Capuchon",capLengthRatio:"Ratio de longueur",labelPlacement:"Placement",inside:"À l'intérieur",outside:"À l'extérieur",noDataToChart:"Aucune donnée disponible à afficher.",pivotChartRequiresPivotMode:"Le graphique croisé dynamique nécessite le mode croisé activé.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Lié à la grille",chartUnlinkToolbarTooltip:"Détaché de la grille",chartDownloadToolbarTooltip:"Télécharger le graphique",chartMenuToolbarTooltip:"Menu",chartEdit:"Modifier le graphique",chartAdvancedSettings:"Paramètres avancés",chartLink:"Lier à la grille",chartUnlink:"Détacher de la grille",chartDownload:"Télécharger le graphique",histogramFrequency:"Fréquence",seriesChartType:"Type de graphique de séries",seriesType:"Type de série",secondaryAxis:"Axe secondaire",seriesAdd:"Ajouter une série",categoryAdd:"Ajouter une catégorie",bar:"Barre",column:"Colonne",histogram:"Histogramme",advancedSettings:"Paramètres avancés",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Type de groupe",groupedSeriesGroupType:"Groupé",stackedSeriesGroupType:"Empilé",normalizedSeriesGroupType:"100% Empilé",legendEnabled:"Activé",invalidColor:"La valeur de couleur est invalide",groupedColumnFull:"Colonne groupée",stackedColumnFull:"Colonne empilée",normalizedColumnFull:"Colonne 100% empilée",groupedBarFull:"Barre groupée",stackedBarFull:"Barre empilée",normalizedBarFull:"Barre 100% empilée",stackedAreaFull:"Zone empilée",normalizedAreaFull:"Zone 100% empilée",customCombo:"Combinaison personnalisée",ariaAdvancedFilterBuilderItem:"${variable}. Niveau ${variable}. Appuyez sur ENTER pour éditer.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niveau ${variable}. ${variable} Appuyez sur ENTER pour éditer.",ariaAdvancedFilterBuilderList:"Liste de cadre de filtre avancé",ariaAdvancedFilterBuilderFilterItem:"Condition de filtre",ariaAdvancedFilterBuilderGroupItem:"Groupe de filtre",ariaAdvancedFilterBuilderColumn:"Colonne",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Valeur",ariaAdvancedFilterBuilderJoinOperator:"Opérateur de jonction",ariaAdvancedFilterInput:"Entrée de filtre avancé",ariaChecked:"coché",ariaColumn:"Colonne",ariaColumnGroup:"Groupe de colonnes",ariaColumnFiltered:"Colonne filtrée",ariaColumnSelectAll:"Basculer la sélection de toutes les colonnes",ariaDateFilterInput:"Entrée de filtre de date",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Entrée de filtre de colonnes",ariaFilterFromValue:"Filtrer depuis la valeur",ariaFilterInput:"Entrée de filtre",ariaFilterList:"Liste de filtres",ariaFilterToValue:"Filtrer jusqu'à la valeur",ariaFilterValue:"Valeur du filtre",ariaFilterMenuOpen:"Ouvrir le menu de filtre",ariaFilteringOperator:"Opérateur de filtrage",ariaHidden:"caché",ariaIndeterminate:"indéterminé",ariaInputEditor:"Éditeur d'entrée",ariaMenuColumn:"Appuyez sur ALT BAS pour ouvrir le menu de colonne",ariaFilterColumn:"Appuyez sur CTRL ENTER pour ouvrir le filtre",ariaRowDeselect:"Appuyez sur ESPACE pour désélectionner cette ligne",ariaRowSelectAll:"Appuyez sur ESPACE pour basculer la sélection de toutes les lignes",ariaRowToggleSelection:"Appuyez sur ESPACE pour basculer la sélection de la ligne",ariaRowSelect:"Appuyez sur ESPACE pour sélectionner cette ligne",ariaRowSelectionDisabled:"La sélection de lignes est désactivée pour cette ligne",ariaSearch:"Rechercher",ariaSortableColumn:"Appuyez sur ENTER pour trier",ariaToggleVisibility:"Appuyez sur ESPACE pour basculer la visibilité",ariaToggleCellValue:"Appuyez sur ESPACE pour basculer la valeur de la cellule",ariaUnchecked:"non coché",ariaVisible:"visible",ariaSearchFilterValues:"Rechercher les valeurs de filtre",ariaPageSizeSelectorLabel:"Taille de page",ariaChartMenuClose:"Fermer le menu d'édition de graphique",ariaChartSelected:"Sélectionné",ariaSkeletonCellLoadingFailed:"Le chargement de la ligne a échoué",ariaSkeletonCellLoading:"Les données de la ligne sont en cours de chargement",ariaRowGroupDropZonePanelLabel:"Groupes de lignes",ariaValuesDropZonePanelLabel:"Valeurs",ariaPivotDropZonePanelLabel:"Étiquettes de colonnes",ariaDropZoneColumnComponentDescription:"Appuyez sur SUPPRIMER pour enlever",ariaDropZoneColumnValueItemDescription:"Appuyez sur ENTRÉE pour changer le type d'agrégation",ariaDropZoneColumnGroupItemDescription:"Appuyez sur ENTRÉE pour trier",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnComponentSortAscending:"ascendant",ariaDropZoneColumnComponentSortDescending:"descendant",ariaLabelDialog:"Dialogue",ariaLabelColumnMenu:"Menu de colonne",ariaLabelColumnFilter:"Filtre de colonne",ariaLabelCellEditor:"Éditeur de cellule",ariaLabelSelectField:"Champ de sélection",ariaLabelRichSelectField:"Champ de sélection enrichie",ariaLabelRichSelectToggleSelection:"Appuyez sur ESPACE pour basculer la sélection",ariaLabelRichSelectDeselectAllItems:"Appuyez sur SUPPRIMER pour désélectionner tous les éléments",ariaLabelRichSelectDeleteSelection:"Appuyez sur SUPPRIMER pour désélectionner l'élément",ariaLabelTooltip:"Info-bulle",ariaLabelContextMenu:"Menu contextuel",ariaLabelSubMenu:"Sous-menu",ariaLabelAggregationFunction:"Fonction d'agrégation",ariaLabelAdvancedFilterAutocomplete:"Filtre avancé auto-complétion",ariaLabelAdvancedFilterBuilderAddField:"Filtre avancé constructeur Ajouter un champ",ariaLabelAdvancedFilterBuilderColumnSelectField:"Filtre avancé constructeur Sélectionnez le champ de colonne",ariaLabelAdvancedFilterBuilderOptionSelectField:"Filtre avancé constructeur Sélectionnez le champ d'option",ariaLabelAdvancedFilterBuilderJoinSelectField:"Filtre avancé constructeur Sélectionnez le champ de l'opérateur de jointure",ariaColumnPanelList:"Liste des colonnes",ariaFilterPanelList:"Liste des filtres",thousandSeparator:",",decimalSeparator:".",true:"Vrai",false:"Faux",invalidDate:"Date invalide",invalidNumber:"Nombre invalide",january:"Janvier",february:"Février",march:"Mars",april:"Avril",may:"Mai",june:"Juin",july:"Juillet",august:"Août",september:"Septembre",october:"Octobre",november:"Novembre",december:"Décembre",timeFormatSlashesDDMMYYYY:"JJ/MM/AAAA",timeFormatSlashesMMDDYYYY:"MM/JJ/AAAA",timeFormatSlashesDDMMYY:"JJ/MM/AA",timeFormatSlashesMMDDYY:"MM/JJ/AA",timeFormatDotsDDMYY:"JJ.M.AA",timeFormatDotsMDDYY:"M.JJ.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-JJ",timeFormatSpacesDDMMMMYYYY:"JJ MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"};const b_=i=>(Dc("data-v-aec3f27c"),i=i(),Fc(),i),N3n={class:"pl-8"},$3n={class:"flex flex-col justify-center items-center h-full"},B3n={class:"flex flex-row"},j3n={class:"font-bold text-2xl"},G3n=b_(()=>Ot("svg",{class:"stroke-black stroke-1",height:"50",width:"25"},[Ot("line",{x1:"0",y1:"50",x2:"25",y2:"0"})],-1)),U3n={class:"mt-20 text-xl"},z3n={class:"my-20"},V3n={class:"text-sm"},H3n=["aria-label"],W3n={class:"flex flex-wrap gap-y-8 items-center pl-8 pb-8"},q3n={class:"flex flex-1 flex-col max-w-full mr-8"},Y3n={class:"w-full font-bold"},X3n={class:"w-full text-sm"},J3n={key:0},K3n={class:"flex flex-1 grow-[1.4] items-center max-w-full"},Z3n={class:"flex flex-1 min-w-0 items-center pb-4 mr-8"},Q3n=["aria-label","placeholder"],eMn={class:"-ml-30"},tMn={key:0,xmlns:"http://www.w3.org/2000/svg",fit:"",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false",class:"fill-current w-24 h-24 flex-shrink-0"},iMn=b_(()=>Ot("g",{id:"search_cache224"},[Ot("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),rMn=[iMn],nMn=b_(()=>Ot("svg",{"data-v-486a0302":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512",class:"w-18 h-18 mt-2"},[Ot("path",{"data-v-486a0302":"",d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)),sMn=[nMn],oMn={class:"pb-2 flex ml-auto justify-end"},aMn=["content","aria-label"],lMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",width:"24px",viewBox:"0 0 24 24",class:"inline fill-current"},[Ot("g",{id:"filter_cache958"},[Ot("path",{d:"M 14.7574,20.8284L 17.6036,17.9822L 14.7574,15.1716L 16.1716,13.7574L 19.0178,16.568L 21.8284,13.7574L 23.2426,15.1716L 20.432,17.9822L 23.2426,20.8284L 21.8284,22.2426L 19.0178,19.3964L 16.1716,22.2426L 14.7574,20.8284 Z M 2,2L 19.9888,2.00001L 20,2.00001L 20,2.01122L 20,3.99999L 19.9207,3.99999L 13,10.9207L 13,22.909L 8.99999,18.909L 8.99999,10.906L 2.09405,3.99999L 2,3.99999L 2,2 Z "})])],-1)),uMn=[lMn],cMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current m-8 w-24 h-24"},[Ot("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)),hMn=["aria-label"],dMn={class:"md-icon-small inline items-start"},pMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"m 15.585999,21.223066 2.414,-2.414 v 1.811 A 3.616,3.616 0 0 0 21.2,15.309066 l 0.881,-0.881 a 4.82,4.82 0 0 1 -4.080001,7.4 v 1.811 z m -13.5859988,-9.224 a 10,10 0 1 1 19.9999998,0 c 0,0.172 0,0.346 -0.013,0.517 a 5.971,5.971 0 0 0 -2.014001,-1.184001 7.935,7.935 0 0 0 -4.973,-6.742999 v 0.41 a 2,2 0 0 1 -2,2 h -2 v 2 A 1,1 0 0 1 10,9.9990662 H 8.0000002 v 1.9999998 h 5.9999988 a 1,1 0 0 1 0.495,0.131 6,6 0 0 0 -0.184,9.6 10.009,10.009 0 0 1 -12.3109988,-9.731 z m 2,0 a 8,8 0 0 0 6.9999988,7.93 v -1.93 a 2,2 0 0 1 -1.9999988,-2 v -1 l -4.79,-4.79 a 8.07,8.07 0 0 0 -0.21,1.79 z m 9.1729988,5 a 4.827,4.827 0 0 1 4.827,-4.828 v -1.81 l 2.414,2.414 -2.414,2.413 v -1.809 a 3.623,3.623 0 0 0 -3.62,3.62 3.537,3.537 0 0 0 0.42,1.69 l -0.881,0.881 a 4.787,4.787 0 0 1 -0.746,-2.571 z"})],-1)),fMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},mMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),gMn=[mMn],yMn=["aria-label"],vMn={class:"md-icon-small inline items-start"},_Mn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"M 3,2L 20.9888,2L 21,2L 21,2.01122L 21,3.99999L 20.9207,3.99999L 14,10.9207L 14,22.909L 9.99999,18.909L 10,10.906L 3.09405,3.99999L 3,3.99999L 3,2 Z "})],-1)),bMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},wMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),xMn=[wMn],SMn=["aria-label"],TMn={class:"md-icon-small inline items-start"},CMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"M 4 10 Z M 2 2 L 19.9888 2 L 20 2 L 20 2.0112 L 20 4 L 19.9207 4 L 13 10.9207 L 13 22.909 L 9 18.909 L 9 10.906 L 2.0941 4 L 2 4 L 2 2 Z M 24 13 L 21 14 L 18 13 L 15 14 V 22 L 18 21 l 3 1 l 3 -1 z M 21 21 l -3 -1 V 14 l 3 1.055 z"})],-1)),EMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},IMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),AMn=[IMn],MMn=["aria-label"],OMn={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},PMn=b_(()=>Ot("path",{d:"M18,8H17V6A5,5 0 0,0 12,1A5,5 0 0,0 7,6V8H6A2,2 0 0,0 4,10V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V10A2,2 0 0,0 18,8M12,3A3,3 0 0,1 15,6V8H9V6A3,3 0 0,1 12,3Z"},null,-1)),RMn=[PMn],DMn={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},FMn=b_(()=>Ot("path",{d:"M18 1.5c2.9 0 5.25 2.35 5.25 5.25v3.75a.75.75 0 01-1.5 0V6.75a3.75 3.75 0 10-7.5 0v3a3 3 0 013 3v6.75a3 3 0 01-3 3H3.75a3 3 0 01-3-3v-6.75a3 3 0 013-3h9v-3c0-2.9 2.35-5.25 5.25-5.25z"},null,-1)),kMn=[FMn],LMn={key:2,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},NMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),$Mn=[NMn],BMn=["aria-label"],jMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("g",null,[Ot("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"})])],-1)),GMn=Xr({__name:"table-component",props:{panel:{type:Zz,required:!0},gridId:{type:String,required:!0}},setup(i){const e=i,t=[j1.OID,j1.DOUBLE,j1.SINGLE,j1.INTEGER],r=eo("iApi"),n=bB(),s=w0(),o=Hr(()=>s.mobileView),a=vi(!o.value),l=vi(),{t:u,locale:c}=Qn(),h=()=>Df()?.proxy?.$forceUpdate(),p=vi({id:"dummy",layerIds:[],state:new i0e,fieldMap:{}}),m=vi(!0),v=vi(new aE.GridApi),w=vi(),S=vi(),I=vi(!1),R=vi(!1),L=vi([]),k=vi(0),B=vi([]),$=vi([]),V=vi(""),Y=vi(new aE.ColumnApi),K=vi([]),Q=vi([]),re=vi("OBJECTID"),ne=vi(void 0),de=g_t.onCellKeyPress,pe=vi({firstRow:0,lastRow:0,visibleRows:0}),H=vi({}),Z=r.geo.layer.getLayer(e.gridId),ae=vi({}),fe=vi(n.grids[e.gridId].layerIds),be=Hr(()=>n.grids[e.gridId]?n.grids[e.gridId].layerIds.map(G=>r.geo.layer.getLayer(G)).filter(G=>G!==void 0):[]),_e=vi(new Set),Ie=vi([]),Te=G=>{v.value=G.api,Y.value=G.columnApi,V.value=p.value.state.title||Z?.name||e.gridId,ot(),Q.value.length>0&&Y.value.autoSizeAllColumns();const E=()=>{document.querySelectorAll(".ag-input-field-input.ag-checkbox-input").forEach((g,b)=>{const O=Y.value.getAllDisplayedColumns()[b].getColDef();g.setAttribute("aria-label",O.headerName??u("grid.label.specialColumn"))})};E(),v.value.addEventListener("rowDataChanged",E),B.value.push(r.event.on(ln.FILTER_CHANGE,({uid:_,filterKey:g})=>{g!==pm.GRID&&_&&be.value.map(b=>b.uid).includes(_)&&me()})),B.value.push(r.event.on(ln.LAYER_VISIBILITYCHANGE,({layer:_})=>{_.uid&&be.value.map(g=>g.uid).includes(_.uid)&&me()})),B.value.push(r.event.on(ln.LAYER_RELOAD_END,_=>{_.loadPromise().then(()=>{be.value.map(g=>g.uid).includes(_.uid)&&me()})})),B.value.push(r.event.on(ln.CONFIG_CHANGE,()=>{v.value.redrawRows({force:!0})})),B.value.push(r.event.on(ln.MAP_EXTENTCHANGE,xE(100,()=>{p.value.state.filterByExtent&&me()}))),B.value.push(r.event.on(ln.LAYER_REMOVE,_=>{fe.value.includes(_.id)&&be.value.length!==0&&ue()})),me()},Be=()=>{Y.value.autoSizeAllColumns(),ne.value=new g_t(l.value,v.value,Y.value)},Ve=()=>{v.value.setQuickFilter(p.value.state.searchFilter)},$e=()=>{p.value.state.searchFilter="",Ve()},tt=()=>{$e(),At(),me()},yt=()=>{p.value.state.filterByExtent=!p.value.state.filterByExtent,me()},Ct=()=>{let G=w.value.api.getColumnDefs();p.value.state.colFilter=!p.value.state.colFilter,G.forEach(E=>{E.floatingFilter=p.value.state.colFilter}),w.value.api.setColumnDefs(G)},ot=()=>{v.value&&!I.value&&(p.value.state.searchFilter!==""&&Ve(),p.value.state.applyToMap&&ge(),Bv(()=>{let G=Y.value.getAllDisplayedColumns();w.value.api.refreshCells({columns:[G[0]]}),vt()}))},vt=()=>{pe.value.firstRow=v.value.getFirstDisplayedRow()+1,pe.value.lastRow=v.value.getLastDisplayedRow()+1,pe.value.visibleRows=v.value.getDisplayedRowCount()},At=()=>{v.value.setFilterModel({}),p.value.state.clearFilters(),v.value.refreshHeader()},Je=()=>{a.value=!a.value;let G=Y.value.getAllDisplayedColumns();Y.value.setColumnsPinned(G.slice(1,3),a.value?"left":"")},it=()=>{const G=Y.value.getAllDisplayedColumns().filter(E=>!E.getColDef().preventExport);v.value.exportDataAsCsv({columnKeys:G,suppressQuotes:!0,processCellCallback:E=>{let _=E.column.getColDef().cellRendererParams;return!E.value||_&&_.type==="number"?E.value:_&&_.type==="date"?`"${new Date(E.value).toLocaleDateString("en-CA",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}"`:`"${E.value.toString().replace(/"/g,'""')}"`}})},Ue=(G,E)=>{G.floatingFilterComponent="dateFloatingFilter",G.filterParams.comparator=function(_,g){let b=new Date(g);return b.getUTCFullYear()>_.getUTCFullYear()?1:b.getUTCFullYear()<_.getUTCFullYear()?-1:b.getUTCMonth()>_.getUTCMonth()?1:b.getUTCMonth()<_.getUTCMonth()?-1:b.getUTCDate()-_.getUTCDate()},G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E}},ct=(G,E,_)=>{G.floatingFilterComponent="selectorFloatingFilter",G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:_,rowData:E}},st=(G,E)=>{G.floatingFilterComponent="numberFloatingFilter",G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E}},Ze=(G,E)=>{G.floatingFilterComponent="textFloatingFilter",G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E},G.filterParams.textMatcher=function(g){const b=g.filterText.replace(/\*/,"\\*");return new RegExp(`^.*${b}.*`).test(g.value)};let _=function(g){let b=g.toLowerCase();return b=b.replace(new RegExp("[àáâãäå]","g"),"a"),b=b.replace(new RegExp("æ","g"),"ae"),b=b.replace(new RegExp("ç","g"),"c"),b=b.replace(new RegExp("[èéêë]","g"),"e"),b=b.replace(new RegExp("[ìíîï]","g"),"i"),b=b.replace(new RegExp("ñ","g"),"n"),b=b.replace(new RegExp("[òóôõö]","g"),"o"),b=b.replace(new RegExp("œ","g"),"oe"),b=b.replace(new RegExp("[ùúûü]","g"),"u"),b=b.replace(new RegExp("[ýÿ]","g"),"y"),b};G.filterParams.textFormatter=function(g){return _(g)}},ye=(G,E,_)=>{if(G.field==="rvRowIndex"){let g={sortable:!1,lockPosition:!0,valueGetter:"node.rowIndex + 1",suppressMovable:!0,suppressMenu:!0,floatingFilter:p.value.state.colFilter,pinned:"left",maxWidth:42,cellStyle:()=>({"padding-left":"2px","padding-right":"2px",display:"flex","justify-content":"center"}),floatingFilterComponent:"clearFloatingFilter",floatingFilterComponentParams:{stateManager:_,clearFilters:At,suppressFilterButton:!0},filter:!0,preventExport:!0};E.push(g)}if(G.field==="rvInteractive"){const g=p.value.state.controls;let b={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:_3n,cellRendererParams:{$iApi:r,t:u,layerCols:ae.value,isTeleport:e.panel.teleport!==void 0},preventExport:!0};if(g.includes("details")&&E.push(b),Yt.value){let C={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:M3n,cellRendererParams:{$iApi:r,layerCols:ae.value,isTeleport:e.panel.teleport!==void 0},preventExport:!0};g.includes("zoom")&&E.push(C)}g.forEach(C=>{if(C==="zoom"||C==="details")return;let O={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:R3n,cellRendererParams:{$iApi:r,t:u,layerCols:ae.value,config:C},preventExport:!0};E.push(O)})}if(G.field==="rvSymbol"){let g={sortable:!1,filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellRenderer:b=>{const C=r.geo.layer.getLayer(b.data.rvUid);if(C===void 0)return;const O=document.createElement("span"),F=b.data[re.value];return C.getIcon(F).then(N=>{O.innerHTML=N}),O},cellStyle:()=>({paddingTop:"3px",textAlign:"center",paddingLeft:"5px",paddingRight:"0px"}),cellRendererParams:{$iApi:r,oidField:re.value},preventExport:!0};E.push(g)}},Ke=()=>!Object.values(H.value).every(G=>G===void 0),ke=G=>{const E=H.value[G.data.rvUid];return E===void 0||E.includes(G.data[re.value])},me=async()=>{const G=new Af,E=Ie.value.slice().map(g=>g.getPromise());Ie.value.push(G),await Promise.all(E),await Promise.all(be.value.map(async g=>{g&&g.visibility?await g.getFilterOIDs([pm.GRID],p.value.state.filterByExtent?r.geo.map.getExtent():void 0).then(b=>{H.value[g.uid]=b}):H.value[g.uid]=[]})),v.value.onFilterChanged(),G.resolveMe();const _=Ie.value.indexOf(G);_===-1?console.error("Grid could not find filter blocker in filter queue"):Ie.value.splice(_,1)},ie=()=>{p.value.state.applyToMap=!p.value.state.applyToMap,ge()},ge=()=>{be.value.filter(G=>G.mapLayer).forEach(G=>{if(!p.value.state.applyToMap)G.setSqlFilter(pm.GRID,"");else{const E=je(G.id);G.setSqlFilter(pm.GRID,E)}})},je=G=>{const E=v.value.getFilterModel();let _=[];if(Object.keys(E).forEach(g=>{const b=A(G,g);b?_.push(rt(b.origAttr,E[g])):_.push("1=2")}),p.value.state.searchFilter&&p.value.state.searchFilter.length>0){const g=Me(G)||"1=2";g.length>0&&_.push(`(${g})`)}return _.join(" AND ")},rt=(G,E)=>{switch(E.filterType){case"number":{switch(E.type){case"greaterThanOrEqual":return`${G} >= ${E.filter}`;case"lessThanOrEqual":return`${G} <= ${E.filter}`;case"inRange":return`${G} >= ${E.filter} AND ${G} <= ${E.filterTo}`}break}case"text":{let _=E.filter.replace(/'/g,/''/);if(_!==""){const g=/\\[(!"#$&'+,.\\/:;<=>?@[\]^`{|}~)]/g;let b=_,C="",O=g.exec(_),F=0;for(;O;)C=C+_.substr(F,O.index-F)+O[0].slice(-1),F=O.index+2,b=_.substr(O.index+2),O=g.exec(_);C=C+b,C=C.replace(/%/g,"ௌ%"),C=C.replace(/_/g,"ௌ_"),C=`*${C}`;let N=`UPPER(${G}) LIKE '${C.replace(/\*/g,"%").toUpperCase()}%'`;return N.includes("ௌ%")||N.includes("ௌ_")?`${N} ESCAPE 'ௌ'`:N}break}case"date":{const _=new Date(E.dateFrom??0),g=new Date(E.dateTo??864e13),b=_?`${_.getMonth()+1}/${_.getDate()}/${_.getFullYear()}`:void 0,C=g?`${g.getMonth()+1}/${g.getDate()}/${g.getFullYear()}`:void 0;switch(E.type){case"greaterThan":return`${G} >= DATE '${b}'`;case"lessThan":return`${G} <= DATE '${b}'`;case"inRange":return`${G} >= DATE '${b}' AND ${G} <= DATE '${C}'`}}}},Me=G=>{const _=p.value.state.searchFilter.replace(/'/g,"''").split(" "),g=v.value.rowModel.rowsToDisplay,b=Y.value.getAllDisplayedColumns().filter(O=>(O.colDef.filter==="agTextColumnFilter"||O.colDef.filter==="agNumberColumnFilter")&&A(G,O.getColId()));let C=[];return g.forEach(O=>{let F=!0,N="";for(let j of _){const W=new RegExp(`.*${j.split(" ").join(".*").toUpperCase()}`),q=`%${j.replace(/\*/g,"%").split(" ").join("%").toUpperCase()}`;let J=!1;for(let ee of b){const he=ee.getColId(),Ee=A(G,ee.getColId())?.origAttr,De=ee.getColDef();if(O.data[he]===void 0)J=!1;else if(De.filter==="agTextColumnFilter"){const pt=O.data[he]===null?null:O.data[he].toString();if(pt!==null&&W.test(pt.toUpperCase())){N?N=N.concat(" AND ",`(UPPER(${Ee}) LIKE '${q}%')`):N=N.concat("(",`(UPPER(${Ee}) LIKE '${q}%')`),C.includes(N+")")?J=!1:J=!0;break}}else if(De.filter==="agNumberColumnFilter"){const pt=O.data[he]===null?null:O.data[he];if(pt!==null&&W.test(pt)){N?N=N.concat(" AND ",`(${Ee} = ${pt})`):N=N.concat("(",`(${Ee} = ${pt})`),C.includes(N+")")?J=!1:J=!0;break}}}if(!J){F=!1;break}}F&&C.push(N+")")}),C.join(" OR ")},ht=G=>{["ArrowDown","Down","ArrowLeft","Left","ArrowUp","Up","ArrowRight","Right"].includes(G.key)&&G.stopPropagation()},Ht=()=>{_t(),e.panel.isOpen&&e.panel.close()},_t=()=>{(I.value||R.value)&&be.value.forEach(G=>{G.abortAttributeLoad(),G.clearFeatureCache()})},Fe=Hr(()=>{const G=be.value.map(g=>g.visibility&&g.canModifyLayer&&g.mapLayer),E=be.value.some(g=>g.visibility&&g.mapLayer&&!g.canModifyLayer),_=G.some(Boolean);return E&&_?"partial":_?"enabled":"disabled"}),Yt=Hr(()=>be.value.some(G=>G.isLoaded&&G.supportsFeatures&&G.mapLayer)),A=(G,E)=>ae.value[G].find(_=>(_.mappedAttr??_.origAttr)===E),ue=()=>{const G=be.value.filter(E=>E&&E.supportsFeatures&&E.isLoaded);G.length===0&&Ht(),k.value=G.reduce((E,{featureCount:_})=>E+_,0),L.value=new Array(be.value.length).fill(0),G.forEach((E,_)=>L.value[_]+=E.downloadedAttributes()),G.forEach((E,_)=>{$.value.push(rl(()=>E.downloadedAttributes(),g=>{L.value[_]=g}))}),Promise.all(G.map(E=>E.loadPromise())).then(()=>{const E=G.map(_=>Da(_).getTabularAttributes().then(g=>{const b=p?.value?.state?.state;if(b?.columns&&b.columnMetadata?.exclusiveColumns){const C=b.columns.map(O=>O.field);g.columns=g.columns.filter(O=>C.includes(O.title))}return g}));Promise.all(E).then(_=>{if(G.every(b=>b.attribLoadAborted())){I.value=!1;return}const g={columns:[],rows:[],fields:[],oidField:""};_.forEach((b,C)=>{const O=[],F=G[C].id;b.columns.forEach(N=>{p.value.fieldMap&&p.value.fieldMap[N.data]?(O.push({origAttr:N.data,mappedAttr:p.value.fieldMap[N.data]}),N.data=p.value.fieldMap[N.data],N.title=N.data):O.push({origAttr:N.data,mappedAttr:void 0}),g.columns.map(j=>j.data).includes(N.data)||g.columns.push(N)}),g.rows=g.rows.concat(b.rows.map(N=>{if(p.value.fieldMap)for(const[j,W]of Object.entries(p.value.fieldMap))N[j]!==void 0&&N[W]===void 0&&(N[W]=N[j],delete N[j]);return N}));for(let N=0;N((!r.ui.exposeOids&&N.type==="oid"||!r.ui.exposeMeasurements&&(N.name.toLowerCase()==="shape_length"||N.name.toLowerCase()==="shape_area"))&&_e.value.add(N.name),{name:p.value.fieldMap&&p.value.fieldMap[N.name]?p.value.fieldMap[N.name]:N.name,type:N.type,alias:N.alias??void 0,length:N.length??void 0}))),g.oidField=p.value.fieldMap&&p.value.fieldMap[b.oidField]?p.value.fieldMap[b.oidField]:b.oidField,ae.value[F]=O}),re.value=g.oidField,["rvRowIndex","rvInteractive","rvSymbol",...g.columns].forEach(b=>{p.value.state?.columns[b.data]===void 0&&(p.value.state.columns[b.data]=new $Jt({field:b.data,title:b.title})),(!r.ui.exposeOids||!r.ui.exposeMeasurements)&&_e.value.has(b.data)&&(p.value.state.columns[b.data].visible=!1);let C=p.value.state?.columns[b.data],O={headerName:C.title??b.title,headerComponent:"agColumnHeader",headerComponentParams:{sort:C.sort},field:b.data??b,isSelector:C.filter.type==="selector",sortable:!0,lockPosition:!0,filterParams:{},floatingFilter:p.value.state.colFilter&&C.searchable,hide:!C?.visible,minWidth:C.width,maxWidth:C.width??400,cellRenderer:N=>N.value,suppressHeaderKeyboardEvent:N=>{const j=N.event;return N.headerRowIndex===0&&(j.key==="Enter"||!j.target.classList.contains("ag-header-cell")&&j.key==="Tab")}},F=g.fields.find(N=>N.name===O.field);b==="rvRowIndex"||b==="rvSymbol"||b==="rvInteractive"?ye(O,K.value,p.value.state):(t.indexOf(F.type)>-1?(st(O,p.value.state),O.filter="agNumberColumnFilter",O.autoHeight=!0,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"number"}):F.type===j1.DATE?(Ue(O,p.value.state),O.filter="agDateColumnFilter",O.autoHeight=!0,O.minWidth=400,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"date"}):F.type===j1.STRING&&(O.isSelector?ct(O,g.rows,p.value.state):Ze(O,p.value.state),O.filter="agTextColumnFilter",O.autoHeight=!0,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"string"}),K.value.push(O))}),Q.value=Da(g.rows),K.value=Da(K.value),ot(),I.value=!1}).catch(_=>{console.error(_),R.value=!0,I.value=!1})})};return E0(()=>{p.value=n.grids[e.gridId],I.value=!0,h(),pe.value={firstRow:0,lastRow:0,visibleRows:0},S.value={agColumnHeader:m3n,numberFloatingFilter:MAn,textFloatingFilter:DAn,selectorFloatingFilter:BAn,dateFloatingFilter:qAn,clearFloatingFilter:KAn},w.value={ensureDomOrder:!0,rowHeight:40,suppressRowTransform:!0,onFilterChanged:()=>{ge(),ot()},onBodyScroll:()=>{[...document.querySelectorAll("[id^=tippy]")].forEach(G=>{G._tippy&&l.value?.contains(G._tippy.reference)&&G._tippy.hide()})},onBodyScrollEnd:()=>{vt()},rowBuffer:0,suppressColumnVirtualisation:!0,tabToNextCell:wAn,tabToNextHeader:bAn,onModelUpdated:xE(300,()=>Y.value.autoSizeAllColumns())},ue(),Fe.value==="partial"&&r.notify.show(K1.WARNING,r.$i18n.t("layer.filterwarning")),$.value.push(rl(c,()=>{m.value=!1,setTimeout(()=>{m.value=!0},10)})),$.value.push(rl(Fe,G=>{G==="partial"&&r.notify.show(K1.WARNING,r.$i18n.t("layer.filterwarning"))}))}),Ka(()=>{_t(),B.value.forEach(G=>r.event.off(G)),$.value.forEach(G=>G()),ne.value?.removeAccessibilityListeners(),ne.value?.removeScrollListeners()}),(G,E)=>{const _=Ko("dropdown-menu"),g=Nn("truncate"),b=Nn("tippy");return qt(),si("div",{class:"flex flex-col w-full h-full bg-white",ref_key:"el",ref:l},[Ur(Ot("div",null,[Ot("p",N3n,br(ri(u)("grid.splash.error")),1)],512),[[bf,R.value]]),Ur(Ot("div",$3n,[Ot("div",B3n,[Ot("span",j3n,br(L.value.reduce((C,O)=>C+O,0)),1),G3n,Ot("span",U3n,br(k.value),1)]),Ot("div",z3n,[Ot("span",V3n,br(L.value.reduce((C,O)=>C+O,0)Ve()),onKeypress:E[1]||(E[1]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:E[2]||(E[2]=Ph(C=>{ri(s).mobileView&&C?.target?.blur()},["enter"])),enterkeyhint:"done","onUpdate:modelValue":E[3]||(E[3]=C=>p.value.state.searchFilter=C),class:"rv-global-search rv-input pr-32 min-w-0","aria-invalid":"false","aria-label":ri(u)("grid.filters.label.global"),placeholder:ri(u)("grid.filters.label.global")},null,40,Q3n),[[LS,p.value.state.searchFilter]]),Ot("div",eMn,[p.value.state.searchFilter.length<3?(qt(),si("svg",tMn,rMn)):(qt(),si("button",{key:1,class:"flex justify-center fill-current ml-6 cursor-pointer",onClick:E[4]||(E[4]=C=>$e())},sMn))])],512),[[bf,p.value.state.search]]),Ot("div",oMn,[Vn(yAn,{columnApi:Y.value,columnDefs:K.value,systemCols:_e.value,onRefreshHeaders:E[5]||(E[5]=C=>v.value.refreshHeader())},null,8,["columnApi","columnDefs","systemCols"]),Ur((qt(),si("button",{type:"button",class:"grid-clearall p-4 h-40 text-gray-500 hover:text-black",onClick:E[6]||(E[6]=C=>tt()),content:ri(u)("grid.clearAll"),"aria-label":ri(u)("grid.clearAll")},uMn,8,aMn)),[[b,{placement:"bottom"}]]),Vn(_,{class:"h-40 w-40",position:"bottom-end",tooltip:ri(u)("panels.controls.optionsMenu"),centered:!1},{header:Rn(()=>[cMn]),default:Rn(()=>[Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:Fe.value!=="disabled"?"none":"text-black",disabled:Fe.value==="disabled"}]),onClick:E[7]||(E[7]=C=>Fe.value!=="disabled"&&ie()),role:"button","aria-label":ri(u)("grid.label.filters.apply")},[Ot("div",dMn,[pMn,Xs(" "+br(ri(u)("grid.label.filters.apply"))+" ",1),Fe.value!=="disabled"&&p.value.state.applyToMap?(qt(),si("svg",fMn,gMn)):Yr("",!0)])],10,hMn),Ot("a",{href:"javascript:;",class:"flex leading-snug items-center w-256 hover:text-black",onClick:E[8]||(E[8]=C=>Ct()),role:"button","aria-label":ri(u)("grid.label.filters.show")},[Ot("div",vMn,[_Mn,Xs(" "+br(ri(u)("grid.label.filters.show"))+" ",1),p.value.state.colFilter?(qt(),si("svg",bMn,xMn)):Yr("",!0)])],8,yMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:Fe.value!=="disabled"?"none":"text-black",disabled:Fe.value==="disabled"}]),onClick:E[9]||(E[9]=C=>Fe.value!=="disabled"&&yt()),role:"button","aria-label":ri(u)("grid.filters.label.extent")},[Ot("div",TMn,[CMn,Xs(" "+br(ri(u)("grid.filters.label.extent"))+" ",1),Fe.value!=="disabled"&&p.value.state.filterByExtent?(qt(),si("svg",EMn,AMn)):Yr("",!0)])],10,SMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:"text-black"}]),onClick:E[10]||(E[10]=C=>Je()),role:"button","aria-label":ri(u)("grid.label.pinColumns")},[a.value?(qt(),si("svg",OMn,RMn)):a.value?Yr("",!0):(qt(),si("svg",DMn,kMn)),Xs(" "+br(ri(u)("grid.label.pinColumns"))+" ",1),a.value?(qt(),si("svg",LMn,$Mn)):Yr("",!0)],8,MMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:"text-black"}]),onClick:E[11]||(E[11]=C=>it()),role:"button","aria-label":ri(u)("grid.label.export")},[jMn,Xs(" "+br(ri(u)("grid.label.export")),1)],8,BMn)]),_:1},8,["tooltip"])])])],512),[[bf,!I.value&&!R.value]]),m.value?Ur((qt(),Dn(ri(cAn),{key:0,class:"ag-theme-material flex-grow",enableCellTextSelection:"true",accentedSort:"true",localeText:ri(c)==="en"?ri(k3n):ri(L3n),gridOptions:w.value,columnDefs:K.value,rowData:Q.value,components:S.value,onGridReady:Te,onKeydown:ht,onFirstDataRendered:Be,onCellKeyPress:ri(de),doesExternalFilterPass:ke,isExternalFilterPresent:Ke},null,8,["localeText","gridOptions","columnDefs","rowData","components","onCellKeyPress"])),[[bf,!I.value&&!R.value]]):Yr("",!0)],512)}}}),UMn=ml(GMn,[["__scopeId","data-v-aec3f27c"]]),zMn=Xr({__name:"screen",props:{panel:{type:Zz,required:!0}},setup(i){const e=bB(),{t}=Qn(),r=Hr(()=>e.currentId);return(n,s)=>{const o=Ko("panel-screen");return qt(),Dn(o,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(t)("grid.title")),1)]),content:Rn(()=>[Vn(UMn,{class:"rv-grid",gridId:r.value,panel:i.panel},null,8,["gridId","panel"])]),_:1},8,["panel"])}}}),GJt=ml(zMn,[["__scopeId","data-v-e4d6fbae"]]),VMn=Object.freeze(Object.defineProperty({__proto__:null,default:GJt},Symbol.toStringTag,{value:"Module"})),HMn={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class WMn extends KIn{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":Da(GJt)},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:HMn}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("grid"),bB(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}const qMn=Object.freeze(Object.defineProperty({__proto__:null,default:WMn},Symbol.toStringTag,{value:"Module"}));class YMn extends Yu{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=_Te(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const XMn=i=>(Dc("data-v-c2a24c78"),i=i(),Fc(),i),JMn={key:0},KMn=["content"],ZMn={class:"text-lg text-left flex-grow"},QMn=XMn(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)),eOn=[QMn],tOn=["innerHTML"],iOn=Xr({__name:"section",props:{helpSection:{type:Object,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return i.helpSection.drawn?(qt(),si("div",JMn,[Ot("div",null,[Ur((qt(),si("button",{type:"button",class:"help-section-header flex items-center py-15 px-25 hover:bg-gray-200 cursor-pointer select-none w-full",onClick:r[0]||(r[0]=s=>t.$emit("expand")),content:ri(e)(i.helpSection.expanded?"help.section.collapse":"help.section.expand")},[Ot("span",ZMn,br(i.helpSection.header),1),Ot("div",{class:Wn(["dropdown-icon",{"transform -rotate-180":i.helpSection.expanded}])},eOn,2)],8,KMn)),[[n,{placement:"top-end",hideOnClick:!1}]]),Vn(eL,{name:"help-item",mode:"out-in"},{default:Rn(()=>[Ur(Ot("div",{innerHTML:i.helpSection.info,class:"ramp-markdown section-body px-20 pt-5 ml-10 overflow-hidden"},null,8,tOn),[[bf,i.helpSection.expanded]])]),_:1})])])):Yr("",!0)}}}),rOn=ml(iOn,[["__scopeId","data-v-c2a24c78"]]);function UJt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let S7=UJt();function nOn(i){S7=i}const zJt=/[&<>"']/,sOn=new RegExp(zJt.source,"g"),VJt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,oOn=new RegExp(VJt.source,"g"),aOn={"&":"&","<":"<",">":">",'"':""","'":"'"},y_t=i=>aOn[i];function mv(i,e){if(e){if(zJt.test(i))return i.replace(sOn,y_t)}else if(VJt.test(i))return i.replace(oOn,y_t);return i}const lOn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function HJt(i){return i.replace(lOn,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const uOn=/(^|[^\[])\^/g;function Dh(i,e){i=typeof i=="string"?i:i.source,e=e||"";const t={replace:(r,n)=>(n=n.source||n,n=n.replace(uOn,"$1"),i=i.replace(r,n),t),getRegex:()=>new RegExp(i,e)};return t}const cOn=/[^\w:]/g,hOn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v_t(i,e,t){if(i){let r;try{r=decodeURIComponent(HJt(t)).replace(cOn,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}e&&!hOn.test(t)&&(t=mOn(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Dpe={},dOn=/^[^:]+:\/*[^/]*$/,pOn=/^([^:]+:)[\s\S]*$/,fOn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function mOn(i,e){Dpe[" "+i]||(dOn.test(i)?Dpe[" "+i]=i+"/":Dpe[" "+i]=r0e(i,"/",!0)),i=Dpe[" "+i];const t=i.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:i.replace(pOn,"$1")+e:e.charAt(0)==="/"?t?e:i.replace(fOn,"$1")+e:i+e}const Iwe={exec:function(){}};function __t(i,e){const t=i.replace(/\|/g,(s,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=t.split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>e)r.splice(e);else for(;r.length1;)e&1&&(t+=i),e>>=1,i+=i;return t+i}function w_t(i,e,t,r){const n=e.href,s=e.title?mv(e.title):null,o=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:t,href:n,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,a}return{type:"image",raw:t,href:n,title:s,text:mv(o)}}function vOn(i,e){const t=i.match(/^(\s+)(?:```)/);if(t===null)return e;const r=t[1];return e.split(` +\0`+(at?"\0\b":"\0\0")+"\0\0"+Se(Lt,2)+Se(Kt,2)+Se(cr?this.getFromCrc32Table(kr):0,4)+Se(cr,4)+Se(cr,4)+Se(Pe.length,2)+Se(_i.length,2),Vr="PK"+Er+Pe+_i,kn="PK\0"+Er+"\0\0\0\0\0\0"+(y?"\0\0\0\0":"\0\0\0")+Se(d,4)+Pe+_i;return{fileHeader:Vr,folderHeader:kn,content:kr||""}},P.getConvertedContent=function(f,d){return d===void 0&&(d=!1),d&&(f=f.split(";base64,")[1]),f=d?atob(f):f,{size:f.length,content:f}},P.buildFolderEnd=function(f,d,y){var T=_o.decToHex;return"PK\0\0\0\0"+T(f,2)+T(f,2)+T(d,4)+T(y,4)+"\0\0"},P.buildUint8Array=function(f){for(var d=new Uint8Array(f.length),y=0;y>>8^Se;return M^-1},P.convertTime=function(f){var d=f.getHours();return d<<=6,d=d|f.getMinutes(),d<<=5,d=d|f.getSeconds()/2,d},P.convertDate=function(f){var d=f.getFullYear()-1980;return d<<=4,d=d|f.getMonth()+1,d<<=5,d=d|f.getDate(),d},P.folders=[],P.files=[],P}();Yt.register(Wui,!1),Yt.register(Qui,!1),Yt.register(Jtt,!1),i.AbstractHeaderCellCtrl=iJ,i.AgAbstractField=bo,i.AgAngleSelect=ttt,i.AgCheckbox=q7,i.AgColorPicker=itt,i.AgDialog=dAe,i.AgGroupComponent=rtt,i.AgInputNumberField=Zet,i.AgInputRange=Qet,i.AgInputTextArea=Ket,i.AgInputTextField=cAe,i.AgMenuItemComponent=J7,i.AgMenuList=att,i.AgMenuPanel=ltt,i.AgPanel=hAe,i.AgPromise=Dg,i.AgRadioButton=Xet,i.AgSelect=LX,i.AgSlider=ett,i.AgStackComponentsRegistry=Gr,i.AgToggleButton=Jet,i.AlignedGridsService=ptt,i.AnimateShowChangeCellRenderer=Bue,i.AnimateSlideCellRenderer=jue,i.AnimationFrameService=ket,i.AutoScrollService=XQe,i.AutoWidthCalculator=Bet,i.Autowired=ie,i.BaseComponentWrapper=Iui,i.BaseCreator=Vtt,i.BaseGridSerializingSession=Htt,i.Bean=me,i.BeanStub=Qi,i.Beans=JIe,i.BodyDropPivotTarget=get,i.BodyDropTarget=vet,i.CellComp=pet,i.CellCtrl=oD,i.CellNavigationService=dtt,i.CellPositionUtils=Ftt,i.ChangedPath=nce,i.CheckboxSelectionComponent=B7,i.ColDefUtil=co,i.Color=Hs,i.Column=G,i.ColumnApi=mtt,i.ColumnFactory=ko,i.ColumnGroup=ei,i.ColumnKeyCreator=v,i.ColumnModel=dt,i.ColumnUtils=oi,i.Component=ka,i.ComponentUtil=Fi,i.Constants=Fe,i.Context=st,i.CssClassApplier=eAe,i.CssClassManager=bue,i.CsvCreator=Ytt,i.CsvExportModule=Jtt,i.CtrlsService=$tt,i.CustomTooltipFeature=_L,i.DateFilter=jX,i.DisplayedGroupCreator=kt,i.Downloader=Wtt,i.DragAndDropService=kg,i.DragService=UQe,i.Environment=Ott,i.EventService=_t,i.Events=ai,i.ExpressionService=vtt,i.FilterManager=zQe,i.FloatingFilterMapper=jQe,i.FocusService=K7,i.Grid=Cui,i.GridApi=wet,i.GridBodyComp=oet,i.GridBodyCtrl=QQe,i.GridComp=Stt,i.GridCoreCreator=jtt,i.GridCtrl=xtt,i.GridHeaderComp=Oet,i.GridHeaderCtrl=Met,i.GridOptionsWrapper=as,i.GridSerializer=Xtt,i.GroupCellRenderer=U7,i.GroupCellRendererCtrl=Bf,i.GroupInstanceIdCreator=Al,i.HeaderCellCtrl=Cet,i.HeaderFilterCellComp=VQe,i.HeaderFilterCellCtrl=Tet,i.HeaderGroupCellCtrl=Eet,i.HeaderNavigationService=Aet,i.HeaderPositionUtils=Ltt,i.HeaderRowComp=bet,i.HeaderRowContainerComp=tce,i.HeaderRowContainerCtrl=Iet,i.HeaderRowCtrl=ece,i.HorizontalResizeService=Pet,i.KeyCode=sn,i.LargeTextCellEditor=WX,i.Logger=cce,i.LoggerFactory=wtt,i.ManagedFocusFeature=iw,i.ModuleRegistry=Yt,i.MouseEventService=cet,i.MoveColumnFeature=yet,i.NavigationService=het,i.NumberFilter=UX,i.NumberSequence=Rg,i.Optional=ge,i.PaginationProxy=Wet,i.PinnedRowModel=Vet,i.PopupComponent=t2,i.PopupEditorWrapper=det,i.PopupSelectCellEditor=XX,i.PopupService=ctt,i.PopupTextCellEditor=$ue,i.PositionableFeature=$et,i.PostConstruct=Ke,i.PreConstruct=ye,i.PreDestroy=ke,i.PropertyKeys=xt,i.ProvidedColumnGroup=Xt,i.ProvidedFilter=wL,i.Qualifier=rt,i.QuerySelector=wue,i.RefSelector=Mr,i.ResizeObserverService=Fet,i.RowContainerComp=fet,i.RowContainerCtrl=Xue,i.RowCtrl=aD,i.RowNode=Va,i.RowNodeBlock=sce,i.RowNodeBlockLoader=Het,i.RowNodeSorter=Ntt,i.RowPositionUtils=Dtt,i.RowRenderer=Get,i.ScalarFilter=rf,i.ScrollVisibleService=aet,i.SelectCellEditor=YX,i.SelectableService=Rtt,i.SelectionService=ftt,i.SetLeftFeature=Kue,i.SimpleFilter=Id,i.SortController=Ttt,i.StandardMenuFactory=Ret,i.StylingService=Yet,i.TabGuardComp=cJ,i.TabGuardCtrl=stt,i.TabbedLayout=yai,i.TemplateService=_tt,i.TextCellEditor=CL,i.TextFilter=SL,i.TextFloatingFilter=VX,i.Timer=rr,i.TouchListener=S_,i.UserComponentFactory=GQe,i.UserComponentRegistry=$t,i.ValueCache=Ett,i.ValueFormatterService=zet,i.ValueService=gtt,i.VanillaFrameworkOverrides=htt,i.VirtualList=hli,i.XmlFactory=nci,i.ZipContainer=aci,i._=_o,i.defaultGroupComparator=Eui,i.getRowContainerTypeForName=set,i.simpleHttpRequest=vai,i.stringToArray=Ll})(aE);var Rre=globalThis&&globalThis.__assign||function(){return Rre=Object.assign||function(i){for(var e,t=1,r=arguments.length;t0},i.mapChildColumnDefs=function(e){return e.default.map(function(t){return i.toColDef(t)})},i.toColDef=function(e){var t=i.createColDefFromGridColumn(e);return e.children&&e.children.length>0&&(t.children=i.getChildColDefs(e.children)),t},i.getChildColDefs=function(e){return e.map(function(t){return i.createColDefFromGridColumn(t)})},i.createColDefFromGridColumn=function(e){var t={};return Object.assign(t,e.data.attrs),delete t.children,aE.ColDefUtil.BOOLEAN_PROPERTIES.forEach(function(r){var n=t;n[r]===""&&(n[r]=!0)}),t},i}(),tAn=globalThis&&globalThis.__extends||function(){var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},i(e,t)};return function(e,t){i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),iAn=function(i){tAn(e,i);function e(t){var r=i.call(this)||this;return r.parent=t,r}return e.prototype.frameworkComponent=function(t){return BJt.searchForComponentInstance(this.parent,t,10,!0)?t:null},e.prototype.isFrameworkComponent=function(t){return typeof t=="object"},e}(aE.VanillaFrameworkOverrides),Ewe=globalThis&&globalThis.__assign||function(){return Ewe=Object.assign||function(i){for(var e,t=1,r=arguments.length;t{const s=Ko("dropdown-menu");return qt(),Dn(s,{class:"relative",position:"bottom-end",tooltip:ri(t)("grid.label.columns"),"tooltip-placement":"bottom",centered:!1},{header:Rn(()=>[lAn]),default:Rn(()=>[(qt(!0),si(Ks,null,hu(i.columnDefs.filter(o=>o.headerName&&o.headerName.length>0&&!(!ri(e).ui.exposeOids&&i.systemCols?.has(o.headerName))&&!(!ri(e).ui.exposeMeasurements&&(i.systemCols?.has(o.headerName)||i.systemCols?.has(o.field)))),o=>(qt(),si("a",{key:o.headerName,onClick:a=>{i.columnApi?.setColumnVisible(o.field,o.hide),o.hide=!o.hide,r.$emit("refreshHeaders")},href:"javascript:;",class:"flex leading-snug items-center w-256"},[Ot("div",cAn,[Xs(br(o.headerName)+" ",1),o.hide?Yr("",!0):(qt(),si("svg",hAn,pAn))])],8,uAn))),128))]),_:1},8,["tooltip"])}}}),mAn=".ag-root",gAn=".ag-header-viewport .ag-header-row";class g_t{element;agGrid;headerRows;agGridApi;agColumnApi;mousedown=!1;static onCellKeyPress({event:e}){function t(r){r.forEach(n=>{n.href&&window.open(n.href),n.childNodes.length>0&&t(n.childNodes)})}e.key=="Enter"&&t(e.target.childNodes)}constructor(e,t,r){this.element=e,this.agGridApi=t,this.agColumnApi=r,this.agGrid=this.element.querySelector(mAn),this.headerRows=Array.prototype.slice.call(this.element.querySelectorAll(gAn)),this.element.querySelector(".ag-body-horizontal-scroll-viewport")?.setAttribute("tabindex","-1"),this.initAccessibilityListeners(),this.initScrollListeners()}initAccessibilityListeners(){Array.prototype.slice.call(this.headerRows[0].querySelectorAll(".ag-header-cell")).forEach((t,r)=>{if(r<3)return;const n=Array.prototype.slice.call(t.querySelectorAll("button"));t.addEventListener("keydown",s=>{this.cellKeydownHandler(s,t,n)}),t.addEventListener("blur",s=>{this.cellBlurHandler(s,t,n)}),n[n.length-1].addEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!1)}),n[0].addEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!0)})})}removeAccessibilityListeners(){Array.prototype.slice.call(this.headerRows[0].querySelectorAll(".ag-header-cell")).forEach((t,r)=>{if(r<3)return;const n=Array.prototype.slice.call(t.querySelectorAll("button"));t.removeEventListener("keydown",s=>{this.cellKeydownHandler(s,t,n)}),t.removeEventListener("blur",s=>{this.cellBlurHandler(s,t,n)}),n[n.length-1].removeEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!1)}),n[0].removeEventListener("keydown",s=>{this.cellButtonTabHandler(s,t,n,!0)})})}cellKeydownHandler(e,t,r){e.key==="Enter"&&e.target===t&&(e.preventDefault(),r.forEach(n=>{n.setAttribute("tabindex","0")}),r[0].focus())}cellBlurHandler(e,t,r){e.target===t&&!r.includes(e.relatedTarget)&&r.forEach(n=>{n.setAttribute("tabindex","-1")})}cellButtonTabHandler(e,t,r,n){e.key==="Tab"&&(n&&e.shiftKey||!n&&!e.shiftKey)&&(e.preventDefault(),t.focus(),r.forEach(s=>{s.setAttribute("tabindex","-1")}))}initScrollListeners(){this.agGrid.style.cursor="grab",this.agGrid.addEventListener("mousedown",e=>{this.scrollMouseDownHandler(e)})}removeScrollListeners(){this.agGrid.style.cursor="default",this.agGrid.removeEventListener("mousedown",e=>{this.scrollMouseDownHandler(e)})}scrollMouseDownHandler(e){const t=this.element.querySelector(".ag-body-horizontal-scroll-viewport"),r=t.scrollLeft,n=e.clientX;this.agGrid.style.cursor="grabbing";const s=a=>{const l=a.clientX-n;t.scrollLeft=r-l},o=()=>{this.agGrid.style.cursor="grab",this.agGrid.removeEventListener("mousemove",s),this.agGrid.removeEventListener("mouseup",o),this.agGrid.removeEventListener("mouseleave",o)};this.agGrid.addEventListener("mousemove",s),this.agGrid.addEventListener("mouseup",o),this.agGrid.addEventListener("mouseleave",o)}}function yAn(i){const e=i.previousHeaderPosition.column,t=i.previousHeaderPosition.headerRowIndex;let r=i.backwards?t-1:t+1;return r===-1?null:(r===i.headerRowCount&&(r=-1),{headerRowIndex:r,column:e})}function vAn(i){return i.backwards?{column:i.previousCellPosition.column,rowIndex:-1}:null}const _An=i=>(Dc("data-v-81f67cc1"),i=i(),Fc(),i),bAn={class:"h-full flex items-center justify-center"},wAn=["placeholder","aria-label","disabled"],xAn=_An(()=>Ot("span",{class:"w-12"},null,-1)),SAn=["placeholder","aria-label","disabled"],TAn={methods:{onParentModelChanged(){}}},CAn=Xr({...TAn,__name:"custom-number-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(""),o=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),a=()=>{n.value=n.value!==""&&!isNaN(n.value)?n.value:null,e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value,"min")})},l=()=>{s.value=s.value!==""&&!isNaN(s.value)?s.value:null,e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,s.value,"max")})},u=c=>{(isNaN(n.value)||n.value===null)&&(n.value=""),(isNaN(s.value)||s.value===null)&&(s.value=""),s.value!==""&&n.value!==""?c.setModel({filterType:"number",type:"inRange",filter:n.value,filterTo:s.value}):n.value===""?c.setModel({filterType:"number",type:"lessThanOrEqual",filter:s.value}):s.value===""?c.setModel({filterType:"number",type:"greaterThanOrEqual",filter:n.value}):c.setModel(null),e.params.api.onFilterChanged()};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"min"),s.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"max"),a(),l()}),(c,h)=>(qt(),si("div",bAn,[Ur(Ot("input",{class:Wn(["rv-min rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),style:{width:"45%"},type:"number","onUpdate:modelValue":h[0]||(h[0]=p=>n.value=p),onInput:h[1]||(h[1]=p=>a()),onMousedown:h[2]||(h[2]=ia(()=>{},["stop"])),onKeypress:h[3]||(h[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[4]||(h[4]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.number.min"),"aria-label":ri(r)("grid.filters.number.min"),disabled:o.value},null,42,wAn),[[LS,n.value]]),xAn,Ur(Ot("input",{class:Wn(["rv-max rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),style:{width:"45%"},type:"number","onUpdate:modelValue":h[5]||(h[5]=p=>s.value=p),onInput:h[6]||(h[6]=p=>l()),onMousedown:h[7]||(h[7]=ia(()=>{},["stop"])),onKeypress:h[8]||(h[8]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[9]||(h[9]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.number.max"),"aria-label":ri(r)("grid.filters.number.max"),disabled:o.value},null,42,SAn),[[LS,s.value]])]))}}),EAn=ml(CAn,[["__scopeId","data-v-81f67cc1"]]),IAn={class:"h-full flex items-center justify-center"},AAn=["placeholder","aria-label","disabled"],MAn={methods:{onParentModelChanged(){}}},OAn=Xr({...MAn,__name:"custom-text-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),o=()=>{e.params.parentFilterInstance(a=>{n.value=n.value?n.value:"",a.setModel({filterType:"text",type:"contains",filter:n.value}),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value),e.params.api.onFilterChanged()})};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field),o()}),(a,l)=>(qt(),si("div",IAn,[Ur(Ot("input",{class:Wn(["rv-input w-full bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":s.value}]),type:"text",onInput:l[0]||(l[0]=u=>o()),"onUpdate:modelValue":l[1]||(l[1]=u=>n.value=u),onMousedown:l[2]||(l[2]=ia(()=>{},["stop"])),onKeypress:l[3]||(l[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:l[4]||(l[4]=Ph(u=>{ri(t).mobileView&&u.target.blur()},["enter"])),enterkeyhint:"done",placeholder:ri(r)("grid.filters.column.label.text",[i.params.column.colDef.headerName]),"aria-label":ri(r)("grid.filters.column.label.text",[i.params.column.colDef.headerName]),disabled:s.value},null,42,AAn),[[LS,n.value]])]))}}),PAn={class:"h-full flex items-center justify-center"},RAn=["aria-label","disabled"],DAn=["value"],FAn={methods:{onParentModelChanged(){}}},kAn=Xr({...FAn,__name:"custom-selector-filter",props:["params"],setup(i){const e=i,t=vi(""),r=vi([]),n=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),s=()=>{t.value=t.value?t.value:"",e.params.parentFilterInstance(o=>{t.value==="..."?(o.setModel(null),t.value=""):o.setModel({filterType:"text",type:"contains",filter:t.value}),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,t.value),e.params.api.onFilterChanged()})};return E0(()=>{t.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field);let o=e.params.rowData;o=o.map(a=>a[e.params.column.colId]),r.value=o.filter((a,l)=>o.indexOf(a)===l),r.value.unshift("..."),s()}),(o,a)=>(qt(),si("div",PAn,[Ur(Ot("select",{class:Wn(["rv-input w-full bg-white text-black-75 h-24 py-0 px-8 border-2 rounded",{"cursor-not-allowed":n.value}]),"onUpdate:modelValue":a[0]||(a[0]=l=>t.value=l),onChange:a[1]||(a[1]=l=>s()),onMousedown:a[2]||(a[2]=ia(()=>{},["stop"])),"aria-label":t.value,disabled:n.value},[(qt(!0),si(Ks,null,hu(r.value,l=>(qt(),si("option",{value:l,key:l},br(l),9,DAn))),128))],42,RAn),[[ZSe,t.value]])]))}}),LAn=ml(kAn,[["__scopeId","data-v-401a2b3c"]]),NAn=i=>(Dc("data-v-df09f5c8"),i=i(),Fc(),i),$An={class:"h-full flex items-center justify-center w-full"},BAn=["placeholder","aria-label","disabled"],jAn=NAn(()=>Ot("span",{class:"w-12"},null,-1)),GAn=["placeholder","aria-label","disabled"],UAn={methods:{onParentModelChanged(){}}},zAn=Xr({...UAn,__name:"custom-date-filter",props:["params"],setup(i){const e=i,t=w0(),{t:r}=Qn(),n=vi(""),s=vi(""),o=vi(e.params.stateManager.columns[e.params.column.colDef.field].filter.static),a=()=>{e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,n.value,"min")})},l=()=>{e.params.parentFilterInstance(c=>{u(c),e.params.stateManager.setColumnFilterValue(e.params.column.colDef.field,s.value,"max")})},u=c=>{s.value===""&&n.value===""?c.setModel(null):s.value!==""&&n.value!==""?c.setModel({filterType:"date",type:"inRange",dateFrom:n.value,dateTo:s.value}):n.value===""?c.setModel({filterType:"date",type:"lessThan",dateFrom:s.value}):s.value===""&&c.setModel({filterType:"date",type:"greaterThan",dateFrom:n.value}),e.params.api.onFilterChanged()};return E0(()=>{n.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"min")||"",s.value=e.params.stateManager.getColumnFilterValue(e.params.column.colDef.field,"max")||"",a(),l()}),(c,h)=>(qt(),si("div",$An,[Ur(Ot("input",{class:Wn(["m-0 py-1 w-1/2 rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),type:"date",placeholder:ri(r)("grid.filters.date.min"),"aria-label":ri(r)("grid.filters.date.min"),"onUpdate:modelValue":h[0]||(h[0]=p=>n.value=p),onInput:h[1]||(h[1]=p=>a()),onMousedown:h[2]||(h[2]=ia(()=>{},["stop"])),onKeypress:h[3]||(h[3]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[4]||(h[4]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",disabled:o.value},null,42,BAn),[[LS,n.value]]),jAn,Ur(Ot("input",{class:Wn(["m-0 py-1 w-1/2 rv-input bg-white text-black-75 h-24 py-16 px-8 border-2 rounded",{"cursor-not-allowed":o.value}]),type:"date",placeholder:ri(r)("grid.filters.date.max"),"aria-label":ri(r)("grid.filters.date.max"),"onUpdate:modelValue":h[5]||(h[5]=p=>s.value=p),onInput:h[6]||(h[6]=p=>l()),onMousedown:h[7]||(h[7]=ia(()=>{},["stop"])),onKeypress:h[8]||(h[8]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:h[9]||(h[9]=Ph(p=>{ri(t).mobileView&&p.target.blur()},["enter"])),enterkeyhint:"done",disabled:o.value},null,42,GAn),[[LS,s.value]])]))}}),VAn=ml(zAn,[["__scopeId","data-v-df09f5c8"]]),HAn=["content","disabled"],WAn=Ot("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",class:"h-24 w-24 fill-current",viewBox:"0 0 24 24"},[Ot("g",null,[Ot("rect",{fill:"none",height:"24",width:"24"})]),Ot("g",null,[Ot("g",null,[Ot("path",{d:"M19.79,5.61C20.3,4.95,19.83,4,19,4H6.83l7.97,7.97L19.79,5.61z"}),Ot("path",{d:"M2.81,2.81L1.39,4.22L10,13v6c0,0.55,0.45,1,1,1h2c0.55,0,1-0.45,1-1v-2.17l5.78,5.78l1.41-1.41L2.81,2.81z"})])])],-1),qAn=[WAn],YAn=Xr({__name:"clear-filter",props:["params"],setup(i){const e=i,{t}=Qn(),r=vi(),n=()=>e.params.clearFilters();return Fa(async()=>{await Bv();const s=r.value?.closest(".ag-header-cell"),o=s.closest(".ag-pinned-left-header");s.addEventListener("keydown",async a=>{a.key==="Enter"&&(a.stopPropagation(),n(),await Bv(),o.querySelector(".ag-header-cell.ag-floating-filter").focus())}),s.addEventListener("focus",()=>{r.value._tippy.show()}),s.addEventListener("blur",()=>{r.value._tippy.hide()})}),Ka(()=>{const s=r.value?.closest(".ag-header-cell"),o=s.closest(".ag-pinned-left-header");s.removeEventListener("keydown",async a=>{a.key==="Enter"&&(a.stopPropagation(),n(),await Bv(),o.querySelector(".ag-header-cell.ag-floating-filter").focus())}),s.removeEventListener("focus",()=>{r.value._tippy.show()}),s.removeEventListener("blur",()=>{r.value._tippy.hide()})}),(s,o)=>{const a=Nn("tippy");return Ur((qt(),si("button",{type:"button",class:"clearFilterButton flex items-center justify-center w-full h-full disabled:opacity-30 disabled:cursor-default text-gray-500 hover:text-black",onClick:n,content:ri(t)("grid.filters.clear"),disabled:!i.params.stateManager.filtered,tabindex:"-1",ref_key:"el",ref:r},qAn,8,HAn)),[[a,{placement:"bottom"}]])}}}),XAn={key:0,class:"flex flex-1 items-center min-w-0","truncate-trigger":""},JAn=["content","aria-label"],KAn={key:1,class:"customHeaderLabel",role:"columnheader"},ZAn={key:2,class:"flex"},QAn={key:0,class:"w-24 inline-block"},e3n={key:1,class:"customSortDownLabel"},t3n=Ot("div",{class:"md-icon-small"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"arrow_upward"},[Ot("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})])])],-1),i3n=[t3n],r3n={key:2,class:"customSortUpLabel"},n3n=Ot("div",{class:"md-icon-small"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"arrow_downward"},[Ot("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})])])],-1),s3n=[n3n],o3n=["content","aria-label","disabled"],a3n=Ot("div",{class:"inline-block"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"keyboard_arrow_left"},[Ot("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])])],-1),l3n=[a3n],u3n=["content","aria-label","disabled"],c3n=Ot("div",{class:"inline-block"},[Ot("svg",{height:"24",width:"24"},[Ot("g",{id:"keyboard_arrow_right"},[Ot("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"})])])],-1),h3n=[c3n],d3n=Xr({__name:"custom-header",props:["params"],setup(i){const e=i,{t}=Qn(),r=vi(),n=vi(0),s=vi(!1),o=vi(!1),a=vi(!1),l=vi(null),u=()=>{const m=l.value.getAllDisplayedColumns(),v=m.indexOf(e.params.column);o.value=v>3&&!m[v-1].colDef.isStatic,a.value=v{const m=l.value.getAllDisplayedColumns(),v=l.value.getAllGridColumns(),w=v.indexOf(m[m.indexOf(e.params.column)-1]);o.value&&(l.value.moveColumn(e.params.column,w),e.params.api.ensureColumnVisible(v[w]),r.value?.closest(".ag-header-row")?.querySelector(`[col-id="${e.params.column.colId}"]`)?.querySelector(".move-left")?.focus())},h=()=>{const m=l.value.getAllDisplayedColumns(),v=l.value.getAllGridColumns(),w=v.indexOf(m[m.indexOf(e.params.column)+1]);a.value&&(l.value.moveColumn(e.params.column,w),e.params.api.ensureColumnVisible(v[w]))},p=m=>{n.value=(n.value+1)%3,n.value===1?e.params.setSort("asc",m.shiftKey):n.value===2?e.params.setSort("desc",m.shiftKey):e.params.setSort("none",m.shiftKey)};return Fa(()=>{s.value=e.params.column.colDef.sortable,l.value=e.params.columnApi,e.params.sort==="asc"?(n.value=1,e.params.setSort("asc")):e.params.sort==="desc"&&(n.value=2,e.params.setSort("desc")),u(),e.params.column.addEventListener("leftChanged",()=>{u()})}),Ka(()=>{e.params.column.removeEventListener("leftChanged",()=>{u()})}),(m,v)=>{const w=Nn("truncate"),S=Nn("tippy");return qt(),si("div",{class:"ag-custom-header flex flex-1 items-center h-full w-full",ref_key:"el",ref:r},[s.value?(qt(),si("div",XAn,[Ur((qt(),si("button",{type:"button",onClick:v[0]||(v[0]=I=>p(I)),content:ri(t)(`grid.header.sort.${n.value}`),"aria-label":ri(t)(`grid.header.sort.${n.value}`),class:"customHeaderLabel hover:bg-gray-300 font-bold p-8 max-w-full",role:"columnheader",tabindex:"-1"},[Ur((qt(),si("div",null,[Xs(br(i.params.displayName),1)])),[[w,{externalTrigger:!0}]])],8,JAn)),[[S,{placement:"top",hideOnClick:!1}]])])):Ur((qt(),si("span",KAn,[Xs(br(i.params.displayName),1)])),[[w]]),s.value?(qt(),si("div",ZAn,[i.params.enableSorting&&n.value===0?(qt(),si("span",QAn)):Yr("",!0),i.params.enableSorting&&n.value===1?(qt(),si("span",e3n,i3n)):Yr("",!0),i.params.enableSorting&&n.value===2?(qt(),si("span",r3n,s3n)):Yr("",!0),Ur((qt(),si("button",{type:"button",content:ri(t)("grid.header.reorder.left"),"aria-label":ri(t)("grid.header.reorder.left"),onClick:v[1]||(v[1]=I=>c()),class:"move-left opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default flex justify-center items-center",tabindex:"-1",disabled:!o.value},l3n,8,o3n)),[[S,{placement:"top"}]]),Ur((qt(),si("button",{type:"button",content:ri(t)("grid.header.reorder.right"),"aria-label":ri(t)("grid.header.reorder.right"),onClick:v[2]||(v[2]=I=>h()),class:"move-right opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default flex justify-center items-center",tabindex:"-1",disabled:!a.value},h3n,8,u3n)),[[S,{placement:"top"}]])])):Yr("",!0)],512)}}}),p3n=["content"],f3n=Ot("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"16",viewBox:"0 0 24 24",width:"16"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{style:{fill:"#979797"},d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1),m3n=[f3n],g3n=Xr({__name:"details-button-renderer",props:["params"],setup(i){const e=i,{t}=Qn(),r=eo("iApi"),n=vi(),s=async()=>{const o=e.params.data,a=o.rvUid,l=r.geo.layer.getLayer(a),u=l.oidField,h=e.params.layerCols[l.id].find(m=>m.origAttr===u)?.mappedAttr||u,p=await l.getGraphic(o[h],{getAttribs:!0});r.event.emit(ln.DETAILS_TOGGLE,{data:p.attributes,uid:a,format:z8.ESRI},!0),e.params.isTeleport&&r.scrollToInstance()};return Fa(()=>{e.params.eGridCell.addEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.addEventListener("focus",()=>{n.value._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{n.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.removeEventListener("focus",()=>{n.value._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{n.value._tippy.hide()})}),(o,a)=>{const l=Nn("tippy");return Ur((qt(),si("button",{type:"button",class:"flex items-center justify-center w-40 h-36",content:ri(t)("grid.cells.details"),onClick:s,tabindex:"-1",ref_key:"el",ref:n},m3n,8,p3n)),[[l,{placement:"top"}]])}}}),y3n=["content"],v3n={key:0,class:"m-auto animate-spin spinner h-20 w-20"},_3n={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"w-20 h-20"},b3n=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1),w3n=[b3n],x3n={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"w-20 h-20"},S3n=Ot("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1),T3n=[S3n],C3n=["innerHTML"],E3n=Xr({__name:"zoom-button-renderer",props:["params"],setup(i){const e=i,t=vi("none"),r=eo("iApi"),n=H1(),s=vi(),{t:o}=Qn(),a=Hr(()=>{const c=n.getLayerByUid(e.params.data.rvUid);return!!c&&c.mapLayer}),l=()=>{if(t.value!=="none")return;t.value="zooming";const c=n.getLayerByUid(e.params.data.rvUid);if(c===void 0||!c.isLoaded){u("error");return}const h=e.params.layerCols[c.id].find(v=>v.origAttr===c.oidField),p=e.params.data[h.mappedAttr??h.origAttr],m=()=>{const v={getGeom:!0};c.getGraphic(p,v).then(w=>{w.geometry.invalid()?(console.error(`Could not find graphic for objectid ${p}`),u("error")):(r.geo.map.zoomMapTo(w.geometry),u("zoomed"),r.updateAlert(r.$i18n.t("grid.cells.alert.zoom")),e.params.isTeleport&&r.scrollToInstance())}).catch(()=>{u("error")})};c.layerType===pn.FEATURE&&c.geomType!==cl.POINT?c.getGraphicExtent(p).then(v=>{r.geo.map.zoomMapTo(v),u("zoomed"),r.updateAlert(r.$i18n.t("grid.cells.alert.zoom")),e.params.isTeleport&&r.scrollToInstance()}).catch(()=>{m()}):m()},u=c=>{c==="zoomed"||c==="error"?setTimeout(()=>{t.value=c,s.value?._tippy.show(),setTimeout(()=>{s.value?._tippy.hide(),t.value="none"},3e3)},300):t.value=c};return Fa(()=>{a.value&&(e.params.eGridCell.addEventListener("keydown",c=>{c.key==="Enter"&&t.value==="none"&&l()}),e.params.eGridCell.addEventListener("focus",()=>{s.value?._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{s.value?._tippy.hide()}))}),Ka(()=>{a.value&&(e.params.eGridCell.removeEventListener("keydown",c=>{c.key==="Enter"&&l()}),e.params.eGridCell.removeEventListener("focus",()=>{s.value?._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{s.value?._tippy.hide()}))}),(c,h)=>{const p=Nn("tippy");return a.value?Ur((qt(),si("button",{key:0,type:"button",class:"flex items-center justify-center w-40 h-36",content:ri(o)(`grid.cells.zoom${t.value==="none"?"":`.${t.value}`}`),onClick:l,tabindex:"-1",ref_key:"button",ref:s},[t.value==="zooming"?(qt(),si("div",v3n)):t.value==="zoomed"?(qt(),si("svg",_3n,w3n)):t.value==="error"?(qt(),si("svg",x3n,T3n)):(qt(),si("span",{key:3,innerHTML:ri(r).ui.getZoomIcon()},null,8,C3n))],8,y3n)),[[p,{placement:"top"}]]):Yr("",!0)}}}),I3n=["content"],A3n=["innerHTML"],M3n=Xr({__name:"custom-button-renderer",props:["params"],setup(i){const e=i,t=eo("iApi"),r=vi(),n=Hr(()=>{let o=Object.assign({},e.params.data);const a=t.geo.layer.getLayer(o.rvUid),l=e.params.config.displayOn;return!(!a||l==="geo"&&!a.mapLayer||l==="data"&&a.mapLayer)}),s=()=>{let o=Object.assign({},e.params.data);const a=t.geo.layer.getLayer(o.rvUid),l=e.params.layerCols[a.id].find(c=>c.origAttr===a.oidField),u=l.mappedAttr?o[l.mappedAttr]:o[l.origAttr];a.getGraphic(u,{getAttribs:!0}).then(c=>{t.event.emit(e.params.config.actionEvent,{data:c.attributes,layer:a,uid:e.params.data.rvUid,oid:u})})};return Fa(()=>{e.params.eGridCell.addEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.addEventListener("focus",()=>{r.value._tippy.show()}),e.params.eGridCell.addEventListener("blur",()=>{r.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("keydown",o=>{o.key==="Enter"&&s()}),e.params.eGridCell.removeEventListener("focus",()=>{r.value._tippy.show()}),e.params.eGridCell.removeEventListener("blur",()=>{r.value._tippy.hide()})}),(o,a)=>{const l=Nn("tippy");return n.value?Ur((qt(),si("button",{key:0,type:"button",class:"flex items-center justify-center w-42 h-38",content:e.params.config.tooltip,onClick:s,tabindex:"-1",ref_key:"el",ref:r},[Ot("span",{innerHTML:e.params.config.icon},null,8,A3n)],8,I3n)),[[l,{placement:"top"}]]):Yr("",!0)}}}),O3n=["name","content","innerHTML"],P3n=["content"],MRe=Xr({__name:"cell-renderer",props:["params"],setup(i){const e=i,t=w0(),r=eo("iApi"),{t:n}=Qn(),s=vi(),o=vi(),a=vi(!1),l=Hr(()=>t.mobileView),u=()=>{o.value?.textContent&&(a.value=!0,s.value?._tippy.show(),navigator.clipboard.writeText(o.value?.textContent),setTimeout(()=>{a.value=!1},2e3))},c=Hr(()=>e.params.type==="number"?e.params.value==null?"":r.ui.formatNumber(e.params.value):e.params.type==="date"?e.params.value==null?"":new Date(e.params.value).toISOString().slice(0,10):e.params.type==="string"?!e.params.value||/]*>[^<]+<\/a>/g.test(e.params.value)?e.params.value:gTe(e.params.value,{target:"_blank",validate:{url:p=>/^https?:\/\//.test(p)}}):""),h=Hr(()=>/]*>[^<]+<\/a>/g.test(e.params.value)||/(http(s)?:\/\/.*)/g.test(e.params.value));return Fa(()=>{e.params.eGridCell.addEventListener("dblclick",()=>{u()}),e.params.eGridCell.addEventListener("keydown",p=>{p.ctrlKey&&p.code==="KeyC"&&u()}),e.params.eGridCell.addEventListener("blur",()=>{o.value._tippy.hide(),s.value?._tippy.hide()}),e.params.eGridCell.addEventListener("focus",()=>{o.value?._tippy.show(),setTimeout(()=>{document.activeElement===e.params.eGridCell&&s.value?._tippy.show()},1e3),o.value._tippy.reference.clientWidth>=o.value._tippy.reference.scrollWidth&&o.value._tippy.hide()})}),Ka(()=>{e.params.eGridCell.removeEventListener("dblclick",()=>{u()}),e.params.eGridCell.removeEventListener("keydown",p=>{p.ctrlKey&&p.code==="KeyC"&&u()}),e.params.eGridCell.removeEventListener("blur",()=>{o.value._tippy.hide(),s.value?._tippy.hide()}),e.params.eGridCell.removeEventListener("focus",()=>{o.value._tippy.show(),s.value?._tippy.show()})}),(p,m)=>{const v=Nn("truncate"),w=Nn("tippy");return qt(),si("div",null,[Ur(Ot("div",{name:c.value,content:c.value,tabindex:"-1",innerHTML:c.value,ref_key:"el",ref:o},null,8,O3n),[[v,{options:{placement:"top",hideOnClick:!1,theme:"ramp4",maxWidth:l.value?300:700,animation:"scale",interactive:h.value}}]]),o.value?.textContent?Ur((qt(),si("div",{key:0,ref_key:"copyTooltip",ref:s,content:ri(n)(`grid.label.${a.value?"copied":"copy"}`)},null,8,P3n)),[[w,{triggerTarget:o.value,placement:"bottom",theme:"ramp4",hideOnClick:!1,delay:[1e3,0]}]]):Yr("",!0)])}}});var R3n={selectAll:"(Select All)",selectAllSearchResults:"(Select All Search Results)",addCurrentSelectionToFilter:"Add current selection to filter",searchOoo:"Search...",blanks:"(Blanks)",noMatches:"No matches",filterOoo:"Filter...",equals:"Equals",notEqual:"Does not equal",blank:"Blank",notBlank:"Not blank",empty:"Choose one",lessThan:"Less than",greaterThan:"Greater than",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",dateFormatOoo:"yyyy-mm-dd",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",applyFilter:"Apply",resetFilter:"Reset",clearFilter:"Clear",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",groupFilterSelect:"Select field:",advancedFilterContains:"contains",advancedFilterNotContains:"does not contain",advancedFilterTextEquals:"equals",advancedFilterTextNotEqual:"does not equal",advancedFilterStartsWith:"begins with",advancedFilterEndsWith:"ends with",advancedFilterBlank:"is blank",advancedFilterNotBlank:"is not blank",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"is true",advancedFilterFalse:"is false",advancedFilterAnd:"AND",advancedFilterOr:"OR",advancedFilterApply:"Apply",advancedFilterBuilder:"Builder",advancedFilterValidationMissingColumn:"Column is missing",advancedFilterValidationMissingOption:"Option is missing",advancedFilterValidationMissingValue:"Value is missing",advancedFilterValidationInvalidColumn:"Column not found",advancedFilterValidationInvalidOption:"Option not found",advancedFilterValidationMissingQuote:"Value is missing an end quote",advancedFilterValidationNotANumber:"Value is not a number",advancedFilterValidationInvalidDate:"Value is not a valid date",advancedFilterValidationMissingCondition:"Condition is missing",advancedFilterValidationJoinOperatorMismatch:"Join operators within a condition must be the same",advancedFilterValidationInvalidJoinOperator:"Join operator not found",advancedFilterValidationMissingEndBracket:"Missing end bracket",advancedFilterValidationExtraEndBracket:"Too many end brackets",advancedFilterValidationMessage:"Expression has an error. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"Expression has an error. ${variable} at end of expression.",advancedFilterBuilderTitle:"Advanced Filter",advancedFilterBuilderApply:"Apply",advancedFilterBuilderCancel:"Cancel",advancedFilterBuilderAddButtonTooltip:"Add Filter or Group",advancedFilterBuilderRemoveButtonTooltip:"Remove",advancedFilterBuilderMoveUpButtonTooltip:"Move Up",advancedFilterBuilderMoveDownButtonTooltip:"Move Down",advancedFilterBuilderAddJoin:"Add Group",advancedFilterBuilderAddCondition:"Add Filter",advancedFilterBuilderSelectColumn:"Select a column",advancedFilterBuilderSelectOption:"Select an option",advancedFilterBuilderEnterValue:"Enter a value...",advancedFilterBuilderValidationAlreadyApplied:"Current filter already applied.",advancedFilterBuilderValidationIncomplete:"Not all conditions are complete.",advancedFilterBuilderValidationSelectColumn:"Must select a column.",advancedFilterBuilderValidationSelectOption:"Must select an option.",advancedFilterBuilderValidationEnterValue:"Must enter a value.",columns:"Columns",filters:"Filters",pivotMode:"Pivot Mode",groups:"Row Groups",rowGroupColumnsEmptyMessage:"Drag here to set row groups",values:"Values",valueColumnsEmptyMessage:"Drag here to aggregate",pivots:"Column Labels",pivotColumnsEmptyMessage:"Drag here to set column labels",group:"Group",rowDragRow:"row",rowDragRows:"rows",loadingOoo:"Loading...",loadingError:"ERR",noRowsToShow:"No Rows To Show",enabled:"Enabled",pinColumn:"Pin Column",pinLeft:"Pin Left",pinRight:"Pin Right",noPin:"No Pin",valueAggregation:"Value Aggregation",noAggregation:"None",autosizeThisColumn:"Autosize This Column",autosizeAllColumns:"Autosize All Columns",groupBy:"Group by",ungroupBy:"Un-Group by",ungroupAll:"Un-Group All",addToValues:"Add ${variable} to values",removeFromValues:"Remove ${variable} from values",addToLabels:"Add ${variable} to labels",removeFromLabels:"Remove ${variable} from labels",resetColumns:"Reset Columns",expandAll:"Expand All Row Groups",collapseAll:"Close All Row Groups",copy:"Copy",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copy With Headers",copyWithGroupHeaders:"Copy with Group Headers",cut:"Cut",paste:"Paste",ctrlV:"Ctrl+V",export:"Export",csvExport:"CSV Export",excelExport:"Excel Export",columnFilter:"Column Filter",columnChooser:"Choose Columns",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",sortUnSort:"Clear Sort",sum:"Sum",first:"First",last:"Last",min:"Min",max:"Max",none:"None",count:"Count",avg:"Average",filteredRows:"Filtered",selectedRows:"Selected",totalRows:"Total Rows",totalAndFilteredRows:"Rows",more:"More",to:"to",of:"of",page:"Page",pageLastRowUnknown:"?",nextPage:"Next Page",lastPage:"Last Page",firstPage:"First Page",previousPage:"Previous Page",pageSizeSelectorLabel:"Page Size:",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Pivot Chart & Pivot Mode",pivotChart:"Pivot Chart",chartRange:"Chart Range",columnChart:"Column",groupedColumn:"Grouped",stackedColumn:"Stacked",normalizedColumn:"100% Stacked",barChart:"Bar",groupedBar:"Grouped",stackedBar:"Stacked",normalizedBar:"100% Stacked",pieChart:"Pie",pie:"Pie",donut:"Donut",line:"Line",xyChart:"X Y (Scatter)",scatter:"Scatter",bubble:"Bubble",areaChart:"Area",area:"Area",stackedArea:"Stacked",normalizedArea:"100% Stacked",histogramChart:"Histogram",polarChart:"Polar",radarLine:"Radar Line",radarArea:"Radar Area",nightingale:"Nightingale",radialColumn:"Radial Column",radialBar:"Radial Bar",statisticalChart:"Statistical",boxPlot:"Box Plot",rangeBar:"Range Bar",rangeArea:"Range Area",hierarchicalChart:"Hierarchical",treemap:"Treemap",sunburst:"Sunburst",specializedChart:"Specialized",waterfall:"Waterfall",heatmap:"Heatmap",combinationChart:"Combination",columnLineCombo:"Column & Line",AreaColumnCombo:"Area & Column",pivotChartTitle:"Pivot Chart",rangeChartTitle:"Range Chart",settings:"Chart",data:"Set Up",format:"Customize",categories:"Categories",defaultCategory:"(None)",series:"Series",switchCategorySeries:"Switch Category / Series",categoryValues:"Category Values",seriesLabels:"Series Labels",aggregate:"Aggregate",xyValues:"X Y Values",paired:"Paired Mode",axis:"Axis",xAxis:"Horizontal Axis",yAxis:"Vertical Axis",polarAxis:"Polar Axis",radiusAxis:"Radius Axis",navigator:"Navigator",zoom:"Zoom",animation:"Animation",crosshair:"Crosshair",color:"Color",thickness:"Thickness",preferredLength:"Preferred Length",xType:"X Type",axisType:"Axis Type",automatic:"Automatic",category:"Category",number:"Number",time:"Time",timeFormat:"Time Format",autoRotate:"Auto Rotate",labelRotation:"Rotation",circle:"Circle",polygon:"Polygon",square:"Square",cross:"Cross",diamond:"Diamond",plus:"Plus",triangle:"Triangle",heart:"Heart",orientation:"Orientation",fixed:"Fixed",parallel:"Parallel",perpendicular:"Perpendicular",radiusAxisPosition:"Position",ticks:"Ticks",gridLines:"Grid Lines",width:"Width",height:"Height",length:"Length",padding:"Padding",spacing:"Spacing",chartStyle:"Chart Style",title:"Title",chartTitles:"Titles",chartTitle:"Chart Title",chartSubtitle:"Subtitle",horizontalAxisTitle:"Horizontal Axis Title",verticalAxisTitle:"Vertical Axis Title",polarAxisTitle:"Polar Axis Title",titlePlaceholder:"Chart Title",background:"Background",font:"Font",weight:"Weight",top:"Top",right:"Right",bottom:"Bottom",left:"Left",labels:"Labels",calloutLabels:"Callout Labels",sectorLabels:"Sector Labels",positionRatio:"Position Ratio",size:"Size",shape:"Shape",minSize:"Minimum Size",maxSize:"Maximum Size",legend:"Legend",position:"Position",markerSize:"Marker Size",markerStroke:"Marker Stroke",markerPadding:"Marker Padding",itemSpacing:"Item Spacing",itemPaddingX:"Item Padding X",itemPaddingY:"Item Padding Y",layoutHorizontalSpacing:"Horizontal Spacing",layoutVerticalSpacing:"Vertical Spacing",strokeWidth:"Stroke Width",offset:"Offset",offsets:"Offsets",tooltips:"Tooltips",callout:"Callout",markers:"Markers",shadow:"Shadow",blur:"Blur",xOffset:"X Offset",yOffset:"Y Offset",lineWidth:"Line Width",lineDash:"Line Dash",lineDashOffset:"Dash Offset",scrollingZoom:"Scrolling",scrollingStep:"Scrolling Step",selectingZoom:"Selecting",durationMillis:"Duration (ms)",crosshairLabel:"Label",crosshairSnap:"Snap to Node",normal:"Normal",bold:"Bold",italic:"Italic",boldItalic:"Bold Italic",predefined:"Predefined",fillOpacity:"Fill Opacity",strokeColor:"Line Color",strokeOpacity:"Line Opacity",miniChart:"Mini-Chart",histogramBinCount:"Bin count",connectorLine:"Connector Line",seriesItems:"Series Items",seriesItemType:"Item Type",seriesItemPositive:"Positive",seriesItemNegative:"Negative",seriesItemLabels:"Item Labels",columnGroup:"Column",barGroup:"Bar",pieGroup:"Pie",lineGroup:"Line",scatterGroup:"X Y (Scatter)",areaGroup:"Area",polarGroup:"Polar",statisticalGroup:"Statistical",hierarchicalGroup:"Hierarchical",specializedGroup:"Specialized",combinationGroup:"Combination",groupedColumnTooltip:"Grouped",stackedColumnTooltip:"Stacked",normalizedColumnTooltip:"100% Stacked",groupedBarTooltip:"Grouped",stackedBarTooltip:"Stacked",normalizedBarTooltip:"100% Stacked",pieTooltip:"Pie",donutTooltip:"Donut",lineTooltip:"Line",groupedAreaTooltip:"Area",stackedAreaTooltip:"Stacked",normalizedAreaTooltip:"100% Stacked",scatterTooltip:"Scatter",bubbleTooltip:"Bubble",histogramTooltip:"Histogram",radialColumnTooltip:"Radial Column",radialBarTooltip:"Radial Bar",radarLineTooltip:"Radar Line",radarAreaTooltip:"Radar Area",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Range Bar",rangeAreaTooltip:"Range Area",boxPlotTooltip:"Box Plot",treemapTooltip:"Treemap",sunburstTooltip:"Sunburst",waterfallTooltip:"Waterfall",heatmapTooltip:"Heatmap",columnLineComboTooltip:"Column & Line",areaColumnComboTooltip:"Area & Column",customComboTooltip:"Custom Combination",innerRadius:"Inner Radius",startAngle:"Start Angle",endAngle:"End Angle",reverseDirection:"Reverse Direction",groupPadding:"Group Padding",seriesPadding:"Series Padding",tile:"Tile",whisker:"Whisker",cap:"Cap",capLengthRatio:"Length Ratio",labelPlacement:"Placement",inside:"Inside",outside:"Outside",noDataToChart:"No data available to be charted.",pivotChartRequiresPivotMode:"Pivot Chart requires Pivot Mode enabled.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Linked to Grid",chartUnlinkToolbarTooltip:"Unlinked from Grid",chartDownloadToolbarTooltip:"Download Chart",chartMenuToolbarTooltip:"Menu",chartEdit:"Edit Chart",chartAdvancedSettings:"Advanced Settings",chartLink:"Link to Grid",chartUnlink:"Unlink from Grid",chartDownload:"Download Chart",histogramFrequency:"Frequency",seriesChartType:"Series Chart Type",seriesType:"Series Type",secondaryAxis:"Secondary Axis",seriesAdd:"Add a series",categoryAdd:"Add a category",bar:"Bar",column:"Column",histogram:"Histogram",advancedSettings:"Advanced Settings",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Group Type",groupedSeriesGroupType:"Grouped",stackedSeriesGroupType:"Stacked",normalizedSeriesGroupType:"100% Stacked",legendEnabled:"Enabled",invalidColor:"Color value is invalid",groupedColumnFull:"Grouped Column",stackedColumnFull:"Stacked Column",normalizedColumnFull:"100% Stacked Column",groupedBarFull:"Grouped Bar",stackedBarFull:"Stacked Bar",normalizedBarFull:"100% Stacked Bar",stackedAreaFull:"Stacked Area",normalizedAreaFull:"100% Stacked Area",customCombo:"Custom Combination",ariaAdvancedFilterBuilderItem:"${variable}. Level ${variable}. Press ENTER to edit",ariaAdvancedFilterBuilderItemValidation:"${variable}. Level ${variable}. ${variable} Press ENTER to edit",ariaAdvancedFilterBuilderList:"Advanced Filter Builder List",ariaAdvancedFilterBuilderFilterItem:"Filter Condition",ariaAdvancedFilterBuilderGroupItem:"Filter Group",ariaAdvancedFilterBuilderColumn:"Column",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Value",ariaAdvancedFilterBuilderJoinOperator:"Join Operator",ariaAdvancedFilterInput:"Advanced Filter Input",ariaChecked:"checked",ariaColumn:"Column",ariaColumnGroup:"Column Group",ariaColumnFiltered:"Column Filtered",ariaColumnSelectAll:"Toggle Select All Columns",ariaDateFilterInput:"Date Filter Input",ariaDefaultListName:"List",ariaFilterColumnsInput:"Filter Columns Input",ariaFilterFromValue:"Filter from value",ariaFilterInput:"Filter Input",ariaFilterList:"Filter List",ariaFilterToValue:"Filter to value",ariaFilterValue:"Filter Value",ariaFilterMenuOpen:"Open Filter Menu",ariaFilteringOperator:"Filtering Operator",ariaHidden:"hidden",ariaIndeterminate:"indeterminate",ariaInputEditor:"Input Editor",ariaMenuColumn:"Press ALT DOWN to open column menu",ariaFilterColumn:"Press CTRL ENTER to open filter",ariaRowDeselect:"Press SPACE to deselect this row",ariaRowSelectAll:"Press Space to toggle all rows selection",ariaRowToggleSelection:"Press Space to toggle row selection",ariaRowSelect:"Press SPACE to select this row",ariaRowSelectionDisabled:"Row Selection is disabled for this row",ariaSearch:"Search",ariaSortableColumn:"Press ENTER to sort",ariaToggleVisibility:"Press SPACE to toggle visibility",ariaToggleCellValue:"Press SPACE to toggle cell value",ariaUnchecked:"unchecked",ariaVisible:"visible",ariaSearchFilterValues:"Search filter values",ariaPageSizeSelectorLabel:"Page Size",ariaChartMenuClose:"Close Chart Edit Menu",ariaChartSelected:"Selected",ariaSkeletonCellLoadingFailed:"Row failed to load",ariaSkeletonCellLoading:"Row data is loading",ariaRowGroupDropZonePanelLabel:"Row Groups",ariaValuesDropZonePanelLabel:"Values",ariaPivotDropZonePanelLabel:"Column Labels",ariaDropZoneColumnComponentDescription:"Press DELETE to remove",ariaDropZoneColumnValueItemDescription:"Press ENTER to change the aggregation type",ariaDropZoneColumnGroupItemDescription:"Press ENTER to sort",ariaDropZoneColumnComponentAggFuncSeparator:" of ",ariaDropZoneColumnComponentSortAscending:"ascending",ariaDropZoneColumnComponentSortDescending:"descending",ariaLabelDialog:"Dialog",ariaLabelColumnMenu:"Column Menu",ariaLabelColumnFilter:"Column Filter",ariaLabelCellEditor:"Cell Editor",ariaLabelSelectField:"Select Field",ariaLabelRichSelectField:"Rich Select Field",ariaLabelRichSelectToggleSelection:"Press SPACE to toggle selection",ariaLabelRichSelectDeselectAllItems:"Press DELETE to deselect all items",ariaLabelRichSelectDeleteSelection:"Press DELETE to deselect item",ariaLabelTooltip:"Tooltip",ariaLabelContextMenu:"Context Menu",ariaLabelSubMenu:"SubMenu",ariaLabelAggregationFunction:"Aggregation Function",ariaLabelAdvancedFilterAutocomplete:"Advanced Filter Autocomplete",ariaLabelAdvancedFilterBuilderAddField:"Advanced Filter Builder Add Field",ariaLabelAdvancedFilterBuilderColumnSelectField:"Advanced Filter Builder Column Select Field",ariaLabelAdvancedFilterBuilderOptionSelectField:"Advanced Filter Builder Option Select Field",ariaLabelAdvancedFilterBuilderJoinSelectField:"Advanced Filter Builder Join Operator Select Field",ariaColumnPanelList:"Column List",ariaFilterPanelList:"Filter List",thousandSeparator:",",decimalSeparator:".",true:"True",false:"False",invalidDate:"Invalid Date",invalidNumber:"Invalid Number",january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"},D3n={selectAll:"(Sélectionner tout)",selectAllSearchResults:"(Sélectionner tous les résultats de recherche)",addCurrentSelectionToFilter:"Ajouter la sélection actuelle au filtre",searchOoo:"Chercher...",blanks:"(Vides)",noMatches:"Aucune correspondance",filterOoo:"Filtrer...",equals:"Égal à",notEqual:"N'est pas égal à",blank:"Vide",notBlank:"Non vide",empty:"Choisissez-en un",lessThan:"Moins de",greaterThan:"Plus de",lessThanOrEqual:"Moins de ou égal à",greaterThanOrEqual:"Plus de ou égal à",inRange:"Entre",inRangeStart:"De",inRangeEnd:"À",contains:"Contient",notContains:"Ne contient pas",startsWith:"Commence par",endsWith:"Se termine par",dateFormatOoo:"yyyy-mm-dd",before:"Avant",after:"Après",andCondition:"ET",orCondition:"OU",applyFilter:"Appliquer",resetFilter:"Réinitialiser",clearFilter:"Effacer",cancelFilter:"Annuler",textFilter:"Filtre de texte",numberFilter:"Filtre numérique",dateFilter:"Filtre de date",setFilter:"Filtre de jeu",groupFilterSelect:"Sélectionner le champ :",advancedFilterContains:"contient",advancedFilterNotContains:"ne contient pas",advancedFilterTextEquals:"égal",advancedFilterTextNotEqual:"n'est pas égal",advancedFilterStartsWith:"commence par",advancedFilterEndsWith:"se termine par",advancedFilterBlank:"est vide",advancedFilterNotBlank:"n'est pas vide",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"est vrai",advancedFilterFalse:"est faux",advancedFilterAnd:"ET",advancedFilterOr:"OU",advancedFilterApply:"Appliquer",advancedFilterBuilder:"Constructeur",advancedFilterValidationMissingColumn:"La colonne est manquante",advancedFilterValidationMissingOption:"L'option est manquante",advancedFilterValidationMissingValue:"La valeur est manquante",advancedFilterValidationInvalidColumn:"Colonne non trouvée",advancedFilterValidationInvalidOption:"Option non trouvée",advancedFilterValidationMissingQuote:"Il manque une guillemet de fin à la valeur",advancedFilterValidationNotANumber:"La valeur n'est pas un nombre",advancedFilterValidationInvalidDate:"La valeur n'est pas une date valide",advancedFilterValidationMissingCondition:"La condition est manquante",advancedFilterValidationJoinOperatorMismatch:"Les opérateurs de jonction au sein d'une condition doivent être identiques",advancedFilterValidationInvalidJoinOperator:"Opérateur de jonction non trouvé",advancedFilterValidationMissingEndBracket:"Guillemet de fin manquante",advancedFilterValidationExtraEndBracket:"Trop de crochets de fin",advancedFilterValidationMessage:"L'expression contient une erreur. ${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"L'expression contient une erreur. ${variable} à la fin de l'expression.",advancedFilterBuilderTitle:"Filtre Avancé",advancedFilterBuilderApply:"Appliquer",advancedFilterBuilderCancel:"Annuler",advancedFilterBuilderAddButtonTooltip:"Ajouter un filtre ou un groupe",advancedFilterBuilderRemoveButtonTooltip:"Supprimer",advancedFilterBuilderMoveUpButtonTooltip:"Monter",advancedFilterBuilderMoveDownButtonTooltip:"Descendre",advancedFilterBuilderAddJoin:"Ajouter un groupe",advancedFilterBuilderAddCondition:"Ajouter un filtre",advancedFilterBuilderSelectColumn:"Sélectionner une colonne",advancedFilterBuilderSelectOption:"Sélectionner une option",advancedFilterBuilderEnterValue:"Entrer une valeur...",advancedFilterBuilderValidationAlreadyApplied:"Le filtre actuel est déjà appliqué.",advancedFilterBuilderValidationIncomplete:"Toutes les conditions ne sont pas remplies.",advancedFilterBuilderValidationSelectColumn:"Vous devez sélectionner une colonne.",advancedFilterBuilderValidationSelectOption:"Vous devez sélectionner une option.",advancedFilterBuilderValidationEnterValue:"Vous devez entrer une valeur.",columns:"Colonnes",filters:"Filtres",pivotMode:"Mode pivot",groups:"Groupes de lignes",rowGroupColumnsEmptyMessage:"Faites glisser ici pour définir les groupes de lignes",values:"Valeurs",valueColumnsEmptyMessage:"Faites glisser ici pour agréger",pivots:"Étiquettes de colonnes",pivotColumnsEmptyMessage:"Faites glisser ici pour définir les étiquettes de colonnes",group:"Groupe",rowDragRow:"rang",rowDragRows:"rangs",loadingOoo:"Chargement...",loadingError:"ERR",noRowsToShow:"Aucune ligne à afficher",enabled:"Activé",pinColumn:"Épingler la colonne",pinLeft:"Épingler à gauche",pinRight:"Épingler à droite",noPin:"Pas d'épingle",valueAggregation:"Agrégation de valeur",noAggregation:"Aucun",autosizeThisColumn:"Ajuster automatiquement cette colonne",autosizeAllColumns:"Ajuster automatiquement toutes les colonnes",groupBy:"Grouper par",ungroupBy:"Dégrouper par",ungroupAll:"Dégrouper tout",addToValues:"Ajouter ${variable} aux valeurs",removeFromValues:"Retirer ${variable} des valeurs",addToLabels:"Ajouter ${variable} aux étiquettes",removeFromLabels:"Retirer ${variable} des étiquettes",resetColumns:"Réinitialiser les colonnes",expandAll:"Développer tous les groupes de lignes",collapseAll:"Fermer tous les groupes de lignes",copy:"Copier",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"Copier avec en-têtes",copyWithGroupHeaders:"Copier avec en-têtes de groupe",cut:"Couper",paste:"Coller",ctrlV:"Ctrl+V",export:"Exporter",csvExport:"Export CSV",excelExport:"Export Excel",columnFilter:"Filtre de colonne",columnChooser:"Choisir les colonnes",sortAscending:"Trier par ordre croissant",sortDescending:"Trier par ordre décroissant",sortUnSort:"Effacer le tri",sum:"Somme",first:"Premier",last:"Dernier",min:"Min",max:"Max",none:"Aucun",count:"Nombre",avg:"Moyenne",filteredRows:"Filtré",selectedRows:"Sélectionné",totalRows:"Total des Lignes",totalAndFilteredRows:"Lignes",more:"Plus",to:"à",of:"de",page:"Page",pageLastRowUnknown:"?",nextPage:"Page Suivante",lastPage:"Dernière Page",firstPage:"Première Page",previousPage:"Page Précédente",pageSizeSelectorLabel:"Taille de la Page :",footerTotal:"Total",pivotColumnGroupTotals:"Total",pivotChartAndPivotMode:"Graphique pivot et mode pivot",pivotChart:"Graphique pivot",chartRange:"Plage de graphique",columnChart:"Colonne",groupedColumn:"Groupé",stackedColumn:"Empilé",normalizedColumn:"100% empilé",barChart:"Barre",groupedBar:"Groupé",stackedBar:"Empilé",normalizedBar:"100% empilé",pieChart:"Camembert",pie:"Camembert",donut:"Donut",line:"Ligne",xyChart:"X Y (Nuage de points)",scatter:"Nuage de points",bubble:"Bulle",areaChart:"Aire",area:"Aire",stackedArea:"Empilé",normalizedArea:"100% empilé",histogramChart:"Histogramme",polarChart:"Polaire",radarLine:"Ligne radar",radarArea:"Aire radar",nightingale:"Nightingale",radialColumn:"Colonne radiale",radialBar:"Barre radiale",statisticalChart:"Statistique",boxPlot:"Boîte à moustaches",rangeBar:"Barre de plage",rangeArea:"Aire de plage",hierarchicalChart:"Hiérarchique",treemap:"Arborescence",sunburst:"Rayonnement",specializedChart:"Spécialisé",waterfall:"Cascade",heatmap:"Carte thermique",combinationChart:"Combinaison",columnLineCombo:"Colonne et ligne",AreaColumnCombo:"Aire et colonne",pivotChartTitle:"Graphique croisé dynamique",rangeChartTitle:"Graphique en plage",settings:"Graphique",data:"Configurer",format:"Personnaliser",categories:"Catégories",defaultCategory:"(Aucun)",series:"Séries",switchCategorySeries:"Changer Catégorie / Séries",categoryValues:"Valeurs de catégorie",seriesLabels:"Étiquettes de séries",aggregate:"Agrégat",xyValues:"Valeurs X Y",paired:"Mode apparié",axis:"Axe",xAxis:"Axe horizontal",yAxis:"Axe vertical",polarAxis:"Axe polaire",radiusAxis:"Axe de rayon",navigator:"Navigateur",zoom:"Zoom",animation:"Animation",crosshair:"Réticule",color:"Couleur",thickness:"Épaisseur",preferredLength:"Longueur préférée",xType:"Type X",axisType:"Type d'axe",automatic:"Automatique",category:"Catégorie",number:"Nombre",time:"Temps",timeFormat:"Format de temps",autoRotate:"Rotation auto",labelRotation:"Rotation",circle:"Cercle",polygon:"Polygone",square:"Carré",cross:"Croix",diamond:"Diamant",plus:"Plus",triangle:"Triangle",heart:"Cœur",orientation:"Orientation",fixed:"Fixé",parallel:"Parallèle",perpendicular:"Perpendiculaire",radiusAxisPosition:"Position",ticks:"Graduations",gridLines:"Lignes de grille",width:"Largeur",height:"Hauteur",length:"Longueur",padding:"Rembourrage",spacing:"Espacement",chartStyle:"Style de graphique",title:"Titre",chartTitles:"Titres",chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre",horizontalAxisTitle:"Titre de l'axe horizontal",verticalAxisTitle:"Titre de l'axe vertical",polarAxisTitle:"Titre de l'axe polaire",titlePlaceholder:"Titre du graphique",background:"Arrière-plan",font:"Police",weight:"Poids",top:"Haut",right:"Droite",bottom:"Bas",left:"Gauche",labels:"Étiquettes",calloutLabels:"Étiquettes d'appel",sectorLabels:"Étiquettes de secteur",positionRatio:"Ratio de position",size:"Taille",shape:"Forme",minSize:"Taille minimum",maxSize:"Taille maximum",legend:"Légende",position:"Position",markerSize:"Taille du marqueur",markerStroke:"Contour du marqueur",markerPadding:"Rembourrage du marqueur",itemSpacing:"Espacement des éléments",itemPaddingX:"Rembourrage d'élément X",itemPaddingY:"Rembourrage d'élément Y",layoutHorizontalSpacing:"Espacement horizontal",layoutVerticalSpacing:"Espacement vertical",strokeWidth:"Épaisseur du trait",offset:"Décalage",offsets:"Décalages",tooltips:"Info-bulles",callout:"Appel",markers:"Marqueurs",shadow:"Ombre",blur:"Flou",xOffset:"Décalage X",yOffset:"Décalage Y",lineWidth:"Épaisseur de la ligne",lineDash:"Tirets de la ligne",lineDashOffset:"Décalage des tirets",scrollingZoom:"Défilement",scrollingStep:"Étape de défilement",selectingZoom:"Sélection",durationMillis:"Durée (ms)",crosshairLabel:"Étiquette",crosshairSnap:"Accrocher au nœud",normal:"Normal",bold:"Gras",italic:"Italique",boldItalic:"Gras Italique",predefined:"Prédéfini",fillOpacity:"Opacité de remplissage",strokeColor:"Couleur du trait",strokeOpacity:"Opacité du trait",miniChart:"Mini-Graphique",histogramBinCount:"Nombre de bins",connectorLine:"Ligne de connexion",seriesItems:"Éléments de série",seriesItemType:"Type d'élément",seriesItemPositive:"Positif",seriesItemNegative:"Négatif",seriesItemLabels:"Étiquettes d'éléments",columnGroup:"Colonne",barGroup:"Barre",pieGroup:"Camembert",lineGroup:"Ligne",scatterGroup:"X Y (Nuage de points)",areaGroup:"Zone",polarGroup:"Polaire",statisticalGroup:"Statistique",hierarchicalGroup:"Hiérarchique",specializedGroup:"Spécialisé",combinationGroup:"Combinaison",groupedColumnTooltip:"Groupe",stackedColumnTooltip:"Empilé",normalizedColumnTooltip:"100% Empilé",groupedBarTooltip:"Groupe",stackedBarTooltip:"Empilé",normalizedBarTooltip:"100% Empilé",pieTooltip:"Camembert",donutTooltip:"Donut",lineTooltip:"Ligne",groupedAreaTooltip:"Zone",stackedAreaTooltip:"Empilé",normalizedAreaTooltip:"100% Empilé",scatterTooltip:"Nuage de points",bubbleTooltip:"Bulle",histogramTooltip:"Histogramme",radialColumnTooltip:"Colonne radiale",radialBarTooltip:"Barre radiale",radarLineTooltip:"Ligne radar",radarAreaTooltip:"Zone radar",nightingaleTooltip:"Nightingale",rangeBarTooltip:"Barre de plage",rangeAreaTooltip:"Zone de plage",boxPlotTooltip:"Boîte à moustaches",treemapTooltip:"Treemap",sunburstTooltip:"Rayon de soleil",waterfallTooltip:"Chute d'eau",heatmapTooltip:"Carte thermique",columnLineComboTooltip:"Colonne & Ligne",areaColumnComboTooltip:"Zone & Colonne",customComboTooltip:"Combinaison Personnalisée",innerRadius:"Rayon intérieur",startAngle:"Angle de départ",endAngle:"Angle de fin",reverseDirection:"Inverser la direction",groupPadding:"Rembourrage de groupe",seriesPadding:"Rembourrage de séries",tile:"Tuile",whisker:"Moustache",cap:"Capuchon",capLengthRatio:"Ratio de longueur",labelPlacement:"Placement",inside:"À l'intérieur",outside:"À l'extérieur",noDataToChart:"Aucune donnée disponible à afficher.",pivotChartRequiresPivotMode:"Le graphique croisé dynamique nécessite le mode croisé activé.",chartSettingsToolbarTooltip:"Menu",chartLinkToolbarTooltip:"Lié à la grille",chartUnlinkToolbarTooltip:"Détaché de la grille",chartDownloadToolbarTooltip:"Télécharger le graphique",chartMenuToolbarTooltip:"Menu",chartEdit:"Modifier le graphique",chartAdvancedSettings:"Paramètres avancés",chartLink:"Lier à la grille",chartUnlink:"Détacher de la grille",chartDownload:"Télécharger le graphique",histogramFrequency:"Fréquence",seriesChartType:"Type de graphique de séries",seriesType:"Type de série",secondaryAxis:"Axe secondaire",seriesAdd:"Ajouter une série",categoryAdd:"Ajouter une catégorie",bar:"Barre",column:"Colonne",histogram:"Histogramme",advancedSettings:"Paramètres avancés",direction:"Direction",horizontal:"Horizontal",vertical:"Vertical",seriesGroupType:"Type de groupe",groupedSeriesGroupType:"Groupé",stackedSeriesGroupType:"Empilé",normalizedSeriesGroupType:"100% Empilé",legendEnabled:"Activé",invalidColor:"La valeur de couleur est invalide",groupedColumnFull:"Colonne groupée",stackedColumnFull:"Colonne empilée",normalizedColumnFull:"Colonne 100% empilée",groupedBarFull:"Barre groupée",stackedBarFull:"Barre empilée",normalizedBarFull:"Barre 100% empilée",stackedAreaFull:"Zone empilée",normalizedAreaFull:"Zone 100% empilée",customCombo:"Combinaison personnalisée",ariaAdvancedFilterBuilderItem:"${variable}. Niveau ${variable}. Appuyez sur ENTER pour éditer.",ariaAdvancedFilterBuilderItemValidation:"${variable}. Niveau ${variable}. ${variable} Appuyez sur ENTER pour éditer.",ariaAdvancedFilterBuilderList:"Liste de cadre de filtre avancé",ariaAdvancedFilterBuilderFilterItem:"Condition de filtre",ariaAdvancedFilterBuilderGroupItem:"Groupe de filtre",ariaAdvancedFilterBuilderColumn:"Colonne",ariaAdvancedFilterBuilderOption:"Option",ariaAdvancedFilterBuilderValueP:"Valeur",ariaAdvancedFilterBuilderJoinOperator:"Opérateur de jonction",ariaAdvancedFilterInput:"Entrée de filtre avancé",ariaChecked:"coché",ariaColumn:"Colonne",ariaColumnGroup:"Groupe de colonnes",ariaColumnFiltered:"Colonne filtrée",ariaColumnSelectAll:"Basculer la sélection de toutes les colonnes",ariaDateFilterInput:"Entrée de filtre de date",ariaDefaultListName:"Liste",ariaFilterColumnsInput:"Entrée de filtre de colonnes",ariaFilterFromValue:"Filtrer depuis la valeur",ariaFilterInput:"Entrée de filtre",ariaFilterList:"Liste de filtres",ariaFilterToValue:"Filtrer jusqu'à la valeur",ariaFilterValue:"Valeur du filtre",ariaFilterMenuOpen:"Ouvrir le menu de filtre",ariaFilteringOperator:"Opérateur de filtrage",ariaHidden:"caché",ariaIndeterminate:"indéterminé",ariaInputEditor:"Éditeur d'entrée",ariaMenuColumn:"Appuyez sur ALT BAS pour ouvrir le menu de colonne",ariaFilterColumn:"Appuyez sur CTRL ENTER pour ouvrir le filtre",ariaRowDeselect:"Appuyez sur ESPACE pour désélectionner cette ligne",ariaRowSelectAll:"Appuyez sur ESPACE pour basculer la sélection de toutes les lignes",ariaRowToggleSelection:"Appuyez sur ESPACE pour basculer la sélection de la ligne",ariaRowSelect:"Appuyez sur ESPACE pour sélectionner cette ligne",ariaRowSelectionDisabled:"La sélection de lignes est désactivée pour cette ligne",ariaSearch:"Rechercher",ariaSortableColumn:"Appuyez sur ENTER pour trier",ariaToggleVisibility:"Appuyez sur ESPACE pour basculer la visibilité",ariaToggleCellValue:"Appuyez sur ESPACE pour basculer la valeur de la cellule",ariaUnchecked:"non coché",ariaVisible:"visible",ariaSearchFilterValues:"Rechercher les valeurs de filtre",ariaPageSizeSelectorLabel:"Taille de page",ariaChartMenuClose:"Fermer le menu d'édition de graphique",ariaChartSelected:"Sélectionné",ariaSkeletonCellLoadingFailed:"Le chargement de la ligne a échoué",ariaSkeletonCellLoading:"Les données de la ligne sont en cours de chargement",ariaRowGroupDropZonePanelLabel:"Groupes de lignes",ariaValuesDropZonePanelLabel:"Valeurs",ariaPivotDropZonePanelLabel:"Étiquettes de colonnes",ariaDropZoneColumnComponentDescription:"Appuyez sur SUPPRIMER pour enlever",ariaDropZoneColumnValueItemDescription:"Appuyez sur ENTRÉE pour changer le type d'agrégation",ariaDropZoneColumnGroupItemDescription:"Appuyez sur ENTRÉE pour trier",ariaDropZoneColumnComponentAggFuncSeparator:" de ",ariaDropZoneColumnComponentSortAscending:"ascendant",ariaDropZoneColumnComponentSortDescending:"descendant",ariaLabelDialog:"Dialogue",ariaLabelColumnMenu:"Menu de colonne",ariaLabelColumnFilter:"Filtre de colonne",ariaLabelCellEditor:"Éditeur de cellule",ariaLabelSelectField:"Champ de sélection",ariaLabelRichSelectField:"Champ de sélection enrichie",ariaLabelRichSelectToggleSelection:"Appuyez sur ESPACE pour basculer la sélection",ariaLabelRichSelectDeselectAllItems:"Appuyez sur SUPPRIMER pour désélectionner tous les éléments",ariaLabelRichSelectDeleteSelection:"Appuyez sur SUPPRIMER pour désélectionner l'élément",ariaLabelTooltip:"Info-bulle",ariaLabelContextMenu:"Menu contextuel",ariaLabelSubMenu:"Sous-menu",ariaLabelAggregationFunction:"Fonction d'agrégation",ariaLabelAdvancedFilterAutocomplete:"Filtre avancé auto-complétion",ariaLabelAdvancedFilterBuilderAddField:"Filtre avancé constructeur Ajouter un champ",ariaLabelAdvancedFilterBuilderColumnSelectField:"Filtre avancé constructeur Sélectionnez le champ de colonne",ariaLabelAdvancedFilterBuilderOptionSelectField:"Filtre avancé constructeur Sélectionnez le champ d'option",ariaLabelAdvancedFilterBuilderJoinSelectField:"Filtre avancé constructeur Sélectionnez le champ de l'opérateur de jointure",ariaColumnPanelList:"Liste des colonnes",ariaFilterPanelList:"Liste des filtres",thousandSeparator:",",decimalSeparator:".",true:"Vrai",false:"Faux",invalidDate:"Date invalide",invalidNumber:"Nombre invalide",january:"Janvier",february:"Février",march:"Mars",april:"Avril",may:"Mai",june:"Juin",july:"Juillet",august:"Août",september:"Septembre",october:"Octobre",november:"Novembre",december:"Décembre",timeFormatSlashesDDMMYYYY:"JJ/MM/AAAA",timeFormatSlashesMMDDYYYY:"MM/JJ/AAAA",timeFormatSlashesDDMMYY:"JJ/MM/AA",timeFormatSlashesMMDDYY:"MM/JJ/AA",timeFormatDotsDDMYY:"JJ.M.AA",timeFormatDotsMDDYY:"M.JJ.AA",timeFormatDashesYYYYMMDD:"AAAA-MM-JJ",timeFormatSpacesDDMMMMYYYY:"JJ MMMM AAAA",timeFormatHHMMSS:"HH:MM:SS",timeFormatHHMMSSAmPm:"HH:MM:SS AM/PM"};const b_=i=>(Dc("data-v-aec3f27c"),i=i(),Fc(),i),F3n={class:"pl-8"},k3n={class:"flex flex-col justify-center items-center h-full"},L3n={class:"flex flex-row"},N3n={class:"font-bold text-2xl"},$3n=b_(()=>Ot("svg",{class:"stroke-black stroke-1",height:"50",width:"25"},[Ot("line",{x1:"0",y1:"50",x2:"25",y2:"0"})],-1)),B3n={class:"mt-20 text-xl"},j3n={class:"my-20"},G3n={class:"text-sm"},U3n=["aria-label"],z3n={class:"flex flex-wrap gap-y-8 items-center pl-8 pb-8"},V3n={class:"flex flex-1 flex-col max-w-full mr-8"},H3n={class:"w-full font-bold"},W3n={class:"w-full text-sm"},q3n={key:0},Y3n={class:"flex flex-1 grow-[1.4] items-center max-w-full"},X3n={class:"flex flex-1 min-w-0 items-center pb-4 mr-8"},J3n=["aria-label","placeholder"],K3n={class:"-ml-30"},Z3n={key:0,xmlns:"http://www.w3.org/2000/svg",fit:"",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false",class:"fill-current w-24 h-24 flex-shrink-0"},Q3n=b_(()=>Ot("g",{id:"search_cache224"},[Ot("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})],-1)),eMn=[Q3n],tMn=b_(()=>Ot("svg",{"data-v-486a0302":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512",class:"w-18 h-18 mt-2"},[Ot("path",{"data-v-486a0302":"",d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)),iMn=[tMn],rMn={class:"pb-2 flex ml-auto justify-end"},nMn=["content","aria-label"],sMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",width:"24px",viewBox:"0 0 24 24",class:"inline fill-current"},[Ot("g",{id:"filter_cache958"},[Ot("path",{d:"M 14.7574,20.8284L 17.6036,17.9822L 14.7574,15.1716L 16.1716,13.7574L 19.0178,16.568L 21.8284,13.7574L 23.2426,15.1716L 20.432,17.9822L 23.2426,20.8284L 21.8284,22.2426L 19.0178,19.3964L 16.1716,22.2426L 14.7574,20.8284 Z M 2,2L 19.9888,2.00001L 20,2.00001L 20,2.01122L 20,3.99999L 19.9207,3.99999L 13,10.9207L 13,22.909L 8.99999,18.909L 8.99999,10.906L 2.09405,3.99999L 2,3.99999L 2,2 Z "})])],-1)),oMn=[sMn],aMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current m-8 w-24 h-24"},[Ot("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)),lMn=["aria-label"],uMn={class:"md-icon-small inline items-start"},cMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"m 15.585999,21.223066 2.414,-2.414 v 1.811 A 3.616,3.616 0 0 0 21.2,15.309066 l 0.881,-0.881 a 4.82,4.82 0 0 1 -4.080001,7.4 v 1.811 z m -13.5859988,-9.224 a 10,10 0 1 1 19.9999998,0 c 0,0.172 0,0.346 -0.013,0.517 a 5.971,5.971 0 0 0 -2.014001,-1.184001 7.935,7.935 0 0 0 -4.973,-6.742999 v 0.41 a 2,2 0 0 1 -2,2 h -2 v 2 A 1,1 0 0 1 10,9.9990662 H 8.0000002 v 1.9999998 h 5.9999988 a 1,1 0 0 1 0.495,0.131 6,6 0 0 0 -0.184,9.6 10.009,10.009 0 0 1 -12.3109988,-9.731 z m 2,0 a 8,8 0 0 0 6.9999988,7.93 v -1.93 a 2,2 0 0 1 -1.9999988,-2 v -1 l -4.79,-4.79 a 8.07,8.07 0 0 0 -0.21,1.79 z m 9.1729988,5 a 4.827,4.827 0 0 1 4.827,-4.828 v -1.81 l 2.414,2.414 -2.414,2.413 v -1.809 a 3.623,3.623 0 0 0 -3.62,3.62 3.537,3.537 0 0 0 0.42,1.69 l -0.881,0.881 a 4.787,4.787 0 0 1 -0.746,-2.571 z"})],-1)),hMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},dMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),pMn=[dMn],fMn=["aria-label"],mMn={class:"md-icon-small inline items-start"},gMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"M 3,2L 20.9888,2L 21,2L 21,2.01122L 21,3.99999L 20.9207,3.99999L 14,10.9207L 14,22.909L 9.99999,18.909L 10,10.906L 3.09405,3.99999L 3,3.99999L 3,2 Z "})],-1)),yMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},vMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),_Mn=[vMn],bMn=["aria-label"],wMn={class:"md-icon-small inline items-start"},xMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("path",{d:"M 4 10 Z M 2 2 L 19.9888 2 L 20 2 L 20 2.0112 L 20 4 L 19.9207 4 L 13 10.9207 L 13 22.909 L 9 18.909 L 9 10.906 L 2.0941 4 L 2 4 L 2 2 Z M 24 13 L 21 14 L 18 13 L 15 14 V 22 L 18 21 l 3 1 l 3 -1 z M 21 21 l -3 -1 V 14 l 3 1.055 z"})],-1)),SMn={key:0,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},TMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),CMn=[TMn],EMn=["aria-label"],IMn={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},AMn=b_(()=>Ot("path",{d:"M18,8H17V6A5,5 0 0,0 12,1A5,5 0 0,0 7,6V8H6A2,2 0 0,0 4,10V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V10A2,2 0 0,0 18,8M12,3A3,3 0 0,1 15,6V8H9V6A3,3 0 0,1 12,3Z"},null,-1)),MMn=[AMn],OMn={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},PMn=b_(()=>Ot("path",{d:"M18 1.5c2.9 0 5.25 2.35 5.25 5.25v3.75a.75.75 0 01-1.5 0V6.75a3.75 3.75 0 10-7.5 0v3a3 3 0 013 3v6.75a3 3 0 01-3 3H3.75a3 3 0 01-3-3v-6.75a3 3 0 013-3h9v-3c0-2.9 2.35-5.25 5.25-5.25z"},null,-1)),RMn=[PMn],DMn={key:2,height:"18",width:"18",viewBox:"0 0 24 24",class:"inline float-right"},FMn=b_(()=>Ot("g",{id:"done"},[Ot("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})],-1)),kMn=[FMn],LMn=["aria-label"],NMn=b_(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current inline w-20 h-20 mr-2 text-gray-500"},[Ot("g",null,[Ot("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"})])],-1)),$Mn=Xr({__name:"table-component",props:{panel:{type:Zz,required:!0},gridId:{type:String,required:!0}},setup(i){const e=i,t=[j1.OID,j1.DOUBLE,j1.SINGLE,j1.INTEGER],r=eo("iApi"),n=bB(),s=w0(),o=Hr(()=>s.mobileView),a=vi(!o.value),l=vi(),{t:u,locale:c}=Qn(),h=()=>Df()?.proxy?.$forceUpdate(),p=vi({id:"dummy",layerIds:[],state:new i0e,fieldMap:{}}),m=vi(!0),v=vi(new aE.GridApi),w=vi(),S=vi(),I=vi(!1),R=vi(!1),L=vi([]),k=vi(0),B=vi([]),$=vi([]),V=vi(""),Y=vi(new aE.ColumnApi),K=vi([]),Q=vi([]),re=vi("OBJECTID"),ne=vi(void 0),de=g_t.onCellKeyPress,pe=vi({firstRow:0,lastRow:0,visibleRows:0}),H=vi({}),Z=r.geo.layer.getLayer(e.gridId),ae=vi({}),fe=vi(n.grids[e.gridId].layerIds),be=Hr(()=>n.grids[e.gridId]?n.grids[e.gridId].layerIds.map(G=>r.geo.layer.getLayer(G)).filter(G=>G!==void 0):[]),_e=vi(new Set),Ie=vi([]),Te=G=>{v.value=G.api,Y.value=G.columnApi,V.value=p.value.state.title||Z?.name||e.gridId,ot(),Q.value.length>0&&Y.value.autoSizeAllColumns();const E=()=>{document.querySelectorAll(".ag-input-field-input.ag-checkbox-input").forEach((g,b)=>{const O=Y.value.getAllDisplayedColumns()[b].getColDef();g.setAttribute("aria-label",O.headerName??u("grid.label.specialColumn"))})};E(),v.value.addEventListener("rowDataChanged",E),B.value.push(r.event.on(ln.FILTER_CHANGE,({uid:_,filterKey:g})=>{g!==pm.GRID&&_&&be.value.map(b=>b.uid).includes(_)&&me()})),B.value.push(r.event.on(ln.LAYER_VISIBILITYCHANGE,({layer:_})=>{_.uid&&be.value.map(g=>g.uid).includes(_.uid)&&me()})),B.value.push(r.event.on(ln.LAYER_RELOAD_END,_=>{_.loadPromise().then(()=>{be.value.map(g=>g.uid).includes(_.uid)&&me()})})),B.value.push(r.event.on(ln.CONFIG_CHANGE,()=>{v.value.redrawRows({force:!0})})),B.value.push(r.event.on(ln.MAP_EXTENTCHANGE,xE(100,()=>{p.value.state.filterByExtent&&me()}))),B.value.push(r.event.on(ln.LAYER_REMOVE,_=>{fe.value.includes(_.id)&&be.value.length!==0&&ue()})),me()},Be=()=>{Y.value.autoSizeAllColumns(),ne.value=new g_t(l.value,v.value,Y.value)},Ve=()=>{v.value.setQuickFilter(p.value.state.searchFilter)},$e=()=>{p.value.state.searchFilter="",Ve()},tt=()=>{$e(),At(),me()},yt=()=>{p.value.state.filterByExtent=!p.value.state.filterByExtent,me()},Ct=()=>{let G=w.value.api.getColumnDefs();p.value.state.colFilter=!p.value.state.colFilter,G.forEach(E=>{E.floatingFilter=p.value.state.colFilter}),w.value.api.setColumnDefs(G)},ot=()=>{v.value&&!I.value&&(p.value.state.searchFilter!==""&&Ve(),p.value.state.applyToMap&&ge(),Bv(()=>{let G=Y.value.getAllDisplayedColumns();w.value.api.refreshCells({columns:[G[0]]}),vt()}))},vt=()=>{pe.value.firstRow=v.value.getFirstDisplayedRow()+1,pe.value.lastRow=v.value.getLastDisplayedRow()+1,pe.value.visibleRows=v.value.getDisplayedRowCount()},At=()=>{v.value.setFilterModel({}),p.value.state.clearFilters(),v.value.refreshHeader()},Je=()=>{a.value=!a.value;let G=Y.value.getAllDisplayedColumns();Y.value.setColumnsPinned(G.slice(1,3),a.value?"left":"")},it=()=>{const G=Y.value.getAllDisplayedColumns().filter(E=>!E.getColDef().preventExport);v.value.exportDataAsCsv({columnKeys:G,suppressQuotes:!0,processCellCallback:E=>{let _=E.column.getColDef().cellRendererParams;return!E.value||_&&_.type==="number"?E.value:_&&_.type==="date"?`"${new Date(E.value).toLocaleDateString("en-CA",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}"`:`"${E.value.toString().replace(/"/g,'""')}"`}})},Ue=(G,E)=>{G.floatingFilterComponent="dateFloatingFilter",G.filterParams.comparator=function(_,g){let b=new Date(g);return b.getUTCFullYear()>_.getUTCFullYear()?1:b.getUTCFullYear()<_.getUTCFullYear()?-1:b.getUTCMonth()>_.getUTCMonth()?1:b.getUTCMonth()<_.getUTCMonth()?-1:b.getUTCDate()-_.getUTCDate()},G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E}},ct=(G,E,_)=>{G.floatingFilterComponent="selectorFloatingFilter",G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:_,rowData:E}},st=(G,E)=>{G.floatingFilterComponent="numberFloatingFilter",G.filterParams.inRangeInclusive=!0,G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E}},Ze=(G,E)=>{G.floatingFilterComponent="textFloatingFilter",G.floatingFilterComponentParams={suppressFilterButton:!0,stateManager:E},G.filterParams.textMatcher=function(g){const b=g.filterText.replace(/\*/,"\\*");return new RegExp(`^.*${b}.*`).test(g.value)};let _=function(g){let b=g.toLowerCase();return b=b.replace(new RegExp("[àáâãäå]","g"),"a"),b=b.replace(new RegExp("æ","g"),"ae"),b=b.replace(new RegExp("ç","g"),"c"),b=b.replace(new RegExp("[èéêë]","g"),"e"),b=b.replace(new RegExp("[ìíîï]","g"),"i"),b=b.replace(new RegExp("ñ","g"),"n"),b=b.replace(new RegExp("[òóôõö]","g"),"o"),b=b.replace(new RegExp("œ","g"),"oe"),b=b.replace(new RegExp("[ùúûü]","g"),"u"),b=b.replace(new RegExp("[ýÿ]","g"),"y"),b};G.filterParams.textFormatter=function(g){return _(g)}},ye=(G,E,_)=>{if(G.field==="rvRowIndex"){let g={sortable:!1,lockPosition:!0,valueGetter:"node.rowIndex + 1",suppressMovable:!0,suppressMenu:!0,floatingFilter:p.value.state.colFilter,pinned:"left",maxWidth:42,cellStyle:()=>({"padding-left":"2px","padding-right":"2px",display:"flex","justify-content":"center"}),floatingFilterComponent:"clearFloatingFilter",floatingFilterComponentParams:{stateManager:_,clearFilters:At,suppressFilterButton:!0},filter:!0,preventExport:!0};E.push(g)}if(G.field==="rvInteractive"){const g=p.value.state.controls;let b={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:g3n,cellRendererParams:{$iApi:r,t:u,layerCols:ae.value,isTeleport:e.panel.teleport!==void 0},preventExport:!0};if(g.includes("details")&&E.push(b),Yt.value){let C={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:E3n,cellRendererParams:{$iApi:r,layerCols:ae.value,isTeleport:e.panel.teleport!==void 0},preventExport:!0};g.includes("zoom")&&E.push(C)}g.forEach(C=>{if(C==="zoom"||C==="details")return;let O={sortable:!1,pinned:o.value?"":"left",filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellStyle:()=>({padding:"0px"}),cellRenderer:M3n,cellRendererParams:{$iApi:r,t:u,layerCols:ae.value,config:C},preventExport:!0};E.push(O)})}if(G.field==="rvSymbol"){let g={sortable:!1,filter:!1,lockPosition:!0,isStatic:!0,maxWidth:42,cellRenderer:b=>{const C=r.geo.layer.getLayer(b.data.rvUid);if(C===void 0)return;const O=document.createElement("span"),F=b.data[re.value];return C.getIcon(F).then(N=>{O.innerHTML=N}),O},cellStyle:()=>({paddingTop:"3px",textAlign:"center",paddingLeft:"5px",paddingRight:"0px"}),cellRendererParams:{$iApi:r,oidField:re.value},preventExport:!0};E.push(g)}},Ke=()=>!Object.values(H.value).every(G=>G===void 0),ke=G=>{const E=H.value[G.data.rvUid];return E===void 0||E.includes(G.data[re.value])},me=async()=>{const G=new Af,E=Ie.value.slice().map(g=>g.getPromise());Ie.value.push(G),await Promise.all(E),await Promise.all(be.value.map(async g=>{g&&g.visibility?await g.getFilterOIDs([pm.GRID],p.value.state.filterByExtent?r.geo.map.getExtent():void 0).then(b=>{H.value[g.uid]=b}):H.value[g.uid]=[]})),v.value.onFilterChanged(),G.resolveMe();const _=Ie.value.indexOf(G);_===-1?console.error("Grid could not find filter blocker in filter queue"):Ie.value.splice(_,1)},ie=()=>{p.value.state.applyToMap=!p.value.state.applyToMap,ge()},ge=()=>{be.value.filter(G=>G.mapLayer).forEach(G=>{if(!p.value.state.applyToMap)G.setSqlFilter(pm.GRID,"");else{const E=je(G.id);G.setSqlFilter(pm.GRID,E)}})},je=G=>{const E=v.value.getFilterModel();let _=[];if(Object.keys(E).forEach(g=>{const b=A(G,g);b?_.push(rt(b.origAttr,E[g])):_.push("1=2")}),p.value.state.searchFilter&&p.value.state.searchFilter.length>0){const g=Me(G)||"1=2";g.length>0&&_.push(`(${g})`)}return _.join(" AND ")},rt=(G,E)=>{switch(E.filterType){case"number":{switch(E.type){case"greaterThanOrEqual":return`${G} >= ${E.filter}`;case"lessThanOrEqual":return`${G} <= ${E.filter}`;case"inRange":return`${G} >= ${E.filter} AND ${G} <= ${E.filterTo}`}break}case"text":{let _=E.filter.replace(/'/g,/''/);if(_!==""){const g=/\\[(!"#$&'+,.\\/:;<=>?@[\]^`{|}~)]/g;let b=_,C="",O=g.exec(_),F=0;for(;O;)C=C+_.substr(F,O.index-F)+O[0].slice(-1),F=O.index+2,b=_.substr(O.index+2),O=g.exec(_);C=C+b,C=C.replace(/%/g,"ௌ%"),C=C.replace(/_/g,"ௌ_"),C=`*${C}`;let N=`UPPER(${G}) LIKE '${C.replace(/\*/g,"%").toUpperCase()}%'`;return N.includes("ௌ%")||N.includes("ௌ_")?`${N} ESCAPE 'ௌ'`:N}break}case"date":{const _=new Date(E.dateFrom??0),g=new Date(E.dateTo??864e13),b=_?`${_.getMonth()+1}/${_.getDate()}/${_.getFullYear()}`:void 0,C=g?`${g.getMonth()+1}/${g.getDate()}/${g.getFullYear()}`:void 0;switch(E.type){case"greaterThan":return`${G} >= DATE '${b}'`;case"lessThan":return`${G} <= DATE '${b}'`;case"inRange":return`${G} >= DATE '${b}' AND ${G} <= DATE '${C}'`}}}},Me=G=>{const _=p.value.state.searchFilter.replace(/'/g,"''").split(" "),g=v.value.rowModel.rowsToDisplay,b=Y.value.getAllDisplayedColumns().filter(O=>(O.colDef.filter==="agTextColumnFilter"||O.colDef.filter==="agNumberColumnFilter")&&A(G,O.getColId()));let C=[];return g.forEach(O=>{let F=!0,N="";for(let j of _){const W=new RegExp(`.*${j.split(" ").join(".*").toUpperCase()}`),q=`%${j.replace(/\*/g,"%").split(" ").join("%").toUpperCase()}`;let J=!1;for(let ee of b){const he=ee.getColId(),Ee=A(G,ee.getColId())?.origAttr,De=ee.getColDef();if(O.data[he]===void 0)J=!1;else if(De.filter==="agTextColumnFilter"){const pt=O.data[he]===null?null:O.data[he].toString();if(pt!==null&&W.test(pt.toUpperCase())){N?N=N.concat(" AND ",`(UPPER(${Ee}) LIKE '${q}%')`):N=N.concat("(",`(UPPER(${Ee}) LIKE '${q}%')`),C.includes(N+")")?J=!1:J=!0;break}}else if(De.filter==="agNumberColumnFilter"){const pt=O.data[he]===null?null:O.data[he];if(pt!==null&&W.test(pt)){N?N=N.concat(" AND ",`(${Ee} = ${pt})`):N=N.concat("(",`(${Ee} = ${pt})`),C.includes(N+")")?J=!1:J=!0;break}}}if(!J){F=!1;break}}F&&C.push(N+")")}),C.join(" OR ")},ht=G=>{["ArrowDown","Down","ArrowLeft","Left","ArrowUp","Up","ArrowRight","Right"].includes(G.key)&&G.stopPropagation()},Ht=()=>{_t(),e.panel.isOpen&&e.panel.close()},_t=()=>{(I.value||R.value)&&be.value.forEach(G=>{G.abortAttributeLoad(),G.clearFeatureCache()})},Fe=Hr(()=>{const G=be.value.map(g=>g.visibility&&g.canModifyLayer&&g.mapLayer),E=be.value.some(g=>g.visibility&&g.mapLayer&&!g.canModifyLayer),_=G.some(Boolean);return E&&_?"partial":_?"enabled":"disabled"}),Yt=Hr(()=>be.value.some(G=>G.isLoaded&&G.supportsFeatures&&G.mapLayer)),A=(G,E)=>ae.value[G].find(_=>(_.mappedAttr??_.origAttr)===E),ue=()=>{const G=be.value.filter(E=>E&&E.supportsFeatures&&E.isLoaded);G.length===0&&Ht(),k.value=G.reduce((E,{featureCount:_})=>E+_,0),L.value=new Array(be.value.length).fill(0),G.forEach((E,_)=>L.value[_]+=E.downloadedAttributes()),G.forEach((E,_)=>{$.value.push(rl(()=>E.downloadedAttributes(),g=>{L.value[_]=g}))}),Promise.all(G.map(E=>E.loadPromise())).then(()=>{const E=G.map(_=>Da(_).getTabularAttributes().then(g=>{const b=p?.value?.state?.state;if(b?.columns&&b.columnMetadata?.exclusiveColumns){const C=b.columns.map(O=>O.field);g.columns=g.columns.filter(O=>C.includes(O.title))}return g}));Promise.all(E).then(_=>{if(G.every(b=>b.attribLoadAborted())){I.value=!1;return}const g={columns:[],rows:[],fields:[],oidField:""};_.forEach((b,C)=>{const O=[],F=G[C].id;b.columns.forEach(N=>{p.value.fieldMap&&p.value.fieldMap[N.data]?(O.push({origAttr:N.data,mappedAttr:p.value.fieldMap[N.data]}),N.data=p.value.fieldMap[N.data],N.title=N.data):O.push({origAttr:N.data,mappedAttr:void 0}),g.columns.map(j=>j.data).includes(N.data)||g.columns.push(N)}),g.rows=g.rows.concat(b.rows.map(N=>{if(p.value.fieldMap)for(const[j,W]of Object.entries(p.value.fieldMap))N[j]!==void 0&&N[W]===void 0&&(N[W]=N[j],delete N[j]);return N}));for(let N=0;N((!r.ui.exposeOids&&N.type==="oid"||!r.ui.exposeMeasurements&&(N.name.toLowerCase()==="shape_length"||N.name.toLowerCase()==="shape_area"))&&_e.value.add(N.name),{name:p.value.fieldMap&&p.value.fieldMap[N.name]?p.value.fieldMap[N.name]:N.name,type:N.type,alias:N.alias??void 0,length:N.length??void 0}))),g.oidField=p.value.fieldMap&&p.value.fieldMap[b.oidField]?p.value.fieldMap[b.oidField]:b.oidField,ae.value[F]=O}),re.value=g.oidField,["rvRowIndex","rvInteractive","rvSymbol",...g.columns].forEach(b=>{p.value.state?.columns[b.data]===void 0&&(p.value.state.columns[b.data]=new $Jt({field:b.data,title:b.title})),(!r.ui.exposeOids||!r.ui.exposeMeasurements)&&_e.value.has(b.data)&&(p.value.state.columns[b.data].visible=!1);let C=p.value.state?.columns[b.data],O={headerName:C.title??b.title,headerComponent:"agColumnHeader",headerComponentParams:{sort:C.sort},field:b.data??b,isSelector:C.filter.type==="selector",sortable:!0,lockPosition:!0,filterParams:{},floatingFilter:p.value.state.colFilter&&C.searchable,hide:!C?.visible,minWidth:C.width,maxWidth:C.width??400,cellRenderer:N=>N.value,suppressHeaderKeyboardEvent:N=>{const j=N.event;return N.headerRowIndex===0&&(j.key==="Enter"||!j.target.classList.contains("ag-header-cell")&&j.key==="Tab")}},F=g.fields.find(N=>N.name===O.field);b==="rvRowIndex"||b==="rvSymbol"||b==="rvInteractive"?ye(O,K.value,p.value.state):(t.indexOf(F.type)>-1?(st(O,p.value.state),O.filter="agNumberColumnFilter",O.autoHeight=!0,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"number"}):F.type===j1.DATE?(Ue(O,p.value.state),O.filter="agDateColumnFilter",O.autoHeight=!0,O.minWidth=400,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"date"}):F.type===j1.STRING&&(O.isSelector?ct(O,g.rows,p.value.state):Ze(O,p.value.state),O.filter="agTextColumnFilter",O.autoHeight=!0,O.cellRenderer=C.template===""?MRe:r.component(C.template),O.cellRendererParams={type:"string"}),K.value.push(O))}),Q.value=Da(g.rows),K.value=Da(K.value),ot(),I.value=!1}).catch(_=>{console.error(_),R.value=!0,I.value=!1})})};return E0(()=>{p.value=n.grids[e.gridId],I.value=!0,h(),pe.value={firstRow:0,lastRow:0,visibleRows:0},S.value={agColumnHeader:d3n,numberFloatingFilter:EAn,textFloatingFilter:OAn,selectorFloatingFilter:LAn,dateFloatingFilter:VAn,clearFloatingFilter:YAn},w.value={ensureDomOrder:!0,rowHeight:40,suppressRowTransform:!0,onFilterChanged:()=>{ge(),ot()},onBodyScroll:()=>{[...document.querySelectorAll("[id^=tippy]")].forEach(G=>{G._tippy&&l.value?.contains(G._tippy.reference)&&G._tippy.hide()})},onBodyScrollEnd:()=>{vt()},rowBuffer:0,suppressColumnVirtualisation:!0,tabToNextCell:vAn,tabToNextHeader:yAn,onModelUpdated:xE(300,()=>Y.value.autoSizeAllColumns())},ue(),Fe.value==="partial"&&r.notify.show(K1.WARNING,r.$i18n.t("layer.filterwarning")),$.value.push(rl(c,()=>{m.value=!1,setTimeout(()=>{m.value=!0},10)})),$.value.push(rl(Fe,G=>{G==="partial"&&r.notify.show(K1.WARNING,r.$i18n.t("layer.filterwarning"))}))}),Ka(()=>{_t(),B.value.forEach(G=>r.event.off(G)),$.value.forEach(G=>G()),ne.value?.removeAccessibilityListeners(),ne.value?.removeScrollListeners()}),(G,E)=>{const _=Ko("dropdown-menu"),g=Nn("truncate"),b=Nn("tippy");return qt(),si("div",{class:"flex flex-col w-full h-full bg-white",ref_key:"el",ref:l},[Ur(Ot("div",null,[Ot("p",F3n,br(ri(u)("grid.splash.error")),1)],512),[[bf,R.value]]),Ur(Ot("div",k3n,[Ot("div",L3n,[Ot("span",N3n,br(L.value.reduce((C,O)=>C+O,0)),1),$3n,Ot("span",B3n,br(k.value),1)]),Ot("div",j3n,[Ot("span",G3n,br(L.value.reduce((C,O)=>C+O,0)Ve()),onKeypress:E[1]||(E[1]=Ph(ia(()=>{},["prevent"]),["enter"])),onKeyup:E[2]||(E[2]=Ph(C=>{ri(s).mobileView&&C?.target?.blur()},["enter"])),enterkeyhint:"done","onUpdate:modelValue":E[3]||(E[3]=C=>p.value.state.searchFilter=C),class:"rv-global-search rv-input pr-32 min-w-0","aria-invalid":"false","aria-label":ri(u)("grid.filters.label.global"),placeholder:ri(u)("grid.filters.label.global")},null,40,J3n),[[LS,p.value.state.searchFilter]]),Ot("div",K3n,[p.value.state.searchFilter.length<3?(qt(),si("svg",Z3n,eMn)):(qt(),si("button",{key:1,class:"flex justify-center fill-current ml-6 cursor-pointer",onClick:E[4]||(E[4]=C=>$e())},iMn))])],512),[[bf,p.value.state.search]]),Ot("div",rMn,[Vn(fAn,{columnApi:Y.value,columnDefs:K.value,systemCols:_e.value,onRefreshHeaders:E[5]||(E[5]=C=>v.value.refreshHeader())},null,8,["columnApi","columnDefs","systemCols"]),Ur((qt(),si("button",{type:"button",class:"grid-clearall p-4 h-40 text-gray-500 hover:text-black",onClick:E[6]||(E[6]=C=>tt()),content:ri(u)("grid.clearAll"),"aria-label":ri(u)("grid.clearAll")},oMn,8,nMn)),[[b,{placement:"bottom"}]]),Vn(_,{class:"h-40 w-40",position:"bottom-end",tooltip:ri(u)("panels.controls.optionsMenu"),centered:!1},{header:Rn(()=>[aMn]),default:Rn(()=>[Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:Fe.value!=="disabled"?"none":"text-black",disabled:Fe.value==="disabled"}]),onClick:E[7]||(E[7]=C=>Fe.value!=="disabled"&&ie()),role:"button","aria-label":ri(u)("grid.label.filters.apply")},[Ot("div",uMn,[cMn,Xs(" "+br(ri(u)("grid.label.filters.apply"))+" ",1),Fe.value!=="disabled"&&p.value.state.applyToMap?(qt(),si("svg",hMn,pMn)):Yr("",!0)])],10,lMn),Ot("a",{href:"javascript:;",class:"flex leading-snug items-center w-256 hover:text-black",onClick:E[8]||(E[8]=C=>Ct()),role:"button","aria-label":ri(u)("grid.label.filters.show")},[Ot("div",mMn,[gMn,Xs(" "+br(ri(u)("grid.label.filters.show"))+" ",1),p.value.state.colFilter?(qt(),si("svg",yMn,_Mn)):Yr("",!0)])],8,fMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:Fe.value!=="disabled"?"none":"text-black",disabled:Fe.value==="disabled"}]),onClick:E[9]||(E[9]=C=>Fe.value!=="disabled"&&yt()),role:"button","aria-label":ri(u)("grid.filters.label.extent")},[Ot("div",wMn,[xMn,Xs(" "+br(ri(u)("grid.filters.label.extent"))+" ",1),Fe.value!=="disabled"&&p.value.state.filterByExtent?(qt(),si("svg",SMn,CMn)):Yr("",!0)])],10,bMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:"text-black"}]),onClick:E[10]||(E[10]=C=>Je()),role:"button","aria-label":ri(u)("grid.label.pinColumns")},[a.value?(qt(),si("svg",IMn,MMn)):a.value?Yr("",!0):(qt(),si("svg",OMn,RMn)),Xs(" "+br(ri(u)("grid.label.pinColumns"))+" ",1),a.value?(qt(),si("svg",DMn,kMn)):Yr("",!0)],8,EMn),Ot("a",{href:"javascript:;",class:Wn(["flex leading-snug items-center w-256",{hover:"text-black"}]),onClick:E[11]||(E[11]=C=>it()),role:"button","aria-label":ri(u)("grid.label.export")},[NMn,Xs(" "+br(ri(u)("grid.label.export")),1)],8,LMn)]),_:1},8,["tooltip"])])])],512),[[bf,!I.value&&!R.value]]),m.value?Ur((qt(),Dn(ri(aAn),{key:0,class:"ag-theme-material flex-grow",enableCellTextSelection:"true",accentedSort:"true",localeText:ri(c)==="en"?ri(R3n):ri(D3n),gridOptions:w.value,columnDefs:K.value,rowData:Q.value,components:S.value,onGridReady:Te,onKeydown:ht,onFirstDataRendered:Be,onCellKeyPress:ri(de),doesExternalFilterPass:ke,isExternalFilterPresent:Ke},null,8,["localeText","gridOptions","columnDefs","rowData","components","onCellKeyPress"])),[[bf,!I.value&&!R.value]]):Yr("",!0)],512)}}}),BMn=ml($Mn,[["__scopeId","data-v-aec3f27c"]]),jMn=Xr({__name:"screen",props:{panel:{type:Zz,required:!0}},setup(i){const e=bB(),{t}=Qn(),r=Hr(()=>e.currentId);return(n,s)=>{const o=Ko("panel-screen");return qt(),Dn(o,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(t)("grid.title")),1)]),content:Rn(()=>[Vn(BMn,{class:"rv-grid",gridId:r.value,panel:i.panel},null,8,["gridId","panel"])]),_:1},8,["panel"])}}}),GJt=ml(jMn,[["__scopeId","data-v-e4d6fbae"]]),GMn=Object.freeze(Object.defineProperty({__proto__:null,default:GJt},Symbol.toStringTag,{value:"Module"})),UMn={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class zMn extends YIn{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":Da(GJt)},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:UMn}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&dy(this.$vApp.$pinia).removeButton("grid"),bB(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}const VMn=Object.freeze(Object.defineProperty({__proto__:null,default:zMn},Symbol.toStringTag,{value:"Module"}));class HMn extends Yu{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=_Te(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const WMn=i=>(Dc("data-v-c2a24c78"),i=i(),Fc(),i),qMn={key:0},YMn=["content"],XMn={class:"text-lg text-left flex-grow"},JMn=WMn(()=>Ot("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},[Ot("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ot("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)),KMn=[JMn],ZMn=["innerHTML"],QMn=Xr({__name:"section",props:{helpSection:{type:Object,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy");return i.helpSection.drawn?(qt(),si("div",qMn,[Ot("div",null,[Ur((qt(),si("button",{type:"button",class:"help-section-header flex items-center py-15 px-25 hover:bg-gray-200 cursor-pointer select-none w-full",onClick:r[0]||(r[0]=s=>t.$emit("expand")),content:ri(e)(i.helpSection.expanded?"help.section.collapse":"help.section.expand")},[Ot("span",XMn,br(i.helpSection.header),1),Ot("div",{class:Wn(["dropdown-icon",{"transform -rotate-180":i.helpSection.expanded}])},KMn,2)],8,YMn)),[[n,{placement:"top-end",hideOnClick:!1}]]),Vn(eL,{name:"help-item",mode:"out-in"},{default:Rn(()=>[Ur(Ot("div",{innerHTML:i.helpSection.info,class:"ramp-markdown section-body px-20 pt-5 ml-10 overflow-hidden"},null,8,ZMn),[[bf,i.helpSection.expanded]])]),_:1})])])):Yr("",!0)}}}),eOn=ml(QMn,[["__scopeId","data-v-c2a24c78"]]);function UJt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let S7=UJt();function tOn(i){S7=i}const zJt=/[&<>"']/,iOn=new RegExp(zJt.source,"g"),VJt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,rOn=new RegExp(VJt.source,"g"),nOn={"&":"&","<":"<",">":">",'"':""","'":"'"},y_t=i=>nOn[i];function mv(i,e){if(e){if(zJt.test(i))return i.replace(iOn,y_t)}else if(VJt.test(i))return i.replace(rOn,y_t);return i}const sOn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function HJt(i){return i.replace(sOn,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const oOn=/(^|[^\[])\^/g;function Dh(i,e){i=typeof i=="string"?i:i.source,e=e||"";const t={replace:(r,n)=>(n=n.source||n,n=n.replace(oOn,"$1"),i=i.replace(r,n),t),getRegex:()=>new RegExp(i,e)};return t}const aOn=/[^\w:]/g,lOn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v_t(i,e,t){if(i){let r;try{r=decodeURIComponent(HJt(t)).replace(aOn,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}e&&!lOn.test(t)&&(t=dOn(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Dpe={},uOn=/^[^:]+:\/*[^/]*$/,cOn=/^([^:]+:)[\s\S]*$/,hOn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function dOn(i,e){Dpe[" "+i]||(uOn.test(i)?Dpe[" "+i]=i+"/":Dpe[" "+i]=r0e(i,"/",!0)),i=Dpe[" "+i];const t=i.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:i.replace(cOn,"$1")+e:e.charAt(0)==="/"?t?e:i.replace(hOn,"$1")+e:i+e}const Iwe={exec:function(){}};function __t(i,e){const t=i.replace(/\|/g,(s,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),r=t.split(/ \|/);let n=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>e)r.splice(e);else for(;r.length1;)e&1&&(t+=i),e>>=1,i+=i;return t+i}function w_t(i,e,t,r){const n=e.href,s=e.title?mv(e.title):null,o=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:t,href:n,title:s,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,a}return{type:"image",raw:t,href:n,title:s,text:mv(o)}}function mOn(i,e){const t=i.match(/^(\s+)(?:```)/);if(t===null)return e;const r=t[1];return e.split(` `).map(n=>{const s=n.match(/^\s+/);if(s===null)return n;const[o]=s;return o.length>=r.length?n.slice(r.length):n}).join(` `)}class dZe{constructor(e){this.options=e||S7}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:r0e(r,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=vOn(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){const n=r0e(r,"#");(this.options.pedantic||!n||/ $/.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const r=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(r);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r,n,s,o,a,l,u,c,h,p,m,v,w=t[1].trim();const S=w.length>1,I={type:"list",raw:"",ordered:S,start:S?+w.slice(0,-1):"",loose:!1,items:[]};w=S?`\\d{1,9}\\${w.slice(-1)}`:`\\${w}`,this.options.pedantic&&(w=S?w:"[*+-]");const R=new RegExp(`^( {0,3}${w})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(v=!1,!(!(t=R.exec(e))||this.rules.block.hr.test(e)));){if(r=t[0],e=e.substring(r.length),c=t[2].split(` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=mOn(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){const n=r0e(r,"#");(this.options.pedantic||!n||/ $/.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const r=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(r);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r,n,s,o,a,l,u,c,h,p,m,v,w=t[1].trim();const S=w.length>1,I={type:"list",raw:"",ordered:S,start:S?+w.slice(0,-1):"",loose:!1,items:[]};w=S?`\\d{1,9}\\${w.slice(-1)}`:`\\${w}`,this.options.pedantic&&(w=S?w:"[*+-]");const R=new RegExp(`^( {0,3}${w})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(v=!1,!(!(t=R.exec(e))||this.rules.block.hr.test(e)));){if(r=t[0],e=e.substring(r.length),c=t[2].split(` `,1)[0].replace(/^\t+/,k=>" ".repeat(3*k.length)),h=e.split(` `,1)[0],this.options.pedantic?(o=2,m=c.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,m=c.slice(o),o+=t[1].length),l=!1,!c&&/^ *$/.test(h)&&(r+=h+` `,e=e.substring(h.length+1),v=!0),!v){const k=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),B=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),$=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),V=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;e&&(p=e.split(` @@ -7042,8 +7042,8 @@ gl_FragColor.rgb *= color.a; `+h}!l&&!h.trim()&&(l=!0),r+=p+` `,e=e.substring(p.length+1),c=h.slice(o)}}I.loose||(u?I.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(m),n&&(s=n[0]!=="[ ] ",m=m.replace(/^\[[ xX]\] +/,""))),I.items.push({type:"list_item",raw:r,task:!!n,checked:s,loose:!1,text:m}),I.raw+=r}I.items[I.items.length-1].raw=r.trimRight(),I.items[I.items.length-1].text=m.trimRight(),I.raw=I.raw.trimRight();const L=I.items.length;for(a=0;a$.type==="space"),B=k.length>0&&k.some($=>/\n.*\n/.test($.raw));I.loose=B}if(I.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){const r={type:"table",header:__t(t[1]).map(n=>({text:n})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(r.header.length===r.align.length){r.raw=t[0];let n=r.align.length,s,o,a,l;for(s=0;s({text:u}));for(n=r.header.length,o=0;o/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):mv(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const o=r0e(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=gOn(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(r)?n=n.slice(1):n=n.slice(1,-1)),w_t(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n){const s=r[0].charAt(0);return{type:"text",raw:s,text:s}}return w_t(r,n,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&r.match(/[\p{L}\p{N}]/u))return;const s=n[1]||n[2]||"";if(!s||s&&(r===""||this.rules.inline.punctuation.exec(r))){const o=n[0].length-1;let a,l,u=o,c=0;const h=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+o);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=a.length,n[3]||n[4]){u+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const p=e.slice(0,o+n.index+(n[0].length-a.length)+l);if(Math.min(o,l)%2){const v=p.slice(1,-1);return{type:"em",raw:p,text:v,tokens:this.lexer.inlineTokens(v)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," ");const n=/[^ ]/.test(r),s=/^ /.test(r)&&/ $/.test(r);return n&&s&&(r=r.substring(1,r.length-1)),r=mv(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const r=this.rules.inline.autolink.exec(e);if(r){let n,s;return r[2]==="@"?(n=mv(this.options.mangle?t(r[1]):r[1]),s="mailto:"+n):(n=mv(r[1]),s=n),{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let r;if(r=this.rules.inline.url.exec(e)){let n,s;if(r[2]==="@")n=mv(this.options.mangle?t(r[0]):r[0]),s="mailto:"+n;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(o!==r[0]);n=mv(r[0]),r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t){const r=this.rules.inline.text.exec(e);if(r){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):mv(r[0]):r[0]:n=mv(this.options.smartypants?t(r[0]):r[0]),{type:"text",raw:r[0],text:n}}}}const ra={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Iwe,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ra._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ra._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ra.def=Dh(ra.def).replace("label",ra._label).replace("title",ra._title).getRegex();ra.bullet=/(?:[*+-]|\d{1,9}[.)])/;ra.listItemStart=Dh(/^( *)(bull) */).replace("bull",ra.bullet).getRegex();ra.list=Dh(ra.list).replace(/bull/g,ra.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ra.def.source+")").getRegex();ra._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ra._comment=/|$)/;ra.html=Dh(ra.html,"i").replace("comment",ra._comment).replace("tag",ra._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ra.paragraph=Dh(ra._paragraph).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.blockquote=Dh(ra.blockquote).replace("paragraph",ra.paragraph).getRegex();ra.normal={...ra};ra.gfm={...ra.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ra.gfm.table=Dh(ra.gfm.table).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.gfm.paragraph=Dh(ra._paragraph).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ra.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.pedantic={...ra.normal,html:Dh(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ra._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Iwe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dh(ra.normal._paragraph).replace("hr",ra.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ra.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Vs={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Iwe,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Iwe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Vs.punctuation=Dh(Vs.punctuation).replace(/punctuation/g,Vs._punctuation).getRegex();Vs.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Vs.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Vs._comment=Dh(ra._comment).replace("(?:-->|$)","-->").getRegex();Vs.emStrong.lDelim=Dh(Vs.emStrong.lDelim).replace(/punct/g,Vs._punctuation).getRegex();Vs.emStrong.rDelimAst=Dh(Vs.emStrong.rDelimAst,"g").replace(/punct/g,Vs._punctuation).getRegex();Vs.emStrong.rDelimUnd=Dh(Vs.emStrong.rDelimUnd,"g").replace(/punct/g,Vs._punctuation).getRegex();Vs._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Vs._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Vs._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Vs.autolink=Dh(Vs.autolink).replace("scheme",Vs._scheme).replace("email",Vs._email).getRegex();Vs._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Vs.tag=Dh(Vs.tag).replace("comment",Vs._comment).replace("attribute",Vs._attribute).getRegex();Vs._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Vs._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Vs._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Vs.link=Dh(Vs.link).replace("label",Vs._label).replace("href",Vs._href).replace("title",Vs._title).getRegex();Vs.reflink=Dh(Vs.reflink).replace("label",Vs._label).replace("ref",ra._label).getRegex();Vs.nolink=Dh(Vs.nolink).replace("ref",ra._label).getRegex();Vs.reflinkSearch=Dh(Vs.reflinkSearch,"g").replace("reflink",Vs.reflink).replace("nolink",Vs.nolink).getRegex();Vs.normal={...Vs};Vs.pedantic={...Vs.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Dh(/^!?\[(label)\]\((.*?)\)/).replace("label",Vs._label).getRegex(),reflink:Dh(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vs._label).getRegex()};Vs.gfm={...Vs.normal,escape:Dh(Vs.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(r="x"+r.toString(16)),e+="&#"+r+";";return e}class Pk{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||S7,this.options.tokenizer=this.options.tokenizer||new dZe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ra.normal,inline:Vs.normal};this.options.pedantic?(t.block=ra.pedantic,t.inline=Vs.pedantic):this.options.gfm&&(t.block=ra.gfm,this.options.breaks?t.inline=Vs.breaks:t.inline=Vs.gfm),this.tokenizer.rules=t}static get rules(){return{block:ra,inline:Vs}}static lex(e,t){return new Pk(t).lex(e)}static lexInline(e,t){return new Pk(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:mv(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):mv(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const o=r0e(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=pOn(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(r)?n=n.slice(1):n=n.slice(1,-1)),w_t(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n){const s=r[0].charAt(0);return{type:"text",raw:s,text:s}}return w_t(r,n,r[0],this.lexer)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&r.match(/[\p{L}\p{N}]/u))return;const s=n[1]||n[2]||"";if(!s||s&&(r===""||this.rules.inline.punctuation.exec(r))){const o=n[0].length-1;let a,l,u=o,c=0;const h=n[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+o);(n=h.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=a.length,n[3]||n[4]){u+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const p=e.slice(0,o+n.index+(n[0].length-a.length)+l);if(Math.min(o,l)%2){const v=p.slice(1,-1);return{type:"em",raw:p,text:v,tokens:this.lexer.inlineTokens(v)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," ");const n=/[^ ]/.test(r),s=/^ /.test(r)&&/ $/.test(r);return n&&s&&(r=r.substring(1,r.length-1)),r=mv(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const r=this.rules.inline.autolink.exec(e);if(r){let n,s;return r[2]==="@"?(n=mv(this.options.mangle?t(r[1]):r[1]),s="mailto:"+n):(n=mv(r[1]),s=n),{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let r;if(r=this.rules.inline.url.exec(e)){let n,s;if(r[2]==="@")n=mv(this.options.mangle?t(r[0]):r[0]),s="mailto:"+n;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(o!==r[0]);n=mv(r[0]),r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t){const r=this.rules.inline.text.exec(e);if(r){let n;return this.lexer.state.inRawBlock?n=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):mv(r[0]):r[0]:n=mv(this.options.smartypants?t(r[0]):r[0]),{type:"text",raw:r[0],text:n}}}}const ra={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Iwe,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};ra._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;ra._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;ra.def=Dh(ra.def).replace("label",ra._label).replace("title",ra._title).getRegex();ra.bullet=/(?:[*+-]|\d{1,9}[.)])/;ra.listItemStart=Dh(/^( *)(bull) */).replace("bull",ra.bullet).getRegex();ra.list=Dh(ra.list).replace(/bull/g,ra.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ra.def.source+")").getRegex();ra._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";ra._comment=/|$)/;ra.html=Dh(ra.html,"i").replace("comment",ra._comment).replace("tag",ra._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();ra.paragraph=Dh(ra._paragraph).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.blockquote=Dh(ra.blockquote).replace("paragraph",ra.paragraph).getRegex();ra.normal={...ra};ra.gfm={...ra.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};ra.gfm.table=Dh(ra.gfm.table).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.gfm.paragraph=Dh(ra._paragraph).replace("hr",ra.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",ra.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",ra._tag).getRegex();ra.pedantic={...ra.normal,html:Dh(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ra._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Iwe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dh(ra.normal._paragraph).replace("hr",ra.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",ra.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Vs={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Iwe,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Iwe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Vs.punctuation=Dh(Vs.punctuation).replace(/punctuation/g,Vs._punctuation).getRegex();Vs.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Vs.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Vs._comment=Dh(ra._comment).replace("(?:-->|$)","-->").getRegex();Vs.emStrong.lDelim=Dh(Vs.emStrong.lDelim).replace(/punct/g,Vs._punctuation).getRegex();Vs.emStrong.rDelimAst=Dh(Vs.emStrong.rDelimAst,"g").replace(/punct/g,Vs._punctuation).getRegex();Vs.emStrong.rDelimUnd=Dh(Vs.emStrong.rDelimUnd,"g").replace(/punct/g,Vs._punctuation).getRegex();Vs._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Vs._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Vs._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Vs.autolink=Dh(Vs.autolink).replace("scheme",Vs._scheme).replace("email",Vs._email).getRegex();Vs._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Vs.tag=Dh(Vs.tag).replace("comment",Vs._comment).replace("attribute",Vs._attribute).getRegex();Vs._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Vs._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Vs._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Vs.link=Dh(Vs.link).replace("label",Vs._label).replace("href",Vs._href).replace("title",Vs._title).getRegex();Vs.reflink=Dh(Vs.reflink).replace("label",Vs._label).replace("ref",ra._label).getRegex();Vs.nolink=Dh(Vs.nolink).replace("ref",ra._label).getRegex();Vs.reflinkSearch=Dh(Vs.reflinkSearch,"g").replace("reflink",Vs.reflink).replace("nolink",Vs.nolink).getRegex();Vs.normal={...Vs};Vs.pedantic={...Vs.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Dh(/^!?\[(label)\]\((.*?)\)/).replace("label",Vs._label).getRegex(),reflink:Dh(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vs._label).getRegex()};Vs.gfm={...Vs.normal,escape:Dh(Vs.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(r="x"+r.toString(16)),e+="&#"+r+";";return e}class Pk{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||S7,this.options.tokenizer=this.options.tokenizer||new dZe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ra.normal,inline:Vs.normal};this.options.pedantic?(t.block=ra.pedantic,t.inline=Vs.pedantic):this.options.gfm&&(t.block=ra.gfm,this.options.breaks?t.inline=Vs.breaks:t.inline=Vs.gfm),this.tokenizer.rules=t}static get rules(){return{block:ra,inline:Vs}}static lex(e,t){return new Pk(t).lex(e)}static lexInline(e,t){return new Pk(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` `),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let r,n,s,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),n=t[t.length-1],n&&(n.type==="paragraph"||n.type==="text")?(n.raw+=` `+r.raw,n.text+=` @@ -7053,7 +7053,7 @@ gl_FragColor.rgb *= color.a; `+r.raw,n.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r),o=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),n=t[t.length-1],n&&n.type==="text"?(n.raw+=` `+r.raw,n.text+=` -`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,s,o=e,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+b_t("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+b_t("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,a.index+a[0].length-2)+"++"+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),n=t[t.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),n=t[t.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,o,u)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e,x_t)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,x_t))){e=e.substring(r.raw.length),t.push(r);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const h=e.slice(1);let p;this.options.extensions.startInline.forEach(function(m){p=m.call({lexer:this},h),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(s=e.substring(0,c+1))}if(r=this.tokenizer.inlineText(s,_On)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),l=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}}class pZe{constructor(e){this.options=e||S7}code(e,t,r){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(e,n);s!=null&&s!==e&&(r=!0,e=s)}return e=e.replace(/\n$/,"")+` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n,s,o=e,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+b_t("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+b_t("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,a.index+a[0].length-2)+"++"+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),n=t[t.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),n=t[t.length-1],n&&r.type==="text"&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,o,u)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e,x_t)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,x_t))){e=e.substring(r.raw.length),t.push(r);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const h=e.slice(1);let p;this.options.extensions.startInline.forEach(function(m){p=m.call({lexer:this},h),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(s=e.substring(0,c+1))}if(r=this.tokenizer.inlineText(s,gOn)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),l=!0,n=t[t.length-1],n&&n.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}}class pZe{constructor(e){this.options=e||S7}code(e,t,r){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(e,n);s!=null&&s!==e&&(r=!0,e=s)}return e=e.replace(/\n$/,"")+` `,n?'
'+(r?e:mv(e,!0))+`
`:"
"+(r?e:mv(e,!0))+`
`}blockquote(e){return`
@@ -7074,28 +7074,28 @@ ${e}
${e} `}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+` `}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
":"
"}del(e){return`${e}`}link(e,t,r){if(e=v_t(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n='
",n}image(e,t,r){if(e=v_t(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let n=`${r}":">",n}text(e){return e}}class WJt{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class qJt{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let r=e,n=0;if(this.seen.hasOwnProperty(r)){n=this.seen[e];do n++,r=e+"-"+n;while(this.seen.hasOwnProperty(r))}return t||(this.seen[e]=n,this.seen[r]=0),r}slug(e,t={}){const r=this.serialize(e);return this.getNextSafeSlug(r,t.dryrun)}}class Rk{constructor(e){this.options=e||S7,this.options.renderer=this.options.renderer||new pZe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new WJt,this.slugger=new qJt}static parse(e,t){return new Rk(t).parse(e)}static parseInline(e,t){return new Rk(t).parseInline(e)}parse(e,t=!0){let r="",n,s,o,a,l,u,c,h,p,m,v,w,S,I,R,L,k,B,$;const V=e.length;for(n=0;n0&&R.tokens[0].type==="paragraph"?(R.tokens[0].text=B+" "+R.tokens[0].text,R.tokens[0].tokens&&R.tokens[0].tokens.length>0&&R.tokens[0].tokens[0].type==="text"&&(R.tokens[0].tokens[0].text=B+" "+R.tokens[0].tokens[0].text)):R.tokens.unshift({type:"text",text:B}):I+=B),I+=this.parse(R.tokens,S),p+=this.renderer.listitem(I,k,L);r+=this.renderer.list(p,v,w);continue}case"html":{r+=this.renderer.html(m.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(m.tokens));continue}case"text":{for(p=m.tokens?this.parseInline(m.tokens):m.text;n+1{if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,i){const n="

An error occurred:

"+mv(r.message+"",!0)+"
";if(e)return Promise.resolve(n);if(t){t(null,n);return}return n}if(e)return Promise.reject(r);if(t){t(r);return}throw r}}function YJt(i,e){return(t,r,n)=>{typeof r=="function"&&(n=r,r=null);const s={...r};r={...Lo.defaults,...s};const o=bOn(r.silent,r.async,n);if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(yOn(r),r.hooks&&(r.hooks.options=r),n){const a=r.highlight;let l;try{r.hooks&&(t=r.hooks.preprocess(t)),l=i(t,r)}catch(h){return o(h)}const u=function(h){let p;if(!h)try{r.walkTokens&&Lo.walkTokens(l,r.walkTokens),p=e(l,r),r.hooks&&(p=r.hooks.postprocess(p))}catch(m){h=m}return r.highlight=a,h?o(h):n(null,p)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;Lo.walkTokens(l,function(h){h.type==="code"&&(c++,setTimeout(()=>{a(h.text,h.lang,function(p,m){if(p)return u(p);m!=null&&m!==h.text&&(h.text=m,h.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(a=>i(a,r)).then(a=>r.walkTokens?Promise.all(Lo.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>e(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));const a=i(t,r);r.walkTokens&&Lo.walkTokens(a,r.walkTokens);let l=e(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return o(a)}}}function Lo(i,e,t){return YJt(Pk.lex,Rk.parse)(i,e,t)}Lo.options=Lo.setOptions=function(i){return Lo.defaults={...Lo.defaults,...i},nOn(Lo.defaults),Lo};Lo.getDefaults=UJt;Lo.defaults=S7;Lo.use=function(...i){const e=Lo.defaults.extensions||{renderers:{},childTokens:{}};i.forEach(t=>{const r={...t};if(r.async=Lo.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const s=e.renderers[n.name];s?e.renderers[n.name]=function(...o){let a=n.renderer.apply(this,o);return a===!1&&(a=s.apply(this,o)),a}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){const n=Lo.defaults.renderer||new pZe;for(const s in t.renderer){const o=n[s];n[s]=(...a)=>{let l=t.renderer[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.renderer=n}if(t.tokenizer){const n=Lo.defaults.tokenizer||new dZe;for(const s in t.tokenizer){const o=n[s];n[s]=(...a)=>{let l=t.tokenizer[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.tokenizer=n}if(t.hooks){const n=Lo.defaults.hooks||new ije;for(const s in t.hooks){const o=n[s];ije.passThroughHooks.has(s)?n[s]=a=>{if(Lo.defaults.async)return Promise.resolve(t.hooks[s].call(n,a)).then(u=>o.call(n,u));const l=t.hooks[s].call(n,a);return o.call(n,l)}:n[s]=(...a)=>{let l=t.hooks[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.hooks=n}if(t.walkTokens){const n=Lo.defaults.walkTokens;r.walkTokens=function(s){let o=[];return o.push(t.walkTokens.call(this,s)),n&&(o=o.concat(n.call(this,s))),o}}Lo.setOptions(r)})};Lo.walkTokens=function(i,e){let t=[];for(const r of i)switch(t=t.concat(e.call(Lo,r)),r.type){case"table":{for(const n of r.header)t=t.concat(Lo.walkTokens(n.tokens,e));for(const n of r.rows)for(const s of n)t=t.concat(Lo.walkTokens(s.tokens,e));break}case"list":{t=t.concat(Lo.walkTokens(r.items,e));break}default:Lo.defaults.extensions&&Lo.defaults.extensions.childTokens&&Lo.defaults.extensions.childTokens[r.type]?Lo.defaults.extensions.childTokens[r.type].forEach(function(n){t=t.concat(Lo.walkTokens(r[n],e))}):r.tokens&&(t=t.concat(Lo.walkTokens(r.tokens,e)))}return t};Lo.parseInline=YJt(Pk.lexInline,Rk.parseInline);Lo.Parser=Rk;Lo.parser=Rk.parse;Lo.Renderer=pZe;Lo.TextRenderer=WJt;Lo.Lexer=Pk;Lo.lexer=Pk.lex;Lo.Tokenizer=dZe;Lo.Slugger=qJt;Lo.Hooks=ije;Lo.parse=Lo;Lo.options;Lo.setOptions;Lo.use;Lo.walkTokens;Lo.parseInline;Rk.parse;Pk.lex;const wOn={class:"h-26 mb-8 mx-8"},xOn=["placeholder","aria-label"],SOn={key:0},XJt=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const e=eo("iApi"),t=_Te(),{t:r}=Qn(),n=Hr(()=>t.location),s=vi([]),o=vi([]),a=vi([]),l=vi(!1);let u,c;function h(w,S){const I=S.info.split(/(<[^>]*>)/);for(const[R,L]of I.entries())if(R%2===0&&L.toLowerCase().indexOf(w.toLowerCase())>-1)return!0;return!1}function p(w,S){const R=o.value[S].split(/(<[^>]*>)/);let L="";for(const[k,B]of R.entries())k%2===0?L+=B.replace(new RegExp(w,"gi"),$=>`${$}`):L+=B;s.value[S].info=L}function m(w,S){u=0,S.forEach((I,R)=>{I.info=o.value[R],I.drawn=h(w,I)||I.header.toLowerCase().indexOf(w.toLowerCase())>-1,u=I.drawn?u+1:u,I.expanded=I.drawn&&w.length>2,I.drawn&&w.length>2&&p(w,R)}),l.value=u===0}function v(w){w.expanded=!w.expanded}return E0(()=>{a.value.push(rl(()=>e.language,(w,S)=>{if(w===S)return;const I=new Lo.Renderer,R=n.value.slice(-1)==="/"?n.value:`${n.value}/`;I.image=(L,k,B)=>(L.indexOf("http")===-1&&(L=`${R}images/`+L),`${B}`),bP.get(`${R}${w}.md`).then(L=>{const k=/^#\s(.*)\n{2}(?:.+|\n(?!\n{2,}))*/gm;let B=L.data.replace(new RegExp("\r","g"),"");s.value=[];let $;for(;$=k.exec(B);)s.value.push({header:$[1],info:Lo($[0].split(` +`+(m.tokens?this.parseInline(m.tokens):m.text);r+=t?this.renderer.paragraph(p):p;continue}default:{const Y='Token with "'+m.type+'" type was not found.';if(this.options.silent){console.error(Y);return}else throw new Error(Y)}}}return r}parseInline(e,t){t=t||this.renderer;let r="",n,s,o;const a=e.length;for(n=0;n{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,i){const n="

An error occurred:

"+mv(r.message+"",!0)+"
";if(e)return Promise.resolve(n);if(t){t(null,n);return}return n}if(e)return Promise.reject(r);if(t){t(r);return}throw r}}function YJt(i,e){return(t,r,n)=>{typeof r=="function"&&(n=r,r=null);const s={...r};r={...Lo.defaults,...s};const o=yOn(r.silent,r.async,n);if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(fOn(r),r.hooks&&(r.hooks.options=r),n){const a=r.highlight;let l;try{r.hooks&&(t=r.hooks.preprocess(t)),l=i(t,r)}catch(h){return o(h)}const u=function(h){let p;if(!h)try{r.walkTokens&&Lo.walkTokens(l,r.walkTokens),p=e(l,r),r.hooks&&(p=r.hooks.postprocess(p))}catch(m){h=m}return r.highlight=a,h?o(h):n(null,p)};if(!a||a.length<3||(delete r.highlight,!l.length))return u();let c=0;Lo.walkTokens(l,function(h){h.type==="code"&&(c++,setTimeout(()=>{a(h.text,h.lang,function(p,m){if(p)return u(p);m!=null&&m!==h.text&&(h.text=m,h.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(a=>i(a,r)).then(a=>r.walkTokens?Promise.all(Lo.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>e(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));const a=i(t,r);r.walkTokens&&Lo.walkTokens(a,r.walkTokens);let l=e(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return o(a)}}}function Lo(i,e,t){return YJt(Pk.lex,Rk.parse)(i,e,t)}Lo.options=Lo.setOptions=function(i){return Lo.defaults={...Lo.defaults,...i},tOn(Lo.defaults),Lo};Lo.getDefaults=UJt;Lo.defaults=S7;Lo.use=function(...i){const e=Lo.defaults.extensions||{renderers:{},childTokens:{}};i.forEach(t=>{const r={...t};if(r.async=Lo.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if(n.renderer){const s=e.renderers[n.name];s?e.renderers[n.name]=function(...o){let a=n.renderer.apply(this,o);return a===!1&&(a=s.apply(this,o)),a}:e.renderers[n.name]=n.renderer}if(n.tokenizer){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[n.level]?e[n.level].unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){const n=Lo.defaults.renderer||new pZe;for(const s in t.renderer){const o=n[s];n[s]=(...a)=>{let l=t.renderer[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.renderer=n}if(t.tokenizer){const n=Lo.defaults.tokenizer||new dZe;for(const s in t.tokenizer){const o=n[s];n[s]=(...a)=>{let l=t.tokenizer[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.tokenizer=n}if(t.hooks){const n=Lo.defaults.hooks||new ije;for(const s in t.hooks){const o=n[s];ije.passThroughHooks.has(s)?n[s]=a=>{if(Lo.defaults.async)return Promise.resolve(t.hooks[s].call(n,a)).then(u=>o.call(n,u));const l=t.hooks[s].call(n,a);return o.call(n,l)}:n[s]=(...a)=>{let l=t.hooks[s].apply(n,a);return l===!1&&(l=o.apply(n,a)),l}}r.hooks=n}if(t.walkTokens){const n=Lo.defaults.walkTokens;r.walkTokens=function(s){let o=[];return o.push(t.walkTokens.call(this,s)),n&&(o=o.concat(n.call(this,s))),o}}Lo.setOptions(r)})};Lo.walkTokens=function(i,e){let t=[];for(const r of i)switch(t=t.concat(e.call(Lo,r)),r.type){case"table":{for(const n of r.header)t=t.concat(Lo.walkTokens(n.tokens,e));for(const n of r.rows)for(const s of n)t=t.concat(Lo.walkTokens(s.tokens,e));break}case"list":{t=t.concat(Lo.walkTokens(r.items,e));break}default:Lo.defaults.extensions&&Lo.defaults.extensions.childTokens&&Lo.defaults.extensions.childTokens[r.type]?Lo.defaults.extensions.childTokens[r.type].forEach(function(n){t=t.concat(Lo.walkTokens(r[n],e))}):r.tokens&&(t=t.concat(Lo.walkTokens(r.tokens,e)))}return t};Lo.parseInline=YJt(Pk.lexInline,Rk.parseInline);Lo.Parser=Rk;Lo.parser=Rk.parse;Lo.Renderer=pZe;Lo.TextRenderer=WJt;Lo.Lexer=Pk;Lo.lexer=Pk.lex;Lo.Tokenizer=dZe;Lo.Slugger=qJt;Lo.Hooks=ije;Lo.parse=Lo;Lo.options;Lo.setOptions;Lo.use;Lo.walkTokens;Lo.parseInline;Rk.parse;Pk.lex;const vOn={class:"h-26 mb-8 mx-8"},_On=["placeholder","aria-label"],bOn={key:0},XJt=Xr({__name:"screen",props:{panel:{type:Object,required:!0}},setup(i){const e=eo("iApi"),t=_Te(),{t:r}=Qn(),n=Hr(()=>t.location),s=vi([]),o=vi([]),a=vi([]),l=vi(!1);let u,c;function h(w,S){const I=S.info.split(/(<[^>]*>)/);for(const[R,L]of I.entries())if(R%2===0&&L.toLowerCase().indexOf(w.toLowerCase())>-1)return!0;return!1}function p(w,S){const R=o.value[S].split(/(<[^>]*>)/);let L="";for(const[k,B]of R.entries())k%2===0?L+=B.replace(new RegExp(w,"gi"),$=>`${$}`):L+=B;s.value[S].info=L}function m(w,S){u=0,S.forEach((I,R)=>{I.info=o.value[R],I.drawn=h(w,I)||I.header.toLowerCase().indexOf(w.toLowerCase())>-1,u=I.drawn?u+1:u,I.expanded=I.drawn&&w.length>2,I.drawn&&w.length>2&&p(w,R)}),l.value=u===0}function v(w){w.expanded=!w.expanded}return E0(()=>{a.value.push(rl(()=>e.language,(w,S)=>{if(w===S)return;const I=new Lo.Renderer,R=n.value.slice(-1)==="/"?n.value:`${n.value}/`;I.image=(L,k,B)=>(L.indexOf("http")===-1&&(L=`${R}images/`+L),`${B}`),bP.get(`${R}${w}.md`).then(L=>{const k=/^#\s(.*)\n{2}(?:.+|\n(?!\n{2,}))*/gm;let B=L.data.replace(new RegExp("\r","g"),"");s.value=[];let $;for(;$=k.exec(B);)s.value.push({header:$[1],info:Lo($[0].split(` `).splice(2).join(` `),{renderer:I}),drawn:!0,expanded:!1}),o.value.push(Lo($[0].split(` `).splice(2).join(` -`),{renderer:I}))})},{immediate:!0}))}),Ka(()=>{a.value.forEach(w=>w())}),(w,S)=>{const I=Ko("panel-screen");return qt(),Dn(I,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(r)("help.title")),1)]),content:Rn(()=>[Ot("div",wOn,[Ur(Ot("input",{type:"search",class:"rv-help-search-bar border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",placeholder:ri(r)("help.search"),"onUpdate:modelValue":S[0]||(S[0]=R=>Wu(c)?c.value=R:c=R),"aria-label":ri(r)("help.search"),onInput:S[1]||(S[1]=R=>m(ri(c),s.value)),onKeypress:S[2]||(S[2]=Ph(ia(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,40,xOn),[[LS,ri(c)]])]),l.value?(qt(),si("div",SOn,[Ot("p",null,br(ri(r)("help.noResults")),1)])):Yr("",!0),(qt(!0),si(Ks,null,hu(s.value,(R,L)=>(qt(),Dn(rOn,{helpSection:R,key:L,onExpand:k=>v(R)},null,8,["helpSection","onExpand"]))),128))]),_:1},8,["panel"])}}}),TOn=Object.freeze(Object.defineProperty({__proto__:null,default:XJt},Symbol.toStringTag,{value:"Module"})),COn=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1),EOn=Xr({__name:"nav-button",setup(i){const e=eo("iApi"),{t}=Qn(),r=()=>e.event.emit(ln.HELP_TOGGLE);return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(t)("help.title")},{default:Rn(()=>[COn]),_:1},8,["tooltip"])}}}),IOn={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class AOn extends YMn{added(){this.$iApi.component("help-nav-button",EOn),this.$iApi.panel.register({help:{screens:{"help-screen":Da(XJt)},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:IOn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("help"),_Te(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}const MOn=Object.freeze(Object.defineProperty({__proto__:null,default:AOn},Symbol.toStringTag,{value:"Module"}));class rje extends tf{config={};mode=k8.NONE;constructor(e,t){super(t),this.config=e,this.mode=e.mode}async add(e){this.notImplementedError("addGraphics")}async remove(e){this.notImplementedError("removeGraphics")}async reloadHilight(e){this.notImplementedError("reloadHilight")}async getHilightLayer(){const e=await this.layerFetcher();if(e){if(e.isLoaded&&e instanceof W6t)return e;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(e){console.warn(`Hilight mode method ${e} was not implemented by subclass.`)}layerFetcher(){const e=this.$iApi.geo.layer.getLayer(Coe);return e?Promise.resolve(e):new Promise(t=>{let r=0;const n=setInterval(()=>{const s=this.$iApi.geo.layer.getLayer(Coe);if(s)clearInterval(n),t(s);else if(r+=125,r>=1125){clearInterval(n),t(void 0);return}},125)})}}class fZe extends rje{async add(e){const t=await this.getHilightLayer();t&&await t.addGraphic(e)}async remove(e){const t=await this.getHilightLayer();t&&t.removeGraphic(e)}async reloadHilight(e){await this.remove(e),await this.add(e)}}class OOn extends fZe{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(e,t){super(e,t),this.onOpacity=e.options?.onOpacity??.75,this.offOpacity=e.options?.offOpacity>.02?e.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(ln.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(ln.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(r=>{r&&r.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const e=bm(this.$vApp.$pinia).activeBasemapConfig;try{const t=this.$iApi.geo.layer.createLayer({id:CRe,layerType:pn.TILE,cosmetic:!0,url:e.layers[0].url});await this.$iApi.geo.map.addLayer(t),t.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(CRe),await this.hilightSetup()}async reorderFogLayer(){const e=this.getFogLayer(),t=await this.getHilightLayer();if(!t||!e)return;const r=this.$iApi.geo.layer.layerOrderIds(),n=r.indexOf(e.id),s=r.indexOf(t.id);s-1&&n>-1&&this.$iApi.geo.map.reorder(t,n,!1)}async add(e){this.lastAdd=Date.now();const t=this.getFogLayer();t&&(t.opacity=this.onOpacity,await super.add(e))}async remove(e){await super.remove(e);const t=this.getFogLayer();if(!t)return;const r=Date.now(),n=await this.getHilightLayer();n&&setTimeout(()=>{this.lastAdd{this.hilightSetup(e)}))}hilightSetup(e){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=e.options})}async add(e){await super.add(e);const t=this.$iApi.geo.layer.getLayer(Coe);if(t&&t.esriLayer&&t.isLoaded&&t instanceof q6t){const r=e instanceof Array?e:[e];this.$iApi.geo.map.esriView?.whenLayerView(t.esriLayer)?.then(function(n){n.highlight(r.map(s=>t.getEsriGraphic(s.id)))})}}async remove(e){await super.remove(e)}}class POn extends Yu{hilightMode=new rje({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(e){if(e)switch(e.mode){case k8.NONE:this.hilightMode=new rje(e,this.$iApi);break;case k8.GLOW:this.hilightMode=new S_t(e,this.$iApi);break;case k8.LIFT:this.hilightMode=new fZe(e,this.$iApi);break;case k8.FOG:this.hilightMode=new OOn(e,this.$iApi);break;default:console.error("Could not find hilight mode:",e.mode);break}else this.hilightMode=new S_t(oTn,this.$iApi)}async initHilightLayer(){const e=this.$iApi.geo.layer.createLayer({id:Coe,layerType:pn.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(e)}async addHilight(e){const t=e instanceof Array?e:[e];await this.hilightMode.add(t)}async removeHilight(e){const t=e?e instanceof Array?e:[e]:void 0;await this.hilightMode.remove(t)}async reloadHilight(e){const t=e instanceof Array?e:[e];await this.hilightMode.reloadHilight(t)}async getGraphicsByKey(e,t,r){const n=await this.getHilightLayer();if(!n)return[];let s=n.graphics.map(o=>({...this.deconstructGraphicKey(o.id),og:o}));return e&&(s=s.filter(o=>o.origin===e)),t&&(s=s.filter(o=>o.uid===t)),r&&(s=s.filter(o=>o.oid===r)),s.map(o=>o.og)}constructGraphicKey(e,t,r){return`${Coe}~${e}~${t}~${r}`}deconstructGraphicKey(e){const t=e.split("~");return t.length!==4&&console.warn("Malformed Hilight Graphic key provided:",e),{origin:t[1],uid:t[2],oid:parseInt(t[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class ROn extends POn{async added(){this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e()}}}const DOn=Object.freeze(Object.defineProperty({__proto__:null,default:ROn},Symbol.toStringTag,{value:"Module"})),JJt=i=>(Dc("data-v-fd14520e"),i=i(),Fc(),i),FOn=["content","aria-label"],kOn=JJt(()=>Ot("svg",{class:"fill-current w-20 h-20",viewBox:"0 0 23 21"},[Ot("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})],-1)),LOn=[kOn],NOn=["disabled","aria-label"],$On=JJt(()=>Ot("svg",{class:"fill-current w-20 h-20",viewBox:"0 0 23 21"},[Ot("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})],-1)),BOn=[$On],jOn=Xr({__name:"reorder-button",props:{disabled:{type:Boolean},direction:{type:String,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy"),s=Nn("focus-item");return i.disabled?(qt(),si("button",{key:1,type:"button",class:Wn(`pb-10 text-gray-300 p-8 ${i.direction==="up"?"rotate-180":""}`),disabled:i.disabled,"aria-label":ri(e)(`layer-reorder.move.${i.direction}`)},BOn,10,NOn)):Ur((qt(),si("button",{key:0,type:"button",class:Wn(`pb-10 text-gray-500 hover:text-black p-8 ${i.direction==="up"?"rotate-180":""}`),content:ri(e)(`layer-reorder.move.${i.direction}`),"aria-label":ri(e)(`layer-reorder.move.${i.direction}`)},LOn,10,FOn)),[[n,{placement:"top-start",aria:"describedby"}],[s]])}}}),T_t=ml(jOn,[["__scopeId","data-v-fd14520e"]]);var KJt={exports:{}};const mZe=wSe(vIr);/**! +`),{renderer:I}))})},{immediate:!0}))}),Ka(()=>{a.value.forEach(w=>w())}),(w,S)=>{const I=Ko("panel-screen");return qt(),Dn(I,{panel:i.panel},{header:Rn(()=>[Xs(br(ri(r)("help.title")),1)]),content:Rn(()=>[Ot("div",vOn,[Ur(Ot("input",{type:"search",class:"rv-help-search-bar border-b w-full text-base py-8 outline-none focus:shadow-outline border-gray-600 h-full min-w-0",placeholder:ri(r)("help.search"),"onUpdate:modelValue":S[0]||(S[0]=R=>Wu(c)?c.value=R:c=R),"aria-label":ri(r)("help.search"),onInput:S[1]||(S[1]=R=>m(ri(c),s.value)),onKeypress:S[2]||(S[2]=Ph(ia(()=>{},["prevent"]),["enter"])),enterkeyhint:"done"},null,40,_On),[[LS,ri(c)]])]),l.value?(qt(),si("div",bOn,[Ot("p",null,br(ri(r)("help.noResults")),1)])):Yr("",!0),(qt(!0),si(Ks,null,hu(s.value,(R,L)=>(qt(),Dn(eOn,{helpSection:R,key:L,onExpand:k=>v(R)},null,8,["helpSection","onExpand"]))),128))]),_:1},8,["panel"])}}}),wOn=Object.freeze(Object.defineProperty({__proto__:null,default:XJt},Symbol.toStringTag,{value:"Module"})),xOn=Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[Ot("path",{d:"M0 0h24v24H0z",fill:"none"}),Ot("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1),SOn=Xr({__name:"nav-button",setup(i){const e=eo("iApi"),{t}=Qn(),r=()=>e.event.emit(ln.HELP_TOGGLE);return(n,s)=>{const o=Ko("mapnav-button");return qt(),Dn(o,{onClickFunction:r,tooltip:ri(t)("help.title")},{default:Rn(()=>[xOn]),_:1},8,["tooltip"])}}}),TOn={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class COn extends HMn{added(){this.$iApi.component("help-nav-button",SOn),this.$iApi.panel.register({help:{screens:{"help-screen":Da(XJt)},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:TOn}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&oL(this.$vApp.$pinia).removeItem("help"),_Te(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}const EOn=Object.freeze(Object.defineProperty({__proto__:null,default:COn},Symbol.toStringTag,{value:"Module"}));class rje extends tf{config={};mode=k8.NONE;constructor(e,t){super(t),this.config=e,this.mode=e.mode}async add(e){this.notImplementedError("addGraphics")}async remove(e){this.notImplementedError("removeGraphics")}async reloadHilight(e){this.notImplementedError("reloadHilight")}async getHilightLayer(){const e=await this.layerFetcher();if(e){if(e.isLoaded&&e instanceof W6t)return e;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(e){console.warn(`Hilight mode method ${e} was not implemented by subclass.`)}layerFetcher(){const e=this.$iApi.geo.layer.getLayer(Coe);return e?Promise.resolve(e):new Promise(t=>{let r=0;const n=setInterval(()=>{const s=this.$iApi.geo.layer.getLayer(Coe);if(s)clearInterval(n),t(s);else if(r+=125,r>=1125){clearInterval(n),t(void 0);return}},125)})}}class fZe extends rje{async add(e){const t=await this.getHilightLayer();t&&await t.addGraphic(e)}async remove(e){const t=await this.getHilightLayer();t&&t.removeGraphic(e)}async reloadHilight(e){await this.remove(e),await this.add(e)}}class IOn extends fZe{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(e,t){super(e,t),this.onOpacity=e.options?.onOpacity??.75,this.offOpacity=e.options?.offOpacity>.02?e.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(ln.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(ln.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(r=>{r&&r.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const e=bm(this.$vApp.$pinia).activeBasemapConfig;try{const t=this.$iApi.geo.layer.createLayer({id:CRe,layerType:pn.TILE,cosmetic:!0,url:e.layers[0].url});await this.$iApi.geo.map.addLayer(t),t.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(CRe),await this.hilightSetup()}async reorderFogLayer(){const e=this.getFogLayer(),t=await this.getHilightLayer();if(!t||!e)return;const r=this.$iApi.geo.layer.layerOrderIds(),n=r.indexOf(e.id),s=r.indexOf(t.id);s-1&&n>-1&&this.$iApi.geo.map.reorder(t,n,!1)}async add(e){this.lastAdd=Date.now();const t=this.getFogLayer();t&&(t.opacity=this.onOpacity,await super.add(e))}async remove(e){await super.remove(e);const t=this.getFogLayer();if(!t)return;const r=Date.now(),n=await this.getHilightLayer();n&&setTimeout(()=>{this.lastAdd{this.hilightSetup(e)}))}hilightSetup(e){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=e.options})}async add(e){await super.add(e);const t=this.$iApi.geo.layer.getLayer(Coe);if(t&&t.esriLayer&&t.isLoaded&&t instanceof q6t){const r=e instanceof Array?e:[e];this.$iApi.geo.map.esriView?.whenLayerView(t.esriLayer)?.then(function(n){n.highlight(r.map(s=>t.getEsriGraphic(s.id)))})}}async remove(e){await super.remove(e)}}class AOn extends Yu{hilightMode=new rje({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(e){if(e)switch(e.mode){case k8.NONE:this.hilightMode=new rje(e,this.$iApi);break;case k8.GLOW:this.hilightMode=new S_t(e,this.$iApi);break;case k8.LIFT:this.hilightMode=new fZe(e,this.$iApi);break;case k8.FOG:this.hilightMode=new IOn(e,this.$iApi);break;default:console.error("Could not find hilight mode:",e.mode);break}else this.hilightMode=new S_t(rTn,this.$iApi)}async initHilightLayer(){const e=this.$iApi.geo.layer.createLayer({id:Coe,layerType:pn.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(e)}async addHilight(e){const t=e instanceof Array?e:[e];await this.hilightMode.add(t)}async removeHilight(e){const t=e?e instanceof Array?e:[e]:void 0;await this.hilightMode.remove(t)}async reloadHilight(e){const t=e instanceof Array?e:[e];await this.hilightMode.reloadHilight(t)}async getGraphicsByKey(e,t,r){const n=await this.getHilightLayer();if(!n)return[];let s=n.graphics.map(o=>({...this.deconstructGraphicKey(o.id),og:o}));return e&&(s=s.filter(o=>o.origin===e)),t&&(s=s.filter(o=>o.uid===t)),r&&(s=s.filter(o=>o.oid===r)),s.map(o=>o.og)}constructGraphicKey(e,t,r){return`${Coe}~${e}~${t}~${r}`}deconstructGraphicKey(e){const t=e.split("~");return t.length!==4&&console.warn("Malformed Hilight Graphic key provided:",e),{origin:t[1],uid:t[2],oid:parseInt(t[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class MOn extends AOn{async added(){this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e()}}}const OOn=Object.freeze(Object.defineProperty({__proto__:null,default:MOn},Symbol.toStringTag,{value:"Module"})),JJt=i=>(Dc("data-v-fd14520e"),i=i(),Fc(),i),POn=["content","aria-label"],ROn=JJt(()=>Ot("svg",{class:"fill-current w-20 h-20",viewBox:"0 0 23 21"},[Ot("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})],-1)),DOn=[ROn],FOn=["disabled","aria-label"],kOn=JJt(()=>Ot("svg",{class:"fill-current w-20 h-20",viewBox:"0 0 23 21"},[Ot("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})],-1)),LOn=[kOn],NOn=Xr({__name:"reorder-button",props:{disabled:{type:Boolean},direction:{type:String,required:!0}},setup(i){const{t:e}=Qn();return(t,r)=>{const n=Nn("tippy"),s=Nn("focus-item");return i.disabled?(qt(),si("button",{key:1,type:"button",class:Wn(`pb-10 text-gray-300 p-8 ${i.direction==="up"?"rotate-180":""}`),disabled:i.disabled,"aria-label":ri(e)(`layer-reorder.move.${i.direction}`)},LOn,10,FOn)):Ur((qt(),si("button",{key:0,type:"button",class:Wn(`pb-10 text-gray-500 hover:text-black p-8 ${i.direction==="up"?"rotate-180":""}`),content:ri(e)(`layer-reorder.move.${i.direction}`),"aria-label":ri(e)(`layer-reorder.move.${i.direction}`)},DOn,10,POn)),[[n,{placement:"top-start",aria:"describedby"}],[s]])}}}),T_t=ml(NOn,[["__scopeId","data-v-fd14520e"]]);var KJt={exports:{}};const mZe=wSe(mIr);/**! * Sortable 1.14.0 * @author RubaXa * @author owenm * @license MIT - */function C_t(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function D3(i){for(var e=1;e=0)&&(t[n]=i[n]);return t}function zOn(i,e){if(i==null)return{};var t=UOn(i,e),r,n;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(i,r)&&(t[r]=i[r])}return t}function VOn(i){return HOn(i)||WOn(i)||qOn(i)||YOn()}function HOn(i){if(Array.isArray(i))return nje(i)}function WOn(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function qOn(i,e){if(i){if(typeof i=="string")return nje(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nje(i,e)}}function nje(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function KOn(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function _C(i,e,t,r){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&Awe(i,e):Awe(i,e))||r&&i===t)return i;if(i===t)break}while(i=KOn(i))}return null}var I_t=/\s+/g;function cp(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var r=(" "+i.className+" ").replace(I_t," ").replace(" "+e+" "," ");i.className=(r+(t?" "+e:"")).replace(I_t," ")}}function ro(i,e,t){var r=i&&i.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function x9(i,e){var t="";if(typeof i=="string")t=i;else do{var r=ro(i,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(i=i.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(t)}function eKt(i,e,t){if(i){var r=i.getElementsByTagName(e),n=0,s=r.length;if(t)for(;n=s,!o)return r;if(r===e3())break;r=dF(r,!1)}return!1}function Vq(i,e,t,r){for(var n=0,s=0,o=i.children;s2&&arguments[2]!==void 0?arguments[2]:{},n=r.evt,s=zOn(r,nPn);Kle.pluginEvent.bind(ga)(e,t,D3({dragEl:ts,parentEl:Dp,ghostEl:vl,rootEl:Ld,nextEl:n6,lastDownEl:s0e,cloneEl:Np,cloneHidden:q5,dragStarted:Ate,putSortable:Ny,activeSortable:ga.active,originalEvent:n,oldIndex:bV,oldDraggableIndex:kre,newIndex:Bw,newDraggableIndex:I5,hideGhostForTarget:oKt,unhideGhostForTarget:aKt,cloneNowHidden:function(){q5=!0},cloneNowShown:function(){q5=!1},dispatchSortableEvent:function(a){y1({sortable:t,name:a,originalEvent:n})}},s))};function y1(i){Ite(D3({putSortable:Ny,cloneEl:Np,targetEl:ts,rootEl:Ld,oldIndex:bV,oldDraggableIndex:kre,newIndex:Bw,newDraggableIndex:I5},i))}var ts,Dp,vl,Ld,n6,s0e,Np,q5,bV,Bw,kre,I5,Fpe,Ny,sz=!1,Mwe=!1,Owe=[],dN,TT,DRe,FRe,P_t,R_t,Ate,aG,Lre,Nre=!1,kpe=!1,o0e,$0,kRe=[],sje=!1,Pwe=[],oEe=typeof document<"u",Lpe=ZJt,D_t=Jle||KR?"cssFloat":"float",sPn=oEe&&!JOn&&!ZJt&&"draggable"in document.createElement("div"),rKt=function(){if(oEe){if(KR)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),nKt=function(e,t){var r=ro(e),n=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),s=Vq(e,0,t),o=Vq(e,1,t),a=s&&ro(s),l=o&&ro(o),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+jd(s).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+jd(o).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&a.float&&a.float!=="none"){var h=a.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===h)?"vertical":"horizontal"}return s&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=n&&r[D_t]==="none"||o&&r[D_t]==="none"&&u+c>n)?"vertical":"horizontal"},oPn=function(e,t,r){var n=r?e.left:e.top,s=r?e.right:e.bottom,o=r?e.width:e.height,a=r?t.left:t.top,l=r?t.right:t.bottom,u=r?t.width:t.height;return n===a||s===l||n+o/2===a+u/2},aPn=function(e,t){var r;return Owe.some(function(n){var s=n[Rv].options.emptyInsertThreshold;if(!(!s||gZe(n))){var o=jd(n),a=e>=o.left-s&&e<=o.right+s,l=t>=o.top-s&&t<=o.bottom+s;if(a&&l)return r=n}}),r},sKt=function(e){function t(s,o){return function(a,l,u,c){var h=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(s==null&&(o||h))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return t(s(a,l,u,c),o)(a,l,u,c);var p=(o?a:l).options.group.name;return s===!0||typeof s=="string"&&s===p||s.join&&s.indexOf(p)>-1}}var r={},n=e.group;(!n||n0e(n)!="object")&&(n={name:n}),r.name=n.name,r.checkPull=t(n.pull,!0),r.checkPut=t(n.put),r.revertClone=n.revertClone,e.group=r},oKt=function(){!rKt&&vl&&ro(vl,"display","none")},aKt=function(){!rKt&&vl&&ro(vl,"display","")};oEe&&document.addEventListener("click",function(i){if(Mwe)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),Mwe=!1,!1},!0);var pN=function(e){if(ts){e=e.touches?e.touches[0]:e;var t=aPn(e.clientX,e.clientY);if(t){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[Rv]._onDragOver(r)}}},lPn=function(e){ts&&ts.parentNode[Rv]._isOutsideThisEl(e.target)};function ga(i,e){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=e=ZS({},e),i[Rv]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return nKt(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,a){o.setData("Text",a.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:ga.supportPointer!==!1&&"PointerEvent"in window&&!Dre,emptyInsertThreshold:5};Kle.initializePlugins(this,i,t);for(var r in t)!(r in e)&&(e[r]=t[r]);sKt(e);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=e.forceFallback?!1:sPn,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Eu(i,"pointerdown",this._onTapStart):(Eu(i,"mousedown",this._onTapStart),Eu(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(Eu(i,"dragover",this),Eu(i,"dragenter",this)),Owe.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ZS(this,tPn())}ga.prototype={constructor:ga,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(aG=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,ts):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,n=this.options,s=n.preventOnFilter,o=e.type,a=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(a||e).target,u=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=n.filter;if(gPn(r),!ts&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||n.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Dre&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=_C(l,n.draggable,r,!1),!(l&&l.animated)&&s0e!==l)){if(bV=Gp(l),kre=Gp(l,n.draggable),typeof c=="function"){if(c.call(this,e,l,this)){y1({sortable:t,rootEl:u,name:"filter",targetEl:l,toEl:r,fromEl:r}),P_("filter",t,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=_C(u,h.trim(),r,!1),h)return y1({sortable:t,rootEl:h,name:"filter",targetEl:l,fromEl:r,toEl:r}),P_("filter",t,{evt:e}),!0}),c)){s&&e.cancelable&&e.preventDefault();return}n.handle&&!_C(u,n.handle,r,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,r){var n=this,s=n.el,o=n.options,a=s.ownerDocument,l;if(r&&!ts&&r.parentNode===s){var u=jd(r);if(Ld=s,ts=r,Dp=ts.parentNode,n6=ts.nextSibling,s0e=r,Fpe=o.group,ga.dragged=ts,dN={target:ts,clientX:(t||e).clientX,clientY:(t||e).clientY},P_t=dN.clientX-u.left,R_t=dN.clientY-u.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,ts.style["will-change"]="all",l=function(){if(P_("delayEnded",n,{evt:e}),ga.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!E_t&&n.nativeDraggable&&(ts.draggable=!0),n._triggerDragStart(e,t),y1({sortable:n,name:"choose",originalEvent:e}),cp(ts,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){eKt(ts,c.trim(),LRe)}),Eu(a,"dragover",pN),Eu(a,"mousemove",pN),Eu(a,"touchmove",pN),Eu(a,"mouseup",n._onDrop),Eu(a,"touchend",n._onDrop),Eu(a,"touchcancel",n._onDrop),E_t&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ts.draggable=!0),P_("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Jle||KR))){if(ga.eventCanceled){this._onDrop();return}Eu(a,"mouseup",n._disableDelayedDrag),Eu(a,"touchend",n._disableDelayedDrag),Eu(a,"touchcancel",n._disableDelayedDrag),Eu(a,"mousemove",n._delayedDragTouchMoveHandler),Eu(a,"touchmove",n._delayedDragTouchMoveHandler),o.supportPointer&&Eu(a,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(l,o.delay)}else l()}},_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(){ts&&LRe(ts),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;su(e,"mouseup",this._disableDelayedDrag),su(e,"touchend",this._disableDelayedDrag),su(e,"touchcancel",this._disableDelayedDrag),su(e,"mousemove",this._delayedDragTouchMoveHandler),su(e,"touchmove",this._delayedDragTouchMoveHandler),su(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Eu(document,"pointermove",this._onTouchMove):t?Eu(document,"touchmove",this._onTouchMove):Eu(document,"mousemove",this._onTouchMove):(Eu(ts,"dragend",this),Eu(Ld,"dragstart",this._onDragStart));try{document.selection?a0e(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(sz=!1,Ld&&ts){P_("dragStarted",this,{evt:t}),this.nativeDraggable&&Eu(document,"dragover",lPn);var r=this.options;!e&&cp(ts,r.dragClass,!1),cp(ts,r.ghostClass,!0),ga.active=this,e&&this._appendGhost(),y1({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(TT){this._lastX=TT.clientX,this._lastY=TT.clientY,oKt();for(var e=document.elementFromPoint(TT.clientX,TT.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(TT.clientX,TT.clientY),e!==t);)t=e;if(ts.parentNode[Rv]._isOutsideThisEl(e),t)do{if(t[Rv]){var r=void 0;if(r=t[Rv]._onDragOver({clientX:TT.clientX,clientY:TT.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);aKt()}},_onTouchMove:function(e){if(dN){var t=this.options,r=t.fallbackTolerance,n=t.fallbackOffset,s=e.touches?e.touches[0]:e,o=vl&&x9(vl,!0),a=vl&&o&&o.a,l=vl&&o&&o.d,u=Lpe&&$0&&M_t($0),c=(s.clientX-dN.clientX+n.x)/(a||1)+(u?u[0]-kRe[0]:0)/(a||1),h=(s.clientY-dN.clientY+n.y)/(l||1)+(u?u[1]-kRe[1]:0)/(l||1);if(!ga.active&&!sz){if(r&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(y1({rootEl:Dp,name:"add",toEl:Dp,fromEl:Ld,originalEvent:e}),y1({sortable:this,name:"remove",toEl:Dp,originalEvent:e}),y1({rootEl:Dp,name:"sort",toEl:Dp,fromEl:Ld,originalEvent:e}),y1({sortable:this,name:"sort",toEl:Dp,originalEvent:e})),Ny&&Ny.save()):Bw!==bV&&Bw>=0&&(y1({sortable:this,name:"update",toEl:Dp,originalEvent:e}),y1({sortable:this,name:"sort",toEl:Dp,originalEvent:e})),ga.active&&((Bw==null||Bw===-1)&&(Bw=bV,I5=kre),y1({sortable:this,name:"end",toEl:Dp,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){P_("nulling",this),Ld=ts=Dp=vl=n6=Np=s0e=q5=dN=TT=Ate=Bw=I5=bV=kre=aG=Lre=Ny=Fpe=ga.dragged=ga.ghost=ga.clone=ga.active=null,Pwe.forEach(function(e){e.checked=!0}),Pwe.length=DRe=FRe=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":ts&&(this._onDragOver(e),uPn(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,n=0,s=r.length,o=this.options;nr.right+n||i.clientX<=r.right&&i.clientY>r.bottom&&i.clientX>=r.left:i.clientX>r.right&&i.clientY>r.top||i.clientX<=r.right&&i.clientY>r.bottom+n}function pPn(i,e,t,r,n,s,o,a){var l=r?i.clientY:i.clientX,u=r?t.height:t.width,c=r?t.top:t.left,h=r?t.bottom:t.right,p=!1;if(!o){if(a&&o0ec+u*s/2:lh-o0e)return-Lre}else if(l>c+u*(1-n)/2&&lh-u*s/2)?l>c+u/2?1:-1:0}function fPn(i){return Gp(ts)1&&(el.forEach(function(a){s.addAnimationState({target:a,rect:R_?jd(a):o}),PRe(a),a.fromRect=o,r.removeAnimationState(a)}),R_=!1,wPn(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var r=t.sortable,n=t.isOwner,s=t.insertion,o=t.activeSortable,a=t.parentEl,l=t.putSortable,u=this.options;if(s){if(n&&o._hideClone(),qK=!1,u.animation&&el.length>1&&(R_||!n&&!o.options.sort&&!l)){var c=jd(jh,!1,!0,!0);el.forEach(function(p){p!==jh&&(O_t(p,c),a.appendChild(p))}),R_=!0}if(!n)if(R_||Bpe(),el.length>1){var h=$pe;o._showClone(r),o.options.animation&&!$pe&&h&&Ow.forEach(function(p){o.addAnimationState({target:p,rect:YK}),p.fromRect=YK,p.thisAnimationDuration=null})}else o._showClone(r)}},dragOverAnimationCapture:function(t){var r=t.dragRect,n=t.isOwner,s=t.activeSortable;if(el.forEach(function(a){a.thisAnimationDuration=null}),s.options.animation&&!n&&s.multiDrag.isMultiDrag){YK=ZS({},r);var o=x9(jh,!0);YK.top-=o.f,YK.left-=o.e}},dragOverAnimationComplete:function(){R_&&(R_=!1,Bpe())},drop:function(t){var r=t.originalEvent,n=t.rootEl,s=t.parentEl,o=t.sortable,a=t.dispatchSortableEvent,l=t.oldIndex,u=t.putSortable,c=u||this.sortable;if(r){var h=this.options,p=s.children;if(!lG)if(h.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),cp(jh,h.selectedClass,!~el.indexOf(jh)),~el.indexOf(jh))el.splice(el.indexOf(jh),1),WK=null,Ite({sortable:o,rootEl:n,name:"deselect",targetEl:jh,originalEvt:r});else{if(el.push(jh),Ite({sortable:o,rootEl:n,name:"select",targetEl:jh,originalEvt:r}),r.shiftKey&&WK&&o.el.contains(WK)){var m=Gp(WK),v=Gp(jh);if(~m&&~v&&m!==v){var w,S;for(v>m?(S=m,w=v):(S=v,w=m+1);S1){var I=jd(jh),R=Gp(jh,":not(."+this.options.selectedClass+")");if(!qK&&h.animation&&(jh.thisAnimationDuration=null),c.captureAnimationState(),!qK&&(h.animation&&(jh.fromRect=I,el.forEach(function(k){if(k.thisAnimationDuration=null,k!==jh){var B=R_?jd(k):I;k.fromRect=B,c.addAnimationState({target:k,rect:B})}})),Bpe(),el.forEach(function(k){p[R]?s.insertBefore(k,p[R]):s.appendChild(k),R++}),l===Gp(jh))){var L=!1;el.forEach(function(k){if(k.sortableIndex!==Gp(k)){L=!0;return}}),L&&a("update")}el.forEach(function(k){PRe(k)}),c.animateAll()}CT=c}(n===s||u&&u.lastPutMode!=="clone")&&Ow.forEach(function(k){k.parentNode&&k.parentNode.removeChild(k)})}},nullingGlobal:function(){this.isMultiDrag=lG=!1,Ow.length=0},destroyGlobal:function(){this._deselectMultiDrag(),su(document,"pointerup",this._deselectMultiDrag),su(document,"mouseup",this._deselectMultiDrag),su(document,"touchend",this._deselectMultiDrag),su(document,"keydown",this._checkKeyDown),su(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(typeof lG<"u"&&lG)&&CT===this.sortable&&!(t&&_C(t.target,this.options.draggable,this.sortable.el,!1))&&!(t&&t.button!==0))for(;el.length;){var r=el[0];cp(r,this.options.selectedClass,!1),el.shift(),Ite({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:r,originalEvt:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},ZS(i,{pluginName:"multiDrag",utils:{select:function(t){var r=t.parentNode[Rv];!r||!r.options.multiDrag||~el.indexOf(t)||(CT&&CT!==r&&(CT.multiDrag._deselectMultiDrag(),CT=r),cp(t,r.options.selectedClass,!0),el.push(t))},deselect:function(t){var r=t.parentNode[Rv],n=el.indexOf(t);!r||!r.options.multiDrag||!~n||(cp(t,r.options.selectedClass,!1),el.splice(n,1))}},eventProperties:function(){var t=this,r=[],n=[];return el.forEach(function(s){r.push({multiDragElement:s,index:s.sortableIndex});var o;R_&&s!==jh?o=-1:R_?o=Gp(s,":not(."+t.options.selectedClass+")"):o=Gp(s),n.push({multiDragElement:s,index:o})}),{items:VOn(el),clones:[].concat(Ow),oldIndicies:r,newIndicies:n}},optionListeners:{multiDragKey:function(t){return t=t.toLowerCase(),t==="ctrl"?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function wPn(i,e){el.forEach(function(t,r){var n=e.children[t.sortableIndex+(i?Number(r):0)];n?e.insertBefore(t,n):e.appendChild(t)})}function k_t(i,e){Ow.forEach(function(t,r){var n=e.children[t.sortableIndex+(i?Number(r):0)];n?e.insertBefore(t,n):e.appendChild(t)})}function Bpe(){el.forEach(function(i){i!==jh&&i.parentNode&&i.parentNode.removeChild(i)})}ga.mount(new yPn);ga.mount(_Ze,vZe);const xPn=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:bPn,Sortable:ga,Swap:vPn,default:ga},Symbol.toStringTag,{value:"Module"})),SPn=wSe(xPn);(function(i,e){(function(r,n){i.exports=n(mZe,SPn)})(typeof self<"u"?self:Hh,function(t,r){return function(n){var s={};function o(a){if(s[a])return s[a].exports;var l=s[a]={i:a,l:!1,exports:{}};return n[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=n,o.c=s,o.d=function(a,l,u){o.o(a,l)||Object.defineProperty(a,l,{enumerable:!0,get:u})},o.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},o.t=function(a,l){if(l&1&&(a=o(a)),l&8||l&4&&typeof a=="object"&&a&&a.__esModule)return a;var u=Object.create(null);if(o.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:a}),l&2&&typeof a!="string")for(var c in a)o.d(u,c,function(h){return a[h]}.bind(null,c));return u},o.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(l,"a",l),l},o.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},o.p="",o(o.s="fb15")}({"00ee":function(n,s,o){var a=o("b622"),l=a("toStringTag"),u={};u[l]="z",n.exports=String(u)==="[object z]"},"0366":function(n,s,o){var a=o("1c0b");n.exports=function(l,u,c){if(a(l),u===void 0)return l;switch(c){case 0:return function(){return l.call(u)};case 1:return function(h){return l.call(u,h)};case 2:return function(h,p){return l.call(u,h,p)};case 3:return function(h,p,m){return l.call(u,h,p,m)}}return function(){return l.apply(u,arguments)}}},"057f":function(n,s,o){var a=o("fc6a"),l=o("241c").f,u={}.toString,c=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(p){try{return l(p)}catch{return c.slice()}};n.exports.f=function(m){return c&&u.call(m)=="[object Window]"?h(m):l(a(m))}},"06cf":function(n,s,o){var a=o("83ab"),l=o("d1e7"),u=o("5c6c"),c=o("fc6a"),h=o("c04e"),p=o("5135"),m=o("0cfb"),v=Object.getOwnPropertyDescriptor;s.f=a?v:function(S,I){if(S=c(S),I=h(I,!0),m)try{return v(S,I)}catch{}if(p(S,I))return u(!l.f.call(S,I),S[I])}},"0cfb":function(n,s,o){var a=o("83ab"),l=o("d039"),u=o("cc12");n.exports=!a&&!l(function(){return Object.defineProperty(u("div"),"a",{get:function(){return 7}}).a!=7})},"13d5":function(n,s,o){var a=o("23e7"),l=o("d58f").left,u=o("a640"),c=o("ae40"),h=u("reduce"),p=c("reduce",{1:0});a({target:"Array",proto:!0,forced:!h||!p},{reduce:function(v){return l(this,v,arguments.length,arguments.length>1?arguments[1]:void 0)}})},"14c3":function(n,s,o){var a=o("c6b6"),l=o("9263");n.exports=function(u,c){var h=u.exec;if(typeof h=="function"){var p=h.call(u,c);if(typeof p!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return p}if(a(u)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return l.call(u,c)}},"159b":function(n,s,o){var a=o("da84"),l=o("fdbc"),u=o("17c2"),c=o("9112");for(var h in l){var p=a[h],m=p&&p.prototype;if(m&&m.forEach!==u)try{c(m,"forEach",u)}catch{m.forEach=u}}},"17c2":function(n,s,o){var a=o("b727").forEach,l=o("a640"),u=o("ae40"),c=l("forEach"),h=u("forEach");n.exports=!c||!h?function(m){return a(this,m,arguments.length>1?arguments[1]:void 0)}:[].forEach},"1be4":function(n,s,o){var a=o("d066");n.exports=a("document","documentElement")},"1c0b":function(n,s){n.exports=function(o){if(typeof o!="function")throw TypeError(String(o)+" is not a function");return o}},"1c7e":function(n,s,o){var a=o("b622"),l=a("iterator"),u=!1;try{var c=0,h={next:function(){return{done:!!c++}},return:function(){u=!0}};h[l]=function(){return this},Array.from(h,function(){throw 2})}catch{}n.exports=function(p,m){if(!m&&!u)return!1;var v=!1;try{var w={};w[l]=function(){return{next:function(){return{done:v=!0}}}},p(w)}catch{}return v}},"1d80":function(n,s){n.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},"1dde":function(n,s,o){var a=o("d039"),l=o("b622"),u=o("2d00"),c=l("species");n.exports=function(h){return u>=51||!a(function(){var p=[],m=p.constructor={};return m[c]=function(){return{foo:1}},p[h](Boolean).foo!==1})}},"23cb":function(n,s,o){var a=o("a691"),l=Math.max,u=Math.min;n.exports=function(c,h){var p=a(c);return p<0?l(p+h,0):u(p,h)}},"23e7":function(n,s,o){var a=o("da84"),l=o("06cf").f,u=o("9112"),c=o("6eeb"),h=o("ce4e"),p=o("e893"),m=o("94ca");n.exports=function(v,w){var S=v.target,I=v.global,R=v.stat,L,k,B,$,V,Y;if(I?k=a:R?k=a[S]||h(S,{}):k=(a[S]||{}).prototype,k)for(B in w){if(V=w[B],v.noTargetGet?(Y=l(k,B),$=Y&&Y.value):$=k[B],L=m(I?B:S+(R?".":"#")+B,v.forced),!L&&$!==void 0){if(typeof V==typeof $)continue;p(V,$)}(v.sham||$&&$.sham)&&u(V,"sham",!0),c(k,B,V,v)}}},"241c":function(n,s,o){var a=o("ca84"),l=o("7839"),u=l.concat("length","prototype");s.f=Object.getOwnPropertyNames||function(h){return a(h,u)}},"25f0":function(n,s,o){var a=o("6eeb"),l=o("825a"),u=o("d039"),c=o("ad6d"),h="toString",p=RegExp.prototype,m=p[h],v=u(function(){return m.call({source:"a",flags:"b"})!="/a/b"}),w=m.name!=h;(v||w)&&a(RegExp.prototype,h,function(){var I=l(this),R=String(I.source),L=I.flags,k=String(L===void 0&&I instanceof RegExp&&!("flags"in p)?c.call(I):L);return"/"+R+"/"+k},{unsafe:!0})},"2ca0":function(n,s,o){var a=o("23e7"),l=o("06cf").f,u=o("50c4"),c=o("5a34"),h=o("1d80"),p=o("ab13"),m=o("c430"),v="".startsWith,w=Math.min,S=p("startsWith"),I=!m&&!S&&!!function(){var R=l(String.prototype,"startsWith");return R&&!R.writable}();a({target:"String",proto:!0,forced:!I&&!S},{startsWith:function(L){var k=String(h(this));c(L);var B=u(w(arguments.length>1?arguments[1]:void 0,k.length)),$=String(L);return v?v.call(k,$,B):k.slice(B,B+$.length)===$}})},"2d00":function(n,s,o){var a=o("da84"),l=o("342f"),u=a.process,c=u&&u.versions,h=c&&c.v8,p,m;h?(p=h.split("."),m=p[0]+p[1]):l&&(p=l.match(/Edge\/(\d+)/),(!p||p[1]>=74)&&(p=l.match(/Chrome\/(\d+)/),p&&(m=p[1]))),n.exports=m&&+m},"342f":function(n,s,o){var a=o("d066");n.exports=a("navigator","userAgent")||""},"35a1":function(n,s,o){var a=o("f5df"),l=o("3f8c"),u=o("b622"),c=u("iterator");n.exports=function(h){if(h!=null)return h[c]||h["@@iterator"]||l[a(h)]}},"37e8":function(n,s,o){var a=o("83ab"),l=o("9bf2"),u=o("825a"),c=o("df75");n.exports=a?Object.defineProperties:function(p,m){u(p);for(var v=c(m),w=v.length,S=0,I;w>S;)l.f(p,I=v[S++],m[I]);return p}},"3bbe":function(n,s,o){var a=o("861d");n.exports=function(l){if(!a(l)&&l!==null)throw TypeError("Can't set "+String(l)+" as a prototype");return l}},"3ca3":function(n,s,o){var a=o("6547").charAt,l=o("69f3"),u=o("7dd0"),c="String Iterator",h=l.set,p=l.getterFor(c);u(String,"String",function(m){h(this,{type:c,string:String(m),index:0})},function(){var v=p(this),w=v.string,S=v.index,I;return S>=w.length?{value:void 0,done:!0}:(I=a(w,S),v.index+=I.length,{value:I,done:!1})})},"3f8c":function(n,s){n.exports={}},4160:function(n,s,o){var a=o("23e7"),l=o("17c2");a({target:"Array",proto:!0,forced:[].forEach!=l},{forEach:l})},"428f":function(n,s,o){var a=o("da84");n.exports=a},"44ad":function(n,s,o){var a=o("d039"),l=o("c6b6"),u="".split;n.exports=a(function(){return!Object("z").propertyIsEnumerable(0)})?function(c){return l(c)=="String"?u.call(c,""):Object(c)}:Object},"44d2":function(n,s,o){var a=o("b622"),l=o("7c73"),u=o("9bf2"),c=a("unscopables"),h=Array.prototype;h[c]==null&&u.f(h,c,{configurable:!0,value:l(null)}),n.exports=function(p){h[c][p]=!0}},"44e7":function(n,s,o){var a=o("861d"),l=o("c6b6"),u=o("b622"),c=u("match");n.exports=function(h){var p;return a(h)&&((p=h[c])!==void 0?!!p:l(h)=="RegExp")}},4930:function(n,s,o){var a=o("d039");n.exports=!!Object.getOwnPropertySymbols&&!a(function(){return!String(Symbol())})},"4d64":function(n,s,o){var a=o("fc6a"),l=o("50c4"),u=o("23cb"),c=function(h){return function(p,m,v){var w=a(p),S=l(w.length),I=u(v,S),R;if(h&&m!=m){for(;S>I;)if(R=w[I++],R!=R)return!0}else for(;S>I;I++)if((h||I in w)&&w[I]===m)return h||I||0;return!h&&-1}};n.exports={includes:c(!0),indexOf:c(!1)}},"4de4":function(n,s,o){var a=o("23e7"),l=o("b727").filter,u=o("1dde"),c=o("ae40"),h=u("filter"),p=c("filter");a({target:"Array",proto:!0,forced:!h||!p},{filter:function(v){return l(this,v,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(n,s,o){var a=o("0366"),l=o("7b0b"),u=o("9bdd"),c=o("e95a"),h=o("50c4"),p=o("8418"),m=o("35a1");n.exports=function(w){var S=l(w),I=typeof this=="function"?this:Array,R=arguments.length,L=R>1?arguments[1]:void 0,k=L!==void 0,B=m(S),$=0,V,Y,K,Q,re,ne;if(k&&(L=a(L,R>2?arguments[2]:void 0,2)),B!=null&&!(I==Array&&c(B)))for(Q=B.call(S),re=Q.next,Y=new I;!(K=re.call(Q)).done;$++)ne=k?u(Q,L,[K.value,$],!0):K.value,p(Y,$,ne);else for(V=h(S.length),Y=new I(V);V>$;$++)ne=k?L(S[$],$):S[$],p(Y,$,ne);return Y.length=$,Y}},"4fad":function(n,s,o){var a=o("23e7"),l=o("6f53").entries;a({target:"Object",stat:!0},{entries:function(c){return l(c)}})},"50c4":function(n,s,o){var a=o("a691"),l=Math.min;n.exports=function(u){return u>0?l(a(u),9007199254740991):0}},5135:function(n,s){var o={}.hasOwnProperty;n.exports=function(a,l){return o.call(a,l)}},5319:function(n,s,o){var a=o("d784"),l=o("825a"),u=o("7b0b"),c=o("50c4"),h=o("a691"),p=o("1d80"),m=o("8aa5"),v=o("14c3"),w=Math.max,S=Math.min,I=Math.floor,R=/\$([$&'`]|\d\d?|<[^>]*>)/g,L=/\$([$&'`]|\d\d?)/g,k=function(B){return B===void 0?B:String(B)};a("replace",2,function(B,$,V,Y){var K=Y.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,Q=Y.REPLACE_KEEPS_$0,re=K?"$":"$0";return[function(pe,H){var Z=p(this),ae=pe?.[B];return ae!==void 0?ae.call(pe,Z,H):$.call(String(Z),pe,H)},function(de,pe){if(!K&&Q||typeof pe=="string"&&pe.indexOf(re)===-1){var H=V($,de,this,pe);if(H.done)return H.value}var Z=l(de),ae=String(this),fe=typeof pe=="function";fe||(pe=String(pe));var be=Z.global;if(be){var _e=Z.unicode;Z.lastIndex=0}for(var Ie=[];;){var Te=v(Z,ae);if(Te===null||(Ie.push(Te),!be))break;var Be=String(Te[0]);Be===""&&(Z.lastIndex=m(ae,c(Z.lastIndex),_e))}for(var Ve="",$e=0,tt=0;tt=$e&&(Ve+=ae.slice($e,Ct)+it,$e=Ct+yt.length)}return Ve+ae.slice($e)}];function ne(de,pe,H,Z,ae,fe){var be=H+de.length,_e=Z.length,Ie=L;return ae!==void 0&&(ae=u(ae),Ie=R),$.call(fe,Ie,function(Te,Be){var Ve;switch(Be.charAt(0)){case"$":return"$";case"&":return de;case"`":return pe.slice(0,H);case"'":return pe.slice(be);case"<":Ve=ae[Be.slice(1,-1)];break;default:var $e=+Be;if($e===0)return Te;if($e>_e){var tt=I($e/10);return tt===0?Te:tt<=_e?Z[tt-1]===void 0?Be.charAt(1):Z[tt-1]+Be.charAt(1):Te}Ve=Z[$e-1]}return Ve===void 0?"":Ve})}})},5692:function(n,s,o){var a=o("c430"),l=o("c6cd");(n.exports=function(u,c){return l[u]||(l[u]=c!==void 0?c:{})})("versions",[]).push({version:"3.6.5",mode:a?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(n,s,o){var a=o("d066"),l=o("241c"),u=o("7418"),c=o("825a");n.exports=a("Reflect","ownKeys")||function(p){var m=l.f(c(p)),v=u.f;return v?m.concat(v(p)):m}},"5a34":function(n,s,o){var a=o("44e7");n.exports=function(l){if(a(l))throw TypeError("The method doesn't accept regular expressions");return l}},"5c6c":function(n,s){n.exports=function(o,a){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:a}}},"5db7":function(n,s,o){var a=o("23e7"),l=o("a2bf"),u=o("7b0b"),c=o("50c4"),h=o("1c0b"),p=o("65f0");a({target:"Array",proto:!0},{flatMap:function(v){var w=u(this),S=c(w.length),I;return h(v),I=p(w,0),I.length=l(I,w,w,S,0,1,v,arguments.length>1?arguments[1]:void 0),I}})},6547:function(n,s,o){var a=o("a691"),l=o("1d80"),u=function(c){return function(h,p){var m=String(l(h)),v=a(p),w=m.length,S,I;return v<0||v>=w?c?"":void 0:(S=m.charCodeAt(v),S<55296||S>56319||v+1===w||(I=m.charCodeAt(v+1))<56320||I>57343?c?m.charAt(v):S:c?m.slice(v,v+2):(S-55296<<10)+(I-56320)+65536)}};n.exports={codeAt:u(!1),charAt:u(!0)}},"65f0":function(n,s,o){var a=o("861d"),l=o("e8b5"),u=o("b622"),c=u("species");n.exports=function(h,p){var m;return l(h)&&(m=h.constructor,typeof m=="function"&&(m===Array||l(m.prototype))?m=void 0:a(m)&&(m=m[c],m===null&&(m=void 0))),new(m===void 0?Array:m)(p===0?0:p)}},"69f3":function(n,s,o){var a=o("7f9a"),l=o("da84"),u=o("861d"),c=o("9112"),h=o("5135"),p=o("f772"),m=o("d012"),v=l.WeakMap,w,S,I,R=function(K){return I(K)?S(K):w(K,{})},L=function(K){return function(Q){var re;if(!u(Q)||(re=S(Q)).type!==K)throw TypeError("Incompatible receiver, "+K+" required");return re}};if(a){var k=new v,B=k.get,$=k.has,V=k.set;w=function(K,Q){return V.call(k,K,Q),Q},S=function(K){return B.call(k,K)||{}},I=function(K){return $.call(k,K)}}else{var Y=p("state");m[Y]=!0,w=function(K,Q){return c(K,Y,Q),Q},S=function(K){return h(K,Y)?K[Y]:{}},I=function(K){return h(K,Y)}}n.exports={set:w,get:S,has:I,enforce:R,getterFor:L}},"6eeb":function(n,s,o){var a=o("da84"),l=o("9112"),u=o("5135"),c=o("ce4e"),h=o("8925"),p=o("69f3"),m=p.get,v=p.enforce,w=String(String).split("String");(n.exports=function(S,I,R,L){var k=L?!!L.unsafe:!1,B=L?!!L.enumerable:!1,$=L?!!L.noTargetGet:!1;if(typeof R=="function"&&(typeof I=="string"&&!u(R,"name")&&l(R,"name",I),v(R).source=w.join(typeof I=="string"?I:"")),S===a){B?S[I]=R:c(I,R);return}else k?!$&&S[I]&&(B=!0):delete S[I];B?S[I]=R:l(S,I,R)})(Function.prototype,"toString",function(){return typeof this=="function"&&m(this).source||h(this)})},"6f53":function(n,s,o){var a=o("83ab"),l=o("df75"),u=o("fc6a"),c=o("d1e7").f,h=function(p){return function(m){for(var v=u(m),w=l(v),S=w.length,I=0,R=[],L;S>I;)L=w[I++],(!a||c.call(v,L))&&R.push(p?[L,v[L]]:v[L]);return R}};n.exports={entries:h(!0),values:h(!1)}},"73d9":function(n,s,o){var a=o("44d2");a("flatMap")},7418:function(n,s){s.f=Object.getOwnPropertySymbols},"746f":function(n,s,o){var a=o("428f"),l=o("5135"),u=o("e538"),c=o("9bf2").f;n.exports=function(h){var p=a.Symbol||(a.Symbol={});l(p,h)||c(p,h,{value:u.f(h)})}},7839:function(n,s){n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(n,s,o){var a=o("1d80");n.exports=function(l){return Object(a(l))}},"7c73":function(n,s,o){var a=o("825a"),l=o("37e8"),u=o("7839"),c=o("d012"),h=o("1be4"),p=o("cc12"),m=o("f772"),v=">",w="<",S="prototype",I="script",R=m("IE_PROTO"),L=function(){},k=function(K){return w+I+v+K+w+"/"+I+v},B=function(K){K.write(k("")),K.close();var Q=K.parentWindow.Object;return K=null,Q},$=function(){var K=p("iframe"),Q="java"+I+":",re;return K.style.display="none",h.appendChild(K),K.src=String(Q),re=K.contentWindow.document,re.open(),re.write(k("document.F=Object")),re.close(),re.F},V,Y=function(){try{V=document.domain&&new ActiveXObject("htmlfile")}catch{}Y=V?B(V):$();for(var K=u.length;K--;)delete Y[S][u[K]];return Y()};c[R]=!0,n.exports=Object.create||function(Q,re){var ne;return Q!==null?(L[S]=a(Q),ne=new L,L[S]=null,ne[R]=Q):ne=Y(),re===void 0?ne:l(ne,re)}},"7dd0":function(n,s,o){var a=o("23e7"),l=o("9ed3"),u=o("e163"),c=o("d2bb"),h=o("d44e"),p=o("9112"),m=o("6eeb"),v=o("b622"),w=o("c430"),S=o("3f8c"),I=o("ae93"),R=I.IteratorPrototype,L=I.BUGGY_SAFARI_ITERATORS,k=v("iterator"),B="keys",$="values",V="entries",Y=function(){return this};n.exports=function(K,Q,re,ne,de,pe,H){l(re,Q,ne);var Z=function(tt){if(tt===de&&Ie)return Ie;if(!L&&tt in be)return be[tt];switch(tt){case B:return function(){return new re(this,tt)};case $:return function(){return new re(this,tt)};case V:return function(){return new re(this,tt)}}return function(){return new re(this)}},ae=Q+" Iterator",fe=!1,be=K.prototype,_e=be[k]||be["@@iterator"]||de&&be[de],Ie=!L&&_e||Z(de),Te=Q=="Array"&&be.entries||_e,Be,Ve,$e;if(Te&&(Be=u(Te.call(new K)),R!==Object.prototype&&Be.next&&(!w&&u(Be)!==R&&(c?c(Be,R):typeof Be[k]!="function"&&p(Be,k,Y)),h(Be,ae,!0,!0),w&&(S[ae]=Y))),de==$&&_e&&_e.name!==$&&(fe=!0,Ie=function(){return _e.call(this)}),(!w||H)&&be[k]!==Ie&&p(be,k,Ie),S[Q]=Ie,de)if(Ve={values:Z($),keys:pe?Ie:Z(B),entries:Z(V)},H)for($e in Ve)(L||fe||!($e in be))&&m(be,$e,Ve[$e]);else a({target:Q,proto:!0,forced:L||fe},Ve);return Ve}},"7f9a":function(n,s,o){var a=o("da84"),l=o("8925"),u=a.WeakMap;n.exports=typeof u=="function"&&/native code/.test(l(u))},"825a":function(n,s,o){var a=o("861d");n.exports=function(l){if(!a(l))throw TypeError(String(l)+" is not an object");return l}},"83ab":function(n,s,o){var a=o("d039");n.exports=!a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})},8418:function(n,s,o){var a=o("c04e"),l=o("9bf2"),u=o("5c6c");n.exports=function(c,h,p){var m=a(h);m in c?l.f(c,m,u(0,p)):c[m]=p}},"861d":function(n,s){n.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},8875:function(n,s,o){var a,l,u;(function(c,h){l=[],a=h,u=typeof a=="function"?a.apply(s,l):a,u!==void 0&&(n.exports=u)})(typeof self<"u"?self:this,function(){function c(){var h=Object.getOwnPropertyDescriptor(document,"currentScript");if(!h&&"currentScript"in document&&document.currentScript||h&&h.get!==c&&document.currentScript)return document.currentScript;try{throw new Error}catch(V){var p=/.*at [^(]*\((.*):(.+):(.+)\)$/ig,m=/@([^@]*):(\d+):(\d+)\s*$/ig,v=p.exec(V.stack)||m.exec(V.stack),w=v&&v[1]||!1,S=v&&v[2]||!1,I=document.location.href.replace(document.location.hash,""),R,L,k,B=document.getElementsByTagName("script");w===I&&(R=document.documentElement.outerHTML,L=new RegExp("(?:[^\\n]+?\\n){0,"+(S-2)+"}[^<]* - + diff --git a/toc-sublists/index-ca-fr.html b/toc-sublists/index-ca-fr.html index 7b7f7213..cce49afb 100644 --- a/toc-sublists/index-ca-fr.html +++ b/toc-sublists/index-ca-fr.html @@ -15,7 +15,7 @@ src="https://www.canada.ca/etc/designs/canada/cdts/gcweb/v5_0_2/cdts/compiled/wet-fr.js" data-cdts-setup='{"cdnEnv": "prod"}' > - + diff --git a/toc-sublists/index.html b/toc-sublists/index.html index b88163bd..9f25d817 100644 --- a/toc-sublists/index.html +++ b/toc-sublists/index.html @@ -8,7 +8,7 @@ RAMP Storylines - +